// 会话相关类型定义

/** 会话 */
export interface Session {
  id: string;
  user_id: string;
  title: string;
  is_main: boolean;
  created_at: string;
  updated_at: string;
  message_count?: number;
}

/** 创建会话参数 */
export interface CreateSessionParams {
  title?: string;
  is_main?: boolean;
}

/** 会话列表响应 */
export interface SessionListResponse {
  sessions: Session[];
}

/** 会话消息列表响应 (API 返回的原始数据，字段名如 created_at 与服务端一致) */
export interface SessionMessagesResponse {
  messages: Record<string, unknown>[];
}

/** 单个会话响应 */
export interface SessionResponse {
  id: string;
  user_id: string;
  title: string;
  is_main: boolean;
  created_at: string;
  updated_at: string;
}

/** 认证相关 */
export interface AuthResponse {
  user_id: string;
  token: string;
  refresh_token?: string;
  expires: number;
  nickname?: string;
}

export interface LoginParams {
  username: string;
  password: string;
}

export interface RegisterParams {
  username: string;
  password: string;
  email: string;
  nickname: string;
  verify_code: string;
}
