vct_core/session/mod.rs
1//! Shared session-file parsing layer.
2//!
3//! Every supported provider writes its session history to disk in a
4//! provider-specific JSON, JSONL, or SQLite shape.
5//! This module owns the "turn raw bytes into a typed
6//! [`crate::CodeAnalysis`]" boundary so both of the features that consume
7//! session files — [`crate::analysis`] (aggregated tool-call metrics) and
8//! [`crate::usage`] (aggregated token counts) — share the same parsers
9//! and intermediate shape instead of one feature reaching into the other.
10//!
11//! Naming convention: the file-backed providers expose `parse_*` entry points
12//! (`parse_session_file_*`), while the SQLite-backed providers (OpenCode /
13//! Cursor / Hermes) expose `read_*` entry points, since they query a database
14//! rather than parse a byte stream.
15pub mod claude;
16pub mod codex;
17pub mod copilot;
18pub mod cursor;
19pub mod detector;
20pub(crate) mod diagnostics;
21pub mod gemini;
22pub mod grok;
23pub mod hermes;
24pub mod opencode;
25pub mod parser;
26pub(crate) mod sqlite;
27pub mod state;
28
29pub use cursor::{read_cursor_analysis, read_cursor_usage};
30pub use detector::{classify_records, detect_extension_type};
31pub use hermes::read_hermes_usage;
32pub use opencode::{read_opencode_analysis, read_opencode_usage};
33pub use parser::{
34 SessionFileParseDiagnostics, parse_session_file_to_value, parse_session_file_typed,
35 parse_session_file_typed_as, parse_session_file_typed_with_mode,
36 parse_session_file_with_diagnostics,
37};
38pub use state::{ParseMode, SessionParseState};