/** Normalize cancellation reasons to an AbortError for the provider failure classifier. */ declare function abortError(reason: unknown): Error; /** * Stop waiting when the signal aborts without cancelling the underlying operation. * Remove the listener when either the operation or cancellation settles the wait. */ export declare function waitForAbortable(operation: Promise, abortSignal: AbortSignal | undefined): Promise; export interface SessionDispatchQueue { /** Schedule a turn after this session's previous turn; other sessions remain independent. */ run(sessionId: string, abortSignal: AbortSignal | undefined, operation: () => Promise): Promise; /** Forget queue bookkeeping during shutdown; this does not cancel scheduled operations. */ clear(): void; } /** * Serialize turns per session, retaining the queue slot until the operation settles. * Aborting a caller's wait must not let the next turn overtake a still-running operation. */ export declare function createSessionDispatchQueue(): SessionDispatchQueue; export { abortError }; //# sourceMappingURL=session-dispatch.d.ts.map