/**
 * Shared types for V2 Dashboard components
 */
import type { OperationResultDto } from '../../../api/contracts'

export interface ChatMessage {
  sender: 'iris' | 'user'
  text: string
  ts: string
  tool?: string
  runId?: string | null
  runState?: string | null
  operation?: OperationResultDto | null
}

export interface TaskItem {
  id: string
  title: string
  agent: string
  priority: 'high' | 'medium' | 'low'
  status: 'active' | 'pending' | 'blocked'
  progress: number  // 0–100
  detail?: string | null
  source?: string
}

/* ── Agent Detail Modal Types ─────────────────── */

export interface AgentActivityItem {
  time: string
  text: string
}

/** Dashboard view-model for an agent detail modal */
export interface AgentDetailData {
  id: string
  name: string
  role: string
  roleBadge: string
  model: string
  status: 'work' | 'think' | 'idle'
  statusLabel: string
  task: string | null
  goal: string | null
  progress: number | null
  elapsed: string | null
  next: string | null
  tokens: string | null
  cost: string | null
  statusDetail: string | null
  md?: string
  tokensToday: number | null
  costToday: number | null
  workload: number | null
  uptime: string | null
  lastActive: string
  activeTaskCount: number
  activity: AgentActivityItem[]
  availableModels: { id: string; alias: string }[]
}
