MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / buildSessionStateMap

Function buildSessionStateMap

src/stores/syncResultPolling.ts:22–33  ·  view source on GitHub ↗
(sources: SyncSourceState[])

Source from the content-addressed store, hash-verified

20}
21
22function buildSessionStateMap(sources: SyncSourceState[]): Map<string, string> {
23 const states = new Map<string, string>()
24 for (const source of sources) {
25 for (const session of source.sessions) {
26 states.set(
27 `${source.id}:${session.id}`,
28 JSON.stringify([session.targetSessionId, session.lastPullAt, session.lastStatus, session.lastNewMessages])
29 )
30 }
31 }
32 return states
33}
34
35/**
36 * CLI Web 没有 Electron IPC 推送,因此通过持久化的订阅状态检测后台同步完成。

Callers 1

pollFunction · 0.85

Calls 1

setMethod · 0.80

Tested by

no test coverage detected