Skip to content

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

Enable trusted tag-based npm releases

Leo7e8e8c1272d3
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 1f789ad..efe7196 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,6 +1,10 @@
name: release
on:
+ push:
+ tags:
+ - "v*"
+ - "*.*.*"
workflow_dispatch:
inputs:
publish_to_npm:
@@ -16,6 +20,7 @@ on:
permissions:
contents: read
+ id-token: write
jobs:
package-npm:
@@ -44,11 +49,11 @@ jobs:
if-no-files-found: error
- name: Publish packages to npm
- if: ${{ inputs.publish_to_npm }}
+ if: ${{ github.event_name == 'push' || inputs.publish_to_npm }}
env:
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
+ NPM_DIST_TAG: ${{ github.event_name == 'push' && 'latest' || inputs.npm_tag }}
run: |
node ./scripts/npm/publish-packages.mjs \
--skip-build \
--out-dir dist/release/npm-staging \
- --tag "${{ inputs.npm_tag }}"
+ --tag "${NPM_DIST_TAG}"
diff --git a/README.md b/README.md
index 5ed3a7a..57bb443 100644
--- a/README.md
+++ b/README.md
@@ -276,7 +276,7 @@ node ./scripts/npm/publish-packages.mjs
- `build-packages.mjs` 会构建 universal app 并 stage 三个 npm 包目录到 `dist/npm/`。
- `release-package.sh` 会额外把它们打成 `dist/release/npm/*.tgz`,并生成 `dist/release/release-manifest.json`。
-- `.github/workflows/release.yml` 支持在 GitHub Actions 里手动触发打包,并可在配置 `NPM_TOKEN` secret 后直接发布到 npm。
+- `.github/workflows/release.yml` 支持通过 push `0.1.5` / `v0.1.5` 这类 git tag 自动发布,也保留手动触发作为兜底;发布走 npm Trusted Publishing,不再依赖长期 `NPM_TOKEN` secret。
## 许可证
diff --git a/apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift b/apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift
index 70ec4c9..39519e6 100644
--- a/apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift
+++ b/apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift
@@ -34,7 +34,7 @@ final class MCPClient {
_ = try request(method: "initialize", params: [
"clientInfo": [
"name": "OpenComputerUseSmokeSuite",
- "version": "0.1.4",
+ "version": "0.1.5",
],
"capabilities": [:],
"protocolVersion": "2025-03-26",
diff --git a/docs/CICD.md b/docs/CICD.md
index 058540e..6719d34 100644
--- a/docs/CICD.md
+++ b/docs/CICD.md
@@ -5,7 +5,7 @@
## 当前 release 入口
- `scripts/release-package.sh`:构建 universal `Open Computer Use.app`,stage 三个 npm 包目录,并产出 `dist/release/npm/*.tgz` 与 `dist/release/release-manifest.json`。
-- `.github/workflows/release.yml`:手动触发的 release 流水线,会调用仓库内的 npm release 打包逻辑,并可在配置 `NPM_TOKEN` secret 后直接发布到 npm。
+- `.github/workflows/release.yml`:支持 push semver tag 自动发布,也支持手动触发;它会调用仓库内的 npm release 打包逻辑,并通过 GitHub Actions OIDC / npm Trusted Publishing 直接发布到 npm。
## 设计原则
diff --git a/docs/histories/2026-04/20260417-2206-enable-npm-trusted-publishing.md b/docs/histories/2026-04/20260417-2206-enable-npm-trusted-publishing.md
new file mode 100644
index 0000000..714a375
--- /dev/null
+++ b/docs/histories/2026-04/20260417-2206-enable-npm-trusted-publishing.md
@@ -0,0 +1,27 @@
+## [2026-04-17 22:06] | Task: 启用 npm Trusted Publishing
+
+### 🤖 Execution Context
+* **Agent ID**: `codex`
+* **Base Model**: `GPT-5`
+* **Runtime**: `Codex CLI`
+
+### 📥 User Query
+> 已经在 npmjs 上保存了 Trusted Publishing,处理一下 `.github/workflows/release.yml`。
+
+### 🛠 Changes Overview
+**Scope:** `.github/workflows/`、`scripts/npm/`、`README.md`、`docs/`
+
+**Key Actions:**
+- **更新 workflow 权限**:给 `release.yml` 增加 `id-token: write`,满足 npm Trusted Publishing 的 OIDC 要求。
+- **移除 token 依赖**:删掉 workflow 中对 `NPM_TOKEN` secret 的依赖。
+- **放宽发布脚本校验**:让 `scripts/npm/publish-packages.mjs` 在 GitHub Actions OIDC 场景下不再强制要求 `NODE_AUTH_TOKEN`。
+- **同步文档**:把 README 和 CI/CD 文档中的发布说明改成 Trusted Publishing 路径。
+
+### 🧠 Design Intent (Why)
+Trusted Publishing 的核心是短时 OIDC 凭证,不应该再让 workflow 依赖长期 npm token。只改 workflow 还不够,因为仓库内的发布脚本之前会在没有 `NODE_AUTH_TOKEN` 时直接失败,所以需要把脚本和文档一起收敛到同一条发布模型。
+
+### 📁 Files Modified
+- `.github/workflows/release.yml`
+- `README.md`
+- `docs/CICD.md`
+- `scripts/npm/publish-packages.mjs`
diff --git a/docs/histories/2026-04/20260417-2214-enable-tag-release-and-bump-to-0.1.5.md b/docs/histories/2026-04/20260417-2214-enable-tag-release-and-bump-to-0.1.5.md
new file mode 100644
index 0000000..40858bc
--- /dev/null
+++ b/docs/histories/2026-04/20260417-2214-enable-tag-release-and-bump-to-0.1.5.md
@@ -0,0 +1,33 @@
+## [2026-04-17 22:14] | Task: 启用 tag 发布并 bump 到 0.1.5
+
+### 🤖 Execution Context
+* **Agent ID**: `codex`
+* **Base Model**: `GPT-5`
+* **Runtime**: `Codex CLI`
+
+### 📥 User Query
+> 通过 gh 设置 workflow,后续通过 git tag 来发;搞完就提交相关改动,打个 0.1.5 发,然后观察结果。
+
+### 🛠 Changes Overview
+**Scope:** `.github/workflows/`、`plugins/`、`packages/`、`apps/`、`scripts/`、`docs/`
+
+**Key Actions:**
+- **调整 release 触发方式**:让 `release.yml` 在 push `v*` 和 `*.*.*` tag 时自动发布,同时保留手动触发。
+- **保留 Trusted Publishing**:发布步骤继续走 GitHub Actions OIDC,不依赖长期 npm token。
+- **版本 bump**:将插件 manifest、MCP server、自测和 CLI 文档中的版本统一更新到 `0.1.5`。
+- **同步文档**:把 README 和 CI/CD 文档明确改成“打 git tag 自动发 npm”的用法。
+
+### 🧠 Design Intent (Why)
+既然 npm 侧已经配置了 Trusted Publishing,最自然的 release 路径就是“commit -> tag -> GitHub Actions 自动发”。这样发布动作能绑定到一个明确的 Git tag,也更符合 npm 包版本和 Git 版本一一对应的维护习惯。
+
+### 📁 Files Modified
+- `.github/workflows/release.yml`
+- `README.md`
+- `apps/OpenComputerUseSmokeSuite/Sources/OpenComputerUseSmokeSuite/main.swift`
+- `docs/CICD.md`
+- `docs/references/codex-computer-use-cli.md`
+- `packages/OpenComputerUseKit/Sources/OpenComputerUseKit/MCPServer.swift`
+- `packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift`
+- `plugins/open-computer-use/.codex-plugin/plugin.json`
+- `scripts/computer-use-cli/README.md`
+- `scripts/computer-use-cli/main.go`
diff --git a/docs/references/codex-computer-use-cli.md b/docs/references/codex-computer-use-cli.md
index 7f5a65d..59ae6a4 100644
--- a/docs/references/codex-computer-use-cli.md
+++ b/docs/references/codex-computer-use-cli.md
@@ -76,7 +76,7 @@ go run . call list_apps --transport app-server
cd scripts/computer-use-cli
go run . call list_apps \
--transport direct \
- --server-bin ~/.codex/plugins/cache/open-computer-use-local/open-computer-use/0.1.4/scripts/launch-open-computer-use.sh
+ --server-bin ~/.codex/plugins/cache/open-computer-use-local/open-computer-use/0.1.5/scripts/launch-open-computer-use.sh
```
## 什么时候不要再重试 direct
diff --git a/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/MCPServer.swift b/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/MCPServer.swift
index 3ec5355..8a03bc6 100644
--- a/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/MCPServer.swift
+++ b/packages/OpenComputerUseKit/Sources/OpenComputerUseKit/MCPServer.swift
@@ -54,7 +54,7 @@ public final class StdioMCPServer {
"protocolVersion": "2025-03-26",
"serverInfo": [
"name": "open-computer-use",
- "version": "0.1.4",
+ "version": "0.1.5",
],
"capabilities": [
"tools": [
diff --git a/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift b/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift
index a789144..3767866 100644
--- a/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift
+++ b/packages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swift
@@ -33,7 +33,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.4"},"capabilities":{}}}"#)
+ let response = server.handle(line: #"{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","clientInfo":{"name":"test","version":"0.1.5"},"capabilities":{}}}"#)
XCTAssertNotNil(response)
XCTAssertTrue(response!.contains(#""name":"open-computer-use""#))
XCTAssertTrue(response!.contains(#""tools":{"listChanged":false}"#))
@@ -42,7 +42,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.4"},"capabilities":{}}}"#)
+ server.handle(line: #"{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","clientInfo":{"name":"test","version":"0.1.5"},"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 7eaa083..decd26d 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.4",
+ "version": "0.1.5",
"description": "Open-source macOS 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 52967fb..7947cf7 100644
--- a/scripts/computer-use-cli/README.md
+++ b/scripts/computer-use-cli/README.md
@@ -85,7 +85,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.4/scripts/launch-open-computer-use.sh
+ --server-bin ~/.codex/plugins/cache/open-computer-use-local/open-computer-use/0.1.5/scripts/launch-open-computer-use.sh
```
Example working invocation against the official bundled `computer-use`:
diff --git a/scripts/computer-use-cli/main.go b/scripts/computer-use-cli/main.go
index dc82e5e..73cf8b0 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.4"
+ cliVersion = "0.1.5"
defaultTimeout = 60 * time.Second
pluginRootEnvVar = "COMPUTER_USE_PLUGIN_ROOT"
serverBinEnvVar = "COMPUTER_USE_SERVER_BIN"
diff --git a/scripts/npm/publish-packages.mjs b/scripts/npm/publish-packages.mjs
index bfa96f4..cc09726 100644
--- a/scripts/npm/publish-packages.mjs
+++ b/scripts/npm/publish-packages.mjs
@@ -83,9 +83,10 @@ function run(command, args, options = {}) {
function main() {
const options = parseArgs(process.argv.slice(2));
+ const usingTrustedPublishing = Boolean(process.env.ACTIONS_ID_TOKEN_REQUEST_URL);
- if (!options.dryRun && !process.env.NODE_AUTH_TOKEN) {
- throw new Error("NODE_AUTH_TOKEN is required for npm publish.");
+ if (!options.dryRun && !process.env.NODE_AUTH_TOKEN && !usingTrustedPublishing) {
+ throw new Error("npm publish requires either NODE_AUTH_TOKEN or GitHub Actions OIDC trusted publishing.");
}
run("node", [path.join(repoRoot, "scripts", "npm", "build-packages.mjs"), ...options.buildArgs]);