Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
docs: true up the drifted claims across the README, STRUCTURE and ops guides
nirholas5dfc4d2dffec
diff --git a/README.md b/README.mdindex f45031971..4c3a566cd 100644--- a/README.md+++ b/README.md@@ -9361,7 +9361,7 @@ salience: 0.95User is a game developer interested in character animation.```-A `MEMORY.md` index file is auto-maintained. At the start of each conversation turn, the memory store is scanned and high-salience entries are injected into the system prompt.+A `MEMORY.md` index file is auto-maintained. At the start of each conversation turn, the memory store is scanned and high-salience entries are injected into the system prompt; the `MEMORY.md` index itself is injected in full, capped at the spec's 200 lines.**Storage modes:**@@ -9748,7 +9748,7 @@ Every catalog, gate and odds table above is published live at **[three.ws/play/eTwo creator tools sit alongside [Pose Studio](#pose-studio):- **Voice Lab** (`/voice`, `src/voice-lab.js`) — audition and bind voices to an agent, building on the [Voice & Persona Hub](#voice--persona-hub-phase-2).-- **Mocap Studio** (`/mocap-studio`, `src/mocap-studio.js`, `api/mocap/`) — capture and retarget motion onto a rigged avatar, exporting reusable animation clips.+- **Mocap Studio** (`/mocap-studio`, `src/mocap-studio.js`, `api/mocap/`): record webcam face mocap (MediaPipe FaceLandmarker) on a rigged avatar, calibrate to a neutral pose, then save, replay, and share the clips via `/api/mocap/clips` (public clips are replayable by anyone, resolved by slug).---@@ -9983,7 +9983,7 @@ The full OpenAPI 3.1 spec is available at `/openapi.json`. The key API surface iCron schedules are declared in `vercel.json` (still the live cron/route config the server reads) and executed in production by **Google Cloud Scheduler**, which calls each endpoint on its schedule. All cron endpoints are fail-closed — a missing auth token aborts with an error rather than silently skipping (see [Security Hardening](#security-hardening)).-The 103 crons in `vercel.json` are routed through a single dynamic handler at [`api/cron/[name].js`](api/cron/[name].js); the `name` segment selects the handler function. Scheduler jobs are provisioned from the `vercel.json` cron list via [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs); the schedules below match `vercel.json` verbatim.+The 105 crons in `vercel.json` are routed through a single dynamic handler at [`api/cron/[name].js`](api/cron/[name].js); the `name` segment selects the handler function. Scheduler jobs are provisioned from the `vercel.json` cron list via [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs); the schedules below match `vercel.json` verbatim.| Schedule | Endpoint | Purpose || -------------------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |@@ -10359,7 +10359,7 @@ export default paidEndpoint({});```-The helper handles the 402 challenge, Permit2 sibling, receipt write-back, idempotency-token enforcement, and CSRF/SSRF guards. See [api/\_lib/x402-paid-endpoint.js](api/_lib/x402-paid-endpoint.js).+The helper handles the 402 challenge, Permit2 sibling, receipt write-back, idempotency-token enforcement, and CSRF/SSRF guards. Optional hooks: `metered` attaches a signed metered-job receipt to the response (the inference network's proof-of-work lane), and `onSettled` fires fire-and-forget after settlement (used for per-call skill royalty accrual). See [api/\_lib/x402-paid-endpoint.js](api/_lib/x402-paid-endpoint.js).### Wire checks@@ -10648,8 +10648,8 @@ three.ws ships in four phases. Each phase closes a specific gap between the curr| **0** | Platform foundations (viewer, runtime, ERC-8004 + Metaplex Core identity, embed layer) | ✅ Shipped || **1** | Selfie → Avatar engine (3-photo capture, hosted inference) | 🟡 In progress — capture UX + quality gates shipped; GPU reconstruction backend wiring || **2** | Agent personalization + voice cloning | 🟡 In progress — voice clone, persona, memory seeds shipped behind `/demos`; main-flow integration next |-| **3** | Onchain economy (agent tokens, reputation markets, royalties) | 🟡 Scaffolding — bonding-curve sim, EAS-reputation viewer, 0xsplits + EAS SDKs landed; contracts + audits next |-| **4** | Open inference network (decentralized GPU layer) | 🔮 Future — livepeer dep landed for early experimentation |+| **3** | Onchain economy (agent tokens, reputation markets, royalties) | 🟡 In progress: bonding-curve sim, EAS-reputation viewer, 0xsplits + EAS SDKs landed; per-call skill royalties accrue on paid skill calls (`royalty_ledger`); contracts + audits next |+| **4** | Open inference network (decentralized GPU layer) | 🟡 Live core: open node-operator daemon + `/api/nodes` job queue with signed receipts shipped; Livepeer federation behind a flag |---@@ -10689,7 +10689,7 @@ The full stack is live at [three.ws](https://three.ws): WebGL viewer, LLM agent**Deliverables**-- Voice cloning (3–10 seconds of speech → ElevenLabs custom voice bound to the agent)+- Voice cloning (30+ seconds of speech → ElevenLabs custom voice bound to the agent)- Persona extraction from a short onboarding interview (tone, vocabulary, interests)- Memory seeding from connected accounts (X, GitHub, Farcaster) with explicit user consent- Per-agent fine-tuned system prompt stored in the manifest, signed and pinned to IPFS@@ -10731,6 +10731,8 @@ The full stack is live at [three.ws](https://three.ws): WebGL viewer, LLM agent- Onchain settlement for inference jobs — pay-per-token with cryptographic receipts- Federation with existing decentralized compute networks where appropriate+**Shipped so far:** anyone can run a node today. The [node-operator/](node-operator/) daemon registers with the coordinator, claims `llm.completion` jobs from the `/api/nodes` queue, and returns results signed with the node's Solana key over a canonical receipt binding job, model, and input/output hashes. Paid inference on `/api/x402/llm-proxy` settles through the metered hook on the x402 paid-endpoint wrapper, and `POST /api/x402/inference-verify` publishes the platform signing key so receipts verify offline. Operator guide: [docs/inference-node-operator.md](docs/inference-node-operator.md).+**Compute requirements**- Bootstrap GPU credits for early node operators@@ -10782,8 +10784,8 @@ The avatar isn't just _you_ — the agent _acts_ like you. The Voice & Persona H| Persona extraction | [api/persona/extract.js](api/persona/extract.js) | Short onboarding interview → tone, vocabulary, interests profile || Persona preview | [api/persona/preview.js](api/persona/preview.js) | Try the extracted persona against test prompts before saving || Persona keys | `scripts/generate-persona-key.mjs` | Per-agent signing key + persona SSO setup |-| Voice clone modal | [src/voice/voice-clone-modal.js](src/voice/voice-clone-modal.js) | 3–10s recording → ElevenLabs custom voice bound to the agent |-| Talk controller | [src/voice/talk-controller.js](src/voice/talk-controller.js) | Push-to-talk and continuous talk modes |+| Voice clone modal | [src/voice/voice-clone-modal.js](src/voice/voice-clone-modal.js) | 30s+ recording or upload → ElevenLabs custom voice (BYOK or platform key, 3 clones/day) bound to the agent |+| Talk controller | [src/voice/talk-controller.js](src/voice/talk-controller.js) | Push-to-talk voice loop: mic STT (Riva or browser) → `/api/chat` → ElevenLabs/Edge TTS || ARKit blendshapes | [src/voice/arkit-blendshapes.js](src/voice/arkit-blendshapes.js) | Standard ARKit-52 morph table || Lip-sync driver | [src/voice/lipsync-driver.js](src/voice/lipsync-driver.js) | Web Audio analyser → blendshape weights per frame || Avatar morph target | [src/voice/avatar-morph-target.js](src/voice/avatar-morph-target.js) | Per-rig binding of ARKit blendshapes to the loaded GLB |@@ -10798,14 +10800,14 @@ The per-agent fine-tuned system prompt is stored in the manifest, signed, and pi## Livepeer Inference Network (Phase 4)-three.ws is wiring the **Livepeer** decentralized GPU network as an alternative inference backend for avatar reconstruction and agent conversations.+three.ws wires the **Livepeer** decentralized GPU network as an alternative inference backend alongside the platform's own open inference network.- Open protocol: model weights, GPU runtime, signed responses- Onchain settlement: pay-per-token with cryptographic receipts, mediated by the same x402 rails described above- Node operator client (Docker + GPU drivers) with onchain registration- Federation with existing decentralized compute networks where appropriate-The Livepeer dependency landed early so the Phase 1 selfie pipeline can switch its heaviest step (multi-view face fitting) onto external GPU nodes without touching the rest of the system. The goal: ≥50% of production agent traffic served by independent node operators with latency parity to centralized inference.+Federation is live behind a flag: with `LIVEPEER_FEDERATION_ENABLED` set, the text-to-image chain can route one GPU job class to Livepeer gateways (runbook: [docs/ops/livepeer-federation.md](docs/ops/livepeer-federation.md)). The goal: ≥50% of production agent traffic served by independent node operators with latency parity to centralized inference.---@@ -11014,7 +11016,7 @@ npm run build # frontend build to dist/ (only when frontend changed)npm run deploy:gcp # check:dist + db:check, gcloud builds submit, purge CDN```-`npm run deploy:gcp` runs `gcloud builds submit --config server/cloudbuild.yaml`. Routing, cache headers, and cron schedules are defined in `vercel.json`, which the server reads at runtime. The scheduled jobs (103 at time of writing, one per entry in the `crons` array of `vercel.json`) run on **Cloud Scheduler** (provisioned by [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs)); the GPU inference workers run as their own Cloud Run services. Full ops runbook (load balancer, DNS/TLS, env, rollback, recovery): **[docs/ops/gcp-production.md](docs/ops/gcp-production.md)**.+`npm run deploy:gcp` runs `gcloud builds submit --config server/cloudbuild.yaml`. Routing, cache headers, and cron schedules are defined in `vercel.json`, which the server reads at runtime. The scheduled jobs (105 at time of writing, one per entry in the `crons` array of `vercel.json`) run on **Cloud Scheduler** (provisioned by [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs)); the GPU inference workers run as their own Cloud Run services. Full ops runbook (load balancer, DNS/TLS, env, rollback, recovery): **[docs/ops/gcp-production.md](docs/ops/gcp-production.md)**.**Environment variables** live on the Cloud Run service, not in `.env` files — inspect or update them with `gcloud run services describe/update three-ws-api --region us-central1`. See [Environment Variables](#environment-variables) for the full list.@@ -11162,7 +11164,7 @@ VITE_AVATURN_DEVELOPER_ID=...## Testing-`npm run test` runs Vitest (unit + integration) followed by Playwright (end-to-end). API tests stub the database and auth layer; frontend tests stub the viewer. The project currently has ~150 test files spread across `tests/`, `tests/api/`, `tests/src/`, and `tests/e2e/`.+`npm run test` runs Vitest (unit + integration) followed by Playwright (end-to-end). API tests stub the database and auth layer; frontend tests stub the viewer. The project currently has ~1,500 test files spread across `tests/`, `tests/api/`, `tests/src/`, and `tests/e2e/`.```bashnpm run test # Vitest then Playwrightdiff --git a/STRUCTURE.md b/STRUCTURE.mdindex 93ebe6c59..9fde88e07 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -29,17 +29,18 @@ bottom.| Assistant widget (3D avatar assistant for any website) | Loader [public/assistant/v1.js](public/assistant/v1.js) `-> /assistant/v1.js`, iframe app [pages/assistant-frame.html](pages/assistant-frame.html) + [src/assistant-frame.js](src/assistant-frame.js) `-> /assistant-frame`, builder [pages/assistant.html](pages/assistant.html) + [src/assistant-page.js](src/assistant-page.js) `-> /assistant`, shared validators [src/assistant-widget-core.js](src/assistant-widget-core.js). npm SDK [assistant-sdk/](assistant-sdk) (`@three-ws/assistant`) is the single source for the loader; its [build.mjs](assistant-sdk/build.mjs) emits the npm ESM + the mirrored one-tag build at `public/assistant/v1.js`. MCP server [packages/assistant-mcp/](packages/assistant-mcp) (`@three-ws/assistant-mcp`, registry `io.github.nirholas/assistant-widget`): `build_assistant_widget` (config -> paste-ready snippet + frame URL + JS-API call), `list_assistant_options` (avatars, backgrounds, modes, attributes). | Published as `@three-ws/assistant` | One script tag adds a floating launcher to any site; clicking it pops up a full-body animated avatar against the host page (transparent) or a color/gradient. Two modes: chatbot (free chain via POST /api/chat, or the visitor's own Groq/OpenRouter key sent browser-to-provider, stored in the frame's localStorage only) and speak mode (avatar repeats typed text out loud via Web Speech + head-anchored speech bubble + talking clip). All params re-validated in-frame (CSS/URL injection safe). Sibling of Concierge (chat panel) - this one is the full-body, avatar-first widget. Install three ways: one-tag CDN, `npm i @three-ws/assistant`, or the MCP server for AI agents. Examples: [assistant-sdk/examples/](assistant-sdk/examples). Docs: [docs/assistant-widget.md](docs/assistant-widget.md) `-> /docs/assistant-widget`, tutorial [docs/tutorials/add-a-3d-assistant.md](docs/tutorials/add-a-3d-assistant.md). Tests: [tests/assistant-widget.test.js](tests/assistant-widget.test.js), [assistant-sdk/test/](assistant-sdk/test), [packages/assistant-mcp/test/](packages/assistant-mcp/test) || Chat (conversational surface) | [chat/](chat) `→ /chat` | Live | Svelte 4 + Vite client, fork of eplus, built by `build:chat` inside `build:gcp` into `public/chat` → `dist/chat`. Free Built-in lane via `/api/chat/proxy` plus BYOK providers; inline 3D forge tools + ModelViewer3D; shares the platform wallet via [src/shared/](src/shared). Docs: [chat/README.md](chat/README.md) || three.ws's own guided tour + onboarding | [src/feature-tour/](src/feature-tour) `→ /feature-tour.js`, entry [src/feature-tour.js](src/feature-tour.js), curriculum [public/tour/curriculum.json](public/tour/curriculum.json) generated by [scripts/build-tour.mjs](scripts/build-tour.mjs), landing [pages/tour.html](pages/tour.html) `→ /tour` | Live | A hardened, site-native fork of the [tour-sdk/](tour-sdk) engine (same curriculum schema — stops/sections/tracks/highlight/narration/targets), lazy-injected only when a tour is starting/active (`feature-tour-boot` Vite plugin) so pages that never tour pay no Three.js cost. Three tracks share one curriculum: `full` (every feature, chapter by chapter), `quick` (highlighted heroes), and `onboarding` (added 2026-07-12) — a 6-stop, hand-authored new-account walkthrough chaining `/start` → make an avatar (`/create/selfie`) → build a world (`/diorama`) → live `/markets` data → an optional coin launch (`/create-agent`, clearly skippable) → the new creator's own `/profile`. Auto-offered once to a signed-in account with zero creations across avatars/agents/forged models/worlds (`GET /api/me` → `show_onboarding_tour`, backed by `users.onboarding_tour_seen_at`/`onboarding_tour_completed_at`, migration [api/_lib/migrations/20260712030000_onboarding_tour_state.sql](api/_lib/migrations/20260712030000_onboarding_tour_state.sql)); always reachable afterward via "🎬 Replay guided tour" in the [public/getting-started.js](public/getting-started.js) checklist panel. Tests: [tests/feature-tour-curriculum.test.js](tests/feature-tour-curriculum.test.js), [tests/api-me-onboarding-tour.test.js](tests/api-me-onboarding-tour.test.js) |-| Onboarding tier (Simple ⇄ Everything) | Menu tags [public/nav-data.js](public/nav-data.js), runtime + `window.twsTier` [public/nav.js](public/nav.js), styles [public/nav.css](public/nav.css), homepage start path + gate [pages/home.html](pages/home.html) + [public/home.css](public/home.css) | Live | Progressive disclosure for first-time visitors: the platform's ~100 nav destinations and ten deep homepage sections were competing with its core promise, so a new visitor now gets the ~21 links and the sections that carry one journey — make an avatar, build an agent, publish it — with a three-step start path under the hero. Everything else (the whole Launch menu, trading, token economy, Oracle, pay-per-call, dev platform, the stack) is tagged `tier: 'advanced'` / `data-tier="advanced"` and revealed by one control. Mechanism is one `<html>` class (`tws-lite`) over one localStorage key (`tws:tier`), applied pre-paint and never re-rendered (the nav binds document-level listeners once), with the two surfaces synced through a `tws:tier-change` event. Deep links into a gated section reveal it for that visit. Nothing is removed, only deferred. Docs: [docs/onboarding-tier.md](docs/onboarding-tier.md). Tests: [tests/onboarding-tier.test.js](tests/onboarding-tier.test.js) |+| Onboarding tier (Simple ⇄ Everything) | Menu tags [public/nav-data.js](public/nav-data.js), runtime + `window.twsTier` [public/nav.js](public/nav.js), styles [public/nav.css](public/nav.css), homepage start path + gate [pages/home.html](pages/home.html) + [public/home.css](public/home.css) | Live | Progressive disclosure for first-time visitors: the platform's ~119 nav destinations and ten deep homepage sections were competing with its core promise, so a new visitor now gets the ~28 links and the sections that carry one journey (make an avatar, build an agent, publish it) with a three-step start path under the hero. Everything else (the whole Launch menu, trading, token economy, Oracle, pay-per-call, dev platform, the stack) is tagged `tier: 'advanced'` / `data-tier="advanced"` and revealed by one control. Mechanism is one `<html>` class (`tws-lite`) over one localStorage key (`tws:tier`), applied pre-paint and never re-rendered (the nav binds document-level listeners once), with the two surfaces synced through a `tws:tier-change` event. Deep links into a gated section reveal it for that visit. Nothing is removed, only deferred. Docs: [docs/onboarding-tier.md](docs/onboarding-tier.md). Tests: [tests/onboarding-tier.test.js](tests/onboarding-tier.test.js) || Tour Builder (no-code playground) | [pages/tour-builder.html](pages/tour-builder.html) `→ /tour-builder` | Live | Point-and-click editor over a demo storefront: pick avatar, add stops, preview the real tour, export curriculum + Shopify snippets. Also ships **Templates** — ready-made tours (Sperax's DeFi protocol tour is the first) that load straight into the editor. Logic: [public/tour-builder/builder.js](public/tour-builder/builder.js), presets: [public/tour-builder/presets/](public/tour-builder/presets). Sperax template doc: [docs/tutorials/sperax-tour.md](docs/tutorials/sperax-tour.md) || Avatar builder (full app) | [character-studio/](character-studio) | Fork of [m3-org/CharacterStudio](https://github.com/M3-org/CharacterStudio), MIT, see [character-studio/LICENSE](character-studio/LICENSE) | Web-first character creator || Scene Studio (3D scene editor) | [src/scene-studio/](src/scene-studio) `→ /scene` | Vendored [mrdoob/three.js](https://github.com/mrdoob/three.js) r184 editor, MIT, see [src/scene-studio/vendor/README.md](src/scene-studio/vendor/README.md) | Import GLBs, compose scenes, edit materials/lights, export || Diorama (text → 3D world) | [src/diorama/](src/diorama) `→ /diorama` | In-repo · backend [api/diorama.js](api/diorama.js) | One sentence → an explorable 3D diorama: Claude composes the scene, each object is forged to a real GLB, assembled live, saved to a public gallery + shareable permalink || Creator portfolio (human profile) | [pages/profile.html](pages/profile.html) `→ /u/:username` (self-view `/profile`), backend [api/users/[username].js](api/users/%5Busername%5D.js) + paginated [api/users/[username]/creations.js](api/users/%5Busername%5D/creations.js) `→ /api/users/:username/creations` | Live | Every three.ws user's public portfolio: avatars, agents, widgets, skills, plugins, coins, memories, items for sale, and (added 2026-07-12, extended 2026-07-23) a **Creations** tab merging forged 3D models + Scene Studio worlds + Material Studio restyles — real, live, spinning `<model-viewer>` cards, cursor-paginated for 100+ items. `/forge`, `/diorama`, and `/restyle` all stay anonymous by default (no login required); a signed-in creator's `user_id` is attached to `forge_creations`/`dioramas` rows at generation/save time (migration [api/_lib/migrations/20260712010000_creator_portfolio_user_ids.sql](api/_lib/migrations/20260712010000_creator_portfolio_user_ids.sql)) and to a new `material_restyles` row per AI restyle or colorway variant (migration [api/_lib/migrations/20260723140000_material_restyles.sql](api/_lib/migrations/20260723140000_material_restyles.sql), store [api/_lib/material-restyle-store.js](api/_lib/material-restyle-store.js)) so those creations surface here. The same opt-in attribution now links back from the diorama viewer HUD, the diorama gallery cards, and the forge result bar ("by @user") whenever a creation's creator is known. `/@:handle` ([pages/handle.html](pages/handle.html)) is a separate, narrower agent-embed page — not the human portfolio. |-| Model detail page (`/m/:id`) | [pages/model.html](pages/model.html) `→ /m/:id`, page module [src/model-page.js](src/model-page.js) + pure helpers [src/model-lib.js](src/model-lib.js) + [src/model.css](src/model.css), backend [api/forge-creation.js](api/forge-creation.js) (`?related=&view=` + voted state) and [api/forge-comments.js](api/forge-comments.js), store reads [api/_lib/forge-store.js](api/_lib/forge-store.js) (`getPublicCreation`/`listRelated`/`recordCreationView`), schema [api/_lib/migrations/20260805120000_model_page.sql](api/_lib/migrations/20260805120000_model_page.sql) | Live | Every finished forge model as a first-class page in the classic model-platform detail layout: interactive viewer hero with AR and fullscreen, title + creator card with a real follow button (follow graph), live triangle/vertex stats from `GET /api/3d/inspect` (nothing persisted, nothing invented), the full prompt as the description, honest attribute chips, anonymous likes shared with the Forge-Off vote rail (`forge_votes`, same `forge:cid` id), a real page-view counter (`forge_creations.view_count`), a signed-in comment thread (`forge_comments`, bell-notifies the creator via the `comment` event type), paid remix via the existing x402 rail, embed/share/download, and a same-category suggested-models rail. Linked from the Details button on `/creations` cards and the Forge showcase. Tests: [tests/model-lib.test.js](tests/model-lib.test.js) |+| Model detail page (`/m/:id`) | [pages/model.html](pages/model.html) `→ /m/:id`, page module [src/model-page.js](src/model-page.js) + pure helpers [src/model-lib.js](src/model-lib.js) + [src/model.css](src/model.css), backend [api/forge-creation.js](api/forge-creation.js) (`?related=&view=` + voted state; `DELETE`, scoped to the owning `x-forge-client`, lets a creator erase a creation, its stored GLB, preview, and recorded source uploads included) and [api/forge-comments.js](api/forge-comments.js), store reads [api/_lib/forge-store.js](api/_lib/forge-store.js) (`getPublicCreation`/`listRelated`/`recordCreationView`), schema [api/_lib/migrations/20260805120000_model_page.sql](api/_lib/migrations/20260805120000_model_page.sql) | Live | Every finished forge model as a first-class page in the classic model-platform detail layout: interactive viewer hero with AR and fullscreen, title + creator card with a real follow button (follow graph), live triangle/vertex stats from `GET /api/3d/inspect` (nothing persisted, nothing invented), the full prompt as the description, honest attribute chips, anonymous likes shared with the Forge-Off vote rail (`forge_votes`, same `forge:cid` id), a real page-view counter (`forge_creations.view_count`), a signed-in comment thread (`forge_comments`, bell-notifies the creator via the `comment` event type), paid remix via the existing x402 rail, embed/share/download, and a same-category suggested-models rail. Linked from the Details button on `/creations` cards and the Forge showcase. Tests: [tests/model-lib.test.js](tests/model-lib.test.js) || Labs (hidden-gems hub) | [pages/labs.html](pages/labs.html) + [src/labs.js](src/labs.js) `→ /labs` | In-repo | Data-driven discovery hub: renders every `data/pages.json` entry flagged `showcase: true` as a live card (status check + iframe preview), filterable by category || Holo Sticker (procedural foil demo) | [pages/holo.html](pages/holo.html) `→ /holo`, app [src/holo.js](src/holo.js), styles [src/holo.css](src/holo.css) | Live | A real-time holographic foil sticker rendered with physical materials, fully procedural (no assets fetched): tilt it with the pointer, peel the corner (vertex-shader cylinder roll), switch foil styles, die-cut arbitrary typed text via a marching-squares vectorizer, and download the frame as a PNG || Examples gallery | [pages/examples.html](pages/examples.html) `→ /examples`, curated snippets [public/examples.js](public/examples.js), generated index renderer [public/examples-index.js](public/examples-index.js), styles [public/examples.css](public/examples.css) | Live | Two halves. The top is six copy-paste snippets that RUN on the page: each is a complete document loading the production CDN bundle into a sandboxed iframe, so "Run" executes exactly the code shown. The bottom is every example that ships in the repo (40 as of 2026-08-05), generated by [scripts/build-examples-index.mjs](scripts/build-examples-index.mjs) scanning every `examples/` directory into [data/examples.json](data/examples.json), mirrored to the served [public/examples.json](public/examples.json) by [scripts/mirror-examples-index.mjs](scripts/mirror-examples-index.mjs) (`npm run build:examples` runs both). Because it is scanned, the page cannot advertise a deleted example or miss an added one; each card carries the files it contains and the command that runs it. Tests: [tests/examples-page.test.js](tests/examples-page.test.js), [tests/examples-index.test.js](tests/examples-index.test.js) || Cookbook (runnable recipes) | Index [pages/cookbook.html](pages/cookbook.html) `-> /cookbook`, recipe viewer [pages/recipe.html](pages/recipe.html) `-> /cookbook/<slug>`, manifest [public/cookbook-manifest.js](public/cookbook-manifest.js), styles [public/cookbook.css](public/cookbook.css), recipe prose [docs/cookbook/](docs/cookbook), runnable files [public/cookbook/recipes/](public/cookbook/recipes), notebook export [public/cookbook/self-correcting-3d/](public/cookbook/self-correcting-3d) | Live | The sibling of the Examples gallery, and deliberately a different thing: an example is a snippet you read on the page, a recipe is a file you download and run. Five recipes, each one executed against the live API before it was published: a standard-library text-to-3D CLI, a parallel asset-pack builder that emits a manifest plus a gallery, an MCP server that hands Claude Code or Cursor a 3D tool, a CI budget gate over [api/3d/inspect.js](api/3d/inspect.js), and the function-calling-plus-vision notebook also submitted to the OpenAI Cookbook. The manifest is the single source of truth for both surfaces; recipe prose is markdown under `docs/cookbook/` fetched by the viewer, so adding a recipe is a manifest entry plus a `.md` plus the file itself. Route order is load-bearing in both [vercel.json](vercel.json) and the dev middleware: the notebook's static export must be matched before the generic `/cookbook/<slug>` rule or the viewer shadows it. Docs: [public/cookbook/recipes/README.md](public/cookbook/recipes/README.md). Tests: [tests/cookbook.test.js](tests/cookbook.test.js) |+| Walkthroughs (interactive product tours from real frames) | Index [pages/walkthroughs.html](pages/walkthroughs.html) + [src/walkthroughs-index.js](src/walkthroughs-index.js) `→ /walkthroughs`, player [pages/walkthrough.html](pages/walkthrough.html) + [src/walkthrough.js](src/walkthrough.js) `→ /walkthroughs/<slug>` (routed in [vercel.json](vercel.json), mirrored by the Vite dev middleware in [vite.config.js](vite.config.js)), pure step geometry [src/walkthrough-geometry.js](src/walkthrough-geometry.js), generated manifest + screenshot sets [public/walkthroughs/](public/walkthroughs) captured by [scripts/capture-walkthroughs.mjs](scripts/capture-walkthroughs.mjs) | Live | Step-by-step guided tours (forge a 3D model, build an agent, embed an avatar, find an agent worth using) built from real frames captured on the live product: each step zooms and pans to the element it describes, cuts a spotlight around it, and anchors a callout, so it reads like a screen recording but is a handful of deep-linkable, keyboard-operable JPEGs that degrade to annotated stills under reduced motion. Index and player read the same generated manifest, so a walkthrough that did not capture cleanly cannot be advertised. Registered in [data/pages.json](data/pages.json). || Cross-entity search | [pages/search.html](pages/search.html) `→ /search`, backend [api/search.js](api/search.js) + query layer [api/_lib/cross-search.js](api/_lib/cross-search.js) | Live | The one search across every creation type — avatars, on-chain/Solana agents, forged 3D models, worlds, and coins. Federates (not one SQL UNION — the stores are genuinely heterogeneous, two of five aren't even in the same database) five parallel queries, normalizes into one card shape, and ranks by recency plus real signals (follower count via `user_follows`, remix count, view count) — see the file header in `api/search.js` for the full unify-vs-federate writeup. Model results carry a working "Remix — $0.25" action against the existing paid rail ([api/x402/remix-asset.js](api/x402/remix-asset.js)), reused from [pages/creations.html](pages/creations.html) rather than re-derived. Coin search checks three.ws's own launch directory (`pump_agent_mints`) first, then falls back to market-wide pump.fun/Birdeye search for broader coverage (those external matches carry no verified timestamp or creator profile, and are ranked/labelled accordingly). Linked from the Discover nav menu. || Cross-surface rankings, streaks & badges | [pages/rankings.html](pages/rankings.html) `→ /rankings`, backend [api/leaderboard/unified.js](api/leaderboard/unified.js), streak/badge engine [api/_lib/streaks.js](api/_lib/streaks.js) (migration [api/_lib/migrations/20260712020000_leaderboard_streaks_badges.sql](api/_lib/migrations/20260712020000_leaderboard_streaks_badges.sql)), daily Top-10 badge sweep [api/cron/leaderboard-rollup.js](api/cron/leaderboard-rollup.js) | Live | Five real, queried leaderboard metrics — creations (forge models + worlds), remixes received, coin launches, followers, and walk distance (signed-in walkers, all-time) — ranked live with the viewer's own rank pinned even off-page. Every signed-in qualifying action (login, a finished forge model, a saved world, a `/walk` session) rolls a per-user daily streak in `user_streaks` via `recordDailyActivity()`, called from [api/_lib/auth.js](api/_lib/auth.js), [api/_lib/forge-store.js](api/_lib/forge-store.js), [api/_lib/diorama-store.js](api/_lib/diorama-store.js), and [api/walk/metrics.js](api/walk/metrics.js). Four real earned badges persist in `user_badges`: First Creation, Remixed (awarded in [api/x402/remix-asset.js](api/x402/remix-asset.js) when a remix lands on your creation), 7-Day Streak, and a daily-refreshed `top10_<metric>` per leaderboard. Streak + badges surface on the profile ([pages/profile.html](pages/profile.html)) and the Rankings page itself. Rejected metrics (documented in `api/leaderboard/unified.js`'s header): royalties earned in USD (the settlement record is a single overwritten JSONB column, not a cumulative ledger) and `/play` activity (no per-human-user session table exists). || Daily Match (agent output arena) | [pages/daily-match.html](pages/daily-match.html) `→ /daily-match`, backend [api/leaderboard/daily-match.js](api/leaderboard/daily-match.js) | Live | Live daily standings ranking public agents by real output shipped since 00:00 UTC: agent_actions events, sniper + pump trades, confirmed skill sales, and coin launches, with realized sniper P&L shown for context (never scored). Computed live per request (no rollup cron), resets naturally at UTC midnight; includes yesterday's champion and a live-output feed. Reputation-first: no payouts hang off the score. Format adopted with credit from Bowyer's Arena (bowyer.app/arena), who build their agent pages on three.ws avatars. |@@ -51,8 +52,8 @@ bottom.| Marketplace analytics & trial funnel | [pages/marketplace-analytics.html](pages/marketplace-analytics.html) `→ /marketplace/analytics`, renderer [src/marketplace-analytics.js](src/marketplace-analytics.js), backend [api/marketplace/analytics.js](api/marketplace/analytics.js) | Live | Public transparency page for the skill marketplace: paid sales, volume, top skills/agents, and the trial conversion funnel. **Every money aggregate gates on `status = 'confirmed'` alone.** Counting `status IN ('confirmed','trial')` as a sale published 10,454 "sales" and 6.2M $THREE of "volume" on 2026-07-30 against a table holding zero confirmed purchases, because a `trial` row is a free grant whose `amount` is only the list price it would have cost. Free trials now render as their own stat and as a four-stage funnel (granted → used → exhausted → converted), which also names the two shapes that mean a wiring fault rather than weak demand: trials never spent, or trials exhausted with nothing converting. Docs: [docs/marketplace.md](docs/marketplace.md), tutorial [docs/tutorials/sell-a-skill-with-a-trial.md](docs/tutorials/sell-a-skill-with-a-trial.md). Tests: [tests/marketplace-analytics-paid-only.test.js](tests/marketplace-analytics-paid-only.test.js) || OKX.AI marketplace services | [api/okx/3d/[service].js](api/okx/3d/%5Bservice%5D.js) `→ /api/okx/3d/*` | Live | 3D services sold to other agents on OKX.AI (agent #2632): Agent Identity Studio flagship + decomposed studio services. Catalog source of truth: [api/_lib/okx-catalog.js](api/_lib/okx-catalog.js); pipeline: [api/_okx3d/](api/_okx3d); showcase: [pages/agent-identities.html](pages/agent-identities.html) `→ /agent-identities` + [src/agent-identities.js](src/agent-identities.js), fed at runtime by [api/agent-identities.js](api/agent-identities.js) `→ /api/agent-identities` (demo runs from `data/agent-identities.json` merged with the live catalog row, so the price the page quotes is the price the paid endpoint charges); docs: [docs/okx-marketplace.md](docs/okx-marketplace.md), [docs/agent-identities.md](docs/agent-identities.md) || OKX.AI marketplace chat bot host | [workers/okx-chat-bot/](workers/okx-chat-bot) (Cloud Run service `okx-chat-bot`), local revive [scripts/okx-bot-revive.mjs](scripts/okx-bot-revive.mjs) `→ npm run okx:bot` | Built · deploy owner-gated | Always-on host for the XMTP chat behind agent #2632. Supervises the `okx-a2a` daemon plus the `onchainos` wallet session, persists the wallet/XMTP identity to GCS across revisions, and rebuilds the AI subsession's briefing from [api/_lib/okx-chat-briefing.js](api/_lib/okx-chat-briefing.js) on every boot so quoted prices can never drift from the catalog. It exists because the stack used to live on a codespace that sleeps, and its outage mode is silent: an expired wallet session leaves the process healthy while no chat is delivered, which flagged the listing offline once. Health reaches the platform as the `okx_chat_bot` subsystem on `/api/healthz` via a `bot_heartbeat` row; a logged-out session pages with the exact login commands. Deploy: [workers/okx-chat-bot/cloudbuild.yaml](workers/okx-chat-bot/cloudbuild.yaml) (`--max-instances=1` is load-bearing, one GCS state writer). Tests: [tests/okx-chat-bot.test.js](tests/okx-chat-bot.test.js) |-| Crypto Data API docs / landing | [pages/crypto.html](pages/crypto.html) `→ /crypto` | In-repo · docs surface | Screenshot-worthy public docs + funnel-top for the free, keyless Crypto Data API (`/api/crypto/*` — token snapshot, security, holders, launches, bonding, whales, symbol, wallet, trending). Renders hero, endpoint table, tabbed quickstart (curl/JS/Python), per-endpoint request/response reference and a live "Try it" console. Probes production at runtime and marks each endpoint Live vs Coming soon (degrades gracefully while sibling endpoints roll out). CTAs funnel to paid uniques: [/launcher](pages/launcher.html), [/vanity-wallet](public/vanity-wallet.html), [/forge](pages/forge.html). Spec: x402-overhaul campaign (retired 2026-07-28; readable in git history) |-| Free Crypto Data API + discovery | [api/crypto/index.js](api/crypto/index.js) `→ /api/crypto`, [api/crypto/openapi.js](api/crypto/openapi.js) `→ /api/crypto/openapi.json`, docs [docs/crypto-api.md](docs/crypto-api.md) `→ /docs/crypto-api` | Live · docs surface | Front door + OpenAPI 3.1 for the free, keyless Crypto Data API. Catalog assembler [api/_lib/crypto-catalog/index.js](api/_lib/crypto-catalog/index.js) merges `api/_lib/crypto-catalog/*.js` self-describing descriptors (currently `bonding`, `holders`, `launches`, `security`, `symbol`, `token`, `trending`, `wallet`, `whales`) via a static import barrel — the production source of truth, since Vercel's bundler only ships what static imports reach — plus an additive dev-time directory glob; skips malformed/throwing entries, never throws, valid-empty when zero. New descriptor = drop the file AND add its import line to the barrel. OpenAPI built from the same catalog via [api/_lib/crypto-catalog/openapi.js](api/_lib/crypto-catalog/openapi.js). Index does HTML/JSON content negotiation. Endpoint handlers live in `api/crypto/*.js`. Spec: x402-overhaul campaign (retired 2026-07-28; readable in git history) |+| Crypto Data API docs / landing | [pages/crypto.html](pages/crypto.html) `→ /crypto` | In-repo · docs surface | Screenshot-worthy public docs + funnel-top for the free, keyless Crypto Data API (`/api/crypto/*`: token snapshot, security, holders, launches, bonding, whales, symbol, wallet, trending, portfolio, airdrops). Renders hero, endpoint table, tabbed quickstart (curl/JS/Python), per-endpoint request/response reference and a live "Try it" console. Probes production at runtime and marks each endpoint Live vs Coming soon (degrades gracefully while sibling endpoints roll out). CTAs funnel to paid uniques: [/launcher](pages/launcher.html), [/vanity-wallet](public/vanity-wallet.html), [/forge](pages/forge.html). Spec: x402-overhaul campaign (retired 2026-07-28; readable in git history) |+| Free Crypto Data API + discovery | [api/crypto/index.js](api/crypto/index.js) `→ /api/crypto`, [api/crypto/openapi.js](api/crypto/openapi.js) `→ /api/crypto/openapi.json`, docs [docs/crypto-api.md](docs/crypto-api.md) `→ /docs/crypto-api` | Live · docs surface | Front door + OpenAPI 3.1 for the free, keyless Crypto Data API. Catalog assembler [api/_lib/crypto-catalog/index.js](api/_lib/crypto-catalog/index.js) merges `api/_lib/crypto-catalog/*.js` self-describing descriptors (currently `airdrops`, `bonding`, `holders`, `launches`, `portfolio`, `security`, `symbol`, `token`, `trending`, `wallet`, `whales`) via a static import barrel (the production source of truth, since Vercel's bundler only ships what static imports reach) plus an additive dev-time directory glob; skips malformed/throwing entries, never throws, valid-empty when zero. New descriptor = drop the file AND add its import line to the barrel. OpenAPI built from the same catalog via [api/_lib/crypto-catalog/openapi.js](api/_lib/crypto-catalog/openapi.js). Index does HTML/JSON content negotiation. Endpoint handlers live in `api/crypto/*.js`. Spec: x402-overhaul campaign (retired 2026-07-28; readable in git history) || Unified Crypto API aggregator — storefront + OpenAPI | Registry [api/v1/_providers.js](api/v1/_providers.js) (`providerCatalog()`), front door [api/v1/x/[...slug].js](api/v1/x/%5B...slug%5D.js) `→ /api/v1/x/<provider>/<endpoint>`, discovery `→ GET /api/v1/x`, storefront [pages/crypto-api.html](pages/crypto-api.html) `→ /crypto-api`, OpenAPI 3.1 [api/openapi-json.js](api/openapi-json.js) `→ /openapi.json`, docs § in [docs/api-reference.md](docs/api-reference.md#unified-api--apiv1x-aggregator), dir guide [api/v1/README.md](api/v1/README.md) | Live | Third-party crypto/DeFi/on-chain APIs (CoinGecko, DefiLlama × 2, Jupiter, DexScreener, Solana RPC, OpenAI-compatible) re-offered as one bill: free per-IP tier → BYOK pass-through → three.ws plan → x402 pay-per-call, in that order. Everything (OpenAPI paths, the `/crypto-api` live table, the docs quota table) renders from `providerCatalog()` at request/page-load time — no hand-enumeration, so a new provider descriptor shows up everywhere with zero page edits. Test: [tests/openapi-aggregator.test.js](tests/openapi-aggregator.test.js). Not to be confused with the separate `/api/crypto/*` bundle below (different campaign, different registry). Spec: x402-catalog campaign (retired 2026-07-28; readable in git history) || Free 3D API + docs | [api/3d/index.js](api/3d/index.js) `→ /api/3d`, [api/3d/openapi.js](api/3d/openapi.js) `→ /api/3d/openapi.json`, docs [public/3d.html](public/3d.html) `→ /3d` (alias `/docs/3d-api`) | Live · docs surface | Front door + OpenAPI 3.1 for the free, keyless 3D API. Catalog assembler [api/_lib/3d-catalog/index.js](api/_lib/3d-catalog/index.js) merges `api/_lib/3d-catalog/*.js` descriptors (currently `generate`, `inspect`) via a static import barrel (production source of truth) plus an additive dev-time directory glob; new descriptor = drop the file AND add its barrel import line; skips malformed, never throws; OpenAPI built from the same catalog via [api/_lib/3d-catalog/openapi.js](api/_lib/3d-catalog/openapi.js). Index does HTML/JSON content negotiation and advertises the paid ladder (Forge Pro, Rigged Avatars). Docs page: hero, live endpoint table, runnable quickstart with a live "Run inspect" console, embedded `<model-viewer>` GLB preview, and the free→paid ladder. Free endpoints: [api/3d/generate.js](api/3d/generate.js) (prompt 12), [api/3d/inspect.js](api/3d/inspect.js) (prompt 13). GPT Store Actions surface: [api/3d/studio.js](api/3d/studio.js) `→ /api/3d/studio` — a store-compliant twin of `generate` that strips the x402/upgrade block, drops internal ids, and runs the [api/_mcp-studio/safety.js](api/_mcp-studio/safety.js) age-13+ content gate before any GPU work; backs the "three.ws 3D Studio" custom GPT ([prompts/store-submissions/_generated/openai-actions.yaml](prompts/store-submissions/_generated/openai-actions.yaml) + [openai-gpt-config.md](prompts/store-submissions/_generated/openai-gpt-config.md), store-submission prompt 12). Spec: x402-overhaul campaign (retired 2026-07-28; readable in git history) || Paid Market Data API (x402, 17 endpoints) | Registry [api/_lib/market-data/registry.js](api/_lib/market-data/registry.js), fetchers [api/_lib/market-data/fetch.js](api/_lib/market-data/fetch.js), factory [api/_lib/market-data/endpoint.js](api/_lib/market-data/endpoint.js), routes `api/x402/market-*.js` `→ /api/x402/market-<category>`, free index [api/x402/market.js](api/x402/market.js) `→ /api/x402/market`, catalog projection [api/_lib/service-catalog/services/market-data.js](api/_lib/service-catalog/services/market-data.js), docs [docs/market-data-api.md](docs/market-data-api.md) `→ /docs/market-data-api` | Live | Every free /markets feed (coins, coin profile, price history, categories, exchanges, derivatives, global+Fear&Greed, ETH gas, trending, DeFi TVL, chains, ~15k yield pools, stablecoins, fees/revenue, DEX volumes, hacks) wrapped as pay-per-call x402 endpoints at $0.001 USDC (Solana/Base), plus the $0.005 one-call `market-pulse` bundle. One registry drives the live 402s, the discovery-doc listings, and the free index — zero drift by construction; the fetchers delegate to the SAME exported builders the free pages use (`api/coin/*`, `api/defi/*`), so paid data always matches the site. Params rejected pre-settle (422) and upstream outages (503) never charge the buyer. Tests: [tests/market-data-api.test.js](tests/market-data-api.test.js). |@@ -90,7 +91,7 @@ bottom.| `/play` safety & lifecycle invariants | Doc [docs/play-hardening.md](docs/play-hardening.md) `→ /docs/play-hardening`. Guards: `cssBgImage()` + `clampParam()` + `isPlausibleMint()` in [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) / [src/game/coincommunities.js](src/game/coincommunities.js), avatar template cache + `releaseAvatar()` in [src/game/avatar-rig.js](src/game/avatar-rig.js), reconnect pruning (`_markRemotesStale`/`_pruneStaleRemotes`) and `_disposeObject3D()` in [src/game/coincommunities.js](src/game/coincommunities.js). Harnesses: [scripts/play-desktop-audit.mjs](scripts/play-desktop-audit.mjs), [scripts/play-mobile-repro.mjs](scripts/play-mobile-repro.mjs) | Live | The rules that keep the platform's largest interactive surface safe, honest and phone-survivable, each written against a failure that actually shipped: untrusted display names and coin metadata never become markup or CSS (a tombstone owner's name once ran as HTML for everyone who walked past it; a crafted coin `image_uri` could paint a full-screen overlay across the lobby), a malformed `?coin=` is refused instead of building a convincing world nobody else can join, a *valid* `?coin=` that lost the rest of its query (a hand-typed link, a truncated share, an unfurl that kept only the mint) is named from the coin feed by `_fetchCoinIdentity()`/`mergeCoinIdentity()` instead of building a real district under a totem reading "COMMUNITY" with a blank market cap, a reconnect retires the peers who left rather than accumulating frozen ghosts and a tripled headcount, and everything the world loads (crowd/NPC GLBs, the sun's 2048² shadow map, totem, jumbotron, dance floor, district, environment) is genuinely freed on the way out instead of held until the tab is killed. Tests: [tests/play-deeplink-safety.test.js](tests/play-deeplink-safety.test.js), [tests/play-deeplink-identity.test.js](tests/play-deeplink-identity.test.js) || Cinematic rendering (shared 3D quality bar) | [src/shared/cinematic-render.js](src/shared/cinematic-render.js) — `applyCinematicDefaults()`, `loadEnvironment()`, `detectQualityTier()`, `updateGroundContactShadow()`; curated HDRIs in [public/hdri/](public/hdri) (CC0, Poly Haven) | Live, wired into every three.js viewer on the platform (`/irl`, talk mode, `/play`, `/club`, `/ar`, `/xr`, `/walk`, `/coin3d`, marketplace lobby, demo pages, the `<agent-3d>`/`<page-agent>` embeds, and more) | One module every WebGLRenderer-based viewer calls into instead of re-deriving ACES tone mapping, sRGB output color space, HDRI image-based lighting, and soft VSM shadows per file. `detectQualityTier()` picks high/medium/mobile from real device signals and caps pixel ratio + disables shadows/HDRI accordingly; `loadEnvironment()` fetches a real photographic HDRI (`studio`/`outdoor`/`sunset`) and falls back to a procedural room environment on mobile tier or fetch failure (including cross-origin embed contexts where the absolute `/hdri/*.hdr` URL can't resolve). `/walk` keeps its own richer per-biome HDR system ([src/walk-environments.js](src/walk-environments.js)); surfaces already running a postprocessing tone-mapping pass (`/oracle-graph`, `/club-entrance`) only take the sRGB/HDRI half to avoid double-applying the curve. || `/play` Wheel of Fortune (Fortune's Folly; free/paid $THREE spins) | Client: [src/game/wheel-station.js](src/game/wheel-station.js) (the plaza landmark, proximity prompt, `E` to spin; lazy-imports the actual UI on first interact), spin UI [src/game/spin-wheel-ui.js](src/game/spin-wheel-ui.js) (20-segment wheel, free/paid flow, wallet signing). Server: [multiplayer/src/spin-wheel.js](multiplayer/src/spin-wheel.js) (paytable, RNG, level/cooldown/pack gates, handlers), split-payment settlement [multiplayer/src/game-token.js](multiplayer/src/game-token.js) (`buildSpinPayment`/`verifySpinPayment`; the same primitives the $THREE boutique uses), wheel location [multiplayer/src/world-features.js](multiplayer/src/world-features.js) `WHEEL`, persisted cooldown field in [multiplayer/src/economy.js](multiplayer/src/economy.js), handlers wired in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W09 of the World Online program (program brief retired to git history). Walk up to the wheel in the plaza and press `E`: one free spin every 12h (a real persisted cooldown; survives a disconnect, unlike the ephemeral per-action cooldowns everything else on this row's neighbors use), or pay $3 in `$THREE`; split 50% to the holder-rewards pool / 50% to the treasury, verified on-chain before any prize is granted, mirroring the boutique's proven settlement pattern exactly. Gated behind an average skill level of 3 (a light anti-farm floor, not a grind) and never lets a won prize get lost to a full pack; room for at least one possible item prize is checked before a spin is even offered, paid or free. All 20 wedges are equal-odds by design, matching the client's fixed-angle wheel rendering exactly (see the header note in `spin-wheel.js` on why that must never drift). Tests: [tests/spin-wheel.test.js](tests/spin-wheel.test.js). |-| `/play` live events (countdown chip, agenda drawer, synchronized fireworks) | Config `public/event.json` (one file, shared with the lobby countdown and the server-side souvenir grant). Client: in-world layer [src/game/meetup-event.js](src/game/meetup-event.js) + [src/game/meetup-event.css](src/game/meetup-event.css), pure schedule math [src/game/meetup-schedule.js](src/game/meetup-schedule.js), particle show [src/game/fireworks.js](src/game/fireworks.js), lobby banner + wayfinding pill [src/game/event-countdown.js](src/game/event-countdown.js). Mounted from [pages/play.html](pages/play.html) | In-repo | Turns the `$THREE` home town into a place something is *happening* in for the length of a scheduled event, driven entirely by `public/event.json`: delete the file and the world is normal again, with no code change. A countdown chip docks under the King of the Totem card (and stands the generic pill down, so there is only ever one countdown on screen) and opens a right-docked agenda drawer that marks the running segment, dims finished ones, counts the rest down in local time, and carries a live `$THREE` pulse row (`/api/three-signal`) plus one-tap Buy and commemorative-photo actions. Six phases derive from the wall clock (`far → upcoming → preshow → live → afterglow → ended`), so every player agrees on what is on and what is next without a round-trip. **Fireworks are deterministic, not networked:** four-second buckets hashed with the event id give every client the identical sky (`fireworkPlan()`), the same trick [src/shared/world-clock.js](src/shared/world-clock.js) uses for the shared sun; density ramps into a closing barrage, power-saver halves it, at most 14 shells live at once, and a backgrounded tab rejoins the show live instead of replaying the backlog `requestAnimationFrame` paused through. Preview any schedule with `?meetup=now` or `?meetup=<ISO>`. Doc: [docs/play-live-events.md](docs/play-live-events.md). Browser audit: `npm run audit:meetup` ([scripts/meetup-audit.mjs](scripts/meetup-audit.mjs)). Tests: [tests/meetup-schedule.test.js](tests/meetup-schedule.test.js), [tests/meetup-event-ui.test.js](tests/meetup-event-ui.test.js) |+| `/play` live events (countdown chip, agenda drawer, synchronized fireworks) | Config `public/event.json` (one file, shared with the lobby countdown and the server-side souvenir grant). Client: in-world layer [src/game/meetup-event.js](src/game/meetup-event.js) + [src/game/meetup-event.css](src/game/meetup-event.css), pure schedule math [src/game/meetup-schedule.js](src/game/meetup-schedule.js), particle show [src/game/fireworks.js](src/game/fireworks.js), lobby banner + wayfinding pill [src/game/event-countdown.js](src/game/event-countdown.js). Mounted from [pages/play.html](pages/play.html) | In-repo | Turns the `$THREE` home town into a place something is *happening* in for the length of a scheduled event, driven entirely by `public/event.json`: reset it to its no-event state (`npm run event:schedule -- --clear --apply`) and the world is normal again, with no code change. A countdown chip docks under the King of the Totem card (and stands the generic pill down, so there is only ever one countdown on screen) and opens a right-docked agenda drawer that marks the running segment, dims finished ones, counts the rest down in local time, and carries a live `$THREE` pulse row (`/api/three-signal`) plus one-tap Buy and commemorative-photo actions. Six phases derive from the wall clock (`far → upcoming → preshow → live → afterglow → ended`), so every player agrees on what is on and what is next without a round-trip. **Fireworks are deterministic, not networked:** four-second buckets hashed with the event id give every client the identical sky (`fireworkPlan()`), the same trick [src/shared/world-clock.js](src/shared/world-clock.js) uses for the shared sun; density ramps into a closing barrage, power-saver halves it, at most 14 shells live at once, and a backgrounded tab rejoins the show live instead of replaying the backlog `requestAnimationFrame` paused through. Preview any schedule with `?meetup=now` or `?meetup=<ISO>`. Doc: [docs/play-live-events.md](docs/play-live-events.md). Browser audit: `npm run audit:meetup` ([scripts/meetup-audit.mjs](scripts/meetup-audit.mjs)). Tests: [tests/meetup-schedule.test.js](tests/meetup-schedule.test.js), [tests/meetup-event-ui.test.js](tests/meetup-event-ui.test.js) || `/play` event souvenirs (a free wearable you keep for having been there) | Config `public/event.json` (`souvenir.cosmeticId`, the same file the countdown reads). Server: window/world/item resolution [multiplayer/src/event-drop.js](multiplayer/src/event-drop.js), join-time grant `_grantEventSouvenir` in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js), `event` tier + catalog entry [multiplayer/src/cosmetics-catalog.js](multiplayer/src/cosmetics-catalog.js), unlock + persistence [multiplayer/src/economy.js](multiplayer/src/economy.js). Client: drop card [src/game/event-souvenir.js](src/game/event-souvenir.js), wardrobe treatment [src/game/cosmetics-wardrobe.js](src/game/cosmetics-wardrobe.js). Asset: [public/accessories/laurel-meetup.glb](public/accessories/laurel-meetup.glb) generated by [scripts/generate-accessory-glbs.mjs](scripts/generate-accessory-glbs.mjs), poster by [scripts/render-accessory-thumbs.mjs](scripts/render-accessory-thumbs.mjs) | In-repo | Everyone who joins the event world between an event's `startsAt` and `endsAt` is granted a free commemorative wearable (the Meetup Laurel), once, forever, wearable in every coin world. After `endsAt` it is never granted again and there is no purchase path at any point: a third catalog tier, `event`, carries `price: 0`, so the boutique's `tier === 'premium' && price > 0` filter excludes it by construction and the x402 purchase ledger is filtered to premium ids so it cannot mint one. Server-authoritative and idempotent: the window and the world both come from the shared event config (never a client option), the grant is a no-op on an account that already owns it, and the one-shot `souvenir` message only fires on the not-owned to owned transition, so a reconnect produces neither a duplicate nor a second announcement. Fails open on every axis (no config, unreachable config, closed window, wrong world all mean grant nothing and never delay a join). Doc: [docs/event-souvenirs.md](docs/event-souvenirs.md). Tests: [tests/event-souvenir.test.js](tests/event-souvenir.test.js); live conformance `node scripts/play-souvenir-conformance.mjs` (real server, no browser) and `node scripts/play-souvenir-e2e.mjs` (real browser) || `/play` Coin Wars portal (in-world war door, league board, spectator screen) | Client: [src/game/war-portal.js](src/game/war-portal.js) + [src/game/war-portal.css](src/game/war-portal.css) (plaza landmark, canvas league board, queue panel, results echo), wired in [src/game/coincommunities.js](src/game/coincommunities.js); arena page [pages/play/war.html](pages/play/war.html) `→ /play/war` → [src/play/war.js](src/play/war.js) + [src/play/war-world.js](src/play/war-world.js) + [src/play/war.css](src/play/war.css). API: [api/wars.js](api/wars.js) `→ /api/wars` over [api/_lib/wars-store.js](api/_lib/wars-store.js) (ledger + queue + live registry) and [api/_lib/war-ticket.js](api/_lib/war-ticket.js) (signs a pairing). Server: [multiplayer/src/rooms/ClashRoom.js](multiplayer/src/rooms/ClashRoom.js) `clash_arena`, pairing math [multiplayer/src/war-matchmaking.js](multiplayer/src/war-matchmaking.js), ticket verify [multiplayer/src/war-ticket.js](multiplayer/src/war-ticket.js), spectator snapshots [multiplayer/src/war-live.js](multiplayer/src/war-live.js), league math [multiplayer/src/war-standings.js](multiplayer/src/war-standings.js), portal location [multiplayer/src/world-features.js](multiplayer/src/world-features.js) `WAR_PORTAL` | In-repo | F18. Coin Wars ran full community-vs-community battles with an Elo league behind it and no door into it from any world. The portal is that door: a plaza landmark whose board shows this coin's real league standing, its last battles, and any war running right now (read from `/api/wars`, folded through the arena's own standings module, never a second implementation). Press `E` to run the coin's holder gate and queue the community; the matchmaker pairs it with another waiting community, seals both sides into an HMAC war ticket, and hands the player to `/play/war` with a return link carrying the full coin identity, so walking back lands in the same world with the result already echoing on the board. While a war is live the board becomes a spectator screen (score, round clock, kill feed) off a cheap poll, and a win takes the board over for a few seconds. Costs nothing when nobody is near it: no poll fires outside `WAR_PORTAL_BOARD_REACH`. Docs: [docs/coin-wars.md](docs/coin-wars.md). Tests: [tests/war-matchmaking.test.js](tests/war-matchmaking.test.js), [tests/clash-match.test.js](tests/clash-match.test.js) || `/play` event countdown (lobby banner + in-world pill) | Self-attaching module [src/game/event-countdown.js](src/game/event-countdown.js) loaded by [pages/play.html](pages/play.html); config `public/event.json` (single source of the event window; the file is the edit surface for scheduling an event), read through the shared parser + state machine in [src/shared/event-config.js](src/shared/event-config.js). Verified end to end in a real browser by `npm run verify:event` ([scripts/verify-event-countdown.mjs](scripts/verify-event-countdown.mjs)). Campaign pack: [prompts/event/](prompts/event/) | In-repo | While `public/event.json` describes an upcoming or live event, the lobby shows a banner (name, tagline, local-time start, ticking countdown, CTA into the event world) and the in-world view gets a dismissible top-center pill (dismissal persisted per event in localStorage). Three explicit states: upcoming, live (pulsing marker, CTA suppressed when already standing in the event world), and over (everything unmounts, the interval stops). Zero edits to `coincommunities*.js` by design (the ambient-crowd pattern): it waits for the lobby DOM and mounts nothing when the config is missing, malformed, or expired. |@@ -151,7 +152,7 @@ bottom.| Memetic Launcher (per-user autonomous coin launcher) | [pages/launcher.html](pages/launcher.html) `→ /launcher` + [src/user-launcher.js](src/user-launcher.js), API [api/launcher/me.js](api/launcher/me.js), engine [api/_lib/launcher-engine.js](api/_lib/launcher-engine.js) (cron [api/cron/launcher-tick.js](api/cron/launcher-tick.js)), trends [api/_lib/launcher-trends.js](api/_lib/launcher-trends.js) | In-repo | Every user designs their own autonomous pump.fun launcher: mode (trend/meme/hybrid/random), trend sources, cadence, network. Preview (default) records picks without moving SOL; **Live** mints for real, SELF-FUNDED - each launch paid by the user's own agent wallet (base ~0.022 SOL + dev buy), never master SOL, with typed go-live confirm, dev-buy + daily-SOL-cap clamps, unfunded-wallet skips (breaker-immune), and an agent-wallet funding panel with live balances. Docs: [docs/memetic-launcher.md](docs/memetic-launcher.md). Tests: [tests/user-launcher.test.js](tests/user-launcher.test.js), [tests/launcher-engine.test.js](tests/launcher-engine.test.js) || On-chain agent invocation | [contracts/agent-invocation/](contracts/agent-invocation) | In-repo | Anchor program: verifiable agent-to-agent skill invocation events. SDK: [agent-protocol-sdk/](agent-protocol-sdk) || Cross-chain SDKs | [sdk/](sdk), [solana-agent-sdk/](solana-agent-sdk), [agent-payments-sdk/](agent-payments-sdk), [agent-protocol-sdk/](agent-protocol-sdk) | Published | Cross-chain agent SDKs |-| MCP integration | [mcp-server/](mcp-server), [mcp-bridge/](mcp-bridge), [packages/*-mcp/](packages) | 35 npm servers + 7 hosted remote (42 total, incl. the free `/api/mcp-studio` 3D Studio), all in the [MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas). Canonical metadata: [prompts/store-submissions/_generated/mcp-listing-source.json](prompts/store-submissions/_generated/mcp-listing-source.json) | Model Context Protocol surface, full server list in [docs/mcp.md](docs/mcp.md). Searchable index of every tool: [pages/mcp-tools.html](pages/mcp-tools.html) `→ /mcp-tools`, rendered from the generated [public/mcp-catalog.json](public/mcp-catalog.json) ([scripts/build-mcp-catalog.mjs](scripts/build-mcp-catalog.mjs), `npm run build:mcp-catalog`, staleness gated by `npm run audit:mcp-catalog`). Tool safety annotations are verified against each handler by [scripts/audit-mcp-safety.mjs](scripts/audit-mcp-safety.mjs) (`npm run audit:mcp-safety`, rules in [scripts/lib/mcp-safety-check.mjs](scripts/lib/mcp-safety-check.mjs), guarded-file list shared with the golden snapshot via [scripts/lib/mcp-tool-sources.mjs](scripts/lib/mcp-tool-sources.mjs)); docs [docs/mcp-safety.md](docs/mcp-safety.md) `→ /docs/mcp-safety`. Trust policy: [api/mcp-policy.js](api/mcp-policy.js) `-> GET /api/mcp-policy` turns those verified labels into a ready-to-paste client allowlist (profiles strict/balanced/open x formats claude/vscode/json), surfaced by the builder panel on `/mcp-tools`. Tests: [tests/mcp-safety-audit.test.js](tests/mcp-safety-audit.test.js), [tests/mcp-catalog.test.js](tests/mcp-catalog.test.js), [tests/api/mcp-policy.test.js](tests/api/mcp-policy.test.js) |+| MCP integration | [mcp-server/](mcp-server), [mcp-bridge/](mcp-bridge), [packages/*-mcp/](packages) | 37 npm servers + 7 hosted remote (44 total, incl. the free `/api/mcp-studio` 3D Studio), all in the [MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas). Canonical metadata: [prompts/store-submissions/_generated/mcp-listing-source.json](prompts/store-submissions/_generated/mcp-listing-source.json) | Model Context Protocol surface, full server list in [docs/mcp.md](docs/mcp.md). Searchable index of every tool: [pages/mcp-tools.html](pages/mcp-tools.html) `→ /mcp-tools`, rendered from the generated [public/mcp-catalog.json](public/mcp-catalog.json) ([scripts/build-mcp-catalog.mjs](scripts/build-mcp-catalog.mjs), `npm run build:mcp-catalog`, staleness gated by `npm run audit:mcp-catalog`). Tool safety annotations are verified against each handler by [scripts/audit-mcp-safety.mjs](scripts/audit-mcp-safety.mjs) (`npm run audit:mcp-safety`, rules in [scripts/lib/mcp-safety-check.mjs](scripts/lib/mcp-safety-check.mjs), guarded-file list shared with the golden snapshot via [scripts/lib/mcp-tool-sources.mjs](scripts/lib/mcp-tool-sources.mjs)); docs [docs/mcp-safety.md](docs/mcp-safety.md) `→ /docs/mcp-safety`. Trust policy: [api/mcp-policy.js](api/mcp-policy.js) `-> GET /api/mcp-policy` turns those verified labels into a ready-to-paste client allowlist (profiles strict/balanced/open x formats claude/vscode/json), surfaced by the builder panel on `/mcp-tools`. Tests: [tests/mcp-safety-audit.test.js](tests/mcp-safety-audit.test.js), [tests/mcp-catalog.test.js](tests/mcp-catalog.test.js), [tests/api/mcp-policy.test.js](tests/api/mcp-policy.test.js) || Agent Skills pack | [.agents/skills/](.agents/skills) → manifest [.agents/skills/SKILLS.md](.agents/skills/SKILLS.md), [.agents/skills/skills-pack.json](.agents/skills/skills-pack.json) | In-repo; bundled in the `three-ws-core` [plugin](.claude-plugin/marketplace.json) | 40 portable `SKILL.md` folders (Agent Skills open standard) for any Claude surface — 3d/creative (cross-platform-safe), wallet/payments, intel/trading. Regenerate manifest: `node scripts/build-skills-pack.mjs`. Docs: [docs/agent-skills.md](docs/agent-skills.md) || Claude Code plugin marketplace | [marketplace/](marketplace) → plugins [three-ws-3d](marketplace/plugins/three-ws-3d), [three-ws-developer](marketplace/plugins/three-ws-developer) | In-repo · installable via `/plugin marketplace add nirholas/three.ws` | 3D generation + rigged avatars inside Claude Code (free lane + paid x402 tools) and developer tooling for building on three.ws. Index: [marketplace/README.md](marketplace/README.md) || SNS naming + pay-by-name | [api/sns.js](api/sns.js), [api/sns-subdomain.js](api/sns-subdomain.js), [api/threews/subdomain.js](api/threews/subdomain.js), [api/x402/pay-by-name.js](api/x402/pay-by-name.js), [src/solana/sns-subdomain.js](src/solana/sns-subdomain.js), [pages/threews-claim.html](pages/threews-claim.html) | In-repo | `*.threews.sol` subdomain mint, x402 payments addressed by name. Env: `THREEWS_SOL_PARENT_SECRET_BASE58` |@@ -204,7 +205,7 @@ bottom.| Ghost-copy (paper-copy a leader) | [pages/ghost-copy.html](pages/ghost-copy.html) + [src/ghost-copy.js](src/ghost-copy.js) `→ /ghost-copy`, simulator [api/_lib/ghost-copy.js](api/_lib/ghost-copy.js), endpoint [api/pump/ghost-copy.js](api/pump/ghost-copy.js), tests [tests/ghost-copy.test.js](tests/ghost-copy.test.js) | Live (paper only, zero custody) | The bridge between the leaderboard and actually copying someone. Pick a verified trader agent, a budget and a window, and it replays that agent's real closed on-chain round-trips (`agent_sniper_positions`) against a wallet that does not exist, sizing every order through `planCopyOrder`, the SAME function the live [copy-fanout cron](api/cron/copy-fanout.js) uses, so the result is what the copy engine would actually have generated rather than a marketing figure. Deliberately unflattering: P&L per trade is derived from exact chain lamports (never the stored pct column), losing round-trips all count, the ghost wallet has a real cash constraint so capital locked in an open copy blocks the next one, every skip carries a machine reason plus a human sentence, and the leader's still-open positions are marked at THEIR last on-chain quote and reported as unrealized outside the realized headline. Needs no account, no wallet, no signature and no funded signer, so it ships ahead of any custody decision; state lives in the query string so a result is deep-linkable and shareable. Converts into [/vaults](pages/vaults.html) for real money. Doc: [docs/ghost-copy.md](docs/ghost-copy.md). || Clip Director (content engine) | [pages/clip-director.html](pages/clip-director.html) + [src/clip-director-page.js](src/clip-director-page.js) `→ /clip-director`, brain [api/_lib/clip-director.js](api/_lib/clip-director.js), endpoint [api/clip-director.js](api/clip-director.js) | Live | Turns one real closed trade (`agent_sniper_positions`) into the optimal shareable card per surface (X / Telegram / Feed): honest hook, the real number, an avatar gesture mapped to a real animation clip, CTA, and alt text, plus an on-chain proof link. Losses get an honest card too. Free-first `llmComplete` with a deterministic same-shape fallback. Doc: [docs/clip-director.md](docs/clip-director.md). || Atlas (site-wide Cmd+K search + route map) | Palette [public/atlas.js](public/atlas.js) `-> /atlas.js`, ranking [public/atlas/score.js](public/atlas/score.js), map page [pages/atlas.html](pages/atlas.html) + [src/atlas-page.js](src/atlas-page.js) `-> /atlas`, index [scripts/build-atlas-index.mjs](scripts/build-atlas-index.mjs) `-> public/atlas-index.json`, task catalog [data/atlas-intents.json](data/atlas-intents.json), coverage [scripts/inject-atlas.mjs](scripts/inject-atlas.mjs) | Live | **Discovery layer for 650+ routes.** Cmd+K (or `/`) opens a search over every page in `data/pages.json` plus a curated set of TASKS that answer with ordered steps rather than one link, because "which page starts the get-paid flow" is a harder question than "where is /x402-revenue". Zero-dependency single file so it runs identically on 250+ standalone HTML entry points; the index is fetched on first open, not page load. Every task step target is resolved against the real route table at build time, so an onboarding path cannot dead-end on a 404. Injected by a Vite `three-ws-atlas` plugin plus a post-build `dist/` walk (same belt-and-suspenders as [scripts/inject-tour-boot.mjs](scripts/inject-tour-boot.mjs), for the same plugin-ordering reason). Embeds and the nav/footer fragments are excluded. Doc: [docs/atlas.md](docs/atlas.md). Tests: [tests/atlas.test.js](tests/atlas.test.js). |-| Internationalization (i18n) | Runtime [src/i18n.js](src/i18n.js) `→ /i18n.js`; catalogs [public/locales/](public/locales) (`en` + 40 locales, `manifest.json`, `localized-pages.json`); pipeline [scripts/i18n-annotate.mjs](scripts/i18n-annotate.mjs) · [i18n-extract.mjs](scripts/i18n-extract.mjs) · [i18n-translate.mjs](scripts/i18n-translate.mjs) (Vertex Gemini, glossary-locked) · [i18n-backfill.mjs](scripts/i18n-backfill.mjs) (re-translates copy that was baked to English during a backend outage); hreflang in [api/sitemap/[type].js](api/sitemap/%5Btype%5D.js) | Live (41 languages) | LobeHub-model client-side copy swap. `npm run i18n:annotate` auto-injects `data-i18n*` into static HTML (byte-surgical), `i18n:extract` builds `en.json`, `i18n:translate` fans it out to every locale via Vertex with brand/protocol terms masked. `i18n:backfill` finds keys whose value is still byte-identical to English (the silent failure mode: a baked fallback is present, so every later run skips it) and re-translates them. Runtime auto-detects locale, mounts a floating `<lang-switcher>`, and injects hreflang. Doc: [docs/i18n.md](docs/i18n.md). Tests: [tests/i18n.test.js](tests/i18n.test.js), [tests/i18n-annotate.test.js](tests/i18n-annotate.test.js), [tests/i18n-backfill.test.js](tests/i18n-backfill.test.js). |+| Internationalization (i18n) | Runtime [src/i18n.js](src/i18n.js) `→ /i18n.js`; catalogs [public/locales/](public/locales) (`en` + 84 locales, `manifest.json`, `localized-pages.json`); pipeline [scripts/i18n-annotate.mjs](scripts/i18n-annotate.mjs) · [i18n-extract.mjs](scripts/i18n-extract.mjs) · [i18n-translate.mjs](scripts/i18n-translate.mjs) (Vertex Gemini, glossary-locked) · [i18n-backfill.mjs](scripts/i18n-backfill.mjs) (re-translates copy that was baked to English during a backend outage); hreflang in [api/sitemap/[type].js](api/sitemap/%5Btype%5D.js) | Live (85 languages) | LobeHub-model client-side copy swap. `npm run i18n:annotate` auto-injects `data-i18n*` into static HTML (byte-surgical), `i18n:extract` builds `en.json`, `i18n:translate` fans it out to every locale via Vertex with brand/protocol terms masked. `i18n:backfill` finds keys whose value is still byte-identical to English (the silent failure mode: a baked fallback is present, so every later run skips it) and re-translates them. Runtime auto-detects locale, mounts a floating `<lang-switcher>`, and injects hreflang. Doc: [docs/i18n.md](docs/i18n.md). Tests: [tests/i18n.test.js](tests/i18n.test.js), [tests/i18n-annotate.test.js](tests/i18n-annotate.test.js), [tests/i18n-backfill.test.js](tests/i18n-backfill.test.js). || Shared utilities (import instead of hand-rolling) | Frontend [src/shared/markdown.js](src/shared/markdown.js) · [src/shared/toast.js](src/shared/toast.js) · [src/shared/fuzzy.js](src/shared/fuzzy.js) · `timeAgo`/`toEpochMs` in [src/shared/coin-format.js](src/shared/coin-format.js); backend [api/_lib/resilience.js](api/_lib/resilience.js) · [api/_lib/mem-cache.js](api/_lib/mem-cache.js) · [api/_lib/pool.js](api/_lib/pool.js) · [api/_lib/csv.js](api/_lib/csv.js); ops [scripts/check-cron-drift.mjs](scripts/check-cron-drift.mjs) | Live · doc [docs/shared-utilities.md](docs/shared-utilities.md) | Thin layers over vetted packages, each replacing a family of hand-rolled copies that had drifted. `markdown.js` = `marked` + `DOMPurify`, the single sanitized path for model/user text reaching `innerHTML` (the concierge SDK carries its own copy at [concierge-sdk/src/markdown.js](concierge-sdk/src/markdown.js) because it ships as an independent bundle). `toast.js` = one aria-live region with a real queue. `fuzzy.js` = `@leeoniya/ufuzzy` ranking + typo tolerance + match ranges for both command palettes. `resilience.js` = `cockatiel` circuit breakers **and** jittered retry (`withRetry`, `parseRetryAfter`, `isRetryableError`). `mem-cache.js` = `lru-cache` with true recency eviction and single-flight `cached()`. `pool.js` = `p-limit` bounded concurrency. `csv.js` = RFC 4180 quoting **plus** spreadsheet formula-injection neutralization. `check-cron-drift.mjs` = `cron-parser` validation of vercel.json's 101 crons against live Cloud Scheduler. Tests: [tests/shared-markdown.test.js](tests/shared-markdown.test.js), [tests/fuzzy.test.js](tests/fuzzy.test.js), [tests/csv.test.js](tests/csv.test.js), [tests/resilience-shared.test.js](tests/resilience-shared.test.js) || Interactive 3D history timeline | [pages/timeline.html](pages/timeline.html) `→ /timeline`, [src/timeline.js](src/timeline.js), data [data/timeline.json](data/timeline.json) | Live | three.ws's public history (launches, partnerships, listings, press, product ships) as an explorable 3D scene: 60+ milestones as glowing markers along a curved path, 360° free-orbit or a marker-to-marker Walk mode with a guide beacon (reuses the shared `AnimationManager` + default rig from [src/walk.js](src/walk.js)'s pattern), a synced bottom scrubber, category filters, and a detail panel linking to the original source where one exists (IBM Community, NVIDIA Developer Forums, Yahoo Finance, Phemex, CoinGecko, HackerNoon). Real accessible HTML-list fallback for no-WebGL or fetch-failure. |diff --git a/docs/index.html b/docs/index.htmlindex f1db9fb41..302343796 100644--- a/docs/index.html+++ b/docs/index.html@@ -35,10 +35,14 @@an ERR_UNKNOWN_URL_SCHEME per figure. Same files the tutorial viewerloads, so a figure looks identical on every surface. --><link rel="stylesheet" href="/tutorial-figures.css" />- <script src="/tutorial-figures.js"></script>- <script src="/model-viewer-meshopt.js"></script>- <script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"></script>- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>+ <link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />+ <!-- All four are deferred so they stop blocking the parser; nothing here is+ needed before the shell's boot, which waits for DOMContentLoaded (fired+ only after every deferred script has executed). -->+ <script src="/tutorial-figures.js" defer></script>+ <script src="/model-viewer-meshopt.js" defer></script>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js" defer></script>+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" defer></script><style>:root {--sidebar-w: 268px;@@ -949,7 +953,7 @@<body><header class="docs-header"><a href="/" class="docs-logo">- <img src="/three.svg" class="docs-logo-mark" alt="" aria-hidden="true" />three.ws+ <img src="/three.svg" class="docs-logo-mark" alt="" aria-hidden="true" width="24" height="24" />three.ws</a><span class="docs-header-sep"></span><span class="docs-header-label">Docs</span>@@ -1171,16 +1175,21 @@}).join('');}- marked.setOptions({- highlight: (code, lang) => {- if (lang && hljs.getLanguage(lang)) {- return hljs.highlight(code, { language: lang }).value;- }- return hljs.highlightAuto(code).value;- },- gfm: true,- breaks: false,- });+ // marked/hljs arrive via deferred head scripts, so this must not run at+ // parse time; the boot below calls it once DOMContentLoaded guarantees+ // they have executed.+ function configureMarked() {+ marked.setOptions({+ highlight: (code, lang) => {+ if (lang && hljs.getLanguage(lang)) {+ return hljs.highlight(code, { language: lang }).value;+ }+ return hljs.highlightAuto(code).value;+ },+ gfm: true,+ breaks: false,+ });+ }const COPY_ICON ='<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>';@@ -1760,7 +1769,15 @@buildSidebar(document.getElementById('search-input').value);navigate();}- loadNav();+ function boot() {+ configureMarked();+ loadNav();+ }+ if (document.readyState === 'loading') {+ document.addEventListener('DOMContentLoaded', boot);+ } else {+ boot();+ }</script><div id="footer-container"></div>diff --git a/docs/ops/gcp-production.md b/docs/ops/gcp-production.mdindex 1d11ad703..130f6a7be 100644--- a/docs/ops/gcp-production.md+++ b/docs/ops/gcp-production.md@@ -35,12 +35,13 @@ Cloud Run service "three-ws-api" (us-central1, min 0, 2 vCPU / 2 Gi, timeout 900allow-unauthenticated, runtime SA three-ws@…)└─ one Express container (server/index.mjs) serving:• static frontend from dist/ (baked into the image)- • the 1,047-rule vercel.json route table (headers/rewrites/redirects/404)+ • the vercel.json route table (1,236 rules as of 2026-08-13:+ headers/rewrites/redirects/404)• all api/** handlers with Vercel-parity filesystem routing│Data layer (unchanged by the migration — all vendor-neutral HTTP):Neon Postgres (DATABASE_URL) · Upstash Redis · Cloudflare R2 (S3_* / R2_*)-Cloud Scheduler: 76 jobs (one per vercel.json cron) → GET /api/cron/* with+Cloud Scheduler: one job per vercel.json cron (105 as of 2026-08-13) → GET /api/cron/* with`Authorization: Bearer $CRON_SECRET````@@ -118,9 +119,10 @@ aerial-vehicle-466722-p5 --filter="bindings.members:three-ws-build@"`.```bash# Frontend changed? Build first — dist/ ships from the local build.-# build:gcp = site build -> agent-3d CDN lib (build:lib:full) -> publish:lib-# -> build:info -> check:dist -> check:pages, IN THAT ORDER. The order is-# load-bearing: the+# build:gcp = check:conflicts -> check:browser-graph -> ensure:avatar-studio+# -> build:info:snapshot -> build:chat -> site build -> agent-3d CDN lib+# (build:lib:full) -> publish:lib -> build:info -> check:dist -> check:pages,+# IN THAT ORDER. The order is load-bearing: the# site `vite build` WIPES dist/, so it must run before publish:lib mirrors the# lib into dist/. Plain `npm run build` is NOT enough (skips the lib publish, so# /agent-3d/latest/agent-3d.js 404s and the hero avatar dies). Hand-running@@ -438,9 +440,10 @@ Now every `sendOpsAlert()` **always** persists to the `ops_alerts` table(`api/_lib/alerts.js`, migration `20260712000000_ops_alerts.sql`), keyed by thealert's stable signature so a recurring condition is one row with a growing`count`, not a flood. Read the active feed from the `ops_alerts` table or the-`x-ops-secret`-gated ops APIs (`/api/ops/health` and friends, `OPS_SECRET`-falling back to `CRON_SECRET`). This is the primary sink and needs no-third-party service.+`x-ops-secret`-gated ops APIs (`/api/ops/health` and friends; the gate is+`authorizeOps` in `api/_lib/ops-auth.js`: admin session or a dedicated+`OPS_SECRET`, deliberately never `CRON_SECRET`, fail-closed in production).+This is the primary sink and needs no third-party service.Telegram is now an **optional extra push**, off by default. When both`TELEGRAM_BOT_TOKEN` and `TELEGRAM_ALERTS_CHAT_ID` are set, alerts also push todiff --git a/docs/ops/llm-lanes.md b/docs/ops/llm-lanes.mdindex 813a5734b..3d2a50bc1 100644--- a/docs/ops/llm-lanes.md+++ b/docs/ops/llm-lanes.md@@ -17,25 +17,35 @@ seconds.`api/_lib/llm.js` builds it. Free rungs first, always, because the paid keys inproduction are routinely dead and a chain that depends on them fails:-| # | Rung | Key | Cost to us | State (2026-08-02) |+| # | Rung | Key | Cost to us | State ||---|---|---|---|---|-| 1 | Groq `llama-3.3-70b-versatile` | `GROQ_API_KEY` | free | **serving** (200, ~1.0s) |+| 1 | Groq `llama-3.3-70b-versatile` | `GROQ_API_KEY` | free | **serving** (200, ~1.0s, 2026-08-02) || 2 | Cerebras `llama-3.3-70b` | `CEREBRAS_API_KEY` | free | not configured in prod |-| 3 | OpenRouter `:free` routes, one rung per key | `OPENROUTER_API_KEY`, `OPENROUTER_FALLBACK_KEYS` | free | **serving** on the fallback keys |-| 4 | NVIDIA NIM `meta/llama-3.3-70b-instruct` | `NVIDIA_API_KEY` | free | 429 (rate limited at probe time) |-| 5 | OVH AI Endpoints `Meta-Llama-3_3-70B-Instruct` | none (keyless) | free | **serving** (200, ~1.2s) |-| 6 | Gemini Flash-Lite (AI Studio) | `GEMINI_API_KEY` | free | not configured in prod |-| 7 | **Vertex Gemini Flash** | GCP service account | GCP credits | **serving**, the reliability anchor |-| 8 | Pollinations `openai-fast` | none (keyless) | free | **serving** (200, ~3.7s) |-| 9 | Groq `llama-3.1-8b-instant` | `GROQ_API_KEY` | free | serving (separate per-model quota) |-| 10 | Vertex Claude | GCP service account + `VERTEX_CLAUDE_ENABLED=1` | GCP credits | **off and unentitled** (see below) |-| 11 | Anthropic first-party | `ANTHROPIC_API_KEY` | paid | **absent** (no key anywhere) |-| 12 | OpenRouter Claude mirror | `OPENROUTER_CLAUDE_MIRROR_MODEL` | paid | off by default (see below) |-| 13 | OpenAI `gpt-5.4-nano` | `OPENAI_API_KEY` | paid | **dead**: 429 `billing_not_active` |-| 14 | xAI Grok | `GROK_API_KEY` | paid | not configured in prod |--Rungs 1 to 9 are not a degradation path any more. They are production. Every one-of them is covered by a transport-level failover test+| 3 | OpenRouter `:free` routes, one rung per key | `OPENROUTER_API_KEY`, `OPENROUTER_FALLBACK_KEYS` | free | **serving** on the fallback keys (2026-08-02) |+| 4 | NVIDIA NIM `meta/llama-3.3-70b-instruct` | `NVIDIA_API_KEY` | free | 429 (rate limited at probe time, 2026-08-02) |+| 5 | SambaNova `Meta-Llama-3.3-70B-Instruct` | `SAMBANOVA_API_KEY` | free | added 2026-08-05; skipped when the key is unset |+| 6 | Mistral `mistral-small-latest` (Experiment tier) | `MISTRAL_API_KEY` | free | added 2026-08-05; skipped when the key is unset |+| 7 | Z.AI `glm-4.7-flash` | `ZAI_API_KEY` | free | added 2026-08-05; skipped when the key is unset |+| 8 | Cloudflare Workers AI `@cf/meta/llama-3.3-70b-instruct-fp8-fast` | `CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_AI_API_TOKEN` | free | added 2026-08-05; skipped when either is unset |+| 9 | OVH AI Endpoints `Meta-Llama-3_3-70B-Instruct` | none (keyless) | free | **serving** (200, ~1.2s, 2026-08-02) |+| 10 | Gemini Flash-Lite (AI Studio) | `GEMINI_API_KEY` | free | not configured in prod |+| 11 | **Vertex Gemini Flash** | GCP service account | GCP credits | **serving**, the reliability anchor |+| 12 | Pollinations `openai-fast` | none (keyless) | free | **serving** (200, ~3.7s, 2026-08-02) |+| 13 | LLM7.io `gemini-3.1-flash-lite` | none (keyless) | free | added 2026-08-05, the third keyless rung |+| 14 | SiliconFlow `Qwen/Qwen3-8B` | `SILICONFLOW_API_KEY` | free | added 2026-08-05; skipped when the key is unset |+| 15 | Groq `llama-3.1-8b-instant` | `GROQ_API_KEY` | free | serving (separate per-model quota) |+| 16 | Vertex Claude | GCP service account + `VERTEX_CLAUDE_ENABLED=1` | GCP credits | **off and unentitled** (see below) |+| 17 | Anthropic first-party | `ANTHROPIC_API_KEY` | paid | **absent** (no key anywhere) |+| 18 | OpenRouter Claude mirror | `OPENROUTER_CLAUDE_MIRROR_MODEL` | paid | off by default (see below) |+| 19 | OpenAI `gpt-5.4-nano` | `OPENAI_API_KEY` | paid | **dead**: 429 `billing_not_active` |+| 20 | xAI Grok | `GROK_API_KEY` | paid | not configured in prod |++The 2026-08-05 widening (SambaNova, Mistral, Z.AI, Cloudflare, LLM7,+SiliconFlow) added six independent free quota pools; each is documented with+its tier limits in `docs/free-llm-providers.md`.++Rungs 1 to 15 are not a degradation path any more. They are production. Every+one of them is covered by a transport-level failover test(`tests/api/llm-free-chain-reachability.test.js`): each case kills the rungsabove it the way a provider actually dies (dropped socket, abort, empty 503) andrequires the next rung to answer. A fallback that only catches a parse error is@@ -44,7 +54,8 @@ exists to prevent.`/brain` (`api/brain/chat.js`) runs its own chain with the same shape: requestedmodel → OpenRouter mirror of that model → free safety net (Groq → OpenRouter-`:free` per key → NVIDIA) → the Vertex Gemini anchor.+`:free` per key → NVIDIA → SambaNova → Mistral → Z.AI) → the Vertex Gemini+anchor.### Why the paid rungs are outdiff --git a/docs/ux-flows/02-forge-text-to-3d.md b/docs/ux-flows/02-forge-text-to-3d.mdindex f5356ba82..39e1ac361 100644--- a/docs/ux-flows/02-forge-text-to-3d.md+++ b/docs/ux-flows/02-forge-text-to-3d.md@@ -16,8 +16,8 @@ Routing facts (from `vercel.json`):### Forge (Text / Photos / Sketch → 3D) — `/forge`- **Source:**- - `pages/forge.html` (4153 lines: full composer/stage markup + styles)- - `src/forge.js` (3213 lines: main controller, catalog, engine/tier selection, job submit, polling, result, gating; imports `src/forge-timeline.js` for the generation stage timeline and `src/forge-compare.js` for side-by-side compare)+ - `pages/forge.html` (~4200 lines: full composer/stage markup + styles)+ - `src/forge.js` (~3300 lines: main controller, catalog, engine/tier selection, job submit, polling, result, gating; imports `src/forge-timeline.js` for the generation stage timeline and `src/forge-compare.js` for side-by-side compare)- `src/forge-prompt-studio.js` (Surprise-me + prompt coach; prompts come from the slot-grammar generator `src/forge-prompt-gen.js`), `src/forge-enhance.js` (AI prompt rewrite → `/api/forge-enhance`), `src/forge-directed-prompt.js` (reveals the server's art-director rewrite from the `directed_prompt` response field)- `src/forge-dropzone.js` (paste/drop image handling), `src/forge-reveal.js` (WebGL "materialize" dissolve overlay), `src/forge-wait.js` (rotating craft tips while generating)- `src/forge-refine.js` (in-browser geometry refine, no API), `src/forge-stylize.js` (→ `/api/forge-stylize`), `src/forge-optimize.js` (→ `/api/forge-remesh`), `src/forge-gameready.js` (→ `/api/forge-gameready`)@@ -28,7 +28,7 @@ Routing facts (from `vercel.json`):- **Prerequisites / gates:**- **None for the default lane.** Draft/Standard tiers on the free NVIDIA-hosted engine require no auth, no wallet, no payment ("No account required for your first model").- **BYOK engines** (Fast, Meshy, Tripo, Rodin, Stability, Replicate) require the user to paste their own provider API key (kept in-browser, sent as `x-forge-provider-key` header).- - **High quality tier** is gated: it is a `$THREE` holder perk (hold-OR-pay). A holder clears it with a tier pass (`attachTierPass`); a non-holder gets a `402 three_hold_required` and may **pay-per-generation in $THREE** via `forge-pay.js`, or hold $THREE. BYOK High is server-exempt (no pass needed).+ - **High quality tier** is gated: it is a `$THREE` holder perk (hold-OR-pay). A holder clears it with a tier pass (`attachTierPass`); a non-holder gets a `402 three_hold_required` and may **pay-per-generation in $THREE** via `forge-pay.js`, or hold $THREE. BYOK High is server-exempt (no pass needed). A server-side comp allowlist (`api/_lib/comp-access.js`, wired into `requireFeatureAccess` and `GET /api/three/access`) clears an allowlisted account through every $THREE gate (`forge.high`, `forge.gameready`, and any gate added later) with no holding, wallet, or payment.- Rate limiting applies on the paid lane (server-side, surfaced as a recoverable `429` state).- **Steps (core text→3D path):**1. User lands on `/forge`; `forge.js` fetches the engine/tier catalog (`GET /api/forge?catalog=1`) and live backend health (`GET /api/forge?health=1`), then builds the tier buttons (Draft/Standard/High) and the per-mode engine selector. The empty stage (`#state-empty`) shows an idle community/sample model.@@ -49,9 +49,9 @@ Routing facts (from `vercel.json`):16. (optional) **Iterate** (`forge-conversational-refine.js`): a free-text instruction against the model on screen ("make the helmet red", "add a cape") via `POST /api/forge-iterate` (polled). The only post-result action that changes the model's shape from natural language; same core as the MCP `refine_model` tool.17. (optional) **Stylize** (`forge-stylize.js`): voxels/bricks/lattice/low-poly geometric filters via `POST /api/forge-stylize` (worker job, polled), with a resolution slider, download, and revert.18. (optional) **Restyle materials** (`forge-materials.js`): free-text or preset-chip PBR re-skin (chrome, brushed gold, weathered wood, ...) via synchronous `POST /api/material-studio?action=restyle`; geometry untouched. Same pipeline as the paid `restyle_material` MCP tool.- 19. (optional) **Rig for animation** (`forge-rig.js`): adds a humanoid skeleton + skin weights to the current GLB via `POST /api/forge?action=rig` (self-hosted GCP UniRig, Replicate fallback), polled through the same `GET /api/forge?job=` contract.+ 19. (optional) **Rig for animation** (`forge-rig.js`): adds a humanoid skeleton + skin weights to the current GLB via `POST /api/forge?action=rig` (the self-hosted GCP model-rig worker, falling back to the configured Replicate rerig model), polled through the same `GET /api/forge?job=` contract.20. (optional) **Optimize topology** (`forge-optimize.js`): tri/quad/low-poly remesh via `POST /api/forge-remesh` (polled).- 21. (optional) **Game-Ready** (`forge-gameready.js`): retopologize to a poly budget and export a textured GLB + FBX for Unity/Unreal via `POST /api/forge-gameready` (polled), with budget slider + wireframe preview.+ 21. (optional) **Game-Ready** (`forge-gameready.js`): retopologize to a poly budget and export a textured GLB + FBX for Unity/Unreal via `POST /api/forge-gameready` (polled), with budget slider + wireframe preview. Gated on the same $THREE hold-or-pay model as High tier: the panel resolves the viewer's real entitlement first (a signed-in holding or a connected wallet, via `getAccess`/`attachTierPass`), a verified holder exports free, and a non-holder gets a server-quoted pay-per-export price in $THREE.22. (optional) **Split into parts** → links to `/segment?mesh=<glb>` (Parts Studio). **Compose** → `/compose?glb=<glb>` (Scene Composer / attach to avatar). **Place IRL** → `/irl?avatar=<glb>` (anchor the model in a real room).23. (optional) **Export** (`forge-export.js`): in-browser convert to OBJ / STL / PLY / USDZ (lazy three.js exporters, no upload).24. (optional) **Reel** (`forge-reel.js`): fully client-side cinematic capture of the model into a looping video (MP4 or WebM), a hero still, and a transparent-PNG cutout; no upload, no worker.@@ -74,14 +74,14 @@ Routing facts (from `vercel.json`):- Submit/poll: `POST /api/forge`, `GET /api/forge?job=<id>`- Uploads: `POST /api/forge-upload` (presign) + `PUT` object storage- Flywheel: `POST /api/forge-feedback`, `POST /api/forge-categorize`, `POST /api/forge-poster`- - Galleries: `GET /api/forge-gallery?limit=24` (your creations), `GET /api/forge-gallery?scope=community&limit=24` (showcase, plus `&sort=` for the Forge-Off board), `POST /api/forge-vote` (showcase upvotes), `GET /api/forge-creation?id=` (share open)+ - Galleries: `GET /api/forge-gallery?limit=24` (your creations), `GET /api/forge-gallery?scope=community&limit=24` (showcase, plus `&sort=` for the Forge-Off board), `POST /api/forge-vote` (showcase upvotes), `GET /api/forge-creation?id=` (share open), `DELETE /api/forge-creation?id=` (each "Your creations" card carries a two-tap arm-then-confirm delete, scoped to the owning `x-forge-client`; it erases the stored GLB, preview, and every recorded source photo upload, so an image-to-3D run's reference pictures leave object storage with it)- Post-processing jobs: `POST /api/forge-stylize`, `POST /api/forge-remesh`, `POST /api/forge-gameready`, `POST /api/forge-enhance`, `POST /api/forge-iterate` (all polled by `?job=`); `POST /api/forge?action=rig` (auto-rig, polled by `GET /api/forge?job=`); `POST /api/material-studio?action=restyle` (synchronous)- Payment: `forge-pay.js` → `src/token-pay.js` → `/api/token/quote` + `/api/token/settle` ($THREE)- Access/tier pass: `/api/three/access` (read) + tier-pass mint (referenced via `attachTierPass`/`getTierPass`)- Generation engines: FLUX (image) → TRELLIS (mesh) free lane; BYOK Meshy / Tripo / Rodin / Stability / Replicate; Hunyuan3D / TripoSG (sketch). Hosted on NVIDIA NIM / providers; same pipeline exposed to agents over MCP at `/api/mcp-3d`.- **Photoreal reference-image path (the realism lever):** the final mesh reads as real only if the reference image the reconstructor sees is a photoreal, single-subject, plain-seamless-background, evenly-lit photograph. Two pieces drive that:- `POST /api/forge-enhance` (director): rewrites the raw prompt into one centered real-world subject with material + surface micro-detail + neutral studio-lighting cues. It classifies the subject (person / animal / vehicle / food / object) and returns a `subject`-aware `negative_prompt` targeting that class's failure modes (hands/faces for people, wheel-count/panel symmetry for vehicles, plastic-replica sheen for food). It prefers a Vertex Gemini rewrite (GCP credits) and falls through to the free-first LLM chain automatically, so it never hard-depends on Vertex. Response schema is unchanged apart from the additive `subject` field.- - `api/_lib/forge-reference-image.js` → `generateReferenceImage(directedPrompt, { aspectRatio, negativePrompt?, seed, skipNim })`: generates the reconstruction reference image on the Vertex Gemini 2.5 Flash Image lane (`imageConfig.imageSize:"2K"`), tuned as a plain-background studio photo, with the director's negatives folded in as natural-language avoidance. Automatic fallthrough to the existing provider chain (`textToImage`: NIM FLUX free → Vertex Imagen → Replicate), returning the same `{ imageUrl, model }` shape. When `negativePrompt` is omitted it derives subject-aware negatives from the prompt itself, so a caller gets them for free. `api/forge.js` now imports it on the text→3D path (dynamic import with `textToImage` as the fallback).+ - `api/_lib/forge-reference-image.js` → `generateReferenceImage(directedPrompt, { aspectRatio, negativePrompt?, seed, skipNim })`: generates the reconstruction reference image on the Vertex Gemini 2.5 Flash Image lane (`imageConfig.imageSize:"2K"`), tuned as a plain-background studio photo, with the director's negatives folded in as natural-language avoidance. Automatic fallthrough to the existing provider chain (`textToImage`: NIM FLUX free → Vertex Imagen → Replicate), returning `{ imageUrl, model, lane }` (generated base64 output is persisted through the shared `image-persist` lib). The same directed prompt + aspect + negatives within 24h reuses its cached reference set instead of re-spending a Vertex generation. When `negativePrompt` is omitted it derives subject-aware negatives from the prompt itself, so a caller gets them for free. `api/forge.js` imports it on the text→3D path (dynamic import with `textToImage` as the fallback).- 3rd-party viewer: model-viewer 4.0.0 (googleapis CDN).- **Success state:** A textured **GLB** standing in the in-page `<model-viewer>` (orbit/AR), auto-saved to "Your creations", with a downloadable file and all post-processing/export/embed/share actions enabled. Optional converted formats (OBJ/STL/PLY/USDZ/FBX) and a community showcase entry.- **Empty / error states:**diff --git a/docs/ux-flows/10-chat-brain-labs.md b/docs/ux-flows/10-chat-brain-labs.mdindex df9ec0d45..eadb85bf2 100644--- a/docs/ux-flows/10-chat-brain-labs.md+++ b/docs/ux-flows/10-chat-brain-labs.md@@ -11,7 +11,7 @@ modules. Routes resolved via `vercel.json` rewrites.- **Entry point:** `/chat` → `chat/index.html` (`<div id="app">` mounted by `main.js`).- **Prerequisites / gates:** None to start chatting: free built-in models stream through the server proxy with no key. Optional gates: user-supplied API key (Anthropic/OpenAI/Groq/Mistral/Ollama/OpenRouter) stored locally for non-built-in models; wallet sign-in (SIWE/SIWS via `/api/auth/*`) only for cross-device sync + on-chain tool calls; `TxApprovalModal` requires a connected wallet for wallet/pump tool transactions. No $THREE gate. Voice output is opt-in (off by default).- **Steps (6):**- 1. Open `/chat`; app boots, fetches the free model list from `/api/chat/models`, shows empty state with suggestion chips. `BUILTIN_MODELS` in `providers.js` is only a first-paint seed; `resolveDefaultModel()` prefers a model the server reports as live, so if the configured default has been retired upstream a new conversation opens on a live model instead of a dead one.+ 1. Open `/chat`; app boots, fetches the free model list from `/api/chat/models`, shows empty state with suggestion chips. `BUILTIN_MODELS` in `providers.js` is only a first-paint seed; `resolveDefaultModel()` prefers a model the server reports as live, so if the configured default has been retired upstream a new conversation opens on a live model instead of a dead one. The list also carries one virtual entry, "three.ws Agent · server tools": a server-side agent loop that answers through `/api/chat/proxy` in the same wire format but runs multiple tool-calling LLM rounds per message; it is appended last so it can never become the silent default.2. (optional) Click the model selector and pick an LLM, or open `AgentPicker` to load a persona/agent (from `/api/agents`, `/api/marketplace/agents`, or the agent library JSON). Loading an agent mounts its live `<agent-3d>` avatar in the panel.3. (optional) Open Settings → Avatar and turn on "Speak replies aloud", optionally picking one of the browser's installed voices and previewing it. The sidebar holding the Settings button renders once a conversation has messages, so a first-time visitor reaches it after their first reply.4. Type a message in the composer and submit (or attach an image / file for multimodal).@@ -101,14 +101,14 @@ modules. Routes resolved via `vercel.json` rewrites.### Launchpad Studio — `/launchpad`- **Source:** `/workspaces/three.ws/pages/launchpad.html` → `mountLaunchpadLanding` from `/workspaces/three.ws/src/launchpad/landing.js` (a discovery front door), which lazy-imports `mountLaunchpadStudio` from `/workspaces/three.ws/src/editor/launchpad-studio.js` only when the URL deep-links the editor.- **Entry point:** Bare `/launchpad` renders the landing page; a URL carrying `?slug=`, `?template=`, `?wallet=`, `?avatar=`, `?build`, or `?studio` mounts the studio into `#root` (3-pane: sidebar / live-preview stage / config rail).-- **Prerequisites / gates:** Building/previewing is open. **Publishing requires a payout wallet address** (throws "Add your payout wallet address." otherwise) and writes via `/api/launchpad/publish`; editing an existing published page (`?slug=`) hydrates owner state and requires owner sign-in. Templates include a Token Launchpad (one-click Pump.fun mint with creator-fee split — generic runtime mint, $THREE-compliant). No $THREE gate to use the editor.+- **Prerequisites / gates:** Building/previewing is open, and so is a first publish: anonymous publishing is allowed by design. **Publishing requires a payout wallet address** (throws "Add your payout wallet address." otherwise, validated against the selected chain server-side) and writes via `/api/launchpad/publish`; editing an existing published page (`?slug=`) hydrates via the public `/api/launchpad/get` read, and re-publishing it requires the `ownerSecret` the first publish stored in localStorage or a signed-in session matching the page's owner (anything else answers `409 slug_taken`). Templates include a Token Launchpad (one-click Pump.fun mint with creator-fee split — generic runtime mint, $THREE-compliant). No $THREE gate to use the editor.- **Steps (6):**1. Open `/launchpad`; the landing renders. Enter the studio via a template/build CTA (or a deep-linked URL); the studio mounts with a default template (`token-launchpad`) and recent-projects from localStorage.2. Pick a template card (`token-launchpad`, `paid-concierge`, or `gated-showroom`).3. Fill the config form (slug, brand color, payout wallet, website, theme, avatar, monetization/chain) — live preview updates in the center stage.4. (optional) Attach a 3D avatar (agent-3d element) into the avatar-stage slot.5. Add the payout wallet address (required for publish).- 6. Click Publish → `POST /api/launchpad/publish`; on success the page is hosted at `/p/<slug>` and an owner token is kept in localStorage for re-edits.+ 6. Click Publish → `POST /api/launchpad/publish`; on success the page is hosted at `/p/<slug>` and the returned `ownerSecret` is kept in localStorage for re-edits.- **Decision points / branches:** landing browse vs studio deep-link; template choice (token-launchpad vs paid-concierge vs gated-showroom); new vs edit (`?slug=` hydration via `/api/launchpad/get`); chain/payout selection; signed-in owner vs anonymous (owner-only sections hidden on 401).- **External calls / dependencies:** `POST /api/launchpad/publish`, `GET /api/launchpad/get` (hydrate existing), `/api/agents` (my-agents avatar picker), Pump.fun launch plumbing (runtime mint, creator-fee split). agent-3d / Three.js for the avatar preview.- **Success state:** A live hosted page at `/p/<slug>` with the chosen template, brand, avatar, and (for token template) a one-click Pump.fun mint; editable later from the same browser.