/** * Decision Auto-Capture Middleware * * Wraps MCP tool handlers to automatically emit vcs:decisionRecord ops * for every tool invocation. Pre/post hooks can enrich the trace with * rationale, alternatives, and prompt context. */ import type { HookRegistry } from './hooks.js'; import type { DecisionInput } from './types.js'; /** A generic MCP tool handler: receives params, returns a result. */ export type ToolHandler = (params: Record) => Promise; /** Callback invoked after auto-capture builds the DecisionInput. */ export type DecisionRecorder = (decision: DecisionInput) => Promise; export interface AutoCaptureOpts { /** The hook registry for pre/post enrichment. */ hooks: HookRegistry; /** Called to persist the decision as a VcsOp. */ recorder: DecisionRecorder; /** Tool names to exclude from auto-capture (e.g. read-only queries). */ exclude?: Set; } /** * Wrap an MCP tool handler for automatic decision trace capture. */ export declare function wrapToolHandler(toolName: string, handler: ToolHandler, opts: AutoCaptureOpts): ToolHandler; /** * Summarize a tool result to a concise string (max 500 chars). */ declare function summarize(result: unknown): string; export { summarize as _summarizeForTest }; //# sourceMappingURL=auto-capture.d.ts.map