/// Analysis module - AI-powered activity classification /// For MVP: uses heuristic-based classification /// Future: integrate Mistral 7B for advanced analysis pub mod classifier; pub mod entities; pub use classifier::{Classifier, ClassificationResult}; pub use entities::EntityExtractor; use serde::{Deserialize, Serialize}; /// Available activity categories (as per MVP spec) #[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum ActivityCategory { Development, Meeting, Research, Design, Other, } impl ActivityCategory { pub fn as_str(&self) -> &'static str { match self { Self::Development => "Development", Self::Meeting => "Meeting", Self::Research => "Research", Self::Design => "Design", Self::Other => "Other", } } pub fn from_str(s: &str) -> Self { match s.to_lowercase().as_str() { "development" => Self::Development, "meeting" => Self::Meeting, "research" => Self::Research, "design" => Self::Design, _ => Self::Other, } } pub fn all() -> Vec { vec![ Self::Development, Self::Meeting, Self::Research, Self::Design, Self::Other, ] } } /// Extracted entities from activity #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Entities { pub project: Option, pub tool: Option, pub language: Option, pub other: Vec, } impl Entities { pub fn new() -> Self { Self { project: None, tool: None, language: None, other: Vec::new(), } } pub fn to_json(&self) -> String { serde_json::to_string(self).unwrap_or_default() } } impl Default for Entities { fn default() -> Self { Self::new() } }