aboutsummaryrefslogtreecommitdiff
path: root/src/detect/agents/github_copilot.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/detect/agents/github_copilot.rs')
-rw-r--r--src/detect/agents/github_copilot.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/detect/agents/github_copilot.rs b/src/detect/agents/github_copilot.rs
new file mode 100644
index 00000000..eed03011
--- /dev/null
+++ b/src/detect/agents/github_copilot.rs
@@ -0,0 +1,24 @@
+use super::super::AgentState;
+
+pub(super) fn detect(content: &str) -> AgentState {
+ let lower = content.to_lowercase();
+
+ // Blocked
+ if lower.contains("esc to cancel")
+ && (lower.contains("enter to select")
+ || lower.contains("enter to confirm")
+ || lower.contains("enter to submit"))
+ {
+ return AgentState::Blocked;
+ }
+
+ // Working
+ if lower.contains("esc to cancel")
+ || lower.contains("esc cancel")
+ || lower.contains("esc again to cancel")
+ {
+ return AgentState::Working;
+ }
+
+ AgentState::Idle
+}