import { type Component, type TUI, type TuiMouseEvent } from "@earendil-works/pi-tui"; import type { AgentRecord } from "../types.js"; import type { Theme } from "./agent-widget.js"; import { type ConversationBlock } from "./conversation-blocks.js"; export interface TimelineRenderLine { text: string; plain: string; blockIndex: number; railable?: boolean; } export interface TimelineBlockSpan { /** Index into the snapshot's messageBlocks array, not the source block array. */ blockIndex: number; startLine: number; height: number; } export interface TimelineToolSpan extends TimelineBlockSpan { toolCallId: string; /** The only row that opens a collapsed card with a single click. */ clickStartLine?: number; clickHeight?: number; } export interface ConversationTimelineSnapshot { lines: TimelineRenderLine[]; messageStarts: number[]; messageBlocks: ConversationBlock[]; interactiveToolIds: string[]; blockSpans: TimelineBlockSpan[]; toolSpans: TimelineToolSpan[]; } export interface ConversationTimelineMouseResult { handled?: boolean; capture?: boolean; render?: boolean; focusedBlockIndex?: number; } export interface ConversationTimelineLineRange { startLine: number; height: number; } export interface ConversationTimelineChange { kind: "content" | "interaction"; /** Lines patched in-place for an interaction-only change such as hover. */ changedRanges?: readonly ConversationTimelineLineRange[]; } export interface ConversationTimelineOptions { cwd?: string; record?: AgentRecord; onChange?: (change: ConversationTimelineChange) => void; } /** * Component-aware, snapshot-driven conversation timeline. * ToolExecutionComponent state is rebuilt from normalized blocks when a call id * first appears and then reused; history never needs a live session, spinner, * stream, or process handle. */ export declare class ConversationTimeline implements Component { private readonly tui; private readonly theme; private readonly options; private blocks; private showTools; private focusedToolCallId; private expandedTools; private hoveredToolCallId; private hoveredIoView; private hoveredIoToolCallId; private hoveredIoSection; private lastClickedToolCallId; private lastClickedPoint; private toolComponents; private snapshot; private lastWidth; constructor(tui: TUI, theme: Theme, options?: ConversationTimelineOptions); setBlocks(blocks: readonly ConversationBlock[]): void; setShowTools(show: boolean): void; getShowTools(): boolean; setFocusedToolCallId(id: string | undefined): void; getFocusedToolCallId(): string | undefined; getSnapshot(): ConversationTimelineSnapshot; moveFocus(direction: 1 | -1): boolean; toggleFocusedTool(): boolean; isToolFocused(): boolean; render(width: number): string[]; private renderToolLines; /** * Hover only changes styling in a tool card. Re-render those rows in place * and leave the Markdown rows and their spans untouched. */ private refreshToolSpan; handleMouse(event: TuiMouseEvent): ConversationTimelineMouseResult | undefined; invalidate(): void; } //# sourceMappingURL=conversation-timeline.d.ts.map