👾 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
feat(release): publish direct download artifacts
Leo3ac6c0ca3b1e
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 2b7ed72..ccb6a2e 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -20,6 +20,7 @@ on:permissions:contents: write+ attestations: writeid-token: writejobs:@@ -113,6 +114,40 @@ jobs:- name: Build npm release artifactsrun: npm run npm:pack+ - name: Notarize direct-download Open Computer Use app+ if: ${{ github.event_name == 'push' }}+ env:+ RELEASE_TAG: ${{ github.ref_name }}+ APPLE_NOTARY_API_KEY_P8_BASE64: ${{ secrets.APPLE_NOTARY_API_KEY_P8_BASE64 }}+ APPLE_NOTARY_KEY_ID: ${{ secrets.APPLE_NOTARY_KEY_ID }}+ APPLE_NOTARY_ISSUER_ID: ${{ secrets.APPLE_NOTARY_ISSUER_ID }}+ APPLE_DEVELOPER_TEAM_ID: ${{ secrets.APPLE_DEVELOPER_TEAM_ID }}+ run: |+ if [ "${OPEN_COMPUTER_USE_CODESIGN_MODE}" != "identity" ]; then+ echo "Open Computer Use is not Developer ID signed; skipping app notarization."+ exit 0+ fi+ if [ -z "${APPLE_NOTARY_API_KEY_P8_BASE64}" ] || [ -z "${APPLE_NOTARY_KEY_ID}" ] || [ -z "${APPLE_NOTARY_ISSUER_ID}" ] || [ -z "${APPLE_DEVELOPER_TEAM_ID}" ]; then+ echo "No notary credentials configured; skipping Open Computer Use app notarization."+ exit 0+ fi++ version="${RELEASE_TAG#v}"+ app_archive="dist/release/github/Open-Computer-Use-${version}-macOS-universal.app.zip"+ api_key_path="${RUNNER_TEMP}/AuthKey_${APPLE_NOTARY_KEY_ID}.p8"++ CERT_PATH="${api_key_path}" python3 -c 'import base64, os, pathlib; pathlib.Path(os.environ["CERT_PATH"]).write_bytes(base64.b64decode(os.environ["APPLE_NOTARY_API_KEY_P8_BASE64"]))'++ xcrun notarytool submit "${app_archive}" \+ --key "${api_key_path}" \+ --key-id "${APPLE_NOTARY_KEY_ID}" \+ --issuer "${APPLE_NOTARY_ISSUER_ID}" \+ --team-id "${APPLE_DEVELOPER_TEAM_ID}" \+ --wait++ xcrun stapler staple "dist/Open Computer Use.app"+ ./scripts/package-github-release-assets.sh --version "${version}"+- name: Upload npm release artifactsuses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0awith:@@ -122,6 +157,22 @@ jobs:dist/release/release-manifest.jsonif-no-files-found: error+ - name: Upload direct-download release artifacts+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a+ with:+ name: open-computer-use-release-artifacts+ path: dist/release/github/*+ if-no-files-found: error++ - name: Generate build provenance for direct-download artifacts+ if: ${{ !github.event.repository.private }}+ uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32+ with:+ subject-path: |+ dist/release/github/*.zip+ dist/release/github/*.tar.gz+ dist/release/github/*.skill+- name: Configure npm token fallbackenv:NPM_TOKEN: ${{ secrets.NPM_TOKEN }}@@ -243,22 +294,49 @@ jobs:path: dist/release/cursor-motion/*.dmgif-no-files-found: error- - name: Publish Cursor Motion DMG to GitHub Releases+ publish-github-release:+ needs:+ - package-npm+ - release-cursor-motion-dmg+ if: ${{ github.event_name == 'push' }}+ runs-on: ubuntu-24.04+ permissions:+ contents: write++ steps:+ - name: Check out repository+ uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd++ - name: Download Open Computer Use release artifacts+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c+ with:+ name: open-computer-use-release-artifacts+ path: dist/release/github++ - name: Download Cursor Motion release artifact+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c+ with:+ name: cursor-motion-release-artifact+ path: dist/release/cursor-motion++ - name: Publish all assets to GitHub Releasesenv:GH_TOKEN: ${{ github.token }}RELEASE_TAG: ${{ github.ref_name }}run: |- version="${RELEASE_TAG#v}"- dmg_path="dist/release/cursor-motion/CursorMotion-${version}.dmg"notes_path="docs/releases/github/${RELEASE_TAG}.md"+ assets=(+ dist/release/github/*+ dist/release/cursor-motion/*.dmg+ )if gh release view "${RELEASE_TAG}" >/dev/null 2>&1; then- gh release upload "${RELEASE_TAG}" "${dmg_path}" --clobber+ gh release upload "${RELEASE_TAG}" "${assets[@]}" --clobbergh release edit "${RELEASE_TAG}" \--title "${RELEASE_TAG}" \--notes-file "${notes_path}"else- gh release create "${RELEASE_TAG}" "${dmg_path}" \+ gh release create "${RELEASE_TAG}" "${assets[@]}" \--title "${RELEASE_TAG}" \--notes-file "${notes_path}"fidiff --git a/Makefile b/Makefileindex b07b4cc..5ecf8c6 100644--- a/Makefile+++ b/Makefile@@ -3,7 +3,7 @@ SLUG ?=AGENTS ?= claude,codexSCENARIO ?= list-apps-.PHONY: init build app test smoke stress agent-smoke check-docs check-repo ci release-package npm-build npm-publish new-history new-plan+.PHONY: init build app test smoke stress agent-smoke check-docs check-repo ci release-package release-assets npm-build npm-publish new-history new-planinit:@if [ -z "$(PROJECT)" ]; then echo "用法: make init PROJECT=项目名"; exit 1; fi@@ -41,6 +41,9 @@ ci:release-package:./scripts/release-package.sh+release-assets:+ ./scripts/package-github-release-assets.sh+npm-build:node ./scripts/npm/build-packages.mjsdiff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex c425e55..f6bc3da 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -27,7 +27,7 @@- `experiments/StandaloneCursor`新的独立 Swift cursor viewer,直接复用 `scripts/cursor-motion-re/official_cursor_motion.py` 里收敛出来的候选路径、score 与 raw spring timeline,用来观察更贴近 binary lift 的表现。- `scripts/`- 仓库级自动化命令,包括 smoke test、`.app` 打包入口、Windows `.exe` / Linux binary 构建入口、npm 分发脚本、`scripts/node-repl/` 的 JS REPL adapter 与 npm CLI controller,以及 `scripts/computer-use-cli/` 这个用于探测官方 bundled `computer-use` 的 Go helper。+ 仓库级自动化命令,包括 smoke test、`.app` 打包入口、Windows `.exe` / Linux binary 构建入口、npm 分发脚本、GitHub Release direct-download archive 打包、`scripts/node-repl/` 的 JS REPL adapter 与 npm CLI controller,以及 `scripts/computer-use-cli/` 这个用于探测官方 bundled `computer-use` 的 Go helper。- `skills/`面向 agent runtime 的可安装 skill。当前 `skills/open-computer-use/SKILL.md` 只作为轻量入口和目录,安装、MCP/CLI 使用、排障等细节拆到相邻 `references/` 文件里按需加载;`scripts/package-skill.sh` 负责校验并打包 `.zip` / `.skill` 制品。- `docs/`diff --git a/docs/CICD.md b/docs/CICD.mdindex a68bd59..be9b318 100644--- a/docs/CICD.md+++ b/docs/CICD.md@@ -4,11 +4,12 @@## 当前 release 入口-- `scripts/release-package.sh`:构建 universal `Open Computer Use.app`,cross-compile Linux / Windows runtime,stage 三个既有 root/alias npm 包;每个包都会内置 macOS app、Linux binaries 和 Windows exes,并暴露 `open-computer-use` / `ocu` 等 npm bin 入口,产出 `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,并暴露 `open-computer-use` / `ocu` 等 npm bin 入口。脚本同时调用 `scripts/package-github-release-assets.sh`,产出 npm tarballs、GitHub Release 直接下载制品与对应 manifest。当前 CI 继续显式使用 ad-hoc signing,保持和此前发布链路一致;本地 debug/dev 构建则允许使用开发机自己的签名身份。+- `scripts/package-github-release-assets.sh`:把已构建的 universal `.app`、Linux 双架构 binary、Windows 双架构 `.exe` 和 `open-computer-use` skill 封装到 `dist/release/github/`,并生成 `SHA256SUMS` 与 `release-assets-manifest.json`。macOS 必须分发完整 app bundle,不能把 bundle 内 binary 当成独立安装包。- `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 包的 `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。+- `.github/workflows/release.yml`:支持 push semver tag 自动发布,也支持手动触发;tag push 时会并行构建 npm/direct-download artifacts 与 `Cursor Motion` DMG,只有两个构建 job 都成功后,单一汇总 job 才会创建或更新 GitHub Release 并上传全套 assets。`Open Computer Use` 的 npm 与 app 制品默认走 ad-hoc signing;如果配置了 `OPEN_COMPUTER_USE_CODESIGN_*` secrets,则会先导入 `Developer ID Application` 证书,再按同一 identity 对 release `.app` 统一签名。若同时配置 `APPLE_NOTARY_*` secrets,direct-download app zip 会在 notarization 与 staple 后重新封装;`Cursor Motion` DMG 也会走 notarization 和 staple。## 设计原则@@ -34,8 +35,15 @@- `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/github/Open-Computer-Use-<version>-macOS-universal.app.zip`+- `dist/release/github/open-computer-use-cli-<version>-linux-{arm64,amd64}.tar.gz`+- `dist/release/github/open-computer-use-cli-<version>-windows-{arm64,amd64}.zip`+- `dist/release/github/open-computer-use-skill.zip`+- `dist/release/github/open-computer-use.skill`+- `dist/release/github/SHA256SUMS`+- `dist/release/github/release-assets-manifest.json`- `dist/release/cursor-motion/CursorMotion-<version>.dmg`-- GitHub Actions 中上传的 npm release artifact-- GitHub Releases 中和 tag 对齐的 `CursorMotion-<version>.dmg`+- GitHub Actions 中上传的 npm 与 direct-download release artifacts+- GitHub Releases 中上述 direct-download assets 与和 tag 对齐的 `CursorMotion-<version>.dmg`-也就是说,即使项目还没进入更复杂的部署阶段,仓库现在也已经同时具备了一条真实可复用的 npm 制品封装链路,以及一条由 git tag 驱动的 macOS app DMG 交付链路。+也就是说,即使项目还没进入更复杂的部署阶段,仓库现在也同时具备 npm 分发链路,以及由 git tag 驱动、覆盖 macOS / Linux / Windows 和 skill 的直接下载链路。diff --git a/docs/exec-plans/completed/20260929-github-release-downloads.md b/docs/exec-plans/completed/20260929-github-release-downloads.mdnew file mode 100644index 0000000..5ec5ec1--- /dev/null+++ b/docs/exec-plans/completed/20260929-github-release-downloads.md@@ -0,0 +1,83 @@+# GitHub Release direct downloads++## 目标++让 tag 驱动的 release workflow 在所有构建任务成功后,一次性把 Open Computer Use 的 macOS app、Linux / Windows CLI、skill、校验和与现有 Cursor Motion DMG 发布到 GitHub Releases,供不使用 npm 或 Homebrew 的用户直接下载和集成。++## 范围++- 包含:+ - 为已有 macOS universal app、Linux 双架构 binary、Windows 双架构 exe 生成清晰命名的 release archives。+ - 把 `open-computer-use` skill 的 `.zip` / `.skill` 制品加入 GitHub Release。+ - 生成 SHA-256 校验和与机器可读 asset manifest。+ - 将 GitHub Release 创建收敛为依赖全部构建 job 的单一发布 job。+ - 更新 CI/CD、发版指南、feature release notes 和 history。+- 不包含:+ - 新增 installer、Windows code signing 或 Linux desktop package。+ - 改变 npm package 结构或 runtime 行为。+ - 在本轮直接 bump 版本、打 tag 或发布公开 release。++## 背景++- 相关文档:+ - `docs/CICD.md`+ - `docs/releases/RELEASE_GUIDE.md`+ - `docs/SUPPLY_CHAIN_SECURITY.md`+- 相关代码路径:+ - `scripts/release-package.sh`+ - `scripts/package-skill.sh`+ - `.github/workflows/release.yml`+- 已知约束:+ - macOS runtime 必须保留在 `.app` bundle 中,才能复用稳定权限身份和 app-agent proxy。+ - GitHub Release asset 不能直接上传目录,因此 `.app` 必须封装为 zip。+ - 所有 GitHub Actions 必须固定到 commit SHA。++## 风险++- 风险:多个并行 job 同时创建或更新同一个 GitHub Release,可能产生半成品或竞态。+ - 缓解方式:构建 job 只上传 Actions artifacts,唯一的发布 job等待全部依赖成功后再统一上传。+- 风险:用户误把 macOS bundle 内 binary 单独复制出来,导致权限代理找不到 app。+ - 缓解方式:只发布完整 `.app.zip`,并在发版文档中说明 bundle 边界。+- 风险:release archive 漏架构或丢失可执行位。+ - 缓解方式:打包脚本验证 app 架构、签名、输入 executable,并在归档后检查文件清单和数量。++## 里程碑++1. 对照 Open Browser Use 的 release assets,确定命名与公开资产集合。+2. 实现直接下载制品打包与 manifest / checksum。+3. 重构 workflow 为构建后统一发布。+4. 完成本地打包验证、文档与 history 收口。++## 验证方式++- 命令:+ - `bash -n scripts/package-github-release-assets.sh scripts/release-package.sh`+ - `./scripts/package-github-release-assets.sh --version 0.3.5`+ - `./scripts/release-package.sh`+ - `make ci`+ - `git diff --check`+- 手工检查:+ - macOS zip 内只有完整 `Open Computer Use.app` bundle。+ - Linux archives 内 binary 名为 `open-computer-use` 且保留可执行位。+ - Windows archives 内 binary 名为 `open-computer-use.exe`。+ - skill zip 和 `.skill` 字节一致。+ - workflow 的 publish job 同时依赖 npm/direct-download assets 与 Cursor Motion DMG。++## 进度记录++- [x] 确认现有 GitHub Release 只公开 Cursor Motion DMG。+- [x] 对照 Open Browser Use 的 CLI / skill release asset 组织方式。+- [x] 完成直接下载制品打包脚本。+- [x] 完成 workflow 汇总发布 job。+- [x] 完成文档、history 与本地验证。+- [x] 完整 `release-package.sh` 实跑成功,产出 3 个 npm tarball 与 9 个 GitHub direct-download/meta assets;macOS archive 解压后签名和 universal 架构校验通过,SHA-256 全量校验通过。+- [x] Swift 168 项测试通过(1 项 live test 按默认配置跳过),Linux / Windows Go tests 与 Linux Python tests 通过。+- [x] 文档、Action pinning、shell syntax、workflow YAML 与 diff 检查通过。+- [x] 记录两项既有基线阻塞:`make ci` 在本次 diff 之外的仓库模板缺失检查处失败;Node REPL 测试稳定复现 20/21 通过、`WorkerJavaScriptSession` late throw 用例失败,相关源码未由本任务修改。++## 决策记录++- 2026-09-29:macOS 只发布完整 universal `.app.zip`,不发布脱离 bundle 的裸 binary;后者无法可靠保留 app-scoped 权限身份。+- 2026-09-29:Linux 和 Windows 延续 Open Browser Use 的 archive 形式,分别使用 `.tar.gz` 与 `.zip`,避免 GitHub asset 重名并保留平台惯用解压体验。+- 2026-09-29:GitHub Release 由单一汇总 job 创建;构建 job 不再直接写 Release。+- 2026-09-29:Developer ID 与 Apple notary secrets 同时可用时,先 notarize / staple direct-download app 再重新封装;缺少配置时保持既有 ad-hoc fallback。diff --git a/docs/histories/2026-09/20260929-1059-publish-direct-release-assets.md b/docs/histories/2026-09/20260929-1059-publish-direct-release-assets.mdnew file mode 100644index 0000000..0442330--- /dev/null+++ b/docs/histories/2026-09/20260929-1059-publish-direct-release-assets.md@@ -0,0 +1,41 @@+## [2026-09-29 10:59] | Task: 发布可直接下载的跨平台制品++### 🤖 Execution Context+* **Agent ID**: `/root`+* **Base Model**: GPT-5+* **Runtime**: TraeCode++### 📥 User Query+> 在 CI 后把 Open Computer Use 的 macOS app、Windows exe、CLI binary 和 skill 发布到 GitHub Releases,让用户无需 npm 或 Homebrew 也能下载集成;参考 Open Browser Use 的发布方式。++### 🛠 Changes Overview+**Scope:** release packaging、GitHub Actions 与用户文档。++**Key Actions:**+- 新增 direct-download 打包脚本,封装 macOS universal app、Linux / Windows 双架构 CLI 与 skill,并生成 SHA-256 校验和及 manifest。+- 将 GitHub Release 创建收敛到单一汇总 job,等待 npm/direct-download 和 Cursor Motion DMG 构建成功后再发布全套 assets。+- 为 Developer ID 签名的 direct-download macOS app 接入可选 notarization 与 staple。+- 补充架构、CI/CD 与发版指南中的直接下载、验证和失败排查说明。++### 🧠 Design Intent (Why)+macOS runtime 必须保留完整 app bundle 才能维持稳定的权限身份;Linux / Windows 则适合像 Open Browser Use 一样以按平台和架构命名的 CLI archive 直接分发。统一的发布 job 可以避免并行任务提前创建只有部分 assets 的 Release。++### 📁 Files Modified+- `scripts/package-github-release-assets.sh`+- `scripts/release-package.sh`+- `.github/workflows/release.yml`+- `package.json`+- `Makefile`+- `docs/ARCHITECTURE.md`+- `docs/CICD.md`+- `docs/releases/feature-release-notes.md`+- `docs/releases/RELEASE_GUIDE.md`+- `docs/exec-plans/completed/20260929-github-release-downloads.md`++### Validation++- `./scripts/release-package.sh` 完整通过,生成 3 个 npm tarball、macOS app zip、Linux / Windows 双架构 CLI archives、两种 skill 包、checksums 与 manifests。+- macOS archive 解压后通过 `codesign --verify --deep --strict`,binary 为 `x86_64 arm64` universal;Linux / Windows 输入 binary 的四个目标架构经 `file` 确认。+- `SHA256SUMS` 全量验证通过,skill `.zip` / `.skill` 字节一致,版本不匹配会被打包脚本拒绝。+- Swift 168 项测试通过(1 项 live test 默认跳过);Linux / Windows Go tests 和 Linux Python tests 通过;文档、Action pinning、shell syntax、workflow YAML、diff 检查通过。+- 仓库既有基线仍有两项非本次改动导致的失败:`make ci` 会先被缺失的模板文件阻断;Node REPL suite 为 20/21,通过之外的失败是既有 `WorkerJavaScriptSession` late throw 用例。diff --git a/docs/releases/RELEASE_GUIDE.md b/docs/releases/RELEASE_GUIDE.mdindex b16ec45..6d3a94b 100644--- a/docs/releases/RELEASE_GUIDE.md+++ b/docs/releases/RELEASE_GUIDE.md@@ -20,6 +20,7 @@## 当前 release 入口- 本地 staging / 打 tgz:`./scripts/release-package.sh`+- 本地重新封装 GitHub Release assets:`./scripts/package-github-release-assets.sh --version <version>`- 本地构建 Cursor Motion DMG:`./scripts/build-cursor-motion-dmg.sh --configuration release --arch universal --version <version>`- 本地 stage npm 包目录:`node ./scripts/npm/build-packages.mjs`- 本地 publish:`node ./scripts/npm/publish-packages.mjs`@@ -35,6 +36,7 @@- npm staging 包版本:以 `plugins/open-computer-use/.codex-plugin/plugin.json` 里的 `version` 为准。- GitHub Release 正文:以 `docs/releases/github/<tag>.md` 为准,文件名必须与实际 tag 完全一致。- `CursorMotion-<version>.dmg` 文件名与 GitHub Release asset 版本:以 release tag 为准;workflow 会把 `vX.Y.Z` 规范化成 `X.Y.Z` 写进 DMG 文件名,也可以在本地显式传 `--version`。+- Open Computer Use direct-download asset 版本:以 plugin manifest 为准;`package-github-release-assets.sh --version` 会拒绝与 manifest 不一致的版本。也就是说:@@ -83,13 +85,14 @@ node ./scripts/validate-github-release-notes.mjs --tag v0.1.14### 3. 本地验证版本源已经生效-至少跑这四步:+至少跑这些步骤:```bashnode ./scripts/validate-github-release-notes.mjs --tag v0.1.14swift testnode ./scripts/npm/build-packages.mjs --out-dir dist/release/npm-staging-check./scripts/build-cursor-motion-dmg.sh --configuration release --arch universal --version 0.1.14+./scripts/package-github-release-assets.sh --version 0.1.14```然后直接检查 staging 包版本和 DMG 文件名:@@ -102,6 +105,9 @@ test -x "dist/release/npm-staging-check/open-computer-use/bin/ocu"node -e "const bin=require('./dist/release/npm-staging-check/open-computer-use/package.json').bin; if (bin.ocu !== 'bin/ocu') process.exit(1)"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+test -f dist/release/github/Open-Computer-Use-0.1.14-macOS-universal.app.zip+test "$(find dist/release/github -maxdepth 1 -type f -name 'open-computer-use-cli-*' | wc -l | tr -d ' ')" = 4+(cd dist/release/github && shasum -a 256 -c SHA256SUMS)```如果这里打印的不是目标版本,或者 DMG 没按目标版本名产出,不要打 tag。@@ -123,10 +129,12 @@ git push origin maingit push origin v0.1.14```-tag push 后,`.github/workflows/release.yml` 会自动做两件事:+tag push 后,`.github/workflows/release.yml` 会自动完成:- 发布 npm 包。-- 构建 `CursorMotion-0.1.14.dmg`,并创建或更新同名 tag 的 GitHub Release asset。+- 构建 Open Computer Use 的 macOS app、Linux / Windows CLI 与 skill 直接下载包。+- 构建 `CursorMotion-0.1.14.dmg`。+- 等全部构建 job 成功后,一次性创建或更新同名 tag 的 GitHub Release assets。### 6. 检查 GitHub Release notes@@ -136,7 +144,7 @@ tag push 后,`.github/workflows/release.yml` 会自动做两件事:gh release view v0.1.14 --json body,url```-workflow 会使用 `docs/releases/github/<tag>.md` 创建新 Release;如果 Release 已经存在,则在覆盖上传 DMG 后用同一文件更新正文。GitHub 自动生成 notes 不再是正文来源,因此 PR 标题使用中文也不会改变公开 Release 的语言。+workflow 会使用 `docs/releases/github/<tag>.md` 创建新 Release;如果 Release 已经存在,则覆盖上传 macOS app、Linux / Windows CLI、skill、checksums、manifest 和 DMG,并用同一文件更新正文。GitHub 自动生成 notes 不再是正文来源,因此 PR 标题使用中文也不会改变公开 Release 的语言。最低要求:@@ -168,18 +176,21 @@ gh run view -R iFurySt/open-codex-computer-use <run-id> --log-failed- 如果日志显示已经选择 `GitHub Actions OIDC trusted publishing`,优先检查 CI 里的 npm CLI 版本;trusted publishing 需要 npm `11.5.1+`,当前 release workflow 的 npm package job 使用 Node `24` 并显式检查 npm 版本。- 如果 npm CLI 版本满足要求仍报这个错误,说明 npmjs.com 包侧还没有把当前 GitHub repo / workflow 文件配置成 trusted publisher。- 构建阶段失败- - 优先看 `Build npm release artifacts`、`Build Cursor Motion DMG` 或 Swift 编译错误。+ - 优先看 `Build npm release artifacts`、`package-github-release-assets.sh` 的架构/归档校验、`Build Cursor Motion DMG` 或 Swift 编译错误。- GitHub Release 资产上传失败- - 优先看 `Publish Cursor Motion DMG to GitHub Releases`,确认 tag 是否存在、`GH_TOKEN` 权限是否正常,以及生成的 `CursorMotion-<version>.dmg` 路径是否匹配。+ - 优先看 `publish-github-release` job,确认两个上游 artifact 都已上传、tag 存在、`GH_TOKEN` 权限正常,以及下载后的 asset 路径匹配。- publish 认证失败- 再去看 `.github/workflows/release.yml`、`scripts/npm/publish-packages.mjs` 和 npm trusted publishing / token fallback 配置。## 当前已知边界- `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 统一签名。+- 如果 Open Computer Use 已使用 Developer ID 签名且 `APPLE_NOTARY_*` secrets 齐全,workflow 会 notarize 并 staple direct-download `.app` 后重新生成 app zip、checksums 和 manifest;缺少任一条件时跳过 notarization。- `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 包会内置六个 `os-arch` native artifacts,包体积会比 macOS-only 版本更大;release 前要确认 staging 包里包含 `dist/Open Computer Use.app`、`dist/linux/` 和 `dist/windows/`,并确认 launcher 没有声明 `optionalDependencies`。+- 直接下载的 Linux / Windows CLI archive 只包含 native CLI / MCP runtime;`ocu js` / `ocu repl` 所需的 Node adapter 继续通过 npm 包分发。+- macOS direct download 必须保留完整 `.app` bundle;不要单独分发 `Contents/MacOS/OpenComputerUse`,否则无法可靠复用 app-scoped 权限身份。## 如果 tag 已经打错了diff --git a/docs/releases/feature-release-notes.md b/docs/releases/feature-release-notes.mdindex 578867a..5f97628 100644--- a/docs/releases/feature-release-notes.md+++ b/docs/releases/feature-release-notes.md@@ -4,6 +4,7 @@| 日期 | 功能域 | 用户价值 | 变更摘要 || --- | --- | --- | --- |+| 2026-09-29 | GitHub Release 直接下载 | 不使用 npm 或 Homebrew 的用户也可以从 GitHub Releases 直接下载 macOS app、Linux / Windows CLI 和 Agent skill,并通过 checksum 校验制品。 | tag release 在全部构建成功后统一发布 macOS universal `.app.zip`、Linux / Windows 双架构 CLI archives、`.zip` / `.skill` skill 包、SHA-256 校验和与机器可读 manifest;Developer ID 和 notary 配置齐全时会公证并 staple macOS app。 || 2026-09-22 | JS REPL CLI | 用户无需先配置 MCP host,也可以直接用 `ocu js` 执行一次性 Computer Use JavaScript,或用 `ocu repl` 在终端中复用持久 binding;Agent 还能先读取结构化 capability 状态。 | npm launcher 新增 positional/stdin/file 三种 `js` 输入、持久 terminal REPL、`capabilities [--json]` 和稳定 help availability;`ocu mcp` 仍保持原生 9-tool surface。 || 2026-09-22 | JS REPL 错误传播与 read-back | `js` 代码抛出的异常立即以 `isError` 返回且保留 bindings,不再等到 30 s 超时并丢弃 session;macOS 上一批 action 不再为每个动作等待 150 ms 并重新读取整棵 AX tree,十次点击从数秒降到约一次 state read。 | REPL adapter 从 Node 的 `handleError`(Node 26)或 domain(Node 22)路径 settle 当前 evaluation;adapter 以 `OPEN_COMPUTER_USE_ACTION_READ_BACK=0` 启动 native runtime,macOS action 在该模式下返回短状态、跳过 settle 与 snapshot;默认 9-tool 行为不变,Linux / Windows 暂时忽略该变量。 || 2026-09-21 | JS REPL Computer Use | Agent 可以用异步 JavaScript 绑定 app,并在一个 tool round trip 内完成 inspect、action、条件和最终验证,不必在多轮间搬运所有中间状态。 | Codex plugin 通过持久 Node.js Worker 和 app-bound `cua` API 暴露 `js` / `js_reset`;`open-computer-use mcp` 继续保留既有 9-tool compatibility surface。 |diff --git a/package.json b/package.jsonindex c863364..4a032f4 100644--- a/package.json+++ b/package.json@@ -6,6 +6,7 @@"npm:build": "node ./scripts/npm/build-packages.mjs","npm:pack": "./scripts/release-package.sh","npm:publish": "node ./scripts/npm/publish-packages.mjs",+ "package:release-assets": "./scripts/package-github-release-assets.sh","package:skill": "./scripts/package-skill.sh","release:notes:validate": "node ./scripts/validate-github-release-notes.mjs"}diff --git a/scripts/package-github-release-assets.sh b/scripts/package-github-release-assets.shnew file mode 100755index 0000000..d6d1ffd--- /dev/null+++ b/scripts/package-github-release-assets.sh@@ -0,0 +1,212 @@+#!/usr/bin/env bash++set -euo pipefail++repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"+dist_dir="${repo_root}/dist"+output_dir="${dist_dir}/release/github"+requested_version=""++usage() {+ cat <<'EOF'+Usage: ./scripts/package-github-release-assets.sh [--version X.Y.Z] [--output-dir <dir>]++Packages already-built Open Computer Use runtimes and the repository skill as+direct-download GitHub Release assets. Run scripts/release-package.sh when the+native runtimes have not been built yet.+EOF+}++while [[ $# -gt 0 ]]; do+ case "$1" in+ --version)+ requested_version="${2:-}"+ if [[ -z "${requested_version}" ]]; then+ echo "--version requires a value" >&2+ exit 1+ fi+ shift 2+ ;;+ --output-dir)+ output_dir="${2:-}"+ if [[ -z "${output_dir}" ]]; then+ echo "--output-dir requires a value" >&2+ exit 1+ fi+ shift 2+ ;;+ -h|--help)+ usage+ exit 0+ ;;+ *)+ echo "Unknown argument: $1" >&2+ usage >&2+ exit 1+ ;;+ esac+done++if [[ "${output_dir}" != /* ]]; then+ output_dir="${repo_root}/${output_dir}"+fi++for command in node ditto lipo codesign tar zip unzip shasum; do+ if ! command -v "${command}" >/dev/null 2>&1; then+ echo "${command} is required to package GitHub Release assets" >&2+ exit 1+ fi+done++manifest_version="$(node -p "JSON.parse(require('fs').readFileSync(process.argv[1], 'utf8')).version" "${repo_root}/plugins/open-computer-use/.codex-plugin/plugin.json")"+version="${requested_version:-${manifest_version}}"+version="${version#v}"++if [[ ! "${version}" =~ ^[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$ ]]; then+ echo "Release version must look like X.Y.Z: ${version}" >&2+ exit 1+fi++if [[ "${version}" != "${manifest_version}" ]]; then+ echo "Release version ${version} does not match plugin manifest version ${manifest_version}" >&2+ exit 1+fi++app_path="${dist_dir}/Open Computer Use.app"+linux_arm64="${dist_dir}/linux/arm64/open-computer-use"+linux_amd64="${dist_dir}/linux/amd64/open-computer-use"+windows_arm64="${dist_dir}/windows/arm64/open-computer-use.exe"+windows_amd64="${dist_dir}/windows/amd64/open-computer-use.exe"++if [[ ! -d "${app_path}" ]]; then+ echo "Missing macOS app bundle: ${app_path}" >&2+ exit 1+fi++for executable in "${linux_arm64}" "${linux_amd64}" "${windows_arm64}" "${windows_amd64}"; do+ if [[ ! -f "${executable}" ]]; then+ echo "Missing native runtime: ${executable}" >&2+ exit 1+ fi+done++app_archs="$(lipo -archs "${app_path}/Contents/MacOS/OpenComputerUse")"+if [[ " ${app_archs} " != *" arm64 "* || " ${app_archs} " != *" x86_64 "* ]]; then+ echo "Expected a universal macOS app, found architectures: ${app_archs}" >&2+ exit 1+fi+codesign --verify --deep --strict "${app_path}"++rm -rf "${output_dir}"+mkdir -p "${output_dir}"++app_archive="${output_dir}/Open-Computer-Use-${version}-macOS-universal.app.zip"+ditto -c -k --sequesterRsrc --keepParent "${app_path}" "${app_archive}"++package_unix_cli() {+ local source_path="$1"+ local platform="$2"+ local arch="$3"+ local archive_path="${output_dir}/open-computer-use-cli-${version}-${platform}-${arch}.tar.gz"+ local work_dir+ work_dir="$(mktemp -d "${TMPDIR:-/tmp}/open-computer-use-release.XXXXXX")"+ cp "${source_path}" "${work_dir}/open-computer-use"+ chmod +x "${work_dir}/open-computer-use"+ COPYFILE_DISABLE=1 tar -czf "${archive_path}" -C "${work_dir}" open-computer-use+ rm -rf "${work_dir}"+}++package_windows_cli() {+ local source_path="$1"+ local arch="$2"+ local archive_path="${output_dir}/open-computer-use-cli-${version}-windows-${arch}.zip"+ local work_dir+ work_dir="$(mktemp -d "${TMPDIR:-/tmp}/open-computer-use-release.XXXXXX")"+ cp "${source_path}" "${work_dir}/open-computer-use.exe"+ (+ cd "${work_dir}"+ zip -q -X "${archive_path}" open-computer-use.exe+ )+ rm -rf "${work_dir}"+}++package_unix_cli "${linux_arm64}" linux arm64+package_unix_cli "${linux_amd64}" linux amd64+package_windows_cli "${windows_arm64}" arm64+package_windows_cli "${windows_amd64}" amd64++"${repo_root}/scripts/package-skill.sh" >/dev/null+cp "${dist_dir}/skills/open-computer-use-skill.zip" "${output_dir}/"+cp "${dist_dir}/skills/open-computer-use.skill" "${output_dir}/"++app_entry_list="${output_dir}/.macos-app-entries"+unzip -Z1 "${app_archive}" > "${app_entry_list}"+if ! grep -Fxq 'Open Computer Use.app/Contents/MacOS/OpenComputerUse' "${app_entry_list}"; then+ echo "macOS app archive is missing its CLI executable" >&2+ exit 1+fi+rm -f "${app_entry_list}"++for archive in "${output_dir}"/open-computer-use-cli-*.tar.gz; do+ if [[ "$(tar -tzf "${archive}")" != "open-computer-use" ]]; then+ echo "Unexpected Linux CLI archive contents: ${archive}" >&2+ exit 1+ fi+done++for archive in "${output_dir}"/open-computer-use-cli-*.zip; do+ if [[ "$(unzip -Z1 "${archive}")" != "open-computer-use.exe" ]]; then+ echo "Unexpected Windows CLI archive contents: ${archive}" >&2+ exit 1+ fi+done++(+ cd "${output_dir}"+ shasum -a 256 \+ "$(basename "${app_archive}")" \+ open-computer-use-cli-*.tar.gz \+ open-computer-use-cli-*.zip \+ open-computer-use-skill.zip \+ open-computer-use.skill \+ > SHA256SUMS+)++node - "${output_dir}" "${version}" "${repo_root}" <<'NODE'+const crypto = require("crypto");+const fs = require("fs");+const path = require("path");++const outputDir = process.argv[2];+const version = process.argv[3];+const repoRoot = process.argv[4];+const files = fs.readdirSync(outputDir)+ .filter((name) => name !== "release-assets-manifest.json")+ .sort();++const artifacts = files.map((name) => {+ const contents = fs.readFileSync(path.join(outputDir, name));+ return {+ name,+ size_bytes: contents.byteLength,+ sha256: crypto.createHash("sha256").update(contents).digest("hex")+ };+});++const manifest = {+ repository: process.env.GITHUB_REPOSITORY || "local",+ git_sha: process.env.GITHUB_SHA || require("child_process")+ .execFileSync("git", ["-C", repoRoot, "rev-parse", "HEAD"], { encoding: "utf8" })+ .trim(),+ version,+ generated_at_utc: new Date().toISOString(),+ artifacts+};++fs.writeFileSync(+ path.join(outputDir, "release-assets-manifest.json"),+ `${JSON.stringify(manifest, null, 2)}\n`+);+NODE++echo "${output_dir}"diff --git a/scripts/release-package.sh b/scripts/release-package.shindex 4c0f81a..432b6a3 100755--- a/scripts/release-package.sh+++ b/scripts/release-package.sh@@ -16,6 +16,8 @@ node "${repo_root}/scripts/npm/build-packages.mjs" \--arch universal \--out-dir "${staging_dir}"+"${repo_root}/scripts/package-github-release-assets.sh"+while IFS= read -r package_dir; donpm pack "${package_dir}" --pack-destination "${tarball_dir}" >/dev/nulldone < <(find "${staging_dir}" -mindepth 1 -maxdepth 1 -type d | sort)@@ -46,6 +48,7 @@ manifest = {).strip(),"generated_at_utc": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),"artifacts": artifacts,+ "github_release_assets": "dist/release/github/release-assets-manifest.json","distribution": {"type": "npm","package_count": len(artifacts),