import type { AgentSession } from "@earendil-works/pi-coding-agent"; export type ConversationBlockKind = "text" | "tool" | "meta"; export type ConversationBlockRole = "user" | "assistant" | "tool" | "custom" | "meta"; /** The durable result snapshot attached to a normalized tool block. */ export interface ConversationToolResultSnapshot { toolCallId?: string; toolName?: string; content?: unknown; details?: unknown; isError?: boolean; } export interface ConversationBlock { id: string; kind: ConversationBlockKind; role: ConversationBlockRole; header: string; markdown: string; copyText: string; fullText: string; toolLine?: string; /** Stable call id, including a synthetic id when the provider omitted one. */ toolCallId?: string; toolName?: string; /** Original tool arguments are retained for rich input rendering. */ toolArguments?: unknown; /** Compatibility-facing short alias used by the timeline renderer. */ args?: unknown; /** Result details/content are retained for rich output and durable diff rendering. */ toolResult?: ConversationToolResultSnapshot; /** Compatibility-facing short alias used by the timeline renderer. */ result?: ConversationToolResultSnapshot; toolStatus?: "pending" | "success" | "error"; } export interface ConversationFormatOptions { maxEntryChars?: number; maxToolResultChars?: number; } /** * Convert provider messages into stable, render-oriented blocks. * * Tool results are attached to the original call when possible. This keeps the * block in call/source order while preserving the complete result snapshot for * rich rendering. Results that cannot be matched remain visible as orphan cards. */ export declare function formatConversationMessages(messages: AgentSession["messages"], options?: ConversationFormatOptions): ConversationBlock[]; //# sourceMappingURL=conversation-blocks.d.ts.map