HistoryAdapter

Trait HistoryAdapter 

Source
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§

Source

fn provider(&self) -> &str

Provider identifier (e.g., “claude”, “codex”, “gemini”, “kimi”, “openclaw”, “pi”).

Source

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.

Source

fn extract_meta( &self, file_path: &str, ) -> Result<Option<SessionMeta>, HistoryError>

Extract lightweight metadata without full parsing.

Source

fn parse_file( &self, file_path: &str, ) -> Result<Option<HistorySession>, HistoryError>

Parse a single session file into a full HistorySession.

Implementors§