openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.03 kB
JavaScript
import{o as e,u as t}from"./transcript-kysely-sync-CAP5xe3V.mjs";import{t as n}from"./transcript-session-accessor.sqlite-scope-helpers-LCM13IZK.mjs";import{t as r}from"./transcript-session-entry-snapshots-B1SDC3sn.mjs";import{r as i,t as a}from"./transcript-session-accessor.sqlite-status-BxqCNBm4.mjs";import{n as o}from"./transcript-session-canonical-key-9wlUjrYM.mjs";function readSessionEntryStore(i,s={}){s.allowCanonicalRepair!==!0&&o(i);let c=n(i.db).selectFrom(`session_nodes`).selectAll().select(r);s.includeArchived===!1&&(c=c.where(`archived_at`,`is`,null));let l=e(i.db,(s.sessionKeys?c.where(`session_key`,`in`,t(s.sessionKeys)):c).orderBy(`session_key`)),u={};for(let e of l){let t=a(e);t&&(u[e.session_key]=t)}return u}function*iterateSessionEntryKeys(t){let r=n(t.db).selectFrom(`session_nodes`).select([i,`session_key`]).orderBy(`session_key`,`asc`);for(let n of e(t.db,r))(n.entry_json===null||a({entry_json:n.entry_json}))&&(yield n.session_key)}export{readSessionEntryStore as n,iterateSessionEntryKeys as t};