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

Function getSessionFacts

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

Source from the content-addressed store, hash-verified

197}
198
199function getSessionFacts(
200 adapter: SessionRuntimeAdapter,
201 sessionId: string,
202 timeRange: ContactsTimeRangeState,
203 factsCache: ContactsFactsCacheContext | null
204): ContactsSessionFacts {
205 const dbVersion = getSessionDbVersion(adapter, sessionId)
206 const cached = readSessionFacts(sessionId, timeRange, factsCache, dbVersion)
207 if (cached) return cached
208
209 const facts = computeSessionFacts(adapter, sessionId, timeRange)
210 writeSessionFacts(adapter, sessionId, timeRange, factsCache, facts, dbVersion)
211 return facts
212}
213
214function computeSessionFacts(
215 adapter: SessionRuntimeAdapter,

Callers 1

computeContactsFunction · 0.70

Calls 4

getSessionDbVersionFunction · 0.70
readSessionFactsFunction · 0.70
computeSessionFactsFunction · 0.70
writeSessionFactsFunction · 0.70

Tested by

no test coverage detected