agent-job-relay-runtime 0.0.0-stage → 0.1.8
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/LICENSE +21 -0
- package/README.md +12 -2
- package/cli.mjs +19 -0
- package/index.mjs +46 -0
- package/native/linux-x64/agent-job-relay +0 -0
- package/native/manifest.json +13 -0
- package/native/win32-x64/agent-job-relay.exe +0 -0
- package/package.json +39 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AgentJobRelay contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AgentJobRelay runtime
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared native Rust/MCP executable for the AgentJobRelay OpenCode V1 and ChatGPT Desktop/Codex plugins. Linux x86_64/glibc or Windows x86_64 with Node.js 20+; no Rust compiler, install script, separate binary download, global PATH change or system service is required. The package includes the native executable and a platform-specific SHA-256 manifest. The manifest records the Linux build's minimum glibc version; incompatible platforms fail explicitly. Windows uses a statically linked MSVC runtime. Hashes check integrity, not publisher authenticity. Use the official npm registry and verify the publisher/provenance when available.
|
|
4
|
+
|
|
5
|
+
This is an experimental package. See the [repository](https://github.com/MorningFrog/agent-job-relay) for release availability, supported hosts and known limits. An npm version being downloadable is separate from official plugin-directory approval.
|
|
6
|
+
|
|
7
|
+
`agent-job-relay codex <arguments>` and `agent-job-relay opencode <arguments>` select persistent host profiles under `$XDG_STATE_HOME/agent-job-relay/<host>`, or `$HOME/.local/state/agent-job-relay/<host>`. Windows uses `%LOCALAPPDATA%\AgentJobRelay\profiles\<host>`. An explicit absolute `AJR_STATE_DIR` overrides that choice. Ordinary arguments pass to the same native CLI. These profiles are outside npm/host caches and stable across version updates; they contain no guessed caller identity. New profiles do not migrate a prior offline installation. Review its recorded state path before deliberately selecting it.
|
|
8
|
+
|
|
9
|
+
Installation runs no code. Invoking the CLI or plugin validates the packaged executable, then runs it with your OS permissions. First submission/explicit session binding starts the per-profile daemon. Removal preserves jobs/logs/history and does not stop daemons. Finish jobs and explicitly stop the original profile before an incompatible upgrade; no automatic daemon stop, database rollback or workload replay is performed.
|
|
10
|
+
|
|
11
|
+
Development: this source directory intentionally has no native payload. Build and pack from the repository with `python3 scripts/prepare_release.py --binary target/release/agent-job-relay --output .tmp/release-candidate`.
|
|
12
|
+
|
|
13
|
+
Windows 0.1.8 starts its daemon on demand, including host cleanup jobs, through verified same-user local CIM when native startup is denied. No login task/service is installed. Built-in Windows PowerShell/CIM must be permitted; diagnostics provide a copyable same-profile outside-terminal fallback when policy blocks it. `AJR_WINDOWS_STARTUP=direct` disables CIM.
|
package/cli.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { constants } from "node:os";
|
|
4
|
+
import { resolveExecutable, defaultStateDir } from "./index.mjs";
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
if (["codex", "opencode"].includes(args[0])) {
|
|
9
|
+
const host = args.shift();
|
|
10
|
+
args.unshift("--state-dir", defaultStateDir(host));
|
|
11
|
+
}
|
|
12
|
+
const child = spawn(resolveExecutable(), args, { stdio: "inherit" });
|
|
13
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(signal, () => child.kill(signal));
|
|
14
|
+
child.once("error", (error) => { console.error(`AgentJobRelay: ${error.message}`); process.exitCode = 1; });
|
|
15
|
+
child.once("exit", (code, signal) => { process.exitCode = code ?? 128 + (constants.signals[signal] ?? 1); });
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error(`AgentJobRelay: ${error.message}`);
|
|
18
|
+
process.exitCode = 1;
|
|
19
|
+
}
|
package/index.mjs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readFileSync, lstatSync, accessSync, constants } from "node:fs";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { dirname, join, isAbsolute } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const root = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
export function resolveExecutable() {
|
|
9
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
10
|
+
if (!["linux-x64", "win32-x64"].includes(platform)) {
|
|
11
|
+
throw new Error("AgentJobRelay supports Linux x86_64/glibc and Windows x86_64; macOS/ARM are not implemented");
|
|
12
|
+
}
|
|
13
|
+
const manifest = JSON.parse(readFileSync(join(root, "native/manifest.json"), "utf8"));
|
|
14
|
+
const metadata = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
15
|
+
const target = manifest.format === 2 ? manifest.targets?.[platform] : manifest.format === 1 && manifest.platform === platform ? manifest : undefined;
|
|
16
|
+
if (manifest.version !== metadata.version || !target || !/^[0-9a-f]{64}$/.test(target.sha256)) {
|
|
17
|
+
throw new Error("Invalid or missing AgentJobRelay native target; reinstall the matching trusted package");
|
|
18
|
+
}
|
|
19
|
+
if (process.platform === "linux") {
|
|
20
|
+
if (!/^\d+\.\d+$/.test(target.minimumGlibc)) throw new Error("Invalid native glibc requirement");
|
|
21
|
+
const libc = process.report?.getReport?.().header.glibcVersionRuntime;
|
|
22
|
+
const [major, minor] = (libc ?? "").split(".").map(Number);
|
|
23
|
+
const [requiredMajor, requiredMinor] = target.minimumGlibc.split(".").map(Number);
|
|
24
|
+
if (!libc || major < requiredMajor || major === requiredMajor && minor < requiredMinor) {
|
|
25
|
+
throw new Error(`AgentJobRelay requires glibc >=${target.minimumGlibc}; musl/unknown libc is unsupported`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const executable = join(root, "native", platform, process.platform === "win32" ? "agent-job-relay.exe" : "agent-job-relay");
|
|
29
|
+
const stat = lstatSync(executable);
|
|
30
|
+
if (!stat.isFile() || stat.isSymbolicLink() || stat.size > 128 * 1024 * 1024 || createHash("sha256").update(readFileSync(executable)).digest("hex") !== target.sha256) {
|
|
31
|
+
throw new Error("AgentJobRelay native payload failed integrity validation; nothing was executed");
|
|
32
|
+
}
|
|
33
|
+
accessSync(executable, constants.X_OK);
|
|
34
|
+
return executable;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function defaultStateDir(host) {
|
|
38
|
+
if (!["codex", "opencode"].includes(host)) throw new Error("Unknown AgentJobRelay host profile");
|
|
39
|
+
const linuxState = process.env.XDG_STATE_HOME || (process.env.HOME && join(process.env.HOME, ".local/state"));
|
|
40
|
+
const base = process.platform === "win32"
|
|
41
|
+
? process.env.LOCALAPPDATA && join(process.env.LOCALAPPDATA, "AgentJobRelay", "profiles")
|
|
42
|
+
: linuxState && join(linuxState, "agent-job-relay");
|
|
43
|
+
const state = process.env.AJR_STATE_DIR || (base && join(base, host));
|
|
44
|
+
if (!state || !isAbsolute(state)) throw new Error("AgentJobRelay state path must be absolute; set AJR_STATE_DIR or the platform's state base");
|
|
45
|
+
return state;
|
|
46
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": 2,
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"targets": {
|
|
5
|
+
"linux-x64": {
|
|
6
|
+
"minimumGlibc": "2.34",
|
|
7
|
+
"sha256": "8b86b7e83fa3b8e3b25330226bae1dd77f29cf646a5b79577d626a1c8d669b12"
|
|
8
|
+
},
|
|
9
|
+
"win32-x64": {
|
|
10
|
+
"sha256": "a0e34708285b681466bf97d7a2384086619a8f12c889c3dd7aae35ed940d01b9"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-job-relay-runtime",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Shared Linux and Windows native runtime for AgentJobRelay host plugins",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": "./index.mjs",
|
|
7
|
+
"bin": {
|
|
8
|
+
"agent-job-relay": "./cli.mjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.mjs",
|
|
12
|
+
"cli.mjs",
|
|
13
|
+
"native",
|
|
14
|
+
"README.md",
|
|
15
|
+
"LICENSE"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=20"
|
|
19
|
+
},
|
|
20
|
+
"os": [
|
|
21
|
+
"linux",
|
|
22
|
+
"win32"
|
|
23
|
+
],
|
|
24
|
+
"cpu": [
|
|
25
|
+
"x64"
|
|
26
|
+
],
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/MorningFrog/agent-job-relay.git",
|
|
31
|
+
"directory": "packages/runtime"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/MorningFrog/agent-job-relay",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/MorningFrog/agent-job-relay/issues"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public",
|
|
39
|
+
"registry": "https://registry.npmjs.org"
|
|
40
|
+
}
|
|
41
|
+
}
|