🎬 Video Generation — Runway Gen-3 + card embebida
Feature 5/7 del roadmap. Nueva tool de generación de video usando Runway Gen-3 (text-to-video, 5-10s, 16:9/9:16/1:1). Toggle en el menú del ChatInput debajo de "Generar Imagen". El video se renderiza embebido en una card con descarga + abrir + estados loading/error.
Nuevo
- 🎬 Tool video-generation provider-agnostic (Runway/Sora/Veo/Luma)
- 📦 meta_json.video_generation persistido en el assistant message
- 🚨 Si falta RUNWAY_API_KEY: status skipped + mensaje en systemPromptAddition
- 🧪 Typecheck verde
Mejorado
- ⚡ Default: Runway Gen-3 (RUNWAY_API_KEY) con polling 60s + fallback "processing"
Arreglado
- 🎨 VideoGenerationCard: header gradient + <video> embebido + descarga + abrir + estados ready/processing/error
Seguridad
- 🪪 Toggle "Generar Video" en el menú de tools (sólo si tiene permiso de imageGeneration)
Nuevo: src/lib/server/chat/tools/video-generation.ts
- runVideoGenerationTool({ prompt, durationSec, aspectRatio })
- runRunwayGeneration: POST /v1/text_to_video → poll /v1/tasks/{id}
- Devuelve { status: ready | processing | error, video_url, thumbnail_url, provider, prompt, duration_s, task_id, error }
- Sin API key → status: skipped (no bloquea, informa al LLM)
Nuevo: src/components/chat/VideoGenerationCard.tsx
- 3 estados: ready (video embebido + downloads), processing (loader), error (rojo + sugerencia)
- Botón descarga via fetch + Blob + a.click
- Botón abrir en pestaña nueva
Integración chat
- chat-store: videoGeneration boolean + setVideoGeneration
- src/app/api/chat/route.ts: parámetro video_generation + effectiveVideoGeneration + invocación + persistencia
- src/components/chat/ChatInput.tsx: toggle "Generar Video" en menú desktop (icono Film)
- src/components/chat/MessageBubble.tsx: getter videoGenerationMeta + render VideoGenerationCard
Configuración requerida
- Env var: RUNWAY_API_KEY (https://app.runwayml.com/account)
- Pricing aproximado: ~$0.05/segundo de video Gen-3 turbo
- Sin la env var, la tool devuelve "skipped" + el LLM informa al user
