# Edición de textos de cápsulas / Capsule text editing

ES: En Stock, «Abrir en AINimation» recupera el guion guardado de las cápsulas con `externalRef=capsula-url:<hash>`. El editor muestra título, subtítulo, gancho, giro, remate, fuente, idea, tema y cifra. «Guardar borrador» guarda sólo en este navegador; «Recuperar original» descarta ese borrador. La vista de composición se actualiza mientras escribes: pulsa el titular o la frase para editar encima del contenido, o usa los campos. Puedes revisar horizontal/vertical y las escenas de entrada, cuerpo y cierre; las cartelas sólo se generan si están activadas. La comparación muestra cada valor original y su borrador sin modificar el original. El vídeo original se conserva aparte como referencia. La vista del navegador no promete identidad de píxeles con el render: ajuste tipográfico y animaciones finales se resuelven al generar. «Generar nueva versión y sincronizar» requiere la clave del Stock y encola el guion en el renderizador existente. La clave sólo viaja en una cabecera y no se guarda. La versión anterior se conserva; cuando se publica la nueva se oculta la anterior por orientación. Las dos orientaciones deben terminar para anunciar «publicada». La cola depende del renderizador de GrokBotBox; no se promete una hora de entrega. Los vídeos sin proyecto original siguen importándose al Cast y no ofrecen edición de su texto incrustado.

EN: In Stock, “Open in AINimation” loads the saved script for capsules with `externalRef=capsula-url:<hash>`. Edit the card title, subtitle, hook, twist, payoff, credit, idea, topic and figure. “Save draft” stores changes only in this browser; “Restore original” discards the draft. The composition preview updates while typing: click the headline or sentence to edit on content, or use the fields. Review landscape/portrait and opening/body/closing scenes; cards render only when enabled. The comparison shows original and draft values without modifying the original. The original video remains available separately. Browser preview is not a pixel-exact export guarantee: final typography and animations are resolved during rendering. “Render new version and sync” requires the Stock key and queues the script for the existing renderer. The key travels only in a request header and is never stored. Previous assets are retained and hidden per orientation when replacements publish. Both orientations must finish before status reports “published”. Rendering depends on GrokBotBox availability; no completion time is promised. Videos without a saved project still import into Cast without editing their embedded text.

## Contract

`GET https://api.admira.store/capsula/url/director?ref=capsula-url:<16 hex>` returns the exact `guion`, `cartelas`, `capsuleVersion`, opaque `revision` and current publication state. No prompt extraction or new AI synthesis is used.

`POST` to the same URL accepts `{revision, guion, cartelas}` with `Content-Type: application/json` and the existing Stock authorization (`X-Notify-Key` or internal ingest header). A matching revision and completed previous render are required. It archives the previous job, preserves source/media parameters, and conditionally updates the queue using the R2 ETag. Replies: `202` queued; `401` unauthorized; `409 revision-conflict`, `render-in-progress` or `version-limit`; `400` invalid script. No shared content changes while typing or saving a local draft.

MCP: this is an HTTP/browser workflow; no new MCP tool is claimed. Agents can inspect the contract and use the existing authenticated API. Do not put keys in URLs, prompts or repository files.

## Live preview / Vista en directo

`GET /capsula/url/preview?ref=…&version=N` returns a version-bound `admira.capsule-preview.v1` manifest with a separate media track, its aspect ratio and `sourceVersion`. Missing tracks return `404 preview-not-ready`; the editor keeps comparison/form editing available and explicitly reports the absence. Authenticated `PUT` uploads MP4 media (32 MiB maximum) with `X-Capsule-Aspect`. It never publishes a Stock asset or changes the saved script. Tracks use content-addressed URLs. Text-only Director revisions reuse the same source track, while keeping their own version-bound manifest.

ES: La cápsula Depredador v8 dispone de pista para edición. Al ser histórica, su vídeo central se recupera de la versión horizontal publicada y se retiran las barras de progreso; el original no se modifica. Para nuevas cápsulas está preparado `tools/capsulas-sabiasque/editor_preview.py`: exporta el b-roll limpio y lo sube con la credencial de Stock existente en una cabecera. Debe instalarse con `capsula_cola.py` en el renderizador y tener `ADMIRANEXT_INGEST_TOKEN` o `NOTIFY_KEY`; la instalación remota en GrokBotBox no se ha verificado en esta entrega (SSH no accesible). No se anuncia cobertura automática de todas las cápsulas.

EN: The Predator v8 capsule has an editing track. For this historical asset, its central video is recovered from the published landscape version and progress bars are removed; the original is untouched. New-capsule support is prepared in `tools/capsulas-sabiasque/editor_preview.py`: export clean b-roll and upload using the existing Stock credential in a request header. Install it with `capsula_cola.py` on the renderer and provide `ADMIRANEXT_INGEST_TOKEN` or `NOTIFY_KEY`; remote GrokBotBox installation was not verified in this delivery (SSH unavailable). Automatic coverage of all capsules is not claimed.


## Edición integrada / Inline editing

ES: «Editar con Ainimation» en el detalle de Stock abre la edición en la misma pantalla, a la izquierda del enlace externo existente. [Guía y contrato](capsule-inline-editor.md).

EN: “Edit with Ainimation” in Stock detail opens editing in the same screen, immediately before the existing external link. [Guide and contract](capsule-inline-editor.md).
