harness-reins 0.0.0-stage → 0.9.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/reins.js +57 -0
- package/package.json +30 -4
- package/README.md +0 -3
package/bin/reins.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// npm launcher: find the frozen reins for this platform and run it.
|
|
3
|
+
//
|
|
4
|
+
// The binary is installed by one of the optionalDependencies below; npm picks
|
|
5
|
+
// the one whose "os"/"cpu" match. Long-lived owners (systemd, launchd, Task
|
|
6
|
+
// Scheduler) are registered against the binary itself, never this script, so
|
|
7
|
+
// they do not depend on Node.
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
const { spawnSync } = require("child_process");
|
|
11
|
+
const path = require("path");
|
|
12
|
+
|
|
13
|
+
const PLATFORM_PACKAGES = {
|
|
14
|
+
"linux-x64": "@harness-reins/linux-x64",
|
|
15
|
+
"linux-arm64": "@harness-reins/linux-arm64",
|
|
16
|
+
"darwin-x64": "@harness-reins/darwin-x64",
|
|
17
|
+
"darwin-arm64": "@harness-reins/darwin-arm64",
|
|
18
|
+
"win32-x64": "@harness-reins/win32-x64",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function fail(message) {
|
|
22
|
+
process.stderr.write(`reins: ${message}\n`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const PIP_INSTALL = 'python3 -m pip install "git+https://github.com/lz59970062/harness-reins.git"';
|
|
27
|
+
|
|
28
|
+
// The Linux binaries link against glibc; musl systems such as Alpine cannot load them.
|
|
29
|
+
function isMusl() {
|
|
30
|
+
if (process.platform !== "linux") return false;
|
|
31
|
+
try {
|
|
32
|
+
const report = process.report && process.report.getReport();
|
|
33
|
+
return !(report && report.header && report.header.glibcVersionRuntime);
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function binaryPath() {
|
|
40
|
+
if (process.env.REINS_BINARY) return process.env.REINS_BINARY;
|
|
41
|
+
if (isMusl()) fail(`no prebuilt binary for musl-based Linux (such as Alpine); install from source: ${PIP_INSTALL}`);
|
|
42
|
+
const key = `${process.platform}-${process.arch}`;
|
|
43
|
+
const name = PLATFORM_PACKAGES[key];
|
|
44
|
+
if (!name) fail(`no prebuilt binary for ${key}; install from source: ${PIP_INSTALL}`);
|
|
45
|
+
let root;
|
|
46
|
+
try {
|
|
47
|
+
root = path.dirname(require.resolve(`${name}/package.json`));
|
|
48
|
+
} catch {
|
|
49
|
+
fail(`${name} is not installed; reinstall without --omit=optional / --no-optional`);
|
|
50
|
+
}
|
|
51
|
+
return path.join(root, "dist", "reins", process.platform === "win32" ? "reins.exe" : "reins");
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const result = spawnSync(binaryPath(), process.argv.slice(2), { stdio: "inherit" });
|
|
55
|
+
if (result.error) fail(result.error.message);
|
|
56
|
+
if (result.signal) process.kill(process.pid, result.signal);
|
|
57
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "harness-reins",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.9.2",
|
|
4
|
+
"description": "Harness Reins: dispatch work to any agent and route the result back to the session that asked",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/lz59970062/harness-reins.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/lz59970062/harness-reins#readme",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"agents",
|
|
13
|
+
"codex",
|
|
14
|
+
"claude-code",
|
|
15
|
+
"pi",
|
|
16
|
+
"callback",
|
|
17
|
+
"long-running",
|
|
18
|
+
"orchestration"
|
|
19
|
+
],
|
|
20
|
+
"bin": {
|
|
21
|
+
"reins": "bin/reins.js"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"bin"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"optionalDependencies": {
|
|
30
|
+
"@harness-reins/linux-x64": "0.9.2"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/README.md
DELETED