/**
 * Core type definitions for the multi-agent chat application
 */

/**
 * Represents an AI agent that users can chat with
 */
export interface Agent {
  id: string
  name: string
  description: string
  webhookUrl: string
}

/**
 * Represents a single message in the chat
 * Images are stored as base64 strings for transmission to the webhook
 */
export interface Message {
  id: string
  role: "user" | "assistant"
  content: string
  timestamp: Date
  isError?: boolean
  hint?: string
  images?: string[] // Base64 encoded images (user messages only)
}

/**
 * API request body for POST /api/chat
 */
export interface ChatRequest {
  message: string
  timestamp: string
  sessionId: string
  agentId: string
  images?: string[] // Optional base64 encoded images
}

/**
 * API response from POST /api/chat
 */
export interface ChatResponse {
  error?: string
  hint?: string
  response?: string
  message?: string
}

/**
 * API response from GET /api/agents
 */
export interface AgentsResponse {
  agents: Agent[]
  error?: string
}

/**
 * Props for diff-related components
 */
export interface DiffToolProps {
  oldCode: string
  newCode: string
  title?: string
  language?: string
}

export interface DiffDisplayProps {
  oldText: string
  newText: string
  title?: string
  language?: string
}

export interface DiffLine {
  type: "added" | "removed" | "unchanged"
  content: string
  oldLineNumber?: number
  newLineNumber?: number
}

/**
 * Props for markdown renderer
 */
export interface MarkdownRendererProps {
  content: string
  className?: string
}
