import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import type { OpenClawConfig } from "../config/config.js"; import type { AnyAgentTool } from "./tools/common.js"; export type BundleMcpToolRuntime = { tools: AnyAgentTool[]; dispose: () => Promise; }; export type McpServerCatalog = { serverName: string; launchSummary: string; toolCount: number; }; export type McpCatalogTool = { serverName: string; safeServerName: string; toolName: string; title?: string; description?: string; inputSchema: unknown; fallbackDescription: string; }; export type McpToolCatalog = { version: number; generatedAt: number; servers: Record; tools: McpCatalogTool[]; }; export type SessionMcpRuntime = { sessionId: string; sessionKey?: string; workspaceDir: string; configFingerprint: string; createdAt: number; lastUsedAt: number; getCatalog: () => Promise; markUsed: () => void; callTool: (serverName: string, toolName: string, input: unknown) => Promise; dispose: () => Promise; }; export type SessionMcpRuntimeManager = { getOrCreate: (params: { sessionId: string; sessionKey?: string; workspaceDir: string; cfg?: OpenClawConfig; }) => Promise; bindSessionKey: (sessionKey: string, sessionId: string) => void; resolveSessionId: (sessionKey: string) => string | undefined; disposeSession: (sessionId: string) => Promise; disposeAll: () => Promise; listSessionIds: () => string[]; };