/** A buffered event carries a per-session monotonic `seq` (assigned at
 *  broadcast time) and a wall-clock `ts` so the client can dedupe by seq and
 *  order by seq across a reconnect gap. See docs/design/streaming-dedup-reorder.md. */
export interface BufferedEvent {
    seq: number;
    ts: number;
    event: unknown;
}
/** Circular buffer of recent agent events for reconnection catch-up. */
export declare class EventBuffer {
    /** Floor sentinel reserved for snapshot ordering. All snapshot `_order`
     *  values are strictly less than every live `seq` (which starts at 1).
     *  See docs/design/unified-message-ordering-reducer.md §3.2. */
    static readonly SNAPSHOT_ORDER_FLOOR = -1000000000;
    private buffer;
    private maxSize;
    private nextSeq;
    constructor(maxSize?: number);
    /** Append an event, assigning it a monotonic `seq` and wall-clock `ts`.
     *  Returns the stored entry so callers can attach seq/ts to the broadcast. */
    push(event: unknown): BufferedEvent;
    /** Like push() but for non-`event` frames (e.g. `tool_permission_needed`)
     *  that need a seq for client ordering but do NOT need to be retained for
     *  reconnect resume — the client recovers them via the messages snapshot.
     *  Stamps a monotonic `seq` and wall-clock `ts` without touching the ring.
     *  See docs/design/unified-message-ordering-reducer.md §3.1. */
    pushFrame(): {
        seq: number;
        ts: number;
    };
    /** All buffered entries, oldest first. */
    getAll(): BufferedEvent[];
    /** Return entries whose `seq > fromSeq`, preserving buffer order. */
    since(fromSeq: number): BufferedEvent[];
    /** True if `fromSeq` falls inside the retained window (i.e. we still hold
     *  `fromSeq + 1`, or the buffer is empty meaning no events were missed). */
    canResumeFrom(fromSeq: number): boolean;
    clear(): void;
    /** Reseed the next-seq counter so a freshly constructed buffer continues
     *  the previous one's monotonic sequence space. Used by `_restartAgent`-class
     *  flows to preserve the client-side `_highestSeq` frame of reference across
     *  a server-side process respawn (clients do NOT disconnect during the
     *  restart, so their `_highestSeq` keeps the old high-water mark — if the
     *  new buffer started back at 1, every fresh event would be silently dropped
     *  by the client's `seq <= _highestSeq` dedup gate).
     *  See docs/design/restart-preserves-streaming-frame-of-reference.md. */
    seedNextSeq(seq: number): void;
    get size(): number;
    /** Highest seq assigned so far (0 if nothing has been pushed). */
    get lastSeq(): number;
}
//# sourceMappingURL=event-buffer.d.ts.map