import type { TurnMiddleware } from "./turn-middleware.js";
/**
 * 2.5-second backoff between the original attempt and the retry — same as
 * the production constant in unified-runner.ts. Exposed here so callers
 * (and tests) can pin the value.
 */
export declare const TRANSIENT_HTTP_RETRY_DELAY_MS = 2500;
export interface WithTransientHttpRetryOptions {
    /**
     * Override the wait-between-attempts. Defaults to 2.5 seconds — the
     * production value. Tests can pass `0` to skip the wait.
     */
    delayMs?: number;
    /**
     * Override the predicate that decides whether an error is transient.
     * Defaults to the production isTransientHttpError (matches 502/521 from
     * the underlying provider). Tests can supply a fake to assert the wiring.
     */
    isTransient?: (errorMessage: string) => boolean;
    /**
     * Notification fired AFTER a transient error and BEFORE the retry. Useful
     * for telemetry / "retrying..." log lines.
     */
    onRetry?: (info: {
        error: unknown;
        errorMessage: string;
    }) => void | Promise<void>;
}
/**
 * Middleware: when the inner runner throws a transient HTTP error AND
 * `params.retryOnTransientError` is set, wait `delayMs` and call the inner
 * runner once more. A second transient error (or any non-transient throw)
 * propagates as-is — no third attempt, no infinite loop.
 *
 * No-op when:
 *   - `params.retryOnTransientError` is not truthy
 *   - the thrown error is not transient
 *   - the inner runner returns successfully (the common case)
 */
export declare function withTransientHttpRetry(opts?: WithTransientHttpRetryOptions): TurnMiddleware;
