UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.02 kB
import{n as cleanupSessionLifecycleArtifacts}from"./session-store-runtime-BiMBNaHL.mjs"; //!extensions/memory-core/src/dreaming-session-cleanup.ts const DREAMING_SESSION_KEY_PREFIX=`dreaming-narrative-`;const DREAMING_ORPHAN_MIN_AGE_MS=3e5;const DREAMING_TRANSCRIPT_RUN_MARKER=`"runId":"dreaming-narrative-`;async function scrubDreamingNarrativeArtifacts(e){const t=await cleanupSessionLifecycleArtifacts({agentId:e.agentId,archiveRemovedEntryTranscripts:false,orphanTranscriptMinAgeMs:DREAMING_ORPHAN_MIN_AGE_MS,pluginOwnerId:`memory-core`,sessionStore:e.config.session?.store,sessionKeySegmentPrefix:DREAMING_SESSION_KEY_PREFIX,transcriptContentMarker:DREAMING_TRANSCRIPT_RUN_MARKER,...e.nowMs===void 0?{}:{nowMs:e.nowMs}});const n=t.removedEntries;const r=t.archivedTranscriptArtifacts;if(n>0||r>0)e.logger.info(`memory-core: dreaming cleanup scrubbed ${n} stale session entr${n===1?`y`:`ies`} and archived ${r} orphan transcript${r===1?``:`s`}.`)}export{DREAMING_ORPHAN_MIN_AGE_MS,scrubDreamingNarrativeArtifacts};