/** * Tracks consecutive edit/write failures per file path so the session can escalate * from "retry the edit" to "re-read the region" instead of letting the model retry blind. */ import type { ImageContent, TextContent } from "@elyracode/ai"; export declare class EditFailureTracker { private readonly threshold; private readonly _counts; constructor(threshold?: number); /** Record an edit outcome for a path. Returns the consecutive failure count for that path after this call. */ record(path: string, failed: boolean): number; /** Consecutive failures for a path (0 if none). */ count(path: string): number; /** Whether the consecutive failure count for a path has reached the escalation threshold. */ shouldEscalate(path: string): boolean; reset(path?: string): void; } export declare function buildEscalationHint(path: string, failures: number, hasReadTool: boolean): string; /** Extract the file path from edit/write tool arguments (`path` or legacy `file_path`). */ export declare function getEditTargetPath(args: unknown): string | undefined; /** Append text to the last text block of a tool result, creating one if there is none. Returns a new array. */ export declare function appendTextToContent(content: (TextContent | ImageContent)[], text: string): (TextContent | ImageContent)[]; //# sourceMappingURL=edit-failure-tracker.d.ts.map