import type { Audio } from "@/llm/content/audio";
import type { Document } from "@/llm/content/document";
import type { Image } from "@/llm/content/image";
import type { Text } from "@/llm/content/text";
import type {
  TextChunk,
  TextEndChunk,
  TextStartChunk,
} from "@/llm/content/text";
import type { Thought } from "@/llm/content/thought";
import type {
  ThoughtChunk,
  ThoughtEndChunk,
  ThoughtStartChunk,
} from "@/llm/content/thought";
import type { ToolCall } from "@/llm/content/tool-call";
import type {
  ToolCallChunk,
  ToolCallEndChunk,
  ToolCallStartChunk,
} from "@/llm/content/tool-call";
import type { ToolOutput } from "@/llm/content/tool-output";

/**
 * All content types that can appear in messages.
 */
export type ContentPart =
  | Text
  | Image
  | Audio
  | Document
  | ToolOutput
  | ToolCall
  | Thought;

/**
 * Content types that can appear in user messages.
 */
export type UserContentPart = Text | Image | Audio | Document | ToolOutput;

/**
 * Content types that can appear in assistant messages.
 */
export type AssistantContentPart = Text | ToolCall | Thought;

/**
 * Chunks of assistant content that may be streamed as generated by the LLM.
 */
export type AssistantContentChunk =
  | TextStartChunk
  | TextChunk
  | TextEndChunk
  | ThoughtStartChunk
  | ThoughtChunk
  | ThoughtEndChunk
  | ToolCallStartChunk
  | ToolCallChunk
  | ToolCallEndChunk;

/**
 * Individual content type exports
 */
export type { Text } from "@/llm/content/text";
export type { Thought } from "@/llm/content/thought";
export type { ToolCall } from "@/llm/content/tool-call";
export {
  Audio,
  type AudioMimeType,
  type Base64AudioSource,
} from "@/llm/content/audio";
export {
  Document,
  type Base64DocumentSource,
  type DocumentBase64MimeType,
  type DocumentTextMimeType,
  type TextDocumentSource,
  type URLDocumentSource,
} from "@/llm/content/document";
export {
  Image,
  type Base64ImageSource,
  type ImageMimeType,
  type URLImageSource,
} from "@/llm/content/image";
export { ToolOutput } from "@/llm/content/tool-output";

/**
 * Text chunk exports
 */
export type {
  TextStartChunk,
  TextChunk,
  TextEndChunk,
} from "@/llm/content/text";
export { textStart, textChunk, textEnd } from "@/llm/content/text";

/**
 * Thought chunk exports
 */
export type {
  ThoughtStartChunk,
  ThoughtChunk,
  ThoughtEndChunk,
} from "@/llm/content/thought";
export { thoughtStart, thoughtChunk, thoughtEnd } from "@/llm/content/thought";

/**
 * ToolCall chunk exports
 */
export type {
  ToolCallStartChunk,
  ToolCallChunk,
  ToolCallEndChunk,
} from "@/llm/content/tool-call";
export {
  toolCallStart,
  toolCallChunk,
  toolCallEnd,
} from "@/llm/content/tool-call";
