import request from '@/utils/http'

export interface AgentSession {
  id: string
  trace_type: 'application' | 'digital_employee'
  target_code: string
  trace_count: number
  latest_trace_id: string
  latest_status: 'running' | 'success' | 'error'
  started_at: string
  updated_at: string
  retrieval_count: number
  model_call_count: number
  tool_call_count: number
}

export interface AgentSessionPage { items: AgentSession[] }

export function fetchAgentSessions(params: Record<string, string | number | undefined>) {
  return request.get<AgentSessionPage>({ url: '/api/v1/admin/agent-sessions', params })
}
