/**
 * Single-consumer queue with backpressure: once `capacity` values wait, the producer awaits `writable()` before it
 * reads more from its source, so a long streamed tool call never overflows it (senpi#2822).
 */
export declare const SESSION_STREAM_QUEUE_CAPACITY = 256;
export declare class BoundedAsyncQueue<T> implements AsyncIterableIterator<T> {
    private readonly capacity;
    private readonly values;
    private reader;
    private writers;
    private closed;
    private failed;
    private failure;
    constructor(capacity: number);
    [Symbol.asyncIterator](): AsyncIterableIterator<T>;
    next(): Promise<IteratorResult<T>>;
    push(value: T): void;
    /** Resolves once there is room for more values, or once the queue has ended. */
    writable(): Promise<void>;
    private releaseWriters;
    close(): void;
    fail(error: unknown): void;
}
//# sourceMappingURL=bounded-queue.d.ts.map