UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 3.35 kB
import{w as e}from"./openclaw-state-read-read-open-flags-CtNL1rJs.mjs";import{i as t,r as n}from"./openclaw-state-read-path-existence-Bp_sxI9A.mjs";var SandboxStateOwnerRequiredError=class extends Error{constructor(e){super(`Sandbox workspace preparation cannot run alongside a foreign live owner of the selected state root, or when that ownership cannot be verified. Run this SDK call inside the owning Gateway plugin/runtime, or stop the Gateway through its service owner and wait for any embedded run to finish, then retry offline. Inspect openclaw gateway status; this call does not acquire ownership or route remotely.`,{cause:e}),this.code=`GATEWAY_STATE_OWNER_REQUIRED`,this.name=`SandboxStateOwnerRequiredError`}};function assertCanonicalPath(t,n){let r=process.platform===`win32`?e:String;if(r(n)!==r(t.canonicalPath))throw new SandboxStateOwnerRequiredError(/* @__PURE__ */ Error(`Sandbox state path changed while preparing an operation`))}function assertSandboxStateOwnerPathCurrent(e){assertCanonicalPath(e,t(e.path))}async function prepareSandboxStateOwnerPath(e){assertCanonicalPath(e,await n(e.path))}var WorktreeRepositoryError=class extends Error{constructor(e,t){super(e,t),this.name=`WorktreeRepositoryError`,this.reason=t?.reason}},WorktreeRemovalContentionError=class extends Error{constructor(e,t,n){super(t),this.kind=e,this.blockedByRun=n,this.name=`WorktreeRemovalContentionError`}},WorktreeRemovalLockError=class extends Error{constructor(e,t){super(t),this.kind=e,this.name=`WorktreeRemovalLockError`}},SessionWorktreeSourceChangedError=class extends Error{},SessionWorktreeLifecycleError=class extends Error{constructor(e,t){super(e),this.reason=t}};function registryAuthorityChanged(e){switch(e){case`publication`:return new SessionWorktreeSourceChangedError(`GitHub publication worktree authority changed`);case`snapshot-retirement`:return/* @__PURE__ */ Error(`Worktree snapshot retirement identity changed`);case`exact-snapshot`:return/* @__PURE__ */ Error(`Exact-state recovery owner or lifecycle changed; source and snapshot preserved`);case`exact-owner`:return/* @__PURE__ */ Error(`Worktree exact-state owner or lifecycle changed; checkout preserved`);case`activity`:return new WorktreeRemovalLockError(`busy`,`worktree activity changed during cleanup`);case`session-owner`:return new SessionWorktreeLifecycleError(`Session worktree ownership changed; retry cleanup.`,`owner-mismatch`);case`source-record`:return new SessionWorktreeSourceChangedError(`Accepted managed source changed during preparation`);case`source-owner`:return new SessionWorktreeSourceChangedError(`Spawn parent managed worktree changed; retry from its current session`);case`projection`:return/* @__PURE__ */ Error(`Managed projection owner changed during settlement`);case`record`:return/* @__PURE__ */ Error(`Worktree registry changed during recovery; remaining source and original snapshot preserved`);default:return new WorktreeRemovalContentionError(`busy`,`Worktree owner or binding changed; checkout preserved`)}}export{WorktreeRepositoryError as a,assertSandboxStateOwnerPathCurrent as c,WorktreeRemovalLockError as i,prepareSandboxStateOwnerPath as l,SessionWorktreeSourceChangedError as n,registryAuthorityChanged as o,WorktreeRemovalContentionError as r,SandboxStateOwnerRequiredError as s,SessionWorktreeLifecycleError as t};