/**
 * Exponential-backoff scheduler for abuse-signal responses.
 *
 * Proton does not publish explicit IMAP/SMTP rate-limit headers, but the
 * Bridge surfaces throttling through standard protocol-level codes:
 *
 *   - SMTP 421 — service not available / temporarily throttled
 *   - SMTP 454 — temporary authentication failure (often anti-abuse)
 *   - SMTP 450 — mailbox temporarily unavailable
 *   - IMAP BYE [ALERT] — server-initiated disconnect (Bridge human-verification path)
 *
 * This module translates those signals into a small amount of
 * well-behaved client-side backoff so the agentic workload does not
 * hammer Bridge / Proton and trip account-level blocks.
 */
/**
 * Classify an arbitrary error from a send/connect path as a transient
 * abuse-adjacent signal worth backing off on (vs. a terminal failure).
 *
 * Matches SMTP 4xx codes (421, 450, 454) and common Bridge/Proton throttle
 * keywords. Conservative — non-matching errors are treated as terminal.
 */
export declare function isTransientAbuseError(err: unknown): boolean;
/**
 * Tracks consecutive failure attempts and emits a delay-until timestamp
 * with exponential growth + small jitter. Callers record each attempt's
 * outcome with {@link record} and ask {@link delayUntilMs} whether a
 * pending attempt should wait.
 */
export declare class BackoffTracker {
    private readonly baseDelayMs;
    private readonly maxDelayMs;
    private readonly now;
    private readonly jitter;
    /** Number of consecutive abuse-signal failures observed. Reset on success. */
    private failures;
    /** Absolute ms timestamp before which no attempt should be made. */
    private blockedUntil;
    constructor(baseDelayMs?: number, maxDelayMs?: number, now?: () => number, jitter?: () => number);
    /**
     * Record the outcome of an attempt.
     *
     * - `"success"` — clears the backoff state.
     * - `"abuse"` — increments the failure counter and schedules the next
     *               allowed attempt with exponential growth + jitter.
     * - `"terminal"` — does not change the backoff state (leave untouched so
     *                  a permanent auth failure doesn't masquerade as throttling).
     */
    record(outcome: "success" | "abuse" | "terminal"): void;
    /** Whether the tracker is currently holding back new attempts. */
    isBlocked(): boolean;
    /** Milliseconds remaining on the current backoff window (0 if not blocked). */
    delayUntilMs(): number;
    /** Current consecutive-failure count (0 after a successful attempt). */
    get failureCount(): number;
    /** Absolute ms timestamp of the current backoff deadline (0 if unblocked). */
    get blockedUntilMs(): number;
    /** Force-clear all state. Use when the user manually retries. */
    reset(): void;
}
//# sourceMappingURL=backoff.d.ts.map