UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.43 kB
import{i as listAgentIds}from"./agent-roster-4XrgUgPK.mjs";import{f as resolveAgentWorkspaceDir}from"./agent-scope-config-CG9CFpGX.mjs";import{n as resolveStdioMcpServerLaunchConfig}from"./mcp-stdio-B1gRAX5S.mjs";import{t as runTasksWithConcurrency}from"./run-with-concurrency-BX7H2nwl.mjs";import{t as loadMergedBundleMcpConfig}from"./bundle-mcp-config-C-R5gRDz.mjs";import{t as parseMcpDockerCommand}from"./mcp-docker-command-G_deUMa7.mjs"; //!src/agents/mcp-docker-recovery.ts async function recoverConfiguredMcpDockerServers(e,t){const n=[];for(const r of listAgentIds(e)){const i=loadMergedBundleMcpConfig({cfg:e,manifestRegistry:t,workspaceDir:resolveAgentWorkspaceDir(e,r)});n.push(...Object.values(i.config.mcpServers))}await recoverMcpDockerServers(n)}async function recoverMcpDockerServers(e){const t=/* @__PURE__ */ new Set;const n=[];for(const r of e){if(r.enabled===false)continue;const e=resolveStdioMcpServerLaunchConfig(r);if(!e.ok)continue;const i=parseMcpDockerCommand(e.config.command,e.config.args);if(i.kind!==`docker`)continue;const{env:a,cwd:o}=e.config;const s=JSON.stringify([i.command,a,o]);if(t.has(s))continue;t.add(s);n.push(async()=>{const{recoverMcpDockerContainers:e}=await import(`./mcp-docker-custody-Bz0hWqqe.mjs`);await e(i.command,a,o)})}const{hasError:r,firstError:i}=await runTasksWithConcurrency({tasks:n,limit:4});if(r)throw i}export{recoverConfiguredMcpDockerServers,recoverMcpDockerServers};