/** * Tool-call observability plane — the events half. One origin-uniform `tool.called` record * across every dispatch site (the gateway agent tool hook, the Senpi MCP client), so a single * query spans agent + MCP tool use. The trace plane already covers these calls (auto HTTP/undici * client spans + the manual `execute_tool`/`tools/call` semantic spans), so this adds events only. * * Anti-bloat: only abnormal calls are evented here — a failed tool call (`error`) or a drift/ * hallucinated one (`unknown`). Successful calls (and hot-path polls) stay on the span/metric * planes: a successful state-changing call already emits a richer domain event (`position.opened`, * `order.placed`, …), and "most-called / heaviest" is a metric-plane question. The schema lives * here once so the keys stay identical across origins (the metric plane adds `mcp`/`decision`). */ export type ToolOrigin = "agent" | "mcp"; export type ToolOutcome = "ok" | "error" | "unknown" | "denied"; /** Emit the origin-uniform `tool.called` event. Abnormal outcomes escalate the level to `warn`. */ export declare function emitToolCalled(opts: { name: string; origin: ToolOrigin; outcome: ToolOutcome; errorType?: string; errorMessage?: string; }): void; /** * The tool names a turn was OFFERED, from the `llm_input` `tools` definitions — the baseline the * drift alarm diffs against. Tolerates the bare `{ name }` and OpenAI `{ function: { name } }` * definition shapes. Empty when no definitions were captured (e.g. conversation access is off). */ export declare function offeredToolNames(tools: unknown): Set; /** The tool names a turn REQUESTED, read from the normalized gen_ai output messages (`parts[].tool_call`). */ export declare function requestedToolNames(outputMessages: unknown): string[]; //# sourceMappingURL=tool-plane.d.ts.map