import type { AIUIDocument } from '../GenerativeUI/AIUIDocument'; import type { AIMessageAttachmentData } from '../Message/AIMessageAttachment'; import type { AIMessage, AIPendingMessage } from './types'; /** A row of the conversation: a message, or a message the person sent that is on its way. */ export type AIConversationEntry = { /** The message's id, or, for the copy of a message that was on its way, that message's. */ id: string; isFromUser: boolean; /** Whether it is a reply that ends the conversation. */ isLatestReply: boolean; /** The message, or `undefined` for one on its way. */ message?: AIMessage; /** The message on its way, until its copy arrives. */ pending?: AIPendingMessage; /** What the person sent with a message on its way, which its copy shows rather than load it again. */ sentAttachments: AIMessageAttachmentData[]; }; /** The person's message and the replies to it. */ export type AIConversationTurn = { entries: AIConversationEntry[]; id: string; }; /** Whether a reply's generated UI shows, such as `AIUIHost.canShow`. */ export type AIConversationCanShowUI = (document: AIUIDocument) => boolean; /** * Groups the rows into turns, each starting with one of the person's messages. A row that * started a turn, kept in `starts`, keeps starting one: a reply that opened the first page loaded * stays the start of its turn when older messages load above it, so the turn keeps its key. */ export declare const turnsOf: (entries: AIConversationEntry[], starts?: Set) => AIConversationTurn[]; /** * Follows a message the person sent until its copy arrives in the messages, so the copy takes * over its row (and its key) without a flicker, and tells whether the agent is surely about to * answer. The counterpart of `AIPendingMessageTracker`. */ export declare class AIPendingMessageTracker { private seen; private copies; private lastPending?; private lastNewestFromUser; entries(messages: AIMessage[], pending?: AIPendingMessage | null, canShowUI?: AIConversationCanShowUI): AIConversationEntry[]; private copyOf; isAwaitingReply(messages: AIMessage[], pending?: AIPendingMessage | null, canShowUI?: AIConversationCanShowUI): boolean; } //# sourceMappingURL=entries.d.ts.map