feat(cua-driver): consolidate type_text; remove get_accessibility_tree - #1416
Conversation
type_text now auto-falls back to CGEvent character synthesis when the AX write is rejected — covers Chromium/Electron inputs without requiring the caller to choose between two tools. Adds delay_ms param (default 30ms, used only in the CGEvent path). TypeTextCharsTool deleted; all references updated to type_text throughout docs, skills, and tests. get_accessibility_tree removed — its functionality (running apps + window list) is fully covered by list_apps and list_windows. Tool file deleted, removed from ToolRegistry, stale doc references updated to list_windows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughThis PR consolidates typing functionality by removing Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client
participant TypeTextHandler as TypeTextTool Handler
participant AXInput as AXInput
participant KeyboardInput as KeyboardInput
participant System as OS
Client->>TypeTextHandler: type_text(element_index, text, delay_ms)
TypeTextHandler->>AXInput: Try setAttribute("AXSelectedText")
alt AX Success
AXInput->>TypeTextHandler: Success
TypeTextHandler->>Client: ✓ Text inserted via AX
else AX Fails
AXInput->>TypeTextHandler: AXInputError
TypeTextHandler->>KeyboardInput: typeCharacters(text, pid, delay_ms)
KeyboardInput->>System: CGEvent.postToPid (per-character)
System->>KeyboardInput: Events posted
KeyboardInput->>TypeTextHandler: Success
TypeTextHandler->>Client: ✓ Text inserted via CGEvent (AX fallback)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Summary
type_textconsolidationtype_text_charsis deleted.type_textnow auto-falls back to CGEvent character synthesis (CGEvent.postToPid) when the AX attribute write is rejected — covers Chromium/Electron inputs transparently.delay_msparam (0–200, default 30ms) controls inter-character delay in the CGEvent fallback path; ignored when the AX path succeeds.via AXorvia CGEvent (AX fallback)).get_accessibility_treeremovallist_appsandlist_windows.list_windows.Test plan
swift buildclean ✅type_texton a Cocoa text field → summary saysvia AXtype_texton a Chrome input → falls back to CGEvent, summary saysvia CGEvent (AX fallback)cua-driver get_accessibility_tree→Unknown toolerrorlist_appsandlist_windowsstill work🤖 Generated with Claude Code
Summary by CodeRabbit
Removed Features
type_text_charsandget_accessibility_treetoolsImprovements
type_texttool now automatically handles typing in Chromium and Electron applications with seamless fallbackdelay_msparameter totype_textfor controlling fallback timing (0-200ms, default 30ms)Bug Fixes