import type { ChatAttachment, ChatMessage } from '../types'; /** Walk the conversation and collect image attachments in chronological order. */ export function collectImageAttachments(messages: ChatMessage[]): ChatAttachment[] { const out: ChatAttachment[] = []; for (const m of messages) { if (!m.attachments) continue; for (const a of m.attachments) { if (a.type === 'image') out.push(a); } } return out; }