mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
Initial scaffold for ECC 2.0, a terminal-native agentic IDE built with Ratatui. Compiles to a 3.4MB single binary. Core modules: - Session manager with SQLite-backed state store - TUI dashboard with split-pane layout (sessions, output, metrics) - Worktree orchestration (auto-create per agent session) - Observability with tool call risk scoring - Inter-agent communication via SQLite mailbox - Background daemon with heartbeat monitoring - CLI with start/stop/sessions/status/daemon subcommands Tech stack: Rust + Ratatui + Crossterm + Tokio + rusqlite + git2 + clap
60 lines
1.5 KiB
Rust
60 lines
1.5 KiB
Rust
pub mod daemon;
|
|
pub mod manager;
|
|
pub mod store;
|
|
|
|
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
use std::fmt;
|
|
use std::path::PathBuf;
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct Session {
|
|
pub id: String,
|
|
pub task: String,
|
|
pub agent_type: String,
|
|
pub state: SessionState,
|
|
pub worktree: Option<WorktreeInfo>,
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
pub metrics: SessionMetrics,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
|
pub enum SessionState {
|
|
Pending,
|
|
Running,
|
|
Idle,
|
|
Completed,
|
|
Failed,
|
|
Stopped,
|
|
}
|
|
|
|
impl fmt::Display for SessionState {
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
match self {
|
|
SessionState::Pending => write!(f, "pending"),
|
|
SessionState::Running => write!(f, "running"),
|
|
SessionState::Idle => write!(f, "idle"),
|
|
SessionState::Completed => write!(f, "completed"),
|
|
SessionState::Failed => write!(f, "failed"),
|
|
SessionState::Stopped => write!(f, "stopped"),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct WorktreeInfo {
|
|
pub path: PathBuf,
|
|
pub branch: String,
|
|
pub base_branch: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
|
pub struct SessionMetrics {
|
|
pub tokens_used: u64,
|
|
pub tool_calls: u64,
|
|
pub files_changed: u32,
|
|
pub duration_secs: u64,
|
|
pub cost_usd: f64,
|
|
}
|