UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.55 kB
import{n as normalizeConfigMachineStateKey}from"./config-machine-state-row-DRffEZur.mjs";import{n as executeExistingOpenClawStateRead}from"./openclaw-state-db-readonly-Cd5_cxBs.mjs";import{a as withArtifactPreservingStateReads}from"./artifact-preserving-state-reads-CWuQPqxe.mjs";import{r as captureOpenClawStateWorkerContext}from"./openclaw-state-worker-context-Dx8YjqO2.mjs";import{s as createAuthProfileCredentialWriteAdmission}from"./user-model-account-authority-B8H7rvCb.mjs"; //!src/state/config-machine-state-async.ts async function readConfigMachineStateAsync(e,t={},n={}){const read=()=>executeExistingOpenClawStateRead(t,{type:`machineState.read`,input:{key:e}});const r=await(n.artifactPreservingReadOnly?withArtifactPreservingStateReads(read):read());if(!r)return;return r.row?JSON.parse(r.row.value_json):void 0}async function readVoiceWakeMachineState(e,t={}){const n=await executeExistingOpenClawStateRead(t,{type:e});if(!n)return;return n.row?{value:JSON.parse(n.row.value_json),updatedAtMs:n.row.updated_at_ms}:void 0}async function writeConfigMachineStateAsync(e,t,n={}){const{runOpenClawStateWorkerOperation:r}=await import(`./openclaw-state-worker-store-DM1orX5Z.mjs`);const i=normalizeConfigMachineStateKey(e);const a=captureOpenClawStateWorkerContext(n);return r(a,e=>e.execute({type:`machineState.write`,input:{key:i,value:t}}),i===`authProfiles.store`?{createAdmission:createAuthProfileCredentialWriteAdmission(a)}:void 0)}export{readVoiceWakeMachineState as n,writeConfigMachineStateAsync as r,readConfigMachineStateAsync as t};