import { type ProviderRetryClass } from '../providers/provider-retry.js'; import type { AgentRuntime, AgentRuntimeInput, AgentRuntimeResult } from '../providers/contract.js'; import { type ProviderSessionCorruptionError } from '../providers/session-corruption.js'; export declare const PROVIDER_TRANSIENT_MAX_RETRIES = 3; /** Backoff before transient retry n (1-based); provider outages rarely clear in under seconds. */ export declare const PROVIDER_TRANSIENT_RETRY_BACKOFF_MS: readonly number[]; /** * Raised by {@link runProviderWithCrashRetries} when the provider is rate * limited: the item should be deferred (not failed) until `resumeAt`. */ export declare class ProviderRateLimitedError extends Error { readonly cause: unknown; readonly resumeAt: Date; constructor(cause: unknown, resumeAt: Date); } export declare function isProviderRateLimitedError(error: unknown): error is ProviderRateLimitedError; export interface RecordedProviderFailure { error: unknown; retryAttempts: number; retryClass: ProviderRetryClass; } export interface ProviderRetryOptions { /** Test seam: override the transient retry backoff schedule. */ transientBackoffMs?: readonly number[]; } export declare function runProviderWithCrashRetries(input: { agentId: string; agentRuntime: AgentRuntime; buildInput: (retryNotice?: string) => Promise; itemId?: string; onFinalFailureRecorded?: (failure: RecordedProviderFailure) => void; recoverCorruptSession?: (error: ProviderSessionCorruptionError) => Promise; retry?: ProviderRetryOptions; signal: AbortSignal; }): Promise; export declare function recordFinalRuntimeFailure(input: { agentId: string; agentRuntime: AgentRuntime; error: unknown; itemId?: string; providerFailure?: boolean; retryAttempts: number; retryClass?: ProviderRetryClass; }): Promise; //# sourceMappingURL=provider-runner.d.ts.map