Skip to content

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.

docs(ux-flows): update the onboarding, chat, account, and home walkthroughs to shipped behavior

nirholas7ddc0e417d6d
diff --git a/docs/ux-flows/01-onboarding-creation.md b/docs/ux-flows/01-onboarding-creation.md
index b1aa7886a..81272cc09 100644
--- a/docs/ux-flows/01-onboarding-creation.md
+++ b/docs/ux-flows/01-onboarding-creation.md
@@ -31,15 +31,16 @@
### Avatar Method Picker — `/create`
- **Source:** `pages/create.html` + `src/create.js` (imports `src/account.js`, `src/avatar-creator.js`, `src/guest-avatar.js`, `src/shared/template-picker.js`, `src/shared/crypto-optional.js`, `src/wallet-auth.js` inline)
- **Entry point:** Nav/landing CTA; reached from `/start` Step 1 "Editor" with `?wizard=1&next=`. Also handles `?fork=<avatarId>` deep-links (remix an existing avatar).
-- **Prerequisites / gates:** Anonymous-friendly for the default editor / customize / studio / direct GLB upload (guest avatar staged in IndexedDB; auth deferred to `/create-review`). **Auth-gated paths:** Selfie card (`requireAuthForSelfie` → redirect `/login?next=/create/selfie`) and Prompt card (redirect `/login?next=/create/prompt`). Signed-in users also hit an avatar-quota check (`/api/usage/summary`) before opening a creator. No wallet/$THREE gate.
+- **Prerequisites / gates:** Anonymous-friendly for the base-avatar editor / template / studio / direct GLB upload (guest avatar staged in IndexedDB; auth deferred to `/create-review`). **Auth-gated paths:** the selfie card (`requireAuthForSelfie` → redirect `/login?next=/create/selfie`), the prompt card (redirect `/login?next=/create/prompt`), and the video card (redirect `/login?next=/create/video`). Signed-in users also hit an avatar-quota check (`/api/usage/summary`) before opening a creator. No wallet/$THREE gate.
- **Steps (N):**
- 1. Land on `/create`. `boot()` probes `/api/config` for the `videoAvatar` feature flag (greys out the video card if off) and, for signed-in users with avatars, loads `/api/avatars` to render a "Start from one of yours" remix strip.
- 2. (optional) If `?fork=<id>` present: `handleFork` runs immediately — POST `/api/avatars/fork` (signed-in → owned copy → redirect `/avatars/<id>`); on 401/403 falls back to fetching the source, downloading its GLB, staging a guest copy, and redirecting to `/create-review`.
- 3. Choose a creation method card: **Default editor** (`AvatarCreator.openDefaultEditor`), **Customize** (`createFromTemplate`), **Agent Studio** (→ `/create/studio`), **Selfie** (→ `/create/selfie`, auth-gated), **Prompt** (→ `/create/prompt`, auth-gated), **Talking avatar video** (→ `/create/video`, feature-flagged + auth-gated), or **Upload GLB** (`#glb-input`).
- 4. (optional) Upload path: pick a `.glb`; `handleGlbFile` validates the GLB magic bytes, then `stageAndReview` stashes the blob via `guest-avatar.js` (IndexedDB) and navigates to `/create-review`.
- 5. (optional) Editor/Customize path: the in-page `AvatarCreator` produces a GLB blob → `stageAndReview` → `/create-review`.
- 6. (optional) Remix strip: click a saved avatar thumbnail → `handleFork(av.id)` (same fork path as step 2).
-- **Decision points / branches:** fork vs fresh; six creation methods (editor / customize / studio / selfie / prompt / video / upload); anonymous (stage→review) vs signed-in (direct save/fork); video flag on/off; avatar-quota reached vs not.
+ 1. Land on `/create`. The page now opens with a four-card **intent hub**: "Build an AI agent" → `/create-agent`, "Make a 3D avatar" → `#avatar-options` (tagged "You're here"), "Generate a 3D model" → `/forge`, "Launch a token world" → `/launchpad`. The avatar method cards live below at `#avatar-options`.
+ 2. `boot()` probes `/api/config` for the `videoAvatar` feature flag (greys out the video card if off) and, for signed-in users with avatars, loads `/api/avatars` to render a "Start from one of yours" remix strip. The prompt card cycles 7 example prompts with a reduced-motion-aware typewriter (`#card-prompt-example`).
+ 3. (optional) If `?fork=<id>` present: `handleFork` runs immediately, POSTing `/api/avatars/fork` (signed-in → owned copy → redirect `/avatars/<id>`); on 401/403 falls back to fetching the source, downloading its GLB, staging a guest copy, and redirecting to `/create-review`.
+ 4. Choose a creation method card: **Customize a base avatar** (`card-default-editor` → `AvatarCreator.openDefaultEditor`), **Describe it to 3D** (`card-prompt` → `/create/prompt`, auth-gated), **Start with a template** (`card-customize` → `createFromTemplate`), **Scan yourself to 3D** (`card-selfie` → `/create/selfie`, auth-gated), **Talking avatar video** (`card-video-avatar` → `/create/video`, feature-flagged + auth-gated), **Living world (Cosmos)** (`card-cosmos` → `/cosmos`), **Upload your own GLB** (`card-upload-glb` → `#glb-input`), or **Avatar Studio (beta)** (`card-agent-studio` → `/create/studio`).
+ 5. (optional) Upload path: pick a `.glb`; `handleGlbFile` validates the GLB magic bytes, then `stageAndReview` stashes the blob via `guest-avatar.js` (IndexedDB) and navigates to `/create-review`.
+ 6. (optional) Editor/Template path: the in-page `AvatarCreator` produces a GLB blob → `stageAndReview` → `/create-review`.
+ 7. (optional) Remix strip: click a saved avatar thumbnail → `handleFork(av.id)` (same fork path as step 3).
+- **Decision points / branches:** intent hub (agent wizard / avatar options / Forge / launchpad) vs direct card pick; fork vs fresh; eight creation method cards (base editor / prompt / template / selfie / video / Cosmos / upload / studio); anonymous (stage→review) vs signed-in (direct save/fork); video flag on/off; avatar-quota reached vs not.
- **External calls / dependencies:** `GET /api/config`; `GET /api/avatars`; `GET /api/usage/summary`; `POST /api/avatars/fork`; `GET /api/avatars/:id` + raw GLB fetch (guest fork). External avatar-platform iframes loaded by `AvatarCreator`.
- **Success state:** A staged or owned avatar; the user is forwarded to `/create-review` (anonymous) or `/avatars/<id>` (forked) — onward to agent creation.
- **Empty / error states:** `status-toast` for invalid GLB, fork failure, quota-limit; video card shows "coming soon" when flag off; save overlay (`#save-loading`) covers staging. Remix strip stays hidden for anonymous users / users with no avatars.
@@ -48,23 +49,24 @@
---
### Agent Creation Wizard — `/create-agent`
-- **Source:** `pages/create-agent.html` + `src/create-agent.js` (imports `src/api.js`, `src/account.js`, `src/shared/log.js`, `src/shared/glb-magic.js`)
-- **Entry point:** Nav/landing CTA, marketplace "create your own" links.
-- **Prerequisites / gates:** **Auth required.** `boot()` calls `getMe()`; if no user, the form is hidden and an auth gate (`#auth-gate` → `/login?next=/create-agent`) is shown. Each agent gets a wallet, so the whole flow is account-gated. No $THREE gate.
+- **Source:** `pages/create-agent.html` + `src/create-agent.js` (imports `src/api.js`, `src/account.js`, `src/agents/guest-agent.js`, `src/create-agent-draft.js`, `src/shared/log.js`, `src/shared/glb-magic.js`)
+- **Entry point:** Nav/landing CTA, marketplace "create your own" links, the `/create` intent hub, and the `/agent/new` 301 (see routing notes). Avatar surfaces hand off with `?avatar_id=&avatar_glb=&avatar_name=` (`applyAvatarHandoff` pre-seeds the model step).
+- **Prerequisites / gates:** **Try-first: anyone can build all five steps signed out.** `boot()` calls `getMe()` but only records `state.authed`; there is no auth gate on the form. The one place an account is required is the ship step: `submit()` with no session saves the draft and redirects to `/login?next=/create-agent`; `boot()` restores the draft on return and drops the user on Review ("Welcome back, <name> is ready. Ship it below."). Each agent gets a wallet at create. No $THREE gate.
- **Steps (N):**
- 1. Land; `boot()` resolves auth. Signed-out → auth gate (stop). Signed-in → Step 0 (Basics) shown.
- 2. **Step 0 — Basics.** Enter name (required, ≤60), description (≤280), and tags (≤8, Enter/comma to add). Click "Next" → validates name present.
+ 1. Land; `boot()` resolves auth. Signed out, the ship CTA relabels to "Sign in to ship <name> →" and a "no account needed to build" note (`#build-free-note`) unhides. A fresh guest draft (see below) or a guest-companion claim (`peekGuestAgent()` carries the companion's name in) can prefill the form.
+ 2. **Step 0 (Basics).** Enter name (required, ≤60), description (≤280), and tags (≤8, Enter/comma to add). (optional) Use the **"Build it for me"** AI box: type a one-line brief (or a chip / "✦ Surprise me") → POST `/api/agents/suggest-spec` → the returned spec fills the whole wizard and jumps to Review. Guests can generate too; the guest rate limit maps a 429 to a sign-in nudge. Click "Next" → validates name present.
3. **Step 1 — Model.** Choose a body via one of four tabs: **Starter** (4 shipped GLBs: Vern/CZ/Saga/Boss with `model-viewer` previews), **Library** (your owned avatars, paginated via `GET /api/avatars`, filtered to avatar/creature categories), **Upload** (drag-drop `.glb` ≤16 MB, validated by GLB magic), or **Add later** (must tick the `#f-skip-ack` confirm box → default starter assigned at create). Selected model renders in the live preview. Click "Next" → requires a starter/upload/library pick or acknowledged skip.
4. **Step 2 — Skills.** Five core skills (greet/present-model/validate-model/remember/think) are locked on; toggle optional skills (wave/dance/pump-fun/explain-gltf/web-search). Click "Next".
5. **Step 3 — Personality.** Pick category (14 marketplace categories), greeting (≤200), profile/system prompt (≤2000), voice (browser/custom). Click "Next" (soft tip if publishing without category+prompt).
- 6. **Step 4 — Review.** Editable summary grid (each row jumps back to its step). Toggle "Publish to marketplace" (`#f-publish`). Click "Create".
+ 6. **Step 4 (Review).** Editable summary grid (each row jumps back to its step). Toggle "Publish to marketplace" (`#f-publish`, default on). Click "Create" (or "Sign in to ship…" when signed out, which round-trips through `/login` and resumes here).
7. `submit()`: (a) resolves the body to a real owned avatar — `saveRemoteGlbToAccount` for starter URL or uploaded file (with upload % progress), library = connect directly, none = assign default starter; (b) POST `/api/agents` (name, description, skills, avatar_id, meta with greeting/voice/tags); (c) if publish opted-in AND category+prompt present → POST `/api/marketplace/agents/:id/publish`.
- 8. Success panel: "<name> is ready", 3D preview if public, and buttons — Open (`/agent/<id>`), Edit (`/agent/<id>/edit`), Fund wallet (`/agent/<id>/wallet#deposit`).
-- **Decision points / branches:** auth gate vs proceed; model tab (starter/library/upload/skip); publish on/off and whether publish prerequisites are met (publishes vs creates private with a soft warning); name conflict (409 → bounce to Step 0 to rename); per-step jump-back via stepper pips and review "Edit" buttons.
-- **External calls / dependencies:** `getMe()` (account.js); `GET /api/avatars` (library tab); `saveRemoteGlbToAccount` (account.js → presign + R2 upload + commit); `POST /api/agents`; `POST /api/marketplace/agents/:id/publish`.
-- **Success state:** A real agent with its own wallet/on-chain identity, a guaranteed 3D body, optionally listed on the marketplace; success card links to view/edit/fund.
-- **Empty / error states:** Auth gate for signed-out; library tab has loading / error (with "Try again") / empty (no character models) states; per-step inline validation via `#foot-msg`; 409 name conflict bounces back; publish failure is non-fatal (soft warning, agent still created); submit failure re-enables the form with an error message.
-- **Step count:** 6 required (Basics → Model → Skills → Personality → Review → Create) + ~2 optional (tags, optional skills/customizing voice).
+ 8. Success panel: "<name> is ready", 3D preview if public, and buttons: **Go live** (`/agent/<id>/wallet#activate`, primary; claims the on-chain welcome grant), Fund wallet (`/agent/<id>/wallet#deposit`), Open (`/agent/<id>`), Edit (`/agent/<id>/edit`), and Widget Studio (`/studio?model=<avatar_model_url>`).
+- **Guest draft autosave:** every input change debounce-saves (600 ms) to `localStorage['threews:create-agent:draft']` once the form has real content, with a `beforeunload` flush; drafts expire after 7 days (`src/create-agent-draft.js`). A returning guest resumes on the exact saved step with "Resumed your saved draft. [Start fresh]". A picked upload `File` cannot survive navigation: the draft marks it lost, downgrades the model to "Add later", and asks the user to re-attach on the model step. Creation stops the autosave so a shipped agent never resurrects as a draft.
+- **Decision points / branches:** signed-in ship vs signed-out login round-trip (draft preserved); AI-generated spec vs manual form; model tab (starter/library/upload/skip); publish on/off and whether publish prerequisites are met (publishes vs creates private with a soft warning); name conflict (409 → bounce to Step 0 to rename); resume draft vs "Start fresh"; per-step jump-back via stepper pips and review "Edit" buttons.
+- **External calls / dependencies:** `getMe()` (account.js); `POST /api/agents/suggest-spec` (AI spec generator); `GET /api/avatars` (library tab); `saveRemoteGlbToAccount` (account.js → presign + R2 upload + commit); `POST /api/agents`; `POST /api/marketplace/agents/:id/publish`.
+- **Success state:** A real agent with its own wallet/on-chain identity, a guaranteed 3D body, optionally listed on the marketplace; success card links to go-live/fund/view/edit/embed.
+- **Empty / error states:** Library tab has loading / error (with "Try again") / empty (no character models) states; per-step inline validation via `#foot-msg`; 409 name conflict bounces back; guest generate 429 → "That's the guest generation limit. Sign in to keep going, or fill the form in by hand."; publish failure is non-fatal (soft warning, agent still created); submit failure re-enables the form with an error message; lost upload on draft resume → re-attach prompt.
+- **Step count:** 6 required (Basics → Model → Skills → Personality → Review → Create) + ~4 optional (AI spec generate, tags, optional skills/customizing voice, sign-in round-trip when starting signed out).
---
@@ -73,12 +75,12 @@
- **Entry point:** The "Prompt" card on `/create` (`/create` redirects signed-out users to `/login?next=/create/prompt`). Also reachable directly.
- **Prerequisites / gates:** **Auth required** — the submit endpoint returns 401 → page redirects to `/login?next=/create/prompt` (also enforced upstream by `/create`). No wallet/$THREE gate.
- **Steps (N):**
- 1. Land on the **compose** step; type a text prompt (3–600 chars; live counter). (optional) Click an example chip to fill the prompt.
- 2. Click "Generate" (or Cmd/Ctrl+Enter). `start()` → switches to the **building** step, starts the elapsed clock, sets progress to 8%.
+ 1. Land on the **compose** step; type a text prompt (3 to 600 chars; live counter), or dictate it: a mic button (`src/voice/prompt-dictation.js`, browser SpeechRecognition with an NVIDIA Riva fallback) mounts next to the textarea only when the browser can dictate. (optional) Click an example chip to fill the prompt; around July 4 (July 1-5, viewer local time) seasonal preset chips are injected via `src/shared/festive-presets.js`. A `?prompt=<text>` deep-link prefills the composer (no auto-submit).
+ 2. Click "Generate" (or Cmd/Ctrl+Enter). `start()` → switches to the **building** step, starts the elapsed clock, sets progress to 8%. Escape (or the cancel button) aborts the build back to compose.
3. POST `/api/avatars/reconstruct` `{ name (derived from prompt), prompt, visibility: 'private' }`. Server renders a reference image (Flux) then runs reconstruct→auto-rig. Returns `{ jobId }`.
4. `pollUntilDone(jobId)` polls `GET /api/avatars/regenerate-status?jobId=...` every 3s (8-min timeout), advancing the progress bar by phase (queued→running→rigging).
- 5. On `{ status: 'done', resultAvatarId }`: `renderDone` fetches `GET /api/avatars/:id`, sets the `model-viewer` src, and tags it (Animation-ready / static, Private). Shows the **done** step with "Open in editor" (`/avatars/<id>/edit`) and "Make another"; dispatches `tws:feature-done` for the cross-feature discovery layer. If the finished avatar has no model URL yet, it redirects straight to the editor.
-- **Decision points / branches:** compose vs building vs done; success vs failure (`mapSubmitError`/`friendlyJobError` map codes to human messages — rate-limited, unconfigured→suggest selfie, no-face, NSFW, timeout, OOM); 401 mid-flow → login redirect; "Make another" resets to compose.
+ 5. On `{ status: 'done', resultAvatarId }`: `renderDone` fetches `GET /api/avatars/:id`, sets the `model-viewer` src (using the owner's presigned URL for private avatars), and tags it (Animation-ready / static, Private). Shows the **done** step with "Open in editor" (`/avatars/<id>/edit`) and "Make another"; dispatches `tws:feature-done` for the cross-feature discovery layer.
+- **Decision points / branches:** compose vs building vs done; typed vs dictated prompt; success vs failure (`mapSubmitError`/`friendlyJobError` map codes to human messages: rate-limited, unconfigured→suggest selfie, no-face, NSFW, timeout, OOM); cancel mid-build; 401 mid-flow → login redirect; "Make another" resets to compose.
- **External calls / dependencies:** `POST /api/avatars/reconstruct`; `GET /api/avatars/regenerate-status`; `GET /api/avatars/:id`. Backend uses a text-to-image (Flux) + reconstruct/rig pipeline.
- **Success state:** A private, riggable 3D avatar previewed in-page with an "Open in editor" path.
- **Empty / error states:** Compose: inline `#compose-error` if prompt < 3 chars. Building: `#build-error` with a "Back" button to return to compose; friendly mapping of provider errors; 8-min timeout message suggesting the dashboard. Generate button disabled until prompt ≥ 3 chars.
@@ -93,13 +95,14 @@
- **Steps (N):**
1. Land; inline boot fetches `/api/config` to pick platform vs BYOK mode and dynamically imports the capture UI + pipeline.
2. (optional, BYOK only) **api-key step:** pick provider (Meshy/Tripo), paste key (>8 chars), submit → `storeByokKey` → advance to capture.
- 3. **capture step:** capture or upload a **frontal** photo (required) via camera overlay (`selfie-capture.js`, with face-oval guidance) or file upload; optionally add **left/right** angle photos (fidelity boost).
+ 3. **capture step:** capture or upload a **frontal** photo (required) via camera overlay (`selfie-capture.js`, with face-oval guidance) or file upload; optionally add **left/right** angle photos (fidelity boost). Each added frontal photo is quality-assessed on-device (`src/selfie-refine.js` `assessPhoto`), surfacing `#quality-notice` warnings (blurry / drawing / no face) before the user waits out a full build. The page also cross-links `/image-to-3d` for object (non-face) photos.
4. Click "Build my avatar" (`#submit-btn`) → dispatches `selfie:submit`. Pipeline downscales photos (≤1024px JPEG), runs a local MediaPipe face check, then dispatches `selfie:preview` (shows the user's own photo on a placeholder).
5. POST `/api/avatars/reconstruct` `{ name, photos[], visibility: 'private', params:{bodyType,style}, optional provider_key/provider_name }` → `{ jobId }`. Stashes `selfie:pendingJobId` in sessionStorage (for resume across login). Dispatches `selfie:building` → shows the **building** step (and requests Notification permission).
6. `pollUntilDone` polls `GET /api/avatars/regenerate-status?jobId=...` (1.5s first, then 3s w/ backoff, 8–10 min timeout), dispatching `selfie:progress` labels (mesh → geometry → rigging → finishing).
7. On done: `selfie:done` fires; the page fetches `GET /api/avatars/:id`, renders the model in the **done** viewer, prefills the name. If the tab is hidden, flashes the title + fires an OS notification.
- 8. **done step** actions: "Save" (`#done-save-btn`, optional PATCH name → `/avatars/<id>`), "List" (`#done-list-btn`, PATCH name + visibility public → `/marketplace/avatars/<id>`), "Open in editor" (`#done-editor-btn` → `/avatars/<id>/edit`), or "Make another" (`#done-regen-btn`, reset to capture).
-- **Decision points / branches:** platform vs BYOK mode (key step or not); camera vs upload; frontal-only vs +side angles; mid-flow 401 → login + job resume; done vs build-error (per-slot error highlighting, retry); resume-pending-job on reload.
+ 8. **done step** actions: "Open my avatar" (`#done-save-btn`, optional PATCH name → `/avatars/<id>`), "List on marketplace" (`#done-list-btn`, PATCH name + visibility public → `/marketplace/avatars/<id>`), "Customize in editor" (`#done-editor-btn` → `/avatars/<id>/edit`), or "Not quite right? Try again" (`#done-regen-btn`, reset to capture).
+- **Abandoned jobs finish server-side (platform mode):** the browser poll is no longer the only engine. `api/cron/reconstruct-sweep.js` (every 5 min) picks up open reconstruct jobs quiet for over 3 minutes and runs the same finalize stages, so closing the tab mid-build still lands the avatar in the user's library (30-day rescue window). BYOK jobs stay browser-driven (the server has no user key).
+- **Decision points / branches:** platform vs BYOK mode (key step or not); camera vs upload; frontal-only vs +side angles; photo quality warnings vs proceed; mid-flow 401 → login + job resume; done vs build-error (per-slot error highlighting, retry); resume-pending-job on reload.
- **External calls / dependencies:** `GET /api/config`; `POST /api/avatars/reconstruct`; `GET /api/avatars/regenerate-status`; `GET /api/avatars/:id`; `PATCH /api/avatars/:id` (save/list). MediaPipe (client face detect); camera `getUserMedia`; optional Meshy/Tripo BYOK providers.
- **Success state:** A private, rigged 3D avatar (reconstructed from the selfie), previewed in-page with save/list/edit paths.
- **Empty / error states:** `selfie:needs-byok` → key-entry form ("No API key found"); local face-check failure highlights the offending slot with guidance; `selfie:build-error` recolors the building step, shows tips, and a "Try again" → capture; rate-limit cooldown with a live countdown; viewer load failure marks the preview `.failed`; 8-min timeout message.
@@ -107,20 +110,18 @@
---
-### Agent Editor / New Agent — `/agent/new`
-- **Source:** `pages/agent-edit.html` + `src/agent-edit.js` (vercel route `/agent/new` → `/agent-edit.html`; imports `src/avatar-creator.js`, `src/account.js`, `src/api.js`, `src/avatar-gallery-picker.js`, `src/shared/agent-wallet-chip.js`, `src/shared/glb-magic.js`)
-- **Entry point:** "New agent" nav/dashboard buttons. Also the editor target for existing agents at `/agent/<uuid>(/edit)` and the create-from-avatar handoff `/agent/new?avatar_id=&avatar_glb=&avatar_name=` (marketplace "Start an agent with this avatar").
-- **Prerequisites / gates:** **Auth required.** `resolveAgentIdFromUrl()` finds no id for `/agent/new`, so `loadAgent()` calls `createDraftAgent()` which POSTs `/api/agents` immediately; a 401 stashes `login_redirect` and redirects to `/login`. Each agent provisions a wallet. No $THREE gate.
+### Agent Editor: `/agent/<id>/edit` (and the retired `/agent/new`)
+- **Source:** `pages/agent-edit.html` + `src/agent-edit.js` (vercel route `/agent/<id>/edit` → `/agent-edit.html`; imports `src/avatar-creator.js`, `src/account.js`, `src/api.js`, `src/avatar-gallery-picker.js`, `src/shared/agent-wallet-chip.js`, `src/shared/glb-magic.js`)
+- **Entry point:** "Edit" buttons on agent profiles and the create-agent success panel. **`/agent/new` no longer serves this editor:** the bare route 301s to `/create-agent`, and `/agent/new?avatar_id=` / `?avatar_glb=` rewrites to `create-agent.html`, where `applyAvatarHandoff()` pre-seeds the wizard's model step (marketplace "Start an agent with this avatar" now lands in the wizard).
+- **Prerequisites / gates:** **Auth required.** Loading an agent you don't own (or with no session) hits a 401, which stashes `login_redirect` and redirects to `/login`. No $THREE gate.
- **Steps (N):**
- 1. Navigate to `/agent/new`. With no id in the URL, `createDraftAgent()` shows a "Creating a new agent…" overlay and POSTs `/api/agents` `{ name: 'Untitled Agent' }` (or "<avatar> Agent" when arriving from an avatar handoff).
- 2. (optional) If `?avatar_id` present, PUT `/api/agents/:id` to attach that avatar to the draft.
- 3. The new agent id is adopted and the full editor renders (`render()`): identity (name/description), 3D body (starter/library picker/upload via `avatar-gallery-picker.js` + `AvatarCreator`), skills, animations, voice, wallet chip, and the embed/manifest panels.
- 4. Edit any field → changes persist through the same verified endpoints (PUT `/api/agents/:id`, animations endpoint, etc.).
-- **Decision points / branches:** new draft vs existing agent (URL id) vs create-from-avatar handoff; signed-out → login; avatar attach vs leave default.
-- **External calls / dependencies:** `POST /api/agents` (draft); `GET /api/agents/:id`; `PUT /api/agents/:id`; `PUT /api/agents/:id/animations`; `GET /api/agents/:id/manifest`; avatar APIs via `saveRemoteGlbToAccount` / gallery picker.
-- **Success state:** A live draft agent (with wallet) loaded into the full editor for fine-grained configuration; URL becomes the canonical agent edit URL.
-- **Empty / error states:** Loading overlay during draft creation; `showError(...)` for load/create failures; 401 → login redirect with return.
-- **Step count:** 1 required (navigate → draft auto-created → editor) + 1 optional (avatar attach) — the editor itself is open-ended.
+ 1. Navigate to `/agent/<id>/edit`; `loadAgent()` fetches `GET /api/agents/:id` and the full editor renders (`render()`): identity (name/description), 3D body (starter/library picker/upload via `avatar-gallery-picker.js` + `AvatarCreator`), skills, animations, **gesture slots** (per-agent bindings for the fixed gesture vocabulary, saved via `#anim-slots-save`, previewable on `/gestures`), voice, wallet chip, and the embed/manifest panels.
+ 2. Edit any field → changes persist through the same verified endpoints (PUT `/api/agents/:id`, animations endpoint, etc.).
+- **Decision points / branches:** existing agent (URL id) vs the retired new-draft path (bare `/agent/new` now redirects to the `/create-agent` wizard before this page ever loads); signed-out → login; gesture overrides set vs cleared.
+- **External calls / dependencies:** `GET /api/agents/:id`; `PUT /api/agents/:id`; `PUT /api/agents/:id/animations`; `GET /api/agents/:id/manifest`; avatar APIs via `saveRemoteGlbToAccount` / gallery picker.
+- **Success state:** The agent loaded into the full editor for fine-grained configuration, with saves confirmed inline (e.g. "Saved N gesture overrides.").
+- **Empty / error states:** `showError(...)` for load failures; 401 → login redirect with return.
+- **Step count:** 1 required (navigate → editor); the editor itself is open-ended.
---
@@ -143,15 +144,15 @@
---
### 3D Scanner (redirect) — `/scan`
-- **Source:** `pages/scan.html` (inline `<script type="module">`; dynamically imports `src/selfie-capture.js` + `src/selfie-pipeline.js`)
-- **Entry point:** `/features/scan` CTAs ("Start scanning →"), direct links, marketing.
-- **Prerequisites / gates:** N/A — **the page immediately redirects.** The first line of the inline module runs `window.location.replace('/create/selfie' + window.location.search)`, preserving `?next`/`?from` query params. The legacy scan capture/build/done code below the redirect is therefore **dead/unreachable** (superseded by `/create/selfie`, which adds BYOK key entry).
+- **Source:** None. `pages/scan.html` has been deleted; `/scan` is now a pure routing rule in `vercel.json` (server-side `301` with `Location: /create/selfie`).
+- **Entry point:** Legacy `/scan` links, direct links, marketing.
+- **Prerequisites / gates:** N/A. The redirect fires before any page loads.
- **Steps (N):**
- 1. Land on `/scan` → instant `location.replace` to `/create/selfie` (query string carried over). User experiences the **`/create/selfie` flow** (see that entry) — there is no distinct `/scan` UX anymore.
+ 1. Hit `/scan` → 301 to `/create/selfie`. User experiences the **`/create/selfie` flow** (see that entry); there is no `/scan` UX at all anymore. Note: the 301 sends a bare `Location: /create/selfie`, so query params (`?wizard=1&next=…`) are dropped, unlike the old in-page redirect which preserved them.
- **Decision points / branches:** None — unconditional redirect.
-- **External calls / dependencies:** None reached on `/scan` itself (redirect fires before any fetch). The vestigial code referenced `GET /api/avatars/:id` + the selfie pipeline endpoints, but they never run.
+- **External calls / dependencies:** None.
- **Success state:** User arrives at `/create/selfie` (selfie pipeline success state applies there).
-- **Empty / error states:** None on this page (redirect-only).
+- **Empty / error states:** None (route-level redirect).
- **Step count:** 0 required on `/scan` itself (1 implicit redirect) — the real flow is `/create/selfie`.
---
@@ -162,8 +163,8 @@
- **Prerequisites / gates:** None — public landing page.
- **Steps (N):**
1. Land on the feature landing page ("Your face in 3D. In 60 seconds.") — hero, explainer sections, a `model-viewer` demo.
- 2. Click a primary CTA "Start scanning →" → navigates to `/scan` (which redirects to `/create/selfie`). Secondary CTAs link to `/features`, `/features/forge`.
-- **Decision points / branches:** CTA choice — start scanning (`/scan` → `/create/selfie`) vs "Try Forge instead" (`/features/forge`) vs "All features" (`/features`).
+ 2. Click a primary CTA "Start scanning →" → navigates directly to `/create/selfie` (the CTAs no longer route through `/scan`). Secondary CTAs link to `/features`, `/features/forge`.
+- **Decision points / branches:** CTA choice: start scanning (`/create/selfie`) vs "Try Forge instead" (`/features/forge`) vs "All features" (`/features`).
- **External calls / dependencies:** None (static page; model-viewer loaded from CDN for the demo GLB `/animations/soldier.glb`).
- **Success state:** User is routed into the selfie/scan creation flow.
- **Empty / error states:** N/A — static content, no data fetching.
@@ -192,8 +193,8 @@
---
## Notes on routing resolution
-- `/start`, `/create`, `/create-agent`, `/import/rpm`, `/scan`, `/features/scan`, `/voice` all resolve via explicit `vercel.json` `routes[]` rewrites to their `*.html` files.
+- `/start`, `/create`, `/create-agent`, `/import/rpm`, `/features/scan`, `/voice` all resolve via explicit `vercel.json` `routes[]` rewrites to their `*.html` files.
- `/create/prompt` → `create-prompt.html`, `/create/selfie` → `create-selfie.html`.
-- `/agent/new` → `agent-edit.html` (shared with the existing-agent editor at `/agent/<uuid>`).
-- `/scan` is a **redirect shell** to `/create/selfie`; its in-page flow code is dead.
-- `/features/scan` is a **static landing page** with no flow logic — its CTA bounces to `/scan` → `/create/selfie`.
+- `/agent/new` → **301 to `/create-agent`** (or a rewrite to `create-agent.html` when the URL carries `?avatar_id=`/`?avatar_glb=`); the existing-agent editor lives at `/agent/<uuid>/edit` → `agent-edit.html`.
+- `/scan` is a **route-level 301** to `/create/selfie` (`pages/scan.html` no longer exists; the 301 drops query params).
+- `/features/scan` is a **static landing page** with no flow logic; its CTAs link straight to `/create/selfie`.
diff --git a/docs/ux-flows/10-chat-brain-labs.md b/docs/ux-flows/10-chat-brain-labs.md
index 2612ac543..d4ead3759 100644
--- a/docs/ux-flows/10-chat-brain-labs.md
+++ b/docs/ux-flows/10-chat-brain-labs.md
@@ -9,19 +9,20 @@ modules. Routes resolved via `vercel.json` rewrites.
### Conversational AI Chat (3D talking agent) — `/chat`
- **Source:** `/workspaces/three.ws/chat/` (a standalone Svelte app, separate Vite build). Entry `/workspaces/three.ws/chat/index.html` → `/workspaces/three.ws/chat/src/main.js` → `/workspaces/three.ws/chat/src/App.svelte`. Key modules: `chat/src/providers.js` (LLM providers), `chat/src/convo.js` (streaming completion pipeline), `chat/src/TalkingHead.svelte` (3D avatar + TTS lip-sync), `chat/src/AgentPicker.svelte`, `chat/src/ModelSelector.svelte`, `chat/src/stores.js`, `chat/src/walletAuth.js` (SIWE/SIWS), `chat/src/tools.js`, `chat/src/sync.js`, `chat/src/SkillsMarketplaceModal.svelte`, `chat/src/TxApprovalModal.svelte`.
- **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. 3D talking head and TTS are opt-in toggles (off by default).
+- **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 free model list from `/api/chat/models`, shows empty state with suggestion chips.
- 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).
- 3. (optional) Enable the 3D Talking Head and/or TTS toggle; a GLB avatar loads (`talkingHeadAvatarUrl`, fallback `/avatars/default.glb`).
+ 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.
+ 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) Toggle voice output in settings.
4. Type a message in the composer and submit (or attach an image / file for multimodal).
5. `convo.complete()` POSTs to the provider's completion URL (built-in → `/api/chat/proxy`; Anthropic → `/v1/messages`; others → `/v1/chat/completions`) and streams tokens back into the assistant bubble (markdown + KaTeX rendered live).
- 6. On reply completion: if Talking Head is enabled the avatar runs `talkingHead.speak({text, mood})` (TTS via `/api/tts/google` endpoint → viseme lip-sync); else if TTS toggle on, browser `speechSynthesis` reads it. Payoff: a 3D agent that answers in voice with synced mouth + mood animation.
-- **Decision points / branches:** model/provider choice (free built-in vs keyed provider vs OpenRouter "all models" vs local Ollama); text vs voice output (Talking Head 3D vs browser speechSynthesis vs silent); persona/agent loaded vs raw model; tool-calling on/off (curated tool packs: agent, pump, payments, wallet); regenerate / edit / branch a message; share conversation (compressed link via `share.js`).
-- **External calls / dependencies:** `/api/chat/models` (free model list, OpenRouter-proxied), `/api/chat/proxy` (built-in completions), `/api/chat/config`, `/api/chat/mcp`, `/api/tts/google` (TTS for lip-sync), `/api/agents` + `/api/marketplace/agents` (agent picker), `/api/auth/{me,logout,siwe/nonce,siwe/verify,siws/nonce,siws/verify}` (wallet auth), agent-library `index.en-US.json`. Direct provider APIs (api.anthropic.com, api.openai.com, api.groq.com, api.mistral.ai, openrouter.ai, local Ollama) when a user key is set. Three.js (importmap, r0.169) for the Talking Head.
-- **Success state:** Streamed assistant message rendered; if enabled, 3D avatar speaks with lip-sync + mood; conversation persisted to IndexedDB / optional E2E-encrypted sync.
-- **Empty / error states:** Empty state with brand tagline + suggestion chips when no messages. Provider/network errors surface as inline notices; abortable generation via `controller`. Missing API key → model marked unavailable in selector. Avatar GLB load failure falls back to default avatar; TTS failure degrades silently to text.
+ 6. On reply completion with voice enabled: if an agent is loaded, its `<agent-3d>` avatar speaks the reply (`agentEl.speak(...)`) and expresses the classified emotion (`agentEl.expressEmotion(...)`); with no agent loaded, browser `speechSynthesis` reads it. Payoff: a 3D agent that answers in voice with mood animation. (A legacy `TalkingHead.svelte` component is still imported but never mounted; see the note below.)
+- **Decision points / branches:** model/provider choice (free built-in vs keyed provider vs OpenRouter "all models" vs local Ollama); text vs voice output (agent-3d speech vs browser speechSynthesis vs silent); persona/agent loaded vs raw model; tool-calling on/off (16 curated tool packs in `tools.js` `curatedToolPacks`, surfaced via `ToolPackModal`: wallet-transactions, x402-pay, tradingview, price-chart-3d, token-price, token-ticker-3d, web-search, date-time, pump-launch, tx-explain, mint-scene-nft, nft-3d-import, forge-text-to-3d, forge-avatar, wallet-balances, token-gate-scene; the built-in wallet/agent/pump/payments tool schemas back them); every generated 3D model card carries "View in AR ↗" (`/ar?src=<glb>`), "Download GLB", and "Viewer ↗" actions; regenerate / edit / branch a message; share conversation (compressed link via `share.js`).
+- **External calls / dependencies:** `/api/chat/models` (free model list, OpenRouter-proxied), `/api/chat/proxy` (built-in completions), `/api/chat/config`, `/api/mcp` + `/api/pump-fun-mcp` (skills marketplace / pump tools), `/api/agents` + `/api/marketplace/agents` (agent picker), `/api/auth/{me,logout,siwe/nonce,siwe/verify,siws/nonce,siws/verify}` (wallet auth), agent-library `index.en-US.json`. Direct provider APIs (api.anthropic.com, api.openai.com, api.groq.com, api.mistral.ai, openrouter.ai, local Ollama) when a user key is set.
+- **Success state:** Streamed assistant message rendered; if voice is enabled and an agent is loaded, the 3D avatar speaks with mood animation; conversation persisted to IndexedDB / optional E2E-encrypted sync.
+- **Empty / error states:** Empty state with brand tagline + suggestion chips when no messages. Provider/network errors surface as inline notices; abortable generation via `controller`. Missing API key → model marked unavailable in selector. Avatar GLB load failure falls back to default avatar; speech failure degrades silently to text.
- **Step count:** 6 required (+4 optional)
+- **Known issue (verified 2026-08-05):** the standalone 3D Talking Head is dead code. `TalkingHead.svelte` is imported in `App.svelte` but never rendered, so its bind never fires; with the settings "Talking Head" toggle on, replies queue in `pendingSpeak` and are never spoken (and `speechSynthesis` is suppressed while the toggle is on). Its default TTS endpoint `/api/tts/google` also no longer exists (live TTS endpoints are `/api/tts/speak`, `/api/tts/eleven`, `/api/tts/edge`). The working voice path is the agent-3d avatar described in step 6.
---
@@ -32,12 +33,12 @@ modules. Routes resolved via `vercel.json` rewrites.
- **Steps (4):**
1. Hit `/agent` → 301 to `/agents`; directory of agents renders.
2. Click an agent card → `/agents/:id` loads `agent-detail.js`.
- 3. Profile renders: `<model-viewer>` 3D avatar preview, identity, voice metadata (cloned provider or browser TTS pill), live $THREE/pump token chip (streamed via `/api/pump/by-agent`), skills, history.
+ 3. Profile renders: a live Three.js hero avatar (`mountIdleAvatar` retargets the canonical idle clip onto the rig with a procedural idle-life loop; no static `<model-viewer>`), identity, voice metadata (cloned provider or browser TTS pill), live $THREE/pump token chip (streamed via `/api/pump/by-agent`), skills (with dynamic price/promo state from `/api/marketplace/skill-promo?agent_id=…&skill=…`), history.
4. Click "See in world" → routes to `/play?avatar=<glb>&coin=<THREE_MINT>` (the 3D world payoff); or "Edit" / wallet chip / coin-launch actions for owners.
- **Decision points / branches:** view vs edit (owner); "See in world" (→ /play) vs embed (`/agent/:id/embed`) vs wallet (`/agent/:id/wallet`); token chip present (launched coin) vs not.
-- **External calls / dependencies:** `/api/agents/:id`, `/api/marketplace/agents/:id`, `/api/pump/by-agent` (live market-cap stream), `/api/agent-share` (share). model-viewer (Google CDN) for the 3D preview.
+- **External calls / dependencies:** `/api/agents/:id`, `/api/marketplace/agents/:id`, `/api/pump/by-agent` (live market-cap stream), `/api/marketplace/skill-promo` (skill pricing/promo), `/api/agent-share` (share). Three.js idle-avatar mount for the 3D preview (falls back to a flat image when WebGL/GLB fails).
- **Success state:** Agent profile with interactive 3D avatar, live token data, and working navigation to world/embed/edit.
-- **Empty / error states:** Avatar fetch failure → flat-image fallback (model-viewer hidden); enrich failure logged non-fatally; save errors surface inline in the edit flow.
+- **Empty / error states:** Avatar mount failure → flat-image fallback; enrich failure logged non-fatally; save errors surface inline in the edit flow.
- **Step count:** 4 required (+2 optional)
- **Note:** This route is a profile/directory surface, **not** a chat interface. The "talk to a 3D agent" experience lives at `/chat` (Talking Head). `/agents/:id` links *out* to `/play` ("See in world"), not to an inline chat.
@@ -45,8 +46,8 @@ modules. Routes resolved via `vercel.json` rewrites.
### Brain — Persona Builder + Multi-LLM Playground — `/brain`
- **Source:** `/workspaces/three.ws/pages/brain.html` → `/workspaces/three.ws/src/brain.js`.
-- **Entry point:** `/brain` → `brain.html` (H1 "Build Your Persona"), two tabs: Persona + Playground.
-- **Prerequisites / gates:** None to use the playground / compare models. Saving a persona as a deployed agent requires sign-in (auth-hint check + `/api/agents` with credentials); an auth gate is shown if signed out. No $THREE gate.
+- **Entry point:** `/brain` → `brain.html` (H1 "Pick a vibe", sub-copy "One tap gives your agent a personality. No extra steps."; "Build Persona" is a sidebar button), two tabs: Persona + Playground.
+- **Prerequisites / gates:** None to open the playground, but signed-out callers are limited to the free-model set (`ANON_BRAIN_PROVIDERS` in `api/brain/chat.js`: gpt-oss-120b plus the NVIDIA NIM family); every paid first-party model returns `401 "sign in to use this model"`, and anonymous traffic is rate limited. Saving a persona as a deployed agent requires sign-in (auth-hint check + `/api/agents` with credentials); an auth gate is shown if signed out. No $THREE gate.
- **Steps (6):**
1. Open `/brain`; Persona tab active, archetype presets rendered.
2. (optional) Apply an archetype preset or type freeform persona text → `/api/persona/extract` structures it into a persona object (tone, vocabulary, interests, dont_say, greeting).
@@ -55,9 +56,9 @@ modules. Routes resolved via `vercel.json` rewrites.
5. Type a prompt and run; `streamProvider()` POSTs to `/api/brain/chat` per model and streams responses side-by-side, each prefixed with the effective persona system prompt.
6. (optional) Save the persona as an agent → POST `/api/agents` (or PATCH `/api/agents/:id`) with the built `system_prompt`.
- **Decision points / branches:** Compare (multi-model fan-out) vs Focus (single model); persona enabled/disabled (`personaEnabled` toggle injects/omits the system prompt); archetype preset vs freeform extraction; model availability (unavailable models disabled in selector); save-as-agent (gated by auth).
-- **External calls / dependencies:** `GET /api/brain/chat` (provider availability), `POST /api/brain/chat` (per-model streaming completions), `/api/persona/extract` (structure persona), `/api/agents` + `/api/agents/:id` (load/save agent). Models span Anthropic / OpenAI / OpenRouter / Groq / ModelScope tiers.
+- **External calls / dependencies:** `GET /api/brain/chat` (provider availability), `POST /api/brain/chat` (per-model streaming completions), `/api/persona/extract` (structure persona), `/api/agents` + `/api/agents/:id` (load/save agent). Models span Anthropic (via Google Vertex), OpenAI (via OpenRouter), xAI Grok, DeepSeek, Qwen/DashScope, IBM watsonx, NVIDIA NIM, and Google Vertex Gemini tiers.
- **Success state:** Multiple model responses stream into the compare grid (or one in focus); persona optionally persisted locally and/or saved as a deployable agent.
-- **Empty / error states:** "Select at least one model" notice; provider-availability fetch failure is non-fatal (all models treated available); upstream stream error surfaces per-model; auth gate shown when saving while signed out; sessions/persona persisted to localStorage.
+- **Empty / error states:** "Select at least one model" notice; provider-availability fetch failure is non-fatal (all models treated available); upstream stream error surfaces per-model; signed-out use of a paid model errors with a sign-in prompt; auth gate shown when saving while signed out; sessions/persona persisted to localStorage.
- **Step count:** 6 required (+2 optional)
---
@@ -82,7 +83,7 @@ modules. Routes resolved via `vercel.json` rewrites.
---
### Labs — Feature Gallery — `/labs`
-- **Source:** `/workspaces/three.ws/pages/labs.html` → `/workspaces/three.ws/src/labs.js`. Data: `/features.json` (static registry, mirror of `/api/features`).
+- **Source:** `/workspaces/three.ws/pages/labs.html` → `/workspaces/three.ws/src/labs.js`. Data: `/features.json` (generated by `scripts/build-page-index.mjs` from `data/pages.json`; `labs.js` flattens its `sections[].pages` and shows only pages flagged `showcase: true`).
- **Entry point:** `/labs` → `labs.html`; grid of "gem" cards.
- **Prerequisites / gates:** None. Pure discovery surface.
- **Steps (3):**
@@ -98,17 +99,17 @@ modules. Routes resolved via `vercel.json` rewrites.
---
### Launchpad Studio — `/launchpad`
-- **Source:** `/workspaces/three.ws/pages/launchpad.html` → inline `<script type="module">` → `/workspaces/three.ws/src/editor/launchpad-studio.js` (`mountLaunchpadStudio`).
-- **Entry point:** `/launchpad` (optional `?template=&slug=&wallet=&website=&avatar=` query hydration) → studio mounts into `#root` (3-pane: sidebar / live-preview stage / config rail).
+- **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.
- **Steps (6):**
- 1. Open `/launchpad`; studio mounts with a default template (`token-launchpad`) and recent-projects from localStorage.
- 2. Pick a template card (e.g. Token Launchpad, Concierge, Showroom).
+ 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.
-- **Decision points / branches:** template choice (token-launchpad vs concierge vs showroom…); new vs edit (`?slug=` hydration via `/api/launchpad/get`); chain/payout selection; signed-in owner vs anonymous (owner-only sections hidden on 401).
+- **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.
- **Empty / error states:** Publish blocked with actionable message if no payout wallet; publish-status line shows ok/err; owner-only sections silently hidden when signed out (401); recent-projects empty on first visit.
diff --git a/docs/ux-flows/11-account-dashboard.md b/docs/ux-flows/11-account-dashboard.md
index 25be866ba..82734910c 100644
--- a/docs/ux-flows/11-account-dashboard.md
+++ b/docs/ux-flows/11-account-dashboard.md
@@ -22,8 +22,9 @@ Resolved from `vercel.json` (`routes`) and `vite.config.js` (`vercel-rewrites` d
Shared auth concepts:
- **Session:** a `__Host-sid` cookie minted server-side by `createSession()`, identical across email/password, SIWE (EVM), SIWS (Solana), Privy, and SAML.
-- **Post-auth redirect:** `?next=` query param → `sessionStorage.login_redirect` → default (`/dashboard` for login, `/create` for register). On `/login`, an already-authenticated visitor is bounced to `next` via a `GET /api/auth/me` probe on load.
+- **Post-auth redirect:** `?next=` query param → `sessionStorage.login_redirect` → default (`/dashboard` for login, `/create` for register). On `/login`, an already-authenticated visitor is bounced to `next` via a `GET /api/auth/me` probe on load. The value is sanitized by a shared `safeNext` helper: anything that is not a single-leading-slash same-site path (protocol-relative `//host`, backslashes, control characters) is silently discarded and the default is used, so a crafted external `?next=` can no longer navigate off-site.
- **Auth hint:** every successful auth writes `localStorage['3dagent:auth-hint']` so other surfaces render a logged-in chrome optimistically.
+- **Terms clickwrap (ToS v2):** every auth surface asserts Terms acceptance. `/register` has a required checkbox; `/login` and the Privy/wallet paths use notice-style clickwrap ("By signing in... you agree to the Terms of Service and Privacy Policy") and send `tosAccepted: true`; the Privy SIWE message statement itself carries the agreement text. The server records `users.tos_accepted_version`/`tos_accepted_at` plus an append-only `audit_log` row (`api/_lib/legal.js`, `TOS_VERSION = 2`) and re-stamps on login.
---
@@ -38,7 +39,7 @@ Shared auth concepts:
4. **Email/password path:** type email-or-username into `#email`, password into `#password`. Avatar covers its eyes while a credential field is focused. (optional) toggle show/hide password; Caps-Lock warning shows live.
5. (optional) tick "Remember me".
6. Click **Sign in** (`#submit`). Client validates both fields are non-empty (inline field errors + avatar facepalm on empty).
- 7. `POST /api/auth/login` with `{ email, password, remember }`, credentials included. Button shows "Signing in…".
+ 7. `POST /api/auth/login` with `{ email, password, remember, tosAccepted: true }` (notice-style clickwrap; the legal line sits under the form), credentials included. Button shows "Signing in…".
8. On `!res.ok`: 429 → "Too many attempts…", else "Email or password is incorrect." — inline error on password field, avatar facepalm, button re-enabled.
9. On success: persist `3dagent:last-email` + auth-hint; button "Signed in — redirecting…"; avatar plays a dance; after one dance cycle (700–1800ms) `location.replace(next)`.
10. **(optional) Privy email-OTP path:** type email in `#privy-email-input` → click **Send code**. If the Privy app has CAPTCHA, a Cloudflare Turnstile challenge resolves first. `privy.auth.email.sendCode()` sends the code; UI advances to the code step.
@@ -64,17 +65,18 @@ Shared auth concepts:
2. On load, `GET /api/auth/me`; if `{user}` → `location.replace(next)`; 401 stays; transport error shows a notice.
3. Type a **Username** (`#username`, 3–30 chars, `[a-zA-Z0-9_-]`); inline hint validates live ("✓ Looks good" / specific error).
4. Type a **Password** (`#password`, min 10 chars); strength meter updates (Too short → Very strong); Caps-Lock warning; (optional) show/hide toggle.
- 5. Click **Create account** (`#submit`); button shows "Creating account…".
- 6. `POST /api/auth/register` with `{ username, password }`, credentials included.
- 7. On `!res.ok`: 429 → "Too many attempts…"; 409 → "That username is taken."; 400 → field guidance; 422 → "…isn't allowed — try another."; 5xx → server-fault copy; network `TypeError` → "Couldn't reach the server…". Error banner shown, button re-enabled.
- 8. On success: server creates the account **and an immediate session** (signed in on register); persist auth-hint; `location.replace(next)` (default `/create`).
- 9. **(optional) Privy email-OTP / EVM / Solana wallet** registration — identical flows to `/login` (shared `src/privy-login.js`): Send code → Verify, or EVM SIWE, or Solana SIWS → session → redirect.
- 10. **(optional) On-chain features drawer** — same Solana/EVM native connect buttons; state persists in `sessionStorage['register:onchain']`.
-- **Decision points / branches:** username+password (`/api/auth/register`) **vs** Privy email-OTP **vs** Privy EVM SIWE **vs** Privy Solana SIWS **vs** native on-chain drawer SIWE/SIWS. (Note: the primary form here collects **username** + password, whereas `/login` accepts email-or-username; the shared `registerWithEmail()` helper supports an email+displayName variant used by other surfaces.)
+ 5. Tick the required **Terms checkbox** (`#tos-accept`, "I have read and agree to the Terms of Service and Privacy Policy", linking `/legal/tos` and `/legal/privacy`); native `required` validation blocks submit until ticked.
+ 6. Click **Create account** (`#submit`); button shows "Creating account…".
+ 7. `POST /api/auth/register` with `{ username, password, tosAccepted }`, credentials included. The server rejects registration without acceptance (`400 tos_required`).
+ 8. On `!res.ok`: 429 → "Too many attempts…"; 409 → "That username is taken."; 400 → field guidance (prefers the server's `error_description`, e.g. the `tos_required` copy); 422 → the "isn't allowed" copy with a try-another nudge; 5xx → server-fault copy; network `TypeError` → "Couldn't reach the server…". Error banner shown, button re-enabled.
+ 9. On success: server creates the account **and an immediate session** (signed in on register); persist auth-hint; `location.replace(next)` (default `/create`).
+ 10. **(optional) Privy email-OTP / EVM / Solana wallet** registration: identical flows to `/login` (shared `src/privy-login.js`), each asserting `tosAccepted: true`: Send code → Verify, or EVM SIWE, or Solana SIWS → session → redirect.
+ 11. **(optional) On-chain features drawer**: same Solana/EVM native connect buttons; state persists in `sessionStorage['register:onchain']`.
+- **Decision points / branches:** username+password (`/api/auth/register`) **vs** Privy email-OTP **vs** Privy EVM SIWE **vs** Privy Solana SIWS **vs** native on-chain drawer SIWE/SIWS. (Note: the primary form here collects **username** + password, whereas `/login` accepts email-or-username; the shared `registerWithEmail()` helper supports an email+displayName variant used by other surfaces, and only sends `tosAccepted: true` when the calling surface passes it explicitly.)
- **External calls / dependencies:** `GET /api/auth/me`, `POST /api/auth/register`, `POST /api/auth/privy/verify`, `GET /api/auth/siws/nonce`, `POST /api/auth/siws/verify`, `GET /api/config`; Privy SDK, Turnstile, browser wallets, model-viewer CDN.
- **Success state:** Account created, session minted, redirect to `next` (default `/create`); user is logged in.
-- **Empty / error states:** Live username/password validation; status-mapped error banner (taken username, rate-limit, server fault, offline); Privy/wallet cancellation handling; ToS/Privacy legal copy below the button.
-- **Step count:** 8 required (+2 optional)
+- **Empty / error states:** Live username/password validation; unticked Terms checkbox blocks submit (and the server 400s with `tos_required` if bypassed); status-mapped error banner (taken username, rate-limit, server fault, offline); Privy/wallet cancellation handling; a second ToS/Privacy legal line below the button covers the Privy/wallet paths.
+- **Step count:** 9 required (+2 optional)
---
@@ -105,16 +107,16 @@ Shared auth concepts:
- **Steps (N):**
1. `home.js` boots → `mountShell()` renders sidebar + topbar + live-event drawer + command palette; the active nav item pulses "you are here".
2. `requireUser()` resolves the session (or redirects to login).
- 3. Greeting renders ("Welcome back, &lt;name&gt;."); new-account detection (< 30 days) and dismissal flags (`twx_onboarding_dismissed`, `twx_forge_announce_dismissed`) decide which banners show.
+ 3. Greeting renders ("Welcome back, &lt;name&gt;."); new-account detection (< 30 days) and dismissal flags (`twx_onboarding_dismissed`, `twx_forge_announce_dismissed`) decide which banners show. The forge announce is now a full "Text & image to 3D are live" front door: an animated visual, a rotating example-prompt typewriter, and an inline prompt composer that deep-links to `/forge?prompt=…`.
4. Skeletons render across hero / KPI / activity slots.
5. Parallel fetch: `GET /api/avatars?limit=50`, `GET /api/widgets`, `GET /api/agents?limit=20` (each `Promise.allSettled`, degrades independently).
6. Hero strip shows live 3D avatar previews; KPI row (revenue, views, transcripts, avatars) with sparklines over a 7-day window; trading + world-health sections; 2×2 quick-actions grid; agent/avatar directory; recent-activity feed (stitched transcripts + revenue events).
7. The onboarding guide (`getting-started.js`) is reconciled against authoritative server state (avatars/agents/widgets) on every visit.
8. KPIs + activity re-poll every 30s; relative timestamps tick every 60s.
9. (optional) Use the sidebar to navigate to sub-pages (account, analytics, settings, agents, avatars, tokens, monetize, etc.); open the command palette; open the live-event drawer (pulses on new events); dismiss onboarding/announce banners.
- 10. (optional) If the user arrived via a referral link, `claimPendingReferral()` attributes it now that a session exists (no-op otherwise).
+ 10. (optional) If the user arrived via a referral link, `claimPendingReferral()` attributes it now that a session exists (no-op otherwise). It runs from the shared shell (`src/dashboard-next/shell.js`), so it fires on every dashboard page, not just the overview.
- **Decision points / branches:** New vs returning user (onboarding banner); each data slot renders, empties, or errors independently; referral-claim runs only with a pending code.
-- **External calls / dependencies:** `GET /api/auth/me`, `GET /api/avatars`, `GET /api/widgets`, `GET /api/agents`, plus KPI/activity polling endpoints; shared `tour.js`, `crypto-optional.js`, `log.js`.
+- **External calls / dependencies:** `GET /api/auth/me`, `GET /api/avatars`, `GET /api/widgets`, `GET /api/agents`; the trading strip fetches `GET /api/sniper/strategy?limit=30`, `GET /api/copy/subscriptions`, `GET /api/oracle/stats`, `GET /api/oracle/feed?tier=prime&limit=3&network=mainnet`; KPI/activity refresh adds `GET /api/billing/revenue` and per-widget `GET /api/widgets/{id}/stats` / `.../transcripts`; shared `tour.js`, `crypto-optional.js`, `log.js`.
- **Success state:** Authenticated overview rendered with live KPIs, hero avatars, and activity; navigation chrome fully wired.
- **Empty / error states:** Per-slot skeletons during load; new-user onboarding panel as the "empty" guidance; failed data fetches degrade per slot (empty arrays) rather than failing the page; unauthenticated → redirect to `/login`.
- **Step count:** 8 required (+2 optional)
@@ -127,16 +129,16 @@ Shared auth concepts:
- **Prerequisites / gates:** Signed-in required (`requireUser()` → `/login?return=…` on 401).
- **Steps (N):**
1. Boot: `mountShell()` then `requireUser()`.
- 2. Page renders sections: **Profile** (display name, username, sign out), **AI Provider Keys**, **Linked Wallets**, **SNS / .sol handle domains**, **Vanity Wallets** (Solana + ETH CREATE2), **Delegation** console, **Action Log / audit trail**, and quick links to settings/storage/usage/ERC-8004.
+ 2. Page renders sections in order: **Profile** (display name, username, sign out), **AI Provider Keys**, **Linked Wallets**, **Vanity Wallets** (Solana + ETH CREATE2), **SNS / .sol handle domains**, **Delegation** console, **Action Log / audit trail**, and quick links to settings/storage/usage/ERC-8004.
3. **(optional) Update profile:** click edit on the name row → inline input (max 60) → **Save** → `PATCH /api/auth/profile` `{ display_name }` → toast "Saved", profile re-renders. Username edit → `PATCH /api/auth/profile` `{ username }` → toast "Username saved".
- 4. **(optional) Provider keys:** enter a key → **Save** → `PATCH /api/user/provider-keys` `{ [provider]: value }` → toast "Key saved"; clear → `PATCH …` `{ [provider]: null }` → toast "Key removed".
+ 4. **(optional) Provider keys:** eight named providers (anthropic, openai, grok, meshy, tripo, rodin, stability, replicate; a note explains OpenRouter and Groq are provided free, no key needed). Enter a key → **Save** → `PATCH /api/user/provider-keys` `{ [provider]: value }` → toast "Key saved"; clear → `PATCH …` `{ [provider]: null }` → toast "Key removed".
5. **(optional) Linked wallets:** list from `GET /api/auth/wallets`. "Make primary" → `POST /api/auth/wallets/primary` `{ address }` → toast "Primary wallet updated" + refresh. "Disconnect" → confirm → `DELETE /api/auth/wallets/{address}` → toast "Wallet disconnected" + row removed. "+ Link wallet" routes to the wallet-linking flow.
6. **(optional) SNS / vanity:** "Register domain" → `/vanity-wallet`; "Manage" → external `sns.id`; vanity tools open `/vanity-wallet` and `/eth-vanity`.
7. **(optional) Delegation:** open console → pick target agent + message (max 8000) → **Run delegation** → `POST /api/agent-delegate` `{ toAgentId, message }` → response box with model tag; status-specific errors (429/404/503).
8. **(optional) Audit log:** "Export CSV" → `GET /api/audit-log?format=csv` → toast "CSV downloaded"; "Load older" paginates `GET /api/audit-log`.
9. **(optional) Sign out:** `POST /api/auth/logout` → redirect to `/`.
- **Decision points / branches:** Each section is independent; wallet/SNS sections show empty states when nothing is linked; delegation requires at least one agent.
-- **External calls / dependencies:** `GET /api/auth/me`, `PATCH /api/auth/profile`, `PATCH /api/user/provider-keys`, `GET /api/auth/wallets`, `POST /api/auth/wallets/primary`, `DELETE /api/auth/wallets/{address}`, `POST /api/agent-delegate`, `GET /api/audit-log`, `POST /api/auth/logout`.
+- **External calls / dependencies:** `GET /api/auth/me`, `PATCH /api/auth/profile`, `PATCH /api/user/provider-keys`, `GET /api/auth/wallets`, `GET /api/sns?address=…` (per Solana wallet, to resolve .sol domains), `POST /api/auth/wallets/primary`, `DELETE /api/auth/wallets/{address}`, `POST /api/agent-delegate`, `GET /api/audit-log`, `POST /api/auth/logout`.
- **Success state:** Toasts on each mutation (Saved / Username saved / Key saved / Primary wallet updated / Wallet disconnected / CSV downloaded); sections re-render with fresh data.
- **Empty / error states:** "No wallets linked", "No Solana wallets linked", "No primary .sol domains found", "No agents to delegate", "Audit log is empty"; load-failure toasts ("Couldn't load &lt;section&gt;"); audit 404 ("endpoint not deployed yet"), 401 ("Sign in required").
- **Step count:** 2 required (boot + render) (+7 optional management flows)
@@ -168,17 +170,17 @@ Shared auth concepts:
- **Prerequisites / gates:** Signed-in required (`requireUser()`; 401 → `/login?return=…`).
- **Steps (N):**
1. Boot: `mountShell()` → `requireUser()`; 4 skeletons while data loads.
- 2. Parallel fetch: `GET /api/auth/sessions`, `GET /api/notifications?limit=20`, `GET /api/notifications/preferences`, `GET /api/billing/summary` (storage), `GET /api/usage/summary` (LLM usage), plus dashboard prefs.
+ 2. Parallel fetch: `GET /api/auth/sessions`, `GET /api/notifications?limit=20`, `GET /api/notifications/preferences`, `GET /api/billing/summary` (storage), `GET /api/usage/summary` (LLM usage), `GET /api/dashboard/prefs`.
3. Render sections: **Appearance/theme**, **Active sessions**, **Notifications**, **Notification preferences**, **Default payment network**, **Storage usage**, **LLM usage**, **Vanity wallet tools**, **Preferences**, **Data export**, **About**.
4. **(optional) Theme:** click Dark/Light/Auto → `localStorage['twx_theme']` (+ `window.threeTheme.set`) → toast "Theme applied" (no API).
- 5. **(optional) Sessions:** "Revoke" → `DELETE /api/auth/sessions/{id}` → toast + row removed; "Revoke all other" → `POST /api/auth/sessions/revoke-others` → toast.
+ 5. **(optional) Sessions:** "Revoke" → `DELETE /api/auth/sessions/{id}` → toast + row removed; "Revoke all other" → `DELETE /api/auth/sessions` (revokes every other session **and rotates the current session cookie**) → toast.
6. **(optional) Notifications:** "Mark all read" → `POST /api/notifications/read-all` → toast. The inbox covers the full bell vocabulary (sales, purchases, follows, remixes, DMs, coin-launch graduations, IRL, market, account).
- 6b. **(optional) Notification preferences:** the category × channel matrix (categories: sales, purchases, social, IRL, market, account; channels: in-app, push, email, Telegram) → `PATCH /api/notifications/preferences` per toggle → toast. The in-app channel is always on and rendered disabled.
+ 6b. **(optional) Notification preferences:** a category × channel matrix driven by the server response (`categories` + `channels`, default channels in-app / push / email / Telegram). Toggles flip locally; a single **Save notification preferences** button sends the whole matrix via `PUT /api/notifications/preferences` `{ categories }` → toast "Notification preferences saved". Per-category `lockedChannels` render disabled (in-app is typically locked on); the Telegram column stays disabled ("Link a Telegram chat id to enable") until `telegram_chat_id` is set; a footer reports subscribed push devices.
7. **(optional) Default network:** Base/Solana/Polygon → `localStorage['twx_default_network']` + best-effort `PATCH /api/dashboard/prefs` `{ prefs: { default_network } }` → toast.
8. **(optional) Preferences:** toggle email notifications / show tips / compact sidebar → **Save preferences** → `PATCH /api/dashboard/prefs` `{ prefs }` → toast "Preferences saved".
9. **(optional) Data export:** Agents / Avatars / All → fetch `GET /api/agents`, `GET /api/avatars?limit=100`, `GET /api/widgets` → build JSON blob → browser download → toast "Data exported".
- **Decision points / branches:** Theme, default network, and privacy-style toggles are local-first (localStorage) with best-effort prefs sync; sessions/notifications/export hit live APIs. Read-only meters for storage/LLM usage.
-- **External calls / dependencies:** `GET /api/auth/me`, `GET /api/auth/sessions`, `DELETE /api/auth/sessions/{id}`, `POST /api/auth/sessions/revoke-others`, `GET /api/notifications`, `POST /api/notifications/read-all`, `GET /api/notifications/preferences`, `PATCH /api/notifications/preferences`, `GET /api/billing/summary`, `GET /api/usage/summary`, `PATCH /api/dashboard/prefs`, `GET /api/agents`, `GET /api/avatars`, `GET /api/widgets`.
+- **External calls / dependencies:** `GET /api/auth/me`, `GET /api/auth/sessions`, `DELETE /api/auth/sessions/{id}`, `DELETE /api/auth/sessions` (revoke-others + cookie rotation), `GET /api/notifications`, `POST /api/notifications/read-all`, `GET /api/notifications/preferences`, `PUT /api/notifications/preferences`, `GET /api/billing/summary`, `GET /api/usage/summary`, `GET`/`PATCH /api/dashboard/prefs`, `GET /api/agents`, `GET /api/avatars`, `GET /api/widgets`.
- **Success state:** Toasts on each action (Theme applied / Session revoked / All notifications marked read / Default network set / Preferences saved / Data exported); sections reflect new state.
- **Empty / error states:** "No session data", "No notifications" / "You're all caught up", "No usage data"; per-action error toasts with button re-enable for retry; skeletons during load.
- **Step count:** 3 required (boot + fetch + render) (+6 optional setting flows)
@@ -202,6 +204,7 @@ Shared auth concepts:
- **External calls / dependencies:** `GET /api/auth/me`, `PATCH /api/auth/profile`, `GET /api/auth/wallets`, `POST /api/auth/logout-everywhere`, `GET /api/auth/sessions`, `DELETE /api/auth/sessions/{id}`, `DELETE /api/auth/sessions`, `GET /api/auth/github/status`, `/api/auth/github/connect`, `POST /api/agents/{id}/memory-seed`, `GET`/`POST /api/agents/{id}/memory/seed/x`, `/api/auth/x/connect`, `DELETE /api/auth/me`.
- **Success state:** "Saved!" / "Saved preference." / "All other sessions revoked." inline messages (auto-hide 4s); GitHub/X "Connected" tags; account deletion redirect to `/?deleted=1`.
- **Empty / error states:** "No sessions found."; "Not connected" + connect buttons for GitHub/X; inline `.ok`/`.err` messages; delete-flow confirmation gate + error alert with button revert; "Checking…"/"Loading…" placeholders during async loads.
+- **Known issues (verified against source, 2026-08-05):** the Danger Zone calls `DELETE /api/auth/me`, but the server's `me` handler only accepts GET (no delete-account endpoint exists), so deletion fails with the "contact support" alert. Separately, this page's local fetch helper attaches no `x-csrf-token`, so in production the profile **Save changes** and both session-revoke calls are rejected by the CSRF gate (`403 csrf_missing`); only `logout-everywhere` was moved to the CSRF-carrying client. The `/dashboard/*` equivalents are unaffected (they go through `src/api.js`, which auto-attaches the token).
- **Step count:** 3 required (boot + profile load + save profile) (+5 optional tab flows)
---
@@ -210,4 +213,4 @@ Shared auth concepts:
- **No login/register modal:** auth is full-page (`/login`, `/register`). Other surfaces trigger it by redirect (`requireAuth()` in `src/auth/email-auth.js`, `requireUser()` in `src/dashboard-next/api.js`), preserving the origin via `?return=`/`?next=`. The dashboard chrome itself is gated, not the marketing pages.
- **Two settings surfaces, intentionally separate:** `/settings` = identity/security/connections/danger (profile hub); `/dashboard/settings` = app/dashboard preferences (theme, sessions, notifications, network, storage/LLM meters, export). They share only the concept of "sessions" (each with its own UI and revoke calls).
-- **Heavy 301 consolidation:** `/dashboard-classic/*` and many legacy `/dashboard/*` slugs (wallets, sessions, actions, memory, strategy, voice, sns, delegation, x402, storage, usage, agent-pumpfun) redirect to the canonical `/dashboard/*` pages — mirrored in both `vercel.json` and the Vite dev middleware so dev matches prod.
+- **Heavy 301 consolidation:** `/dashboard-classic/*` and many legacy `/dashboard/*` slugs (wallets, sessions, actions, memory, strategy, voice, sns, delegation, x402, storage, usage, agent-pumpfun) redirect to the canonical `/dashboard/*` pages in `vercel.json`. The Vite dev middleware mirrors only the `/dashboard-classic/*` family; the bare legacy slugs 301 in prod but have no dev equivalent.
diff --git a/docs/ux-flows/12-home-and-content.md b/docs/ux-flows/12-home-and-content.md
index 5a3ff5609..f9e94331a 100644
--- a/docs/ux-flows/12-home-and-content.md
+++ b/docs/ux-flows/12-home-and-content.md
@@ -12,52 +12,57 @@ confirmed against source.
## Home — `/`
- **Source:**
- - Markup + inline modules: `pages/home.html` (6921 lines; served via `vercel.json` `"/" → "/home.html"`)
- - Lazy-mounted widget modules: `src/home-forge.js`, `src/home-pose.js`, `src/home-act2-viewer.js`, `src/home-live-token.js`
+ - Markup + inline modules: `pages/home.html` (~3800 lines; CSS extracted to `/home.css`; served via `vercel.json` `"/" → "/home.html"`)
+ - Lazy-mounted widget modules: `src/home-forge.js` (+ `src/home-forge-controls.js`), `src/home-pose.js`, `src/home-live-token.js`, `src/home-bento.js`, `src/home-sniper.js`, `src/home-live-agents.js`, `src/economy-ticker.js`
- Other lazy mounts referenced by inline scripts: `src/avatar-drop.js`, `src/walk-embed-preview.js`, `src/pump/homepage-launcher.js`, `src/api-playground.js`, `src/forge-embed-snippets.js`, `src/erc8004/qr.js`
- - Web component runtime: `<script src="https://three.ws/agent-3d/latest/agent-3d.js">` (line 2430) + `/embed.js`
- - Chrome: `/nav.js`, `/footer.js`
+ - Web component runtime: `<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js">` (near the top of `<head>`) + `/model-viewer-meshopt.js` (no `/embed.js` on this page)
+ - Chrome: `/nav.js` + `/seasonal.js`; the footer is hardcoded inline in `home.html` (no `/footer.js` here)
- **Entry point:** Root route. No auth. The hero `<agent-3d>` and the capability/press strips render immediately; every widget below the fold is lazy-loaded on `IntersectionObserver` to keep the initial payload light.
-- **Prerequisites / gates:** None. Fully public, no wallet/login. The mini-Forge uses an anonymous device `forge:cid` handle (localStorage); no sign-up required to generate a model.
+- **Prerequisites / gates:** None. Fully public, no wallet/login. The mini-Forge uses an anonymous device `forge:cid` handle (localStorage); no sign-up required to generate a model. **Progressive disclosure:** first-time visitors get the "lite" page (`tws-lite` class unless `localStorage['tws:tier'] === 'full'`); nine advanced sections are tagged `data-tier="advanced"` and hidden behind an "advanced platform" gate section (`#advanced-gate`) that links each of them (sniper, capabilities, token economy, live economy, oracle, x402, dev platform, stack).
- **Steps (the landing flow is browse-and-branch, not linear; the "required" path is reach a CTA → click → leave to a product route):**
- 1. Land on hero — headline "The 3D agent layer of the internet.", three hero bullets, a live `<agent-3d>` on stage, and the eyebrow link "New · Text → 3D is live…" → `/forge`.
- 2. (Optional) Trigger a hero animation chip (🎲 Random, 👋 Wave, 💃 Dance, 🤸 Capoeira, 🦘 Jump, 🧟 Thriller, 🙏 Pray) — drives the live agent; a counter tracks triggers.
- 3. Choose a primary CTA: **"Build your agent →"** → `/create`, **"Text → 3D"** → `/forge`, or **"See the embed"** → `#embed` anchor (in-page Playground).
- 4. (Optional) Scroll through the page's ~23 sections, each demoing a capability with a live widget and its own CTA (see Decision points below).
- 5. Click any CTA to leave for the target product route.
+ 1. Land on hero: headline "The 3D agent layer of the internet.", three hero bullets (the third, "Earn USDC per chat", is advanced-tier), a live `<agent-3d>` on stage, and the eyebrow link "New · Text → 3D is live…" → `/forge`.
+ 2. (Optional) Forge from the hero: `#hero-forge-form` is a live text-to-3D input ("describe anything…" + **"Forge it"** button + three Try chips: low-poly fox / sci-fi helmet / ceramic teapot) that types straight into the mini-Forge, which now sits directly under the hero. An "Open the full Forge →" note links `/forge`. A `<lang-switcher>` sits under the CTA row.
+ 3. (Optional) Trigger a hero animation chip (🎲 Random, 👋 Wave, 💃 Dance, 🤸 Capoeira, 🦘 Jump, 🧟 Thriller, 🙏 Pray); each chip drives the live agent, and a counter tracks triggers.
+ 4. Choose a primary CTA: **"Build your agent →"** → `/create`, **"See the embed"** → `#embed` anchor (in-page Playground), or **"▶ Take the tour"** → `/tour`. (The "Text → 3D" hero CTA is gone; that label now only appears in the closing section.)
+ 5. (Optional) Follow the "Start here · three steps, about five minutes" section: 01 Create a 3D avatar → `/create/prompt`, 02 Build an AI agent → `/create-agent`, 03 Publish anywhere → `#embed`, plus "Power user? Skip to the advanced platform ↓" → `#advanced-gate`.
+ 6. (Optional) Scroll through the page's ~25 sections, each demoing a capability with a live widget and its own CTA (see Decision points below).
+ 7. Click any CTA to leave for the target product route.
- **Decision points / branches (every body CTA → destination, exact labels):**
- - Hero / eyebrow: eyebrow → `/forge`; "Build your agent →" → `/create`; "Text → 3D" → `/forge`; "See the embed" → `#embed`.
- - Three Doors (02): "Start building" → `/create`; "Read the docs" → `/docs`; "Set up monetization" → `/dashboard/monetize`.
+ - Hero / eyebrow: eyebrow → `/forge`; "Build your agent →" → `/create`; "See the embed" → `#embed`; "▶ Take the tour" → `/tour`; hero forge bar → in-page mini-Forge.
+ - Press strip: news links → `/news/*` routes (MCP/x402 Bazaar, IBM collaboration, AWS Marketplace, Alibaba Cloud Marketplace, and one numeric X-article slug).
+ - Three Doors: "Start building" → `/create`; "Read the docs" → `/docs`; "Set up monetization" → `/dashboard/monetize`.
- What You Get cards: "Open viewer" → `/playground`; "Widget Studio" → `/widgets`; "Claim your subdomain" → `/dashboard/account`.
- Community Forge: "Generate yours →" → `/forge`.
+ - Autonomous trading (`#home-sniper`, via `src/home-sniper.js`): "Watch the arena →" → `/arena`; "Arm a strategy" → `/oracle/arm`.
- Pose Studio: "Pose Studio" → `/pose`; "Open this pose in the full studio →" → `/pose?…` (carries pose params).
- Mini Forge: "open the full Forge →" → `/forge`.
- - AR: "Forge gallery"/"Generate your own model →" → `/forge`; "Browse the avatar gallery →" → `/gallery`; "AR feature overview →" → `/features/ar`; "How AR works →" → `/blog/see-your-3d-in-ar`.
- - Capabilities Bento: "Continue in Avatar Studio →" → `/create/selfie`.
- - Pump.fun token (04): "Explore token agents →" → `/launches`; "Trending tokens" → `/radar`; "Launch yours" → in-page launcher (`src/pump/homepage-launcher.js`).
- - Oracle: "Open Oracle →" / "View all conviction scores →" → `/oracle`.
+ - AR: "Forge gallery"/"Generate your own model →" → `/forge`; "Open this model in AR →" → `/forge`; "Browse the avatar gallery →" → `/gallery`; "AR feature overview →" → `/features/ar`; "How AR works →" → `/blog/see-your-3d-in-ar`.
+ - Capabilities Bento: "Continue in Avatar Studio →" → `/create/selfie`; a sign-language card → `/sign-language`.
+ - Pump.fun token: "Explore token agents →" → `/launches`; "Trending tokens" → `/radar`; "Launch yours" → in-page launcher (`src/pump/homepage-launcher.js`).
+ - Live economy: "Agent Galaxy" inline link → `/galaxy`.
+ - Oracle: "Open Oracle →" / "View all conviction scores →" → `/oracle`; coin cards deep-link `/oracle/coin/<mint>`.
- Pay-per-call: "Configure monetization →" → `/dashboard/monetize`.
- - Walk: "See walk mode →" → `/walk`.
- - Developer platform (05): "Get a key"/"Get API key →" → `/dashboard/api`; "Docs" → `/docs`; "GitHub" → github.com/nirholas/three.ws; "OpenAPI" → `/api/openapi-json`; "MCP server" → `/docs/mcp`.
- - The Stack (07): Studio → `/studio`; Registry → `/discover`; Embed → `/docs`; Pay-per-call → `/dashboard/monetize`; Walk → `/walk`; SDK → `/docs/sdk`.
- - Showcase 3D (08): "Browse all" → `/discover`; "Make your own" → `/create`.
- - Avatar Drop (09) & Vclose: "Build your agent →" → `/create`; "Text → 3D" → `/forge`; "Read the docs" → `/docs`.
- - Footer (6 columns): Product (`/create`, `/forge`, `/marketplace`, `/discover`, `/pricing`, `/dashboard`), Explore (`/agents`, `/reputation`, `/characters`, `/gallery`, `/bazaar`), Developers (`/docs`, `/avatar-sdk`, `/dashboard/api`, `/artifact`, `/sitemap`), Integrations (`/galaxy`, `/x402`, `/aws`), Company (`/blog`, `/community`, X, GitHub, `mailto:[email protected]`), Legal (`/legal/privacy`, `/legal/tos`), plus a "$THREE contract address" copy button.
+ - Walk: "See walk mode →" → `/temporary` (the `/walk` route still exists but home points at `/temporary`).
+ - Developer platform: "Get a key ↗"/"Get API key →" → `/dashboard/api`; "Docs" → `/docs`; "GitHub" → github.com/nirholas/three.ws; "OpenAPI" → `/api/openapi-json.js` (currently a dead link; only `/openapi.json` is routed); "MCP server" → `/docs/mcp`.
+ - The Stack: Studio → `/studio`; Registry → `/discover`; Embed → `/docs`; Pay-per-call → `/dashboard/monetize`; Walk → `/temporary`; SDK → `/docs/sdk`.
+ - Showcase 3D: "Browse all" → `/discover`; "Make your own" → `/create`.
+ - Avatar Drop & Vclose: "Build your agent →" → `/create`; "Text → 3D" → `/forge`; "Read the docs" → `/docs`.
+ - Footer (6 columns, inline in home.html): Product (`/create`, `/forge`, `/image-to-3d`, `/marketplace`, `/discover`, `/pricing`, `/dashboard` labeled "Console"), Explore (`/agents`, `/reputation`, `/characters`, `/gallery`, `/bazaar`), Developers (`/docs`, `/avatar-sdk`, `/dashboard/api`, `/artifact`, `/sitemap`), Integrations (`/galaxy`, `/x402`, `/aws`), Company (`/blog`, `/community`, `/support`, `/status`, X, GitHub, `mailto:[email protected]`), Legal (`/legal/privacy`, `/legal/tos`), plus a "$THREE contract address" copy button.
- **Embedded interactive widgets (in-page, no navigation required):**
- - **Hero agent** — live `<agent-3d>` + 7 animation chips.
- - **Playground (`#embed`)** — editable embed-code textarea (HTML/React/Vue tabs), mode chips (inline/widget), background chips, feature toggles (responsive/nameplate/chat/eager), live `<agent-3d>` preview, 7 animation test chips, copy-code button.
- - **Mini Forge (`#home-forge`, `src/home-forge.js`)** — real text-to-3D: prompt bar with typewriter suggestions (Tab to accept), example chips, POST `/api/forge` (tier `standard`, TRELLIS lane, free; auto-degrades to NVIDIA lane), poll `GET /api/forge?job=…`, live `<model-viewer>` result, session history rail (localStorage `forge:home:history`), result toolbar (auto-rotate toggle, variation, Scene Studio → `/scene?model=…`, copy share link, GLB download, clear), and an embed sheet (iframe/web-component snippets, size presets, copy, standalone link). Cancel/retry wired. Honest elapsed timer only.
+ - **Hero agent**: live `<agent-3d>` + 7 animation chips + the hero forge bar.
+ - **Playground (`#embed`)**: editable embed-code textarea (HTML/React/Vue tabs), mode chips (inline/widget), background chips plus a custom color picker (`#pg-color-trigger`/`#pg-color-hex`), an avatar row (`#pg-avatars`), feature toggles (responsive/nameplate/chat/eager), live `<agent-3d>` preview, 7 animation test chips (idle/wave/dance/capoeira/jump/thriller/celebrate), copy-code button.
+ - **Mini Forge (`#home-forge`, `src/home-forge.js`)**: real text-to-3D, now directly under the hero: prompt bar with typewriter suggestions (Tab to accept), example chips, POST `/api/forge` (tier `standard`, `backend: null` so the server's health-aware router picks the lane), poll `GET /api/forge?job=…`, live `<model-viewer>` result, session history rail (localStorage `forge:home:history`; a separate `forge:home:count` drives milestone nudges as the device's collection grows), result toolbar of 7 controls (auto-rotate toggle, Variation, Scene Studio → `/scene?model=…`, Embed sheet, Copy share link, GLB download, Clear), and an embed sheet (iframe/web-component snippets, size presets, copy, standalone link). Share copies a real OG-unfurling permalink `/forge/share/<creation_id>` for fresh forges, or a remix link `/?prompt=<encoded>&remix=1` for history-restored results; arriving with `?prompt=`/`&remix=1` auto-forges on load (the module boots eagerly when the URL carries a prompt). An "Options" disclosure (`src/home-forge-controls.js`) adds quality tiers (draft/standard/high, high gated behind $THREE holding), a live engine picker fed by `/api/forge?catalog` + `?health`, aspect ratio, and BYOK keys. Cancel/retry wired. Honest elapsed timer only.
- **Pose Studio (`#home-pose`, `src/home-pose.js`)** — drag-to-orbit rig, joint sliders, preset chips, reset/snapshot/copy-link/open-studio buttons.
- - **AR (`#home-ar`)** — `<model-viewer>` with `ar` modes (webxr/scene-viewer/quick-look), desktop QR (lazy `src/erc8004/qr.js`), model cycling.
+ - **AR (`#home-ar`)**: `<model-viewer>` with `ar` modes (webxr/scene-viewer/quick-look), desktop QR (lazy `src/erc8004/qr.js`), model cycling (fed by a top-sorted `/api/forge-gallery` fetch).
- **Live token card (`#hlt-card`, `src/home-live-token.js`)** — real Pump.fun data; plus homepage launcher.
- - **Oracle feed** — `GET /api/oracle/feed?network=mainnet&limit=6&min_score=56`, renders top conviction coins.
- - **Community Forge gallery** — `GET /api/forge-gallery?scope=community&limit=18`.
- - **Showcase 3D grid** — `GET /api/explore`, agent cards + CTA cards.
+ - **Oracle feed**: `GET /api/oracle/feed?network=mainnet&limit=6&min_score=56`, renders top conviction coins ("Oracle is warming up…" empty state; error state renders an "Open Oracle →" button).
+ - **Community Forge gallery**: a live, sortable browse loop over `GET /api/forge-gallery?scope=community&…limit=24`: Fresh/Trending tabs (`sort=fresh` vs `sort=top&window=week`), a 25s background refresh that prepends genuinely-new models on Fresh (with a live chip), prompt-based dedupe, and a "Show more" button (12 shown initially, up to 24).
+ - **Showcase 3D grid**: `GET /api/explore?source=avatar&only3d=1&category=avatar,creature&limit=24&quality=high` (via `src/home-live-agents.js`), agent cards + CTA cards.
- **Other live agents** — What-You-Get viewer (50+ animation chips), Bento mini-agents, Vclose agent, Avatar Drop canvas, Walk preview canvas.
-- **External calls / dependencies:** `POST/GET /api/forge`, `GET /api/forge-gallery`, `GET /api/explore`, `GET /api/oracle/feed`; Pump.fun feed (live token card); `agent-3d` runtime + Google `model-viewer` CDN (lazy). Solana RPC indirectly via the launcher.
+- **External calls / dependencies:** `POST/GET /api/forge` (+ `?catalog`/`?health` for the options panel), `GET /api/forge-gallery`, `GET /api/explore`, `GET /api/oracle/feed`; Pump.fun feed (live token card); `agent-3d` runtime + Google `model-viewer` CDN (lazy). Solana RPC indirectly via the launcher.
- **Success state:** User reaches and clicks a CTA into a product route, or completes an in-page demo (e.g. a forged model rendered with a working toolbar; an embed snippet copied).
- **Empty / error states:**
- - Mini Forge: 503/`unconfigured` → "The generator is offline right now"; 429/`rate_limited` → "The forge is busy, try again in ~N s"; poll timeout → "try a simpler, single-subject prompt"; viewer load failure surfaced; explicit error state with **Try again** (re-runs `lastPrompt`) and **Cancel**.
+ - Mini Forge: 503/`unconfigured` → "The generator is offline right now" (with a try-again-in-a-bit tail); 429/`rate_limited` → "The forge is busy. Try again in about N seconds."; poll timeout → "Generation timed out" plus a try-a-simpler-single-subject-prompt hint; a high-tier request without the $THREE hold gets its own gate message; viewer load failure surfaced; explicit error state with **Try again** (re-runs `lastPrompt`) and **Cancel**.
- API-fed sections (Oracle, Community Forge, Showcase) degrade gracefully if their fetch fails (sections render empty rather than break the page).
- Reduced-motion respected throughout (typewriter, parallax, scanline disabled).
- Clipboard blocked → fallback hidden input + `execCommand('copy')` with "Press ⌘/Ctrl-C" toast.
@@ -70,21 +75,21 @@ confirmed against source.
### What is three.ws — `/what-is`
- **Source:** `pages/what-is.html` (static; `<model-viewer>` v4.0.0 CDN).
- **Entry point:** `vercel.json` `/what-is → /what-is.html`.
-- **Steps (4):** 1) Read hero/overview. 2) Expand/collapse FAQ accordion (4 questions: crypto, free-to-start, skills-needed, where-embed) via `.fl-faq-q` buttons. 3) Drag/orbit the embedded sample avatar (`/animations/soldier.glb`). 4) Follow a nav/CTA link (`#use-cases`, `/create`, `/features`, `/studio`, `/playground`, `/play`, `/overlay-control`, `/pay`).
+- **Steps (4):** 1) Read hero/overview. 2) Expand/collapse FAQ accordion (4 questions: crypto, free-to-start, skills-needed, where-embed) via `.fl-faq-q` buttons. 3) Drag/orbit the embedded sample avatar (`/animations/soldier.glb`). 4) Follow a nav/CTA link (`#use-cases`, `/`, `/brain`, `/chat`, `/create`, `/create/selfie`, `/docs`, `/features`, `/forge`, `/overlay-control`, `/pay`, `/play`, `/studio`).
- **Notes:** Schema.org FAQPage + WebPage. No API calls. Interactive: FAQ accordion + 3D viewer.
### Features (index) — `/features`
- **Source:** `pages/features.html` (static + 3D widgets; `/footer-newsletter.js`).
- **Entry point:** `vercel.json` `/features → /features.html`. (Subpages `/features/*` covered elsewhere.)
-- **Steps (6):** 1) Hero "Core" vs "Optional" pill nav scrolls to `#core`/`#optional`. 2) Animation showcase: 70+ pills swap a live `<model-viewer>` `src` (`/animations/*.glb`) with a "Now Playing" label. 3) Copy embed snippet (`#embedCopyBtn` → clipboard, "Copied!" 2s). 4) Scroll-reveal cascade (IntersectionObserver). 5) Interact with multiple embedded `<model-viewer>` demos. 6) Newsletter signup (footer `data-newsletter-form` → `POST /api/newsletter/subscribe`).
-- **Notes:** No content-fetch API; copy button + animation picker + newsletter form are the real interactions.
+- **Steps (7):** 1) Hero "Core" vs "Optional" pill nav scrolls to `#core`/`#optional`. 2) Animation showcase: ~31 pills swap a live `<model-viewer>` `src` (`/animations/*.glb`) with a "Now Playing" label. 3) Browse the **"New on three.ws"** strip (`#featNewGrid`): populated at runtime from `GET /changelog.json`, filtered to launches/feature-tagged entries, deduped, 6 newest rendered as cards (kind tag, date, title, summary) linking to the entry's page or `/changelog/<slug>`; skeletons while loading, and a fallback link to `/changelog` on fetch failure. 4) Copy embed snippet (`#embedCopyBtn` → clipboard, "Copied!" 2s). 5) Scroll-reveal cascade (IntersectionObserver). 6) Interact with multiple embedded `<model-viewer>` demos. 7) Newsletter signup (footer `data-newsletter-form` → `POST /api/newsletter/subscribe`).
+- **Notes:** The only content fetch is `/changelog.json` for the newest strip; copy button + animation picker + newsletter form are the other real interactions.
### Status — `/status`
- **Source:** `pages/status.html` (dynamic).
- **Entry point:** `vercel.json` `/status → /status.html`.
- **Prerequisites / gates:** None.
-- **Steps (3):** 1) On load, fetch `GET /api/status` and render service cards (status dot, uptime %, avg latency, 90-day history bar). 2) Auto-poll every 5 min (`setInterval`, 300000 ms) updating the `aria-live` banner ("All systems operational" ↔ "X of Y services disrupted"). 3) Hover/focus a 90-day history cell for per-day tooltip.
-- **External calls:** `GET /api/status`.
+- **Steps (4):** 1) On load, fetch `GET /api/status` and render service cards (status dot, uptime %, avg latency, 90-day history bar). 2) Auto-poll every 5 min (`setInterval`, 300000 ms) updating the `aria-live` banner ("All systems operational" ↔ "X of Y services disrupted"). 3) Hover/focus a 90-day history cell for per-day tooltip. 4) Read the live build stamp: a `GET /api/version` fetch fills `#st-build` with the live commit (linked to GitHub), version, Cloud Run revision, and build time; it stays hidden if the endpoint is unreachable. Footer links to the SVG status badge (`/api/status?format=svg`) and `/changelog`.
+- **External calls:** `GET /api/status`, `GET /api/version`.
- **Success state:** Live service grid rendered with current operational status + "last check" timestamp.
- **Empty / error states:** Skeleton loaders on first paint; on fetch failure renders an error message with retry guidance.
- **Step count:** 1 required (page loads + auto-fetches) (+2 optional: re-poll happens automatically; hover cells).
@@ -93,7 +98,7 @@ confirmed against source.
- **Source:** `pages/glossary.html` + `src/glossary/page.js`; term data inline in `public/glossary.js` (`window.twsGlossary.terms`, injected site-wide by `nav.js`).
- **Entry point:** `vercel.json` `/glossary → /glossary.html`.
- **Steps (4):** 1) Type in `#glos-q` search (rAF-debounced `applyFilter`, case-insensitive, filters cards). 2) Result count updates (`#glos-count` aria-live: "X terms" / "Y of X terms" / "No terms match '…'"). 3) Deep-link `#<term>` scrolls + flash-highlights a card (`highlightFromHash`). 4) Read a term card.
-- **Notes:** No external API — terms are a static inline object (~16+ terms: usdc, sol, solana, evm, wallet, x402, pay-per-call, on-chain, mint, bonding-curve, pump.fun, mainnet, base, nft, ipfs, mcp, a2a, erc-8004, metaplex-core, graduation, skills, brain, rig…). page.js polls up to 6s for the injected glossary data.
+- **Notes:** No external API; terms are a static inline object (36 terms: usdc, sol, solana, evm, wallet, x402, pay-per-call, on-chain, mint, bonding curve, pump.fun, gas, mainnet, testnet, base, nft, ipfs, mcp, a2a, erc-8004, agent reputation, identity registry, reputation registry, validation registry, attestation, vouch, stake, sybil attack, metaplex core, agenc, trust grade, memo attestation, graduation, skills, brain, rig). page.js polls up to 6s for the injected glossary data (self-injecting `/glossary.js` if nav.js didn't).
### Support — `/support`
- **Source:** `pages/support.html` (static).
@@ -104,25 +109,25 @@ confirmed against source.
### Events — Build 3D Agents Live — `/events/build-3d-agents-live`
- **Source:** `pages/events/build-3d-agents-live.html` (static + realtime; `/embed.js`, `/footer-newsletter.js`).
- **Entry point:** `vercel.json` `/events/([a-z0-9-]+) → /events/$1.html`.
-- **Steps (5):** 1) Watch live countdown to start (event 2026-06-23 18:00 MT / 20:00 ET, 60 min, online; rAF tick → days/hrs/min/sec; switches to "LIVE NOW" then "Replay coming soon"). 2) Add to calendar (`#add-cal`/`#add-cal-2` build a Google Calendar render URL from EVENT_START/END). 3) RSVP email signup (`#rsvp-form`, `data-newsletter-form` → `POST /api/newsletter/subscribe`, aria-live result). 4) Interact with the lazy-loaded hero `<agent-3d>` (deferred via `requestIdleCallback` → `/embed.js`). 5) Scroll-reveal sections.
+- **Steps (5):** 1) The countdown block reflects event phase (event was 2026-06-23 18:00 MT, 60 min, online; rAF tick → days/hrs/min/sec pre-event; "LIVE NOW" during; since EVENT_END passed it now renders the post-event headline "Thanks for joining" with the sub-label "replay coming soon"; no replay link exists yet). 2) Add to calendar (`#add-cal`/`#add-cal-2` build a Google Calendar render URL from EVENT_START/END, now a past date). 3) RSVP email signup (`#rsvp-form`, `data-newsletter-form` → `POST /api/newsletter/subscribe`, aria-live result). 4) Interact with the lazy-loaded hero `<agent-3d>` (deferred via `requestIdleCallback` → `/embed.js`). 5) Scroll-reveal sections.
- **Notes:** Schema.org Event. Countdown is local (no API); only newsletter POSTs.
### Legal — Privacy & Terms — `/legal/privacy`, `/legal/tos`
- **Source:** `public/legal/privacy.html`, `public/legal/tos.html` (pure static).
- **Entry point:** `vercel.json` `/legal/privacy → /legal/privacy.html`, `/legal/tos → /legal/tos.html`.
- **Steps (1):** Read the document; follow cross-links (each links to the other, plus `mailto:` addresses; one IBM cloud external ref).
-- **Notes:** No TOC/anchors, no dynamic behavior, no API. Privacy = 11 sections; Terms = 12 sections.
+- **Notes:** v2 of both documents shipped 2026-07-16. No TOC/anchors, no API; the pages do run the standard chrome (theme boot, `/nav.js`, `/footer.js`, `/brand.js`, `/i18n.js` runtime translation) but the legal body is hand-authored static HTML. Privacy = 16 h2 sections (through MCP Connectors / AI Processing, Free 3D Actions, Changes, Contact); Terms = 20 numbered sections (through Dispute Resolution with arbitration + class-action waiver, Governing Law, Termination, Changes, Miscellaneous, Contact).
### Tutorials index — `/tutorials`
-- **Source:** `pages/tutorials.html` (client-rendered from `public/tutorials-manifest.js` → `window.TUTORIALS`, 23 entries, 3 tiers).
+- **Source:** `pages/tutorials.html` (client-rendered from `public/tutorials-manifest.js` → `window.TUTORIALS`, 69 entries, 3 tiers).
- **Entry point:** `vercel.json` `/tutorials → /tutorials.html`.
-- **Steps (4):** 1) Use hero jump-links (`.tut-jump`, 3 tiers) to scroll. 2) Browse 23 tutorial cards (Easy 8 / Middle 10 / Advanced 5), grouped with section headers. 3) Click a card → `/tutorials/<slug>`. 4) Bottom CTA: "Open docs →" → `/docs`; "Read source on GitHub" (new tab).
+- **Steps (4):** 1) Use hero jump-links (`.tut-jump`, 3 tiers) to scroll. 2) Browse 69 tutorial cards (Easy 21 / Middle 25 / Advanced 23), grouped with section headers. 3) Click a card → `/tutorials/<slug>`. 4) Bottom CTA: "Open docs →" → `/docs`; "Read source on GitHub" (new tab).
- **Notes:** Dynamic render from the manifest `<script>`, no fetch. Hover: translateY + accent-bar.
### Tutorial article template — `/tutorials/prompts-for-3d`, `/tutorials/generate-3d-api`
- **Source:** `pages/tutorial.html` (route `/tutorials/([a-z0-9-]+) → /tutorial.html`); content markdown in `docs/tutorials/<slug>.md` (`docs/tutorials/prompts-for-3d.md`, `docs/tutorials/generate-3d-api.md`); metadata from `public/tutorials-manifest.js`.
- **Entry point:** Slug parsed from URL via regex, metadata via `window.tutorialBySlug(slug)`.
-- **Steps (5):** 1) Read hero (title/meta from manifest). 2) Hero CTA (manifest-driven, e.g. "Open the Forge"). 3) Read article — markdown fetched `GET /docs/tutorials/<slug>.md`, parsed with marked + highlight.js; per-`<pre>` **copy code** buttons ("Copy" → "Copied" 1700ms). 4) Use the sticky TOC (scroll-spy) and heading anchors. 5) Prev/Next pager (adjacent manifest entries); back-to-top button + top progress bar.
+- **Steps (5):** 1) Read hero (title/meta from manifest). 2) Hero CTA (manifest-driven, e.g. "Open the Forge"). 3) Read article: markdown fetched `GET /docs/tutorials/<slug>.md`, parsed with marked + highlight.js; per-`<pre>` **copy code** buttons ("Copy" → "Copied" 1700ms); `figure:` directives in the markdown resolve to real captured images via `/tutorial-figures.js` + `/tutorial-figures.css` (pipeline shared with the cookbook recipe viewer). 4) Use the sticky TOC (scroll-spy) and heading anchors. 5) Prev/Next pager (adjacent manifest entries); back-to-top button + top progress bar.
- **External calls:** `GET /docs/tutorials/<slug>.md`.
- **Success state:** Rendered article with working TOC, copy buttons, and pager.
- **Empty / error states:** "Page not found." on failed markdown fetch.
@@ -132,10 +137,10 @@ confirmed against source.
### Docs (index + all subpages) — `/docs`, `/docs/start-here`, `/docs/make-your-agent`, `/docs/share-and-embed`, `/docs/do-i-need-crypto`, `/docs/quick-start`, `/docs/agent-system`, `/docs/erc8004`, `/docs/embedding`, `/docs/web-component`, `/docs/mcp`, `/docs/skills`, `/docs/api-reference`, `/docs/sdk`, `/docs/listings` (and ~50 more)
- **Source:** Single SPA shell `docs/index.html` (served for `/docs`, `/docs/`, and `/docs/<slug>` per `vercel.json`); markdown content in `docs/*.md` and `docs/tutorials/*.md`. Marked + highlight.js via CDN.
- **Entry point:** `vercel.json` `/docs → /docs/index.html`, `/docs/([^./]+) → /docs/index.html` (the slug becomes a hash route). `currentPath()` reads `location.hash` (or `/docs/<slug>`), defaulting to `start-here`.
-- **Steps (4):** 1) Land — sidebar (9 sections, NAV array) + `start-here.md` fetched & rendered. 2) Sidebar **search** input live-filters the nav by label. 3) Click a sidebar link → hash route → `GET /docs/<slug>.md` rendered (headings get anchor IDs; internal `.md` links rewritten to hash routes; code highlighted). 4) Per-page tools: "Copy page" (markdown to clipboard), "View as Markdown" (`/docs/<slug>.md` new tab), "Open in Claude" (`claude.ai/new?q=…`); Prev/Next pager; mobile sidebar FAB/overlay.
-- **External calls:** `GET /docs/<slug>.md` per page (e.g. `do-i-need-crypto.md`, `quick-start.md`, `agent-system.md`, `erc8004.md`, `embedding.md`, `web-component.md`, `mcp.md`, `skills.md`, `api-reference.md`, `sdk.md`, `listings.md`, `make-your-agent.md`, `start-here.md`); marked + highlight.js CDNs.
-- **Empty / error states:** Loading dots during fetch; "Page not found." on a missing slug.
-- **Notes:** ALL `/docs/*` slugs (except `/docs/widgets`) share this one SPA — the route is one repeated pattern: navigate (hash/sidebar/search) → fetch markdown → render, with copy-page + pager + TOC behaviors. Real steps per page = 1 required (read) +3 optional (search, copy-page, pager). **Exception:** `/docs/widgets` is a separate standalone page (below).
+- **Steps (4):** 1) Land: the sidebar NAV is loaded from `GET /docs/nav.json` (currently 14 sections / ~273 links, with a designed failure state if the manifest 404s) + `start-here.md` fetched & rendered. 2) Sidebar **search** live-filters the nav by label AND surfaces a full-text results panel fed by the docs search index (with a Clear search control). 3) Click a sidebar link → hash route → `GET /docs/<slug>.md` rendered (headings get anchor IDs; internal `.md` links rewritten to hash routes; code highlighted). 4) Per-page tools: "Copy page" (markdown to clipboard), "View as Markdown" (`/docs/<slug>.md` new tab), "Open in Claude" (`claude.ai/new?q=…`); Prev/Next pager; mobile sidebar FAB/overlay; a lazy doc-freshness banner (`/doc-freshness.js`, backed by `public/docs-freshness*.json`).
+- **External calls:** `GET /docs/nav.json`; `GET /docs/<slug>.md` per page (e.g. `do-i-need-crypto.md`, `quick-start.md`, `agent-system.md`, `erc8004.md`, `embedding.md`, `web-component.md`, `mcp.md`, `skills.md`, `api-reference.md`, `sdk.md`, `listings.md`, `make-your-agent.md`, `start-here.md`); marked + highlight.js CDNs.
+- **Empty / error states:** Loading dots during fetch; "Page not found." on a missing slug; a designed nav-manifest failure state.
+- **Notes:** Nearly all `/docs/*` slugs share this one SPA; the route is one repeated pattern: navigate (hash/sidebar/search) → fetch markdown → render, with copy-page + pager + TOC behaviors. Real steps per page = 1 required (read) +3 optional (search, copy-page, pager). **Exceptions mapped before the generic rule:** `/docs/widgets` (standalone page, below), `/docs/3d-api` → `/3d.html`, `/docs/agent-3d` → 308 → `/docs/web-component`, and the `/docs/walk*` family.
### Docs — Widgets (standalone) — `/docs/widgets`
- **Source:** `public/docs-widgets.html` (static; `vercel.json` `/docs/widgets → /docs-widgets.html`, mapped *before* the generic `/docs/*` rule).
@@ -146,19 +151,19 @@ confirmed against source.
- **Source:** `blog/index.html` (static; `vercel.json` `/blog → /blog/index.html`).
- **Entry point:** `/blog`.
- **Prerequisites / gates:** None.
-- **Steps (2):** 1) Scan the hardcoded list of 26 post cards (each shows title, date, informational tag). 2) Click a post → `/blog/<slug>`. (Also: RSS link `/rss/announcements.xml`; X/GitHub external links.)
-- **Decision points / branches:** 26 posts → 26 individual article routes; RSS / social out.
+- **Steps (2):** 1) Scan the hardcoded list of 35 post cards (each shows title, date, informational tag). 2) Click a post → `/blog/<slug>`. (Also: RSS link `/rss/announcements.xml`; X/GitHub external links.)
+- **Decision points / branches:** 35 indexed posts → individual article routes (37 post files exist; two are routable but unlinked from the index); RSS / social out.
- **External calls:** None — fully static list (no fetch, no pagination, no filter/search). Tags are display-only, not filterable.
- **Success state:** User opens an article.
- **Empty / error states:** N/A (static).
- **Step count:** 1 required (click a post) (+ optional RSS/social).
-### Blog posts (26) — `/blog/<slug>`
-- **Source:** `blog/<slug>.html` — 26 routable static HTML files, all on **one shared template** (`.post-wrap`, `.post-meta`, `.post-tag`, shared nav/footer containers). Routed via `vercel.json` `/blog/([a-z0-9-]+) → /blog/$1.html`.
-- **Slugs:** 2500-new-animations, 3d-ai-crypto-convergence, agent-3d-web-component, agent-builder-studio-launch, animation-emotion-control, how-to-embed-3d-onchain-agents, pumpfun-agent-payments-sdk, real-time-voice-interaction, see-your-3d-in-ar, solana-wallet-integration, text-to-3d-is-live, three-token-listings, three-ws-aws-partner, three-ws-dextools-social-boost-buyback, three-ws-featured-on-alibaba-cloud-marketplace-blog, three-ws-google-cloud-partnership, three-ws-hackernoon-partnership, three-ws-ibm-business-partner, three-ws-ibm-collaboration, three-ws-on-alibaba-cloud-marketplace, three-ws-on-anthropic-mcp-registry, three-ws-on-aws-marketplace, three-ws-on-bnb-chain-dappbay, three-ws-on-coinmarketcap, three-ws-speraxusd-integration, three-ws-x402-bazaar.
+### Blog posts (37): `/blog/<slug>`
+- **Source:** `blog/<slug>.html`: 37 routable static HTML files, all on **one shared template** (`.post-wrap`, `.post-meta`, `.post-tag`, shared nav/footer containers). Routed via `vercel.json` `/blog/([a-z0-9-]+) → /blog/$1.html`. One legacy slug redirects: `/blog/all-90-trades` 308s to `/blog/autonomous-trading-experiment`.
+- **Slugs:** the routable set is exactly the `blog/*.html` filenames (37 today; enumerate with `ls blog/*.html`), which rots less than restating the list here. (`three-ws-alibaba-cloud-partnership` and `three-ws-play-coin-communities` are routable but not linked from the index.)
- **Steps (1):** Read the article; follow the "← Blog" back link, inline links, and the occasional primary CTA (e.g. text-to-3d post → "Try Forge — type a prompt →" → `/forge`).
- **Notes:** Repeated "read article" pattern. No embedded 3D demos / share / TOC / newsletter inside the post body in the sampled pages; copy-button CSS exists in the template but the sampled posts have no code blocks. No API.
-- **Source not exposed:** Two `.md` files (`blog/decision-optimization-3d-ai-crypto.md`, `blog/internets-second-species.md`) are NOT routed (no rule maps `.md` blog slugs) and are not in the index — source material only, not live pages.
+- **Source not exposed:** Several `.md` files under `blog/` (drafts and source material such as `decision-optimization-3d-ai-crypto.md`, `internets-second-species.md`, `we-are-the-provider.md`, the autonomous-trading X drafts, plus `README.md`) are NOT routed (no rule maps `.md` blog slugs) and are not in the index; source material only, not live pages.
---
@@ -168,14 +173,20 @@ Agent/crawler endpoints — not user UX (0 user steps). All resolve via `vercel.
| Endpoint | Route | Served by | Purpose |
|---|---|---|---|
-| Sitemap | `/sitemap.xml` | `/api/sitemap` (function) | XML sitemap for crawlers (sub-sitemaps at `/sitemap/{core,agents,avatars,widgets,profiles}.xml`) |
+| Sitemap | `/sitemap.xml` | `/api/sitemap` (function) | XML sitemap for crawlers (sub-sitemaps at `/sitemap/{core,agents,avatars,widgets,profiles,news}.xml`) |
| LLMs index | `/llms.txt` | `public/llms.txt` (static) | LLM site index |
| LLMs full | `/llms-full.txt` | `public/llms-full.txt` (static) | Full LLM corpus dump |
| Robots | `/robots.txt` | `public/robots.txt` (static) | Crawler directives |
-| OpenAPI | `/openapi.json` | `/api/openapi-json` (function) | OpenAPI spec for the REST API |
+| OpenAPI | `/openapi.json` | `/api/openapi-json` (function) | OpenAPI spec for the REST API (domain specs also at `/api/crypto/openapi.json`, `/api/3d/openapi.json`) |
| x402 discovery | `/.well-known/x402` | `/api/wk?name=x402` | x402 micropayment service discovery (`/.well-known/x402.json` → `name=x402-discovery`) |
| Agent attestation schemas | `/.well-known/agent-attestation-schemas` | `/api/wk?name=agent-attestation-schemas` | ERC-8004 attestation schema descriptors |
| OAuth AS metadata | `/.well-known/oauth-authorization-server` | `/api/wk?name=oauth-authorization-server` | OAuth 2.0 Authorization Server metadata |
+| OAuth protected resource | `/.well-known/oauth-protected-resource` (also under `/api/mcp/`) | `/api/wk?name=oauth-protected-resource` | OAuth 2.0 Protected Resource metadata |
| Chat plugin manifest | `/.well-known/chat-plugin.json` | `/api/wk?name=chat-plugin` | AI chat-plugin manifest |
+| Vanity metadata | `/.well-known/three-vanity.json` | `/api/wk?name=three-vanity` | Vanity-wallet discovery metadata |
+| JWKS | `/.well-known/jwks.json` | `/api/auth/persona/[action]?action=jwks` | Signing keys |
+| DID document | `/.well-known/did.json` | `/api/x402/did` | x402 DID document |
+| Solana Actions | `/.well-known/solana/actions.json` | static | Solana Actions registry |
+| Agent card (per asset) | `/a/sol/<asset>/.well-known/agent-card.json` | `/api/agents/solana/[action]?action=card` | Per-agent A2A card |
-All `/.well-known/*` and `/openapi.json` / `/sitemap.xml` responses are JSON/XML for machines (agents, wallets, crawlers, OAuth/MCP clients), not rendered UI. The `/.well-known/*` family is handled centrally by `api/wk.js`.
+All `/.well-known/*` and `/openapi.json` / `/sitemap.xml` responses are JSON/XML for machines (agents, wallets, crawlers, OAuth/MCP clients), not rendered UI. The dynamic `/.well-known/*` family is handled centrally by `api/wk.js` (its `DISPATCH` map is the source of truth; public-discovery names get `Access-Control-Allow-Origin: *`, OAuth metadata stays origin-restricted, unknown names 404). A generic `/.well-known/(.*)` fallthrough additionally serves the static manifests in `public/.well-known/` (agent cards, `ai-plugin.json`, `mcp.json`, `security.txt`, `openapi.yaml`, and similar).