diff --git a/src/fenrirscreenreader/commands/onScreenUpdate/65000-progress_detector.py b/src/fenrirscreenreader/commands/onScreenUpdate/65000-progress_detector.py index a1150468..f67312be 100644 --- a/src/fenrirscreenreader/commands/onScreenUpdate/65000-progress_detector.py +++ b/src/fenrirscreenreader/commands/onScreenUpdate/65000-progress_detector.py @@ -305,11 +305,12 @@ class command: self.env["commandBuffer"]["lastProgressTime"] = current_time return - # Pattern 6: Claude Code working indicators (various symbols + activity word + "esc to interrupt") - # Matches any: [symbol] [Word]… (... esc to interrupt ...) + # Pattern 6: Claude Code working indicators (various symbols + activity text + "esc to interrupt") + # Matches any: [symbol] [Task description]… (... esc to interrupt ...) # Symbols include: * ✢ ✽ ✶ ✻ · • ◦ ○ ● ◆ and similar decorative characters + # Example: ✽ Reviewing script for issues… (esc to interrupt · ctrl+t to show todos · 1m 25s · ↑ 887 tokens) claude_progress_match = re.search( - r'[*✢✽✶✻·•◦○●◆]\s*\w+…?\s*\(.*esc to interrupt.*\)', + r'[*✢✽✶✻·•◦○●◆]\s+\w+.*?…\s*\(.*esc to interrupt.*\)', text, re.IGNORECASE, ) @@ -323,6 +324,23 @@ class command: self.env["commandBuffer"]["lastProgressTime"] = current_time return + # Pattern 6b: Claude Code tool invocation indicators (● Tool Name(...)) + # Example: ● Web Search("query here") + tool_invocation_match = re.search( + r'[●○◉]\s+(?:Web\s*Search|Read|Write|Edit|Bash|Glob|Grep|Task|WebFetch)\s*\(', + text, + re.IGNORECASE, + ) + if tool_invocation_match: + if current_time - self.env["commandBuffer"]["lastProgressTime"] >= 1.0: + self.env["runtime"]["DebugManager"].write_debug_out( + "Playing Claude Code tool invocation beep", + debug.DebugLevel.INFO, + ) + self.play_activity_beep() + self.env["commandBuffer"]["lastProgressTime"] = current_time + return + # Pattern 7: Moon phase spinner indicators moon_match = re.search(r'[🌑🌒🌓🌔🌕🌖🌗🌘]', text) if moon_match: