import type { AnalysisDiagnostic, LoadedGraph } from "@telorun/analyzer"; import { type RuntimeDiagnostic } from "@telorun/kernel"; /** One diagnostic as `-o json` reports it. The shape is the machine contract * that replaces parsing the prose form: `code` is what a caller branches on, * and the location is pre-resolved because deriving it needs the loaded graph, * which the consumer does not have. */ export interface JsonDiagnostic { file: string; line: number; column: number; severity: "error" | "warning"; code?: string; message: string; /** `/` of the resource the diagnostic is pinned to. */ resource?: string; /** Dotted path of the offending value within that resource. */ path?: string; /** A mechanically applicable repair: the whole corrected value at `path`. * Present only when the repair is decidable, so a consumer can apply it * without re-deriving it from the message. */ fix?: { replacement: string; }; } /** The logger's colouring delegates to `Output`'s per-stream palettes. * * Its methods paint text destined for STDOUT; `log.err` is the same palette * bound to stderr. Which one a caller wants is decided by where it writes, not * by the process — `formatDiagnostics` writes to stderr and `check`'s summary * to stdout, and one shared decision was wrong for whichever stream was * redirected. Under `-o json` both palettes are plain, so structured output * cannot carry escapes. */ export declare function createLogger(verbose: boolean): { info: (...args: any[]) => void; ok: (text: string) => string; warn: (text: string) => string; error: (text: string) => string; dim: (text: string) => string; /** Palette for text written to stderr. */ err: import("./output.js").Palette; verbose: boolean; }; export type Logger = ReturnType; /** * Render runtime diagnostics. Entries the kernel classified as `derived` (they * failed only because a dependency did) collapse into one line per blocked * chain — a ten-resource chain is one real error and nine shadows of it, and * printing them flat buries the only line a reader can act on. `--verbose` * prints every entry in full. * * An entry the kernel raised from static analysis carries `origin`; given the * loaded graph it renders with the same `file:line:col` prefix `telo check` * prints, so a manifest error points at its line whichever command surfaced it. */ export declare function formatDiagnostics(diagnostics: RuntimeDiagnostic[], log: Logger, displayPath: string, graph?: LoadedGraph): void; /** Format analysis diagnostics with file:line:col locations resolved via * the canonical `LoadedGraph` — no need to thread positionIndex through * manifest metadata. */ export declare function formatAnalysisDiagnostics(diagnostics: AnalysisDiagnostic[], graph: LoadedGraph, log: Logger, entryPath: string): { errorCount: number; warnCount: number; diagnostics: JsonDiagnostic[]; }; //# sourceMappingURL=logger.d.ts.map