// Admin 相关类型定义

/** 模型供应商 */
export interface ModelProvider {
  name: string;
  base_url: string;
  api_key: string;
}

/** 模型配置 */
export interface ModelConfig {
  id: string;
  name: string;
  provider: string;
  description?: string;
  priority?: number;
  tags?: string[];
  params?: Record<string, unknown>;
  enabled?: boolean;
  updated_at?: string;
}

/** 路由规则 */
export interface RoutingRule {
  purpose: string;
  fallback_chain: string[];
  required?: boolean;
}

/** 会话状态 */
export interface SessionState {
  session_id: string;
  user_id: string;
  title: string;
  is_main: boolean;
  created_at: string;
  updated_at: string;
  message_count: number;
}

/** 客户端信息 */
export interface ClientInfo {
  client_id: string;
  device_name?: string;
  user_agent?: string;
  note?: string;
  last_seen?: string;
  online?: boolean;
}

/** 健康检查结果 */
export interface HealthCheckResult {
  provider: string;
  message: string;
}

/** Profile 信息 */
export interface ProfileInfo {
  user_id: string;
  username: string;
  nickname?: string;
  is_admin: boolean;
  created_at: string;
}

/** 模型列表响应 */
export interface ModelListResponse {
  models: ModelConfig[];
  total: number;
}

/** 供应商列表响应 */
export interface ProviderListResponse {
  providers: ModelProvider[];
  total: number;
}

/** 会话列表响应 (admin) */
export interface AdminSessionsResponse {
  sessions: SessionState[];
  total: number;
}

/** 按用户分组的活跃会话 */
export interface ActiveSessionsResponse {
  users: Record<string, SessionState[]>;
}

/** 客户端列表响应 */
export interface ClientListResponse {
  clients: ClientInfo[];
  total: number;
}
