export type Role = 'student' | 'professor' | 'admin'; export interface User { id: string; email: string; role: Role; display_name: string | null; preferences: { tutoiement?: boolean; course?: string; deep?: boolean; locale?: string; font_scale?: number }; consent_at: string | null; has_password?: boolean; } export interface Course { code: string; title: string; term: string; modules: string[]; suggestions: string[]; site: string; deadlines: { label: string; date: string }[]; announcement: string; } export interface Conversation { id: string; title: string; course: string; pinned: boolean; archived: boolean; created_at: string; updated_at: string; } export interface Artifact { type: string; file_id: string | null; filename: string | null; preview?: unknown; url?: string | null; } export interface ToolCallView { id: string; name: string; arguments: Record; args_preview?: string; summary: string; payload: Record; artifacts?: Artifact[]; status: 'running' | 'ok' | 'error'; progress?: string; duration_ms: number; } export interface Message { id: string; role: 'user' | 'assistant' | 'system'; content: string; model?: string | null; created_at: string; feedback?: string | null; attachments?: string[]; tool_calls?: ToolCallView[]; cost_usd?: number; streaming?: boolean; error?: string; latency_ms?: number; } export interface UploadedFile { file_id: string; filename: string; type: string; size: number; url: string; kind?: string; pinned?: boolean; created_at?: string; } export interface QuizQuestion { id: string; type: 'mcq' | 'true_false' | 'numeric'; prompt: string; choices?: string[]; unit?: string; } export interface QuizPayload { quiz_id: string; title: string; course: string; topic: string; difficulty: string; questions: QuizQuestion[]; sources?: { module: string; section: string; url: string }[]; } export interface QuizResult { score: number; correct: number; total: number; results: { id: string; correct: boolean; given: unknown; answer: unknown; explanation: string; unit?: string }[]; }