UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

5 lines • 2.8 kB
import{r as defaultRuntime}from"../runtime-DIcLIHcp.mjs";import{t as enableConsoleCapture}from"../console-BHJbJ-IX.mjs";import{Jn as string,Lt as boolean,Nt as array,Pn as number,qn as strictObject,xn as literal}from"../schemas-DuCQi-Qb.mjs";import{l as withSqliteSnapshotReuse}from"../sqlite-snapshot-reuse-CJ-j-WeT.mjs";import{a as resolveUpdateRehearsalRoot}from"../update-rehearsal-paths-C4qLj9oD.mjs";import{a as withCliCommandCleanup,o as withCliProcessScope}from"../runtime-cleanup-scope-BC_Qj3cp.mjs";import{a as withConsoleLogsRoutedToStderrForJson}from"../json-output-mode-SfJd0w4b.mjs";import{a as runCliDisposer,t as closeCliResources}from"../runtime-cleanup-DVuV57ip.mjs";import{a as runCliWithExitFinalization}from"../one-shot-exit-LLy48Ehj.mjs";import{t as readByteStreamWithLimit}from"../read-byte-stream-with-limit-Ockoa332.mjs";import{t as scrubDoctorErrorMessage}from"../doctor-error-message-Crthe8x4.mjs"; //!src/commands/doctor-lint-options.ts const DoctorLintCliOptionsSchema=strictObject({json:boolean().optional(),severityMin:string().optional(),skipIds:array(string()).readonly().optional(),onlyIds:array(string()).readonly().optional(),allowExec:boolean().optional(),deep:boolean().optional(),includeAllChecks:boolean().optional(),updateReadiness:literal(`post-plugin`).optional()});const DoctorLintWorkerInputSchema=strictObject({options:DoctorLintCliOptionsSchema,commandStartedAtMs:number().int().optional()}); //!src/commands/doctor-lint.worker.ts async function runDoctorLintWorker(){if(!resolveUpdateRehearsalRoot(process.env))throw new Error(`Doctor lint worker requires an isolated update rehearsal.`);const e=await readByteStreamWithLimit(process.stdin,{maxBytes:1048576,onOverflow:()=>/* @__PURE__ */ new Error(`Doctor lint worker input exceeded its limit.`)});const{options:t,commandStartedAtMs:n}=DoctorLintWorkerInputSchema.parse(JSON.parse(e.toString(`utf8`)));if(t.json!==true)throw new Error(`Doctor lint worker requires JSON output.`);enableConsoleCapture();await withCliProcessScope(()=>withCliCommandCleanup(false,async e=>{let r;try{const{preparePostgresPoolForUpdate:e}=await import(`../pool-D4IPt2Ny.mjs`);await e(`openclaw doctor --fix`);const{runDoctorLintCliInProcess:i}=await import(`../doctor-lint-runner-D6jW5PRT.mjs`);r=await i(defaultRuntime,t,{commandStartedAtMs:n})}finally{await closeCliResources(e);const t=e?.pluginResources;if(t)await runCliDisposer(`plugin-registration-resources`,()=>t.release())}process.exitCode=r}))}withConsoleLogsRoutedToStderrForJson(process.argv,()=>runCliWithExitFinalization({run:()=>withSqliteSnapshotReuse(runDoctorLintWorker),onError:e=>{process.stderr.write(`Doctor lint worker failed: ${scrubDoctorErrorMessage(e)}\n`);process.exitCode=2}}),{machineOutput:true,retainRoutingUntilProcessExit:true});export{};