Skip to content

👾 Open Computer Use – Open-Source Alternative to Codex Computer Use

Bundle cross-platform npm artifacts

Leo023eea454b99
diff --git a/README.md b/README.md
index 973d637..57cc7a6 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ I bootstrapped this repo with my earlier [harness template](https://github.com/i
## Quick Start
-The npm package installs a root launcher plus the native package that matches your current `os-arch`:
+The npm package bundles the macOS, Linux, and Windows native runtimes, then the root launcher selects the artifact that matches your current `os-arch`:
```bash
npm i -g open-computer-use
@@ -24,7 +24,7 @@ npm i -g open-computer-use
On macOS, grant `Accessibility` and `Screen Recording` permission to the `Open Computer Use.app` you actually plan to keep installed. The CI-built release package remains the stable identity for distribution. Local debug/dev builds are intentionally packaged as `Open Computer Use (Dev).app`, so System Settings shows them as a separate development app instead of another indistinguishable `Open Computer Use`.
-On Linux and Windows, run it in the signed-in desktop session so AT-SPI2 or UI Automation can see GUI apps. To confirm the installed native package is wired correctly, run:
+On Linux and Windows, run it in the signed-in desktop session so AT-SPI2 or UI Automation can see GUI apps. To confirm the bundled native runtime is wired correctly, run:
```bash
open-computer-use --version
diff --git a/README.zh-CN.md b/README.zh-CN.md
index fa69b6c..91c370f 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -16,7 +16,7 @@ https://github.com/user-attachments/assets/eacb3b15-f939-46c7-b3b3-6f876977a58d
## Quick Start
-当前 npm 包会安装 root launcher,并按当前 `os-arch` 拉起对应 native package:
+当前 npm 包会内置 macOS、Linux、Windows 的 native runtime,并由 root launcher 按当前 `os-arch` 拉起对应制品:
```bash
npm i -g open-computer-use
@@ -24,7 +24,7 @@ npm i -g open-computer-use
macOS 第一次使用前,给你实际准备长期保留的那个 `Open Computer Use.app` 授予 `Accessibility` 和 `Screen Recording` 权限。CI 产出的 release 包继续作为正式分发身份;本地 debug/dev 构建会故意打成 `Open Computer Use (Dev).app`,这样系统设置里会明确显示成一个开发版 app,而不是再出现两个同名的 `Open Computer Use`。
-Linux 和 Windows 需要跑在已登录桌面 session 里,这样 AT-SPI2 或 UI Automation 才能看到 GUI app。先用下面的命令确认 native package 已经接好:
+Linux 和 Windows 需要跑在已登录桌面 session 里,这样 AT-SPI2 或 UI Automation 才能看到 GUI app。先用下面的命令确认内置 native runtime 已经接好:
```bash
open-computer-use --version
diff --git a/apps/OpenComputerUseLinux/main.go b/apps/OpenComputerUseLinux/main.go
index d4cccc1..5b18bb9 100644
--- a/apps/OpenComputerUseLinux/main.go
+++ b/apps/OpenComputerUseLinux/main.go
@@ -17,7 +17,7 @@ import (
"time"
)
-var version = "0.1.34"
+var version = "0.1.35"
//go:embed runtime.py
var linuxRuntimeScript string
diff --git a/apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift b/apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift
index 55c9688..3f383da 100644
--- a/apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift
+++ b/apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift
@@ -35,7 +35,7 @@ final class MCPClient {
_ = try request(method: "initialize", params: [
"clientInfo": [
"name": "OpenComputerUseSmokeSuite",
- "version": "0.1.34",
+ "version": "0.1.35",
],
"capabilities": [:],
"protocolVersion": "2025-03-26",
diff --git a/apps/OpenComputerUseWindows/main.go b/apps/OpenComputerUseWindows/main.go
index 7e2eafb..eb6440a 100644
--- a/apps/OpenComputerUseWindows/main.go
+++ b/apps/OpenComputerUseWindows/main.go
@@ -16,7 +16,7 @@ import (
"time"
)
-var version = "0.1.34"
+var version = "0.1.35"
//go:embed runtime.ps1
var windowsRuntimeScript string
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md
index 6118200..c33184c 100644
--- a/docs/ARCHITECTURE.md
+++ b/docs/ARCHITECTURE.md
@@ -11,9 +11,9 @@
- `apps/OpenComputerUseSmokeSuite`
端到端 smoke runner,会拉起 fixture 和 MCP server,并通过 JSON-RPC 真实调用 9 个 tools;同时也支持单独的 visual cursor idle smoke,用跨进程 observation file 断言等待下一次 move 时是 anchored tip + tiny rotate wobble,而不是横向漂移。
- `apps/OpenComputerUseWindows`
- 实验性 Windows runtime。它不依赖 Swift 或 `.app` bundle,Go CLI/MCP 入口会嵌入 PowerShell UI Automation bridge,构建产物是 `open-computer-use.exe`,并通过 `open-computer-use-win32-arm64` / `open-computer-use-win32-x64` npm platform packages 分发。
+ 实验性 Windows runtime。它不依赖 Swift 或 `.app` bundle,Go CLI/MCP 入口会嵌入 PowerShell UI Automation bridge,构建产物是 `open-computer-use.exe`,并随已有 npm 包的 `dist/windows/<arch>/` bundled artifacts 分发。
- `apps/OpenComputerUseLinux`
- 实验性 Linux runtime。它不依赖 Swift 或 `.app` bundle,Go CLI/MCP 入口会嵌入 Python AT-SPI bridge,构建产物是 `open-computer-use`,并通过 `open-computer-use-linux-arm64` / `open-computer-use-linux-x64` npm platform packages 分发。
+ 实验性 Linux runtime。它不依赖 Swift 或 `.app` bundle,Go CLI/MCP 入口会嵌入 Python AT-SPI bridge,构建产物是 `open-computer-use`,并随已有 npm 包的 `dist/linux/<arch>/` bundled artifacts 分发。
- `packages/OpenComputerUseKit`
核心库,包含:
- MCP stdio transport 与 tool registry
@@ -101,7 +101,7 @@
### 6. Windows Runtime
- Windows runtime 位于 `apps/OpenComputerUseWindows`,以 Go 维护 CLI、`call --calls` sequence、MCP JSON-RPC、tool schema 和进程内 snapshot cache。
-- 构建入口是 `scripts/build-open-computer-use-windows.sh --arch arm64|amd64`,默认输出到 `dist/windows/<arch>/open-computer-use.exe`;npm release package 会把它们分别封装为 `open-computer-use-win32-arm64` 和 `open-computer-use-win32-x64`,由 root `open-computer-use` package 的 `optionalDependencies` 按 `process.platform/process.arch` 自动选择。
+- 构建入口是 `scripts/build-open-computer-use-windows.sh --arch arm64|amd64`,默认输出到 `dist/windows/<arch>/open-computer-use.exe`;npm release package 会把两个 Windows artifact 内置到已有 root/alias packages,Node launcher 按 `process.platform/process.arch` 自动选择。
- Go runtime 通过 `go:embed` 带上 `runtime.ps1`,执行 tool call 时临时落盘并调用 Windows PowerShell。PowerShell bridge 使用 `System.Windows.Automation` 做 app/window/element discovery、tree rendering、UIA pattern action、ValuePattern set value 和 ScrollPattern scroll;当目标 app 不暴露对应 pattern 时,fallback 到 `PostMessage` / `SendMessage` 形式的 Win32 window message。
- Windows runtime 默认只连接已经运行的 app,不会在 `get_app_state` 找不到进程时自动 `Start-Process`,也不会默认允许 `SetFocus` secondary action;这两条前台抢占路径分别需要 `OPEN_COMPUTER_USE_WINDOWS_ALLOW_APP_LAUNCH=1` 和 `OPEN_COMPUTER_USE_WINDOWS_ALLOW_FOCUS_ACTIONS=1` 显式打开。`type_text` 默认优先对可写文本控件的 child HWND 发送 `EM_SETSEL` / `EM_REPLACESEL`,不再默认走可能触发前台激活的 UIA `ValuePattern.SetValue` fallback;需要旧行为时必须设置 `OPEN_COMPUTER_USE_WINDOWS_ALLOW_UIA_TEXT_FALLBACK=1`。UIA pattern 和 Win32 message fallback 本身仍是 best-effort:很多控件可以在后台响应,但 Windows 没有一套对所有 GUI toolkit 都等价于 macOS AX 的后台键鼠输入模型。
- 这 9 个 tool 的协议面与 macOS 主线保持一致:`list_apps`、`get_app_state`、`click`、`perform_secondary_action`、`scroll`、`drag`、`type_text`、`press_key`、`set_value`。其中 element-targeted action 会优先复用上一轮 `get_app_state` 的 runtime id / automation metadata,coordinate action 使用 screenshot/window-relative 坐标。
@@ -111,7 +111,7 @@
### 7. Linux Runtime
- Linux runtime 位于 `apps/OpenComputerUseLinux`,以 Go 维护 CLI、`call --calls` sequence、MCP JSON-RPC、tool schema 和进程内 snapshot cache。
-- 构建入口是 `scripts/build-open-computer-use-linux.sh --arch arm64|amd64`,默认输出到 `dist/linux/<arch>/open-computer-use`;npm release package 会把它们分别封装为 `open-computer-use-linux-arm64` 和 `open-computer-use-linux-x64`,由 root `open-computer-use` package 的 `optionalDependencies` 按 `process.platform/process.arch` 自动选择。
+- 构建入口是 `scripts/build-open-computer-use-linux.sh --arch arm64|amd64`,默认输出到 `dist/linux/<arch>/open-computer-use`;npm release package 会把两个 Linux artifact 内置到已有 root/alias packages,Node launcher 按 `process.platform/process.arch` 自动选择。
- Go runtime 通过 `go:embed` 带上 `runtime.py`,执行 tool call 时临时落盘并调用 `python3`。Python bridge 使用 GNOME/GObject Introspection 暴露的 AT-SPI2 接口做 app/window discovery、accessibility tree rendering、semantic action、editable text、value set,以及 best-effort 的 key/mouse fallback。
- Linux 上最接近 macOS AX 的是 AT-SPI2/D-Bus accessibility,而不是一套统一的后台键鼠输入模型。第一版优先使用元素暴露的 AT-SPI action、EditableText 和 Value 接口;coordinate `click` / `drag` 与 `press_key` 使用 AT-SPI event synthesis fallback,在 Wayland 下只能按 best-effort 处理。
- Linux runtime 需要运行在已登录桌面用户 session 里,并带有 `XDG_RUNTIME_DIR`、`DBUS_SESSION_BUS_ADDRESS` 和 display 环境。纯 SSH tty 可以启动二进制,但不能直接 inspect 或操作 GUI session;实机验证时通过 `runuser -u <desktop-user>` 挂到 `/run/user/<uid>/bus`。
diff --git a/docs/CICD.md b/docs/CICD.md
index e84f9b0..af041ad 100644
--- a/docs/CICD.md
+++ b/docs/CICD.md
@@ -4,10 +4,10 @@
## 当前 release 入口
-- `scripts/release-package.sh`:构建 universal `Open Computer Use.app`,cross-compile Linux / Windows runtime,stage 三个 root npm 包和六个 `open-computer-use-<os>-<arch>` platform packages,并产出 `dist/release/npm/*.tgz` 与 `dist/release/release-manifest.json`。当前 CI 继续显式使用 ad-hoc signing,保持和此前发布链路一致;本地 debug/dev 构建则允许使用开发机自己的签名身份。
+- `scripts/release-package.sh`:构建 universal `Open Computer Use.app`,cross-compile Linux / Windows runtime,stage 三个既有 root/alias npm 包;每个包都会内置 macOS app、Linux binaries 和 Windows exes,并产出 `dist/release/npm/*.tgz` 与 `dist/release/release-manifest.json`。当前 CI 继续显式使用 ad-hoc signing,保持和此前发布链路一致;本地 debug/dev 构建则允许使用开发机自己的签名身份。
- `scripts/build-cursor-motion-dmg.sh`:本地构建 `Cursor Motion.app` 并封装 `dist/release/cursor-motion/CursorMotion-<version>.dmg`,支持 `native` / `arm64` / `x86_64` / `universal`。
-- `scripts/build-open-computer-use-linux.sh`:本地构建实验性 Linux `open-computer-use` binary,支持 `arm64` / `amd64`;release package 会把这两个产物封装进对应 npm platform packages。
-- `scripts/build-open-computer-use-windows.sh`:本地构建实验性 Windows `open-computer-use.exe`,支持 `arm64` / `amd64`;release package 会把这两个产物封装进对应 npm platform packages。
+- `scripts/build-open-computer-use-linux.sh`:本地构建实验性 Linux `open-computer-use` binary,支持 `arm64` / `amd64`;release package 会把这两个产物内置进既有 npm 包的 `dist/linux/`。
+- `scripts/build-open-computer-use-windows.sh`:本地构建实验性 Windows `open-computer-use.exe`,支持 `arm64` / `amd64`;release package 会把这两个产物内置进既有 npm 包的 `dist/windows/`。
- `.github/workflows/release.yml`:支持 push semver tag 自动发布,也支持手动触发;tag push 时会同时跑 npm release 打包逻辑与 `Cursor Motion` 的 DMG 打包,并把 `.dmg` 上传到对应的 GitHub Releases 页面。`Open Computer Use` 的 npm 产物默认走 ad-hoc signing;如果配置了 `OPEN_COMPUTER_USE_CODESIGN_*` secrets,则会先导入 `Developer ID Application` 证书,再按同一 identity 对 release `.app` 统一签名。`Cursor Motion` 的 DMG 也会复用同一张 `Developer ID Application` 证书签 app;若同时配置 `APPLE_NOTARY_*` secrets,则会在上传前对 `.dmg` 做 notarization 和 staple。
## 设计原则
@@ -34,12 +34,6 @@
- `dist/release/npm/open-computer-use-<version>.tgz`
- `dist/release/npm/open-computer-use-mcp-<version>.tgz`
- `dist/release/npm/open-codex-computer-use-mcp-<version>.tgz`
-- `dist/release/npm/open-computer-use-darwin-arm64-<version>.tgz`
-- `dist/release/npm/open-computer-use-darwin-x64-<version>.tgz`
-- `dist/release/npm/open-computer-use-linux-arm64-<version>.tgz`
-- `dist/release/npm/open-computer-use-linux-x64-<version>.tgz`
-- `dist/release/npm/open-computer-use-win32-arm64-<version>.tgz`
-- `dist/release/npm/open-computer-use-win32-x64-<version>.tgz`
- `dist/release/cursor-motion/CursorMotion-<version>.dmg`
- GitHub Actions 中上传的 npm release artifact
- GitHub Releases 中和 tag 对齐的 `CursorMotion-<version>.dmg`
diff --git a/docs/QUALITY_SCORE.md b/docs/QUALITY_SCORE.md
index 6d20e11..19cdec4 100644
--- a/docs/QUALITY_SCORE.md
+++ b/docs/QUALITY_SCORE.md
@@ -12,8 +12,8 @@
| 区域 | 评分 | 原因 | 下一步 |
| --- | --- | --- | --- |
| 产品面 | B | 已经有 Swift 本地 `computer-use` MCP server、默认 app 模式权限引导,以及一轮按官方 surface / result 行为收敛过的 9 个 tools。 | 继续收敛复杂 AX 场景下的 state rendering 细节、权限 UI 和更清晰的用户错误提示。 |
-| Windows runtime | C | 已新增独立 Go `.exe`,通过 Windows UI Automation + Win32 window message 暴露同样 9 个 tools、MCP server 和 `call --calls`;默认不再自动启动 app、执行 `SetFocus`,或让 `type_text` 走可能抢前台的 UIA text fallback,并已接入 npm platform package 分发,但仍是功能性第一版。 | 补交互式桌面 smoke、Windows fixture、installer/signing,以及更原生的 Go UIA 实现或更稳定的 bridge。 |
-| Linux runtime | C | 已新增独立 Go binary,通过 Python GI / AT-SPI2 暴露同样 9 个 tools、MCP server 和 `call --calls`;Ubuntu GNOME VM 已跑通 `list_apps`、MCP tools list 和 Text Editor 8-tool sequence,并已接入 npm platform package 分发,但截图在 GNOME Wayland 下仍只能 best-effort,coordinate input 也不是通用后台模型。 | 补 Linux fixture、可重复 smoke runner、portal/compositor screenshot 路径,以及更原生的 Go D-Bus/libatspi bridge。 |
+| Windows runtime | C | 已新增独立 Go `.exe`,通过 Windows UI Automation + Win32 window message 暴露同样 9 个 tools、MCP server 和 `call --calls`;默认不再自动启动 app、执行 `SetFocus`,或让 `type_text` 走可能抢前台的 UIA text fallback,并已接入 npm bundled artifact 分发,但仍是功能性第一版。 | 补交互式桌面 smoke、Windows fixture、installer/signing,以及更原生的 Go UIA 实现或更稳定的 bridge。 |
+| Linux runtime | C | 已新增独立 Go binary,通过 Python GI / AT-SPI2 暴露同样 9 个 tools、MCP server 和 `call --calls`;Ubuntu GNOME VM 已跑通 `list_apps`、MCP tools list 和 Text Editor 8-tool sequence,并已接入 npm bundled artifact 分发,但截图在 GNOME Wayland 下仍只能 best-effort,coordinate input 也不是通用后台模型。 | 补 Linux fixture、可重复 smoke runner、portal/compositor screenshot 路径,以及更原生的 Go D-Bus/libatspi bridge。 |
| 架构文档 | B | 顶层结构、fixture bridge、app 模式和验证路径已经落文档。 | 后续补 release artifact、code signing / notarization 和 host 集成方式。 |
| 测试 | B | `swift test` + smoke suite 已覆盖 9 个 tools 的回归,并新增了针对“前台焦点是否被抢占”的手工对比样本沉淀。 | 增加更多普通 app 的录制回归,减少只依赖 fixture 和一次性手工检查。 |
| 可观测性 | C | 已有 `doctor`、`snapshot`、smoke 输出,以及一组仓库内留档的官方 `computer-use` / 本仓库实现对比样本。 | 补统一日志级别、失败上下文和 release artifact 里的诊断信息,把一次性样本收敛成可重复采集流程。 |
diff --git a/docs/exec-plans/active/20260422-linux-computer-use-runtime.md b/docs/exec-plans/active/20260422-linux-computer-use-runtime.md
index 2b3bca3..39bd2cc 100644
--- a/docs/exec-plans/active/20260422-linux-computer-use-runtime.md
+++ b/docs/exec-plans/active/20260422-linux-computer-use-runtime.md
@@ -84,7 +84,7 @@
- [x] 在 Ubuntu VM 中验证 8-tool sequence:`get_app_state`、`set_value`、`type_text`、`press_key`、`perform_secondary_action`、`click`、`scroll`、`drag` 均 `isError=false`。
- [ ] 增加 Linux fixture 和可重复 smoke runner。
- [ ] 评估 xdg-desktop-portal / compositor-specific screenshot 路径,补非黑图 capture。
-- [x] 将 Linux artifact 接入 npm release packaging,通过 `open-computer-use-linux-arm64` / `open-computer-use-linux-x64` platform packages 分发。
+- [x] 将 Linux artifact 接入 npm release packaging,作为既有 npm root/alias packages 的 bundled artifacts 分发。
- [ ] 评估用原生 Go D-Bus/libatspi 替换 Python GI bridge 的收益和风险。
## 决策记录
@@ -94,4 +94,4 @@
- 2026-04-22:Linux 默认使用 AT-SPI semantic action / editable text / value;coordinate mouse、drag、keyboard synthesis 作为 best-effort fallback,并在 MCP instructions 中明确不是通用 Wayland background input。
- 2026-04-22:GNOME Text Editor 的 AT-SPI tree 深度超过 Windows runtime 沿用的 16 层,Linux bridge 单独把 traversal depth 放宽到 64。
- 2026-04-22:GNOME Wayland 下 GDK root capture 在 VM 上返回黑图;Linux bridge 检测全黑采样后省略 image block,后续再评估 portal/compositor-specific capture。
-- 2026-04-23:Linux release artifact 接入 npm platform package,不新增系统 installer;root `open-computer-use` package 通过 optional dependency 按 `linux-arm64` / `linux-x64` 自动选择 binary。
+- 2026-04-23:Linux release artifact 接入 npm package bundled artifacts,不新增系统 installer;root `open-computer-use` package 通过 launcher 按 `linux-arm64` / `linux-x64` 自动选择 binary。
diff --git a/docs/exec-plans/active/20260422-windows-computer-use-runtime.md b/docs/exec-plans/active/20260422-windows-computer-use-runtime.md
index 7eebd43..f9e4264 100644
--- a/docs/exec-plans/active/20260422-windows-computer-use-runtime.md
+++ b/docs/exec-plans/active/20260422-windows-computer-use-runtime.md
@@ -81,7 +81,7 @@
- [ ] 增加 Windows fixture 和可重复 smoke runner。
- [ ] 评估用 `PrintWindow` / Windows Graphics Capture 补一条不依赖窗口可见性的 background screenshot 路径。
- [ ] 为必须依赖前台输入的 app/toolkit 场景补更明确的 capability/error,避免静默退到抢焦点行为。
-- [x] 将 Windows artifact 接入 npm release packaging,通过 `open-computer-use-win32-arm64` / `open-computer-use-win32-x64` platform packages 分发。
+- [x] 将 Windows artifact 接入 npm release packaging,作为既有 npm root/alias packages 的 bundled artifacts 分发。
- [ ] 补 Windows signing / installer 方案。
- [ ] 评估把 PowerShell bridge 替换为原生 Go COM/UIA 的收益和风险。
@@ -96,4 +96,4 @@
- 2026-04-22:为避免 Windows tools 主动抢占用户焦点,`Resolve-App` 默认不再 `Start-Process` 目标 app,`SetFocus` secondary action 默认返回错误;需要前台行为时分别设置 `OPEN_COMPUTER_USE_WINDOWS_ALLOW_APP_LAUNCH=1` 或 `OPEN_COMPUTER_USE_WINDOWS_ALLOW_FOCUS_ACTIONS=1`。
- 2026-04-22:Notepad 实测反馈 `type_text` 的 UIA `ValuePattern.SetValue` 会把窗口带到前台;默认改为 child HWND `EM_REPLACESEL` 后台消息路径,旧 UIA fallback 需要 `OPEN_COMPUTER_USE_WINDOWS_ALLOW_UIA_TEXT_FALLBACK=1`。
- 2026-04-22:Windows 交互式 scheduled task 验证显示新 `type_text` 能写入 Notepad 且不会把前台从 Codex 切到 Notepad;Notepad 文本控件 UIA class 为 `RichEditD2DPT`,有 child native handle,可接收 `EM_REPLACESEL`。
-- 2026-04-23:Windows release artifact 接入 npm platform package,不新增系统 installer/signing;root `open-computer-use` package 通过 optional dependency 按 `win32-arm64` / `win32-x64` 自动选择 `.exe`。
+- 2026-04-23:Windows release artifact 接入 npm package bundled artifacts,不新增系统 installer/signing;root `open-computer-use` package 通过 launcher 按 `win32-arm64` / `win32-x64` 自动选择 `.exe`。
diff --git a/docs/exec-plans/active/20260423-cross-platform-npm-distribution.md b/docs/exec-plans/active/20260423-cross-platform-npm-distribution.md
index 613685d..2be73e0 100644
--- a/docs/exec-plans/active/20260423-cross-platform-npm-distribution.md
+++ b/docs/exec-plans/active/20260423-cross-platform-npm-distribution.md
@@ -2,14 +2,14 @@
## 目标
-让 `npm i -g open-computer-use` 在 macOS、Linux 和 Windows 上都能安装同一个 root package,并由 root launcher 根据当前 `os-arch` 调用对应的 native app 或 binary。
+让 `npm i -g open-computer-use` 在 macOS、Linux 和 Windows 上都能安装同一个既有 npm package,并由 root launcher 根据当前 `os-arch` 调用包内对应的 native app 或 binary。
## 范围
- 包含:
- - 把 npm staging 从单一 macOS app 包改成 root/meta package + platform packages。
- - 为 `darwin-arm64`、`darwin-x64`、`linux-arm64`、`linux-x64`、`win32-arm64`、`win32-x64` 生成可发布 npm 包。
- - 调整 release/publish 顺序,先发布平台包,再发布 root/alias 包。
+ - 把 npm staging 从单一 macOS app 包改成三端 bundled artifacts。
+ - 既有 `open-computer-use`、`open-computer-use-mcp`、`open-codex-computer-use-mcp` 三个包内置 `darwin-arm64`、`darwin-x64`、`linux-arm64`、`linux-x64`、`win32-arm64`、`win32-x64` runtime。
+ - 保持 release/publish 面只包含既有三个 npm 包名。
- 更新 release workflow、README、架构文档、发版指南和 history。
- bump patch version、tag release,并用 Linux VM 实测 npm 全局安装后的 MCP `tools/list`。
- 不包含:
@@ -37,10 +37,10 @@
## 风险
-- 风险:root package 发布早于 platform packages,用户立刻安装时缺少 optional dependency。
- - 缓解方式:publish script 按 package 类型排序,platform packages 优先。
-- 风险:用户用 `--omit=optional` 或 npm 跳过 optional dependency 后,root launcher 找不到 native runtime。
- - 缓解方式:launcher 输出明确的缺失平台包和重装命令。
+- 风险:包体积比 macOS-only 版本更大。
+ - 缓解方式:先保持既有 npm 包名和可复现安装路径,后续如果 npm package 权限准备好再评估拆分平台包。
+- 风险:launcher 找不到当前 `os-arch` 的 bundled runtime。
+ - 缓解方式:launcher 输出明确的缺失 bundled artifact 路径和重装命令。
- 风险:CI macOS runner 没有 Go toolchain,导致 Linux/Windows cross compile 失败。
- 缓解方式:release workflow 显式 setup Go。
- 风险:Linux runtime 需要桌面 session,纯 SSH 不能验证 GUI 操作。
@@ -64,9 +64,9 @@
- `(cd apps/OpenComputerUseWindows && go test ./...)`
- `node ./scripts/npm/publish-packages.mjs --skip-build --out-dir dist/release/npm-staging --dry-run`
- 手工检查:
- - root packages 包含 `optionalDependencies`。
- - platform packages 包含正确的 `os` / `cpu`。
- - npm tarball 数量和 release manifest 对齐。
+ - root/alias packages 不再声明 `optionalDependencies`。
+ - staging 包包含 `dist/Open Computer Use.app`、`dist/linux/` 和 `dist/windows/`。
+ - npm tarball 数量为 3,和 release manifest 对齐。
- 观测检查:
- GitHub Actions release workflow 成功。
- npm registry 最新版可见。
@@ -75,8 +75,8 @@
## 进度记录
- [x] 确认当前 npm 包仍是 macOS-only。
-- [x] 完成 root/meta package 与 platform package staging。
-- [x] 完成 publish 顺序与 CI Go toolchain 调整。
+- [x] 完成 root/alias package bundled artifact staging。
+- [x] 完成 publish 面收敛到既有三个 npm 包,并保留 CI Go toolchain 调整。
- [x] 完成版本、文档、history 同步。
- [x] 完成本地验证:staging / release tarballs / dry-run publish / Swift tests / Linux Go tests / Windows Go tests / macOS npm prefix install / MCP tools list。
- [ ] 完成 tag release、CI 跟踪、npm registry 验证。
@@ -84,5 +84,5 @@
## 决策记录
-- 2026-04-23:采用 npm `optionalDependencies` + 每平台 `os`/`cpu` package,而不是 postinstall 下载制品。这样安装路径更可复现,也避免 install script 依赖额外网络下载逻辑。
-- 2026-04-23:macOS 仍构建 universal `.app`,但发布为 `darwin-arm64` 和 `darwin-x64` 两个 npm platform package。这样 root launcher 统一按 `process.platform-process.arch` 做映射。
+- 2026-04-23:初版采用 npm `optionalDependencies` + 每平台 `os`/`cpu` package,但 `v0.1.34` release 在 CI 发布新 npm package 名时被 npm 权限挡住。
+- 2026-04-23:`v0.1.35` 改为在既有三个 npm package 中 bundled 三端六个 runtime,避免新增 package 名权限问题;root launcher 继续按 `process.platform-process.arch` 做映射。
diff --git a/docs/histories/2026-04/20260423-1151-add-cross-platform-npm-packages.md b/docs/histories/2026-04/20260423-1151-add-cross-platform-npm-packages.md
index def12f0..20433f4 100644
--- a/docs/histories/2026-04/20260423-1151-add-cross-platform-npm-packages.md
+++ b/docs/histories/2026-04/20260423-1151-add-cross-platform-npm-packages.md
@@ -6,16 +6,16 @@
## 主要改动
-- **[NPM Packaging]**: 将 npm staging 从单一 macOS package 改为三个 root/alias packages 加六个 platform packages:`darwin-arm64`、`darwin-x64`、`linux-arm64`、`linux-x64`、`win32-arm64`、`win32-x64`。
-- **[Runtime Launcher]**: root package 的 `bin/open-computer-use` 改为跨平台 Node launcher,通过 `process.platform` / `process.arch` 解析并执行对应 native package;缺少 optional dependency 时给出明确重装提示。
-- **[Release Flow]**: release package 构建现在会同时构建 macOS app、Linux binaries、Windows exes;publish script 会先发布 platform packages,再发布 root/alias packages。
+- **[NPM Packaging]**: 将 npm staging 从单一 macOS package 改为三个既有 root/alias packages,每个包内置 `darwin-arm64`、`darwin-x64`、`linux-arm64`、`linux-x64`、`win32-arm64`、`win32-x64` runtime。
+- **[Runtime Launcher]**: root package 的 `bin/open-computer-use` 改为跨平台 Node launcher,通过 `process.platform` / `process.arch` 解析并执行对应 bundled native runtime;缺少 artifact 时给出明确重装提示。
+- **[Release Flow]**: release package 构建现在会同时构建 macOS app、Linux binaries、Windows exes;publish script 的发布面保持为 `open-computer-use`、`open-computer-use-mcp`、`open-codex-computer-use-mcp` 三个既有包名。
- **[Plugin Path]**: Codex plugin launcher 和 installer 增加 Linux / Windows native payload fallback,保留 macOS app bundle 路径。
-- **[Version Bump]**: 将插件 manifest、Swift 版本常量、Linux/Windows Go runtime、smoke/test 输入和 CLI helper 文档统一 bump 到 `0.1.34`。
+- **[Version Bump]**: 将插件 manifest、Swift 版本常量、Linux/Windows Go runtime、smoke/test 输入和 CLI helper 文档统一 bump 到 `0.1.35`。
- **[Docs]**: 同步 README、中文 README、架构文档、CI/CD、质量说明、release guide、feature release notes 和相关 execution plans。
## 设计动机
-使用 npm 原生的 `optionalDependencies`、`os`、`cpu` 机制,而不是 postinstall 下载制品。这样 root package 可以保持一个用户入口,平台包由 npm 根据当前环境选择,安装路径也更容易复现和审计。macOS 继续构建 universal `.app`,但拆成 `darwin-arm64` / `darwin-x64` 两个 npm platform packages,让 launcher 的映射规则在三端保持一致。
+最初实现使用 npm 原生的 `optionalDependencies`、`os`、`cpu` 机制,但 `v0.1.34` CI 在发布新增 platform package 名时被 npm 权限挡住。`v0.1.35` 改为把三端六个 runtime 直接 bundled 到既有三个 npm 包里,避免新增 package 权限问题,同时仍由 launcher 根据 `process.platform` / `process.arch` 做本地选择。
## 受影响文件
@@ -34,12 +34,12 @@
- 通过:`node ./scripts/npm/build-packages.mjs --out-dir dist/release/npm-staging-check`
- 通过:`./scripts/release-package.sh`
-- 通过:本地 npm prefix 安装 `open-computer-use-0.1.34.tgz` + `open-computer-use-darwin-arm64-0.1.34.tgz` 后,`open-computer-use --version` 输出 `0.1.34`。
+- 通过:本地 npm prefix 只安装 `open-computer-use-0.1.35.tgz` 后,`open-computer-use --version` 输出 `0.1.35`。
- 通过:本地 npm prefix 安装后的 `open-computer-use mcp` raw JSON-RPC `tools/list` 返回 9 个 tools。
- 通过:`swift test`
- 通过:`(cd apps/OpenComputerUseLinux && go test ./...)`
- 通过:`(cd apps/OpenComputerUseWindows && go test ./...)`
-- 通过:`node ./scripts/npm/publish-packages.mjs --skip-build --out-dir dist/release/npm-staging --dry-run`,发布顺序为六个 platform packages 先于三个 root/alias packages。
+- 通过:`node ./scripts/npm/publish-packages.mjs --skip-build --out-dir dist/release/npm-staging --dry-run`,发布面为三个既有 root/alias packages。
- 通过:`git diff --check`
- 待补:GitHub Actions release workflow。
- 待补:Linux VM npm 全局安装和 MCP `tools/list`。
diff --git a/docs/releases/RELEASE_GUIDE.md b/docs/releases/RELEASE_GUIDE.md
index d1cd7e0..57caa04 100644
--- a/docs/releases/RELEASE_GUIDE.md
+++ b/docs/releases/RELEASE_GUIDE.md
@@ -68,8 +68,9 @@ node ./scripts/npm/build-packages.mjs --out-dir dist/release/npm-staging-check
```bash
node -p "require('./dist/release/npm-staging-check/open-computer-use/package.json').version"
-node -p "require('./dist/release/npm-staging-check/open-computer-use-linux-arm64/package.json').version"
-node -p "require('./dist/release/npm-staging-check/open-computer-use/package.json').optionalDependencies['open-computer-use-linux-arm64']"
+test -x "dist/release/npm-staging-check/open-computer-use/dist/linux/arm64/open-computer-use"
+test -f "dist/release/npm-staging-check/open-computer-use/dist/windows/arm64/open-computer-use.exe"
+node -e "if (require('./dist/release/npm-staging-check/open-computer-use/package.json').optionalDependencies) process.exit(1)"
ls dist/release/cursor-motion/CursorMotion-0.1.14.dmg
```
@@ -146,7 +147,7 @@ gh run view -R iFurySt/open-codex-computer-use <run-id> --log-failed
- `Open Computer Use` 的 npm release 产物在没有配置 `OPEN_COMPUTER_USE_CODESIGN_P12_BASE64` / `OPEN_COMPUTER_USE_CODESIGN_P12_PASSWORD` 等 secrets 时,仍会退回 ad-hoc signing;配置后会先导入 `Developer ID Application` 证书,再按该 identity 统一签名。
- `Cursor Motion` 当前 release 资产会优先复用 `OPEN_COMPUTER_USE_CODESIGN_*` 对 app 做 `Developer ID Application` 签名;如果同时配置 `APPLE_NOTARY_API_KEY_P8_BASE64`、`APPLE_NOTARY_KEY_ID`、`APPLE_NOTARY_ISSUER_ID`、`APPLE_DEVELOPER_TEAM_ID`,workflow 会继续对 `.dmg` 执行 notarization 和 staple。
- 如果上述 secrets 缺失,workflow 会分别退回 ad-hoc signing 或跳过 notarization,而不是阻塞整条 release。
-- `open-computer-use` npm root 包通过 `optionalDependencies` 拉取 platform packages。如果用户安装时使用 `--omit=optional`,root launcher 会缺少 native runtime 并给出重装提示;release 前要确认 platform packages 先于 root/alias packages 发布。
+- `open-computer-use` npm root 包会内置六个 `os-arch` native artifacts,包体积会比 macOS-only 版本更大;release 前要确认 staging 包里包含 `dist/Open Computer Use.app`、`dist/linux/` 和 `dist/windows/`,并确认 launcher 没有声明 `optionalDependencies`。
## 如果 tag 已经打错了
diff --git a/docs/releases/feature-release-notes.md b/docs/releases/feature-release-notes.md
index 71d650e..301d746 100644
--- a/docs/releases/feature-release-notes.md
+++ b/docs/releases/feature-release-notes.md
@@ -4,7 +4,7 @@
| 日期 | 功能域 | 用户价值 | 变更摘要 |
| --- | --- | --- | --- |
-| 2026-04-23 | 三端 npm 安装 | `npm i -g open-computer-use` 现在会根据当前 `os-arch` 安装并调用对应的 macOS `.app`、Linux binary 或 Windows `.exe`,不再把 npm 分发锁死在 macOS。 | 发布 `0.1.34`,把 npm 包改成 root/meta package + `open-computer-use-<os>-<arch>` platform packages,通过 `optionalDependencies` 和跨平台 Node launcher 选择 native runtime,并让 release workflow 同时构建 macOS、Linux、Windows 制品。 |
+| 2026-04-23 | 三端 npm 安装 | `npm i -g open-computer-use` 现在会根据当前 `os-arch` 调用对应的 macOS `.app`、Linux binary 或 Windows `.exe`,不再把 npm 分发锁死在 macOS。 | 发布 `0.1.35`,三个既有 npm 包都会内置 macOS、Linux、Windows runtime,由跨平台 Node launcher 选择 native runtime;`0.1.34` 的新增 platform package 方案因 npm 包名权限失败后被 supersede。 |
| 2026-04-22 | Gemini / opencode MCP 安装 | Gemini CLI 和 opencode 用户现在也能像 Claude Code / Codex 一样用仓库内置命令完成 `open-computer-use` 的 MCP 接入,不需要再手动查各自配置格式。 | 发布 `0.1.33`,新增 `install-gemini-mcp` 和 `install-opencode-mcp`,将 npm launcher、README 与共享配置 helper 一并补齐,并让 Gemini 默认 project-scope 配置不会污染仓库 git 状态。 |
| 2026-04-22 | 发布版本重新对齐 | GitHub Release tag、插件 manifest 和仓库内版本常量重新回到同一个版本线;后续本地安装、staging 和诊断不会再出现 “release 已是新版本,但产物仍显示旧值” 的混乱状态。 | 发布 `0.1.32`,在远端 `v0.1.31` 已存在的前提下,将 `plugin.json`、Swift 版本常量、smoke/test 初始化请求和 CLI helper 文档统一 bump 到 `0.1.32`,为下一次 release 保持单一版本源。 |
| 2026-04-22 | 视觉光标落点与空闲态收口 | Retina 窗口里的坐标点击更准确,visual cursor 在等待下一次动作时也更稳定、更接近官方观感。 | 发布 `0.1.31`,修复 screenshot pixel 到 window point 的映射,避免 `click({x,y})` 在高分屏上点偏;同时把 idle cursor 收敛为 30 秒停驻、保持压在目标窗口之上,并将等待态改成 anchored tip + tiny rotate wobble。 |
diff --git a/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseVersion.swift b/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseVersion.swift
index 291e9a7..49249a6 100644
--- a/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseVersion.swift
+++ b/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/OpenComputerUseVersion.swift
@@ -1,6 +1,6 @@
import Foundation
-public let openComputerUseVersion = "0.1.34"
+public let openComputerUseVersion = "0.1.35"
public func resolvedOpenComputerUseVersion(bundle: Bundle = .main) -> String {
if let version = bundle.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String,
diff --git a/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift b/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift
index b73e4e7..f137d60 100644
--- a/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift
+++ b/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift
@@ -325,7 +325,7 @@ final class OpenComputerUseKitTests: XCTestCase {
func testInitializeResponseContainsToolsCapability() throws {
let server = StdioMCPServer(service: ComputerUseService())
- let response = server.handle(line: #"{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","clientInfo":{"name":"test","version":"0.1.34"},"capabilities":{}}}"#)
+ let response = server.handle(line: #"{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","clientInfo":{"name":"test","version":"0.1.35"},"capabilities":{}}}"#)
XCTAssertNotNil(response)
XCTAssertTrue(response!.contains(#""name":"open-computer-use""#))
XCTAssertTrue(response!.contains(#""tools":{"listChanged":false}"#))
@@ -334,7 +334,7 @@ final class OpenComputerUseKitTests: XCTestCase {
func testInitializeResponseContainsComputerUseInstructions() throws {
let server = StdioMCPServer(service: ComputerUseService())
let response = try XCTUnwrap(
- server.handle(line: #"{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","clientInfo":{"name":"test","version":"0.1.34"},"capabilities":{}}}"#)
+ server.handle(line: #"{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","clientInfo":{"name":"test","version":"0.1.35"},"capabilities":{}}}"#)
)
let data = try XCTUnwrap(response.data(using: .utf8))
let json = try XCTUnwrap(JSONSerialization.jsonObject(with: data) as? [String: Any])
diff --git a/plugins/open-computer-use/.codex-plugin/plugin.json b/plugins/open-computer-use/.codex-plugin/plugin.json
index 8089cd3..fe9d18e 100644
--- a/plugins/open-computer-use/.codex-plugin/plugin.json
+++ b/plugins/open-computer-use/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "open-computer-use",
- "version": "0.1.34",
+ "version": "0.1.35",
"description": "Open-source cross-platform Computer Use MCP server packaged as a Codex plugin.",
"author": {
"name": "Leo",
diff --git a/scripts/computer-use-cli/README.md b/scripts/computer-use-cli/README.md
index a34d7b8..e1b7087 100644
--- a/scripts/computer-use-cli/README.md
+++ b/scripts/computer-use-cli/README.md
@@ -131,7 +131,7 @@ Example working invocation against `open-computer-use`:
```bash
go run . list-tools \
--transport direct \
- --server-bin ~/.codex/plugins/cache/open-computer-use-local/open-computer-use/0.1.34/scripts/launch-open-computer-use.sh
+ --server-bin ~/.codex/plugins/cache/open-computer-use-local/open-computer-use/0.1.35/scripts/launch-open-computer-use.sh
```
Example working comparison flow against a local repo build:
diff --git a/scripts/computer-use-cli/main.go b/scripts/computer-use-cli/main.go
index 983497d..eadf6b9 100644
--- a/scripts/computer-use-cli/main.go
+++ b/scripts/computer-use-cli/main.go
@@ -21,7 +21,7 @@ import (
const (
cliName = "computer-use-cli"
- cliVersion = "0.1.34"
+ cliVersion = "0.1.35"
defaultTimeout = 60 * time.Second
pluginRootEnvVar = "COMPUTER_USE_PLUGIN_ROOT"
pluginVersionEnvVar = "COMPUTER_USE_PLUGIN_VERSION"
diff --git a/scripts/install-codex-plugin.sh b/scripts/install-codex-plugin.sh
index 1f995b2..1879720 100755
--- a/scripts/install-codex-plugin.sh
+++ b/scripts/install-codex-plugin.sh
@@ -38,10 +38,7 @@ resolve_app_bundle() {
fi
for bundle_name in "${candidates[@]}"; do
- for candidate in \
- "${repo_root}/dist/${bundle_name}" \
- "${repo_root}/node_modules/open-computer-use-darwin-$(node_arch)/dist/${bundle_name}" \
- "${repo_root}/../open-computer-use-darwin-$(node_arch)/dist/${bundle_name}"; do
+ for candidate in "${repo_root}/dist/${bundle_name}"; do
if [[ -d "${candidate}" ]]; then
printf '%s\n' "${candidate}"
return 0
@@ -61,19 +58,11 @@ resolve_native_binary() {
case "${platform}" in
linux)
- candidates+=(
- "${repo_root}/node_modules/open-computer-use-linux-${arch}/bin/open-computer-use"
- "${repo_root}/../open-computer-use-linux-${arch}/bin/open-computer-use"
- )
if [[ -n "${go_arch}" ]]; then
candidates+=("${repo_root}/dist/linux/${go_arch}/open-computer-use")
fi
;;
win32)
- candidates+=(
- "${repo_root}/node_modules/open-computer-use-win32-${arch}/bin/open-computer-use.exe"
- "${repo_root}/../open-computer-use-win32-${arch}/bin/open-computer-use.exe"
- )
if [[ -n "${go_arch}" ]]; then
candidates+=("${repo_root}/dist/windows/${go_arch}/open-computer-use.exe")
fi
diff --git a/scripts/npm/build-packages.mjs b/scripts/npm/build-packages.mjs
index 25dd18a..02e1ebc 100644
--- a/scripts/npm/build-packages.mjs
+++ b/scripts/npm/build-packages.mjs
@@ -26,61 +26,50 @@ const metaPackageNames = [
"open-computer-use-mcp",
"open-codex-computer-use-mcp",
];
-const platformPackages = [
+const runtimeTargets = [
{
- name: "open-computer-use-darwin-arm64",
os: "darwin",
cpu: "arm64",
kind: "macos-app",
executablePath: ["dist", appBundleName, "Contents", "MacOS", appExecutableName],
},
{
- name: "open-computer-use-darwin-x64",
os: "darwin",
cpu: "x64",
kind: "macos-app",
executablePath: ["dist", appBundleName, "Contents", "MacOS", appExecutableName],
},
{
- name: "open-computer-use-linux-arm64",
os: "linux",
cpu: "arm64",
kind: "binary",
buildArch: "arm64",
- sourcePath: ["dist", "linux", "arm64", "open-computer-use"],
- executablePath: ["bin", "open-computer-use"],
+ executablePath: ["dist", "linux", "arm64", "open-computer-use"],
},
{
- name: "open-computer-use-linux-x64",
os: "linux",
cpu: "x64",
kind: "binary",
buildArch: "amd64",
- sourcePath: ["dist", "linux", "amd64", "open-computer-use"],
- executablePath: ["bin", "open-computer-use"],
+ executablePath: ["dist", "linux", "amd64", "open-computer-use"],
},
{
- name: "open-computer-use-win32-arm64",
os: "win32",
cpu: "arm64",
kind: "binary",
buildArch: "arm64",
- sourcePath: ["dist", "windows", "arm64", "open-computer-use.exe"],
- executablePath: ["bin", "open-computer-use.exe"],
+ executablePath: ["dist", "windows", "arm64", "open-computer-use.exe"],
},
{
- name: "open-computer-use-win32-x64",
os: "win32",
cpu: "x64",
kind: "binary",
buildArch: "amd64",
- sourcePath: ["dist", "windows", "amd64", "open-computer-use.exe"],
- executablePath: ["bin", "open-computer-use.exe"],
+ executablePath: ["dist", "windows", "amd64", "open-computer-use.exe"],
},
];
const packageNames = [
...metaPackageNames,
- ...platformPackages.map((platformPackage) => platformPackage.name),
];
function parseArgs(argv) {
@@ -213,11 +202,10 @@ function writeExecutable(filePath, content) {
function platformLaunchTable() {
return Object.fromEntries(
- platformPackages.map((platformPackage) => [
- `${platformPackage.os}-${platformPackage.cpu}`,
+ runtimeTargets.map((runtimeTarget) => [
+ `${runtimeTarget.os}-${runtimeTarget.cpu}`,
{
- packageName: platformPackage.name,
- executablePath: platformPackage.executablePath,
+ executablePath: runtimeTarget.executablePath,
},
]),
);
@@ -269,7 +257,7 @@ Global options:
-v, --version Show version.
Notes:
- This npm package installs a small launcher plus one platform package selected by npm.
+ This npm package bundles native runtimes for supported platforms and selects the current os-arch at launch.
Use 'open-computer-use help <command>' for command-specific help.\`);
}
@@ -334,22 +322,12 @@ function resolveNativeExecutable() {
fail(\`Unsupported platform \${platformKey}. Supported platforms: \${supported}.\`);
}
- let manifestPath;
- try {
- manifestPath = require.resolve(\`\${target.packageName}/package.json\`, { paths: [packageRoot] });
- } catch (error) {
- fail(\`Missing platform package \${target.packageName}.
-
-This usually means npm optional dependencies were omitted or pruned. Reinstall with:
- npm install -g open-computer-use
-
-If you intentionally use --omit=optional, install the matching platform package too.\`);
- }
-
- const platformRoot = path.dirname(manifestPath);
- const executablePath = path.join(platformRoot, ...target.executablePath);
+ const executablePath = path.join(packageRoot, ...target.executablePath);
if (!fs.existsSync(executablePath)) {
- fail(\`Platform package \${target.packageName} is installed, but its executable is missing at \${executablePath}.\`);
+ fail(\`Missing bundled native runtime for \${platformKey} at \${executablePath}.
+
+Reinstall with:
+ npm install -g open-computer-use\`);
}
return executablePath;
@@ -409,7 +387,7 @@ const lines = [
"Installed ${packageName}@${version}.",
"Package: https://www.npmjs.com/package/${packageName}",
"Commands: open-computer-use, open-computer-use-mcp, open-codex-computer-use-mcp",
- "Native package is selected by npm optionalDependencies for " + process.platform + "-" + process.arch + ".",
+ "Native runtime will be selected from bundled artifacts for " + process.platform + "-" + process.arch + ".",
"",
"Next:",
"1. Run open-computer-use --version",
@@ -431,9 +409,9 @@ function renderReadme(packageName, version) {
Cross-platform npm distribution for the open-source **Open Computer Use** MCP server.
-This package installs a small Node launcher and lets npm choose one native package through \`optionalDependencies\`:
+This package bundles native runtimes for these supported platforms and lets the Node launcher choose the current \`process.platform\` / \`process.arch\` pair:
-${platformPackages.map((platformPackage) => `- \`${platformPackage.name}\` for \`${platformPackage.os}-${platformPackage.cpu}\``).join("\n")}
+${runtimeTargets.map((runtimeTarget) => `- \`${runtimeTarget.os}-${runtimeTarget.cpu}\``).join("\n")}
Global command aliases:
@@ -447,7 +425,7 @@ Global command aliases:
npm install -g ${packageName}
\`\`\`
-The root launcher resolves the current \`process.platform\` / \`process.arch\` pair and runs the matching native runtime. Do not install with \`--omit=optional\` unless you also install the matching platform package yourself.
+The root launcher resolves the current \`process.platform\` / \`process.arch\` pair and runs the matching bundled native runtime.
## MCP config
@@ -498,22 +476,6 @@ Source repository: https://github.com/iFurySt/open-codex-computer-use
`;
}
-function renderPlatformReadme(platformPackage, version) {
- const platformKey = `${platformPackage.os}-${platformPackage.cpu}`;
- return `# ${platformPackage.name}
-
-Native Open Computer Use runtime package for \`${platformKey}\`.
-
-This package is installed automatically as an optional dependency of \`open-computer-use@${version}\` when npm runs on \`${platformKey}\`. Most users should install the root package instead:
-
-\`\`\`bash
-npm install -g open-computer-use
-\`\`\`
-
-Source repository: https://github.com/iFurySt/open-codex-computer-use
-`;
-}
-
function packageKeywords(extraKeywords = []) {
return [
"computer-use",
@@ -527,12 +489,6 @@ function packageKeywords(extraKeywords = []) {
];
}
-function platformOptionalDependencies(version) {
- return Object.fromEntries(
- platformPackages.map((platformPackage) => [platformPackage.name, version]),
- );
-}
-
function renderMetaPackageJson(packageName, version) {
return {
name: packageName,
@@ -548,7 +504,6 @@ function renderMetaPackageJson(packageName, version) {
url: "https://github.com/iFurySt/open-codex-computer-use/issues",
},
keywords: packageKeywords(),
- optionalDependencies: platformOptionalDependencies(version),
preferGlobal: true,
publishConfig: {
access: "public",
@@ -564,6 +519,9 @@ function renderMetaPackageJson(packageName, version) {
files: [
".agents/plugins/marketplace.json",
"bin/",
+ "dist/Open Computer Use.app/",
+ "dist/linux/",
+ "dist/windows/",
"plugins/open-computer-use/.codex-plugin/",
"plugins/open-computer-use/.mcp.json",
"plugins/open-computer-use/assets/",
@@ -581,34 +539,6 @@ function renderMetaPackageJson(packageName, version) {
};
}
-function renderPlatformPackageJson(platformPackage, version) {
- const platformKey = `${platformPackage.os}-${platformPackage.cpu}`;
- const files = platformPackage.kind === "macos-app"
- ? [`dist/${appBundleName}/`, "README.md", "LICENSE"]
- : ["bin/", "README.md", "LICENSE"];
- return {
- name: platformPackage.name,
- version,
- description: `Native Open Computer Use runtime for ${platformKey}.`,
- license: "MIT",
- homepage: "https://github.com/iFurySt/open-codex-computer-use",
- repository: {
- type: "git",
- url: "git+https://github.com/iFurySt/open-codex-computer-use.git",
- },
- bugs: {
- url: "https://github.com/iFurySt/open-codex-computer-use/issues",
- },
- keywords: packageKeywords([platformPackage.os, platformPackage.cpu]),
- os: [platformPackage.os],
- cpu: [platformPackage.cpu],
- publishConfig: {
- access: "public",
- },
- files,
- };
-}
-
function copyInstallerScripts(packageRoot) {
cpSync(path.join(repoRoot, "scripts", "install-claude-mcp.sh"), path.join(packageRoot, "scripts", "install-claude-mcp.sh"));
cpSync(path.join(repoRoot, "scripts", "install-gemini-mcp.sh"), path.join(packageRoot, "scripts", "install-gemini-mcp.sh"));
@@ -628,12 +558,44 @@ function copyInstallerScripts(packageRoot) {
}
}
+function assertFileExists(filePath, packageName) {
+ if (!existsSync(filePath)) {
+ throw new Error(`Missing artifact for ${packageName}: ${filePath}. Run without --skip-build first.`);
+ }
+}
+
+function copyBundledRuntimes(packageRoot, packageName) {
+ const distRoot = path.join(packageRoot, "dist");
+ mkdirSync(distRoot, { recursive: true });
+
+ const macosSourcePath = path.join(repoRoot, "dist", appBundleName);
+ const macosDestinationPath = path.join(distRoot, appBundleName);
+ assertFileExists(macosSourcePath, packageName);
+ cpSync(macosSourcePath, macosDestinationPath, { recursive: true });
+
+ for (const platformDir of ["linux", "windows"]) {
+ const sourcePath = path.join(repoRoot, "dist", platformDir);
+ const destinationPath = path.join(distRoot, platformDir);
+ assertFileExists(sourcePath, packageName);
+ cpSync(sourcePath, destinationPath, { recursive: true });
+ }
+
+ for (const runtimeTarget of runtimeTargets) {
+ const executablePath = path.join(packageRoot, ...runtimeTarget.executablePath);
+ assertFileExists(executablePath, packageName);
+ if (runtimeTarget.kind !== "macos-app") {
+ chmodSync(executablePath, 0o755);
+ }
+ }
+}
+
function stageMetaPackage(packageName, version, outDir) {
const packageRoot = path.join(outDir, packageName);
rmSync(packageRoot, { recursive: true, force: true });
mkdirSync(path.join(packageRoot, ".agents", "plugins"), { recursive: true });
mkdirSync(path.join(packageRoot, "bin"), { recursive: true });
+ mkdirSync(path.join(packageRoot, "dist"), { recursive: true });
mkdirSync(path.join(packageRoot, "plugins"), { recursive: true });
mkdirSync(path.join(packageRoot, "scripts"), { recursive: true });
@@ -642,6 +604,7 @@ function stageMetaPackage(packageName, version, outDir) {
recursive: true,
});
cpSync(path.join(repoRoot, "LICENSE"), path.join(packageRoot, "LICENSE"));
+ copyBundledRuntimes(packageRoot, packageName);
copyInstallerScripts(packageRoot);
const launcher = renderLauncher();
@@ -655,50 +618,12 @@ function stageMetaPackage(packageName, version, outDir) {
removeJunkFiles(packageRoot);
}
-function assertFileExists(filePath, packageName) {
- if (!existsSync(filePath)) {
- throw new Error(`Missing artifact for ${packageName}: ${filePath}. Run without --skip-build first.`);
- }
-}
-
-function stagePlatformPackage(platformPackage, version, outDir) {
- const packageRoot = path.join(outDir, platformPackage.name);
- rmSync(packageRoot, { recursive: true, force: true });
-
- mkdirSync(path.join(packageRoot, "bin"), { recursive: true });
- mkdirSync(path.join(packageRoot, "dist"), { recursive: true });
-
- if (platformPackage.kind === "macos-app") {
- const sourcePath = path.join(repoRoot, "dist", appBundleName);
- assertFileExists(sourcePath, platformPackage.name);
- cpSync(sourcePath, path.join(packageRoot, "dist", appBundleName), {
- recursive: true,
- });
- } else {
- const sourcePath = path.join(repoRoot, ...platformPackage.sourcePath);
- const destinationPath = path.join(packageRoot, ...platformPackage.executablePath);
- assertFileExists(sourcePath, platformPackage.name);
- cpSync(sourcePath, destinationPath);
- chmodSync(destinationPath, 0o755);
- }
-
- cpSync(path.join(repoRoot, "LICENSE"), path.join(packageRoot, "LICENSE"));
- writeFileSync(path.join(packageRoot, "README.md"), renderPlatformReadme(platformPackage, version), "utf-8");
- writeFileSync(path.join(packageRoot, "package.json"), `${JSON.stringify(renderPlatformPackageJson(platformPackage, version), null, 2)}\n`, "utf-8");
- removeJunkFiles(packageRoot);
-}
-
function stagePackage(packageName, version, outDir) {
- if (metaPackageNames.includes(packageName)) {
- stageMetaPackage(packageName, version, outDir);
- return;
- }
-
- const platformPackage = platformPackages.find((candidate) => candidate.name === packageName);
- if (!platformPackage) {
+ if (!metaPackageNames.includes(packageName)) {
throw new Error(`Unsupported package name: ${packageName}`);
}
- stagePlatformPackage(platformPackage, version, outDir);
+
+ stageMetaPackage(packageName, version, outDir);
}
function main() {
diff --git a/scripts/npm/publish-packages.mjs b/scripts/npm/publish-packages.mjs
index 0b80c61..d44bc00 100644
--- a/scripts/npm/publish-packages.mjs
+++ b/scripts/npm/publish-packages.mjs
@@ -95,10 +95,7 @@ function readPackageMetadata(packageDir) {
};
}
-function publishPriority(packageName) {
- if (/^open-computer-use-(darwin|linux|win32)-/.test(packageName)) {
- return 0;
- }
+function publishPriority(_packageName) {
return 1;
}