export interface ToolFailureAlertConfig {
    /** Window size — last N samples per tool. Default 50. */
    windowSize?: number;
    /** Minimum samples before the alert can fire. Default 10. */
    minSamples?: number;
    /** Failure rate that triggers the alert (0–1). Default 0.30. */
    failureThreshold?: number;
    /** Cooldown after a fired alert. Default 5 minutes. */
    cooldownMs?: number;
    /** Optional clock source for tests. */
    now?: () => number;
}
export interface ToolFailureAlert {
    tool: string;
    failureRate: number;
    failureCount: number;
    totalCount: number;
    windowSize: number;
    threshold: number;
    firedAt: string;
}
export type ToolFailureAlertListener = (alert: ToolFailureAlert) => void;
/**
 * Build a failure-alert tracker. Returned object exposes `record(tool,
 * success)` for each tool call and `subscribe(listener)` for callers
 * that want to receive alerts.
 */
export declare function createToolFailureAlerts(config?: ToolFailureAlertConfig): {
    record: (tool: string, success: boolean) => ToolFailureAlert | null;
    subscribe: (listener: ToolFailureAlertListener) => () => void;
    status: () => Record<string, {
        samples: number;
        failureCount: number;
        failureRate: number;
        lastAlertAt: string | null;
    }>;
    reset: () => void;
};
export type ToolFailureAlertTracker = ReturnType<typeof createToolFailureAlerts>;
//# sourceMappingURL=toolFailureAlerts.d.ts.map