MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / readSessionFacts

Function readSessionFacts

packages/node-runtime/src/services/contacts/compute.ts:382–401  ·  view source on GitHub ↗
(
  sessionId: string,
  timeRange: ContactsTimeRangeState,
  factsCache: ContactsFactsCacheContext | null,
  dbVersion: string
)

Source from the content-addressed store, hash-verified

380}
381
382function readSessionFacts(
383 sessionId: string,
384 timeRange: ContactsTimeRangeState,
385 factsCache: ContactsFactsCacheContext | null,
386 dbVersion: string
387): ContactsSessionFacts | null {
388 if (!factsCache) return null
389 const cached = readCachedContactsSessionFacts(
390 sessionId,
391 factsCache.dir,
392 buildContactsSessionFactsCacheKey(CONTACTS_ALGORITHM_VERSION, timeRange),
393 dbVersion
394 )
395 if (!cached.hit) {
396 factsCache.stats.factsMisses++
397 return null
398 }
399 factsCache.stats.factsHits++
400 return cached.data
401}
402
403function writeSessionFacts(
404 adapter: SessionRuntimeAdapter,

Callers 1

getSessionFactsFunction · 0.70

Tested by

no test coverage detected