Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(categories): land the coin category surface, autopilot and wallet-reputation work
nirholas2f3da74b666a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 45987ddcd..db023ecba 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -13,6 +13,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Agent attestations that stopped indexing now recover on their own**: An agent's on-chain attestation history is indexed by walking Solana signatures newer than the last one we recorded. If that recorded signature aged out of the RPC node's history, the walk failed outright and kept failing: the same dead signature was replayed on every run, so that agent's attestations silently stopped appearing on its profile while the scheduled job still reported success. The crawler now recognises that case, re-scans from the most recent signatures instead, and clears the stale marker, so an agent that fell behind catches up by itself on the next pass. `[fix, infra]`- **Agent share cards survive an unconfigured bucket, and a mistyped payment mint is refused instead of listed**: An audit of the agent endpoints turned up four things worth fixing. A skill price set through /api/agents/:id/skills/set-price accepted any text as its payment mint and saved it, so a typo produced a listing nobody could actually pay; it now has to be a real base58 address, matching the other door onto the same table. The agent share page and its OG image used to answer a social crawler with a hard error whenever object storage was not configured, instead of falling back to the plain card they already knew how to draw. A mistyped agent id in the diary, skill-price and screen-push endpoints came back as a server error rather than the plain "that is not an agent id" it is. And an agent screen with no live frame store now tells you the agent is offline right away instead of leaving you on "Connecting" for five minutes. `[fix, improvement]`- **Agent Studio shows your real avatar again, and a shared studio link stops opening the wrong agent**: Four repairs to the Agent Studio. The live stage on the left is meant to be your agent's actual body, but the 3D renderer was leaking its internal debug controls into that panel, including a stray rainbow colour strip painted over the avatar. Those controls are hidden now, everywhere the live agent appears. Second, opening a studio link that names someone else's agent used to quietly load your own agent instead and put it in a full editor under the other agent's address, so any edit went to the wrong record; it now loads the agent the link names and, when it is not yours, says so and offers its public profile. Third, on a phone the five section tabs ran off the edge of the screen, leaving Money and Skills unreachable behind a hidden scrollbar; all five now fit. Finally the status pill on the stage moved to the top so it stops sitting on top of your agent's name, and the walking companion no longer doubles up in the corner on a page that already shows your agent life-size. (`/agent-studio`) `[fix]`+- **Agora citizens show the craft they actually work, and the square fits a phone**: Every one of the 200 citizens in the Commons was labelled a Fetcher. The nameplate over each avatar, the citizen list that screen readers and keyboard users navigate by, and the passport header all read the citizen's capability list rather than the craft it is known for. Every citizen carries the fetcher capability, because calling a paid service is the one job anyone in the Commons can take, so that list always begins with Fetcher no matter who you were looking at. Mira the Appraiser and Aria the Sculptor both wore a FETCHER chip, sitting under a coloured ring that was already showing their real craft. Citizens now say what they do: the crowd, the list and the passport agree with each other and with the colour, and a passport leads with the primary craft before the rest of what that citizen is able to claim. On a phone the bottom of the square was a pile-up. The job board, the sign-in bar, the language switcher and the Enter the Commons button all pinned themselves to the same strip of screen, so at 320px wide the button that takes you into the world was completely buried under two other controls and the board's last rows were cut off. Those layers now stack above one another at every screen size, and the stack follows the sign-in bar as it changes height. (`/agora`) `[fix, improvement]`- **Alpha Co-pilot counts its live launches again, and a mistyped agent ID no longer leaves the last one on stage**: Four things were wrong on the page where your agent reads a launch out loud. The badge next to Live launches, which tells you how many launches are waiting, was always blank: the counter was written inside the heading text, and translating the heading replaced the very element the page updates, so the number was thrown away every time. It now sits beside the heading and survives a switch into any of the 85 languages. Loading an agent that does not exist used to leave the previous agent standing on stage with its launch cards still on screen, and every Ask for a read button on those cards did nothing at all when clicked; the stage is now cleared back to its starting state with a prompt to pick another co-pilot. The buy button in the confirm drawer showed the amount with its unit twice over. And on a local or preview copy of the site the avatar's 3D body failed to load at all, because this page was the only one that did not route model files through the same asset path every other page uses. (`/alpha-copilot`) `[fix]`- **An expired X connection now offers to reconnect instead of sending you to the login page**: Posting a Walk screenshot or clip to X goes through your connected X account. When that connection could no longer be renewed, the share endpoint answered with the same code it uses for a signed-out visitor, so the capture panel told an already signed-in user to sign in to three.ws and linked them to the login page, which fixed nothing. That case now comes back as its own answer with the X connect link attached, and the panel offers a Reconnect X button that takes you straight to the flow that repairs it. The share caption also lost a stray dash. (`/walk`) `[fix]`- **An unsubscribe now sticks, even if you click an old confirm link**: Every three.ws newsletter email carries a confirm link and an unsubscribe link that share one token, so a reader who unsubscribed and later opened an older email and clicked confirm was quietly put back on the list. That link no longer signs anyone up: it says you are unsubscribed and leaves it that way, and opting back in starts from the site. Three other fixes ship alongside it. The allocation planner at /meta-allocator no longer serves an empty basket when the model declines to answer, it falls back to the allocator that always produces a real spread across verified leaders. The motion capture uploader told you an upload link lasted ten minutes when it really lasted five, so a large video queued on that promise could fail with nothing explaining why. And an agent whose stablecoin payment is rejected by the x402 Bazaar now gets the Bazaar's own details back instead of a different server's, so its retry is aimed at the right place. (`/changelog`) `[fix]`@@ -48,6 +49,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **The AGI page no longer goes quiet when its 3D body cannot load**: The AGI page is built around a live 3D body that reacts to the market, and when that model could not be fetched the page said nothing at all. The loading line disappeared on a timer whether or not anything had arrived, so the centrepiece became a silent empty panel with no explanation and no way to try again, while the decision stream and track record beside it carried on as normal. A body that fails to load now falls back to the platform's own avatar, so there is still something on the stage reacting to the agent's mood. If that cannot be fetched either, the stage says so plainly, makes clear that the agent is still trading and that the decisions and track record below are live and unaffected, and offers a button to try embodying again. The loading line now stays up until the body genuinely arrives instead of vanishing early, and the stage no longer re-requests a model it already knows is unreachable every twenty seconds. The page's description shown in search results and link previews was also carrying an older wording than the page itself. (`/agi`) `[fix, improvement]`- **The Animation Gallery keeps its keyboard, its focus, and its promises about what will play**: The gallery of nearly 3,000 motion clips had a set of small breakages that added up. Roughly a third of the mocap catalogue has no picture made for it yet, and the page was asking the picture store for one anyway: every one of those requests came back empty, so a third of the cards spent a request to arrive at the same drawing they now show immediately. Opening a clip's details trapped nobody: pressing Tab walked out of the open window and into the page behind it, and closing the window dropped you back at the very top of the page instead of the card you came from. The playback controls were on show while a preview was still loading and stayed on show when it failed, so there were buttons that did nothing. Arrow keys jumped to the next clip even while you were dragging the speed slider, which moved the slider and changed the clip at the same time. Sharing a filtered view was misleading too: a link carrying the loops or one-shot filter applied it but left the buttons showing All, and a link with a filter the page does not recognise emptied the sort menu. All of it is fixed, along with the keyboard hint the window shows: Space really does play and pause now, from the moment the window opens. (`/animations`) `[fix, improvement]`- **The AWS page stops promising AWS invoicing three.ws does not do, and the GLB optimizer reads compressed avatars again**: Three corrections found by reading the docs pages against the code they describe. The AWS page told you a three.ws subscription would bill usage onto your AWS invoice, draw down AWS credits, and count toward Enterprise Discount Program commitments. None of that is the plan: the Marketplace subscription is free, and usage is paid per call in USDC over x402, exactly as it is for any other caller, so there is nothing to reconcile on your AWS bill at all. The page now says that, and describes the free subscription, the single key that opens every x402 endpoint, and the absence of any trial clock. Separately, the GLB optimization command documented on the 3D asset pipeline page failed on every compressed avatar, which is most of them, because it loaded the glTF extensions without the matching decoders; it now decodes meshopt and Draco and leaves the output as plain glTF the way its own contract promises. The NVIDIA models page also listed the tool-capable fallback model under the wrong vendor prefix. (`/aws`) `[fix, docs]`+- **The BNB Chain page now says how many demos are actually live**: The BNB Chain page checks each of its three demo tracks against the running deployment and reports the tally in its header. That line was stuck: it read "Checking which tracks are live" forever, even once all three cards beside it had finished and said Live. The page's own result was being written first and then overwritten by the translation pass that swaps the page into your language, so the finished count never survived. The header now holds its result and reads "3 of 3 demo tracks live now". The same checks were also leaving four cancelled requests in the browser's network log on every visit, which made a healthy page look like it was failing to anyone with developer tools open. They now close cleanly. (`/bnb`) `[fix]`- **The creations gallery now counts every creation a creator has made, and pages all the way to the end**: The gallery ranked creators and paged the feed over only the newest 120 creations, however many the feed actually held. A creator's older work was invisible in their profile count, the top-creator board scored people on a fraction of their output, and scrolling the gallery dead-ended early with items still left to show. It now reads the full feed depth it always meant to, and does it in two database round trips instead of two per item, so the deeper read loads faster than the shallow one did. (`/creations`) `[fix, improvement]`- **The Forge community board remembers what you liked**: The community showcase on /forge, and the same feed on the daily page and the model explorer, kept showing your own likes as un-liked. The board is held at the edge for a minute so it loads instantly for everyone, but the copy being held was the one built for a visitor who is not you, and it was handed to you as well. Your like button then started from the wrong state, and pressing it again fought with what the server already knew. The board now keeps a separate copy for a signed browser, so the hearts you filled in stay filled. Alongside it, a security fix on the Game-Ready export: when the export was paid for with $THREE rather than covered by holding, a badly formed payment reference made the server answer with the raw internals of its own database instead of a plain "that payment could not be verified". It now says only what a caller needs, and a database problem is no longer reported as a bad payment, so nobody is told to pay twice for an outage on our side. (`/forge`) `[fix, security]`- **The KOL, Loom and marketplace MCP servers now tell you why a call failed, and ship runnable examples**: When a market-data provider was rate-limited, these servers passed back only a bare code like provider_unavailable and threw away the sentence explaining it. They now surface the full reason. The KOL portfolio tool used to answer a provider outage with an empty card that read as a quiet wallet with no trades; it now reports the outage as an outage, so nobody sizes up a trader from a blank. The KOL and Loom packages also gained runnable examples that talk to the live public API, and the naming SDK now answers an unregistered .eth name the same way it answers an unclaimed .sol one, with data instead of an exception. `[fix, sdk]`diff --git a/api/_lib/trust/wallet-reputation.js b/api/_lib/trust/wallet-reputation.jsindex 09d43a5be..81320a561 100644--- a/api/_lib/trust/wallet-reputation.js+++ b/api/_lib/trust/wallet-reputation.js@@ -369,7 +369,16 @@ function buildEvidence(agent, { solRep, registry, holdsThree }) {ev.lineage = { label: 'Fork lineage', href: `/avatars/${agent.avatar_id}` };}if (agent.erc8004_agent_id) {- ev.identity = { label: 'On-chain identity', href: `/agent/${agent.id}/onchain` };+ // The registered identity's public page is the discover detail route+ // (/discover/a/:chainId/:agentId). Without a chain the record predates the+ // unified deploy, so fall back to the agent profile, which mounts the+ // on-chain card. There is no /agent/:id/onchain route.+ ev.identity = {+ label: 'On-chain identity',+ href: agent.chain_id+ ? `/discover/a/${agent.chain_id}/${agent.erc8004_agent_id}`+ : `/agent/${agent.id}`,+ };}if (registry?.count > 0) {ev.registry = { label: 'On-chain reviews', href: '/reputation' };@@ -422,7 +431,11 @@ function buildGuidance(result, inputs, agent) {action: 'verify_identity',label: 'Verify your on-chain identity',detail: 'Register an ERC-8004 identity to add provable trust.',- href: `/agent/${agent.id}/onchain`,+ // /deploy is the ERC-8004 registration wizard; ?avatar= prefills it from+ // this agent's saved avatar so the owner lands on a ready form.+ href: agent.avatar_id+ ? `/deploy?avatar=${encodeURIComponent(agent.avatar_id)}`+ : '/deploy',});}if (inputs.distinctTippers < 3) {diff --git a/api/coin/categories.js b/api/coin/categories.jsindex 65464d19e..639c2a3d8 100644--- a/api/coin/categories.js+++ b/api/coin/categories.js@@ -2,7 +2,7 @@// ---------------------------------------------------------------------------// Crypto category leaderboard for the /categories page. Proxies CoinGecko// /coins/categories?order=market_cap_desc and shapes each row down to the-// fields the page renders — id, name, market cap, 24h market-cap change, 24h+// fields the page renders: id, name, market cap, 24h market-cap change, 24h// volume, and the top-3 coin icons for the avatar stack. Non-finite numbers// collapse to null so the client never renders NaN. Cached 5 min in-memory// + CDN, like the sibling coin endpoints.@@ -26,7 +26,7 @@ function shapeCategory(c) {};}-// Exported for the paid Market Data API (api/_lib/market-data/) — the x402+// Exported for the paid Market Data API (api/_lib/market-data/): the x402// market-categories endpoint sells the same sector leaderboard this page renders.export async function buildCategories() {const raw = await geckoFetch('/coins/categories?order=market_cap_desc', {@@ -58,7 +58,7 @@ export default wrap(async (req, res) => {res,502,'upstream_error',- 'category data is unavailable right now — retry shortly',+ 'category data is unavailable right now, retry shortly',);}});diff --git a/data/changelog.json b/data/changelog.jsonindex eb909c304..d4a121953 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,25 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-08-16",+ "title": "Agora citizens show the craft they actually work, and the square fits a phone",+ "summary": "Every one of the 200 citizens in the Commons was labelled a Fetcher. The nameplate over each avatar, the citizen list that screen readers and keyboard users navigate by, and the passport header all read the citizen's capability list rather than the craft it is known for. Every citizen carries the fetcher capability, because calling a paid service is the one job anyone in the Commons can take, so that list always begins with Fetcher no matter who you were looking at. Mira the Appraiser and Aria the Sculptor both wore a FETCHER chip, sitting under a coloured ring that was already showing their real craft. Citizens now say what they do: the crowd, the list and the passport agree with each other and with the colour, and a passport leads with the primary craft before the rest of what that citizen is able to claim. On a phone the bottom of the square was a pile-up. The job board, the sign-in bar, the language switcher and the Enter the Commons button all pinned themselves to the same strip of screen, so at 320px wide the button that takes you into the world was completely buried under two other controls and the board's last rows were cut off. Those layers now stack above one another at every screen size, and the stack follows the sign-in bar as it changes height.",+ "tags": [+ "fix",+ "improvement"+ ],+ "link": "/agora"+ },+ {+ "date": "2026-08-16",+ "title": "The BNB Chain page now says how many demos are actually live",+ "summary": "The BNB Chain page checks each of its three demo tracks against the running deployment and reports the tally in its header. That line was stuck: it read \"Checking which tracks are live\" forever, even once all three cards beside it had finished and said Live. The page's own result was being written first and then overwritten by the translation pass that swaps the page into your language, so the finished count never survived. The header now holds its result and reads \"3 of 3 demo tracks live now\". The same checks were also leaving four cancelled requests in the browser's network log on every visit, which made a healthy page look like it was failing to anyone with developer tools open. They now close cleanly.",+ "tags": [+ "fix"+ ],+ "link": "/bnb"+ },{"date": "2026-08-16","title": "The agent wallet is usable on a phone again, and visitors see a real balance",diff --git a/pages/autopilot.html b/pages/autopilot.htmlindex 4b2ca28e3..f8211b0f4 100644--- a/pages/autopilot.html+++ b/pages/autopilot.html@@ -287,7 +287,7 @@</div></section>- <div id="toast"></div>+ <div id="toast" role="status" aria-live="polite"></div><script type="module" src="/src/autopilot.js"></script><script src="/brand.js" defer></script>diff --git a/pages/avatar-wallet-chat.html b/pages/avatar-wallet-chat.htmlindex 90d3f3516..2fc80df7d 100644--- a/pages/avatar-wallet-chat.html+++ b/pages/avatar-wallet-chat.html@@ -29,6 +29,16 @@--err: #ff6b6b;--radius: 16px;--shadow: 0 12px 40px rgba(0, 0, 0, 0.45);+ /* Design tokens the shared <lang-switcher> reads, mapped onto this+ page's palette so the picker matches the chip it sits in. */+ --surface-2: rgba(255, 255, 255, 0.04);+ --border: var(--panel-border);+ --border-strong: rgba(255, 255, 255, 0.24);+ --text-2: var(--text-dim);+ /* Widest column the chrome is allowed to stretch to. The page is an+ embeddable widget, so on a desktop-width tab an uncapped chip and+ composer sprawl across 1400px of empty glass. */+ --column: 720px;}* { box-sizing: border-box; }html, body {@@ -73,14 +83,37 @@pointer-events: none;}- /* ── Wallet chip ────────────────────────────────────────────── */- #wallet {+ .sr-only {+ position: absolute; width: 1px; height: 1px;+ padding: 0; margin: -1px; overflow: hidden;+ clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;+ }++ /* ── Top overlay stack ──────────────────────────────────────── */+ /* The wallet chip and the fund hint flow in one column instead of each+ being pinned to its own absolute offset: the chip wraps to a second+ line at phone widths, and a hard-coded `top` for the hint below it+ sat straight on top of the wrapped row. */+ #overlay {position: absolute;top: 14px;left: 14px;right: 14px;+ max-width: var(--column);+ margin-inline: auto;+ display: flex;+ flex-direction: column;+ gap: 10px;+ z-index: 3;+ pointer-events: none;+ }+ #overlay > * { pointer-events: auto; }++ /* ── Wallet chip ────────────────────────────────────────────── */+ #wallet {display: flex;align-items: center;+ flex-wrap: wrap;gap: 12px;padding: 10px 12px;background: rgba(12, 11, 22, 0.62);@@ -89,7 +122,16 @@border: 1px solid var(--panel-border);border-radius: 14px;box-shadow: var(--shadow);- z-index: 3;+ }+ /* The language picker lives in this page's own chrome. i18n.js floats a+ fixed bottom-right fallback only on pages that place no+ <lang-switcher>, and that fallback sat directly on top of the send+ button, leaving the composer's primary action unclickable. */+ #wallet lang-switcher {+ display: inline-flex;+ flex: 0 1 auto;+ min-width: 0;+ max-width: 132px;}#wallet .net {display: inline-flex;@@ -146,9 +188,6 @@/* ── Fund-your-wallet hint (shown when SOL balance is too low tocover an autonomous send, before the user attempts one) ──── */#fund-hint {- position: absolute;- left: 14px; right: 14px;- top: 70px;display: none;align-items: flex-start;gap: 11px;@@ -159,7 +198,6 @@border: 1px solid rgba(255, 184, 92, 0.42);border-radius: 14px;box-shadow: var(--shadow);- z-index: 3;animation: rise 0.25s ease both;}#fund-hint.show { display: flex; }@@ -219,6 +257,9 @@flex: 1 1 auto;overflow-y: auto;padding: 16px;+ width: 100%;+ max-width: var(--column);+ margin-inline: auto;display: flex;flex-direction: column;gap: 12px;@@ -252,6 +293,25 @@}.msg.bot .cursor { display: inline-block; width: 7px; animation: blink 1s steps(2) infinite; }@keyframes blink { 50% { opacity: 0; } }+ /* Failed turn: say what went wrong and give the user the one control+ that fixes it, instead of a dead sentence they have to retype past. */+ .msg.bot.errored { border-color: rgba(255, 107, 107, 0.38); }+ .msg .retry {+ display: inline-flex; align-items: center; gap: 6px;+ margin-top: 9px;+ border: 1px solid var(--panel-border);+ background: transparent;+ color: var(--text);+ border-radius: 999px;+ padding: 6px 12px;+ font: inherit;+ font-size: 13px;+ cursor: pointer;+ transition: background 0.15s, border-color 0.15s, transform 0.1s;+ }+ .msg .retry:hover { background: var(--accent-soft); border-color: var(--accent); }+ .msg .retry:active { transform: scale(0.97); }+ .msg .retry:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }/* IBM Granite Guardian "Trust Layer" notice — shown when an autonomoussend is held server-side before it could move funds. */.gov-chip {@@ -330,11 +390,14 @@.pay a.sig:hover { text-decoration: underline; }/* Composer */+ #composer-bar { border-top: 1px solid var(--panel-border); }#composer {display: flex;gap: 8px;padding: 12px;- border-top: 1px solid var(--panel-border);+ width: 100%;+ max-width: var(--column);+ margin-inline: auto;}#input {flex: 1 1 auto;diff --git a/pages/brain.html b/pages/brain.htmlindex b4e466c71..11de3fbc0 100644--- a/pages/brain.html+++ b/pages/brain.html@@ -10,11 +10,11 @@<link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/manifest.webmanifest" /><meta name="viewport" content="width=device-width, initial-scale=1" />- <title data-i18n="brain.meta_title">Brain · three.ws</title>- <meta name="description" content="Build your AI persona, compare models side-by-side, and test your agent's voice across Claude, GPT, Qwen, and Llama." data-i18n-attr="content:brain.meta_description"/>+ <title data-i18n="brain.meta_title">Multi-LLM Brain · three.ws</title>+ <meta name="description" content="Send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously. Side-by-side streaming with latency and token stats." data-i18n-attr="content:brain.meta_description"/><link rel="canonical" href="https://three.ws/brain" />- <meta property="og:title" content="Brain · three.ws" data-i18n-attr="content:brain.meta_og_title"/>- <meta property="og:description" content="Build a persona from scratch, compare AI models, and give your agent a voice." data-i18n-attr="content:brain.meta_og_description"/>+ <meta property="og:title" content="Multi-LLM Brain · three.ws" data-i18n-attr="content:brain.meta_og_title"/>+ <meta property="og:description" content="Send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously. Side-by-side streaming with latency and token stats." data-i18n-attr="content:brain.meta_og_description"/><meta property="og:url" content="https://three.ws/brain" /><meta name="twitter:card" content="summary_large_image" /><link rel="stylesheet" href="/style.css" />diff --git a/pages/categories.html b/pages/categories.htmlindex d14b0f712..e51403b30 100644--- a/pages/categories.html+++ b/pages/categories.html@@ -61,7 +61,7 @@<link rel="canonical" href="https://three.ws/categories" /><meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" /><meta property="og:locale" content="en_US" />- <meta property="og:image:alt" content="Crypto Categories — three.ws" />+ <meta property="og:image:alt" content="Crypto Categories on three.ws" /><script type="application/ld+json">{@@ -94,7 +94,7 @@</nav><h1 class="cv-h1" data-i18n="categories.crypto_categories">Crypto Categories</h1><p class="cv-sub" data-i18n="categories.every_sector_of_the_market_ranked_by">- Every sector of the market, ranked by market cap — Layer 1s, DeFi, memes, AI, RWAs+ Every sector of the market, ranked by market cap: Layer 1s, DeFi, memes, AI, RWAsand more. See which narratives are leading and lagging, then click through to thecoins that make them up.</p>diff --git a/public/app-next.css b/public/app-next.cssindex c7777b897..60843c37a 100644--- a/public/app-next.css+++ b/public/app-next.css@@ -1664,6 +1664,14 @@ body.app-next-body.nxt-chat-merged .nxt-chat-input-wrap {box-shadow: none;}+/* …but not the focus ring: the rule above outranks the plain :focus-within+ selector, so without this the composer loses every focus cue the moment the+ conversation thread opens. */+body.app-next-body.nxt-chat-merged .nxt-chat-input-wrap:focus-within {+ border-color: rgba(255, 255, 255, 0.45);+ box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.28);+}+/* ── Mobile ────────────────────────────────────────────────────────────── */@media (max-width: 720px) {diff --git a/public/brain.css b/public/brain.cssindex c85c882f4..c5342e616 100644--- a/public/brain.css+++ b/public/brain.css@@ -77,7 +77,21 @@ body {}.br-sess:hover { background: #0e0e0e; color: #b0b0b0; }.br-sess.active { background: #151515; color: #dde0f0; border-color: #222222; }-.br-sess-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.br-sess-name {+ flex: 1;+ min-width: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ background: none;+ border: none;+ padding: 0;+ margin: 0;+ font: inherit;+ color: inherit;+ text-align: left;+ cursor: pointer;+}.br-sess-del {background: none;border: none;diff --git a/public/changelog.json b/public/changelog.jsonindex 1c6f0a5cf..0e38a68ab 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-16T19:29:40.162Z",+ "generated_at": "2026-08-16T19:33:21.877Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -81,6 +81,17 @@"fix"]},+ {+ "date": "2026-08-16",+ "type": "update",+ "title": "Agora citizens show the craft they actually work, and the square fits a phone",+ "summary": "Every one of the 200 citizens in the Commons was labelled a Fetcher. The nameplate over each avatar, the citizen list that screen readers and keyboard users navigate by, and the passport header all read the citizen's capability list rather than the craft it is known for. Every citizen carries the fetcher capability, because calling a paid service is the one job anyone in the Commons can take, so that list always begins with Fetcher no matter who you were looking at. Mira the Appraiser and Aria the Sculptor both wore a FETCHER chip, sitting under a coloured ring that was already showing their real craft. Citizens now say what they do: the crowd, the list and the passport agree with each other and with the colour, and a passport leads with the primary craft before the rest of what that citizen is able to claim. On a phone the bottom of the square was a pile-up. The job board, the sign-in bar, the language switcher and the Enter the Commons button all pinned themselves to the same strip of screen, so at 320px wide the button that takes you into the world was completely buried under two other controls and the board's last rows were cut off. Those layers now stack above one another at every screen size, and the stack follows the sign-in bar as it changes height.",+ "link": "/agora",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-08-16","type": "update",@@ -449,6 +460,16 @@"docs"]},+ {+ "date": "2026-08-16",+ "type": "update",+ "title": "The BNB Chain page now says how many demos are actually live",+ "summary": "The BNB Chain page checks each of its three demo tracks against the running deployment and reports the tally in its header. That line was stuck: it read \"Checking which tracks are live\" forever, even once all three cards beside it had finished and said Live. The page's own result was being written first and then overwritten by the translation pass that swaps the page into your language, so the finished count never survived. The header now holds its result and reads \"3 of 3 demo tracks live now\". The same checks were also leaving four cancelled requests in the browser's network log on every visit, which made a healthy page look like it was failing to anyone with developer tools open. They now close cleanly.",+ "link": "/bnb",+ "tags": [+ "fix"+ ]+ },{"date": "2026-08-16","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex db5fe04f8..a65e048aa 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -62,6 +62,14 @@<category>fix</category><description>Four repairs to the Agent Studio. The live stage on the left is meant to be your agent's actual body, but the 3D renderer was leaking its internal debug controls into that panel, including a stray rainbow colour strip painted over the avatar. Those controls are hidden now, everywhere the live agent appears. Second, opening a studio link that names someone else's agent used to quietly load your own agent instead and put it in a full editor under the other agent's address, so any edit went to the wrong record; it now loads the agent the link names and, when it is not yours, says so and offers its public profile. Third, on a phone the five section tabs ran off the edge of the screen, leaving Money and Skills unreachable behind a hidden scrollbar; all five now fit. Finally the status pill on the stage moved to the top so it stops sitting on top of your agent's name, and the walking companion no longer doubles up in the corner on a page that already shows your agent life-size.</description></item>+ <item>+ <title>Agora citizens show the craft they actually work, and the square fits a phone</title>+ <link>https://three.ws/agora</link>+ <guid isPermaLink="false">2026-08-16:Agora citizens show the craft they actually work, and the square fits a phone</guid>+ <pubDate>Sun, 16 Aug 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Every one of the 200 citizens in the Commons was labelled a Fetcher. The nameplate over each avatar, the citizen list that screen readers and keyboard users navigate by, and the passport header all read the citizen's capability list rather than the craft it is known for. Every citizen carries the fetcher capability, because calling a paid service is the one job anyone in the Commons can take, so that list always begins with Fetcher no matter who you were looking at. Mira the Appraiser and Aria the Sculptor both wore a FETCHER chip, sitting under a coloured ring that was already showing their real craft. Citizens now say what they do: the crowd, the list and the passport agree with each other and with the colour, and a passport leads with the primary craft before the rest of what that citizen is able to claim. On a phone the bottom of the square was a pile-up. The job board, the sign-in bar, the language switcher and the Enter the Commons button all pinned themselves to the same strip of screen, so at 320px wide the button that takes you into the world was completely buried under two other controls and the board's last rows were cut off. Those layers now stack above one another at every screen size, and the stack follows the sign-in bar as it changes height.</description>+ </item><item><title>Alpha Co-pilot counts its live launches again, and a mistyped agent ID no longer leaves the last one on stage</title><link>https://three.ws/alpha-copilot</link>@@ -342,6 +350,14 @@<category>fix</category><description>Three corrections found by reading the docs pages against the code they describe. The AWS page told you a three.ws subscription would bill usage onto your AWS invoice, draw down AWS credits, and count toward Enterprise Discount Program commitments. None of that is the plan: the Marketplace subscription is free, and usage is paid per call in USDC over x402, exactly as it is for any other caller, so there is nothing to reconcile on your AWS bill at all. The page now says that, and describes the free subscription, the single key that opens every x402 endpoint, and the absence of any trial clock. Separately, the GLB optimization command documented on the 3D asset pipeline page failed on every compressed avatar, which is most of them, because it loaded the glTF extensions without the matching decoders; it now decodes meshopt and Draco and leaves the output as plain glTF the way its own contract promises. The NVIDIA models page also listed the tool-capable fallback model under the wrong vendor prefix.</description></item>+ <item>+ <title>The BNB Chain page now says how many demos are actually live</title>+ <link>https://three.ws/bnb</link>+ <guid isPermaLink="false">2026-08-16:The BNB Chain page now says how many demos are actually live</guid>+ <pubDate>Sun, 16 Aug 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The BNB Chain page checks each of its three demo tracks against the running deployment and reports the tally in its header. That line was stuck: it read "Checking which tracks are live" forever, even once all three cards beside it had finished and said Live. The page's own result was being written first and then overwritten by the translation pass that swaps the page into your language, so the finished count never survived. The header now holds its result and reads "3 of 3 demo tracks live now". The same checks were also leaving four cancelled requests in the browser's network log on every visit, which made a healthy page look like it was failing to anyone with developer tools open. They now close cleanly.</description>+ </item><item><title>The creations gallery now counts every creation a creator has made, and pages all the way to the end</title><link>https://three.ws/creations</link>diff --git a/public/features.json b/public/features.jsonindex 56fd2c213..07d1853e4 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-16T19:29:39.995Z",+ "generated_at": "2026-08-16T19:33:21.717Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/locales/en.json b/public/locales/en.jsonindex fc3dd4c41..cffab54bf 100644--- a/public/locales/en.json+++ b/public/locales/en.json@@ -1385,7 +1385,7 @@"immersive": "✦ Immersive","join": "Join","leave_room": "Leave room",- "meta_description": "A live multi-model AR studio: place any number of 3D models and avatars in your real space through your camera, pull in your forge creations or any GLB link, and generate new models with a prompt without leaving the camera view.",+ "meta_description": "A live multi-model AR studio: place any number of 3D models and avatars in your real space through your camera, pull in your forge creations, community models, the CC0 object library, or any GLB link, and generate new models with a prompt without leaving the camera view.","meta_og_description": "Place any number of 3D models in your real space, and forge new ones by prompt without leaving the camera.","meta_og_title": "AR Studio · three.ws","meta_title": "AR Studio · three.ws",diff --git a/src/agora/README.md b/src/agora/README.mdindex ca52c5108..130c4c11b 100644--- a/src/agora/README.md+++ b/src/agora/README.md@@ -45,7 +45,7 @@ Deep links: `?task=<pda>`, `?arena=<pda>`, `?guild=<pda>` (plus `&cluster=`) ope| --- | --- | --- || [api.js](api.js) | `getJson`, `postJson`, `fetchPassport`, `fetchCitizens`, `fetchBoard`, `fetchPulse`, `fetchTask`, `fetchAgent`, `linkIdentity` | Thin client for the read APIs; throws on failure so panels render honest error states || [actions.js](actions.js) | `getMe`, `join`, `postTask`, `hire`, `claim`, `complete`, `vouch` | Authenticated human actions against `POST /api/agora/act` |-| [citizen-avatar.js](citizen-avatar.js) | `CitizenPopulation`, `professionColor`, `buildLabelSprite` | The animated crowd with name + profession labels |+| [citizen-avatar.js](citizen-avatar.js) | `CitizenPopulation`, `professionColor`, `professionLabelFor`, `primaryProfessionKey`, `citizenProfessionLabel`, `buildLabelSprite` | The animated crowd with name + profession labels. Owns the profession vocabulary: colour, display label, and which craft a citizen is *known for*. Read `citizenProfessionLabel(citizen)` rather than `citizen.professions[0]`: that array is the decoded AgenC capability bitmap and every citizen carries the fetcher bit, so its first entry is always Fetcher || [economy-layer.js](economy-layer.js) | `mountEconomyLayer` | Single mount point wiring board + ticker + FX to one pulse poll || [job-board.js](job-board.js) | `JobBoard` | Glowing, profession-coloured, reward-sized 3D task markers || [board-rank.js](board-rank.js) | `rankBoardItems`, `MARKER_BUDGET`, `ROSTER_BUDGET` | Which open jobs earn a marker: on-chain bounties first, then reward order, capped with an honest overflow count |@@ -64,12 +64,14 @@ Deep links: `?task=<pda>`, `?arena=<pda>`, `?guild=<pda>` (plus `&cluster=`) ope| [onchain-presence.js](onchain-presence.js) | `mountOnchainPresence` | Opt-in "Record on-chain (BNB testnet)" toggle + ghost markers from real `Moved` events || [panel.js](panel.js) | `Panel`, `h`, `infoRow`, `copyChip`, `rewardChip` | Accessible side-panel primitives shared by passport and job detail || [format.js](format.js) | `formatThree`, `formatSol`, `shortId`, `timeAgo`, `explorerTxUrl` | Display formatting for atomic amounts, ids, times, Explorer links |-| [professions.js](professions.js) | `professionColor`, `professionLabelFor`, `rewardMagnitude`, `rewardChip` | Profession palette + reward sizing shared by board and crowd |+| [professions.js](professions.js) | `professionColor`, `professionLabelFor`, `primaryProfessionKey`, `citizenProfessionLabel`, `rewardMagnitude`, `rewardChip` | Re-exports the profession vocabulary from [citizen-avatar.js](citizen-avatar.js) and adds reward sizing/formatting on top, so board and crowd share one palette and one set of labels || [glb-viewer.js](glb-viewer.js) | `makeViewer` (default) | Minimal GLB viewer for verified deliverables || [post-form.js](post-form.js) | `buildPostForm` | The post-a-bounty / hire form used by the me-hud drawer |Style modules ([agora.css](agora.css), [economy-layer.css.js](economy-layer.css.js), [trust-surface.css.js](trust-surface.css.js), [arena-guild.css.js](arena-guild.css.js), [humans.css.js](humans.css.js), [player-mode.css.js](player-mode.css.js)) carry each layer's CSS; the `.css.js` files self-inject so a layer ships its own styles.+**The bottom-edge stack.** The Commons is a full-bleed canvas, so several independent layers compete for the bottom of the viewport: the job board panel and the activity ticker ([economy-layer.css.js](economy-layer.css.js)), the humans dock ([humans.css.js](humans.css.js)), the "Enter the Commons" button and the population chip ([agora.css](agora.css)), and the platform language switcher ([src/i18n.js](../i18n.js)). Anything new that pins itself to the bottom must join that stack instead of hard-coding an offset, or it will land on top of a control. The shared tokens are declared and documented at the top of [agora.css](agora.css): `--agora-corner-band`, `--agora-pop-band`, `--agora-dock-floor`, and `--agora-dock-h` (the dock's live measured height, published by [me-hud.js](me-hud.js) through a `ResizeObserver` so the stack follows the dock through every signed-out/signed-in state).+## Backend endpoints consumedAll under [api/agora/[action].js](../../api/agora/%5Baction%5D.js) (reads) and [api/agora/act.js](../../api/agora/act.js) (writes):diff --git a/src/autopilot.js b/src/autopilot.jsindex eabed03f6..8f53dab32 100644--- a/src/autopilot.js+++ b/src/autopilot.js@@ -17,6 +17,13 @@ const $ = (sel, root = document) => root.querySelector(sel);const esc = (s) =>String(s ?? '').replace(/[<>&"]/g, (c) => ({ '<': '<', '>': '>', '&': '&', '"': '"' })[c]);+/** Both columns ship with `aria-busy` set so the skeletons announce as loading.+ * Every render path has to clear it, or a screen reader is told the region is+ * still loading for as long as the tab stays open. */+function settle(el) {+ if (el) el.removeAttribute('aria-busy');+}+function usdcFromAtomics(atomics) {const n = Number(BigInt(atomics || '0')) / 10 ** USDC_DECIMALS;if (!Number.isFinite(n)) return '0';@@ -96,7 +103,7 @@ function narrate(activity, coinsById, agentImage) {}if (!a) {- $('#narratorLine').textContent = 'Standing by — no autonomous actions yet.';+ $('#narratorLine').textContent = 'Standing by. No autonomous actions yet.';$('#narratorLine').className = 'narrator-line';$('#narratorMeta').textContent = 'Your agent will speak here the moment it acts.';return;@@ -127,6 +134,7 @@ function narrate(activity, coinsById, agentImage) {function coinCard(c) {const p = c.policy;const on = p.enabled;+ const label = c.name || c.symbol || 'this coin';const initials = (c.symbol || c.name || 'A').slice(0, 2).toUpperCase();const img = c.image? `<img loading="lazy" decoding="async" src="${esc(c.image)}" alt="" data-fallback="remove">`@@ -136,6 +144,16 @@ function coinCard(c) {: c.stats.progress_pct != null? `<span class="pill paused" title="Bonding-curve progress">${Number(c.stats.progress_pct).toFixed(0)}% to grad</span>`: '';+ // The API reports `configured: false` for a coin with no policy row: it runs+ // on the platform defaults, which is not the same as rules the owner chose.+ // Say so, or an inherited "Autopilot on" reads as a deliberate setting.+ const defaultPill = p.configured+ ? ''+ : `<span class="pill default" data-role="default-pill" title="No rules saved yet. This coin runs on the platform defaults until you change something here.">Defaults</span>`;+ // Field ids are per-coin so the visible "Min" label points at the right input+ // on a page that renders one card per launched coin.+ const bbId = `bb-min-${esc(c.mint)}`;+ const dsId = `ds-min-${esc(c.mint)}`;return `<div class="coin-card ${on ? 'on' : ''}" data-mint="${esc(c.mint)}" data-network="${esc(c.network)}">@@ -150,11 +168,13 @@ function coinCard(c) {</div><div class="coin-status">${gradPill}+ ${defaultPill}<span class="pill ${on ? 'live' : 'paused'}" data-role="status-pill"><span class="dot"></span>${on ? 'Autopilot on' : 'Paused'}</span>+ <span class="save-state" data-role="save-state" role="status" aria-live="polite"></span><label class="sw" title="Master autopilot switch">- <input type="checkbox" data-field="enabled" ${on ? 'checked' : ''}>+ <input type="checkbox" data-field="enabled" aria-label="Autopilot for ${esc(label)}" ${on ? 'checked' : ''}><span class="sw-track"></span></label></div>@@ -171,13 +191,15 @@ function coinCard(c) {<div class="rule ${p.buyback_enabled ? '' : 'off'}" data-rule="buyback"><div class="rule-head"><div><div class="rule-title">Buyback & burn</div></div>- <label class="sw"><input type="checkbox" data-field="buyback_enabled" ${p.buyback_enabled ? 'checked' : ''}><span class="sw-track"></span></label>+ <label class="sw"><input type="checkbox" data-field="buyback_enabled" aria-label="Buyback and burn for ${esc(label)}" ${p.buyback_enabled ? 'checked' : ''}><span class="sw-track"></span></label></div><div class="rule-desc">Spend collected creator fees to buy the token back and burn it once the buyback vault clears your floor.</div><div class="rule-field">- <label>Min</label>+ <label for="${bbId}">Min</label><div class="amt-wrap">- <input type="number" min="0" step="0.01" data-field="buyback_min_usdc" value="${esc(usdcFromAtomics(p.buyback_min_atomics))}">+ <input type="number" min="0" step="0.01" id="${bbId}" data-field="buyback_min_usdc"+ aria-label="Minimum buyback vault balance in USDC before ${esc(label)} buys back"+ value="${esc(usdcFromAtomics(p.buyback_min_atomics))}"><span class="amt-unit">USDC</span></div></div>@@ -187,13 +209,15 @@ function coinCard(c) {<div class="rule ${p.distribute_enabled ? '' : 'off'}" data-rule="distribute"><div class="rule-head"><div><div class="rule-title">Distribute to holders</div></div>- <label class="sw"><input type="checkbox" data-field="distribute_enabled" ${p.distribute_enabled ? 'checked' : ''}><span class="sw-track"></span></label>+ <label class="sw"><input type="checkbox" data-field="distribute_enabled" aria-label="Distribute to holders for ${esc(label)}" ${p.distribute_enabled ? 'checked' : ''}><span class="sw-track"></span></label></div><div class="rule-desc">Push accumulated payment-vault fees out to your configured shareholders once the vault clears your floor.</div><div class="rule-field">- <label>Min</label>+ <label for="${dsId}">Min</label><div class="amt-wrap">- <input type="number" min="0" step="0.01" data-field="distribute_min_usdc" value="${esc(usdcFromAtomics(p.distribute_min_atomics))}">+ <input type="number" min="0" step="0.01" id="${dsId}" data-field="distribute_min_usdc"+ aria-label="Minimum payment vault balance in USDC before ${esc(label)} distributes"+ value="${esc(usdcFromAtomics(p.distribute_min_atomics))}"><span class="amt-unit">USDC</span></div></div>diff --git a/src/avatar-artifact.js b/src/avatar-artifact.jsnew file mode 100644index 000000000..36b806e7b--- /dev/null+++ b/src/avatar-artifact.js@@ -0,0 +1,770 @@+/**+ * /avatar-artifact: the standalone viewer for avatar artifacts.+ *+ * The page is meant to be pasted into another site as a bare iframe, so it+ * carries no wrapper chrome from the app shell and pulls no third-party CDN:+ * three.js ships with the bundle, because an embed host never agreed to a+ * cross-origin script tag.+ *+ * Three modes, one stage. The lighting, ground, fog and drifting motes are+ * shared so a link always lands somewhere composed:+ *+ * ?agent=<uuid> the agent's avatar, resolved live from /api/agents/:id+ * ?model=<url> any GLB on an allowlisted host (mirrors /api/artifact)+ * (no params) the house portrait: a procedural figure that tracks you+ *+ * Failure is designed, never blank: a missing agent, a private avatar, a+ * blocked host and a broken GLB each say what happened and offer the next+ * move. The copy lives on the markup (data-msg-*) so it stays translatable+ * alongside the rest of the page.+ */++import { resolveDevR2Url } from './shared/dev-r2-proxy.js';+import { getMeshoptDecoder } from './viewer/internal.js';++const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;++// Hosts a ?model= URL may point at. Same set the server-side artifact endpoint+// enforces (specs/CLAUDE_ARTIFACT.md) plus the public R2 domain this platform+// actually serves avatars from. Anything else is refused with a designed error+// rather than rendered under the three.ws origin.+const ALLOWED_MODEL_HOSTS = [+ /^[^.]+\.r2\.dev$/,+ /^.+\.r2\.cloudflarestorage\.com$/,+ /^.+\.amazonaws\.com$/,+ /^.+\.cloudfront\.net$/,+ /^storage\.googleapis\.com$/,+ /^.+\.blob\.core\.windows\.net$/,+ /^three\.ws$/,+ /^.+\.vercel\.app$/,+];++const params = new URLSearchParams(location.search);+const agentParam = (params.get('agent') || '').trim();+const modelParam = (params.get('model') || '').trim();++const els = {+ loading: document.getElementById('loading'),+ loadingNote: document.getElementById('loading-note'),+ error: document.getElementById('error'),+ title: document.getElementById('artifact-title'),+ source: document.getElementById('artifact-source'),+};++/** Report a designed failure. `mode` selects the copy authored on #error. */+function fail(mode, action) {+ const detail = mode && els.error ? els.error.dataset[mode] : '';+ window.__avatarArtifactFailed(detail || '', action);+}++/** Replace a translated node's text and drop its key, so i18n can't clobber it. */+function setOwnText(el, text) {+ if (!el) return;+ el.removeAttribute('data-i18n');+ el.textContent = text;+}++function setLoadingNote(text) {+ setOwnText(els.loadingNote, text);+}++// ---------------------------------------------------------------------------+// Artifact resolution: what are we actually rendering?+// ---------------------------------------------------------------------------++/**+ * @returns {Promise<{kind:'house'}|{kind:'model',url:string,name:string,href:string,embed:string}|null>}+ * null means a failure state has already been rendered.+ */+async function resolveArtifact() {+ if (agentParam && modelParam) {+ fail('msgBoth');+ return null;+ }++ if (modelParam) {+ let parsed;+ try {+ parsed = new URL(modelParam, location.href);+ } catch {+ fail('msgModelBlocked');+ return null;+ }+ const sameOrigin = parsed.origin === location.origin;+ const allowed =+ sameOrigin ||+ (parsed.protocol === 'https:' && ALLOWED_MODEL_HOSTS.some((re) => re.test(parsed.hostname)));+ if (!allowed) {+ fail('msgModelBlocked');+ return null;+ }+ return {+ kind: 'model',+ url: parsed.href,+ name: '',+ href: '',+ embed: `?model=${encodeURIComponent(parsed.href)}`,+ };+ }++ if (agentParam) {+ if (!UUID_RE.test(agentParam)) {+ fail('msgNotFound', { href: '/agents', label: els.error?.dataset.actionAgents || '' });+ return null;+ }+ setLoadingNote(els.loading?.dataset.noteAgent || '');++ let payload;+ try {+ const res = await fetch(`/api/agents/${agentParam}`, { headers: { accept: 'application/json' } });+ if (res.status === 404) {+ fail('msgNotFound', { href: '/agents', label: els.error?.dataset.actionAgents || '' });+ return null;+ }+ if (!res.ok) {+ fail('msgAgentFetch', { href: '/agents', label: els.error?.dataset.actionAgents || '' });+ return null;+ }+ payload = await res.json();+ } catch {+ fail('msgAgentFetch', { href: '/agents', label: els.error?.dataset.actionAgents || '' });+ return null;+ }++ const agent = payload?.agent || payload;+ const href = `/agent/${agentParam}`;+ const label = els.error?.dataset.actionProfile || '';+ if (!agent?.id) {+ fail('msgNotFound', { href: '/agents', label: els.error?.dataset.actionAgents || '' });+ return null;+ }+ if (!agent.avatar_model_url) {+ fail(agent.avatar_id ? 'msgAvatarPrivate' : 'msgNoAvatar', { href, label });+ return null;+ }+ return {+ kind: 'model',+ url: agent.avatar_model_url,+ name: agent.name || '',+ href,+ linkLabel: label,+ embed: `?agent=${encodeURIComponent(agentParam)}`,+ };+ }++ return { kind: 'house' };+}++// ---------------------------------------------------------------------------+// Boot+// ---------------------------------------------------------------------------++let THREE;+let GLTFLoader;+let meshoptDecoder;+let fatal = false;++const artifact = await resolveArtifact();+if (artifact) {+ let runtimeReady = false;+ try {+ THREE = await import('three');+ if (artifact.kind === 'model') {+ // Loaded only on the artifact lane: the house portrait is pure geometry+ // and must not pay for a loader it never calls. Meshopt is mandatory+ // here (see the decoder note in src/viewer/internal.js); draco and KTX2+ // are not, because the avatar bake never emits them.+ const [loaderMod, decoder] = await Promise.all([+ import('three/addons/loaders/GLTFLoader.js'),+ getMeshoptDecoder(),+ ]);+ GLTFLoader = loaderMod.GLTFLoader;+ meshoptDecoder = decoder;+ }+ runtimeReady = true;+ } catch {+ // The runtime itself never arrived: the generic "couldn't load" copy.+ window.__avatarArtifactFailed();+ }+ if (runtimeReady) boot(artifact);+}++function boot(artifact) {+ const W = window.innerWidth,+ H = window.innerHeight;+ const scene = new THREE.Scene();+ const camera = new THREE.PerspectiveCamera(42, W / H, 0.1, 100);+ camera.position.set(0, 1.6, 4.2);+ camera.lookAt(0, 1.6, 0);++ // Coarse pointer (phones/tablets) -> lighter render: fewer DPR samples+ // and no shadow pass, so the canvas stays smooth on mobile GPUs.+ const isCoarse = window.matchMedia && window.matchMedia('(pointer: coarse)').matches;+ const reduceMotion =+ window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;++ let renderer;+ try {+ renderer = new THREE.WebGLRenderer({ antialias: !isCoarse, alpha: true });+ } catch {+ // No WebGL context available: show the designed error state.+ fail('msgNoWebgl');+ return;+ }+ renderer.setSize(W, H);+ renderer.setPixelRatio(Math.min(devicePixelRatio, isCoarse ? 1.5 : 2));+ renderer.shadowMap.enabled = !isCoarse;+ document.body.appendChild(renderer.domElement);++ // Lights. Intensities are in physical units (three r155+ dropped the+ // legacy PI scaling), so they read high next to the old CDN build.+ scene.add(new THREE.AmbientLight(0x2a2a5a, 3.8));++ const key = new THREE.DirectionalLight(0x99aaff, 6.9);+ key.position.set(2, 5, 4);+ key.castShadow = true;+ scene.add(key);++ const rim = new THREE.PointLight(0xff4488, 22, 10, 1.4);+ rim.position.set(-3, 2, -1);+ scene.add(rim);++ const fill = new THREE.PointLight(0x4488ff, 12, 8, 1.4);+ fill.position.set(3, 0, 2);+ scene.add(fill);++ // Ground plane (subtle)+ const ground = new THREE.Mesh(+ new THREE.CircleGeometry(3, 48),+ new THREE.MeshStandardMaterial({ color: 0x0a0a20, roughness: 0.9, metalness: 0.1 }),+ );+ ground.rotation.x = -Math.PI / 2;+ ground.receiveShadow = true;+ scene.add(ground);++ // Fog+ scene.fog = new THREE.FogExp2(0x070714, 0.06);++ // Particles+ const pCount = 120;+ const pPos = new Float32Array(pCount * 3);+ const pVel = new Float32Array(pCount);+ for (let i = 0; i < pCount; i++) {+ pPos[i * 3] = (Math.random() - 0.5) * 8;+ pPos[i * 3 + 1] = Math.random() * 5;+ pPos[i * 3 + 2] = (Math.random() - 0.5) * 8;+ pVel[i] = 0.003 + Math.random() * 0.008;+ }+ const pGeo = new THREE.BufferGeometry();+ pGeo.setAttribute('position', new THREE.BufferAttribute(pPos, 3));+ const pMat = new THREE.PointsMaterial({+ color: 0x6699ff,+ size: 0.04,+ transparent: true,+ opacity: 0.55,+ });+ const pts = new THREE.Points(pGeo, pMat);+ scene.add(pts);++ // Input tracking (mouse, touch, keyboard). Every modality drives one+ // normalized look-target, so the house portrait's gaze and the artifact+ // turntable share a single code path.+ const mouse = { x: 0, y: 0 };+ let keyTarget = null; // when set, keyboard overrides pointer++ function aim(clientX, clientY) {+ mouse.x = (clientX / window.innerWidth - 0.5) * 2;+ mouse.y = (clientY / window.innerHeight - 0.5) * 2;+ }++ window.addEventListener('mousemove', (e) => {+ keyTarget = null;+ aim(e.clientX, e.clientY);+ });++ // Touch: track a finger drag so the portrait is interactive on phones.+ window.addEventListener(+ 'touchmove',+ (e) => {+ const tch = e.touches && e.touches[0];+ if (!tch) return;+ keyTarget = null;+ aim(tch.clientX, tch.clientY);+ },+ { passive: true },+ );++ const canvasEl = renderer.domElement;+ canvasEl.tabIndex = 0;+ canvasEl.setAttribute('role', 'img');+ canvasEl.setAttribute(+ 'aria-label',+ document.body.dataset.canvasLabel ||+ 'Interactive 3D avatar that follows your cursor, touch, or arrow keys',+ );++ // Zoom lives on the artifact lane only: the house portrait is framed as a+ // portrait and has nothing to inspect closer.+ let zoom = 1;+ const ZOOM_MIN = 0.55;+ const ZOOM_MAX = 2.4;+ function nudgeZoom(delta) {+ zoom = Math.max(ZOOM_MIN, Math.min(ZOOM_MAX, zoom * delta));+ }++ // Keyboard: arrow keys and WASD nudge the gaze, so the viewer is+ // usable without a pointer. Only the arrows suppress their default+ // (scrolling); the letters stay available to the browser.+ const KEY_STEP = 0.25;+ const KEY_MAP = {+ arrowleft: [-1, 0],+ a: [-1, 0],+ arrowright: [1, 0],+ d: [1, 0],+ arrowup: [0, -1],+ w: [0, -1],+ arrowdown: [0, 1],+ s: [0, 1],+ };+ window.addEventListener('keydown', (e) => {+ if (e.metaKey || e.ctrlKey || e.altKey) return;+ const target = e.target;+ // Never steal a keystroke aimed at the embed field or a control.+ if (target && (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA')) return;+ const k = e.key.toLowerCase();+ if (artifact.kind === 'model' && (k === '+' || k === '=' || k === '-' || k === '_')) {+ e.preventDefault();+ nudgeZoom(k === '-' || k === '_' ? 1.12 : 0.89);+ return;+ }+ const v = KEY_MAP[k];+ if (!v) return;+ if (k.startsWith('arrow')) e.preventDefault();+ if (!keyTarget) keyTarget = { x: mouse.x, y: mouse.y };+ keyTarget.x = Math.max(-1, Math.min(1, keyTarget.x + v[0] * KEY_STEP));+ keyTarget.y = Math.max(-1, Math.min(1, keyTarget.y + v[1] * KEY_STEP));+ mouse.x = keyTarget.x;+ mouse.y = keyTarget.y;+ });++ const stage =+ artifact.kind === 'model'+ ? buildArtifactStage(scene, camera, renderer, artifact)+ : buildHousePortrait(scene);++ // Animate+ let t = 0;+ let firstFramePainted = false;++ function frame() {+ t += 0.016;+ stage.update(t, mouse, zoom, reduceMotion);++ // Particles drift upward+ if (!reduceMotion) {+ const pos = pGeo.attributes.position;+ for (let i = 0; i < pCount; i++) {+ pos.array[i * 3 + 1] += pVel[i];+ if (pos.array[i * 3 + 1] > 5) pos.array[i * 3 + 1] = 0;+ }+ pos.needsUpdate = true;+ pts.rotation.y += 0.0006;+ }++ renderer.render(scene, camera);++ // Fade out the loading overlay once the first frame is on screen. The+ // artifact lane holds the overlay until its GLB has actually arrived,+ // so an empty stage is never mistaken for a finished render.+ if (!firstFramePainted && stage.ready()) {+ firstFramePainted = true;+ window.__avatarArtifactPainted = true;+ clearTimeout(window.__avatarArtifactWatchdog);+ // A slow runtime can trip the watchdog and still arrive; the+ // error state must not outlive a working scene.+ document.getElementById('error')?.setAttribute('hidden', '');+ const loading = document.getElementById('loading');+ if (loading) {+ loading.classList.add('fade');+ setTimeout(() => loading.setAttribute('hidden', ''), 450);+ }+ }+ }++ renderer.setAnimationLoop(frame);++ if (artifact.kind === 'model') {+ // Wheel zoom is non-passive on purpose: an embedded viewer that scrolled+ // its host page while you inspected a model would be hostile.+ window.addEventListener(+ 'wheel',+ (e) => {+ e.preventDefault();+ nudgeZoom(e.deltaY > 0 ? 1.08 : 0.93);+ },+ { passive: false },+ );+ }++ // A hidden tab has nothing to animate: stop the loop so an embedded+ // viewer never burns a host page's GPU in the background. Same reason the+ // loop never restarts after a fatal load error: the error overlay is opaque,+ // so every frame under it would be pure waste on someone else's page.+ document.addEventListener('visibilitychange', () => {+ renderer.setAnimationLoop(document.hidden || fatal ? null : frame);+ });++ // Keep the canvas matched to the viewport (handles orientation changes+ // and mobile browser-chrome resize, not just desktop window drags).+ function onResize() {+ const w = window.innerWidth,+ h = window.innerHeight;+ camera.aspect = w / h;+ camera.updateProjectionMatrix();+ renderer.setSize(w, h);+ }+ window.addEventListener('resize', onResize);+ window.addEventListener('orientationchange', onResize);+}++// ---------------------------------------------------------------------------+// The artifact lane: a real GLB on a turntable+// ---------------------------------------------------------------------------++function buildArtifactStage(scene, camera, renderer, artifact) {+ // PBR glTF materials are authored for a filmic response; the house portrait+ // is hand-lit and keeps the linear default.+ renderer.toneMapping = THREE.ACESFilmicToneMapping;+ renderer.toneMappingExposure = 1.05;++ const pivot = new THREE.Group();+ scene.add(pivot);++ let mixer = null;+ let loaded = false;+ let focusY = 1.0;+ let baseDist = 3.2;+ let yaw = 0;+ let pitch = 0;++ if (artifact.name) {+ setOwnText(els.title, artifact.name);+ document.title = `${artifact.name} · Avatar Artifact · three.ws`;+ }+ if (artifact.href && els.source) {+ els.source.href = artifact.href;+ if (artifact.linkLabel) setOwnText(els.source, artifact.linkLabel);+ els.source.removeAttribute('hidden');+ }+ window.__avatarArtifactSetEmbed?.(artifact.embed);+ setLoadingNote(els.loading?.dataset.noteModel || '');++ const loader = new GLTFLoader();+ // three.ws avatars ship with EXT_meshopt_compression; without this decoder+ // every one of them fails to parse.+ loader.setMeshoptDecoder(meshoptDecoder);++ loader.load(+ resolveDevR2Url(artifact.url),+ (gltf) => {+ const root = gltf.scene || gltf.scenes?.[0];+ if (!root) {+ fail('msgModelFailed');+ return;+ }+ root.traverse((node) => {+ if (!node.isMesh) return;+ node.castShadow = true;+ node.receiveShadow = true;+ });++ // Normalize to a portrait-sized subject so one stage frames every+ // artifact, from a 20 cm prop to a 6 m mech.+ const box = new THREE.Box3().setFromObject(root);+ const size = box.getSize(new THREE.Vector3());+ const center = box.getCenter(new THREE.Vector3());+ const height = Math.max(size.y, 1e-3);+ const scale = 1.8 / height;+ root.scale.setScalar(scale);+ root.position.set(-center.x * scale, -(center.y - size.y / 2) * scale, -center.z * scale);+ pivot.add(root);++ const radius = Math.max(size.x, size.z, size.y) * scale;+ focusY = 0.95;+ baseDist = Math.max(2.6, radius * 1.55);++ if (gltf.animations?.length) {+ mixer = new THREE.AnimationMixer(root);+ const clip =+ gltf.animations.find((c) => /idle|breath|stand/i.test(c.name || '')) ||+ gltf.animations[0];+ mixer.clipAction(clip).play();+ }+ loaded = true;+ },+ (progress) => {+ if (!progress?.lengthComputable || !els.loading?.dataset.noteProgress) return;+ const pct = Math.min(99, Math.round((progress.loaded / progress.total) * 100));+ setLoadingNote(els.loading.dataset.noteProgress.replace('{pct}', String(pct)));+ },+ () => {+ fail(+ 'msgModelFailed',+ artifact.href ? { href: artifact.href, label: artifact.linkLabel || '' } : null,+ );+ },+ );++ const clock = new THREE.Clock();++ return {+ ready: () => loaded,+ update(t, mouse, zoom, reduceMotion) {+ if (mixer) mixer.update(clock.getDelta());++ // Turntable: the shared look-target orbits the camera instead of+ // turning a head, because an arbitrary GLB has no head to turn.+ const targetYaw = mouse.x * Math.PI * 0.55;+ const targetPitch = Math.max(-0.35, Math.min(0.85, -mouse.y * 0.55));+ yaw += (targetYaw - yaw) * 0.06;+ pitch += (targetPitch - pitch) * 0.06;++ const drift = reduceMotion ? 0 : Math.sin(t * 0.25) * 0.08;+ const r = baseDist * zoom;+ const cp = Math.cos(pitch);+ camera.position.set(+ Math.sin(yaw + drift) * r * cp,+ focusY + Math.sin(pitch) * r,+ Math.cos(yaw + drift) * r * cp,+ );+ camera.lookAt(0, focusY, 0);+ },+ };+}++// ---------------------------------------------------------------------------+// The house portrait: the artifact the page is itself+// ---------------------------------------------------------------------------++function buildHousePortrait(scene) {+ // Materials+ const skinMat = new THREE.MeshStandardMaterial({+ color: 0x7ba3d4,+ roughness: 0.25,+ metalness: 0.05,+ });+ const darkMat = new THREE.MeshStandardMaterial({+ color: 0x0d1a2e,+ roughness: 0.2,+ metalness: 0.6,+ });+ const irisMat = new THREE.MeshStandardMaterial({+ color: 0x55aaff,+ roughness: 0.05,+ metalness: 0.3,+ emissive: 0x1144cc,+ emissiveIntensity: 0.6,+ });+ const suitMat = new THREE.MeshStandardMaterial({+ color: 0x1a2540,+ roughness: 0.6,+ metalness: 0.3,+ });+ const glareMat = new THREE.MeshStandardMaterial({+ color: 0xffffff,+ roughness: 0,+ metalness: 0,+ transparent: true,+ opacity: 0.55,+ });++ // Avatar+ const avatar = new THREE.Group();+ scene.add(avatar);++ // Torso+ const torsoMesh = new THREE.Mesh(new THREE.CylinderGeometry(0.38, 0.32, 1.0, 20), suitMat);+ torsoMesh.position.y = 0.82;+ torsoMesh.castShadow = true;+ avatar.add(torsoMesh);++ // Neck+ const neck = new THREE.Mesh(new THREE.CylinderGeometry(0.17, 0.19, 0.28, 16), skinMat);+ neck.position.y = 1.47;+ avatar.add(neck);++ // Head group (rotates for gaze tracking)+ const headGroup = new THREE.Group();+ headGroup.position.y = 1.94;+ avatar.add(headGroup);++ const headMesh = new THREE.Mesh(new THREE.SphereGeometry(0.52, 40, 40), skinMat);+ headMesh.scale.set(1, 1.08, 0.96);+ headMesh.castShadow = true;+ headGroup.add(headMesh);++ // Eyes+ function makeEye(x) {+ const group = new THREE.Group();+ group.position.set(x, 0.06, 0.44);++ // White+ const white = new THREE.Mesh(+ new THREE.SphereGeometry(0.105, 20, 20),+ new THREE.MeshStandardMaterial({ color: 0xddeeff, roughness: 0.3, metalness: 0 }),+ );+ group.add(white);++ // Iris+ const iris = new THREE.Mesh(new THREE.SphereGeometry(0.065, 16, 16), irisMat);+ iris.position.z = 0.055;+ group.add(iris);++ // Pupil+ const pupil = new THREE.Mesh(new THREE.SphereGeometry(0.036, 12, 12), darkMat);+ pupil.position.z = 0.088;+ group.add(pupil);++ // Glare+ const glare = new THREE.Mesh(new THREE.SphereGeometry(0.014, 8, 8), glareMat);+ glare.position.set(0.022, 0.025, 0.1);+ group.add(glare);++ return group;+ }++ headGroup.add(makeEye(-0.185), makeEye(0.185));++ // Eyelids: a blink is a Y scale on these caps.+ function makeLid(x) {+ const lid = new THREE.Mesh(+ new THREE.SphereGeometry(0.112, 20, 10, 0, Math.PI * 2, 0, Math.PI * 0.5),+ new THREE.MeshStandardMaterial({+ color: 0x6a95c0,+ roughness: 0.3,+ side: THREE.FrontSide,+ }),+ );+ lid.position.set(x, 0.06, 0.43);+ lid.rotation.x = Math.PI;+ lid.scale.y = 0.01; // open; blinking animates this to 1+ return lid;+ }+ const leftLid = makeLid(-0.185);+ const rightLid = makeLid(0.185);+ headGroup.add(leftLid, rightLid);++ // Eyebrows+ function makeBrow(x) {+ const geo = new THREE.BoxGeometry(0.16, 0.03, 0.04);+ const brow = new THREE.Mesh(+ geo,+ new THREE.MeshStandardMaterial({ color: 0x3a6090, roughness: 0.5 }),+ );+ brow.position.set(x, 0.215, 0.455);+ brow.rotation.z = x > 0 ? -0.12 : 0.12;+ return brow;+ }+ headGroup.add(makeBrow(-0.185), makeBrow(0.185));++ // Nose+ const noseMesh = new THREE.Mesh(new THREE.SphereGeometry(0.07, 12, 12), skinMat);+ noseMesh.scale.set(0.7, 0.65, 0.8);+ noseMesh.position.set(0, -0.07, 0.5);+ headGroup.add(noseMesh);++ // Mouth+ const mouthGeo = new THREE.TorusGeometry(0.1, 0.025, 8, 20, Math.PI);+ const mouth = new THREE.Mesh(+ mouthGeo,+ new THREE.MeshStandardMaterial({ color: 0x3a5a80, roughness: 0.5 }),+ );+ mouth.position.set(0, -0.2, 0.46);+ mouth.rotation.z = Math.PI;+ headGroup.add(mouth);++ // Shoulders / arms+ function makeArm(x) {+ const arm = new THREE.Mesh(new THREE.CylinderGeometry(0.11, 0.09, 0.75, 14), suitMat);+ arm.position.set(x, 0.85, 0);+ arm.rotation.z = x > 0 ? -0.35 : 0.35;+ arm.castShadow = true;+ return arm;+ }+ avatar.add(makeArm(-0.52), makeArm(0.52));++ // Shoulder pads+ function makePad(x) {+ const pad = new THREE.Mesh(new THREE.SphereGeometry(0.18, 16, 16), suitMat);+ pad.scale.set(1, 0.7, 1);+ pad.position.set(x, 1.3, 0);+ return pad;+ }+ avatar.add(makePad(-0.52), makePad(0.52));++ // Chest detail (glowing panel)+ const panelMat = new THREE.MeshStandardMaterial({+ color: 0x1155cc,+ emissive: 0x0033aa,+ emissiveIntensity: 1.2,+ roughness: 0.2,+ });+ const panel = new THREE.Mesh(new THREE.BoxGeometry(0.22, 0.14, 0.04), panelMat);+ panel.position.set(0, 0.88, 0.37);+ avatar.add(panel);++ let blinkTimer = 0;+ let blinkInterval = 3 + Math.random() * 3;+ let blinking = false;+ let blinkT = 0;+ const targetHeadRot = { x: 0, y: 0 };+ const currentHeadRot = { x: 0, y: 0 };++ return {+ // Geometry, not a download: on screen the moment the first frame renders.+ ready: () => true,+ update(t, mouse, _zoom, reduceMotion) {+ // Breathing+ const breathe = reduceMotion ? 0 : Math.sin(t * 1.15) * 0.025;+ torsoMesh.scale.y = 1 + breathe;+ torsoMesh.position.y = 0.82 + breathe * 0.3;++ // Chest glow pulse+ panelMat.emissiveIntensity = reduceMotion ? 1.0 : 1.0 + Math.sin(t * 2.3) * 0.3;++ // Head follows the look-target (smoothed)+ targetHeadRot.y = mouse.x * 0.35;+ targetHeadRot.x = -mouse.y * 0.2;+ currentHeadRot.x += (targetHeadRot.x - currentHeadRot.x) * 0.06;+ currentHeadRot.y += (targetHeadRot.y - currentHeadRot.y) * 0.06;+ headGroup.rotation.x = currentHeadRot.x;+ headGroup.rotation.y = currentHeadRot.y;++ // Idle body sway+ avatar.rotation.y = reduceMotion ? 0 : Math.sin(t * 0.35) * 0.06;++ // Blink+ if (reduceMotion) return;+ blinkTimer += 0.016;+ if (!blinking && blinkTimer > blinkInterval) {+ blinking = true;+ blinkT = 0;+ blinkInterval = 2.5 + Math.random() * 4;+ blinkTimer = 0;+ }+ if (!blinking) return;+ blinkT += 0.016;+ const half = 0.09;+ const progress =+ blinkT < half ? blinkT / half : blinkT < half * 2 ? 1 - (blinkT - half) / half : -1;+ if (progress < 0) {+ leftLid.scale.y = 0.01;+ rightLid.scale.y = 0.01;+ blinking = false;+ } else {+ leftLid.scale.y = progress;+ rightLid.scale.y = progress;+ }+ },+ };+}diff --git a/src/brain.js b/src/brain.jsindex c193b952a..b6ae5480b 100644--- a/src/brain.js+++ b/src/brain.js@@ -308,6 +308,25 @@ function applyArchetype(index) {autoSavePersonaToAgent(archetype.label);}+// Clearing has to unwind every surface the persona lit up. The sidebar used to+// run its own shorter version and left the status bar, the persona card and the+// selected archetype chip behind, all describing a persona that no longer+// existed.+function clearPersona() {+ state.persona = null;+ persistPersona();+ $('brPersonaCard').classList.remove('show');+ $('brStatusBar').classList.remove('show');+ $('brToggleAdvanced').textContent = 'Customize';+ document.querySelectorAll('.br-archetype-chip').forEach(chip => {+ chip.classList.remove('selected');+ chip.setAttribute('aria-pressed', 'false');+ });+ updatePersonaMini();+ updatePersonaBanner();+ toast('Persona cleared');+}+function showAuthGate() {let gate = $('brAuthGate');if (gate) { gate.style.display = ''; return; }@@ -587,9 +606,9 @@ function renderSidebar() {return;}el.innerHTML = state.sessions.map(s => `- <div class="br-sess${s.id === state.currentId ? ' active' : ''}" data-id="${escHtml(s.id)}">- <span class="br-sess-name">${escHtml(s.name)}</span>- <button class="br-sess-del" data-del="${escHtml(s.id)}" title="Delete">x</button>+ <div class="br-sess${s.id === state.currentId ? ' active' : ''}">+ <button type="button" class="br-sess-name" data-id="${escHtml(s.id)}"${s.id === state.currentId ? ' aria-current="true"' : ''}>${escHtml(s.name)}</button>+ <button type="button" class="br-sess-del" data-del="${escHtml(s.id)}" title="Delete session" aria-label="Delete session ${escHtml(s.name)}">x</button></div>`).join('');}@@ -1170,16 +1189,7 @@ function bindEvents() {card.classList.toggle('show', !isOpen);$('brToggleAdvanced').textContent = isOpen ? 'Customize' : 'Done';});- $('brResetPersona').addEventListener('click', () => {- state.persona = null;- persistPersona();- $('brPersonaCard').classList.remove('show');- $('brStatusBar').classList.remove('show');- document.querySelectorAll('.br-archetype-chip').forEach(c => c.classList.remove('selected'));- updatePersonaMini();- updatePersonaBanner();- toast('Persona cleared');- });+ $('brResetPersona').addEventListener('click', clearPersona);// Agent switcher — persist selection and re-save persona if one is active$('brAgentSelect').addEventListener('change', () => {@@ -1189,13 +1199,7 @@ function bindEvents() {// Sidebar: build persona shortcut$('brBuildPersonaBtn').addEventListener('click', () => setTab('persona'));- $('brMiniClear').addEventListener('click', () => {- state.persona = null;- persistPersona();- updatePersonaMini();- updatePersonaBanner();- toast('Persona cleared');- });+ $('brMiniClear').addEventListener('click', clearPersona);// Playground mode toggledocument.querySelectorAll('.br-mode-btn').forEach(b => {diff --git a/src/categories.css b/src/categories.cssindex 21ab02b62..a46c4c141 100644--- a/src/categories.css+++ b/src/categories.css@@ -1,5 +1,5 @@/*- * /categories — sector leaderboard. Reuses the shared cv-table / cv-stat-card+ * /categories: sector leaderboard. Reuses the shared cv-table / cv-stat-card* system from coin-pages.css; this file adds only the stacked top-3 coin* avatars that identify each category in the name cell.*/