import type { SessionEvent, SessionEventToolOutputPreview } from "@opengeni/sdk"; /** * Exact reads of tool outputs a step page delivered as bounded previews. * * A turn's steps are read with `toolOutputs: "preview"`, so a large tool * output arrives as its head and tail with an `outputPreview` fact. When a * reader expands that row (or its renderer needs the exact output) the row's * exact output event is read once, by its sequence, and replaces the preview. */ export type ToolOutputReadState = "loading" | "error" | "loaded"; /** One row's exact-output read, as the timeline projection sees it. */ export type ToolOutputRead = { state: ToolOutputReadState | "preview"; load: () => void; }; export type ToolOutputReader = (eventId: string, sequence: number, turnId: string | null) => ToolOutputRead; /** The exact tool-output events of a page around one sequence. */ export type ToolOutputPageRead = (sequence: number) => Promise; /** Exact-output reads in flight at once; the rest wait their turn. */ export declare const TOOL_OUTPUT_READS_IN_FLIGHT = 4; /** The preview fact of a step-page tool output, or null for an exact one. */ export declare function toolOutputPreviewFact(payload: unknown): SessionEventToolOutputPreview | null; /** Whether a session event is a tool output delivered as a preview. */ export declare function isToolOutputPreviewEvent(event: SessionEvent): boolean; /** * Reads each requested row's exact output once, a few at a time. `read` * identifies the session: reads are forgotten when it changes. Exact outputs * are kept only for turns in `turns` (the turns whose steps are loaded). */ export declare function useToolOutputReads(read: ToolOutputPageRead, turns: ReadonlyMap): { /** Exact output events by event id. */ exact: ReadonlyMap; reader: ToolOutputReader; };