import type { CodeIntelligence } from '../../intelligence/index.js'; /** A single error-level diagnostic for a touched file. */ export interface PostEditDiagnostic { readonly severity: 'error'; /** 1-based line. */ readonly line: number; /** 0-based column. */ readonly column: number; readonly message: string; } /** A diagnostic tagged with the file it belongs to (output-level shape). */ export interface PostEditFileDiagnostic extends PostEditDiagnostic { readonly file: string; } /** * A source of cheap, in-process, error-level diagnostics for a single file. * Implementations MUST NOT spawn processes and MUST never throw, return [] on * any failure or when they cannot produce diagnostics (honest absence). */ export interface DiagnosticsProvider { readonly name: string; /** True when this provider can produce diagnostics for the file's type. */ supports(filePath: string): boolean; /** Collect error-level diagnostics for one file's content. */ collect(filePath: string, content: string): Promise; } /** * Syntax-level TypeScript/JavaScript diagnostics from the in-process tree-sitter * parser. Cheap and never spawns a process; surfaces parse errors (unbalanced * braces, broken syntax), NOT type errors. Only runs when a TS/JS project * context (tsconfig.json / jsconfig.json) is detectable; otherwise returns [] * (honest absence rather than a fabricated "no errors"). */ export declare class TypeScriptSyntaxDiagnosticsProvider implements DiagnosticsProvider { readonly name = "typescript-syntax"; private readonly intel; private initPromise; constructor(intel?: CodeIntelligence); supports(filePath: string): boolean; collect(filePath: string, content: string): Promise; } /** * Render diagnostics as a compact human-readable block for tools whose output * is not pure JSON (e.g. the edit tool, which already appends text suffixes). * Returns '' for an empty list so callers can append unconditionally. */ export declare function formatDiagnosticsBlock(diagnostics: readonly PostEditFileDiagnostic[]): string; /** * Run a provider across several just-written files, tagging each diagnostic with * its file and capping the total count. Returns [] when no provider is wired. */ export declare function collectPostEditDiagnostics(provider: DiagnosticsProvider | undefined, files: ReadonlyArray<{ readonly path: string; readonly content: string; }>, cap?: number): Promise; //# sourceMappingURL=post-edit-diagnostics.d.ts.map