From 7fb81500a73a105f1856ceeaf9986ae833beecaf Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Thu, 10 Sep 2026 21:55:17 -0400 Subject: [PATCH] rename CLAUDE.md to AGENTS.md (#1940) Co-authored-by: Hanashi --- AGENTS.md | 97 ++++ CLAUDE.md | 97 +--- _database/sql/migrations/AGENTS.md | 38 ++ _database/sql/migrations/CLAUDE.md | 39 +- _database/sql/migrations_squashed/AGENTS.md | 26 + _database/sql/migrations_squashed/CLAUDE.md | 27 +- crates/AGENTS.md | 59 ++ crates/CLAUDE.md | 60 +- .../artcraft/artcraft_api_defs/AGENTS.md | 22 + .../artcraft/artcraft_api_defs/CLAUDE.md | 23 +- .../src/generate/generate_video/AGENTS.md | 127 +++++ .../src/generate/generate_video/CLAUDE.md | 128 +---- crates/api_clients/beeble_client/AGENTS.md | 24 + crates/api_clients/beeble_client/CLAUDE.md | 25 +- crates/cli/production/support-tool/AGENTS.md | 58 ++ crates/cli/production/support-tool/CLAUDE.md | 59 +- crates/lib/pager/AGENTS.md | 40 ++ crates/lib/pager/CLAUDE.md | 41 +- .../schema/database/mysql_queries/AGENTS.md | 79 +++ .../schema/database/mysql_queries/CLAUDE.md | 80 +-- crates/schema/public/enums/AGENTS.md | 26 + crates/schema/public/enums/CLAUDE.md | 27 +- crates/schema/public/tokens/AGENTS.md | 22 + crates/schema/public/tokens/CLAUDE.md | 23 +- crates/service/job/AGENTS.md | 42 ++ crates/service/job/CLAUDE.md | 43 +- crates/service/web/storyteller_web/AGENTS.md | 116 ++++ crates/service/web/storyteller_web/CLAUDE.md | 117 +--- frontend/libs/components/pagescene/AGENTS.md | 513 +++++++++++++++++ frontend/libs/components/pagescene/CLAUDE.md | 514 +----------------- frontend/package-lock.json | 232 +++----- 31 files changed, 1391 insertions(+), 1433 deletions(-) create mode 100644 AGENTS.md mode change 100644 => 120000 CLAUDE.md create mode 100644 _database/sql/migrations/AGENTS.md mode change 100644 => 120000 _database/sql/migrations/CLAUDE.md create mode 100644 _database/sql/migrations_squashed/AGENTS.md mode change 100644 => 120000 _database/sql/migrations_squashed/CLAUDE.md create mode 100644 crates/AGENTS.md mode change 100644 => 120000 crates/CLAUDE.md create mode 100644 crates/api_clients/artcraft/artcraft_api_defs/AGENTS.md mode change 100644 => 120000 crates/api_clients/artcraft/artcraft_api_defs/CLAUDE.md create mode 100644 crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/AGENTS.md mode change 100644 => 120000 crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/CLAUDE.md create mode 100644 crates/api_clients/beeble_client/AGENTS.md mode change 100644 => 120000 crates/api_clients/beeble_client/CLAUDE.md create mode 100644 crates/cli/production/support-tool/AGENTS.md mode change 100644 => 120000 crates/cli/production/support-tool/CLAUDE.md create mode 100644 crates/lib/pager/AGENTS.md mode change 100644 => 120000 crates/lib/pager/CLAUDE.md create mode 100644 crates/schema/database/mysql_queries/AGENTS.md mode change 100644 => 120000 crates/schema/database/mysql_queries/CLAUDE.md create mode 100644 crates/schema/public/enums/AGENTS.md mode change 100644 => 120000 crates/schema/public/enums/CLAUDE.md create mode 100644 crates/schema/public/tokens/AGENTS.md mode change 100644 => 120000 crates/schema/public/tokens/CLAUDE.md create mode 100644 crates/service/job/AGENTS.md mode change 100644 => 120000 crates/service/job/CLAUDE.md create mode 100644 crates/service/web/storyteller_web/AGENTS.md mode change 100644 => 120000 crates/service/web/storyteller_web/CLAUDE.md create mode 100644 frontend/libs/components/pagescene/AGENTS.md mode change 100644 => 120000 frontend/libs/components/pagescene/CLAUDE.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000000..36c8acae45 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,97 @@ +# AGENTS.md + +This file provides guidance for coding agents when working with the Artcraft monorepo. + +## Project Overview + +Artcraft is a web and desktop application for generating AI image and video. It is written in +Rust and TypeScript and contains desktop, server, and frontend components. + +## Project Structure + +``` +artcraft/ +├── _database/ # Schema definitions and migrations (MySQL, SQLite, Elasticsearch, etc.) +│ ├── elasticsearch/ # Elasticsearch schema and queries +│ └── sql/ # MySQL and SQLite schema definitions and migrations +│ ├── artcraft_migrations/ # ArtCraft desktop app SQLite migrations +│ ├── migrations/ # Server MySQL migrations +│ └── migrations_squashed/ # Fully materialized MySQL schema definitions for most tables +├── _tools/ # Various 3rd party tool integrations and configurations +│ └── postman/ # Postman configs for test HTTP requests against development and production +├── build/ # Dockerfile build instructions for server components +├── crates/ # Rust workspace +│ ├── api_clients/ # HTTP clients for calling internal and 3rd party services +│ ├── cli/ # Command line tools +│ ├── desktop/ # Desktop (Tauri) apps +│ │ └── artcraft/ # (Important) ArtCraft, the desktop app. This is one of our main pieces of software +│ ├── lib/ # Various utility libraries for servers, CLI tools, desktop, etc. +│ ├── schema/ # Data definition layer: MySQL, SQlite, Redis, S3/R2 buckets, etc. +│ │ ├── buckets/ # Declares R2 cloud bucket topology +│ │ ├── database/ # MySQL, SQLite, Elasticsearch, Redis, etc. +│ │ │ ├── elasticsearch_schema/ # Elasticsearch +│ │ │ ├── migration/ # (deprecated) Online schema adapters for MySQL +│ │ │ ├── mysql_queries/ # Sqlx MySQL queries for our backend monolith `storyteller-web`, jobs, etc. +│ │ │ ├── redis_common/ # Redis support +│ │ │ ├── redis_schema/ # Redis key and HKEY topology +│ │ │ ├── sqlite_queries/ # (deprecated) Sqlite queries +│ │ │ └── sqlite_tasks/ # Queries for the ArtCraft desktop app's "tasks" database. +│ │ ├── public/ # Token identifier and enum variant definitions +│ │ │ ├── composite_identifier/ # MySQL composite key system +│ │ │ ├── enums/ # MySQL "enums" stored in VARCHAR fields. +│ │ │ └── tokens/ # Primary database identifiers with Stripe-like ID prefixes, eg. "user_{entropy}" +│ │ └── service/ # Backend HTTP services and jobs +│ │ ├── job/ # Backend jobs. +│ │ │ └── video_thumbnail_job/ # Render video thumbnails +│ │ ├── plugins/ # Collections of reusable Actix-Web HTTP functions (user and billing systems) +│ │ └── web/ # HTTP web servers +│ │ └── storyteller_web/ # (Important) Our main HTTP API monolith and backend. +│ └── frontend/ # Nx typescript monorepo for our websites and Tauri desktop apps +│ ├── apps/ # Websites and Tauri desktop apps +│ │ ├── artcraft/ # ArtCraft the Tauri app's frontend. Used in conjunction with `artcraft` the Rust crate. +│ │ └── artcraft-website/ # The website for https://getartcraft.com +│ └── libs/ # Support libraries, reusable React components, etc. +└── Cargo.toml # Rust monorepo workspace +``` + +## Code Style + +- Rust with no minimum supported version +- Actix-web for HTTP services +- SQLx for MySQL and SQLite; prefer `sqlx::query!` / `sqlx::query_as!` compile-time checked macros over runtime `sqlx::query()` whenever possible +- MySQL queries belong in the `mysql_queries` crate, not in application/service crates like `storyteller-web` — call those query functions instead of embedding `sqlx::query!` / `sqlx::query()` in handlers. (Query-writing conventions live in `crates/schema/database/mysql_queries/AGENTS.md`.) +- A mix of wreq and reqwest for Rust HTTP clients +- Never use `println!` or `eprintln!` outside of tests; use `log` crate macros instead +- When two crates export the same type name, alias imports with a suffix: `use foo::Bar as BarFoo;` +- Prefer `use` imports over inline fully-qualified paths; only qualify inline for true one-offs or std collisions +- TypeScript with Nx, React, Vite, Zustand, and Three.js +- Use two spaces for indentation + +### File Layout + +Organize for top-to-bottom reading. Important things first, details later. + +- **Constants** at the top (after imports) +- **Structs/enums** next; outer structs above inner sub-structs +- **API types** in order: Request, Response, Error +- **In impl blocks**: constructors first, then public methods, then private helpers +- Private helpers go *below* the methods that call them +- Among helpers: meatier logic above leaf-level formatters +- **In test modules**: constants first, then test cases (grouped into sub-modules when 2+), then helper functions last + +## Markdown + +- **Tables must be space-padded so columns align in plain text.** Markdown + tables are read raw (terminals, diffs, editors) at least as often as + rendered, and condensed tables are unreadable there. Pad every cell to its + column width: + + ```markdown + | Model | Configuration | Credits | Speed | Score | + |--------------|---------------|--------------------|---------| + | Meshy 6 | text or image | 104 | 80.0 | +24 | + | Rodin 2.5 | text or image | 13 | 10.0 | +3 | + ``` + + Not: `| Model | Configuration | Credits | Speed | Score |` packed tight + with varying widths per row. diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index 4621dddf28..0000000000 --- a/CLAUDE.md +++ /dev/null @@ -1,96 +0,0 @@ -# CLAUDE.md - -This file provides guidance for Claude Code when working with the Artcraft monorepo. - -## Project Overview - -Artcraft is a web and desktop application for generating AI image and video. It is written in -Rust and TypeScript and contains desktop, server, and frontend components. - -## Project Structure - -``` -artcraft/ -├── _database/ # Schema definitions and migrations (MySQL, SQLite, Elasticsearch, etc.) -│ ├── elasticsearch/ # Elasticsearch schema and queries -│ └── sql/ # MySQL and SQLite schema definitions and migrations -│ ├── artcraft_migrations/ # ArtCraft desktop app SQLite migrations -│ ├── migrations/ # Server MySQL migrations -│ └── migrations_squashed/ # Fully materialized MySQL schema definitions for most tables -├── _tools/ # Various 3rd party tool integrations and configurations -│ └── postman/ # Postman configs for test HTTP requests against development and production -├── build/ # Dockerfile build instructions for server components -├── crates/ # Rust workspace -│ ├── api_clients/ # HTTP clients for calling internal and 3rd party services -│ ├── cli/ # Command line tools -│ ├── desktop/ # Desktop (Tauri) apps -│ │ └── artcraft/ # (Important) ArtCraft, the desktop app. This is one of our main pieces of software -│ ├── lib/ # Various utility libraries for servers, CLI tools, desktop, etc. -│ ├── schema/ # Data definition layer: MySQL, SQlite, Redis, S3/R2 buckets, etc. -│ │ ├── buckets/ # Declares R2 cloud bucket topology -│ │ ├── database/ # MySQL, SQLite, Elasticsearch, Redis, etc. -│ │ │ ├── elasticsearch_schema/ # Elasticsearch -│ │ │ ├── migration/ # (deprecated) Online schema adapters for MySQL -│ │ │ ├── mysql_queries/ # Sqlx MySQL queries for our backend monolith `storyteller-web`, jobs, etc. -│ │ │ ├── redis_common/ # Redis support -│ │ │ ├── redis_schema/ # Redis key and HKEY topology -│ │ │ ├── sqlite_queries/ # (deprecated) Sqlite queries -│ │ │ └── sqlite_tasks/ # Queries for the ArtCraft desktop app's "tasks" database. -│ │ ├── public/ # Token identifier and enum variant definitions -│ │ │ ├── composite_identifier/ # MySQL composite key system -│ │ │ ├── enums/ # MySQL "enums" stored in VARCHAR fields. -│ │ │ └── tokens/ # Primary database identifiers with Stripe-like ID prefixes, eg. "user_{entropy}" -│ │ └── service/ # Backend HTTP services and jobs -│ │ ├── job/ # Backend jobs. -│ │ │ └── video_thumbnail_job/ # Render video thumbnails -│ │ ├── plugins/ # Collections of reusable Actix-Web HTTP functions (user and billing systems) -│ │ └── web/ # HTTP web servers -│ │ └── storyteller_web/ # (Important) Our main HTTP API monolith and backend. -│ └── frontend/ # Nx typescript monorepo for our websites and Tauri desktop apps -│ ├── apps/ # Websites and Tauri desktop apps -│ │ ├── artcraft/ # ArtCraft the Tauri app's frontend. Used in conjunction with `artcraft` the Rust crate. -│ │ └── artcraft-website/ # The website for https://getartcraft.com -│ └── libs/ # Support libraries, reusable React components, etc. -└── Cargo.toml # Rust monorepo workspace -``` - -## Code Style - -- Rust with no minimum supported version -- Actix-web for HTTP services -- SQLx for MySQL and SQLite. MySQL queries belong in the `mysql_queries` crate, not in application/service crates like `storyteller-web` — call those query functions instead of embedding `sqlx::query!` / `sqlx::query()` in handlers. (Query-writing conventions live in `crates/schema/database/mysql_queries/CLAUDE.md`.) -- A mix of wreq and reqwest for Rust HTTP clients -- Never use `println!` or `eprintln!` outside of tests; use `log` crate macros instead -- When two crates export the same type name, alias imports with a suffix: `use foo::Bar as BarFoo;` -- Prefer `use` imports over inline fully-qualified paths; only qualify inline for true one-offs or std collisions -- TypeScript with Nx, React, Vite, Zustand, and Three.js -- Use two spaces for indentation - -### File Layout - -Organize for top-to-bottom reading. Important things first, details later. - -- **Constants** at the top (after imports) -- **Structs/enums** next; outer structs above inner sub-structs -- **API types** in order: Request, Response, Error -- **In impl blocks**: constructors first, then public methods, then private helpers -- Private helpers go *below* the methods that call them -- Among helpers: meatier logic above leaf-level formatters -- **In test modules**: constants first, then test cases (grouped into sub-modules when 2+), then helper functions last - -## Markdown - -- **Tables must be space-padded so columns align in plain text.** Markdown - tables are read raw (terminals, diffs, editors) at least as often as - rendered, and condensed tables are unreadable there. Pad every cell to its - column width: - - ```markdown - | Model | Configuration | Credits | Speed | Score | - |--------------|---------------|--------------------|---------| - | Meshy 6 | text or image | 104 | 80.0 | +24 | - | Rodin 2.5 | text or image | 13 | 10.0 | +3 | - ``` - - Not: `| Model | Configuration | Credits | Speed | Score |` packed tight - with varying widths per row. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/_database/sql/migrations/AGENTS.md b/_database/sql/migrations/AGENTS.md new file mode 100644 index 0000000000..d5423532c5 --- /dev/null +++ b/_database/sql/migrations/AGENTS.md @@ -0,0 +1,38 @@ +# SQL Migrations + +Incremental schema changes applied in order by timestamp prefix. + +## Naming Convention + +Migration directories follow the format: + +``` +YYYY-MM-DD-HHMMSS-NNNN_description_goes_here/ + up.sql + down.sql +``` + +These are created with the `diesel` tool, and in particular: + +> `diesel migration generate description_goes_here` + +- `NNNN` is a zero-padded sequence number for ordering multiple migrations on the same timestamp. +- `up.sql` applies the migration forward. +- `down.sql` reverses it. + +## Table Conventions + +- Primary key `id` columns must be `BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT`. Do not use signed IDs. +- Always create tables with `ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin`. +- All SQL files should start with the standard IntelliJ noinspection comments: + ```sql + -- noinspection SqlDialectInspectionForFile + -- noinspection SqlNoDataSourceInspectionForFile + -- noinspection SqlResolveForFile + ``` + +## Rules + +- Every `up.sql` must have a corresponding `down.sql` that cleanly reverses the migration. +- For `CREATE TABLE` migrations, the `down.sql` is typically `DROP TABLE IF EXISTS table_name;`. +- For `ALTER TABLE` migrations, the `down.sql` reverses the alteration (e.g. `DROP COLUMN`). diff --git a/_database/sql/migrations/CLAUDE.md b/_database/sql/migrations/CLAUDE.md deleted file mode 100644 index d5423532c5..0000000000 --- a/_database/sql/migrations/CLAUDE.md +++ /dev/null @@ -1,38 +0,0 @@ -# SQL Migrations - -Incremental schema changes applied in order by timestamp prefix. - -## Naming Convention - -Migration directories follow the format: - -``` -YYYY-MM-DD-HHMMSS-NNNN_description_goes_here/ - up.sql - down.sql -``` - -These are created with the `diesel` tool, and in particular: - -> `diesel migration generate description_goes_here` - -- `NNNN` is a zero-padded sequence number for ordering multiple migrations on the same timestamp. -- `up.sql` applies the migration forward. -- `down.sql` reverses it. - -## Table Conventions - -- Primary key `id` columns must be `BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT`. Do not use signed IDs. -- Always create tables with `ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin`. -- All SQL files should start with the standard IntelliJ noinspection comments: - ```sql - -- noinspection SqlDialectInspectionForFile - -- noinspection SqlNoDataSourceInspectionForFile - -- noinspection SqlResolveForFile - ``` - -## Rules - -- Every `up.sql` must have a corresponding `down.sql` that cleanly reverses the migration. -- For `CREATE TABLE` migrations, the `down.sql` is typically `DROP TABLE IF EXISTS table_name;`. -- For `ALTER TABLE` migrations, the `down.sql` reverses the alteration (e.g. `DROP COLUMN`). diff --git a/_database/sql/migrations/CLAUDE.md b/_database/sql/migrations/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/_database/sql/migrations/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/_database/sql/migrations_squashed/AGENTS.md b/_database/sql/migrations_squashed/AGENTS.md new file mode 100644 index 0000000000..95248459cd --- /dev/null +++ b/_database/sql/migrations_squashed/AGENTS.md @@ -0,0 +1,26 @@ +# Squashed / Materialized Schemas + +Fully materialized table definitions representing the current state of each table +after all migrations have been applied. These are not executed — they exist as +human-readable documentation of the current schema. + +## When to Update + +Update the corresponding squashed file whenever a migration changes a table's schema +(adding columns, changing types, dropping and recreating, etc.). + +## Table Conventions + +- Primary key `id` columns must be `BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT`. Do not use signed IDs. +- Always create tables with `ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin`. +- All SQL files should start with the standard IntelliJ noinspection comments: + ```sql + -- noinspection SqlDialectInspectionForFile + -- noinspection SqlNoDataSourceInspectionForFile + -- noinspection SqlResolveForFile + ``` + +## File Organization + +Files are named after their table (e.g. `users.sql`, `media_files.sql`). +Some tables are grouped into subdirectories (e.g. `user_tables/`). diff --git a/_database/sql/migrations_squashed/CLAUDE.md b/_database/sql/migrations_squashed/CLAUDE.md deleted file mode 100644 index 95248459cd..0000000000 --- a/_database/sql/migrations_squashed/CLAUDE.md +++ /dev/null @@ -1,26 +0,0 @@ -# Squashed / Materialized Schemas - -Fully materialized table definitions representing the current state of each table -after all migrations have been applied. These are not executed — they exist as -human-readable documentation of the current schema. - -## When to Update - -Update the corresponding squashed file whenever a migration changes a table's schema -(adding columns, changing types, dropping and recreating, etc.). - -## Table Conventions - -- Primary key `id` columns must be `BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT`. Do not use signed IDs. -- Always create tables with `ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin`. -- All SQL files should start with the standard IntelliJ noinspection comments: - ```sql - -- noinspection SqlDialectInspectionForFile - -- noinspection SqlNoDataSourceInspectionForFile - -- noinspection SqlResolveForFile - ``` - -## File Organization - -Files are named after their table (e.g. `users.sql`, `media_files.sql`). -Some tables are grouped into subdirectories (e.g. `user_tables/`). diff --git a/_database/sql/migrations_squashed/CLAUDE.md b/_database/sql/migrations_squashed/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/_database/sql/migrations_squashed/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/AGENTS.md b/crates/AGENTS.md new file mode 100644 index 0000000000..302b7d238a --- /dev/null +++ b/crates/AGENTS.md @@ -0,0 +1,59 @@ +# Rust Workspace + +All Rust code lives under `crates/`. The workspace is defined in `Cargo.toml` at the repo root. + +## Code Style + +- Two spaces for indentation (not four) +- No minimum supported Rust version; use latest stable features freely +- Never use `println!` or `eprintln!` outside of tests; use `log` crate macros instead +- Use `anyhow::Result` / `AnyhowResult` for fallible functions in application code +- Fields that are optional use the `maybe_` prefix: `maybe_creator_user_token` +- When two crates export the same type name, alias with a suffix: `use foo::Bar as BarFoo;` +- Prefer `use` imports over inline fully-qualified paths; only qualify inline for true one-offs or std prelude collisions (`Result`, `Option`, `Error`) + +## File Layout + +Organize for top-to-bottom reading. Important things first, details later. + +1. **Constants** at the top (after imports) +2. **Primary public type** (the main struct/enum the file defines) +3. **Supporting types** below the primary type +4. **API types** in order: Request, Response, Error +5. **`impl` blocks** after their type definitions + - Constructors first, then public methods, then private helpers + - Callers above callees — follow the call chain downward + +## Test Layout + +Within `#[cfg(test)] mod tests { ... }`: + +1. **Imports** +2. **Constants** (test IDs, URLs, fixture data) — small context that tests reference +3. **Test functions or sub-modules** grouped by category +4. **Helper functions** (builders, pipeline runners, assertions) + +Constants provide small context up front. Test cases come next so engineers see *what* is +tested before *how* the helpers work. + +Group related tests into sub-modules (`mod pricing_tests { ... }`) when a category has 2+ +tests. Don't wrap a single test in its own module. Keep nesting to two levels max. Shared +helpers go in the parent `mod tests` so sub-modules can `use super::*`. + +## Building + +- Most crates: `cargo check -p {crate_name}` or `cargo test -p {crate_name}` +- Crates using SQLx: `SQLX_OFFLINE=true cargo check -p {crate_name}` +- `storyteller-web` and `mysql_queries` require `SQLX_OFFLINE=true` +- `storyteller-web` has ~370 pre-existing warnings — check the last few lines for actual errors + +## Key Crates + +- `storyteller_web` — main HTTP API monolith (actix-web) +- `artcraft` (desktop) — Tauri desktop app +- `artcraft_router` — provider routing for image/video generation (Artcraft, Fal, KinoviWeb, Muapi) +- `artcraft_api_defs` — shared HTTP API type definitions +- `kinovi_web_client` — HTTP client for the Kinovi/KinoviWeb video generation service +- `enums` — database-backed enums stored as VARCHAR fields +- `tokens` — primary key identifiers with Stripe-like prefixes (e.g. `user_`, `mf_`) +- `mysql_queries` — SQLx MySQL queries for the backend diff --git a/crates/CLAUDE.md b/crates/CLAUDE.md deleted file mode 100644 index 302b7d238a..0000000000 --- a/crates/CLAUDE.md +++ /dev/null @@ -1,59 +0,0 @@ -# Rust Workspace - -All Rust code lives under `crates/`. The workspace is defined in `Cargo.toml` at the repo root. - -## Code Style - -- Two spaces for indentation (not four) -- No minimum supported Rust version; use latest stable features freely -- Never use `println!` or `eprintln!` outside of tests; use `log` crate macros instead -- Use `anyhow::Result` / `AnyhowResult` for fallible functions in application code -- Fields that are optional use the `maybe_` prefix: `maybe_creator_user_token` -- When two crates export the same type name, alias with a suffix: `use foo::Bar as BarFoo;` -- Prefer `use` imports over inline fully-qualified paths; only qualify inline for true one-offs or std prelude collisions (`Result`, `Option`, `Error`) - -## File Layout - -Organize for top-to-bottom reading. Important things first, details later. - -1. **Constants** at the top (after imports) -2. **Primary public type** (the main struct/enum the file defines) -3. **Supporting types** below the primary type -4. **API types** in order: Request, Response, Error -5. **`impl` blocks** after their type definitions - - Constructors first, then public methods, then private helpers - - Callers above callees — follow the call chain downward - -## Test Layout - -Within `#[cfg(test)] mod tests { ... }`: - -1. **Imports** -2. **Constants** (test IDs, URLs, fixture data) — small context that tests reference -3. **Test functions or sub-modules** grouped by category -4. **Helper functions** (builders, pipeline runners, assertions) - -Constants provide small context up front. Test cases come next so engineers see *what* is -tested before *how* the helpers work. - -Group related tests into sub-modules (`mod pricing_tests { ... }`) when a category has 2+ -tests. Don't wrap a single test in its own module. Keep nesting to two levels max. Shared -helpers go in the parent `mod tests` so sub-modules can `use super::*`. - -## Building - -- Most crates: `cargo check -p {crate_name}` or `cargo test -p {crate_name}` -- Crates using SQLx: `SQLX_OFFLINE=true cargo check -p {crate_name}` -- `storyteller-web` and `mysql_queries` require `SQLX_OFFLINE=true` -- `storyteller-web` has ~370 pre-existing warnings — check the last few lines for actual errors - -## Key Crates - -- `storyteller_web` — main HTTP API monolith (actix-web) -- `artcraft` (desktop) — Tauri desktop app -- `artcraft_router` — provider routing for image/video generation (Artcraft, Fal, KinoviWeb, Muapi) -- `artcraft_api_defs` — shared HTTP API type definitions -- `kinovi_web_client` — HTTP client for the Kinovi/KinoviWeb video generation service -- `enums` — database-backed enums stored as VARCHAR fields -- `tokens` — primary key identifiers with Stripe-like prefixes (e.g. `user_`, `mf_`) -- `mysql_queries` — SQLx MySQL queries for the backend diff --git a/crates/CLAUDE.md b/crates/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/api_clients/artcraft/artcraft_api_defs/AGENTS.md b/crates/api_clients/artcraft/artcraft_api_defs/AGENTS.md new file mode 100644 index 0000000000..4b551c0a9a --- /dev/null +++ b/crates/api_clients/artcraft/artcraft_api_defs/AGENTS.md @@ -0,0 +1,22 @@ +# artcraft_api_defs + +Shared HTTP API type definitions used by both the server (`storyteller_web`) and clients. + +## Structure + +Organized by feature: `users/`, `media_file/`, `jobs/`, `moderation/`, etc. + +## Conventions + +- Request types: `#[derive(Deserialize, ToSchema)]` +- Response types: `#[derive(Serialize, ToSchema)]` +- Path params: `#[derive(Deserialize, ToSchema)]` with `PathInfo` suffix +- Query params: `#[derive(Deserialize, IntoParams)]` + +## Orphan Rule + +Types that need `ResponseError` impl (actix-web) CANNOT live here because of Rust's orphan rule. Keep error response types in `storyteller_web` and only put data types here. + +## Dependencies + +Only `serde`, `serde_derive`, `utoipa`, `chrono`, `url`, and internal schema crates (`enums`, `tokens`). No actix-web dependency. diff --git a/crates/api_clients/artcraft/artcraft_api_defs/CLAUDE.md b/crates/api_clients/artcraft/artcraft_api_defs/CLAUDE.md deleted file mode 100644 index 4b551c0a9a..0000000000 --- a/crates/api_clients/artcraft/artcraft_api_defs/CLAUDE.md +++ /dev/null @@ -1,22 +0,0 @@ -# artcraft_api_defs - -Shared HTTP API type definitions used by both the server (`storyteller_web`) and clients. - -## Structure - -Organized by feature: `users/`, `media_file/`, `jobs/`, `moderation/`, etc. - -## Conventions - -- Request types: `#[derive(Deserialize, ToSchema)]` -- Response types: `#[derive(Serialize, ToSchema)]` -- Path params: `#[derive(Deserialize, ToSchema)]` with `PathInfo` suffix -- Query params: `#[derive(Deserialize, IntoParams)]` - -## Orphan Rule - -Types that need `ResponseError` impl (actix-web) CANNOT live here because of Rust's orphan rule. Keep error response types in `storyteller_web` and only put data types here. - -## Dependencies - -Only `serde`, `serde_derive`, `utoipa`, `chrono`, `url`, and internal schema crates (`enums`, `tokens`). No actix-web dependency. diff --git a/crates/api_clients/artcraft/artcraft_api_defs/CLAUDE.md b/crates/api_clients/artcraft/artcraft_api_defs/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/api_clients/artcraft/artcraft_api_defs/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/AGENTS.md b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/AGENTS.md new file mode 100644 index 0000000000..1c6f012adf --- /dev/null +++ b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/AGENTS.md @@ -0,0 +1,127 @@ +# generate_video + +This module implements the v2 video generation pipeline. It replaces the v1 system +(in `generate_video/`) with a two-phase approach that separates request planning from +execution, allowing cost estimation and media uploads to happen at the right time. + +## Lifecycle + +``` +GenerateVideoRequestBuilder + │ + ▼ build2() +VideoGenerationDraftOrRequest + │ + ├─ Draft(VideoGenerationDraftRequest) + │ │ + │ ▼ estimate_cost() ← cost estimate from draft state + │ │ + │ ▼ finalize(context) ← uploads media, resolves tokens + │ │ + │ ▼ + │ VideoGenerationRequest + │ │ + │ ▼ estimate_cost() ← cost estimate from finalized request + │ │ + │ ▼ send_request() ← fires the API call + │ │ + │ ▼ + │ GenerateVideoResponse + │ + └─ Request(VideoGenerationRequest) ← skips draft phase (used by Artcraft provider) +``` + +### Key types + +- **`GenerateVideoRequestBuilder`** — generic builder with provider/model/prompt/resolution/etc. + Located in `generate_video/generate_video_request_builder.rs`. The `use_new_builder()` method + gates which provider+model combos use the v2 path. `build2()` dispatches to the correct + provider's build function. + +- **`VideoGenerationDraftOrRequest`** — the output of `build2()`. Either `Draft` (for providers + that need media upload/resolution, like Kinovi) or `Request` (for providers that work with + media file tokens directly, like Artcraft). + +- **`VideoGenerationDraftRequest`** — enum with one variant per provider+model. Holds + materialized settings (resolution, duration, batch count) plus unresolved media references. + Can estimate cost without network calls. + +- **`VideoGenerationDraftContext`** — context needed during `finalize()`: the provider client, + media file token-to-URL map, and character token-to-ID map. + +- **`VideoGenerationRequest`** — enum with one variant per provider+model. Holds a fully + materialized request ready to send. All media URLs are resolved and uploaded. + +### Cost estimation + +Cost can be estimated at two stages: +1. **From draft** — before `finalize()`. Uses the planned resolution/duration/batch count. + Good for showing the user a price before committing. +2. **From request** — after `finalize()`. Uses the final materialized request. Should match + the draft estimate for the same parameters. + +## Module layout + +``` +generate_video/ +├── mod.rs +├── video_generation_draft.rs ← VideoGenerationDraftRequest enum +├── video_generation_draft_context.rs ← context for finalize() +├── video_generation_draft_or_request.rs +├── video_generation_request.rs ← VideoGenerationRequest enum +└── providers/ + ├── artcraft/ ← Artcraft provider (uses media file tokens directly) + │ ├── seedance_2p0/ ← Seedance 2.0 Pro model (skips draft, returns Request directly) + │ │ ├── mod.rs + │ │ ├── build.rs ← builder → Request conversion + plan helpers + │ │ ├── cost.rs ← standalone cost estimation (independent of kinovi_web_client) + │ │ └── request.rs ← request state + send() via Artcraft multi-function API + │ └── seedance_2p0_fast/ ← Seedance 2.0 Fast model (skips draft, 480p/720p only) + │ ├── mod.rs + │ ├── build.rs ← builder → Request conversion + plan helpers (no 1080p) + │ ├── cost.rs ← standalone cost estimation with Fast-specific pricing + │ └── request.rs ← request state + send() via Artcraft omni-gen API + └── kinovi/ ← Kinovi/KinoviWeb provider + ├── mod.rs + ├── resolve.rs ← shared: media token resolution, upload helpers + ├── upload.rs ← shared: download + re-upload to KinoviWeb CDN + ├── seedance_2p0/ ← Seedance 2.0 Pro model + │ ├── mod.rs + │ ├── build.rs ← builder → draft conversion + plan helpers + │ ├── cost.rs ← cost estimation state + │ ├── draft.rs ← draft state + finalize (to_request) + │ └── request.rs ← request state + send() + └── seedance_2p0_fast/ ← Seedance 2.0 Fast model + ├── mod.rs + ├── build.rs + ├── cost.rs + ├── draft.rs + └── request.rs +``` + +## Adding a new provider or model + +1. **Create the module** under `providers/{provider}/{model}/` with these files: + - `mod.rs` — declares sub-modules + - `build.rs` — `build_{provider}_{model}(builder) -> VideoGenerationDraftOrRequest`. + Contains `plan_*` helpers for aspect ratio, resolution, batch count, duration. + - `draft.rs` — draft state struct with `to_request()` async method for finalization. + **Not needed** if the provider uses media tokens directly (no upload/resolution needed); + in that case `build.rs` returns `VideoGenerationDraftOrRequest::Request(...)` directly. + - `cost.rs` — cost state with `from_request()` and `estimate_cost()`. Add `from_draft()` + if the provider uses the draft phase. + - `request.rs` — request state with `send()` async method. + +2. **Register the module** in the parent provider's `mod.rs`. + +3. **Add enum variants** in: + - `video_generation_draft.rs` — `VideoGenerationDraftRequest` enum + `estimate_cost` + `finalize` + (skip if provider has no draft phase) + - `video_generation_request.rs` — `VideoGenerationRequest` enum + `estimate_cost` + `send_request` + +4. **Wire into the builder** in `generate_video_request_builder.rs`: + - Add the `(Provider, Model)` pair to `use_new_builder()` returning `true` + - Add the dispatch arm in `build2()` + +5. **Tests**: each `build.rs` and `cost.rs` should have comprehensive tests. `request.rs` + should have `#[ignore]` live API tests for manual verification. diff --git a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/CLAUDE.md b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/CLAUDE.md deleted file mode 100644 index 1c6f012adf..0000000000 --- a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/CLAUDE.md +++ /dev/null @@ -1,127 +0,0 @@ -# generate_video - -This module implements the v2 video generation pipeline. It replaces the v1 system -(in `generate_video/`) with a two-phase approach that separates request planning from -execution, allowing cost estimation and media uploads to happen at the right time. - -## Lifecycle - -``` -GenerateVideoRequestBuilder - │ - ▼ build2() -VideoGenerationDraftOrRequest - │ - ├─ Draft(VideoGenerationDraftRequest) - │ │ - │ ▼ estimate_cost() ← cost estimate from draft state - │ │ - │ ▼ finalize(context) ← uploads media, resolves tokens - │ │ - │ ▼ - │ VideoGenerationRequest - │ │ - │ ▼ estimate_cost() ← cost estimate from finalized request - │ │ - │ ▼ send_request() ← fires the API call - │ │ - │ ▼ - │ GenerateVideoResponse - │ - └─ Request(VideoGenerationRequest) ← skips draft phase (used by Artcraft provider) -``` - -### Key types - -- **`GenerateVideoRequestBuilder`** — generic builder with provider/model/prompt/resolution/etc. - Located in `generate_video/generate_video_request_builder.rs`. The `use_new_builder()` method - gates which provider+model combos use the v2 path. `build2()` dispatches to the correct - provider's build function. - -- **`VideoGenerationDraftOrRequest`** — the output of `build2()`. Either `Draft` (for providers - that need media upload/resolution, like Kinovi) or `Request` (for providers that work with - media file tokens directly, like Artcraft). - -- **`VideoGenerationDraftRequest`** — enum with one variant per provider+model. Holds - materialized settings (resolution, duration, batch count) plus unresolved media references. - Can estimate cost without network calls. - -- **`VideoGenerationDraftContext`** — context needed during `finalize()`: the provider client, - media file token-to-URL map, and character token-to-ID map. - -- **`VideoGenerationRequest`** — enum with one variant per provider+model. Holds a fully - materialized request ready to send. All media URLs are resolved and uploaded. - -### Cost estimation - -Cost can be estimated at two stages: -1. **From draft** — before `finalize()`. Uses the planned resolution/duration/batch count. - Good for showing the user a price before committing. -2. **From request** — after `finalize()`. Uses the final materialized request. Should match - the draft estimate for the same parameters. - -## Module layout - -``` -generate_video/ -├── mod.rs -├── video_generation_draft.rs ← VideoGenerationDraftRequest enum -├── video_generation_draft_context.rs ← context for finalize() -├── video_generation_draft_or_request.rs -├── video_generation_request.rs ← VideoGenerationRequest enum -└── providers/ - ├── artcraft/ ← Artcraft provider (uses media file tokens directly) - │ ├── seedance_2p0/ ← Seedance 2.0 Pro model (skips draft, returns Request directly) - │ │ ├── mod.rs - │ │ ├── build.rs ← builder → Request conversion + plan helpers - │ │ ├── cost.rs ← standalone cost estimation (independent of kinovi_web_client) - │ │ └── request.rs ← request state + send() via Artcraft multi-function API - │ └── seedance_2p0_fast/ ← Seedance 2.0 Fast model (skips draft, 480p/720p only) - │ ├── mod.rs - │ ├── build.rs ← builder → Request conversion + plan helpers (no 1080p) - │ ├── cost.rs ← standalone cost estimation with Fast-specific pricing - │ └── request.rs ← request state + send() via Artcraft omni-gen API - └── kinovi/ ← Kinovi/KinoviWeb provider - ├── mod.rs - ├── resolve.rs ← shared: media token resolution, upload helpers - ├── upload.rs ← shared: download + re-upload to KinoviWeb CDN - ├── seedance_2p0/ ← Seedance 2.0 Pro model - │ ├── mod.rs - │ ├── build.rs ← builder → draft conversion + plan helpers - │ ├── cost.rs ← cost estimation state - │ ├── draft.rs ← draft state + finalize (to_request) - │ └── request.rs ← request state + send() - └── seedance_2p0_fast/ ← Seedance 2.0 Fast model - ├── mod.rs - ├── build.rs - ├── cost.rs - ├── draft.rs - └── request.rs -``` - -## Adding a new provider or model - -1. **Create the module** under `providers/{provider}/{model}/` with these files: - - `mod.rs` — declares sub-modules - - `build.rs` — `build_{provider}_{model}(builder) -> VideoGenerationDraftOrRequest`. - Contains `plan_*` helpers for aspect ratio, resolution, batch count, duration. - - `draft.rs` — draft state struct with `to_request()` async method for finalization. - **Not needed** if the provider uses media tokens directly (no upload/resolution needed); - in that case `build.rs` returns `VideoGenerationDraftOrRequest::Request(...)` directly. - - `cost.rs` — cost state with `from_request()` and `estimate_cost()`. Add `from_draft()` - if the provider uses the draft phase. - - `request.rs` — request state with `send()` async method. - -2. **Register the module** in the parent provider's `mod.rs`. - -3. **Add enum variants** in: - - `video_generation_draft.rs` — `VideoGenerationDraftRequest` enum + `estimate_cost` + `finalize` - (skip if provider has no draft phase) - - `video_generation_request.rs` — `VideoGenerationRequest` enum + `estimate_cost` + `send_request` - -4. **Wire into the builder** in `generate_video_request_builder.rs`: - - Add the `(Provider, Model)` pair to `use_new_builder()` returning `true` - - Add the dispatch arm in `build2()` - -5. **Tests**: each `build.rs` and `cost.rs` should have comprehensive tests. `request.rs` - should have `#[ignore]` live API tests for manual verification. diff --git a/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/CLAUDE.md b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/api_clients/artcraft/artcraft_router/src/generate/generate_video/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/api_clients/beeble_client/AGENTS.md b/crates/api_clients/beeble_client/AGENTS.md new file mode 100644 index 0000000000..cd77e5c204 --- /dev/null +++ b/crates/api_clients/beeble_client/AGENTS.md @@ -0,0 +1,24 @@ +# beeble_client + +HTTP client for the Beeble SwitchX compositing API. + +## API Reference + +- Docs: https://developer.beeble.ai/docs +- OpenAPI: https://api.beeble.ai/developer-api-docs/openapi.json +- Auth: `x-api-key` header + +## Endpoints + +- `create_upload_url` — POST /v1/uploads — get a presigned PUT URL for uploading media +- `start_generation` — POST /v1/switchx/generations — start an image or video compositing job +- `get_job_status` — GET /v1/switchx/generations/{job_id} — poll job status until completed/failed + +## Testing + +```bash +cargo test -p beeble_client # run non-ignored tests (API shape only) +cargo test -p beeble_client -- --ignored # run live API tests (requires key, incurs costs) +``` + +Live tests require: `/Users/bt/Artcraft/credentials/beeble_api_key.txt` diff --git a/crates/api_clients/beeble_client/CLAUDE.md b/crates/api_clients/beeble_client/CLAUDE.md deleted file mode 100644 index cd77e5c204..0000000000 --- a/crates/api_clients/beeble_client/CLAUDE.md +++ /dev/null @@ -1,24 +0,0 @@ -# beeble_client - -HTTP client for the Beeble SwitchX compositing API. - -## API Reference - -- Docs: https://developer.beeble.ai/docs -- OpenAPI: https://api.beeble.ai/developer-api-docs/openapi.json -- Auth: `x-api-key` header - -## Endpoints - -- `create_upload_url` — POST /v1/uploads — get a presigned PUT URL for uploading media -- `start_generation` — POST /v1/switchx/generations — start an image or video compositing job -- `get_job_status` — GET /v1/switchx/generations/{job_id} — poll job status until completed/failed - -## Testing - -```bash -cargo test -p beeble_client # run non-ignored tests (API shape only) -cargo test -p beeble_client -- --ignored # run live API tests (requires key, incurs costs) -``` - -Live tests require: `/Users/bt/Artcraft/credentials/beeble_api_key.txt` diff --git a/crates/api_clients/beeble_client/CLAUDE.md b/crates/api_clients/beeble_client/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/api_clients/beeble_client/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/cli/production/support-tool/AGENTS.md b/crates/cli/production/support-tool/AGENTS.md new file mode 100644 index 0000000000..e5f493f073 --- /dev/null +++ b/crates/cli/production/support-tool/AGENTS.md @@ -0,0 +1,58 @@ +# support-tool + +Production support CLI for debugging and manual operations against external services. + +## Building & Running + +```bash +cargo build -p support-tool +cargo run -p support-tool -- kinovi_web generate_video --prompt "A corgi at the lake" +``` + +## Environment + +Requires a `.env-support-tool-secrets` file (or env vars) with: + +- `SEEDANCE2PRO_COOKIES` — session cookies for Kinovi/KinoviWeb API auth +- `ARTCRAFT_COOKIES` — session cookies for ArtCraft API auth (format: `session=...; visitor=...`) + +## Architecture + +- Entry point: `src/main.rs` → normalizes args (underscores optional) → dispatches +- Top-level commands in `src/commands/run.rs` (`TopLevelCommand` enum) +- Each top-level command has its own module with `dispatch.rs`, `state.rs`, `subcommands/` +- Subcommands use `#[derive(Args)]` for their argument structs +- All subcommand `run()` functions are `async fn` returning `anyhow::Result<()>` + +## Adding a New Subcommand (to kinovi_web) + +1. Create `src/commands/kinovi_web/subcommands/my_command.rs` +2. Add `pub mod my_command;` to `subcommands/mod.rs` +3. Add the name to `SUBCOMMAND_NAMES` in `dispatch.rs` +4. Add a variant to `KinoviWebCommand` enum in `dispatch.rs` +5. Add a match arm in `dispatch.rs::run()` + +## Utilities + +- `src/utils/parse_video_model.rs` — shared parser for loose video model names → `CommonVideoModel` +- `src/utils/normalize_subcommands.rs` — underscore-insensitive arg normalizer + +## Conventions + +- Use `log::info!()` for status output, never `println!` (except for final results) +- Use `anyhow::anyhow!()` for ad-hoc errors +- Get `KinoviWebSession` from `state.cookies` via `from_cookies_string()` +- Get `StorytellerCredentialSet` from `state.creds` (parsed from ARTCRAFT_COOKIES) +- External crates used: `artcraft_client` (media file download, omni API), `kinovi_web_client` (Kinovi direct), `artcraft_api_defs` (request types) + +## Subcommands + +### kinovi_web (direct Kinovi API) + +- `kinovi_web find_job --token ` — search for a job across all pages +- `kinovi_web failed_job_histogram` — histogram of failure reasons +- `kinovi_web generate_video --prompt [--model seedance2p0] [--start_frame_media_token mf_xxx] [--localhost] [--download_path /tmp/media_files]` + +### artcraft (omni API) + +- `artcraft generate_video --prompt [--model seedance2p0] [--start_frame_media_token mf_xxx] [--duration 5] [--localhost]` diff --git a/crates/cli/production/support-tool/CLAUDE.md b/crates/cli/production/support-tool/CLAUDE.md deleted file mode 100644 index e5f493f073..0000000000 --- a/crates/cli/production/support-tool/CLAUDE.md +++ /dev/null @@ -1,58 +0,0 @@ -# support-tool - -Production support CLI for debugging and manual operations against external services. - -## Building & Running - -```bash -cargo build -p support-tool -cargo run -p support-tool -- kinovi_web generate_video --prompt "A corgi at the lake" -``` - -## Environment - -Requires a `.env-support-tool-secrets` file (or env vars) with: - -- `SEEDANCE2PRO_COOKIES` — session cookies for Kinovi/KinoviWeb API auth -- `ARTCRAFT_COOKIES` — session cookies for ArtCraft API auth (format: `session=...; visitor=...`) - -## Architecture - -- Entry point: `src/main.rs` → normalizes args (underscores optional) → dispatches -- Top-level commands in `src/commands/run.rs` (`TopLevelCommand` enum) -- Each top-level command has its own module with `dispatch.rs`, `state.rs`, `subcommands/` -- Subcommands use `#[derive(Args)]` for their argument structs -- All subcommand `run()` functions are `async fn` returning `anyhow::Result<()>` - -## Adding a New Subcommand (to kinovi_web) - -1. Create `src/commands/kinovi_web/subcommands/my_command.rs` -2. Add `pub mod my_command;` to `subcommands/mod.rs` -3. Add the name to `SUBCOMMAND_NAMES` in `dispatch.rs` -4. Add a variant to `KinoviWebCommand` enum in `dispatch.rs` -5. Add a match arm in `dispatch.rs::run()` - -## Utilities - -- `src/utils/parse_video_model.rs` — shared parser for loose video model names → `CommonVideoModel` -- `src/utils/normalize_subcommands.rs` — underscore-insensitive arg normalizer - -## Conventions - -- Use `log::info!()` for status output, never `println!` (except for final results) -- Use `anyhow::anyhow!()` for ad-hoc errors -- Get `KinoviWebSession` from `state.cookies` via `from_cookies_string()` -- Get `StorytellerCredentialSet` from `state.creds` (parsed from ARTCRAFT_COOKIES) -- External crates used: `artcraft_client` (media file download, omni API), `kinovi_web_client` (Kinovi direct), `artcraft_api_defs` (request types) - -## Subcommands - -### kinovi_web (direct Kinovi API) - -- `kinovi_web find_job --token ` — search for a job across all pages -- `kinovi_web failed_job_histogram` — histogram of failure reasons -- `kinovi_web generate_video --prompt [--model seedance2p0] [--start_frame_media_token mf_xxx] [--localhost] [--download_path /tmp/media_files]` - -### artcraft (omni API) - -- `artcraft generate_video --prompt [--model seedance2p0] [--start_frame_media_token mf_xxx] [--duration 5] [--localhost]` diff --git a/crates/cli/production/support-tool/CLAUDE.md b/crates/cli/production/support-tool/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/cli/production/support-tool/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/lib/pager/AGENTS.md b/crates/lib/pager/AGENTS.md new file mode 100644 index 0000000000..d58719851d --- /dev/null +++ b/crates/lib/pager/AGENTS.md @@ -0,0 +1,40 @@ +# Pager Crate + +Alerting/paging system that sends notifications via Rootly. + +## Key Types + +- `Pager` - Main client, cloneable. Has `enqueue_page()` and `shutdown_worker()` +- `PagerBuilder` - Constructs a Pager with optional background worker +- `NotificationDetails` - Alert payload with title, description, urgency, HTTP context, entity tokens +- `NotificationDetailsBuilder` - Fluent builder for constructing notifications +- `NotificationUrgency` - High, Medium, Low + +## Building Notifications + +```rust +let notification = NotificationDetailsBuilder::from_title("Something happened".to_string()) + .set_description(Some("Details...".to_string())) + .set_urgency(Some(NotificationUrgency::High)) + .set_http_method(Some("POST".to_string())) + .set_http_path(Some("/v1/endpoint".to_string())) + .set_inference_job_token(Some(job_token.to_string())) + .build(); +``` + +For errors, use `from_error()` which auto-populates title and description from the error: + +```rust +NotificationDetailsBuilder::from_error(&err) + .set_title("Custom title".to_string()) + .set_urgency(Some(NotificationUrgency::Medium)) + .build() +``` + +## Deduplication + +`NotificationDetails::to_deduplication_key()` generates a SHA-256 hash for dedup. Same title + HTTP context + hour = same key. + +## Worker Thread + +The pager worker uses `Condvar::wait()` (blocking). It MUST run on a dedicated OS thread, not a tokio task. diff --git a/crates/lib/pager/CLAUDE.md b/crates/lib/pager/CLAUDE.md deleted file mode 100644 index d58719851d..0000000000 --- a/crates/lib/pager/CLAUDE.md +++ /dev/null @@ -1,40 +0,0 @@ -# Pager Crate - -Alerting/paging system that sends notifications via Rootly. - -## Key Types - -- `Pager` - Main client, cloneable. Has `enqueue_page()` and `shutdown_worker()` -- `PagerBuilder` - Constructs a Pager with optional background worker -- `NotificationDetails` - Alert payload with title, description, urgency, HTTP context, entity tokens -- `NotificationDetailsBuilder` - Fluent builder for constructing notifications -- `NotificationUrgency` - High, Medium, Low - -## Building Notifications - -```rust -let notification = NotificationDetailsBuilder::from_title("Something happened".to_string()) - .set_description(Some("Details...".to_string())) - .set_urgency(Some(NotificationUrgency::High)) - .set_http_method(Some("POST".to_string())) - .set_http_path(Some("/v1/endpoint".to_string())) - .set_inference_job_token(Some(job_token.to_string())) - .build(); -``` - -For errors, use `from_error()` which auto-populates title and description from the error: - -```rust -NotificationDetailsBuilder::from_error(&err) - .set_title("Custom title".to_string()) - .set_urgency(Some(NotificationUrgency::Medium)) - .build() -``` - -## Deduplication - -`NotificationDetails::to_deduplication_key()` generates a SHA-256 hash for dedup. Same title + HTTP context + hour = same key. - -## Worker Thread - -The pager worker uses `Condvar::wait()` (blocking). It MUST run on a dedicated OS thread, not a tokio task. diff --git a/crates/lib/pager/CLAUDE.md b/crates/lib/pager/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/lib/pager/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/schema/database/mysql_queries/AGENTS.md b/crates/schema/database/mysql_queries/AGENTS.md new file mode 100644 index 0000000000..c10c15976b --- /dev/null +++ b/crates/schema/database/mysql_queries/AGENTS.md @@ -0,0 +1,79 @@ +# mysql_queries + +SQLx-based MySQL queries for the storyteller-web backend and background jobs. + +## Building + +``` +SQLX_OFFLINE=true cargo check -p mysql_queries +``` + +The `SQLX_OFFLINE=true` env var is **required** for compilation. This crate uses the sqlx +offline cache (`.sqlx/` directory at the workspace root) to validate queries at compile time +without a live database connection. + +## Query Style + +### Prefer `sqlx::query!` and `sqlx::query_as!` macros + +Always use the compile-time checked `sqlx::query!` and `sqlx::query_as!` macros over the +runtime `sqlx::query()` and `sqlx::query_as()` functions. The macros validate SQL syntax, +column names, and parameter types against the offline cache at compile time. + +```rust +// PREFERRED: compile-time checked +sqlx::query!( + r#"INSERT INTO my_table SET token = ?, name = ?"#, + token, + name, +) + .execute(args.mysql_executor) + .await?; + +// AVOID: runtime only, no compile-time checking +sqlx::query(r#"INSERT INTO my_table SET token = ?, name = ?"#) + .bind(token) + .bind(name) + .execute(args.mysql_executor) + .await?; +``` + +Use runtime `sqlx::query()` only when: +- The query involves a table not yet in the offline cache and you cannot run `cargo sqlx prepare` +- The query is dynamically constructed (rare) +- SELECT queries for new tables where column type metadata isn't cached yet + +### Offline Cache + +When adding new queries for **existing tables**, the `.sqlx/` cache should already have the +schema metadata. For **new tables**, you may need to: + +1. Run the migration against a real database +2. Run `cargo sqlx prepare` to regenerate the cache +3. Or manually create cache entries for simple INSERT/UPDATE queries (they only need parameter count) + +### Table Conventions + +- Primary key `id` columns must be `BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT`. Do not use signed IDs. +- Always create tables with `ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin`. + +### Error Types + +New queries should return `Result` instead of the legacy `AnyhowResult`. +The `AnyhowResult` pattern is being phased out. + +### Transaction Support + +Use the executor-generic `Args` pattern for queries that need to work inside transactions: + +```rust +pub struct MyQueryArgs<'a, 'c: 'a, E> + where E: 'a + Executor<'c, Database = MySql> +{ + pub field: &'a str, + pub mysql_executor: E, + pub phantom: PhantomData<&'c E>, +} +``` + +This allows the same query function to accept both `&MySqlPool` and `&mut Transaction`. diff --git a/crates/schema/database/mysql_queries/CLAUDE.md b/crates/schema/database/mysql_queries/CLAUDE.md deleted file mode 100644 index c10c15976b..0000000000 --- a/crates/schema/database/mysql_queries/CLAUDE.md +++ /dev/null @@ -1,79 +0,0 @@ -# mysql_queries - -SQLx-based MySQL queries for the storyteller-web backend and background jobs. - -## Building - -``` -SQLX_OFFLINE=true cargo check -p mysql_queries -``` - -The `SQLX_OFFLINE=true` env var is **required** for compilation. This crate uses the sqlx -offline cache (`.sqlx/` directory at the workspace root) to validate queries at compile time -without a live database connection. - -## Query Style - -### Prefer `sqlx::query!` and `sqlx::query_as!` macros - -Always use the compile-time checked `sqlx::query!` and `sqlx::query_as!` macros over the -runtime `sqlx::query()` and `sqlx::query_as()` functions. The macros validate SQL syntax, -column names, and parameter types against the offline cache at compile time. - -```rust -// PREFERRED: compile-time checked -sqlx::query!( - r#"INSERT INTO my_table SET token = ?, name = ?"#, - token, - name, -) - .execute(args.mysql_executor) - .await?; - -// AVOID: runtime only, no compile-time checking -sqlx::query(r#"INSERT INTO my_table SET token = ?, name = ?"#) - .bind(token) - .bind(name) - .execute(args.mysql_executor) - .await?; -``` - -Use runtime `sqlx::query()` only when: -- The query involves a table not yet in the offline cache and you cannot run `cargo sqlx prepare` -- The query is dynamically constructed (rare) -- SELECT queries for new tables where column type metadata isn't cached yet - -### Offline Cache - -When adding new queries for **existing tables**, the `.sqlx/` cache should already have the -schema metadata. For **new tables**, you may need to: - -1. Run the migration against a real database -2. Run `cargo sqlx prepare` to regenerate the cache -3. Or manually create cache entries for simple INSERT/UPDATE queries (they only need parameter count) - -### Table Conventions - -- Primary key `id` columns must be `BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT`. Do not use signed IDs. -- Always create tables with `ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin`. - -### Error Types - -New queries should return `Result` instead of the legacy `AnyhowResult`. -The `AnyhowResult` pattern is being phased out. - -### Transaction Support - -Use the executor-generic `Args` pattern for queries that need to work inside transactions: - -```rust -pub struct MyQueryArgs<'a, 'c: 'a, E> - where E: 'a + Executor<'c, Database = MySql> -{ - pub field: &'a str, - pub mysql_executor: E, - pub phantom: PhantomData<&'c E>, -} -``` - -This allows the same query function to accept both `&MySqlPool` and `&mut Transaction`. diff --git a/crates/schema/database/mysql_queries/CLAUDE.md b/crates/schema/database/mysql_queries/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/schema/database/mysql_queries/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/schema/public/enums/AGENTS.md b/crates/schema/public/enums/AGENTS.md new file mode 100644 index 0000000000..0d59f19765 --- /dev/null +++ b/crates/schema/public/enums/AGENTS.md @@ -0,0 +1,26 @@ +# Enums Crate + +Database-backed enums stored as VARCHAR fields in MySQL. + +## Adding a New Enum + +1. Create file: `src/by_table/{table_name}/{field_name}.rs` +2. Define the enum with required derives: + ```rust + #[cfg_attr(test, derive(EnumIter, EnumCount))] + #[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema)] + pub enum MyEnum { ... } + ``` +3. Implement `to_str()` and `from_str()` manually +4. Add macros: `impl_enum_display_and_debug_using_to_str!(MyEnum);` and `impl_mysql_enum_coders!(MyEnum);` +5. Add to parent `mod.rs` +6. Write tests: serialization, round-trip, `all_variants()` count + +## Rules + +- **NEVER change existing variant string values** - they are stored in the database +- New variants CAN be added freely - but be very careful about the Tauri API callers + ingesting new values. Make sure to pair the client with variants with an "Unknown(String)" + catch-all / future-proof bucket. +- All string values must be snake_case +- Use `#[serde(rename = "snake_case_value")]` on each variant diff --git a/crates/schema/public/enums/CLAUDE.md b/crates/schema/public/enums/CLAUDE.md deleted file mode 100644 index 0d59f19765..0000000000 --- a/crates/schema/public/enums/CLAUDE.md +++ /dev/null @@ -1,26 +0,0 @@ -# Enums Crate - -Database-backed enums stored as VARCHAR fields in MySQL. - -## Adding a New Enum - -1. Create file: `src/by_table/{table_name}/{field_name}.rs` -2. Define the enum with required derives: - ```rust - #[cfg_attr(test, derive(EnumIter, EnumCount))] - #[derive(Clone, Copy, Eq, PartialEq, Hash, Ord, PartialOrd, Deserialize, Serialize, ToSchema)] - pub enum MyEnum { ... } - ``` -3. Implement `to_str()` and `from_str()` manually -4. Add macros: `impl_enum_display_and_debug_using_to_str!(MyEnum);` and `impl_mysql_enum_coders!(MyEnum);` -5. Add to parent `mod.rs` -6. Write tests: serialization, round-trip, `all_variants()` count - -## Rules - -- **NEVER change existing variant string values** - they are stored in the database -- New variants CAN be added freely - but be very careful about the Tauri API callers - ingesting new values. Make sure to pair the client with variants with an "Unknown(String)" - catch-all / future-proof bucket. -- All string values must be snake_case -- Use `#[serde(rename = "snake_case_value")]` on each variant diff --git a/crates/schema/public/enums/CLAUDE.md b/crates/schema/public/enums/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/schema/public/enums/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/schema/public/tokens/AGENTS.md b/crates/schema/public/tokens/AGENTS.md new file mode 100644 index 0000000000..06c4a8293e --- /dev/null +++ b/crates/schema/public/tokens/AGENTS.md @@ -0,0 +1,22 @@ +# Tokens Crate + +Strongly-typed primary key identifiers with Stripe-like prefixes (e.g. `user_abc123`, `prompt_xyz789`, etc.) + +## Adding a New Token + +1. Create file in `src/tokens/{entity_name}.rs` +2. Define as a newtype wrapper: + ```rust + #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize, Deserialize, ToSchema)] + #[cfg_attr(feature = "database", derive(sqlx::Type))] + #[cfg_attr(feature = "database", sqlx(transparent))] + pub struct MyToken(pub String); + ``` +3. Apply macros: + ```rust + impl_string_token!(MyToken); + impl_mysql_token_from_row!(MyToken); + impl_crockford_generator!(MyToken, 32usize, TokenPrefix::MyEntity, CrockfordLower); + ``` +4. Add the prefix to `TokenPrefix` enum in `src/token_prefix.rs` +5. Add to parent `mod.rs` diff --git a/crates/schema/public/tokens/CLAUDE.md b/crates/schema/public/tokens/CLAUDE.md deleted file mode 100644 index 06c4a8293e..0000000000 --- a/crates/schema/public/tokens/CLAUDE.md +++ /dev/null @@ -1,22 +0,0 @@ -# Tokens Crate - -Strongly-typed primary key identifiers with Stripe-like prefixes (e.g. `user_abc123`, `prompt_xyz789`, etc.) - -## Adding a New Token - -1. Create file in `src/tokens/{entity_name}.rs` -2. Define as a newtype wrapper: - ```rust - #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Serialize, Deserialize, ToSchema)] - #[cfg_attr(feature = "database", derive(sqlx::Type))] - #[cfg_attr(feature = "database", sqlx(transparent))] - pub struct MyToken(pub String); - ``` -3. Apply macros: - ```rust - impl_string_token!(MyToken); - impl_mysql_token_from_row!(MyToken); - impl_crockford_generator!(MyToken, 32usize, TokenPrefix::MyEntity, CrockfordLower); - ``` -4. Add the prefix to `TokenPrefix` enum in `src/token_prefix.rs` -5. Add to parent `mod.rs` diff --git a/crates/schema/public/tokens/CLAUDE.md b/crates/schema/public/tokens/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/schema/public/tokens/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/service/job/AGENTS.md b/crates/service/job/AGENTS.md new file mode 100644 index 0000000000..05d6c0433e --- /dev/null +++ b/crates/service/job/AGENTS.md @@ -0,0 +1,42 @@ +# Background Jobs + +Background job crates that run as standalone processes alongside storyteller-web. + +## Common Pattern + +All jobs follow the same structure: + +1. `main.rs` - Bootstrap, DB pool, bucket client, pager setup, thread spawning +2. `job_dependencies.rs` - Shared state struct passed to the main loop +3. `startup/build_pager.rs` - Pager initialization from env vars +4. `http_server/` - Health check endpoint for k8s liveness probes +5. `job/` or `jobs/` - Main processing logic + +## Threading Model + +- **Main thread** (`#[tokio::main]`): runs the job's main loop +- **HTTP server thread** (`std::thread::spawn`): dedicated OS thread with its own `actix_web::rt::System` +- **Pager worker thread** (`std::thread::spawn`): dedicated OS thread (uses blocking `Condvar::wait`) +- **Signal handler** (`tokio::spawn`): listens for SIGTERM/SIGINT to set `application_shutdown` flag + +Important: Do NOT use `#[actix_web::main]` - it registers signal handlers that steal SIGINT. Use `#[tokio::main]` instead. + +Important: Do NOT spawn the pager worker via `tokio::spawn` - its `Condvar::wait` blocks the runtime. Use a dedicated OS thread. + +## Pager Integration + +Use the `alert_pager_and_return_err()` helper pattern for error reporting: + +```rust +if let Err(err) = some_operation().await { + error!("Descriptive message: {:?}", err); + return alert_pager_and_return_err(&deps.pager, "Alert title", err, optional_job_ref); +} +``` + +## Environment Variables + +Shared across jobs (via `shared_env_var_config`): +- `ENABLE_PAGING` - Master switch for pager alerts +- `ROOTLY_API_KEY` - Rootly API key for sending alerts +- `ROOTLY_NOTIFICATION_TARGET_TYPE` / `ROOTLY_NOTIFICATION_TARGET_ID` diff --git a/crates/service/job/CLAUDE.md b/crates/service/job/CLAUDE.md deleted file mode 100644 index 05d6c0433e..0000000000 --- a/crates/service/job/CLAUDE.md +++ /dev/null @@ -1,42 +0,0 @@ -# Background Jobs - -Background job crates that run as standalone processes alongside storyteller-web. - -## Common Pattern - -All jobs follow the same structure: - -1. `main.rs` - Bootstrap, DB pool, bucket client, pager setup, thread spawning -2. `job_dependencies.rs` - Shared state struct passed to the main loop -3. `startup/build_pager.rs` - Pager initialization from env vars -4. `http_server/` - Health check endpoint for k8s liveness probes -5. `job/` or `jobs/` - Main processing logic - -## Threading Model - -- **Main thread** (`#[tokio::main]`): runs the job's main loop -- **HTTP server thread** (`std::thread::spawn`): dedicated OS thread with its own `actix_web::rt::System` -- **Pager worker thread** (`std::thread::spawn`): dedicated OS thread (uses blocking `Condvar::wait`) -- **Signal handler** (`tokio::spawn`): listens for SIGTERM/SIGINT to set `application_shutdown` flag - -Important: Do NOT use `#[actix_web::main]` - it registers signal handlers that steal SIGINT. Use `#[tokio::main]` instead. - -Important: Do NOT spawn the pager worker via `tokio::spawn` - its `Condvar::wait` blocks the runtime. Use a dedicated OS thread. - -## Pager Integration - -Use the `alert_pager_and_return_err()` helper pattern for error reporting: - -```rust -if let Err(err) = some_operation().await { - error!("Descriptive message: {:?}", err); - return alert_pager_and_return_err(&deps.pager, "Alert title", err, optional_job_ref); -} -``` - -## Environment Variables - -Shared across jobs (via `shared_env_var_config`): -- `ENABLE_PAGING` - Master switch for pager alerts -- `ROOTLY_API_KEY` - Rootly API key for sending alerts -- `ROOTLY_NOTIFICATION_TARGET_TYPE` / `ROOTLY_NOTIFICATION_TARGET_ID` diff --git a/crates/service/job/CLAUDE.md b/crates/service/job/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/service/job/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/crates/service/web/storyteller_web/AGENTS.md b/crates/service/web/storyteller_web/AGENTS.md new file mode 100644 index 0000000000..00d6a27a2e --- /dev/null +++ b/crates/service/web/storyteller_web/AGENTS.md @@ -0,0 +1,116 @@ +# storyteller-web + +The main HTTP API monolith. This is the backend for the ArtCraft application. + +## Building + +``` +cargo check -p storyteller-web +``` + +There are ~370 pre-existing warnings. Check the last 8-10 lines of output for actual errors. + +## Structure + +- `src/http_server/endpoints/` - HTTP handlers organized by feature +- `src/http_server/middleware/` - Actix middleware (error alerting, etc.) +- `src/http_server/common_responses/` - Shared error types (`CommonWebError`) +- `src/http_server/web_utils/` - Session checking, auth helpers +- `src/state/` - Server state, feature flags +- `src/startup/` - Initialization (pager, etc.) +- `src/threads/` - Background threads (health checker, etc.) +- `src/docs/` - OpenAPI/Swagger documentation (`api_doc.rs`) + +## Handler Pattern + +Handlers return `Result, ErrorType>`. The `Result` pattern is +deprecated or only used when setting other HTTP headers, like cookies. + +Prefer `CommonWebError` for new handlers unless you need custom error variants. + +The session helpers (`require_user_session`, `require_user_session_extended`, `require_moderator` +in `http_server/web_utils/user_session/`) take a generic `mysql_executor` argument. Pass an +already-open connection (`&mut *conn`) so the helper reuses it; do NOT pass +`&server_state.mysql_pool` when the handler already holds a connection, since that self-acquires a +second one and adds pool pressure (this crate has had pool-timeout incidents). There is no +`require_user_session_using_connection` / `require_moderator_using_connection` — the +reuse-vs-acquire behavior is determined by the argument. + +## Database Access + +Do NOT write SQLx queries in this crate. `storyteller-web` contains **zero** direct SQLx queries — +all MySQL access goes through the `mysql_queries` crate. Add a function there (or reuse an existing +one) and call it from the handler; never embed `sqlx::query!` / `sqlx::query()` in a handler or +helper here. See `crates/schema/database/mysql_queries/CLAUDE.md` for the query-writing conventions +(compile-time `query!` / `query_as!` macros, offline cache, the `Args`/`Executor` pattern, etc.). + +## api_doc.rs + +When adding new request/response/error types, add them to `src/docs/api_doc.rs` in the +schemas section (alphabetically sorted). Types from `artcraft_api_defs` need explicit imports. + +## Running locally + +Environment variables are auto-loaded by Rust at startup from these files: + +- `.env` (repo root) +- `crates/service/web/storyteller_web/config/storyteller-web.common.env` +- `crates/service/web/storyteller_web/config/storyteller-web.development.env` +- `crates/service/web/storyteller_web/config/storyteller-web.development-secrets.env` + +**Do NOT** use `SQLX_OFFLINE=true` — the server needs live DB access. + +```bash +# From the repo root, just run: +cargo run --bin storyteller-web +``` + +The server binds to `0.0.0.0:12345` by default. Compilation takes ~3 minutes on first build. + +## Testing endpoints with curl + +```bash +# 1. Log in to get session cookies: +curl -s -c /tmp/cookies.txt -X POST http://localhost:12345/v1/login \ + -H "Content-Type: application/json" \ + -d '{"username_or_email":"newuser4","password":"newuser4"}' + +# 2. Generate video (Seedance 2.0 Fast): +# Requires a UUID-format idempotency_token. +curl -s -b /tmp/cookies.txt -X POST http://localhost:12345/v1/omni_gen/generate/video \ + -H "Content-Type: application/json" \ + -d '{ + "model": "seedance_2p0_fast", + "prompt": "a corgi running through a field", + "duration_seconds": 5, + "aspect_ratio": "wide_sixteen_by_nine", + "idempotency_token": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + }' + +# 3. Generate video (Seedance 2.0, 720p): +curl -s -b /tmp/cookies.txt -X POST http://localhost:12345/v1/omni_gen/generate/video \ + -H "Content-Type: application/json" \ + -d '{ + "model": "seedance_2p0", + "prompt": "a corgi running through a field", + "duration_seconds": 5, + "resolution": "seven_twenty_p", + "aspect_ratio": "wide_sixteen_by_nine", + "idempotency_token": "b2c3d4e5-f6a7-8901-bcde-f12345678901" + }' +``` + +A successful response returns 200 with `{"success": true, "inference_job_token": "jinf_..."}`. + +**Notes:** +- `idempotency_token` must be UUID format (32 hex chars or 36 with dashes) +- `resolution` uses enum names: `four_eighty_p`, `seven_twenty_p`, `ten_eighty_p` +- `aspect_ratio` uses enum names: `wide_sixteen_by_nine`, `tall_nine_by_sixteen`, `square`, etc. +- Use a new `idempotency_token` for each request to avoid duplicate detection + +## Pager Integration + +- The `Pager` is available on `ServerState` as `server_state.pager` +- Health check handler sends alerts when unhealthy +- Error alerting middleware sends alerts on HTTP 500s (when enabled) +- Use `NotificationDetailsBuilder` for constructing alerts diff --git a/crates/service/web/storyteller_web/CLAUDE.md b/crates/service/web/storyteller_web/CLAUDE.md deleted file mode 100644 index 00d6a27a2e..0000000000 --- a/crates/service/web/storyteller_web/CLAUDE.md +++ /dev/null @@ -1,116 +0,0 @@ -# storyteller-web - -The main HTTP API monolith. This is the backend for the ArtCraft application. - -## Building - -``` -cargo check -p storyteller-web -``` - -There are ~370 pre-existing warnings. Check the last 8-10 lines of output for actual errors. - -## Structure - -- `src/http_server/endpoints/` - HTTP handlers organized by feature -- `src/http_server/middleware/` - Actix middleware (error alerting, etc.) -- `src/http_server/common_responses/` - Shared error types (`CommonWebError`) -- `src/http_server/web_utils/` - Session checking, auth helpers -- `src/state/` - Server state, feature flags -- `src/startup/` - Initialization (pager, etc.) -- `src/threads/` - Background threads (health checker, etc.) -- `src/docs/` - OpenAPI/Swagger documentation (`api_doc.rs`) - -## Handler Pattern - -Handlers return `Result, ErrorType>`. The `Result` pattern is -deprecated or only used when setting other HTTP headers, like cookies. - -Prefer `CommonWebError` for new handlers unless you need custom error variants. - -The session helpers (`require_user_session`, `require_user_session_extended`, `require_moderator` -in `http_server/web_utils/user_session/`) take a generic `mysql_executor` argument. Pass an -already-open connection (`&mut *conn`) so the helper reuses it; do NOT pass -`&server_state.mysql_pool` when the handler already holds a connection, since that self-acquires a -second one and adds pool pressure (this crate has had pool-timeout incidents). There is no -`require_user_session_using_connection` / `require_moderator_using_connection` — the -reuse-vs-acquire behavior is determined by the argument. - -## Database Access - -Do NOT write SQLx queries in this crate. `storyteller-web` contains **zero** direct SQLx queries — -all MySQL access goes through the `mysql_queries` crate. Add a function there (or reuse an existing -one) and call it from the handler; never embed `sqlx::query!` / `sqlx::query()` in a handler or -helper here. See `crates/schema/database/mysql_queries/CLAUDE.md` for the query-writing conventions -(compile-time `query!` / `query_as!` macros, offline cache, the `Args`/`Executor` pattern, etc.). - -## api_doc.rs - -When adding new request/response/error types, add them to `src/docs/api_doc.rs` in the -schemas section (alphabetically sorted). Types from `artcraft_api_defs` need explicit imports. - -## Running locally - -Environment variables are auto-loaded by Rust at startup from these files: - -- `.env` (repo root) -- `crates/service/web/storyteller_web/config/storyteller-web.common.env` -- `crates/service/web/storyteller_web/config/storyteller-web.development.env` -- `crates/service/web/storyteller_web/config/storyteller-web.development-secrets.env` - -**Do NOT** use `SQLX_OFFLINE=true` — the server needs live DB access. - -```bash -# From the repo root, just run: -cargo run --bin storyteller-web -``` - -The server binds to `0.0.0.0:12345` by default. Compilation takes ~3 minutes on first build. - -## Testing endpoints with curl - -```bash -# 1. Log in to get session cookies: -curl -s -c /tmp/cookies.txt -X POST http://localhost:12345/v1/login \ - -H "Content-Type: application/json" \ - -d '{"username_or_email":"newuser4","password":"newuser4"}' - -# 2. Generate video (Seedance 2.0 Fast): -# Requires a UUID-format idempotency_token. -curl -s -b /tmp/cookies.txt -X POST http://localhost:12345/v1/omni_gen/generate/video \ - -H "Content-Type: application/json" \ - -d '{ - "model": "seedance_2p0_fast", - "prompt": "a corgi running through a field", - "duration_seconds": 5, - "aspect_ratio": "wide_sixteen_by_nine", - "idempotency_token": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" - }' - -# 3. Generate video (Seedance 2.0, 720p): -curl -s -b /tmp/cookies.txt -X POST http://localhost:12345/v1/omni_gen/generate/video \ - -H "Content-Type: application/json" \ - -d '{ - "model": "seedance_2p0", - "prompt": "a corgi running through a field", - "duration_seconds": 5, - "resolution": "seven_twenty_p", - "aspect_ratio": "wide_sixteen_by_nine", - "idempotency_token": "b2c3d4e5-f6a7-8901-bcde-f12345678901" - }' -``` - -A successful response returns 200 with `{"success": true, "inference_job_token": "jinf_..."}`. - -**Notes:** -- `idempotency_token` must be UUID format (32 hex chars or 36 with dashes) -- `resolution` uses enum names: `four_eighty_p`, `seven_twenty_p`, `ten_eighty_p` -- `aspect_ratio` uses enum names: `wide_sixteen_by_nine`, `tall_nine_by_sixteen`, `square`, etc. -- Use a new `idempotency_token` for each request to avoid duplicate detection - -## Pager Integration - -- The `Pager` is available on `ServerState` as `server_state.pager` -- Health check handler sends alerts when unhealthy -- Error alerting middleware sends alerts on HTTP 500s (when enabled) -- Use `NotificationDetailsBuilder` for constructing alerts diff --git a/crates/service/web/storyteller_web/CLAUDE.md b/crates/service/web/storyteller_web/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/crates/service/web/storyteller_web/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/frontend/libs/components/pagescene/AGENTS.md b/frontend/libs/components/pagescene/AGENTS.md new file mode 100644 index 0000000000..cb27c73bd7 --- /dev/null +++ b/frontend/libs/components/pagescene/AGENTS.md @@ -0,0 +1,513 @@ +# CLAUDE.md — pagescene (3D Scene Editor) + +Guidance for working in the `pagescene` library — the 3D editor (a.k.a. "pagescene" / "Stage3D"). + +## ⚠️ Engine-canvas mounting invariant (footgun) + +`EngineProvider`'s editor-construction effect depends on three DOM nodes: `sceneContainer`, +`editorCanvas`, and **`camViewCanvas`** (owned by `PreviewEngineCamera` → `CameraViewCanvas`). +If ANY of these unmounts, the effect tears down + recreates the whole `Editor` (serializing to +cache, then reloading) — which wipes a fresh/unsaved scene. **Never conditionally unmount the +components that host these canvases** (`SceneContainer`, `EditorCanvas`, `PreviewEngineCamera`) +for mode/chrome gating — hide them with CSS (`hidden`) instead. (Regression fixed: record mode +had gated `PreviewEngineCamera` behind `!isRecord`, wiping the scene on record→build toggle.) + +## Keybinds (unified registry) + +Every viewport shortcut is a remappable action in `@storyteller/keybinds` +(`frontend/libs/components/keybinds`): the registry owns *which key* (preset + +user overrides, Settings → Keybinds), `engine/keymap.ts` owns *what it does* +(action id → handler), and `useViewportKeyboard` dispatches with a per-event +`KeybindContext` (sceneMode / encoding / timelineExpanded / timelineSelection / +modalTransformActive). Rules: + +- **Availability is declared, not implied.** An `ActionDef.when(ctx)` gate + decides if a binding is live; an unavailable binding falls through without + consuming the event. Default rule: available unless encoding. Two actions may + share a key ONLY if their gates are mutually exclusive (`actionsCoAvailable` + enforces this in tests and in the settings conflict UI). Examples: Space = + timeline play/pause in playback contexts, camera-view toggle otherwise; + Del/Backspace = valid timeline selection → keyframe/strip delete, else scene + object; Escape = cancel-render mid-encode, clear-selection otherwise. +- **Do NOT add raw keydown listeners for editor operations** — register an + action + handler + `when` gate instead. Capture-phase component listeners + (the old TimelineEditor delete path) are exactly the pattern this replaced. +- **Record mode** gates all scene-mutating actions off (`inBuild`); the encode + is abortable (overlay Cancel / Escape via `encodeCancelSignal`), and + Capture/Record always `enterCameraView()` first so output comes from the + render camera even after peeking at the scene view. +- Camera movement (held WASD/QE/arrows) stays in `useFreeCam`, which resolves + its codes from the same store; its imperative guards (ctrl-chords, + timeline-expanded arrows, record lock) must stay in sync with the registry's + `cameraMove`/`cameraLook` gates. + +## Behavior notes (fixes) + +- **Record mode is fully immutable.** The viewport lock (`CameraController.locked`, set by the + record effect) gates every camera-move path: FreeCam drag/wheel/keyboard (`useFreeCam`), + FreeCam integration (`tickPerFrame`), AND `MouseControls` mouse-look + `focus()` (gated via + `MouseControlsDeps.isViewportLocked`). If you add a new camera-move path, gate it on `locked`. +- **Default camera framing** (`DEFAULT_CAMERAS.main`): a Blender-style pulled-back/elevated 3/4 + view (`pos (-4.5,4,6)`, `lookAt (0,0.5,0.6)`) so the whole render-camera (`cam2`) frustum is + visible on a blank scene. +- **Auto-keyframe**: mutating an **already-keyframed** object (gizmo drag-end or inspector commit) + calls `TimelineController.autoKeyIfTracked(uuid)` → `addKeyframe` at the playhead, which + replace-or-creates a keyframe at the current scrub point. No-op for never-keyframed objects + (first keyframe is always explicit). + +## Architecture (existing, do not rebuild) + +Strict one-way data flow. Do not violate it. + +``` +Three.js engine → typed event bus → EngineStoreBridge → Zustand store → React → actions → engine methods +``` + +- **`Stage3D.tsx`** — public entry component; takes an `adapter` + optional slots/callbacks. +- **`Stage3DBody.tsx`** — layout composition (canvas, panels, toolbars, modals). Mounts the external `PromptBox3D`. +- **`PageSceneStore.ts`** — the single Zustand store (~60 fields). All UI state. The engine never imports this store. +- **`adapter.ts`** — platform-abstraction interface. All host-specific logic (HTTP, upload, auth, navigation, modals) flows through `PageSceneAdapter`. Hosts (Tauri app, web app) inject it at mount. +- **`comps/Controls3D/Controls3D.tsx`** — top-center toolbar: `+` add, Move/Rotate/Scale (`transformMode`), World/Local (`transformSpace`). +- **`comps/Outliner/Outliner.tsx`** — left "Scene" panel (code name: Outliner). Driven by `outlinerItems`; each `OutlinerRow` has lock + visibility toggles. +- **`engine/editor.ts`** — main `Editor` class; owns subsystems (GizmoController, CameraController, HistoryManager, SelectionBridge) and the prompt text (`editor.positive_prompt`). +- **Undo/redo** — `HistoryManager` + command-pattern `UndoableAction` classes. Every mutation that should be undoable records an action. + +Key boundary: the **bottom prompt bar is NOT in this library**. It is `PromptBox3D` from the external `@storyteller/ui-promptbox` package, mounted by `Stage3DBody`. Anything that changes the prompt bar crosses the pagescene ↔ ui-promptbox boundary. + +--- + +## Feature: Scene Builder (IN PROGRESS — branch `feature/scene-builder`) + +Status: **spec / in development.** This section describes intended behavior; not all of it is built yet. Images referenced are from Figma design frames. + +### Top-level mode pill (net-new) + +A segmented toggle at top-center (above the `Controls3D` toolbar) with two modes: + +- **Build** — default. Scene composition/layout. Used unless the user switches. +- **Record** — read-only playback/output mode (see below). + +Rule: a scene with **no animations/keyframes (static)** defaults to **Build**. + +This mode does not exist in code today. It needs a new store field (e.g. `sceneMode: "build" | "record"`) and a new component rendered in `Stage3DBody`. Distinct from the existing `editorState` enum (`EDIT` | `CAMERA_VIEW`), which is a different axis — don't overload it. + +### Launch re-scope — drop promptbox, lightbox handoff, editable duration + +- **Promptbox removed**: `SceneBuilderPromptBox` deleted (MCP not ready). The **animation + timeline** is the sole build-mode bottom UI: collapsed `TimelineBar` by default, expanded + `TimelineEditor` via chevron. An empty timeline is auto-created on editor init + (`editor.timelineController.create()`), so the bar is always functional (no "Add timeline" + button). Auto-expands once on load when `timelineTracks.length > 0` or + `editor.sceneHasAnimation()` (imported THREE clips). +- **Editable max duration**: `TimelineController.setDuration(s)` (clamped `[1,60]`, covers 5–30s) + + `comps/Timeline/DurationLabel.tsx` (click the total-time → number input). Persists via `getTimeline`. +- **Capture/Record → review modal (appears first) → app Lightbox**: + - `CompletionModal` opens **immediately** for both kinds (`producedArtifact`) with a **local + preview** (object URL, works offline) + upload status. Images **auto-upload** on open; videos + show a manual **Upload** button (large). On success → `adapter.openMediaLightbox(token, kind)` + (destinations) + close; on failure → **Retry** (so the modal is always visible even when the + upload API is unreachable in dev). The modal — not `RenderOverlay` — owns the upload. + - `RecordControls`: Capture → produce image `producedArtifact`; Record → encode (overlay) → + produce video `producedArtifact`. + - Adapter: `openMediaLightbox(token, kind)` (host resolves cdnUrl via `MediaFilesApi` and renders + the app ``); `uploadMedia` kept; `openImageInEditor`/`openVideoInEditor` **removed** + (the Lightbox owns destination routing — Edit-on-Canvas/Make-Video/Recreate/Share/Download). + - Uploading first means the Lightbox gets a real token + cdnUrl → its actions route correctly + (retires the earlier blob/data-URL handoff fragility). + +### Spec revision — 3D delegates generation to 2D/Video (branch `feature/scene-builder`) + +The 3D editor no longer generates. It composes; 2D (pagedraw) and the video experiences generate. + +- **Build promptbox is now the scene-builder/MCP tool only** — `comps/SceneBuilderPromptBox/` + replaced `PromptBox3D` in `Stage3DBody` (the Manual/Prompted toggle + `buildMode` store field are + gone; `PromptBox3D` is no longer mounted by 3D). Update is still an MCP stub (records prompt + + history on the engine). Hosts the collapsed `TimelineBar` + Add-animation-timeline affordance. +- **Record mode = Capture (still) / Record (timeline → video)**: + - `engine/recording/TimelineRecorder.ts` — deterministic `seekTo`→`renderScene`→`CanvasSource.add` + encode via **mediabunny** (already a dep). Capture reuses `snapShotOfCurrentFrame(false)`. + - `comps/RenderOverlay/` (opaque `LoadingDots` + progress) covers the viewport while encoding. + - Output cached locally as `producedArtifact` in the store (`{kind, blob, objectUrl, ...}`) — no + upload from 3D. +- **`comps/CompletionModal/`** — preview hub: image full-preview / video playback + **Delete** + (revokes URL), **Upload** (`adapter.uploadMedia` → library token), **Edit** → 2D for images, + Create-Video / Video-editor for videos. +- **Adapter handoff (new)** in `adapter.ts`: `openImageInEditor`, `openVideoInEditor(target)`, + `uploadMedia` + `PageSceneArtifact`. Host-wired in `apps/artcraft-webapp/.../pagescene` : + image → eager-upload + `applyEditOnCanvasFromImage` (`/edit-image`); video "generate" → + `useCreateVideoStore.setPendingRecreate` reference-video (lazy upload at generate, `/create-video`); + video "edit" → upload + `/video-editor` (TODO: auto-drop on timeline). +- **Camera-view regression fixes** (Phase 0): Esc + viewport double-click exit; double-click the + frustum to enter; robust enter/exit pose handling (removed the dead `hot_items` toggle); + frustum **pick-proxy mesh** (line raycasting disabled) so selection matches the wireframe; + `CameraStatusPill` (top-left) shows Viewport vs render-camera and toggles. + +Deferred: real MCP backend; pagedraw file-only (lazy) base image; video-editor timeline +auto-import; audio in recordings; `snapShotOfCurrentFrame` render-camera reconciliation. + +### Persistence + undo (timeline & split camera) + +- **Timeline persists in scene JSON**: `save_manager.getSceneJson` now writes `timeline: + getTimeline() ?? null` (was a `""` stub); `loadFromJson` restores via `loadTimeline` (guards + legacy `""`/null). Flows through both backend save and the unmount→cache→remount roundtrip. + Loaded objects keep their saved `object_uuid` (proxy load, `obj.uuid = json_object.object_uuid`), + so timeline tracks (keyed by uuid) resolve. +- **Render camera persists**: at save, the render-camera entry in `cameras[]` is overridden with the + **live `::CAM::` transform** (`getRenderCameraTransform` dep) so it reflects gizmo moves (the store + config otherwise goes stale). The load path strips `::CAM::` and never recreated it — fixed: + `loadFromJson` calls `recreateCameraObject()` (→ `Scene._create_camera_obj()`, now idempotent) + AFTER `CamerasReplacedEvent`, so the frustum lands at the restored transform. This also fixes the + standalone "load loses the render camera" bug. +- **Undo/redo (PER-EDIT)**: every user-facing timeline edit is ONE undo step via + `TimelineEditAction` — whole-timeline `{live, saved}` before/after snapshots, recorded through + `TimelineController.recordEdit` (discrete edits) or `beginTimelineEdit`/`commitTimelineEdit` + (continuous gestures: keyframe/strip drags coalesce at pointer-up, a Motion-popover session + commits on close). Raw dispatchers (`moveKeyframe`, `resizeClipLane`, `setKeyframeEasing`, + `setClipTransitionEasing`) are deliberately UNRECORDED live-previews — never call them for a + discrete edit without wrapping. `Save` now only moves the Cancel baseline (its undo restores + the old baseline without jumping live state); `Cancel` still reverts to last saved and is + itself undoable. `autoKeyIfTracked` bypasses recording on purpose (it rides the gizmo's + `TransformAction`). The old `SaveTimelineAction`/`RemoveClipLaneAction` classes are retired. + Render-camera gizmo moves were already undoable (`TransformAction` on `::CAM::`, no special-casing); + because save reads the live `cam_obj`, a save after an undo persists the undone position. + +### Implementation status (branch `feature/scene-builder`) + +- **DONE — Build/Record pill**: `comps/SceneModePill/` (reuses `@storyteller/ui-tab-selector`), mounted above `Controls3D` in `Stage3DBody`. Store: `sceneMode` (default `build`) + `setSceneMode`. +- **DONE — Manual/Prompted toggle + prompted layout**: store `buildMode: "manual" | "prompted"` (default `manual`) + `setBuildMode`. The toggle + prompted layout live in `PromptBox3D` (`@storyteller/ui-promptbox`), gated by a new optional `buildMode` / `onBuildModeChange` / `onAddTimeline` prop trio passed from `Stage3DBody`. Toggle = a `ButtonIconSelect` (Manual = pointer icon, Prompted = wand-sparkles) in a floating glass pill above the prompt card. Prompted layout hides the manual toolbar and shows: textarea + "Add animation timeline" (`onAddTimeline`, stubbed) + prompt-history popover (`usePrompt3DStore.promptHistory`) + **Update**. `handlePromptedUpdate` is a **stub**: records the prompt on the engine + pushes to history + toasts; it does NOT call the MCP backend yet. +- **DONE — Animation timeline (in-memory)**: keyframe system + playback + full UI. + - Data model: `engine/timeline/types.ts` (`Keyframe`/`TimelineTrack`/`TimelineData`, `EasingSpec` = cubic-bezier ctrl pts, presets) + `interpolation.ts` (`cubicBezierYForX`, `sampleTrackAt`). Reuses `TransformSnap`/`snapshotTransform`/`writeTransform`. + - `engine/editor/TimelineController.ts` owns the timeline; ticked in `editor.ts` `renderSingleFrame()` after `entranceAnimator`. **Writes transforms only while playing or on seek** (idle never touches objects, so manual editing is safe). + - Events `TimelineChangedEvent`/`TimelinePlayheadEvent` → `EngineStoreBridge` → store fields (`timelineExists/Expanded/Playhead/IsPlaying/Duration/Tracks/SelectedKeyframeId`). Dispatchers in `actions/timeline.ts`. + - Undo: `engine/editor/actions/SaveTimelineAction.ts`; `Save` records it, `Cancel` reverts to last saved. + - UI in `comps/Timeline/`: `TimelineBar` (collapsed, via promptbox `aboveStackSlot`), `TimelineEditor` (expanded, replaces the prompt box; `Stage3DBody` hides `PromptBox3D` when `timelineExpanded`), `TimelineTrackRow` (diamonds, drag, add), `MotionPopover` (presets + draggable cubic-bezier). `onAddTimeline` → `createTimeline` + expand; `showAddTimelineButton={!timelineExists}` hides the promptbox button once a timeline exists. + - **In-memory only** — not persisted to scene JSON yet (reload clears). Rotation is euler-lerped (quaternion slerp is a possible refinement). Camera track is absent until the camera-split slice creates `::CAM::`. +- **DONE — Camera split (single camera) + camera view**: the render camera is now a selectable + wireframe-frustum placeholder in the scene. + - `scene.ts` `_create_camera_obj()` rewritten to build a `THREE.Group` named `"::CAM::"` (line + frustum, layer 1 = editor-only/excluded from render), positioned at the first non-`main` + store camera; called in `initialize()`/`clear()`; `refreshCamObj` resolves it. No + `userData.media_id` → the save path (`saveToScene`, which only serializes `media_id` children) + skips it, so scenes aren't corrupted. + - Enter/exit camera view reuses the existing `CameraController.switchCameraView()` + + `tickPerFrame` sync (canvas renders through the viewport camera, which is moved to the render + camera — no render-path change). Trigger: new `CameraViewToggleRequestedEvent` → `editor.ts` + subscription → `switchCameraView()`. Emitted by (a) `scene_manager_api.ts` `double_click()` + when the selected object is `::CAM::` (covers viewport + outliner-row double-click), and + (b) `actions/cameraView.ts` `toggleCameraView` (outliner icon + exit button). + - Outliner: `OutlinerItem.isCamera` (set in `convert_object`) → `Outliner.tsx` renders a + view-from-camera button (`faArrowRightToBracket`) left of the lock icon. + - `comps/ExitCameraView/` shows the "EXIT CAMERA VIEW" pill while `editorState === CAMERA_VIEW`. +- **DONE — Record mode**: `sceneMode === "record"` is read-only playback through the render camera. + - `Stage3DBody` effect on `isRecord`: `cameraController.enterCameraView()` + `setLocked(true)` on + entry; `setLocked(false)` + `exitCameraView()` on exit. `switchCameraView()` was refactored into + idempotent `enterCameraView()`/`exitCameraView()`; new `CameraController.locked` gates the + FreeCam integration in `tickPerFrame` (viewport can't be flown in record). + - Build chrome hidden in record (ControlsTopButtons, Controls3D, top-right cluster, Outliner, + PreviewEngineCamera, ControlPanelSceneObject, PromptBox3D, TimelineEditor). The **mode pill + stays**. `ExitCameraView` is suppressed in record (the pill leaves record). + - `comps/RecordControls/`: bottom-center read-only `TimelineBar` (`readOnly` hides the expand + chevron — playback only, no editing) + **Capture** (`editor.snapShotOfCurrentFrame(true)` — still + image download) and **Record** (red; **stub** — no video pipeline in pagescene yet). +- **NOT STARTED**: timeline persistence to scene JSON; natural-language motion clips; multi-camera; + render-camera transform round-trip to store `cameras[]`; **video render behind the Record button**; + the record-mode "expand timeline into a grayed-out read-only editor" (currently the expand chevron + is simply hidden in record). + +### Feature: Mixamo animation clips on the timeline (IN PROGRESS) + +Characters can carry skeletal (Mixamo) animation clips on the timeline, alongside the transform- +keyframe tracks. Answers locked with the user: retarget onto the character's skeleton; clips + +keyframes coexist; default clip source = the 37 curated demo clips. **Playback is sequential, one +clip at a time** — a character's clips live on a **single row** and cannot overlap (see the overlap +guard below). The earlier "stacked lanes" idea was dropped: stacking only pays off for *additive +layering* (e.g. a base walk + an upper-body wave playing together), which needs per-lane weights + +bone masking and is out of scope. If layering is ever wanted, that's the feature to build; until +then one row per character is the right model. + +- **Data model (phase A, done)**: `engine/timeline/types.ts` — `ClipStrip` (`sourceMediaId`, + `startTime`, `duration`, `loop`) + `ClipLane` (`objectUuid`, `strip`); `TimelineData.clipLanes[]`. + Only the reference + placement is serialized; the `AnimationClip` is resolved at runtime. + `TimelineController` has `addClipLane` / `moveClipLane` / `removeClipLane` / `clipLanesFor`; + `TimelineChangedEvent` carries `clipLanes` → store `timelineClipLanes`. Persists via the existing + `getTimeline`/`loadTimeline` (rides `TimelineData`). +- **Playback engine (phase B, done — UNVERIFIED at runtime)**: `engine/animation/CharacterAnimationManager.ts`. + One `THREE.AnimationMixer` per character; each lane → an `AnimationAction`. Playhead-driven + + **deterministic**: on every `TimelineController.evaluate()` it sets each action's absolute `time` + from the playhead (paused actions) then `mixer.update(0)` — scrub, play, and frame-accurate record + all pose identically. `syncClipLanes()` reconciles the runtime on every clip-lane change; a + monotonic load token guards against superseded async clip loads. Clips are loaded via + `Scene.loadRawGlb(media_id)` (raw GLTF, not added to the scene) and bound **by node name** — + relies on the shared `mixorig:*` naming so a clip's tracks resolve against the character's bones + directly (direct-bind first; `SkeletonUtils.retargetClip` is the documented fallback if a rig uses + different bone names — **not yet wired**, pending the runtime spike). +- **Trigger UI (done — moved)**: the old right-docked `comps/AnimationsDrawer/` is retired. The + clip source is now the **"Animations" tab in `comps/AssetMenu/AssetModal.tsx`**: server-curated + animations (`list_featured` with `engine_category=animation`, GLB/GLTF only) REPLACE the 37 + `demoAnimationItems` when the API returns any; the demos are only the empty-API fallback. + Animation cards are **click-to-add** (earliest free slot on the selected character's row; toast + if no character is selected or the row is full) **and pointer-draggable** via the shared + `DndAsset` singleton (`ANIMATION` branch): drop on a character in the 3D scene (earliest free + slot) or on a character's timeline row (pointer-x → time via the `data-timeline-ruler` rect; + rows tag `data-clip-drop-uuid`). While dragging, the shared `DragGhost` shows a green/red + **compatibility badge** (`PageSceneStore.animationDropState`): DndAsset preloads the clip's + track node names (`loadRawGlb`, cached per media id) and checks them against the hovered + character's nodes — the same direct-bind rule `CharacterAnimationManager` plays by; no + retargeting. Incompatible or slot-less drops are rejected with a toast. A drop that beats the + clip's name-inspection fetch is **queued** and completes (fully validated) when the names + resolve — never punted back to the user (`completeAnimationDrop`; a re-drop of the SAME clip + supersedes its earlier queued drop via a per-clip token, while queued drops of other clips + complete independently). The old HTML5 DnD path (`ANIMATION_CLIP_MIME`) is removed. A full row + (`resolveFreeStart` → null) **rejects** the add instead of overlapping. +- **Standalone AnimationsModal (done)**: `comps/AssetMenu/AnimationsModal.tsx` — an + animations-only sibling of `AssetModal` (same `@storyteller/ui-modal` floating-panel props, + same `ItemElements` grid, same drag-under semantics) with All / Presets / Uploaded tabs. + Opened by the **"Add Animation" button** next to "Enter Pose Mode" (`PoseModeSelector`, + visible when a character is selected and not posing) and by the **"Animations" entry in the + Controls3D "+" popover** (not auth-gated, like "presets"), both via + `actions/openAnimationsModal.ts`. + The two library modals are **mutually exclusive** (each open action closes the other), so + `DndAsset.endDrag` and `ItemElement`'s click-add close whichever is visible (reopen-off + path). Animations data (uploads-first + featured-else-demos fallback) lives in the shared + `comps/AssetMenu/hooks/useAnimationLibrary.tsx`, consumed by both modals. + **Upload from the modal**: an "Upload animation" button (sidebar bottom, above "Reopen + after adding") plus an empty-state CTA on the Uploaded tab open the host uploader through + the same `renderAssetUploader` adapter slot AssetModal uses. The slot (and `UploadModal3D`) + gained an optional `initialCategory?: "animation" | "character"` (literal strings — the + pagescene and upload-modal `FilterEngineCategories` enums aren't cross-assignable): it + pre-checks the matching "Upload as ..." toggle and suppresses the My-Library popup on + success (the panel shows the result itself). On success the modal refetches user + animations and jumps to the Uploaded tab (only if the category stayed Animation). + Anonymous users get `promptSignup("upload-3d")` instead, same as the Controls3D entries. +- **Timeline reveal on add (done)**: a successful `addClipToCharacter` (click or drop, either + modal) sets `timelineExpanded` + `timelineRevealObjectUuid`; an effect in `TimelineEditor` + scrolls the row list to `[data-timeline-row-uuid]` (every row is tagged) then clears the + field. A store field because `TimelineEditor` is unmounted while collapsed — expand + scroll + can't happen in the caller's tick. +- **Timeline focus toggle (done)**: crosshair button in the `TimelineEditor` transport bar + (`timelineFocusSelected`, store-held so it survives the collapse/expand remount) narrows the + row list to the selected object's track. Falls back to all rows when nothing is selected (or + the selection has no outliner row), and the reveal effect switches focus off when a clip + lands on a non-selected object so the new strip is never hidden. +- **Timeline clip UI (phase C, done)**: `comps/Timeline/TimelineClipRow.tsx` renders **one row per + character** (rendered even when empty, as a drop hint) holding all that character's strips + end-to-end under its keyframe row in `TimelineEditor`. Strip body drags to **move** + (`moveClipLane`), the right edge drags to **trim** length (`resizeClipLane`), a loop chip toggles + repeat (`setClipLoop`), the × (selected strip only) removes it (`removeClipLane`, undoable — see + the selection bullet below). Clip-eligible rows are drop targets via `data-clip-drop-uuid` (see + the DnD bullet). Other clip edits (move/trim/loop) ride the timeline **Save/Cancel** session + exactly like keyframes (`cancel()` restores + re-syncs). +- **Overlap guard (single row)**: `TimelineController.resolveFreeStart` snaps add/move to the nearest + gap so a character's strips never overlap; `nextStartAfter` bounds trim (`resizeClipLane`) and + auto-length (`resolveClipDuration`) against the following clip. `evaluateAt` then has at most one + active clip at any playhead, so playback is an unambiguous sequence. +- **Runtime revalidation (loop-free)**: mixers/rest poses hold object-INSTANCE refs, but + delete→undo and in-session scene reloads recreate objects under the same uuids. Every lane + runtime lands in a TERMINAL state — bound, missing-object (`boundRoot: null`), or unbindable + (rig-less/clip-less target; one warn, no fetch) — and `CharacterAnimationManager.revalidate()` + (subscribed to `OutlinerRefreshedEvent` alongside the skeleton-helper sync) reassesses a lane + ONLY when the live top-level root instance for its uuid differs from `boundRoot` (object + appeared/vanished/replaced). One map lookup per lane per refresh; no traverses, timers, fetch + retries, or per-refresh re-adds. A uuid-resolvable root is always fully loaded (all load paths + stamp the uuid post-load), which is what makes rig-lessness a terminal verdict. Skeleton-helper `sync()` self-heals the same two cases: it purges and + recreates helpers that are orphaned (scene reloads strip children; the map survives) or whose + `helper.root` no longer matches the live object for that uuid. +- **Rest-pose in gaps** (was bind-pose): a disabled three.js action leaves the skeleton frozen on + its last frame, so `evaluateAt` resets any character with no clip under the playhead to a **rest + pose captured at mixer creation** (`captureRestPose` — local transforms of every node BELOW the + root; the root is excluded so gizmo/keyframe placement never snaps back). `Skeleton.pose()` was + abandoned: it rebuilds bone locals from inverse bind matrices and mis-scales rigs whose armature + carries a baked scale (mixamo cm-rigs), which made characters visually VANISH when a strip moved + off the playhead. `pruneMixers` also restores the rest pose before dropping a character's mixer. +- **Drag preview**: animation drags ride the same pointer-based `DndAsset` pipeline as every + other asset card, so the shared `DragGhost` (tilt card) works unchanged — plus the + compatibility badge described above. +- **Clip-row eligibility (widened)**: rows are no longer characters-only. Any **skinned** object + (creatures, rigged uploads — `OutlinerItem.hasSkeleton`, computed in `convert_object`) accepts + animation drags (bind check still gates), and any object with **baked clips** + (`OutlinerItem.bakedClips`, from `object.animations`) gets a clip row even without a skeleton. +- **Baked-in clips**: `ClipStrip.bakedClipIndex` marks a strip sourced from the object's own + `animations[]` (with `sourceMediaId: ""`); `CharacterAnimationManager.addLane` resolves it + synchronously from the model instead of `loadRawGlb`, and **CLONES the clip per lane** — + `mixer.clipAction` caches one action per (clip, root), so two strips of the same raw baked + clip would fight over a single action and `uncacheClip` on removal would kill the sibling's. Added via the **"+" picker** on the + object's clip row (`TimelineClipRow`, `addBakedClipToObject`, earliest free slot, real length + known up front so no `autoDuration`). INVARIANT: baked clips are **never removed from the THREE + model** — removing a baked strip only unschedules it (mixer uncache is mixer-state only); the + clip stays on `object.animations` and in the picker. Library-sourced strips remain fully + removable. ⚠️ Runtime-unverified: whether `object.animations` survives the save/load roundtrip + (the stash in `scene.ts` is gated on `auto_add`), and that the outliner refresh timing surfaces + `bakedClips` after async GLB loads. +- **Strip width = play window (revised)**: fresh strips default to a compact + `DEFAULT_CLIP_DURATION` (1 s) instead of adopting the clip's natural length — long clips were + eating the whole row. The strip's on-timeline width is the **authoritative play window** + (`LaneRuntime.stripDuration` in `evaluateAt`); the clip's natural length only drives the loop + modulo / final-frame clamp inside it, so trimming a strip shorter genuinely cuts playback. + Strips default to **loop: true** — dragging a strip wider than the clip keeps the motion + cycling (a walk keeps walking, per tester expectation/old-studio behavior); the loop chip opts + a strip into play-once/hold-last-frame instead. `resolveClipDuration` only SHRINKS an + `autoDuration` strip when the clip is shorter than the default. +- **Gap transitions (opt-in blending)**: `ClipStrip.transitionEasing` on the LEADING strip + (presence = enabled; mirrors keyframes storing easing "into the next") cross-fades the strip's + exit pose into the next strip's entry pose across the gap between them. `evaluateAt` enables + BOTH actions pinned at their exit/entry frames with weights `(1−w, w)` from + `cubicBezierYForX` — weights sum to 1 so the mixer computes a proper lerp; this is the one + deliberate exception to the one-winner rule, and it's continuous at both gap edges (w=0 at the + leading strip's end, w=1 at the next strip's start). Gaps without a transition keep the rest + pose; leading/trailing row gaps never blend. UI: a `data-transition-chip` button at EVERY + consecutive-strip boundary (ghost = off, solid = on) — auto-placement packs strips flush, so + enabling on a flush/too-tight boundary first calls `ensureTransitionGap` + (`DEFAULT_TRANSITION_GAP` = 0.3s: shift the next strip right, bounded by its follower/timeline + end, then trim the leading strip if shifting isn't enough; a too-packed row rejects with a + toast and mutates nothing). Click enables with `DEFAULT_EASING` and opens the generalized + `MotionPopover` (`easing`/`onChange`/`footer` props — keyframes use the same component) with a + "Remove transition" footer; popover selection rides `timelineEasingClipLaneId` — bridge-pruned + both when the lane vanishes AND when it loses its transition with the id intact (Cancel / + undo-of-Save revert the easing wholesale; an open popover would otherwise re-create it on the + next curve drag) — and the keyframe popover takes render priority so the two never coexist. + Edits ride the Save/Cancel session; serialization needs no special casing (`transitionEasing` + rides `TimelineData` through every wholesale-clone path: scene JSON save/load, Save/Cancel + snapshots, SaveTimelineAction, RemoveClipLaneAction restore). +- **Strip selection + delete UX**: strips are click-to-select + (`timelineSelectedClipLaneId` store field, `data-clip-strip` exempts the pointerdown from the + click-away deselect). The **× renders only on the selected strip** (always-visible was too easy + to hit); **Del/Backspace** removes the selected strip. Removal (either path) is **individually + undoable** via `RemoveClipLaneAction` — the one exception to "clip edits ride Save/Cancel" — + and to keep that honest it is **mirrored into the `saved` snapshot** (removeClipLane strips the + lane from `saved` too, so Cancel can't resurrect a deleted strip and Save doesn't double-record + the removal); the action captures both the live lane and its saved-snapshot entry so undo + restores both worlds exactly (`restoreClipLane(lane, savedLane?)`). +- **Rig-mismatch diagnostic**: `CharacterAnimationManager.clipBindsToCharacter` warns (console) when + a clip's tracks resolve to **0** nodes on the character — the signal that `SkeletonUtils.retargetClip` + is needed. Retarget itself is still **not wired** (direct-bind first). +- **⚠️ Runtime unknown to verify**: whether the demo clips and character rigs share `mixamorig:*` + bone names (→ direct bind works) or need retargeting. Drop/scrub a clip and watch for motion (and + the console warn) to decide whether to wire the retarget fallback. + +### ⚠️ Unverified — compiles but NOT runtime-tested + +Everything in slices 1–3 has been validated **only** by `tsc -b` (both `pagescene` and +`promptbox` exit 0). The app has **not** been launched; no visual, behavioral, lint, or test +verification has been done. Outstanding items to verify live: + +- **Slice 1 (pill)**: placement/spacing above `Controls3D` (possible double `pt-3`); white-active + styling vs Figma; that clicking actually flips `sceneMode`. +- **Slice 2 (prompted)**: Manual/Prompted toggle renders/positions correctly above the card; + prompted layout hides the toolbar and shows textbox + add-timeline + history + Update; Update + stub toasts + records history; history popover lists/restores prompts; toggle only appears when + the host wires `onBuildModeChange`. +- **Slice 3 (timeline)**: nothing behaviorally verified — playback actually interpolates objects; + scrub/seek updates transforms; add/move/delete keyframes; Save+undo / Cancel; collapsed bar + positioning via `aboveStackSlot`; expanded editor replacing the prompt box; **playhead-line + alignment** (the `LANE_LEFT=8.75rem`/`LANE_RIGHT=2.5rem` offsets are hand-computed guesses); + `MotionPopover` bezier drag coordinate math + popover anchoring; range-scrubber styling; euler + rotation lerp quality; the assumption that the render loop stays alive during playback + (`shouldRender`); "selected object gets an empty track row" behavior. + +- **Slice 4 (camera split)**: nothing runtime-verified — that the frustum appears at the render + camera and is excluded from the render; that selecting/moving it moves the render framing; + double-click (viewport + outliner row) and the outliner icon enter camera view; the aspect + frame + focal label show in camera view; EXIT returns to the prior free-cam position; the + frustum is/ isn't viewport-click-selectable (**may need `raycaster.layers.enable(1)`** in + MouseControls — outliner selection works regardless); `::CAM::` really is skipped by save. + +- **Slice 5 (record mode)**: nothing runtime-verified — that switching the pill to Record enters a + locked render-camera view (viewport truly can't be flown), hides all build chrome but keeps the + pill, and shows the read-only playback bar + Capture/Record; that Capture downloads the composed + frame; that switching back to Build restores the prior free-cam view and chrome; interaction + between record and a manually-entered camera view; whether `switchCameraView` refactor (idempotent + enter/exit) preserved the original toggle behavior. Record button is a **no-op stub**. + +Treat all of the above as needing a live pass before shipping. + +### Build mode has two usability sub-modes + +- **Manual** — identical to current behavior. User manually moves/places/transforms objects with the gizmo and toolbar. This is what exists today. +- **Prompted (Builder)** — the prompt bar changes to show only: + - a text box, + - an **"Add animation timeline"** button, + - a **history** button (previous prompts), + - an **"Update"** primary button. + + Prompted mode drives a **JSON-style, MCP-esque backend integration** (in development). The flow: an LLM (e.g. Claude) reads the scene's **scene-descriptor data** + the user's prompt, makes edits, **outputs a new scene descriptor**, which is then applied to the 3D scene. + + The **"Add animation timeline"** button only appears when the scene is **static** (no keyframes/animations on any object). Clicking it reveals the animation timeline bar (see below). + +### Animation timeline + +**Collapsed state** (a slim bar that sits above the prompt box, replacing the "Add animation timeline" button once a timeline exists): +- ▶ play/pause · current-time readout (`0:00`) · scrubber (blue fill to playhead) · total duration (`0:10`) · **chevron ▾**. +- The **chevron ▾ expands the timeline downward, collapsing the prompt box** (they trade vertical space). + +**Expanded state** (full multi-track keyframe editor): +- **Transport (top-left):** skip-to-start ⏮ · play ▶ · skip-to-end ⏭. +- **Time ruler** with a draggable **playhead** (`0:00 … 0:04 … 0:10`). +- **One track per object.** A track can hold either: + - **Diamond keyframes** — each diamond stores the object's **full transform (position, rotation, scale)** at that moment. Tapping a diamond jumps the playhead to it. Each row has an "add keyframe" diamond button at its right edge. + - **Natural-language motion clip** — a text clip spanning a time range (e.g. *"walks to car - opens door - gets in"*) that drives generated motion. + - **Any object can have either type.** For simplicity, an early version may show only raw keyframes and drop the natural-language grouping. +- **Motion popover** — appears when a keyframe is selected; edits the **easing/interpolation curve into the next keyframe**. Contains ~4 **easing presets** at top plus a large **editable bezier curve** with draggable **handles**; a **dotted line** shows the linear reference. +- **Cancel / Save** (bottom-right): + - **Cancel** — drops all changes back to the last saved timeline state. + - **Save** — commits the changes. **This is an undoable action** (record it via `HistoryManager` / an `UndoableAction`). + +### Camera model change (Blender-style) + +Introduce a distinction between: + +- **Viewport (scene) camera** — what the user flies around with; the editing view. +- **Render camera(s)** — the camera(s) that define the final render output. + +Render cameras become **objects within the 3D scene**: visible/selectable in the editor (with a camera gizmo/frustum, as in the Figma), but **excluded from the final render**. This mirrors professional 3D software (Blender). + +Render cameras appear in the **Outliner** (left "Scene" panel). A camera row shows a **"view from camera"** icon positioned **right of the camera item's name and left of the lock icon** (visible in the reference frames). Clicking it **switches the viewport camera to the selected render camera** and lets the user control it with the usual navigation keybinds. + +**This is the big architectural change** — but the engine is **already partially scaffolded** for it. Verify these anchors before building on them: + +- **Two cameras already exist** in `engine/editor/CameraController.ts`: `camera` (viewport/free-fly, sees layer 1 incl. gizmos) and `render_camera` (layer 0 only, clean output, its own aspect ratio). Created in `editor.ts` `initialize()` from the store's camera configs. +- **`Camera` type** lives in `frontend/libs/common/src/lib/interfaces/Camera.ts`: `{ id, label, focalLength, position, rotation, lookAt }`. Store seeds two: `"main"` (Main View, viewport) and `"cam2"` (Camera 2, render). So the store models multiple camera *configs*, but only **one** `render_camera` THREE object is currently instantiated (first non-main). +- **Placeholder object `"::CAM::"`** is referenced throughout (`scene.getObjectByName("::CAM::")`, `CameraController.refreshCamObj`, layer 1 so it's editor-only/excluded from render) — **but `_create_camera_obj()` is commented out** in `scene.ts`, so no camera mesh is actually in the scene graph today. The Outliner already knows to render a `::CAM::` object as a "Camera" row (`scene_manager_api.ts` `convert_object`) — it just never appears because the object isn't created. +- **`CAMERA_VIEW` state** (`enums/EditorState.ts`) + `CameraController.switchCameraView()` already implement enter/exit: on enter it copies `cam_obj` transform → viewport camera, hides `cam_obj`/objects/gizmo; on exit it restores. **Caveat:** today it *repositions the single viewport camera* rather than truly swapping to render through a separate scene camera. `PreviewEngineCamera.tsx` + an unused `camViewCanvasEl` exist as a secondary preview surface. +- **Letterbox/aspect overlay** already built: `comps/SceneContainer/Letterbox.tsx` reads `cameraAspectRatio`, draws mattes, toggled via `editorLetterBox`. `CameraAspectRatio` enum + `getRenderDimensions()` map to pixel sizes. +- **Focal length** is per-camera (`Camera.focalLength`), converted via `CameraController.focalLengthToFov()`, applied per-frame in `tickPerFrame()`; `focalLengthDragging` tracks the slider. The `35mm` overlay label maps to this. +- **Render path**: `editor.ts` `renderScene()` renders `activeScene.scene` through `render_camera`; but `snapShotOfCurrentFrame()` currently snapshots through the **viewport** `camera`, not `render_camera` — reconcile so exports use the render camera. + +**Gaps to close for the true split:** (1) actually create camera placeholder meshes as scene objects (uncomment/rework `_create_camera_obj`); (2) map `cameras: Camera[]` 1:1 to scene objects; (3) make `CAMERA_VIEW` swap which camera the viewport renders through (not just reposition one); (4) support N render cameras, not just the first non-main; (5) make cameras keyframeable timeline targets. Reconcile all of this with the existing `cameras[]` + `selectedCameraId` store state. + +### Camera view + +Entered by **double-clicking the camera placeholder in the viewport** or the **view-from-camera button in the outliner**. In this state the **viewport camera becomes the selected render camera** — the user flies it with the usual navigation keybinds, and that motion is what gets keyframed. + +- **Framing overlay**: the render **aspect frame** with **rule-of-thirds** guides; everything **outside the frame is dimmed** (won't be captured). +- **Focal-length label** (e.g. `35mm`) shown top-left inside the frame. Editable; may become a keyframable value in the future. +- The camera's frustum is not drawn while looking through it. +- **Timeline filters to just the selected camera's track** while in camera view. +- **Selected keyframe** renders as a **blue diamond** (at the playhead); other keyframes are white. +- **Exit** via the **EXIT CAMERA VIEW** button (bottom-right), or **Esc** / **double-click out**. (The text button is a dev placeholder; a proper icon comes later.) + +Camera keyframes store the camera's transform just like object keyframes (and later, potentially focal length). + +### Record mode + +Record mode is the **read-only output/preview** mode — practically **immutable**. It plays back the render timeline **as seen from the main render camera** only. + +- **All build chrome is hidden**: no outliner, no transform toolbar, no prompt box, no gizmos. +- The **viewport is locked to the render camera** (no free-fly, no object/camera editing). Framing overlay (aspect frame, dimmed exterior) is shown. +- **The only interactive controls are play/pause and scrubber position.** Nothing in the scene can be mutated. +- The **chevron can still expand the timeline**, but it renders **grayed out / read-only** — no keyframe editing. +- Two actions: + - **Capture** — export the **current frame as a still image**. + - **Record** — render the **full animation to video**. + +### Build ↔ Record relationship (summary of axes) + +- **Top pill**: `sceneMode` = `build | record` (net-new). +- **Within Build**: a usability sub-mode = `manual | prompted`. +- **Camera view** is an orthogonal viewport state (looking through a render camera) available while editing — not a top-level mode. +- Keep these distinct from the pre-existing `editorState` (`EDIT | CAMERA_VIEW`) and `poseMode` (`select | pose`) fields; do not overload them. + +### Notes / deferred + +- **JSON scene descriptor / MCP backend contract** is out of scope for the UI work — the UI and other features can be built independently. The one thing that won't function until the backend lands is the **Update button in Prompted mode** (acceptable for dev). +- The **view-from-camera icon** is already shown in the reference frames (outliner, right of the camera name, left of the lock icon) — no separate spec needed. +- **EXIT CAMERA VIEW** text button is a dev placeholder; a proper icon comes later. diff --git a/frontend/libs/components/pagescene/CLAUDE.md b/frontend/libs/components/pagescene/CLAUDE.md deleted file mode 100644 index cb27c73bd7..0000000000 --- a/frontend/libs/components/pagescene/CLAUDE.md +++ /dev/null @@ -1,513 +0,0 @@ -# CLAUDE.md — pagescene (3D Scene Editor) - -Guidance for working in the `pagescene` library — the 3D editor (a.k.a. "pagescene" / "Stage3D"). - -## ⚠️ Engine-canvas mounting invariant (footgun) - -`EngineProvider`'s editor-construction effect depends on three DOM nodes: `sceneContainer`, -`editorCanvas`, and **`camViewCanvas`** (owned by `PreviewEngineCamera` → `CameraViewCanvas`). -If ANY of these unmounts, the effect tears down + recreates the whole `Editor` (serializing to -cache, then reloading) — which wipes a fresh/unsaved scene. **Never conditionally unmount the -components that host these canvases** (`SceneContainer`, `EditorCanvas`, `PreviewEngineCamera`) -for mode/chrome gating — hide them with CSS (`hidden`) instead. (Regression fixed: record mode -had gated `PreviewEngineCamera` behind `!isRecord`, wiping the scene on record→build toggle.) - -## Keybinds (unified registry) - -Every viewport shortcut is a remappable action in `@storyteller/keybinds` -(`frontend/libs/components/keybinds`): the registry owns *which key* (preset + -user overrides, Settings → Keybinds), `engine/keymap.ts` owns *what it does* -(action id → handler), and `useViewportKeyboard` dispatches with a per-event -`KeybindContext` (sceneMode / encoding / timelineExpanded / timelineSelection / -modalTransformActive). Rules: - -- **Availability is declared, not implied.** An `ActionDef.when(ctx)` gate - decides if a binding is live; an unavailable binding falls through without - consuming the event. Default rule: available unless encoding. Two actions may - share a key ONLY if their gates are mutually exclusive (`actionsCoAvailable` - enforces this in tests and in the settings conflict UI). Examples: Space = - timeline play/pause in playback contexts, camera-view toggle otherwise; - Del/Backspace = valid timeline selection → keyframe/strip delete, else scene - object; Escape = cancel-render mid-encode, clear-selection otherwise. -- **Do NOT add raw keydown listeners for editor operations** — register an - action + handler + `when` gate instead. Capture-phase component listeners - (the old TimelineEditor delete path) are exactly the pattern this replaced. -- **Record mode** gates all scene-mutating actions off (`inBuild`); the encode - is abortable (overlay Cancel / Escape via `encodeCancelSignal`), and - Capture/Record always `enterCameraView()` first so output comes from the - render camera even after peeking at the scene view. -- Camera movement (held WASD/QE/arrows) stays in `useFreeCam`, which resolves - its codes from the same store; its imperative guards (ctrl-chords, - timeline-expanded arrows, record lock) must stay in sync with the registry's - `cameraMove`/`cameraLook` gates. - -## Behavior notes (fixes) - -- **Record mode is fully immutable.** The viewport lock (`CameraController.locked`, set by the - record effect) gates every camera-move path: FreeCam drag/wheel/keyboard (`useFreeCam`), - FreeCam integration (`tickPerFrame`), AND `MouseControls` mouse-look + `focus()` (gated via - `MouseControlsDeps.isViewportLocked`). If you add a new camera-move path, gate it on `locked`. -- **Default camera framing** (`DEFAULT_CAMERAS.main`): a Blender-style pulled-back/elevated 3/4 - view (`pos (-4.5,4,6)`, `lookAt (0,0.5,0.6)`) so the whole render-camera (`cam2`) frustum is - visible on a blank scene. -- **Auto-keyframe**: mutating an **already-keyframed** object (gizmo drag-end or inspector commit) - calls `TimelineController.autoKeyIfTracked(uuid)` → `addKeyframe` at the playhead, which - replace-or-creates a keyframe at the current scrub point. No-op for never-keyframed objects - (first keyframe is always explicit). - -## Architecture (existing, do not rebuild) - -Strict one-way data flow. Do not violate it. - -``` -Three.js engine → typed event bus → EngineStoreBridge → Zustand store → React → actions → engine methods -``` - -- **`Stage3D.tsx`** — public entry component; takes an `adapter` + optional slots/callbacks. -- **`Stage3DBody.tsx`** — layout composition (canvas, panels, toolbars, modals). Mounts the external `PromptBox3D`. -- **`PageSceneStore.ts`** — the single Zustand store (~60 fields). All UI state. The engine never imports this store. -- **`adapter.ts`** — platform-abstraction interface. All host-specific logic (HTTP, upload, auth, navigation, modals) flows through `PageSceneAdapter`. Hosts (Tauri app, web app) inject it at mount. -- **`comps/Controls3D/Controls3D.tsx`** — top-center toolbar: `+` add, Move/Rotate/Scale (`transformMode`), World/Local (`transformSpace`). -- **`comps/Outliner/Outliner.tsx`** — left "Scene" panel (code name: Outliner). Driven by `outlinerItems`; each `OutlinerRow` has lock + visibility toggles. -- **`engine/editor.ts`** — main `Editor` class; owns subsystems (GizmoController, CameraController, HistoryManager, SelectionBridge) and the prompt text (`editor.positive_prompt`). -- **Undo/redo** — `HistoryManager` + command-pattern `UndoableAction` classes. Every mutation that should be undoable records an action. - -Key boundary: the **bottom prompt bar is NOT in this library**. It is `PromptBox3D` from the external `@storyteller/ui-promptbox` package, mounted by `Stage3DBody`. Anything that changes the prompt bar crosses the pagescene ↔ ui-promptbox boundary. - ---- - -## Feature: Scene Builder (IN PROGRESS — branch `feature/scene-builder`) - -Status: **spec / in development.** This section describes intended behavior; not all of it is built yet. Images referenced are from Figma design frames. - -### Top-level mode pill (net-new) - -A segmented toggle at top-center (above the `Controls3D` toolbar) with two modes: - -- **Build** — default. Scene composition/layout. Used unless the user switches. -- **Record** — read-only playback/output mode (see below). - -Rule: a scene with **no animations/keyframes (static)** defaults to **Build**. - -This mode does not exist in code today. It needs a new store field (e.g. `sceneMode: "build" | "record"`) and a new component rendered in `Stage3DBody`. Distinct from the existing `editorState` enum (`EDIT` | `CAMERA_VIEW`), which is a different axis — don't overload it. - -### Launch re-scope — drop promptbox, lightbox handoff, editable duration - -- **Promptbox removed**: `SceneBuilderPromptBox` deleted (MCP not ready). The **animation - timeline** is the sole build-mode bottom UI: collapsed `TimelineBar` by default, expanded - `TimelineEditor` via chevron. An empty timeline is auto-created on editor init - (`editor.timelineController.create()`), so the bar is always functional (no "Add timeline" - button). Auto-expands once on load when `timelineTracks.length > 0` or - `editor.sceneHasAnimation()` (imported THREE clips). -- **Editable max duration**: `TimelineController.setDuration(s)` (clamped `[1,60]`, covers 5–30s) + - `comps/Timeline/DurationLabel.tsx` (click the total-time → number input). Persists via `getTimeline`. -- **Capture/Record → review modal (appears first) → app Lightbox**: - - `CompletionModal` opens **immediately** for both kinds (`producedArtifact`) with a **local - preview** (object URL, works offline) + upload status. Images **auto-upload** on open; videos - show a manual **Upload** button (large). On success → `adapter.openMediaLightbox(token, kind)` - (destinations) + close; on failure → **Retry** (so the modal is always visible even when the - upload API is unreachable in dev). The modal — not `RenderOverlay` — owns the upload. - - `RecordControls`: Capture → produce image `producedArtifact`; Record → encode (overlay) → - produce video `producedArtifact`. - - Adapter: `openMediaLightbox(token, kind)` (host resolves cdnUrl via `MediaFilesApi` and renders - the app ``); `uploadMedia` kept; `openImageInEditor`/`openVideoInEditor` **removed** - (the Lightbox owns destination routing — Edit-on-Canvas/Make-Video/Recreate/Share/Download). - - Uploading first means the Lightbox gets a real token + cdnUrl → its actions route correctly - (retires the earlier blob/data-URL handoff fragility). - -### Spec revision — 3D delegates generation to 2D/Video (branch `feature/scene-builder`) - -The 3D editor no longer generates. It composes; 2D (pagedraw) and the video experiences generate. - -- **Build promptbox is now the scene-builder/MCP tool only** — `comps/SceneBuilderPromptBox/` - replaced `PromptBox3D` in `Stage3DBody` (the Manual/Prompted toggle + `buildMode` store field are - gone; `PromptBox3D` is no longer mounted by 3D). Update is still an MCP stub (records prompt + - history on the engine). Hosts the collapsed `TimelineBar` + Add-animation-timeline affordance. -- **Record mode = Capture (still) / Record (timeline → video)**: - - `engine/recording/TimelineRecorder.ts` — deterministic `seekTo`→`renderScene`→`CanvasSource.add` - encode via **mediabunny** (already a dep). Capture reuses `snapShotOfCurrentFrame(false)`. - - `comps/RenderOverlay/` (opaque `LoadingDots` + progress) covers the viewport while encoding. - - Output cached locally as `producedArtifact` in the store (`{kind, blob, objectUrl, ...}`) — no - upload from 3D. -- **`comps/CompletionModal/`** — preview hub: image full-preview / video playback + **Delete** - (revokes URL), **Upload** (`adapter.uploadMedia` → library token), **Edit** → 2D for images, - Create-Video / Video-editor for videos. -- **Adapter handoff (new)** in `adapter.ts`: `openImageInEditor`, `openVideoInEditor(target)`, - `uploadMedia` + `PageSceneArtifact`. Host-wired in `apps/artcraft-webapp/.../pagescene` : - image → eager-upload + `applyEditOnCanvasFromImage` (`/edit-image`); video "generate" → - `useCreateVideoStore.setPendingRecreate` reference-video (lazy upload at generate, `/create-video`); - video "edit" → upload + `/video-editor` (TODO: auto-drop on timeline). -- **Camera-view regression fixes** (Phase 0): Esc + viewport double-click exit; double-click the - frustum to enter; robust enter/exit pose handling (removed the dead `hot_items` toggle); - frustum **pick-proxy mesh** (line raycasting disabled) so selection matches the wireframe; - `CameraStatusPill` (top-left) shows Viewport vs render-camera and toggles. - -Deferred: real MCP backend; pagedraw file-only (lazy) base image; video-editor timeline -auto-import; audio in recordings; `snapShotOfCurrentFrame` render-camera reconciliation. - -### Persistence + undo (timeline & split camera) - -- **Timeline persists in scene JSON**: `save_manager.getSceneJson` now writes `timeline: - getTimeline() ?? null` (was a `""` stub); `loadFromJson` restores via `loadTimeline` (guards - legacy `""`/null). Flows through both backend save and the unmount→cache→remount roundtrip. - Loaded objects keep their saved `object_uuid` (proxy load, `obj.uuid = json_object.object_uuid`), - so timeline tracks (keyed by uuid) resolve. -- **Render camera persists**: at save, the render-camera entry in `cameras[]` is overridden with the - **live `::CAM::` transform** (`getRenderCameraTransform` dep) so it reflects gizmo moves (the store - config otherwise goes stale). The load path strips `::CAM::` and never recreated it — fixed: - `loadFromJson` calls `recreateCameraObject()` (→ `Scene._create_camera_obj()`, now idempotent) - AFTER `CamerasReplacedEvent`, so the frustum lands at the restored transform. This also fixes the - standalone "load loses the render camera" bug. -- **Undo/redo (PER-EDIT)**: every user-facing timeline edit is ONE undo step via - `TimelineEditAction` — whole-timeline `{live, saved}` before/after snapshots, recorded through - `TimelineController.recordEdit` (discrete edits) or `beginTimelineEdit`/`commitTimelineEdit` - (continuous gestures: keyframe/strip drags coalesce at pointer-up, a Motion-popover session - commits on close). Raw dispatchers (`moveKeyframe`, `resizeClipLane`, `setKeyframeEasing`, - `setClipTransitionEasing`) are deliberately UNRECORDED live-previews — never call them for a - discrete edit without wrapping. `Save` now only moves the Cancel baseline (its undo restores - the old baseline without jumping live state); `Cancel` still reverts to last saved and is - itself undoable. `autoKeyIfTracked` bypasses recording on purpose (it rides the gizmo's - `TransformAction`). The old `SaveTimelineAction`/`RemoveClipLaneAction` classes are retired. - Render-camera gizmo moves were already undoable (`TransformAction` on `::CAM::`, no special-casing); - because save reads the live `cam_obj`, a save after an undo persists the undone position. - -### Implementation status (branch `feature/scene-builder`) - -- **DONE — Build/Record pill**: `comps/SceneModePill/` (reuses `@storyteller/ui-tab-selector`), mounted above `Controls3D` in `Stage3DBody`. Store: `sceneMode` (default `build`) + `setSceneMode`. -- **DONE — Manual/Prompted toggle + prompted layout**: store `buildMode: "manual" | "prompted"` (default `manual`) + `setBuildMode`. The toggle + prompted layout live in `PromptBox3D` (`@storyteller/ui-promptbox`), gated by a new optional `buildMode` / `onBuildModeChange` / `onAddTimeline` prop trio passed from `Stage3DBody`. Toggle = a `ButtonIconSelect` (Manual = pointer icon, Prompted = wand-sparkles) in a floating glass pill above the prompt card. Prompted layout hides the manual toolbar and shows: textarea + "Add animation timeline" (`onAddTimeline`, stubbed) + prompt-history popover (`usePrompt3DStore.promptHistory`) + **Update**. `handlePromptedUpdate` is a **stub**: records the prompt on the engine + pushes to history + toasts; it does NOT call the MCP backend yet. -- **DONE — Animation timeline (in-memory)**: keyframe system + playback + full UI. - - Data model: `engine/timeline/types.ts` (`Keyframe`/`TimelineTrack`/`TimelineData`, `EasingSpec` = cubic-bezier ctrl pts, presets) + `interpolation.ts` (`cubicBezierYForX`, `sampleTrackAt`). Reuses `TransformSnap`/`snapshotTransform`/`writeTransform`. - - `engine/editor/TimelineController.ts` owns the timeline; ticked in `editor.ts` `renderSingleFrame()` after `entranceAnimator`. **Writes transforms only while playing or on seek** (idle never touches objects, so manual editing is safe). - - Events `TimelineChangedEvent`/`TimelinePlayheadEvent` → `EngineStoreBridge` → store fields (`timelineExists/Expanded/Playhead/IsPlaying/Duration/Tracks/SelectedKeyframeId`). Dispatchers in `actions/timeline.ts`. - - Undo: `engine/editor/actions/SaveTimelineAction.ts`; `Save` records it, `Cancel` reverts to last saved. - - UI in `comps/Timeline/`: `TimelineBar` (collapsed, via promptbox `aboveStackSlot`), `TimelineEditor` (expanded, replaces the prompt box; `Stage3DBody` hides `PromptBox3D` when `timelineExpanded`), `TimelineTrackRow` (diamonds, drag, add), `MotionPopover` (presets + draggable cubic-bezier). `onAddTimeline` → `createTimeline` + expand; `showAddTimelineButton={!timelineExists}` hides the promptbox button once a timeline exists. - - **In-memory only** — not persisted to scene JSON yet (reload clears). Rotation is euler-lerped (quaternion slerp is a possible refinement). Camera track is absent until the camera-split slice creates `::CAM::`. -- **DONE — Camera split (single camera) + camera view**: the render camera is now a selectable - wireframe-frustum placeholder in the scene. - - `scene.ts` `_create_camera_obj()` rewritten to build a `THREE.Group` named `"::CAM::"` (line - frustum, layer 1 = editor-only/excluded from render), positioned at the first non-`main` - store camera; called in `initialize()`/`clear()`; `refreshCamObj` resolves it. No - `userData.media_id` → the save path (`saveToScene`, which only serializes `media_id` children) - skips it, so scenes aren't corrupted. - - Enter/exit camera view reuses the existing `CameraController.switchCameraView()` + - `tickPerFrame` sync (canvas renders through the viewport camera, which is moved to the render - camera — no render-path change). Trigger: new `CameraViewToggleRequestedEvent` → `editor.ts` - subscription → `switchCameraView()`. Emitted by (a) `scene_manager_api.ts` `double_click()` - when the selected object is `::CAM::` (covers viewport + outliner-row double-click), and - (b) `actions/cameraView.ts` `toggleCameraView` (outliner icon + exit button). - - Outliner: `OutlinerItem.isCamera` (set in `convert_object`) → `Outliner.tsx` renders a - view-from-camera button (`faArrowRightToBracket`) left of the lock icon. - - `comps/ExitCameraView/` shows the "EXIT CAMERA VIEW" pill while `editorState === CAMERA_VIEW`. -- **DONE — Record mode**: `sceneMode === "record"` is read-only playback through the render camera. - - `Stage3DBody` effect on `isRecord`: `cameraController.enterCameraView()` + `setLocked(true)` on - entry; `setLocked(false)` + `exitCameraView()` on exit. `switchCameraView()` was refactored into - idempotent `enterCameraView()`/`exitCameraView()`; new `CameraController.locked` gates the - FreeCam integration in `tickPerFrame` (viewport can't be flown in record). - - Build chrome hidden in record (ControlsTopButtons, Controls3D, top-right cluster, Outliner, - PreviewEngineCamera, ControlPanelSceneObject, PromptBox3D, TimelineEditor). The **mode pill - stays**. `ExitCameraView` is suppressed in record (the pill leaves record). - - `comps/RecordControls/`: bottom-center read-only `TimelineBar` (`readOnly` hides the expand - chevron — playback only, no editing) + **Capture** (`editor.snapShotOfCurrentFrame(true)` — still - image download) and **Record** (red; **stub** — no video pipeline in pagescene yet). -- **NOT STARTED**: timeline persistence to scene JSON; natural-language motion clips; multi-camera; - render-camera transform round-trip to store `cameras[]`; **video render behind the Record button**; - the record-mode "expand timeline into a grayed-out read-only editor" (currently the expand chevron - is simply hidden in record). - -### Feature: Mixamo animation clips on the timeline (IN PROGRESS) - -Characters can carry skeletal (Mixamo) animation clips on the timeline, alongside the transform- -keyframe tracks. Answers locked with the user: retarget onto the character's skeleton; clips + -keyframes coexist; default clip source = the 37 curated demo clips. **Playback is sequential, one -clip at a time** — a character's clips live on a **single row** and cannot overlap (see the overlap -guard below). The earlier "stacked lanes" idea was dropped: stacking only pays off for *additive -layering* (e.g. a base walk + an upper-body wave playing together), which needs per-lane weights + -bone masking and is out of scope. If layering is ever wanted, that's the feature to build; until -then one row per character is the right model. - -- **Data model (phase A, done)**: `engine/timeline/types.ts` — `ClipStrip` (`sourceMediaId`, - `startTime`, `duration`, `loop`) + `ClipLane` (`objectUuid`, `strip`); `TimelineData.clipLanes[]`. - Only the reference + placement is serialized; the `AnimationClip` is resolved at runtime. - `TimelineController` has `addClipLane` / `moveClipLane` / `removeClipLane` / `clipLanesFor`; - `TimelineChangedEvent` carries `clipLanes` → store `timelineClipLanes`. Persists via the existing - `getTimeline`/`loadTimeline` (rides `TimelineData`). -- **Playback engine (phase B, done — UNVERIFIED at runtime)**: `engine/animation/CharacterAnimationManager.ts`. - One `THREE.AnimationMixer` per character; each lane → an `AnimationAction`. Playhead-driven + - **deterministic**: on every `TimelineController.evaluate()` it sets each action's absolute `time` - from the playhead (paused actions) then `mixer.update(0)` — scrub, play, and frame-accurate record - all pose identically. `syncClipLanes()` reconciles the runtime on every clip-lane change; a - monotonic load token guards against superseded async clip loads. Clips are loaded via - `Scene.loadRawGlb(media_id)` (raw GLTF, not added to the scene) and bound **by node name** — - relies on the shared `mixorig:*` naming so a clip's tracks resolve against the character's bones - directly (direct-bind first; `SkeletonUtils.retargetClip` is the documented fallback if a rig uses - different bone names — **not yet wired**, pending the runtime spike). -- **Trigger UI (done — moved)**: the old right-docked `comps/AnimationsDrawer/` is retired. The - clip source is now the **"Animations" tab in `comps/AssetMenu/AssetModal.tsx`**: server-curated - animations (`list_featured` with `engine_category=animation`, GLB/GLTF only) REPLACE the 37 - `demoAnimationItems` when the API returns any; the demos are only the empty-API fallback. - Animation cards are **click-to-add** (earliest free slot on the selected character's row; toast - if no character is selected or the row is full) **and pointer-draggable** via the shared - `DndAsset` singleton (`ANIMATION` branch): drop on a character in the 3D scene (earliest free - slot) or on a character's timeline row (pointer-x → time via the `data-timeline-ruler` rect; - rows tag `data-clip-drop-uuid`). While dragging, the shared `DragGhost` shows a green/red - **compatibility badge** (`PageSceneStore.animationDropState`): DndAsset preloads the clip's - track node names (`loadRawGlb`, cached per media id) and checks them against the hovered - character's nodes — the same direct-bind rule `CharacterAnimationManager` plays by; no - retargeting. Incompatible or slot-less drops are rejected with a toast. A drop that beats the - clip's name-inspection fetch is **queued** and completes (fully validated) when the names - resolve — never punted back to the user (`completeAnimationDrop`; a re-drop of the SAME clip - supersedes its earlier queued drop via a per-clip token, while queued drops of other clips - complete independently). The old HTML5 DnD path (`ANIMATION_CLIP_MIME`) is removed. A full row - (`resolveFreeStart` → null) **rejects** the add instead of overlapping. -- **Standalone AnimationsModal (done)**: `comps/AssetMenu/AnimationsModal.tsx` — an - animations-only sibling of `AssetModal` (same `@storyteller/ui-modal` floating-panel props, - same `ItemElements` grid, same drag-under semantics) with All / Presets / Uploaded tabs. - Opened by the **"Add Animation" button** next to "Enter Pose Mode" (`PoseModeSelector`, - visible when a character is selected and not posing) and by the **"Animations" entry in the - Controls3D "+" popover** (not auth-gated, like "presets"), both via - `actions/openAnimationsModal.ts`. - The two library modals are **mutually exclusive** (each open action closes the other), so - `DndAsset.endDrag` and `ItemElement`'s click-add close whichever is visible (reopen-off - path). Animations data (uploads-first + featured-else-demos fallback) lives in the shared - `comps/AssetMenu/hooks/useAnimationLibrary.tsx`, consumed by both modals. - **Upload from the modal**: an "Upload animation" button (sidebar bottom, above "Reopen - after adding") plus an empty-state CTA on the Uploaded tab open the host uploader through - the same `renderAssetUploader` adapter slot AssetModal uses. The slot (and `UploadModal3D`) - gained an optional `initialCategory?: "animation" | "character"` (literal strings — the - pagescene and upload-modal `FilterEngineCategories` enums aren't cross-assignable): it - pre-checks the matching "Upload as ..." toggle and suppresses the My-Library popup on - success (the panel shows the result itself). On success the modal refetches user - animations and jumps to the Uploaded tab (only if the category stayed Animation). - Anonymous users get `promptSignup("upload-3d")` instead, same as the Controls3D entries. -- **Timeline reveal on add (done)**: a successful `addClipToCharacter` (click or drop, either - modal) sets `timelineExpanded` + `timelineRevealObjectUuid`; an effect in `TimelineEditor` - scrolls the row list to `[data-timeline-row-uuid]` (every row is tagged) then clears the - field. A store field because `TimelineEditor` is unmounted while collapsed — expand + scroll - can't happen in the caller's tick. -- **Timeline focus toggle (done)**: crosshair button in the `TimelineEditor` transport bar - (`timelineFocusSelected`, store-held so it survives the collapse/expand remount) narrows the - row list to the selected object's track. Falls back to all rows when nothing is selected (or - the selection has no outliner row), and the reveal effect switches focus off when a clip - lands on a non-selected object so the new strip is never hidden. -- **Timeline clip UI (phase C, done)**: `comps/Timeline/TimelineClipRow.tsx` renders **one row per - character** (rendered even when empty, as a drop hint) holding all that character's strips - end-to-end under its keyframe row in `TimelineEditor`. Strip body drags to **move** - (`moveClipLane`), the right edge drags to **trim** length (`resizeClipLane`), a loop chip toggles - repeat (`setClipLoop`), the × (selected strip only) removes it (`removeClipLane`, undoable — see - the selection bullet below). Clip-eligible rows are drop targets via `data-clip-drop-uuid` (see - the DnD bullet). Other clip edits (move/trim/loop) ride the timeline **Save/Cancel** session - exactly like keyframes (`cancel()` restores + re-syncs). -- **Overlap guard (single row)**: `TimelineController.resolveFreeStart` snaps add/move to the nearest - gap so a character's strips never overlap; `nextStartAfter` bounds trim (`resizeClipLane`) and - auto-length (`resolveClipDuration`) against the following clip. `evaluateAt` then has at most one - active clip at any playhead, so playback is an unambiguous sequence. -- **Runtime revalidation (loop-free)**: mixers/rest poses hold object-INSTANCE refs, but - delete→undo and in-session scene reloads recreate objects under the same uuids. Every lane - runtime lands in a TERMINAL state — bound, missing-object (`boundRoot: null`), or unbindable - (rig-less/clip-less target; one warn, no fetch) — and `CharacterAnimationManager.revalidate()` - (subscribed to `OutlinerRefreshedEvent` alongside the skeleton-helper sync) reassesses a lane - ONLY when the live top-level root instance for its uuid differs from `boundRoot` (object - appeared/vanished/replaced). One map lookup per lane per refresh; no traverses, timers, fetch - retries, or per-refresh re-adds. A uuid-resolvable root is always fully loaded (all load paths - stamp the uuid post-load), which is what makes rig-lessness a terminal verdict. Skeleton-helper `sync()` self-heals the same two cases: it purges and - recreates helpers that are orphaned (scene reloads strip children; the map survives) or whose - `helper.root` no longer matches the live object for that uuid. -- **Rest-pose in gaps** (was bind-pose): a disabled three.js action leaves the skeleton frozen on - its last frame, so `evaluateAt` resets any character with no clip under the playhead to a **rest - pose captured at mixer creation** (`captureRestPose` — local transforms of every node BELOW the - root; the root is excluded so gizmo/keyframe placement never snaps back). `Skeleton.pose()` was - abandoned: it rebuilds bone locals from inverse bind matrices and mis-scales rigs whose armature - carries a baked scale (mixamo cm-rigs), which made characters visually VANISH when a strip moved - off the playhead. `pruneMixers` also restores the rest pose before dropping a character's mixer. -- **Drag preview**: animation drags ride the same pointer-based `DndAsset` pipeline as every - other asset card, so the shared `DragGhost` (tilt card) works unchanged — plus the - compatibility badge described above. -- **Clip-row eligibility (widened)**: rows are no longer characters-only. Any **skinned** object - (creatures, rigged uploads — `OutlinerItem.hasSkeleton`, computed in `convert_object`) accepts - animation drags (bind check still gates), and any object with **baked clips** - (`OutlinerItem.bakedClips`, from `object.animations`) gets a clip row even without a skeleton. -- **Baked-in clips**: `ClipStrip.bakedClipIndex` marks a strip sourced from the object's own - `animations[]` (with `sourceMediaId: ""`); `CharacterAnimationManager.addLane` resolves it - synchronously from the model instead of `loadRawGlb`, and **CLONES the clip per lane** — - `mixer.clipAction` caches one action per (clip, root), so two strips of the same raw baked - clip would fight over a single action and `uncacheClip` on removal would kill the sibling's. Added via the **"+" picker** on the - object's clip row (`TimelineClipRow`, `addBakedClipToObject`, earliest free slot, real length - known up front so no `autoDuration`). INVARIANT: baked clips are **never removed from the THREE - model** — removing a baked strip only unschedules it (mixer uncache is mixer-state only); the - clip stays on `object.animations` and in the picker. Library-sourced strips remain fully - removable. ⚠️ Runtime-unverified: whether `object.animations` survives the save/load roundtrip - (the stash in `scene.ts` is gated on `auto_add`), and that the outliner refresh timing surfaces - `bakedClips` after async GLB loads. -- **Strip width = play window (revised)**: fresh strips default to a compact - `DEFAULT_CLIP_DURATION` (1 s) instead of adopting the clip's natural length — long clips were - eating the whole row. The strip's on-timeline width is the **authoritative play window** - (`LaneRuntime.stripDuration` in `evaluateAt`); the clip's natural length only drives the loop - modulo / final-frame clamp inside it, so trimming a strip shorter genuinely cuts playback. - Strips default to **loop: true** — dragging a strip wider than the clip keeps the motion - cycling (a walk keeps walking, per tester expectation/old-studio behavior); the loop chip opts - a strip into play-once/hold-last-frame instead. `resolveClipDuration` only SHRINKS an - `autoDuration` strip when the clip is shorter than the default. -- **Gap transitions (opt-in blending)**: `ClipStrip.transitionEasing` on the LEADING strip - (presence = enabled; mirrors keyframes storing easing "into the next") cross-fades the strip's - exit pose into the next strip's entry pose across the gap between them. `evaluateAt` enables - BOTH actions pinned at their exit/entry frames with weights `(1−w, w)` from - `cubicBezierYForX` — weights sum to 1 so the mixer computes a proper lerp; this is the one - deliberate exception to the one-winner rule, and it's continuous at both gap edges (w=0 at the - leading strip's end, w=1 at the next strip's start). Gaps without a transition keep the rest - pose; leading/trailing row gaps never blend. UI: a `data-transition-chip` button at EVERY - consecutive-strip boundary (ghost = off, solid = on) — auto-placement packs strips flush, so - enabling on a flush/too-tight boundary first calls `ensureTransitionGap` - (`DEFAULT_TRANSITION_GAP` = 0.3s: shift the next strip right, bounded by its follower/timeline - end, then trim the leading strip if shifting isn't enough; a too-packed row rejects with a - toast and mutates nothing). Click enables with `DEFAULT_EASING` and opens the generalized - `MotionPopover` (`easing`/`onChange`/`footer` props — keyframes use the same component) with a - "Remove transition" footer; popover selection rides `timelineEasingClipLaneId` — bridge-pruned - both when the lane vanishes AND when it loses its transition with the id intact (Cancel / - undo-of-Save revert the easing wholesale; an open popover would otherwise re-create it on the - next curve drag) — and the keyframe popover takes render priority so the two never coexist. - Edits ride the Save/Cancel session; serialization needs no special casing (`transitionEasing` - rides `TimelineData` through every wholesale-clone path: scene JSON save/load, Save/Cancel - snapshots, SaveTimelineAction, RemoveClipLaneAction restore). -- **Strip selection + delete UX**: strips are click-to-select - (`timelineSelectedClipLaneId` store field, `data-clip-strip` exempts the pointerdown from the - click-away deselect). The **× renders only on the selected strip** (always-visible was too easy - to hit); **Del/Backspace** removes the selected strip. Removal (either path) is **individually - undoable** via `RemoveClipLaneAction` — the one exception to "clip edits ride Save/Cancel" — - and to keep that honest it is **mirrored into the `saved` snapshot** (removeClipLane strips the - lane from `saved` too, so Cancel can't resurrect a deleted strip and Save doesn't double-record - the removal); the action captures both the live lane and its saved-snapshot entry so undo - restores both worlds exactly (`restoreClipLane(lane, savedLane?)`). -- **Rig-mismatch diagnostic**: `CharacterAnimationManager.clipBindsToCharacter` warns (console) when - a clip's tracks resolve to **0** nodes on the character — the signal that `SkeletonUtils.retargetClip` - is needed. Retarget itself is still **not wired** (direct-bind first). -- **⚠️ Runtime unknown to verify**: whether the demo clips and character rigs share `mixamorig:*` - bone names (→ direct bind works) or need retargeting. Drop/scrub a clip and watch for motion (and - the console warn) to decide whether to wire the retarget fallback. - -### ⚠️ Unverified — compiles but NOT runtime-tested - -Everything in slices 1–3 has been validated **only** by `tsc -b` (both `pagescene` and -`promptbox` exit 0). The app has **not** been launched; no visual, behavioral, lint, or test -verification has been done. Outstanding items to verify live: - -- **Slice 1 (pill)**: placement/spacing above `Controls3D` (possible double `pt-3`); white-active - styling vs Figma; that clicking actually flips `sceneMode`. -- **Slice 2 (prompted)**: Manual/Prompted toggle renders/positions correctly above the card; - prompted layout hides the toolbar and shows textbox + add-timeline + history + Update; Update - stub toasts + records history; history popover lists/restores prompts; toggle only appears when - the host wires `onBuildModeChange`. -- **Slice 3 (timeline)**: nothing behaviorally verified — playback actually interpolates objects; - scrub/seek updates transforms; add/move/delete keyframes; Save+undo / Cancel; collapsed bar - positioning via `aboveStackSlot`; expanded editor replacing the prompt box; **playhead-line - alignment** (the `LANE_LEFT=8.75rem`/`LANE_RIGHT=2.5rem` offsets are hand-computed guesses); - `MotionPopover` bezier drag coordinate math + popover anchoring; range-scrubber styling; euler - rotation lerp quality; the assumption that the render loop stays alive during playback - (`shouldRender`); "selected object gets an empty track row" behavior. - -- **Slice 4 (camera split)**: nothing runtime-verified — that the frustum appears at the render - camera and is excluded from the render; that selecting/moving it moves the render framing; - double-click (viewport + outliner row) and the outliner icon enter camera view; the aspect - frame + focal label show in camera view; EXIT returns to the prior free-cam position; the - frustum is/ isn't viewport-click-selectable (**may need `raycaster.layers.enable(1)`** in - MouseControls — outliner selection works regardless); `::CAM::` really is skipped by save. - -- **Slice 5 (record mode)**: nothing runtime-verified — that switching the pill to Record enters a - locked render-camera view (viewport truly can't be flown), hides all build chrome but keeps the - pill, and shows the read-only playback bar + Capture/Record; that Capture downloads the composed - frame; that switching back to Build restores the prior free-cam view and chrome; interaction - between record and a manually-entered camera view; whether `switchCameraView` refactor (idempotent - enter/exit) preserved the original toggle behavior. Record button is a **no-op stub**. - -Treat all of the above as needing a live pass before shipping. - -### Build mode has two usability sub-modes - -- **Manual** — identical to current behavior. User manually moves/places/transforms objects with the gizmo and toolbar. This is what exists today. -- **Prompted (Builder)** — the prompt bar changes to show only: - - a text box, - - an **"Add animation timeline"** button, - - a **history** button (previous prompts), - - an **"Update"** primary button. - - Prompted mode drives a **JSON-style, MCP-esque backend integration** (in development). The flow: an LLM (e.g. Claude) reads the scene's **scene-descriptor data** + the user's prompt, makes edits, **outputs a new scene descriptor**, which is then applied to the 3D scene. - - The **"Add animation timeline"** button only appears when the scene is **static** (no keyframes/animations on any object). Clicking it reveals the animation timeline bar (see below). - -### Animation timeline - -**Collapsed state** (a slim bar that sits above the prompt box, replacing the "Add animation timeline" button once a timeline exists): -- ▶ play/pause · current-time readout (`0:00`) · scrubber (blue fill to playhead) · total duration (`0:10`) · **chevron ▾**. -- The **chevron ▾ expands the timeline downward, collapsing the prompt box** (they trade vertical space). - -**Expanded state** (full multi-track keyframe editor): -- **Transport (top-left):** skip-to-start ⏮ · play ▶ · skip-to-end ⏭. -- **Time ruler** with a draggable **playhead** (`0:00 … 0:04 … 0:10`). -- **One track per object.** A track can hold either: - - **Diamond keyframes** — each diamond stores the object's **full transform (position, rotation, scale)** at that moment. Tapping a diamond jumps the playhead to it. Each row has an "add keyframe" diamond button at its right edge. - - **Natural-language motion clip** — a text clip spanning a time range (e.g. *"walks to car - opens door - gets in"*) that drives generated motion. - - **Any object can have either type.** For simplicity, an early version may show only raw keyframes and drop the natural-language grouping. -- **Motion popover** — appears when a keyframe is selected; edits the **easing/interpolation curve into the next keyframe**. Contains ~4 **easing presets** at top plus a large **editable bezier curve** with draggable **handles**; a **dotted line** shows the linear reference. -- **Cancel / Save** (bottom-right): - - **Cancel** — drops all changes back to the last saved timeline state. - - **Save** — commits the changes. **This is an undoable action** (record it via `HistoryManager` / an `UndoableAction`). - -### Camera model change (Blender-style) - -Introduce a distinction between: - -- **Viewport (scene) camera** — what the user flies around with; the editing view. -- **Render camera(s)** — the camera(s) that define the final render output. - -Render cameras become **objects within the 3D scene**: visible/selectable in the editor (with a camera gizmo/frustum, as in the Figma), but **excluded from the final render**. This mirrors professional 3D software (Blender). - -Render cameras appear in the **Outliner** (left "Scene" panel). A camera row shows a **"view from camera"** icon positioned **right of the camera item's name and left of the lock icon** (visible in the reference frames). Clicking it **switches the viewport camera to the selected render camera** and lets the user control it with the usual navigation keybinds. - -**This is the big architectural change** — but the engine is **already partially scaffolded** for it. Verify these anchors before building on them: - -- **Two cameras already exist** in `engine/editor/CameraController.ts`: `camera` (viewport/free-fly, sees layer 1 incl. gizmos) and `render_camera` (layer 0 only, clean output, its own aspect ratio). Created in `editor.ts` `initialize()` from the store's camera configs. -- **`Camera` type** lives in `frontend/libs/common/src/lib/interfaces/Camera.ts`: `{ id, label, focalLength, position, rotation, lookAt }`. Store seeds two: `"main"` (Main View, viewport) and `"cam2"` (Camera 2, render). So the store models multiple camera *configs*, but only **one** `render_camera` THREE object is currently instantiated (first non-main). -- **Placeholder object `"::CAM::"`** is referenced throughout (`scene.getObjectByName("::CAM::")`, `CameraController.refreshCamObj`, layer 1 so it's editor-only/excluded from render) — **but `_create_camera_obj()` is commented out** in `scene.ts`, so no camera mesh is actually in the scene graph today. The Outliner already knows to render a `::CAM::` object as a "Camera" row (`scene_manager_api.ts` `convert_object`) — it just never appears because the object isn't created. -- **`CAMERA_VIEW` state** (`enums/EditorState.ts`) + `CameraController.switchCameraView()` already implement enter/exit: on enter it copies `cam_obj` transform → viewport camera, hides `cam_obj`/objects/gizmo; on exit it restores. **Caveat:** today it *repositions the single viewport camera* rather than truly swapping to render through a separate scene camera. `PreviewEngineCamera.tsx` + an unused `camViewCanvasEl` exist as a secondary preview surface. -- **Letterbox/aspect overlay** already built: `comps/SceneContainer/Letterbox.tsx` reads `cameraAspectRatio`, draws mattes, toggled via `editorLetterBox`. `CameraAspectRatio` enum + `getRenderDimensions()` map to pixel sizes. -- **Focal length** is per-camera (`Camera.focalLength`), converted via `CameraController.focalLengthToFov()`, applied per-frame in `tickPerFrame()`; `focalLengthDragging` tracks the slider. The `35mm` overlay label maps to this. -- **Render path**: `editor.ts` `renderScene()` renders `activeScene.scene` through `render_camera`; but `snapShotOfCurrentFrame()` currently snapshots through the **viewport** `camera`, not `render_camera` — reconcile so exports use the render camera. - -**Gaps to close for the true split:** (1) actually create camera placeholder meshes as scene objects (uncomment/rework `_create_camera_obj`); (2) map `cameras: Camera[]` 1:1 to scene objects; (3) make `CAMERA_VIEW` swap which camera the viewport renders through (not just reposition one); (4) support N render cameras, not just the first non-main; (5) make cameras keyframeable timeline targets. Reconcile all of this with the existing `cameras[]` + `selectedCameraId` store state. - -### Camera view - -Entered by **double-clicking the camera placeholder in the viewport** or the **view-from-camera button in the outliner**. In this state the **viewport camera becomes the selected render camera** — the user flies it with the usual navigation keybinds, and that motion is what gets keyframed. - -- **Framing overlay**: the render **aspect frame** with **rule-of-thirds** guides; everything **outside the frame is dimmed** (won't be captured). -- **Focal-length label** (e.g. `35mm`) shown top-left inside the frame. Editable; may become a keyframable value in the future. -- The camera's frustum is not drawn while looking through it. -- **Timeline filters to just the selected camera's track** while in camera view. -- **Selected keyframe** renders as a **blue diamond** (at the playhead); other keyframes are white. -- **Exit** via the **EXIT CAMERA VIEW** button (bottom-right), or **Esc** / **double-click out**. (The text button is a dev placeholder; a proper icon comes later.) - -Camera keyframes store the camera's transform just like object keyframes (and later, potentially focal length). - -### Record mode - -Record mode is the **read-only output/preview** mode — practically **immutable**. It plays back the render timeline **as seen from the main render camera** only. - -- **All build chrome is hidden**: no outliner, no transform toolbar, no prompt box, no gizmos. -- The **viewport is locked to the render camera** (no free-fly, no object/camera editing). Framing overlay (aspect frame, dimmed exterior) is shown. -- **The only interactive controls are play/pause and scrubber position.** Nothing in the scene can be mutated. -- The **chevron can still expand the timeline**, but it renders **grayed out / read-only** — no keyframe editing. -- Two actions: - - **Capture** — export the **current frame as a still image**. - - **Record** — render the **full animation to video**. - -### Build ↔ Record relationship (summary of axes) - -- **Top pill**: `sceneMode` = `build | record` (net-new). -- **Within Build**: a usability sub-mode = `manual | prompted`. -- **Camera view** is an orthogonal viewport state (looking through a render camera) available while editing — not a top-level mode. -- Keep these distinct from the pre-existing `editorState` (`EDIT | CAMERA_VIEW`) and `poseMode` (`select | pose`) fields; do not overload them. - -### Notes / deferred - -- **JSON scene descriptor / MCP backend contract** is out of scope for the UI work — the UI and other features can be built independently. The one thing that won't function until the backend lands is the **Update button in Prompted mode** (acceptable for dev). -- The **view-from-camera icon** is already shown in the reference frames (outliner, right of the camera name, left of the lock icon) — no separate spec needed. -- **EXIT CAMERA VIEW** text button is a dev placeholder; a proper icon comes later. diff --git a/frontend/libs/components/pagescene/CLAUDE.md b/frontend/libs/components/pagescene/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/frontend/libs/components/pagescene/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 2fd5b13e1b..bec09d9f6e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -361,6 +361,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "nanoid": "^3.3.12", "picocolors": "^1.1.1", @@ -376,6 +377,7 @@ "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -855,6 +857,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", @@ -2649,6 +2652,7 @@ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", "license": "MIT", + "peer": true, "engines": { "node": ">=6.9.0" } @@ -2725,6 +2729,7 @@ "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz", "integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==", "license": "MIT", + "peer": true, "dependencies": { "@dnd-kit/accessibility": "^3.1.1", "@dnd-kit/utilities": "^3.2.2", @@ -2866,6 +2871,7 @@ "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.0.tgz", "integrity": "sha512-l9Oo58x0HOP5znGzVhYW9U3e5wVuA4LAZU2AGezTmkhO1CgQRFDhDg4nneHsu/t3WniXg9QrG2nIXL/ZS8ln8Q==", "license": "MIT", + "peer": true, "dependencies": { "@emnapi/wasi-threads": "1.2.2", "tslib": "^2.4.0" @@ -2876,6 +2882,7 @@ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.0.tgz", "integrity": "sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg==", "license": "MIT", + "peer": true, "dependencies": { "tslib": "^2.4.0" } @@ -2901,6 +2908,7 @@ "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.4.0.tgz", "integrity": "sha512-QgD4fyscGcbbKwJmqNvUMSE02OsHUa+lAWKdEUIJKgqe5IwRSKd7+KhibEWdaKwgjLj0DRSHA9biAIqGBk05lw==", "license": "MIT", + "peer": true, "dependencies": { "@emotion/memoize": "^0.9.0" } @@ -3773,7 +3781,6 @@ "resolved": "https://registry.npmjs.org/@isaacs/ttlcache/-/ttlcache-1.4.1.tgz", "integrity": "sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA==", "license": "ISC", - "peer": true, "engines": { "node": ">=12" } @@ -3818,6 +3825,7 @@ "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "license": "MIT", + "peer": true, "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", @@ -5293,6 +5301,7 @@ "integrity": "sha512-pYUNvaQQBEwP66TLrjmmfkDIrTmPnX0kK86HgClkWLQKkX/oCgnqDxEgNbjeCc75dwUvZP6fW2d0pZ5++XILTw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@module-federation/runtime": "2.5.1", "@module-federation/webpack-bundler-runtime": "2.5.1" @@ -5470,6 +5479,7 @@ "integrity": "sha512-kzFn3ObUeBp5vaEtN1WMxhTYBuYEErxugu1RzFUERD21X3BZ+b4cWwdFJuBDlsmVjctIg/QSOoZoPXRKAO0foA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@module-federation/runtime": "0.15.0", "@module-federation/webpack-bundler-runtime": "0.15.0" @@ -5569,6 +5579,7 @@ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", "license": "MIT", + "peer": true, "engines": { "node": "^14.21.3 || >=16" }, @@ -7943,7 +7954,6 @@ "resolved": "https://registry.npmjs.org/@react-native/assets-registry/-/assets-registry-0.86.0.tgz", "integrity": "sha512-nIaXbm2jX1OTYp0qbviJ3O6KZivoE8z3BnhUQ2LsqfZSWRoOK/n1qsiAr6oALiNKWnXY3j2KPwtYORnZzp8xew==", "license": "MIT", - "peer": true, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } @@ -7953,7 +7963,6 @@ "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.86.0.tgz", "integrity": "sha512-uTs9DBo3+/lUqinsGZK0FKJRBVClrwMXoZToaDxE1Q2SL2e55vs2GwyZfIKzPl5uJnbu4PfFMIp0/mLXLWUMuA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "^7.25.2", "@babel/parser": "^7.29.0", @@ -7975,7 +7984,6 @@ "resolved": "https://registry.npmjs.org/@react-native/community-cli-plugin/-/community-cli-plugin-0.86.0.tgz", "integrity": "sha512-Jv8p1ebEPfTzs8gmrjsdT2XMXFfeAg45Pman+XPLFGaSeGAZkutRFRyX9Cs9aGTSOyIA9YPJ6vDNb1ayTf1FKQ==", "license": "MIT", - "peer": true, "dependencies": { "@react-native/dev-middleware": "0.86.0", "debug": "^4.4.0", @@ -8006,7 +8014,6 @@ "resolved": "https://registry.npmjs.org/@react-native/debugger-frontend/-/debugger-frontend-0.86.0.tgz", "integrity": "sha512-7Mb3nDfyJeys+ELF75Ageu7VKERlnIMoO+aNPoXqTXvz+b41L6l2CqMyLpDHxkBSlenij6gEepPNgaIyWHbJZw==", "license": "BSD-3-Clause", - "peer": true, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } @@ -8016,7 +8023,6 @@ "resolved": "https://registry.npmjs.org/@react-native/debugger-shell/-/debugger-shell-0.86.0.tgz", "integrity": "sha512-Y0zEkZzLz8ou6o/VLml1A31X/rMgc6DRjwxwzPMa94qRTMY070WeBCNTITQo4kKTBAUgbxh07oXPQqp0Tpja8w==", "license": "MIT", - "peer": true, "dependencies": { "cross-spawn": "^7.0.6", "debug": "^4.4.0", @@ -8031,7 +8037,6 @@ "resolved": "https://registry.npmjs.org/@react-native/dev-middleware/-/dev-middleware-0.86.0.tgz", "integrity": "sha512-20pTO6yTybmvXvro520H6C7jydIQnLKOl5qFtVEcHSdFrY63r3OGei+Rx9bILgSRmH6jgnfEcijcMx7pwWuQtw==", "license": "MIT", - "peer": true, "dependencies": { "@isaacs/ttlcache": "^1.4.1", "@react-native/debugger-frontend": "0.86.0", @@ -8055,7 +8060,6 @@ "resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz", "integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==", "license": "MIT", - "peer": true, "dependencies": { "is-docker": "^2.0.0", "is-wsl": "^2.1.1" @@ -8072,7 +8076,6 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "license": "MIT", - "peer": true, "engines": { "node": ">=8.3.0" }, @@ -8094,7 +8097,6 @@ "resolved": "https://registry.npmjs.org/@react-native/gradle-plugin/-/gradle-plugin-0.86.0.tgz", "integrity": "sha512-a1RcfaEDqWExCGfCwadIxt4l8FvKYgFqeMf2uzeKyAOnb+vTGNIeCvifFL2MqvgaeYxlER437HbMIajGcuJ1pQ==", "license": "MIT", - "peer": true, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } @@ -8104,7 +8106,6 @@ "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.86.0.tgz", "integrity": "sha512-zYy/Cjd1VTnZ2iCNaG9bDF9C3l2ntESiPRscjIlI5FKugu6aeTwsDSv1aI8Bc4Kp3vEdoVg+UQhLAhE4svREaQ==", "license": "MIT", - "peer": true, "engines": { "node": "^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0" } @@ -8113,8 +8114,7 @@ "version": "0.86.0", "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.86.0.tgz", "integrity": "sha512-kG0wfCGghUKlfxkJyyHCDVutWVYWK7/DG58ojA/4v9EfulgF+osuSQmlbNb3rcKX58qutm7JcldSeVLgGFha9g==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@react-oauth/google": { "version": "0.13.5", @@ -8253,6 +8253,7 @@ "integrity": "sha512-yEDrKcIICHnaJdUOdBAXQTNXoehB0J3FBcZr4CnK6Alic6cVJGGBGMtJdIO7DUwNySwoYvkUTS3qnXuk2zGYZA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.21.8", "@babel/generator": "^7.21.5", @@ -9045,6 +9046,7 @@ "resolved": "https://registry.npmjs.org/@remix-run/server-runtime/-/server-runtime-2.17.5.tgz", "integrity": "sha512-SyJ5n2pQyo4ERGvjjLvL2PpRWBzlC2qzO5KkkOE2ygOiNcgOu9WQnnom9GI8KgsTRCO8JnIeLHFRcmxZnVBjfw==", "license": "MIT", + "peer": true, "dependencies": { "@remix-run/router": "1.23.3", "@types/cookie": "^0.6.0", @@ -9667,6 +9669,7 @@ "integrity": "sha512-rsD9b+Khmot5DwCMiB3cqTQo53ioPG3M/A7BySu8+0+RS7GCxKm+Z+mtsjtG/vsu4Tn2tcqCdZtA3pgLoJB+ew==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@module-federation/runtime-tools": "0.22.0", "@rspack/binding": "1.7.11", @@ -10400,6 +10403,7 @@ "integrity": "sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/core": "^7.21.3", "@svgr/babel-preset": "8.1.0", @@ -10582,6 +10586,7 @@ "devOptional": true, "hasInstallScript": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@swc/counter": "^0.1.3", "@swc/types": "^0.1.8" @@ -10830,6 +10835,7 @@ "integrity": "sha512-lyMwd7WGgG79RS7EERZV3T8wMdmPq3xwyg+1nmAM64kIhx5yl+juO2PYIHb7vTiPgPCj8LYjsNV2T5wiQHUEaw==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@swc/counter": "^0.1.3" } @@ -11188,6 +11194,7 @@ "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -11670,6 +11677,7 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.42.tgz", "integrity": "sha512-5L7SUaFC1RyDraj2yRhyBzHTobyXHmohD100CChNtyPyleoq37Mqab5Gn8XEKI04dfN/oqPdpHk38MgcQWHbZg==", "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~6.21.0" } @@ -11692,6 +11700,7 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.0.tgz", "integrity": "sha512-MY3oPudxvMYyesqs/kW1Bh8y9VqSmf+tzqw3ae8a9DZW68pUe3zAdHeI1jc6iAysuRdACnVknHP8AhwD4/dxtg==", "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.0.2" } @@ -12028,6 +12037,7 @@ "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "7.18.0", "@typescript-eslint/types": "7.18.0", @@ -14299,6 +14309,7 @@ "resolved": "https://registry.npmjs.org/@zkochan/js-yaml/-/js-yaml-0.0.7.tgz", "integrity": "sha512-nrUSn7hzt7J6JWgWGz78ZYI8wj+gdIJdk0Ynjpp8l+trkn58Uqsf6RYrYkEK+3X18EX+TNdtJI0WxAtc+L84SQ==", "license": "MIT", + "peer": true, "dependencies": { "argparse": "^2.0.1" }, @@ -14360,6 +14371,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -14441,6 +14453,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -14514,8 +14527,7 @@ "version": "1.4.10", "resolved": "https://registry.npmjs.org/anser/-/anser-1.4.10.tgz", "integrity": "sha512-hCv9AqTQ8ycjpSd3upOJd7vFwW1JaoYQ7tpham03GJ1ca8/65rqn0RpaWpItOAd6ylW9wAw6luXYPJIyPFVOww==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/ansi-colors": { "version": "4.1.3", @@ -14800,8 +14812,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/assertion-error": { "version": "2.0.1", @@ -15104,7 +15115,6 @@ "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.36.0.tgz", "integrity": "sha512-LhD0xdoedDw7ansQgXbB2DADLZIK/LRXuWNBPuVzMc5S2WK5GyT89tCM+cQzxFGO0mGyLK6D5TrVOJJzAoDy8Q==", "license": "MIT", - "peer": true, "dependencies": { "hermes-parser": "0.36.0" } @@ -15327,6 +15337,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.10.12", "caniuse-lite": "^1.0.30001782", @@ -15359,7 +15370,6 @@ "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", "license": "Apache-2.0", - "peer": true, "dependencies": { "node-int64": "^0.4.0" } @@ -15762,7 +15772,6 @@ "resolved": "https://registry.npmjs.org/chrome-launcher/-/chrome-launcher-0.15.2.tgz", "integrity": "sha512-zdLEwNo3aUVzIhKhTtXfxhdvZhUghrnmkvcAq2NoDd+LeOHKf03H5jwZ8T/STsAlzyALkBVK552iaG1fGf1xVQ==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@types/node": "*", "escape-string-regexp": "^4.0.0", @@ -15791,7 +15800,6 @@ "resolved": "https://registry.npmjs.org/chromium-edge-launcher/-/chromium-edge-launcher-0.3.0.tgz", "integrity": "sha512-p03azHlGjtyRvFEee3cyvtsRYdniSkwjkzmM/KmVnqT5d7QkkwpJBhis/zCLMYdQMVJ5tt140TBNqqrZPaWeFA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@types/node": "*", "escape-string-regexp": "^4.0.0", @@ -16195,7 +16203,6 @@ "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", "license": "MIT", - "peer": true, "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.2", @@ -16211,7 +16218,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", - "peer": true, "dependencies": { "ms": "2.0.0" } @@ -16221,7 +16227,6 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "license": "MIT", - "peer": true, "engines": { "node": ">= 0.8" } @@ -16231,7 +16236,6 @@ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "license": "MIT", - "peer": true, "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -16249,15 +16253,13 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/connect/node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", "license": "MIT", - "peer": true, "dependencies": { "ee-first": "1.1.1" }, @@ -16270,7 +16272,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "license": "MIT", - "peer": true, "engines": { "node": ">= 0.6" } @@ -16606,7 +16607,8 @@ "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/culori": { "version": "4.0.2", @@ -17329,7 +17331,8 @@ "version": "8.6.0", "resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.6.0.tgz", "integrity": "sha512-SjWyZBHJPbqxHOzckOfo8lHisEaJWmwd23XppYFYVh10bU66/Pn5tkVkbkCMZVdbUE5eTCI2nD8OyIP4Z+uwkA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/embla-carousel-react": { "version": "8.6.0", @@ -17385,6 +17388,7 @@ "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "iconv-lite": "^0.6.2" } @@ -17492,7 +17496,6 @@ "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", "license": "MIT", - "peer": true, "dependencies": { "stackframe": "^1.3.4" } @@ -17704,6 +17707,7 @@ "dev": true, "hasInstallScript": true, "license": "MIT", + "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -18128,6 +18132,7 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -18184,6 +18189,7 @@ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", "dev": true, "license": "MIT", + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -18309,6 +18315,7 @@ "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.8", @@ -19052,14 +19059,14 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==", - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/express": { "version": "4.22.2", "resolved": "https://registry.npmjs.org/express/-/express-4.22.2.tgz", "integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==", "license": "MIT", + "peer": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -19234,7 +19241,6 @@ "resolved": "https://registry.npmjs.org/fb-dotslash/-/fb-dotslash-0.5.8.tgz", "integrity": "sha512-XHYLKk9J4BupDxi9bSEhkfss0m+Vr9ChTrjhf9l2iw3jB5C7BnY4GVPoMcqbrTutsKJso6yj2nAB6BI/F2oZaA==", "license": "(MIT OR Apache-2.0)", - "peer": true, "bin": { "dotslash": "bin/dotslash" }, @@ -19247,7 +19253,6 @@ "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "bser": "2.1.1" } @@ -19362,6 +19367,7 @@ "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -19555,8 +19561,7 @@ "version": "0.0.6", "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz", "integrity": "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/follow-redirects": { "version": "1.16.0", @@ -20414,22 +20419,19 @@ "version": "250829098.0.14", "resolved": "https://registry.npmjs.org/hermes-compiler/-/hermes-compiler-250829098.0.14.tgz", "integrity": "sha512-5meXwsZxgiqFaJjNzwjzI9IyUkuGGBisu+z9BvQWmGVpjH6nz11hgqkyxe4dl8UAdyIV4lTbz91+Dlnjz0VxqA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/hermes-estree": { "version": "0.36.0", "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.36.0.tgz", "integrity": "sha512-A1+8zn5oss2CFP7pKsOaxorQG6FNIz1WU1VDqruLPPZl3LVgeE2C5xfFg8Ow6/Ow4mSslLLtYP1J3n38eKyW9w==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/hermes-parser": { "version": "0.36.0", "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.36.0.tgz", "integrity": "sha512-GdpwMmH5x6IpC1cijvcvYnlPB60Mh6kTSF/NFdYV/j56gYdi+0RIakYs+eqOV+bbO0SW7mgVVGSsTJxyPQfo3w==", "license": "MIT", - "peer": true, "dependencies": { "hermes-estree": "0.36.0" } @@ -20452,6 +20454,7 @@ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.24.tgz", "integrity": "sha512-I36D1s+HgQc55KbhEr4iybfxv/9o1zdpw+XEM6dJa91LqQD0HCoSGdxpRJCZE+aavs87j4V3Ls2OJzq8C/U4iw==", "license": "MIT", + "peer": true, "engines": { "node": ">=16.9.0" } @@ -20768,7 +20771,6 @@ "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz", "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==", "license": "MIT", - "peer": true, "dependencies": { "queue": "6.0.2" }, @@ -21950,6 +21952,7 @@ "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "license": "MIT", + "peer": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -21979,7 +21982,6 @@ "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "license": "MIT", - "peer": true, "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", @@ -21997,7 +21999,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -22010,7 +22011,6 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "license": "MIT", - "peer": true, "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -22024,15 +22024,13 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/jest-worker": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "license": "MIT", - "peer": true, "dependencies": { "@types/node": "*", "jest-util": "^29.7.0", @@ -22048,7 +22046,6 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "license": "MIT", - "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -22117,8 +22114,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/jsdom": { "version": "22.1.0", @@ -22126,6 +22122,7 @@ "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "abab": "^2.0.6", "cssstyle": "^3.0.0", @@ -22484,7 +22481,8 @@ "url": "https://github.com/sponsors/lavrton" } ], - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/language-subtag-registry": { "version": "0.3.23", @@ -22542,7 +22540,6 @@ "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -22574,7 +22571,6 @@ "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.4.2.tgz", "integrity": "sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g==", "license": "Apache-2.0", - "peer": true, "dependencies": { "debug": "^2.6.9", "marky": "^1.2.2" @@ -22585,7 +22581,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", - "peer": true, "dependencies": { "ms": "2.0.0" } @@ -22594,14 +22589,14 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/lightningcss": { "version": "1.32.0", "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", "license": "MPL-2.0", + "peer": true, "dependencies": { "detect-libc": "^2.0.3" }, @@ -23280,8 +23275,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", @@ -23604,7 +23598,6 @@ "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", "license": "BSD-3-Clause", - "peer": true, "dependencies": { "tmpl": "1.0.5" } @@ -23623,8 +23616,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/marky/-/marky-1.3.0.tgz", "integrity": "sha512-ocnPZQLNpvbedwTy9kNrQEsknEfgvcLMvOtz3sFeWApDq1MXH1TqkCIx58xlpESsfwQOnuBO9beyQuNGzVvuhQ==", - "license": "Apache-2.0", - "peer": true + "license": "Apache-2.0" }, "node_modules/math-intrinsics": { "version": "1.1.0", @@ -23890,8 +23882,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/merge-descriptors": { "version": "1.0.3", @@ -23938,7 +23929,6 @@ "resolved": "https://registry.npmjs.org/metro/-/metro-0.84.4.tgz", "integrity": "sha512-8ETTubqfD6ornDy2zYDvRcKnVDOXdFJsjetYDBsY4oAsb6NJkiwFR+FaMESyGppFmQUyBQA4H4sFGxzcQSGtFA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/core": "^7.25.2", @@ -23992,7 +23982,6 @@ "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.84.4.tgz", "integrity": "sha512-rvCfz8snl9h20VcvpOHxZuHP1SlAkv4HXbzw7nyyVwu6Eqo5PRerbakQ9XmUCOsRy70spJ37O+G1TK8oMzo48g==", "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "^7.25.2", "flow-enums-runtime": "^0.0.6", @@ -24008,15 +23997,13 @@ "version": "0.35.0", "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.35.0.tgz", "integrity": "sha512-xVx5Opwy8Oo1I5yGpVRhCvWL/iV3M+ylksSKVNlxxD90cpDpR/AR1jLYqK8HWihm065a6UI3HeyAmYzwS8NOOg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/metro-babel-transformer/node_modules/hermes-parser": { "version": "0.35.0", "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.35.0.tgz", "integrity": "sha512-9JLjeHxBx8T4CAsydZR49PNZUaix+WpQJwu9p2010lu+7Kwl6D/7wYFFJxoz+aXkaaClp9Zfg6W6/zVlSJORaA==", "license": "MIT", - "peer": true, "dependencies": { "hermes-estree": "0.35.0" } @@ -24026,7 +24013,6 @@ "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.84.4.tgz", "integrity": "sha512-gpcFQdSLUwUCk71saKoE64jLFbx2nwTfVCcPSULMNT8QYq0p1eZZE29Jvd0HtT/UlhC3ZOutLxJME5xqD2JUZg==", "license": "MIT", - "peer": true, "dependencies": { "exponential-backoff": "^3.1.1", "flow-enums-runtime": "^0.0.6", @@ -24042,7 +24028,6 @@ "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.84.4.tgz", "integrity": "sha512-wVO79aGrkYImpnaVS4+d5RrRBRPX31QtvKB3wKGBuiNSznduZTQHzsrJZRroFJSwnygrzdsGUtDQPuqqFjFdvw==", "license": "MIT", - "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6" }, @@ -24055,7 +24040,6 @@ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", "license": "MIT", - "peer": true, "engines": { "node": ">= 14" } @@ -24065,7 +24049,6 @@ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "license": "MIT", - "peer": true, "dependencies": { "agent-base": "^7.1.2", "debug": "4" @@ -24079,7 +24062,6 @@ "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.84.4.tgz", "integrity": "sha512-PMotGDjXcXLWo2TMRH+VR99phFNgYTwqh4OoieIKK3yTJa1Jmkl+fZJxDO0jfBvNF+WESHciHvpNuBtXaF3B0Q==", "license": "MIT", - "peer": true, "dependencies": { "connect": "^3.6.5", "flow-enums-runtime": "^0.0.6", @@ -24099,7 +24081,6 @@ "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.84.4.tgz", "integrity": "sha512-HONpWC5LGXZn3ffkd4Hu6AIrfE7j4Z0g0wMo/goV24WOB3lhuFZ40KgvaDiSw8iyQHloMYay5N/wPX+z8oN/PQ==", "license": "MIT", - "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6", "lodash.throttle": "^4.1.1", @@ -24114,7 +24095,6 @@ "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.84.4.tgz", "integrity": "sha512-KSVDi/u60hKPx++NLu3MTIvyjzNoJnFAF8PQFxaj1jiSka/wjw+Ua6sNuJ0TDHQv+7AAoFQxeMgaRAe8Yic5wQ==", "license": "MIT", - "peer": true, "dependencies": { "debug": "^4.4.0", "fb-watchman": "^2.0.0", @@ -24135,7 +24115,6 @@ "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.84.4.tgz", "integrity": "sha512-5qpbaVOMC7CPitIpuewzVeGw7E+C3ykbv2mqTjQLl85Z3annSVGlSCTcsZjqXZzjupfK4Ztj3dDc4kc44NZwtQ==", "license": "MIT", - "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6", "terser": "^5.15.0" @@ -24149,7 +24128,6 @@ "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.84.4.tgz", "integrity": "sha512-1qLgbxQ5ZGhhutuPot1Yp348ofDsATL2WkrHF65TobqTT9K3P9qJXw38bomk7ncp5B7OYMfWwtyBZo1lCV792A==", "license": "MIT", - "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6" }, @@ -24162,7 +24140,6 @@ "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.84.4.tgz", "integrity": "sha512-Jibypds4g7AhzdRKY+kDoj51s5EXMwgyp5ddtlreDAsWefMdOx+agWqgm0H2XSZ/ueanHHVM89fnf5OJnlxa8Q==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.25.0", "flow-enums-runtime": "^0.0.6" @@ -24176,7 +24153,6 @@ "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.84.4.tgz", "integrity": "sha512-jbWkPxIesVuo1IWkvezmMJld6iu8nD62GsrZiV6jP37AOdbo4OBq1FJ+qkOg8sV05wAHB//jAbziuW0SlJfW4g==", "license": "MIT", - "peer": true, "dependencies": { "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", @@ -24197,7 +24173,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "license": "BSD-3-Clause", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -24207,7 +24182,6 @@ "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.84.4.tgz", "integrity": "sha512-OnfpacxUqGPZQ27t8qK9mFa7uqHIlVWeqRqkCbvMvreEBiamEeOn8krKtcwgP5M4cYDPwuSmCTopHMVthqG4zA==", "license": "MIT", - "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6", "invariant": "^2.2.4", @@ -24228,7 +24202,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "license": "BSD-3-Clause", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -24238,7 +24211,6 @@ "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.84.4.tgz", "integrity": "sha512-kehr6HbAecqD0/a3xLXobELdPaAmRAl8bel0qagPF4vhZtux93nS8S4eq2kgKt6J2GnQpVjSoW1PXdst04mwow==", "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", @@ -24256,7 +24228,6 @@ "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.84.4.tgz", "integrity": "sha512-W1IYMvvXTu4MxYr7d9h7CeG2vpIr3bmLLIavkPY4O1ilzDrvS8z/NEe6y+pC44Ff7raMXQgYSfdqDUwN/i39gg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "^7.25.2", "@babel/generator": "^7.29.1", @@ -24281,7 +24252,6 @@ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", "license": "MIT", - "peer": true, "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" @@ -24294,22 +24264,19 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/metro/node_modules/hermes-estree": { "version": "0.35.0", "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.35.0.tgz", "integrity": "sha512-xVx5Opwy8Oo1I5yGpVRhCvWL/iV3M+ylksSKVNlxxD90cpDpR/AR1jLYqK8HWihm065a6UI3HeyAmYzwS8NOOg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/metro/node_modules/hermes-parser": { "version": "0.35.0", "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.35.0.tgz", "integrity": "sha512-9JLjeHxBx8T4CAsydZR49PNZUaix+WpQJwu9p2010lu+7Kwl6D/7wYFFJxoz+aXkaaClp9Zfg6W6/zVlSJORaA==", "license": "MIT", - "peer": true, "dependencies": { "hermes-estree": "0.35.0" } @@ -24319,7 +24286,6 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", "license": "MIT", - "peer": true, "dependencies": { "mime-db": "^1.54.0" }, @@ -24336,7 +24302,6 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", "license": "MIT", - "peer": true, "engines": { "node": ">= 0.6" } @@ -24346,7 +24311,6 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "license": "BSD-3-Clause", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -24356,7 +24320,6 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "license": "MIT", - "peer": true, "engines": { "node": ">=8.3.0" }, @@ -25571,6 +25534,7 @@ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -25615,8 +25579,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/node-machine-id": { "version": "1.1.12", @@ -25803,8 +25766,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/nwsapi": { "version": "2.2.24", @@ -25819,6 +25781,7 @@ "integrity": "sha512-2wL/2fSmIbRWn6zXaQ/g3kj5DfEaTw/aJkPr6ozJh8BUq5iYKE+tS9oh0PjsVVwN6Pybe80Lu+mn9RgWyeV3xw==", "hasInstallScript": true, "license": "MIT", + "peer": true, "dependencies": { "@napi-rs/wasm-runtime": "0.2.4", "@yarnpkg/lockfile": "^1.1.0", @@ -25976,7 +25939,6 @@ "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.84.4.tgz", "integrity": "sha512-eJXMpz4aQHXF/YBB9ddqZDIS+ooO91hObo9FoW/xBkr54/zCwYYCDqT/O54vNo8kOkWs5Ou/y28NgdrV0edQNA==", "license": "MIT", - "peer": true, "dependencies": { "flow-enums-runtime": "^0.0.6" }, @@ -26736,6 +26698,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", @@ -27041,6 +27004,7 @@ "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -27128,6 +27092,7 @@ "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -27278,7 +27243,6 @@ "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", "license": "MIT", - "peer": true, "dependencies": { "asap": "~2.0.6" } @@ -27463,7 +27427,6 @@ "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", "license": "MIT", - "peer": true, "dependencies": { "inherits": "~2.0.3" } @@ -27613,6 +27576,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -27682,7 +27646,6 @@ "resolved": "https://registry.npmjs.org/react-devtools-core/-/react-devtools-core-6.1.5.tgz", "integrity": "sha512-ePrwPfxAnB+7hgnEr8vpKxL9cmnp7F322t8oqcPshbIQQhDKgFDW4tjhF2wjVbdXF9O/nyuy3sQWd9JGpiLPvA==", "license": "MIT", - "peer": true, "dependencies": { "shell-quote": "^1.6.1", "ws": "^7" @@ -27693,7 +27656,6 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "license": "MIT", - "peer": true, "engines": { "node": ">=8.3.0" }, @@ -27715,6 +27677,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", + "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -28107,7 +28070,6 @@ "resolved": "https://registry.npmjs.org/@react-three/fiber/-/fiber-9.6.1.tgz", "integrity": "sha512-zF0rsKcVYpcJwbFEnv2HkHX9cvOEgsfQo/X8lwmR2dn13S4qEQJXir9fxf5js2LQFoXqxOY7MDkOkYx2uZ4gSg==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.17.8", "@types/webxr": "*", @@ -28156,7 +28118,6 @@ "resolved": "https://registry.npmjs.org/its-fine/-/its-fine-2.0.0.tgz", "integrity": "sha512-KLViCmWx94zOvpLwSlsx6yOCeMhZYaxrJV87Po5k/FoZzcPSahvK5qJ7fYhS61sZi5ikmh2S3Hz55A2l3U69ng==", "license": "MIT", - "peer": true, "dependencies": { "@types/react-reconciler": "^0.28.9" }, @@ -28179,7 +28140,6 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -28206,7 +28166,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -28217,7 +28176,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "license": "MIT", - "peer": true, "engines": { "node": ">=18" } @@ -28227,7 +28185,6 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "license": "MIT", - "peer": true, "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -28241,8 +28198,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/react-spring/node_modules/react-konva": { "version": "19.2.5", @@ -28263,7 +28219,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "@types/react-reconciler": "^0.33.0", "its-fine": "^2.0.0", @@ -28281,7 +28236,6 @@ "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.33.0.tgz", "integrity": "sha512-HZOXsKT0tGI9LlUw2LuedXsVeB88wFa536vVL0M6vE8zN63nI+sSr1ByxmPToP5K5bukaVscyeCJcF9guVNJ1g==", "license": "MIT", - "peer": true, "peerDependencies": { "@types/react": "*" } @@ -28291,7 +28245,6 @@ "resolved": "https://registry.npmjs.org/its-fine/-/its-fine-2.0.0.tgz", "integrity": "sha512-KLViCmWx94zOvpLwSlsx6yOCeMhZYaxrJV87Po5k/FoZzcPSahvK5qJ7fYhS61sZi5ikmh2S3Hz55A2l3U69ng==", "license": "MIT", - "peer": true, "dependencies": { "@types/react-reconciler": "^0.28.9" }, @@ -28304,7 +28257,6 @@ "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.28.9.tgz", "integrity": "sha512-HHM3nxyUZ3zAylX8ZEyrDNd2XZOnQ0D5XfunJF5FLQnZbHHYq4UWvW1QfelQNXv1ICNkwYhfxjwfnqivYB6bFg==", "license": "MIT", - "peer": true, "peerDependencies": { "@types/react": "*" } @@ -28314,7 +28266,6 @@ "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.33.0.tgz", "integrity": "sha512-KetWRytFv1epdpJc3J4G75I4WrplZE5jOL7Yq0p34+OVOKF4Se7WrdIdVC45XsSSmUTlht2FM/fM1FZb1mfQeA==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -28390,7 +28341,6 @@ "resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.86.0.tgz", "integrity": "sha512-4/ZLXdf/OSpPDVO0AsQ1SJdRIzt5t9BNQ46QwGgxvX7/cirYR5k8KXctNGGgW8lQo2gZChEfY2zFCZg9nM/jiw==", "license": "MIT", - "peer": true, "dependencies": { "invariant": "^2.2.4", "nullthrows": "^1.1.1" @@ -28413,15 +28363,13 @@ "version": "0.27.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/react-spring/node_modules/ws": { "version": "7.5.11", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "license": "MIT", - "peer": true, "engines": { "node": ">=8.3.0" }, @@ -28482,7 +28430,6 @@ "resolved": "https://registry.npmjs.org/react-use-measure/-/react-use-measure-2.1.7.tgz", "integrity": "sha512-KrvcAo13I/60HpwGO5jpW7E9DfusKyLPLvuHlUyP5zqnmAPhNc6qTRjUQrdTADl0lpPpDVU2/Gg51UlOGHXbdg==", "license": "MIT", - "peer": true, "peerDependencies": { "react": ">=16.13", "react-dom": ">=16.13" @@ -28676,8 +28623,7 @@ "version": "0.13.11", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/regexp.prototype.flags": { "version": "1.5.4", @@ -28866,8 +28812,7 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/resolve": { "version": "1.22.8", @@ -29401,7 +29346,6 @@ "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", "integrity": "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -30065,7 +30009,6 @@ "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.9.0.tgz", "integrity": "sha512-Iov+JwFv/2HcTpcwNMKd8+IWNb8tboQJNQTkAY/LLVK7gGH9jy+LGkVqPxfekHl+yMmiqXszdGWXgkfml7hjqA==", "license": "MIT", - "peer": true, "engines": { "node": ">= 0.4" }, @@ -30409,15 +30352,13 @@ "version": "1.3.4", "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/stacktrace-parser": { "version": "0.1.11", "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.11.tgz", "integrity": "sha512-WjlahMgHmCJpqzU8bIBy4qtsZdU9lRlcZE3Lvyej6t4tuOuv1vk57OW3MBrj6hXBFx/nNoC9MPMTcr5YA7NQbg==", "license": "MIT", - "peer": true, "dependencies": { "type-fest": "^0.7.1" }, @@ -30948,7 +30889,6 @@ "resolved": "https://registry.npmjs.org/suspend-react/-/suspend-react-0.1.3.tgz", "integrity": "sha512-aqldKgX9aZqpoDp3e8/BZ8Dm7x1pJl+qI3ZKxDN0i/IQTWUwBx/ManmlVJ3wowqbno6c2bmiIfs+Um6LbsjJyQ==", "license": "MIT", - "peer": true, "peerDependencies": { "react": ">=17.0" } @@ -31250,6 +31190,7 @@ "resolved": "https://registry.npmjs.org/terser/-/terser-5.48.0.tgz", "integrity": "sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.15.0", @@ -31468,14 +31409,14 @@ "version": "0.171.0", "resolved": "https://registry.npmjs.org/three/-/three-0.171.0.tgz", "integrity": "sha512-Y/lAXPaKZPcEdkKjh0JOAHVv8OOnv/NDJqm0wjfCzyQmfKxV7zvkwsnBgPBKTzJHToSOhRGQAGbPJObT59B/PQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/throat": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/through2": { "version": "2.0.5", @@ -31619,8 +31560,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/to-regex-range": { "version": "5.0.1", @@ -31925,7 +31865,6 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", "license": "(MIT OR CC0-1.0)", - "peer": true, "engines": { "node": ">=8" } @@ -32027,6 +31966,7 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -32726,6 +32666,7 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -33622,6 +33563,7 @@ "integrity": "sha512-xejya+bT/j/+R/AGa1XOfRxLmNUlLtlwjRsFUILF+xHfzElmGcmFydy2gqqIrd62ptIEfwVMofd19uNWD9L7Nw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/chai": "^5.2.2", "@vitest/expect": "3.2.6", @@ -33700,8 +33642,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz", "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/vscode-uri": { "version": "3.1.0", @@ -33728,7 +33669,6 @@ "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", "license": "Apache-2.0", - "peer": true, "dependencies": { "makeerror": "1.0.12" } @@ -33816,6 +33756,7 @@ "integrity": "sha512-v7RhXaJbpMlV0D7hC7lb2EbnxkoeUqf9qhKr6lozx3Q48pmFrqqNRmZFUEGmi7pSwm6fCQ2H1IjvCkHqdpVdjQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/estree": "^1.0.8", "@types/json-schema": "^7.0.15", @@ -33916,8 +33857,7 @@ "version": "3.6.20", "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/whatwg-mimetype": { "version": "3.0.0", @@ -34202,6 +34142,7 @@ "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" }, @@ -34424,6 +34365,7 @@ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" }