/** * API Request and Response Types * * TypeScript type definitions for API endpoints in the slide presentation system. * These types ensure type safety across client-server communication. * * @module @buzztrail/shared/types/api */ /** * Slide data for deck generation */ export interface SlideData { /** Slide title */ title: string; /** Slide content (supports Markdown) */ content: string; /** Optional slide layout/theme */ layout?: string; } /** * Request to generate a custom Slidev deck */ export interface GenerateCustomDeckRequest { /** Company name for deck customization */ company: string; /** Array of slide data */ slides: SlideData[]; /** Optional template ID (defaults to 'default' if not provided) */ template_id?: string; /** Optional session ID to associate deck with a conversation */ session_id?: string; } /** * Response from deck generation */ export interface GenerateCustomDeckResponse { /** Generated deck identifier */ deck_id: string; /** GitHub Pages URL where deck is published */ github_url: string; /** Associated session ID (if provided in request) */ session_id?: string; /** Generation timestamp */ created_at: string; } /** * Request to spawn a screenshare bot */ export interface SpawnScreenshareBotRequest { /** Daily.co room URL */ room_url: string; /** Slidev deck URL to present */ deck_url: string; /** Session ID to associate bot with */ session_id: string; /** Optional Daily.co meeting token for authentication */ meeting_token?: string; } /** * Response from bot spawn operation */ export interface SpawnBotResponse { /** Unique bot identifier */ bot_id: string; /** Bot status (typically 'spawning' initially) */ status: string; /** Process ID of spawned bot */ pid?: number; /** Estimated time for bot to join room */ estimated_join_time: string; /** Success message */ message: string; /** Path to bot log file */ log_file?: string; } /** * Request to get bot status */ export interface BotStatusRequest { /** Bot ID to query (optional, if not provided returns all bots) */ bot_id?: string; /** Filter by session ID (optional) */ session_id?: string; } /** * Bot status details */ export interface BotStatusDetails { /** Bot identifier */ bot_id: string; /** Associated session ID */ session_id: string; /** Daily.co room URL */ room_url: string; /** Deck URL (for screenshare bots) */ deck_url?: string; /** Current bot status */ status: string; /** Process ID */ pid: number; /** When bot was spawned */ spawned_at: string; /** When bot was stopped (if applicable) */ stopped_at?: string; /** Error message (if failed) */ error?: string; /** Log file path */ log_file?: string; /** Whether the process is still alive */ is_process_alive?: boolean; } /** * Response from bot status query */ export interface BotStatusResponse { /** Single bot status (when querying specific bot) */ bot?: BotStatusDetails; /** Multiple bot statuses (when querying all bots) */ bots?: BotStatusDetails[]; /** Count of active bots */ active_count?: number; } /** * Request to kill a bot */ export interface KillBotRequest { /** Bot ID to kill */ bot_id: string; } /** * Response from bot kill operation */ export interface KillBotResponse { /** Success message */ message: string; /** Bot ID that was killed */ bot_id: string; /** Updated status */ status: string; } /** * Request to spawn a Tavus tool forwarder bot */ export interface SpawnTavusToolForwarderRequest { /** Daily.co room URL */ room_url: string; /** Session ID to associate bot with */ session_id: string; /** Optional Daily.co meeting token */ meeting_token?: string; /** Optional webhook URL for tool responses */ webhook_url?: string; } /** * Slide control request */ export interface SlideControlRequest { /** Session ID */ session_id: string; /** Command type */ command: 'next' | 'prev' | 'goto' | 'sync' | 'reload'; /** Target slide number (required for 'goto' command) */ slide_number?: number; } /** * Slide control response */ export interface SlideControlResponse { /** Success indicator */ success: boolean; /** Command that was executed */ command: string; /** Current slide number after command */ current_slide?: number; /** Error message if failed */ error?: string; } /** * Error response structure */ export interface ApiErrorResponse { /** Error type/category */ error: string; /** Detailed error message */ details?: string; /** Validation errors (field-specific) */ validation_errors?: Record; /** HTTP status code */ status?: number; }