openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
26 lines (25 loc) • 1.19 kB
JavaScript
import { n as getRuntimeConfig } from "./io.runtime-B9iJRs3w.js";
import { o as resolveSessionStorePathCore } from "./paths-CXdaYWF_.js";
import "./io-bdCzpGWJ.js";
import { r as resolveSqliteTargetFromSessionStorePath } from "./session-sqlite-target-Dp-kgpcT.js";
import { r as resolveSessionStoreIdentity } from "./session-store-key-8xEjWSNi.js";
import { t as SqliteBoardStore } from "./sqlite-board-store-B92YW4eF.js";
//#region src/gateway/board-store.ts
function resolveGatewaySessionDatabase(sessionKey, explicitAgentId) {
const cfg = getRuntimeConfig();
const { agentId, canonicalKey } = resolveSessionStoreIdentity({
cfg,
sessionKey,
agentId: explicitAgentId
});
const storePath = resolveSessionStorePathCore(cfg.session?.store, { agentId });
const databaseTarget = resolveSqliteTargetFromSessionStorePath(storePath, { agentId });
return {
agentId: databaseTarget.agentId ?? agentId,
path: databaseTarget.path,
sessionKey: canonicalKey
};
}
const boardStore = new SqliteBoardStore({ resolveSession: ({ sessionKey, agentId }) => resolveGatewaySessionDatabase(sessionKey, agentId) });
//#endregion
export { resolveGatewaySessionDatabase as n, boardStore as t };