openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 937 B
JavaScript
import{n as resolveSessionTranscriptReadFence}from"./session-transcript-read-fence-DE07xwTs.mjs";import{t as withSessionTranscriptReadSource}from"./session-transcript-read-source-BL16lzXg.mjs";import{y as formatHookErrorForLog}from"./hooks-Bu2gwS_g.mjs";import{t as resolveHookConfig}from"./policy-Vh7w_DtI.mjs";
//!src/hooks/bundled/session-memory/capture.ts
async function captureSessionMemoryTranscript(e,t){const n=resolveHookConfig(t,`session-memory`);const r=typeof n?.messages===`number`&&n.messages>0?n.messages:15;try{return await withSessionTranscriptReadSource(e,async e=>{const t=await(e.preparedReads??e.owner).readSessionMemoryCapture({scope:e.scope,resolved:e.resolved,messageCount:r,admission:resolveSessionTranscriptReadFence(e.resolved),expectedIdentity:e.expectedIdentity});e.assertCurrent();return t})}catch(e){return{status:`unavailable`,reason:formatHookErrorForLog(e)}}}export{captureSessionMemoryTranscript as t};