/** * Chat session types */ export interface ChatSession { id: string title: string createdAt: Date updatedAt: Date messages: ChatMessage[] agent: Agent projectId?: string // Associated project if any } export interface ChatMessage { id: string role: "user" | "assistant" | "system" content: string timestamp: Date agent?: Agent error?: string metadata?: { model?: string tokens?: number processingTime?: number } } export type Agent = "claude-4-opus" | "claude-4-sonnet" | "gpt-4" | "gpt-4o" | "gpt-3.5-turbo" | "o3" export interface ChatListItem { id: string title: string lastMessage?: string lastMessageAt?: Date messageCount: number } export interface ChatTimelineContext { projectName?: string projectDuration?: number selectedClips?: Array<{ id: string name: string startTime: number duration: number }> selectedTracks?: Array<{ id: string name: string type: "video" | "audio" }> currentTime?: number effects?: string[] filters?: string[] } export interface ChatStorageService { // Session management createSession(title?: string): Promise getSession(id: string): Promise getAllSessions(): Promise updateSession(id: string, updates: Partial): Promise deleteSession(id: string): Promise // Message management addMessage(sessionId: string, message: Omit): Promise updateMessage(sessionId: string, messageId: string, updates: Partial): Promise deleteMessage(sessionId: string, messageId: string): Promise // Search searchSessions(query: string): Promise // Export/Import exportSession(id: string): Promise // JSON string importSession(data: string): Promise } export interface AIService { sendMessage( message: string, context?: ChatTimelineContext, options?: { stream?: boolean maxTokens?: number temperature?: number }, ): Promise | string> isConfigured(): boolean getAvailableModels(): string[] }