/** * Retry pacing and failure policy for a Task. * * Ports three Python behaviours that live in the loop that *runs* tasks, not * in `Task.__init__`: * * - `retry_delay` — `praisonaiagents/agents/agents.py` waits * `min(retry_delay * 2 ** attempt, max_retry_delay)` seconds between * attempts, so the delay is exponential and capped at five minutes. * - `skip_on_failure` / `on_error` — `Agents._should_continue_on_dep_failure` * lets a task run in degraded mode when an upstream dependency failed * instead of being force-failed with it. * - `rerun` — whether an already-completed task is executed again when the * workflow reaches it a second time (`TaskExecutionConfig.rerun`). */ import type { Task } from '../types'; /** Python `max_retry_delay`: the five-minute cap on exponential backoff. */ export declare const MAX_RETRY_DELAY_SECONDS = 300; /** The fields the retry policy reads; a plain object works as well as a Task. */ export type RetryPolicyLike = Pick & { maxRetryDelay?: number; }; /** * Seconds to wait before retry number `attempt` (0-based), following Python's * `min(delay * (2 ** retries), max_delay)`. A task with `retryDelay: 0` (the * default) never waits, which is what makes the option observable. */ export declare function retryDelaySeconds(task: RetryPolicyLike, attempt: number): number; /** Sleep helper; `timer` is injectable so tests never wait on a real clock. */ export declare function sleepSeconds(seconds: number, timer?: (fn: () => void, ms: number) => unknown): Promise; /** * Python `Agents._should_continue_on_dep_failure`: true when the task opted * into graceful degradation, so an upstream failure does not force-fail it. */ export declare function continuesOnDependencyFailure(task: RetryPolicyLike): boolean; /** * Whether the runner should execute this task now. A task that already * completed is skipped unless `rerun` was requested * (Python `TaskExecutionConfig.rerun`). */ export declare function needsRun(task: RetryPolicyLike): boolean;