/** * Shared async safety helpers: phase timeout racing with caller aborts. * Extracted from src/evaluate.ts so src/complete.ts can share the mechanism * without a cyclic import (evaluate.ts already imports complete.ts). * @module dsh-continual-harness */ /** Marker error for a phase that exceeded its timeout budget. */ export declare class PhaseTimeoutError extends Error { name: string; } /** Marker error for a phase cancelled by the caller's abort signal. */ export declare class PhaseAbortError extends Error { name: string; } /** * Relay a caller's abort into an internal per-call controller, so cancelling * the caller cancels the underlying work. Returns a cleanup fn that removes * the forward listener — call it when the guarded work settles; the caller's * signal usually outlives the call and would otherwise accumulate listeners. */ export declare function bridgeAbortSignal(from: AbortSignal, controller: AbortController): () => void; /** Race a promise against a per-phase timeout and the caller's abort signal. * When the timeout wins, `onTimeout` (if given) fires first so the caller can * cancel the underlying work before the rejection is observed. */ export declare function raceWithTimeout(promise: Promise, timeoutMs: number, signal: AbortSignal | undefined, onTimeout?: () => void): Promise; //# sourceMappingURL=async-safe.d.ts.map