import { z } from "zod"; export type FailureKind = "auth" | "usage_limit" | "rate_limit" | "budget" | "max_turns" | "not_found" | "timeout" | "crash" | "unknown"; export declare const FAILURE_KINDS: FailureKind[]; export declare const FailureKindSchema: z.ZodEnum<{ auth: "auth"; budget: "budget"; crash: "crash"; max_turns: "max_turns"; not_found: "not_found"; rate_limit: "rate_limit"; timeout: "timeout"; unknown: "unknown"; usage_limit: "usage_limit"; }>; export interface JobFailure { kind: FailureKind; /** The runner's own code when it has one (Claude's result `subtype`). */ code?: string; /** Whether trying again soon could succeed (a rate limit, a crash); an account problem is not. */ retryable: boolean; /** The first line of the error, for people. */ message?: string; } /** When a `fallback:` runner takes over: before the run (`not_ready`) or after a run failed that way before the agent produced anything. */ export type FallbackTrigger = "not_ready" | "auth" | "usage_limit" | "rate_limit" | "crash"; export declare const FALLBACK_TRIGGERS: FallbackTrigger[]; export declare const FallbackSchema: z.ZodObject<{ runners: z.ZodArray, z.ZodObject<{ runner: z.ZodEnum<{ claude: "claude"; codex: "codex"; shell: "shell"; }>; model: z.ZodOptional; effort: z.ZodOptional; account: z.ZodOptional; }, z.core.$strict>]>>; on: z.ZodOptional>>; }, z.core.$strict>; export type FallbackConfig = z.infer; export declare const RetrySchema: z.ZodObject<{ attempts: z.ZodNumber; on: z.ZodOptional>>; backoff_seconds: z.ZodOptional; }, z.core.$strict>; export type RetryConfig = z.infer; export interface ClassifyInput { status: "failed" | "timed_out"; error?: string; exitCode: number | null; signal: string | null; /** Claude's result event, when one was seen. */ resultEvent?: Record; /** The process could not be started at all. */ spawnFailed?: boolean; /** The last lines of stderr, when the error text says nothing. */ stderr?: string; /** The runner reported the failure itself (Claude's result event, Codex's error event) rather than just dying. */ reported?: boolean; } export declare function classifyFailure(input: ClassifyInput): JobFailure;