/** * Shared tool dispatch — single source of truth mapping a tool name + args to its * handler. Consumed by BOTH transports: * - the stdio MCP server (`src/cli/commands/mcp.ts`) * - the local HTTP daemon (`src/cli/commands/serve.ts`) * * Keeping one dispatch table here prevents the two transports from drifting as * handlers are added or their signatures change. This function is intentionally * pure: it resolves args → handler → result and nothing else. Transport concerns * (input validation, telemetry, epistemic/panic tracking, output truncation) stay * in the caller. * * `directory` is passed explicitly (already resolved from `args.directory` by the * caller) but most branches re-read it from `args` to preserve the exact behaviour * the MCP server had before this extraction. */ /** Thrown when a tool name has no registered handler. Callers map this to their * transport's "unknown tool" response (isError result / HTTP 404). */ export declare class UnknownToolError extends Error { readonly toolName: string; constructor(toolName: string); } /** * Resolve a tool call to its result. Throws {@link UnknownToolError} for an * unregistered name; propagates any handler error unchanged. * * Note on `directory`: most branches destructure `const { directory } = args` * which shadows the top-level param. This is intentional — it preserves the * exact pre-extraction behaviour where handlers read directory from args. The * top-level param is used only by handlers that don't re-destructure (orient, * search_code, suggest_insertion_points). Callers must ensure args.directory * and the directory param are the same resolved path. */ export declare function dispatchTool(name: string, args: Record, directory: string): Promise; //# sourceMappingURL=tool-dispatch.d.ts.map