diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000000000000000000000000000000000000..19ac75d90a198a54886fcf3ad51671ce1b29de85
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,17 @@
+.git
+.venv
+node_modules
+frontend/node_modules
+frontend/dist
+frontend/test-results
+frontend/playwright-report
+.env
+.env.*
+assets
+data
+model_weights
+deliverables
+__pycache__
+**/__pycache__
+.pytest_cache
+.ruff_cache
diff --git a/.gitattributes b/.gitattributes
index a6344aac8c09253b3b630fb776ae94478aa0275b..2fc8eb2a29c0f38e7dbad59648fe82e89e717002 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
+*.png filter=lfs diff=lfs merge=lfs -text
+*.jpg filter=lfs diff=lfs merge=lfs -text
+*.jpeg filter=lfs diff=lfs merge=lfs -text
+*.wav filter=lfs diff=lfs merge=lfs -text
+*.mp4 filter=lfs diff=lfs merge=lfs -text
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..6d992bdb809d50846af2bef62d865cdaf4ed0e04
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,32 @@
+
+
+#Ignore vscode AI rules
+.github/instructions/codacy.instructions.md
+
+# Python and local settings
+__pycache__/
+*.py[cod]
+.venv/
+.pytest_cache/
+.env
+.env.*
+!.env.example
+
+# Generated assets and model weights
+assets/**/*
+!assets/**/
+!assets/**/.gitkeep
+model_weights/*
+!model_weights/.gitkeep
+data/*
+!data/.gitkeep
+
+# Monorepo build and test artifacts
+node_modules/
+frontend/dist/
+frontend/test-results/
+frontend/playwright-report/
+*.tsbuildinfo
+.ruff_cache/
+worker-heartbeat.json
+backend/.pytest_cache/
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000000000000000000000000000000000..a089295a5b7e2b8a514d06d65236e356c35e55e9
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,52 @@
+# Hugging Face Docker Space. Inference runs only on the assigned GPU at runtime.
+FROM node:22-bookworm AS frontend
+WORKDIR /workspace
+COPY package.json package-lock.json ./
+COPY frontend/package.json frontend/package.json
+RUN npm ci
+COPY frontend frontend
+RUN npm run build
+
+FROM python:3.10-slim-bookworm
+WORKDIR /workspace
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ git wget ffmpeg espeak-ng libsndfile1 libgl1 libglib2.0-0 build-essential \
+ && rm -rf /var/lib/apt/lists/*
+
+# SadTalker's older dependencies stay separate from Kokoro and FastAPI.
+ARG SADTALKER_REF=cd4c0465ae0b54a6f85af57f5c65fec9fe23e7f8
+RUN git clone https://github.com/OpenTalker/SadTalker.git /opt/SadTalker \
+ && cd /opt/SadTalker && git checkout "$SADTALKER_REF"
+COPY backend/model_services/requirements-sadtalker.txt /tmp/requirements-sadtalker.txt
+RUN python -m venv /opt/sadtalker-venv \
+ && /opt/sadtalker-venv/bin/pip install --no-cache-dir 'setuptools<70' wheel \
+ && /opt/sadtalker-venv/bin/pip install --no-cache-dir \
+ torch==1.13.1+cu117 torchvision==0.14.1+cu117 \
+ --extra-index-url https://download.pytorch.org/whl/cu117 \
+ && /opt/sadtalker-venv/bin/pip install --no-cache-dir --no-build-isolation -r /tmp/requirements-sadtalker.txt
+RUN cd /opt/SadTalker && bash scripts/download_models.sh \
+ && test -s checkpoints/SadTalker_V0.0.2_256.safetensors \
+ && test -s checkpoints/mapping_00109-model.pth.tar
+
+COPY backend/requirements.txt backend/requirements.txt
+COPY backend/model_services/requirements-lightweight.txt backend/model_services/requirements-lightweight.txt
+RUN pip install --no-cache-dir torch==2.6.0 --index-url https://download.pytorch.org/whl/cpu \
+ && pip install --no-cache-dir -r backend/requirements.txt -r backend/model_services/requirements-lightweight.txt
+RUN useradd -m -u 1000 studio
+COPY --chown=studio:studio backend backend
+COPY --chown=studio:studio scripts scripts
+COPY --from=frontend --chown=studio:studio /workspace/frontend/dist frontend/dist
+# /workspace itself must be writable: the worker heartbeat is written beside
+# ASSETS_DIR, and /data is pre-created so persistent-storage overrides work.
+RUN mkdir -p data assets /home/studio/.cache /data \
+ && chown studio:studio /workspace /data \
+ && chown -R studio:studio data assets /home/studio/.cache /opt/SadTalker
+USER studio
+ENV PYTHONUNBUFFERED=1 PYTHONPATH=/workspace/backend HOST=0.0.0.0 PORT=7860 \
+ DATABASE_URL=sqlite:////workspace/data/app.db ASSETS_DIR=/workspace/assets \
+ START_MODEL_SERVICE=true ENABLE_ANIMATED_RENDERS=true ENABLE_AI_DRAFTS=false \
+ SPEECH_PROVIDER=kokoro VIDEO_PROVIDER=sadtalker OLLAMA_URL="" \
+ SADTALKER_ROOT=/opt/SadTalker SADTALKER_PYTHON=/opt/sadtalker-venv/bin/python \
+ PROVIDER_TIMEOUT=14400 VIDEO_TIMEOUT=3600 HF_HOME=/home/studio/.cache/huggingface
+EXPOSE 7860
+CMD ["python", "scripts/start.py"]
diff --git a/README.md b/README.md
index 0e5f8da9093f525fa804b7729ee7be4fec7cc39e..029cb3136194fe818adbfe0f45be492e1f8b1e96 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,65 @@
---
title: Character Studio
-emoji: ⚡
-colorFrom: blue
-colorTo: gray
+emoji: 🎬
+colorFrom: purple
+colorTo: pink
sdk: docker
+app_port: 7860
pinned: false
-license: mit
---
-Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
+# Character Studio
+
+A React/Vite + FastAPI MVP using two fixed fictional characters and the included generated image.
+The UI is a single Studio page: write exact dialogue, save/approve it, create a preview and download the result.
+Image uploads, character editing, Settings and Videos pages are not exposed.
+
+## Current small-model pipeline
+
+**Written dialogue → Kokoro-82M → SadTalker → FFmpeg.** No Ollama, voice recordings or external AI API keys are required.
+R.Royale and Summer Breeze use different saved voice presets. Each portrait is animated independently and shown beside the other; natural shared reactions, body gestures and detailed dialect controls are not implemented.
+
+The root Dockerfile prepares the frontend, backend and bundled model service for a Hugging Face NVIDIA GPU Space.
+It does not run tests or inference at build time. The talking-video button requires model-service readiness.
+**Remote Docker build and GPU output quality remain unverified.** See [deployment steps and limitations](docs/lightweight-mvp.md).
+
+## Structure
+
+```text
+backend/app/
+ characters/ # saved character profiles, voice presets
+ conversations/ # creator-written dialogue; optional AI adapter
+ scenes/ # fixed cast and reference image
+ generations/ # immutable input snapshots, queue, worker
+ assets/ # asset records and downloads
+ ai/ # provider factory and replaceable model adapters
+ shared/ # storage, audio alignment, FFmpeg export
+ system/ # availability checks
+backend/model_services/ # Kokoro/SadTalker service; legacy model adapters
+backend/demo_assets/ # fixed generated scene
+frontend/src/
+ app/ # app shell and styles
+ features/ # Studio, dialogue and scene components
+ shared/ # API client, types and common components
+scripts/start.py # supervises API, worker and optional model service
+docs/lightweight-mvp.md # deployment and current capability details
+```
+
+Backend modules use controller/service/repository/model/schema files. ML models use provider files.
+The local SQLite database is created automatically; no separate database server is needed.
+Attach persistent storage on Hugging Face if scripts and outputs must survive a rebuild.
+
+## Frontend development
+
+```sh
+npm ci
+npm run dev
+```
+
+Vite proxies `/api` to the backend. Build with `npm run build`.
+For backend-only development, install `backend/requirements.txt`, copy `.env.example` to `.env`,
+and run `python scripts/start.py` with the backend virtual environment active.
+Local defaults disable model inference; the GPU Docker deployment supplies its own defaults.
+
+Legacy test files and heavier model adapters remain in the repository. Tests have not been updated or run for this simplified MVP.
+The older [model-services document](docs/model-services.md) and [requirements coverage](docs/requirements-coverage.md) describe the previous heavier design; use the lightweight guide for the current implementation.
diff --git a/backend/app/__init__.py b/backend/app/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/app/ai/__init__.py b/backend/app/ai/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/app/ai/chatterbox_provider.py b/backend/app/ai/chatterbox_provider.py
new file mode 100644
index 0000000000000000000000000000000000000000..5092e6a0fdba02afbc997f55bb4dcbb5533a28f6
--- /dev/null
+++ b/backend/app/ai/chatterbox_provider.py
@@ -0,0 +1,33 @@
+from pathlib import Path
+import httpx
+from app.config import settings
+
+
+class ChatterboxProvider:
+ def synthesize(
+ self,
+ text: str,
+ voice_reference: Path,
+ output_path: Path,
+ profile: dict | None = None,
+ ) -> Path:
+ if not settings.speech_url:
+ raise RuntimeError(
+ "Configure SPEECH_URL and start the Chatterbox model service"
+ )
+ with voice_reference.open("rb") as voice:
+ response = httpx.post(
+ settings.speech_url.rstrip("/") + "/synthesize",
+ files={"reference": ("voice.wav", voice, "audio/wav")},
+ data={
+ "text": text,
+ "expressiveness": str((profile or {}).get("expressiveness", 0.5)),
+ },
+ headers={"Authorization": f"Bearer {settings.provider_token}"},
+ timeout=settings.provider_timeout,
+ )
+ response.raise_for_status()
+ if len(response.content) > 50_000_000:
+ raise RuntimeError("Speech response exceeds size limit")
+ output_path.write_bytes(response.content)
+ return output_path
diff --git a/backend/app/ai/dialogue_provider.py b/backend/app/ai/dialogue_provider.py
new file mode 100644
index 0000000000000000000000000000000000000000..31b71929a031a2af9dddea4eb6c728bec117960c
--- /dev/null
+++ b/backend/app/ai/dialogue_provider.py
@@ -0,0 +1,7 @@
+from typing import Protocol
+
+
+class DialogueProvider(Protocol):
+ def generate(self, prompt: str, profiles: list[dict]) -> list[dict[str, str]]:
+ """Return dialogue turns containing character_id and text."""
+ ...
diff --git a/backend/app/ai/infinitetalk_provider.py b/backend/app/ai/infinitetalk_provider.py
new file mode 100644
index 0000000000000000000000000000000000000000..f2e5cb95c676c5ee845e668b1756e2519f46f499
--- /dev/null
+++ b/backend/app/ai/infinitetalk_provider.py
@@ -0,0 +1,5 @@
+from app.ai.video_http_provider import VideoHttpProvider
+
+
+class InfiniteTalkProvider(VideoHttpProvider):
+ """Shared-scene video generation via the InfiniteTalk service."""
diff --git a/backend/app/ai/kokoro_provider.py b/backend/app/ai/kokoro_provider.py
new file mode 100644
index 0000000000000000000000000000000000000000..2bc7e3076df6f81859d8095e98875376e0a99940
--- /dev/null
+++ b/backend/app/ai/kokoro_provider.py
@@ -0,0 +1,27 @@
+from pathlib import Path
+import httpx
+from app.config import settings
+
+
+class KokoroProvider:
+ def synthesize(
+ self,
+ text: str,
+ voice_reference: Path | None,
+ output_path: Path,
+ profile: dict | None = None,
+ ) -> Path:
+ response = httpx.post(
+ settings.speech_url.rstrip("/") + "/synthesize",
+ data={
+ "text": text,
+ "voice": (profile or {}).get("voice_preset", "af_heart"),
+ },
+ headers={"Authorization": f"Bearer {settings.provider_token}"},
+ timeout=settings.provider_timeout,
+ )
+ response.raise_for_status()
+ if len(response.content) > 50_000_000:
+ raise RuntimeError("Speech response exceeds size limit")
+ output_path.write_bytes(response.content)
+ return output_path
diff --git a/backend/app/ai/provider_factory.py b/backend/app/ai/provider_factory.py
new file mode 100644
index 0000000000000000000000000000000000000000..104aa17b64e0d172c004e10bb2c91085ac6df590
--- /dev/null
+++ b/backend/app/ai/provider_factory.py
@@ -0,0 +1,20 @@
+from app.ai.chatterbox_provider import ChatterboxProvider
+from app.ai.kokoro_provider import KokoroProvider
+from app.ai.infinitetalk_provider import InfiniteTalkProvider
+from app.ai.sadtalker_provider import SadTalkerProvider
+
+
+def speech_provider(name):
+ if name == "kokoro":
+ return KokoroProvider()
+ if name == "chatterbox":
+ return ChatterboxProvider()
+ raise ValueError(f"Unsupported speech provider: {name}")
+
+
+def video_provider(name):
+ if name == "sadtalker":
+ return SadTalkerProvider()
+ if name == "infinitetalk":
+ return InfiniteTalkProvider()
+ raise ValueError(f"Unsupported video provider: {name}")
diff --git a/backend/app/ai/provider_readiness.py b/backend/app/ai/provider_readiness.py
new file mode 100644
index 0000000000000000000000000000000000000000..0df4005337df1ee6a3deca6d8a0be9c365ae3db6
--- /dev/null
+++ b/backend/app/ai/provider_readiness.py
@@ -0,0 +1,32 @@
+import time
+import httpx
+from app.config import settings
+
+_cached_at = 0.0
+_cached_ready = False
+
+
+def lightweight_ready():
+ """Short readiness cache; configuration alone must not enable rendering."""
+ global _cached_at, _cached_ready
+ if time.monotonic() - _cached_at < 10:
+ return _cached_ready
+ _cached_ready = False
+ try:
+ for url in {settings.speech_url, settings.video_url}:
+ if not url:
+ return False
+ response = httpx.get(
+ url.rstrip("/") + "/health",
+ headers={"Authorization": f"Bearer {settings.provider_token}"},
+ timeout=5,
+ )
+ response.raise_for_status()
+ if response.json().get("model") != "kokoro+sadtalker":
+ return False
+ _cached_ready = True
+ except (httpx.HTTPError, ValueError):
+ pass
+ finally:
+ _cached_at = time.monotonic()
+ return _cached_ready
diff --git a/backend/app/ai/qwen_provider.py b/backend/app/ai/qwen_provider.py
new file mode 100644
index 0000000000000000000000000000000000000000..fe25d5fd043082a8569885011652bb66ac1b9c7f
--- /dev/null
+++ b/backend/app/ai/qwen_provider.py
@@ -0,0 +1,41 @@
+import json
+import httpx
+from fastapi import HTTPException
+from pydantic import ValidationError
+from app.config import settings
+from app.conversations.conversation_schema import DialogueTurn
+
+
+class QwenProvider:
+ def generate(self, prompt: str, profiles: list[dict]) -> list[dict]:
+ system = (
+ "Write an original approximately 120-word conversation. Return JSON {turns: [{character_id, text, direction, pause_after}]}. Use exactly the supplied character IDs and both characters. Honor each profile. Do not infer dialect from race. No impersonation. Profiles: "
+ + json.dumps(profiles)
+ )
+ try:
+ response = httpx.post(
+ settings.ollama_url.rstrip("/") + "/api/chat",
+ json={
+ "model": settings.dialogue_model,
+ "stream": False,
+ "format": "json",
+ "messages": [
+ {"role": "system", "content": system},
+ {"role": "user", "content": prompt},
+ ],
+ },
+ timeout=120,
+ )
+ response.raise_for_status()
+ turns = json.loads(response.json()["message"]["content"])["turns"]
+ if not 2 <= len(turns) <= 40:
+ raise ValueError("Invalid turn count")
+ result = [DialogueTurn.model_validate(t).model_dump() for t in turns]
+ if {t["character_id"] for t in result} != {p["id"] for p in profiles}:
+ raise ValueError("Invalid speaker IDs")
+ return result
+ except (httpx.HTTPError, KeyError, ValueError, ValidationError) as exc:
+ raise HTTPException(
+ 503,
+ "Dialogue provider unavailable or returned an invalid draft. Start Ollama, install the configured Qwen model, or use creator-written dialogue.",
+ ) from exc
diff --git a/backend/app/ai/sadtalker_provider.py b/backend/app/ai/sadtalker_provider.py
new file mode 100644
index 0000000000000000000000000000000000000000..333d718c845a4fb1c6afb64726c8eb644c6a5c57
--- /dev/null
+++ b/backend/app/ai/sadtalker_provider.py
@@ -0,0 +1,9 @@
+from app.ai.video_http_provider import VideoHttpProvider
+
+
+class SadTalkerProvider(VideoHttpProvider):
+ """Same multipart transport: fixed scene, two aligned WAVs, output MP4.
+
+ The service splits the scene, animates each portrait and composes the result.
+ Text performance directions are deliberately not interpreted by SadTalker.
+ """
diff --git a/backend/app/ai/speech_provider.py b/backend/app/ai/speech_provider.py
new file mode 100644
index 0000000000000000000000000000000000000000..36a3e162df8df98c2be372f65c92f46b99c939cc
--- /dev/null
+++ b/backend/app/ai/speech_provider.py
@@ -0,0 +1,8 @@
+from pathlib import Path
+from typing import Protocol
+
+
+class SpeechProvider(Protocol):
+ def synthesize(self, text: str, voice_reference: Path, output_path: Path) -> Path:
+ """Generate speech using an authorized voice reference."""
+ ...
diff --git a/backend/app/ai/video_http_provider.py b/backend/app/ai/video_http_provider.py
new file mode 100644
index 0000000000000000000000000000000000000000..fc13501fd57e32904d02880aa3ffd39fe424c038
--- /dev/null
+++ b/backend/app/ai/video_http_provider.py
@@ -0,0 +1,51 @@
+from pathlib import Path
+from contextlib import ExitStack
+import httpx
+from app.config import settings
+
+
+class VideoHttpProvider:
+ def generate(
+ self,
+ scene_image: Path,
+ audio_tracks: list[Path],
+ output_path: Path,
+ prompt: str = "",
+ ) -> Path:
+ if not settings.video_url:
+ raise RuntimeError(
+ "Configure VIDEO_URL and start the selected video model service"
+ )
+ with ExitStack() as stack:
+ files = {
+ "image": (
+ scene_image.name,
+ stack.enter_context(scene_image.open("rb")),
+ "image/png"
+ if scene_image.suffix.lower() == ".png"
+ else "image/jpeg",
+ )
+ }
+ for index, path in enumerate(audio_tracks):
+ files[f"audio{index + 1}"] = (
+ path.name,
+ stack.enter_context(path.open("rb")),
+ "audio/wav",
+ )
+ with httpx.stream(
+ "POST",
+ settings.video_url.rstrip("/") + "/generate",
+ files=files,
+ data={"prompt": prompt},
+ headers={"Authorization": f"Bearer {settings.provider_token}"},
+ timeout=settings.provider_timeout,
+ ) as response:
+ response.raise_for_status()
+ with output_path.open("wb") as output:
+ size = 0
+ for chunk in response.iter_bytes():
+ size += len(chunk)
+ if size > 500_000_000:
+ raise RuntimeError("Video response exceeds size limit")
+ output.write(chunk)
+ return output_path
diff --git a/backend/app/ai/video_provider.py b/backend/app/ai/video_provider.py
new file mode 100644
index 0000000000000000000000000000000000000000..5ce397941f4e4abad973640103d178cdb92aec3d
--- /dev/null
+++ b/backend/app/ai/video_provider.py
@@ -0,0 +1,10 @@
+from pathlib import Path
+from typing import Protocol
+
+
+class VideoProvider(Protocol):
+ def generate(
+ self, scene_image: Path, audio_tracks: list[Path], output_path: Path
+ ) -> Path:
+ """Animate a shared scene using aligned, per-character audio tracks."""
+ ...
diff --git a/backend/app/assets/__init__.py b/backend/app/assets/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/app/assets/asset_controller.py b/backend/app/assets/asset_controller.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f4fdb3eb76ca7628cb22e33e55241ee2f10d824
--- /dev/null
+++ b/backend/app/assets/asset_controller.py
@@ -0,0 +1,84 @@
+from fastapi import APIRouter, Depends, File, Form, HTTPException, UploadFile
+from fastapi.responses import FileResponse
+from sqlalchemy import select
+from sqlalchemy.orm import Session
+from app.database import get_session
+from app.shared.storage_service import StorageService
+from app.assets.asset_model import Asset
+from app.config import settings
+from app.generations.generation_model import Generation
+
+router = APIRouter(prefix="/assets", tags=["assets"])
+
+
+def serialize(asset):
+ return {
+ "id": asset.id,
+ "kind": asset.kind,
+ "name": asset.original_name,
+ "rights": asset.rights,
+ "rights_note": asset.rights_note,
+ "url": f"/api/v1/assets/{asset.id}/file",
+ "revoked": asset.revoked,
+ }
+
+
+@router.get("")
+def list_assets(db: Session = Depends(get_session)):
+ return [
+ serialize(a) for a in db.scalars(select(Asset).where(Asset.revoked.is_(False)))
+ ]
+
+
+@router.post("", status_code=201)
+async def upload(
+ file: UploadFile = File(...),
+ kind: str = Form(...),
+ rights: str = Form(...),
+ rights_note: str = Form(...),
+ consent: bool = Form(...),
+ db: Session = Depends(get_session),
+):
+ if settings.fixed_demo_mode and kind == "image":
+ raise HTTPException(403, "Image uploads are disabled for this MVP")
+ if not consent:
+ raise HTTPException(422, "Rights confirmation is required")
+ data = await file.read(20 * 1024 * 1024 + 1)
+ if len(data) > 20 * 1024 * 1024:
+ raise HTTPException(413, "Maximum upload is 20 MB")
+ return serialize(
+ StorageService(db).upload(
+ data, file.filename or "asset", kind, rights, rights_note
+ )
+ )
+
+
+@router.get("/{asset_id}/file")
+def download(asset_id: str, db: Session = Depends(get_session)):
+ storage = StorageService(db)
+ asset = storage.get(asset_id)
+ if asset.kind == "video":
+ job = db.scalar(
+ select(Generation).where(Generation.output_asset_id == asset.id)
+ )
+ if job:
+ storage.get(job.settings["scene"]["image_asset_id"], "image")
+ if job.settings["kind"] == "animated":
+ for character in job.settings["characters"]:
+ storage.get(character["voice_asset_id"], "voice")
+ path = storage.path(asset)
+ if not path.is_file():
+ raise HTTPException(404, "Asset file is unavailable")
+ return FileResponse(
+ path, filename=asset.original_name, content_disposition_type="inline"
+ )
+
+
+@router.post("/{asset_id}/revoke")
+def revoke(asset_id: str, db: Session = Depends(get_session)):
+ if settings.fixed_demo_mode and asset_id == "mvp-scene-image":
+ raise HTTPException(403, "The built-in demo image cannot be removed")
+ asset = StorageService(db).get(asset_id)
+ asset.revoked = True
+ db.commit()
+ return {"revoked": True}
diff --git a/backend/app/assets/asset_model.py b/backend/app/assets/asset_model.py
new file mode 100644
index 0000000000000000000000000000000000000000..6fb2b64e5c2c958433f129ae98fe4a05069de94b
--- /dev/null
+++ b/backend/app/assets/asset_model.py
@@ -0,0 +1,13 @@
+from sqlalchemy import String, Boolean
+from sqlalchemy.orm import Mapped, mapped_column
+from app.shared.base_model import Record
+
+
+class Asset(Record):
+ __tablename__ = "assets"
+ kind: Mapped[str] = mapped_column(String(30))
+ path: Mapped[str] = mapped_column(String(500))
+ original_name: Mapped[str] = mapped_column(String(300))
+ rights: Mapped[str] = mapped_column(String(30))
+ rights_note: Mapped[str] = mapped_column(String(2000))
+ revoked: Mapped[bool] = mapped_column(Boolean, default=False)
diff --git a/backend/app/bootstrap.py b/backend/app/bootstrap.py
new file mode 100644
index 0000000000000000000000000000000000000000..a05556a7226646bb13de4d6ee8ce70560b629d89
--- /dev/null
+++ b/backend/app/bootstrap.py
@@ -0,0 +1,127 @@
+from pathlib import Path
+import shutil
+from sqlalchemy.orm import Session
+from app.database import Base, get_engine
+from app.config import settings
+from app.characters.character_model import Character
+from app.assets.asset_model import Asset # noqa: F401
+from app.conversations.conversation_model import Conversation # noqa: F401
+from app.scenes.scene_model import Scene # noqa: F401
+from app.generations.generation_model import Generation # noqa: F401
+from app.characters.character_schema import CharacterProfile
+
+
+def initialize():
+ settings.assets_dir.mkdir(parents=True, exist_ok=True)
+ Base.metadata.create_all(get_engine())
+ if not settings.seed_characters and not settings.fixed_demo_mode:
+ return
+ with Session(get_engine()) as db:
+ profiles = [
+ (
+ "royale",
+ "R.Royale",
+ "Calm presence. A dry sense of humor.",
+ "#b9ace8",
+ "Calm, dry humor, thoughtful and controlled. An original fictional African-American woman.",
+ 0.3,
+ "Small hand movements; attentive eye contact",
+ ),
+ (
+ "summer",
+ "Summer Breeze",
+ "Big energy. A little sunshine.",
+ "#eac391",
+ "Warm, animated, expressive and outgoing. An original fictional African-American woman.",
+ 0.75,
+ "Expressive hands; warm smiles; lively but natural reactions",
+ ),
+ ]
+ for (
+ identity,
+ name,
+ description,
+ color,
+ personality,
+ expression,
+ gestures,
+ ) in profiles:
+ existing = db.get(Character, identity)
+ preset = "af_heart" if identity == "royale" else "af_bella"
+ if existing:
+ if "voice_preset" not in existing.profile:
+ existing.profile = {**existing.profile, "voice_preset": preset}
+ continue
+ profile = CharacterProfile(
+ personality=personality,
+ expressiveness=expression,
+ gestures=gestures,
+ voice_preset=preset,
+ ).model_dump()
+ db.add(
+ Character(
+ id=identity,
+ name=name,
+ description=description,
+ color=color,
+ profile=profile,
+ )
+ )
+ db.commit()
+
+ demo = Path(__file__).resolve().parents[1] / "demo_assets" / "scene.png"
+ if demo.exists() and not db.get(Asset, "demo-scene-image"):
+ target = settings.assets_dir / "scenes" / "original-demo.png"
+ target.parent.mkdir(parents=True, exist_ok=True)
+ shutil.copyfile(demo, target)
+ asset = Asset(
+ id="demo-scene-image",
+ kind="image",
+ path="scenes/original-demo.png",
+ original_name="Original fictional scene.png",
+ rights="original",
+ rights_note="AI-generated fictional reference created for this prototype; creator approval pending",
+ )
+ db.add(asset)
+ db.add(
+ Scene(
+ id="demo-scene",
+ name="The living room",
+ image_asset_id=asset.id,
+ character_ids=["royale", "summer"],
+ prompt="Two women seated together in a warm living room. R.Royale on the left, Summer Breeze on the right. Natural eye contact, subtle gestures and attentive listening while the other speaks.",
+ approved=False,
+ )
+ )
+ db.commit()
+
+ if settings.fixed_demo_mode:
+ if not demo.is_file():
+ raise RuntimeError("The bundled MVP scene image is missing")
+ target = settings.assets_dir / "scenes" / "mvp-original.png"
+ target.parent.mkdir(parents=True, exist_ok=True)
+ if not target.exists():
+ shutil.copyfile(demo, target)
+ if not db.get(Asset, "mvp-scene-image"):
+ db.add(
+ Asset(
+ id="mvp-scene-image",
+ kind="image",
+ path="scenes/mvp-original.png",
+ original_name="R.Royale and Summer Breeze.png",
+ rights="original",
+ rights_note="AI-generated fictional scene selected by the creator for this fixed-image MVP",
+ )
+ )
+ if not db.get(Scene, "mvp-scene"):
+ db.add(
+ Scene(
+ id="mvp-scene",
+ name="The living room",
+ image_asset_id="mvp-scene-image",
+ character_ids=["royale", "summer"],
+ prompt="Two women seated together in a warm living room. R.Royale on the left, Summer Breeze on the right. Natural eye contact, subtle gestures and attentive listening while the other speaks.",
+ approved=True,
+ )
+ )
+ db.commit()
diff --git a/backend/app/characters/__init__.py b/backend/app/characters/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/app/characters/character_controller.py b/backend/app/characters/character_controller.py
new file mode 100644
index 0000000000000000000000000000000000000000..e6178f545c33732338fcdd545b47fdd65296d0f7
--- /dev/null
+++ b/backend/app/characters/character_controller.py
@@ -0,0 +1,28 @@
+from fastapi import APIRouter, Depends
+from sqlalchemy.orm import Session
+from app.database import get_session
+from app.characters.character_repository import CharacterRepository
+from app.characters.character_service import CharacterService
+from app.characters.character_schema import CharacterCreate, CharacterRead
+
+router = APIRouter(prefix="/characters", tags=["characters"])
+
+
+@router.get("", response_model=list[CharacterRead])
+def list_records(db: Session = Depends(get_session)):
+ return CharacterRepository(db).list()
+
+
+@router.post("", response_model=CharacterRead, status_code=201)
+def create(data: CharacterCreate, db: Session = Depends(get_session)):
+ return CharacterService(CharacterRepository(db)).save(data)
+
+
+@router.get("/{record_id}", response_model=CharacterRead)
+def get(record_id: str, db: Session = Depends(get_session)):
+ return CharacterRepository(db).get(record_id)
+
+
+@router.put("/{record_id}", response_model=CharacterRead)
+def update(record_id: str, data: CharacterCreate, db: Session = Depends(get_session)):
+ return CharacterService(CharacterRepository(db)).save(data, record_id)
diff --git a/backend/app/characters/character_model.py b/backend/app/characters/character_model.py
new file mode 100644
index 0000000000000000000000000000000000000000..3d9f90df00280835f4a7c9441991d654d16917dd
--- /dev/null
+++ b/backend/app/characters/character_model.py
@@ -0,0 +1,14 @@
+from sqlalchemy import JSON, String, Boolean
+from sqlalchemy.orm import Mapped, mapped_column
+from app.shared.base_model import Record
+
+
+class Character(Record):
+ __tablename__ = "characters"
+ name: Mapped[str] = mapped_column(String(120))
+ description: Mapped[str] = mapped_column(String(2000), default="")
+ color: Mapped[str] = mapped_column(String(20), default="#a599e9")
+ profile: Mapped[dict] = mapped_column(JSON, default=dict)
+ image_asset_id: Mapped[str | None] = mapped_column(String(36), nullable=True)
+ voice_asset_id: Mapped[str | None] = mapped_column(String(36), nullable=True)
+ archived: Mapped[bool] = mapped_column(Boolean, default=False)
diff --git a/backend/app/characters/character_repository.py b/backend/app/characters/character_repository.py
new file mode 100644
index 0000000000000000000000000000000000000000..51ccdfd01f1cd5bd78085c1b1691a027b8b3dce4
--- /dev/null
+++ b/backend/app/characters/character_repository.py
@@ -0,0 +1,6 @@
+from app.shared.base_repository import Repository
+from app.characters.character_model import Character
+
+
+class CharacterRepository(Repository):
+ model = Character
diff --git a/backend/app/characters/character_schema.py b/backend/app/characters/character_schema.py
new file mode 100644
index 0000000000000000000000000000000000000000..ddab5c22f9464c9812081bc26a408e11128c8ae2
--- /dev/null
+++ b/backend/app/characters/character_schema.py
@@ -0,0 +1,35 @@
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field
+
+
+class CharacterProfile(BaseModel):
+ personality: str = Field(default="", max_length=2000)
+ region: str = Field(default="Creator defined", max_length=200)
+ vocabulary: str = Field(default="", max_length=2000)
+ aave: str = Field(default="Creator defined; no automatic dialect", max_length=1000)
+ slang: int = Field(default=0, ge=0, le=100)
+ pronunciation: str = Field(default="", max_length=2000)
+ cadence: str = Field(default="Natural", max_length=300)
+ code_switching: str = Field(default="Context dependent", max_length=1000)
+ expressiveness: float = Field(default=0.5, ge=0, le=1)
+ pace: float = Field(default=1, ge=0.8, le=1.2)
+ gestures: str = Field(default="Subtle conversational gestures", max_length=1000)
+ voice_notes: str = Field(default="", max_length=1000)
+ voice_preset: str = Field(default="af_heart", pattern=r"^af_[a-z]+$")
+
+
+class CharacterCreate(BaseModel):
+ name: str = Field(min_length=1, max_length=120)
+ description: str = Field(default="", max_length=2000)
+ color: str = Field(default="#a599e9", pattern=r"^#[0-9a-fA-F]{6}$")
+ profile: CharacterProfile = Field(default_factory=CharacterProfile)
+ image_asset_id: str | None = None
+ voice_asset_id: str | None = None
+ archived: bool = False
+
+
+class CharacterRead(CharacterCreate):
+ model_config = ConfigDict(from_attributes=True)
+ id: str
+ created_at: datetime
+ version: int
diff --git a/backend/app/characters/character_service.py b/backend/app/characters/character_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..6d5d976a2b938b9e45a62c5f5ebf6c62f5ca6a55
--- /dev/null
+++ b/backend/app/characters/character_service.py
@@ -0,0 +1,23 @@
+from fastapi import HTTPException
+from app.config import settings
+from app.shared.storage_service import StorageService
+
+
+class CharacterService:
+ def __init__(self, repository):
+ self.repository = repository
+
+ def save(self, data, character_id=None):
+ if settings.fixed_demo_mode:
+ raise HTTPException(
+ 403,
+ "Character creation and editing are disabled for this fixed-cast MVP",
+ )
+ storage = StorageService(self.repository.session)
+ for field, kind in [("image_asset_id", "image"), ("voice_asset_id", "voice")]:
+ if value := getattr(data, field):
+ storage.get(value, kind)
+ values = data.model_dump()
+ if character_id:
+ return self.repository.update(self.repository.get(character_id), values)
+ return self.repository.create(values)
diff --git a/backend/app/config.py b/backend/app/config.py
new file mode 100644
index 0000000000000000000000000000000000000000..bd870504eda7d02d47eb6ccc6f9f385a6e90a9ad
--- /dev/null
+++ b/backend/app/config.py
@@ -0,0 +1,27 @@
+from pathlib import Path
+from typing import Literal
+from pydantic_settings import BaseSettings, SettingsConfigDict
+
+
+class Settings(BaseSettings):
+ model_config = SettingsConfigDict(env_file=".env", extra="ignore")
+ app_name: str = "Character Studio"
+ database_url: str = "sqlite:///./data/app.db"
+ assets_dir: Path = Path("assets")
+ model_weights_dir: Path = Path("model_weights")
+ ollama_url: str = "http://127.0.0.1:11434"
+ dialogue_model: str = "qwen3:1.7b"
+ speech_provider: Literal["kokoro", "chatterbox"] = "kokoro"
+ video_provider: Literal["sadtalker", "infinitetalk"] = "sadtalker"
+ speech_url: str = ""
+ video_url: str = ""
+ provider_token: str = ""
+ provider_timeout: int = 1800
+ worker_poll_seconds: float = 2
+ seed_characters: bool = True
+ fixed_demo_mode: bool = True
+ enable_ai_drafts: bool = False
+ enable_animated_renders: bool = False
+
+
+settings = Settings()
diff --git a/backend/app/conversations/__init__.py b/backend/app/conversations/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/app/conversations/conversation_controller.py b/backend/app/conversations/conversation_controller.py
new file mode 100644
index 0000000000000000000000000000000000000000..5f2f616248aa26b15f95a474d2aefa0dce6ea2f3
--- /dev/null
+++ b/backend/app/conversations/conversation_controller.py
@@ -0,0 +1,47 @@
+from fastapi import APIRouter, Depends, HTTPException
+from sqlalchemy.orm import Session
+from app.database import get_session
+from app.conversations.conversation_repository import ConversationRepository
+from app.conversations.conversation_service import ConversationService
+from app.conversations.conversation_schema import ConversationCreate, ConversationRead
+from app.conversations.conversation_schema import DraftRequest
+from app.characters.character_repository import CharacterRepository
+from app.ai.qwen_provider import QwenProvider
+from app.config import settings
+
+router = APIRouter(prefix="/conversations", tags=["conversations"])
+
+
+@router.get("", response_model=list[ConversationRead])
+def list_records(db: Session = Depends(get_session)):
+ return ConversationRepository(db).list()
+
+
+@router.post("", response_model=ConversationRead, status_code=201)
+def create(data: ConversationCreate, db: Session = Depends(get_session)):
+ return ConversationService(ConversationRepository(db)).save(data)
+
+
+@router.post("/draft")
+def draft(data: DraftRequest, db: Session = Depends(get_session)):
+ if not settings.enable_ai_drafts:
+ raise HTTPException(
+ 503, "AI dialogue drafting is not functional at the moment for this MVP"
+ )
+ characters = [CharacterRepository(db).get(i) for i in data.character_ids]
+ if len(set(data.character_ids)) != 2 or any(c.archived for c in characters):
+ raise HTTPException(422, "Choose two distinct active characters")
+ profiles = [{"id": c.id, "name": c.name, "profile": c.profile} for c in characters]
+ return {"turns": QwenProvider().generate(data.topic, profiles), "approved": False}
+
+
+@router.get("/{record_id}", response_model=ConversationRead)
+def get(record_id: str, db: Session = Depends(get_session)):
+ return ConversationRepository(db).get(record_id)
+
+
+@router.put("/{record_id}", response_model=ConversationRead)
+def update(
+ record_id: str, data: ConversationCreate, db: Session = Depends(get_session)
+):
+ return ConversationService(ConversationRepository(db)).save(data, record_id)
diff --git a/backend/app/conversations/conversation_model.py b/backend/app/conversations/conversation_model.py
new file mode 100644
index 0000000000000000000000000000000000000000..527c8fa7f975c066c15e1305dd590bfd45ae98c6
--- /dev/null
+++ b/backend/app/conversations/conversation_model.py
@@ -0,0 +1,11 @@
+from sqlalchemy import JSON, String, Boolean
+from sqlalchemy.orm import Mapped, mapped_column
+from app.shared.base_model import Record
+
+
+class Conversation(Record):
+ __tablename__ = "conversations"
+ title: Mapped[str] = mapped_column(String(200))
+ mode: Mapped[str] = mapped_column(String(20), default="scripted")
+ turns: Mapped[list] = mapped_column(JSON, default=list)
+ approved: Mapped[bool] = mapped_column(Boolean, default=False)
diff --git a/backend/app/conversations/conversation_repository.py b/backend/app/conversations/conversation_repository.py
new file mode 100644
index 0000000000000000000000000000000000000000..eb14cd1ba531131a05197dd517372c55604d90cd
--- /dev/null
+++ b/backend/app/conversations/conversation_repository.py
@@ -0,0 +1,6 @@
+from app.shared.base_repository import Repository
+from app.conversations.conversation_model import Conversation
+
+
+class ConversationRepository(Repository):
+ model = Conversation
diff --git a/backend/app/conversations/conversation_schema.py b/backend/app/conversations/conversation_schema.py
new file mode 100644
index 0000000000000000000000000000000000000000..cc9a9133b4e65e3764ec74b53277411ba3159464
--- /dev/null
+++ b/backend/app/conversations/conversation_schema.py
@@ -0,0 +1,29 @@
+from datetime import datetime
+from typing import Literal
+from pydantic import BaseModel, ConfigDict, Field
+
+
+class DialogueTurn(BaseModel):
+ character_id: str
+ text: str = Field(min_length=1, max_length=1500)
+ direction: str = Field(default="", max_length=500)
+ pause_after: float = Field(default=0.4, ge=0, le=5)
+
+
+class ConversationCreate(BaseModel):
+ title: str = Field(min_length=1, max_length=200)
+ mode: Literal["scripted", "generated"] = "scripted"
+ turns: list[DialogueTurn] = Field(min_length=1, max_length=40)
+ approved: bool = False
+
+
+class ConversationRead(ConversationCreate):
+ model_config = ConfigDict(from_attributes=True)
+ id: str
+ created_at: datetime
+ version: int
+
+
+class DraftRequest(BaseModel):
+ topic: str = Field(min_length=3, max_length=2000)
+ character_ids: list[str] = Field(min_length=2, max_length=2)
diff --git a/backend/app/conversations/conversation_service.py b/backend/app/conversations/conversation_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..0846d2d1430b4156099153223e65c231ce916993
--- /dev/null
+++ b/backend/app/conversations/conversation_service.py
@@ -0,0 +1,17 @@
+from fastapi import HTTPException
+from app.characters.character_repository import CharacterRepository
+
+
+class ConversationService:
+ def __init__(self, repository):
+ self.repository = repository
+
+ def save(self, data, conversation_id=None):
+ characters = CharacterRepository(self.repository.session)
+ for turn in data.turns:
+ if characters.get(turn.character_id).archived:
+ raise HTTPException(422, "An archived character cannot be used")
+ values = data.model_dump()
+ if conversation_id:
+ return self.repository.update(self.repository.get(conversation_id), values)
+ return self.repository.create(values)
diff --git a/backend/app/database.py b/backend/app/database.py
new file mode 100644
index 0000000000000000000000000000000000000000..393f4fab7fee7be60a5104b0193948e4ed884405
--- /dev/null
+++ b/backend/app/database.py
@@ -0,0 +1,29 @@
+from collections.abc import Generator
+from functools import lru_cache
+from pathlib import Path
+
+from sqlalchemy import create_engine
+from sqlalchemy.engine import Engine, make_url
+from sqlalchemy.orm import DeclarativeBase, Session
+
+from app.config import settings
+
+
+class Base(DeclarativeBase):
+ pass
+
+
+@lru_cache
+def get_engine() -> Engine:
+ url = make_url(settings.database_url)
+ options = {}
+ if url.get_backend_name() == "sqlite":
+ options["check_same_thread"] = False
+ if url.database and url.database != ":memory:":
+ Path(url.database).parent.mkdir(parents=True, exist_ok=True)
+ return create_engine(url, connect_args=options)
+
+
+def get_session() -> Generator[Session, None, None]:
+ with Session(get_engine()) as session:
+ yield session
diff --git a/backend/app/generations/__init__.py b/backend/app/generations/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/app/generations/generation_controller.py b/backend/app/generations/generation_controller.py
new file mode 100644
index 0000000000000000000000000000000000000000..c023f51d7a6f1f0917a599acdacd9828b9a12f22
--- /dev/null
+++ b/backend/app/generations/generation_controller.py
@@ -0,0 +1,75 @@
+from fastapi import APIRouter, Depends, HTTPException
+from sqlalchemy import update
+from sqlalchemy.orm import Session
+from app.database import get_session
+from app.generations.generation_model import Generation
+from app.generations.generation_repository import GenerationRepository
+from app.generations.generation_service import GenerationService
+from app.generations.generation_schema import (
+ GenerationCreate,
+ GenerationRead,
+ ReviewRequest,
+)
+
+router = APIRouter(prefix="/generations", tags=["generations"])
+
+
+@router.get("", response_model=list[GenerationRead])
+def list_jobs(db: Session = Depends(get_session)):
+ return GenerationRepository(db).list()
+
+
+@router.post("", status_code=201, response_model=GenerationRead)
+def create(data: GenerationCreate, db: Session = Depends(get_session)):
+ return GenerationService(GenerationRepository(db)).create(data)
+
+
+@router.get("/{job_id}", response_model=GenerationRead)
+def get(job_id: str, db: Session = Depends(get_session)):
+ return GenerationRepository(db).get(job_id)
+
+
+@router.post("/{job_id}/retry", status_code=201, response_model=GenerationRead)
+def retry(job_id: str, db: Session = Depends(get_session)):
+ repo = GenerationRepository(db)
+ return GenerationService(repo).retry(repo.get(job_id))
+
+
+@router.post("/{job_id}/cancel")
+def cancel(job_id: str, db: Session = Depends(get_session)):
+ GenerationRepository(db).get(job_id)
+ result = db.execute(
+ update(Generation)
+ .where(Generation.id == job_id, Generation.status == "queued")
+ .values(status="cancelled", stage="Cancelled")
+ )
+ db.commit()
+ if not result.rowcount:
+ raise HTTPException(
+ 409, "Only queued jobs can be cancelled; running GPU calls must finish"
+ )
+ return {"status": "cancelled"}
+
+
+@router.post("/{job_id}/review", response_model=GenerationRead)
+def review(job_id: str, data: ReviewRequest, db: Session = Depends(get_session)):
+ repo = GenerationRepository(db)
+ job = repo.get(job_id)
+ if job.status != "completed" or job.settings["kind"] != "animated":
+ raise HTTPException(
+ 409, "Only a completed animated render can receive final review"
+ )
+ return repo.update(job, {"review": data.model_dump()})
+
+
+@router.get("/{job_id}/manifest")
+def manifest(job_id: str, db: Session = Depends(get_session)):
+ job = GenerationRepository(db).get(job_id)
+ return {
+ "id": job.id,
+ "status": job.status,
+ "inputs": job.settings,
+ "review": job.review,
+ "duration": job.duration,
+ "disclosure": "AI-generated fictional characters",
+ }
diff --git a/backend/app/generations/generation_model.py b/backend/app/generations/generation_model.py
new file mode 100644
index 0000000000000000000000000000000000000000..501f60d83e2a0fef05e9362acc81b20c70067a7f
--- /dev/null
+++ b/backend/app/generations/generation_model.py
@@ -0,0 +1,17 @@
+from sqlalchemy import JSON, String, Float, Integer
+from sqlalchemy.orm import Mapped, mapped_column
+from app.shared.base_model import Record
+
+
+class Generation(Record):
+ __tablename__ = "generations"
+ status: Mapped[str] = mapped_column(String(32), default="queued")
+ stage: Mapped[str] = mapped_column(String(100), default="Waiting for worker")
+ progress: Mapped[int] = mapped_column(Integer, default=0)
+ conversation_id: Mapped[str] = mapped_column(String(36))
+ scene_id: Mapped[str] = mapped_column(String(36))
+ settings: Mapped[dict] = mapped_column(JSON)
+ error: Mapped[str | None] = mapped_column(String(2000), nullable=True)
+ output_asset_id: Mapped[str | None] = mapped_column(String(36), nullable=True)
+ duration: Mapped[float | None] = mapped_column(Float, nullable=True)
+ review: Mapped[dict] = mapped_column(JSON, default=dict)
diff --git a/backend/app/generations/generation_repository.py b/backend/app/generations/generation_repository.py
new file mode 100644
index 0000000000000000000000000000000000000000..d3a9a6997fc419757c9ebabf1d2af9d251087463
--- /dev/null
+++ b/backend/app/generations/generation_repository.py
@@ -0,0 +1,6 @@
+from app.shared.base_repository import Repository
+from app.generations.generation_model import Generation
+
+
+class GenerationRepository(Repository):
+ model = Generation
diff --git a/backend/app/generations/generation_schema.py b/backend/app/generations/generation_schema.py
new file mode 100644
index 0000000000000000000000000000000000000000..9900a533cff34e85a472213c181d9c3a2515ba3c
--- /dev/null
+++ b/backend/app/generations/generation_schema.py
@@ -0,0 +1,35 @@
+from datetime import datetime
+from typing import Literal
+from pydantic import BaseModel, ConfigDict, Field
+
+
+class GenerationCreate(BaseModel):
+ conversation_id: str
+ scene_id: str
+ kind: Literal["storyboard", "animated"] = "storyboard"
+ target_seconds: int = Field(default=60, ge=10, le=65)
+
+
+class GenerationRead(BaseModel):
+ model_config = ConfigDict(from_attributes=True)
+ id: str
+ created_at: datetime
+ version: int
+ conversation_id: str
+ scene_id: str
+ status: str
+ stage: str
+ progress: int
+ settings: dict
+ error: str | None
+ output_asset_id: str | None
+ duration: float | None
+ review: dict
+
+
+class ReviewRequest(BaseModel):
+ exact_words: bool
+ consistent_identity: bool
+ natural_reactions: bool
+ lip_sync: bool
+ notes: str = Field(default="", max_length=2000)
diff --git a/backend/app/generations/generation_service.py b/backend/app/generations/generation_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..da064380540b2c5e93d55c264428eebf6f18ef33
--- /dev/null
+++ b/backend/app/generations/generation_service.py
@@ -0,0 +1,120 @@
+from fastapi import HTTPException
+from app.characters.character_repository import CharacterRepository
+from app.characters.character_schema import CharacterRead
+from app.conversations.conversation_repository import ConversationRepository
+from app.conversations.conversation_schema import ConversationRead
+from app.scenes.scene_repository import SceneRepository
+from app.scenes.scene_schema import SceneRead
+from app.shared.storage_service import StorageService
+from app.config import settings
+from app.ai.provider_readiness import lightweight_ready
+
+
+class GenerationService:
+ def __init__(self, repository):
+ self.repository = repository
+
+ def create(self, data):
+ self.check_feature(data.kind)
+ if settings.fixed_demo_mode and data.scene_id != "mvp-scene":
+ raise HTTPException(
+ 403, "Only the built-in scene can be rendered in this MVP"
+ )
+ db = self.repository.session
+ conversation = ConversationRepository(db).get(data.conversation_id)
+ scene = SceneRepository(db).get(data.scene_id)
+ if not conversation.approved or not scene.approved:
+ raise HTTPException(
+ 422, "Approve the dialogue and shared scene before rendering"
+ )
+ speakers = {t["character_id"] for t in conversation.turns}
+ if speakers != set(scene.character_ids):
+ raise HTTPException(
+ 422, "The dialogue must use both scene characters and no other speakers"
+ )
+ storage = StorageService(db)
+ storage.get(scene.image_asset_id, "image")
+ characters = [CharacterRepository(db).get(i) for i in scene.character_ids]
+ for c in characters:
+ if c.archived:
+ raise HTTPException(422, "Restore archived characters before rendering")
+ if data.kind == "animated" and settings.speech_provider == "chatterbox":
+ if not c.voice_asset_id:
+ raise HTTPException(
+ 422, f"Add an authorized voice reference for {c.name}"
+ )
+ storage.get(c.voice_asset_id, "voice")
+ if data.kind == "animated" and (
+ not settings.speech_url or not settings.video_url
+ ):
+ raise HTTPException(
+ 503,
+ "GPU services are not configured. Start the configured speech and video model services. A storyboard is available without GPU services.",
+ )
+ if (
+ data.kind == "animated"
+ and settings.speech_provider == "chatterbox"
+ and len({c.voice_asset_id for c in characters}) != 2
+ ):
+ raise HTTPException(422, "Choose two distinct voice references")
+ snapshot = {
+ "kind": data.kind,
+ "target_seconds": data.target_seconds,
+ "conversation": ConversationRead.model_validate(conversation).model_dump(
+ mode="json"
+ ),
+ "scene": SceneRead.model_validate(scene).model_dump(mode="json"),
+ "characters": [
+ CharacterRead.model_validate(c).model_dump(mode="json")
+ for c in characters
+ ],
+ "providers": {
+ "speech": settings.speech_provider,
+ "video": settings.video_provider,
+ "dialogue": settings.dialogue_model,
+ },
+ }
+ return self.repository.create(
+ {
+ "conversation_id": conversation.id,
+ "scene_id": scene.id,
+ "settings": snapshot,
+ }
+ )
+
+ @staticmethod
+ def check_feature(kind):
+ if kind == "animated" and not settings.enable_animated_renders:
+ raise HTTPException(
+ 503,
+ "Animated speech and lip-sync are not functional at the moment for this MVP",
+ )
+ if (
+ kind == "animated"
+ and settings.video_provider == "sadtalker"
+ and not lightweight_ready()
+ ):
+ raise HTTPException(
+ 503,
+ "Kokoro/SadTalker service is not ready. Check the GPU deployment logs.",
+ )
+
+ def retry(self, job):
+ self.check_feature(job.settings["kind"])
+ if (
+ settings.fixed_demo_mode
+ and job.settings["scene"]["image_asset_id"] != "mvp-scene-image"
+ ):
+ raise HTTPException(
+ 403, "Older custom scenes cannot be re-rendered in this MVP"
+ )
+ if job.status not in {"failed", "cancelled"}:
+ raise HTTPException(409, "Only failed or cancelled jobs can be retried")
+ # Preserve the original versioned inputs, even after character edits.
+ return self.repository.create(
+ {
+ "conversation_id": job.conversation_id,
+ "scene_id": job.scene_id,
+ "settings": job.settings,
+ }
+ )
diff --git a/backend/app/generations/generation_worker.py b/backend/app/generations/generation_worker.py
new file mode 100644
index 0000000000000000000000000000000000000000..5ee240896fa32fe98c65720fa6f8ecbd774ffb41
--- /dev/null
+++ b/backend/app/generations/generation_worker.py
@@ -0,0 +1,220 @@
+import json
+import logging
+import time
+import threading
+from datetime import datetime, timezone
+from sqlalchemy import select, update
+from sqlalchemy.orm import Session
+from app.database import get_engine
+from app.config import settings
+from app.generations.generation_model import Generation
+from app.shared.storage_service import StorageService
+from app.shared.audio_service import AudioService
+from app.shared.video_service import VideoService
+from app.ai.provider_factory import speech_provider, video_provider
+
+logger = logging.getLogger(__name__)
+
+
+def claim_job():
+ with Session(get_engine()) as db:
+ job_id = db.scalar(
+ select(Generation.id)
+ .where(Generation.status == "queued")
+ .order_by(Generation.created_at)
+ .limit(1)
+ )
+ if job_id:
+ result = db.execute(
+ update(Generation)
+ .where(Generation.id == job_id, Generation.status == "queued")
+ .values(status="running", stage="Preparing inputs", progress=5)
+ )
+ db.commit()
+ if result.rowcount:
+ return job_id
+ return None
+
+
+def run_generation(job_id: str):
+ with Session(get_engine()) as db:
+ job = db.get(Generation, job_id)
+ if not job or job.status != "running":
+ return
+
+ def progress(stage, percent):
+ job.stage = stage
+ job.progress = percent
+ db.commit()
+
+ try:
+ snapshot = job.settings
+ if (
+ settings.fixed_demo_mode
+ and snapshot["scene"]["image_asset_id"] != "mvp-scene-image"
+ ):
+ raise ValueError("Only the built-in scene can be rendered in this MVP")
+ if snapshot["kind"] == "animated" and not settings.enable_animated_renders:
+ raise ValueError(
+ "Animated speech and lip-sync are not functional at the moment for this MVP"
+ )
+ storage = StorageService(db)
+ scene = snapshot["scene"]
+ image = storage.path(storage.get(scene["image_asset_id"], "image"))
+ folder = settings.assets_dir / "outputs" / job.id
+ folder.mkdir(parents=True, exist_ok=True)
+ output = folder / "conversation.mp4"
+ if snapshot["kind"] == "storyboard":
+ progress("Rendering silent storyboard", 40)
+ VideoService().storyboard(image, output, snapshot["target_seconds"])
+ duration = snapshot["target_seconds"]
+ else:
+ providers = snapshot["providers"]
+ if (
+ providers["speech"] != settings.speech_provider
+ or providers["video"] != settings.video_provider
+ ):
+ raise ValueError(
+ "Providers changed since this job was saved. Create a new render."
+ )
+ speech = speech_provider(providers["speech"])
+ video = video_provider(providers["video"])
+ characters = {c["id"]: c for c in snapshot["characters"]}
+ turns = snapshot["conversation"]["turns"]
+ clips = []
+ audio = AudioService()
+ for index, turn in enumerate(turns):
+ c = characters[turn["character_id"]]
+ voice = (
+ storage.path(storage.get(c["voice_asset_id"], "voice"))
+ if providers["speech"] == "chatterbox"
+ else None
+ )
+ progress(
+ f"Generating voice {index + 1}/{len(turns)}",
+ 10 + int(35 * index / len(turns)),
+ )
+ raw = speech.synthesize(
+ turn["text"], voice, folder / f"raw-{index}.wav", c["profile"]
+ )
+ clips.append(
+ audio.normalize(
+ raw,
+ folder / f"turn-{index}.wav",
+ c["profile"].get("pace", 1),
+ )
+ )
+ progress("Aligning two speaker tracks", 50)
+ tracks, timeline, duration = audio.align(
+ turns,
+ clips,
+ scene["character_ids"],
+ folder,
+ snapshot["target_seconds"],
+ )
+ (folder / "timeline.json").write_text(json.dumps(timeline, indent=2))
+ progress(
+ "Animating both portraits"
+ if providers["video"] == "sadtalker"
+ else "Animating the shared scene",
+ 65,
+ )
+ prompt = (
+ scene["prompt"]
+ + " Left-to-right character performance: "
+ + json.dumps(
+ [
+ {
+ "name": c["name"],
+ "gestures": c["profile"].get("gestures", ""),
+ "personality": c["profile"].get("personality", ""),
+ }
+ for c in snapshot["characters"]
+ ]
+ )
+ )
+ prompt += " Per-turn directions: " + json.dumps(
+ [
+ {
+ "character_id": t["character_id"],
+ "start": t["start"],
+ "end": t["end"],
+ "direction": t.get("direction", ""),
+ }
+ for t in timeline
+ ]
+ )
+ raw_video = video.generate(image, tracks, folder / "raw.mp4", prompt)
+ progress("Mixing and exporting", 90)
+ VideoService().finalize(raw_video, folder / "mix.wav", output)
+ # Revocation during a long render prevents publishing its output.
+ db.expire_all()
+ storage.get(scene["image_asset_id"], "image")
+ if (
+ snapshot["kind"] == "animated"
+ and snapshot["providers"]["speech"] == "chatterbox"
+ ):
+ for c in snapshot["characters"]:
+ storage.get(c["voice_asset_id"], "voice")
+ job.duration = duration
+ job.output_asset_id = storage.register(
+ output, "video", f"{snapshot['kind']}-{job.id[:8]}.mp4"
+ ).id
+ job.status = "completed"
+ job.stage = (
+ "Ready for review"
+ if snapshot["kind"] == "animated"
+ else "Storyboard ready — no voice or animation"
+ )
+ job.progress = 100
+ db.commit()
+ except Exception as exc:
+ logger.exception("Generation %s failed", job_id)
+ db.rollback()
+ job = db.get(Generation, job_id)
+ job.status = "failed"
+ job.stage = "Needs attention"
+ job.error = (
+ str(getattr(exc, "detail", str(exc)))[:1800]
+ or "Generation failed; inspect worker logs"
+ )
+ db.commit()
+
+
+def main():
+ from app.bootstrap import initialize
+
+ initialize()
+ # The deployment runs one worker. Recover jobs interrupted by a process restart.
+ with Session(get_engine()) as db:
+ db.execute(
+ update(Generation)
+ .where(Generation.status == "running")
+ .values(
+ status="failed",
+ stage="Worker restarted",
+ error="Worker stopped during rendering. Retry this job.",
+ )
+ )
+ db.commit()
+ heartbeat = settings.assets_dir.parent / "worker-heartbeat.json"
+
+ def report_heartbeat():
+ while True:
+ heartbeat.parent.mkdir(parents=True, exist_ok=True)
+ heartbeat.write_text(
+ json.dumps({"updated_at": datetime.now(timezone.utc).isoformat()})
+ )
+ time.sleep(5)
+
+ threading.Thread(target=report_heartbeat, daemon=True).start()
+ while True:
+ job_id = claim_job()
+ if job_id:
+ run_generation(job_id)
+ else:
+ time.sleep(settings.worker_poll_seconds)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/backend/app/main.py b/backend/app/main.py
new file mode 100644
index 0000000000000000000000000000000000000000..e75c5c0f06fcf9924eb19901e81a511b8e8ceae3
--- /dev/null
+++ b/backend/app/main.py
@@ -0,0 +1,54 @@
+from contextlib import asynccontextmanager
+from pathlib import Path
+from fastapi import FastAPI, HTTPException
+from fastapi.responses import FileResponse
+from app.config import settings
+from app.bootstrap import initialize
+from app.characters.character_controller import router as character_router
+from app.conversations.conversation_controller import router as conversation_router
+from app.scenes.scene_controller import router as scene_router
+from app.generations.generation_controller import router as generation_router
+from app.assets.asset_controller import router as asset_router
+from app.system.system_controller import router as system_router
+
+
+@asynccontextmanager
+async def lifespan(app):
+ initialize()
+ yield
+
+
+app = FastAPI(title=settings.app_name, lifespan=lifespan)
+for router in (
+ character_router,
+ conversation_router,
+ scene_router,
+ generation_router,
+ asset_router,
+ system_router,
+):
+ app.include_router(router, prefix="/api/v1")
+
+
+@app.get("/health", tags=["health"])
+def health():
+ return {"status": "ok", "service": settings.app_name}
+
+
+# The built Vite app and API use the same origin in the Docker deployment.
+frontend = Path(__file__).resolve().parents[2] / "frontend" / "dist"
+
+
+@app.get("/{path:path}", include_in_schema=False)
+def frontend_app(path: str):
+ if path.startswith(("api/", "health/")):
+ raise HTTPException(404, "Route not found")
+ candidate = (frontend / path).resolve()
+ if candidate.is_relative_to(frontend.resolve()) and candidate.is_file():
+ return FileResponse(candidate)
+ index = frontend / "index.html"
+ if not index.is_file():
+ raise HTTPException(
+ 404, "Build the frontend or start the Vite development server"
+ )
+ return FileResponse(index)
diff --git a/backend/app/scenes/__init__.py b/backend/app/scenes/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/app/scenes/scene_controller.py b/backend/app/scenes/scene_controller.py
new file mode 100644
index 0000000000000000000000000000000000000000..ef719a25665856b0d26aa383b4b8fba899039ca5
--- /dev/null
+++ b/backend/app/scenes/scene_controller.py
@@ -0,0 +1,28 @@
+from fastapi import APIRouter, Depends
+from sqlalchemy.orm import Session
+from app.database import get_session
+from app.scenes.scene_repository import SceneRepository
+from app.scenes.scene_service import SceneService
+from app.scenes.scene_schema import SceneCreate, SceneRead
+
+router = APIRouter(prefix="/scenes", tags=["scenes"])
+
+
+@router.get("", response_model=list[SceneRead])
+def list_records(db: Session = Depends(get_session)):
+ return SceneRepository(db).list()
+
+
+@router.post("", response_model=SceneRead, status_code=201)
+def create(data: SceneCreate, db: Session = Depends(get_session)):
+ return SceneService(SceneRepository(db)).save(data)
+
+
+@router.get("/{record_id}", response_model=SceneRead)
+def get(record_id: str, db: Session = Depends(get_session)):
+ return SceneRepository(db).get(record_id)
+
+
+@router.put("/{record_id}", response_model=SceneRead)
+def update(record_id: str, data: SceneCreate, db: Session = Depends(get_session)):
+ return SceneService(SceneRepository(db)).save(data, record_id)
diff --git a/backend/app/scenes/scene_model.py b/backend/app/scenes/scene_model.py
new file mode 100644
index 0000000000000000000000000000000000000000..12aa9c91ca15f285816759205c9c6a5309450da2
--- /dev/null
+++ b/backend/app/scenes/scene_model.py
@@ -0,0 +1,12 @@
+from sqlalchemy import JSON, String, Boolean
+from sqlalchemy.orm import Mapped, mapped_column
+from app.shared.base_model import Record
+
+
+class Scene(Record):
+ __tablename__ = "scenes"
+ name: Mapped[str] = mapped_column(String(120))
+ image_asset_id: Mapped[str] = mapped_column(String(36))
+ character_ids: Mapped[list] = mapped_column(JSON)
+ prompt: Mapped[str] = mapped_column(String(4000), default="")
+ approved: Mapped[bool] = mapped_column(Boolean, default=False)
diff --git a/backend/app/scenes/scene_repository.py b/backend/app/scenes/scene_repository.py
new file mode 100644
index 0000000000000000000000000000000000000000..d8aa1fe8cc16a851c14b8c2b6087c1a92978b503
--- /dev/null
+++ b/backend/app/scenes/scene_repository.py
@@ -0,0 +1,6 @@
+from app.shared.base_repository import Repository
+from app.scenes.scene_model import Scene
+
+
+class SceneRepository(Repository):
+ model = Scene
diff --git a/backend/app/scenes/scene_schema.py b/backend/app/scenes/scene_schema.py
new file mode 100644
index 0000000000000000000000000000000000000000..488620098ef8a649ed1cae7d6b22d51e77cee38b
--- /dev/null
+++ b/backend/app/scenes/scene_schema.py
@@ -0,0 +1,20 @@
+from datetime import datetime
+from pydantic import BaseModel, ConfigDict, Field
+
+
+class SceneCreate(BaseModel):
+ name: str = Field(min_length=1, max_length=120)
+ image_asset_id: str
+ character_ids: list[str] = Field(min_length=2, max_length=2)
+ prompt: str = Field(
+ default="Two women in one scene, natural conversation and attentive listening.",
+ max_length=4000,
+ )
+ approved: bool = False
+
+
+class SceneRead(SceneCreate):
+ model_config = ConfigDict(from_attributes=True)
+ id: str
+ created_at: datetime
+ version: int
diff --git a/backend/app/scenes/scene_service.py b/backend/app/scenes/scene_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..ca377eb79e3d369278e5e82c1f88b827a640da0e
--- /dev/null
+++ b/backend/app/scenes/scene_service.py
@@ -0,0 +1,27 @@
+from app.config import settings
+from fastapi import HTTPException
+from app.characters.character_repository import CharacterRepository
+from app.shared.storage_service import StorageService
+
+
+class SceneService:
+ def __init__(self, repository):
+ self.repository = repository
+
+ def save(self, data, scene_id=None):
+ if settings.fixed_demo_mode:
+ raise HTTPException(
+ 403, "This MVP uses the built-in scene; scene editing is disabled"
+ )
+ if len(set(data.character_ids)) != 2:
+ raise HTTPException(
+ 422, "Choose two different characters, in left-to-right image order"
+ )
+ for character_id in data.character_ids:
+ if CharacterRepository(self.repository.session).get(character_id).archived:
+ raise HTTPException(422, "An archived character cannot be used")
+ StorageService(self.repository.session).get(data.image_asset_id, "image")
+ values = data.model_dump()
+ if scene_id:
+ return self.repository.update(self.repository.get(scene_id), values)
+ return self.repository.create(values)
diff --git a/backend/app/shared/__init__.py b/backend/app/shared/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/app/shared/audio_service.py b/backend/app/shared/audio_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..ea6748ee993a2b290f003f3ca3cf41d1997dc331
--- /dev/null
+++ b/backend/app/shared/audio_service.py
@@ -0,0 +1,99 @@
+from pathlib import Path
+import subprocess
+import wave
+from array import array
+import sys
+import imageio_ffmpeg
+
+RATE = 24000
+
+
+def wav_read(path):
+ with wave.open(str(path), "rb") as wav:
+ if (
+ wav.getnchannels() != 1
+ or wav.getsampwidth() != 2
+ or wav.getframerate() != RATE
+ ):
+ raise ValueError("Expected mono 24 kHz PCM WAV")
+ samples = array("h", wav.readframes(wav.getnframes()))
+ if sys.byteorder != "little":
+ samples.byteswap()
+ return samples
+
+
+def wav_write(path, samples):
+ with wave.open(str(path), "wb") as wav:
+ wav.setnchannels(1)
+ wav.setsampwidth(2)
+ wav.setframerate(RATE)
+ data = array("h", samples)
+ if sys.byteorder != "little":
+ data.byteswap()
+ wav.writeframes(data.tobytes())
+
+
+class AudioService:
+ def normalize(self, source: Path, target: Path, pace=1.0):
+ subprocess.run(
+ [
+ imageio_ffmpeg.get_ffmpeg_exe(),
+ "-y",
+ "-i",
+ str(source),
+ "-af",
+ f"atempo={pace}",
+ "-ac",
+ "1",
+ "-ar",
+ str(RATE),
+ "-c:a",
+ "pcm_s16le",
+ str(target),
+ ],
+ check=True,
+ capture_output=True,
+ timeout=90,
+ )
+ return target
+
+ def align(self, turns, clips, character_ids, folder, target_seconds):
+ tracks = {i: array("h") for i in character_ids}
+ timeline = []
+ cursor = 0
+ for turn, clip in zip(turns, clips, strict=True):
+ samples = wav_read(clip)
+ length = len(samples)
+ timeline.append(
+ {**turn, "start": cursor / RATE, "end": (cursor + length) / RATE}
+ )
+ gap = int(turn["pause_after"] * RATE)
+ for identity in character_ids:
+ tracks[identity].extend(
+ samples
+ if identity == turn["character_id"]
+ else array("h", [0]) * length
+ )
+ tracks[identity].extend(array("h", [0]) * gap)
+ cursor += length + gap
+ actual = cursor / RATE
+ if abs(actual - target_seconds) > 5:
+ raise ValueError(
+ f"Speech is {actual:.1f}s; target is {target_seconds}s ±5s. Edit dialogue or pace and render again. Words were not changed."
+ )
+ length = max(cursor, target_seconds * RATE)
+ paths = []
+ for index, identity in enumerate(character_ids):
+ tracks[identity].extend(array("h", [0]) * (length - cursor))
+ path = folder / f"person{index + 1}.wav"
+ wav_write(path, tracks[identity])
+ paths.append(path)
+ mixed = array(
+ "h",
+ (
+ max(-32768, min(32767, a + b))
+ for a, b in zip(*tracks.values(), strict=True)
+ ),
+ )
+ wav_write(folder / "mix.wav", mixed)
+ return paths, timeline, length / RATE
diff --git a/backend/app/shared/base_model.py b/backend/app/shared/base_model.py
new file mode 100644
index 0000000000000000000000000000000000000000..400f8a81c162f828daa4c95647d69db7b079816b
--- /dev/null
+++ b/backend/app/shared/base_model.py
@@ -0,0 +1,16 @@
+from datetime import datetime, timezone
+from uuid import uuid4
+from sqlalchemy import String, DateTime, Integer
+from sqlalchemy.orm import Mapped, mapped_column
+from app.database import Base
+
+
+class Record(Base):
+ __abstract__ = True
+ id: Mapped[str] = mapped_column(
+ String(36), primary_key=True, default=lambda: str(uuid4())
+ )
+ created_at: Mapped[datetime] = mapped_column(
+ DateTime(timezone=True), default=lambda: datetime.now(timezone.utc)
+ )
+ version: Mapped[int] = mapped_column(Integer, default=1)
diff --git a/backend/app/shared/base_repository.py b/backend/app/shared/base_repository.py
new file mode 100644
index 0000000000000000000000000000000000000000..7bc9dc6384d2a51b1d58bd9403bf3ecc97fe287c
--- /dev/null
+++ b/backend/app/shared/base_repository.py
@@ -0,0 +1,40 @@
+from sqlalchemy import select
+from sqlalchemy.orm import Session
+from fastapi import HTTPException
+
+
+class Repository:
+ model = None
+
+ def __init__(self, session: Session):
+ self.session = session
+
+ def list(self):
+ return self.session.scalars(
+ select(self.model).order_by(self.model.created_at)
+ ).all()
+
+ def get(self, record_id: str):
+ record = self.session.get(self.model, record_id)
+ if record is None:
+ raise HTTPException(404, f"{self.model.__name__} not found")
+ return record
+
+ def create(self, values):
+ record = self.model(**values)
+ self.session.add(record)
+ self.session.commit()
+ self.session.refresh(record)
+ return record
+
+ def update(self, record, values):
+ for key, value in values.items():
+ setattr(record, key, value)
+ record.version += 1
+ self.session.commit()
+ self.session.refresh(record)
+ return record
+
+ def delete(self, record):
+ self.session.delete(record)
+ self.session.commit()
diff --git a/backend/app/shared/storage_service.py b/backend/app/shared/storage_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..65a5346b3ec79080b8cf56e223e580311220e383
--- /dev/null
+++ b/backend/app/shared/storage_service.py
@@ -0,0 +1,102 @@
+from io import BytesIO
+from pathlib import Path
+from uuid import uuid4
+import wave
+from fastapi import HTTPException
+from PIL import Image, UnidentifiedImageError
+from sqlalchemy.orm import Session
+from app.assets.asset_model import Asset
+from app.config import settings
+
+
+class StorageService:
+ def __init__(self, session: Session):
+ self.session = session
+
+ def get(self, asset_id: str, kind: str | None = None) -> Asset:
+ asset = self.session.get(Asset, asset_id)
+ if not asset or asset.revoked:
+ raise HTTPException(404, "Asset missing or authorization revoked")
+ if kind and asset.kind != kind:
+ raise HTTPException(422, f"Expected {kind} asset")
+ return asset
+
+ def path(self, asset: Asset) -> Path:
+ root = settings.assets_dir.resolve()
+ path = (root / asset.path).resolve()
+ if not path.is_relative_to(root):
+ raise HTTPException(400, "Invalid asset path")
+ return path
+
+ def register(
+ self,
+ path: Path,
+ kind: str,
+ name: str,
+ rights="generated",
+ note="Created in Character Studio",
+ ):
+ asset = Asset(
+ kind=kind,
+ path=str(path.resolve().relative_to(settings.assets_dir.resolve())),
+ original_name=name,
+ rights=rights,
+ rights_note=note,
+ )
+ self.session.add(asset)
+ self.session.commit()
+ self.session.refresh(asset)
+ return asset
+
+ def upload(self, data: bytes, name: str, kind: str, rights: str, note: str):
+ if settings.fixed_demo_mode and kind == "image":
+ raise HTTPException(
+ 403, "Image uploads are disabled; this MVP uses the built-in image"
+ )
+ if kind not in {"image", "voice"} or rights not in {
+ "original",
+ "licensed",
+ "authorized",
+ }:
+ raise HTTPException(422, "Invalid asset or rights type")
+ if len(note.strip()) < 5 or len(note) > 2000:
+ raise HTTPException(
+ 422, "Provide the ownership, license or authorization details"
+ )
+ if kind == "image" and rights == "authorized":
+ raise HTTPException(
+ 422,
+ "Real-person likeness uploads are not enabled; use original fictional or licensed fictional images",
+ )
+ try:
+ if kind == "image":
+ with Image.open(BytesIO(data)) as image:
+ if image.width * image.height > 20_000_000:
+ raise ValueError("Image exceeds 20 megapixels")
+ image.load()
+ result = BytesIO()
+ image.convert("RGB").save(result, format="JPEG")
+ data = result.getvalue()
+ suffix = ".jpg"
+ else:
+ with wave.open(BytesIO(data)) as audio:
+ duration = audio.getnframes() / audio.getframerate()
+ if not 3 <= duration <= 30 or audio.getsampwidth() != 2:
+ raise ValueError(
+ "Use a 3–30 second, 16-bit PCM WAV voice recording"
+ )
+ suffix = ".wav"
+ except (
+ UnidentifiedImageError,
+ Image.DecompressionBombError,
+ OSError,
+ EOFError,
+ wave.Error,
+ ValueError,
+ ) as exc:
+ raise HTTPException(422, str(exc) or "Invalid media file") from exc
+ folder = settings.assets_dir / ("characters" if kind == "image" else "audio")
+ folder.mkdir(parents=True, exist_ok=True)
+ path = folder / (str(uuid4()) + suffix)
+ path.write_bytes(data)
+ return self.register(path, kind, Path(name).name[:300], rights, note)
diff --git a/backend/app/shared/video_service.py b/backend/app/shared/video_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..ad7f55fa522c8a64163352746d13666cd29419fc
--- /dev/null
+++ b/backend/app/shared/video_service.py
@@ -0,0 +1,79 @@
+from pathlib import Path
+import subprocess
+import imageio_ffmpeg
+from PIL import Image, ImageDraw
+
+
+class VideoService:
+ def storyboard(self, image: Path, output: Path, duration: int):
+ canvas = Image.open(image).convert("RGB")
+ canvas.thumbnail((1280, 650))
+ frame = Image.new("RGB", (1280, 720), "#16171c")
+ frame.paste(canvas, ((1280 - canvas.width) // 2, (650 - canvas.height) // 2))
+ ImageDraw.Draw(frame).text(
+ (28, 679),
+ "AI CHARACTER STUDIO | STORYBOARD ONLY - NO VOICE OR ANIMATION",
+ fill="white",
+ font_size=21,
+ )
+ poster = output.with_suffix(".jpg")
+ frame.save(poster)
+ subprocess.run(
+ [
+ imageio_ffmpeg.get_ffmpeg_exe(),
+ "-y",
+ "-loop",
+ "1",
+ "-i",
+ str(poster),
+ "-t",
+ str(duration),
+ "-r",
+ "12",
+ "-c:v",
+ "libx264",
+ "-preset",
+ "ultrafast",
+ "-pix_fmt",
+ "yuv420p",
+ "-movflags",
+ "+faststart",
+ str(output),
+ ],
+ check=True,
+ capture_output=True,
+ timeout=180,
+ )
+
+ def finalize(self, video: Path, audio: Path, output: Path):
+ subprocess.run(
+ [
+ imageio_ffmpeg.get_ffmpeg_exe(),
+ "-y",
+ "-i",
+ str(video),
+ "-i",
+ str(audio),
+ "-map",
+ "0:v:0",
+ "-map",
+ "1:a:0",
+ "-c:v",
+ "libx264",
+ "-preset",
+ "fast",
+ "-pix_fmt",
+ "yuv420p",
+ "-c:a",
+ "aac",
+ "-shortest",
+ "-movflags",
+ "+faststart",
+ "-metadata",
+ "comment=AI-generated fictional characters",
+ str(output),
+ ],
+ check=True,
+ capture_output=True,
+ timeout=300,
+ )
diff --git a/backend/app/system/__init__.py b/backend/app/system/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/app/system/system_controller.py b/backend/app/system/system_controller.py
new file mode 100644
index 0000000000000000000000000000000000000000..259bc405fa7cdb5311a762d0a580374ccc73281b
--- /dev/null
+++ b/backend/app/system/system_controller.py
@@ -0,0 +1,92 @@
+import json
+from datetime import datetime, timezone
+import httpx
+from fastapi import APIRouter
+from app.config import settings
+from app.ai.provider_readiness import lightweight_ready
+
+router = APIRouter(prefix="/system", tags=["system"])
+
+
+@router.get("/status")
+def status():
+ heartbeat = settings.assets_dir.parent / "worker-heartbeat.json"
+ worker = False
+ if heartbeat.exists():
+ try:
+ timestamp = datetime.fromisoformat(
+ json.loads(heartbeat.read_text())["updated_at"]
+ )
+ worker = (datetime.now(timezone.utc) - timestamp).total_seconds() < 30
+ except (ValueError, KeyError, OSError):
+ pass
+ return {
+ "worker": worker,
+ "providers": {
+ "dialogue": {
+ "name": settings.dialogue_model,
+ "configured": bool(settings.ollama_url),
+ },
+ "speech": {
+ "name": settings.speech_provider,
+ "configured": bool(settings.speech_url),
+ },
+ "video": {
+ "name": settings.video_provider,
+ "configured": bool(settings.video_url),
+ },
+ },
+ "capabilities": {
+ "scripted_dialogue": True,
+ "performance_controls": False,
+ "storyboard": True,
+ "ai_dialogue": bool(settings.enable_ai_drafts and settings.ollama_url),
+ "animated_video": bool(
+ settings.enable_animated_renders
+ and settings.speech_url
+ and settings.video_url
+ and (settings.video_provider != "sadtalker" or lightweight_ready())
+ ),
+ },
+ "limitations": [
+ "Preset voices do not guarantee dialect or emotional delivery.",
+ "SadTalker animates two portraits independently; shared reactions and body gestures are not generated.",
+ "Review exact words, faces, lip-sync and listening reactions after GPU generation.",
+ "Uploaded likenesses must depict fictional characters; third-party real-person likeness verification is not enabled.",
+ ],
+ }
+
+
+@router.post("/check")
+def check():
+ results = {}
+ for name, url in [
+ ("dialogue", settings.ollama_url),
+ ("speech", settings.speech_url),
+ ("video", settings.video_url),
+ ]:
+ if not url:
+ results[name] = {"ready": False, "message": "Not configured"}
+ continue
+ try:
+ suffix = "/api/tags" if name == "dialogue" else "/health"
+ response = httpx.get(
+ url.rstrip("/") + suffix,
+ headers={"Authorization": f"Bearer {settings.provider_token}"},
+ timeout=5,
+ )
+ response.raise_for_status()
+ ready = True
+ if name == "dialogue":
+ ready = settings.dialogue_model in {
+ m["name"] for m in response.json().get("models", [])
+ }
+ results[name] = {
+ "ready": ready,
+ "message": "Connected"
+ if ready
+ else "Configured model is not installed",
+ }
+ except (httpx.HTTPError, ValueError, KeyError):
+ results[name] = {"ready": False, "message": "Service not reachable"}
+ return results
diff --git a/backend/demo_assets/scene.png b/backend/demo_assets/scene.png
new file mode 100644
index 0000000000000000000000000000000000000000..714b524d4e101d6b767e151d01dcbd2ed2b34f2a
--- /dev/null
+++ b/backend/demo_assets/scene.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:afa35cd9226e66323a958365a6e68d6c6406a46246304ec433440496e226dd37
+size 2235914
diff --git a/backend/model_services/chatterbox_service.py b/backend/model_services/chatterbox_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..fdc60ecbf672a393f437b9aee8270ae270f0c7ae
--- /dev/null
+++ b/backend/model_services/chatterbox_service.py
@@ -0,0 +1,66 @@
+"""Run inside Chatterbox's own environment, on a private GPU service."""
+
+import os
+import secrets
+import tempfile
+import threading
+from pathlib import Path
+from functools import lru_cache
+from fastapi import FastAPI, File, Form, Header, HTTPException, UploadFile
+from fastapi.responses import Response
+
+app = FastAPI(title="Chatterbox adapter")
+lock = threading.Lock()
+
+
+def authorize(authorization):
+ token = os.environ.get("PROVIDER_TOKEN", "")
+ if not token or not secrets.compare_digest(authorization, "Bearer " + token):
+ raise HTTPException(401, "Provider authorization required")
+
+
+@lru_cache
+def get_model():
+ from chatterbox.tts import ChatterboxTTS
+
+ return ChatterboxTTS.from_pretrained(device=os.environ.get("TTS_DEVICE", "cuda"))
+
+
+@app.get("/health")
+def health(authorization: str = Header(default="")):
+ authorize(authorization)
+ return {
+ "status": "ok",
+ "model": "chatterbox",
+ "loaded": get_model.cache_info().currsize > 0,
+ }
+
+
+@app.post("/synthesize")
+def synthesize(
+ reference: UploadFile = File(...),
+ text: str = Form(...),
+ expressiveness: float = Form(0.5),
+ authorization: str = Header(default=""),
+):
+ authorize(authorization)
+ if not 1 <= len(text) <= 1500 or not 0 <= expressiveness <= 1:
+ raise HTTPException(422, "Invalid speech request")
+ data = reference.file.read(20 * 1024 * 1024 + 1)
+ if len(data) > 20 * 1024 * 1024:
+ raise HTTPException(413, "Reference too large")
+ import torchaudio
+
+ with lock, tempfile.TemporaryDirectory() as folder:
+ path = Path(folder) / "reference.wav"
+ path.write_bytes(data)
+ model = get_model()
+ audio = model.generate(
+ text,
+ audio_prompt_path=str(path),
+ exaggeration=expressiveness,
+ cfg_weight=0.5,
+ )
+ output = Path(folder) / "speech.wav"
+ torchaudio.save(str(output), audio, model.sr)
+ return Response(output.read_bytes(), media_type="audio/wav")
diff --git a/backend/model_services/infinitetalk_service.py b/backend/model_services/infinitetalk_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..f64fdf093cecabdac1077926980d8c8d08a99fdd
--- /dev/null
+++ b/backend/model_services/infinitetalk_service.py
@@ -0,0 +1,116 @@
+"""HTTP adapter for the official InfiniteTalk CLI. Run in its CUDA environment."""
+
+import json
+import os
+import secrets
+import subprocess
+import sys
+import tempfile
+import threading
+from pathlib import Path
+from fastapi import FastAPI, File, Form, Header, HTTPException, UploadFile
+from fastapi.responses import Response
+
+app = FastAPI(title="InfiniteTalk adapter")
+lock = threading.Lock()
+
+
+def authorize(authorization):
+ token = os.environ.get("PROVIDER_TOKEN", "")
+ if not token or not secrets.compare_digest(authorization, "Bearer " + token):
+ raise HTTPException(401, "Provider authorization required")
+
+
+def config():
+ root = Path(os.environ.get("INFINITETALK_ROOT", "/opt/InfiniteTalk"))
+ weights = Path(os.environ.get("VIDEO_WEIGHTS_DIR", str(root / "weights")))
+ return root, weights
+
+
+@app.get("/health")
+def health(authorization: str = Header(default="")):
+ authorize(authorization)
+ root, weights = config()
+ required = [
+ root / "generate_infinitetalk.py",
+ weights / "Wan2.1-I2V-14B-480P",
+ weights / "chinese-wav2vec2-base",
+ weights / "InfiniteTalk/multi/infinitetalk.safetensors",
+ ]
+ if not all(p.exists() for p in required):
+ raise HTTPException(503, "Install InfiniteTalk and all model weights first")
+ return {"status": "ok", "model": "infinitetalk", "inference_verified": False}
+
+
+@app.post("/generate")
+def generate(
+ image: UploadFile = File(...),
+ audio1: UploadFile = File(...),
+ audio2: UploadFile = File(...),
+ prompt: str = Form(...),
+ authorization: str = Header(default=""),
+):
+ authorize(authorization)
+ root, weights = config()
+ if len(prompt) > 16000:
+ raise HTTPException(422, "Prompt too long")
+ with lock, tempfile.TemporaryDirectory() as folder:
+ folder = Path(folder)
+ for name, upload in [
+ ("scene.jpg", image),
+ ("person1.wav", audio1),
+ ("person2.wav", audio2),
+ ]:
+ data = upload.file.read(30 * 1024 * 1024 + 1)
+ if len(data) > 30 * 1024 * 1024:
+ raise HTTPException(413, "Media too large")
+ (folder / name).write_bytes(data)
+ manifest = {
+ "prompt": prompt,
+ "cond_video": str(folder / "scene.jpg"),
+ "audio_type": "para",
+ "cond_audio": {
+ "person1": str(folder / "person1.wav"),
+ "person2": str(folder / "person2.wav"),
+ },
+ }
+ (folder / "input.json").write_text(json.dumps(manifest))
+ command = [
+ sys.executable,
+ str(root / "generate_infinitetalk.py"),
+ "--ckpt_dir",
+ str(weights / "Wan2.1-I2V-14B-480P"),
+ "--wav2vec_dir",
+ str(weights / "chinese-wav2vec2-base"),
+ "--infinitetalk_dir",
+ str(weights / "InfiniteTalk/multi/infinitetalk.safetensors"),
+ "--input_json",
+ str(folder / "input.json"),
+ "--size",
+ "infinitetalk-480",
+ "--sample_steps",
+ "40",
+ "--mode",
+ "streaming",
+ "--motion_frame",
+ "9",
+ "--num_persistent_param_in_dit",
+ "0",
+ "--save_file",
+ str(folder / "render"),
+ ]
+ try:
+ subprocess.run(
+ command,
+ cwd=root,
+ check=True,
+ timeout=int(os.getenv("VIDEO_TIMEOUT", "3600")),
+ )
+ except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as exc:
+ raise HTTPException(
+ 500, "InfiniteTalk failed; inspect private service logs"
+ ) from exc
+ output = folder / "render.mp4"
+ if not output.exists():
+ raise HTTPException(500, "Model did not produce the expected MP4")
+ return Response(output.read_bytes(), media_type="video/mp4")
diff --git a/backend/model_services/lightweight_service.py b/backend/model_services/lightweight_service.py
new file mode 100644
index 0000000000000000000000000000000000000000..3abe92ec62eb4b385447f3a746a63c57372deae6
--- /dev/null
+++ b/backend/model_services/lightweight_service.py
@@ -0,0 +1,289 @@
+"""Private Kokoro + SadTalker service; GPU inference runs in SadTalker's venv."""
+
+import io
+import math
+import os
+import secrets
+import subprocess
+import tempfile
+import threading
+import wave
+from functools import lru_cache
+from pathlib import Path
+
+from fastapi import FastAPI, File, Form, Header, HTTPException, UploadFile
+from fastapi.responses import Response
+
+app = FastAPI(title="Kokoro and SadTalker")
+lock = threading.Lock()
+VOICES = {"af_heart", "af_bella"}
+
+
+def authorize(value):
+ token = os.getenv("PROVIDER_TOKEN", "")
+ if not token or not secrets.compare_digest(value, "Bearer " + token):
+ raise HTTPException(401, "Provider authorization required")
+
+
+def run(command, timeout=120, cwd=None):
+ try:
+ subprocess.run(command, check=True, timeout=timeout, cwd=cwd)
+ except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as exc:
+ raise HTTPException(
+ 500, "Rendering failed; inspect model service logs"
+ ) from exc
+
+
+def sad_config():
+ return Path(os.getenv("SADTALKER_ROOT", "/opt/SadTalker")), os.getenv(
+ "SADTALKER_PYTHON", "/opt/sadtalker-venv/bin/python"
+ )
+
+
+@lru_cache
+def check_runtime():
+ root, python = sad_config()
+ result = subprocess.run(
+ [
+ python,
+ "-c",
+ "import torch; import src.utils.preprocess; "
+ "raise SystemExit(0 if torch.cuda.is_available() else 1)",
+ ],
+ cwd=root,
+ capture_output=True,
+ timeout=30,
+ )
+ if result.returncode:
+ raise HTTPException(
+ 503, "SadTalker requires its installed dependencies and an NVIDIA GPU"
+ )
+ # Load CPU speech weights once; failures leave rendering unavailable.
+ kokoro()
+ return True
+
+
+@lru_cache
+def kokoro():
+ from kokoro import KPipeline
+
+ # Save GPU memory for animation. Downloads the public weights on first use.
+ return KPipeline(lang_code="a", repo_id="hexgrad/Kokoro-82M", device="cpu")
+
+
+@app.get("/health")
+def health(authorization: str = Header(default="")):
+ authorize(authorization)
+ root, python = sad_config()
+ required = [
+ root / "inference.py",
+ Path(python),
+ root / "checkpoints/SadTalker_V0.0.2_256.safetensors",
+ root / "checkpoints/mapping_00109-model.pth.tar",
+ ]
+ if not all(p.is_file() for p in required):
+ raise HTTPException(503, "Install SadTalker environment and checkpoints")
+ with lock:
+ check_runtime()
+ return {"status": "ok", "model": "kokoro+sadtalker", "inference_verified": False}
+
+
+@app.post("/synthesize")
+def synthesize(
+ text: str = Form(...),
+ voice: str = Form(...),
+ authorization: str = Header(default=""),
+):
+ authorize(authorization)
+ if voice not in VOICES or not text.strip() or len(text) > 1500:
+ raise HTTPException(
+ 422, "Use a built-in voice and 1–1500 characters of dialogue"
+ )
+ import numpy as np
+ import soundfile as sf
+
+ with lock:
+ chunks = [audio.numpy() for _, _, audio in kokoro()(text, voice=voice, speed=1)]
+ if not chunks:
+ raise HTTPException(422, "No speech was generated")
+ output = io.BytesIO()
+ sf.write(output, np.concatenate(chunks), 24000, format="WAV", subtype="PCM_16")
+ return Response(output.getvalue(), media_type="audio/wav")
+
+
+def save_upload(upload, path):
+ data = upload.file.read(30 * 1024 * 1024 + 1)
+ if len(data) > 30 * 1024 * 1024:
+ raise HTTPException(413, "Media too large")
+ path.write_bytes(data)
+
+
+def wav_duration(path):
+ try:
+ with wave.open(str(path), "rb") as audio:
+ if (audio.getnchannels(), audio.getsampwidth(), audio.getframerate()) != (
+ 1,
+ 2,
+ 24000,
+ ):
+ raise ValueError("Expected mono PCM 24 kHz")
+ return audio.getnframes() / audio.getframerate()
+ except (wave.Error, ValueError, EOFError) as exc:
+ raise HTTPException(422, "Expected mono 24 kHz PCM WAV") from exc
+
+
+@app.post("/generate")
+def generate(
+ image: UploadFile = File(...),
+ audio1: UploadFile = File(...),
+ audio2: UploadFile = File(...),
+ prompt: str = Form(""),
+ authorization: str = Header(default=""),
+):
+ authorize(authorization)
+ health(authorization)
+ root, python = sad_config()
+ import imageio_ffmpeg
+
+ ffmpeg = imageio_ffmpeg.get_ffmpeg_exe()
+ with lock, tempfile.TemporaryDirectory() as temp:
+ folder = Path(temp)
+ scene = folder / "scene.png"
+ save_upload(image, scene)
+ tracks = [folder / "left.wav", folder / "right.wav"]
+ for upload, path in zip([audio1, audio2], tracks):
+ save_upload(upload, path)
+ lengths = [wav_duration(path) for path in tracks]
+ duration = lengths[0]
+ if not 1 <= duration <= 65 or abs(duration - lengths[1]) > 0.04:
+ raise HTTPException(
+ 422, "Supply two aligned tracks of equal length, up to 65 seconds"
+ )
+ portraits = []
+ for side in range(2):
+ portrait = folder / f"portrait-{side}.png"
+ # Isolate each face from the supplied fixed image, retaining its background.
+ run(
+ [
+ ffmpeg,
+ "-y",
+ "-i",
+ str(scene),
+ "-vf",
+ f"crop=trunc(iw/4)*2:trunc(ih/2)*2:{'0' if side == 0 else 'iw-ow'}:0",
+ "-frames:v",
+ "1",
+ str(portrait),
+ ]
+ )
+ portraits.append(portrait)
+ segments = []
+ # Bound per-inference frame memory; both speakers share the same clock.
+ for index in range(math.ceil(duration / 10)):
+ start = index * 10
+ seconds = min(10, duration - start)
+ clips = []
+ for side in range(2):
+ audio = folder / f"chunk-{index}-{side}.wav"
+ run(
+ [
+ ffmpeg,
+ "-y",
+ "-i",
+ str(tracks[side]),
+ "-ss",
+ str(start),
+ "-t",
+ str(seconds),
+ "-c:a",
+ "pcm_s16le",
+ str(audio),
+ ]
+ )
+ results = folder / f"result-{index}-{side}"
+ results.mkdir()
+ run(
+ [
+ python,
+ str(root / "inference.py"),
+ "--source_image",
+ str(portraits[side]),
+ "--driven_audio",
+ str(audio),
+ "--checkpoint_dir",
+ str(root / "checkpoints"),
+ "--result_dir",
+ str(results),
+ "--size",
+ "256",
+ "--batch_size",
+ "1",
+ "--preprocess",
+ "full",
+ "--still",
+ ],
+ timeout=int(os.getenv("VIDEO_TIMEOUT", "3600")),
+ cwd=root,
+ )
+ outputs = list(results.glob("*.mp4"))
+ if len(outputs) != 1:
+ raise HTTPException(
+ 500, "SadTalker did not produce the expected clip"
+ )
+ clips.append(outputs[0])
+ segment = folder / f"segment-{index}.mp4"
+ filters = (
+ ";".join(
+ f"[{side}:v]scale=480:540:force_original_aspect_ratio=decrease,"
+ f"pad=480:540:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=25,"
+ f"tpad=stop_mode=clone:stop_duration=1[v{side}]"
+ for side in range(2)
+ )
+ + ";[v0][v1]hstack=inputs=2[out]"
+ )
+ run(
+ [
+ ffmpeg,
+ "-y",
+ "-i",
+ str(clips[0]),
+ "-i",
+ str(clips[1]),
+ "-filter_complex",
+ filters,
+ "-map",
+ "[out]",
+ "-an",
+ "-t",
+ str(seconds),
+ "-c:v",
+ "libx264",
+ "-preset",
+ "fast",
+ "-pix_fmt",
+ "yuv420p",
+ str(segment),
+ ]
+ )
+ segments.append(segment)
+ manifest = folder / "segments.txt"
+ manifest.write_text("".join(f"file '{p.name}'\n" for p in segments))
+ output = folder / "conversation.mp4"
+ run(
+ [
+ ffmpeg,
+ "-y",
+ "-f",
+ "concat",
+ "-safe",
+ "1",
+ "-i",
+ str(manifest),
+ "-c",
+ "copy",
+ "-movflags",
+ "+faststart",
+ str(output),
+ ]
+ )
+ return Response(output.read_bytes(), media_type="video/mp4")
diff --git a/backend/model_services/requirements-lightweight.txt b/backend/model_services/requirements-lightweight.txt
new file mode 100644
index 0000000000000000000000000000000000000000..8db9bf742059f7ca5a8d532759afb930b59f6fa5
--- /dev/null
+++ b/backend/model_services/requirements-lightweight.txt
@@ -0,0 +1,4 @@
+# Install CPU torch first; see Dockerfile.
+kokoro==0.9.4
+soundfile>=0.12,<1
+numpy>=1.26,<2
diff --git a/backend/model_services/requirements-sadtalker.txt b/backend/model_services/requirements-sadtalker.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f73be49dacc55ef2d438080c98aa9141ff6b8aeb
--- /dev/null
+++ b/backend/model_services/requirements-sadtalker.txt
@@ -0,0 +1,24 @@
+# Isolated Python 3.10 inference environment. Install torch/torchvision first.
+numpy==1.23.4
+face_alignment==1.3.5
+imageio==2.19.3
+imageio-ffmpeg==0.4.7
+librosa==0.9.2
+numba==0.57.1
+resampy==0.3.1
+pydub==0.25.1
+scipy==1.10.1
+kornia==0.6.8
+tqdm
+yacs==0.1.8
+pyyaml
+joblib==1.1.0
+scikit-image==0.19.3
+basicsr==1.4.2
+facexlib==0.3.0
+gfpgan==1.3.8
+av>=10,<13
+safetensors>=0.4,<1
+Pillow==9.5.0
+opencv-python-headless==4.8.1.78
+opencv-python==4.8.1.78
diff --git a/backend/requirements-dev.txt b/backend/requirements-dev.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1d6c5dc93ee3078dbed0c630d7e01fe87cedd5fd
--- /dev/null
+++ b/backend/requirements-dev.txt
@@ -0,0 +1,3 @@
+-r requirements.txt
+pytest>=8,<10
+ruff>=0.11,<1
diff --git a/backend/requirements.txt b/backend/requirements.txt
new file mode 100644
index 0000000000000000000000000000000000000000..f7a27aaa8ee1d4b1241b29a4d455671ddc0b1f53
--- /dev/null
+++ b/backend/requirements.txt
@@ -0,0 +1,9 @@
+fastapi>=0.115,<1
+uvicorn>=0.30,<1
+pydantic>=2.9,<3
+pydantic-settings>=2.5,<3
+SQLAlchemy>=2.0,<3
+python-multipart>=0.0.20
+httpx>=0.28,<1
+Pillow>=11,<13
+imageio-ffmpeg>=0.6,<1
diff --git a/backend/tests/.gitkeep b/backend/tests/.gitkeep
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py
new file mode 100644
index 0000000000000000000000000000000000000000..3bc10dd80f4a4bc88abeff1203ab6c8254f42a84
--- /dev/null
+++ b/backend/tests/conftest.py
@@ -0,0 +1,20 @@
+import os
+from pathlib import Path
+from tempfile import TemporaryDirectory
+
+_storage = TemporaryDirectory()
+os.environ["DATABASE_URL"] = "sqlite:///" + str(Path(_storage.name) / "test.db")
+os.environ["ASSETS_DIR"] = str(Path(_storage.name) / "assets")
+os.environ["SEED_CHARACTERS"] = "true"
+os.environ["SPEECH_URL"] = ""
+os.environ["VIDEO_URL"] = ""
+
+import pytest
+from fastapi.testclient import TestClient
+from app.main import app
+
+
+@pytest.fixture(scope="session")
+def client():
+ with TestClient(app) as client:
+ yield client
diff --git a/backend/tests/test_workflow.py b/backend/tests/test_workflow.py
new file mode 100644
index 0000000000000000000000000000000000000000..e521e99ae8cc525a9d880ca2faa21bc846705eb4
--- /dev/null
+++ b/backend/tests/test_workflow.py
@@ -0,0 +1,201 @@
+from io import BytesIO
+from PIL import Image
+from app.generations.generation_worker import claim_job, run_generation
+from app.shared.audio_service import AudioService, wav_write, RATE
+from array import array
+import pytest
+
+
+def upload_image(client):
+ image = BytesIO()
+ Image.new("RGB", (640, 360), "#b7a9c8").save(image, format="PNG")
+ response = client.post(
+ "/api/v1/assets",
+ files={"file": ("fictional-test.png", image.getvalue(), "image/png")},
+ data={
+ "kind": "image",
+ "rights": "original",
+ "rights_note": "Synthetic test image owned by this test suite",
+ "consent": "true",
+ },
+ )
+ assert response.status_code == 201, response.text
+ return response.json()["id"]
+
+
+def setup_project(client):
+ characters = client.get("/api/v1/characters").json()
+ ids = [c["id"] for c in characters[:2]]
+ script = client.post(
+ "/api/v1/conversations",
+ json={
+ "title": "Exact words test",
+ "approved": True,
+ "turns": [
+ {"character_id": ids[0], "text": "Don't change my words."},
+ {"character_id": ids[1], "text": "Of course, I won't."},
+ ],
+ },
+ ).json()
+ scene = client.post(
+ "/api/v1/scenes",
+ json={
+ "name": "Test room",
+ "image_asset_id": upload_image(client),
+ "character_ids": ids,
+ "approved": True,
+ },
+ ).json()
+ return script, scene
+
+
+def test_character_roundtrip(client):
+ original = client.get("/api/v1/characters/royale").json()
+ original["profile"]["region"] = "Creator-defined Atlanta influence"
+ result = client.put("/api/v1/characters/royale", json=original)
+ assert result.status_code == 200
+ assert result.json()["version"] == original["version"] + 1
+ assert (
+ client.get("/api/v1/characters/royale").json()["profile"]["region"]
+ == original["profile"]["region"]
+ )
+
+
+def test_validation_and_consent(client):
+ assert client.get("/api/v1/characters/missing").status_code == 404
+ result = client.post(
+ "/api/v1/assets",
+ files={"file": ("x.png", b"invalid", "image/png")},
+ data={
+ "kind": "image",
+ "rights": "original",
+ "rights_note": "Owned test",
+ "consent": "false",
+ },
+ )
+ assert result.status_code == 422
+ result = client.post(
+ "/api/v1/assets",
+ files={"file": ("x.png", b"invalid", "image/png")},
+ data={
+ "kind": "image",
+ "rights": "original",
+ "rights_note": "Owned test",
+ "consent": "true",
+ },
+ )
+ assert result.status_code == 422
+ assert (
+ client.post(
+ "/api/v1/scenes",
+ json={
+ "name": "Bad",
+ "image_asset_id": upload_image(client),
+ "character_ids": ["royale", "royale"],
+ },
+ ).status_code
+ == 422
+ )
+
+
+def test_script_approval_and_snapshot(client):
+ script, scene = setup_project(client)
+ script["approved"] = False
+ client.put(f"/api/v1/conversations/{script['id']}", json=script)
+ data = {
+ "conversation_id": script["id"],
+ "scene_id": scene["id"],
+ "kind": "storyboard",
+ "target_seconds": 10,
+ }
+ assert client.post("/api/v1/generations", json=data).status_code == 422
+ script["approved"] = True
+ client.put(f"/api/v1/conversations/{script['id']}", json=script)
+ job = client.post("/api/v1/generations", json=data).json()
+ script["turns"][0]["text"] = "A changed script."
+ client.put(f"/api/v1/conversations/{script['id']}", json=script)
+ saved = client.get(f"/api/v1/generations/{job['id']}").json()
+ assert (
+ saved["settings"]["conversation"]["turns"][0]["text"]
+ == "Don't change my words."
+ )
+ assert client.post(f"/api/v1/generations/{job['id']}/cancel").status_code == 200
+ assert client.post(f"/api/v1/generations/{job['id']}/cancel").status_code == 409
+
+
+def test_real_storyboard_render(client):
+ script, scene = setup_project(client)
+ response = client.post(
+ "/api/v1/generations",
+ json={
+ "conversation_id": script["id"],
+ "scene_id": scene["id"],
+ "target_seconds": 10,
+ },
+ )
+ assert response.status_code == 201
+ job_id = response.json()["id"]
+ assert claim_job() == job_id
+ assert claim_job() is None
+ run_generation(job_id)
+ job = client.get(f"/api/v1/generations/{job_id}").json()
+ assert job["status"] == "completed", job
+ assert job["duration"] == 10
+ video = client.get(f"/api/v1/assets/{job['output_asset_id']}/file")
+ assert video.status_code == 200 and b"ftyp" in video.content[:64]
+ assert (
+ client.post(
+ f"/api/v1/generations/{job_id}/review",
+ json={
+ "exact_words": True,
+ "consistent_identity": True,
+ "natural_reactions": True,
+ "lip_sync": True,
+ },
+ ).status_code
+ == 409
+ )
+
+
+def test_gpu_not_faked_and_revocation(client):
+ script, scene = setup_project(client)
+ response = client.post(
+ "/api/v1/generations",
+ json={
+ "conversation_id": script["id"],
+ "scene_id": scene["id"],
+ "kind": "animated",
+ },
+ )
+ assert response.status_code in {422, 503}
+ asset_id = scene["image_asset_id"]
+ assert client.post(f"/api/v1/assets/{asset_id}/revoke").status_code == 200
+ assert client.get(f"/api/v1/assets/{asset_id}/file").status_code == 404
+ assert (
+ client.post(
+ "/api/v1/generations",
+ json={"conversation_id": script["id"], "scene_id": scene["id"]},
+ ).status_code
+ == 404
+ )
+
+
+def test_audio_alignment_and_duration(tmp_path):
+ clips = []
+ for i in range(2):
+ path = tmp_path / f"{i}.wav"
+ wav_write(path, array("h", [1000]) * RATE * 4)
+ clips.append(path)
+ turns = [
+ {"character_id": "a", "text": "first", "pause_after": 1},
+ {"character_id": "b", "text": "second", "pause_after": 1},
+ ]
+ paths, timeline, duration = AudioService().align(
+ turns, clips, ["a", "b"], tmp_path, 10
+ )
+ assert duration == 10 and timeline[1]["start"] == 5 and len(paths) == 2
+ from app.shared.audio_service import wav_read
+
+ assert max(wav_read(paths[1])[: RATE * 5]) == 0
+ with pytest.raises(ValueError, match="Words were not changed"):
+ AudioService().align(turns, clips, ["a", "b"], tmp_path, 60)
diff --git a/docs/lightweight-mvp.md b/docs/lightweight-mvp.md
new file mode 100644
index 0000000000000000000000000000000000000000..000e2f41f862db510b086151388d141cc6735b13
--- /dev/null
+++ b/docs/lightweight-mvp.md
@@ -0,0 +1,47 @@
+# Lightweight MVP: Kokoro + SadTalker
+
+Current path: creator-written dialogue → Kokoro-82M → aligned speaker WAVs → SadTalker → FFmpeg MP4.
+No LLM, Ollama URL, voice recording, Unreal Engine or external inference API key is required for this path.
+This integration has not yet been built or rendered on a Hugging Face GPU. Frontend build and Python static checks are separate from GPU validation.
+
+## Deploy on Hugging Face
+
+1. Use a Docker Space with this repository and its root Dockerfile. Assign an NVIDIA GPU; a T4 16 GB is a starting trial configuration, not a verified memory or speed guarantee. CPU-only Spaces leave talking-video generation disabled.
+2. The Docker build installs two isolated environments and downloads SadTalker checkpoints. No tests or inference run during the build. The first startup/readiness check downloads Kokoro and its language assets, so model readiness can take several minutes.
+3. The container starts FastAPI, one render worker and a private model service bound to `127.0.0.1:8001`. The supervisor generates an internal shared token automatically. No manually configured `SPEECH_URL`, `VIDEO_URL`, `PROVIDER_TOKEN` or `OLLAMA_URL` is needed for the bundled deployment.
+4. Docker defaults enable talking-video requests, but the UI/API also require model-service readiness. `ENABLE_AI_DRAFTS=false` remains the default. Use `ENABLE_ANIMATED_RENDERS=false` to disable talking videos if validation fails.
+5. Open Studio, write both characters' lines, save/approve them and create a 10-second preview first. Review pronunciation, correct speaker/lip assignment, face consistency and video/audio timing on the GPU. Then prepare approximately 120–140 words and select 60 seconds. The exact duration depends on the text; if speech is outside target ±5 seconds, the job fails with its measured duration so the creator can edit and resubmit. Words are never silently cut or rewritten.
+6. Preview/download the latest submitted job directly in Studio. There is no separate Videos or Settings page. Saved conversations persist in SQLite; the inline current-job selection resets on browser refresh.
+
+HF container disk is not a durable backup. For storage that survives rebuilds, attach persistent storage and set `DATABASE_URL=sqlite:////data/app.db`, `ASSETS_DIR=/data/assets`, and optionally `HF_HOME=/data/huggingface`. Without persistent storage, rebuilding the Space can lose scripts and outputs.
+
+The previous private-Space creation attempt was blocked by the account's PRO requirement; deployment and GPU validation still need an available Space.
+
+## Fixed characters and saved settings
+
+The existing generated scene is the only image. No image uploads or character editing are exposed. Runtime preprocessing divides it into left and right portraits without changing the bundled asset. Each portrait keeps its original background, and both remain visible side by side.
+
+R.Royale uses Kokoro `af_heart`; Summer Breeze uses `af_bella`. These are distinct American English female presets, not guarantees of African-American regional identity, AAVE, calm delivery or emotional expressiveness. Auditioning them with the creator is still required. Presets are stored in character profile JSON and copied into each generation snapshot; existing profiles receive their preset during initialization. Saved pace is applied to audio, but natural-language delivery, dialect and gesture instructions are not applied by this smaller pipeline. Those UI controls remain disabled.
+
+SadTalker runs at 256-pixel face resolution, batch size 1, full-image preprocessing, still mode and without a face enhancer. Each aligned track contains silence when the other character speaks. Animation runs sequentially in chunks of up to 10 seconds to bound per-inference frame memory. Reinitializing the model per chunk trades speed and motion continuity for lower peak memory. FFmpeg combines both characters into a 960×540 video, then the worker adds the aligned speech mix.
+
+## Limitations to review
+
+- Independent talking portraits, not a jointly generated shared interaction. No meaningful listening reactions or body gestures.
+- Small head/facial motion; possible artifacts, silence-time mouth movement and motion resets at chunk boundaries.
+- Resolution and output size do not imply high-resolution facial detail.
+- A 60-second video is not expected to render in 60 seconds. Latency and peak VRAM are unmeasured.
+- Same saved inputs do not guarantee bit-for-bit identical animation.
+- No claim that an approved script is pronounced perfectly: listen to the full output.
+
+## Replaceable providers
+
+`backend/app/ai/provider_factory.py` selects the adapters. The queue snapshots provider names, character profiles and exact dialogue. New default providers are `SPEECH_PROVIDER=kokoro` and `VIDEO_PROVIDER=sadtalker`. Existing Chatterbox and InfiniteTalk adapters remain for a future return to the heavier pipeline; they require separate services and authorized voice references. Jobs reject provider mismatches rather than silently changing a saved render's model.
+
+For an external lightweight service, start `uvicorn model_services.lightweight_service:app --host 0.0.0.0 --port 8001` with `PYTHONPATH=backend`, `PROVIDER_TOKEN`, `SADTALKER_ROOT` and `SADTALKER_PYTHON`; configure the app with matching token, both service URLs and `ENABLE_ANIMATED_RENDERS=true`. Keep this service private. The bundled Docker configuration handles this automatically.
+
+## Upstream sources
+
+- Kokoro model and voice list: https://huggingface.co/hexgrad/Kokoro-82M and https://huggingface.co/hexgrad/Kokoro-82M/blob/main/VOICES.md
+- SadTalker source/CLI: https://github.com/OpenTalker/SadTalker (Docker pins commit `cd4c0465ae0b54a6f85af57f5c65fec9fe23e7f8`).
+- SadTalker has older dependency pins; they are isolated in a separate Python environment. The container dependency installation and compatibility still need the remote Docker build.
diff --git a/docs/model-services.md b/docs/model-services.md
new file mode 100644
index 0000000000000000000000000000000000000000..e92e76b45b603464233cb4e6b4c71c857db68753
--- /dev/null
+++ b/docs/model-services.md
@@ -0,0 +1,69 @@
+# GPU model services
+
+The web application and its SQLite worker can run in one CPU Docker Space. GPU
+inference lives in private services reached through `SPEECH_URL` and `VIDEO_URL`.
+Keep the services private or protect them with a random `PROVIDER_TOKEN` set in
+both the app and model services. For Hugging Face private-Space routing, the
+bearer credential also needs permission to access that Space (or expose the model
+service behind a separate authenticated gateway). Never commit tokens or pass them
+to the browser.
+
+## Chatterbox
+
+Use the official Chatterbox installation in its own environment:
+https://github.com/resemble-ai/chatterbox
+
+Add FastAPI, uvicorn and python-multipart to that environment. Set `TTS_DEVICE=cuda`
+and `PROVIDER_TOKEN`, then run from this repository:
+
+```sh
+uvicorn backend.model_services.chatterbox_service:app --host 0.0.0.0 --port 7860
+```
+
+The first synthesis loads weights. Supply two distinct authorized 3–30 second WAV
+references. Requests preserve script text; Chatterbox may still mispronounce or add
+sounds, which must be caught in the creator review. Slang, pronunciation and region
+fields guide draft writing and review, not guaranteed acoustic dialect transfer.
+
+## InfiniteTalk
+
+Install the official repository and its pinned CUDA/PyTorch dependencies separately:
+https://github.com/MeiGen-AI/InfiniteTalk
+
+Download these model components into the expected layout:
+
+```sh
+hf download Wan-AI/Wan2.1-I2V-14B-480P --local-dir /models/Wan2.1-I2V-14B-480P
+hf download TencentGameMate/chinese-wav2vec2-base --local-dir /models/chinese-wav2vec2-base
+hf download MeiGen-AI/InfiniteTalk --local-dir /models/InfiniteTalk
+```
+
+Set `INFINITETALK_ROOT` to the official checkout and `VIDEO_WEIGHTS_DIR=/models`.
+Verify the upstream audio encoder requirements and any revised checkpoint layout
+against the checked-out revision. Add FastAPI, uvicorn and python-multipart, then run:
+
+```sh
+uvicorn backend.model_services.infinitetalk_service:app --host 0.0.0.0 --port 7860
+```
+
+The adapter calls the documented multi-person CLI using `audio_type=para`, one
+shared scene image and silence-aligned per-person tracks. Its initial output is
+480p. Raising resolution, GPU memory tuning and final performance quality must be
+benchmarked on the selected GPU; the web build tests do not establish those claims.
+Model timeout and the application's `PROVIDER_TIMEOUT` must accommodate the full
+render. The app retains raw speech, timelines, separate tracks and render outputs.
+
+## Conversation drafts
+
+Run Ollama separately, pull `qwen3:8b`, and point `OLLAMA_URL` to it. Creator-written
+scripts work without Ollama. Profile data is passed to the model on each draft.
+
+## Required GPU acceptance test
+
+1. Approve the fictional shared image and two authorized voice references.
+2. Generate a 10-second exchange and verify speaker-to-face assignment.
+3. Check transcription manually, facial identity, gestures and silent reactions.
+4. Tune pace/word count; the worker rejects speech more than 5 seconds from target.
+5. Generate and review the full approximately 60-second take before client delivery.
+
+No GPU inference has been claimed solely from a successful application test.
diff --git a/docs/requirements-coverage.md b/docs/requirements-coverage.md
new file mode 100644
index 0000000000000000000000000000000000000000..ef5904449a0d275fed78c47821ae659d5a5ab540
--- /dev/null
+++ b/docs/requirements-coverage.md
@@ -0,0 +1,18 @@
+# MVP acceptance coverage
+
+| Client requirement | Implemented application support | Remaining acceptance evidence |
+| --- | --- | --- |
+| Two original women with different personalities | Seed profiles, editable traits and versioning | Creator approves final appearances/voices |
+| Save faces, bodies and voices | Image/scene assets, voice reference and generation snapshots | No editable 3D body rig; body appearance lives in scene imagery |
+| Exact creator-written dialogue | Script editor and immutable render snapshot | Listen to TTS to confirm spoken fidelity |
+| AI-generated dialogue | Qwen/Ollama provider and editable draft | Live model service test |
+| Region, AAVE, slang, cadence, code-switching | Separate saved controls and draft context | Acoustic range and cultural authenticity review |
+| Two people in one scene | Shared-image assignment and multi-person InfiniteTalk adapter | GPU speaker/face mapping and listener reactions |
+| Lip-sync, facial movement, gestures | Audio-conditioned inference and performance prompt | Full GPU output review; no precision gesture timeline guarantee |
+| Approximately 60 seconds | Target duration, measured audio and ±5-second constraint | Render and approve final take |
+| Reusable/provider-independent architecture | Layers, protocols, adapters and saved input manifests | Replacing a voice provider requires a new voice audition |
+| Consent | Rights metadata, attestation, revoke; no real-person face workflow | Human authorization review, not automated verification |
+| Frontend and backend integration | React/Vite UI, FastAPI endpoints and real workflow E2E | See remote test logs for executed results |
+
+Do not mark the client MVP complete until the GPU acceptance test is passed. The
+application can be delivered and reviewed independently of that external dependency.
diff --git a/frontend/e2e/studio.spec.ts b/frontend/e2e/studio.spec.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b127d886154e29685605aa181926e31ba1d1201a
--- /dev/null
+++ b/frontend/e2e/studio.spec.ts
@@ -0,0 +1,84 @@
+import { test, expect } from '@playwright/test';
+
+// These tests use the actual API, SQLite and FFmpeg worker. No network interception.
+// The fixture is a synthetic solid image, not a model-quality test.
+const image = Buffer.from(
+ 'iVBORw0KGgoAAAANSUhEUgAAAoAAAAFoCAIAAABIUN0GAAAFl0lEQVR4nO3XMRHAMBDEQDv8iQRBKBhWWLwK7xK4UnP7e88CAGY9w3sAgAADQMMDBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgABBgA7uABA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQYAAQaAO3jAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYAAICDAABAQaAgAADQECAASAgwAAQEGAACAgwAAQEGAACAgwAAQEGgIAAA0BAgAEgIMAAEBBgAAgIMAAEBBgAAgIMAAEBBoCAAANAQIABICDAABAQYAAICDAABAQYANa8H4AjBPggNxbsAAAAAElFTkSuQmCC',
+ 'base64',
+);
+
+test('edit a character and persist its speech preferences', async ({ page }) => {
+ await page.goto('/characters');
+ await page.getByRole('button', { name: 'Edit R.Royale' }).click();
+ await page.getByRole('button', { name: 'Speech style', exact: true }).click();
+ await page.getByLabel('Regional influence').fill('Creator approved regional expression');
+ await page.getByRole('button', { name: 'Save character', exact: true }).click();
+ await expect(page.getByRole('dialog')).not.toBeVisible();
+ await page.reload();
+ await page.getByRole('button', { name: 'Edit R.Royale' }).click();
+ await page.getByRole('button', { name: 'Speech style', exact: true }).click();
+ await expect(page.getByLabel('Regional influence')).toHaveValue(
+ 'Creator approved regional expression',
+ );
+});
+
+test('approve a scene and exact script, render a real storyboard and reload', async ({ page }) => {
+ await page.goto('/');
+ await page
+ .getByLabel('Upload image')
+ .setInputFiles({ name: 'e2e-fictional-scene.png', mimeType: 'image/png', buffer: image });
+ await page
+ .getByLabel('Ownership or authorization details')
+ .fill('Original synthetic image for automated testing');
+ await page.getByLabel('I have rights to use this fictional image.').check();
+ await page.getByRole('button', { name: 'Upload asset', exact: true }).click();
+ await expect(page.getByRole('img', { name: 'Shared scene preview' })).toBeVisible();
+ await page.getByLabel('Both fictional characters are visible').check();
+ await page
+ .getByLabel('Dialogue line 1', { exact: true })
+ .fill('A little perspective changes everything.');
+ await page
+ .getByLabel('Dialogue line 2', { exact: true })
+ .fill('And a little sunshine helps, too.');
+ await expect(page.getByRole('button', { name: 'Create storyboard' })).toBeDisabled();
+ await page.getByLabel('I approve these exact words').check();
+ await page.getByLabel('Duration', { exact: true }).selectOption('10');
+ await page.getByRole('button', { name: 'Create storyboard' }).click();
+ await expect(page).toHaveURL(/renders/);
+ await expect(page.getByText('Storyboard ready — no voice or animation').first()).toBeVisible({
+ timeout: 60000,
+ });
+ const download = page.getByRole('link', { name: 'Download MP4' }).first();
+ const response = await page.request.get((await download.getAttribute('href'))!);
+ expect(response.ok()).toBeTruthy();
+ expect((await response.body()).subarray(0, 64).includes(Buffer.from('ftyp'))).toBeTruthy();
+ await page.reload();
+ await expect(download).toBeVisible();
+});
+
+test('mobile navigation and provider status are usable', async ({ page }) => {
+ await page.setViewportSize({ width: 390, height: 844 });
+ await page.goto('/settings');
+ await expect(page.getByRole('heading', { name: 'Your studio, connected.' })).toBeVisible();
+ await expect(page.getByRole('heading', { name: 'Chatterbox', exact: true })).toBeVisible();
+ const overflow = await page.evaluate(
+ () => document.documentElement.scrollWidth > window.innerWidth,
+ );
+ expect(overflow).toBe(false);
+ await page.getByRole('link', { name: 'Characters', exact: true }).click();
+ await expect(page.getByRole('heading', { name: 'Characters with character.' })).toBeVisible();
+});
+
+test('missing GPU voices are surfaced instead of a fake completed render', async ({ request }) => {
+ const conversations = await (await request.get('/api/v1/conversations')).json();
+ const scenes = await (await request.get('/api/v1/scenes')).json();
+ const result = await request.post('/api/v1/generations', {
+ data: {
+ conversation_id: conversations[0].id,
+ scene_id: scenes[0].id,
+ kind: 'animated',
+ target_seconds: 60,
+ },
+ });
+ expect([422, 503]).toContain(result.status());
+});
diff --git a/frontend/index.html b/frontend/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..cb2cf9e1c26a3fa0d5aeb9b1ce6487462f3f4e39
--- /dev/null
+++ b/frontend/index.html
@@ -0,0 +1 @@
+
Character Studio
\ No newline at end of file
diff --git a/frontend/package.json b/frontend/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..c9ad898d4d8eb818eb24198a636f706689c346b2
--- /dev/null
+++ b/frontend/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "@character-studio/frontend",
+ "private": true,
+ "version": "0.1.0",
+ "type": "module",
+ "scripts": {
+ "dev": "vite --host 127.0.0.1",
+ "build": "tsc -b && vite build",
+ "typecheck": "tsc -b",
+ "test:e2e": "playwright test"
+ },
+ "dependencies": {
+ "@tanstack/react-query": "^5.0.0",
+ "lucide-react": "^0.468.0",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
+ "react-router-dom": "^7.0.0"
+ },
+ "devDependencies": {
+ "@playwright/test": "^1.50.0",
+ "@types/node": "^22.0.0",
+ "@types/react": "^19.0.0",
+ "@types/react-dom": "^19.0.0",
+ "@vitejs/plugin-react": "^4.3.0",
+ "prettier": "^3.9.8",
+ "typescript": "^5.7.0",
+ "vite": "^6.0.0"
+ }
+}
diff --git a/frontend/playwright.config.ts b/frontend/playwright.config.ts
new file mode 100644
index 0000000000000000000000000000000000000000..860482207e76a1b79003bd7fb558102b1bf7dd84
--- /dev/null
+++ b/frontend/playwright.config.ts
@@ -0,0 +1,23 @@
+import { defineConfig, devices } from '@playwright/test';
+const remote = process.env.E2E_BASE_URL;
+export default defineConfig({
+ testDir: './e2e',
+ fullyParallel: false,
+ workers: 1,
+ timeout: 60000,
+ reporter: [['list'], ['html', { open: 'never' }]],
+ use: {
+ baseURL: remote || 'http://127.0.0.1:8000',
+ trace: 'retain-on-failure',
+ screenshot: 'only-on-failure',
+ },
+ projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
+ webServer: remote
+ ? undefined
+ : {
+ command: 'python ../scripts/run_e2e_server.py',
+ url: 'http://127.0.0.1:8000/health',
+ reuseExistingServer: false,
+ timeout: 30000,
+ },
+});
diff --git a/frontend/src/app/app.tsx b/frontend/src/app/app.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..75c8992a1139f713833032b2b1f0a5fc23a4ea08
--- /dev/null
+++ b/frontend/src/app/app.tsx
@@ -0,0 +1,26 @@
+import { Routes, Route, Navigate, Link } from 'react-router-dom';
+import { AudioLines } from 'lucide-react';
+import { StudioPage } from '../features/generations/studio.page';
+
+export function App() {
+ return (
+
+
+
+
+
+
Character Studio
+
+
+
+
+
+ } />
+ } />
+ } />
+
+
+
Original fictional characters · MVP
+
+ );
+}
diff --git a/frontend/src/app/styles.css b/frontend/src/app/styles.css
new file mode 100644
index 0000000000000000000000000000000000000000..a9282e3befd7ead90e7496c5b174210ae62756a9
--- /dev/null
+++ b/frontend/src/app/styles.css
@@ -0,0 +1,1833 @@
+@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Manrope:wght@400;500;600;650;700;750;800&display=swap');
+:root {
+ font-family: 'DM Sans', sans-serif;
+ color: #25262b;
+ background: #f6f6f3;
+ font-synthesis: none;
+ font-weight: 400;
+ line-height: 1.5;
+ --purple: #6b50ba;
+ --border: #e7e6e2;
+ --muted: #7c7d82;
+}
+* {
+ box-sizing: border-box;
+}
+body {
+ margin: 0;
+}
+button,
+input,
+textarea,
+select {
+ font: inherit;
+}
+button,
+a,
+input,
+select,
+textarea {
+ -webkit-tap-highlight-color: transparent;
+}
+button {
+ cursor: pointer;
+}
+button:disabled {
+ cursor: not-allowed;
+ opacity: 0.45;
+}
+a {
+ color: inherit;
+ text-decoration: none;
+}
+button,
+input,
+select,
+textarea,
+a {
+ outline-offset: 4px;
+}
+:focus-visible {
+ outline: 2px solid #8063c9;
+}
+button {
+ border: 0;
+}
+h1,
+h2,
+h3,
+p {
+ margin: 0;
+}
+h1,
+h2,
+h3 {
+ font-family: Manrope, 'DM Sans', sans-serif;
+}
+h1 {
+ font-size: 32px;
+ line-height: 1.25;
+ font-weight: 750;
+ letter-spacing: -1.1px;
+}
+h2 {
+ font-size: 18px;
+ letter-spacing: -0.4px;
+}
+h3 {
+ font-size: 15px;
+}
+p {
+ color: #78797d;
+ font-size: 13px;
+ line-height: 1.65;
+}
+small,
+.small {
+ font-size: 11px;
+}
+.muted {
+ color: var(--muted);
+}
+.row {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+.between {
+ justify-content: space-between;
+}
+.wrap {
+ flex-wrap: wrap;
+}
+.app-shell {
+ display: flex;
+ min-height: 100vh;
+}
+.sidebar {
+ width: 230px;
+ background: #191b20;
+ color: #9699a1;
+ position: fixed;
+ inset: 0 auto 0 0;
+ display: flex;
+ flex-direction: column;
+ padding: 32px 20px 20px;
+}
+.brand {
+ display: flex;
+ gap: 10px;
+ align-items: center;
+ color: white;
+ font-size: 18px;
+ font-weight: 700;
+ letter-spacing: -0.5px;
+}
+.brand-icon {
+ color: #ccbdf7;
+ background: #2c2938;
+ border: 1px solid #443d55;
+ border-radius: 10px;
+ padding: 8px;
+ display: flex;
+}
+.brand-light {
+ font-weight: 400;
+ color: #b5b7c0;
+ display: block;
+ font-size: 12px;
+ letter-spacing: 2.5px;
+ line-height: 1;
+}
+.workspace-label {
+ font-size: 9px;
+ letter-spacing: 1.7px;
+ margin: 43px 12px 14px;
+ color: #676b77;
+ font-weight: 700;
+}
+.sidebar nav {
+ display: grid;
+ gap: 7px;
+}
+.sidebar nav a {
+ display: flex;
+ align-items: center;
+ gap: 13px;
+ padding: 12px 14px;
+ border-radius: 7px;
+ font-size: 13px;
+ font-weight: 500;
+}
+.sidebar nav a:hover {
+ background: #23262d;
+ color: white;
+}
+.sidebar nav a.active {
+ background: #34303f;
+ color: #ddcffd;
+}
+.sidebar nav a.active:after {
+ content: '';
+ width: 5px;
+ height: 5px;
+ border-radius: 50%;
+ background: #c9aef8;
+ margin-left: auto;
+}
+.sidebar-bottom {
+ margin-top: auto;
+ padding-top: 60px;
+}
+.studio-tip {
+ border: 1px solid #34363e;
+ background: linear-gradient(125deg, #272832, #23252b);
+ border-radius: 10px;
+ padding: 18px 15px;
+}
+.studio-tip .pill {
+ font-size: 8px;
+ letter-spacing: 1px;
+ background: #393542;
+ color: #cbbbe8;
+}
+.studio-tip h3 {
+ color: #e2e0e9;
+ margin: 13px 0 10px;
+ font-size: 18px;
+ font-weight: 500;
+ line-height: 1.5;
+}
+.studio-tip p {
+ font-size: 11px;
+ color: #8e919d;
+}
+.studio-tip a {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 18px;
+ font-size: 11px;
+ color: #d6c3fb;
+}
+.help-link {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ margin: 25px 9px;
+ font-size: 11px;
+}
+.account {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding-top: 20px;
+ border-top: 1px solid #2d3037;
+}
+.account > span {
+ background: #393743;
+ color: #d6c8ef;
+ border-radius: 50%;
+ font-size: 11px;
+ padding: 10px;
+}
+.account strong,
+.account small {
+ display: block;
+}
+.account strong {
+ font-size: 11px;
+ font-weight: 500;
+ color: #d5d6dc;
+}
+.account small {
+ font-size: 8px;
+ color: #686c78;
+ margin-top: 3px;
+}
+.main-shell {
+ margin-left: 230px;
+ width: calc(100% - 230px);
+}
+.topbar {
+ height: 69px;
+ padding: 0 42px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border-bottom: 1px solid var(--border);
+ background: #fff;
+ font-size: 11px;
+ color: #92939a;
+}
+.topbar strong {
+ font-weight: 500;
+ color: #55575d;
+}
+.slash {
+ margin: 0 14px;
+ color: #d5d4da;
+}
+.topbar-badge {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 10px;
+ color: #64676a;
+}
+.dot {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background: #9ab49a;
+ display: inline-block;
+}
+main {
+ max-width: 1550px;
+ margin: 0 auto;
+ padding: 38px 42px 20px;
+}
+.page-heading {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 20px;
+ margin-bottom: 27px;
+}
+.page-heading p {
+ margin-top: 10px;
+ font-size: 13px;
+}
+.eyebrow {
+ font-size: 9px;
+ letter-spacing: 1.7px;
+ font-weight: 650;
+ color: #8b8994;
+ margin-bottom: 10px;
+}
+.pill {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ font-size: 9px;
+ font-weight: 500;
+ padding: 5px 9px;
+ border-radius: 5px;
+ background: #efedf5;
+ color: #776594;
+ white-space: nowrap;
+}
+.pill.outline {
+ background: #fff;
+ border: 1px solid var(--border);
+ color: #7a7e79;
+ font-size: 10px;
+ padding: 8px 11px;
+}
+.pill.success {
+ background: #e9f1e9;
+ color: #587958;
+}
+.pill.danger {
+ background: #f9e8e4;
+ color: #b55045;
+}
+.button {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ font-size: 11px;
+ font-weight: 600;
+ border-radius: 6px;
+ padding: 11px 15px;
+ white-space: nowrap;
+ line-height: 1.4;
+ transition:
+ background 0.2s,
+ transform 0.2s;
+}
+.button.primary {
+ color: #fff;
+ background: #26252e;
+ border: 1px solid #26252e;
+}
+.button.primary:hover:not(:disabled) {
+ background: #51446f;
+}
+.button.secondary {
+ background: #fff;
+ color: #5a5962;
+ border: 1px solid #dddae3;
+}
+.button.secondary:hover:not(:disabled) {
+ background: #f4f0fa;
+}
+.button.text {
+ background: none;
+ color: #7c718f;
+ padding-left: 5px;
+ padding-right: 5px;
+}
+.icon-button {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 6px;
+ background: transparent;
+ color: #8f8c98;
+ padding: 6px;
+}
+.icon-button:hover {
+ background: #f0ecf7;
+ color: #58427e;
+}
+.cast-strip {
+ display: flex;
+ align-items: center;
+ gap: 23px;
+ padding: 20px 24px;
+ background: #fff;
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ margin-bottom: 26px;
+}
+.cast-label {
+ border-right: 1px solid var(--border);
+ padding-right: 24px;
+ min-width: 100px;
+}
+.cast-label .eyebrow {
+ font-size: 8px;
+ display: block;
+ margin-bottom: 5px;
+}
+.cast-label strong {
+ font-size: 13px;
+ font-weight: 600;
+}
+.cast-person {
+ display: flex;
+ align-items: center;
+ gap: 11px;
+ background: none;
+ text-align: left;
+ min-width: 0;
+ padding: 0;
+ flex: 1;
+}
+.cast-person > span {
+ min-width: 0;
+}
+.cast-person strong,
+.cast-person small {
+ display: block;
+}
+.cast-person strong {
+ font-size: 12px;
+ color: #3a3940;
+}
+.cast-person small {
+ font-size: 10px;
+ color: #929096;
+ margin-top: 3px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ max-width: 190px;
+}
+.cast-person > svg {
+ margin-left: auto;
+ color: #a6a1ac;
+}
+.avatar {
+ width: 43px;
+ height: 43px;
+ border-radius: 50%;
+ flex-shrink: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #4e435d;
+ font-size: 13px;
+ font-weight: 600;
+ overflow: hidden;
+}
+.avatar img {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+.cast-note {
+ font-size: 9px;
+ color: #aba6b0;
+ font-style: italic;
+ line-height: 1.8;
+ border-left: 1px solid var(--border);
+ padding-left: 22px;
+}
+.studio-grid {
+ display: grid;
+ grid-template-columns: 1fr 1.08fr;
+ gap: 24px;
+ align-items: start;
+}
+.panel {
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ background: #fff;
+ overflow: hidden;
+}
+.panel-header {
+ padding: 18px 22px;
+ border-bottom: 1px solid #f0efed;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+.panel-header > div {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+.panel-header h2 {
+ font-size: 14px;
+ font-weight: 650;
+}
+.step {
+ font-size: 9px;
+ color: #aaa3b5;
+ border: 1px solid #eae6ef;
+ border-radius: 5px;
+ padding: 3px 5px;
+}
+.panel-content {
+ padding: 21px;
+}
+.scene-preview {
+ position: relative;
+ background: #e9e6e1;
+ aspect-ratio: 16/10;
+ overflow: hidden;
+ margin: 18px 18px 0;
+ border-radius: 7px;
+}
+.scene-preview > img {
+ width: 100%;
+ height: 100%;
+ object-fit: contain;
+}
+.frame-label {
+ position: absolute;
+ bottom: 10px;
+ left: 12px;
+ font-size: 7px;
+ letter-spacing: 1px;
+ padding: 5px 8px;
+ border-radius: 3px;
+ background: #fff9;
+ color: #6f6963;
+}
+.scene-placeholder {
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+ background: radial-gradient(ellipse at 50% 40%, #f8f5ee, #e1ddd4);
+ color: #958e83;
+}
+.scene-placeholder h3 {
+ font-size: 14px;
+ font-weight: 500;
+ margin: 10px 0 3px;
+}
+.scene-placeholder p {
+ font-size: 10px;
+}
+.scene-art {
+ display: flex;
+ align-items: end;
+ justify-content: center;
+ height: 70px;
+ gap: 25px;
+ margin-bottom: 12px;
+}
+.scene-art span {
+ height: 60px;
+ width: 44px;
+ border-radius: 50% 50% 18% 18%;
+ background: #c3b8ce;
+ position: relative;
+}
+.scene-art span:before {
+ content: '';
+ position: absolute;
+ top: -20px;
+ left: 10px;
+ width: 25px;
+ height: 27px;
+ background: #aa9bb6;
+ border-radius: 50%;
+}
+.scene-art span:nth-child(2) {
+ background: #d0bba8;
+ height: 55px;
+}
+.scene-art span:nth-child(2):before {
+ background: #bd9f88;
+}
+.scene-art i {
+ position: absolute;
+ width: 145px;
+ height: 20px;
+ top: calc(50% + 1px);
+ border-radius: 6px;
+ background: #c9c1b65e;
+}
+.field-row {
+ display: flex;
+ gap: 13px;
+}
+.field-row > label {
+ flex: 1;
+ min-width: 0;
+}
+label {
+ display: block;
+ font-size: 10px;
+ font-weight: 600;
+ color: #68656f;
+ margin-bottom: 15px;
+}
+input:not([type='checkbox']):not([type='range']):not([type='color']):not([type='file']),
+select,
+textarea {
+ display: block;
+ width: 100%;
+ border: 1px solid #e3e0e8;
+ border-radius: 5px;
+ background: #fff;
+ padding: 9px 11px;
+ font-size: 11px;
+ line-height: 1.5;
+ color: #49444f;
+ margin-top: 6px;
+}
+input::placeholder,
+textarea::placeholder {
+ color: #aca7b2;
+}
+textarea {
+ resize: vertical;
+ min-height: 65px;
+}
+.check {
+ display: flex;
+ align-items: flex-start;
+ gap: 8px;
+ font-size: 10px;
+ color: #77717e;
+ font-weight: 400;
+ line-height: 1.6;
+ cursor: pointer;
+ margin: 16px 0 0;
+}
+.check input {
+ accent-color: #775ab6;
+ margin: 2px 0 0;
+ flex-shrink: 0;
+ width: 13px;
+ height: 13px;
+}
+.hint {
+ font-size: 10px;
+ color: #9a95a1;
+ line-height: 1.7;
+ margin: 10px 0 14px;
+}
+.upload-box {
+ background: #faf9fc;
+ border: 1px dashed #ddd6e8;
+ border-radius: 6px;
+ padding: 14px;
+ margin-top: 5px;
+}
+.file-label {
+ display: flex;
+ align-items: center;
+ gap: 11px;
+ position: relative;
+ margin: 0;
+ color: #8d7f9f;
+ cursor: pointer;
+ font-weight: 500;
+ font-size: 10px;
+}
+.file-label small {
+ display: block;
+ font-size: 8px;
+ color: #a49bad;
+ margin-top: 4px;
+}
+.file-label input {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ opacity: 0;
+ cursor: pointer;
+}
+.file-label:focus-within {
+ outline: 2px solid #8063c9;
+ outline-offset: 5px;
+}
+.upload-details {
+ margin-top: 17px;
+}
+.upload-details .button {
+ margin-top: 12px;
+}
+.director-note {
+ display: flex;
+ gap: 13px;
+ padding: 22px 9px;
+ color: #9b8cae;
+}
+.director-note h3 {
+ font-size: 11px;
+ font-weight: 600;
+ color: #82738f;
+ margin-bottom: 5px;
+}
+.director-note p {
+ font-size: 10px;
+ color: #9c93a4;
+ max-width: 340px;
+}
+.segmented {
+ display: flex;
+ padding: 4px;
+ border-radius: 6px;
+ background: #f3f1f5;
+ gap: 3px;
+ margin-bottom: 20px;
+}
+.segmented button {
+ padding: 8px 10px;
+ color: #92879f;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 7px;
+ border-radius: 4px;
+ flex: 1;
+ font-size: 10px;
+ background: none;
+ white-space: nowrap;
+}
+.segmented button.active {
+ color: #675183;
+ background: #fff;
+ box-shadow: 0 1px 4px #23163e12;
+}
+.turn {
+ border-left: 3px solid #bba7db;
+ background: #fcfbfd;
+ border-radius: 5px;
+ padding: 9px 12px;
+ margin-bottom: 12px;
+}
+.turn .row select {
+ width: auto;
+ background: transparent;
+ border: 0;
+ padding: 0;
+ font-size: 10px;
+ font-weight: 600;
+ margin: 0;
+}
+.turn textarea {
+ border: 0;
+ padding: 8px 0;
+ background: none;
+ min-height: 65px;
+ font-size: 12px;
+ color: #595160;
+}
+.turn-footer {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ border-top: 1px solid #eeeaf3;
+}
+.turn-footer > input {
+ border: 0 !important;
+ background: none !important;
+ font-size: 9px !important;
+ padding: 8px 0 !important;
+ margin: 0 !important;
+}
+.turn-footer label {
+ display: flex;
+ gap: 4px;
+ align-items: center;
+ white-space: nowrap;
+ font-weight: 400;
+ font-size: 8px;
+ margin: 0;
+ color: #a197ac;
+}
+.turn-footer label input {
+ width: 40px !important;
+ padding: 2px 3px !important;
+ font-size: 9px !important;
+ margin: 0 !important;
+}
+.add-line {
+ width: 100%;
+ padding: 10px;
+ border: 1px dashed #ded8e8;
+ border-radius: 5px;
+ background: #fff;
+ color: #8c779f;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 7px;
+ font-size: 10px;
+}
+.ai-prompt {
+ padding: 15px;
+ background: #f7f3fc;
+ border-radius: 7px;
+ margin-bottom: 15px;
+}
+.ai-prompt label {
+ margin-bottom: 10px;
+}
+.render-bar {
+ margin-top: 22px;
+ display: flex;
+ align-items: center;
+ gap: 15px;
+ background: #efedf3;
+ border: 1px solid #e1dce9;
+ border-radius: 9px;
+ padding: 20px;
+}
+.render-bar > div:first-child {
+ margin-right: auto;
+}
+.render-bar h3 {
+ font-size: 15px;
+}
+.render-bar .eyebrow {
+ font-size: 8px;
+ margin-bottom: 3px;
+}
+.render-bar label {
+ margin: 0;
+ min-width: 110px;
+ font-size: 8px;
+}
+.render-bar select {
+ margin-top: 4px;
+ padding: 7px;
+ font-size: 10px;
+}
+.render-disclaimer {
+ font-size: 9px;
+ color: #9b929f;
+ text-align: right;
+ padding: 10px 5px;
+}
+.page-footer {
+ display: flex;
+ justify-content: space-between;
+ margin-top: 40px;
+ padding: 20px 0 3px;
+ border-top: 1px solid #e7e4e9;
+ color: #aaa5ad;
+ font-size: 9px;
+}
+.page-footer span:last-child {
+ font-size: 8px;
+ letter-spacing: 1px;
+}
+.notice {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 12px 15px;
+ border-radius: 7px;
+ font-size: 12px;
+ margin: 12px 0;
+}
+.notice.error {
+ background: #fbeee9;
+ color: #b14c39;
+ border: 1px solid #f0d4c8;
+}
+.notice.success {
+ background: #edf3e9;
+ color: #5d7d45;
+}
+.loading {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 90px;
+ gap: 15px;
+ color: #8b8097;
+ font-size: 13px;
+}
+.spin {
+ animation: spin 1s linear infinite;
+}
+@keyframes spin {
+ to {
+ transform: rotate(360deg);
+ }
+}
+.empty {
+ text-align: center;
+ padding: 100px 25px;
+ border: 1px dashed #dfd9e7;
+ border-radius: 12px;
+ color: #a491bf;
+ background: #faf8fc;
+}
+.empty h3 {
+ margin: 20px 0 8px;
+ color: #655870;
+}
+.character-grid {
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 22px;
+}
+.character-card {
+ background: #fff;
+ border: 1px solid var(--border);
+ border-radius: 12px;
+ overflow: hidden;
+}
+.character-visual {
+ height: 235px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+}
+.avatar.large {
+ width: 125px;
+ height: 125px;
+ font-size: 34px;
+ box-shadow: 0 0 0 13px #ffffff30;
+}
+.character-visual .pill {
+ position: absolute;
+ top: 15px;
+ left: 15px;
+ background: #ffffffa6;
+ color: #756781;
+ font-size: 8px;
+}
+.character-content {
+ padding: 22px;
+}
+.character-content p {
+ font-size: 11px;
+ margin: 8px 0 22px;
+}
+.character-meta {
+ display: flex;
+ align-items: center;
+ gap: 13px;
+ font-size: 9px;
+ color: #9b909f;
+ border-top: 1px solid #f0ebf2;
+ padding-top: 13px;
+}
+.character-meta span {
+ display: flex;
+ gap: 4px;
+ align-items: center;
+}
+.character-meta span:last-child {
+ margin-left: auto;
+}
+.modal {
+ border: 1px solid #ded7e9;
+ border-radius: 14px;
+ box-shadow: 0 30px 100px #20172935;
+ padding: 0;
+ width: min(600px, 94vw);
+ max-height: 90vh;
+ color: #494150;
+}
+.modal::backdrop {
+ background: #19122370;
+ backdrop-filter: blur(3px);
+}
+.modal > header {
+ position: sticky;
+ top: 0;
+ background: #fff;
+ z-index: 2;
+ padding: 20px 24px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border-bottom: 1px solid var(--border);
+}
+.modal .segmented {
+ margin: 20px 24px 0;
+}
+.modal-body {
+ padding: 24px;
+}
+.modal-footer {
+ padding: 17px 24px;
+ border-top: 1px solid var(--border);
+ display: flex;
+ justify-content: flex-end;
+ gap: 10px;
+}
+.modal label {
+ font-size: 12px;
+}
+.modal input,
+.modal textarea {
+ font-size: 13px !important;
+}
+.color-field {
+ max-width: 60px;
+}
+.color-field input {
+ display: block;
+ width: 50px;
+ height: 37px;
+ border: 1px solid #ddd;
+ border-radius: 6px;
+ background: #fff;
+ margin-top: 6px;
+}
+.range-value {
+ float: right;
+ color: #8966b4;
+}
+input[type='range'] {
+ display: block;
+ width: 100%;
+ margin: 15px 0;
+ accent-color: #9470c5;
+}
+.asset-preview {
+ height: 120px;
+ border-radius: 8px;
+ margin-top: 10px;
+}
+.modal h3 {
+ margin: 8px 0 15px;
+}
+.modal audio {
+ width: 100%;
+ margin: 10px 0;
+}
+.render-list {
+ display: grid;
+ gap: 20px;
+}
+.render-card {
+ display: grid;
+ grid-template-columns: 310px 1fr;
+ padding: 18px;
+ gap: 25px;
+}
+.render-thumb {
+ border-radius: 6px;
+ overflow: hidden;
+ background: #efedf0;
+ display: flex;
+ align-items: center;
+}
+.render-thumb video,
+.render-thumb img {
+ width: 100%;
+ max-height: 220px;
+ object-fit: contain;
+}
+.render-info h2 {
+ margin: 16px 0 7px;
+}
+.render-info p {
+ font-size: 11px;
+}
+.render-info > .row:last-child {
+ margin-top: 15px;
+}
+.progress {
+ height: 4px;
+ background: #f1ebf7;
+ border-radius: 4px;
+ margin: 17px 0 8px;
+ overflow: hidden;
+}
+.progress span {
+ display: block;
+ height: 100%;
+ background: #a790c6;
+}
+.review-check {
+ margin: 17px 0;
+}
+.provider-grid {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 20px;
+}
+.provider {
+ padding: 25px;
+}
+.provider > svg {
+ color: #a28ab8;
+ margin-bottom: 15px;
+}
+.provider .eyebrow {
+ display: block;
+}
+.provider h2 {
+ margin: 0 0 12px;
+}
+.provider p {
+ margin-top: 17px;
+ font-size: 12px;
+}
+.settings-panel {
+ padding: 25px;
+ margin-top: 22px;
+}
+.settings-panel h2 {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ margin-bottom: 15px;
+}
+.settings-panel p {
+ margin: 10px 0;
+ font-size: 12px;
+}
+.text-link {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ font-size: 12px;
+ color: #8c65b4;
+}
+.asset-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ border-top: 1px solid var(--border);
+ padding: 13px 0;
+}
+.asset-row strong {
+ font-size: 12px;
+}
+.asset-row small {
+ display: block;
+ color: #98929d;
+ max-width: 650px;
+ overflow-wrap: anywhere;
+}
+code {
+ font-size: 11px;
+ background: #f3eff7;
+ padding: 3px 4px;
+ border-radius: 3px;
+}
+@media (min-width: 1600px) {
+ main {
+ padding-top: 48px;
+ }
+ .scene-preview {
+ aspect-ratio: 16/9;
+ }
+ .panel-content {
+ padding: 25px;
+ }
+}
+@media (max-width: 1200px) {
+ .sidebar {
+ width: 200px;
+ padding: 25px 15px;
+ }
+ .main-shell {
+ margin-left: 200px;
+ width: calc(100% - 200px);
+ }
+ main {
+ padding: 30px 25px;
+ }
+ .topbar {
+ padding: 0 25px;
+ }
+ .cast-note {
+ display: none;
+ }
+ .cast-person small {
+ max-width: 150px;
+ }
+ .cast-strip {
+ gap: 17px;
+ padding: 17px;
+ }
+ .render-bar {
+ flex-wrap: wrap;
+ }
+ .render-bar > div:first-child {
+ min-width: 150px;
+ }
+ .character-grid {
+ grid-template-columns: repeat(2, 1fr);
+ }
+ .render-card {
+ grid-template-columns: 240px 1fr;
+ }
+ .page-heading h1 {
+ font-size: 27px;
+ }
+ .page-heading > .pill {
+ display: none;
+ }
+}
+@media (max-width: 950px) {
+ .studio-grid {
+ grid-template-columns: 1fr;
+ }
+ .scene-preview {
+ aspect-ratio: 16/8;
+ }
+ .sidebar {
+ width: 175px;
+ }
+ .main-shell {
+ margin-left: 175px;
+ width: calc(100% - 175px);
+ }
+ .brand {
+ font-size: 15px;
+ }
+ .sidebar nav a {
+ font-size: 12px;
+ }
+ .studio-tip {
+ padding: 12px;
+ }
+ .cast-label {
+ display: none;
+ }
+ .render-card {
+ grid-template-columns: 1fr;
+ }
+ .render-thumb {
+ max-height: 280px;
+ }
+ .provider-grid {
+ grid-template-columns: 1fr;
+ }
+ .provider {
+ display: block;
+ }
+ .character-grid {
+ grid-template-columns: 1fr;
+ }
+}
+@media (max-width: 650px) {
+ .app-shell {
+ display: block;
+ }
+ .sidebar {
+ position: static;
+ width: 100%;
+ padding: 16px 18px 10px;
+ }
+ .brand {
+ font-size: 17px;
+ }
+ .brand-light {
+ display: inline;
+ margin-left: 3px;
+ font-size: 17px;
+ letter-spacing: 0;
+ }
+ .brand-icon {
+ padding: 5px;
+ }
+ .workspace-label,
+ .sidebar-bottom {
+ display: none;
+ }
+ .sidebar nav {
+ display: flex;
+ justify-content: space-between;
+ margin-top: 14px;
+ gap: 3px;
+ }
+ .sidebar nav a {
+ padding: 8px;
+ font-size: 11px;
+ gap: 5px;
+ }
+ .sidebar nav a svg {
+ width: 15px;
+ }
+ .sidebar nav a.active:after {
+ display: none;
+ }
+ .main-shell {
+ margin-left: 0;
+ width: 100%;
+ }
+ .topbar {
+ height: 45px;
+ padding: 0 18px;
+ font-size: 9px;
+ }
+ .topbar-badge {
+ font-size: 8px;
+ }
+ main {
+ padding: 25px 17px;
+ }
+ .page-heading {
+ align-items: flex-start;
+ }
+ .page-heading h1 {
+ font-size: 25px;
+ }
+ .page-heading p {
+ font-size: 11px;
+ }
+ .page-heading .button {
+ font-size: 9px;
+ padding: 8px;
+ }
+ .cast-strip {
+ gap: 10px;
+ }
+ .cast-person {
+ gap: 8px;
+ }
+ .cast-person strong {
+ font-size: 10px;
+ }
+ .cast-person small {
+ display: none;
+ }
+ .cast-person > svg {
+ display: none;
+ }
+ .avatar {
+ width: 33px;
+ height: 33px;
+ font-size: 10px;
+ }
+ .panel-header,
+ .panel-content {
+ padding: 16px;
+ }
+ .field-row {
+ flex-wrap: wrap;
+ }
+ .field-row label {
+ min-width: 120px;
+ }
+ .studio-grid {
+ gap: 12px;
+ }
+ .scene-preview {
+ aspect-ratio: 16/11;
+ margin: 12px;
+ }
+ .scene-placeholder h3 {
+ font-size: 12px;
+ }
+ .render-bar {
+ gap: 12px;
+ padding: 15px;
+ }
+ .render-bar > div:first-child {
+ width: 100%;
+ }
+ .render-bar label {
+ flex: 1;
+ min-width: 100px;
+ }
+ .render-bar .button {
+ flex: 1;
+ font-size: 10px;
+ }
+ .page-footer {
+ gap: 20px;
+ font-size: 8px;
+ }
+ .render-card {
+ padding: 13px;
+ }
+ .render-info .between {
+ flex-wrap: wrap;
+ }
+ .modal-body {
+ padding: 18px;
+ }
+ .modal .segmented {
+ margin: 14px 12px 0;
+ }
+ .modal .segmented button {
+ font-size: 9px;
+ padding: 8px;
+ }
+ .character-grid {
+ grid-template-columns: 1fr;
+ }
+ .render-disclaimer {
+ text-align: left;
+ }
+ .turn-footer > input {
+ min-width: 0;
+ }
+ .turn-footer label {
+ font-size: 8px;
+ flex-shrink: 0;
+ }
+}
+
+/* Disabled MVP features remain discoverable by pointer, keyboard and touch. */
+.feature-gate {
+ min-width: 0;
+}
+.feature-gate-controls {
+ border: 0;
+ margin: 0;
+ padding: 0;
+ min-width: 0;
+}
+.feature-gate.is-unavailable {
+ cursor: not-allowed;
+ border-radius: 6px;
+}
+.feature-gate.is-unavailable > .feature-gate-controls {
+ opacity: 0.48;
+ pointer-events: none;
+ user-select: none;
+}
+.feature-gate.is-unavailable button:disabled {
+ opacity: 1;
+}
+.feature-toast {
+ position: fixed;
+ z-index: 10000;
+ bottom: 24px;
+ right: 24px;
+ width: min(380px, calc(100vw - 32px));
+ display: flex;
+ align-items: flex-start;
+ gap: 12px;
+ background: #292531;
+ color: #f3eef9;
+ border: 1px solid #574766;
+ border-radius: 10px;
+ padding: 16px 18px;
+ box-shadow: 0 12px 40px #20152930;
+ pointer-events: none;
+ text-align: left;
+ cursor: default;
+}
+.feature-toast > svg {
+ color: #c9adee;
+ flex-shrink: 0;
+ margin-top: 2px;
+}
+.feature-toast strong {
+ display: block;
+ font-size: 12px;
+ font-weight: 600;
+}
+.feature-toast p {
+ color: #c7bdcf;
+ margin-top: 5px;
+ font-size: 11px;
+ line-height: 1.6;
+}
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: -1px;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ white-space: nowrap;
+ border: 0;
+}
+.segmented > .feature-gate {
+ flex: 1;
+}
+.segmented .feature-gate-controls,
+.segmented .feature-gate button {
+ width: 100%;
+ height: 100%;
+}
+.output-field > span {
+ display: block;
+ color: #68656f;
+ font-size: 8px;
+ font-weight: 600;
+ margin-bottom: 4px;
+}
+.output-options {
+ display: flex;
+ padding: 3px;
+ border: 1px solid #ded8e6;
+ border-radius: 6px;
+ background: #e8e4ed;
+}
+.output-options button {
+ background: none;
+ color: #7d7387;
+ font-size: 9px;
+ padding: 8px;
+ border-radius: 4px;
+ white-space: nowrap;
+}
+.output-options button.active {
+ background: #fff;
+ color: #665277;
+ box-shadow: 0 1px 3px #2b1b4310;
+}
+.render-action .button {
+ width: 100%;
+}
+@media (max-width: 650px) {
+ .feature-toast {
+ right: 16px;
+ bottom: 16px;
+ }
+ .render-bar .render-action {
+ flex: 1;
+ }
+ .render-bar .output-field {
+ flex: 1;
+ }
+}
+
+/* Compact MVP workspace: three steps and a single navigation bar. */
+.simple-shell {
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+}
+.simple-app-header {
+ background: #fff;
+ border-bottom: 1px solid var(--border);
+}
+.simple-app-nav {
+ max-width: 1100px;
+ margin: 0 auto;
+ min-height: 72px;
+ padding: 0 28px;
+ display: flex;
+ align-items: center;
+ gap: 38px;
+}
+.simple-brand {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ font-size: 16px;
+ font-weight: 700;
+ letter-spacing: -0.4px;
+ white-space: nowrap;
+}
+.simple-brand svg {
+ color: #8065ab;
+}
+.simple-app-nav nav {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+}
+.simple-app-nav nav a {
+ padding: 9px 14px;
+ border-radius: 6px;
+ color: #85808c;
+ font-size: 12px;
+}
+.simple-app-nav nav a.active {
+ background: #f1edf7;
+ color: #6b518e;
+ font-weight: 600;
+}
+.simple-settings-link {
+ margin-left: auto;
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ color: #8a8293;
+ font-size: 11px;
+}
+.simple-settings-link.active {
+ color: #6b518e;
+}
+.simple-shell main {
+ width: 100%;
+ max-width: 1050px;
+ padding: 34px 28px 40px;
+ flex: 1;
+}
+.simple-studio {
+ max-width: 800px;
+ margin: 0 auto;
+}
+.simple-heading {
+ margin-bottom: 24px;
+}
+.simple-heading h1 {
+ font-size: 27px;
+ font-weight: 700;
+ letter-spacing: -0.7px;
+}
+.simple-heading p {
+ margin-top: 7px;
+ font-size: 12px;
+}
+.simple-studio > .panel {
+ margin-bottom: 18px;
+}
+.simple-studio .panel-header {
+ padding: 15px 22px;
+}
+.simple-studio .panel-header h2 {
+ font-size: 14px;
+}
+.simple-studio .step {
+ background: #f3f0f8;
+ color: #8b75a5;
+ border: none;
+ width: 24px;
+ height: 24px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 50%;
+ font-size: 11px;
+}
+.simple-studio .panel-content {
+ padding: 20px 22px;
+}
+.simple-scene-layout {
+ display: grid;
+ grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
+ gap: 24px;
+ align-items: center;
+}
+.simple-scene .scene-preview {
+ margin: 0;
+ aspect-ratio: 16/9;
+}
+.simple-scene .scene-placeholder {
+ padding: 20px;
+ text-align: center;
+ gap: 10px;
+}
+.simple-cast-fields label {
+ margin-bottom: 12px;
+}
+.simple-cast-fields .hint {
+ margin: 0;
+}
+.simple-details {
+ border-top: 1px solid #eeeaf2;
+ margin-top: 16px;
+ padding-top: 12px;
+}
+.simple-details summary {
+ color: #8e7a9f;
+ font-size: 10px;
+ cursor: pointer;
+ width: fit-content;
+}
+.simple-details[open] summary {
+ margin-bottom: 12px;
+}
+.details-content {
+ padding-top: 3px;
+}
+.simple-details .field-row label {
+ flex: 2;
+}
+.simple-details .field-row label:last-child {
+ flex: 1;
+}
+.simple-dialogue .panel-header .button {
+ padding: 5px 0;
+ font-size: 10px;
+}
+.simple-dialogue .turn {
+ margin-top: 12px;
+ margin-bottom: 0;
+ padding: 10px 14px;
+}
+.simple-dialogue .turn textarea {
+ min-height: 52px;
+ padding: 7px 0 0;
+}
+.simple-line-actions {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 14px;
+}
+.simple-line-actions .button {
+ padding: 8px 12px;
+ font-size: 10px;
+}
+.simple-export-row {
+ display: flex;
+ align-items: center;
+ gap: 20px;
+}
+.simple-export-row label {
+ min-width: 135px;
+ margin: 0;
+}
+.simple-export-row p {
+ font-size: 11px;
+}
+.next-step {
+ margin: 14px 0 0;
+ font-size: 10px;
+ color: #8d8095;
+}
+.simple-actions {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-wrap: wrap;
+ margin-top: 18px;
+}
+.simple-actions .button {
+ font-size: 11px;
+}
+.simple-app-footer {
+ text-align: center;
+ font-size: 10px;
+ color: #a8a0ad;
+ padding: 0 20px 25px;
+}
+@media (max-width: 650px) {
+ .simple-app-nav {
+ flex-wrap: wrap;
+ gap: 10px;
+ padding: 17px 18px 12px;
+ }
+ .simple-brand {
+ font-size: 16px;
+ }
+ .simple-app-nav nav {
+ order: 3;
+ width: 100%;
+ margin-top: 5px;
+ }
+ .simple-app-nav nav a {
+ flex: 1;
+ text-align: center;
+ padding: 8px 10px;
+ font-size: 11px;
+ }
+ .simple-settings-link {
+ font-size: 10px;
+ }
+ .simple-shell main {
+ padding: 24px 15px;
+ }
+ .simple-heading h1 {
+ font-size: 23px;
+ }
+ .simple-studio .panel-content {
+ padding: 16px;
+ }
+ .simple-studio .panel-header {
+ padding: 14px 16px;
+ }
+ .simple-scene-layout {
+ grid-template-columns: 1fr;
+ gap: 16px;
+ }
+ .simple-cast-fields {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 12px;
+ }
+ .simple-cast-fields .hint {
+ grid-column: 1 / -1;
+ }
+ .simple-cast-fields label {
+ margin: 0;
+ }
+ .simple-scene .panel-header .text-link {
+ font-size: 10px;
+ }
+ .simple-actions > button,
+ .simple-actions > .feature-gate {
+ flex: 1 1 140px;
+ }
+ .simple-actions .feature-gate button {
+ width: 100%;
+ }
+ .simple-dialogue .panel-header h2 {
+ font-size: 12px;
+ }
+ .simple-export-row {
+ gap: 13px;
+ }
+ .simple-export-row label {
+ min-width: 110px;
+ }
+ .simple-export-row p {
+ font-size: 10px;
+ }
+}
+
+.fixed-scene .scene-preview {
+ max-width: 610px;
+ margin: 0 auto;
+ aspect-ratio: 16/9;
+}
+.fixed-cast-captions {
+ max-width: 610px;
+ margin: 14px auto 0;
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 18px;
+ text-align: center;
+}
+.fixed-cast-captions strong {
+ display: block;
+ font-size: 12px;
+ color: #51465c;
+}
+.fixed-cast-captions span {
+ display: block;
+ font-size: 10px;
+ color: #968a9f;
+ margin-top: 3px;
+}
+.fixed-image-error {
+ padding: 30px;
+ text-align: center;
+}
diff --git a/frontend/src/features/characters/character-editor.tsx b/frontend/src/features/characters/character-editor.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..349b76b3ba6481b6ce6b84265bc58637a8c238a2
--- /dev/null
+++ b/frontend/src/features/characters/character-editor.tsx
@@ -0,0 +1,250 @@
+import { UnavailableFeature } from '../../shared/components/unavailable-feature';
+import { useCapabilities, unavailable } from '../../shared/api/use-capabilities';
+import { useState } from 'react';
+import { useQueryClient } from '@tanstack/react-query';
+import { api, assetUrl } from '../../shared/api/client';
+import type { Character, CharacterInput, Profile } from '../../shared/api/types';
+import { Modal, ErrorNotice } from '../../shared/components/ui';
+import { AssetUpload } from '../../shared/components/asset-upload';
+export const defaultProfile: Profile = {
+ personality: '',
+ region: 'Creator defined',
+ vocabulary: '',
+ aave: 'Creator defined; no automatic dialect',
+ slang: 0,
+ pronunciation: '',
+ cadence: 'Natural',
+ code_switching: 'Context dependent',
+ expressiveness: 0.5,
+ pace: 1,
+ gestures: 'Subtle conversational gestures',
+ voice_notes: '',
+};
+export function CharacterEditor({
+ character,
+ onClose,
+}: {
+ character?: Character;
+ onClose: () => void;
+}) {
+ const capabilities = useCapabilities();
+ const [value, setValue] = useState(
+ character
+ ? { ...character, profile: { ...defaultProfile, ...character.profile } }
+ : {
+ name: '',
+ description: '',
+ color: '#b9ace8',
+ profile: defaultProfile,
+ image_asset_id: null,
+ voice_asset_id: null,
+ archived: false,
+ },
+ );
+ const [tab, setTab] = useState('Identity'),
+ [busy, setBusy] = useState(false),
+ [error, setError] = useState();
+ const query = useQueryClient();
+ const profile = (key: keyof Profile, v: string | number) =>
+ setValue({ ...value, profile: { ...value.profile, [key]: v } });
+ async function save(e: React.FormEvent) {
+ e.preventDefault();
+ setBusy(true);
+ setError(null);
+ try {
+ await api.saveCharacter(value, character?.id);
+ await query.invalidateQueries({ queryKey: ['characters'] });
+ onClose();
+ } catch (e) {
+ setError(e);
+ } finally {
+ setBusy(false);
+ }
+ }
+ return (
+
+
+
+ );
+}
diff --git a/frontend/src/features/characters/characters.page.tsx b/frontend/src/features/characters/characters.page.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..7df1d30fe22b685c914769dd30eb778d054aa1a1
--- /dev/null
+++ b/frontend/src/features/characters/characters.page.tsx
@@ -0,0 +1,74 @@
+import { useState } from 'react';
+import { useQuery } from '@tanstack/react-query';
+import { Plus, ArrowUpRight, Mic, Image } from 'lucide-react';
+import { api } from '../../shared/api/client';
+import type { Character } from '../../shared/api/types';
+import { Avatar, Loading, ErrorNotice, PageTitle, Empty } from '../../shared/components/ui';
+import { CharacterEditor } from './character-editor';
+export function CharactersPage() {
+ const query = useQuery({ queryKey: ['characters'], queryFn: api.characters });
+ const [editing, setEditing] = useState();
+ return (
+ <>
+ setEditing(null)}>
+
+ New character
+
+ }
+ />
+
+ {query.isLoading ? (
+
+ ) : (
+
+ {query.data?.map((c) => (
+
+
+
+
{c.archived ? 'Archived' : 'Original character'}
+
+
+
+
{c.name}
+
setEditing(c)}
+ >
+
+
+
+
{c.description || 'Your next original character.'}
+
+
+
+ {c.voice_asset_id ? 'Voice saved' : 'Add voice'}
+
+
+
+ {c.image_asset_id ? 'Image saved' : 'Add image'}
+
+ v{c.version}
+
+
+
+ ))}
+
+ )}
+ {query.data?.length === 0 && (
+ Create your first character to get started.
+ )}
+ {editing !== undefined && (
+ setEditing(undefined)} />
+ )}
+ >
+ );
+}
diff --git a/frontend/src/features/conversations/dialogue-editor.tsx b/frontend/src/features/conversations/dialogue-editor.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..039d5a6e729ea44ce97985e3153d716ced5f9afc
--- /dev/null
+++ b/frontend/src/features/conversations/dialogue-editor.tsx
@@ -0,0 +1,252 @@
+import { useState } from 'react';
+import { Plus, Trash2, Sparkles } from 'lucide-react';
+import type { Character, ConversationInput, Conversation } from '../../shared/api/types';
+import { api } from '../../shared/api/client';
+import { useCapabilities, unavailable } from '../../shared/api/use-capabilities';
+import { UnavailableFeature } from '../../shared/components/unavailable-feature';
+import { ErrorNotice } from '../../shared/components/ui';
+
+export function DialogueEditor({
+ value,
+ onChange,
+ characters,
+ saved,
+ onLoad,
+}: {
+ value: ConversationInput;
+ onChange: (v: ConversationInput) => void;
+ characters: Character[];
+ saved: Conversation[];
+ onLoad: (c: Conversation) => void;
+}) {
+ const capabilities = useCapabilities();
+ const [showAI, setShowAI] = useState(false);
+ const [topic, setTopic] = useState('');
+ const [busy, setBusy] = useState(false);
+ const [error, setError] = useState();
+ const update = (v: Partial) => onChange({ ...value, ...v, approved: false });
+ async function draft() {
+ if (!capabilities.dialogue) return;
+ setBusy(true);
+ setError(null);
+ try {
+ const result = await api.draft(
+ topic,
+ characters.slice(0, 2).map((c) => c.id),
+ );
+ update({ turns: result.turns, mode: 'generated' });
+ setShowAI(false);
+ } catch (e) {
+ setError(e);
+ } finally {
+ setBusy(false);
+ }
+ }
+ return (
+
+
+
+ 2
+
Write the conversation
+
+
+ setShowAI(!showAI)}>
+
+ Write with AI
+
+
+
+
+
+ Write each character’s exact words below. AI writing is a separate option.
+
+
+ Conversation name
+ update({ title: e.target.value })}
+ placeholder="My first conversation"
+ />
+
+ {saved.length > 0 && (
+
+ Open a saved conversation
+ {
+ const script = saved.find((c) => c.id === e.target.value);
+ if (script) onLoad(script);
+ }}
+ >
+ Choose a conversation
+ {saved.map((s) => (
+
+ {s.title}
+
+ ))}
+
+
+ )}
+ {showAI && (
+
+
+ What should they talk about?
+ setTopic(e.target.value)}
+ placeholder="A topic for the conversation"
+ />
+
+
+
+ {busy ? 'Writing…' : 'Generate draft'}
+
+
+
+ )}
+
+
+ {value.turns.map((turn, index) => {
+ const character = characters.find((c) => c.id === turn.character_id);
+ return (
+
+
+
+ update({
+ turns: value.turns.map((t, i) =>
+ i === index ? { ...t, character_id: e.target.value } : t,
+ ),
+ })
+ }
+ >
+
+ Choose character
+
+ {!character && turn.character_id && (
+
+ Choose a character from this scene
+
+ )}
+ {characters.map((c) => (
+
+ {c.name}
+
+ ))}
+
+ update({ turns: value.turns.filter((_, i) => i !== index) })}
+ >
+
+
+
+
+ update({
+ turns: value.turns.map((t, i) =>
+ i === index ? { ...t, text: e.target.value } : t,
+ ),
+ })
+ }
+ />
+
+ );
+ })}
+
+
+
= 40 || characters.length !== 2}
+ onClick={() =>
+ update({
+ turns: [
+ ...value.turns,
+ {
+ character_id: characters[value.turns.length % 2]?.id || '',
+ text: '',
+ direction: '',
+ pause_after: 0.4,
+ },
+ ],
+ })
+ }
+ >
+
+ Add line
+
+
+ {value.turns.reduce((n, t) => n + t.text.trim().split(/\s+/).filter(Boolean).length, 0)}{' '}
+ words
+
+
+
+ Delivery options
+
+
+
+
+
+ onChange({ ...value, approved: e.target.checked })}
+ />
+ I approve these exact words for the conversation.
+
+
+
+ );
+}
diff --git a/frontend/src/features/generations/renders.page.tsx b/frontend/src/features/generations/renders.page.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..5efe812c1f1b98ddcb056169a49faa1ec00ceddc
--- /dev/null
+++ b/frontend/src/features/generations/renders.page.tsx
@@ -0,0 +1,203 @@
+import { UnavailableFeature } from '../../shared/components/unavailable-feature';
+import { useCapabilities } from '../../shared/api/use-capabilities';
+import { useState } from 'react';
+import { useQuery, useQueryClient } from '@tanstack/react-query';
+import { Download, RefreshCw, X, FileJson, CheckCircle2 } from 'lucide-react';
+import { api, assetUrl } from '../../shared/api/client';
+import type { Generation } from '../../shared/api/types';
+import { Empty, ErrorNotice, Loading, PageTitle, Modal } from '../../shared/components/ui';
+export function RendersPage() {
+ const capabilities = useCapabilities();
+ const query = useQuery({ queryKey: ['generations'], queryFn: api.jobs, refetchInterval: 3000 }),
+ client = useQueryClient();
+ const [error, setError] = useState(),
+ [review, setReview] = useState(),
+ [checks, setChecks] = useState>({
+ exact_words: false,
+ consistent_identity: false,
+ natural_reactions: false,
+ lip_sync: false,
+ notes: '',
+ });
+ async function action(fn: () => Promise) {
+ try {
+ await fn();
+ await client.invalidateQueries({ queryKey: ['generations'] });
+ setError(null);
+ } catch (e) {
+ setError(e);
+ }
+ }
+ return (
+ <>
+
+
+ {query.isLoading ? (
+
+ ) : !query.data?.length ? (
+
+ Create a scene and save a conversation in the studio, then start a render.
+
+ ) : (
+
+ {[...query.data].reverse().map((job) => (
+
+
+ {job.output_asset_id ? (
+
+ ) : (
+
+ )}
+
+
+
+
+ {job.status}
+
+ {new Date(job.created_at).toLocaleString()}
+
+
{job.settings.conversation.title}
+
+ {job.settings.kind === 'storyboard'
+ ? 'Silent storyboard · no speech or animation'
+ : 'AI-generated conversation · review required'}{' '}
+ · {job.duration?.toFixed(1) || job.settings.target_seconds}s
+
+
+
+
+
{job.stage}
+ {job.error &&
{job.error}
}
+
+ {job.output_asset_id && (
+
+
+ Download MP4
+
+ )}
+
+
+ Saved inputs
+
+ {job.status === 'queued' && (
+
action(() => api.cancel(job.id))}
+ >
+
+ Cancel
+
+ )}
+ {['failed', 'cancelled'].includes(job.status) && (
+
+ action(() => api.retry(job.id))}
+ >
+
+ Retry
+
+
+ )}
+ {job.status === 'completed' && job.settings.kind === 'animated' && (
+
{
+ setReview(job);
+ setChecks({
+ exact_words: false,
+ consistent_identity: false,
+ natural_reactions: false,
+ lip_sync: false,
+ notes: '',
+ ...job.review,
+ });
+ }}
+ >
+
+ Review performance
+
+ )}
+
+
+
+ ))}
+
+ )}
+ {review && (
+ setReview(undefined)}>
+
+
Listen and watch the entire take before marking these checks.
+ {(
+ [
+ ['exact_words', 'The spoken words match the approved script'],
+ ['consistent_identity', 'Faces, bodies and voices stay consistent'],
+ ['natural_reactions', 'Listening reactions and gestures feel natural'],
+ ['lip_sync', 'Lip movements match the correct speaker'],
+ ] as const
+ ).map(([key, label]) => (
+
+ setChecks({ ...checks, [key]: e.target.checked })}
+ />
+ {label}
+
+ ))}
+
+ Review notes
+ setChecks({ ...checks, notes: e.target.value })}
+ />
+
+
+ action(async () => {
+ await api.review(review.id, checks);
+ setReview(undefined);
+ })
+ }
+ >
+ Save review
+
+
+
+ )}
+ >
+ );
+}
diff --git a/frontend/src/features/generations/studio.page.tsx b/frontend/src/features/generations/studio.page.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..94a7c0b7e0a4224babf6afdc2b52349114ecd3df
--- /dev/null
+++ b/frontend/src/features/generations/studio.page.tsx
@@ -0,0 +1,224 @@
+import { useState } from 'react';
+import { useQuery, useQueryClient } from '@tanstack/react-query';
+import { ArrowRight, Check, Save } from 'lucide-react';
+import { api, assetUrl, request } from '../../shared/api/client';
+import type { ConversationInput, Generation } from '../../shared/api/types';
+import { useCapabilities } from '../../shared/api/use-capabilities';
+import { UnavailableFeature } from '../../shared/components/unavailable-feature';
+import { ErrorNotice, Loading } from '../../shared/components/ui';
+import { ScenePreview } from '../scenes/scene-preview';
+import { DEMO_SCENE_ID, DEMO_IMAGE_ID, DEMO_CHARACTER_IDS } from '../../shared/api/demo';
+import { DialogueEditor } from '../conversations/dialogue-editor';
+
+export function StudioPage() {
+ const capabilities = useCapabilities();
+ const chars = useQuery({ queryKey: ['characters'], queryFn: api.characters });
+ const scripts = useQuery({ queryKey: ['conversations'], queryFn: api.conversations });
+ const scenes = useQuery({ queryKey: ['scenes'], queryFn: api.scenes });
+ const characters =
+ chars.data?.filter((c) => !c.archived && DEMO_CHARACTER_IDS.some((id) => id === c.id)) || [];
+ const scene = scenes.data?.find((s) => s.id === DEMO_SCENE_ID);
+ const [script, setScript] = useState({
+ title: 'My first conversation',
+ mode: 'scripted',
+ approved: false,
+ turns: [
+ { character_id: 'royale', text: '', direction: '', pause_after: 0.4 },
+ { character_id: 'summer', text: '', direction: '', pause_after: 0.4 },
+ ],
+ });
+ const [scriptId, setScriptId] = useState();
+ const [seconds, setSeconds] = useState(60);
+ const [busy, setBusy] = useState(false);
+ const [error, setError] = useState();
+ const [notice, setNotice] = useState('');
+ const query = useQueryClient();
+ const [jobId, setJobId] = useState();
+ const job = useQuery({
+ queryKey: ['generation', jobId],
+ queryFn: () => request(`/generations/${jobId}`),
+ enabled: !!jobId,
+ refetchInterval: (query) =>
+ ['completed', 'failed', 'cancelled'].includes(query.state.data?.status || '') ? false : 3000,
+ });
+ const cast = DEMO_CHARACTER_IDS.map((id) => characters.find((c) => c.id === id)).filter(
+ (c) => c !== undefined,
+ );
+ const scriptValid =
+ !!script.title.trim() &&
+ script.turns.every((t) => t.text.trim() && characters.some((c) => c.id === t.character_id));
+ const sceneValid = scene?.image_asset_id === DEMO_IMAGE_ID && cast.length === 2;
+ const matchingSpeakers =
+ new Set(script.turns.map((t) => t.character_id)).size === 2 &&
+ script.turns.every((t) => DEMO_CHARACTER_IDS.some((id) => id === t.character_id));
+ const ready = scriptValid && sceneValid && matchingSpeakers && script.approved && scene?.approved;
+ const remaining = !sceneValid
+ ? 'The demo scene is not available. Check the backend connection.'
+ : !scriptValid
+ ? 'Give your conversation a name and fill in each line. Aim for about 120–140 words for 60 seconds.'
+ : !matchingSpeakers
+ ? 'Give both characters at least one line.'
+ : !script.approved
+ ? 'Approve the dialogue to create your preview.'
+ : '';
+
+ async function save(kind?: 'storyboard' | 'animated') {
+ if (
+ busy ||
+ !scriptValid ||
+ (kind &&
+ (!ready || capabilities.workerReason || (kind === 'animated' && !capabilities.animation)))
+ )
+ return;
+ setBusy(true);
+ setError(null);
+ setNotice('');
+ try {
+ const conversation = await api.saveConversation(script, scriptId);
+ setScriptId(conversation.id);
+ await query.invalidateQueries({ queryKey: ['conversations'] });
+ if (kind && scene) {
+ const generation = await api.generate(conversation.id, DEMO_SCENE_ID, kind, seconds);
+ setJobId(generation.id);
+ setNotice('Conversation saved. Your preview is queued below.');
+ } else setNotice('Conversation saved.');
+ } catch (e) {
+ setError(e);
+ } finally {
+ setBusy(false);
+ }
+ }
+
+ if (chars.isLoading || scenes.isLoading) return ;
+ return (
+
+
+
+ {notice && (
+
+
+ {notice}
+
+ )}
+
+
{
+ setScript(v);
+ setNotice('');
+ }}
+ characters={cast}
+ saved={scripts.data || []}
+ onLoad={(s) => {
+ setScript(s);
+ setScriptId(s.id);
+ }}
+ />
+
+
+
+ 3
+
Save or create
+
+
+
+
+
+ Duration
+ setSeconds(+e.target.value)}>
+ 10 seconds
+ 60 seconds
+
+
+
+ The storyboard is a silent scene preview.
+
+ {capabilities.animation
+ ? 'Talking videos animate both portraits separately with speech and lip-sync.'
+ : 'Speaking and lip-sync are not available yet.'}
+
+
+ {remaining &&
{remaining}
}
+
+
save()}
+ disabled={busy || !scriptValid}
+ >
+
+ {busy ? 'Saving…' : 'Save draft'}
+
+
+ save('storyboard')}
+ >
+ Create storyboard
+
+
+
+
+ save('animated')}
+ >
+ Create talking video
+
+
+
+
+
+ {jobId && (
+
+
+
Your preview
+
+
+
+ {job.isLoading &&
}
+ {job.data && (
+ <>
+
+ {job.data.status} · {job.data.stage}
+
+
+ {job.data.settings.kind === 'storyboard'
+ ? 'Silent scene preview — no spoken dialogue or lip-sync.'
+ : 'Review the spoken dialogue and animation before sharing.'}
+
+ {job.data.error && (
+
+ {job.data.error}
+
+ )}
+ {job.data.output_asset_id && (
+ <>
+
+
+ Download MP4
+
+ >
+ )}
+ >
+ )}
+
+
+ )}
+
+ );
+}
diff --git a/frontend/src/features/scenes/scene-preview.tsx b/frontend/src/features/scenes/scene-preview.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..5579af02409816c7636a7362260b88ec5401e4c1
--- /dev/null
+++ b/frontend/src/features/scenes/scene-preview.tsx
@@ -0,0 +1,42 @@
+import { useState } from 'react';
+import { assetUrl } from '../../shared/api/client';
+import { DEMO_IMAGE_ID } from '../../shared/api/demo';
+
+export function ScenePreview() {
+ const [failed, setFailed] = useState(false);
+ return (
+
+
+
+ 1
+
Your characters
+
+
+
+
+ {failed ? (
+
+ The demo image could not be loaded. Refresh once the backend is available.
+
+ ) : (
+
setFailed(true)}
+ />
+ )}
+
+
+
+ R.Royale
+ Calm, dry and thoughtful
+
+
+ Summer Breeze
+ Warm, lively and expressive
+
+
+
+
+ );
+}
diff --git a/frontend/src/features/settings/settings.page.tsx b/frontend/src/features/settings/settings.page.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..bae21156ce5621215189e5b8b61593dce403742f
--- /dev/null
+++ b/frontend/src/features/settings/settings.page.tsx
@@ -0,0 +1,136 @@
+import { useState } from 'react';
+import { DEMO_IMAGE_ID } from '../../shared/api/demo';
+import { useQuery, useQueryClient } from '@tanstack/react-query';
+import { Server, Check, RefreshCw, ShieldCheck } from 'lucide-react';
+import { api } from '../../shared/api/client';
+import { ErrorNotice, External, PageTitle } from '../../shared/components/ui';
+export function SettingsPage() {
+ const status = useQuery({ queryKey: ['system'], queryFn: api.status }),
+ assets = useQuery({ queryKey: ['assets'], queryFn: api.assets }),
+ client = useQueryClient();
+ const [checks, setChecks] = useState>(),
+ [busy, setBusy] = useState(false),
+ [error, setError] = useState();
+ async function check() {
+ setBusy(true);
+ try {
+ setChecks(await api.check());
+ } catch (e) {
+ setError(e);
+ } finally {
+ setBusy(false);
+ }
+ }
+ async function revoke(id: string) {
+ if (
+ !window.confirm(
+ 'Revoke this asset? It will no longer be available for rendering or download.',
+ )
+ )
+ return;
+ try {
+ await api.revoke(id);
+ await client.invalidateQueries({ queryKey: ['assets'] });
+ } catch (e) {
+ setError(e);
+ }
+ }
+ return (
+ <>
+
+
+ {busy ? 'Checking…' : 'Check connections'}
+
+ }
+ />
+
+
+ {Object.entries(status.data?.providers || {}).map(([key, p]) => (
+
+
+ {key}
+ {p.name}
+
+ {checks?.[key]?.message ||
+ (p.configured ? 'Configured · not verified' : 'Not configured')}
+
+ {!(key === 'dialogue'
+ ? status.data?.capabilities.ai_dialogue
+ : status.data?.capabilities.animated_video) && (
+
+ Disabled for this MVP. Connection checks do not enable the feature.
+
+ )}
+
+ {key === 'dialogue'
+ ? 'Creates editable dialogue drafts. Scripted mode works without it.'
+ : key === 'speech'
+ ? 'Synthesizes speech using your authorized voice references.'
+ : 'Animates both characters from a shared image and two audio tracks.'}
+
+
+ ))}
+
+
+ Hugging Face deployment
+
+ Set SPEECH_URL, VIDEO_URL, OLLAMA_URL and{' '}
+ PROVIDER_TOKEN in Space variables and secrets. Credentials never enter the
+ browser.
+
+
+ Worker: {status.data?.worker ? 'Heartbeat received' : 'No heartbeat yet'}
+ . Start the separate worker with the API.
+
+
+ Docker Spaces documentation
+
+
+
+
+
+ Demo assets
+
+
+ This MVP uses the included fictional scene. Image uploads and character editing are
+ disabled.
+
+ {assets.data?.length ? (
+
+ {assets.data.map((a) => (
+
+
+ {a.name}
+
+ {a.kind} · {a.rights} · {a.rights_note}
+
+
+ {a.id !== DEMO_IMAGE_ID && (
+
revoke(a.id)}>
+ Revoke
+
+ )}
+
+ ))}
+
+ ) : (
+ Your uploaded assets will appear here.
+ )}
+
+
+ What to review
+ {status.data?.limitations.map((l) => (
+
+
+ {l}
+
+ ))}
+
+ >
+ );
+}
diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..acf5ace9501f26e5cfdc00f31bae6930af3742ed
--- /dev/null
+++ b/frontend/src/main.tsx
@@ -0,0 +1,18 @@
+import React from 'react';
+import ReactDOM from 'react-dom/client';
+import { BrowserRouter } from 'react-router-dom';
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { App } from './app/app';
+import './app/styles.css';
+const client = new QueryClient({
+ defaultOptions: { queries: { retry: 1, refetchOnWindowFocus: false } },
+});
+ReactDOM.createRoot(document.getElementById('root')!).render(
+
+
+
+
+
+
+ ,
+);
diff --git a/frontend/src/shared/api/client.ts b/frontend/src/shared/api/client.ts
new file mode 100644
index 0000000000000000000000000000000000000000..5656e53288f049cf82eae26cf1100b5e61ec6a80
--- /dev/null
+++ b/frontend/src/shared/api/client.ts
@@ -0,0 +1,68 @@
+import type {
+ Asset,
+ Character,
+ CharacterInput,
+ Conversation,
+ ConversationInput,
+ Scene,
+ SceneInput,
+ Generation,
+ SystemStatus,
+ Turn,
+} from './types';
+const root = '/api/v1';
+export async function request(path: string, options: RequestInit = {}): Promise {
+ const response = await fetch(root + path, {
+ ...options,
+ headers: {
+ ...(options.body instanceof FormData ? {} : { 'Content-Type': 'application/json' }),
+ ...options.headers,
+ },
+ });
+ if (!response.ok) {
+ let message = `Request failed (${response.status})`;
+ try {
+ const body = await response.json();
+ message =
+ typeof body.detail === 'string'
+ ? body.detail
+ : body.detail?.map((e: { msg: string }) => e.msg).join('; ') || message;
+ } catch {}
+ throw new Error(message);
+ }
+ return response.status === 204 ? (undefined as T) : response.json();
+}
+const body = (value: unknown) => ({ method: 'POST', body: JSON.stringify(value) });
+export const assetUrl = (id: string) => `${root}/assets/${encodeURIComponent(id)}/file`;
+export const api = {
+ characters: () => request('/characters'),
+ saveCharacter: (data: CharacterInput, id?: string) =>
+ request(`/characters${id ? '/' + id : ''}`, {
+ ...body(data),
+ method: id ? 'PUT' : 'POST',
+ }),
+ conversations: () => request('/conversations'),
+ saveConversation: (data: ConversationInput, id?: string) =>
+ request(`/conversations${id ? '/' + id : ''}`, {
+ ...body(data),
+ method: id ? 'PUT' : 'POST',
+ }),
+ draft: (topic: string, character_ids: string[]) =>
+ request<{ turns: Turn[] }>('/conversations/draft', body({ topic, character_ids })),
+ scenes: () => request('/scenes'),
+ saveScene: (data: SceneInput, id?: string) =>
+ request(`/scenes${id ? '/' + id : ''}`, { ...body(data), method: id ? 'PUT' : 'POST' }),
+ assets: () => request('/assets'),
+ upload: (form: FormData) => request('/assets', { method: 'POST', body: form }),
+ revoke: (id: string) => request(`/assets/${id}/revoke`, body({})),
+ jobs: () => request('/generations'),
+ generate: (conversation_id: string, scene_id: string, kind: string, target_seconds: number) =>
+ request('/generations', body({ conversation_id, scene_id, kind, target_seconds })),
+ cancel: (id: string) => request(`/generations/${id}/cancel`, body({})),
+ retry: (id: string) => request(`/generations/${id}/retry`, body({})),
+ review: (id: string, review: Record) =>
+ request(`/generations/${id}/review`, body(review)),
+ status: () => request('/system/status'),
+ check: () =>
+ request>('/system/check', body({})),
+};
diff --git a/frontend/src/shared/api/demo.ts b/frontend/src/shared/api/demo.ts
new file mode 100644
index 0000000000000000000000000000000000000000..aca574d01588181dfc648df0ab700e3b7ecb8254
--- /dev/null
+++ b/frontend/src/shared/api/demo.ts
@@ -0,0 +1,4 @@
+// Fixed cast and approved reference image for the current MVP.
+export const DEMO_SCENE_ID = 'mvp-scene';
+export const DEMO_IMAGE_ID = 'mvp-scene-image';
+export const DEMO_CHARACTER_IDS = ['royale', 'summer'] as const;
diff --git a/frontend/src/shared/api/types.ts b/frontend/src/shared/api/types.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c646090d95212bee584af238b3e61b4c13082f0a
--- /dev/null
+++ b/frontend/src/shared/api/types.ts
@@ -0,0 +1,88 @@
+export interface Profile {
+ personality: string;
+ region: string;
+ vocabulary: string;
+ aave: string;
+ slang: number;
+ pronunciation: string;
+ cadence: string;
+ code_switching: string;
+ expressiveness: number;
+ pace: number;
+ gestures: string;
+ voice_notes: string;
+ voice_preset?: string;
+}
+export interface Character {
+ id: string;
+ name: string;
+ description: string;
+ color: string;
+ profile: Profile;
+ image_asset_id: string | null;
+ voice_asset_id: string | null;
+ archived: boolean;
+ version: number;
+ created_at: string;
+}
+export type CharacterInput = Omit;
+export interface Turn {
+ character_id: string;
+ text: string;
+ direction: string;
+ pause_after: number;
+}
+export interface Conversation {
+ id: string;
+ title: string;
+ mode: 'scripted' | 'generated';
+ turns: Turn[];
+ approved: boolean;
+ version: number;
+}
+export type ConversationInput = Omit;
+export interface Scene {
+ id: string;
+ name: string;
+ image_asset_id: string;
+ character_ids: string[];
+ prompt: string;
+ approved: boolean;
+ version: number;
+}
+export type SceneInput = Omit;
+export interface Asset {
+ id: string;
+ kind: string;
+ name: string;
+ url: string;
+ rights: string;
+ rights_note: string;
+ revoked: boolean;
+}
+export interface Generation {
+ id: string;
+ status: string;
+ stage: string;
+ progress: number;
+ conversation_id: string;
+ scene_id: string;
+ created_at: string;
+ settings: {
+ kind: 'storyboard' | 'animated';
+ target_seconds: number;
+ conversation: Conversation;
+ scene: Scene;
+ characters: Character[];
+ };
+ error: string | null;
+ output_asset_id: string | null;
+ duration: number | null;
+ review: Record;
+}
+export interface SystemStatus {
+ worker: boolean;
+ providers: Record;
+ capabilities: { ai_dialogue: boolean; animated_video: boolean };
+ limitations: string[];
+}
diff --git a/frontend/src/shared/api/use-capabilities.ts b/frontend/src/shared/api/use-capabilities.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1f227958f6bae1b5500eb1796091bd25252b89d6
--- /dev/null
+++ b/frontend/src/shared/api/use-capabilities.ts
@@ -0,0 +1,38 @@
+import { useQuery } from '@tanstack/react-query';
+import { api } from './client';
+
+export const unavailable = {
+ dialogue:
+ 'AI dialogue drafting is not functional at the moment for this MVP. You can write and save dialogue manually.',
+ animation:
+ 'Talking video is unavailable until the GPU model service is ready and rendering is enabled. You can prepare a silent storyboard.',
+ speechStyle:
+ 'Automatic speech-style controls are not functional at the moment for this MVP. Existing preferences are preserved.',
+ performance:
+ 'Voice performance and gesture controls are not functional at the moment for this MVP. Existing settings are preserved.',
+ voiceDirection:
+ 'Custom voice-direction instructions are not applied by the current speech model.',
+ worker: 'Rendering is unavailable at the moment because the render worker is offline.',
+ checking: 'Feature availability is being checked. Please try again shortly.',
+ disconnected: 'Feature availability could not be checked. Reconnect to the backend to render.',
+};
+
+export function useCapabilities() {
+ const status = useQuery({ queryKey: ['system'], queryFn: api.status, refetchInterval: 15000 });
+ const dialogue = status.data?.capabilities.ai_dialogue === true;
+ const animation = status.data?.capabilities.animated_video === true;
+ const workerReason = status.isError
+ ? unavailable.disconnected
+ : status.isPending
+ ? unavailable.checking
+ : !status.data?.worker
+ ? unavailable.worker
+ : undefined;
+ return {
+ dialogue,
+ animation,
+ dialogueReason: dialogue ? undefined : unavailable.dialogue,
+ animationReason: animation ? undefined : unavailable.animation,
+ workerReason,
+ };
+}
diff --git a/frontend/src/shared/components/asset-upload.tsx b/frontend/src/shared/components/asset-upload.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..66afb9e22d92acef8e080fdce54af55f86c9d90f
--- /dev/null
+++ b/frontend/src/shared/components/asset-upload.tsx
@@ -0,0 +1,106 @@
+import { useState } from 'react';
+import { Upload } from 'lucide-react';
+import { useQueryClient } from '@tanstack/react-query';
+import { api } from '../api/client';
+import { ErrorNotice } from './ui';
+import type { Asset } from '../api/types';
+export function AssetUpload({
+ kind,
+ onUploaded,
+}: {
+ kind: 'image' | 'voice';
+ onUploaded: (asset: Asset) => void;
+}) {
+ const [file, setFile] = useState(null),
+ [rights, setRights] = useState('original'),
+ [note, setNote] = useState(''),
+ [consent, setConsent] = useState(false),
+ [busy, setBusy] = useState(false),
+ [error, setError] = useState();
+ const query = useQueryClient();
+ async function upload() {
+ if (!file) return;
+ setBusy(true);
+ setError(null);
+ const form = new FormData();
+ form.append('file', file);
+ form.append('kind', kind);
+ form.append('rights', rights);
+ form.append('rights_note', note);
+ form.append('consent', String(consent));
+ try {
+ const asset = await api.upload(form);
+ await query.invalidateQueries({ queryKey: ['assets'] });
+ onUploaded(asset);
+ setFile(null);
+ } catch (e) {
+ setError(e);
+ } finally {
+ setBusy(false);
+ }
+ }
+ return (
+
+ );
+}
diff --git a/frontend/src/shared/components/ui.tsx b/frontend/src/shared/components/ui.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..6bd9039b32a3f10a7bd215c09b8031bb840a3a5c
--- /dev/null
+++ b/frontend/src/shared/components/ui.tsx
@@ -0,0 +1,100 @@
+import { useEffect, useRef, type ReactNode } from 'react';
+import { X, LoaderCircle, AlertCircle, ArrowUpRight, AudioLines } from 'lucide-react';
+import type { Character } from '../api/types';
+import { assetUrl } from '../api/client';
+export function ErrorNotice({ error }: { error: unknown }) {
+ return error ? (
+
+
+
{error instanceof Error ? error.message : String(error)}
+
+ ) : null;
+}
+export function Loading() {
+ return (
+
+ Loading your studio…
+
+ );
+}
+export function Avatar({ character, large = false }: { character: Character; large?: boolean }) {
+ return (
+
+ {character.image_asset_id ? (
+
+ ) : (
+
+ {character.name
+ .split(/[ .]+/)
+ .map((n) => n[0])
+ .slice(0, 2)
+ .join('')}
+
+ )}
+
+ );
+}
+export function PageTitle({
+ eyebrow,
+ title,
+ description,
+ action,
+}: {
+ eyebrow: string;
+ title: string;
+ description: string;
+ action?: ReactNode;
+}) {
+ return (
+
+
+
{eyebrow}
+
{title}
+
{description}
+
+ {action}
+
+ );
+}
+export function Empty({ title, children }: { title: string; children: ReactNode }) {
+ return (
+
+
+
{title}
+
{children}
+
+ );
+}
+export function Modal({
+ title,
+ children,
+ onClose,
+}: {
+ title: string;
+ children: ReactNode;
+ onClose: () => void;
+}) {
+ const ref = useRef(null);
+ useEffect(() => {
+ ref.current?.showModal();
+ }, []);
+ return (
+
+
+ {children}
+
+ );
+}
+export function External({ href, children }: { href: string; children: ReactNode }) {
+ return (
+
+ {children}
+
+
+ );
+}
diff --git a/frontend/src/shared/components/unavailable-feature.tsx b/frontend/src/shared/components/unavailable-feature.tsx
new file mode 100644
index 0000000000000000000000000000000000000000..d80b13a522342550ba2307133e8143b616e0e8e0
--- /dev/null
+++ b/frontend/src/shared/components/unavailable-feature.tsx
@@ -0,0 +1,72 @@
+import { useEffect, useId, useState, type ReactNode } from 'react';
+import { Info } from 'lucide-react';
+
+/** Keep unavailable controls visible, but block pointer and keyboard activation. */
+export function UnavailableFeature({
+ reason,
+ children,
+ className = '',
+}: {
+ reason?: string;
+ children: ReactNode;
+ className?: string;
+}) {
+ const [visible, setVisible] = useState(false);
+ const descriptionId = useId();
+ useEffect(() => {
+ if (!visible) return;
+ const timer = window.setTimeout(() => setVisible(false), 4500);
+ return () => window.clearTimeout(timer);
+ }, [visible]);
+ return (
+ reason && setVisible(true)}
+ onMouseLeave={() => setVisible(false)}
+ onFocus={() => reason && setVisible(true)}
+ onBlur={() => setVisible(false)}
+ onClick={
+ reason
+ ? (event) => {
+ event.preventDefault();
+ setVisible(true);
+ }
+ : undefined
+ }
+ onKeyDown={
+ reason
+ ? (event) => {
+ if (event.key === 'Escape') setVisible(false);
+ if (event.key === 'Enter' || event.key === ' ') {
+ event.preventDefault();
+ setVisible(true);
+ }
+ }
+ : undefined
+ }
+ >
+
+ {children}
+
+ {reason && (
+
+ {reason}
+
+ )}
+ {reason && visible && (
+
+
+
+
Unavailable in this MVP
+
{reason}
+
+
+ )}
+
+ );
+}
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
new file mode 100644
index 0000000000000000000000000000000000000000..e8b5888f096a5fbffc0cc3ba863246b61a4bdb2d
--- /dev/null
+++ b/frontend/tsconfig.json
@@ -0,0 +1 @@
+{"compilerOptions":{"target":"ES2022","useDefineForClassFields":true,"lib":["ES2022","DOM","DOM.Iterable"],"module":"ESNext","skipLibCheck":true,"moduleResolution":"Bundler","allowImportingTsExtensions":true,"resolveJsonModule":true,"isolatedModules":true,"noEmit":true,"jsx":"react-jsx","strict":true},"include":["src","vite.config.ts","playwright.config.ts","e2e"]}
\ No newline at end of file
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f43c7022537b7172c48443e92c1c8feed59befb8
--- /dev/null
+++ b/frontend/vite.config.ts
@@ -0,0 +1,12 @@
+import { defineConfig } from 'vite';
+import react from '@vitejs/plugin-react';
+export default defineConfig({
+ plugins: [react()],
+ server: {
+ port: 5173,
+ proxy: {
+ '/api': { target: 'http://127.0.0.1:8000' },
+ '/health': { target: 'http://127.0.0.1:8000' },
+ },
+ },
+});
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000000000000000000000000000000000000..0376250a58554f8466cd7e130645afd01ab68500
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,2028 @@
+{
+ "name": "character-studio",
+ "version": "0.1.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "character-studio",
+ "version": "0.1.0",
+ "workspaces": [
+ "frontend"
+ ]
+ },
+ "frontend": {
+ "name": "@character-studio/frontend",
+ "version": "0.1.0",
+ "dependencies": {
+ "@tanstack/react-query": "^5.0.0",
+ "lucide-react": "^0.468.0",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
+ "react-router-dom": "^7.0.0"
+ },
+ "devDependencies": {
+ "@playwright/test": "^1.50.0",
+ "@types/node": "^22.0.0",
+ "@types/react": "^19.0.0",
+ "@types/react-dom": "^19.0.0",
+ "@vitejs/plugin-react": "^4.3.0",
+ "prettier": "^3.9.8",
+ "typescript": "^5.7.0",
+ "vite": "^6.0.0"
+ }
+ },
+ "node_modules/@babel/code-frame": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
+ "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.29.7",
+ "js-tokens": "^4.0.0",
+ "picocolors": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/compat-data": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
+ "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/core": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz",
+ "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.7",
+ "@babel/helper-compilation-targets": "^7.29.7",
+ "@babel/helper-module-transforms": "^7.29.7",
+ "@babel/helpers": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/template": "^7.29.7",
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7",
+ "@jridgewell/remapping": "^2.3.5",
+ "convert-source-map": "^2.0.0",
+ "debug": "^4.1.0",
+ "gensync": "^1.0.0-beta.2",
+ "json5": "^2.2.3",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/babel"
+ }
+ },
+ "node_modules/@babel/generator": {
+ "version": "7.29.8",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz",
+ "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.29.8",
+ "@babel/types": "^7.29.8",
+ "@jridgewell/gen-mapping": "^0.3.12",
+ "@jridgewell/trace-mapping": "^0.3.28",
+ "jsesc": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz",
+ "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/compat-data": "^7.29.7",
+ "@babel/helper-validator-option": "^7.29.7",
+ "browserslist": "^4.24.0",
+ "lru-cache": "^5.1.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-globals": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
+ "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-imports": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz",
+ "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/traverse": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-transforms": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz",
+ "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-module-imports": "^7.29.7",
+ "@babel/helper-validator-identifier": "^7.29.7",
+ "@babel/traverse": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-plugin-utils": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz",
+ "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
+ "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
+ "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-option": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz",
+ "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helpers": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz",
+ "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/parser": {
+ "version": "7.29.9",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz",
+ "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.8"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-react-jsx-self": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz",
+ "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-react-jsx-source": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz",
+ "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/template": {
+ "version": "7.29.7",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
+ "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.7",
+ "@babel/parser": "^7.29.7",
+ "@babel/types": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/traverse": {
+ "version": "7.29.8",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.8.tgz",
+ "integrity": "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.7",
+ "@babel/generator": "^7.29.8",
+ "@babel/helper-globals": "^7.29.7",
+ "@babel/parser": "^7.29.8",
+ "@babel/template": "^7.29.7",
+ "@babel/types": "^7.29.8",
+ "debug": "^4.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/types": {
+ "version": "7.29.8",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz",
+ "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.29.7",
+ "@babel/helper-validator-identifier": "^7.29.7"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@character-studio/frontend": {
+ "resolved": "frontend",
+ "link": true
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
+ "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz",
+ "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz",
+ "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz",
+ "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz",
+ "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz",
+ "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz",
+ "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz",
+ "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz",
+ "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz",
+ "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz",
+ "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz",
+ "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz",
+ "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz",
+ "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz",
+ "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz",
+ "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz",
+ "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz",
+ "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz",
+ "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz",
+ "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz",
+ "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz",
+ "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz",
+ "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz",
+ "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@jridgewell/gen-mapping": {
+ "version": "0.3.13",
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/sourcemap-codec": "^1.5.0",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/remapping": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
+ "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/gen-mapping": "^0.3.5",
+ "@jridgewell/trace-mapping": "^0.3.24"
+ }
+ },
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
+ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.31",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
+ "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.1.0",
+ "@jridgewell/sourcemap-codec": "^1.4.14"
+ }
+ },
+ "node_modules/@napi-rs/lzma-linux-x64-gnu": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz",
+ "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": "^22.20 || ^24.12 || >=25"
+ }
+ },
+ "node_modules/@playwright/test": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.63.0.tgz",
+ "integrity": "sha512-oxMK4vllB9RK5NQ2l1pq1IfOf2AvnEuj/vYGDj0H2nMtmtZpKtCwt/l00GEO6xjGfpBNAvjovvYdCm50dRQkpQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "playwright": "1.63.0"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@rolldown/pluginutils": {
+ "version": "1.0.0-beta.27",
+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz",
+ "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.4.tgz",
+ "integrity": "sha512-I+BSHzTAhKN2n7ZwGZsegGcZjDpLqFOMAtJz/u6uFGe0pUFbq56dEHjqJV/ZUdRJtNXNxA+hREUatZBvMR3Oiw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.4.tgz",
+ "integrity": "sha512-pu3BdjS2LtEzRu2elmGzS3fIeWSZy4BMDIaLNwjorO76+k2d0LMluijhsDx3KQyQBQ/lLUZCQA9/s6csvUfuhw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.4.tgz",
+ "integrity": "sha512-xfSrj9MHnWK9GaSqT9U0ImHtH/N8WZlHLx4cZHiuLcqs640hvZ3hLPd5UR2AZS57FaE8HrRUSpltbZdWRxHiDA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.4.tgz",
+ "integrity": "sha512-bqU99PLJb/dqb3S0GIMdeuyAEETSUgZBoqXYd3Sd+WCsV+MmPhnN6JrotWyir31+QgH7EvvE5/mwGJlEoci8Fw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.4.tgz",
+ "integrity": "sha512-JinsFZ5G40oXQb+sUuiA5x689vhr6dDYK0H0NL+rwKdL6CqnmYN8PE4ZwfRSoIjrCxqTQG/SLfTtSvHeGxoVlw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.4.tgz",
+ "integrity": "sha512-GAdA4UxpiNm27cLHr2GqXBpAD0x9FqwYBY7/YSP0Ss0/PNi4k8gbviqpIpYbVSRBaS2ZcegXEzgTQMbRNCwxCw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.4.tgz",
+ "integrity": "sha512-qDd6NoA1znaLjp4jR5U/KWCdLAKDJNB8W9ChbbDaKbo0xA+Atln5HK6LFCZ4oJQpemtRZA288DCirFRjrspptw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.4.tgz",
+ "integrity": "sha512-WtB5Tz5KTNINb8ZA+8sQ7bmjuS1JrRT7YverYIhUGdWWDlpzVWmIwuZE+jidkEXUn1l0zrEkaIMa8dHF3NGcsA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.4.tgz",
+ "integrity": "sha512-VcQ3L1tjnkKzWjryAVaFhHEWcqOfICX9uxVVoDzm2t0DpgKRHd2zOpVrJc0xsWeBZcBFyYROCIBdyR/fS174pg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.4.tgz",
+ "integrity": "sha512-6+ZQX6P5s0cMDN2Ypb8Lbm2+/sZYmZjdaYny992ujUU9UKi/4CWoJWsl1pNvjWJHNHGK51m+jKGLlh1ylb2ifQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.4.tgz",
+ "integrity": "sha512-D72ZnvkFkBXOfzMMQLcwfPLyGkKb7HZ9/mf97B7v6/P5Lbv4oFOtSY/uHbS8lH6uKUOxoKiuokdb50XZSzzbJw==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.4.tgz",
+ "integrity": "sha512-piU6BxeqA3O9KSu3kRCIQQtNqFFaTu21SEV4FwaRZowpnj3bLaWPZHw+xFqCs0XlJ+aOH3PTRWGoglH+mKA/OA==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.4.tgz",
+ "integrity": "sha512-/5PGpHwqt2EEEOUs1XwzubE/ucr0dWDQ+to3zqi4Ds7EWpwtQ79wXc4JBoxqj/OwpawTsKWzJxHfSuBOq3DrWA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.4.tgz",
+ "integrity": "sha512-cX3beZDLWt7G2oJF+nhChiT+qtaihs+S2xi7ziGmVB+2pwPng6D0Ed0HmElQOgv2UsUmSJJLGwpBao/3TDx3VA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.4.tgz",
+ "integrity": "sha512-1uz2mGWHyptR7DgHHrlbdRAjXK7v7elGZ9lMja910/RP+ZYbX6xAmCiU9UZSX4hqmgtHMv6lr5l3kq1HIOpcag==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.4.tgz",
+ "integrity": "sha512-nLS8topojxyz7SRpKR2IODRpQ0XPZ+xaOXvT3+hqK/Uy8Lo5HFgkkIBiIrCu5tL5YqzTvgovGw55PwpahTAGig==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.4.tgz",
+ "integrity": "sha512-gs7DRKotr3l3q+jGPQBjH0ng1FjlEDm5ueQrkw5JtQvtLyEIcLASqAEaor56BhkKRzk+IcQzrcanBdb/bBQn8g==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.4.tgz",
+ "integrity": "sha512-791ET7W17NnScOZM7h4dX5hYspxE28htPFsb1awY/NRR8+PRNkS53e475rDdxXXDrP+kwnCcNWg9CX5ztn/Aqw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.4.tgz",
+ "integrity": "sha512-iwZQRcmj7g88g3tzefIrQY7qvmuA/cfYwhrDtTBhsmukO4U2huVO5W+86XacUMRvdSFVAc6kZUZy21JaRwiB9w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.4.tgz",
+ "integrity": "sha512-dVHFp9gRWrdTpnqQuGfCwd7hOQDatK1VCP2iWhLY/cGrOQs/ucFzJ6A5SRqbXX12ZDI8EUuejSM5kwg+ja7Png==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.4.tgz",
+ "integrity": "sha512-t3NlauOW6gxZVVFcBEnO62Cb4wbyDFL416gTg1uFI/2tgqYQlf69FbSE115Ajre9I+c26Lk4mcmdFUsS/DGifQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.4.tgz",
+ "integrity": "sha512-xWuIaSye5FWZF8+UYtVEcHtRJDN5kN9Kfgxx3Kq8XIov9KSKbc1fiqQCm90SKrgQbUXZelbnUhnlUJmfSE7P9A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.4.tgz",
+ "integrity": "sha512-9ALJJUOg/ZflMJepVo2PlgsGxSaxN7SQ4Z8GoZfVlarWr6r3rkHUNsd/zAio7p4YMtChSMXPionxej4Hkf6CXQ==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.4.tgz",
+ "integrity": "sha512-blj9z5qx/Pv4WU0W1NMFDB97e0JH5ed+aZGywW8WCvp/NhWX/4PFAq5uu6Q0AebNn+Vo6KzUYDT++JzTT5ojlQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.4.tgz",
+ "integrity": "sha512-Erx822VRBwLa124shbj+wNXe//BOgMEctDV0m1aqTQdNO1S69DgNUCFKC1RCeZfixs1J31l6igk1ziyXErbigQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@tanstack/query-core": {
+ "version": "5.103.2",
+ "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.103.2.tgz",
+ "integrity": "sha512-I8DkFXls5jXLqtm8+QpOhEmG07hIblhSZFzafg9wHsMSEvMzULy9hK17wU1T/ahfhMbtITJhbxutwwCoihkR7A==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ }
+ },
+ "node_modules/@tanstack/react-query": {
+ "version": "5.103.2",
+ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.103.2.tgz",
+ "integrity": "sha512-B+fWiYZBc+0uUD5zDZAeLw9dKj7XEsdnuu6zRZ+no6LNKpeE3P3bJ+N6HINjcIlWR6fW3vUoTneEaGa2V6ehqw==",
+ "license": "MIT",
+ "dependencies": {
+ "@tanstack/query-core": "5.103.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ },
+ "peerDependencies": {
+ "react": "^18 || ^19"
+ }
+ },
+ "node_modules/@types/babel__core": {
+ "version": "7.20.5",
+ "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",
+ "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.20.7",
+ "@babel/types": "^7.20.7",
+ "@types/babel__generator": "*",
+ "@types/babel__template": "*",
+ "@types/babel__traverse": "*"
+ }
+ },
+ "node_modules/@types/babel__generator": {
+ "version": "7.27.0",
+ "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz",
+ "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__template": {
+ "version": "7.4.4",
+ "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz",
+ "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.1.0",
+ "@babel/types": "^7.0.0"
+ }
+ },
+ "node_modules/@types/babel__traverse": {
+ "version": "7.28.0",
+ "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz",
+ "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.28.2"
+ }
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.9",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
+ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "22.20.4",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.4.tgz",
+ "integrity": "sha512-zJRE40jpHtKqE/C4fgHrAKQLJuSpzEnP9ff9Y7YtoR3Wd2pwqzlekDeEuUQXjRd+QCYnVnNwuJYmhdk9XV8gvA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~6.21.0"
+ }
+ },
+ "node_modules/@types/react": {
+ "version": "19.3.0",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz",
+ "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "csstype": "^3.2.2"
+ }
+ },
+ "node_modules/@types/react-dom": {
+ "version": "19.3.0",
+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz",
+ "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "^19.3.0"
+ }
+ },
+ "node_modules/@vitejs/plugin-react": {
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz",
+ "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.28.0",
+ "@babel/plugin-transform-react-jsx-self": "^7.27.1",
+ "@babel/plugin-transform-react-jsx-source": "^7.27.1",
+ "@rolldown/pluginutils": "1.0.0-beta.27",
+ "@types/babel__core": "^7.20.5",
+ "react-refresh": "^0.17.0"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "peerDependencies": {
+ "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
+ }
+ },
+ "node_modules/baseline-browser-mapping": {
+ "version": "2.11.25",
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.25.tgz",
+ "integrity": "sha512-gMmEShwwq7FJqMwvfRwvCl00v4kN+KOfJqXn+f4nrufak5gNHJOksd/60Dvjuz7sI8Y5WiSFBa8FEYr+zoyqCw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "baseline-browser-mapping": "dist/cli.cjs"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/browserslist": {
+ "version": "4.29.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.0.tgz",
+ "integrity": "sha512-3GSvyjvDI4Dur1Meg2BekJquu5uF+9R9a1+5M1Mde192eZoXbeXjzgOsgqPS2V8D5wrrip0gR5Hf/GhWQ9ZzaA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "baseline-browser-mapping": "^2.11.23",
+ "caniuse-lite": "^1.0.30001810",
+ "electron-to-chromium": "^1.5.427",
+ "node-releases": "^2.0.55",
+ "update-browserslist-db": "^1.3.3"
+ },
+ "bin": {
+ "browserslist": "cli.js"
+ },
+ "engines": {
+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+ }
+ },
+ "node_modules/caniuse-lite": {
+ "version": "1.0.30001810",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz",
+ "integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "CC-BY-4.0"
+ },
+ "node_modules/convert-source-map": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
+ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/cookie": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/csstype": {
+ "version": "3.2.3",
+ "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
+ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/debug": {
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
+ "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ms": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/electron-to-chromium": {
+ "version": "1.5.433",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.433.tgz",
+ "integrity": "sha512-5lCAbyZBjtmUt/RAGHRqrL2q0oEFRThDAsZHHDn9XHa89Qw7gMYOeSicBTy+AHfvo0r6vwsZvqNJTQIQy1BLzA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/esbuild": {
+ "version": "0.25.12",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz",
+ "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.25.12",
+ "@esbuild/android-arm": "0.25.12",
+ "@esbuild/android-arm64": "0.25.12",
+ "@esbuild/android-x64": "0.25.12",
+ "@esbuild/darwin-arm64": "0.25.12",
+ "@esbuild/darwin-x64": "0.25.12",
+ "@esbuild/freebsd-arm64": "0.25.12",
+ "@esbuild/freebsd-x64": "0.25.12",
+ "@esbuild/linux-arm": "0.25.12",
+ "@esbuild/linux-arm64": "0.25.12",
+ "@esbuild/linux-ia32": "0.25.12",
+ "@esbuild/linux-loong64": "0.25.12",
+ "@esbuild/linux-mips64el": "0.25.12",
+ "@esbuild/linux-ppc64": "0.25.12",
+ "@esbuild/linux-riscv64": "0.25.12",
+ "@esbuild/linux-s390x": "0.25.12",
+ "@esbuild/linux-x64": "0.25.12",
+ "@esbuild/netbsd-arm64": "0.25.12",
+ "@esbuild/netbsd-x64": "0.25.12",
+ "@esbuild/openbsd-arm64": "0.25.12",
+ "@esbuild/openbsd-x64": "0.25.12",
+ "@esbuild/openharmony-arm64": "0.25.12",
+ "@esbuild/sunos-x64": "0.25.12",
+ "@esbuild/win32-arm64": "0.25.12",
+ "@esbuild/win32-ia32": "0.25.12",
+ "@esbuild/win32-x64": "0.25.12"
+ }
+ },
+ "node_modules/escalade": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/fdir": {
+ "version": "6.5.0",
+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "peerDependencies": {
+ "picomatch": "^3 || ^4"
+ },
+ "peerDependenciesMeta": {
+ "picomatch": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/gensync": {
+ "version": "1.0.0-beta.2",
+ "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
+ "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/jsesc": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
+ "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "jsesc": "bin/jsesc"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/json5": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+ "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "json5": "lib/cli.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/lru-cache": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
+ "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "yallist": "^3.0.2"
+ }
+ },
+ "node_modules/lucide-react": {
+ "version": "0.468.0",
+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.468.0.tgz",
+ "integrity": "sha512-6koYRhnM2N0GGZIdXzSeiNwguv1gt/FAjZOiPl76roBi3xKEXa4WmfpxgQwTTL4KipXjefrnf3oV4IsYhi4JFA==",
+ "license": "ISC",
+ "peerDependencies": {
+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.19",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.19.tgz",
+ "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/node-releases": {
+ "version": "2.0.56",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.56.tgz",
+ "integrity": "sha512-x0InOIyzgdk+eyaWaRJFH5snEtiImgBgblZ2CyPrLmqqcuMQkEvcDPHbzqbD8eDsSeJbVOjn+crzyzHaM4D+/A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/picocolors": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/picomatch": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",
+ "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/playwright": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz",
+ "integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "playwright-core": "1.63.0"
+ },
+ "bin": {
+ "playwright": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/playwright-core": {
+ "version": "1.63.0",
+ "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz",
+ "integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "playwright-core": "cli.js"
+ },
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.28",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.28.tgz",
+ "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/postcss/"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/postcss"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "nanoid": "^3.3.18",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/prettier": {
+ "version": "3.9.8",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.8.tgz",
+ "integrity": "sha512-WRFq3Wn3WId7LLROfMLdH7xaFr2jR62wU8nLO6rQUOLOxNZUviyJQs1M0iIhLexSFy+L+w0ch66wtoO2jRjG0A==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "prettier": "bin/prettier.cjs"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
+ }
+ },
+ "node_modules/react": {
+ "version": "19.3.0",
+ "resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz",
+ "integrity": "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-dom": {
+ "version": "19.3.0",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz",
+ "integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==",
+ "license": "MIT",
+ "dependencies": {
+ "scheduler": "^0.28.0"
+ },
+ "peerDependencies": {
+ "react": "^19.3.0"
+ }
+ },
+ "node_modules/react-refresh": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz",
+ "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-router": {
+ "version": "7.18.4",
+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.18.4.tgz",
+ "integrity": "sha512-PUPQcMhMGRAslLcvtlPz/kmzBEWPhLdgLFrL7pLNepBL6dX0lWj4WD2cUYVgYCuT3jxvghYFg81cDTj44DhetQ==",
+ "license": "MIT",
+ "dependencies": {
+ "cookie": "^1.0.1",
+ "set-cookie-parser": "^2.6.0"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "react-dom": ">=18"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-router-dom": {
+ "version": "7.18.4",
+ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.18.4.tgz",
+ "integrity": "sha512-yrfmJHIpDG7taCpqKjT1G5B6q3O2K+RN8/fgNf0lTjCwiPbQ0ei6vXX9ZjQR+7ld8Tr7Z5xmyMnZ8YJrphWQUw==",
+ "license": "MIT",
+ "dependencies": {
+ "react-router": "7.18.4"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "react-dom": ">=18"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "4.63.4",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.4.tgz",
+ "integrity": "sha512-4U0liVayNIoLp3GFl1FcI8561WepLnZ1rqfraGh7S9B3Ur5F9S283y8Futii7RUU2C/97tOBmBy7nYvhoiOpbQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.9"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@napi-rs/lzma-linux-x64-gnu": "1.5.1",
+ "@rollup/rollup-android-arm-eabi": "4.63.4",
+ "@rollup/rollup-android-arm64": "4.63.4",
+ "@rollup/rollup-darwin-arm64": "4.63.4",
+ "@rollup/rollup-darwin-x64": "4.63.4",
+ "@rollup/rollup-freebsd-arm64": "4.63.4",
+ "@rollup/rollup-freebsd-x64": "4.63.4",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.63.4",
+ "@rollup/rollup-linux-arm-musleabihf": "4.63.4",
+ "@rollup/rollup-linux-arm64-gnu": "4.63.4",
+ "@rollup/rollup-linux-arm64-musl": "4.63.4",
+ "@rollup/rollup-linux-loong64-gnu": "4.63.4",
+ "@rollup/rollup-linux-loong64-musl": "4.63.4",
+ "@rollup/rollup-linux-ppc64-gnu": "4.63.4",
+ "@rollup/rollup-linux-ppc64-musl": "4.63.4",
+ "@rollup/rollup-linux-riscv64-gnu": "4.63.4",
+ "@rollup/rollup-linux-riscv64-musl": "4.63.4",
+ "@rollup/rollup-linux-s390x-gnu": "4.63.4",
+ "@rollup/rollup-linux-x64-gnu": "4.63.4",
+ "@rollup/rollup-linux-x64-musl": "4.63.4",
+ "@rollup/rollup-openbsd-x64": "4.63.4",
+ "@rollup/rollup-openharmony-arm64": "4.63.4",
+ "@rollup/rollup-win32-arm64-msvc": "4.63.4",
+ "@rollup/rollup-win32-ia32-msvc": "4.63.4",
+ "@rollup/rollup-win32-x64-gnu": "4.63.4",
+ "@rollup/rollup-win32-x64-msvc": "4.63.4",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/scheduler": {
+ "version": "0.28.0",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz",
+ "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==",
+ "license": "MIT"
+ },
+ "node_modules/semver": {
+ "version": "6.3.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+ "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ }
+ },
+ "node_modules/set-cookie-parser": {
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",
+ "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",
+ "license": "MIT"
+ },
+ "node_modules/source-map-js": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+ "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.17",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.4"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "6.21.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
+ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/update-browserslist-db": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz",
+ "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ },
+ {
+ "type": "tidelift",
+ "url": "https://tidelift.com/funding/github/npm/browserslist"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/ai"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "escalade": "^3.2.0",
+ "picocolors": "^1.1.1"
+ },
+ "bin": {
+ "update-browserslist-db": "cli.js"
+ },
+ "peerDependencies": {
+ "browserslist": ">= 4.21.0"
+ }
+ },
+ "node_modules/vite": {
+ "version": "6.4.3",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz",
+ "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "^0.25.0",
+ "fdir": "^6.4.4",
+ "picomatch": "^4.0.2",
+ "postcss": "^8.5.3",
+ "rollup": "^4.34.9",
+ "tinyglobby": "^0.2.13"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^18.0.0 || ^20.0.0 || >=22.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
+ "jiti": ">=1.21.0",
+ "less": "*",
+ "lightningcss": "^1.21.0",
+ "sass": "*",
+ "sass-embedded": "*",
+ "stylus": "*",
+ "sugarss": "*",
+ "terser": "^5.16.0",
+ "tsx": "^4.8.1",
+ "yaml": "^2.4.2"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ },
+ "jiti": {
+ "optional": true
+ },
+ "less": {
+ "optional": true
+ },
+ "lightningcss": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "sass-embedded": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "sugarss": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ },
+ "tsx": {
+ "optional": true
+ },
+ "yaml": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/yallist": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
+ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
+ "dev": true,
+ "license": "ISC"
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..e0cdb177db391dd53fd88be208924bab5d7a7f79
--- /dev/null
+++ b/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "character-studio",
+ "private": true,
+ "version": "0.1.0",
+ "workspaces": [
+ "frontend"
+ ],
+ "scripts": {
+ "dev": "npm run dev --workspace frontend",
+ "build": "npm run build --workspace frontend",
+ "typecheck": "npm run typecheck --workspace frontend",
+ "test:e2e": "npm run test:e2e --workspace frontend"
+ }
+}
diff --git a/scripts/run_e2e_server.py b/scripts/run_e2e_server.py
new file mode 100644
index 0000000000000000000000000000000000000000..05893f60bfcdffd86fe24de7c6c1afaa6ede5788
--- /dev/null
+++ b/scripts/run_e2e_server.py
@@ -0,0 +1,54 @@
+"""Disposable database + actual API/worker for browser tests. Does not load ML models."""
+
+import os
+import subprocess
+import sys
+import tempfile
+import time
+from pathlib import Path
+
+root = Path(__file__).resolve().parents[1]
+with tempfile.TemporaryDirectory(prefix="character-e2e-") as folder:
+ env = {
+ **os.environ,
+ "PYTHONPATH": str(root / "backend"),
+ "DATABASE_URL": "sqlite:///" + folder + "/app.db",
+ "ASSETS_DIR": folder + "/assets",
+ "SEED_CHARACTERS": "true",
+ "SPEECH_URL": "",
+ "VIDEO_URL": "",
+ }
+ subprocess.run(
+ [sys.executable, "-c", "from app.bootstrap import initialize; initialize()"],
+ env=env,
+ check=True,
+ )
+ api = subprocess.Popen(
+ [
+ sys.executable,
+ "-m",
+ "uvicorn",
+ "app.main:app",
+ "--host",
+ "127.0.0.1",
+ "--port",
+ "8000",
+ ],
+ env=env,
+ cwd=root,
+ )
+ worker = subprocess.Popen(
+ [sys.executable, "-m", "app.generations.generation_worker"], env=env, cwd=root
+ )
+ try:
+ while api.poll() is None and worker.poll() is None:
+ time.sleep(0.5)
+ finally:
+ for process in (api, worker):
+ process.terminate()
+ for process in (api, worker):
+ try:
+ process.wait(timeout=10)
+ except subprocess.TimeoutExpired:
+ process.kill()
+ process.wait()
diff --git a/scripts/start.py b/scripts/start.py
new file mode 100644
index 0000000000000000000000000000000000000000..3311bd689bf6513036e591838360980113df36eb
--- /dev/null
+++ b/scripts/start.py
@@ -0,0 +1,82 @@
+"""Run one API process and one worker. Model services are deployed separately."""
+
+import os
+import signal
+import subprocess
+import sys
+import time
+import secrets
+from pathlib import Path
+
+root = Path(__file__).resolve().parents[1]
+env = {**os.environ, "PYTHONPATH": str(root / "backend")}
+bundled_models = os.getenv("START_MODEL_SERVICE", "false").lower() == "true"
+if bundled_models:
+ env["PROVIDER_TOKEN"] = env.get("PROVIDER_TOKEN") or secrets.token_urlsafe(32)
+ env["SPEECH_URL"] = "http://127.0.0.1:8001"
+ env["VIDEO_URL"] = "http://127.0.0.1:8001"
+ env["SPEECH_PROVIDER"] = "kokoro"
+ env["VIDEO_PROVIDER"] = "sadtalker"
+subprocess.run(
+ [sys.executable, "-c", "from app.bootstrap import initialize; initialize()"],
+ env=env,
+ check=True,
+)
+processes = []
+
+
+def stop(*args):
+ for process in processes:
+ if process.poll() is None:
+ process.terminate()
+ for process in processes:
+ try:
+ process.wait(timeout=15)
+ except subprocess.TimeoutExpired:
+ process.kill()
+ sys.exit(0)
+
+
+signal.signal(signal.SIGTERM, stop)
+signal.signal(signal.SIGINT, stop)
+if bundled_models:
+ processes.append(
+ subprocess.Popen(
+ [
+ sys.executable,
+ "-m",
+ "uvicorn",
+ "model_services.lightweight_service:app",
+ "--host",
+ "127.0.0.1",
+ "--port",
+ "8001",
+ ],
+ env=env,
+ cwd=root,
+ )
+ )
+processes.append(
+ subprocess.Popen(
+ [
+ sys.executable,
+ "-m",
+ "uvicorn",
+ "app.main:app",
+ "--host",
+ os.getenv("HOST", "127.0.0.1"),
+ "--port",
+ os.getenv("PORT", "8000"),
+ ],
+ env=env,
+ cwd=root,
+ )
+)
+processes.append(
+ subprocess.Popen(
+ [sys.executable, "-m", "app.generations.generation_worker"], env=env, cwd=root
+ )
+)
+while all(p.poll() is None for p in processes):
+ time.sleep(1)
+stop()