/** * Tool Sanitization Proxy * * HTTP proxy that intercepts Claude CLI → CLIProxy requests to: * 1. Sanitize MCP tool names exceeding Gemini's 64-char limit * 2. Forward sanitized requests to upstream * 3. Restore original names in responses * * Follows CodexReasoningProxy pattern for consistency. */ export interface ToolSanitizationProxyConfig { /** Upstream CLIProxy URL */ upstreamBaseUrl: string; /** Enable verbose logging */ verbose?: boolean; /** Log warnings when sanitization occurs */ warnOnSanitize?: boolean; /** Request timeout in milliseconds */ timeoutMs?: number; } export declare class ToolSanitizationProxy { private server; private port; private readonly config; private readonly logFilePath; private readonly debugMode; constructor(config: ToolSanitizationProxyConfig); /** * Initialize log file path and ensure directory exists. */ private initLogFile; /** * Write log entry to file (always) and console (if CCS_DEBUG=1). */ private writeLog; private log; private warn; /** * Start the proxy server on an ephemeral port. * @returns The assigned port number */ start(): Promise; /** * Stop the proxy server. */ stop(): void; /** * Get the port the proxy is listening on. */ getPort(): number | null; private readBody; private handleRequest; private buildForwardHeaders; private getRequestFn; private forwardRaw; /** * Forward JSON request and buffer response for tool name restoration. */ private forwardJsonBuffered; /** * Forward JSON request and stream response with tool name restoration. * Handles SSE (Server-Sent Events) format. */ private forwardJsonStreaming; /** * Process a single SSE event, restoring tool names if present. */ private processSSEEvent; } //# sourceMappingURL=tool-sanitization-proxy.d.ts.map