/**
 * Attachments + sources attached to a chat message.
 */

export interface ChatAttachment {
  id: string;
  type: 'image' | 'file' | 'audio' | 'video' | 'text';
  /**
   * Object-URL / remote URL for binary attachments. Empty string for
   * `type:'text'` chunks — those carry their payload in `text`, not a URL.
   */
  url: string;
  thumbnailUrl?: string;
  name?: string;
  mimeType?: string;
  sizeBytes?: number;
  status?: 'uploading' | 'ready' | 'error';
  /** 0..1 while uploading. */
  progress?: number;
  /** Extracted text from images (OCR). */
  ocrText?: string;
  /**
   * Raw text payload for `type:'text'` chunks — the "Pasted text"
   * attachment minted when a long paste is converted into a chip
   * instead of dumped into the textarea (ChatGPT/Claude behaviour).
   * Preserves exact content: newlines, indentation, stack traces.
   */
  text?: string;
}

export interface ChatSource {
  title: string;
  url: string;
  snippet?: string;
  chunkIndex?: number;
}
