openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.65 kB
JavaScript
import{t as createConfigIO}from"./io.factory-y6nIrp_4.mjs";import"./config-DkZ8y8Gv.mjs";import{n as healthFindingMeetsSeverity}from"./health-checks-bdwCtNe-.mjs";import{n as runDoctorLintChecks,t as exitCodeFromFindings}from"./doctor-lint-flow-nrUDzyxR.mjs";import{n as createCoreHealthChecks}from"./doctor-core-checks-j_P0cANC.mjs";
//!src/commands/doctor-hosted.ts
const HOSTED_CHECK_IDS=/* @__PURE__ */ new Set([`core/doctor/final-config-validation`,`core/doctor/gateway-config`,`core/doctor/command-owner`,`core/doctor/node-runtime`,`core/doctor/runtime-capabilities`,`core/doctor/stale-runtime-build`,`core/doctor/ui-protocol-freshness`]);async function runHostedDoctorLint(e){const t=await createConfigIO({observe:false,pluginValidation:`core-only`}).readConfigFileSnapshot();const n={mode:`lint`,runtime:e,cfg:t.config,env:process.env,lintConfigSnapshot:t};const r=createCoreHealthChecks().filter(e=>HOSTED_CHECK_IDS.has(e.id)&&(t.valid||e.id!==`core/doctor/gateway-config`));const i=await runDoctorLintChecks(n,{checks:r});const a=i.findings.filter(e=>healthFindingMeetsSeverity(e,`warning`));e.log(`Doctor (live Gateway): ran ${i.checksRun} check(s), ${a.length} finding(s)`);for(const t of a){e.log(` [${t.severity}] ${t.checkId} - ${t.path?`${t.path}: `:``}${t.message}`);if(t.fixHint)e.log(` fix: ${t.fixHint}`)}e.log("Database, plugin, credential, and workspace inspections were deferred to avoid copying or changing live Gateway state. Run `openclaw doctor --lint` on this host with the Gateway stopped for the full report; repairs require `openclaw doctor --fix`.");return exitCodeFromFindings(i.findings)}export{runHostedDoctorLint};