/** * Scripted-conversation replay — turn a stored `HistoricalMessage[]` into ordered * "mock SSE" playback frames that animate a chat surface exactly like the live * NATS/SSE stream (a `thinking` pause → assistant text token-by-token → tool / * approval segments popping in → `idle`), just replayed from a script instead of * a network stream. * * Lives in the lib (not a host) so any consumer — marketing hero demos, docs, * onboarding tours — can drive a `previewMode` `EmbeddableChat` or a * `ChatMessageList` from a canned conversation without re-implementing the * streaming cadence. Pair with {@link useScriptedStream} (the playback clock). */ import type { HistoricalMessage, MessageData, StreamingPhase } from '../types'; /** Normalize the single-or-array `messageData` to an array (empty when absent). */ export declare function normalizeHistoricalMessageData(md: HistoricalMessage['messageData']): MessageData[]; /** A message the user authored carries an `owner`; assistant turns have none — * drives whether a turn streams (assistant) or lands at once (user). */ export declare function isHistoricalUserTurn(m: HistoricalMessage): boolean; /** One rendered step of the mocked stream. */ export interface StreamFrame { /** The partial message list to show at this step. */ messages: HistoricalMessage[]; phase: StreamingPhase; /** The chat "typing" indicator (up during the `thinking` pause). */ typing: boolean; /** Hold time (ms) before advancing to the next frame. */ delayMs: number; } /** * Expand a message list into ordered playback frames reproducing the live * stream: each user turn lands whole; each assistant turn first shows a * `thinking` indicator, then streams its text token-by-token, then pops any * tool / approval segments. Frame COUNT for a given prefix is deterministic, so * a host that appends a continuation (e.g. after an Approve) resumes seamlessly * from where it paused — the shared prefix's frames are unchanged. */ export declare function buildStreamFrames(messages: HistoricalMessage[]): StreamFrame[]; //# sourceMappingURL=scripted-stream.d.ts.map