import type { CompletionMessage } from '../adapter/openai/wire.js'; import type { PartDelta } from '../adapter/types.js'; import type { MessagePart } from '../types.js'; /** Fold one streamed PartDelta into a parts timeline. Pure: returns a new * array, leaving the input untouched, so it works for both reducer state * and the provider's local accumulation. Unknown target ids are dropped * rather than invented — an end without a start has nothing to render. */ export declare function applyPartDelta(parts: MessagePart[], delta: PartDelta): MessagePart[]; export declare function toolTurnMessages(parts: MessagePart[] | null | undefined, answer: CompletionMessage): CompletionMessage[]; /** What finalizeParts records for a call whose end never came. */ export declare const UNFINISHED_CALL_RESULT = "interrupted"; /** A turn can end (completed or stopped) with tool calls still marked * running — the transport died before their tool_end arrived. A stored * message must not spin forever, so close them out as interrupted. */ export declare function finalizeParts(parts: MessagePart[]): MessagePart[]; /** A finished reply whose text was streamed among its parts: the text after * the last part is the answer, shown below them as the message's content, * the shape a stored conversation is read back in. */ export declare function splitAnswer(parts: MessagePart[]): { parts: MessagePart[]; content?: string | null; };