export interface AbortSourceTracker { requestAbortController: AbortController; requestSignal: AbortSignal; abortLocally(reason: Error): Error; getLocalAbortReason(): Error | undefined; wasCallerAbort(): boolean; } /** * Tracks whether a merged request signal was aborted by the caller or by provider-local logic. * * Caller aborts always take priority. When both the caller and a local watchdog fire near * each other, the merged `requestSignal.reason` reflects whichever AbortController called * `.abort()` first — but ordering is racy and not meaningful for upstream consumers. What * matters is intent: if the caller's signal aborted, the request was cancelled by the * caller, and any local watchdog reason is incidental and **MUST NOT** be surfaced as a * retryable transient error (which would cause auto-retry to re-enter streaming and leave * the UI showing a spinner the user already tried to cancel). */ export declare function createAbortSourceTracker(callerSignal?: AbortSignal): AbortSourceTracker; /** * Race a shared promise against a caller's AbortSignal without coupling the * underlying work to that signal. The shared promise keeps running (and caches * its result) even when an individual caller bails out. */ export declare function raceWithSignal(promise: Promise, signal: AbortSignal | undefined): Promise;