(
filePath: string,
tracker: { lastCompleteLineOffset: number },
)
| 1881 | // ── Cache-Aware Parsing Helpers ──────────────────────────────────────── |
| 1882 | |
| 1883 | async function parseClaudeEntries( |
| 1884 | filePath: string, |
| 1885 | tracker: { lastCompleteLineOffset: number }, |
| 1886 | ): Promise<JournalEntry[] | null> { |
| 1887 | const entries: JournalEntry[] = [] |
| 1888 | let hasLines = false |
| 1889 | for await (const line of readSessionLines(filePath, undefined, { |
| 1890 | largeLineAsBuffer: true, |
| 1891 | byteOffsetTracker: tracker, |
| 1892 | })) { |
| 1893 | hasLines = true |
| 1894 | const entry = parseJsonlLine(line) |
| 1895 | if (entry) entries.push(compactEntry(entry)) |
| 1896 | } |
| 1897 | if (!hasLines || entries.length === 0) return null |
| 1898 | return entries |
| 1899 | } |
| 1900 | |
| 1901 | function getOrCreateProviderSection(cache: SessionCache, provider: string): ProviderSection { |
| 1902 | const envFp = computeEnvFingerprint(provider) |
no test coverage detected