import type { InputSchema } from "./mcp/mcp.js"; export declare class MessageBuffer { private size; private items; private writePos; private head; private readers; private filenameCache; constructor(size?: number); /** * Binary search for an event by its envelope ID (UUIDv7). * Returns the position of the event, or -1 if not found. * Takes advantage of UUIDv7's time-ordered property. */ private binarySearchEventId; put(item: T): void; subscribe(callback: (item: T) => void, lastEventId?: string): string; unsubscribe(readerId: string): void; stream(readerId: string): void; /** * hard reset: drops items and resets cursors. */ clear(): void; /** * soft reset: clears buffered items but preserves subscribers * do not set head or writePos to `0` as subscribers retain their * readPos which would mess things up if we suddenly reset everything * to 0. */ reset(): void; read(filters?: ReadFilter): T[]; filterHandlers: Record, ctx: { filenameCache: Map>; }) => boolean>; } export type ReadFilter = InputSchema["filters"] | { envelopeId: string; } | { all: true; };