import type { ScriptParameter } from './scripts'

export interface ScriptBuilderSessionSummary {
  id: string
  language: string
  title: string | null
  message_count: number
  latest_script_filename: string | null
  created_at: string
  updated_at: string
}

export interface ScriptBuilderSessionDetail {
  id: string
  language: string
  title: string | null
  messages: ScriptBuilderMessage[]
  latest_script: string | null
  latest_script_filename: string | null
  message_count: number
  ai_session_id: string | null
  created_at: string
  updated_at: string
}

export interface ScriptBuilderMessage {
  id?: string
  role: 'user' | 'assistant'
  content: string
  script?: string | null
  script_filename?: string | null
  line_count?: number | null
  input_tokens?: number | null
  output_tokens?: number | null
  created_at: string
}

export interface ScriptBuilderMessageResponse {
  role: 'assistant'
  content: string
  script: string | null
  script_filename: string | null
  line_count: number | null
  timestamp: string
}

export interface SaveToLibraryRequest {
  name: string
  description?: string
  category_id?: string
  share_with_team?: boolean
  script_body?: string
  parameters_schema?: { parameters: ScriptParameter[] }
}
