/** * @module memory/auto-record * @description Automatic tool call recording hook. * * Wraps the MCP tool handler to automatically record every tool call in the * local memory database — no agent action required. The hook measures * latency, captures the outcome, and stores truncated input/output. * * The hook is designed to be non-blocking: if the memory DB is degraded or * the recording fails, the tool call proceeds normally. Recording errors * are logged but never propagated to the caller. */ /** * @name AutoRecordResult * @description Result of a tool call with metadata for recording. */ export interface AutoRecordResult { /** The original tool result text. */ result: string; /** Whether the result indicates an error. */ isError: boolean; } /** * @name recordToolCall * @description Records a tool call execution in the memory database. * * This function is called after every tool handler executes. It captures: * - toolName: the MCP tool name * - input: JSON-serialized input (truncated to 8KB) * - output: JSON-serialized output (truncated to 8KB) * - outcome: 'success' | 'error' | 'partial' * - latencyMs: wall-clock time from start to finish * - costUsd: estimated from the pricing tier (if available) * - txSignature: extracted from the output if present * * The function never throws — recording failures are logged and swallowed. * * @param toolName - The MCP tool name. * @param input - The raw input object passed to the tool. * @param output - The tool result text. * @param isError - Whether the tool returned an error. * @param latencyMs - Execution latency in milliseconds. * @param sessionId - Optional session identifier. * @param callerProfile - Optional signer profile. */ export declare function recordToolCall(toolName: string, input: unknown, output: string, isError: boolean, latencyMs: number, sessionId?: string, callerProfile?: string): void; //# sourceMappingURL=auto-record.d.ts.map