/** * design/121 — LSP diagnostics registry + model-facing formatting (CC 2.1.198 parity). * * CC's two diagnostics sources (IDE MCP baseline/diff + passive LSP publishDiagnostics) collapse to * ONE in sema: the passive registry. The "only NEW diagnostics" semantics CC gets from per-file * baselines falls out of the delivered-set here — a diagnostic is injected at most once, and editing * a file clears its delivered set so a persisting problem can resurface (CC `Fjn` same behavior). * * Volumes and wire format are CC-exact (198:320661 `Njn=10, nqa=30`; 198:320480-320505 summary + * 4000-char cap; severity symbols ✖/⚠/ℹ/★). * * NOT durable: diagnostics regenerate from the language server on the next edit; a suspend/resume * simply starts empty (recorded in design/121 §2). */ /** One LSP diagnostic, the subset the model/shell needs (LSP `Diagnostic` narrowed). */ export interface LspDiagnostic { message: string; /** LSP severity: 1=Error 2=Warning 3=Information 4=Hint. Absent = unknown (sorted last). */ severity?: number; range?: { start: { line: number; character: number; }; end?: { line: number; character: number; }; }; code?: string | number; source?: string; } /** One file's new diagnostics, as drained for injection + the wire frame. */ export interface LspFileDiagnostics { uri: string; diagnostics: LspDiagnostic[]; } /** * Per-run pending/delivered registry. `publish` is called by an LSP session's publishDiagnostics * subscription (whole-file replacement semantics, per the LSP spec); `drain` is called at the turn * boundary and returns only diagnostics not yet delivered, sorted and volume-capped. */ export declare class LspDiagnosticsRegistry { /** uri → the LAST published full diagnostic set for that file (LSP replace semantics). */ private readonly pending; /** Keys already injected once — cleared per file when the agent edits it (may resurface). */ private readonly delivered; /** Record a `textDocument/publishDiagnostics` payload (already version-checked by the session). */ publish(uri: string, diagnostics: LspDiagnostic[]): void; /** The agent edited `uri` — its delivered set resets so a still-present problem can resurface * against the NEW text (CC clears per-file delivered on edit, 198 `Fjn`). */ fileEdited(uri: string): void; /** True when a drain would produce nothing (cheap pre-check for the turn-boundary hook). */ isEmpty(): boolean; /** * Take the NEW (never-delivered) diagnostics: sorted Error>Warning>Info>Hint within each file, * capped at {@link MAX_PER_FILE}/{@link MAX_TOTAL}, marked delivered. Pending is consumed (a file * with only already-delivered diagnostics simply drops out until its server publishes again or the * file is edited). */ drain(): LspFileDiagnostics[]; } /** * CC 198 `formatDiagnosticsSummary` (198:320480-320499), verbatim shape: * ``` * {basename}: * {symbol} [Line {line+1}:{col+1}] {message}[ [{code}]][ ({source})] * ``` * capped at 4000 chars with an honest `…[truncated]` tail. */ export declare function formatDiagnosticsSummary(files: LspFileDiagnostics[]): string; /** CC 198 model-facing injection block (198:320500-320503), verbatim framing. */ export declare function formatDiagnosticsBlock(files: LspFileDiagnostics[]): string; //# sourceMappingURL=lsp-diagnostics.d.ts.map