/** * Tool registration guard. * * Enforces CONSTITUTION rule 3 — "every project_path input goes through * validateProjectPath()" — by construction rather than by convention: * once applied, ANY registered tool whose arguments include a string * `project_path` has it validated and canonicalised before the handler * runs, so individual handlers cannot forget the check. Handlers always * receive a resolved, existing directory path. * * @module tool-guard */ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; export interface ProjectPathGuardOptions { /** * When set, every project_path must resolve inside this directory * (symlinks included). Wire to VASPERA_PATH_BOUNDARY for deployments * that should never scan outside a workspace root. */ basePath?: string; } type ToolHandler = (...handlerArgs: unknown[]) => unknown; export interface ToolAnnotationsSummary { readOnlyHint?: boolean; destructiveHint?: boolean; } /** * Registry of every registered tool's annotations, populated as tools * are registered. The HTTP transport uses it to decide which tools may * be invoked remotely (read-only by default). */ export declare const toolAnnotations: Map; /** Minimal structural view of McpServer used by the guard (method syntax * keeps it bivariant so both real and fake servers are accepted). */ export interface ToolRegistrar { registerTool(name: string, config: unknown, handler: ToolHandler): unknown; } export declare function applyProjectPathGuard(server: McpServer | ToolRegistrar, options?: ProjectPathGuardOptions): void; export {}; //# sourceMappingURL=tool-guard.d.ts.map