import type { Message, MessagePart } from '../../types/api'; import { type CompactActivityEntry } from './compactActivity'; export declare const STATUS_LINE_TOOL_NAMES: Set; export declare const AUTO_COMPACT_COMPLETED_PART_THRESHOLD = 60; export declare const PART_WINDOW_RENDER_THRESHOLD = 90; export declare const PART_WINDOW_HEAD_COUNT = 20; export declare const PART_WINDOW_TAIL_COUNT = 48; export declare const ACTION_TOOL_NAMES: string[]; /** Stable per-message loading copy so the label does not flicker on rerender. */ export declare function getLoadingMessage(messageId: string): string; export declare function isStatusLineTool(toolName: string | null | undefined): boolean; export declare function isActionToolPart(part: MessagePart): boolean; /** Parts in render order; tool results can arrive out of order while streaming. */ export declare function getOrderedMessageParts(message: Message): MessagePart[]; export type AssistantRenderItem = { kind: 'part'; index: number; part: MessagePart; } | { kind: 'group'; id: string; entries: CompactActivityEntry[]; titleOverride?: string; }; export interface VisibleAssistantRenderItem { item: AssistantRenderItem; renderIndex: number; } export interface PreloadedContextSummary { files: Array<{ path: string; lineRange?: string; }>; totalBytes?: number; preloadDurationMs?: number; deduplicatedFileCount?: number; } export declare function getPreloadedContextSummary(parts: MessagePart[]): PreloadedContextSummary | null; export declare function getRenderItemKey(item: AssistantRenderItem): string; /** True for the `progress_update` tool, whose text titles the next activity group. */ export declare function isProgressUpdatePart(part: MessagePart): boolean; /** * Text of a `progress_update` part, or `undefined` for any other part. The * compact renderer uses it as the title of the activity group that follows it. */ export declare function getProgressUpdateMessage(part: MessagePart): string | undefined; export declare function buildAssistantRenderItems(parts: MessagePart[], shouldCompactActivity: boolean): AssistantRenderItem[]; /** * Windows very long turns: the head and tail stay rendered and the middle * collapses behind a "show all" affordance until the user expands it. */ export declare function getVisibleRenderItems(renderItems: AssistantRenderItem[], showAllParts: boolean, messageStatus: Message['status']): { visibleRenderItems: { item: AssistantRenderItem; renderIndex: number; }[]; omittedRenderItemCount: number; }; export interface AssistantTurnOptions { compact?: boolean; isQueued?: boolean; showAllParts?: boolean; /** * Keeps a turn in its expanded per-part representation even after it * completes past the auto-compact threshold. The thread sets this for * turns it already rendered expanded while they streamed: swapping the * whole turn to compact groups at the pending→complete instant would * remove every in-view row key at once, which the reader experiences as * the viewport jumping. History turns (first seen complete) still * auto-compact. */ suppressAutoCompact?: boolean; } /** * Memoized `deriveAssistantTurn` keyed on message identity. Messages are * replaced (not mutated) on every stream update, so untouched turns are * re-derived zero times while the thread rebuilds its rows. */ export declare function getAssistantTurn(message: Message, options: AssistantTurnOptions): AssistantTurnModel; export interface AssistantTurnModel { parts: MessagePart[]; preloadedContext: PreloadedContextSummary | null; renderItems: AssistantRenderItem[]; visibleRenderItems: VisibleAssistantRenderItem[]; omittedRenderItemCount: number; autoCompactActivity: boolean; shouldCompactActivity: boolean; liveActionToolCallIds: Set; /** * Action-tool call ids that already have a persisted `tool_result`. Their * ephemeral (client-only) placeholder is redundant and is dropped so the * persisted part keeps the row. */ completedActionToolCallIds: Set; /** * Every tool call id in this turn that already has a persisted * `tool_result`. A call row keeps its live box until this contains its id, * which makes the row's height independent of how many parts follow it. */ resolvedToolCallIds: Set; firstVisiblePartIndex: number; hasVisibleNonProgressParts: boolean; latestProgressUpdatePart: MessagePart | null; latestStatusLineToolCallPart: MessagePart | null; shouldShowStatusLineToolCall: boolean; shouldShowProgressUpdate: boolean; shouldShowLoadingFallback: boolean; shouldShowErrorFallback: boolean; } /** * Derives everything needed to render one assistant turn. Shared by the * grouped renderer and the flattened thread rows so both stay in sync. */ export declare function deriveAssistantTurn(message: Message, options: AssistantTurnOptions): AssistantTurnModel; //# sourceMappingURL=assistantTurnModel.d.ts.map