#![allow(dead_code, unused_imports)]
#[cfg(test)]
mod benches;
mod cross_tab;
mod delegator;
pub mod group;
#[cfg(test)]
mod key_e2e;
mod manager;
pub mod meeting;
pub mod mention;
pub mod persistence;
pub use manager::TabManager;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct TabId(pub u64);
impl TabId {
pub fn new(id: u64) -> Self {
Self(id)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
pub enum TabType {
#[default]
Chat,
Delegation,
Review,
Meeting,
}
impl TabType {
pub fn icon(&self) -> &'static str {
match self {
TabType::Chat => "💬",
TabType::Delegation => "📤",
TabType::Review => "🔍",
TabType::Meeting => "👥",
}
}
pub fn ascii_icon(&self) -> &'static str {
match self {
TabType::Chat => "[C]",
TabType::Delegation => "[D]",
TabType::Review => "[R]",
TabType::Meeting => "[M]",
}
}
pub fn display_name(&self) -> &'static str {
match self {
TabType::Chat => "Chat",
TabType::Delegation => "Delegation",
TabType::Review => "Review",
TabType::Meeting => "Meeting",
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TabMetadata {
pub id: TabId,
pub title: String,
pub tab_type: TabType,
pub created_at: DateTime<Utc>,
pub last_active: DateTime<Utc>,
pub unread_count: usize,
pub agent_name: Option<String>,
pub session_path: Option<PathBuf>,
}
impl TabMetadata {
pub fn new(id: TabId, title: String, tab_type: TabType) -> Self {
let now = Utc::now();
Self {
id,
title,
tab_type,
created_at: now,
last_active: now,
unread_count: 0,
agent_name: None,
session_path: None,
}
}
pub fn touch(&mut self) {
self.last_active = Utc::now();
}
pub fn increment_unread(&mut self) {
self.unread_count += 1;
}
pub fn clear_unread(&mut self) {
self.unread_count = 0;
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Default)]
pub enum Priority {
Low = 0,
#[default]
Normal = 1,
High = 2,
Urgent = 3,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
pub enum TabStatus {
Active,
#[default]
Idle,
Loading,
Error,
}