{"version":3,"file":"mcp-status.d.ts","sourceRoot":"","sources":["../../src/core/mcp-status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,eAAe;IAC/B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,UAAU,EAAE,OAAO,CAAC;IACpB,sEAAsE;IACtE,QAAQ,EAAE,OAAO,CAAC;IAClB,+FAA+F;IAC/F,KAAK,EAAE,WAAW,GAAG,aAAa,CAAC;CACnC;AAID,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAEhE;AAED,+EAA+E;AAC/E,wBAAgB,oBAAoB,IAAI,eAAe,EAAE,CAExD;AAED,iFAAiF;AACjF,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C","sourcesContent":["/**\n * Process-global registry of MCP servers that actually connected this session.\n *\n * MCP discovery and connection happen inside the hoo-core `mcp-loader` module on\n * `session_start`, from several sources (standard `mcp.json` files, hoocode's\n * per-server JSON files, plugin registrations). The startup resource summary\n * needs a single answer to \"which servers are live and how many tools do they\n * bring\", so the loader records each outcome here and the UI reads it.\n *\n * Mirrors the module-global approach of `extension-mcp-servers.ts`. The registry\n * is cleared at the start of each connect pass so a session switch or reload\n * rebuilds it instead of accumulating.\n */\n\nexport interface McpServerStatus {\n\t/** Server name, as used in the `mcp_<server>_<tool>` prefix. */\n\tname: string;\n\t/** Tools the server exposed on connect. */\n\ttoolCount: number;\n\t/** Tools default to background execution (task-panel rows) rather than inline. */\n\tbackground: boolean;\n\t/** Tool names are injected but schemas are materialized on demand. */\n\tdeferred: boolean;\n\t/** `authorizing` means a browser OAuth flow is in flight; tools register when it completes. */\n\tstate: \"connected\" | \"authorizing\";\n}\n\nconst statuses = new Map<string, McpServerStatus>();\n\n/** Record (or replace) the connection outcome for one server. */\nexport function setMcpServerStatus(status: McpServerStatus): void {\n\tstatuses.set(status.name, status);\n}\n\n/** All servers that connected (or are awaiting authorization) this session. */\nexport function getMcpServerStatuses(): McpServerStatus[] {\n\treturn [...statuses.values()];\n}\n\n/** Clear the registry. Called before each connect pass so reloads rebuild it. */\nexport function clearMcpServerStatuses(): void {\n\tstatuses.clear();\n}\n"]}