import type { McpServerConfig } from '@pellux/goodvibes-sdk/platform/mcp/config';
export interface McpProcessSpec {
    command: string;
    args?: string[];
    env?: Record<string, string>;
    cwd?: string;
    summary?: string;
    sandboxSessionId?: string;
}
export interface McpToolInfo {
    name: string;
    description: string;
}
export interface McpToolSchema extends McpToolInfo {
    inputSchema: Record<string, unknown>;
}
export declare class McpClient {
    private config;
    private options?;
    private proc;
    private nextId;
    private pendingRequests;
    private buffer;
    private readLoopRunning;
    private restartCount;
    private initialized;
    /** Cache: tool name → full schema (populated lazily on first callTool) */
    private schemaCache;
    /** Minimal tool info loaded at connect time (name + description only) */
    private toolInfoCache;
    constructor(config: McpServerConfig, options?: {
        timeout?: number;
        processSpec?: McpProcessSpec;
    } | undefined);
    get name(): string;
    get isConnected(): boolean;
    /**
     * connect — Start the server process and perform MCP handshake (initialize).
     * After connect, listTools() is available.
     */
    connect(): Promise<void>;
    /**
     * listTools — Return tool names and descriptions (progressive loading).
     * Full schemas are NOT fetched here; call getToolSchema() to get them.
     */
    listTools(): Promise<McpToolInfo[]>;
    /**
     * getToolSchema — Fetch full JSON schema for a tool (lazy, cached).
     * MCP protocol provides full schemas in tools/list; we cache them on first access.
     */
    getToolSchema(toolName: string): Promise<McpToolSchema | null>;
    /**
     * callTool — Execute a tool on the MCP server.
     * Fetches full schema on first use (if not already cached).
     */
    callTool(toolName: string, args: Record<string, unknown>): Promise<unknown>;
    /**
     * disconnect — Stop the server process and clean up.
     */
    disconnect(): Promise<void>;
    private _startProcess;
    /** Perform MCP initialize handshake. */
    private _initialize;
    /** Send a JSON-RPC request; returns the result. */
    private _request;
    /** Send a JSON-RPC notification (no response expected). */
    private _notify;
    private _startReadLoop;
    private _processBuffer;
    private _dispatchLine;
    private _scheduleRestart;
    /**
     * ping — Send a ping to check if server is healthy.
     * Returns true if server responds within PING_TIMEOUT_MS.
     */
    ping(): Promise<boolean>;
}
//# sourceMappingURL=client.d.ts.map