export interface GoalStats {
  message_count: number;
  total_tokens: number;
  total_cost: number;
  preview?: string;
}

export interface Knowledge {
  id: string;
  scenario: string;
  content: string;
  score?: number;
  quality_score?: number;
  tags?: {
    type?: string[];
  };
  metrics?: {
    helpful?: number;
    harmful?: number;
  };
  created_at?: string;
}

export interface Goal {
  id: string;
  description: string;
  reason?: string;
  status: "pending" | "running" | "completed" | "failed";
  summary?: string;
  parent_id?: string;
  created_at: string;
  completed_at?: string;
  metadata?: Record<string, unknown>;
  agent_call_mode?: string;
  sub_trace_ids?: Array<string | { trace_id: string; mission?: string }>;
  sub_goals?: Array<Goal>;
  self_stats?: GoalStats;
  cumulative_stats?: GoalStats;
  knowledge?: Knowledge[];
}

export interface BranchContext {
  branch_id: string;
  parent_goal_id: string;
  status: string;
  created_at: string;
  completed_at?: string;
}
