openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 911 B
JavaScript
import"./openclaw-state-read-kysely-sync-Bcu0Qb7F.mjs";import{n as e}from"./openclaw-state-read-agent-id-DmscQLD6.mjs";import{a as t,s as n}from"./openclaw-state-read-session-key-H2_GWFw8.mjs";import{t as r}from"./openclaw-state-read-store-entry-Bd9zQZa_.mjs";function resolveSqliteSessionKey(e,i){let a=r(e);return!a||a===`global`||a===`unknown`||n(a)?a:t({agentId:i,requestKey:a})}function resolveSqliteAgentId(t){let r=t.scopedAgentId?e(t.scopedAgentId):void 0;if(r&&t.storeAgentId&&r!==t.storeAgentId&&!t.storeShared)throw Error(`SQLite session store path belongs to agent ${t.storeAgentId}; requested agent ${r}.`);let i=t.sessionKey?n(t.sessionKey)?.agentId:void 0;return r??t.storeAgentId??i}function toDatabaseOptions(e){return{agentId:e.databaseAgentId??e.agentId,...e.env?{env:e.env}:{},...e.path?{path:e.path}:{}}}export{resolveSqliteSessionKey as n,toDatabaseOptions as r,resolveSqliteAgentId as t};