use std::time::Duration;
#[derive(Debug, Clone)]
pub struct SessionActivity {
pub activity_type: ActivityType,
pub details: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ActivityType {
Message,
ToolUse,
Command,
FileAccess,
}
impl SessionActivity {
pub fn new(activity_type: ActivityType) -> Self {
Self {
activity_type,
details: None,
}
}
pub fn with_details(mut self, details: String) -> Self {
self.details = Some(details);
self
}
}
pub struct SessionActivityTracker {
_activities: Vec<SessionActivity>,
}
impl SessionActivityTracker {
pub fn new() -> Self {
Self {
_activities: Vec::new(),
}
}
pub fn record(&mut self, activity: SessionActivity) {
self._activities.push(activity);
}
pub fn get_activities(&self) -> &[SessionActivity] {
&self._activities
}
pub fn get_recent_count(&self, _duration: Duration) -> usize {
self._activities.len()
}
pub fn clear(&mut self) {
self._activities.clear();
}
}
impl Default for SessionActivityTracker {
fn default() -> Self {
Self::new()
}
}