/** * @toolplex/ai-engine - MCP Client * * Core MCP client that manages sessions and tool operations. * Uses a TransportFactory for platform-specific transport creation. */ import type { MCPResult, MCPToolResult, MCPClientConfig, CreateTransportOptions } from "./types.js"; /** * MCP Client - manages sessions and provides tool operations */ export declare class MCPClient { private sessions; private transportFactory; private logger; private imageHandler; private getCurrentUserId; constructor(config: MCPClientConfig); /** * Creates an MCP session and waits for tools to be initialized * * CRITICAL: The ToolPlex MCP server fetches tool schemas from the API during startup. * This is asynchronous and can take time. We MUST wait for this to complete before * returning, otherwise listTools() will return empty schemas. * * @param userId - Optional user ID for system API keys (per-user telemetry) * @param options - Additional options including clientMode */ createSession(sessionId: string, apiKey: string, sessionResumeHistory?: string, userId?: string, options?: CreateTransportOptions): Promise; /** * Lists available tools for a session */ listTools(sessionId: string): Promise<{ tools: any[]; }>; /** * Calls a tool for a session */ callTool(sessionId: string, toolName: string, args: any): Promise; /** * Destroys an MCP session */ destroySession(sessionId: string): Promise; /** * Gets all active session IDs */ getActiveSessions(): string[]; /** * Destroys all MCP sessions (cleanup) */ destroyAllSessions(): Promise; /** * Gets session info */ getSessionInfo(sessionId: string): { exists: boolean; isConnected?: boolean; }; /** * Check if a session exists */ hasSession(sessionId: string): boolean; } //# sourceMappingURL=MCPClient.d.ts.map