MCPcopy
hub / github.com/ValueCell-ai/ClawX / extractSessionRecords

Function extractSessionRecords

electron/utils/session-util.ts:15–23  ·  view source on GitHub ↗
(store: JsonRecord)

Source from the content-addressed store, hash-verified

13 * - Array format: { sessions: [...] }
14 */
15export function extractSessionRecords(store: JsonRecord): JsonRecord[] {
16 const directEntries = Object.entries(store)
17 .filter(([key, value]) => key !== 'sessions' && value && typeof value === 'object')
18 .map(([, value]) => value as JsonRecord);
19 const arrayEntries = Array.isArray(store.sessions)
20 ? store.sessions.filter((entry): entry is JsonRecord => Boolean(entry && typeof entry === 'object'))
21 : [];
22 return [...directEntries, ...arrayEntries];
23}
24
25/**
26 * Find accountId from session history by "to" address and channel type.

Calls

no outgoing calls

Tested by

no test coverage detected