/** * Generic, pure, unit-testable bounded-parallel pipeline runner. * * Runs `worker` over `items` with at most `concurrency` in flight at once. * Results are returned in input order regardless of completion order. A * worker may throw {@link RateLimitSignal} to back off and retry: the affected * item sleeps (per-item, via the injected `sleep`) then retries, bounded by a * retry cap; other in-flight workers are NOT paused. Any other thrown error * propagates and fails the whole run. * * Zero claude/network dependency: callers inject `sleep` for deterministic * tests (no real timers, no `Math.random`). */ /** Thrown by a worker to back off (sleep) and retry the current item. */ export declare class RateLimitSignal extends Error { } export interface RunPipelineOptions { readonly items: readonly T[]; /** Max number of workers in flight at once. Must be >= 1. */ readonly concurrency: number; readonly worker: (item: T, index: number) => Promise; /** ms to wait before retrying, given the 1-based retry attempt number. * Default: exponential backoff, min(60_000, 1000 * 2^(attempt-1)). */ readonly onRateLimit?: (attempt: number) => number; /** Injectable for tests; defaults to a real `setTimeout`-based sleep. */ readonly sleep?: (ms: number) => Promise; } export declare function runPipeline(o: RunPipelineOptions): Promise; //# sourceMappingURL=pipeline.d.ts.map