UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

25 lines (24 loc) • 1.16 kB
//#region src/agents/agent-runtime-id.ts const OPENCLAW_AGENT_RUNTIME_ID = "openclaw"; const AUTO_AGENT_RUNTIME_ID = "auto"; /** Normalizes configured runtime aliases to the current embedded-agent runtime id vocabulary. */ function normalizeEmbeddedAgentRuntime(e) { const t = e?.trim(); if (!t) return OPENCLAW_AGENT_RUNTIME_ID; if (t === "openclaw" || t === "pi") return OPENCLAW_AGENT_RUNTIME_ID; if (t === "auto") return AUTO_AGENT_RUNTIME_ID; if (t === "codex-app-server") return "codex"; return t; } /** Normalizes an optional unknown runtime id value, returning undefined when absent/invalid. */ function normalizeOptionalAgentRuntimeId(e) { if (typeof e !== "string") return; const t = e.trim().toLowerCase(); return t ? normalizeEmbeddedAgentRuntime(t) : void 0; } /** Returns whether a runtime id should be treated as the default runtime selection. */ function isDefaultAgentRuntimeId(e) { return e === void 0 || e === "auto" || e === "default"; } //#endregion export { normalizeOptionalAgentRuntimeId as a, normalizeEmbeddedAgentRuntime as i, OPENCLAW_AGENT_RUNTIME_ID as n, isDefaultAgentRuntimeId as r, AUTO_AGENT_RUNTIME_ID as t };