Something went wrong. Try again.
fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)
Something went wrong. Try again.
960 B · 23 lines
TypeScript
at main
123456789101112131415161718192021222324import { resolve } from "node:path";import { VERSION } from "../../config.js";import type { DaemonRuntimeIdentity } from "./daemon-protocol.js";
declare const __PI_BUILD_ID__: string | undefined;
export const PRIME_AGENT_BUILD_ID_ENV = "PRIME_AGENT_BUILD_ID";export const PRIME_AGENT_LAUNCHER_PATH_ENV = "PRIME_AGENT_LAUNCHER_PATH";
function bundledBuildId(): string | undefined { return typeof __PI_BUILD_ID__ === "undefined" ? undefined : __PI_BUILD_ID__;}
export function getDaemonRuntimeIdentity(environment: NodeJS.ProcessEnv = process.env): DaemonRuntimeIdentity { const entrypoint = process.argv[1]; const launcher = environment[PRIME_AGENT_LAUNCHER_PATH_ENV]; return { buildId: environment[PRIME_AGENT_BUILD_ID_ENV] ?? bundledBuildId() ?? `release-${VERSION}`, executablePath: resolve(process.execPath), ...(entrypoint ? { entrypointPath: resolve(entrypoint) } : {}), ...(launcher ? { launcherPath: resolve(launcher) } : {}), };}