import { type LspDiagnostic } from "./client.js";
import { type LspServerSpec } from "./servers.js";
export interface LspManagerOptions {
    /** Server catalog override — tests inject a fake-server spec here. */
    catalog?: readonly LspServerSpec[];
    /** Hard diagnostics budget once a client has served at least one file. */
    warmBudgetMs?: number;
    /** Hard budget for a client's very first file (spawn + init + indexing). */
    firstBudgetMs?: number;
    /** Maximum number of per-file latest outcomes retained. */
    snapshotLimit?: number;
}
export type LspOutcomeKind = "diagnostics" | "clean" | "low_confidence" | "timeout" | "unsupported" | "unavailable" | "server_failed";
interface LspOutcomeBase {
    kind: LspOutcomeKind;
    filePath: string;
    updatedAt: number;
}
export type LspDiagnosticOutcome = (LspOutcomeBase & {
    kind: "diagnostics";
    diagnostics: LspDiagnostic[];
    formatted: string;
}) | (LspOutcomeBase & {
    kind: Exclude<LspOutcomeKind, "diagnostics">;
});
/**
 * Lazily spawns and pools language servers keyed by (serverId, projectRoot).
 * The detailed outcome path preserves confidence and failure evidence while the
 * compatibility wrapper keeps edit/write output byte-identical on degradation.
 */
export declare class LspManager {
    private readonly cwd;
    private readonly catalog;
    private readonly warmBudgetMs;
    private readonly firstBudgetMs;
    private readonly snapshotLimit;
    /** (serverId\0root) → in-flight or settled client resolution. */
    private readonly clients;
    /** Keys that have completed at least one diagnostics pass (warm). */
    private readonly warmKeys;
    private readonly latestOutcomes;
    private shutDown;
    constructor(cwd: string, options?: LspManagerOptions);
    /**
     * Compatibility surface used by edit/write tools. Diagnostics remain visible;
     * every clean/degraded outcome remains the exact historical empty string.
     */
    diagnosticsAfterWrite(filePath: string, content: string): Promise<string>;
    /** Collect diagnostics with explicit confidence/failure evidence. */
    diagnosticsAfterWriteDetailed(filePath: string, content: string): Promise<LspDiagnosticOutcome>;
    /** Latest bounded evidence for one normalized absolute/relative file path. */
    getLatestOutcome(filePath: string): LspDiagnosticOutcome | undefined;
    /** Newest retained per-file evidence snapshots. */
    getLatestOutcomes(): LspDiagnosticOutcome[];
    /** Shut down every pooled server. Safe in process exit handlers. */
    shutdownAll(): void;
    private outcome;
    private record;
    private collect;
    private ensureClient;
}
export {};
//# sourceMappingURL=manager.d.ts.map