Files
pikasTech-agentrun/src/mgr/main.ts
T
2026-05-29 11:48:26 +08:00

14 lines
686 B
TypeScript

import { startManagerServer } from "./server.js";
import { errorToJson } from "../common/errors.js";
const port = Number(process.env.PORT ?? process.env.AGENTRUN_MGR_PORT ?? "8080");
const host = process.env.HOST ?? "0.0.0.0";
try {
const started = await startManagerServer({ port, host });
const database = await started.store.health();
console.log(JSON.stringify({ ok: true, serviceId: "agentrun-mgr", baseUrl: started.baseUrl, database }));
} catch (error) {
console.error(JSON.stringify({ ok: false, serviceId: "agentrun-mgr", failureKind: "infra-failed", message: error instanceof Error ? error.message : String(error), error: errorToJson(error) }));
process.exit(1);
}