openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
5 lines • 1.29 kB
JavaScript
import{n as normalizeAgentId}from"./agent-id-cOfqmfln.mjs";import{j as tryResolveLegacyDataOwnerAgentId}from"./agent-scope-config-CG9CFpGX.mjs";
//!src/config/legacy.default-agent-owner-state.ts
const legacyDefaultAgentIdByConfig=/* @__PURE__ */ new WeakMap;function setRetainedLegacyDefaultAgentId(e,t){if(t)legacyDefaultAgentIdByConfig.set(e,t);else legacyDefaultAgentIdByConfig.delete(e)}function getRetainedLegacyDefaultAgentId(e){return legacyDefaultAgentIdByConfig.get(e)}
//!src/config/legacy.default-agent-owner.ts
function retainLegacyDefaultAgentId(e,t){setRetainedLegacyDefaultAgentId(e,t?normalizeAgentId(t):void 0);return e}function inheritLegacyDefaultAgentId(e,t){return retainLegacyDefaultAgentId(t,tryGetLegacyDefaultAgentId(e))}function tryGetLegacyDefaultAgentId(e){return typeof e===`object`&&e!==null||typeof e===`function`?getRetainedLegacyDefaultAgentId(e):void 0}function resolveSessionStoreCompatibilityAgentId(e){const t=e.agents?.defaults?.sessionStore?.agentId?.trim();return t?normalizeAgentId(t):tryResolveLegacyDataOwnerAgentId(e)??`main`}export{getRetainedLegacyDefaultAgentId as a,tryGetLegacyDefaultAgentId as i,resolveSessionStoreCompatibilityAgentId as n,setRetainedLegacyDefaultAgentId as o,retainLegacyDefaultAgentId as r,inheritLegacyDefaultAgentId as t};