import { type DoctorCheckOpts } from './checks.js'; import { type CheckResultWithName } from './runner.js'; export type DoctorScheduleTier = 'frequent' | 'full'; export interface DoctorScheduleResult { tier: DoctorScheduleTier; ranAt: number; results: CheckResultWithName[]; failCount: number; inconclusiveCount: number; /** * True when this 'full' run skipped the LLM chat probe + embed probe * because the crash-loop streak was already at/above CRASH_LOOP_THRESHOLD * (see this module's header comment, finding 2). Always false/absent for * a 'frequent' run, which never includes those checks regardless of crash * state. Surfaced so a caller (serve.ts's console.warn line) can tell "the * LLM/embed probe genuinely passed" apart from "the LLM/embed probe never * ran this cycle" — the same ADR-015 "don't let two different states * render identically" rule the `inconclusive` field exists for. */ llmTierSkippedForCrashLoop?: boolean; } export type DoctorResultSink = (result: DoctorScheduleResult) => void; /** Cheap-tier cadence: 15 minutes. Every check this tier runs is either a * local index-backed SQLite read or a loopback HTTP probe to the daemon's * own /health — no network call leaves the box, so a 15-minute interval * costs nothing worth tuning against. */ export declare const FREQUENT_DOCTOR_INTERVAL_MS: number; /** * Cheap DB-only pass. Selects exactly the checks declared `tier: 'cheap'` * (see this module's header comment) — from BOTH the core registry * (checks.ts) and the hardening/GPU registries (`extraChecks()` above) — and, * belt-and-braces, also clears `llmProviders`/`embedProvider` from the opts * before building the check list at all. */ export declare function runFrequentDoctorChecks(checkOpts: DoctorCheckOpts, onResult: DoctorResultSink): Promise; /** * Full pass — every check regardless of tier, including the LLM chat probe + * embed probe when `checkOpts.llmProviders`/`embedProvider` are supplied. * Call this ONLY from an existing infrequent (>=24h) tick; see module doc * comment. Skips the LLM/embed portion (not the rest of the full tier) when * the crash-loop streak is already at/above CRASH_LOOP_THRESHOLD — see the * module header comment, finding 2. */ export declare function runFullDoctorChecks(checkOpts: DoctorCheckOpts, onResult: DoctorResultSink): Promise; /** * Starts the frequent (cheap, DB-only) recurring pass: one immediate boot * pass (mirrors the consolidate/cleanup/spool-drain boot-pass convention in * serve.ts — catches anything a downtime window skipped) plus a recurring * timer. Returns a stop() handle; the interval is unref'd so it never holds * the process open, matching every other serve.ts timer. */ export declare function startFrequentDoctorSchedule(checkOpts: DoctorCheckOpts, onResult: DoctorResultSink, intervalMs?: number): () => void;