@gea-ai/cli 0.2.261012-alpha.0 → 0.2.261016-alpha.0
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/gea-launcher.cjs +26 -12
- package/package.json +2 -2
- package/runtime.mjs +2 -2
- package/vite.mjs +2 -2
package/gea-launcher.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { spawn } = require("node:child_process");
|
|
4
4
|
const path = require("node:path");
|
|
5
5
|
|
|
6
6
|
function resolveGeaTarget(platform, arch) {
|
|
@@ -18,9 +18,16 @@ function resolveGeaTarget(platform, arch) {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
if (platform === "linux" && arch === "x64") {
|
|
22
|
+
return {
|
|
23
|
+
executable: "gea-linux-x64",
|
|
24
|
+
packageName: "@gea-ai/cli-linux-x64",
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
21
28
|
throw new Error(
|
|
22
29
|
`@gea-ai/cli does not provide an executable for ${platform}/${arch}. ` +
|
|
23
|
-
"Supported platforms are darwin/arm64 and
|
|
30
|
+
"Supported platforms are darwin/arm64, win32/x64 and linux/x64.",
|
|
24
31
|
);
|
|
25
32
|
}
|
|
26
33
|
|
|
@@ -41,7 +48,7 @@ function main() {
|
|
|
41
48
|
process.exit(1);
|
|
42
49
|
}
|
|
43
50
|
|
|
44
|
-
const
|
|
51
|
+
const child = spawn(
|
|
45
52
|
path.join(distributionRoot, target.executable),
|
|
46
53
|
process.argv.slice(2),
|
|
47
54
|
{
|
|
@@ -53,16 +60,23 @@ function main() {
|
|
|
53
60
|
},
|
|
54
61
|
);
|
|
55
62
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
process.kill(process.pid, result.signal);
|
|
63
|
-
}
|
|
63
|
+
const signals = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
64
|
+
const forward = (signal) => child.kill(signal);
|
|
65
|
+
for (const signal of signals) process.on(signal, forward);
|
|
66
|
+
const removeSignalHandlers = () => {
|
|
67
|
+
for (const signal of signals) process.off(signal, forward);
|
|
68
|
+
};
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
child.once("error", (error) => {
|
|
71
|
+
removeSignalHandlers();
|
|
72
|
+
process.stderr.write(`Failed to start GEA CLI: ${error.message}\n`);
|
|
73
|
+
process.exitCode = 1;
|
|
74
|
+
});
|
|
75
|
+
child.once("exit", (code, signal) => {
|
|
76
|
+
removeSignalHandlers();
|
|
77
|
+
if (signal) process.kill(process.pid, signal);
|
|
78
|
+
else process.exitCode = code ?? 1;
|
|
79
|
+
});
|
|
66
80
|
}
|
|
67
81
|
|
|
68
82
|
if (require.main === module) {
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"directory": "packages/gea-cli"
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
|
-
"version": "0.2.
|
|
16
|
+
"version": "0.2.261016-alpha.0",
|
|
17
17
|
"bin": {
|
|
18
18
|
"gea": "gea-launcher.cjs"
|
|
19
19
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"name": "@gea-ai/cli",
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"@gea-ai/cli-darwin-arm64": "0.2.
|
|
41
|
+
"@gea-ai/cli-darwin-arm64": "0.2.261016-alpha.0"
|
|
42
42
|
},
|
|
43
43
|
"os": [
|
|
44
44
|
"darwin"
|
package/runtime.mjs
CHANGED
|
@@ -14,7 +14,7 @@ function geaInstallation(environment = process.env) {
|
|
|
14
14
|
let distributionRoot = environment.GEA_CLI_DISTRIBUTION_ROOT;
|
|
15
15
|
if (!distributionRoot && (!environment.GEA_CLI_BINARY || !environment.GEA_WORKER_RUNTIME_BINARY || !environment.WORKER_RUNTIME_SYSTEM_WORKER_ROOT)) {
|
|
16
16
|
const cliRequire = createRequire(import.meta.url);
|
|
17
|
-
const target = process.platform === "darwin" && process.arch === "arm64" ? "darwin-arm64" : process.platform === "win32" && process.arch === "x64" ? "win32-x64" : null;
|
|
17
|
+
const target = process.platform === "darwin" && process.arch === "arm64" ? "darwin-arm64" : process.platform === "win32" && process.arch === "x64" ? "win32-x64" : process.platform === "linux" && process.arch === "x64" ? "linux-x64" : null;
|
|
18
18
|
if (!target)
|
|
19
19
|
throw new Error(
|
|
20
20
|
"Set GEA_CLI_BINARY, GEA_WORKER_RUNTIME_BINARY and WORKER_RUNTIME_SYSTEM_WORKER_ROOT for this platform."
|
|
@@ -25,7 +25,7 @@ function geaInstallation(environment = process.env) {
|
|
|
25
25
|
}
|
|
26
26
|
const cli = environment.GEA_CLI_BINARY ?? join(
|
|
27
27
|
distributionRoot,
|
|
28
|
-
process.platform === "win32" ? "gea-windows-x64.exe" : "gea-darwin-arm64"
|
|
28
|
+
process.platform === "win32" ? "gea-windows-x64.exe" : process.platform === "linux" ? "gea-linux-x64" : "gea-darwin-arm64"
|
|
29
29
|
);
|
|
30
30
|
const runtime = environment.GEA_WORKER_RUNTIME_BINARY ?? join(
|
|
31
31
|
distributionRoot,
|
package/vite.mjs
CHANGED
|
@@ -19,7 +19,7 @@ function geaInstallation(environment = process.env) {
|
|
|
19
19
|
let distributionRoot = environment.GEA_CLI_DISTRIBUTION_ROOT;
|
|
20
20
|
if (!distributionRoot && (!environment.GEA_CLI_BINARY || !environment.GEA_WORKER_RUNTIME_BINARY || !environment.WORKER_RUNTIME_SYSTEM_WORKER_ROOT)) {
|
|
21
21
|
const cliRequire = createRequire(import.meta.url);
|
|
22
|
-
const target = process.platform === "darwin" && process.arch === "arm64" ? "darwin-arm64" : process.platform === "win32" && process.arch === "x64" ? "win32-x64" : null;
|
|
22
|
+
const target = process.platform === "darwin" && process.arch === "arm64" ? "darwin-arm64" : process.platform === "win32" && process.arch === "x64" ? "win32-x64" : process.platform === "linux" && process.arch === "x64" ? "linux-x64" : null;
|
|
23
23
|
if (!target)
|
|
24
24
|
throw new Error(
|
|
25
25
|
"Set GEA_CLI_BINARY, GEA_WORKER_RUNTIME_BINARY and WORKER_RUNTIME_SYSTEM_WORKER_ROOT for this platform."
|
|
@@ -30,7 +30,7 @@ function geaInstallation(environment = process.env) {
|
|
|
30
30
|
}
|
|
31
31
|
const cli = environment.GEA_CLI_BINARY ?? join(
|
|
32
32
|
distributionRoot,
|
|
33
|
-
process.platform === "win32" ? "gea-windows-x64.exe" : "gea-darwin-arm64"
|
|
33
|
+
process.platform === "win32" ? "gea-windows-x64.exe" : process.platform === "linux" ? "gea-linux-x64" : "gea-darwin-arm64"
|
|
34
34
|
);
|
|
35
35
|
const runtime = environment.GEA_WORKER_RUNTIME_BINARY ?? join(
|
|
36
36
|
distributionRoot,
|