UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.18 kB
import{i as isSqliteWorkerError}from"../sqlite-worker-error-DHUQ0e2U.mjs";import{l as OPENCLAW_SQLITE_BUSY_TIMEOUT_MS}from"../openclaw-state-db-contract-G6fQNIi2.mjs";import"../sqlite-worker-contract-CcRGAuae.mjs";import{l as runSqliteWorkerTransactionSync}from"../sqlite-transaction-CON-dGDv.mjs";import{n as prepareSessionProgressCardWrite,r as writePreparedSessionProgressCard}from"../progress-card-store-DO9eoz-8.mjs";import{t as bindSqliteWorkerDatabase}from"../sqlite-worker-binding-CxA1GbiJ.mjs";import{t as encodeSqliteWorkerDomainError}from"../sqlite-worker-domain-error-CHwGZvH1.mjs"; //!src/session-cards/progress-card-store.worker.ts function bindSqliteWorkerBackend(e,t){const n=t.database;return bindSqliteWorkerDatabase(n,{execute(e){const r=prepareSessionProgressCardWrite(e.input);try{return{ok:true,value:runSqliteWorkerTransactionSync(t,()=>writePreparedSessionProgressCard(n,e.input.sessionKey,r),{databaseLabel:t.databasePath,operationLabel:`progress-card.put`,busyTimeoutMs:OPENCLAW_SQLITE_BUSY_TIMEOUT_MS})}}catch(e){if(isSqliteWorkerError(e,`closed`))throw e;return{ok:false,error:encodeSqliteWorkerDomainError(n,e)}}}})}export{bindSqliteWorkerBackend};