/** Structured field difference between example_cause and example_fix */ export interface RepairAction { /** Top-level key that differs */ field: string; /** What kind of change is needed */ action: "change" | "add" | "remove"; } /** Result when the error type is found in the catalog */ export interface ExplainResultFound { found: true; /** The error discriminator string */ errorType: string; /** Pipeline stage that produces this error */ pipelineStage: string; /** All fields present on this error type */ fields: { name: string; type: string; }[]; /** Minimal AST that triggers this error */ exampleCause: Record; /** The corrected AST that fixes the error */ exampleFix: Record; /** Structured repair actions derived from cause→fix diff */ repairStrategy: RepairAction[]; } /** Result when the error type is not found */ export interface ExplainResultNotFound { found: false; /** Why lookup failed */ reason: "missing_discriminator" | "unknown_error_type"; /** The error type that was looked up (only for unknown_error_type) */ errorType?: string; } export type ExplainResult = ExplainResultFound | ExplainResultNotFound; /** * Given a structured error object, return enriched repair context derived * from the error catalog. The error must have an `error` field (the * discriminator string) to be looked up. * * @param error - A structured error with an `error` discriminator field * @returns Repair context including pipeline stage, example cause/fix, and repair strategy — or a `found: false` result if lookup fails */ export declare function explainError(error: Record): ExplainResult; //# sourceMappingURL=explain.d.ts.map