use serde::{Deserialize, Serialize};
use std::path::PathBuf;
#[derive(Debug, Clone)]
pub struct CacheConfig {
pub db_path: PathBuf,
pub session_id: String,
pub workdir: PathBuf,
}
impl Default for CacheConfig {
fn default() -> Self {
Self {
db_path: PathBuf::from(".cached-context/cache.db"),
session_id: uuid::Uuid::new_v4().to_string(),
workdir: std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")),
}
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct FileReadResult {
pub cached: bool,
pub content: String,
pub hash: String,
pub total_lines: usize,
pub lines_changed: Option<usize>,
pub diff: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CacheStats {
pub files_tracked: usize,
pub tokens_saved: u64,
pub session_tokens_saved: u64,
}