openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.89 kB
JavaScript
import{n as e}from"./sqlite-readonly-rolldown-runtime-DJBNY8Aw.mjs";import{a as t}from"./sqlite-readonly-sqlite-readonly-location-CrsaHxKY.mjs";import{Tn as n,kn as r,q as i}from"./sqlite-readonly-sqlite-database-admission-Bj6bmeyX.mjs";import{t as a}from"./sqlite-readonly-usingCtx-03vOGQ3v.mjs";import{t as o}from"./sqlite-readonly-node-sqlite-C-jA8uc4.mjs";import{n as s}from"./sqlite-readonly-open-BLov0o_D.mjs";import{dt as c,lt as l}from"./sqlite-readonly-location.worker.js";import{n as u}from"./sqlite-readonly-sqlite-readonly-inspection-CF7sn5Rb.mjs";var d=/* @__PURE__ */ e({inspectPhysicalStoreInProcess:()=>inspectPhysicalStoreInProcess,readBackupEngineImage:()=>readBackupEngineImage,readBackupEngineInProcess:()=>readBackupEngineInProcess,readEngineAnchorIdentity:()=>readEngineAnchorIdentity});function readBackupEngineImage(e,t){try{var n=a();return readEngineAnchorIdentity(n.u(o(e,{readOnly:!0})),t)}catch(e){n.e=e}finally{n.d()}}function readEngineAnchorIdentity(e,t){let n=s(e);if(!n)return{engine:`sqlite`};let r=n[0];if(n.length!==1||r?.engine!==`postgres`||typeof r.store_id!=`string`||typeof r.schema!=`string`||!/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(r.schema))throw Error(`Invalid PostgreSQL anchor: ${t}. Restore its matched backup.`);return{engine:`postgres`,storeId:r.store_id,namespace:r.schema}}async function readBackupEngineInProcess(e,t=!1){return inspectPhysicalStoreInProcess(e,t,t=>readEngineAnchorIdentity(t,e))}async function inspectPhysicalStoreInProcess(e,s,d){if(!s)try{let t=u(e,d);if(t)return t.value}catch(e){if(!(e instanceof l)&&!(e instanceof c)&&!i(e))throw e}let f=await t(e);return r({release(){if(!f.cleanup())throw new n(`SQLite engine inspection cleanup failed: ${e}`)}},`SQLite engine inspection`,()=>{try{var e=a();return d(e.u(o(f.location,{readOnly:!0})))}catch(t){e.e=t}finally{e.d()}})}export{readEngineAnchorIdentity as n,d as t};