UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.49 kB
import{t as runChannelPluginStartupMaintenance}from"./lifecycle-startup-DGbFsqpA.mjs";import{n as resolveDoctorChannelPreviewConfig}from"./preview-warnings-DKnXoH6e.mjs"; //!src/flows/doctor-startup-channel-maintenance.ts const CHANNEL_PREVIEW_WARNINGS_CHECK_ID=`core/doctor/channel-preview-warnings`;function normalizeWarningMessage(e){return e.replace(/^-\s*/,``).trim()}function warningPath(e){return e.match(/^\s*-?\s*(channels\.[^\s:]+)/)?.[1]}async function collectChannelPreviewWarningHealthFindings(e){const{collectChannelDoctorPreviewWarnings:t}=await import(`./channel-doctor-DhwxQp-5.mjs`);const n=`openclaw doctor --fix`;return(await t({cfg:(await resolveDoctorChannelPreviewConfig({cfg:e.cfg,env:process.env,allowExec:e.allowExec})).cfg,doctorFixCommand:n,env:process.env})).map(e=>{const t=warningPath(e);return Object.assign({checkId:CHANNEL_PREVIEW_WARNINGS_CHECK_ID,severity:`warning`,message:normalizeWarningMessage(e)},t?{path:t}:{},{requirement:`Configured channels should not emit doctor preview warnings.`,fixHint:`Run \`${n}\` if the channel warning recommends repair, or update the affected channel config manually.`})})}async function maybeRunDoctorStartupChannelMaintenance(e){if(!e.shouldRepair)return;await runChannelPluginStartupMaintenance({cfg:e.cfg,env:process.env,log:{info:t=>e.runtime.log(t),warn:t=>e.runtime.error(t)},trigger:`doctor-fix`,logPrefix:`doctor`})}export{collectChannelPreviewWarningHealthFindings,maybeRunDoctorStartupChannelMaintenance};