open-computer-use-mcp 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 +24 -33
- package/bin/open-codex-computer-use-mcp +172 -108
- package/bin/open-computer-use +172 -108
- package/bin/open-computer-use-mcp +172 -108
- package/dist/Open Computer Use.app/Contents/Info.plist +1 -1
- package/dist/Open Computer Use.app/Contents/MacOS/OpenComputerUse +0 -0
- package/dist/linux/amd64/open-computer-use +0 -0
- package/dist/linux/arm64/open-computer-use +0 -0
- package/dist/windows/amd64/open-computer-use.exe +0 -0
- package/dist/windows/arm64/open-computer-use.exe +0 -0
- package/package.json +7 -10
- package/plugins/open-computer-use/.codex-plugin/plugin.json +5 -5
- package/plugins/open-computer-use/scripts/launch-open-computer-use.sh +12 -1
- package/scripts/install-codex-plugin.sh +123 -18
- package/scripts/postinstall.mjs +6 -5
package/bin/open-computer-use
CHANGED
|
@@ -1,9 +1,74 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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>
|
|
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
|
-
|
|
33
|
-
Use
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
94
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
open-computer-use install-codex-mcp
|
|
108
|
+
Script:
|
|
109
|
+
${scriptName}`);
|
|
110
|
+
}
|
|
102
111
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
exit
|
|
106
|
-
|
|
112
|
+
function fail(message) {
|
|
113
|
+
console.error(message);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
107
116
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
146
|
+
const scriptPath = path.join(packageRoot, "scripts", scriptName);
|
|
147
|
+
if (!fs.existsSync(scriptPath)) {
|
|
148
|
+
fail(`Missing installer helper at ${scriptPath}.`);
|
|
149
|
+
}
|
|
122
150
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
exit 0
|
|
126
|
-
fi
|
|
151
|
+
spawnAndExit(scriptPath, scriptArgs);
|
|
152
|
+
}
|
|
127
153
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
fi
|
|
166
|
+
Reinstall with:
|
|
167
|
+
npm install -g open-computer-use`);
|
|
168
|
+
}
|
|
143
169
|
|
|
144
|
-
|
|
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
|
+
}
|
|
@@ -1,9 +1,74 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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>
|
|
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
|
-
|
|
33
|
-
Use
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
94
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
open-computer-use install-codex-mcp
|
|
108
|
+
Script:
|
|
109
|
+
${scriptName}`);
|
|
110
|
+
}
|
|
102
111
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
exit
|
|
106
|
-
|
|
112
|
+
function fail(message) {
|
|
113
|
+
console.error(message);
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
107
116
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
146
|
+
const scriptPath = path.join(packageRoot, "scripts", scriptName);
|
|
147
|
+
if (!fs.existsSync(scriptPath)) {
|
|
148
|
+
fail(`Missing installer helper at ${scriptPath}.`);
|
|
149
|
+
}
|
|
122
150
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
exit 0
|
|
126
|
-
fi
|
|
151
|
+
spawnAndExit(scriptPath, scriptArgs);
|
|
152
|
+
}
|
|
127
153
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
fi
|
|
166
|
+
Reinstall with:
|
|
167
|
+
npm install -g open-computer-use`);
|
|
168
|
+
}
|
|
143
169
|
|
|
144
|
-
|
|
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
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-computer-use-mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.35",
|
|
4
|
+
"description": "Cross-platform Computer Use MCP server launcher. After install, configure open-computer-use mcp.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/iFurySt/open-codex-computer-use",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/iFurySt/open-codex-computer-use"
|
|
9
|
+
"url": "git+https://github.com/iFurySt/open-codex-computer-use.git"
|
|
10
10
|
},
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/iFurySt/open-codex-computer-use/issues"
|
|
@@ -16,15 +16,10 @@
|
|
|
16
16
|
"codex",
|
|
17
17
|
"mcp",
|
|
18
18
|
"macos",
|
|
19
|
+
"linux",
|
|
20
|
+
"windows",
|
|
19
21
|
"automation"
|
|
20
22
|
],
|
|
21
|
-
"os": [
|
|
22
|
-
"darwin"
|
|
23
|
-
],
|
|
24
|
-
"cpu": [
|
|
25
|
-
"arm64",
|
|
26
|
-
"x64"
|
|
27
|
-
],
|
|
28
23
|
"preferGlobal": true,
|
|
29
24
|
"publishConfig": {
|
|
30
25
|
"access": "public"
|
|
@@ -41,6 +36,8 @@
|
|
|
41
36
|
".agents/plugins/marketplace.json",
|
|
42
37
|
"bin/",
|
|
43
38
|
"dist/Open Computer Use.app/",
|
|
39
|
+
"dist/linux/",
|
|
40
|
+
"dist/windows/",
|
|
44
41
|
"plugins/open-computer-use/.codex-plugin/",
|
|
45
42
|
"plugins/open-computer-use/.mcp.json",
|
|
46
43
|
"plugins/open-computer-use/assets/",
|