openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 967 B
JavaScript
import{i as e}from"./transcript-sqlite-worker-identity-CA1Up8Es.mjs";import{a as t,i as n,t as r}from"./transcript-openclaw-agent-db-identity-BPgUuROx.mjs";function captureSessionEntryReadSource(e,i,a=`Session entry read requires its current durable owner`){i&&r(e,i);let o=t(e);if(typeof o.identity!=`string`||!n(e))throw Error(a);return{agentId:e.agentId,path:e.path,databaseIdentity:o.identity,databaseBirthtime:o.birthtime}}function assertCapturedSessionEntryReadSource(r,i){if(typeof r.databaseIdentity==`string`&&(!i||i.path!==r.path)&&e(r.path,`file:${r.databaseIdentity}`,r.databaseBirthtime),!i){if(typeof r.databaseIdentity==`symbol`)throw Error(`Captured session database is no longer open`);return}let a=t(i);if(i.agentId!==r.agentId||a.identity!==r.databaseIdentity||a.birthtime!==r.databaseBirthtime||!n(i))throw Error(`Captured session database changed before read`)}export{captureSessionEntryReadSource as n,assertCapturedSessionEntryReadSource as t};