UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

28 lines (27 loc) • 1.38 kB
import { c as resolveUserPath } from "./home-dir-EKmgmdPG.mjs"; import "./utils-C8YECn2Q.mjs"; import { i as resolveSandboxRuntimeStatusAsync } from "./runtime-status-C5ZOG7YR.mjs"; import { b as resolveSenderRestrictedSpawnError } from "./subagent-capabilities-D82nSYzB.mjs"; import { o as resolveSpawnSandboxError } from "./spawn-plan-cbvAU9St.mjs"; //#region src/agents/subagents/spawn/acp-spawn-policy.ts async function resolveAcpSpawnRuntimePolicyError(e) { const t = await resolveSandboxRuntimeStatusAsync({ cfg: e.cfg, sessionKey: e.requesterSessionKey, agentId: e.requesterAgentId }); return resolveSpawnSandboxError({ backend: "acp", requesterSandboxed: e.requesterSandboxed === true || t.sandboxed, sandbox: e.sandbox === "require" ? "require" : "inherit" }); } function resolveAcpSenderSpawnError(e) { const t = resolveSenderRestrictedSpawnError(e); if (t) return t; if (e.inheritedToolPolicySource !== "sender") return; const n = e.sessionPermissionPolicy?.root ?? e.workspaceDir; return e.sessionPermissionPolicy && e.sessionPermissionPolicy.mode !== "full" || !n || e.cwd && resolveUserPath(e.cwd) !== resolveUserPath(n) ? `ACP cannot preserve this sender's session root restrictions. Use runtime="subagent" without a cwd override.` : void 0; } //#endregion export { resolveAcpSpawnRuntimePolicyError as n, resolveAcpSenderSpawnError as t };