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.

fix(chat): delete the fabricated marketing shell inside /chat and make sign-in real

nirholasdad8c6606c63
diff --git a/STRUCTURE.md b/STRUCTURE.md
index ab18c51a9..9a1d19fa4 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -28,7 +28,7 @@ bottom.
| Guided site tour | [tour-sdk/](tour-sdk) | Published as `@three-ws/tour` | 3D guide walks a live site, spotlights sections, narrates each. One-tag CDN build + free roam |
| Concierge (embeddable AI support chat) | [concierge-sdk/](concierge-sdk), backend [api/concierge.js](api/concierge.js) `→ /api/concierge`, landing [pages/concierge.html](pages/concierge.html) `→ /concierge`, first-party CDN copy `→ /concierge/concierge.global.js` (mirrored by [concierge-sdk/build.mjs](concierge-sdk/build.mjs)) | Published as `@three-ws/concierge` | An AI concierge for ANY website: floating launcher, chat panel with a rigged 3D avatar bust (blink/idle/viseme lipsync via the page-agent stage lineage), SSE-streamed answers grounded in the live page (ask-time DOM harvest + host `knowledge`, no crawler), speaks while streaming (sentence-level TTS handoff), push-to-talk mic, themes/accent/position, avatar picker or custom GLB. Backend is anonymous + CORS-`*` (third-party origins by design) with its own rate buckets (`limits.conciergeIp`/`conciergeGlobal`), no platform-side content filter on the visitor question, and streaming failover over the shared free-first chain (api/_lib/llm.js). Shopping mode (Shopify): when embedded on a Shopify storefront it auto-detects the store (`window.Shopify` / `shop` config) and becomes a shopping assistant, reading the store's public `/products.json` + `/collections.json` + `/policies/*` at ask-time (no key, no crawler, same-origin), retrieving the relevant products per question via keyword+intent search ([concierge-sdk/src/shopify.js](concierge-sdk/src/shopify.js)), grounding the answer in them, and rendering real product cards (image/live price/link + on-store `/cart/add.js` add-to-cart). The endpoint accepts a bounded `shopping` payload and swaps the system prompt to a store assistant. `<three-concierge>` element, `data-concierge` one-tag auto-init, or `new Concierge({...})`. Also reachable from any AI agent via the MCP server [packages/concierge-mcp/](packages/concierge-mcp) (`@three-ws/concierge-mcp`, registry `io.github.nirholas/concierge-mcp`): `concierge_ask` (ask any site's concierge, grounded in the fetched page), `concierge_embed` (generate the embed), `concierge_avatars`. Examples: [concierge-sdk/examples/](concierge-sdk/examples) (one-tag, web component, imperative, custom avatar, React, self-hosted backend). Docs: [docs/concierge.md](docs/concierge.md), tutorial [docs/tutorials/build-a-site-concierge.md](docs/tutorials/build-a-site-concierge.md). Tests: [concierge-sdk/test/](concierge-sdk/test), [tests/api-concierge.test.js](tests/api-concierge.test.js), [packages/concierge-mcp/test/](packages/concierge-mcp/test) |
| Assistant widget (3D avatar assistant for any website) | Loader [public/assistant/v1.js](public/assistant/v1.js) `-> /assistant/v1.js`, iframe app [pages/assistant-frame.html](pages/assistant-frame.html) + [src/assistant-frame.js](src/assistant-frame.js) `-> /assistant-frame`, builder [pages/assistant.html](pages/assistant.html) + [src/assistant-page.js](src/assistant-page.js) `-> /assistant`, shared validators [src/assistant-widget-core.js](src/assistant-widget-core.js). npm SDK [assistant-sdk/](assistant-sdk) (`@three-ws/assistant`) is the single source for the loader; its [build.mjs](assistant-sdk/build.mjs) emits the npm ESM + the mirrored one-tag build at `public/assistant/v1.js`. MCP server [packages/assistant-mcp/](packages/assistant-mcp) (`@three-ws/assistant-mcp`, registry `io.github.nirholas/assistant-widget`): `build_assistant_widget` (config -> paste-ready snippet + frame URL + JS-API call), `list_assistant_options` (avatars, backgrounds, modes, attributes). | Published as `@three-ws/assistant` | One script tag adds a floating launcher to any site; clicking it pops up a full-body animated avatar against the host page (transparent) or a color/gradient. Two modes: chatbot (free chain via POST /api/chat, or the visitor's own Groq/OpenRouter key sent browser-to-provider, stored in the frame's localStorage only) and speak mode (avatar repeats typed text out loud via Web Speech + head-anchored speech bubble + talking clip). All params re-validated in-frame (CSS/URL injection safe). Sibling of Concierge (chat panel) - this one is the full-body, avatar-first widget. Install three ways: one-tag CDN, `npm i @three-ws/assistant`, or the MCP server for AI agents. Examples: [assistant-sdk/examples/](assistant-sdk/examples). Docs: [docs/assistant-widget.md](docs/assistant-widget.md) `-> /docs/assistant-widget`, tutorial [docs/tutorials/add-a-3d-assistant.md](docs/tutorials/add-a-3d-assistant.md). Tests: [tests/assistant-widget.test.js](tests/assistant-widget.test.js), [assistant-sdk/test/](assistant-sdk/test), [packages/assistant-mcp/test/](packages/assistant-mcp/test) |
-| Chat (conversational surface) | [chat/](chat) `→ /chat` | Live | Svelte 4 + Vite client, fork of eplus, built by `build:chat` inside `build:gcp` into `public/chat` → `dist/chat`. Free Built-in lane via `/api/chat/proxy` plus BYOK providers; inline 3D forge tools + ModelViewer3D; shares the platform wallet via [src/shared/](src/shared). Docs: [chat/README.md](chat/README.md) |
+| Chat (conversational surface) | [chat/](chat) `→ /chat` | Live | Svelte 4 + Vite client, fork of eplus, built by `build:chat` inside `build:gcp` into `public/chat` → `dist/chat`. Free Built-in lane via `/api/chat/proxy` plus BYOK providers; inline 3D forge tools + ModelViewer3D; shares the platform wallet via [src/shared/](src/shared). Sign-in is wallet (SIWE/SIWS) or email+password against the platform's own `/api/auth/*`, on the same cookie session as the rest of the site ([chat/src/passwordAuth.js](chat/src/passwordAuth.js)). The app is the chat and only the chat: marketing lives at the site root, and the hash routes that once rendered in-app copies of it resolve to the real page and redirect ([chat/src/three-ui/site-routes.js](chat/src/three-ui/site-routes.js)). Docs: [chat/README.md](chat/README.md). Tests: [tests/chat-app-core.test.js](tests/chat-app-core.test.js) |
| three.ws's own guided tour + onboarding | [src/feature-tour/](src/feature-tour) `→ /feature-tour.js`, entry [src/feature-tour.js](src/feature-tour.js), curriculum [public/tour/curriculum.json](public/tour/curriculum.json) generated by [scripts/build-tour.mjs](scripts/build-tour.mjs), landing [pages/tour.html](pages/tour.html) `→ /tour` | Live | A hardened, site-native fork of the [tour-sdk/](tour-sdk) engine (same curriculum schema — stops/sections/tracks/highlight/narration/targets), lazy-injected only when a tour is starting/active (`feature-tour-boot` Vite plugin) so pages that never tour pay no Three.js cost. Three tracks share one curriculum: `full` (every feature, chapter by chapter), `quick` (highlighted heroes), and `onboarding` (added 2026-07-12) — a 6-stop, hand-authored new-account walkthrough chaining `/start` → make an avatar (`/create/selfie`) → build a world (`/diorama`) → live `/markets` data → an optional coin launch (`/create-agent`, clearly skippable) → the new creator's own `/profile`. Auto-offered once to a signed-in account with zero creations across avatars/agents/forged models/worlds (`GET /api/me` → `show_onboarding_tour`, backed by `users.onboarding_tour_seen_at`/`onboarding_tour_completed_at`, migration [api/_lib/migrations/20260712030000_onboarding_tour_state.sql](api/_lib/migrations/20260712030000_onboarding_tour_state.sql)); always reachable afterward via "🎬 Replay guided tour" in the [public/getting-started.js](public/getting-started.js) checklist panel. Tests: [tests/feature-tour-curriculum.test.js](tests/feature-tour-curriculum.test.js), [tests/api-me-onboarding-tour.test.js](tests/api-me-onboarding-tour.test.js) |
| Onboarding tier (Simple ⇄ Everything) | Menu tags [public/nav-data.js](public/nav-data.js), runtime + `window.twsTier` [public/nav.js](public/nav.js), styles [public/nav.css](public/nav.css), homepage start path + gate [pages/home.html](pages/home.html) + [public/home.css](public/home.css) | Live | Progressive disclosure for first-time visitors: the platform's ~119 nav destinations and ten deep homepage sections were competing with its core promise, so a new visitor now gets the ~28 links and the sections that carry one journey (make an avatar, build an agent, publish it) with a three-step start path under the hero. Everything else (the whole Launch menu, trading, token economy, Oracle, pay-per-call, dev platform, the stack) is tagged `tier: 'advanced'` / `data-tier="advanced"` and revealed by one control. Mechanism is one `<html>` class (`tws-lite`) over one localStorage key (`tws:tier`), applied pre-paint and never re-rendered (the nav binds document-level listeners once), with the two surfaces synced through a `tws:tier-change` event. Deep links into a gated section reveal it for that visit. Nothing is removed, only deferred. Docs: [docs/onboarding-tier.md](docs/onboarding-tier.md). Tests: [tests/onboarding-tier.test.js](tests/onboarding-tier.test.js) |
| Tour Builder (no-code playground) | [pages/tour-builder.html](pages/tour-builder.html) `→ /tour-builder` | Live | Point-and-click editor over a demo storefront: pick avatar, add stops, preview the real tour, export curriculum + Shopify snippets. Also ships **Templates** — ready-made tours (Sperax's DeFi protocol tour is the first) that load straight into the editor. Logic: [public/tour-builder/builder.js](public/tour-builder/builder.js), presets: [public/tour-builder/presets/](public/tour-builder/presets). Sperax template doc: [docs/tutorials/sperax-tour.md](docs/tutorials/sperax-tour.md) |
@@ -126,7 +126,7 @@ bottom.
| Choreographer | [pages/choreograph.html](pages/choreograph.html) + [src/choreograph-page.js](src/choreograph-page.js), engine [src/runtime/choreography.js](src/runtime/choreography.js) | Live at `/choreograph` | Timeline for composing gesture slots into named, timed routines, previewed on the shared live-preview engine with crossfades and a scrubbable playhead. One dependency-free module defines the routine format, the URL wire format and the timing engine; the studio, `PUT /api/agents/:id/animations` (stored at `meta.choreographies`), the public manifest and `AgentAvatar.playChoreography` all import it, and `<agent-3d>.playRoutine('welcome')` performs one from any embed. Also published as `@three-ws/avatar/runtime/choreography.js` · see [docs/choreography.md](docs/choreography.md) |
| Character Library | [pages/character-library.html](pages/character-library.html) + [src/character-library.js](src/character-library.js) (search/sort/link logic in [src/shared/character-library-view.js](src/shared/character-library-view.js), covered by [tests/character-library-view.test.js](tests/character-library-view.test.js)) → `/character-library`, API [api/avatars/library.js](api/avatars/library.js) | Live at `/character-library` | Professionally rigged Mixamo characters (skinned GLB + thumbnails on R2, `avatars/mixamo/`), each drives the full animation library. The live count comes from the R2 manifest and renders in the hero; no page copy hard-codes it. Pipeline: [scripts/fetch-mixamo-avatars.mjs](scripts/fetch-mixamo-avatars.mjs) → [scripts/convert-mixamo-avatars.mjs](scripts/convert-mixamo-avatars.mjs) → [scripts/fetch-mixamo-avatar-thumbnails.mjs](scripts/fetch-mixamo-avatar-thumbnails.mjs) → [scripts/build-mixamo-avatar-library.mjs](scripts/build-mixamo-avatar-library.mjs) publishes `avatars/library/manifest.json`. Cards deep-link into the 3D viewer (`/app#model=`), Widget Studio (`/studio?model=`), and Animation Studio (`/pose?src=`). Mirrors the animation-library R2-manifest pattern (no DB). See [public/avatars/mixamo/README.md](public/avatars/mixamo/README.md) |
| Object Library | [pages/objects.html](pages/objects.html) + [src/objects-library.js](src/objects-library.js) → `/objects`, API [api/objects/library.js](api/objects/library.js) | Live at `/objects` | Hundreds of CC0 (public-domain) 3D props from Poly Haven (packed to GLB on R2, `objects/polyhaven/`). Pipeline: [scripts/fetch-polyhaven-objects.mjs](scripts/fetch-polyhaven-objects.mjs) (glTF→GLB via @gltf-transform) → [scripts/render-glb-thumbnails.mjs](scripts/render-glb-thumbnails.mjs) → [scripts/build-object-library.mjs](scripts/build-object-library.mjs) publishes `objects/library/manifest.json`. Same R2-manifest pattern as the Character/animation libraries (no DB). Cards preview in the 3D viewer (`/app#model=`), place into AR Studio (`/ar/studio?src=`), and download the GLB directly (CC0). AR Studio's tray also has an Objects tab over the same manifest. |
-| Agent-Forged Gallery | [pages/forged.html](pages/forged.html) + [src/forged-gallery.js](src/forged-gallery.js) → `/forged`, API [api/forged.js](api/forged.js), writer [api/_lib/x402/pipelines/forge-content.js](api/_lib/x402/pipelines/forge-content.js) | Live at `/forged` | 3D props BOUGHT by the autonomous x402 agents with real USDC: the hourly forge-content pipeline pays `/api/x402/forge` (draft tier), the generated GLB lands in `forge_autonomous_props` with payment provenance (payer wallet, price, Solana settlement signature), and `/forged` renders each prop with its on-chain receipt linked to Solscan. Honest feed: no synthetic entries; before the first paid generation the page shows its designed empty state. Category chips (crate/barrel/furniture/terrain), prompt search, newest/priciest/most-novel sorts. |
+| Agent-Forged Gallery | [pages/forged.html](pages/forged.html) + [src/forged-gallery.js](src/forged-gallery.js) → `/forged`, API [api/forged.js](api/forged.js), writer [api/_lib/x402/pipelines/forge-content.js](api/_lib/x402/pipelines/forge-content.js) | Live at `/forged` | 3D props BOUGHT by the autonomous x402 agents with real USDC: the hourly forge-content pipeline pays `/api/x402/forge` (draft tier), the generated GLB lands in `forge_autonomous_props` with payment provenance (payer wallet, price, Solana settlement signature), and `/forged` renders each prop with its on-chain receipt linked to Solscan. Honest feed: no synthetic entries; before the first paid generation the page shows its designed empty state. Category chips built from the eight families in [api/_lib/x402/pipelines/forge-catalog.js](api/_lib/x402/pipelines/forge-catalog.js) (club-decor, ar-object, diorama-set, avatar-item, vehicle, container, furniture, terrain), prompt search, newest/priciest/most-novel sorts. |
| Motion Swap (avatar body-swap in video) | [pages/motion-swap.html](pages/motion-swap.html) `→ /motion-swap` + [src/motion-swap.js](src/motion-swap.js), API [api/motion-swap.js](api/motion-swap.js), worker [workers/model-video2motion/](workers/model-video2motion) | Live | Upload a video of one person, get it back with a 3D avatar performing their motion. The worker (CPU Cloud Run, MediaPipe pose + hands + multiclass person segmentation, all Apache-2.0) tracks 33 body world landmarks plus 21 per hand each frame, solves them onto the canonical Wolf3D skeleton, body and all 30 finger bones, with an in-house bend-plane IK solver ([pose_solver.py](workers/model-video2motion/pose_solver.py), pure NumPy, unit-tested), and emits a standard `AnimationClip.toJSON()` + person-mask video + per-frame screen anchors. The browser composites in one WebGL scene: footage on a shader quad with the subject pixelated under the mask, avatar retargeted via [src/animation-retarget.js](src/animation-retarget.js) and pinned to the subject's anchor each frame, MediaRecorder export with original audio. Provider mode `video2motion` (`GCP_VIDEO2MOTION_URL`) in [api/_providers/gcp.js](api/_providers/gcp.js). Docs: [docs/motion-swap.md](docs/motion-swap.md). Tests: [test_pose_solver.py](workers/model-video2motion/test_pose_solver.py) (solver) and [test_service.py](workers/model-video2motion/test_service.py) (HTTP contract, ffmpeg normalize/mask encode, SSRF guard, live MediaPipe pass). |
| Sign Language (feature home) | [pages/sign-language.html](pages/sign-language.html) `→ /sign-language` + [src/sign-language-page.js](src/sign-language-page.js) | Live | The front door for signing avatars: a live avatar signing on arrival (PoseStage + [src/sign-speech.js](src/sign-speech.js) SignSpeaker, portrait-framed), an input that signs or spells anything you type (reporting which words were which), a playable vocabulary of every word with a real sign, and an embedded webcam sign-recognition demo. Controls for signing speed, left- vs right-handed signing, and which avatar signs: [src/sign-avatars.js](src/sign-avatars.js) owns the shared rig list, the one preference block every signing surface reads, and the Avatar pill group whose third pill opens the avatar gallery, so any avatar you own (or any public one) signs with the same vocabulary; a rig with no usable skeleton is rejected with a named message and the working rig is remounted. Verified in a real browser by `npm run verify:sign-avatar` ([scripts/verify-sign-avatar.mjs](scripts/verify-sign-avatar.mjs)). Engines: [src/sign-rig.js](src/sign-rig.js) (skeleton measured from the bind pose → forward kinematics, two-bone arm IK, and hand geometry, so a sign is authored as a place in signing space or as CONTACT, "fingertips on the palm", never as joint angles), [src/sign-handshapes.js](src/sign-handshapes.js) (A, Z, 0, 9, and the named shapes), [src/sign-clip.js](src/sign-clip.js) (resting signer, phase poser, non-manual face markers, eased timeline → clip JSON), [src/sign-dictionary.js](src/sign-dictionary.js) (the lexical vocabulary, one- and two-handed), [src/fingerspelling.js](src/fingerspelling.js) (the manual alphabet), [src/sign-speech.js](src/sign-speech.js) (text→one signing clip: hands rise once and lower once, signs where they exist and spelling for the rest), [src/sign-input.js](src/sign-input.js) (browser Holistic landmarks → text). Face markers ride a morph-target lane through [src/animation-retarget.js](src/animation-retarget.js), re-pointed at whichever meshes the target avatar owns. Tools: `npm run sign:sheet` (contact sheet of every sign, [scripts/sign-contact-sheet.mjs](scripts/sign-contact-sheet.mjs)), `npm run build:sign-goldens` (positional snapshot). Docs: [docs/sign-language.md](docs/sign-language.md). Tests: `tests/{sign-rig,sign-dictionary,sign-linguistics,sign-goldens,fingerspelling,sign-speech,sign-input}.test.js`. |
| ASL alphabet (learn + practice) | [pages/asl-alphabet.html](pages/asl-alphabet.html) `→ /asl-alphabet` + [src/asl-alphabet-page.js](src/asl-alphabet-page.js), letter notes [src/asl-alphabet-data.js](src/asl-alphabet-data.js) | Live | The manual alphabet as a reference you can turn around: every letter A-Z and digit 0-9 formed on a live portrait-framed rig ([src/fingerspelling.js](src/fingerspelling.js) via PoseStage), each with a written handshape description and the letters it is confused with (F/9, M/N, K/V, G/Q). A single letter holds its final frame (`playOnce({ settleTo: null })`) so it can be orbited; a word settles like a signer finishing. Typing any letter key signs it. Spelling a word lights each key in step with the hand, driven by the `marks` schedule the clip builder emits rather than a parallel timer. A practice drill spells a random letter or word and checks what you type, keeping a streak in localStorage. Shares speed / dominant-hand / avatar preferences with [/sign-language](pages/sign-language.html) under one key via [src/sign-avatars.js](src/sign-avatars.js), including a custom avatar picked from the gallery on either page. Deep links `?letter=W`, `?spell=HELLO`. Docs: [docs/sign-language.md](docs/sign-language.md). |
diff --git a/chat/README.md b/chat/README.md
index 4aa681aa1..752af8fa9 100644
--- a/chat/README.md
+++ b/chat/README.md
@@ -29,6 +29,32 @@ This directory is covered by [LICENSE](LICENSE) (proprietary, copyright 2026 nir
Pasted `.glb` links auto-render too, proxied through `/api/glb?src=` when the host lacks CORS.
- **Conversations** live entirely in the browser (localStorage), with optional
end-to-end-encrypted sync through the Go server in [sync/](sync).
+- **Sign-in** ([src/three-ui/pages/AuthPage.svelte](src/three-ui/pages/AuthPage.svelte),
+ hash routes `#signin` / `#signup`): wallet sign-in over SIWE/SIWS
+ ([src/walletAuth.js](src/walletAuth.js)) or email and password against the platform's
+ own `/api/auth/login` and `/api/auth/register`
+ ([src/passwordAuth.js](src/passwordAuth.js)). All four paths set the same cookie
+ session the rest of three.ws reads, so a chat sign-in is a platform sign-in.
+ Registration sends the server-enforced Terms clickwrap; without it the API refuses to
+ create the account, so the submit button stays disabled until the box is checked.
+
+## Routes
+
+This app is the chat, and only the chat. Everything marketing (pricing, blog, updates,
+docs, use cases, security, events, per-solution landing pages) is published for real at
+the site root and reached through the top nav's `CHAT_SITE_LINKS`, never re-implemented
+here. The hash routes that used to render in-app copies of those pages now resolve to
+the live page that owns each topic and replace the location
+([src/three-ui/site-routes.js](src/three-ui/site-routes.js), covered by
+[../tests/chat-app-core.test.js](../tests/chat-app-core.test.js)), so an old
+`/chat#pricing` link still lands somewhere true.
+
+| Hash route | Renders |
+|---|---|
+| `#chat` (default) | The conversation surface |
+| `#signin`, `#signup` | Wallet or email sign-in |
+| `#dashboard/revenue` | Agent earnings and withdrawals (`/api/billing/*`, signed in) |
+| `#pricing`, `#resources/*`, `#features/*`, `#solutions/*`, `#business/*`, `#events/*` | Redirect to the real site page |
## Local development
@@ -53,8 +79,18 @@ The dev server ([vite.config.js](vite.config.js)) does three things for you:
- Aliases `$src` to [src/](src) and `$shared` to `../src/shared` (the app imports the
platform's `portable-wallet.js` from there: one repo, one wallet truth).
-`npm run format` / `format:check` run Prettier. There is no test suite inside `chat/`;
-platform tests live in the repo root (`npm test`).
+`npm run format` / `format:check` run Prettier. Note that `format:check` currently
+reports pre-existing style drift across most of the tree; it is not a gate.
+
+Tests live in the repo root and run with the platform suite (`npm test`, or
+`npx vitest run tests/chat-app-core.test.js` for just this app). They cover the pure
+core paths underneath the Svelte UI: model selection and provider headers
+([src/providers.js](src/providers.js)), the tool-call argument codec
+([src/util.js](src/util.js)), the fund-moving-tool gate that decides which wallet calls
+are preflighted through GuardChain ([src/guard.js](src/guard.js)), credential auth
+([src/passwordAuth.js](src/passwordAuth.js)), and the retired-route resolver
+([src/three-ui/site-routes.js](src/three-ui/site-routes.js)), including an assertion
+that every route it redirects to is a page `data/pages.json` actually declares.
## How production builds it
@@ -94,8 +130,9 @@ Everything below is a real `api/` handler in the repo root, reached same-origin:
- **Chat**: `/api/chat/models`, `/api/chat/config`, `/api/chat/proxy` (free lane with
moderation and model failover), `/api/chat-skills`, `/api/tts/google` (voice).
-- **Auth and identity**: `/api/auth/me`, `/api/csrf-token` (cookie session shared with
- the rest of three.ws).
+- **Auth and identity**: `/api/auth/login`, `/api/auth/register`, `/api/auth/me`,
+ `/api/auth/logout`, the SIWE/SIWS nonce and verify pairs, `/api/csrf-token` (cookie
+ session shared with the rest of three.ws).
- **Forge and 3D**: `/api/forge` (create, poll, rig), `/api/avatars/from-forge`,
`/api/glb` (CORS proxy), `/api/nft/resolve`.
- **Agents and marketplace**: `/api/agents/*`, `/api/marketplace/agents`,
diff --git a/chat/src/AgentPicker.svelte b/chat/src/AgentPicker.svelte
index e8005fea9..b33131f94 100644
--- a/chat/src/AgentPicker.svelte
+++ b/chat/src/AgentPicker.svelte
@@ -315,7 +315,7 @@
>
<option value="popular">Popular</option>
<option value="recent">Recent</option>
- <option value="name">A–Z</option>
+ <option value="name">A-Z</option>
</select>
</div>
</div>
@@ -324,7 +324,7 @@
<p class="text-center text-[12px] text-slate-400 py-3">{$t('loading')}</p>
{:else if marketError}
<p class="text-[12px] text-slate-400 py-2">
- Failed to load — <button class="underline" on:click={() => searchMarket(query, true)}>retry</button>
+ Failed to load. <button class="underline" on:click={() => searchMarket(query, true)}>retry</button>
</p>
{:else if marketAgents.length === 0}
<p class="text-[12px] text-slate-400 py-2">{$t('noAgentsFound')}</p>
diff --git a/chat/src/AgentSettingsModal.svelte b/chat/src/AgentSettingsModal.svelte
index 534c54a7f..2a1441696 100644
--- a/chat/src/AgentSettingsModal.svelte
+++ b/chat/src/AgentSettingsModal.svelte
@@ -52,7 +52,7 @@
<Modal bind:open>
<div class="flex flex-col gap-4 p-4 w-[480px] max-w-full">
- <h2 class="text-[15px] font-semibold text-slate-800">Agent Settings — {$activeAgent?.name}</h2>
+ <h2 class="text-[15px] font-semibold text-slate-800">Agent Settings: {$activeAgent?.name}</h2>
<label class="flex flex-col gap-1.5 text-[12px] font-medium text-slate-600">
System Prompt
diff --git a/chat/src/AgentWallet.svelte b/chat/src/AgentWallet.svelte
index f2fd61d20..77afe7fb4 100644
--- a/chat/src/AgentWallet.svelte
+++ b/chat/src/AgentWallet.svelte
@@ -1,5 +1,5 @@
<script>
- // The wallet identity of the agent you're chatting with — tip it for a good
+ // The wallet identity of the agent you're chatting with. Tip it for a good
// answer, copy its address, or open its full wallet on three.ws. Thin Svelte
// wrapper over the shared portable wallet (one module, mounted everywhere the
// avatar appears) so the chat never forks the wallet logic. Reads only public
diff --git a/chat/src/App.svelte b/chat/src/App.svelte
index 5c278cc2c..37e22846d 100644
--- a/chat/src/App.svelte
+++ b/chat/src/App.svelte
@@ -28,11 +28,7 @@
import Notifications from './Notifications.svelte';
import TxApprovalModal from './TxApprovalModal.svelte';
import AuthPage from './three-ui/pages/AuthPage.svelte';
- import Pricing from './three-ui/pages/Pricing.svelte';
- import MarketingPage from './three-ui/pages/MarketingPage.svelte';
- import ResourcePage from './three-ui/pages/ResourcePage.svelte';
- import FeaturePage from './three-ui/pages/FeaturePage.svelte';
- import EventsPage from './three-ui/pages/EventsPage.svelte';
+ import { siteRouteFor } from './three-ui/site-routes.js';
import SettingsModal from './SettingsModal.svelte';
import ToolcallButton from './ToolcallButton.svelte';
import MessageContent from './MessageContent.svelte';
@@ -91,6 +87,15 @@
})
);
+ // The chat app's own marketing pages were removed; every surface they
+ // covered is published for real at the site root. Old links still resolve:
+ // the hash is mapped to the live page and the location is replaced, so the
+ // dead route never occupies a history entry.
+ $: {
+ const retired = siteRouteFor($route);
+ if (retired) window.location.replace(retired);
+ }
+
const convoId = persisted('convoId');
let convos = {};
@@ -777,7 +782,7 @@
}
if (tool_call.function.arguments != null) {
// Most providers stream arguments as JSON-string fragments we concatenate.
- // Some (e.g. GPT OSS 120B) send the fully-formed arguments object in one chunk —
+ // Some (e.g. GPT OSS 120B) send the fully-formed arguments object in one chunk,
// concatenating that with += would coerce it to the literal "[object Object]"
// and break the JSON.parse below. Stringify non-string deltas first.
const delta = tool_call.function.arguments;
@@ -1052,12 +1057,6 @@
cleanShareLink();
activeToolcall = null;
- // if (convo.messages.length === 0) {
- // historyOpen = false;
- // inputTextareaEl.focus();
- // return;
- // }
-
const existingNewConvo = Object.values(convos).find((convo) => convo.messages.length === 0);
if (existingNewConvo) {
const oldModels = convo.models;
@@ -1066,7 +1065,7 @@
convo.models = oldModels;
historyOpen = false;
- inputTextareaEl.focus();
+ inputTextareaEl?.focus();
return;
}
@@ -1105,7 +1104,7 @@
historyOpen = false;
if (innerWidth > 880) {
- inputTextareaEl.focus();
+ inputTextareaEl?.focus();
}
}
@@ -2334,41 +2333,23 @@
/>
{/if}
-{#if $route === 'pricing'}
- <div class="min-h-dvh bg-paper">
- <div class="sticky top-0 z-[110]"><TopNav /></div>
- <Pricing />
+{#if siteRouteFor($route)}
+ <!-- A retired marketing hash. The reactive block above is already replacing
+ the location; this holds the frame until the browser navigates so the
+ chat UI never flashes behind the redirect. -->
+ <div class="flex min-h-dvh items-center justify-center bg-paper">
+ <p class="text-sm text-ink-soft">Opening {siteRouteFor($route)}…</p>
</div>
{:else if $route === 'signin' || $route === 'signup'}
<div class="min-h-dvh bg-paper">
<div class="sticky top-0 z-[110]"><TopNav /></div>
<AuthPage kind={$route} />
</div>
-{:else if $route.startsWith('solutions/') || $route.startsWith('business/')}
- <div class="min-h-dvh bg-paper">
- <div class="sticky top-0 z-[110]"><TopNav /></div>
- <MarketingPage slug={$route} />
- </div>
-{:else if $route.startsWith('events/')}
- <div class="min-h-dvh bg-paper overflow-y-auto">
- <div class="sticky top-0 z-[110]"><TopNav /></div>
- <EventsPage slug={$route} />
- </div>
-{:else if $route.startsWith('resources/')}
- <div class="min-h-dvh bg-paper">
- <div class="sticky top-0 z-[110]"><TopNav /></div>
- <ResourcePage slug={$route.slice('resources/'.length)} />
- </div>
{:else if $route === 'dashboard/revenue'}
<div class="min-h-dvh bg-paper">
<div class="sticky top-0 z-[110]"><TopNav /></div>
<RevenueDashboard />
</div>
-{:else if $route.startsWith('features/')}
- <div class="min-h-dvh bg-paper overflow-y-auto">
- <div class="sticky top-0 z-[110]"><TopNav /></div>
- <FeaturePage slug={$route.slice('features/'.length)} />
- </div>
{:else}
<main class="flex h-dvh w-screen flex-col">
<div class="sticky top-0 z-[110]">
@@ -2851,7 +2832,7 @@
</button>
{/if}
{#if effectiveAgentId}
- <!-- The agent's wallet identity — tip it for a good answer. -->
+ <!-- The agent's wallet identity. Tip it for a good answer. -->
<AgentWallet agentId={effectiveAgentId} />
{/if}
</div>
@@ -3188,7 +3169,7 @@
<div class="h-footer-inner">
<div class="h-footer-brand-col">
<div class="h-footer-brand">
- <img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" />
+ <img class="wordmark-logo" src="{import.meta.env.BASE_URL}three.svg" alt="" aria-hidden="true" />
<span class="wordmark-dot" aria-hidden="true"></span>
<span>three.ws</span>
</div>
diff --git a/chat/src/CompanyLogo.svelte b/chat/src/CompanyLogo.svelte
index bcf270312..f3cc244b1 100644
--- a/chat/src/CompanyLogo.svelte
+++ b/chat/src/CompanyLogo.svelte
@@ -5,7 +5,7 @@
export let model;
export let size = 'h-7 w-7';
export let rounded = null;
- /** Live-animated walking avatar. Set false for dense lists (dropdown rows) — uses still frame. */
+ /** Live-animated walking avatar. Set false for dense lists (dropdown rows), which uses a still frame. */
export let live = true;
// Remember to update hasCompanyLogo from convo.js when adding new logos.
diff --git a/chat/src/KnowledgeBasePanel.svelte b/chat/src/KnowledgeBasePanel.svelte
index da71f92ad..601bb72aa 100644
--- a/chat/src/KnowledgeBasePanel.svelte
+++ b/chat/src/KnowledgeBasePanel.svelte
@@ -77,7 +77,7 @@
<div class="text-[12px] text-slate-500">
{uploadProgress.stage === 'done'
? 'Saved!'
- : `${uploadProgress.stage} — ${uploadProgress.done}/${uploadProgress.total} chunks…`}
+ : `${uploadProgress.stage}: ${uploadProgress.done}/${uploadProgress.total} chunks…`}
</div>
{:else}
<label class="cursor-pointer rounded-lg border border-dashed border-slate-300 px-4 py-3 text-center text-[12px] text-slate-500 hover:border-indigo-400 hover:text-indigo-500 transition">
diff --git a/chat/src/Message.svelte b/chat/src/Message.svelte
index 08f7d19fb..ebf1e4dc1 100644
--- a/chat/src/Message.svelte
+++ b/chat/src/Message.svelte
@@ -57,7 +57,7 @@
// Walk the avatar down from the previous message's slot into this one. The slot
// stays hidden until the agent's GLB is ready, then it appears at the old
- // position and glides to its resting spot while the walk clip plays — so the
+ // position and glides to its resting spot while the walk clip plays, so the
// agent looks like it strolled to the new message rather than teleporting.
function walkAgentIntoPlace(slot, el) {
if (!slot || !el) return;
diff --git a/chat/src/PayWalletPicker.svelte b/chat/src/PayWalletPicker.svelte
index b33219487..6d26f3477 100644
--- a/chat/src/PayWalletPicker.svelte
+++ b/chat/src/PayWalletPicker.svelte
@@ -18,7 +18,7 @@
$: selectedAgent = agentsWithWallet.find((a) => a.id === $payAgentId) || null;
function fmtUsdc(v) {
- if (v == null || Number.isNaN(Number(v))) return '— USDC';
+ if (v == null || Number.isNaN(Number(v))) return '- USDC';
return Number(v).toFixed(3) + ' USDC';
}
function shortAddr(a) {
@@ -36,7 +36,7 @@
demoWallet = await r.json();
if (demoWallet?.configured === false) {
// A wallet that simply isn't set up is a neutral state, not an
- // error — only misconfiguration and fetch failures go red.
+ // error: only misconfiguration and fetch failures go red.
if (demoWallet.code === 'wallet_unconfigured') {
demoUnconfigured = true;
} else {
@@ -114,7 +114,7 @@
loadDemoWallet();
}
function selectAgent(a) {
- if (!a.solana_address) return; // No wallet — handled via separate flow
+ if (!a.solana_address) return; // No wallet, handled via separate flow
$payAgentId = a.id;
open = false;
}
@@ -124,7 +124,7 @@
}
function onSettled() {
- // A paid tool call just settled — refresh balances so the pill ticks down.
+ // A paid tool call just settled, so refresh balances so the pill ticks down.
refreshAll();
}
@@ -209,7 +209,7 @@
{:else if demoError}
<span class="text-red-600">{demoError}</span>
{:else if demoUnconfigured && signedIn && agentsWithWallet.length > 0}
- not configured — pick one of your agent wallets below
+ not configured. Pick one of your agent wallets below
{:else}
not configured
{/if}
diff --git a/chat/src/SettingsModal.svelte b/chat/src/SettingsModal.svelte
index 2ce6bcdcf..104abcfcc 100644
--- a/chat/src/SettingsModal.svelte
+++ b/chat/src/SettingsModal.svelte
@@ -101,7 +101,7 @@
}
}
- // Avatar selector — pulls user's avatars (session auth) + featured public avatars
+ // Avatar selector: pulls user's avatars (session auth) + featured public avatars
let myAvatars = [];
let featuredAvatars = [];
let avatarsLoading = false;
@@ -175,7 +175,7 @@
let elRefreshToolSchema;
- // Draft values for API keys — nothing commits until Save is clicked
+ // Draft values for API keys: nothing commits until Save is clicked
let draftKeys = {
openrouter: $openrouterAPIKey,
anthropic: $anthropicAPIKey,
@@ -358,7 +358,7 @@
<span>Enable local model providers</span>
<span class="text-[11px] text-slate-500">
Probe Ollama (localhost:11434) and the local tool server (localhost:8081) on load.
- Leave off if you don't run these locally — otherwise the browser logs connection errors.
+ Leave off if you don't run these locally, otherwise the browser logs connection errors.
</span>
</span>
</label>
@@ -702,7 +702,7 @@
<p class="text-[12px] text-red-500">{brandSaveError}</p>
{/if}
{#if brandSaveOk}
- <p class="text-[12px] text-green-600">Saved — all users will see the updated branding.</p>
+ <p class="text-[12px] text-green-600">Saved. All users will see the updated branding.</p>
{/if}
<button
class="mt-1 rounded-lg bg-indigo-500 px-4 py-2 text-[13px] font-medium text-white hover:bg-indigo-600 disabled:opacity-50"
diff --git a/chat/src/SkillsMarketplaceModal.svelte b/chat/src/SkillsMarketplaceModal.svelte
index 00060add5..607457118 100644
--- a/chat/src/SkillsMarketplaceModal.svelte
+++ b/chat/src/SkillsMarketplaceModal.svelte
@@ -61,7 +61,7 @@
}
/**
- * Install a Local skill into the chat. No HTTP round-trip — local skills
+ * Install a Local skill into the chat. No HTTP round-trip: local skills
* are not stored in the marketplace DB; they live on disk (SKILL.md packs)
* or in-code (AgentSkills). Install just mutates the two client stores:
* - knowledgeSkills: full SKILL.md body injected into the system prompt
@@ -550,7 +550,7 @@
category: p.meta?.category || '',
manifestUrl: p.manifest || `${base}/${p.identifier}.json`,
}));
- // No upfront HEAD probe — surfacing 100+ 404s in the console on
+ // No upfront HEAD probe: surfacing 100+ 404s in the console on
// every Library open isn't worth filtering broken entries early.
// Install-time fetch (installLibraryPlugin) reports the real failure.
} else {
@@ -1177,7 +1177,7 @@
{/if}
</button>
{#if libraryFailed[plugin.identifier]}
- <span class="text-[10px] text-red-500">Install failed — retry?</span>
+ <span class="text-[10px] text-red-500">Install failed. Retry?</span>
{/if}
</div>
</div>
diff --git a/chat/src/convo.js b/chat/src/convo.js
index 94c71ccbd..6fac9d777 100644
--- a/chat/src/convo.js
+++ b/chat/src/convo.js
@@ -72,7 +72,7 @@ export async function complete(convo, onupdate, onabort) {
}
// Drop a trailing unclosed, empty assistant message so we never submit a
- // dangling turn — applies across every provider, Anthropic included.
+ // dangling turn, and it applies across every provider, Anthropic included.
if (
convo.messages[convo.messages.length - 1].unclosed &&
convo.messages[convo.messages.length - 1].content === ''
diff --git a/chat/src/knowledge.js b/chat/src/knowledge.js
index 8665ca128..0729888bf 100644
--- a/chat/src/knowledge.js
+++ b/chat/src/knowledge.js
@@ -13,7 +13,7 @@ export function chunkText(text, chunkSize = 500, overlap = 50) {
export async function embedTexts(texts) {
const apiKey = get(openaiAPIKey);
- if (!apiKey) throw new Error('No OpenAI API key set — add it in Settings.');
+ if (!apiKey) throw new Error('No OpenAI API key set. Add it in Settings.');
const res = await fetch('https://api.openai.com/v1/embeddings', {
method: 'POST',
headers: {
diff --git a/chat/src/locales/en.json b/chat/src/locales/en.json
index 4a3f64bf4..646a44664 100644
--- a/chat/src/locales/en.json
+++ b/chat/src/locales/en.json
@@ -30,5 +30,5 @@
"cancel": "Cancel",
"install": "Install",
"installed": "Installed",
- "showingOf": "Showing {shown} of {total} — search to filter"
+ "showingOf": "Showing {shown} of {total}, search to filter"
}
diff --git a/chat/src/locales/zh-CN.json b/chat/src/locales/zh-CN.json
index 5841919d7..8dab92e2b 100644
--- a/chat/src/locales/zh-CN.json
+++ b/chat/src/locales/zh-CN.json
@@ -30,5 +30,5 @@
"cancel": "取消",
"install": "安装",
"installed": "已安装",
- "showingOf": "显示 {shown} / {total} — 搜索筛选"
+ "showingOf": "显示 {shown} / {total},搜索筛选"
}
diff --git a/chat/src/passwordAuth.js b/chat/src/passwordAuth.js
new file mode 100644
index 000000000..e3d3530a2
--- /dev/null
+++ b/chat/src/passwordAuth.js
@@ -0,0 +1,67 @@
+// Email/password sign-in and registration against the platform's own auth API.
+//
+// Same-origin, cookie-session based: /api/auth/login and /api/auth/register set
+// the session cookie the rest of three.ws already reads, so a chat sign-in is a
+// platform sign-in. Neither endpoint takes a CSRF token (there is no session to
+// bind one to yet); the CSRF-protected endpoints are the ones that run against
+// an established session.
+
+/**
+ * Turn an auth-API response into a message a person can act on.
+ *
+ * The API answers with `{ error, error_description }`; the codes that matter to
+ * these two forms get a sentence of their own so the form does not surface a
+ * bare code like `tos_required`.
+ *
+ * @param {number} status
+ * @param {{ error?: string, error_description?: string }} body
+ * @returns {string}
+ */
+export function authErrorMessage(status, body) {
+ const code = body?.error;
+ if (code === 'invalid_credentials') return 'That email or password is not right.';
+ if (code === 'conflict') return 'An account with that email already exists. Sign in instead.';
+ if (code === 'tos_required') return 'You have to accept the Terms of Service to create an account.';
+ if (code === 'validation_error' || status === 400) {
+ return body?.error_description || 'Check the details you entered and try again.';
+ }
+ if (status === 429) return 'Too many attempts. Wait a minute and try again.';
+ if (status >= 500) return 'Sign-in is unavailable right now. Try again in a moment.';
+ return body?.error_description || `Sign-in failed (${status}).`;
+}
+
+async function postAuth(path, payload) {
+ const res = await fetch(path, {
+ method: 'POST',
+ credentials: 'include',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify(payload),
+ });
+ const body = await res.json().catch(() => ({}));
+ if (!res.ok) throw new Error(authErrorMessage(res.status, body));
+ return body.user || null;
+}
+
+/**
+ * Sign in with an email address (or username) and password.
+ * @param {{ email: string, password: string }} credentials
+ * @returns {Promise<object|null>} the signed-in user
+ */
+export function signInWithPassword({ email, password }) {
+ return postAuth('/api/auth/login', { email: email.trim(), password });
+}
+
+/**
+ * Create an account. The Terms checkbox is a server-enforced clickwrap: the
+ * request is refused outright without it, so it is sent explicitly rather than
+ * assumed.
+ *
+ * @param {{ email: string, password: string, displayName?: string, tosAccepted: boolean }} details
+ * @returns {Promise<object|null>} the newly created user
+ */
+export function registerWithPassword({ email, password, displayName, tosAccepted }) {
+ const payload = { email: email.trim(), password, tosAccepted: tosAccepted === true };
+ const name = displayName?.trim();
+ if (name) payload.display_name = name;
+ return postAuth('/api/auth/register', payload);
+}
diff --git a/chat/src/providers.js b/chat/src/providers.js
index dc2b3e0be..ba8bd72fc 100644
--- a/chat/src/providers.js
+++ b/chat/src/providers.js
@@ -9,7 +9,7 @@ import {
localProvidersEnabled,
} from './stores.js';
-// First-paint seed ONLY — the real list comes from /api/chat/models, which
+// First-paint seed ONLY. The real list comes from /api/chat/models, which
// returns what OpenRouter is serving right now, ranked best-first.
//
// Do not treat these ids as durable. OpenRouter retires `:free` endpoints with
@@ -30,7 +30,7 @@ export const BUILTIN_MODELS = [
*
* Order: the configured default when it is actually available, else the first
* model the server says is live, else the local seed. The middle rung is the
- * one that matters — it is what keeps chat working through a model retirement
+ * one that matters: it is what keeps chat working through a model retirement
* without a redeploy.
*/
export function resolveDefaultModel(available, configuredId) {
@@ -302,7 +302,7 @@ export async function fetchModels({ onFinally }) {
.catch((err) => {
if (provider.isLocal) {
console.debug(
- `[${provider.name}] not detected at ${provider.url} — start the local service if you want it.`
+ `[${provider.name}] not detected at ${provider.url}. Start the local service if you want it.`
);
} else {
console.debug('Error fetching models from provider', provider.name, err);
@@ -312,7 +312,7 @@ export async function fetchModels({ onFinally }) {
});
const [serverModels, ...providerResults] = await Promise.all([serverModelsPromise, ...promises]);
- // User's own provider keys take precedence — deduplicate by id.
+ // User's own provider keys take precedence, so deduplicate by id.
const userModels = providerResults.flat();
const userModelIds = new Set(userModels.map((m) => m.id));
const externalModels = [...userModels, ...serverModels.filter((m) => !userModelIds.has(m.id))];
diff --git a/chat/src/sentiment.js b/chat/src/sentiment.js
index b9af226b6..9729f7494 100644
--- a/chat/src/sentiment.js
+++ b/chat/src/sentiment.js
@@ -2,7 +2,7 @@
// Emotion vocabulary: 'celebration' | 'concern' | 'curiosity' | 'empathy' | 'patience'
//
// Returns { emotion, weight } or null if nothing reads strongly enough.
-// Keyword lists are deliberately small and high-precision — false positives
+// Keyword lists are deliberately small and high-precision: false positives
// look worse than no reaction.
const PATTERNS = {
diff --git a/chat/src/stores.js b/chat/src/stores.js
index afd146e2c..d13f2b2fa 100644
--- a/chat/src/stores.js
+++ b/chat/src/stores.js
@@ -85,7 +85,7 @@ export const pluginLibraryUrl = persisted('pluginLibraryUrl', 'https://ai-agent-
// reply, the sidebar logo, and the Settings avatar picker all read this one.
export const talkingHeadAvatarUrl = persisted('talkingHeadAvatarUrl', '');
-// True while the assistant is generating a response — drives the chat avatar
+// True while the assistant is generating a response. Drives the chat avatar
// walk animation so the agent visibly "moves with the chat".
export const generating = writable(false);
@@ -107,7 +107,6 @@ export const websiteCategory = writable(null);
export const composerFill = writable(null);
export const flowSecondary = persisted('flowSecondary', {});
export const appPlatforms = writable(new Set(['macOS']));
-export const designModel = writable('gpt-image-2');
export const notifications = writable([]);
diff --git a/chat/src/svelte-marked/markdown/components/code/MarkdownCode.svelte b/chat/src/svelte-marked/markdown/components/code/MarkdownCode.svelte
index 4cc49b74c..54ac6f1e6 100644
--- a/chat/src/svelte-marked/markdown/components/code/MarkdownCode.svelte
+++ b/chat/src/svelte-marked/markdown/components/code/MarkdownCode.svelte
@@ -1,6 +1,6 @@
<script lang="ts">
import { flash } from '../../../../actions.js';
- import { feChevronDown, feChevronUp, feCopy, feFile, fePlay } from '../../../../feather.js';
+ import { feChevronDown, feChevronUp, feCopy } from '../../../../feather.js';
import Icon from '../../../../Icon.svelte';
import type { MarkdownOptions, Renderers } from '../../markedConfiguration';
import type { Tokens } from 'marked';
@@ -8,7 +8,9 @@
export let token: Tokens.Code;
export const options: MarkdownOptions = undefined;
export const renderers: Renderers = undefined;
- export let message;
+ // Passed to every renderer by the marked harness; this one renders the same
+ // header for assistant and user code blocks, so it goes unread.
+ export const message = undefined;
let attrs: Record<string, any> = {};
@@ -49,14 +51,6 @@
</span>
{/if}
<div class="ml-auto flex gap-2">
- {#if message && message.role === 'assistant'}
- <button
- class="flex items-center gap-x-1.5 self-start rounded-full bg-gray-200 px-3.5 py-2 text-left text-xs transition-colors hover:bg-gray-300"
- >
- <Icon icon={fePlay} class="h-3 w-3" />
- Apply
- </button>
- {/if}
<button
class="flex items-center gap-x-1.5 self-start rounded-full bg-gray-200 px-3.5 py-2 text-left text-xs transition-colors hover:bg-gray-300"
use:flash
diff --git a/chat/src/sync.js b/chat/src/sync.js
index d6419cccb..4b1b4c2de 100644
--- a/chat/src/sync.js
+++ b/chat/src/sync.js
@@ -19,7 +19,7 @@ let failureWarned = false;
function circuitOpen() {
if (consecutiveFailures < MAX_FAILURES) return false;
if (Date.now() - circuitOpenedAt > COOLDOWN_MS) {
- // Cool-down elapsed — allow one probe to test recovery.
+ // Cool-down elapsed, so allow one probe to test recovery.
consecutiveFailures = 0;
failureWarned = false;
return false;
@@ -28,7 +28,7 @@ function circuitOpen() {
}
async function safePostJson(url, body, fallback) {
- // No address configured (or relative) — skip silently.
+ // No address configured (or relative), so skip silently.
if (!url || typeof url !== 'string' || !/^https?:\/\//i.test(url)) return fallback;
if (circuitOpen()) return fallback;
try {
@@ -55,7 +55,7 @@ async function safePostJson(url, body, fallback) {
}
}
-// Reset the breaker — call after the user changes the sync address so a new host
+// Reset the breaker. Call it after the user changes the sync address so a new host
// gets a fresh attempt instead of inheriting the prior host's failure count.
export function resetSyncCircuit() {
consecutiveFailures = 0;
diff --git a/chat/src/templates.js b/chat/src/templates.js
deleted file mode 100644
index c73d310c7..000000000
--- a/chat/src/templates.js
+++ /dev/null
@@ -1 +0,0 @@
-export const conversationTemplates = {};
diff --git a/chat/src/three-ui/AnnouncementBanner.svelte b/chat/src/three-ui/AnnouncementBanner.svelte
deleted file mode 100644
index 01938d58e..000000000
--- a/chat/src/three-ui/AnnouncementBanner.svelte
+++ /dev/null
@@ -1,24 +0,0 @@
-<script>
- import { persisted } from '../localstorage.js';
- import Icon from '../Icon.svelte';
- import { feArrowRight, feX } from '../feather.js';
-
- const dismissed = persisted('three.wsBannerDismissed_v1', false);
- export let href = '#';
- export let message = 'three.ws is now part of Meta — bringing AI to businesses worldwide';
-</script>
-
-{#if !$dismissed}
- <div class="relative w-full bg-paper-deep text-ink">
- <a {href} class="flex items-center justify-center gap-2 h-10 text-sm font-medium hover:opacity-80">
- <span>{message}</span>
- <Icon icon={feArrowRight} class="h-4 w-4 shrink-0" />
- </a>
- <button
- class="absolute right-3 top-1/2 -translate-y-1/2 p-1 text-ink-soft hover:text-ink"
- on:click={() => ($dismissed = true)}
- aria-label="Dismiss announcement">
- <Icon icon={feX} class="h-4 w-4" />
- </button>
- </div>
-{/if}
diff --git a/chat/src/three-ui/Composer.svelte b/chat/src/three-ui/Composer.svelte
index 488467ea6..4687b5cac 100644
--- a/chat/src/three-ui/Composer.svelte
+++ b/chat/src/three-ui/Composer.svelte
@@ -55,7 +55,9 @@
composerFill.set(null);
const shouldFill = !fill.ifEmpty || !content;
if (shouldFill) {
- content = fill.text;
+ // `append` adds to what is already composed instead of replacing it,
+ // so a flow can layer a hint onto a half-written prompt.
+ content = fill.append && content ? `${content.trimEnd()} ${fill.text}` : fill.text;
tick().then(() => {
autoresizeTextarea();
if (fill.submit) sendMessage();
diff --git a/chat/src/three-ui/DesignModelPicker.svelte b/chat/src/three-ui/DesignModelPicker.svelte
deleted file mode 100644
index cec1c9b79..000000000
--- a/chat/src/three-ui/DesignModelPicker.svelte
+++ /dev/null
@@ -1,50 +0,0 @@
-<script>
- import { createEventDispatcher } from 'svelte';
- import { designModel } from '../stores.js';
- import Icon from '../Icon.svelte';
- import { feCheck } from '../feather.js';
-
- const dispatch = createEventDispatcher();
-
- const models = [
- { id: 'gpt-image-2', label: 'GPT Image 2', badge: '⊕' },
- { id: 'sdxl', label: 'Stable Diffusion XL' },
- { id: 'flux-1', label: 'Flux 1' },
- { id: 'banana', label: 'Banana 🍌' },
- ];
-
- function pick(model) {
- designModel.set(model.id);
- dispatch('close');
- }
-
- function onKey(e) {
- if (e.key === 'Escape') dispatch('close');
- }
-</script>
-
-<svelte:window on:keydown={onKey} />
-
-<button
- class="fixed inset-0 z-20 cursor-default"
- aria-hidden="true"
- tabindex="-1"
- on:click={() => dispatch('close')}
-/>
-
-<div class="absolute bottom-full mb-2 left-0 z-30 bg-white border border-rule rounded-2xl shadow-pop p-2 w-[220px]">
- {#each models as model}
- <button
- class="flex items-center gap-3 w-full px-3 h-10 rounded-lg text-sm font-medium text-ink hover:bg-paper"
- on:click={() => pick(model)}
- >
- <span class="w-5 h-5 shrink-0 flex items-center justify-center text-base leading-none">
- {model.badge ?? ''}
- </span>
- <span class="flex-1 text-left">{model.label}</span>
- {#if $designModel === model.id}
- <Icon icon={feCheck} class="h-3.5 w-3.5 shrink-0 text-blue-600" />
- {/if}
- </button>
- {/each}
-</div>
diff --git a/chat/src/three-ui/TopNav.svelte b/chat/src/three-ui/TopNav.svelte
index 0b87c289b..01838478e 100644
--- a/chat/src/three-ui/TopNav.svelte
+++ b/chat/src/three-ui/TopNav.svelte
@@ -23,7 +23,7 @@
<header class="sticky top-0 z-40 border-b border-rule bg-paper/95 backdrop-blur supports-[backdrop-filter]:bg-paper/80">
<div class="mx-auto flex h-14 max-w-[1240px] items-center justify-between px-4 sm:px-6">
- <!-- LEFT: brand breadcrumb — three.ws (home) / Chat -->
+ <!-- LEFT: brand breadcrumb: three.ws (home) / Chat -->
<div class="flex min-w-0 items-center gap-1.5">
<a
href="/"
@@ -137,7 +137,7 @@
border-radius: 12px;
}
- /* Iris live dot — same signature as the main-site nav's Text → 3D pill. */
+ /* Iris live dot: same signature as the main-site nav's Text → 3D pill. */
.iris-dot {
width: 6px;
height: 6px;
diff --git a/chat/src/three-ui/flows/SlidesFlow.svelte b/chat/src/three-ui/flows/SlidesFlow.svelte
index 47d8e2858..274b40c5a 100644
--- a/chat/src/three-ui/flows/SlidesFlow.svelte
+++ b/chat/src/three-ui/flows/SlidesFlow.svelte
@@ -1,7 +1,7 @@
<script>
import { composerFill } from '../../stores.js';
import Icon from '../../Icon.svelte';
- import { feArrowUpLeft, feLayout, feChevronDown, feUpload } from '../../feather.js';
+ import { feArrowUpLeft, feLayout, feChevronDown } from '../../feather.js';
const samplePrompts = [
'Automate weekly team status reporting',
@@ -10,14 +10,38 @@
'Design investor pitch deck with projections',
];
- const templateCount = 8;
+ // Each template is a real prompt preset: picking one writes its outline into
+ // the composer and sends it, exactly like picking a sample prompt does.
+ const templates = [
+ { name: 'Pitch deck', outline: 'problem, solution, market size, product demo, traction, business model, team, and the ask' },
+ { name: 'Product launch', outline: 'what shipped, who it is for, the before/after, a live demo, pricing, and rollout dates' },
+ { name: 'Quarterly review',outline: 'goals set, results against them, wins, misses with root causes, and next quarter priorities' },
+ { name: 'Sales narrative', outline: 'the customer pain, the cost of the status quo, our approach, proof, and next steps' },
+ { name: 'Technical design', outline: 'context, constraints, the proposed architecture, alternatives considered, risks, and rollout' },
+ { name: 'Team onboarding', outline: 'how the team works, the systems we run, who owns what, and the first-week checklist' },
+ { name: 'Research readout', outline: 'the question, the method, what we found, what surprised us, and what we recommend' },
+ { name: 'Board update', outline: 'headline metrics, progress against plan, the top three risks, and decisions needed' },
+ ];
const slideCountOptions = ['4 - 8', '8 - 12', '12 - 16', '16 - 20'];
let selectedSlideCount = '8 - 12';
let slideCountOpen = false;
+ /** The chosen length is part of every request, so the control actually steers output. */
+ function withSlideCount(text) {
+ return `${text}. Make it ${selectedSlideCount} slides.`;
+ }
+
function selectPrompt(prompt) {
- composerFill.set({ text: prompt, submit: true, ifEmpty: false });
+ composerFill.set({ text: withSlideCount(prompt), submit: true, ifEmpty: false });
+ }
+
+ function selectTemplate(template) {
+ composerFill.set({
+ text: withSlideCount(`Build a ${template.name.toLowerCase()} covering ${template.outline}`),
+ submit: true,
+ ifEmpty: false,
+ });
}
</script>
@@ -26,7 +50,7 @@
<div class="grid grid-cols-2 gap-3 md:grid-cols-4">
{#each samplePrompts as prompt}
<button
- class="bg-white border border-rule rounded-xl p-4 text-left h-[112px] flex flex-col justify-between hover:bg-paper transition-colors"
+ class="bg-white border border-rule rounded-xl p-4 text-left h-[112px] flex flex-col justify-between hover:bg-paper transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ink"
on:click={() => selectPrompt(prompt)}
>
<span class="text-sm text-ink line-clamp-2">{prompt}</span>
@@ -39,7 +63,9 @@
<h2 class="text-sm font-semibold text-ink">Choose a template</h2>
<div class="relative">
<button
- class="bg-white border border-rule rounded-full h-9 px-3 text-sm flex items-center gap-2 hover:bg-paper transition-colors"
+ class="bg-white border border-rule rounded-full h-9 px-3 text-sm flex items-center gap-2 hover:bg-paper transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ink"
+ aria-expanded={slideCountOpen}
+ aria-label="Slide count: {selectedSlideCount}"
on:click={() => (slideCountOpen = !slideCountOpen)}
>
<Icon icon={feLayout} class="w-4 h-4 text-ink-soft" />
@@ -51,6 +77,7 @@
{#each slideCountOptions as option}
<button
class="block w-full px-4 py-2 text-sm text-left text-ink hover:bg-paper first:rounded-t-xl last:rounded-b-xl"
+ aria-current={option === selectedSlideCount ? 'true' : undefined}
on:click={() => { selectedSlideCount = option; slideCountOpen = false; }}
>
{option}
@@ -61,14 +88,14 @@
</div>
</div>
- <div class="grid grid-cols-4 gap-4 pb-8">
- <button class="aspect-[4/3] bg-white border border-rule rounded-xl flex flex-col items-center justify-center gap-2 hover:bg-paper transition-colors">
- <Icon icon={feUpload} class="w-5 h-5 text-ink-soft" />
- <span class="text-xs text-ink-soft">Import template</span>
- </button>
- {#each Array(templateCount) as _, i}
- <button class="aspect-[4/3] bg-paper-deep rounded-xl flex items-center justify-center hover:opacity-80 transition-opacity">
- <span class="text-xs text-ink-soft font-serif text-center px-2">Sample template {i + 1}</span>
+ <div class="grid grid-cols-2 gap-4 pb-8 md:grid-cols-4">
+ {#each templates as template}
+ <button
+ class="aspect-[4/3] bg-paper-deep rounded-xl flex flex-col items-center justify-center gap-1.5 px-2 text-center hover:bg-white hover:border hover:border-rule transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ink"
+ on:click={() => selectTemplate(template)}
+ >
+ <span class="text-sm text-ink font-serif">{template.name}</span>
+ <Icon icon={feArrowUpLeft} class="w-[14px] h-[14px] text-ink-faint" />
</button>
{/each}
</div>
diff --git a/chat/src/three-ui/flows/WebsiteFlow.svelte b/chat/src/three-ui/flows/WebsiteFlow.svelte
index a161027b7..56b55298f 100644
--- a/chat/src/three-ui/flows/WebsiteFlow.svelte
+++ b/chat/src/three-ui/flows/WebsiteFlow.svelte
@@ -9,7 +9,6 @@
feCloud,
feLink,
feArrowUpLeft,
- feFigma,
} from '../../feather.js';
const categories = [
@@ -39,7 +38,22 @@
linkbio: 'Create a link-in-bio page for ',
};
- export let compact = false;
+ let referenceOpen = false;
+ let referenceUrl = '';
+
+ /** Append a site the model should take its cues from to whatever is composed. */
+ function addReference() {
+ const url = referenceUrl.trim();
+ if (!url) return;
+ composerFill.set({
+ text: `Use ${url} as the visual reference. `,
+ submit: false,
+ ifEmpty: false,
+ append: true,
+ });
+ referenceUrl = '';
+ referenceOpen = false;
+ }
function pick(id) {
const isDeselecting = $websiteCategory === id;
@@ -57,19 +71,34 @@
<div class="mt-8 max-w-[760px] mx-auto px-1">
<div class="flex items-center justify-between">
<h3 class="text-sm font-semibold text-ink">What would you like to build?</h3>
- {#if !compact}
- <div class="flex items-center gap-3 text-sm text-ink">
- <button class="inline-flex items-center gap-1.5 hover:underline">
- <Icon icon={feLink} size={14} /> Add website reference
- </button>
- <span class="text-ink-faint">|</span>
- <button class="inline-flex items-center gap-1.5 hover:underline">
- <Icon icon={feFigma} size={14} /> Import from Figma
- </button>
- </div>
- {/if}
+ <button
+ class="inline-flex items-center gap-1.5 text-sm text-ink hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ink rounded"
+ aria-expanded={referenceOpen}
+ on:click={() => (referenceOpen = !referenceOpen)}
+ >
+ <Icon icon={feLink} size={14} /> Add website reference
+ </button>
</div>
+ {#if referenceOpen}
+ <form class="mt-3 flex gap-2" on:submit|preventDefault={addReference}>
+ <input
+ type="url"
+ bind:value={referenceUrl}
+ placeholder="https://a-site-you-like.com"
+ aria-label="Website to use as a visual reference"
+ class="h-9 flex-1 rounded-full border border-rule bg-white px-4 text-sm text-ink placeholder-ink-faint focus:border-ink focus:outline-none"
+ />
+ <button
+ type="submit"
+ disabled={!referenceUrl.trim()}
+ class="h-9 shrink-0 rounded-full bg-black px-4 text-sm font-medium text-white transition-colors hover:bg-[#333] disabled:cursor-not-allowed disabled:opacity-40"
+ >
+ Add
+ </button>
+ </form>
+ {/if}
+
<div class="mt-4 flex gap-2 overflow-x-auto scrollbar-none">
{#each categories as c}
<button
diff --git a/chat/src/three-ui/flows/utilityFlowData.js b/chat/src/three-ui/flows/utilityFlowData.js
index a61255621..646c5d2f2 100644
--- a/chat/src/three-ui/flows/utilityFlowData.js
+++ b/chat/src/three-ui/flows/utilityFlowData.js
@@ -43,7 +43,7 @@ export const modeConfig = {
chat: {
label: 'Chat mode',
icon: feMessageSquare,
- placeholder: 'Just chat — no tools, no agents.',
+ placeholder: 'Just chat. No tools, no agents.',
secondary: null,
},
playbook: {
@@ -66,7 +66,7 @@ export const schedulePrompts = [
export const researchPrompts = [
'Compare the top 10 vector databases on price, latency, scale',
'Find every YC W24 company in dev tools with public pricing',
- 'Summarize recent papers on LLM evaluation from 2024–2026',
+ 'Summarize recent papers on LLM evaluation from 2024-2026',
'List all Series A AI infra startups with announced rounds in Q1',
'Extract feature parity matrix for Cursor, Claude Code, and three.ws',
'Find hiring pages of top 50 robotics startups; pull JD for SWE',
@@ -146,9 +146,9 @@ export const portfolioPrompts = [
export const rugcheckPrompts = [
'Rug check this token: [paste mint address]',
- 'Analyze the holder distribution — is this token concentrated?',
+ 'Analyze the holder distribution: is this token concentrated?',
'How much does the dev wallet hold? Any recent dumps?',
- 'Show me the bonding curve — is it near graduation or stalling?',
+ 'Show me the bonding curve: is it near graduation or stalling?',
'Check for suspicious trading patterns on this token',
'Flag any honeypot signals or locked liquidity issues',
];
diff --git a/chat/src/three-ui/pages/AuthPage.svelte b/chat/src/three-ui/pages/AuthPage.svelte
index ac37e5911..67d8f7a95 100644
--- a/chat/src/three-ui/pages/AuthPage.svelte
+++ b/chat/src/three-ui/pages/AuthPage.svelte
@@ -1,13 +1,15 @@
<script>
import { route, loadCurrentUser } from '../../stores.js';
import { signInWithEVM, signInWithSolana } from '../../walletAuth.js';
+ import { signInWithPassword, registerWithPassword } from '../../passwordAuth.js';
export let kind = 'signin'; // 'signin' | 'signup'
let email = '';
let password = '';
let name = '';
- let loading = null; // 'evm' | 'sol' | null
+ let tosAccepted = false;
+ let loading = null; // 'evm' | 'sol' | 'password' | null
let error = '';
async function connectEVM() {
@@ -38,9 +40,23 @@
}
}
- function submit() {
- // Email/password auth not yet implemented
- route.set('chat');
+ async function submit() {
+ error = '';
+ loading = 'password';
+ try {
+ if (kind === 'signup') {
+ await registerWithPassword({ email, password, displayName: name, tosAccepted });
+ } else {
+ await signInWithPassword({ email, password });
+ }
+ await loadCurrentUser();
+ password = '';
+ route.set('chat');
+ } catch (e) {
+ error = e.message || 'Sign-in failed.';
+ } finally {
+ loading = null;
+ }
}
</script>
@@ -70,9 +86,6 @@
>
{loading === 'sol' ? 'Connecting…' : 'Connect Solana Wallet'}
</button>
- {#if error}
- <p class="text-xs text-red-500 text-center">{error}</p>
- {/if}
</div>
<div class="flex items-center gap-3 text-xs text-ink-faint my-4">
@@ -90,18 +103,41 @@
<label class="block">
<span class="text-xs font-medium text-ink-soft mb-1.5 block">Email</span>
<input class="w-full h-11 px-4 rounded-xl border border-rule bg-white focus:outline-none focus:border-ink"
- type="email" bind:value={email} required>
+ type="email" bind:value={email} required autocomplete="email">
</label>
<label class="block">
<span class="text-xs font-medium text-ink-soft mb-1.5 block">Password</span>
<input class="w-full h-11 px-4 rounded-xl border border-rule bg-white focus:outline-none focus:border-ink"
- type="password" bind:value={password} required minlength="8">
+ type="password" bind:value={password} required minlength="8"
+ autocomplete={kind === 'signup' ? 'new-password' : 'current-password'}>
</label>
+ {#if kind === 'signup'}
+ <!-- Clickwrap. The server refuses account creation without it, so the
+ submit button stays disabled until it is checked. -->
+ <label class="flex items-start gap-2 text-xs text-ink-soft">
+ <input type="checkbox" bind:checked={tosAccepted} required class="mt-0.5 accent-black">
+ <span>
+ I agree to the
+ <a href="/legal/tos" class="text-ink underline">Terms of Service</a>
+ and
+ <a href="/legal/privacy" class="text-ink underline">Privacy Policy</a>.
+ </span>
+ </label>
+ {/if}
<button type="submit"
- class="w-full h-11 rounded-full bg-black text-white text-sm font-medium hover:bg-ink">
- {kind === 'signin' ? 'Sign in' : 'Create account'}
+ disabled={loading !== null || (kind === 'signup' && !tosAccepted)}
+ class="w-full h-11 rounded-full bg-black text-white text-sm font-medium hover:bg-ink disabled:opacity-50 disabled:cursor-not-allowed transition-colors">
+ {#if loading === 'password'}
+ {kind === 'signin' ? 'Signing in…' : 'Creating account…'}
+ {:else}
+ {kind === 'signin' ? 'Sign in' : 'Create account'}
+ {/if}
</button>
</form>
+
+ {#if error}
+ <p role="alert" class="text-xs text-red-500 text-center mt-3">{error}</p>
+ {/if}
</div>
<p class="text-center text-sm text-ink-soft mt-6">
diff --git a/chat/src/three-ui/pages/EventsPage.svelte b/chat/src/three-ui/pages/EventsPage.svelte
deleted file mode 100644
index 70123db6f..000000000
--- a/chat/src/three-ui/pages/EventsPage.svelte
+++ /dev/null
@@ -1,149 +0,0 @@
-<script>
- import { route } from '../../stores.js';
- import Icon from '../../Icon.svelte';
- import {
- feVideo, feMapPin, feClock, feZap, fePlay,
- feCalendar, feExternalLink, feUsers,
- } from '../../feather.js';
-
- export let slug = '';
-
- const pages = {
- 'events/webinars': {
- title: 'Webinars',
- sub: 'Live sessions with the three.ws team — deep dives, demos, and Q&A.',
- cta: 'Register for upcoming webinars',
- upcoming: [
- { date: 'May 14, 2026', title: 'Building multi-agent workflows with three.ws', host: 'Lena Park · Product', duration: '45 min', spots: 'Open' },
- { date: 'May 21, 2026', title: 'Deploying on your own VPC: a step-by-step walkthrough', host: 'Marco Diaz · Engineering', duration: '60 min', spots: 'Open' },
- { date: 'Jun 4, 2026', title: 'Agent Skills deep dive: recording, sharing, and versioning', host: 'Sarah Chen · Product', duration: '45 min', spots: 'Open' },
- ],
- past: [
- { date: 'Apr 23, 2026', title: 'What\'s new in three.ws — April edition', views: '1.2k views' },
- { date: 'Apr 9, 2026', title: 'Intro to wide research: parallel agents at scale', views: '980 views' },
- { date: 'Mar 19, 2026', title: 'Building internal tools with three.ws + Postgres', views: '2.1k views' },
- ],
- },
- 'events/conferences': {
- title: 'Conferences',
- sub: 'Meet the three.ws team in person at leading AI, developer, and product conferences.',
- cta: 'Request a meeting at an upcoming event',
- upcoming: [
- { date: 'May 19–21, 2026', title: 'AI Engineer World\'s Fair', host: 'San Francisco, CA', duration: 'Booth #412', spots: 'Open' },
- { date: 'Jun 3–5, 2026', title: 'SaaStr Annual', host: 'San Mateo, CA', duration: 'Sponsor', spots: 'Open' },
- { date: 'Jun 17–18, 2026', title: 'Config 2026 (Figma)', host: 'San Francisco, CA', duration: 'Speaking', spots: 'Open' },
- ],
- past: [
- { date: 'Mar 2026', title: 'GTC 2026 — NVIDIA', views: 'San Jose, CA' },
- { date: 'Feb 2026', title: 'ProductHunt Makers Festival', views: 'Remote' },
- { date: 'Jan 2026', title: 'CES 2026', views: 'Las Vegas, NV' },
- ],
- },
- 'events/office-hours': {
- title: 'Office Hours',
- sub: 'Weekly open Q&A with three.ws engineers and product managers. Bring your questions, bugs, or ideas.',
- cta: 'Join the next session',
- upcoming: [
- { date: 'May 7, 2026', title: 'Engineering office hours — general Q&A', host: 'Marco Diaz + Alex Kim', duration: '60 min', spots: '12 spots left' },
- { date: 'May 14, 2026', title: 'Product office hours — roadmap & feedback', host: 'Lena Park', duration: '45 min', spots: 'Open' },
- { date: 'May 21, 2026', title: 'Engineering office hours — general Q&A', host: 'Marco Diaz + Alex Kim', duration: '60 min', spots: 'Open' },
- ],
- past: [
- { date: 'Apr 30, 2026', title: 'Engineering Q&A — memory and context', views: 'Recording available' },
- { date: 'Apr 23, 2026', title: 'Product Q&A — new composer feedback', views: 'Recording available' },
- { date: 'Apr 16, 2026', title: 'Engineering Q&A — deployment options', views: 'Recording available' },
- ],
- },
- 'events/hackathons': {
- title: 'Hackathons',
- sub: 'Build with three.ws alongside the community. Cash prizes, credits, and a chance to get featured.',
- cta: 'Apply for the next hackathon',
- upcoming: [
- { date: 'Jun 7–8, 2026', title: 'three.ws Build Weekend — Agents Track', host: 'Remote', duration: '48 hours', spots: 'Applications open' },
- { date: 'Jul 12, 2026', title: 'AI x Fintech Hackathon (co-hosted)', host: 'New York, NY', duration: '24 hours', spots: 'Coming soon' },
- ],
- past: [
- { date: 'Apr 2026', title: 'Spring Build Weekend — 142 submissions', views: 'See winners' },
- { date: 'Feb 2026', title: 'Agents for Good Hackathon — $20k in prizes', views: 'See winners' },
- { date: 'Dec 2025', title: 'Launch Week Hackathon — inaugural event', views: 'See winners' },
- ],
- },
- 'events/recordings': {
- title: 'Recordings',
- sub: 'Every webinar, demo, and talk — available on demand.',
- cta: null,
- upcoming: [],
- past: [
- { date: 'Apr 23, 2026', title: 'What\'s new in three.ws — April edition', views: '1.2k views' },
- { date: 'Apr 9, 2026', title: 'Intro to wide research: parallel agents at scale', views: '980 views' },
- { date: 'Mar 19, 2026', title: 'Building internal tools with three.ws + Postgres', views: '2.1k views' },
- { date: 'Mar 5, 2026', title: 'Agent reliability — how we think about failure', views: '1.5k views' },
- { date: 'Feb 19, 2026', title: 'Live demo: multi-agent runs from scratch', views: '3.4k views' },
- { date: 'Feb 5, 2026', title: 'Office hours recap — memory and context deep dive', views: '760 views' },
- { date: 'Jan 22, 2026', title: 'New composer walkthrough — file and image support', views: '1.1k views' },
- { date: 'Jan 8, 2026', title: 'Building with the three.ws SDK — getting started', views: '2.8k views' },
- ],
- },
- };
-
- $: page = pages[slug] ?? pages['events/webinars'];
-</script>
-
-<div class="max-w-[1100px] mx-auto px-6 pt-20 pb-32">
-
- <!-- Hero -->
- <div class="text-center mb-16">
- <h1 class="font-serif text-5xl font-semibold text-ink">{page.title}</h1>
- <p class="text-ink-soft text-lg max-w-[560px] mx-auto mt-4">{page.sub}</p>
- {#if page.cta}
- <button class="mt-8 bg-black text-white rounded-full h-10 px-6 text-sm font-medium hover:bg-[#333] transition-colors">
- {page.cta}
- </button>
- {/if}
- </div>
-
- <!-- Upcoming -->
- {#if page.upcoming.length > 0}
- <h2 class="font-serif text-2xl font-semibold text-ink mb-6">Upcoming</h2>
- <div class="space-y-3 mb-16">
- {#each page.upcoming as e}
- <div class="bg-white border border-rule rounded-2xl px-6 py-5 flex items-center gap-6">
- <div class="flex items-center justify-center w-10 h-10 rounded-xl bg-paper shrink-0">
- <Icon icon={feCalendar} class="w-5 h-5 text-ink" strokeWidth={1.5} />
- </div>
- <div class="flex-1 min-w-0">
- <p class="text-sm font-semibold text-ink">{e.title}</p>
- <p class="text-xs text-ink-soft mt-1">{e.host} · {e.duration}</p>
- </div>
- <div class="text-right shrink-0">
- <p class="text-xs font-medium text-ink">{e.date}</p>
- <p class="text-xs text-ink-soft mt-1">{e.spots}</p>
- </div>
- <button class="shrink-0 h-8 px-4 rounded-full border border-rule text-xs font-medium text-ink hover:bg-paper transition-colors">
- Register
- </button>
- </div>
- {/each}
- </div>
- {/if}
-
- <!-- Past / All Recordings -->
- <h2 class="font-serif text-2xl font-semibold text-ink mb-6">
- {page.upcoming.length > 0 ? 'Past sessions' : 'All recordings'}
- </h2>
- <div class="grid md:grid-cols-2 gap-4">
- {#each page.past as e}
- <div class="bg-white border border-rule rounded-2xl px-6 py-5 flex items-center gap-4 hover:bg-paper-deep transition-colors cursor-pointer">
- <div class="flex items-center justify-center w-10 h-10 rounded-xl bg-paper shrink-0">
- <Icon icon={fePlay} class="w-4 h-4 text-ink" strokeWidth={1.5} />
- </div>
- <div class="flex-1 min-w-0">
- <p class="text-sm font-semibold text-ink line-clamp-1">{e.title}</p>
- <p class="text-xs text-ink-soft mt-1">{e.date} · {e.views}</p>
- </div>
- <Icon icon={feExternalLink} class="w-4 h-4 text-ink-faint shrink-0" strokeWidth={1.5} />
- </div>
- {/each}
- </div>
-
-</div>
diff --git a/chat/src/three-ui/pages/FeaturePage.svelte b/chat/src/three-ui/pages/FeaturePage.svelte
deleted file mode 100644
index e20cd54f4..000000000
--- a/chat/src/three-ui/pages/FeaturePage.svelte
+++ /dev/null
@@ -1,47 +0,0 @@
-<script>
- import Icon from '../../Icon.svelte';
- import { featurePages } from './featurePages.js';
-
- export let slug;
-
- $: page = featurePages[slug] ?? featurePages['web-app'];
-</script>
-
-<div class="overflow-y-auto">
- <div class="max-w-[1100px] mx-auto px-6 pt-20 pb-32">
-
- <!-- Hero -->
- <div class="text-center">
- <p class="text-xs font-medium tracking-[0.16em] uppercase text-ink-soft mb-4">{page.eyebrow}</p>
- <h1 class="three.ws-display">{page.title}</h1>
- <p class="text-ink-soft text-lg max-w-[640px] mx-auto mt-6">{page.sub}</p>
- <div class="flex items-center justify-center gap-3 mt-8">
- <button class="three.ws-btn-primary">{page.primaryCta}</button>
- <button class="three.ws-btn-ghost border border-rule">{page.secondaryCta}</button>
- </div>
- </div>
-
- <!-- What you get -->
- <h2 class="font-serif text-3xl font-semibold mt-24 mb-8 text-center">What you get</h2>
- <div class="grid md:grid-cols-3 gap-4">
- {#each page.features as feat}
- <div class="bg-white border border-rule rounded-2xl p-6">
- <div class="w-9 h-9 flex items-center justify-center rounded-xl bg-paper border border-rule">
- <Icon icon={feat.icon} class="h-[22px] w-[22px] text-ink" strokeWidth={1.5} />
- </div>
- <p class="text-base font-semibold mt-4">{feat.title}</p>
- <p class="text-sm text-ink-soft mt-2">{feat.body}</p>
- </div>
- {/each}
- </div>
-
- <!-- Bottom CTA strip -->
- <div class="bg-black text-white rounded-2xl p-10 max-w-[1100px] mx-auto mt-24 flex items-center justify-between gap-6">
- <h3 class="font-serif text-3xl">{page.closingTitle}</h3>
- <button class="shrink-0 bg-white text-black rounded-full h-10 px-5 text-sm font-medium hover:bg-paper transition-colors">
- {page.closingCta}
- </button>
- </div>
-
- </div>
-</div>
diff --git a/chat/src/three-ui/pages/MarketingPage.svelte b/chat/src/three-ui/pages/MarketingPage.svelte
deleted file mode 100644
index 76b8c1ae4..000000000
--- a/chat/src/three-ui/pages/MarketingPage.svelte
+++ /dev/null
@@ -1,107 +0,0 @@
-<script>
- import { tick } from 'svelte';
- import { route, mode, composerFill } from '../../stores.js';
- import Icon from '../../Icon.svelte';
- import { feArrowUp } from '../../feather.js';
- import WebsiteFlow from '../flows/WebsiteFlow.svelte';
- import { getPageContent } from './marketingPages.js';
-
- export let slug = '';
-
- $: content = getPageContent(slug);
- $: headlineParts = content.headline.split('\n');
-
- let text = '';
- let textareaEl;
-
- function autoresize() {
- if (!textareaEl) return;
- textareaEl.style.height = 'auto';
- textareaEl.style.height = Math.min(textareaEl.scrollHeight + 2, 320) + 'px';
- }
-
- async function submit() {
- const msg = text.trim();
- if (!msg) return;
- composerFill.set({ text: msg, submit: false, ifEmpty: false });
- if (slug.startsWith('solutions/') || slug.startsWith('business/')) {
- mode.set('website');
- }
- route.set('chat');
- }
-
- const logos = ['ACME', 'NORTHWIND', 'LATTE', 'PIVOT', 'ATLAS', 'BEACON'];
-</script>
-
-<div class="bg-paper min-h-screen">
- <div class="max-w-[1100px] mx-auto px-6 pt-24 pb-32">
-
- <!-- Eyebrow -->
- {#if content.eyebrow}
- <p class="text-center text-xs font-semibold uppercase tracking-[0.14em] text-ink-faint mb-4">
- {content.eyebrow}
- </p>
- {/if}
-
- <!-- Headline -->
- <h1 class="three.ws-display text-center">
- {#each headlineParts as part, i}
- {part}{#if i < headlineParts.length - 1}<br />{/if}
- {/each}
- </h1>
-
- <!-- Sub -->
- <p class="text-ink-soft text-lg max-w-[640px] mx-auto text-center mt-6">
- {content.sub}
- </p>
-
- <!-- Composer -->
- <div class="mt-12 max-w-[680px] mx-auto">
- <div
- class="bg-white border border-rule rounded-[20px] shadow-composer pt-5 px-5 pb-3"
- style="min-height:140px"
- >
- <textarea
- bind:this={textareaEl}
- bind:value={text}
- placeholder={content.placeholder}
- rows={1}
- class="w-full resize-none bg-transparent border-0 p-0 outline-none ring-0 focus:outline-none focus:ring-0 text-base text-ink placeholder-ink-faint font-sans overflow-y-auto scrollbar-ultraslim"
- style="max-height:320px;"
- on:input={autoresize}
- on:keydown={(e) => {
- if (e.key === 'Enter' && !e.shiftKey) {
- e.preventDefault();
- submit();
- }
- }}
- />
- <div class="flex items-center justify-end mt-3">
- <button
- disabled={!text.trim()}
- on:click={submit}
- class="flex h-9 w-9 items-center justify-center rounded-full transition-colors {text.trim()
- ? 'bg-black text-white hover:bg-[#333] cursor-pointer'
- : 'bg-paper-deep text-ink-faint cursor-default'}"
- title="Send"
- >
- <Icon icon={feArrowUp} class="h-4 w-4" />
- </button>
- </div>
- </div>
- </div>
-
- <!-- Categories row (compact — no Add reference / Import from Figma) -->
- <WebsiteFlow compact={true} />
-
- <!-- Logos strip -->
- <div class="mt-20 grid grid-cols-3 md:grid-cols-6 gap-6 items-center opacity-70">
- {#each logos as logo}
- <div class="text-ink-soft text-sm uppercase tracking-[0.16em] text-center">
- {logo}
- </div>
- {/each}
- </div>
-
- </div>
-</div>
diff --git a/chat/src/three-ui/pages/Pricing.svelte b/chat/src/three-ui/pages/Pricing.svelte
deleted file mode 100644
index 0d6ccd84b..000000000
--- a/chat/src/three-ui/pages/Pricing.svelte
+++ /dev/null
@@ -1,66 +0,0 @@
-<script>
- import Icon from '../../Icon.svelte';
- import { feCheck } from '../../feather.js';
- const plans = [
- { name: 'Free', price: '$0', suffix: '/mo', tag: 'Try three.ws on small projects',
- features: ['50 messages / month','Single-agent runs','Community support'],
- cta: 'Get started', highlight: false },
- { name: 'Pro', price: '$39', suffix: '/mo', tag: 'For builders who ship daily',
- features: ['Unlimited messages','Multi-agent runs','Priority models','Email support'],
- cta: 'Start free trial', highlight: true },
- { name: 'Business', price: '$129', suffix: '/mo', tag: 'For teams running real workloads',
- features: ['Everything in Pro','Shared workspaces','SSO','SOC 2 reports','Dedicated CSM'],
- cta: 'Talk to sales', highlight: false },
- ];
- const faqs = [
- { q: 'Can I change plans later?', a: 'Yes — upgrade, downgrade, or cancel any time.' },
- { q: 'Do you offer annual billing?', a: 'Annual billing is available with a 20% discount.' },
- { q: 'Is there a free trial of Pro?', a: '14 days, no credit card required.' },
- { q: 'How does enterprise pricing work?', a: 'Custom volume pricing — contact sales for a quote.' },
- ];
-</script>
-
-<section class="pt-20 pb-24">
- <h1 class="three.ws-display text-center">Simple pricing.<br/>Built for momentum.</h1>
- <p class="text-ink-soft text-lg max-w-[640px] text-center mx-auto mt-6">
- Start free. Upgrade when your team is ready to ship more.
- </p>
-
- <div class="max-w-[1100px] mx-auto px-6 mt-16 grid md:grid-cols-3 gap-6">
- {#each plans as p}
- <div class={'rounded-2xl p-8 flex flex-col border ' + (p.highlight
- ? 'bg-black text-white border-black'
- : 'bg-white text-ink border-rule')}>
- <div class="text-sm font-medium opacity-80">{p.name}</div>
- <div class="mt-2 flex items-baseline gap-1">
- <span class="font-serif text-5xl font-semibold">{p.price}</span>
- <span class={p.highlight ? 'text-white/60 text-base' : 'text-ink-soft text-base'}>{p.suffix}</span>
- </div>
- <div class={'mt-2 text-sm ' + (p.highlight ? 'text-white/70' : 'text-ink-soft')}>{p.tag}</div>
- <ul class="mt-6 space-y-2 text-sm">
- {#each p.features as f}
- <li class="flex items-center gap-2">
- <Icon icon={feCheck} size={14} />
- <span>{f}</span>
- </li>
- {/each}
- </ul>
- <button class={'mt-8 h-10 rounded-full text-sm font-medium ' + (p.highlight
- ? 'bg-white text-black hover:bg-white/90'
- : 'bg-black text-white hover:bg-ink')}>{p.cta}</button>
- </div>
- {/each}
- </div>
-
- <div class="max-w-[760px] mx-auto px-6 mt-24">
- <h2 class="font-serif text-3xl font-semibold mb-6">Questions</h2>
- <div class="divide-y divide-rule border-t border-rule">
- {#each faqs as f}
- <details class="py-4">
- <summary class="cursor-pointer font-medium text-ink">{f.q}</summary>
- <p class="mt-2 text-ink-soft text-sm">{f.a}</p>
- </details>
- {/each}
- </div>
- </div>
-</section>
diff --git a/chat/src/three-ui/pages/ResourcePage.svelte b/chat/src/three-ui/pages/ResourcePage.svelte
deleted file mode 100644
index 4bbd1bb41..000000000
--- a/chat/src/three-ui/pages/ResourcePage.svelte
+++ /dev/null
@@ -1,25 +0,0 @@
-<script>
- import BlogIndex from './resources/BlogIndex.svelte';
- import DocsIndex from './resources/DocsIndex.svelte';
- import UpdatesTimeline from './resources/UpdatesTimeline.svelte';
- import UseCasesIndex from './resources/UseCasesIndex.svelte';
- import TrustCenter from './resources/TrustCenter.svelte';
-
- export let slug = '';
-</script>
-
-{#if slug === 'blog'}
- <BlogIndex />
-{:else if slug === 'docs' || slug.startsWith('docs/')}
- <DocsIndex docSlug={slug.startsWith('docs/') ? slug.slice(5) : ''} />
-{:else if slug === 'updates'}
- <UpdatesTimeline />
-{:else if slug === 'use-cases'}
- <UseCasesIndex />
-{:else if slug === 'trust-center'}
- <TrustCenter />
-{:else}
- <div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24">
- <p class="text-ink-soft">Page not found: resources/{slug}</p>
- </div>
-{/if}
diff --git a/chat/src/three-ui/pages/RevenueDashboard.svelte b/chat/src/three-ui/pages/RevenueDashboard.svelte
index bbba42d82..fbec49719 100644
--- a/chat/src/three-ui/pages/RevenueDashboard.svelte
+++ b/chat/src/three-ui/pages/RevenueDashboard.svelte
@@ -9,6 +9,7 @@
let withdrawalsTotal = 0;
let loading = true;
let loadError = '';
+ let needsSignIn = false;
// Available balance = net earned minus pending/processing withdrawals
let availableBalance = 0;
@@ -55,6 +56,7 @@
async function loadAll() {
loading = true;
loadError = '';
+ needsSignIn = false;
try {
const [revRes, walletsRes, histRes] = await Promise.all([
fetch('/api/billing/revenue', { credentials: 'include' }),
@@ -62,9 +64,15 @@
fetch(`/api/billing/withdrawals?limit=${HIST_LIMIT}&offset=${histOffset}`, { credentials: 'include' }),
]);
- if (!revRes.ok) throw new Error('Failed to load revenue');
- if (!walletsRes.ok) throw new Error('Failed to load payout wallets');
- if (!histRes.ok) throw new Error('Failed to load withdrawal history');
+ // 401 is not a failure, it is the page telling an anonymous visitor what
+ // to do next. Saying "failed to load" there sends people hunting a bug.
+ if ([revRes, walletsRes, histRes].some((r) => r.status === 401)) {
+ needsSignIn = true;
+ return;
+ }
+ if (!revRes.ok) throw new Error('Could not load your revenue. Try again in a moment.');
+ if (!walletsRes.ok) throw new Error('Could not load your payout wallets. Try again in a moment.');
+ if (!histRes.ok) throw new Error('Could not load your withdrawal history. Try again in a moment.');
revenueData = await revRes.json();
const walletsJson = await walletsRes.json();
@@ -159,7 +167,7 @@
return;
}
- submitSuccess = 'Withdrawal requested. Processing typically takes 1–2 business days.';
+ submitSuccess = 'Withdrawal requested. Processing typically takes 1-2 business days.';
amountDisplay = '';
await loadAll();
} catch (e) {
@@ -198,8 +206,21 @@
{#if loading}
<p class="text-ink-soft text-sm">Loading…</p>
+ {:else if needsSignIn}
+ <div class="rounded-xl border border-rule bg-white p-6 text-center">
+ <p class="text-sm text-ink">Sign in to see what your agents have earned.</p>
+ <button
+ class="mt-4 h-10 rounded-full bg-black px-5 text-sm font-medium text-white transition-colors hover:bg-[#333]"
+ on:click={() => route.set('signin')}
+ >Sign in</button>
+ </div>
{:else if loadError}
- <div class="rounded-xl border border-red-200 bg-red-50 p-4 text-sm text-red-700">{loadError}</div>
+ <div class="rounded-xl border border-red-200 bg-red-50 p-4 text-sm text-red-700">
+ <p>{loadError}</p>
+ <button class="mt-3 rounded-full border border-red-300 px-3 py-1 text-xs font-medium hover:bg-red-100" on:click={loadAll}>
+ Retry
+ </button>
+ </div>
{:else}
<!-- Summary cards -->
@@ -365,7 +386,7 @@
{w.tx_signature.slice(0, 8)}…
</a>
{:else}
- <span class="text-xs text-ink-faint">—</span>
+ <span class="text-xs text-ink-faint">-</span>
{/if}
</td>
</tr>
@@ -377,7 +398,7 @@
<!-- Pagination -->
{#if withdrawalsTotal > HIST_LIMIT}
<div class="flex items-center justify-between mt-4 text-sm text-ink-soft">
- <span>{histOffset + 1}–{Math.min(histOffset + HIST_LIMIT, withdrawalsTotal)} of {withdrawalsTotal}</span>
+ <span>{histOffset + 1}-{Math.min(histOffset + HIST_LIMIT, withdrawalsTotal)} of {withdrawalsTotal}</span>
<div class="flex gap-2">
<button
disabled={histOffset === 0}
diff --git a/chat/src/three-ui/pages/featurePages.js b/chat/src/three-ui/pages/featurePages.js
deleted file mode 100644
index 0a2247282..000000000
--- a/chat/src/three-ui/pages/featurePages.js
+++ /dev/null
@@ -1,153 +0,0 @@
-import {
- feActivity, feBarChart, feBell, feBookOpen, feCheckSquare,
- feClock, feCode, feCpu, feEdit2, feGlobe, feGrid,
- feImage, feInbox, feLayers, feLayout, feList, feMail,
- feMonitor, fePenTool, fePlayCircle, feSearch, feSliders,
- feSmartphone, feTarget, feUpload, feUsers, feZap,
-} from '../../feather.js';
-
-export const featurePages = {
- 'web-app': {
- eyebrow: 'AI Web App',
- title: 'Build full-stack apps from a single prompt',
- sub: 'three.ws generates the frontend, backend, database, and deploys it — no engineering team required.',
- primaryCta: 'Start building',
- secondaryCta: 'Watch a 2-min demo',
- features: [
- { title: 'Real frameworks', body: 'Next.js, Postgres, Auth, Stripe — production-grade defaults.', icon: feCode },
- { title: 'One-click deploys', body: 'Push to your own domain, with HTTPS and previews per branch.', icon: feUpload },
- { title: 'Editable from chat', body: 'Iterate on copy, layout, and logic without leaving the conversation.', icon: feEdit2 },
- { title: 'Built-in observability', body: 'Errors, traces, and costs visible from the start.', icon: feActivity },
- { title: 'Bring your stack', body: 'Swap any default — your DB, your auth, your CDN.', icon: feGrid },
- { title: 'Team review', body: 'Comment on diffs, approve before deploy.', icon: feUsers },
- ],
- closingTitle: 'Ship a real app today.',
- closingCta: 'Start free',
- },
-
- 'mobile-app': {
- eyebrow: 'AI Mobile App',
- title: 'Native iOS & Android apps, generated end-to-end',
- sub: 'From idea to App Store — three.ws writes the code, wires the APIs, and handles the release build.',
- primaryCta: 'Build your app',
- secondaryCta: 'Watch a 2-min demo',
- features: [
- { title: 'Cross-platform code', body: 'React Native or Flutter — idiomatic output, not scaffolded boilerplate.', icon: feSmartphone },
- { title: 'App Store submission', body: 'Signed builds, metadata, and screenshots ready to submit.', icon: feUpload },
- { title: 'Push & deep links', body: 'APNs, FCM, and universal links configured from the first run.', icon: feBell },
- { title: 'Live preview', body: 'See your app on a real device before pushing to production.', icon: feMonitor },
- { title: 'Auth & payments', body: 'Apple Sign-In, Google OAuth, and Stripe ready from day one.', icon: feCheckSquare },
- { title: 'Team CI/CD', body: 'Every merge triggers a fresh build — no manual release steps.', icon: feUsers },
- ],
- closingTitle: 'Launch your app this week.',
- closingCta: 'Start free',
- },
-
- 'ai-design': {
- eyebrow: 'AI Design',
- title: 'From brief to brand: design that ships itself',
- sub: 'Describe your product, brand, or screen — three.ws delivers complete, export-ready design files.',
- primaryCta: 'Start designing',
- secondaryCta: 'Watch a 2-min demo',
- features: [
- { title: 'Brand systems', body: 'Logos, color palettes, and type scales generated as a coherent whole.', icon: fePenTool },
- { title: 'Figma-ready exports', body: 'Components, variables, and styles structured for handoff.', icon: feImage },
- { title: 'Responsive layouts', body: 'Desktop, tablet, and mobile frames produced in a single pass.', icon: feLayout },
- { title: 'Iterate in chat', body: 'Adjust tone, color, or density with plain-language instructions.', icon: feEdit2 },
- { title: 'Asset library', body: 'Icons, illustrations, and photography matched to your brand style.', icon: feGrid },
- { title: 'Review & approve', body: 'Share a preview link with stakeholders before any handoff.', icon: feCheckSquare },
- ],
- closingTitle: 'Design your brand in an afternoon.',
- closingCta: 'Start designing',
- },
-
- 'ai-slides': {
- eyebrow: 'AI Slides',
- title: 'Decks that write, design, and rehearse with you',
- sub: 'Tell three.ws your audience and key message. Get a polished, presentation-ready deck in minutes.',
- primaryCta: 'Create a deck',
- secondaryCta: 'Watch a 2-min demo',
- features: [
- { title: 'Smart outlines', body: 'three.ws structures your narrative before designing a single slide.', icon: feList },
- { title: 'On-brand layouts', body: 'Themes that match your palette, fonts, and grid — automatically.', icon: feLayout },
- { title: 'Speaker notes', body: 'Every slide ships with talking points and transition cues.', icon: feEdit2 },
- { title: 'Live data charts', body: 'Pull in your numbers; three.ws picks the right chart type automatically.', icon: feBarChart },
- { title: 'Rehearsal mode', body: 'Practice your timing with auto-advance and an inline teleprompter.', icon: fePlayCircle },
- { title: 'Share & export', body: 'PowerPoint, PDF, or a shareable link — one click away.', icon: feUpload },
- ],
- closingTitle: 'Present with confidence.',
- closingCta: 'Create your deck',
- },
-
- 'browser-operator': {
- eyebrow: 'Browser Operator',
- title: 'Lend three.ws a tab. Watch it work.',
- sub: 'Give three.ws access to a browser tab and it completes multi-step web tasks while you focus on other things.',
- primaryCta: 'Try it now',
- secondaryCta: 'Watch a 2-min demo',
- features: [
- { title: 'Full page control', body: 'Clicks, scrolls, form fills, and file uploads — no task too complex.', icon: feMonitor },
- { title: 'Multi-tab flows', body: 'Research across sites, compare prices, and aggregate results in one pass.', icon: feGlobe },
- { title: 'Authenticated sessions', body: 'three.ws works inside your logged-in accounts, safely sandboxed.', icon: feCheckSquare },
- { title: 'Parallel browsing', body: 'Spin up multiple agents to run independent web tasks concurrently.', icon: feGrid },
- { title: 'Audit trail', body: 'Every action logged — see exactly what was clicked and when.', icon: feActivity },
- { title: 'Scheduled runs', body: 'Set three.ws to monitor a site or submit a form on a recurring schedule.', icon: feClock },
- ],
- closingTitle: 'Never click through a workflow again.',
- closingCta: 'Try it free',
- },
-
- 'wide-research': {
- eyebrow: 'Wide Research',
- title: 'Parallel research across hundreds of sources at once',
- sub: 'three.ws dispatches a fleet of agents to explore the web, synthesising findings into a single citable report.',
- primaryCta: 'Start researching',
- secondaryCta: 'Watch a 2-min demo',
- features: [
- { title: 'Hundreds of sources', body: 'Academic papers, news, forums, and market data — searched simultaneously.', icon: feSearch },
- { title: 'Cited outputs', body: 'Every claim linked to its source — no hallucinated references.', icon: feBookOpen },
- { title: 'Configurable depth', body: 'Set breadth vs. depth for quick briefs or exhaustive deep-dives.', icon: feSliders },
- { title: 'Structured exports', body: 'Markdown, PDF, or structured JSON ready for downstream use.', icon: feList },
- { title: 'Competitive intel', body: 'Track rivals, pricing, and sentiment across the web automatically.', icon: feTarget },
- { title: 'Scheduled sweeps', body: 'Run the same query weekly and get a concise diff of what changed.', icon: feClock },
- ],
- closingTitle: 'Get better research done faster.',
- closingCta: 'Start free',
- },
-
- 'mail-three.ws': {
- eyebrow: 'Mail three.ws',
- title: 'Turn every inbox thread into a finished task',
- sub: 'Connect your inbox and three.ws drafts replies, schedules actions, and closes loops — without you lifting a finger.',
- primaryCta: 'Connect your inbox',
- secondaryCta: 'Watch a 2-min demo',
- features: [
- { title: 'Smart triage', body: 'three.ws reads context, urgency, and intent — not just keywords.', icon: feInbox },
- { title: 'Draft in your voice', body: 'Replies that sound like you, tuned to your past writing patterns.', icon: feEdit2 },
- { title: 'Action extraction', body: 'Meeting requests, to-dos, and follow-ups turned into calendar items.', icon: feCheckSquare },
- { title: 'Thread summaries', body: 'Long threads distilled into a three-line brief before you reply.', icon: feList },
- { title: 'Rules & routing', body: 'Custom logic to forward, label, or delegate automatically.', icon: feSliders },
- { title: 'Team shared inbox', body: 'Assign, co-draft, and track accountability across your whole team.', icon: feUsers },
- ],
- closingTitle: 'Reach inbox zero. Stay there.',
- closingCta: 'Connect your inbox',
- },
-
- 'agent-skills': {
- eyebrow: 'Agent Skills',
- title: 'Codify your team\'s expertise into reusable agents',
- sub: 'Record a workflow once and three.ws runs it reliably at any scale — no maintenance, no documentation drift.',
- primaryCta: 'Build a skill',
- secondaryCta: 'Watch a 2-min demo',
- features: [
- { title: 'Skill recorder', body: 'Walk through a task once; three.ws captures the pattern as a reusable skill.', icon: feCpu },
- { title: 'Parameterised runs', body: 'Swap inputs to reuse the same skill across clients, markets, or datasets.', icon: feSliders },
- { title: 'Team library', body: 'Share, fork, and version skills across your entire organisation.', icon: feUsers },
- { title: 'Composable chains', body: 'Sequence skills into multi-step pipelines with conditional branching.', icon: feLayers },
- { title: 'Reliability monitoring', body: 'Track success rate, drift, and latency for every skill run.', icon: feActivity },
- { title: 'Access controls', body: 'Scope skills to roles, departments, or individual contributors.', icon: feTarget },
- ],
- closingTitle: 'Turn expertise into infrastructure.',
- closingCta: 'Build your first skill',
- },
-};
diff --git a/chat/src/three-ui/pages/marketingPages.js b/chat/src/three-ui/pages/marketingPages.js
deleted file mode 100644
index d0da19367..000000000
--- a/chat/src/three-ui/pages/marketingPages.js
+++ /dev/null
@@ -1,91 +0,0 @@
-export const marketingPages = {
- 'solutions/sales': {
- eyebrow: 'For Sales teams',
- headline: 'Close more deals\nwithout writing more SQL',
- sub: 'Forecasts, dashboards, and outreach drafts — generated from your CRM in minutes.',
- placeholder: 'Describe the sales workflow you want to ship.',
- },
- 'solutions/marketing': {
- eyebrow: 'For Marketing teams',
- headline: 'Campaigns, briefs, and analytics\n— drafted in chat',
- sub: 'From brief to launch — generate copy, analyze performance, and iterate without waiting on engineers.',
- placeholder: 'Describe the marketing workflow you want to automate.',
- },
- 'solutions/engineering': {
- eyebrow: 'For Engineering teams',
- headline: 'Internal tools your team\nwill actually use',
- sub: 'Build admin panels, deployment dashboards, and incident runbooks — without spinning up a new service.',
- placeholder: 'Describe the internal tool you want to build.',
- },
- 'solutions/operations': {
- eyebrow: 'For Operations teams',
- headline: 'Operational reporting\nthat runs itself',
- sub: 'Automate recurring reports, status digests, and cross-team updates so you can focus on decisions, not data wrangling.',
- placeholder: 'Describe the operational report or workflow you need.',
- },
- 'solutions/support': {
- eyebrow: 'For Support teams',
- headline: 'Triage, draft, and resolve\n— alongside your humans',
- sub: 'Route tickets, draft responses, and surface knowledge base answers — keeping your team in the loop at every step.',
- placeholder: 'Describe the support workflow you want to improve.',
- },
- 'solutions/finance': {
- eyebrow: 'For Finance teams',
- headline: 'Forecasts and spend reviews\non demand',
- sub: 'Pull actuals, model scenarios, and generate board-ready summaries — without exporting another spreadsheet.',
- placeholder: 'Describe the finance report or analysis you need.',
- },
- 'solutions/hr': {
- eyebrow: 'For HR teams',
- headline: 'Hiring, onboarding, internal Q&A\n— automated',
- sub: 'Publish job descriptions, answer policy questions, and guide new hires through onboarding — all from one interface.',
- placeholder: 'Describe the HR workflow you want to automate.',
- },
- 'solutions/founders': {
- eyebrow: 'For Founders',
- headline: 'Launch the v1 of your idea\nthis weekend',
- sub: 'Go from idea to working prototype in hours — no engineering team required.',
- placeholder: 'Describe the product or tool you want to ship.',
- },
- 'business/enterprise': {
- eyebrow: 'For Enterprise',
- headline: 'Launch business applications\nwithout engineering resources',
- sub: 'Give every team the ability to build internal apps, automate workflows, and ship faster — no code required.',
- placeholder: 'Describe the business application you want to launch.',
- },
- 'business/security': {
- eyebrow: 'Security & Compliance',
- headline: 'Security and compliance\nyou can show your board',
- sub: 'SOC 2, SSO, audit logs, and data residency controls built in — so your security team can say yes.',
- placeholder: 'Describe your security or compliance requirements.',
- },
- 'business/deployments': {
- eyebrow: 'Private Deployments',
- headline: 'Run three.ws inside\nyour VPC',
- sub: 'Deploy on your own infrastructure. Your data never leaves your environment.',
- placeholder: 'Tell us about your deployment requirements.',
- },
- 'business/customers': {
- eyebrow: 'Customer Stories',
- headline: 'Real teams.\nReal outcomes.',
- sub: 'See how leading organizations use three.ws to ship faster and eliminate bottlenecks.',
- placeholder: 'Describe the outcome you\'re looking for.',
- },
- 'business/contact-sales': {
- eyebrow: 'Talk to Sales',
- headline: 'Talk to a real human\nabout your rollout',
- sub: 'Whether you\'re evaluating, expanding, or ready to sign — our team is here to help.',
- placeholder: 'Tell us about your team and what you\'re building.',
- },
-};
-
-export function getPageContent(slug) {
- if (marketingPages[slug]) return marketingPages[slug];
- const label = slug.split('/').pop().replace(/-/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
- return {
- eyebrow: null,
- headline: label,
- sub: 'Explore what three.ws can do for your team.',
- placeholder: 'Describe what you want to build.',
- };
-}
diff --git a/chat/src/three-ui/pages/resources/BlogIndex.svelte b/chat/src/three-ui/pages/resources/BlogIndex.svelte
deleted file mode 100644
index 3ebfa207e..000000000
--- a/chat/src/three-ui/pages/resources/BlogIndex.svelte
+++ /dev/null
@@ -1,29 +0,0 @@
-<script>
- const articles = [
- { tag: 'Engineering', title: 'How we think about agent reliability', excerpt: 'Building systems that fail gracefully is harder than building systems that work. Here is our approach.', date: 'Apr 14, 2026', read: '6 min read' },
- { tag: 'Design', title: 'Designing chat for non-engineers', excerpt: 'Most chat interfaces are built by engineers, for engineers. We asked a different question.', date: 'Apr 2, 2026', read: '4 min read' },
- { tag: 'Engineering', title: 'Inside the three.ws runtime', excerpt: 'A look at how we execute multi-step agent tasks safely and efficiently at scale.', date: 'Mar 24, 2026', read: '8 min read' },
- { tag: 'Product', title: 'Shipping the new composer', excerpt: 'What we learned from six months of user research on how people write prompts.', date: 'Mar 10, 2026', read: '5 min read' },
- { tag: 'Company', title: 'Why we built three.ws', excerpt: 'The original insight that led us to build an agent-first platform from the ground up.', date: 'Feb 28, 2026', read: '7 min read' },
- { tag: 'Engineering', title: 'Streaming responses at scale', excerpt: 'How we cut median time-to-first-token by 40% without changing model providers.', date: 'Feb 14, 2026', read: '5 min read' },
- { tag: 'Product', title: 'Multi-agent runs: what we shipped', excerpt: 'A deep dive into the new orchestration layer that powers parallel agent execution.', date: 'Jan 30, 2026', read: '6 min read' },
- { tag: 'Design', title: 'The typography behind the interface', excerpt: 'On using a serif wordmark inside a tool-first product and making it feel right.', date: 'Jan 18, 2026', read: '3 min read' },
- { tag: 'Company', title: 'Our approach to trust and safety', excerpt: 'How we think about the responsibility that comes with building powerful AI agents.', date: 'Jan 6, 2026', read: '5 min read' },
- ];
-</script>
-
-<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24">
- <h1 class="font-serif text-4xl font-semibold mb-2">Blog</h1>
- <p class="text-ink-soft text-base mb-12">Ideas, guides, and stories from the three.ws team</p>
-
- <div class="grid md:grid-cols-3 gap-6">
- {#each articles as a}
- <article class="bg-white border border-rule rounded-2xl p-6 hover:bg-paper-deep transition-colors cursor-pointer">
- <span class="inline-block text-xs uppercase tracking-wide text-ink-soft">{a.tag}</span>
- <h2 class="font-serif text-xl mt-2 text-ink">{a.title}</h2>
- <p class="text-sm text-ink-soft mt-2 line-clamp-2">{a.excerpt}</p>
- <div class="text-xs text-ink-faint mt-4">{a.date} · {a.read}</div>
- </article>
- {/each}
- </div>
-</div>
diff --git a/chat/src/three-ui/pages/resources/DocsIndex.svelte b/chat/src/three-ui/pages/resources/DocsIndex.svelte
deleted file mode 100644
index 57b477ef0..000000000
--- a/chat/src/three-ui/pages/resources/DocsIndex.svelte
+++ /dev/null
@@ -1,147 +0,0 @@
-<script>
- import { onMount } from 'svelte';
- import { marked } from 'marked';
-
- export let docSlug = '';
-
- // Load all markdown files at build time
- const rawDocs = import.meta.glob('../../../../../docs/*.md', { query: '?raw', import: 'default', eager: true });
-
- // Build a slug → raw content map
- const docs = {};
- for (const [path, content] of Object.entries(rawDocs)) {
- const slug = path.replace('../../../../../docs/', '').replace('.md', '');
- docs[slug] = content;
- }
-
- // Extract the first H1 heading from a doc, falling back to slug
- function getTitle(slug) {
- const src = docs[slug] || '';
- const m = src.match(/^#\s+(.+)/m);
- return m ? m[1] : slug;
- }
-
- const sections = [
- {
- label: 'Getting Started',
- items: ['introduction', 'quick-start', 'how-it-works'],
- },
- {
- label: 'Concepts',
- items: ['architecture', 'layers', 'agent-system', 'agent-manifest', 'memory', 'skills'],
- },
- {
- label: 'Embedding & SDK',
- items: ['embedding', 'web-component', 'widgets', 'widget-studio', 'js-api', 'sdk'],
- },
- {
- label: 'API',
- items: ['api-reference', 'authentication', 'permissions', 'configuration'],
- },
- {
- label: 'Avatars & 3D',
- items: ['viewer', 'avatar-creation', 'avaturn', 'character-studio', 'validation', 'editor', 'ar'],
- },
- {
- label: 'Blockchain',
- items: ['erc8004', 'smart-contracts', 'solana', 'solana-pumpfun', 'x402', 'reputation'],
- },
- {
- label: 'Platform',
- items: ['deployment', 'security', 'mcp', 'multi-agent'],
- },
- {
- label: 'Help',
- items: ['examples', 'troubleshooting', 'changelog', 'contributing'],
- },
- ].map(s => ({
- ...s,
- items: s.items.filter(slug => docs[slug]),
- })).filter(s => s.items.length > 0);
-
- let active = docSlug && docs[docSlug] ? docSlug : 'introduction';
- let search = '';
- let htmlContent = '';
-
- function navigate(slug) {
- active = slug;
- search = '';
- window.location.hash = `resources/docs/${slug}`;
- }
-
- $: {
- const src = docs[active] || '';
- htmlContent = marked.parse(src);
- }
-
- $: filtered = search.trim()
- ? sections
- .flatMap(s => s.items)
- .filter(slug =>
- getTitle(slug).toLowerCase().includes(search.toLowerCase()) ||
- slug.toLowerCase().includes(search.toLowerCase())
- )
- : null;
-
- onMount(() => {
- // Sync from hash if navigating directly to a sub-page
- const fromHash = window.location.hash.slice(1);
- if (fromHash.startsWith('resources/docs/')) {
- const slug = fromHash.slice('resources/docs/'.length);
- if (docs[slug]) active = slug;
- }
- });
-</script>
-
-<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24 flex gap-8">
- <!-- Left rail -->
- <aside class="w-[240px] shrink-0">
- <div class="sticky top-20">
- <input
- type="search"
- placeholder="Search docs"
- bind:value={search}
- class="bg-white border border-rule rounded-full h-9 px-3 text-sm w-full mb-6 focus:outline-none focus:border-ink"
- />
- {#if filtered}
- <div class="mb-4">
- <div class="text-xs font-semibold uppercase tracking-wide text-ink-faint mb-1">Results</div>
- <ul class="space-y-0.5">
- {#each filtered as slug}
- <li>
- <button
- class="w-full text-left text-sm px-2 py-1 rounded-lg transition-colors {active === slug ? 'bg-paper text-ink font-medium' : 'text-ink-soft hover:text-ink hover:bg-paper'}"
- on:click={() => navigate(slug)}
- >{getTitle(slug)}</button>
- </li>
- {/each}
- {#if filtered.length === 0}
- <li class="text-sm text-ink-faint px-2 py-1">No results</li>
- {/if}
- </ul>
- </div>
- {:else}
- {#each sections as s}
- <div class="mb-4">
- <div class="text-xs font-semibold uppercase tracking-wide text-ink-faint mb-1">{s.label}</div>
- <ul class="space-y-0.5">
- {#each s.items as slug}
- <li>
- <button
- class="w-full text-left text-sm px-2 py-1 rounded-lg transition-colors {active === slug ? 'bg-paper text-ink font-medium' : 'text-ink-soft hover:text-ink hover:bg-paper'}"
- on:click={() => navigate(slug)}
- >{getTitle(slug)}</button>
- </li>
- {/each}
- </ul>
- </div>
- {/each}
- {/if}
- </div>
- </aside>
-
- <!-- Content -->
- <main class="flex-1 min-w-0 prose prose-neutral prose-invert max-w-none">
- {@html htmlContent}
- </main>
-</div>
diff --git a/chat/src/three-ui/pages/resources/TrustCenter.svelte b/chat/src/three-ui/pages/resources/TrustCenter.svelte
deleted file mode 100644
index 3c3b3a6b2..000000000
--- a/chat/src/three-ui/pages/resources/TrustCenter.svelte
+++ /dev/null
@@ -1,63 +0,0 @@
-<script>
- const stats = [
- { label: 'SOC 2 Type II', detail: 'Audited annually by an independent third party.' },
- { label: 'GDPR Ready', detail: 'Data processing agreements available for EU customers.' },
- { label: '99.95% SLA', detail: 'Uptime commitment backed by service credits.' },
- ];
-
- const sections = [
- {
- title: 'Data handling',
- body: 'All data in transit is encrypted with TLS 1.3. Data at rest uses AES-256 encryption. We do not use customer data to train models. Retention windows are configurable per workspace, with hard-delete available on request.',
- },
- {
- title: 'Access controls',
- body: 'Role-based access control (RBAC) is available on all Business plans. SSO via SAML 2.0 and OIDC is supported. All user sessions are time-limited and MFA is enforced for admin roles.',
- },
- {
- title: 'Subprocessors',
- body: 'We maintain a current list of subprocessors. Customers on Business plans receive advance notice of any subprocessor changes and have the right to object. Our core infrastructure runs on AWS (us-east-1, eu-west-1).',
- },
- {
- title: 'Vulnerability disclosure',
- body: 'We operate a responsible disclosure program. Security researchers can report issues to [email protected]. Critical vulnerabilities are acknowledged within 24 hours and patched within 7 days where possible.',
- },
- ];
-
- const badges = ['SOC 2', 'ISO 27001', 'HIPAA', 'GDPR', 'CCPA', 'PCI'];
-</script>
-
-<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24">
- <h1 class="font-serif text-4xl font-semibold mb-2">Trust Center</h1>
- <p class="text-ink-soft text-base mb-12">Security, privacy, and compliance at three.ws</p>
-
- <!-- Stats row -->
- <div class="grid md:grid-cols-3 gap-4 mb-10">
- {#each stats as s}
- <div class="bg-white border border-rule rounded-2xl p-6">
- <div class="font-serif text-2xl font-semibold text-ink mb-1">{s.label}</div>
- <p class="text-sm text-ink-soft">{s.detail}</p>
- </div>
- {/each}
- </div>
-
- <!-- Content sections -->
- <div class="grid md:grid-cols-2 gap-4 mb-14">
- {#each sections as s}
- <div class="bg-white border border-rule rounded-2xl p-6">
- <h2 class="font-serif text-xl font-semibold mb-3 text-ink">{s.title}</h2>
- <p class="text-sm text-ink-soft leading-relaxed">{s.body}</p>
- </div>
- {/each}
- </div>
-
- <!-- Compliance badge grid -->
- <h2 class="font-serif text-2xl font-semibold mb-6 text-ink">Certifications &amp; frameworks</h2>
- <div class="grid grid-cols-3 md:grid-cols-6 gap-4">
- {#each badges as b}
- <div class="bg-paper border border-rule rounded-xl aspect-square flex items-center justify-center">
- <span class="text-xs font-semibold text-ink-soft text-center px-2">{b}</span>
- </div>
- {/each}
- </div>
-</div>
diff --git a/chat/src/three-ui/pages/resources/UpdatesTimeline.svelte b/chat/src/three-ui/pages/resources/UpdatesTimeline.svelte
deleted file mode 100644
index 30b9811fa..000000000
--- a/chat/src/three-ui/pages/resources/UpdatesTimeline.svelte
+++ /dev/null
@@ -1,58 +0,0 @@
-<script>
- const entries = [
- {
- date: 'April 2026',
- title: 'Multi-agent runs are now generally available',
- body: 'Parallel agent execution exits beta. You can now run up to 8 agents simultaneously on any Pro or Business plan, with shared context and cross-agent tool calls.',
- },
- {
- date: 'March 2026',
- title: 'Introducing Skills — reusable agent capabilities',
- body: 'Skills let you package a set of instructions, tools, and context into a shareable unit. Publish to the library or keep them private to your workspace.',
- },
- {
- date: 'February 2026',
- title: 'New composer with file and image support',
- body: 'The composer now accepts image uploads, PDFs, and spreadsheets. Agents can reference attachments directly within a task run.',
- },
- {
- date: 'January 2026',
- title: 'Deployments: run agents on a schedule',
- body: 'Set any agent to run on a cron schedule, trigger on webhook events, or expose it as a callable API endpoint. Available on Business plans.',
- },
- {
- date: 'December 2025',
- title: 'Memory and persistent context',
- body: 'Agents can now store facts across sessions using the built-in memory tool. Set a retention window or let the agent decide what to remember.',
- },
- {
- date: 'November 2025',
- title: 'three.ws is open to everyone',
- body: 'After six months in private beta we are opening three.ws to the public. Free accounts include 50 runs per month — no credit card required to get started.',
- },
- ];
-</script>
-
-<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24">
- <h1 class="font-serif text-4xl font-semibold mb-2">Updates</h1>
- <p class="text-ink-soft text-base mb-12">What's new in three.ws</p>
-
- <div class="relative">
- <!-- vertical line -->
- <div class="absolute left-[120px] top-0 bottom-0 w-px bg-rule"></div>
-
- <div class="space-y-10">
- {#each entries as e}
- <div class="flex gap-10">
- <time class="w-[100px] shrink-0 text-xs text-ink-faint uppercase tracking-wide pt-5 text-right">{e.date}</time>
- <div class="flex-1 pl-8">
- <div class="bg-white border border-rule rounded-2xl p-6 hover:bg-paper-deep transition-colors">
- <h2 class="font-serif text-xl font-semibold text-ink">{e.title}</h2>
- <p class="text-sm text-ink-soft mt-2 leading-relaxed">{e.body}</p>
- </div>
- </div>
- </div>
- {/each}
- </div>
- </div>
-</div>
diff --git a/chat/src/three-ui/pages/resources/UseCasesIndex.svelte b/chat/src/three-ui/pages/resources/UseCasesIndex.svelte
deleted file mode 100644
index 867bfe838..000000000
--- a/chat/src/three-ui/pages/resources/UseCasesIndex.svelte
+++ /dev/null
@@ -1,30 +0,0 @@
-<script>
- const cases = [
- { industry: 'Sales', headline: 'Cut SDR onboarding from 4 weeks to 3 days', summary: 'A B2B SaaS team automated prospect research, outreach drafting, and CRM hygiene with a single three.ws workflow.', logo: 'Acme Corp' },
- { industry: 'Legal', headline: 'Contract review time dropped by 70%', summary: 'A mid-size law firm runs first-pass contract analysis through three.ws, flagging high-risk clauses before human review.', logo: 'LexGroup' },
- { industry: 'Finance', headline: 'Weekly reporting from 6 hours to 12 minutes', summary: 'An investment ops team replaced manual data pulls with a scheduled three.ws agent that writes and delivers the report.', logo: 'CapitalCo' },
- { industry: 'E-commerce', headline: '3× more product listings, same headcount', summary: 'A marketplace seller generates optimized titles, descriptions, and alt-text for every new SKU automatically.', logo: 'ShopNow' },
- { industry: 'Healthcare', headline: 'Patient intake summaries in under 60 seconds', summary: 'A clinic uses three.ws to pull relevant history from notes and produce structured intake briefs before each appointment.', logo: 'Mediflow' },
- { industry: 'Engineering', headline: 'Code review backlog cleared in a day', summary: 'A 12-person engineering team uses three.ws to do first-pass reviews, catch lint issues, and suggest test cases automatically.', logo: 'DevCo' },
- { industry: 'Marketing', headline: 'Campaign briefs drafted in minutes, not days', summary: 'A growth team runs research, audience profiling, and copy generation inside one three.ws session before handing off to designers.', logo: 'GrowthLab' },
- { industry: 'Recruiting', headline: 'Screening volume up 5× without new headcount', summary: 'An internal TA team uses three.ws to screen inbound applications, draft personalized responses, and schedule interviews.', logo: 'HireHub' },
- ];
-</script>
-
-<div class="max-w-[1100px] mx-auto px-6 pt-16 pb-24">
- <h1 class="font-serif text-4xl font-semibold mb-2">Use Cases</h1>
- <p class="text-ink-soft text-base mb-12">How teams are putting three.ws to work</p>
-
- <div class="grid md:grid-cols-2 gap-6">
- {#each cases as c}
- <article class="bg-white border border-rule rounded-2xl p-6 hover:bg-paper-deep transition-colors cursor-pointer flex flex-col">
- <span class="inline-block text-xs uppercase tracking-wide text-ink-soft">{c.industry}</span>
- <h2 class="font-serif text-xl mt-2 text-ink leading-snug">{c.headline}</h2>
- <p class="text-sm text-ink-soft mt-2 line-clamp-2 flex-1">{c.summary}</p>
- <div class="mt-5 h-8 bg-paper rounded-lg flex items-center px-3">
- <span class="text-xs text-ink-faint font-medium">{c.logo}</span>
- </div>
- </article>
- {/each}
- </div>
-</div>
diff --git a/chat/src/three-ui/site-routes.js b/chat/src/three-ui/site-routes.js
new file mode 100644
index 000000000..441d71eb9
--- /dev/null
+++ b/chat/src/three-ui/site-routes.js
@@ -0,0 +1,66 @@
+// Retired marketing routes -> the real three.ws pages that own them.
+//
+// The chat app once carried its own copy of a marketing site (pricing, blog,
+// updates, use cases, a trust center, events, per-solution landing pages). None
+// of it was backed by real data, and the top nav stopped linking to any of it
+// when it switched to the shared CHAT_SITE_LINKS list, so the pages survived
+// only as hash routes that anyone with an old link could still land on.
+//
+// The platform already publishes every one of those surfaces for real at the
+// site root. Rather than 404 the old links, each retired hash resolves to the
+// live page that owns the topic, and App.svelte replaces the location with it.
+// Keeping this a pure function is deliberate: it is the one piece of the
+// removal that a test can hold onto.
+
+/** Exact hash route -> site path. */
+const EXACT = {
+ pricing: '/pricing',
+ 'resources/blog': '/blog',
+ 'resources/updates': '/changelog',
+ 'resources/docs': '/docs',
+ 'resources/use-cases': '/features',
+ 'resources/trust-center': '/docs/security',
+ 'business/security': '/docs/security',
+ 'business/contact-sales': '/support',
+};
+
+/** Route prefix -> site path, applied when no exact match wins. */
+const PREFIXES = [
+ ['resources/docs/', null], // handled below: carries the doc slug through
+ ['features/', '/features'],
+ ['solutions/', '/features'],
+ ['business/', '/features'],
+ ['events/', '/community'],
+];
+
+const DOC_SLUG = /^[a-z0-9][a-z0-9-]*$/;
+
+/**
+ * Resolve a chat hash route to the real site page that replaced it.
+ *
+ * @param {string} route hash route without the leading '#', e.g. 'resources/blog'
+ * @returns {string|null} an absolute site path, or null when the chat SPA still
+ * owns this route and must render it itself.
+ */
+export function siteRouteFor(route) {
+ if (typeof route !== 'string') return null;
+ const clean = route.trim().replace(/^\/+/, '').replace(/\/+$/, '');
+ if (!clean) return null;
+
+ if (Object.prototype.hasOwnProperty.call(EXACT, clean)) return EXACT[clean];
+
+ if (clean.startsWith('resources/docs/')) {
+ const slug = clean.slice('resources/docs/'.length);
+ return DOC_SLUG.test(slug) ? `/docs/${slug}` : '/docs';
+ }
+
+ for (const [prefix, target] of PREFIXES) {
+ if (target && clean.startsWith(prefix)) return target;
+ }
+
+ // A bare `resources` landing, or any resources sub-page the removal did not
+ // name, belongs with the docs.
+ if (clean === 'resources' || clean.startsWith('resources/')) return '/docs';
+
+ return null;
+}
diff --git a/chat/src/tools.js b/chat/src/tools.js
index cb3f5df26..e65251e0b 100644
--- a/chat/src/tools.js
+++ b/chat/src/tools.js
@@ -1,7 +1,7 @@
// Reusable client-side body that POSTs to /api/x402-pay and returns a
// structured envelope the LLM can reason over. Built once and shared by every
// x402-paid tool below so the on-chain payment + MCP dispatch happens for real
-// on every call — no mocks, no fallbacks.
+// on every call: no mocks, no fallbacks.
//
// Inputs: `tool` (string) → MCP tool name; `args` (object) → MCP arguments.
// Side-effects: dispatches a CustomEvent on window after settlement so the
@@ -16,7 +16,7 @@ if (agentId) {
try {
const ct = await fetch('/api/csrf-token', { credentials: 'include' });
if (ct.ok) { const cj = await ct.json().catch(() => null); const tok = cj && cj.data && cj.data.token; if (tok) headers['x-csrf-token'] = tok; }
- } catch (e) { /* fall through — server will 403 if the token is truly required */ }
+ } catch (e) { /* fall through: server will 403 if the token is truly required */ }
}
const r = await fetch('/api/x402-pay', {
method: 'POST',
@@ -324,7 +324,7 @@ export const curatedToolPacks = [
id: 'x402-pay',
name: 'three.ws · Pay-per-call (x402)',
description:
- 'Call real paid MCP tools on three.ws — every invocation signs an SPL transferChecked, pays $0.001 USDC on Solana mainnet, and settles on-chain. Same flow as /pay, surfaced as native chat tools.',
+ 'Call real paid MCP tools on three.ws: every invocation signs an SPL transferChecked, pays $0.001 USDC on Solana mainnet, and settles on-chain. Same flow as /pay, surfaced as native chat tools.',
schema: [
{
clientDefinition: {
@@ -447,7 +447,7 @@ const argsObj = q ? { q, limit } : { limit };
type: 'object',
properties: {
q: { type: 'string', description: 'Free-text query (name, traits, description). Omit to browse.' },
- limit: { type: 'integer', description: 'Max results (1–48, default 12).' },
+ limit: { type: 'integer', description: 'Max results (1-48, default 12).' },
},
required: [],
},
@@ -692,7 +692,7 @@ html,body{margin:0;height:100%;background:#0b0d10;color:#e5e7eb;font-family:ui-s
.up{color:#22c55e}.dn{color:#ef4444}
#err{position:absolute;inset:0;display:none;align-items:center;justify-content:center;color:#fca5a5;padding:24px;text-align:center}
</style></head><body>
-<div id="info"><div id="name">Loading…</div><div id="price">—</div><div id="chg">—</div></div>
+<div id="info"><div id="name">Loading…</div><div id="price">-</div><div id="chg">-</div></div>
<div id="err"></div>
<script type="module">
import * as THREE from 'https://esm.sh/[email protected]';
@@ -838,7 +838,7 @@ return JSON.stringify({ abstract: d.AbstractText || '', topics });`,
try { await window.solana?.connect(); } catch(e) { throw new Error('Solana wallet not connected: ' + (e?.message||e)); }
}
const pubkey = window.solana?.publicKey?.toBase58?.();
-if (!pubkey) throw new Error('No Solana public key available — connect a wallet first.');
+if (!pubkey) throw new Error('No Solana public key available. Connect a wallet first.');
const agentId = String(args.agent_id || '').trim();
const name = String(args.name || '').trim();
const symbol = String(args.symbol || '').trim();
@@ -1143,7 +1143,7 @@ return { mint, signature, metadataUri, explorer: 'https://solscan.io/tx/' + sign
name: 'ForgeTextTo3D',
description: 'Generate a 3D model (GLB) from a text prompt and render it in an orbit viewer.',
arguments: [
- { name: 'prompt', type: 'string', description: 'Single-subject object description, e.g. "a brass steampunk owl, full body". 3–1000 chars.' },
+ { name: 'prompt', type: 'string', description: 'Single-subject object description, e.g. "a brass steampunk owl, full body". 3-1000 chars.' },
],
body: `const prompt = String(args.prompt || '').trim();
// Submit on the host page (same-origin, cookies), then return an
@@ -1154,7 +1154,7 @@ return { mint, signature, metadataUri, explorer: 'https://solscan.io/tx/' + sign
if (prompt.length < 3) {
payload = { error: 'Describe one subject in at least 3 characters, e.g. "a brass steampunk owl, full body".', prompt };
} else if (prompt.length > 1000) {
- payload = { error: 'Keep the prompt under 1000 characters — one clear subject works best.', prompt };
+ payload = { error: 'Keep the prompt under 1000 characters. One clear subject works best.', prompt };
} else {
try {
const res = await fetch('/api/forge', { method: 'POST', headers: {'content-type':'application/json'}, credentials: 'include', body: JSON.stringify({ prompt }) });
@@ -1192,7 +1192,7 @@ return { mint, signature, metadataUri, explorer: 'https://solscan.io/tx/' + sign
parameters: {
type: 'object',
properties: {
- prompt: { type: 'string', description: 'Single-subject object description, e.g. "a brass steampunk owl, full body". 3–1000 characters.' },
+ prompt: { type: 'string', description: 'Single-subject object description, e.g. "a brass steampunk owl, full body". 3-1000 characters.' },
},
required: ['prompt'],
},
@@ -1204,7 +1204,7 @@ return { mint, signature, metadataUri, explorer: 'https://solscan.io/tx/' + sign
id: 'forge-avatar',
name: 'Text → 3D Avatar',
description:
- 'Generate a real, textured 3D avatar from a text prompt, auto-rig it into an animation-ready character, and save it to your three.ws avatar library — the full text → mesh → rig → library pipeline, rendered in an orbit viewer with a skeleton toggle.',
+ 'Generate a real, textured 3D avatar from a text prompt, auto-rig it into an animation-ready character, and save it to your three.ws avatar library: the full text → mesh → rig → library pipeline, rendered in an orbit viewer with a skeleton toggle.',
schema: [
{
clientDefinition: {
@@ -1212,12 +1212,12 @@ return { mint, signature, metadataUri, explorer: 'https://solscan.io/tx/' + sign
name: 'ForgeAvatar',
description: 'Generate a 3D avatar (GLB) from a text prompt, auto-rig it, save it to the avatar library, and render it in an orbit viewer.',
arguments: [
- { name: 'prompt', type: 'string', description: 'Single-subject avatar description, e.g. "a friendly cyberpunk fox mascot, full body". 3–1000 chars.' },
+ { name: 'prompt', type: 'string', description: 'Single-subject avatar description, e.g. "a friendly cyberpunk fox mascot, full body". 3-1000 chars.' },
{ name: 'name', type: 'string', description: 'Optional name for the saved avatar (defaults to the prompt).' },
{ name: 'save', type: 'boolean', description: 'Save the rigged avatar to the signed-in user library (default true). Set false to only preview.' },
],
body: `const prompt = String(args.prompt || '').trim();
-if (prompt.length < 3) throw new Error('prompt required (3–1000 chars)');
+if (prompt.length < 3) throw new Error('prompt required (3-1000 chars)');
const wantSave = args.save !== false;
const avatarName = (String(args.name || '').trim() || prompt).slice(0, 80);
async function pollForge(jobId, tries) {
@@ -1237,7 +1237,7 @@ const job = await submit.json();
if (!job.job_id) throw new Error('Forge returned no job id');
let state = await pollForge(job.job_id, 75);
if (!state || state.status === 'failed') throw new Error('Generation failed: ' + ((state && state.error) || 'unknown error'));
-if (state.status !== 'done') throw new Error('Generation timed out after ~3 minutes — try again or open three.ws/forge');
+if (state.status !== 'done') throw new Error('Generation timed out after ~3 minutes. Try again or open three.ws/forge');
let glb = state.glb_url;
if (!glb) throw new Error('Job finished without a model URL');
let rigged = false, rigNote = '';
@@ -1248,14 +1248,14 @@ try {
if (rj.job_id) {
const rstate = await pollForge(rj.job_id, 60);
if (rstate && rstate.status === 'done' && rstate.glb_url) { glb = rstate.glb_url; rigged = true; }
- else rigNote = (rstate && rstate.error) ? ('Rigging failed (' + rstate.error + ') — using the static mesh.') : 'Rigging did not finish — using the static mesh.';
- } else rigNote = 'Rigging returned no job — using the static mesh.';
+ else rigNote = (rstate && rstate.error) ? ('Rigging failed (' + rstate.error + '). Using the static mesh.') : 'Rigging did not finish. Using the static mesh.';
+ } else rigNote = 'Rigging returned no job. Using the static mesh.';
} else if (rs.status === 501) {
- rigNote = 'Auto-rigging is not enabled on this deployment — using the static mesh.';
+ rigNote = 'Auto-rigging is not enabled on this deployment. Using the static mesh.';
} else {
- rigNote = 'Rigging unavailable (' + rs.status + ') — using the static mesh.';
+ rigNote = 'Rigging unavailable (' + rs.status + '). Using the static mesh.';
}
-} catch (e) { rigNote = 'Rigging error — using the static mesh.'; }
+} catch (e) { rigNote = 'Rigging error. Using the static mesh.'; }
let savedUrl = '', saveNote = '';
if (wantSave) {
try {
@@ -1291,11 +1291,11 @@ return {
function: {
name: 'ForgeAvatar',
description:
- 'Generate a real 3D AVATAR from a text prompt: forge a textured GLB, auto-rig it into an animation-ready character, save it to the signed-in user three.ws avatar library, and render it in an interactive orbit viewer (press S for the skeleton). Use whenever the user asks to make, create, or generate an AVATAR, character, or agent body from a description (use ForgeTextTo3D instead for a generic object/prop). Takes ~1–3 min. Describe ONE full-body subject with material and style. If the user is not signed in, it still returns the rigged model and notes that sign-in is needed to save.',
+ 'Generate a real 3D AVATAR from a text prompt: forge a textured GLB, auto-rig it into an animation-ready character, save it to the signed-in user three.ws avatar library, and render it in an interactive orbit viewer (press S for the skeleton). Use whenever the user asks to make, create, or generate an AVATAR, character, or agent body from a description (use ForgeTextTo3D instead for a generic object/prop). Takes ~1-3 min. Describe ONE full-body subject with material and style. If the user is not signed in, it still returns the rigged model and notes that sign-in is needed to save.',
parameters: {
type: 'object',
properties: {
- prompt: { type: 'string', description: 'Single-subject, full-body avatar description, e.g. "a friendly cyberpunk fox mascot, full body". 3–1000 characters.' },
+ prompt: { type: 'string', description: 'Single-subject, full-body avatar description, e.g. "a friendly cyberpunk fox mascot, full body". 3-1000 characters.' },
name: { type: 'string', description: 'Optional name for the saved avatar. Defaults to the prompt.' },
save: { type: 'boolean', description: 'Whether to save the rigged avatar to the library (default true).' },
},
@@ -1391,7 +1391,7 @@ return {
name: 'TokenGateScene',
description: 'Token-gate the current scene and return a share URL.',
arguments: [
- { name: 'sceneRef', type: 'string', description: 'Identifier for the current scene (the chat already exposes one via the viewer share API — pass the same string the existing /share command uses).' },
+ { name: 'sceneRef', type: 'string', description: 'Identifier for the current scene (the chat already exposes one via the viewer share API, pass the same string the existing /share command uses).' },
{ name: 'chain', type: 'string', description: 'solana | evm' },
{ name: 'kind', type: 'string', description: 'spl | collection | erc20 | erc721' },
{ name: 'address', type: 'string', description: 'Token mint, collection address, or contract address.' },
@@ -1728,7 +1728,7 @@ export const pumpToolSchema = {
type: 'function',
function: {
name: 'getKingOfTheHill',
- description: 'Get the king of the hill — the highest market cap pump.fun token still on the bonding curve.',
+ description: 'Get the king of the hill: the highest market cap pump.fun token still on the bonding curve.',
parameters: { type: 'object', properties: {} },
},
},
@@ -1966,7 +1966,7 @@ export const agentPaymentsToolSchema = {
type: 'object',
properties: {
mint: { type: 'string', description: 'Agent token mint address (base58)' },
- currency_mint: { type: 'string', description: 'Currency mint — USDC or wSOL (default USDC)' },
+ currency_mint: { type: 'string', description: 'Currency mint: USDC or wSOL (default USDC)' },
},
required: ['mint'],
},
@@ -1986,7 +1986,7 @@ export const agentPaymentsToolSchema = {
type: 'function',
function: {
name: 'agentPaymentsDistribute',
- description: 'Distribute the payment vault — splits funds into buyback vault and withdraw vault per on-chain BPS config. Permissionless.',
+ description: 'Distribute the payment vault: splits funds into buyback vault and withdraw vault per on-chain BPS config. Permissionless.',
parameters: {
type: 'object',
properties: {
diff --git a/chat/src/util.js b/chat/src/util.js
index fabc9336a..0e7bff431 100644
--- a/chat/src/util.js
+++ b/chat/src/util.js
@@ -124,13 +124,13 @@ function stripCodeFence(text) {
* genuinely unparseable. The raw payload is attached as `err.payload`.
*/
export function parseToolCallArguments(raw) {
- // Already an object (and not null) — providers that hand back parsed args.
+ // Already an object (and not null): providers that hand back parsed args.
if (raw !== null && typeof raw === 'object') {
return raw;
}
if (typeof raw !== 'string') {
- // null / undefined / number — treat as "no arguments".
+ // null / undefined / number: treat as "no arguments".
return {};
}
@@ -149,7 +149,7 @@ export function parseToolCallArguments(raw) {
} catch (err) {
const message = err instanceof Error ? err.message : String(err);
const wrapped = new Error(message);
- // @ts-ignore — attach the offending payload for diagnostics/UI.
+ // @ts-ignore: attach the offending payload for diagnostics/UI.
wrapped.payload = raw;
throw wrapped;
}
diff --git a/chat/vite.config.js b/chat/vite.config.js
index 83dff877a..57fd10f00 100644
--- a/chat/vite.config.js
+++ b/chat/vite.config.js
@@ -62,7 +62,7 @@ export default defineConfig(function () {
strictPort: true,
fs: {
// The chat app reuses shared wallet modules that live in the main
- // repo's src/ (one repo, one wallet truth) — allow Vite to serve them.
+ // repo's src/ (one repo, one wallet truth), so allow Vite to serve them.
allow: [path.resolve(__dirname, '..')],
},
proxy: {
diff --git a/prompts/swarm-100/sdk-chat.md b/prompts/swarm-100/sdk-chat.md
deleted file mode 100644
index c9a2856f1..000000000
--- a/prompts/swarm-100/sdk-chat.md
+++ /dev/null
@@ -1,89 +0,0 @@
-# Module audit: chat/
-
-How to run: paste this file's repo path into a fresh Claude Code chat in this
-repository and say "run this work order". This file is fully self-contained:
-it depends on no other prompt file anywhere. If neighboring files in
-prompts/swarm-100/ are gone, that work is done; if present, ignore them.
-Every claim below rots; step 0 re-measures, and what you measure wins.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first. Its rules override everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option
- list, or an unexecuted plan. A judgment call goes in one line of the final
- report; it never becomes a question that halts work.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real
- funds or any irreversible on-chain write, git push or a production deploy,
- committing content that references a crypto project other than $THREE, and
- destroying unrecoverable data.
-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no
- commented-out code. Real APIs and real integrations only.
-- The em-dash and en-dash characters are banned in everything you write.
-- Concurrent agents share this worktree: stage explicit paths only (never a
- bare add-everything), and commit finished work promptly.
-- Before committing, run: npm run check:rules -- --paths <files you touched>.
- It must exit 0.
-
-## Step 0: re-derive the current state
-
-1. Read chat/README.md and chat/package.json (or the equivalent manifest).
-2. Find every consumer: grep the repo for imports of this module and check
- STRUCTURE.md for the surfaces it powers.
-
-## Task: bring chat/ to verified-shippable
-
-1. Build it with its own build script; the build must succeed from this
- worktree.
-2. Run its tests; add a core-path test if none proves the main export works.
-3. README quickstart: execute it verbatim as a new user would. Every command
- must run, every code sample must work. Fix drift in the same change.
-4. Public API: import the declared entry points with node and confirm they
- load. Exported functions the README documents must exist and behave as
- documented.
-5. Hard-rule scan across its source: no stubs, no mock data, no unfinished
- markers, no commented-out code.
-6. If this module publishes an artifact consumed elsewhere (a UMD bundle, a
- published npm package, a served static build), verify the wiring that
- produces the artifact still works; never hand-edit generated output.
-
-## Definition of done
-
-- [ ] Build green from this worktree.
-- [ ] Tests green, core path covered.
-- [ ] README quickstart executed successfully end to end.
-- [ ] Entry points import cleanly; documented API verified real.
-- [ ] Zero hard-rule violations remain in this module.
-- [ ] npm run check:rules -- --paths <touched files> exits 0.
-
-## Never blocked
-
-| Blocker | Resolution (act, do not ask) |
-|---|---|
-| Missing env var or credential | Check .env and .env.local, then the Cloud Run service env, then Secret Manager (the CLAUDE.md self-unblock playbook has the exact commands). If it truly exists nowhere, wire the code fully behind the env var, prove the wiring with a dry run, and name the single missing var in the report. |
-| gcloud not on PATH | Run: export PATH="$HOME/google-cloud-sdk/bin:$PATH" |
-| Dev server port 3000 busy | Another agent may be serving this repo; probe it and reuse if so. Otherwise start your own on a free port: npx vite --port 3101 |
-| Playwright browser missing | npx playwright install chromium |
-| A surface needs a signed-in user | Register a fresh account through the real /register flow against the real API and use it. Never mock the session. |
-| A defect sits in code you did not touch | Fix it if it blocks a Definition of done line (root cause it, never mask it). Otherwise note it in the report and continue. |
-| An unrelated test is red | Same rule. Never pipe npm test through tail; it masks exit codes. |
-
-## Close out (required)
-
-1. Verify every Definition of done line with the actual command output in
- front of you. Never claim a line you did not verify.
-2. Commit with explicit paths and a subject that describes the diff (house
- style: type(scope): what changed and why a reader cares).
-3. Delete this prompt file in that same commit:
-
- git rm prompts/swarm-100/sdk-chat.md
-
- The shrinking directory is this campaign's only progress ledger; there is
- no progress log to update.
-4. Final report: what step 0 measured, what changed (file list), evidence per
- Definition of done line, and any one-line judgment calls. No trailing
- questions, no unexecuted plans.
-
-If a line genuinely cannot pass inside this session (an external party must
-respond, or an owner-gated action is the final step), finish everything else,
-leave this file in place, and state exactly which line remains and who owns
-it. Never delete this file on a partial.
diff --git a/tests/chat-app-core.test.js b/tests/chat-app-core.test.js
new file mode 100644
index 000000000..2b130ca45
--- /dev/null
+++ b/tests/chat-app-core.test.js
@@ -0,0 +1,300 @@
+// Core-path coverage for the chat/ app (three.ws/chat).
+//
+// chat/ is a Svelte SPA, so most of it is only exercised in a browser. These
+// are the pure, load-bearing modules underneath it: the model-selection layer
+// the composer opens on, the tool-call argument codec every provider reply goes
+// through, the fund-moving-tool gate that decides whether a wallet call is
+// preflighted through GuardChain, the credential auth the sign-in form posts,
+// and the retired-marketing-route resolver that keeps old /chat links alive.
+//
+// Nothing here is stubbed except the browser globals the modules read at import
+// time (localStorage) and the one network call each auth helper makes.
+import { describe, it, expect, beforeAll, afterEach, vi } from 'vitest';
+
+// chat/src/stores.js persists settings through localStorage at module scope, so
+// the shim has to exist before providers.js is imported.
+beforeAll(() => {
+ if (typeof globalThis.localStorage === 'undefined') {
+ const mem = new Map();
+ globalThis.localStorage = {
+ getItem: (k) => (mem.has(k) ? mem.get(k) : null),
+ setItem: (k, v) => void mem.set(k, String(v)),
+ removeItem: (k) => void mem.delete(k),
+ clear: () => mem.clear(),
+ };
+ }
+});
+
+describe('chat/src/three-ui/site-routes.js', () => {
+ let siteRouteFor;
+ beforeAll(async () => {
+ ({ siteRouteFor } = await import('../chat/src/three-ui/site-routes.js'));
+ });
+
+ it('leaves the routes the chat SPA still owns alone', () => {
+ for (const route of ['chat', 'signin', 'signup', 'dashboard/revenue', '']) {
+ expect(siteRouteFor(route)).toBeNull();
+ }
+ });
+
+ it('sends every retired marketing route to a real site page', () => {
+ expect(siteRouteFor('pricing')).toBe('/pricing');
+ expect(siteRouteFor('resources/blog')).toBe('/blog');
+ expect(siteRouteFor('resources/updates')).toBe('/changelog');
+ expect(siteRouteFor('resources/use-cases')).toBe('/features');
+ expect(siteRouteFor('resources/trust-center')).toBe('/docs/security');
+ expect(siteRouteFor('business/security')).toBe('/docs/security');
+ expect(siteRouteFor('business/contact-sales')).toBe('/support');
+ expect(siteRouteFor('business/enterprise')).toBe('/features');
+ expect(siteRouteFor('solutions/sales')).toBe('/features');
+ expect(siteRouteFor('features/web-app')).toBe('/features');
+ expect(siteRouteFor('events/webinars')).toBe('/community');
+ });
+
+ it('carries a docs slug through to the real docs page', () => {
+ expect(siteRouteFor('resources/docs')).toBe('/docs');
+ expect(siteRouteFor('resources/docs/quick-start')).toBe('/docs/quick-start');
+ expect(siteRouteFor('resources/docs/x402')).toBe('/docs/x402');
+ });
+
+ it('refuses to build a path out of a hostile slug', () => {
+ // A slug that is not a plain doc name must not become part of the URL.
+ expect(siteRouteFor('resources/docs/../../etc/passwd')).toBe('/docs');
+ expect(siteRouteFor('resources/docs/Evil%20Thing')).toBe('/docs');
+ expect(siteRouteFor('resources/docs/a b')).toBe('/docs');
+ });
+
+ it('normalizes stray slashes and non-strings', () => {
+ expect(siteRouteFor('/pricing')).toBe('/pricing');
+ expect(siteRouteFor('pricing/')).toBe('/pricing');
+ expect(siteRouteFor(null)).toBeNull();
+ expect(siteRouteFor(undefined)).toBeNull();
+ expect(siteRouteFor(42)).toBeNull();
+ });
+
+ it('never points at a page the site does not publish', async () => {
+ const { readFile } = await import('node:fs/promises');
+ const features = JSON.parse(
+ await readFile(new URL('../public/features.json', import.meta.url), 'utf8')
+ );
+ const published = new Set(features.sections.flatMap((s) => s.pages.map((p) => p.path)));
+ const targets = [
+ siteRouteFor('pricing'),
+ siteRouteFor('resources/blog'),
+ siteRouteFor('resources/updates'),
+ siteRouteFor('resources/docs'),
+ siteRouteFor('resources/use-cases'),
+ siteRouteFor('resources/trust-center'),
+ siteRouteFor('business/contact-sales'),
+ siteRouteFor('features/web-app'),
+ siteRouteFor('events/webinars'),
+ ];
+ for (const target of targets) {
+ expect(published.has(target), `${target} is not declared in data/pages.json`).toBe(true);
+ }
+ });
+});
+
+describe('chat/src/util.js tool-call argument codec', () => {
+ let parseToolCallArguments, serializeToolCallArguments;
+ beforeAll(async () => {
+ ({ parseToolCallArguments, serializeToolCallArguments } = await import('../chat/src/util.js'));
+ });
+
+ it('passes an already-parsed arguments object straight through', () => {
+ const args = { prompt: 'a brass owl' };
+ expect(parseToolCallArguments(args)).toBe(args);
+ });
+
+ it('treats an absent payload as no arguments', () => {
+ expect(parseToolCallArguments(null)).toEqual({});
+ expect(parseToolCallArguments(undefined)).toEqual({});
+ expect(parseToolCallArguments('')).toEqual({});
+ expect(parseToolCallArguments(' ')).toEqual({});
+ });
+
+ it('decodes a JSON string, including one a model wrapped in a code fence', () => {
+ expect(parseToolCallArguments('{"limit":5}')).toEqual({ limit: 5 });
+ expect(parseToolCallArguments('```json\n{"limit":5}\n```')).toEqual({ limit: 5 });
+ });
+
+ it('rejects a bare scalar and keeps the payload for diagnostics', () => {
+ expect(() => parseToolCallArguments('"just a string"')).toThrow();
+ try {
+ parseToolCallArguments('{not json');
+ throw new Error('should have thrown');
+ } catch (err) {
+ expect(err.payload).toBe('{not json');
+ }
+ });
+
+ it('round-trips without double-encoding a value that is already a string', () => {
+ expect(serializeToolCallArguments({ a: 1 })).toBe('{"a":1}');
+ expect(serializeToolCallArguments('{"a":1}')).toBe('{"a":1}');
+ expect(serializeToolCallArguments(undefined)).toBe('{}');
+ expect(parseToolCallArguments(serializeToolCallArguments({ a: 1 }))).toEqual({ a: 1 });
+ });
+});
+
+describe('chat/src/guard.js fund-moving tool gate', () => {
+ let isFundMovingTool;
+ beforeAll(async () => {
+ ({ isFundMovingTool } = await import('../chat/src/guard.js'));
+ });
+
+ it('flags every tool that moves value out of the connected wallet', () => {
+ for (const name of [
+ 'solana_transfer',
+ 'solana_swap',
+ 'evm_transfer',
+ 'evm_swap',
+ 'pumpfunBuy',
+ 'pumpfunSell',
+ 'pumpfunSellAll',
+ 'LaunchPumpToken',
+ 'MintScene',
+ 'agentPaymentsDistribute',
+ 'agentPaymentsWithdraw',
+ ]) {
+ expect(isFundMovingTool(name), `${name} must be preflighted`).toBe(true);
+ }
+ });
+
+ it('leaves read-only tools out of the preflight path', () => {
+ for (const name of ['ForgeTextTo3D', 'ForgeAvatar', 'pumpfunKingOfTheHill', undefined, '']) {
+ expect(isFundMovingTool(name)).toBe(false);
+ }
+ });
+});
+
+describe('chat/src/providers.js model selection', () => {
+ let resolveDefaultModel, headersForFetch, hasCompanyLogo, BUILTIN_MODELS;
+ beforeAll(async () => {
+ ({ resolveDefaultModel, headersForFetch, hasCompanyLogo, BUILTIN_MODELS } = await import(
+ '../chat/src/providers.js'
+ ));
+ });
+
+ it('opens on the configured default when the server still serves it', () => {
+ const live = [{ id: 'a/one' }, { id: 'b/two' }];
+ expect(resolveDefaultModel(live, 'b/two')).toEqual({ id: 'b/two' });
+ });
+
+ it('falls back to a live model when the configured default was retired', () => {
+ // This is the rung that keeps chat working through an OpenRouter free
+ // endpoint retirement without a redeploy.
+ const live = [{ id: 'a/one' }, { id: 'b/two' }];
+ expect(resolveDefaultModel(live, 'gone/model')).toEqual({ id: 'a/one' });
+ });
+
+ it('falls back to the local seed only when the server returned nothing', () => {
+ expect(resolveDefaultModel([], 'gone/model')).toBe(BUILTIN_MODELS[0]);
+ expect(resolveDefaultModel(null, null)).toBe(BUILTIN_MODELS[0]);
+ });
+
+ it('sends each provider the auth header it actually expects', () => {
+ const key = () => 'test-key';
+ const openrouter = headersForFetch({ name: 'OpenRouter', apiKeyFn: key });
+ expect(openrouter.Authorization).toBe('Bearer test-key');
+ expect(openrouter['HTTP-Referer']).toBe('https://three.ws');
+
+ const anthropic = headersForFetch({ name: 'Anthropic', apiKeyFn: key }, { kind: 'reasoner' });
+ expect(anthropic['x-api-key']).toBe('test-key');
+ expect(anthropic.Authorization).toBeUndefined();
+ expect(anthropic['anthropic-version']).toBe('2023-06-01');
+ expect(anthropic['anthropic-beta']).toBe('output-128k-2025-02-19');
+
+ // A non-reasoner Anthropic call must not ask for the extended output beta.
+ expect(
+ headersForFetch({ name: 'Anthropic', apiKeyFn: key }, { kind: 'chat' })['anthropic-beta']
+ ).toBeUndefined();
+
+ // Ollama is local and keyless: no Authorization header at all.
+ expect(headersForFetch({ name: 'Ollama', apiKeyFn: key }).Authorization).toBeUndefined();
+ });
+
+ it('only claims a company logo for models it can actually draw one for', () => {
+ expect(hasCompanyLogo({ provider: 'OpenRouter', id: 'anthropic/claude-3.5-sonnet' })).toBe(true);
+ expect(hasCompanyLogo({ provider: 'Anthropic', id: 'claude-opus-4-6' })).toBe(true);
+ expect(hasCompanyLogo({ provider: 'Built-in', id: 'someone/unknown-model' })).toBe(false);
+ expect(hasCompanyLogo(null)).toBeFalsy();
+ });
+});
+
+describe('chat/src/passwordAuth.js', () => {
+ let authErrorMessage, signInWithPassword, registerWithPassword;
+ beforeAll(async () => {
+ ({ authErrorMessage, signInWithPassword, registerWithPassword } = await import(
+ '../chat/src/passwordAuth.js'
+ ));
+ });
+
+ afterEach(() => {
+ vi.unstubAllGlobals();
+ });
+
+ it('turns each auth-API error code into a sentence a person can act on', () => {
+ expect(authErrorMessage(401, { error: 'invalid_credentials' })).toMatch(/not right/);
+ expect(authErrorMessage(409, { error: 'conflict' })).toMatch(/already exists/);
+ expect(authErrorMessage(400, { error: 'tos_required' })).toMatch(/Terms of Service/);
+ expect(authErrorMessage(429, {})).toMatch(/Too many attempts/);
+ expect(authErrorMessage(503, {})).toMatch(/unavailable/);
+ // A validation failure surfaces the server's own description, never a code.
+ expect(
+ authErrorMessage(400, { error: 'validation_error', error_description: 'password too short' })
+ ).toBe('password too short');
+ });
+
+ it('posts login credentials same-origin with the session cookie', async () => {
+ const calls = [];
+ vi.stubGlobal('fetch', async (url, init) => {
+ calls.push({ url, init });
+ return { ok: true, json: async () => ({ user: { id: 'u1' } }) };
+ });
+ const user = await signInWithPassword({ email: ' [email protected] ', password: 'hunter22' });
+ expect(user).toEqual({ id: 'u1' });
+ expect(calls[0].url).toBe('/api/auth/login');
+ expect(calls[0].init.credentials).toBe('include');
+ expect(JSON.parse(calls[0].init.body)).toEqual({
+ email: '[email protected]',
+ password: 'hunter22',
+ });
+ });
+
+ it('always sends the Terms clickwrap the register endpoint requires', async () => {
+ const bodies = [];
+ vi.stubGlobal('fetch', async (_url, init) => {
+ bodies.push(JSON.parse(init.body));
+ return { ok: true, json: async () => ({ user: { id: 'u2' } }) };
+ });
+ await registerWithPassword({
+ email: '[email protected]',
+ password: 'hunter22',
+ displayName: ' Ada ',
+ tosAccepted: true,
+ });
+ expect(bodies[0]).toEqual({
+ email: '[email protected]',
+ password: 'hunter22',
+ tosAccepted: true,
+ display_name: 'Ada',
+ });
+
+ // An unchecked box is sent as an explicit false, never omitted, so the
+ // server refusal is the one the user sees.
+ await registerWithPassword({ email: '[email protected]', password: 'hunter22', tosAccepted: undefined });
+ expect(bodies[1].tosAccepted).toBe(false);
+ expect(bodies[1].display_name).toBeUndefined();
+ });
+
+ it('raises the mapped message when the API refuses', async () => {
+ vi.stubGlobal('fetch', async () => ({
+ ok: false,
+ status: 401,
+ json: async () => ({ error: 'invalid_credentials' }),
+ }));
+ await expect(signInWithPassword({ email: '[email protected]', password: 'nope' })).rejects.toThrow(
+ /not right/
+ );
+ });
+});