{"version":3,"file":"extension-mcp-servers.d.ts","sourceRoot":"","sources":["../../src/core/extension-mcp-servers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,uEAAuE;AACvE,MAAM,WAAW,wBAAwB;IACxC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,6FAA6F;IAC7F,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;IAChC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IACjC,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,+DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;CACrD;AAID,8DAA8D;AAC9D,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,GAClD,IAAI,CAGN;AAED,0DAA0D;AAC1D,wBAAgB,sBAAsB,IAAI,iBAAiB,EAAE,CAE5D;AAED,uFAAuF;AACvF,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C","sourcesContent":["/**\n * Process-global registry of MCP servers contributed by extensions/plugins.\n *\n * Plugins declare `mcpServers` in their manifest (or a `.mcp.json`), but MCP\n * connection happens in the hoo-core `mcp-loader` module's `setupMcpLoader` on `session_start`, which\n * reads from fixed file locations. This registry bridges the two: plugin\n * factories register their servers here during load, and `setupMcpLoader` reads\n * them when connecting. Mirrors the module-global approach of\n * `agent-manifest-paths.ts`.\n *\n * Entries are keyed by `source` so a reload can rebuild the set cleanly: call\n * {@link clearExtensionMcpServers} before (re)loading plugins, then register.\n */\n\n/** Standard MCP server config (Claude Desktop / `.mcp.json` shape). */\nexport interface ExtensionMcpServerConfig {\n\t/** Executable to spawn (stdio transport). One of command/url is required. */\n\tcommand?: string;\n\targs?: string[];\n\tenv?: Record<string, string>;\n\t/** Transport: \"stdio\" (default with command), \"http\" (Streamable HTTP), or \"sse\" (legacy) */\n\ttype?: \"stdio\" | \"http\" | \"sse\";\n\t/** Remote server URL (http/sse transports) */\n\turl?: string;\n\t/** Extra HTTP headers (e.g. Authorization) for remote transports */\n\theaders?: Record<string, string>;\n\tbackground?: boolean;\n}\n\nexport interface ExtensionMcpEntry {\n\t/** Identifier of the contributing plugin/extension (for diagnostics + dedup). */\n\tsource: string;\n\t/** Server name → config, in standard `mcpServers` format. */\n\tmcpServers: Record<string, ExtensionMcpServerConfig>;\n}\n\nlet registered: ExtensionMcpEntry[] = [];\n\n/** Register MCP servers contributed by a plugin/extension. */\nexport function registerExtensionMcpServers(\n\tsource: string,\n\tmcpServers: Record<string, ExtensionMcpServerConfig>,\n): void {\n\tif (!mcpServers || Object.keys(mcpServers).length === 0) return;\n\tregistered.push({ source, mcpServers });\n}\n\n/** Get all currently registered extension MCP servers. */\nexport function getExtensionMcpServers(): ExtensionMcpEntry[] {\n\treturn [...registered];\n}\n\n/** Clear the registry. Call before (re)loading plugins so reloads don't accumulate. */\nexport function clearExtensionMcpServers(): void {\n\tregistered = [];\n}\n"]}