/** * Supabase Database Schema Types * * TypeScript type definitions for database tables used in the slide presentation system. * These types are shared between TypeScript and Python codebases via code generation. * * @module @buzztrail/shared/types/supabase */ /** * Status values for conversation sessions */ export type ConversationSessionStatus = | 'generating_deck' | 'deck_ready' | 'bot_active' | 'completed' | 'error'; /** * Conversation session record * * Represents an active Tavus conversation session with associated deck generation * and bot lifecycle. */ export interface ConversationSession { /** Unique session identifier */ id: string; /** Tavus conversation ID for video interaction */ tavus_conversation_id: string; /** Daily.co room URL for video conferencing */ daily_room_url: string; /** Current session status */ status: ConversationSessionStatus; /** Timestamp when session was created */ created_at: string; /** Timestamp when session was last updated */ updated_at: string; } /** * Slidev deck record * * Represents a generated Slidev presentation deck. */ export interface SlidevDeck { /** Unique database record identifier */ id: string; /** Human-readable deck identifier */ deck_id: string; /** Associated session ID (optional, for session-linked decks) */ session_id?: string; /** GitHub Pages URL where deck is published */ github_url: string; /** Template ID used for deck generation */ template_id: string; /** Additional generation data (flexible JSON field) */ generation_data?: Record; /** Timestamp when deck was created */ created_at: string; /** Timestamp when deck was last updated */ updated_at: string; } /** * Slide control command types */ export type SlideControlCommandType = | 'next' | 'prev' | 'goto' | 'sync' | 'reload'; /** * Slide control command record * * Commands sent to control slide navigation during presentations. */ export interface SlideControlCommand { /** Unique command identifier */ id: string; /** Associated session ID */ session_id: string; /** Command type */ command: SlideControlCommandType; /** Target slide number (for 'goto' command) */ slide_number?: number; /** Timestamp when command was created */ created_at: string; } /** * Active bot database record * * Tracks active bot processes for presentation sessions. * This is the database schema - for application-level types, use types from bot.ts */ export interface ActiveBotRow { /** Unique bot identifier */ bot_id: string; /** Bot type (screenshare, screenshare_livekit, tool-forwarder, or voice-agent) */ bot_type: 'screenshare' | 'screenshare_livekit' | 'tool-forwarder' | 'voice-agent'; /** Operating system process ID */ pid: number; /** Associated session ID */ session_id: string; /** Daily.co room URL */ room_url: string; /** Slidev deck URL (for screenshare bots) */ deck_url?: string; /** Current bot status */ status: 'spawning' | 'running' | 'stopping' | 'stopped' | 'error'; /** Timestamp when bot was spawned */ spawned_at: string; /** Timestamp when bot was stopped */ stopped_at?: string; /** Error message if bot failed */ error_message?: string; /** Path to bot log file */ log_file_path?: string; /** Timestamp when record was created */ created_at: string; /** Timestamp when record was last updated */ updated_at: string; } /** * Supabase Database Schema * * Type-safe database interface for all tables. */ export interface Database { public: { Tables: { conversation_sessions: { Row: ConversationSession; Insert: Omit; Update: Partial>; }; slidev_decks: { Row: SlidevDeck; Insert: Omit; Update: Partial>; }; slide_control_commands: { Row: SlideControlCommand; Insert: Omit; Update: Partial>; }; active_bots: { Row: ActiveBotRow; Insert: Omit; Update: Partial>; }; }; }; }