openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 733 B
JavaScript
import{i as e}from"./transcript-record-coerce-CPLgmAk9.mjs";function createSessionResetRecallCutoffTracker(){let t=/* @__PURE__ */ new Map,n={state:`absent`},r=0;return{observe(i){let a=e(i);if(a?.type===`reset`){let e=a.firstKeptEntryId;if(e===void 0)n={state:`valid`,cutoffLine:r+1};else if(typeof e!=`string`||!e.trim())n={state:`invalid`};else{let r=t.get(e);n=r===void 0?{state:`invalid`}:{state:`valid`,cutoffLine:r+1}}}typeof a?.id==`string`&&!t.has(a.id)&&t.set(a.id,r),r++},current(){return{...n}}}}function resolveSessionResetRecallCutoff(e){let t=createSessionResetRecallCutoffTracker();for(let n of e)t.observe(n);return t.current()}export{resolveSessionResetRecallCutoff as n,createSessionResetRecallCutoffTracker as t};