import type { ChatBlock, JsonObject } from '../shared/types.js'; /** Attachment descriptor stored alongside a message and rendered by the web UI. */ export interface MessageMedia { type: 'image' | 'audio' | 'video' | 'file'; url: string; name?: string; mimeType?: string; size?: number; /** Displayed pixel size of an image, so the client can reserve its box before * the bytes arrive. Absent when nothing measured it. */ width?: number; height?: number; } export interface SessionMessage { id: string; role: string; content: string; timestamp: number; /** Parsed from the `media` JSON column; undefined when the message has no attachments. */ media?: MessageMedia[]; /** True for a live mid-turn block. Most engines replace these at turn end. */ partial?: boolean; /** Tool name when this block is a tool call — lets a reloaded block render as a tool card. */ toolCall?: string; /** Native engine call id used to correlate interleaved tool results. */ toolId?: string; /** Structured Chat Mode blocks rendered by the web UI. */ blocks?: ChatBlock[]; /** Safe structured UI metadata, used for reload-stable callback attribution. */ meta?: JsonObject; } export interface MessageRow { rowid: number; id: string; role: string; content: string; timestamp: number; media: string | null; partial: number | null; seq: number | null; tool_call: string | null; tool_id: string | null; blocks: string | null; meta: string | null; } export interface MessagePage { messages: SessionMessage[]; hasOlder: boolean; } export interface MessagePageOptions { /** Fetch messages strictly older than this message id. Omit for the newest tail. */ before?: string; /** Number of messages to return. Clamped to a bounded positive page size. */ limit?: number; } export declare function parseBlocksColumn(value: unknown): ChatBlock[] | undefined; export declare function parseMetaColumn(value: unknown): JsonObject | undefined; export declare function rowToMessage(r: MessageRow): SessionMessage; //# sourceMappingURL=message-row.d.ts.map