/** * Transcript source adapters — each AI coding tool persists chat transcripts * somewhere different; this module knows where, and how to pull out the * genuine human-typed messages. The harvest orchestrator (harvest.ts) treats * every source identically: discover sessions → extract user messages → * redact → LLM claim extraction → proposal queue. * * Supported: * - claude-code ~/.claude/projects//*.jsonl * - codex ~/.codex/sessions/(**)/*.jsonl (rollout files, matched by cwd) * - copilot-vscode VS Code workspaceStorage//chatSessions/*.json * - cursor Cursor workspaceStorage//state.vscdb (SQLite) * * Not supported: Devin (cloud-hosted, no local transcripts). */ /** One harvestable chat session (a transcript file / workspace DB). */ export interface TranscriptSession { /** Stable id used for dedupe + evidence (file basename or workspace hash). */ id: string; mtimeMs: number; /** Lazily read + parse the human-typed messages. May throw on unreadable input. */ messages(): string[]; } export interface TranscriptSource { /** Stable slug: proposals get source `harvest:`, cursor meta `harvest__last_mtime`. */ name: string; /** Human-readable tool name for CLI output and evidence text. */ label: string; /** Where transcripts live (for CLI hints); null if the tool isn't installed. */ transcriptDir(repoRoot: string): string | null; /** All sessions for this repo, or null when the tool/transcripts are absent. */ sessions(repoRoot: string): TranscriptSession[] | null; } /** Claude Code stores transcripts under a slug of the project's absolute path. */ export declare function claudeProjectDir(repoRoot: string): string | null; /** Extract genuine human-typed messages from one Claude Code session JSONL. */ export declare function userMessagesFromTranscript(jsonl: string): string[]; /** * Parse one Codex rollout JSONL: find the session's cwd (session_meta / * turn_context) and the human-typed user messages. Handles both the wrapped * (`{type:"response_item",payload:{…}}`) and older flat line formats. */ export declare function codexTranscript(jsonl: string): { cwd: string | null; messages: string[]; }; /** Extract human-typed turns from one VS Code Copilot chatSessions/*.json file. */ export declare function copilotUserMessages(json: string): string[]; /** * Cursor keeps chat state in a per-workspace SQLite DB (state.vscdb, * ItemTable). Schema is undocumented and drifts between versions, so every * read is defensive — a miss just means zero messages. */ export declare function cursorUserMessages(dbPath: string): string[]; /** All known transcript sources, in harvest order. */ export declare const TRANSCRIPT_SOURCES: TranscriptSource[];