openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 2.06 kB
JavaScript
import{M as e}from"./transcript-chat-message-content-Cx-VPFHv.mjs";import{i as t}from"./transcript-global-singleton-DIJgobpU.mjs";import{t as n}from"./transcript-async-context-CWIqzhI4.mjs";import"./transcript-src-DFL7yLCI.mjs";import{t as r}from"./transcript-session-transcript-read-fence-error-DfU0swK6.mjs";import{a as i}from"./transcript-openclaw-agent-db.paths-5mfY5--s.mjs";import"./transcript-operator-authority-error-Cg8jQmEy.mjs";t(Symbol.for(`openclaw.messageInjectionQueues`),()=>/* @__PURE__ */ new WeakMap),t(Symbol.for(`openclaw.messageInjectionAdmissions`),()=>/* @__PURE__ */ new WeakMap),t(Symbol.for(`openclaw.messageInjectionQuestionAssertionFrame`),()=>({active:!1}));var a=/* @__PURE__ */ e({SessionTranscriptReadFenceError:()=>r,resolveSessionTranscriptReadFence:()=>resolveSessionTranscriptReadFence,resolveSqliteSessionTranscriptReadFence:()=>resolveSqliteSessionTranscriptReadFence,runWithSessionTranscriptReadFence:()=>runWithSessionTranscriptReadFence});const o=new n(Symbol(`sessionTranscriptReadFence`));function isSameTranscriptStore(e,t){return e===t||i(e,t)}new n(Symbol(`sessionTranscriptQuestionAnswers`));function runWithSessionTranscriptReadFence(e,t){return e?o.run(e,t):t()}function resolveSessionTranscriptReadFence(e){let t=o.getStore();return t?.agentId===e.agentId&&t.sessionId===e.sessionId?t:void 0}function resolveSqliteSessionTranscriptReadFence(e){let t=resolveSessionTranscriptReadFence(e);if(t){if(t.role!==`user`)throw new r(`Current-turn transcript admission is not a user message: ${t.entryId}`);if(!isSameTranscriptStore(e.database.path,t.storePath))throw new r(`Current-turn transcript admission belongs to a different transcript store`);if(e.sessionKey!==void 0&&e.sessionKey!==t.sessionKey)throw new r(`Current-turn transcript admission belongs to a different session key`);return{admission:t,beforeActiveMessagePosition:t.activeMessagePosition,beforeRawSeq:t.rawSeq}}}export{a as i,resolveSqliteSessionTranscriptReadFence as n,runWithSessionTranscriptReadFence as r,resolveSessionTranscriptReadFence as t};