diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-08 20:55:51 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-09 04:26:19 +0300 |
| commit | ee51c5e5fbaea694e65bb0a4908f75bcaf9707d1 (patch) | |
| tree | f566d2a5921d4112602a7abcffb5cf6eb04d5f24 /src/detect/agents/kimi.rs | |
| parent | a7cd7806f2fa0251e2dca41ffec61ceafb6f0e18 (diff) | |
feat: use pty-first agent detection
Diffstat (limited to 'src/detect/agents/kimi.rs')
| -rw-r--r-- | src/detect/agents/kimi.rs | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/detect/agents/kimi.rs b/src/detect/agents/kimi.rs index b42bf885..9d3821ed 100644 --- a/src/detect/agents/kimi.rs +++ b/src/detect/agents/kimi.rs @@ -16,10 +16,6 @@ pub(super) fn has_visible_blocker(content: &str) -> bool { has_current_approval_panel(content) || has_question_panel(content) } -pub(super) fn has_prompt_box(content: &str) -> bool { - has_editor_prompt_box(content) && has_footer_context(content) -} - pub(super) fn has_visible_working(content: &str) -> bool { has_kimi_working_status(content) } @@ -99,49 +95,3 @@ fn has_question_panel(content: &str) -> bool { fn has_numeric_choose_hint(lower_content: &str) -> bool { lower_content.contains(" choose") && lower_content.contains('1') && lower_content.contains('2') } - -fn has_editor_prompt_box(content: &str) -> bool { - let lines: Vec<&str> = content.lines().collect(); - - for top_index in 0..lines.len() { - if !is_editor_top_border(lines[top_index]) { - continue; - } - - let mut saw_prompt = false; - for line in lines.iter().skip(top_index + 1) { - if is_editor_bottom_border(line) { - if saw_prompt { - return true; - } - break; - } - - saw_prompt |= is_editor_prompt_line(line); - } - } - - false -} - -fn is_editor_top_border(line: &str) -> bool { - let trimmed = line.trim(); - ((trimmed.starts_with('╭') && trimmed.ends_with('╮')) - || (trimmed.starts_with('├') && trimmed.ends_with('┤'))) - && trimmed.contains('─') -} - -fn is_editor_bottom_border(line: &str) -> bool { - let trimmed = line.trim(); - trimmed.starts_with('╰') && trimmed.ends_with('╯') && trimmed.contains('─') -} - -fn is_editor_prompt_line(line: &str) -> bool { - let trimmed = line.trim_start(); - let inner = trimmed.strip_prefix('│').unwrap_or(trimmed).trim_start(); - inner.starts_with('>') -} - -fn has_footer_context(content: &str) -> bool { - content.to_lowercase().contains("context: ") -} |
