import type { MessageStreamEvent } from "#protocol/message.js"; /** Options for {@link streamSessionEvents}. */ export interface SessionEventStreamOptions { /** * Zero-based index of the first event to read. Negative values count back * from the durable tail (`-1` is the latest event). Defaults to `0`. */ readonly startIndex?: number; /** * Whether to keep following events recorded after the read opens. When * `false`, the read ends at the durable tail observed when it opens. * Defaults to `true`. */ readonly follow?: boolean; /** Stops the read and releases the underlying stream reader. */ readonly signal?: AbortSignal; } /** * Reads one session's durable event stream. Negative `startIndex` values count * back from the tail. */ export declare function readSessionEventStream(sessionId: string, startIndex?: number): ReadableStream; /** * Reads one session's recorded events up to the durable tail observed when * the read opens, then ends. Negative `startIndex` values count back from * that tail. */ export declare function readSessionEventHistory(sessionId: string, startIndex?: number): ReadableStream; /** Returns the index of the last durably recorded event, or `-1` before the first. */ export declare function readSessionStreamTailIndex(sessionId: string): Promise; /** * Iterates one session's durable events in process, without the HTTP stream * route. * * A bounded read counts events up from `startIndex` to find the tail. That * holds because the writer persists exactly one chunk per event (see * `createOrderedStreamEmitter`). */ export declare function streamSessionEvents(sessionId: string, options?: SessionEventStreamOptions): AsyncGenerator;