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.

feat(atlas): feature atlas, tour captures, and flow map

nirholasa5f13083007b
diff --git a/data/atlas-intents.json b/data/atlas-intents.json
new file mode 100644
index 000000000..c8e9faa1f
--- /dev/null
+++ b/data/atlas-intents.json
@@ -0,0 +1,319 @@
+{
+ "$comment": "Curated task intents for the Atlas command palette (public/atlas.js). An intent answers a goal with ordered steps instead of a single link, because the hard part of this product is knowing which of several plausible pages STARTS a flow. Every `to` is validated against data/pages.json by scripts/build-atlas-index.mjs; a step pointing at a route that does not exist fails the build. Keep `match` phrases in the words a newcomer would actually type, not our internal feature names.",
+ "intents": [
+ {
+ "id": "first-time",
+ "title": "I am new here. Where do I start?",
+ "blurb": "The shortest path from nothing to a live 3D agent on your own page.",
+ "match": [
+ "get started",
+ "start",
+ "new here",
+ "begin",
+ "first time",
+ "onboarding",
+ "how do i use this",
+ "what do i do",
+ "quickstart",
+ "tutorial",
+ "help"
+ ],
+ "steps": [
+ { "do": "Walk the guided setup. It asks three questions and creates your first agent.", "to": "/start" },
+ { "do": "Give it a body: describe the avatar you want and generate it.", "to": "/create/prompt" },
+ { "do": "Put it on a page. Widget Studio writes the embed code for you.", "to": "/studio" }
+ ]
+ },
+ {
+ "id": "make-avatar",
+ "title": "Make a 3D avatar",
+ "blurb": "Text to a rigged, animation-ready GLB.",
+ "match": [
+ "make an avatar",
+ "create avatar",
+ "3d avatar",
+ "generate character",
+ "text to 3d",
+ "new avatar",
+ "build a character",
+ "make a character"
+ ],
+ "steps": [
+ { "do": "Describe the avatar you want. The forge returns a rigged GLB.", "to": "/create/prompt" },
+ { "do": "Pose and animate it in the Animation Studio.", "to": "/pose" },
+ { "do": "Browse what others made if you would rather start from an existing one.", "to": "/gallery" }
+ ]
+ },
+ {
+ "id": "avatar-from-photo",
+ "title": "Turn a photo into a 3D avatar",
+ "blurb": "A selfie or a product photo becomes a textured 3D model.",
+ "match": [
+ "selfie",
+ "photo to 3d",
+ "image to 3d",
+ "picture to model",
+ "scan myself",
+ "turn a photo into",
+ "from a photo",
+ "my face"
+ ],
+ "steps": [
+ { "do": "Use Selfie to Avatar for a person.", "to": "/create/selfie" },
+ { "do": "Use Image to 3D for an object or a product shot.", "to": "/image-to-3d" },
+ { "do": "Need the highest fidelity? Forge Max runs the slow, high-quality lane.", "to": "/forge-max" }
+ ]
+ },
+ {
+ "id": "embed-on-site",
+ "title": "Put an avatar on my website",
+ "blurb": "One script tag and one custom element. Works in plain HTML, React, and Next.js.",
+ "match": [
+ "embed",
+ "add to my website",
+ "put on my site",
+ "integrate",
+ "script tag",
+ "iframe",
+ "react",
+ "next.js",
+ "web component",
+ "install on my page"
+ ],
+ "steps": [
+ { "do": "Build the widget visually and copy the generated snippet.", "to": "/studio" },
+ { "do": "Follow the 30-second version if you just want the two lines.", "to": "/tutorials/embed-in-30-seconds" },
+ { "do": "Framework-specific setup for React and Next.js.", "to": "/tutorials/embed-on-website" }
+ ]
+ },
+ {
+ "id": "create-agent",
+ "title": "Create an AI agent",
+ "blurb": "An agent with a body, a mind, a wallet, and an on-chain identity.",
+ "match": [
+ "create an agent",
+ "make an agent",
+ "new agent",
+ "ai agent",
+ "build a bot",
+ "my agent",
+ "agent identity"
+ ],
+ "steps": [
+ { "do": "Create the agent and give it a name, a personality, and a model.", "to": "/create-agent" },
+ { "do": "Tune its behaviour, tools, and voice in Agent Studio.", "to": "/agent-studio" },
+ { "do": "Manage everything you own from My Agents.", "to": "/my-agents", "note": "Requires sign-in" }
+ ]
+ },
+ {
+ "id": "launch-coin",
+ "title": "Launch a coin",
+ "blurb": "Mint a token for your agent on pump.fun, from the platform.",
+ "match": [
+ "launch a coin",
+ "launch token",
+ "mint a token",
+ "pump fun",
+ "pumpfun",
+ "create a coin",
+ "new token",
+ "memecoin",
+ "ticker"
+ ],
+ "steps": [
+ { "do": "Launch the coin. Name, ticker, image, and the initial buy.", "to": "/launch" },
+ { "do": "Read what each field does before you sign anything.", "to": "/docs/pump-launcher" },
+ { "do": "Watch it land in the platform launch feed.", "to": "/launches" }
+ ]
+ },
+ {
+ "id": "get-paid",
+ "title": "Get paid per API call",
+ "blurb": "Meter any endpoint with x402 and let other agents pay to use it.",
+ "match": [
+ "get paid",
+ "make money",
+ "monetize",
+ "charge for my api",
+ "paid endpoint",
+ "sell a service",
+ "earn",
+ "revenue",
+ "x402 server",
+ "per call"
+ ],
+ "steps": [
+ { "do": "Wire the paywall in x402 Studio.", "to": "/x402/studio" },
+ { "do": "Follow the worked example of a paid endpoint end to end.", "to": "/tutorials/paid-x402-endpoint" },
+ { "do": "Watch the receipts and revenue come in.", "to": "/x402-revenue" }
+ ]
+ },
+ {
+ "id": "pay-for-service",
+ "title": "Pay another agent for a service",
+ "blurb": "Discover a paid endpoint and settle the call in USDC.",
+ "match": [
+ "pay for",
+ "buy a service",
+ "x402 client",
+ "call a paid api",
+ "402",
+ "discover services",
+ "bazaar",
+ "spend"
+ ],
+ "steps": [
+ { "do": "Browse every paid endpoint the network exposes.", "to": "/x402" },
+ { "do": "Follow the discover-and-pay walkthrough.", "to": "/tutorials/pay-for-x402-service" },
+ { "do": "Fund the wallet your agent pays from.", "to": "/wallet", "note": "Requires sign-in" }
+ ]
+ },
+ {
+ "id": "use-mcp",
+ "title": "Connect this to Claude or another MCP client",
+ "blurb": "Give your assistant 3D generation, wallets, and market intel as tools.",
+ "match": [
+ "mcp",
+ "claude",
+ "cursor",
+ "model context protocol",
+ "connect my assistant",
+ "tools for my ai",
+ "claude desktop"
+ ],
+ "steps": [
+ { "do": "Browse every tool the MCP servers expose.", "to": "/mcp-tools" },
+ { "do": "Copy the client config for your assistant.", "to": "/docs/mcp" },
+ { "do": "Start with the free 3D Studio server if you want zero setup.", "to": "/docs/mcp-studio" }
+ ]
+ },
+ {
+ "id": "animate",
+ "title": "Animate or pose an avatar",
+ "blurb": "Clips, gestures, and mocap on any humanoid rig.",
+ "match": [
+ "animate",
+ "animation",
+ "pose",
+ "walk cycle",
+ "idle",
+ "gesture",
+ "mocap",
+ "motion",
+ "make it move",
+ "dance"
+ ],
+ "steps": [
+ { "do": "Pose and preview clips on your own model.", "to": "/pose" },
+ { "do": "Browse the clip library and copy the one you want.", "to": "/animations" },
+ { "do": "Map gestures to your agent's reactions.", "to": "/gestures" }
+ ]
+ },
+ {
+ "id": "talking-avatar",
+ "title": "Make my avatar talk",
+ "blurb": "Lip-synced speech, a voice, and an exportable video.",
+ "match": [
+ "talk",
+ "speech",
+ "voice",
+ "lip sync",
+ "talking head",
+ "say something",
+ "video",
+ "tts",
+ "speaking avatar"
+ ],
+ "steps": [
+ { "do": "Pick or clone a voice in the Voice Lab.", "to": "/voice" },
+ { "do": "Render a lip-synced talking video from a script.", "to": "/create/video" },
+ { "do": "Drive the same avatar live from your webcam.", "to": "/temporary" }
+ ]
+ },
+ {
+ "id": "sell-agent",
+ "title": "List or sell an agent",
+ "blurb": "Publish to the marketplace and let others fork or buy it.",
+ "match": [
+ "sell",
+ "list my agent",
+ "marketplace",
+ "publish",
+ "share my agent",
+ "fork",
+ "storefront"
+ ],
+ "steps": [
+ { "do": "See what sells and how listings are presented.", "to": "/marketplace" },
+ { "do": "Publish from the agent you own.", "to": "/my-agents", "note": "Requires sign-in" },
+ { "do": "Check demand before you price it.", "to": "/marketplace/analytics" }
+ ]
+ },
+ {
+ "id": "account",
+ "title": "Sign in or manage my account",
+ "blurb": "Email, wallet, billing, credits, and API keys.",
+ "match": [
+ "sign in",
+ "log in",
+ "login",
+ "account",
+ "register",
+ "sign up",
+ "password",
+ "billing",
+ "api key",
+ "credits",
+ "settings",
+ "profile"
+ ],
+ "steps": [
+ { "do": "Sign in with email or a Solana wallet.", "to": "/login" },
+ { "do": "No account yet? Create one.", "to": "/register" },
+ { "do": "Keys, billing, and usage live in the dashboard.", "to": "/dashboard", "note": "Requires sign-in" }
+ ]
+ },
+ {
+ "id": "status",
+ "title": "Is something broken?",
+ "blurb": "Live uptime, 90 days of history, and a machine-readable feed.",
+ "match": [
+ "status",
+ "is it down",
+ "outage",
+ "uptime",
+ "broken",
+ "not working",
+ "incident",
+ "health"
+ ],
+ "steps": [
+ { "do": "Check live status and 90-day uptime for every surface.", "to": "/status" },
+ { "do": "Poll the same data as JSON from your own monitor.", "to": "/api/status" },
+ { "do": "Still stuck? The docs index is the fastest way to the right page.", "to": "/docs/start-here" }
+ ]
+ },
+ {
+ "id": "map",
+ "title": "Show me everything",
+ "blurb": "The full route map: every page on three.ws, grouped and searchable.",
+ "match": [
+ "everything",
+ "all pages",
+ "site map",
+ "sitemap",
+ "what else",
+ "browse",
+ "map",
+ "atlas",
+ "index",
+ "whats here"
+ ],
+ "steps": [
+ { "do": "Browse the whole platform as one map.", "to": "/atlas" },
+ { "do": "Prefer a flat list? The sitemap has every route.", "to": "/sitemap" },
+ { "do": "Reading as a machine? Take llms.txt instead.", "to": "/llms.txt" }
+ ]
+ }
+ ]
+}
diff --git a/data/tour-atlas.json b/data/tour-atlas.json
new file mode 100644
index 000000000..6dd0129d3
--- /dev/null
+++ b/data/tour-atlas.json
@@ -0,0 +1,297 @@
+{
+ "version": 1,
+ "generatedBy": "scripts/capture-tour-atlas.mjs",
+ "generatedAt": "2026-07-31T06:33:23.365Z",
+ "base": "https://three.ws",
+ "curriculumVersion": 2,
+ "curriculumGeneratedAt": "2026-07-12T17:16:09.990Z",
+ "sections": [
+ {
+ "id": "main",
+ "title": "Main"
+ },
+ {
+ "id": "build",
+ "title": "Build"
+ },
+ {
+ "id": "crypto",
+ "title": "Crypto"
+ },
+ {
+ "id": "labs",
+ "title": "Labs"
+ },
+ {
+ "id": "agent-tools",
+ "title": "Agent Tools"
+ },
+ {
+ "id": "learn",
+ "title": "Learn"
+ },
+ {
+ "id": "onboarding",
+ "title": "Getting started"
+ }
+ ],
+ "tracks": [
+ {
+ "id": "full",
+ "title": "Full tour"
+ },
+ {
+ "id": "quick",
+ "title": "Quick highlights"
+ },
+ {
+ "id": "onboarding",
+ "title": "Getting started"
+ }
+ ],
+ "summary": {
+ "total": 5,
+ "anchored": 5,
+ "missingAnchor": 0,
+ "curatedAnchor": 4,
+ "fallbackAnchor": 1,
+ "navScopedAnchor": 3,
+ "unreachable": 0,
+ "withConsoleErrors": 0,
+ "captured": 5
+ },
+ "stops": [
+ {
+ "id": "home",
+ "index": 0,
+ "title": "Home",
+ "path": "/",
+ "section": "main",
+ "tracks": [
+ "full",
+ "quick"
+ ],
+ "highlight": true,
+ "narration": "Here we have Home. Landing page. 3D AI agents that think on IBM watsonx.ai (Granite) — the pitch, live agent demos, and the front door to every flow.",
+ "status": 200,
+ "anchor": {
+ "state": "resolved",
+ "selector": "a[href=\"/create-agent\"], a[href=\"/create\"], .hero a.cta, main a.button",
+ "source": "curriculum",
+ "scope": "nav",
+ "tag": "a",
+ "rect": {
+ "left": 174.67750549316406,
+ "top": 84.08195495605469,
+ "width": 230.72999572753906,
+ "height": 88.22819519042969
+ }
+ },
+ "consoleErrors": 0,
+ "consoleSamples": [],
+ "notes": [
+ "the anchor resolved inside the site nav rather than the page content"
+ ],
+ "media": {
+ "hero": {
+ "url": "/media/tour/home.webp",
+ "width": 1200,
+ "height": 750,
+ "bytes": 23694
+ },
+ "thumb": {
+ "url": "/media/tour/home.thumb.webp",
+ "width": 520,
+ "height": 325,
+ "bytes": 5588
+ }
+ },
+ "capturedAt": "2026-07-31T06:32:49.872Z"
+ },
+ {
+ "id": "agenc-embodied",
+ "index": 5,
+ "title": "AgenC · Embodied",
+ "path": "/agenc/embodied",
+ "section": "main",
+ "tracks": [
+ "full"
+ ],
+ "highlight": false,
+ "narration": "Let's visit AgenC · Embodied. Watch two AI agents negotiate and coordinate a task, embodied as 3D characters — the AgenC coordination protocol made visible.",
+ "status": 200,
+ "anchor": {
+ "state": "resolved",
+ "selector": "main h1, .hero h1, h1",
+ "source": "fallback",
+ "scope": "other",
+ "tag": "h1",
+ "rect": {
+ "left": 106,
+ "top": 24,
+ "width": 1068,
+ "height": 49
+ }
+ },
+ "consoleErrors": 0,
+ "consoleSamples": [],
+ "notes": [
+ "anchored by the director's generic fallback, not a curated selector for this page"
+ ],
+ "media": {
+ "hero": {
+ "url": "/media/tour/agenc-embodied.webp",
+ "width": 1200,
+ "height": 750,
+ "bytes": 24806
+ },
+ "thumb": {
+ "url": "/media/tour/agenc-embodied.thumb.webp",
+ "width": 520,
+ "height": 325,
+ "bytes": 4882
+ }
+ },
+ "capturedAt": "2026-07-31T06:32:49.873Z"
+ },
+ {
+ "id": "create-agent",
+ "index": 26,
+ "title": "Create an Agent",
+ "path": "/create-agent",
+ "section": "build",
+ "tracks": [
+ "full",
+ "quick"
+ ],
+ "highlight": true,
+ "narration": "This is Create an Agent. Step-by-step wizard to create a 3D AI agent: name, 3D body, skills, personality, voice, and on-chain identity.",
+ "status": 200,
+ "anchor": {
+ "state": "resolved",
+ "selector": "form, .wizard, .step, button",
+ "source": "curriculum",
+ "scope": "nav",
+ "tag": "button",
+ "rect": {
+ "left": 165.8125,
+ "top": 11.34375,
+ "width": 81.96875,
+ "height": 47
+ }
+ },
+ "consoleErrors": 0,
+ "consoleSamples": [],
+ "notes": [
+ "the anchor resolved inside the site nav rather than the page content"
+ ],
+ "media": {
+ "hero": {
+ "url": "/media/tour/create-agent.webp",
+ "width": 1200,
+ "height": 750,
+ "bytes": 22768
+ },
+ "thumb": {
+ "url": "/media/tour/create-agent.thumb.webp",
+ "width": 520,
+ "height": 325,
+ "bytes": 4386
+ }
+ },
+ "capturedAt": "2026-07-31T06:32:49.833Z"
+ },
+ {
+ "id": "forge",
+ "index": 27,
+ "title": "Forge — Text to 3D",
+ "path": "/forge",
+ "section": "build",
+ "tracks": [
+ "full",
+ "quick"
+ ],
+ "highlight": true,
+ "narration": "Take a look at Forge — Text to 3D. Type a prompt — or drop in photos or a sketch — and get a downloadable textured 3D model (GLB). Pick from multiple generation engines with live health status.",
+ "status": 200,
+ "anchor": {
+ "state": "resolved",
+ "selector": "textarea, input[type=\"text\"], .prompt-input, form",
+ "source": "curriculum",
+ "scope": "main",
+ "tag": "form",
+ "rect": {
+ "left": 43.1875,
+ "top": 76,
+ "width": 456,
+ "height": 657.515625
+ }
+ },
+ "consoleErrors": 0,
+ "consoleSamples": [],
+ "notes": [],
+ "media": {
+ "hero": {
+ "url": "/media/tour/forge.webp",
+ "width": 1200,
+ "height": 750,
+ "bytes": 32228
+ },
+ "thumb": {
+ "url": "/media/tour/forge.thumb.webp",
+ "width": 520,
+ "height": 325,
+ "bytes": 6244
+ }
+ },
+ "capturedAt": "2026-07-31T06:33:08.529Z"
+ },
+ {
+ "id": "docs",
+ "index": 169,
+ "title": "Docs",
+ "path": "/docs",
+ "section": "learn",
+ "tracks": [
+ "full",
+ "quick"
+ ],
+ "highlight": true,
+ "narration": "Next up, Docs. Full documentation: SDKs, API reference, embedding, agent system, smart contracts.",
+ "status": 200,
+ "anchor": {
+ "state": "resolved",
+ "selector": "nav, .sidebar, main",
+ "source": "curriculum",
+ "scope": "nav",
+ "tag": "nav",
+ "rect": {
+ "left": 934.5,
+ "top": 2.421875,
+ "width": 327.625,
+ "height": 46.15625
+ }
+ },
+ "consoleErrors": 0,
+ "consoleSamples": [],
+ "notes": [
+ "the anchor resolved inside the site nav rather than the page content"
+ ],
+ "media": {
+ "hero": {
+ "url": "/media/tour/docs.webp",
+ "width": 1200,
+ "height": 750,
+ "bytes": 41424
+ },
+ "thumb": {
+ "url": "/media/tour/docs.thumb.webp",
+ "width": 520,
+ "height": 325,
+ "bytes": 8028
+ }
+ },
+ "capturedAt": "2026-07-31T06:33:14.858Z"
+ }
+ ]
+}
diff --git a/pages/atlas.html b/pages/atlas.html
new file mode 100644
index 000000000..0c438daa1
--- /dev/null
+++ b/pages/atlas.html
@@ -0,0 +1,417 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <script>/* three.ws theme boot: no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
+ <meta charset="utf-8" />
+ <title>Atlas · three.ws</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="theme-color" content="#000000" />
+ <meta
+ name="description"
+ content="The whole three.ws platform as one searchable map: every page grouped by what it is for, plus task shortcuts that answer with steps. Press Cmd+K anywhere on the site to search it."
+ />
+
+ <meta property="og:type" content="website" />
+ <meta property="og:url" content="https://three.ws/atlas" />
+ <meta property="og:title" content="Atlas · three.ws" />
+ <meta
+ property="og:description"
+ content="Every page on three.ws, grouped and searchable, plus the task shortcuts behind Cmd+K."
+ />
+ <meta name="twitter:card" content="summary_large_image" />
+
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <link rel="manifest" href="/manifest.webmanifest" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+
+ <style>
+ .at-wrap {
+ max-width: 1080px;
+ margin: 0 auto;
+ padding: calc(var(--space-md) * 2) var(--space-md) calc(var(--space-md) * 4);
+ }
+ .at-crumb {
+ font: var(--text-sm) var(--font-body);
+ color: var(--ink-dim);
+ margin: 0 0 var(--space-md);
+ }
+ .at-crumb a {
+ color: inherit;
+ }
+
+ /* Hero */
+ .at-hero {
+ margin-bottom: calc(var(--space-md) * 1.5);
+ }
+ .at-title {
+ font-family: var(--font-display);
+ font-size: clamp(1.9rem, 5vw, 2.8rem);
+ letter-spacing: -0.03em;
+ margin: 0 0 0.4rem;
+ }
+ .at-lede {
+ color: var(--ink-dim);
+ font-size: 1rem;
+ line-height: 1.6;
+ max-width: 58ch;
+ margin: 0 0 1.25rem;
+ }
+ .at-lede kbd {
+ font-family: var(--font-body);
+ font-size: 0.82em;
+ border: 1px solid var(--stroke-strong);
+ border-radius: 5px;
+ padding: 1px 6px;
+ color: var(--ink);
+ }
+
+ /* Search */
+ .at-search {
+ position: sticky;
+ top: 0;
+ z-index: 5;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding: 12px 14px;
+ margin: 0 0 var(--space-md);
+ background: var(--surface-1);
+ border: 1px solid var(--stroke-strong);
+ border-radius: var(--radius-lg);
+ }
+ .at-search:focus-within {
+ border-color: var(--ink);
+ }
+ .at-search svg {
+ width: 17px;
+ height: 17px;
+ opacity: 0.5;
+ flex: 0 0 auto;
+ }
+ .at-search input {
+ flex: 1;
+ min-width: 0;
+ background: none;
+ border: 0;
+ outline: none;
+ color: var(--ink);
+ font: inherit;
+ font-size: 16px;
+ }
+ .at-search input::placeholder {
+ color: var(--ink-dim);
+ }
+ .at-clear {
+ background: none;
+ border: 0;
+ color: var(--ink-dim);
+ cursor: pointer;
+ font: inherit;
+ font-size: 18px;
+ line-height: 1;
+ padding: 0 2px;
+ }
+ .at-clear:hover {
+ color: var(--ink);
+ }
+
+ /* Section rail */
+ .at-rail {
+ display: flex;
+ gap: 6px;
+ flex-wrap: wrap;
+ margin: 0 0 calc(var(--space-md) * 1.5);
+ }
+ .at-chip {
+ display: inline-flex;
+ align-items: baseline;
+ gap: 6px;
+ padding: 5px 11px;
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ color: var(--ink-dim);
+ font-size: 12.5px;
+ text-decoration: none;
+ transition:
+ border-color 0.15s ease,
+ color 0.15s ease;
+ }
+ .at-chip:hover,
+ .at-chip[aria-current='true'] {
+ color: var(--ink);
+ border-color: var(--ink);
+ }
+ .at-chip span {
+ font-size: 10.5px;
+ opacity: 0.6;
+ font-variant-numeric: tabular-nums;
+ }
+
+ /* Intent cards */
+ .at-intents {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
+ gap: 12px;
+ margin: 0 0 calc(var(--space-md) * 2);
+ }
+ .at-intent {
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-card);
+ padding: 14px 16px 15px;
+ background: var(--surface-glass);
+ transition: border-color 0.15s ease;
+ }
+ .at-intent:hover {
+ border-color: var(--stroke-strong);
+ }
+ .at-intent h3 {
+ font-family: var(--font-display);
+ font-size: 0.98rem;
+ margin: 0 0 0.3rem;
+ line-height: 1.3;
+ }
+ .at-intent p {
+ color: var(--ink-dim);
+ font-size: 12px;
+ line-height: 1.5;
+ margin: 0 0 0.7rem;
+ }
+ .at-intent ol {
+ margin: 0;
+ padding: 0 0 0 1.1rem;
+ display: grid;
+ gap: 5px;
+ }
+ .at-intent li {
+ font-size: 12px;
+ line-height: 1.5;
+ color: var(--ink-dim);
+ }
+ .at-intent li a {
+ color: var(--ink);
+ text-decoration: underline;
+ text-underline-offset: 2px;
+ text-decoration-color: var(--stroke-strong);
+ }
+ .at-intent li a:hover {
+ text-decoration-color: currentColor;
+ }
+ .at-intent li em {
+ font-style: normal;
+ opacity: 0.6;
+ }
+
+ /* Sections + page cards */
+ .at-section {
+ margin: 0 0 calc(var(--space-md) * 2.2);
+ scroll-margin-top: 76px;
+ }
+ .at-section-head {
+ display: flex;
+ align-items: baseline;
+ gap: 10px;
+ flex-wrap: wrap;
+ padding-bottom: 8px;
+ margin-bottom: 12px;
+ border-bottom: 1px solid var(--stroke);
+ }
+ .at-section-head h2 {
+ font-family: var(--font-display);
+ font-size: 1.15rem;
+ margin: 0;
+ }
+ .at-section-head .at-count {
+ font-size: 11px;
+ color: var(--ink-dim);
+ font-variant-numeric: tabular-nums;
+ }
+ .at-section-head p {
+ flex: 1 1 100%;
+ margin: 4px 0 0;
+ font-size: 12.5px;
+ color: var(--ink-dim);
+ line-height: 1.5;
+ }
+ .at-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
+ gap: 2px;
+ }
+ .at-card {
+ display: block;
+ padding: 10px 12px;
+ border-radius: var(--radius-md);
+ text-decoration: none;
+ color: inherit;
+ border: 1px solid transparent;
+ transition:
+ background 0.12s ease,
+ border-color 0.12s ease;
+ }
+ .at-card:hover,
+ .at-card:focus-visible {
+ background: var(--surface-2);
+ border-color: var(--stroke);
+ }
+ .at-card-title {
+ font-size: 13.5px;
+ line-height: 1.35;
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ flex-wrap: wrap;
+ }
+ .at-card-path {
+ font-family: var(--font-mono);
+ font-size: 10.5px;
+ color: var(--ink-dim);
+ }
+ .at-card-desc {
+ font-size: 11.5px;
+ line-height: 1.45;
+ color: var(--ink-dim);
+ margin-top: 2px;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ }
+ .at-card mark {
+ background: none;
+ color: inherit;
+ font-weight: 700;
+ text-decoration: underline;
+ text-decoration-thickness: 1px;
+ text-underline-offset: 2px;
+ }
+ .at-tag {
+ font-size: 9.5px;
+ letter-spacing: 0.05em;
+ text-transform: uppercase;
+ padding: 1px 5px;
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ color: var(--ink-dim);
+ }
+
+ /* States */
+ .at-skel {
+ height: 46px;
+ border-radius: var(--radius-md);
+ background: linear-gradient(
+ 90deg,
+ var(--surface-2) 0%,
+ var(--surface-3) 50%,
+ var(--surface-2) 100%
+ );
+ background-size: 200% 100%;
+ animation: at-shimmer 1.2s linear infinite;
+ }
+ @keyframes at-shimmer {
+ to {
+ background-position: -200% 0;
+ }
+ }
+ .at-state {
+ padding: 44px 20px;
+ text-align: center;
+ color: var(--ink-dim);
+ font-size: 13px;
+ line-height: 1.7;
+ }
+ .at-state strong {
+ display: block;
+ color: var(--ink);
+ font-size: 15px;
+ margin-bottom: 6px;
+ font-family: var(--font-display);
+ }
+ .at-state a {
+ color: var(--ink);
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ .at-skel {
+ animation: none;
+ }
+ .at-card,
+ .at-chip,
+ .at-intent {
+ transition: none;
+ }
+ }
+ </style>
+ </head>
+ <body>
+ <header><div id="nav-container"></div></header>
+
+ <main class="at-wrap">
+ <p class="at-crumb"><a href="/">Home</a> / Atlas</p>
+
+ <div class="at-hero">
+ <h1 class="at-title">Atlas</h1>
+ <p class="at-lede">
+ The whole platform on one page, grouped by what each surface is for. Start with a goal
+ below, or search. Press <kbd>⌘ K</kbd> anywhere on three.ws to open the same search
+ without leaving the page you are on.
+ </p>
+ </div>
+
+ <div class="at-search">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
+ <circle cx="11" cy="11" r="7" />
+ <path d="M20 20l-4-4" stroke-linecap="round" />
+ </svg>
+ <input
+ id="at-q"
+ type="search"
+ autocomplete="off"
+ spellcheck="false"
+ placeholder="Search every page, or describe what you want to do"
+ aria-label="Search the atlas"
+ aria-describedby="at-live"
+ />
+ <button type="button" class="at-clear" id="at-clear" aria-label="Clear search" hidden>×</button>
+ </div>
+
+ <p id="at-live" role="status" aria-live="polite" class="at-crumb" style="min-height: 1.2em"></p>
+
+ <nav class="at-rail" id="at-rail" aria-label="Jump to a section"></nav>
+
+ <section id="at-intents-wrap" aria-labelledby="at-intents-h" hidden>
+ <div class="at-section-head">
+ <h2 id="at-intents-h">Start with a goal</h2>
+ <span class="at-count" id="at-intent-count"></span>
+ <p>
+ Each of these answers with the ordered steps, not just a link. They are the same
+ shortcuts the ⌘K palette surfaces when you describe a task.
+ </p>
+ </div>
+ <div class="at-intents" id="at-intents"></div>
+ </section>
+
+ <div id="at-body">
+ <div class="at-grid" aria-hidden="true">
+ <div class="at-skel"></div>
+ <div class="at-skel"></div>
+ <div class="at-skel"></div>
+ <div class="at-skel"></div>
+ <div class="at-skel"></div>
+ <div class="at-skel"></div>
+ </div>
+ </div>
+ </main>
+
+ <script type="module" src="/src/atlas-page.js"></script>
+ <script src="/nav.js" defer></script>
+ <script src="/brand.js" defer></script>
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+ <script type="module" src="/i18n.js"></script>
+ </body>
+</html>
diff --git a/public/atlas-index.json b/public/atlas-index.json
new file mode 100644
index 000000000..8e51f139d
--- /dev/null
+++ b/public/atlas-index.json
@@ -0,0 +1 @@
+{"version":1,"pageCount":633,"intentCount":15,"sections":[{"id":"main","title":"Main","hint":"Entry points into the product."},{"id":"build","title":"Build","hint":"Create and customize an agent."},{"id":"labs","title":"Labs","hint":"Experimental features actively shipping. Expect fast iteration."},{"id":"crypto","title":"Crypto","hint":"On-chain features: pay-per-call, token launches, vanity wallets."},{"id":"agent-tools","title":"Agent Tools","hint":"Manage, talk to, and deploy individual agents."},{"id":"account","title":"Account","hint":"Sign-in, dashboard, billing."},{"id":"learn","title":"Learn","hint":"Docs, tutorials, and reference."},{"id":"blog","title":"Blog","hint":"Long-form announcements, launches, and writing from three.ws."},{"id":"legal","title":"Legal","hint":""},{"id":"machine","title":"Machine-readable","hint":"Indexes and well-known files for crawlers and AI agents."}],"pages":[["/","Home","Landing page. 3D AI agents that think on IBM watsonx.ai (Granite): the pitch, live agent demos, and the front door to every flow.","main",1,0],["/discover","Discover","On-chain agent directory (ERC-8004 + Solana). Browse, search, and inspect every registered agent.","main",0.9,0],["/gallery","Avatar Gallery","Every public 3D avatar in the system, browsable as a grid.","main",0.8,0],["/animations","Animation Gallery","Browse and preview public animations authored by the three.ws community. Apply any clip to your avatar in the Animation Studio.","main",0.8,0],["/gestures","Agent Gestures","The three.ws agent gesture vocabulary: every animation slot, the clip it plays, the skills that trigger it, and a builder for overriding any slot on your own...","main",0.7,0],["/character-library","Character Library","106 professionally rigged 3D characters, free to use. Every one drives the full animation library and drops into the Studio, Animation Studio, and embed viewer...","main",0.8,0],["/sign-language","Sign Language Avatars","three.ws avatars sign in American Sign Language: fingerspell any word or number, get signed chat replies, and sign back with your webcam. The whole loop, live...","main",0.9,0],["/objects","Object Library","Hundreds of free CC0 3D objects and props: furniture, lighting, electronics, decor. Public domain, no attribution required. Preview live, place it in your room...","main",0.8,0],["/forged","Agent-Forged Gallery","3D props bought by autonomous AI agents with real USDC over x402. Every asset carries its on-chain receipt: the paying agent wallet, the price, and the Solana...","main",0.7,0],["/wardrobe","Wardrobe","The open garment catalog for 3D avatars: browse every wearable, inspect it in 3D, and generate new pieces from a text prompt. Every piece binds to any humanoid...","main",0.7,0],["/diorama","Diorama","Speak a little world into being: describe a scene and watch it assemble into an explorable 3D diorama you can walk through, then take it into AR.","main",0.7,0],["/mocap-studio","Mocap Studio","Drive a 3D avatar with your webcam: real-time facial motion capture in the browser, no rig and no download.","main",0.7,0],["/autopilot","Coin Autopilot","A hands-off token cockpit: set the rules: buys, sells, and guardrails: and let your agent run the coin autonomously.","main",0.7,0],["/agenc/embodied","AgenC · Embodied","Watch two AI agents negotiate and coordinate a task, embodied as 3D characters: the AgenC coordination protocol made visible.","main",0.6,0],["/agenc/room","AgenC · Task Room","A live room where autonomous agents discover open work, bid for it, and settle on-chain: the labor market up close.","main",0.6,0],["/create/video","Talking Avatar Video","Turn a three.ws avatar into a talking-head video: upload your audio and export a lip-synced clip.","main",0.6,0],["/temporary","Drive Your Avatar","Drive a 3D avatar around with a joystick or WASD, then toggle the back camera for AR-style passthrough on your phone.","main",0.7,0],["/irl","IRL","Place a 3D avatar in your real environment. Camera AR passthrough, joystick movement, and tap-to-place 3D objects on your floor.","main",0.75,0],["/irl-privacy","How location works on IRL","Placed agents are private by location: they appear only to people physically standing near them, never on a map or a list. What's shared, what isn't, and how...","main",0.4,0],["/alpha-copilot","Alpha Co-pilot: your agent narrates its own alpha","Your 3D agent reads a real pump.fun launch in character: grounded in live liquidity, holder, and smart-money data: and speaks its verdict aloud. Fabricated...","main",0.8,0],["/world-lines","World Lines: agent proof-of-presence quests","Walk to an AI agent's real-world spot, complete its AR challenge, and earn a cryptographically real, agent-signed proof of presence. Privacy-preserving (only a...","main",0.7,0],["/marketplace","Marketplace","Buy access to agents, skills, and avatars from other creators.","main",0.8,0],["/marketplace/analytics","Marketplace Analytics","Real-time stats on the three.ws skill marketplace: top skills, top agents, and sales volume.","main",0.6,0],["/collection","My Collection","View all the skills and subscriptions you've unlocked on three.ws.","main",0.5,0],["/notifications","Notifications","Every payment, sale, remix, follow, quest, and royalty notification on three.ws: all in one place, filterable by category.","main",0.5,0],["/skills","Skills Marketplace","Browse, search, and install agent skills: tool packs, knowledge bases, and capabilities that make AI agents smarter. Now lives inside the Marketplace; this...","main",0.8,2],["/community","Community","Live platform activity plus where to follow, contribute, and connect with three.ws creators.","main",0.6,0],["/search","Search","One search across every creation type on three.ws: avatars, agents, 3D models, worlds, and coins: with remixable models remixable straight from the results.","main",0.8,0],["/atlas","Atlas","The whole platform as one searchable map: every page grouped by what it is for, plus the task shortcuts the Cmd+K palette answers with. Press Cmd+K anywhere on...","main",0.7,0],["/sitemap","Sitemap","Human-readable index of every page on three.ws.","main",0.4,0],["/characters","Characters","Discover AI characters on three.ws. Chat, trade, and create.","main",0.8,0],["/what-is","What is three.ws?","Plain-English introduction to three.ws: what a 3D AI agent is, real use-cases, and where to begin.","main",0.8,0],["/pitch","Pitch Deck","The three.ws story as a presentable slide deck: one platform that gives any AI a real-time 3D body you can embed anywhere in one line. Arrow-key navigation, a...","main",0.6,0],["/timeline","The Story So Far","three.ws's history as an explorable 3D scene: every launch, partnership, listing, and milestone laid out along a path you can orbit in 360° or walk end to end...","main",0.6,0],["/tour","Guided Tour","A 3D guide walks across the live site, points at every feature, and narrates what each one does and how to use it: voice plus an on-screen chat bubble, paced...","main",0.7,0],["/walk","Walk Anywhere on the Web","Your 3D avatar walks anywhere on the web. Live demos across six environments, a Chrome extension, one-tag embeds, and a global distance leaderboard.","main",0.8,0],["/concierge","Concierge: AI Chat Widget","Give any website an AI concierge with a talking 3D avatar: one-tag embed, streaming answers grounded in the live page, voice in and out, themes, and an avatar...","main",0.8,0],["/feed","Feed","Live avatars, agents, 3D models, worlds, and launches across three.ws: filter to everyone or just the people you follow.","main",0.6,0],["/partners","Partner Ecosystem","three.ws partner ecosystem: OpenAI, IBM, AWS, Google Cloud, Alibaba Cloud, NVIDIA, Quicknode, HackerNoon. The AI, cloud, and infrastructure programs powering...","main",0.8,0],["/openai","three.ws is an OpenAI Select Partner","three.ws is an OpenAI Select Partner in the OpenAI Partner Network. Connect the free three.ws 3D Studio MCP server to ChatGPT and turn a prompt into an...","main",0.8,0],["/nvidia","three.ws on NVIDIA","three.ws is a member of the NVIDIA Inception program. Every 3D model, avatar, and voice on the platform runs on NVIDIA: a free hosted lane behind one API key...","main",0.8,0],["/press","Press kit","Logos, announcement graphics, boilerplate, and usage rules for three.ws. Every asset is downloadable and current, and editorial use needs no permission.","main",0.6,0],["/pricing","Pricing","Plans and pricing for three.ws: free forge quota, premium passes, and pay-per-use API surfaces.","main",0.8,0],["/showcase","Showcase","AI-powered 3D model viewer showcase: drop in a model and explore it live.","main",0.6,0],["/demos","Lab Demos","Index of live demos across the platform: viewers, agents, payments, and experiments.","main",0.6,0],["/assistant","Assistant widget","Put a 3D avatar assistant on any website with one script tag. A floating launcher opens a real animated avatar, against your page, a color, or a gradient, with...","build",0.8,0],["/agora","Agora: the Commons","A watchable 3D world where AI agent and human citizens live, work, and earn $THREE. Walk the square, inspect any citizen's passport, and watch the economy come...","build",0.8,0],["/start","Get Started","5-step onboarding wizard: create a 3D avatar, name your agent, enable skills, deploy an embed widget, and set up monetization: all in under 5 minutes.","build",1,2],["/create","Create","The front door for everything you can create on three.ws: build an AI agent, make a 3D avatar (from a photo, from scratch, from a text prompt, or a file)...","build",0.9,0],["/genome","Agent Genome: breed two agents","Breed two AI agents into a provably-inherited offspring. The child inherits a recombination of both parents' brain, voice, body, and on-chain skill licenses...","build",0.8,0],["/genesis","Instant Agent Genesis","A prompt or a selfie becomes a rigged 3D AI agent with its own custodial Solana + EVM wallet and a verifiable on-chain identity: in under a minute, owned by...","build",0.9,0],["/create-agent","Create an Agent","Step-by-step wizard to create a 3D AI agent: name, 3D body, skills, personality, voice, and on-chain identity.","build",0.9,0],["/agent-screen","Agent Screen","Watch your agent work in real time: split view with the agent's live screen on the left and their 3D avatar rendered as a webcam on the right.","build",0.5,3],["/agents-live","Live Agents","Mission control: real-time grid of all AI agents with active screen streams. Watch their screens and avatar feeds live.","build",0.5,0],["/agent-studio","Agent Studio","Author your agent's brain, memory, body, money, and skills in one place, with a live 3D avatar that updates everywhere as you edit.","build",0.5,3],["/app","Viewer","Drag-and-drop glTF/GLB viewer for inspecting 3D models in the browser.","build",0.7,0],["/create/prompt","Describe it to 3D","Type a description. About a minute later: a rigged 3D avatar you can animate and download.","build",0.9,0],["/forge","Forge: Text & Image to 3D","Type a prompt: or drop in photos or a sketch: and get a downloadable textured 3D model (GLB). Pick from multiple generation engines with live health status.","build",0.9,0],["/image-to-3d","Image to 3D: Turn a Photo into a 3D Model","Upload a photo (or up to 4 angles) and get a downloadable textured 3D model (GLB). The Forge's photo lane, opened directly: for objects and props; for faces...","build",0.9,0],["/forge-max","Forge Max: Highest-Quality Text & Image to 3D","The Forge's maximum-quality lane, opened directly: High tier pinned (200k-poly geometry, 4K PBR and HD textures, subject-aware engine routing). A $THREE holder...","build",0.9,0],["/restyle","Restyle Studio: material presets, AI restyle & variants","Re-skin any 3D model in the browser: apply PBR material presets (chrome, gold, glass, wood…), restyle from a plain-language AI instruction, fan out seeded...","build",0.8,0],["/avatar-engines","Avatar Engines Atlas","A curated, factual atlas of the open-source and commercial engines that build high-quality and photoreal 3D human avatars: Gaussian-splat heads, single-photo...","build",0.7,0],["/splat","Splat Viewer: Photoreal Gaussian Avatars","Render Gaussian-splat and radiance-field avatars in the browser: the photoreal output of engines like GaussianAvatars and HumanGaussian. Load a .ply / .splat /...","build",0.7,0],["/capture","Scene Capture: Video to 3D Point Cloud","Turn a phone video of any space into an explorable 3D point cloud. Streaming feed-forward reconstruction (LingBot-Map Geometric Context Transformer) fuses the...","build",0.7,0],["/motion-swap","Motion Swap: Replace Yourself in Video with Your Avatar","Upload a video of yourself and get it back with your 3D avatar performing your motion instead of you. Server-side pose tracking and person masking...","build",0.7,0],["/forge-nim","Forge · NIM: Self-Hosted Image to 3D","Drive a self-hosted TRELLIS NIM (nvcr.io/nim/microsoft/trellis) directly: drop a photo, hit /v1/infer, and get the textured GLB back synchronously as base64...","build",0.7,0],["/forge-spark","Text → 3D: Nemotron → FLUX → TRELLIS","Describe an object and watch it become a textured 3D mesh: Nemotron sharpens the prompt, FLUX paints a clean reference, and TRELLIS reconstructs the model...","build",0.7,0],["/forge-studio","Studio: Object + Avatar from text","One canvas for both text-to-3D pipelines: forge a textured object (GLB) in the Object tab, or describe a character and get a rigged avatar in the Avatar tab.","build",0.8,0],["/cosmos","Cosmos: Living Worlds","Bring your avatar to life: type a world and NVIDIA Cosmos renders a living, photoreal scene that plays behind your 3D avatar. Generate, preview, and download a...","build",0.8,0],["/scene","Scene Studio","Full 3D scene editor in the browser: import GLB models, arrange them with transform gizmos, edit materials and lights, and export complete scenes.","build",0.8,0],["/compose","Scene Composer","Real-time 3D scene composer: forge items from text, attach them to your avatar's skeleton bones, arrange and scale freely, then export your creation or save it...","build",0.9,0],["/pose","Animation Studio","Pose any three.ws avatar or the built-in mannequin with FK/IK, keyframe a timeline, and preview the motion live. Export an animated GLB or clip JSON, save...","build",0.9,0],["/validation","glTF Validator","Khronos-spec validator for glTF/GLB files. Paste a URL or upload a model.","build",0.6,0],["/studio","Widget Studio","Pick an avatar, configure embed options, copy a one-line snippet for your site.","build",0.8,0],["/artifact","Artifact Viewer","Renders Claude artifact bundles as standalone embeddable apps.","build",0.5,0],["/widgets","Widgets Gallery","Pre-built chat, voice, and 3D-avatar widgets you can drop into any page.","build",0.7,0],["/hydrate","Hydrate","Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.","build",0.7,0],["/integrations","Integrations","Drop-in 3D agents, chat widgets, walk companions, and live token embeds for any site. One script tag. Powered by three.ws.","build",0.8,0],["/features","Features","Full feature overview of the three.ws platform: avatars, agents, on-chain identity, x402 payments, and embedding.","build",0.8,0],["/features/ar","AR & WebXR: Place Any 3D Agent in Your Real World","Every three.ws avatar and Forge model has a View in AR button. On mobile it anchors the model to real surfaces through your camera. WebXR on Android, Quick...","build",0.8,0],["/features/forge","Forge: Text & Image to 3D Models","Type a description or upload photos, and get a downloadable textured 3D model (GLB). Multiple self-hosted engines, from fast drafts to PBR realism.","build",0.8,0],["/features/scan","Scan: Selfie to 3D Avatar","Point your camera at your face, hold still, and walk away with a rigged 3D avatar in 60 seconds. Free, in your browser.","build",0.8,0],["/features/play","Play: Live 3D Coin Worlds","Every pump.fun coin gets a deterministic 3D world. Walk in as your avatar, chat with holders, and trade: all in the browser.","build",0.8,0],["/features/walk","Walk: 3D Avatar AR","Drive your AI agent's 3D avatar with WASD or joystick. Toggle AR mode and it walks on your real floor through your phone camera.","build",0.8,0],["/features/studio","Studio: Embeddable AI Widget Builder","Configure avatar, voice, and knowledge base in the Widget Studio, then copy one script tag to embed a 3D AI agent anywhere.","build",0.8,0],["/features/marketplace","Marketplace: Discover and Fork AI Agents","Browse hundreds of community-built AI agents with 3D avatars and on-chain identities. Fork any agent, buy paid skills, and ship in minutes.","build",0.8,0],["/features/agent-exchange","Agent Exchange: AI Agents Paying Each Other","Watch two AI agents with 3D avatars autonomously negotiate and pay each other for crypto intelligence via x402 micropayments on Solana.","build",0.7,0],["/features/deploy","Deploy: On-Chain Agent Identity","Register your AI agent on Solana via ERC-8004 and Metaplex Core. Permanent, verifiable identity: discoverable by any wallet or other agent.","build",0.8,0],["/create/selfie","Selfie to Avatar","One selfie. About a minute. A rigged 3D avatar that works everywhere.","build",0.7,0],["/import/rpm","Import an avatar URL","Import any GLB or glTF avatar into three.ws and give it an agent brain.","build",0.6,0],["/threews/claim","Claim threews.sol Subdomain","Claim your own <name>.threews.sol subdomain and get a Brave-resolvable personal showcase page.","build",0.6,0],["/voice","Voice Lab","Clone your voice from a short recording, then use it for TTS or give it to your agent. Side-by-side comparison of voice models.","build",0.7,0],["/dad","Make Dad a 3D Avatar","Turn one photo of your dad into a recognizable, rigged, animated 3D avatar: it idles, walks, and waves: then share a permalink.","build",0.7,0],["/ca2x402","CA → x402","Paste any token contract address and get a live, agent-payable x402 endpoint for its market intel: price, momentum, and a bullish/bearish signal: for $0.01...","build",0.7,0],["/avatar-studio","Avatar Studio","Build a custom 3D avatar from scratch. Choose body type, sculpt face and body, add outfits and accessories. No selfie required.","build",0.7,0],["/nim-forge","TRELLIS NIM Forge","Drop in a photo, get a textured 3D model, reconstructed on a self-hosted Microsoft TRELLIS NIM. Single-hop image to GLB.","build",0.6,0],["/avatar-sdk","Avatar SDK","The @three-ws/avatar package: embed the platform 3D avatars in any site with a few lines of JavaScript.","build",0.6,0],["/avatar-cli","Avatar CLI","The @three-ws/avatar-cli package: scaffold a hash-anchored avatar manifest from a wallet and a GLB, validate it against the schema, and print an embed snippet....","build",0.6,0],["/launchpad","Launchpad Studio","Build a hosted 3D launchpad, token page, concierge, or showroom on a three.ws subdomain.","labs",0.7,0],["/brain","Multi-LLM Brain","Send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously. Side-by-side streaming with latency and token stats.","labs",0.7,0],["/lipsync","Lipsync (TTS)","Type text, stream it through the avatar's voice, and the mouth animates in real time via wawa-lipsync viseme detection.","labs",0.6,0],["/lipsync/mic","Lipsync (Mic)","Feed live mic audio through the viseme analyser and watch the avatar's mouth track your voice in real time.","labs",0.6,0],["/avatar-artifact","Avatar Artifact","Standalone Three.js viewer for avatar artifacts: embeddable and shareable without any wrapper page.","labs",0.5,0],["/viewer","glTF / GLB Viewer","Preview any public glTF/GLB inline, then take it further: pose and animate it, restyle the material, build a scene, place it in AR, embed it on your site, or...","labs",0.5,0],["/watch","Generation Watch","Live progress page for a running text-to-3D generation: real countdown, the painted concept art, and an automatic hand-off into the interactive viewer the...","labs",0.4,0],["/ar","AR Forge","Type a prompt, get a real 3D model, and place it in your room: free text-to-3D with one-tap AR on any phone (WebXR, Scene Viewer, Quick Look) and a QR handoff...","labs",0.7,0],["/ar/studio","AR Studio","A live multi-model AR scene through your camera: place any number of 3D models and avatars in your real space, pull in your forge creations, community models...","labs",0.7,0],["/daily","Daily Forge","A new 3D creative challenge every day. Forge today's theme into a real 3D model, free and no sign-up, build a daily streak, and place your creation in AR on...","labs",0.8,0],["/spatial-mcp","Spatial MCP: reference renderer","The open standard for returning a live, interactive 3D scene as a first-class MCP tool result, with a framework-free reference renderer that displays any...","labs",0.5,0],["/playground","Playground","Sandbox for experimenting with agents, prompts, and 3D scenes.","labs",0.5,0],["/labs","Labs Showcase","A curated gallery of three.ws's most powerful: and most hidden: features. Find and try things you didn't know existed.","labs",0.8,0],["/rankings","Rankings","The cross-surface three.ws leaderboard: creators ranked by real creations, remixes received, coin launches, followers, and distance walked. Track your streak...","labs",0.7,0],["/daily-match","Daily Match","Which agent ships the most real output today? Live daily standings over real agent activity: actions, trades, skill sales, and coin launches. Resets at 00:00...","labs",0.7,0],["/walk-leaderboard","Walk Leaderboard","Global leaderboard for the walking avatar: distance walked, sites visited, and time, ranked daily, weekly, and all-time.","labs",0.6,0],["/galaxy","Agent Galaxy","Every public agent embedded by IBM Granite on watsonx.ai into a navigable 3D constellation with natural-language semantic search.","labs",0.6,0],["/symphony","Agent Symphony","The agent economy, played live as generative music. Every real payment, trade, launch and level-up on three.ws becomes a synthesized note in real time; record...","labs",0.6,0],["/sperax","Sperax on three.ws","Free AI credits for three.ws users on chat.sperax.io: what the integration is and how to claim it.","crypto",0.5,0],["/agi","The AGI: narrow by design","The first AGI, narrow by design: a single autonomous agent that is genuinely superhuman at one thing: trading memecoins on pump.fun (Solana): and deliberately...","crypto",0.95,0],["/oracle","Oracle: AI Conviction Engine","A fused AI conviction engine for every pump.fun launch: pedigree (who's buying), structure (bundle vs organic), narrative (what story is it riding), and...","crypto",0.9,0],["/oracle/docs","Oracle Docs: the conviction engine, end to end","The complete Oracle reference: the thesis behind fused pump.fun conviction, the four-pillar scoring model and its exact math, the data pipeline and worker...","crypto",0.75,0],["/oracle/arm","Arm your agent: automate Oracle conviction","Configure your 3D agent to trade Oracle conviction automatically: set the minimum score, position size, daily and open-position caps, narrative filters and...","crypto",0.8,0],["/activity","Agent Activity: Oracle conviction in real time","The trading floor: every Oracle conviction action from every autonomous 3D agent on pump.fun, live. Filter by tier and mode, track outcomes, and copy the...","crypto",0.8,0],["/pipeline","Recording Pipeline: the data loop, live","One-glance health of the closed loop that turns every pump.fun launch into a trade signal: the launch recorder, signal intel, ground-truth outcomes, Oracle...","crypto",0.7,0],["/guardian","Guardian console: recover & inherit agent wallets","The agents you’re trusted to protect. Approve a recovery or confirm an inheritance to help a fellow human back into their funded agent wallet: through a...","crypto",0.6,0],["/launch","Launch a Coin","Mint a coin for your 3D AI agent in one flow: pick an agent, set the name, symbol, and image, then launch on pump.fun straight from your wallet with an...","crypto",0.8,0],["/launch-studio","Launch Studio: 50 ways to mint a coin","A catalog of 50 coin-launch use cases: reward coins for trending GitHub repos and creators, and coins riding live cultural, news, and onchain narratives....","crypto",0.8,0],["/launches","Agent Launches","Live public feed of every coin launched by a three.ws agent: market caps, graduation status, and the agent behind each launch.","crypto",0.8,0],["/minted","Minted 3D Assets","Live public gallery of every generated 3D avatar minted as a Metaplex Core NFT through three.ws: interactive viewer, baked provenance, and enforced creator...","crypto",0.7,0],["/creations","Creator Gallery","Search, filter, and live-preview the remix bazaar: remix any published 3D creation for a real on-chain USDC royalty, view parent → child lineage, and see the...","crypto",0.7,0],["/theater","Live Trading Theater","Watch agents trade in 3D, in real time. Every trader is a 3D character with a wallet and a verifiable on-chain reputation: when a real on-chain buy fills, its...","crypto",0.8,0],["/pulse","Money Pulse","The Money Pulse: a real-time, platform-wide feed of three.ws agent wallet activity: tips landing, coins launching, agents trading and paying each other. Every...","crypto",0.8,0],["/x402-revenue","Endpoint Revenue","The live revenue layer: real USDC flowing into three.ws's own x402 paid endpoints. A live revenue chart, gross/net/success-rate KPIs, momentum vs the prior...","crypto",0.7,0],["/fits","Fits: the cosmetics economy","The live cosmetics economy: the scarcest premium fits ranked by how few wallets own them, the top collectors wearing them, the creators actually getting paid...","crypto",0.6,0],["/receipts","Receipt Vault","Every x402 payment you ever made to three.ws, retrievable forever. Connect a Solana or EVM wallet, sign one read-only message, and get back every signed...","crypto",0.6,0],["/viability","Viability","The honest signal behind three.ws: real marketplace and trading viability. Live $THREE skill GMV, take-rate, repeat buyers and trading pairs, plus real guarded...","crypto",0.8,0],["/admin/ring","Ring Dashboard (admin)","Operator dashboard for the closed-loop x402 ring economy: live per-minute settlement pulse, loop diagram with wallet balances and floors, streaming activity...","crypto",0.5,3],["/deployments","On-chain Deployments","A live, cross-chain feed of every agent registered on the ERC-8004 Identity Registry: the moment each registration lands on-chain. Real on-chain registrations...","crypto",0.8,0],["/launcher","Memetic Launcher","Your personal autonomous coin launcher: set your mode (trend, meme, hybrid, random), pick trend sources, tune your cadence, preview what your agents would...","crypto",0.8,0],["/clash","Coin Clash","Token-gated community warfare. Every coin community is an army: hold the coin, enlist, and rally for your faction in timed battles against other communities.","crypto",0.7,0],["/leaderboard","Trader Leaderboard","Pump.fun traders ranked by a provable, on-chain track record: realized P&L, win rate, drawdown: with every number traceable to its transaction.","crypto",0.8,0],["/tracker","KOL Tracker","Solana crypto KOLs ranked by realized P&L computed from their own wallet's on-chain trade history, with win rate, volume, trade count, and X follower counts...","crypto",0.8,0],["/integrity","Custody Integrity","Provable, on-chain-anchored custody for every three.ws agent wallet. The platform commits a Merkle root over every wallet's on-chain state to Solana: verify...","crypto",0.7,0],["/proof","Verify Custody","Verify your own three.ws agent wallet's custody: recompute your Merkle leaf, walk the path, and confirm it against the root anchored on Solana, entirely in...","crypto",0.5,3],["/labor-market","Agent Labor Market","A live machine economy: agents post bounties, bid on each other's work, and settle in $THREE on-chain: escrowed, verified, and royalty-routed, with no human in...","crypto",0.8,0],["/vaults","Back-an-Agent Vaults","Copy-trade a 3D agent with a verifiable on-chain reputation: stake into a verified trader, share its real P&L pro-rata, and watch it trade your capital live...","crypto",0.8,0],["/signals","Signal Marketplace: paid alpha feeds, ranked by proven edge","Verified traders publish their live entry/exit signals as x402-metered feeds. Your agent pays per signal or per epoch in USDC and auto-mirrors the trade...","crypto",0.8,0],["/dashboard/capabilities","Capabilities: Alpha Hunt, Launcher, Auto-Claim & Market Maker","Live command center for all 4 autonomous agent capabilities: Alpha Hunt smart-money scoring, autonomous Coin Launcher on schedule, Creator Auto-Claim for fee...","crypto",0.7,0],["/arena","The Arena: live PvP trading tournaments","Time-boxed PvP tournaments where AI agents compete on real, verified pump.fun P&L. Live rankings, on-chain attested standings, and $THREE prizes for the...","crypto",0.8,0],["/trending","Trending: Top Agents & Coins on three.ws","What’s hot on three.ws right now. Top 3D AI agents ranked by real chat activity and top Oracle conviction coins by score, with 24h/7d/all-time windows.","crypto",0.8,0],["/trades","Live Trade Feed: Notable pump.fun Exits","Real-time feed of every notable pump.fun exit from three.ws AI agents: realized PnL, hold time, exit multiple, conviction tier, and a one-click path to copy...","crypto",0.8,0],["/claim-wallet","Claim Your Wallet: Verified pump.fun Track Record","Paste your Solana wallet to see your provable pump.fun track record: win rate, smart-money score, reputation label, and coin history. Sign in to claim it as...","crypto",0.8,0],["/meta-allocator","Meta-Allocator: the ETF of degens","Do not pick a coin, pick a basket of proven traders. The Meta-Allocator spreads a budget across the top verified pump.fun trader agents, ranked by...","crypto",0.7,0],["/clip-director","Clip Director: every trade becomes content","Turn any trader agent's real closed pump.fun trade into the optimal shareable card per surface (X, Telegram, or the in-app Feed): an honest hook, the real...","crypto",0.7,0],["/pay","Pay (x402)","Pay-per-call gateway: invoke any x402-protocol paid API with a USDC micro-transaction.","crypto",0.9,0],["/x402/studio","x402 Studio: the Stripe of x402","Merchant console to run a paid x402 business: products and pricing, payout and agent wallets, a real USDC send/receive with SNS .sol resolution, a...","crypto",0.7,0],["/play/agent-wallet","Agent Wallet (x402 on Solana)","Watch your 3D avatar walk up to a paid endpoint and pay for it with its agent wallet: a real USDC micropayment signed by the agent and settled on Solana.","crypto",0.7,0],["/play/arena","Sniper Arena: autonomous AI agents trading live","Watch three.ws AI agents trade pump.fun autonomously in real time. Live P&L leaderboard, each trade signed by the agent's own wallet and verifiable on-chain.","crypto",0.8,0],["/sniper/experiments","Sniper Experiments: rules vs LLM judgment, scored live","The sniper fleet runs different rule sets side by side, including LLM-judged agents with no rules at all. The live scoreboard of which entry conditions...","crypto",0.7,0],["/play/ufo","Flappin UFO: retired demo","The Flappin UFO arcade demo ran on an external deployment that is no longer online, so the game has been retired. The page now points visitors to the live...","crypto",0.3,0],["/smart-money","Smart Money Radar: follow the wallets that win on pump.fun","A live first-party reputation graph of every pump.fun wallet. We cross each coin's buyers with the coins that actually graduated, so you can see which wallets...","crypto",0.8,0],["/pumpfun","Pump.fun Stream","Mint and trade pump.fun agent tokens on Solana. Live feed of every launch.","crypto",0.8,0],["/pump-live","Pump Live","Real-time feed of every pump.fun launch as it happens, with a 3D agent that reacts live.","crypto",0.7,0],["/terminal","Mission Control","The real-time pump.fun trading terminal: the live launch firehose fused with intel scores, firewall verdicts, and smart-money flow, your streaming positions...","crypto",0.85,0],["/radar","Coin Radar","Live pump.fun launch intelligence: every new coin scored in its first ~90 seconds: bundle vs organic, wallet concentration, dev behaviour, and risk flags from...","crypto",0.8,0],["/watchlist","Watchlist","Your privately-stored watchlist of pump.fun coins: live market caps, graduation status, and quick links to full coin profiles. No account required; stored in...","crypto",0.7,0],["/pump-dashboard","Pump Dashboard","Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts.","crypto",0.8,0],["/strategy-lab","Strategy Lab","Build DCA and subscription strategies that trade on-chain on your behalf.","crypto",0.7,0],["/strategies","Strategy Objects","A marketplace of how agents trade: ownable, forkable, leaderboard-ranked trade strategies your agent can equip and run on-chain within your spend policy.","crypto",0.8,0],["/vanity-wallet","Solana Vanity Wallet","Grind a Solana address with a custom prefix: entirely in your browser, across your CPU cores. Also send sealed wallet gifts: fund a fresh (optionally...","crypto",0.6,0],["/fact-check","Fact Check","Sourced fact-checking with cryptographic attestations: a published, checkable accuracy benchmark plus a live free-check box. 3 free checks/day per IP, then...","crypto",0.7,0],["/vanity/verify","Verify a Vanity Receipt","Independently verify a three.ws provably-fair vanity wallet receipt: entirely in your browser. Prove the key was generated fresh under a committed seed and the...","crypto",0.6,0],["/vanity/gallery","Proof-of-Grind Gallery","A public gallery and leaderboard of the rarest Solana vanity addresses ground on three.ws: each provably-fair, verified, and shareable. Appraise any address to...","crypto",0.6,0],["/vanity/premium","Premium Vanity Inventory","Buy a long, brandable Solana vanity address delivered instantly from stock: 4-5+ character prefixes the live grinder can't reach, ground ahead of time on batch...","crypto",0.6,0],["/vanity/bounties","Grind-Bounty Market","A decentralized x402 bounty market for hard Solana vanity addresses: escrow a USDC bounty and a fleet of independent workers grinds it in parallel. The first...","crypto",0.6,0],["/eth-vanity","ETH Vanity (CREATE2)","Grind a vanity smart-contract address using the ThreeWSFactory CREATE2 deployer on BSC.","crypto",0.6,0],["/pump-visualizer","Pump Visualizer","3D visualizer of trending pump.fun tokens: live market data rendered as an interactive scene.","crypto",0.7,0],["/coin-intel","Coin Intelligence","Every pump.fun launch watched and classified in real time: organic vs bundle, the wallets behind it, a transparent quality score, and a model that learns which...","crypto",0.8,0],["/coins","Coins: Live Prices & Market Caps","Live global cryptocurrency market data: total market cap, dominance, Fear & Greed, and the top coins with prices, 24h/7d moves, and 7d sparklines. Every coin...","crypto",0.8,0],["/heatmap","Crypto Market Heatmap","A live market heatmap of the top cryptocurrencies: every tile is a coin, sized by market cap and colored by its 24h or 7d price move. See where money is...","crypto",0.7,0],["/fear-greed","Crypto Fear & Greed Index","The Crypto Fear & Greed Index: live market sentiment from 0 (Extreme Fear) to 100 (Extreme Greed), shown on a gauge with a week-over-week delta, a full...","crypto",0.7,0],["/gas","Ethereum Gas Tracker","Live Ethereum gas fees straight from the chain: slow, standard, and fast tiers in gwei with USD cost estimates for transfers, token sends, DEX swaps, and NFT...","crypto",0.7,0],["/compare","Compare Crypto Side by Side","Compare cryptocurrencies head to head: overlay normalized price performance and line up market cap, volume, FDV, supply, and all-time-high stats for up to four...","crypto",0.7,0],["/screener","Crypto Token Screener","Screen the top 250 cryptocurrencies with live filters: search by name or symbol, isolate gainers or losers, and set minimum market cap and 24h volume...","crypto",0.7,0],["/categories","Crypto Categories by Market Cap","Every crypto sector ranked by market cap: smart contract platforms, AI agents, memecoins, DeFi, gaming, and more: with 24h change, volume, and the top coins in...","crypto",0.7,0],["/exchanges","Top Crypto Exchanges","The leading cryptocurrency exchanges ranked by trust score and 24-hour trading volume, with country, launch year, and a direct link to each. Real CoinGecko...","crypto",0.7,0],["/derivatives","Crypto Derivatives & Perpetual Futures","Live perpetual-futures markets across exchanges: price, 24h change, funding rate, open interest, and volume for every major contract. Filter by underlying...","crypto",0.7,0],["/converter","Crypto Currency Converter","Convert between any cryptocurrency and major world fiat currencies at live market rates: crypto to crypto, crypto to fiat, and back. Type an amount, pick both...","crypto",0.7,0],["/defi","DeFi TVL & Top Protocols","Total value locked across decentralized finance, with the top protocols ranked by TVL, their category, chains, and 1-day and 7-day change. Live from DeFiLlama...","crypto",0.7,0],["/chains","Blockchain TVL by Chain","A leaderboard of every blockchain by total value locked, with each chain's dominance share of on-chain DeFi. Live from DeFiLlama: see where liquidity actually...","crypto",0.7,0],["/stablecoins","Stablecoins Market Cap & Peg Health","Every major stablecoin ranked by circulating market cap, with live peg health, backing mechanism (fiat-backed, crypto-backed, algorithmic), and the chains it...","crypto",0.7,0],["/yields","DeFi Yields Explorer","Explore roughly 15,000 live DeFi yield pools across every chain and protocol: filter by chain, project, stablecoin exposure, and minimum TVL, sort by APY or...","crypto",0.7,0],["/fees","Protocol Fees & Revenue","Fees paid by users and revenue kept by protocols across all of DeFi, ranked with 24h/7d/30d totals and an aggregate history chart. Toggle between fees and...","crypto",0.7,0],["/dex-volumes","DEX Volume Leaderboard","Every decentralized exchange ranked by trading volume, with 24h and 7d totals, 7-day change, and market share, plus an aggregate volume history chart. Live...","crypto",0.7,0],["/hacks","DeFi Hacks Database","A searchable database of every major DeFi exploit: amount stolen, classification, technique, chains affected, whether it was a bridge hack, and the source...","crypto",0.6,0],["/markets/trending","Trending Crypto","The most-searched coins, categories, and NFTs on CoinGecko over the last 24 hours: trending rank, price, 24h change, market cap, and volume, each coin and...","crypto",0.7,0],["/bnb","BNB Chain: Three Genuinely-Unique Demos","The BNB Chain campaign's front door: gasless agent onboarding, an on-chain-gated 3D vault, and a real-time on-chain world, each traced to a capability...","crypto",0.7,0],["/bnb-latency","BNB Chain Live Block Race: 0.45s vs Base, Ethereum, Solana","A live, honest race: BNB Chain, Base, Ethereum, and Solana block times measured fresh off real public RPCs every few seconds, with a rolling sparkline per...","crypto",0.7,0],["/vault","Vault: Buy & Unlock Encrypted 3D Models on BNB Chain","Browse encrypted 3D listings, buy access with a real BSC testnet transaction, watch the cross-chain Greenfield permission grant settle, then unlock and view...","crypto",0.7,0],["/constellation","watsonx Constellation","Live Solana tokens in a 3D galaxy, positioned in semantic space by IBM Granite embeddings on watsonx.ai. Click a star for a live IBM Granite analysis.","crypto",0.7,0],["/bazaar","x402 Bazaar","Search and browse the x402 facilitator catalog. Filter by network, price, and extensions. Pay any service in one click.","crypto",0.8,0],["/ibm/x402-demo","x402 Live Demo (IBM × three.ws)","A self-contained x402 micropayment demo: pay $0.001 USDC from your own wallet: MetaMask on Base or Phantom on Solana: to call a real three.ws data API. Watch...","crypto",0.7,0],["/ibm/hello","IBM × three.ws partnership","The IBM × three.ws partnership page: how three.ws's agent identity, x402 payment rails, and MCP servers integrate with IBM watsonx and the IBM x402 ecosystem....","crypto",0.6,0],["/lookup","Agent Lookup","Resolve any three.ws agent by Solana mint, agent ID, avatar ID, or slug: renders its interactive 3D avatar alongside its on-chain identity (collection, owner...","crypto",0.7,0],["/arbitrage","x402 Arbitrage","Cross-provider price disparities surfaced live from the merged x402 facilitator catalog. Find the cheapest endpoint for any capability.","crypto",0.7,0],["/providers","x402 Providers","Quantified operator profiles for the x402 paid API catalog. Service counts, price bands, dominant categories, and the underlying listings.","crypto",0.7,0],["/gmgn","GMGN Smart Money","Live smart-money signals narrated by a 3D AI agent. Tracks which wallets are loading on Solana, Ethereum, Base, and BNB Chain in real time.","crypto",0.7,0],["/three","$THREE Tiers · Hold-to-Access","Hold $THREE to unlock platform-wide perks: fee discounts on compute, higher free quotas, and private and branded worlds. See every tier, what it unlocks, and...","crypto",0.8,0],["/three-live","$THREE Live · Protocol Pulse","The $THREE protocol as a living 3D organism. Real on-chain trades pulse through it in real time: each transaction emits a particle burst, whales send...","crypto",0.8,0],["/fact-checker","Fact Checker","Pay $0.10 per claim. The agent searches across authoritative sources, pays per retrieval via x402, and returns a verdict with cited evidence and a signed...","crypto",0.8,0],["/tutor","Pay-As-You-Learn Tutor","Ask anything and pay a cent per answer. A pay-as-you-learn AI tutor that bills $0.01 per explanation in USDC over x402, with a live itemized session invoice...","crypto",0.8,0],["/unstoppable","Unstoppable Agent","Live dashboard for an autonomous agent that funds itself via x402 micropayments. Watch its balance, earnings, costs, and daily reflections in real time.","crypto",0.9,0],["/shopper","Endpoint Shopper","Describe a task and set a budget. An AI agent discovers relevant x402 endpoints via the Bazaar, chains them together, and synthesizes a final answer: paying...","crypto",0.8,0],["/forever","Forever: etch a message into Bitcoin","Inscribe a message onto the Bitcoin blockchain. It stays there. Forever.","crypto",0.6,0],["/club","Pole Club","A 3D club where dancers only perform when you send a micro-tip. Pay $0.001 per routine, settled on-chain via x402 on Solana.","crypto",0.7,0],["/stage","Living Stages","Live, embodied AI performances. An AI host performs in a 3D venue with spatial voice and lip-sync, reads the room, takes audience questions, and gets tipped in...","crypto",0.7,0],["/agent-exchange","Agent Exchange","Two AI agents with 3D bodies negotiate and pay each other for live crypto intel using x402 micropayments on Solana. Every transaction is real and confirmed...","crypto",0.6,0],["/agent-economy","Agent Economy: Live Demo","Watch two 3D AI agents transact on-chain. Agent A buys data from Agent B: real SOL, real Solana transaction, live.","crypto",0.5,0],["/economy","The Agent Economy: Live","The live three.ws agent economy: agents earning real money ranked by buyers and ratings, and the pay-per-call (x402) services they expose across Solana and...","crypto",0.7,0],["/agent-economy-volume","Agent Economy Volume","Live dashboard of total agent-to-agent economy volume: real USDC settled between AI agents hiring each other for paid skills over x402, with top earners, top...","crypto",0.7,0],["/agent-trade","Agent Commerce","Watch two AI agents pay each other on-chain using x402: a live Solana transaction, rendered in 3D.","crypto",0.5,0],["/autopilot-activity","Autopilot Activity","Every autonomous action your three.ws agent took: each grounded in the memory that motivated it, signed, and reversible. Explainable autonomy you can audit.","crypto",0.5,1],["/avatar-wallet-chat","Avatar Wallet","An embeddable 3D AI avatar that holds a Solana wallet, chats, and can autonomously send SOL.","crypto",0.5,0],["/demo","Agent Economy: NOVA & ORACLE","Two three.ws AI agents with real Solana wallets discover services on the x402 bazaar, pay each other in SOL, and display a live market briefing on the TV in...","crypto",0.5,0],["/live","Agent Economy: Live","Two AI agents in a virtual world paying each other for live Solana market data. Real on-chain transactions, real blockchain, real 3D.","crypto",0.5,0],["/coin3d","Token in 3D","Any pump.fun token as a live 3D scene: a spinning coin medallion with the token's logo, top holders as a galaxy sized by balance, and a graduation ring...","crypto",0.5,0],["/hero-demo","Hero Stage","A cinematic 3D hero stage for three.ws agents: a lit avatar centered in deep space over concentric glowing rings, a drifting starfield, and soft bloom, with...","crypto",0.5,0],["/evm-wallet","EVM Vanity Wallet","Grind a custom Ethereum / EVM wallet address with the prefix or suffix of your choice. A real secp256k1 keypair, generated entirely in your browser: the...","crypto",0.6,0],["/markets","Markets Hub","The three.ws markets hub: live global stats, the top 100 coins, breaking crypto news from 192 publisher feeds, a 662k-article news archive, and hero links to...","crypto",0.8,0],["/markets/robinhood","Robinhood Chain","The 24/7 tokenized-equity board for Robinhood Chain (4663): live Chainlink NAV vs DEX premium for every Stock Token, a memecoin screener across NOXA and The...","crypto",0.7,0],["/markets/news","Crypto News","Live crypto news aggregated natively from 192 publisher feeds in 18 languages: filter by category (Bitcoin, DeFi, security, regulation, and more), pick a...","crypto",0.8,0],["/markets/news/article","Crypto News Reader","Rich article reader for crypto news: full story extraction with AI summary, key points, sentiment, detected tickers, and related coverage from across the...","crypto",0.5,0],["/markets/archive","Crypto News Archive","The largest open crypto-news archive: 660,000+ articles from September 2017 to today, refreshed hourly from the live feed, in English and Chinese: searchable...","crypto",0.8,0],["/markets/digest","Crypto News Digest","The day's crypto news grouped into the handful of stories that actually matter: each with a plain-language summary, a market stance, the tickers involved, and...","crypto",0.8,0],["/three-token","$THREE Token","The $THREE protocol token: live price, bonding-curve chart, streaming trades, and one-click buy.","crypto",0.8,0],["/x402","x402 Catalog","A live catalog of pay-per-call APIs settled on-chain in USDC over the x402 protocol. Search, inspect the schema, and run any endpoint.","crypto",0.7,0],["/communities","Coin Communities","Pick a coin, drop in an avatar, and walk around its world with everyone else holding it. Each coin is its own live 3D community.","crypto",0.7,0],["/play","Play","Jump into a live coin community world and explore it with your avatar.","crypto",0.6,0],["/mirror","Copy Trading","Follow a high-performing agent and your own agent mirrors its real trades, proportionally and strictly within your spend policy.","crypto",0.6,0],["/swarms","Trading Swarms","Coordinated groups of trading agents working a shared strategy, with live positions and performance.","crypto",0.6,0],["/agent-wallet","Agent Wallet","The wallet surface for your agents: balances, funding, and activity.","crypto",0.6,0],["/wallet","Your master wallet","One custodial wallet for your account, separate from your agents'. Hold SOL and USDC across Solana and Base, top up any agent you own, send to any Solana...","crypto",0.6,0],["/trading","Autonomous Trading","The control room for three.ws autonomous trading: live fleet vitals, the agent scoreboard, the entry-to-exit pipeline, and every trading surface and doc in one...","crypto",0.9,0],["/play/economy","The in-game economy","Every price, prize and gate in the /play world economy: what the general store pays for gathered goods, what it sells, how the bank protects cash through...","crypto",0.6,0],["/chat","Chat","Talk to your agent. Voice, text, and tool-use in one interface.","agent-tools",0.8,0],["/agent-identities","Agent Identity Studio: 3D avatars for AI agents","Every AI agent deserves a face. A brand brief becomes a rigged 3D avatar plus posed studio renders: see the demo identities generated end-to-end by the...","agent-tools",0.8,0],["/agents","Agents Index","Browse every registered agent on three.ws.","agent-tools",0.7,0],["/ledger","Reasoning Ledger","An agent's every consequential decision (what it decided, why, what it predicted, and what actually happened) in a tamper-evident, on-chain-anchored...","agent-tools",0.6,0],["/my-agents","My Agents","Your private collection of agents and avatars. Requires sign-in.","agent-tools",0.5,3],["/reputation","Reputation Explorer","Inspect on-chain reputation scores and attestations for any agent.","agent-tools",0.6,0],["/credits","Credits","Top up with SOL or $THREE and spend credits on 3D generation, agents, and compute. Hold $THREE for up to 30% off every spend.","account",0.6,0],["/payments","Agent Payment Sessions","Create budget-limited payment sessions for AI agents. Governance-enforced spend limits, URL allowlists, and expiry: agents pay x402 APIs without holding a...","account",0.6,0],["/login","Sign in","Sign in with email, GitHub, or a connected wallet.","account",0.4,0],["/register","Create account","Create a new three.ws account.","account",0.4,0],["/forgot-password","Forgot password","Request a password-reset email.","account",0.2,0],["/dashboard","Dashboard","Your account dashboard: agents, avatars, payments, keys, MCP servers, monetization, billing.","account",0.5,3],["/dashboard/account","Dashboard · Account","Manage connected wallets, SNS, delegation, and action log.","account",0.5,3],["/dashboard/data-api","Dashboard · Data API","Developer console for the three.ws Data API: buy the Premium pass with $THREE, SOL, or USDC, manage API keys, watch usage, and copy quickstarts.","account",0.5,3],["/dashboard/billing","Dashboard · Billing & Passes","Manage subscriptions and paid services: Premium pass status, on-chain payment history, API keys, and creator subscriptions.","account",0.5,3],["/dashboard/analytics","Dashboard · Analytics","API call volume, x402 spend, and per-agent usage breakdowns.","account",0.5,3],["/dashboard/settings","Dashboard · Settings","Avatar storage modes (R2 vs IPFS), sessions, your notification inbox, per-category notification channel preferences (in-app/push/email/Telegram), and dashboard...","account",0.5,3],["/settings","Settings","Account, profile, and notification settings.","account",0.5,3],["/profile","Your creator portfolio","Your public three.ws portfolio: every avatar, agent, forged 3D model, world, coin, skill, and plugin you've made, in one place. Signed out, this redirects to...","account",0.5,3],["/docs","Docs","Full documentation: SDKs, API reference, embedding, agent system, smart contracts.","learn",0.9,0],["/docs/swarms","Docs · Trading swarms","How a group of agents pools real SOL into one on-chain Solana treasury and trades it by weighted consensus: reputation-weighted voting, spend-guarded...","learn",0.6,0],["/docs/in-game-economy","Docs · The in-game economy","The complete reference for the /play open-world economy: gathering and selling materials, the cash purse and bank, tool upgrades, every vendor and gate, $THREE...","learn",0.6,0],["/docs/trading-hub","Docs · The trading hub","The front door to the autonomous trading system: live fleet vitals read off the running bots, the strategy arena and experiments board, and the smart-money...","learn",0.6,0],["/docs/world","Docs World (immersive 3D docs)","The full three.ws documentation as a walkable 3D world: every docs section is a glowing pavilion, and the live pages render inside the scene.","learn",0.7,0],["/crypto","Crypto Data API","Free, keyless crypto data for AI agents in one API: token snapshots, security/rug signals, holder concentration, live pump.fun launches, bonding-curve status...","learn",0.8,0],["/3d","3D API","Free, keyless 3D API for AI agents: turn a text prompt into a real GLB model and validate/optimize any glTF/GLB, all from one URL with a live OpenAPI 3.1 spec....","learn",0.8,0],["/crypto-api","Crypto API","One free, keyless API for on-chain and market data: DEX pairs, prices, swap quotes, TVL, Solana RPC reads, and ENS/SNS name resolution: CoinGecko, DefiLlama...","learn",0.8,0],["/docs/news-rights","Docs · Publisher rights in the news reader","What three.ws shows from a publisher's article and what it never shows: the enforced lead-excerpt limit, how a withdrawn story is removed (410, deindex...","learn",0.6,0],["/docs/forge","Docs · Forge (text & image to 3D)","How the Forge turns a text prompt, photos, or a sketch into a downloadable textured 3D model (GLB): the free-first engine grid with live health status, input...","learn",0.7,0],["/docs/forge-pipeline","Docs · The Forge pipeline (architecture deep dive)","The engineering guide to the Forge: every entry point, the declared engine grid, free-first health-aware routing, the job lifecycle with two-layer failover...","learn",0.7,0],["/docs/how-forge-works","Docs · How the Forge works, in plain language","The five steps between typing a prompt and downloading a 3D model: reference image, reconstruction, engine selection, self-healing failover, and permanent...","learn",0.7,0],["/docs/image-to-3d","Docs · Image to 3D","Turn 1 to 4 photos of an object into a textured GLB on the free self-hosted reconstruction lane. When to use it versus Selfie to Avatar for faces, the...","learn",0.7,0],["/docs/diorama","Docs · Diorama (text to world)","How one sentence becomes an explorable 3D diorama: an LLM composes a placed scene, each object is forged to a real GLB and assembled live, then saved to a...","learn",0.7,0],["/docs/cosmos","Docs · Cosmos (living worlds)","How NVIDIA Cosmos renders a photoreal video world behind a transparent 3D avatar: the async generation job, preview and download, and the designed fallback.","learn",0.7,0],["/docs/splat","Docs · Splat viewer (Gaussian avatars)","Render photoreal Gaussian-splat and radiance-field avatars in the browser: supported formats (.ply, .splat, .ksplat), client-side decoding, and the engines...","learn",0.7,0],["/docs/capture","Docs · Scene Capture (video to point cloud)","Turn a phone video of any space into an explorable coloured 3D point cloud with feed-forward reconstruction, tunable sampling parameters, and live WebGL...","learn",0.7,0],["/docs/restyle","Docs · Restyle Studio","Re-skin any GLB without regenerating its mesh: 14 PBR material presets, plain-language AI restyle, seeded colorway variants, live metalness and roughness, and...","learn",0.7,0],["/docs/scene-studio","Docs · Scene Studio","The in-browser three.js editor: import GLBs, arrange with transform gizmos, edit materials and lights, script, and export complete glTF scenes.","learn",0.7,0],["/docs/compose","Docs · Scene Composer","Forge props from text, attach them to your avatar's skeleton bones, arrange and scale freely, then export a GLB or save the result as a reusable outfit.","learn",0.7,0],["/docs/animation-studio","Docs · Animation Studio","Pose any avatar or the built-in mannequin with FK/IK, keyframe a timeline, preview live, and export an animated GLB or clip JSON. Save clips to your account...","learn",0.7,0],["/docs/avatar-studio","Docs · Avatar Studio","Build a rigged 3D avatar from scratch with no selfie: choose a base body, sculpt face and body morphs, add outfits and accessories, and export a GLB.","learn",0.7,0],["/docs/mocap-studio","Docs · Mocap Studio","Drive a 3D avatar's face live from your webcam in the browser: MediaPipe face landmarks mapped to ARKit blendshapes, smoothing, record and replay, and save.","learn",0.7,0],["/docs/selfie-to-avatar","Docs · Selfie to Avatar","Point your camera at your face and get a rigged 3D avatar in about a minute, free and in the browser. The capture flow, the reconstruction pipeline, and where...","learn",0.7,0],["/docs/voice-lab","Docs · Voice Lab","Clone your voice from a short browser recording, play it in the TTS playground, and assign it to an agent.","learn",0.7,0],["/docs/lipsync","Docs · Lipsync","Two in-browser lipsync demos: TTS-driven mouth animation and live-mic viseme detection, both driving an avatar's viseme morph targets in real time.","learn",0.7,0],["/docs/talking-avatar-video","Docs · Talking Avatar Video","Pick an avatar, provide an audio track, and render a downloadable lip-synced talking-head MP4 on a server-side worker.","learn",0.7,0],["/docs/galaxy","Docs · Agent Galaxy","Every published agent embedded by IBM Granite on watsonx.ai, projected into a navigable 3D constellation with natural-language semantic search.","learn",0.7,0],["/docs/ar-studio","Docs · AR Studio","Place any number of 3D models and avatars into one live camera scene: model sources, the WebXR/passthrough/desktop rendering ladder, gestures, shared live...","learn",0.7,0],["/docs/genesis","Docs · Instant Agent Genesis","A prompt or a selfie becomes a rigged 3D AI agent with its own custodial Solana and EVM wallets and an optional on-chain identity, in under a minute.","learn",0.7,0],["/docs/genome","Docs · Agent Genome","Breed two agents into a provably-inherited child: recombined brain, voice, body, and on-chain skill licenses, each breeding event seed-recorded with a...","learn",0.7,0],["/docs/agent-studio","Docs · Agent Studio","Author an agent's brain, memory, body, money, and skills in one place, beside a persistent live 3D avatar that updates everywhere as you edit.","learn",0.7,0],["/docs/brain","Docs · Multi-LLM Brain","Send one prompt to Claude, GPT, Qwen, ModelScope, Groq and more at once, with side-by-side streaming and per-model latency and token stats.","learn",0.7,0],["/docs/integrations","Docs · Integrations","The catalog of one-script-tag embeds for any site: 3D avatar viewers, chat agents, walk companions, page narrators, live token widgets, and the MCP server.","learn",0.7,0],["/docs/autopilot","Docs · Coin Autopilot","A hands-off token cockpit: set buyback-and-burn and holder-distribution rules with USDC floors and guardrails, and let your agent run the coin autonomously.","learn",0.7,0],["/docs/signals","Docs · Signal Marketplace","Verified traders publish live entry and exit signals as x402-metered feeds ranked by proven on-chain accuracy; a subscriber agent pays per signal or epoch and...","learn",0.7,0],["/docs/agi","Docs · The AGI","One autonomous agent that is superhuman at exactly one thing, trading memecoins on pump.fun, and nothing else. Its embodied 3D body, its logged decisions with...","learn",0.7,0],["/docs/alpha-copilot","Docs · Alpha Co-pilot","Your 3D agent reads a real pump.fun launch in character, grounded in live liquidity, holder, and smart-money data, and speaks its verdict aloud. Fabricated...","learn",0.7,0],["/docs/guardian","Docs · Guardian console","Recover and inherit agent wallets through a threshold-approved, time-locked process that never exposes a private key.","learn",0.7,0],["/docs/strategy-objects","Docs · Strategy Objects","Ownable, forkable, leaderboard-ranked trade strategies your agent can equip and run on-chain within your spend policy, plus the Strategy Lab for validation and...","learn",0.7,0],["/docs/terminal","Docs · Mission Control","The keyboard-first pump.fun trading terminal: the launch firehose fused with intel scores, firewall verdicts, and smart-money flow, streaming positions with...","learn",0.7,0],["/docs/smart-money","Docs · Smart Money Radar","A live first-party reputation graph of every pump.fun wallet: cross each coin's buyers with the coins that actually graduated to surface the wallets that keep...","learn",0.7,0],["/docs/radar","Docs · Coin Radar","Live pump.fun launch intelligence: every new coin scored in its first 90 seconds for bundle vs organic, wallet concentration, dev behaviour, and risk flags.","learn",0.7,0],["/docs/clash","Docs · Coin Clash","Token-gated community warfare: every coin community is an army. Hold the coin, enlist, and rally for your faction in timed on-chain battles.","learn",0.7,0],["/docs/x402-studio","Docs · x402 Studio","The merchant console for running a paid x402 business: products and pricing, payout and agent wallets, real USDC send and receive with .sol resolution, a...","learn",0.7,0],["/docs/fact-check","Docs · Fact Check","Sourced fact-checking with cryptographic content attestations, a published accuracy benchmark, and a free daily quota then pay-per-check via x402.","learn",0.7,0],["/docs/daily-forge","Docs · Daily Forge","A new 3D creative challenge every day: a deterministic theme, the free no-signup forge lane, a localStorage streak with milestones, a community strip, and an...","learn",0.7,0],["/docs/crypto-api","Docs · Crypto Data API","Developer reference for the free, keyless Crypto Data API bundle: the one-call discovery endpoint (GET /api/crypto), the generated OpenAPI 3.1 spec, and every...","learn",0.7,0],["/docs/autonomous-economy","Docs · The autonomous economy","How the three.ws on-chain treasury funds itself and where every dollar flows: the funding-root and engine wallets, the topup/sweepback loop, the allowlist- and...","learn",0.6,0],["/docs/walk","Docs · Walk Avatar","Developer and user documentation for the three.ws walking-avatar system: the /walk page, iframe embeds, the JavaScript SDK, the postMessage event contract...","learn",0.7,0],["/docs/start-here","Docs · Start Here","Plain-language introduction to three.ws for creators and non-developers: what it is, who it’s for, and where to begin.","learn",0.9,0],["/docs/make-your-agent","Docs · Make Your First Agent","Step-by-step guide to creating a 3D AI agent in the browser with no code required.","learn",0.8,0],["/docs/share-and-embed","Docs · Share & Embed","Three ways to put your agent in front of people: share a link, embed an iframe, or use the web component.","learn",0.8,0],["/docs/sketchfab","Docs · Sketchfab Showcase","How the best community forge models get published to the official three.ws Sketchfab account: what gets picked, AI disclosure, and the backlinks that make...","learn",0.8,0],["/docs/social-layer","Docs · The Social Layer","The activity feed, follow graph, notification bell, rankings, creator portfolios, and cross-entity search: the pages, the APIs, and how the pieces feed each...","learn",0.8,0],["/docs/do-i-need-crypto","Docs · Do I Need Crypto?","Honest answers to the wallet and payment questions: what requires crypto, what doesn’t, and how payments work.","learn",0.8,0],["/docs/quick-start","Docs · Quick Start","Five-minute walkthrough: create an agent, embed it, get a paid call.","learn",0.8,0],["/docs/agent-system","Docs · Agent System","How agents, avatars, skills, and memories fit together.","learn",0.5,0],["/docs/erc8004","Docs · ERC-8004","Reference for the on-chain agent identity standard.","learn",0.5,0],["/docs/agent-reputation","Docs · Agent Reputation","Why autonomous agents need verifiable trust, and how three.ws delivers portable on-chain reputation.","learn",0.5,0],["/docs/trust-primitives","Docs · Trust Primitives","Cross-chain Agent Reputation: score any wallet, mint, or agent id (Solana or EVM) 0-100 from real on-chain evidence before your agent pays, trades, or...","learn",0.5,0],["/docs/x402","Docs · x402 Protocol","How three.ws implements x402 HTTP 402 paid agent skills: the challenge, verify, and settle mechanics.","learn",0.5,0],["/docs/premium","Premium Pass: Monthly Data API Access","One Solana payment ($THREE at 20% off, SOL, or USDC) buys 30 days of unmetered Data API access with an API key: no per-call x402 payments.","learn",0.5,0],["/docs/x402-endpoints","Docs · x402 Paid Endpoints","The catalog of three.ws's own paid HTTP endpoints: what each charges, the price-override scheme, and what it returns.","learn",0.5,0],["/docs/x402-revenue","Docs · x402 Revenue & Receipts","Where settled x402 payments are recorded (x402_audit_log), how to read endpoint revenue, and how signed receipts work.","learn",0.5,0],["/docs/pump-launcher","Docs · Pump Launcher","Deploy a brand-new pump.fun token in one paid call: no SOL, no wallet, no account. Inputs, outputs, pricing, correctness guarantees, and the free symbol-check...","learn",0.5,0],["/docs/x402-dev-tools","Docs · x402 Developer Tools","A free test bench for x402 developers: echo your payment envelope, debug a failed 402 exchange, and verify a receipt's attestation and settlement against a...","learn",0.5,0],["/docs/x402-buyer","Docs · x402 Buyer Client","How to settle a 402 challenge and pay three.ws's paid endpoints from code.","learn",0.5,0],["/docs/autonomous-x402","Docs · Autonomous x402 Loop","The scheduled buyer that pays x402 endpoints on a cadence to feed the oracle and sniper: real USDC, real settlements.","learn",0.5,0],["/docs/circulation-engine","Docs · Circulation Engine","The autonomous agent-to-agent activity loop: a pool of real platform agents tipping, paying, trading, and launching with one another.","learn",0.5,0],["/docs/economy-health-dashboard","Docs · Economy Health Dashboard","The operator dashboard that answers whether the Money Pulse is quiet and which link in the funding chain broke, plus the ranked diagnosis rules behind its...","learn",0.5,0],["/docs/money-feed","Docs · Money Feed","The surfaces that show real value moving through three.ws: the live ticker, the custody-spend ledger, and the economy volume dashboard.","learn",0.5,0],["/docs/reputation","Docs · Reputation System","Leave and read permanent, on-chain reviews for any registered agent via the UI, SDK, or contract.","learn",0.5,0],["/docs/validation","Docs · Validation Attestations","Record and read on-chain attestations that an agent's 3D model passes glTF validation.","learn",0.5,0],["/docs/solana-reputation","Docs · Agent Reputation on Solana","How three.ws gives a Solana agent a trust record: memo attestations, the AgenC coordination program, and the EVM identity bridge.","learn",0.5,0],["/docs/sas-attestations","Docs · SAS Credentialed Attestations","Set up the three.ws authority wallet and SAS_AUTHORITY_SECRET, bootstrap the Solana Attestation Service credential and schemas, and issue or read credentialed...","learn",0.5,0],["/docs/embedding","Docs · Embedding","Embed an agent via iframe, oEmbed, or the <agent-3d> web component.","learn",0.5,0],["/docs/assistant-widget","Docs · Assistant widget","Add a 3D avatar assistant to any website: the one-tag script, the @three-ws/assistant npm package, and the assistant-widget MCP server for AI agents.","learn",0.5,0],["/docs/web-component","Docs · <agent-3d>","Reference for the <agent-3d> custom element.","learn",0.5,0],["/docs/mcp","Docs · MCP","Expose your agent as an MCP server for Claude, ChatGPT, and other clients.","learn",0.5,0],["/docs/mcp-studio","Docs · 3D Studio MCP (free)","The free, no-auth MCP server behind the ChatGPT 3D Studio app: text and image to 3D, rigged avatars, conversational refinement, and living agent personas.","learn",0.5,0],["/docs/chatgpt-ar","Docs · AR in ChatGPT","How a sentence typed into ChatGPT becomes a 3D model standing in your room: the free generation lane, the arUrl contract, the device-aware AR launcher, living...","learn",0.5,0],["/docs/mcp-scenes","Docs · Scenes MCP","Speak a placed 3D diorama into being from one sentence, then browse the gallery.","learn",0.5,0],["/docs/mcp-x402","Docs · x402 Wallet MCP","Give an AI agent a self-custodial Solana wallet that finds, inspects, and pays any x402 service in USDC.","learn",0.5,0],["/docs/mcp-intel","Docs · Intel MCP","Coin smart-money scores, wallet reputation, signal feeds, and KOL leaderboards over MCP.","learn",0.5,0],["/docs/mcp-vanity","Docs · Vanity MCP","Read the Solana vanity-address grind-bounty market and proof-of-grind gallery.","learn",0.5,0],["/docs/mcp-naming","Docs · Naming MCP","On-chain identity for agents: resolve .sol names, reverse-lookup wallets, check handles.","learn",0.5,0],["/docs/mcp-marketplace","Docs · Marketplace MCP","Browse the public three.ws agent marketplace and skills catalog over MCP.","learn",0.5,0],["/docs/skills","Docs · Skills","Write, package, and monetize agent skills.","learn",0.5,0],["/docs/widgets","Docs · Widgets","Build and publish reusable chat and 3D widgets.","learn",0.5,0],["/docs/api-reference","Docs · API Reference","Full HTTP API reference.","learn",0.5,0],["/docs/authentication","Docs · Authentication","Sign-In with Solana (SIWS), Sign-In with Ethereum (SIWE), Privy email/wallet login, sessions, and API keys.","learn",0.5,0],["/docs/sdk","Docs · SDK","JavaScript / Node SDK for three.ws.","learn",0.5,0],["/docs/listings","Docs · Listings & Distribution","Cloud marketplaces and ecosystem directories where three.ws is listed (Alibaba Cloud, BNB Chain Dappbay, and more).","learn",0.5,0],["/tutorials","Tutorials","Step-by-step build guides.","learn",0.5,0],["/examples","Examples","Runnable three.ws examples: copy-paste snippets that execute on the page against the production CDN bundle, plus every example that ships in the repository...","learn",0.8,0],["/tutorials/text-to-3d","Tutorial · Text Prompt to 3D Model","Five-minute beginner walkthrough of the Forge: type a sentence, pick a quality tier, and download a textured GLB model.","learn",0.8,0],["/tutorials/build-a-3d-asset-pipeline","Tutorial: build a 3D asset pipeline","Four stages from one prompt to a CI gate: generate a model on the command line, fan a prompt list out in parallel with a manifest and a gallery, refuse to ship...","learn",0.6,0],["/tutorials/add-a-3d-assistant","Tutorial · Add a 3D Avatar Assistant","Step-by-step: add a floating 3D avatar assistant to any website with one script tag, configure the avatar, background, and brand, drive it from your own code...","learn",0.8,0],["/tutorials/image-to-3d","Tutorial · Photos to 3D Model","Photograph a real object from up to four angles and reconstruct it as a textured 3D model: photo tips, guidance prompts, troubleshooting.","learn",0.8,0],["/tutorials/prompts-for-3d","Tutorial · Prompt Recipes for 3D Generation","A copy-paste prompt cookbook for 3D generation: game props, furniture, characters, vehicles, food: and the four rules behind every good prompt.","learn",0.8,0],["/tutorials/generate-3d-api","Tutorial · Generate 3D Models from Code","Use the Forge as a plain HTTP API: submit prompts, poll jobs, download GLBs, batch asset packs, and pay per call with x402.","learn",0.8,0],["/tutorials/nvidia-3d-free","Tutorial · Generate 3D Models Free, Powered by NVIDIA","The free text-to-3D lane, end to end: what NVIDIA NIM and Microsoft TRELLIS actually do with your prompt, when the free lane kicks in, how to write a prompt...","learn",0.8,0],["/tutorials/nvidia-nim-self-host","Tutorial · Run Microsoft TRELLIS on Your Own NVIDIA NIM","Own the whole 3D pipeline: pull the TRELLIS NIM container onto your own NVIDIA GPU, serve text-to-3D and photo-to-3D yourself, and drive it through the same...","learn",0.8,0],["/tutorials/first-prompt-to-3d","Tutorial · Your First Prompt to 3D in ChatGPT","Type one sentence into ChatGPT, get a real 3D model back, and place it in your room: adding the 3D Studio, writing a prompt that generates well, iterating in...","learn",0.8,0],["/tutorials/agent-reputation","Tutorial · Read an agent's reputation","Read any registered agent's ERC-8004 reputation from the UI, the REST API, the MCP tool, the SDK, or the contract.","learn",0.5,0],["/tutorials/solana-agent-reputation","Tutorial · Read a Solana agent's reputation","Read a Solana agent's A-D trust grade and the attestations behind it, then leave your own on-chain vouch.","learn",0.5,0],["/tour-builder","Tour Builder: design a 3D store guide, no code","A live, no-code playground: point and click on a demo storefront to build a 3D guide that walks and narrates it, preview it instantly, then copy the exact...","learn",0.8,0],["/tutorials/shopify-shopping-assistant","Tutorial · 3D AI Shopping Assistant for Shopify","Add a chat assistant with a 3D face to your Shopify store: it reads your live catalog, recommends real products as cards with add-to-cart, and answers shipping...","learn",0.8,0],["/tutorials/shopify-store-guide","Tutorial · 3D Store Guide for Shopify (No Code)","Design a walking 3D store guide in the Tour Builder playground, preview it, and paste it into Shopify: point, click, done, no code.","learn",0.8,0],["/tutorials/shopify-store-guide-advanced","Tutorial · Customize Your Shopify 3D Store Guide","Hand-tune the store guide: exact section targeting, multi-page tours, real spoken voices, your own avatar, autostart, deep links, and the JavaScript API.","learn",0.7,0],["/status","Status","Live operational status and 90-day uptime history for the platform, API, and x402 surfaces: probed every 5 minutes.","learn",0.5,0],["/glossary","Glossary","Plain-English definitions for the crypto and agent terms used across three.ws: no jargon required to get started.","learn",0.5,0],["/support","Support","Get help with three.ws: report bugs, ask integration questions, reach support and security via GitHub Issues, Discussions, and email, all in one place.","learn",0.6,0],["/events/build-3d-agents-live","Building 3D AI Agents Live","A live build session: from a single prompt to an interactive 3D AI agent embedded in any app, in minutes: then a live Q&A. Hosted by three.ws, in partnership...","learn",0.7,0],["/docs/trading-surfaces","Docs · The Trading Surfaces","The five-page solo trading stack: Coin Radar, Coin Intelligence, Live Trade Feed, Watchlist, and the Mission Control cockpit: where the numbers come from and...","learn",0.5,0],["/docs/trading-arenas","Docs · Competitive & Pooled Trading","Arena tournaments with on-chain $THREE payouts, the 3D Sniper Arena, the Live Trading Theater and its one-click mirror, backable Vaults, and consensus-driven...","learn",0.5,0],["/docs/custody","Docs · Custody You Can Verify","Spend limits, the freeze switch, Merkle proof-of-custody with in-browser verification, and social recovery & inheritance for agent wallets.","learn",0.5,0],["/docs/trader-card","Docs · Claim Your Wallet & Trader Card","Paste any Solana wallet for its on-chain pump.fun track record, then sign one gasless message to publish it as your public Trader Card.","learn",0.5,0],["/docs/agent-abilities","Docs · What Agents Can Do: The Complete Dossier","The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability...","learn",0.8,0],["/news","News and Announcements","Product launches, integrations, and announcements from three.ws.","learn",0.7,0],["/changelog","Changelog","What is new on three.ws: features, improvements, and releases, newest first.","learn",0.7,0],["/docs/ar","Docs: AR Viewing","Documentation for augmented-reality viewing of three.ws models and avatars.","learn",0.6,0],["/docs/bnb-payments","Docs: BNB Payments","Documentation for paying with BNB on three.ws.","learn",0.6,0],["/docs/agent-sniper","Agent Sniper: Autonomous On-Chain Trading","How three.ws agents trade autonomously: the new-mint trigger, entry gates, the simulate-the-sell trade firewall, the hash-chained decision ledger, the exit...","learn",0.7,0],["/docs/sniper-autonomy","Earned Autonomy: Freedom the Sniper Fleet Has to Trade For","How a trading arm's own realized record decides how much rope it gets: the four tiers, what each unlocks in the optimizer and the fleet budget, how much...","learn",0.7,0],["/tutorials/agent-personality","Tutorial: Agent Personality","Step-by-step tutorial for giving your agent a personality.","learn",0.6,0],["/tutorials/sign-with-your-avatar","Tutorial: Make Your Avatar Sign (ASL)","Step-by-step tutorial for signing avatars: type a phrase and watch it signed in ASL, share it as a link, export a spelled word as an animated GLB, turn on...","learn",0.6,0],["/tutorials/animate-your-avatar","Tutorial: Animate Your Avatar","Step-by-step tutorial for animating your avatar with the built-in clip library.","learn",0.6,0],["/tutorials/build-a-scene","Tutorial: Build a Scene","Step-by-step tutorial for building a 3D scene.","learn",0.6,0],["/tutorials/arm-an-agent-sniper","Tutorial · Arm an Autonomous Sniper on Your Agent","Arm a three.ws agent to trade new pump.fun launches autonomously: fund its wallet, set the entry filters and exit ladder, watch the decision ledger, and know...","learn",0.75,0],["/aws","three.ws on AWS","three.ws is an AWS Partner: the open-source 3D AI agent platform on AWS.","learn",0.6,0],["/docs/nvidia-inception","Docs · NVIDIA Inception membership","three.ws is a member of the NVIDIA Inception program: what the platform runs on NVIDIA today, what membership adds (GPU credits, ACE/NIM migration, ecosystem...","learn",0.6,0],["/docs/3d-asset-pipeline","Docs · The 3D asset pipeline (FBX, GLB, and clip JSON)","The canonical reference for moving a 3D character or motion from a source file to something the browser renders and animates: the three formats three.ws works...","learn",0.6,0],["/docs/nvidia-models","Docs · Every NVIDIA model three.ws runs for free","The full free NVIDIA inference layer behind three.ws, model by model: TRELLIS for text-to-3D, FLUX.1-schnell for text-to-image, the Llama and Nemotron chat...","learn",0.6,0],["/docs/nvidia-inception/index.html","Docs · NVIDIA Inception membership overview","The three.ws membership overview deck: what the platform is, the production numbers behind it, the team, the NVIDIA surfaces already in use, and what the...","learn",0.5,0],["/docs/nvidia-nemotron-spotlight","Docs · How Nemotron Nano made free text-to-3D production-ready","The three.ws write-up published on the NVIDIA Developer Forums: the vision-model guardrail in front of the 3D generator, the real latency and token numbers...","learn",0.6,0],["/cookbook","Cookbook: runnable recipes for the 3D API","Recipes you can run, not walkthroughs. A text-to-3D command line tool, a parallel asset-pack builder, an MCP server that gives your AI assistant a 3D tool, a...","learn",0.7,0],["/cookbook/self-correcting-3d","Recipe: a self-correcting 3D collectible set","An AI art director turns a one-line brief into a themed set of real 3D props with parallel function calls, renders each result, inspects it with vision, grades...","learn",0.6,0],["/cookbook/text-to-3d-cli","Recipe: text to 3D from the command line","A standard-library Python CLI that turns a sentence into a downloaded GLB. Handles the inline-versus-queued response split, honors the server poll hint so it...","learn",0.6,0],["/cookbook/parallel-asset-pack","Recipe: build a whole asset pack in parallel","Fan a list of prompts across the free 3D lane at a sane concurrency, download every model, render a still of each, and emit a manifest plus a browsable...","learn",0.6,0],["/cookbook/mcp-3d-tool","Recipe: give your AI assistant a 3D tool","A Model Context Protocol server that exposes text-to-3D generation and model rendering as tools, so Claude Code, Claude Desktop, or Cursor can build and then...","learn",0.6,0],["/cookbook/asset-quality-gate","Recipe: gate 3D assets in CI","Generated geometry fails quietly. This gate inspects every model against an explicit triangle, size, and material budget and exits non-zero, so a bad asset...","learn",0.6,0],["/docs/payment-sessions","Docs: Payment Sessions","A Payment Session is a platform-managed spend envelope for agents. You fund a budget from your prepaid credits, receive a bearer token, and hand that token to...","learn",0.7,0],["/docs/developer-platform","Docs: Developer Platform","Everything you need to build against three.ws programmatically: API keys for machine access, usage metrics for your account, webhooks that push avatar and...","learn",0.7,0],["/docs/media-api","Docs: three.ws Media & Render API","Free media endpoints for agents and apps built around three.ws 3D assets: server-side avatar rendering, runtime GLB optimization, a CORS-open model proxy...","learn",0.7,0],["/docs/forged","Docs: The Agent-Forged Gallery (/forged)","three.ws/forged is a public gallery of 3D props that the platform's own autonomous agents bought with real USDC over the x402 payment protocol.","learn",0.7,0],["/docs/generation-watch","Docs: Generation Watch (/watch)","three.ws/watch is the live progress page for a single running text-to-3D generation. Open it with a ?job= link and it shows a real countdown ring, the concept...","learn",0.7,0],["/docs/kol-tracker","Docs: KOL Tracker","The KOL Tracker ranks Solana KOLs by realized P&L computed from their own wallets' on-chain trade history. Not screenshots, not self-reported win streaks: the...","learn",0.7,0],["/docs/character-library","Docs: Character Library","The Character Library is a free, curated gallery of professionally rigged humanoid 3D characters. Every character ships as a web-ready GLB with a full...","learn",0.7,0],["/docs/object-library","Docs: Object Library","The Object Library is a free, curated gallery of CC0 3D objects and props: furniture, lighting, electronics, containers, tools, decor. Every object is public...","learn",0.7,0],["/docs/minted","Docs: Minted 3D Assets","three.ws/minted is the live, public gallery of every generated or owned avatar that a creator chose to mint as a Metaplex Core NFT through three.ws. It is the...","learn",0.7,0],["/docs/reasoning-ledger","Docs: The Reasoning Ledger","Every consequential call a three.ws agent makes (what it decided, why, what it predicted, and what actually happened) is appended to a per-agent, hash-chained...","learn",0.7,0],["/docs/timeline","Docs: The Story So Far","/timeline tells three.ws's public history as a place you can explore rather than a page you scroll. Every milestone in the company's story (launches...","learn",0.7,0],["/docs/daily-match","Docs: Daily Match","/daily-match is a live standings board that answers one question: which agent ships the most real output today? Every number on the board is a count or sum...","learn",0.7,0],["/docs/agent-symphony","Docs: Agent Symphony","three.ws/symphony plays the live agent economy as generative music. Every note is a real platform event from the site-wide activity bus: payments pluck, coin...","learn",0.7,0],["/docs/notifications","Docs: Notifications","Everything that happens to your work on three.ws (a payment lands, a skill sells, someone remixes your model, follows you, a quest finishes, a royalty arrives)...","learn",0.7,0],["/docs/creator-portfolio","Docs: Creator portfolio","Everything a creator makes on three.ws (avatars, agents, forged models, worlds, coins, skills, plugins, and more) aggregates onto one public page...","learn",0.7,0],["/docs/agent-wallet-api","Docs: Agent wallet control API","Every three.ws agent owns one custodial Solana wallet. Seven owner-only HTTP surfaces hang off it, and this is their developer reference: exact routes, exact...","learn",0.7,0],["/docs/vaults","Docs: USDC agent vaults","A vault lets strangers put real USDC behind one trading agent, on terms the agent's owner publishes up front. The product-level tour (who each surface is for...","learn",0.7,0],["/docs/user-wallet","Docs: Your master wallet","Every three.ws agent owns a wallet (agent-wallets.md). Separately, every user account can own one custodial wallet of its own: the master wallet. It is the...","learn",0.7,0],["/docs/copy-trading","Docs: Copy Trading","Copy trading lets one wallet follow another's real trades. Two engines sit behind it: the custodial agent mirror, where the platform signs a real on-chain...","learn",0.7,0],["/docs/deployments","Docs: On-chain Deployments","/deployments is the live, cross-chain feed of agent identities landing on-chain: every ERC-8004 Identity Registry registration on EVM and every Metaplex Core...","learn",0.7,0],["/docs/ca2x402","Docs: CA to x402","Paste a token contract address, get back a live, agent-payable x402 market-intel endpoint for that exact token. The generated endpoint costs a small USDC...","learn",0.7,0],["/docs/agent-economy-volume","Docs: Agent Economy Volume","/agent-economy-volume is the public roll-up of the agent-to-agent economy: the total USDC that three.ws agents have actually paid each other for paid skills...","learn",0.7,0],["/docs/viability","Docs: Viability","/viability answers one question about three.ws without decoration: are the two money loops real? The skill marketplace ($THREE skill GMV, take-rate, repeat...","learn",0.7,0],["/docs/press-kit","Docs: Press kit","Everything a journalist, analyst, conference organiser, or partner needs to write about three.ws: the marks, the announcement graphics, approved boilerplate at...","learn",0.7,0],["/docs/partners","Docs: Partner ecosystem","three.ws/partners is the public map of the cloud, AI, hardware, infrastructure, and media programmes three.ws takes part in. This doc is the developer-facing...","learn",0.7,0],["/docs/agent-identities","Docs: Agent Identity Studio","Every AI agent deserves a face. The Agent Identity Studio takes an agent's name and a plain-language brand brief and returns a complete visual identity: a...","learn",0.7,0],["/docs/avatar-engines","Docs: Avatar Engines Atlas","A factual map of the open-source and commercial systems that build high-quality and photoreal 3D human avatars: Gaussian-splat heads, single-photo humans...","learn",0.7,0],["/docs/stage","Docs: Living Stages","A Living Stage is a 3D venue where an embodied AI agent performs a live show for a co-present crowd. The host opens the set, riffs, runs its format, and...","learn",0.7,0],["/docs/world-lines","Docs: World Lines","A World Line is a quest an agent leaves at a real place. Someone walks to that spot, completes the agent's challenge in a live ceremony panel (a tap, a...","learn",0.7,0],["/docs/walk-leaderboard","Docs: Walk Leaderboard","Every step your avatar takes on three.ws is measured, rolled up, and ranked. The Walk Leaderboard is the public board for it: walkers ordered by distance...","learn",0.7,0],["/docs/guards","Repository guards","The local guards that protect this codebase in place of CI: what each one blocks, which stage runs it, and how to add a new one.","learn",0.5,0],["/tutorials/wallet-sign-in","Tutorial · Add Wallet Sign-In to Your App","Authenticate visitors with Phantom, Backpack, Solflare, or MetaMask: the Sign-In with Solana round trip end to end, the domain check that rejects dev origins...","learn",0.8,0],["/tutorials/agent-spending-envelope","Tutorial · Give an Agent a Spending Envelope","Fund a budget from prepaid credits, hand an agent a capped bearer token, and let it buy real x402 services with no private key: total budget, per-call ceiling...","learn",0.8,0],["/tutorials/render-avatar-images","Tutorial · Render Avatars as Images","Put a live 3D avatar in an image tag: four camera framings, 28 poses, ARKit facial morphs, social cards, turntables, and a CORS-open GLB proxy. No 3D engine...","learn",0.8,0],["/tutorials/character-library-to-embed","Tutorial · Character Library to a Live Embed","Pick a rigged character from the free library of 107, prove its skeleton drives the animation clip library, and embed it on your own site with one script tag...","learn",0.8,0],["/tutorials/sell-a-skill-with-a-trial","Tutorial · Sell a Skill With a Free Trial That Converts","List an agent skill for sale in $THREE, give buyers a metered free trial, and watch it expire into a real on-chain purchase. Covers choosing a trial length and...","learn",0.8,0],["/docs/3d-api","Docs · The three.ws 3D API","Free, keyless 3D for AI agents. No key, no account, no wallet: an autonomous agent turns a text prompt into a real textured GLB in a single HTTP call....","learn",0.6,0],["/docs/DESIGN-TOKENS","Docs · Design tokens","The canonical design vocabulary every three.ws surface builds from: colour, spacing, type scale, radii, and motion primitives, with the source-of-truth...","learn",0.6,0],["/docs/agent-manifest","Docs · Agent manifest reference","The complete definition of an embodied AI agent in one JSON file: its 3D body, LLM brain, voice, personality, skills, memory, and on-chain identity. Every...","learn",0.6,0],["/docs/agent-screen-control","Docs · Take the wheel: drive your agent's computer","Every agent has a live screen you can watch doing real web work in a real browser. If you own the agent, you can take control of that browser directly: mouse...","learn",0.6,0],["/docs/agent-shell","Docs · The agent shell","Every visitor gets a named agent within five seconds of arriving, and the shell makes that agent the way you use the site: a command palette that runs real...","learn",0.6,0],["/docs/agent-skills","Docs · The three.ws Agent Skills pack","Portable skill folders that teach any Claude surface (Claude Code, the Claude apps, the Agent SDK) how to use three.ws: 3D creation, wallets, and paid...","learn",0.6,0],["/docs/agent-wallets","Docs · Agent wallets","Every three.ws agent owns a custodial Solana wallet, which is what lets it act on its own: pay for an API call, tip another agent, receive its earnings....","learn",0.6,0],["/docs/agents-vs-avatars","Docs · Agents vs. avatars","three.ws is built around two distinct concepts: agents are AI minds, avatars are 3D bodies. The short, plain-language explanation of which is which, how they...","learn",0.6,0],["/docs/animations","Docs · Animations","The motion clips (idle, wave, dance, and about 2,000 more) that bring three.ws avatars to life: how the registry is organised, how clips load at runtime, how...","learn",0.6,0],["/docs/architecture","Docs · Architecture overview","The engineering map of three.ws: how a request flows from the browser through the route table to a handler, where 3D generation runs, how state is stored, and...","learn",0.6,0],["/docs/avatar-creation","Docs · Avatar creation","The three ways to give an agent a 3D body: generate one from a photo, build one in the browser with the avatar builder, or upload your own GLB. What each path...","learn",0.6,0],["/docs/avatar-inspector","Docs · Avatar inspector","Every avatar you meet in a three.ws world is somebody: a player, an agent they pilot, or a townsperson selling a real paid service. Press I on anyone to see...","learn",0.6,0],["/docs/avatar-pipeline","Docs · The avatar pipeline","End to end, how a text prompt or an image becomes a rigged, animated 3D avatar: generation, auto-rigging, skin weighting, and the universal animation system...","learn",0.6,0],["/docs/avatar-reconstruction","Docs · Selfie to avatar reconstruction","The subsystem that turns a photo (or a generated reference image) into a rigged, animation-ready 3D avatar. How it differs from the text-to-3D forge lane, what...","learn",0.6,0],["/docs/avatar-thumbnails","Docs · Avatar thumbnails","Where an avatar's preview image comes from, the one rule every code path obeys (never publish a thumbnail URL whose object does not exist), the crons that keep...","learn",0.6,0],["/docs/avatar-wardrobe","Docs · The additive wardrobe","Dress any avatar from the garment catalogue. The subtractive half recolours or hides layers a GLB already contains; the additive half fits new garments onto a...","learn",0.6,0],["/docs/character-studio","Docs · Avatar Studio","The browser-based avatar builder: design a customised humanoid (body, hair, face, clothing, accessories) with point-and-click controls, then export it rigged...","learn",0.6,0],["/docs/concierge","Docs · Concierge, an AI chat widget with a 3D face","A floating launcher that opens a chat panel where a rigged 3D avatar blinks, idles, and lip-syncs while it answers your visitors. Grounded in your live page...","learn",0.6,0],["/docs/configuration","Docs · Configuration reference","Every environment variable and configuration file three.ws reads, what each one turns on, and what the safe default is. Written for self-hosters and for...","learn",0.6,0],["/docs/contributing","Docs · Contributing to three.ws","From a fresh clone to a merged pull request: local environment setup, how the test suite is organised, the code conventions the repository actually enforces...","learn",0.6,0],["/docs/deployment","Docs · Deployment and self-hosting","Run your own instance of three.ws, from the single Node container that serves the whole application to a fully self-hosted setup on any Node.js infrastructure....","learn",0.6,0],["/docs/editor","Docs · Editor guide","Inspect and modify an agent's 3D model in the browser: adjust materials and textures, build the agent manifest, and publish the result to the platform. Runs...","learn",0.6,0],["/docs/embody","Docs · Embody, a 3D body in one paid call","One endpoint that turns a prompt or an image into an embeddable, animated, voiced 3D presence for an agent on any framework. What the call returns, how the...","learn",0.6,0],["/docs/examples","Docs · Examples gallery","Copy-paste-ready code for the most common three.ws use cases. Every example runs as written: swap in your own model URL and go. Covers embedding, animation...","learn",0.6,0],["/docs/forge-background-generation","Docs · Background generation and completion notifications","Forge generations are tracked server-side to completion. Start a generation, close the tab, and the platform finishes the job, saves the model to your gallery...","learn",0.6,0],["/docs/forge-off","Docs · Forge-Off, community voting on the forge","Turns the passive Fresh from the Forge strip into a live competitive board: every public creation can be upvoted, the strip re-sorts by score, and a weekly...","learn",0.6,0],["/docs/how-it-works","Docs · How three.ws works","The load-bearing mental model. If you are trying to figure out where a feature lives, how a request flows, or which layer to extend, start here before reading...","learn",0.6,0],["/docs/i18n","Docs · Internationalization","How the UI translation catalogue works: one source-of-truth file translated incrementally by an LLM, committed as static JSON, and swapped in the browser at...","learn",0.6,0],["/docs/introduction","Docs · Introduction and overview","three.ws is an open-source, browser-native platform for creating, hosting, and embedding interactive AI agents that live inside 3D avatars. What it does, who...","learn",0.6,0],["/docs/irl","Docs · IRL, agents in the real world","Take an agent off the screen and pin it at a real GPS coordinate: on your table, at a park bench, outside a venue. Anyone who physically walks up can see it...","learn",0.6,0],["/docs/js-api","Docs · JavaScript API reference","The internal JavaScript classes behind the three.ws viewer: the application controller, the three.js viewer, the glTF validator, and the small components that...","learn",0.6,0],["/docs/layers","Docs · The four layers","three.ws splits into four horizontal layers. Each can be used on its own, and each is independently replaceable as long as its contract with the rest of the...","learn",0.6,0],["/docs/marketplace","Docs · Marketplace","Where agents and people list, buy, and sell real inventory: agent skills, whole assets (avatars, agents, plugins), and trials. How listings are created, how...","learn",0.6,0],["/docs/mcp-3d-studio","Docs · 3D Studio MCP server","Turn text or an image into an interactive, animation-ready 3D model, then rig, animate, pose, edit, retexture, and analyse it, directly from Claude, Cursor, or...","learn",0.6,0],["/docs/mcp-tools","Docs · MCP tools catalog","three.ws ships several MCP servers that AI assistants can call directly. One is free and 3D-only; the others expose paid tools. This is the catalogue: which...","learn",0.6,0],["/docs/memory","Docs · Agent memory","Memory is what lets an agent remember between sessions. Without it every conversation starts fresh. How memories are stored and embedded, how retrieval is...","learn",0.6,0],["/docs/mint-mark","Docs · The three.ws mint mark","Every address minted through three.ws carries the platform's brand mark in the address itself, verifiable directly from the address with no external lookup....","learn",0.6,0],["/docs/motion-swap","Docs · Motion Swap","Upload a video of yourself and get it back with your 3D avatar performing your exact motion instead of you. Pose tracking and masking run server-side...","learn",0.6,0],["/docs/multi-agent","Docs · Multi-agent scenes","Load two or more characters at once, each with its own brain, memory, and persona, sharing one stage. How turn-taking works, how the scene is described to each...","learn",0.6,0],["/docs/onboarding-tier","Docs · The onboarding tier","Why a first-time visitor sees around 20 navigation destinations instead of around 100, how the Simple and Everything switch works, and which tier a newly built...","learn",0.6,0],["/docs/onchain-agents","Docs · Deploying agents on-chain in bulk","Give every agent a real on-chain identity as an NFT minted into the three.ws Agents collection on Solana. Written for platform admins and self-hosters running...","learn",0.6,0],["/docs/permissions","Docs · Permissions and delegation","As agents sign transactions, call external APIs, and spend on your behalf, what the agent is allowed to do becomes the central question. The permission model...","learn",0.6,0],["/docs/persona-hub","Docs · Persona Hub","Cross-app sign-in for avatars: a user creates and stores their three.ws avatar once, then any site embedding the widget can request a short-lived token that...","learn",0.6,0],["/docs/procedural-animation","Docs · Procedural animation","Pre-baked clips replay motion recorded somewhere else; they cannot know where your cursor is or that the ground under one foot is lower than the other. The...","learn",0.6,0],["/docs/provenance","Docs · Verifiable 3D provenance","Every generated model can carry a signed content credential (creator, prompt, model and provider, lineage, timestamp, and the file's content hash) with that...","learn",0.6,0],["/docs/remix","Docs · The remix economy","Every model carries its provenance, and creators can opt a finished model into the remix bazaar: when someone builds on it, a creator-set royalty routes back...","learn",0.6,0],["/docs/risk-acknowledgment","Docs · The real-funds risk acknowledgment","Every feature that can move real money sits behind a one-time, versioned acknowledgment shown before a user's first real-funds action. What it says, how...","learn",0.6,0],["/docs/security","Docs · Security","How three.ws protects your data, wallet, and agents, and what you are responsible for when you embed or self-host. The threat model, the boundaries enforced in...","learn",0.6,0],["/docs/seed-quality","Docs · The catalog quality gate","Nobody asked for the assets the platform seeds into its own catalogue, so they have to earn their slot. The gate that decides whether a platform-generated...","learn",0.6,0],["/docs/shared-utilities","Docs · Shared utilities","Small dependency-backed modules that exist so the same problem is not solved twice. Each one replaced a family of hand-rolled copies that had drifted apart...","learn",0.6,0],["/docs/sign-language","Docs · Sign language, avatars that sign","three.ws avatars communicate in American Sign Language: words that have a sign are signed on one or both hands, and everything else is fingerspelled letter by...","learn",0.6,0],["/docs/smart-contracts","Docs · ERC-8004 smart contracts","The three Solidity contracts behind the ERC-8004 identity registry: contract interfaces, deployed addresses, and how to read from and write to each registry...","learn",0.6,0],["/docs/solana","Docs · Solana agents","Give your agent a real on-chain identity on Solana. Your wallet signs one transaction that mints an NFT representing the agent, which is what lets the identity...","learn",0.6,0],["/docs/spatial-mcp","Docs · Spatial MCP","An open response shape for returning a live, interactive 3D scene as an MCP tool result instead of a URL in text. A conforming host renders it inline: orbit...","learn",0.6,0],["/docs/token-gated-3d-embeds","Docs · Token-gated 3D embeds","You can already embed a live 3D avatar on any page with one script tag. Token gating adds one thing on top: the embed only renders for a visitor whose wallet...","learn",0.6,0],["/docs/trading-copilot","Docs · The Trading Copilot","The conversational front door to an agent's self-custodied Solana wallet. Talk to it by text or by voice and it answers with real live data: your balances...","learn",0.6,0],["/docs/troubleshooting","Docs · Troubleshooting and FAQ","Organised by symptom rather than by subsystem. Find the problem you are actually seeing, check the likely causes, and follow the fix steps. Covers embedding...","learn",0.6,0],["/docs/ui-juice","Docs · ui-juice, the shared game-feel library","The one place the platform keeps its interaction primitives: count-ups, directional flashes, live-feed row enters, sparklines, ring gauges, and the ripple that...","learn",0.6,0],["/docs/vanity","Docs · Vanity, branding a Solana address","Endpoints that hand an agent a branded Solana address, one that starts with your prefix and optionally ends with a chosen suffix, with no wallet and no...","learn",0.6,0],["/docs/viewer","Docs · The 3D viewer","The rendering layer of three.ws: a full-featured three.js WebGL scene manager handling model loading, camera control, animation playback, lighting, and...","learn",0.6,0],["/docs/widget-api","Docs · Widget API","Control an embedded three.ws widget from your own page: move the camera, play animations, capture screenshots, or swap models at runtime. Every method, its...","learn",0.6,0],["/docs/widget-studio","Docs · Widget Studio guide","The no-code builder for embeddable 3D widgets. Pick an avatar, choose a widget type, configure brand settings, and get a one-line embed snippet. No account and...","learn",0.6,0],["/docs/labor-market","Docs · The agent labor market","A market where agents post paid bounties and other agents bid, do the work, and get paid, settled on-chain through real escrow. How a bounty is scoped...","learn",0.6,0],["/docs/hold-to-access","Docs · Hold-to-access","three.ws unlocks premium capability by holding $THREE rather than spending it. A wallet's live value resolves to a membership tier, and tiers unlock fee...","learn",0.6,0],["/docs/plan-checkout","Docs · Paid plans","Upgrading to a paid tier is a single on-chain payment on Solana: no card and no billing processor. Which assets are accepted, how the payment is verified, and...","learn",0.6,0],["/docs/market-data-api","Docs · Market Data API","The same live market data behind every three.ws markets page, packaged as pay-per-call endpoints an agent can buy without an account. Endpoint list, response...","learn",0.6,0],["/docs/oracle","Docs · Oracle, the conviction engine","The complete story of Oracle: why it was built, how the scoring model works, the exact maths, the agent action loop, every platform feature that runs on it...","learn",0.6,0],["/docs/x402-distribution","Docs · x402 distribution","three.ws sells dozens of pay-per-call services over x402. Building them is half the job; the other half is making sure every directory, crawler, and agent...","learn",0.6,0],["/docs/x402-ring-economy","Docs · The closed-loop x402 ring economy","A self-contained agent-to-agent payment loop where platform-controlled wallets pay the platform's own paid endpoints in real stablecoin, settled by the...","learn",0.6,0],["/docs/three-microbuy","Docs · The $THREE micro-buy loop","Many tiny, real on-chain buys of $THREE per minute, each triggered by and paid through a settled pay-per-call payment. It exists to put continuous, verifiable...","learn",0.6,0],["/docs/ibm","Docs · IBM watsonx and Granite","three.ws agents can think on IBM Granite foundation models served through IBM watsonx.ai. The whole integration for developers and operators: model selection...","learn",0.6,0],["/docs/ibm-x402-mcp","Docs · IBM Granite pay-per-call MCP","A menu of IBM AI capabilities (chat, code, embeddings, document analysis, forecasting) that any agent or MCP client can use by paying a few cents per call...","learn",0.6,0],["/docs/aws-builder-center","Docs · three.ws on the AWS Builder Center","The AWS Builder Center is Amazon's community publishing platform for engineers building on AWS. three.ws publishes there under its official organisation...","learn",0.6,0],["/docs/aws-marketplace","Docs · three.ws on AWS Marketplace","three.ws is a verified AWS Partner and listed on AWS Marketplace as an API-based SaaS product. The subscription is a free front door: subscribing links your...","learn",0.6,0],["/docs/aws-partner-spotlight","Docs · three.ws on AWS","Most enterprise AI agents live inside a chat box. For brand agents, product guides, tutors, and storefront assistants, a body changes the interaction. How...","learn",0.6,0],["/docs/aws-builder-center-mcp-agents","Docs · An MCP server whose tools pay for themselves","Most AI tooling assumes a human is standing by with a credit card and an API key. That model breaks the moment the caller is an agent. How to build tools an...","learn",0.6,0],["/docs/aws-builder-center-agent-payment-sessions","Docs · Give your AI agent a budget, not a private key","There is a moment in every agentic build where the agent needs to buy something. Handing it a private key is the wrong answer. Payment sessions give it a...","learn",0.6,0],["/docs/aws-builder-center-marketplace-x402","Docs · One paywall, two economies","Putting AWS Marketplace metering in front of a pay-per-call x402 API, so the same endpoint bills an enterprise buyer through their AWS account and an...","learn",0.6,0],["/docs/chatgpt-3d-studio-gpt","Docs · The 3D Studio custom GPT configuration","The canonical builder configuration for the three.ws 3D Studio custom GPT: the instructions, the action contract it calls, the safety gate, and the response...","learn",0.6,0],["/docs/mcp-agent","Docs · The three.ws Agent MCP server","The MCP server where an assistant can transact real value: discover, pay for, and call paid services in stablecoin, settled on-chain from the signed-in user's...","learn",0.6,0],["/docs/mcp-x402-bazaar","Docs · The x402 Bazaar MCP server","Discover paid agent services across the live x402 facilitator network: search, browse, and price any service from inside Claude, Cursor, or any other MCP...","learn",0.6,0],["/docs/3d-pipeline","Docs · The 3D asset pipeline, stage by stage","The same lanes the platform uses to turn a prompt into a rigged, game-ready character, with every working stage sold as its own pay-per-call resource. What...","learn",0.6,0],["/docs/PROTOCOL-vanity","Docs · The provably-fair vanity grinding protocol","A vanity-address service normally asks you to trust the operator: trust the randomness, trust that no copy was kept. This protocol removes that trust...","learn",0.6,0],["/docs/changelog","Docs · Changelog and versioning","How three.ws is versioned, what changed across releases, and how to upgrade safely. Written for developers pinning the SDK or the CDN bundle to a specific...","learn",0.6,0],["/docs/agenc","Docs · AgenC","The on-chain coordination protocol three.ws reads from for task discovery and agent identity. The read endpoints exposed over it, and how three.ws agents are...","learn",0.6,0],["/docs/docs-world","Docs · Docs World","The three.ws documentation as an explorable place: the same content served both as ordinary pages and as a navigable 3D world, from one source. How the two...","learn",0.6,0],["/docs/package-extraction","Docs · Package extraction","How reusable packages graduate out of the three.ws monorepo into their own repositories that publish to npm independently. The criteria for extraction and the...","learn",0.6,0],["/tutorials/read-the-trading-fleet","Tutorial · Read the trading fleet","Tell a working autonomous strategy from a lucky one: why realized profit is the only profit, how to read profit factor against win rate and drawdown, the...","learn",0.6,0],["/docs/mcp-safety","Docs · MCP tool safety","What an MCP tool's safety annotations mean on three.ws and why you can trust them: read-only tools never change what you asked about, anything that spends is...","learn",0.7,0],["/mcp-tools","MCP Tool Catalog","Every MCP tool three.ws publishes, searchable in one place: what it does, which server hosts it, what it costs in USDC, and whether an AI client can run it...","learn",0.8,0],["/docs/trading-experiment","Docs · The 10 SOL trading experiment","The full risk policy behind the autonomous fleet: entry band, position sizing, taking initials at 2x, the moon-bag floor, trailing and hard stops, and how to...","learn",0.6,0],["/tutorials/getting-started","Tutorial · Getting started (hosted)","A five-minute, no-code tour: create an agent, pick a body, give it a personality, share the URL.","learn",0.8,0],["/tutorials/explore-docs-world","Tutorial · Explore the docs as a 3D world","Walk an avatar through the documentation: fourteen sections as glowing pavilions, live pages read in-world, shareable deep links, and your own GLB as the body.","learn",0.8,0],["/tutorials/embed-in-30-seconds","Tutorial · Embed in 30 seconds","Drop one script tag into any HTML page. Your agent loads, auto-sizes, and starts animating.","learn",0.8,0],["/tutorials/customize-appearance","Tutorial · Customize size, position & background","Tune every visible knob: bubble size, corner placement, background, rotation speed: entirely through data-* attributes.","learn",0.8,0],["/tutorials/swap-avatar-in-studio","Tutorial · Pick & swap an avatar in Studio","Visually browse the avatar gallery, switch bodies with one click, and have the change ripple to every embed without redeploying.","learn",0.8,0],["/tutorials/greeting-and-first-speech","Tutorial · Add a greeting & first speech line","Make your agent say hello the moment it loads: and have its mouth move with the words.","learn",0.8,0],["/tutorials/share-your-agent","Tutorial · Share your agent (link, QR, social preview)","Get a permanent link to your agent, generate a QR for print, and set the Open Graph preview so it looks good in tweets.","learn",0.8,0],["/tutorials/selfie-to-avatar","Tutorial · Turn a selfie into a 3D avatar","Snap or upload a photo and get a rigged 3D avatar that can walk, wave, and talk: then put it on an agent.","learn",0.8,0],["/tutorials/view-in-ar","Tutorial · View your 3D model in AR","See any three.ws model in augmented reality and walk around it in your kitchen: straight from the browser, no app to install. iOS Quick Look and Android WebXR.","learn",0.8,0],["/tutorials/import-avatar-url","Tutorial · Import an avatar by URL","Bring any hosted glTF/GLB avatar into three.ws by link: auto-validated, auto-rigged, ready for an agent.","learn",0.8,0],["/tutorials/walk-companion","Tutorial · Add the Walk Companion to your site","Drop a 3D avatar that strolls across any web page: corner mascot or full-page playground: with one script tag, the npm SDK, or a postMessage bridge.","learn",0.8,0],["/tutorials/sperax-tour","Tutorial · Load a ready-made 3D tour for a DeFi protocol (Sperax)","The Tour Builder's first template: an 8-stop guided tour of Sperax's USDs auto-yield stablecoin, ready to load, edit, and export as a one-tag snippet in...","learn",0.8,0],["/tutorials/first-agent","Tutorial · Build your first agent (from scratch)","A complete walkthrough from a blank HTML file to a live, talking 3D character you wrote yourself: no framework, no build tools.","learn",0.8,0],["/tutorials/embed-on-website","Tutorial · Embed on a website (HTML, React, Next.js)","Five different ways to add an agent to your site: pick the one that matches how you build today.","learn",0.8,0],["/tutorials/personal-ai-site","Tutorial · Build a personal AI website","A 3D version of you, on your domain, ready to answer any question about your work: with a portfolio, contact form, and resume.","learn",0.8,0],["/tutorials/js-api-events","Tutorial · Drive the agent with the JavaScript API","Listen for the ready event, play animations on demand, make the agent speak from anywhere in your app code.","learn",0.8,0],["/tutorials/web-component-end-to-end","Tutorial · Use the <agent-3d> web component end-to-end","Skip the script tag: drop a real custom element into your DOM, bind attributes, and use the full event lifecycle.","learn",0.8,0],["/tutorials/build-a-site-concierge","Tutorial · Build a site concierge from the building blocks","How the Concierge widget is assembled: the talking avatar, the streaming chat, the tool calls, and how to point the same parts at your own backend over...","learn",0.8,0],["/tutorials/trigger-from-page-events","Tutorial · Trigger the agent from page events","Make your agent react to clicks, scrolls, form submits, and route changes: turn it into a real co-pilot, not a chat widget.","learn",0.8,0],["/tutorials/upload-custom-glb","Tutorial · Upload a custom GLB avatar","Bring your own model: any glTF 2.0 .glb from Blender, three.ws Studio, or any other source. Get it validated, fixed, and live.","learn",0.8,0],["/tutorials/connect-ai-brain","Tutorial · Connect Anthropic or OpenAI as the brain","Plug your own model provider into the agent loop. Bring your API key, choose your model, control cost and latency.","learn",0.8,0],["/tutorials/create-and-edit-memory","Tutorial · Create, enhance & edit agent memory","Teach an agent a fact that sticks between sessions: five ways: the dashboard, the agent itself, MCP tools, the REST API, and from a skill. Plus how to sharpen...","learn",0.8,0],["/tutorials/place-agent-irl","Tutorial · Place your agent in the real world (IRL)","Use camera passthrough, a joystick, and tap-to-place to drop your 3D agent into your physical space: and understand how location privacy works.","learn",0.8,0],["/tutorials/voice-and-lipsync","Tutorial · Give your agent a voice with lipsync","Add real-time text-to-speech with synchronized mouth movement: pick or clone a voice, drive visemes from audio, and wire it into a live agent.","learn",0.8,0],["/tutorials/pay-for-x402-service","Tutorial · Discover and pay for an x402 service","Browse the x402 Bazaar and call a paid API from your agent: the 402 challenge, the USDC payment, and the retry, end to end.","learn",0.8,0],["/tutorials/emotion-from-data","Tutorial · Animations from data: wire your agent's gestures to real APIs and AI","Trigger real body animations: celebrate, dance, flinch: from a live data feed. A free lexicon lane to prove the wiring, then a real AI model classifying...","learn",0.8,0],["/tutorials/custom-skill","Tutorial · Build a custom skill","A complete walkthrough of building a weather skill an agent can invoke: bundle format, LLM tool calling, context API.","learn",0.8,0],["/tutorials/register-onchain","Tutorial · Register your agent on-chain (ERC-8004)","Give your agent a permanent, verifiable identity. Publish an ERC-8004 attestation anyone can read from any chain.","learn",0.8,0],["/tutorials/mint-pumpfun-token","Tutorial · Mint an agent token on Pump.fun","Launch a Solana token for your agent, bond it to its on-chain identity, and let people speculate on (or hold) a piece of it.","learn",0.8,0],["/tutorials/paid-x402-endpoint","Tutorial · Build a paid x402 endpoint your agent calls","Stand up an API that other agents pay USDC to call: using the x402 protocol on Base mainnet. Real money, real flow.","learn",0.8,0],["/tutorials/monetize-mcp-server","Tutorial · Monetize an MCP server: charge per tool call","Build an MCP server whose tools charge other agents per call in USDC on Solana. One free orientation tool, one paid tool that does real work, and a test that...","learn",0.8,0],["/tutorials/x402-server-sdk","Tutorial · Meter any API with the x402-server SDK","Turn an ordinary HTTP handler into a paid one with @three-ws/x402-server. Solana-first, framework-agnostic, and runnable offline before you touch a wallet.","learn",0.8,0],["/tutorials/self-host-agent-backend","Tutorial · Self-host the agent backend","Run the full three.ws backend on your own infrastructure: workers, function endpoints, model proxies. No three.ws dependency in production.","learn",0.8,0],["/tutorials/multi-agent-coordination","Tutorial · Multi-agent coordination","Two or more agents on the same page that talk to each other: turn-taking, shared memory, delegating subtasks.","learn",0.8,0],["/tutorials/mcp-server-for-your-agent","Tutorial · Expose your agent as an MCP server","Wrap your agent in the Model Context Protocol so any MCP-compatible client (Claude Desktop, Cursor, etc.) can drive it.","learn",0.8,0],["/tutorials/skill-with-database-auth","Tutorial · Custom skill with database + auth","A real production skill: Postgres-backed CRM lookup, signed requests, per-user permissions, rate limits. Not a toy weather demo.","learn",0.8,0],["/tutorials/deploy-to-vercel-custom-domain","Tutorial · Deploy to Vercel with a custom domain","Take a forked three.ws and ship it as agent.yourcompany.com: CI, environment variables, custom domain, SSL, the lot.","learn",0.8,0],["/tutorials/claim-threews-name","Tutorial · Claim a .threews.sol name & get paid by name","Mint a *.threews.sol Solana subdomain for your agent and accept USDC payments addressed to the name instead of a raw wallet.","learn",0.8,0],["/tutorials/mine-vanity-address","Tutorial · Mine a Solana vanity address","Grind a custom-prefix Solana address in the browser, then prove how it was made with the proof-of-grind receipt, gallery, and bounty market.","learn",0.8,0],["/docs/avatar-cli","Docs: Avatar CLI","Command reference for @three-ws/avatar-cli: init, validate, hash, and preview, with every flag, exit code, and JSON shape, plus the two checks that gate a...","learn",0.7,0],["/tutorials/ship-an-avatar-manifest","Tutorial · Ship an avatar manifest","Turn a raw GLB into a signed-off, hash-anchored manifest: one document that names the avatar, records the exact bytes of its mesh, declares its skeleton, and...","learn",0.8,0],["/tutorials/write-a-guard","Tutorial · Write a repository guard","This repo has no CI, so a guard is the only thing between a mistake and production. Build one that fails the build when an API handler forgets its error...","learn",0.8,0],["/guards","Repository guards","Every mechanical guard that protects the three.ws codebase, and the stage each one runs in. This repository has no CI, so correctness is enforced by fast local...","learn",0.6,0],["/docs/tutorials/write-a-guard","Tutorial · Write a repository guard","Build a real guard end to end: write the checker, give it an npm script, register it in data/guards.json, wire it into a stage, and cover it with a test that...","learn",0.5,0],["/tutorials/earn-and-spend-in-play","Tutorial · Earn and spend in /play","Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin...","learn",0.8,0],["/docs/showcase","Docs: The showcase","The public directory of ERC-8004 agents that registered a real 3D avatar. Nothing is curated: an agent appears because the crawler verified its on-chain...","learn",0.7,0],["/docs/tutorials/earn-and-spend-in-play","Docs · Tutorial: earn and spend in /play","Run the full economic loop in the open world: gather materials, sell them to the vendor, buy a better tool, bank what you cannot afford to lose, and spin the...","learn",0.7,0],["/tutorials/animate-your-agent","Tutorial · Give your agent body language","Clips, slots and hints: the three-name chain that makes an agent nod, look down while it reads, celebrate a settled payment, and dance on request. Re-point any...","learn",0.8,0],["/blog","Blog","Editorial index of three.ws launches and long-form posts.","blog",0.7,0],["/blog/image-to-3d-on-nvidia-l4-and-blackwell","Image-to-3D on NVIDIA L4 and Blackwell: Shipping Hunyuan3D 2.1 on Cloud Run GPUs","A field report from the three.ws GPU fleet: why Hunyuan3D 2.1 could not load on an NVIDIA L4, why CUDA 12.4 wheels have no sm_120 kernels for RTX PRO 6000...","blog",0.6,0],["/blog/monetize-mcp-server-x402-paid-tools","How to Monetize an MCP Server: Paid Tools with x402","A complete guide to charging for MCP tools with x402: price a tool in USDC, issue the 402 challenge, verify and settle on Solana, get discovered in the bazaar...","blog",0.6,0],["/blog/three-ws-openai-select-partner","three.ws Named an OpenAI Select Partner","three.ws has been named an OpenAI Select Partner within the OpenAI Partner Network. What we ship on OpenAI surfaces today: a free 3D Studio MCP connector for...","blog",0.6,0],["/blog/autonomous-trading-experiment","We Gave 11 AI Agents Their Own Wallets and Real SOL. Here Are All 90 Trades.","Two weeks of fully autonomous pump.fun trading on Solana: 11 armed strategies, 90 closed real-money trades, every entry thesis, every exit, every mistake. Plus...","blog",0.6,0],["/blog/first-autonomous-trade","Our Agent Made Its First Autonomous Trade. Here Is Every Decision It Took.","A three.ws agent sniped a brand-new pump.fun launch and closed it at +42.38%, fully autonomously. The full postmortem: every gate it passed, the on-chain...","blog",0.6,0],["/blog/concierge-3d-chat-widget","Concierge: We Gave the Site Chatbot a Face","Every website has the same faceless chat bubble. We shipped one with a rigged 3D avatar that blinks, lipsyncs, and speaks streaming answers grounded in your...","blog",0.6,0],["/blog/inside-the-forge","Inside the Forge: How a Prompt Becomes a 3D Model","What actually happens between typing a prompt on three.ws and downloading a textured 3D model: the reference image, the engine grid, self-healing failover...","blog",0.6,0],["/blog/three-ws-quicknode-startup-program","three.ws Joins the Quicknode Startup Program","three.ws has been accepted into the Quicknode Startup Program and approved for free infrastructure credits, expanding the RPC backbone behind its Solana-first...","blog",0.6,0],["/blog/three-ws-alibaba-cloud-partnership","three.ws Joins the Alibaba Cloud Partner Network","three.ws is now an Alibaba Cloud Partner, bringing Qwen foundation models and Asia-Pacific cloud infrastructure to the three.ws 3D AI agent platform.","blog",0.6,0],["/blog/x402-stripe-for-agent-payments","The Stripe of x402: How three.ws Turned Agent Payments Into One Line of Code","HTTP 402 sat unused for thirty years. Agents revived it. three.ws built the drop in payment modal that makes x402 a one liner, on top of a full stack of agent...","blog",0.6,0],["/blog/see-your-3d-in-ar","See Your 3D Avatar in the Real World: AR Lands on three.ws","Every 3D model and avatar on three.ws now has a View in AR button. On mobile it places the model in your real space through the camera. On desktop, a QR code...","blog",0.6,0],["/blog/text-to-3d-is-live","Text to 3D Is Live: Type a Prompt, Download a 3D Model","Forge is live on three.ws: type a description and get a textured, downloadable 3D model (GLB) in your browser. Image to 3D from photos works too. Free draft...","blog",0.6,0],["/blog/3d-ai-crypto-convergence","3D + AI + Web3 Just Converged: three.ws Shipped the Whole Stack","A web2 unicorn just raised ~$200M to build 3D AI agents. three.ws is the only crypto-native team that already shipped the full stack: browser 3D, a...","blog",0.6,0],["/blog/three-ws-dextools-social-boost-buyback","three.ws Wins DEXTools Social Boost: $5,543 $three Buyback","three.ws is DEXTools","blog",0.6,0],["/blog/three-ws-featured-on-alibaba-cloud-marketplace-blog","three.ws Featured on the Alibaba Cloud Marketplace Blog","Alibaba Cloud Marketplace published an editorial on three.ws: browser-native 3D AI agents you deploy with a single <agent-3d> tag, with a Claude-powered...","blog",0.6,0],["/blog/three-ws-ibm-collaboration","Showcasing the three.ws × IBM Partnership","three.ws and IBM showcased their partnership: embedding a persistent, on-chain 3D agent into any platform as easily as a YouTube video, with the agent brain...","blog",0.6,0],["/blog/three-ws-play-coin-communities","We turned every memecoin into a live 3D world you can walk into","How we built /play: isolated multiplayer worlds keyed to a token","blog",0.6,0],["/blog/three-ws-aws-partner","three.ws Joins the AWS Partner Network","three.ws is now an official AWS Partner, enrolled in the AWS Partner Network (APN) Software Path as a Technology Partner. The open-source platform for 3D AI...","blog",0.6,0],["/blog/three-ws-on-aws-marketplace","three.ws Launches on AWS Marketplace, Bringing On-Chain 3D AI Agents to Enterprise Procurement","three.ws is now live on AWS Marketplace as a SaaS subscription. AWS customers can subscribe directly, bill to their AWS invoice, spend AWS Activate credits...","blog",0.6,0],["/blog/agent-3d-web-component","We Just Shipped the 3D Layer for the Internet: <agent-3d>","Drop one <agent-3d> web component on your site and give any page an AI with LLM brain, memory, emotions, DOM awareness, password field privacy, and an on-chain...","blog",0.6,0],["/blog/2500-new-animations","2,500 New 3D Animations Coming to three.ws","three.ws is expanding its animation library with 2,500 new 3D animations: giving every agent vastly more expressive range across emotions, gestures, reactions...","blog",0.6,0],["/blog/three-ws-x402-bazaar","three.ws Listed on Coinbase x402 Bazaar and agentic.market","three.ws is now a verified service provider on the Coinbase x402 Bazaar and agentic.market: the app store and discovery layer for AI agents with 480k active...","blog",0.6,0],["/blog/real-time-voice-interaction","Real-Time Voice Interaction with 3D AI Agents: Preview","three.ws ships an early preview of real-time voice interaction with 3D AI agents. Agents listen, reason with memory and emotions, respond in voice, and support...","blog",0.6,0],["/blog/three-ws-on-alibaba-cloud-marketplace","three.ws Launches on Alibaba Cloud Marketplace, Bringing Native x402 Agent Payments to Hyperscale","three.ws is now live on the Alibaba Cloud International Marketplace. The listing makes <agent-3d> available to every Alibaba Cloud customer worldwide and...","blog",0.6,0],["/blog/three-ws-on-bnb-chain-dappbay","three.ws Listed on BNB Chain's Dappbay Directory","three.ws is now listed on Dappbay, BNB Chain","blog",0.6,0],["/blog/three-ws-hackernoon-partnership","three.ws Teams Up with HackerNoon","three.ws is partnering with HackerNoon to launch a builder-focused initiative with feature articles, tutorials, and developer guides for those shipping with AI.","blog",0.6,0],["/blog/three-ws-on-coinmarketcap","three.ws Is Now Live on CoinMarketCap","three.ws is now live on CoinMarketCap: join the community page for real-time discussion and stay updated on the platform for 3D on-chain AI agents.","blog",0.6,0],["/blog/how-to-embed-3d-onchain-agents","How to Embed 3D On-Chain Agents on Your Site","A complete walkthrough for embedding a three.ws 3D on-chain agent on any website using the <agent-3d> web component: from setup to CORS configuration and page...","blog",0.5,0],["/blog/pumpfun-agent-payments-sdk","three.ws Integrates the Pump.fun Agent Payments SDK","three.ws has integrated the Pump.fun agent payments SDK. Your 3D AI agent doesn","blog",0.6,0],["/blog/three-ws-speraxusd-integration","three.ws Ships Inside SperaxUSD: DeFi Gets a 3D Face","three.ws is now integrated with SperaxOS, fully wired into the production DeFi stack. Agents get a 3D body, memory, voice, and an on-chain identity: and they...","blog",0.6,0],["/blog/agent-builder-studio-launch","Agent Builder Live: Studio Redesign, LLM Chat Upgrade","three.ws ships Agent Builder, an improved Studio design, and a major LLM Chat upgrade. Agents are now payable, tradeable, and discoverable.","blog",0.6,0],["/blog/animation-emotion-control","Full Animation & Emotion Control: Plus Pump.fun Live Feed","three.ws now ships full animation and emotion control for 3D agents, with live Pump.fun feed integration. Your agents react to any API or data feed in real...","blog",0.6,0],["/blog/three-ws-ibm-business-partner","three.ws Is Now an Official IBM Business Partner","three.ws has been accepted into IBM","blog",0.6,0],["/blog/three-token-listings","$THREE Listed on Coinbase, CoinGecko, Jupiter, and Investing.com","$THREE is now listed and verified across Coinbase, CoinGecko, Jupiter Exchange, and Investing.com: giving the three.ws community every major on-ramp and price...","blog",0.6,0],["/blog/solana-wallet-integration","Solana Wallet Integration for Autonomous 3D Agents","three.ws 3D agents now have native Solana wallets. Your agent can hold and spend money autonomously: earning from skills, paying for inference, and executing...","blog",0.6,0],["/blog/three-ws-google-cloud-partnership","three.ws Joins Google Cloud for Web3 Startups","three.ws is joining forces with Google Cloud, bringing cloud-scale rendering and AI infrastructure to 3D on-chain agents.","blog",0.6,0],["/blog/three-ws-on-anthropic-mcp-registry","three.ws Listed on Anthropic's Official MCP Registry","three.ws is now listed on Anthropic","blog",0.6,0],["/legal","Legal","Every three.ws policy in one place, plus which address to use to report copyright, abuse, or privacy issues.","legal",0.4,0],["/legal/privacy","Privacy Policy","How three.ws handles user data.","legal",0.2,0],["/legal/eula","End-User License Agreement","License terms for the three.ws Seeker/Saga app.","legal",0.2,0],["/legal/tos","Terms of Use","Terms of service for three.ws.","legal",0.2,0],["/legal/risk","Risk Disclosure","Risk disclosure for real-funds features: experimental software, total-loss risk, autonomous agents, no liability.","legal",0.2,0],["/legal/content-policy","Content Policy","What you may publish, mint, and monetise on the platform.","legal",0.6,0],["/sitemap.xml","sitemap.xml","XML sitemap for search-engine crawlers.","machine",0.5,2],["/llms.txt","llms.txt","AI-agent-friendly index of every public page (Howard convention).","machine",0.5,2],["/llms-full.txt","llms-full.txt","Expanded llms.txt with full descriptions and content hints.","machine",0.5,2],["/robots.txt","robots.txt","Crawler directives.","machine",0.5,2],["/openapi.json","OpenAPI","Machine-readable HTTP API spec.","machine",0.5,2],["/.well-known/x402",".well-known/x402","x402 paid-API discovery document.","machine",0.5,2],["/.well-known/agent-attestation-schemas",".well-known/agent-attestation-schemas","JSON schemas for agent attestations.","machine",0.5,2],["/.well-known/oauth-authorization-server",".well-known/oauth-authorization-server","OAuth 2.1 authorization-server metadata.","machine",0.5,2],["/.well-known/chat-plugin.json",".well-known/chat-plugin.json","ChatGPT-style plugin manifest.","machine",0.5,2]],"intents":[{"id":"first-time","title":"I am new here. Where do I start?","blurb":"The shortest path from nothing to a live 3D agent on your own page.","match":["get started","start","new here","begin","first time","onboarding","how do i use this","what do i do","quickstart","tutorial","help"],"steps":[{"do":"Walk the guided setup. It asks three questions and creates your first agent.","to":"/start"},{"do":"Give it a body: describe the avatar you want and generate it.","to":"/create/prompt"},{"do":"Put it on a page. Widget Studio writes the embed code for you.","to":"/studio"}]},{"id":"make-avatar","title":"Make a 3D avatar","blurb":"Text to a rigged, animation-ready GLB.","match":["make an avatar","create avatar","3d avatar","generate character","text to 3d","new avatar","build a character","make a character"],"steps":[{"do":"Describe the avatar you want. The forge returns a rigged GLB.","to":"/create/prompt"},{"do":"Pose and animate it in the Animation Studio.","to":"/pose"},{"do":"Browse what others made if you would rather start from an existing one.","to":"/gallery"}]},{"id":"avatar-from-photo","title":"Turn a photo into a 3D avatar","blurb":"A selfie or a product photo becomes a textured 3D model.","match":["selfie","photo to 3d","image to 3d","picture to model","scan myself","turn a photo into","from a photo","my face"],"steps":[{"do":"Use Selfie to Avatar for a person.","to":"/create/selfie"},{"do":"Use Image to 3D for an object or a product shot.","to":"/image-to-3d"},{"do":"Need the highest fidelity? Forge Max runs the slow, high-quality lane.","to":"/forge-max"}]},{"id":"embed-on-site","title":"Put an avatar on my website","blurb":"One script tag and one custom element. Works in plain HTML, React, and Next.js.","match":["embed","add to my website","put on my site","integrate","script tag","iframe","react","next.js","web component","install on my page"],"steps":[{"do":"Build the widget visually and copy the generated snippet.","to":"/studio"},{"do":"Follow the 30-second version if you just want the two lines.","to":"/tutorials/embed-in-30-seconds"},{"do":"Framework-specific setup for React and Next.js.","to":"/tutorials/embed-on-website"}]},{"id":"create-agent","title":"Create an AI agent","blurb":"An agent with a body, a mind, a wallet, and an on-chain identity.","match":["create an agent","make an agent","new agent","ai agent","build a bot","my agent","agent identity"],"steps":[{"do":"Create the agent and give it a name, a personality, and a model.","to":"/create-agent"},{"do":"Tune its behaviour, tools, and voice in Agent Studio.","to":"/agent-studio"},{"do":"Manage everything you own from My Agents.","to":"/my-agents","note":"Requires sign-in"}]},{"id":"launch-coin","title":"Launch a coin","blurb":"Mint a token for your agent on pump.fun, from the platform.","match":["launch a coin","launch token","mint a token","pump fun","pumpfun","create a coin","new token","memecoin","ticker"],"steps":[{"do":"Launch the coin. Name, ticker, image, and the initial buy.","to":"/launch"},{"do":"Read what each field does before you sign anything.","to":"/docs/pump-launcher"},{"do":"Watch it land in the platform launch feed.","to":"/launches"}]},{"id":"get-paid","title":"Get paid per API call","blurb":"Meter any endpoint with x402 and let other agents pay to use it.","match":["get paid","make money","monetize","charge for my api","paid endpoint","sell a service","earn","revenue","x402 server","per call"],"steps":[{"do":"Wire the paywall in x402 Studio.","to":"/x402/studio"},{"do":"Follow the worked example of a paid endpoint end to end.","to":"/tutorials/paid-x402-endpoint"},{"do":"Watch the receipts and revenue come in.","to":"/x402-revenue"}]},{"id":"pay-for-service","title":"Pay another agent for a service","blurb":"Discover a paid endpoint and settle the call in USDC.","match":["pay for","buy a service","x402 client","call a paid api","402","discover services","bazaar","spend"],"steps":[{"do":"Browse every paid endpoint the network exposes.","to":"/x402"},{"do":"Follow the discover-and-pay walkthrough.","to":"/tutorials/pay-for-x402-service"},{"do":"Fund the wallet your agent pays from.","to":"/wallet","note":"Requires sign-in"}]},{"id":"use-mcp","title":"Connect this to Claude or another MCP client","blurb":"Give your assistant 3D generation, wallets, and market intel as tools.","match":["mcp","claude","cursor","model context protocol","connect my assistant","tools for my ai","claude desktop"],"steps":[{"do":"Browse every tool the MCP servers expose.","to":"/mcp-tools"},{"do":"Copy the client config for your assistant.","to":"/docs/mcp"},{"do":"Start with the free 3D Studio server if you want zero setup.","to":"/docs/mcp-studio"}]},{"id":"animate","title":"Animate or pose an avatar","blurb":"Clips, gestures, and mocap on any humanoid rig.","match":["animate","animation","pose","walk cycle","idle","gesture","mocap","motion","make it move","dance"],"steps":[{"do":"Pose and preview clips on your own model.","to":"/pose"},{"do":"Browse the clip library and copy the one you want.","to":"/animations"},{"do":"Map gestures to your agent's reactions.","to":"/gestures"}]},{"id":"talking-avatar","title":"Make my avatar talk","blurb":"Lip-synced speech, a voice, and an exportable video.","match":["talk","speech","voice","lip sync","talking head","say something","video","tts","speaking avatar"],"steps":[{"do":"Pick or clone a voice in the Voice Lab.","to":"/voice"},{"do":"Render a lip-synced talking video from a script.","to":"/create/video"},{"do":"Drive the same avatar live from your webcam.","to":"/temporary"}]},{"id":"sell-agent","title":"List or sell an agent","blurb":"Publish to the marketplace and let others fork or buy it.","match":["sell","list my agent","marketplace","publish","share my agent","fork","storefront"],"steps":[{"do":"See what sells and how listings are presented.","to":"/marketplace"},{"do":"Publish from the agent you own.","to":"/my-agents","note":"Requires sign-in"},{"do":"Check demand before you price it.","to":"/marketplace/analytics"}]},{"id":"account","title":"Sign in or manage my account","blurb":"Email, wallet, billing, credits, and API keys.","match":["sign in","log in","login","account","register","sign up","password","billing","api key","credits","settings","profile"],"steps":[{"do":"Sign in with email or a Solana wallet.","to":"/login"},{"do":"No account yet? Create one.","to":"/register"},{"do":"Keys, billing, and usage live in the dashboard.","to":"/dashboard","note":"Requires sign-in"}]},{"id":"status","title":"Is something broken?","blurb":"Live uptime, 90 days of history, and a machine-readable feed.","match":["status","is it down","outage","uptime","broken","not working","incident","health"],"steps":[{"do":"Check live status and 90-day uptime for every surface.","to":"/status"},{"do":"Poll the same data as JSON from your own monitor.","to":"/api/status"},{"do":"Still stuck? The docs index is the fastest way to the right page.","to":"/docs/start-here"}]},{"id":"map","title":"Show me everything","blurb":"The full route map: every page on three.ws, grouped and searchable.","match":["everything","all pages","site map","sitemap","what else","browse","map","atlas","index","whats here"],"steps":[{"do":"Browse the whole platform as one map.","to":"/atlas"},{"do":"Prefer a flat list? The sitemap has every route.","to":"/sitemap"},{"do":"Reading as a machine? Take llms.txt instead.","to":"/llms.txt"}]}]}
\ No newline at end of file
diff --git a/public/atlas.js b/public/atlas.js
new file mode 100644
index 000000000..5c628128e
--- /dev/null
+++ b/public/atlas.js
@@ -0,0 +1,771 @@
+/**
+ * three.ws Atlas: one keystroke to anywhere on the platform.
+ * ===========================================================
+ *
+ * three.ws ships 600+ routes. Before this, the only ways to reach a page were
+ * knowing its URL, finding a link to it, or reading the sitemap top to bottom.
+ * Every flow therefore started with the same tax: figure out where the flow
+ * starts. Atlas removes it. Cmd+K (Ctrl+K on Windows/Linux) anywhere on the
+ * site opens a search over every route, and over a curated set of TASKS that
+ * answer with ordered steps instead of a link, because "which page do I open to
+ * get paid per API call" is a harder question than "where is /x402-revenue".
+ *
+ * Design decisions worth keeping:
+ *
+ * Zero dependencies, one file, no framework. It has to run identically on 250
+ * hand-written HTML pages built by different generations of this codebase.
+ *
+ * The index is fetched on FIRST OPEN, never at page load. A visitor who never
+ * presses Cmd+K pays nothing beyond this script. The fetch is also warmed on
+ * the first idle callback so the first open still feels instant.
+ *
+ * The empty state is the feature. Opening with an empty box shows where you
+ * have been and what most people are trying to do. A palette that shows
+ * nothing until you type only helps people who already know the answer.
+ *
+ * Ranking lives in ./atlas/score.js, DOM-free and unit-tested. See the note
+ * at the top of that file for why.
+ *
+ * Opt out on a page with <html data-no-atlas> or <meta name="atlas" content="off">.
+ * Embeds and iframes opt out automatically.
+ */
+import { rankPages, rankIntents, highlight } from './atlas/score.js';
+
+(function () {
+ 'use strict';
+
+ if (window.__twsAtlas) return;
+
+ // Never inside a third-party frame: our keyboard shortcut is not theirs to take.
+ try {
+ if (window.self !== window.top) return;
+ } catch (_) {
+ return;
+ }
+ if (document.documentElement.hasAttribute('data-no-atlas')) return;
+ if (document.querySelector('meta[name="atlas"][content="off"]')) return;
+
+ var INDEX_URL = '/atlas-index.json';
+ var RECENT_KEY = 'tws:atlas:recent';
+ var HINT_KEY = 'tws:atlas:hinted';
+ var RECENT_MAX = 6;
+ var IS_APPLE = /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent || '');
+ var MOD_LABEL = IS_APPLE ? '⌘' : 'Ctrl';
+
+ var index = null;
+ var indexPromise = null;
+ var root = null;
+ var input = null;
+ var listEl = null;
+ var countEl = null;
+ var footHint = null;
+ var rows = [];
+ var active = 0;
+ var lastFocus = null;
+ var open = false;
+ var rowSeq = 0;
+
+ // ---------------------------------------------------------------------
+ // Styles. Scoped under .tws-atlas so they can never leak into a page, and
+ // every token has a literal fallback because a handful of older pages do
+ // not load /style.css.
+ // ---------------------------------------------------------------------
+ var CSS = [
+ '.tws-atlas{position:fixed;inset:0;z-index:var(--z-overlay-modal,2147483600);display:flex;',
+ 'align-items:flex-start;justify-content:center;padding:max(8vh,48px) 16px 16px;',
+ 'background:rgba(0,0,0,.62);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);',
+ 'opacity:0;transition:opacity .16s ease;font-family:var(--font-body,ui-sans-serif,system-ui,sans-serif)}',
+ '.tws-atlas[data-open]{opacity:1}',
+ '.tws-atlas-card{width:min(680px,100%);max-height:min(72vh,640px);display:flex;flex-direction:column;',
+ 'background:var(--surface-1,#0e0e0e);color:var(--ink,#ececec);',
+ 'border:1px solid var(--stroke-strong,rgba(255,255,255,.16));border-radius:var(--radius-card,16px);',
+ 'box-shadow:0 24px 80px rgba(0,0,0,.55);overflow:hidden;',
+ 'transform:translateY(-8px) scale(.985);transition:transform .16s cubic-bezier(.2,.8,.3,1)}',
+ '.tws-atlas[data-open] .tws-atlas-card{transform:none}',
+
+ /* Search row */
+ '.tws-atlas-search{display:flex;align-items:center;gap:10px;padding:14px 16px;',
+ 'border-bottom:1px solid var(--stroke,rgba(255,255,255,.09));flex:0 0 auto}',
+ '.tws-atlas-search svg{width:17px;height:17px;flex:0 0 auto;opacity:.55}',
+ '.tws-atlas-input{flex:1;min-width:0;background:none;border:0;outline:none;color:inherit;',
+ 'font:inherit;font-size:16px;line-height:1.4;padding:2px 0}',
+ '.tws-atlas-input::placeholder{color:var(--ink-dim,#8b8b8b)}',
+ '.tws-atlas-esc{flex:0 0 auto;font-size:10px;letter-spacing:.06em;text-transform:uppercase;',
+ 'color:var(--ink-dim,#8b8b8b);border:1px solid var(--stroke,rgba(255,255,255,.14));',
+ 'border-radius:5px;padding:3px 6px;background:none;cursor:pointer;font-family:inherit}',
+ '.tws-atlas-esc:hover{color:var(--ink,#ececec);border-color:var(--stroke-strong,rgba(255,255,255,.28))}',
+
+ /* Results */
+ '.tws-atlas-list{flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;padding:6px 0 8px;',
+ 'scrollbar-width:thin}',
+ '.tws-atlas-group{padding:12px 16px 4px;font-size:10.5px;letter-spacing:.09em;text-transform:uppercase;',
+ 'color:var(--ink-dim,#8b8b8b);font-weight:600}',
+ '.tws-atlas-row{display:flex;align-items:flex-start;gap:11px;padding:9px 16px;cursor:pointer;',
+ 'border-left:2px solid transparent;scroll-margin:56px}',
+ '.tws-atlas-row[aria-selected="true"]{background:var(--surface-2,rgba(255,255,255,.06));',
+ 'border-left-color:var(--ink,#ececec)}',
+ '.tws-atlas-row-main{min-width:0;flex:1}',
+ '.tws-atlas-row-title{font-size:13.5px;line-height:1.35;color:var(--ink,#ececec);',
+ 'display:flex;align-items:center;gap:7px;flex-wrap:wrap}',
+ '.tws-atlas-row-desc{font-size:11.5px;line-height:1.45;color:var(--ink-dim,#8b8b8b);margin-top:2px;',
+ 'overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}',
+ '.tws-atlas-row mark{background:none;color:inherit;font-weight:700;text-decoration:underline;',
+ 'text-decoration-thickness:1px;text-underline-offset:2px}',
+ '.tws-atlas-kind{flex:0 0 auto;width:22px;height:22px;margin-top:1px;display:grid;place-items:center;',
+ 'border:1px solid var(--stroke,rgba(255,255,255,.12));border-radius:6px;font-size:10px;font-weight:700;',
+ 'color:var(--ink-dim,#8b8b8b);text-transform:uppercase}',
+ '.tws-atlas-row[data-kind="intent"] .tws-atlas-kind{border-color:var(--ink,#ececec);color:var(--ink,#ececec)}',
+ '.tws-atlas-path{font-family:var(--font-mono,ui-monospace,SFMono-Regular,Menlo,monospace);',
+ 'font-size:10.5px;color:var(--ink-dim,#8b8b8b);flex:0 0 auto}',
+ '.tws-atlas-tag{font-size:9.5px;letter-spacing:.05em;text-transform:uppercase;padding:1px 5px;',
+ 'border:1px solid var(--stroke,rgba(255,255,255,.14));border-radius:999px;color:var(--ink-dim,#8b8b8b)}',
+
+ /* Intent step list */
+ '.tws-atlas-steps{list-style:none;margin:7px 0 2px;padding:0;display:grid;gap:5px}',
+ '.tws-atlas-step{display:flex;gap:8px;align-items:baseline;font-size:11.5px;line-height:1.45;',
+ 'color:var(--ink-dim,#8b8b8b)}',
+ '.tws-atlas-step b{flex:0 0 auto;width:14px;font-variant-numeric:tabular-nums;font-weight:600;opacity:.7}',
+ '.tws-atlas-step a{color:var(--ink,#ececec);text-decoration:underline;text-underline-offset:2px;',
+ 'text-decoration-color:var(--stroke-strong,rgba(255,255,255,.3))}',
+ '.tws-atlas-step a:hover{text-decoration-color:currentColor}',
+ '.tws-atlas-step em{font-style:normal;opacity:.65}',
+
+ /* States */
+ '.tws-atlas-empty{padding:30px 20px 34px;text-align:center;color:var(--ink-dim,#8b8b8b);font-size:12.5px;',
+ 'line-height:1.6}',
+ '.tws-atlas-empty strong{display:block;color:var(--ink,#ececec);font-size:14px;margin-bottom:6px}',
+ '.tws-atlas-empty code{font-family:var(--font-mono,ui-monospace,monospace);font-size:11.5px;',
+ 'border:1px solid var(--stroke,rgba(255,255,255,.14));border-radius:4px;padding:1px 5px}',
+ '.tws-atlas-skel{height:9px;margin:14px 16px;border-radius:4px;',
+ 'background:linear-gradient(90deg,rgba(255,255,255,.05),rgba(255,255,255,.12),rgba(255,255,255,.05));',
+ 'background-size:200% 100%;animation:tws-atlas-shimmer 1.1s linear infinite}',
+ '@keyframes tws-atlas-shimmer{to{background-position:-200% 0}}',
+
+ /* Footer */
+ '.tws-atlas-foot{flex:0 0 auto;display:flex;align-items:center;gap:14px;flex-wrap:wrap;',
+ 'padding:9px 16px;border-top:1px solid var(--stroke,rgba(255,255,255,.09));',
+ 'font-size:10.5px;color:var(--ink-dim,#8b8b8b)}',
+ '.tws-atlas-foot kbd{font-family:inherit;font-size:10px;border:1px solid var(--stroke,rgba(255,255,255,.16));',
+ 'border-radius:4px;padding:1px 4px;margin-right:3px;background:var(--surface-2,rgba(255,255,255,.05))}',
+ '.tws-atlas-foot a{color:inherit;margin-left:auto;text-decoration:underline;text-underline-offset:2px}',
+
+ /* First-visit hint chip */
+ '.tws-atlas-hint{display:flex;align-items:center;gap:9px;padding:9px 13px;',
+ 'background:var(--surface-1,#0e0e0e);color:var(--ink,#ececec);',
+ 'border:1px solid var(--stroke-strong,rgba(255,255,255,.18));border-radius:999px;',
+ 'box-shadow:0 8px 28px rgba(0,0,0,.4);font-size:12px;',
+ 'font-family:var(--font-body,ui-sans-serif,system-ui,sans-serif);cursor:pointer;',
+ 'animation:tws-atlas-rise .34s cubic-bezier(.2,.8,.3,1) both}',
+ '.tws-atlas-hint kbd{font-family:inherit;font-size:11px;border:1px solid var(--stroke,rgba(255,255,255,.2));',
+ 'border-radius:5px;padding:2px 6px;background:var(--surface-2,rgba(255,255,255,.06))}',
+ '.tws-atlas-hint button{background:none;border:0;color:var(--ink-dim,#8b8b8b);cursor:pointer;',
+ 'font:inherit;font-size:15px;line-height:1;padding:0 0 0 3px}',
+ '.tws-atlas-hint button:hover{color:var(--ink,#ececec)}',
+ '@keyframes tws-atlas-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}',
+
+ /* Light theme. The site flips [data-theme] on <html>. */
+ '[data-theme="light"] .tws-atlas{background:rgba(255,255,255,.55)}',
+ '[data-theme="light"] .tws-atlas-card{background:var(--surface-1,#fff);color:var(--ink,#111);',
+ 'box-shadow:0 24px 80px rgba(0,0,0,.18)}',
+ '[data-theme="light"] .tws-atlas-skel{background:linear-gradient(90deg,rgba(0,0,0,.04),rgba(0,0,0,.1),rgba(0,0,0,.04));background-size:200% 100%}',
+
+ '@media (max-width:560px){',
+ '.tws-atlas{padding:0}',
+ '.tws-atlas-card{width:100%;max-height:100%;height:100%;border:0;border-radius:0}',
+ '.tws-atlas-row-desc{-webkit-line-clamp:2}',
+ '}',
+ '@media (prefers-reduced-motion:reduce){',
+ '.tws-atlas,.tws-atlas-card,.tws-atlas-hint{transition:none;animation:none}',
+ '.tws-atlas-skel{animation:none}',
+ '}',
+ ].join('');
+
+ function injectStyles() {
+ if (document.getElementById('tws-atlas-css')) return;
+ var s = document.createElement('style');
+ s.id = 'tws-atlas-css';
+ s.textContent = CSS;
+ document.head.appendChild(s);
+ }
+
+ // ---------------------------------------------------------------------
+ // Index loading
+ // ---------------------------------------------------------------------
+ function loadIndex() {
+ if (indexPromise) return indexPromise;
+ indexPromise = fetch(INDEX_URL, { credentials: 'omit' })
+ .then(function (r) {
+ if (!r.ok) throw new Error('atlas index ' + r.status);
+ return r.json();
+ })
+ .then(function (data) {
+ index = data;
+ // Map path to page tuple once, so recents resolve in O(1).
+ index.byPath = Object.create(null);
+ for (var i = 0; i < data.pages.length; i++) index.byPath[data.pages[i][0]] = data.pages[i];
+ return data;
+ })
+ .catch(function (err) {
+ // Reset so a later open retries rather than being stuck on a
+ // transient network failure.
+ indexPromise = null;
+ throw err;
+ });
+ return indexPromise;
+ }
+
+ // ---------------------------------------------------------------------
+ // Recents. Stored as paths; titles are resolved from the index at render
+ // time so a renamed page never shows its old name.
+ // ---------------------------------------------------------------------
+ function readRecents() {
+ try {
+ var raw = JSON.parse(localStorage.getItem(RECENT_KEY) || '[]');
+ return Array.isArray(raw) ? raw.filter(function (p) { return typeof p === 'string'; }) : [];
+ } catch (_) {
+ return [];
+ }
+ }
+
+ function rememberPath(path) {
+ if (!path) return;
+ try {
+ var list = readRecents().filter(function (p) { return p !== path; });
+ list.unshift(path);
+ localStorage.setItem(RECENT_KEY, JSON.stringify(list.slice(0, RECENT_MAX)));
+ } catch (_) {
+ /* private mode: recents are a nicety, never a hard dependency */
+ }
+ }
+
+ // ---------------------------------------------------------------------
+ // Rendering helpers
+ // ---------------------------------------------------------------------
+ function el(tag, className, text) {
+ var n = document.createElement(tag);
+ if (className) n.className = className;
+ if (text != null) n.textContent = text;
+ return n;
+ }
+
+ /** Render `text` into `node` with the query's matched runs wrapped in <mark>. */
+ function paintHighlighted(node, text, query) {
+ node.textContent = '';
+ var runs = query ? highlight(text, query) : [{ t: text, hit: false }];
+ for (var i = 0; i < runs.length; i++) {
+ if (runs[i].hit) node.appendChild(el('mark', null, runs[i].t));
+ else node.appendChild(document.createTextNode(runs[i].t));
+ }
+ }
+
+ function groupLabel(text) {
+ var g = el('div', 'tws-atlas-group', text);
+ g.setAttribute('role', 'presentation');
+ return g;
+ }
+
+ function makeRow(kind) {
+ var row = el('div', 'tws-atlas-row');
+ row.id = 'tws-atlas-row-' + rowSeq++;
+ row.setAttribute('role', 'option');
+ row.setAttribute('aria-selected', 'false');
+ row.dataset.kind = kind;
+ return row;
+ }
+
+ function pageRow(page, query) {
+ var row = makeRow('page');
+ var section = sectionTitle(page[3]);
+ row.appendChild(el('span', 'tws-atlas-kind', (section || '?').slice(0, 2)));
+
+ var main = el('div', 'tws-atlas-row-main');
+ var title = el('div', 'tws-atlas-row-title');
+ var titleText = el('span');
+ paintHighlighted(titleText, page[1], query);
+ title.appendChild(titleText);
+ var path = el('span', 'tws-atlas-path');
+ paintHighlighted(path, page[0], query);
+ title.appendChild(path);
+ if (page[5] & 1) title.appendChild(el('span', 'tws-atlas-tag', 'sign-in'));
+ main.appendChild(title);
+
+ if (page[2]) {
+ var desc = el('div', 'tws-atlas-row-desc');
+ paintHighlighted(desc, page[2], query);
+ main.appendChild(desc);
+ }
+ row.appendChild(main);
+ row.dataset.href = page[0];
+ return row;
+ }
+
+ function intentRow(intent, query) {
+ var row = makeRow('intent');
+ row.appendChild(el('span', 'tws-atlas-kind', '→'));
+
+ var main = el('div', 'tws-atlas-row-main');
+ var title = el('div', 'tws-atlas-row-title');
+ var t = el('span');
+ paintHighlighted(t, intent.title, query);
+ title.appendChild(t);
+ title.appendChild(el('span', 'tws-atlas-tag', 'how to'));
+ main.appendChild(title);
+
+ if (intent.blurb) main.appendChild(el('div', 'tws-atlas-row-desc', intent.blurb));
+
+ var ol = el('ul', 'tws-atlas-steps');
+ for (var i = 0; i < intent.steps.length; i++) {
+ var step = intent.steps[i];
+ var li = el('li', 'tws-atlas-step');
+ li.appendChild(el('b', null, String(i + 1)));
+ var body = el('span');
+ if (step.to) {
+ var a = el('a', null, step.do);
+ a.href = step.to;
+ // The row's own click handler would double-navigate; let the
+ // anchor own its click so Cmd-click and middle-click behave.
+ a.addEventListener('click', function (ev) {
+ ev.stopPropagation();
+ rememberPath(this.getAttribute('href'));
+ });
+ body.appendChild(a);
+ } else {
+ body.appendChild(document.createTextNode(step.do));
+ }
+ if (step.note) {
+ body.appendChild(document.createTextNode(' '));
+ body.appendChild(el('em', null, '(' + step.note + ')'));
+ }
+ li.appendChild(body);
+ ol.appendChild(li);
+ }
+ main.appendChild(ol);
+ row.appendChild(main);
+
+ // Enter on the intent row follows its first destination, which is always
+ // the step that starts the flow.
+ for (var j = 0; j < intent.steps.length; j++) {
+ if (intent.steps[j].to) {
+ row.dataset.href = intent.steps[j].to;
+ break;
+ }
+ }
+ return row;
+ }
+
+ function sectionTitle(id) {
+ if (!index) return '';
+ for (var i = 0; i < index.sections.length; i++) {
+ if (index.sections[i].id === id) return index.sections[i].title;
+ }
+ return id;
+ }
+
+ // ---------------------------------------------------------------------
+ // Result assembly
+ // ---------------------------------------------------------------------
+ function render(query) {
+ listEl.textContent = '';
+ rows = [];
+ active = 0;
+
+ if (!index) {
+ for (var s = 0; s < 5; s++) {
+ var sk = el('div', 'tws-atlas-skel');
+ sk.style.width = [72, 54, 63, 47, 58][s] + '%';
+ listEl.appendChild(sk);
+ }
+ announce('Loading the index');
+ return;
+ }
+
+ var q = query.trim();
+ if (!q) {
+ renderEmptyState();
+ return;
+ }
+
+ var intents = rankIntents(q, index.intents);
+ var pages = rankPages(q, index.pages, { limit: 24 });
+
+ if (intents.length === 0 && pages.length === 0) {
+ var none = el('div', 'tws-atlas-empty');
+ none.appendChild(el('strong', null, 'Nothing matches "' + q + '"'));
+ none.appendChild(
+ document.createTextNode('Try a shorter word, or browse the whole map at '),
+ );
+ var link = el('a', null, '/atlas');
+ link.href = '/atlas';
+ link.style.color = 'inherit';
+ none.appendChild(link);
+ none.appendChild(document.createTextNode('.'));
+ listEl.appendChild(none);
+ announce('No results');
+ return;
+ }
+
+ if (intents.length) {
+ listEl.appendChild(groupLabel('Do this'));
+ for (var i = 0; i < intents.length; i++) addRow(intentRow(intents[i].intent, q));
+ }
+
+ if (pages.length) {
+ listEl.appendChild(groupLabel(intents.length ? 'Pages' : 'Results'));
+ for (var p = 0; p < pages.length; p++) addRow(pageRow(pages[p].page, q));
+ }
+
+ setActive(0, false);
+ announce(rows.length + (rows.length === 1 ? ' result' : ' results'));
+ }
+
+ function renderEmptyState() {
+ var recents = readRecents()
+ .map(function (path) { return index.byPath[path]; })
+ .filter(Boolean)
+ .slice(0, 5);
+
+ if (recents.length) {
+ listEl.appendChild(groupLabel('Recent'));
+ for (var i = 0; i < recents.length; i++) addRow(pageRow(recents[i], ''));
+ }
+
+ // The starting points every visitor eventually needs, in the order a
+ // first-timer needs them. This is the onboarding surface: someone who
+ // opens Atlas with no idea what to type still leaves with a next step.
+ listEl.appendChild(groupLabel(recents.length ? 'Start here' : 'What do you want to do?'));
+ var starters = index.intents.slice(0, 6);
+ for (var s = 0; s < starters.length; s++) addRow(intentRow(starters[s], ''));
+
+ setActive(0, false);
+ announce(rows.length + ' suggestions. Type to search ' + index.pageCount + ' pages.');
+ }
+
+ function addRow(row) {
+ row.addEventListener('click', function () {
+ go(this.dataset.href, false);
+ });
+ row.addEventListener('mousemove', function () {
+ var i = rows.indexOf(this);
+ if (i >= 0 && i !== active) setActive(i, false);
+ });
+ listEl.appendChild(row);
+ rows.push(row);
+ }
+
+ function setActive(i, scroll) {
+ if (!rows.length) return;
+ if (rows[active]) rows[active].setAttribute('aria-selected', 'false');
+ active = Math.max(0, Math.min(rows.length - 1, i));
+ var row = rows[active];
+ row.setAttribute('aria-selected', 'true');
+ input.setAttribute('aria-activedescendant', row.id);
+ if (scroll !== false) row.scrollIntoView({ block: 'nearest' });
+ }
+
+ function announce(text) {
+ if (countEl) countEl.textContent = text;
+ }
+
+ function go(href, newTab) {
+ if (!href) return;
+ rememberPath(href);
+ if (newTab) {
+ window.open(href, '_blank', 'noopener');
+ return;
+ }
+ close();
+ window.location.href = href;
+ }
+
+ // ---------------------------------------------------------------------
+ // Overlay lifecycle
+ // ---------------------------------------------------------------------
+ function build() {
+ injectStyles();
+ root = el('div', 'tws-atlas');
+ root.setAttribute('role', 'dialog');
+ root.setAttribute('aria-modal', 'true');
+ root.setAttribute('aria-label', 'Search three.ws');
+ root.hidden = true;
+
+ var card = el('div', 'tws-atlas-card');
+
+ var search = el('div', 'tws-atlas-search');
+ var icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+ icon.setAttribute('viewBox', '0 0 24 24');
+ icon.setAttribute('fill', 'none');
+ icon.setAttribute('stroke', 'currentColor');
+ icon.setAttribute('stroke-width', '2');
+ icon.setAttribute('aria-hidden', 'true');
+ var circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
+ circle.setAttribute('cx', '11');
+ circle.setAttribute('cy', '11');
+ circle.setAttribute('r', '7');
+ var line = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+ line.setAttribute('d', 'M20 20l-4-4');
+ line.setAttribute('stroke-linecap', 'round');
+ icon.appendChild(circle);
+ icon.appendChild(line);
+ search.appendChild(icon);
+
+ input = el('input', 'tws-atlas-input');
+ input.type = 'text';
+ input.autocomplete = 'off';
+ input.spellcheck = false;
+ input.placeholder = 'Search pages, or describe what you want to do';
+ input.setAttribute('aria-label', 'Search three.ws');
+ input.setAttribute('role', 'combobox');
+ input.setAttribute('aria-expanded', 'true');
+ input.setAttribute('aria-autocomplete', 'list');
+ search.appendChild(input);
+
+ var esc = el('button', 'tws-atlas-esc', 'esc');
+ esc.type = 'button';
+ esc.setAttribute('aria-label', 'Close search');
+ esc.addEventListener('click', close);
+ search.appendChild(esc);
+ card.appendChild(search);
+
+ listEl = el('div', 'tws-atlas-list');
+ listEl.setAttribute('role', 'listbox');
+ listEl.setAttribute('aria-label', 'Search results');
+ card.appendChild(listEl);
+ input.setAttribute('aria-controls', (listEl.id = 'tws-atlas-list'));
+
+ var foot = el('div', 'tws-atlas-foot');
+ foot.appendChild(kbdHint('↵', 'open'));
+ foot.appendChild(kbdHint('↑↓', 'navigate'));
+ foot.appendChild(kbdHint(MOD_LABEL + ' ↵', 'new tab'));
+ footHint = el('a', null, 'Browse the full map');
+ footHint.href = '/atlas';
+ foot.appendChild(footHint);
+ card.appendChild(foot);
+
+ // Screen-reader-only result count. Visually hidden rather than absent so
+ // the count is announced on every keystroke without any visual noise.
+ countEl = el('div');
+ countEl.setAttribute('role', 'status');
+ countEl.setAttribute('aria-live', 'polite');
+ countEl.style.cssText =
+ 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap';
+ card.appendChild(countEl);
+
+ root.appendChild(card);
+ document.body.appendChild(root);
+
+ root.addEventListener('mousedown', function (e) {
+ if (e.target === root) close();
+ });
+ input.addEventListener('input', function () {
+ render(input.value);
+ });
+ input.addEventListener('keydown', onKeydown);
+ return root;
+ }
+
+ function kbdHint(keys, label) {
+ var wrap = el('span');
+ wrap.appendChild(el('kbd', null, keys));
+ wrap.appendChild(document.createTextNode(label));
+ return wrap;
+ }
+
+ function onKeydown(e) {
+ if (e.key === 'ArrowDown') {
+ e.preventDefault();
+ setActive(active + 1);
+ } else if (e.key === 'ArrowUp') {
+ e.preventDefault();
+ setActive(active - 1);
+ } else if (e.key === 'Home' && !input.value) {
+ e.preventDefault();
+ setActive(0);
+ } else if (e.key === 'End' && !input.value) {
+ e.preventDefault();
+ setActive(rows.length - 1);
+ } else if (e.key === 'Enter') {
+ e.preventDefault();
+ if (rows[active]) go(rows[active].dataset.href, e.metaKey || e.ctrlKey);
+ } else if (e.key === 'Escape') {
+ e.preventDefault();
+ close();
+ } else if (e.key === 'Tab') {
+ // The card holds exactly three focusables and the list is driven by
+ // aria-activedescendant, so keeping focus on the input IS the trap.
+ e.preventDefault();
+ }
+ }
+
+ function show(seed) {
+ if (open) return;
+ if (!root) build();
+ lastFocus = document.activeElement;
+ open = true;
+ root.hidden = false;
+ document.documentElement.style.overflow = 'hidden';
+ // Force a frame so the opacity transition actually runs.
+ requestAnimationFrame(function () {
+ root.setAttribute('data-open', '');
+ });
+ input.value = seed || '';
+ input.focus();
+ render(input.value);
+
+ loadIndex().then(
+ function () {
+ if (open) render(input.value);
+ },
+ function () {
+ if (!open) return;
+ listEl.textContent = '';
+ var fail = el('div', 'tws-atlas-empty');
+ fail.appendChild(el('strong', null, 'Search is offline'));
+ fail.appendChild(document.createTextNode('The index did not load. '));
+ var a = el('a', null, 'Browse the sitemap instead');
+ a.href = '/sitemap';
+ a.style.color = 'inherit';
+ fail.appendChild(a);
+ fail.appendChild(document.createTextNode('.'));
+ listEl.appendChild(fail);
+ announce('Search index unavailable');
+ },
+ );
+ }
+
+ function close() {
+ if (!open || !root) return;
+ open = false;
+ root.removeAttribute('data-open');
+ document.documentElement.style.overflow = '';
+ var finish = function () {
+ if (!open) root.hidden = true;
+ };
+ if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) finish();
+ else setTimeout(finish, 170);
+ if (lastFocus && typeof lastFocus.focus === 'function') lastFocus.focus();
+ }
+
+ // ---------------------------------------------------------------------
+ // Global shortcut
+ // ---------------------------------------------------------------------
+ function isTypingTarget(node) {
+ if (!node) return false;
+ if (node.isContentEditable) return true;
+ var tag = node.tagName;
+ return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT';
+ }
+
+ document.addEventListener(
+ 'keydown',
+ function (e) {
+ if (e.defaultPrevented) return;
+ var mod = e.metaKey || e.ctrlKey;
+ if (mod && !e.altKey && (e.key === 'k' || e.key === 'K')) {
+ e.preventDefault();
+ if (open) close();
+ else show('');
+ return;
+ }
+ if (open) return;
+ // "/" is the other muscle-memory shortcut, but only when the visitor
+ // is not already typing somewhere. Never steal it from a form.
+ if (e.key === '/' && !mod && !e.altKey && !isTypingTarget(e.target)) {
+ e.preventDefault();
+ show('');
+ }
+ },
+ true,
+ );
+
+ // Any element on any page can open Atlas by declaring itself.
+ document.addEventListener('click', function (e) {
+ var trigger = e.target.closest && e.target.closest('[data-atlas-open]');
+ if (!trigger) return;
+ e.preventDefault();
+ show(trigger.getAttribute('data-atlas-open') || '');
+ });
+
+ // ---------------------------------------------------------------------
+ // Discoverability. A shortcut nobody knows about is not a feature, so the
+ // first visit gets one dismissible chip. It is shown once ever, mounts into
+ // the shared corner stack when that exists so it cannot cover another
+ // widget, and never returns after being seen.
+ // ---------------------------------------------------------------------
+ function maybeHint() {
+ try {
+ if (localStorage.getItem(HINT_KEY)) return;
+ } catch (_) {
+ return; // No storage means no way to remember it was dismissed.
+ }
+ if (window.matchMedia && window.matchMedia('(max-width: 640px)').matches) return; // No hardware keyboard.
+
+ injectStyles();
+ var chip = el('div', 'tws-atlas-hint');
+ chip.setAttribute('role', 'note');
+ chip.dataset.cornerPriority = '30';
+ chip.appendChild(el('kbd', null, MOD_LABEL + ' K'));
+ chip.appendChild(el('span', null, 'search anything on three.ws'));
+ var dismiss = el('button', null, '×');
+ dismiss.type = 'button';
+ dismiss.setAttribute('aria-label', 'Dismiss');
+ chip.appendChild(dismiss);
+
+ var seen = function () {
+ try {
+ localStorage.setItem(HINT_KEY, '1');
+ } catch (_) {
+ /* nothing to do */
+ }
+ if (chip.parentNode) chip.parentNode.removeChild(chip);
+ };
+ dismiss.addEventListener('click', function (e) {
+ e.stopPropagation();
+ seen();
+ });
+ chip.addEventListener('click', function () {
+ seen();
+ show('');
+ });
+
+ if (window.twsCornerStack && typeof window.twsCornerStack.mount === 'function') {
+ document.body.appendChild(chip);
+ window.twsCornerStack.mount(chip, { priority: 30 });
+ } else {
+ chip.style.cssText +=
+ ';position:fixed;right:18px;bottom:18px;z-index:var(--z-corner-stack,2147482500)';
+ document.body.appendChild(chip);
+ }
+ setTimeout(seen, 12000);
+ }
+
+ // ---------------------------------------------------------------------
+ // Boot
+ // ---------------------------------------------------------------------
+ function boot() {
+ // Remember where the visitor actually is, so Recent reflects browsing and
+ // not only palette use.
+ rememberPath(location.pathname.replace(/\/+$/, '') || '/');
+
+ // ?atlas / #atlas open it directly, which is what a link in docs or a
+ // support reply needs.
+ var params = new URLSearchParams(location.search);
+ if (params.has('atlas') || location.hash === '#atlas') {
+ show(params.get('atlas') || '');
+ }
+
+ var warm = function () {
+ loadIndex().catch(function () {
+ /* prefetch is best-effort; the real open retries and reports */
+ });
+ };
+ if (window.requestIdleCallback) window.requestIdleCallback(warm, { timeout: 4000 });
+ else setTimeout(warm, 2500);
+
+ setTimeout(maybeHint, 3500);
+ }
+
+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);
+ else boot();
+
+ window.__twsAtlas = { open: show, close: close, loadIndex: loadIndex };
+})();
diff --git a/public/atlas/score.js b/public/atlas/score.js
new file mode 100644
index 000000000..cd40475e3
--- /dev/null
+++ b/public/atlas/score.js
@@ -0,0 +1,228 @@
+/**
+ * Atlas ranking: the pure half of the command palette.
+ *
+ * Kept DOM-free and in its own module for one reason: ranking is the part that
+ * is either right or subtly, invisibly wrong. A palette that puts /docs/x402-buyer
+ * above /x402 for the query "x402" is not broken in any way a screenshot shows,
+ * it just quietly fails the visitor. So the ranking lives here where
+ * tests/atlas-score.test.js can pin the orderings that matter, and public/atlas.js
+ * owns only the UI.
+ *
+ * Two rankers, because the palette answers two different questions:
+ *
+ * rankPages answers "which route did you mean?". AND over query terms, so every
+ * term has to land somewhere in the page. Precision beats recall
+ * across 600 routes; a fuzzy OR turns the list into noise.
+ * rankIntents answers "which task are you trying to do?". Matches curated phrases,
+ * and floats to the top of the results because a newcomer who
+ * types "get paid" needs the three-step flow, not the 40 pages
+ * whose description happens to contain the word "paid".
+ */
+
+/** Section weight. Nudges ties toward the surfaces a person can act on. */
+const SECTION_WEIGHT = {
+ main: 1.15,
+ build: 1.15,
+ 'agent-tools': 1.1,
+ crypto: 1.0,
+ account: 1.0,
+ labs: 0.95,
+ learn: 0.9,
+ blog: 0.8,
+ legal: 0.6,
+ machine: 0.6,
+};
+
+const WORD_SPLIT = /[^a-z0-9]+/;
+
+export function normalize(text) {
+ return String(text || '')
+ .toLowerCase()
+ .normalize('NFKD')
+ // Strip combining marks so "café" matches "cafe".
+ .replace(/[\u0300-\u036f]/g, '');
+}
+
+export function tokenize(text) {
+ return normalize(text).split(WORD_SPLIT).filter(Boolean);
+}
+
+/**
+ * Score one term against one haystack. Returns 0 when the term is absent.
+ * The tiers are ordered by how much a match at that position tells us about
+ * intent: the start of a title is a near-certain hit, a hit buried in a
+ * description is a hint.
+ */
+function scoreTerm(term, haystack, weights) {
+ const at = haystack.indexOf(term);
+ if (at === -1) return 0;
+ if (haystack === term) return weights.exact;
+ if (at === 0) return weights.prefix;
+ // A match at a word boundary ("agent" in "my agent") is worth far more than
+ // one inside a word ("gent" in "agents"), which is usually coincidence.
+ const before = haystack.charCodeAt(at - 1);
+ const isBoundary = !((before >= 97 && before <= 122) || (before >= 48 && before <= 57));
+ return isBoundary ? weights.word : weights.loose;
+}
+
+const TITLE_W = { exact: 1000, prefix: 620, word: 460, loose: 150 };
+const PATH_W = { exact: 900, prefix: 400, word: 300, loose: 90 };
+const DESC_W = { exact: 200, prefix: 130, word: 100, loose: 30 };
+
+/**
+ * Subsequence fallback for typos and abbreviations: "anmtns" -> "animations",
+ * "mktplc" -> "marketplace". Deliberately weak (it can only ever break a tie
+ * against a real substring hit) and requires the first character to match, which
+ * kills almost all of the false positives a naive subsequence produces.
+ */
+function subsequenceScore(term, haystack) {
+ if (term.length < 3 || haystack[0] !== term[0]) return 0;
+ let i = 0;
+ let gaps = 0;
+ let last = -1;
+ for (let h = 0; h < haystack.length && i < term.length; h++) {
+ if (haystack[h] === term[i]) {
+ if (last >= 0) gaps += h - last - 1;
+ last = h;
+ i++;
+ }
+ }
+ if (i < term.length) return 0;
+ return Math.max(0, 60 - gaps * 4);
+}
+
+/**
+ * Rank the page tuples from atlas-index.json against a query.
+ *
+ * @param {string} query
+ * @param {Array<[string,string,string,string,number,number]>} pages
+ * [path, title, description, sectionId, priority, flags]
+ * @param {{limit?: number}} [opts]
+ * @returns {Array<{page: any[], score: number}>}
+ */
+export function rankPages(query, pages, opts = {}) {
+ const terms = tokenize(query);
+ if (terms.length === 0) return [];
+ const limit = opts.limit ?? 30;
+ const whole = normalize(query).trim();
+ const out = [];
+
+ for (const page of pages) {
+ const title = normalize(page[1]);
+ const path = normalize(page[0]);
+ const desc = normalize(page[2]);
+ let total = 0;
+ let matchedAll = true;
+
+ for (const term of terms) {
+ const best = Math.max(
+ scoreTerm(term, title, TITLE_W),
+ scoreTerm(term, path, PATH_W),
+ scoreTerm(term, desc, DESC_W),
+ );
+ if (best > 0) {
+ total += best;
+ continue;
+ }
+ const fuzzy = Math.max(subsequenceScore(term, title), subsequenceScore(term, path.slice(1)));
+ if (fuzzy > 0) {
+ total += fuzzy;
+ continue;
+ }
+ matchedAll = false;
+ break;
+ }
+ if (!matchedAll) continue;
+
+ // Typing the route outright, or the exact title, should never be
+ // out-ranked by a longer page that merely contains it.
+ if (path === `/${whole}` || path === whole) total += 1400;
+ if (title === whole) total += 1200;
+ if (title.startsWith(whole)) total += 260;
+
+ // Multi-word queries reward pages that match the phrase in order.
+ if (terms.length > 1 && (title.includes(whole) || desc.includes(whole))) total += 320;
+
+ const priority = typeof page[4] === 'number' ? page[4] : 0.5;
+ total *= (SECTION_WEIGHT[page[3]] ?? 1) * (0.7 + priority * 0.6);
+
+ out.push({ page, score: total });
+ }
+
+ out.sort((a, b) => b.score - a.score || a.page[0].length - b.page[0].length);
+ return out.slice(0, limit);
+}
+
+/**
+ * Rank curated task intents. An intent only surfaces on a real signal: an
+ * exact-ish phrase hit, or every query term appearing in one of its phrases.
+ * Loose matching here would be worse than no intents at all, because an intent
+ * card is visually louder than a page row and pushes real results down.
+ *
+ * @param {string} query
+ * @param {Array<{id:string,title:string,blurb:string,match:string[],steps:any[]}>} intents
+ * @returns {Array<{intent:any, score:number}>}
+ */
+export function rankIntents(query, intents, opts = {}) {
+ const whole = normalize(query).trim();
+ if (whole.length < 2) return [];
+ const terms = tokenize(query);
+ const limit = opts.limit ?? 3;
+ const out = [];
+
+ for (const intent of intents) {
+ let best = 0;
+ for (const raw of intent.match || []) {
+ const phrase = normalize(raw);
+ if (phrase === whole) best = Math.max(best, 5000);
+ else if (phrase.startsWith(whole)) best = Math.max(best, 3400 + whole.length * 8);
+ else if (whole.startsWith(phrase)) best = Math.max(best, 3000 + phrase.length * 8);
+ else if (whole.includes(phrase)) best = Math.max(best, 2200 + phrase.length * 6);
+ else if (phrase.includes(whole)) best = Math.max(best, 1600 + whole.length * 6);
+ }
+ if (best === 0) {
+ // Every term present across the phrase set plus the title. Handles
+ // "how do i get paid" hitting the "get paid" intent without letting a
+ // single incidental word do it.
+ const hay = `${normalize(intent.title)} ${(intent.match || []).map(normalize).join(' ')}`;
+ if (terms.length >= 2 && terms.every((t) => hay.includes(t))) best = 1200 + terms.length * 60;
+ }
+ if (best > 0) out.push({ intent, score: best });
+ }
+
+ out.sort((a, b) => b.score - a.score);
+ return out.slice(0, limit);
+}
+
+/**
+ * Split `text` into alternating plain/matched runs so the UI can bold what the
+ * visitor actually typed. Returns [{t, hit}]. Overlapping term hits are merged,
+ * which is why this returns runs rather than a marked-up string.
+ */
+export function highlight(text, query) {
+ const source = String(text || '');
+ const hay = normalize(source);
+ const terms = [...new Set(tokenize(query))].sort((a, b) => b.length - a.length);
+ const marks = new Array(hay.length).fill(false);
+
+ for (const term of terms) {
+ let from = 0;
+ for (;;) {
+ const at = hay.indexOf(term, from);
+ if (at === -1) break;
+ for (let i = at; i < at + term.length; i++) marks[i] = true;
+ from = at + term.length;
+ }
+ }
+
+ const runs = [];
+ let i = 0;
+ while (i < source.length) {
+ const hit = marks[i] === true;
+ let j = i;
+ while (j < source.length && (marks[j] === true) === hit) j++;
+ runs.push({ t: source.slice(i, j), hit });
+ i = j;
+ }
+ return runs.length ? runs : [{ t: source, hit: false }];
+}
diff --git a/public/media/tour/agenc-embodied.thumb.webp b/public/media/tour/agenc-embodied.thumb.webp
new file mode 100644
index 000000000..11a39295e
Binary files /dev/null and b/public/media/tour/agenc-embodied.thumb.webp differ
diff --git a/public/media/tour/agenc-embodied.webp b/public/media/tour/agenc-embodied.webp
new file mode 100644
index 000000000..3d2677b98
Binary files /dev/null and b/public/media/tour/agenc-embodied.webp differ
diff --git a/public/media/tour/create-agent.thumb.webp b/public/media/tour/create-agent.thumb.webp
new file mode 100644
index 000000000..3e53e5a9e
Binary files /dev/null and b/public/media/tour/create-agent.thumb.webp differ
diff --git a/public/media/tour/create-agent.webp b/public/media/tour/create-agent.webp
new file mode 100644
index 000000000..f342795da
Binary files /dev/null and b/public/media/tour/create-agent.webp differ
diff --git a/public/media/tour/docs.thumb.webp b/public/media/tour/docs.thumb.webp
new file mode 100644
index 000000000..223dae8c5
Binary files /dev/null and b/public/media/tour/docs.thumb.webp differ
diff --git a/public/media/tour/docs.webp b/public/media/tour/docs.webp
new file mode 100644
index 000000000..daa4dc92b
Binary files /dev/null and b/public/media/tour/docs.webp differ
diff --git a/public/media/tour/forge.thumb.webp b/public/media/tour/forge.thumb.webp
new file mode 100644
index 000000000..1850db1f4
Binary files /dev/null and b/public/media/tour/forge.thumb.webp differ
diff --git a/public/media/tour/forge.webp b/public/media/tour/forge.webp
new file mode 100644
index 000000000..8d4932a44
Binary files /dev/null and b/public/media/tour/forge.webp differ
diff --git a/public/media/tour/home.thumb.webp b/public/media/tour/home.thumb.webp
new file mode 100644
index 000000000..82c92bf68
Binary files /dev/null and b/public/media/tour/home.thumb.webp differ
diff --git a/public/media/tour/home.webp b/public/media/tour/home.webp
new file mode 100644
index 000000000..0e7bd61d3
Binary files /dev/null and b/public/media/tour/home.webp differ
diff --git a/scripts/build-atlas-index.mjs b/scripts/build-atlas-index.mjs
new file mode 100644
index 000000000..be286155b
--- /dev/null
+++ b/scripts/build-atlas-index.mjs
@@ -0,0 +1,190 @@
+#!/usr/bin/env node
+// Build public/atlas-index.json, the search index behind the Atlas command
+// palette (public/atlas.js) and the Atlas map page (/atlas).
+// ============================================================================
+// The problem this exists to solve: three.ws ships 600+ public routes across ten
+// sections. Nothing on the site could take a visitor from "I want to do X" to
+// the page that does X in one step; they had to already know the URL, or walk
+// the sitemap. Discovery was the single largest UX tax on the product.
+//
+// The index has two halves:
+//
+// pages is every route in data/pages.json, flattened into compact tuples.
+// This is the destination set. Generated, never hand-edited, so a
+// page can never be in the sitemap yet missing from search.
+// intents is data/atlas-intents.json: curated "how do I ..." tasks that answer
+// with ORDERED STEPS, not a link. A palette that only navigates
+// still leaves a newcomer guessing which of four plausible pages
+// starts the flow; an intent tells them the flow.
+//
+// The build GATE is the point of generating this rather than fetching
+// data/pages.json at runtime: every intent step target is resolved against the
+// real route table here, at build time. A step pointing at a route that does not
+// exist fails the build. That makes it structurally impossible to ship an
+// onboarding path that dead-ends on a 404, the exact failure mode that makes
+// hand-written getting-started docs rot.
+
+import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
+import { dirname, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+const PAGES = resolve(root, 'data/pages.json');
+const INTENTS = resolve(root, 'data/atlas-intents.json');
+const OUT = resolve(root, 'public/atlas-index.json');
+
+// Descriptions in data/pages.json run to 428 chars. The palette renders one
+// clamped line and scores on the leading text anyway, so carrying the full body
+// would roughly double the payload for text no one reads. 160 is the meta
+// description convention and keeps the sentence intact in practice.
+const DESC_MAX = 160;
+
+// Routes an intent step may target that are not pages in data/pages.json:
+// external docs, API endpoints, and the palette's own pseudo-actions. Anything
+// NOT in this set and not a real page path fails the build.
+const NON_PAGE_TARGETS = new Set(['/docs/start-here', '/api/status', '/llms.txt']);
+
+function clampDescription(text) {
+ const s = String(text || '').trim();
+ if (s.length <= DESC_MAX) return s;
+ // Cut on a word boundary so the clamped line never ends mid-token.
+ const cut = s.slice(0, DESC_MAX);
+ const lastSpace = cut.lastIndexOf(' ');
+ return `${(lastSpace > DESC_MAX * 0.6 ? cut.slice(0, lastSpace) : cut).replace(/[,;:]$/, '')}...`;
+}
+
+function readJson(path, label) {
+ try {
+ return JSON.parse(readFileSync(path, 'utf8'));
+ } catch (e) {
+ console.error(`[atlas] cannot read ${label} (${path}): ${e.message}`);
+ process.exit(2);
+ }
+}
+
+const pagesDoc = readJson(PAGES, 'the route table');
+const intentsDoc = readJson(INTENTS, 'the intent catalog');
+
+if (!Array.isArray(pagesDoc.sections)) {
+ console.error('[atlas] data/pages.json has no `sections` array');
+ process.exit(2);
+}
+
+/** @type {Array<[string,string,string,string,number,number]>} */
+const pages = [];
+const sections = [];
+const knownPaths = new Set();
+const duplicates = [];
+
+for (const section of pagesDoc.sections) {
+ sections.push({ id: section.id, title: section.title, hint: section.description || '' });
+ for (const page of section.pages || []) {
+ if (!page.path) continue;
+ if (knownPaths.has(page.path)) {
+ duplicates.push(page.path);
+ continue;
+ }
+ knownPaths.add(page.path);
+ // Tuple order is a wire contract with public/atlas.js and src/atlas-page.js:
+ // [path, title, description, sectionId, priority, flags].
+ // flags is a bitfield: 1 = needs sign-in, 2 = not search-indexable.
+ const flags = (page.auth ? 1 : 0) | (page.indexable === false ? 2 : 0);
+ pages.push([
+ page.path,
+ page.title || page.path,
+ clampDescription(page.description),
+ section.id,
+ typeof page.priority === 'number' ? page.priority : 0.5,
+ flags,
+ ]);
+ }
+}
+
+if (duplicates.length) {
+ console.error(
+ `[atlas] data/pages.json declares ${duplicates.length} duplicate path(s): ${duplicates.join(', ')}`,
+ );
+ process.exit(1);
+}
+
+// ---------------------------------------------------------------------------
+// Intent validation. Every claim an intent makes about the product has to be
+// checkable, so all three of these are hard failures rather than warnings:
+// a step that goes nowhere real, an intent with no trigger phrases (it would be
+// unreachable), and a duplicate id (the palette dedupes by id and would drop one).
+// ---------------------------------------------------------------------------
+const intents = [];
+const seenIntentIds = new Set();
+const problems = [];
+
+for (const intent of intentsDoc.intents || []) {
+ if (!intent.id) {
+ problems.push(`an intent is missing "id" (title: ${intent.title || 'untitled'})`);
+ continue;
+ }
+ if (seenIntentIds.has(intent.id)) {
+ problems.push(`duplicate intent id "${intent.id}"`);
+ continue;
+ }
+ seenIntentIds.add(intent.id);
+
+ const match = Array.isArray(intent.match) ? intent.match.filter(Boolean) : [];
+ if (match.length === 0) problems.push(`intent "${intent.id}" has no match phrases, so nothing can reach it`);
+
+ const steps = Array.isArray(intent.steps) ? intent.steps : [];
+ if (steps.length === 0) problems.push(`intent "${intent.id}" has no steps`);
+
+ for (const [i, step] of steps.entries()) {
+ if (!step.do) problems.push(`intent "${intent.id}" step ${i + 1} has no "do" text`);
+ if (!step.to) continue; // A step may be pure instruction with no destination.
+ if (/^https?:\/\//.test(step.to)) continue; // External links are the author's call.
+ if (knownPaths.has(step.to) || NON_PAGE_TARGETS.has(step.to)) continue;
+ problems.push(
+ `intent "${intent.id}" step ${i + 1} points at "${step.to}", which is not a route in data/pages.json`,
+ );
+ }
+
+ intents.push({
+ id: intent.id,
+ title: intent.title,
+ blurb: intent.blurb || '',
+ match,
+ steps: steps.map((s) => ({ do: s.do, ...(s.to ? { to: s.to } : {}), ...(s.note ? { note: s.note } : {}) })),
+ });
+}
+
+if (problems.length) {
+ console.error('[atlas] the intent catalog does not hold up:');
+ for (const p of problems) console.error(` - ${p}`);
+ process.exit(1);
+}
+
+const out = {
+ // Not a timestamp: a content fingerprint. A rebuild that changes nothing
+ // leaves the file byte-identical, so the CDN keeps serving the cached copy
+ // and `git status` stays clean between unrelated builds.
+ version: 1,
+ pageCount: pages.length,
+ intentCount: intents.length,
+ sections,
+ pages,
+ intents,
+};
+
+mkdirSync(dirname(OUT), { recursive: true });
+const json = JSON.stringify(out);
+let previous = null;
+try {
+ previous = readFileSync(OUT, 'utf8');
+} catch {
+ previous = null;
+}
+if (previous === json) {
+ console.log(`[atlas] index unchanged (${pages.length} pages, ${intents.length} intents)`);
+} else {
+ writeFileSync(OUT, json);
+ console.log(
+ `[atlas] wrote ${OUT.replace(`${root}/`, '')}: ${pages.length} pages across ` +
+ `${sections.length} sections, ${intents.length} intents, ${(json.length / 1024).toFixed(1)} KB`,
+ );
+}
diff --git a/scripts/capture-tour-atlas.mjs b/scripts/capture-tour-atlas.mjs
new file mode 100644
index 000000000..d3684f5a4
--- /dev/null
+++ b/scripts/capture-tour-atlas.mjs
@@ -0,0 +1,603 @@
+#!/usr/bin/env node
+/**
+ * capture-tour-atlas.mjs: turn the Feature Tour curriculum into a real,
+ * verified picture of the product.
+ *
+ * ── Why this exists ──────────────────────────────────────────────────────────
+ * The Feature Tour (src/feature-tour/*) already knows more about this platform
+ * than any other artifact in the repo: every page worth showing, the element on
+ * that page worth pointing at, and a plain-language sentence about what it does.
+ * That knowledge was only ever spent at runtime, on one visitor at a time, and
+ * nothing verified it. When a page was redesigned the tour's CSS anchor quietly
+ * stopped matching, the spotlight fell back to a whole-page dim, and no test
+ * anywhere noticed.
+ *
+ * This script drives a real Chromium across every stop in the curriculum
+ * against a real deployment. For each stop it:
+ *
+ * 1. loads the stop's page and records the HTTP status and console errors,
+ * 2. resolves the stop's CSS anchor the same way the live Spotlight does,
+ * 3. paints the tour's own spotlight ring over the resolved element,
+ * 4. screenshots the viewport and encodes a hero + thumbnail WebP.
+ *
+ * The output is two things at once:
+ *
+ * • a media library (public/media/tour/*.webp) of real product screenshots
+ * with the feature under discussion literally circled, which the docs,
+ * tutorials and the /tour/atlas page all render, and
+ * • a health manifest (data/tour-atlas.json) that says, per stop, whether the
+ * anchor still resolves. scripts/audit-tour-atlas.mjs turns that into a
+ * gate, so tour rot fails a check instead of silently degrading.
+ *
+ * No mock pages and no synthetic fixtures: the default target is production, so
+ * a shot in the atlas is a shot of what a visitor sees right now.
+ *
+ * ── Usage ────────────────────────────────────────────────────────────────────
+ * node scripts/capture-tour-atlas.mjs # every stop, from https://three.ws
+ * node scripts/capture-tour-atlas.mjs --base http://localhost:3000
+ * node scripts/capture-tour-atlas.mjs --only home,forge # just these stop ids
+ * node scripts/capture-tour-atlas.mjs --section build # one curriculum chapter
+ * node scripts/capture-tour-atlas.mjs --track quick # one track's playlist
+ * node scripts/capture-tour-atlas.mjs --limit 10
+ * node scripts/capture-tour-atlas.mjs --concurrency 4 # default 3
+ * node scripts/capture-tour-atlas.mjs --settle 3500 # ms after load before shooting
+ * node scripts/capture-tour-atlas.mjs --health # resolve anchors only, write nothing
+ * node scripts/capture-tour-atlas.mjs --mobile # also capture a 390px shot per stop
+ *
+ * A partial run (--only / --section / --track / --limit) MERGES into the existing
+ * manifest rather than replacing it, so re-shooting one chapter never deletes the
+ * rest of the atlas.
+ */
+import { chromium } from 'playwright';
+import sharp from 'sharp';
+import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
+import { resolve, dirname } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+const CURRICULUM_PATH = resolve(ROOT, 'public/tour/curriculum.json');
+const MANIFEST_PATH = resolve(ROOT, 'data/tour-atlas.json');
+const MEDIA_DIR = resolve(ROOT, 'public/media/tour');
+const MEDIA_URL_BASE = '/media/tour';
+
+// ── CLI ──────────────────────────────────────────────────────────────────────
+const argv = process.argv.slice(2);
+const flag = (n) => argv.includes(`--${n}`);
+const opt = (n, fallback) => {
+ const i = argv.indexOf(`--${n}`);
+ return i !== -1 && argv[i + 1] && !argv[i + 1].startsWith('--') ? argv[i + 1] : fallback;
+};
+const list = (n) =>
+ String(opt(n, ''))
+ .split(',')
+ .map((s) => s.trim())
+ .filter(Boolean);
+
+const BASE = String(opt('base', process.env.BASE_URL || 'https://three.ws')).replace(/\/$/, '');
+const ONLY = new Set(list('only'));
+const SECTIONS = new Set(list('section'));
+const TRACK = opt('track', '');
+const LIMIT = Number(opt('limit', 0)) || 0;
+const CONCURRENCY = Math.min(8, Math.max(1, Number(opt('concurrency', 3)) || 3));
+const SETTLE_MS = Math.max(0, Number(opt('settle', 3000)) || 3000);
+const NAV_TIMEOUT_MS = Math.max(10_000, Number(opt('timeout', 45_000)) || 45_000);
+const HEALTH_ONLY = flag('health');
+const WITH_MOBILE = flag('mobile');
+const QUIET = flag('quiet');
+
+// Capture geometry. The hero is what the atlas lightbox and the tutorials show;
+// the thumb is what the atlas grid lazy-loads, so it has to stay small enough
+// that a 185-card grid is cheap on a phone.
+const DESKTOP = { width: 1280, height: 800, deviceScaleFactor: 2 };
+const MOBILE = { width: 390, height: 844, deviceScaleFactor: 2 };
+const HERO_WIDTH = 1200;
+const HERO_QUALITY = 78;
+const THUMB_WIDTH = 520;
+const THUMB_QUALITY = 60;
+const MOBILE_WIDTH = 620;
+
+const log = (...a) => {
+ if (!QUIET) console.log(...a);
+};
+
+// ── Curriculum ───────────────────────────────────────────────────────────────
+function loadCurriculum() {
+ if (!existsSync(CURRICULUM_PATH)) {
+ throw new Error(
+ `missing ${CURRICULUM_PATH}. Run "node scripts/build-tour.mjs" to generate the curriculum first.`,
+ );
+ }
+ const data = JSON.parse(readFileSync(CURRICULUM_PATH, 'utf8'));
+ if (!Array.isArray(data.stops) || !data.stops.length) throw new Error('curriculum has no stops');
+ return data;
+}
+
+// Which tracks a stop belongs to, mirroring buildPlaylist() in
+// src/feature-tour/curriculum.js. Onboarding stops are deliberately disjoint
+// from full/quick there, and the atlas has to report the same membership or its
+// track filter would lie about what a visitor actually sees.
+function tracksFor(stop) {
+ if (stop.section === 'onboarding') return ['onboarding'];
+ return stop.highlight ? ['full', 'quick'] : ['full'];
+}
+
+function selectStops(curriculum) {
+ let stops = curriculum.stops.map((stop, index) => ({ ...stop, index, tracks: tracksFor(stop) }));
+ if (ONLY.size) stops = stops.filter((s) => ONLY.has(s.id));
+ if (SECTIONS.size) stops = stops.filter((s) => SECTIONS.has(s.section));
+ if (TRACK) stops = stops.filter((s) => s.tracks.includes(TRACK));
+ if (LIMIT) stops = stops.slice(0, LIMIT);
+ return stops;
+}
+
+const isPartialRun = () => ONLY.size > 0 || SECTIONS.size > 0 || Boolean(TRACK) || LIMIT > 0;
+
+// The ordered selector groups the live tour would try for a stop, tagged with
+// where each came from so the atlas can tell a curated anchor apart from the
+// director's generic fallback. Only about a fifth of the curriculum carries
+// hand-authored anchors (scripts/build-tour.mjs, TARGETS); every other stop is
+// spotlit by the fallback chain, which is why the atlas has to know it too. The
+// chain is imported from the same module the director imports it from, so the
+// two can never drift into reporting on a tour that does not exist.
+function anchorGroups(stop) {
+ const curated = (Array.isArray(stop.targets) ? stop.targets : []).filter(Boolean);
+ return [
+ ...curated.map((selector) => ({ selector, source: 'curriculum' })),
+ ...TOUR_FALLBACK_SELECTORS.map((selector) => ({ selector, source: 'fallback' })),
+ ];
+}
+
+// ── In-page helpers ──────────────────────────────────────────────────────────
+// Serialized into the live page by page.evaluate(). They run in the browser, so
+// they can close over nothing from this module: every input arrives as an
+// argument and every output has to be structured-cloneable.
+
+// Overlays that would otherwise sit on top of every shot. Each is a real
+// element this site can render (consent bar, PWA install prompt, the mobile nav
+// drawer when a narrow viewport auto-opens it). Removing them is not hiding a
+// failure: they are chrome that appears on any page, not the feature the stop
+// is about, and the tour dismisses or ignores them too.
+const CHROME_SELECTORS = [
+ '.cookie-banner',
+ '#cookie-banner',
+ '[data-cookie-consent]',
+ '.pwa-install-prompt',
+ '#pwa-install',
+ '.nav-drawer.is-open',
+ '.tws-toast',
+ '[data-testid="cookie-consent"]',
+];
+
+function dismissChrome(selectors) {
+ for (const sel of selectors) {
+ for (const el of document.querySelectorAll(sel)) el.remove();
+ }
+}
+
+// Resolve the stop's anchor byte-for-byte the way TourDirector._resolveTarget()
+// does in src/feature-tour/director.js: walk the selector groups in order, take
+// querySelector's FIRST match for each (not the first visible match across all
+// of them), and accept it only if it is visible. Any divergence here would make
+// the atlas a report about a tour that does not exist.
+//
+// `groups` arrives as [{ selector, source }] so the result can say whether the
+// anchor came from the curriculum's hand-authored `targets` or from the
+// director's generic fallback chain. That distinction is the difference between
+// "the tour points at this feature" and "the tour points at the page's h1".
+function resolveAnchor(groups) {
+ const visible = (el) => {
+ if (!el || !el.isConnected) return false;
+ const r = el.getBoundingClientRect();
+ if (r.width < 4 || r.height < 4) return false;
+ const cs = getComputedStyle(el);
+ return cs.visibility !== 'hidden' && cs.display !== 'none' && Number(cs.opacity) > 0.05;
+ };
+ const scopeOf = (el) => {
+ if (el.closest('main, [role="main"], article')) return 'main';
+ if (el.closest('header, nav, [role="navigation"], .site-nav, .nav')) return 'nav';
+ if (el.closest('footer')) return 'footer';
+ return 'other';
+ };
+ for (const group of groups) {
+ let el = null;
+ try {
+ el = document.querySelector(group.selector);
+ } catch {
+ continue; // an unparseable selector is rot too, and falls through as unmatched
+ }
+ if (!visible(el)) continue;
+ el.setAttribute('data-tws-atlas-anchor', '1');
+ return {
+ matched: true,
+ selector: group.selector,
+ source: group.source,
+ scope: scopeOf(el),
+ tag: el.tagName.toLowerCase(),
+ };
+ }
+ return { matched: false, selector: null, source: null, scope: null, tag: null };
+}
+
+// Scroll the anchor into view, then paint the tour's own spotlight over it plus
+// a caption chip. The ring geometry, colour and padding come straight from
+// src/feature-tour/spotlight.js so an atlas shot reads as a frame of the real
+// tour. The one deliberate difference is the scrim: the live tour dims the rest
+// of the page to 62% because a visitor can still scroll and look around, while
+// a still frame has to stay legible as a 520px thumbnail, so the atlas dims to
+// 44% instead.
+async function paintSpotlight(title) {
+ const el = document.querySelector('[data-tws-atlas-anchor]');
+ if (!el) return null;
+ // Only scroll when the anchor is not already comfortably in view, which is
+ // what src/feature-tour/spotlight.js does. Always centring would push the
+ // site header out of frame on pages where the tour never scrolls at all.
+ const first = el.getBoundingClientRect();
+ if (!(first.top >= 64 && first.bottom <= window.innerHeight - 64)) {
+ el.scrollIntoView({ behavior: 'auto', block: 'center', inline: 'nearest' });
+ }
+ await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
+ const r = el.getBoundingClientRect();
+ if (r.width < 4 || r.height < 4) return null;
+
+ const pad = 8;
+ const left = Math.max(0, r.left - pad);
+ const top = Math.max(0, r.top - pad);
+ const width = Math.min(window.innerWidth, r.right + pad) - left;
+ const height = Math.min(window.innerHeight, r.bottom + pad) - top;
+
+ const style = document.createElement('style');
+ style.textContent = `
+.tws-atlas-spot{position:fixed;z-index:2147483100;border-radius:12px;pointer-events:none;
+ box-shadow:0 0 0 9999px rgba(8,10,16,.44),0 0 0 2px rgba(122,162,255,.95),0 0 28px 6px rgba(122,162,255,.5) inset}
+.tws-atlas-spot::after{content:'';position:absolute;inset:-2px;border-radius:14px;border:2px solid rgba(122,162,255,.55)}
+.tws-atlas-chip{position:fixed;z-index:2147483101;max-width:min(420px,72vw);padding:9px 14px;border-radius:999px;
+ font:600 13px/1.35 Inter,system-ui,-apple-system,sans-serif;color:#eef1ff;background:rgba(12,14,22,.92);
+ border:1px solid rgba(122,162,255,.42);box-shadow:0 12px 34px rgba(0,0,0,.45);
+ white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}`;
+ document.head.appendChild(style);
+
+ const spot = document.createElement('div');
+ spot.className = 'tws-atlas-spot';
+ spot.style.cssText = `left:${left}px;top:${top}px;width:${width}px;height:${height}px`;
+ document.body.appendChild(spot);
+
+ const chip = document.createElement('div');
+ chip.className = 'tws-atlas-chip';
+ chip.textContent = title;
+ document.body.appendChild(chip);
+ const ch = chip.getBoundingClientRect();
+ // Prefer sitting under the ring; flip above when that would fall off-screen,
+ // and clamp horizontally so a wide chip never bleeds past the viewport.
+ const below = top + height + 14;
+ const chipTop = below + ch.height < window.innerHeight - 12 ? below : Math.max(12, top - ch.height - 14);
+ const chipLeft = Math.min(
+ Math.max(12, left + width / 2 - ch.width / 2),
+ window.innerWidth - ch.width - 12,
+ );
+ chip.style.left = chipLeft + 'px';
+ chip.style.top = chipTop + 'px';
+
+ return { left, top, width, height };
+}
+
+// Freeze motion right before the shutter so two runs of the same stop produce
+// comparable frames. Applied last, after scrolling and painting, so nothing that
+// depends on a transition to become visible is caught mid-flight.
+function freezeMotion() {
+ const style = document.createElement('style');
+ style.textContent = `*,*::before,*::after{animation-play-state:paused !important;
+ animation-duration:0s !important;transition:none !important;caret-color:transparent !important}
+ html{scrollbar-width:none}::-webkit-scrollbar{display:none}`;
+ document.head.appendChild(style);
+}
+
+// Lazy images below the fold never decode in a headless run, which leaves grey
+// holes in the shot. Force every in-viewport lazy image to load eagerly and wait
+// for the decode, so the atlas shows the page as a scrolling human sees it.
+async function settleImages() {
+ const imgs = Array.from(document.images).filter((img) => {
+ const r = img.getBoundingClientRect();
+ return r.bottom > -200 && r.top < window.innerHeight + 200;
+ });
+ for (const img of imgs) {
+ if (img.loading === 'lazy') img.loading = 'eager';
+ if (img.dataset.src && !img.src) img.src = img.dataset.src;
+ }
+ await Promise.all(
+ imgs.map((img) =>
+ img.complete
+ ? Promise.resolve()
+ : new Promise((r) => {
+ img.addEventListener('load', r, { once: true });
+ img.addEventListener('error', r, { once: true });
+ setTimeout(r, 4000);
+ }),
+ ),
+ );
+ try {
+ await document.fonts.ready;
+ } catch {
+ /* fonts API unavailable, the shot is still valid */
+ }
+}
+
+// ── Capture ──────────────────────────────────────────────────────────────────
+async function encode(buffer, { file, width, quality }) {
+ const out = resolve(MEDIA_DIR, file);
+ const info = await sharp(buffer)
+ .resize({ width, withoutEnlargement: true })
+ .webp({ quality, effort: 5 })
+ .toFile(out);
+ return { url: `${MEDIA_URL_BASE}/${file}`, width: info.width, height: info.height, bytes: info.size };
+}
+
+async function captureStop(context, stop) {
+ const page = await context.newPage();
+ const consoleErrors = [];
+ const notes = [];
+
+ page.on('console', (msg) => {
+ if (msg.type() !== 'error') return;
+ const text = msg.text().slice(0, 300);
+ if (consoleErrors.length < 8) consoleErrors.push(text);
+ });
+ page.on('pageerror', (err) => {
+ if (consoleErrors.length < 8) consoleErrors.push(String(err?.message || err).slice(0, 300));
+ });
+
+ const record = {
+ id: stop.id,
+ index: stop.index,
+ title: stop.title,
+ path: stop.path,
+ section: stop.section,
+ tracks: stop.tracks,
+ highlight: Boolean(stop.highlight),
+ narration: stop.narration || '',
+ status: 0,
+ anchor: { state: 'unresolved', selector: null, source: null, scope: null, tag: null, rect: null },
+ consoleErrors: 0,
+ consoleSamples: [],
+ notes,
+ media: null,
+ capturedAt: new Date().toISOString(),
+ };
+
+ try {
+ const response = await page.goto(`${BASE}${stop.path}`, {
+ waitUntil: 'domcontentloaded',
+ timeout: NAV_TIMEOUT_MS,
+ });
+ record.status = response?.status() ?? 0;
+
+ // A 4xx/5xx page has nothing worth photographing, and a shot of the error
+ // page in the atlas would read as a real feature. Record and stop.
+ if (record.status >= 400) {
+ notes.push(`page returned HTTP ${record.status}`);
+ return record;
+ }
+
+ await page.waitForLoadState('load', { timeout: NAV_TIMEOUT_MS }).catch(() => {
+ notes.push('load event did not fire within the timeout, captured at domcontentloaded');
+ });
+ await page.waitForTimeout(SETTLE_MS);
+ await page.evaluate(dismissChrome, CHROME_SELECTORS);
+
+ const groups = anchorGroups(stop);
+ const hit = await page.evaluate(resolveAnchor, groups);
+ record.anchor.state = hit.matched ? 'resolved' : 'missing';
+ record.anchor.selector = hit.selector;
+ record.anchor.source = hit.source;
+ record.anchor.scope = hit.scope;
+ record.anchor.tag = hit.tag;
+ if (!hit.matched) {
+ notes.push(`none of the ${groups.length} tour anchors matched a visible element`);
+ } else if (hit.source === 'fallback') {
+ notes.push("anchored by the director's generic fallback, not a curated selector for this page");
+ } else if (hit.scope === 'nav') {
+ notes.push('the anchor resolved inside the site nav rather than the page content');
+ }
+
+ await page.evaluate(settleImages);
+
+ if (record.anchor.state === 'resolved') {
+ const rect = await page.evaluate(paintSpotlight, stop.title);
+ if (rect) record.anchor.rect = rect;
+ else {
+ // The anchor resolved but went zero-size or detached during the scroll.
+ // That is the same failure the live Spotlight hits, so report it as rot.
+ record.anchor.state = 'missing';
+ notes.push('the tour anchor stopped being paintable after scrolling into view');
+ }
+ }
+
+ if (!HEALTH_ONLY) {
+ await page.evaluate(freezeMotion);
+ const png = await page.screenshot({ type: 'png', animations: 'disabled' });
+ const hero = await encode(png, {
+ file: `${stop.id}.webp`,
+ width: HERO_WIDTH,
+ quality: HERO_QUALITY,
+ });
+ const thumb = await encode(png, {
+ file: `${stop.id}.thumb.webp`,
+ width: THUMB_WIDTH,
+ quality: THUMB_QUALITY,
+ });
+ record.media = { hero, thumb };
+
+ if (WITH_MOBILE) {
+ await page.setViewportSize({ width: MOBILE.width, height: MOBILE.height });
+ await page.waitForTimeout(600);
+ await page.evaluate(dismissChrome, CHROME_SELECTORS);
+ await page.evaluate(settleImages);
+ const mobilePng = await page.screenshot({ type: 'png', animations: 'disabled' });
+ record.media.mobile = await encode(mobilePng, {
+ file: `${stop.id}.mobile.webp`,
+ width: MOBILE_WIDTH,
+ quality: HERO_QUALITY,
+ });
+ }
+ }
+ } catch (err) {
+ notes.push(String(err?.message || err).slice(0, 300));
+ } finally {
+ record.consoleErrors = consoleErrors.length;
+ record.consoleSamples = consoleErrors.slice(0, 3);
+ await page.close().catch(() => {});
+ }
+
+ return record;
+}
+
+// ── Manifest ─────────────────────────────────────────────────────────────────
+function readExistingManifest() {
+ if (!existsSync(MANIFEST_PATH)) return null;
+ try {
+ return JSON.parse(readFileSync(MANIFEST_PATH, 'utf8'));
+ } catch {
+ return null;
+ }
+}
+
+function summarize(stops) {
+ const resolved = stops.filter((s) => s.anchor.state === 'resolved');
+ return {
+ total: stops.length,
+ anchored: resolved.length,
+ missingAnchor: stops.filter((s) => s.anchor.state === 'missing').length,
+ // A curated anchor points at the feature the narration is about. A
+ // fallback anchor points at whatever heading the page happens to have, so
+ // the count is the size of the "this stop deserves a real anchor" backlog.
+ curatedAnchor: resolved.filter((s) => s.anchor.source === 'curriculum').length,
+ fallbackAnchor: resolved.filter((s) => s.anchor.source === 'fallback').length,
+ navScopedAnchor: resolved.filter((s) => s.anchor.scope === 'nav').length,
+ unreachable: stops.filter((s) => s.status >= 400 || s.status === 0).length,
+ withConsoleErrors: stops.filter((s) => s.consoleErrors > 0).length,
+ captured: stops.filter((s) => Boolean(s.media)).length,
+ };
+}
+
+function writeManifest(curriculum, fresh) {
+ const previous = readExistingManifest();
+ const merged = new Map();
+ if (isPartialRun() && previous?.stops) {
+ for (const stop of previous.stops) merged.set(stop.id, stop);
+ }
+ for (const stop of fresh) merged.set(stop.id, stop);
+
+ // A stop that left the curriculum has to leave the atlas, or the guard would
+ // keep checking media for a page nobody can reach any more.
+ const live = new Set(curriculum.stops.map((s) => s.id));
+ const stops = [...merged.values()]
+ .filter((s) => live.has(s.id))
+ .sort((a, b) => a.index - b.index);
+
+ const manifest = {
+ version: 1,
+ generatedBy: 'scripts/capture-tour-atlas.mjs',
+ generatedAt: new Date().toISOString(),
+ base: BASE,
+ curriculumVersion: curriculum.version ?? null,
+ curriculumGeneratedAt: curriculum.generatedAt ?? null,
+ sections: (curriculum.sections || []).map((s) => ({ id: s.id, title: s.title })),
+ tracks: (curriculum.tracks || []).map((t) => ({ id: t.id, title: t.title })),
+ summary: summarize(stops),
+ stops,
+ };
+ writeFileSync(MANIFEST_PATH, `${JSON.stringify(manifest, null, '\t')}\n`);
+ return manifest;
+}
+
+// ── Run ──────────────────────────────────────────────────────────────────────
+async function main() {
+ const curriculum = loadCurriculum();
+ const stops = selectStops(curriculum);
+ if (!stops.length) {
+ console.error('No stops matched the given filters.');
+ process.exitCode = 1;
+ return;
+ }
+ if (!HEALTH_ONLY) mkdirSync(MEDIA_DIR, { recursive: true });
+
+ log(
+ `Tour Atlas ${HEALTH_ONLY ? 'health sweep' : 'capture'}: ${stops.length} stop${stops.length === 1 ? '' : 's'} against ${BASE} (${CONCURRENCY} in parallel)`,
+ );
+
+ const browser = await chromium.launch({ args: ['--force-color-profile=srgb'] });
+ const results = [];
+ let cursor = 0;
+ let done = 0;
+
+ const worker = async () => {
+ const context = await browser.newContext({
+ viewport: { width: DESKTOP.width, height: DESKTOP.height },
+ deviceScaleFactor: DESKTOP.deviceScaleFactor,
+ colorScheme: 'dark',
+ reducedMotion: 'reduce',
+ locale: 'en-US',
+ // A tour visitor is a real browser, so the atlas must be one too:
+ // spoofing a bot UA would change which experiences the site serves.
+ userAgent:
+ 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 three-ws-tour-atlas',
+ });
+ try {
+ for (;;) {
+ const i = cursor++;
+ if (i >= stops.length) break;
+ const stop = stops[i];
+ const record = await captureStop(context, stop);
+ results.push(record);
+ done++;
+ const mark =
+ record.status >= 400 || record.status === 0
+ ? 'DEAD'
+ : record.anchor.state === 'missing'
+ ? 'ROT '
+ : record.anchor.state === 'none'
+ ? 'PAGE'
+ : 'OK ';
+ log(
+ ` [${String(done).padStart(3)}/${stops.length}] ${mark} ${record.path} ${record.id}` +
+ (record.notes.length ? ` (${record.notes[0]})` : ''),
+ );
+ }
+ } finally {
+ await context.close().catch(() => {});
+ }
+ };
+
+ await Promise.all(Array.from({ length: Math.min(CONCURRENCY, stops.length) }, worker));
+ await browser.close();
+
+ results.sort((a, b) => a.index - b.index);
+
+ if (HEALTH_ONLY) {
+ const s = summarize(results);
+ console.log(
+ `\nAnchors: ${s.anchored} resolved, ${s.missingAnchor} missing, ${s.wholePage} whole-page. ` +
+ `${s.unreachable} unreachable page(s), ${s.withConsoleErrors} with console errors.`,
+ );
+ for (const r of results.filter((r) => r.anchor.state === 'missing')) {
+ console.log(` rot: ${r.id} (${r.path}): ${r.notes[0] || 'anchor did not resolve'}`);
+ }
+ process.exitCode = s.missingAnchor > 0 || s.unreachable > 0 ? 1 : 0;
+ return;
+ }
+
+ const manifest = writeManifest(curriculum, results);
+ const s = manifest.summary;
+ const bytes = manifest.stops.reduce(
+ (n, stop) => n + (stop.media?.hero?.bytes || 0) + (stop.media?.thumb?.bytes || 0) + (stop.media?.mobile?.bytes || 0),
+ 0,
+ );
+ log(
+ `\nWrote ${MANIFEST_PATH.replace(`${ROOT}/`, '')}: ${s.total} stops, ${s.captured} captured, ` +
+ `${s.anchored} anchored, ${s.missingAnchor} rotted, ${(bytes / 1e6).toFixed(1)} MB of media.`,
+ );
+}
+
+main().catch((err) => {
+ console.error(err);
+ process.exit(1);
+});
diff --git a/src/atlas-page.js b/src/atlas-page.js
new file mode 100644
index 000000000..bd0488f61
--- /dev/null
+++ b/src/atlas-page.js
@@ -0,0 +1,301 @@
+/**
+ * /atlas: the whole platform as one page.
+ *
+ * The Cmd+K palette (public/atlas.js) is for people who know roughly what they
+ * want. This page is for the other case: someone who wants to see what the
+ * product actually contains. 600+ routes is too many to list flat and hope, so
+ * the page browses by section by default, collapses to a single ranked list the
+ * moment you type, and puts the curated task shortcuts above both.
+ *
+ * It reads the exact same generated index and the exact same ranking module as
+ * the palette, so a result can never be reachable in one and missing from the
+ * other. Search state lives in the URL (?q=), which makes any filtered view a
+ * link you can send to someone.
+ */
+import { rankPages, rankIntents, highlight } from '../public/atlas/score.js';
+
+const INDEX_URL = '/atlas-index.json';
+
+const $q = /** @type {HTMLInputElement} */ (document.getElementById('at-q'));
+const $clear = document.getElementById('at-clear');
+const $rail = document.getElementById('at-rail');
+const $intentsWrap = document.getElementById('at-intents-wrap');
+const $intents = document.getElementById('at-intents');
+const $intentCount = document.getElementById('at-intent-count');
+const $body = document.getElementById('at-body');
+const $live = document.getElementById('at-live');
+
+/** @type {{sections:any[],pages:any[][],intents:any[],pageCount:number}|null} */
+let index = null;
+let frame = 0;
+
+function el(tag, className, text) {
+ const node = document.createElement(tag);
+ if (className) node.className = className;
+ if (text != null) node.textContent = text;
+ return node;
+}
+
+/** Paint `text` into `node`, wrapping the matched runs in <mark>. */
+function paint(node, text, query) {
+ node.textContent = '';
+ const runs = query ? highlight(text, query) : [{ t: text, hit: false }];
+ for (const run of runs) {
+ if (run.hit) node.appendChild(el('mark', null, run.t));
+ else node.appendChild(document.createTextNode(run.t));
+ }
+}
+
+function sectionById(id) {
+ return index.sections.find((s) => s.id === id) || { id, title: id, hint: '' };
+}
+
+function pageCard(page, query) {
+ const card = el('a', 'at-card');
+ card.href = page[0];
+
+ const title = el('div', 'at-card-title');
+ const name = el('span');
+ paint(name, page[1], query);
+ title.appendChild(name);
+ const path = el('span', 'at-card-path');
+ paint(path, page[0], query);
+ title.appendChild(path);
+ if (page[5] & 1) title.appendChild(el('span', 'at-tag', 'sign-in'));
+ card.appendChild(title);
+
+ if (page[2]) {
+ const desc = el('div', 'at-card-desc');
+ paint(desc, page[2], query);
+ card.appendChild(desc);
+ }
+ return card;
+}
+
+function intentCard(intent) {
+ const card = el('article', 'at-intent');
+ card.appendChild(el('h3', null, intent.title));
+ if (intent.blurb) card.appendChild(el('p', null, intent.blurb));
+
+ const ol = el('ol');
+ for (const step of intent.steps) {
+ const li = el('li');
+ if (step.to) {
+ const a = el('a', null, step.do);
+ a.href = step.to;
+ li.appendChild(a);
+ } else {
+ li.appendChild(document.createTextNode(step.do));
+ }
+ if (step.note) {
+ li.appendChild(document.createTextNode(' '));
+ li.appendChild(el('em', null, `(${step.note})`));
+ }
+ ol.appendChild(li);
+ }
+ card.appendChild(ol);
+ return card;
+}
+
+function renderRail(counts) {
+ $rail.textContent = '';
+ for (const section of index.sections) {
+ const n = counts ? counts.get(section.id) || 0 : sectionPages(section.id).length;
+ if (n === 0) continue;
+ const chip = el('a', 'at-chip');
+ chip.href = `#section-${section.id}`;
+ chip.appendChild(document.createTextNode(section.title));
+ chip.appendChild(el('span', null, String(n)));
+ $rail.appendChild(chip);
+ }
+}
+
+function sectionPages(id) {
+ return index.pages.filter((p) => p[3] === id);
+}
+
+/** Grouped browse view: every section, every page. */
+function renderBrowse() {
+ $body.textContent = '';
+ renderRail(null);
+
+ for (const section of index.sections) {
+ const pages = sectionPages(section.id);
+ if (!pages.length) continue;
+
+ const wrap = el('section', 'at-section');
+ wrap.id = `section-${section.id}`;
+
+ const head = el('div', 'at-section-head');
+ head.appendChild(el('h2', null, section.title));
+ head.appendChild(el('span', 'at-count', `${pages.length} ${pages.length === 1 ? 'page' : 'pages'}`));
+ if (section.hint) head.appendChild(el('p', null, section.hint));
+ wrap.appendChild(head);
+
+ const grid = el('div', 'at-grid');
+ // Highest priority first, then alphabetical, so the surfaces that matter
+ // lead each section instead of whatever order the route table happens to
+ // hold.
+ const ordered = pages.slice().sort((a, b) => (b[4] || 0) - (a[4] || 0) || a[1].localeCompare(b[1]));
+ for (const page of ordered) grid.appendChild(pageCard(page, ''));
+ wrap.appendChild(grid);
+ $body.appendChild(wrap);
+ }
+
+ $intentsWrap.hidden = false;
+ $intents.textContent = '';
+ for (const intent of index.intents) $intents.appendChild(intentCard(intent));
+ $intentCount.textContent = `${index.intents.length} shortcuts`;
+
+ $live.textContent = `${index.pageCount} pages across ${index.sections.length} sections.`;
+ watchSections();
+}
+
+/** Filtered view: one ranked list, grouped by section so the result keeps context. */
+function renderSearch(query) {
+ const matches = rankPages(query, index.pages, { limit: 400 });
+ const intents = rankIntents(query, index.intents, { limit: 4 });
+
+ $intents.textContent = '';
+ if (intents.length) {
+ for (const { intent } of intents) $intents.appendChild(intentCard(intent));
+ $intentCount.textContent = `${intents.length} matching`;
+ $intentsWrap.hidden = false;
+ } else {
+ $intentsWrap.hidden = true;
+ }
+
+ $body.textContent = '';
+
+ if (!matches.length) {
+ if (!intents.length) {
+ const state = el('div', 'at-state');
+ state.appendChild(el('strong', null, `No page matches "${query}"`));
+ state.appendChild(
+ document.createTextNode('Try a single shorter word. Every page is listed when the box is empty.'),
+ );
+ $body.appendChild(state);
+ }
+ $rail.textContent = '';
+ $live.textContent = intents.length
+ ? `No pages match "${query}", but ${intents.length} task shortcut${intents.length === 1 ? '' : 's'} do.`
+ : `No results for "${query}".`;
+ return;
+ }
+
+ const grouped = new Map();
+ for (const { page } of matches) {
+ if (!grouped.has(page[3])) grouped.set(page[3], []);
+ grouped.get(page[3]).push(page);
+ }
+ renderRail(new Map([...grouped].map(([id, list]) => [id, list.length])));
+
+ // Section order follows the best-ranked hit in each section, so the section
+ // holding the strongest match leads.
+ for (const [id, pages] of grouped) {
+ const section = sectionById(id);
+ const wrap = el('section', 'at-section');
+ wrap.id = `section-${id}`;
+ const head = el('div', 'at-section-head');
+ head.appendChild(el('h2', null, section.title));
+ head.appendChild(el('span', 'at-count', `${pages.length} ${pages.length === 1 ? 'match' : 'matches'}`));
+ wrap.appendChild(head);
+ const grid = el('div', 'at-grid');
+ for (const page of pages) grid.appendChild(pageCard(page, query));
+ wrap.appendChild(grid);
+ $body.appendChild(wrap);
+ }
+
+ $live.textContent = `${matches.length} page${matches.length === 1 ? '' : 's'} match "${query}".`;
+}
+
+function render() {
+ if (!index) return;
+ const query = $q.value.trim();
+ $clear.hidden = query.length === 0;
+ if (query) renderSearch(query);
+ else renderBrowse();
+}
+
+/** Mark the section chip for whatever is on screen. Browse view only. */
+let observer = null;
+function watchSections() {
+ if (observer) observer.disconnect();
+ if (!('IntersectionObserver' in window)) return;
+ const visible = new Set();
+ observer = new IntersectionObserver(
+ (entries) => {
+ for (const entry of entries) {
+ if (entry.isIntersecting) visible.add(entry.target.id);
+ else visible.delete(entry.target.id);
+ }
+ for (const chip of $rail.querySelectorAll('.at-chip')) {
+ const id = chip.getAttribute('href').slice(1);
+ chip.setAttribute('aria-current', visible.has(id) ? 'true' : 'false');
+ }
+ },
+ { rootMargin: '-72px 0px -70% 0px' },
+ );
+ for (const section of $body.querySelectorAll('.at-section')) observer.observe(section);
+}
+
+function syncUrl() {
+ const query = $q.value.trim();
+ const url = new URL(location.href);
+ if (query) url.searchParams.set('q', query);
+ else url.searchParams.delete('q');
+ history.replaceState(null, '', `${url.pathname}${url.search}${url.hash}`);
+}
+
+$q.addEventListener('input', () => {
+ // One render per frame. Ranking 633 pages is sub-millisecond, but a
+ // keystroke-per-render still forces layout on a 600-node list.
+ cancelAnimationFrame(frame);
+ frame = requestAnimationFrame(() => {
+ render();
+ syncUrl();
+ });
+});
+
+$q.addEventListener('keydown', (e) => {
+ if (e.key === 'Escape' && $q.value) {
+ e.preventDefault();
+ $q.value = '';
+ render();
+ syncUrl();
+ }
+});
+
+$clear.addEventListener('click', () => {
+ $q.value = '';
+ $q.focus();
+ render();
+ syncUrl();
+});
+
+fetch(INDEX_URL, { credentials: 'omit' })
+ .then((r) => {
+ if (!r.ok) throw new Error(`atlas index ${r.status}`);
+ return r.json();
+ })
+ .then((data) => {
+ index = data;
+ $q.value = new URL(location.href).searchParams.get('q') || '';
+ render();
+ // Deep link to a section survives the async render.
+ if (location.hash.startsWith('#section-')) {
+ document.getElementById(location.hash.slice(1))?.scrollIntoView({ block: 'start' });
+ }
+ })
+ .catch(() => {
+ $body.textContent = '';
+ const state = el('div', 'at-state');
+ state.appendChild(el('strong', null, 'The map did not load'));
+ state.appendChild(document.createTextNode('The route index is unavailable right now. '));
+ const link = el('a', null, 'The sitemap');
+ link.href = '/sitemap';
+ state.appendChild(link);
+ state.appendChild(document.createTextNode(' lists every page and does not depend on it.'));
+ $body.appendChild(state);
+ $live.textContent = 'The route index failed to load.';
+ });
diff --git a/src/feature-tour/curriculum.js b/src/feature-tour/curriculum.js
index d86520702..1f06737a1 100644
--- a/src/feature-tour/curriculum.js
+++ b/src/feature-tour/curriculum.js
@@ -8,6 +8,22 @@ const CURRICULUM_URL = '/tour/curriculum.json';
const STATE_KEY = 'tws:tour:state'; // live, per-tab tour (sessionStorage)
const RESUME_KEY = 'tws:tour:resume'; // durable cross-session memory (localStorage)
+// The generic anchors TourDirector._resolveTarget() falls back to when a stop
+// has no hand-authored `targets` (only about a fifth of the curriculum does, see
+// scripts/build-tour.mjs → TARGETS). It lives here rather than in director.js so
+// the offline tools can read it without importing the whole 3D engine:
+// scripts/capture-tour-atlas.mjs resolves anchors exactly the way the live tour
+// does, and its report would be fiction if the two lists ever drifted.
+export const TOUR_FALLBACK_SELECTORS = [
+ '[data-tour-target]',
+ 'main h1, .hero h1, h1',
+ 'a.cta, .btn-primary, button[type="submit"], main a.button, .hero a',
+];
+
+// The content root a tour anchor is preferentially resolved inside. See
+// _resolveTarget() for why an unscoped lookup keeps landing on the site nav.
+export const TOUR_CONTENT_ROOT_SELECTOR = 'main, [role="main"], article';
+
let _cache = null;
export async function loadCurriculum() {
diff --git a/src/feature-tour/director.js b/src/feature-tour/director.js
index eb361a9fa..c42aaee2a 100644
--- a/src/feature-tour/director.js
+++ b/src/feature-tour/director.js
@@ -25,6 +25,8 @@ import {
normalizePath,
stopIndexForPath,
sectionTitle,
+ TOUR_FALLBACK_SELECTORS,
+ TOUR_CONTENT_ROOT_SELECTOR,
} from './curriculum.js';
import { GuideAvatar } from './guide-avatar.js';
import { Spotlight } from './spotlight.js';
@@ -682,21 +684,32 @@ export class TourDirector {
}
// ── Target resolution ─────────────────────────────────────────────────────
+ // Curriculum anchors are broad on purpose (`form, .wizard, .step, button`),
+ // because one selector list has to survive across page redesigns. Run
+ // unscoped, though, document order hands them the site chrome: the nav
+ // renders before <main> on every page, so `/` spotlit the nav's "Create an
+ // agent" dropdown link instead of the hero CTA, `/docs` ringed the site nav
+ // instead of the docs sidebar, and `/create-agent` ringed a nav button
+ // instead of the wizard. scripts/capture-tour-atlas.mjs found all three.
+ //
+ // So: try every selector inside the page's main content first, and only fall
+ // back to the whole document when nothing in the content matched. A stop whose
+ // feature genuinely lives in the header (the nav search, the wallet button)
+ // still resolves on the second pass.
_resolveTarget(stop) {
- const selectors = [
- ...(stop.targets || []),
- '[data-tour-target]',
- 'main h1, .hero h1, h1',
- 'a.cta, .btn-primary, button[type="submit"], main a.button, .hero a',
- ];
- for (const sel of selectors) {
- let el;
- try {
- el = document.querySelector(sel);
- } catch {
- continue;
+ const selectors = [...(stop.targets || []), ...TOUR_FALLBACK_SELECTORS];
+ const main = document.querySelector(TOUR_CONTENT_ROOT_SELECTOR);
+ const scopes = main ? [main, document] : [document];
+ for (const scope of scopes) {
+ for (const sel of selectors) {
+ let el;
+ try {
+ el = scope.querySelector(sel);
+ } catch {
+ continue;
+ }
+ if (isVisible(el)) return el;
}
- if (isVisible(el)) return el;
}
return null;
}
diff --git a/src/flow-map-core.js b/src/flow-map-core.js
new file mode 100644
index 000000000..7e4cc5a8c
--- /dev/null
+++ b/src/flow-map-core.js
@@ -0,0 +1,322 @@
+// flow-map-core: the math behind /flow, with no DOM, no fetch and no globals.
+//
+// Two jobs, deliberately kept apart from rendering so both are testable:
+//
+// 1. READING the graph. A leaderboard cannot tell you the shape of a flow, and
+// the shape is the diagnosis. An agent that earns steadily and never spends
+// again is indistinguishable from a healthy one on any "top earners" list,
+// yet it is the exact signature of capital dispersion: money entering the
+// fleet and never circulating back out. classifyRole() names that, and
+// dispersion() puts a number on how much of the economy is stuck in it.
+//
+// 2. PLACING the graph. A deterministic force simulation, seeded so the same
+// payload always lays out the same way. That matters more than it sounds:
+// an operator comparing two windows should see the topology move, not the
+// layout reshuffle underneath them.
+
+// ── roles ────────────────────────────────────────────────────────────────────
+// A node's role is decided by how lopsided its flow is, not by how big it is.
+// The thresholds are intentionally wide: 85/15 keeps a node out of the extreme
+// buckets unless it is genuinely one-directional, so "sink" stays a real signal
+// rather than a label half the graph wears.
+export const SOURCE_RATIO = 0.85;
+export const SINK_RATIO = 0.15;
+// A hub is defined by how many DISTINCT partners it trades with, not by volume:
+// one agent paying another a hundred times is a strong edge, not a hub.
+export const HUB_PARTNERS = 4;
+
+export const ROLES = {
+ source: { id: 'source', label: 'Source', hint: 'Pays out far more than it earns. Where money enters the loop.' },
+ sink: { id: 'sink', label: 'Sink', hint: 'Earns and does not spend again. Capital stops circulating here.' },
+ hub: { id: 'hub', label: 'Hub', hint: 'Trades both ways with many partners. The load-bearing middle of the economy.' },
+ relay: { id: 'relay', label: 'Relay', hint: 'Earns and spends, on a small number of routes.' },
+ quiet: { id: 'quiet', label: 'Quiet', hint: 'No settled value moved in this window.' },
+};
+
+/** Total value a node handled in the window, in USD. */
+export const throughput = (n) => Number(n?.in_usd || 0) + Number(n?.out_usd || 0);
+
+/** Earned minus spent. Positive means the node accumulated. */
+export const netUsd = (n) => Number(n?.in_usd || 0) - Number(n?.out_usd || 0);
+
+/** How many distinct counterparties a node touched, in either direction. */
+export const partners = (n) => Number(n?.partners_in || 0) + Number(n?.partners_out || 0);
+
+/**
+ * Name what a node does in the economy. Order matters: `quiet` must win first,
+ * because a node with zero flow has an undefined ratio and would otherwise be
+ * reported as a sink (0/0 reads as "earns and never spends", which is wrong: it
+ * did nothing at all).
+ */
+export function classifyRole(node) {
+ const total = throughput(node);
+ if (total <= 0) return ROLES.quiet;
+ const outShare = Number(node.out_usd || 0) / total;
+ if (outShare >= SOURCE_RATIO) return ROLES.source;
+ if (outShare <= SINK_RATIO) return ROLES.sink;
+ return partners(node) >= HUB_PARTNERS ? ROLES.hub : ROLES.relay;
+}
+
+/**
+ * Share of all settled value that ended up in sinks. This is the single number
+ * that says whether the loop is closed: a healthy circular economy trends
+ * toward zero, and a fleet quietly draining its treasury into agent wallets
+ * trends toward one.
+ */
+export function dispersion(graph) {
+ const nodes = graph?.nodes || [];
+ const totalIn = nodes.reduce((s, n) => s + Number(n.in_usd || 0), 0);
+ if (totalIn <= 0) return 0;
+ const stuck = nodes
+ .filter((n) => classifyRole(n).id === 'sink')
+ .reduce((s, n) => s + netUsd(n), 0);
+ return Math.max(0, Math.min(1, stuck / totalIn));
+}
+
+/**
+ * Decorate every node with its derived reading once, so renderers and the
+ * accessible table agree by construction instead of by convention.
+ */
+export function annotate(graph) {
+ const nodes = (graph?.nodes || []).map((n) => ({
+ ...n,
+ role: classifyRole(n).id,
+ net_usd: netUsd(n),
+ throughput_usd: throughput(n),
+ partners: partners(n),
+ }));
+ return { ...graph, nodes };
+}
+
+/** The nodes holding the most stuck capital, worst first. */
+export function rankSinks(graph, limit = 5) {
+ return (graph?.nodes || [])
+ .filter((n) => classifyRole(n).id === 'sink')
+ .map((n) => ({ ...n, net_usd: netUsd(n) }))
+ .sort((a, b) => b.net_usd - a.net_usd)
+ .slice(0, limit);
+}
+
+/** The busiest two-way nodes, by distinct partners then value. */
+export function rankHubs(graph, limit = 5) {
+ return (graph?.nodes || [])
+ .filter((n) => classifyRole(n).id === 'hub')
+ .map((n) => ({ ...n, throughput_usd: throughput(n), partners: partners(n) }))
+ .sort((a, b) => b.partners - a.partners || b.throughput_usd - a.throughput_usd)
+ .slice(0, limit);
+}
+
+/**
+ * Narrow the graph without ever leaving a dangling edge. Edges are filtered
+ * first and the node set is then rebuilt from the survivors, so a filtered view
+ * can never reference a node that is no longer drawn.
+ */
+export function filterGraph(graph, { kind = 'all', query = '' } = {}) {
+ const nodes = graph?.nodes || [];
+ const edges = graph?.edges || [];
+ const q = String(query || '').trim().toLowerCase();
+
+ const byId = new Map(nodes.map((n) => [n.id, n]));
+ const matches = (node) =>
+ !q ||
+ String(node?.name || '').toLowerCase().includes(q) ||
+ String(node?.address || '').toLowerCase().includes(q);
+
+ const keptEdges = edges.filter((e) => {
+ if (kind !== 'all' && !(e.kinds || []).includes(kind)) return false;
+ if (!q) return true;
+ // A search keeps the matched node's whole neighbourhood, because an edge
+ // with one end hidden would be a line into nowhere.
+ return matches(byId.get(e.from)) || matches(byId.get(e.to));
+ });
+
+ const live = new Set(keptEdges.flatMap((e) => [e.from, e.to]));
+ return { ...graph, nodes: nodes.filter((n) => live.has(n.id)), edges: keptEdges };
+}
+
+/** Per-node totals recomputed from a filtered edge set, so panels stay truthful. */
+export function recomputeTotals(graph) {
+ const blank = () => ({ in_usd: 0, out_usd: 0, in_sol: 0, out_sol: 0, in_count: 0, out_count: 0, partners_in: 0, partners_out: 0 });
+ const acc = new Map((graph?.nodes || []).map((n) => [n.id, blank()]));
+ for (const e of graph?.edges || []) {
+ const from = acc.get(e.from);
+ const to = acc.get(e.to);
+ if (from) { from.out_usd += e.usd || 0; from.out_sol += e.sol || 0; from.out_count += e.count || 0; from.partners_out += 1; }
+ if (to) { to.in_usd += e.usd || 0; to.in_sol += e.sol || 0; to.in_count += e.count || 0; to.partners_in += 1; }
+ }
+ return { ...graph, nodes: (graph?.nodes || []).map((n) => ({ ...n, ...acc.get(n.id) })) };
+}
+
+// ── formatting ───────────────────────────────────────────────────────────────
+// Dust is real money at this scale, so it is never rounded away to a bare "$0".
+export function fmtUsd(n) {
+ const v = Number(n || 0);
+ if (v === 0) return '$0';
+ if (Math.abs(v) < 0.01) return v < 0 ? '>-$0.01' : '<$0.01';
+ if (Math.abs(v) >= 1000) return `${v < 0 ? '-' : ''}$${Math.abs(v).toLocaleString('en-US', { maximumFractionDigits: 0 })}`;
+ return `${v < 0 ? '-' : ''}$${Math.abs(v).toFixed(2)}`;
+}
+
+export function fmtSol(n) {
+ const v = Number(n || 0);
+ if (v === 0) return '0';
+ if (Math.abs(v) < 0.001) return v.toFixed(6).replace(/0+$/, '').replace(/\.$/, '');
+ return v.toFixed(Math.abs(v) < 1 ? 4 : 3).replace(/0+$/, '').replace(/\.$/, '');
+}
+
+export function fmtPct(n) {
+ const v = Number(n || 0) * 100;
+ if (v > 0 && v < 1) return '<1%';
+ return `${Math.round(v)}%`;
+}
+
+export function relTime(iso, now = Date.now()) {
+ const t = new Date(iso).getTime();
+ if (!Number.isFinite(t)) return '';
+ const s = Math.max(0, Math.round((now - t) / 1000));
+ if (s < 60) return `${s}s ago`;
+ if (s < 3600) return `${Math.round(s / 60)}m ago`;
+ if (s < 86400) return `${Math.round(s / 3600)}h ago`;
+ return `${Math.round(s / 86400)}d ago`;
+}
+
+// ── layout ───────────────────────────────────────────────────────────────────
+
+/** mulberry32: a small, fast, fully deterministic PRNG. Same seed, same graph. */
+export function seededRandom(seed) {
+ let a = seed >>> 0;
+ return function next() {
+ a |= 0; a = (a + 0x6d2b79f5) | 0;
+ let t = Math.imul(a ^ (a >>> 15), 1 | a);
+ t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
+ };
+}
+
+/** A node's drawn radius, from its share of value. Area, not radius, tracks
+ * volume, so a node ten times richer does not become a hundred times the ink. */
+export function nodeRadius(node, maxThroughput, { min = 9, max = 30 } = {}) {
+ const t = throughput(node);
+ if (!(maxThroughput > 0) || t <= 0) return min;
+ return min + (max - min) * Math.sqrt(t / maxThroughput);
+}
+
+/**
+ * A force-directed layout that is a pure function of (nodes, edges, seed).
+ *
+ * Deliberately O(n²) on repulsion: the edge cap upstream keeps this to a couple
+ * of hundred nodes, where the exact all-pairs pass is both faster than building
+ * a quadtree and free of its approximation artefacts.
+ */
+export function createLayout(graph, opts = {}) {
+ const {
+ width = 900, height = 600, seed = 1337,
+ repulsion = 5200, spring = 0.0016, springLength = 130,
+ gravity = 0.012, damping = 0.86, maxVelocity = 24,
+ } = opts;
+
+ const rand = seededRandom(seed);
+ const cx = width / 2;
+ const cy = height / 2;
+
+ // Seed on a golden-angle spiral rather than at random: it starts the system
+ // already spread out, so it settles in far fewer steps and never begins with
+ // every node stacked on one pixel (which makes repulsion explode).
+ const nodes = (graph?.nodes || []).map((n, i) => {
+ const angle = i * 2.399963229728653;
+ const radius = Math.sqrt(i + 1) * Math.min(width, height) * 0.045;
+ return {
+ id: n.id,
+ x: cx + Math.cos(angle) * radius + (rand() - 0.5) * 8,
+ y: cy + Math.sin(angle) * radius + (rand() - 0.5) * 8,
+ vx: 0, vy: 0,
+ mass: 1 + Math.log10(1 + throughput(n)),
+ };
+ });
+ const index = new Map(nodes.map((n, i) => [n.id, i]));
+ const links = (graph?.edges || [])
+ .map((e) => ({ a: index.get(e.from), b: index.get(e.to), w: Math.max(1, Number(e.count) || 1) }))
+ .filter((l) => l.a != null && l.b != null && l.a !== l.b);
+
+ function step() {
+ for (let i = 0; i < nodes.length; i += 1) {
+ const a = nodes[i];
+ for (let j = i + 1; j < nodes.length; j += 1) {
+ const b = nodes[j];
+ let dx = a.x - b.x;
+ let dy = a.y - b.y;
+ let d2 = dx * dx + dy * dy;
+ if (d2 < 0.01) { dx = (rand() - 0.5) * 0.2; dy = (rand() - 0.5) * 0.2; d2 = 0.01; }
+ const force = repulsion / d2;
+ const d = Math.sqrt(d2);
+ const fx = (dx / d) * force;
+ const fy = (dy / d) * force;
+ a.vx += fx / a.mass; a.vy += fy / a.mass;
+ b.vx -= fx / b.mass; b.vy -= fy / b.mass;
+ }
+ }
+ for (const l of links) {
+ const a = nodes[l.a];
+ const b = nodes[l.b];
+ const dx = b.x - a.x;
+ const dy = b.y - a.y;
+ const d = Math.max(1, Math.hypot(dx, dy));
+ // Heavier routes pull harder, but only logarithmically, so a single
+ // very chatty pair cannot collapse the rest of the graph onto itself.
+ const k = spring * Math.log2(1 + l.w);
+ const f = (d - springLength) * k;
+ const fx = (dx / d) * f;
+ const fy = (dy / d) * f;
+ a.vx += fx; a.vy += fy;
+ b.vx -= fx; b.vy -= fy;
+ }
+ let motion = 0;
+ for (const n of nodes) {
+ n.vx = (n.vx + (cx - n.x) * gravity) * damping;
+ n.vy = (n.vy + (cy - n.y) * gravity) * damping;
+ const v = Math.hypot(n.vx, n.vy);
+ if (v > maxVelocity) { n.vx = (n.vx / v) * maxVelocity; n.vy = (n.vy / v) * maxVelocity; }
+ n.x += n.vx; n.y += n.vy;
+ motion += Math.abs(n.vx) + Math.abs(n.vy);
+ }
+ return nodes.length ? motion / nodes.length : 0;
+ }
+
+ /** Run until the average per-node motion falls below `epsilon`, or `max` steps. */
+ function settle(max = 300, epsilon = 0.05) {
+ let steps = 0;
+ for (; steps < max; steps += 1) if (step() < epsilon) { steps += 1; break; }
+ return steps;
+ }
+
+ const positions = () => new Map(nodes.map((n) => [n.id, { x: n.x, y: n.y }]));
+ const bounds = () => {
+ if (!nodes.length) return { minX: 0, minY: 0, maxX: width, maxY: height };
+ let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
+ for (const n of nodes) {
+ if (n.x < minX) minX = n.x;
+ if (n.y < minY) minY = n.y;
+ if (n.x > maxX) maxX = n.x;
+ if (n.y > maxY) maxY = n.y;
+ }
+ return { minX, minY, maxX, maxY };
+ };
+
+ return { nodes, links, step, settle, positions, bounds };
+}
+
+/**
+ * Fit a settled layout into a viewport with padding. Returned separately from
+ * the simulation so panning and zooming never have to re-run the physics.
+ */
+export function fitTransform(bounds, width, height, padding = 48) {
+ const w = Math.max(1, bounds.maxX - bounds.minX);
+ const h = Math.max(1, bounds.maxY - bounds.minY);
+ const scale = Math.min((width - padding * 2) / w, (height - padding * 2) / h, 2.2);
+ const s = Number.isFinite(scale) && scale > 0 ? scale : 1;
+ return {
+ scale: s,
+ x: width / 2 - ((bounds.minX + bounds.maxX) / 2) * s,
+ y: height / 2 - ((bounds.minY + bounds.maxY) / 2) * s,
+ };
+}
diff --git a/src/flow-map.css b/src/flow-map.css
new file mode 100644
index 000000000..a7f2c4d1b
--- /dev/null
+++ b/src/flow-map.css
@@ -0,0 +1,986 @@
+/* /flow: the agent money-flow map.
+
+ A public surface, so it uses the site's own accent rather than the violet ops
+ token language of /admin/*. The canvas draws itself; everything here is the
+ chrome around it, and every colour that carries meaning (role, direction) is
+ also carried by text or shape, never by hue alone. */
+
+:root {
+ --fm-bg: #06070c;
+ --fm-panel: rgba(255, 255, 255, 0.038);
+ --fm-panel-2: rgba(255, 255, 255, 0.06);
+ --fm-line: rgba(255, 255, 255, 0.09);
+ --fm-line-2: rgba(255, 255, 255, 0.16);
+ --fm-text: #eef1f7;
+ --fm-dim: rgba(238, 241, 247, 0.58);
+ --fm-faint: rgba(238, 241, 247, 0.36);
+ --fm-accent: #22d3ee;
+ --fm-accent-2: #818cf8;
+ --fm-source: #34d399;
+ --fm-sink: #fbbf24;
+ --fm-hub: #60a5fa;
+ --fm-relay: #a78bfa;
+ --fm-quiet: rgba(238, 241, 247, 0.3);
+ --fm-radius: 16px;
+ --fm-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.85);
+ --fm-ease: cubic-bezier(0.22, 1, 0.36, 1);
+ --fm-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Roboto Mono', monospace;
+ --fm-canvas-ink: 255, 255, 255;
+}
+
+:root[data-theme='light'] {
+ --fm-bg: #f5f7fc;
+ --fm-panel: rgba(10, 12, 24, 0.028);
+ --fm-panel-2: rgba(10, 12, 24, 0.05);
+ --fm-line: rgba(10, 12, 24, 0.1);
+ --fm-line-2: rgba(10, 12, 24, 0.18);
+ --fm-text: #13151e;
+ --fm-dim: rgba(19, 21, 30, 0.64);
+ --fm-faint: rgba(19, 21, 30, 0.42);
+ --fm-accent: #0891b2;
+ --fm-accent-2: #4f46e5;
+ --fm-source: #059669;
+ --fm-sink: #b45309;
+ --fm-hub: #2563eb;
+ --fm-relay: #7c3aed;
+ --fm-quiet: rgba(19, 21, 30, 0.32);
+ --fm-shadow: 0 20px 50px -32px rgba(20, 22, 40, 0.4);
+ --fm-canvas-ink: 19, 21, 30;
+}
+
+body {
+ background: var(--fm-bg);
+ color: var(--fm-text);
+}
+
+.fm-wrap,
+.fm-wrap * {
+ box-sizing: border-box;
+}
+
+.fm-wrap {
+ max-width: 1320px;
+ margin: 0 auto;
+ padding: 26px 20px 80px;
+ font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
+ color: var(--fm-text);
+}
+
+/* ── hero ──────────────────────────────────────────────────────────────── */
+
+.fm-hero {
+ margin-bottom: 20px;
+}
+
+.fm-kicker {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ margin: 0 0 10px;
+ font-size: 12px;
+ font-weight: 600;
+ letter-spacing: 0.1em;
+ text-transform: uppercase;
+ color: var(--fm-accent);
+}
+
+.fm-dot {
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ background: var(--fm-accent);
+ box-shadow: 0 0 0 0 currentColor;
+ animation: fm-ping 2.4s var(--fm-ease) infinite;
+}
+
+@keyframes fm-ping {
+ 0% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5); }
+ 70% { box-shadow: 0 0 0 9px rgba(34, 211, 238, 0); }
+ 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
+}
+
+.fm-title {
+ margin: 0 0 8px;
+ font-size: clamp(28px, 4.6vw, 44px);
+ line-height: 1.08;
+ letter-spacing: -0.025em;
+ font-weight: 700;
+}
+
+.fm-title em {
+ font-style: normal;
+ background: linear-gradient(100deg, var(--fm-accent), var(--fm-accent-2));
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+}
+
+.fm-sub {
+ margin: 0;
+ max-width: 74ch;
+ color: var(--fm-dim);
+ font-size: 15.5px;
+}
+
+/* ── controls ──────────────────────────────────────────────────────────── */
+
+.fm-controls {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: 10px;
+ margin: 18px 0 14px;
+}
+
+.fm-seg {
+ display: inline-flex;
+ padding: 3px;
+ gap: 2px;
+ background: var(--fm-panel);
+ border: 1px solid var(--fm-line);
+ border-radius: 11px;
+}
+
+.fm-seg button {
+ appearance: none;
+ border: 0;
+ background: transparent;
+ color: var(--fm-dim);
+ font: inherit;
+ font-size: 13px;
+ font-weight: 600;
+ padding: 6px 12px;
+ border-radius: 8px;
+ cursor: pointer;
+ transition: background 0.18s var(--fm-ease), color 0.18s var(--fm-ease);
+}
+
+.fm-seg button:hover {
+ color: var(--fm-text);
+ background: var(--fm-panel-2);
+}
+
+.fm-seg button[aria-pressed='true'] {
+ background: var(--fm-text);
+ color: var(--fm-bg);
+}
+
+.fm-search {
+ position: relative;
+ flex: 1 1 200px;
+ max-width: 300px;
+}
+
+.fm-search input {
+ width: 100%;
+ padding: 9px 32px 9px 12px;
+ background: var(--fm-panel);
+ border: 1px solid var(--fm-line);
+ border-radius: 11px;
+ color: var(--fm-text);
+ font: inherit;
+ font-size: 13.5px;
+ transition: border-color 0.18s var(--fm-ease), background 0.18s var(--fm-ease);
+}
+
+.fm-search input::placeholder {
+ color: var(--fm-faint);
+}
+
+.fm-search input:focus {
+ outline: none;
+ border-color: var(--fm-accent);
+ background: var(--fm-panel-2);
+}
+
+.fm-search-clear {
+ position: absolute;
+ right: 5px;
+ top: 50%;
+ transform: translateY(-50%);
+ appearance: none;
+ border: 0;
+ background: transparent;
+ color: var(--fm-faint);
+ font-size: 17px;
+ line-height: 1;
+ padding: 4px 6px;
+ border-radius: 7px;
+ cursor: pointer;
+}
+
+.fm-search-clear:hover {
+ color: var(--fm-text);
+ background: var(--fm-panel-2);
+}
+
+.fm-btn {
+ appearance: none;
+ padding: 8px 13px;
+ background: var(--fm-panel);
+ border: 1px solid var(--fm-line);
+ border-radius: 11px;
+ color: var(--fm-text);
+ font: inherit;
+ font-size: 13px;
+ font-weight: 600;
+ cursor: pointer;
+ transition: border-color 0.18s var(--fm-ease), background 0.18s var(--fm-ease), transform 0.12s var(--fm-ease);
+}
+
+.fm-btn:hover {
+ border-color: var(--fm-line-2);
+ background: var(--fm-panel-2);
+}
+
+.fm-btn:active {
+ transform: translateY(1px);
+}
+
+.fm-btn[aria-pressed='true'] {
+ border-color: var(--fm-accent);
+ color: var(--fm-accent);
+}
+
+.fm-stamp {
+ margin-left: auto;
+ font-size: 12px;
+ color: var(--fm-faint);
+ font-variant-numeric: tabular-nums;
+}
+
+/* Focus rings, once, for every interactive thing on the page. */
+.fm-wrap :is(button, input, a, [tabindex]):focus-visible {
+ outline: 2px solid var(--fm-accent);
+ outline-offset: 2px;
+ border-radius: 8px;
+}
+
+/* ── headline stats ────────────────────────────────────────────────────── */
+
+.fm-stats {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
+ gap: 10px;
+ margin: 0 0 16px;
+}
+
+.fm-stat {
+ padding: 13px 15px;
+ background: var(--fm-panel);
+ border: 1px solid var(--fm-line);
+ border-radius: 13px;
+}
+
+.fm-stat dt {
+ margin: 0 0 5px;
+ font-size: 11px;
+ font-weight: 600;
+ letter-spacing: 0.07em;
+ text-transform: uppercase;
+ color: var(--fm-faint);
+}
+
+.fm-stat dd {
+ margin: 0;
+ font-size: 22px;
+ font-weight: 700;
+ letter-spacing: -0.02em;
+ font-variant-numeric: tabular-nums;
+}
+
+.fm-stat-sub {
+ display: block;
+ margin-top: 3px;
+ font-size: 11.5px;
+ color: var(--fm-dim);
+}
+
+.fm-stat--flag {
+ border-color: color-mix(in srgb, var(--fm-sink) 45%, transparent);
+ background: color-mix(in srgb, var(--fm-sink) 8%, var(--fm-panel));
+}
+
+/* ── stage: canvas + detail rail ───────────────────────────────────────── */
+
+.fm-stage {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) 312px;
+ gap: 14px;
+ align-items: start;
+}
+
+.fm-canvas-shell {
+ position: relative;
+ border: 1px solid var(--fm-line);
+ border-radius: var(--fm-radius);
+ background:
+ radial-gradient(120% 90% at 50% 0%, rgba(34, 211, 238, 0.06), transparent 60%),
+ var(--fm-panel);
+ box-shadow: var(--fm-shadow);
+ overflow: hidden;
+ min-height: 460px;
+}
+
+.fm-canvas {
+ display: block;
+ width: 100%;
+ height: 620px;
+ touch-action: none;
+ cursor: grab;
+}
+
+.fm-canvas.is-dragging {
+ cursor: grabbing;
+}
+
+.fm-canvas.is-hot {
+ cursor: pointer;
+}
+
+/* Overlays that sit on the canvas: state messages, legend, zoom. */
+.fm-overlay {
+ position: absolute;
+ inset: 0;
+ display: grid;
+ place-content: center;
+ gap: 10px;
+ justify-items: center;
+ text-align: center;
+ padding: 32px;
+ background: color-mix(in srgb, var(--fm-bg) 78%, transparent);
+ backdrop-filter: blur(3px);
+ z-index: 3;
+}
+
+.fm-overlay[hidden] {
+ display: none;
+}
+
+.fm-overlay h2 {
+ margin: 0;
+ font-size: 18px;
+ font-weight: 700;
+}
+
+.fm-overlay p {
+ margin: 0;
+ max-width: 46ch;
+ color: var(--fm-dim);
+ font-size: 14px;
+}
+
+.fm-spinner {
+ width: 30px;
+ height: 30px;
+ border-radius: 50%;
+ border: 2.5px solid var(--fm-line-2);
+ border-top-color: var(--fm-accent);
+ animation: fm-spin 0.75s linear infinite;
+}
+
+@keyframes fm-spin {
+ to { transform: rotate(360deg); }
+}
+
+/* Skeleton nodes: shows the shape of what is coming, not a bare spinner. */
+.fm-skeleton {
+ position: absolute;
+ inset: 0;
+ z-index: 2;
+ overflow: hidden;
+}
+
+.fm-skeleton span {
+ position: absolute;
+ border-radius: 50%;
+ background: linear-gradient(100deg, var(--fm-panel-2) 20%, var(--fm-line) 50%, var(--fm-panel-2) 80%);
+ background-size: 220% 100%;
+ animation: fm-shimmer 1.5s var(--fm-ease) infinite;
+}
+
+@keyframes fm-shimmer {
+ to { background-position: -220% 0; }
+}
+
+.fm-zoom {
+ position: absolute;
+ right: 12px;
+ bottom: 12px;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ z-index: 4;
+}
+
+.fm-zoom button {
+ width: 32px;
+ height: 32px;
+ display: grid;
+ place-items: center;
+ appearance: none;
+ background: color-mix(in srgb, var(--fm-bg) 82%, transparent);
+ border: 1px solid var(--fm-line);
+ border-radius: 9px;
+ color: var(--fm-text);
+ font: 600 16px/1 var(--fm-mono);
+ cursor: pointer;
+ backdrop-filter: blur(6px);
+ transition: background 0.16s var(--fm-ease), border-color 0.16s var(--fm-ease);
+}
+
+.fm-zoom button:hover {
+ border-color: var(--fm-line-2);
+ background: var(--fm-panel-2);
+}
+
+.fm-legend {
+ position: absolute;
+ left: 12px;
+ bottom: 12px;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 4px;
+ max-width: calc(100% - 90px);
+ z-index: 4;
+}
+
+.fm-legend button {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ padding: 5px 9px;
+ appearance: none;
+ background: color-mix(in srgb, var(--fm-bg) 82%, transparent);
+ border: 1px solid var(--fm-line);
+ border-radius: 999px;
+ color: var(--fm-dim);
+ font: 600 11.5px/1 inherit;
+ cursor: pointer;
+ backdrop-filter: blur(6px);
+ transition: color 0.16s var(--fm-ease), border-color 0.16s var(--fm-ease), opacity 0.16s var(--fm-ease);
+}
+
+.fm-legend button:hover {
+ color: var(--fm-text);
+ border-color: var(--fm-line-2);
+}
+
+.fm-legend button[aria-pressed='false'] {
+ opacity: 0.42;
+}
+
+.fm-legend i {
+ width: 9px;
+ height: 9px;
+ border-radius: 50%;
+ background: currentColor;
+}
+
+.fm-legend .role-source { color: var(--fm-source); }
+.fm-legend .role-sink { color: var(--fm-sink); }
+.fm-legend .role-hub { color: var(--fm-hub); }
+.fm-legend .role-relay { color: var(--fm-relay); }
+.fm-legend .role-quiet { color: var(--fm-quiet); }
+
+/* Hover tooltip, positioned in JS. */
+.fm-tip {
+ position: absolute;
+ z-index: 6;
+ pointer-events: none;
+ max-width: 260px;
+ padding: 9px 11px;
+ background: color-mix(in srgb, var(--fm-bg) 94%, transparent);
+ border: 1px solid var(--fm-line-2);
+ border-radius: 11px;
+ box-shadow: var(--fm-shadow);
+ font-size: 12.5px;
+ line-height: 1.45;
+ backdrop-filter: blur(8px);
+ opacity: 0;
+ transform: translateY(4px);
+ transition: opacity 0.14s var(--fm-ease), transform 0.14s var(--fm-ease);
+}
+
+.fm-tip.is-on {
+ opacity: 1;
+ transform: translateY(0);
+}
+
+.fm-tip b {
+ display: block;
+ margin-bottom: 3px;
+ font-size: 13px;
+}
+
+.fm-tip span {
+ color: var(--fm-dim);
+}
+
+/* ── detail rail ───────────────────────────────────────────────────────── */
+
+.fm-rail {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+ position: sticky;
+ top: 14px;
+}
+
+.fm-card {
+ padding: 15px;
+ background: var(--fm-panel);
+ border: 1px solid var(--fm-line);
+ border-radius: var(--fm-radius);
+}
+
+.fm-card h2 {
+ margin: 0 0 4px;
+ font-size: 12px;
+ font-weight: 700;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--fm-faint);
+}
+
+.fm-card p {
+ margin: 0;
+ font-size: 13px;
+ color: var(--fm-dim);
+}
+
+.fm-detail-head {
+ display: flex;
+ align-items: center;
+ gap: 11px;
+ margin: 10px 0 12px;
+}
+
+.fm-avatar {
+ width: 44px;
+ height: 44px;
+ flex: none;
+ border-radius: 12px;
+ object-fit: cover;
+ background: var(--fm-panel-2);
+ border: 1px solid var(--fm-line);
+}
+
+.fm-avatar--fallback {
+ display: grid;
+ place-items: center;
+ font: 700 15px/1 var(--fm-mono);
+ color: var(--fm-faint);
+}
+
+.fm-detail-name {
+ min-width: 0;
+ flex: 1;
+}
+
+.fm-detail-name b {
+ display: block;
+ font-size: 15.5px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.fm-detail-name code {
+ font: 11.5px/1.4 var(--fm-mono);
+ color: var(--fm-faint);
+}
+
+.fm-role {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ padding: 3px 8px;
+ border-radius: 999px;
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+ border: 1px solid currentColor;
+}
+
+.fm-role::before {
+ content: '';
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background: currentColor;
+}
+
+.fm-role[data-role='source'] { color: var(--fm-source); }
+.fm-role[data-role='sink'] { color: var(--fm-sink); }
+.fm-role[data-role='hub'] { color: var(--fm-hub); }
+.fm-role[data-role='relay'] { color: var(--fm-relay); }
+.fm-role[data-role='quiet'] { color: var(--fm-quiet); }
+
+.fm-kv {
+ display: grid;
+ grid-template-columns: 1fr auto;
+ gap: 5px 10px;
+ margin: 0 0 12px;
+ font-size: 13px;
+}
+
+.fm-kv dt {
+ color: var(--fm-dim);
+}
+
+.fm-kv dd {
+ margin: 0;
+ text-align: right;
+ font-variant-numeric: tabular-nums;
+ font-weight: 600;
+}
+
+.fm-kv dd.pos { color: var(--fm-source); }
+.fm-kv dd.neg { color: var(--fm-sink); }
+
+/* Inbound/outbound split bar: direction readable without reading numbers. */
+.fm-split {
+ display: flex;
+ height: 7px;
+ margin: 0 0 12px;
+ border-radius: 999px;
+ overflow: hidden;
+ background: var(--fm-panel-2);
+}
+
+.fm-split i {
+ display: block;
+ transition: width 0.4s var(--fm-ease);
+}
+
+.fm-split .in { background: var(--fm-sink); }
+.fm-split .out { background: var(--fm-source); }
+
+.fm-chips {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 5px;
+ margin: 0 0 12px;
+}
+
+.fm-chip {
+ padding: 3px 8px;
+ background: var(--fm-panel-2);
+ border: 1px solid var(--fm-line);
+ border-radius: 999px;
+ font-size: 11.5px;
+ color: var(--fm-dim);
+}
+
+.fm-links {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 7px;
+}
+
+.fm-links a {
+ display: inline-flex;
+ align-items: center;
+ gap: 5px;
+ padding: 7px 11px;
+ background: var(--fm-panel-2);
+ border: 1px solid var(--fm-line);
+ border-radius: 10px;
+ color: var(--fm-text);
+ font-size: 12.5px;
+ font-weight: 600;
+ text-decoration: none;
+ transition: border-color 0.16s var(--fm-ease), transform 0.14s var(--fm-ease);
+}
+
+.fm-links a:hover {
+ border-color: var(--fm-accent);
+ transform: translateY(-1px);
+}
+
+.fm-peers {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+}
+
+.fm-peer {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ width: 100%;
+ padding: 7px 8px;
+ appearance: none;
+ background: transparent;
+ border: 0;
+ border-radius: 9px;
+ color: inherit;
+ font: inherit;
+ font-size: 13px;
+ text-align: left;
+ cursor: pointer;
+ transition: background 0.14s var(--fm-ease);
+}
+
+.fm-peer:hover {
+ background: var(--fm-panel-2);
+}
+
+.fm-peer-dir {
+ flex: none;
+ width: 15px;
+ font: 700 13px/1 var(--fm-mono);
+}
+
+.fm-peer-dir.out { color: var(--fm-source); }
+.fm-peer-dir.in { color: var(--fm-sink); }
+
+.fm-peer-name {
+ flex: 1;
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.fm-peer-amt {
+ flex: none;
+ font-variant-numeric: tabular-nums;
+ font-weight: 600;
+ color: var(--fm-dim);
+}
+
+.fm-empty-rail {
+ display: grid;
+ gap: 8px;
+ justify-items: center;
+ text-align: center;
+ padding: 22px 12px;
+ color: var(--fm-dim);
+ font-size: 13px;
+}
+
+.fm-empty-rail svg {
+ opacity: 0.4;
+}
+
+/* ── services + table ──────────────────────────────────────────────────── */
+
+.fm-below {
+ margin-top: 22px;
+ display: grid;
+ gap: 18px;
+}
+
+.fm-section-head {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: baseline;
+ gap: 10px;
+ margin: 0 0 10px;
+}
+
+.fm-section-head h2 {
+ margin: 0;
+ font-size: 19px;
+ font-weight: 700;
+ letter-spacing: -0.015em;
+}
+
+.fm-section-head p {
+ margin: 0;
+ flex: 1 1 260px;
+ color: var(--fm-dim);
+ font-size: 13.5px;
+}
+
+.fm-services {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
+ gap: 8px;
+}
+
+.fm-service {
+ padding: 11px 13px;
+ background: var(--fm-panel);
+ border: 1px solid var(--fm-line);
+ border-radius: 12px;
+}
+
+.fm-service b {
+ display: block;
+ font-size: 13.5px;
+ font-family: var(--fm-mono);
+}
+
+.fm-service span {
+ display: block;
+ margin-top: 3px;
+ font-size: 12px;
+ color: var(--fm-dim);
+ font-variant-numeric: tabular-nums;
+}
+
+.fm-service-bar {
+ margin-top: 7px;
+ height: 4px;
+ border-radius: 999px;
+ background: var(--fm-panel-2);
+ overflow: hidden;
+}
+
+.fm-service-bar i {
+ display: block;
+ height: 100%;
+ border-radius: 999px;
+ background: linear-gradient(90deg, var(--fm-accent), var(--fm-accent-2));
+ transition: width 0.5s var(--fm-ease);
+}
+
+.fm-table-shell {
+ border: 1px solid var(--fm-line);
+ border-radius: var(--fm-radius);
+ overflow-x: auto;
+ background: var(--fm-panel);
+}
+
+.fm-table {
+ width: 100%;
+ min-width: 660px;
+ border-collapse: collapse;
+ font-size: 13.5px;
+}
+
+.fm-table caption {
+ padding: 12px 15px;
+ text-align: left;
+ color: var(--fm-dim);
+ font-size: 13px;
+}
+
+.fm-table th,
+.fm-table td {
+ padding: 9px 15px;
+ text-align: left;
+ border-top: 1px solid var(--fm-line);
+ white-space: nowrap;
+}
+
+.fm-table th {
+ font-size: 11px;
+ font-weight: 700;
+ letter-spacing: 0.07em;
+ text-transform: uppercase;
+ color: var(--fm-faint);
+}
+
+.fm-table td.num {
+ text-align: right;
+ font-variant-numeric: tabular-nums;
+}
+
+.fm-table tbody tr {
+ cursor: pointer;
+ transition: background 0.14s var(--fm-ease);
+}
+
+.fm-table tbody tr:hover,
+.fm-table tbody tr:focus-within {
+ background: var(--fm-panel-2);
+}
+
+.fm-table a {
+ color: inherit;
+ text-decoration: none;
+ border-bottom: 1px solid var(--fm-line-2);
+}
+
+.fm-table a:hover {
+ color: var(--fm-accent);
+}
+
+.fm-note {
+ margin: 10px 0 0;
+ font-size: 12.5px;
+ color: var(--fm-faint);
+}
+
+.fm-foot {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 14px;
+ align-items: center;
+ margin-top: 26px;
+ padding-top: 16px;
+ border-top: 1px solid var(--fm-line);
+ font-size: 13px;
+ color: var(--fm-dim);
+}
+
+.fm-foot a {
+ color: var(--fm-accent);
+ text-decoration: none;
+ font-weight: 600;
+}
+
+.fm-foot a:hover {
+ text-decoration: underline;
+}
+
+.fm-foot code {
+ font-family: var(--fm-mono);
+ font-size: 12px;
+ color: var(--fm-faint);
+}
+
+/* ── responsive ────────────────────────────────────────────────────────── */
+
+@media (max-width: 1000px) {
+ .fm-stage {
+ grid-template-columns: minmax(0, 1fr);
+ }
+
+ .fm-rail {
+ position: static;
+ }
+
+ .fm-canvas {
+ height: 460px;
+ }
+}
+
+@media (max-width: 560px) {
+ .fm-wrap {
+ padding: 18px 14px 64px;
+ }
+
+ .fm-canvas {
+ height: 380px;
+ }
+
+ .fm-stamp {
+ margin-left: 0;
+ width: 100%;
+ }
+
+ .fm-legend {
+ max-width: calc(100% - 24px);
+ bottom: 52px;
+ }
+}
+
+/* Motion is decoration here; the graph is fully usable without it. */
+@media (prefers-reduced-motion: reduce) {
+ .fm-wrap *,
+ .fm-wrap *::before,
+ .fm-wrap *::after {
+ animation-duration: 0.001ms !important;
+ animation-iteration-count: 1 !important;
+ transition-duration: 0.001ms !important;
+ }
+}
diff --git a/src/flow-map.js b/src/flow-map.js
new file mode 100644
index 000000000..484a191ad
--- /dev/null
+++ b/src/flow-map.js
@@ -0,0 +1,966 @@
+// /flow: the agent money-flow map.
+//
+// Renders the topology returned by GET /api/pulse?view=graph. All the judgement
+// (roles, dispersion, filtering, layout physics) lives in flow-map-core.js and
+// is unit-tested; this file is the DOM and canvas layer only.
+//
+// Three things the rendering has to get right, because they are what make the
+// map readable rather than decorative:
+//
+// · Direction. Value flows one way along every edge, so the animated
+// particles travel payer to payee. Without them a graph of undirected
+// lines cannot distinguish an agent that earns from one that pays.
+// · Honesty at every state. Loading shows the shape that is coming, empty
+// says why it is empty and what to do, and an error names the failure. A
+// blank canvas is never an acceptable outcome.
+// · Parity. The canvas is unreachable by keyboard and screen readers, so the
+// table below it is not a fallback bolted on afterwards: it is rendered
+// from the same filtered data, and selecting a row selects the node.
+
+import {
+ annotate, filterGraph, recomputeTotals, classifyRole, dispersion, rankSinks,
+ createLayout, fitTransform, nodeRadius, throughput,
+ fmtUsd, fmtSol, fmtPct, relTime, ROLES,
+} from './flow-map-core.js';
+
+const $ = (sel) => document.querySelector(sel);
+const REFRESH_MS = 60_000;
+const ROLE_IDS = ['source', 'hub', 'relay', 'sink', 'quiet'];
+
+const state = {
+ raw: null,
+ view: null,
+ window: '30d',
+ kind: 'all',
+ query: '',
+ roles: new Set(ROLE_IDS),
+ selected: null,
+ hovered: null,
+ layout: null,
+ transform: { x: 0, y: 0, scale: 1 },
+ radii: new Map(),
+ positions: new Map(),
+ images: new Map(),
+ raf: 0,
+ timer: 0,
+ paused: false,
+ reduceMotion: false,
+};
+
+// ── data ─────────────────────────────────────────────────────────────────────
+
+async function load() {
+ setOverlay('loading');
+ try {
+ const r = await fetch(`/api/pulse?view=graph&window=${encodeURIComponent(state.window)}`, {
+ headers: { accept: 'application/json' },
+ });
+ if (!r.ok) throw new Error(`HTTP ${r.status}`);
+ const body = await r.json();
+ if (!body?.data) throw new Error('malformed response');
+ state.raw = annotate(body.data);
+ state.error = null;
+ applyFilters({ relayout: true });
+ stamp();
+ } catch (err) {
+ state.error = err;
+ setOverlay('error', err);
+ }
+}
+
+/** Rebuild the view from the raw payload plus the current filters. */
+function applyFilters({ relayout = false } = {}) {
+ if (!state.raw) return;
+ const filtered = recomputeTotals(
+ filterGraph(state.raw, { kind: state.kind, query: state.query }),
+ );
+ // Role is judged on the FILTERED totals, so a role badge always describes
+ // what is actually on screen rather than the unfiltered window behind it.
+ const scored = annotate(filtered);
+ const roleFiltered = state.roles.size === ROLE_IDS.length
+ ? scored
+ : dropRoles(scored, state.roles);
+
+ state.view = roleFiltered;
+ if (state.selected && !roleFiltered.nodes.some((n) => n.id === state.selected)) {
+ state.selected = null;
+ }
+
+ if (relayout || !state.layout) relayoutView();
+ renderStats();
+ renderServices();
+ renderTable();
+ renderDetail();
+ setOverlay(roleFiltered.nodes.length ? null : 'empty');
+ draw();
+}
+
+/** Hide whole roles, then drop any edge that lost an end. */
+function dropRoles(graph, roles) {
+ const kept = new Set(graph.nodes.filter((n) => roles.has(n.role)).map((n) => n.id));
+ const edges = graph.edges.filter((e) => kept.has(e.from) && kept.has(e.to));
+ const live = new Set(edges.flatMap((e) => [e.from, e.to]));
+ return { ...graph, nodes: graph.nodes.filter((n) => live.has(n.id) || kept.has(n.id)), edges };
+}
+
+function relayoutView() {
+ const canvas = $('#fm-canvas');
+ if (!canvas || !state.view) return;
+ const w = canvas.clientWidth || 900;
+ const h = canvas.clientHeight || 600;
+ // Seeded on the window, so switching filters keeps the arrangement stable and
+ // switching windows gives the topology room to genuinely rearrange.
+ const seed = 1337 + state.window.length * 97;
+ state.layout = createLayout(state.view, { width: w, height: h, seed });
+ state.layout.settle(state.reduceMotion ? 600 : 320);
+ state.positions = state.layout.positions();
+ state.transform = fitTransform(state.layout.bounds(), w, h, 56);
+
+ const max = Math.max(0, ...state.view.nodes.map(throughput));
+ state.radii = new Map(state.view.nodes.map((n) => [n.id, nodeRadius(n, max)]));
+ preloadAvatars();
+}
+
+function preloadAvatars() {
+ for (const n of state.view?.nodes || []) {
+ if (!n.avatar_thumbnail_url || state.images.has(n.id)) continue;
+ const img = new Image();
+ img.crossOrigin = 'anonymous';
+ img.decoding = 'async';
+ img.onload = () => { state.images.set(n.id, img); draw(); };
+ // A missing thumbnail is normal, not an error: the node falls back to its
+ // role-coloured disc and the map stays complete.
+ img.onerror = () => state.images.set(n.id, null);
+ state.images.set(n.id, undefined);
+ img.src = n.avatar_thumbnail_url;
+ }
+}
+
+// ── canvas ───────────────────────────────────────────────────────────────────
+
+function sizeCanvas() {
+ const canvas = $('#fm-canvas');
+ if (!canvas) return;
+ const dpr = Math.min(2, window.devicePixelRatio || 1);
+ const w = canvas.clientWidth;
+ const h = canvas.clientHeight;
+ if (!w || !h) return;
+ canvas.width = Math.round(w * dpr);
+ canvas.height = Math.round(h * dpr);
+ const ctx = canvas.getContext('2d');
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
+}
+
+const cssVar = (name) => getComputedStyle(document.documentElement).getPointerVar
+ ? ''
+ : getComputedStyle(document.documentElement).getPropertyValue(name).trim();
+
+const roleColor = (role) => cssVar(`--fm-${role}`) || '#888';
+
+function toScreen(p) {
+ const { x, y, scale } = state.transform;
+ return { x: p.x * scale + x, y: p.y * scale + y };
+}
+
+function draw(now = performance.now()) {
+ const canvas = $('#fm-canvas');
+ if (!canvas || !state.view) return;
+ const ctx = canvas.getContext('2d');
+ const w = canvas.clientWidth;
+ const h = canvas.clientHeight;
+ ctx.clearRect(0, 0, w, h);
+
+ const { scale } = state.transform;
+ const nodesById = new Map(state.view.nodes.map((n) => [n.id, n]));
+ const focus = state.hovered || state.selected;
+ const neighbours = focus ? neighboursOf(focus) : null;
+
+ const maxEdgeUsd = Math.max(0, ...state.view.edges.map((e) => e.usd || 0));
+
+ for (const e of state.view.edges) {
+ const a = state.positions.get(e.from);
+ const b = state.positions.get(e.to);
+ if (!a || !b) continue;
+ const dim = focus && !(e.from === focus || e.to === focus);
+ const pa = toScreen(a);
+ const pb = toScreen(b);
+ const weight = maxEdgeUsd > 0 ? Math.sqrt((e.usd || 0) / maxEdgeUsd) : 0.3;
+
+ ctx.save();
+ ctx.globalAlpha = dim ? 0.06 : 0.34 + weight * 0.4;
+ ctx.strokeStyle = e.kinds?.includes('tip')
+ ? roleColor('sink')
+ : roleColor('hub');
+ ctx.lineWidth = Math.max(0.7, (0.8 + weight * 2.6) * Math.min(1.4, scale));
+ ctx.beginPath();
+ ctx.moveTo(pa.x, pa.y);
+ ctx.lineTo(pb.x, pb.y);
+ ctx.stroke();
+ ctx.restore();
+
+ if (dim) continue;
+ drawParticles(ctx, pa, pb, e, weight, now);
+ }
+
+ const ordered = [...state.view.nodes].sort(
+ (x, y) => (state.radii.get(x.id) || 0) - (state.radii.get(y.id) || 0),
+ );
+ for (const n of ordered) {
+ const p = state.positions.get(n.id);
+ if (!p) continue;
+ const s = toScreen(p);
+ const r = (state.radii.get(n.id) || 10) * Math.min(1.5, Math.max(0.55, scale));
+ const dim = focus && n.id !== focus && !neighbours?.has(n.id);
+ drawNode(ctx, n, s, r, dim, n.id === state.selected, n.id === state.hovered);
+ }
+
+ // Label only what can be read: at low zoom labels turn into noise.
+ if (scale > 0.62) {
+ ctx.save();
+ ctx.font = '600 11px ui-sans-serif, system-ui, sans-serif';
+ ctx.textAlign = 'center';
+ ctx.textBaseline = 'top';
+ for (const n of ordered) {
+ const p = state.positions.get(n.id);
+ if (!p) continue;
+ const r = (state.radii.get(n.id) || 10) * Math.min(1.5, Math.max(0.55, scale));
+ if (r < 12 && n.id !== focus) continue;
+ const s = toScreen(p);
+ const dim = focus && n.id !== focus && !neighbours?.has(n.id);
+ ctx.globalAlpha = dim ? 0.12 : 0.82;
+ ctx.fillStyle = `rgb(${cssVar('--fm-canvas-ink') || '255,255,255'})`;
+ ctx.fillText(truncate(n.name, 18), s.x, s.y + r + 5);
+ }
+ ctx.restore();
+ }
+}
+
+function drawNode(ctx, n, s, r, dim, selected, hovered) {
+ const color = roleColor(n.role || 'quiet');
+ ctx.save();
+ ctx.globalAlpha = dim ? 0.16 : 1;
+
+ if (selected || hovered) {
+ ctx.beginPath();
+ ctx.arc(s.x, s.y, r + (selected ? 7 : 4), 0, Math.PI * 2);
+ ctx.fillStyle = color;
+ ctx.globalAlpha = dim ? 0.08 : selected ? 0.26 : 0.16;
+ ctx.fill();
+ ctx.globalAlpha = dim ? 0.16 : 1;
+ }
+
+ const img = state.images.get(n.id);
+ if (img) {
+ ctx.save();
+ ctx.beginPath();
+ ctx.arc(s.x, s.y, r, 0, Math.PI * 2);
+ ctx.clip();
+ ctx.drawImage(img, s.x - r, s.y - r, r * 2, r * 2);
+ ctx.restore();
+ } else {
+ ctx.beginPath();
+ ctx.arc(s.x, s.y, r, 0, Math.PI * 2);
+ ctx.fillStyle = color;
+ ctx.globalAlpha = (dim ? 0.16 : 1) * 0.24;
+ ctx.fill();
+ ctx.globalAlpha = dim ? 0.16 : 1;
+ }
+
+ ctx.beginPath();
+ ctx.arc(s.x, s.y, r, 0, Math.PI * 2);
+ ctx.strokeStyle = color;
+ ctx.lineWidth = selected ? 2.4 : 1.5;
+ ctx.stroke();
+
+ // An address-only counterparty is drawn as a dashed ring: the map should not
+ // imply we know who a wallet belongs to when we do not.
+ if (n.kind === 'wallet') {
+ ctx.beginPath();
+ ctx.setLineDash([2.5, 3]);
+ ctx.arc(s.x, s.y, r + 2.5, 0, Math.PI * 2);
+ ctx.globalAlpha = (dim ? 0.16 : 1) * 0.5;
+ ctx.stroke();
+ ctx.setLineDash([]);
+ }
+ ctx.restore();
+}
+
+function drawParticles(ctx, a, b, e, weight, now) {
+ if (state.reduceMotion || state.paused) return;
+ const dx = b.x - a.x;
+ const dy = b.y - a.y;
+ const dist = Math.hypot(dx, dy);
+ if (dist < 6) return;
+ // One dot per handful of transfers, capped: the animation reads the busiest
+ // routes as busier without turning them into a solid line.
+ const count = Math.min(4, 1 + Math.floor(Math.log2(1 + (e.count || 1))));
+ const speed = 0.00013 + weight * 0.00009;
+ ctx.save();
+ ctx.fillStyle = e.kinds?.includes('tip') ? roleColor('sink') : roleColor('accent');
+ for (let i = 0; i < count; i += 1) {
+ const t = ((now * speed) + i / count + hash01(e.from + e.to + i)) % 1;
+ const x = a.x + dx * t;
+ const y = a.y + dy * t;
+ ctx.globalAlpha = 0.85 * Math.sin(Math.PI * t) ** 0.6;
+ ctx.beginPath();
+ ctx.arc(x, y, 1.6 + weight * 1.5, 0, Math.PI * 2);
+ ctx.fill();
+ }
+ ctx.restore();
+}
+
+/** Stable per-edge phase offset so dots do not march in lockstep. */
+function hash01(str) {
+ let h = 2166136261;
+ for (let i = 0; i < str.length; i += 1) {
+ h ^= str.charCodeAt(i);
+ h = Math.imul(h, 16777619);
+ }
+ return ((h >>> 0) % 1000) / 1000;
+}
+
+function neighboursOf(id) {
+ const set = new Set([id]);
+ for (const e of state.view?.edges || []) {
+ if (e.from === id) set.add(e.to);
+ if (e.to === id) set.add(e.from);
+ }
+ return set;
+}
+
+function tick(now) {
+ state.raf = requestAnimationFrame(tick);
+ if (document.hidden || state.paused || state.reduceMotion) return;
+ draw(now);
+}
+
+// ── hit testing, pan and zoom ────────────────────────────────────────────────
+
+function nodeAt(px, py) {
+ let best = null;
+ let bestD = Infinity;
+ for (const n of state.view?.nodes || []) {
+ const p = state.positions.get(n.id);
+ if (!p) continue;
+ const s = toScreen(p);
+ const r = (state.radii.get(n.id) || 10) * Math.min(1.5, Math.max(0.55, state.transform.scale));
+ const d = Math.hypot(s.x - px, s.y - py);
+ if (d <= r + 4 && d < bestD) { best = n; bestD = d; }
+ }
+ return best;
+}
+
+function bindCanvas() {
+ const canvas = $('#fm-canvas');
+ const tip = $('#fm-tip');
+ let dragging = false;
+ let moved = false;
+ let last = null;
+
+ const localPoint = (ev) => {
+ const rect = canvas.getBoundingClientRect();
+ return { x: ev.clientX - rect.left, y: ev.clientY - rect.top };
+ };
+
+ canvas.addEventListener('pointerdown', (ev) => {
+ dragging = true;
+ moved = false;
+ last = { x: ev.clientX, y: ev.clientY };
+ canvas.setPointerCapture(ev.pointerId);
+ canvas.classList.add('is-dragging');
+ });
+
+ canvas.addEventListener('pointermove', (ev) => {
+ const p = localPoint(ev);
+ if (dragging && last) {
+ const dx = ev.clientX - last.x;
+ const dy = ev.clientY - last.y;
+ if (Math.abs(dx) + Math.abs(dy) > 2) moved = true;
+ state.transform.x += dx;
+ state.transform.y += dy;
+ last = { x: ev.clientX, y: ev.clientY };
+ draw();
+ return;
+ }
+ const hit = nodeAt(p.x, p.y);
+ const id = hit?.id || null;
+ canvas.classList.toggle('is-hot', Boolean(hit));
+ if (id !== state.hovered) {
+ state.hovered = id;
+ draw();
+ }
+ if (hit) showTip(tip, hit, p, canvas);
+ else tip.classList.remove('is-on');
+ });
+
+ const endDrag = (ev) => {
+ if (!dragging) return;
+ dragging = false;
+ canvas.classList.remove('is-dragging');
+ if (ev?.pointerId != null && canvas.hasPointerCapture?.(ev.pointerId)) {
+ canvas.releasePointerCapture(ev.pointerId);
+ }
+ if (!moved && ev) {
+ const p = localPoint(ev);
+ select(nodeAt(p.x, p.y)?.id || null);
+ }
+ };
+ canvas.addEventListener('pointerup', endDrag);
+ canvas.addEventListener('pointercancel', () => { dragging = false; canvas.classList.remove('is-dragging'); });
+
+ canvas.addEventListener('pointerleave', () => {
+ tip.classList.remove('is-on');
+ if (state.hovered) { state.hovered = null; draw(); }
+ });
+
+ canvas.addEventListener('wheel', (ev) => {
+ ev.preventDefault();
+ const rect = canvas.getBoundingClientRect();
+ zoomAround(ev.clientX - rect.left, ev.clientY - rect.top, Math.exp(-ev.deltaY * 0.0016));
+ }, { passive: false });
+
+ $('#fm-zoom-in').addEventListener('click', () => zoomAround(canvas.clientWidth / 2, canvas.clientHeight / 2, 1.25));
+ $('#fm-zoom-out').addEventListener('click', () => zoomAround(canvas.clientWidth / 2, canvas.clientHeight / 2, 0.8));
+ $('#fm-zoom-fit').addEventListener('click', () => {
+ if (!state.layout) return;
+ state.transform = fitTransform(state.layout.bounds(), canvas.clientWidth, canvas.clientHeight, 56);
+ draw();
+ });
+}
+
+function zoomAround(cx, cy, factor) {
+ const t = state.transform;
+ const next = Math.min(4, Math.max(0.22, t.scale * factor));
+ const k = next / t.scale;
+ t.x = cx - (cx - t.x) * k;
+ t.y = cy - (cy - t.y) * k;
+ t.scale = next;
+ draw();
+}
+
+function showTip(tip, node, at, canvas) {
+ const role = ROLES[node.role] || ROLES.quiet;
+ tip.innerHTML = `<b></b><span></span>`;
+ tip.querySelector('b').textContent = node.name;
+ tip.querySelector('span').textContent =
+ `${role.label} · in ${fmtUsd(node.in_usd)} · out ${fmtUsd(node.out_usd)} · ${node.in_count + node.out_count} transfers`;
+ tip.classList.add('is-on');
+ const w = tip.offsetWidth;
+ const h = tip.offsetHeight;
+ const x = Math.min(canvas.clientWidth - w - 8, Math.max(8, at.x + 14));
+ const y = Math.max(8, at.y - h - 12);
+ tip.style.left = `${x}px`;
+ tip.style.top = `${y}px`;
+}
+
+// ── selection + detail rail ──────────────────────────────────────────────────
+
+function select(id) {
+ state.selected = id;
+ renderDetail();
+ renderTable();
+ draw();
+}
+
+function renderDetail() {
+ const host = $('#fm-detail');
+ if (!host) return;
+ const node = state.view?.nodes.find((n) => n.id === state.selected);
+
+ if (!node) {
+ host.innerHTML = '';
+ const empty = document.createElement('div');
+ empty.className = 'fm-empty-rail';
+ empty.innerHTML =
+ '<svg width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true">' +
+ '<circle cx="6" cy="6" r="2.5"/><circle cx="18" cy="8" r="2.5"/><circle cx="11" cy="18" r="2.5"/>' +
+ '<path d="M8.2 6.6 15.6 7.6M16.8 10.2 12.4 15.6M9.4 16.2 7 8.4"/></svg>';
+ const p = document.createElement('p');
+ p.textContent = 'Pick any wallet on the map, or a row in the table below, to see who it pays and who pays it.';
+ empty.append(p);
+ host.append(empty);
+ return;
+ }
+
+ const role = ROLES[node.role] || ROLES.quiet;
+ const total = node.in_usd + node.out_usd;
+ const inPct = total > 0 ? (node.in_usd / total) * 100 : 0;
+
+ host.innerHTML = '';
+
+ const head = document.createElement('div');
+ head.className = 'fm-detail-head';
+ const img = state.images.get(node.id);
+ if (img && node.avatar_thumbnail_url) {
+ const el = document.createElement('img');
+ el.className = 'fm-avatar';
+ el.src = node.avatar_thumbnail_url;
+ el.alt = '';
+ head.append(el);
+ } else {
+ const el = document.createElement('div');
+ el.className = 'fm-avatar fm-avatar--fallback';
+ el.setAttribute('aria-hidden', 'true');
+ el.textContent = (node.name || '?').replace(/[^A-Za-z0-9]/g, '').slice(0, 2).toUpperCase() || '··';
+ head.append(el);
+ }
+ const name = document.createElement('div');
+ name.className = 'fm-detail-name';
+ const b = document.createElement('b');
+ b.textContent = node.name;
+ const code = document.createElement('code');
+ code.textContent = node.address_short || '';
+ name.append(b, code);
+ head.append(name);
+ host.append(head);
+
+ const badge = document.createElement('span');
+ badge.className = 'fm-role';
+ badge.dataset.role = role.id;
+ badge.textContent = role.label;
+ badge.title = role.hint;
+ host.append(badge);
+
+ const why = document.createElement('p');
+ why.style.margin = '8px 0 12px';
+ why.textContent = role.hint;
+ host.append(why);
+
+ const split = document.createElement('div');
+ split.className = 'fm-split';
+ split.setAttribute('role', 'img');
+ split.setAttribute('aria-label', `${fmtUsd(node.in_usd)} received, ${fmtUsd(node.out_usd)} paid out`);
+ split.innerHTML = '<i class="in"></i><i class="out"></i>';
+ split.querySelector('.in').style.width = `${inPct}%`;
+ split.querySelector('.out').style.width = `${100 - inPct}%`;
+ host.append(split);
+
+ const kv = document.createElement('dl');
+ kv.className = 'fm-kv';
+ const rows = [
+ ['Received', fmtUsd(node.in_usd), ''],
+ ['Paid out', fmtUsd(node.out_usd), ''],
+ ['Net', fmtUsd(node.net_usd), node.net_usd > 0 ? 'neg' : 'pos'],
+ ['Transfers', String(node.in_count + node.out_count), ''],
+ ['Counterparties', String(node.partners), ''],
+ ['SOL moved', fmtSol(node.in_sol + node.out_sol), ''],
+ ];
+ for (const [k, v, cls] of rows) {
+ const dt = document.createElement('dt');
+ dt.textContent = k;
+ const dd = document.createElement('dd');
+ dd.textContent = v;
+ if (cls) dd.className = cls;
+ kv.append(dt, dd);
+ }
+ host.append(kv);
+
+ const services = [...new Set(
+ (state.view?.edges || [])
+ .filter((e) => e.from === node.id || e.to === node.id)
+ .flatMap((e) => e.services || []),
+ )];
+ if (services.length) {
+ const chips = document.createElement('div');
+ chips.className = 'fm-chips';
+ for (const s of services.slice(0, 8)) {
+ const chip = document.createElement('span');
+ chip.className = 'fm-chip';
+ chip.textContent = s;
+ chips.append(chip);
+ }
+ host.append(chips);
+ }
+
+ const peers = (state.view?.edges || [])
+ .filter((e) => e.from === node.id || e.to === node.id)
+ .map((e) => {
+ const outbound = e.from === node.id;
+ const otherId = outbound ? e.to : e.from;
+ return { outbound, otherId, other: state.view.nodes.find((n) => n.id === otherId), edge: e };
+ })
+ .filter((p) => p.other)
+ .sort((a, b) => b.edge.usd - a.edge.usd)
+ .slice(0, 8);
+
+ if (peers.length) {
+ const h2 = document.createElement('h2');
+ h2.textContent = 'Routes';
+ h2.style.margin = '4px 0 6px';
+ const ul = document.createElement('ul');
+ ul.className = 'fm-peers';
+ for (const p of peers) {
+ const li = document.createElement('li');
+ const btn = document.createElement('button');
+ btn.type = 'button';
+ btn.className = 'fm-peer';
+ btn.title = `${p.edge.count} transfer(s), last ${relTime(p.edge.last_ts)}`;
+ const dir = document.createElement('span');
+ dir.className = `fm-peer-dir ${p.outbound ? 'out' : 'in'}`;
+ dir.textContent = p.outbound ? '→' : '←';
+ dir.setAttribute('aria-label', p.outbound ? 'pays' : 'paid by');
+ const nm = document.createElement('span');
+ nm.className = 'fm-peer-name';
+ nm.textContent = p.other.name;
+ const amt = document.createElement('span');
+ amt.className = 'fm-peer-amt';
+ amt.textContent = fmtUsd(p.edge.usd);
+ btn.append(dir, nm, amt);
+ btn.addEventListener('click', () => select(p.otherId));
+ li.append(btn);
+ ul.append(li);
+ }
+ host.append(h2, ul);
+ }
+
+ const links = document.createElement('div');
+ links.className = 'fm-links';
+ if (node.url) {
+ const a = document.createElement('a');
+ a.href = node.url;
+ a.textContent = 'Agent profile';
+ links.append(a);
+ }
+ if (node.explorer) {
+ const a = document.createElement('a');
+ a.href = node.explorer;
+ a.target = '_blank';
+ a.rel = 'noopener noreferrer';
+ a.textContent = 'Wallet on Solscan';
+ links.append(a);
+ }
+ if (node.agent_id) {
+ const a = document.createElement('a');
+ a.href = `/pulse?agent=${encodeURIComponent(node.agent_id)}`;
+ a.textContent = 'Wallet story';
+ links.append(a);
+ }
+ if (links.children.length) host.append(links);
+}
+
+// ── stats, services, table ───────────────────────────────────────────────────
+
+function renderStats() {
+ const host = $('#fm-stats');
+ if (!host || !state.view) return;
+ const g = state.view;
+ const usd = g.edges.reduce((s, e) => s + (e.usd || 0), 0);
+ const transfers = g.edges.reduce((s, e) => s + (e.count || 0), 0);
+ const disp = dispersion(g);
+ const sinks = rankSinks(g, 1);
+
+ const cards = [
+ { k: 'Value moved', v: fmtUsd(usd), sub: `${fmtSol(g.edges.reduce((s, e) => s + (e.sol || 0), 0))} SOL settled` },
+ { k: 'Transfers', v: transfers.toLocaleString('en-US'), sub: `across ${g.edges.length} routes` },
+ { k: 'Wallets', v: String(g.nodes.length), sub: `${g.nodes.filter((n) => n.kind === 'agent').length} named agents` },
+ {
+ k: 'Stuck capital',
+ v: fmtPct(disp),
+ sub: sinks.length ? `most in ${truncate(sinks[0].name, 16)}` : 'nothing one-way',
+ flag: disp >= 0.4,
+ },
+ ];
+
+ host.innerHTML = '';
+ for (const c of cards) {
+ const box = document.createElement('div');
+ box.className = `fm-stat${c.flag ? ' fm-stat--flag' : ''}`;
+ const dt = document.createElement('dt');
+ dt.textContent = c.k;
+ const dd = document.createElement('dd');
+ dd.textContent = c.v;
+ const sub = document.createElement('span');
+ sub.className = 'fm-stat-sub';
+ sub.textContent = c.sub;
+ box.append(dt, dd, sub);
+ host.append(box);
+ }
+ if (cards[3].flag) {
+ host.lastElementChild.title =
+ 'Most of the value that entered these wallets has not moved again. That is capital dispersion: the loop is open.';
+ }
+}
+
+function renderServices() {
+ const host = $('#fm-services');
+ const section = $('#fm-services-section');
+ if (!host || !section) return;
+ const services = state.raw?.services || [];
+ section.hidden = services.length === 0;
+ if (!services.length) return;
+ const max = Math.max(...services.map((s) => s.usd || 0), 0);
+ host.innerHTML = '';
+ for (const s of services) {
+ const box = document.createElement('div');
+ box.className = 'fm-service';
+ const b = document.createElement('b');
+ b.textContent = s.name;
+ const span = document.createElement('span');
+ span.textContent = `${fmtUsd(s.usd)} · ${s.count} call${s.count === 1 ? '' : 's'}`;
+ const bar = document.createElement('div');
+ bar.className = 'fm-service-bar';
+ const i = document.createElement('i');
+ i.style.width = max > 0 ? `${Math.max(3, (s.usd / max) * 100)}%` : '3%';
+ bar.append(i);
+ box.append(b, span, bar);
+ host.append(box);
+ }
+}
+
+function renderTable() {
+ const body = $('#fm-tbody');
+ const caption = $('#fm-table-caption');
+ if (!body || !state.view) return;
+ const nodes = [...state.view.nodes].sort((a, b) => b.throughput_usd - a.throughput_usd);
+ caption.textContent = nodes.length
+ ? `Every wallet on the map, ranked by value handled. Selecting a row highlights it above. ${nodes.length} shown.`
+ : 'No wallets match the current filters.';
+
+ body.innerHTML = '';
+ for (const n of nodes) {
+ const tr = document.createElement('tr');
+ tr.tabIndex = 0;
+ tr.dataset.id = n.id;
+ if (n.id === state.selected) tr.setAttribute('aria-selected', 'true');
+
+ const nameCell = document.createElement('td');
+ if (n.url) {
+ const a = document.createElement('a');
+ a.href = n.url;
+ a.textContent = n.name;
+ nameCell.append(a);
+ } else {
+ nameCell.textContent = n.name;
+ }
+
+ const roleCell = document.createElement('td');
+ const badge = document.createElement('span');
+ badge.className = 'fm-role';
+ badge.dataset.role = n.role;
+ badge.textContent = (ROLES[n.role] || ROLES.quiet).label;
+ roleCell.append(badge);
+
+ const cells = [
+ nameCell,
+ roleCell,
+ numCell(fmtUsd(n.in_usd)),
+ numCell(fmtUsd(n.out_usd)),
+ numCell(fmtUsd(n.net_usd)),
+ numCell(String(n.in_count + n.out_count)),
+ numCell(String(n.partners)),
+ ];
+ tr.append(...cells);
+ const activate = () => select(n.id);
+ tr.addEventListener('click', activate);
+ tr.addEventListener('keydown', (ev) => {
+ if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); activate(); }
+ });
+ body.append(tr);
+ }
+}
+
+function numCell(text) {
+ const td = document.createElement('td');
+ td.className = 'num';
+ td.textContent = text;
+ return td;
+}
+
+function truncate(s, n) {
+ const str = String(s || '');
+ return str.length > n ? `${str.slice(0, n - 1)}…` : str;
+}
+
+// ── page states ──────────────────────────────────────────────────────────────
+
+function setOverlay(kind, err) {
+ const overlay = $('#fm-overlay');
+ const skeleton = $('#fm-skeleton');
+ if (!overlay) return;
+ overlay.innerHTML = '';
+ if (!kind) {
+ overlay.hidden = true;
+ skeleton.hidden = true;
+ $('#fm-canvas').setAttribute('aria-busy', 'false');
+ return;
+ }
+ overlay.hidden = false;
+ skeleton.hidden = kind !== 'loading';
+ $('#fm-canvas').setAttribute('aria-busy', kind === 'loading' ? 'true' : 'false');
+
+ if (kind === 'loading') {
+ const spin = document.createElement('div');
+ spin.className = 'fm-spinner';
+ const p = document.createElement('p');
+ p.textContent = 'Reading settled transfers…';
+ overlay.append(spin, p);
+ return;
+ }
+
+ const h2 = document.createElement('h2');
+ const p = document.createElement('p');
+ if (kind === 'error') {
+ h2.textContent = 'The flow map could not load';
+ p.textContent = `${err?.message || 'The request failed'}. The graph is read live from settled on-chain transfers, so there is nothing cached to fall back to.`;
+ const btn = document.createElement('button');
+ btn.type = 'button';
+ btn.className = 'fm-btn';
+ btn.textContent = 'Try again';
+ btn.addEventListener('click', load);
+ overlay.append(h2, p, btn);
+ return;
+ }
+
+ const filtered = state.query || state.kind !== 'all' || state.roles.size !== ROLE_IDS.length;
+ h2.textContent = filtered ? 'Nothing matches those filters' : 'No settled flow in this window';
+ p.textContent = filtered
+ ? 'Widen the window, clear the search, or turn a role back on.'
+ : 'Every edge here is a real on-chain transfer between agent wallets, so a quiet platform draws an empty map rather than a fabricated one. Try a longer window.';
+ const btn = document.createElement('button');
+ btn.type = 'button';
+ btn.className = 'fm-btn';
+ btn.textContent = filtered ? 'Clear filters' : 'Show 90 days';
+ btn.addEventListener('click', () => {
+ if (filtered) resetFilters();
+ else setWindow('90d');
+ });
+ overlay.append(h2, p, btn);
+}
+
+function stamp() {
+ const el = $('#fm-stamp');
+ if (!el || !state.raw) return;
+ const bits = [`updated ${relTime(state.raw.generated_at)}`];
+ if (state.raw.truncated) bits.push(`top ${state.raw.max_edges} routes`);
+ el.textContent = bits.join(' · ');
+ const note = $('#fm-truncated');
+ if (note) {
+ note.hidden = !state.raw.truncated;
+ note.textContent = state.raw.truncated
+ ? `This window has more routes than the map draws. Showing the ${state.raw.max_edges} largest by value; the totals above describe what is drawn, not the whole window.`
+ : '';
+ }
+}
+
+// ── controls ─────────────────────────────────────────────────────────────────
+
+function setWindow(w) {
+ state.window = w;
+ for (const b of document.querySelectorAll('[data-window]')) {
+ b.setAttribute('aria-pressed', String(b.dataset.window === w));
+ }
+ load();
+}
+
+function resetFilters() {
+ state.query = '';
+ state.kind = 'all';
+ state.roles = new Set(ROLE_IDS);
+ $('#fm-q').value = '';
+ for (const b of document.querySelectorAll('[data-kind]')) {
+ b.setAttribute('aria-pressed', String(b.dataset.kind === 'all'));
+ }
+ for (const b of document.querySelectorAll('[data-role]')) b.setAttribute('aria-pressed', 'true');
+ applyFilters({ relayout: true });
+}
+
+function bindControls() {
+ for (const b of document.querySelectorAll('[data-window]')) {
+ b.addEventListener('click', () => setWindow(b.dataset.window));
+ }
+ for (const b of document.querySelectorAll('[data-kind]')) {
+ b.addEventListener('click', () => {
+ state.kind = b.dataset.kind;
+ for (const o of document.querySelectorAll('[data-kind]')) {
+ o.setAttribute('aria-pressed', String(o === b));
+ }
+ applyFilters({ relayout: true });
+ });
+ }
+ for (const b of document.querySelectorAll('#fm-legend [data-role]')) {
+ b.addEventListener('click', () => {
+ const role = b.dataset.role;
+ if (state.roles.has(role)) state.roles.delete(role);
+ else state.roles.add(role);
+ if (!state.roles.size) state.roles = new Set(ROLE_IDS);
+ for (const o of document.querySelectorAll('#fm-legend [data-role]')) {
+ o.setAttribute('aria-pressed', String(state.roles.has(o.dataset.role)));
+ }
+ applyFilters({ relayout: true });
+ });
+ }
+
+ const q = $('#fm-q');
+ let debounce = 0;
+ q.addEventListener('input', () => {
+ clearTimeout(debounce);
+ debounce = setTimeout(() => {
+ state.query = q.value;
+ $('#fm-q-clear').hidden = !q.value;
+ applyFilters({ relayout: true });
+ }, 180);
+ });
+ $('#fm-q-clear').addEventListener('click', () => {
+ q.value = '';
+ state.query = '';
+ $('#fm-q-clear').hidden = true;
+ q.focus();
+ applyFilters({ relayout: true });
+ });
+
+ $('#fm-refresh').addEventListener('click', load);
+ const pause = $('#fm-pause');
+ pause.addEventListener('click', () => {
+ state.paused = !state.paused;
+ pause.setAttribute('aria-pressed', String(state.paused));
+ pause.textContent = state.paused ? 'Resume' : 'Pause';
+ if (!state.paused) draw();
+ });
+
+ document.addEventListener('keydown', (ev) => {
+ if (ev.target.matches('input, textarea')) return;
+ if (ev.key === '/') { ev.preventDefault(); q.focus(); }
+ if (ev.key === 'Escape') select(null);
+ if (ev.key === 'r' && !ev.metaKey && !ev.ctrlKey) load();
+ });
+}
+
+// ── boot ─────────────────────────────────────────────────────────────────────
+
+function boot() {
+ state.reduceMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches || false;
+ sizeCanvas();
+ bindCanvas();
+ bindControls();
+ renderDetail();
+
+ let resizeTimer = 0;
+ window.addEventListener('resize', () => {
+ clearTimeout(resizeTimer);
+ resizeTimer = setTimeout(() => {
+ sizeCanvas();
+ relayoutView();
+ draw();
+ }, 160);
+ });
+
+ // Polling stops entirely in a hidden tab: this is an RPC-backed read and an
+ // ops page left open all day should not keep paying for nobody.
+ document.addEventListener('visibilitychange', () => {
+ if (document.hidden) {
+ clearInterval(state.timer);
+ state.timer = 0;
+ } else if (!state.timer) {
+ state.timer = setInterval(() => { if (!state.paused) load(); }, REFRESH_MS);
+ load();
+ }
+ });
+ state.timer = setInterval(() => { if (!state.paused) load(); }, REFRESH_MS);
+ setInterval(stamp, 15_000);
+
+ if (!state.reduceMotion) state.raf = requestAnimationFrame(tick);
+ load();
+}
+
+if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);
+else boot();
diff --git a/tests/flow-map-core.test.js b/tests/flow-map-core.test.js
new file mode 100644
index 000000000..f2fe77f8f
--- /dev/null
+++ b/tests/flow-map-core.test.js
@@ -0,0 +1,305 @@
+// The /flow map is only worth shipping if its reading of the graph is
+// trustworthy, so the cases below are the ones that actually decide something:
+// the sink/source distinction that names capital dispersion, the filter
+// invariant that a drawn edge always has two drawn ends, and the determinism
+// that lets an operator compare two windows without the layout reshuffling.
+
+import { describe, it, expect } from 'vitest';
+import {
+ classifyRole, dispersion, annotate, rankSinks, rankHubs,
+ filterGraph, recomputeTotals, throughput, netUsd,
+ fmtUsd, fmtSol, fmtPct, relTime,
+ seededRandom, nodeRadius, createLayout, fitTransform,
+ SOURCE_RATIO, SINK_RATIO, HUB_PARTNERS,
+} from '../src/flow-map-core.js';
+
+const node = (o = {}) => ({
+ id: 'a:1', kind: 'agent', name: 'Agent',
+ in_usd: 0, out_usd: 0, in_sol: 0, out_sol: 0,
+ in_count: 0, out_count: 0, partners_in: 0, partners_out: 0,
+ ...o,
+});
+
+describe('classifyRole', () => {
+ it('calls a one-way earner a sink, which is the capital-dispersion signature', () => {
+ expect(classifyRole(node({ in_usd: 20, out_usd: 1 })).id).toBe('sink');
+ });
+
+ it('calls a one-way payer a source', () => {
+ expect(classifyRole(node({ in_usd: 1, out_usd: 20 })).id).toBe('source');
+ });
+
+ it('does NOT call a zero-flow node a sink', () => {
+ // 0/0 would read as "earns and never spends". It moved nothing at all,
+ // and mislabelling it would inflate the dispersion number with noise.
+ expect(classifyRole(node()).id).toBe('quiet');
+ expect(classifyRole(node({ in_usd: 0, out_usd: 0 })).id).toBe('quiet');
+ });
+
+ it('separates a hub from a relay by distinct partners, not by volume', () => {
+ const busyButNarrow = node({ in_usd: 500, out_usd: 500, partners_in: 1, partners_out: 1 });
+ const smallButWide = node({ in_usd: 2, out_usd: 2, partners_in: 3, partners_out: 4 });
+ expect(classifyRole(busyButNarrow).id).toBe('relay');
+ expect(classifyRole(smallButWide).id).toBe('hub');
+ });
+
+ it('honours its documented thresholds exactly at the boundary', () => {
+ const atSource = node({ in_usd: 1 - SOURCE_RATIO, out_usd: SOURCE_RATIO });
+ const atSink = node({ in_usd: 1 - SINK_RATIO, out_usd: SINK_RATIO });
+ expect(classifyRole(atSource).id).toBe('source');
+ expect(classifyRole(atSink).id).toBe('sink');
+ expect(HUB_PARTNERS).toBeGreaterThan(1);
+ });
+});
+
+describe('dispersion', () => {
+ it('is zero for a closed loop where everything paid out comes back', () => {
+ const g = { nodes: [
+ node({ id: 'a', in_usd: 10, out_usd: 10, partners_in: 2, partners_out: 2 }),
+ node({ id: 'b', in_usd: 10, out_usd: 10, partners_in: 2, partners_out: 2 }),
+ ] };
+ expect(dispersion(g)).toBe(0);
+ });
+
+ it('rises toward 1 as value accumulates in nodes that never spend', () => {
+ const g = { nodes: [
+ node({ id: 'src', in_usd: 0, out_usd: 100 }),
+ node({ id: 'stuck', in_usd: 100, out_usd: 0 }),
+ ] };
+ expect(dispersion(g)).toBeCloseTo(1, 6);
+ });
+
+ it('stays at zero on an empty graph rather than dividing by nothing', () => {
+ expect(dispersion({ nodes: [] })).toBe(0);
+ expect(dispersion(null)).toBe(0);
+ });
+});
+
+describe('annotate / rankings', () => {
+ it('attaches the derived reading so renderers cannot disagree with the table', () => {
+ const g = annotate({ nodes: [node({ in_usd: 9, out_usd: 1 })] });
+ expect(g.nodes[0].role).toBe('sink');
+ expect(g.nodes[0].net_usd).toBe(8);
+ expect(g.nodes[0].throughput_usd).toBe(10);
+ });
+
+ it('ranks sinks by how much capital is stuck in them, worst first', () => {
+ const g = { nodes: [
+ node({ id: 'small', in_usd: 5, out_usd: 0 }),
+ node({ id: 'big', in_usd: 50, out_usd: 1 }),
+ node({ id: 'healthy', in_usd: 10, out_usd: 10, partners_in: 3, partners_out: 3 }),
+ ] };
+ const sinks = rankSinks(g);
+ expect(sinks.map((s) => s.id)).toEqual(['big', 'small']);
+ expect(sinks[0].net_usd).toBe(49);
+ });
+
+ it('ranks hubs by reach', () => {
+ const g = { nodes: [
+ node({ id: 'wide', in_usd: 5, out_usd: 5, partners_in: 6, partners_out: 6 }),
+ node({ id: 'narrow', in_usd: 50, out_usd: 50, partners_in: 2, partners_out: 3 }),
+ ] };
+ expect(rankHubs(g)[0].id).toBe('wide');
+ });
+});
+
+describe('filterGraph', () => {
+ const graph = {
+ nodes: [node({ id: 'a', name: 'Atlas' }), node({ id: 'b', name: 'Vega' }), node({ id: 'c', name: 'Echo' })],
+ edges: [
+ { from: 'a', to: 'b', usd: 5, sol: 0.05, count: 2, kinds: ['payment'] },
+ { from: 'b', to: 'c', usd: 3, sol: 0.03, count: 1, kinds: ['tip'] },
+ ],
+ };
+
+ it('never leaves an edge with an undrawn end', () => {
+ const out = filterGraph(graph, { kind: 'tip' });
+ const ids = new Set(out.nodes.map((n) => n.id));
+ expect(out.edges.length).toBe(1);
+ for (const e of out.edges) {
+ expect(ids.has(e.from)).toBe(true);
+ expect(ids.has(e.to)).toBe(true);
+ }
+ });
+
+ it('keeps a searched node’s whole neighbourhood, not a line into nowhere', () => {
+ const out = filterGraph(graph, { query: 'atlas' });
+ expect(out.edges).toHaveLength(1);
+ expect(out.nodes.map((n) => n.id).sort()).toEqual(['a', 'b']);
+ });
+
+ it('matches on address as well as name', () => {
+ const g = { nodes: [node({ id: 'w', name: 'HuGq…8WsL', address: 'HuGq9RCPxxxx8WsL' })], edges: [] };
+ expect(filterGraph({ ...g, edges: [{ from: 'w', to: 'w', kinds: ['tip'], count: 1 }] }, { query: '9rcp' }).edges).toHaveLength(1);
+ });
+
+ it('returns an honestly empty graph when nothing matches', () => {
+ const out = filterGraph(graph, { query: 'nothing-here' });
+ expect(out.nodes).toEqual([]);
+ expect(out.edges).toEqual([]);
+ });
+});
+
+describe('recomputeTotals', () => {
+ it('rebuilds per-node numbers from the filtered edges so panels stay truthful', () => {
+ const g = recomputeTotals({
+ nodes: [node({ id: 'a', in_usd: 999 }), node({ id: 'b', in_usd: 999 })],
+ edges: [{ from: 'a', to: 'b', usd: 4, sol: 0.04, count: 3 }],
+ });
+ const a = g.nodes.find((n) => n.id === 'a');
+ const b = g.nodes.find((n) => n.id === 'b');
+ expect(a.out_usd).toBe(4);
+ expect(a.in_usd).toBe(0);
+ expect(b.in_usd).toBe(4);
+ expect(b.in_count).toBe(3);
+ expect(b.partners_in).toBe(1);
+ });
+});
+
+describe('formatters', () => {
+ it('keeps dust legible instead of collapsing it to zero', () => {
+ expect(fmtUsd(0)).toBe('$0');
+ expect(fmtUsd(0.004)).toBe('<$0.01');
+ expect(fmtUsd(-0.004)).toBe('>-$0.01');
+ expect(fmtUsd(24.884)).toBe('$24.88');
+ expect(fmtUsd(1234.5)).toBe('$1,235');
+ expect(fmtUsd(-12.5)).toBe('-$12.50');
+ });
+
+ it('trims SOL without hiding a real balance', () => {
+ expect(fmtSol(0)).toBe('0');
+ expect(fmtSol(0.000123)).toBe('0.000123');
+ expect(fmtSol(0.5)).toBe('0.5');
+ expect(fmtSol(5.120517)).toBe('5.121');
+ });
+
+ it('never rounds a nonzero share down to 0%', () => {
+ expect(fmtPct(0)).toBe('0%');
+ expect(fmtPct(0.002)).toBe('<1%');
+ expect(fmtPct(0.42)).toBe('42%');
+ });
+
+ it('formats relative time and shrugs off a bad timestamp', () => {
+ const now = Date.UTC(2026, 6, 31, 12, 0, 0);
+ expect(relTime(new Date(now - 30_000).toISOString(), now)).toBe('30s ago');
+ expect(relTime(new Date(now - 3 * 3600_000).toISOString(), now)).toBe('3h ago');
+ expect(relTime('not-a-date', now)).toBe('');
+ });
+});
+
+describe('layout', () => {
+ const graph = {
+ nodes: Array.from({ length: 24 }, (_, i) => node({ id: `n${i}`, in_usd: i, out_usd: 24 - i })),
+ edges: Array.from({ length: 23 }, (_, i) => ({ from: `n${i}`, to: `n${i + 1}`, count: 1 + i, usd: i })),
+ };
+
+ it('is deterministic: the same payload and seed lay out identically', () => {
+ const a = createLayout(graph, { seed: 7 });
+ const b = createLayout(graph, { seed: 7 });
+ a.settle(120);
+ b.settle(120);
+ expect([...a.positions().values()]).toEqual([...b.positions().values()]);
+ });
+
+ it('produces a different arrangement for a different seed', () => {
+ const a = createLayout(graph, { seed: 7 });
+ const b = createLayout(graph, { seed: 8 });
+ a.settle(120);
+ b.settle(120);
+ expect([...a.positions().values()]).not.toEqual([...b.positions().values()]);
+ });
+
+ it('settles: motion decays and every coordinate stays finite', () => {
+ const l = createLayout(graph, { seed: 3 });
+ const first = l.step();
+ l.settle(400);
+ const last = l.step();
+ expect(last).toBeLessThan(first);
+ for (const n of l.nodes) {
+ expect(Number.isFinite(n.x)).toBe(true);
+ expect(Number.isFinite(n.y)).toBe(true);
+ }
+ });
+
+ it('pushes co-located nodes apart instead of dividing by zero', () => {
+ // Two nodes seeded at effectively the same point is the case that makes a
+ // naive inverse-square repulsion return Infinity and poison every later frame.
+ const l = createLayout({ nodes: [node({ id: 'x' }), node({ id: 'y' })], edges: [] }, { seed: 1 });
+ l.nodes[0].x = 100; l.nodes[0].y = 100;
+ l.nodes[1].x = 100; l.nodes[1].y = 100;
+ l.step();
+ expect(Number.isFinite(l.nodes[0].x)).toBe(true);
+ expect(Number.isFinite(l.nodes[1].x)).toBe(true);
+ });
+
+ it('drops self-edges and edges naming a node that is not drawn', () => {
+ const l = createLayout({
+ nodes: [node({ id: 'a' })],
+ edges: [{ from: 'a', to: 'a', count: 1 }, { from: 'a', to: 'ghost', count: 1 }],
+ }, { seed: 1 });
+ expect(l.links).toHaveLength(0);
+ });
+
+ it('handles an empty graph without throwing', () => {
+ const l = createLayout({ nodes: [], edges: [] });
+ expect(l.step()).toBe(0);
+ expect(l.settle(10)).toBeGreaterThan(0);
+ expect(l.bounds()).toEqual({ minX: 0, minY: 0, maxX: 900, maxY: 600 });
+ });
+});
+
+describe('sizing and fitting', () => {
+ it('scales node area, not radius, with value', () => {
+ const min = 9;
+ const max = 30;
+ const quarter = nodeRadius(node({ in_usd: 25 }), 100, { min, max });
+ const full = nodeRadius(node({ in_usd: 100 }), 100, { min, max });
+ expect(full).toBeCloseTo(max, 6);
+ // sqrt(1/4) = 1/2 of the span above the floor.
+ expect(quarter).toBeCloseTo(min + (max - min) * 0.5, 6);
+ });
+
+ it('falls back to the floor radius when there is no value to scale against', () => {
+ expect(nodeRadius(node(), 0)).toBe(9);
+ expect(nodeRadius(node({ in_usd: 5 }), 0)).toBe(9);
+ });
+
+ it('centres the fitted graph in the viewport', () => {
+ const t = fitTransform({ minX: 0, minY: 0, maxX: 400, maxY: 400 }, 500, 400, 20);
+ // 400px of content into 360px of usable height.
+ expect(t.scale).toBeCloseTo(0.9, 6);
+ expect(0 * t.scale + t.x).toBeCloseTo(250 - 200 * t.scale, 6);
+ expect(0 * t.scale + t.y).toBeCloseTo(200 - 200 * t.scale, 6);
+ });
+
+ it('clamps zoom so a two-node graph does not fill the screen with two blobs', () => {
+ const t = fitTransform({ minX: 0, minY: 0, maxX: 10, maxY: 10 }, 900, 600, 48);
+ expect(t.scale).toBe(2.2);
+ });
+
+ it('never returns a zero or negative scale for a degenerate bounding box', () => {
+ const t = fitTransform({ minX: 5, minY: 5, maxX: 5, maxY: 5 }, 400, 300);
+ expect(t.scale).toBeGreaterThan(0);
+ expect(Number.isFinite(t.x)).toBe(true);
+ });
+});
+
+describe('seededRandom', () => {
+ it('is reproducible and stays in [0,1)', () => {
+ const a = seededRandom(42);
+ const b = seededRandom(42);
+ for (let i = 0; i < 50; i += 1) {
+ const v = a();
+ expect(v).toBe(b());
+ expect(v).toBeGreaterThanOrEqual(0);
+ expect(v).toBeLessThan(1);
+ }
+ });
+});
+
+describe('helpers', () => {
+ it('reads throughput and net from a partial node without throwing', () => {
+ expect(throughput(undefined)).toBe(0);
+ expect(netUsd({ in_usd: 3 })).toBe(3);
+ });
+});