Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
983 B ยท 29 lines
TypeScript
at incident-api
123456789101112131415161718192021222324252627282930import type { AnyAgentTool } from "@openstatus/services/agent-tools";
const VERB_PREFIXES: Array<[string, string]> = [ ["create_", "created"], ["update_", "updated"], ["resolve_", "resolved"], ["add_", "added"],];
function inferVerb(toolName: string): string { const match = VERB_PREFIXES.find(([prefix]) => toolName.startsWith(prefix)); return match?.[1] ?? "done";}
/** * Fallback presenter. Uses `approval.summarize().title` for the headline * and `approval.verb` (or an inference from the tool name) for the verb. */export function defaultPresenter(args: { tool: AnyAgentTool; input: unknown; notify: boolean;}): string { if (!args.tool.approval) return ":white_check_mark: Done."; const summary = args.tool.approval.summarize(args.input); const verb = args.tool.approval.verb ?? inferVerb(args.tool.name); const notifyTail = args.notify ? " Subscribers notified." : ""; return `:white_check_mark: ${summary.title} ${verb}.${notifyTail}`;}