import { i as OpenClawConfig } from "./types.openclaw-FkxG7fk3.js"; import { r as AnyAgentTool } from "./common-C5X3-7Sz.js"; import { TSchema } from "typebox"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; //#region src/agents/agent-bundle-mcp-types.d.ts type BundleMcpToolRuntime = { tools: AnyAgentTool[]; diagnostics?: readonly McpToolCatalogDiagnostic[]; dispose: () => Promise; }; type McpServerCatalog = { serverName: string; launchSummary: string; toolCount: number; }; type McpCatalogTool = { serverName: string; safeServerName: string; toolName: string; title?: string; description?: string; inputSchema: TSchema; fallbackDescription: string; }; type McpToolCatalog = { version: number; generatedAt: number; servers: Record; tools: McpCatalogTool[]; diagnostics?: readonly McpToolCatalogDiagnostic[]; }; type McpToolCatalogDiagnostic = { serverName: string; safeServerName: string; launchSummary: string; message: string; }; type SessionMcpRuntime = { sessionId: string; sessionKey?: string; workspaceDir: string; configFingerprint: string; createdAt: number; lastUsedAt: number; activeLeases?: number; acquireLease?: () => () => void; /** Lists tools if needed and may connect MCP transports. */ getCatalog: () => Promise; /** Returns the cached catalog only; must not start runtimes, connect transports, or issue tools/list. */ peekCatalog: () => McpToolCatalog | null; markUsed: () => void; callTool: (serverName: string, toolName: string, input: unknown) => Promise; dispose: () => Promise; }; type SessionMcpRuntimeManager = { getOrCreate: (params: { sessionId: string; sessionKey?: string; workspaceDir: string; cfg?: OpenClawConfig; }) => Promise; bindSessionKey: (sessionKey: string, sessionId: string) => void; resolveSessionId: (sessionKey: string) => string | undefined; /** Looks up an existing runtime only; must not create runtimes or connect transports. */ peekSession: (params: { sessionId?: string; sessionKey?: string; }) => SessionMcpRuntime | undefined; disposeSession: (sessionId: string) => Promise; disposeAll: () => Promise; sweepIdleRuntimes: () => Promise; listSessionIds: () => string[]; }; //#endregion export { SessionMcpRuntimeManager as a, SessionMcpRuntime as i, McpCatalogTool as n, McpToolCatalog as r, BundleMcpToolRuntime as t };