/**
 * Persistent Server Executor
 *
 * This executor communicates with a long-lived Swift server process via
 * Unix domain socket and JSON-RPC protocol. Used when tools are needed
 * to enable bidirectional communication during generation.
 *
 * Performance characteristics:
 * - First call: ~1.2s (includes server startup)
 * - Subsequent calls: ~0.7s (no spawn overhead)
 * - Tool callbacks: Real-time bidirectional communication
 * - Cleanup required: Must call close() to shutdown server
 */
import type { Executor } from '../executor-interface.js';
import type { Tool } from '../types.js';
export declare class PersistentServerExecutor implements Executor {
    private socket?;
    private serverProcess?;
    private tools;
    private socketPath;
    private messageHandlers;
    private connected;
    private connecting;
    constructor(tools: Tool[]);
    /**
     * Ensure connection to Swift server
     * Starts server if not running and connects socket
     */
    private ensureConnected;
    /**
     * Start the Swift server process
     */
    private startServer;
    /**
     * Wait for Unix socket file to exist
     */
    private waitForSocket;
    /**
     * Connect to the Unix socket
     */
    private connectSocket;
    /**
     * Send tool definitions to Swift server
     */
    private sendToolDefinitions;
    /**
     * Handle incoming message from Swift server
     */
    private handleMessage;
    /**
     * Handle tool execution request from Swift
     */
    private handleToolCall;
    /**
     * Send JSON-RPC request to Swift server
     */
    private sendRequest;
    /**
     * Send JSON-RPC response to Swift server
     */
    private sendResponse;
    /**
     * Execute a command via persistent server
     */
    execute<T = any>(action: string, parameters?: Record<string, any>): Promise<T>;
    /**
     * Execute a streaming command via persistent server
     */
    executeStream(action: string, parameters?: Record<string, any>): AsyncIterableIterator<string>;
    /**
     * Close the executor and clean up resources
     * Shuts down Swift server and removes socket file
     */
    close(): Promise<void>;
}
//# sourceMappingURL=persistent-server.d.ts.map