/** * Storage Provider Abstraction * * Provides a unified interface for storing generated assets to: * - Local filesystem (development) * - Supabase Storage (production) * - GCP Cloud Storage (alternative) * * Security Model: * - Only RunPod (write) and Jump Box (read/write) have direct bucket access * - All other clients get signed URLs via Jump Box API */ export interface StorageObject { /** Filename without path */ name: string; /** Full path in storage */ path: string; /** File size in bytes */ size: number; /** MIME type */ contentType: string; /** Creation timestamp */ created: Date; /** Optional metadata */ metadata?: Record; } export interface UploadResult { /** Path in storage (relative to bucket root) */ path: string; /** Public URL if available, null for local storage */ url: string | null; /** Signed URL for private buckets (time-limited access) */ signedUrl?: string; /** Size in bytes */ size: number; } /** Options for viewing/downloading results */ export interface ViewOptions { /** Auto-open in browser after generation (default: false on headless, true on desktop) */ autoOpen?: boolean; /** Download to local path (default: true on desktop, false on headless) */ download?: boolean; /** Local download path (default: ./output/) */ downloadPath?: string; } /** Detect if running in headless environment */ export declare function isHeadless(): boolean; /** Get default view options based on environment */ export declare function getDefaultViewOptions(): ViewOptions; export interface HealthCheckResult { ok: boolean; error?: string; /** Provider-specific details */ details?: Record; } /** * Storage provider interface * * All implementations must handle: * - Large files (videos up to several GB) * - Binary content (images, audio, video) * - Concurrent uploads */ export interface StorageProvider { /** Provider name for logging/debugging */ readonly name: string; /** * Upload a local file to remote storage * @param localPath - Absolute path to local file * @param remotePath - Destination path in storage (e.g., "videos/output.mp4") * @returns Upload result with path and URL */ upload(localPath: string, remotePath: string): Promise; /** * Download a remote file to local path * @param remotePath - Path in storage * @param localPath - Destination local path */ download(remotePath: string, localPath: string): Promise; /** * List objects with a given prefix * @param prefix - Path prefix (e.g., "videos/" or "") * @returns Array of storage objects */ list(prefix: string): Promise; /** * Generate a signed URL for temporary access * @param remotePath - Path in storage * @param expiresInSeconds - URL validity duration (default: 3600 = 1 hour) * @returns Signed URL string */ getSignedUrl(remotePath: string, expiresInSeconds?: number): Promise; /** * Check if the storage provider is configured and accessible * @returns Health check result */ healthCheck(): Promise; /** * Delete a file from storage * @param remotePath - Path to delete */ delete(remotePath: string): Promise; /** * Check if a file exists * @param remotePath - Path to check */ exists(remotePath: string): Promise; } /** * Storage provider type identifier */ export type StorageProviderType = "local" | "supabase" | "gcp"; /** * Configuration for storage providers */ export interface StorageConfig { provider: StorageProviderType; localBasePath?: string; supabaseUrl?: string; supabaseServiceKey?: string; supabaseBucket?: string; gcpProjectId?: string; gcpBucket?: string; gcpKeyFile?: string; outputPrefix?: string; } /** * Get storage config from environment variables */ export declare function getStorageConfigFromEnv(): StorageConfig;