/** * claude-code cost provider: transcript JSONL parsing since a cursor. * * Transcripts live at ~/.claude/projects//.jsonl * (CLAUDE_CONFIG_DIR respected). The entry format is internal to Claude Code * and may change between versions — extraction is fail-soft: anything that * doesn't match the expected shape is skipped and counted, never fatal (D1). * * Cursor: last processed entry uuid. Resume/compaction append to the same * file, so uuid-based resumption is safe; if the cursor uuid is absent * (e.g. /branch copied the file), extraction falls back to the beginning * and the recorder's coverage dedup prevents double counting. * * **One API response spans several lines.** Claude Code writes one line per * content block and repeats the response's `usage` object on every one, so * counting per line counts one charge many times over. Segments are therefore * grouped by `message.id`, and the repeats are *collapsed* rather than summed — * see `extract` for the measurement that settles which of the two is correct. * * The other two providers were checked, not assumed: `codex.ts` emits one segment * per `token_count` event and its own docblock records that no record carries an * id at all, while `kiro.ts` emits one per `usage_summary` turn summary. Neither * writes per content block, so neither carries this defect and neither needs the * grouping. * * Design: design.md §3; context-budget design Part 1 */ import { isWithin } from '../../core/paths.js'; import type { CostProvider, ProviderEnv } from './provider.js'; /** Root directory that transcripts must live under (FR3.9). */ export declare function transcriptRoot(env: ProviderEnv): string; /** * Is `p` the directory `root` or something beneath it? Purely lexical. * * Re-exported from `core/paths.ts`, which is now the only implementation * (project-constitution D4). Kept exported here so `kiro.ts` and the cost tests * that import it from this module keep working. */ export { isWithin }; export declare const claudeCodeProvider: CostProvider; //# sourceMappingURL=claude-code.d.ts.map