/**
 * Notebook 模块类型定义
 */

import type { QAReference } from './qa'

export interface NotebookConfig {
  goal: string
  style: string
  answer_length: 'short' | 'medium' | 'long'
}

export interface Notebook {
  id: string
  title: string
  description?: string
  status: 'active' | 'archived'
  config?: NotebookConfig
  sources?: NotebookSource[]
  source_count?: number
  message_count?: number
  created_at?: string
  updated_at?: string
}

export interface NotebookSource {
  id: string
  notebook_id: string
  source_type: 'search' | 'upload' | 'paste'
  title: string
  doc_id?: string
  ingest_status: 'pending' | 'processing' | 'completed' | 'failed'
  ingest_error?: string
  summary?: string
  selected: boolean
  created_at?: string
  updated_at?: string
}

export interface NotebookMessage {
  id: string
  role: 'user' | 'assistant'
  content?: string
  references?: QAReference[]
  suggestions?: string[]
  created_at?: string
}

export interface NotebookOutput {
  id: string
  notebook_id: string
  output_type: string
  title: string
  content_md?: string
  status: 'generating' | 'completed' | 'failed'
  error?: string
  context_json?: { source_count?: number; source_titles?: string[] }
  created_at?: string
  updated_at?: string
}

export type OutputType =
  | 'briefing'
  | 'study_guide'
  | 'blog_post'
  | 'science_handbook'
  | 'implementation_plan'
  | 'speech_draft'
  | 'policy_brief'
  | 'summary_report'
  | 'custom'

export interface OutputTypeOption {
  value: OutputType
  label: string
  description: string
  icon: string
}
