/** * Maps TORUK Core's persisted messages onto the widget's runtime message shape. * * Core is the only source of chat history, so this is the single place where a * stored message becomes a rendered one. Field names follow Core's * MessageOutputDto exactly — note `createdDate` (not `createdAt`) and `role` * carrying the engine's own 'userMessage' / 'apiMessage' values. * * The engine passthrough fields are stored as JSON strings. They are parsed * defensively: a single malformed field drops that field, never the message. */ import type { MessageType } from '@/widget/types'; import type { TorukSessionMessage } from '@/sessions/sessions.types'; /** Convert one stored message. */ export declare function mapCoreMessage(item: TorukSessionMessage): MessageType; /** * Convert a page of stored messages, dropping rows with nothing to render. * Order is preserved: Core returns oldest-first. */ export declare function mapCoreMessages(items: TorukSessionMessage[] | undefined): MessageType[];