export declare class StructuredOutputDeadlineError extends Error { constructor(timeoutMs: number, attempts: string); } /** The failure for an aborted decision: the deadline error when the deadline fired, otherwise a plain cancellation. */ export declare function abortFailure(signal: AbortSignal): Error; export declare function validateTimeoutOverride(value: number | undefined): void; /** * The wall-clock limit for one decision: an explicit `timeoutMs`, else the session's `httpIdleTimeoutMs`, else that * setting's default. Like the provider clients, an idle timeout of `0` (disabled) becomes the largest timer delay. */ export declare function resolveDecisionDeadlineMs(timeoutMs: number | undefined, httpIdleTimeoutMs?: number): number; /** One model request, from send to response; transport retries and their waits are not part of it. Records only the stop reason and timing, never content. */ export declare class DecisionAttempt { readonly startedAt: number; endedAt: number | undefined; stopReason: string | undefined; settle(stopReason?: string): void; describe(now: number): string; } /** How every generation of one decision ended and how long it took, across repairs, retries and candidates. */ export declare class DecisionTrace { private readonly attempts; get size(): number; begin(): DecisionAttempt; /** Mark every generation still in flight as ended without a response. */ settleOpen(): void; /** The attempts from `first` onward, numbered from 1, or an empty string when there are none. */ describe(first?: number): string; } export interface DecisionRun { readonly signal: AbortSignal; readonly trace: DecisionTrace; } /** * Run a whole decision under one wall-clock limit. `run` receives a signal that aborts with the caller's reason when * the caller aborts and with a {@link StructuredOutputDeadlineError} when the limit passes, so the existing abort * plumbing cancels the in-flight generation. The timer is always released. */ export declare function withinDecisionDeadline(callerSignal: AbortSignal | undefined, timeoutMs: number, run: (decision: DecisionRun) => Promise): Promise; //# sourceMappingURL=deadline.d.ts.map