From 170dc0695dc26f822a3891da9df5b710dbe7337f Mon Sep 17 00:00:00 2001 From: Benjiyaya Date: Wed, 19 Aug 2026 03:53:29 +0800 Subject: [PATCH] Calliope 1.1.0: publish backend, web, and example workflows --- .gitignore | 45 + README.md | 72 +- calliope-backend/calliope.spec | 74 + calliope-backend/calliope_config.example.json | 15 + calliope-backend/launcher.py | 21 + calliope-backend/pyproject.toml | 34 + calliope-backend/requirements.txt | 13 + calliope-backend/src/calliope/__init__.py | 1 + .../src/calliope/agent/__init__.py | 1 + .../src/calliope/agent/asset_agent.py | 173 + calliope-backend/src/calliope/agent/llm.py | 69 + .../src/calliope/agent/prompts.py | 489 ++ .../src/calliope/agent/script_agent.py | 185 + .../src/calliope/agent/video_agent.py | 227 + .../src/calliope/comfyui/__init__.py | 5 + .../src/calliope/comfyui/client.py | 135 + .../src/calliope/comfyui/dry_run.py | 49 + .../src/calliope/comfyui/parser.py | 82 + .../src/calliope/comfyui/patcher.py | 31 + .../src/calliope/comfyui/profiles.py | 28 + .../src/calliope/comfyui/registry.py | 85 + .../src/calliope/comfyui/roles.py | 85 + .../src/calliope/comfyui/smart_fill.py | 158 + calliope-backend/src/calliope/config.py | 202 + calliope-backend/src/calliope/db.py | 225 + .../src/calliope/events/__init__.py | 3 + calliope-backend/src/calliope/events/bus.py | 50 + .../src/calliope/export/__init__.py | 0 .../src/calliope/export/runner.py | 281 ++ calliope-backend/src/calliope/main.py | 120 + .../src/calliope/models/__init__.py | 1 + .../src/calliope/models/schemas.py | 188 + .../src/calliope/queue/__init__.py | 4 + .../src/calliope/queue/manager.py | 187 + calliope-backend/src/calliope/queue/worker.py | 294 ++ .../src/calliope/routers/__init__.py | 1 + .../src/calliope/routers/assets.py | 72 + .../src/calliope/routers/events.py | 40 + calliope-backend/src/calliope/routers/jobs.py | 157 + .../src/calliope/routers/playground.py | 395 ++ .../src/calliope/routers/projects.py | 114 + .../src/calliope/routers/scenes.py | 166 + .../src/calliope/routers/settings.py | 47 + .../src/calliope/routers/story.py | 460 ++ .../src/calliope/routers/workflows.py | 121 + calliope-backend/tests/__init__.py | 0 calliope-backend/tests/conftest.py | 40 + calliope-backend/tests/test_export.py | 207 + calliope-backend/tests/test_h3_profile.py | 128 + calliope-backend/tests/test_pipeline.py | 165 + calliope-backend/tests/test_playground.py | 122 + .../tests/test_playground_uploads.py | 80 + calliope-backend/tests/test_projects.py | 121 + calliope-backend/tests/test_rebase_paths.py | 76 + calliope-backend/tests/test_roles.py | 104 + .../tests/test_script_scene_count.py | 86 + calliope-web/package-lock.json | 4054 +++++++++++++++++ calliope-web/package.json | 34 + calliope-web/src/app.html | 18 + calliope-web/src/hooks.client.ts | 8 + calliope-web/src/hooks.server.ts | 4 + calliope-web/src/lib/api.ts | 312 ++ calliope-web/src/lib/comfy/classifyInput.ts | 151 + calliope-web/src/lib/comfy/parser.ts | 137 + calliope-web/src/lib/comfy/promptInput.ts | 50 + calliope-web/src/lib/comfy/types.ts | 76 + .../src/lib/comfy/useUpload.svelte.ts | 95 + .../src/lib/components/ActivityPanel.svelte | 611 +++ .../src/lib/components/AppHeader.svelte | 132 + .../src/lib/components/AssetThumb.svelte | 132 + .../src/lib/components/AssetsStage.svelte | 1196 +++++ .../src/lib/components/AttachToProject.svelte | 319 ++ .../lib/components/ComfyDynamicForm.svelte | 694 +++ .../lib/components/GeneratingOverlay.svelte | 89 + .../src/lib/components/ImageLightbox.svelte | 315 ++ calliope-web/src/lib/components/JobRow.svelte | 163 + .../src/lib/components/NavRail.svelte | 134 + .../src/lib/components/OmniComposer.svelte | 554 +++ .../src/lib/components/ProjectCard.svelte | 480 ++ .../src/lib/components/QueueStage.svelte | 916 ++++ .../src/lib/components/SafeMedia.svelte | 108 + .../src/lib/components/ScriptStage.svelte | 659 +++ .../src/lib/components/StoryStage.svelte | 927 ++++ .../src/lib/components/ToastHost.svelte | 162 + .../src/lib/components/omni/MediaTile.svelte | 464 ++ .../lib/components/omni/PillPopover.svelte | 199 + .../src/lib/components/omni/PillSelect.svelte | 259 ++ .../lib/components/omni/PillStepper.svelte | 110 + .../components/settings/SettingsNav.svelte | 108 + .../settings/WorkflowsLibrary.svelte | 700 +++ .../src/lib/components/ui/Button.svelte | 147 + .../src/lib/components/ui/Card.svelte | 84 + .../lib/components/ui/ConfirmDialog.svelte | 63 + .../src/lib/components/ui/EmptyState.svelte | 64 + .../src/lib/components/ui/Icon.svelte | 37 + .../src/lib/components/ui/Modal.svelte | 230 + .../src/lib/components/ui/ProgressBar.svelte | 121 + calliope-web/src/lib/components/ui/README.md | 263 ++ .../src/lib/components/ui/Skeleton.svelte | 54 + .../src/lib/components/ui/Spinner.svelte | 59 + .../src/lib/components/ui/StatusChip.svelte | 106 + calliope-web/src/lib/components/ui/icons.ts | 70 + .../lib/components/video/ClipMonitor.svelte | 227 + .../components/video/SceneFilmstrip.svelte | 239 + .../components/video/SceneScriptDrawer.svelte | 207 + .../video/VideoEditWorkspace.svelte | 190 + calliope-web/src/lib/durationBudget.ts | 81 + calliope-web/src/lib/events.ts | 67 + calliope-web/src/lib/jobProgress.ts | 200 + calliope-web/src/lib/promptTemplates.ts | 70 + calliope-web/src/lib/toast.ts | 92 + calliope-web/src/routes/+layout.svelte | 16 + calliope-web/src/routes/+layout.ts | 5 + calliope-web/src/routes/+page.svelte | 441 ++ calliope-web/src/routes/+page.ts | 8 + calliope-web/src/routes/app.css | 158 + .../src/routes/favicon.png/+server.ts | 5 + .../src/routes/playground/+page.svelte | 869 ++++ calliope-web/src/routes/playground/+page.ts | 2 + .../src/routes/project/[id]/+page.svelte | 329 ++ calliope-web/src/routes/project/[id]/+page.ts | 8 + calliope-web/src/routes/settings/+page.svelte | 410 ++ calliope-web/src/routes/settings/+page.ts | 2 + calliope-web/svelte.config.js | 23 + calliope-web/tailwind.config.js | 22 + calliope-web/tsconfig.json | 21 + calliope-web/vite.config.ts | 17 + electron/README.md | 103 - electron/main.js | 216 - electron/package-lock.json | 3594 --------------- electron/package.json | 49 - .../Krea2_t2i_20260818_API.json | 372 ++ .../krea2_T2I_CharSheetV1_API.json | 536 +++ .../video_minimax_h3_r2v_2ref_API.json | 351 ++ .../video_minimax_h3_r2v_3ref_API.json | 364 ++ .../video_minimax_h3_r2v_4ref_API.json | 377 ++ .../video_minimax_h3_r2v_5ref_API.json | 390 ++ .../video_minimax_h3_r2v_API.json | 338 ++ 138 files changed, 28423 insertions(+), 3978 deletions(-) create mode 100644 .gitignore create mode 100644 calliope-backend/calliope.spec create mode 100644 calliope-backend/calliope_config.example.json create mode 100644 calliope-backend/launcher.py create mode 100644 calliope-backend/pyproject.toml create mode 100644 calliope-backend/requirements.txt create mode 100644 calliope-backend/src/calliope/__init__.py create mode 100644 calliope-backend/src/calliope/agent/__init__.py create mode 100644 calliope-backend/src/calliope/agent/asset_agent.py create mode 100644 calliope-backend/src/calliope/agent/llm.py create mode 100644 calliope-backend/src/calliope/agent/prompts.py create mode 100644 calliope-backend/src/calliope/agent/script_agent.py create mode 100644 calliope-backend/src/calliope/agent/video_agent.py create mode 100644 calliope-backend/src/calliope/comfyui/__init__.py create mode 100644 calliope-backend/src/calliope/comfyui/client.py create mode 100644 calliope-backend/src/calliope/comfyui/dry_run.py create mode 100644 calliope-backend/src/calliope/comfyui/parser.py create mode 100644 calliope-backend/src/calliope/comfyui/patcher.py create mode 100644 calliope-backend/src/calliope/comfyui/profiles.py create mode 100644 calliope-backend/src/calliope/comfyui/registry.py create mode 100644 calliope-backend/src/calliope/comfyui/roles.py create mode 100644 calliope-backend/src/calliope/comfyui/smart_fill.py create mode 100644 calliope-backend/src/calliope/config.py create mode 100644 calliope-backend/src/calliope/db.py create mode 100644 calliope-backend/src/calliope/events/__init__.py create mode 100644 calliope-backend/src/calliope/events/bus.py create mode 100644 calliope-backend/src/calliope/export/__init__.py create mode 100644 calliope-backend/src/calliope/export/runner.py create mode 100644 calliope-backend/src/calliope/main.py create mode 100644 calliope-backend/src/calliope/models/__init__.py create mode 100644 calliope-backend/src/calliope/models/schemas.py create mode 100644 calliope-backend/src/calliope/queue/__init__.py create mode 100644 calliope-backend/src/calliope/queue/manager.py create mode 100644 calliope-backend/src/calliope/queue/worker.py create mode 100644 calliope-backend/src/calliope/routers/__init__.py create mode 100644 calliope-backend/src/calliope/routers/assets.py create mode 100644 calliope-backend/src/calliope/routers/events.py create mode 100644 calliope-backend/src/calliope/routers/jobs.py create mode 100644 calliope-backend/src/calliope/routers/playground.py create mode 100644 calliope-backend/src/calliope/routers/projects.py create mode 100644 calliope-backend/src/calliope/routers/scenes.py create mode 100644 calliope-backend/src/calliope/routers/settings.py create mode 100644 calliope-backend/src/calliope/routers/story.py create mode 100644 calliope-backend/src/calliope/routers/workflows.py create mode 100644 calliope-backend/tests/__init__.py create mode 100644 calliope-backend/tests/conftest.py create mode 100644 calliope-backend/tests/test_export.py create mode 100644 calliope-backend/tests/test_h3_profile.py create mode 100644 calliope-backend/tests/test_pipeline.py create mode 100644 calliope-backend/tests/test_playground.py create mode 100644 calliope-backend/tests/test_playground_uploads.py create mode 100644 calliope-backend/tests/test_projects.py create mode 100644 calliope-backend/tests/test_rebase_paths.py create mode 100644 calliope-backend/tests/test_roles.py create mode 100644 calliope-backend/tests/test_script_scene_count.py create mode 100644 calliope-web/package-lock.json create mode 100644 calliope-web/package.json create mode 100644 calliope-web/src/app.html create mode 100644 calliope-web/src/hooks.client.ts create mode 100644 calliope-web/src/hooks.server.ts create mode 100644 calliope-web/src/lib/api.ts create mode 100644 calliope-web/src/lib/comfy/classifyInput.ts create mode 100644 calliope-web/src/lib/comfy/parser.ts create mode 100644 calliope-web/src/lib/comfy/promptInput.ts create mode 100644 calliope-web/src/lib/comfy/types.ts create mode 100644 calliope-web/src/lib/comfy/useUpload.svelte.ts create mode 100644 calliope-web/src/lib/components/ActivityPanel.svelte create mode 100644 calliope-web/src/lib/components/AppHeader.svelte create mode 100644 calliope-web/src/lib/components/AssetThumb.svelte create mode 100644 calliope-web/src/lib/components/AssetsStage.svelte create mode 100644 calliope-web/src/lib/components/AttachToProject.svelte create mode 100644 calliope-web/src/lib/components/ComfyDynamicForm.svelte create mode 100644 calliope-web/src/lib/components/GeneratingOverlay.svelte create mode 100644 calliope-web/src/lib/components/ImageLightbox.svelte create mode 100644 calliope-web/src/lib/components/JobRow.svelte create mode 100644 calliope-web/src/lib/components/NavRail.svelte create mode 100644 calliope-web/src/lib/components/OmniComposer.svelte create mode 100644 calliope-web/src/lib/components/ProjectCard.svelte create mode 100644 calliope-web/src/lib/components/QueueStage.svelte create mode 100644 calliope-web/src/lib/components/SafeMedia.svelte create mode 100644 calliope-web/src/lib/components/ScriptStage.svelte create mode 100644 calliope-web/src/lib/components/StoryStage.svelte create mode 100644 calliope-web/src/lib/components/ToastHost.svelte create mode 100644 calliope-web/src/lib/components/omni/MediaTile.svelte create mode 100644 calliope-web/src/lib/components/omni/PillPopover.svelte create mode 100644 calliope-web/src/lib/components/omni/PillSelect.svelte create mode 100644 calliope-web/src/lib/components/omni/PillStepper.svelte create mode 100644 calliope-web/src/lib/components/settings/SettingsNav.svelte create mode 100644 calliope-web/src/lib/components/settings/WorkflowsLibrary.svelte create mode 100644 calliope-web/src/lib/components/ui/Button.svelte create mode 100644 calliope-web/src/lib/components/ui/Card.svelte create mode 100644 calliope-web/src/lib/components/ui/ConfirmDialog.svelte create mode 100644 calliope-web/src/lib/components/ui/EmptyState.svelte create mode 100644 calliope-web/src/lib/components/ui/Icon.svelte create mode 100644 calliope-web/src/lib/components/ui/Modal.svelte create mode 100644 calliope-web/src/lib/components/ui/ProgressBar.svelte create mode 100644 calliope-web/src/lib/components/ui/README.md create mode 100644 calliope-web/src/lib/components/ui/Skeleton.svelte create mode 100644 calliope-web/src/lib/components/ui/Spinner.svelte create mode 100644 calliope-web/src/lib/components/ui/StatusChip.svelte create mode 100644 calliope-web/src/lib/components/ui/icons.ts create mode 100644 calliope-web/src/lib/components/video/ClipMonitor.svelte create mode 100644 calliope-web/src/lib/components/video/SceneFilmstrip.svelte create mode 100644 calliope-web/src/lib/components/video/SceneScriptDrawer.svelte create mode 100644 calliope-web/src/lib/components/video/VideoEditWorkspace.svelte create mode 100644 calliope-web/src/lib/durationBudget.ts create mode 100644 calliope-web/src/lib/events.ts create mode 100644 calliope-web/src/lib/jobProgress.ts create mode 100644 calliope-web/src/lib/promptTemplates.ts create mode 100644 calliope-web/src/lib/toast.ts create mode 100644 calliope-web/src/routes/+layout.svelte create mode 100644 calliope-web/src/routes/+layout.ts create mode 100644 calliope-web/src/routes/+page.svelte create mode 100644 calliope-web/src/routes/+page.ts create mode 100644 calliope-web/src/routes/app.css create mode 100644 calliope-web/src/routes/favicon.png/+server.ts create mode 100644 calliope-web/src/routes/playground/+page.svelte create mode 100644 calliope-web/src/routes/playground/+page.ts create mode 100644 calliope-web/src/routes/project/[id]/+page.svelte create mode 100644 calliope-web/src/routes/project/[id]/+page.ts create mode 100644 calliope-web/src/routes/settings/+page.svelte create mode 100644 calliope-web/src/routes/settings/+page.ts create mode 100644 calliope-web/svelte.config.js create mode 100644 calliope-web/tailwind.config.js create mode 100644 calliope-web/tsconfig.json create mode 100644 calliope-web/vite.config.ts delete mode 100644 electron/README.md delete mode 100644 electron/main.js delete mode 100644 electron/package-lock.json delete mode 100644 electron/package.json create mode 100644 example_ComfyUI_workflows/Krea2_t2i_20260818_API.json create mode 100644 example_ComfyUI_workflows/krea2_T2I_CharSheetV1_API.json create mode 100644 example_ComfyUI_workflows/video_minimax_h3_r2v_2ref_API.json create mode 100644 example_ComfyUI_workflows/video_minimax_h3_r2v_3ref_API.json create mode 100644 example_ComfyUI_workflows/video_minimax_h3_r2v_4ref_API.json create mode 100644 example_ComfyUI_workflows/video_minimax_h3_r2v_5ref_API.json create mode 100644 example_ComfyUI_workflows/video_minimax_h3_r2v_API.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..c7194b84 --- /dev/null +++ b/.gitignore @@ -0,0 +1,45 @@ +# --- Secrets & user data (NEVER commit) --- +calliope-backend/calliope_config.json +calliope-backend/data/ +backups/ +*.db +*.db-wal +*.db-shm +.env +.env.* + +# --- Python --- +.venv/ +__pycache__/ +*.py[cod] +.pytest_cache/ +.ruff_cache/ +calliope-backend/build/ +calliope-backend/dist/ +*.egg-info/ + +# --- Node / Svelte --- +node_modules/ +calliope-web/build/ +calliope-web/.svelte-kit/ +electron/dist/ +electron/builder-debug.yml + +# --- Build artifacts (generated, not source) --- +calliope-backend/src/calliope/static/ +*.zip + +# --- Tooling / QA --- +.playwright-mcp/ +.cursor/ +*.log + +# --- Local-only files (not part of the public repo) --- +electron/ +AGENTS.md +start.bat +end.bat +ScreenShots/ +docs/ +prototype/ +2026-*.md diff --git a/README.md b/README.md index 76b3583c..acb03e16 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ Calliope is a local-first story-to-video studio. You type a story idea; Calliope drafts a storyline with beats, characters, and locations, writes a per-scene script, then generates a video clip per scene by driving your own ComfyUI install. When the clips are done, one click stitches them into a finished film with crossfades and matched loudness (ffmpeg). Everything runs on your machine: projects live in SQLite, media lives in folders, and no cloud service is involved beyond the LLM endpoint you point it at. -## Download & run (Windows) +## Install — Windows EXE (recommended) -1. Grab **`Calliope-win-x64.zip`** from the [latest release](../../releases). +1. Download **`Calliope--win-x64.zip`** (e.g. `Calliope-1.1.0-win-x64.zip`) from the [latest release](../../releases). 2. Unzip it anywhere writable (avoid `Program Files`). 3. Run `win-unpacked\Calliope.exe`. -No installer, no dev setup. First launch shows a splash while the backend boots. Windows SmartScreen will warn on first run (unsigned binary) — that's expected. +No installer, no dev setup. First launch shows a splash while the backend boots. Windows SmartScreen will warn on first run (unsigned binary) — that's expected: click **More info → Run anyway**. **Portable:** your projects, database, generated media, and settings live next to the app: @@ -19,21 +19,38 @@ No installer, no dev setup. First launch shows a splash while the backend boots. Move or copy the whole unzipped folder to relocate the app together with its data. -Screenshot 2026-07-28 045615 +## Install — from source (npm + Python) -Screenshot 2026-07-28 052215 +For development, or if you prefer running the web UI in a browser instead of the Electron shell. -Screenshot 2026-07-28 052242 +**Prerequisites** -Screenshot 2026-07-28 052349 +- Python 3.11+ +- Node.js 18+ (npm) +- A running ComfyUI install, with the models your workflows need already set up +- An OpenAI-compatible LLM endpoint — local (LM Studio, Ollama, etc.) or hosted +- ffmpeg on PATH — needed for film export +**1. Backend (FastAPI)** -## Requirements +```bash +cd calliope-backend +python -m venv .venv +.venv\Scripts\pip install -e ".[dev]" +.venv\Scripts\python -m calliope.main --host 127.0.0.1 --port 8247 +``` -- **Windows 10/11** -- **A running ComfyUI install**, with the models your workflows need already set up -- **An OpenAI-compatible LLM endpoint** — local (LM Studio, Ollama, etc.) or hosted -- **ffmpeg on PATH** — needed for film export +Optionally copy `calliope_config.example.json` to `calliope_config.json` and edit it before starting (LLM endpoint, ComfyUI URL). You can also configure everything later in the app's **Settings** page. Never commit `calliope_config.json` — it stores your API key. + +**2. Frontend (SvelteKit)** + +```bash +cd calliope-web +npm install +npm run dev +``` + +Open `http://127.0.0.1:5173`. The dev server proxies `/api` to the backend on `127.0.0.1:8247`. ## First run @@ -59,7 +76,7 @@ The app walks a project through four stages — **Story, Assets, Script, Video** ## ComfyUI workflows (important) -Calliope does **not** hardcode Comfy node IDs. It discovers editable nodes from **role tags** in the node titles of an **API Format** workflow JSON. The `ComfyAPI/` folder in this repo contains ready-to-import example workflows (LTX-2.3 ref2vid, krea2 t2i). +Calliope does **not** hardcode Comfy node IDs. It discovers editable nodes from **role tags** in the node titles of an **API Format** workflow JSON. The `example_ComfyUI_workflows/` folder in this repo contains ready-to-import examples (MiniMax H3 reference-to-video, krea2 text-to-image, character sheet). ### 1. Tag your nodes in ComfyUI @@ -95,8 +112,9 @@ Input roles: | `height` | `h` | Shared form / defaults | | `character` | `char`, `portrait`, `sheet`, `face`, `ref` | Character reference path | | `location` | `loc`, `environment`, `env`, `background`, `scene` | Location reference path | -| `image` | `img` | Generic image input | +| `image` | `img` | Generic image input (ordered ref slot — see below) | | `seed` | — | Shared form | +| `duration` | `dur`, `length`, `seconds` | Scene duration (video jobs) | Output roles: @@ -107,6 +125,18 @@ Output roles: Unknown roles still show up in the dynamic form; they just get no special auto-fill. Plain `(Input)` / `(Output)` without a role still works through a deprecated label fallback, so old workflows keep working — but tag new workflows with explicit roles. +#### Prompt profiles + +Each workflow has a **Prompt format** setting (default *Plain prose*). When set to *MiniMax H3 reference (6-section)*, Calliope rewrites each scene prompt at generation time into MiniMax H3's full-reference format (`subject_definitions` → `summary` → `retention_analysis` → `detailed_description` → `overall_soundscape` → `non_diegetic_music`, with `` labels and `[Language] …` dialogue). It is auto-suggested on import when the workflow contains a `MiniMaxH3*` node. + +For multi-reference workflows, generic `(Input:image)` inputs are filled in **node-id order** — characters in scene order, then the location — and that order defines the `` numbering in the prompt. Keep your ref node ids in the order you want subjects numbered. A `(Input:duration)` node receives the scene's duration in seconds. + +**Using the H3 profile from the scene form (Generate clip):** the form's auto-fill vs. override rule is simple — anything you type or pick wins over the automatic value. + +- **Text Prompt — leave it empty.** An empty field gets the LLM-rewritten six-section H3 prompt built from the scene's action, dialogue, characters, and location. If you type anything, your text is sent verbatim and the model receives plain prose instead of the H3 format. +- **Ref 1 / Ref 2 — leave them on "Choose asset…"** to auto-fill from the scene's characters (in scene order) then the location, with `` numbering matched to those slots. Picking an asset manually overrides just that slot (and you take over subject numbering for it). +- **Duration** auto-fills from the scene's estimated duration; edit it only when you want a different clip length. + ### 3. Export the workflow In ComfyUI, use **Save (API Format)** — not the regular UI workflow graph format. Calliope only understands API Format JSON. @@ -128,6 +158,16 @@ If ComfyUI "doesn't know what to generate" or jobs come back empty: Calliope talks to ComfyUI purely over its HTTP API: it uploads reference files with `POST /upload/image`, patches the workflow JSON and queues it via `POST /prompt`, polls `/history/{prompt_id}`, and downloads the results. It **never reads or writes ComfyUI's local `input/` / `output/` folders** — any folder paths stay configured on the ComfyUI side, not in Calliope. -## Source code +## License -The app source (FastAPI backend, SvelteKit frontend) is not published yet — this repo currently ships the packaged app (via Releases), the Electron shell (`electron/`), and example ComfyUI workflows (`ComfyAPI/`). +All rights reserved — © 2026 Calliope contributors. + +## Repo layout + +```text +calliope-backend/ FastAPI backend (Python) +calliope-web/ SvelteKit frontend +example_ComfyUI_workflows/ ready-to-import API-format workflow JSONs +``` + +The Windows desktop app is built from this repo but not shipped in it — download it from the [Releases](../../releases) page. diff --git a/calliope-backend/calliope.spec b/calliope-backend/calliope.spec new file mode 100644 index 00000000..439f408b --- /dev/null +++ b/calliope-backend/calliope.spec @@ -0,0 +1,74 @@ +# -*- mode: python ; coding: utf-8 -*- +# PyInstaller spec for the Calliope FastAPI backend (one-folder mode). +# +# Build (from calliope-backend/): +# ./.venv/Scripts/python.exe -m PyInstaller calliope.spec --noconfirm +# +# Output: +# dist/calliope-backend/calliope-backend.exe (+ _internal/ next to it) +# +# Storage note: when frozen, config.py anchors calliope_config.json and data/ +# NEXT TO the exe (portable app), so keep this folder user-writable. + +import os + +from PyInstaller.utils.hooks import collect_submodules + +# SPECPATH is the directory containing this spec file (calliope-backend/). +BACKEND_DIR = os.path.abspath(SPECPATH) + +# Fresh SvelteKit adapter-static build. Bundled as calliope/static so the frozen +# exe serves the SPA at its own origin (main.py mounts /static at /). +WEB_BUILD = os.path.abspath(os.path.join(BACKEND_DIR, "..", "calliope-web", "build")) + +# main.py imports uvicorn dynamically via __import__("uvicorn"), which static +# analysis cannot see — collect all uvicorn submodules (lifespan/loops/protocols) +# plus its optional speedups and other lazily-imported packages explicitly. +hidden = collect_submodules("uvicorn") +hidden += ["httptools", "websockets", "multipart", "dotenv"] + + +a = Analysis( + # launcher.py imports calliope.main as a package module — see its docstring + # for why the entry must NOT be src/calliope/main.py itself. + [os.path.join(BACKEND_DIR, "launcher.py")], + pathex=[BACKEND_DIR, os.path.join(BACKEND_DIR, "src")], + binaries=[], + datas=[(WEB_BUILD, "calliope/static")], + hiddenimports=hidden, + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=["pytest", "pytest_asyncio", "ruff"], + noarchive=False, +) +pyz = PYZ(a.pure, a.zipped_data) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name="calliope-backend", + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=False, # faster builds, fewer antivirus false-positives + # Console stays ON so a user can run calliope-backend.exe from a terminal and + # read uvicorn/ComfyUI error logs when debugging. The Electron shell always + # spawns it with windowsHide=True, so no console window appears in normal use. + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, +) +coll = COLLECT( + exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=False, + upx_exclude=[], + name="calliope-backend", +) diff --git a/calliope-backend/calliope_config.example.json b/calliope-backend/calliope_config.example.json new file mode 100644 index 00000000..232ebfd6 --- /dev/null +++ b/calliope-backend/calliope_config.example.json @@ -0,0 +1,15 @@ +{ + "host": "127.0.0.1", + "port": 8247, + "data_dir": "./data", + "assets_dir": "./data/assets", + "db_name": "calliope.db", + "llm_base_url": "http://127.0.0.1:11434/v1", + "llm_model": "Qwen3.8-27B", + "llm_api_key": "", + "comfyui_base_url": "http://127.0.0.1:8188", + "queue_concurrency": 1, + "queue_poll_interval_sec": 2.0, + "queue_max_retries": 4, + "dry_run": false +} diff --git a/calliope-backend/launcher.py b/calliope-backend/launcher.py new file mode 100644 index 00000000..562da272 --- /dev/null +++ b/calliope-backend/launcher.py @@ -0,0 +1,21 @@ +"""PyInstaller entry point for the Calliope backend. + +Why this exists: using src/calliope/main.py directly as the frozen entry script +makes PyInstaller bundle it as a TOP-LEVEL module named "main", so its __file__ +becomes <_MEIPASS>/main.pyc and main.py's __file__-relative lookup of the +bundled SPA (/static) breaks. Importing calliope.main as a package +module here keeps its __file__ at <_MEIPASS>/calliope/main.pyc, so +Path(__file__).parent / "static" resolves to the bundled calliope/static. + +Dev flow is unaffected (python -m calliope.main still works); this file is only +used by calliope.spec. +""" + +from __future__ import annotations + +import sys + +from calliope.main import main + +if __name__ == "__main__": + sys.exit(main()) diff --git a/calliope-backend/pyproject.toml b/calliope-backend/pyproject.toml new file mode 100644 index 00000000..c6fb7c7f --- /dev/null +++ b/calliope-backend/pyproject.toml @@ -0,0 +1,34 @@ +[project] +name = "calliope" +version = "1.1.0" +description = "Local-first AI story-to-video studio" +requires-python = ">=3.11" +dependencies = [ + "fastapi>=0.115.0", + "uvicorn[standard]>=0.32.0", + "aiosqlite>=0.20.0", + "pydantic>=2.9.0", + "pydantic-settings>=2.6.0", + "httpx>=0.27.0", + "python-multipart>=0.0.12", +] + +[project.optional-dependencies] +dev = ["pytest>=8.3.0", "pytest-asyncio>=0.24.0", "ruff>=0.8.0"] + +[project.scripts] +calliope = "calliope.main:main" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.ruff] +line-length = 100 +src = ["src"] + +[tool.ruff.lint] +select = ["E", "F", "I", "N", "W"] + +[tool.pytest.ini_options] +asyncio_mode = "auto" diff --git a/calliope-backend/requirements.txt b/calliope-backend/requirements.txt new file mode 100644 index 00000000..810b51c9 --- /dev/null +++ b/calliope-backend/requirements.txt @@ -0,0 +1,13 @@ +# Calliope Backend — runtime dependencies +fastapi>=0.115.0 +uvicorn[standard]>=0.32.0 +aiosqlite>=0.20.0 +pydantic>=2.9.0 +pydantic-settings>=2.6.0 +httpx>=0.27.0 +python-multipart>=0.0.12 + +# Dev dependencies +pytest>=8.3.0 +pytest-asyncio>=0.24.0 +ruff>=0.8.0 diff --git a/calliope-backend/src/calliope/__init__.py b/calliope-backend/src/calliope/__init__.py new file mode 100644 index 00000000..0cabc7f9 --- /dev/null +++ b/calliope-backend/src/calliope/__init__.py @@ -0,0 +1 @@ +# Calliope backend package diff --git a/calliope-backend/src/calliope/agent/__init__.py b/calliope-backend/src/calliope/agent/__init__.py new file mode 100644 index 00000000..c6a9aa26 --- /dev/null +++ b/calliope-backend/src/calliope/agent/__init__.py @@ -0,0 +1 @@ +# Agentic layer for Calliope diff --git a/calliope-backend/src/calliope/agent/asset_agent.py b/calliope-backend/src/calliope/agent/asset_agent.py new file mode 100644 index 00000000..1b518889 --- /dev/null +++ b/calliope-backend/src/calliope/agent/asset_agent.py @@ -0,0 +1,173 @@ +"""Enqueue character/location image generation jobs.""" +from __future__ import annotations + +import json +from typing import Any + +from calliope.agent.prompts import character_image_prompt, location_image_prompt +from calliope.comfyui.parser import parse_dynamic_inputs +from calliope.comfyui.smart_fill import smart_fill_inputs +from calliope.config import settings +from calliope.db import get_db, row_to_dict +from calliope.events.bus import event_bus +from calliope.queue.manager import queue_manager + + +def _has_text_inputs(inputs: list[dict[str, Any]]) -> bool: + return any(inp.get("kind") in ("text", "textarea") for inp in inputs) + + +def _sanitize_input_overrides(extra: dict[str, Any] | None) -> dict[str, Any] | None: + """Drop null/blank overrides so empty shared Text Prompt cannot wipe the entity prompt.""" + if not extra: + return None + cleaned: dict[str, Any] = {} + for k, v in extra.items(): + if v is None: + continue + if isinstance(v, str) and not v.strip(): + continue + cleaned[str(k)] = v + return cleaned or None + + +def _get_enabled_workflow(kind: str = "image", workflow_id: int | None = None) -> dict[str, Any] | None: + conn = get_db(settings.db_path) + try: + if workflow_id: + row = conn.execute( + "SELECT * FROM workflows WHERE id = ? AND is_enabled = 1", (workflow_id,) + ).fetchone() + else: + row = conn.execute( + "SELECT * FROM workflows WHERE kind = ? AND is_enabled = 1 ORDER BY id ASC LIMIT 1", + (kind,), + ).fetchone() + return row_to_dict(row) if row else None + finally: + conn.close() + + +async def enqueue_asset_jobs( + project_id: int, + *, + character_ids: list[int] | None = None, + location_ids: list[int] | None = None, + missing_only: bool = True, + workflow_id: int | None = None, + input_values_override: dict[str, Any] | None = None, + asset_target: str = "sheet", + prompt_override: str | None = None, +) -> list[dict[str, Any]]: + await event_bus.publish( + "agent.thinking", + {"message": "Preparing asset generation from saved image prompts…", "project_id": project_id}, + ) + workflow = _get_enabled_workflow("image", workflow_id) + workflow_json = json.loads(workflow["workflow_json"]) if workflow else {} + inputs = parse_dynamic_inputs(workflow_json) if workflow_json else [] + target = asset_target if asset_target in {"sheet", "portrait"} else "sheet" + input_values_override = _sanitize_input_overrides(input_values_override) + has_override = bool(input_values_override) + allow_empty_prompt = has_override or not _has_text_inputs(inputs) + + conn = get_db(settings.db_path) + jobs: list[dict[str, Any]] = [] + skipped: list[str] = [] + try: + chars = conn.execute( + "SELECT * FROM characters WHERE project_id = ?", (project_id,) + ).fetchall() + locs = conn.execute( + "SELECT * FROM locations WHERE project_id = ?", (project_id,) + ).fetchall() + + for row in chars: + c = row_to_dict(row) + if character_ids is not None and c["id"] not in character_ids: + continue + existing = c.get("sheet_path") if target == "sheet" else c.get("portrait_path") + if missing_only and existing: + continue + prompt = (prompt_override or "").strip() or character_image_prompt(c, kind=target) + if not prompt.strip() and not allow_empty_prompt: + skipped.append(c.get("name") or str(c["id"])) + continue + values = smart_fill_inputs( + inputs, + prompt=prompt or None, + extra=input_values_override, + ) + job = queue_manager.enqueue( + project_id=project_id, + kind="image", + workflow_id=workflow["id"] if workflow else None, + payload={ + "input_values": values, + "character_id": c["id"], + "asset_target": target, + "prompt": prompt, + }, + ) + jobs.append(job) + await event_bus.publish( + "job.created", + { + "job_id": job["id"], + "kind": "image", + "message": f"{c.get('name')} · {target}", + }, + ) + + # Only enqueue locations when not doing a character-only generate + enqueue_locs = location_ids is not None or character_ids is None + if enqueue_locs: + for row in locs: + loc = row_to_dict(row) + if location_ids is not None and loc["id"] not in location_ids: + continue + if character_ids is not None and location_ids is None: + # Character-scoped call — skip locations + continue + if missing_only and loc.get("reference_image_path"): + continue + prompt = (prompt_override or "").strip() or location_image_prompt(loc) + if not prompt.strip() and not allow_empty_prompt: + skipped.append(loc.get("name") or str(loc["id"])) + continue + values = smart_fill_inputs( + inputs, + prompt=prompt or None, + extra=input_values_override, + ) + job = queue_manager.enqueue( + project_id=project_id, + kind="image", + workflow_id=workflow["id"] if workflow else None, + payload={ + "input_values": values, + "location_id": loc["id"], + "prompt": prompt, + }, + ) + jobs.append(job) + await event_bus.publish( + "job.created", + { + "job_id": job["id"], + "kind": "image", + "message": f"{loc.get('name')} · environment", + }, + ) + finally: + conn.close() + + if skipped: + await event_bus.publish( + "agent.thinking", + { + "project_id": project_id, + "message": f"Skipped (empty image prompt): {', '.join(skipped)}", + }, + ) + return jobs diff --git a/calliope-backend/src/calliope/agent/llm.py b/calliope-backend/src/calliope/agent/llm.py new file mode 100644 index 00000000..1e62611b --- /dev/null +++ b/calliope-backend/src/calliope/agent/llm.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +import json +import logging +from typing import Any + +import httpx + +from calliope.config import settings + +logger = logging.getLogger("calliope.llm") + + +class LLMClient: + def __init__(self) -> None: + self.base_url = settings.llm_base_url.rstrip("/") + self.model = settings.llm_model + self.api_key = settings.llm_api_key + self.client = httpx.AsyncClient(timeout=120.0) + + def _headers(self) -> dict[str, str]: + headers = {"Content-Type": "application/json"} + if self.api_key: + headers["Authorization"] = f"Bearer {self.api_key}" + return headers + + async def chat(self, messages: list[dict[str, str]], temperature: float = 0.7, response_format: dict[str, str] | None = None) -> str: + payload: dict[str, Any] = { + "model": self.model, + "messages": messages, + "temperature": temperature, + } + if response_format: + payload["response_format"] = response_format + + url = f"{self.base_url}/chat/completions" + logger.info("LLM request to %s with model %s", url, self.model) + resp = await self.client.post(url, headers=self._headers(), json=payload) + resp.raise_for_status() + data = resp.json() + content = data["choices"][0]["message"]["content"] + return content.strip() + + async def close(self) -> None: + await self.client.aclose() + + +def extract_json(text: str) -> dict[str, Any]: + """Extract JSON object from a markdown code block or raw text.""" + text = text.strip() + if text.startswith("```"): + # Strip fenced code block + lines = text.splitlines() + if lines[0].startswith("```"): + lines = lines[1:] + if lines and lines[-1].startswith("```"): + lines = lines[:-1] + text = "\n".join(lines).strip() + return json.loads(text) + + +async def generate_structured(messages: list[dict[str, str]], temperature: float = 0.7) -> dict[str, Any]: + client = LLMClient() + try: + response_format = {"type": "json_object"} + text = await client.chat(messages, temperature=temperature, response_format=response_format) + return extract_json(text) + finally: + await client.close() diff --git a/calliope-backend/src/calliope/agent/prompts.py b/calliope-backend/src/calliope/agent/prompts.py new file mode 100644 index 00000000..f96fd5ee --- /dev/null +++ b/calliope-backend/src/calliope/agent/prompts.py @@ -0,0 +1,489 @@ +"""Prompts for Calliope story / script / asset generation.""" +from __future__ import annotations + +import re +from typing import Any + + +STORY_GENERATION_SYSTEM = ( + "You are a story development assistant for an AI video studio. " + "You output ONLY a single valid JSON object. " + "HARD RULE: the beats array length must equal required_beat_count from the user message. " + "Returning fewer beats is a failure. Longer target runtimes require many fine-grained beats." +) + +SCRIPT_GENERATION_SYSTEM = ( + "You are a screenwriter for short-form AI video. " + "Write a scene-by-scene script that uses the provided characters and locations. " + "Each scene's action is fed directly into a video generation model, so it must be a " + "rich, multi-sentence cinematic description — never a single short sentence. " + "Always respond with a single valid JSON object. " + "HARD RULE: the scenes array length must equal required_scene_count from the user message. " + "Returning fewer scenes is a failure. Respect the user's chosen scene count." +) + + +def estimate_target_seconds(target_duration: str | None) -> int: + """Best-effort parse of free-text duration into seconds.""" + text = (target_duration or "").strip().lower() + if not text: + return 30 + + # Explicit "N scenes" -> ~8s each as a coarse floor for beat planning + scenes_m = re.search(r"(\d+)\s*scenes?", text) + if scenes_m and "min" not in text and "sec" not in text: + return max(30, int(scenes_m.group(1)) * 8) + + minutes = 0.0 + seconds = 0.0 + for m in re.finditer(r"(\d+(?:\.\d+)?)\s*(min|mins|minutes?|m)\b", text): + minutes += float(m.group(1)) + for m in re.finditer(r"(\d+(?:\.\d+)?)\s*(sec|secs|seconds?|s)\b", text): + seconds += float(m.group(1)) + + if minutes or seconds: + return max(15, int(minutes * 60 + seconds)) + + bare = re.search(r"\b(\d+(?:\.\d+)?)\b", text) + if bare: + n = float(bare.group(1)) + if "medium" in text or n >= 2: + if n <= 30: + return int(n * 60) + if n <= 180: + return int(n) + + if "medium" in text: + return 120 + if "short" in text or "brief" in text: + return 30 + if "long" in text or "feature" in text: + return 180 + return 60 + + +def recommend_beat_count(target_duration: str | None) -> int: + """ + Story beats for the AI video pipeline (~12s of narrative weight each). + 30s -> 4, 2 min -> 10, 5 min -> 25, 10 min -> 50 (capped at 60). + """ + secs = estimate_target_seconds(target_duration) + return max(4, min(60, round(secs / 12))) + + +def recommend_scene_count(target_duration: str | None) -> int: + """Video scenes (~7s each) for the target runtime.""" + secs = estimate_target_seconds(target_duration) + return max(4, min(90, round(secs / 7))) + + +def story_generation_user_prompt( + title: str | None, + idea: str | None, + genre: str | None, + tone: str | None, + target_duration: str | None, +) -> str: + secs = estimate_target_seconds(target_duration) + beat_n = recommend_beat_count(target_duration) + return f"""Create a story brief for an AI-generated video. + +required_beat_count: {beat_n} +estimated_runtime_seconds: {secs} +target_duration_text: {target_duration or "short (~30 seconds)"} + +Title: {title or "Untitled"} +Idea: {idea or "No idea provided."} +Genre: {genre or "Not specified"} +Tone: {tone or "cinematic, atmospheric"} + +=== HARD CONSTRAINTS (non-negotiable) === +1. The JSON field "beats" MUST contain EXACTLY {beat_n} objects. +2. order_index must run 1, 2, 3, ... {beat_n} with no gaps. +3. Do NOT summarize into a short arc. Do NOT return 5-8 beats for a long runtime. +4. For ~{secs}s (~{secs // 60} min), beats are fine-grained plot steps (~12 seconds of story weight each) so Script can later expand into many short video clips. +5. Cover full arc across all {beat_n} beats: setup, rising complications, midpoint turn, escalation, climax, resolution — spread across the whole list, not compressed into the first few items. +6. If you are unsure, add more concrete incident beats rather than fewer abstract ones. + +=== OUTPUT SCHEMA (JSON only) === +{{ + "title": "a compelling story title", + "logline": "one sentence hook", + "beats": [ + {{"order_index": 1, "title": "Beat title", "description": "what happens visually / dramatically"}} + ], + "characters": [ + {{ + "name": "Name", + "role": "protagonist|antagonist|supporting", + "age": "approximate age", + "appearance": "concise visual description for image generation", + "personality": "concise personality traits" + }} + ], + "locations": [ + {{ + "name": "Location name", + "description": "concise visual description for image generation" + }} + ] +}} + +Keep descriptions visual and concrete. Characters and locations should be reusable across scenes. +FINAL CHECK before responding: beats.length == {beat_n}. If not, fix it.""" + + +def build_story_messages( + title: str | None, + idea: str | None, + genre: str | None, + tone: str | None, + target_duration: str | None, +) -> list[dict[str, str]]: + return [ + {"role": "system", "content": STORY_GENERATION_SYSTEM}, + { + "role": "user", + "content": story_generation_user_prompt(title, idea, genre, tone, target_duration), + }, + ] + + +def build_script_messages( + *, + title: str, + idea: str | None, + beats: list[dict[str, Any]], + characters: list[dict[str, Any]], + locations: list[dict[str, Any]], + target_duration: str | None, + scene_count: int | None = None, +) -> list[dict[str, str]]: + secs = estimate_target_seconds(target_duration) + recommended = recommend_scene_count(target_duration) + # Honor an explicit / existing count (e.g. user added empty scenes before regenerate) + scene_n = max(recommended, int(scene_count)) if scene_count and scene_count > 0 else recommended + # Stretch runtime floor when the user asked for more clips than duration alone implies + secs = max(secs, scene_n * 6) + duration_hint = max(4, round(secs / scene_n)) + char_lines = "\n".join( + f"- id={c['id']} {c['name']} ({c.get('role') or ''}): {c.get('appearance') or ''}" + for c in characters + ) + loc_lines = "\n".join( + f"- id={l['id']} {l['name']}: {l.get('description') or ''}" for l in locations + ) + beat_lines = "\n".join( + f"- {b.get('order_index')}. {b.get('title')}: {b.get('description')}" for b in beats + ) + user = f"""Write a scene script for this project. + +Title: {title} +Idea: {idea or ''} +Target duration: {target_duration or 'short (~30-60 seconds)'} +Estimated runtime: ~{secs} seconds +required_scene_count: {scene_n} + +Story beats: +{beat_lines or '(none)'} + +Characters: +{char_lines or '(none)'} + +Locations: +{loc_lines or '(none)'} + +=== HARD CONSTRAINTS (non-negotiable) === +1. The JSON field "scenes" MUST contain EXACTLY {scene_n} objects. +2. order_index must run 1, 2, 3, ... {scene_n} with no gaps. +3. Do NOT collapse back to fewer scenes. The user expanded the script to {scene_n} clips — fill all of them. +4. Sum of duration_sec across all scenes should be approximately {secs} (within ±15%). +5. Prefer short scenes (5–10s) — this is for AI video clips. Spread the beat arc across all {scene_n} scenes. + +=== ACTION DETAIL (this text IS the video prompt — users copy it straight into the generator) === +Each scene's "action" is fed verbatim to an AI video generator. Write 4–6 vivid present-tense +sentences (~80–130 words) per scene as ONE flowing natural-English paragraph — no bullet points, +no labeled fragments (do NOT write "Shot:", "Lighting:", etc.), no line breaks. Rules: +1. ONE SHOT PER SCENE. A clip is only {duration_hint} seconds — describe a single continuous + camera setup with at most one simple action beat (one entrance, one gesture, one reveal). + If a beat needs more room, split it across multiple scenes instead of compressing it. +2. SHOT & MOTION. Name the framing and camera move (wide establishing, slow push-in, handheld + tracking, low angle, rack focus) AND what visibly moves in frame — video models need motion: + gestures, turning heads, hair and fabric, drifting dust, sweeping flashlight beams, an + expression shifting. A static description produces a static clip. +3. CHARACTER ANCHORS. The first time each character appears in a scene, attach a 3–8 word + visual anchor taken from their description above (hair, outfit, one distinguishing + feature), e.g. "MIA, a teenage girl with a chestnut ponytail and yellow rain jacket,". + Later mentions in the same scene use the plain name. Never invent new appearance details — + reuse these anchors so every clip matches the same face and wardrobe. +4. ENVIRONMENT & CONTINUITY. Concrete set details, props, weather, time-of-day — consistent + with the location description and with earlier scenes set in the same location. +5. LIGHTING & MOOD. Named light sources, color palette, emotional tone of the moment. +Describe only what is VISIBLE (no inner thoughts; no sounds or music — dialogue covers audio). +Vary shot types across scenes — do not write {scene_n} identical wide shots. + +=== DIALOGUE === +Keep lines short and natural. When delivery matters for performance, add a brief cue in +parentheses after the speaker name, e.g. "MIA (whispering): line" or "LIAM (hushed, excited): line". + +Respond ONLY with JSON: +{{ + "scenes": [ + {{ + "order_index": 1, + "heading": "INT. LOCATION - TIME", + "action": "Wide establishing shot, slow push-in through the cracked main doorway. MIA, a teenage girl with a chestnut ponytail and yellow rain jacket, steps into the dusty main hall, lantern held high, its warm glow catching drifting dust motes around her cautious, widening eyes. She freezes mid-step, fingers tightening on the lantern handle as she looks up. Overturned desks and a collapsed chalkboard fill the frame; moonlight cuts through shattered windows in pale blue shafts. The mood is hushed and uneasy, shadows pooling at the edges of the lantern light.", + "dialog": "MIA (whispering): line\\nNARRATOR: line", + "duration_sec": 5, + "character_ids": [1], + "location_id": 1 + }} + ] +}} + +Use only the provided character_ids and location_ids. +FINAL CHECK before responding: scenes.length == {scene_n}, and every action is a flowing prose +paragraph of 4–6 sentences (~80–130 words) covering ONE shot, with a character anchor at each +character's first mention (no bullets, no labels, no invented appearances). If not, fix it.""" + return [ + {"role": "system", "content": SCRIPT_GENERATION_SYSTEM}, + {"role": "user", "content": user}, + ] + + +def character_sheet_prompt(character: dict[str, Any]) -> str: + """Transparent character-sheet template — what ComfyUI receives for turnarounds.""" + name = (character.get("name") or "Unnamed").strip() + role = (character.get("role") or "character").strip() + age = (character.get("age") or "unspecified age").strip() + appearance = (character.get("appearance") or "no appearance notes yet").strip() + personality = (character.get("personality") or "").strip() + personality_line = f"Personality cues (visual only): {personality}\n" if personality else "" + return ( + f"CHARACTER SHEET — {name}\n" + f"Role: {role}. Age: {age}.\n" + f"Appearance: {appearance}\n" + f"{personality_line}" + f"\n" + f"Layout: single cinematic character reference sheet on a clean neutral backdrop, " + f"multiple panels — front full body, side full body, back full body, three-quarter, " + f"and a head close-up. Same face, hair, body proportions, and outfit in every panel. " + f"Neutral standing pose, even studio lighting, high detail, no text watermarks, " + f"no extra characters." + ) + + +def character_portrait_prompt(character: dict[str, Any]) -> str: + """Transparent portrait template — face/upper-body lock for consistency.""" + name = (character.get("name") or "Unnamed").strip() + role = (character.get("role") or "character").strip() + age = (character.get("age") or "unspecified age").strip() + appearance = (character.get("appearance") or "no appearance notes yet").strip() + return ( + f"CHARACTER PORTRAIT — {name}\n" + f"Role: {role}. Age: {age}.\n" + f"Appearance: {appearance}\n" + f"\n" + f"Shot: cinematic head-and-shoulders portrait, eye-level, soft key light, " + f"shallow depth of field, sharp facial features, consistent wardrobe collar/shoulders, " + f"plain muted background, photoreal or high-end concept art, no text." + ) + + +def location_reference_prompt(location: dict[str, Any]) -> str: + """Transparent environment reference template.""" + name = (location.get("name") or "Unnamed place").strip() + description = (location.get("description") or "no description yet").strip() + return ( + f"ENVIRONMENT REFERENCE — {name}\n" + f"Description: {description}\n" + f"\n" + f"Shot: wide establishing concept art, cinematic atmosphere, clear readable space " + f"for characters to stand in, consistent lighting and materials, no people, no text." + ) + + +def character_image_prompt(character: dict[str, Any], *, kind: str = "sheet") -> str: + """ + Prefer the user-edited consistency_prompt when present. + Otherwise fill the published template (never invent a hidden LLM prompt). + """ + saved = (character.get("consistency_prompt") or "").strip() + if saved: + return saved + if kind == "portrait": + return character_portrait_prompt(character) + return character_sheet_prompt(character) + + +def location_image_prompt(location: dict[str, Any]) -> str: + saved = (location.get("consistency_prompt") or "").strip() + if saved: + return saved + return location_reference_prompt(location) + + +def scene_video_prompt(scene: dict[str, Any], characters: list[dict[str, Any]]) -> str: + char_bits = ", ".join( + f"{c.get('name')}: {c.get('consistency_prompt') or c.get('appearance') or ''}" + for c in characters + ) + parts = [ + scene.get("heading") or "", + scene.get("action") or "", + f"featuring {char_bits}" if char_bits else "", + "cinematic motion, coherent continuity", + ] + return ". ".join(p for p in parts if p) + + +# --------------------------------------------------------------------------- +# MiniMax H3 full-reference (ref2video) prompt profile +# --------------------------------------------------------------------------- +# Condensed from MiniMax's VIDEO_PROMPT_WRITING_GUIDE_ref_en.md, adapted to +# Calliope's single-scene clips: each subject's reference image is wired into +# the workflow's generic (Input:image) slots in node-id order, and that order +# defines the / numbering below. + +MINIMAX_H3_REF_SYSTEM = ( + "You rewrite scene descriptions into MiniMax H3's full-reference video prompt format. " + "Output ONLY the rewritten prompt as plain text — no markdown fences, no commentary. " + "The output must contain exactly these six sections in this order, each starting with " + "its header on its own line:\n" + "subject_definitions:\n" + "summary:\n" + "retention_analysis:\n" + "detailed_description:\n" + "overall_soundscape:\n" + "non_diegetic_music:\n" + "\n" + "Rules:\n" + "1. subject_definitions: one line per referenced subject supplied in the user message, " + "keeping its exact index. Form: ' is the in " + ", with .' is the reference " + "image wired to slot N — cite it inside the subject line, never as a standalone entry.\n" + "2. summary: one short English paragraph starting with '[reference generation]' that " + "states what happens using the labels.\n" + "3. retention_analysis: one line per subject: ' (appears in [Shot 1]…): " + "fully_preserved - .'\n" + "4. detailed_description: the main body, 120–300 words. Open with one or two style " + "sentences (lighting, palette, medium) BEFORE '[Shot 1]'. '[Shot 1]' has no timestamp; " + "later cuts use '[Shot N] At MM:SS.mmm, …'. For clips under ~8 seconds prefer a single " + "shot. Introduce each at its first visible appearance with its referenced " + "features, position, and action; reuse the label afterwards. Describe only what is " + "visible except sound/dialogue.\n" + "5. Dialogue: give each speaker a stable ID in order of first speech — ' (S1) " + "says, [English] …'. A speaker with no defined subject uses a stable voice " + "description, e.g. 'A narrator (S2) says, [English] …'. Keep the original " + "language of every line inside and tag it, e.g. [English], [Chinese].\n" + "6. overall_soundscape: ambience and physical sounds across the clip, or 'N/A'. " + "non_diegetic_music: audience-only score (instrumentation, tempo), or 'N/A'.\n" + "Write everything in English except dialogue/lyrics inside and visible on-screen text." +) + + +def _subject_roster_lines(subjects: list[dict[str, Any]]) -> str: + lines = [] + for s in subjects: + lines.append( + f" = {s['kind']} \"{s.get('name') or 'unnamed'}\" " + f"(reference image slot {s['index']}): {s.get('appearance') or 'no description'}" + ) + return "\n".join(lines) + + +def build_minimax_h3_ref_messages( + scene: dict[str, Any], subjects: list[dict[str, Any]] +) -> list[dict[str, str]]: + """LLM messages that rewrite a scene into H3's six-section ref format. + + subjects: ordered roster — index N corresponds to ref image slot N. + """ + roster = _subject_roster_lines(subjects) or ( + "(no reference images — describe subjects from the action text)" + ) + user = f"""Rewrite this scene into MiniMax H3 full-reference format. + +Scene heading: {scene.get('heading') or '(none)'} +Scene duration: ~{scene.get('duration_sec') or 6} seconds + +Action (visual base for detailed_description): +{scene.get('action') or '(none)'} + +Dialogue (raw 'SPEAKER: line' format; optional '(delivery cue)' after the speaker — +map speakers to subjects by name and keep cues as delivery direction): +{scene.get('dialog') or '(none)'} + +Referenced subjects (keep these exact indices): +{roster} +""" + return [ + {"role": "system", "content": MINIMAX_H3_REF_SYSTEM}, + {"role": "user", "content": user}, + ] + + +def minimax_h3_ref_fallback(scene: dict[str, Any], subjects: list[dict[str, Any]]) -> str: + """Deterministic six-section H3 prompt — used when the LLM rewrite fails.""" + defs = [] + retention = [] + for s in subjects: + name = s.get("name") or "unnamed" + desc = (s.get("appearance") or "").strip() + defs.append( + f" is the {s['kind']} \"{name}\" in " + f"" + (f", {desc}." if desc else ".") + ) + retention.append( + f" (appears in [Shot 1]): fully_preserved - " + f"the referenced appearance of \"{name}\" is retained." + ) + + heading = (scene.get("heading") or "").strip() + action = (scene.get("action") or "").strip() + labels = ", ".join(f"" for s in subjects) + summary = ( + f"[reference generation] {heading or 'A scene'} featuring {labels}." + if labels + else f"[reference generation] {heading or 'A scene'}." + ) + + body = ( + "The target video is in a cinematic style consistent with the reference images, " + "with coherent lighting and natural motion.\n" + f"[Shot 1] {heading} {action}".strip() + ) + + # Map 'SPEAKER: line' rows onto subjects by name; assign speaker IDs in speech order. + # An optional delivery cue — 'MIA (whispering): line' — is kept as performance direction. + dialog_lines = [] + speaker_ids: dict[str, int] = {} + name_to_subject = {(s.get("name") or "").strip().lower(): s["index"] for s in subjects} + for raw in (scene.get("dialog") or "").splitlines(): + if ":" not in raw: + continue + speaker, line = raw.split(":", 1) + speaker, line = speaker.strip(), line.strip() + if not line: + continue + cue_m = re.search(r"\(([^)]*)\)\s*$", speaker) + cue = cue_m.group(1).strip() if cue_m else "" + base = re.sub(r"\s*\([^)]*\)\s*$", "", speaker).strip() or speaker + key = base.lower() + if key not in speaker_ids: + speaker_ids[key] = len(speaker_ids) + 1 + sid = speaker_ids[key] + subj_idx = name_to_subject.get(key) + who = f" (S{sid})" if subj_idx else f"{base.title()} (S{sid})" + dialog_lines.append(f"{who} says{f' {cue}' if cue else ''}, [English] {line}") + if dialog_lines: + body += "\n" + "\n".join(dialog_lines) + + return ( + "subject_definitions:\n" + ("\n".join(defs) if defs else "N/A") + "\n\n" + "summary:\n" + summary + "\n\n" + "retention_analysis:\n" + ("\n".join(retention) if retention else "N/A") + "\n\n" + "detailed_description:\n" + body + "\n\n" + "overall_soundscape:\nN/A\n\n" + "non_diegetic_music:\nN/A" + ) diff --git a/calliope-backend/src/calliope/agent/script_agent.py b/calliope-backend/src/calliope/agent/script_agent.py new file mode 100644 index 00000000..ce5ac031 --- /dev/null +++ b/calliope-backend/src/calliope/agent/script_agent.py @@ -0,0 +1,185 @@ +"""Generate scene scripts via LLM and persist them.""" +from __future__ import annotations + +from typing import Any + +from calliope.agent.llm import generate_structured +from calliope.agent.prompts import build_script_messages, recommend_scene_count +from calliope.config import settings +from calliope.db import get_db, row_to_dict +from calliope.events.bus import event_bus + + +def _persist_scenes( + conn, + project_id: int, + scenes: list[dict[str, Any]], +) -> list[dict[str, Any]]: + created: list[dict[str, Any]] = [] + for scene in scenes: + loc_id = scene.get("location_id") + env_path = None + if loc_id: + loc = conn.execute( + "SELECT reference_image_path FROM locations WHERE id = ? AND project_id = ?", + (loc_id, project_id), + ).fetchone() + if loc: + env_path = loc["reference_image_path"] + + cur = conn.execute( + """ + INSERT INTO scenes + (project_id, order_index, heading, action, dialog, duration_sec, location_id, env_image_path) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + """, + ( + project_id, + scene.get("order_index", 0), + scene.get("heading"), + scene.get("action"), + scene.get("dialog"), + scene.get("duration_sec"), + loc_id, + env_path, + ), + ) + scene_id = cur.lastrowid + for cid in scene.get("character_ids") or []: + exists = conn.execute( + "SELECT id FROM characters WHERE id = ? AND project_id = ?", + (cid, project_id), + ).fetchone() + if exists: + conn.execute( + "INSERT OR IGNORE INTO scene_characters (scene_id, character_id) VALUES (?, ?)", + (scene_id, cid), + ) + row = conn.execute("SELECT * FROM scenes WHERE id = ?", (scene_id,)).fetchone() + created.append(row_to_dict(row)) + return created + + +async def generate_script( + project_id: int, + *, + replace: bool = True, + scene_count: int | None = None, +) -> dict[str, Any]: + await event_bus.publish( + "agent.thinking", {"message": "Writing scene script…", "project_id": project_id} + ) + conn = get_db(settings.db_path) + try: + project = conn.execute("SELECT * FROM projects WHERE id = ?", (project_id,)).fetchone() + if not project: + raise ValueError("Project not found") + p = row_to_dict(project) + beats = [ + row_to_dict(r) + for r in conn.execute( + "SELECT * FROM story_beats WHERE project_id = ? ORDER BY order_index", + (project_id,), + ).fetchall() + ] + characters = [ + row_to_dict(r) + for r in conn.execute( + "SELECT * FROM characters WHERE project_id = ?", (project_id,) + ).fetchall() + ] + locations = [ + row_to_dict(r) + for r in conn.execute( + "SELECT * FROM locations WHERE project_id = ?", (project_id,) + ).fetchall() + ] + + existing_n = conn.execute( + "SELECT COUNT(*) AS n FROM scenes WHERE project_id = ?", + (project_id,), + ).fetchone()["n"] + recommended = recommend_scene_count(p.get("target_duration")) + # Prefer explicit request, else keep at least the board the user already built + requested = scene_count if scene_count and scene_count > 0 else existing_n + required_scenes = max(recommended, int(requested)) if requested else recommended + + await event_bus.publish( + "agent.thinking", + { + "message": f"Writing {required_scenes} scenes " + f"(board had {existing_n}; duration suggests {recommended})…", + "project_id": project_id, + }, + ) + + messages = build_script_messages( + title=p["title"], + idea=p.get("idea"), + beats=beats, + characters=characters, + locations=locations, + target_duration=p.get("target_duration"), + scene_count=required_scenes, + ) + result = await generate_structured(messages, temperature=0.7) + scenes_out = result.get("scenes") or [] + + if len(scenes_out) < required_scenes: + await event_bus.publish( + "agent.thinking", + { + "message": ( + f"Model returned {len(scenes_out)} scenes; " + f"required {required_scenes}. Retrying…" + ), + "project_id": project_id, + }, + ) + retry_messages = [ + messages[0], + { + "role": "user", + "content": messages[1]["content"] + + ( + f"\n\nPREVIOUS ATTEMPT FAILED: it only had {len(scenes_out)} scenes. " + f"You MUST return exactly {required_scenes} scenes this time." + ), + }, + ] + result = await generate_structured(retry_messages, temperature=0.5) + scenes_out = result.get("scenes") or [] + if len(scenes_out) < required_scenes: + raise ValueError( + f"Script returned {len(scenes_out)} scenes but {required_scenes} were required. " + "Add scenes again and retry, or raise target duration." + ) + + if replace: + scene_ids = [ + r["id"] + for r in conn.execute( + "SELECT id FROM scenes WHERE project_id = ?", (project_id,) + ).fetchall() + ] + for sid in scene_ids: + conn.execute("DELETE FROM scene_characters WHERE scene_id = ?", (sid,)) + conn.execute("DELETE FROM scenes WHERE project_id = ?", (project_id,)) + + created = _persist_scenes(conn, project_id, scenes_out) + + conn.execute( + "UPDATE projects SET status = 'in_progress', updated_at = CURRENT_TIMESTAMP WHERE id = ?", + (project_id,), + ) + conn.commit() + await event_bus.publish( + "agent.thinking", + { + "message": f"Script written — {len(created)} scenes", + "project_id": project_id, + }, + ) + return {"ok": True, "scenes": created, "generated": result} + finally: + conn.close() diff --git a/calliope-backend/src/calliope/agent/video_agent.py b/calliope-backend/src/calliope/agent/video_agent.py new file mode 100644 index 00000000..4992dad5 --- /dev/null +++ b/calliope-backend/src/calliope/agent/video_agent.py @@ -0,0 +1,227 @@ +"""Enqueue per-scene video generation jobs.""" +from __future__ import annotations + +import json +import logging +from typing import Any + +from calliope.agent.llm import LLMClient +from calliope.agent.prompts import ( + build_minimax_h3_ref_messages, + minimax_h3_ref_fallback, + scene_video_prompt, +) +from calliope.comfyui.parser import parse_dynamic_inputs +from calliope.comfyui.smart_fill import ref_image_slots, smart_fill_inputs +from calliope.config import settings +from calliope.db import get_db, row_to_dict +from calliope.events.bus import event_bus +from calliope.queue.manager import queue_manager + +logger = logging.getLogger("calliope.video_agent") + + +def _h3_subjects( + characters: list[dict[str, Any]], + location: dict[str, Any] | None, + loc_image: str | None, + inputs: list[dict[str, Any]], +) -> tuple[list[dict[str, Any]], list[str]]: + """Ordered subject roster + ref image paths for the H3 ref profile. + + Order = ref wiring order: scene characters first (scene order), then the + location. Capped at the workflow's generic (Input:image) slot count so + always matches an actually-wired reference image. + """ + subjects: list[dict[str, Any]] = [] + paths: list[str] = [] + for c in characters: + img = c.get("sheet_path") or c.get("portrait_path") + if not img: + continue + subjects.append( + { + "index": len(subjects) + 1, + "kind": "character", + "name": c.get("name"), + "appearance": c.get("consistency_prompt") or c.get("appearance") or "", + } + ) + paths.append(img) + if loc_image: + loc = location or {} + subjects.append( + { + "index": len(subjects) + 1, + "kind": "location", + "name": loc.get("name"), + "appearance": loc.get("consistency_prompt") or loc.get("description") or "", + } + ) + paths.append(loc_image) + cap = len(ref_image_slots(inputs)) + return subjects[:cap], paths[:cap] + + +async def _h3_rewrite(scene: dict[str, Any], subjects: list[dict[str, Any]]) -> str: + """LLM rewrite into H3's six-section format, deterministic template on failure.""" + client = LLMClient() + try: + return await client.chat( + build_minimax_h3_ref_messages(scene, subjects), temperature=0.4 + ) + except Exception as exc: + logger.warning("MiniMax H3 prompt rewrite failed (%s); using fallback template", exc) + return minimax_h3_ref_fallback(scene, subjects) + finally: + await client.close() + + +def _get_workflow(workflow_id: int | None = None) -> dict[str, Any] | None: + conn = get_db(settings.db_path) + try: + if workflow_id: + row = conn.execute( + "SELECT * FROM workflows WHERE id = ? AND is_enabled = 1", (workflow_id,) + ).fetchone() + else: + row = conn.execute( + "SELECT * FROM workflows WHERE kind = 'video' AND is_enabled = 1 ORDER BY id ASC LIMIT 1" + ).fetchone() + if not row: + row = conn.execute( + "SELECT * FROM workflows WHERE is_enabled = 1 ORDER BY id ASC LIMIT 1" + ).fetchone() + return row_to_dict(row) if row else None + finally: + conn.close() + + +async def enqueue_video_jobs( + project_id: int, + *, + scene_ids: list[int] | None = None, + workflow_id: int | None = None, + input_values_override: dict[str, Any] | None = None, +) -> list[dict[str, Any]]: + await event_bus.publish( + "agent.thinking", {"message": "Queuing video jobs…", "project_id": project_id} + ) + conn = get_db(settings.db_path) + jobs: list[dict[str, Any]] = [] + try: + query = "SELECT * FROM scenes WHERE project_id = ?" + params: list[Any] = [project_id] + if scene_ids: + placeholders = ",".join("?" * len(scene_ids)) + query += f" AND id IN ({placeholders})" + params.extend(scene_ids) + query += " ORDER BY order_index" + scenes = [row_to_dict(r) for r in conn.execute(query, params).fetchall()] + + for scene in scenes: + # Supersede leftover pending jobs so a re-Generate always starts fresh + conn.execute( + """ + UPDATE jobs SET status = 'failed', error = 'superseded by new generate', + completed_at = CURRENT_TIMESTAMP + WHERE scene_id = ? AND kind = 'video' AND status = 'pending' + """, + (scene["id"],), + ) + # Clear prior clip so UI shows generating instead of the old video + conn.execute( + "UPDATE scenes SET video_path = NULL WHERE id = ?", + (scene["id"],), + ) + # Commit BEFORE enqueue: queue_manager.enqueue writes on its own + # connection, and holding this transaction open across that call + # self-deadlocks (sqlite3.OperationalError: database is locked). + conn.commit() + + wf_id = workflow_id or scene.get("workflow_id") + workflow = _get_workflow(wf_id) + workflow_json = json.loads(workflow["workflow_json"]) if workflow else {} + inputs = parse_dynamic_inputs(workflow_json) if workflow_json else [] + + char_rows = conn.execute( + """ + SELECT c.* FROM characters c + JOIN scene_characters sc ON sc.character_id = c.id + WHERE sc.scene_id = ? + """, + (scene["id"],), + ).fetchall() + characters = [row_to_dict(r) for r in char_rows] + char_image = next( + (c.get("sheet_path") or c.get("portrait_path") for c in characters if c.get("sheet_path") or c.get("portrait_path")), + None, + ) + loc_image = scene.get("env_image_path") + loc_row: dict[str, Any] | None = None + if scene.get("location_id"): + row = conn.execute( + "SELECT name, description, consistency_prompt, reference_image_path " + "FROM locations WHERE id = ?", + (scene["location_id"],), + ).fetchone() + if row: + loc_row = row_to_dict(row) + if not loc_image: + loc_image = loc_row["reference_image_path"] + + profile = (workflow or {}).get("prompt_profile") or "prose" + if profile == "minimax_h3_ref": + subjects, ref_paths = _h3_subjects(characters, loc_row, loc_image, inputs) + await event_bus.publish( + "agent.thinking", + { + "message": f"H3 prompt rewrite · scene {scene.get('order_index')}", + "project_id": project_id, + }, + ) + prompt = await _h3_rewrite(scene, subjects) + values = smart_fill_inputs( + inputs, + prompt=prompt, + ref_images=ref_paths, + duration=scene.get("duration_sec"), + extra=input_values_override, + ) + else: + prompt = scene_video_prompt(scene, characters) + values = smart_fill_inputs( + inputs, + prompt=prompt, + character_image=char_image, + location_image=loc_image, + extra=input_values_override, + ) + job = queue_manager.enqueue( + project_id=project_id, + kind="video", + workflow_id=workflow["id"] if workflow else None, + scene_id=scene["id"], + payload={"input_values": values, "prompt": prompt}, + ) + if workflow and not scene.get("workflow_id"): + conn.execute( + "UPDATE scenes SET workflow_id = ? WHERE id = ?", + (workflow["id"], scene["id"]), + ) + # Never hold a write lock across awaits (event publish below). + conn.commit() + jobs.append(job) + await event_bus.publish( + "job.created", + { + "job_id": job["id"], + "kind": "video", + "message": f"Scene · {scene.get('heading') or scene.get('order_index')}", + "project_id": project_id, + }, + ) + conn.commit() + finally: + conn.close() + return jobs diff --git a/calliope-backend/src/calliope/comfyui/__init__.py b/calliope-backend/src/calliope/comfyui/__init__.py new file mode 100644 index 00000000..ec4e69bc --- /dev/null +++ b/calliope-backend/src/calliope/comfyui/__init__.py @@ -0,0 +1,5 @@ +"""ComfyUI integration package.""" +from calliope.comfyui.parser import parse_dynamic_inputs, parse_dynamic_outputs +from calliope.comfyui.patcher import patch_workflow + +__all__ = ["parse_dynamic_inputs", "parse_dynamic_outputs", "patch_workflow"] diff --git a/calliope-backend/src/calliope/comfyui/client.py b/calliope-backend/src/calliope/comfyui/client.py new file mode 100644 index 00000000..351cd426 --- /dev/null +++ b/calliope-backend/src/calliope/comfyui/client.py @@ -0,0 +1,135 @@ +"""ComfyUI HTTP client: upload, prompt, poll, download.""" +from __future__ import annotations + +import logging +import uuid +from pathlib import Path +from typing import Any + +import httpx + +from calliope.config import settings +from calliope.comfyui.registry import IMAGE_CLASSES, AUDIO_CLASSES + +logger = logging.getLogger("calliope.comfyui") + + +class ComfyUIClient: + def __init__(self, base_url: str | None = None) -> None: + self.base_url = (base_url or settings.comfyui_base_url).rstrip("/") + self.client_id = str(uuid.uuid4()) + self._http = httpx.AsyncClient(timeout=120.0) + + async def close(self) -> None: + await self._http.aclose() + + async def health(self) -> bool: + try: + resp = await self._http.get(f"{self.base_url}/system_stats") + return resp.status_code == 200 + except Exception: + return False + + async def upload_image(self, path: Path, subfolder: str = "calliope") -> str: + data = path.read_bytes() + files = {"image": (path.name, data, "application/octet-stream")} + form = {"overwrite": "true", "subfolder": subfolder} + resp = await self._http.post(f"{self.base_url}/upload/image", files=files, data=form) + resp.raise_for_status() + result = resp.json() + name = result.get("name", path.name) + sub = result.get("subfolder") or subfolder + return f"{sub}/{name}" if sub else name + + async def upload_audio(self, path: Path, subfolder: str = "calliope") -> str: + data = path.read_bytes() + files = {"image": (path.name, data, "application/octet-stream")} # Comfy uses image field + form = {"overwrite": "true", "subfolder": subfolder, "type": "input"} + resp = await self._http.post(f"{self.base_url}/upload/image", files=files, data=form) + resp.raise_for_status() + result = resp.json() + name = result.get("name", path.name) + sub = result.get("subfolder") or subfolder + return f"{sub}/{name}" if sub else name + + async def prepare_media_inputs(self, workflow: dict[str, Any]) -> dict[str, Any]: + """Upload local file paths referenced in LoadImage/LoadAudio nodes.""" + for _node_id, node in workflow.items(): + if not isinstance(node, dict): + continue + class_type = node.get("class_type", "") + inputs = node.get("inputs") or {} + if class_type in IMAGE_CLASSES: + image = inputs.get("image") + if isinstance(image, str) and self._looks_like_local_path(image): + path = Path(image) + if path.exists(): + inputs["image"] = await self.upload_image(path) + node["inputs"] = inputs + elif class_type in AUDIO_CLASSES: + audio = inputs.get("audio") + if isinstance(audio, str) and self._looks_like_local_path(audio): + path = Path(audio) + if path.exists(): + inputs["audio"] = await self.upload_audio(path) + node["inputs"] = inputs + return workflow + + @staticmethod + def _looks_like_local_path(value: str) -> bool: + if value.startswith("http://") or value.startswith("https://"): + return False + p = Path(value) + return p.is_absolute() or "/" in value or "\\" in value + + async def queue_prompt(self, workflow: dict[str, Any]) -> str: + payload = {"prompt": workflow, "client_id": self.client_id} + resp = await self._http.post(f"{self.base_url}/prompt", json=payload) + resp.raise_for_status() + data = resp.json() + prompt_id = data.get("prompt_id") + if not prompt_id: + raise RuntimeError(f"ComfyUI /prompt missing prompt_id: {data}") + return prompt_id + + async def get_history(self, prompt_id: str) -> dict[str, Any] | None: + resp = await self._http.get(f"{self.base_url}/history/{prompt_id}") + resp.raise_for_status() + data = resp.json() + return data.get(prompt_id) + + async def download_image( + self, + filename: str, + subfolder: str = "", + folder_type: str = "output", + dest: Path | None = None, + ) -> Path: + params = {"filename": filename, "subfolder": subfolder, "type": folder_type} + resp = await self._http.get(f"{self.base_url}/view", params=params) + resp.raise_for_status() + if dest is None: + dest = settings.assets_dir / "comfy_downloads" / filename + dest.parent.mkdir(parents=True, exist_ok=True) + dest.write_bytes(resp.content) + return dest + + async def interrupt(self) -> None: + try: + await self._http.post(f"{self.base_url}/interrupt") + except Exception as exc: + logger.warning("ComfyUI interrupt failed: %s", exc) + + def extract_outputs(self, history: dict[str, Any]) -> list[dict[str, str]]: + outputs: list[dict[str, str]] = [] + for _node_id, node_out in (history.get("outputs") or {}).items(): + for key in ("images", "gifs", "videos"): + for item in node_out.get(key) or []: + outputs.append( + { + "filename": item.get("filename", ""), + "subfolder": item.get("subfolder", ""), + "type": item.get("type", "output"), + } + ) + return outputs diff --git a/calliope-backend/src/calliope/comfyui/dry_run.py b/calliope-backend/src/calliope/comfyui/dry_run.py new file mode 100644 index 00000000..b02c6c79 --- /dev/null +++ b/calliope-backend/src/calliope/comfyui/dry_run.py @@ -0,0 +1,49 @@ +"""Dry-run placeholder asset generation when ComfyUI is offline.""" +from __future__ import annotations + +import struct +import zlib +from pathlib import Path + + +def _png_chunk(chunk_type: bytes, data: bytes) -> bytes: + return ( + struct.pack(">I", len(data)) + + chunk_type + + data + + struct.pack(">I", zlib.crc32(chunk_type + data) & 0xFFFFFFFF) + ) + + +def write_placeholder_png(dest: Path, width: int = 512, height: int = 512, label: str = "dry-run") -> Path: + """Write a minimal solid-color PNG (no Pillow dependency).""" + dest.parent.mkdir(parents=True, exist_ok=True) + # Dark purple-ish RGB + r, g, b = 40, 30, 70 + raw = b"" + for _y in range(height): + raw += b"\x00" # filter none + raw += bytes([r, g, b]) * width + compressed = zlib.compress(raw, 9) + ihdr = struct.pack(">IIBBBBB", width, height, 8, 2, 0, 0, 0) + png = b"\x89PNG\r\n\x1a\n" + png += _png_chunk(b"IHDR", ihdr) + png += _png_chunk(b"IDAT", compressed) + png += _png_chunk(b"IEND", b"") + dest.write_bytes(png) + # Write a tiny sidecar note + dest.with_suffix(".txt").write_text(f"Calliope dry-run placeholder: {label}\n", encoding="utf-8") + return dest + + +def write_placeholder_mp4(dest: Path, label: str = "dry-run") -> Path: + """Write a tiny stub file with .mp4 extension (not a real video codec).""" + dest.parent.mkdir(parents=True, exist_ok=True) + # Minimal ftyp box so some players recognize container; still a stub. + data = ( + b"\x00\x00\x00\x18ftypmp42" + b"\x00\x00\x00\x00mp42isom" + + f"Calliope dry-run stub: {label}".encode("utf-8") + ) + dest.write_bytes(data) + return dest diff --git a/calliope-backend/src/calliope/comfyui/parser.py b/calliope-backend/src/calliope/comfyui/parser.py new file mode 100644 index 00000000..ddc6cd29 --- /dev/null +++ b/calliope-backend/src/calliope/comfyui/parser.py @@ -0,0 +1,82 @@ +"""Parse ComfyUI API-format workflows for (Input[:role]) / (Output[:role]) titled nodes.""" +from __future__ import annotations + +from typing import Any + +from calliope.comfyui.registry import ( + ComfyOutputKind, + IMAGE_CLASSES, + AUDIO_CLASSES, + class_to_input_kind, + class_to_output_kind, +) +from calliope.comfyui.roles import ( + normalize_input_role, + normalize_output_role, + parse_title_tag, +) + + +def extract_default_value(node: dict[str, Any]) -> str | int | float | None: + class_type = node.get("class_type", "") + inputs = node.get("inputs") or {} + if class_type in IMAGE_CLASSES or class_type in AUDIO_CLASSES: + return None + if isinstance(inputs.get("text"), str): + return inputs["text"] + value = inputs.get("value") + if isinstance(value, (str, int, float)): + return value + if isinstance(inputs.get("int"), (int, float)): + return inputs["int"] + if isinstance(inputs.get("float"), (int, float)): + return inputs["float"] + return None + + +def parse_dynamic_inputs(workflow: dict[str, Any]) -> list[dict[str, Any]]: + results: list[dict[str, Any]] = [] + for node_id, node in workflow.items(): + if not isinstance(node, dict): + continue + title = (node.get("_meta") or {}).get("title") or "" + kind, role, label = parse_title_tag(title) + if kind != "input": + continue + results.append( + { + "nodeId": str(node_id), + "label": label or node.get("class_type", node_id), + "role": normalize_input_role(role), + "kind": class_to_input_kind(node.get("class_type", "")), + "defaultValue": extract_default_value(node), + "required": True, + } + ) + return results + + +def parse_dynamic_outputs(workflow: dict[str, Any]) -> list[dict[str, Any]]: + results: list[dict[str, Any]] = [] + for node_id, node in workflow.items(): + if not isinstance(node, dict): + continue + title = (node.get("_meta") or {}).get("title") or "" + kind, role, label = parse_title_tag(title) + if kind != "output": + continue + out_kind: ComfyOutputKind = class_to_output_kind(node.get("class_type", "")) + canon = normalize_output_role(role) + if canon == "video": + out_kind = "video" + elif canon == "image": + out_kind = "image" + results.append( + { + "nodeId": str(node_id), + "label": label or node.get("class_type", node_id), + "role": canon, + "kind": out_kind, + } + ) + return results diff --git a/calliope-backend/src/calliope/comfyui/patcher.py b/calliope-backend/src/calliope/comfyui/patcher.py new file mode 100644 index 00000000..32275b9d --- /dev/null +++ b/calliope-backend/src/calliope/comfyui/patcher.py @@ -0,0 +1,31 @@ +"""Patch user values into ComfyUI API-format workflow by nodeId.""" +from __future__ import annotations + +import copy +from typing import Any + +from calliope.comfyui.registry import class_to_patch_field + + +def patch_workflow( + base: dict[str, Any], + values_by_node_id: dict[str, Any], +) -> dict[str, Any]: + patched = copy.deepcopy(base) + for node_id, value in values_by_node_id.items(): + if value is None: + continue + key = str(node_id) + node = patched.get(key) + if not isinstance(node, dict): + continue + inputs = dict(node.get("inputs") or {}) + field = class_to_patch_field(node.get("class_type", "")) + if field == "text" and "text" not in inputs and "value" in inputs: + field = "value" + if field == "value" and "text" in inputs and "value" not in inputs: + field = "text" + inputs[field] = value + node["inputs"] = inputs + patched[key] = node + return patched diff --git a/calliope-backend/src/calliope/comfyui/profiles.py b/calliope-backend/src/calliope/comfyui/profiles.py new file mode 100644 index 00000000..436b78df --- /dev/null +++ b/calliope-backend/src/calliope/comfyui/profiles.py @@ -0,0 +1,28 @@ +"""Prompt profiles: how scene prompts are formatted for a workflow's model. + +``prose`` (default) sends the classic flat prose paragraph. ``minimax_h3_ref`` +rewrites the scene into MiniMax H3's six-section full-reference format at +video-enqueue time (see calliope.agent.prompts). +""" +from __future__ import annotations + +from typing import Any + +PROFILES = ("prose", "minimax_h3_ref") + +DEFAULT_PROFILE = "prose" + + +def detect_prompt_profile(workflow_json: dict[str, Any]) -> str: + """Suggest a prompt profile from the workflow's node classes. + + Deterministic class-type check (not title guessing): any MiniMaxH3* node + (e.g. ``MiniMaxH3ReferenceToVideo``) means the workflow expects the H3 + full-reference prompt format. + """ + for node in workflow_json.values(): + if not isinstance(node, dict): + continue + if str(node.get("class_type", "")).startswith("MiniMaxH3"): + return "minimax_h3_ref" + return DEFAULT_PROFILE diff --git a/calliope-backend/src/calliope/comfyui/registry.py b/calliope-backend/src/calliope/comfyui/registry.py new file mode 100644 index 00000000..4fb660b4 --- /dev/null +++ b/calliope-backend/src/calliope/comfyui/registry.py @@ -0,0 +1,85 @@ +"""Unified class_type → kind + patch-field registry (MuseAgent port).""" +from __future__ import annotations + +from typing import Literal + +ComfyInputKind = Literal["text", "textarea", "number", "image", "image_url", "audio"] +ComfyOutputKind = Literal["image", "video", "other"] +PatchField = Literal["image", "url", "audio", "text", "value", "int", "float"] + +TEXT_AREA_CLASSES = frozenset( + { + "CLIPTextEncode", + "Note", + "ShowText", + "ImpactWildcardProcessor", + "PrimitiveStringMultiline", + "PrimitiveString", + } +) +NUMBER_CLASSES = frozenset( + {"INT", "FLOAT", "PrimitiveInt", "PrimitiveFloat", "KSampler", "KSamplerAdvanced"} +) +IMAGE_CLASSES = frozenset({"LoadImage", "ImageLoader", "ETN_LoadImageBase64"}) +IMAGE_URL_CLASSES = frozenset({"Load Image From Url (mtb)"}) +AUDIO_CLASSES = frozenset({"LoadAudio", "VHS_LoadAudio"}) +VIDEO_OUTPUT_CLASSES = frozenset( + {"VHS_VideoCombine", "SaveVideo", "VideoOutput", "AnimateDiffCombine"} +) +IMAGE_OUTPUT_CLASSES = frozenset( + {"SaveImage", "PreviewImage", "SaveImageWebsocket", "ETN_SendImageWebSocket"} +) + + +def class_to_input_kind(class_type: str) -> ComfyInputKind: + if class_type in IMAGE_CLASSES: + return "image" + if class_type in IMAGE_URL_CLASSES: + return "image_url" + if class_type in AUDIO_CLASSES: + return "audio" + if class_type in NUMBER_CLASSES: + return "number" + if class_type in TEXT_AREA_CLASSES: + return "textarea" + lower = class_type.lower() + if "image" in lower or "load" in lower: + return "image" + if "audio" in lower: + return "audio" + if "int" in lower or "float" in lower or "seed" in lower: + return "number" + if "text" in lower or "clip" in lower or "prompt" in lower: + return "textarea" + return "text" + + +def class_to_patch_field(class_type: str) -> PatchField: + if class_type in IMAGE_CLASSES: + return "image" + if class_type in IMAGE_URL_CLASSES: + return "url" + if class_type in AUDIO_CLASSES: + return "audio" + if class_type in {"CLIPTextEncode", "Note", "ShowText", "ImpactWildcardProcessor"}: + return "text" + if class_type.startswith("Primitive"): + return "value" + kind = class_to_input_kind(class_type) + if kind == "image": + return "image" + if kind == "image_url": + return "url" + if kind == "audio": + return "audio" + if kind == "textarea": + return "text" + return "value" + + +def class_to_output_kind(class_type: str) -> ComfyOutputKind: + if class_type in VIDEO_OUTPUT_CLASSES or "video" in class_type.lower(): + return "video" + if class_type in IMAGE_OUTPUT_CLASSES or "image" in class_type.lower(): + return "image" + return "other" diff --git a/calliope-backend/src/calliope/comfyui/roles.py b/calliope-backend/src/calliope/comfyui/roles.py new file mode 100644 index 00000000..b2f19e57 --- /dev/null +++ b/calliope-backend/src/calliope/comfyui/roles.py @@ -0,0 +1,85 @@ +"""ComfyUI node title role tags: (Input:prompt), (Output:image), etc.""" +from __future__ import annotations + +import re +from typing import Any + +# Title tag: (Input), (Input:prompt), (Output:image), … +_TITLE_TAG_RE = re.compile( + r"\((?PInput|Output)(?::(?P[a-zA-Z0-9_-]+))?\)", + re.IGNORECASE, +) + +# Canonical role → accepted aliases (all lowercased). +INPUT_ROLE_ALIASES: dict[str, frozenset[str]] = { + "prompt": frozenset({"prompt", "positive"}), + "negative": frozenset({"negative", "neg"}), + "width": frozenset({"width", "w"}), + "height": frozenset({"height", "h"}), + "character": frozenset({"character", "char", "portrait", "sheet", "face", "ref"}), + "location": frozenset({"location", "loc", "environment", "env", "background", "scene"}), + "image": frozenset({"image", "img"}), + "seed": frozenset({"seed"}), + "duration": frozenset({"duration", "dur", "length", "seconds"}), +} + +OUTPUT_ROLE_ALIASES: dict[str, frozenset[str]] = { + "image": frozenset({"image", "img"}), + "video": frozenset({"video", "vid"}), +} + + +def parse_title_tag(title: str) -> tuple[str | None, str | None, str]: + """Return (kind, role, label) from a Comfy node title. + + kind is ``\"input\"`` / ``\"output\"`` or None if no tag. + role is the lowercase role string or None for plain ``(Input)`` / ``(Output)``. + label is the display name with the tag stripped. + """ + if not title: + return None, None, "" + match = _TITLE_TAG_RE.search(title) + if not match: + return None, None, title.strip() + kind = match.group("kind").lower() + role_raw = match.group("role") + role = role_raw.lower() if role_raw else None + stripped = _TITLE_TAG_RE.sub("", title).strip() + # Title is only the tag, e.g. "(Input:prompt)" → use role as display label. + if stripped: + label = stripped + elif role: + label = role + else: + label = kind + return kind, role, label + + +def normalize_input_role(role: str | None) -> str | None: + """Map an alias to its canonical input role, or return the role as-is if unknown.""" + if not role: + return None + r = role.lower().strip() + for canonical, aliases in INPUT_ROLE_ALIASES.items(): + if r in aliases or r == canonical: + return canonical + return r + + +def normalize_output_role(role: str | None) -> str | None: + if not role: + return None + r = role.lower().strip() + for canonical, aliases in OUTPUT_ROLE_ALIASES.items(): + if r in aliases or r == canonical: + return canonical + return r + + +def input_has_role(inp: dict[str, Any], *canonical_roles: str) -> bool: + """True if this parsed input's role matches any of the canonical roles (incl. aliases).""" + role = normalize_input_role(inp.get("role")) + if not role: + return False + wanted = {normalize_input_role(c) for c in canonical_roles} + return role in wanted diff --git a/calliope-backend/src/calliope/comfyui/smart_fill.py b/calliope-backend/src/calliope/comfyui/smart_fill.py new file mode 100644 index 00000000..0e49e7dc --- /dev/null +++ b/calliope-backend/src/calliope/comfyui/smart_fill.py @@ -0,0 +1,158 @@ +"""Smart-fill ComfyUI dynamic inputs from project/scene context via role tags.""" +from __future__ import annotations + +from typing import Any + +from calliope.comfyui.roles import input_has_role + + +def _find_by_role(inputs: list[dict[str, Any]], *roles: str) -> dict[str, Any] | None: + for inp in inputs: + if input_has_role(inp, *roles): + return inp + return None + + +def _find_all_by_role(inputs: list[dict[str, Any]], *roles: str) -> list[dict[str, Any]]: + """All inputs matching any of the roles, sorted by numeric node id. + + Node-id order is the documented ref-slot order: for multi-reference + workflows (e.g. MiniMax H3 ref2video), ``(Input:image)`` slots are filled + in this order and it defines ```` numbering in the prompt. + """ + matches = [inp for inp in inputs if input_has_role(inp, *roles)] + return sorted(matches, key=lambda i: int(i["nodeId"])) + + +def ref_image_slots(inputs: list[dict[str, Any]]) -> list[dict[str, Any]]: + """Generic ``(Input:image)`` ref slots in documented fill order (node id). + + For multi-reference workflows (e.g. MiniMax H3 ref2video) these slots are + filled in this order and it defines ```` prompt numbering. + """ + return _find_all_by_role(inputs, "image") + + +def _legacy_prompt_node(inputs: list[dict[str, Any]]) -> dict[str, Any] | None: + """Deprecated: untagged (Input) text nodes — prefer (Input:prompt).""" + for inp in inputs: + if inp.get("role"): + continue + if inp.get("kind") not in ("text", "textarea"): + continue + label = (inp.get("label") or "").lower() + if "negative" in label: + continue + if any(k in label for k in ("prompt", "positive", "text")): + return inp + for inp in inputs: + if inp.get("role"): + continue + if inp.get("kind") in ("text", "textarea"): + label = (inp.get("label") or "").lower() + if "negative" not in label: + return inp + return None + + +def smart_fill_inputs( + inputs: list[dict[str, Any]], + *, + prompt: str | None = None, + negative_prompt: str | None = None, + character_image: str | None = None, + location_image: str | None = None, + ref_images: list[str] | None = None, + duration: int | float | None = None, + extra: dict[str, Any] | None = None, +) -> dict[str, Any]: + """Build valuesByNodeId from workflow dynamic inputs + context. + + Mapping is driven by Comfy title role tags, e.g. ``(Input:prompt)``. + See ``AGENTS.md`` / README for the role contract. + + Order: non-blank defaults → role-based context → shared extras (non-blank). + User/form ``extra`` wins so regenerating a clip keeps the settings they edited. + Blank extras are skipped so an empty shared Text Prompt cannot wipe context. + """ + values: dict[str, Any] = {} + for inp in inputs: + node_id = str(inp["nodeId"]) + default = inp.get("defaultValue") + if default is None: + continue + if isinstance(default, str) and not default.strip(): + continue + values[node_id] = default + + if prompt: + target = _find_by_role(inputs, "prompt") or _legacy_prompt_node(inputs) + if target: + values[str(target["nodeId"])] = prompt + + if negative_prompt: + target = _find_by_role(inputs, "negative") + if target: + values[str(target["nodeId"])] = negative_prompt + else: + for inp in inputs: + if inp.get("role"): + continue + if inp.get("kind") in ("text", "textarea") and "negative" in ( + inp.get("label") or "" + ).lower(): + values[str(inp["nodeId"])] = negative_prompt + break + + if character_image: + target = _find_by_role(inputs, "character") + if target: + values[str(target["nodeId"])] = character_image + else: + for inp in inputs: + if inp.get("role"): + continue + if inp.get("kind") in ("image", "image_url"): + label = (inp.get("label") or "").lower() + if any( + k in label + for k in ("character", "portrait", "reference", "sheet", "face", "ref") + ) and not any(k in label for k in ("env", "location", "background", "scene")): + values[str(inp["nodeId"])] = character_image + break + + if location_image: + target = _find_by_role(inputs, "location") + if target: + values[str(target["nodeId"])] = location_image + else: + for inp in inputs: + if inp.get("role"): + continue + if inp.get("kind") in ("image", "image_url"): + label = (inp.get("label") or "").lower() + if any( + k in label + for k in ("env", "location", "background", "scene", "setting") + ): + values[str(inp["nodeId"])] = location_image + break + + if ref_images: + for inp, path in zip(ref_image_slots(inputs), ref_images): + values[str(inp["nodeId"])] = path + + if duration is not None: + target = _find_by_role(inputs, "duration") + if target: + values[str(target["nodeId"])] = duration + + if extra: + for k, v in extra.items(): + if v is None: + continue + if isinstance(v, str) and not str(v).strip(): + continue + values[str(k)] = v + + return values diff --git a/calliope-backend/src/calliope/config.py b/calliope-backend/src/calliope/config.py new file mode 100644 index 00000000..735c4259 --- /dev/null +++ b/calliope-backend/src/calliope/config.py @@ -0,0 +1,202 @@ +from __future__ import annotations + +import json +import sys +import tempfile +from pathlib import Path +from typing import Any + +from pydantic_settings import BaseSettings, SettingsConfigDict + + +# calliope-backend/ — permanent home for config + default data (never %TEMP%) +# PyInstaller-frozen exe: __file__ points inside the bundle (_internal/), which is +# not where a portable app should keep user data. Anchor config + default data +# NEXT TO the exe instead, so the app folder stays self-contained and writable. +# Dev (non-frozen) resolution is unchanged. +if getattr(sys, "frozen", False): + BACKEND_ROOT = Path(sys.executable).resolve().parent +else: + BACKEND_ROOT = Path(__file__).resolve().parent.parent.parent +CONFIG_FILE = BACKEND_ROOT / "calliope_config.json" +DEFAULT_DATA_DIR = BACKEND_ROOT / "data" +DEFAULT_ASSETS_DIR = DEFAULT_DATA_DIR / "assets" + + +def _strip_path_str(value: str | Path | None) -> str | None: + """Normalize path strings; strip accidental wrapping quotes from UI paste.""" + if value is None: + return None + s = str(value).strip() + if not s or s.lower() in {"none", "null"}: + return None + if (s.startswith('"') and s.endswith('"')) or (s.startswith("'") and s.endswith("'")): + s = s[1:-1].strip() + return s or None + + +def normalize_path(value: str | Path | None) -> Path | None: + cleaned = _strip_path_str(value) + if cleaned is None: + return None + return Path(cleaned) + + +def is_ephemeral_path(path: Path | str | None) -> bool: + """True for OS temp / pytest TemporaryDirectory paths — never use as default storage.""" + if path is None: + return False + try: + resolved = Path(path).resolve() + except OSError: + resolved = Path(path) + parts_lower = {p.lower() for p in resolved.parts} + if "temp" in parts_lower or "tmp" in parts_lower: + # Windows %TEMP% and Unix /tmp + temp_root = Path(tempfile.gettempdir()).resolve() + try: + resolved.relative_to(temp_root) + return True + except ValueError: + pass + # pytest-style .../Temp/tmpXXXX + name = resolved.name.lower() + if name.startswith("tmp") and len(name) > 3: + return True + for parent in resolved.parents: + if parent.name.lower().startswith("tmp") and parent.parent.resolve() == temp_root: + return True + return False + + +class Settings(BaseSettings): + model_config = SettingsConfigDict( + env_prefix="CALLIOPE_", + env_file=".env", + env_file_encoding="utf-8", + extra="ignore", + ) + + host: str = "127.0.0.1" + port: int = 8247 + data_dir: Path = DEFAULT_DATA_DIR + assets_dir: Path = DEFAULT_ASSETS_DIR + db_name: str = "calliope.db" + + llm_base_url: str = "http://127.0.0.1:11434/v1" + llm_model: str = "llama3.2" + llm_api_key: str | None = None + + comfyui_base_url: str = "http://127.0.0.1:8188" + # Comfy is HTTP-only (upload / prompt / history / view). No local input/output dirs. + + queue_concurrency: int = 1 + queue_poll_interval_sec: float = 2.0 + queue_max_retries: int = 2 + dry_run: bool = False # off by default — real ComfyUI jobs + + @property + def db_path(self) -> Path: + return self.data_dir / self.db_name + + def ensure_storage_dirs(self) -> None: + self.data_dir.mkdir(parents=True, exist_ok=True) + self.assets_dir.mkdir(parents=True, exist_ok=True) + + def to_public_dict(self) -> dict[str, Any]: + """Return settings that are safe to expose to the frontend.""" + return { + "host": self.host, + "port": self.port, + "data_dir": str(self.data_dir), + "assets_dir": str(self.assets_dir), + "db_name": self.db_name, + "llm_base_url": self.llm_base_url, + "llm_model": self.llm_model, + "llm_api_key": bool(self.llm_api_key), + "comfyui_base_url": self.comfyui_base_url, + "queue_concurrency": self.queue_concurrency, + "queue_poll_interval_sec": self.queue_poll_interval_sec, + "queue_max_retries": self.queue_max_retries, + "dry_run": bool(self.dry_run), + } + + def _apply_storage_paths(self, data_dir: Path | None, assets_dir: Path | None) -> None: + if data_dir is not None: + if is_ephemeral_path(data_dir): + data_dir = DEFAULT_DATA_DIR + self.data_dir = data_dir + if assets_dir is not None: + if is_ephemeral_path(assets_dir): + assets_dir = DEFAULT_ASSETS_DIR + self.assets_dir = assets_dir + # Keep assets under data when data moved and assets still ephemeral + if is_ephemeral_path(self.assets_dir): + self.assets_dir = self.data_dir / "assets" + + def load_config_file(self) -> None: + if not CONFIG_FILE.exists(): + self.data_dir = DEFAULT_DATA_DIR + self.assets_dir = DEFAULT_ASSETS_DIR + self.dry_run = False + self.ensure_storage_dirs() + return + + data = json.loads(CONFIG_FILE.read_text(encoding="utf-8")) + path_keys = {"data_dir", "assets_dir"} + # Ignore legacy comfyui_input_dir / comfyui_output_dir if present in old configs. + skip_keys = {"comfyui_input_dir", "comfyui_output_dir"} + for key, value in data.items(): + if key in skip_keys: + continue + if key in path_keys: + value = normalize_path(value) + if key == "dry_run": + value = bool(value) + if hasattr(self, key) and key not in {"data_dir", "assets_dir"}: + setattr(self, key, value) + + data_dir = normalize_path(data.get("data_dir")) or DEFAULT_DATA_DIR + assets_dir = normalize_path(data.get("assets_dir")) or (data_dir / "assets") + self._apply_storage_paths(data_dir, assets_dir) + self.dry_run = bool(data.get("dry_run", False)) + self.ensure_storage_dirs() + + # Auto-heal poisoned config (temp paths / quoted dirs / legacy comfy dirs) back to disk + needs_rewrite = is_ephemeral_path(normalize_path(data.get("data_dir"))) or any( + isinstance(data.get(k), str) and str(data.get(k)).startswith('"') + for k in ("data_dir", "assets_dir") + if data.get(k) + ) + if needs_rewrite or "comfyui_input_dir" in data or "comfyui_output_dir" in data: + self.save_config_file() + + def save_config_file(self) -> None: + # Never persist pytest / OS temp storage as the real data home + if is_ephemeral_path(self.data_dir): + self.data_dir = DEFAULT_DATA_DIR + if is_ephemeral_path(self.assets_dir): + self.assets_dir = self.data_dir / "assets" + self.dry_run = bool(self.dry_run) + self.ensure_storage_dirs() + + data = { + "host": self.host, + "port": self.port, + "data_dir": str(self.data_dir), + "assets_dir": str(self.assets_dir), + "db_name": self.db_name, + "llm_base_url": self.llm_base_url, + "llm_model": self.llm_model, + "llm_api_key": self.llm_api_key, + "comfyui_base_url": self.comfyui_base_url, + "queue_concurrency": self.queue_concurrency, + "queue_poll_interval_sec": self.queue_poll_interval_sec, + "queue_max_retries": self.queue_max_retries, + "dry_run": bool(self.dry_run), + } + CONFIG_FILE.write_text(json.dumps(data, indent=2), encoding="utf-8") + + +settings = Settings() +settings.load_config_file() diff --git a/calliope-backend/src/calliope/db.py b/calliope-backend/src/calliope/db.py new file mode 100644 index 00000000..0daa124b --- /dev/null +++ b/calliope-backend/src/calliope/db.py @@ -0,0 +1,225 @@ +from __future__ import annotations + +import json +import sqlite3 +from pathlib import Path +from typing import Any + +SCHEMA = """ +CREATE TABLE IF NOT EXISTS projects ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + title TEXT NOT NULL, + idea TEXT, + genre TEXT, + tone TEXT, + target_duration TEXT, + cover_path TEXT, + status TEXT NOT NULL DEFAULT 'draft', + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS story_beats ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE, + order_index INTEGER NOT NULL, + title TEXT NOT NULL, + description TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS characters ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE, + name TEXT NOT NULL, + role TEXT, + age TEXT, + appearance TEXT, + personality TEXT, + portrait_path TEXT, + sheet_path TEXT, + consistency_prompt TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS locations ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE, + name TEXT NOT NULL, + description TEXT, + reference_image_path TEXT, + consistency_prompt TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS scenes ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE, + beat_id INTEGER REFERENCES story_beats(id) ON DELETE SET NULL, + order_index INTEGER NOT NULL, + heading TEXT, + action TEXT, + dialog TEXT, + duration_sec INTEGER, + workflow_id INTEGER, + env_image_path TEXT, + location_id INTEGER, + video_path TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS scene_characters ( + scene_id INTEGER NOT NULL REFERENCES scenes(id) ON DELETE CASCADE, + character_id INTEGER NOT NULL REFERENCES characters(id) ON DELETE CASCADE, + PRIMARY KEY (scene_id, character_id) +); + +CREATE TABLE IF NOT EXISTS workflows ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL, + kind TEXT NOT NULL CHECK(kind IN ('image', 'video')), + workflow_json TEXT NOT NULL, + input_node_map TEXT, + output_node_name TEXT, + input_schema TEXT, + output_schema TEXT, + description TEXT, + prompt_profile TEXT NOT NULL DEFAULT 'prose', + is_enabled INTEGER NOT NULL DEFAULT 1, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); + +CREATE TABLE IF NOT EXISTS jobs ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + project_id INTEGER NOT NULL REFERENCES projects(id) ON DELETE CASCADE, + scene_id INTEGER REFERENCES scenes(id) ON DELETE SET NULL, + kind TEXT NOT NULL, + workflow_id INTEGER REFERENCES workflows(id) ON DELETE SET NULL, + status TEXT NOT NULL DEFAULT 'pending', + payload_json TEXT, + output_paths_json TEXT, + error TEXT, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + started_at TIMESTAMP, + completed_at TIMESTAMP, + retry_count INTEGER NOT NULL DEFAULT 0 +); +""" + + +def get_db(db_path: Path) -> sqlite3.Connection: + conn = sqlite3.connect(db_path, timeout=10) + conn.row_factory = sqlite3.Row + # WAL: readers never block writers (the UI polls jobs/settings constantly), + # and busy_timeout makes writers wait instead of erroring on contention. + conn.execute("PRAGMA journal_mode = WAL") + conn.execute("PRAGMA busy_timeout = 10000") + conn.execute("PRAGMA foreign_keys = ON") + return conn + + +def _sqlite_connect(path: Path) -> sqlite3.Connection: + return sqlite3.connect(path) + + +async def migrate_db(db_path: Path) -> None: + db_path.parent.mkdir(parents=True, exist_ok=True) + conn = sqlite3.connect(db_path) + conn.executescript(SCHEMA) + # Additive migrations for existing DBs + cols = {r[1] for r in conn.execute("PRAGMA table_info(workflows)").fetchall()} + if "input_schema" not in cols: + conn.execute("ALTER TABLE workflows ADD COLUMN input_schema TEXT") + if "output_schema" not in cols: + conn.execute("ALTER TABLE workflows ADD COLUMN output_schema TEXT") + if "description" not in cols: + conn.execute("ALTER TABLE workflows ADD COLUMN description TEXT") + if "prompt_profile" not in cols: + conn.execute( + "ALTER TABLE workflows ADD COLUMN prompt_profile TEXT NOT NULL DEFAULT 'prose'" + ) + scene_cols = {r[1] for r in conn.execute("PRAGMA table_info(scenes)").fetchall()} + if "location_id" not in scene_cols: + conn.execute("ALTER TABLE scenes ADD COLUMN location_id INTEGER") + if "video_path" not in scene_cols: + conn.execute("ALTER TABLE scenes ADD COLUMN video_path TEXT") + project_cols = {r[1] for r in conn.execute("PRAGMA table_info(projects)").fetchall()} + if "cover_path" not in project_cols: + conn.execute("ALTER TABLE projects ADD COLUMN cover_path TEXT") + conn.commit() + conn.close() + + +def row_to_dict(row: sqlite3.Row) -> dict[str, Any]: + return {key: row[key] for key in row.keys()} + + +# Columns that store absolute asset paths. When the app folder moves, these +# still point at the old install root and /api/file rejects them (403). +_PATH_COLUMNS = { + "projects": ["cover_path"], + "characters": ["portrait_path", "sheet_path"], + "locations": ["reference_image_path"], + "scenes": ["env_image_path", "video_path"], +} + + +def _rebase_path(value: Any, data_dir: Path, assets_dir: Path) -> str | None: + """Rebase an absolute path from a previous install location onto current dirs. + + Returns the rebased path, or None when the value is not a stale absolute + path (relative, already under data_dir, or has no 'assets' segment). + """ + if not value or not isinstance(value, str): + return None + p = Path(value) + if not p.is_absolute(): + return None + try: + p.resolve().relative_to(data_dir.resolve()) + return None # already under the current install + except (ValueError, OSError): + pass + parts_lower = [seg.lower() for seg in p.parts] + if "assets" not in parts_lower: + return None + idx = len(parts_lower) - 1 - parts_lower[::-1].index("assets") + rel = Path(*p.parts[idx + 1 :]) + if not rel.parts: + return None + return str(assets_dir / rel) + + +def rebase_stale_asset_paths(conn: sqlite3.Connection, data_dir: Path, assets_dir: Path) -> int: + """Rewrite stored asset paths left over from a previous install location. + + Call after migrate_db (needs all columns to exist). Returns the number of + rewritten values; caller commits. + """ + count = 0 + for table, columns in _PATH_COLUMNS.items(): + for col in columns: + rows = conn.execute(f"SELECT id, {col} FROM {table} WHERE {col} IS NOT NULL").fetchall() + for row in rows: + new = _rebase_path(row[col], data_dir, assets_dir) + if new and new != row[col]: + conn.execute(f"UPDATE {table} SET {col} = ? WHERE id = ?", (new, row["id"])) + count += 1 + rows = conn.execute( + "SELECT id, output_paths_json FROM jobs WHERE output_paths_json IS NOT NULL" + ).fetchall() + for row in rows: + try: + paths = json.loads(row["output_paths_json"] or "[]") + except json.JSONDecodeError: + continue + if not isinstance(paths, list): + continue + new_paths = [_rebase_path(p, data_dir, assets_dir) or p for p in paths] + if new_paths != paths: + conn.execute( + "UPDATE jobs SET output_paths_json = ? WHERE id = ?", + (json.dumps(new_paths), row["id"]), + ) + count += 1 + return count diff --git a/calliope-backend/src/calliope/events/__init__.py b/calliope-backend/src/calliope/events/__init__.py new file mode 100644 index 00000000..3cc7ad97 --- /dev/null +++ b/calliope-backend/src/calliope/events/__init__.py @@ -0,0 +1,3 @@ +from calliope.events.bus import EventBus, event_bus + +__all__ = ["EventBus", "event_bus"] diff --git a/calliope-backend/src/calliope/events/bus.py b/calliope-backend/src/calliope/events/bus.py new file mode 100644 index 00000000..a4a86120 --- /dev/null +++ b/calliope-backend/src/calliope/events/bus.py @@ -0,0 +1,50 @@ +"""In-process SSE event bus.""" +from __future__ import annotations + +import asyncio +import json +from datetime import datetime, timezone +from typing import Any + + +class EventBus: + def __init__(self) -> None: + self._subscribers: list[asyncio.Queue[dict[str, Any]]] = [] + self._lock = asyncio.Lock() + self.recent: list[dict[str, Any]] = [] + + async def subscribe(self) -> asyncio.Queue[dict[str, Any]]: + q: asyncio.Queue[dict[str, Any]] = asyncio.Queue(maxsize=256) + async with self._lock: + self._subscribers.append(q) + return q + + async def unsubscribe(self, q: asyncio.Queue[dict[str, Any]]) -> None: + async with self._lock: + if q in self._subscribers: + self._subscribers.remove(q) + + async def publish(self, event_type: str, data: dict[str, Any] | None = None) -> None: + event = { + "type": event_type, + "data": data or {}, + "ts": datetime.now(timezone.utc).isoformat(), + } + self.recent.append(event) + if len(self.recent) > 200: + self.recent = self.recent[-200:] + async with self._lock: + dead: list[asyncio.Queue[dict[str, Any]]] = [] + for q in self._subscribers: + try: + q.put_nowait(event) + except asyncio.QueueFull: + dead.append(q) + for q in dead: + self._subscribers.remove(q) + + def format_sse(self, event: dict[str, Any]) -> str: + return f"event: {event['type']}\ndata: {json.dumps(event)}\n\n" + + +event_bus = EventBus() diff --git a/calliope-backend/src/calliope/export/__init__.py b/calliope-backend/src/calliope/export/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/calliope-backend/src/calliope/export/runner.py b/calliope-backend/src/calliope/export/runner.py new file mode 100644 index 00000000..0c941649 --- /dev/null +++ b/calliope-backend/src/calliope/export/runner.py @@ -0,0 +1,281 @@ +"""Film export: stitch a project's scene clips into one mp4 via ffmpeg. + +Pipeline (validated on real clips — do not reinvent): normalize each clip → +0.5s crossfades (xfade/acrossfade) → loudness normalize. ComfyUI is never +involved; export jobs run locally against files on disk. +""" +from __future__ import annotations + +import asyncio +import json +import logging +import re +import shutil +import time +from pathlib import Path +from typing import Any + +from calliope import config +from calliope.comfyui.dry_run import write_placeholder_mp4 +from calliope.db import get_db, row_to_dict + +logger = logging.getLogger("calliope.export") + +# Normalization targets — every clip is conformed to these before stitching. +EXPORT_WIDTH = 1920 +EXPORT_HEIGHT = 1080 +EXPORT_FPS = 30 +XFADE_SEC = 0.5 +PROGRESS_MIN_INTERVAL_SEC = 1.0 + +_running: dict[int, asyncio.subprocess.Process] = {} + + +def kill_running(job_id: int) -> bool: + """Kill the ffmpeg process for a running export job. False when none.""" + proc = _running.get(job_id) + if not proc or proc.returncode is not None: + return False + try: + proc.kill() + except ProcessLookupError: + return False + return True + + +def _require_binary(name: str) -> str: + path = shutil.which(name) + if not path: + raise RuntimeError(f"{name} not found on PATH — install ffmpeg to enable film export.") + return path + + +def slugify(title: str) -> str: + slug = re.sub(r"[^a-z0-9]+", "-", title.lower()).strip("-") + return slug or "film" + + +def collect_clips(project_id: int) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]: + """Scenes in story order, split into (with video_path, without).""" + conn = get_db(config.settings.db_path) + try: + rows = conn.execute( + "SELECT * FROM scenes WHERE project_id = ? ORDER BY order_index", + (project_id,), + ).fetchall() + scenes = [row_to_dict(r) for r in rows] + finally: + conn.close() + with_clip = [s for s in scenes if s.get("video_path")] + skipped = [s for s in scenes if not s.get("video_path")] + return with_clip, skipped + + +def _project_title(project_id: int) -> str: + conn = get_db(config.settings.db_path) + try: + row = conn.execute("SELECT title FROM projects WHERE id = ?", (project_id,)).fetchone() + return row["title"] if row else f"project-{project_id}" + finally: + conn.close() + + +async def probe(path: str | Path) -> dict[str, Any]: + """ffprobe a clip: duration (float seconds) and has_audio (bool).""" + ffprobe = _require_binary("ffprobe") + proc = await asyncio.create_subprocess_exec( + ffprobe, + "-v", + "error", + "-show_entries", + "format=duration:stream=codec_type", + "-of", + "json", + str(path), + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + out, err = await proc.communicate() + if proc.returncode != 0: + tail = err.decode("utf-8", "replace")[-500:] + raise RuntimeError(f"ffprobe failed for {path}: {tail}") + data = json.loads(out.decode("utf-8", "replace") or "{}") + duration = float((data.get("format") or {}).get("duration") or 0.0) + has_audio = any(s.get("codec_type") == "audio" for s in data.get("streams") or []) + return {"duration": duration, "has_audio": has_audio} + + +def build_ffmpeg_cmd( + clips: list[dict[str, Any]], + probes: list[dict[str, Any]], + dest: str | Path, +) -> list[str]: + """Assemble the validated normalize → xfade → loudnorm ffmpeg command.""" + if not clips: + raise RuntimeError("No clips to export") + if len(clips) != len(probes): + raise ValueError("clips and probes must align") + + n = len(clips) + ffmpeg = shutil.which("ffmpeg") or "ffmpeg" + cmd: list[str] = [ffmpeg, "-nostdin", "-nostats", "-progress", "pipe:1", "-y"] + for clip in clips: + cmd += ["-i", str(clip["video_path"])] + # Silent clips get a lavfi silence donor input, appended after the clip inputs + # so input indices for real clips stay 0..n-1. + lavfi_index: dict[int, int] = {} + next_index = n + for i, p in enumerate(probes): + if not p["has_audio"]: + lavfi_index[i] = next_index + next_index += 1 + cmd += ["-f", "lavfi", "-i", "anullsrc=cl=stereo:r=48000"] + + v_chain = ( + f"scale={EXPORT_WIDTH}:{EXPORT_HEIGHT}:force_original_aspect_ratio=decrease," + f"pad={EXPORT_WIDTH}:{EXPORT_HEIGHT}:(ow-iw)/2:(oh-ih)/2," + f"setsar=1,fps={EXPORT_FPS},settb=AVTB" + ) + a_chain = "aformat=sample_rates=48000:channel_layouts=stereo" + + filters: list[str] = [] + for i, p in enumerate(probes): + filters.append(f"[{i}:v]{v_chain}[v{i}]") + if p["has_audio"]: + filters.append(f"[{i}:a]{a_chain}[a{i}]") + else: + filters.append( + f"[{lavfi_index[i]}:a]atrim=duration={float(p['duration']):.3f}," + f"asetpts=PTS-STARTPTS,{a_chain}[a{i}]" + ) + + durations = [float(p["duration"]) for p in probes] + if n == 1: + # Single clip: no crossfade, but same normalize + loudness treatment. + filters.append("[v0]format=yuv420p[vout]") + filters.append("[a0]loudnorm=I=-16:TP=-1.5:LRA=11[aout]") + else: + for k in range(1, n): + offset = sum(durations[:k]) - k * XFADE_SEC + vin = "[v0]" if k == 1 else f"[x{k - 1}]" + ain = "[a0]" if k == 1 else f"[c{k - 1}]" + filters.append( + f"{vin}[v{k}]xfade=transition=fade:duration={XFADE_SEC}:offset={offset:.3f}[x{k}]" + ) + filters.append(f"{ain}[a{k}]acrossfade=d={XFADE_SEC}:c1=tri:c2=tri[c{k}]") + # format=yuv420p AFTER the final xfade — the chain renegotiates to + # yuv444p otherwise and players choke on the result. + filters.append(f"[x{n - 1}]format=yuv420p[vout]") + filters.append(f"[c{n - 1}]loudnorm=I=-16:TP=-1.5:LRA=11[aout]") + + cmd += ["-filter_complex", ";".join(filters)] + cmd += ["-map", "[vout]", "-map", "[aout]"] + cmd += [ + "-c:v", + "libx264", + "-preset", + "medium", + "-crf", + "20", + "-c:a", + "aac", + "-b:a", + "192k", + "-movflags", + "+faststart", + str(dest), + ] + return cmd + + +async def run_export( + job: dict[str, Any], + payload: dict[str, Any], + bus: Any, + *, + dry_run: bool = False, +) -> list[str]: + """Run one export job; returns the output mp4 path list.""" + project_id = job["project_id"] + job_id = job["id"] + clips, skipped = collect_clips(project_id) + if not clips: + raise RuntimeError("No scene clips to export — generate videos first") + + for scene in skipped: + heading = (scene.get("heading") or f"Scene {scene.get('order_index')}").strip() + await bus.publish( + "job.progress", + { + "job_id": job_id, + "kind": "export", + "message": f"Skipping scene «{heading}» — no clip", + }, + ) + + dest_dir = Path(config.settings.assets_dir) / str(project_id) / "export" + dest_dir.mkdir(parents=True, exist_ok=True) + dest = dest_dir / f"{slugify(_project_title(project_id))}-job{job_id}.mp4" + + if dry_run: + write_placeholder_mp4(dest, label=f"job-{job_id}-export") + return [str(dest)] + + _require_binary("ffmpeg") + probes = [await probe(clip["video_path"]) for clip in clips] + durations = [float(p["duration"]) for p in probes] + total_us = (sum(durations) - XFADE_SEC * max(0, len(clips) - 1)) * 1_000_000 + + cmd = build_ffmpeg_cmd(clips, probes, dest) + logger.info("Export job %s: %s", job_id, " ".join(cmd)) + + await bus.publish( + "job.progress", + {"job_id": job_id, "kind": "export", "percent": 0.0, "message": "Exporting film…"}, + ) + last_publish = time.monotonic() + + proc = await asyncio.create_subprocess_exec( + *cmd, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + _running[job_id] = proc + try: + assert proc.stdout is not None and proc.stderr is not None + # Drain stderr concurrently — a full pipe buffer would deadlock ffmpeg. + stderr_task = asyncio.create_task(proc.stderr.read()) + while True: + line = await proc.stdout.readline() + if not line: + break + text = line.decode("utf-8", "replace").strip() + if not text.startswith("out_time_us="): + continue + try: + out_us = int(text.split("=", 1)[1]) + except ValueError: + continue + now = time.monotonic() + if now - last_publish < PROGRESS_MIN_INTERVAL_SEC: + continue + last_publish = now + percent = min(99.0, max(0.0, out_us / total_us * 100.0)) if total_us > 0 else 0.0 + await bus.publish( + "job.progress", + { + "job_id": job_id, + "kind": "export", + "percent": round(percent, 1), + "message": "Exporting film…", + }, + ) + stderr_bytes = await stderr_task + returncode = await proc.wait() + finally: + _running.pop(job_id, None) + + if returncode != 0: + tail = stderr_bytes.decode("utf-8", "replace")[-2000:] + raise RuntimeError(f"ffmpeg export failed (exit {returncode}): {tail}") + return [str(dest)] diff --git a/calliope-backend/src/calliope/main.py b/calliope-backend/src/calliope/main.py new file mode 100644 index 00000000..ee0868a7 --- /dev/null +++ b/calliope-backend/src/calliope/main.py @@ -0,0 +1,120 @@ +from __future__ import annotations + +import logging +import sys +from contextlib import asynccontextmanager +from pathlib import Path + +from fastapi import FastAPI, HTTPException +from fastapi.middleware.cors import CORSMiddleware +from fastapi.staticfiles import StaticFiles + +from calliope.config import settings +from calliope.db import get_db, migrate_db, rebase_stale_asset_paths +from calliope.queue.worker import queue_worker +from calliope.routers import ( + assets, + events, + jobs, + playground, + projects, + scenes, + settings as settings_router, + story, + workflows, +) + +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s | %(levelname)s | %(name)s | %(message)s", +) +logger = logging.getLogger("calliope") + + +@asynccontextmanager +async def lifespan(app: FastAPI): + settings.data_dir.mkdir(parents=True, exist_ok=True) + settings.assets_dir.mkdir(parents=True, exist_ok=True) + await migrate_db(settings.db_path) + # Folder moved? Stored asset paths still point at the old install root — + # rebase them onto the current data dir before serving anything. + conn = get_db(settings.db_path) + try: + rebased = rebase_stale_asset_paths(conn, settings.data_dir, settings.assets_dir) + if rebased: + conn.commit() + logger.info( + "Rebased %s asset path(s) from a previous install location onto %s", + rebased, + settings.data_dir, + ) + finally: + conn.close() + await queue_worker.start() + logger.info("Calliope started — db=%s dry_run=%s", settings.db_path, settings.dry_run) + yield + await queue_worker.stop() + logger.info("Calliope shutting down") + + +def create_app() -> FastAPI: + app = FastAPI(title="Calliope", version="1.1.0", lifespan=lifespan) + + app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], + ) + + app.include_router(projects.router, prefix="/api/projects", tags=["projects"]) + app.include_router(settings_router.router, prefix="/api/settings", tags=["settings"]) + app.include_router(story.router, prefix="/api/projects", tags=["story"]) + app.include_router(scenes.router, prefix="/api/projects", tags=["scenes"]) + app.include_router(assets.router, prefix="/api", tags=["assets"]) + app.include_router(workflows.router, prefix="/api/workflows", tags=["workflows"]) + app.include_router(jobs.router, prefix="/api/jobs", tags=["jobs"]) + app.include_router(playground.router, prefix="/api/playground", tags=["playground"]) + app.include_router(events.router, prefix="/api/events", tags=["events"]) + + @app.get("/api/health") + async def health() -> dict: + return {"status": "ok", "version": "1.1.0", "dry_run": settings.dry_run} + + # Catch unknown /api/* before StaticFiles — otherwise POST falls through and + # returns a confusing 405 Method Not Allowed from the file server. + @app.api_route( + "/api/{full_path:path}", + methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"], + include_in_schema=False, + ) + async def api_not_found(full_path: str) -> None: + raise HTTPException(status_code=404, detail=f"API route not found: /api/{full_path}") + + static_dir = Path(__file__).resolve().parent / "static" + if static_dir.exists(): + app.mount("/", StaticFiles(directory=static_dir, html=True), name="static") + + return app + + +def main() -> int: + import argparse + + parser = argparse.ArgumentParser(description="Calliope backend server") + parser.add_argument("--host", default=None, help="Bind host (default: from config)") + parser.add_argument("--port", type=int, default=None, help="Bind port (default: from config)") + args = parser.parse_args() + + host = args.host or settings.host + port = args.port or settings.port + + app = create_app() + uvicorn = __import__("uvicorn") + uvicorn.run(app, host=host, port=port) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/calliope-backend/src/calliope/models/__init__.py b/calliope-backend/src/calliope/models/__init__.py new file mode 100644 index 00000000..f3d9f4b1 --- /dev/null +++ b/calliope-backend/src/calliope/models/__init__.py @@ -0,0 +1 @@ +# Models package diff --git a/calliope-backend/src/calliope/models/schemas.py b/calliope-backend/src/calliope/models/schemas.py new file mode 100644 index 00000000..5d033f23 --- /dev/null +++ b/calliope-backend/src/calliope/models/schemas.py @@ -0,0 +1,188 @@ +from __future__ import annotations + +from datetime import datetime +from typing import Any, Literal + +from pydantic import BaseModel, ConfigDict, Field + + +class ProjectCreate(BaseModel): + title: str = Field(..., min_length=1, max_length=200) + idea: str | None = None + genre: str | None = None + tone: str | None = None + target_duration: str | None = None + + +class ProjectUpdate(BaseModel): + title: str | None = Field(None, min_length=1, max_length=200) + idea: str | None = None + genre: str | None = None + tone: str | None = None + target_duration: str | None = None + cover_path: str | None = None + status: str | None = None + + +class ProjectStats(BaseModel): + scene_count: int + character_count: int + asset_ready_count: int + asset_total_count: int + + +class Project(BaseModel): + id: int + title: str + idea: str | None + genre: str | None + tone: str | None + target_duration: str | None + cover_path: str | None = None + status: str + created_at: datetime + updated_at: datetime + stats: ProjectStats | None = None + + model_config = ConfigDict(from_attributes=True) + + +class ProjectList(BaseModel): + projects: list[Project] + + +class ProjectStats(BaseModel): + scene_count: int = 0 + character_count: int = 0 + asset_ready_count: int = 0 + asset_total_count: int = 0 + + +class BeatCreate(BaseModel): + order_index: int = 0 + title: str = Field(..., min_length=1) + description: str | None = None + + +class BeatUpdate(BaseModel): + order_index: int | None = None + title: str | None = None + description: str | None = None + + +class CharacterCreate(BaseModel): + name: str = Field(..., min_length=1) + role: str | None = None + age: str | None = None + appearance: str | None = None + personality: str | None = None + consistency_prompt: str | None = None + + +class CharacterUpdate(BaseModel): + name: str | None = None + role: str | None = None + age: str | None = None + appearance: str | None = None + personality: str | None = None + consistency_prompt: str | None = None + portrait_path: str | None = None + sheet_path: str | None = None + + +class LocationCreate(BaseModel): + name: str = Field(..., min_length=1) + description: str | None = None + consistency_prompt: str | None = None + + +class LocationUpdate(BaseModel): + name: str | None = None + description: str | None = None + consistency_prompt: str | None = None + reference_image_path: str | None = None + + +class SceneCreate(BaseModel): + order_index: int = 0 + heading: str | None = None + action: str | None = None + dialog: str | None = None + duration_sec: int | None = None + workflow_id: int | None = None + env_image_path: str | None = None + beat_id: int | None = None + character_ids: list[int] = Field(default_factory=list) + location_id: int | None = None + + +class SceneUpdate(BaseModel): + order_index: int | None = None + heading: str | None = None + action: str | None = None + dialog: str | None = None + duration_sec: int | None = None + workflow_id: int | None = None + env_image_path: str | None = None + beat_id: int | None = None + character_ids: list[int] | None = None + location_id: int | None = None + video_path: str | None = None + + +class SceneReorder(BaseModel): + scene_ids: list[int] + + +class WorkflowCreate(BaseModel): + name: str = Field(..., min_length=1) + kind: Literal["image", "video"] = "image" + workflow_json: dict[str, Any] + description: str | None = None + prompt_profile: Literal["prose", "minimax_h3_ref"] | None = None + + +class WorkflowUpdate(BaseModel): + name: str | None = None + kind: Literal["image", "video"] | None = None + description: str | None = None + prompt_profile: Literal["prose", "minimax_h3_ref"] | None = None + is_enabled: bool | None = None + + +class WorkflowAnalyze(BaseModel): + workflow_json: dict[str, Any] + + +class JobCreate(BaseModel): + scene_id: int | None = None + kind: str + workflow_id: int | None = None + input_values: dict[str, Any] | None = None + character_id: int | None = None + location_id: int | None = None + + +class GenerateAssetsRequest(BaseModel): + character_ids: list[int] | None = None + location_ids: list[int] | None = None + missing_only: bool = True + workflow_id: int | None = None + input_values: dict[str, Any] | None = None + # For characters: which image slot to write. Default/UI is "sheet" only + # (sheet includes face close-up). "portrait" remains for legacy queued jobs. + asset_target: str | None = "sheet" + # Optional one-shot prompt override (must still be user-visible text from the UI). + prompt: str | None = None + + +class GenerateScenesRequest(BaseModel): + replace: bool = True + # When set (or inferred from existing scenes), regenerate must produce at least this many. + scene_count: int | None = None + + +class GenerateVideosRequest(BaseModel): + scene_ids: list[int] | None = None + workflow_id: int | None = None + input_values: dict[str, Any] | None = None diff --git a/calliope-backend/src/calliope/queue/__init__.py b/calliope-backend/src/calliope/queue/__init__.py new file mode 100644 index 00000000..32bc6aa0 --- /dev/null +++ b/calliope-backend/src/calliope/queue/__init__.py @@ -0,0 +1,4 @@ +from calliope.queue.manager import QueueManager, queue_manager +from calliope.queue.worker import QueueWorker, queue_worker + +__all__ = ["QueueManager", "queue_manager", "QueueWorker", "queue_worker"] diff --git a/calliope-backend/src/calliope/queue/manager.py b/calliope-backend/src/calliope/queue/manager.py new file mode 100644 index 00000000..b53ea888 --- /dev/null +++ b/calliope-backend/src/calliope/queue/manager.py @@ -0,0 +1,187 @@ +"""SQLite-backed job queue manager.""" +from __future__ import annotations + +import json +import logging +from typing import Any + +from calliope import config +from calliope.db import get_db, row_to_dict + +logger = logging.getLogger("calliope.queue") + + +class QueueManager: + def __init__(self) -> None: + self.paused = False + + def reset_stale_jobs(self) -> int: + conn = get_db(config.settings.db_path) + try: + cur = conn.execute( + "UPDATE jobs SET status = 'pending', started_at = NULL WHERE status = 'running'" + ) + conn.commit() + return cur.rowcount + finally: + conn.close() + + def enqueue( + self, + *, + project_id: int, + kind: str, + workflow_id: int | None = None, + scene_id: int | None = None, + payload: dict[str, Any] | None = None, + ) -> dict[str, Any]: + conn = get_db(config.settings.db_path) + try: + cur = conn.execute( + """ + INSERT INTO jobs (project_id, scene_id, kind, workflow_id, status, payload_json) + VALUES (?, ?, ?, ?, 'pending', ?) + """, + (project_id, scene_id, kind, workflow_id, json.dumps(payload or {})), + ) + conn.commit() + row = conn.execute("SELECT * FROM jobs WHERE id = ?", (cur.lastrowid,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + def claim_next(self) -> dict[str, Any] | None: + if self.paused: + return None + conn = get_db(config.settings.db_path) + try: + row = conn.execute( + "SELECT * FROM jobs WHERE status = 'pending' ORDER BY created_at ASC LIMIT 1" + ).fetchone() + if not row: + return None + job_id = row["id"] + conn.execute( + """ + UPDATE jobs SET status = 'running', started_at = CURRENT_TIMESTAMP + WHERE id = ? AND status = 'pending' + """, + (job_id,), + ) + conn.commit() + claimed = conn.execute("SELECT * FROM jobs WHERE id = ?", (job_id,)).fetchone() + return row_to_dict(claimed) if claimed else None + finally: + conn.close() + + def mark_done(self, job_id: int, output_paths: list[str]) -> None: + conn = get_db(config.settings.db_path) + try: + conn.execute( + """ + UPDATE jobs SET status = 'done', output_paths_json = ?, error = NULL, + completed_at = CURRENT_TIMESTAMP WHERE id = ? + """, + (json.dumps(output_paths), job_id), + ) + conn.commit() + finally: + conn.close() + + def mark_failed(self, job_id: int, error: str) -> None: + conn = get_db(config.settings.db_path) + try: + conn.execute( + """ + UPDATE jobs SET status = 'failed', error = ?, completed_at = CURRENT_TIMESTAMP, + retry_count = retry_count + 1 WHERE id = ? + """, + (error[:2000], job_id), + ) + conn.commit() + finally: + conn.close() + + def retry(self, job_id: int) -> dict[str, Any] | None: + conn = get_db(config.settings.db_path) + try: + row = conn.execute("SELECT * FROM jobs WHERE id = ?", (job_id,)).fetchone() + if not row: + return None + conn.execute( + """ + UPDATE jobs SET status = 'pending', error = NULL, started_at = NULL, + completed_at = NULL WHERE id = ? + """, + (job_id,), + ) + conn.commit() + return row_to_dict( + conn.execute("SELECT * FROM jobs WHERE id = ?", (job_id,)).fetchone() + ) + finally: + conn.close() + + def cancel(self, job_id: int) -> bool: + conn = get_db(config.settings.db_path) + try: + cur = conn.execute( + """ + UPDATE jobs SET status = 'failed', error = 'cancelled', + completed_at = CURRENT_TIMESTAMP + WHERE id = ? AND status IN ('pending', 'running') + """, + (job_id,), + ) + conn.commit() + return cur.rowcount > 0 + finally: + conn.close() + + def list_jobs( + self, project_id: int | None = None, status: str | None = None, limit: int = 100 + ) -> list[dict[str, Any]]: + conn = get_db(config.settings.db_path) + try: + clauses: list[str] = [] + params: list[Any] = [] + if project_id is not None: + clauses.append("project_id = ?") + params.append(project_id) + if status: + clauses.append("status = ?") + params.append(status) + where = f"WHERE {' AND '.join(clauses)}" if clauses else "" + params.append(limit) + rows = conn.execute( + f"SELECT * FROM jobs {where} ORDER BY created_at DESC LIMIT ?", + params, + ).fetchall() + return [row_to_dict(r) for r in rows] + finally: + conn.close() + + def get_job(self, job_id: int) -> dict[str, Any] | None: + conn = get_db(config.settings.db_path) + try: + row = conn.execute("SELECT * FROM jobs WHERE id = ?", (job_id,)).fetchone() + return row_to_dict(row) if row else None + finally: + conn.close() + + def delete_job(self, job_id: int) -> dict[str, Any] | None: + """Remove job row. Returns the deleted job dict, or None if missing.""" + conn = get_db(config.settings.db_path) + try: + row = conn.execute("SELECT * FROM jobs WHERE id = ?", (job_id,)).fetchone() + if not row: + return None + job = row_to_dict(row) + conn.execute("DELETE FROM jobs WHERE id = ?", (job_id,)) + conn.commit() + return job + finally: + conn.close() + + +queue_manager = QueueManager() diff --git a/calliope-backend/src/calliope/queue/worker.py b/calliope-backend/src/calliope/queue/worker.py new file mode 100644 index 00000000..e0399aa0 --- /dev/null +++ b/calliope-backend/src/calliope/queue/worker.py @@ -0,0 +1,294 @@ +"""Background queue worker loop.""" +from __future__ import annotations + +import asyncio +import json +import logging +from typing import Any + +from calliope import config +from calliope.comfyui.client import ComfyUIClient +from calliope.comfyui.dry_run import write_placeholder_mp4, write_placeholder_png +from calliope.comfyui.patcher import patch_workflow +from calliope.db import get_db +from calliope.events.bus import event_bus +from calliope.export.runner import run_export +from calliope.queue.manager import queue_manager + +logger = logging.getLogger("calliope.worker") + + +class QueueWorker: + def __init__(self) -> None: + self._task: asyncio.Task | None = None + self._stop = asyncio.Event() + + async def start(self) -> None: + reset = queue_manager.reset_stale_jobs() + if reset: + logger.info("Reset %s stale running jobs to pending", reset) + self._stop.clear() + self._task = asyncio.create_task(self._loop(), name="calliope-queue-worker") + + async def stop(self) -> None: + self._stop.set() + if self._task: + await asyncio.wait([self._task], timeout=5) + + async def _loop(self) -> None: + logger.info("Queue worker started") + while not self._stop.is_set(): + try: + if queue_manager.paused: + await asyncio.sleep(config.settings.queue_poll_interval_sec) + continue + job = queue_manager.claim_next() + if not job: + await asyncio.sleep(config.settings.queue_poll_interval_sec) + continue + await event_bus.publish( + "job.started", + { + "job_id": job["id"], + "kind": job["kind"], + "project_id": job.get("project_id"), + "message": self._job_label(job), + }, + ) + try: + outputs = await self._run_job(job) + queue_manager.mark_done(job["id"], outputs) + if job["kind"] == "export": + self._mark_project_completed(job["project_id"]) + await event_bus.publish( + "job.completed", + { + "job_id": job["id"], + "kind": job["kind"], + "outputs": outputs, + "project_id": job["project_id"], + "message": f"{self._job_label(job)} · {len(outputs)} file(s)", + }, + ) + if outputs: + await event_bus.publish( + "asset.ready", + { + "job_id": job["id"], + "kind": job["kind"], + "paths": outputs, + "project_id": job["project_id"], + "message": f"Saved {self._job_label(job)}", + }, + ) + except Exception as exc: + logger.exception("Job %s failed", job["id"]) + queue_manager.mark_failed(job["id"], str(exc)) + await event_bus.publish( + "job.failed", + { + "job_id": job["id"], + "kind": job["kind"], + "error": str(exc), + "project_id": job.get("project_id"), + "message": f"{self._job_label(job)} failed", + }, + ) + except Exception: + logger.exception("Worker loop error") + await asyncio.sleep(config.settings.queue_poll_interval_sec) + logger.info("Queue worker stopped") + + async def _run_job(self, job: dict[str, Any]) -> list[str]: + payload = json.loads(job["payload_json"] or "{}") + project_id = job["project_id"] + kind = job["kind"] + use_dry = bool(config.settings.dry_run) + + if kind == "export": + # Export stitches local clips with ffmpeg — never touches ComfyUI, + # and dry-run writes an mp4 placeholder (not the default PNG). + return await run_export(job, payload, event_bus, dry_run=use_dry) + + client = ComfyUIClient(config.settings.comfyui_base_url) + try: + if use_dry: + return await self._dry_run(job, payload) + + healthy = await client.health() + if not healthy: + raise RuntimeError( + f"ComfyUI unreachable at {config.settings.comfyui_base_url}. " + "Start ComfyUI, or enable Dry-run in Settings only for placeholder testing." + ) + + workflow_id = job.get("workflow_id") or payload.get("workflow_id") + workflow = self._load_workflow(workflow_id) + if not workflow: + raise RuntimeError("No workflow found for job") + + input_values = payload.get("input_values") or {} + patched = patch_workflow(workflow, input_values) + patched = await client.prepare_media_inputs(patched) + prompt_id = await client.queue_prompt(patched) + + history = await self._poll_history(client, prompt_id) + if not history: + raise RuntimeError("Timed out waiting for ComfyUI history") + + status = history.get("status") or {} + if status.get("status_str") == "error" or status.get("completed") is False: + messages = status.get("messages") or [] + raise RuntimeError(f"ComfyUI error: {messages}") + + outputs_meta = client.extract_outputs(history) + dest_dir = config.settings.assets_dir / str(project_id) / kind + dest_dir.mkdir(parents=True, exist_ok=True) + paths: list[str] = [] + for meta in outputs_meta: + filename = meta["filename"] + dest = dest_dir / filename + await client.download_image( + filename, + subfolder=meta.get("subfolder", ""), + folder_type=meta.get("type", "output"), + dest=dest, + ) + paths.append(str(dest)) + + self._apply_outputs_to_entities(job, payload, paths) + return paths + finally: + await client.close() + + async def _dry_run(self, job: dict[str, Any], payload: dict[str, Any]) -> list[str]: + project_id = job["project_id"] + kind = job["kind"] + dest_dir = config.settings.assets_dir / str(project_id) / kind + dest_dir.mkdir(parents=True, exist_ok=True) + label = f"job-{job['id']}-{kind}" + if kind == "video": + path = write_placeholder_mp4(dest_dir / f"{label}.mp4", label=label) + else: + path = write_placeholder_png(dest_dir / f"{label}.png", label=label) + paths = [str(path)] + self._apply_outputs_to_entities(job, payload, paths) + await asyncio.sleep(0.3) + return paths + + async def _poll_history(self, client: ComfyUIClient, prompt_id: str) -> dict[str, Any] | None: + attempts = int(600 / max(config.settings.queue_poll_interval_sec, 0.5)) + for _ in range(attempts): + if self._stop.is_set(): + return None + history = await client.get_history(prompt_id) + if history: + return history + await asyncio.sleep(config.settings.queue_poll_interval_sec) + await event_bus.publish( + "job.progress", + { + "prompt_id": prompt_id, + "message": f"Waiting on ComfyUI ({prompt_id[:8]}…)", + }, + ) + return None + + def _mark_project_completed(self, project_id: int) -> None: + """A finished export closes the project lifecycle.""" + conn = get_db(config.settings.db_path) + try: + conn.execute( + "UPDATE projects SET status = 'completed' WHERE id = ? AND status != 'completed'", + (project_id,), + ) + conn.commit() + finally: + conn.close() + + def _load_workflow(self, workflow_id: int | None) -> dict[str, Any] | None: + if not workflow_id: + return None + conn = get_db(config.settings.db_path) + try: + row = conn.execute( + "SELECT workflow_json FROM workflows WHERE id = ?", (workflow_id,) + ).fetchone() + if not row: + return None + return json.loads(row["workflow_json"]) + finally: + conn.close() + + def _job_label(self, job: dict[str, Any]) -> str: + payload = json.loads(job.get("payload_json") or "{}") + kind = job.get("kind") or "job" + if kind == "export": + return "Export film" + conn = get_db(config.settings.db_path) + try: + if payload.get("character_id"): + row = conn.execute( + "SELECT name FROM characters WHERE id = ?", (payload["character_id"],) + ).fetchone() + name = row["name"] if row else f"#{payload['character_id']}" + target = payload.get("asset_target") or "sheet" + return f"{name} · {target}" + if payload.get("location_id"): + row = conn.execute( + "SELECT name FROM locations WHERE id = ?", (payload["location_id"],) + ).fetchone() + name = row["name"] if row else f"#{payload['location_id']}" + return f"{name} · environment" + if job.get("scene_id"): + row = conn.execute( + "SELECT heading, order_index FROM scenes WHERE id = ?", (job["scene_id"],) + ).fetchone() + if row: + heading = (row["heading"] or f"Scene {row['order_index']}").strip() + return f"Scene · {heading}" + return f"Scene #{job['scene_id']}" + finally: + conn.close() + return f"{kind} #{job.get('id')}" + + def _apply_outputs_to_entities( + self, job: dict[str, Any], payload: dict[str, Any], paths: list[str] + ) -> None: + if not paths: + return + primary = paths[0] + character_id = payload.get("character_id") + location_id = payload.get("location_id") + scene_id = job.get("scene_id") + conn = get_db(config.settings.db_path) + try: + if character_id: + target = payload.get("asset_target") or "sheet" + if target == "portrait": + # Legacy jobs only — UI no longer generates portraits + conn.execute( + "UPDATE characters SET portrait_path = ? WHERE id = ?", + (primary, character_id), + ) + else: + conn.execute( + "UPDATE characters SET sheet_path = ? WHERE id = ?", + (primary, character_id), + ) + if location_id: + conn.execute( + "UPDATE locations SET reference_image_path = ? WHERE id = ?", + (primary, location_id), + ) + if scene_id and job["kind"] == "video": + conn.execute( + "UPDATE scenes SET video_path = ? WHERE id = ?", + (primary, scene_id), + ) + conn.commit() + finally: + conn.close() + + +queue_worker = QueueWorker() diff --git a/calliope-backend/src/calliope/routers/__init__.py b/calliope-backend/src/calliope/routers/__init__.py new file mode 100644 index 00000000..873f7bbb --- /dev/null +++ b/calliope-backend/src/calliope/routers/__init__.py @@ -0,0 +1 @@ +# Routers package diff --git a/calliope-backend/src/calliope/routers/assets.py b/calliope-backend/src/calliope/routers/assets.py new file mode 100644 index 00000000..87c6fcc1 --- /dev/null +++ b/calliope-backend/src/calliope/routers/assets.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from pathlib import Path +from typing import Any + +from fastapi import APIRouter, HTTPException, Query +from fastapi.responses import FileResponse + +from calliope.agent.asset_agent import enqueue_asset_jobs +from calliope.config import settings +from calliope.db import get_db, row_to_dict +from calliope.models.schemas import GenerateAssetsRequest + +router = APIRouter() + + +@router.get("/projects/{project_id}/assets") +async def list_assets(project_id: int) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + project = conn.execute("SELECT id FROM projects WHERE id = ?", (project_id,)).fetchone() + if not project: + raise HTTPException(status_code=404, detail="Project not found") + characters = [ + row_to_dict(r) + for r in conn.execute( + "SELECT * FROM characters WHERE project_id = ?", (project_id,) + ).fetchall() + ] + locations = [ + row_to_dict(r) + for r in conn.execute( + "SELECT * FROM locations WHERE project_id = ?", (project_id,) + ).fetchall() + ] + return {"characters": characters, "locations": locations} + finally: + conn.close() + + +@router.post("/projects/{project_id}/generate-assets") +async def generate_assets(project_id: int, payload: GenerateAssetsRequest) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + if not conn.execute("SELECT id FROM projects WHERE id = ?", (project_id,)).fetchone(): + raise HTTPException(status_code=404, detail="Project not found") + finally: + conn.close() + jobs = await enqueue_asset_jobs( + project_id, + character_ids=payload.character_ids, + location_ids=payload.location_ids, + missing_only=payload.missing_only, + workflow_id=payload.workflow_id, + input_values_override=payload.input_values, + asset_target=payload.asset_target or "sheet", + prompt_override=payload.prompt, + ) + return {"ok": True, "jobs": jobs} + + +@router.get("/file") +async def get_asset_file(path: str = Query(...)) -> FileResponse: + assets_root = settings.assets_dir.resolve() + target = Path(path).resolve() + try: + target.relative_to(assets_root) + except ValueError as exc: + raise HTTPException(status_code=403, detail="Path outside assets directory") from exc + if not target.exists() or not target.is_file(): + raise HTTPException(status_code=404, detail="File not found") + return FileResponse(target) diff --git a/calliope-backend/src/calliope/routers/events.py b/calliope-backend/src/calliope/routers/events.py new file mode 100644 index 00000000..b3884534 --- /dev/null +++ b/calliope-backend/src/calliope/routers/events.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +import asyncio + +from fastapi import APIRouter, Request +from fastapi.responses import StreamingResponse + +from calliope.events.bus import event_bus + +router = APIRouter() + + +@router.get("") +async def events_stream(request: Request): + async def generator(): + q = await event_bus.subscribe() + try: + # Send recent backlog + for event in event_bus.recent[-20:]: + yield event_bus.format_sse(event) + while True: + if await request.is_disconnected(): + break + try: + event = await asyncio.wait_for(q.get(), timeout=15.0) + yield event_bus.format_sse(event) + except asyncio.TimeoutError: + yield ": keepalive\n\n" + finally: + await event_bus.unsubscribe(q) + + return StreamingResponse( + generator(), + media_type="text/event-stream", + headers={ + "Cache-Control": "no-cache", + "Connection": "keep-alive", + "X-Accel-Buffering": "no", + }, + ) diff --git a/calliope-backend/src/calliope/routers/jobs.py b/calliope-backend/src/calliope/routers/jobs.py new file mode 100644 index 00000000..13c2fd9a --- /dev/null +++ b/calliope-backend/src/calliope/routers/jobs.py @@ -0,0 +1,157 @@ +from __future__ import annotations + +import json +from typing import Any + +from fastapi import APIRouter, HTTPException, Query + +from calliope.agent.video_agent import enqueue_video_jobs +from calliope.comfyui.client import ComfyUIClient +from calliope.config import settings +from calliope.db import get_db +from calliope.events.bus import event_bus +from calliope.export.runner import kill_running +from calliope.models.schemas import GenerateVideosRequest, JobCreate +from calliope.queue.manager import queue_manager + +router = APIRouter() + + +def _job_public(job: dict[str, Any]) -> dict[str, Any]: + out = dict(job) + out["payload"] = json.loads(job.get("payload_json") or "{}") + out["output_paths"] = json.loads(job.get("output_paths_json") or "[]") + out.pop("payload_json", None) + out.pop("output_paths_json", None) + return out + + +@router.get("") +async def list_jobs( + project_id: int | None = None, + status: str | None = None, + limit: int = Query(100, ge=1, le=500), +) -> list[dict[str, Any]]: + return [_job_public(j) for j in queue_manager.list_jobs(project_id, status, limit)] + + +@router.get("/queue-status") +async def queue_status() -> dict[str, Any]: + return {"paused": queue_manager.paused} + + +@router.post("/pause") +async def pause_queue() -> dict[str, Any]: + queue_manager.paused = True + return {"ok": True, "paused": True} + + +@router.post("/resume") +async def resume_queue() -> dict[str, Any]: + queue_manager.paused = False + return {"ok": True, "paused": False} + + +@router.post("/projects/{project_id}/generate-videos") +async def generate_videos( + project_id: int, payload: GenerateVideosRequest | None = None +) -> dict[str, Any]: + body = payload or GenerateVideosRequest() + jobs = await enqueue_video_jobs( + project_id, + scene_ids=body.scene_ids, + workflow_id=body.workflow_id, + input_values_override=body.input_values, + ) + return {"ok": True, "jobs": [_job_public(j) for j in jobs]} + + +@router.post("/projects/{project_id}/export") +async def export_film(project_id: int) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + row = conn.execute( + "SELECT COUNT(*) AS n FROM scenes WHERE project_id = ? AND video_path IS NOT NULL", + (project_id,), + ).fetchone() + if not row or row["n"] == 0: + raise HTTPException( + status_code=400, + detail="No scene clips to export — generate videos first", + ) + # Supersede leftover pending exports so a re-Export always starts fresh + conn.execute( + """ + UPDATE jobs SET status = 'failed', error = 'superseded by new export', + completed_at = CURRENT_TIMESTAMP + WHERE project_id = ? AND kind = 'export' AND status = 'pending' + """, + (project_id,), + ) + # Commit BEFORE enqueue: queue_manager.enqueue writes on its own connection. + conn.commit() + finally: + conn.close() + job = queue_manager.enqueue(project_id=project_id, kind="export", payload={}) + await event_bus.publish( + "job.created", + { + "job_id": job["id"], + "kind": "export", + "message": "Export film", + "project_id": project_id, + }, + ) + return {"ok": True, "job": _job_public(job)} + + +@router.post("") +async def create_job(payload: JobCreate, project_id: int = Query(...)) -> dict[str, Any]: + job = queue_manager.enqueue( + project_id=project_id, + kind=payload.kind, + workflow_id=payload.workflow_id, + scene_id=payload.scene_id, + payload={ + "input_values": payload.input_values or {}, + "character_id": payload.character_id, + "location_id": payload.location_id, + }, + ) + return _job_public(job) + + +@router.get("/{job_id}") +async def get_job(job_id: int) -> dict[str, Any]: + job = queue_manager.get_job(job_id) + if not job: + raise HTTPException(status_code=404, detail="Job not found") + return _job_public(job) + + +@router.post("/{job_id}/retry") +async def retry_job(job_id: int) -> dict[str, Any]: + job = queue_manager.retry(job_id) + if not job: + raise HTTPException(status_code=404, detail="Job not found") + return _job_public(job) + + +@router.post("/{job_id}/cancel") +async def cancel_job(job_id: int) -> dict[str, Any]: + job = queue_manager.get_job(job_id) + if not job: + raise HTTPException(status_code=404, detail="Job not cancellable") + ok = queue_manager.cancel(job_id) + if not ok: + raise HTTPException(status_code=404, detail="Job not cancellable") + if job["kind"] == "export": + # Export runs local ffmpeg, not Comfy — kill the process instead. + kill_running(job_id) + else: + client = ComfyUIClient() + try: + await client.interrupt() + finally: + await client.close() + return {"ok": True} diff --git a/calliope-backend/src/calliope/routers/playground.py b/calliope-backend/src/calliope/routers/playground.py new file mode 100644 index 00000000..a6f54ef7 --- /dev/null +++ b/calliope-backend/src/calliope/routers/playground.py @@ -0,0 +1,395 @@ +"""Standalone ComfyUI playground — generate freely, attach favorites to projects.""" +from __future__ import annotations + +import json +import re +from datetime import datetime, timezone +from pathlib import Path +from typing import Any, Literal +from uuid import uuid4 + +from fastapi import APIRouter, File, HTTPException, UploadFile +from pydantic import BaseModel, Field + +from calliope import config +from calliope.db import get_db, row_to_dict +from calliope.events.bus import event_bus +from calliope.queue.manager import queue_manager + +router = APIRouter() + +PLAYGROUND_STATUS = "system" +PLAYGROUND_TITLE = "Playground Scratch" + + +class PlaygroundGenerate(BaseModel): + workflow_id: int + input_values: dict[str, Any] = Field(default_factory=dict) + + +class PlaygroundAttach(BaseModel): + path: str + project_id: int + target: Literal["character_sheet", "location", "scene"] + character_id: int | None = None + location_id: int | None = None + scene_id: int | None = None + + +def _job_public(job: dict[str, Any]) -> dict[str, Any]: + out = dict(job) + out["payload"] = json.loads(job.get("payload_json") or "{}") + out["output_paths"] = json.loads(job.get("output_paths_json") or "[]") + out.pop("payload_json", None) + out.pop("output_paths_json", None) + return out + + +def ensure_playground_project(conn) -> int: + row = conn.execute( + "SELECT id FROM projects WHERE status = ? ORDER BY id ASC LIMIT 1", + (PLAYGROUND_STATUS,), + ).fetchone() + if row: + return int(row["id"]) + cur = conn.execute( + """ + INSERT INTO projects (title, idea, status) + VALUES (?, ?, ?) + """, + ( + PLAYGROUND_TITLE, + "System scratch for ComfyUI playground jobs — hidden from project list", + PLAYGROUND_STATUS, + ), + ) + conn.commit() + return int(cur.lastrowid) + + +def _assert_path_in_assets(path: str) -> Path: + assets_root = config.settings.assets_dir.resolve() + target = Path(path).resolve() + try: + target.relative_to(assets_root) + except ValueError as exc: + raise HTTPException(status_code=403, detail="Path outside assets directory") from exc + if not target.exists() or not target.is_file(): + raise HTTPException(status_code=404, detail="File not found") + return target + + +def _safe_unlink_asset(path_str: str) -> bool: + """Delete a file if it resolves under assets_dir. Missing files count as already gone.""" + assets_root = config.settings.assets_dir.resolve() + try: + target = Path(path_str).resolve() + target.relative_to(assets_root) + except (ValueError, OSError): + return False + if not target.is_file(): + return False + try: + target.unlink() + return True + except OSError: + return False + + +UPLOAD_KIND_BY_EXT: dict[str, str] = { + ".png": "image", + ".jpg": "image", + ".jpeg": "image", + ".webp": "image", + ".gif": "image", + ".bmp": "image", + ".mp4": "video", + ".webm": "video", + ".mov": "video", + ".mkv": "video", + ".mp3": "audio", + ".wav": "audio", + ".flac": "audio", + ".ogg": "audio", + ".m4a": "audio", +} + +UPLOAD_CHUNK_SIZE = 1024 * 1024 # 1MB +UPLOAD_MAX_BYTES = 500 * 1024 * 1024 # 500MB +_UPLOAD_PREFIX_RE = re.compile(r"^[0-9a-f]{8}-") + + +def _kind_for_ext(ext: str) -> str | None: + return UPLOAD_KIND_BY_EXT.get(ext.lower()) + + +def _uploads_dir() -> Path: + return config.settings.assets_dir / "uploads" + + +def _safe_upload_name(filename: str) -> str: + return re.sub(r"[^A-Za-z0-9._-]", "_", filename) + + +def _upload_display_name(filename: str) -> str: + """Strip the uuid prefix written at upload time (``deadbeef-name.png`` → ``name.png``).""" + if _UPLOAD_PREFIX_RE.match(filename): + return filename[9:] + return filename + + +def _clear_entity_refs(conn, paths: list[str]) -> None: + """If playground outputs were attached to entities, clear those path columns.""" + for path in paths: + conn.execute("UPDATE characters SET portrait_path = NULL WHERE portrait_path = ?", (path,)) + conn.execute("UPDATE characters SET sheet_path = NULL WHERE sheet_path = ?", (path,)) + conn.execute( + "UPDATE locations SET reference_image_path = NULL WHERE reference_image_path = ?", + (path,), + ) + conn.execute("UPDATE scenes SET video_path = NULL WHERE video_path = ?", (path,)) + + +@router.get("/project") +async def playground_project() -> dict[str, Any]: + conn = get_db(config.settings.db_path) + try: + pid = ensure_playground_project(conn) + row = conn.execute("SELECT * FROM projects WHERE id = ?", (pid,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + +@router.get("/jobs") +async def list_playground_jobs(limit: int = 50) -> list[dict[str, Any]]: + conn = get_db(config.settings.db_path) + try: + pid = ensure_playground_project(conn) + finally: + conn.close() + return [_job_public(j) for j in queue_manager.list_jobs(pid, None, limit)] + + +@router.delete("/jobs/{job_id}") +async def delete_playground_job(job_id: int) -> dict[str, Any]: + """Delete a playground job row and its output files under assets_dir.""" + conn = get_db(config.settings.db_path) + try: + pid = ensure_playground_project(conn) + finally: + conn.close() + + job = queue_manager.get_job(job_id) + if not job: + raise HTTPException(status_code=404, detail="Job not found") + if int(job["project_id"]) != int(pid): + raise HTTPException(status_code=403, detail="Not a playground job") + + paths = json.loads(job.get("output_paths_json") or "[]") + if not isinstance(paths, list): + paths = [] + + deleted_files: list[str] = [] + missing_files: list[str] = [] + for p in paths: + if not isinstance(p, str) or not p.strip(): + continue + if _safe_unlink_asset(p): + deleted_files.append(p) + else: + missing_files.append(p) + + conn = get_db(config.settings.db_path) + try: + _clear_entity_refs(conn, [p for p in paths if isinstance(p, str)]) + conn.commit() + finally: + conn.close() + + removed = queue_manager.delete_job(job_id) + if not removed: + raise HTTPException(status_code=404, detail="Job not found") + + await event_bus.publish( + "job.deleted", + { + "job_id": job_id, + "source": "playground", + "deleted_files": deleted_files, + "missing_files": missing_files, + }, + ) + return { + "ok": True, + "job_id": job_id, + "deleted_files": deleted_files, + "missing_files": missing_files, + } + + +@router.post("/uploads") +async def upload_media(file: UploadFile = File(...)) -> dict[str, Any]: + """Store a client-provided media file under assets_dir/uploads for use as a job input.""" + original = Path(file.filename or "upload").name + ext = Path(original).suffix.lower() + kind = _kind_for_ext(ext) + if kind is None: + allowed = " ".join(sorted(UPLOAD_KIND_BY_EXT)) + raise HTTPException( + status_code=400, + detail=f"Unsupported file type '{ext or '(none)'}'. Allowed extensions: {allowed}", + ) + + uploads = _uploads_dir() + uploads.mkdir(parents=True, exist_ok=True) + dest = uploads / f"{uuid4().hex[:8]}-{_safe_upload_name(original)}" + + size = 0 + try: + with dest.open("wb") as out: + while chunk := await file.read(UPLOAD_CHUNK_SIZE): + size += len(chunk) + if size > UPLOAD_MAX_BYTES: + raise HTTPException(status_code=413, detail="File too large (max 500MB)") + out.write(chunk) + except Exception: + dest.unlink(missing_ok=True) + raise + + return {"ok": True, "path": str(dest.resolve()), "name": original, "kind": kind} + + +@router.get("/uploads") +async def list_uploaded_media() -> list[dict[str, Any]]: + """List previously uploaded media files, newest first.""" + uploads = _uploads_dir() + if not uploads.is_dir(): + return [] + entries: list[tuple[float, dict[str, Any]]] = [] + for f in uploads.iterdir(): + if not f.is_file(): + continue + kind = _kind_for_ext(f.suffix) + if kind is None: + continue + stat = f.stat() + entries.append( + ( + stat.st_mtime, + { + "name": _upload_display_name(f.name), + "path": str(f.resolve()), + "kind": kind, + "size": stat.st_size, + "mtime": datetime.fromtimestamp(stat.st_mtime, tz=timezone.utc).isoformat(), + }, + ) + ) + entries.sort(key=lambda e: e[0], reverse=True) + return [item for _, item in entries] + + +@router.post("/generate") +async def generate(payload: PlaygroundGenerate) -> dict[str, Any]: + conn = get_db(config.settings.db_path) + try: + pid = ensure_playground_project(conn) + wf = conn.execute( + "SELECT id, kind, is_enabled FROM workflows WHERE id = ?", + (payload.workflow_id,), + ).fetchone() + if not wf: + raise HTTPException(status_code=404, detail="Workflow not found") + if not wf["is_enabled"]: + raise HTTPException(status_code=400, detail="Workflow is disabled") + kind = wf["kind"] + finally: + conn.close() + + job = queue_manager.enqueue( + project_id=pid, + kind=kind, + workflow_id=payload.workflow_id, + scene_id=None, + payload={"input_values": payload.input_values, "source": "playground"}, + ) + await event_bus.publish( + "job.created", + {"job_id": job["id"], "kind": kind, "source": "playground", "project_id": pid}, + ) + return {"ok": True, "job": _job_public(job)} + + +@router.post("/attach") +async def attach_to_project(payload: PlaygroundAttach) -> dict[str, Any]: + path = str(_assert_path_in_assets(payload.path)) + conn = get_db(config.settings.db_path) + try: + project = conn.execute( + "SELECT id, status FROM projects WHERE id = ?", (payload.project_id,) + ).fetchone() + if not project: + raise HTTPException(status_code=404, detail="Project not found") + if project["status"] == PLAYGROUND_STATUS: + raise HTTPException(status_code=400, detail="Cannot attach to playground scratch") + + if payload.target == "character_sheet": + if not payload.character_id: + raise HTTPException(status_code=400, detail="character_id required") + char = conn.execute( + "SELECT id FROM characters WHERE id = ? AND project_id = ?", + (payload.character_id, payload.project_id), + ).fetchone() + if not char: + raise HTTPException(status_code=404, detail="Character not found") + conn.execute( + "UPDATE characters SET sheet_path = ? WHERE id = ?", + (path, payload.character_id), + ) + elif payload.target == "location": + if not payload.location_id: + raise HTTPException(status_code=400, detail="location_id required") + loc = conn.execute( + "SELECT id FROM locations WHERE id = ? AND project_id = ?", + (payload.location_id, payload.project_id), + ).fetchone() + if not loc: + raise HTTPException(status_code=404, detail="Location not found") + conn.execute( + "UPDATE locations SET reference_image_path = ? WHERE id = ?", + (path, payload.location_id), + ) + elif payload.target == "scene": + if not payload.scene_id: + raise HTTPException(status_code=400, detail="scene_id required") + scene = conn.execute( + "SELECT id FROM scenes WHERE id = ? AND project_id = ?", + (payload.scene_id, payload.project_id), + ).fetchone() + if not scene: + raise HTTPException(status_code=404, detail="Scene not found") + conn.execute( + "UPDATE scenes SET video_path = ? WHERE id = ?", + (path, payload.scene_id), + ) + else: + raise HTTPException(status_code=400, detail="Invalid target") + + conn.execute( + "UPDATE projects SET updated_at = CURRENT_TIMESTAMP WHERE id = ?", + (payload.project_id,), + ) + conn.commit() + await event_bus.publish( + "asset.ready", + { + "path": path, + "project_id": payload.project_id, + "target": payload.target, + "source": "playground_attach", + }, + ) + return {"ok": True, "path": path, "target": payload.target, "project_id": payload.project_id} + finally: + conn.close() diff --git a/calliope-backend/src/calliope/routers/projects.py b/calliope-backend/src/calliope/routers/projects.py new file mode 100644 index 00000000..411bd043 --- /dev/null +++ b/calliope-backend/src/calliope/routers/projects.py @@ -0,0 +1,114 @@ +from __future__ import annotations + +from fastapi import APIRouter, HTTPException + +from calliope.config import settings +from calliope.db import get_db, row_to_dict +from calliope.models.schemas import Project, ProjectCreate, ProjectUpdate + +router = APIRouter() + + +def _project_stats(project_id: int, conn) -> dict[str, int]: + cur = conn.execute( + """ + SELECT + (SELECT COUNT(*) FROM scenes WHERE project_id = :pid) AS scene_count, + (SELECT COUNT(*) FROM characters WHERE project_id = :pid) AS character_count, + (SELECT COUNT(*) FROM characters WHERE project_id = :pid AND sheet_path IS NOT NULL) + + (SELECT COUNT(*) FROM locations WHERE project_id = :pid AND reference_image_path IS NOT NULL) AS asset_ready_count, + (SELECT COUNT(*) FROM characters WHERE project_id = :pid) + + (SELECT COUNT(*) FROM locations WHERE project_id = :pid) AS asset_total_count + """, + {"pid": project_id}, + ) + return dict(cur.fetchone()) + + +@router.post("", response_model=Project) +async def create_project(payload: ProjectCreate): + conn = get_db(settings.db_path) + try: + cur = conn.execute( + """ + INSERT INTO projects (title, idea, genre, tone, target_duration) + VALUES (:title, :idea, :genre, :tone, :target_duration) + """, + payload.model_dump(), + ) + conn.commit() + row = conn.execute("SELECT * FROM projects WHERE id = ?", (cur.lastrowid,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + +@router.get("", response_model=list[Project]) +async def list_projects(): + conn = get_db(settings.db_path) + try: + rows = conn.execute( + "SELECT * FROM projects WHERE status != 'system' ORDER BY updated_at DESC" + ).fetchall() + out = [] + for row in rows: + project = row_to_dict(row) + project["stats"] = _project_stats(row["id"], conn) + out.append(project) + return out + finally: + conn.close() + + +@router.get("/{project_id}") +async def get_project(project_id: int): + conn = get_db(settings.db_path) + try: + row = conn.execute("SELECT * FROM projects WHERE id = ?", (project_id,)).fetchone() + if not row: + raise HTTPException(status_code=404, detail="Project not found") + project = row_to_dict(row) + project["stats"] = _project_stats(project_id, conn) + return project + finally: + conn.close() + + +@router.patch("/{project_id}", response_model=Project) +async def update_project(project_id: int, payload: ProjectUpdate): + conn = get_db(settings.db_path) + try: + existing = conn.execute("SELECT * FROM projects WHERE id = ?", (project_id,)).fetchone() + if not existing: + raise HTTPException(status_code=404, detail="Project not found") + + # exclude_unset keeps explicitly-sent nulls (e.g. clearing cover_path) + # while leaving fields the client did not send untouched. + data = payload.model_dump(exclude_unset=True) + if not data: + return row_to_dict(existing) + + fields = ", ".join(f"{k} = :{k}" for k in data.keys()) + data["id"] = project_id + conn.execute( + f"UPDATE projects SET {fields}, updated_at = CURRENT_TIMESTAMP WHERE id = :id", + data, + ) + conn.commit() + row = conn.execute("SELECT * FROM projects WHERE id = ?", (project_id,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + +@router.delete("/{project_id}") +async def delete_project(project_id: int): + conn = get_db(settings.db_path) + try: + cur = conn.execute("DELETE FROM projects WHERE id = ?", (project_id,)) + conn.commit() + if cur.rowcount == 0: + raise HTTPException(status_code=404, detail="Project not found") + return {"ok": True} + finally: + conn.close() diff --git a/calliope-backend/src/calliope/routers/scenes.py b/calliope-backend/src/calliope/routers/scenes.py new file mode 100644 index 00000000..368a5bed --- /dev/null +++ b/calliope-backend/src/calliope/routers/scenes.py @@ -0,0 +1,166 @@ +from __future__ import annotations + +from typing import Any + +from fastapi import APIRouter, HTTPException + +from calliope.agent.script_agent import generate_script +from calliope.config import settings +from calliope.db import get_db, row_to_dict +from calliope.models.schemas import GenerateScenesRequest, SceneCreate, SceneReorder, SceneUpdate + +router = APIRouter() + + +def _scene_with_chars(conn, scene_row) -> dict[str, Any]: + scene = row_to_dict(scene_row) + chars = conn.execute( + """ + SELECT c.id, c.name, c.role, c.portrait_path, c.sheet_path + FROM characters c + JOIN scene_characters sc ON sc.character_id = c.id + WHERE sc.scene_id = ? + """, + (scene["id"],), + ).fetchall() + scene["characters"] = [row_to_dict(c) for c in chars] + scene["character_ids"] = [c["id"] for c in scene["characters"]] + return scene + + +@router.get("/{project_id}/scenes") +async def list_scenes(project_id: int) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + if not conn.execute("SELECT id FROM projects WHERE id = ?", (project_id,)).fetchone(): + raise HTTPException(status_code=404, detail="Project not found") + rows = conn.execute( + "SELECT * FROM scenes WHERE project_id = ? ORDER BY order_index", + (project_id,), + ).fetchall() + scenes = [_scene_with_chars(conn, r) for r in rows] + total = sum((s.get("duration_sec") or 0) for s in scenes) + return {"scenes": scenes, "estimated_duration_sec": total} + finally: + conn.close() + + +@router.post("/{project_id}/generate-script") +async def generate_script_endpoint(project_id: int, payload: GenerateScenesRequest | None = None) -> dict[str, Any]: + replace = True if payload is None else payload.replace + scene_count = None if payload is None else payload.scene_count + try: + return await generate_script(project_id, replace=replace, scene_count=scene_count) + except ValueError as exc: + # Distinguish not-found vs constraint failures + detail = str(exc) + code = 404 if "not found" in detail.lower() else 422 + raise HTTPException(status_code=code, detail=detail) from exc + except Exception as exc: + raise HTTPException(status_code=500, detail=str(exc)) from exc + + +@router.post("/{project_id}/scenes") +async def create_scene(project_id: int, payload: SceneCreate) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + if not conn.execute("SELECT id FROM projects WHERE id = ?", (project_id,)).fetchone(): + raise HTTPException(status_code=404, detail="Project not found") + cur = conn.execute( + """ + INSERT INTO scenes + (project_id, beat_id, order_index, heading, action, dialog, duration_sec, + workflow_id, env_image_path, location_id) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + """, + ( + project_id, + payload.beat_id, + payload.order_index, + payload.heading, + payload.action, + payload.dialog, + payload.duration_sec, + payload.workflow_id, + payload.env_image_path, + payload.location_id, + ), + ) + scene_id = cur.lastrowid + for cid in payload.character_ids: + conn.execute( + "INSERT OR IGNORE INTO scene_characters (scene_id, character_id) VALUES (?, ?)", + (scene_id, cid), + ) + conn.commit() + row = conn.execute("SELECT * FROM scenes WHERE id = ?", (scene_id,)).fetchone() + return _scene_with_chars(conn, row) + finally: + conn.close() + + +@router.patch("/{project_id}/scenes/{scene_id}") +async def update_scene(project_id: int, scene_id: int, payload: SceneUpdate) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + existing = conn.execute( + "SELECT * FROM scenes WHERE id = ? AND project_id = ?", + (scene_id, project_id), + ).fetchone() + if not existing: + raise HTTPException(status_code=404, detail="Scene not found") + data = payload.model_dump(exclude_unset=True) + char_ids = data.pop("character_ids", None) + data = {k: v for k, v in data.items() if v is not None} + if data: + fields = ", ".join(f"{k} = :{k}" for k in data) + data["id"] = scene_id + conn.execute(f"UPDATE scenes SET {fields} WHERE id = :id", data) + if char_ids is not None: + conn.execute("DELETE FROM scene_characters WHERE scene_id = ?", (scene_id,)) + for cid in char_ids: + conn.execute( + "INSERT OR IGNORE INTO scene_characters (scene_id, character_id) VALUES (?, ?)", + (scene_id, cid), + ) + conn.commit() + row = conn.execute("SELECT * FROM scenes WHERE id = ?", (scene_id,)).fetchone() + return _scene_with_chars(conn, row) + finally: + conn.close() + + +@router.delete("/{project_id}/scenes/{scene_id}") +async def delete_scene(project_id: int, scene_id: int) -> dict[str, bool]: + conn = get_db(settings.db_path) + try: + conn.execute("DELETE FROM scene_characters WHERE scene_id = ?", (scene_id,)) + cur = conn.execute( + "DELETE FROM scenes WHERE id = ? AND project_id = ?", + (scene_id, project_id), + ) + conn.commit() + if cur.rowcount == 0: + raise HTTPException(status_code=404, detail="Scene not found") + return {"ok": True} + finally: + conn.close() + + +@router.post("/{project_id}/scenes/reorder") +async def reorder_scenes(project_id: int, payload: SceneReorder) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + for index, scene_id in enumerate(payload.scene_ids, start=1): + conn.execute( + "UPDATE scenes SET order_index = ? WHERE id = ? AND project_id = ?", + (index, scene_id, project_id), + ) + conn.commit() + rows = conn.execute( + "SELECT * FROM scenes WHERE project_id = ? ORDER BY order_index", + (project_id,), + ).fetchall() + return {"scenes": [_scene_with_chars(conn, r) for r in rows]} + finally: + conn.close() diff --git a/calliope-backend/src/calliope/routers/settings.py b/calliope-backend/src/calliope/routers/settings.py new file mode 100644 index 00000000..8bddb379 --- /dev/null +++ b/calliope-backend/src/calliope/routers/settings.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from typing import Any + +from fastapi import APIRouter +from pydantic import BaseModel, Field + +from calliope.config import normalize_path, settings + +router = APIRouter() + + +class SettingsUpdate(BaseModel): + llm_base_url: str | None = None + llm_model: str | None = None + llm_api_key: str | None = None + comfyui_base_url: str | None = None + data_dir: str | None = None + assets_dir: str | None = None + queue_concurrency: int | None = Field(None, ge=1, le=8) + queue_poll_interval_sec: float | None = Field(None, ge=0.5, le=60.0) + queue_max_retries: int | None = Field(None, ge=0, le=10) + dry_run: bool | None = None + + +@router.get("") +async def get_settings() -> dict[str, Any]: + return settings.to_public_dict() + + +@router.post("") +async def update_settings(payload: SettingsUpdate) -> dict[str, Any]: + data = payload.model_dump(exclude_unset=True) + + for key, value in data.items(): + if key in {"data_dir", "assets_dir"}: + path = normalize_path(value) + if path is not None: + setattr(settings, key, path) + continue + if key == "dry_run": + setattr(settings, key, bool(value)) + continue + setattr(settings, key, value) + + settings.save_config_file() + return settings.to_public_dict() diff --git a/calliope-backend/src/calliope/routers/story.py b/calliope-backend/src/calliope/routers/story.py new file mode 100644 index 00000000..14df4290 --- /dev/null +++ b/calliope-backend/src/calliope/routers/story.py @@ -0,0 +1,460 @@ +from __future__ import annotations + +import logging +from typing import Any + +from fastapi import APIRouter, HTTPException + +from calliope.agent.llm import generate_structured +from calliope.agent.prompts import ( + build_story_messages, + character_sheet_prompt, + location_reference_prompt, + recommend_beat_count, + story_generation_user_prompt, +) +from calliope.config import settings +from calliope.db import get_db, row_to_dict +from calliope.events.bus import event_bus +from calliope.models.schemas import ( + BeatCreate, + BeatUpdate, + CharacterCreate, + CharacterUpdate, + LocationCreate, + LocationUpdate, +) + +logger = logging.getLogger("calliope.story") + +router = APIRouter() + + +def _touch_project(conn, project_id: int) -> None: + conn.execute( + "UPDATE projects SET updated_at = CURRENT_TIMESTAMP WHERE id = ?", + (project_id,), + ) + + +def _require_project(conn, project_id: int) -> dict[str, Any]: + row = conn.execute("SELECT * FROM projects WHERE id = ?", (project_id,)).fetchone() + if not row: + raise HTTPException(status_code=404, detail="Project not found") + return row_to_dict(row) + + +@router.post("/{project_id}/generate-story") +async def generate_story(project_id: int, replace: bool = True) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + project = _require_project(conn, project_id) + + required_beats = recommend_beat_count(project.get("target_duration")) + await event_bus.publish( + "agent.thinking", + { + "project_id": project_id, + "message": ( + f"Drafting storyline for \"{project['title']}\" " + f"(target {project.get('target_duration') or '?'} -> {required_beats} beats)..." + ), + }, + ) + + messages = build_story_messages( + title=project["title"], + idea=project["idea"], + genre=project["genre"], + tone=project["tone"], + target_duration=project["target_duration"], + ) + result = await generate_structured(messages, temperature=0.7) + beats_out = result.get("beats") or [] + + # Models often under-deliver on long runtimes — one corrective retry. + if len(beats_out) < required_beats: + await event_bus.publish( + "agent.thinking", + { + "project_id": project_id, + "message": ( + f"Model returned {len(beats_out)} beats; " + f"required {required_beats}. Retrying..." + ), + }, + ) + repair = [ + {"role": "system", "content": messages[0]["content"]}, + { + "role": "user", + "content": story_generation_user_prompt( + project["title"], + project["idea"], + project["genre"], + project["tone"], + project["target_duration"], + ) + + ( + f"\n\nPREVIOUS ATTEMPT FAILED: it only had {len(beats_out)} beats. " + f"You MUST return exactly {required_beats} beats this time." + ), + }, + ] + result = await generate_structured(repair, temperature=0.4) + beats_out = result.get("beats") or [] + if len(beats_out) < required_beats: + raise HTTPException( + status_code=502, + detail=( + f"Story draft returned {len(beats_out)} beats but target " + f"'{project.get('target_duration')}' requires {required_beats}. " + "Try Draft Storyline again, or check the LLM follows JSON instructions." + ), + ) + + title = result.get("title") or project["title"] + logline = result.get("logline") + conn.execute( + "UPDATE projects SET title = ?, idea = COALESCE(?, idea), status = 'in_progress', " + "updated_at = CURRENT_TIMESTAMP WHERE id = ?", + (title, logline, project_id), + ) + + if replace: + conn.execute("DELETE FROM story_beats WHERE project_id = ?", (project_id,)) + conn.execute("DELETE FROM characters WHERE project_id = ?", (project_id,)) + conn.execute("DELETE FROM locations WHERE project_id = ?", (project_id,)) + + for beat in result.get("beats", []): + conn.execute( + """ + INSERT INTO story_beats (project_id, order_index, title, description) + VALUES (:project_id, :order_index, :title, :description) + """, + { + "project_id": project_id, + "order_index": beat.get("order_index", 0), + "title": beat.get("title", ""), + "description": beat.get("description", ""), + }, + ) + + for character in result.get("characters", []): + appearance = character.get("appearance", "") or "" + row_seed = { + "name": character.get("name", ""), + "role": character.get("role", ""), + "age": character.get("age", ""), + "appearance": appearance, + "personality": character.get("personality", ""), + } + # Seed with the published sheet template so Assets shows a real prompt, not a hidden blob. + sheet_prompt = character_sheet_prompt(row_seed) + conn.execute( + """ + INSERT INTO characters + (project_id, name, role, age, appearance, personality, consistency_prompt) + VALUES (:project_id, :name, :role, :age, :appearance, :personality, :consistency_prompt) + """, + { + "project_id": project_id, + **row_seed, + "consistency_prompt": sheet_prompt, + }, + ) + + for location in result.get("locations", []): + description = location.get("description", "") or "" + loc_seed = { + "name": location.get("name", ""), + "description": description, + } + env_prompt = location_reference_prompt(loc_seed) + conn.execute( + """ + INSERT INTO locations (project_id, name, description, consistency_prompt) + VALUES (:project_id, :name, :description, :consistency_prompt) + """, + { + "project_id": project_id, + **loc_seed, + "consistency_prompt": env_prompt, + }, + ) + + conn.commit() + beat_n = len(result.get("beats", [])) + await event_bus.publish( + "story.ready", + { + "project_id": project_id, + "message": f"Story drafted — {beat_n} beats", + }, + ) + return {"ok": True, "project_id": project_id, "generated": result} + except HTTPException: + raise + except Exception as exc: + logger.exception("Story generation failed for project %s", project_id) + await event_bus.publish( + "agent.thinking", + {"project_id": project_id, "message": f"Story draft failed: {exc}"}, + ) + raise HTTPException(status_code=500, detail=str(exc)) from exc + finally: + conn.close() + + +@router.get("/{project_id}/story") +async def get_story(project_id: int) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + project = conn.execute( + "SELECT id, title, idea, genre, tone, target_duration, status FROM projects WHERE id = ?", + (project_id,), + ).fetchone() + if not project: + raise HTTPException(status_code=404, detail="Project not found") + + beats = conn.execute( + "SELECT id, order_index, title, description FROM story_beats WHERE project_id = ? ORDER BY order_index", + (project_id,), + ).fetchall() + characters = conn.execute( + """ + SELECT id, name, role, age, appearance, personality, portrait_path, sheet_path, consistency_prompt + FROM characters WHERE project_id = ? + """, + (project_id,), + ).fetchall() + locations = conn.execute( + """ + SELECT id, name, description, reference_image_path, consistency_prompt + FROM locations WHERE project_id = ? + """, + (project_id,), + ).fetchall() + + return { + "project": row_to_dict(project), + "beats": [row_to_dict(b) for b in beats], + "characters": [row_to_dict(c) for c in characters], + "locations": [row_to_dict(l) for l in locations], + } + finally: + conn.close() + + +# --- Beats CRUD --- + + +@router.post("/{project_id}/beats") +async def create_beat(project_id: int, payload: BeatCreate) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + _require_project(conn, project_id) + cur = conn.execute( + """ + INSERT INTO story_beats (project_id, order_index, title, description) + VALUES (?, ?, ?, ?) + """, + (project_id, payload.order_index, payload.title, payload.description), + ) + _touch_project(conn, project_id) + conn.commit() + row = conn.execute("SELECT * FROM story_beats WHERE id = ?", (cur.lastrowid,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + +@router.patch("/{project_id}/beats/{beat_id}") +async def update_beat(project_id: int, beat_id: int, payload: BeatUpdate) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + existing = conn.execute( + "SELECT * FROM story_beats WHERE id = ? AND project_id = ?", + (beat_id, project_id), + ).fetchone() + if not existing: + raise HTTPException(status_code=404, detail="Beat not found") + data = {k: v for k, v in payload.model_dump().items() if v is not None} + if data: + fields = ", ".join(f"{k} = :{k}" for k in data) + data["id"] = beat_id + conn.execute(f"UPDATE story_beats SET {fields} WHERE id = :id", data) + _touch_project(conn, project_id) + conn.commit() + row = conn.execute("SELECT * FROM story_beats WHERE id = ?", (beat_id,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + +@router.delete("/{project_id}/beats/{beat_id}") +async def delete_beat(project_id: int, beat_id: int) -> dict[str, bool]: + conn = get_db(settings.db_path) + try: + cur = conn.execute( + "DELETE FROM story_beats WHERE id = ? AND project_id = ?", + (beat_id, project_id), + ) + if cur.rowcount == 0: + raise HTTPException(status_code=404, detail="Beat not found") + _touch_project(conn, project_id) + conn.commit() + return {"ok": True} + finally: + conn.close() + + +# --- Characters CRUD --- + + +@router.post("/{project_id}/characters") +async def create_character(project_id: int, payload: CharacterCreate) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + _require_project(conn, project_id) + consistency = payload.consistency_prompt or character_sheet_prompt( + { + "name": payload.name, + "role": payload.role, + "age": payload.age, + "appearance": payload.appearance, + "personality": payload.personality, + } + ) + cur = conn.execute( + """ + INSERT INTO characters + (project_id, name, role, age, appearance, personality, consistency_prompt) + VALUES (?, ?, ?, ?, ?, ?, ?) + """, + ( + project_id, + payload.name, + payload.role, + payload.age, + payload.appearance, + payload.personality, + consistency, + ), + ) + _touch_project(conn, project_id) + conn.commit() + row = conn.execute("SELECT * FROM characters WHERE id = ?", (cur.lastrowid,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + +@router.patch("/{project_id}/characters/{character_id}") +async def update_character( + project_id: int, character_id: int, payload: CharacterUpdate +) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + existing = conn.execute( + "SELECT * FROM characters WHERE id = ? AND project_id = ?", + (character_id, project_id), + ).fetchone() + if not existing: + raise HTTPException(status_code=404, detail="Character not found") + data = {k: v for k, v in payload.model_dump().items() if v is not None} + if data: + fields = ", ".join(f"{k} = :{k}" for k in data) + data["id"] = character_id + conn.execute(f"UPDATE characters SET {fields} WHERE id = :id", data) + _touch_project(conn, project_id) + conn.commit() + row = conn.execute("SELECT * FROM characters WHERE id = ?", (character_id,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + +@router.delete("/{project_id}/characters/{character_id}") +async def delete_character(project_id: int, character_id: int) -> dict[str, bool]: + conn = get_db(settings.db_path) + try: + cur = conn.execute( + "DELETE FROM characters WHERE id = ? AND project_id = ?", + (character_id, project_id), + ) + if cur.rowcount == 0: + raise HTTPException(status_code=404, detail="Character not found") + _touch_project(conn, project_id) + conn.commit() + return {"ok": True} + finally: + conn.close() + + +# --- Locations CRUD --- + + +@router.post("/{project_id}/locations") +async def create_location(project_id: int, payload: LocationCreate) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + _require_project(conn, project_id) + consistency = payload.consistency_prompt or location_reference_prompt( + {"name": payload.name, "description": payload.description} + ) + cur = conn.execute( + """ + INSERT INTO locations (project_id, name, description, consistency_prompt) + VALUES (?, ?, ?, ?) + """, + (project_id, payload.name, payload.description, consistency), + ) + _touch_project(conn, project_id) + conn.commit() + row = conn.execute("SELECT * FROM locations WHERE id = ?", (cur.lastrowid,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + +@router.patch("/{project_id}/locations/{location_id}") +async def update_location( + project_id: int, location_id: int, payload: LocationUpdate +) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + existing = conn.execute( + "SELECT * FROM locations WHERE id = ? AND project_id = ?", + (location_id, project_id), + ).fetchone() + if not existing: + raise HTTPException(status_code=404, detail="Location not found") + data = {k: v for k, v in payload.model_dump().items() if v is not None} + if data: + fields = ", ".join(f"{k} = :{k}" for k in data) + data["id"] = location_id + conn.execute(f"UPDATE locations SET {fields} WHERE id = :id", data) + _touch_project(conn, project_id) + conn.commit() + row = conn.execute("SELECT * FROM locations WHERE id = ?", (location_id,)).fetchone() + return row_to_dict(row) + finally: + conn.close() + + +@router.delete("/{project_id}/locations/{location_id}") +async def delete_location(project_id: int, location_id: int) -> dict[str, bool]: + conn = get_db(settings.db_path) + try: + cur = conn.execute( + "DELETE FROM locations WHERE id = ? AND project_id = ?", + (location_id, project_id), + ) + if cur.rowcount == 0: + raise HTTPException(status_code=404, detail="Location not found") + _touch_project(conn, project_id) + conn.commit() + return {"ok": True} + finally: + conn.close() diff --git a/calliope-backend/src/calliope/routers/workflows.py b/calliope-backend/src/calliope/routers/workflows.py new file mode 100644 index 00000000..783c3b64 --- /dev/null +++ b/calliope-backend/src/calliope/routers/workflows.py @@ -0,0 +1,121 @@ +from __future__ import annotations + +import json +from typing import Any + +from fastapi import APIRouter, HTTPException + +from calliope.comfyui.parser import parse_dynamic_inputs, parse_dynamic_outputs +from calliope.comfyui.profiles import detect_prompt_profile +from calliope.config import settings +from calliope.db import get_db, row_to_dict +from calliope.models.schemas import WorkflowAnalyze, WorkflowCreate, WorkflowUpdate + +router = APIRouter() + + +def _serialize_workflow(row: Any) -> dict[str, Any]: + data = row_to_dict(row) + data["workflow_json"] = json.loads(data["workflow_json"]) + data["input_schema"] = json.loads(data["input_schema"]) if data.get("input_schema") else [] + data["output_schema"] = json.loads(data["output_schema"]) if data.get("output_schema") else [] + data["is_enabled"] = bool(data.get("is_enabled")) + return data + + +@router.post("/analyze") +async def analyze_workflow(payload: WorkflowAnalyze) -> dict[str, Any]: + inputs = parse_dynamic_inputs(payload.workflow_json) + outputs = parse_dynamic_outputs(payload.workflow_json) + return { + "inputs": inputs, + "outputs": outputs, + "suggested_profile": detect_prompt_profile(payload.workflow_json), + } + + +@router.get("") +async def list_workflows() -> list[dict[str, Any]]: + conn = get_db(settings.db_path) + try: + rows = conn.execute("SELECT * FROM workflows ORDER BY id DESC").fetchall() + return [_serialize_workflow(r) for r in rows] + finally: + conn.close() + + +@router.post("") +async def create_workflow(payload: WorkflowCreate) -> dict[str, Any]: + inputs = parse_dynamic_inputs(payload.workflow_json) + outputs = parse_dynamic_outputs(payload.workflow_json) + profile = payload.prompt_profile or detect_prompt_profile(payload.workflow_json) + conn = get_db(settings.db_path) + try: + cur = conn.execute( + """ + INSERT INTO workflows (name, kind, workflow_json, input_schema, + output_schema, description, prompt_profile, is_enabled) + VALUES (?, ?, ?, ?, ?, ?, ?, 1) + """, + ( + payload.name, + payload.kind, + json.dumps(payload.workflow_json), + json.dumps(inputs), + json.dumps(outputs), + payload.description, + profile, + ), + ) + conn.commit() + row = conn.execute("SELECT * FROM workflows WHERE id = ?", (cur.lastrowid,)).fetchone() + return _serialize_workflow(row) + finally: + conn.close() + + +@router.get("/{workflow_id}") +async def get_workflow(workflow_id: int) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + row = conn.execute("SELECT * FROM workflows WHERE id = ?", (workflow_id,)).fetchone() + if not row: + raise HTTPException(status_code=404, detail="Workflow not found") + return _serialize_workflow(row) + finally: + conn.close() + + +@router.patch("/{workflow_id}") +async def update_workflow(workflow_id: int, payload: WorkflowUpdate) -> dict[str, Any]: + conn = get_db(settings.db_path) + try: + existing = conn.execute("SELECT * FROM workflows WHERE id = ?", (workflow_id,)).fetchone() + if not existing: + raise HTTPException(status_code=404, detail="Workflow not found") + data = payload.model_dump(exclude_unset=True) + if "is_enabled" in data and data["is_enabled"] is not None: + data["is_enabled"] = 1 if data["is_enabled"] else 0 + data = {k: v for k, v in data.items() if v is not None} + if data: + fields = ", ".join(f"{k} = :{k}" for k in data) + data["id"] = workflow_id + conn.execute(f"UPDATE workflows SET {fields} WHERE id = :id", data) + conn.commit() + row = conn.execute("SELECT * FROM workflows WHERE id = ?", (workflow_id,)).fetchone() + return _serialize_workflow(row) + finally: + conn.close() + + +@router.delete("/{workflow_id}") +async def delete_workflow(workflow_id: int) -> dict[str, bool]: + conn = get_db(settings.db_path) + try: + cur = conn.execute("DELETE FROM workflows WHERE id = ?", (workflow_id,)) + conn.commit() + if cur.rowcount == 0: + raise HTTPException(status_code=404, detail="Workflow not found") + return {"ok": True} + finally: + conn.close() diff --git a/calliope-backend/tests/__init__.py b/calliope-backend/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/calliope-backend/tests/conftest.py b/calliope-backend/tests/conftest.py new file mode 100644 index 00000000..bd7920eb --- /dev/null +++ b/calliope-backend/tests/conftest.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +import asyncio +import tempfile +from pathlib import Path + +import pytest +from fastapi.testclient import TestClient + +from calliope.db import migrate_db +from calliope.main import create_app + + +@pytest.fixture +def client(monkeypatch): + with tempfile.TemporaryDirectory() as tmpdir: + import calliope.config as config_module + + # Mutate singleton in place so all `from calliope.config import settings` refs update + s = config_module.settings + prev = { + "data_dir": s.data_dir, + "assets_dir": s.assets_dir, + "dry_run": s.dry_run, + "queue_poll_interval_sec": s.queue_poll_interval_sec, + } + s.data_dir = Path(tmpdir) + s.assets_dir = Path(tmpdir) / "assets" + s.dry_run = True + s.queue_poll_interval_sec = 0.5 + # Never persist temp test paths into the real calliope_config.json + monkeypatch.setattr(config_module.Settings, "save_config_file", lambda self: None) + asyncio.run(migrate_db(s.db_path)) + app = create_app() + try: + with TestClient(app) as c: + yield c + finally: + for k, v in prev.items(): + setattr(s, k, v) diff --git a/calliope-backend/tests/test_export.py b/calliope-backend/tests/test_export.py new file mode 100644 index 00000000..b87ff372 --- /dev/null +++ b/calliope-backend/tests/test_export.py @@ -0,0 +1,207 @@ +from __future__ import annotations + +import time +from pathlib import Path + +import pytest + +from calliope.comfyui.client import ComfyUIClient +from calliope.export.runner import build_ffmpeg_cmd, collect_clips + + +def _make_project_with_clips(client, title: str = "My Film") -> int: + pid = client.post("/api/projects", json={"title": title}).json()["id"] + s1 = client.post( + f"/api/projects/{pid}/scenes", json={"order_index": 1, "heading": "Opening"} + ).json() + s2 = client.post( + f"/api/projects/{pid}/scenes", json={"order_index": 2, "heading": "Chase"} + ).json() + client.patch( + f"/api/projects/{pid}/scenes/{s1['id']}", json={"video_path": "C:/clips/a.mp4"} + ) + client.patch( + f"/api/projects/{pid}/scenes/{s2['id']}", json={"video_path": "C:/clips/b.mp4"} + ) + return pid + + +def test_build_ffmpeg_cmd_two_clips(): + clips = [{"video_path": "a.mp4"}, {"video_path": "b.mp4"}] + probes = [ + {"duration": 8.02, "has_audio": True}, + {"duration": 8.0, "has_audio": True}, + ] + cmd = build_ffmpeg_cmd(clips, probes, Path("out.mp4")) + joined = " ".join(str(c) for c in cmd) + # offset = 8.02 - 0.5 = 7.52 + assert "xfade=transition=fade:duration=0.5:offset=7.52" in joined + assert "acrossfade=d=0.5:c1=tri:c2=tri" in joined + # format=yuv420p must come AFTER the xfade output label + assert "[x1]format=yuv420p[vout]" in joined + assert "loudnorm=I=-16:TP=-1.5:LRA=11" in joined + assert "scale=1920:1080:force_original_aspect_ratio=decrease" in joined + assert "fps=30" in joined + assert "-c:v libx264" in joined + assert "-crf 20" in joined + assert "-b:a 192k" in joined + assert "-movflags +faststart" in joined + assert "-progress pipe:1" in joined + assert "anullsrc" not in joined + assert cmd[-1] == "out.mp4" + + +def test_build_ffmpeg_cmd_anullsrc_for_silent_clip(): + clips = [{"video_path": "a.mp4"}, {"video_path": "b.mp4"}] + probes = [ + {"duration": 8.0, "has_audio": True}, + {"duration": 4.0, "has_audio": False}, + ] + cmd = build_ffmpeg_cmd(clips, probes, "out.mp4") + joined = " ".join(str(c) for c in cmd) + # One lavfi silence donor input appended after the 2 clip inputs (index 2) + assert joined.count("-f lavfi -i anullsrc=cl=stereo:r=48000") == 1 + assert ( + "[2:a]atrim=duration=4.000,asetpts=PTS-STARTPTS," + "aformat=sample_rates=48000:channel_layouts=stereo[a1]" in joined + ) + # Real clip keeps its own audio chain + assert "[0:a]aformat=sample_rates=48000:channel_layouts=stereo[a0]" in joined + assert "xfade=transition=fade:duration=0.5:offset=7.500" in joined + + +def test_build_ffmpeg_cmd_single_clip(): + cmd = build_ffmpeg_cmd( + [{"video_path": "a.mp4"}], [{"duration": 5.0, "has_audio": True}], "out.mp4" + ) + joined = " ".join(str(c) for c in cmd) + assert "xfade" not in joined + assert "acrossfade" not in joined + assert "[v0]format=yuv420p[vout]" in joined + assert "[a0]loudnorm=I=-16:TP=-1.5:LRA=11[aout]" in joined + assert "-c:v libx264" in joined + + +def test_build_ffmpeg_cmd_no_clips_raises(): + with pytest.raises(RuntimeError): + build_ffmpeg_cmd([], [], "out.mp4") + + +def test_collect_clips_split_and_order(client): + pid = client.post("/api/projects", json={"title": "Order"}).json()["id"] + s_b = client.post( + f"/api/projects/{pid}/scenes", json={"order_index": 2, "heading": "B"} + ).json() + s_a = client.post( + f"/api/projects/{pid}/scenes", json={"order_index": 1, "heading": "A"} + ).json() + client.post(f"/api/projects/{pid}/scenes", json={"order_index": 3, "heading": "C"}) + client.patch(f"/api/projects/{pid}/scenes/{s_b['id']}", json={"video_path": "b.mp4"}) + client.patch(f"/api/projects/{pid}/scenes/{s_a['id']}", json={"video_path": "a.mp4"}) + + clips, skipped = collect_clips(pid) + assert [c["heading"] for c in clips] == ["A", "B"] + assert [s["heading"] for s in skipped] == ["C"] + + +def test_export_requires_scene_clips(client): + pid = client.post("/api/projects", json={"title": "Empty"}).json()["id"] + client.post(f"/api/projects/{pid}/scenes", json={"order_index": 1, "heading": "No clip"}) + r = client.post(f"/api/jobs/projects/{pid}/export") + assert r.status_code == 400 + + +def test_export_supersedes_pending(client): + pid = _make_project_with_clips(client) + try: + client.post("/api/jobs/pause") + r1 = client.post(f"/api/jobs/projects/{pid}/export") + r2 = client.post(f"/api/jobs/projects/{pid}/export") + assert r1.status_code == 200 + assert r2.status_code == 200 + j1 = client.get(f"/api/jobs/{r1.json()['job']['id']}").json() + assert j1["status"] == "failed" + assert "superseded" in j1["error"] + j2 = client.get(f"/api/jobs/{r2.json()['job']['id']}").json() + assert j2["status"] == "pending" + assert j2["kind"] == "export" + finally: + client.post("/api/jobs/resume") + + +def test_export_job_dry_run(client): + pid = _make_project_with_clips(client) + r = client.post(f"/api/jobs/projects/{pid}/export") + assert r.status_code == 200 + job = r.json()["job"] + assert job["kind"] == "export" + + final = None + for _ in range(40): + time.sleep(0.25) + got = client.get(f"/api/jobs/{job['id']}").json() + if got["status"] in {"done", "failed"}: + final = got + break + assert final is not None, "export job never finished" + assert final["status"] == "done", final + outputs = final["output_paths"] + assert len(outputs) == 1 + norm = outputs[0].replace("\\", "/") + assert f"/{pid}/export/" in norm + assert norm.endswith(f"my-film-job{job['id']}.mp4") + assert Path(outputs[0]).exists() + + # A finished export closes the project lifecycle + project = client.get(f"/api/projects/{pid}").json() + assert project["status"] == "completed" + + +def test_cancel_export_skips_comfy_interrupt(client, monkeypatch): + calls = {"interrupt": 0, "kill": 0} + + async def fake_interrupt(self): + calls["interrupt"] += 1 + + def fake_kill(job_id: int) -> bool: + calls["kill"] += 1 + return True + + monkeypatch.setattr(ComfyUIClient, "interrupt", fake_interrupt) + monkeypatch.setattr("calliope.routers.jobs.kill_running", fake_kill) + + pid = _make_project_with_clips(client) + try: + client.post("/api/jobs/pause") + job_id = client.post(f"/api/jobs/projects/{pid}/export").json()["job"]["id"] + r = client.post(f"/api/jobs/{job_id}/cancel") + assert r.status_code == 200 + assert calls["kill"] == 1 + assert calls["interrupt"] == 0 + finally: + client.post("/api/jobs/resume") + + +def test_cancel_comfy_job_calls_interrupt(client, monkeypatch): + calls = {"interrupt": 0, "kill": 0} + + async def fake_interrupt(self): + calls["interrupt"] += 1 + + def fake_kill(job_id: int) -> bool: + calls["kill"] += 1 + return True + + monkeypatch.setattr(ComfyUIClient, "interrupt", fake_interrupt) + monkeypatch.setattr("calliope.routers.jobs.kill_running", fake_kill) + + pid = client.post("/api/projects", json={"title": "Comfy"}).json()["id"] + try: + client.post("/api/jobs/pause") + job_id = client.post(f"/api/jobs?project_id={pid}", json={"kind": "image"}).json()["id"] + r = client.post(f"/api/jobs/{job_id}/cancel") + assert r.status_code == 200 + assert calls["interrupt"] == 1 + assert calls["kill"] == 0 + finally: + client.post("/api/jobs/resume") diff --git a/calliope-backend/tests/test_h3_profile.py b/calliope-backend/tests/test_h3_profile.py new file mode 100644 index 00000000..a74910f2 --- /dev/null +++ b/calliope-backend/tests/test_h3_profile.py @@ -0,0 +1,128 @@ +"""Tests for the MiniMax H3 ref2video prompt profile.""" +from __future__ import annotations + +import json +from pathlib import Path + +from calliope.agent.prompts import minimax_h3_ref_fallback +from calliope.comfyui.parser import parse_dynamic_inputs, parse_dynamic_outputs +from calliope.comfyui.profiles import detect_prompt_profile +from calliope.comfyui.smart_fill import ref_image_slots, smart_fill_inputs + +REPO_ROOT = Path(__file__).resolve().parents[2] +H3_WORKFLOW = REPO_ROOT / "ComfyAPI" / "video_minimax_h3_r2v_API.json" +KREA_WORKFLOW = REPO_ROOT / "ComfyAPI" / "krea2_t2i_2pass-nsfwEnable-API.json" + + +def _load(path: Path) -> dict: + return json.loads(path.read_text(encoding="utf-8")) + + +def test_h3_workflow_parses_expected_roles(): + workflow = _load(H3_WORKFLOW) + inputs = parse_dynamic_inputs(workflow) + by_node = {i["nodeId"]: i for i in inputs} + + assert by_node["138"]["role"] == "prompt" + assert by_node["132"]["role"] == "duration" + image_slots = [i["nodeId"] for i in ref_image_slots(inputs)] + assert image_slots == ["148", "149"] # node-id order = ref wiring order + + outputs = parse_dynamic_outputs(workflow) + assert any(o["nodeId"] == "153" and o["kind"] == "video" for o in outputs) + + +def test_detect_prompt_profile(): + assert detect_prompt_profile(_load(H3_WORKFLOW)) == "minimax_h3_ref" + assert detect_prompt_profile(_load(KREA_WORKFLOW)) == "prose" + + +def test_smart_fill_ref_images_and_duration(): + inputs = parse_dynamic_inputs(_load(H3_WORKFLOW)) + values = smart_fill_inputs( + inputs, + prompt="six-section h3 prompt", + ref_images=["char.png", "loc.png", "surplus.png"], + duration=8, + ) + assert values["138"] == "six-section h3 prompt" + assert values["148"] == "char.png" + assert values["149"] == "loc.png" + assert "surplus.png" not in values.values() + assert values["132"] == 8 + + +def test_smart_fill_ref_images_user_extra_wins(): + inputs = parse_dynamic_inputs(_load(H3_WORKFLOW)) + values = smart_fill_inputs( + inputs, + ref_images=["char.png"], + extra={"148": "user-override.png"}, + ) + assert values["148"] == "user-override.png" + + +def test_h3_fallback_prompt_structure(): + scene = { + "heading": "INT. COFFEE SHOP - DAY", + "action": "Mia sits on the orange sofa, guarding a cookie.", + "dialog": "MIA: Hey! Watch your dog!\nNARRATOR: Later that day.", + "duration_sec": 6, + } + subjects = [ + { + "index": 1, + "kind": "character", + "name": "Mia", + "appearance": "long dark hair, blue cardigan", + }, + { + "index": 2, + "kind": "location", + "name": "Coffee Shop", + "appearance": "exposed brick wall, neon sign", + }, + ] + text = minimax_h3_ref_fallback(scene, subjects) + + sections = [ + "subject_definitions:", + "summary:", + "retention_analysis:", + "detailed_description:", + "overall_soundscape:", + "non_diegetic_music:", + ] + positions = [text.index(s) for s in sections] + assert positions == sorted(positions), "sections must appear in the canonical order" + + assert ' is the character "Mia" in ' in text + assert ' is the location "Coffee Shop" in ' in text + assert text.count("fully_preserved") == 2 + assert "[reference generation]" in text + assert "[Shot 1]" in text + assert " (S1) says, [English] Hey! Watch your dog!" in text + # Narrator has no subject → stable voice description with its own speaker ID + assert "Narrator (S2) says, [English] Later that day." in text + + +def test_h3_fallback_without_subjects_or_dialog(): + scene = {"heading": "EXT. FOREST - NIGHT", "action": "Fog drifts between trees."} + text = minimax_h3_ref_fallback(scene, []) + assert "detailed_description:" in text + assert "[Shot 1]" in text + assert "" not in text + + +def test_h3_fallback_dialog_delivery_cue(): + scene = { + "heading": "INT. HALL - NIGHT", + "action": "Mia freezes.", + "dialog": "MIA (whispering): Did you hear that?", + } + subjects = [ + {"index": 1, "kind": "character", "name": "Mia", "appearance": "chestnut ponytail"}, + ] + text = minimax_h3_ref_fallback(scene, subjects) + # Cue kept as delivery direction; speaker still matched to the subject + assert " (S1) says whispering, [English] Did you hear that?" in text diff --git a/calliope-backend/tests/test_pipeline.py b/calliope-backend/tests/test_pipeline.py new file mode 100644 index 00000000..7fa3caa8 --- /dev/null +++ b/calliope-backend/tests/test_pipeline.py @@ -0,0 +1,165 @@ +from __future__ import annotations + +import json + +from calliope.comfyui.parser import parse_dynamic_inputs, parse_dynamic_outputs +from calliope.comfyui.patcher import patch_workflow + + +SAMPLE_WORKFLOW = { + "102": { + "inputs": {"value": 1280}, + "class_type": "PrimitiveInt", + "_meta": {"title": "Width (Input:width)"}, + }, + "209": { + "inputs": {"value": "My prompt"}, + "class_type": "PrimitiveStringMultiline", + "_meta": {"title": "Text Prompt (Input:prompt)"}, + }, + "10": { + "inputs": {"image": "x.png"}, + "class_type": "LoadImage", + "_meta": {"title": "Reference Image (Input:character)"}, + }, + "99": { + "inputs": {"filename_prefix": "out"}, + "class_type": "SaveImage", + "_meta": {"title": "Final Image (Output:image)"}, + }, +} + + +def test_parse_dynamic_inputs_outputs(): + inputs = parse_dynamic_inputs(SAMPLE_WORKFLOW) + outputs = parse_dynamic_outputs(SAMPLE_WORKFLOW) + assert len(inputs) == 3 + assert {i["kind"] for i in inputs} >= {"number", "textarea", "image"} + by_role = {i["role"]: i for i in inputs} + assert by_role["width"]["nodeId"] == "102" + assert by_role["prompt"]["nodeId"] == "209" + assert by_role["character"]["nodeId"] == "10" + assert len(outputs) == 1 + assert outputs[0]["kind"] == "image" + assert outputs[0]["role"] == "image" + + +def test_patch_workflow_by_node_id(): + patched = patch_workflow(SAMPLE_WORKFLOW, {"209": "New prompt", "102": 720, "10": "ref.png"}) + assert patched["209"]["inputs"]["value"] == "New prompt" + assert patched["102"]["inputs"]["value"] == 720 + assert patched["10"]["inputs"]["image"] == "ref.png" + + +def test_workflow_analyze_and_create(client): + r = client.post("/api/workflows/analyze", json={"workflow_json": SAMPLE_WORKFLOW}) + assert r.status_code == 200 + assert len(r.json()["inputs"]) == 3 + + r = client.post( + "/api/workflows", + json={"name": "Test WF", "kind": "image", "workflow_json": SAMPLE_WORKFLOW}, + ) + assert r.status_code == 200 + data = r.json() + assert data["name"] == "Test WF" + assert len(data["input_schema"]) == 3 + + +def test_story_replace_on_regenerate(client, monkeypatch): + async def fake_structured(messages, temperature=0.7): + return { + "title": "T", + "logline": "L", + "beats": [ + {"order_index": i, "title": f"B{i}", "description": "d"} for i in range(1, 5) + ], + "characters": [ + { + "name": "Hero", + "role": "protagonist", + "age": "20", + "appearance": "tall", + "personality": "brave", + } + ], + "locations": [{"name": "Forest", "description": "dark woods"}], + } + + monkeypatch.setattr("calliope.routers.story.generate_structured", fake_structured) + + r = client.post("/api/projects", json={"title": "P", "idea": "idea"}) + pid = r.json()["id"] + r = client.post(f"/api/projects/{pid}/generate-story") + assert r.status_code == 200 + r = client.get(f"/api/projects/{pid}/story") + assert len(r.json()["beats"]) == 4 + assert len(r.json()["characters"]) == 1 + + # regenerate should replace, not append + r = client.post(f"/api/projects/{pid}/generate-story") + assert r.status_code == 200 + r = client.get(f"/api/projects/{pid}/story") + assert len(r.json()["beats"]) == 4 + assert len(r.json()["characters"]) == 1 + + +def test_enqueue_dry_run_job(client): + r = client.post("/api/projects", json={"title": "Q"}) + pid = r.json()["id"] + r = client.post( + "/api/workflows", + json={"name": "Img", "kind": "image", "workflow_json": SAMPLE_WORKFLOW}, + ) + assert r.status_code == 200 + + # create character manually via story path monkeypatch-less insert through generate-assets empty + # use character create endpoint + r = client.post( + f"/api/projects/{pid}/characters", + json={"name": "A", "appearance": "blue hair"}, + ) + assert r.status_code == 200 + + r = client.post(f"/api/projects/{pid}/generate-assets", json={"missing_only": True}) + assert r.status_code == 200 + jobs = r.json()["jobs"] + assert len(jobs) >= 1 + + # wait briefly for dry-run worker + import time + + done = False + for _ in range(20): + time.sleep(0.25) + listed = client.get(f"/api/jobs?project_id={pid}").json() + if listed and listed[0]["status"] in {"done", "failed"}: + done = listed[0]["status"] == "done" + break + assert done + + +def test_settings_dry_run(client): + r = client.get("/api/settings") + assert r.status_code == 200 + assert "dry_run" in r.json() + r = client.post("/api/settings", json={"dry_run": True}) + assert r.status_code == 200 + assert r.json()["dry_run"] is True + + +def test_duration_beat_budget(): + from calliope.agent.prompts import ( + estimate_target_seconds, + recommend_beat_count, + story_generation_user_prompt, + ) + + assert estimate_target_seconds("2 minutes") == 120 + assert recommend_beat_count("2 minutes") == 10 + assert recommend_beat_count("medium (~2 min)") == 10 + assert recommend_beat_count("10 minutes") == 50 + assert recommend_beat_count("30 seconds") == 4 + prompt = story_generation_user_prompt("T", "idea", "Horror", "Dark", "10 minutes") + assert "required_beat_count: 50" in prompt + assert "EXACTLY 50" in prompt diff --git a/calliope-backend/tests/test_playground.py b/calliope-backend/tests/test_playground.py new file mode 100644 index 00000000..d2c06317 --- /dev/null +++ b/calliope-backend/tests/test_playground.py @@ -0,0 +1,122 @@ +from __future__ import annotations + +import tempfile +from pathlib import Path + +import pytest +from fastapi.testclient import TestClient + +from calliope.db import migrate_db +from calliope.main import create_app + + +SAMPLE_WORKFLOW = { + "1": { + "class_type": "CLIPTextEncode", + "inputs": {"text": "hello"}, + "_meta": {"title": "Prompt (Input:prompt)"}, + }, + "2": { + "class_type": "SaveImage", + "inputs": {"images": ["1", 0]}, + "_meta": {"title": "Save (Output:image)"}, + }, +} + + +@pytest.fixture +def client(monkeypatch): + with tempfile.TemporaryDirectory() as tmpdir: + import asyncio + import calliope.config as config_module + + s = config_module.settings + prev = { + "data_dir": s.data_dir, + "assets_dir": s.assets_dir, + "dry_run": s.dry_run, + } + s.data_dir = Path(tmpdir) + s.assets_dir = Path(tmpdir) / "assets" + s.assets_dir.mkdir(parents=True, exist_ok=True) + s.dry_run = True + monkeypatch.setattr(config_module.Settings, "save_config_file", lambda self: None) + asyncio.run(migrate_db(s.db_path)) + app = create_app() + try: + with TestClient(app) as c: + yield c + finally: + for k, v in prev.items(): + setattr(s, k, v) + + +def test_playground_generate_and_attach(client): + wf = client.post( + "/api/workflows", + json={"name": "PG Img", "kind": "image", "workflow_json": SAMPLE_WORKFLOW}, + ) + assert wf.status_code == 200 + workflow_id = wf.json()["id"] + + gen = client.post( + "/api/playground/generate", + json={"workflow_id": workflow_id, "input_values": {"1": "a cat"}}, + ) + assert gen.status_code == 200 + job = gen.json()["job"] + assert job["kind"] == "image" + assert job["status"] == "pending" + + # Scratch project hidden from list + listed = client.get("/api/projects").json() + assert all(p.get("status") != "system" for p in listed) + + proj = client.post("/api/projects", json={"title": "Reel"}).json() + char = client.post( + f"/api/projects/{proj['id']}/characters", + json={"name": "Hero"}, + ).json() + + # Wait briefly for dry-run worker, or poll jobs + import time + + path = None + done = None + for _ in range(40): + jobs = client.get("/api/playground/jobs").json() + done = next((j for j in jobs if j["id"] == job["id"] and j["status"] == "done"), None) + if done and done["output_paths"]: + path = done["output_paths"][0] + break + time.sleep(0.25) + assert path and done, "playground job did not finish in dry-run" + + attach = client.post( + "/api/playground/attach", + json={ + "path": path, + "project_id": proj["id"], + "target": "character_sheet", + "character_id": char["id"], + }, + ) + assert attach.status_code == 200 + + assets = client.get(f"/api/projects/{proj['id']}/assets").json() + sheet = next(c for c in assets["characters"] if c["id"] == char["id"])["sheet_path"] + assert sheet == path + + from pathlib import Path as P + + assert P(path).is_file() + dead = client.delete(f"/api/playground/jobs/{done['id']}") + assert dead.status_code == 200 + assert dead.json()["ok"] is True + assert path in dead.json()["deleted_files"] + assert not P(path).exists() + assert done["id"] not in [j["id"] for j in client.get("/api/playground/jobs").json()] + + assets2 = client.get(f"/api/projects/{proj['id']}/assets").json() + sheet2 = next(c for c in assets2["characters"] if c["id"] == char["id"])["sheet_path"] + assert sheet2 is None diff --git a/calliope-backend/tests/test_playground_uploads.py b/calliope-backend/tests/test_playground_uploads.py new file mode 100644 index 00000000..f8cd9598 --- /dev/null +++ b/calliope-backend/tests/test_playground_uploads.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +import os +import time +from pathlib import Path + +import calliope.config as config_module +from calliope.routers.playground import UPLOAD_KIND_BY_EXT, _kind_for_ext + +PNG_BYTES = b"\x89PNG\r\n\x1a\n" + b"\x00" * 32 +MP3_BYTES = b"ID3" + b"\x00" * 32 + + +def _uploads_root() -> Path: + return config_module.settings.assets_dir.resolve() / "uploads" + + +def test_upload_image_ok(client): + res = client.post( + "/api/playground/uploads", + files={"file": ("ref one.png", PNG_BYTES, "image/png")}, + ) + assert res.status_code == 200 + data = res.json() + assert data["ok"] is True + assert data["kind"] == "image" + assert data["name"] == "ref one.png" + + dest = Path(data["path"]).resolve() + assert dest.is_relative_to(_uploads_root()) + assert dest.is_file() + assert dest.read_bytes() == PNG_BYTES + # Stored as "<8-char uuid>-" + assert dest.name[8] == "-" + assert dest.name[9:] == "ref_one.png" + + +def test_upload_bad_extension(client): + res = client.post( + "/api/playground/uploads", + files={"file": ("evil.exe", b"MZ", "application/octet-stream")}, + ) + assert res.status_code == 400 + assert "Unsupported file type" in res.json()["detail"] + + +def test_list_uploads_newest_first(client): + first = client.post( + "/api/playground/uploads", + files={"file": ("old.png", PNG_BYTES, "image/png")}, + ).json() + second = client.post( + "/api/playground/uploads", + files={"file": ("new.mp3", MP3_BYTES, "audio/mpeg")}, + ).json() + + # Backdate the first file so ordering does not depend on mtime resolution + old_mtime = time.time() - 100 + os.utime(first["path"], (old_mtime, old_mtime)) + + items = client.get("/api/playground/uploads").json() + assert [i["path"] for i in items] == [second["path"], first["path"]] + assert items[0]["name"] == "new.mp3" + assert items[0]["kind"] == "audio" + assert items[0]["size"] == len(MP3_BYTES) + assert items[0]["mtime"] + assert items[1]["name"] == "old.png" + assert items[1]["kind"] == "image" + + +def test_upload_extension_map(): + assert UPLOAD_KIND_BY_EXT[".png"] == "image" + assert UPLOAD_KIND_BY_EXT[".webp"] == "image" + assert UPLOAD_KIND_BY_EXT[".mp4"] == "video" + assert UPLOAD_KIND_BY_EXT[".mkv"] == "video" + assert UPLOAD_KIND_BY_EXT[".wav"] == "audio" + assert UPLOAD_KIND_BY_EXT[".m4a"] == "audio" + assert _kind_for_ext(".JPG") == "image" # case-insensitive + assert _kind_for_ext(".exe") is None + assert _kind_for_ext("") is None diff --git a/calliope-backend/tests/test_projects.py b/calliope-backend/tests/test_projects.py new file mode 100644 index 00000000..a277341e --- /dev/null +++ b/calliope-backend/tests/test_projects.py @@ -0,0 +1,121 @@ +from __future__ import annotations + +import tempfile +from pathlib import Path + +import pytest +from fastapi.testclient import TestClient + +from calliope.config import Settings +from calliope.main import create_app +from calliope.db import migrate_db + + +@pytest.fixture +def client(monkeypatch): + with tempfile.TemporaryDirectory() as tmpdir: + import calliope.config as config_module + import asyncio + + s = config_module.settings + prev = { + "data_dir": s.data_dir, + "assets_dir": s.assets_dir, + "dry_run": s.dry_run, + } + s.data_dir = Path(tmpdir) + s.assets_dir = Path(tmpdir) / "assets" + s.dry_run = True + monkeypatch.setattr(config_module.Settings, "save_config_file", lambda self: None) + asyncio.run(migrate_db(s.db_path)) + app = create_app() + try: + with TestClient(app) as c: + yield c + finally: + for k, v in prev.items(): + setattr(s, k, v) + + +def test_health(client): + r = client.get("/api/health") + assert r.status_code == 200 + assert r.json()["status"] == "ok" + + +def test_create_and_list_project(client): + r = client.post("/api/projects", json={"title": "Test", "idea": "idea"}) + assert r.status_code == 200 + data = r.json() + assert data["title"] == "Test" + assert data["idea"] == "idea" + pid = data["id"] + + r = client.get("/api/projects") + assert r.status_code == 200 + assert any(p["id"] == pid for p in r.json()) + + +def test_list_projects_includes_stats(client): + r = client.post("/api/projects", json={"title": "ListStats"}) + pid = r.json()["id"] + r = client.get("/api/projects") + assert r.status_code == 200 + item = next(p for p in r.json() if p["id"] == pid) + assert item["stats"] == { + "scene_count": 0, + "character_count": 0, + "asset_ready_count": 0, + "asset_total_count": 0, + } + + +def test_get_project_with_stats(client): + r = client.post("/api/projects", json={"title": "Stats"}) + pid = r.json()["id"] + r = client.get(f"/api/projects/{pid}") + assert r.status_code == 200 + data = r.json() + assert data["stats"]["scene_count"] == 0 + + +def test_update_project(client): + r = client.post("/api/projects", json={"title": "Old"}) + pid = r.json()["id"] + r = client.patch(f"/api/projects/{pid}", json={"title": "New"}) + assert r.status_code == 200 + assert r.json()["title"] == "New" + + +def test_update_project_cover(client): + r = client.post("/api/projects", json={"title": "Cover"}) + pid = r.json()["id"] + assert r.json()["cover_path"] is None + + r = client.patch(f"/api/projects/{pid}", json={"cover_path": "/tmp/cover.png"}) + assert r.status_code == 200 + assert r.json()["cover_path"] == "/tmp/cover.png" + + r = client.get(f"/api/projects/{pid}") + assert r.json()["cover_path"] == "/tmp/cover.png" + r = client.get("/api/projects") + assert next(p for p in r.json() if p["id"] == pid)["cover_path"] == "/tmp/cover.png" + + # Explicit null clears the cover again. + r = client.patch(f"/api/projects/{pid}", json={"cover_path": None}) + assert r.status_code == 200 + assert r.json()["cover_path"] is None + + # Unrelated patches leave the (cleared) cover untouched. + r = client.patch(f"/api/projects/{pid}", json={"title": "Cover 2"}) + assert r.json()["title"] == "Cover 2" + assert r.json()["cover_path"] is None + + +def test_delete_project(client): + r = client.post("/api/projects", json={"title": "Delete"}) + pid = r.json()["id"] + r = client.delete(f"/api/projects/{pid}") + assert r.status_code == 200 + r = client.get(f"/api/projects/{pid}") + assert r.status_code == 404 diff --git a/calliope-backend/tests/test_rebase_paths.py b/calliope-backend/tests/test_rebase_paths.py new file mode 100644 index 00000000..6e76843f --- /dev/null +++ b/calliope-backend/tests/test_rebase_paths.py @@ -0,0 +1,76 @@ +"""Tests for rebasing stored asset paths after the install folder moves.""" +from __future__ import annotations + +import json + +from calliope.db import SCHEMA, rebase_stale_asset_paths, get_db + + +def _make_db(tmp_path): + db_path = tmp_path / "calliope.db" + conn = get_db(db_path) + conn.executescript(SCHEMA) + return conn + + +def test_rebase_stale_paths(tmp_path): + old_root = tmp_path / "old" / "Calliope" / "calliope-backend" / "data" + new_data = tmp_path / "new" / "data" + new_assets = new_data / "assets" + conn = _make_db(tmp_path) + try: + conn.execute( + "INSERT INTO projects (title) VALUES ('demo')", + ) + conn.execute( + "INSERT INTO characters (project_id, name, sheet_path) VALUES (1, 'Mia', ?)", + (str(old_root / "assets" / "1" / "image" / "sheet.png"),), + ) + conn.execute( + "INSERT INTO scenes (project_id, order_index, video_path) VALUES (1, 1, ?)", + (str(old_root / "assets" / "1" / "video" / "clip.mp4"),), + ) + conn.execute( + "INSERT INTO jobs (project_id, kind, output_paths_json) VALUES (1, 'image', ?)", + (json.dumps([str(old_root / "assets" / "1" / "image" / "out.png")]),), + ) + # A path already under the current install must be left alone + current = str(new_assets / "2" / "image" / "keep.png") + conn.execute( + "INSERT INTO locations (project_id, name, reference_image_path) VALUES (1, 'Lab', ?)", + (current,), + ) + conn.commit() + + rebased = rebase_stale_asset_paths(conn, new_data, new_assets) + conn.commit() + + assert rebased == 3 + row = conn.execute("SELECT sheet_path FROM characters WHERE id = 1").fetchone() + assert row["sheet_path"] == str(new_assets / "1" / "image" / "sheet.png") + row = conn.execute("SELECT video_path FROM scenes WHERE id = 1").fetchone() + assert row["video_path"] == str(new_assets / "1" / "video" / "clip.mp4") + row = conn.execute("SELECT output_paths_json FROM jobs WHERE id = 1").fetchone() + assert json.loads(row["output_paths_json"]) == [ + str(new_assets / "1" / "image" / "out.png") + ] + row = conn.execute("SELECT reference_image_path FROM locations WHERE id = 1").fetchone() + assert row["reference_image_path"] == current + finally: + conn.close() + + +def test_rebase_ignores_relative_and_foreign_paths(tmp_path): + new_data = tmp_path / "data" + new_assets = new_data / "assets" + conn = _make_db(tmp_path) + try: + conn.execute("INSERT INTO projects (title, cover_path) VALUES ('demo', 'relative/x.png')") + conn.execute( + "INSERT INTO characters (project_id, name, sheet_path) VALUES (1, 'A', ?)", + ("C:/elsewhere/no-assets-segment.png",), + ) + conn.commit() + assert rebase_stale_asset_paths(conn, new_data, new_assets) == 0 + finally: + conn.close() diff --git a/calliope-backend/tests/test_roles.py b/calliope-backend/tests/test_roles.py new file mode 100644 index 00000000..c4846502 --- /dev/null +++ b/calliope-backend/tests/test_roles.py @@ -0,0 +1,104 @@ +"""Tests for Comfy title role tags and smart-fill by role.""" +from __future__ import annotations + +from calliope.comfyui.parser import parse_dynamic_inputs +from calliope.comfyui.roles import parse_title_tag +from calliope.comfyui.smart_fill import smart_fill_inputs + + +def test_parse_title_tag_with_role(): + kind, role, label = parse_title_tag("主提示词 (Input:prompt)") + assert kind == "input" + assert role == "prompt" + assert "主提示词" in label + assert "(Input" not in label + + +def test_parse_title_tag_role_only(): + kind, role, label = parse_title_tag("(Input:prompt)") + assert kind == "input" + assert role == "prompt" + assert label == "prompt" + + +def test_parse_title_tag_plain_input(): + kind, role, label = parse_title_tag("Width (Input)") + assert kind == "input" + assert role is None + assert label == "Width" + + +def test_smart_fill_uses_role_not_node_id(): + workflow = { + "999": { + "inputs": {"value": ""}, + "class_type": "PrimitiveStringMultiline", + "_meta": {"title": "Whatever Name (Input:prompt)"}, + }, + "7": { + "inputs": {"value": 512}, + "class_type": "PrimitiveInt", + "_meta": {"title": "W (Input:width)"}, + }, + } + inputs = parse_dynamic_inputs(workflow) + values = smart_fill_inputs( + inputs, + prompt="Jake tall athletic", + extra={"999": "", "7": 1280}, + ) + assert values["999"] == "Jake tall athletic" + assert values["7"] == 1280 + + +def test_input_prompt_alias_positive(): + workflow = { + "3": { + "inputs": {"text": ""}, + "class_type": "CLIPTextEncode", + "_meta": {"title": "Pos (Input:positive)"}, + }, + } + inputs = parse_dynamic_inputs(workflow) + assert inputs[0]["role"] == "prompt" + values = smart_fill_inputs(inputs, prompt="hello") + assert values["3"] == "hello" + + +def test_smart_fill_extra_overrides_context(): + """Form/user values must win on regenerate so edits are not wiped.""" + workflow = { + "9": { + "inputs": {"value": ""}, + "class_type": "PrimitiveStringMultiline", + "_meta": {"title": "Global (Input:prompt)"}, + }, + "12": { + "inputs": {"image": ""}, + "class_type": "LoadImage", + "_meta": {"title": "Ref 1 (Input:character)"}, + }, + } + inputs = parse_dynamic_inputs(workflow) + values = smart_fill_inputs( + inputs, + prompt="auto from scene", + character_image="/old/sheet.png", + extra={"9": "user edited prompt", "12": "/new/ref.png"}, + ) + assert values["9"] == "user edited prompt" + assert values["12"] == "/new/ref.png" + + +def test_input_duration_alias(): + workflow = { + "5": { + "inputs": {"value": 10}, + "class_type": "PrimitiveFloat", + "_meta": {"title": "(input:duration) Duration"}, + }, + } + inputs = parse_dynamic_inputs(workflow) + assert inputs[0]["role"] == "duration" + values = smart_fill_inputs(inputs, duration=7) + assert values["5"] == 7 diff --git a/calliope-backend/tests/test_script_scene_count.py b/calliope-backend/tests/test_script_scene_count.py new file mode 100644 index 00000000..f70f5b18 --- /dev/null +++ b/calliope-backend/tests/test_script_scene_count.py @@ -0,0 +1,86 @@ +"""Script regenerate must honor an expanded scene board.""" +from __future__ import annotations + +from calliope.agent.prompts import build_script_messages, recommend_scene_count + + +def test_build_script_messages_honors_expanded_scene_count(): + msgs = build_script_messages( + title="T", + idea="idea", + beats=[{"order_index": 1, "title": "B", "description": "d"}], + characters=[{"id": 1, "name": "Hero", "role": "lead", "appearance": "tall"}], + locations=[{"id": 1, "name": "Camp", "description": "night"}], + target_duration="30 seconds", + scene_count=6, + ) + user = msgs[1]["content"] + recommended = recommend_scene_count("30 seconds") + assert recommended <= 6 + assert "required_scene_count: 6" in user + assert "EXACTLY 6 objects" in user + assert "scenes.length == 6" in user + + +def test_script_regenerate_keeps_expanded_count(client, monkeypatch): + calls: list[int] = [] + + async def fake_structured(messages, temperature=0.7): + user = messages[1]["content"] + # Parse required count from prompt + n = 4 + for line in user.splitlines(): + if line.startswith("required_scene_count:"): + n = int(line.split(":", 1)[1].strip()) + break + calls.append(n) + return { + "scenes": [ + { + "order_index": i, + "heading": f"SCENE {i}", + "action": f"action {i}", + "dialog": "", + "duration_sec": 5, + "character_ids": [], + "location_id": None, + } + for i in range(1, n + 1) + ] + } + + monkeypatch.setattr("calliope.agent.script_agent.generate_structured", fake_structured) + + r = client.post("/api/projects", json={"title": "Expand", "idea": "desert", "target_duration": "30 seconds"}) + pid = r.json()["id"] + + # Seed 4 scenes via generate + r = client.post(f"/api/projects/{pid}/generate-script", json={"replace": True}) + assert r.status_code == 200 + assert len(r.json()["scenes"]) == calls[-1] + + # User expands board with empty scenes + for i in range(2): + existing = client.get(f"/api/projects/{pid}/scenes").json()["scenes"] + client.post( + f"/api/projects/{pid}/scenes", + json={ + "order_index": len(existing) + 1, + "heading": f"NEW SCENE {len(existing) + 1}", + "action": "", + "dialog": "", + "duration_sec": 5, + }, + ) + + board = client.get(f"/api/projects/{pid}/scenes").json()["scenes"] + expanded = len(board) + assert expanded >= 6 + + r = client.post( + f"/api/projects/{pid}/generate-script", + json={"replace": True, "scene_count": expanded}, + ) + assert r.status_code == 200 + assert len(r.json()["scenes"]) == expanded + assert calls[-1] == expanded diff --git a/calliope-web/package-lock.json b/calliope-web/package-lock.json new file mode 100644 index 00000000..3933a10a --- /dev/null +++ b/calliope-web/package-lock.json @@ -0,0 +1,4054 @@ +{ + "name": "calliope-web", + "version": "1.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "calliope-web", + "version": "1.1.0", + "dependencies": { + "@tanstack/svelte-query": "^5.66.0" + }, + "devDependencies": { + "@sveltejs/adapter-static": "^3.0.8", + "@sveltejs/kit": "^2.20.0", + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "@types/node": "^22.13.0", + "autoprefixer": "^10.4.20", + "eslint": "^9.20.0", + "eslint-plugin-svelte": "^2.46.0", + "postcss": "^8.5.0", + "prettier": "^3.5.0", + "prettier-plugin-svelte": "^3.3.0", + "svelte": "^5.20.0", + "svelte-check": "^4.1.0", + "tailwindcss": "^3.4.17", + "typescript": "^5.7.0", + "vite": "^6.1.0" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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/@eslint-community/eslint-utils": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.6.tgz", + "integrity": "sha512-l2Ul9PrHsPCKcEY/ac7VgFj9D80C7S68sOKc618SyHDPK36s1XcFebXY0iTzUVn4Yq+YbwvSnDmCz9yxjX+QrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.3.0", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.5", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.5.tgz", + "integrity": "sha512-QywQuszQh77pIXCsq998c8hbhSTI/azTty1Z6N53dmAudKHhy573j3yvRLsX2BSp8YpLtoCEG8E9DJe+8zUh4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "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==", + "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==", + "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==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "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==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", + "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz", + "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz", + "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", + "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz", + "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz", + "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz", + "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz", + "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz", + "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz", + "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz", + "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz", + "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz", + "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz", + "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz", + "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz", + "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz", + "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz", + "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz", + "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz", + "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", + "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz", + "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz", + "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz", + "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz", + "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sveltejs/acorn-typescript": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.11.tgz", + "integrity": "sha512-LFuZUkjJ9iF7JZye/aG5XM0SFcQ5VyL0oVX4WJ9dc0Va3R3s0OauX1BESVCb+YN/ol8TAfqGDDAQsTG627Y5kw==", + "license": "MIT", + "peerDependencies": { + "acorn": "^8.9.0" + } + }, + "node_modules/@sveltejs/adapter-static": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.10.tgz", + "integrity": "sha512-7D9lYFWJmB7zxZyTE/qxjksvMqzMuYrrsyh1f4AlZqeZeACPRySjbC3aFiY55wb1tWUaKOQG9PVbm74JcN2Iew==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@sveltejs/kit": "^2.0.0" + } + }, + "node_modules/@sveltejs/kit": { + "version": "2.70.1", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.70.1.tgz", + "integrity": "sha512-nY9SPHGOZro3doud9vZXDBwl9tCZIouuJztjgSHs6PAIrv9M/z5O7eOhPV5xU7CgVHA976Jwu3BA1hIFvXztkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@sveltejs/acorn-typescript": "^1.0.9", + "@types/cookie": "^0.6.0", + "acorn": "^8.16.0", + "cookie": "^0.6.0", + "devalue": "^5.8.1", + "esm-env": "^1.2.2", + "kleur": "^4.1.5", + "magic-string": "^0.30.5", + "mrmime": "^2.0.0", + "set-cookie-parser": "^3.0.0", + "sirv": "^3.0.0" + }, + "bin": { + "svelte-kit": "svelte-kit.js" + }, + "engines": { + "node": ">=18.13" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.0.0", + "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0", + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": "^5.3.3 || ^6.0.0", + "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/@sveltejs/load-config": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@sveltejs/load-config/-/load-config-0.2.0.tgz", + "integrity": "sha512-1LgZ/qUqSoq+QorD83lk2hka79Px0wXNW2q5V1nZlxGhQgw1jrsIbVz5YiCeucVLo4XvFLjXukUaQjIiqowkcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18.0.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-5.1.1.tgz", + "integrity": "sha512-Y1Cs7hhTc+a5E9Va/xwKlAJoariQyHY+5zBgCZg4PFWNYQ1nMN9sjK1zhw1gK69DuqVP++sht/1GZg1aRwmAXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sveltejs/vite-plugin-svelte-inspector": "^4.0.1", + "debug": "^4.4.1", + "deepmerge": "^4.3.1", + "kleur": "^4.1.5", + "magic-string": "^0.30.17", + "vitefu": "^1.0.6" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22" + }, + "peerDependencies": { + "svelte": "^5.0.0", + "vite": "^6.0.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte-inspector": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-4.0.1.tgz", + "integrity": "sha512-J/Nmb2Q2y7mck2hyCX4ckVHcR5tu2J+MtBEQqpDrrgELZ2uvraQcK/ioCV61AqkdXFgriksOKIceDcQmqnGhVw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.3.7" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "svelte": "^5.0.0", + "vite": "^6.0.0" + } + }, + "node_modules/@tanstack/query-core": { + "version": "5.90.2", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.2.tgz", + "integrity": "sha512-k/TcR3YalnzibscALLwxeiLUub6jN5EDLwKDiO7q5f4ICEoptJ+n9+7vcEFy5/x/i6Q+Lb/tXrsKCggf5uQJXQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/svelte-query": { + "version": "5.90.2", + "resolved": "https://registry.npmjs.org/@tanstack/svelte-query/-/svelte-query-5.90.2.tgz", + "integrity": "sha512-owjnp0w8sOXlMhLZhucHrsYvCjgjHrVyII/wlqMGefxKFyroZS3xCwTee+IUx7UHbL+QmKr/HQTeTqhgxmxPQw==", + "license": "MIT", + "dependencies": { + "@tanstack/query-core": "5.90.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "svelte": "^3.54.0 || ^4.0.0 || ^5.0.0" + } + }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "dev": true, + "license": "MIT" + }, + "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==", + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.20.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.1.tgz", + "integrity": "sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/aria-query": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz", + "integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/autoprefixer": { + "version": "10.5.4", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.5.4.tgz", + "integrity": "sha512-MaU0U/za7N3r6brxD4YB/l4NSrFzLPlANv6wEuQVaIPlD3L4W9rFcQPbL/EilY9BHhHvhfcz3gInDLrEtWT4EA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.28.6", + "caniuse-lite": "^1.0.30001806", + "fraction.js": "^5.3.4", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.1", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.1.tgz", + "integrity": "sha512-HYXq73DDpCtNzOmrFsm9eSwCvWCql0RzqjpDzXN9EadiLJ4DNat0nsZ/Bzmy+Ud12mb4/zKDY0cQ805ZzN+i0A==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", + "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.7.tgz", + "integrity": "sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==", + "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.10.44", + "caniuse-lite": "^1.0.30001806", + "electron-to-chromium": "^1.5.393", + "node-releases": "^2.0.51", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-css": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", + "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001806", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz", + "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==", + "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/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "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/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/devalue": { + "version": "5.8.2", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.8.2.tgz", + "integrity": "sha512-DObPPAfdtFbXjxLqK8s2Xk9ZuWz5+ZoFEhC7J76es4GU/rEiXwHTmbImoCdyoCOcBH1UF3+Cz6Z2sYD4hyl5TA==", + "license": "MIT" + }, + "node_modules/didyoumean": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", + "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/dlv": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", + "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", + "dev": true, + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.396", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.396.tgz", + "integrity": "sha512-yHiw2Y3C3H9U6TMbOfoWK/BPreiOPXRfTWPBwQBoZG6/8TB6eOPnsy5oaRYuatR7Fw2SJ4kKforgufeo7fq0EQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "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/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.5", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.5.tgz", + "integrity": "sha512-DgZS62aPLXKlnxILS/AYCoRvHaZeXceIzlXPkkGGzJWSow1aEk0lbTlxUSlyjC8jcaKxAdOnTDz+o1JFSBsyjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.6", + "@eslint/js": "9.39.5", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-compat-utils": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz", + "integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-plugin-svelte": { + "version": "2.46.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-2.46.1.tgz", + "integrity": "sha512-7xYr2o4NID/f9OEYMqxsEQsCsj4KaMy4q5sANaKkAb6/QeCjYFxRmDm2S3YC3A3pl1kyPZ/syOx/i7LcWYSbIw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@jridgewell/sourcemap-codec": "^1.4.15", + "eslint-compat-utils": "^0.5.1", + "esutils": "^2.0.3", + "known-css-properties": "^0.35.0", + "postcss": "^8.4.38", + "postcss-load-config": "^3.1.4", + "postcss-safe-parser": "^6.0.0", + "postcss-selector-parser": "^6.1.0", + "semver": "^7.6.2", + "svelte-eslint-parser": "^0.43.0" + }, + "engines": { + "node": "^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0-0 || ^9.0.0-0", + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esm-env": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", + "license": "MIT" + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrap": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.3.0.tgz", + "integrity": "sha512-GQ/7RN8uOtEfNpzZzBMTzW9JBcX42oaSVtPzdF+6cEL8pqIL094iUpr9jzYGn4O4P/1S60dJ6izyT8F4LYARng==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "peerDependencies": { + "@typescript-eslint/types": "^8.2.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/types": { + "optional": true + } + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "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/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.3.tgz", + "integrity": "sha512-/zipXxyO6rGvuNGDiULY9MvEGSkb2gaG4GGH4ygMi0ZZzyMHdUZBmntJmx5x1G2VuPytCwGN4xsJP6cw+sK+vQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/fraction.js": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", + "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/rawify" + } + }, + "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/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-core-module": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-reference": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "bin/jiti.js" + } + }, + "node_modules/js-yaml": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", + "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/known-css-properties": { + "version": "0.35.0", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.35.0.tgz", + "integrity": "sha512-a/RAk2BfKk+WFGhhOCAYqSiFLc34k8Mt/6NWRI4joER0EYUzXIcFivjjnoD3+XU1DggLn/tZc3DOAgke7l8a4A==", + "dev": true, + "license": "MIT" + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true, + "license": "MIT" + }, + "node_modules/locate-character": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", + "license": "MIT" + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "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/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.16", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.16.tgz", + "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", + "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/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.51", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", + "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "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.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss": { + "version": "8.5.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.22.tgz", + "integrity": "sha512-KBDEIpLrvpv16pp3K0Fw+UCoZfopFjjgeB+0tA/aaThfEE74kKDLrgg603YvOWJyg3+WYtyq3xYsQWsIyZlPqQ==", + "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.16", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-import": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", + "dev": true, + "license": "MIT", + "dependencies": { + "postcss-value-parser": "^4.0.0", + "read-cache": "^1.0.0", + "resolve": "^1.1.7" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "postcss": "^8.0.0" + } + }, + "node_modules/postcss-js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz", + "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "camelcase-css": "^2.0.1" + }, + "engines": { + "node": "^12 || ^14 || >= 16" + }, + "peerDependencies": { + "postcss": "^8.4.21" + } + }, + "node_modules/postcss-load-config": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz", + "integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "lilconfig": "^2.0.5", + "yaml": "^1.10.2" + }, + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": ">=8.0.9", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "postcss": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/postcss-load-config/node_modules/yaml": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz", + "integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-safe-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz", + "integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + "peerDependencies": { + "postcss": "^8.3.3" + } + }, + "node_modules/postcss-scss": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-4.0.9.tgz", + "integrity": "sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss-scss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.4.29" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.4.tgz", + "integrity": "sha512-bIoJLOmjCO1S9XdY/DcnR5hJxvrDir1PbGChrzXG3vw0/FOliy/fA3dmdhQ441kah4gKv+TwckGzex6wNS5cnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz", + "integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-svelte": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.5.2.tgz", + "integrity": "sha512-ItFouLvzSFE3ulNl4DKoWM3BGcbDCNVpIyy/Y3F2gC3aNiGLxtFUdffVqO5Z5hhYG+DFT5KULWaxmeFFpdbvaQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "prettier": "^3.0.0", + "svelte": "^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^2.3.0" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/resolve": { + "version": "1.22.12", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", + "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", + "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", + "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": { + "@rollup/rollup-android-arm-eabi": "4.62.2", + "@rollup/rollup-android-arm64": "4.62.2", + "@rollup/rollup-darwin-arm64": "4.62.2", + "@rollup/rollup-darwin-x64": "4.62.2", + "@rollup/rollup-freebsd-arm64": "4.62.2", + "@rollup/rollup-freebsd-x64": "4.62.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.62.2", + "@rollup/rollup-linux-arm-musleabihf": "4.62.2", + "@rollup/rollup-linux-arm64-gnu": "4.62.2", + "@rollup/rollup-linux-arm64-musl": "4.62.2", + "@rollup/rollup-linux-loong64-gnu": "4.62.2", + "@rollup/rollup-linux-loong64-musl": "4.62.2", + "@rollup/rollup-linux-ppc64-gnu": "4.62.2", + "@rollup/rollup-linux-ppc64-musl": "4.62.2", + "@rollup/rollup-linux-riscv64-gnu": "4.62.2", + "@rollup/rollup-linux-riscv64-musl": "4.62.2", + "@rollup/rollup-linux-s390x-gnu": "4.62.2", + "@rollup/rollup-linux-x64-gnu": "4.62.2", + "@rollup/rollup-linux-x64-musl": "4.62.2", + "@rollup/rollup-openbsd-x64": "4.62.2", + "@rollup/rollup-openharmony-arm64": "4.62.2", + "@rollup/rollup-win32-arm64-msvc": "4.62.2", + "@rollup/rollup-win32-ia32-msvc": "4.62.2", + "@rollup/rollup-win32-x64-gnu": "4.62.2", + "@rollup/rollup-win32-x64-msvc": "4.62.2", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-cookie-parser": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.1.2.tgz", + "integrity": "sha512-5/r/lTwbJ3zQ+qwdUFZYeRNqda7P5HD8zQKqlSjdGt1/S0cjLAphHusj4Y58ahDtWn/g32xrIS58/ikOvwl0Lw==", + "dev": true, + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/sirv": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", + "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "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/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/svelte": { + "version": "5.56.7", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.56.7.tgz", + "integrity": "sha512-5qERUZX80oQj6XrDMUmD2Uhd/cIpCPDWWKBK3ZHmyRUC9apPyamWM8xMo31mbWsIQxwG2hVoSnOJ/EcnhVkkzQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@sveltejs/acorn-typescript": "^1.0.10", + "@types/estree": "^1.0.5", + "@types/trusted-types": "^2.0.7", + "acorn": "^8.12.1", + "aria-query": "5.3.1", + "axobject-query": "^4.1.0", + "clsx": "^2.1.1", + "devalue": "^5.8.1", + "esm-env": "^1.2.1", + "esrap": "^2.2.12", + "is-reference": "^3.0.3", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/svelte-check": { + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.7.3.tgz", + "integrity": "sha512-DHdTCGX62R0fCxBEaT+USdASAnoaRBaaNczkRJl0K7o3WyoCeVUbVxo6fKqpOll/B+WMWCsiFK0eFrJSNBKZIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "@sveltejs/load-config": "^0.2.0", + "chokidar": "^4.0.1", + "fdir": "^6.2.0", + "picocolors": "^1.0.0", + "sade": "^1.7.4" + }, + "bin": { + "svelte-check": "bin/svelte-check" + }, + "engines": { + "node": ">= 18.0.0" + }, + "peerDependencies": { + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": ">=5.0.0" + } + }, + "node_modules/svelte-eslint-parser": { + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/svelte-eslint-parser/-/svelte-eslint-parser-0.43.0.tgz", + "integrity": "sha512-GpU52uPKKcVnh8tKN5P4UZpJ/fUDndmq7wfsvoVXsyP+aY0anol7Yqo01fyrlaWGMFfm4av5DyrjlaXdLRJvGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "postcss": "^8.4.39", + "postcss-scss": "^4.0.9" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "svelte": "^3.37.0 || ^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + } + } + }, + "node_modules/svelte-eslint-parser/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/svelte-eslint-parser/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/svelte-eslint-parser/node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/tailwindcss": { + "version": "3.4.19", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz", + "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "arg": "^5.0.2", + "chokidar": "^3.6.0", + "didyoumean": "^1.2.2", + "dlv": "^1.1.3", + "fast-glob": "^3.3.2", + "glob-parent": "^6.0.2", + "is-glob": "^4.0.3", + "jiti": "^1.21.7", + "lilconfig": "^3.1.3", + "micromatch": "^4.0.8", + "normalize-path": "^3.0.0", + "object-hash": "^3.0.0", + "picocolors": "^1.1.1", + "postcss": "^8.4.47", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", + "postcss-nested": "^6.2.0", + "postcss-selector-parser": "^6.1.2", + "resolve": "^1.22.8", + "sucrase": "^3.35.0" + }, + "bin": { + "tailwind": "lib/cli.js", + "tailwindcss": "lib/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tailwindcss/node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/tailwindcss/node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/tailwindcss/node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/tailwindcss/node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tailwindcss/node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/tailwindcss/node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "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/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "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.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "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/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "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/vitefu": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz", + "integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==", + "dev": true, + "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*", + "tests/projects/workspace/packages/*" + ], + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "extraneous": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zimmerframe": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", + "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", + "license": "MIT" + } + } +} diff --git a/calliope-web/package.json b/calliope-web/package.json new file mode 100644 index 00000000..24070d36 --- /dev/null +++ b/calliope-web/package.json @@ -0,0 +1,34 @@ +{ + "name": "calliope-web", + "version": "1.1.0", + "private": true, + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "lint": "prettier --check . && eslint .", + "format": "prettier --write ." + }, + "devDependencies": { + "@sveltejs/adapter-static": "^3.0.8", + "@sveltejs/kit": "^2.20.0", + "@sveltejs/vite-plugin-svelte": "^5.0.0", + "@types/node": "^22.13.0", + "autoprefixer": "^10.4.20", + "eslint": "^9.20.0", + "eslint-plugin-svelte": "^2.46.0", + "postcss": "^8.5.0", + "prettier": "^3.5.0", + "prettier-plugin-svelte": "^3.3.0", + "svelte": "^5.20.0", + "svelte-check": "^4.1.0", + "tailwindcss": "^3.4.17", + "typescript": "^5.7.0", + "vite": "^6.1.0" + }, + "dependencies": { + "@tanstack/svelte-query": "^5.66.0" + }, + "type": "module" +} diff --git a/calliope-web/src/app.html b/calliope-web/src/app.html new file mode 100644 index 00000000..0a71bc46 --- /dev/null +++ b/calliope-web/src/app.html @@ -0,0 +1,18 @@ + + + + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/calliope-web/src/hooks.client.ts b/calliope-web/src/hooks.client.ts new file mode 100644 index 00000000..6fa26381 --- /dev/null +++ b/calliope-web/src/hooks.client.ts @@ -0,0 +1,8 @@ +import type { HandleClientError } from '@sveltejs/kit'; + +export const handleError: HandleClientError = ({ error }) => { + console.error(error); + return { + message: 'Something went wrong.', + }; +}; diff --git a/calliope-web/src/hooks.server.ts b/calliope-web/src/hooks.server.ts new file mode 100644 index 00000000..bd4c6e5b --- /dev/null +++ b/calliope-web/src/hooks.server.ts @@ -0,0 +1,4 @@ +export async function handle({ event, resolve }) { + const response = await resolve(event); + return response; +} diff --git a/calliope-web/src/lib/api.ts b/calliope-web/src/lib/api.ts new file mode 100644 index 00000000..b7ed1b0a --- /dev/null +++ b/calliope-web/src/lib/api.ts @@ -0,0 +1,312 @@ +const API_BASE = ''; + +export interface Project { + id: number; + title: string; + idea: string | null; + genre: string | null; + tone: string | null; + target_duration: string | null; + cover_path: string | null; + status: string; + created_at: string; + updated_at: string; + stats?: ProjectStats; +} + +export interface ProjectStats { + scene_count: number; + character_count: number; + asset_ready_count: number; + asset_total_count: number; +} + +export interface ProjectCreate { + title: string; + idea?: string; + genre?: string; + tone?: string; + target_duration?: string; +} + +export interface Beat { + id: number; + order_index: number; + title: string; + description: string | null; +} + +export interface Character { + id: number; + name: string; + role: string | null; + age: string | null; + appearance: string | null; + personality: string | null; + portrait_path: string | null; + sheet_path: string | null; + consistency_prompt: string | null; +} + +export interface Location { + id: number; + name: string; + description: string | null; + reference_image_path: string | null; + consistency_prompt: string | null; +} + +export interface StoryData { + project: Project; + beats: Beat[]; + characters: Character[]; + locations: Location[]; +} + +export interface Settings { + host: string; + port: number; + data_dir: string; + assets_dir: string; + db_name: string; + llm_base_url: string; + llm_model: string; + llm_api_key: boolean; + comfyui_base_url: string; + queue_concurrency: number; + queue_poll_interval_sec: number; + queue_max_retries: number; + dry_run: boolean; +} + +import type { Job, Scene, Workflow, ComfyDynamicInput, ComfyDynamicOutput } from './comfy/types'; +export type { Job, Scene, Workflow, ComfyDynamicInput, ComfyDynamicOutput }; + +async function api(path: string, init?: RequestInit): Promise { + const res = await fetch(`${API_BASE}${path}`, { + ...init, + headers: { + 'Content-Type': 'application/json', + ...init?.headers, + }, + }); + if (!res.ok) { + const body = await res.text().catch(() => 'unknown error'); + throw new Error(`${res.status}: ${body}`); + } + return res.json() as Promise; +} + +/** Multipart variant of api() — FormData sets its own Content-Type boundary. */ +async function apiUpload(path: string, form: FormData): Promise { + const res = await fetch(`${API_BASE}${path}`, { method: 'POST', body: form }); + if (!res.ok) { + const body = await res.text().catch(() => 'unknown error'); + throw new Error(`${res.status}: ${body}`); + } + return res.json() as Promise; +} + +export function assetUrl(path: string | null | undefined): string | null { + if (!path) return null; + return `/api/file?path=${encodeURIComponent(path)}`; +} + +export const projects = { + list: () => api('/api/projects'), + create: (payload: ProjectCreate) => + api('/api/projects', { method: 'POST', body: JSON.stringify(payload) }), + get: (id: number) => api(`/api/projects/${id}`), + update: (id: number, payload: Partial) => + api(`/api/projects/${id}`, { method: 'PATCH', body: JSON.stringify(payload) }), + delete: (id: number) => api<{ ok: boolean }>(`/api/projects/${id}`, { method: 'DELETE' }), + generateStory: (id: number) => + api<{ ok: boolean; generated: unknown }>(`/api/projects/${id}/generate-story`, { + method: 'POST', + }), + getStory: (id: number) => api(`/api/projects/${id}/story`), + updateBeat: (projectId: number, beatId: number, payload: Partial) => + api(`/api/projects/${projectId}/beats/${beatId}`, { + method: 'PATCH', + body: JSON.stringify(payload), + }), + updateCharacter: (projectId: number, characterId: number, payload: Partial) => + api(`/api/projects/${projectId}/characters/${characterId}`, { + method: 'PATCH', + body: JSON.stringify(payload), + }), + updateLocation: (projectId: number, locationId: number, payload: Partial) => + api(`/api/projects/${projectId}/locations/${locationId}`, { + method: 'PATCH', + body: JSON.stringify(payload), + }), + deleteBeat: (projectId: number, beatId: number) => + api<{ ok: boolean }>(`/api/projects/${projectId}/beats/${beatId}`, { method: 'DELETE' }), + deleteCharacter: (projectId: number, characterId: number) => + api<{ ok: boolean }>(`/api/projects/${projectId}/characters/${characterId}`, { + method: 'DELETE', + }), + deleteLocation: (projectId: number, locationId: number) => + api<{ ok: boolean }>(`/api/projects/${projectId}/locations/${locationId}`, { + method: 'DELETE', + }), + getScenes: (id: number) => + api<{ scenes: Scene[]; estimated_duration_sec: number }>(`/api/projects/${id}/scenes`), + generateScript: (id: number, opts?: { scene_count?: number }) => + api<{ ok: boolean; scenes: Scene[] }>(`/api/projects/${id}/generate-script`, { + method: 'POST', + body: JSON.stringify({ + replace: true, + ...(opts?.scene_count != null ? { scene_count: opts.scene_count } : {}), + }), + }), + updateScene: (projectId: number, sceneId: number, payload: Record) => + api(`/api/projects/${projectId}/scenes/${sceneId}`, { + method: 'PATCH', + body: JSON.stringify(payload), + }), + createScene: (projectId: number, payload: Record) => + api(`/api/projects/${projectId}/scenes`, { + method: 'POST', + body: JSON.stringify(payload), + }), + deleteScene: (projectId: number, sceneId: number) => + api<{ ok: boolean }>(`/api/projects/${projectId}/scenes/${sceneId}`, { method: 'DELETE' }), + reorderScenes: (projectId: number, sceneIds: number[]) => + api<{ scenes: Scene[] }>(`/api/projects/${projectId}/scenes/reorder`, { + method: 'POST', + body: JSON.stringify({ scene_ids: sceneIds }), + }), + generateAssets: ( + id: number, + payload: { + missing_only?: boolean; + character_ids?: number[]; + location_ids?: number[]; + workflow_id?: number; + input_values?: Record; + asset_target?: 'sheet'; + prompt?: string; + } = {}, + ) => + api<{ ok: boolean; jobs: Job[] }>(`/api/projects/${id}/generate-assets`, { + method: 'POST', + body: JSON.stringify(payload), + }), + getAssets: (id: number) => + api<{ characters: Character[]; locations: Location[] }>(`/api/projects/${id}/assets`), +}; + +export const settings = { + get: () => api('/api/settings'), + update: (payload: Record) => + api('/api/settings', { method: 'POST', body: JSON.stringify(payload) }), +}; + +export const workflows = { + list: () => api('/api/workflows'), + analyze: (workflow_json: Record) => + api<{ + inputs: ComfyDynamicInput[]; + outputs: ComfyDynamicOutput[]; + suggested_profile?: string; + }>('/api/workflows/analyze', { + method: 'POST', + body: JSON.stringify({ workflow_json }), + }), + create: (payload: { + name: string; + kind: 'image' | 'video'; + workflow_json: Record; + description?: string; + prompt_profile?: string; + }) => api('/api/workflows', { method: 'POST', body: JSON.stringify(payload) }), + update: ( + id: number, + payload: Partial<{ + name: string; + kind: string; + is_enabled: boolean; + description: string; + prompt_profile: string; + }>, + ) => api(`/api/workflows/${id}`, { method: 'PATCH', body: JSON.stringify(payload) }), + delete: (id: number) => api<{ ok: boolean }>(`/api/workflows/${id}`, { method: 'DELETE' }), + get: (id: number) => api(`/api/workflows/${id}`), +}; + +export const jobsApi = { + list: (projectId?: number) => + api(`/api/jobs${projectId != null ? `?project_id=${projectId}` : ''}`), + retry: (id: number) => api(`/api/jobs/${id}/retry`, { method: 'POST' }), + cancel: (id: number) => api<{ ok: boolean }>(`/api/jobs/${id}/cancel`, { method: 'POST' }), + pause: () => api<{ ok: boolean; paused: boolean }>('/api/jobs/pause', { method: 'POST' }), + resume: () => api<{ ok: boolean; paused: boolean }>('/api/jobs/resume', { method: 'POST' }), + queueStatus: () => api<{ paused: boolean }>('/api/jobs/queue-status'), + generateVideos: ( + projectId: number, + payload: { + scene_ids?: number[]; + workflow_id?: number; + input_values?: Record; + } = {}, + ) => + api<{ ok: boolean; jobs: Job[] }>(`/api/jobs/projects/${projectId}/generate-videos`, { + method: 'POST', + body: JSON.stringify(payload), + }), + exportFilm: (projectId: number) => + api<{ ok: boolean; job: Job }>(`/api/jobs/projects/${projectId}/export`, { method: 'POST' }), +}; + +export type PlaygroundAttachTarget = 'character_sheet' | 'location' | 'scene'; + +export type UploadKind = 'image' | 'video' | 'audio'; + +export interface PlaygroundUpload { + ok: boolean; + path: string; + name: string; + kind: UploadKind; +} + +export interface PlaygroundUploadListItem { + name: string; + path: string; + kind: UploadKind; + size: number; + mtime: string; +} + +export const playgroundApi = { + project: () => api('/api/playground/project'), + jobs: () => api('/api/playground/jobs'), + generate: (payload: { workflow_id: number; input_values?: Record }) => + api<{ ok: boolean; job: Job }>('/api/playground/generate', { + method: 'POST', + body: JSON.stringify(payload), + }), + upload: (file: File) => { + const form = new FormData(); + form.append('file', file); + return apiUpload('/api/playground/uploads', form); + }, + listUploads: () => api('/api/playground/uploads'), + deleteJob: (jobId: number) => + api<{ ok: boolean; job_id: number; deleted_files: string[]; missing_files: string[] }>( + `/api/playground/jobs/${jobId}`, + { method: 'DELETE' }, + ), + attach: (payload: { + path: string; + project_id: number; + target: PlaygroundAttachTarget; + character_id?: number; + location_id?: number; + scene_id?: number; + }) => + api<{ ok: boolean; path: string; target: string; project_id: number }>( + '/api/playground/attach', + { method: 'POST', body: JSON.stringify(payload) }, + ), +}; diff --git a/calliope-web/src/lib/comfy/classifyInput.ts b/calliope-web/src/lib/comfy/classifyInput.ts new file mode 100644 index 00000000..5d739a80 --- /dev/null +++ b/calliope-web/src/lib/comfy/classifyInput.ts @@ -0,0 +1,151 @@ +/** + * Omni Composer input classification. + * + * Maps each ComfyDynamicInput — based on its canonical role — to a UI zone + * and widget type inside the Omni layout. This is presentation-only: the + * underlying values map (nodeId → value) is identical to what + * ComfyDynamicForm would produce. + * + * Zones: + * composer → main prompt textarea + collapsible negative + * media → thumbnail tiles (upload / asset-pick) + * control → compact pills (resolution, duration, seed) + * advanced → hidden inside an "Advanced" popover + */ +import type { ComfyDynamicInput } from './types'; +import { normalizeInputRole } from './parser'; + +export type InputZone = 'composer' | 'media' | 'control' | 'advanced'; + +export type OmniWidget = + | 'promptTextarea' + | 'negativeTextarea' + | 'uploadTile' + | 'assetTile' + | 'resolutionPill' + | 'numberPill' + | 'textPill'; + +export interface ClassifiedInput { + input: ComfyDynamicInput; + zone: InputZone; + widget: OmniWidget; +} + +/** + * Classify a single input by its canonical role. + * + * The rules are deliberately exhaustive — every input lands in exactly one + * zone. Unknown roles fall to `advanced` so no field is ever hidden or lost. + */ +export function classifyInput(inp: ComfyDynamicInput): ClassifiedInput { + const role = normalizeInputRole(inp.role); + + // --- Composer --- + if (role === 'prompt' || role === 'positive') { + return { input: inp, zone: 'composer', widget: 'promptTextarea' }; + } + if (role === 'negative') { + return { input: inp, zone: 'composer', widget: 'negativeTextarea' }; + } + + // --- Media tray --- + if (role === 'character' || role === 'location' || role === 'image') { + const isImageKind = inp.kind === 'image' || inp.kind === 'image_url'; + return { + input: inp, + zone: 'media', + widget: isImageKind ? 'uploadTile' : 'assetTile', + }; + } + + // --- Control bar --- + if (role === 'width' || role === 'height') { + return { input: inp, zone: 'control', widget: 'resolutionPill' }; + } + if (role === 'duration' || role === 'seed') { + return { input: inp, zone: 'control', widget: 'numberPill' }; + } + + // --- Advanced popover --- + if (inp.kind === 'number') { + return { input: inp, zone: 'advanced', widget: 'numberPill' }; + } + return { input: inp, zone: 'advanced', widget: 'textPill' }; +} + +/** + * Batch-classify an entire input schema into grouped buckets. + * + * Resolution pairs (width + height in the same schema) are detected so the + * OmniComposer can render a single "Resolution" pill that writes both + * nodeIds on change. + */ +export function classifyAll(inputs: ComfyDynamicInput[]): { + prompt: ClassifiedInput | null; + negative: ClassifiedInput | null; + media: ClassifiedInput[]; + control: ClassifiedInput[]; + advanced: ClassifiedInput[]; + /** Non-null when both width AND height are present → merge into one pill. */ + resolutionPair: { width: ClassifiedInput; height: ClassifiedInput } | null; +} { + const classified = inputs.map(classifyInput); + + const prompt = classified.find((c) => c.widget === 'promptTextarea') ?? null; + const negative = classified.find((c) => c.widget === 'negativeTextarea') ?? null; + const media = classified.filter((c) => c.zone === 'media'); + const advanced = classified.filter((c) => c.zone === 'advanced'); + + // Separate resolution from other control inputs + const controlNonRes = classified.filter( + (c) => c.zone === 'control' && c.widget !== 'resolutionPill', + ); + const resInputs = classified.filter((c) => c.widget === 'resolutionPill'); + + // Detect width + height pair + const wInput = resInputs.find((c) => normalizeInputRole(c.input.role) === 'width'); + const hInput = resInputs.find((c) => normalizeInputRole(c.input.role) === 'height'); + const resolutionPair = + wInput && hInput ? { width: wInput, height: hInput } : null; + + // If only one of width/height exists, treat it as a standalone control number pill + const standaloneRes = resolutionPair ? [] : resInputs; + + return { + prompt, + negative, + media, + control: [...controlNonRes, ...standaloneRes], + advanced, + resolutionPair, + }; +} + +// ── Resolution presets ──────────────────────────────────────────────────────── + +export interface ResolutionPreset { + label: string; + width: number; + height: number; +} + +export const RESOLUTION_PRESETS: ResolutionPreset[] = [ + { label: '720p', width: 1280, height: 720 }, + { label: '1080p', width: 1920, height: 1080 }, +]; + +/** + * Given current width/height values, find the matching preset label + * (or return null for custom / unset values). + */ +export function resolutionLabel( + width: number | string | undefined, + height: number | string | undefined, +): string | null { + const w = Number(width); + const h = Number(height); + if (!w || !h) return null; + const match = RESOLUTION_PRESETS.find((p) => p.width === w && p.height === h); + return match?.label ?? `${w}×${h}`; +} diff --git a/calliope-web/src/lib/comfy/parser.ts b/calliope-web/src/lib/comfy/parser.ts new file mode 100644 index 00000000..19450c4d --- /dev/null +++ b/calliope-web/src/lib/comfy/parser.ts @@ -0,0 +1,137 @@ +import type { ComfyDynamicInput, ComfyDynamicOutput, WorkflowNode } from './types'; + +const TEXT_AREA = new Set([ + 'CLIPTextEncode', + 'Note', + 'ShowText', + 'ImpactWildcardProcessor', + 'PrimitiveStringMultiline', + 'PrimitiveString', +]); +const NUMBER = new Set(['INT', 'FLOAT', 'PrimitiveInt', 'PrimitiveFloat', 'KSampler', 'KSamplerAdvanced']); +const IMAGE = new Set(['LoadImage', 'ImageLoader', 'ETN_LoadImageBase64']); +const IMAGE_URL = new Set(['Load Image From Url (mtb)']); +const AUDIO = new Set(['LoadAudio', 'VHS_LoadAudio']); +const VIDEO_OUT = new Set(['VHS_VideoCombine', 'SaveVideo', 'VideoOutput', 'AnimateDiffCombine']); +const IMAGE_OUT = new Set(['SaveImage', 'PreviewImage', 'SaveImageWebsocket', 'ETN_SendImageWebSocket']); + +/** Matches (Input), (Input:prompt), (Output:image), … */ +const TITLE_TAG_RE = /\((Input|Output)(?::([a-zA-Z0-9_-]+))?\)/i; + +const INPUT_ROLE_ALIASES: Record = { + prompt: ['prompt', 'positive'], + negative: ['negative', 'neg'], + width: ['width', 'w'], + height: ['height', 'h'], + character: ['character', 'char', 'portrait', 'sheet', 'face', 'ref'], + location: ['location', 'loc', 'environment', 'env', 'background', 'scene'], + image: ['image', 'img'], + seed: ['seed'], + duration: ['duration', 'dur', 'length', 'seconds'], +}; + +const OUTPUT_ROLE_ALIASES: Record = { + image: ['image', 'img'], + video: ['video', 'vid'], +}; + +export function parseTitleTag(title: string): { + kind: 'input' | 'output' | null; + role: string | null; + label: string; +} { + if (!title) return { kind: null, role: null, label: '' }; + const match = TITLE_TAG_RE.exec(title); + if (!match) return { kind: null, role: null, label: title.trim() }; + const kind = match[1].toLowerCase() as 'input' | 'output'; + const role = match[2] ? match[2].toLowerCase() : null; + const stripped = title.replace(TITLE_TAG_RE, '').trim(); + const label = stripped || role || kind; + return { kind, role, label }; +} + +export function normalizeInputRole(role: string | null | undefined): string | null { + if (!role) return null; + const r = role.toLowerCase().trim(); + for (const [canonical, aliases] of Object.entries(INPUT_ROLE_ALIASES)) { + if (r === canonical || aliases.includes(r)) return canonical; + } + return r; +} + +export function normalizeOutputRole(role: string | null | undefined): string | null { + if (!role) return null; + const r = role.toLowerCase().trim(); + for (const [canonical, aliases] of Object.entries(OUTPUT_ROLE_ALIASES)) { + if (r === canonical || aliases.includes(r)) return canonical; + } + return r; +} + +function classToInputKind(classType: string): ComfyDynamicInput['kind'] { + if (IMAGE.has(classType)) return 'image'; + if (IMAGE_URL.has(classType)) return 'image_url'; + if (AUDIO.has(classType)) return 'audio'; + if (NUMBER.has(classType)) return 'number'; + if (TEXT_AREA.has(classType)) return 'textarea'; + const lower = classType.toLowerCase(); + if (lower.includes('image') || lower.includes('load')) return 'image'; + if (lower.includes('audio')) return 'audio'; + if (lower.includes('int') || lower.includes('float') || lower.includes('seed')) return 'number'; + if (lower.includes('text') || lower.includes('clip') || lower.includes('prompt')) return 'textarea'; + return 'text'; +} + +function extractDefault(node: WorkflowNode): string | number | undefined { + const { inputs, class_type } = node; + if (IMAGE.has(class_type) || AUDIO.has(class_type)) return undefined; + if (typeof inputs.text === 'string') return inputs.text; + if (typeof inputs.value === 'string' || typeof inputs.value === 'number') return inputs.value; + if (typeof inputs.int === 'number') return inputs.int; + if (typeof inputs.float === 'number') return inputs.float; + return undefined; +} + +export function parseDynamicInputs(workflow: Record): ComfyDynamicInput[] { + const results: ComfyDynamicInput[] = []; + for (const [nodeId, node] of Object.entries(workflow)) { + const title = node._meta?.title ?? ''; + const { kind, role, label } = parseTitleTag(title); + if (kind !== 'input') continue; + results.push({ + nodeId, + label: label || node.class_type, + role: normalizeInputRole(role), + kind: classToInputKind(node.class_type), + defaultValue: extractDefault(node), + required: true, + }); + } + return results; +} + +export function parseDynamicOutputs(workflow: Record): ComfyDynamicOutput[] { + const results: ComfyDynamicOutput[] = []; + for (const [nodeId, node] of Object.entries(workflow)) { + const title = node._meta?.title ?? ''; + const { kind, role, label } = parseTitleTag(title); + if (kind !== 'output') continue; + const canon = normalizeOutputRole(role); + let outKind: ComfyDynamicOutput['kind'] = 'other'; + if (canon === 'video' || VIDEO_OUT.has(node.class_type) || node.class_type.toLowerCase().includes('video')) + outKind = 'video'; + else if ( + canon === 'image' || + IMAGE_OUT.has(node.class_type) || + node.class_type.toLowerCase().includes('image') + ) + outKind = 'image'; + results.push({ + nodeId, + label: label || node.class_type, + role: canon, + kind: outKind, + }); + } + return results; +} diff --git a/calliope-web/src/lib/comfy/promptInput.ts b/calliope-web/src/lib/comfy/promptInput.ts new file mode 100644 index 00000000..6195a675 --- /dev/null +++ b/calliope-web/src/lib/comfy/promptInput.ts @@ -0,0 +1,50 @@ +import type { ComfyDynamicInput } from './types'; +import { normalizeInputRole } from './parser'; + +const PROMPT_ROLES = new Set(['prompt', 'positive']); + +function roleOf(inp: ComfyDynamicInput): string | null { + return normalizeInputRole(inp.role ?? null); +} + +/** Positive prompt input — prefers (Input:prompt), legacy label fallback. */ +export function isPromptLikeInput(inp: ComfyDynamicInput): boolean { + const role = roleOf(inp); + if (role && PROMPT_ROLES.has(role)) return true; + if (role) return false; // other roles are never "the" prompt + if (inp.kind !== 'text' && inp.kind !== 'textarea') return false; + const label = (inp.label || '').toLowerCase(); + if (label.includes('negative')) return false; + return ( + label.includes('prompt') || + label.includes('positive') || + label.includes('text') || + inp.kind === 'textarea' + ); +} + +/** Drop prompt-role fields from shared workflow forms (entity Image prompt owns those). */ +export function withoutPromptInputs(inputs: ComfyDynamicInput[] | undefined | null): ComfyDynamicInput[] { + if (!inputs?.length) return []; + return inputs.filter((inp) => !isPromptLikeInput(inp)); +} + +/** True if this workflow schema has a prompt-role (or legacy prompt-like) (Input). */ +export function workflowHasPromptInput(inputs: ComfyDynamicInput[] | undefined | null): boolean { + if (!inputs?.length) return false; + return inputs.some(isPromptLikeInput); +} + +/** Strip blank strings so empty fields cannot wipe smart-fill. */ +export function compactInputValues( + values: Record | undefined | null, +): Record { + if (!values) return {}; + const out: Record = {}; + for (const [k, v] of Object.entries(values)) { + if (v === null || v === undefined) continue; + if (typeof v === 'string' && !v.trim()) continue; + out[k] = v; + } + return out; +} diff --git a/calliope-web/src/lib/comfy/types.ts b/calliope-web/src/lib/comfy/types.ts new file mode 100644 index 00000000..6d1ef7d5 --- /dev/null +++ b/calliope-web/src/lib/comfy/types.ts @@ -0,0 +1,76 @@ +export type ComfyInputKind = 'text' | 'textarea' | 'number' | 'image' | 'image_url' | 'audio'; +export type ComfyOutputKind = 'image' | 'video' | 'other'; + +export interface ComfyDynamicInput { + nodeId: string; + label: string; + /** Role from title tag, e.g. (Input:prompt) → "prompt". Null for plain (Input). */ + role?: string | null; + kind: ComfyInputKind; + defaultValue?: string | number; + required: boolean; +} + +export interface ComfyDynamicOutput { + nodeId: string; + label: string; + /** Role from title tag, e.g. (Output:image) → "image". */ + role?: string | null; + kind: ComfyOutputKind; +} + +export interface WorkflowNode { + class_type: string; + inputs: Record; + _meta?: { title?: string }; +} + +export interface Workflow { + id: number; + name: string; + kind: 'image' | 'video'; + workflow_json: Record; + input_schema: ComfyDynamicInput[]; + output_schema: ComfyDynamicOutput[]; + description: string | null; + prompt_profile: string; + is_enabled: boolean; +} + +export interface Job { + id: number; + project_id: number; + scene_id: number | null; + kind: string; + workflow_id: number | null; + status: string; + payload: Record; + output_paths: string[]; + error: string | null; + created_at: string; + started_at: string | null; + completed_at: string | null; + retry_count: number; +} + +export interface Scene { + id: number; + project_id: number; + order_index: number; + heading: string | null; + action: string | null; + dialog: string | null; + duration_sec: number | null; + workflow_id: number | null; + env_image_path: string | null; + location_id: number | null; + video_path: string | null; + character_ids: number[]; + characters: Array<{ + id: number; + name: string; + role: string | null; + portrait_path: string | null; + sheet_path: string | null; + }>; +} diff --git a/calliope-web/src/lib/comfy/useUpload.svelte.ts b/calliope-web/src/lib/comfy/useUpload.svelte.ts new file mode 100644 index 00000000..bb1d679e --- /dev/null +++ b/calliope-web/src/lib/comfy/useUpload.svelte.ts @@ -0,0 +1,95 @@ +/** + * Shared upload logic — extracted from ComfyDynamicForm so both the legacy + * form and OmniComposer can use it without duplication. + * + * Provides a Svelte 5 `$state`-based upload manager that handles: + * - file picker (click to browse) + * - drag-and-drop + * - upload progress per nodeId + * - metadata (name, kind) for uploaded files + */ +import { playgroundApi, type UploadKind } from '$lib/api'; +import { toast } from '$lib/toast'; + +export interface UploadState { + /** nodeId → uploading filename (present while upload is in-flight) */ + uploading: Record; + /** path → { name, kind } for previously uploaded files */ + uploadedMeta: Record; +} + +export function createUploadManager() { + let uploading = $state>({}); + let uploadedMeta = $state>({}); + + return { + get uploading() { + return uploading; + }, + get uploadedMeta() { + return uploadedMeta; + }, + + isUploading(nodeId: string): boolean { + return !!uploading[nodeId]; + }, + + uploadMetaFor(path: string): { name: string; kind: UploadKind } { + const meta = uploadedMeta[path]; + if (meta) return meta; + const base = path.split(/[/\\]/).pop() ?? path; + const ext = base.slice(base.lastIndexOf('.')).toLowerCase(); + if (['.mp4', '.webm', '.mov', '.mkv'].includes(ext)) + return { name: base, kind: 'video' }; + if (['.mp3', '.wav', '.flac', '.ogg', '.m4a'].includes(ext)) + return { name: base, kind: 'audio' }; + return { name: base, kind: 'image' }; + }, + + /** + * Upload a file and return the server path. + * Manages uploading state and metadata internally. + * Throws on failure (caller handles toast if needed). + */ + async upload(nodeId: string, file: File): Promise { + uploading = { ...uploading, [nodeId]: file.name }; + try { + const res = await playgroundApi.upload(file); + uploadedMeta = { + ...uploadedMeta, + [res.path]: { name: res.name, kind: res.kind }, + }; + return res.path; + } finally { + const next = { ...uploading }; + delete next[nodeId]; + uploading = next; + } + }, + + /** + * Convenience: upload + toast on error, return path or null. + */ + async uploadSafe(nodeId: string, file: File): Promise { + try { + return await this.upload(nodeId, file); + } catch (err) { + toast.error(err instanceof Error ? err.message : 'Upload failed'); + return null; + } + }, + }; +} + +export type UploadManager = ReturnType; + +export function truncateMiddle(name: string, max = 32): string { + if (name.length <= max) return name; + const head = Math.ceil((max - 1) / 2); + const tail = Math.floor((max - 1) / 2); + return `${name.slice(0, head)}…${name.slice(name.length - tail)}`; +} + +export function acceptForKind(kind: string): string { + return kind === 'audio' ? 'audio/*' : 'image/*'; +} diff --git a/calliope-web/src/lib/components/ActivityPanel.svelte b/calliope-web/src/lib/components/ActivityPanel.svelte new file mode 100644 index 00000000..5b1ad67b --- /dev/null +++ b/calliope-web/src/lib/components/ActivityPanel.svelte @@ -0,0 +1,611 @@ + + + + + diff --git a/calliope-web/src/lib/components/AppHeader.svelte b/calliope-web/src/lib/components/AppHeader.svelte new file mode 100644 index 00000000..9ba1e6df --- /dev/null +++ b/calliope-web/src/lib/components/AppHeader.svelte @@ -0,0 +1,132 @@ + + +
+
+ + {#if crumb} + {crumb} + {/if} + {#if status} +
+ {@render status()} +
+ {/if} + +
+
+ {#if children} + {@render children()} + {/if} +
+
+ + diff --git a/calliope-web/src/lib/components/AssetThumb.svelte b/calliope-web/src/lib/components/AssetThumb.svelte new file mode 100644 index 00000000..495a6d8b --- /dev/null +++ b/calliope-web/src/lib/components/AssetThumb.svelte @@ -0,0 +1,132 @@ + + + +
+ (available = true)} + onUnavailable={() => (available = false)} + /> + + + +
+ + diff --git a/calliope-web/src/lib/components/AssetsStage.svelte b/calliope-web/src/lib/components/AssetsStage.svelte new file mode 100644 index 00000000..ac6e8eea --- /dev/null +++ b/calliope-web/src/lib/components/AssetsStage.svelte @@ -0,0 +1,1196 @@ + + +
+
+

2. Characters & Environments

+

+ Pick a workflow below. Sheet/environment prompts use the built-in template by default — + expand Edit prompt only if you need to tweak text. +

+
+
+ +
+
+ +
+
+ + +
+
+ +{#if imageWorkflows.length === 0} +

+ Enable an image workflow in Settings → Workflows before + generating. +

+{/if} + +
+ + {#snippet header()} +

Generation settings

+ {tab === 'characters' ? 'Character sheets' : 'Environment references'} + {/snippet} + {#if tab === 'characters'} + + {#if sheetWorkflow} + (sheetMissing = m)} + /> + {:else} +

Select a sheet workflow.

+ {/if} + {:else} + + {#if envWorkflow} + (envMissing = m)} + /> + {:else} +

Select an environment workflow.

+ {/if} + {/if} +
+
+ +{#if $assetsQuery.isLoading} +
+ {#each [0, 1, 2] as n (n)} +
+ +
+ + + +
+
+ {/each} +
+{:else if $assetsQuery.data} + {#if tab === 'characters'} + {#if $assetsQuery.data.characters.length === 0} + + {#snippet icon()} + + {/snippet} + {#snippet action()} + + {/snippet} + + {:else} +
+ {#each $assetsQuery.data.characters as char (char.id)} + {@const key = charKey(char.id)} + {@const job = entityJob(jobs, 'character_id', char.id)} + {@const jstate = jobStateOf(job)} +
+
+ openPreview(url, `${char.name} sheet`)} + /> + {#if isCover(char.sheet_path) && jstate !== 'generating'} + Cover + {/if} +
+ + + + +
+ {#if jstate === 'generating'} +
+ +
+ {/if} +
+ +
+
+ {char.name} + {#if char.role} + {char.role}{#if char.age} · {char.age}{/if} + {:else if char.age} + {char.age} + {/if} +
+ {#if char.appearance} +

+ Appearance {char.appearance} +

+ {/if} + {#if char.personality} +

+ Personality {char.personality} +

+ {/if} + {#if jstate === 'failed' && job} + {#if job.error} +

{job.error}

+ {/if} + {/if} + +
+ + {#if jstate === 'failed' && job} + + {/if} +
+ + {#if showCharPrompt} +
+ Edit image prompt + +
+ + +
+
+ {:else} +

+ Selected workflow has no (Input:prompt) — add that role + tag in ComfyUI (see AGENTS.md), or use the Generation settings above. +

+ {/if} +
+
+ {/each} +
+ {/if} + {:else if $assetsQuery.data.locations.length === 0} + + {#snippet icon()} + + {/snippet} + {#snippet action()} + + {/snippet} + + {:else} +
+ {#each $assetsQuery.data.locations as loc (loc.id)} + {@const key = locKey(loc.id)} + {@const job = entityJob(jobs, 'location_id', loc.id)} + {@const jstate = jobStateOf(job)} +
+
+ openPreview(url, loc.name)} + /> + {#if isCover(loc.reference_image_path) && jstate !== 'generating'} + Cover + {/if} +
+ + + + +
+ {#if jstate === 'generating'} +
+ +
+ {/if} +
+ +
+
+ {loc.name} +
+ {#if loc.description} +

+ Description {loc.description} +

+ {/if} + {#if jstate === 'failed' && job} + {#if job.error} +

{job.error}

+ {/if} + {/if} + +
+ + {#if jstate === 'failed' && job} + + {/if} +
+ + {#if envHasPrompt} +
+ Edit image prompt + +
+ + +
+
+ {:else} +

+ Selected workflow has no (Input:prompt) — add that role tag + in ComfyUI (see AGENTS.md), or use the Generation settings above. +

+ {/if} +
+
+ {/each} +
+ {/if} +{/if} + + { + previewSrc = null; + previewAlt = ''; + }} +/> + + { + const target = deleteTarget; + deleteTarget = null; + if (target) $deleteEntityMutation.mutate(target); + }} + oncancel={() => (deleteTarget = null)} +/> + + diff --git a/calliope-web/src/lib/components/AttachToProject.svelte b/calliope-web/src/lib/components/AttachToProject.svelte new file mode 100644 index 00000000..ff15c980 --- /dev/null +++ b/calliope-web/src/lib/components/AttachToProject.svelte @@ -0,0 +1,319 @@ + + +
+ {#if attached && !open} +
+ + Added to {attached.title} + View in project + +
+ {:else if !open} + + {:else} +
+ + + {#if !isVideo} + + + {#if target === 'character_sheet'} + + {:else} + + {/if} + {:else} + + {/if} + +
+ + +
+ {#if message && $attachMutation.isError} + + {/if} +
+ {/if} +
+ + diff --git a/calliope-web/src/lib/components/ComfyDynamicForm.svelte b/calliope-web/src/lib/components/ComfyDynamicForm.svelte new file mode 100644 index 00000000..79111f96 --- /dev/null +++ b/calliope-web/src/lib/components/ComfyDynamicForm.svelte @@ -0,0 +1,694 @@ + + +{#if inputs.length === 0} +

+ No (Input) / (Input:role) nodes detected. In ComfyUI, title editable nodes like + (Input:prompt) — see AGENTS.md. +

+{:else} +
+ {#if allowUpload} + + {/if} + {#each inputs as inp (inp.nodeId)} + {@const current = String(values[inp.nodeId] ?? '')} + {@const id = inputId(inp.nodeId)} + {@const errored = showError(inp)} +
+ + {#if readonly} +
{values[inp.nodeId] ?? inp.defaultValue ?? '—'}
+ {:else if inp.kind === 'textarea'} + + {:else if inp.kind === 'number'} + setNumberValue(inp.nodeId, e.currentTarget.value)} + onblur={() => markTouched(inp.nodeId)} + /> + {:else if allowUpload && isUploadKind(inp.kind)} + {@const uploadingName = uploading[inp.nodeId]} + {@const isUpload = !!current && !assetOptions.some((o) => o.path === current)} +
+ {#if isUpload} + {@const meta = uploadMetaFor(current)} +
+ {#if meta.kind === 'image'} + Uploaded file preview + {:else} + + {/if} + {truncateMiddle(meta.name)} + +
+ {/if} + + {#if assetOptions.length} + {@const thumb = thumbFor(current)} + +
+ {#if isImageKind(inp.kind) && thumb} + Selected asset preview + {/if} + + {#if current} + + {/if} +
+ {/if} +
+ {:else if isImageKind(inp.kind)} + {#if assetOptions.length} + {@const thumb = thumbFor(current)} +
+ {#if thumb} + Selected asset preview + {/if} + + {#if current} + + {/if} +
+ {:else} +

No assets yet — generate sheets / environments in Assets first.

+ {/if} + {:else if inp.kind === 'audio'} + {#if assetOptions.length} + + {:else} + setValue(inp.nodeId, e.currentTarget.value)} + onblur={() => markTouched(inp.nodeId)} + /> + {/if} + {:else} + setValue(inp.nodeId, e.currentTarget.value)} + onblur={() => markTouched(inp.nodeId)} + /> + {/if} + {#if errored} + {inp.label} is required + {/if} +
+ {/each} +
+{/if} + + diff --git a/calliope-web/src/lib/components/GeneratingOverlay.svelte b/calliope-web/src/lib/components/GeneratingOverlay.svelte new file mode 100644 index 00000000..73c15d82 --- /dev/null +++ b/calliope-web/src/lib/components/GeneratingOverlay.svelte @@ -0,0 +1,89 @@ + + +
+
+ +

{title}

+ {#if status} +

{status}

+ {/if} + {#if hint} +

{hint}

+ {/if} +
+
+ + diff --git a/calliope-web/src/lib/components/ImageLightbox.svelte b/calliope-web/src/lib/components/ImageLightbox.svelte new file mode 100644 index 00000000..716112e0 --- /dev/null +++ b/calliope-web/src/lib/components/ImageLightbox.svelte @@ -0,0 +1,315 @@ + + + + +{#if src} + + +{/if} + + diff --git a/calliope-web/src/lib/components/JobRow.svelte b/calliope-web/src/lib/components/JobRow.svelte new file mode 100644 index 00000000..1396a50c --- /dev/null +++ b/calliope-web/src/lib/components/JobRow.svelte @@ -0,0 +1,163 @@ + + +
+ +
+
+ {title} + +
+ {#if active} +
+ +
+ {:else if job.status === 'failed' && job.error} +

{job.error}

+ {/if} +
+
+ {#if active} + + {:else if job.status === 'failed'} + + {/if} +
+
+ + diff --git a/calliope-web/src/lib/components/NavRail.svelte b/calliope-web/src/lib/components/NavRail.svelte new file mode 100644 index 00000000..55f2d4fd --- /dev/null +++ b/calliope-web/src/lib/components/NavRail.svelte @@ -0,0 +1,134 @@ + + + + + diff --git a/calliope-web/src/lib/components/OmniComposer.svelte b/calliope-web/src/lib/components/OmniComposer.svelte new file mode 100644 index 00000000..0485f659 --- /dev/null +++ b/calliope-web/src/lib/components/OmniComposer.svelte @@ -0,0 +1,554 @@ + + +
+ +
0}> + {#if classified.media.length > 0} +
+ {#each classified.media as mc (mc.input.nodeId)} + {@const nodeId = mc.input.nodeId} + handleFileUpload(nodeId, file)} + onselectAsset={(path) => handleAssetSelect(nodeId, path)} + onclear={() => clearValue(nodeId)} + /> + {/each} +
+ {/if} + + {#if promptNode} + + {:else} + + {/if} + + {#if negativeNode} +
+ {#if showNegative} + + {/if} + +
+ {/if} +
+ + +
+ + {#if workflow && workflows.length > 0} + + {/if} + + + {#if resPair} + + {/if} + + + {#each classified.control.filter((c) => c.widget === 'resolutionPill') as ctrl (ctrl.input.nodeId)} + {@const nodeId = ctrl.input.nodeId} + setValue(nodeId, v)} + /> + {/each} + + + {#each classified.control.filter((c) => normalizeInputRole(c.input.role) === 'duration') as ctrl (ctrl.input.nodeId)} + {@const nodeId = ctrl.input.nodeId} + setValue(nodeId, v)} + /> + {/each} + + + {#each classified.control.filter((c) => normalizeInputRole(c.input.role) === 'seed') as ctrl (ctrl.input.nodeId)} + {@const nodeId = ctrl.input.nodeId} + setValue(nodeId, v)} + /> + {/each} + + + {#if hasAdvanced} + + {#each classified.advanced as ctrl (ctrl.input.nodeId)} + {@const nodeId = ctrl.input.nodeId} + + {/each} + + {/if} + + + +
+
+ + diff --git a/calliope-web/src/lib/components/ProjectCard.svelte b/calliope-web/src/lib/components/ProjectCard.svelte new file mode 100644 index 00000000..f1b6a263 --- /dev/null +++ b/calliope-web/src/lib/components/ProjectCard.svelte @@ -0,0 +1,480 @@ + + +
+ + + +
+ + +
{ + e.preventDefault(); + submitRename(); + }} + > + +
+ {#snippet footer()} + + + {/snippet} +
+ + $deleteMutation.mutate()} +/> + + diff --git a/calliope-web/src/lib/components/QueueStage.svelte b/calliope-web/src/lib/components/QueueStage.svelte new file mode 100644 index 00000000..623a60d1 --- /dev/null +++ b/calliope-web/src/lib/components/QueueStage.svelte @@ -0,0 +1,916 @@ + + +
+
+
+

4. Video

+

+ {#if scenes.length === 0} + Build a script first, then cut clips on the timeline. + {:else} + {doneCount}/{scenes.length} clips done · {formatClock(totalSec)} total + {/if} +

+
+
+ +
+ + +
+
+
+ +{#if view === 'edit'} + {#if $queueStatusQuery.data?.paused} +
+ + + Renders are held — workers sit idle until you resume. + + + +
+ {/if} + + {#if scenes.length === 0} +
+

No timeline yet

+

Generate or add scenes in Script, then come back to render clips.

+
+ {:else if selected} + {@const selWf = workflowFor(selected)} + {@const selStatus = statusOf(selected)} + {@const selPreview = previewPath(selected)} + { + selectedWorkflow = { ...selectedWorkflow, [selected.id]: Number(id) }; + }} + onGenerate={() => $generateOne.mutate(selected.id)} + /> + {/if} +{:else} +
+
+ +

{projectTitle}

+ + + +
+ +
+ {#if exportState === 'ready'} + + {#if exportStale} +
+ + Clips changed since this export — re-export to update. +
+ {/if} + {:else if exportState === 'active'} +
+ +

Exporting your film…

+
+ +
+

You can keep editing — export runs in the background.

+ +
+ {:else if exportState === 'failed'} +
+ +

Export failed

+

+ {exportJob?.error || 'Export failed'} +

+ +
+ {:else} +
+ +

Your film isn't exported yet

+

+ {clipsReady} clips · {formatClock(totalSec)} · 0.5s crossfades · loudness matched +

+ {#if clipsMissing > 0} +

+ + + {clipsMissing} scene{clipsMissing === 1 ? '' : 's'} without a clip will be skipped + +

+ {/if} + +
+ {/if} +
+ + {#if exportState === 'ready'} + {@const exportUrl = assetUrl(exportPath)} +
+ + {exportClipCount} clips · {formatClock(totalSec)}{#if exportedAgo} · Exported {exportedAgo}{/if} + +
+ {#if exportUrl} + + Download film + + {/if} + +
+
+ {/if} + + {#if scenes.length > 0} +
+

In this film

+
+ {#each scenes as scene (scene.id)} + {@const thumb = thumbFor(scene)} + + {/each} +
+
+ {/if} +
+{/if} +
+ + diff --git a/calliope-web/src/lib/components/SafeMedia.svelte b/calliope-web/src/lib/components/SafeMedia.svelte new file mode 100644 index 00000000..0191ae2b --- /dev/null +++ b/calliope-web/src/lib/components/SafeMedia.svelte @@ -0,0 +1,108 @@ + + +{#if usable && src} + {#if kind === 'video'} + + + {:else} + + {/if} +{:else} + +{/if} + + diff --git a/calliope-web/src/lib/components/ScriptStage.svelte b/calliope-web/src/lib/components/ScriptStage.svelte new file mode 100644 index 00000000..8bf0e440 --- /dev/null +++ b/calliope-web/src/lib/components/ScriptStage.svelte @@ -0,0 +1,659 @@ + + +
+
+

3. Script

+

+ Estimated duration: {formatClock(totalSec)} + {#if targetSec > 0} + / target ~{formatClock(targetSec)} + {/if} + {#if sceneCount > 0} + · {sceneCount} scenes + {/if} +

+
+
+ + +
+
+ +
+ {#if writing} + + {/if} + + {#if $scenesQuery.isLoading} +
Loading scenes…
+ {:else if sceneCount === 0} + + {#snippet icon()} + + {/snippet} + {#snippet action()} + + {/snippet} + + {:else} + {#each scenes as scene, i (scene.id)} + {@const st = sceneStatus(scene)} + {@const locName = locationName(scene)} +
+
+
+ + #{scene.order_index} + {scene.heading || 'Untitled scene'} + {#if highlightId === scene.id} + Just added + {/if} + +
+
+ + + + +
+
+ {#if scene.action} +

{scene.action}

+ {:else} +

No action yet — open Edit to write the beat.

+ {/if} + {#if scene.dialog} +
{scene.dialog}
+ {/if} +
+ {#each scene.characters ?? [] as c (c.id)} + {@const avatar = avatarFor(c)} + + + + {#if avatar} + + {/if} + + {c.name} + + {/each} + {#if locName} + {locName} + {/if} + {#if scene.duration_sec} + {formatClock(scene.duration_sec)} + {/if} +
+
+ {/each} + {/if} +
+ + (editing = null)} +> + {#if editing} + + + + + {/if} + {#snippet footer()} + + + {/snippet} + + + { + editing = null; + editOpen = false; + $generateMutation.mutate(); + }} +/> + + void confirmDeleteScene()} + oncancel={() => (sceneToDelete = null)} +/> + + diff --git a/calliope-web/src/lib/components/StoryStage.svelte b/calliope-web/src/lib/components/StoryStage.svelte new file mode 100644 index 00000000..29ae962c --- /dev/null +++ b/calliope-web/src/lib/components/StoryStage.svelte @@ -0,0 +1,927 @@ + + +{#snippet saveIndicator()} + {#if saveState === 'saving'} + Saving… + {:else if saveState === 'saved'} + Saved + {:else if saveState === 'error'} + + Save failed + + + {/if} +{/snippet} + +
+

1. Story

+
+ + +
+
+ +{#if !configured} + +{/if} + +{#if shownError} + +{/if} + +
+ {#if busy} + + {/if} + + {#snippet header()} +

Story Idea

+ {@render saveIndicator()} + {/snippet} + +
+ + + {#snippet header()} +

Settings

+ {@render saveIndicator()} + {/snippet} +
+ + + +
+
+ + + {#snippet header()} +

Draft Storyline prompt

+ + {/snippet} + {#if showDraftPrompt} +
{draftPromptPreview}
+

+ This is the user message (plus a short system rule). Beat count is a hard constraint; + if the model under-delivers, the server retries once, then errors instead of accepting a thin + outline. +

+ {:else} +

+ Expand to inspect the exact prompt Draft Storyline sends to the LLM. +

+ {/if} +
+ + + {#snippet header()} +

Story Beats

+
+ {#if story.beats.length} + + {/if} + +
+ {/snippet} + {#if story.beats.length === 0} + + {#snippet icon()} + + {/snippet} + {#snippet action()} + + {/snippet} + + {:else} +
+ {#each story.beats as beat (beat.id)} +
+ +
+ +
+
+ {/each} +
+ + {/if} +
+ +{#if story.characters.length || story.locations.length} + + {#snippet header()} +

Extracted

+ + {/snippet} +
+ {#each story.characters as char (char.id)} + + {/each} + {#each story.locations as loc (loc.id)} + + {/each} +
+
+{/if} +
+ + (editingBeat = null)}> + {#if editingBeat} + + + {/if} + {#snippet footer()} + + + {/snippet} + + + (editingChar = null)}> + {#if editingChar} + + + + + + + {/if} + {#snippet footer()} + + + {/snippet} + + + (editingLoc = null)}> + {#if editingLoc} + + + + {/if} + {#snippet footer()} + + + {/snippet} + + + void loadExample()} +/> + + void draftStoryline()} +/> + + { + const id = deletingBeat?.id; + deletingBeat = null; + if (id != null) $deleteBeatMutation.mutate(id); + }} + oncancel={() => (deletingBeat = null)} +/> + + diff --git a/calliope-web/src/lib/components/ToastHost.svelte b/calliope-web/src/lib/components/ToastHost.svelte new file mode 100644 index 00000000..690aa718 --- /dev/null +++ b/calliope-web/src/lib/components/ToastHost.svelte @@ -0,0 +1,162 @@ + + +{#if items.length} +
+ {#each items as t (t.id)} +
pauseToast(t.id)} + onmouseleave={() => resumeToast(t.id)} + onfocusin={() => pauseToast(t.id)} + onfocusout={() => resumeToast(t.id)} + > + + {t.message} + +
+ {/each} +
+{/if} + + diff --git a/calliope-web/src/lib/components/omni/MediaTile.svelte b/calliope-web/src/lib/components/omni/MediaTile.svelte new file mode 100644 index 00000000..810bc390 --- /dev/null +++ b/calliope-web/src/lib/components/omni/MediaTile.svelte @@ -0,0 +1,464 @@ + + +
+ + + + +
{ + e.preventDefault(); + dragOver = true; + }} + ondragleave={() => (dragOver = false)} + ondragover={(e) => e.preventDefault()} + ondrop={onDrop} + onclick={openPicker} + role="button" + tabindex="0" + title={displayLabel} + aria-haspopup={hasAssets ? 'menu' : undefined} + aria-expanded={hasAssets ? showAssetMenu : undefined} + > + {#if uploadingName} +
+ +
+ {:else if value && thumbSrc && isImageKind} + {displayLabel} + {:else if value} +
+ +
+ {:else} +
+ +
+ {/if} + + {#if value && !uploadingName} + + {/if} +
+ + {displayLabel} + + {#if invalid && !value} + Required + {/if} +
+ +{#if showAssetMenu && hasAssets} + +{/if} + + diff --git a/calliope-web/src/lib/components/omni/PillPopover.svelte b/calliope-web/src/lib/components/omni/PillPopover.svelte new file mode 100644 index 00000000..0d5bf775 --- /dev/null +++ b/calliope-web/src/lib/components/omni/PillPopover.svelte @@ -0,0 +1,199 @@ + + +
+ +
+ +{#if open} + + +
e.stopPropagation()} + > + {@render children()} +
+{/if} + + diff --git a/calliope-web/src/lib/components/omni/PillSelect.svelte b/calliope-web/src/lib/components/omni/PillSelect.svelte new file mode 100644 index 00000000..d28b7a9d --- /dev/null +++ b/calliope-web/src/lib/components/omni/PillSelect.svelte @@ -0,0 +1,259 @@ + + +
+ +
+ +{#if open} +
+ {#each options as opt (opt.value)} + + {/each} +
+{/if} + + diff --git a/calliope-web/src/lib/components/omni/PillStepper.svelte b/calliope-web/src/lib/components/omni/PillStepper.svelte new file mode 100644 index 00000000..ace0d356 --- /dev/null +++ b/calliope-web/src/lib/components/omni/PillStepper.svelte @@ -0,0 +1,110 @@ + + +
+ + + {#if obscured && !value} + + {:else} + {value}{label === 'Duration' ? 's' : ''} + {/if} + + +
+ + diff --git a/calliope-web/src/lib/components/settings/SettingsNav.svelte b/calliope-web/src/lib/components/settings/SettingsNav.svelte new file mode 100644 index 00000000..e793dfbf --- /dev/null +++ b/calliope-web/src/lib/components/settings/SettingsNav.svelte @@ -0,0 +1,108 @@ + + + + + diff --git a/calliope-web/src/lib/components/settings/WorkflowsLibrary.svelte b/calliope-web/src/lib/components/settings/WorkflowsLibrary.svelte new file mode 100644 index 00000000..e8ff4675 --- /dev/null +++ b/calliope-web/src/lib/components/settings/WorkflowsLibrary.svelte @@ -0,0 +1,700 @@ + + +
+
+
+

ComfyUI Workflows

+

+ Register API-format workflow JSONs as a reusable library. In ComfyUI, title editable + nodes with role tags such as (Input:prompt), + (Input:width), (Output:image) — see AGENTS.md. +

+
+
+ {list.length} saved + {imageCount} image + {videoCount} video +
+
+ +
+

Analyze & register

+
{ + e.preventDefault(); + dragging = true; + }} + ondragleave={() => (dragging = false)} + ondrop={onDrop} + onclick={() => document.getElementById('wf-file')?.click()} + onkeydown={(e) => e.key === 'Enter' && document.getElementById('wf-file')?.click()} + > + { + const f = (e.currentTarget as HTMLInputElement).files?.[0]; + if (f) void onFile(f); + }} + /> +
JSON
+
+ Drop ComfyUI API JSON here +

or click to browse · Save (API Format) from ComfyUI

+
+
+ + {#if uploadedFileName} +

{uploadedFileName}

+ {/if} + + {#if jsonText} + + + {/if} + + {#if parseError} +
{parseError}
+ {/if} + + {#if analyzed} +
+
+

Detected inputs ({analyzedInputs.length})

+ {#if analyzedInputs.length === 0} +

None — add (Input:prompt) etc. to node titles in ComfyUI.

+ {:else} + {#each analyzedInputs as inp} +
+ {inp.kind} + {#if inp.role}{inp.role}{/if} + {inp.label} + #{inp.nodeId} +
+ {/each} + {/if} +
+
+

Detected outputs ({analyzedOutputs.length})

+ {#if analyzedOutputs.length === 0} +

None — add (Output:image) / (Output:video) to node titles.

+ {:else} + {#each analyzedOutputs as out} +
+ {out.kind} + {#if out.role}{out.role}{/if} + {out.label} + #{out.nodeId} +
+ {/each} + {/if} +
+
+ +
+ + +
+ + + + {/if} +
+ +
+
+

Saved workflows ({list.length})

+
+ + {#if $workflowsQuery.isLoading} +
+ {#each [1, 2, 3] as n (n)} +
+ +
+ + +
+
+ {/each} +
+ {:else if list.length === 0} +
+ No workflows yet +

Register at least one image and one video workflow to run the pipeline.

+
+ {:else} +
+ {#each list as wf (wf.id)} +
+ {#if editingId === wf.id} + + + +

Workflow JSON is locked after registration.

+
+ + +
+ {:else} +
+
+ {wf.kind === 'video' ? 'VID' : 'IMG'} +
+
+ {wf.name} +
+ {wf.kind} + {#if wf.prompt_profile === 'minimax_h3_ref'} + H3-ref + {/if} + {wf.input_schema?.length ?? 0} inputs + {wf.output_schema?.length ?? 0} outputs + {#if !wf.is_enabled}{/if} +
+ {#if wf.description} +

{wf.description}

+ {/if} +
+
+
+ + + + +
+ {#if detailsId === wf.id} +
+
+

Inputs

+ {#each wf.input_schema ?? [] as inp} +
+ {inp.kind} + {#if inp.role}{inp.role}{/if} + {inp.label} +
+ {:else} +

No inputs cached.

+ {/each} +
+
+

Outputs

+ {#each wf.output_schema ?? [] as out} +
+ {out.kind} + {out.label} +
+ {:else} +

No outputs cached.

+ {/each} +
+
+ {/if} + {/if} +
+ {/each} +
+ {/if} +
+
+ + (deleteTarget = null)} +/> + + diff --git a/calliope-web/src/lib/components/ui/Button.svelte b/calliope-web/src/lib/components/ui/Button.svelte new file mode 100644 index 00000000..34033791 --- /dev/null +++ b/calliope-web/src/lib/components/ui/Button.svelte @@ -0,0 +1,147 @@ + + + + + diff --git a/calliope-web/src/lib/components/ui/Card.svelte b/calliope-web/src/lib/components/ui/Card.svelte new file mode 100644 index 00000000..c9fe7016 --- /dev/null +++ b/calliope-web/src/lib/components/ui/Card.svelte @@ -0,0 +1,84 @@ + + +
+ {#if header} +
+ {@render header()} +
+ {:else if title || actions} +
+ {#if title} +

{title}

+ {/if} + {#if actions} +
+ {@render actions()} +
+ {/if} +
+ {/if} +
+ {@render children()} +
+
+ + diff --git a/calliope-web/src/lib/components/ui/ConfirmDialog.svelte b/calliope-web/src/lib/components/ui/ConfirmDialog.svelte new file mode 100644 index 00000000..e4b2da96 --- /dev/null +++ b/calliope-web/src/lib/components/ui/ConfirmDialog.svelte @@ -0,0 +1,63 @@ + + + +

{message}

+ {#snippet footer()} + + + {/snippet} +
+ + diff --git a/calliope-web/src/lib/components/ui/EmptyState.svelte b/calliope-web/src/lib/components/ui/EmptyState.svelte new file mode 100644 index 00000000..bbe1a48c --- /dev/null +++ b/calliope-web/src/lib/components/ui/EmptyState.svelte @@ -0,0 +1,64 @@ + + +
+ {#if icon} +
+ {@render icon()} +
+ {/if} +

{title}

+ {#if body} +

{body}

+ {/if} + {#if action} +
+ {@render action()} +
+ {/if} +
+ + diff --git a/calliope-web/src/lib/components/ui/Icon.svelte b/calliope-web/src/lib/components/ui/Icon.svelte new file mode 100644 index 00000000..acd7024b --- /dev/null +++ b/calliope-web/src/lib/components/ui/Icon.svelte @@ -0,0 +1,37 @@ + + +{#if content} + +{/if} + + diff --git a/calliope-web/src/lib/components/ui/Modal.svelte b/calliope-web/src/lib/components/ui/Modal.svelte new file mode 100644 index 00000000..72e0de17 --- /dev/null +++ b/calliope-web/src/lib/components/ui/Modal.svelte @@ -0,0 +1,230 @@ + + +{#if open} + + +{/if} + + diff --git a/calliope-web/src/lib/components/ui/ProgressBar.svelte b/calliope-web/src/lib/components/ui/ProgressBar.svelte new file mode 100644 index 00000000..b4622a1c --- /dev/null +++ b/calliope-web/src/lib/components/ui/ProgressBar.svelte @@ -0,0 +1,121 @@ + + +
+ {#if showMeta} +
+ {#if label} + {label} + {/if} + {#if !indeterminate} + {pct}% + {/if} +
+ {/if} +
+ {#if indeterminate} +
+ {:else} +
+ {/if} +
+
+ + diff --git a/calliope-web/src/lib/components/ui/README.md b/calliope-web/src/lib/components/ui/README.md new file mode 100644 index 00000000..ebcd405b --- /dev/null +++ b/calliope-web/src/lib/components/ui/README.md @@ -0,0 +1,263 @@ +# Calliope UI primitives + +Shared component library for the Calliope UI. Import from `$lib/components/ui/`. +Svelte 5 runes mode, TypeScript strict, scoped styles driven by the CSS vars in +`src/routes/app.css`. No Tailwind. + +Conventions shared by all primitives: + +- Styling uses the global tokens (`--bg-surface`, `--border`, `--accent`, `--radius-*`, `--space-*`, fonts). Never hardcode hex colors outside this directory. +- All interactive primitives expose a `:focus-visible` accent ring. `app.css` also provides a global `:focus-visible` fallback for native elements. +- Motion respects `prefers-reduced-motion`: `app.css` kills animation/transition durations globally; components that need a styled static fallback (Skeleton, ProgressBar indeterminate, StatusChip pulse) handle it in their own scoped styles. + +--- + +## Button + +`import Button from '$lib/components/ui/Button.svelte';` + +| Prop | Type | Default | Notes | +| ---------- | ------------------------------------------------- | ------------- | -------------------------------------------------- | +| `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'danger'` | `'secondary'` | primary = `--accent` bg; danger = `--error` tinted | +| `size` | `'sm' \| 'md'` | `'md'` | sm = 28px, md = 34px min-height | +| `disabled` | `boolean` | `false` | reduced opacity, no pointer events | +| `loading` | `boolean` | `false` | inline spinner, disables, width stays stable | +| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | | +| `title` | `string` | — | native tooltip | +| `onclick` | `(event: MouseEvent) => void` | — | | +| `children` | `Snippet` | required | label content | + +```svelte + + + + + +``` + +## Card + +`import Card from '$lib/components/ui/Card.svelte';` + +| Prop | Type | Default | Notes | +| ----------- | --------- | -------- | ---------------------------------------------------- | +| `hoverable` | `boolean` | `false` | border lightens + `translateY(-1px)` on hover | +| `title` | `string` | — | renders default header row | +| `actions` | `Snippet` | — | right side of the default header row | +| `header` | `Snippet` | — | full custom header row (overrides `title`/`actions`) | +| `children` | `Snippet` | required | body content | +| `class` | `string` | `''` | extra class on the root | + +```svelte + + {#snippet actions()} + + {/snippet} +

Body content here.

+
+``` + +## StatusChip + +`import StatusChip from '$lib/components/ui/StatusChip.svelte';` + +| Prop | Type | Default | Notes | +| -------- | -------- | -------- | -------------------------------------- | +| `status` | `string` | required | matched case-insensitively after trim | +| `label` | `string` | — | display text; defaults to raw `status` | + +Status → color mapping (unknown strings fall back to muted and show the raw string): + +| Tone | Color var | Statuses | +| ------- | ------------------ | ---------------------------------------------- | +| success | `--success` | `ready`, `done`, `completed` | +| info | `--info` | `running` (dot pulses), `generating`, `queued` | +| muted | `--text-secondary` | `pending`, `idle`, `draft`, + any unknown | +| error | `--error` | `failed`, `error` | +| warning | `--warning` | `paused` | +| accent | `--accent` | `in_progress` | + +```svelte + + +``` + +## ProgressBar + +`import ProgressBar from '$lib/components/ui/ProgressBar.svelte';` + +| Prop | Type | Default | Notes | +| --------------- | -------------- | ------- | ----------------------------------------- | +| `value` | `number` | `0` | clamped to 0–100 | +| `indeterminate` | `boolean` | `false` | sliding accent gradient, no % readout | +| `label` | `string` | — | text above the track, also the aria-label | +| `size` | `'sm' \| 'md'` | `'md'` | sm = 4px, md = 6px track | + +```svelte + + +``` + +## Skeleton + +`import Skeleton from '$lib/components/ui/Skeleton.svelte';` + +| Prop | Type | Default | Notes | +| -------- | --------- | -------- | ------------------------------------------------------- | +| `width` | `string` | `'100%'` | any CSS length | +| `height` | `string` | `'14px'` | any CSS length | +| `circle` | `boolean` | `false` | 50% radius; defaults width to `height` when width unset | + +```svelte + + + +``` + +## Modal + +`import Modal from '$lib/components/ui/Modal.svelte';` + +| Prop | Type | Default | Notes | +| ------------- | ------------ | -------- | --------------------------------------------------------------------------- | +| `open` | `boolean` | `false` | **bindable** — use `bind:open` | +| `title` | `string` | — | wired to `aria-labelledby`; falls back to `aria-label="Dialog"` | +| `dismissible` | `boolean` | `true` | gates Esc, backdrop click, and the close button | +| `onclose` | `() => void` | — | fires once when the modal closes (any cause, incl. external `open = false`) | +| `footer` | `Snippet` | — | right-aligned action row | +| `children` | `Snippet` | required | body content | + +Behavior: Esc and backdrop click close when dismissible; focus is trapped while +open; initial focus goes to the first focusable element (or the panel); focus is +restored to the invoking element on close; body scroll is locked while open; +`role="dialog" aria-modal="true"`; backdrop blur + fade, panel rises 8px. + +```svelte + + + + console.log('closed')}> +

Body content.

+ {#snippet footer()} + + + {/snippet} +
+``` + +## ConfirmDialog + +`import ConfirmDialog from '$lib/components/ui/ConfirmDialog.svelte';` (built on Modal) + +| Prop | Type | Default | Notes | +| -------------- | ------------ | ----------- | ------------------------------------------------------------------- | +| `open` | `boolean` | `false` | **bindable** — use `bind:open` | +| `title` | `string` | required | | +| `message` | `string` | required | body copy | +| `confirmLabel` | `string` | `'Confirm'` | | +| `cancelLabel` | `string` | `'Cancel'` | | +| `danger` | `boolean` | `false` | confirm button uses the danger variant | +| `onconfirm` | `() => void` | required | fires once, after the dialog closes | +| `oncancel` | `() => void` | — | fires when closed without confirming (Esc, backdrop, cancel button) | + +```svelte + + + console.log('kept')} +/> +``` + +## EmptyState + +`import EmptyState from '$lib/components/ui/EmptyState.svelte';` + +| Prop | Type | Default | Notes | +| -------- | --------- | -------- | -------------------------------------- | +| `title` | `string` | required | | +| `body` | `string` | — | supporting copy, max-width constrained | +| `icon` | `Snippet` | — | rendered muted above the title | +| `action` | `Snippet` | — | CTA row below the body | + +```svelte + + {#snippet icon()} + + {/snippet} + {#snippet action()} + + {/snippet} + +``` + +## Spinner + +`import Spinner from '$lib/components/ui/Spinner.svelte';` + +| Prop | Type | Default | Notes | +| ------ | ---------------------- | ------- | ------------------------------- | +| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | sm = 14px, md = 18px, lg = 28px | + +`role="status"` with an sr-only "Loading". Colors can be overridden from a parent +via the `--spinner-track` / `--spinner-arc` CSS vars (Button uses this on +primary/danger). + +```svelte + +``` + +## Icon + +`import Icon from '$lib/components/ui/Icon.svelte';` + +| Prop | Type | Default | Notes | +| ------ | ---------- | -------- | --------------------------------------------------------- | +| `name` | `IconName` | required | union type from `icons.ts` — autocomplete lists all names | +| `size` | `number` | `18` | px, square | + +Stroke-based inline SVG (1.5px stroke, `currentColor`), inherits text color. +`aria-hidden` — when an icon is the only content of a control, put an +`aria-label` on the control itself. Use these instead of emoji everywhere. + +Icon names (`import { icons, type IconName } from '$lib/components/ui/icons';`): + +- Navigation: `home`, `story`, `assets`, `script`, `video`, `queue`, `settings`, `playground` +- Actions: `plus`, `trash`, `edit`, `retry`, `close`, `download`, `upload`, `search`, `external-link`, `zoom-in` +- Media transport: `play`, `pause`, `stop` +- Status: `check`, `alert`, `info`, `clock`, `sparkle` +- Media: `image`, `folder`, `film`, `music` +- Chevrons: `chevron-left`, `chevron-right`, `chevron-up`, `chevron-down` +- Misc: `drag` + +```svelte + + + + + +``` diff --git a/calliope-web/src/lib/components/ui/Skeleton.svelte b/calliope-web/src/lib/components/ui/Skeleton.svelte new file mode 100644 index 00000000..b5653c13 --- /dev/null +++ b/calliope-web/src/lib/components/ui/Skeleton.svelte @@ -0,0 +1,54 @@ + + + + + diff --git a/calliope-web/src/lib/components/ui/Spinner.svelte b/calliope-web/src/lib/components/ui/Spinner.svelte new file mode 100644 index 00000000..7b228321 --- /dev/null +++ b/calliope-web/src/lib/components/ui/Spinner.svelte @@ -0,0 +1,59 @@ + + + + Loading + + + diff --git a/calliope-web/src/lib/components/ui/StatusChip.svelte b/calliope-web/src/lib/components/ui/StatusChip.svelte new file mode 100644 index 00000000..dd3c0f6a --- /dev/null +++ b/calliope-web/src/lib/components/ui/StatusChip.svelte @@ -0,0 +1,106 @@ + + + + + {label ?? status} + + + diff --git a/calliope-web/src/lib/components/ui/icons.ts b/calliope-web/src/lib/components/ui/icons.ts new file mode 100644 index 00000000..bce67ab9 --- /dev/null +++ b/calliope-web/src/lib/components/ui/icons.ts @@ -0,0 +1,70 @@ +/** + * Inline SVG icon set for Calliope UI primitives. + * 24x24 viewBox, stroke-based (1.5px), currentColor — Lucide-style geometry. + * Each entry is SVG inner content rendered by Icon.svelte via {@html}. + */ +export const icons = { + // Navigation + home: '', + story: + '', + assets: + '', + script: + '', + video: + '', + queue: + '', + settings: + '', + playground: + '', + // Actions + plus: '', + trash: + '', + edit: '', + retry: + '', + close: '', + download: + '', + upload: + '', + search: '', + 'external-link': + '', + 'zoom-in': + '', + // Media transport + play: '', + pause: + '', + stop: '', + // Status + check: '', + alert: + '', + info: '', + clock: '', + sparkle: + '', + // Media + image: + '', + film: '', + music: + '', + folder: + '', + // Chevrons + 'chevron-left': '', + 'chevron-right': '', + 'chevron-up': '', + 'chevron-down': '', + // Misc + drag: '', +} as const satisfies Record; + +export type IconName = keyof typeof icons; diff --git a/calliope-web/src/lib/components/video/ClipMonitor.svelte b/calliope-web/src/lib/components/video/ClipMonitor.svelte new file mode 100644 index 00000000..5ca5def1 --- /dev/null +++ b/calliope-web/src/lib/components/video/ClipMonitor.svelte @@ -0,0 +1,227 @@ + + +
+
+ {#if previewUrl} + + {:else} +
+ #{orderIndex} +

{heading || 'Untitled'}

+ {#if status === 'pending' || status === 'running'} +
+
+ + {status === 'running' ? 'Generating…' : 'Queued — waiting for a worker'} +
+ {#if status === 'running'} + + {/if} +
+ {:else if status === 'failed'} +
+

{error || 'Generation failed'}

+ {#if errorLong} + + {/if} +
+ {:else} +

No render yet — describe the shot below and generate.

+ {/if} +
+ {/if} +
+ + {#if previewUrl} + + {/if} +
+ + diff --git a/calliope-web/src/lib/components/video/SceneFilmstrip.svelte b/calliope-web/src/lib/components/video/SceneFilmstrip.svelte new file mode 100644 index 00000000..1015b343 --- /dev/null +++ b/calliope-web/src/lib/components/video/SceneFilmstrip.svelte @@ -0,0 +1,239 @@ + + +
+
+ {#each scenes as scene (scene.id)} + {@const st = statusOf(scene)} + {@const thumb = thumbFor(scene)} + + {/each} +
+ +
+ + + {selected ? `Scene ${selected.order_index} of ${scenes.length}` : '—'} + + +
+
+ + diff --git a/calliope-web/src/lib/components/video/SceneScriptDrawer.svelte b/calliope-web/src/lib/components/video/SceneScriptDrawer.svelte new file mode 100644 index 00000000..bfcc0907 --- /dev/null +++ b/calliope-web/src/lib/components/video/SceneScriptDrawer.svelte @@ -0,0 +1,207 @@ + + +
+
+ #{scene.order_index} + + {scene.heading || 'Untitled scene'} + + + {formatClock(scene.duration_sec || 5)} + +
+ + {#if open} +
+
+ Heading +

{scene.heading || 'Untitled scene'}

+
+
+ Action / script + {#if scene.action?.trim()} +

{scene.action}

+ {:else} +

No action text for this scene.

+ {/if} +
+
+ Dialog + {#if scene.dialog?.trim()} +
{scene.dialog}
+ {:else} +

No dialog for this scene.

+ {/if} +
+ {#if (scene.characters ?? []).length} +
+ Characters +
+ {#each scene.characters as c} + {c.name} + {/each} +
+
+ {/if} +
+ {/if} +
+ + diff --git a/calliope-web/src/lib/components/video/VideoEditWorkspace.svelte b/calliope-web/src/lib/components/video/VideoEditWorkspace.svelte new file mode 100644 index 00000000..540c0c04 --- /dev/null +++ b/calliope-web/src/lib/components/video/VideoEditWorkspace.svelte @@ -0,0 +1,190 @@ + + +
+
+ +
+ + + + + +
+ {#if workflow} + {#if assetOptions.length === 0} +

+ No image assets yet. Generate character sheets or environments in Assets to pick them as + refs. +

+ {/if} + + {:else} +
+

No video workflow enabled

+

+ Enable a video workflow in Settings → Workflows. +

+
+ {/if} +
+
+ + diff --git a/calliope-web/src/lib/durationBudget.ts b/calliope-web/src/lib/durationBudget.ts new file mode 100644 index 00000000..755c09ed --- /dev/null +++ b/calliope-web/src/lib/durationBudget.ts @@ -0,0 +1,81 @@ +/** + * Mirror of calliope.agent.prompts duration helpers — keep in sync. + * Used so Story UI can show the beat budget before drafting. + */ + +export function estimateTargetSeconds(targetDuration: string | null | undefined): number { + const text = (targetDuration || '').trim().toLowerCase(); + if (!text) return 30; + + const scenesM = text.match(/(\d+)\s*scenes?/); + if (scenesM && !/min|sec/.test(text)) { + return Math.max(30, Number(scenesM[1]) * 8); + } + + let minutes = 0; + let seconds = 0; + for (const m of text.matchAll(/(\d+(?:\.\d+)?)\s*(min|mins|minutes?|m)\b/g)) { + minutes += Number(m[1]); + } + for (const m of text.matchAll(/(\d+(?:\.\d+)?)\s*(sec|secs|seconds?|s)\b/g)) { + seconds += Number(m[1]); + } + if (minutes || seconds) return Math.max(15, Math.round(minutes * 60 + seconds)); + + const bare = text.match(/\b(\d+(?:\.\d+)?)\b/); + if (bare) { + const n = Number(bare[1]); + if (text.includes('medium') || n >= 2) { + if (n <= 30) return Math.round(n * 60); + } + if (n <= 180) return Math.round(n); + } + + if (text.includes('medium')) return 120; + if (text.includes('short') || text.includes('brief')) return 30; + if (text.includes('long') || text.includes('feature')) return 180; + return 60; +} + +/** ~12s narrative weight per beat; capped at 60. */ +export function recommendBeatCount(targetDuration: string | null | undefined): number { + const secs = estimateTargetSeconds(targetDuration); + return Math.max(4, Math.min(60, Math.round(secs / 12))); +} + +export function recommendSceneCount(targetDuration: string | null | undefined): number { + const secs = estimateTargetSeconds(targetDuration); + return Math.max(4, Math.min(90, Math.round(secs / 7))); +} + +/** Same user prompt the backend sends to the LLM (for transparency). */ +export function buildStoryDraftPromptPreview(args: { + title: string; + idea: string; + genre: string; + tone: string; + targetDuration: string; +}): string { + const secs = estimateTargetSeconds(args.targetDuration); + const beatN = recommendBeatCount(args.targetDuration); + return `Create a story brief for an AI-generated video. + +required_beat_count: ${beatN} +estimated_runtime_seconds: ${secs} +target_duration_text: ${args.targetDuration || 'short (~30 seconds)'} + +Title: ${args.title || 'Untitled'} +Idea: ${args.idea || 'No idea provided.'} +Genre: ${args.genre || 'Not specified'} +Tone: ${args.tone || 'cinematic, atmospheric'} + +=== HARD CONSTRAINTS (non-negotiable) === +1. The JSON field "beats" MUST contain EXACTLY ${beatN} objects. +2. order_index must run 1..${beatN} with no gaps. +3. Do NOT compress a long runtime into a handful of beats. +4. ~${secs}s runtime → fine-grained beats (~12s story weight each). + +(+ JSON schema for title, logline, beats, characters, locations) + +FINAL CHECK: beats.length == ${beatN}`; +} diff --git a/calliope-web/src/lib/events.ts b/calliope-web/src/lib/events.ts new file mode 100644 index 00000000..2a146410 --- /dev/null +++ b/calliope-web/src/lib/events.ts @@ -0,0 +1,67 @@ +export type CalliopeEvent = { + type: string; + data: Record; + ts: string; +}; + +/** + * SSE connection lifecycle: + * - `connecting` — first attach attempt in flight + * - `open` — stream established (EventSource.onopen fired) + * - `reconnecting` — stream dropped; the 3s re-attach loop is running + */ +export type EventConnectionState = 'connecting' | 'open' | 'reconnecting'; + +type Listener = (event: CalliopeEvent) => void; +type StateListener = (state: EventConnectionState) => void; + +export function connectEvents(onEvent: Listener, onState?: StateListener): () => void { + let es: EventSource | null = null; + let closed = false; + let firstAttach = true; + let reconnectTimer: ReturnType | null = null; + + const attach = () => { + if (closed) return; + onState?.(firstAttach ? 'connecting' : 'reconnecting'); + firstAttach = false; + es = new EventSource('/api/events'); + es.onopen = () => onState?.('open'); + const handler = (e: MessageEvent) => { + try { + const parsed = JSON.parse(e.data) as CalliopeEvent; + onEvent(parsed); + } catch { + /* ignore */ + } + }; + // Listen to named events + default message + [ + 'agent.thinking', + 'job.created', + 'job.started', + 'job.progress', + 'job.completed', + 'job.failed', + 'job.deleted', + 'asset.ready', + 'story.ready', + ].forEach((name) => es!.addEventListener(name, handler as EventListener)); + es.onmessage = handler; + es.onerror = () => { + onState?.('reconnecting'); + es?.close(); + if (!closed) { + reconnectTimer = setTimeout(attach, 3000); + } + }; + }; + + attach(); + + return () => { + closed = true; + if (reconnectTimer) clearTimeout(reconnectTimer); + es?.close(); + }; +} diff --git a/calliope-web/src/lib/jobProgress.ts b/calliope-web/src/lib/jobProgress.ts new file mode 100644 index 00000000..e4601720 --- /dev/null +++ b/calliope-web/src/lib/jobProgress.ts @@ -0,0 +1,200 @@ +import { SvelteMap } from 'svelte/reactivity'; +import type { CalliopeEvent } from './events'; + +/** + * Live per-job render progress, fed by the `/api/events` SSE stream. + * + * Backend reality (see calliope-backend/src/calliope/queue/worker.py): + * - `job.created` { job_id, kind, ... } + * - `job.started` { job_id, kind, message } ← message = job label + * - `job.progress` { prompt_id, message } ← NO job_id, NO percent + * - `job.completed` { job_id, outputs, message } + * - `job.failed` { job_id, error, message } + * - `job.deleted` { job_id } + * + * Because progress ticks carry neither a job id nor a percent, the store: + * 1. Attributes a tick to the currently running job (tracked from job.started; + * explicit `job_id` wins if a future backend sends one). + * 2. Honors a numeric payload field (`progress` / `percent` / `value`, 0–1 or + * 0–100) when present, otherwise synthesizes an asymptotic value that + * approaches TICK_CAP but never reaches it — only job.completed sets 100. + * + * Entries for completed jobs are kept briefly (progress pinned to 100) and for + * failed jobs a bit longer (last known progress + error), then removed, so the + * UI can flash the final state before the jobs query becomes the source of + * truth again. Consumers should only render the live bar while the job's + * queried status is still pending/running. + */ + +export type JobProgressEntry = { + /** 0–100. Reaches 100 only via job.completed. */ + progress: number; + /** Latest human-readable status line from the worker. */ + message?: string; + /** True once the job reached a terminal state (done/failed). */ + final: boolean; + /** Terminal status when final: 'done' | 'failed'. */ + status?: 'done' | 'failed'; + /** Last update, ms epoch. */ + updatedAt: number; +}; + +/** Synthesized ticks never exceed this; only job.completed reports 100. */ +const TICK_CAP = 95; +/** How long terminal entries linger so the UI can show the final state. */ +const DONE_KEEP_MS = 6_000; +const FAILED_KEEP_MS = 10_000; + +function num(v: unknown): number | null { + if (typeof v === 'number' && Number.isFinite(v)) return v; + if (typeof v === 'string' && v.trim() !== '' && Number.isFinite(Number(v))) return Number(v); + return null; +} + +function str(v: unknown): string { + return typeof v === 'string' ? v : ''; +} + +/** Numeric progress from a payload, normalized to 0–100 (capped below 100). */ +function progressValue(d: Record): number | null { + const raw = num(d.progress ?? d.percent ?? d.value); + if (raw == null) return null; + const pct = raw <= 1 ? raw * 100 : raw; + return Math.min(TICK_CAP, Math.max(0, pct)); +} + +class JobProgressStore { + private map = new SvelteMap(); + /** Jobs seen via job.started and not yet terminal — tick attribution. */ + private running = new Set(); + private lastStarted: number | null = null; + private cleanupTimers = new Map>(); + + /** Live entry for a job id (tracked — safe inside $derived / markup). */ + get(jobId: number | null | undefined): JobProgressEntry | undefined { + if (jobId == null) return undefined; + return this.map.get(jobId); + } + + handleEvent(ev: CalliopeEvent): void { + const d = ev.data ?? {}; + switch (ev.type) { + case 'job.created': { + const id = num(d.job_id); + if (id == null) return; + this.cancelCleanup(id); + this.map.set(id, { + progress: 0, + message: str(d.message) || 'Queued', + final: false, + updatedAt: Date.now(), + }); + break; + } + case 'job.started': { + const id = num(d.job_id); + if (id == null) return; + this.cancelCleanup(id); + this.running.add(id); + this.lastStarted = id; + const prev = this.map.get(id); + this.map.set(id, { + progress: prev?.progress ?? 0, + message: str(d.message) || 'Running', + final: false, + updatedAt: Date.now(), + }); + break; + } + case 'job.progress': { + const id = this.resolveJobId(d); + if (id == null) return; + const prev = this.map.get(id); + const progress = progressValue(d) ?? this.synthesize(prev?.progress ?? 0); + this.map.set(id, { + progress, + message: str(d.message) || prev?.message, + final: false, + updatedAt: Date.now(), + }); + break; + } + case 'job.completed': + case 'job.failed': { + const id = num(d.job_id); + if (id == null) return; + this.running.delete(id); + if (this.lastStarted === id) this.lastStarted = null; + const failed = ev.type === 'job.failed'; + const prev = this.map.get(id); + this.map.set(id, { + progress: failed ? (prev?.progress ?? 0) : 100, + message: str(d.error) || str(d.message) || prev?.message, + final: true, + status: failed ? 'failed' : 'done', + updatedAt: Date.now(), + }); + this.scheduleCleanup(id, failed ? FAILED_KEEP_MS : DONE_KEEP_MS); + break; + } + case 'job.deleted': { + const id = num(d.job_id); + if (id == null) return; + this.running.delete(id); + if (this.lastStarted === id) this.lastStarted = null; + this.cancelCleanup(id); + this.map.delete(id); + break; + } + } + } + + /** + * Today's job.progress payload is {prompt_id, message} with no job id. + * Attribute the tick to the only running job, else the most recently + * started one. Explicit job_id wins when a backend sends it. + */ + private resolveJobId(d: Record): number | null { + const explicit = num(d.job_id); + if (explicit != null) return explicit; + if (this.running.size === 1) return [...this.running][0]; + if (this.lastStarted != null && this.running.has(this.lastStarted)) return this.lastStarted; + return null; + } + + /** Asymptotic approach to TICK_CAP — feels live, never falsely completes. */ + private synthesize(prev: number): number { + return prev + (TICK_CAP - prev) * 0.08; + } + + private scheduleCleanup(jobId: number, delayMs: number): void { + this.cancelCleanup(jobId); + this.cleanupTimers.set( + jobId, + setTimeout(() => { + this.cleanupTimers.delete(jobId); + this.map.delete(jobId); + }, delayMs), + ); + } + + private cancelCleanup(jobId: number): void { + const timer = this.cleanupTimers.get(jobId); + if (timer) { + clearTimeout(timer); + this.cleanupTimers.delete(jobId); + } + } +} + +export const jobProgress = new JobProgressStore(); + +/** Feed one SSE event into the store. Safe to call for every event type. */ +export function handleJobEvent(ev: CalliopeEvent): void { + jobProgress.handleEvent(ev); +} + +/** Read the live entry for a job id (reactive via SvelteMap). */ +export function progressFor(jobId: number | null | undefined): JobProgressEntry | undefined { + return jobProgress.get(jobId); +} diff --git a/calliope-web/src/lib/promptTemplates.ts b/calliope-web/src/lib/promptTemplates.ts new file mode 100644 index 00000000..179f2a4a --- /dev/null +++ b/calliope-web/src/lib/promptTemplates.ts @@ -0,0 +1,70 @@ +/** + * Image prompt templates — keep in sync with calliope.agent.prompts + * (character_sheet_prompt / character_portrait_prompt / location_reference_prompt). + * + * These are the prompts the user sees and edits. Generation must not invent a hidden string. + */ + +export type CharacterPromptFields = { + name?: string | null; + role?: string | null; + age?: string | null; + appearance?: string | null; + personality?: string | null; +}; + +export type LocationPromptFields = { + name?: string | null; + description?: string | null; +}; + +export function characterSheetTemplate(c: CharacterPromptFields): string { + const name = (c.name || 'Unnamed').trim(); + const role = (c.role || 'character').trim(); + const age = (c.age || 'unspecified age').trim(); + const appearance = (c.appearance || 'no appearance notes yet').trim(); + const personality = (c.personality || '').trim(); + const personalityLine = personality + ? `Personality cues (visual only): ${personality}\n` + : ''; + return ( + `CHARACTER SHEET — ${name}\n` + + `Role: ${role}. Age: ${age}.\n` + + `Appearance: ${appearance}\n` + + personalityLine + + `\n` + + `Layout: single cinematic character reference sheet on a clean neutral backdrop, ` + + `multiple panels — front full body, side full body, back full body, three-quarter, ` + + `and a head close-up. Same face, hair, body proportions, and outfit in every panel. ` + + `Neutral standing pose, even studio lighting, high detail, no text watermarks, ` + + `no extra characters.` + ); +} + +export function characterPortraitTemplate(c: CharacterPromptFields): string { + const name = (c.name || 'Unnamed').trim(); + const role = (c.role || 'character').trim(); + const age = (c.age || 'unspecified age').trim(); + const appearance = (c.appearance || 'no appearance notes yet').trim(); + return ( + `CHARACTER PORTRAIT — ${name}\n` + + `Role: ${role}. Age: ${age}.\n` + + `Appearance: ${appearance}\n` + + `\n` + + `Shot: cinematic head-and-shoulders portrait, eye-level, soft key light, ` + + `shallow depth of field, sharp facial features, consistent wardrobe collar/shoulders, ` + + `plain muted background, photoreal or high-end concept art, no text.` + ); +} + +export function locationReferenceTemplate(loc: LocationPromptFields): string { + const name = (loc.name || 'Unnamed place').trim(); + const description = (loc.description || 'no description yet').trim(); + return ( + `ENVIRONMENT REFERENCE — ${name}\n` + + `Description: ${description}\n` + + `\n` + + `Shot: wide establishing concept art, cinematic atmosphere, clear readable space ` + + `for characters to stand in, consistent lighting and materials, no people, no text.` + ); +} diff --git a/calliope-web/src/lib/toast.ts b/calliope-web/src/lib/toast.ts new file mode 100644 index 00000000..1b61a790 --- /dev/null +++ b/calliope-web/src/lib/toast.ts @@ -0,0 +1,92 @@ +export type ToastKind = 'success' | 'error' | 'info'; + +export type Toast = { + id: number; + message: string; + kind: ToastKind; + /** Auto-dismiss delay in ms. 0 = sticky until dismissed. */ + duration: number; +}; + +type Listener = (toasts: Toast[]) => void; + +const DEFAULT_DURATION = 3200; + +let seq = 0; +let toasts: Toast[] = []; +const listeners = new Set(); + +type TimerState = { + remaining: number; + startedAt: number; + handle: ReturnType; +}; + +const timers = new Map(); + +function emit() { + const snapshot = [...toasts]; + for (const listener of listeners) listener(snapshot); +} + +export function subscribeToasts(listener: Listener): () => void { + listeners.add(listener); + listener([...toasts]); + return () => listeners.delete(listener); +} + +export function dismissToast(id: number) { + const timer = timers.get(id); + if (timer) { + clearTimeout(timer.handle); + timers.delete(id); + } + toasts = toasts.filter((t) => t.id !== id); + emit(); +} + +function schedule(id: number, delay: number) { + timers.set(id, { + remaining: delay, + startedAt: Date.now(), + handle: setTimeout(() => dismissToast(id), delay), + }); +} + +export function showToast( + message: string, + kind: ToastKind = 'success', + durationMs: number = DEFAULT_DURATION, +) { + const id = ++seq; + toasts = [...toasts, { id, message, kind, duration: durationMs }]; + emit(); + if (durationMs > 0) schedule(id, durationMs); + return id; +} + +/** Pause auto-dismiss (e.g. while the pointer or focus is on the toast). */ +export function pauseToast(id: number) { + const timer = timers.get(id); + if (!timer) return; + clearTimeout(timer.handle); + timer.remaining = Math.max(0, timer.remaining - (Date.now() - timer.startedAt)); + timer.startedAt = Date.now(); +} + +/** Resume auto-dismiss after a pause. */ +export function resumeToast(id: number) { + const timer = timers.get(id); + if (!timer) return; + clearTimeout(timer.handle); + const delay = Math.max(0, timer.remaining); + timer.remaining = delay; + timer.startedAt = Date.now(); + timer.handle = setTimeout(() => dismissToast(id), delay); +} + +export const toast = { + success: (message: string, duration?: number) => showToast(message, 'success', duration), + error: (message: string, duration?: number) => showToast(message, 'error', duration), + info: (message: string, duration?: number) => showToast(message, 'info', duration), +}; diff --git a/calliope-web/src/routes/+layout.svelte b/calliope-web/src/routes/+layout.svelte new file mode 100644 index 00000000..71608bd4 --- /dev/null +++ b/calliope-web/src/routes/+layout.svelte @@ -0,0 +1,16 @@ + + + + + + diff --git a/calliope-web/src/routes/+layout.ts b/calliope-web/src/routes/+layout.ts new file mode 100644 index 00000000..9dca7740 --- /dev/null +++ b/calliope-web/src/routes/+layout.ts @@ -0,0 +1,5 @@ +import type { LayoutLoad } from './$types'; + +export const load: LayoutLoad = () => { + return {}; +}; diff --git a/calliope-web/src/routes/+page.svelte b/calliope-web/src/routes/+page.svelte new file mode 100644 index 00000000..df2a8980 --- /dev/null +++ b/calliope-web/src/routes/+page.svelte @@ -0,0 +1,441 @@ + + + + + + +
+
+
+

Projects

+

Your local story-to-video workspace. Pick up where you left off.

+
+
+ + {#if showForm} +
+
+
+

New reel

+

New Project

+
+ +
+ + + + + +
+ + + +
+ +
+ + +
+
+ {/if} + +
+ +
+ {#each FILTERS as f (f.id)} + + {/each} +
+
+ + {#if $projectsQuery.isLoading} +
+ {#each [1, 2, 3, 4, 5, 6] as n (n)} +
+ +
+ + + + +
+
+ {/each} +
+ {:else if $projectsQuery.isError} + + {#snippet icon()} + + {/snippet} + {#snippet action()} + + {/snippet} + + {:else if all.length === 0} + + {#snippet icon()} + + {/snippet} + {#snippet action()} + + {/snippet} + + {:else if filtered.length === 0} + + {#snippet icon()} + + {/snippet} + {#snippet action()} + + {/snippet} + + {:else} +
+ {#each filtered as project (project.id)} + + {/each} + +
+ {/if} +
+ + diff --git a/calliope-web/src/routes/+page.ts b/calliope-web/src/routes/+page.ts new file mode 100644 index 00000000..6b068267 --- /dev/null +++ b/calliope-web/src/routes/+page.ts @@ -0,0 +1,8 @@ +import { error } from '@sveltejs/kit'; + +export const prerender = true; +export const ssr = false; + +export function load() { + return {}; +} diff --git a/calliope-web/src/routes/app.css b/calliope-web/src/routes/app.css new file mode 100644 index 00000000..5d1c3c58 --- /dev/null +++ b/calliope-web/src/routes/app.css @@ -0,0 +1,158 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --bg-primary: #0a0a0c; + --bg-surface: #141418; + --bg-elevated: #1e1e24; + --border: #2a2a32; + --text-primary: #f4f4f5; + --text-secondary: #a1a1aa; + --text-muted: #71717a; + --accent: #8b5cf6; + --accent-hover: #7c3aed; + --accent-glow: rgba(139, 92, 246, 0.25); + --success: #22c55e; + --warning: #f59e0b; + --error: #ef4444; + --info: #3b82f6; + + /* Omni Composer pill tokens */ + --pill-bg: var(--bg-elevated); + --pill-border: var(--border); + --pill-radius: 9999px; + --pill-height: 36px; + --pill-padding: 0 14px; + --pill-font-size: 13px; + + --radius-sm: 6px; + --radius-md: 10px; + --radius-lg: 16px; + + --space-xs: 4px; + --space-sm: 8px; + --space-md: 16px; + --space-lg: 24px; + --space-xl: 32px; + + --font-display: 'Outfit', system-ui, sans-serif; + --font-body: 'IBM Plex Sans', system-ui, sans-serif; + --font-mono: 'JetBrains Mono', ui-monospace, monospace; +} + +body { + background: var(--bg-primary); + color: var(--text-primary); + font-family: var(--font-body); + margin: 0; + min-height: 100vh; +} + +h1, +h2, +h3, +.logo { + font-family: var(--font-display); +} + +code, +.mono { + font-family: var(--font-mono); +} + +.field { + display: block; + margin-bottom: var(--space-md); +} +.field-label { + display: block; + font-size: 12px; + font-weight: 500; + letter-spacing: 0.02em; + color: var(--text-muted); + margin-bottom: 6px; +} +.field-input, +.field-textarea, +.field-select { + width: 100%; + box-sizing: border-box; + background: var(--bg-elevated); + border: 1px solid var(--border); + border-radius: var(--radius-sm); + padding: 10px 12px; + color: var(--text-primary); + font-size: 14px; + font-family: inherit; +} +.field-textarea { + resize: vertical; + min-height: 96px; + line-height: 1.5; +} +.field-input:focus, +.field-textarea:focus, +.field-select:focus { + outline: none; + border-color: var(--accent); + box-shadow: 0 0 0 3px var(--accent-glow); +} +.field-hint { + margin-top: 6px; + font-size: 12px; + color: var(--text-muted); +} + +/* Dark theme scrollbars (Firefox + Chromium) */ +* { + scrollbar-width: thin; + scrollbar-color: #3f3f46 transparent; +} + +*::-webkit-scrollbar { + width: 10px; + height: 10px; +} + +*::-webkit-scrollbar-track { + background: transparent; +} + +*::-webkit-scrollbar-thumb { + background: #3f3f46; + border-radius: 999px; + border: 2px solid transparent; + background-clip: padding-box; +} + +*::-webkit-scrollbar-thumb:hover { + background: #52525b; + border: 2px solid transparent; + background-clip: padding-box; +} + +*::-webkit-scrollbar-corner { + background: transparent; +} + +/* Global keyboard focus fallback: every natively focusable element gets a ring, + even before the ui/ primitives are adopted. Component-scoped :focus-visible + rules (e.g. .field-input) override this via higher specificity. */ +:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; +} + +/* Global reduced-motion baseline. Components that need a styled static fallback + (Skeleton shimmer, ProgressBar indeterminate, StatusChip pulse) also handle + this in their own scoped styles. */ +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + } +} diff --git a/calliope-web/src/routes/favicon.png/+server.ts b/calliope-web/src/routes/favicon.png/+server.ts new file mode 100644 index 00000000..56c9522e --- /dev/null +++ b/calliope-web/src/routes/favicon.png/+server.ts @@ -0,0 +1,5 @@ +import type { RequestHandler } from '@sveltejs/kit'; + +export const GET: RequestHandler = () => { + return new Response(null, { status: 204 }); +}; diff --git a/calliope-web/src/routes/playground/+page.svelte b/calliope-web/src/routes/playground/+page.svelte new file mode 100644 index 00000000..0a68bb34 --- /dev/null +++ b/calliope-web/src/routes/playground/+page.svelte @@ -0,0 +1,869 @@ + + +
+ + +
+ +
+ + +
+ +
+ + +
+
+

Artifacts

+

+ {jobs.length} + {doneCount} ready +

+
+ + {#if jobsLoading} +
+ + +
+ {:else if jobs.length === 0} +
+

Nothing queued yet

+

Generations land here — pending first, then the media.

+
+ {:else} +
    + {#each jobs as job (job.id)} + {@const primaryPath = job.output_paths?.[0] ?? null} + {@const primaryMedia = primaryPath ? assetUrl(primaryPath) : null} +
  • +
    + #{job.id} + {statusWord(job.status)} + {job.kind} +
    + + {#if job.status === 'pending' || job.status === 'running'} + {@const prog = progressFor(job.id)} +
    + +
    + + {job.status === 'running' ? (prog?.message ?? 'Generating…') : 'Queued'} + + {#if job.status === 'running'} + + {/if} +
    +
    + {/if} + + {#if job.error} +

    {job.error}

    + {/if} + + {#if primaryMedia && primaryPath} + {#if isVideoPath(primaryPath, job.kind)} + + {:else} + + {/if} + {:else if job.status === 'done'} +
    +

    File missing on disk

    + {#if primaryPath} +

    {primaryPath.split(/[/\\]/).pop()}

    + {/if} +
    + {/if} + +
    + {#if primaryPath && primaryMedia} + + {/if} + {#if job.status === 'failed'} + + {/if} + +
    +
  • + {/each} +
+ {/if} +
+ + +
+ {#if modeWorkflows.length === 0} +
+

No enabled {mode === 'video' ? 'video' : 'image'} workflows

+

+ Enable a workflow in Settings → Workflows. +

+
+ {:else if selected} + (workflowId = id)} + allowUpload + showErrors={attempted} + onValidityChange={(m) => (missingLabels = m)} + onSubmit={tryGenerate} + submitting={$generateMutation.isPending} + /> + {#if formError} + + {/if} + {/if} +
+
+
+ + { + previewSrc = null; + previewAlt = ''; + }} +/> + + diff --git a/calliope-web/src/routes/playground/+page.ts b/calliope-web/src/routes/playground/+page.ts new file mode 100644 index 00000000..83addb7e --- /dev/null +++ b/calliope-web/src/routes/playground/+page.ts @@ -0,0 +1,2 @@ +export const ssr = false; +export const prerender = false; diff --git a/calliope-web/src/routes/project/[id]/+page.svelte b/calliope-web/src/routes/project/[id]/+page.svelte new file mode 100644 index 00000000..5f3667fa --- /dev/null +++ b/calliope-web/src/routes/project/[id]/+page.svelte @@ -0,0 +1,329 @@ + + +
+ + + {#if !enabled} +
+ + {#snippet icon()} + + {/snippet} + {#snippet action()} + + {/snippet} + +
+ {:else} +
+ {STAGE_LABELS[activeTab]} + +
+ +
+ + +
+ {#if activeTab === 'story'} + {#if $storyQuery.isLoading} +
+ + + + +
+ {:else if $storyQuery.isError} +
+ Failed to load story: {$storyQuery.error?.message ?? 'unknown error'} +
+ {:else if $storyQuery.data} + $generateStoryMutation.mutateAsync()} + onGoAssets={() => selectStage('assets')} + {agentStatus} + /> + {/if} + {:else if activeTab === 'assets'} + + {:else if activeTab === 'script'} + + {:else if activeTab === 'video'} + + {/if} +
+ + (activityCollapsed = !activityCollapsed)} + /> +
+ {/if} +
+ + diff --git a/calliope-web/src/routes/project/[id]/+page.ts b/calliope-web/src/routes/project/[id]/+page.ts new file mode 100644 index 00000000..d7b61935 --- /dev/null +++ b/calliope-web/src/routes/project/[id]/+page.ts @@ -0,0 +1,8 @@ +import type { PageLoad } from './$types'; + +export const prerender = false; +export const ssr = false; + +export const load: PageLoad = ({ params }) => { + return { id: params.id }; +}; diff --git a/calliope-web/src/routes/settings/+page.svelte b/calliope-web/src/routes/settings/+page.svelte new file mode 100644 index 00000000..7fe1914e --- /dev/null +++ b/calliope-web/src/routes/settings/+page.svelte @@ -0,0 +1,410 @@ + + + + +
+ + {#snippet status()} + {#if isDirty} + + {/if} + {/snippet} + + +
+ +
+ {#if $settingsQuery.isLoading} +

Loading settings…

+ {:else if $settingsQuery.data} + {@const s = $settingsQuery.data} + {#if tab === 'llm'} +
+

LLM

+

OpenAI-compatible chat endpoint used for story and script drafting.

+ + + +
+ {:else if tab === 'comfy'} +
+

ComfyUI

+

Connection to your local render farm for image and video jobs.

+ + +
+ {:else if tab === 'queue'} +
+

Queue

+

Worker concurrency and retry behavior for long GPU jobs.

+ + + +
+ {:else if tab === 'storage'} +
+

Storage

+

Where Calliope keeps SQLite and generated assets on disk.

+
+ +

+ Changing storage paths moves where Calliope writes data. + Do not point this at temporary folders — they are wiped. +

+
+ + +
+ {:else if tab === 'workflows'} + + {/if} + + {#if tab !== 'workflows'} +
+ + {#if isDirty} + Unsaved changes + {:else} + All changes saved + {/if} + + + +
+ {/if} + {/if} +
+
+
+ + (pendingUrl = null)} +/> + + diff --git a/calliope-web/src/routes/settings/+page.ts b/calliope-web/src/routes/settings/+page.ts new file mode 100644 index 00000000..83addb7e --- /dev/null +++ b/calliope-web/src/routes/settings/+page.ts @@ -0,0 +1,2 @@ +export const ssr = false; +export const prerender = false; diff --git a/calliope-web/svelte.config.js b/calliope-web/svelte.config.js new file mode 100644 index 00000000..2194b0b4 --- /dev/null +++ b/calliope-web/svelte.config.js @@ -0,0 +1,23 @@ +import adapter from '@sveltejs/adapter-static'; +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + preprocess: vitePreprocess(), + kit: { + adapter: adapter({ + fallback: 'index.html', + }), + paths: { + base: '', + }, + prerender: { + handleHttpError: ({ path, message }) => { + if (path === '/favicon.png') return; + throw new Error(message); + }, + }, + }, +}; + +export default config; diff --git a/calliope-web/tailwind.config.js b/calliope-web/tailwind.config.js new file mode 100644 index 00000000..51c08f8a --- /dev/null +++ b/calliope-web/tailwind.config.js @@ -0,0 +1,22 @@ +module.exports = { + content: ['./src/**/*.{html,js,svelte,ts}'], + theme: { + extend: { + colors: { + primary: '#0a0a0c', + surface: '#141418', + elevated: '#1e1e24', + border: '#2a2a32', + muted: '#71717a', + accent: '#8b5cf6', + 'accent-hover': '#7c3aed', + }, + borderRadius: { + sm: '6px', + md: '10px', + lg: '16px', + }, + }, + }, + plugins: [], +}; diff --git a/calliope-web/tsconfig.json b/calliope-web/tsconfig.json new file mode 100644 index 00000000..6bbac90a --- /dev/null +++ b/calliope-web/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "bundler", + "module": "ESNext", + "target": "ESNext", + "types": ["svelte"], + "baseUrl": ".", + "paths": { + "$lib/*": ["src/lib/*"] + } + }, + "include": ["src/**/*", "src/**/*.svelte"] +} diff --git a/calliope-web/vite.config.ts b/calliope-web/vite.config.ts new file mode 100644 index 00000000..c5e757cf --- /dev/null +++ b/calliope-web/vite.config.ts @@ -0,0 +1,17 @@ +import { sveltekit } from '@sveltejs/kit/vite'; +import { defineConfig } from 'vite'; + +export default defineConfig({ + plugins: [sveltekit()], + server: { + host: '127.0.0.1', + port: 5173, + strictPort: true, + proxy: { + '/api': { + target: 'http://127.0.0.1:8247', + changeOrigin: true, + }, + }, + }, +}); diff --git a/electron/README.md b/electron/README.md deleted file mode 100644 index 36d5016e..00000000 --- a/electron/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# Calliope — Electron shell - -Portable Windows packaging for the Calliope story-to-video studio. -Double-click `Calliope.exe` → the FastAPI backend starts → the window opens the UI. -No installer, no code signing, no vite — the backend serves the built SPA at its -own origin, so there is zero CORS/API-base configuration. - -## Prerequisites - -- `calliope-backend/.venv` set up (`pip install -e ".[dev]"` + `pyinstaller`) -- `calliope-web/node_modules` installed -- `electron/node_modules` installed (`npm install` in this folder — once) - -## Build (one command) - -```bash -cd electron -npm run build:all -``` - -This chains: - -1. `build:web` — `npm run build` in `calliope-web/` (fresh SPA in `calliope-web/build/`) -2. `build:backend` — PyInstaller (`calliope-backend/calliope.spec`) → - `calliope-backend/dist/calliope-backend/` (onedir, SPA bundled as `calliope/static`) -3. `dist` — electron-builder `dir` target → `electron/dist/win-unpacked/` - -Then zip for distribution: - -```bash -npm run zip # → electron/dist/Calliope-win-x64.zip -``` - -## Run - -- Packaged: `electron/dist/win-unpacked/Calliope.exe` (or unzip the zip anywhere - writable and run `win-unpacked/Calliope.exe`). First launch shows a splash while - the backend boots; a failure page appears if it cannot start. -- Dev (shell against the source backend in `calliope-backend/.venv`): - `npm start` in this folder. - -Ports: tries 8247, then 8248→8250. If a healthy Calliope backend already answers -on a candidate port (e.g. a dev instance), it is reused instead of spawning a -second one. Set `CALLIOPE_PORT=` to pin the preferred port. - -> Note: the backend reads host/port from env (`CALLIOPE_HOST`/`CALLIOPE_PORT`), -> not argv — there is no CLI parser in `calliope.main`. The shell sets both. -> Also: if `ELECTRON_RUN_AS_NODE=1` is set in your environment, Electron will not -> start as an app — unset it before launching. - -## Where user data lives - -Everything is **portable**, next to the backend exe — never `%TEMP%`, never the -source tree: - -``` -/resources/backend/calliope-backend.exe -/resources/backend/data/ created on first run (fresh, empty) -/resources/backend/data/calliope.db SQLite database -/resources/backend/data/assets/ generated assets / uploads -/resources/backend/calliope_config.json created only when you save Settings -``` - -This works because `calliope-backend/src/calliope/config.py` anchors -`BACKEND_ROOT` to `sys.executable`'s folder when running frozen -(`getattr(sys, "frozen", False)`); non-frozen dev behavior is unchanged. -The package ships with **no** `data/` and **no** `calliope_config.json` — -fresh users get a fresh database and sane in-memory defaults. - -Move/copy the whole unzipped folder to relocate the app + its data together. -Avoid `Program Files` (not writable without elevation). - -## Updating backend / frontend - -- UI changed → `npm run build:web` then rebuild (`build:backend` + `dist`). - The spec packs `calliope-web/build/` directly; the copy in - `calliope-backend/src/calliope/static/` is only used by the dev server. -- Backend Python changed → `npm run build:backend && npm run dist`. -- To ship an update, re-zip. Users replace the app folder; their `data/` and - `calliope_config.json` survive if they keep those two paths (they sit outside - `_internal/`, directly in `resources/backend/`). - -## Implementation notes - -- `main.js`: single-instance lock; spawns `resources/backend/calliope-backend.exe` - (hidden, `windowsHide`) with `CALLIOPE_HOST`/`CALLIOPE_PORT`; polls - `/api/health` up to 30 s; loads `http://127.0.0.1:/`; kills the backend on - `before-quit` / `window-all-closed` / `exit` / `SIGINT` / `SIGTERM`. -- Backend exe console stays ON (`console=True` in `calliope.spec`) so users can - run it from a terminal for diagnostics; the shell always hides it. -- asar stays enabled: only the JS shell is packed (`resources/app.asar`); the - backend lives in `extraResources` → `resources/backend/` and writes beside - itself, so asar is irrelevant to storage. - -## Known rough edges - -- Default Electron icon (no custom `.ico` yet). -- Full-page reload (F5) on a deep route (`/project/123`) returns JSON 404 — - Starlette `StaticFiles(html=True)` has no SPA fallback. In-app navigation is - client-side and unaffected; the window always starts at `/`, which works. -- Force-killing `Calliope.exe` (Task Manager → End task with /F) can orphan - `calliope-backend.exe`; the next launch simply reuses it if it is healthy. -- Windows SmartScreen will warn on first run (unsigned binary). diff --git a/electron/main.js b/electron/main.js deleted file mode 100644 index 13eaa991..00000000 --- a/electron/main.js +++ /dev/null @@ -1,216 +0,0 @@ -// Calliope Electron shell. -// -// Starts the FastAPI backend (PyInstaller exe in packaged mode, venv python in -// dev), waits for /api/health, then loads the SPA the backend serves at its own -// origin — so no CORS or API-base handling is needed here. - -const { app, BrowserWindow, Menu } = require('electron'); -const { spawn } = require('node:child_process'); -const http = require('node:http'); -const net = require('node:net'); -const path = require('node:path'); - -const HOST = '127.0.0.1'; -// CALLIOPE_PORT env pins the preferred port (handy for testing alongside a dev -// backend on 8247); otherwise the chain below is tried in order. -const PREFERRED_PORT = Number(process.env.CALLIOPE_PORT) || 8247; -const PORT_CANDIDATES = [...new Set([PREFERRED_PORT, 8247, 8248, 8249, 8250])]; -const HEALTH_TIMEOUT_MS = 30_000; - -let backendChild = null; -let mainWindow = null; - -// ---------- small helpers ---------- - -function healthOk(port) { - return new Promise((resolve) => { - const req = http.get({ host: HOST, port, path: '/api/health', timeout: 1500 }, (res) => { - res.resume(); - resolve(res.statusCode === 200); - }); - req.on('timeout', () => { - req.destroy(); - resolve(false); - }); - req.on('error', () => resolve(false)); - }); -} - -function portBusy(port) { - return new Promise((resolve) => { - const srv = net.createServer(); - srv.once('error', () => resolve(true)); - srv.once('listening', () => srv.close(() => resolve(false))); - srv.listen(port, HOST); - }); -} - -function sleep(ms) { - return new Promise((r) => setTimeout(r, ms)); -} - -// ---------- backend process ---------- - -function backendLaunch() { - if (app.isPackaged) { - // extraResources copied the onedir PyInstaller output to resources/backend/. - // Frozen config.py anchors data/ and calliope_config.json next to this exe. - const exe = path.join(process.resourcesPath, 'backend', 'calliope-backend.exe'); - return { cmd: exe, args: [], cwd: path.dirname(exe) }; - } - // Dev: run the source backend from its venv; storage stays in calliope-backend/data. - const backendRoot = path.resolve(__dirname, '..', 'calliope-backend'); - const py = path.join(backendRoot, '.venv', 'Scripts', 'python.exe'); - return { cmd: py, args: ['-m', 'calliope.main'], cwd: backendRoot }; -} - -function killBackend() { - if (backendChild && backendChild.exitCode === null && !backendChild.killed) { - try { - backendChild.kill(); // TerminateProcess on Windows - } catch { - /* already gone */ - } - } - backendChild = null; -} - -async function waitForHealth(port, child, spawnErrorRef) { - const deadline = Date.now() + HEALTH_TIMEOUT_MS; - while (Date.now() < deadline) { - if (spawnErrorRef.err) throw spawnErrorRef.err; - if (child && child.exitCode !== null) { - throw new Error(`backend exited early (code ${child.exitCode})`); - } - if (await healthOk(port)) return; - await sleep(500); - } - throw new Error(`no /api/health response within ${HEALTH_TIMEOUT_MS / 1000}s`); -} - -async function startBackend() { - let lastErr = null; - for (const port of PORT_CANDIDATES) { - // Stale/previous instance already serving? Reuse it — no second backend. - if (await healthOk(port)) { - console.log(`[calliope] backend already healthy on :${port} — reusing it`); - return port; - } - if (await portBusy(port)) { - console.log(`[calliope] :${port} is busy (not a Calliope backend) — trying next port`); - continue; - } - - const { cmd, args, cwd } = backendLaunch(); - // NOTE: the backend reads host/port from settings/env, NOT argv (there is no - // CLI parser). --host/--port are passed for future CLI support; the env vars - // below are what actually bind the port. - const fullArgs = [...args, '--host', HOST, '--port', String(port)]; - console.log(`[calliope] spawning ${cmd} ${fullArgs.join(' ')} (cwd=${cwd})`); - - const spawnErrorRef = { err: null }; - backendChild = spawn(cmd, fullArgs, { - cwd, - env: { ...process.env, CALLIOPE_HOST: HOST, CALLIOPE_PORT: String(port) }, - windowsHide: true, // never flash a console window for the backend - stdio: ['ignore', 'pipe', 'pipe'], - }); - backendChild.on('error', (err) => { - spawnErrorRef.err = err; - }); - // Mirror backend logs into our stdout (visible when launched from a terminal). - backendChild.stdout?.on('data', (d) => process.stdout.write(`[backend] ${d}`)); - backendChild.stderr?.on('data', (d) => process.stderr.write(`[backend] ${d}`)); - - try { - await waitForHealth(port, backendChild, spawnErrorRef); - console.log(`[calliope] backend healthy on :${port}`); - return port; - } catch (err) { - console.error(`[calliope] backend on :${port} failed: ${err.message}`); - lastErr = err; - killBackend(); - } - } - throw lastErr || new Error(`no free port among ${PORT_CANDIDATES.join(', ')}`); -} - -// ---------- window ---------- - -function inlinePage(title, message) { - const html = ` -${title} - -
-

${title}

${message}

`; - return 'data:text/html;charset=utf-8,' + encodeURIComponent(html); -} - -function createWindow() { - Menu.setApplicationMenu(null); - mainWindow = new BrowserWindow({ - width: 1440, - height: 900, - backgroundColor: '#0a0a0c', - autoHideMenuBar: true, - show: true, - webPreferences: { contextIsolation: true, nodeIntegration: false }, - }); - mainWindow.loadURL(inlinePage('Calliope', 'Starting the local studio…')); -} - -async function boot() { - createWindow(); - try { - const port = await startBackend(); - await mainWindow.loadURL(`http://${HOST}:${port}/`); - } catch (err) { - console.error('[calliope] fatal:', err); - await mainWindow.loadURL( - inlinePage( - 'Calliope failed to start', - `The backend could not be started (${String(err.message || err)}). ` + - `If a previous run hung, close it or run end.bat, then try again.` - ) - ); - } -} - -// ---------- lifecycle ---------- - -const gotLock = app.requestSingleInstanceLock(); -if (!gotLock) { - app.quit(); -} else { - app.on('second-instance', () => { - if (mainWindow) { - if (mainWindow.isMinimized()) mainWindow.restore(); - mainWindow.focus(); - } - }); - - app.whenReady().then(boot); - - app.on('before-quit', killBackend); - app.on('window-all-closed', () => { - killBackend(); - app.quit(); - }); - // Cover terminal kill paths so no orphan calliope-backend.exe is left behind. - process.on('exit', killBackend); - for (const sig of ['SIGINT', 'SIGTERM']) { - process.on(sig, () => { - killBackend(); - app.quit(); - }); - } -} diff --git a/electron/package-lock.json b/electron/package-lock.json deleted file mode 100644 index f8ff9b90..00000000 --- a/electron/package-lock.json +++ /dev/null @@ -1,3594 +0,0 @@ -{ - "name": "calliope-shell", - "version": "0.1.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "calliope-shell", - "version": "0.1.0", - "devDependencies": { - "electron": "^43.2.0", - "electron-builder": "^26.15.3" - } - }, - "node_modules/@electron-internal/extract-zip": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@electron-internal/extract-zip/-/extract-zip-1.0.4.tgz", - "integrity": "sha512-Zr1Vs7E9tpCNhZHDAbFVXc2gEVCG9RqPDjrno5+bdgB6LRAuvgyMHJut4NCVyYwtAieapMzc3fiQ3CSTi75ARg==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=22.12.0" - } - }, - "node_modules/@electron/asar": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.4.1.tgz", - "integrity": "sha512-i4/rNPRS84t0vSRa2HorerGRXWyF4vThfHesw0dmcWHp+cspK743UanA0suA5Q5y8kzY2y6YKrvbIUn69BCAiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "commander": "^5.0.0", - "glob": "^7.1.6", - "minimatch": "^3.0.4" - }, - "bin": { - "asar": "bin/asar.js" - }, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/@electron/asar/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@electron/asar/node_modules/brace-expansion": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", - "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/@electron/asar/node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/@electron/fuses": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@electron/fuses/-/fuses-1.8.0.tgz", - "integrity": "sha512-zx0EIq78WlY/lBb1uXlziZmDZI4ubcCXIMJ4uGjXzZW0nS19TjSPeXPAjzzTmKQlJUZm0SbmZhPKP7tuQ1SsEw==", - "dev": true, - "license": "MIT", - "dependencies": { - "chalk": "^4.1.1", - "fs-extra": "^9.0.1", - "minimist": "^1.2.5" - }, - "bin": { - "electron-fuses": "dist/bin.js" - } - }, - "node_modules/@electron/fuses/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@electron/get": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@electron/get/-/get-5.1.0.tgz", - "integrity": "sha512-3kSBtG8ObcTVfXanm5vVJ6UnBLEVmVsRk1M+vGqCuMBV+XLCbJYuWQful+yIy0GQDsSlK0kHEriEHn7SPk4EnA==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.1.1", - "env-paths": "^3.0.0", - "graceful-fs": "^4.2.11", - "progress": "^2.0.3", - "semver": "^7.6.3", - "sumchecker": "^3.0.1" - }, - "engines": { - "node": ">=22.12.0" - }, - "optionalDependencies": { - "undici": "^7.24.4" - } - }, - "node_modules/@electron/notarize": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@electron/notarize/-/notarize-2.5.0.tgz", - "integrity": "sha512-jNT8nwH1f9X5GEITXaQ8IF/KdskvIkOFfB2CvwumsveVidzpSc+mvhhTMdAGSYF3O+Nq49lJ7y+ssODRXu06+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.1.1", - "fs-extra": "^9.0.1", - "promise-retry": "^2.0.1" - }, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/@electron/notarize/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@electron/osx-sign": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@electron/osx-sign/-/osx-sign-1.3.3.tgz", - "integrity": "sha512-KZ8mhXvWv2rIEgMbWZ4y33bDHyUKMXnx4M0sTyPNK/vcB81ImdeY9Ggdqy0SWbMDgmbqyQ+phgejh6V3R2QuSg==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "compare-version": "^0.1.2", - "debug": "^4.3.4", - "fs-extra": "^10.0.0", - "isbinaryfile": "^4.0.8", - "minimist": "^1.2.6", - "plist": "^3.0.5" - }, - "bin": { - "electron-osx-flat": "bin/electron-osx-flat.js", - "electron-osx-sign": "bin/electron-osx-sign.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@electron/osx-sign/node_modules/isbinaryfile": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", - "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/gjtorikian/" - } - }, - "node_modules/@electron/rebuild": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-4.2.0.tgz", - "integrity": "sha512-RKL/O+jGoXJMxrx/5771y1n0xTKmFuOYGO3gMmwypBM6rsH0kou0mswwdXA2JrhIkE4xyC7v9vGk0n6NPzgOxQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@malept/cross-spawn-promise": "^2.0.0", - "debug": "^4.1.1", - "node-abi": "^4.2.0", - "node-api-version": "^0.2.1", - "node-gyp": "^12.2.0", - "read-binary-file-arch": "^1.0.6" - }, - "bin": { - "electron-rebuild": "lib/cli.js" - }, - "engines": { - "node": ">=22.12.0" - } - }, - "node_modules/@electron/universal": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-2.0.3.tgz", - "integrity": "sha512-Wn9sPYIVFRFl5HmwMJkARCCf7rqK/EurkfQ/rJZ14mHP3iYTjZSIOSVonEAnhWeAXwtw7zOekGRlc6yTtZ0t+g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@electron/asar": "^3.3.1", - "@malept/cross-spawn-promise": "^2.0.0", - "debug": "^4.3.1", - "dir-compare": "^4.2.0", - "fs-extra": "^11.1.1", - "minimatch": "^9.0.3", - "plist": "^3.1.0" - }, - "engines": { - "node": ">=16.4" - } - }, - "node_modules/@electron/universal/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@electron/universal/node_modules/brace-expansion": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.2.tgz", - "integrity": "sha512-w5JZcKgdhDOgOwm8H+KgbosopHMuGcl6qbulwjtz3SM7I7P3yW1eAjzMPLrIE+NQ9vjgANKHWeMHnrT0OXW1oA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@electron/universal/node_modules/fs-extra": { - "version": "11.4.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.4.0.tgz", - "integrity": "sha512-EQsFzMUJkCKGr1ePqlYADkIUmHW1s3ZXr5Yqy6wbGrfUCphpl2maM/kyOIRA2HpP3AaFQTZXD4ldjek+nccddA==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/@electron/universal/node_modules/minimatch": { - "version": "9.0.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", - "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.2" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@electron/windows-sign": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@electron/windows-sign/-/windows-sign-1.2.2.tgz", - "integrity": "sha512-dfZeox66AvdPtb2lD8OsIIQh12Tp0GNCRUDfBHIKGpbmopZto2/A8nSpYYLoedPIHpqkeblZ/k8OV0Gy7PYuyQ==", - "dev": true, - "license": "BSD-2-Clause", - "optional": true, - "peer": true, - "dependencies": { - "cross-dirname": "^0.1.0", - "debug": "^4.3.4", - "fs-extra": "^11.1.1", - "minimist": "^1.2.8", - "postject": "^1.0.0-alpha.6" - }, - "bin": { - "electron-windows-sign": "bin/electron-windows-sign.js" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/@electron/windows-sign/node_modules/fs-extra": { - "version": "11.4.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.4.0.tgz", - "integrity": "sha512-EQsFzMUJkCKGr1ePqlYADkIUmHW1s3ZXr5Yqy6wbGrfUCphpl2maM/kyOIRA2HpP3AaFQTZXD4ldjek+nccddA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/@isaacs/fs-minipass": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", - "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "minipass": "^7.0.4" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@malept/cross-spawn-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@malept/cross-spawn-promise/-/cross-spawn-promise-2.0.0.tgz", - "integrity": "sha512-1DpKU0Z5ThltBwjNySMC14g0CkbyhCaz9FkhxqNsZI6uAPJXFS8cMXlBKo26FJ8ZuW6S9GCMcR9IO5k2X5/9Fg==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/malept" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/subscription/pkg/npm-.malept-cross-spawn-promise?utm_medium=referral&utm_source=npm_fund" - } - ], - "license": "Apache-2.0", - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "engines": { - "node": ">= 12.13.0" - } - }, - "node_modules/@malept/flatpak-bundler": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@malept/flatpak-bundler/-/flatpak-bundler-0.4.0.tgz", - "integrity": "sha512-9QOtNffcOF/c1seMCDnjckb3R9WHcG34tky+FHpNKKCW0wc/scYLwMtO+ptyGUfMW0/b/n4qRiALlaFHc9Oj7Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.1.1", - "fs-extra": "^9.0.0", - "lodash": "^4.17.15", - "tmp-promise": "^3.0.2" - }, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/@malept/flatpak-bundler/node_modules/fs-extra": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", - "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@noble/hashes": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.2.0.tgz", - "integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@peculiar/asn1-schema": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.8.0.tgz", - "integrity": "sha512-7YT0U/ze0tF2QOBbE15gKZwy5tvgGyLRiRHLzhlbOpf7BT032oBSd0haZqXn5W6l26WLlu3dyxzjM+2638/z2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@peculiar/utils": "^2.0.2", - "asn1js": "^3.0.10", - "tslib": "^2.8.1" - } - }, - "node_modules/@peculiar/json-schema": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/@peculiar/json-schema/-/json-schema-1.1.12.tgz", - "integrity": "sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@peculiar/utils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@peculiar/utils/-/utils-2.0.3.tgz", - "integrity": "sha512-+oL3HPFRIZ1St2K50lWCXiioIgSoxzz7R1J3uF6neO2yl1sgmpgY6XXJH4BdpoDkMWznQTeYF6oWNDZLCdQ4eQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^2.8.1" - } - }, - "node_modules/@peculiar/webcrypto": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@peculiar/webcrypto/-/webcrypto-1.7.1.tgz", - "integrity": "sha512-ODOov0sGMJMf3jPonOkgGqPknTsu+DdQ7kD++gz8aI+aFMOMHFbWAA2taqXXVTdP+OTOQR/znGvSpmkeI0WTYQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@peculiar/asn1-schema": "^2.7.0", - "@peculiar/json-schema": "^1.1.12", - "@peculiar/utils": "^2.0.2", - "tslib": "^2.8.1", - "webcrypto-core": "^1.9.2" - }, - "engines": { - "node": ">=14.18.0" - } - }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" - } - }, - "node_modules/@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", - "dev": true, - "license": "MIT", - "dependencies": { - "defer-to-connect": "^2.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@types/cacheable-request": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", - "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "^3.1.4", - "@types/node": "*", - "@types/responselike": "^1.0.0" - } - }, - "node_modules/@types/debug": { - "version": "4.1.13", - "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", - "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/ms": "*" - } - }, - "node_modules/@types/fs-extra": { - "version": "9.0.13", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", - "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/http-cache-semantics": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", - "integrity": "sha512-L3LgimLHXtGkWikKnsPg0/VFx9OGZaC+eN1u4r+OB1XRqH3meBIAVC2zr1WdMH+RHmnRkqliQAOHNJ/E0j/e0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", - "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "24.13.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.3.tgz", - "integrity": "sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "undici-types": "~7.18.0" - } - }, - "node_modules/@types/responselike": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", - "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@xmldom/xmldom": { - "version": "0.8.13", - "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.13.tgz", - "integrity": "sha512-KRYzxepc14G/CEpEGc3Yn+JKaAeT63smlDr+vjB8jRfgTBBI9wRj/nkQEO+ucV8p8I9bfKLWp37uHgFrbntPvw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/abbrev": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-4.0.0.tgz", - "integrity": "sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==", - "dev": true, - "license": "ISC", - "engines": { - "node": "^20.17.0 || >=22.9.0" - } - }, - "node_modules/agent-base": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", - "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 14" - } - }, - "node_modules/ajv": { - "version": "8.20.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", - "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/app-builder-lib": { - "version": "26.15.3", - "resolved": "https://registry.npmjs.org/app-builder-lib/-/app-builder-lib-26.15.3.tgz", - "integrity": "sha512-2VnyWkqsP5v5XbBhL3tD5Syx8iNPBYsoU7kY4S2fz7wg8Rj/nztWKCUzGKaFRTv0Xwf3/H058CR1Kvtd/3lRow==", - "dev": true, - "license": "MIT", - "dependencies": { - "@electron/asar": "3.4.1", - "@electron/fuses": "^1.8.0", - "@electron/get": "^3.0.0", - "@electron/notarize": "2.5.0", - "@electron/osx-sign": "1.3.3", - "@electron/rebuild": "^4.0.4", - "@electron/universal": "2.0.3", - "@malept/flatpak-bundler": "^0.4.0", - "@noble/hashes": "^2.2.0", - "@peculiar/webcrypto": "^1.7.1", - "@types/fs-extra": "9.0.13", - "ajv": "^8.18.0", - "asn1js": "^3.0.10", - "async-exit-hook": "^2.0.1", - "builder-util": "26.15.3", - "builder-util-runtime": "9.7.0", - "chromium-pickle-js": "^0.2.0", - "ci-info": "4.3.1", - "debug": "^4.3.4", - "dotenv": "^16.4.5", - "dotenv-expand": "^11.0.6", - "ejs": "^3.1.8", - "electron-publish": "26.15.3", - "fs-extra": "^10.1.0", - "hosted-git-info": "^4.1.0", - "isbinaryfile": "^5.0.0", - "jiti": "^2.4.2", - "js-yaml": "^4.1.0", - "json5": "^2.2.3", - "lazy-val": "^1.0.5", - "minimatch": "^10.2.5", - "pkijs": "^3.4.0", - "plist": "3.1.0", - "proper-lockfile": "^4.1.2", - "resedit": "^1.7.0", - "semver": "~7.7.3", - "tar": "^7.5.7", - "temp-file": "^3.4.0", - "tiny-async-pool": "1.3.0", - "unzipper": "^0.12.3", - "which": "^5.0.0" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "dmg-builder": "26.15.3", - "electron-builder-squirrel-windows": "26.15.3" - } - }, - "node_modules/app-builder-lib/node_modules/@electron/get": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@electron/get/-/get-3.1.0.tgz", - "integrity": "sha512-F+nKc0xW+kVbBRhFzaMgPy3KwmuNTYX1fx6+FxxoSnNgwYX6LD7AKBTWkU0MQ6IBoe7dz069CNkR673sPAgkCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.1.1", - "env-paths": "^2.2.0", - "fs-extra": "^8.1.0", - "got": "^11.8.5", - "progress": "^2.0.3", - "semver": "^6.2.0", - "sumchecker": "^3.0.1" - }, - "engines": { - "node": ">=14" - }, - "optionalDependencies": { - "global-agent": "^3.0.0" - } - }, - "node_modules/app-builder-lib/node_modules/@electron/get/node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/app-builder-lib/node_modules/@electron/get/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/app-builder-lib/node_modules/ci-info": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.3.1.tgz", - "integrity": "sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/app-builder-lib/node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/app-builder-lib/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "license": "MIT", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/app-builder-lib/node_modules/semver": { - "version": "7.7.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", - "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/app-builder-lib/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/asn1js": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.10.tgz", - "integrity": "sha512-S2s3aOytiKdFRdulw2qPE51MzjzVOisppcVv7jVFR+Kw0kxwvFrDcYA0h7Ndqbmj0HkMIXYWaoj7fli8kgx1eg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "pvtsutils": "^1.3.6", - "pvutils": "^1.1.5", - "tslib": "^2.8.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "dev": true, - "license": "MIT" - }, - "node_modules/async-exit-hook": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/async-exit-hook/-/async-exit-hook-2.0.1.tgz", - "integrity": "sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/aws4": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", - "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", - "dev": true, - "license": "MIT" - }, - "node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true, - "license": "MIT" - }, - "node_modules/boolean": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/boolean/-/boolean-3.2.0.tgz", - "integrity": "sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==", - "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/brace-expansion": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz", - "integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/builder-util": { - "version": "26.15.3", - "resolved": "https://registry.npmjs.org/builder-util/-/builder-util-26.15.3.tgz", - "integrity": "sha512-q2hn7Mbo2nFNkVekPiHFx6Nfo3hURmES3tfBn+k5Pqxl2RkmP3QGqZUhH/q9Pch/4G05NRhPjDlVj1O8q4Txvw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/debug": "^4.1.6", - "builder-util-runtime": "9.7.0", - "chalk": "^4.1.2", - "cross-spawn": "^7.0.6", - "debug": "^4.3.4", - "fs-extra": "^10.1.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", - "js-yaml": "^4.1.0", - "sanitize-filename": "^1.6.3", - "source-map-support": "^0.5.19", - "stat-mode": "^1.0.0", - "temp-file": "^3.4.0", - "tiny-async-pool": "1.3.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/builder-util-runtime": { - "version": "9.7.0", - "resolved": "https://registry.npmjs.org/builder-util-runtime/-/builder-util-runtime-9.7.0.tgz", - "integrity": "sha512-g/kR520giAFYkSXTzcmF3kqQq7wi8F6N6SzeDgZrqTBN+VHdmgWOyTdD1yD7AATDId/yXLvuP34CxW46/BwCdw==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.3.4", - "sax": "^1.2.4" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/bytestreamjs": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-2.0.1.tgz", - "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.6.0" - } - }, - "node_modules/cacheable-request": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", - "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", - "dev": true, - "license": "MIT", - "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chownr": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", - "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=18" - } - }, - "node_modules/chromium-pickle-js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/chromium-pickle-js/-/chromium-pickle-js-0.2.0.tgz", - "integrity": "sha512-1R5Fho+jBq0DDydt+/vHWj5KJNJCKdARKOCwZUen84I5BreWoLqRLANH1U87eJy1tiASPtMnGqJJq0ZsLoRPOw==", - "dev": true, - "license": "MIT" - }, - "node_modules/ci-info": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", - "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/clone-response": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", - "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/commander": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", - "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/compare-version": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/compare-version/-/compare-version-0.1.2.tgz", - "integrity": "sha512-pJDh5/4wrEnXX/VWRZvruAGHkzKdr46z11OlTPN+VrATlWWhSKewNCJ1futCO5C7eJB3nPMFZA1LeYtcFboZ2A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "license": "MIT" - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/cross-dirname": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/cross-dirname/-/cross-dirname-0.1.0.tgz", - "integrity": "sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true - }, - "node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/cross-spawn/node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/cross-spawn/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "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/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/detect-node": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", - "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/dir-compare": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dir-compare/-/dir-compare-4.2.0.tgz", - "integrity": "sha512-2xMCmOoMrdQIPHdsTawECdNPwlVFB9zGcz3kuhmBO6U3oU+UQjsue0i8ayLKpgBcm+hcXPMVSGUN9d+pvJ6+VQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimatch": "^3.0.5", - "p-limit": "^3.1.0 " - } - }, - "node_modules/dir-compare/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/dir-compare/node_modules/brace-expansion": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", - "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/dir-compare/node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/dmg-builder": { - "version": "26.15.3", - "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-26.15.3.tgz", - "integrity": "sha512-O3zJUFUYHJKgzPqioHxfxzBzlSC1eXCSr79gMSBKBP5AgjjpmrydMsMLotEg9fAJF36vdUncb+4ndRNxoPdlSQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "app-builder-lib": "26.15.3", - "builder-util": "26.15.3", - "fs-extra": "^10.1.0", - "js-yaml": "^4.1.0" - } - }, - "node_modules/dotenv": { - "version": "16.6.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", - "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", - "dev": true, - "license": "BSD-2-Clause", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/dotenv-expand": { - "version": "11.0.7", - "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-11.0.7.tgz", - "integrity": "sha512-zIHwmZPRshsCdpMDyVsqGmgyP0yT8GAgXUnkdAoJisxvf33k7yO6OuoKmcTGuXPWSsm8Oh88nZicRLA9Y0rUeA==", - "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "dotenv": "^16.4.5" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://dotenvx.com" - } - }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "readable-stream": "^2.0.2" - } - }, - "node_modules/ejs": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", - "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "jake": "^10.8.5" - }, - "bin": { - "ejs": "bin/cli.js" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/electron": { - "version": "43.2.0", - "resolved": "https://registry.npmjs.org/electron/-/electron-43.2.0.tgz", - "integrity": "sha512-80zvrgG7ZRXD+tD0IyLvrnN9n+veSxadMRsMaC9wKKP3iUbtC7rGM8+dVuCmOb0Rrwwv8ESW4awnUZh9Hbp1fA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@electron-internal/extract-zip": "^1.0.1", - "@electron/get": "^5.0.0", - "@types/node": "^24.9.0" - }, - "bin": { - "electron": "cli.js", - "install-electron": "install.js" - }, - "engines": { - "node": ">= 22.12.0" - } - }, - "node_modules/electron-builder": { - "version": "26.15.3", - "resolved": "https://registry.npmjs.org/electron-builder/-/electron-builder-26.15.3.tgz", - "integrity": "sha512-a1KM5heqS3gQCZzizXEI8RjJy3QVogULPdeSknt76uLDpBIW/HDGsMg/XgP0riP6PI9COsRvFITKKGDqA8fJxA==", - "dev": true, - "license": "MIT", - "dependencies": { - "app-builder-lib": "26.15.3", - "builder-util": "26.15.3", - "builder-util-runtime": "9.7.0", - "chalk": "^4.1.2", - "ci-info": "^4.2.0", - "dmg-builder": "26.15.3", - "fs-extra": "^10.1.0", - "lazy-val": "^1.0.5", - "simple-update-notifier": "2.0.0", - "yargs": "^17.6.2" - }, - "bin": { - "electron-builder": "cli.js", - "install-app-deps": "install-app-deps.js" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/electron-builder-squirrel-windows": { - "version": "26.15.3", - "resolved": "https://registry.npmjs.org/electron-builder-squirrel-windows/-/electron-builder-squirrel-windows-26.15.3.tgz", - "integrity": "sha512-Jc19XPV9y9+2bAdZPkXuVNGNIEFBq9poHC61l8Kv6FdK7DRG3+Ic0rerC0DXOaeHNz8yW0fg/JnF8GQROOF5MA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "app-builder-lib": "26.15.3", - "builder-util": "26.15.3", - "electron-winstaller": "5.4.0" - } - }, - "node_modules/electron-publish": { - "version": "26.15.3", - "resolved": "https://registry.npmjs.org/electron-publish/-/electron-publish-26.15.3.tgz", - "integrity": "sha512-g/2bn8YTavY4cuS5F+jOS7zmZbXXBV8KZ8yHKfJjFPoKtzBqrpCdNPxBd3tqdBwP7BVd0lGzf7Bk2s0KesWZ4Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/fs-extra": "^9.0.11", - "aws4": "^1.13.2", - "builder-util": "26.15.3", - "builder-util-runtime": "9.7.0", - "chalk": "^4.1.2", - "form-data": "^4.0.5", - "fs-extra": "^10.1.0", - "lazy-val": "^1.0.5", - "mime": "^2.5.2" - } - }, - "node_modules/electron-winstaller": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/electron-winstaller/-/electron-winstaller-5.4.0.tgz", - "integrity": "sha512-bO3y10YikuUwUuDUQRM4KfwNkKhnpVO7IPdbsrejwN9/AABJzzTQ4GeHwyzNSrVO+tEH3/Np255a3sVZpZDjvg==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "peer": true, - "dependencies": { - "@electron/asar": "^3.2.1", - "debug": "^4.1.1", - "fs-extra": "^7.0.1", - "lodash": "^4.17.21", - "temp": "^0.9.0" - }, - "engines": { - "node": ">=8.0.0" - }, - "optionalDependencies": { - "@electron/windows-sign": "^1.1.2" - } - }, - "node_modules/electron-winstaller/node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/electron-winstaller/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "license": "MIT", - "peer": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/electron-winstaller/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true, - "license": "MIT" - }, - "node_modules/end-of-stream": { - "version": "1.4.5", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", - "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", - "dev": true, - "license": "MIT", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/env-paths": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", - "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", - "dev": true, - "license": "MIT" - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", - "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-set-tostringtag": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", - "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.6", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true, - "license": "MIT", - "optional": true - }, - "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/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/exponential-backoff": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", - "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-uri": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.4.tgz", - "integrity": "sha512-8JnbkQ4juDyvYs4mgFGQqg4yCYtFDtUtmp2QIQq11ZZe5CFQ5wcqm1rqDgAh/QdMySuBnPzMUiJUNZG5N/AiQw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "BSD-3-Clause" - }, - "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/filelist": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.6.tgz", - "integrity": "sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "minimatch": "^5.0.1" - } - }, - "node_modules/filelist/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/filelist/node_modules/brace-expansion": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.2.tgz", - "integrity": "sha512-w5JZcKgdhDOgOwm8H+KgbosopHMuGcl6qbulwjtz3SM7I7P3yW1eAjzMPLrIE+NQ9vjgANKHWeMHnrT0OXW1oA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/filelist/node_modules/minimatch": { - "version": "5.1.9", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", - "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/form-data": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", - "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.4", - "mime-types": "^2.1.35" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "license": "ISC" - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, - "license": "MIT", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "license": "MIT" - }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", - "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/global-agent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/global-agent/-/global-agent-3.0.0.tgz", - "integrity": "sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==", - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "dependencies": { - "boolean": "^3.0.1", - "es6-error": "^4.1.1", - "matcher": "^3.0.0", - "roarr": "^2.15.3", - "semver": "^7.3.2", - "serialize-error": "^7.0.1" - }, - "engines": { - "node": ">=10.0" - } - }, - "node_modules/globalthis": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", - "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "define-properties": "^1.2.1", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/got": { - "version": "11.8.6", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", - "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=10.19.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", - "dev": true, - "license": "ISC", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", - "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", - "dev": true, - "license": "BSD-2-Clause" - }, - "node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", - "dev": true, - "license": "MIT", - "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" - }, - "engines": { - "node": ">=10.19.0" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", - "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^7.1.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/isbinaryfile": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-5.0.7.tgz", - "integrity": "sha512-gnWD14Jh3FzS3CPhF0AxNOJ8CxqeblPTADzI38r0wt8ZyQl5edpy75myt08EG2oKvpyiqSqsx+Wkz9vtkbTqYQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 18.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/gjtorikian/" - } - }, - "node_modules/isexe": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz", - "integrity": "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=18" - } - }, - "node_modules/jake": { - "version": "10.9.4", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", - "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "async": "^3.2.6", - "filelist": "^1.0.4", - "picocolors": "^1.1.1" - }, - "bin": { - "jake": "bin/cli.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/jiti": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", - "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", - "dev": true, - "license": "MIT", - "bin": { - "jiti": "lib/jiti-cli.mjs" - } - }, - "node_modules/js-yaml": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", - "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/puzrin" - }, - { - "type": "github", - "url": "https://github.com/sponsors/nodeca" - } - ], - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true, - "license": "MIT" - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true, - "license": "ISC", - "optional": true - }, - "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/jsonfile": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", - "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/keyv": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "json-buffer": "3.0.1" - } - }, - "node_modules/lazy-val": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.5.tgz", - "integrity": "sha512-0/BnGCCfyUMkBpeDgWihanIAF9JmZhHBgUhEqzvf+adhNGLoP6TaiI5oF8oyb3I45P+PcnrqihSf01M0l0G5+Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/lodash": { - "version": "4.18.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", - "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/matcher": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", - "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "escape-string-regexp": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true, - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/minimatch": { - "version": "10.2.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.5" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/minizlib": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.1.0.tgz", - "integrity": "sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "minipass": "^7.1.2" - }, - "engines": { - "node": ">= 18" - } - }, - "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "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/node-abi": { - "version": "4.33.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-4.33.0.tgz", - "integrity": "sha512-vLBWCKb+7LWsX+TbfzWOkw0W81m377tyx3hOweBTjO43CXZnRGS1/JPWs20fr0PgZyDXk6ROYrylsEycK8raDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.6.3" - }, - "engines": { - "node": ">=22.12.0" - } - }, - "node_modules/node-api-version": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-api-version/-/node-api-version-0.2.1.tgz", - "integrity": "sha512-2xP/IGGMmmSQpI1+O/k72jF/ykvZ89JeuKX3TLJAYPDVLUalrshrLHkeVcCCZqG/eEa635cr8IBYzgnDvM2O8Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.3.5" - } - }, - "node_modules/node-gyp": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-12.4.0.tgz", - "integrity": "sha512-OMcPNvqTCFUnNaBlmdgq+lfNqY7gTiSmNRDjY3uAXRyudeKZEZxu3CLtjMQrx4zZxCX2b/mpNqTtwuCJgXhHkw==", - "dev": true, - "license": "MIT", - "dependencies": { - "env-paths": "^2.2.0", - "exponential-backoff": "^3.1.1", - "graceful-fs": "^4.2.6", - "nopt": "^9.0.0", - "proc-log": "^6.0.0", - "semver": "^7.3.5", - "tar": "^7.5.4", - "tinyglobby": "^0.2.12", - "undici": "^6.25.0", - "which": "^6.0.0" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": "^20.17.0 || >=22.9.0" - } - }, - "node_modules/node-gyp/node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/node-gyp/node_modules/isexe": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz", - "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=20" - } - }, - "node_modules/node-gyp/node_modules/undici": { - "version": "6.28.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz", - "integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.17" - } - }, - "node_modules/node-gyp/node_modules/which": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz", - "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^4.0.0" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^20.17.0 || >=22.9.0" - } - }, - "node_modules/node-int64": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "dev": true, - "license": "MIT" - }, - "node_modules/nopt": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-9.0.0.tgz", - "integrity": "sha512-Zhq3a+yFKrYwSBluL4H9XP3m3y5uvQkB/09CwDruCiRmR/UJYnn9W4R48ry0uGC70aeTPKLynBtscP9efFFcPw==", - "dev": true, - "license": "ISC", - "dependencies": { - "abbrev": "^4.0.0" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": "^20.17.0 || >=22.9.0" - } - }, - "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/pe-library": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/pe-library/-/pe-library-0.4.1.tgz", - "integrity": "sha512-eRWB5LBz7PpDu4PUlwT0PhnQfTQJlDDdPa35urV4Osrm0t0AqQFGn+UIkU3klZvwJ8KPO3VbBFsXquA6p6kqZw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12", - "npm": ">=6" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jet2jet" - } - }, - "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.5", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pkijs": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.4.0.tgz", - "integrity": "sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "@noble/hashes": "1.4.0", - "asn1js": "^3.0.6", - "bytestreamjs": "^2.0.1", - "pvtsutils": "^1.3.6", - "pvutils": "^1.1.3", - "tslib": "^2.8.1" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/pkijs/node_modules/@noble/hashes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", - "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/plist": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz", - "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@xmldom/xmldom": "^0.8.8", - "base64-js": "^1.5.1", - "xmlbuilder": "^15.1.1" - }, - "engines": { - "node": ">=10.4.0" - } - }, - "node_modules/postject": { - "version": "1.0.0-alpha.6", - "resolved": "https://registry.npmjs.org/postject/-/postject-1.0.0-alpha.6.tgz", - "integrity": "sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "commander": "^9.4.0" - }, - "bin": { - "postject": "dist/cli.js" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/postject/node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": "^12.20.0 || >=14" - } - }, - "node_modules/proc-log": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-6.1.0.tgz", - "integrity": "sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==", - "dev": true, - "license": "ISC", - "engines": { - "node": "^20.17.0 || >=22.9.0" - } - }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "license": "MIT" - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "dev": true, - "license": "MIT", - "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/proper-lockfile": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-4.1.2.tgz", - "integrity": "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.4", - "retry": "^0.12.0", - "signal-exit": "^3.0.2" - } - }, - "node_modules/pump": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", - "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", - "dev": true, - "license": "MIT", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/pvtsutils": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.6.tgz", - "integrity": "sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "^2.8.1" - } - }, - "node_modules/pvutils": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.1.5.tgz", - "integrity": "sha512-KTqnxsgGiQ6ZAzZCVlJH5eOjSnvlyEgx1m8bkRJfOhmGRqfo5KLvmAlACQkrjEtOQ4B7wF9TdSLIs9O90MX9xA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/read-binary-file-arch": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/read-binary-file-arch/-/read-binary-file-arch-1.0.6.tgz", - "integrity": "sha512-BNg9EN3DD3GsDXX7Aa8O4p92sryjkmzYYgmgTAc6CA4uGLEDzFfxOxugu21akOxpcXHiEgsYkC6nPsQvLLLmEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.3.4" - }, - "bin": { - "read-binary-file-arch": "cli.js" - } - }, - "node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/resedit": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/resedit/-/resedit-1.7.2.tgz", - "integrity": "sha512-vHjcY2MlAITJhC0eRD/Vv8Vlgmu9Sd3LX9zZvtGzU5ZImdTN3+d6e/4mnTyV8vEbyf1sgNIrWxhWlrys52OkEA==", - "dev": true, - "license": "MIT", - "dependencies": { - "pe-library": "^0.4.1" - }, - "engines": { - "node": ">=12", - "npm": ">=6" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jet2jet" - } - }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", - "dev": true, - "license": "MIT" - }, - "node_modules/responselike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", - "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", - "dev": true, - "license": "MIT", - "dependencies": { - "lowercase-keys": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "peer": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, - "node_modules/roarr": { - "version": "2.15.4", - "resolved": "https://registry.npmjs.org/roarr/-/roarr-2.15.4.tgz", - "integrity": "sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==", - "dev": true, - "license": "BSD-3-Clause", - "optional": true, - "dependencies": { - "boolean": "^3.0.1", - "detect-node": "^2.0.4", - "globalthis": "^1.0.1", - "json-stringify-safe": "^5.0.1", - "semver-compare": "^1.0.0", - "sprintf-js": "^1.1.2" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "license": "MIT" - }, - "node_modules/sanitize-filename": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/sanitize-filename/-/sanitize-filename-1.6.4.tgz", - "integrity": "sha512-9ZyI08PsvdQl2r/bBIGubpVdR3RR9sY6RDiWFPreA21C/EFlQhmgo20UZlNjZMMZNubusLhAQozkA0Od5J21Eg==", - "dev": true, - "license": "WTFPL OR ISC", - "dependencies": { - "truncate-utf8-bytes": "^1.0.0" - } - }, - "node_modules/sax": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.1.tgz", - "integrity": "sha512-42tBVwLWnaQvW5zc4HbZrTuWccECCZfBi92FDuwtqxasH+JbPB3/FOKb1m222K42R4WxuxzzMsTswfzgtSu64Q==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=11.0.0" - } - }, - "node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true, - "license": "MIT", - "optional": true - }, - "node_modules/serialize-error": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-7.0.1.tgz", - "integrity": "sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "type-fest": "^0.13.1" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/simple-update-notifier": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", - "integrity": "sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, - "node_modules/sprintf-js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", - "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", - "dev": true, - "license": "BSD-3-Clause", - "optional": true - }, - "node_modules/stat-mode": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stat-mode/-/stat-mode-1.0.0.tgz", - "integrity": "sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/sumchecker": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-3.0.1.tgz", - "integrity": "sha512-MvjXzkz/BOfyVDkG0oFOtBxHX2u3gKbMHIF/dXblZsgD3BWOFLmHovIpZY7BykJdAjcqRCBi1WYBNdEC9yI7vg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "debug": "^4.1.0" - }, - "engines": { - "node": ">= 8.0" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tar": { - "version": "7.5.22", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.22.tgz", - "integrity": "sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/fs-minipass": "^4.0.0", - "chownr": "^3.0.0", - "minipass": "^7.1.2", - "minizlib": "^3.1.0", - "yallist": "^5.0.0" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/tar/node_modules/yallist": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", - "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=18" - } - }, - "node_modules/temp": { - "version": "0.9.4", - "resolved": "https://registry.npmjs.org/temp/-/temp-0.9.4.tgz", - "integrity": "sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==", - "dev": true, - "license": "MIT", - "peer": true, - "dependencies": { - "mkdirp": "^0.5.1", - "rimraf": "~2.6.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/temp-file": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/temp-file/-/temp-file-3.4.0.tgz", - "integrity": "sha512-C5tjlC/HCtVUOi3KWVokd4vHVViOmGjtLwIh4MuzPo/nMYTV/p1urt3RnMz2IWXDdKEGJH3k5+KPxtqRsUYGtg==", - "dev": true, - "license": "MIT", - "dependencies": { - "async-exit-hook": "^2.0.1", - "fs-extra": "^10.0.0" - } - }, - "node_modules/tiny-async-pool": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tiny-async-pool/-/tiny-async-pool-1.3.0.tgz", - "integrity": "sha512-01EAw5EDrcVrdgyCLgoSPvqznC0sVxDSVeiOz09FUpjh71G79VCqneOr+xvt7T1r76CF6ZZfPjHorN2+d+3mqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^5.5.0" - } - }, - "node_modules/tiny-async-pool/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver" - } - }, - "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/tmp": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.7.tgz", - "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.14" - } - }, - "node_modules/tmp-promise": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz", - "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "tmp": "^0.2.0" - } - }, - "node_modules/truncate-utf8-bytes": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/truncate-utf8-bytes/-/truncate-utf8-bytes-1.0.2.tgz", - "integrity": "sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==", - "dev": true, - "license": "WTFPL", - "dependencies": { - "utf8-byte-length": "^1.0.1" - } - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true, - "license": "0BSD" - }, - "node_modules/type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "optional": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/undici": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.0.tgz", - "integrity": "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==", - "dev": true, - "license": "MIT", - "optional": true, - "engines": { - "node": ">=20.18.1" - } - }, - "node_modules/undici-types": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", - "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", - "dev": true, - "license": "MIT" - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/unzipper": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/unzipper/-/unzipper-0.12.5.tgz", - "integrity": "sha512-tXYOi9R57Uj/2Z25SOs5RRSzq886MBQj2gY8dPL+xl/kv6s6SvByoKfAtvfVeEuhntWDgjd2o9p2lb4TVPAz0A==", - "dev": true, - "license": "MIT", - "dependencies": { - "bluebird": "~3.7.2", - "duplexer2": "~0.1.4", - "fs-extra": "11.3.1", - "graceful-fs": "^4.2.2", - "node-int64": "^0.4.0" - } - }, - "node_modules/unzipper/node_modules/fs-extra": { - "version": "11.3.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.1.tgz", - "integrity": "sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/utf8-byte-length": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", - "integrity": "sha512-Xn0w3MtiQ6zoz2vFyUVruaCL53O/DwUvkEeOvj+uulMm0BkUGYWmBYVyElqZaSLhY6ZD0ulfU3aBra2aVT4xfA==", - "dev": true, - "license": "(WTFPL OR MIT)" - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true, - "license": "MIT" - }, - "node_modules/webcrypto-core": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/webcrypto-core/-/webcrypto-core-1.9.2.tgz", - "integrity": "sha512-gsXecm82UQNlTBURJGuqOWy1Ww08S3kZUcr3aOJS02Pk0xLtkfeUAVC0u0xhgdonFme80edSJUIJyuvL/7250Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@peculiar/asn1-schema": "^2.7.0", - "@peculiar/json-schema": "^1.1.12", - "@peculiar/utils": "^2.0.2", - "asn1js": "^3.0.10", - "tslib": "^2.8.1" - } - }, - "node_modules/which": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", - "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^3.1.1" - }, - "bin": { - "node-which": "bin/which.js" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/xmlbuilder": { - "version": "15.1.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", - "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.0" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true, - "license": "ISC" - }, - "node_modules/yargs": { - "version": "17.7.3", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", - "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/electron/package.json b/electron/package.json deleted file mode 100644 index e7b71a73..00000000 --- a/electron/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "calliope-shell", - "productName": "Calliope", - "version": "1.0.0", - "private": true, - "description": "Electron shell for the Calliope local story-to-video studio", - "main": "main.js", - "scripts": { - "start": "electron .", - "dist": "electron-builder --win dir", - "build:web": "cd ../calliope-web && npm run build", - "build:backend": "cd ../calliope-backend && .venv/Scripts/python.exe -m PyInstaller calliope.spec --noconfirm", - "build:all": "npm run build:web && npm run build:backend && npm run dist", - "zip": "powershell -NoProfile -Command \"Compress-Archive -Path 'dist/win-unpacked' -DestinationPath 'dist/Calliope-win-x64.zip' -Force\"" - }, - "build": { - "appId": "com.calliope.app", - "productName": "Calliope", - "asar": true, - "files": [ - "main.js", - "package.json" - ], - "extraResources": [ - { - "from": "../calliope-backend/dist/calliope-backend", - "to": "backend", - "filter": [ - "**/*", - "!data/**", - "!data", - "!calliope_config.json" - ] - } - ], - "win": { - "target": [ - "dir" - ] - }, - "directories": { - "output": "dist" - } - }, - "devDependencies": { - "electron": "^43.2.0", - "electron-builder": "^26.15.3" - } -} diff --git a/example_ComfyUI_workflows/Krea2_t2i_20260818_API.json b/example_ComfyUI_workflows/Krea2_t2i_20260818_API.json new file mode 100644 index 00000000..55b58d79 --- /dev/null +++ b/example_ComfyUI_workflows/Krea2_t2i_20260818_API.json @@ -0,0 +1,372 @@ +{ + "29": { + "inputs": { + "filename_prefix": "krea2/Assets", + "images": [ + "173", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "(output:image) Image Output" + } + }, + "144": { + "inputs": { + "text": [ + "171:163", + 0 + ], + "clip": [ + "149", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "145": { + "inputs": { + "width": 1280, + "height": 720, + "batch_size": 1 + }, + "class_type": "EmptyLatentImage", + "_meta": { + "title": "Empty Latent Image" + } + }, + "146": { + "inputs": { + "seed": 875219259066635, + "steps": 8, + "cfg": 1, + "sampler_name": "res_multistep", + "scheduler": "beta", + "denoise": 1, + "model": [ + "159", + 0 + ], + "positive": [ + "144", + 0 + ], + "negative": [ + "151", + 0 + ], + "latent_image": [ + "145", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "148": { + "inputs": { + "unet_name": "Krea-2-Turbo.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "149": { + "inputs": { + "clip_name": "qwen3vl_4b_fp8_scaled.safetensors", + "type": "krea2", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "150": { + "inputs": { + "vae_name": "qwen_image_vae.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "151": { + "inputs": { + "conditioning": [ + "144", + 0 + ] + }, + "class_type": "ConditioningZeroOut", + "_meta": { + "title": "Conditioning Zero Out" + } + }, + "152": { + "inputs": { + "lora_name": "krea2\\Krea2-realism-V2.safetensors", + "strength_model": 1, + "model": [ + "148", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + }, + "156": { + "inputs": { + "value": " ultra realistic landscape. A sprawling, vertical city of dark metal and concrete. Sleek towers are contrasted with grimy, overcrowded lower levels. Perpetual twilight is punctuated by neon propaganda and searchlights." + }, + "class_type": "PrimitiveStringMultiline", + "_meta": { + "title": "(Input:prompt) Prompt" + } + }, + "159": { + "inputs": { + "switch": [ + "160", + 0 + ], + "on_false": [ + "148", + 0 + ], + "on_true": [ + "152", + 0 + ] + }, + "class_type": "ComfySwitchNode", + "_meta": { + "title": "Switch (Model)" + } + }, + "160": { + "inputs": { + "value": false + }, + "class_type": "PrimitiveBoolean", + "_meta": { + "title": "Boolean (Enable LoRA?)" + } + }, + "161": { + "inputs": { + "value": false + }, + "class_type": "PrimitiveBoolean", + "_meta": { + "title": "Boolean (Refine Prompt?)" + } + }, + "172": { + "inputs": { + "seed": 42, + "steps": 6, + "cfg": 1, + "sampler_name": "euler", + "scheduler": "simple", + "denoise": 0.15, + "model": [ + "152", + 0 + ], + "positive": [ + "144", + 0 + ], + "negative": [ + "151", + 0 + ], + "latent_image": [ + "187", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "173": { + "inputs": { + "samples": [ + "172", + 0 + ], + "vae": [ + "150", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "187": { + "inputs": { + "pixels": [ + "188", + 0 + ], + "vae": [ + "150", + 0 + ] + }, + "class_type": "VAEEncode", + "_meta": { + "title": "VAE Encode" + } + }, + "188": { + "inputs": { + "samples": [ + "146", + 0 + ], + "vae": [ + "150", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "171:154": { + "inputs": { + "string_a": [ + "171:155", + 0 + ], + "string_b": [ + "156", + 0 + ], + "delimiter": "" + }, + "class_type": "StringConcatenate", + "_meta": { + "title": "Concatenate Text" + } + }, + "171:153": { + "inputs": { + "prompt": [ + "171:154", + 0 + ], + "max_length": 512, + "sampling_mode": "on", + "sampling_mode.temperature": 0.7, + "sampling_mode.top_k": 64, + "sampling_mode.top_p": 0.95, + "sampling_mode.min_p": 0.05, + "sampling_mode.repetition_penalty": 1.05, + "sampling_mode.seed": 0, + "sampling_mode.presence_penalty": 0, + "thinking": true, + "use_default_template": true, + "clip": [ + "149", + 0 + ] + }, + "class_type": "TextGenerate", + "_meta": { + "title": "Generate Text" + } + }, + "171:157": { + "inputs": { + "source": [ + "171:158", + 0 + ] + }, + "class_type": "PreviewAny", + "_meta": { + "title": "Preview as Text" + } + }, + "171:162": { + "inputs": { + "string_a": [ + "171:157", + 0 + ], + "string_b": "muted minimalist sketch style", + "delimiter": ", " + }, + "class_type": "StringConcatenate", + "_meta": { + "title": "Concatenate Text (LoRA Trigger Word)" + } + }, + "171:163": { + "inputs": { + "switch": [ + "160", + 0 + ], + "on_false": [ + "171:157", + 0 + ], + "on_true": [ + "171:162", + 0 + ] + }, + "class_type": "ComfySwitchNode", + "_meta": { + "title": "If/Else Switch" + } + }, + "171:158": { + "inputs": { + "switch": [ + "161", + 0 + ], + "on_false": [ + "156", + 0 + ], + "on_true": [ + "171:153", + 0 + ] + }, + "class_type": "ComfySwitchNode", + "_meta": { + "title": "If/Else Switch" + } + }, + "171:155": { + "inputs": { + "value": "You are an expert prompt engineer for text-to-image models. Your task is to expand the user's prompt into a highly effective image-generation prompt.\n\nThink step by step about the request before writing the answer:\n- What is the subject and mood?\n- What visual styles, mediums, and lighting options would fit? Consider two or three alternatives and pick the one that best serves the caption.\n- What composition, framing, and grounded details will help the text-to-image model?\n\nThen output a single expanded prompt paragraph.\n\nFollow these rules strictly:\n1. **Faithfulness First:** Preserve all original subjects, actions, colors, and spatial relationships. Do not add new objects, props, characters, or animals unless the user clearly implies them.\n2. **Practical T2I Structure:** Write a prompt that a text-to-image model can parse cleanly. Group subjects with their own attributes and actions. Use grounded phrasing for poses, interactions, and spatial layout.\n3. **Style Planning Stays Internal:** Use your internal reasoning to choose style, medium, framing, and lighting. Do not emit planning tags or wrappers in the visible answer body.\n4. **Text Rendering:** If the user requests visible text, quotes, labels, or typography, specify the exact text clearly and wrap requested words in quotes.\n5. **Avoid Over-Specification:** Do not invent highly specific clothing, colors, materials, or scene details unless the input supports them.\n6. **Structure:** Write one cohesive paragraph after the thinking block. No bullets, JSON, or markdown.\n7. **Respect Existing Detail:** If the user's prompt is already detailed, lightly polish and finalize rather than heavily expanding — preserve their phrasing and direction.\n8. **Respect the Human Form:** Treat depictions of people with dignity. Assume clothing covers genitals and intimate anatomy.\n9. **Preserve User Medium:** When the user explicitly requests a medium (e.g. \"photo of\", \"photograph of\", \"illustration of\", \"painting of\", \"sketch of\", \"3D render of\"), honor it. Do not pivot to a different medium to avoid difficulty — match the user's stated intent.\n\nUser's Input:\n\n" + }, + "class_type": "PrimitiveStringMultiline", + "_meta": { + "title": "Text String (System Prompt)" + } + } +} \ No newline at end of file diff --git a/example_ComfyUI_workflows/krea2_T2I_CharSheetV1_API.json b/example_ComfyUI_workflows/krea2_T2I_CharSheetV1_API.json new file mode 100644 index 00000000..125e2985 --- /dev/null +++ b/example_ComfyUI_workflows/krea2_T2I_CharSheetV1_API.json @@ -0,0 +1,536 @@ +{ + "29": { + "inputs": { + "filename_prefix": "krea2_identity_edit/CharSheet", + "images": [ + "54", + 0 + ] + }, + "class_type": "SaveImage", + "_meta": { + "title": "(output:image) Character Sheet" + } + }, + "53": { + "inputs": { + "seed": 908245965848740, + "steps": 10, + "cfg": 1, + "sampler_name": "euler", + "scheduler": "simple", + "denoise": 1, + "model": [ + "120", + 0 + ], + "positive": [ + "119", + 0 + ], + "negative": [ + "85", + 0 + ], + "latent_image": [ + "135", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "54": { + "inputs": { + "samples": [ + "53", + 0 + ], + "vae": [ + "57", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "55": { + "inputs": { + "unet_name": "Krea-2-Turbo.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "56": { + "inputs": { + "clip_name": "qwen3vl_4b_fp8_scaled.safetensors", + "type": "krea2", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "57": { + "inputs": { + "vae_name": "qwen_image_vae.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "73": { + "inputs": { + "pixels": [ + "123", + 0 + ], + "vae": [ + "57", + 0 + ] + }, + "class_type": "VAEEncode", + "_meta": { + "title": "VAE Encode" + } + }, + "85": { + "inputs": { + "prompt": "", + "grounding_px": 768, + "system_prompt": "", + "clip": [ + "56", + 0 + ], + "image": [ + "123", + 0 + ] + }, + "class_type": "Krea2EditGroundedEncode", + "_meta": { + "title": "negative (leave empty)" + } + }, + "117": { + "inputs": { + "vae": [ + "57", + 0 + ] + }, + "class_type": "VAEEncode", + "_meta": { + "title": "VAE Encode" + } + }, + "119": { + "inputs": { + "prompt": "Convert the character in the image to a Character Sheet showing a face close-up, front full body, side full body and back full body views.", + "grounding_px": 0, + "system_prompt": "", + "clip": [ + "56", + 0 + ], + "image": [ + "123", + 0 + ] + }, + "class_type": "Krea2EditGroundedEncode", + "_meta": { + "title": "Krea2 Edit (grounded encode)" + } + }, + "120": { + "inputs": { + "ref_boost": 1, + "ref_boost_a": 1, + "fit_mode": "fit", + "model": [ + "127", + 0 + ], + "source_latent": [ + "73", + 0 + ], + "vae": [ + "57", + 0 + ], + "source_image": [ + "123", + 0 + ] + }, + "class_type": "Krea2EditModelPatch", + "_meta": { + "title": "Krea2 Edit (source patch)" + } + }, + "121": { + "inputs": { + "image": [ + "123", + 0 + ] + }, + "class_type": "GetImageSize", + "_meta": { + "title": "Get Image Size" + } + }, + "123": { + "inputs": { + "width": 1024, + "height": 1024, + "upscale_method": "lanczos", + "keep_proportion": "resize", + "pad_color": "0, 0, 0", + "crop_position": "center", + "divisible_by": 2, + "device": "cpu", + "image": [ + "147", + 0 + ] + }, + "class_type": "ImageResizeKJv2", + "_meta": { + "title": "Resize Image v2" + } + }, + "127": { + "inputs": { + "lora_name": "krea2\\QuadView_krea2_v1.safetensors", + "strength_model": 1, + "model": [ + "55", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + }, + "135": { + "inputs": { + "width": 1536, + "height": 1024, + "batch_size": 1 + }, + "class_type": "EmptySD3LatentImage", + "_meta": { + "title": "EmptySD3LatentImage" + } + }, + "144": { + "inputs": { + "text": [ + "163", + 0 + ], + "clip": [ + "149", + 0 + ] + }, + "class_type": "CLIPTextEncode", + "_meta": { + "title": "CLIP Text Encode (Prompt)" + } + }, + "145": { + "inputs": { + "width": 1024, + "height": 1024, + "batch_size": 1 + }, + "class_type": "EmptyLatentImage", + "_meta": { + "title": "Empty Latent Image" + } + }, + "146": { + "inputs": { + "seed": 328782017276463, + "steps": 8, + "cfg": 1, + "sampler_name": "euler", + "scheduler": "simple", + "denoise": 1, + "model": [ + "159", + 0 + ], + "positive": [ + "144", + 0 + ], + "negative": [ + "151", + 0 + ], + "latent_image": [ + "145", + 0 + ] + }, + "class_type": "KSampler", + "_meta": { + "title": "KSampler" + } + }, + "147": { + "inputs": { + "samples": [ + "146", + 0 + ], + "vae": [ + "150", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "148": { + "inputs": { + "unet_name": "Krea-2-Turbo.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "149": { + "inputs": { + "clip_name": "qwen3vl_4b_fp8_scaled.safetensors", + "type": "krea2", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "150": { + "inputs": { + "vae_name": "qwen_image_vae.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "151": { + "inputs": { + "conditioning": [ + "144", + 0 + ] + }, + "class_type": "ConditioningZeroOut", + "_meta": { + "title": "Conditioning Zero Out" + } + }, + "152": { + "inputs": { + "lora_name": "krea2\\Krea2-realism-V2.safetensors", + "strength_model": 1, + "model": [ + "148", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + }, + "153": { + "inputs": { + "prompt": [ + "154", + 0 + ], + "max_length": 512, + "sampling_mode": "on", + "sampling_mode.temperature": 0.7, + "sampling_mode.top_k": 64, + "sampling_mode.top_p": 0.95, + "sampling_mode.min_p": 0.05, + "sampling_mode.repetition_penalty": 1.05, + "sampling_mode.seed": 0, + "sampling_mode.presence_penalty": 0, + "thinking": true, + "use_default_template": true, + "clip": [ + "149", + 0 + ] + }, + "class_type": "TextGenerate", + "_meta": { + "title": "Generate Text" + } + }, + "154": { + "inputs": { + "string_a": [ + "155", + 0 + ], + "string_b": [ + "156", + 0 + ], + "delimiter": "" + }, + "class_type": "StringConcatenate", + "_meta": { + "title": "Concatenate Text" + } + }, + "155": { + "inputs": { + "value": "You are an expert prompt engineer for text-to-image models. Your task is to expand the user's prompt into a highly effective image-generation prompt.\n\nThink step by step about the request before writing the answer:\n- What is the subject and mood?\n- What visual styles, mediums, and lighting options would fit? Consider two or three alternatives and pick the one that best serves the caption.\n- What composition, framing, and grounded details will help the text-to-image model?\n\nThen output a single expanded prompt paragraph.\n\nFollow these rules strictly:\n1. **Faithfulness First:** Preserve all original subjects, actions, colors, and spatial relationships. Do not add new objects, props, characters, or animals unless the user clearly implies them.\n2. **Practical T2I Structure:** Write a prompt that a text-to-image model can parse cleanly. Group subjects with their own attributes and actions. Use grounded phrasing for poses, interactions, and spatial layout.\n3. **Style Planning Stays Internal:** Use your internal reasoning to choose style, medium, framing, and lighting. Do not emit planning tags or wrappers in the visible answer body.\n4. **Text Rendering:** If the user requests visible text, quotes, labels, or typography, specify the exact text clearly and wrap requested words in quotes.\n5. **Avoid Over-Specification:** Do not invent highly specific clothing, colors, materials, or scene details unless the input supports them.\n6. **Structure:** Write one cohesive paragraph after the thinking block. No bullets, JSON, or markdown.\n7. **Respect Existing Detail:** If the user's prompt is already detailed, lightly polish and finalize rather than heavily expanding — preserve their phrasing and direction.\n8. **Respect the Human Form:** Treat depictions of people with dignity. Assume clothing covers genitals and intimate anatomy.\n9. **Preserve User Medium:** When the user explicitly requests a medium (e.g. \"photo of\", \"photograph of\", \"illustration of\", \"painting of\", \"sketch of\", \"3D render of\"), honor it. Do not pivot to a different medium to avoid difficulty — match the user's stated intent.\n\nUser's Input:\n\n" + }, + "class_type": "PrimitiveStringMultiline", + "_meta": { + "title": "Text String (System Prompt)" + } + }, + "156": { + "inputs": { + "value": "" + }, + "class_type": "PrimitiveStringMultiline", + "_meta": { + "title": "(Input:prompt) Character Prompt Not Sheet" + } + }, + "157": { + "inputs": { + "source": [ + "158", + 0 + ] + }, + "class_type": "PreviewAny", + "_meta": { + "title": "Preview as Text" + } + }, + "158": { + "inputs": { + "switch": [ + "161", + 0 + ], + "on_false": [ + "156", + 0 + ], + "on_true": [ + "153", + 0 + ] + }, + "class_type": "ComfySwitchNode", + "_meta": { + "title": "If/Else Switch" + } + }, + "159": { + "inputs": { + "switch": [ + "160", + 0 + ], + "on_false": [ + "148", + 0 + ], + "on_true": [ + "152", + 0 + ] + }, + "class_type": "ComfySwitchNode", + "_meta": { + "title": "Switch (Model)" + } + }, + "160": { + "inputs": { + "value": false + }, + "class_type": "PrimitiveBoolean", + "_meta": { + "title": "Boolean (Enable LoRA?)" + } + }, + "161": { + "inputs": { + "value": true + }, + "class_type": "PrimitiveBoolean", + "_meta": { + "title": "Boolean (Refine Prompt?)" + } + }, + "162": { + "inputs": { + "string_a": [ + "157", + 0 + ], + "string_b": "muted minimalist sketch style", + "delimiter": ", " + }, + "class_type": "StringConcatenate", + "_meta": { + "title": "Concatenate Text (LoRA Trigger Word)" + } + }, + "163": { + "inputs": { + "switch": [ + "160", + 0 + ], + "on_false": [ + "157", + 0 + ], + "on_true": [ + "162", + 0 + ] + }, + "class_type": "ComfySwitchNode", + "_meta": { + "title": "If/Else Switch" + } + } +} \ No newline at end of file diff --git a/example_ComfyUI_workflows/video_minimax_h3_r2v_2ref_API.json b/example_ComfyUI_workflows/video_minimax_h3_r2v_2ref_API.json new file mode 100644 index 00000000..9861bafb --- /dev/null +++ b/example_ComfyUI_workflows/video_minimax_h3_r2v_2ref_API.json @@ -0,0 +1,351 @@ +{ + "115": { + "inputs": { + "aspect_ratio": "16:9 (Widescreen)", + "megapixels": 0.8, + "multiple": 32 + }, + "class_type": "ResolutionSelector", + "_meta": { + "title": "Resolution Selector (Size)" + } + }, + "131": { + "inputs": { + "expression": "max(5, round(a * 24)) + (5 - (max(5, round(a * 24)) % 17)) % 17", + "values.a": [ + "132", + 0 + ] + }, + "class_type": "ComfyMathExpression", + "_meta": { + "title": "Math Expression" + } + }, + "132": { + "inputs": { + "value": 5 + }, + "class_type": "PrimitiveFloat", + "_meta": { + "title": "(input:duration) Duration" + } + }, + "138": { + "inputs": { + "value": "" + }, + "class_type": "PrimitiveStringMultiline", + "_meta": { + "title": "(input:prompt) Text Prompt" + } + }, + "148": { + "inputs": { + "image": "CharSheet_00002_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 1" + } + }, + "149": { + "inputs": { + "image": "CharSheet_00005_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 2" + } + }, + "160": { + "inputs": { + "string_a": "r34l1sm , create realism style cinematic video. ", + "string_b": [ + "138", + 0 + ], + "delimiter": " " + }, + "class_type": "StringConcatenate", + "_meta": { + "title": "Concatenate Text" + } + }, + "161": { + "inputs": { + "unet_name": "minimax-h3\\minimax_h3_ref2va_int8_convrot.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "162": { + "inputs": { + "lora_name": "minimax-h3\\minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors", + "strength_model": 1, + "model": [ + "161", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + }, + "163": { + "inputs": { + "clip_name": "minimax-h3\\qwen3vl_32b_minimax_h3_int8_convrot.comfy.safetensors", + "type": "minimax", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "164": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_video_vae_fp16.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "165": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_audio_vae_fp32.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "166": { + "inputs": { + "shift_video": 12, + "shift_audio": 3, + "model": [ + "167", + 0 + ] + }, + "class_type": "MiniMaxH3SigmaShift", + "_meta": { + "title": "ModelSamplingMiniMaxH3" + } + }, + "167": { + "inputs": { + "sage_attention": "auto", + "allow_compile": false, + "model": [ + "180", + 0 + ] + }, + "class_type": "PathchSageAttentionKJ", + "_meta": { + "title": "Patch Sage Attention KJ" + } + }, + "169": { + "inputs": { + "sampler_name": "euler" + }, + "class_type": "KSamplerSelect", + "_meta": { + "title": "KSamplerSelect" + } + }, + "170": { + "inputs": { + "scheduler": "beta", + "steps": 8, + "denoise": 1, + "model": [ + "166", + 0 + ] + }, + "class_type": "BasicScheduler", + "_meta": { + "title": "BasicScheduler" + } + }, + "171": { + "inputs": { + "noise_seed": 1043441231554445 + }, + "class_type": "RandomNoise", + "_meta": { + "title": "RandomNoise" + } + }, + "172": { + "inputs": { + "model": [ + "166", + 0 + ], + "conditioning": [ + "178", + 0 + ] + }, + "class_type": "BasicGuider", + "_meta": { + "title": "Basic Guider" + } + }, + "173": { + "inputs": { + "noise": [ + "171", + 0 + ], + "guider": [ + "172", + 0 + ], + "sampler": [ + "169", + 0 + ], + "sigmas": [ + "170", + 0 + ], + "latent_image": [ + "178", + 1 + ] + }, + "class_type": "SamplerCustomAdvanced", + "_meta": { + "title": "SamplerCustomAdvanced" + } + }, + "174": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "164", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "175": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "165", + 0 + ] + }, + "class_type": "VAEDecodeAudio", + "_meta": { + "title": "VAE Decode Audio" + } + }, + "176": { + "inputs": { + "frame_rate": 24, + "loop_count": 0, + "filename_prefix": "Calliope/vid", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": false, + "pingpong": false, + "save_output": false, + "images": [ + "174", + 0 + ], + "audio": [ + "175", + 0 + ] + }, + "class_type": "VHS_VideoCombine", + "_meta": { + "title": "(output:video) Video" + } + }, + "178": { + "inputs": { + "prompt": [ + "160", + 0 + ], + "width": [ + "115", + 0 + ], + "height": [ + "115", + 1 + ], + "length": [ + "131", + 1 + ], + "ref_image_size": "match", + "clip": [ + "163", + 0 + ], + "vae": [ + "164", + 0 + ], + "audio_vae": [ + "165", + 0 + ], + "ref_images.ref_image_0": [ + "148", + 0 + ], + "ref_images.ref_image_1": [ + "149", + 0 + ] + }, + "class_type": "MiniMaxH3ReferenceToVideo", + "_meta": { + "title": "MiniMax H3 Reference to Video" + } + }, + "180": { + "inputs": { + "lora_name": "minimax-h3\\h3-realism-people-t2v-i2v-r2v(r34l1sm).safetensors", + "strength_model": 1, + "model": [ + "162", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + } +} \ No newline at end of file diff --git a/example_ComfyUI_workflows/video_minimax_h3_r2v_3ref_API.json b/example_ComfyUI_workflows/video_minimax_h3_r2v_3ref_API.json new file mode 100644 index 00000000..bb27a0fc --- /dev/null +++ b/example_ComfyUI_workflows/video_minimax_h3_r2v_3ref_API.json @@ -0,0 +1,364 @@ +{ + "115": { + "inputs": { + "aspect_ratio": "16:9 (Widescreen)", + "megapixels": 0.8, + "multiple": 32 + }, + "class_type": "ResolutionSelector", + "_meta": { + "title": "Resolution Selector (Size)" + } + }, + "131": { + "inputs": { + "expression": "max(5, round(a * 24)) + (5 - (max(5, round(a * 24)) % 17)) % 17", + "values.a": [ + "132", + 0 + ] + }, + "class_type": "ComfyMathExpression", + "_meta": { + "title": "Math Expression" + } + }, + "132": { + "inputs": { + "value": 5 + }, + "class_type": "PrimitiveFloat", + "_meta": { + "title": "(input:duration) Duration" + } + }, + "138": { + "inputs": { + "value": "" + }, + "class_type": "PrimitiveStringMultiline", + "_meta": { + "title": "(input:prompt) Text Prompt" + } + }, + "148": { + "inputs": { + "image": "CharSheet_00002_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 1" + } + }, + "149": { + "inputs": { + "image": "CharSheet_00005_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 2" + } + }, + "155": { + "inputs": { + "image": "CharSheet_00008_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 3" + } + }, + "160": { + "inputs": { + "string_a": "r34l1sm , create realism style cinematic video. ", + "string_b": [ + "138", + 0 + ], + "delimiter": " " + }, + "class_type": "StringConcatenate", + "_meta": { + "title": "Concatenate Text" + } + }, + "161": { + "inputs": { + "unet_name": "minimax-h3\\minimax_h3_ref2va_int8_convrot.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "162": { + "inputs": { + "lora_name": "minimax-h3\\minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors", + "strength_model": 1, + "model": [ + "161", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + }, + "163": { + "inputs": { + "clip_name": "minimax-h3\\qwen3vl_32b_minimax_h3_int8_convrot.comfy.safetensors", + "type": "minimax", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "164": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_video_vae_fp16.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "165": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_audio_vae_fp32.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "166": { + "inputs": { + "shift_video": 12, + "shift_audio": 3, + "model": [ + "167", + 0 + ] + }, + "class_type": "MiniMaxH3SigmaShift", + "_meta": { + "title": "ModelSamplingMiniMaxH3" + } + }, + "167": { + "inputs": { + "sage_attention": "auto", + "allow_compile": false, + "model": [ + "180", + 0 + ] + }, + "class_type": "PathchSageAttentionKJ", + "_meta": { + "title": "Patch Sage Attention KJ" + } + }, + "169": { + "inputs": { + "sampler_name": "euler" + }, + "class_type": "KSamplerSelect", + "_meta": { + "title": "KSamplerSelect" + } + }, + "170": { + "inputs": { + "scheduler": "beta", + "steps": 8, + "denoise": 1, + "model": [ + "166", + 0 + ] + }, + "class_type": "BasicScheduler", + "_meta": { + "title": "BasicScheduler" + } + }, + "171": { + "inputs": { + "noise_seed": 1043441231554445 + }, + "class_type": "RandomNoise", + "_meta": { + "title": "RandomNoise" + } + }, + "172": { + "inputs": { + "model": [ + "166", + 0 + ], + "conditioning": [ + "178", + 0 + ] + }, + "class_type": "BasicGuider", + "_meta": { + "title": "Basic Guider" + } + }, + "173": { + "inputs": { + "noise": [ + "171", + 0 + ], + "guider": [ + "172", + 0 + ], + "sampler": [ + "169", + 0 + ], + "sigmas": [ + "170", + 0 + ], + "latent_image": [ + "178", + 1 + ] + }, + "class_type": "SamplerCustomAdvanced", + "_meta": { + "title": "SamplerCustomAdvanced" + } + }, + "174": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "164", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "175": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "165", + 0 + ] + }, + "class_type": "VAEDecodeAudio", + "_meta": { + "title": "VAE Decode Audio" + } + }, + "176": { + "inputs": { + "frame_rate": 24, + "loop_count": 0, + "filename_prefix": "Calliope/vid", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": false, + "pingpong": false, + "save_output": false, + "images": [ + "174", + 0 + ], + "audio": [ + "175", + 0 + ] + }, + "class_type": "VHS_VideoCombine", + "_meta": { + "title": "(output:video) Video" + } + }, + "178": { + "inputs": { + "prompt": [ + "160", + 0 + ], + "width": [ + "115", + 0 + ], + "height": [ + "115", + 1 + ], + "length": [ + "131", + 1 + ], + "ref_image_size": "match", + "clip": [ + "163", + 0 + ], + "vae": [ + "164", + 0 + ], + "audio_vae": [ + "165", + 0 + ], + "ref_images.ref_image_0": [ + "148", + 0 + ], + "ref_images.ref_image_1": [ + "149", + 0 + ], + "ref_images.ref_image_2": [ + "155", + 0 + ] + }, + "class_type": "MiniMaxH3ReferenceToVideo", + "_meta": { + "title": "MiniMax H3 Reference to Video" + } + }, + "180": { + "inputs": { + "lora_name": "minimax-h3\\h3-realism-people-t2v-i2v-r2v(r34l1sm).safetensors", + "strength_model": 1, + "model": [ + "162", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + } +} \ No newline at end of file diff --git a/example_ComfyUI_workflows/video_minimax_h3_r2v_4ref_API.json b/example_ComfyUI_workflows/video_minimax_h3_r2v_4ref_API.json new file mode 100644 index 00000000..ef6ad573 --- /dev/null +++ b/example_ComfyUI_workflows/video_minimax_h3_r2v_4ref_API.json @@ -0,0 +1,377 @@ +{ + "115": { + "inputs": { + "aspect_ratio": "16:9 (Widescreen)", + "megapixels": 0.8, + "multiple": 32 + }, + "class_type": "ResolutionSelector", + "_meta": { + "title": "Resolution Selector (Size)" + } + }, + "131": { + "inputs": { + "expression": "max(5, round(a * 24)) + (5 - (max(5, round(a * 24)) % 17)) % 17", + "values.a": [ + "132", + 0 + ] + }, + "class_type": "ComfyMathExpression", + "_meta": { + "title": "Math Expression" + } + }, + "132": { + "inputs": { + "value": 5 + }, + "class_type": "PrimitiveFloat", + "_meta": { + "title": "(input:duration) Duration" + } + }, + "138": { + "inputs": { + "value": "" + }, + "class_type": "PrimitiveStringMultiline", + "_meta": { + "title": "(input:prompt) Text Prompt" + } + }, + "148": { + "inputs": { + "image": "CharSheet_00002_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 1" + } + }, + "149": { + "inputs": { + "image": "CharSheet_00005_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 2" + } + }, + "155": { + "inputs": { + "image": "CharSheet_00008_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 3" + } + }, + "156": { + "inputs": { + "image": "CharSheet_00003_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 4" + } + }, + "160": { + "inputs": { + "string_a": "r34l1sm , create realism style cinematic video. ", + "string_b": [ + "138", + 0 + ], + "delimiter": " " + }, + "class_type": "StringConcatenate", + "_meta": { + "title": "Concatenate Text" + } + }, + "161": { + "inputs": { + "unet_name": "minimax-h3\\minimax_h3_ref2va_int8_convrot.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "162": { + "inputs": { + "lora_name": "minimax-h3\\minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors", + "strength_model": 1, + "model": [ + "161", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + }, + "163": { + "inputs": { + "clip_name": "minimax-h3\\qwen3vl_32b_minimax_h3_int8_convrot.comfy.safetensors", + "type": "minimax", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "164": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_video_vae_fp16.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "165": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_audio_vae_fp32.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "166": { + "inputs": { + "shift_video": 12, + "shift_audio": 3, + "model": [ + "167", + 0 + ] + }, + "class_type": "MiniMaxH3SigmaShift", + "_meta": { + "title": "ModelSamplingMiniMaxH3" + } + }, + "167": { + "inputs": { + "sage_attention": "auto", + "allow_compile": false, + "model": [ + "180", + 0 + ] + }, + "class_type": "PathchSageAttentionKJ", + "_meta": { + "title": "Patch Sage Attention KJ" + } + }, + "169": { + "inputs": { + "sampler_name": "euler" + }, + "class_type": "KSamplerSelect", + "_meta": { + "title": "KSamplerSelect" + } + }, + "170": { + "inputs": { + "scheduler": "beta", + "steps": 8, + "denoise": 1, + "model": [ + "166", + 0 + ] + }, + "class_type": "BasicScheduler", + "_meta": { + "title": "BasicScheduler" + } + }, + "171": { + "inputs": { + "noise_seed": 1043441231554445 + }, + "class_type": "RandomNoise", + "_meta": { + "title": "RandomNoise" + } + }, + "172": { + "inputs": { + "model": [ + "166", + 0 + ], + "conditioning": [ + "178", + 0 + ] + }, + "class_type": "BasicGuider", + "_meta": { + "title": "Basic Guider" + } + }, + "173": { + "inputs": { + "noise": [ + "171", + 0 + ], + "guider": [ + "172", + 0 + ], + "sampler": [ + "169", + 0 + ], + "sigmas": [ + "170", + 0 + ], + "latent_image": [ + "178", + 1 + ] + }, + "class_type": "SamplerCustomAdvanced", + "_meta": { + "title": "SamplerCustomAdvanced" + } + }, + "174": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "164", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "175": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "165", + 0 + ] + }, + "class_type": "VAEDecodeAudio", + "_meta": { + "title": "VAE Decode Audio" + } + }, + "176": { + "inputs": { + "frame_rate": 24, + "loop_count": 0, + "filename_prefix": "Calliope/vid", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": false, + "pingpong": false, + "save_output": false, + "images": [ + "174", + 0 + ], + "audio": [ + "175", + 0 + ] + }, + "class_type": "VHS_VideoCombine", + "_meta": { + "title": "(output:video) Video" + } + }, + "178": { + "inputs": { + "prompt": [ + "160", + 0 + ], + "width": [ + "115", + 0 + ], + "height": [ + "115", + 1 + ], + "length": [ + "131", + 1 + ], + "ref_image_size": "match", + "clip": [ + "163", + 0 + ], + "vae": [ + "164", + 0 + ], + "audio_vae": [ + "165", + 0 + ], + "ref_images.ref_image_0": [ + "148", + 0 + ], + "ref_images.ref_image_1": [ + "149", + 0 + ], + "ref_images.ref_image_2": [ + "155", + 0 + ], + "ref_images.ref_image_3": [ + "156", + 0 + ] + }, + "class_type": "MiniMaxH3ReferenceToVideo", + "_meta": { + "title": "MiniMax H3 Reference to Video" + } + }, + "180": { + "inputs": { + "lora_name": "minimax-h3\\h3-realism-people-t2v-i2v-r2v(r34l1sm).safetensors", + "strength_model": 1, + "model": [ + "162", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + } +} \ No newline at end of file diff --git a/example_ComfyUI_workflows/video_minimax_h3_r2v_5ref_API.json b/example_ComfyUI_workflows/video_minimax_h3_r2v_5ref_API.json new file mode 100644 index 00000000..82a1d62e --- /dev/null +++ b/example_ComfyUI_workflows/video_minimax_h3_r2v_5ref_API.json @@ -0,0 +1,390 @@ +{ + "115": { + "inputs": { + "aspect_ratio": "16:9 (Widescreen)", + "megapixels": 0.8, + "multiple": 32 + }, + "class_type": "ResolutionSelector", + "_meta": { + "title": "Resolution Selector (Size)" + } + }, + "131": { + "inputs": { + "expression": "max(5, round(a * 24)) + (5 - (max(5, round(a * 24)) % 17)) % 17", + "values.a": [ + "132", + 0 + ] + }, + "class_type": "ComfyMathExpression", + "_meta": { + "title": "Math Expression" + } + }, + "132": { + "inputs": { + "value": 5 + }, + "class_type": "PrimitiveFloat", + "_meta": { + "title": "(input:duration) Duration" + } + }, + "138": { + "inputs": { + "value": "" + }, + "class_type": "PrimitiveStringMultiline", + "_meta": { + "title": "(input:prompt) Text Prompt" + } + }, + "148": { + "inputs": { + "image": "CharSheet_00002_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 1" + } + }, + "149": { + "inputs": { + "image": "CharSheet_00005_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 2" + } + }, + "155": { + "inputs": { + "image": "CharSheet_00008_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 3" + } + }, + "156": { + "inputs": { + "image": "CharSheet_00003_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 4" + } + }, + "160": { + "inputs": { + "string_a": "r34l1sm , create realism style cinematic video. ", + "string_b": [ + "138", + 0 + ], + "delimiter": " " + }, + "class_type": "StringConcatenate", + "_meta": { + "title": "Concatenate Text" + } + }, + "161": { + "inputs": { + "unet_name": "minimax-h3\\minimax_h3_ref2va_int8_convrot.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "162": { + "inputs": { + "lora_name": "minimax-h3\\minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors", + "strength_model": 1, + "model": [ + "161", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + }, + "163": { + "inputs": { + "clip_name": "minimax-h3\\qwen3vl_32b_minimax_h3_int8_convrot.comfy.safetensors", + "type": "minimax", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "164": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_video_vae_fp16.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "165": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_audio_vae_fp32.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "166": { + "inputs": { + "shift_video": 12, + "shift_audio": 3, + "model": [ + "167", + 0 + ] + }, + "class_type": "MiniMaxH3SigmaShift", + "_meta": { + "title": "ModelSamplingMiniMaxH3" + } + }, + "167": { + "inputs": { + "sage_attention": "auto", + "allow_compile": false, + "model": [ + "180", + 0 + ] + }, + "class_type": "PathchSageAttentionKJ", + "_meta": { + "title": "Patch Sage Attention KJ" + } + }, + "169": { + "inputs": { + "sampler_name": "euler" + }, + "class_type": "KSamplerSelect", + "_meta": { + "title": "KSamplerSelect" + } + }, + "170": { + "inputs": { + "scheduler": "beta", + "steps": 8, + "denoise": 1, + "model": [ + "166", + 0 + ] + }, + "class_type": "BasicScheduler", + "_meta": { + "title": "BasicScheduler" + } + }, + "171": { + "inputs": { + "noise_seed": 1043441231554445 + }, + "class_type": "RandomNoise", + "_meta": { + "title": "RandomNoise" + } + }, + "172": { + "inputs": { + "model": [ + "166", + 0 + ], + "conditioning": [ + "178", + 0 + ] + }, + "class_type": "BasicGuider", + "_meta": { + "title": "Basic Guider" + } + }, + "173": { + "inputs": { + "noise": [ + "171", + 0 + ], + "guider": [ + "172", + 0 + ], + "sampler": [ + "169", + 0 + ], + "sigmas": [ + "170", + 0 + ], + "latent_image": [ + "178", + 1 + ] + }, + "class_type": "SamplerCustomAdvanced", + "_meta": { + "title": "SamplerCustomAdvanced" + } + }, + "174": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "164", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "175": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "165", + 0 + ] + }, + "class_type": "VAEDecodeAudio", + "_meta": { + "title": "VAE Decode Audio" + } + }, + "176": { + "inputs": { + "frame_rate": 24, + "loop_count": 0, + "filename_prefix": "Calliope/vid", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": false, + "pingpong": false, + "save_output": false, + "images": [ + "174", + 0 + ], + "audio": [ + "175", + 0 + ] + }, + "class_type": "VHS_VideoCombine", + "_meta": { + "title": "(output:video) Video" + } + }, + "178": { + "inputs": { + "prompt": [ + "160", + 0 + ], + "width": [ + "115", + 0 + ], + "height": [ + "115", + 1 + ], + "length": [ + "131", + 1 + ], + "ref_image_size": "match", + "clip": [ + "163", + 0 + ], + "vae": [ + "164", + 0 + ], + "audio_vae": [ + "165", + 0 + ], + "ref_images.ref_image_0": [ + "148", + 0 + ], + "ref_images.ref_image_1": [ + "149", + 0 + ], + "ref_images.ref_image_2": [ + "155", + 0 + ], + "ref_images.ref_image_3": [ + "156", + 0 + ], + "ref_images.ref_image_4": [ + "179", + 0 + ] + }, + "class_type": "MiniMaxH3ReferenceToVideo", + "_meta": { + "title": "MiniMax H3 Reference to Video" + } + }, + "179": { + "inputs": { + "image": "1_0.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 5" + } + }, + "180": { + "inputs": { + "lora_name": "minimax-h3\\h3-realism-people-t2v-i2v-r2v(r34l1sm).safetensors", + "strength_model": 1, + "model": [ + "162", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + } +} \ No newline at end of file diff --git a/example_ComfyUI_workflows/video_minimax_h3_r2v_API.json b/example_ComfyUI_workflows/video_minimax_h3_r2v_API.json new file mode 100644 index 00000000..ed70823b --- /dev/null +++ b/example_ComfyUI_workflows/video_minimax_h3_r2v_API.json @@ -0,0 +1,338 @@ +{ + "115": { + "inputs": { + "aspect_ratio": "16:9 (Widescreen)", + "megapixels": 0.8, + "multiple": 32 + }, + "class_type": "ResolutionSelector", + "_meta": { + "title": "Resolution Selector (Size)" + } + }, + "131": { + "inputs": { + "expression": "max(5, round(a * 24)) + (5 - (max(5, round(a * 24)) % 17)) % 17", + "values.a": [ + "132", + 0 + ] + }, + "class_type": "ComfyMathExpression", + "_meta": { + "title": "Math Expression" + } + }, + "132": { + "inputs": { + "value": 5 + }, + "class_type": "PrimitiveFloat", + "_meta": { + "title": "(input:duration) Duration" + } + }, + "138": { + "inputs": { + "value": "" + }, + "class_type": "PrimitiveStringMultiline", + "_meta": { + "title": "(input:prompt) Text Prompt" + } + }, + "148": { + "inputs": { + "image": "CharSheet_00002_.png" + }, + "class_type": "LoadImage", + "_meta": { + "title": "(input:image) Ref 1" + } + }, + "160": { + "inputs": { + "string_a": "r34l1sm , create realism style cinematic video. ", + "string_b": [ + "138", + 0 + ], + "delimiter": " " + }, + "class_type": "StringConcatenate", + "_meta": { + "title": "Concatenate Text" + } + }, + "161": { + "inputs": { + "unet_name": "minimax-h3\\minimax_h3_ref2va_int8_convrot.safetensors", + "weight_dtype": "default" + }, + "class_type": "UNETLoader", + "_meta": { + "title": "Load Diffusion Model" + } + }, + "162": { + "inputs": { + "lora_name": "minimax-h3\\minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors", + "strength_model": 1, + "model": [ + "161", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + }, + "163": { + "inputs": { + "clip_name": "minimax-h3\\qwen3vl_32b_minimax_h3_int8_convrot.comfy.safetensors", + "type": "minimax", + "device": "default" + }, + "class_type": "CLIPLoader", + "_meta": { + "title": "Load CLIP" + } + }, + "164": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_video_vae_fp16.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "165": { + "inputs": { + "vae_name": "minimax-h3\\minimax_h3_audio_vae_fp32.safetensors" + }, + "class_type": "VAELoader", + "_meta": { + "title": "Load VAE" + } + }, + "166": { + "inputs": { + "shift_video": 12, + "shift_audio": 3, + "model": [ + "167", + 0 + ] + }, + "class_type": "MiniMaxH3SigmaShift", + "_meta": { + "title": "ModelSamplingMiniMaxH3" + } + }, + "167": { + "inputs": { + "sage_attention": "auto", + "allow_compile": false, + "model": [ + "180", + 0 + ] + }, + "class_type": "PathchSageAttentionKJ", + "_meta": { + "title": "Patch Sage Attention KJ" + } + }, + "169": { + "inputs": { + "sampler_name": "euler" + }, + "class_type": "KSamplerSelect", + "_meta": { + "title": "KSamplerSelect" + } + }, + "170": { + "inputs": { + "scheduler": "beta", + "steps": 8, + "denoise": 1, + "model": [ + "166", + 0 + ] + }, + "class_type": "BasicScheduler", + "_meta": { + "title": "BasicScheduler" + } + }, + "171": { + "inputs": { + "noise_seed": 1043441231554445 + }, + "class_type": "RandomNoise", + "_meta": { + "title": "RandomNoise" + } + }, + "172": { + "inputs": { + "model": [ + "166", + 0 + ], + "conditioning": [ + "178", + 0 + ] + }, + "class_type": "BasicGuider", + "_meta": { + "title": "Basic Guider" + } + }, + "173": { + "inputs": { + "noise": [ + "171", + 0 + ], + "guider": [ + "172", + 0 + ], + "sampler": [ + "169", + 0 + ], + "sigmas": [ + "170", + 0 + ], + "latent_image": [ + "178", + 1 + ] + }, + "class_type": "SamplerCustomAdvanced", + "_meta": { + "title": "SamplerCustomAdvanced" + } + }, + "174": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "164", + 0 + ] + }, + "class_type": "VAEDecode", + "_meta": { + "title": "VAE Decode" + } + }, + "175": { + "inputs": { + "samples": [ + "173", + 0 + ], + "vae": [ + "165", + 0 + ] + }, + "class_type": "VAEDecodeAudio", + "_meta": { + "title": "VAE Decode Audio" + } + }, + "176": { + "inputs": { + "frame_rate": 24, + "loop_count": 0, + "filename_prefix": "Calliope/vid", + "format": "video/h264-mp4", + "pix_fmt": "yuv420p", + "crf": 19, + "save_metadata": true, + "trim_to_audio": false, + "pingpong": false, + "save_output": false, + "images": [ + "174", + 0 + ], + "audio": [ + "175", + 0 + ] + }, + "class_type": "VHS_VideoCombine", + "_meta": { + "title": "(output:video) Video" + } + }, + "178": { + "inputs": { + "prompt": [ + "160", + 0 + ], + "width": [ + "115", + 0 + ], + "height": [ + "115", + 1 + ], + "length": [ + "131", + 1 + ], + "ref_image_size": "match", + "clip": [ + "163", + 0 + ], + "vae": [ + "164", + 0 + ], + "audio_vae": [ + "165", + 0 + ], + "ref_images.ref_image_0": [ + "148", + 0 + ] + }, + "class_type": "MiniMaxH3ReferenceToVideo", + "_meta": { + "title": "MiniMax H3 Reference to Video" + } + }, + "180": { + "inputs": { + "lora_name": "minimax-h3\\h3-realism-people-t2v-i2v-r2v(r34l1sm).safetensors", + "strength_model": 1, + "model": [ + "162", + 0 + ] + }, + "class_type": "LoraLoaderModelOnly", + "_meta": { + "title": "Load LoRA" + } + } +} \ No newline at end of file