use chrono::{DateTime, Utc};
use serde::Serialize;
use std::path::PathBuf;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum Role {
User,
Assistant,
Tool,
}
impl Role {
pub fn label(&self) -> &'static str {
match self {
Role::User => "user",
Role::Assistant => "assistant",
Role::Tool => "tool",
}
}
}
#[derive(Debug, Serialize)]
pub struct Message {
pub role: Role,
pub text: String,
pub ts: Option<DateTime<Utc>>,
}
#[derive(Debug, Serialize)]
pub struct Session {
pub id: String,
pub tool: &'static str,
pub path: PathBuf,
pub project: String,
pub started: Option<DateTime<Utc>>,
pub ended: Option<DateTime<Utc>>,
pub title: String,
pub subagent: bool,
pub messages: Vec<Message>,
pub touched: Vec<String>,
}
pub struct StoreReport {
pub tool: &'static str,
pub root: PathBuf,
pub files: usize,
pub bytes: u64,
pub oldest: Option<DateTime<Utc>>,
pub newest: Option<DateTime<Utc>>,
}