UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

16 lines (15 loc) • 889 B
//#region src/gateway/worker-environments/node-carrier-binding.ts function snapshotWorkerNodeCarrierBinding(e, t, n = e?.ownerEpoch) { if (!e || e.state !== "ready" && e.state !== "idle" && e.state !== "attached" || e.destroyRequestedAtMs !== null || !e.leaseId || !e.nodeDeviceId || e.sshEndpoint !== null || e.ownerEpoch !== n) throw new Error(t); return { environmentId: e.environmentId, leaseId: e.leaseId, nodeDeviceId: e.nodeDeviceId, ownerEpoch: e.ownerEpoch }; } function isWorkerNodeCarrierBindingCurrent(e, t) { return Boolean(e && (e.state === "ready" || e.state === "idle" || e.state === "attached") && e.destroyRequestedAtMs === null && e.leaseId === t.leaseId && e.nodeDeviceId === t.nodeDeviceId && e.sshEndpoint === null && e.ownerEpoch === t.ownerEpoch); } //#endregion export { snapshotWorkerNodeCarrierBinding as n, isWorkerNodeCarrierBindingCurrent as t };