export interface WidgetConfig { uuid: string; theme: 'light' | 'dark'; position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'; size: { width: number; height: number; }; title: string; subtitle?: string; placeholder?: string; welcomeMessage?: string; apiUrl: string; apiKey: string; themeColor?: string; defaultOpen?: boolean; supabaseUrl?: string; supabaseAnonKey?: string; userContext?: Record; } export interface ChatMessage { id: string; content: string; role: 'user' | 'assistant' | 'system'; type?: 'user' | 'assistant' | 'agent' | 'system'; timestamp: Date; sources?: ChatSource[]; validation?: { confidence: number; valid: boolean; status: string; accuracy?: { verified: boolean; verification_rate: number; reason?: string; }; hallucination?: { detected: boolean; risk: number; reason?: string; }; context?: { source_relevance: number; source_usage_rate: number; valid: boolean; }; }; _realUuid?: string; } export interface ChatSource { document_uuid: string; document_title: string; chunk_indices: number[]; title?: string; url?: string; content?: string; } export interface ChatState { messages: ChatMessage[]; isLoading: boolean; error?: string; isOpen: boolean; } export interface AssistantServerResponse { message: string; sources?: ChatSource[]; conversationId?: string; } export interface WidgetProps { config: WidgetConfig; onMessage?: (message: ChatMessage) => void; onError?: (error: string) => void; } export interface EnvConfig { VITE_ASSISTANT_SERVER_URL: string; VITE_ASSISTANT_SERVER_API_KEY: string; VITE_DEV_MODE: boolean; VITE_DEBUG_MODE: boolean; }