@omicverse/omicos 0.3.19 → 0.3.21
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/omicos.js +35 -5
- package/package.json +7 -7
package/bin/omicos.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// and execs its bundled binary. Mirrors the codex-cli pattern.
|
|
5
5
|
"use strict";
|
|
6
6
|
|
|
7
|
-
const {
|
|
7
|
+
const { spawn } = require("node:child_process");
|
|
8
8
|
|
|
9
9
|
const PKG_BY_TRIPLE = {
|
|
10
10
|
"x86_64-unknown-linux-musl": "@omicverse/omicos-linux-x64",
|
|
@@ -51,9 +51,39 @@ try {
|
|
|
51
51
|
process.exit(1);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
// Keep the Node shim responsive while the native Core runs. A blocking
|
|
55
|
+
// spawnSync() dies immediately when a service manager sends SIGTERM to the
|
|
56
|
+
// shim, leaving the native `omicos serve` child alive under PID 1.
|
|
57
|
+
const child = spawn(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
58
|
+
const forwardedSignals = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
59
|
+
const forwarders = new Map();
|
|
60
|
+
|
|
61
|
+
child.on("error", (error) => {
|
|
62
|
+
console.error(`omicos: failed to launch native binary: ${error.message}`);
|
|
57
63
|
process.exit(1);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
for (const signal of forwardedSignals) {
|
|
67
|
+
const forward = () => {
|
|
68
|
+
try {
|
|
69
|
+
child.kill(signal);
|
|
70
|
+
} catch (_error) {
|
|
71
|
+
// The native child may already have exited.
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
forwarders.set(signal, forward);
|
|
75
|
+
process.on(signal, forward);
|
|
58
76
|
}
|
|
59
|
-
|
|
77
|
+
|
|
78
|
+
child.on("exit", (code, signal) => {
|
|
79
|
+
for (const forwardedSignal of forwardedSignals) {
|
|
80
|
+
process.removeListener(forwardedSignal, forwarders.get(forwardedSignal));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Preserve signal-based termination instead of converting it to exit 0.
|
|
84
|
+
if (signal) {
|
|
85
|
+
process.kill(process.pid, signal);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
process.exit(typeof code === "number" ? code : 1);
|
|
89
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omicverse/omicos",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"description": "OmicOS \u2014 agentic omics-analysis runtime & CLI (omicos-core). Installs the matching native binary for your platform.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"omicos": "bin/omicos.js"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "git+https://github.com/PrimorDecode/omicos-core.git"
|
|
20
20
|
},
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"@omicverse/omicos-linux-x64": "0.3.
|
|
23
|
-
"@omicverse/omicos-linux-arm64": "0.3.
|
|
24
|
-
"@omicverse/omicos-darwin-x64": "0.3.
|
|
25
|
-
"@omicverse/omicos-darwin-arm64": "0.3.
|
|
26
|
-
"@omicverse/omicos-win32-x64": "0.3.
|
|
27
|
-
"@omicverse/omicos-win32-arm64": "0.3.
|
|
22
|
+
"@omicverse/omicos-linux-x64": "0.3.21",
|
|
23
|
+
"@omicverse/omicos-linux-arm64": "0.3.21",
|
|
24
|
+
"@omicverse/omicos-darwin-x64": "0.3.21",
|
|
25
|
+
"@omicverse/omicos-darwin-arm64": "0.3.21",
|
|
26
|
+
"@omicverse/omicos-win32-x64": "0.3.21",
|
|
27
|
+
"@omicverse/omicos-win32-arm64": "0.3.21"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|