import type { HarnessAdapter } from "../adapters/types.js"; import { collectDiagnostics, type DiagnosticReport } from "../lib/diagnostics.js"; import { resolveAdaptersForCommand } from "../lib/harness-select.js"; import { type ClearResult } from "../lib/lsp-cache.js"; import { type OpenCodeHostDetection } from "../setup/host-generation.js"; export type DoctorClearTarget = "plugin-cache" | "lsp-cache" | "binary-cache"; export declare const DOCTOR_CLEAR_TARGET_OPTIONS: { label: string; value: DoctorClearTarget; }[]; export declare const DOCTOR_FORCE_CLEAR_TARGETS: DoctorClearTarget[]; export interface DoctorOptions { clear: boolean; fix: boolean; force: boolean; issue: boolean; argv: string[]; /** Optional adapter override lets tests render doctor output without launching a host. */ resolveAdapters?: typeof resolveAdaptersForCommand; collectDiagnostics?: typeof collectDiagnostics; collectRemovalHealth?: typeof collectRemovalHealth; detectOpenCodeHost?: () => OpenCodeHostDetection; } export interface RemovalHealth { available: boolean; usageWindowDays?: number; projectRootsServed?: number; sessionsServed?: number; projectRootsSource?: string; runningBackgroundTasks?: number; undoHistorySessions?: number; message?: string; } export interface CacheClearSummary { hadErrors: boolean; pluginCache?: { cleared: number; totalBytes: number; errors: number; }; lspCache?: { cleared: number; totalBytes: number; errors: number; }; binaryCache?: { cleared: number; totalBytes: number; errors: number; }; } export interface CacheClearOptions { clearLspCaches?: () => ClearResult; includePluginBytes?: boolean; } /** Build native arguments for `doctor --profile [seconds]` without changing profile semantics. */ export declare function buildDoctorProfileArgs(argv: string[]): string[]; /** Run the native sampler directly so doctor does not add its normal diagnostics output. */ export declare function runDoctorProfile(argv: string[]): number; export declare function runDoctor(options: DoctorOptions): Promise; declare function collectRemovalHealth(adapters: HarnessAdapter[]): Promise; /** Render AFT's durable removal costs; the section is shown even when state is unavailable. */ export declare function renderRemovalSection(health: RemovalHealth): string[]; export declare function hasDoctorProblems(report: DiagnosticReport): boolean; export declare function logBuildBreakerSuspensions(report: DiagnosticReport): void; export declare function runDoctorBuildBreakerReset(argv: string[]): Promise; export declare function clearDoctorCaches(adapters: HarnessAdapter[], targets: readonly DoctorClearTarget[], options?: CacheClearOptions): Promise; /** * Clear cached `aft` binaries except the version this CLI ships with. * * Each release of `@cortexkit/aft` bundles a matching binary version; the * plugin downloads it on first use into `~/.cache/aft/bin/v/aft`. * Older versions are kept around for rollback and to handle the * "old plugin instance still running" scenario, but they pile up over * time and a single binary is ~30 MB on macOS / Linux. Clearing keeps * the version that matches the running CLI so we don't yank the binary * a live OpenCode/Pi process is currently executing from. */ export interface BinaryCacheClearResult { cleared: number; bytesReclaimed: number; errors: { path: string; error: string; }[]; keptVersion: string | null; } export declare function clearOldBinaries(): BinaryCacheClearResult; export interface DoctorFixPlanItem { kind: "plugin" | "plugin-update" | "binary" | "onnx" | "storage" | "schema"; message: string; } export declare function buildDoctorFixPlan(adapters: HarnessAdapter[], report: DiagnosticReport): DoctorFixPlanItem[]; export declare function shouldSkipDoctorFixConfirmation(argv: string[]): boolean; export declare function doctorSkewBinaryDownloadDecision(argv: string[]): "prompt" | "proceed" | "skip"; export declare function formatDoctorStorageStatus(h: DiagnosticReport["harnesses"][number]): string; export declare function fixPluginEntries(adapters: HarnessAdapter[]): Promise; export declare function renderIssueDescription(description: string): string; export declare function deriveIssueTitleFromBody(body: string): string; export {}; //# sourceMappingURL=doctor.d.ts.map