diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-10 19:23:13 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-10 19:23:13 +0300 |
| commit | 82468a0e03360219898ebf3735bdf559182009f8 (patch) | |
| tree | 0ee5213fe041a539f23e846f9148493528249512 /src/detect/mod.rs | |
| parent | 36a1b7f86444871f0c38ff36510a6e3c2eec48c6 (diff) | |
feat: add manifest-based detection engine
Diffstat (limited to 'src/detect/mod.rs')
| -rw-r--r-- | src/detect/mod.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/detect/mod.rs b/src/detect/mod.rs index 62dc3d05..6a8a25c5 100644 --- a/src/detect/mod.rs +++ b/src/detect/mod.rs @@ -193,7 +193,18 @@ pub fn detect_state(agent: Option<Agent>, screen_content: &str) -> AgentState { } /// Detect state and whether a visible blocker is present on the current screen. +#[allow(dead_code)] // shim for existing callers; detect_agent_with_osc is the real path pub fn detect_agent(agent: Option<Agent>, screen_content: &str) -> AgentDetection { + detect_agent_with_osc(agent, screen_content, "", "") +} + +/// Detect state using screen content plus OSC title/progress strings. +pub fn detect_agent_with_osc( + agent: Option<Agent>, + screen_content: &str, + osc_title: &str, + osc_progress: &str, +) -> AgentDetection { let Some(agent) = agent else { return AgentDetection { state: AgentState::Unknown, @@ -203,7 +214,14 @@ pub fn detect_agent(agent: Option<Agent>, screen_content: &str) -> AgentDetectio visible_working: false, }; }; - manifest::detect(agent, screen_content) + manifest::detect_with_osc( + agent, + manifest::DetectionInput { + screen: screen_content, + osc_title, + osc_progress, + }, + ) } pub fn should_skip_state_update(agent: Option<Agent>, screen_content: &str) -> bool { @@ -218,6 +236,7 @@ pub(crate) fn full_lifecycle_hook_authority(source: &str, agent_label: &str) -> | ("herdr:hermes", "hermes") | ("herdr:opencode", "opencode") | ("herdr:kilo", "kilo") + | ("herdr:kimi", "kimi") ) } |
