/** * `UnifiedChatMessage` (what the chat state produces, and what a host like * Mingo hands in) → `Message` (what the thread renders). * * The two types overlap but are not the same: this step resolves the role's * default name and avatar, folds `segments` back into `content`, and stamps a * timestamp for rows that arrived without one. So it is a REBUILD, and a * rebuild names every field it keeps — which makes "a new field was added * upstream" a silent data loss by default, not a compile error. * * It has cost us that twice already. `hidden` was dropped here, and a synthetic * directive the reader was never meant to see rendered as an ordinary bubble. * Then Guide Mode's `sources` / `refs` were dropped here, and every answer lost * its citation strip while its cards fell back to being titled by their own id * — with the decoder, the reducer and the renderer all working correctly, which * is exactly why it took a screenshot diff to find. * * Hence this module: pure, cheap to render-free test, and the one place the * pass-through list is pinned. */ import type { Message } from '../types/message.types'; import type { UnifiedChatMessage } from '../types/unified-chat-state.types'; export interface HostMessageMapOptions { /** Display name for `user` rows when the host supplies none. */ userName?: string; /** Avatar for `user` rows when the host supplies none. */ userAvatar?: string; /** * Fallback timestamps for rows that carry none, keyed by message id. Mutated: * a row must keep the SAME fallback across renders, or its bubble re-stamps * itself on every keystroke elsewhere in the thread. */ timestampCache: Map; } export declare function mapHostMessage(m: UnifiedChatMessage, options: HostMessageMapOptions): Message; /** * Drop cached fallback timestamps for messages no longer in the thread, so the * map cannot grow unbounded across a long-lived session. */ export declare function pruneTimestampCache(timestampCache: Map, liveIds: Set): void; //# sourceMappingURL=host-message.d.ts.map