/** * Claude Code transcript importer. * * Reads ~/.claude/projects/(**)/*.jsonl (honouring CLAUDE_CONFIG_DIR) and produces * normalized Runs. * * Two things dominate the design of this file: * * 1. Anthropic documents the transcript entry format as *internal and subject to * change between releases*. So: no schema validation, no required fields, no * exceptions on unknown shapes. Anything unrecognised is recorded as schema * drift and surfaced in the UI rather than dropped silently or fatal. * * 2. A transcript file is not a run. Resuming appends to the same file for days, * and `/clear` starts a fresh conversation inside it. We segment into runs on * idle gaps and on `/clear`. Compaction is marked inline, not split on — it * happens mid-task and splitting there would cut a single logical run in half. */ import { type Run } from "../model.js"; import type { DiscoveredFile, Source } from "./types.js"; export { classifyCommand } from "../commands.js"; export declare function configDir(): string; export declare function projectsDir(): string; export declare class ClaudeCodeSource implements Source { readonly name = "claude_code"; available(): boolean; discover(): DiscoveredFile[]; load(path: string): Run[]; private readLines; /** Split a transcript into runs on idle gaps and /clear. */ private segment; private buildRun; private handleAssistant; private handleUser; private handleToolResult; }