pub trait HistoryAdapter: Send + Sync {
// Required methods
fn provider(&self) -> &str;
fn discover_files(&self) -> Result<Vec<DiscoveredFile>, HistoryError>;
fn extract_meta(
&self,
file_path: &str,
) -> Result<Option<SessionMeta>, HistoryError>;
fn parse_file(
&self,
file_path: &str,
) -> Result<Option<HistorySession>, HistoryError>;
}Expand description
One implementation per CLI provider.
Required Methods§
Sourcefn provider(&self) -> &str
fn provider(&self) -> &str
Provider identifier (e.g., “claude”, “codex”, “gemini”, “kimi”, “openclaw”, “pi”).
Sourcefn discover_files(&self) -> Result<Vec<DiscoveredFile>, HistoryError>
fn discover_files(&self) -> Result<Vec<DiscoveredFile>, HistoryError>
Discover all session file paths on disk. Returns (file_path, mtime_ms) pairs, sorted by mtime descending.
Sourcefn extract_meta(
&self,
file_path: &str,
) -> Result<Option<SessionMeta>, HistoryError>
fn extract_meta( &self, file_path: &str, ) -> Result<Option<SessionMeta>, HistoryError>
Extract lightweight metadata without full parsing.
Sourcefn parse_file(
&self,
file_path: &str,
) -> Result<Option<HistorySession>, HistoryError>
fn parse_file( &self, file_path: &str, ) -> Result<Option<HistorySession>, HistoryError>
Parse a single session file into a full HistorySession.