👾 Open Computer Use – Open-Source Alternative to Codex Computer Use
Swift accessibilityai-agentai-agentsclaude-codecodexcodex-computer-usecomputer-usecomputer-use-agentcross-platformcuadesktop-automationgemini-cligui-automationmacosmcpmodel-context-protocolopen-computer-useopen-computer-use-mcpopenai-codexopencode
[2026-07-22 19:05] | Task: 添加 macOS SkyLight 后台点击
🤖 Execution Context
- Agent ID:
/root - Base Model:
GPT-5 - Runtime:
Codex desktop / macOS arm64
📥 User Query
阅读 Cua 的 macOS Window Internals 文章及相关开源库,为 OCU 实现
sky_click后台点击方式。
🛠 Changes Overview
Scope: macOS click runtime、三平台工具协议、测试、skill 文档与第三方归属。
Key Actions:
- SkyLight route: 新增运行时
dlopen/dlsym桥接,使用SLPSPostEventRecordTofocus-without-raise、SLEventPostToPid、window-local event fields、off-window Chromium primer 和恢复阶段。 - Safety boundary:
sky_click保持显式 macOS-only,不进入auto、不 fallback;只接受当前 on-screen 同 PID 窗口上的左键单击/双击,并串行化 AppKit-active 状态切换。 - Cross-platform contract: macOS、Windows、Linux 同步
sky_click枚举;Windows / Linux 在 snapshot lookup 前返回稳定 unsupported。 - Verification: 增加事件 recipe、activation record、符号/ABI、窗口身份和平台 parser 测试,并加入默认跳过的隔离 Chrome 完全遮挡实机回归。
- Attribution: 固定 Cua / yabai 参考 commit,补充 MIT third-party notices 和私有 SPI 兼容性文档。
🧠 Design Intent (Why)
Chrome 在被其他窗口遮挡时会丢弃普通 CGEvent.postToPid mouse event。完整后台路径需要先只切 AppKit event-routing active state、保持 WindowServer frontmost 与 z-order 不变,再通过带 Chromium telemetry 和 primer 的 SkyLight 事件投递;结束后恢复当前实际前台进程的 AppKit 状态。该能力风险高且依赖私有 ABI,因此保持显式 opt-in、fail closed,并用受控 Chrome 页面验证不重复触发和无前台副作用。
✅ Verification
swift test:147 tests,0 failures;默认跳过 1 个显式 live test。OPEN_COMPUTER_USE_RUN_SKY_CLICK_LIVE_TEST=1 swift test --filter SkyClickLiveTests:隔离 Chrome 被 Fixture 完全覆盖时触发恰好一次,前台 PID、真实 cursor 与 z-order 不变;最终实现连续通过。- Windows / Linux:
go test ./...通过。 npm run package:skill通过。./scripts/run-tool-smoke-tests.sh通过完整 tool smoke 与 cursor idle smoke。
📁 Files Modified
packages/OpenComputerUseKit/Sources/OpenComputerUseKit/SkyLightSPI.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/SkyClickSimulation.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/InputSimulation.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/ToolDefinitions.swiftpackages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/apps/OpenComputerUseWindows/apps/OpenComputerUseLinux/skills/open-computer-use/references/usage.mddocs/ARCHITECTURE.mddocs/SECURITY.mddocs/RELIABILITY.mddocs/references/macos-skylight-background-click.mdTHIRD_PARTY_NOTICES.md