UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.31 kB
import{t as createDeferredCore}from"./deferred-QsZCoVH-.mjs";import{t as formatCliCommand}from"./command-format-D7KhNLP0.mjs";import{c as registerSignalExitGate}from"./signal-exit-barrier-DoATIAtq.mjs"; //!src/commands/doctor-maintenance-exit.ts function formatDoctorRecoveryHint(e){return`Keep the Gateway stopped until Doctor (PID ${process.pid}) and its repair children have exited. Resolve any storage or cleanup failure, then run \`${formatCliCommand(`openclaw doctor --fix`,e)}\` to finish and verify repairs. After repair succeeds, run \`${formatCliCommand(`openclaw gateway status --deep`,e)}\`; if still stopped, run \`${formatCliCommand(`openclaw gateway start`,e)}\`.`}function holdDoctorMaintenanceExit(e){const t=new AbortController;const n=createDeferredCore();n.promise.catch(()=>void 0);const r=registerSignalExitGate(n.promise,(n,r)=>{if(t.signal.aborted)return;const i=n??r;const a=`Doctor interrupted${i?` by ${i}`:``}; cancelling inspections and settling admitted repairs before exit.`;t.abort(new Error(a));try{e?.(a)}catch{}});let i=true;const release=(e=false)=>{if(!i)return;i=false;r();if(e)n.reject(/* @__PURE__ */ new Error(`Doctor maintenance did not complete.`));else n.resolve()};return{signal:t.signal,release}}export{holdDoctorMaintenanceExit as n,formatDoctorRecoveryHint as t};