MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / enrichLogs

Function enrichLogs

src/utils/sessionStorage.ts:5190–5218  ·  view source on GitHub ↗
(
  allLogs: LogOption[],
  startIndex: number,
  count: number,
)

Source from the content-addressed store, hash-verified

5188 * index where scanning stopped (for progressive loading to continue from).
5189 */
5190export async function enrichLogs(
5191 allLogs: LogOption[],
5192 startIndex: number,
5193 count: number,
5194): Promise<{ logs: LogOption[]; nextIndex: number }> {
5195 const result: LogOption[] = []
5196 const readBuf = Buffer.alloc(LITE_READ_BUF_SIZE)
5197 let i = startIndex
5198
5199 while (i < allLogs.length && result.length < count) {
5200 const log = allLogs[i]!
5201 i++
5202
5203 const enriched = await enrichLog(log, readBuf)
5204 if (enriched) {
5205 result.push(enriched)
5206 }
5207 }
5208
5209 const scanned = i - startIndex
5210 const filtered = scanned - result.length
5211 if (filtered > 0) {
5212 logForDebugging(
5213 `/resume: enriched ${scanned} sessions, ${filtered} filtered out, ${result.length} visible (${allLogs.length - i} remaining on disk)`,
5214 )
5215 }
5216
5217 return { logs: result, nextIndex: i }
5218}

Callers 5

loadMessageLogsFunction · 0.85
ResumeConversationFunction · 0.85

Calls 3

enrichLogFunction · 0.85
logForDebuggingFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected