/**
 * TypeScript type definitions for TradingAgents API
 */

export interface AnalysisRequest {
  ticker: string;
  analysis_date: string;
  analysts?: string[];
  research_depth?: number;
  shallow_thinking_agent?: string;
  deep_thinking_agent?: string;
  
  // API Configuration
  openai_api_key?: string;
  openai_base_url?: string;
  alpha_vantage_api_key?: string;
}

export interface PriceData {
  Date: string;
  Open: number;
  High: number;
  Low: number;
  Close: number;
  Volume: number;
}

export interface PriceStats {
  growth_rate: number;
  duration_days: number;
  start_date: string;
  end_date: string;
  start_price: number;
  end_price: number;
}

export interface AnalysisResponse {
  status: string;
  ticker: string;
  analysis_date: string;
  decision?: any;
  reports?: any;
  error?: string;
  price_data?: PriceData[];
  price_stats?: PriceStats;
}

export interface Decision {
  action: string;
  quantity?: number;
  reasoning?: string;
  confidence?: number;
}

export interface Reports {
  market_report?: string;
  sentiment_report?: string;
  news_report?: string;
  fundamentals_report?: string;
  investment_plan?: string;
  trader_investment_plan?: string;
  final_trade_decision?: string;
  investment_debate_state?: DebateState;
  risk_debate_state?: DebateState;
}

export interface DebateState {
  bull_history?: string;
  bear_history?: string;
  risky_history?: string;
  safe_history?: string;
  neutral_history?: string;
  judge_decision?: string;
}

export interface ConfigResponse {
  available_analysts: string[];
  available_llms: {
    [provider: string]: string[];
  };
  default_config: {
    [key: string]: any;
  };
}

export interface HealthResponse {
  status: string;
  version: string;
  timestamp: string;
}

export interface Ticker {
  symbol: string;
  name: string;
}

// Task Management Types

export interface TaskCreatedResponse {
  task_id: string;
  status: "pending";
  message: string;
}

export interface TaskStatusResponse {
  task_id: string;
  status: "pending" | "running" | "completed" | "failed";
  created_at: string;
  updated_at: string;
  progress?: string;
  result?: AnalysisResponse;
  error?: string;
  completed_at?: string;
}

