open-computer-use 0.1.33 → 0.1.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,17 @@
1
1
  # open-computer-use
2
2
 
3
- Prebuilt macOS npm distribution for the open-source **Open Computer Use** MCP server.
3
+ Cross-platform npm distribution for the open-source **Open Computer Use** MCP server.
4
4
 
5
- This package bundles a ready-to-run `Open Computer Use.app`, the Codex plugin metadata, and three global command aliases:
5
+ This package bundles native runtimes for these supported platforms and lets the Node launcher choose the current `process.platform` / `process.arch` pair:
6
+
7
+ - `darwin-arm64`
8
+ - `darwin-x64`
9
+ - `linux-arm64`
10
+ - `linux-x64`
11
+ - `win32-arm64`
12
+ - `win32-x64`
13
+
14
+ Global command aliases:
6
15
 
7
16
  - `open-computer-use`
8
17
  - `open-computer-use-mcp`
@@ -14,7 +23,7 @@ This package bundles a ready-to-run `Open Computer Use.app`, the Codex plugin me
14
23
  npm install -g open-computer-use
15
24
  ```
16
25
 
17
- After install, run `open-computer-use doctor` first. If macOS `Accessibility` or `Screen Recording` permission is missing, it will open the permission onboarding window and tell you what still needs to be granted. If everything is already granted, it just prints the status and exits.
26
+ The root launcher resolves the current `process.platform` / `process.arch` pair and runs the matching bundled native runtime.
18
27
 
19
28
  ## MCP config
20
29
 
@@ -31,52 +40,34 @@ If your MCP client accepts a stdio-style `mcpServers` JSON config, this is the d
31
40
  }
32
41
  ```
33
42
 
34
- In practice, using this package as MCP is: global install, add the JSON config, then grant macOS `Accessibility` and `Screen Recording` permission to the bundled npm-installed `Open Computer Use.app` on first use.
35
-
36
43
  Package page: https://www.npmjs.com/package/open-computer-use
37
44
 
38
45
  ## Use
39
46
 
40
47
  ```bash
41
- # Show global help, command help, and version
42
- open-computer-use --help
43
- open-computer-use help snapshot
44
48
  open-computer-use --version
49
+ open-computer-use --help
50
+ open-computer-use mcp
51
+ open-computer-use call list_apps
45
52
 
46
- # Install into Claude Code for the current project
47
- open-computer-use install-claude-mcp
53
+ # macOS permission check and onboarding
54
+ open-computer-use doctor
48
55
 
49
- # Install into Gemini CLI for the current project or user config
56
+ # Installer helpers for MCP-capable CLIs
57
+ open-computer-use install-claude-mcp
50
58
  open-computer-use install-gemini-mcp
51
59
  open-computer-use install-gemini-mcp --scope user
52
-
53
- # Install into Codex as a plain MCP entry in ~/.codex/config.toml
54
60
  open-computer-use install-codex-mcp
55
-
56
- # Install into opencode in ~/.config/opencode
57
61
  open-computer-use install-opencode-mcp
58
-
59
- # Check permissions first; if Accessibility / Screen Recording is missing, open the permission onboarding window
60
- # If both are already granted, this just prints the status and exits
61
- open-computer-use doctor
62
-
63
- # Start the stdio MCP server for Claude Desktop, Cursor, Cline, or another MCP client
64
- open-computer-use mcp
65
-
66
- # Call tools directly; the JSON-array form keeps state in one process for follow-up actions
67
- open-computer-use call list_apps
68
- open-computer-use call get_app_state --args '{"app":"TextEdit"}'
69
- open-computer-use call --calls '[{"tool":"get_app_state","args":{"app":"TextEdit"}},{"tool":"press_key","args":{"app":"TextEdit","key":"Return"}}]'
70
-
71
- # Install this package into the local Codex plugin marketplace/cache
72
62
  open-computer-use install-codex-plugin
73
63
  ```
74
64
 
75
65
  ## Notes
76
66
 
77
- - Version: `0.1.33`
78
- - Platform: macOS 14+
79
- - Architectures: `arm64` and `x64` via a universal app bundle
80
- - The host terminal or app still needs macOS `Accessibility` and `Screen Recording` permissions
67
+ - Version: `0.1.35`
68
+ - Supported npm platforms: `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64`, `win32-arm64`, `win32-x64`
69
+ - macOS still requires `Accessibility` and `Screen Recording` permissions.
70
+ - Linux requires a signed-in desktop session with AT-SPI2 / D-Bus accessibility available for real app control.
71
+ - Windows requires a signed-in desktop session for UI Automation access.
81
72
 
82
73
  Source repository: https://github.com/iFurySt/open-codex-computer-use
@@ -1,9 +1,74 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- print_launcher_help() {
5
- cat <<'EOF'
6
- Open Computer Use
1
+ #!/usr/bin/env node
2
+ const { spawn } = require("node:child_process");
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+
6
+ const platformPackages = {
7
+ "darwin-arm64": {
8
+ "executablePath": [
9
+ "dist",
10
+ "Open Computer Use.app",
11
+ "Contents",
12
+ "MacOS",
13
+ "OpenComputerUse"
14
+ ]
15
+ },
16
+ "darwin-x64": {
17
+ "executablePath": [
18
+ "dist",
19
+ "Open Computer Use.app",
20
+ "Contents",
21
+ "MacOS",
22
+ "OpenComputerUse"
23
+ ]
24
+ },
25
+ "linux-arm64": {
26
+ "executablePath": [
27
+ "dist",
28
+ "linux",
29
+ "arm64",
30
+ "open-computer-use"
31
+ ]
32
+ },
33
+ "linux-x64": {
34
+ "executablePath": [
35
+ "dist",
36
+ "linux",
37
+ "amd64",
38
+ "open-computer-use"
39
+ ]
40
+ },
41
+ "win32-arm64": {
42
+ "executablePath": [
43
+ "dist",
44
+ "windows",
45
+ "arm64",
46
+ "open-computer-use.exe"
47
+ ]
48
+ },
49
+ "win32-x64": {
50
+ "executablePath": [
51
+ "dist",
52
+ "windows",
53
+ "amd64",
54
+ "open-computer-use.exe"
55
+ ]
56
+ }
57
+ };
58
+ const packageRoot = path.resolve(__dirname, "..");
59
+ const args = process.argv.slice(2);
60
+ const command = args[0] || "";
61
+ const installCommands = new Map([
62
+ ["install-claude-mcp", "install-claude-mcp.sh"],
63
+ ["install-clauce-mcp", "install-claude-mcp.sh"],
64
+ ["install-gemini-mcp", "install-gemini-mcp.sh"],
65
+ ["install-codex-mcp", "install-codex-mcp.sh"],
66
+ ["install-opencode-mcp", "install-opencode-mcp.sh"],
67
+ ["install-codex-plugin", "install-codex-plugin.sh"],
68
+ ]);
69
+
70
+ function printLauncherHelp() {
71
+ console.log(`Open Computer Use
7
72
 
8
73
  Usage:
9
74
  open-computer-use [command] [options]
@@ -11,10 +76,10 @@ Usage:
11
76
 
12
77
  Commands:
13
78
  mcp Start the stdio MCP server.
14
- doctor Print permission status and launch onboarding if needed.
79
+ doctor Print permission status and launch onboarding if needed on macOS.
15
80
  list-apps Print running or recently used apps.
16
81
  snapshot <app> Print the current accessibility snapshot for an app.
17
- call <tool> Call one tool, or run a JSON array of tool calls.
82
+ call <tool> Call one tool, or run a JSON array of tool calls.
18
83
  turn-ended Notify the running MCP process that the host turn ended.
19
84
  install-claude-mcp Install the MCP server into ~/.claude.json for this project.
20
85
  install-gemini-mcp Install the MCP server into Gemini CLI config.
@@ -29,116 +94,115 @@ Global options:
29
94
  -v, --version Show version.
30
95
 
31
96
  Notes:
32
- Running without a command launches the permission onboarding app.
33
- Use `open-computer-use help <command>` for command-specific help.
34
- EOF
97
+ This npm package bundles native runtimes for supported platforms and selects the current os-arch at launch.
98
+ Use 'open-computer-use help <command>' for command-specific help.`);
35
99
  }
36
100
 
37
- script_path="${BASH_SOURCE[0]}"
38
- while [[ -L "${script_path}" ]]; do
39
- script_dir="$(cd "$(dirname "${script_path}")" && pwd)"
40
- script_path="$(readlink "${script_path}")"
41
- if [[ "${script_path}" != /* ]]; then
42
- script_path="${script_dir}/${script_path}"
43
- fi
44
- done
45
- package_root="$(cd "$(dirname "${script_path}")/.." && pwd)"
46
- app_binary="${package_root}/dist/Open Computer Use.app/Contents/MacOS/OpenComputerUse"
47
- install_claude_mcp_script="${package_root}/scripts/install-claude-mcp.sh"
48
- install_gemini_mcp_script="${package_root}/scripts/install-gemini-mcp.sh"
49
- install_mcp_script="${package_root}/scripts/install-codex-mcp.sh"
50
- install_opencode_mcp_script="${package_root}/scripts/install-opencode-mcp.sh"
51
- install_script="${package_root}/scripts/install-codex-plugin.sh"
52
-
53
- if [[ "${1:-}" == "install-claude-mcp" || "${1:-}" == "install-clauce-mcp" ]]; then
54
- shift
55
- exec "${install_claude_mcp_script}" "$@"
56
- fi
57
-
58
- if [[ "${1:-}" == "install-gemini-mcp" ]]; then
59
- shift
60
- exec "${install_gemini_mcp_script}" "$@"
61
- fi
62
-
63
- if [[ "${1:-}" == "install-codex-mcp" ]]; then
64
- shift
65
- exec "${install_mcp_script}" "$@"
66
- fi
67
-
68
- if [[ "${1:-}" == "install-opencode-mcp" ]]; then
69
- shift
70
- exec "${install_opencode_mcp_script}" "$@"
71
- fi
72
-
73
- if [[ "${1:-}" == "install-codex-plugin" ]]; then
74
- shift
75
- exec "${install_script}" "$@"
76
- fi
77
-
78
- if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
79
- print_launcher_help
80
- exit 0
81
- fi
82
-
83
- if [[ "${1:-}" == "help" && $# -le 1 ]]; then
84
- print_launcher_help
85
- exit 0
86
- fi
87
-
88
- if [[ "${1:-}" == "help" && "${2:-}" == "install-codex-plugin" ]]; then
89
- cat <<'EOF'
90
- Usage:
91
- open-computer-use install-codex-plugin
101
+ function printInstallHelp(scriptName, usage) {
102
+ console.log(`Usage:
103
+ ${usage}
92
104
 
93
- Install this npm package into the local Codex plugin cache.
94
- EOF
95
- exit 0
96
- fi
105
+ This helper updates a local MCP or plugin config to run:
106
+ open-computer-use mcp
97
107
 
98
- if [[ "${1:-}" == "help" && "${2:-}" == "install-codex-mcp" ]]; then
99
- cat <<'EOF'
100
- Usage:
101
- open-computer-use install-codex-mcp
108
+ Script:
109
+ ${scriptName}`);
110
+ }
102
111
 
103
- Install the open-computer-use MCP server into ~/.codex/config.toml.
104
- EOF
105
- exit 0
106
- fi
112
+ function fail(message) {
113
+ console.error(message);
114
+ process.exit(1);
115
+ }
107
116
 
108
- if [[ "${1:-}" == "help" && "${2:-}" == "install-gemini-mcp" ]]; then
109
- cat <<'EOF'
110
- Usage:
111
- open-computer-use install-gemini-mcp [--scope project|user]
117
+ function spawnAndExit(executable, executableArgs) {
118
+ const child = spawn(executable, executableArgs, {
119
+ stdio: "inherit",
120
+ windowsHide: false,
121
+ });
122
+
123
+ child.on("error", (error) => {
124
+ fail(`Failed to start ${executable}: ${error.message}`);
125
+ });
126
+
127
+ for (const signal of ["SIGINT", "SIGTERM"]) {
128
+ process.on(signal, () => {
129
+ child.kill(signal);
130
+ });
131
+ }
132
+
133
+ child.on("exit", (code, signal) => {
134
+ if (signal) {
135
+ process.exit(1);
136
+ }
137
+ process.exit(code ?? 0);
138
+ });
139
+ }
112
140
 
113
- Install the open-computer-use MCP server into Gemini CLI config.
114
- EOF
115
- exit 0
116
- fi
141
+ function runInstallCommand(scriptName, scriptArgs) {
142
+ if (process.platform === "win32") {
143
+ fail(`${command} currently requires a POSIX shell. Configure your MCP client with command "open-computer-use" and args ["mcp"] on Windows.`);
144
+ }
117
145
 
118
- if [[ "${1:-}" == "help" && "${2:-}" == "install-opencode-mcp" ]]; then
119
- cat <<'EOF'
120
- Usage:
121
- open-computer-use install-opencode-mcp
146
+ const scriptPath = path.join(packageRoot, "scripts", scriptName);
147
+ if (!fs.existsSync(scriptPath)) {
148
+ fail(`Missing installer helper at ${scriptPath}.`);
149
+ }
122
150
 
123
- Install the open-computer-use MCP server into ~/.config/opencode.
124
- EOF
125
- exit 0
126
- fi
151
+ spawnAndExit(scriptPath, scriptArgs);
152
+ }
127
153
 
128
- if [[ "${1:-}" == "help" && ( "${2:-}" == "install-claude-mcp" || "${2:-}" == "install-clauce-mcp" ) ]]; then
129
- cat <<'EOF'
130
- Usage:
131
- open-computer-use install-claude-mcp
132
- open-computer-use install-clauce-mcp
154
+ function resolveNativeExecutable() {
155
+ const platformKey = `${process.platform}-${process.arch}`;
156
+ const target = platformPackages[platformKey];
157
+ if (!target) {
158
+ const supported = Object.keys(platformPackages).sort().join(", ");
159
+ fail(`Unsupported platform ${platformKey}. Supported platforms: ${supported}.`);
160
+ }
133
161
 
134
- Install the open-computer-use MCP server into ~/.claude.json for the current project.
135
- EOF
136
- exit 0
137
- fi
162
+ const executablePath = path.join(packageRoot, ...target.executablePath);
163
+ if (!fs.existsSync(executablePath)) {
164
+ fail(`Missing bundled native runtime for ${platformKey} at ${executablePath}.
138
165
 
139
- if [[ ! -x "${app_binary}" ]]; then
140
- echo "open-computer-use could not find a runnable app bundle at ${app_binary}." >&2
141
- exit 1
142
- fi
166
+ Reinstall with:
167
+ npm install -g open-computer-use`);
168
+ }
143
169
 
144
- exec "${app_binary}" "$@"
170
+ return executablePath;
171
+ }
172
+
173
+ if (command === "-h" || command === "--help" || (command === "help" && args.length <= 1)) {
174
+ printLauncherHelp();
175
+ process.exit(0);
176
+ }
177
+
178
+ if (command === "help" && args[1] === "install-codex-plugin") {
179
+ printInstallHelp("install-codex-plugin.sh", "open-computer-use install-codex-plugin");
180
+ process.exit(0);
181
+ }
182
+
183
+ if (command === "help" && args[1] === "install-codex-mcp") {
184
+ printInstallHelp("install-codex-mcp.sh", "open-computer-use install-codex-mcp");
185
+ process.exit(0);
186
+ }
187
+
188
+ if (command === "help" && args[1] === "install-gemini-mcp") {
189
+ printInstallHelp("install-gemini-mcp.sh", "open-computer-use install-gemini-mcp [--scope project|user]");
190
+ process.exit(0);
191
+ }
192
+
193
+ if (command === "help" && args[1] === "install-opencode-mcp") {
194
+ printInstallHelp("install-opencode-mcp.sh", "open-computer-use install-opencode-mcp");
195
+ process.exit(0);
196
+ }
197
+
198
+ if (command === "help" && (args[1] === "install-claude-mcp" || args[1] === "install-clauce-mcp")) {
199
+ printInstallHelp("install-claude-mcp.sh", "open-computer-use install-claude-mcp");
200
+ process.exit(0);
201
+ }
202
+
203
+ if (installCommands.has(command)) {
204
+ const scriptName = installCommands.get(command);
205
+ runInstallCommand(scriptName, args.slice(1));
206
+ } else {
207
+ spawnAndExit(resolveNativeExecutable(), args);
208
+ }