Two root causes fixed:
1. swiftLoader.ts: require('@ant/computer-use-swift') returns a module
with { ComputerUseAPI } class, not an instance. macOS native .node
exports a plain object. Fixed by detecting class export and calling
new ComputerUseAPI().
2. executor.ts resolvePrepareCapture: toolCalls.ts expects result to have
{ hidden: string[], displayId: number } fields. Our ComputerUseAPI
returns { base64, width, height } only. Fixed by backfilling missing
fields with defaults.
Verified: request_access → screenshot → left_click all work on Windows.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New Windows-native capabilities:
- windowCapture.ts: PrintWindow API for per-window screenshot (works on
occluded/background windows)
- windowEnum.ts: EnumWindows for precise window enumeration with HWND
- uiAutomation.ts: IUIAutomation for UI tree reading, element clicking,
text input, and coordinate-based element identification
- ocr.ts: Windows.Media.Ocr for screen text recognition (en-US + zh-CN)
Updated win32.ts backend to use EnumWindows for listRunning() and added
captureWindowTarget() for window-specific screenshots.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These two exported functions in src/utils/path.ts lacked unit tests.
toRelativePath wraps Node's path.relative() and keeps the absolute
path when the result would start with '..' (i.e. the target is outside
the CWD). Four tests cover: child-of-cwd, outside-cwd, cwd-itself,
and the type-safety invariant.
getDirectoryForPath uses statSync to distinguish directories from files,
falling back to dirname() for non-existent paths and bypassing the
filesystem for UNC paths (NTLM credential-leak prevention). Three tests
cover: existing directory, known file, and non-existent path.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
These two exported functions in src/utils/format.ts had no test
coverage. formatRelativeTimeAgo wraps formatRelativeTime and forces
numeric:'always' for past dates; formatLogMetadata assembles parts
(time, branch, size/count, tag, agentSetting, prNumber) into a
' · '-separated string.
Added 8 tests for formatRelativeTimeAgo covering past dates, future
dates, equal-to-now, and the no-'ago'-for-future invariant. Added
9 tests for formatLogMetadata covering all optional fields and the
separator format.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the 6-line stub in @ant/claude-for-chrome-mcp with the complete
implementation (8 files, 3038 lines) from the reference project.
Provides 17 browser tools: navigate, screenshot, click, type, read DOM,
execute JS, record GIF, monitor console/network, manage tabs, etc.
No feature flag needed. No changes to src/ (already matches official).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>