import type { TerminalOutputEvent } from "@tangle-network/agent-interface"; import type { TerminalReplayWindow } from "@tangle-network/agent-interface"; /** * Ordered terminal frames with a replay cursor. * * Every frame takes a monotonic ordinal, and an `output` frame also takes a * monotonic `seq` that a consumer replays from. `since` is EXCLUSIVE: it names * the last sequence the consumer processed, so a reconnect resumes with * neither loss nor duplication. A cursor whose successor frames were evicted is * refused, because silently resuming after the gap would drop terminal output * the consumer believes it received. * * The buffer is bounded, so the accepted cursors move as frames are evicted. * {@link cursors} states the window they moved to: `earliest` is the oldest * cursor `read` accepts and delivers every retained frame from, and `latest` is * the newest output frame. A read with no cursor starts at `earliest`, so a * consumer that holds none is never locked out. A consumer that names an * evicted cursor is refused and told which cursor to resume from, because it * believes it received the frames the gap would silently drop. */ export declare class TerminalFrameLog { private entries; private lastOrdinal; private outputSeq; private evictedOrdinal; private evictedOutputSeq; private ended; private waiters; append(event: TerminalOutputEvent): void; /** Append decoded PTY text, split so no frame exceeds the contract bound. */ appendOutput(text: string): void; /** No more frames will arrive; readers drain what is retained and return. */ end(): void; /** * The cursors this buffer can serve. Reading from `earliest` yields every * retained frame and loses no output, because eviction drops output frames in * sequence order and `earliest` names the newest one that was dropped. */ get cursors(): TerminalReplayWindow; read(since: number | undefined, signal?: AbortSignal): AsyncIterable; private ordinalForCursor; private waitForFrames; private wake; }