MCPcopy Index your code
hub / github.com/codeaashu/claude-code / enrichLogs

Function enrichLogs

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

Source from the content-addressed store, hash-verified

5075 * index where scanning stopped (for progressive loading to continue from).
5076 */
5077export async function enrichLogs(
5078 allLogs: LogOption[],
5079 startIndex: number,
5080 count: number,
5081): Promise<{ logs: LogOption[]; nextIndex: number }> {
5082 const result: LogOption[] = []
5083 const readBuf = Buffer.alloc(LITE_READ_BUF_SIZE)
5084 let i = startIndex
5085
5086 while (i < allLogs.length && result.length < count) {
5087 const log = allLogs[i]!
5088 i++
5089
5090 const enriched = await enrichLog(log, readBuf)
5091 if (enriched) {
5092 result.push(enriched)
5093 }
5094 }
5095
5096 const scanned = i - startIndex
5097 const filtered = scanned - result.length
5098 if (filtered > 0) {
5099 logForDebugging(
5100 `/resume: enriched ${scanned} sessions, ${filtered} filtered out, ${result.length} visible (${allLogs.length - i} remaining on disk)`,
5101 )
5102 }
5103
5104 return { logs: result, nextIndex: i }
5105}
5106

Callers 5

loadMessageLogsFunction · 0.85
ResumeConversationFunction · 0.85

Calls 3

enrichLogFunction · 0.85
logForDebuggingFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected