/**
 * Tool Sanitization Proxy
 *
 * HTTP proxy that intercepts Claude CLI → CLIProxy requests to:
 * 1. Sanitize MCP tool names exceeding Gemini's 64-char limit
 * 2. Sanitize MCP tool input_schema to remove non-standard JSON Schema properties
 * 3. Forward sanitized requests to upstream
 * 4. 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;
    /** Skip TLS certificate validation for self-signed remote HTTPS proxies */
    allowSelfSigned?: boolean;
}
export declare class ToolSanitizationProxy {
    private server;
    private port;
    private readonly config;
    private readonly logFilePath;
    private readonly debugMode;
    private readonly logger;
    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<number>;
    /**
     * 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 startResponseTimeout;
    private buildRequestOptions;
    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;
    /**
     * Build a synthetic minimal SSE response when upstream returns empty content.
     * Prevents Claude Code from crashing with "No assistant message found".
     * Omits lifecycle events that upstream already sent to avoid protocol violations.
     */
    private buildSyntheticErrorResponse;
}
//# sourceMappingURL=tool-sanitization-proxy.d.ts.map