feat: enable Computer Use with Windows support#97
feat: enable Computer Use with Windows support#97amDosion wants to merge 1 commit intoclaude-code-best:mainfrom
Conversation
Phase 1: Replace @ant/computer-use-mcp stub with full implementation (12 files, 6517 lines from reference project). Phase 2-3: Refactor @ant/computer-use-input and @ant/computer-use-swift from single-file to dispatcher + backends/ architecture: - backends/darwin.ts — existing macOS AppleScript (unchanged logic) - backends/win32.ts — new Windows PowerShell (SetCursorPos, SendInput, CopyFromScreen, GetForegroundWindow) Add CHICAGO_MCP to default build features. Verified on Windows x64: mouse control, dual-monitor detection, full-screen screenshot, foreground app info, running process list. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request restores and expands "Computer Use" cross-platform functionality by refactoring three packages into backend-dispatched architectures supporting both macOS and Windows, replacing an MCP stub with a full server implementation featuring permission management, app categorization, key blocking, and screenshot validation. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User/Host
participant Session as ComputerUseSessionContext
participant Dispatcher as MCP Dispatcher<br/>(bindSessionContext)
participant Tool as Tool Handler<br/>(handleToolCall)
participant Platform as Platform Backend<br/>(darwin/win32)
participant UI as Screenshot/Display
User->>Session: Initialize session context
Session->>Dispatcher: Create call dispatcher with context
User->>Dispatcher: Call tool (e.g., click @ x,y)
Dispatcher->>Dispatcher: Check/acquire execution lock
Dispatcher->>Session: Fetch allowed apps & grant flags
Dispatcher->>Tool: Dispatch to handleToolCall
Tool->>Tool: Validate click target pixels<br/>(comparePixelAtLocation)
Tool->>Platform: Execute input action
Platform->>Platform: Platform-specific impl<br/>(AppleScript/PowerShell)
Platform-->>Tool: Action result
Tool->>Tool: Capture screenshot<br/>(if needed)
Tool->>UI: Call screenshot backend
UI->>Platform: Capture screen (darwin/win32)
Platform-->>UI: Return screenshot base64
UI-->>Tool: Screenshot result
Tool->>Tool: Persist screenshot in closure
Tool->>Session: Forward screenshot dimensions
Tool-->>Dispatcher: Return tool result<br/>(stripped of telemetry)
Dispatcher->>Dispatcher: Abort any in-flight dialog
Dispatcher-->>User: MCP response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes 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 |
|
功能尚未完整:需要修正平台限制、GrowthBook 默认值、以及新增 /computer-use 命令 |
Summary
@ant/computer-use-mcpstub 为完整实现(12 文件,6517 行)@ant/computer-use-input和@ant/computer-use-swift为 dispatcher + backends/ 架构CHICAGO_MCP加入默认编译开关Architecture
Key design
open()直接启动 exe 路径(Start-Process)backends/linux.ts,不动其他文件Test plan
bun run dev启动无报错🤖 Generated with Claude Code
Summary by CodeRabbit