import type { Goal, BranchContext } from "./goal";

export interface TraceListItem {
  trace_id: string;
  mode: string;
  task: string;
  status: string;
  total_messages: number;
  total_tokens: number;
  total_cost: number;
  current_goal_id: string;
  created_at: string;
  parent_trace_id: string | null;
  agent_type?: string;
  parent_goal_id?: string;
}

export interface TraceListResponse {
  traces: TraceListItem[];
  total: number;
}

export interface TraceDetailResponse {
  trace_id: string;
  mode: string;
  task: string;
  status: string;
  total_messages: number;
  total_tokens: number;
  total_cost: number;
  created_at: string;
  completed_at: string | null;
  goal_tree: {
    mission: string;
    current_id: string | null;
    goals: Goal[];
  };
  sub_traces?: Record<string, TraceListItem>;
  branches?: Record<string, BranchContext>; // Deprecated but kept for compatibility
}
