/** * runWithRetry โ€” the generic retry-with-backoff primitive the execution substrate * uses (north-star ยง5.8, release 2.13.0). * * Hoisted from fitness's `executeWithRetry` (the proven shape): retry ONLY on a * thrown error, never re-throw (return `lastError` instead), and skip retry for a * caller-named class of errors (fitness: an abort). The hardcoded * `CheckAbortedError` check becomes a `shouldNotRetry` predicate, and the fixed * backoff is configurable โ€” so fitness re-points to this with byte-identical * behaviour (default backoff `[1000, 2000]`, the same delays it used). * * Distinct from `withRetry` (`lib/retry.ts`), which is the network-oriented * throw-on-exhaustion retry for `--report-to`; this one returns an outcome and is * the per-unit execution retry. */ export interface PipelineRetryOptions { /** When false (or `maxRetries <= 0`), the function runs once with no retry. */ readonly enabled: boolean; readonly maxRetries: number; /** Errors for which retry is skipped entirely (e.g. an abort). Default: none. */ readonly shouldNotRetry?: (error: unknown) => boolean; /** Per-attempt backoff delays (ms). Default `[1000, 2000]` (last value repeats). */ readonly backoffMs?: readonly number[]; } /** Outcome of a retry-wrapped run. `result === undefined` โ‡” every attempt threw. */ export interface PipelineRetryOutcome { readonly result: T | undefined; readonly lastError: unknown; readonly retryCount: number; readonly wasRetried: boolean; } /** * Run `fn` with retry. Retries only on a thrown error (up to `maxRetries`), never * re-throws, and short-circuits for `shouldNotRetry` errors. Mirrors fitness's * former `executeWithRetry` exactly (same default backoff, same return shape). */ export declare function runWithRetry(fn: () => Promise, options: PipelineRetryOptions): Promise>; //# sourceMappingURL=retry.d.ts.map