agent_status.rs (1396B)
1 /// Represents the current status of an agent in the RTS scene 2 #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] 3 pub enum AgentStatus { 4 /// Agent is idle, no active work 5 #[default] 6 Idle, 7 /// Agent is actively processing (receiving tokens, executing tools) 8 Working, 9 /// Agent needs user input (permission request pending) 10 NeedsInput, 11 /// Agent encountered an error 12 Error, 13 /// Agent completed its task successfully 14 Done, 15 } 16 17 impl AgentStatus { 18 /// Get the color associated with this status 19 pub fn color(&self) -> egui::Color32 { 20 match self { 21 AgentStatus::Idle => egui::Color32::from_rgb(128, 128, 128), // Gray 22 AgentStatus::Working => egui::Color32::from_rgb(50, 205, 50), // Green 23 AgentStatus::NeedsInput => egui::Color32::from_rgb(255, 200, 0), // Yellow/amber 24 AgentStatus::Error => egui::Color32::from_rgb(220, 60, 60), // Red 25 AgentStatus::Done => egui::Color32::from_rgb(70, 130, 220), // Blue 26 } 27 } 28 29 /// Get a human-readable label for this status 30 pub fn label(&self) -> &'static str { 31 match self { 32 AgentStatus::Idle => "Idle", 33 AgentStatus::Working => "Working", 34 AgentStatus::NeedsInput => "Needs Input", 35 AgentStatus::Error => "Error", 36 AgentStatus::Done => "Done", 37 } 38 } 39 }