feat: Computer Use Windows — 跨平台 executor + Python Bridge + GUI 无障碍#136
feat: Computer Use Windows — 跨平台 executor + Python Bridge + GUI 无障碍#136amDosion wants to merge 2 commits intoclaude-code-best:mainfrom
Conversation
三平台 Computer Use (macOS + Windows + Linux),Windows 专项增强。
- MCP server: toolCalls/tools/executor/mcpServer 等 12 文件完整实现
- 平台抽象层: platforms/{win32,darwin,linux}.ts
- 跨平台 executor: executorCrossPlatform.ts
- CHICAGO_MCP + VOICE_MODE feature flags 启用
- windowMessage.ts: SendMessageW (WM_CHAR Unicode + 剪贴板粘贴)
- windowBorder.ts: 4 叠加窗口边框 (30fps 跟踪)
- uiAutomation.ts: UI Automation 元素树/点击/写值
- accessibilitySnapshot.ts: 无障碍快照 → 模型感知 GUI
- bridge.py + bridgeClient.ts: Python 长驻进程 (替代 per-call PS)
- window_management: min/max/restore/close/focus (Win32 API)
- click_element / type_into_element: 按名称操作 (无需坐标)
- 截图自动附带 Accessibility Snapshot
- 17 种方法, stdin/stdout JSON 通信
- 窗口枚举 1.5ms vs PS 500ms, 截图 360ms vs PS 800ms
- 依赖: mss + Pillow + pywinauto
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR refactors Computer Use to support cross-platform operation (macOS, Windows, Linux) by introducing a platform abstraction layer, making native packages macOS-only, implementing Windows/Linux backends with platform-specific APIs, and extending the executor interface with Windows-specific capabilities like window binding, UI Automation, and virtual input routing. Changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
在已合并的三平台 Computer Use 基础上(PR #98),大幅增强 Windows 专项能力:
executorCrossPlatform.ts, 1143 行) — 统一的工具调用执行层,替代原有平台分散逻辑bridge.py+bridgeClient.ts) — 长驻 Python 进程替代逐次 PowerShell 调用,窗口枚举 1.5ms vs 500ms,截图 360ms vs 800msclick_element/type_into_element按名称操作无需坐标新增文件 (22 个)
executorCrossPlatform.tsplatforms/{win32,darwin,linux,types,index}.tswin32/windowMessage.tswin32/bridge.py+bridgeClient.tswin32/uiAutomation.tswin32/accessibilitySnapshot.tswin32/ocr.tswin32/windowBorder.tswin32/windowEnum.tswin32/virtualCursor.tswin32/inputIndicator.tswin32/comExcel.ts/comWord.tswin32/shared.ts/appDispatcher.tstoolCalls.ts/tools.ts/executor.ts/mcpServer.ts等修改文件 (14 个)
主要是移除 macOS 硬编码、扩展平台支持、增加 feature flag。
Test plan
bun run dev→ Computer Use 工具可用click_element/type_into_element按名称操作bun run build成功🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
Documentation