feat: add v0.1 runtime skeleton
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { runOnce, type RunnerOnceOptions } from "./run-once.js";
|
||||
|
||||
const managerUrl = process.env.AGENTRUN_MGR_URL;
|
||||
const runId = process.env.AGENTRUN_RUN_ID;
|
||||
if (!managerUrl || !runId) {
|
||||
console.log(JSON.stringify({ ok: false, failureKind: "schema-invalid", message: "AGENTRUN_MGR_URL and AGENTRUN_RUN_ID are required" }));
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
const options: RunnerOnceOptions = {
|
||||
managerUrl,
|
||||
runId,
|
||||
};
|
||||
if (process.env.AGENTRUN_RUNNER_ID) options.runnerId = process.env.AGENTRUN_RUNNER_ID;
|
||||
if (process.env.AGENTRUN_CODEX_COMMAND) options.codexCommand = process.env.AGENTRUN_CODEX_COMMAND;
|
||||
if (process.env.AGENTRUN_CODEX_ARGS) options.codexArgs = JSON.parse(process.env.AGENTRUN_CODEX_ARGS) as string[];
|
||||
if (process.env.CODEX_HOME) options.codexHome = process.env.CODEX_HOME;
|
||||
const result = await runOnce(options);
|
||||
console.log(JSON.stringify({ ok: true, data: result }));
|
||||
Reference in New Issue
Block a user