/** Conversation returned by the gateway API. */
export interface Conversation {
  id: string;
  userId: string;
  title: string | null;
  projectId: string | null;
  archived: boolean;
  createdAt: string;
  updatedAt: string;
}

/** Message within a conversation. */
export interface Message {
  id: string;
  conversationId: string;
  role: 'user' | 'assistant' | 'system';
  content: string;
  thinking?: string;
  model?: string;
  provider?: string;
  promptTokens?: number;
  completionTokens?: number;
  totalTokens?: number;
  metadata?: Record<string, unknown>;
  createdAt: string;
}

/** Model definition returned by provider APIs. */
export interface ModelInfo {
  id: string;
  provider: string;
  name: string;
  reasoning: boolean;
  contextWindow: number;
  maxTokens: number;
  inputTypes: Array<'text' | 'image'>;
  cost: {
    input: number;
    output: number;
    cacheRead: number;
    cacheWrite: number;
  };
}

/** Provider with associated models. */
export interface ProviderInfo {
  id: string;
  name: string;
  available: boolean;
  models: ModelInfo[];
}

/** Task statuses. */
export type TaskStatus = 'not-started' | 'in-progress' | 'blocked' | 'done' | 'cancelled';

/** Task priorities. */
export type TaskPriority = 'critical' | 'high' | 'medium' | 'low';

/** Task returned by the gateway API. */
export interface Task {
  id: string;
  title: string;
  description: string | null;
  status: TaskStatus;
  priority: TaskPriority;
  projectId: string | null;
  missionId: string | null;
  assignee: string | null;
  tags: string[] | null;
  dueDate: string | null;
  metadata: Record<string, unknown> | null;
  createdAt: string;
  updatedAt: string;
}

/** Project statuses. */
export type ProjectStatus = 'active' | 'paused' | 'completed' | 'archived';

/** Project returned by the gateway API. */
export interface Project {
  id: string;
  name: string;
  description: string | null;
  status: ProjectStatus;
  userId: string;
  ownerId?: string;
  metadata: Record<string, unknown> | null;
  createdAt: string;
  updatedAt: string;
}

/** Mission statuses. */
export type MissionStatus = 'planning' | 'active' | 'paused' | 'completed' | 'failed';

/** Mission returned by the gateway API. */
export interface Mission {
  id: string;
  name: string;
  description: string | null;
  status: MissionStatus;
  projectId: string | null;
  metadata: Record<string, unknown> | null;
  createdAt: string;
  updatedAt: string;
}
