//! Models for claude-mem data (`~/.claude-mem/claude-mem.db`)
//!
//! claude-mem is an optional Claude Code plugin that captures tool use activity
//! and stores structured session summaries and observations in a local SQLite database.

/// A session summary generated by claude-mem at the end of each Claude Code session.
///
/// This is the high-value data: what was asked, what was accomplished, what's next.
#[derive(Debug, Clone)]
pub struct ClaudeMemSummary {
    pub id: i64,
    pub memory_session_id: String,
    /// Project name (basename of working directory)
    pub project: String,
    /// What the user asked / the session goal
    pub request: Option<String>,
    /// What was accomplished during the session
    pub completed: Option<String>,
    /// Suggested next steps
    pub next_steps: Option<String>,
    /// Files edited during the session
    pub files_edited: Option<String>,
    /// ISO 8601 timestamp
    pub created_at: String,
}

impl ClaudeMemSummary {
    /// One-line display: the request text, truncated
    pub fn headline(&self) -> &str {
        self.request
            .as_deref()
            .filter(|s| !s.is_empty())
            .unwrap_or("(no summary)")
    }
}
