UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

42 lines (41 loc) • 1.92 kB
import { t as createConfigIO } from "./io.factory-DEa_bi2j.mjs"; import "./config-CMA-J084.mjs"; import { n as healthFindingMeetsSeverity } from "./health-checks-BFk2VaFq.mjs"; import { n as runDoctorLintChecks, t as exitCodeFromFindings } from "./doctor-lint-flow-BvruTNfX.mjs"; import { n as createCoreHealthChecks } from "./doctor-core-checks-C6WOupW-.mjs"; //#region 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" ]); /** Hosted diagnosis never opens operator databases or prepares private inspection images. */ 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); } //#endregion export { runHostedDoctorLint };