UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

26 lines (25 loc) • 1.54 kB
import { r as isBundledManifestOwner } from "./manifest-owner-policy-B8Brw4Zo.mjs"; //#region src/gateway/worker-environments/node-bootstrap-plugins.ts /** Selects node runtime packages from the Gateway's already validated plugin generation. */ 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 }; }); } //#endregion export { resolveNodeBootstrapPlugins };