aboutsummaryrefslogtreecommitdiff
path: root/src/detect.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/detect.rs')
-rw-r--r--src/detect.rs40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/detect.rs b/src/detect.rs
index ae7559bd..bc59fe25 100644
--- a/src/detect.rs
+++ b/src/detect.rs
@@ -16,19 +16,6 @@ pub enum AgentState {
Unknown,
}
-impl AgentState {
- /// Priority for rolling up pane states to a workspace indicator.
- /// Higher = more urgent.
- pub fn priority(self) -> u8 {
- match self {
- Self::Unknown => 0,
- Self::Idle => 1,
- Self::Working => 2,
- Self::Blocked => 3,
- }
- }
-}
-
/// Which agent we detected running in a pane.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Agent {
@@ -106,16 +93,6 @@ pub fn detect_state(agent: Option<Agent>, screen_content: &str) -> AgentState {
}
}
-/// Roll up multiple pane states into a single workspace state.
-/// Returns the highest-priority state among all panes.
-pub fn workspace_state(pane_states: &[AgentState]) -> AgentState {
- pane_states
- .iter()
- .max_by_key(|s| s.priority())
- .copied()
- .unwrap_or(AgentState::Unknown)
-}
-
// ---------------------------------------------------------------------------
// Per-agent detectors
// ---------------------------------------------------------------------------
@@ -622,23 +599,6 @@ mod tests {
// ---- Workspace state rollup ----
- #[test]
- fn workspace_state_blocked_wins() {
- let states = [AgentState::Idle, AgentState::Working, AgentState::Blocked];
- assert_eq!(workspace_state(&states), AgentState::Blocked);
- }
-
- #[test]
- fn workspace_state_working_over_idle() {
- let states = [AgentState::Idle, AgentState::Working, AgentState::Unknown];
- assert_eq!(workspace_state(&states), AgentState::Working);
- }
-
- #[test]
- fn workspace_state_empty() {
- assert_eq!(workspace_state(&[]), AgentState::Unknown);
- }
-
// ---- No agent → Unknown ----
#[test]