import type { AgentEvent } from '../agent/AgentLoop.js'; export type PresentationRole = 'user' | 'assistant' | 'tool' | 'system'; export interface FlatChatMessage { id?: string; role: PresentationRole; content: string; toolName?: string; toolArgs?: Record; toolCallId?: string; toolStatus?: ToolLifecyclePart['status']; durationMs?: number; errorType?: string; model?: string; timestamp: Date; checkpointId?: string; } export type VisualPartKind = 'text' | 'tool' | 'error' | 'route' | 'compact' | 'research'; export interface ToolLifecyclePart { kind: 'tool'; id: string; toolCallId?: string; toolName?: string; args?: Record; content: string; status: 'running' | 'success' | 'error' | 'timeout' | 'cancelled'; startedAt: Date; endedAt?: Date; durationMs?: number; errorType?: string; } export interface TextVisualPart { kind: 'text'; content: string; model?: string; startedAt: Date; updatedAt: Date; } export interface NonTextVisualPart { kind: Exclude; content: string; toolName?: string; timestamp: Date; } export type VisualPart = TextVisualPart | ToolLifecyclePart | NonTextVisualPart; export interface CompletionMetadata { model?: string; durationMs?: number; toolCount: number; } export interface PresentationTurnState { turnId?: string; startedAt: Date; updatedAt: Date; parts: VisualPart[]; activeToolIds: string[]; toolCount: number; completed?: CompletionMetadata; } export interface PresentationState { messages: FlatChatMessage[]; baseMessages: FlatChatMessage[]; currentTurn?: PresentationTurnState; } export interface ApplyEventOptions { model?: string; now?: Date; renderToolEnd?: (event: AgentEvent) => string; } export declare function boundedLiveToolPreview(content: string): string; export declare function startUserTurn(state: PresentationState, content: string, options?: { now?: Date; turnId?: string; }): PresentationState; export declare function applyAgentEvents(state: PresentationState, events: AgentEvent[], options?: ApplyEventOptions): PresentationState; export declare function applyAgentEvent(state: PresentationState, event: AgentEvent, options?: ApplyEventOptions): PresentationState; export declare function flattenPresentationState(state: PresentationState, options?: Pick): FlatChatMessage[]; export declare function createPresentationState(messages?: FlatChatMessage[]): PresentationState; //# sourceMappingURL=TurnState.d.ts.map