openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.51 kB
JavaScript
import{r as e}from"./transcript-string-coerce-BxRUqIXb.mjs";import{n as t}from"./transcript-agent-id-DmscQLD6.mjs";import{n,o as r,r as i}from"./transcript-session-key-normalization-CxaUSpng.mjs";Object.freeze(/* @__PURE__ */ `activity.ai-agents.appearance.approve.apps.ask.automation.automations.channels.chat.templates.communications.config.cron.custodian.dashboard.dashboards.debug.focus.infrastructure.lobsterdex.logs.mcp.meetings.memory-import.model-providers.model-setup.new.nodes.plugin.plugins.portals.profile.sessions.settings.share.skills.systems.terminal.usage.workboard.worktrees`.split(`.`));const a=`main`,o=a;function toAgentStoreSessionKey(a){let o=(a.requestKey??``).trim(),s=e(o);if(!o||s===`main`)return r({agentId:a.agentId,mainKey:a.mainKey});let c=i(o);if(c)return`agent:${c.agentId}:${c.rest}`;let l=n(o);return s.startsWith(`agent:`)?l:`agent:${t(a.agentId)}:${l}`}function resolveAgentIdFromSessionKey(e,n){let r=i(e);if(r?.agentId)return t(r.agentId);if(classifySessionKeyShape(e)===`malformed_agent`)throw Error(`Malformed agent session key; refusing default-agent resolution.`);let a=n?.trim();if(a)return t(a);throw Error(`Session key does not contain an agent id; resolve it with the configured default agent.`)}function classifySessionKeyShape(t){let n=(t??``).trim();return n?i(n)?`agent`:e(n).startsWith(`agent:`)?`malformed_agent`:`legacy_or_alias`:`missing`}export{toAgentStoreSessionKey as a,resolveAgentIdFromSessionKey as i,a as n,classifySessionKeyShape as r,o as t};