/** The failure classes tracked, keyed per model. */ export type ToolFormatFailureClass = 'edit_not_found' | 'edit_ambiguous' | 'edit_conflict' | 'edit_failed' | 'edit_fallback_whitespace' | 'edit_fallback_fuzzy' | 'exec_expectation_exit_code' | 'exec_expectation_stdout_contains' | 'exec_expectation_stderr_contains'; /** A tool result, in the shape both tool-execution loops already hold. */ export interface ToolFormatResultLike { readonly callId?: string | undefined; readonly success: boolean; readonly output?: string | undefined; readonly error?: string | undefined; readonly warnings?: readonly string[] | undefined; } /** A tool call, in the shape both tool-execution loops already hold. */ export interface ToolFormatCallLike { readonly id: string; readonly name: string; } /** * Classify a single tool outcome into zero or more failure classes. Edit * failures map through the sanctioned `classifyEditFailure`; a successful edit * that used a lenient fallback is classified from its warning. Exec is recorded * ONLY for declared-expectation misses (an ordinary non-zero exit is not a * format regression), one class per violated expectation. */ export declare function classifyToolFormatOutcome(toolName: string, result: ToolFormatResultLike): ToolFormatFailureClass[]; /** * Process-wide recorder of per-model tool-format failure counts. A singleton, * mirroring `platformMeter`: fed at the tool-execution call sites (which know * the active model) and read by `snapshotMetrics()`. */ export declare class ToolFormatTelemetry { private readonly counts; /** Record one occurrence of a failure class for a model. */ record(model: string, failureClass: ToolFormatFailureClass): void; /** * Classify and record a batch of tool results for the given model. Results are * matched to calls by callId (falling back to positional order when a result * carries no callId). Only edit/exec outcomes produce counts. */ observeToolResults(model: string, calls: readonly ToolFormatCallLike[], results: readonly ToolFormatResultLike[]): void; /** * A stable, JSON-serialisable snapshot: `{ [modelId]: { [failureClass]: count } }` * plus a flat `total` per class. Empty when nothing has been recorded. */ snapshot(): { readonly byModel: Record>; readonly byClass: Record; }; /** Clear all counts (test isolation). */ reset(): void; } /** Singleton recorder for the platform (mirrors `platformMeter`). */ export declare const toolFormatTelemetry: ToolFormatTelemetry; //# sourceMappingURL=tool-format-telemetry.d.ts.map