/** * MCP Client Foundation — official SDK adapter (2.13.0). * * This is the ONLY module that imports the MCP TypeScript SDK runtime and * transports. It owns a single stdio session: spawn, protocol negotiation, * tool discovery, tool invocation, cancellation/timeout, stderr isolation, and * clean shutdown. Everything crossing out of this file is Jensen-shaped (see * mcp-types.ts). * * Negotiation policy: `versionNegotiation: { mode: "auto" }` — probe with the * modern `server/discover` advertisement first, then fall back to the legacy * `initialize` handshake for 2025-era servers. The negotiated era/version are * captured and surfaced as observable Jensen session metadata; Jensen domains * never branch on them. */ import type { McpServerDefinition, McpServerSession, McpToolCall, McpToolDescriptor, McpToolResult } from "./mcp-types.js"; export interface McpSdkAdapterOptions { sessionId: string; serverId: string; now?: () => number; } export declare class McpSdkAdapter { private readonly sessionId; private readonly serverId; private readonly now; private definition?; private client?; private state; private failure?; private connectedAtMs?; private disconnectedAtMs?; private pid?; private protocolVersion?; private protocolEra?; private identity?; private capabilities?; private instructions?; private toolListChanged; private stderrPending; private stderrLines; constructor(options: McpSdkAdapterOptions); get isConnected(): boolean; connect(definition: McpServerDefinition): Promise; disconnect(): Promise; listTools(): Promise; callTool(call: McpToolCall): Promise; snapshot(): McpServerSession; processAlive(): boolean; private toToolResult; private resultStatusForCode; private assertConnected; private onToolsChanged; private onTransportClosed; private forceCleanup; private captureStderr; } //# sourceMappingURL=sdk-adapter.d.ts.map