import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { MCP } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/modelContextProtocol"; export declare const McpGatewayChannelName = "mcpGateway"; export declare const McpGatewayToolBrokerChannelName = "mcpGatewayToolBroker"; /** * Descriptor for an MCP server known to the gateway. */ export interface IMcpGatewayServerDescriptor { readonly id: string; readonly label: string; } /** * A single server entry exposed by the gateway. */ export interface IMcpGatewayServerInfo { readonly label: string; readonly address: URI; } /** * Per-server tool invoker used by a single gateway route/session. * All methods operate on the specific server this invoker is bound to. */ export interface IMcpGatewaySingleServerInvoker { readonly onDidChangeTools: Event; readonly onDidChangeResources: Event; listTools(): Promise; callTool(name: string, args: Record): Promise; listResources(): Promise; readResource(uri: string): Promise; listResourceTemplates(): Promise; } /** * Aggregating tool invoker that provides per-server operations and * server lifecycle tracking. Used by the gateway service to create * and manage per-server routes. */ export interface IMcpGatewayToolInvoker { readonly onDidChangeServers: Event; readonly onDidChangeTools: Event; readonly onDidChangeResources: Event; listServers(): readonly IMcpGatewayServerDescriptor[]; listToolsForServer(serverId: string): Promise; callToolForServer(serverId: string, name: string, args: Record): Promise; listResourcesForServer(serverId: string): Promise; readResourceForServer(serverId: string, uri: string): Promise; listResourceTemplatesForServer(serverId: string): Promise; } /** * Serializable result of creating an MCP gateway (safe for IPC). */ export interface IMcpGatewayDto { /** * The servers currently exposed by this gateway. */ readonly servers: readonly IMcpGatewayServerInfo[]; /** * The unique identifier for this gateway, used for disposal. */ readonly gatewayId: string; } /** * Result of creating an MCP gateway (in-process, includes event). */ export interface IMcpGatewayInfo extends IMcpGatewayDto { /** * Event that fires when the set of servers changes. */ readonly onDidChangeServers: Event; }