/** * @license * Copyright 2026 Qwen * SPDX-License-Identifier: Apache-2.0 */ /** * Bounded single-consumer push queue backing an adaptor's event stream. * * The orchestrator's pump is the sole consumer and may drop and * resubscribe (backoff); a new subscribe takes the queue over and ends * the previous iterator — events buffered between subscriptions are * retained, so a resubscribing pump can never lose a turn_complete. * * Overflow policy: drop the oldest `progress` events first (they are * advisory), else the oldest event, and count the drops so tests can * pin the behavior. */ export interface AsyncEventQueueOptions { capacity?: number; onDrop?: (dropped: number) => void; } export declare class AsyncEventQueue { private readonly capacity; private readonly onDrop?; private buffered; private waiters; private ended; constructor(options?: AsyncEventQueueOptions); push(item: T): void; end(): void; subscribe(options?: { signal?: AbortSignal; }): AsyncIterable; get size(): number; private evictOne; private abortedIterable; }