UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.27 kB
import{r as isBundledManifestOwner}from"./manifest-owner-policy-DVnu9FAE.mjs"; //!src/gateway/worker-environments/node-bootstrap-plugins.ts function resolveNodeBootstrapPlugins(e){if(e.executionMode!==`remote-exec`)return[];const t=new Map(e.registry.plugins.filter(e=>e.enabled&&e.status===`loaded`).map(e=>[e.id,e]));const n=new Set(e.registry.agentHarnesses.flatMap(({pluginId:n,harness:r})=>t.has(n)&&r.cloudPlacement?.mode===e.executionMode?r.cloudPlacement?.devicePlacement?.requiredNodeCommands??[]:[]));const r=/* @__PURE__ */ new Set;for(const i of n){const n=e.registry.nodeHostCommands.find(e=>e.command.command===i);if(!n||!t.has(n.pluginId))throw new Error(`Cloud node bootstrap requires an available plugin for node command ${i}`);r.add(n.pluginId)}return[...r].toSorted().map(n=>{const r=e.metadata.byPluginId.get(n);const i=t.get(n);if(!r||!i||!isBundledManifestOwner(r)&&r.trustedOfficialInstall!==true||!r.rootDir||!r.packageName||!r.packageVersion||r.rootDir!==i.rootDir||r.packageName!==i.packageName||r.packageVersion!==i.packageVersion)throw new Error(`Cloud node bootstrap requires the loaded trusted package for plugin ${n}; repair its installation and restart the Gateway`);return{id:n,root:r.rootDir}})}export{resolveNodeBootstrapPlugins as t};