@tokenhouse/worker 0.0.0-stage → 0.1.0-rc.11
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/tokenhouse-worker.js +22 -0
- package/package.json +23 -4
- package/README.md +0 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
const { spawn } = require("node:child_process");
|
|
4
|
+
const os = require("node:os");
|
|
5
|
+
|
|
6
|
+
const key = process.platform + "-" + process.arch;
|
|
7
|
+
let bin;
|
|
8
|
+
try {
|
|
9
|
+
bin = require.resolve("@tokenhouse/worker-" + key + "/bin/tokenhouse-worker");
|
|
10
|
+
} catch {
|
|
11
|
+
console.error("tokenhouse-worker has no build for " + key + ". Supported: linux-x64, linux-arm64, darwin-arm64, darwin-x64.");
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
16
|
+
// Pass stops through, so a service manager stopping this launcher stops the worker too.
|
|
17
|
+
for (const sig of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(sig, () => child.kill(sig));
|
|
18
|
+
child.on("error", (e) => {
|
|
19
|
+
console.error(e.message);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
});
|
|
22
|
+
child.on("exit", (code, signal) => process.exit(code ?? 128 + (os.constants.signals[signal] ?? 0)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenhouse/worker",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-rc.11",
|
|
4
|
+
"description": "Connects a machine to Tokenhouse. A thin launcher for the platform binary.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"tokenhouse-worker": "bin/tokenhouse-worker.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin"
|
|
10
|
+
],
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": ">=18"
|
|
13
|
+
},
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"@tokenhouse/worker-linux-x64": "0.1.0-rc.11",
|
|
16
|
+
"@tokenhouse/worker-linux-arm64": "0.1.0-rc.11",
|
|
17
|
+
"@tokenhouse/worker-darwin-arm64": "0.1.0-rc.11",
|
|
18
|
+
"@tokenhouse/worker-darwin-x64": "0.1.0-rc.11"
|
|
19
|
+
},
|
|
20
|
+
"license": "UNLICENSED",
|
|
21
|
+
"repository": "github:Tokenhouse-Platform/tokenhouse",
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
}
|
|
25
|
+
}
|
package/README.md
DELETED