ai-launcher 0.0.0-stage → 0.1.2
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/bin/ai.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawn } = require("child_process");
|
|
3
|
+
const os = require("os");
|
|
4
|
+
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const fs = require("fs");
|
|
7
|
+
|
|
8
|
+
const plat = `${process.platform}-${process.arch}`;
|
|
9
|
+
const exe = process.platform === "win32" ? "ai-launcher.exe" : "ai-launcher";
|
|
10
|
+
const bin = path.join(__dirname, plat, exe);
|
|
11
|
+
if (!fs.existsSync(bin)) {
|
|
12
|
+
console.error(`ai-launcher: no binary for ${plat}. Supported: darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64.`);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
17
|
+
const fwd = (sig) => () => { try { child.kill(sig); } catch {} };
|
|
18
|
+
const sigs = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
19
|
+
for (const s of sigs) process.on(s, fwd(s));
|
|
20
|
+
|
|
21
|
+
child.on("error", (e) => { console.error(`ai-launcher: ${e.message}`); process.exit(1); });
|
|
22
|
+
child.on("exit", (code, signal) => {
|
|
23
|
+
if (signal) {
|
|
24
|
+
for (const s of sigs) process.removeAllListeners(s);
|
|
25
|
+
process.kill(process.pid, signal);
|
|
26
|
+
// signal may not terminate us (e.g. handled); fall back to shell convention
|
|
27
|
+
setTimeout(() => process.exit(128 + (os.constants.signals[signal] || 0)), 50);
|
|
28
|
+
} else {
|
|
29
|
+
process.exit(code ?? 1);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-launcher",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Launcher for AI coding CLIs",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ai": "bin/ai.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin"
|
|
11
|
+
],
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=16"
|
|
14
|
+
}
|
|
15
|
+
}
|
package/README.md
DELETED