πΎ Open Computer Use β Open-Source Alternative to Codex Computer Use
[2026-09-22 17:39] | Task: Add ocu js and ocu repl
π€ Execution Context
- Agent ID:
TRAE CLI - Base Model:
GPT-5.4 - Runtime:
local macOS repository workspace
π₯ User Query
Add both direct
ocu jsand persistentocu replcommands, clarify whether OCU stays resident, and expose code-first capability status without hiding commands when Node or another component is unavailable.
π Changes Overview
Scope: npm launcher, JavaScript REPL CLI, capability diagnostics, tests, and user/developer documentation.
Key Actions:
- Direct code execution: Added positional, stdin, and file-backed
ocu jsexecution with configurable timeout and optional JSON result output. - Terminal REPL: Added
ocu replwith persistent top-level bindings,.help,.editor/.end,.reset,.exit, piped line mode, and deterministic Worker/native child cleanup. - Capability contract: Added human-readable and JSON
ocu capabilitiesoutput for Node, adapter, kernel, native MCP,js, andrepl; help keeps the commands visible and marks current availability. - Compatibility: Kept
ocu mcpas the existing native 9-tool stdio server and left the Codex plugin's separatejs/js_resetMCP surface unchanged. - Launcher structure: Reduced generated npm bin files to a small bootstrap and moved command behavior into a reusable, directly tested module.
- Runtime boundary: Documented that the npm launcher requires Node.js 18+, reuses its current Node executable, and is separate from the macOS app agent that may stay resident for permission identity reuse.
π§ Design Intent (Why)
Stable command discovery is more useful to users and agents than silently removing commands based on environment state. The CLI therefore always documents js and repl, while a separate structured preflight reports exactly which runtime component is missing. One-shot and persistent modes reuse the same proven Worker/native MCP bridge, without widening or changing the native MCP protocol.
π Files Modified
scripts/node-repl/open-computer-use-cli.mjsscripts/node-repl/open-computer-use-cli.test.mjsscripts/npm/build-packages.mjsscripts/ci.shMakefileREADME.mddocs/references/js-repl.mddocs/ARCHITECTURE.mddocs/RELIABILITY.mddocs/SECURITY.mdskills/open-computer-use/SKILL.mdskills/open-computer-use/references/usage.md
β Validation
node --test scripts/node-repl/*.test.mjsβ 18/18 passed.- npm staging launcher β help, JSON capabilities, positional/stdin
js, piped persistentrepl,.reset, and realcua.listApps()passed against the bundled macOS runtime. - Raw
ocu mcpJSON-RPCtools/listβ still exactly 9 native tools. swift testβ 167 tests, 0 failures, 1 opt-in live test skipped; 9-tool/cursor smoke passed.- Linux/Windows Go tests, Linux Python tests, shell/Node syntax, docs, action pinning, DSH installer tests, and diff checks passed.
- Release build produced macOS universal, Linux arm64/amd64, and Windows arm64/amd64 artifacts. Isolated tgz installs passed on local macOS Node 22.22.1 and Linux x64 devbox Node 22.16.0, including capability detection, multiline REPL, native bridge, exact 9-tool compatibility, and SIGTERM child cleanup.
- A PATH restricted to
/usr/bin:/binon the local machine reproduces the documented npm bootstrap boundary: the shebang exits 127 withenv: node: No such file or directorybefore CLI code can run. - Full
scripts/ci.shremains blocked only by the existing repository-hygiene gate: themaincheckout lacks.editorconfig,.markdownlint.json, and several expected.githubtemplates/workflows. All later CI substeps were run separately and passed. - PR #80 was squash-merged as
07610f09b0c118c45cc3bd0a8781029f678e3b7d; the repository had no GitHub Actions run for the merge commit. The mergedmainstaging package passed capabilities, one-shotjs, multilinerepl, and exact 9-tool MCP sanity checks again.