openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
2 lines • 2.21 kB
JavaScript
//!src/infra/doctor-progress.ts
const CORE_PHASES=[`doctor.startup`,`doctor.maintenance-admission`,`doctor.archive-preparation`,`doctor.maintenance.begin`,`doctor.state-preflight`,`doctor.database-preflight`,`doctor.schema-admission`,`doctor.state-database-repair`,`doctor.state-schema`,`doctor.config-flow`,`doctor.database-migrations`,`doctor.heartbeat-migration-backups`,`doctor.contributions`,`doctor.external-config`,`doctor.maintenance-ready`,`doctor.sqlite-nocow`,`doctor.sqlite-reclamation`,`doctor.retained-runtimes`,`doctor.maintenance.finish`,`doctor.maintenance.release`,`Update schema admission`,`Update schema rehearsal`,`Agent deletion journal`,`Database preflight`,`UI protocol`,`Source install`,`CLI launcher`,`Plugin runtime links`,`Config repairs`,`Preserve original state`];function formatDoctorProgressPhase(e){return e.replace(/^doctor\./u,``).replaceAll(/[.-]/gu,` `)}const CORE_LABELS=new Set(CORE_PHASES.map(formatDoctorProgressPhase));const RETIREMENT_WIDENING=/^Retirement-only Doctor widened: (?:config\.(?:model-retirement(?:\.(?:pending-changes|change-notes|warning-notes(?:\.codex-routes)?|auth-findings|model-replacements|model-repair-warnings))?|config-repair|config-missing|config-invalid|legacy-write-blocked|heartbeat-deferred|preflight-unsettled|preflight-config-changed|state-migration-unsettled|cron-selection-unresolved|heartbeat-migration|billing-migration|repair-warning|mutable-allowlist-warning|plugin-warning|billing-warning|plugin-inventory-changed|channel-work|provider-renames|blocked-models|phone-cleanup|session-plan-unbound|session-plan-refused|preparation)|agent-admission|startup-findings|startup-warnings|doctor:(?:write-config-migrations|auth-profile-migration|session-transcripts|codex-session-routes|write-config|final-config-validation)(?:\.failed)?)$/u;function parseDoctorRetirementWideningLine(e){return RETIREMENT_WIDENING.test(e)?e:void 0}function parseDoctorProgressLine(e){if(e.length>128)return;const t=/^Doctor: ([A-Za-z ]+)( \(\d{1,10}s elapsed\))?$/u.exec(e);return t?.[1]&&CORE_LABELS.has(t[1])?`Doctor: ${t[1]}${t[2]??``}`:void 0}export{parseDoctorProgressLine as n,parseDoctorRetirementWideningLine as r,formatDoctorProgressPhase as t};