import type { SimulationFunction } from '../types.js'; export type FaultKind = 'rate_limit' | 'transient' | 'auth_expiry' | 'auth_hard_fail' | 'malformed_page' | 'oversized_page' | 'disconnect' | 'checkpoint_regression'; export interface FaultSpec { kind: FaultKind; /** Apply on this 1-based successful-dispatch attempt count for the session. */ atAttempt?: number; /** Apply on this endpoint id only (optional). */ endpointId?: string; /** Extra options per kind. */ options?: { retryAfterSec?: number; status?: number; /** For oversized_page: max items / bytes to claim exceeded. */ maxItems?: number; maxBytes?: number; /** For checkpoint_regression: older cursor/watermark to return. */ olderCursor?: string; olderWatermark?: string; /** For disconnect: after which page index (0-based). */ afterPage?: number; }; } export interface FaultSchedule { faults: FaultSpec[]; } export interface FaultScheduler { /** Imperatively queue a fault for the next matching dispatch. */ injectFault(spec: FaultSpec): void; /** Peek whether a disconnect should fire for this page. */ shouldDisconnect(pageIndex: number): boolean; /** Wrap a simulation handler so scheduled faults fire first. */ wrap>(handler: SimulationFunction): SimulationFunction; /** Reset attempt counters and clear injected one-shots; restore schedule from seed. */ reset(): void; getAttemptCount(): number; } export declare const createFaultScheduler: (schedule: FaultSchedule | undefined, seed: number) => FaultScheduler; //# sourceMappingURL=faults.d.ts.map