import type { KeybindingsManager } from '@earendil-works/pi-tui'; import { Container } from '@earendil-works/pi-tui'; import type { AgentMessage, AgentToolResult } from '@earendil-works/pi-agent-core'; import { BashExecutionComponent } from './bash-execution.js'; import { type BashSummary } from './bash-summary.js'; import { type BranchMessageSummary } from './branch-message-summary.js'; import { type CustomMessageSummary } from './custom-message.js'; import type { TuiMessageRenderer } from '../../extensions/types/tui.js'; import { type ToolExecutionOptions } from './tool-execution.js'; import type { TuiBranchSummary, TuiCompactionResult } from '../tui-backend.js'; export type ChatLogEntryMeta = { displayIndex?: number; historyIndex?: number; rowNumber?: number; role?: 'user' | 'assistant' | 'system'; }; export declare class ChatLog extends Container { private readonly keybindings?; private toolById; private bashBlocks; private compactionBlocks; private branchBlocks; private branchMessageBlocks; private customBlocks; private customMessageRenderers; private assistantMessages; private streamingRuns; /** After finalizeAssistant, late tool execution events can still arrive; keep the bubble to link tools. */ private assistantAnchorByRunId; private runsWithTools; private toolsExpanded; private showThinking; private hiddenThinkingLabel; private toolImageOptions; private lastAssistantText; private lastStatusEntry; private lastStatusText; private workflowStatusByRunId; private entryRecords; private viewportRowsProvider; private historyViewDisplayIndex; constructor(keybindings?: KeybindingsManager); private pruneOverflow; private dropReferences; private append; clearAll(): void; private createAssistantMessage; addSystem(text: string, meta?: ChatLogEntryMeta): void; addStatus(text: string): void; updateWorkflowRun(runId: string, text: string): void; addCompactionSummary(result: TuiCompactionResult): void; addBranchSummary(summary: TuiBranchSummary): void; addBranchMessageSummary(summary: BranchMessageSummary): void; addCustomMessage(summary: CustomMessageSummary): void; setCustomMessageRenderer(customType: string, renderer: TuiMessageRenderer | undefined): void; addUser(text: string | unknown[], meta?: ChatLogEntryMeta): void; /** Stream local `!command` output in a bordered block. */ addBashExecution(command: string, ui: import('@earendil-works/pi-tui').TUI, excludeFromContext: boolean): BashExecutionComponent; /** Replay a completed shell execution from persisted transcript history. */ addBashSummary(summary: BashSummary): void; startAssistant(message: AgentMessage, runId: string): void; updateAssistant(message: AgentMessage, runId: string): void; finalizeAssistant(message: AgentMessage, runId: string, meta?: ChatLogEntryMeta): void; dropAssistant(runId: string): void; startTool(toolCallId: string, toolName: string, args: unknown, runId: string): void; markToolExecutionStarted(toolCallId: string): void; markToolArgsComplete(toolCallId: string): void; updateToolResult(toolCallId: string, result: AgentToolResult | unknown, isError: boolean, isPartial?: boolean): void; updateToolDetails(toolCallId: string, details: unknown): void; updateToolArgs(toolCallId: string, args: unknown): void; setToolsExpanded(expanded: boolean): void; setShowThinking(showThinking: boolean): void; setHiddenThinkingLabel(label?: string): void; setToolImageOptions(options: ToolExecutionOptions): void; getLastAssistantText(): string; setViewportRowsProvider(provider: (() => number) | undefined): void; jumpToDisplayIndex(displayIndex: number): boolean; jumpToLatest(): void; getTimelineViewportState(): { mode: 'latest'; } | { mode: 'history'; displayIndex: number; }; render(width: number): string[]; private findEntryRecord; }