From ee51c5e5fbaea694e65bb0a4908f75bcaf9707d1 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Mon, 8 Jun 2026 20:55:51 +0300 Subject: feat: use pty-first agent detection --- src/detect/agents/mod.rs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src/detect/agents/mod.rs') diff --git a/src/detect/agents/mod.rs b/src/detect/agents/mod.rs index 46a25f66..704350df 100644 --- a/src/detect/agents/mod.rs +++ b/src/detect/agents/mod.rs @@ -45,7 +45,6 @@ pub(super) fn detect(agent: Agent, screen_content: &str) -> AgentDetection { state, skip_state_update: true, visible_blocker: false, - visible_idle: false, visible_working: false, }; } @@ -54,7 +53,6 @@ pub(super) fn detect(agent: Agent, screen_content: &str) -> AgentDetection { state, skip_state_update: false, visible_blocker: has_visible_blocker(agent, screen_content, state), - visible_idle: has_visible_idle(agent, screen_content, state), visible_working: has_visible_working(agent, screen_content, state), } } @@ -79,20 +77,20 @@ fn has_visible_blocker(agent: Agent, content: &str, state: AgentState) -> bool { // is known to be structural and live. Agent::Claude => claude_code::has_visible_blocker(content), Agent::Codex => codex::has_visible_blocker(content), + Agent::Gemini => gemini::has_visible_blocker(content), + Agent::Cursor => cursor::has_visible_blocker(content), + Agent::Antigravity => antigravity::has_visible_blocker(content), + Agent::Cline => cline::has_visible_blocker(content), + Agent::OpenCode => opencode::has_visible_blocker(content), + Agent::GithubCopilot => github_copilot::has_visible_blocker(content), Agent::Kimi => kimi::has_visible_blocker(content), - _ => false, - } -} - -fn has_visible_idle(agent: Agent, content: &str, state: AgentState) -> bool { - if state != AgentState::Idle { - return false; - } - - match agent { - Agent::Claude => claude_code::has_prompt_box(content), - Agent::Codex => codex::has_prompt(content), - Agent::Kimi => kimi::has_prompt_box(content), + Agent::Kiro => kiro::has_visible_blocker(content), + Agent::Droid => droid::has_visible_blocker(content), + Agent::Amp => amp::has_visible_blocker(content), + Agent::Grok => grok::has_visible_blocker(content), + Agent::Hermes => hermes::has_visible_blocker(content), + Agent::Kilo => kilo::has_visible_blocker(content), + Agent::Qodercli => qodercli::has_visible_blocker(content), _ => false, } } -- cgit v1.2.3