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

Function getChatOverview

packages/core/src/query/session-queries.ts:232–257  ·  view source on GitHub ↗
(db: DatabaseAdapter, topN: number = 10)

Source from the content-addressed store, hash-verified

230 * Simpler than Electron version — no cache layer, direct SQL.
231 */
232export function getChatOverview(db: DatabaseAdapter, topN: number = 10): ChatOverviewData | null {
233 const meta = getSessionMeta(db)
234 if (!meta) return null
235
236 const overview = getSessionOverview(db)
237 const members = getMemberActivity(db)
238 const summaryCount = getSummaryCount(db)
239
240 const topMembers = members.slice(0, topN).map((m) => ({
241 id: m.memberId,
242 name: m.name,
243 count: m.messageCount,
244 }))
245
246 return {
247 name: meta.name,
248 platform: meta.platform,
249 type: meta.type,
250 totalMessages: overview.totalMessages,
251 totalMembers: overview.totalMembers,
252 firstMessageTs: overview.firstMessageTs,
253 lastMessageTs: overview.lastMessageTs,
254 topMembers,
255 summaryCount,
256 }
257}
258
259/**
260 * Get messages for a specific chat session

Callers 2

createCliRunAgentStreamFunction · 0.90

Calls 4

getMemberActivityFunction · 0.90
getSessionMetaFunction · 0.85
getSessionOverviewFunction · 0.85
getSummaryCountFunction · 0.85

Tested by

no test coverage detected