@rivet-dev/agentos-runtime-core0.4.91.0 kB
import { existsSync } from "node:fs";
import { createRequire } from "node:module";
/**
* Resolves the published AgentOS runtime sidecar binary for Node.js clients.
*/
export function resolvePublishedSidecarBinary() {
const override = process.env.AGENTOS_NATIVE_SIDECAR_BIN ??
process.env.AGENTOS_SIDECAR_BIN;
if (override) {
if (!existsSync(override)) {
throw new Error(`AgentOS native sidecar override is set to ${override} but the file does not exist`);
}
return override;
}
const require = createRequire(import.meta.url);
let mod;
try {
mod = require("@rivet-dev/agentos-runtime-sidecar");
}
catch (error) {
throw new Error("failed to resolve the AgentOS runtime sidecar binary: the @rivet-dev/agentos-runtime-sidecar " +
"package is not installed. Install it, or set AGENTOS_NATIVE_SIDECAR_BIN to a local " +
`agentos-native-sidecar binary. (${error.message})`);
}
return mod.getSidecarPath();
}
Shown as plain text from the published tarball, after apm checked it against the version's checksum. Nothing in it runs on this page.