UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines • 1.21 kB
//!src/infra/database-engine/registry.ts const stores=[{id:`state`,label:`Shared state`,postgres:true},{id:`agent`,label:`Agent data`,postgres:true},{id:`workboard`,label:`Workboard`,postgres:true},{id:`logbook`,label:`Logbook`,postgres:true},{id:`team-reports`,label:`Team Reports`,postgres:true},{id:`quarantine`,label:`Database quarantine`},{id:`managed-update`,label:`Managed update handoffs`},{id:`package-activation`,label:`Package activation journal`}];function listDatabaseEngineStores(){return stores}function selectDatabaseEngine(e,t){const n=e.id===`quarantine`||e.id===`managed-update`||e.id===`package-activation`?void 0:t.database?.families?.[e.id]?.engine;if(n===`postgres`&&!e.postgres)throw new Error(`database.families.${e.id}.engine does not support postgres.`);return n??(t.database?.engine===`postgres`&&e.postgres?`postgres`:`sqlite`)}function resolveDatabaseFamilyEngines(e){const t={state:`sqlite`,agent:`sqlite`,workboard:`sqlite`,logbook:`sqlite`,"team-reports":`sqlite`,quarantine:`sqlite`,"managed-update":`sqlite`,"package-activation":`sqlite`};for(const n of stores)t[n.id]=selectDatabaseEngine(n,e);return t}export{resolveDatabaseFamilyEngines as n,listDatabaseEngineStores as t};