/** * Retry knobs for the internal OM transport-error retry wrapper. * Exported as a mutable object so tests can shrink the backoff schedule * without changing public API. * * With the defaults the per-retry pre-jitter backoff schedule is: * 1s, 2s, 4s, 8s, 16s, 32s, 64s, 120s (cap) * giving 8 retries / 9 total attempts and ~247s (~4 minutes) of waiting * before the final attempt fails. Designed to ride out short provider / * network blips without holding the actor turn for much longer than that. * * @internal */ export declare const RETRY_CONFIG: { /** Maximum number of retry *attempts* (total tries = maxRetries + 1). */ maxRetries: number; /** Initial backoff delay in milliseconds. */ initialDelayMs: number; /** Multiplier applied to the delay after each failed attempt. */ backoffFactor: number; /** Cap on per-attempt delay (ms). */ maxDelayMs: number; /** Random jitter as a fraction of the computed delay (e.g. 0.2 = ±20%). */ jitter: number; }; /** * Returns true when the given error looks like a transient transport-class * failure that's worth retrying — undici `terminated`, `fetch failed`, * `UND_ERR_*` codes, AI SDK `APICallError` with `isRetryable: true`, and * common HTTP 408/425/429/5xx statuses. Walks the `error.cause` chain so * wrapper errors don't hide the real failure. * * Never retries on user-initiated aborts. * * @internal */ export declare function isTransientLLMError(error: unknown): boolean; /** * Compute the backoff delay (ms) for the Nth retry (0-indexed). * * Exponential growth (`initialDelayMs * backoffFactor^attempt`) capped at * `maxDelayMs`, then nudged by ±`jitter` (fractional). Exported for unit * tests that lock the schedule against drift. * * @internal */ export declare function computeDelay(attempt: number): number; export interface WithRetryOptions { /** Short label used in debug logs (e.g. 'observer', 'reflector'). */ label: string; /** Optional abort signal — cancels both in-flight attempts and backoff waits. */ abortSignal?: AbortSignal; } /** * Run `fn` with retries on transient transport-class errors. * * Non-transient errors (auth, validation, schema, etc.) are rethrown * immediately. User-initiated aborts are rethrown without delay. * * @internal */ export declare function withRetry(fn: () => Promise, opts: WithRetryOptions): Promise; //# sourceMappingURL=retry.d.ts.map