Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(build): the shared cache no longer breaks the frontend bundle

nirholas5cbdefdd2557
diff --git a/.gcloudignore b/.gcloudignore
index 54a0f1ca0..526bdd971 100644
--- a/.gcloudignore
+++ b/.gcloudignore
@@ -57,3 +57,11 @@
# Re-exclude heavy/derived paths even inside the re-included directories.
**/node_modules/
.git/
+# Python virtualenvs and caches inside the GPU workers. These are gitignored, so
+# a clean `git worktree` deploy (the runbook path) never sees them, but a submit
+# straight from a working directory would upload thousands of files: one
+# workers/avatar-reconstruction/.venv-eval alone accounts for most of the ~10.5k
+# files workers/ contributes. Verify with `npm run check:gcloudignore`.
+**/.venv*/
+**/__pycache__/
+**/*.pyc
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 10eef5374..5476af549 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,10 +14,14 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Avatars now look where they should and stand properly on uneven ground** — Two things every avatar on three.ws was missing, because a recorded animation clip cannot know about them. First, gaze: the corner walk companion now follows your cursor with its chest, neck and head, and agents can be told to look at a point in the world or at whoever is watching, holding that gaze while you orbit the camera. The turn is shared across three joints rather than cranking the head alone, which is the difference between a person glancing over and an owl. Asking an agent to look somewhere used to be accepted and then quietly ignored; it works now. Second, footing: in the walkaround world each foot lands on the patch of ground actually beneath it instead of one floating above a slope while the other sinks into it. The avatar's hips settle just enough for the downhill leg to reach, and the walk cycle's own foot lift is left intact, so it still reads as walking rather than sliding. Both effects work on any humanoid avatar, including ones you generated yourself, and both bow out cleanly on avatars that cannot support them and when you have asked for reduced motion. (`/walk`) `[feature, improvement]`
- **Background jobs no longer pause themselves against a storage limit that was not real** — A safety valve pauses data-heavy background jobs when the database approaches its storage ceiling. The ceiling it was checking had been set by hand and no longer matched the actual database plan, which is far larger, so the valve was tripping on a limit that did not exist and pausing dozens of jobs a minute, including the one that keeps the payment wallets funded. The threshold now reflects the real capacity, with months of headroom, and the valve remains in place as a genuine backstop. `[fix, infra]`
- **Category pages keep working when the market data provider rate-limits us** — Every coin category page (layer-1, AI tokens, meme tokens and the rest) is built from one upstream market data provider, because it is the only free source that knows which coins belong to which sector. Whenever that provider throttled us, those pages returned an error and showed nothing at all, while the main coins table stayed up because it has a second source to fall back on. Category pages now fall back to the most recent real data they successfully loaded, clearly marked as of when it was fetched, and switch back to live figures the moment the provider recovers. Nothing is invented: a category we have never loaded still reports the outage honestly rather than showing a made-up table. `[fix, improvement]`
+- **Chat now forges and displays 3D models right in the conversation** — Ask the chat at three.ws/chat for a 3D model and it generates one with the free Forge lane, streams live progress in place, and then renders the finished model as an interactive viewer inside the thread: orbit and zoom it, play its animations, toggle the skeleton on rigged avatars, download the GLB, or open it in AR. Pasting a link to any .glb file now shows the model the same way, even when the file's host would normally block the browser from reading it. Previously 3D results only appeared inside a boxed-in web page you had to click into. (`/chat`) `[feature, improvement]`
+- **Coin pages stay up when the market data provider rate-limits us** — The price chart, profile and exchange listings on a coin page all came from one provider, so whenever it throttled our requests the whole page went down at once, for hours. Each of those now has a live backup: charts fall back to exchange candles for the majors and an on-chain price oracle for every other coin, while the profile and market listings fall back to a second data provider. When a backup is answering, the page says so at the bottom instead of quietly leaving numbers blank, and columns the backup cannot fill are hidden rather than shown as a row of dashes. Two small honesty fixes came with it: a follower count of zero now means "not tracked" and is left out rather than stated as zero, and a price change the backup does not actually compute is no longer drawn as a flat 0.00%. (`/coins`) `[fix, improvement]`
+- **Concierge demo and the 3D home demo both work again** — The live widget on the Concierge page failed to start because the page ran its setup before the widget code had finished loading, leaving visitors with a dead demo on the page that sells it. The /demos/3d-home animated avatar demo never rendered its character either: the model uses compressed geometry and the page was loading it without the matching decoder. Both now load, animate, and respond as intended. (`/concierge`) `[fix]`
- **Ethereum name lookups work again** — Looking up an .eth name through the public name resolver had stopped working: every request sat there for about ten seconds and then came back as an error, while .sol names resolved fine. Two things were wrong. The Ethereum node we asked first had started refusing our requests outright, and because it was first in line every lookup wasted a full round trip on it before trying anywhere else. On top of that, the lookup itself was asking the network four or five separate questions in sequence when one would do. Nodes known to refuse us are now tried last instead of first, and a name lookup is a single question. An .eth name now resolves in about a quarter of a second, and a name that genuinely does not exist comes back as a clean not-found instead of a timeout. (`/crypto-api`) `[fix]`
- **Every x402 payment now settles against its own Solana transaction** — An audit of our payment facilitator found that about one in five recorded settlements shared an on-chain transaction with another settlement. Solana signatures are deterministic, so two payments of the same amount, from the same wallet, to the same endpoint, built in the same short window could compile to a byte-for-byte identical transaction. Only one of them could ever land on chain, and the facilitator was crediting the others against it. Settlement is now claimed atomically: one transaction settles at most one payment, a genuine retry is recognised and answered without double-charging, and anything else is refused rather than credited. The payment builder also draws from a signature space about four thousand times larger, at no extra fee, so identical transactions are no longer built in the first place. A new hourly audit watches the invariant and raises an alert if it is ever violated again. `[fix, infra, security]`
- **Fact checks that used to time out now come back with their sources** — Some fact checks were taking so long that the request was cut off before anything came back, and the caller got an error instead of an answer. Two things caused it. The checker asks a language model to write search queries and then to judge each source it finds; if none of the model providers could answer, that step threw the whole check away, even though the checker had already gathered real sources and knew how to carry on without the model. And nothing kept an eye on the clock, so a slow run could outlast the time limit the request had to begin with. Both are fixed. A check now works to a time budget and hands each step whatever is left, so it always finishes with something to show. If a step genuinely cannot reach a model, the check falls back instead of failing: it searches the claim itself, returns the sources it found with their excerpts, and marks the verdict as insufficient rather than guessing. The response now says plainly which step fell back, and a result produced that way is deliberately not cached, so asking again re-runs the full check rather than replaying a bad day. (`/fact-check`) `[fix, improvement]`
- **Notification mute switches actually work now** — The per-category switches in settings let you turn the bell off for a kind of notification, but the bell ignored them and filled up anyway. They work now. One deliberate exception: account and security notices (withdrawals, payment problems, security alerts) always stay in your bell, because that is your record of what happened to your account and losing it silently would be worse than a little noise. You can still turn off their push, email and Telegram. Those always-on switches now show as locked in settings instead of pretending to be adjustable. (`/dashboard/settings`) `[fix, improvement]`
+- **On-chain agent pages now load their registration details reliably** — ERC-8004 agent pages read each agent's registration document from wherever its owner published it. Most of those hosts do not permit direct browser access, so a large share of agents showed "Could not fetch registration JSON" instead of their name, description, avatar, and skills. Pages now fall back to fetching that document through three.ws, so those agents render in full. The fallback validates every address it connects to and caps the download, so a hostile registration link cannot reach anything private. (`/docs/erc8004`) `[fix]`
- **Ordinary new coins are no longer mistaken for honeypots** — Before any automated buy, the platform simulates a full buy-then-sell round trip on-chain to prove the coin can actually be sold again, and blocks anything that cannot be exited. That simulation runs from the buying agent's own wallet, so when the wallet was too small to fund the simulated purchase, the failure was being read as evidence that the coin was a trap. One underfunded agent produced 336 consecutive false honeypot verdicts in a single afternoon on perfectly normal launches. The safety probe now scales down to a size the wallet can actually simulate, since a real honeypot traps a seller at any size, and an out-of-funds failure is now reported as exactly that. Coins that genuinely cannot be sold are still blocked, and a wallet too empty to prove anything is still refused rather than waved through. `[fix, security]`
- **Payments that had already gone through no longer come back as failures** — When an agent pays three.ws for an API call, the payment is sent to Solana and then confirmed. If the node that answered replied in a shape our software could not read, the platform gave up and called the payment failed, even though in many cases it had already settled on-chain. The caller got an error for something they had genuinely paid for. The platform now asks the chain directly before declaring any payment failed, and skips that check only in the one case that proves the payment never reached the network at all. Separately, the most common payment failure used to reach our logs carrying no reason whatsoever, which made it impossible to diagnose or fix; the underlying cause is now recorded alongside it. `[fix]`
- **Platform payment wallets now refill straight from the treasury when they run dry** — The two wallets that pay for the platform's automated work could only refill themselves by trading one of their own assets for the other. A wallet that was low on both had no way out, so it would sit and fail payments while the treasury held plenty of funds one step away. The treasury now tops those wallets up directly, with a per-transfer cap, a daily cap, and a reserve it never spends below. Payments that used to stall for hours waiting on a human now recover on their own within a minute. `[fix, infra]`
@@ -25,8 +29,10 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Restyled models read properly in the feed** — When someone restyled a model, the activity feed just said they "shared something" with a generic icon. Restyles now say so, with their own icon, and a colorway variant is labelled as one instead of being lumped in with a hand-directed restyle. (`/feed`) `[fix]`
- **Solana RPC failover fixed: the paid reserve is no longer the primary lane** — The platform routes every Solana call through a chain of RPC providers so no single one becomes a bottleneck, with a paid endpoint held back as an emergency reserve. A configuration mistake had that reserve listed as the primary as well, and because the chain keeps the first entry for a repeated address, it quietly served all traffic and burned through its daily request cap while the free providers sat idle. The reserve is now held back as intended and the premium provider leads. Two safeguards prevent a repeat: the slowest public endpoint can no longer outrank a paid provider by being used as a default, and when one server discovers a provider is out of quota, the rest of the fleet now inherits that verdict immediately instead of each wasting another request against a cap that is already full. `[infra, fix]`
- **Stopped two automated systems from passing the same SOL back and forth** — One background job tops up each trading agent wallet to a working balance. Another reclaims idle SOL from platform wallets back to the treasury so the agent economy can pay its network fees. Their thresholds disagreed, so they took turns moving the same funds in opposite directions: in one fifteen-minute window 0.24 SOL made that round trip six times, paying a network fee each leg, and the agents never held a balance long enough to trade. Both jobs now read a single shared policy with one rule, that a reclaim can never take a wallet below the level the top-up will immediately restore. The reclaim also now leaves every active trader enough to cover a complete trade, including the safety check that runs before it. `[fix, infra]`
+- **The agent directory is now readable without JavaScript, and the homepage loads lighter** — Two things that made the site slower and harder to find. The Discover directory indexes over 150,000 agents but built its entire page in the browser, so search engines, link previews, and anyone on a slow or JavaScript-less connection saw an empty page. The server now sends the first page of agents and the live directory totals with the page itself, exactly matching what the browser then loads. Separately, the homepage was carrying a large duplicate copy of its own styling inline, plus two big scripts that blocked the page from drawing while they parsed. Those moved into files the browser caches once and reuses on every later visit, cutting the homepage document roughly in half. (`/discover`) `[improvement, infra]`
- **The fact checker stops timing out, and reads its sources properly** — Paid fact checks had started failing outright with a server error instead of returning a verdict. The cause was in how we try our AI providers: when the first provider accepted a request and then went quiet, we kept waiting on it (and on two more sign-ins to the same provider) until the whole time budget for the check was gone, so the providers that were healthy and ready to answer were never reached. We now stop re-trying a provider that has already gone quiet, and no single provider can eat more than a third of the remaining time while others are still waiting. Checks that used to die at 46 seconds now come back with a real, sourced answer. Alongside that, the checker reads evidence far better: its free Wikipedia source now returns the article's actual opening text instead of a 150-character fragment around a keyword, all three search angles are represented in the sources we examine rather than just the first, and a verdict is now decided by the sources that genuinely address the claim, so evidence that never mentions the claim returns an honest "not enough evidence" instead of a misleading "mixed". The published accuracy figure on the fact-check page has been cleared until a clean measurement can be taken, because the last one was recorded during the outage above and measured that outage rather than the product. (`/fact-check`) `[fix, improvement]`
- **The live pump.fun trade feed now drops data providers that cannot serve it** — The live trade feed connects to a chain of Solana data providers and falls back through them. Some of those providers answer normal requests fine but reject the live-streaming connection outright, and the underlying library retried them forever, flooding the logs and wasting a slot in the fallback chain. The feed now tests each provider once, permanently sets aside the ones that structurally cannot stream, and briefly benches ones that are merely busy, so it lands on a working provider immediately instead of retrying a dead one. `[fix, improvement]`
+- **The news rail on a coin page no longer hides stories it already has** — The related-news strip on a coin page decided whether to show anything by asking how many news publishers had just been refreshed, rather than whether it actually had articles in hand. Since the news system also serves recent copies it fetched a little earlier, the rail could be holding eight real stories and still show an error instead. It now shows what it has, and reports a problem only when it genuinely has nothing. (`/coins`) `[fix]`
- **three.ws can search the live web now, with sources you can check** — Until now the platform could not look anything up on the open web. Searching three.ws found things made on three.ws (avatars, agents, models, worlds, coins), and the news surfaces read from a fixed list of crypto publishers, but there was no way to ask a question about the wider web and get a current answer. A new public endpoint does exactly that: ask a question, get an answer written from live search results, plus the list of sources it was built from and the exact searches that were run, so you can check the work rather than take it on faith. The fact checker uses the same lookup, which means it now reads real current pages instead of falling back to Wikipedia summaries, and it correctly treats a government or reference source as more authoritative than an anonymous blog. (`/docs/api-reference`) `[feature, infra]`
- **Trading agents that looked healthy but could never place a trade now say why** — Several arms of the autonomous trading fleet were switched on, funded, and reading every new launch, yet had never bought anything. Nothing looked broken, because an entry that gets skipped leaves no record at all. Four separate causes were found and fixed. An arm whose configured trade size had drifted above its own daily spending cap could never satisfy both at once, so it sat out every opportunity. A wallet trimmed too thin could not pay for the safety simulation the platform runs before every buy. Some arms asked for coins above a market-cap floor that a brand-new launch cannot reach at the moment they look at it. And arms pinned to a specific AI model refused to trade because that model had quietly stopped answering, with a stand-in replying in its place. Every armed strategy on the experiments board now carries a plain-language reason when it is not trading, and the ops channel is paged when a pinned model goes dark. (`/sniper/experiments`) `[fix, improvement]`
- **Uploaded avatars from far more 3D tools now animate instead of standing frozen** — three.ws recognises an avatar's skeleton by its bone names, and every 3D tool names bones differently. When a name was not recognised the avatar still uploaded and still looked right, but it stood frozen in a T-pose, or walked while its legs stayed rigid. Rather than keep guessing which tools to support, we measured: a new audit reads the skeleton of avatars actually stored on the platform and reports exactly which ones fail and which bone names caused it. That turned up several whole families of rigs that were silently broken, and all of them now work: characters from Maya's Advanced Skeleton, Sketchfab exports, research and motion-capture tools that use the SMPL convention, Roblox and Second Life avatars, VRM converter output, and Blender rigs whose legs and finger joints were being dropped. Measured across 802 rigs that people uploaded or imported themselves: the share that walk with a complete leg chain went from 94.4% to 97.6%, the share that animate at all from 97.4% to 98.4%, and nothing that already worked regressed. A small number of Blender rigs built on constraint systems still cannot be driven this way, because the constraints are discarded when the file is exported and forcing it would pull the limbs apart; those fall back to a working skeleton rather than breaking, and can be re-rigged automatically instead. `[improvement, fix]`
@@ -35,9 +41,12 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-07-28
- **Agent Symphony** (`/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 a clip and share the sound of machines doing business.
+- **Fits: the cosmetics economy** (`/fits`) — 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 in real settled USDC, and every cosmetic sale as it lands. Includes a free creator-earnings lookup for any Solana wallet, with per-cosmetic and per-coin-world breakdowns.
- **Receipt Vault** (`/receipts`) — 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 proof-of-purchase receipt issued to that wallet: endpoint, network, settlement transaction with explorer link, and the full signed artifact as JSON, plus CSV export and search. The buyer-side mirror of Endpoint Revenue.
- **Claude 5 models land across chat, agent brains, and widgets** — Claude Sonnet 5 and Claude Opus 5 are now available everywhere agents talk: the chat app, agent brains, embedded widgets, agent talk, the co-pilot narrator, and nightly reflection all route to the new generation, with Sonnet 5 as the platform's Anthropic default. Under the hood the Claude transport got smarter too: large system prompts are prompt-cached (about 90% cheaper on repeat turns), and requests are automatically shaped for the new models so older settings can never cause a failed reply. (`/chat`) `[feature, improvement]`
- **Coin pages are back, and they can no longer be taken down by an expired market-data key** — Every coin profile page was returning an error. The market-data provider we read prices and coin details from gives us a monthly call allowance, and once it ran out, every request we sent with our key was refused. The awkward part: the exact same request sent without the key was still being answered. We were effectively locking ourselves out. The pages are live again, and the fix is permanent rather than a one-off: when the key gets refused, we now set it aside for a while and retry the same request without it, so the pages keep serving and recover on their own when the allowance resets. We also repaired a 3D model service that was crash-looping because it tried to download a small config file from a public model host on every start and kept getting throttled. That file now ships with our own model storage, so the service starts without depending on anyone else. (`/coins`) `[fix, infra]`
+- **Coin pages stay up when the market-data quota runs out** — Our market-data provider caps the free tier at 10,000 calls a month. Once that ran out, every request carrying our key was refused for the rest of the billing period, while the very same request without a key was still being answered normally. Coin details, tickers, and exchange data returned errors for hours on 28 July because of it. An exhausted key is now benched for fifteen minutes and the request is immediately retried without it, so pages keep serving. The key comes back into use on its own when the quota resets, with no redeploy and nobody paged. `[fix]`
+- **Consistent formatted text and notifications across the site** — Formatted text (agent descriptions, chat replies, docs excerpts) was being rendered by a handful of separate implementations that had drifted apart, and each page that needed a confirmation message carried its own copied-in version. Both now come from one shared implementation: text is parsed and sanitised the same way everywhere, so the same content renders identically on every surface, and notifications queue and dismiss consistently instead of stacking or vanishing depending on which page you were on. `[improvement]`
- **Crypto Intel now prices pump.fun coins, and settle failures explain themselves** — The paid Crypto Intel feed ($0.01 per call) previously could only answer for major coins listed on CoinGecko or Coinbase, so agents asking about pump.fun tokens got an unavailable response every time. It now accepts a mint address and prices any Solana token: through on-chain market aggregators for coins trading on a DEX, and directly from the live pump.fun bonding-curve state for brand-new launches. The platform's own trading engine passes the mint automatically, so the sentiment signals that guide its snipe decisions now cover the coins it actually holds and watches. Separately, when an on-chain payment settlement fails, the recorded error now keeps the part of the simulation log that states the actual cause instead of cutting it off, which makes production issues much faster to diagnose. `[improvement, fix]`
- **Documentation overhaul: every directory now explains itself** — A full documentation pass across the repository. Previously undocumented areas now ship real READMEs: the five server-side platform agents (endpoint shopper, fact checker, tutor, unstoppable, x402 buildout), the site data files, the static page system, the blog pipeline, and the npm package index. A docs-wide link audit fixed every broken link, including roughly 317 in the combined docs file, whose generator now rebases links correctly. Orphaned reference docs (design tokens, use cases, the UX flow atlas, specs) are now reachable from the Start Here page. (`/docs/start-here`) `[docs]`
- **Fixed a wallet-balancing loop that was quietly burning swap fees** — The platform wallet that pays for agent-to-agent settlements holds both USDC (to pay other agents) and a little SOL (to pay Solana network fees). An automatic balancer kept each side topped up, but when the wallet was too small to satisfy both targets at once, the two rules fought: one swapped USDC into SOL, the next run swapped it straight back, over a hundred reversing swaps in an afternoon, each one paying exchange fees for nothing. The balancer now treats the SOL fee reserve as untouchable when topping up USDC, so the tug-of-war is structurally impossible, and the balancer itself keeps running even during database-storage pressure, since skipping it is what let the fee wallet run dry earlier today. `[fix, infra]`
@@ -58,9 +67,12 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Chat works again: every built-in model had been retired** — The AI provider behind three.ws's free chat models retired all five of the built-in models at once, without notice. Because the model names were written into the app, every new conversation opened on a model that no longer existed, and the first message anyone sent came back as "This model is unavailable for free" instead of an answer. Chat now reads the list of working models from the provider directly, every time, and opens on one that is actually running. If a model is retired mid-conversation, the request quietly rolls over to a working one instead of failing. The same fix covers the model pickers on the avatar, brain, embed and dashboard pages, which were offering the same dead models. (`/chat`) `[fix]`
- **Every 3D service we sell to other agents now ships parameters and a worked example** — The service catalog three.ws publishes to the OKX.AI agent marketplace describes all eleven 3D services the same way: what it does, exactly what you provide numbered one by one, and a concrete example of a real request. Buying agents (and the humans reading over their shoulder) can now tell what a service takes before spending anything, and the free catalog endpoint serves the same text the marketplace listing shows. (`/docs/okx-marketplace`) `[improvement, docs]`
- **Every asset address in our docs and API examples now actually loads** — For a long time our developer documentation, API response examples, and the skill file that AI agents read to embed a 3D avatar all pointed model and image URLs at an address that does not exist: there was never a DNS record behind it. Copy one of those examples and you got a connection failure, and an agent following the embed instructions produced a body URL that could never load. It appeared 181 times across 55 files, including every code sample in the 3D and MCP API references. All of them now point at the asset CDN we actually run, which serves the same files from three.ws itself, allows any site to load them, and caches at the edge for a month. The Spatial MCP reference page moved onto it too, which fixes something subtle: it had been loading its example model from a storage origin that is rate-limited and only answers requests from our own domain, so anyone copying that example to prove the standard is portable was blocked by the very page meant to demonstrate portability. A new check refuses to let a dead asset address into the codebase again, and it also pins the route the working URLs depend on, so the two cannot drift apart. `[fix, docs]`
+- **Five more languages: Hausa, Armenian, Georgian, Pashto and Sinhala** — three.ws now ships in 60 languages. The five new locales cover the full site, not a landing page: navigation, the studio, the wardrobe, forged galleries, notifications, and the cookbook. Translations across the existing 55 languages were refreshed at the same time, so pages that gained copy recently are no longer part-English in a translated locale. `[feature]`
- **Garment generation no longer loses jobs when it scales down** — Requesting a batch of garments could silently drop most of them: the queue lived in one server's memory, so anything waiting disappeared when that server was recycled. Jobs are now durable and picked up by whichever server is free, with automatic retries, so a queued piece finishes even if the machine that took the request goes away. `[fix, infra]`
- **Generated garments are checked for shape, not just fit** — A garment can be skinned perfectly and still be the wrong shape: one generated hairstyle came back as a curtain nearly as tall as the avatar wearing it. Pieces are now measured against the body at two points, when they are made and again when they are worn, so a malformed mesh is refused and regenerated instead of ending up on someone's avatar. `[fix, improvement]`
- **Hats and shoes now sit where they belong** — Generated caps could come out with brims jutting past the face, and sneakers could hover away from the feet, because the forge sized those pieces by width alone: a deep-brimmed cap or a photographed pair of shoes standing close together gave the sizing step no useful signal. Caps are now scaled to fit the head on every dimension, and shoes are sized by foot length and placed onto each foot individually. Measured on a walking avatar, the worst-case gap between shoe and foot dropped from 34cm to 3cm, and cap overhang from 21cm to 8cm. Every piece in the catalog is now checked automatically: it must load, match its published fingerprint, and bind correctly onto four different avatar skeletons before it counts as good, with the pieces that failed the new bar replaced. A daily check also watches the live catalog for anything that breaks after the fact. `[improvement, fix]`
+- **Interrupted garment generations now recover on their own** — When the garment worker scaled down mid-job, the job it was holding became an orphan: the machinery to re-drive it existed but nothing ever triggered it, so the job sat until a watchdog eventually marked it failed. A scheduled sweep now re-drives orphaned jobs every ten minutes, so a generation interrupted by a scale-down finishes instead of dying quietly. `[fix]`
+- **Loading grids and the live terminal now pass the accessibility floor** — Two things a screen reader or a low-vision visitor hit directly. The loading placeholders on the animation and character libraries announced themselves with a label that assistive technology is required to ignore, so the "loading" state was silent; they are now proper status regions that get read aloud. And on the live terminal, each arriving row faded in from fully transparent, which meant text on screen sat below the readable-contrast floor for a quarter second at a time on a feed that never stops. Rows now slide in at full contrast instead of fading. `[fix]`
- **Pages that stayed English no matter which language you picked now translate** — Switching the site to one of our 50 languages left a set of pages stubbornly in English, and for three different reasons. Every news post was one of them: the translations existed, in every language, but the news pages are rebuilt automatically and each rebuild dropped the markers that connect a page to its translations, so about 2,400 already-translated strings sat unused. The cookbook lost its markers the same way when the page was rewritten. And ten pages had never been connected at all, including the wardrobe and our OpenAI partner page. All of them are wired now, the news rebuild reconnects itself so it cannot drift again, and the copy that was genuinely never translated is being translated into every language. `[fix, improvement]`
- **Search engines can now find the translated version of 160 more pages** — We tell search engines which languages a page is available in so someone searching in Japanese finds the Japanese version rather than the English one. The list of pages that got those signals was built by guessing each page's file from its address, and the guess only covered one of the four layouts we actually use. Pages living in a subfolder were treated as having no translations at all, so 160 fully translated pages, including the cookbook, the gallery, the demos and our OpenAI partner page, were telling search engines they existed only in English. Coverage goes from 186 pages to 346. `[fix, improvement]`
- **Solana name registration works again, and embeds stop crashing on older phones** — Claiming a .sol domain for an agent, and claiming your own name under threews.sol, both ran against a Solana naming library so old that the functions doing the registering had been renamed out from under us: the calls resolved to nothing and the whole attempt failed. The library is now current, every naming path has been re-checked against the live Solana mainnet, and handing a fresh subdomain to its new owner no longer trips over an account that the same transaction is still creating. Looking up a wallet's primary name also stops reporting a name the wallet no longer owns. Separately, the embeddable 3D avatar used a newer JavaScript feature than some older Android browsers ship, so the avatar page went blank instead of loading; the missing piece is now included in the embed, which matters because the embed is designed to run on other people's sites where we do not get to pick the browser. (`/embed`) `[fix]`
@@ -72,6 +84,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Trading agents no longer lose slots to settled trades** — A trade that sold successfully but whose confirmation timed out could get stuck: the agent kept treating the finished position as live, which used up one of its limited slots for new trades. Five positions were stuck at once, one for over 40 hours, leaving parts of the fleet unable to trade. Finished trades are now recognised from their on-chain record, a stuck position is released automatically instead of waiting forever, and the database itself now refuses to move a settled trade back to open. (`/sniper/experiments`) `[fix]`
- **Translated pages no longer turn code samples into live 3D avatars** — Our pages are written in English and machine-translated into 50 languages. When a page prints a code sample, the sample is stored in an escaped form so the browser shows it as text instead of running it. The translator did not know that, and on 289 pieces of copy across 46 languages it quietly un-escaped them. The worst case: a documentation page showing readers how to write the <agent-3d> embed tag stopped printing the tag and started running it, so a live 3D avatar appeared in the middle of the instructions and the sentence after it disappeared. Every one of those has been repaired, the translator now treats escaped markup as untouchable the same way it already protects $THREE and wallet addresses, and a new build check refuses to ship a translation whose markup does not match the English. `[fix, docs]`
- **Translations repaired: whole pages were quietly still in English** — A stretch of the site's translated copy was never actually translated. When the translation service was unreachable, the pipeline wrote the English text into each language file as a placeholder, and because the text was technically present, every later run skipped it. Punjabi was the worst case: the language was offered in the picker but read as English from top to bottom. Punjabi is now fully translated, and the same repair is running across the other languages, covering tens of thousands of phrases that had been sitting in English. There is also a new maintenance command that finds this class of gap, so a language can no longer look complete while reading in English. `[fix, improvement]`
+- **Wallet tools work again on older Android browsers** — A compatibility shim for older Android WebViews was reaching the main app but not the four background workers the site runs off the main thread. The vanity-address grinder calls the exact feature that shim exists to provide, so on Chrome 92 and earlier it failed on launch while the rest of the page looked fine. The shim now ships into the background workers too. `[fix]`
## 2026-07-26
@@ -110,6 +123,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Closed the tab while your avatar was building? It finishes anyway now** — Until today, a selfie avatar only completed while you kept the page open: your browser did the checking, and if you closed the tab after uploading, the engine finished your avatar but nobody ever came back to collect it. The job sat unfinished forever and your library never received the result. We found jobs stranded this way going back a month. The platform now checks in on every in-flight avatar itself, every few minutes, and files the finished result into your library exactly as if you had waited, so starting an avatar on your phone and pocketing it mid-build is now fine. The same pass also went back through every stranded job from the past month and delivered the ones whose results were still recoverable. Separately, the selfie page no longer shows a Masc and Femme body choice. Honest reason: the engine builds every avatar on one shared template body today, so that toggle changed nothing and never had, which is worse than not offering it. A real body choice, with sliders for build, height and more rather than two buttons, is planned on the parametric avatar base. (`/create/selfie`) `[fix, improvement]`
- **Crypto API: automatic upstream failover ends most rate-limit errors** — The unified crypto API (/api/v1/x) no longer fails your call just because one upstream host had a bad moment. When a provider is backed by a pool of interchangeable hosts (the Solana read endpoints front the platform's full RPC pool), a rate-limited, unreachable, or erroring host now fails over to a healthy alternate within the same request. The API also remembers which host just failed for a short window, so during an outage only the first request pays the discovery cost and everything after routes straight to a working host. Rate-limit passthrough was the second-largest error class on the aggregator; this removes it for pooled providers. (`/crypto-api`) `[improvement, infra]`
- **Dress any avatar: the wardrobe now adds clothes, not just recolours them** — Until now the wardrobe could only recolour or hide the clothes an avatar was generated with. It can now put NEW clothes on: the avatar editor's Wardrobe tab gained a Closet with racks of catalog pieces (tops, bottoms, footwear, outerwear, hair, headwear, glasses, accessories). Click a piece and it binds to your avatar's skeleton and moves with every animation, whatever generator the avatar came from: forge characters, selfie reconstructions and uploaded models all work, because garments are fitted to the skeleton at wear-time instead of being authored for one specific body. The body is masked under whatever you wear so skin never pokes through the cloth, a piece that cannot fit a particular skeleton politely refuses instead of deforming into spaghetti, and every download is integrity-checked against the catalog before it touches your avatar. Saved outfits persist: the downloadable and embedded versions of your avatar come out dressed too. (`/avatar-edit`) `[feature]`
+- **Fingerspelled signing reads as one continuous hand, not a slideshow** — The signing avatar built each letter from its own one-off pose code, so handshapes drifted between letters and a spelled word looked like a sequence of unrelated snapshots. Handshapes now come from a single shared library that both fingerspelling and full lexical signs draw on, so the same letter looks the same everywhere and the transitions between them are continuous. Wrists, thumbs, and finger curls were re-checked against reference photography across the whole alphabet. `[improvement]`
- **Fixed: saving your avatar's look from the editor** — Saving an outfit or appearance change from the avatar editor failed silently after a recent security hardening of the API. The editor now signs its save requests correctly, and a safety rule was added so no garment can ever hide your avatar's face, whatever its metadata claims. `[fix, security]`
- **Garment generation is now open to everyone: API and agent tools** — The garment generator that fills the wardrobe catalog is now a public surface. Developers can create wearables with one HTTP call (POST /api/garment-forge with a description and a slot, then poll the job), and AI agents get the same power through three new MCP tools: generate_garment, garment_status, and list_garment_catalog. Every generated piece is validated end to end before it publishes, appears in the shared catalog immediately, and fits any humanoid avatar. The catalog now covers tops, jeans, sneakers, and a leather jacket, with more slots filling in. `[feature, sdk]`
- **Long 3D generations in the free studio now hand you the result instead of giving up** — The free 3D studio tools (the ones ChatGPT and other agents call: forge_free, text_to_avatar, mesh_forge, rig_mesh, forge_avatar, refine_model) waited up to three minutes for a generation and then reported failure, even though the model kept rendering and usually finished a minute or two later. On our current primary 3D lane most generations take four to six minutes, which meant nearly every call through those tools looked broken while perfectly good models piled up unseen. Now, when a generation outlives the inline wait, the tool answers with a live job handle: a status of pending, plus a public poll link that returns the finished model's download and viewer links the moment it completes. Nothing about fast generations changes; they still return the finished model directly. (`/forge`) `[fix, improvement]`
@@ -2235,7 +2249,6 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-05-29
- **$THREE Live · Protocol Pulse** (`/three-live`) — 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 shockwaves, with a live trade feed and a HUD of price, market cap, holders, and volume.
-- **3D Scanner — Scan Yourself into 3D** (`/scan`) — Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser.
- **Forever — etch a message into Bitcoin** (`/forever`) — Inscribe a message onto the Bitcoin blockchain. It stays there. Forever.
- **Pay-As-You-Learn Tutor** (`/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 and signed attestation.
- **x402 Arbitrage** (`/arbitrage`) — Cross-provider price disparities surfaced live from the merged x402 facilitator catalog. Find the cheapest endpoint for any capability.
@@ -2278,7 +2291,6 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Full Animation & Emotion Control — Plus Pump.fun Live Feed** (`/blog/animation-emotion-control`) — 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 time.
- **GMGN Smart Money** (`/gmgn`) — 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.
- **Import an avatar URL** (`/import/rpm`) — Import any GLB or glTF avatar into three.ws and give it an agent brain.
-- **New Agent** (`/agent/new`) — Create a new agent from scratch — avatar, brain, skills, and on-chain identity.
- **Playground** (`/playground`) — Sandbox for experimenting with agents, prompts, and 3D scenes.
- **Real-Time Voice Interaction with 3D AI Agents — Preview** (`/blog/real-time-voice-interaction`) — 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 AR/VR.
- **Selfie to Avatar** (`/create/selfie`) — One selfie. About a minute. A rigged 3D avatar that works everywhere.
diff --git a/api/_lib/cache.js b/api/_lib/cache.js
index 941e6f8a0..078be9874 100644
--- a/api/_lib/cache.js
+++ b/api/_lib/cache.js
@@ -21,12 +21,34 @@
// (resolved through _lib/env.js, which also accepts the Vercel-marketplace
// names three_KV_REST_API_URL/TOKEN and KV_REST_API_URL/TOKEN)
-import { gzip, gunzip } from 'node:zlib';
-import { promisify } from 'node:util';
import { env } from './env.js';
-const gzipAsync = promisify(gzip);
-const gunzipAsync = promisify(gunzip);
+// node:zlib / node:util are loaded LAZILY, not at module scope. This module is
+// server-only in intent, but it is reachable from the BROWSER bundle: the
+// isomorphic SNS resolver imports the shared Solana connection, which imports
+// this cache —
+// pages/app.html → src/app.js → src/agent-skills-scene.js → src/agent-skills.js
+// → src/agent-skills-pumpfun.js → src/solana/sns.js
+// → api/_lib/solana/connection.js → api/_lib/cache.js
+// Vite externalizes `node:*` for the browser, so a STATIC `import { promisify }
+// from 'node:util'` resolves to a named export of `__vite-browser-external`
+// that does not exist, and the whole frontend build dies with
+// `"promisify" is not exported by "__vite-browser-external"`. That failure is
+// silent until deploy time, because the browser never reaches the gzip codec at
+// runtime — only the bundler does, at parse time.
+//
+// Deferring the import to first use keeps the module graph browser-safe while
+// leaving the server path unchanged (one dynamic import, memoized below).
+let _zlibPromise = null;
+function loadZlib() {
+ if (!_zlibPromise) {
+ _zlibPromise = Promise.all([import('node:zlib'), import('node:util')]).then(([zlib, util]) => ({
+ gzipAsync: util.promisify(zlib.gzip),
+ gunzipAsync: util.promisify(zlib.gunzip),
+ }));
+ }
+ return _zlibPromise;
+}
const memCache = new Map();
const MEM_DEFAULT_TTL_MS = 60_000;
@@ -273,12 +295,14 @@ const COMPRESS_MIN_BYTES = 1024;
async function encodeForWire(payload) {
if (payload.length < COMPRESS_MIN_BYTES) return payload;
+ const { gzipAsync } = await loadZlib();
const encoded = GZIP_PREFIX + (await gzipAsync(payload)).toString('base64');
return encoded.length < payload.length ? encoded : payload;
}
async function decodeFromWire(raw) {
if (typeof raw === 'string' && raw.startsWith(GZIP_PREFIX)) {
+ const { gunzipAsync } = await loadZlib();
const buf = Buffer.from(raw.slice(GZIP_PREFIX.length), 'base64');
return JSON.parse((await gunzipAsync(buf)).toString('utf8'));
}
diff --git a/api/_lib/coingecko.js b/api/_lib/coingecko.js
index 5f4f17c41..61be0c9a9 100644
--- a/api/_lib/coingecko.js
+++ b/api/_lib/coingecko.js
@@ -8,6 +8,7 @@
// the upstream from concurrent cold-instance misses.
import { cacheGet, cacheSet } from './cache.js';
+import { createCache } from './mem-cache.js';
export const COINGECKO_BASE = 'https://api.coingecko.com/api/v3';
@@ -16,8 +17,13 @@ export const COINGECKO_BASE = 'https://api.coingecko.com/api/v3';
// instead of cascading into a user-facing 502. CoinGecko's free/demo tiers cap
// at ~30 req/min; broad coin-page crawling saturates that, and without a stale
// buffer every /coin/:id detail call would 502 during the storm.
-const _cache = new Map();
-const MAX_ENTRIES = 512;
+// Bounded by true LRU rather than a Map trimmed with
+// `delete(keys().next().value)`, which dropped the OLDEST INSERTED entry — so a
+// continuously-hot coin page could be evicted while colder entries inserted
+// after it survived. Freshness is NOT the LRU's `ttl`: entries must stay
+// readable past `expiresAt` for the stale buffer below to work, so expiry stays
+// an explicit field on the value.
+const _cache = createCache({ max: 512 });
// How long past freshness a cached value may still be served on an upstream
// fault. Coin metadata (description, dev/community stats, market cap) tolerates
// minutes of staleness far better than an outage.
@@ -157,7 +163,6 @@ export async function geckoFetch(path, { ttlMs = 60_000, timeoutMs = 8000 } = {}
}
const value = await resp.json();
_cache.set(path, { value, expiresAt: now + ttlMs, staleUntil: now + ttlMs + STALE_MS });
- if (_cache.size > MAX_ENTRIES) _cache.delete(_cache.keys().next().value);
// Fire-and-forget durable mirror, never let a cache fault fail a live fetch.
Promise.resolve(cacheSet(durableKey(path), value, DURABLE_STALE_S)).catch(() => {});
return value;
diff --git a/api/_lib/coinpaprika.js b/api/_lib/coinpaprika.js
new file mode 100644
index 000000000..9c2f20897
--- /dev/null
+++ b/api/_lib/coinpaprika.js
@@ -0,0 +1,88 @@
+// Shared CoinPaprika client — one place that owns the free tier's budget.
+//
+// **The free tier allows sixty requests per HOUR** (hard cap 25k/month). Past
+// that, every request returns `402 payment_required` and the client is blocked
+// for a full hour. Three separate surfaces draw on that single budget:
+//
+// api/_lib/coin-fallbacks.js coin profile + exchange listings fallback
+// api/_lib/market-fallbacks.js global stats fallback
+// api/x402/market-heatmap.js the paid heatmap endpoint's fallback
+//
+// so the health state has to be process-wide, exactly like the demo-key health
+// in api/_lib/coingecko.js. Without it, one surface exhausting the budget leaves
+// the others paying a wasted round-trip per request for the rest of the hour,
+// and the paid endpoint spends latency discovering what a sibling module already
+// knew.
+//
+// Callers should ALSO cache what they get back. This module bounds the damage of
+// a spent budget; it cannot create requests that don't exist. See the payload
+// cache in coin-fallbacks.js for the pattern that actually makes 60/hour usable
+// under load.
+
+const PAPRIKA_BLOCK_MS = 60 * 60_000;
+// 402 = hourly/monthly budget spent (their documented reply), 429 = throttled.
+const BUDGET_STATUSES = new Set([402, 429]);
+
+let _benchedUntil = 0;
+
+/** True while CoinPaprika is blocked for exceeding its free-tier budget. */
+export function isPaprikaBenched(now = Date.now()) {
+ return _benchedUntil > now;
+}
+
+/** Bench CoinPaprika for its stated block duration. Exported for tests. */
+export function benchPaprika(now = Date.now()) {
+ _benchedUntil = now + PAPRIKA_BLOCK_MS;
+}
+
+/** Clear the bench. Test-only hook; production heals when the block expires. */
+export function resetPaprikaHealth() {
+ _benchedUntil = 0;
+}
+
+/** Note a budget rejection observed by a caller that fetches on its own. */
+export function notePaprikaStatus(status) {
+ if (BUDGET_STATUSES.has(status)) {
+ benchPaprika();
+ console.warn(`[coinpaprika] ${status} — free-tier budget spent; benching for 1h`);
+ return true;
+ }
+ return false;
+}
+
+export const PAPRIKA_BASE = 'https://api.coinpaprika.com/v1';
+
+/**
+ * GET a CoinPaprika URL, returning null on any miss and never throwing.
+ *
+ * Deliberately a direct fetch rather than a `fetchFirst` provider: the shared
+ * failover primitive rejects every non-2xx alike and before its parser runs, so
+ * a 402 would be indistinguishable from a timeout — and the 402 is the one
+ * status that must change FUTURE behaviour rather than just this call's outcome.
+ *
+ * @param {string} url absolute CoinPaprika URL
+ * @param {number} [timeoutMs=8000]
+ * @returns {Promise<any|null>} parsed body, or null on miss/budget/error
+ */
+export async function paprikaGet(url, timeoutMs = 8000) {
+ if (isPaprikaBenched()) return null;
+ try {
+ const res = await fetch(url, {
+ headers: { accept: 'application/json', 'user-agent': 'three.ws/1.0' },
+ signal: AbortSignal.timeout(timeoutMs),
+ });
+ if (notePaprikaStatus(res.status)) return null;
+ if (!res.ok) return null;
+ const body = await res.json();
+ // The budget reply is JSON carrying this marker; honour it whatever status
+ // delivered it.
+ if (body?.type === 'payment_required') {
+ benchPaprika();
+ console.warn('[coinpaprika] payment_required — free-tier budget spent; benching for 1h');
+ return null;
+ }
+ return body ?? null;
+ } catch {
+ return null;
+ }
+}
diff --git a/api/_lib/market-fallbacks.js b/api/_lib/market-fallbacks.js
index 9b95063c8..27cb08771 100644
--- a/api/_lib/market-fallbacks.js
+++ b/api/_lib/market-fallbacks.js
@@ -21,6 +21,7 @@
import { fetchFirst } from '../../src/shared/failover-fetch.js';
import { COINGECKO_BASE, geckoHeaders } from './coingecko.js';
+import { PAPRIKA_BASE, paprikaGet } from './coinpaprika.js';
import { downsample } from '../../src/shared/coin-format.js';
import { cacheGet, cacheSet } from './cache.js';
@@ -209,19 +210,32 @@ export function normalizeLoreGlobal(raw) {
* @throws when every free source is down.
*/
export async function fetchGlobalMarket() {
+ try {
+ const { value } = await fetchFirst(
+ [
+ {
+ name: 'coingecko',
+ url: `${COINGECKO_BASE}/global`,
+ init: { headers: geckoHeaders() },
+ parse: async (r) => normalizeGeckoGlobal(await r.json()),
+ },
+ ],
+ { timeoutMs: 6000, label: 'global-market' },
+ );
+ return value;
+ } catch {
+ /* fall through to the free backups below */
+ }
+ // CoinPaprika sits on its own client rather than in the provider list above,
+ // because its free tier allows sixty requests an HOUR across every caller on
+ // this deployment and answers a spent budget with a 402 — a status the shared
+ // failover primitive would discard as just another failure. paprikaGet
+ // recognises it, benches the source process-wide, and returns null so this
+ // rung is skipped outright until the block lifts. See api/_lib/coinpaprika.js.
+ const paprika = normalizePaprikaGlobal(await paprikaGet(`${PAPRIKA_BASE}/global`, 6000));
+ if (paprika) return paprika;
const { value } = await fetchFirst(
[
- {
- name: 'coingecko',
- url: `${COINGECKO_BASE}/global`,
- init: { headers: geckoHeaders() },
- parse: async (r) => normalizeGeckoGlobal(await r.json()),
- },
- {
- name: 'coinpaprika',
- url: 'https://api.coinpaprika.com/v1/global',
- parse: async (r) => normalizePaprikaGlobal(await r.json()),
- },
{
name: 'coinlore',
url: 'https://api.coinlore.com/api/global/',
diff --git a/api/_lib/market/ohlcv.js b/api/_lib/market/ohlcv.js
index e4c439ce5..b8f00da89 100644
--- a/api/_lib/market/ohlcv.js
+++ b/api/_lib/market/ohlcv.js
@@ -6,12 +6,17 @@
// Never fabricates candles: any upstream failure throws with the real status so
// the caller surfaces the true cause.
+import { createCache } from '../mem-cache.js';
+
const BASE = 'https://api.geckoterminal.com/api/v2';
const UA = 'three.ws-granite-oracle/1.0';
// Small in-memory cache — GeckoTerminal's free tier is ~30 req/min and candle
// data only changes once per bar, so a short TTL keeps us well under the cap.
-const cache = new Map(); // url → { value, expiresAt }
+// True LRU bounding: the previous Map was trimmed with
+// `delete(keys().next().value)`, evicting the oldest INSERTED url rather than
+// the least recently used one.
+const cache = createCache({ max: 256 }); // url → { value, expiresAt }
const TTL_MS = 20_000;
// Bounded exponential backoff with jitter for transient upstream throttling.
@@ -78,7 +83,6 @@ async function gecko(path) {
throw Object.assign(new Error('GeckoTerminal returned non-JSON'), { status: 502 });
}
cache.set(url, { value: json, expiresAt: now + TTL_MS });
- if (cache.size > 256) cache.delete(cache.keys().next().value);
return json;
}
diff --git a/api/_lib/market/token-market.js b/api/_lib/market/token-market.js
index d243e41ce..738d5525f 100644
--- a/api/_lib/market/token-market.js
+++ b/api/_lib/market/token-market.js
@@ -13,6 +13,7 @@
// analogue of the RPC failover layer.
import { cacheGet, cacheGetFresh, cacheSet, cacheDel, acquireLock, releaseLock } from '../cache.js';
+import { createCache } from '../mem-cache.js';
const BIRDEYE_BASE = 'https://public-api.birdeye.so';
const DEXSCREENER_BASE = 'https://api.dexscreener.com/latest/dex/tokens';
@@ -58,7 +59,11 @@ const LOCK_WAIT_TRIES = 4;
const LOCK_WAIT_STEP_MS = 250;
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
-const _cache = new Map(); // mint → { value, expires, fetchedAt }
+// True LRU bounding: the previous Map was trimmed with
+// `delete(keys().next().value)`, evicting the oldest INSERTED mint rather than
+// the least recently used one — so a mint under constant polling could be
+// dropped while colder mints cached after it survived.
+const _cache = createCache({ max: 256 }); // mint → { value, expires, fetchedAt }
const _warnedAt = new Map();
const WARN_COOLDOWN_MS = 60_000;
@@ -263,7 +268,6 @@ const SOURCES = [fromBirdeye, fromDexScreener, fromGeckoTerminal, fromLlamaCoins
// paths so they all keep L1 coherent the same way.
function storeL1(mint, value, now, ttlMs) {
_cache.set(mint, { value, expires: now + ttlMs, fetchedAt: now });
- if (_cache.size > 256) _cache.delete(_cache.keys().next().value);
return value;
}
diff --git a/api/_lib/news-archive-store.js b/api/_lib/news-archive-store.js
index 60a20faa0..5b167a1b4 100644
--- a/api/_lib/news-archive-store.js
+++ b/api/_lib/news-archive-store.js
@@ -12,6 +12,8 @@
// it hourly from the live feed. Never hardcode the end date — read
// meta/stats.json (last_article_date), which the appender keeps current.
+import { createCache } from './mem-cache.js';
+
const GCS_BASE = 'https://storage.googleapis.com/three-ws-news-archive';
const GCS_LIST =
'https://storage.googleapis.com/storage/v1/b/three-ws-news-archive/o?prefix=articles/&fields=items(name)&maxResults=500';
@@ -23,9 +25,11 @@ const META_TTL_MS = 3600_000;
// and their fresh permalinks 404 until restart. Older months are immutable.
const MUTABLE_MONTH_TTL_MS = 10 * 60_000;
-// month "YYYY-MM" → { records, expiresAt } (newest month files are ~2–11 MB
-// raw; compact form keeps only serving fields). LRU by Map insertion order.
-const monthCache = new Map();
+// month "YYYY-MM" → { records, expiresAt } (newest month files are ~2-11 MB
+// raw; compact form keeps only serving fields). True LRU: the previous trim
+// evicted by Map INSERTION order, so with only 5 slots the month being actively
+// paged could be discarded while months touched once survived.
+const monthCache = createCache({ max: MONTH_CACHE_MAX });
// small metadata caches: { value, expiresAt }
let statsCache = null;
let monthsCache = null;
@@ -129,8 +133,5 @@ export async function loadMonth(month) {
records,
expiresAt: isMutableMonth(month) ? Date.now() + MUTABLE_MONTH_TTL_MS : Infinity,
});
- while (monthCache.size > MONTH_CACHE_MAX) {
- monthCache.delete(monthCache.keys().next().value);
- }
return records;
}
diff --git a/api/_lib/oracle/market.js b/api/_lib/oracle/market.js
index ca462552b..089d5741a 100644
--- a/api/_lib/oracle/market.js
+++ b/api/_lib/oracle/market.js
@@ -25,6 +25,7 @@
// coin page poll almost never fans out to six upstreams.
import { cacheGet, cacheSet } from '../cache.js';
+import { createCache } from '../mem-cache.js';
import { bondingProgressPct } from '../pump-bonding.js';
const DEXSCREENER = 'https://api.dexscreener.com/latest/dex/tokens';
@@ -37,7 +38,10 @@ const COINGECKO = 'https://api.coingecko.com/api/v3';
const FETCH_TIMEOUT_MS = 6000;
const WSOL = 'So11111111111111111111111111111111111111112';
-const L1 = new Map(); // key -> { value, expires }
+// True LRU bounding: the previous Map was trimmed with
+// `delete(keys().next().value)`, evicting the oldest INSERTED key rather than
+// the least recently used one.
+const L1 = createCache({ max: 256 }); // key -> { value, expires }
const L1_TTL_MS = 20_000;
const L2_TTL_S = 45;
@@ -455,7 +459,6 @@ export async function fetchCoinMarket(mint, network = 'mainnet', { fresh = false
// hollow all-null result that a transient outage produced.
if (merged.price?.usd != null) {
L1.set(mint, { value: merged, expires: now + L1_TTL_MS });
- if (L1.size > 256) L1.delete(L1.keys().next().value);
cacheSet(key, merged, L2_TTL_S).catch(() => {});
}
return merged;
diff --git a/api/_lib/pump-curve-view.js b/api/_lib/pump-curve-view.js
index 74976cb28..ea2ca197f 100644
--- a/api/_lib/pump-curve-view.js
+++ b/api/_lib/pump-curve-view.js
@@ -13,6 +13,7 @@
// entirely into the curve/pool (FDV == market cap post-graduation).
import { rpcFallbackFromEnv, getBondingCurveState, getTokenPrice, getGraduationProgress } from './solana/index.js';
+import { createCache } from './mem-cache.js';
// Mints that can never carry a pump.fun bonding curve. These are coin-agnostic
// payment-rail / native tokens, listed only so we can *exclude* them from curve
@@ -43,12 +44,15 @@ export function isPlausibleMint(s) {
// to slightly-old real data instead of an unhandled 500. Same serve-stale tier
// as api/pump/price-history: never fabricated, only ever a body a healthy read
// really produced.
-const _lastGood = new Map(); // `${network}:${mint}` → { body, at }
+// Bounded by true LRU: trimming with `delete(keys().next().value)` evicted the
+// oldest INSERTED mint, so the most-requested curve could lose its stale copy
+// while colder mints kept theirs. Staleness stays an explicit field because the
+// entry must remain readable to serve degraded data.
+const _lastGood = createCache({ max: 256 }); // `${network}:${mint}` → { body, at }
const STALE_MAX_MS = 10 * 60_000;
function rememberGood(network, mint, body) {
_lastGood.set(`${network}:${mint}`, { body, at: Date.now() });
- if (_lastGood.size > 256) _lastGood.delete(_lastGood.keys().next().value);
}
function recallGood(network, mint) {
diff --git a/api/_lib/quality-bench.js b/api/_lib/quality-bench.js
index 2e6efe255..2f66bfa0f 100644
--- a/api/_lib/quality-bench.js
+++ b/api/_lib/quality-bench.js
@@ -14,7 +14,13 @@ import { vertexGeminiAvailable, vertexGeminiChatUrl, vertexGeminiHeaders } from
// used the same rung unless this constant itself changed via a reviewed commit.
export const JUDGE_MODEL = 'google/gemini-2.5-pro';
export const JUDGE_PROMPT_VERSION = 1;
-const JUDGE_MAX_TOKENS = 700;
+// Gemini 2.5 Pro always spends thinking tokens, and on Vertex's OpenAI-compatible
+// surface those count against `max_tokens`. Measured on this judge prompt: ~1000-1300
+// reasoning tokens before a ~60-token JSON verdict, so the original 700 budget cut
+// every reply off mid-string (finish_reason "length" → "Unterminated string in JSON")
+// and lost most views. 3000 clears the observed ceiling with headroom; the verdict
+// itself stays tiny, so this costs nothing extra on a reply that finishes early.
+const JUDGE_MAX_TOKENS = 3000;
// Front, three-quarter, side — matches the studio-product framing render-clip.js
// already uses for avatar thumbnails (phi=78deg, just above eye level).
@@ -110,12 +116,24 @@ export async function loadCatalog(baseUrl) {
return res.json();
}
+// The bench is an internal sweep of our own deployment, so it submits as an
+// internal seed request when the deployment's CRON_SECRET is available locally
+// (api/forge.js: isInternalSeedRequest). Without it the High tier is unreachable —
+// forge.high is $THREE hold-or-pay gated and an anonymous submit gets a 402
+// three_hold_required, which would record every high-tier combo as a lane failure
+// and make the "standard vs high" comparison meaningless. Absent the secret the
+// bench still runs; only the ungated tiers produce scores.
+export function forgeSeedHeaders() {
+ const secret = (process.env.QUALITY_BENCH_FORGE_SEED || process.env.CRON_SECRET || '').trim();
+ return secret ? { 'x-forge-seed': secret } : {};
+}
+
export async function submitForge(baseUrl, { prompt, mode, referenceImageUrl, tier, backend }) {
const body = { prompt, tier, backend };
if (mode === 'image' && referenceImageUrl) body.image_urls = [referenceImageUrl];
const res = await fetch(`${baseUrl}/api/forge`, {
method: 'POST',
- headers: { 'content-type': 'application/json' },
+ headers: { 'content-type': 'application/json', ...forgeSeedHeaders() },
body: JSON.stringify(body),
});
const data = await res.json().catch(() => ({}));
diff --git a/api/_lib/solana/connection.js b/api/_lib/solana/connection.js
index f1f7faa6d..7e97e5caf 100644
--- a/api/_lib/solana/connection.js
+++ b/api/_lib/solana/connection.js
@@ -28,7 +28,25 @@
import { Connection } from '@solana/web3.js';
-import { cacheGet, cacheSet } from '../cache.js';
+// NOTE: the shared cache is deliberately NOT imported at module scope. This
+// module is shared with the BROWSER bundle (public/agent/index.html →
+// src/agent-skills.js → src/agent-skills-pumpfun.js → src/solana/sns.js →
+// here), and api/_lib/cache.js statically imports node:zlib and node:util. A
+// top-level import therefore broke `npm run build` outright — rollup resolves
+// the Node built-ins to __vite-browser-external and fails on
+// `"promisify" is not exported`. Loading it lazily behind isServer() also fixes
+// the architectural half: the browser holds no Upstash credentials and must
+// never reach L2, so in a browser the breaker is correctly local-only.
+let _cachePromise = null;
+function isServer() {
+ return typeof window === 'undefined';
+}
+/** Resolve { cacheGet, cacheSet }, or null in a browser. Cached after first call. */
+function sharedCache() {
+ if (!isServer()) return null;
+ if (!_cachePromise) _cachePromise = import('../cache.js').catch(() => null);
+ return _cachePromise;
+}
function deriveWsUrl(httpUrl) {
return String(httpUrl)
@@ -211,7 +229,9 @@ let _cooldownHydrateInFlight = null;
// cache miss or error leaves the local map as-is and the request proceeds.
async function readSharedCooldowns() {
try {
- const shared = await cacheGet(COOLDOWN_CACHE_KEY);
+ const cache = await sharedCache();
+ if (!cache) return; // browser: the local breaker is the whole breaker
+ const shared = await cache.cacheGet(COOLDOWN_CACHE_KEY);
if (!shared || typeof shared !== 'object') return;
const now = Date.now();
for (const [url, until] of Object.entries(shared)) {
@@ -252,7 +272,11 @@ function publishCooldowns(now) {
}
}
if (maxRemainingMs <= 0) return;
- cacheSet(COOLDOWN_CACHE_KEY, active, Math.ceil(maxRemainingMs / 1000)).catch(() => {});
+ const pending = sharedCache();
+ if (!pending) return; // browser: nothing to publish to
+ pending
+ .then((cache) => cache?.cacheSet(COOLDOWN_CACHE_KEY, active, Math.ceil(maxRemainingMs / 1000)))
+ .catch(() => {});
}
function cooldownMsFor(status, bodyText) {
diff --git a/api/coin/news.js b/api/coin/news.js
index 58aa049fa..cb3d69312 100644
--- a/api/coin/news.js
+++ b/api/coin/news.js
@@ -22,7 +22,13 @@ export default wrap(async (req, res) => {
const limit = Math.min(Math.max(1, parseInt(params.get('limit') || '8', 10) || 8), 20);
const result = await searchNews(q, limit);
- if (!result.sources_ok) {
+ // `sources_ok` counts publishers whose LAST refresh succeeded, which is not
+ // the same question as "do we have anything to show". The aggregator also
+ // serves recent-but-not-just-refreshed copies, so a rail holding eight real
+ // articles could still report zero ok sources and 502 — discarding the
+ // articles it was holding. Gate on the articles themselves; only a genuinely
+ // empty-handed fan-out (no articles AND nothing refreshed) is an outage.
+ if (!result.articles.length && !result.sources_ok) {
return error(res, 502, 'upstream_error', 'related news is unavailable right now');
}
diff --git a/api/x402/market-heatmap.js b/api/x402/market-heatmap.js
index 200d29875..b9337531b 100644
--- a/api/x402/market-heatmap.js
+++ b/api/x402/market-heatmap.js
@@ -6,12 +6,14 @@
// normalized snapshot.
//
// Dual live sources with automatic failover: CoinGecko /coins/markets first
-// (richest fields), CoinPaprika /tickers second (keyless, generous quota) —
-// so one upstream rate-limit never breaks a paid call. Cached 60 s in-memory.
-// No mock path — if both sources fail the handler throws BEFORE settlement
-// so the buyer is never charged.
+// (richest fields), CoinPaprika /tickers second (keyless, but only sixty
+// requests an HOUR shared across every caller on this deployment — see
+// api/_lib/coinpaprika.js) — so one upstream rate-limit never breaks a paid
+// call. Cached 60 s in-memory. No mock path — if both sources fail the handler
+// throws BEFORE settlement so the buyer is never charged.
import { paidEndpoint } from '../_lib/x402-paid-endpoint.js';
+import { PAPRIKA_BASE, isPaprikaBenched, notePaprikaStatus } from '../_lib/coinpaprika.js';
import { buildBazaarSchema } from '../_lib/x402-spec.js';
import { installAccessControl } from '../_lib/x402/access-control.js';
import { withService } from '../_lib/x402/bazaar-helpers.js';
@@ -52,11 +54,17 @@ async function fetchCoinGecko() {
}));
}
+// CoinPaprika's free tier is sixty requests an HOUR across every surface that
+// uses it (see api/_lib/coinpaprika.js), so this paid endpoint routes through
+// the shared budget guard: when a sibling caller has already been blocked,
+// this one fails immediately instead of spending 8s discovering the same thing.
async function fetchCoinPaprika() {
- const r = await fetch('https://api.coinpaprika.com/v1/tickers?quotes=USD', {
+ if (isPaprikaBenched()) throw new Error('coinpaprika budget spent');
+ const r = await fetch(`${PAPRIKA_BASE}/tickers?quotes=USD`, {
headers: { accept: 'application/json' },
signal: AbortSignal.timeout(8000),
});
+ notePaprikaStatus(r.status);
if (!r.ok) throw new Error(`coinpaprika ${r.status}`);
const raw = await r.json();
if (!Array.isArray(raw) || !raw.length) throw new Error('coinpaprika empty');
diff --git a/chat/README.md b/chat/README.md
index fca817b7d..85e6e2333 100644
--- a/chat/README.md
+++ b/chat/README.md
@@ -29,6 +29,21 @@
- Completely private and transparent. All your conversation history and keys are stored entirely locally, and kept only in your browser, on your device.
+## 3D in chat: forge models and view them inline
+
+The chat generates and displays real 3D models directly in the conversation. Three pieces work together:
+
+**Forge tools (on by default).** Two client tools are bootstrapped into every fresh conversation:
+
+- `ForgeTextTo3D` runs the free three.ws Forge lane (`POST /api/forge { prompt }`). It returns immediately; the model appears in the thread in roughly 30 to 90 seconds. Ask for "a 3D model of a brass steampunk owl" and the assistant calls it on its own.
+- `ForgeAvatar` runs the full text to mesh to auto-rig to avatar-library pipeline (`/api/forge`, `/api/forge?action=rig`, `/api/avatars/from-forge`). Saving to the library requires being signed in; without a session it still returns the rigged model.
+
+Both tools return an `application/model-3d` envelope instead of raw HTML: `{ contentType: 'application/model-3d', content: { glb, job, prompt, preview, eta, rigged, saved_url, status_note, error }, summary }`. The `summary` string is what the LLM reads; the compact `content` object is what renders, so tool results stay cheap in tokens.
+
+**The inline viewer (`src/ModelViewer3D.svelte`).** Any `application/model-3d` tool result renders directly in the message thread (and in the tool split view) as an interactive Three.js viewer: orbit and zoom with damping plus auto-rotate until first interaction, PBR environment lighting, animation playback when the GLB has clips, a skeleton toggle for rigged models (press S), and Download GLB / Viewer / View in AR / Recenter controls. While a forge job is pending it polls `GET /api/forge?job=` and shows the concept preview with a progress bar, then swaps in the model; once resolved, the GLB URL is persisted into the stored message so reloading the conversation renders instantly instead of re-polling. Viewers initialize lazily near the viewport, pause rendering offscreen, dispose all GPU resources on unmount, and recover from WebGL context loss with a reload card.
+
+**GLB links auto-render.** Paste a `.glb` URL into a message (or have the assistant produce one) and a viewer appears under it. Cross-origin models whose host lacks CORS headers are fetched through the same-origin `/api/glb?src=` proxy automatically. Links already rendered by a tool card or an earlier message are not duplicated.
+
## How to install?
If you don't want to use tools, you don't need to install anything. A hosted instance is available at: https://three.ws/chat
diff --git a/chat/src/tools.js b/chat/src/tools.js
index 9400cdd6f..cb3f5df26 100644
--- a/chat/src/tools.js
+++ b/chat/src/tools.js
@@ -1135,7 +1135,7 @@ return { mint, signature, metadataUri, explorer: 'https://solscan.io/tx/' + sign
id: 'forge-text-to-3d',
name: 'Text → 3D Forge',
description:
- 'Generate a real, textured 3D model from a text prompt with the three.ws Forge — live progress and an interactive PBR orbit viewer rendered inline in the chat, with GLB download, browser viewer, and AR links. Same engine as three.ws/forge, free, no key required.',
+ 'Generate a real, textured 3D model from a text prompt with the three.ws Forge: live progress and an interactive PBR orbit viewer rendered inline in the chat, with GLB download, browser viewer, and AR links. Same engine as three.ws/forge, free, no key required.',
schema: [
{
clientDefinition: {
@@ -1149,7 +1149,7 @@ return { mint, signature, metadataUri, explorer: 'https://solscan.io/tx/' + sign
// Submit on the host page (same-origin, cookies), then return an
// application/model-3d envelope. The chat renders it inline with the native
// ModelViewer3D component, which polls the job and swaps in the interactive
- // orbit viewer the moment the GLB is ready — no blocking, no iframe.
+ // orbit viewer the moment the GLB is ready: no blocking, no iframe.
let payload;
if (prompt.length < 3) {
payload = { error: 'Describe one subject in at least 3 characters, e.g. "a brass steampunk owl, full body".', prompt };
@@ -1188,7 +1188,7 @@ return { mint, signature, metadataUri, explorer: 'https://solscan.io/tx/' + sign
function: {
name: 'ForgeTextTo3D',
description:
- 'Generate a real 3D model (textured GLB) from a text prompt using the three.ws Forge, then render it inline in the chat with live progress and an interactive PBR orbit viewer (orbit/zoom, GLB download, browser viewer, AR link, recenter). Use whenever the user asks to make, create, generate, forge, render, show, or display a 3D model/object/mesh from a description. Returns immediately and the model appears in-place in ~30–90 s; do not poll or tell the user to wait. The prompt should describe ONE subject with material and style details.',
+ 'Generate a real 3D model (textured GLB) from a text prompt using the three.ws Forge, then render it inline in the chat with live progress and an interactive PBR orbit viewer (orbit/zoom, GLB download, browser viewer, AR link, recenter). Use whenever the user asks to make, create, generate, forge, render, show, or display a 3D model/object/mesh from a description. Returns immediately and the model appears in-place in about 30 to 90 seconds; do not poll or tell the user to wait. The prompt should describe ONE subject with material and style details.',
parameters: {
type: 'object',
properties: {
diff --git a/data/changelog.json b/data/changelog.json
index fc77ba1da..7b6f15426 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,35 @@
{
"$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-07-29",
+ "title": "Chat now forges and displays 3D models right in the conversation",
+ "summary": "Ask the chat at three.ws/chat for a 3D model and it generates one with the free Forge lane, streams live progress in place, and then renders the finished model as an interactive viewer inside the thread: orbit and zoom it, play its animations, toggle the skeleton on rigged avatars, download the GLB, or open it in AR. Pasting a link to any .glb file now shows the model the same way, even when the file's host would normally block the browser from reading it. Previously 3D results only appeared inside a boxed-in web page you had to click into.",
+ "tags": [
+ "feature",
+ "improvement"
+ ],
+ "link": "/chat"
+ },
+ {
+ "date": "2026-07-29",
+ "title": "Coin pages stay up when the market data provider rate-limits us",
+ "summary": "The price chart, profile and exchange listings on a coin page all came from one provider, so whenever it throttled our requests the whole page went down at once, for hours. Each of those now has a live backup: charts fall back to exchange candles for the majors and an on-chain price oracle for every other coin, while the profile and market listings fall back to a second data provider. When a backup is answering, the page says so at the bottom instead of quietly leaving numbers blank, and columns the backup cannot fill are hidden rather than shown as a row of dashes. Two small honesty fixes came with it: a follower count of zero now means \"not tracked\" and is left out rather than stated as zero, and a price change the backup does not actually compute is no longer drawn as a flat 0.00%.",
+ "tags": [
+ "fix",
+ "improvement"
+ ],
+ "link": "/coins"
+ },
+ {
+ "date": "2026-07-29",
+ "title": "The news rail on a coin page no longer hides stories it already has",
+ "summary": "The related-news strip on a coin page decided whether to show anything by asking how many news publishers had just been refreshed, rather than whether it actually had articles in hand. Since the news system also serves recent copies it fetched a little earlier, the rail could be holding eight real stories and still show an error instead. It now shows what it has, and reports a problem only when it genuinely has nothing.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/coins"
+ },
{
"date": "2026-07-29",
"title": "Notification mute switches actually work now",
@@ -16690,6 +16719,62 @@
"infra"
],
"link": "/discover"
+ },
+ {
+ "date": "2026-07-25",
+ "title": "Fingerspelled signing reads as one continuous hand, not a slideshow",
+ "summary": "The signing avatar built each letter from its own one-off pose code, so handshapes drifted between letters and a spelled word looked like a sequence of unrelated snapshots. Handshapes now come from a single shared library that both fingerspelling and full lexical signs draw on, so the same letter looks the same everywhere and the transitions between them are continuous. Wrists, thumbs, and finger curls were re-checked against reference photography across the whole alphabet.",
+ "tags": [
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-07-27",
+ "title": "Five more languages: Hausa, Armenian, Georgian, Pashto and Sinhala",
+ "summary": "three.ws now ships in 60 languages. The five new locales cover the full site, not a landing page: navigation, the studio, the wardrobe, forged galleries, notifications, and the cookbook. Translations across the existing 55 languages were refreshed at the same time, so pages that gained copy recently are no longer part-English in a translated locale.",
+ "tags": [
+ "feature"
+ ]
+ },
+ {
+ "date": "2026-07-27",
+ "title": "Loading grids and the live terminal now pass the accessibility floor",
+ "summary": "Two things a screen reader or a low-vision visitor hit directly. The loading placeholders on the animation and character libraries announced themselves with a label that assistive technology is required to ignore, so the \"loading\" state was silent; they are now proper status regions that get read aloud. And on the live terminal, each arriving row faded in from fully transparent, which meant text on screen sat below the readable-contrast floor for a quarter second at a time on a feed that never stops. Rows now slide in at full contrast instead of fading.",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-07-27",
+ "title": "Wallet tools work again on older Android browsers",
+ "summary": "A compatibility shim for older Android WebViews was reaching the main app but not the four background workers the site runs off the main thread. The vanity-address grinder calls the exact feature that shim exists to provide, so on Chrome 92 and earlier it failed on launch while the rest of the page looked fine. The shim now ships into the background workers too.",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-07-27",
+ "title": "Interrupted garment generations now recover on their own",
+ "summary": "When the garment worker scaled down mid-job, the job it was holding became an orphan: the machinery to re-drive it existed but nothing ever triggered it, so the job sat until a watchdog eventually marked it failed. A scheduled sweep now re-drives orphaned jobs every ten minutes, so a generation interrupted by a scale-down finishes instead of dying quietly.",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-07-28",
+ "title": "Coin pages stay up when the market-data quota runs out",
+ "summary": "Our market-data provider caps the free tier at 10,000 calls a month. Once that ran out, every request carrying our key was refused for the rest of the billing period, while the very same request without a key was still being answered normally. Coin details, tickers, and exchange data returned errors for hours on 28 July because of it. An exhausted key is now benched for fifteen minutes and the request is immediately retried without it, so pages keep serving. The key comes back into use on its own when the quota resets, with no redeploy and nobody paged.",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-07-28",
+ "title": "Consistent formatted text and notifications across the site",
+ "summary": "Formatted text (agent descriptions, chat replies, docs excerpts) was being rendered by a handful of separate implementations that had drifted apart, and each page that needed a confirmation message carried its own copied-in version. Both now come from one shared implementation: text is parsed and sanitised the same way everywhere, so the same content renders identically on every surface, and notifications queue and dismiss consistently instead of stacking or vanishing depending on which page you were on.",
+ "tags": [
+ "improvement"
+ ]
}
]
}
diff --git a/data/pages.json b/data/pages.json
index 6ea1fbf61..8ba4451f2 100644
--- a/data/pages.json
+++ b/data/pages.json
@@ -715,14 +715,6 @@
"changefreq": "monthly",
"added": "2026-06-05"
},
- {
- "path": "/agent/new",
- "title": "New Agent",
- "description": "Create a new agent from scratch — avatar, brain, skills, and on-chain identity.",
- "priority": 0.7,
- "changefreq": "monthly",
- "added": "2026-05-25"
- },
{
"path": "/create/selfie",
"title": "Selfie to Avatar",
@@ -756,14 +748,6 @@
"added": "2026-06-05",
"showcase": true
},
- {
- "path": "/scan",
- "title": "3D Scanner — Scan Yourself into 3D",
- "description": "Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser.",
- "priority": 0.7,
- "changefreq": "monthly",
- "added": "2026-05-29"
- },
{
"path": "/dad",
"title": "Make Dad a 3D Avatar",
@@ -1093,6 +1077,14 @@
"changefreq": "always",
"added": "2026-06-30"
},
+ {
+ "path": "/fits",
+ "title": "Fits: the cosmetics economy",
+ "description": "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 in real settled USDC, and every cosmetic sale as it lands. Includes a free creator-earnings lookup for any Solana wallet, with per-cosmetic and per-coin-world breakdowns.",
+ "priority": 0.6,
+ "changefreq": "hourly",
+ "added": "2026-07-28"
+ },
{
"path": "/receipts",
"title": "Receipt Vault",
diff --git a/docs/erc8004.md b/docs/erc8004.md
index 9d34b0b23..1896c989d 100644
--- a/docs/erc8004.md
+++ b/docs/erc8004.md
@@ -370,6 +370,37 @@ The resolver tries multiple IPFS gateways in sequence when fetching metadata:
Arweave (`ar://`) URIs are resolved through `arweave.net`.
+### When the registration host blocks the browser
+
+An agent card lives wherever its registrant put it, and most of those hosts send
+no `Access-Control-Allow-Origin` header. A browser therefore cannot read them at
+all: the fetch is blocked before the response is delivered, and the agent page
+used to render "Could not fetch registration JSON: Failed to fetch" for every
+such agent.
+
+The browser tries the card's URL directly first (fast, no extra hop). When that
+fetch fails, it retries through a first-party proxy that fetches server-side,
+where the same-origin policy does not apply:
+
+```
+GET /api/erc8004/metadata?uri=<registration uri>
+```
+
+```sh
+curl -s 'https://three.ws/api/erc8004/metadata?uri=ipfs://bafyExampleAgentCard'
+# → { "data": { ...the agent card... }, "resolvedUrl": "https://ipfs.io/ipfs/bafyExampleAgentCard" }
+```
+
+Public, keyless, and rate-limited per IP. `ipfs://` and `ar://` are resolved to
+their public gateways first, and successful lookups are edge-cached for ten
+minutes. Because the URI comes off-chain from whoever registered the agent, the
+fetch runs behind the platform SSRF guard
+([api/_lib/ssrf-guard.js](../api/_lib/ssrf-guard.js)): DNS is validated, the
+socket is pinned to the checked address, every redirect hop is re-validated, and
+the response is capped at 2 MB. A URI pointing at a private or cloud-metadata
+address is refused with `400 blocked_uri`; a host that answers with something
+other than JSON is reported as `502 invalid_json` rather than passed through.
+
---
## ENS and DNS integration
diff --git a/docs/procedural-animation.md b/docs/procedural-animation.md
index 0d5e6545a..87a228ba4 100644
--- a/docs/procedural-animation.md
+++ b/docs/procedural-animation.md
@@ -121,7 +121,9 @@ Bone lengths are preserved exactly; the solve only ever rotates.
|---|---|---|
| Corner walk companion | Look-at (cursor gaze) | [`walk-sdk/src/companion.js`](../walk-sdk/src/companion.js) `_updateGaze()` |
| The walkaround world (`/walk`) | Foot planting on terrain | [`src/walk.js`](../src/walk.js) `rebuildFootPlant()` |
+| `/walk` NPCs | Look-at (they watch the player) | [`src/walk-npcs.js`](../src/walk-npcs.js) `_updateGaze()` |
| Agent avatars (`AgentAvatar`) | Look-at (`setLookTarget`, `LOOK_AT`) | [`src/agent-avatar.js`](../src/agent-avatar.js) `_applyLookTarget()` |
+| `<agent-3d>` web component | Look-at (`lookAt()` public API) | [`src/runtime/scene.js`](../src/runtime/scene.js) `lookAt()` |
### The companion's cursor gaze
@@ -138,6 +140,20 @@ agentAvatar.setLookTarget(null); // release
`LOOK_AT` with `target: 'user'` (or `'camera'`) tracks the **live** camera position each frame, so the gaze holds while the viewer orbits. An explicit `setLookTarget()` always overrides camera tracking.
+### The `<agent-3d>` component
+
+`lookAt()` on the web component (and on `SceneController`) takes a `Vector3` or one of `'camera'`, `'user'`, `'center'`, or `null` to release:
+
+```js
+document.querySelector('agent-3d').lookAt('user');
+```
+
+The gaze is a **standing state**, not a one-off pose write: it re-applies after the mixer every frame, so it survives on an avatar that is playing a clip. The named targets re-resolve each frame, so `lookAt('camera')` keeps holding the viewer's eyes while they orbit. A rig with no head chain falls back to yawing the whole model, which is the best a headless rig can do.
+
+### `/walk` NPCs
+
+Every NPC watches the player within 14 m — wider than the 4 m greeting range, because noticing someone happens long before greeting them. A wanderer can glance over without breaking stride, since the gaze is an overlay on the walk cycle rather than a replacement for it. Past the clamp the layer releases rather than pinning the head, so an NPC the player has walked behind simply returns to its clip.
+
---
## Adding a layer
diff --git a/pages/create-selfie.html b/pages/create-selfie.html
index f4e60b89f..592b61ce0 100644
--- a/pages/create-selfie.html
+++ b/pages/create-selfie.html
@@ -1414,11 +1414,11 @@
Front-facing, good light, plain background. We downscale and upload locally —
your photo never sits on disk.
</p>
- <p class="alt-path" data-i18n-html="create_selfie.prefer_to_use_your_camera_live_the">
- Prefer to use your camera live? The
- <a href="/scan">3D Scanner</a> reconstructs you in real time from a quick scan.
- Photographing an object instead of yourself?
- <a href="/image-to-3d">Image to 3D</a> turns any photo into a textured model.
+ <p class="alt-path" data-i18n-html="create_selfie.prefer_your_camera_live_use_camera_below">
+ Prefer to scan yourself live? Use camera below opens your webcam and
+ reconstructs you from the shot you take. Photographing an object instead of
+ yourself? <a href="/image-to-3d">Image to 3D</a> turns any photo into a
+ textured model.
</p>
<div class="hero-slot-wrap">
@@ -2449,7 +2449,7 @@
const params = new URLSearchParams({ avatar_id: _avatarId });
if (name) params.set('avatar_name', name);
if (_modelUrl) params.set('avatar_glb', _modelUrl);
- window.location.assign(`/agent/new?${params.toString()}`);
+ window.location.assign(`/create-agent?${params.toString()}`);
});
document.getElementById('done-editor-btn')?.addEventListener('click', () => {
diff --git a/pages/features/scan.html b/pages/features/scan.html
index 8e839225f..05fab483e 100644
--- a/pages/features/scan.html
+++ b/pages/features/scan.html
@@ -131,7 +131,7 @@
entirely in your browser — no download, no app.
</p>
<div class="fl-hero-actions">
- <a href="/scan" class="fl-btn-primary" data-i18n="features_scan.start_scanning">Start scanning →</a>
+ <a href="/create/selfie" class="fl-btn-primary" data-i18n="features_scan.start_scanning">Start scanning →</a>
<a href="/features" class="fl-btn-ghost" data-i18n="features_scan.all_features">All features</a>
</div>
</div>
@@ -353,7 +353,7 @@
<h2 id="scan-cta-h2" data-i18n="features_scan.scan_yourself_in_60_seconds">Scan yourself in 60 seconds</h2>
<p data-i18n="features_scan.all_you_need_is_a_camera_and">All you need is a camera and decent lighting. No account required to try.</p>
<div class="fl-cta-actions">
- <a href="/scan" class="fl-btn-primary" data-i18n="features_scan.start_scanning_2">Start scanning →</a>
+ <a href="/create/selfie" class="fl-btn-primary" data-i18n="features_scan.start_scanning_2">Start scanning →</a>
<a href="/features/forge" class="fl-btn-ghost" data-i18n="features_scan.try_forge_instead">Try Forge instead</a>
</div>
</div>
diff --git a/pages/fits.html b/pages/fits.html
new file mode 100644
index 000000000..67c069868
--- /dev/null
+++ b/pages/fits.html
@@ -0,0 +1,221 @@
+<!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" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Fits: the cosmetics economy · three.ws</title>
+ <meta
+ name="description"
+ content="The live cosmetics economy: the scarcest premium fits ranked by on-chain ownership, the top collectors wearing them, the creators actually getting paid in USDC, and every settled sale as it lands. Look up any creator wallet's earnings, free and without an account."
+ />
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:url" content="https://three.ws/fits" />
+ <meta property="og:title" content="Fits: the cosmetics economy · three.ws" />
+ <meta
+ property="og:description"
+ content="Rarest fits, top collectors, creator earnings in real USDC, and a live feed of every settled cosmetic sale. Every number read from the settled-sale ledger."
+ />
+ <meta
+ property="og:image"
+ content="https://three.ws/api/page-og?s=crypto&amp;t=Fits&amp;d=The+live+cosmetics+economy%3A+rarest+fits%2C+top+collectors%2C+and+the+creators+actually+getting+paid+in+USDC.&amp;p=%2Ffits"
+ />
+ <meta property="og:image:width" content="1200" />
+ <meta property="og:image:height" content="630" />
+ <meta name="twitter:card" content="summary_large_image" />
+ <meta name="twitter:site" content="@trythreews" />
+ <meta name="twitter:title" content="Fits: the cosmetics economy · three.ws" />
+ <meta
+ name="twitter:description"
+ content="Rarest fits, top collectors, and real settled USDC creator earnings, live from the cosmetics ledger."
+ />
+ <meta
+ name="twitter:image"
+ content="https://three.ws/api/page-og?s=crypto&amp;t=Fits&amp;d=The+live+cosmetics+economy%3A+rarest+fits%2C+top+collectors%2C+and+the+creators+actually+getting+paid+in+USDC.&amp;p=%2Ffits"
+ />
+ <meta name="theme-color" content="#0a0a0a" />
+ <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="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/src/ui-juice.css" />
+ <link rel="stylesheet" href="/src/fits.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ <script defer src="/footer-newsletter.js"></script>
+ <link rel="canonical" href="https://three.ws/fits" />
+ <script type="application/ld+json">
+ {
+ "@context": "https://schema.org",
+ "@type": "WebPage",
+ "name": "Fits: the cosmetics economy",
+ "description": "The live cosmetics economy on three.ws: rarest premium fits, top collectors, real settled USDC creator earnings, and every cosmetic sale as it settles.",
+ "url": "https://three.ws/fits",
+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }
+ }
+ </script>
+ <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="Fits: the cosmetics economy on three.ws" />
+ </head>
+ <body>
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main class="ft-shell">
+ <div class="ft-glow" aria-hidden="true"></div>
+
+ <section class="ft-hero">
+ <div>
+ <p class="ft-kicker">
+ <span class="ft-live-dot" aria-hidden="true"></span> Live cosmetics ledger
+ </p>
+ <h1 class="ft-title">The <em>Fits</em> economy</h1>
+ <p class="ft-sub">
+ Premium cosmetics are bought with real USDC, and every sale splits revenue
+ with the creator of the coin world the fit belongs to. This is that ledger:
+ the scarcest fits, the collectors wearing them, the creators actually
+ getting paid, and every sale as it settles. Wear them in
+ <a href="/play">Play</a>; forge your own in the
+ <a href="/wardrobe">Wardrobe</a>.
+ </p>
+ </div>
+ <span class="ft-updated" id="ft-updated" aria-live="polite"></span>
+ </section>
+
+ <div class="ft-kpis" aria-label="Cosmetics economy summary">
+ <div class="ft-kpi ft-kpi--hero">
+ <span class="ft-kpi-label">Recent sales volume</span>
+ <span class="ft-kpi-val" id="ft-k-gross">·</span>
+ <span class="ft-kpi-sub" id="ft-k-gross-note"></span>
+ </div>
+ <div class="ft-kpi">
+ <span class="ft-kpi-label">Creators paid</span>
+ <span class="ft-kpi-val" id="ft-k-creators">·</span>
+ <span class="ft-kpi-sub" id="ft-k-creators-note"></span>
+ </div>
+ <div class="ft-kpi">
+ <span class="ft-kpi-label">Collectors</span>
+ <span class="ft-kpi-val" id="ft-k-collectors">·</span>
+ <span class="ft-kpi-sub">ranked by flex score</span>
+ </div>
+ <div class="ft-kpi">
+ <span class="ft-kpi-label">Fits tracked</span>
+ <span class="ft-kpi-val" id="ft-k-fits">·</span>
+ <span class="ft-kpi-sub" id="ft-k-fits-note"></span>
+ </div>
+ </div>
+
+ <div class="ft-error" id="ft-board-error" role="alert" hidden>
+ <h2>Could not load the cosmetics ledger</h2>
+ <p id="ft-board-error-msg"></p>
+ <button type="button" class="ft-mini" id="ft-retry">Retry</button>
+ </div>
+
+ <div class="ft-empty" id="ft-empty" hidden>
+ <h2>The cosmetics economy is quiet right now</h2>
+ <p>
+ No premium fits have sold yet. Buy one in <a href="/play">Play</a> and you top
+ the rarity board while the coin world's creator earns their cut, or forge an
+ original piece in the <a href="/wardrobe">Wardrobe</a>.
+ </p>
+ </div>
+
+ <section class="ft-section" aria-labelledby="ft-fits-h">
+ <div class="ft-section-h">
+ <h2 id="ft-fits-h">Rarest fits</h2>
+ <span class="ft-section-note">Ranked by how few wallets own them</span>
+ </div>
+ <div class="ft-fits" id="ft-fits"></div>
+ </section>
+
+ <div class="ft-cols">
+ <section class="ft-section" aria-labelledby="ft-collectors-h">
+ <div class="ft-section-h">
+ <h2 id="ft-collectors-h">Top collectors</h2>
+ <span class="ft-section-note">Rarity-weighted</span>
+ </div>
+ <ul class="ft-list" id="ft-collectors"></ul>
+ </section>
+
+ <section class="ft-section" aria-labelledby="ft-creators-h">
+ <div class="ft-section-h">
+ <h2 id="ft-creators-h">Top creators</h2>
+ <span class="ft-section-note">Settled USDC</span>
+ </div>
+ <ul class="ft-list" id="ft-creators"></ul>
+ </section>
+ </div>
+
+ <section class="ft-section" aria-labelledby="ft-recent-h">
+ <div class="ft-section-h">
+ <h2 id="ft-recent-h">Latest sales</h2>
+ <span class="ft-section-note">Every row is a settled payment</span>
+ </div>
+ <ul class="ft-list" id="ft-recent"></ul>
+ </section>
+
+ <section class="ft-lookup" aria-labelledby="ft-lookup-h">
+ <h2 id="ft-lookup-h">Creator earnings lookup</h2>
+ <p>
+ Paste any Solana creator wallet to see its settled cosmetic earnings: lifetime
+ and 30-day totals, paid versus pending, and the breakdown by cosmetic and coin
+ world. Public data, no account needed.
+ </p>
+ <form class="ft-lookup-form" id="ft-lookup-form">
+ <input
+ class="ft-input"
+ id="ft-lookup-input"
+ type="text"
+ inputmode="text"
+ autocomplete="off"
+ spellcheck="false"
+ placeholder="Creator wallet address"
+ aria-label="Creator wallet address"
+ />
+ <button class="ft-btn" type="submit">Look up earnings</button>
+ </form>
+
+ <div class="ft-earnings" id="ft-earnings" hidden>
+ <div class="ft-error" id="ft-earnings-error" role="alert" hidden>
+ <h2>Lookup failed</h2>
+ <p id="ft-earnings-error-msg"></p>
+ </div>
+ <div id="ft-earnings-out"></div>
+ </div>
+ </section>
+
+ <p class="ft-fineprint">
+ Every figure here is read from the settled-sale ledger, never estimated: a row
+ exists only after its USDC payment settled. "Recent sales volume" sums the sales
+ window this board returns, not all time. Creator payouts route to the wallet
+ resolved from the coin's launch records, so a split configuration can never
+ redirect another coin's revenue. See the
+ <a href="/x402-revenue">endpoint revenue</a> and
+ <a href="/receipts">receipt vault</a> for the other sides of the platform ledger.
+ </p>
+ </main>
+
+ <script type="module" src="/src/fits.js"></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/pages/forge.html b/pages/forge.html
index ad35bf55a..2778fba1e 100644
--- a/pages/forge.html
+++ b/pages/forge.html
@@ -3860,6 +3860,7 @@
<script src="/nav.js" defer></script>
<script type="module" src="/src/forge.js"></script>
<script type="module" src="/src/forge-prompt-studio.js"></script>
+ <script type="module" src="/src/forge-directed-prompt.js"></script>
<script type="module" src="/src/forge-enhance.js"></script>
<script type="module" src="/src/forge-refine.js"></script>
<script type="module" src="/src/forge-rig.js"></script>
diff --git a/pages/home.html b/pages/home.html
index 2c8a38a40..2650deb4d 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -83,7 +83,10 @@
<ul class="hero-bullets">
<li data-i18n-html="home.bullet_create"><strong>Create</strong> a 3D AI agent from a text prompt or selfie in about a minute</li>
<li data-i18n-html="home.bullet_embed"><strong>Embed</strong> it on any website with two lines of HTML</li>
- <li data-i18n-html="home.bullet_earn"><strong>Earn</strong> USDC per chat with x402 micropayments</li>
+ <!-- Monetization is the one promise a newcomer has no context for yet
+ (it names a payment protocol in the first screen), so it joins the
+ advanced tier. The other two ARE the first-run journey. -->
+ <li data-tier="advanced" data-i18n-html="home.bullet_earn"><strong>Earn</strong> USDC per chat with x402 micropayments</li>
</ul>
<!-- Hero forge bar: the site's one job, right where the eye lands. Types
straight into the live mini-forge below (relocated directly under the
diff --git a/pages/openai/index.html b/pages/openai/index.html
index b5522f90c..128114d9f 100644
--- a/pages/openai/index.html
+++ b/pages/openai/index.html
@@ -157,6 +157,7 @@
</a>
<a href="/forge" class="btn btn-sec" data-i18n="openai_index.try_it_in_the_browser">Try it in the browser</a>
<a href="/blog/three-ws-openai-select-partner" class="btn btn-sec" data-i18n="openai_index.read_the_announcement">Read the announcement</a>
+ <a href="/press" class="btn btn-sec">Press kit</a>
</div>
<section>
diff --git a/pages/scan.html b/pages/scan.html
deleted file mode 100644
index e246c0d98..000000000
--- a/pages/scan.html
+++ /dev/null
@@ -1,2219 +0,0 @@
-<!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" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <title data-i18n="scan.meta_title">3D Scanner · Scan yourself into 3D · three.ws</title>
- <link rel="icon" href="/favicon.ico" sizes="any" />
- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
- <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
- <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
- <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
- <link rel="manifest" href="/manifest.webmanifest" />
- <meta
- name="description"
- content="Point your camera, hold still, and walk away with a rigged 3D model of yourself — in about a minute. Free, in your browser."
- data-i18n-attr="content:scan.meta_description"/>
- <meta name="robots" content="index, follow" />
-
- <meta property="og:type" content="website" />
- <meta property="og:site_name" content="three.ws" />
- <meta property="og:url" content="https://three.ws/create/selfie" />
- <meta property="og:title" content="3D Scanner · Scan yourself into 3D" data-i18n-attr="content:scan.meta_og_title"/>
- <meta
- property="og:description"
- content="Point your camera, hold still, walk away with a rigged 3D model of yourself. Free, in your browser."
- data-i18n-attr="content:scan.meta_og_description"/>
- <meta property="og:image" content="https://three.ws/api/page-og?s=build&amp;t=3D+Scanner+%E2%80%94+Scan+Yourself+into+3D&amp;d=Point+your+camera+at+your+face%2C+hold+still%2C+and+walk+away+with+a+rigged+3D+avatar+%E2%80%94+reconstruction+runs+in+about+a+minute%2C+free%2C+in+your+browser.&amp;p=%2Fscan" />
- <meta name="twitter:card" content="summary_large_image" />
-
- <style>
- :root {
- color-scheme: dark;
- --bg: #000000;
- --panel: #0a0a0a;
- --panel-elev: #111111;
- --border: #1a1a1a;
- --border-strong: #2a2a2a;
- --text: #e8e8e8;
- --muted: #888888;
- --accent: #ffffff;
- --accent-ink: #000000;
- --scan: #6ee7ff;
- --scan-dim: rgba(110, 231, 255, 0.12);
- --danger: #f87171;
- --danger-dim: #4a1a1a;
- }
- * {
- box-sizing: border-box;
- }
- html,
- body {
- margin: 0;
- padding: 0;
- }
- body {
- font:
- 15px/1.55 -apple-system,
- BlinkMacSystemFont,
- 'Segoe UI',
- Roboto,
- sans-serif;
- color: var(--text);
- background: var(--bg);
- min-height: 100vh;
- overflow-x: hidden;
- }
- body::before {
- content: '';
- position: fixed;
- inset: 0;
- z-index: -1;
- pointer-events: none;
- background:
- radial-gradient(
- 800px 500px at 50% -80px,
- rgba(110, 231, 255, 0.06) 0,
- transparent 70%
- ),
- radial-gradient(
- 600px 400px at 50% 110%,
- rgba(110, 231, 255, 0.05) 0,
- transparent 70%
- ),
- #000000;
- }
- main.stage {
- max-width: 720px;
- margin: 0 auto;
- padding: 28px 20px 96px;
- }
- .topbar {
- display: flex;
- align-items: center;
- gap: 14px;
- margin-bottom: 24px;
- }
- .topbar button.back {
- background: var(--panel);
- border: 1px solid var(--border);
- color: var(--text);
- width: 36px;
- height: 36px;
- border-radius: 9px;
- font: inherit;
- cursor: pointer;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- }
- .topbar button.back:hover {
- border-color: var(--border-strong);
- }
- .topbar .label {
- font-size: 12px;
- letter-spacing: 0.06em;
- text-transform: uppercase;
- color: var(--muted);
- }
- .topbar .label strong {
- color: var(--text);
- font-weight: 600;
- }
- .topbar .badge {
- margin-left: auto;
- font-size: 10.5px;
- font-weight: 700;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- color: var(--scan);
- border: 1px solid var(--scan-dim);
- background: var(--scan-dim);
- border-radius: 999px;
- padding: 4px 10px;
- }
- h1 {
- font-size: 30px;
- line-height: 1.2;
- margin: 0 0 8px;
- letter-spacing: -0.02em;
- }
- h1 .hl {
- color: var(--scan);
- }
- .sub {
- color: var(--muted);
- margin: 0 0 24px;
- line-height: 1.55;
- }
-
- .alt-path {
- color: var(--muted);
- font-size: 0.88rem;
- margin: -10px 0 24px;
- line-height: 1.55;
- }
- .alt-path a {
- color: var(--scan);
- text-decoration: none;
- font-weight: 500;
- }
- .alt-path a:hover,
- .alt-path a:focus-visible {
- text-decoration: underline;
- }
-
- .step {
- display: none;
- opacity: 0;
- }
- .step.active {
- display: block;
- animation: step-in 400ms ease forwards;
- }
- @keyframes step-in {
- from {
- opacity: 0;
- transform: translateY(12px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
- }
-
- .unsupported {
- display: none;
- padding: 12px 14px;
- background: rgba(239, 77, 77, 0.08);
- border: 1px solid var(--danger-dim);
- border-radius: 9px;
- color: #f4b5b5;
- font-size: 13.5px;
- margin: 0 0 20px;
- }
- .unsupported.show {
- display: block;
- }
-
- /* ── Scanner hero ─────────────────────────────────────────────────── */
- .hero-slot-wrap {
- margin: 8px 0 18px;
- }
- .hero-slot {
- aspect-ratio: 3 / 4;
- max-width: 380px;
- margin: 0 auto;
- background:
- linear-gradient(rgba(110, 231, 255, 0.04), rgba(110, 231, 255, 0.04)),
- var(--panel);
- border: 1.5px dashed var(--border-strong);
- border-radius: 18px;
- position: relative;
- overflow: hidden;
- cursor: pointer;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 10px;
- color: var(--muted);
- transition:
- border-color 120ms,
- background 120ms;
- }
- .hero-slot::before {
- content: '';
- position: absolute;
- inset: 0;
- pointer-events: none;
- opacity: 0.5;
- background-image:
- linear-gradient(var(--scan-dim) 1px, transparent 1px),
- linear-gradient(90deg, var(--scan-dim) 1px, transparent 1px);
- background-size: 28px 28px;
- mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 72%);
- -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 72%);
- }
- .hero-slot:hover,
- .hero-slot:focus-visible {
- border-color: var(--scan);
- color: var(--text);
- outline: none;
- }
- .hero-slot.drag {
- border-color: var(--scan);
- background: rgba(110, 231, 255, 0.06);
- cursor: copy;
- }
- .hero-slot.filled {
- border-style: solid;
- border-color: var(--border);
- padding: 0;
- cursor: default;
- }
- .hero-slot.error {
- border-color: var(--danger);
- }
- .hero-slot .hero-icon {
- width: 56px;
- height: 56px;
- border-radius: 50%;
- display: grid;
- place-items: center;
- border: 1.5px solid var(--scan);
- color: var(--scan);
- position: relative;
- z-index: 1;
- box-shadow: 0 0 0 6px var(--scan-dim);
- }
- .hero-slot .hero-title {
- font-size: 16px;
- color: var(--text);
- font-weight: 600;
- position: relative;
- z-index: 1;
- }
- .hero-slot .hero-sub {
- font-size: 13px;
- color: var(--muted);
- max-width: 260px;
- text-align: center;
- line-height: 1.45;
- position: relative;
- z-index: 1;
- }
- .hero-slot img.preview {
- width: 100%;
- height: 100%;
- object-fit: cover;
- display: block;
- }
- .hero-slot .retake-btn {
- position: absolute;
- top: 12px;
- right: 12px;
- background: rgba(0, 0, 0, 0.65);
- backdrop-filter: blur(8px);
- -webkit-backdrop-filter: blur(8px);
- border: 1px solid rgba(255, 255, 255, 0.15);
- color: var(--text);
- border-radius: 9px;
- padding: 8px 12px;
- font: 600 12px/1 inherit;
- cursor: pointer;
- display: inline-flex;
- align-items: center;
- gap: 6px;
- transition: background 120ms;
- z-index: 2;
- }
- .hero-slot .retake-btn:hover {
- background: rgba(0, 0, 0, 0.85);
- }
- .hero-actions {
- display: flex;
- justify-content: center;
- gap: 10px;
- margin-top: 14px;
- flex-wrap: wrap;
- }
- .hero-pill {
- background: var(--panel);
- border: 1px solid var(--border);
- color: var(--muted);
- border-radius: 999px;
- padding: 8px 16px;
- font: 500 12.5px/1 inherit;
- cursor: pointer;
- transition:
- color 120ms,
- border-color 120ms;
- display: inline-flex;
- align-items: center;
- gap: 7px;
- }
- .hero-pill:hover {
- color: var(--text);
- border-color: var(--border-strong);
- }
- .hero-pill[data-action='open-camera'] {
- border-color: var(--scan-dim);
- color: var(--scan);
- }
- .hero-pill[data-action='open-camera']:hover {
- border-color: var(--scan);
- }
- .hero-pill[hidden] {
- display: none;
- }
- .hero-pill svg {
- display: block;
- }
-
- .fidelity {
- margin: 0 0 22px;
- border: 1px solid var(--border);
- background: var(--panel);
- border-radius: 12px;
- overflow: hidden;
- }
- .fidelity summary {
- list-style: none;
- padding: 14px 16px;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 12px;
- color: var(--text);
- }
- .fidelity summary::-webkit-details-marker {
- display: none;
- }
- .fidelity .fid-label {
- font-size: 14px;
- font-weight: 600;
- }
- .fidelity .fid-note {
- color: var(--muted);
- font-size: 12.5px;
- font-weight: 400;
- }
- .fidelity .fid-chev {
- color: var(--muted);
- transition: transform 200ms;
- }
- .fidelity[open] .fid-chev {
- transform: rotate(180deg);
- }
- .fidelity .fid-body {
- padding: 4px 16px 18px;
- }
- .slots {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 12px;
- }
- .slot-frame {
- aspect-ratio: 3 / 4;
- background: var(--panel-elev);
- border: 1.5px dashed var(--border-strong);
- border-radius: 11px;
- position: relative;
- overflow: hidden;
- cursor: pointer;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 6px;
- color: var(--muted);
- transition:
- border-color 120ms,
- background 120ms;
- }
- .slot-frame:hover,
- .slot-frame:focus-visible {
- border-color: var(--scan);
- color: var(--text);
- outline: none;
- }
- .slot-frame.drag {
- border-color: var(--scan);
- background: rgba(110, 231, 255, 0.06);
- cursor: copy;
- }
- .slot-frame.filled {
- border-style: solid;
- border-color: var(--border);
- padding: 0;
- }
- .slot-frame.error {
- border-color: var(--danger);
- }
- .slot-frame .slot-label {
- font-size: 11.5px;
- letter-spacing: 0.06em;
- text-transform: uppercase;
- color: var(--muted);
- }
- .slot-frame .slot-hint {
- font-size: 13px;
- color: var(--text);
- font-weight: 500;
- }
- .slot-frame img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- display: block;
- }
- .slot-frame .retake-btn {
- position: absolute;
- top: 8px;
- right: 8px;
- background: rgba(0, 0, 0, 0.7);
- border: 1px solid rgba(255, 255, 255, 0.2);
- color: var(--text);
- border-radius: 7px;
- padding: 4px 9px;
- font: 600 11px/1 inherit;
- cursor: pointer;
- }
-
- .opts {
- margin: 0 0 22px;
- display: flex;
- flex-direction: column;
- gap: 18px;
- }
- .opt-group .opt-label {
- font-size: 12px;
- letter-spacing: 0.06em;
- text-transform: uppercase;
- color: var(--muted);
- margin: 0 0 10px;
- }
- .toggle {
- display: inline-flex;
- background: var(--panel);
- border: 1px solid var(--border);
- border-radius: 9px;
- padding: 3px;
- gap: 2px;
- }
- .toggle button {
- background: transparent;
- border: none;
- color: var(--muted);
- font: 600 13px/1 inherit;
- padding: 8px 14px;
- border-radius: 7px;
- cursor: pointer;
- }
- .toggle button[aria-pressed='true'] {
- background: var(--panel-elev);
- color: var(--text);
- }
- .toggle button:hover {
- color: var(--text);
- }
- .style-grid {
- display: grid;
- grid-template-columns: 1fr 1fr;
- gap: 10px;
- }
- .style-card {
- background: var(--panel);
- border: 1.5px solid var(--border);
- border-radius: 11px;
- padding: 12px;
- cursor: pointer;
- text-align: left;
- color: var(--text);
- font: inherit;
- display: flex;
- gap: 12px;
- align-items: center;
- transition:
- border-color 120ms,
- transform 120ms;
- }
- .style-card:hover {
- border-color: var(--border-strong);
- transform: translateY(-1px);
- }
- .style-card[aria-pressed='true'] {
- border-color: var(--scan);
- background: rgba(110, 231, 255, 0.05);
- }
- .style-swatch {
- width: 44px;
- height: 44px;
- border-radius: 8px;
- flex-shrink: 0;
- background-size: cover;
- background-position: center;
- border: 1px solid var(--border);
- }
- .style-swatch.photoreal {
- background: radial-gradient(
- circle at 35% 30%,
- #f6c79b 0%,
- #c98c61 45%,
- #4a2e1d 95%
- );
- }
- .style-swatch.stylized {
- background: radial-gradient(
- circle at 35% 30%,
- #ffd5e8 0%,
- #c4a3ff 45%,
- #5a3aa3 95%
- );
- }
- .style-card .style-title {
- font-size: 14px;
- font-weight: 600;
- line-height: 1.2;
- margin: 0 0 2px;
- }
- .style-card .style-desc {
- font-size: 12px;
- color: var(--muted);
- line-height: 1.35;
- }
-
- .steps-strip {
- display: flex;
- gap: 8px;
- margin: 0 0 22px;
- flex-wrap: wrap;
- }
- .steps-strip .chip {
- font-size: 12px;
- color: var(--muted);
- border: 1px solid var(--border);
- border-radius: 999px;
- padding: 6px 12px;
- display: inline-flex;
- align-items: center;
- gap: 7px;
- background: var(--panel);
- }
- .steps-strip .chip b {
- color: var(--scan);
- font-weight: 700;
- }
-
- /* ── Building ─────────────────────────────────────────────────────── */
- .build-progress {
- display: flex;
- flex-direction: column;
- gap: 0;
- margin: 0 0 28px;
- }
- .build-step {
- display: flex;
- align-items: flex-start;
- gap: 12px;
- padding: 10px 0;
- position: relative;
- transition: opacity 200ms;
- }
- .build-step:not(:last-child)::after {
- content: '';
- position: absolute;
- left: 9px;
- top: 30px;
- bottom: -10px;
- width: 2px;
- background: var(--border);
- }
- .build-step.completed::after {
- background: rgba(110, 231, 255, 0.4);
- }
- .bstep-dot {
- width: 20px;
- height: 20px;
- border-radius: 50%;
- border: 2px solid var(--border-strong);
- background: var(--panel);
- flex-shrink: 0;
- margin-top: 1px;
- position: relative;
- z-index: 1;
- }
- .build-step.completed .bstep-dot {
- background: var(--scan);
- border-color: var(--scan);
- }
- .build-step.completed .bstep-dot::after {
- content: '';
- display: block;
- width: 5px;
- height: 9px;
- border: 2px solid var(--accent-ink);
- border-top: none;
- border-left: none;
- transform: rotate(45deg) translate(-1px, -1px);
- position: absolute;
- top: 2px;
- left: 5px;
- }
- .build-step.active .bstep-dot {
- border-color: var(--scan);
- animation: bstep-pulse 1.4s ease-in-out infinite;
- }
- @keyframes bstep-pulse {
- 0%,
- 100% {
- box-shadow: 0 0 0 0 rgba(110, 231, 255, 0.4);
- }
- 50% {
- box-shadow: 0 0 0 6px rgba(110, 231, 255, 0);
- }
- }
- .bstep-label {
- font-size: 14px;
- color: var(--muted);
- line-height: 1.4;
- padding-top: 1px;
- }
- .build-step.active .bstep-label {
- color: var(--text);
- font-weight: 500;
- }
- .build-step.completed {
- opacity: 0.65;
- }
- .build-step.failed .bstep-dot {
- background: var(--danger);
- border-color: var(--danger);
- animation: none;
- }
- .build-step.failed .bstep-dot::after {
- content: '×';
- display: block;
- color: #fff;
- font: 700 14px/1 sans-serif;
- text-align: center;
- position: absolute;
- top: -1px;
- left: 2px;
- }
- .build-step.failed .bstep-label {
- color: var(--danger);
- font-weight: 500;
- }
- .build-step.failed::after {
- background: var(--danger-dim);
- }
-
- .build-viewer {
- position: relative;
- width: 100%;
- max-width: 320px;
- margin: 0 auto 24px;
- aspect-ratio: 3 / 4;
- border-radius: 16px;
- overflow: hidden;
- background: var(--panel);
- border: 1px solid var(--border);
- }
- .build-viewer model-viewer {
- width: 100%;
- height: 100%;
- --poster-color: transparent;
- }
- .build-preview {
- position: absolute;
- top: 18px;
- left: 50%;
- transform: translateX(-50%);
- width: 110px;
- height: 110px;
- border-radius: 50%;
- object-fit: cover;
- border: 2px solid var(--scan);
- box-shadow:
- 0 8px 24px -4px rgba(0, 0, 0, 0.6),
- 0 0 0 4px rgba(110, 231, 255, 0.18);
- background: var(--panel);
- opacity: 0;
- transition: opacity 320ms ease;
- animation: preview-breathe 2.4s ease-in-out infinite;
- }
- .build-preview.show {
- opacity: 1;
- }
- @keyframes preview-breathe {
- 0%,
- 100% {
- box-shadow:
- 0 8px 24px -4px rgba(0, 0, 0, 0.6),
- 0 0 0 4px rgba(110, 231, 255, 0.18);
- }
- 50% {
- box-shadow:
- 0 8px 24px -4px rgba(0, 0, 0, 0.6),
- 0 0 0 9px rgba(110, 231, 255, 0.08);
- }
- }
- .build-veil {
- position: absolute;
- inset: 0;
- display: flex;
- align-items: flex-end;
- justify-content: center;
- padding-bottom: 18px;
- background: linear-gradient(
- to bottom,
- rgba(5, 6, 10, 0.05),
- rgba(5, 6, 10, 0.45) 65%
- );
- pointer-events: none;
- }
- .build-ring {
- width: 36px;
- height: 36px;
- border-radius: 50%;
- border: 2.5px solid rgba(110, 231, 255, 0.15);
- border-top-color: var(--scan);
- animation: build-spin 1s linear infinite;
- }
- @keyframes build-spin {
- to {
- transform: rotate(360deg);
- }
- }
- .build-error {
- display: none;
- padding: 12px 14px;
- background: rgba(239, 77, 77, 0.08);
- border: 1px solid var(--danger-dim);
- border-radius: 9px;
- color: #f4b5b5;
- font-size: 13.5px;
- margin: 0 0 16px;
- }
- .build-error.show {
- display: block;
- }
- .build-retry {
- width: 100%;
- max-width: 320px;
- margin: 0 auto;
- display: none;
- padding: 12px 18px;
- background: var(--panel);
- border: 1px solid var(--border);
- border-radius: 10px;
- color: var(--text);
- font: 600 14px/1 inherit;
- cursor: pointer;
- text-align: center;
- }
- .build-retry.show {
- display: block;
- }
- .build-retry:hover {
- border-color: var(--border-strong);
- }
-
- /* ── Done ─────────────────────────────────────────────────────────── */
- [data-step='done'] h1 {
- text-align: center;
- }
- [data-step='done'] .sub {
- text-align: center;
- }
- .done-viewer {
- position: relative;
- width: 100%;
- max-width: 340px;
- margin: 0 auto 22px;
- aspect-ratio: 3 / 4;
- border-radius: 16px;
- overflow: hidden;
- background: var(--panel);
- border: 1px solid var(--border);
- }
- .done-viewer::after {
- content: '';
- position: absolute;
- inset: -2px;
- border-radius: 18px;
- background: conic-gradient(
- from 0deg,
- var(--scan),
- rgba(136, 136, 136, 0.3),
- var(--scan),
- rgba(136, 136, 136, 0.3)
- );
- z-index: -1;
- animation: done-glow 6s linear infinite;
- opacity: 0.45;
- }
- @keyframes done-glow {
- to {
- transform: rotate(360deg);
- }
- }
- .done-viewer model-viewer {
- width: 100%;
- height: 100%;
- --poster-color: transparent;
- }
- .viewer-error {
- position: absolute;
- inset: 0;
- display: none;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- gap: 8px;
- padding: 22px;
- text-align: center;
- font-size: 13px;
- line-height: 1.5;
- color: var(--muted);
- background: var(--panel);
- }
- .viewer-error.show {
- display: flex;
- }
- .name-row {
- margin: 0 0 18px;
- }
- .name-input {
- width: 100%;
- padding: 12px 14px;
- background: var(--panel);
- border: 1px solid var(--border-strong);
- border-radius: 10px;
- color: var(--text);
- font: 15px/1 inherit;
- outline: none;
- transition: border-color 120ms;
- }
- .name-input:focus {
- border-color: var(--scan);
- }
- .name-input::placeholder {
- color: var(--muted);
- }
-
- .export-row {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 10px;
- margin: 0 0 14px;
- }
- .export-btn {
- padding: 12px 8px;
- background: var(--panel);
- border: 1px solid var(--border);
- border-radius: 10px;
- color: var(--text);
- font: 600 13px/1.2 inherit;
- cursor: pointer;
- transition:
- border-color 120ms,
- color 120ms;
- display: flex;
- flex-direction: column;
- align-items: center;
- gap: 6px;
- }
- .export-btn:hover:not(:disabled) {
- border-color: var(--scan);
- }
- .export-btn:disabled {
- opacity: 0.5;
- cursor: progress;
- }
- .export-btn svg {
- display: block;
- color: var(--scan);
- }
- .export-btn .ext {
- font-size: 11px;
- color: var(--muted);
- font-weight: 500;
- letter-spacing: 0.04em;
- }
-
- .done-actions {
- display: flex;
- flex-direction: column;
- gap: 10px;
- }
- .btn-save {
- width: 100%;
- padding: 14px 18px;
- background: var(--scan);
- color: var(--accent-ink);
- border: none;
- border-radius: 10px;
- font: 700 15px/1 inherit;
- cursor: pointer;
- transition: filter 120ms;
- }
- .btn-save:hover {
- filter: brightness(1.06);
- }
- .btn-save:disabled {
- opacity: 0.55;
- cursor: not-allowed;
- filter: none;
- }
- .btn-share {
- width: 100%;
- padding: 13px 18px;
- background: transparent;
- color: var(--text);
- border: 1px solid var(--scan);
- border-radius: 10px;
- font: 600 14px/1 inherit;
- cursor: pointer;
- transition: background 120ms;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- gap: 8px;
- }
- .btn-share:hover {
- background: var(--scan-dim);
- }
- .btn-share svg {
- color: var(--scan);
- }
- .btn-ghost {
- width: 100%;
- padding: 12px 18px;
- background: var(--panel);
- color: var(--muted);
- border: 1px solid var(--border);
- border-radius: 10px;
- font: 500 14px/1 inherit;
- cursor: pointer;
- transition:
- color 120ms,
- border-color 120ms;
- }
- .btn-ghost:hover {
- color: var(--text);
- border-color: var(--border-strong);
- }
- .share-toast {
- text-align: center;
- font-size: 12.5px;
- color: var(--scan);
- min-height: 18px;
- margin: 6px 0 0;
- opacity: 0;
- transition: opacity 200ms;
- }
- .share-toast.show {
- opacity: 1;
- }
- .portability-note {
- margin-top: 22px;
- padding: 14px 16px;
- background: rgba(110, 231, 255, 0.04);
- border: 1px solid rgba(110, 231, 255, 0.14);
- border-radius: 10px;
- font-size: 13px;
- color: var(--muted);
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 12px;
- flex-wrap: wrap;
- }
- .portability-note a {
- color: var(--scan);
- text-decoration: none;
- white-space: nowrap;
- font-weight: 500;
- }
- .portability-note a:hover {
- text-decoration: underline;
- }
-
- .submit-bar {
- margin-top: 6px;
- position: sticky;
- bottom: 16px;
- z-index: 2;
- }
- .submit-bar[hidden] {
- display: none;
- }
- #submit-btn {
- width: 100%;
- padding: 16px 18px;
- background: var(--panel);
- color: var(--muted);
- border: 1px solid var(--border);
- border-radius: 12px;
- font: 700 15px/1.2 inherit;
- cursor: not-allowed;
- transition:
- background 120ms,
- color 120ms,
- border-color 120ms;
- display: flex;
- align-items: center;
- justify-content: center;
- gap: 10px;
- }
- #submit-btn .meta {
- font: 500 12px/1 inherit;
- color: var(--muted);
- opacity: 0.85;
- }
- #submit-btn.ready {
- background: var(--scan);
- color: var(--accent-ink);
- border-color: var(--scan);
- cursor: pointer;
- box-shadow: 0 10px 30px -10px rgba(110, 231, 255, 0.4);
- animation: btn-ready 300ms ease;
- }
- @keyframes btn-ready {
- from {
- transform: scale(0.97);
- opacity: 0.8;
- }
- to {
- transform: scale(1);
- opacity: 1;
- }
- }
- #submit-btn.ready .meta {
- color: rgba(10, 10, 10, 0.7);
- }
- #submit-btn.ready:hover {
- filter: brightness(0.94);
- }
-
- /* ── Camera overlay (driven by selfie-capture.js) ─────────────────── */
- #cam-overlay {
- position: fixed;
- inset: 0;
- background: #000;
- z-index: 1000;
- display: none;
- flex-direction: column;
- }
- #cam-overlay.open {
- display: flex;
- }
- #cam-stage {
- position: relative;
- flex: 1;
- min-height: 0;
- overflow: hidden;
- }
- #cam-stage video,
- #cam-stage img.preview {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- #cam-stage video {
- transform: scaleX(-1);
- }
- #cam-mesh-overlay {
- position: absolute;
- inset: 0;
- width: 100%;
- height: 100%;
- object-fit: cover;
- transform: scaleX(-1);
- pointer-events: none;
- z-index: 1;
- }
- .cam-badges {
- position: absolute;
- top: env(safe-area-inset-top, 12px);
- left: 12px;
- right: 12px;
- display: flex;
- gap: 5px;
- flex-wrap: wrap;
- z-index: 3;
- padding-top: 50px;
- }
- .cam-badge-chip {
- font-size: 10.5px;
- font-weight: 600;
- padding: 3px 8px;
- border-radius: 6px;
- letter-spacing: 0.03em;
- text-transform: uppercase;
- background: rgba(0, 0, 0, 0.55);
- border: 1px solid rgba(255, 255, 255, 0.1);
- color: rgba(255, 255, 255, 0.5);
- backdrop-filter: blur(6px);
- }
- .cam-badge-chip.ok {
- color: var(--scan);
- border-color: rgba(110, 231, 255, 0.35);
- background: rgba(110, 231, 255, 0.12);
- }
- .cam-badge-chip.bad {
- color: #ff6b6b;
- border-color: rgba(255, 107, 107, 0.3);
- background: rgba(255, 107, 107, 0.08);
- }
- .cam-prompt {
- position: absolute;
- top: env(safe-area-inset-top, 18px);
- left: 0;
- right: 0;
- text-align: center;
- color: rgba(255, 255, 255, 0.92);
- font-size: 13px;
- letter-spacing: 0.06em;
- text-transform: uppercase;
- padding: 16px 18px;
- background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
- pointer-events: none;
- }
- .cam-prompt strong {
- font-weight: 600;
- color: var(--scan);
- }
- .cam-oval {
- position: absolute;
- inset: 0;
- pointer-events: none;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .cam-oval svg {
- width: min(70vw, 60vh);
- height: auto;
- max-height: 75vh;
- }
- .cam-oval ellipse {
- fill: none;
- stroke: rgba(110, 231, 255, 0.5);
- stroke-width: 3;
- stroke-dasharray: 12 8;
- transition: stroke 200ms;
- }
- .cam-oval.detected ellipse {
- stroke: var(--scan);
- stroke-dasharray: 0;
- filter: drop-shadow(0 0 8px rgba(110, 231, 255, 0.5));
- }
- .cam-hint {
- position: absolute;
- bottom: 100px;
- left: 0;
- right: 0;
- text-align: center;
- color: rgba(255, 255, 255, 0.85);
- font-size: 13px;
- padding: 8px 18px;
- pointer-events: none;
- transition: opacity 200ms;
- }
- .cam-hint.ok {
- color: var(--scan);
- }
- #cam-error {
- position: absolute;
- top: 60px;
- left: 16px;
- right: 16px;
- padding: 10px 14px;
- background: rgba(239, 77, 77, 0.92);
- color: white;
- border-radius: 9px;
- font-size: 13.5px;
- text-align: center;
- }
- .cam-bar {
- padding: 16px 22px calc(env(safe-area-inset-bottom, 18px) + 18px);
- background: rgba(0, 0, 0, 0.7);
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 16px;
- }
- .cam-bar button {
- background: rgba(255, 255, 255, 0.08);
- color: var(--text);
- border: 1px solid rgba(255, 255, 255, 0.18);
- border-radius: 9px;
- padding: 10px 16px;
- font: 600 14px/1 inherit;
- cursor: pointer;
- min-width: 88px;
- }
- .cam-bar button.shutter {
- width: 72px;
- height: 72px;
- border-radius: 50%;
- background: var(--scan);
- color: var(--accent-ink);
- border: none;
- padding: 0;
- min-width: 72px;
- }
- .cam-bar button.shutter::before {
- content: '';
- display: block;
- width: 56px;
- height: 56px;
- border-radius: 50%;
- border: 3px solid var(--accent-ink);
- margin: 0 auto;
- }
- .cam-bar button.shutter:disabled {
- opacity: 0.35;
- cursor: not-allowed;
- filter: grayscale(0.6);
- transition:
- opacity 200ms,
- filter 200ms;
- }
- .cam-bar .spacer {
- flex: 1;
- }
- .cam-countdown {
- position: absolute;
- inset: 0;
- display: none;
- align-items: center;
- justify-content: center;
- pointer-events: none;
- z-index: 4;
- }
- .cam-countdown.show {
- display: flex;
- }
- .cam-countdown .count-num {
- font:
- 700 96px/1 -apple-system,
- BlinkMacSystemFont,
- 'Segoe UI',
- sans-serif;
- color: var(--scan);
- text-shadow:
- 0 4px 18px rgba(0, 0, 0, 0.6),
- 0 0 24px rgba(110, 231, 255, 0.5);
- animation: cd-pop 1s ease-out forwards;
- }
- @keyframes cd-pop {
- 0% {
- transform: scale(0.5);
- opacity: 0;
- }
- 20% {
- transform: scale(1.15);
- opacity: 1;
- }
- 80% {
- transform: scale(1);
- opacity: 1;
- }
- 100% {
- transform: scale(0.8);
- opacity: 0;
- }
- }
-
- .photo-tips {
- margin: 16px 0 0;
- padding: 12px 16px;
- background: rgba(255, 255, 255, 0.03);
- border: 1px solid rgba(255, 255, 255, 0.08);
- border-radius: 10px;
- font-size: 13px;
- color: var(--muted);
- }
- .photo-tips .tips-title {
- margin: 0 0 6px;
- font-weight: 600;
- font-size: 12px;
- letter-spacing: 0.04em;
- text-transform: uppercase;
- color: var(--text);
- opacity: 0.7;
- }
- .photo-tips ul {
- margin: 0;
- padding-left: 18px;
- list-style: disc;
- }
- .photo-tips li {
- margin-bottom: 2px;
- line-height: 1.45;
- }
- .photo-tips li:last-child {
- margin-bottom: 0;
- }
- </style>
- <link rel="stylesheet" href="/mobile.css" />
- <script
- type="module"
- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"
- integrity="sha384-sr9b4Ux0WhAUGclJ0ym0FSY2zSOMmNSn0bP/SA0e6bNCrpn/5W3QL8mm+LdlQMKw"
- crossorigin="anonymous"
- ></script>
-
- <link rel="canonical" href="https://three.ws/create/selfie">
- <meta name="twitter:title" content="3D Scanner — Scan Yourself into 3D · three.ws" data-i18n-attr="content:scan.meta_twitter_title">
- <meta name="twitter:description" content="Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser." data-i18n-attr="content:scan.meta_twitter_description">
- <meta name="twitter:image" content="https://three.ws/api/page-og?s=build&amp;t=3D+Scanner+%E2%80%94+Scan+Yourself+into+3D&amp;d=Point+your+camera+at+your+face%2C+hold+still%2C+and+walk+away+with+a+rigged+3D+avatar+%E2%80%94+reconstruction+runs+in+about+a+minute%2C+free%2C+in+your+browser.&amp;p=%2Fscan">
- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"3D Scanner — Scan Yourself into 3D","description":"Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser.","url":"https://three.ws/scan","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
-
- <meta property="og:locale" content="en_US">
- <meta property="og:image:alt" content="3D Scanner — Scan Yourself into 3D — three.ws">
- <meta name="twitter:site" content="@trythreews">
- <script src="/model-viewer-meshopt.js"></script>
-</head>
- <body>
- <main class="stage">
- <div class="topbar">
- <button class="back" id="back-btn" aria-label="Back" type="button" data-i18n-attr="aria-label:scan.back_arialabel">
- <svg
- width="16"
- height="16"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2.2"
- stroke-linecap="round"
- stroke-linejoin="round"
- aria-hidden="true"
- >
- <line x1="19" y1="12" x2="5" y2="12" />
- <polyline points="12 19 5 12 12 5" />
- </svg>
- </button>
- <div class="label"><strong data-i18n="scan.three_ws">three.ws</strong> · 3D Scanner</div>
- <span class="badge" data-i18n="scan.beta">Beta</span>
- </div>
-
- <p id="unsupported-msg" class="unsupported" data-i18n="scan.your_browser_can_t_open_the_camera">
- Your browser can't open the camera here — use Upload instead, or open this page in
- Safari / Chrome on a device with a camera.
- </p>
-
- <!-- Step 1: capture -->
- <section class="step active" data-step="capture">
- <h1 data-i18n-html="scan.scan_yourself_into_3d">Scan yourself into <span class="hl">3D</span>.</h1>
- <p class="sub" data-i18n-html="scan.point_your_camera_and_hold_still_in">
- Point your camera and hold still. In about a minute you get a rigged 3D model of
- yourself that drops into any app, game, or stream. Photos are downscaled in your
- browser — nothing is stored on disk.
- Scanning an object instead of yourself?
- <a href="/image-to-3d">Image to 3D</a> turns any photo into a textured model.
- </p>
- <p class="alt-path" data-i18n-html="scan.rather_upload_a_single_photo_selfie_to">
- Rather upload a single photo?
- <a href="/create/selfie">Selfie to avatar</a> builds the same rigged model from
- one picture.
- </p>
-
- <div class="steps-strip" aria-hidden="true">
- <span class="chip" data-i18n-html="scan.1_scan"><b>1</b> Scan</span>
- <span class="chip" data-i18n-html="scan.2_build"><b>2</b> Build</span>
- <span class="chip" data-i18n-html="scan.3_download_share"><b>3</b> Download &amp; share</span>
- </div>
-
- <div class="hero-slot-wrap">
- <div
- class="hero-slot"
- data-slot="frontal"
- role="button"
- tabindex="0"
- aria-label="Start the scan with your camera or a photo"
- >
- <span class="hero-icon" aria-hidden="true">
- <svg
- width="26"
- height="26"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path
- d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"
- />
- <circle cx="12" cy="13" r="4" />
- </svg>
- </span>
- <span class="hero-title" data-i18n="scan.tap_to_start_scanning">Tap to start scanning</span>
- <span class="hero-sub"
- data-i18n="scan.live_face_tracking_guides_the_shot_or">Live face tracking guides the shot. Or drop in a photo — works on phone
- or desktop.</span
- >
- </div>
- <div class="hero-actions">
- <button
- type="button"
- class="hero-pill"
- data-action="open-camera"
- id="hero-camera-btn"
- >
- <svg
- width="14"
- height="14"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- aria-hidden="true"
- >
- <path
- d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"
- />
- <circle cx="12" cy="13" r="4" />
- </svg>
- Scan with camera
- </button>
- <button type="button" class="hero-pill" data-action="open-upload">
- <svg
- width="14"
- height="14"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- aria-hidden="true"
- >
- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
- <polyline points="17 8 12 3 7 8" />
- <line x1="12" y1="3" x2="12" y2="15" />
- </svg>
- Upload photo
- </button>
- </div>
- </div>
-
- <input
- type="file"
- data-slot-input="frontal"
- accept="image/jpeg,image/png,image/webp,image/heic,image/heif"
- hidden
- />
-
- <div class="photo-tips" id="photo-tips">
- <p class="tips-title" data-i18n="scan.for_the_sharpest_scan">For the sharpest scan</p>
- <ul>
- <li data-i18n="scan.face_the_camera_directly_no_extreme_angles">Face the camera directly — no extreme angles</li>
- <li data-i18n="scan.good_even_lighting_avoid_harsh_shadows_or">Good, even lighting — avoid harsh shadows or backlighting</li>
- <li data-i18n="scan.remove_sunglasses_masks_or_anything_covering">Remove sunglasses, masks, or anything covering your face</li>
- <li data-i18n="scan.keep_hair_away_from_your_forehead_and">Keep hair away from your forehead and jawline if possible</li>
- </ul>
- </div>
-
- <details class="fidelity" id="fidelity-boost">
- <summary>
- <div>
- <div class="fid-label">
- Add side angles
- <span class="fid-note"
- data-i18n="scan.optional_adds_30s_sharper_geometry">(optional — adds ~30s, sharper geometry)</span
- >
- </div>
- </div>
- <svg
- class="fid-chev"
- width="16"
- height="16"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2.4"
- stroke-linecap="round"
- stroke-linejoin="round"
- aria-hidden="true"
- >
- <polyline points="6 9 12 15 18 9" />
- </svg>
- </summary>
- <div class="fid-body">
- <div class="slots">
- <div
- class="slot-frame"
- data-slot="left"
- role="button"
- tabindex="0"
- aria-label="Left side photo slot"
- >
- <span class="slot-label" data-i18n="scan.left">Left</span>
- <span class="slot-hint" data-i18n="scan.turn_45_left">Turn ~45° left</span>
- </div>
- <div
- class="slot-frame"
- data-slot="right"
- role="button"
- tabindex="0"
- aria-label="Right side photo slot"
- >
- <span class="slot-label" data-i18n="scan.right">Right</span>
- <span class="slot-hint" data-i18n="scan.turn_45_right">Turn ~45° right</span>
- </div>
- </div>
- <input
- type="file"
- data-slot-input="left"
- accept="image/jpeg,image/png,image/webp,image/heic,image/heif"
- hidden
- />
- <input
- type="file"
- data-slot-input="right"
- accept="image/jpeg,image/png,image/webp,image/heic,image/heif"
- hidden
- />
- </div>
- </details>
-
- <div class="opts">
- <div class="opt-group">
- <p class="opt-label" data-i18n="scan.look">Look</p>
- <div class="style-grid" role="group" aria-label="Avatar style">
- <button
- type="button"
- class="style-card"
- data-type="v1"
- aria-pressed="true"
- data-i18n-html="scan.photoreal_likeness_first_closest_to_how_you">
- <span class="style-swatch photoreal" aria-hidden="true"></span>
- <span>
- <span class="style-title">Photoreal</span>
- <span class="style-desc"
- >Likeness-first. Closest to how you actually look.</span
- >
- </span>
- </button>
- <button
- type="button"
- class="style-card"
- data-type="v2"
- aria-pressed="false"
- data-i18n-html="scan.stylized_cleaner_cartoon_leaning_good_for_st">
- <span class="style-swatch stylized" aria-hidden="true"></span>
- <span>
- <span class="style-title">Stylized</span>
- <span class="style-desc"
- >Cleaner, cartoon-leaning. Good for streaming + games.</span
- >
- </span>
- </button>
- </div>
- </div>
- <div class="opt-group">
- <p class="opt-label" data-i18n="scan.body">Body</p>
- <div class="toggle" role="group" aria-label="Body type">
- <button type="button" data-body="male" aria-pressed="true" data-i18n="scan.masc">Masc</button>
- <button type="button" data-body="female" aria-pressed="false" data-i18n="scan.femme">
- Femme
- </button>
- </div>
- </div>
- </div>
-
- <div id="submit-bar" class="submit-bar">
- <button id="submit-btn" type="button" disabled data-i18n-html="scan.start_scanning_to_continue">
- <span class="label">Start scanning to continue</span>
- </button>
- </div>
- </section>
-
- <!-- Step 2: Building -->
- <section class="step" data-step="building">
- <h1 data-i18n="scan.reconstructing_you">Reconstructing you…</h1>
- <p class="sub" data-i18n="scan.this_usually_takes_1_2_minutes_keep">
- This usually takes 1–2 minutes. Keep this tab open — we'll ping you when it's
- done.
- </p>
-
- <div class="build-progress" role="list" aria-label="Scan progress">
- <div class="build-step completed" data-bstep="upload" role="listitem">
- <span class="bstep-dot" aria-hidden="true"></span>
- <span class="bstep-label" data-i18n="scan.scan_captured">Scan captured</span>
- </div>
- <div class="build-step active" data-bstep="process" role="listitem">
- <span class="bstep-dot" aria-hidden="true"></span>
- <span class="bstep-label" id="build-status-text" aria-live="polite"
- data-i18n="scan.building_3d_mesh_from_your_scan">Building 3D mesh from your scan…</span
- >
- </div>
- <div class="build-step" data-bstep="finish" role="listitem">
- <span class="bstep-dot" aria-hidden="true"></span>
- <span class="bstep-label" data-i18n="scan.auto_rigging_skeleton">Auto-rigging skeleton</span>
- </div>
- </div>
-
- <div class="build-viewer" aria-hidden="true">
- <!-- loading="lazy": this viewer is decoration inside a hidden step,
- and this page immediately location.replace()s to /create/selfie.
- An eager load here starts a 748KB GLB fetch that the redirect
- then kills mid-flight, making model-viewer log
- "TypeError: Failed to fetch" on every visit. Lazy means the
- fetch only ever starts if the step actually becomes visible. -->
- <model-viewer
- id="build-model"
- src="/avatars/default.glb"
- auto-rotate
- rotation-per-second="12deg"
- interaction-prompt="none"
- disable-zoom
- disable-pan
- shadow-intensity="0.5"
- environment-image="neutral"
- exposure="0.9"
- camera-orbit="0deg 78deg auto"
- loading="lazy"
- ></model-viewer>
- <img id="build-preview" class="build-preview" alt="" />
- <div class="build-veil">
- <div class="build-ring"></div>
- </div>
- </div>
-
- <p id="build-error-msg" class="build-error" role="alert"></p>
- <button id="build-retry-btn" class="build-retry" type="button" data-i18n="scan.scan_again">← Scan again</button>
- </section>
-
- <!-- Step 3: Done -->
- <section class="step" data-step="done">
- <h1 data-i18n="scan.you_re_in_3d">You're in 3D.</h1>
- <p class="sub" data-i18n="scan.drag_to_spin_it_download_the_model">
- Drag to spin it. Download the model, share the scan, or open it in your
- workspace.
- </p>
-
- <div class="done-viewer">
- <model-viewer
- id="done-model"
- auto-rotate
- rotation-per-second="14deg"
- interaction-prompt="none"
- camera-controls
- shadow-intensity="0.7"
- shadow-softness="0.8"
- environment-image="neutral"
- exposure="0.95"
- camera-orbit="0deg 78deg auto"
- loading="eager"
- alt="Your 3D scan"
- ></model-viewer>
- </div>
-
- <div class="name-row">
- <input
- type="text"
- id="done-name"
- class="name-input"
- placeholder="Name your scan"
- maxlength="60"
- autocomplete="off"
- aria-label="Scan name"
- />
- </div>
-
- <div class="export-row">
- <button class="export-btn" id="dl-glb" type="button" data-format="glb">
- <svg
- width="20"
- height="20"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
- <polyline points="7 10 12 15 17 10" />
- <line x1="12" y1="15" x2="12" y2="3" />
- </svg>
- Download
- <span class="ext" data-i18n="scan.glb">.GLB</span>
- </button>
- <button class="export-btn" id="dl-fbx" type="button" data-format="fbx">
- <svg
- width="20"
- height="20"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path
- d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"
- />
- <polyline points="3.27 6.96 12 12.01 20.73 6.96" />
- <line x1="12" y1="22.08" x2="12" y2="12" />
- </svg>
- Engines
- <span class="ext" data-i18n="scan.fbx">.FBX</span>
- </button>
- <button class="export-btn" id="dl-usdz" type="button" data-format="usdz">
- <svg
- width="20"
- height="20"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <path d="M12 2 2 7l10 5 10-5-10-5z" />
- <path d="m2 17 10 5 10-5" />
- <path d="m2 12 10 5 10-5" />
- </svg>
- iOS AR
- <span class="ext" data-i18n="scan.usdz">.USDZ</span>
- </button>
- <button class="export-btn" id="dl-vrm" type="button" data-format="vrm">
- <svg
- width="20"
- height="20"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <circle cx="12" cy="8" r="4" />
- <path d="M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1" />
- </svg>
- VTube
- <span class="ext" data-i18n="scan.vrm">.VRM</span>
- </button>
- </div>
-
- <div class="done-actions">
- <button id="share-btn" class="btn-share" type="button">
- <svg
- width="16"
- height="16"
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- >
- <circle cx="18" cy="5" r="3" />
- <circle cx="6" cy="12" r="3" />
- <circle cx="18" cy="19" r="3" />
- <line x1="8.59" y1="13.51" x2="15.42" y2="17.49" />
- <line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
- </svg>
- Share my scan
- </button>
- <button id="done-save-btn" class="btn-save" type="button" data-i18n="scan.open_in_my_workspace">
- Open in my workspace →
- </button>
- <button id="done-editor-btn" class="btn-ghost" type="button" data-i18n="scan.customize_in_editor">
- Customize in editor
- </button>
- <button id="done-regen-btn" class="btn-ghost" type="button" data-i18n="scan.not_quite_right_scan_again">
- Not quite right — scan again
- </button>
- </div>
- <p id="share-toast" class="share-toast" role="status" aria-live="polite"></p>
-
- <div class="portability-note">
- <span data-i18n="scan.this_scan_works_in_any_three_ws">This scan works in any three.ws-powered app, game, or stream.</span>
- <a href="/docs/embed" target="_blank" rel="noopener" data-i18n="scan.learn_how_to_embed">Learn how to embed →</a>
- </div>
- </section>
- </main>
-
- <!-- Camera overlay (driven by selfie-capture.js) -->
- <div id="cam-overlay" role="dialog" aria-modal="true" aria-label="Camera capture">
- <div id="cam-stage">
- <video id="cam-video" autoplay playsinline muted></video>
- <canvas id="cam-mesh-overlay" aria-hidden="true"></canvas>
- <div class="cam-oval" id="cam-oval" aria-hidden="true">
- <svg viewBox="0 0 300 400" preserveAspectRatio="xMidYMid meet">
- <ellipse cx="150" cy="180" rx="115" ry="155" />
- </svg>
- </div>
- <div class="cam-badges" id="cam-badges" aria-hidden="true"></div>
- <div class="cam-hint" id="cam-hint">Center your face in the oval</div>
- <div class="cam-countdown" id="cam-countdown" aria-hidden="true">
- <span class="count-num" id="cam-count-num">3</span>
- </div>
- </div>
- <div class="cam-prompt">Scanning your <strong id="cam-slot-name" data-i18n="scan.selfie">selfie</strong></div>
- <div id="cam-error" hidden></div>
- <div class="cam-bar">
- <div id="cam-actions-live" style="display: contents">
- <button type="button" data-cam-action="cancel" data-i18n="scan.cancel">Cancel</button>
- <button
- type="button"
- class="shutter"
- data-cam-action="shoot"
- aria-label="Capture scan"
- id="cam-shutter"
- data-i18n-attr="aria-label:scan.capture_scan_arialabel"></button>
- <div class="spacer"></div>
- </div>
- <div id="cam-actions-review" hidden style="display: contents">
- <button type="button" data-cam-action="retake" data-i18n="scan.retake">Retake</button>
- <button type="button" data-cam-action="use" data-i18n="scan.use_this">Use this</button>
- </div>
- </div>
- </div>
-
- <script type="module">
- // /scan is superseded by /create/selfie which has BYOK key entry and a
- // more complete UX. Preserve any ?next or ?from query params so downstream
- // flows still work (e.g. post-login redirects).
- const dest = '/create/selfie' + window.location.search;
- window.location.replace(dest);
-
- function showStep(name) {
- document.querySelectorAll('.step[data-step]').forEach((s) => {
- s.classList.toggle('active', s.dataset.step === name);
- });
- window.scrollTo({ top: 0, behavior: 'auto' });
- }
-
- await import('/src/selfie-capture.js');
- await import('/src/selfie-pipeline.js');
-
- let _avatarId = null;
- let _modelUrl = null;
- let _avatarName = '3d-scan';
- let _docTitleBase = document.title;
- let _notifyPermission =
- typeof Notification !== 'undefined' ? Notification.permission : 'denied';
-
- function showViewerError(message) {
- const viewer = document.querySelector('.done-viewer');
- if (!viewer) return;
- let el = viewer.querySelector('.viewer-error');
- if (!el) {
- el = document.createElement('div');
- el.className = 'viewer-error';
- el.setAttribute('role', 'alert');
- viewer.appendChild(el);
- }
- el.textContent = message;
- el.classList.add('show');
- }
-
- // Surface model-viewer decode/load failures instead of leaving a black box.
- document.getElementById('done-model')?.addEventListener('error', () => {
- showViewerError(
- 'This scan couldn’t be displayed. Try downloading the .GLB instead.',
- );
- });
-
- // The build-step viewer is pure decoration (the placeholder avatar
- // spinning behind the veil while reconstruction runs). If its GLB fetch
- // fails (transient network drop, navigation mid-download), fall back to
- // the designed state (the captured-photo preview and progress veil)
- // instead of leaving a dead black canvas behind them.
- document.getElementById('build-model')?.addEventListener('error', (e) => {
- e.currentTarget.style.visibility = 'hidden';
- });
-
- document.addEventListener('selfie:preview', (e) => {
- const dataUrl = e.detail?.dataUrl;
- if (!dataUrl) return;
- const img = document.getElementById('build-preview');
- if (!img) return;
- img.src = dataUrl;
- requestAnimationFrame(() => img.classList.add('show'));
- });
-
- document.addEventListener('selfie:building', () => {
- showStep('building');
- if (typeof Notification !== 'undefined' && _notifyPermission === 'default') {
- Notification.requestPermission()
- .then((p) => {
- _notifyPermission = p;
- })
- .catch(() => {});
- }
- });
-
- document.addEventListener('selfie:progress', (e) => {
- const label = e.detail?.label;
- if (!label) return;
- const el = document.getElementById('build-status-text');
- if (el) el.textContent = label;
- const processStep = document.querySelector('.build-step[data-bstep="process"]');
- const finishStep = document.querySelector('.build-step[data-bstep="finish"]');
- if (label.toLowerCase().includes('finish') || label.toLowerCase().includes('rig')) {
- processStep?.classList.replace('active', 'completed');
- finishStep?.classList.add('active');
- }
- });
-
- document.addEventListener('selfie:done', async (e) => {
- _avatarId = e.detail?.avatarId;
- if (!_avatarId) return;
- document.querySelectorAll('.build-step').forEach((s) => {
- s.className = 'build-step completed';
- });
-
- try {
- const res = await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {
- credentials: 'include',
- });
- if (res.ok) {
- const data = await res.json();
- // GET /api/avatars/:id wraps the record in { avatar }. Private
- // scans expose the playable model as a presigned `url`; the public
- // CDN field `model_url` is null until the scan is made public.
- const avatar = data.avatar || data;
- _modelUrl = avatar.url || avatar.model_url || null;
- _avatarName = avatar.name || _avatarName;
- const modelEl = document.getElementById('done-model');
- if (modelEl && _modelUrl) {
- modelEl.setAttribute('src', _modelUrl);
- } else {
- showViewerError(
- 'Your scan finished, but the model is still finalizing. Refresh in a moment.',
- );
- }
- const nameEl = document.getElementById('done-name');
- if (nameEl && avatar.name) nameEl.value = avatar.name;
- } else {
- showViewerError('Couldn’t load your scan. Refresh to try again.');
- }
- } catch (_) {
- showViewerError('Couldn’t load your scan. Check your connection and refresh.');
- }
-
- notifyDone();
- showStep('done');
- // Surface adjacent features now that the avatar exists (walk it / embed
- // it). The site-wide discovery layer renders the cross-link card; the
- // avatar id + model URL let it deep-link this avatar into each target.
- document.dispatchEvent(
- new CustomEvent('tws:feature-done', {
- detail: {
- feature: 'scan',
- avatarId: _avatarId || null,
- model: _modelUrl ? { glbUrl: _modelUrl, label: _avatarName || 'Your avatar' } : null,
- },
- }),
- );
- });
-
- function notifyDone() {
- if (!document.hidden) return;
- let on = true;
- const tick = window.setInterval(() => {
- document.title = on ? '✓ Scan ready — three.ws' : _docTitleBase;
- on = !on;
- }, 900);
- const restore = () => {
- clearInterval(tick);
- document.title = _docTitleBase;
- document.removeEventListener('visibilitychange', restore);
- };
- document.addEventListener('visibilitychange', restore);
- if (_notifyPermission === 'granted' && typeof Notification !== 'undefined') {
- try {
- const n = new Notification('Your 3D scan is ready', {
- body: 'Tap to open it on three.ws.',
- icon: '/favicon.ico',
- tag: 'scan-ready',
- });
- n.onclick = () => {
- window.focus();
- n.close();
- };
- } catch (_) {}
- }
- }
-
- document.addEventListener('selfie:build-error', (e) => {
- const detail = e.detail || {};
- const msg = detail.message || 'Something went wrong. Try again.';
- const errEl = document.getElementById('build-error-msg');
- const retryBtn = document.getElementById('build-retry-btn');
- if (errEl) {
- errEl.textContent = msg;
- errEl.classList.add('show');
- }
- if (retryBtn) retryBtn.classList.add('show');
- const ring = document.querySelector('.build-ring');
- if (ring) ring.style.display = 'none';
- const veil = document.querySelector('.build-veil');
- if (veil) veil.style.display = 'none';
- const activeStep = document.querySelector('.build-step.active');
- if (activeStep) {
- activeStep.classList.remove('active');
- activeStep.classList.add('failed');
- const label = activeStep.querySelector('.bstep-label');
- if (label) label.textContent = 'Failed';
- }
- const heading = document.querySelector('[data-step="building"] h1');
- if (heading) heading.textContent = "Couldn't finish the scan";
- const sub = document.querySelector('[data-step="building"] .sub');
- if (sub) sub.textContent = 'Check the tips and scan again with a clearer shot.';
- if (detail.slot) {
- const slotFrame = document.querySelector(
- detail.slot === 'frontal'
- ? `.hero-slot[data-slot="${detail.slot}"]`
- : `.slot-frame[data-slot="${detail.slot}"]`,
- );
- slotFrame?.classList.add('error');
- if (detail.slot !== 'frontal') {
- const fid = document.getElementById('fidelity-boost');
- if (fid) fid.open = true;
- }
- }
- });
-
- document.getElementById('build-retry-btn')?.addEventListener('click', () => {
- document.getElementById('build-error-msg')?.classList.remove('show');
- document.getElementById('build-retry-btn')?.classList.remove('show');
- const ring = document.querySelector('.build-ring');
- if (ring) ring.style.display = '';
- const veil = document.querySelector('.build-veil');
- if (veil) veil.style.display = '';
- const heading = document.querySelector('[data-step="building"] h1');
- if (heading) heading.textContent = 'Reconstructing you…';
- const sub = document.querySelector('[data-step="building"] .sub');
- if (sub)
- sub.textContent =
- "This usually takes 1–2 minutes. Keep this tab open — we'll ping you when it's done.";
- document.querySelectorAll('.build-step').forEach((s) => {
- s.classList.remove('completed', 'active', 'failed');
- });
- document
- .querySelector('.build-step[data-bstep="upload"]')
- ?.classList.add('completed');
- document
- .querySelector('.build-step[data-bstep="process"]')
- ?.classList.add('active');
- const statusText = document.getElementById('build-status-text');
- if (statusText) statusText.textContent = 'Building 3D mesh from your scan…';
- showStep('capture');
- });
-
- // ── Share / export loop ─────────────────────────────────────────────
- function toast(msg) {
- const el = document.getElementById('share-toast');
- if (!el) return;
- el.textContent = msg;
- el.classList.add('show');
- window.clearTimeout(toast._t);
- toast._t = window.setTimeout(() => el.classList.remove('show'), 2600);
- }
-
- // Persist any name edit before leaving / exporting so downloads + the
- // workspace stay consistent with what the user typed.
- async function persistName() {
- const nameEl = document.getElementById('done-name');
- const name = nameEl?.value?.trim();
- if (!_avatarId || !name || name === _avatarName) return;
- _avatarName = name;
- try {
- await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {
- method: 'PATCH',
- credentials: 'include',
- headers: { 'content-type': 'application/json' },
- body: JSON.stringify({ name }),
- });
- } catch (_) {}
- }
-
- document.querySelectorAll('.export-btn').forEach((btn) => {
- btn.addEventListener('click', async () => {
- if (!_modelUrl) {
- toast('Scan still finalizing — try again in a moment.');
- return;
- }
- const format = btn.getAttribute('data-format');
- const labelNodes = [...btn.childNodes];
- btn.disabled = true;
- try {
- await persistName();
- if (format === 'fbx') {
- // FBX is built server-side (Blender) from the scanned GLB.
- const { fbxFromUrl, downloadUrl } =
- await import('/src/remesh-convert.js');
- const fbxUrl = await fbxFromUrl(_modelUrl, {
- onStatus: (msg) => toast(msg),
- });
- downloadUrl(fbxUrl, `${_avatarName || '3d-scan'}.fbx`);
- toast('Downloaded FBX');
- } else {
- const { downloadAvatar } = await import('/src/avatar-export.js');
- const { size } = await downloadAvatar(_modelUrl, {
- format,
- filename: _avatarName || '3d-scan',
- meta: { name: _avatarName },
- });
- toast(
- `Downloaded ${format.toUpperCase()} · ${(size / 1024 / 1024).toFixed(1)} MB`,
- );
- }
- } catch (err) {
- console.error('[scan] export failed', err);
- toast(`Couldn't export ${format.toUpperCase()}. Try GLB.`);
- } finally {
- btn.disabled = false;
- }
- });
- });
-
- document.getElementById('share-btn')?.addEventListener('click', async () => {
- if (!_avatarId) return;
- await persistName();
- const shareUrl = `${location.origin}/avatars/${encodeURIComponent(_avatarId)}`;
- const { showSharePanel } = await import('/src/shared/share.js');
- showSharePanel(
- {
- kind: 'scan',
- id: _avatarId,
- title: _avatarName || 'My 3D scan',
- description: 'A real-time photogrammetry scan made on three.ws.',
- shareUrl,
- remixUrl: `${location.origin}/scan`,
- },
- document.getElementById('share-btn'),
- );
- });
-
- document.getElementById('done-save-btn')?.addEventListener('click', async () => {
- if (!_avatarId) return;
- const btn = document.getElementById('done-save-btn');
- btn.disabled = true;
- btn.textContent = 'Opening…';
- await persistName();
- window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}`);
- });
-
- document.getElementById('done-editor-btn')?.addEventListener('click', async () => {
- if (!_avatarId) return;
- await persistName();
- window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}/edit`);
- });
-
- document.getElementById('done-regen-btn')?.addEventListener('click', () => {
- _avatarId = null;
- _modelUrl = null;
- const preview = document.getElementById('build-preview');
- if (preview) {
- preview.removeAttribute('src');
- preview.classList.remove('show');
- }
- document.dispatchEvent(new CustomEvent('selfie:reset'));
- showStep('capture');
- });
- </script>
- <script src="/brand.js" defer></script>
- <script src="/getting-started.js" defer></script>
- <!-- Runtime i18n: detects locale, swaps annotated copy, mounts <lang-switcher>. -->
- <script type="module" src="/i18n.js"></script>
-</body>
-</html>
diff --git a/pages/what-is.html b/pages/what-is.html
index 9159cae94..69d48044a 100644
--- a/pages/what-is.html
+++ b/pages/what-is.html
@@ -265,7 +265,7 @@
<li data-i18n="what_is.it_lip_syncs_your_voice_and_reacts">It lip-syncs your voice and reacts to hotkeys, live.</li>
</ol>
<div class="wi-case-actions">
- <a href="/scan" class="fl-btn-primary" data-i18n="what_is.scan_your_avatar">Scan your avatar →</a>
+ <a href="/create/selfie" class="fl-btn-primary" data-i18n="what_is.scan_your_avatar">Scan your avatar →</a>
<a href="/overlay-control" class="fl-btn-ghost" data-i18n="what_is.open_the_obs_overlay">Open the OBS overlay</a>
</div>
</article>
diff --git a/prompts/quality-bar/_generated/08/baseline.json b/prompts/quality-bar/_generated/08/baseline.json
new file mode 100644
index 000000000..8df97162f
--- /dev/null
+++ b/prompts/quality-bar/_generated/08/baseline.json
@@ -0,0 +1,1518 @@
+{
+ "config": {
+ "base": "https://three.ws",
+ "device": "Pixel 5",
+ "net": "slow4g",
+ "netLabel": "slow 4G (1.6 Mbps down / 750 Kbps up / 150 ms RTT)",
+ "cpu": 4,
+ "runs": 3,
+ "settle": 5000,
+ "label": "baseline",
+ "startedAt": "2026-07-29T05:33:36.902Z",
+ "harness": "scripts/mobile-perf.mjs",
+ "metricsNote": "Playwright-measured field-style metrics via PerformanceObserver under CDP CPU/network throttling. NOT Lighthouse scores. tbtProxy = sum(max(0, longtask.duration - 50)).",
+ "browser": "chromium"
+ },
+ "results": [
+ {
+ "label": "home",
+ "path": "/",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 27412,
+ "cls": 0.068,
+ "fcp": 2736,
+ "tbtProxy": 34540,
+ "longTaskCount": 60,
+ "longestTask": 5836,
+ "dcl": 23427,
+ "load": 0,
+ "transferBytes": 2368386,
+ "requestCount": 89,
+ "webglCreated": 3,
+ "webglLive": 2,
+ "webglVisible": 1,
+ "domNodes": 2669,
+ "images": 19,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "h1.hero-h",
+ "clsSources": [
+ {
+ "value": 0.01,
+ "at": 47809,
+ "node": "section"
+ }
+ ],
+ "bytesByType": {
+ "Stylesheet": 25601,
+ "Script": 1509123,
+ "Font": 177152,
+ "Document": 92942,
+ "Image": 4824,
+ "Fetch": 558744
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/agent-3d/latest/agent-3d.js",
+ "type": "Script",
+ "bytes": 1002118
+ },
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459135
+ },
+ {
+ "url": "https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js",
+ "type": "Script",
+ "bytes": 258898
+ },
+ {
+ "url": "https://three.ws/",
+ "type": "Document",
+ "bytes": 92942
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin-ext.woff2",
+ "type": "Font",
+ "bytes": 85125
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74422
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Fetch",
+ "bytes": 63563
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin.woff2",
+ "type": "Font",
+ "bytes": 48505
+ },
+ {
+ "url": "https://three.ws/ingest/static/surveys.js?v=1.407.5",
+ "type": "Script",
+ "bytes": 32793
+ },
+ {
+ "url": "https://three.ws/fonts/space-grotesk-latin.woff2",
+ "type": "Font",
+ "bytes": 22316
+ }
+ ],
+ "webglDetail": [
+ {
+ "visible": true,
+ "w": 351,
+ "h": 340,
+ "id": "tws-viewer-canvas"
+ }
+ ],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "forge",
+ "path": "/forge",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 4540,
+ "cls": 0.3085,
+ "fcp": 4484,
+ "tbtProxy": 56126,
+ "longTaskCount": 42,
+ "longestTask": 29969,
+ "dcl": 15850,
+ "load": 65212,
+ "transferBytes": 2340642,
+ "requestCount": 82,
+ "webglCreated": 2,
+ "webglLive": 1,
+ "webglVisible": 1,
+ "domNodes": 1882,
+ "images": 22,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "(unknown)",
+ "clsSources": [
+ {
+ "value": 0.0689,
+ "at": 15385,
+ "node": "div#forge-quality"
+ },
+ {
+ "value": 0.0356,
+ "at": 15545,
+ "node": "main"
+ },
+ {
+ "value": 0.0519,
+ "at": 16404,
+ "node": "main"
+ },
+ {
+ "value": 0.0425,
+ "at": 24618,
+ "node": "div#engine"
+ },
+ {
+ "value": 0.01,
+ "at": 26126,
+ "node": "main"
+ },
+ {
+ "value": 0.0979,
+ "at": 32275,
+ "node": "div#tws-corner-stack"
+ }
+ ],
+ "bytesByType": {
+ "Document": 31899,
+ "Script": 1374525,
+ "Stylesheet": 78377,
+ "Font": 176949,
+ "Other": 33590,
+ "Fetch": 473012,
+ "Image": 63573
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459131
+ },
+ {
+ "url": "https://three.ws/assets/three-core-B6YxbEni.js",
+ "type": "Script",
+ "bytes": 335298
+ },
+ {
+ "url": "https://three.ws/assets/three-addons-C_o9ZiOy.js",
+ "type": "Script",
+ "bytes": 296424
+ },
+ {
+ "url": "https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js",
+ "type": "Script",
+ "bytes": 258897
+ },
+ {
+ "url": "https://three.ws/assets/solana-wLzkomb4.js",
+ "type": "Script",
+ "bytes": 148509
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin-ext.woff2",
+ "type": "Font",
+ "bytes": 85125
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74422
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63573
+ },
+ {
+ "url": "https://three.ws/style.css",
+ "type": "Stylesheet",
+ "bytes": 51175
+ },
+ {
+ "url": "https://three.ws/assets/forge-KN_4drhG.js",
+ "type": "Script",
+ "bytes": 50715
+ }
+ ],
+ "webglDetail": [
+ {
+ "visible": true,
+ "w": 90,
+ "h": 90,
+ "id": "footer-bot-canvas"
+ }
+ ],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "markets",
+ "path": "/markets",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 3220,
+ "cls": 0.5286,
+ "fcp": 3220,
+ "tbtProxy": 17549,
+ "longTaskCount": 42,
+ "longestTask": 3344,
+ "dcl": 4583,
+ "load": 0,
+ "transferBytes": 1820756,
+ "requestCount": 68,
+ "webglCreated": 0,
+ "webglLive": 0,
+ "webglVisible": 0,
+ "domNodes": 3084,
+ "images": 108,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "p.cv-sub",
+ "clsSources": [
+ {
+ "value": 0.0181,
+ "at": 7143,
+ "node": "div"
+ },
+ {
+ "value": 0.5228,
+ "at": 7561,
+ "node": "div"
+ },
+ {
+ "value": 0.0174,
+ "at": 14390,
+ "node": "section"
+ }
+ ],
+ "bytesByType": {
+ "Stylesheet": 34329,
+ "Document": 7502,
+ "Script": 219306,
+ "Font": 91823,
+ "Image": 63562,
+ "Fetch": 506447
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459124
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74419
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63562
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin.woff2",
+ "type": "Font",
+ "bytes": 48294
+ },
+ {
+ "url": "https://three.ws/api/coin/markets?page=1&per_page=100",
+ "type": "Fetch",
+ "bytes": 33730
+ },
+ {
+ "url": "https://three.ws/ingest/static/surveys.js?v=1.407.5",
+ "type": "Script",
+ "bytes": 32795
+ },
+ {
+ "url": "https://three.ws/fonts/space-grotesk-latin.woff2",
+ "type": "Font",
+ "bytes": 22322
+ },
+ {
+ "url": "https://three.ws/fonts/jetbrains-mono-latin.woff2",
+ "type": "Font",
+ "bytes": 21207
+ },
+ {
+ "url": "https://three.ws/search.js",
+ "type": "Script",
+ "bytes": 15831
+ },
+ {
+ "url": "https://three.ws/error-reporter.js",
+ "type": "Script",
+ "bytes": 11269
+ }
+ ],
+ "webglDetail": [],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "news",
+ "path": "/news",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 3672,
+ "cls": 0,
+ "fcp": 3672,
+ "tbtProxy": 6470,
+ "longTaskCount": 7,
+ "longestTask": 2516,
+ "dcl": 4475,
+ "load": 4477,
+ "transferBytes": 547269,
+ "requestCount": 5,
+ "webglCreated": 0,
+ "webglLive": 0,
+ "webglVisible": 0,
+ "domNodes": 1025,
+ "images": 1,
+ "status": 200,
+ "loadFired": true,
+ "lcpDetail": "p.post-summary",
+ "clsSources": [],
+ "bytesByType": {
+ "Document": 20119,
+ "Script": 3077,
+ "Image": 63741,
+ "Fetch": 460225
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459113
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63741
+ },
+ {
+ "url": "https://three.ws/news",
+ "type": "Document",
+ "bytes": 20119
+ },
+ {
+ "url": "https://three.ws/i18n.js",
+ "type": "Script",
+ "bytes": 3077
+ },
+ {
+ "url": "https://three.ws/locales/manifest.json",
+ "type": "Fetch",
+ "bytes": 1112
+ }
+ ],
+ "webglDetail": [],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "marketplace",
+ "path": "/marketplace",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 30432,
+ "cls": 0.4196,
+ "fcp": 3760,
+ "tbtProxy": 28539,
+ "longTaskCount": 45,
+ "longestTask": 5830,
+ "dcl": 11764,
+ "load": 0,
+ "transferBytes": 4781101,
+ "requestCount": 126,
+ "webglCreated": 1,
+ "webglLive": 0,
+ "webglVisible": 0,
+ "domNodes": 6559,
+ "images": 204,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/836fad74-689e-44ba-9eeb-bbdd63f01820.png",
+ "clsSources": [
+ {
+ "value": 0.0684,
+ "at": 3875,
+ "node": "main#main-content"
+ },
+ {
+ "value": 0.1727,
+ "at": 11557,
+ "node": "main#main-content"
+ },
+ {
+ "value": 0.0155,
+ "at": 14486,
+ "node": "section#mkt-top-section"
+ },
+ {
+ "value": 0.0478,
+ "at": 21097,
+ "node": "section#mkt-top-section"
+ },
+ {
+ "value": 0.0488,
+ "at": 28964,
+ "node": "div#market-theme-picks"
+ },
+ {
+ "value": 0.0114,
+ "at": 30880,
+ "node": "div"
+ },
+ {
+ "value": 0.01,
+ "at": 32571,
+ "node": "main#main-content"
+ },
+ {
+ "value": 0.0599,
+ "at": 36728,
+ "node": "div#tws-corner-stack"
+ }
+ ],
+ "bytesByType": {
+ "Document": 37959,
+ "Stylesheet": 110591,
+ "Script": 1596292,
+ "Image": 2268380,
+ "Font": 70631,
+ "Fetch": 503626
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/agent-3d/latest/agent-3d.js",
+ "type": "Script",
+ "bytes": 1002118
+ },
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459134
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/e69a25bf85e8/e121501c-7224-4685-8238-50cd57a7c86d.png",
+ "type": "Image",
+ "bytes": 352499
+ },
+ {
+ "url": "https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js",
+ "type": "Script",
+ "bytes": 258898
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/215905d7-f311-46d8-9036-2ee8cc7f5279.png",
+ "type": "Image",
+ "bytes": 159139
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/1801ff55fdbb/c2f60cfd-b130-47f5-aae0-109f2921ffb5_og.png",
+ "type": "Image",
+ "bytes": 122198
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/836fad74-689e-44ba-9eeb-bbdd63f01820.png",
+ "type": "Image",
+ "bytes": 106510
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/2268b320-142c-45da-8f82-136b6e45fc0e.png",
+ "type": "Image",
+ "bytes": 96835
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/16d61e6f-9cc2-498a-be4d-6dea8faa398d.png",
+ "type": "Image",
+ "bytes": 94281
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/2cad706b-703c-410d-b38f-e0d933b523ac.png",
+ "type": "Image",
+ "bytes": 90797
+ }
+ ],
+ "webglDetail": [],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "coin ($THREE)",
+ "path": "/coin/FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 10316,
+ "cls": 0.5362,
+ "fcp": 1796,
+ "tbtProxy": 43025,
+ "longTaskCount": 38,
+ "longestTask": 28339,
+ "dcl": 2120,
+ "load": 52465,
+ "transferBytes": 1852613,
+ "requestCount": 67,
+ "webglCreated": 1,
+ "webglLive": 1,
+ "webglVisible": 1,
+ "domNodes": 1263,
+ "images": 11,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "(unknown)",
+ "clsSources": [
+ {
+ "value": 0.4462,
+ "at": 5673,
+ "node": "section#cv-chart"
+ },
+ {
+ "value": 0.01,
+ "at": 9680,
+ "node": "main#cv-main"
+ },
+ {
+ "value": 0.0705,
+ "at": 15781,
+ "node": "div#tws-corner-stack"
+ }
+ ],
+ "bytesByType": {
+ "Document": 8794,
+ "Stylesheet": 34190,
+ "Script": 1034024,
+ "Fetch": 477089,
+ "Font": 176946,
+ "Image": 121316,
+ "Other": 33590
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459123
+ },
+ {
+ "url": "https://three.ws/assets/three-core-B6YxbEni.js",
+ "type": "Script",
+ "bytes": 335311
+ },
+ {
+ "url": "https://three.ws/assets/three-addons-C_o9ZiOy.js",
+ "type": "Script",
+ "bytes": 296437
+ },
+ {
+ "url": "https://three.ws/assets/solana-wLzkomb4.js",
+ "type": "Script",
+ "bytes": 148527
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin-ext.woff2",
+ "type": "Font",
+ "bytes": 85117
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74421
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63562
+ },
+ {
+ "url": "https://coin-images.coingecko.com/coins/images/102173088/large/Generated_Image_April_29__2026_-_11_39AM.jpg?1777732999",
+ "type": "Image",
+ "bytes": 57754
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin.woff2",
+ "type": "Font",
+ "bytes": 48295
+ },
+ {
+ "url": "data:application/octet-stream;base64,AGFzbQEAAAABiQEWYAN/f38AYAJ/fwBgAn9/AX9gAX8AYAN/f38Bf2AEf39/fwBgAX8Bf2AFf39/f38Bf2ABfwF+YAV/f39/fwBgBH9/f38Bf2ACf38BfWAAAGAHf39/f39/fwBgBX9/fX1/AGACfn8Bf2ABfQF/YAN9fX0Bf2ADf39/AX5gAX8BfWAAAXxgAXwBfAJiAhkuL21pa2t0c3BhY2VfbW9kdWxlX2JnLmpzFV9fd2JpbmRnZW5fc3RyaW5nX25ldwACGS4vbWlra3RzcGFjZV9tb2R1bGVfYmcuanMSX193YmluZGdlbl9yZXRocm93AAMDeXgGAwkABQQCFAcCEwkVAgULBwUPAAAFAAAAAAABBQ4ADQABAQUAAAsBAAAABQIFAgUFAwEBAQEAAQUEERIHAAIAAAABAAAEAAMDAQADAAoGBgMDAwMDAwMBAgMBAwMBAQEKAQEEAgIAAQAMAgIGEAECBgIGCAgIAwEEBQFwASEhBQMBABEGCQF/AUGAgMAACwdlBQZtZW1vcnkCABBnZW5lcmF0ZVRhbmdlbnRzACEfX193YmluZGd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ABQeACaiABQdgFahBjIAEoAuQCIgYgAk0NEiABQcgFaigCACABKALQBSINIAJBAnQiBiABKALgAmooAgAiC00NESABQdgCaiABQfgFahBjIAEoAtwCIg0gAk0NECALQQJ0aiABKALYAiAGaigCAEECdGogBDYCACABQfgFaigCACELIAEoAoAGIgcgAk0NDyAGIAtqIgIgAigCAEEBajYCACADQQRqIQMgCiAEQQFqIgRHDQALCyABQdACaiABQegFahBjIAEoAtQCRQ0MIAEoAtACKAIAIQNBBCECQQEhBANAIAFByAJqIAFB6AVqEGMgASgCzAIiCiAETQ0MIAMgASgCyAIgAmooAgBJBEAgAUHAAmogAUHoBWoQYyABKALEAiIDIARNDQwgASgCwAIgAmooAgAhAwsgAkEEaiECIARBAWoiBEGAEEcNAAsgAUHgA2oiAkIANwIAIAJBCGpCADcCACABQaAGaiABQegDaikDADcDACABIAEpA+ADNwOYBiABQYgGaiABQZgGaiADEEEgASgCiAYhCiABKAKQBiELQQAhBgNAIAFBuAJqIAFB2AVqEGMgASgCvAIiAyAGTQ0KIAFByAVqKAIAIQIgASgC0AUiBCAGQQJ0IgggASgCuAJqKAIAIgNNDQkgAUGwAmogAUHoBWoQYyABKAK0AiIEIAZNDQggASgCsAIgCGooAgAiCEECTwRAIAIgA0ECdGohBEEAIQMgCiECA0AgAUGoAmogBSAEKAIAIgdBAnRqKAIAEGEgAUGYBmogACABKAKoAiABKAKsAhAxIAMgC0YNCSACIAEoApgGNgIAIAJBBGogASgCnAY2AgAgASgCoAYhDSACQQxqIAc2AgAgAkEIaiANNgIAIARBBGohBCACQRBqIQIgCCADQQFqIgNHDQALIAUgCiAAQQAgCEF/ahAECyAGQQFqIgZBgBBHDQALIBNBASATQQFLGyEFIA5BPGohAyABQYgGahBSIAFB+AVqKAIAGiABQfgFahBWIAFB6AVqKAIAGiABQegFahBWIAFB2AVqKAIAGiABQdgFahBWIAFByAVqKAIAGiABQcgFahBWQQAhAkEAIQRBACEGQQAhBwNAIAFBoAJqIAFBwANqEGMgASgCpAIiCiAETQ0GIAEoAqACIAJqKAIAIQogAUGYAmogAUHAA2oQYyABKAKcAiILIARBAWpNDQUgASgCmAIgAmpBBGooAgAhCyABQZACaiABQcADahBjIAEoApQCIgggBEECak0NBCABKAKQAiACakEIaigCACEIIAFBiAJqIAoQYSABQYgGaiAAIAEoAogCIAEoAowCEDEgAUGAAmogCxBhIAFB4ANqIAAgASgCgAIgASgChAIQMSABQfgBaiAIEGEgAUGYBmogACABKAL4ASABKAL8ARAxAkACQCABQYgGaiABQeADahALDQAgAUGIBmogAUGYBmoQCw0AIAFB4ANqIAFBmAZqEAtFDQELIAwgBk0NBCADIAMoAgBBAXI2AgAgB0EBaiEHCyACQQxqIQIgBEEDaiEEIANByABqIQMgBSAGQQFqIgZHDQALIA4gAUHAA2ooAgAgEyAHayIKIBMQECABQcADaigCACELAkACQCAKRQRAQX8hBgwBC0EAIQYDQCAOIAZByABsaiIDQn83AgAgA0EIakF/NgIAIANBDGpCADcCACADQRRqQQA2AgAgA0E8aiADQRhqIQIgAygCPCEEQQMhAwNAIAJCADcCACACQRhqQgA3AgAgAkEQakIANwIAIAJBCGpCADcCACAEQQRyIQQgA0F/aiIDDQALIAQ2AgAgBkEBaiIGIApHDQALIAFBpAZqIQYgAUHsA2ohDEEAIQUDQCABQfABaiALIAVBDGxqIgMoAgAQYSABQagFaiAAIAEoAvABIAEoAvQBEDEgAUHoAWogA0EEaiICKAIAEGEgAUG4BWogACABKALoASABKALsARAxIAFB4AFqIANBCGoiBCgCABBhIAFByAVqIAAgASgC4AEgASgC5AEQMSABQdgBaiADKAIAEGEgACABKALYASABKALcARA9ISsgAUHQAWogAigCABBhIAAgASgC0AEgASgC1AEQPSEsIAFByAFqIAQoAgAQYSAAIAEoAsgBIAEoAswBED0hLSABQegDaiIDIAFBwAVqKAIANgIAIAEgASkDuAU3A+ADIAFBoAZqIgQgAUGwBWoiAigCADYCACABIAEpA6gFNwOYBiABQdgFaiABQeADaiABQZgGahAVIAMgAUHQBWooAg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AJAAkACQCANKAIAQQFIDQAgCCgCOCEWIAhBPGohGkEAIQcDQCALICQoAgAgB0ECdGooAgAiEkHIAGxqIg8oAjghFyAEIA9BIGooAgA2AgAgASAPKQIYNwOIBiABQYgFaiAPQRhqEBEhLiADIBAoAgA2AgAgASABKQOIBTcDmAYgAUHoAGogAUGYBmogHhBoIAEoAmgiAiABKAJsIhhHBEADQCACIC4gAioCAJQ4AgAgGCACQQRqIgJHDQALCyABQegFaiABQYgGaiABQZgGahAVIAQgD0EsaigCADYCACABIA8pAiQ3A4gGIAFBiAVqIA9BJGoQESEuIAMgECgCADYCACABIAEpA4gFNwOYBiABQeAAaiABQZgGaiAeEGggASgCYCICIAEoAmQiGEcEQANAIAIgLiACKgIAlDgCACAYIAJBBGoiAkcNAAsLIAFB+AVqIAFBiAZqIAFBmAZqEBUgAyABQfAFaiICKAIANgIAIAEgASkD6AU3A5gGIAFBmAZqEFEEQCADIAIoAgA2AgAgASABKQPoBTcDmAYgAUHoBWogAUGYBmoQIwsgAyABQYAGaiICKAIANgIAIAEgASkD+AU3A5gGIAFBmAZqEFEEQCADIAIoAgA2AgAgASABKQP4BTcDmAYgAUH4BWogAUGYBmoQIwsgDygCPCAaKAIAckEEcSAWIBdGckVBACABQZgFaiABQegFahARIDZeQQFzIAFBqAVqIAFB+AVqEBEgNl5BAXNyG0UEQCABQfgEaigCACABKAKABSIPIAlNDQMgCUECdGogEjYCACAJQQFqIQkLIAdBAWoiByANKAIASA0ACyAJQQFNDQAgAUH4BGooAgBBACAJQX9qQcrLgRMQHgsgASAJNgLgAyABQZgGaiABQfgEahA5IBEoAgAaIBEQViARQQhqIAMoAgA2AgAgESABKQOYBjcCACAMBEADQCABKALwBCICIAVNDQMgBSABQeADaiABKALoBCAFQQR0ahAwIgJBAXNqIQUgAkVBACAFIAxJGw0ACyACDQYLIAEoAvAEIgIgDE0NAiAMQQR0IgIgASgC6ARqIAk2AgAgAUGYBmogERA5IAEoAvAEIgcgDE0NAyABKALoBCACa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AYhMSABKgL8BSEwCyAcIBBBAWpBACAdGyAXakECdGooAgAhHSAqKAIAIQIgAUFAayAcIBBBf2pBAiASGyAXakECdGooAgAQYSABQYgGaiAAIAEoAkAgASgCRBAxIAEpA4gGISsgASgCkAYhFyABQThqIAIQYSABQYgGaiAAIAEoAjggASgCPBAxIAEoAogGIQIgASgCjAYhECABKAKQBiESIAFBMGogHRBhIAFBiAZqIAAgASgCMCABKAI0EDEgASkDiAYhLCABKAKQBiEdIAEgFzYCgAYgASArNwP4BSABIBI2ApAGIAEgEDYCjAYgASACNgKIBiABQcgFaiABQfgFaiABQYgGahAVIAEgHTYCgAYgASAsNwP4BSABIBI2ApAGIAEgEDYCjAYgASACNgKIBiABQdgFaiABQfgFaiABQYgGahAVIBYgAUHQBWoiECgCADYCACABIAEpA8gFNwP4BSABQbgFaiABQcgFahARITUgBCAYKAIANgIAIAEgASkDuAU3A4gGIAFBKGogAUGIBmogGRBoIAEoAigiAiABKAIsIhJHBEADQCACIDUgAioCAJQ4AgAgEiACQQRqIgJHDQALCyABQcgFaiABQfgFaiABQYgGahAVIAQgECgCADYCACABIAEpA8gFNwOIBiABQYgGahBRBEAgBCAQKAIANgIAIAEgASkDyAU3A4gGIAFByAVqIAFBiAZqECMLIBYgAUHgBWoiECgCADYCACABIAEpA9gFNwP4BSABQbgFaiABQdgFahARITUgBCAYKAIANgIAIAEgASkDuAU3A4gGIAFBIGogAUGIBmogGRBoIAEoAiAiAiABKAIkIhJHBEADQCACIDUgAioCAJQ4AgAgEiACQQRqIgJHDQALCyABQdgFaiABQfgFaiABQYgGahAVIAQgECgCADYCACABIAEpA9gFNwOIBiABQYgGahBRBEAgBCAQKAIANgIAIAEgASkD2AU3A4gGIAFB2AVqIAFBiAZqECMLQwAAgD8gAUHIBWogAUHYBWoQESI1QwAAgL+XIDVDAACAP14buxAOIA8qAjQhNSAPKgIwITcgFiADKAIANgIAIAEgASkDmAY3A/gFIAEgMjgCkAYgASAvOAKMBiABIDM4AogGIAF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PAABA/AAsgBSAEQdyDwAAQPwALICNBAWoiIyAGRw0ACyABQfgEaigCABogAUH4BGoQViABQegEahBJIAFB6ARqEFIgAUHYBGoQVCABKALIBCEUIAEoAtADIQsLIAFBwANqKAIAIQUgCiATSARAIBtBAUghCSAKIQMDQCALIANByABsaiIELQA8QQJxRQRAIANBA2whDCAEQUBrIQhBACEGA0ACQCAJDQAgBSAGIAxqQQJ0aigCACEOQQAhAgNAAkAgAiAOIAUgAkECdGooAgAiB0ciDWohAiAHIA5GDQAgAiAbSA0BCwsgDQ0AIBQgCCgCACAEIAZqQcQAai0AAGpBKGxqIBQgCyACQQNuIg5ByABsaiIHKAJAIAcgAiAOQQNsa2pBxABqLQAAakEobGpBKBA7GgsgBkEBaiIGQQNHDQALCyADICVGIANBAWohA0UNAAsLIApBAU4EQCALQcQAaiEEQQAhBQNAAkAgCyAFQcgAbGoiAy0APEECcUUNACABQQA2AugDIAFCADcD4AMgAUEIaiADKAI4IgYCf0EBQQEgA0HFAGotAABBH3F0QQEgAy0AREEfcXRyQQEgA0HGAGotAABBH3F0ciICQQJxRQ0AGkECIAJBBHFFDQAaQQBBAyACQQhxGwsiDhBmEGEgAUGYBmogACABKAIIIAEoAgwQMSABQegDaiABQaAGaigCADYCACABIAEpA5gGNwPgAyADQUBrIQNBACECA0AgASAGIAIgBGotAAAiCRBmEGEgAUGYBmogACABKAIAIAEoAgQQMSABQZgGaiABQeADahALBEAgFCADKAIAIgMgDmpBKGxqIBQgAyAJakEobGpBKBA7GgwCCyACQQFqIgJBA0cNAAsLIARByABqIQQgBUEBaiIFIApHDQALCyABKALQBCEFQQAhBkEAIQkDQEEAIAUgCWsiAyADIAVLGyEKIBQgCUEobGohDkEAIQNBACEEA0AgBCAKRg0DIAMgDmoiAikCACErIAEgAkEIaigCADYC6AMgASArNwLgAyAAIAFB4ANqIAJBDGoqAgAgAkEcaioCACACQSRqLQAAEB8gBEEBaiEEIANBKGoiA0H4AEcNAAsgBCAJaiEJIAZBAWoi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AEgA0EgahAtIANBGGooAgAhASADKAIUIQIgAygCEEEBRg0BIAAgAjYCACAAIAFByABuNgIECyADQTBqJAAPCyADQQhqIAIgARBoIAMoAgghASADKAIMDAELIAMgAkEAEGggAygCACEBIAMoAgQLIgAEQCABIAAQcAALEGsAC6cCAgN/AX4jAEEwayIDJAACfwJAAkAgACgCBCIEIAFrIAJJBEAgASACaiICIAFJDQJBBCEBAkAgBEEBdCIFIAIgBSACSxsiAkEEIAJBBEsbrUIofiIGQiCIp0UEQCAGpyECDAELIAAoAgQhBEEAIQELAkAgBARAIAAoAgAhBSADQShqQQQ2AgAgAyAEQShsNgIkIAMgBTYCIAwBCyADQQA2AiALIANBEGogAiABIANBIGoQLSADQRhqKAIAIQEgAygCFCECIAMoAhBBAUYNASAAIAI2AgAgACABQShuNgIECyADQTBqJAAPCyADQQhqIAIgARBoIAMoAgghASADKAIMDAELIAMgAkEAEGggAygCACEBIAMoAgQLIgAEQCABIAAQcAALEGsAC6cCAgN/AX4jAEEwayIDJAACfwJAAkAgACgCBCIEIAFrIAJJBEAgASACaiICIAFJDQJBBCEBAkAgBEEBdCIFIAIgBSACSxsiAkEEIAJBBEsbrUIMfiIGQiCIp0UEQCAGpyECDAELIAAoAgQhBEEAIQELAkAgBARAIAAoAgAhBSADQShqQQQ2AgAgAyAEQQxsNgIkIAMgBTYCIAwBCyADQQA2AiALIANBEGogAiABIANBIGoQLSADQRhqKAIAIQEgAygCFCECIAMoAhBBAUYNASAAIAI2AgAgACABQQxuNgIECyADQTBqJAAPCyADQQhqIAIgARBoIAMoAgghASADKAIMDAELIAMgAkEAEGggAygCACEBIAMoAgQLIgAEQCABIAAQcAALEGsAC6gCAQN/IwBBMGsiAyQAAn8CQAJAIAAoAgQiBCABayACSQRAIAEgAmoiAiABSQ0CQQQhAQJAIARBAXQiBSACIAUgAksbIgJBBCACQQRLGyICQf////8DcSACRgRAIAJBAnQhAgwBCyAAKAIEIQRBACEBCwJAIAQEQCAAKAIAIQUgA0EoakEENgIAIAMgBEECdDYCJCADIAU2AiAMAQsgA0EANgIgCyADQRBqIAIgASADQSBqEC0gA0EYaigCACEBIAMoAhQhAiADKAIQQQFGDQEgACACNgIAIAAgAUECdjYCBAsgA0EwaiQADwsgA0EIaiACIAEQaCADKAIIIQEgAygCDAwBCyADIAJBABBoIAMoAgAhASADKAIECyIABEAgASAAEHAACxBrAAuoAgEDfyMAQTBrIgMkAAJ/AkACQCAAKAIEIgQgAWsgAkkEQCABIAJqIgIgAUkNAkEEIQECQCAEQQF0IgUgAiAFIAJLGyICQQQgAkEESxsiAkH/////AHEgAkYEQCACQQR0IQIMAQsgACgCBCEEQQAhAQsCQCAEBEAgACgCACEFIANBKGpBBDYCACADIARBBHQ2AiQgAyAFNgIgDAELIANBADYCIAsgA0EQaiACIAEgA0EgahAtIANBGGooAgAhASADKAIUIQIgAygCEEEBRg0BIAAgAjYCACAAIAFBBHY2AgQLIANBMGokAA8LIANBCGogAiABEGggAygCCCEBIAMoAgwMAQsgAyACQQAQaCADKAIAIQEgAygCBAsiAARAIAEgABBwAAsQawALsgIBBX8jAEFAaiICJAAgASgCBCIDRQRAIAFBBGohAyABKAIAIQQgAkEANgIgIAJCATcDGCACIAJBGGo2AiQgAkE4aiAEQRBqKQIANwMAIAJBMGogBEEIaikCADcDACACIAQpAgA3AyggAkEkaiACQShqEAgaIAJBEGoiBCACKAIgNgIAIAIgAikDGDcDCAJAIAEoAgQiBUUNACABQQhqKAIAIgZFDQAgBSAGQQEQagsgAyACKQMINwIAIANBCGogBCgCADYCACADKAIAIQMLIAFBATYCBCABQQxqKAIAIQQgAUEIaiIBKAIAIQUgAUIANwIAQQxBBBBnIgFFBEBBDEEEEHAACyABIAQ2AgggASAFNgIEIAEgAzYCACAAQZCPwAA2AgQgACABNgIAIAJBQGskAAuNAgELfyAAQXxqIQwCQANAIAIgAWsiBEEBaiIFIARJDQEgACADIAMgA3cgA0EAIANreHJqQQNqIgMgBXAgAWpBAnRqKAIAIQogAiEFIAEh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gAAIAFBAWohASADQQFqIQMgAkF/aiICDQALDAELIAJFDQAgAUF/aiEBIABBf2ohAwNAIAIgA2ogASACai0AADoAACACQX9qIgINAAsLIAALbwECfwJ/IAIgAJMgASAAk5VDAAAARZQiAEMAAADPYCIDQQFzIABD////Tl9FckUEQCAAqAwBC0H/////B0GAgICAeCADGyIEIARBACAAQ////05fGyADGwsiA0EAIANBAEobIgNB/w8gA0H/D0gbC2YBAX8CQCAAQSBqKAIAIgMgAUEGbCACQQF0aiIBSwRAIAMgAUEBciICTQ0BIAAoAhgiACACQQJ0ajUCAEIghiAAIAFBAnRqNQIAhA8LIAEgA0HsgMAAED8ACyACIANB/IDAABA/AAtrAQJ/IwBBEGsiBiQAAkAgACABIAIgAyAEEAoiBQ0AIAZBCGogAyAAIAEgBCgCDBEFAEEAIQUgBigCCA0AIAYoAgwiBSACKAIANgIIIAIgBTYCACAAIAEgAiADIAQQCiEFCyAGQRBqJAAgBQtsAQF/IwBBMGsiAyQAIAMgATYCBCADIAA2AgAgA0EcakECNgIAIANBLGpBHTYCACADQgI3AgwgA0G0kMAANgIIIANBHTYCJCADIANBIGo2AhggAyADNgIoIAMgA0EEajYCICADQQhqIAIQWQALVAEBfyMAQSBrIgIkACACIAAoAgA2AgQgAkEYaiABQRBqKQIANwMAIAJBEGogAUEIaikCADcDACACIAEpAgA3AwggAkEEaiACQQhqEAggAkEgaiQAC1kCAX8BfiMAQSBrIgMkACADQQhqIAIQNyADKQMIIQQgAEEANgIIIAAgBDcCACADQRhqIAFBCGopAgA3AwAgAyABKQIANwMQIAAgAiADQRBqECcgA0EgaiQAC1kCAX8BfiMAQSBrIgMkACADQQhqIAIQNCADKQMIIQQgAEEANgIIIAAgBDcCACADQRhqIAFBCGooAgA2AgAgAyABKQIANwMQIAAgAiADQRBqECYgA0EgaiQAC1kCAX8BfiMAQSBrIgMkACADQQhqIAIQNyADKQMIIQQgAEEANgIIIAAgBDcCACADQRhqIAFBCGopAgA3AwAgAyABKQIANwMQIAAgAiADQRBqECAgA0EgaiQAC1QBAn8gASgCACECIAFBADYCAAJAIAIEQCABKAIEIQNBCEEEEGciAUUNASABIAM2AgQgASACNgIAIABByI3AADYCBCAAIAE2AgAPCwALQQhBBBBwAAtKAgF/AX4jAEHQAGsiAyQAIAMgAhA2IAMpAwAhBCAAQQA2AgggACAENwIAIANBCGogAUHIABBOIAAgAiADQQhqECsgA0HQAGokAAtHAgF/AX4jAEEwayIDJAAgAyACEDUgAykDACEEIABBADYCCCAAIAQ3AgAgA0EIaiABQSgQTiAAIAIgA0EIahAsIANBMGokAAtKAAJ/IAFBgIDEAEcEQEEBIAAoAhggASAAQRxqKAIAKAIQEQIADQEaCyACRQRAQQAPCyAAKAIYIAJBACAAQRxqKAIAKAIMEQQACwtHAQF/IwBBIGsiAyQAIANBFGpBADYCACADQfCPwAA2AhAgA0IBNwIEIAMgATYCHCADIAA2AhggAyADQRhqNgIAIAMgAhBZAAs8AQF/IAAoAggiAQRAIAFBBHQhASAAKAIAQQRqIQADQCAAKAIAGiAAEFYgAEEQaiEAIAFBcGoiAQ0ACwsLOAAgAEIANwIAIABBCGpBADYCACAAQSRqQQA6AAAgAEEcakIANwIAIABBFGpCADcCACAAQgA3AgwLRAECfyABKAIEIQIgASgCACEDQQhBBBBnIgFFBEBBCEEEEHAACyABIAI2AgQgASADNgIAIABBoI/AADYCBCAAIAE2AgALPQAgAEIANwIgIAAgASkCADcCACAAIAIpAgA3AhAgAEEIaiABQQhqKQIANwIAIABBGGogAkEIaikCADcCAAtbAQN/IwBBEGsiASQAIAAoAgwiAkUEQEGAjsAAQStByI7AABBIAAsgACgCCCIDRQRAQYCOwABBK0HYjsAAEEgACyABIAI2AgggASAANgIEIAEgAzYCACABEFgACysAIAIEQANAIAAgAS0AADoAACABQQFqIQEgAEEBaiEAIAJBf2oiAg0ACwsLKQEBfyADIAIQLiIEBEAgBCAAIAMgASABIANLGxBOIAAgASACECoLIAQLLAACQCAAQXxNBEAgAEUEQEEEIQAMAgsgACAAQX1JQQJ0EGciAA0BCwALIAALNwEBf0EBIQECQCAAKgIAi0MAAIAAXg0AIAAqAgSLQwAAgABeDQAgACoCCItDAACAAF4hAQsgAQsmAQF/AkAgACgCBCIBRQ0AIAAoAgAgAUEEdCIBRQ0AIAFBBBBqCwsnAQF/AkAgACgCBCIBRQ0AIAAoAgAgAUHIAGwiAUUNACABQQQQagsLJgEBfwJAIAAoAgQiAUUNACAAKAIAIAFBKGwiAUUNACABQQQQagsLJgEBfwJAIAAoAgQiAUUNACAAKAIAIAFBDGwiAUUNACABQQQQagsLJgEBfwJAIAAoAgQiAUUNACAAKAIAIAFBAnQiAUUNACABQQQQagsLLAEBfyMAQRBrIgEkACABQQhqIABBCGooAgA2AgAgASAAKQIANwMAIAEQWwALLAEBfyMAQRBrIgEkACABQQhqIABBCGooAgA2AgAgASAAKQIANwMAIAEQMwALNAEBfyMAQRBrIgIkACACIAE2AgwgAiAANgIIIAJB8I/AADYCBCACQfCPwAA2AgAgAhBNAAspAQF/IAEEQCAAIQIDQCACQQA6AAAgAkEBaiECIAFBf2oiAQ0ACwsgAAsrAQF/IwBBEGsiASQAIAEgACkCADcDCCABQQhqQbSNwABBACAAKAIIECUACycBAX8jAEEQayICJAAgAiABNgIIIAJBHTYCBCACIAA2AgAgAhBXAAsmAQF/AkAgACgCACIBRQ0AIABBBGooAgAiAEUNACABIABBARBqCwsmAQF/AkAgACgCBCIBRQ0AIABBCGooAgAiAEUNACABIABBARBqCwshACAAQQM2AgwgACABNgIEIAAgATYCACAAIAFBDGo2AggLHQAgASgCAEUEQAALIABByI3AADYCBCAAIAE2AgALFgAgACABQQNxNgIEIAAgAUECdjYCAAsMACAAIAEgAiADEE8LFgAgACABKAIINgIEIAAgASgCADYCAAsPACABBEAgACABQQQQagsLEgAgACgCACABIAEgAmoQIkEACw0AIAFBA3EgAEECdHILCAAgACABEC4LEAAgACACNgIEIAAgATYCAAsTACAAQaCPwAA2AgQgACABNgIACwoAIAAgASACECoLEQBBzI/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NzQ3NTc2Nzc3ODc5ODA4MTgyODM4NDg1ODY4Nzg4ODk5MDkxOTI5Mzk0OTU5Njk3OTg5OWxpYnJhcnkvY29yZS9zcmMvZm10L21vZC5ycwAMCRAAGwAAAFUEAAARAAAADAkQABsAAABfBAAAJAAAAAMAAAAEAAAABAAAAAYAAACD+aIARE5uAPwpFQDRVycA3TT1AGLbwAA8mZUAQZBDAGNR/gC73qsAt2HFADpuJADSTUIASQbgAAnqLgAcktEA6x3+ACmxHADoPqcA9TWCAES7LgCc6YQAtCZwAEF+XwDWkTkAU4M5AJz0OQCLX4QAKPm9APgfOwDe/5cAD5gFABEv7wAKWosAbR9tAM9+NgAJyycARk+3AJ5mPwAt6l8Auid1AOXrxwA9e/EA9zkHAJJSigD7a+oAH7FfAAhdjQAwA1YAe/xGAPCrawAgvM8ANvSaAOOpHQBeYZEACBvmAIWZZQCgFF8AjUBoAIDY/wAnc00ABgYxAMpWFQDJqHMAe+JgAGuMwAAAAABA+yH5PwAAAAAtRHQ+AAAAgJhG+DwAAABgUcx4OwAAAICDG/A5AAAAQCAlejgAAACAIoLjNgAAAAAd82k1AHsJcHJvZHVjZXJzAghsYW5ndWFnZQEEUnVzdAAMcHJvY2Vzc2VkLWJ5AwVydXN0Yx0xLjQ5LjAgKGUxODg0YThlMyAyMDIwLTEyLTI5KQZ3YWxydXMGMC4xOC4wDHdhc20tYmluZGdlbhIwLjIuNzMgKDNjZWZlMmM4Mik=",
+ "type": "Other",
+ "bytes": 33590
+ }
+ ],
+ "webglDetail": [
+ {
+ "visible": true,
+ "w": 90,
+ "h": 90,
+ "id": "footer-bot-canvas"
+ }
+ ],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "dashboard",
+ "path": "/dashboard",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 6408,
+ "cls": 0,
+ "fcp": 4964,
+ "tbtProxy": 14222,
+ "longTaskCount": 21,
+ "longestTask": 5187,
+ "dcl": 18073,
+ "load": 0,
+ "transferBytes": 1648078,
+ "requestCount": 66,
+ "webglCreated": 1,
+ "webglLive": 0,
+ "webglVisible": 0,
+ "domNodes": 226,
+ "images": 2,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "img",
+ "clsSources": [],
+ "bytesByType": {
+ "Document": 24064,
+ "Stylesheet": 37372,
+ "Script": 1493371,
+ "Font": 48295,
+ "Fetch": 3416,
+ "Image": 63565,
+ "Other": 33590
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/assets/three-core-B6YxbEni.js",
+ "type": "Script",
+ "bytes": 335308
+ },
+ {
+ "url": "https://three.ws/assets/three-addons-C_o9ZiOy.js",
+ "type": "Script",
+ "bytes": 296435
+ },
+ {
+ "url": "https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js",
+ "type": "Script",
+ "bytes": 258897
+ },
+ {
+ "url": "https://three.ws/assets/solana-wLzkomb4.js",
+ "type": "Script",
+ "bytes": 148519
+ },
+ {
+ "url": "https://three.ws/assets/http-BN82FX_8.js",
+ "type": "Script",
+ "bytes": 76795
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74419
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63565
+ },
+ {
+ "url": "https://three.ws/assets/privy-login-B5Xd-9QX.js",
+ "type": "Script",
+ "bytes": 48546
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin.woff2",
+ "type": "Font",
+ "bytes": 48295
+ },
+ {
+ "url": "data:application/octet-stream;base64,AGFzbQEAAAABiQEWYAN/f38AYAJ/fwBgAn9/AX9gAX8AYAN/f38Bf2AEf39/fwBgAX8Bf2AFf39/f38Bf2ABfwF+YAV/f39/fwBgBH9/f38Bf2ACf38BfWAAAGAHf39/f39/fwBgBX9/fX1/AGACfn8Bf2ABfQF/YAN9fX0Bf2ADf39/AX5gAX8BfWAAAXxgAXwBfAJiAhkuL21pa2t0c3BhY2VfbW9kdWxlX2JnLmpzF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aigCACABKALgBUUNFUEAIQJBADYCAEEBIQQDQCABQfgCaiABQdgFahBjIAEoAvwCIgMgBEF/aiIHTQ0UIAEoAvgCIAJqKAIAIQMgAUHwAmogAUHoBWoQYyABKAL0AiINIAdNDRMgASgC8AIgAmooAgAhByABQdgFaigCACENIAEoAuAFIhEgBE0NEiACIA1qQQRqIAMgB2o2AgAgAkEEaiECIARBAWoiBEGAEEcNAAsgCEEJTwRAQQAhBCABQZgGakEAQQRBCCAGGyALG2ohCCAFIQMDQCABQegCaiADKAIAEGEgAUGYBmogACABKALoAiABKALsAhAxIDAgLiAIKgIAEDwhAiABQeACaiABQdgFahBjIAEoAuQCIgYgAk0NEiABQcgFaigCACABKALQBSINIAJBAnQiBiABKALgAmooAgAiC00NESABQdgCaiABQfgFahBjIAEoAtwCIg0gAk0NECALQQJ0aiABKALYAiAGaigCAEECdGogBDYCACABQfgFaigCACELIAEoAoAGIgcgAk0NDyAGIAtqIgIgAigCAEEBajYCACADQQRqIQMgCiAEQQFqIgRHDQALCyABQdACaiABQegFahBjIAEoAtQCRQ0MIAEoAtACKAIAIQNBBCECQQEhBANAIAFByAJqIAFB6AVqEGMgASgCzAIiCiAETQ0MIAMgASgCyAIgAmooAgBJBEAgAUHAAmogAUHoBWoQYyABKALEAiIDIARNDQwgASgCwAIgAmooAgAhAwsgAkEEaiECIARBAWoiBEGAEEcNAAsgAUHgA2oiAkIANwIAIAJBCGpCADcCACABQaAGaiABQegDaikDADcDACABIAEpA+ADNwOYBiABQYgGaiABQZgGaiADEEEgASgCiAYhCiABKAKQBiELQQAhBgNAIAFBuAJqIAFB2AVqEGMgASgCvAIiAyAGTQ0KIAFByAVqKAIAIQIgASgC0AUiBCAGQQJ0IgggASgCuAJqKAIAIgNNDQkgAUGwAmogAUHoBWoQYyABKAK0AiIEIAZNDQggASgCsAIgCGooAgAiCEECTwRAIAIgA0ECdGohBEEAIQMgCiECA0AgAUGoAmogBSAEKAIAIgdBAnRqKAIAEGEgAUGYBmogACABKAKoAiABKAKsAhAxIAMgC0YNCSACIAEoApgGNgIAIAJBBGogASgCnAY2AgAgASgCoAYhDSACQQxqIAc2AgAgAkEIaiANNgIAIARBBGohBCACQRBqIQIgCCADQQFqIgNHDQALIAUgCiAAQQAgCEF/ahAECyAGQQFqIgZBgBBHDQALIBNBASATQQFLGyEFIA5BPGohAyABQYgGahBSIAFB+AVqKAIAGiABQfgFahBWIAFB6AVqKAIAGiABQegFahBWIAFB2AVqKAIAGiABQdgFahBWIAFByAVqKAIAGiABQcgFahBWQQAhAkEAIQRBACEGQQAhBwNAIAFBoAJqIAFBwANqEGMgASgCpAIiCiAETQ0GIAEoAqACIAJqKAIAIQogAUGYAmogAUHAA2oQYyABKAKcAiILIARBAWpNDQUgASgCmAIgAmpBBGooAgAhCyABQZACaiABQcADahBjIAEoApQCIgggBEECak0NBCABKAKQAiACakEIaigCACEIIAFBiAJqIAoQYSABQYgGaiAAIAEoAogCIAEoAowCEDEgAUGAAmogCxBhIAFB4ANqIAAgASgCgAIgASgChAIQMSABQfgBaiAIEGEgAUGYBmogACABKAL4ASABKAL8ARAxAkACQCABQYgGaiABQeADahALDQAgAUGIBmogAUGYBmoQCw0AIAFB4ANqIAFBmAZqEAtFDQELIAwgBk0NBCADIAMoAgBBAXI2AgAgB0EBaiEHCyACQQxqIQIgBEEDaiEEIANByABqIQMgBSAGQQFqIgZHDQALIA4gAUHAA2ooAgAgEyAHayIKIBMQECABQcADaigCACELAkACQCAKRQRAQX8hBgwBC0EAIQYDQCAOIAZByABsaiIDQn83AgAgA0EIakF/NgIAIANBDGpCADcCACADQRRqQQA2AgAgA0E8aiADQRhqIQIgAygCPCEEQQMhAwNAIAJCADcCACACQRhqQgA3AgAgAkEQakIANwIAIAJBCGpCADcCACAEQQRyIQQgA0F/aiIDDQALIAQ2AgAgBkEBaiIGIApHDQALIAFBpAZqIQYgAUHsA2ohDEEAIQUDQCABQfABaiALIAVBDGxqIgMoAgAQYSABQagFaiAAIAEoAvABIAEoAv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gA2AgAgASABKQOIBTcDmAYgAUHwAGogAUGYBmogHhBoIAEoAnAiAiABKAJ0IgVHBEADQCACIC4gAioCAJQ4AgAgBSACQQRqIgJHDQALCyABQagFaiABQYgGaiABQZgGahAVIAMgAUGgBWoiAigCADYCACABIAEpA5gFNwOYBiABQZgGahBRBEAgAyACKAIANgIAIAEgASkDmAU3A5gGIAFBmAVqIAFBmAZqECMLIAMgAUGwBWoiAigCADYCACABIAEpA6gFNwOYBiABQZgGahBRBEAgAyACKAIANgIAIAEgASkDqAU3A5gGIAFBqAVqIAFBmAZqECMLQQAhBUEAIQkCQAJAAkACQAJAAkACQCANKAIAQQFIDQAgCCgCOCEWIAhBPGohGkEAIQcDQCALICQoAgAgB0ECdGooAgAiEkHIAGxqIg8oAjghFyAEIA9BIGooAgA2AgAgASAPKQIYNwOIBiABQYgFaiAPQRhqEBEhLiADIBAoAgA2AgAgASABKQOIBTcDmAYgAUHoAGogAUGYBmogHhBoIAEoAmgiAiABKAJsIhhHBEADQCACIC4gAioCAJQ4AgAgGCACQQRqIgJHDQALCyABQegFaiABQYgGaiABQZgGahAVIAQgD0EsaigCADYCACABIA8pAiQ3A4gGIAFBiAVqIA9BJGoQESEuIAMgECgCADYCACABIAEpA4gFNwOYBiABQeAAaiABQZgGaiAeEGggASgCYCICIAEoAmQiGEcEQANAIAIgLiACKgIAlDgCACAYIAJBBGoiAkcNAAsLIAFB+AVqIAFBiAZqIAFBmAZqEBUgAyABQfAFaiICKAIANgIAIAEgASkD6AU3A5gGIAFBmAZqEFEEQCADIAIoAgA2AgAgASABKQPoBTcDmAYgAUHoBWogAUGYBmoQIwsgAyABQYAGaiICKAIANgIAIAEgASkD+AU3A5gGIAFBmAZqEFEEQCADIAIoAgA2AgAgASABKQP4BTcDmAYgAUH4BWogAUGYBmoQIwsgDygCPCAaKAIAckEEcSAWIBdGckVBACABQZgFaiABQegFahARIDZeQQFzIAFBqAVqIAFB+AVqEBEgNl5BAXNyG0UEQCABQfgEaigCACABK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UcEQANAIAIgMCACKgIAlDgCACAhIAJBBGoiAkcNAAsLIAFB6AVqIAFB+AVqIAFBiAZqEBUgASoC6AUhNCABKgLsBSEwIAEqAvAFITEgASAyOAKQBiABIC84AowGIAEgMzgCiAYgAUGIBmoQUQRAIAEgMjgCkAYgASAvOAKMBiABIDM4AogGIAFB+AVqIAFBiAZqECMgASoC+AUhMyABKgKABiEyIAEqAvwFIS8LIAEgMTgCkAYgASAwOAKMBiABIDQ4AogGIAFBiAZqEFEEQCABIDE4ApAGIAEgMDgCjAYgASA0OAKIBiABQfgFaiABQYgGahAjIAEqAvgFITQgASoCgAYhMSABKgL8BSEwCyAcIBBBAWpBACAdGyAXakECdGooAgAhHSAqKAIAIQIgAUFAayAcIBBBf2pBAiASGyAXakECdGooAgAQYSABQYgGaiAAIAEoAkAgASgCRBAxIAEpA4gGISsgASgCkAYhFyABQThqIAIQYSABQYgGaiAAIAEoAjggASgCPBAxIAEoAogGIQIgASgCjAYhECABKAKQBiESIAFBMGogHRBhIAFBiAZqIAAgASgCMCABKAI0EDEgASkDiAYhLCABKAKQBiEdIAEgFzYCgAYgASArNwP4BSABIBI2ApAGIAEgEDYCjAYgASACNgKIBiABQcgFaiABQfgFaiABQYgGahAVIAEgHTYCgAYgASAsNwP4BSABIBI2ApAGIAEgEDYCjAYgASACNgKIBiABQdgFaiABQfgFaiABQYgGahAVIBYgAUHQBWoiECgCADYCACABIAEpA8gFNwP4BSABQbgFaiABQcgFahARITUgBCAYKAIANgIAIAEgASkDuAU3A4gGIAFBKGogAUGIBmogGRBoIAEoAigiAiABKAIsIhJHBEADQCACIDUgAioCAJQ4AgAgEiACQQRqIgJHDQALCyABQcgFaiABQfgFaiABQYgGahAVIAQgECgCADYCACABIAEpA8gFNwOIBiABQYgGahBRBEAgBCAQKAIANgIAIAEgASkDyAU3A4gGIAFByAVqIAFBiAZqECMLIBYgAUHgBWoiECgCADYCACABIAEpA9gFNwP4BSABQbgFaiABQdgFahARITUgBCAYKAIANgIA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EoAtgEIAxBKGxqIAFBmAZqQSgQTiAMQQFqIQwLICAEQCAIKAJAIAggKGpBxABqLQAAaiICICJPDQICfyAUIAJBKGxqIgIoAiBBAUcEQCABKALgBCIEIAVNDQYgAiABKALYBCAFQShsakEoEDsaQQEMAQsgASgC4AQiBCAFTQ0GIAFBmAZqIAIgASgC2AQgBUEobGoQBSACIAFBmAZqQSgQTkECCyEFIAJBIGogBTYCACACICYtAAA6ACQgESgCABogERBWIB9BAWoiHyANKAIASA0BDAYLC0F/QQRBrIPAABA/AAsgAiAiQbyDwAAQPwALIAwgAkGcg8AAED8ACyAFIARBzIPAABA/AAsgBSAEQdyDwAAQPwALICNBAWoiIyAGRw0ACyABQfgEaigCABogAUH4BGoQViABQegEahBJIAFB6ARqEFIgAUHYBGoQVCABKALIBCEUIAEoAtADIQsLIAFBwANqKAIAIQUgCiATSARAIBtBAUghCSAKIQMDQCALIANByABsaiIELQA8QQJxRQRAIANBA2whDCAEQUBrIQhBACEGA0ACQCAJDQAgBSAGIAxqQQJ0aigCACEOQQAhAgNAAkAgAiAOIAUgAkECdGooAgAiB0ciDWohAiAHIA5GDQAgAiAbSA0BCwsgDQ0AIBQgCCgCACAEIAZqQcQAai0AAGpBKGxqIBQgCyACQQNuIg5ByABsaiIHKAJAIAcgAiAOQQNsa2pBxABqLQAAakEobGpBKBA7GgsgBkEBaiIGQQNHDQALCyADICVGIANBAWohA0UNAAsLIApBAU4EQCALQcQAaiEEQQAhBQNAAkAgCyAFQcgAbGoiAy0APEECcUUNACABQQA2AugDIAFCADcD4AMgAUEIaiADKAI4IgYCf0EBQQEgA0HFAGotAABBH3F0QQEgAy0AREEfcXRyQQEgA0HGAGotAABBH3F0ciICQQJxRQ0AGkECIAJBBHFFDQAaQQBBAyACQQhxGwsiDhBmEGEgAUGYBmogACABKAIIIAEoAgwQMSABQegDaiABQaAGaigCADYCACABIAEpA5gGNwPgAyADQUBrIQNBACECA0AgASAGIAIgBGotAAAiCRBmEGEgAUGYBmogAC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CWogAmoiA0F8aiAAIABCkM4AgCIHQpDOAH59pyIFQf//A3FB5ABuIgZBAXRBxJDAAGovAAA7AAAgA0F+aiAFIAZB5ABsa0H//wNxQQF0QcSQwABqLwAAOwAAIAJBfGohAiAAQv/B1y9WIAchAA0ACwsgB6ciA0HjAEoEQCACQX5qIgIgBEEJamogB6ciAyADQf//A3FB5ABuIgNB5ABsa0H//wNxQQF0QcSQwABqLwAAOwAACwJAIANBCk4EQCACQX5qIgIgBEEJamogA0EBdEHEkMAAai8AADsAAAwBCyACQX9qIgIgBEEJamogA0EwajoAAAsgASAEQQlqIAJqQScgAmsQByAEQTBqJAALqAEBA38jAEEwayIDJAAgA0EoaiIEIAFBCGooAgA2AgAgAyABKQIANwMgIAAgAykDIDcCACAAQQhqIAQoAgA2AgAgA0EIakEAQQMQaCADKAIIIgEgAygCDCIESQRAIAQgAWshBCAAIAFBAnQiBWohASACIAVqIQADQCABIAEqAgAgACoCAJM4AgAgAUEEaiEBIABBBGohACAEQX9qIgQNAAsLIANBMGokAAuoAQEDfyMAQTBrIgMkACADQShqIgQgAUEIaigCADYCACADIAEpAgA3AyAgACADKQMgNwIAIABBCGogBCgCADYCACADQQhqQQBBAxBoIAMoAggiASADKAIMIgRJBEAgBCABayEEIAAgAUECdCIFaiEBIAIgBWohAANAIAEgACoCACABKgIAkjgCACABQQRqIQEgAEEEaiEAIARBf2oiBA0ACwsgA0EwaiQAC7wCAQd/AkADQEEAIQZBACEHAkAgAygCCCIEIAAgAkEMbGoiBSgCAEYNAEEBIQcgBCAFKAIERgRAQQEhBgwBC0ECIQYgBSgCCCAERw0CCwJAIANFDQAgASACQcgAbGoiBCAGQQJ0aiIIQQxqIgkoAgANAAJAIAQoAjwiBUEEcUUNACAEKAIMDQAgBEEQaigCAA0AIARBFGooAgANACAEQTxqIgogBUF3cSIFNgIAIAogAy0ADEEDdCAFciIFNgIACyAFQQhxQQN2IAMtAAxBAEdzDQAgAygCBCADKAIAQQJ0aiACNgIAIAMgAyg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ALIANBEGogAiABIANBIGoQLSADQRhqKAIAIQEgAygCFCECIAMoAhBBAUYNASAAIAI2AgAgACABQQxuNgIECyADQTBqJAAPCyADQQhqIAIgARBoIAMoAgghASADKAIMDAELIAMgAkEAEGggAygCACEBIAMoAgQLIgAEQCABIAAQcAALEGsAC6gCAQN/IwBBMGsiAyQAAn8CQAJAIAAoAgQiBCABayACSQRAIAEgAmoiAiABSQ0CQQQhAQJAIARBAXQiBSACIAUgAksbIgJBBCACQQRLGyICQf////8DcSACRgRAIAJBAnQhAgwBCyAAKAIEIQRBACEBCwJAIAQEQCAAKAIAIQUgA0EoakEENgIAIAMgBEECdDYCJCADIAU2AiAMAQsgA0EANgIgCyADQRBqIAIgASADQSBqEC0gA0EYaigCACEBIAMoAhQhAiADKAIQQQFGDQEgACACNgIAIAAgAUECdjYCBAsgA0EwaiQADwsgA0EIaiACIAEQaCADKAIIIQEgAygCDAwBCyADIAJBABBoIAMoAgAhASADKAIECyIABEAgASAAEHAACxBrAAuoAgEDfyMAQTBrIgMkAAJ/AkACQCAAKAIEIgQgAWsgAkkEQCABIAJqIgIgAUkNAkEEIQECQCAEQQF0IgUgAiAFIAJLGyICQQQgAkEESxsiAkH/////AHEgAkYEQCACQQR0IQIMAQsgACgCBCEEQQAhAQsCQCAEBEAgACgCACEFIANBKGpBBDYCACADIARBBHQ2AiQgAyAFNgIgDAELIANBADYCIAsgA0EQaiACIAEgA0EgahAtIANBGGooAgAhASADKAIUIQIgAygCEEEBRg0BIAAgAjYCACAAIAFBBHY2AgQLIANBMGokAA8LIANBCGogAiABEGggAygCCCEBIAMoAgwMAQsgAyACQQAQaCADKAIAIQEgAygCBAsiAARAIAEgABBwAAsQawALsgIBBX8jAEFAaiICJAAgASgCBCIDRQRAIAFBBGohAyABKAIAIQQgAkEANgIgIAJCATcDGCACIAJBGGo2AiQgAkE4aiAEQRBqKQIANwMAIAJBMGogBEEIaikCADcDACACIAQpAgA3AyggAkEkaiACQShqEAgaIAJBEGoiBCACK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kEIaikCADcCACADIAk3AgAgA0EQaiEDIAhBf2oiCA0ACyAEIAdqIAZrIQQLIAAgAQR/IAIpAgAhCSADQQhqIAJBCGopAgA3AgAgAyAJNwIAIARBAWoFIAQLNgIIIAVBEGokAAuqAQMBfwN+An0jAEEgayICJAAgAkEYaiABKAIAEGEgACACKAIYIAIoAhwQPSEDIAJBEGogASgCBBBhIAAgAigCECACKAIUED0hBCACQQhqIAEoAggQYSAAIAIoAgggAigCDBA9IQUgAkEgaiQAIASnviADp74iBpMgBUIgiKe+IANCIIinviIHk5QgBEIgiKe+IAeTIAWnviAGk5STIgaMIAYgBkMAAAAAXRsLsQEBBX8jAEEQayIDJAACQCAAKAIEIgIgAU8EQAJAIAIEQCACQQJ0IQIgACgCACEEAkAgAUECdCIFRQRAQQQhBiACRQ0BIAQgAkEEEGoMAQsgBCACQQQgBRBiIgZFDQILIAAgBjYCACAAIAFB/////wNxNgIECyADQRBqJAAPCyADQQhqIAVBBBBoIAMoAgwiAEUNASADKAIIIAAQcAALQcWIwABBJEHsiMAAEEgACxBrAAu2AQEBfyMAQRBrIgMkAAJAIABFDQAgAyAANgIEIAFFDQACQCACQQRLDQAgAUEDakECdkF/aiIAQf8BSw0AIANBoJXAADYCCCADIABBAnRBpJXAAGoiACgCADYCDCADQQRqIANBDGogA0EIakGUicAAEBMgACADKAIMNgIADAELIANBoJXAACgCADYCDCADQQRqIANBDGpB/IjAAEH8iMAAEBNBoJXAACADKAIMNgIACyADQRBqJAALmQEBBn8jAEEQayIFJAAgACAAKAIIIAEQGCAAKAIAIAAoAgghAyAFQQhqQQEgARBoIANByABsaiEEIAUoAggiBiAFKAIMIgdJBEAgByAGayEIA0AgBCACQcgAEDtByABqIQQgCEF/aiIIDQALIAMgB2ogBmshAwsgACABBH8gBCACQcgAEDsaIANBAWoFIAMLNgIIIAVBEGokAAuVAQEGfyMAQRBrIgUkACAAIAAoAgggARAZIAAoAgAgACgCCCEDIAVBCGpBASABEGggA0EobGohBCAFKAIII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AVBAnRqKAIANgIIIAAgASADQQJ0aigCADYCBA8LIAIgBEGMgMAAED8ACyADIARBnIDAABA/AAsgBSAEQayAwAAQPwALiwEBAX8jAEEQayIDJAAgAyABKAIAIgEoAgA2AgwgAkECaiICIAJsIgJBgBAgAkGAEEsbIgRBBCADQQxqQayJwABBrInAABA+IQIgASADKAIMNgIAIAIEfyACQgA3AgQgAiACIARBAnRqQQJyNgIAQQAFQQELIQEgACACNgIEIAAgATYCACADQRBqJAALogEBA38jAEEQayIBJAAgACgCACICQRRqKAIAIQMCQAJ/AkACQCACKAIEDgIAAQMLIAMNAkEAIQJB8I3AAAwBCyADDQEgAigCACIDKAIEIQIgAygCAAshAyABIAI2AgQgASADNgIAIAFB/I7AACAAKAIEKAIIIAAoAggQJQALIAFBADYCBCABIAI2AgAgAUHojsAAIAAoAgQoAgggACgCCBAlAAtTAgF/AX4CQCABrUIMfiIDQiCIpw0AIAOnIgFBf0wNAAJAIAEEQCABQQQQZyICDQEgAUEEEHAAC0EEIQILIAAgAjYCACAAIAFBDG42AgQPCxBrAAtTAgF/AX4CQCABrUIofiIDQiCIpw0AIAOnIgFBf0wNAAJAIAEEQCABQQQQZyICDQEgAUEEEHAAC0EEIQILIAAgAjYCACAAIAFBKG42AgQPCxBrAAtVAgF/AX4CQCABrULIAH4iA0IgiKcNACADpyIBQX9MDQACQCABBEAgAUEEEGciAg0BIAFBBBBwAAtBBCECCyAAIAI2AgAgACABQcgAbjYCBA8LEGsAC1MBAX8CQCABIAFB/////wBxRw0AIAFBBHQiAUF/TA0AAkAgAQRAIAFBBBBnIgINASABQQQQcAALQQQhAgsgACACNgIAIAAgAUEEdjYCBA8LEGsAC4MBAQF/AkAgASABQf////8DcUcNACABQQJ0IgFBf0wNAAJAAkACQAJAIAIEQCABDQEMAwsgAUUNAiABQQQQZyICDQMMAQsgASICQQQQLiIDBEAgAyACEFoaCyADIgINAgsgAUEEEHAAC0EEIQILIAAgAjYCACAAIAFBAnY2AgQPCxBrAAt0AgJ/AX4jAEEQayICJAAgAkEIaiABEGMgAigCCCEDIAIgAigCDCIBQQAQOCACKQMAIQQgAEEANgIIIAAgBDcCACAAQQAgARAbIAAoAgAgACgCCEECdGogAyABQQJ0EE4gACABIAAoAghqNgIIIAJBEGokAAtxAAJ/IAJBAnQiASADQQN0QYCAAWoiAiABIAJLG0GHgARqIgFBEHZAACICQX9GBEBBACEDQQEMAQsgAkEQdCIDQgA3AwAgA0EANgIIIAMgAyABQYCAfHFqQQJyNgIAQQALIQIgACADNgIEIAAgAjYCAAtvAQF/AkAgASAATwRAIAJFDQEgACEDA0AgAyABLQAAOgAAIAFBAWohASADQQFqIQMgAkF/aiICDQALDAELIAJFDQAgAUF/aiEBIABBf2ohAwNAIAIgA2ogASACai0AADoAACACQX9qIgINAAsLIAALbwECfwJ/IAIgAJMgASAAk5VDAAAARZQiAEMAAADPYCIDQQFzIABD////Tl9FckUEQCAAqAwBC0H/////B0GAgICAeCADGyIEIARBACAAQ////05fGyADGwsiA0EAIANBAEobIgNB/w8gA0H/D0gbC2YBAX8CQCAAQSBqKAIAIgMgAUEGbCACQQF0aiIBSwRAIAMgAUEBciICTQ0BIAAoAhgiACACQQJ0ajUCAEIghiAAIAFBAnRqNQIAhA8LIAEgA0HsgMAAED8ACyACIANB/IDAABA/AAtrAQJ/IwBBEGsiBiQAAkAgACABIAIgAyAEEAoiBQ0AIAZBCGogAyAAIAEgBCgCDBEFAEEAIQUgBigCCA0AIAYoAgwiBSACKAIANgIIIAIgBTYCACAAIAEgAiADIAQQCiEFCyAGQRBqJAAgBQtsAQF/IwBBMGsiAyQAIAMgATYCBCADIAA2AgAgA0EcakECNgIAIANBLGpBHTYCACADQgI3AgwgA0G0kMAANgIIIANBHTYCJCADIANBIGo2AhggAyADNgIoIAMgA0EEajYCICADQQhqIAIQWQALVAEBfyMAQSBrIgIkACACIAAoAgA2AgQgAkEYaiABQRBqKQIANwMAIAJBEGogAUEIaikCADcDACACIAEpAgA3AwggAkEEaiACQQhq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ARBqCwsmAQF/AkAgACgCBCIBRQ0AIABBCGooAgAiAEUNACABIABBARBqCwshACAAQQM2AgwgACABNgIEIAAgATYCACAAIAFBDGo2AggLHQAgASgCAEUEQAALIABByI3AADYCBCAAIAE2AgALFgAgACABQQNxNgIEIAAgAUECdjYCAAsMACAAIAEgAiADEE8LFgAgACABKAIINgIEIAAgASgCADYCAAsPACABBEAgACABQQQQagsLEgAgACgCACABIAEgAmoQIkEACw0AIAFBA3EgAEECdHILCAAgACABEC4LEAAgACACNgIEIAAgATYCAAsTACAAQaCPwAA2AgQgACABNgIACwoAIAAgASACECoLEQBBzI/AAEERQeCPwAAQSAALDgAgACgCABoDQAwACwALCwAgADUCACABEBQLCwAgACMAaiQAIwALCwAgAItDAACAAF4LGQAgACABQcSdwAAoAgAiAEEPIAAbEQEAAAsFAEGABAsEAEEBCwQAIAELBABBAAsNAEL0+Z7m7qOq+f4ACw0AQve47vqqzNXu5QALDABC6dCi28yi6rtGCwMAAQsDAAELC6QVAgBBgIDAAAvBCnNyYy9saWIucnMAAAAAEAAKAAAANgAAAA0AAAAAABAACgAAADcAAAANAAAAAAAQAAoAAAA4AAAADQAAAAAAEAAKAAAAPgAAAA0AAAAAABAACgAAAD8AAAANAAAAAAAQAAoAAABAAAAADQAAAAAAEAAKAAAARgAAAA0AAAAAABAACgAAAEcAAAANAAAARmFpbGVkIHRvIGdlbmVyYXRlIHRhbmdlbnRzLi9Vc2Vycy9kb25tY2N1cmR5Ly5jYXJnby9yZWdpc3RyeS9zcmMvZ2l0aHViLmNvbS0xZWNjNjI5OWRiOWVjODIzL21pa2t0c3BhY2UtMC4yLjAvc3JjL2dlbmVyYXRlZC5ycwCoABAAYwAAANcAAAASAAAAqAAQAGMAAADYAAAAEgAAAKgAEABjAAAA2QAAABIAAACoABAAYwAAAN4AAAANAAAAqAAQAGMAAAAjAQAAOAAAAKgAEABjAAAA/QEAABUAAACoABAAYwAAAA8CAABAAAAAqAAQAGMAAAAVAgAAEQAAAKgAEAB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hc20tYmluZGdlbhIwLjIuNzMgKDNjZWZlMmM4Mik=",
+ "type": "Other",
+ "bytes": 33590
+ }
+ ],
+ "webglDetail": [
+ {
+ "visible": true,
+ "w": 393,
+ "h": 727,
+ "id": "avatar-canvas"
+ }
+ ],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "walk",
+ "path": "/walk",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 17488,
+ "cls": 0.0096,
+ "fcp": 10180,
+ "tbtProxy": 37031,
+ "longTaskCount": 49,
+ "longestTask": 21126,
+ "dcl": 15525,
+ "load": 0,
+ "transferBytes": 3787691,
+ "requestCount": 87,
+ "webglCreated": 1,
+ "webglLive": 1,
+ "webglVisible": 1,
+ "domNodes": 1143,
+ "images": 7,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "p.wl-hero-sub",
+ "clsSources": [
+ {
+ "value": 0.0556,
+ "at": 33503,
+ "node": "div#tws-corner-stack"
+ }
+ ],
+ "bytesByType": {
+ "Document": 22029,
+ "Stylesheet": 79103,
+ "Script": 1058492,
+ "Image": 63687,
+ "Font": 176926,
+ "Other": 33590,
+ "Fetch": 2405335
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/hdri/outdoor.hdr",
+ "type": "Fetch",
+ "bytes": 1435173
+ },
+ {
+ "url": "https://three.ws/avatars/default.glb",
+ "type": "Fetch",
+ "bytes": 502088
+ },
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459124
+ },
+ {
+ "url": "https://three.ws/assets/three-core-B6YxbEni.js",
+ "type": "Script",
+ "bytes": 335307
+ },
+ {
+ "url": "https://three.ws/assets/three-addons-C_o9ZiOy.js",
+ "type": "Script",
+ "bytes": 296432
+ },
+ {
+ "url": "https://three.ws/assets/solana-wLzkomb4.js",
+ "type": "Script",
+ "bytes": 148528
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin-ext.woff2",
+ "type": "Font",
+ "bytes": 85125
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74419
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63687
+ },
+ {
+ "url": "https://three.ws/style.css",
+ "type": "Stylesheet",
+ "bytes": 51175
+ }
+ ],
+ "webglDetail": [
+ {
+ "visible": true,
+ "w": 90,
+ "h": 90,
+ "id": "footer-bot-canvas"
+ }
+ ],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "irl",
+ "path": "/irl",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 4464,
+ "cls": 0.0012,
+ "fcp": 2284,
+ "tbtProxy": 11006,
+ "longTaskCount": 14,
+ "longestTask": 6148,
+ "dcl": 6299,
+ "load": 7958,
+ "transferBytes": 1756114,
+ "requestCount": 61,
+ "webglCreated": 2,
+ "webglLive": 1,
+ "webglVisible": 1,
+ "domNodes": 612,
+ "images": 1,
+ "status": 200,
+ "loadFired": true,
+ "lcpDetail": "p#irl-subtitle.irl-subtitle",
+ "clsSources": [],
+ "bytesByType": {
+ "Document": 36148,
+ "Stylesheet": 871,
+ "Script": 519511,
+ "Font": 70610,
+ "Fetch": 1121
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/assets/solana-wLzkomb4.js",
+ "type": "Script",
+ "bytes": 148523
+ },
+ {
+ "url": "https://three.ws/assets/irl-BVYQ2DZX.js",
+ "type": "Script",
+ "bytes": 83944
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74419
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin.woff2",
+ "type": "Font",
+ "bytes": 48287
+ },
+ {
+ "url": "https://three.ws/assets/colyseus-connect-DyQw5MR0.js",
+ "type": "Script",
+ "bytes": 41770
+ },
+ {
+ "url": "https://three.ws/irl",
+ "type": "Document",
+ "bytes": 36148
+ },
+ {
+ "url": "https://three.ws/ingest/static/surveys.js?v=1.407.5",
+ "type": "Script",
+ "bytes": 32786
+ },
+ {
+ "url": "https://three.ws/fonts/space-grotesk-latin.woff2",
+ "type": "Font",
+ "bytes": 22323
+ },
+ {
+ "url": "https://three.ws/assets/node-polyfills-CXinE9OU.js",
+ "type": "Script",
+ "bytes": 20007
+ },
+ {
+ "url": "https://three.ws/assets/agent-wallet-chip-CPECrq3s.js",
+ "type": "Script",
+ "bytes": 12971
+ }
+ ],
+ "webglDetail": [],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "ar",
+ "path": "/ar",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 1316,
+ "cls": 0,
+ "fcp": 1316,
+ "tbtProxy": 5842,
+ "longTaskCount": 17,
+ "longestTask": 4357,
+ "dcl": 7008,
+ "load": 7130,
+ "transferBytes": 734962,
+ "requestCount": 7,
+ "webglCreated": 1,
+ "webglLive": 0,
+ "webglVisible": 0,
+ "domNodes": 181,
+ "images": 0,
+ "status": 200,
+ "loadFired": true,
+ "lcpDetail": "p",
+ "clsSources": [],
+ "bytesByType": {
+ "Document": 11067,
+ "Script": 263654,
+ "Fetch": 460225
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459113
+ },
+ {
+ "url": "https://cdn.jsdelivr.net/npm/@google/[email protected]/dist/model-viewer.min.js",
+ "type": "Script",
+ "bytes": 250003
+ },
+ {
+ "url": "https://three.ws/ar",
+ "type": "Document",
+ "bytes": 11067
+ },
+ {
+ "url": "https://cdn.jsdelivr.net/npm/[email protected]/meshopt_decoder.js",
+ "type": "Script",
+ "bytes": 7343
+ },
+ {
+ "url": "https://three.ws/model-viewer-meshopt.js",
+ "type": "Script",
+ "bytes": 3231
+ },
+ {
+ "url": "https://three.ws/i18n.js",
+ "type": "Script",
+ "bytes": 3077
+ },
+ {
+ "url": "https://three.ws/locales/manifest.json",
+ "type": "Fetch",
+ "bytes": 1112
+ }
+ ],
+ "webglDetail": [],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "play",
+ "path": "/play",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 37736,
+ "cls": 0,
+ "fcp": 4704,
+ "tbtProxy": 45855,
+ "longTaskCount": 18,
+ "longestTask": 19392,
+ "dcl": 37621,
+ "load": 44255,
+ "transferBytes": 4886404,
+ "requestCount": 84,
+ "webglCreated": 3,
+ "webglLive": 1,
+ "webglVisible": 1,
+ "domNodes": 811,
+ "images": 7,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "p.pi-body",
+ "clsSources": [],
+ "bytesByType": {
+ "Document": 7782,
+ "Script": 1981593,
+ "Stylesheet": 25826,
+ "Image": 1202582,
+ "Other": 33590,
+ "Fetch": 28130
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/assets/world-hud-CRVwJCC0.js",
+ "type": "Script",
+ "bytes": 792442
+ },
+ {
+ "url": "https://three.ws/api/img?url=https%3A%2F%2Fipfs.io%2Fipfs%2Fbafybeihe22b5sxr3ihnxt7pregfieyteqvubqhik3j3y4bbx243xlqjw3q&seed=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump",
+ "type": "Image",
+ "bytes": 580885
+ },
+ {
+ "url": "https://three.ws/assets/three-core-B6YxbEni.js",
+ "type": "Script",
+ "bytes": 335298
+ },
+ {
+ "url": "https://three.ws/assets/three-addons-C_o9ZiOy.js",
+ "type": "Script",
+ "bytes": 296424
+ },
+ {
+ "url": "https://three.ws/assets/play-CgDwUSls.js",
+ "type": "Script",
+ "bytes": 149341
+ },
+ {
+ "url": "https://three.ws/assets/solana-wLzkomb4.js",
+ "type": "Script",
+ "bytes": 148523
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/6ad7482d-56c2-4048-bc10-d9b441b50f37.png",
+ "type": "Image",
+ "bytes": 114022
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/a4bad2f5-8a07-43cf-82e5-b6ba1314441e.png",
+ "type": "Image",
+ "bytes": 104645
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74422
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63561
+ }
+ ],
+ "webglDetail": [
+ {
+ "visible": true,
+ "w": 393,
+ "h": 727,
+ "id": "kx-canvas"
+ }
+ ],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "launches",
+ "path": "/launches",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 2820,
+ "cls": 0.0809,
+ "fcp": 2820,
+ "tbtProxy": 28526,
+ "longTaskCount": 35,
+ "longestTask": 14136,
+ "dcl": 3619,
+ "load": 35249,
+ "transferBytes": 2418915,
+ "requestCount": 106,
+ "webglCreated": 1,
+ "webglLive": 1,
+ "webglVisible": 1,
+ "domNodes": 2719,
+ "images": 51,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "p.lx-sub",
+ "clsSources": [
+ {
+ "value": 0.01,
+ "at": 12676,
+ "node": "main"
+ },
+ {
+ "value": 0.0505,
+ "at": 16542,
+ "node": "div#tws-corner-stack"
+ },
+ {
+ "value": 0.0167,
+ "at": 21592,
+ "node": "div#tws-corner-stack"
+ }
+ ],
+ "bytesByType": {
+ "Document": 8207,
+ "Stylesheet": 28844,
+ "Script": 445982,
+ "Font": 176953,
+ "Image": 625722,
+ "Fetch": 500198
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459124
+ },
+ {
+ "url": "https://three.ws/assets/solana-wLzkomb4.js",
+ "type": "Script",
+ "bytes": 148534
+ },
+ {
+ "url": "https://ipfs.io/ipfs/QmfNs7QrktxRJG2aV6rFhhDpEnWStqa7AYocjYH6oJ4swY",
+ "type": "Image",
+ "bytes": 102319
+ },
+ {
+ "url": "https://ipfs.io/ipfs/QmWdMFQHbSHJSJPR6bdM5buSpCTiFtu7zpNVFTiVuQpeoQ",
+ "type": "Image",
+ "bytes": 98010
+ },
+ {
+ "url": "https://ipfs.io/ipfs/QmcA2QYRp3ndPr8dFmLbXyS5NU99WfYFnyuReMV3y2inXj",
+ "type": "Image",
+ "bytes": 97396
+ },
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/14bf61cb-1294-4cb4-a2a6-e65ab50aad23.png",
+ "type": "Image",
+ "bytes": 97382
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin-ext.woff2",
+ "type": "Font",
+ "bytes": 85127
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74422
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63563
+ },
+ {
+ "url": "https://ipfs.io/ipfs/QmUiLoMYc96fh9B2TkrBgNb2GwBTsa8LcmSByWB6oGkLWy",
+ "type": "Image",
+ "bytes": 62155
+ }
+ ],
+ "webglDetail": [],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "changelog",
+ "path": "/changelog",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 1276,
+ "cls": 0.1132,
+ "fcp": 1276,
+ "tbtProxy": 15833,
+ "longTaskCount": 24,
+ "longestTask": 12330,
+ "dcl": 1319,
+ "load": 0,
+ "transferBytes": 1584360,
+ "requestCount": 45,
+ "webglCreated": 1,
+ "webglLive": 0,
+ "webglVisible": 0,
+ "domNodes": 13279,
+ "images": 3,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "p",
+ "clsSources": [
+ {
+ "value": 0.0276,
+ "at": 2835,
+ "node": "main"
+ },
+ {
+ "value": 0.0857,
+ "at": 13452,
+ "node": "div#tws-corner-stack"
+ }
+ ],
+ "bytesByType": {
+ "Document": 4886,
+ "Stylesheet": 23573,
+ "Script": 536953,
+ "Fetch": 957259,
+ "Image": 68890
+ },
+ "topResources": [
+ {
+ "url": "https://three.ws/changelog.json",
+ "type": "Fetch",
+ "bytes": 490853
+ },
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459121
+ },
+ {
+ "url": "https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js",
+ "type": "Script",
+ "bytes": 258897
+ },
+ {
+ "url": "https://three.ws/assets/solana-wLzkomb4.js",
+ "type": "Script",
+ "bytes": 148521
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63552
+ },
+ {
+ "url": "https://three.ws/assets/node-polyfills-CXinE9OU.js",
+ "type": "Script",
+ "bytes": 20006
+ },
+ {
+ "url": "https://three.ws/search.js",
+ "type": "Script",
+ "bytes": 15820
+ },
+ {
+ "url": "https://three.ws/nav.js",
+ "type": "Script",
+ "bytes": 9914
+ },
+ {
+ "url": "https://three.ws/feature-discovery.js",
+ "type": "Script",
+ "bytes": 8043
+ },
+ {
+ "url": "https://three.ws/nav.css",
+ "type": "Stylesheet",
+ "bytes": 7829
+ }
+ ],
+ "webglDetail": [],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "docs start",
+ "path": "/docs/start-here",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 3652,
+ "cls": 0,
+ "fcp": 2388,
+ "tbtProxy": 3786,
+ "longTaskCount": 14,
+ "longestTask": 1467,
+ "dcl": 2468,
+ "load": 4299,
+ "transferBytes": 564402,
+ "requestCount": 20,
+ "webglCreated": 1,
+ "webglLive": 0,
+ "webglVisible": 0,
+ "domNodes": 621,
+ "images": 3,
+ "status": 200,
+ "loadFired": true,
+ "lcpDetail": "p",
+ "clsSources": [],
+ "bytesByType": {
+ "Document": 12136,
+ "Stylesheet": 66646,
+ "Script": 320144,
+ "Image": 63552,
+ "Fetch": 10154,
+ "Font": 91799
+ },
+ "topResources": [
+ {
+ "url": "https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js",
+ "type": "Script",
+ "bytes": 258897
+ },
+ {
+ "url": "https://three.ws/three.svg",
+ "type": "Image",
+ "bytes": 63552
+ },
+ {
+ "url": "https://three.ws/style.css",
+ "type": "Stylesheet",
+ "bytes": 51175
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin.woff2",
+ "type": "Font",
+ "bytes": 48287
+ },
+ {
+ "url": "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js",
+ "type": "Script",
+ "bytes": 36317
+ },
+ {
+ "url": "https://three.ws/fonts/space-grotesk-latin.woff2",
+ "type": "Font",
+ "bytes": 22316
+ },
+ {
+ "url": "https://three.ws/fonts/jetbrains-mono-latin.woff2",
+ "type": "Font",
+ "bytes": 21196
+ },
+ {
+ "url": "https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js",
+ "type": "Script",
+ "bytes": 12176
+ },
+ {
+ "url": "https://three.ws/docs/start-here",
+ "type": "Document",
+ "bytes": 12136
+ },
+ {
+ "url": "https://three.ws/tokens.css",
+ "type": "Stylesheet",
+ "bytes": 7294
+ }
+ ],
+ "webglDetail": [],
+ "consoleErrors": [],
+ "errors": []
+ },
+ {
+ "label": "agent profile",
+ "path": "/agents/d94d2a50-86fa-4d2e-b87b-580f7517aa4c",
+ "runs": 3,
+ "okRuns": 3,
+ "lcp": 21792,
+ "cls": 0.9538,
+ "fcp": 3012,
+ "tbtProxy": 25118,
+ "longTaskCount": 36,
+ "longestTask": 9196,
+ "dcl": 10644,
+ "load": 0,
+ "transferBytes": 3951300,
+ "requestCount": 164,
+ "webglCreated": 2,
+ "webglLive": 2,
+ "webglVisible": 2,
+ "domNodes": 2159,
+ "images": 4,
+ "status": 200,
+ "loadFired": false,
+ "lcpDetail": "p#ad-desc.ad-hero-desc",
+ "clsSources": [
+ {
+ "value": 0.01,
+ "at": 11812,
+ "node": "main"
+ },
+ {
+ "value": 0.8405,
+ "at": 15176,
+ "node": "section"
+ },
+ {
+ "value": 0.0505,
+ "at": 22200,
+ "node": "div#tws-corner-stack"
+ },
+ {
+ "value": 0.0167,
+ "at": 23223,
+ "node": "div#tws-corner-stack"
+ }
+ ],
+ "bytesByType": {
+ "Stylesheet": 39713,
+ "Document": 25206,
+ "Script": 1563222,
+ "Fetch": 2082095,
+ "Font": 155766,
+ "Other": 33590,
+ "Image": 51708
+ },
+ "topResources": [
+ {
+ "url": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/9b86c6f92389/3c37961e-d733-42b6-9ca4-f0b0d574ed90.glb",
+ "type": "Fetch",
+ "bytes": 1545927
+ },
+ {
+ "url": "https://three.ws/locales/en.json",
+ "type": "Fetch",
+ "bytes": 459135
+ },
+ {
+ "url": "https://three.ws/assets/three-core-B6YxbEni.js",
+ "type": "Script",
+ "bytes": 335310
+ },
+ {
+ "url": "https://three.ws/assets/three-addons-C_o9ZiOy.js",
+ "type": "Script",
+ "bytes": 296436
+ },
+ {
+ "url": "https://three.ws/assets/solana-wLzkomb4.js",
+ "type": "Script",
+ "bytes": 148521
+ },
+ {
+ "url": "https://three.ws/assets/ethers-B4Q7Fl8M.js",
+ "type": "Script",
+ "bytes": 138619
+ },
+ {
+ "url": "https://three.ws/fonts/inter-latin-ext.woff2",
+ "type": "Font",
+ "bytes": 85127
+ },
+ {
+ "url": "https://three.ws/assets/index-TD5esCDw.js",
+ "type": "Script",
+ "bytes": 82546
+ },
+ {
+ "url": "https://three.ws/ingest/static/array.js",
+ "type": "Script",
+ "bytes": 74426
+ },
+ {
+ "url": "https://three.ws/assets/agent-detail-Ber2vP1F.js",
+ "type": "Script",
+ "bytes": 66059
+ }
+ ],
+ "webglDetail": [
+ {
+ "visible": true,
+ "w": 238,
+ "h": 278,
+ "id": "tws-viewer-canvas"
+ },
+ {
+ "visible": true,
+ "w": 90,
+ "h": 90,
+ "id": "footer-bot-canvas"
+ }
+ ],
+ "consoleErrors": [
+ "Failed to load resource: the server responded with a status of 404 ()",
+ "Failed to load resource: the server responded with a status of 401 ()"
+ ],
+ "errors": []
+ }
+ ]
+}
\ No newline at end of file
diff --git a/prompts/quality-bar/_generated/08/baseline.md b/prompts/quality-bar/_generated/08/baseline.md
new file mode 100644
index 000000000..b486df6b8
--- /dev/null
+++ b/prompts/quality-bar/_generated/08/baseline.md
@@ -0,0 +1,311 @@
+# Mobile performance measurement - baseline
+
+**These are Playwright-measured field-style metrics, not Lighthouse scores.** Lighthouse is not
+installed in this workspace and may not be added as a dependency, so `scripts/mobile-perf.mjs`
+measures the underlying web-vitals primitives directly in the page with `PerformanceObserver`
+under emulated mobile hardware and network. `TBT*` is a long-task blocking-time proxy
+(`sum(max(0, longtask.duration - 50))`), not Lighthouse's simulated TBT.
+
+- Origin: https://three.ws
+- Device: Pixel 5 (Playwright descriptor, Chromium)
+- Network: slow 4G (1.6 Mbps down / 750 Kbps up / 150 ms RTT) via CDP `Network.emulateNetworkConditions`
+- CPU: 4x throttling via CDP `Emulation.setCPUThrottlingRate`
+- Runs per page: 3 (median reported), settle window 5000 ms after `load`
+- Measured: 2026-07-29T05:33:36.902Z
+
+Sorted worst LCP first.
+
+| page | path | LCP ms | CLS | TBT* ms | FCP ms | DCL ms | load ms | transfer | reqs | GL made/live/visible | HTTP |
+|---|---|---|---|---|---|---|---|---|---|---|---|
+| play | `/play` | 37736 | 0.000 | 45855 | 4704 | 37621 | 44255 | 4772 KB | 84 | 3 / 1 / 1 | 200 |
+| marketplace | `/marketplace` | 30432 | 0.420 | 28539 | 3760 | 11764 | 0 | 4669 KB | 126 | 1 / 0 / 0 | 200 |
+| home | `/` | 27412 | 0.068 | 34540 | 2736 | 23427 | 0 | 2313 KB | 89 | 3 / 2 / 1 | 200 |
+| agent profile | `/agents/d94d2a50-86fa-4d2e-b87b-580f7517aa4c` | 21792 | 0.954 | 25118 | 3012 | 10644 | 0 | 3859 KB | 164 | 2 / 2 / 2 | 200 |
+| walk | `/walk` | 17488 | 0.010 | 37031 | 10180 | 15525 | 0 | 3699 KB | 87 | 1 / 1 / 1 | 200 |
+| coin ($THREE) | `/coin/FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump` | 10316 | 0.536 | 43025 | 1796 | 2120 | 52465 | 1809 KB | 67 | 1 / 1 / 1 | 200 |
+| dashboard | `/dashboard` | 6408 | 0.000 | 14222 | 4964 | 18073 | 0 | 1609 KB | 66 | 1 / 0 / 0 | 200 |
+| forge | `/forge` | 4540 | 0.308 | 56126 | 4484 | 15850 | 65212 | 2286 KB | 82 | 2 / 1 / 1 | 200 |
+| irl | `/irl` | 4464 | 0.001 | 11006 | 2284 | 6299 | 7958 | 1715 KB | 61 | 2 / 1 / 1 | 200 |
+| news | `/news` | 3672 | 0.000 | 6470 | 3672 | 4475 | 4477 | 534 KB | 5 | 0 / 0 / 0 | 200 |
+| docs start | `/docs/start-here` | 3652 | 0.000 | 3786 | 2388 | 2468 | 4299 | 551 KB | 20 | 1 / 0 / 0 | 200 |
+| markets | `/markets` | 3220 | 0.529 | 17549 | 3220 | 4583 | 0 | 1778 KB | 68 | 0 / 0 / 0 | 200 |
+| launches | `/launches` | 2820 | 0.081 | 28526 | 2820 | 3619 | 35249 | 2362 KB | 106 | 1 / 1 / 1 | 200 |
+| ar | `/ar` | 1316 | 0.000 | 5842 | 1316 | 7008 | 7130 | 718 KB | 7 | 1 / 0 / 0 | 200 |
+| changelog | `/changelog` | 1276 | 0.113 | 15833 | 1276 | 1319 | 0 | 1547 KB | 45 | 1 / 0 / 0 | 200 |
+
+## Per-page detail
+
+### play - `/play`
+
+- LCP 37736 ms (element: `p.pi-body`)
+- CLS 0.0000, TBT* 45855 ms over 18 long tasks (longest 19392 ms)
+- transfer 4772 KB across 84 requests - Script 1935 KB, Image 1174 KB, Other 33 KB, Fetch 27 KB, Stylesheet 25 KB, Document 8 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 811, img elements 7
+- WebGL contexts: created 3, live 1, visible 1, lost -
+ - 393x727 visible=true `kx-canvas`
+- heaviest resources:
+ - 774 KB `/assets/world-hud-CRVwJCC0.js` (Script)
+ - 567 KB `/api/img?url=https%3A%2F%2Fipfs.io%2Fipfs%2Fbafybeihe22b5sxr3ihnxt7pregfieyteqvubqhik3j3y4bbx243xlqjw3q&seed=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump` (Image)
+ - 327 KB `/assets/three-core-B6YxbEni.js` (Script)
+ - 289 KB `/assets/three-addons-C_o9ZiOy.js` (Script)
+ - 146 KB `/assets/play-CgDwUSls.js` (Script)
+
+### marketplace - `/marketplace`
+
+- LCP 30432 ms (element: `https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/836fad74-689e-44ba-9eeb-bbdd63f01820.png`)
+- CLS 0.4196, TBT* 28539 ms over 45 long tasks (longest 5830 ms)
+- transfer 4669 KB across 126 requests - Image 2215 KB, Script 1559 KB, Fetch 492 KB, Stylesheet 108 KB, Font 69 KB, Document 37 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 6559, img elements 204
+- WebGL contexts: created 1, live 0, visible 0, lost -
+- heaviest resources:
+ - 979 KB `/agent-3d/latest/agent-3d.js` (Script)
+ - 448 KB `/locales/en.json` (Fetch)
+ - 344 KB `https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/e69a25bf85e8/e121501c-7224-4685-8238-50cd57a7c86d.png` (Image)
+ - 253 KB `https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js` (Script)
+ - 155 KB `https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/thumb/215905d7-f311-46d8-9036-2ee8cc7f5279.png` (Image)
+- layout shifts:
+ - 0.0684 at 3875 ms from `main#main-content`
+ - 0.1727 at 11557 ms from `main#main-content`
+ - 0.0155 at 14486 ms from `section#mkt-top-section`
+ - 0.0478 at 21097 ms from `section#mkt-top-section`
+ - 0.0488 at 28964 ms from `div#market-theme-picks`
+ - 0.0114 at 30880 ms from `div`
+ - 0.01 at 32571 ms from `main#main-content`
+ - 0.0599 at 36728 ms from `div#tws-corner-stack`
+
+### home - `/`
+
+- LCP 27412 ms (element: `h1.hero-h`)
+- CLS 0.0680, TBT* 34540 ms over 60 long tasks (longest 5836 ms)
+- transfer 2313 KB across 89 requests - Script 1474 KB, Fetch 546 KB, Font 173 KB, Document 91 KB, Stylesheet 25 KB, Image 5 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 2669, img elements 19
+- WebGL contexts: created 3, live 2, visible 1, lost -
+ - 351x340 visible=true `tws-viewer-canvas`
+- heaviest resources:
+ - 979 KB `/agent-3d/latest/agent-3d.js` (Script)
+ - 448 KB `/locales/en.json` (Fetch)
+ - 253 KB `https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js` (Script)
+ - 91 KB `/` (Document)
+ - 83 KB `/fonts/inter-latin-ext.woff2` (Font)
+- layout shifts:
+ - 0.01 at 47809 ms from `section`
+
+### agent profile - `/agents/d94d2a50-86fa-4d2e-b87b-580f7517aa4c`
+
+- LCP 21792 ms (element: `p#ad-desc.ad-hero-desc`)
+- CLS 0.9538, TBT* 25118 ms over 36 long tasks (longest 9196 ms)
+- transfer 3859 KB across 164 requests - Fetch 2033 KB, Script 1527 KB, Font 152 KB, Image 50 KB, Stylesheet 39 KB, Other 33 KB, Document 25 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 2159, img elements 4
+- WebGL contexts: created 2, live 2, visible 2, lost -
+ - 238x278 visible=true `tws-viewer-canvas`
+ - 90x90 visible=true `footer-bot-canvas`
+- heaviest resources:
+ - 1510 KB `https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/9b86c6f92389/3c37961e-d733-42b6-9ca4-f0b0d574ed90.glb` (Fetch)
+ - 448 KB `/locales/en.json` (Fetch)
+ - 327 KB `/assets/three-core-B6YxbEni.js` (Script)
+ - 289 KB `/assets/three-addons-C_o9ZiOy.js` (Script)
+ - 145 KB `/assets/solana-wLzkomb4.js` (Script)
+- layout shifts:
+ - 0.01 at 11812 ms from `main`
+ - 0.8405 at 15176 ms from `section`
+ - 0.0505 at 22200 ms from `div#tws-corner-stack`
+ - 0.0167 at 23223 ms from `div#tws-corner-stack`
+- console errors: 2 (first: `Failed to load resource: the server responded with a status of 404 ()`)
+
+### walk - `/walk`
+
+- LCP 17488 ms (element: `p.wl-hero-sub`)
+- CLS 0.0096, TBT* 37031 ms over 49 long tasks (longest 21126 ms)
+- transfer 3699 KB across 87 requests - Fetch 2349 KB, Script 1034 KB, Font 173 KB, Stylesheet 77 KB, Image 62 KB, Other 33 KB, Document 22 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 1143, img elements 7
+- WebGL contexts: created 1, live 1, visible 1, lost -
+ - 90x90 visible=true `footer-bot-canvas`
+- heaviest resources:
+ - 1402 KB `/hdri/outdoor.hdr` (Fetch)
+ - 490 KB `/avatars/default.glb` (Fetch)
+ - 448 KB `/locales/en.json` (Fetch)
+ - 327 KB `/assets/three-core-B6YxbEni.js` (Script)
+ - 289 KB `/assets/three-addons-C_o9ZiOy.js` (Script)
+- layout shifts:
+ - 0.0556 at 33503 ms from `div#tws-corner-stack`
+
+### coin ($THREE) - `/coin/FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`
+
+- LCP 10316 ms (element: `(unknown)`)
+- CLS 0.5362, TBT* 43025 ms over 38 long tasks (longest 28339 ms)
+- transfer 1809 KB across 67 requests - Script 1010 KB, Fetch 466 KB, Font 173 KB, Image 118 KB, Stylesheet 33 KB, Other 33 KB, Document 9 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 1263, img elements 11
+- WebGL contexts: created 1, live 1, visible 1, lost -
+ - 90x90 visible=true `footer-bot-canvas`
+- heaviest resources:
+ - 448 KB `/locales/en.json` (Fetch)
+ - 327 KB `/assets/three-core-B6YxbEni.js` (Script)
+ - 289 KB `/assets/three-addons-C_o9ZiOy.js` (Script)
+ - 145 KB `/assets/solana-wLzkomb4.js` (Script)
+ - 83 KB `/fonts/inter-latin-ext.woff2` (Font)
+- layout shifts:
+ - 0.4462 at 5673 ms from `section#cv-chart`
+ - 0.01 at 9680 ms from `main#cv-main`
+ - 0.0705 at 15781 ms from `div#tws-corner-stack`
+
+### dashboard - `/dashboard`
+
+- LCP 6408 ms (element: `img`)
+- CLS 0.0000, TBT* 14222 ms over 21 long tasks (longest 5187 ms)
+- transfer 1609 KB across 66 requests - Script 1458 KB, Image 62 KB, Font 47 KB, Stylesheet 36 KB, Other 33 KB, Document 24 KB, Fetch 3 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 226, img elements 2
+- WebGL contexts: created 1, live 0, visible 0, lost -
+ - 393x727 visible=true `avatar-canvas`
+- heaviest resources:
+ - 327 KB `/assets/three-core-B6YxbEni.js` (Script)
+ - 289 KB `/assets/three-addons-C_o9ZiOy.js` (Script)
+ - 253 KB `https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js` (Script)
+ - 145 KB `/assets/solana-wLzkomb4.js` (Script)
+ - 75 KB `/assets/http-BN82FX_8.js` (Script)
+
+### forge - `/forge`
+
+- LCP 4540 ms (element: `(unknown)`)
+- CLS 0.3085, TBT* 56126 ms over 42 long tasks (longest 29969 ms)
+- transfer 2286 KB across 82 requests - Script 1342 KB, Fetch 462 KB, Font 173 KB, Stylesheet 77 KB, Image 62 KB, Other 33 KB, Document 31 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 1882, img elements 22
+- WebGL contexts: created 2, live 1, visible 1, lost -
+ - 90x90 visible=true `footer-bot-canvas`
+- heaviest resources:
+ - 448 KB `/locales/en.json` (Fetch)
+ - 327 KB `/assets/three-core-B6YxbEni.js` (Script)
+ - 289 KB `/assets/three-addons-C_o9ZiOy.js` (Script)
+ - 253 KB `https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js` (Script)
+ - 145 KB `/assets/solana-wLzkomb4.js` (Script)
+- layout shifts:
+ - 0.0689 at 15385 ms from `div#forge-quality`
+ - 0.0356 at 15545 ms from `main`
+ - 0.0519 at 16404 ms from `main`
+ - 0.0425 at 24618 ms from `div#engine`
+ - 0.01 at 26126 ms from `main`
+ - 0.0979 at 32275 ms from `div#tws-corner-stack`
+
+### irl - `/irl`
+
+- LCP 4464 ms (element: `p#irl-subtitle.irl-subtitle`)
+- CLS 0.0012, TBT* 11006 ms over 14 long tasks (longest 6148 ms)
+- transfer 1715 KB across 61 requests - Script 507 KB, Font 69 KB, Document 35 KB, Fetch 1 KB, Stylesheet 1 KB
+- window `load` fired within the wait window: yes
+- DOM nodes 612, img elements 1
+- WebGL contexts: created 2, live 1, visible 1, lost -
+- heaviest resources:
+ - 145 KB `/assets/solana-wLzkomb4.js` (Script)
+ - 82 KB `/assets/irl-BVYQ2DZX.js` (Script)
+ - 73 KB `/ingest/static/array.js` (Script)
+ - 47 KB `/fonts/inter-latin.woff2` (Font)
+ - 41 KB `/assets/colyseus-connect-DyQw5MR0.js` (Script)
+
+### news - `/news`
+
+- LCP 3672 ms (element: `p.post-summary`)
+- CLS 0.0000, TBT* 6470 ms over 7 long tasks (longest 2516 ms)
+- transfer 534 KB across 5 requests - Fetch 449 KB, Image 62 KB, Document 20 KB, Script 3 KB
+- window `load` fired within the wait window: yes
+- DOM nodes 1025, img elements 1
+- WebGL contexts: created 0, live 0, visible 0, lost -
+- heaviest resources:
+ - 448 KB `/locales/en.json` (Fetch)
+ - 62 KB `/three.svg` (Image)
+ - 20 KB `/news` (Document)
+ - 3 KB `/i18n.js` (Script)
+ - 1 KB `/locales/manifest.json` (Fetch)
+
+### docs start - `/docs/start-here`
+
+- LCP 3652 ms (element: `p`)
+- CLS 0.0000, TBT* 3786 ms over 14 long tasks (longest 1467 ms)
+- transfer 551 KB across 20 requests - Script 313 KB, Font 90 KB, Stylesheet 65 KB, Image 62 KB, Document 12 KB, Fetch 10 KB
+- window `load` fired within the wait window: yes
+- DOM nodes 621, img elements 3
+- WebGL contexts: created 1, live 0, visible 0, lost -
+- heaviest resources:
+ - 253 KB `https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js` (Script)
+ - 62 KB `/three.svg` (Image)
+ - 50 KB `/style.css` (Stylesheet)
+ - 47 KB `/fonts/inter-latin.woff2` (Font)
+ - 35 KB `https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js` (Script)
+
+### markets - `/markets`
+
+- LCP 3220 ms (element: `p.cv-sub`)
+- CLS 0.5286, TBT* 17549 ms over 42 long tasks (longest 3344 ms)
+- transfer 1778 KB across 68 requests - Fetch 495 KB, Script 214 KB, Font 90 KB, Image 62 KB, Stylesheet 34 KB, Document 7 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 3084, img elements 108
+- WebGL contexts: created 0, live 0, visible 0, lost -
+- heaviest resources:
+ - 448 KB `/locales/en.json` (Fetch)
+ - 73 KB `/ingest/static/array.js` (Script)
+ - 62 KB `/three.svg` (Image)
+ - 47 KB `/fonts/inter-latin.woff2` (Font)
+ - 33 KB `/api/coin/markets?page=1&per_page=100` (Fetch)
+- layout shifts:
+ - 0.0181 at 7143 ms from `div`
+ - 0.5228 at 7561 ms from `div`
+ - 0.0174 at 14390 ms from `section`
+
+### launches - `/launches`
+
+- LCP 2820 ms (element: `p.lx-sub`)
+- CLS 0.0809, TBT* 28526 ms over 35 long tasks (longest 14136 ms)
+- transfer 2362 KB across 106 requests - Image 611 KB, Fetch 488 KB, Script 436 KB, Font 173 KB, Stylesheet 28 KB, Document 8 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 2719, img elements 51
+- WebGL contexts: created 1, live 1, visible 1, lost -
+- heaviest resources:
+ - 448 KB `/locales/en.json` (Fetch)
+ - 145 KB `/assets/solana-wLzkomb4.js` (Script)
+ - 100 KB `https://ipfs.io/ipfs/QmfNs7QrktxRJG2aV6rFhhDpEnWStqa7AYocjYH6oJ4swY` (Image)
+ - 96 KB `https://ipfs.io/ipfs/QmWdMFQHbSHJSJPR6bdM5buSpCTiFtu7zpNVFTiVuQpeoQ` (Image)
+ - 95 KB `https://ipfs.io/ipfs/QmcA2QYRp3ndPr8dFmLbXyS5NU99WfYFnyuReMV3y2inXj` (Image)
+- layout shifts:
+ - 0.01 at 12676 ms from `main`
+ - 0.0505 at 16542 ms from `div#tws-corner-stack`
+ - 0.0167 at 21592 ms from `div#tws-corner-stack`
+
+### ar - `/ar`
+
+- LCP 1316 ms (element: `p`)
+- CLS 0.0000, TBT* 5842 ms over 17 long tasks (longest 4357 ms)
+- transfer 718 KB across 7 requests - Fetch 449 KB, Script 257 KB, Document 11 KB
+- window `load` fired within the wait window: yes
+- DOM nodes 181, img elements 0
+- WebGL contexts: created 1, live 0, visible 0, lost -
+- heaviest resources:
+ - 448 KB `/locales/en.json` (Fetch)
+ - 244 KB `https://cdn.jsdelivr.net/npm/@google/[email protected]/dist/model-viewer.min.js` (Script)
+ - 11 KB `/ar` (Document)
+ - 7 KB `https://cdn.jsdelivr.net/npm/[email protected]/meshopt_decoder.js` (Script)
+ - 3 KB `/model-viewer-meshopt.js` (Script)
+
+### changelog - `/changelog`
+
+- LCP 1276 ms (element: `p`)
+- CLS 0.1132, TBT* 15833 ms over 24 long tasks (longest 12330 ms)
+- transfer 1547 KB across 45 requests - Fetch 935 KB, Script 524 KB, Image 67 KB, Stylesheet 23 KB, Document 5 KB
+- window `load` fired within the wait window: NO (long-lived requests still open)
+- DOM nodes 13279, img elements 3
+- WebGL contexts: created 1, live 0, visible 0, lost -
+- heaviest resources:
+ - 479 KB `/changelog.json` (Fetch)
+ - 448 KB `/locales/en.json` (Fetch)
+ - 253 KB `https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js` (Script)
+ - 145 KB `/assets/solana-wLzkomb4.js` (Script)
+ - 62 KB `/three.svg` (Image)
+- layout shifts:
+ - 0.0276 at 2835 ms from `main`
+ - 0.0857 at 13452 ms from `div#tws-corner-stack`
+
diff --git a/prompts/quality-bar/_generated/08/touch-baseline.md b/prompts/quality-bar/_generated/08/touch-baseline.md
new file mode 100644
index 000000000..469d5fb4d
--- /dev/null
+++ b/prompts/quality-bar/_generated/08/touch-baseline.md
@@ -0,0 +1,311 @@
+# Mobile input-ergonomics audit - baseline
+
+Measured with `scripts/mobile-touch-audit.mjs` against https://three.ws in a real
+Pixel 5 Playwright context (Chromium). Every value below is a live computed style or a
+measured bounding box, not a source grep.
+
+- Minimum target size checked: 44x44 CSS px
+- Inline text links are exempt (WCAG 2.5.8) and counted separately
+- Measured: 2026-07-29T06:04:43.521Z
+
+| path | undersized targets | interactive checked | inline-exempt | canvases touch-action:auto / visible | viewport-fit=cover | bottom bars w/o safe-area / total | overflow-x |
+|---|---|---|---|---|---|---|---|
+| `/marketplace` | 1171 | 1502 | 0 | 1/1 | NO | 1/1 | 0 px |
+| `/launches` | 232 | 299 | 0 | 2/2 | NO | 3/3 | 0 px |
+| `/docs/start-here` | 176 | 289 | 47 | 0/0 | NO | 1/1 | 0 px |
+| `/` | 172 | 314 | 5 | 5/6 | NO | 1/1 | 0 px |
+| `/markets` | 120 | 196 | 0 | 2/2 | NO | 1/1 | 165 px |
+| `/forge` | 49 | 135 | 1 | 2/2 | NO | 1/1 | 0 px |
+| `/coin/FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump` | 41 | 86 | 0 | 2/2 | NO | 2/2 | 0 px |
+| `/play` | 37 | 46 | 0 | 0/1 | yes | 3/3 | 0 px |
+| `/changelog` | 18 | 2245 | 4 | 1/1 | NO | 1/1 | 2 px |
+| `/dashboard` | 14 | 37 | 3 | 1/1 | yes | 1/1 | 0 px |
+| `/irl` | 12 | 59 | 0 | 0/1 | yes | 14/14 | 0 px |
+| `/walk` | 9 | 60 | 0 | 1/1 | yes | 0/0 | 0 px |
+| `/ar` | 6 | 14 | 6 | 0/0 | yes | 0/0 | 0 px |
+| `/news` | 5 | 117 | 5 | 0/0 | NO | 0/0 | 127 px |
+
+## Detail
+
+### `/marketplace`
+
+- undersized targets:
+ - 200x `a.title.card-profile-link 316x32`
+ - 200x `button.card-heart 17x21`
+ - 200x `a.compose-cta 79x24`
+ - 146x `button.tag-pill 47x18`
+ - 114x `a.card-author 21x19`
+ - 100x `button.tag-pill 49x18`
+ - 96x `button.tag-pill 45x18`
+ - 28x `button.tag-pill 66x18`
+ - 24x `a.title.card-profile-link 289x32`
+ - 10x `button.tag-pill 64x18`
+ - 5x `button.tag-pill 31x18`
+ - 4x `button.tag-pill 55x18`
+- visible canvases:
+ - `canvas#footer-bot-canvas` 90x90 touch-action=auto (parent auto)
+- bottom-anchored bars:
+ - `header.market-topbar` h=412 padding-bottom=9.888px safe-area-rule=false
+
+### `/launches`
+
+- undersized targets:
+ - 24x `button.twc-make.twc-tip 37x10`
+ - 24x `button.lx-action.lx-action-watch 35x29`
+ - 23x `a.lx-agent-row 322x36`
+ - 23x `span.twc 322x19`
+ - 23x `a.lx-action 103x29`
+ - 23x `a.lx-action 80x29`
+ - 23x `a.lx-action 86x29`
+ - 14x `a.mp-tick.mp-k-pay 201x20`
+ - 14x `a.mp-tick.mp-k-pay 226x20`
+ - 12x `a.mp-tick.mp-k-pay 242x20`
+ - 1x `a.nav-skip 157x36`
+ - 1x `a.lx-btn.lx-btn-primary 146x39`
+- visible canvases:
+ - `canvas#lx-field` 393x727 touch-action=auto (parent auto)
+ - `canvas#footer-bot-canvas` 90x90 touch-action=auto (parent auto)
+- bottom-anchored bars:
+ - `canvas#lx-field` h=727 padding-bottom=0px safe-area-rule=false
+ - `div.lx-aurora` h=1079 padding-bottom=0px safe-area-rule=false
+ - `section.lx-toolbar` h=159 padding-bottom=6.112px safe-area-rule=false
+
+### `/docs/start-here`
+
+- undersized targets:
+ - 160x `a.sidebar-link 267x30`
+ - 1x `a.docs-logo 114x33`
+ - 1x `a 67x28`
+ - 1x `a 71x28`
+ - 1x `a.btn-primary 58x30`
+ - 1x `input#search-input 247x31`
+ - 1x `a.sidebar-link.active 267x30`
+ - 1x `a.sidebar-link.external 267x30`
+ - 1x `button#pagetools-copy.docs-pagetools-btn 110x35`
+ - 1x `button#pagetools-caret.docs-pagetools-caret 35x35`
+ - 1x `a 146x21`
+ - 1x `a 164x21`
+- bottom-anchored bars:
+ - `aside#sidebar.docs-sidebar` h=675 padding-bottom=67.776px safe-area-rule=false
+
+### `/`
+
+- undersized targets:
+ - 27x `a 165x20`
+ - 14x `button.pg-avatar-item 32x32`
+ - 8x `a.eco-row-link 288x38`
+ - 8x `a.eco-row-tx 23x28`
+ - 4x `a.har-cta-link 353x22`
+ - 3x `button.pg-anim 50x24`
+ - 3x `a.wyg-card-link 295x21`
+ - 3x `button.hp-btn 111x41`
+ - 3x `button.bento-pill.bento-pill-btn 83x22`
+ - 2x `button.pg-chip 50x24`
+ - 2x `button.pg-anim 78x24`
+ - 2x `button.bento-pill.bento-pill-btn 50x22`
+- visible canvases:
+ - `canvas` 393x399 touch-action=none (parent auto)
+ - `canvas#mocap-waveform.mocap-waveform` 287x48 touch-action=auto (parent auto)
+ - `canvas#walk-minimap.walk-minimap` 285x140 touch-action=auto (parent auto)
+ - `canvas.walk-preview-canvas` 351x197 touch-action=auto (parent auto)
+ - `canvas#drop-canvas` 393x627 touch-action=auto (parent auto)
+ - `canvas.walk-companion-canvas` 148x208 touch-action=auto (parent auto)
+- bottom-anchored bars:
+ - `div.walk-c2w-fx` h=727 padding-bottom=0px safe-area-rule=false
+
+### `/markets`
+
+- undersized targets:
+ - 100x `a 202x22`
+ - 5x `button.nw-star 21x19`
+ - 1x `a.nav-skip 157x36`
+ - 1x `a.mkt-more 139x22`
+ - 1x `a.mkt-more 75x22`
+ - 1x `a 420x19`
+ - 1x `a 450x39`
+ - 1x `a 410x19`
+ - 1x `a 500x19`
+ - 1x `a 406x19`
+ - 1x `a.h-footer-nvidia 24x44`
+ - 1x `a 83x20`
+- visible canvases:
+ - `canvas#footer-bot-canvas` 90x90 touch-action=auto (parent auto)
+ - `canvas.walk-companion-canvas` 148x208 touch-action=auto (parent auto)
+- bottom-anchored bars:
+ - `div.walk-c2w-fx` h=1033 padding-bottom=0px safe-area-rule=false
+- horizontal overflow: 165 px beyond 558 px viewport
+
+### `/forge`
+
+- undersized targets:
+ - 12x `button.showcase-vote 43x20`
+ - 12x `button.showcase-remix 59x22`
+ - 3x `button 36x44`
+ - 1x `a.nav-skip 157x36`
+ - 1x `button#tab-text 120x39`
+ - 1x `button#tab-image 120x39`
+ - 1x `button#tab-sketch 120x39`
+ - 1x `a 70x15`
+ - 1x `button 42x44`
+ - 1x `a 218x15`
+ - 1x `button#connect-wallet-btn.fq-connect-btn 109x23`
+ - 1x `button#roll-forge.btn.forge-roll 155x41`
+- visible canvases:
+ - `canvas#footer-bot-canvas` 90x90 touch-action=auto (parent auto)
+ - `canvas.walk-companion-canvas` 148x208 touch-action=auto (parent auto)
+- bottom-anchored bars:
+ - `div.walk-c2w-fx` h=727 padding-bottom=0px safe-area-rule=false
+
+### `/coin/FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`
+
+- undersized targets:
+ - 7x `a.cv-mkt-x 104x22`
+ - 2x `button.cv-range-btn 49x27`
+ - 2x `a.cv-mkt-pair 103x17`
+ - 2x `a.cv-pill 87x36`
+ - 2x `a.cv-pill 96x36`
+ - 1x `a.nav-skip 157x36`
+ - 1x `a 38x22`
+ - 1x `a 54x22`
+ - 1x `button.cv-range-btn 48x27`
+ - 1x `button.cv-range-btn 40x27`
+ - 1x `button.cv-range-btn 37x27`
+ - 1x `button.cv-range-btn 87x27`
+- visible canvases:
+ - `canvas#footer-bot-canvas` 90x90 touch-action=auto (parent auto)
+ - `canvas.walk-companion-canvas` 148x208 touch-action=auto (parent auto)
+- bottom-anchored bars:
+ - `th.left` h=47 padding-bottom=12px safe-area-rule=false
+ - `div.walk-c2w-fx` h=727 padding-bottom=0px safe-area-rule=false
+
+### `/play`
+
+- undersized targets:
+ - 20x `button.cc-card-holders 92x20`
+ - 1x `a.cc-nav-brand 103x20`
+ - 1x `button#cc-nav-toggle.cc-nav-toggle 38x34`
+ - 1x `input 290x18`
+ - 1x `a.cc-adventure 165x34`
+ - 1x `button.pi-reopen 99x28`
+ - 1x `input#cc-name-input.cc-name-input 207x38`
+ - 1x `input 202x37`
+ - 1x `button.cc-gallery-btn 143x35`
+ - 1x `a 31x16`
+ - 1x `a 43x16`
+ - 1x `a 54x16`
+- visible canvases:
+ - `canvas#kx-canvas` 393x727 touch-action=none (parent auto)
+- bottom-anchored bars:
+ - `canvas#kx-canvas` h=727 padding-bottom=0px safe-area-rule=false
+ - `div#cc-lobby` h=727 padding-bottom=0px safe-area-rule=false
+ - `div#pi-overlay.pi-show` h=727 padding-bottom=20px safe-area-rule=false
+
+### `/changelog`
+
+- undersized targets:
+ - 1x `a.nav-skip 157x36`
+ - 1x `button.cl-filter 46x28`
+ - 1x `button.cl-filter 71x28`
+ - 1x `button.cl-filter 73x28`
+ - 1x `button.cl-filter 109x28`
+ - 1x `button.cl-filter 45x28`
+ - 1x `button.cl-filter 52x28`
+ - 1x `button.cl-filter 79x28`
+ - 1x `button.cl-filter 58x28`
+ - 1x `button.cl-filter 59x28`
+ - 1x `a.h-footer-community-btn 145x41`
+ - 1x `a 83x15`
+- visible canvases:
+ - `canvas.walk-companion-canvas` 148x208 touch-action=auto (parent auto)
+- bottom-anchored bars:
+ - `div.walk-c2w-fx` h=731 padding-bottom=0px safe-area-rule=false
+- horizontal overflow: 2 px beyond 395 px viewport
+
+### `/dashboard`
+
+- undersized targets:
+ - 1x `a.nav-skip 157x36`
+ - 1x `a.skip-link 1x1`
+ - 1x `a.brand 287x40`
+ - 1x `input#privy-email-input 177x42`
+ - 1x `input#email 287x42`
+ - 1x `input#password 287x42`
+ - 1x `input#remember 18x18`
+ - 1x `a.forgot 105x18`
+ - 1x `button#submit 287x41`
+ - 1x `a.panel-brand 76x17`
+ - 1x `a 83x19`
+ - 1x `a 79x19`
+- visible canvases:
+ - `canvas#avatar-canvas` 393x727 touch-action=auto (parent auto)
+- bottom-anchored bars:
+ - `canvas#avatar-canvas` h=727 padding-bottom=0px safe-area-rule=false
+
+### `/irl`
+
+- undersized targets:
+ - 1x `button#irl-consent-exact.irl-consent-btn 170x43`
+ - 1x `button#irl-consent-approx.irl-consent-btn 170x43`
+ - 1x `input#irl-consent-dontshow 16x16`
+ - 1x `button#irl-sheet-view.irl-sheet-btn 349x43`
+ - 1x `button#irl-sheet-report.irl-sheet-report 97x32`
+ - 1x `button#irl-cal-down.irl-cal-step 40x40`
+ - 1x `button#irl-cal-up.irl-cal-step 40x40`
+ - 1x `button#irl-cal-save 272x41`
+ - 1x `button#irl-cal-cancel 76x41`
+ - 1x `a.irl-ob-learn 144x32`
+ - 1x `button.tws-es-btn.tws-es-btn--primary 283x40`
+ - 1x `button.tws-es-btn 283x40`
+- visible canvases:
+ - `canvas#irl-canvas` 393x727 touch-action=none (parent none)
+- bottom-anchored bars:
+ - `div.irl-bg` h=727 padding-bottom=0px safe-area-rule=false
+ - `canvas#irl-canvas` h=727 padding-bottom=0px safe-area-rule=false
+ - `div#irl-more-sheet` h=375 padding-bottom=28px safe-area-rule=false
+ - `footer.irl-bottom` h=238 padding-bottom=14px safe-area-rule=false
+ - `div#irl-caption-panel` h=288 padding-bottom=36px safe-area-rule=false
+ - `div#irl-consent-sheet` h=443 padding-bottom=32px safe-area-rule=false
+ - `div#irl-error-sheet` h=207 padding-bottom=36px safe-area-rule=false
+ - `div#irl-mypins-sheet` h=200 padding-bottom=36px safe-area-rule=false
+ - `div#irl-sheet` h=308 padding-bottom=36px safe-area-rule=false
+ - `div#irl-report-sheet` h=485 padding-bottom=36px safe-area-rule=false
+ - `div#irl-agents-sheet` h=200 padding-bottom=36px safe-area-rule=false
+ - `div#irl-calibrate-panel` h=230 padding-bottom=18px safe-area-rule=false
+ - `div#irl-onboard.irl-onboard.is-open` h=727 padding-bottom=24px safe-area-rule=false
+ - `section.irl-drops-panel` h=390 padding-bottom=16px safe-area-rule=false
+
+### `/walk`
+
+- undersized targets:
+ - 1x `a.nav-skip 157x36`
+ - 1x `a.skip-link 393x26`
+ - 1x `a.btn.btn--ghost 164x37`
+ - 1x `button#wl-copy.wl-copy-btn 50x23`
+ - 1x `a.btn.btn--primary 123x37`
+ - 1x `a.btn.btn--ghost 189x37`
+ - 1x `a.h-footer-nvidia 24x44`
+ - 1x `a 83x20`
+ - 1x `a 80x20`
+- visible canvases:
+ - `canvas#footer-bot-canvas` 90x90 touch-action=auto (parent auto)
+
+### `/ar`
+
+- undersized targets:
+ - 1x `a.brand 98x19`
+ - 1x `a.top 81x15`
+ - 1x `button.chip 165x29`
+ - 1x `button.chip 223x29`
+ - 1x `button.chip 146x29`
+ - 1x `button.chip 162x29`
+
+### `/news`
+
+- undersized targets:
+ - 1x `a.brand 103x31`
+ - 1x `a 38x26`
+ - 1x `a 58x26`
+ - 1x `a 82x26`
+ - 1x `a.subscribe 165x42`
+- horizontal overflow: 127 px beyond 520 px viewport
+
diff --git a/prompts/quality-bar/_generated/10/audit-data.json b/prompts/quality-bar/_generated/10/audit-data.json
new file mode 100644
index 000000000..c13d20a7c
--- /dev/null
+++ b/prompts/quality-bar/_generated/10/audit-data.json
@@ -0,0 +1,55 @@
+{
+ "startedAt": "2026-07-29T06:10:51.858Z",
+ "finishedAt": null,
+ "baseUrl": "https://three.ws",
+ "cases": {
+ "a": {
+ "id": "a",
+ "label": "Athlete",
+ "prompt": "A synthetic persona, not a real person: a professional sprinter in her late twenties, lean muscular build, short natural curls, wearing a fitted team tracksuit and running shoes, standing relaxed with arms slightly away from the body and hands open, fingers separated.",
+ "subjectClass": "person",
+ "stylized": false,
+ "variants": {
+ "before": {
+ "id": "before",
+ "tierRequested": "standard",
+ "views": {
+ "front": {
+ "file": "a-before-front.png",
+ "renderError": null
+ },
+ "three-quarter": {
+ "file": "a-before-three-quarter.png",
+ "renderError": null
+ }
+ },
+ "glbUrl": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/47e396f1-4c6b-4b4d-9c23-b39931252744.glb",
+ "backend": "hunyuan3d",
+ "tierServed": "standard",
+ "previewImageUrl": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/refs/4f92033c-8e30-4689-9f72-2c55099791d1.png",
+ "creationId": "47e396f1-4c6b-4b4d-9c23-b39931252744",
+ "generationMs": 80287,
+ "error": null
+ }
+ },
+ "directed": "Full-body humanoid, standing in a neutral A-pose with arms slightly away from the body and legs slightly apart for optimal rigging, hands open, fingers separated; female, late twenties, lean muscular athletic build, toned proportions, determined",
+ "directedVia": "vertex gemini-2.5-flash (chat chain returned nothing)",
+ "directorError": null
+ }
+ },
+ "variants": [
+ {
+ "id": "before",
+ "tier": "standard"
+ },
+ {
+ "id": "after",
+ "tier": "high"
+ }
+ ],
+ "judge": {
+ "model": "google/gemini-2.5-pro",
+ "maxTokens": 4096,
+ "callsPerView": 2
+ }
+}
diff --git a/prompts/quality-bar/_generated/10/irl-realism-check.json b/prompts/quality-bar/_generated/10/irl-realism-check.json
new file mode 100644
index 000000000..75eced26d
--- /dev/null
+++ b/prompts/quality-bar/_generated/10/irl-realism-check.json
@@ -0,0 +1,539 @@
+[
+ {
+ "name": "dev",
+ "url": "http://localhost:3004/irl",
+ "loaded": true,
+ "avatarRendered": true,
+ "consoleErrors": [
+ "WebSocket connection to 'wss://solid-parakeet-96wp6jwgq7xcxv75-3000.app.github.dev/?token=M0RPhrYv9bOv' failed: Error during WebSocket handshake: Unexpected response code: 404",
+ "[vite] failed to connect to websocket (Error: WebSocket closed without opened.). "
+ ],
+ "pageErrors": [
+ "WebSocket closed without opened."
+ ],
+ "screenshots": [
+ "/workspaces/three.ws/prompts/quality-bar/_generated/10/irl-avatar.png",
+ "/workspaces/three.ws/prompts/quality-bar/_generated/10/irl-avatar-realism-applied.png"
+ ],
+ "readback": {
+ "scenes": 1,
+ "meshes": 19,
+ "skinnedMeshes": 10,
+ "classified": [
+ {
+ "mesh": "EyeLeft",
+ "class": "eye",
+ "material": {
+ "name": "Wolf3D_Eye",
+ "type": "MeshStandardMaterial",
+ "isMeshPhysicalMaterial": false,
+ "isMeshStandardMaterial": true,
+ "roughness": 1,
+ "metalness": 0,
+ "sheen": null,
+ "sheenColor": null,
+ "sheenRoughness": null,
+ "clearcoat": null,
+ "clearcoatRoughness": null,
+ "ior": null,
+ "specularIntensity": null,
+ "envMapIntensity": 0.85,
+ "side": 0,
+ "alphaTest": 0,
+ "color": "#ffffff"
+ }
+ },
+ {
+ "mesh": "EyeRight",
+ "class": "eye",
+ "material": {
+ "name": "Wolf3D_Eye",
+ "type": "MeshStandardMaterial",
+ "isMeshPhysicalMaterial": false,
+ "isMeshStandardMaterial": true,
+ "roughness": 1,
+ "metalness": 0,
+ "sheen": null,
+ "sheenColor": null,
+ "sheenRoughness": null,
+ "clearcoat": null,
+ "clearcoatRoughness": null,
+ "ior": null,
+ "specularIntensity": null,
+ "envMapIntensity": 0.85,
+ "side": 0,
+ "alphaTest": 0,
+ "color": "#ffffff"
+ }
+ },
+ {
+ "mesh": "Wolf3D_Head",
+ "class": "skin",
+ "material": {
+ "name": "Wolf3D_Skin",
+ "type": "MeshStandardMaterial",
+ "isMeshPhysicalMaterial": false,
+ "isMeshStandardMaterial": true,
+ "roughness": 0.699999988079071,
+ "metalness": 0,
+ "sheen": null,
+ "sheenColor": null,
+ "sheenRoughness": null,
+ "clearcoat": null,
+ "clearcoatRoughness": null,
+ "ior": null,
+ "specularIntensity": null,
+ "envMapIntensity": 0.85,
+ "side": 0,
+ "alphaTest": 0,
+ "color": "#ffffff"
+ }
+ },
+ {
+ "mesh": "Wolf3D_Teeth",
+ "class": "teeth",
+ "material": {
+ "name": "Wolf3D_Teeth",
+ "type": "MeshStandardMaterial",
+ "isMeshPhysicalMaterial": false,
+ "isMeshStandardMaterial": true,
+ "roughness": 1,
+ "metalness": 0,
+ "sheen": null,
+ "sheenColor": null,
+ "sheenRoughness": null,
+ "clearcoat": null,
+ "clearcoatRoughness": null,
+ "ior": null,
+ "specularIntensity": null,
+ "envMapIntensity": 0.85,
+ "side": 2,
+ "alphaTest": 0,
+ "color": "#ffffff"
+ }
+ },
+ {
+ "mesh": "Wolf3D_Hair",
+ "class": "hair",
+ "material": {
+ "name": "Wolf3D_Hair",
+ "type": "MeshStandardMaterial",
+ "isMeshPhysicalMaterial": false,
+ "isMeshStandardMaterial": true,
+ "roughness": 0.800000011920929,
+ "metalness": 0,
+ "sheen": null,
+ "sheenColor": null,
+ "sheenRoughness": null,
+ "clearcoat": null,
+ "clearcoatRoughness": null,
+ "ior": null,
+ "specularIntensity": null,
+ "envMapIntensity": 0.85,
+ "side": 2,
+ "alphaTest": 0,
+ "color": "#181818"
+ }
+ },
+ {
+ "mesh": "Wolf3D_Body",
+ "class": "skin",
+ "material": {
+ "name": "Wolf3D_Body",
+ "type": "MeshStandardMaterial",
+ "isMeshPhysicalMaterial": false,
+ "isMeshStandardMaterial": true,
+ "roughness": 0.858578622341156,
+ "metalness": 0,
+ "sheen": null,
+ "sheenColor": null,
+ "sheenRoughness": null,
+ "clearcoat": null,
+ "clearcoatRoughness": null,
+ "ior": null,
+ "specularIntensity": null,
+ "envMapIntensity": 0.85,
+ "side": 2,
+ "alphaTest": 0,
+ "color": "#e69b7c"
+ }
+ }
+ ],
+ "sample": [
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": false
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "EyeLeft",
+ "class": "eye",
+ "visible": true
+ },
+ {
+ "name": "EyeRight",
+ "class": "eye",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Head",
+ "class": "skin",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Teeth",
+ "class": "teeth",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Hair",
+ "class": "hair",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Glasses",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Body",
+ "class": "skin",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Outfit_Bottom",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Outfit_Footwear",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Outfit_Top",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ }
+ ]
+ },
+ "summary": {
+ "classifiedCount": 6,
+ "physicalCount": 0,
+ "skinCount": 2,
+ "eyeCount": 2,
+ "skinMarked": false,
+ "eyeMarked": false,
+ "realismActive": false
+ },
+ "afterModule": {
+ "looksLikeAvatarMesh": true,
+ "counts": {
+ "skin": 2,
+ "eye": 2,
+ "hair": 1,
+ "teeth": 1
+ },
+ "readback": {
+ "scenes": 1,
+ "meshes": 19,
+ "skinnedMeshes": 10,
+ "classified": [
+ {
+ "mesh": "EyeLeft",
+ "class": "eye",
+ "material": {
+ "name": "Wolf3D_Eye",
+ "type": "MeshPhysicalMaterial",
+ "isMeshPhysicalMaterial": true,
+ "isMeshStandardMaterial": true,
+ "roughness": 0.08,
+ "metalness": 0,
+ "sheen": 0,
+ "sheenColor": "#000000",
+ "sheenRoughness": 1,
+ "clearcoat": 1,
+ "clearcoatRoughness": 0.03,
+ "ior": 1.376,
+ "specularIntensity": 1,
+ "envMapIntensity": 1.1,
+ "side": 0,
+ "alphaTest": 0,
+ "color": "#ffffff"
+ }
+ },
+ {
+ "mesh": "EyeRight",
+ "class": "eye",
+ "material": {
+ "name": "Wolf3D_Eye",
+ "type": "MeshPhysicalMaterial",
+ "isMeshPhysicalMaterial": true,
+ "isMeshStandardMaterial": true,
+ "roughness": 0.08,
+ "metalness": 0,
+ "sheen": 0,
+ "sheenColor": "#000000",
+ "sheenRoughness": 1,
+ "clearcoat": 1,
+ "clearcoatRoughness": 0.03,
+ "ior": 1.376,
+ "specularIntensity": 1,
+ "envMapIntensity": 1.1,
+ "side": 0,
+ "alphaTest": 0,
+ "color": "#ffffff"
+ }
+ },
+ {
+ "mesh": "Wolf3D_Head",
+ "class": "skin",
+ "material": {
+ "name": "Wolf3D_Skin",
+ "type": "MeshPhysicalMaterial",
+ "isMeshPhysicalMaterial": true,
+ "isMeshStandardMaterial": true,
+ "roughness": 0.6,
+ "metalness": 0,
+ "sheen": 0.35,
+ "sheenColor": "#ffe0c2",
+ "sheenRoughness": 0.6,
+ "clearcoat": 0,
+ "clearcoatRoughness": 0,
+ "ior": 1.5,
+ "specularIntensity": 0.6,
+ "envMapIntensity": 0.7,
+ "side": 0,
+ "alphaTest": 0,
+ "color": "#ffffff"
+ }
+ },
+ {
+ "mesh": "Wolf3D_Teeth",
+ "class": "teeth",
+ "material": {
+ "name": "Wolf3D_Teeth",
+ "type": "MeshPhysicalMaterial",
+ "isMeshPhysicalMaterial": true,
+ "isMeshStandardMaterial": true,
+ "roughness": 0.25,
+ "metalness": 0,
+ "sheen": 0,
+ "sheenColor": "#000000",
+ "sheenRoughness": 1,
+ "clearcoat": 0.4,
+ "clearcoatRoughness": 0.15,
+ "ior": 1.5,
+ "specularIntensity": 1,
+ "envMapIntensity": 0.85,
+ "side": 2,
+ "alphaTest": 0,
+ "color": "#ffffff"
+ }
+ },
+ {
+ "mesh": "Wolf3D_Hair",
+ "class": "hair",
+ "material": {
+ "name": "Wolf3D_Hair",
+ "type": "MeshPhysicalMaterial",
+ "isMeshPhysicalMaterial": true,
+ "isMeshStandardMaterial": true,
+ "roughness": 0.55,
+ "metalness": 0,
+ "sheen": 0.5,
+ "sheenColor": "#181818",
+ "sheenRoughness": 0.4,
+ "clearcoat": 0,
+ "clearcoatRoughness": 0,
+ "ior": 1.5,
+ "specularIntensity": 1,
+ "envMapIntensity": 0.85,
+ "side": 2,
+ "alphaTest": 0,
+ "color": "#181818"
+ }
+ },
+ {
+ "mesh": "Wolf3D_Body",
+ "class": "skin",
+ "material": {
+ "name": "Wolf3D_Body",
+ "type": "MeshPhysicalMaterial",
+ "isMeshPhysicalMaterial": true,
+ "isMeshStandardMaterial": true,
+ "roughness": 0.6,
+ "metalness": 0,
+ "sheen": 0.35,
+ "sheenColor": "#e6885d",
+ "sheenRoughness": 0.6,
+ "clearcoat": 0,
+ "clearcoatRoughness": 0,
+ "ior": 1.5,
+ "specularIntensity": 0.6,
+ "envMapIntensity": 0.7,
+ "side": 2,
+ "alphaTest": 0,
+ "color": "#e69b7c"
+ }
+ }
+ ],
+ "sample": [
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": false
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "EyeLeft",
+ "class": "eye",
+ "visible": true
+ },
+ {
+ "name": "EyeRight",
+ "class": "eye",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Head",
+ "class": "skin",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Teeth",
+ "class": "teeth",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Hair",
+ "class": "hair",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Glasses",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Body",
+ "class": "skin",
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Outfit_Bottom",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Outfit_Footwear",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "Wolf3D_Outfit_Top",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ },
+ {
+ "name": "",
+ "class": null,
+ "visible": true
+ }
+ ]
+ }
+ },
+ "afterSummary": {
+ "classifiedCount": 6,
+ "physicalCount": 6,
+ "skinCount": 2,
+ "eyeCount": 2,
+ "skinMarked": true,
+ "eyeMarked": true,
+ "realismActive": true
+ },
+ "cameraAr": null,
+ "onboarding": [
+ "Enable Camera",
+ "Enable Location",
+ "Continue without"
+ ],
+ "notes": [
+ "camera AR click failed: page.click: Timeout 10000ms exceeded.\nCall log:\n - waiting for locator('#irl-camera-btn')\n - locator resolved to <button type=\"button\" id=\"irl-camera-btn\" aria-pressed=\"false\">…</button>\n - attempting click action\n 2 × waiting for element to be visible, enabled and stable\n - element is visible, enabled and stable\n - scrolling into view if needed\n - done scrolling\n - <div data-dx-close=\"\" class=\"irl-dx-scrim\"></div> from <div role=\"dialog\" class=\"is-open\" aria-modal=\"true\" id=\"irl-discovery-explainer\" aria-label=\"How discovery works\">…</div> subtree intercepts pointer events\n - retrying click action\n - waiting 20ms\n - waiting for element to be visible, enabled and stable\n"
+ ]
+ }
+]
\ No newline at end of file
diff --git a/prompts/roadmap/creation-consolidation.md b/prompts/roadmap/creation-consolidation.md
index a2748da05..db6e148f3 100644
--- a/prompts/roadmap/creation-consolidation.md
+++ b/prompts/roadmap/creation-consolidation.md
@@ -1,6 +1,6 @@
# Creation Surface Consolidation — Audit & Plan
-**Status:** Phase 1 (additive hub) shipped 2026-07-08. Phase 2 executed 2026-07-16 for everything that survived re-verification against the live tree; several table rows turned out stale or unsafe (see the 07-16 note). Phase 3 (§3.3 pipeline handoffs) executed 2026-07-16 (see the Phase 3 note).
+**Status:** Phase 1 (additive hub) shipped 2026-07-08. Phase 2 executed 2026-07-16 for everything that survived re-verification against the live tree; several table rows turned out stale or unsafe (see the 07-16 note). Phase 3 (§3.3 pipeline handoffs) executed 2026-07-16 (see the Phase 3 note). Phase 2 closed out 2026-07-29: the `/agent/new` and `/scan` 301s and the standalone `/avatar-edit` retirement shipped; the `/embed` -> `/studio` and `/avatar-edit` -> Avatar Studio redirects are recorded as deliberate no-ships with their blockers (see the 07-29 note).
**Audited:** 2026-06-12
---
@@ -66,6 +66,109 @@ Phase 3 wires the completion-state handoffs from §3.3 that were still missing,
**Still open:** the same route-level items listed in the Phase 2 note (the `/agent/new` 301, the C1 single-URL merge, `/avatar-edit` retirement, and the `/embed` -> `/studio` merge) all remain owner/parity-gated and were not touched.
+## Progress note: 2026-07-29 (Phase 2 close-out pass)
+
+Picks up the four items the 07-16 pass left open. Three of the four shipped; the fourth is
+recorded below as a deliberate no-ship with the reason and the remaining work, because the
+redirect it calls for would have removed working functionality.
+
+The redirect mechanics matter here, so they are written down once: `server/index.mjs` matches
+`vercel.json` `routes` against the **pathname only** and emits `Location` verbatim, so a
+status-only route **drops the query string**. Any retired route that carries meaningful params
+therefore uses a `has`-gated rewrite for the param-carrying form and the 301 only for the bare
+form. That pattern is used twice below.
+
+**Executed:**
+
+- **C2 — `/agent/new` -> `/create-agent` (301), shipped.** The 07-16 blocker was real: `/agent/new`
+ serves `pages/agent-edit.html`, which POSTs a draft agent on page load, and it was the target of
+ the avatar handoff (`?avatar_id=&avatar_glb=&avatar_name=`). Both are now resolved.
+ `src/create-agent.js` gained `applyAvatarHandoff()`: it reads those three params, seeds
+ `state.model` in `library` mode (or `starter` mode when only a GLB URL arrives, which imports the
+ model at ship time), opens the matching pane, prefills the name as `"<avatar> Agent"`, and
+ `history.replaceState`s the URL back to `/create-agent`. Note this is strictly more than
+ `/agent/new` ever did: `agent-edit.js` read `avatar_glb` but never used it. The two producers now
+ link the canonical wizard directly (`startAgentFromAvatar()` in `src/marketplace.js`, the
+ "Turn this into an agent" button in `pages/create-selfie.html`). `vercel.json` keeps
+ `/agent/new` alive for old links: two `has`-gated rewrites (`avatar_id`, `avatar_glb`) serve
+ `create-agent.html` with the params intact, and the bare path 301s. `/agent/:id/edit` is
+ untouched: `agent-edit.html` is still the editor for an existing agent, it is only the
+ create-a-blank-agent entry that is retired. `data/pages.json` entry removed.
+
+- **C1 — `/scan` merged into `/create/selfie` (301), shipped.** Re-inspection overturned the 07-16
+ "two distinct input methods" reading. `pages/scan.html` had already been reduced to a stub that
+ `location.replace()`d to `/create/selfie` on load, and `/create/selfie` owns *both* inputs: the
+ "Use camera" button opens the live camera, "Upload" takes a file. So there was no capability left
+ to port and no second implementation to choose between: §5.1's open decision resolves to
+ `/create/selfie` by what the code already does. `/scan` now 301s server-side (no more
+ render-then-bounce), `pages/scan.html` and its Vite entry are deleted, and the entry is gone from
+ `data/pages.json`. Inbound links repointed: `pages/features/scan.html` (both CTAs),
+ `pages/what-is.html`, and the `/studio` empty state. The now-circular "Prefer to use your camera
+ live? The 3D Scanner…" cross-link on `/create/selfie` is replaced by copy pointing at the
+ page's own camera button (under a new i18n key, so stale translations fall back to English
+ instead of rendering a self-link). `/features/scan` stays as the marketing page.
+
+- **C4 — the standalone `/avatar-edit` landing retired, shipped (partial).** §2 C4 asks for two
+ things: kill the standalone URL, and make Avatar Studio the editor. The first shipped: the bare
+ `/avatar-edit` path (which rendered an error, since it has no avatar to edit) now 301s to
+ `/avatars`, while a `has`-gated rewrite keeps the legacy `?id=` form rendering, and
+ `src/avatar-edit.js` rewrites that URL in place to the canonical `/avatars/:id/edit` with
+ `replaceState` (no reload, so the `?equip-*` gallery handoff survives). The last producer of the
+ query form, `src/a-me.js`, now links the canonical path; every other caller already did.
+ The second half did **not** ship, deliberately: see below.
+
+- **C6 — `/embed` parity work in `/studio`, shipped; the 301 did not.** Four options the
+ `/walk-embed` runtime has always honoured were unreachable from Widget Studio, so any
+ Studio-built avatar snippet silently shipped the defaults. `public/studio/studio.js` now exposes
+ them on the `walking-avatar` type: **ground** disc/shadow (`?ground=false`), visitor
+ **gesture** buttons (`?gestures=true`), the attribution **badge** (`?badge=false`), and a
+ **responsive** snippet that emits an `aspect-ratio` wrapper instead of fixed pixels. Defaults
+ mirror `src/walk-embed.js`, and only non-default values are written into the URL. The two
+ surfaces now cross-link and each states what it is for.
+
+**Deliberately NOT shipped, with the reason:**
+
+- **The `/embed` -> `/studio` 301.** After the parity work above, `/studio` still cannot do
+ `/embed`'s job, and the gaps are structural rather than missing checkboxes:
+ 1. **No-account snippet generation.** `/embed` is fully client-side: configure, copy, leave.
+ `/studio` must persist a widget row before `openEmbedModal` can emit anything, so the redirect
+ would put a sign-in wall in front of a flow that has none today.
+ 2. **Chat mode.** `/embed`'s `chat` mode emits `<iframe src="/a/<agentId>?embed=1">`. Studio's
+ `talking-agent` is a different runtime (`/widget#widget=<id>&kiosk=true`) and cannot produce
+ that URL. `src/dashboard-next/pages/agents.js` links `/embed?avatar=…&mode=chat` today.
+ 3. **Deep-linkable config.** `/embed` reflects every control into `location.search` and rehydrates
+ from it, so a configured editor URL is itself a shareable artifact. `/studio` reads only
+ `edit`/`template`/`type`/`model`/`avatar`. A query-dropping 301 (see the mechanics note above)
+ would break every saved `/embed?…` URL, and a `has`-gated rewrite cannot translate the params
+ because Studio does not read them.
+ 4. **Raw GLB/VRM URL as the avatar**, and the **platform paste instructions**
+ (HTML / React / WordPress / Webflow / Shopify), have no Studio equivalent.
+ Also mechanical: `walk-sdk/src/config.js` suppresses the corner companion on paths prefixed
+ `/embed`; moving the editor under `/studio` needs that list updated in the same change.
+ The honest state is that these are two products sharing a category, not a duplicate: a fast
+ stateless snippet maker and a saved, brandable widget builder. Closing 1-3 means building a
+ guest mode, a chat widget type, and a config-URL layer inside `/studio` (a project, not a
+ redirect). Until then the two are cross-linked and the 301 stays unshipped.
+
+- **`/avatar-edit` -> Avatar Studio edit mode.** The redirect in the §4 table is still unsafe, and
+ the 07-16 note understated why: Avatar Studio's edit mode is not merely missing features, it
+ **loses data**. `collapseAppearance`/`hydrateAppearance` in `src/avatar-studio-utils.js` know only
+ `accessories/morphs/colors/hidden`, so opening a garment-wearing avatar in
+ `/create/studio?edit=ID` and saving drops `appearance.garments` and `appearance.outfit`; and its
+ save is a client-side `GLTFExporter` re-export of `base_model_url` that overwrites the canonical
+ GLB, where `avatar-edit` PATCHes appearance only and lets the server bake rebuild the dressed
+ model. On top of that, Studio has no wardrobe/closet (8 garment slots with occlusion masking), no
+ auto-rig tab, no walk preview or "Play as this" handoff, no `?equip-*` support, and its
+ recolour/hide targets are hardcoded Wolf3D material names where `src/avatar-wardrobe.js` resolves
+ layers on arbitrary GLBs. Redirecting now would silently undress people's avatars. **Prerequisite
+ for the merge:** appearance round-trip fidelity (garments + outfit) and non-destructive save in
+ `src/avatar-studio.js` first; then the wardrobe/closet, rig, and walk panels; then the redirect.
+
+**Phase 2 status after this pass:** steps 4 (C2), 5 (C1), 6 (C3), 8 (C5) and 10 are complete.
+Step 7 (C4) is half complete: the standalone route is retired, the editor merge is blocked on the
+data-loss prerequisites above. Step 9 (C6) has its parity work done and its redirect deliberately
+unshipped. The remaining `/start` question in §5.2 was not in scope for this pass.
+
---
**Problem:** 28 creation-related surfaces (18 nav-linked, 10 orphaned) presented as a flat menu of peer options. Users can't tell which tools are products, which are steps, and which are duplicates. The platform has no creation funnel — it has a pile of doors.
diff --git a/public/changelog.json b/public/changelog.json
index ff408a70c..a5729512e 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-29T05:41:19.675Z",
+ "generated_at": "2026-07-29T06:12:36.507Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -92,6 +92,38 @@
"improvement"
]
},
+ {
+ "date": "2026-07-29",
+ "type": "update",
+ "title": "Chat now forges and displays 3D models right in the conversation",
+ "summary": "Ask the chat at three.ws/chat for a 3D model and it generates one with the free Forge lane, streams live progress in place, and then renders the finished model as an interactive viewer inside the thread: orbit and zoom it, play its animations, toggle the skeleton on rigged avatars, download the GLB, or open it in AR. Pasting a link to any .glb file now shows the model the same way, even when the file's host would normally block the browser from reading it. Previously 3D results only appeared inside a boxed-in web page you had to click into.",
+ "link": "/chat",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-07-29",
+ "type": "update",
+ "title": "Coin pages stay up when the market data provider rate-limits us",
+ "summary": "The price chart, profile and exchange listings on a coin page all came from one provider, so whenever it throttled our requests the whole page went down at once, for hours. Each of those now has a live backup: charts fall back to exchange candles for the majors and an on-chain price oracle for every other coin, while the profile and market listings fall back to a second data provider. When a backup is answering, the page says so at the bottom instead of quietly leaving numbers blank, and columns the backup cannot fill are hidden rather than shown as a row of dashes. Two small honesty fixes came with it: a follower count of zero now means \"not tracked\" and is left out rather than stated as zero, and a price change the backup does not actually compute is no longer drawn as a flat 0.00%.",
+ "link": "/coins",
+ "tags": [
+ "fix",
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-07-29",
+ "type": "update",
+ "title": "Concierge demo and the 3D home demo both work again",
+ "summary": "The live widget on the Concierge page failed to start because the page ran its setup before the widget code had finished loading, leaving visitors with a dead demo on the page that sells it. The /demos/3d-home animated avatar demo never rendered its character either: the model uses compressed geometry and the page was loading it without the matching decoder. Both now load, animate, and respond as intended.",
+ "link": "/concierge",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-29",
"type": "update",
@@ -136,6 +168,16 @@
"improvement"
]
},
+ {
+ "date": "2026-07-29",
+ "type": "update",
+ "title": "On-chain agent pages now load their registration details reliably",
+ "summary": "ERC-8004 agent pages read each agent's registration document from wherever its owner published it. Most of those hosts do not permit direct browser access, so a large share of agents showed \"Could not fetch registration JSON\" instead of their name, description, avatar, and skills. Pages now fall back to fetching that document through three.ws, so those agents render in full. The fallback validates every address it connects to and caps the download, so a hostile registration link cannot reach anything private.",
+ "link": "/docs/erc8004",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-29",
"type": "update",
@@ -211,6 +253,17 @@
"infra"
]
},
+ {
+ "date": "2026-07-29",
+ "type": "update",
+ "title": "The agent directory is now readable without JavaScript, and the homepage loads lighter",
+ "summary": "Two things that made the site slower and harder to find. The Discover directory indexes over 150,000 agents but built its entire page in the browser, so search engines, link previews, and anyone on a slow or JavaScript-less connection saw an empty page. The server now sends the first page of agents and the live directory totals with the page itself, exactly matching what the browser then loads. Separately, the homepage was carrying a large duplicate copy of its own styling inline, plus two big scripts that blocked the page from drawing while they parsed. Those moved into files the browser caches once and reuses on every later visit, cutting the homepage document roughly in half.",
+ "link": "/discover",
+ "tags": [
+ "improvement",
+ "infra"
+ ]
+ },
{
"date": "2026-07-29",
"type": "update",
@@ -233,6 +286,16 @@
"improvement"
]
},
+ {
+ "date": "2026-07-29",
+ "type": "update",
+ "title": "The news rail on a coin page no longer hides stories it already has",
+ "summary": "The related-news strip on a coin page decided whether to show anything by asking how many news publishers had just been refreshed, rather than whether it actually had articles in hand. Since the news system also serves recent copies it fetched a little earlier, the rail could be holding eight real stories and still show an error instead. It now shows what it has, and reports a problem only when it genuinely has nothing.",
+ "link": "/coins",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-29",
"type": "update",
@@ -286,6 +349,16 @@
"launch"
]
},
+ {
+ "date": "2026-07-28",
+ "type": "launch",
+ "title": "Fits: the cosmetics economy",
+ "summary": "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 in real settled USDC, and every cosmetic sale as it lands. Includes a free creator-earnings lookup for any Solana wallet, with per-cosmetic and per-coin-world breakdowns.",
+ "link": "/fits",
+ "tags": [
+ "launch"
+ ]
+ },
{
"date": "2026-07-28",
"type": "launch",
@@ -318,6 +391,26 @@
"infra"
]
},
+ {
+ "date": "2026-07-28",
+ "type": "update",
+ "title": "Coin pages stay up when the market-data quota runs out",
+ "summary": "Our market-data provider caps the free tier at 10,000 calls a month. Once that ran out, every request carrying our key was refused for the rest of the billing period, while the very same request without a key was still being answered normally. Coin details, tickers, and exchange data returned errors for hours on 28 July because of it. An exhausted key is now benched for fifteen minutes and the request is immediately retried without it, so pages keep serving. The key comes back into use on its own when the quota resets, with no redeploy and nobody paged.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-07-28",
+ "type": "update",
+ "title": "Consistent formatted text and notifications across the site",
+ "summary": "Formatted text (agent descriptions, chat replies, docs excerpts) was being rendered by a handful of separate implementations that had drifted apart, and each page that needed a confirmation message carried its own copied-in version. Both now come from one shared implementation: text is parsed and sanitised the same way everywhere, so the same content renders identically on every surface, and notifications queue and dismiss consistently instead of stacking or vanishing depending on which page you were on.",
+ "link": null,
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-07-28",
"type": "update",
@@ -500,6 +593,16 @@
"docs"
]
},
+ {
+ "date": "2026-07-27",
+ "type": "update",
+ "title": "Five more languages: Hausa, Armenian, Georgian, Pashto and Sinhala",
+ "summary": "three.ws now ships in 60 languages. The five new locales cover the full site, not a landing page: navigation, the studio, the wardrobe, forged galleries, notifications, and the cookbook. Translations across the existing 55 languages were refreshed at the same time, so pages that gained copy recently are no longer part-English in a translated locale.",
+ "link": null,
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-07-27",
"type": "update",
@@ -533,6 +636,26 @@
"fix"
]
},
+ {
+ "date": "2026-07-27",
+ "type": "update",
+ "title": "Interrupted garment generations now recover on their own",
+ "summary": "When the garment worker scaled down mid-job, the job it was holding became an orphan: the machinery to re-drive it existed but nothing ever triggered it, so the job sat until a watchdog eventually marked it failed. A scheduled sweep now re-drives orphaned jobs every ten minutes, so a generation interrupted by a scale-down finishes instead of dying quietly.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-07-27",
+ "type": "update",
+ "title": "Loading grids and the live terminal now pass the accessibility floor",
+ "summary": "Two things a screen reader or a low-vision visitor hit directly. The loading placeholders on the animation and character libraries announced themselves with a label that assistive technology is required to ignore, so the \"loading\" state was silent; they are now proper status regions that get read aloud. And on the live terminal, each arriving row faded in from fully transparent, which meant text on screen sat below the readable-contrast floor for a quarter second at a time on a feed that never stops. Rows now slide in at full contrast instead of fading.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-27",
"type": "update",
@@ -650,6 +773,16 @@
"improvement"
]
},
+ {
+ "date": "2026-07-27",
+ "type": "update",
+ "title": "Wallet tools work again on older Android browsers",
+ "summary": "A compatibility shim for older Android WebViews was reaching the main app but not the four background workers the site runs off the main thread. The vanity-address grinder calls the exact feature that shim exists to provide, so on Chrome 92 and earlier it failed on launch while the rest of the page looked fine. The shim now ships into the background workers too.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-26",
"type": "launch",
@@ -985,6 +1118,16 @@
"feature"
]
},
+ {
+ "date": "2026-07-25",
+ "type": "update",
+ "title": "Fingerspelled signing reads as one continuous hand, not a slideshow",
+ "summary": "The signing avatar built each letter from its own one-off pose code, so handshapes drifted between letters and a spelled word looked like a sequence of unrelated snapshots. Handshapes now come from a single shared library that both fingerspelling and full lexical signs draw on, so the same letter looks the same everywhere and the transitions between them are continuous. Wrists, thumbs, and finger curls were re-checked against reference photography across the whole alphabet.",
+ "link": null,
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-07-25",
"type": "update",
@@ -21323,16 +21466,6 @@
"launch"
]
},
- {
- "date": "2026-05-29",
- "type": "launch",
- "title": "3D Scanner — Scan Yourself into 3D",
- "summary": "Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser.",
- "link": "/scan",
- "tags": [
- "launch"
- ]
- },
{
"date": "2026-05-29",
"type": "launch",
@@ -21636,16 +21769,6 @@
"launch"
]
},
- {
- "date": "2026-05-25",
- "type": "launch",
- "title": "New Agent",
- "summary": "Create a new agent from scratch — avatar, brain, skills, and on-chain identity.",
- "link": "/agent/new",
- "tags": [
- "launch"
- ]
- },
{
"date": "2026-05-25",
"type": "launch",
diff --git a/public/changelog.xml b/public/changelog.xml
index 7d947c999..85a95765d 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -70,6 +70,30 @@
<category>fix</category>
<description>Every coin category page (layer-1, AI tokens, meme tokens and the rest) is built from one upstream market data provider, because it is the only free source that knows which coins belong to which sector. Whenever that provider throttled us, those pages returned an error and showed nothing at all, while the main coins table stayed up because it has a second source to fall back on. Category pages now fall back to the most recent real data they successfully loaded, clearly marked as of when it was fetched, and switch back to live figures the moment the provider recovers. Nothing is invented: a category we have never loaded still reports the outage honestly rather than showing a made-up table.</description>
</item>
+ <item>
+ <title>Chat now forges and displays 3D models right in the conversation</title>
+ <link>https://three.ws/chat</link>
+ <guid isPermaLink="false">2026-07-29:Chat now forges and displays 3D models right in the conversation</guid>
+ <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Ask the chat at three.ws/chat for a 3D model and it generates one with the free Forge lane, streams live progress in place, and then renders the finished model as an interactive viewer inside the thread: orbit and zoom it, play its animations, toggle the skeleton on rigged avatars, download the GLB, or open it in AR. Pasting a link to any .glb file now shows the model the same way, even when the file's host would normally block the browser from reading it. Previously 3D results only appeared inside a boxed-in web page you had to click into.</description>
+ </item>
+ <item>
+ <title>Coin pages stay up when the market data provider rate-limits us</title>
+ <link>https://three.ws/coins</link>
+ <guid isPermaLink="false">2026-07-29:Coin pages stay up when the market data provider rate-limits us</guid>
+ <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The price chart, profile and exchange listings on a coin page all came from one provider, so whenever it throttled our requests the whole page went down at once, for hours. Each of those now has a live backup: charts fall back to exchange candles for the majors and an on-chain price oracle for every other coin, while the profile and market listings fall back to a second data provider. When a backup is answering, the page says so at the bottom instead of quietly leaving numbers blank, and columns the backup cannot fill are hidden rather than shown as a row of dashes. Two small honesty fixes came with it: a follower count of zero now means &quot;not tracked&quot; and is left out rather than stated as zero, and a price change the backup does not actually compute is no longer drawn as a flat 0.00%.</description>
+ </item>
+ <item>
+ <title>Concierge demo and the 3D home demo both work again</title>
+ <link>https://three.ws/concierge</link>
+ <guid isPermaLink="false">2026-07-29:Concierge demo and the 3D home demo both work again</guid>
+ <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The live widget on the Concierge page failed to start because the page ran its setup before the widget code had finished loading, leaving visitors with a dead demo on the page that sells it. The /demos/3d-home animated avatar demo never rendered its character either: the model uses compressed geometry and the page was loading it without the matching decoder. Both now load, animate, and respond as intended.</description>
+ </item>
<item>
<title>Ethereum name lookups work again</title>
<link>https://three.ws/crypto-api</link>
@@ -102,6 +126,14 @@
<category>fix</category>
<description>The per-category switches in settings let you turn the bell off for a kind of notification, but the bell ignored them and filled up anyway. They work now. One deliberate exception: account and security notices (withdrawals, payment problems, security alerts) always stay in your bell, because that is your record of what happened to your account and losing it silently would be worse than a little noise. You can still turn off their push, email and Telegram. Those always-on switches now show as locked in settings instead of pretending to be adjustable.</description>
</item>
+ <item>
+ <title>On-chain agent pages now load their registration details reliably</title>
+ <link>https://three.ws/docs/erc8004</link>
+ <guid isPermaLink="false">2026-07-29:On-chain agent pages now load their registration details reliably</guid>
+ <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>ERC-8004 agent pages read each agent's registration document from wherever its owner published it. Most of those hosts do not permit direct browser access, so a large share of agents showed &quot;Could not fetch registration JSON&quot; instead of their name, description, avatar, and skills. Pages now fall back to fetching that document through three.ws, so those agents render in full. The fallback validates every address it connects to and caps the download, so a hostile registration link cannot reach anything private.</description>
+ </item>
<item>
<title>Ordinary new coins are no longer mistaken for honeypots</title>
<link>https://three.ws/changelog</link>
@@ -158,6 +190,14 @@
<category>fix</category>
<description>One background job tops up each trading agent wallet to a working balance. Another reclaims idle SOL from platform wallets back to the treasury so the agent economy can pay its network fees. Their thresholds disagreed, so they took turns moving the same funds in opposite directions: in one fifteen-minute window 0.24 SOL made that round trip six times, paying a network fee each leg, and the agents never held a balance long enough to trade. Both jobs now read a single shared policy with one rule, that a reclaim can never take a wallet below the level the top-up will immediately restore. The reclaim also now leaves every active trader enough to cover a complete trade, including the safety check that runs before it.</description>
</item>
+ <item>
+ <title>The agent directory is now readable without JavaScript, and the homepage loads lighter</title>
+ <link>https://three.ws/discover</link>
+ <guid isPermaLink="false">2026-07-29:The agent directory is now readable without JavaScript, and the homepage loads lighter</guid>
+ <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Two things that made the site slower and harder to find. The Discover directory indexes over 150,000 agents but built its entire page in the browser, so search engines, link previews, and anyone on a slow or JavaScript-less connection saw an empty page. The server now sends the first page of agents and the live directory totals with the page itself, exactly matching what the browser then loads. Separately, the homepage was carrying a large duplicate copy of its own styling inline, plus two big scripts that blocked the page from drawing while they parsed. Those moved into files the browser caches once and reuses on every later visit, cutting the homepage document roughly in half.</description>
+ </item>
<item>
<title>The fact checker stops timing out, and reads its sources properly</title>
<link>https://three.ws/fact-check</link>
@@ -174,6 +214,14 @@
<category>fix</category>
<description>The live trade feed connects to a chain of Solana data providers and falls back through them. Some of those providers answer normal requests fine but reject the live-streaming connection outright, and the underlying library retried them forever, flooding the logs and wasting a slot in the fallback chain. The feed now tests each provider once, permanently sets aside the ones that structurally cannot stream, and briefly benches ones that are merely busy, so it lands on a working provider immediately instead of retrying a dead one.</description>
</item>
+ <item>
+ <title>The news rail on a coin page no longer hides stories it already has</title>
+ <link>https://three.ws/coins</link>
+ <guid isPermaLink="false">2026-07-29:The news rail on a coin page no longer hides stories it already has</guid>
+ <pubDate>Wed, 29 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The related-news strip on a coin page decided whether to show anything by asking how many news publishers had just been refreshed, rather than whether it actually had articles in hand. Since the news system also serves recent copies it fetched a little earlier, the rail could be holding eight real stories and still show an error instead. It now shows what it has, and reports a problem only when it genuinely has nothing.</description>
+ </item>
<item>
<title>three.ws can search the live web now, with sources you can check</title>
<link>https://three.ws/docs/api-reference</link>
@@ -214,6 +262,14 @@
<category>launch</category>
<description>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 a clip and share the sound of machines doing business.</description>
</item>
+ <item>
+ <title>Fits: the cosmetics economy</title>
+ <link>https://three.ws/fits</link>
+ <guid isPermaLink="false">2026-07-28:Fits: the cosmetics economy</guid>
+ <pubDate>Tue, 28 Jul 2026 12:00:00 GMT</pubDate>
+ <category>launch</category>
+ <description>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 in real settled USDC, and every cosmetic sale as it lands. Includes a free creator-earnings lookup for any Solana wallet, with per-cosmetic and per-coin-world breakdowns.</description>
+ </item>
<item>
<title>Receipt Vault</title>
<link>https://three.ws/receipts</link>
@@ -238,6 +294,22 @@
<category>fix</category>
<description>Every coin profile page was returning an error. The market-data provider we read prices and coin details from gives us a monthly call allowance, and once it ran out, every request we sent with our key was refused. The awkward part: the exact same request sent without the key was still being answered. We were effectively locking ourselves out. The pages are live again, and the fix is permanent rather than a one-off: when the key gets refused, we now set it aside for a while and retry the same request without it, so the pages keep serving and recover on their own when the allowance resets. We also repaired a 3D model service that was crash-looping because it tried to download a small config file from a public model host on every start and kept getting throttled. That file now ships with our own model storage, so the service starts without depending on anyone else.</description>
</item>
+ <item>
+ <title>Coin pages stay up when the market-data quota runs out</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-28:Coin pages stay up when the market-data quota runs out</guid>
+ <pubDate>Tue, 28 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Our market-data provider caps the free tier at 10,000 calls a month. Once that ran out, every request carrying our key was refused for the rest of the billing period, while the very same request without a key was still being answered normally. Coin details, tickers, and exchange data returned errors for hours on 28 July because of it. An exhausted key is now benched for fifteen minutes and the request is immediately retried without it, so pages keep serving. The key comes back into use on its own when the quota resets, with no redeploy and nobody paged.</description>
+ </item>
+ <item>
+ <title>Consistent formatted text and notifications across the site</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-28:Consistent formatted text and notifications across the site</guid>
+ <pubDate>Tue, 28 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Formatted text (agent descriptions, chat replies, docs excerpts) was being rendered by a handful of separate implementations that had drifted apart, and each page that needed a confirmation message carried its own copied-in version. Both now come from one shared implementation: text is parsed and sanitised the same way everywhere, so the same content renders identically on every surface, and notifications queue and dismiss consistently instead of stacking or vanishing depending on which page you were on.</description>
+ </item>
<item>
<title>Crypto Intel now prices pump.fun coins, and settle failures explain themselves</title>
<link>https://three.ws/changelog</link>
@@ -374,6 +446,14 @@
<category>fix</category>
<description>For a long time our developer documentation, API response examples, and the skill file that AI agents read to embed a 3D avatar all pointed model and image URLs at an address that does not exist: there was never a DNS record behind it. Copy one of those examples and you got a connection failure, and an agent following the embed instructions produced a body URL that could never load. It appeared 181 times across 55 files, including every code sample in the 3D and MCP API references. All of them now point at the asset CDN we actually run, which serves the same files from three.ws itself, allows any site to load them, and caches at the edge for a month. The Spatial MCP reference page moved onto it too, which fixes something subtle: it had been loading its example model from a storage origin that is rate-limited and only answers requests from our own domain, so anyone copying that example to prove the standard is portable was blocked by the very page meant to demonstrate portability. A new check refuses to let a dead asset address into the codebase again, and it also pins the route the working URLs depend on, so the two cannot drift apart.</description>
</item>
+ <item>
+ <title>Five more languages: Hausa, Armenian, Georgian, Pashto and Sinhala</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-27:Five more languages: Hausa, Armenian, Georgian, Pashto and Sinhala</guid>
+ <pubDate>Mon, 27 Jul 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>three.ws now ships in 60 languages. The five new locales cover the full site, not a landing page: navigation, the studio, the wardrobe, forged galleries, notifications, and the cookbook. Translations across the existing 55 languages were refreshed at the same time, so pages that gained copy recently are no longer part-English in a translated locale.</description>
+ </item>
<item>
<title>Garment generation no longer loses jobs when it scales down</title>
<link>https://three.ws/changelog</link>
@@ -398,6 +478,22 @@
<category>improvement</category>
<description>Generated caps could come out with brims jutting past the face, and sneakers could hover away from the feet, because the forge sized those pieces by width alone: a deep-brimmed cap or a photographed pair of shoes standing close together gave the sizing step no useful signal. Caps are now scaled to fit the head on every dimension, and shoes are sized by foot length and placed onto each foot individually. Measured on a walking avatar, the worst-case gap between shoe and foot dropped from 34cm to 3cm, and cap overhang from 21cm to 8cm. Every piece in the catalog is now checked automatically: it must load, match its published fingerprint, and bind correctly onto four different avatar skeletons before it counts as good, with the pieces that failed the new bar replaced. A daily check also watches the live catalog for anything that breaks after the fact.</description>
</item>
+ <item>
+ <title>Interrupted garment generations now recover on their own</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-27:Interrupted garment generations now recover on their own</guid>
+ <pubDate>Mon, 27 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>When the garment worker scaled down mid-job, the job it was holding became an orphan: the machinery to re-drive it existed but nothing ever triggered it, so the job sat until a watchdog eventually marked it failed. A scheduled sweep now re-drives orphaned jobs every ten minutes, so a generation interrupted by a scale-down finishes instead of dying quietly.</description>
+ </item>
+ <item>
+ <title>Loading grids and the live terminal now pass the accessibility floor</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-27:Loading grids and the live terminal now pass the accessibility floor</guid>
+ <pubDate>Mon, 27 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Two things a screen reader or a low-vision visitor hit directly. The loading placeholders on the animation and character libraries announced themselves with a label that assistive technology is required to ignore, so the &quot;loading&quot; state was silent; they are now proper status regions that get read aloud. And on the live terminal, each arriving row faded in from fully transparent, which meant text on screen sat below the readable-contrast floor for a quarter second at a time on a feed that never stops. Rows now slide in at full contrast instead of fading.</description>
+ </item>
<item>
<title>Pages that stayed English no matter which language you picked now translate</title>
<link>https://three.ws/changelog</link>
@@ -486,6 +582,14 @@
<category>fix</category>
<description>A stretch of the site's translated copy was never actually translated. When the translation service was unreachable, the pipeline wrote the English text into each language file as a placeholder, and because the text was technically present, every later run skipped it. Punjabi was the worst case: the language was offered in the picker but read as English from top to bottom. Punjabi is now fully translated, and the same repair is running across the other languages, covering tens of thousands of phrases that had been sitting in English. There is also a new maintenance command that finds this class of gap, so a language can no longer look complete while reading in English.</description>
</item>
+ <item>
+ <title>Wallet tools work again on older Android browsers</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-27:Wallet tools work again on older Android browsers</guid>
+ <pubDate>Mon, 27 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>A compatibility shim for older Android WebViews was reaching the main app but not the four background workers the site runs off the main thread. The vanity-address grinder calls the exact feature that shim exists to provide, so on Chrome 92 and earlier it failed on launch while the rest of the page looked fine. The shim now ships into the background workers too.</description>
+ </item>
<item>
<title>Wardrobe</title>
<link>https://three.ws/wardrobe</link>
@@ -742,6 +846,14 @@
<category>feature</category>
<description>Until now the wardrobe could only recolour or hide the clothes an avatar was generated with. It can now put NEW clothes on: the avatar editor's Wardrobe tab gained a Closet with racks of catalog pieces (tops, bottoms, footwear, outerwear, hair, headwear, glasses, accessories). Click a piece and it binds to your avatar's skeleton and moves with every animation, whatever generator the avatar came from: forge characters, selfie reconstructions and uploaded models all work, because garments are fitted to the skeleton at wear-time instead of being authored for one specific body. The body is masked under whatever you wear so skin never pokes through the cloth, a piece that cannot fit a particular skeleton politely refuses instead of deforming into spaghetti, and every download is integrity-checked against the catalog before it touches your avatar. Saved outfits persist: the downloadable and embedded versions of your avatar come out dressed too.</description>
</item>
+ <item>
+ <title>Fingerspelled signing reads as one continuous hand, not a slideshow</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-25:Fingerspelled signing reads as one continuous hand, not a slideshow</guid>
+ <pubDate>Sat, 25 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>The signing avatar built each letter from its own one-off pose code, so handshapes drifted between letters and a spelled word looked like a sequence of unrelated snapshots. Handshapes now come from a single shared library that both fingerspelling and full lexical signs draw on, so the same letter looks the same everywhere and the transitions between them are continuous. Wrists, thumbs, and finger curls were re-checked against reference photography across the whole alphabet.</description>
+ </item>
<item>
<title>Fixed: saving your avatar's look from the editor</title>
<link>https://three.ws/changelog</link>
@@ -16374,14 +16486,6 @@
<category>launch</category>
<description>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 shockwaves, with a live trade feed and a HUD of price, market cap, holders, and volume.</description>
</item>
- <item>
- <title>3D Scanner — Scan Yourself into 3D</title>
- <link>https://three.ws/scan</link>
- <guid isPermaLink="false">2026-05-29:3D Scanner — Scan Yourself into 3D</guid>
- <pubDate>Fri, 29 May 2026 12:00:00 GMT</pubDate>
- <category>launch</category>
- <description>Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser.</description>
- </item>
<item>
<title>Forever — etch a message into Bitcoin</title>
<link>https://three.ws/forever</link>
@@ -16622,14 +16726,6 @@
<category>launch</category>
<description>Import any GLB or glTF avatar into three.ws and give it an agent brain.</description>
</item>
- <item>
- <title>New Agent</title>
- <link>https://three.ws/agent/new</link>
- <guid isPermaLink="false">2026-05-25:New Agent</guid>
- <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>
- <category>launch</category>
- <description>Create a new agent from scratch — avatar, brain, skills, and on-chain identity.</description>
- </item>
<item>
<title>Playground</title>
<link>https://three.ws/playground</link>
diff --git a/public/features.json b/public/features.json
index ef6ec999a..8ecc0d309 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-29T05:37:48.107Z",
+ "generated_at": "2026-07-29T06:12:36.355Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
@@ -872,16 +872,6 @@
"tags": [],
"showcase": false
},
- {
- "path": "/agent/new",
- "title": "New Agent",
- "description": "Create a new agent from scratch — avatar, brain, skills, and on-chain identity.",
- "added": "2026-05-25",
- "auth": null,
- "indexable": true,
- "tags": [],
- "showcase": false
- },
{
"path": "/create/selfie",
"title": "Selfie to Avatar",
@@ -922,16 +912,6 @@
"tags": [],
"showcase": true
},
- {
- "path": "/scan",
- "title": "3D Scanner — Scan Yourself into 3D",
- "description": "Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser.",
- "added": "2026-05-29",
- "auth": null,
- "indexable": true,
- "tags": [],
- "showcase": false
- },
{
"path": "/dad",
"title": "Make Dad a 3D Avatar",
@@ -1336,6 +1316,16 @@
"tags": [],
"showcase": false
},
+ {
+ "path": "/fits",
+ "title": "Fits: the cosmetics economy",
+ "description": "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 in real settled USDC, and every cosmetic sale as it lands. Includes a free creator-earnings lookup for any Solana wallet, with per-cosmetic and per-coin-world breakdowns.",
+ "added": "2026-07-28",
+ "auth": null,
+ "indexable": true,
+ "tags": [],
+ "showcase": false
+ },
{
"path": "/receipts",
"title": "Receipt Vault",
diff --git a/public/llms-full.txt b/public/llms-full.txt
index 88a238945..2be47689e 100644
--- a/public/llms-full.txt
+++ b/public/llms-full.txt
@@ -533,12 +533,6 @@ URL: https://three.ws/features/deploy
Register your AI agent on Solana via ERC-8004 and Metaplex Core. Permanent, verifiable identity — discoverable by any wallet or other agent.
-### New Agent
-
-URL: https://three.ws/agent/new
-
-Create a new agent from scratch — avatar, brain, skills, and on-chain identity.
-
### Selfie to Avatar
URL: https://three.ws/create/selfie
@@ -563,12 +557,6 @@ URL: https://three.ws/voice
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.
-### 3D Scanner — Scan Yourself into 3D
-
-URL: https://three.ws/scan
-
-Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser.
-
### Make Dad a 3D Avatar
URL: https://three.ws/dad
@@ -811,6 +799,12 @@ URL: https://three.ws/x402-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 window, top-earning endpoints, revenue by network, and a filterable, searchable live feed of every settlement with copy-tx, sound, and CSV export. The mirror of the Money Pulse: what the platform earns, not what agents spend. Every payment is real and explorer-verifiable.
+### Fits: the cosmetics economy
+
+URL: https://three.ws/fits
+
+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 in real settled USDC, and every cosmetic sale as it lands. Includes a free creator-earnings lookup for any Solana wallet, with per-cosmetic and per-coin-world breakdowns.
+
### Receipt Vault
URL: https://three.ws/receipts
diff --git a/public/llms.txt b/public/llms.txt
index 3a30af998..6b5107772 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -97,12 +97,10 @@ Create and customize an agent.
- [Marketplace — Discover and Fork AI Agents](https://three.ws/features/marketplace): Browse hundreds of community-built AI agents with 3D avatars and on-chain identities. Fork any agent, buy paid skills, and ship in minutes.
- [Agent Exchange — AI Agents Paying Each Other](https://three.ws/features/agent-exchange): Watch two AI agents with 3D avatars autonomously negotiate and pay each other for crypto intelligence via x402 micropayments on Solana.
- [Deploy — On-Chain Agent Identity](https://three.ws/features/deploy): Register your AI agent on Solana via ERC-8004 and Metaplex Core. Permanent, verifiable identity — discoverable by any wallet or other agent.
-- [New Agent](https://three.ws/agent/new): Create a new agent from scratch — avatar, brain, skills, and on-chain identity.
- [Selfie to Avatar](https://three.ws/create/selfie): One selfie. About a minute. A rigged 3D avatar that works everywhere.
- [Import an avatar URL](https://three.ws/import/rpm): Import any GLB or glTF avatar into three.ws and give it an agent brain.
- [Claim threews.sol Subdomain](https://three.ws/threews/claim): Claim your own <name>.threews.sol subdomain and get a Brave-resolvable personal showcase page.
- [Voice Lab](https://three.ws/voice): 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.
-- [3D Scanner — Scan Yourself into 3D](https://three.ws/scan): Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser.
- [Make Dad a 3D Avatar](https://three.ws/dad): Turn one photo of your dad into a recognizable, rigged, animated 3D avatar — it idles, walks, and waves — then share a permalink.
- [CA → x402](https://three.ws/ca2x402): 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 USDC, discoverable in the x402 bazaar.
- [Avatar Studio](https://three.ws/avatar-studio): Build a custom 3D avatar from scratch. Choose body type, sculpt face and body, add outfits and accessories. No selfie required.
@@ -152,6 +150,7 @@ On-chain features: pay-per-call, token launches, vanity wallets.
- [Live Trading Theater](https://three.ws/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 avatar performs on a shared stage and a real receipt rises with an explorer link. Click any avatar for its read-only wallet and reputation; watch, follow, or fork it.
- [Money Pulse](https://three.ws/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 beat is a real on-chain event.
- [Endpoint Revenue](https://three.ws/x402-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 window, top-earning endpoints, revenue by network, and a filterable, searchable live feed of every settlement with copy-tx, sound, and CSV export. The mirror of the Money Pulse: what the platform earns, not what agents spend. Every payment is real and explorer-verifiable.
+- [Fits: the cosmetics economy](https://three.ws/fits): 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 in real settled USDC, and every cosmetic sale as it lands. Includes a free creator-earnings lookup for any Solana wallet, with per-cosmetic and per-coin-world breakdowns.
- [Receipt Vault](https://three.ws/receipts): 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 proof-of-purchase receipt issued to that wallet: endpoint, network, settlement transaction with explorer link, and the full signed artifact as JSON, plus CSV export and search. The buyer-side mirror of Endpoint Revenue.
- [Viability](https://three.ws/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 coin-trade flow, cost and realized P&L on closed positions. Real on-chain data only.
- [On-chain Deployments](https://three.ws/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 only, with chain footprint, 3D-avatar and x402 capability stats.
diff --git a/public/locales/en.json b/public/locales/en.json
index 2acbd6e31..0ef9fab6e 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -3565,6 +3565,7 @@
"photoreal_likeness_first_closest_to_how_you": "<span class=\"style-swatch photoreal\" aria-hidden=\"true\"></span> <span> <span class=\"style-title\">Photoreal</span> <span class=\"style-desc\" >Likeness-first. Closest to how you actually look.</span> </span>",
"photos_uploaded": "Photos uploaded",
"prefer_to_use_your_camera_live_the": "Prefer to use your camera live? The <a href=\"/scan\">3D Scanner</a> reconstructs you in real time from a quick scan. Photographing an object instead of yourself? <a href=\"/image-to-3d\">Image to 3D</a> turns any photo into a textured model.",
+ "prefer_your_camera_live_use_camera_below": "Prefer to scan yourself live? Use camera below opens your webcam and reconstructs you from the shot you take. Photographing an object instead of yourself? <a href=\"/image-to-3d\">Image to 3D</a> turns any photo into a textured model.",
"processing_your_face": "Processing your face…",
"remove_sunglasses_masks_or_anything_covering": "Remove sunglasses, masks, or anything covering your face",
"retake": "Retake",
@@ -11615,6 +11616,7 @@
"13wasqa": "Docs",
"13xwrjs": "Strategy Objects",
"147zefs": "Minted 3D Assets",
+ "154lyo8": "Every x402 payment you made, retrievable forever: sign one message and get back your signed proof-of-purchase receipts",
"156n7pd": "Live global market data — top coins, prices, and a rich detail page for every asset",
"15fiadj": "Live health of the data loop: recorder, intel, outcomes, Oracle, learning, trading",
"15fiyz7": "Monetize it",
@@ -11659,6 +11661,7 @@
"1fu7mdq": "Your tracked coins — live market caps and graduation status",
"1gbqgwp": "Guided wizard: name, 3D body, skills, personality → ship it",
"1gnga3n": "Capture & advanced",
+ "1gs041n": "Receipt Vault",
"1h1i4t9": "Browse every registered agent",
"1h5of5s": "Worlds",
"1hcyv4u": "Getting started",
@@ -18244,6 +18247,35 @@
"meta_twitter_description": "A self-organizing trading guild of AI agents: pooled treasury, shared consensus signals, real pro-rata payouts — all auditable on-chain.",
"meta_twitter_title": "Trading Swarms · three.ws"
},
+ "symphony": {
+ "coin_buys_bass": "Coin buys · bass",
+ "connecting": "connecting",
+ "events_in_ledger": "Events in ledger",
+ "every_note_is_one_of_these_real": "every note is one of these real events",
+ "guard_refusals_dissonance": "Guard refusals · dissonance",
+ "hear_everything": "Hear everything",
+ "jackpots_glissando": "Jackpots · glissando",
+ "last_event": "Last event",
+ "live_sound_layer": "<span class=\"sy-live-dot\" aria-hidden=\"true\"></span> Live sound layer",
+ "meta_description": "The Agent Symphony turns the live three.ws agent economy into generative music. Every payment, trade, launch and level-up on the platform plays as a real-time synthesized note. Listen to the machine economy.",
+ "meta_og_description": "The agent economy, played live as music. Every real platform event becomes a synthesized note: payments pluck, whale buys land as bass, new agents chime. Record a clip and share it.",
+ "meta_og_title": "Agent Symphony · three.ws",
+ "meta_title": "Agent Symphony · three.ws",
+ "meta_twitter_description": "The agent economy, played live as music. Every real platform event becomes a synthesized note in real time.",
+ "meta_twitter_title": "Agent Symphony · three.ws",
+ "new_agents_bells": "New agents · bells",
+ "notes_played": "Notes played",
+ "payments_pluck": "Payments · pluck",
+ "play_the_economy": "<span>Play the economy</span>",
+ "record_a_video_clip": "Record a video clip",
+ "soloing_everything_else_is_muted": "Soloing <strong id=\"sy-solo-label\"></strong>. Everything else is muted.",
+ "sound_only_starts_when_you_press_play": "Sound only starts when you press play; nothing autoplays. The same event stream powers the <a href=\"/pulse\">Money Pulse</a> and the site-wide ticker. Each agent keeps a stable motif and stereo position, so regulars become recognizable by ear. Hover any line in the score and hit <strong>solo</strong> to mute the rest of the platform and listen to that participant alone; the link stays shareable. Prefer numbers to notes? The <a href=\"/economy\">economy dashboard</a> has you covered.",
+ "space_plays_and_pauses_click_a_voice": "<kbd>Space</kbd> plays and pauses. Click a voice below to mute it.",
+ "tasks_levels_arpeggio": "Tasks & levels · arpeggio",
+ "the_agent_economy_played_live_as_music": "The agent economy, played live as music. Every real event on three.ws becomes a synthesized note the moment it happens: payments pluck, whale buys land as bass, new agents chime, safety refusals cut through as dissonance. Nothing is prerecorded and nothing is simulated. You are listening to machines doing business.",
+ "the_agent_symphony": "The Agent <em>Symphony</em>",
+ "the_score_as_it_is_written": "The score, as it is written"
+ },
"temporary": {
"ar": "<span class=\"dot\"></span> <span data-label>AR</span>",
"c_camera": "<kbd>C</kbd> camera",
diff --git a/public/locales/localized-pages.json b/public/locales/localized-pages.json
index 7c294722b..3bb5cc882 100644
--- a/public/locales/localized-pages.json
+++ b/public/locales/localized-pages.json
@@ -1,6 +1,6 @@
{
"generated": true,
- "count": 347,
+ "count": 346,
"paths": [
"/",
"/3d",
@@ -292,7 +292,6 @@
"/register",
"/reputation",
"/restyle",
- "/scan",
"/scene",
"/screener",
"/search",
diff --git a/public/nav.css b/public/nav.css
index 79d1adb27..683b5377a 100644
--- a/public/nav.css
+++ b/public/nav.css
@@ -579,8 +579,16 @@
}
/* Skip-to-content link (injected by nav.js as the first focusable element).
Off-screen until it receives keyboard focus, then slides into the top-left so
- keyboard / screen-reader users can jump past the header on any page. */
-.nav-skip {
+ keyboard / screen-reader users can jump past the header on any page.
+
+ `.h-skip-link` is the hand-authored variant: eleven pages (/pricing, /billing,
+ /crypto-api, /payments, /tutorials, …) write the anchor into their own markup
+ with that class instead of relying on nav.js. It had no rule anywhere in the
+ codebase, so on every one of those pages the link rendered as visible,
+ unstyled text above the header. It shares this rule so it behaves — and
+ hides — exactly like the injected one. */
+.nav-skip,
+.h-skip-link {
position: fixed;
top: 10px;
left: 10px;
@@ -595,13 +603,16 @@
box-shadow: 0 8px 28px rgba(0,0,0,0.45);
transition: transform 150ms ease;
}
-.nav-skip:focus { transform: translateY(0); }
-.nav-skip:focus-visible {
+.nav-skip:focus,
+.h-skip-link:focus { transform: translateY(0); }
+.nav-skip:focus-visible,
+.h-skip-link:focus-visible {
outline: 2px solid var(--focus-ring-color, #4f8cff);
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
- .nav-skip { transition: none; }
+ .nav-skip,
+ .h-skip-link { transition: none; }
}
.nav-toggle svg { width: 16px; height: 16px; }
diff --git a/public/nav.js b/public/nav.js
index 3e612efac..51f143b0e 100644
--- a/public/nav.js
+++ b/public/nav.js
@@ -20,14 +20,28 @@
// The switch is a class on <html>, never a re-render: the dropdown/drawer
// wiring binds document-level listeners once, so re-rendering the menus would
// strand them on detached nodes.
+//
+// That class is the live truth; the storage key is only its seed. The two can
+// legitimately disagree — following a link into a gated section reveals the
+// advanced tier for that visit WITHOUT persisting it, and the nav renders after
+// an async fetch, so re-seeding from storage at that point would yank the
+// revealed section back out from under the visitor. Read the class, not the key.
var TIER_KEY = 'tws:tier'; // 'lite' | 'full'
-function tierIsLite() {
+function storedIsLite() {
try {
return localStorage.getItem(TIER_KEY) !== 'full';
} catch (_) {
- return true;
+ return true; // no storage (private mode) → the simple experience
}
}
+function tierIsLite() {
+ return document.documentElement.classList.contains('tws-lite');
+}
+function syncTierControls(lite) {
+ document.querySelectorAll('.nav-tier-toggle').forEach(function (btn) {
+ btn.setAttribute('aria-expanded', String(!lite));
+ });
+}
function applyTier(lite, persist) {
document.documentElement.classList.toggle('tws-lite', lite);
if (persist) {
@@ -37,14 +51,13 @@ function applyTier(lite, persist) {
/* private mode — the tier still applies for this page view */
}
}
- document.querySelectorAll('.nav-tier-toggle').forEach(function (btn) {
- btn.setAttribute('aria-expanded', String(!lite));
- });
+ syncTierControls(lite);
window.dispatchEvent(new CustomEvent('tws:tier-change', { detail: { lite: lite } }));
}
-// Applied before the nav (and any tier-tagged page content) is rendered, so
-// advanced surfaces never flash in and out on load.
-applyTier(tierIsLite(), false);
+// Seeded before the nav (and any tier-tagged page content) is rendered, so
+// advanced surfaces never flash in and out on load. The homepage's inline
+// <head> script seeds the same class even earlier, from the same key.
+applyTier(storedIsLite(), false);
window.twsTier = {
isLite: tierIsLite,
set: function (lite) {
@@ -303,14 +316,11 @@ function initTierToggles(root) {
e.stopPropagation();
applyTier(!tierIsLite(), true);
});
- // Sync the freshly-rendered controls with the tier already applied at boot,
- // and keep them honest when another surface flips the preference.
- applyTier(tierIsLite(), false);
- window.addEventListener('tws:tier-change', (e) => {
- root.querySelectorAll('.nav-tier-toggle').forEach((btn) => {
- btn.setAttribute('aria-expanded', String(!e.detail.lite));
- });
- });
+ // Sync the freshly-rendered controls with the tier that is already live.
+ // Deliberately reads the class, not storage: a deep link into a gated
+ // section reveals the advanced tier without persisting it, and this runs
+ // after that reveal (the nav is fetched asynchronously).
+ syncTierControls(tierIsLite());
}
// ── Menu rendering ──────────────────────────────────────────────────────────
@@ -366,7 +376,7 @@ function renderMenuItem(item) {
? ` <span class="nav-pill-sm${tone}"${i18nAttr(item.badge)}>${escHtml(item.badge)}</span>`
: '';
return (
- `<a class="nav-mi" href="${escHtml(item.href)}" role="menuitem"${tierAttr(item)}${attrString(item.attrs)}>` +
+ `<a class="nav-mi" href="${escHtml(item.href)}"${tierAttr(item)}${attrString(item.attrs)}>` +
`<span class="nav-mi-t"><span${i18nAttr(item.title)}>${escHtml(item.title)}</span>${badge}</span>` +
`<span class="nav-mi-d"${i18nAttr(item.desc)}>${escHtml(item.desc)}</span></a>`
);
@@ -416,14 +426,22 @@ function renderGroup(group) {
` <span class="nav-tier-n">+${hidden}</span></span>` +
`<span class="nav-tier-less"${i18nAttr('Show the simple menu')}>Show the simple menu</span></button>`
: '';
- // A stable, unique id per group so the trigger can reference its menu via
+ // A stable, unique id per group so the trigger can reference its panel via
// aria-controls (label slug is unique within the nav data).
const popId = `nav-pop-${String(group.label).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '')}`;
+ // Disclosure navigation, NOT an ARIA menu. `role="menu"` requires every child
+ // to be a menuitem or a group of them, and these panels legitimately hold a
+ // descriptive note, column headings, and a "Show everything" button — so the
+ // menu role failed aria-required-children on all 13 top pages that render the
+ // nav. Site navigation is the disclosure pattern's exact use case: a button
+ // carrying aria-expanded/aria-controls over a panel of ordinary links. The
+ // arrow-key handling below is bound to the anchors themselves, not to the
+ // roles, so keyboard behaviour is unchanged by dropping them.
return (
`<div class="nav-grp"${tierAttr(group)}>` +
- `<button type="button" class="nav-trigger" aria-haspopup="menu" aria-expanded="false" aria-controls="${popId}">` +
+ `<button type="button" class="nav-trigger" aria-expanded="false" aria-controls="${popId}">` +
`<span${i18nAttr(group.label)}>${escHtml(group.label)}</span>${badge}<span class="nav-caret" aria-hidden="true">▾</span></button>` +
- `<div class="${popClass}" id="${popId}" role="menu" aria-label="${escHtml(group.label)}">${note}${body}${tierFoot}</div>` +
+ `<div class="${popClass}" id="${popId}" role="group" aria-label="${escHtml(group.label)}">${note}${body}${tierFoot}</div>` +
`</div>`
);
}
@@ -572,9 +590,11 @@ function initDropdowns(root) {
}
});
- // WAI-ARIA menu-button pattern: ArrowDown/ArrowUp on the trigger open the
- // menu and land focus on the first / last item, so a keyboard user can dive
- // straight into the dropdown without first activating then re-reaching it.
+ // ArrowDown/ArrowUp on the trigger open the panel and land focus on the
+ // first / last link, so a keyboard user can dive straight into the dropdown
+ // without first activating it and then re-reaching it. Optional in the
+ // disclosure pattern, and worth keeping: it is what makes a 20-link mega
+ // menu navigable without twenty Tab presses.
trigger.addEventListener('keydown', (e) => {
if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return;
const items = Array.prototype.slice.call(
diff --git a/public/pricing.css b/public/pricing.css
index 3d7ac05bc..b466fc518 100644
--- a/public/pricing.css
+++ b/public/pricing.css
@@ -1,5 +1,40 @@
/* ── Pricing page ─────────────────────────────────────────────────────────── */
+/* Theme channels.
+ This page was authored dark-only: every ink, surface tint and hairline was a
+ literal white, so under [data-theme='light'] the page canvas flipped to white
+ (via /tokens.css) while the text stayed white and the hero became invisible.
+ Rather than fork ~160 declarations, the white channel is a variable: each
+ rule keeps its own alpha (which is what carries the emphasis hierarchy) and
+ only the channel flips. Dark resolves to the exact values authored here, so
+ the primary theme is unchanged by construction.
+ --pr-fg ink + surface tint channel (white on dark, --ink #1d212b on light)
+ --pr-bg the colour that sits ON a solid --pr-fg fill (inverted CTAs) */
+:root {
+ --pr-fg: 255, 255, 255;
+ --pr-bg: 0, 0, 0;
+ --pr-panel: #0d0d0f;
+ --pr-panel-ink: #eee;
+ /* Card surface ramp (base → raised → highest). */
+ --pr-card: var(--pr-card);
+ --pr-card-2: var(--pr-card-2);
+ --pr-card-3: var(--pr-card-3);
+ --pr-card-4: var(--pr-card-4);
+ --pr-card-5: var(--pr-card-5);
+}
+:root[data-theme='light'] {
+ --pr-fg: 29, 33, 43;
+ --pr-bg: 255, 255, 255;
+ --pr-panel: #ffffff;
+ --pr-panel-ink: #1d212b;
+ --pr-card: #ffffff;
+ --pr-card-2: #f7f8fa;
+ --pr-card-3: #f3f4f6;
+ --pr-card-4: #f5f6f8;
+ --pr-card-5: #f3f4f6;
+}
+
+
.pricing-hero {
max-width: 1200px;
margin: 0 auto;
@@ -16,7 +51,7 @@
font-weight: 600;
letter-spacing: 0.17em;
text-transform: uppercase;
- color: rgba(255, 255, 255, 0.55);
+ color: rgba(var(--pr-fg), 0.55);
margin-bottom: 18px;
}
@@ -24,8 +59,8 @@
width: 7px;
height: 7px;
border-radius: 50%;
- background: #fff;
- box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
+ background: rgb(var(--pr-fg));
+ box-shadow: 0 0 10px rgba(var(--pr-fg), 0.6);
}
.pricing-hero h1 {
@@ -35,16 +70,16 @@
letter-spacing: -0.035em;
line-height: 1.05;
margin: 0 0 18px;
- color: #fff;
+ color: rgb(var(--pr-fg));
}
.pricing-hero h1 em {
font-style: normal;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
}
.pricing-hero .lead {
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
font-size: 17px;
max-width: 58ch;
margin: 0 auto 44px;
@@ -60,7 +95,7 @@
margin-bottom: 52px;
font-size: 14px;
font-weight: 500;
- color: rgba(255, 255, 255, 0.5);
+ color: rgba(var(--pr-fg), 0.5);
}
.billing-toggle span {
@@ -69,7 +104,7 @@
}
.billing-toggle span.is-active {
- color: #fff;
+ color: rgb(var(--pr-fg));
}
.billing-toggle .toggle-track {
@@ -77,14 +112,14 @@
width: 46px;
height: 24px;
border-radius: 999px;
- background: rgba(255, 255, 255, 0.1);
- border: 1px solid rgba(255, 255, 255, 0.12);
+ background: rgba(var(--pr-fg), 0.1);
+ border: 1px solid rgba(var(--pr-fg), 0.12);
cursor: pointer;
transition: background 0.2s, border-color 0.2s;
}
.billing-toggle .toggle-track:hover {
- border-color: rgba(255, 255, 255, 0.25);
+ border-color: rgba(var(--pr-fg), 0.25);
}
.billing-toggle .toggle-thumb {
@@ -94,7 +129,7 @@
width: 18px;
height: 18px;
border-radius: 50%;
- background: #fff;
+ background: rgb(var(--pr-fg));
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@@ -104,7 +139,7 @@
}
.billing-toggle.annual .toggle-track {
- background: rgba(255, 255, 255, 0.15);
+ background: rgba(var(--pr-fg), 0.15);
}
.billing-save {
@@ -128,14 +163,14 @@
max-width: 1100px;
margin: 0 auto;
padding: 0 24px;
- background: rgba(255, 255, 255, 0.06);
- border: 1px solid rgba(255, 255, 255, 0.06);
+ background: rgba(var(--pr-fg), 0.06);
+ border: 1px solid rgba(var(--pr-fg), 0.06);
border-radius: 18px;
overflow: hidden;
}
.pricing-tier-card {
- background: rgba(10, 10, 10, 0.95);
+ background: var(--pr-card);
padding: 44px 36px;
display: flex;
flex-direction: column;
@@ -144,12 +179,12 @@
}
.pricing-tier-card:hover {
- background: rgba(18, 18, 18, 0.95);
+ background: var(--pr-card-2);
}
.pricing-tier-card.featured {
- background: rgba(18, 18, 18, 0.98);
- box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
+ background: var(--pr-card-3);
+ box-shadow: inset 0 0 0 1px rgba(var(--pr-fg), 0.15);
}
.pricing-tier-card.featured:hover {
@@ -164,8 +199,8 @@
font-size: 10px;
letter-spacing: 0.14em;
text-transform: uppercase;
- background: #fff;
- color: #000;
+ background: rgb(var(--pr-fg));
+ color: rgb(var(--pr-bg));
padding: 4px 10px;
border-radius: 999px;
font-weight: 700;
@@ -176,7 +211,7 @@
font-size: 11px;
letter-spacing: 0.18em;
text-transform: uppercase;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
margin-bottom: 14px;
font-weight: 600;
}
@@ -186,7 +221,7 @@
font-size: 48px;
font-weight: 700;
letter-spacing: -0.03em;
- color: #fff;
+ color: rgb(var(--pr-fg));
line-height: 1;
margin-bottom: 6px;
}
@@ -194,13 +229,13 @@
.pricing-amount sub {
font-size: 16px;
font-weight: 400;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
letter-spacing: 0;
}
.pricing-cycle-info {
font-size: 13px;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
margin-bottom: 32px;
min-height: 20px;
}
@@ -220,7 +255,7 @@
align-items: flex-start;
gap: 10px;
font-size: 14px;
- color: rgba(255, 255, 255, 0.7);
+ color: rgba(var(--pr-fg), 0.7);
line-height: 1.45;
}
@@ -230,12 +265,12 @@
height: 6px;
margin-top: 7px;
border-radius: 50%;
- background: rgba(255, 255, 255, 0.35);
+ background: rgba(var(--pr-fg), 0.35);
}
.pricing-tier-card.featured .pricing-features li::before {
- background: #fff;
- box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
+ background: rgb(var(--pr-fg));
+ box-shadow: 0 0 6px rgba(var(--pr-fg), 0.4);
}
.pricing-cta {
@@ -250,33 +285,33 @@
font-weight: 600;
text-decoration: none;
cursor: pointer;
- border: 1px solid rgba(255, 255, 255, 0.1);
- background: rgba(255, 255, 255, 0.04);
- color: #fff;
+ border: 1px solid rgba(var(--pr-fg), 0.1);
+ background: rgba(var(--pr-fg), 0.04);
+ color: rgb(var(--pr-fg));
transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.pricing-cta:hover {
- background: rgba(255, 255, 255, 0.08);
- border-color: rgba(255, 255, 255, 0.2);
+ background: rgba(var(--pr-fg), 0.08);
+ border-color: rgba(var(--pr-fg), 0.2);
transform: translateY(-1px);
}
.pricing-cta.primary {
- background: #fff;
- color: #000;
+ background: rgb(var(--pr-fg));
+ color: rgb(var(--pr-bg));
border-color: transparent;
box-shadow:
- 0 1px 0 rgba(255, 255, 255, 0.3) inset,
- 0 6px 20px -8px rgba(255, 255, 255, 0.15);
+ 0 1px 0 rgba(var(--pr-fg), 0.3) inset,
+ 0 6px 20px -8px rgba(var(--pr-fg), 0.15);
}
.pricing-cta.primary:hover {
background: #f0f0f0;
transform: translateY(-1px);
box-shadow:
- 0 1px 0 rgba(255, 255, 255, 0.4) inset,
- 0 10px 28px -8px rgba(255, 255, 255, 0.2);
+ 0 1px 0 rgba(var(--pr-fg), 0.4) inset,
+ 0 10px 28px -8px rgba(var(--pr-fg), 0.2);
}
/* ── 3D Avatar overlay ─────────────────────────────────────────────────── */
@@ -303,7 +338,7 @@
font-size: clamp(26px, 3.5vw, 38px);
font-weight: 700;
letter-spacing: -0.025em;
- color: #fff;
+ color: rgb(var(--pr-fg));
text-align: center;
margin: 0 0 48px;
}
@@ -320,40 +355,40 @@
font-family: var(--font-display, 'Space Grotesk', 'Inter', sans-serif);
font-size: 14px;
font-weight: 600;
- color: rgba(255, 255, 255, 0.5);
+ color: rgba(var(--pr-fg), 0.5);
letter-spacing: 0.06em;
text-transform: uppercase;
- border-bottom: 1px solid rgba(255, 255, 255, 0.08);
+ border-bottom: 1px solid rgba(var(--pr-fg), 0.08);
}
.comparison-table thead th:first-child {
text-align: left;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
font-weight: 500;
text-transform: none;
letter-spacing: 0;
}
.comparison-table thead th.featured-col {
- color: #fff;
+ color: rgb(var(--pr-fg));
}
.comparison-table tbody td {
padding: 14px 20px;
- border-bottom: 1px solid rgba(255, 255, 255, 0.04);
- color: rgba(255, 255, 255, 0.55);
+ border-bottom: 1px solid rgba(var(--pr-fg), 0.04);
+ color: rgba(var(--pr-fg), 0.55);
text-align: center;
vertical-align: middle;
}
.comparison-table tbody td:first-child {
text-align: left;
- color: rgba(255, 255, 255, 0.7);
+ color: rgba(var(--pr-fg), 0.7);
font-weight: 500;
}
.comparison-table tbody tr:hover td {
- background: rgba(255, 255, 255, 0.02);
+ background: rgba(var(--pr-fg), 0.02);
}
.comparison-table .section-row td {
@@ -363,8 +398,8 @@
font-weight: 600;
letter-spacing: 0.14em;
text-transform: uppercase;
- color: rgba(255, 255, 255, 0.6);
- border-bottom: 1px solid rgba(255, 255, 255, 0.08);
+ color: rgba(var(--pr-fg), 0.6);
+ border-bottom: 1px solid rgba(var(--pr-fg), 0.08);
}
.comparison-table .check {
@@ -372,7 +407,7 @@
width: 18px;
height: 18px;
border-radius: 50%;
- background: rgba(255, 255, 255, 0.06);
+ background: rgba(var(--pr-fg), 0.06);
position: relative;
}
@@ -383,26 +418,26 @@
left: 6px;
width: 5px;
height: 8px;
- border: solid rgba(255, 255, 255, 0.5);
+ border: solid rgba(var(--pr-fg), 0.5);
border-width: 0 1.5px 1.5px 0;
transform: rotate(45deg);
}
.comparison-table .check.yes::after {
- border-color: #fff;
+ border-color: rgb(var(--pr-fg));
}
.comparison-table .check.yes {
- background: rgba(255, 255, 255, 0.12);
+ background: rgba(var(--pr-fg), 0.12);
}
.comparison-table .val {
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
font-weight: 500;
}
.comparison-table td.featured-col {
- background: rgba(255, 255, 255, 0.02);
+ background: rgba(var(--pr-fg), 0.02);
}
/* ── FAQ ───────────────────────────────────────────────────────────────── */
@@ -418,24 +453,24 @@
font-size: clamp(26px, 3.5vw, 38px);
font-weight: 700;
letter-spacing: -0.025em;
- color: #fff;
+ color: rgb(var(--pr-fg));
text-align: center;
margin: 0 0 48px;
}
.pricing-faq details {
padding: 18px 0;
- border-bottom: 1px solid rgba(255, 255, 255, 0.06);
+ border-bottom: 1px solid rgba(var(--pr-fg), 0.06);
}
.pricing-faq details:first-of-type {
- border-top: 1px solid rgba(255, 255, 255, 0.06);
+ border-top: 1px solid rgba(var(--pr-fg), 0.06);
}
.pricing-faq summary {
cursor: pointer;
font-weight: 500;
- color: rgba(255, 255, 255, 0.85);
+ color: rgba(var(--pr-fg), 0.85);
font-size: 15px;
list-style: none;
display: flex;
@@ -450,7 +485,7 @@
}
.pricing-faq summary:hover {
- color: #fff;
+ color: rgb(var(--pr-fg));
}
.pricing-faq summary::after {
@@ -462,8 +497,8 @@
align-items: center;
justify-content: center;
border-radius: 50%;
- background: rgba(255, 255, 255, 0.06);
- color: rgba(255, 255, 255, 0.6);
+ background: rgba(var(--pr-fg), 0.06);
+ color: rgba(var(--pr-fg), 0.6);
font-size: 16px;
font-weight: 400;
transition: background 0.15s, transform 0.2s;
@@ -472,11 +507,11 @@
.pricing-faq details[open] summary::after {
content: '\2212';
transform: rotate(180deg);
- background: rgba(255, 255, 255, 0.1);
+ background: rgba(var(--pr-fg), 0.1);
}
.pricing-faq details p {
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
margin: 14px 0 0;
line-height: 1.65;
font-size: 14.5px;
@@ -494,9 +529,9 @@
.pricing-bottom-cta .cta-card {
padding: 64px 48px;
- border: 1px solid rgba(255, 255, 255, 0.08);
+ border: 1px solid rgba(var(--pr-fg), 0.08);
border-radius: 18px;
- background: rgba(255, 255, 255, 0.02);
+ background: rgba(var(--pr-fg), 0.02);
}
.pricing-bottom-cta .cta-card h2 {
@@ -504,13 +539,13 @@
font-size: clamp(24px, 3vw, 36px);
font-weight: 700;
letter-spacing: -0.025em;
- color: #fff;
+ color: rgb(var(--pr-fg));
margin: 0 0 14px;
line-height: 1.15;
}
.pricing-bottom-cta .cta-card p {
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
font-size: 16px;
margin: 0 0 32px;
}
@@ -530,15 +565,15 @@
gap: 16px;
padding: 14px 20px;
margin: 16px 0;
- border: 1px solid rgba(255, 255, 255, 0.08);
+ border: 1px solid rgba(var(--pr-fg), 0.08);
border-radius: 12px;
- background: rgba(255, 255, 255, 0.02);
+ background: rgba(var(--pr-fg), 0.02);
transition: background 0.15s, border-color 0.15s;
}
.upgrade-banner:hover {
- background: rgba(255, 255, 255, 0.04);
- border-color: rgba(255, 255, 255, 0.12);
+ background: rgba(var(--pr-fg), 0.04);
+ border-color: rgba(var(--pr-fg), 0.12);
}
.upgrade-banner-icon {
@@ -546,7 +581,7 @@
width: 36px;
height: 36px;
border-radius: 10px;
- background: rgba(255, 255, 255, 0.06);
+ background: rgba(var(--pr-fg), 0.06);
display: flex;
align-items: center;
justify-content: center;
@@ -555,7 +590,7 @@
.upgrade-banner-icon svg {
width: 18px;
height: 18px;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
}
.upgrade-banner-text {
@@ -566,13 +601,13 @@
.upgrade-banner-title {
font-size: 13px;
font-weight: 600;
- color: #fff;
+ color: rgb(var(--pr-fg));
margin-bottom: 2px;
}
.upgrade-banner-desc {
font-size: 12px;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
line-height: 1.4;
}
@@ -580,9 +615,9 @@
flex-shrink: 0;
padding: 8px 16px;
border-radius: 8px;
- background: rgba(255, 255, 255, 0.08);
- border: 1px solid rgba(255, 255, 255, 0.1);
- color: #fff;
+ background: rgba(var(--pr-fg), 0.08);
+ border: 1px solid rgba(var(--pr-fg), 0.1);
+ color: rgb(var(--pr-fg));
font-size: 12px;
font-weight: 600;
text-decoration: none;
@@ -591,8 +626,8 @@
}
.upgrade-banner-btn:hover {
- background: rgba(255, 255, 255, 0.12);
- border-color: rgba(255, 255, 255, 0.2);
+ background: rgba(var(--pr-fg), 0.12);
+ border-color: rgba(var(--pr-fg), 0.2);
}
/* ── Compact pricing card (embeddable section for other pages) ─────── */
@@ -608,7 +643,7 @@
font-size: 11px;
letter-spacing: 0.16em;
text-transform: uppercase;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
margin-bottom: 14px;
text-align: center;
}
@@ -618,13 +653,13 @@
font-size: clamp(26px, 3.5vw, 40px);
font-weight: 700;
letter-spacing: -0.03em;
- color: #fff;
+ color: rgb(var(--pr-fg));
text-align: center;
margin: 0 0 12px;
}
.pricing-embed-section .section-lead {
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
font-size: 16px;
text-align: center;
max-width: 52ch;
@@ -635,14 +670,14 @@
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1px;
- background: rgba(255, 255, 255, 0.06);
- border: 1px solid rgba(255, 255, 255, 0.06);
+ background: rgba(var(--pr-fg), 0.06);
+ border: 1px solid rgba(var(--pr-fg), 0.06);
border-radius: 16px;
overflow: hidden;
}
.pricing-embed-card {
- background: rgba(10, 10, 10, 0.95);
+ background: var(--pr-card);
padding: 32px 28px;
display: flex;
flex-direction: column;
@@ -651,12 +686,12 @@
}
.pricing-embed-card:hover {
- background: rgba(18, 18, 18, 0.95);
+ background: var(--pr-card-2);
}
.pricing-embed-card.featured {
- background: rgba(18, 18, 18, 0.98);
- box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
+ background: var(--pr-card-3);
+ box-shadow: inset 0 0 0 1px rgba(var(--pr-fg), 0.12);
}
.pricing-embed-card .embed-tier-name {
@@ -664,7 +699,7 @@
font-size: 10px;
letter-spacing: 0.16em;
text-transform: uppercase;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
margin-bottom: 10px;
font-weight: 600;
}
@@ -674,7 +709,7 @@
font-size: 32px;
font-weight: 700;
letter-spacing: -0.03em;
- color: #fff;
+ color: rgb(var(--pr-fg));
line-height: 1;
margin-bottom: 4px;
}
@@ -682,12 +717,12 @@
.pricing-embed-card .embed-price sub {
font-size: 14px;
font-weight: 400;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
}
.pricing-embed-card .embed-cycle {
font-size: 12px;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
margin-bottom: 20px;
}
@@ -706,13 +741,13 @@
align-items: flex-start;
gap: 8px;
font-size: 13px;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
line-height: 1.4;
}
.pricing-embed-card .embed-feats li::before {
content: '✓';
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
font-weight: 700;
font-size: 11px;
flex-shrink: 0;
@@ -720,7 +755,7 @@
}
.pricing-embed-card.featured .embed-feats li::before {
- color: #fff;
+ color: rgb(var(--pr-fg));
}
.pricing-embed-card .embed-popular {
@@ -731,8 +766,8 @@
font-weight: 700;
letter-spacing: 0.1em;
text-transform: uppercase;
- background: #fff;
- color: #000;
+ background: rgb(var(--pr-fg));
+ color: rgb(var(--pr-bg));
padding: 3px 8px;
border-radius: 999px;
}
@@ -747,7 +782,7 @@
display: inline-flex;
align-items: center;
gap: 6px;
- color: rgba(255, 255, 255, 0.5);
+ color: rgba(var(--pr-fg), 0.5);
text-decoration: none;
font-size: 14px;
font-weight: 500;
@@ -755,7 +790,7 @@
}
.pricing-embed-cta a:hover {
- color: #fff;
+ color: rgb(var(--pr-fg));
}
.pricing-embed-cta a .arrow {
@@ -780,11 +815,11 @@
}
/* Billing toggle — keyboard ring + press feedback */
-.billing-toggle span:hover { color: rgba(255, 255, 255, 0.78); }
-.billing-toggle span.is-active:hover { color: #fff; }
-.billing-toggle .toggle-track:active { background: rgba(255, 255, 255, 0.18); }
+.billing-toggle span:hover { color: rgba(var(--pr-fg), 0.78); }
+.billing-toggle span.is-active:hover { color: rgb(var(--pr-fg)); }
+.billing-toggle .toggle-track:active { background: rgba(var(--pr-fg), 0.18); }
.billing-toggle .toggle-track:focus-visible {
- outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);
+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, rgb(var(--pr-fg)));
outline-offset: var(--focus-ring-offset, 2px);
}
@@ -806,11 +841,11 @@
.pricing-cta:focus-visible,
.upgrade-banner-btn:focus-visible,
.pricing-embed-cta a:focus-visible {
- outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);
+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, rgb(var(--pr-fg)));
outline-offset: var(--focus-ring-offset, 2px);
}
-.upgrade-banner-btn:active { background: rgba(255, 255, 255, 0.16); }
-.pricing-embed-cta a:active { color: rgba(255, 255, 255, 0.78); }
+.upgrade-banner-btn:active { background: rgba(var(--pr-fg), 0.16); }
+.pricing-embed-cta a:active { color: rgba(var(--pr-fg), 0.78); }
/* FAQ — answers ease in instead of popping; summary gets ring + press */
.pricing-faq details[open] p {
@@ -821,11 +856,11 @@
to { opacity: 1; transform: translateY(0); }
}
.pricing-faq summary:focus-visible {
- outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);
+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, rgb(var(--pr-fg)));
outline-offset: var(--focus-ring-offset, 2px);
border-radius: var(--radius-sm, 6px);
}
-.pricing-faq summary:active::after { background: rgba(255, 255, 255, 0.14); }
+.pricing-faq summary:active::after { background: rgba(var(--pr-fg), 0.14); }
/* Below-the-fold sections reveal on scroll (IntersectionObserver adds
.is-revealed). Transform/opacity only; the script reveals everything
@@ -947,7 +982,7 @@
font-size: clamp(26px, 3.5vw, 38px);
font-weight: 700;
letter-spacing: -0.025em;
- color: #fff;
+ color: rgb(var(--pr-fg));
text-align: center;
margin: 0 0 12px;
}
@@ -958,20 +993,20 @@
text-align: center;
font-size: 15px;
line-height: 1.6;
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
}
.payg-lead a,
.payg-foot a {
- color: #fff;
+ color: rgb(var(--pr-fg));
text-decoration: none;
- border-bottom: 1px solid rgba(255, 255, 255, 0.3);
+ border-bottom: 1px solid rgba(var(--pr-fg), 0.3);
transition: border-color 0.15s;
}
.payg-lead a:hover,
.payg-foot a:hover {
- border-bottom-color: #fff;
+ border-bottom-color: rgb(var(--pr-fg));
}
.payg-grid {
@@ -981,8 +1016,8 @@
}
.payg-card {
- background: rgba(10, 10, 10, 0.95);
- border: 1px solid rgba(255, 255, 255, 0.08);
+ background: var(--pr-card);
+ border: 1px solid rgba(var(--pr-fg), 0.08);
border-radius: 14px;
padding: 22px 22px 20px;
display: flex;
@@ -992,14 +1027,14 @@
}
.payg-card:hover {
- border-color: rgba(255, 255, 255, 0.2);
- background: rgba(16, 16, 16, 0.97);
+ border-color: rgba(var(--pr-fg), 0.2);
+ background: var(--pr-card-4);
transform: translateY(-2px);
}
.payg-card.is-free {
- background: rgba(18, 18, 18, 0.98);
- box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
+ background: var(--pr-card-3);
+ box-shadow: inset 0 0 0 1px rgba(var(--pr-fg), 0.14);
}
/* ── Holder discount banner + personalized "your price" ──────────────────── */
@@ -1013,14 +1048,14 @@
gap: 12px;
padding: 14px 18px;
border-radius: 14px;
- border: 1px solid rgba(255, 255, 255, 0.1);
- background: rgba(14, 14, 14, 0.92);
+ border: 1px solid rgba(var(--pr-fg), 0.1);
+ background: var(--pr-card-5);
font-size: 13.5px;
- color: rgba(255, 255, 255, 0.78);
+ color: rgba(var(--pr-fg), 0.78);
}
.payg-holder-card.is-active {
border-color: color-mix(in srgb, var(--accent, #7c5cff) 55%, transparent);
- background: color-mix(in srgb, var(--accent, #7c5cff) 12%, rgba(14, 14, 14, 0.92));
+ background: color-mix(in srgb, var(--accent, #7c5cff) 12%, var(--pr-card-5));
}
.payg-holder-badge {
flex: 0 0 auto;
@@ -1031,7 +1066,7 @@
text-transform: uppercase;
padding: 4px 10px;
border-radius: 999px;
- color: #fff;
+ color: rgb(var(--pr-fg));
background: var(--accent, #7c5cff);
}
.payg-holder-msg {
@@ -1039,7 +1074,7 @@
line-height: 1.45;
}
.payg-holder-msg strong {
- color: rgba(255, 255, 255, 0.95);
+ color: rgba(var(--pr-fg), 0.95);
}
.payg-holder-cta {
flex: 0 0 auto;
@@ -1053,14 +1088,14 @@
opacity: 0.8;
}
.payg-card.is-yourprice {
- border-color: color-mix(in srgb, var(--accent, #7c5cff) 45%, rgba(255, 255, 255, 0.08));
+ border-color: color-mix(in srgb, var(--accent, #7c5cff) 45%, rgba(var(--pr-fg), 0.08));
}
.payg-badge.is-discount {
- color: #fff;
+ color: rgb(var(--pr-fg));
background: var(--accent, #7c5cff);
}
.payg-was {
- color: rgba(255, 255, 255, 0.4);
+ color: rgba(var(--pr-fg), 0.4);
font-weight: 400;
margin-right: 6px;
text-decoration-thickness: 1px;
@@ -1076,7 +1111,7 @@
.payg-card-label {
font-size: 13px;
font-weight: 600;
- color: rgba(255, 255, 255, 0.85);
+ color: rgba(var(--pr-fg), 0.85);
line-height: 1.35;
}
@@ -1087,8 +1122,8 @@
letter-spacing: 0.12em;
text-transform: uppercase;
font-weight: 700;
- color: #000;
- background: #fff;
+ color: rgb(var(--pr-bg));
+ background: rgb(var(--pr-fg));
padding: 3px 8px;
border-radius: 999px;
}
@@ -1105,35 +1140,35 @@
font-size: 30px;
font-weight: 700;
letter-spacing: -0.02em;
- color: #fff;
+ color: rgb(var(--pr-fg));
line-height: 1;
}
.payg-card-price .unit {
font-size: 13px;
- color: rgba(255, 255, 255, 0.5);
+ color: rgba(var(--pr-fg), 0.5);
}
.payg-card-settle {
font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
font-size: 11px;
letter-spacing: 0.04em;
- color: rgba(255, 255, 255, 0.45);
+ color: rgba(var(--pr-fg), 0.45);
}
.payg-card-settle strong {
- color: rgba(255, 255, 255, 0.75);
+ color: rgba(var(--pr-fg), 0.75);
font-weight: 600;
}
.payg-card-note {
font-size: 12.5px;
line-height: 1.5;
- color: rgba(255, 255, 255, 0.55);
+ color: rgba(var(--pr-fg), 0.55);
}
.payg-card-note a {
- color: #fff;
+ color: rgb(var(--pr-fg));
text-decoration: underline;
}
@@ -1149,21 +1184,21 @@
font-weight: 600;
text-decoration: none;
cursor: pointer;
- border: 1px solid rgba(255, 255, 255, 0.12);
- background: rgba(255, 255, 255, 0.05);
- color: #fff;
+ border: 1px solid rgba(var(--pr-fg), 0.12);
+ background: rgba(var(--pr-fg), 0.05);
+ color: rgb(var(--pr-fg));
transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.payg-card.is-free .payg-card-cta {
- background: #fff;
- color: #000;
+ background: rgb(var(--pr-fg));
+ color: rgb(var(--pr-bg));
border-color: transparent;
}
.payg-card-cta:hover {
- background: rgba(255, 255, 255, 0.1);
- border-color: rgba(255, 255, 255, 0.25);
+ background: rgba(var(--pr-fg), 0.1);
+ border-color: rgba(var(--pr-fg), 0.25);
transform: translateY(-1px);
}
@@ -1172,7 +1207,7 @@
}
.payg-card-cta:focus-visible {
- outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);
+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, rgb(var(--pr-fg)));
outline-offset: var(--focus-ring-offset, 2px);
}
@@ -1182,13 +1217,13 @@
text-align: center;
font-size: 13px;
line-height: 1.6;
- color: rgba(255, 255, 255, 0.5);
+ color: rgba(var(--pr-fg), 0.5);
}
.payg-foot code {
font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
font-size: 12px;
- color: rgba(255, 255, 255, 0.7);
+ color: rgba(var(--pr-fg), 0.7);
}
/* Loading skeleton — shimmer until the live catalog arrives. */
@@ -1200,9 +1235,9 @@
border-radius: 6px;
background: linear-gradient(
90deg,
- rgba(255, 255, 255, 0.04) 25%,
- rgba(255, 255, 255, 0.09) 37%,
- rgba(255, 255, 255, 0.04) 63%
+ rgba(var(--pr-fg), 0.04) 25%,
+ rgba(var(--pr-fg), 0.09) 37%,
+ rgba(var(--pr-fg), 0.04) 63%
);
background-size: 400% 100%;
animation: payg-shimmer 1.4s ease infinite;
@@ -1256,12 +1291,12 @@
.pricing-pay-assets {
margin-top: 12px;
font-size: 12px;
- color: rgba(255, 255, 255, 0.45);
+ color: rgba(var(--pr-fg), 0.45);
text-align: center;
}
.pricing-pay-assets strong {
- color: rgba(255, 255, 255, 0.75);
+ color: rgba(var(--pr-fg), 0.75);
font-weight: 600;
}
@@ -1293,11 +1328,11 @@
width: min(560px, 100%);
max-height: calc(100vh - 40px);
overflow-y: auto;
- background: #0d0d0f;
- border: 1px solid rgba(255, 255, 255, 0.14);
+ background: var(--pr-panel);
+ border: 1px solid rgba(var(--pr-fg), 0.14);
border-radius: 18px;
padding: 30px 28px 26px;
- color: #eee;
+ color: var(--pr-panel-ink);
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
animation: pc-rise var(--duration-fast, 180ms) var(--ease-standard, ease);
outline: none;
@@ -1320,7 +1355,7 @@
}
.pc-sub {
- color: rgba(255, 255, 255, 0.55);
+ color: rgba(var(--pr-fg), 0.55);
font-size: 14px;
margin: 0 0 22px;
}
@@ -1334,17 +1369,17 @@
display: flex;
align-items: center;
justify-content: center;
- background: rgba(255, 255, 255, 0.06);
- border: 1px solid rgba(255, 255, 255, 0.12);
+ background: rgba(var(--pr-fg), 0.06);
+ border: 1px solid rgba(var(--pr-fg), 0.12);
border-radius: 50%;
- color: rgba(255, 255, 255, 0.7);
+ color: rgba(var(--pr-fg), 0.7);
cursor: pointer;
transition: background var(--duration-fast, 140ms) ease, color var(--duration-fast, 140ms) ease;
}
.pc-close:hover, .pc-close:focus-visible {
- background: rgba(255, 255, 255, 0.14);
- color: #fff;
+ background: rgba(var(--pr-fg), 0.14);
+ color: rgb(var(--pr-fg));
}
.pc-close svg { width: 14px; height: 14px; }
@@ -1366,26 +1401,26 @@
flex-direction: column;
gap: 4px;
padding: 16px 14px;
- background: rgba(255, 255, 255, 0.03);
- border: 1px solid rgba(255, 255, 255, 0.12);
+ background: rgba(var(--pr-fg), 0.03);
+ border: 1px solid rgba(var(--pr-fg), 0.12);
border-radius: 12px;
- color: #eee;
+ color: var(--pr-panel-ink);
text-align: left;
cursor: pointer;
transition: border-color var(--duration-fast, 140ms) ease, background var(--duration-fast, 140ms) ease, transform var(--duration-fast, 140ms) ease;
}
-.pc-asset:hover { border-color: rgba(255, 255, 255, 0.35); transform: translateY(-1px); }
+.pc-asset:hover { border-color: rgba(var(--pr-fg), 0.35); transform: translateY(-1px); }
.pc-asset:focus-visible {
- outline: 2px solid #fff;
+ outline: 2px solid rgb(var(--pr-fg));
outline-offset: 2px;
}
.pc-asset.is-selected {
- border-color: #fff;
- background: rgba(255, 255, 255, 0.07);
- box-shadow: 0 0 0 1px #fff inset;
+ border-color: rgb(var(--pr-fg));
+ background: rgba(var(--pr-fg), 0.07);
+ box-shadow: 0 0 0 1px rgb(var(--pr-fg)) inset;
}
.pc-asset-name {
@@ -1398,7 +1433,7 @@
.pc-asset-note {
font-size: 11.5px;
- color: rgba(255, 255, 255, 0.5);
+ color: rgba(var(--pr-fg), 0.5);
line-height: 1.4;
}
@@ -1419,7 +1454,7 @@
.pc-fineprint {
font-size: 12px;
- color: rgba(255, 255, 255, 0.4);
+ color: rgba(var(--pr-fg), 0.4);
margin: 14px 0 0;
line-height: 1.5;
}
@@ -1439,7 +1474,7 @@
.pc-quote-meta {
font-size: 13px;
- color: rgba(255, 255, 255, 0.55);
+ color: rgba(var(--pr-fg), 0.55);
margin-top: 4px;
}
@@ -1455,7 +1490,7 @@
}
.pc-qr-wrap {
- background: #fff;
+ background: rgb(var(--pr-fg));
border-radius: 12px;
padding: 8px;
line-height: 0;
@@ -1476,7 +1511,7 @@
.pc-sig-label {
display: block;
font-size: 12.5px;
- color: rgba(255, 255, 255, 0.55);
+ color: rgba(var(--pr-fg), 0.55);
margin-bottom: 6px;
}
@@ -1490,10 +1525,10 @@
flex: 1;
min-width: 0;
padding: 10px 12px;
- background: rgba(255, 255, 255, 0.04);
- border: 1px solid rgba(255, 255, 255, 0.14);
+ background: rgba(var(--pr-fg), 0.04);
+ border: 1px solid rgba(var(--pr-fg), 0.14);
border-radius: 10px;
- color: #eee;
+ color: var(--pr-panel-ink);
font-size: 13px;
font-family: inherit;
transition: border-color var(--duration-fast, 140ms) ease;
@@ -1501,25 +1536,25 @@
.pc-sig-row input:focus-visible {
outline: none;
- border-color: #fff;
+ border-color: rgb(var(--pr-fg));
}
.pc-back {
margin-top: 14px;
background: none;
border: 0;
- color: rgba(255, 255, 255, 0.5);
+ color: rgba(var(--pr-fg), 0.5);
font-size: 13px;
cursor: pointer;
padding: 4px 0;
}
-.pc-back:hover, .pc-back:focus-visible { color: #fff; }
+.pc-back:hover, .pc-back:focus-visible { color: rgb(var(--pr-fg)); }
.pc-status {
margin-top: 12px;
font-size: 13px;
- color: rgba(255, 255, 255, 0.65);
+ color: rgba(var(--pr-fg), 0.65);
min-height: 1.2em;
line-height: 1.5;
}
@@ -1550,7 +1585,7 @@
}
.pc-success p {
- color: rgba(255, 255, 255, 0.6);
+ color: rgba(var(--pr-fg), 0.6);
font-size: 14px;
margin: 0 0 18px;
}
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index 8e3021421..a1cfc673b 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -79,7 +79,7 @@
<main class="sm-wrap">
<div class="sm-hero">
<h1>Sitemap</h1>
- <p>All 538 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>
+ <p>All 537 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>
<div class="sm-formats">
<a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a>
<a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>
@@ -91,7 +91,7 @@
</div>
<div class="sm-filter">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>
- <input id="sm-filter-input" type="search" placeholder="Filter 538 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
+ <input id="sm-filter-input" type="search" placeholder="Filter 537 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />
<kbd aria-hidden="true">/</kbd>
</div>
<p class="sm-filter-count" id="sm-filter-count" role="status" aria-live="polite"></p>
@@ -123,6 +123,14 @@
<span class="sm-desc">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 a clip and share the sound of machines doing business.</span>
</a>
</li>
+ <li>
+ <a href="/fits">
+ <span class="sm-new-date">Jul 28, 2026</span>
+ <span class="sm-title">Fits: the cosmetics economy</span>
+ <span class="sm-path">/fits</span>
+ <span class="sm-desc">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 in real settled USDC, and every cosmetic sale as it lands. Includes a free creator-earnings lookup for any Solana wallet, with per-cosmetic and per-coin-world breakdowns.</span>
+ </a>
+ </li>
<li>
<a href="/receipts">
<span class="sm-new-date">Jul 28, 2026</span>
@@ -163,14 +171,6 @@
<span class="sm-desc">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 interactive, riggable, AR-ready 3D model inline in the conversation.</span>
</a>
</li>
- <li>
- <a href="/forge-max">
- <span class="sm-new-date">Jul 25, 2026</span>
- <span class="sm-title">Forge Max: Highest-Quality Text &amp; Image to 3D</span>
- <span class="sm-path">/forge-max</span>
- <span class="sm-desc">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 perk; also unlockable with your own Meshy, Tripo, or Rodin key.</span>
- </a>
- </li>
</ul>
</section>
<nav class="sm-toc" aria-label="Sections">
@@ -491,7 +491,7 @@
<section class="sm-section" id="build">
<header>
- <h2>Build<span class="sm-count" data-count>54</span></h2>
+ <h2>Build<span class="sm-count" data-count>52</span></h2>
<p class="sm-section-desc">Create and customize an agent.</p>
</header>
<ul class="sm-list">
@@ -796,13 +796,6 @@
<span class="sm-desc">Register your AI agent on Solana via ERC-8004 and Metaplex Core. Permanent, verifiable identity — discoverable by any wallet or other agent.</span>
</a>
</li>
- <li>
- <a href="/agent/new">
- <span class="sm-title">New Agent</span>
- <span class="sm-path">/agent/new</span>
- <span class="sm-desc">Create a new agent from scratch — avatar, brain, skills, and on-chain identity.</span>
- </a>
- </li>
<li>
<a href="/create/selfie">
<span class="sm-title">Selfie to Avatar</span>
@@ -831,13 +824,6 @@
<span class="sm-desc">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.</span>
</a>
</li>
- <li>
- <a href="/scan">
- <span class="sm-title">3D Scanner — Scan Yourself into 3D</span>
- <span class="sm-path">/scan</span>
- <span class="sm-desc">Point your camera at your face, hold still, and walk away with a rigged 3D avatar — reconstruction runs in about a minute, free, in your browser.</span>
- </a>
- </li>
<li>
<a href="/dad">
<span class="sm-title">Make Dad a 3D Avatar</span>
@@ -1013,7 +999,7 @@
<section class="sm-section" id="crypto">
<header>
- <h2>Crypto<span class="sm-count" data-count>123</span></h2>
+ <h2>Crypto<span class="sm-count" data-count>124</span></h2>
<p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p>
</header>
<ul class="sm-list">
@@ -1129,6 +1115,13 @@
<span class="sm-desc">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 window, top-earning endpoints, revenue by network, and a filterable, searchable live feed of every settlement with copy-tx, sound, and CSV export. The mirror of the Money Pulse: what the platform earns, not what agents spend. Every payment is real and explorer-verifiable.</span>
</a>
</li>
+ <li>
+ <a href="/fits">
+ <span class="sm-title">Fits: the cosmetics economy</span>
+ <span class="sm-path">/fits</span>
+ <span class="sm-desc">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 in real settled USDC, and every cosmetic sale as it lands. Includes a free creator-earnings lookup for any Solana wallet, with per-cosmetic and per-coin-world breakdowns.</span>
+ </a>
+ </li>
<li>
<a href="/receipts">
<span class="sm-title">Receipt Vault</span>
diff --git a/public/studio/studio.js b/public/studio/studio.js
index 9d105cac8..5d03e7807 100644
--- a/public/studio/studio.js
+++ b/public/studio/studio.js
@@ -177,6 +177,13 @@ const TYPE_DEFAULTS = {
height: 420,
position: 'inline',
enableNarration: false,
+ // Runtime toggles the /walk-embed page has always honoured but Studio
+ // could not reach (creation-consolidation C6 parity with /embed).
+ // Defaults mirror src/walk-embed.js: ground and badge on, gestures off.
+ ground: true,
+ gestures: false,
+ badge: true,
+ responsive: false,
},
};
@@ -481,7 +488,7 @@ async function cloneTemplate(id) {
function renderAvatarList() {
const list = $('#avatar-list');
if (!state.avatars.length) {
- list.innerHTML = `<div class="empty">No avatars yet. <a href="/scan">Scan yourself to 3D →</a> <span class="empty-sep">or</span> <a href="/create/selfie">AI selfie →</a></div>`;
+ list.innerHTML = `<div class="empty">No avatars yet. <a href="/create/selfie">Make one from a selfie →</a> <span class="empty-sep">or</span> <a href="/create">browse every way to build one →</a></div>`;
return;
}
list.innerHTML = '';
@@ -810,6 +817,31 @@ function mountWalkingAvatarExtras(wrap) {
]),
);
+ // Scene + chrome toggles. The /walk-embed runtime has always read these
+ // (src/walk-embed.js: ?ground, ?gestures, ?badge); until now only the /embed
+ // editor could set them, so a Studio-built snippet silently shipped the
+ // defaults. Responsive swaps the fixed width/height for a fluid wrapper.
+ wrap.appendChild(
+ boolField('ground', 'Ground disc and contact shadow', state.config.ground !== false),
+ );
+ wrap.appendChild(
+ boolField(
+ 'gestures',
+ 'Visitor gesture buttons — wave and jump',
+ state.config.gestures === true,
+ ),
+ );
+ wrap.appendChild(
+ boolField('badge', 'three.ws attribution badge', state.config.badge !== false),
+ );
+ wrap.appendChild(
+ boolField(
+ 'responsive',
+ 'Responsive — fill the container width instead of fixed pixels',
+ state.config.responsive === true,
+ ),
+ );
+
wrap.appendChild(
boolField(
'enableNarration',
@@ -822,6 +854,18 @@ function mountWalkingAvatarExtras(wrap) {
narrNote.textContent =
'When on, the script-tag (JS SDK) embed reads each page section the visitor scrolls to via the avatar — using the narrator from the walk SDK. Plain iframe embeds stay silent.';
wrap.appendChild(narrNote);
+
+ // The sibling surface. Studio saves a reusable, brandable widget (needs an
+ // account); the embed editor emits a throwaway snippet instantly and can
+ // point at a raw GLB URL or an agent chat embed, which Studio cannot.
+ const altNote = document.createElement('p');
+ altNote.className = 'note';
+ altNote.append(document.createTextNode('Just need a snippet right now, with no account and no saved widget? '));
+ const altLink = document.createElement('a');
+ altLink.href = '/embed';
+ altLink.textContent = 'Open the embed editor →';
+ altNote.appendChild(altLink);
+ wrap.appendChild(altNote);
}
function mountTalkingAgentExtras(wrap) {
@@ -1657,6 +1701,11 @@ function walkEmbedQuery(avatarParam) {
if (c.bg) p.set('bg', c.bg);
if (typeof c.walkSpeed === 'number') p.set('speed', String(c.walkSpeed));
if (c.enableNarration) p.set('narration', '1');
+ // Only emit the non-default values — the runtime's own defaults (ground on,
+ // badge on, gestures off) keep the snippet short for the common case.
+ if (c.ground === false) p.set('ground', 'false');
+ if (c.gestures === true) p.set('gestures', 'true');
+ if (c.badge === false) p.set('badge', 'false');
return p;
}
@@ -1926,7 +1975,14 @@ function _refreshWalkSnippet() {
const pos = state.config.position || 'inline';
const base = 'border:0;border-radius:12px;max-width:100%;background:transparent';
let snippet;
- if (pos === 'inline' || !WALK_CORNER_CSS[pos]) {
+ if (state.config.responsive === true && (pos === 'inline' || !WALK_CORNER_CSS[pos])) {
+ // Fluid: the wrapper holds the aspect ratio the W/H fields describe, so the
+ // embed tracks the column it lands in instead of overflowing narrow layouts.
+ snippet =
+ `<div style="width:100%;max-width:${w}px;aspect-ratio:${w}/${h}">` +
+ `<iframe src="${_currentEmbedUrl}" style="width:100%;height:100%;${base}" allow="autoplay" loading="lazy"></iframe>` +
+ `</div>`;
+ } else if (pos === 'inline' || !WALK_CORNER_CSS[pos]) {
snippet = `<iframe src="${_currentEmbedUrl}" width="${w}" height="${h}" style="${base}" allow="autoplay" loading="lazy"></iframe>`;
} else {
snippet = `<iframe src="${_currentEmbedUrl}" width="${w}" height="${h}" style="position:fixed;${WALK_CORNER_CSS[pos]};z-index:2147483000;${base}" allow="autoplay" loading="lazy"></iframe>`;
diff --git a/robinhood/README.md b/robinhood/README.md
index fae65307b..7d145895d 100644
--- a/robinhood/README.md
+++ b/robinhood/README.md
@@ -25,7 +25,7 @@ own README with install and usage.
| [hood-status](hood-status/) | Status page for the chain |
| [hood-tokenlist](hood-tokenlist/) | Canonical token list |
| [hood-alerts](hood-alerts/) | Alerting |
-| [robinhood-mcp](robinhood-mcp/) / [hood-mcp](hood-mcp/) | MCP servers exposing chain data + actions to agents |
+| [hood-mcp](hood-mcp/) | MCP servers exposing chain data + actions to agents |
## Payments + agents
diff --git a/robinhood/hood-mcp/docs/install.html b/robinhood/hood-mcp/docs/install.html
new file mode 100644
index 000000000..c5319f910
--- /dev/null
+++ b/robinhood/hood-mcp/docs/install.html
@@ -0,0 +1,153 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Install — hood-mcp</title>
+<meta name="description" content="Install hood-mcp in Claude Code, Claude Desktop, Cursor, Smithery, or any stdio MCP client. Zero config: no key, no wallet, public RPC by default." />
+<link rel="canonical" href="https://nirholas.github.io/hood-mcp/install.html" />
+<meta name="theme-color" content="#0a0d10" />
+<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='7' fill='%230a0d10'/><path d='M7 22V10m0 6h8m0-6v12' fill='none' stroke='%2300c805' stroke-width='2.6' stroke-linecap='round'/><circle cx='24' cy='12' r='2.6' fill='%2335e0c0'/></svg>" />
+<link rel="stylesheet" href="site.css" />
+</head>
+<body>
+
+<nav class="top">
+ <div class="wrap">
+ <div class="brand"><span class="tick">hood</span>-mcp</div>
+ <div class="links">
+ <a href="index.html">Session</a>
+ <a href="install.html" aria-current="page">Install</a>
+ <a href="tools.html">Tools</a>
+ <a href="safety.html">Safety model</a>
+ <a href="https://github.com/nirholas/hood-mcp">GitHub</a>
+ </div>
+ </div>
+</nav>
+
+<main class="wrap">
+
+ <section style="border-top:none; padding-top:56px;">
+ <p class="eyebrow">Install matrix</p>
+ <h1>One line, no key.</h1>
+ <p class="section-lede">
+ The data server runs against the public Robinhood Chain RPC with no account, no API key, and
+ no wallet. Every snippet below is the exact config used to produce
+ <a href="index.html">the session transcript</a>. Node 20 or newer.
+ </p>
+ </section>
+
+ <section id="claude-code">
+ <h2>Claude Code</h2>
+ <pre><code>claude mcp add hood-mcp -- npx -y hood-mcp</code></pre>
+ <p class="section-lede">
+ Then ask it something the chain can answer, for example <em>"what is AAPL trading at on-chain
+ and what is the premium?"</em>. Remove it again with <code>claude mcp remove hood-mcp</code>.
+ </p>
+ </section>
+
+ <section id="claude-desktop">
+ <h2>Claude Desktop</h2>
+ <p class="section-lede">Add to <code>claude_desktop_config.json</code> and restart the app.</p>
+<pre><code>{
+ "mcpServers": {
+ "hood-mcp": {
+ "command": "npx",
+ "args": ["-y", "hood-mcp"]
+ }
+ }
+}</code></pre>
+ </section>
+
+ <section id="cursor">
+ <h2>Cursor</h2>
+ <p class="section-lede">Add to <code>.cursor/mcp.json</code> in the project, or the global config.</p>
+<pre><code>{
+ "mcpServers": {
+ "hood-mcp": {
+ "command": "npx",
+ "args": ["-y", "hood-mcp"]
+ }
+ }
+}</code></pre>
+ </section>
+
+ <section id="smithery">
+ <h2>Smithery</h2>
+ <p class="section-lede">
+ <code>smithery.yaml</code> ships in the repo root and declares the stdio start command plus the
+ two optional settings below. Smithery installs the read-only data server only; the trading
+ server is deliberately not exposed there.
+ </p>
+<pre><code>startCommand:
+ type: stdio
+ configSchema:
+ type: object
+ properties:
+ HOOD_MCP_NETWORK: { type: string, enum: [mainnet, testnet], default: mainnet }
+ ALCHEMY_KEY: { type: string }
+ required: []</code></pre>
+ </section>
+
+ <section id="stdio">
+ <h2>Any stdio MCP client</h2>
+ <pre><code>npx -y hood-mcp</code></pre>
+ <p class="section-lede">
+ Speak JSON-RPC on stdin/stdout. The <a href="index.html#transcript">transcript</a> shows the
+ exact frames a client sends and receives, starting with <code>initialize</code>.
+ </p>
+ </section>
+
+ <section id="http">
+ <h2>Streamable HTTP</h2>
+ <p class="section-lede">
+ For browser-based or remote clients, run the same server over HTTP. It serves
+ <code>POST /mcp</code> and <code>GET /health</code>, stateless (a fresh server per request),
+ with CORS open and the <code>Mcp-Session-Id</code> header exposed.
+ </p>
+<pre><code>npx -y hood-mcp --http # or HOOD_MCP_TRANSPORT=http
+curl -s http://localhost:8730/health
+{"ok":true,"server":"hood-mcp","version":"0.1.0","network":"mainnet"}</code></pre>
+ </section>
+
+ <section id="env">
+ <h2>Environment</h2>
+ <p class="section-lede">
+ Nothing here is required for the data server. The trading server's variables are documented on
+ the <a href="safety.html">safety model</a> page.
+ </p>
+ <div class="table-scroll"><table>
+ <thead><tr><th>Variable</th><th>Default</th><th>What it does</th></tr></thead>
+ <tbody>
+ <tr><td><code>HOOD_MCP_NETWORK</code></td><td><code>mainnet</code></td><td>Target network: <code>mainnet</code> (chain 4663) or <code>testnet</code> (chain 46630).</td></tr>
+ <tr><td><code>ALCHEMY_KEY</code></td><td>unset</td><td>Route RPC through Alchemy instead of the public endpoint. Faster and unthrottled on the heavy portfolio and launch scans.</td></tr>
+ <tr><td><code>HOOD_MCP_TRANSPORT</code></td><td><code>stdio</code></td><td>Set to <code>http</code> to serve Streamable HTTP instead of stdio.</td></tr>
+ <tr><td><code>HOOD_MCP_PORT</code></td><td><code>8730</code></td><td>Port for the HTTP transport.</td></tr>
+ </tbody>
+ </table></div>
+ </section>
+
+ <section id="local">
+ <h2>Run from a checkout</h2>
+<pre><code>git clone https://github.com/nirholas/hood-mcp
+cd hood-mcp
+npm install
+npm run build
+node dist/data-server.js # stdio
+npm run docs # recapture the session + rebuild this site</code></pre>
+ <p class="section-lede">
+ Point a client at the local build with an absolute path instead of <code>npx</code>:
+ <code>{"command": "node", "args": ["/abs/path/hood-mcp/dist/data-server.js"]}</code>.
+ </p>
+ </section>
+
+</main>
+
+<footer class="wrap">
+ © 2026 nirholas · Built by <a href="https://x.com/nichxbt">nirholas</a> ·
+ <a href="https://three.ws">three.ws</a> ·
+ <a href="https://www.npmjs.com/package/hood-mcp">npm</a>
+</footer>
+
+</body>
+</html>
diff --git a/robinhood/hood-mcp/docs/safety.html b/robinhood/hood-mcp/docs/safety.html
new file mode 100644
index 000000000..a2fee70d5
--- /dev/null
+++ b/robinhood/hood-mcp/docs/safety.html
@@ -0,0 +1,153 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Safety model — hood-mcp</title>
+<meta name="description" content="How hood-mcp's trading server is guarded: a kill switch that stops the process from starting, USD spend caps per call and per session, a simulate-then-confirm round trip, and the Stock Token eligibility gate." />
+<link rel="canonical" href="https://nirholas.github.io/hood-mcp/safety.html" />
+<meta name="theme-color" content="#0a0d10" />
+<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='7' fill='%230a0d10'/><path d='M7 22V10m0 6h8m0-6v12' fill='none' stroke='%2300c805' stroke-width='2.6' stroke-linecap='round'/><circle cx='24' cy='12' r='2.6' fill='%2335e0c0'/></svg>" />
+<link rel="stylesheet" href="site.css" />
+</head>
+<body>
+
+<nav class="top">
+ <div class="wrap">
+ <div class="brand"><span class="tick">hood</span>-mcp</div>
+ <div class="links">
+ <a href="index.html">Session</a>
+ <a href="install.html">Install</a>
+ <a href="tools.html">Tools</a>
+ <a href="safety.html" aria-current="page">Safety model</a>
+ <a href="https://github.com/nirholas/hood-mcp">GitHub</a>
+ </div>
+ </div>
+</nav>
+
+<main class="wrap">
+
+ <section style="border-top:none; padding-top:56px;">
+ <p class="eyebrow">Safety model</p>
+ <h1>Four gates before anything is signed.</h1>
+ <p class="section-lede">
+ The data server holds no key and can only read. Everything on this page is about the second
+ binary, <code>hood-mcp-trading</code>, which does hold a key. A language model choosing tool
+ calls is not a trust boundary, so the guards are in the server, ahead of the signer, and each
+ one is independent of the others.
+ </p>
+ <p class="note">
+ <strong>Two servers, never one.</strong> The trading tools are not registered on the data
+ server and cannot be reached from it. Installing <code>hood-mcp</code> from Smithery, Claude
+ Code, or npm gives a client no path to a transaction.
+ </p>
+ </section>
+
+ <section id="kill-switch">
+ <h2>1. Kill switch</h2>
+ <p class="section-lede">
+ The trading process refuses to start unless <code>HOOD_MCP_ENABLE_TRADING</code> is exactly
+ <code>1</code> and <code>ROBINHOOD_CHAIN_PRIVATE_KEY</code> is a well-formed 32-byte hex key.
+ There is no in-band way for a model to flip it: the check runs at boot, before any transport
+ is connected.
+ </p>
+<pre><code>HOOD_MCP_ENABLE_TRADING=1
+ROBINHOOD_CHAIN_PRIVATE_KEY=0x... # env only, never in a config file you commit</code></pre>
+ <p class="section-lede">
+ Stopping the process is the whole revocation story: kill it and the key is out of reach.
+ </p>
+ </section>
+
+ <section id="spend-caps">
+ <h2>2. Hard spend caps, in USD</h2>
+ <p class="section-lede">
+ Every mutating call is priced in USD before it is signed and checked against two independent
+ caps. Exceeding either one is a refusal, not a warning, and the ledger is charged only after a
+ broadcast succeeds.
+ </p>
+ <div class="table-scroll"><table>
+ <thead><tr><th>Variable</th><th>Default</th><th>Scope</th></tr></thead>
+ <tbody>
+ <tr><td><code>HOOD_MCP_MAX_SPEND_USDG</code></td><td><code>25</code></td><td>One call. A single <code>execute_swap</code> or <code>transfer_usdg</code> above this is rejected outright.</td></tr>
+ <tr><td><code>HOOD_MCP_MAX_SESSION_USDG</code></td><td><code>100</code></td><td>Cumulative for the process lifetime, held in memory. Restarting resets it, which is deliberate: a restart is a human action.</td></tr>
+ </tbody>
+ </table></div>
+ <p class="section-lede">
+ Valuation uses the same live pricing path the data tools use, so a cap of 25 means 25 dollars
+ of token, not 25 units of whatever the model happened to name.
+ </p>
+ </section>
+
+ <section id="confirm-gate">
+ <h2>3. Simulate, then confirm</h2>
+ <p class="section-lede">
+ The first call to a mutating tool never signs. It returns a simulation: the resolved token
+ addresses, the exact amount in and minimum out, the recipient, the USD value, and the caps it
+ was checked against. Only a second call carrying <code>confirm: true</code> with identical
+ arguments broadcasts.
+ </p>
+<pre><code>execute_swap({ tokenIn: "USDG", tokenOut: "WETH", amountIn: "10" })
+ -> { simulation: { amountOutMinimum, usdValue, spendRemaining, ... }, confirmRequired: true }
+
+execute_swap({ tokenIn: "USDG", tokenOut: "WETH", amountIn: "10", confirm: true })
+ -> { txHash, blockNumber, status, explorer }</code></pre>
+ <p class="section-lede">
+ This gives the human in the loop a rendered recipient and amount to read before anything
+ moves, which is the only review step that reliably catches a mis-routed tool call.
+ </p>
+ </section>
+
+ <section id="eligibility">
+ <h2>4. Stock Token eligibility gate</h2>
+ <p class="section-lede">
+ Stock Tokens are tokenized debt securities issued by Robinhood Assets (Jersey) Ltd. They may
+ not be offered, sold, or delivered to US persons, with further limits for Canada, the UK, and
+ Switzerland. The restriction is legal and front-end enforced, not enforced by the contracts, so
+ this server enforces it itself.
+ </p>
+ <ul class="plain">
+ <li><strong>Reading is never gated.</strong> Quotes, portfolios, premiums, and search work for everyone. That is data, not an offer.</li>
+ <li><strong>Acquiring is gated.</strong> Any swap whose <em>output</em> is a Stock Token throws unless <code>HOOD_MCP_ACKNOWLEDGE_ELIGIBILITY=1</code> is set, which is the operator affirming they are eligible.</li>
+ <li><strong>Selling is never gated.</strong> Exiting a position you already hold is always allowed.</li>
+ <li><strong>Memecoins are unrestricted.</strong> NOXA and The Odyssey tokens are not securities and carry no gate.</li>
+ </ul>
+ <p class="note">
+ This is a config-level affirmation, not a geo-IP check. Setting the variable does not make you
+ eligible; it records that you say you are.
+ </p>
+ </section>
+
+ <section id="keys">
+ <h2>Key handling</h2>
+ <ul class="plain">
+ <li>The key is read from the environment once, at boot, and turned into a viem account. It is never logged, never returned by a tool, and never written to disk by this package.</li>
+ <li>Tool results carry addresses and transaction hashes, never key material.</li>
+ <li><code>.env*</code> is gitignored in this repo. Client configs that inline a key (Claude Desktop, Cursor) live outside version control by design; prefer exporting the variable in the shell that launches the client.</li>
+ <li>Use a dedicated wallet holding only what you are willing to have an agent spend. The caps above bound the loss per session; the wallet balance bounds it absolutely.</li>
+ </ul>
+ </section>
+
+ <section id="tests">
+ <h2>What is actually tested</h2>
+ <p class="section-lede">
+ The guards are covered by <code>tests/trading-guards.test.ts</code> (spend caps, the confirm
+ round trip, the eligibility gate, the kill switch) and the tool schemas by
+ <code>tests/schema.test.ts</code>. Live data tools run against real mainnet in
+ <code>npm run test:live</code>, and <code>npm run test:swap</code> performs a real testnet swap
+ through <code>execute_swap</code> when a funded key is present.
+ </p>
+ <pre><code>npm test # schema + guard tests
+npm run test:live # every data tool against live chain 4663
+npm run test:swap # real testnet 46630 swap, requires a funded key</code></pre>
+ </section>
+
+</main>
+
+<footer class="wrap">
+ © 2026 nirholas · Built by <a href="https://x.com/nichxbt">nirholas</a> ·
+ <a href="https://three.ws">three.ws</a> ·
+ <a href="https://www.npmjs.com/package/hood-mcp">npm</a>
+</footer>
+
+</body>
+</html>
diff --git a/robinhood/hood-mcp/docs/site.css b/robinhood/hood-mcp/docs/site.css
new file mode 100644
index 000000000..361e4dacf
--- /dev/null
+++ b/robinhood/hood-mcp/docs/site.css
@@ -0,0 +1,449 @@
+/* hood-mcp docs. Dark-first, one accent gradient, system stack, no external
+ requests — the whole site works from file:// . */
+:root {
+ color-scheme: dark;
+ --bg: #0a0d10;
+ --bg-raised: #11161b;
+ --bg-inset: #161c22;
+ --border: #232b34;
+ --border-soft: #1b222a;
+ --text: #e7edf3;
+ --text-dim: #97a5b3;
+ --text-faint: #6f7d8b;
+ --accent: #00c805;
+ --accent-2: #35e0c0;
+ --up: #35d07f;
+ --down: #ff6b6b;
+ --warn: #ffb020;
+ --radius: 12px;
+ --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
+ --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
+}
+
+* {
+ box-sizing: border-box;
+}
+
+html {
+ scroll-behavior: smooth;
+}
+
+body {
+ margin: 0;
+ background: var(--bg);
+ color: var(--text);
+ font-family: var(--font);
+ font-size: 15px;
+ line-height: 1.62;
+ -webkit-font-smoothing: antialiased;
+}
+
+a {
+ color: var(--accent-2);
+ text-decoration: none;
+}
+a:hover,
+a:focus-visible {
+ text-decoration: underline;
+}
+a:focus-visible,
+button:focus-visible,
+summary:focus-visible {
+ outline: 2px solid var(--accent-2);
+ outline-offset: 3px;
+ border-radius: 4px;
+}
+
+code,
+pre,
+.mono {
+ font-family: var(--mono);
+ font-size: 13px;
+}
+code {
+ background: var(--bg-inset);
+ border: 1px solid var(--border-soft);
+ border-radius: 6px;
+ padding: 1px 6px;
+}
+pre {
+ background: var(--bg-raised);
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ padding: 15px 17px;
+ overflow-x: auto;
+ line-height: 1.55;
+ margin: 0 0 16px;
+}
+pre code {
+ background: none;
+ border: 0;
+ padding: 0;
+}
+
+.wrap {
+ max-width: 940px;
+ margin: 0 auto;
+ padding: 0 20px;
+}
+
+/* ---------------------------------------------------------------- nav */
+nav.top {
+ position: sticky;
+ top: 0;
+ z-index: 50;
+ background: rgba(10, 13, 16, 0.86);
+ backdrop-filter: blur(10px);
+ border-bottom: 1px solid var(--border);
+}
+nav.top .wrap {
+ display: flex;
+ align-items: center;
+ gap: 18px;
+ height: 56px;
+}
+.brand {
+ font: 600 15px/1 var(--mono);
+ letter-spacing: -0.01em;
+ white-space: nowrap;
+}
+.brand .tick {
+ background: linear-gradient(96deg, var(--accent), var(--accent-2));
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+}
+.links {
+ margin-left: auto;
+ display: flex;
+ gap: 18px;
+ font-size: 14px;
+ overflow-x: auto;
+ scrollbar-width: none;
+}
+.links::-webkit-scrollbar {
+ display: none;
+}
+.links a {
+ color: var(--text-dim);
+ white-space: nowrap;
+}
+.links a:hover {
+ color: var(--text);
+ text-decoration: none;
+}
+.links a[aria-current='page'] {
+ color: var(--text);
+ box-shadow: inset 0 -2px 0 var(--accent);
+}
+
+/* ------------------------------------------------------------ headings */
+h1 {
+ font-size: clamp(30px, 5.2vw, 46px);
+ line-height: 1.1;
+ letter-spacing: -0.025em;
+ margin: 0 0 14px;
+}
+h2 {
+ font-size: 22px;
+ letter-spacing: -0.015em;
+ margin: 0 0 10px;
+}
+h3 {
+ font-size: 16px;
+ letter-spacing: -0.01em;
+ margin: 0 0 8px;
+}
+.section-lede {
+ color: var(--text-dim);
+ max-width: 70ch;
+ margin: 0 0 20px;
+}
+.eyebrow {
+ font: 600 11px/1 var(--mono);
+ letter-spacing: 0.28em;
+ text-transform: uppercase;
+ color: var(--text-faint);
+ margin: 0 0 14px;
+}
+
+main.wrap section {
+ border-top: 1px solid var(--border-soft);
+ padding: 44px 0;
+}
+
+/* --------------------------------------------------------------- cards */
+.card {
+ border: 1px solid var(--border);
+ background: var(--bg-raised);
+ border-radius: var(--radius);
+ padding: 18px 20px;
+}
+.card p {
+ color: var(--text-dim);
+ margin: 0 0 12px;
+}
+.card h3 code {
+ font-size: 14px;
+ background: none;
+ border: 0;
+ padding: 0;
+ color: var(--text);
+}
+
+.grid {
+ display: grid;
+ gap: 14px;
+ grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
+}
+
+.pill {
+ display: inline-block;
+ font: 600 10px/1 var(--mono);
+ letter-spacing: 0.1em;
+ text-transform: uppercase;
+ padding: 4px 8px;
+ border-radius: 999px;
+ vertical-align: middle;
+ margin-left: 6px;
+}
+.pill.free {
+ color: var(--up);
+ background: rgba(53, 208, 127, 0.12);
+ border: 1px solid rgba(53, 208, 127, 0.3);
+}
+.pill.guarded {
+ color: var(--warn);
+ background: rgba(255, 176, 32, 0.12);
+ border: 1px solid rgba(255, 176, 32, 0.32);
+}
+
+/* -------------------------------------------------------------- tables */
+.table-scroll {
+ overflow-x: auto;
+ border: 1px solid var(--border);
+ border-radius: 10px;
+}
+table {
+ border-collapse: collapse;
+ width: 100%;
+ min-width: 440px;
+ font-size: 13.5px;
+}
+th,
+td {
+ text-align: left;
+ padding: 9px 12px;
+ border-bottom: 1px solid var(--border-soft);
+ vertical-align: top;
+}
+th {
+ color: var(--text-faint);
+ font-size: 11px;
+ text-transform: uppercase;
+ letter-spacing: 0.08em;
+ background: var(--bg-inset);
+}
+tbody tr:last-child td {
+ border-bottom: 0;
+}
+
+/* ---------------------------------------------------- session transcript */
+.transcript {
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ background: var(--bg-raised);
+ overflow: hidden;
+}
+.transcript-head {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 10px 16px;
+ align-items: center;
+ padding: 12px 16px;
+ border-bottom: 1px solid var(--border);
+ background: var(--bg-inset);
+ font: 500 12px/1.4 var(--mono);
+ color: var(--text-faint);
+}
+.dots {
+ display: flex;
+ gap: 6px;
+}
+.dots i {
+ width: 10px;
+ height: 10px;
+ border-radius: 50%;
+ background: var(--border);
+}
+.dots i:first-child {
+ background: #3d454f;
+}
+.turn {
+ border-bottom: 1px solid var(--border-soft);
+ padding: 16px;
+}
+.turn:last-child {
+ border-bottom: 0;
+}
+.turn-label {
+ font: 600 11px/1 var(--mono);
+ letter-spacing: 0.16em;
+ text-transform: uppercase;
+ color: var(--text-faint);
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ margin-bottom: 10px;
+}
+.turn-label .ms {
+ margin-left: auto;
+ letter-spacing: 0;
+ text-transform: none;
+ font-weight: 400;
+}
+.turn.req .turn-label {
+ color: var(--accent-2);
+}
+.turn.res .turn-label {
+ color: var(--up);
+}
+.turn pre {
+ margin: 0;
+ background: var(--bg-inset);
+ max-height: 420px;
+ overflow: auto;
+}
+.turn details pre {
+ margin-top: 10px;
+}
+summary {
+ cursor: pointer;
+ color: var(--text-dim);
+ font-size: 13px;
+ list-style: none;
+}
+summary::-webkit-details-marker {
+ display: none;
+}
+summary::before {
+ content: '▸ ';
+ color: var(--text-faint);
+}
+details[open] > summary::before {
+ content: '▾ ';
+}
+
+/* syntax tint for the JSON frames (applied at build time, no client JS) */
+.j-key {
+ color: #9cd7ff;
+}
+.j-str {
+ color: #b7e8a0;
+}
+.j-num {
+ color: #ffcf8a;
+}
+.j-bool {
+ color: #c8a8ff;
+}
+.j-null {
+ color: var(--text-faint);
+}
+
+/* ------------------------------------------------------------- figures */
+.figures {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
+ gap: 12px;
+ margin: 0 0 20px;
+ padding: 0;
+}
+.figures > div {
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ background: var(--bg-raised);
+ padding: 13px 15px;
+}
+.figures dt {
+ font-size: 11px;
+ text-transform: uppercase;
+ letter-spacing: 0.09em;
+ color: var(--text-faint);
+}
+.figures dd {
+ margin: 5px 0 0;
+ font: 600 19px/1.2 var(--mono);
+ letter-spacing: -0.02em;
+ word-break: break-all;
+}
+.figures dd small {
+ display: block;
+ font: 400 12px/1.4 var(--font);
+ color: var(--text-dim);
+ margin-top: 4px;
+ letter-spacing: 0;
+}
+.pos {
+ color: var(--up);
+}
+.neg {
+ color: var(--down);
+}
+
+.note {
+ border: 1px solid rgba(255, 176, 32, 0.32);
+ background: rgba(255, 176, 32, 0.07);
+ border-radius: 10px;
+ padding: 14px 16px;
+ font-size: 13.5px;
+ color: var(--text-dim);
+}
+.note strong {
+ color: var(--text);
+}
+
+ul.plain {
+ list-style: none;
+ padding: 0;
+ margin: 0 0 16px;
+ display: grid;
+ gap: 10px;
+}
+ul.plain li {
+ color: var(--text-dim);
+ padding-left: 18px;
+ position: relative;
+}
+ul.plain li::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 10px;
+ width: 6px;
+ height: 6px;
+ border-radius: 2px;
+ background: linear-gradient(140deg, var(--accent), var(--accent-2));
+}
+
+footer {
+ border-top: 1px solid var(--border);
+ padding: 24px 0 48px;
+ color: var(--text-faint);
+ font-size: 13px;
+}
+
+@media (max-width: 560px) {
+ main.wrap section {
+ padding: 32px 0;
+ }
+ .turn pre {
+ max-height: 300px;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ html {
+ scroll-behavior: auto;
+ }
+}
diff --git a/robinhood/hood-mcp/docs/sitemap.xml b/robinhood/hood-mcp/docs/sitemap.xml
index 1c41efb62..1fbadcd1e 100644
--- a/robinhood/hood-mcp/docs/sitemap.xml
+++ b/robinhood/hood-mcp/docs/sitemap.xml
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<urlset xmlns="http://www.sitemap.org/schemas/sitemap/0.9">
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>https://nirholas.github.io/hood-mcp/</loc><changefreq>weekly</changefreq><priority>1.0</priority></url>
+ <url><loc>https://nirholas.github.io/hood-mcp/install.html</loc><changefreq>monthly</changefreq><priority>0.8</priority></url>
+ <url><loc>https://nirholas.github.io/hood-mcp/tools.html</loc><changefreq>weekly</changefreq><priority>0.8</priority></url>
+ <url><loc>https://nirholas.github.io/hood-mcp/safety.html</loc><changefreq>monthly</changefreq><priority>0.7</priority></url>
</urlset>
diff --git a/robinhood/hood-mcp/scripts/capture-session.mjs b/robinhood/hood-mcp/scripts/capture-session.mjs
new file mode 100644
index 000000000..8dd37482a
--- /dev/null
+++ b/robinhood/hood-mcp/scripts/capture-session.mjs
@@ -0,0 +1,156 @@
+#!/usr/bin/env node
+/**
+ * Capture a REAL MCP session against the built data server and write it to
+ * `docs/session.json`, which `scripts/build-docs.mjs` renders into the docs
+ * landing page.
+ *
+ * Nothing here is scripted output: a real `@modelcontextprotocol/sdk` client
+ * spawns `dist/data-server.js` as a child process, speaks JSON-RPC over stdio,
+ * and every frame in both directions is recorded verbatim off the transport.
+ * The tool results are whatever the live chain, Blockscout, DefiLlama, and
+ * GeckoTerminal returned at capture time.
+ *
+ * npm run build && node scripts/capture-session.mjs
+ * node scripts/capture-session.mjs --network testnet
+ *
+ * Re-run it whenever the tool surface changes; the page is only as honest as
+ * its last capture, and every transcript carries its own `capturedAt`.
+ */
+import { writeFileSync, existsSync } from 'node:fs'
+import { fileURLToPath } from 'node:url'
+import path from 'node:path'
+import { Client } from '@modelcontextprotocol/sdk/client/index.js'
+import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
+const ROOT = path.join(__dirname, '..')
+const SERVER = path.join(ROOT, 'dist', 'data-server.js')
+const OUT = path.join(ROOT, 'docs', 'session.json')
+
+/** The calls the transcript makes, in order. */
+const MAINNET_CALLS = [
+ { name: 'get_chain_stats', arguments: {} },
+ { name: 'get_stock_quote', arguments: { symbol: 'AAPL' } },
+ { name: 'list_trending_coins', arguments: { limit: 5 } },
+ { name: 'search_token', arguments: { query: 'NVDA', limit: 3 } },
+]
+
+const TESTNET_CALLS = [{ name: 'get_chain_stats', arguments: {} }]
+
+/**
+ * Run one session and return `{ network, frames, tools, calls }`. `frames` is
+ * the verbatim wire log; `calls` pairs each request with its decoded result so
+ * the renderer does not have to re-derive it.
+ */
+async function captureSession(network, calls) {
+ const frames = []
+ const transport = new StdioClientTransport({
+ command: process.execPath,
+ args: [SERVER],
+ env: { ...process.env, HOOD_MCP_NETWORK: network },
+ stderr: 'pipe',
+ })
+
+ // Tap the transport in both directions before anything connects, so the
+ // initialize handshake itself is recorded.
+ const send = transport.send.bind(transport)
+ transport.send = (message, options) => {
+ frames.push({ dir: 'out', at: new Date().toISOString(), message })
+ return send(message, options)
+ }
+ let onmessage
+ Object.defineProperty(transport, 'onmessage', {
+ configurable: true,
+ get: () => onmessage,
+ set: (fn) => {
+ onmessage = (message, extra) => {
+ frames.push({ dir: 'in', at: new Date().toISOString(), message })
+ return fn(message, extra)
+ }
+ },
+ })
+
+ const client = new Client({ name: 'hood-mcp-session-capture', version: '1.0.0' })
+ const startedAt = Date.now()
+ await client.connect(transport)
+
+ const serverInfo = client.getServerVersion()
+ const instructions = client.getInstructions()
+ const { tools } = await client.listTools()
+
+ const results = []
+ for (const call of calls) {
+ const t0 = Date.now()
+ const result = await client.callTool(call)
+ const text = (result.content ?? [])
+ .filter((c) => c.type === 'text')
+ .map((c) => c.text)
+ .join('\n')
+ let parsed = null
+ try {
+ parsed = JSON.parse(text)
+ } catch {
+ parsed = null
+ }
+ results.push({
+ ...call,
+ ms: Date.now() - t0,
+ isError: Boolean(result.isError),
+ text,
+ parsed,
+ })
+ process.stderr.write(` ${network} · ${call.name} -> ${result.isError ? 'error' : 'ok'} (${Date.now() - t0}ms)\n`)
+ }
+
+ await client.close()
+
+ return {
+ network,
+ capturedAt: new Date().toISOString(),
+ totalMs: Date.now() - startedAt,
+ serverInfo,
+ instructions,
+ tools: tools.map((t) => ({
+ name: t.name,
+ title: t.title ?? t.annotations?.title ?? null,
+ description: t.description,
+ inputSchema: t.inputSchema,
+ })),
+ calls: results,
+ frames,
+ }
+}
+
+async function main() {
+ if (!existsSync(SERVER)) {
+ console.error(`Build first: ${SERVER} does not exist. Run \`npm run build\`.`)
+ process.exit(1)
+ }
+
+ const onlyNetwork = process.argv.includes('--network')
+ ? process.argv[process.argv.indexOf('--network') + 1]
+ : null
+
+ const sessions = []
+ if (!onlyNetwork || onlyNetwork === 'mainnet') {
+ process.stderr.write('capturing mainnet session (chain 4663)\n')
+ sessions.push(await captureSession('mainnet', MAINNET_CALLS))
+ }
+ if (!onlyNetwork || onlyNetwork === 'testnet') {
+ process.stderr.write('capturing testnet session (chain 46630)\n')
+ sessions.push(await captureSession('testnet', TESTNET_CALLS))
+ }
+
+ const failures = sessions.flatMap((s) => s.calls.filter((c) => c.isError).map((c) => `${s.network}/${c.name}`))
+ writeFileSync(OUT, `${JSON.stringify({ capturedAt: new Date().toISOString(), sessions }, null, 2)}\n`)
+ console.log(`session transcript -> ${OUT}`)
+ if (failures.length) {
+ console.error(`WARNING: tool calls returned errors: ${failures.join(', ')}`)
+ process.exit(2)
+ }
+}
+
+main().catch((e) => {
+ console.error(e)
+ process.exit(1)
+})
diff --git a/robinhood/hood-mcp/scripts/generate-tools-doc.mjs b/robinhood/hood-mcp/scripts/generate-tools-doc.mjs
index 3994f6cfd..c831e51f1 100644
--- a/robinhood/hood-mcp/scripts/generate-tools-doc.mjs
+++ b/robinhood/hood-mcp/scripts/generate-tools-doc.mjs
@@ -78,17 +78,25 @@ async function main() {
const ledger = new SpendLedger(config)
const tradingTools = await listTools((s) => registerTradingTools(s, hoodTrading, config, ledger))
- const html = `<title>Tools — hood-mcp</title>
-<meta name="description" content="Full tool reference for hood-mcp, generated from the servers' live registered schemas." />
+ const html = `<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
-<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🏹</text></svg>" />
+<title>Tools — hood-mcp</title>
+<meta name="description" content="Full tool reference for hood-mcp, generated from the servers' live registered schemas." />
+<link rel="canonical" href="https://nirholas.github.io/hood-mcp/tools.html" />
+<meta name="theme-color" content="#0a0d10" />
+<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='7' fill='%230a0d10'/><path d='M7 22V10m0 6h8m0-6v12' fill='none' stroke='%2300c805' stroke-width='2.6' stroke-linecap='round'/><circle cx='24' cy='12' r='2.6' fill='%2335e0c0'/></svg>" />
<link rel="stylesheet" href="site.css" />
+</head>
+<body>
<nav class="top">
<div class="wrap">
<div class="brand"><span class="tick">hood</span>-mcp</div>
<div class="links">
- <a href="index.html">Overview</a>
+ <a href="index.html">Session</a>
<a href="install.html">Install</a>
<a href="tools.html" aria-current="page">Tools</a>
<a href="safety.html">Safety model</a>
@@ -118,11 +126,16 @@ async function main() {
${tradingTools.map((t) => toolCard(t, 'trading')).join('\n')}
</section>
- <footer>
- Apache License 2.0 © 2026 nirholas · Built by <a href="https://x.com/nichxbt">nirholas</a> ·
- <a href="https://three.ws">three.ws</a>
- </footer>
</main>
+
+<footer class="wrap">
+ © 2026 nirholas · Built by <a href="https://x.com/nichxbt">nirholas</a> ·
+ <a href="https://three.ws">three.ws</a> ·
+ <a href="https://www.npmjs.com/package/hood-mcp">npm</a>
+</footer>
+
+</body>
+</html>
`
writeFileSync(path.join(DOCS_DIR, 'tools.html'), html)
console.log(`Wrote docs/tools.html — ${dataTools.length} data tools, ${tradingTools.length} trading tools`)
diff --git a/robinhood/robinhood-mcp b/robinhood/robinhood-mcp
deleted file mode 160000
index d450fd26f..000000000
--- a/robinhood/robinhood-mcp
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit d450fd26f67f401419bef1fe72e89ad862cd25c1
diff --git a/scripts/README.md b/scripts/README.md
index 3dc60b3b1..ffc6f9a67 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -67,3 +67,47 @@ Idempotent: re-running with the same policy is a no-op.
Run this any time you see `No 'Access-Control-Allow-Origin' header` errors
on assets served from `*.r2.dev` or your custom R2 domain.
+
+### `mobile-perf.mjs`: mobile field metrics under CPU + network throttling
+
+```sh
+npm run perf:mobile # top-15 preset vs production
+npm run perf:mobile -- --pages /,/forge --runs 3
+npm run perf:mobile -- --base http://localhost:3000 --net fast4g --cpu 2
+npm run perf:mobile -- --json out.json --md out.md --label baseline
+```
+
+Drives each page in a real Playwright mobile context (default Pixel 5,
+Chromium) with CDP throttling applied: `Emulation.setCPUThrottlingRate` (4x by
+default) and `Network.emulateNetworkConditions` (default `slow4g`, the same
+1.6 Mbps / 750 Kbps / 150 ms profile Lighthouse uses for its mobile preset).
+It reads LCP, CLS, FCP, long-task blocking time, DOMContentLoaded, load, real
+over-the-wire transfer bytes (CDP `Network.loadingFinished.encodedDataLength`),
+request count, DOM size, and WebGL contexts created / still live / visible.
+
+**These are Playwright-measured field-style metrics, not Lighthouse scores.**
+Lighthouse is not a dependency of this repo. `TBT*` in the output is a long-task
+blocking-time proxy, `sum(max(0, longtask.duration - 50))`, not Lighthouse's
+simulated Total Blocking Time, and there is deliberately no blended
+"performance score". Report the individual metrics, never a score.
+
+Reports the median of `--runs` runs per page. Every run gets a fresh browser
+context with service workers blocked, so transfer bytes are always cold-cache.
+
+### `mobile-touch-audit.mjs`: touch targets, gesture conflicts, safe areas
+
+```sh
+npm run audit:mobile-touch
+npm run audit:mobile-touch -- --pages /marketplace --json out.json --md out.md
+```
+
+Loads each page in a Pixel 5 context and inspects the live computed DOM for the
+four mobile ergonomics defects that matter: interactive elements whose rendered
+box is under 44x44 CSS px (inline text links are exempt per WCAG 2.5.8 and
+counted separately), visible canvases left at `touch-action: auto` where orbit
+gestures fight page scroll, bottom-anchored fixed bars with no CSS rule
+mentioning `safe-area-inset` plus whether the viewport meta opts into
+`viewport-fit=cover`, and horizontal overflow at the mobile viewport width.
+
+Every finding is a measured bounding box or a resolved computed style, never a
+source grep, so the output can be quoted directly as evidence.
diff --git a/scripts/animation-dignity-sweep.mjs b/scripts/animation-dignity-sweep.mjs
new file mode 100644
index 000000000..40939940f
--- /dev/null
+++ b/scripts/animation-dignity-sweep.mjs
@@ -0,0 +1,763 @@
+#!/usr/bin/env node
+// Animation dignity sweep — proves the "no rig allowlist" claim in CLAUDE.md by
+// driving the real idle + walk clips onto ten differently-named humanoid rigs and
+// MEASURING that both arms and both legs actually move.
+//
+// Why this exists: `src/glb-canonicalize.js` claims to canonicalize every common
+// bone-naming convention, and `src/animation-retarget.js` claims a canonical clip
+// then plays on the result. Until now nothing checked the second half. A rig can
+// map its Hips and still animate as a torso with four frozen sticks attached, and
+// every existing test would stay green because none of them look at motion.
+//
+// What it measures, per rig, per clip:
+// • retarget coverage (the gate `animation-retarget.js` applies at MIN_COVERAGE),
+// • per-limb LOCAL rotation swing, in degrees, across the clip's keyframes,
+// • end-effector WORLD travel (hands, feet), in hip-heights, by applying every
+// retargeted keyframe to a real three.js bone graph and composing world
+// matrices. This is the honest test: a bone can be name-mapped and still not
+// move its limb if its parent chain broke, and world travel catches that.
+// • whether the clip's LeftArm/RightArm track landed on the upper arm rather
+// than the clavicle (the "arm swings from the shoulder blade" failure).
+//
+// It runs each rig down BOTH production paths:
+// ingest — canonicalizeGLBBones() first (what every stored avatar goes through:
+// api/_lib/auto-rig.js, api/_lib/reconstruct-finalize.js,
+// api/avatars/_actions.js), then retarget on the canonical names.
+// runtime — retarget straight onto the raw rig names, the path a GLB loaded
+// directly into the viewer takes.
+// Both must pass. A convention that only survives one of them is reported, not
+// hidden.
+//
+// Usage:
+// node scripts/animation-dignity-sweep.mjs # per-rig report, exit 0/1
+// node scripts/animation-dignity-sweep.mjs --json # machine-readable
+// node scripts/animation-dignity-sweep.mjs --verbose # per-limb numbers
+
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { AnimationClip, Quaternion, Vector3 } from 'three';
+
+import { canonicalizeGLBBones, canonicalizeBoneName } from '../src/glb-canonicalize.js';
+import {
+ MIN_COVERAGE,
+ canonicalNodeMapFromObject,
+ retargetClipToObject,
+} from '../src/animation-retarget.js';
+import { parseGltfJson, buildBoneGraph } from '../tests/_helpers/glb-bone-graph.js';
+
+const REPO = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+const CLIP_DIR = path.join(REPO, 'public/animations/clips');
+
+// The two clips the dignity bar is written against: a standing performance and a
+// locomotion cycle. Both are in the shipped library, both are baked from cz.glb.
+const CLIPS = ['idle', 'walk'];
+
+// ---------------------------------------------------------------------------
+// Pass thresholds
+// ---------------------------------------------------------------------------
+// A limb "moves" when its local rotation swings past this across the clip. Idle
+// is a breathing loop, so its arms travel a few degrees, not tens; walk swings
+// the whole chain. Set per clip so idle can't be passed by a rig that only walks
+// and walk can't be passed by a rig that only breathes.
+const MIN_LIMB_SWING_DEG = { idle: 1.5, walk: 8 };
+// End-effector world travel, in hip-heights. Catches a mapped bone whose parent
+// chain is broken: the rotation track is there, the hand still doesn't go
+// anywhere. Idle's hands drift; walk's hands and feet sweep.
+const MIN_EFFECTOR_TRAVEL = { idle: 0.01, walk: 0.08 };
+
+// The four limb roots whose motion is non-negotiable, with the end effector each
+// one has to carry through space.
+const LIMBS = [
+ { label: 'left arm', chain: ['LeftArm', 'LeftForeArm'], effector: 'LeftHand' },
+ { label: 'right arm', chain: ['RightArm', 'RightForeArm'], effector: 'RightHand' },
+ { label: 'left leg', chain: ['LeftUpLeg', 'LeftLeg'], effector: 'LeftFoot' },
+ { label: 'right leg', chain: ['RightUpLeg', 'RightLeg'], effector: 'RightFoot' },
+];
+
+// ---------------------------------------------------------------------------
+// Skeleton template — one plausible adult humanoid, in metres, Y up, T-pose.
+// Every convention below is this same skeleton with its bones renamed, so a
+// difference in the results is a difference in NAMING, never in proportions.
+// ---------------------------------------------------------------------------
+const FINGERS = ['Thumb', 'Index', 'Middle', 'Ring', 'Pinky'];
+
+/** @returns {Array<{ bone: string, parent: string|null, t: [number,number,number] }>} */
+function skeletonTemplate() {
+ const rows = [
+ { bone: 'Hips', parent: null, t: [0, 0.95, 0] },
+ { bone: 'Spine', parent: 'Hips', t: [0, 0.1, 0] },
+ { bone: 'Spine1', parent: 'Spine', t: [0, 0.12, 0] },
+ { bone: 'Spine2', parent: 'Spine1', t: [0, 0.12, 0] },
+ { bone: 'Neck', parent: 'Spine2', t: [0, 0.13, 0] },
+ { bone: 'Head', parent: 'Neck', t: [0, 0.1, 0] },
+ ];
+ for (const side of ['Left', 'Right']) {
+ const sx = side === 'Left' ? 1 : -1;
+ rows.push({ bone: `${side}Shoulder`, parent: 'Spine2', t: [0.04 * sx, 0.1, 0] });
+ rows.push({ bone: `${side}Arm`, parent: `${side}Shoulder`, t: [0.13 * sx, 0, 0] });
+ rows.push({ bone: `${side}ForeArm`, parent: `${side}Arm`, t: [0.28 * sx, 0, 0] });
+ rows.push({ bone: `${side}Hand`, parent: `${side}ForeArm`, t: [0.26 * sx, 0, 0] });
+ // Five finger chains of three phalanges, splayed across the palm.
+ FINGERS.forEach((finger, i) => {
+ const spread = (i - 2) * 0.018;
+ const isThumb = finger === 'Thumb';
+ rows.push({
+ bone: `${side}Hand${finger}1`,
+ parent: `${side}Hand`,
+ t: [0.04 * sx, spread, isThumb ? 0.02 * sx : 0],
+ });
+ rows.push({ bone: `${side}Hand${finger}2`, parent: `${side}Hand${finger}1`, t: [0.035 * sx, 0, 0] });
+ rows.push({ bone: `${side}Hand${finger}3`, parent: `${side}Hand${finger}2`, t: [0.028 * sx, 0, 0] });
+ });
+ rows.push({ bone: `${side}UpLeg`, parent: 'Hips', t: [0.09 * sx, -0.06, 0] });
+ rows.push({ bone: `${side}Leg`, parent: `${side}UpLeg`, t: [0, -0.42, 0] });
+ rows.push({ bone: `${side}Foot`, parent: `${side}Leg`, t: [0, -0.4, 0] });
+ rows.push({ bone: `${side}ToeBase`, parent: `${side}Foot`, t: [0, -0.07, 0.13] });
+ }
+ return rows;
+}
+
+const TEMPLATE = skeletonTemplate();
+
+// ---------------------------------------------------------------------------
+// The ten naming conventions. Each is a function canonical bone -> that rig's
+// spelling, or null when the convention genuinely has no such bone (a simple rig
+// with no upper chest, a scan rig with no toes). Omitted bones are dropped from
+// the rig and their children reparent to the nearest surviving ancestor, exactly
+// as a real export of that skeleton would.
+// ---------------------------------------------------------------------------
+const sideWord = (b) => (b.startsWith('Left') ? 'Left' : b.startsWith('Right') ? 'Right' : null);
+const stem = (b) => b.replace(/^(Left|Right)/, '');
+const lower = (b) => (b.startsWith('Left') ? 'l' : 'r');
+const upperSide = (b) => (b.startsWith('Left') ? 'L' : 'R');
+// Finger + phalanx index out of a canonical finger bone, e.g. LeftHandIndex2.
+function fingerParts(bone) {
+ const m = /^(Left|Right)Hand(Thumb|Index|Middle|Ring|Pinky)([123])$/.exec(bone);
+ return m ? { side: m[1], finger: m[2], n: Number(m[3]) } : null;
+}
+
+const CONVENTIONS = [
+ {
+ id: 'mixamo',
+ label: 'Mixamo',
+ note: 'the reference export from mixamo.com and every Adobe/Fuse pipeline',
+ name: (b) => `mixamorig:${b}`,
+ },
+ {
+ id: 'avaturn',
+ label: 'Avaturn / Ready Player Me',
+ note: 'canonical spelling, no vendor prefix — the rig the clip library was baked against',
+ name: (b) => b,
+ },
+ {
+ id: 'unreal',
+ label: 'Unreal mannequin',
+ note: 'UE4/UE5 SK_Mannequin: pelvis, clavicle_l, upperarm_l, thigh_l, index_01_l',
+ name: (b) => {
+ const f = fingerParts(b);
+ if (f) return `${f.finger.toLowerCase()}_0${f.n}_${f.side === 'Left' ? 'l' : 'r'}`;
+ const s = sideWord(b) ? (sideWord(b) === 'Left' ? '_l' : '_r') : '';
+ const map = {
+ Hips: 'pelvis', Spine: 'spine_01', Spine1: 'spine_02', Spine2: 'spine_03',
+ Neck: 'neck_01', Head: 'head',
+ Shoulder: `clavicle${s}`, Arm: `upperarm${s}`, ForeArm: `lowerarm${s}`, Hand: `hand${s}`,
+ UpLeg: `thigh${s}`, Leg: `calf${s}`, Foot: `foot${s}`, ToeBase: `ball${s}`,
+ };
+ return map[stem(b)] ?? null;
+ },
+ },
+ {
+ id: 'vrm0',
+ label: 'VRM 0.x / VRoid',
+ note: 'VRoid Studio export: J_Bip_C_Hips, J_Bip_L_UpperArm, J_Bip_L_Little1',
+ name: (b) => {
+ const f = fingerParts(b);
+ if (f) {
+ const vf = f.finger === 'Pinky' ? 'Little' : f.finger;
+ return `J_Bip_${f.side === 'Left' ? 'L' : 'R'}_${vf}${f.n}`;
+ }
+ const sd = sideWord(b) === 'Left' ? 'L' : 'R';
+ const centre = {
+ Hips: 'J_Bip_C_Hips', Spine: 'J_Bip_C_Spine', Spine1: 'J_Bip_C_Chest',
+ Spine2: 'J_Bip_C_UpperChest', Neck: 'J_Bip_C_Neck', Head: 'J_Bip_C_Head',
+ };
+ if (centre[b]) return centre[b];
+ const limb = {
+ Shoulder: 'Shoulder', Arm: 'UpperArm', ForeArm: 'LowerArm', Hand: 'Hand',
+ UpLeg: 'UpperLeg', Leg: 'LowerLeg', Foot: 'Foot', ToeBase: 'ToeBase',
+ };
+ return limb[stem(b)] ? `J_Bip_${sd}_${limb[stem(b)]}` : null;
+ },
+ },
+ {
+ id: 'vrm1',
+ label: 'VRM 1.0',
+ note: 'the 1.0 humanoid spec: leftUpperArm, leftToes, leftIndexProximal',
+ name: (b) => {
+ const f = fingerParts(b);
+ if (f) {
+ const vf = f.finger === 'Pinky' ? 'Little' : f.finger;
+ const phalanx =
+ f.finger === 'Thumb'
+ ? ['Metacarpal', 'Proximal', 'Distal'][f.n - 1]
+ : ['Proximal', 'Intermediate', 'Distal'][f.n - 1];
+ return `${f.side.toLowerCase()}${vf}${phalanx}`;
+ }
+ const centre = {
+ Hips: 'hips', Spine: 'spine', Spine1: 'chest', Spine2: 'upperChest',
+ Neck: 'neck', Head: 'head',
+ };
+ if (centre[b]) return centre[b];
+ const limb = {
+ Shoulder: 'Shoulder', Arm: 'UpperArm', ForeArm: 'LowerArm', Hand: 'Hand',
+ UpLeg: 'UpperLeg', Leg: 'LowerLeg', Foot: 'Foot', ToeBase: 'Toes',
+ };
+ const side = sideWord(b) === 'Left' ? 'left' : 'right';
+ return limb[stem(b)] ? `${side}${limb[stem(b)]}` : null;
+ },
+ },
+ {
+ id: 'daz',
+ label: 'Daz / Genesis 8',
+ note: 'Genesis figure rig: hip, abdomenUpper, lShldrBend, lThighBend, lIndex1',
+ name: (b) => {
+ const f = fingerParts(b);
+ if (f) {
+ const df = f.finger === 'Middle' ? 'Mid' : f.finger;
+ return `${f.side === 'Left' ? 'l' : 'r'}${df}${f.n}`;
+ }
+ const centre = {
+ Hips: 'hip', Spine: 'abdomenLower', Spine1: 'abdomenUpper', Spine2: 'chestUpper',
+ Neck: 'neckLower', Head: 'head',
+ };
+ if (centre[b]) return centre[b];
+ const limb = {
+ Shoulder: 'Collar', Arm: 'ShldrBend', ForeArm: 'ForearmBend', Hand: 'Hand',
+ UpLeg: 'ThighBend', Leg: 'Shin', Foot: 'Foot', ToeBase: 'Toe',
+ };
+ return limb[stem(b)] ? `${lower(b)}${limb[stem(b)]}` : null;
+ },
+ },
+ {
+ id: 'makehuman',
+ label: 'MakeHuman',
+ note: 'anatomical stems with a .L/.R side suffix: clavicle.L, upperarm.L, shin.L, finger2-1.L',
+ name: (b) => {
+ const f = fingerParts(b);
+ if (f) {
+ // MakeHuman numbers the digits 1..5 from the thumb.
+ const idx = FINGERS.indexOf(f.finger) + 1;
+ return `finger${idx}-${f.n}.${upperSide(b)}`;
+ }
+ const centre = { Hips: 'pelvis', Spine: 'spine', Spine1: 'chest', Neck: 'neck', Head: 'head' };
+ if (centre[b]) return centre[b];
+ if (b === 'Spine2') return null; // MakeHuman's default rig has no upper chest
+ const limb = {
+ Shoulder: 'clavicle', Arm: 'upperarm', ForeArm: 'forearm', Hand: 'hand',
+ UpLeg: 'thigh', Leg: 'shin', Foot: 'foot', ToeBase: 'toe',
+ };
+ return limb[stem(b)] ? `${limb[stem(b)]}.${upperSide(b)}` : null;
+ },
+ },
+ {
+ id: 'blender-rigify',
+ label: 'Blender / Rigify (.L suffix)',
+ note: 'the Blender human meta-rig: shoulder.L (clavicle) + upper_arm.L, f_index.01.L, thumb.01.L',
+ name: (b) => {
+ const f = fingerParts(b);
+ if (f) {
+ const side = upperSide(b);
+ return f.finger === 'Thumb'
+ ? `thumb.0${f.n}.${side}`
+ : `f_${f.finger.toLowerCase()}.0${f.n}.${side}`;
+ }
+ const centre = { Hips: 'hips', Spine: 'spine', Spine1: 'chest', Neck: 'neck', Head: 'head' };
+ if (centre[b]) return centre[b];
+ if (b === 'Spine2') return null;
+ const limb = {
+ Shoulder: 'shoulder', Arm: 'upper_arm', ForeArm: 'forearm', Hand: 'hand',
+ UpLeg: 'thigh', Leg: 'shin', Foot: 'foot', ToeBase: 'toe',
+ };
+ return limb[stem(b)] ? `${limb[stem(b)]}.${upperSide(b)}` : null;
+ },
+ },
+ {
+ id: 'simple',
+ label: 'Simple shoulderL rig',
+ note: 'the hand-built / hobby rig: chest, shoulderL, elbowL, wristL, hipL, kneeL, ankleL',
+ name: (b) => {
+ const f = fingerParts(b);
+ if (f) return `${f.finger.toLowerCase()}${f.n}${upperSide(b)}`;
+ const centre = { Hips: 'hips', Spine: 'waist', Spine1: 'chest', Neck: 'neck', Head: 'head' };
+ if (centre[b]) return centre[b];
+ if (b === 'Spine2') return null;
+ if (stem(b) === 'Shoulder') return null; // no clavicle on a simple rig
+ const limb = {
+ Arm: 'shoulder', ForeArm: 'elbow', Hand: 'wrist',
+ UpLeg: 'hip', Leg: 'knee', Foot: 'ankle', ToeBase: 'toe',
+ };
+ return limb[stem(b)] ? `${limb[stem(b)]}${upperSide(b)}` : null;
+ },
+ },
+ {
+ id: 'anatomical',
+ label: 'Anatomical Latin (novel)',
+ note:
+ 'the convention the canonicalizer has never seen: scan/anatomy-kit rigs named for the ' +
+ 'bones themselves — humerus.L, ulna.L, femur.L, tibia.L, index_proximal.L',
+ name: (b) => {
+ const f = fingerParts(b);
+ if (f) {
+ const af = f.finger === 'Pinky' ? 'little' : f.finger.toLowerCase();
+ const phalanx =
+ f.finger === 'Thumb'
+ ? ['metacarpal', 'proximal', 'distal'][f.n - 1]
+ : ['proximal', 'intermediate', 'distal'][f.n - 1];
+ return `${af}_${phalanx}.${upperSide(b)}`;
+ }
+ const centre = {
+ Hips: 'pelvis', Spine: 'lumbar', Spine1: 'thoracic', Spine2: 'sternum',
+ Neck: 'cervical', Head: 'cranium',
+ };
+ if (centre[b]) return centre[b];
+ const limb = {
+ Shoulder: 'scapula', Arm: 'humerus', ForeArm: 'ulna', Hand: 'carpus',
+ UpLeg: 'femur', Leg: 'tibia', Foot: 'talus', ToeBase: 'metatarsus',
+ };
+ return limb[stem(b)] ? `${limb[stem(b)]}.${upperSide(b)}` : null;
+ },
+ },
+];
+
+// ---------------------------------------------------------------------------
+// GLB construction
+// ---------------------------------------------------------------------------
+const GLB_MAGIC = 0x46546c67;
+const CHUNK_JSON = 0x4e4f534a;
+
+/**
+ * Build a minimal but structurally valid skinned GLB for one convention: the
+ * template skeleton renamed, parented under an `Armature` node, with a skin whose
+ * joints list every surviving bone. No BIN chunk is needed — the sweep drives the
+ * skeleton, and both the canonicalizer and the bone-graph reader work off the
+ * JSON chunk alone (the same slice api/_lib/glb-inspect.js reads).
+ *
+ * @param {(bone: string) => string|null} nameFor
+ * @returns {{ buffer: ArrayBuffer, present: Map<string,string> }}
+ */
+function buildRigGLB(nameFor) {
+ const present = new Map(); // canonical -> this rig's spelling
+ for (const row of TEMPLATE) {
+ const n = nameFor(row.bone);
+ if (n) present.set(row.bone, n);
+ }
+ // Nearest surviving ancestor, so dropping a clavicle reparents the upper arm
+ // onto the chest instead of orphaning the whole arm.
+ const parentOf = new Map(TEMPLATE.map((r) => [r.bone, r.parent]));
+ const survivingParent = (bone) => {
+ let p = parentOf.get(bone);
+ while (p && !present.has(p)) p = parentOf.get(p);
+ return p ?? null;
+ };
+
+ const nodes = [{ name: 'Armature', children: [] }];
+ const indexOf = new Map();
+ for (const row of TEMPLATE) {
+ if (!present.has(row.bone)) continue;
+ indexOf.set(row.bone, nodes.length);
+ nodes.push({ name: present.get(row.bone), translation: row.t });
+ }
+ for (const row of TEMPLATE) {
+ if (!present.has(row.bone)) continue;
+ const p = survivingParent(row.bone);
+ const parentIdx = p ? indexOf.get(p) : 0;
+ const node = nodes[parentIdx];
+ (node.children ||= []).push(indexOf.get(row.bone));
+ }
+ // The skinned mesh node. It carries no primitives: the sweep never rasterizes,
+ // and `skins[].joints` is what every reader in this repo keys off.
+ const meshNodeIdx = nodes.length;
+ nodes.push({ name: 'Body', skin: 0 });
+ const joints = [...indexOf.values()];
+
+ const json = {
+ asset: { version: '2.0', generator: 'three.ws animation-dignity-sweep' },
+ scene: 0,
+ scenes: [{ nodes: [0, meshNodeIdx] }],
+ nodes,
+ skins: [{ joints, skeleton: indexOf.get('Hips') }],
+ };
+
+ let jsonBytes = new TextEncoder().encode(JSON.stringify(json));
+ const pad = (4 - (jsonBytes.length % 4)) % 4;
+ if (pad) {
+ const padded = new Uint8Array(jsonBytes.length + pad);
+ padded.set(jsonBytes);
+ padded.fill(0x20, jsonBytes.length);
+ jsonBytes = padded;
+ }
+ const total = 12 + 8 + jsonBytes.length;
+ const buffer = new ArrayBuffer(total);
+ const dv = new DataView(buffer);
+ dv.setUint32(0, GLB_MAGIC, true);
+ dv.setUint32(4, 2, true);
+ dv.setUint32(8, total, true);
+ dv.setUint32(12, jsonBytes.length, true);
+ dv.setUint32(16, CHUNK_JSON, true);
+ new Uint8Array(buffer).set(jsonBytes, 20);
+ return { buffer, present };
+}
+
+function graphFromGLB(buffer) {
+ const u8 = new Uint8Array(buffer);
+ return buildBoneGraph(parseGltfJson(u8));
+}
+
+// ---------------------------------------------------------------------------
+// Measurement
+// ---------------------------------------------------------------------------
+function loadClip(name) {
+ const clip = AnimationClip.parse(JSON.parse(fs.readFileSync(path.join(CLIP_DIR, `${name}.json`), 'utf8')));
+ clip.name = name;
+ return clip;
+}
+
+const _qa = new Quaternion();
+const _qb = new Quaternion();
+
+/** Max angle (degrees) between any two keyframes of a quaternion track. */
+function trackSwingDeg(track) {
+ const v = track.values;
+ const n = v.length / 4;
+ let max = 0;
+ for (let i = 0; i < n; i++) {
+ _qa.set(v[i * 4], v[i * 4 + 1], v[i * 4 + 2], v[i * 4 + 3]);
+ for (let j = i + 1; j < n; j++) {
+ _qb.set(v[j * 4], v[j * 4 + 1], v[j * 4 + 2], v[j * 4 + 3]);
+ const a = _qa.angleTo(_qb);
+ if (a > max) max = a;
+ }
+ // A dense clip has hundreds of keys; the extremes of a cyclic motion are
+ // always reachable from the first key, so cap the inner sweep once the
+ // outer loop has walked a full cycle. Keeps the sweep O(n) in practice
+ // without weakening the measurement (the max over all pairs of a cycle is
+ // found within one period of the first key).
+ if (i > 0 && max > 0) break;
+ }
+ return (max * 180) / Math.PI;
+}
+
+/** Sample a flat keyframe array at-or-before `time` (stepped). */
+function sampleAt(track, time, stride) {
+ const times = track.times;
+ let k = 0;
+ while (k < times.length - 1 && times[k + 1] <= time) k++;
+ const off = k * stride;
+ return track.values.slice(off, off + stride);
+}
+
+/**
+ * World travel of each end effector, in hip-heights, when the retargeted clip is
+ * applied keyframe by keyframe to the real bone graph. The rig is restored to its
+ * bind pose afterwards, so one graph can be measured against several clips.
+ *
+ * @returns {Map<string, number>} canonical effector bone -> travel (hip-heights)
+ */
+function effectorTravel(root, nodeMap, clip) {
+ const bones = new Map();
+ for (const limb of LIMBS) {
+ const nodeName = nodeMap.get(limb.effector);
+ const node = nodeName ? root.getObjectByName(nodeName) : null;
+ if (node) bones.set(limb.effector, node);
+ }
+ if (bones.size === 0) return new Map();
+
+ const driven = [];
+ for (const t of clip.tracks) {
+ const dot = t.name.lastIndexOf('.');
+ const nodeName = t.name.slice(0, dot);
+ const prop = t.name.slice(dot + 1);
+ if (prop !== 'quaternion' && prop !== 'position') continue;
+ const node = root.getObjectByName(nodeName);
+ if (!node) continue;
+ driven.push({ node, prop, track: t });
+ }
+ if (driven.length === 0) return new Map();
+
+ const rest = driven.map(({ node }) => ({
+ node,
+ q: node.quaternion.clone(),
+ p: node.position.clone(),
+ }));
+
+ root.updateMatrixWorld(true);
+ const hipsName = nodeMap.get('Hips');
+ const hipsNode = hipsName ? root.getObjectByName(hipsName) : null;
+ const hipHeight = hipsNode
+ ? Math.abs(new Vector3().setFromMatrixPosition(hipsNode.matrixWorld).y) || 1
+ : 1;
+
+ const times = new Set();
+ for (const { track } of driven) for (const t of track.times) times.add(t);
+ const sorted = [...times].sort((a, b) => a - b);
+ // A 15s idle carries ~950 keys; 120 evenly-spaced samples capture the extremes
+ // of any authored motion without walking every key on every rig.
+ const step = Math.max(1, Math.ceil(sorted.length / 120));
+
+ const boxes = new Map([...bones.keys()].map((k) => [k, { min: null, max: null }]));
+ for (let i = 0; i < sorted.length; i += step) {
+ const time = sorted[i];
+ for (const { node, prop, track } of driven) {
+ if (prop === 'quaternion') {
+ const v = sampleAt(track, time, 4);
+ node.quaternion.set(v[0], v[1], v[2], v[3]);
+ } else {
+ const v = sampleAt(track, time, 3);
+ node.position.set(v[0], v[1], v[2]);
+ }
+ }
+ root.updateMatrixWorld(true);
+ for (const [key, node] of bones) {
+ const p = new Vector3().setFromMatrixPosition(node.matrixWorld);
+ const box = boxes.get(key);
+ if (!box.min) {
+ box.min = p.clone();
+ box.max = p.clone();
+ } else {
+ box.min.min(p);
+ box.max.max(p);
+ }
+ }
+ }
+
+ for (const { node, q, p } of rest) {
+ node.quaternion.copy(q);
+ node.position.copy(p);
+ }
+ root.updateMatrixWorld(true);
+
+ const out = new Map();
+ for (const [key, box] of boxes) {
+ out.set(key, box.min ? box.max.clone().sub(box.min).length() / hipHeight : 0);
+ }
+ return out;
+}
+
+/**
+ * Whether the clip's Arm track landed on the actual upper arm rather than the
+ * clavicle. Two joints in an anatomical rig (`shoulder.L` + `upper_arm.L`)
+ * normalize onto the SAME canonical name, `LeftArm`, and no name-only table can
+ * separate them: the simple hobby rig in this sweep spells its upper arm
+ * `shoulderL` too, so re-pointing that spelling at `LeftShoulder` would freeze
+ * that rig's arms instead. The ingest canonicalizer resolves it structurally
+ * (canonicalizeJointNodes pass 1.5 demotes the clavicle-spelled contender when an
+ * upper-arm-spelled one is present), which is why this only ever fires on the
+ * runtime lane. See RUNTIME_PIVOT_REMEDY.
+ */
+function armPivotCheck(nodeMap, present) {
+ const problems = [];
+ for (const side of ['Left', 'Right']) {
+ const armNode = nodeMap.get(`${side}Arm`);
+ if (!armNode) continue;
+ const claviclish = /shoulder|clavicle|collar|scapula/i.test(armNode);
+ const upperArmExists = [...present.values()].some((n) => /upper.?arm|humerus|shldr.?bend/i.test(n));
+ if (claviclish && upperArmExists) {
+ problems.push(`${side}Arm bound to "${armNode}" (a clavicle) while an upper-arm bone exists`);
+ }
+ }
+ return problems;
+}
+
+const RUNTIME_PIVOT_REMEDY =
+ 'remedy: port canonicalizeJointNodes pass 1.5/1.6 (the clavicle/upper-arm collision resolver in ' +
+ 'src/glb-canonicalize.js) into canonicalNodeMapFromObject in src/animation-retarget.js. Every avatar ' +
+ 'stored by three.ws is canonicalized at ingest (api/_lib/auto-rig.js, api/_lib/reconstruct-finalize.js, ' +
+ 'api/avatars/_actions.js, src/account.js), so this affects only a third-party GLB loaded straight into ' +
+ 'the viewer, and the arm still animates: it swings from the shoulder blade instead of the shoulder.';
+
+/**
+ * Run one rig down one lane for one clip and return the measurements.
+ *
+ * @param {{ lane: string }} ctx the lane decides whether a mis-pivoted arm is a
+ * failure (ingest, where the collision resolver runs and must have worked) or a
+ * warning (runtime, where no structural resolver exists yet).
+ */
+function measure({ root, nodeMap, present, clip, lane }) {
+ const result = retargetClipToObject(clip, root, { minCoverage: 0 });
+ const out = {
+ clip: clip.name,
+ coverage: result.coverage,
+ matched: result.matched,
+ total: result.total,
+ gatePassed: result.coverage >= MIN_COVERAGE,
+ limbs: {},
+ failures: [],
+ warnings: [],
+ };
+ if (!result.clip) {
+ out.failures.push('retarget produced no clip');
+ return out;
+ }
+
+ const byName = new Map(result.clip.tracks.map((t) => [t.name, t]));
+ const travel = effectorTravel(root, nodeMap, result.clip);
+
+ for (const limb of LIMBS) {
+ const swings = limb.chain.map((bone) => {
+ const nodeName = nodeMap.get(bone);
+ const track = nodeName ? byName.get(`${nodeName}.quaternion`) : null;
+ return { bone, node: nodeName ?? null, deg: track ? trackSwingDeg(track) : null };
+ });
+ const best = Math.max(...swings.map((s) => s.deg ?? 0));
+ const effectorNode = nodeMap.get(limb.effector);
+ const moved = travel.get(limb.effector) ?? 0;
+ out.limbs[limb.label] = {
+ swingDeg: best,
+ swings,
+ effector: limb.effector,
+ effectorNode: effectorNode ?? null,
+ travelHipHeights: moved,
+ };
+ if (best < MIN_LIMB_SWING_DEG[clip.name]) {
+ out.failures.push(
+ `${limb.label}: rotation swing ${best.toFixed(2)}deg is below the ${MIN_LIMB_SWING_DEG[clip.name]}deg floor` +
+ (swings.every((s) => s.deg === null) ? ' (no bone in the chain name-mapped)' : ''),
+ );
+ }
+ if (moved < MIN_EFFECTOR_TRAVEL[clip.name]) {
+ out.failures.push(
+ `${limb.label}: ${limb.effector} travels ${moved.toFixed(4)} hip-heights, below the ${MIN_EFFECTOR_TRAVEL[clip.name]} floor`,
+ );
+ }
+ }
+
+ if (!out.gatePassed) {
+ out.failures.push(
+ `coverage ${(result.coverage * 100).toFixed(1)}% is below the MIN_COVERAGE gate (${MIN_COVERAGE * 100}%), so production builds no action at all`,
+ );
+ }
+ for (const p of armPivotCheck(nodeMap, present)) {
+ if (lane === 'ingest') out.failures.push(p);
+ else out.warnings.push(`${p}. ${RUNTIME_PIVOT_REMEDY}`);
+ }
+ return out;
+}
+
+/** Run every clip for one convention down one lane. */
+function runLane({ buffer, present, lane }) {
+ const { root } = graphFromGLB(buffer);
+ const nodeMap = canonicalNodeMapFromObject(root);
+ const clips = CLIPS.map((name) => measure({ root, nodeMap, present, clip: loadClip(name), lane }));
+ return {
+ lane,
+ mappedBones: nodeMap.size,
+ clips,
+ pass: clips.every((c) => c.failures.length === 0),
+ warnings: clips.reduce((n, c) => n + c.warnings.length, 0),
+ };
+}
+
+function runConvention(conv) {
+ const { buffer, present } = buildRigGLB(conv.name);
+ const ingest = canonicalizeGLBBones(buffer);
+ return {
+ id: conv.id,
+ label: conv.label,
+ note: conv.note,
+ bones: present.size,
+ renamedByIngest: ingest.renamed,
+ unmappedNames: [...present.entries()]
+ .filter(([, spelling]) => canonicalizeBoneName(spelling) === null)
+ .map(([canonical, spelling]) => `${spelling} (should be ${canonical})`),
+ lanes: [
+ runLane({ buffer: ingest.buffer, present, lane: 'ingest' }),
+ runLane({ buffer, present, lane: 'runtime' }),
+ ],
+ };
+}
+
+// ---------------------------------------------------------------------------
+// Report
+// ---------------------------------------------------------------------------
+function main() {
+ const argv = process.argv.slice(2);
+ const asJson = argv.includes('--json');
+ const verbose = argv.includes('--verbose');
+
+ const results = CONVENTIONS.map(runConvention);
+ const failed = results.filter((r) => !r.lanes.every((l) => l.pass));
+
+ if (asJson) {
+ process.stdout.write(
+ JSON.stringify(
+ {
+ generatedAt: new Date().toISOString(),
+ minCoverage: MIN_COVERAGE,
+ thresholds: { swingDeg: MIN_LIMB_SWING_DEG, travelHipHeights: MIN_EFFECTOR_TRAVEL },
+ conventions: results,
+ passed: results.length - failed.length,
+ total: results.length,
+ },
+ null,
+ 2,
+ ) + '\n',
+ );
+ process.exit(failed.length === 0 ? 0 : 1);
+ }
+
+ console.log('Animation dignity sweep — idle + walk on 10 bone-naming conventions');
+ console.log(`clips: ${CLIPS.join(', ')} coverage gate: ${(MIN_COVERAGE * 100).toFixed(0)}%`);
+ console.log(
+ `limb floors: rotation swing idle >= ${MIN_LIMB_SWING_DEG.idle}deg / walk >= ${MIN_LIMB_SWING_DEG.walk}deg; ` +
+ `effector travel idle >= ${MIN_EFFECTOR_TRAVEL.idle} / walk >= ${MIN_EFFECTOR_TRAVEL.walk} hip-heights`,
+ );
+ console.log('');
+
+ for (const r of results) {
+ const ok = r.lanes.every((l) => l.pass);
+ console.log(`${ok ? 'PASS' : 'FAIL'} ${r.label} (${r.bones} bones, ingest renamed ${r.renamedByIngest})`);
+ console.log(` ${r.note}`);
+ for (const lane of r.lanes) {
+ const laneClips = lane.clips
+ .map((c) => `${c.clip} ${(c.coverage * 100).toFixed(0)}%`)
+ .join(' ');
+ const laneMark = lane.pass ? (lane.warnings ? 'warn' : 'ok ') : 'BAD ';
+ console.log(` ${laneMark} ${lane.lane.padEnd(7)} ${laneClips} mapped ${lane.mappedBones} bones`);
+ for (const c of lane.clips) {
+ if (verbose) {
+ for (const [label, m] of Object.entries(c.limbs)) {
+ console.log(
+ ` ${c.clip} ${label.padEnd(10)} swing ${m.swingDeg.toFixed(1).padStart(6)}deg ` +
+ `${m.effector} travel ${m.travelHipHeights.toFixed(3)}`,
+ );
+ }
+ }
+ for (const f of c.failures) console.log(` ${c.clip}: ${f}`);
+ }
+ // Warnings repeat identically per clip; print the distinct set once.
+ for (const w of new Set(lane.clips.flatMap((c) => c.warnings))) {
+ console.log(` warning: ${w}`);
+ }
+ }
+ if (r.unmappedNames.length) {
+ const shown = r.unmappedNames.slice(0, 6).join(', ');
+ console.log(
+ ` unmapped spellings (${r.unmappedNames.length}): ${shown}${r.unmappedNames.length > 6 ? ', ...' : ''}`,
+ );
+ }
+ console.log('');
+ }
+
+ const warned = results.filter((r) => r.lanes.some((l) => l.warnings > 0));
+ console.log(`${results.length - failed.length}/${results.length} conventions animate both arms and both legs on both lanes.`);
+ if (failed.length) {
+ console.log('Failing: ' + failed.map((f) => f.label).join(', '));
+ }
+ if (warned.length) {
+ console.log('With warnings: ' + warned.map((w) => w.label).join(', '));
+ }
+ process.exit(failed.length === 0 ? 0 : 1);
+}
+
+main();
diff --git a/scripts/avatar-likeness-audit.mjs b/scripts/avatar-likeness-audit.mjs
new file mode 100644
index 000000000..3c35c0f7e
--- /dev/null
+++ b/scripts/avatar-likeness-audit.mjs
@@ -0,0 +1,632 @@
+#!/usr/bin/env node
+// Avatar likeness audit (prompts/quality-bar/10-avatar-likeness-irl-people.md, task 1/7).
+//
+// Fires six SYNTHETIC personas through the REAL production avatar chain on
+// https://three.ws twice each — once on the Standard tier (the "before": the
+// lane the public MCP studio avatar tools actually request today) and once on
+// the High tier (the "after": the only tier whose router mapping reaches the
+// self-hosted Hunyuan3D lane) — then renders the canonical views with the same
+// headless three.js renderer the platform uses for avatar thumbnails
+// (api/_lib/render-clip.js) and scores every view with Vertex Gemini vision
+// using the bench's own judge prompt (api/_lib/quality-bench.js, imported
+// read-only).
+//
+// Nothing here forks the pipeline: the generate/poll/rig calls are the same
+// HTTP contract api/_mcp-studio/forge-client.js speaks (POST /api/forge,
+// GET /api/forge?job=, POST /api/forge?action=rig), carrying the same internal
+// seed header (x-forge-seed: CRON_SECRET) that lets platform-originated studio
+// traffic run the operator-funded High tier.
+//
+// Usage:
+// node scripts/avatar-likeness-audit.mjs [--cases=a,b] [--concurrency=2]
+// [--base-url=https://three.ws] [--skip-generate] [--skip-render] [--skip-judge]
+//
+// Credentials (never committed): CRON_SECRET for the internal seed header and
+// GCP_SERVICE_ACCOUNT_JSON for the Vertex judge. Both are read from the process
+// env; AVATAR_AUDIT_SA_FILE may point at a service-account JSON file instead.
+//
+// Output: prompts/quality-bar/_generated/10/ — one PNG per rendered view plus
+// audit-data.json (the full, resumable evidence record). Re-running resumes:
+// a case that already has a finished GLB is never re-generated.
+
+import { readFile, writeFile, mkdir } from 'node:fs/promises';
+import { existsSync, readFileSync } from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+const ROOT = path.resolve(__dirname, '..');
+const OUT_DIR = path.join(ROOT, 'prompts', 'quality-bar', '_generated', '10');
+const DATA_FILE = path.join(OUT_DIR, 'audit-data.json');
+
+// ---------------------------------------------------------------------------
+// Env: .env for local credentials, plus an optional SA key file for Vertex.
+// ---------------------------------------------------------------------------
+// Values already present in the environment win, so a caller can override any
+// local .env key (e.g. pointing CRON_SECRET at the deployment's own secret)
+// without editing the file.
+function loadDotEnv() {
+ const file = path.join(ROOT, '.env');
+ if (!existsSync(file)) return;
+ for (const line of readFileSync(file, 'utf8').split('\n')) {
+ const m = line.match(/^([A-Z0-9_]+)=(.*)$/);
+ if (!m) continue;
+ const [, k, raw] = m;
+ if (process.env[k]) continue;
+ process.env[k] = raw.replace(/^["']|["']$/g, '').trim();
+ }
+}
+
+// ---------------------------------------------------------------------------
+// The six cases. Every persona is SYNTHETIC — a described archetype, never a
+// real named individual. Cases (e) and (f) stand in for the prompt spec's two
+// CC0 reference-photo cases: see audit.md for why the photo leg was substituted.
+// `watch` feeds the judge's per-subject failure-mode checklist, matching the
+// shape data/quality-bench/prompts.json uses.
+// ---------------------------------------------------------------------------
+const HUMAN_WATCH = [
+ 'fused, missing, or extra fingers; hands melted into blobs or into the hips',
+ 'melted or asymmetric face; eyes at different heights; no visible iris detail',
+ 'plastic/mannequin skin with no pores or subsurface response',
+ 'hair as one solid painted cap instead of strands',
+ 'texture seams or color breaks at the neck and hairline',
+ 'limbs fused to the torso, or feet melted into a single base',
+];
+
+const CASES = [
+ {
+ id: 'a',
+ label: 'Athlete',
+ subjectClass: 'person',
+ stylized: false,
+ prompt:
+ 'A synthetic persona, not a real person: a professional sprinter in her late twenties, lean muscular build, ' +
+ 'short natural curls, wearing a fitted team tracksuit and running shoes, standing relaxed with arms slightly ' +
+ 'away from the body and hands open, fingers separated.',
+ watch: HUMAN_WATCH,
+ },
+ {
+ id: 'b',
+ label: 'Grandmother',
+ subjectClass: 'person',
+ stylized: false,
+ prompt:
+ 'A synthetic persona, not a real person: a grandmother in her seventies, soft build, silver hair pinned in a ' +
+ 'bun, reading glasses, wearing a knitted cardigan over a floral blouse and a long skirt with flat shoes, ' +
+ 'standing relaxed with arms slightly away from the body and hands open, fingers separated.',
+ watch: HUMAN_WATCH.concat(['skin that reads as a smooth young mannequin instead of a real older face with creases']),
+ },
+ {
+ id: 'c',
+ label: 'Stylized kid (child-safe)',
+ subjectClass: 'person',
+ stylized: true,
+ prompt:
+ 'A clearly stylized cartoon toy character of a child: chunky vinyl-figure proportions, oversized round head, ' +
+ 'simple mitten-like hands, matte toy-plastic finish with visible seam lines, painted-on facial features, ' +
+ 'wearing dungarees and a striped shirt, standing upright with arms slightly away from the body. Deliberately ' +
+ 'non-photoreal: a collectible vinyl figure, never a photographic human child.',
+ watch: [
+ 'any drift toward a photoreal human child instead of a clearly-stylized vinyl toy',
+ 'mitten hands melted into the body',
+ 'fused limbs or a melted face',
+ 'muddy, low-resolution toy-plastic texture',
+ ],
+ },
+ {
+ id: 'd',
+ label: 'Businessperson',
+ subjectClass: 'person',
+ stylized: false,
+ prompt:
+ 'A synthetic persona, not a real person: a businessman in his forties, average build, short dark hair, ' +
+ 'clean-shaven, wearing a navy two-piece wool suit over a white shirt with an open collar and polished black ' +
+ 'leather shoes, standing relaxed with arms slightly away from the body and hands open, fingers separated.',
+ watch: HUMAN_WATCH.concat(['suit rendered as painted-on color instead of wool cloth with lapel and seam geometry']),
+ },
+ {
+ id: 'e',
+ label: 'Construction worker in workwear',
+ subjectClass: 'person',
+ stylized: false,
+ prompt:
+ 'A synthetic persona, not a real person: a construction worker in his fifties, stocky build, weathered face, ' +
+ 'wearing a yellow high-visibility vest with reflective bands over a grey long-sleeve shirt, heavy canvas work ' +
+ 'trousers, a white hard hat and scuffed steel-toe boots, standing relaxed with arms slightly away from the ' +
+ 'body and hands open, fingers separated.',
+ watch: HUMAN_WATCH.concat(['hard hat fused into the skull instead of sitting as a separate shell', 'reflective bands baked as flat stripes with no material change']),
+ },
+ {
+ id: 'f',
+ label: 'Dancer mid-pose',
+ subjectClass: 'person',
+ stylized: false,
+ prompt:
+ 'A synthetic persona, not a real person: a contemporary dancer in her thirties, tall athletic build, hair tied ' +
+ 'back, wearing a fitted dark leotard and a loose wrap skirt with bare feet, standing tall in a poised neutral ' +
+ 'stance with one arm raised slightly to the side and both hands open, fingers separated and clearly visible.',
+ watch: HUMAN_WATCH.concat(['the raised arm fused to the head or torso', 'wrap skirt fused into the legs as one solid block']),
+ },
+];
+
+// Standard is the BEFORE lane, High the AFTER lane: on the live router
+// (/api/forge?catalog) the image path maps standard -> trellis_selfhost and
+// high -> hunyuan3d, so the tier switch is exactly the lane switch this
+// campaign is measuring.
+const VARIANTS = [
+ { id: 'before', tier: 'standard' },
+ { id: 'after', tier: 'high' },
+];
+
+// Front / three-quarter / side are the bench's canonical judged views. The
+// fourth, "hands", is evidence-only: a near-eye-level three-quarter framing
+// where both hands sit in frame so fingers can be counted per case.
+const HANDS_VIEW = { label: 'hands', theta: 25, phi: 88, width: 1536, height: 1536 };
+
+const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
+
+function parseArgs(argv) {
+ const args = {
+ cases: 'all',
+ baseUrl: 'https://three.ws',
+ concurrency: 2,
+ skipGenerate: false,
+ skipRender: false,
+ skipJudge: false,
+ };
+ for (const raw of argv) {
+ const [k, ...rest] = raw.replace(/^--/, '').split('=');
+ const v = rest.join('=');
+ if (k === 'cases') args.cases = v;
+ else if (k === 'base-url') args.baseUrl = v;
+ else if (k === 'concurrency') args.concurrency = Math.max(1, Number(v) || 2);
+ else if (k === 'skip-generate') args.skipGenerate = true;
+ else if (k === 'skip-render') args.skipRender = true;
+ else if (k === 'skip-judge') args.skipJudge = true;
+ }
+ return args;
+}
+
+// ---------------------------------------------------------------------------
+// Forge HTTP client — same contract as api/_mcp-studio/forge-client.js.
+// ---------------------------------------------------------------------------
+function internalHeaders() {
+ const secret = process.env.CRON_SECRET;
+ return secret ? { 'x-forge-seed': secret } : {};
+}
+
+async function submitForge(baseUrl, payload) {
+ const res = await fetch(`${baseUrl}/api/forge`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json', ...internalHeaders() },
+ body: JSON.stringify(payload),
+ signal: AbortSignal.timeout(120_000),
+ });
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok && !(data?.status === 'done' && data?.glb_url)) {
+ throw new Error(`forge submit ${res.status}: ${data?.error || data?.message || 'no body'}`);
+ }
+ if (!data?.job_id && !(data?.status === 'done' && data?.glb_url)) {
+ throw new Error(`forge submit returned no job handle: ${JSON.stringify(data).slice(0, 300)}`);
+ }
+ return data;
+}
+
+async function startRig(baseUrl, glbUrl) {
+ const res = await fetch(`${baseUrl}/api/forge?action=rig`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json', ...internalHeaders() },
+ body: JSON.stringify({ glb_url: glbUrl }),
+ signal: AbortSignal.timeout(60_000),
+ });
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok || !data?.job_id) {
+ throw new Error(`rig start ${res.status}: ${data?.error || data?.message || 'no body'}`);
+ }
+ return data;
+}
+
+async function pollJob(baseUrl, jobId, { timeoutMs = 900_000, intervalMs = 5_000 } = {}) {
+ const deadline = Date.now() + timeoutMs;
+ while (Date.now() < deadline) {
+ let data;
+ try {
+ const res = await fetch(`${baseUrl}/api/forge?job=${encodeURIComponent(jobId)}`, {
+ headers: { accept: 'application/json' },
+ signal: AbortSignal.timeout(30_000),
+ });
+ data = await res.json().catch(() => ({}));
+ if (!res.ok) throw new Error(`poll ${res.status}: ${data?.error || data?.message || ''}`);
+ } catch (err) {
+ if (err?.name === 'TimeoutError' || err?.name === 'AbortError') {
+ await sleep(intervalMs);
+ continue;
+ }
+ throw err;
+ }
+ if (data.status === 'done' && data.glb_url) return data;
+ if (data.status === 'failed') throw new Error(`job failed: ${data.error || 'generation failed'}`);
+ await sleep(intervalMs);
+ }
+ throw new Error(`job ${jobId} did not finish within ${timeoutMs}ms`);
+}
+
+async function generate(baseUrl, payload) {
+ const job = await submitForge(baseUrl, payload);
+ if (job.status === 'done' && job.glb_url) return job;
+ const done = await pollJob(baseUrl, job.job_id);
+ return { ...job, ...done };
+}
+
+// ---------------------------------------------------------------------------
+// Art director — the platform's own avatar director instruction
+// (api/_lib/forge-director-prompts.js) run over the deployment's public /api/chat
+// free chain, exactly like mcp-server's directPrompt does. Vertex Gemini is the
+// fallback rung so a throttled free chain can't silently strip the photoreal
+// briefing from the audit. Returns { text, via } or null (fail-soft: the caller
+// then forges the raw persona prompt, never a fabricated one).
+// ---------------------------------------------------------------------------
+async function directViaChat(baseUrl, instruction, rawPrompt) {
+ let res;
+ try {
+ res = await fetch(`${baseUrl}/api/chat`, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json', accept: 'text/event-stream' },
+ body: JSON.stringify({ message: `${instruction}\n\nIdea: ${rawPrompt}` }),
+ signal: AbortSignal.timeout(60_000),
+ });
+ } catch {
+ return null;
+ }
+ if (!res.ok || !res.body) return null;
+ let acc = '';
+ try {
+ const reader = res.body.getReader();
+ const decoder = new TextDecoder();
+ let buf = '';
+ for (;;) {
+ const { value, done } = await reader.read();
+ if (done) break;
+ buf += decoder.decode(value, { stream: true });
+ const lines = buf.split('\n');
+ buf = lines.pop() ?? '';
+ for (const line of lines) {
+ if (!line.startsWith('data: ')) continue;
+ let evt;
+ try {
+ evt = JSON.parse(line.slice(6));
+ } catch {
+ continue;
+ }
+ if (evt.type === 'chunk' && typeof evt.text === 'string') acc += evt.text;
+ else if (evt.type === 'error') return null;
+ else if (evt.type === 'done' && typeof evt.text === 'string' && !acc) acc = evt.text;
+ }
+ }
+ } catch {
+ return null;
+ }
+ return cleanDirected(acc);
+}
+
+async function directViaVertex(instruction, rawPrompt) {
+ const { vertexGeminiChatUrl, vertexGeminiHeaders } = await import('../api/_lib/vertex-gemini.js');
+ const headers = await vertexGeminiHeaders();
+ const res = await fetch(vertexGeminiChatUrl(), {
+ method: 'POST',
+ headers,
+ body: JSON.stringify({
+ model: 'google/gemini-2.5-flash',
+ temperature: 0.4,
+ max_tokens: 1200,
+ messages: [
+ { role: 'system', content: instruction },
+ { role: 'user', content: `Idea: ${rawPrompt}` },
+ ],
+ }),
+ signal: AbortSignal.timeout(90_000),
+ });
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok) throw new Error(`vertex director ${res.status}: ${JSON.stringify(data).slice(0, 200)}`);
+ return cleanDirected(data?.choices?.[0]?.message?.content || '');
+}
+
+function cleanDirected(text) {
+ if (!text) return null;
+ const firstLine = String(text).trim().split('\n').filter(Boolean)[0]?.trim() || '';
+ const refined = firstLine.replace(/^["'“”]+|["'“”]+$/g, '').trim();
+ return refined.length >= 3 && refined.length <= 1000 ? refined : null;
+}
+
+async function directPrompt(baseUrl, instruction, rawPrompt) {
+ const viaChat = await directViaChat(baseUrl, instruction, rawPrompt);
+ if (viaChat) return { text: viaChat, via: 'prod /api/chat free chain' };
+ try {
+ const viaVertex = await directViaVertex(instruction, rawPrompt);
+ if (viaVertex) return { text: viaVertex, via: 'vertex gemini-2.5-flash (chat chain returned nothing)' };
+ } catch (err) {
+ return { text: null, via: null, error: err.message };
+ }
+ return { text: null, via: null, error: 'director produced no usable line' };
+}
+
+// ---------------------------------------------------------------------------
+// Judge — the bench's own prompt/model, with a token budget wide enough for a
+// reasoning model. api/_lib/quality-bench.js caps replies at 700 tokens, which
+// gemini-2.5-pro spends on internal reasoning before emitting the JSON, so its
+// judgeOnce() truncates mid-object; this local call keeps the identical prompt
+// and model and only widens max_tokens. Throws on any failure — a failed score
+// is recorded as failed, never invented.
+// ---------------------------------------------------------------------------
+const JUDGE_MAX_TOKENS = 4096;
+
+function parseJudgeJson(text) {
+ const trimmed = String(text || '').trim().replace(/^```(?:json)?\s*/i, '').replace(/\s*```$/, '');
+ const start = trimmed.search(/[{[]/);
+ const candidate = start >= 0 ? trimmed.slice(start) : trimmed;
+ const parsed = JSON.parse(candidate);
+ for (const k of ['photorealism', 'geometryIntegrity', 'textureFidelity', 'promptAdherence']) {
+ const n = Number(parsed[k]);
+ if (!Number.isFinite(n)) throw new Error(`judge reply missing numeric ${k}`);
+ parsed[k] = Math.max(1, Math.min(10, n));
+ }
+ if (typeof parsed.critique !== 'string') parsed.critique = '';
+ return parsed;
+}
+
+async function judgeView({ png, promptEntry, viewLabel }) {
+ const { buildJudgePrompt, JUDGE_MODEL } = await import('../api/_lib/quality-bench.js');
+ const { vertexGeminiAvailable, vertexGeminiChatUrl, vertexGeminiHeaders } = await import('../api/_lib/vertex-gemini.js');
+ if (!vertexGeminiAvailable()) {
+ throw Object.assign(new Error('Vertex Gemini unavailable: GOOGLE_CLOUD_PROJECT is not set'), { code: 'judge_unconfigured' });
+ }
+ const headers = await vertexGeminiHeaders();
+ const body = {
+ model: JUDGE_MODEL,
+ temperature: 0,
+ max_tokens: JUDGE_MAX_TOKENS,
+ messages: [
+ {
+ role: 'user',
+ content: [
+ { type: 'text', text: buildJudgePrompt({ ...promptEntry, viewLabel }) },
+ { type: 'image_url', image_url: { url: `data:image/png;base64,${png.toString('base64')}` } },
+ ],
+ },
+ ],
+ };
+ const res = await fetch(vertexGeminiChatUrl(), {
+ method: 'POST',
+ headers,
+ body: JSON.stringify(body),
+ signal: AbortSignal.timeout(180_000),
+ });
+ const data = await res.json().catch(() => ({}));
+ if (!res.ok) throw new Error(`judge call ${res.status}: ${JSON.stringify(data).slice(0, 300)}`);
+ const parsed = parseJudgeJson(data?.choices?.[0]?.message?.content || '');
+ return { ...parsed, modelVersion: data?.model || JUDGE_MODEL };
+}
+
+function avgScores(scores) {
+ const dims = ['photorealism', 'geometryIntegrity', 'textureFidelity', 'promptAdherence'];
+ const out = {};
+ for (const d of dims) out[d] = scores.reduce((s, x) => s + x[d], 0) / scores.length;
+ out.mean = dims.reduce((s, d) => s + out[d], 0) / dims.length;
+ return out;
+}
+
+// ---------------------------------------------------------------------------
+// Evidence record (resumable).
+// ---------------------------------------------------------------------------
+async function loadData() {
+ if (!existsSync(DATA_FILE)) {
+ return {
+ startedAt: new Date().toISOString(),
+ finishedAt: null,
+ baseUrl: null,
+ cases: {},
+ };
+ }
+ return JSON.parse(await readFile(DATA_FILE, 'utf8'));
+}
+
+let _saveQueue = Promise.resolve();
+function saveData(data) {
+ _saveQueue = _saveQueue.then(async () => {
+ await mkdir(OUT_DIR, { recursive: true });
+ await writeFile(DATA_FILE, JSON.stringify(data, null, '\t') + '\n', 'utf8');
+ });
+ return _saveQueue;
+}
+
+function log(...parts) {
+ console.log(`[${new Date().toISOString().slice(11, 19)}]`, ...parts);
+}
+
+// ---------------------------------------------------------------------------
+// Per-case pipeline.
+// ---------------------------------------------------------------------------
+async function runCase(args, data, testCase) {
+ const rec = (data.cases[testCase.id] ??= {
+ id: testCase.id,
+ label: testCase.label,
+ prompt: testCase.prompt,
+ subjectClass: testCase.subjectClass,
+ stylized: testCase.stylized,
+ variants: {},
+ });
+
+ // 1. Director pass (shared by both variants so tier is the only difference).
+ if (!rec.directed && !args.skipGenerate) {
+ const { avatarDirectorFor } = await import('../api/_lib/forge-director-prompts.js');
+ const directed = await directPrompt(args.baseUrl, avatarDirectorFor('person'), testCase.prompt);
+ rec.directed = directed.text || null;
+ rec.directedVia = directed.via || null;
+ rec.directorError = directed.error || null;
+ await saveData(data);
+ log(`case ${testCase.id}: director ${rec.directed ? `ok via ${rec.directedVia}` : `FAILED (${rec.directorError}) — forging the raw persona prompt`}`);
+ }
+ const forgePrompt = rec.directed || testCase.prompt;
+
+ for (const variant of VARIANTS) {
+ const vrec = (rec.variants[variant.id] ??= { id: variant.id, tierRequested: variant.tier, views: {} });
+
+ // 2. Generate the mesh.
+ if (!vrec.glbUrl && !args.skipGenerate) {
+ const started = Date.now();
+ try {
+ const job = await generate(args.baseUrl, {
+ prompt: forgePrompt,
+ aspect_ratio: '1:1',
+ tier: variant.tier,
+ });
+ vrec.glbUrl = job.glb_url;
+ vrec.backend = job.backend ?? null;
+ vrec.tierServed = job.tier ?? null;
+ vrec.previewImageUrl = job.preview_image_url ?? null;
+ vrec.creationId = job.creation_id ?? null;
+ vrec.generationMs = Date.now() - started;
+ vrec.error = null;
+ } catch (err) {
+ vrec.error = err.message;
+ vrec.generationMs = Date.now() - started;
+ }
+ await saveData(data);
+ log(`case ${testCase.id}/${variant.id}: ${vrec.glbUrl ? `mesh ok backend=${vrec.backend} ${Math.round(vrec.generationMs / 1000)}s` : `GENERATION FAILED: ${vrec.error}`}`);
+ }
+ if (!vrec.glbUrl) continue;
+
+ // 3. Rig the after-lane mesh (the animation-ready avatar path).
+ if (variant.id === 'after' && !vrec.riggedGlbUrl && !vrec.rigError && !args.skipGenerate) {
+ const started = Date.now();
+ try {
+ const rigJob = await startRig(args.baseUrl, vrec.glbUrl);
+ const rigged = await pollJob(args.baseUrl, rigJob.job_id, { timeoutMs: 600_000 });
+ vrec.riggedGlbUrl = rigged.glb_url;
+ vrec.rigMs = Date.now() - started;
+ } catch (err) {
+ vrec.rigError = err.message;
+ vrec.rigMs = Date.now() - started;
+ }
+ await saveData(data);
+ log(`case ${testCase.id}/${variant.id}: ${vrec.riggedGlbUrl ? `rig ok ${Math.round(vrec.rigMs / 1000)}s` : `RIG FAILED: ${vrec.rigError}`}`);
+ }
+
+ // 4. Render the canonical views + the hands evidence view.
+ if (!args.skipRender) {
+ const { renderClip } = await import('../api/_lib/render-clip.js');
+ const { CANONICAL_VIEWS, RENDER_BACKGROUND } = await import('../api/_lib/quality-bench.js');
+ const views = [...CANONICAL_VIEWS.map((v) => ({ ...v, width: 1024, height: 1024 })), HANDS_VIEW];
+ for (const view of views) {
+ const vv = (vrec.views[view.label] ??= {});
+ const file = `${testCase.id}-${variant.id}-${view.label}.png`;
+ if (vv.file && existsSync(path.join(OUT_DIR, file))) continue;
+ try {
+ const { png } = await renderClip({
+ glbUrl: vrec.glbUrl,
+ width: view.width,
+ height: view.height,
+ background: RENDER_BACKGROUND,
+ cameraOrbit: { theta: view.theta, phi: view.phi },
+ });
+ await mkdir(OUT_DIR, { recursive: true });
+ await writeFile(path.join(OUT_DIR, file), png);
+ vv.file = file;
+ vv.renderError = null;
+ } catch (err) {
+ vv.renderError = err.message;
+ }
+ await saveData(data);
+ }
+ log(`case ${testCase.id}/${variant.id}: rendered ${Object.values(vrec.views).filter((v) => v.file).length}/${views.length} views`);
+ }
+
+ // 5. Judge the three canonical views, twice each (bench protocol).
+ if (!args.skipJudge) {
+ const { CANONICAL_VIEWS } = await import('../api/_lib/quality-bench.js');
+ const promptEntry = { prompt: testCase.prompt, subjectClass: testCase.subjectClass, watch: testCase.watch };
+ for (const view of CANONICAL_VIEWS) {
+ const vv = vrec.views[view.label];
+ if (!vv?.file || vv.avg) continue;
+ try {
+ const png = await readFile(path.join(OUT_DIR, vv.file));
+ const scores = [];
+ for (let i = 0; i < 2; i += 1) scores.push(await judgeView({ png, promptEntry, viewLabel: view.label }));
+ vv.scores = scores;
+ vv.avg = avgScores(scores);
+ vv.judgeError = null;
+ } catch (err) {
+ vv.judgeError = err.message;
+ }
+ await saveData(data);
+ }
+ const judged = Object.values(vrec.views).filter((v) => v.avg);
+ vrec.meanScore = judged.length ? judged.reduce((s, v) => s + v.avg.mean, 0) / judged.length : null;
+ vrec.dimMeans = judged.length
+ ? avgScores(judged.map((v) => ({
+ photorealism: v.avg.photorealism,
+ geometryIntegrity: v.avg.geometryIntegrity,
+ textureFidelity: v.avg.textureFidelity,
+ promptAdherence: v.avg.promptAdherence,
+ })))
+ : null;
+ await saveData(data);
+ log(`case ${testCase.id}/${variant.id}: mean ${vrec.meanScore == null ? 'n/a (judge failed)' : vrec.meanScore.toFixed(2)}`);
+ }
+ }
+}
+
+async function pool(items, size, worker) {
+ const queue = [...items];
+ const runners = Array.from({ length: Math.min(size, queue.length) }, async () => {
+ for (;;) {
+ const item = queue.shift();
+ if (!item) return;
+ await worker(item);
+ }
+ });
+ await Promise.all(runners);
+}
+
+async function main() {
+ loadDotEnv();
+ if (process.env.AVATAR_AUDIT_SA_FILE && existsSync(process.env.AVATAR_AUDIT_SA_FILE)) {
+ process.env.GCP_SERVICE_ACCOUNT_JSON = await readFile(process.env.AVATAR_AUDIT_SA_FILE, 'utf8');
+ }
+ const args = parseArgs(process.argv.slice(2));
+ const selected = args.cases === 'all' ? CASES : CASES.filter((c) => args.cases.split(',').includes(c.id));
+ if (!selected.length) throw new Error(`no cases matched --cases=${args.cases}`);
+
+ const data = await loadData();
+ data.baseUrl = args.baseUrl;
+ data.variants = VARIANTS;
+ data.judge = { model: (await import('../api/_lib/quality-bench.js')).JUDGE_MODEL, maxTokens: JUDGE_MAX_TOKENS, callsPerView: 2 };
+ await saveData(data);
+
+ log(`avatar likeness audit: ${selected.length} cases x ${VARIANTS.length} tiers against ${args.baseUrl} (concurrency ${args.concurrency})`);
+ if (!process.env.CRON_SECRET) log('WARNING: CRON_SECRET is unset — the High tier will 402 on the $THREE holder gate');
+
+ await pool(selected, args.concurrency, (c) => runCase(args, data, c).catch((err) => {
+ data.cases[c.id] = { ...(data.cases[c.id] || {}), fatalError: err.message };
+ return saveData(data);
+ }));
+
+ data.finishedAt = new Date().toISOString();
+ await saveData(data);
+
+ console.log('\ncase before(std) after(high) delta');
+ for (const c of selected) {
+ const rec = data.cases[c.id] || {};
+ const b = rec.variants?.before?.meanScore;
+ const a = rec.variants?.after?.meanScore;
+ const fmt = (n) => (typeof n === 'number' ? n.toFixed(2).padStart(5) : ' n/a ');
+ const delta = typeof a === 'number' && typeof b === 'number' ? (a - b).toFixed(2).padStart(6) : ' n/a';
+ console.log(`${c.id} ${fmt(b)} ${fmt(a)} ${delta}`);
+ }
+ log(`evidence -> ${DATA_FILE}`);
+}
+
+main().catch((err) => {
+ console.error('avatar-likeness-audit failed:', err.stack || err.message);
+ process.exitCode = 1;
+});
diff --git a/scripts/check-cron-drift.mjs b/scripts/check-cron-drift.mjs
new file mode 100644
index 000000000..3f3e53c8e
--- /dev/null
+++ b/scripts/check-cron-drift.mjs
@@ -0,0 +1,203 @@
+#!/usr/bin/env node
+// Verify that the cron schedules declared in vercel.json are (a) valid cron
+// expressions and (b) actually what Cloud Scheduler is running.
+//
+// vercel.json is a LIVE config file: the Express server reads its `routes`, and
+// `scripts/create-gcp-scheduler.mjs` seeds Cloud Scheduler from its `crons`.
+// But nothing verified the two stayed in agreement. A schedule edited in
+// vercel.json without a re-sync, a job paused by hand during an incident and
+// never resumed, or a job deleted outright, all fail silently: the declared
+// config looks right while the job never fires.
+//
+// Usage:
+// node scripts/check-cron-drift.mjs # validate + compare to live
+// node scripts/check-cron-drift.mjs --offline # validate expressions only
+// node scripts/check-cron-drift.mjs --json # machine-readable report
+//
+// Exits non-zero when drift or an invalid expression is found, so it can gate a
+// deploy.
+
+import { readFileSync } from 'node:fs';
+import { execFile } from 'node:child_process';
+import { promisify } from 'node:util';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { CronExpressionParser } from 'cron-parser';
+
+const execFileP = promisify(execFile);
+const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+
+const PROJECT = 'aerial-vehicle-466722-p5';
+const LOCATION = 'us-central1';
+
+const argv = process.argv.slice(2);
+const OFFLINE = argv.includes('--offline');
+const AS_JSON = argv.includes('--json');
+
+// Must match scripts/create-gcp-scheduler.mjs exactly, or every job reads as
+// missing.
+function jobId(cronPath) {
+ return `cron-${cronPath.replace(/[^a-zA-Z0-9]+/g, '-')}`.slice(0, 500);
+}
+
+/** Parse a cron expression, returning its next fire times or an error. */
+function validate(schedule) {
+ try {
+ const it = CronExpressionParser.parse(schedule, { tz: 'UTC' });
+ const next = [it.next().toISOString(), it.next().toISOString()];
+ return { ok: true, next };
+ } catch (err) {
+ return { ok: false, error: err.message };
+ }
+}
+
+/** Interval in minutes between the next two fires, as a load signal. */
+function intervalMinutes(next) {
+ if (!next || next.length < 2) return null;
+ return Math.round((Date.parse(next[1]) - Date.parse(next[0])) / 60_000);
+}
+
+async function liveJobs() {
+ const { stdout } = await execFileP(
+ 'gcloud',
+ [
+ 'scheduler', 'jobs', 'list',
+ `--project=${PROJECT}`,
+ `--location=${LOCATION}`,
+ '--format=json',
+ '--quiet',
+ ],
+ { maxBuffer: 16 * 1024 * 1024 },
+ );
+ const rows = JSON.parse(stdout || '[]');
+ const byId = new Map();
+ for (const job of rows) {
+ // name is fully qualified: projects/…/locations/…/jobs/<id>
+ const id = String(job.name || '').split('/').pop();
+ byId.set(id, { schedule: job.schedule, state: job.state, timeZone: job.timeZone });
+ }
+ return byId;
+}
+
+const { crons } = JSON.parse(readFileSync(path.join(ROOT, 'vercel.json'), 'utf8'));
+if (!Array.isArray(crons) || !crons.length) {
+ console.error('No crons found in vercel.json.');
+ process.exit(1);
+}
+
+const invalid = [];
+const declared = [];
+for (const { path: cronPath, schedule } of crons) {
+ const v = validate(schedule);
+ if (!v.ok) {
+ invalid.push({ path: cronPath, schedule, error: v.error });
+ continue;
+ }
+ declared.push({
+ path: cronPath,
+ schedule,
+ id: jobId(cronPath),
+ everyMinutes: intervalMinutes(v.next),
+ nextFire: v.next[0],
+ });
+}
+
+// Duplicate paths would make one job silently overwrite the other on sync.
+const seen = new Map();
+const duplicates = [];
+for (const d of declared) {
+ if (seen.has(d.id)) duplicates.push({ id: d.id, paths: [seen.get(d.id), d.path] });
+ else seen.set(d.id, d.path);
+}
+
+const report = {
+ declared: declared.length,
+ invalid,
+ duplicates,
+ missing: [],
+ mismatched: [],
+ paused: [],
+ orphaned: [],
+ checkedLive: false,
+};
+
+if (!OFFLINE) {
+ try {
+ const live = await liveJobs();
+ report.checkedLive = true;
+ for (const d of declared) {
+ const job = live.get(d.id);
+ if (!job) {
+ report.missing.push({ path: d.path, id: d.id, schedule: d.schedule });
+ continue;
+ }
+ if (String(job.schedule).trim() !== String(d.schedule).trim()) {
+ report.mismatched.push({
+ path: d.path,
+ id: d.id,
+ declared: d.schedule,
+ live: job.schedule,
+ });
+ }
+ if (job.state && job.state !== 'ENABLED') {
+ report.paused.push({ path: d.path, id: d.id, state: job.state });
+ }
+ }
+ const declaredIds = new Set(declared.map((d) => d.id));
+ for (const [id, job] of live) {
+ if (id.startsWith('cron-') && !declaredIds.has(id)) {
+ report.orphaned.push({ id, schedule: job.schedule, state: job.state });
+ }
+ }
+ } catch (err) {
+ report.liveError = err.message.split('\n')[0];
+ }
+}
+
+const problems =
+ report.invalid.length +
+ report.duplicates.length +
+ report.missing.length +
+ report.mismatched.length +
+ report.paused.length;
+
+if (AS_JSON) {
+ console.log(JSON.stringify(report, null, 2));
+ process.exit(problems ? 1 : 0);
+}
+
+console.log(`Declared crons in vercel.json: ${report.declared}`);
+const busiest = [...declared]
+ .filter((d) => d.everyMinutes != null)
+ .sort((a, b) => a.everyMinutes - b.everyMinutes)
+ .slice(0, 5);
+if (busiest.length) {
+ console.log('Most frequent:');
+ for (const d of busiest) console.log(` every ${d.everyMinutes}m ${d.path}`);
+}
+
+for (const [label, rows, fmt] of [
+ ['INVALID expression', report.invalid, (r) => `${r.path} "${r.schedule}" ${r.error}`],
+ ['DUPLICATE job id', report.duplicates, (r) => `${r.id} ${r.paths.join(' vs ')}`],
+ ['MISSING in Cloud Scheduler', report.missing, (r) => `${r.path} (${r.id})`],
+ ['SCHEDULE MISMATCH', report.mismatched, (r) => `${r.path} declared "${r.declared}" live "${r.live}"`],
+ ['NOT ENABLED', report.paused, (r) => `${r.path} state=${r.state}`],
+ ['ORPHANED job (no longer declared)', report.orphaned, (r) => `${r.id} "${r.schedule}"`],
+]) {
+ if (!rows.length) continue;
+ console.log(`\n${label}: ${rows.length}`);
+ for (const r of rows) console.log(` ${fmt(r)}`);
+}
+
+if (report.liveError) {
+ console.log(`\nCould not read Cloud Scheduler: ${report.liveError}`);
+ console.log('Expression validation still ran. Re-run after `gcloud auth login` to compare live jobs.');
+} else if (!OFFLINE && !problems) {
+ console.log('\nNo drift: every declared cron exists, is enabled, and matches its live schedule.');
+} else if (OFFLINE && !problems) {
+ console.log('\nAll cron expressions are valid (offline mode: live jobs not compared).');
+}
+
+// Orphans alone do not fail the check — a job intentionally left behind during
+// a migration is not a broken deploy. Everything else is.
+process.exit(problems ? 1 : 0);
diff --git a/scripts/irl-realism-check.mjs b/scripts/irl-realism-check.mjs
new file mode 100644
index 000000000..732940b17
--- /dev/null
+++ b/scripts/irl-realism-check.mjs
@@ -0,0 +1,393 @@
+#!/usr/bin/env node
+/**
+ * irl-realism-check: headless proof of what /irl actually renders, and whether
+ * the shared avatar material realism pass (src/shared/avatar-material-realism.js)
+ * is live on that surface.
+ *
+ * /irl is a camera-AR surface, so this drives it the way a real user would on a
+ * device with a camera: Chromium is launched with a synthetic media device
+ * (--use-fake-device-for-media-stream) and auto-granted camera permission
+ * (--use-fake-ui-for-media-stream), plus SwiftShader for WebGL in headless.
+ * The page is never patched to make it testable.
+ *
+ * Scene readback rides three.js's own devtools hook: every Scene and
+ * WebGLRenderer constructor dispatches an `observe` CustomEvent on the global
+ * __THREE_DEVTOOLS__ if one exists. Installing an EventTarget there before any
+ * page script runs hands us the live scene graph on both the dev server and the
+ * minified production bundle, with zero source changes.
+ *
+ * Usage:
+ * node scripts/irl-realism-check.mjs # dev (localhost:3000) + production
+ * node scripts/irl-realism-check.mjs --base=http://localhost:3000
+ * node scripts/irl-realism-check.mjs --only=prod
+ * node scripts/irl-realism-check.mjs --out=/path/to/dir
+ *
+ * Exit code is 0 when an avatar rendered on at least one target (the realism
+ * pass being absent is a reported finding, not a script failure), 1 otherwise.
+ */
+
+import { chromium } from 'playwright';
+import { mkdir, writeFile } from 'node:fs/promises';
+import path from 'node:path';
+
+const DEFAULT_OUT = path.resolve(process.cwd(), 'prompts/quality-bar/_generated/10');
+
+const args = Object.fromEntries(
+ process.argv.slice(2)
+ .filter((a) => a.startsWith('--'))
+ .map((a) => {
+ const [k, ...rest] = a.replace(/^--/, '').split('=');
+ return [k, rest.length ? rest.join('=') : 'true'];
+ }),
+);
+
+const OUT_DIR = path.resolve(args.out || DEFAULT_OUT);
+const ONLY = args.only || 'all'; // all | dev | prod
+const DEV_BASE = args.base || 'http://localhost:3000';
+// SwiftShader capture of a full-screen WebGL canvas is CPU-bound and slow.
+const SHOT_TIMEOUT = Number(args.shotTimeout || 120_000);
+const PROD_BASE = args.prod || 'https://three.ws';
+
+// The classifier the realism module uses, mirrored here purely as a READ-ONLY
+// probe so the checker can name which meshes the module would claim. It never
+// mutates anything; the actual before/after mutation below is done by importing
+// the real module in the page.
+const CLASSIFIER_SRC = `
+const SKIN_NAME_RE = /(^|[_\\s-])(skin|body|face|head|torso|arm|leg|hand|feet|foot)(?=[_\\s-]|$)/i;
+const WOLF3D_SKIN_RE = /wolf3d_skin|wolf3d_body|wolf3d_head/i;
+const EYE_NAME_RE = /(^|[_\\s-])(eye|cornea|iris|sclera)(left|right)?(?=[_\\s-]|$)/i;
+const HAIR_NAME_RE = /(^|[_\\s-])(hair|eyebrow|eyelash|beard|fur)(left|right|back|front)?(?=[_\\s-]|$)/i;
+const TEETH_NAME_RE = /(^|[_\\s-])(teeth|tongue|mouth)(?=[_\\s-]|$)/i;
+function classify(node) {
+ const n = (node?.name || '') + ' ' + (node?.material?.name || '');
+ if (WOLF3D_SKIN_RE.test(n) || SKIN_NAME_RE.test(n)) return 'skin';
+ if (EYE_NAME_RE.test(n)) return 'eye';
+ if (HAIR_NAME_RE.test(n)) return 'hair';
+ if (TEETH_NAME_RE.test(n)) return 'teeth';
+ return null;
+}
+`;
+
+/** Installed before any page script: three.js dispatches every Scene/WebGLRenderer here. */
+function threeDevtoolsProbe() {
+ const target = new EventTarget();
+ window.__capturedScenes = [];
+ window.__capturedRenderers = [];
+ target.addEventListener('observe', (e) => {
+ const o = e.detail;
+ if (!o) return;
+ if (o.isScene) window.__capturedScenes.push(o);
+ else if (o.isWebGLRenderer || o.domElement instanceof HTMLCanvasElement) window.__capturedRenderers.push(o);
+ });
+ window.__THREE_DEVTOOLS__ = target;
+}
+
+/** Serialize the material fields the realism pass tunes. */
+const MATERIAL_READBACK = `
+function readMaterial(mat) {
+ if (!mat) return null;
+ const hex = (c) => (c && typeof c.getHexString === 'function' ? '#' + c.getHexString() : null);
+ return {
+ name: mat.name || '(unnamed)',
+ type: mat.type,
+ isMeshPhysicalMaterial: !!mat.isMeshPhysicalMaterial,
+ isMeshStandardMaterial: !!mat.isMeshStandardMaterial,
+ roughness: mat.roughness ?? null,
+ metalness: mat.metalness ?? null,
+ sheen: mat.sheen ?? null,
+ sheenColor: hex(mat.sheenColor),
+ sheenRoughness: mat.sheenRoughness ?? null,
+ clearcoat: mat.clearcoat ?? null,
+ clearcoatRoughness: mat.clearcoatRoughness ?? null,
+ ior: mat.ior ?? null,
+ specularIntensity: mat.specularIntensity ?? null,
+ envMapIntensity: mat.envMapIntensity ?? null,
+ side: mat.side,
+ alphaTest: mat.alphaTest ?? null,
+ color: hex(mat.color),
+ };
+}
+`;
+
+const SCENE_SNAPSHOT = `
+function sceneSnapshot() {
+ ${CLASSIFIER_SRC}
+ ${MATERIAL_READBACK}
+ const scenes = window.__capturedScenes || [];
+ const out = { scenes: scenes.length, meshes: 0, skinnedMeshes: 0, classified: [], sample: [] };
+ for (const scene of scenes) {
+ scene.traverse((n) => {
+ if (!n.isMesh) return;
+ out.meshes++;
+ if (n.isSkinnedMesh) out.skinnedMeshes++;
+ const cls = classify(n);
+ if (out.sample.length < 40) out.sample.push({ name: n.name, class: cls, visible: n.visible });
+ if (!cls) return;
+ const mats = Array.isArray(n.material) ? n.material : [n.material];
+ for (const m of mats) {
+ if (!m || !('roughness' in m)) continue;
+ out.classified.push({ mesh: n.name, class: cls, material: readMaterial(m) });
+ }
+ });
+ }
+ return out;
+}
+`;
+
+function summarize(readback) {
+ const upgraded = readback.classified.filter((c) => c.material.isMeshPhysicalMaterial);
+ const skin = readback.classified.filter((c) => c.class === 'skin');
+ const eye = readback.classified.filter((c) => c.class === 'eye');
+ // The realism pass leaves unmistakable fingerprints: skin gets sheen 0.35 +
+ // specularIntensity 0.6, eyes get clearcoat 1 + ior 1.376. Absence of BOTH on
+ // every classified material means the pass never ran on this scene.
+ const skinMarked = skin.some((c) => c.material.sheen === 0.35 && c.material.specularIntensity === 0.6);
+ const eyeMarked = eye.some((c) => c.material.clearcoat === 1 && Math.abs((c.material.ior ?? 0) - 1.376) < 1e-6);
+ return {
+ classifiedCount: readback.classified.length,
+ physicalCount: upgraded.length,
+ skinCount: skin.length,
+ eyeCount: eye.length,
+ skinMarked,
+ eyeMarked,
+ realismActive: skinMarked || eyeMarked,
+ };
+}
+
+async function runTarget({ name, url, canImportModule, browser }) {
+ const result = {
+ name, url,
+ loaded: false,
+ avatarRendered: false,
+ consoleErrors: [],
+ pageErrors: [],
+ screenshots: [],
+ readback: null,
+ summary: null,
+ afterModule: null,
+ afterSummary: null,
+ cameraAr: null,
+ onboarding: [],
+ notes: [],
+ };
+
+ const context = await browser.newContext({
+ viewport: { width: 430, height: 932 }, // iPhone-class portrait, the surface's real target
+ // Kept at 1: a 2x buffer of a SwiftShader-rendered WebGL canvas pushes a
+ // single capture past two minutes on this CPU-only runner.
+ deviceScaleFactor: 1,
+ permissions: ['camera'],
+ locale: 'en-US',
+ });
+ await context.addInitScript(threeDevtoolsProbe);
+ const page = await context.newPage();
+
+ page.on('console', (msg) => {
+ if (msg.type() === 'error') result.consoleErrors.push(msg.text());
+ });
+ page.on('pageerror', (err) => result.pageErrors.push(String(err?.message || err)));
+
+ try {
+ await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60_000 });
+ result.loaded = true;
+
+ // The hero camera button is disabled until loadAvatar() resolves. That is
+ // the app's own "avatar is on screen" signal, so wait on it rather than a
+ // blind timeout.
+ await page.waitForFunction(() => {
+ const b = document.getElementById('irl-camera-btn');
+ return !!b && !b.disabled;
+ }, null, { timeout: 90_000 }).catch(() => {
+ result.notes.push('camera button never enabled within 90s, falling back to scene-graph poll');
+ });
+
+ // Independently confirm a skinned avatar mesh actually reached the scene.
+ await page.waitForFunction(() => {
+ const scenes = window.__capturedScenes || [];
+ let found = false;
+ for (const s of scenes) s.traverse((n) => { if (n.isSkinnedMesh) found = true; });
+ return found;
+ }, null, { timeout: 60_000 }).catch(() => {
+ result.notes.push('no SkinnedMesh observed in any captured scene within 60s');
+ });
+
+ // Clear the first-run permission overlay the way a user does: tap through
+ // each card, taking the grant when the card offers one and the recovery
+ // ("Continue without" / "Skip for now") when the headless profile can't
+ // satisfy it (motion sensors, geolocation). Nothing is bypassed in code.
+ result.onboarding = [];
+ for (let i = 0; i < 12; i++) {
+ const step = await page.evaluate(() => {
+ const ov = document.getElementById('irl-onboard');
+ if (!ov || ov.hidden || !ov.classList.contains('is-open')) return null;
+ const pick = ['enable', 'continue', 'skip']
+ .map((a) => ov.querySelector(`[data-sk-action="${a}"]`))
+ .find(Boolean);
+ return pick ? { action: pick.dataset.skAction, label: pick.textContent.trim() } : { action: null, label: null };
+ });
+ if (!step) break;
+ if (!step.action) { await page.waitForTimeout(800); continue; }
+ result.onboarding.push(step.label);
+ await page.click(`#irl-onboard [data-sk-action="${step.action}"]`, { timeout: 8000 }).catch(() => {});
+ await page.waitForTimeout(1200);
+ }
+ await page.waitForTimeout(1200);
+
+ // First-run discovery explainer sits on the same z-stack. Take its primary
+ // "Start exploring" action, exactly as a first-time user would.
+ const dxStart = page.locator('#irl-discovery-explainer [data-dx-start]');
+ if (await dxStart.count()) {
+ await dxStart.click({ timeout: 8000 }).catch((e) => result.notes.push(`discovery explainer dismiss failed: ${e?.message || e}`));
+ result.onboarding.push('Start exploring');
+ await page.waitForTimeout(1000);
+ }
+
+ // Let the idle clip settle so the screenshot is a natural pose, not bind pose.
+ await page.waitForTimeout(2500);
+
+ result.readback = await page.evaluate(`(() => { ${SCENE_SNAPSHOT} return sceneSnapshot(); })()`);
+ result.avatarRendered = result.readback.skinnedMeshes > 0;
+ result.summary = summarize(result.readback);
+
+ const shot = path.join(OUT_DIR, `irl-avatar${name === 'production' ? '-prod' : ''}.png`);
+ await page.screenshot({ path: shot, timeout: SHOT_TIMEOUT });
+ result.screenshots.push(shot);
+
+ // Camera AR: the fake media device makes getUserMedia resolve headlessly,
+ // so the real "Start camera" path can be exercised end to end.
+ try {
+ const alreadyAr = await page.evaluate(() => document.body.classList.contains('is-ar'));
+ if (!alreadyAr) await page.click('#irl-camera-btn', { timeout: 10_000 });
+ await page.waitForTimeout(3000);
+ const arOn = await page.evaluate(() => ({
+ bodyIsAr: document.body.classList.contains('is-ar'),
+ videoReady: (() => {
+ const v = document.getElementById('irl-camera');
+ return v ? { readyState: v.readyState, w: v.videoWidth, h: v.videoHeight, hasStream: !!v.srcObject } : null;
+ })(),
+ }));
+ result.cameraAr = arOn;
+ const arShot = path.join(OUT_DIR, `irl-avatar-ar${name === 'production' ? '-prod' : ''}.png`);
+ await page.screenshot({ path: arShot, timeout: SHOT_TIMEOUT });
+ result.screenshots.push(arShot);
+ } catch (e) {
+ result.notes.push(`camera AR click failed: ${e?.message || e}`);
+ }
+
+ // Dev only: import the REAL realism module into the live page and apply it
+ // to the same scene, so the readback shows the exact delta the surface is
+ // missing. This mutates the running page, never the source.
+ if (canImportModule) {
+ const applied = await page.evaluate(`(async () => {
+ ${SCENE_SNAPSHOT}
+ const mod = await import('/src/shared/avatar-material-realism.js');
+ const scenes = window.__capturedScenes || [];
+ let looksLike = false;
+ const counts = { skin: 0, eye: 0, hair: 0, teeth: 0 };
+ for (const s of scenes) {
+ if (mod.looksLikeAvatarMesh(s)) looksLike = true;
+ const c = mod.applyAvatarMaterialRealism(s);
+ for (const k of Object.keys(counts)) counts[k] += c[k];
+ }
+ return { looksLikeAvatarMesh: looksLike, counts, readback: sceneSnapshot() };
+ })()`);
+ result.afterModule = applied;
+ result.afterSummary = summarize(applied.readback);
+ await page.waitForTimeout(600);
+ const afterShot = path.join(OUT_DIR, 'irl-avatar-realism-applied.png');
+ await page.screenshot({ path: afterShot, timeout: SHOT_TIMEOUT });
+ result.screenshots.push(afterShot);
+ }
+ } catch (e) {
+ result.notes.push(`fatal: ${e?.message || e}`);
+ } finally {
+ await context.close();
+ }
+ return result;
+}
+
+function fmtMat(m) {
+ return [
+ `type=${m.type}`,
+ `roughness=${m.roughness}`,
+ `metalness=${m.metalness}`,
+ `sheen=${m.sheen}`,
+ `clearcoat=${m.clearcoat}`,
+ `ior=${m.ior}`,
+ `specularIntensity=${m.specularIntensity}`,
+ `envMapIntensity=${m.envMapIntensity}`,
+ ].join(' ');
+}
+
+function report(results) {
+ const lines = [];
+ for (const r of results) {
+ lines.push(`\n=== ${r.name} :: ${r.url} ===`);
+ lines.push(`loaded=${r.loaded} avatarRendered=${r.avatarRendered}`);
+ if (r.readback) {
+ lines.push(`scenes=${r.readback.scenes} meshes=${r.readback.meshes} skinnedMeshes=${r.readback.skinnedMeshes}`);
+ }
+ if (r.summary) {
+ lines.push(`classified=${r.summary.classifiedCount} physical=${r.summary.physicalCount} skinMarked=${r.summary.skinMarked} eyeMarked=${r.summary.eyeMarked}`);
+ lines.push(`REALISM MODULE ACTIVE: ${r.summary.realismActive ? 'YES' : 'NO'}`);
+ }
+ for (const c of (r.readback?.classified || [])) {
+ lines.push(` [${c.class}] ${c.mesh} :: ${fmtMat(c.material)}`);
+ }
+ if (r.afterSummary) {
+ lines.push(`-- after importing + applying the module in-page --`);
+ lines.push(`looksLikeAvatarMesh=${r.afterModule.looksLikeAvatarMesh} counts=${JSON.stringify(r.afterModule.counts)}`);
+ lines.push(`classified=${r.afterSummary.classifiedCount} physical=${r.afterSummary.physicalCount} skinMarked=${r.afterSummary.skinMarked} eyeMarked=${r.afterSummary.eyeMarked}`);
+ for (const c of (r.afterModule.readback?.classified || [])) {
+ lines.push(` [${c.class}] ${c.mesh} :: ${fmtMat(c.material)}`);
+ }
+ }
+ lines.push(`onboarding taps: ${JSON.stringify(r.onboarding)}`);
+ lines.push(`cameraAr=${JSON.stringify(r.cameraAr)}`);
+ lines.push(`consoleErrors(${r.consoleErrors.length}):`);
+ for (const e of r.consoleErrors) lines.push(` ! ${e}`);
+ lines.push(`pageErrors(${r.pageErrors.length}):`);
+ for (const e of r.pageErrors) lines.push(` !! ${e}`);
+ for (const n of r.notes) lines.push(` note: ${n}`);
+ lines.push(`screenshots: ${r.screenshots.join(', ')}`);
+ }
+ return lines.join('\n');
+}
+
+async function main() {
+ await mkdir(OUT_DIR, { recursive: true });
+
+ const browser = await chromium.launch({
+ args: [
+ '--use-fake-ui-for-media-stream',
+ '--use-fake-device-for-media-stream',
+ '--use-gl=angle',
+ '--use-angle=swiftshader',
+ '--enable-unsafe-swiftshader',
+ '--ignore-gpu-blocklist',
+ ],
+ });
+
+ const targets = [];
+ if (ONLY !== 'prod') targets.push({ name: 'dev', url: `${DEV_BASE}/irl`, canImportModule: true });
+ if (ONLY !== 'dev') targets.push({ name: 'production', url: `${PROD_BASE}/irl`, canImportModule: false });
+
+ const results = [];
+ for (const t of targets) {
+ process.stdout.write(`\n[irl-realism-check] ${t.name} → ${t.url}\n`);
+ results.push(await runTarget({ ...t, browser }));
+ }
+ await browser.close();
+
+ const text = report(results);
+ process.stdout.write(text + '\n');
+ await writeFile(path.join(OUT_DIR, 'irl-realism-check.json'), JSON.stringify(results, null, 2));
+
+ const anyAvatar = results.some((r) => r.avatarRendered);
+ process.exitCode = anyAvatar ? 0 : 1;
+}
+
+main().catch((e) => {
+ console.error(e);
+ process.exitCode = 1;
+});
diff --git a/scripts/mobile-perf.mjs b/scripts/mobile-perf.mjs
index 0760a1f34..090e04079 100644
--- a/scripts/mobile-perf.mjs
+++ b/scripts/mobile-perf.mjs
@@ -144,6 +144,8 @@ function parseArgs(argv) {
md: null,
label: '',
headful: false,
+ scroll: false,
+ scrollDwell: 2500,
};
for (let i = 2; i < argv.length; i++) {
const a = argv[i];
@@ -161,6 +163,8 @@ function parseArgs(argv) {
else if (a === '--md') out.md = next();
else if (a === '--label') out.label = next();
else if (a === '--headful') out.headful = true;
+ else if (a === '--scroll') out.scroll = true;
+ else if (a === '--scroll-dwell') out.scrollDwell = Math.max(200, Number(next()) || 200);
else if (a === '--help' || a === '-h') {
printHelp();
process.exit(0);
@@ -185,6 +189,9 @@ ${C.b('mobile-perf')} - Playwright-measured mobile field metrics (NOT Lighthouse
--json <file> write raw results JSON
--md <file> write a readable Markdown table
--label <text> free-text label stored in the JSON (e.g. "baseline")
+ --scroll after metrics are read, scroll the page and sample the
+ WebGL live/visible context ceiling (grid pages)
+ --scroll-dwell <ms> settle per scroll step (default 2500)
--headful run with a visible browser
`);
}
@@ -324,6 +331,34 @@ function readProbe() {
};
}
+// Light-weight live-context sampler used during the optional scroll pass.
+function sampleGl() {
+ const S = window.__mobilePerf || {};
+ let live = 0;
+ let visible = 0;
+ for (const rec of S._gl || []) {
+ let lost = true;
+ try {
+ lost = rec.ctx.isContextLost();
+ } catch {
+ lost = true;
+ }
+ if (!rec.canvas.isConnected || lost) continue;
+ live++;
+ const cs = getComputedStyle(rec.canvas);
+ const box = rec.canvas.getBoundingClientRect();
+ if (
+ cs.display !== 'none' &&
+ cs.visibility !== 'hidden' &&
+ Number(cs.opacity) > 0.01 &&
+ box.width > 8 &&
+ box.height > 8
+ )
+ visible++;
+ }
+ return { created: S.webglCreated || 0, live, visible, lost: S.webglLost || 0, y: Math.round(window.scrollY) };
+}
+
// ── One measurement run ──────────────────────────────────────────────────────
async function measureOnce(browser, deviceDescriptor, url, opts) {
const context = await browser.newContext({
@@ -404,6 +439,32 @@ async function measureOnce(browser, deviceDescriptor, url, opts) {
error = error || `probe failed: ${String(err.message).slice(0, 160)}`;
}
+ // Optional scroll pass. Grid pages only boot their lower viewers once those
+ // rows intersect the viewport, so the WebGL context ceiling is invisible
+ // without scrolling. This runs AFTER the metrics read so it can never
+ // inflate CLS or LCP in the reported numbers.
+ let scroll = null;
+ if (opts.scroll && !error) {
+ try {
+ scroll = { steps: 0, glCreatedMax: 0, glLiveMax: 0, glVisibleMax: 0, samples: [] };
+ const height = await page.evaluate(() => document.documentElement.scrollHeight);
+ const vh = await page.evaluate(() => window.innerHeight);
+ const steps = Math.min(30, Math.max(1, Math.ceil(height / vh)));
+ for (let i = 1; i <= steps; i++) {
+ await page.evaluate((y) => window.scrollTo({ top: y, behavior: 'instant' }), i * vh);
+ await page.waitForTimeout(opts.scrollDwell);
+ const s = await page.evaluate(sampleGl);
+ scroll.steps = i;
+ scroll.samples.push(s);
+ scroll.glCreatedMax = Math.max(scroll.glCreatedMax, s.created);
+ scroll.glLiveMax = Math.max(scroll.glLiveMax, s.live);
+ scroll.glVisibleMax = Math.max(scroll.glVisibleMax, s.visible);
+ }
+ } catch (err) {
+ scroll = { error: String(err.message).slice(0, 160) };
+ }
+ }
+
const wallMs = Date.now() - t0;
bytes.resources.sort((a, b) => b.bytes - a.bytes);
await context.close().catch(() => {});
@@ -413,6 +474,7 @@ async function measureOnce(browser, deviceDescriptor, url, opts) {
status,
error,
loadFired,
+ scroll,
wallMs,
transferBytes: bytes.total,
bytesByType: bytes.byType,
@@ -460,6 +522,13 @@ function summarise(label, path, runs) {
const last = source[source.length - 1] || runs[runs.length - 1] || {};
summary.status = last.status ?? 0;
summary.loadFired = source.every((r) => r.loadFired !== false);
+ const scrolls = source.map((r) => r.scroll).filter((s) => s && !s.error);
+ if (scrolls.length) {
+ summary.scrollGlCreatedMax = Math.max(...scrolls.map((s) => s.glCreatedMax));
+ summary.scrollGlLiveMax = Math.max(...scrolls.map((s) => s.glLiveMax));
+ summary.scrollGlVisibleMax = Math.max(...scrolls.map((s) => s.glVisibleMax));
+ summary.scrollSteps = Math.max(...scrolls.map((s) => s.steps));
+ }
summary.lcpDetail = last.lcpDetail || '';
summary.clsSources = last.clsSources || [];
summary.bytesByType = last.bytesByType || {};
@@ -546,7 +615,11 @@ ${sorted
- transfer ${kb(r.transferBytes)} across ${ms(r.requestCount)} requests${types ? ` - ${types}` : ''}
- window \`load\` fired within the wait window: ${r.loadFired ? 'yes' : 'NO (long-lived requests still open)'}
- DOM nodes ${ms(r.domNodes)}, img elements ${ms(r.images)}
-- WebGL contexts: created ${r.webglCreated ?? '-'}, live ${r.webglLive ?? '-'}, visible ${r.webglVisible ?? '-'}, lost ${r.webglLost ?? '-'}
+- WebGL contexts: created ${r.webglCreated ?? '-'}, live ${r.webglLive ?? '-'}, visible ${r.webglVisible ?? '-'}, lost ${r.webglLost ?? '-'}${
+ r.scrollGlLiveMax === undefined
+ ? ''
+ : `\n- WebGL ceiling while scrolling (${r.scrollSteps} steps): created ${r.scrollGlCreatedMax}, live max ${r.scrollGlLiveMax}, visible max ${r.scrollGlVisibleMax}`
+ }
${gl ? `${gl}\n` : ''}${top ? `- heaviest resources:\n${top}\n` : ''}${shifts ? `- layout shifts:\n${shifts}\n` : ''}${
r.errors?.length ? `- run errors: ${r.errors.join('; ')}\n` : ''
}${r.consoleErrors?.length ? `- console errors: ${r.consoleErrors.length} (first: \`${r.consoleErrors[0]}\`)\n` : ''}`;
@@ -614,7 +687,12 @@ async function main() {
const s = summarise(entry.label, entry.path, runs);
results.push(s);
const tag = s.okRuns
- ? C.d(` LCP ${s.lcp}ms CLS ${s.cls} TBT* ${s.tbtProxy}ms ${kb(s.transferBytes)} GL ${s.webglCreated}/${s.webglLive}/${s.webglVisible}`)
+ ? C.d(
+ ` LCP ${s.lcp}ms CLS ${s.cls} TBT* ${s.tbtProxy}ms ${kb(s.transferBytes)} GL ${s.webglCreated}/${s.webglLive}/${s.webglVisible}` +
+ (s.scrollGlLiveMax === undefined
+ ? ''
+ : ` scrollGL ${s.scrollGlCreatedMax}/${s.scrollGlLiveMax}/${s.scrollGlVisibleMax}`),
+ )
: C.r(` FAILED: ${s.errors[0] || 'unknown'}`);
console.log(tag);
}
diff --git a/scripts/mobile-touch-audit.mjs b/scripts/mobile-touch-audit.mjs
index 69bfac522..50b48e2d8 100644
--- a/scripts/mobile-touch-audit.mjs
+++ b/scripts/mobile-touch-audit.mjs
@@ -78,11 +78,13 @@ function parseArgs(argv) {
json: null,
md: null,
label: '',
+ gesture: true,
};
for (let i = 2; i < argv.length; i++) {
const a = argv[i];
const next = () => argv[++i];
- if (a === '--base') out.base = next().replace(/\/+$/, '');
+ if (a === '--no-gesture') out.gesture = false;
+ else if (a === '--base') out.base = next().replace(/\/+$/, '');
else if (a === '--pages') out.pages = next();
else if (a === '--device') out.device = next();
else if (a === '--settle') out.settle = Math.max(0, Number(next()) || 0);
@@ -209,7 +211,16 @@ function auditDom(minTarget) {
const box = el.getBoundingClientRect();
if (!isVisible(el, cs, box)) continue;
const distanceFromBottom = window.innerHeight - box.bottom;
- if (distanceFromBottom > 4 || box.height < 24 || box.width < window.innerWidth * 0.5) continue;
+ // A real bottom bar hugs the bottom edge, spans most of the width, and is
+ // short. The height ceiling is what keeps full-screen fixed overlays and
+ // backdrop layers (which also end at the bottom edge) out of the list.
+ if (
+ distanceFromBottom > 4 ||
+ box.height < 24 ||
+ box.height > window.innerHeight * 0.4 ||
+ box.width < window.innerWidth * 0.5
+ )
+ continue;
bottomBars.push({
sel: describe(el),
h: Math.round(box.height),
@@ -219,9 +230,24 @@ function auditDom(minTarget) {
});
}
+ // Horizontal overflow. `scrollWidth > clientWidth` alone over-reports: the
+ // site-wide `overflow-x: clip` guard in mobile.css leaves scrollWidth wide
+ // while making the page genuinely unscrollable sideways. So also try to
+ // scroll and see whether it takes.
const doc = document.documentElement;
+ const overflowPx = Math.max(0, doc.scrollWidth - doc.clientWidth);
+ let canScrollX = false;
+ if (overflowPx > 0) {
+ const before = window.scrollX;
+ window.scrollTo({ left: 40, top: window.scrollY, behavior: 'instant' });
+ canScrollX = window.scrollX > before;
+ window.scrollTo({ left: before, top: window.scrollY, behavior: 'instant' });
+ }
+
return {
title: document.title,
+ overflowXStyle: getComputedStyle(doc).overflowX,
+ canScrollX,
checked,
inlineExempt,
smallTargets,
@@ -230,11 +256,73 @@ function auditDom(minTarget) {
viewportFitCover: /viewport-fit\s*=\s*cover/.test(viewportMeta),
safeAreaRuleCount: safeAreaRules.length,
bottomBars,
- overflowX: Math.max(0, doc.scrollWidth - doc.clientWidth),
+ overflowX: overflowPx,
innerWidth: window.innerWidth,
};
}
+/**
+ * Real gesture probe. `touch-action: auto` on a canvas is only a defect if the
+ * viewer actually swallows the swipe, so instead of trusting the computed style
+ * we dispatch a genuine vertical touch drag through CDP and measure how far the
+ * document scrolled. A control swipe over ordinary page content in the same
+ * session gives the "this page can scroll at all" reference.
+ */
+async function probeScrollGestures(page, cdp, canvases) {
+ const results = [];
+ const vh = await page.evaluate(() => window.innerHeight);
+ const swipe = async (x, y) => {
+ await page.evaluate(() => window.scrollTo({ top: 0, behavior: 'instant' }));
+ await page.waitForTimeout(400);
+ const before = await page.evaluate(() => window.scrollY);
+ const send = (type, points) =>
+ cdp.send('Input.dispatchTouchEvent', { type, touchPoints: points });
+ await send('touchStart', [{ x, y }]);
+ for (let i = 1; i <= 6; i++) {
+ await send('touchMove', [{ x, y: y - i * 30 }]);
+ await page.waitForTimeout(30);
+ }
+ await send('touchEnd', []);
+ await page.waitForTimeout(700);
+ const after = await page.evaluate(() => window.scrollY);
+ return Math.round(after - before);
+ };
+
+ // Control: swipe near the left edge, below the fold start, avoiding canvases.
+ let control = 0;
+ try {
+ control = await swipe(8, Math.round(vh * 0.7));
+ } catch {
+ control = 0;
+ }
+
+ for (const c of canvases) {
+ if (!c.visible || c.w < 100 || c.h < 100) continue;
+ try {
+ const box = await page.evaluate((sel) => {
+ const el = Array.from(document.querySelectorAll('canvas')).find((n) => {
+ const id = n.id ? `#${n.id}` : '';
+ const cls =
+ typeof n.className === 'string' && n.className.trim()
+ ? `.${n.className.trim().split(/\s+/).slice(0, 3).join('.')}`
+ : '';
+ return `canvas${id}${cls}` === sel;
+ });
+ if (!el) return null;
+ window.scrollTo({ top: 0, behavior: 'instant' });
+ const r = el.getBoundingClientRect();
+ return { x: r.x + r.width / 2, y: r.y + r.height / 2, top: r.top };
+ }, c.sel);
+ if (!box || box.y < 0 || box.y > vh) continue;
+ const moved = await swipe(Math.round(box.x), Math.round(box.y));
+ results.push({ sel: c.sel, touchAction: c.touchAction, scrolled: moved, control });
+ } catch {
+ /* canvas vanished between audit and probe */
+ }
+ }
+ return { control, canvases: results };
+}
+
async function auditPage(browser, deviceDescriptor, url, opts) {
const context = await browser.newContext({ ...deviceDescriptor, serviceWorkers: 'block' });
const page = await context.newPage();
@@ -249,6 +337,7 @@ async function auditPage(browser, deviceDescriptor, url, opts) {
error = String(err.message).split('\n')[0].slice(0, 200);
}
let dom = null;
+ let gesture = null;
if (!error) {
try {
dom = await page.evaluate(auditDom, MIN_TARGET);
@@ -256,8 +345,16 @@ async function auditPage(browser, deviceDescriptor, url, opts) {
error = `audit failed: ${String(err.message).slice(0, 160)}`;
}
}
+ if (dom && opts.gesture && (dom.canvases || []).some((c) => c.visible && c.w >= 100 && c.h >= 100)) {
+ try {
+ const cdp = await context.newCDPSession(page);
+ gesture = await probeScrollGestures(page, cdp, dom.canvases);
+ } catch (err) {
+ gesture = { error: String(err.message).slice(0, 160) };
+ }
+ }
await context.close().catch(() => {});
- return { url, status, error, ...(dom || {}) };
+ return { url, status, error, gesture, ...(dom || {}) };
}
function renderMarkdown(report) {
@@ -298,7 +395,24 @@ function renderMarkdown(report) {
${lines.length ? `- undersized targets:\n${lines.join('\n')}\n` : '- undersized targets: none\n'}${
cans.length ? `- visible canvases:\n${cans.join('\n')}\n` : ''
}${bars.length ? `- bottom-anchored bars:\n${bars.join('\n')}\n` : ''}${
- r.overflowX > 0 ? `- horizontal overflow: ${r.overflowX} px beyond ${r.innerWidth} px viewport\n` : ''
+ r.overflowX > 0
+ ? `- horizontal overflow: ${r.overflowX} px beyond ${r.innerWidth} px viewport (html overflow-x: ${r.overflowXStyle}, actually scrolls sideways: ${r.canScrollX})\n`
+ : ''
+ }${
+ r.gesture && !r.gesture.error
+ ? `- vertical swipe test (px the document scrolled; control swipe off-canvas moved ${r.gesture.control} px):\n${
+ r.gesture.canvases.length
+ ? r.gesture.canvases
+ .map(
+ (g) =>
+ ` - \`${g.sel}\` touch-action=${g.touchAction} -> page scrolled ${g.scrolled} px${
+ g.control > 20 && Math.abs(g.scrolled) < 5 ? ' **swallowed the swipe**' : ''
+ }`,
+ )
+ .join('\n')
+ : ' - no canvas large enough to probe'
+ }\n`
+ : ''
}`;
});
diff --git a/scripts/quality-bench.mjs b/scripts/quality-bench.mjs
index 89245fc15..92094a930 100644
--- a/scripts/quality-bench.mjs
+++ b/scripts/quality-bench.mjs
@@ -11,7 +11,7 @@
// Usage:
// node scripts/quality-bench.mjs [--lane=<id|id,id|all>] [--tier=<draft|standard|high|all>]
// [--prompts=qb01,qb02,...] [--base-url=https://three.ws] [--resume=<run-file>]
-// [--dry-run]
+// [--concurrency=<n>] [--dry-run]
// node scripts/quality-bench.mjs --compare=latest,previous
//
// Requires GOOGLE_CLOUD_PROJECT + GCP credentials (GCP_SERVICE_ACCOUNT_JSON, or the
@@ -39,7 +39,7 @@ const RUNS_DIR = path.join(BENCH_DIR, 'runs');
const PROMPTS_FILE = path.join(BENCH_DIR, 'prompts.json');
function parseArgs(argv) {
- const args = { lane: 'all', tier: 'standard,high', prompts: 'all', baseUrl: 'https://three.ws', dryRun: false };
+ const args = { lane: 'all', tier: 'standard,high', prompts: 'all', baseUrl: 'https://three.ws', concurrency: 1, dryRun: false };
for (const raw of argv) {
const [k, ...rest] = raw.replace(/^--/, '').split('=');
const v = rest.join('=');
@@ -49,6 +49,7 @@ function parseArgs(argv) {
else if (k === 'base-url') args.baseUrl = v;
else if (k === 'resume') args.resume = v;
else if (k === 'compare') args.compare = v;
+ else if (k === 'concurrency') args.concurrency = Math.max(1, Number(v) || 1);
else if (k === 'dry-run') args.dryRun = true;
}
return args;
@@ -99,6 +100,37 @@ async function saveRun(runPath, run) {
await writeFile(runPath, JSON.stringify(run, null, '\t') + '\n', 'utf8');
}
+// Serialised writes: with --concurrency>1 several combos finish at once and each
+// wants to persist the whole run file. Chaining keeps them from interleaving two
+// full-file writes on the same fd path (a half-written run file would break the
+// resume that the durability guarantee depends on).
+let saveChain = Promise.resolve();
+function queueSave(runPath, run) {
+ saveChain = saveChain.then(
+ () => saveRun(runPath, run),
+ () => saveRun(runPath, run),
+ );
+ return saveChain;
+}
+
+// Fixed-size worker pool over a pre-built task list. Tasks are consumed in order,
+// so the lane-interleaved ordering below spreads simultaneous work across lanes
+// instead of hammering one GPU worker.
+async function runPool(tasks, concurrency, worker) {
+ let next = 0;
+ const size = Math.max(1, Math.min(concurrency, tasks.length));
+ await Promise.all(
+ Array.from({ length: size }, async () => {
+ for (;;) {
+ const i = next;
+ next += 1;
+ if (i >= tasks.length) return;
+ await worker(tasks[i], i);
+ }
+ }),
+ );
+}
+
async function runBench(args) {
const prompts = await loadPrompts();
const wantedPromptIds = args.prompts === 'all' ? null : new Set(args.prompts.split(',').map((s) => s.trim()));
@@ -111,7 +143,7 @@ async function runBench(args) {
throw new Error('no live image-capable forge lanes matched --lane on this deployment (check /api/forge?catalog)');
}
- console.log(`quality-bench: ${selectedPrompts.length} prompts x ${lanes.length} lanes (${lanes.map((l) => l.id).join(', ')}) x ${tiers.length} tiers (${tiers.join(', ')}) against ${args.baseUrl}`);
+ console.log(`quality-bench: ${selectedPrompts.length} prompts x ${lanes.length} lanes (${lanes.map((l) => l.id).join(', ')}) x ${tiers.length} tiers (${tiers.join(', ')}) against ${args.baseUrl}, concurrency ${args.concurrency}`);
let runPath;
let run;
@@ -134,30 +166,37 @@ async function runBench(args) {
}
const done = new Set(run.results.map(resultKey));
- if (args.dryRun) {
- let planned = 0;
- for (const p of selectedPrompts) for (const lane of lanes) for (const tier of tiers) {
- if (!done.has(`${p.id}::${lane.id}::${tier}`)) planned += 1;
- }
- console.log(`dry-run: ${planned} (prompt, lane, tier) combos would run; ${done.size} already recorded in ${runPath}`);
- return;
- }
-
+ // Ordered prompt → tier → lane so that consecutive tasks land on different
+ // lanes: a pool of N workers then spreads across N GPU backends rather than
+ // queueing N jobs behind one.
+ const tasks = [];
for (const p of selectedPrompts) {
- for (const lane of lanes) {
- for (const tier of tiers) {
- const key = `${p.id}::${lane.id}::${tier}`;
- if (done.has(key)) continue;
- console.log(`-> ${p.id} [${p.subjectClass}] lane=${lane.id} tier=${tier}`);
- const result = await runOne(args.baseUrl, p, lane.id, tier);
- run.results.push(result);
- await saveRun(runPath, run);
+ for (const tier of tiers) {
+ for (const lane of lanes) {
+ if (!done.has(`${p.id}::${lane.id}::${tier}`)) tasks.push({ prompt: p, lane, tier });
}
}
}
+ if (args.dryRun) {
+ console.log(`dry-run: ${tasks.length} (prompt, lane, tier) combos would run; ${done.size} already recorded in ${runPath}`);
+ return;
+ }
+
+ let completed = 0;
+ await runPool(tasks, args.concurrency, async ({ prompt: p, lane, tier }) => {
+ console.log(`-> ${p.id} [${p.subjectClass}] lane=${lane.id} tier=${tier}`);
+ const result = await runOne(args.baseUrl, p, lane.id, tier);
+ run.results.push(result);
+ completed += 1;
+ await queueSave(runPath, run);
+ console.log(
+ `<- ${p.id} lane=${lane.id} tier=${tier} status=${result.status} mean=${result.meanScore == null ? 'null' : result.meanScore.toFixed(2)} (${completed}/${tasks.length})`,
+ );
+ });
+
run.finishedAt = new Date().toISOString();
- await saveRun(runPath, run);
+ await queueSave(runPath, run);
console.log(`quality-bench: run complete -> ${runPath}`);
printSummary(run);
}
diff --git a/src/a-me.js b/src/a-me.js
index 4b71ad15f..74440fc13 100644
--- a/src/a-me.js
+++ b/src/a-me.js
@@ -340,7 +340,7 @@ function renderAvatarCards(host, avatars, agents) {
</div>
<div class="ame-avatar-footer-right">
<a class="ame-btn ghost tiny" href="/agents/${encodeURIComponent(av.id)}" title="View">View</a>
- <a class="ame-btn ghost tiny" href="/avatar-edit?id=${encodeURIComponent(av.id)}" title="Customize: wardrobe, sculpt, animate">Customize</a>
+ <a class="ame-btn ghost tiny" href="/avatars/${encodeURIComponent(av.id)}/edit" title="Customize: wardrobe, sculpt, animate">Customize</a>
<button class="ame-btn ghost tiny" data-action="selfie" data-avatar-id="${esc(av.id)}" title="Update from selfie">Selfie</button>
<button class="ame-btn ghost tiny" data-action="share" data-avatar-id="${esc(av.id)}" data-name="${name}" title="Share">Share</button>
<a class="ame-btn ghost tiny" href="/temporary?avatar=${encodeURIComponent(av.id)}" title="Walk">Walk</a>
diff --git a/src/avatar-edit.js b/src/avatar-edit.js
index 415f8de5f..35afe4541 100644
--- a/src/avatar-edit.js
+++ b/src/avatar-edit.js
@@ -51,6 +51,23 @@ const equipKind = ['glasses', 'earrings'].includes(editParams.get('equip-kind')
? editParams.get('equip-kind')
: 'hat';
+// The standalone /avatar-edit landing is retired (creation-consolidation C4):
+// the customizer is an in-flow step of an avatar, not a destination. The bare
+// path 301s to /avatars in vercel.json; the legacy ?id= form still renders here
+// so old links and bookmarks keep working, and gets rewritten to the canonical
+// /avatars/:id/edit URL in place — replaceState, not a navigation, so nothing
+// reloads and the equip handoff params survive.
+if (fromQuery && !fromPath && typeof history.replaceState === 'function') {
+ const rest = new URLSearchParams(editParams);
+ rest.delete('id');
+ const qs = rest.toString();
+ history.replaceState(
+ {},
+ '',
+ `/avatars/${encodeURIComponent(fromQuery)}/edit${qs ? `?${qs}` : ''}`,
+ );
+}
+
const $ = (id) => document.getElementById(id);
const esc = (s) =>
String(s ?? '').replace(
diff --git a/src/create-agent.js b/src/create-agent.js
index 8721fd1e0..f3b131ca5 100644
--- a/src/create-agent.js
+++ b/src/create-agent.js
@@ -308,6 +308,10 @@ async function boot() {
showStep(0);
}
+ // An avatar handoff always wins over a restored draft: the visitor just
+ // finished building that body and asked to turn it into an agent.
+ applyAvatarHandoff();
+
// Autosave the in-progress build: one delegated listener covers every text,
// select, and checkbox field; button-driven changes (model, voice, step nav)
// are caught by showStep and the unload flush below.
@@ -320,6 +324,63 @@ async function boot() {
applyAuthAffordances();
}
+// "Turn this into an agent" handoff. Every avatar surface that finishes with a
+// body (marketplace avatar cards, /create/selfie, the gallery) sends the visitor
+// here with ?avatar_id=&avatar_glb=&avatar_name=. This used to land on
+// /agent/new, which minted a blank draft agent on page load; that route now 301s
+// (or, when it carries these params, rewrites) to the canonical wizard, so the
+// handoff has to be honoured here or the pre-selected body is silently lost.
+//
+// The params seed step 2's "library" mode directly — validateStep(1) only needs
+// state.model.avatarId, so the selection is valid before /api/avatars has even
+// answered, and renderLibrary() re-applies the highlight once it does.
+function applyAvatarHandoff() {
+ const params = new URLSearchParams(location.search);
+ const avatarId = (params.get('avatar_id') || '').trim();
+ const avatarGlb = (params.get('avatar_glb') || '').trim();
+ const avatarName = (params.get('avatar_name') || '').trim();
+ if (!avatarId && !avatarGlb) return;
+
+ state.model = {
+ mode: avatarId ? 'library' : 'starter',
+ starterId: '',
+ starterUrl: avatarId ? '' : avatarGlb,
+ file: null,
+ fileName: '',
+ skipAck: false,
+ avatarId,
+ avatarUrl: avatarGlb,
+ avatarName: avatarName || 'Untitled',
+ _blobUrl: '',
+ };
+
+ // Open the pane that owns the seeded selection so the choice is visible
+ // rather than implied. The library tab's own handler kicks off the fetch.
+ const pane = avatarId ? 'library' : 'starter';
+ document.querySelector(`.model-tab[data-pane="${pane}"]`)?.click();
+ syncModelPreview();
+
+ const nameEl = $('f-name');
+ if (avatarName && nameEl && !nameEl.value.trim()) {
+ const suggested = `${avatarName} Agent`.slice(0, 60);
+ nameEl.value = suggested;
+ state.name = suggested;
+ $('name-count').textContent = `${suggested.length} / 60`;
+ }
+ setMsg(
+ avatarName
+ ? `${avatarName} is attached as the 3D body — name it and keep going.`
+ : 'Your avatar is attached as the 3D body — name it and keep going.',
+ 'ok',
+ );
+
+ // Canonicalise the URL: the handoff params have been consumed into state, and
+ // a rewritten /agent/new?… request still shows the retired path in the bar.
+ if (typeof history.replaceState === 'function') {
+ history.replaceState({}, '', '/create-agent');
+ }
+}
+
// The corner companion mints an ephemeral agent for signed-out visitors
// (src/agents/guest-agent.js) and its "Claim →" CTA lands here. Carry the
// draft's name into the wizard so the agent they met is the agent they create.
diff --git a/src/dashboard-next/components/palette.js b/src/dashboard-next/components/palette.js
index e153b11ee..ca375c526 100644
--- a/src/dashboard-next/components/palette.js
+++ b/src/dashboard-next/components/palette.js
@@ -7,6 +7,7 @@
import { NAV, ICONS, currentRoute } from '../nav.js';
import { esc, get, post, relTime, getMe } from '../api.js';
+import { rank } from '../../shared/fuzzy.js';
const RECENT_KEY = 'dn:recent';
const RECENT_LIMIT = 6;
@@ -80,26 +81,13 @@ function recordRecent() {
saveRecent(next);
}
-// ── Fuzzy scorer ──────────────────────────────────────────────────────────────
-
-function score(query, text) {
- const q = String(query || '').toLowerCase();
- const t = String(text || '').toLowerCase();
- if (!q) return 1;
- if (t === q) return 3;
- if (t.startsWith(q)) return 2;
- if (t.includes(q)) return 1;
- let qi = 0;
- for (const c of t) { if (c === q[qi]) qi++; }
- return qi === q.length ? 0.5 : 0;
-}
+// ── Fuzzy matching ────────────────────────────────────────────────────────────
+// Ranking lives in src/shared/fuzzy.js (uFuzzy). The label, group, and tags are
+// joined into one haystack so a match on any of them counts, and so uFuzzy can
+// rank across all three rather than taking the best of three flat tiers.
-function scoreItem(query, item) {
- const haystacks = [item.label, item.group, ...(item.tags || [])].filter(Boolean);
- let best = 0;
- for (const h of haystacks) { const s = score(query, h); if (s > best) best = s; }
- return best;
-}
+const itemHaystack = (item) =>
+ [item.label, item.group, ...(item.tags || [])].filter(Boolean).join(' ');
// ── Avatar search ─────────────────────────────────────────────────────────────
@@ -128,14 +116,11 @@ async function ensureAvatarFetch() {
function avatarItems(query) {
if (!query || query.length <= 2) return [];
if (!avatarCache) return [];
- const matches = [];
- for (const a of avatarCache) {
- const name = a.name || a.slug || a.id;
- const s = score(query, name);
- if (s > 0) matches.push({ score: s, avatar: a, name });
- }
- matches.sort((a, b) => b.score - a.score);
- return matches.slice(0, 5).map(({ avatar, name }) => ({
+ const named = avatarCache.map((a) => ({ avatar: a, name: a.name || a.slug || a.id }));
+ return rank(query, named, (n) => String(n.name ?? ''), { limit: 5 }).map(({ item }) => ({
+ avatar: item.avatar,
+ name: item.name,
+ })).map(({ avatar, name }) => ({
id: `avatar-${avatar.id}`,
label: name,
sublabel: 'Open avatar',
@@ -408,18 +393,19 @@ function render(query) {
activeItems.push(...items);
}
} else {
- const scored = [];
- for (const it of [...actions, ...nav, ...docs]) {
- const s = scoreItem(q, it);
- if (s > 0) scored.push({ s, it });
- }
- for (const it of avatars) scored.push({ s: 2, it });
- scored.sort((a, b) => {
+ // uFuzzy returns the matches already ordered by relevance; `rankKind`
+ // still groups by kind first, so relevance breaks ties inside a kind.
+ const ranked = rank(q, [...actions, ...nav, ...docs], itemHaystack)
+ .map(({ item }, i) => ({ it: item, r: i }));
+ // Avatars are matched separately (against their names only) and are
+ // appended in their own relevance order.
+ avatars.forEach((it, i) => ranked.push({ it, r: ranked.length + i }));
+ ranked.sort((a, b) => {
const kr = rankKind(a.it.kind) - rankKind(b.it.kind);
if (kr !== 0) return kr;
- return b.s - a.s;
+ return a.r - b.r;
});
- const flat = scored.map((x) => x.it);
+ const flat = ranked.map((x) => x.it);
if (flat.length) {
html += renderSection(`Results (${flat.length})`, flat, 0);
activeItems.push(...flat);
diff --git a/src/dashboard-next/pages/account.js b/src/dashboard-next/pages/account.js
index 5a9a1b87b..e92ba6eb5 100644
--- a/src/dashboard-next/pages/account.js
+++ b/src/dashboard-next/pages/account.js
@@ -6,6 +6,7 @@
import { mountShell } from '../shell.js';
import { requireUser, get, post, patch, del, esc, relTime, initialsOf } from '../api.js';
import { skeletonHTML, errorStateHTML, ensureStateKitStyles } from '../../shared/state-kit.js';
+import { toast } from '../../shared/toast.js';
// Loading placeholder — a stack of shimmer rows sized for a table/list slot.
function skelStack(count) {
@@ -67,33 +68,6 @@ function truncMid(s, head = 6, tail = 4) {
return `${str.slice(0, head)}…${str.slice(-tail)}`;
}
-function toast(msg) {
- let el = document.getElementById('dn-toast');
- if (!el) {
- el = document.createElement('div');
- el.id = 'dn-toast';
- el.setAttribute('role', 'status');
- el.setAttribute('aria-live', 'polite');
- el.style.cssText = `
- position:fixed;left:50%;bottom:32px;transform:translateX(-50%) translateY(20px);
- background:rgba(20,21,28,0.95);border:1px solid var(--nxt-stroke-strong);
- color:var(--nxt-ink);padding:9px 16px;border-radius:999px;font-size:13px;
- z-index:9999;opacity:0;transition:opacity .18s, transform .18s;
- backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
- box-shadow:0 8px 24px rgba(0,0,0,0.4);pointer-events:none;`;
- document.body.appendChild(el);
- }
- el.textContent = msg;
- requestAnimationFrame(() => {
- el.style.opacity = '1';
- el.style.transform = 'translateX(-50%) translateY(0)';
- });
- clearTimeout(el._t);
- el._t = setTimeout(() => {
- el.style.opacity = '0';
- el.style.transform = 'translateX(-50%) translateY(20px)';
- }, 1600);
-}
async function copyToClipboard(text) {
try {
diff --git a/src/dashboard-next/pages/agents.js b/src/dashboard-next/pages/agents.js
index 1df7a4220..240fc9057 100644
--- a/src/dashboard-next/pages/agents.js
+++ b/src/dashboard-next/pages/agents.js
@@ -21,35 +21,11 @@ import { coinChipHTML } from '../../shared/agent-coin.js';
import { walletChipHTML, wireWalletChips } from '../../shared/agent-wallet-chip.js';
import { skeletonHTML, emptyStateHTML, errorStateHTML, attachRetry, ensureStateKitStyles } from '../../shared/state-kit.js';
import { rigBadgeHTML, matchesRigFilter, RIG_FILTERS } from '../../shared/rig-status.js';
+import { toast } from '../../shared/toast.js';
ensureStateKitStyles();
const MONO = `'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`;
-function toast(msg) {
- let el = document.getElementById('dn-toast');
- if (!el) {
- el = document.createElement('div');
- el.id = 'dn-toast';
- el.style.cssText = `
- position:fixed;left:50%;bottom:32px;transform:translateX(-50%) translateY(20px);
- background:rgba(20,21,28,0.95);border:1px solid var(--nxt-stroke-strong);
- color:var(--nxt-ink);padding:9px 16px;border-radius:999px;font-size:13px;
- z-index:9999;opacity:0;transition:opacity .18s,transform .18s;
- backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
- box-shadow:0 8px 24px rgba(0,0,0,0.4);pointer-events:none;`;
- document.body.appendChild(el);
- }
- el.textContent = msg;
- requestAnimationFrame(() => {
- el.style.opacity = '1';
- el.style.transform = 'translateX(-50%) translateY(0)';
- });
- clearTimeout(el._t);
- el._t = setTimeout(() => {
- el.style.opacity = '0';
- el.style.transform = 'translateX(-50%) translateY(20px)';
- }, 1800);
-}
(async function boot() {
try {
diff --git a/src/dashboard-next/pages/referrals.js b/src/dashboard-next/pages/referrals.js
index 4c0408fb1..f189c2f66 100644
--- a/src/dashboard-next/pages/referrals.js
+++ b/src/dashboard-next/pages/referrals.js
@@ -8,6 +8,7 @@
import { mountShell } from '../shell.js';
import { requireUser, get, put, esc } from '../api.js';
import { renderQRToSVG, renderQRToCanvas } from '../../erc8004/qr.js';
+import { toast } from '../../shared/toast.js';
const MONO = `'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`;
@@ -25,34 +26,6 @@ const REFERRAL_PCT = 5;
// ── small utilities ─────────────────────────────────────────────────────────
-function toast(msg) {
- let el = document.getElementById('dn-toast');
- if (!el) {
- el = document.createElement('div');
- el.id = 'dn-toast';
- // Live region so copy/save feedback is announced to screen readers.
- el.setAttribute('role', 'status');
- el.setAttribute('aria-live', 'polite');
- el.style.cssText = `
- position:fixed;left:50%;bottom:32px;transform:translateX(-50%) translateY(20px);
- background:rgba(20,21,28,0.95);border:1px solid var(--nxt-stroke-strong);
- color:var(--nxt-ink);padding:9px 16px;border-radius:999px;font-size:13px;
- z-index:9999;opacity:0;transition:opacity .18s, transform .18s;
- backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
- box-shadow:0 8px 24px rgba(0,0,0,0.4);pointer-events:none;`;
- document.body.appendChild(el);
- }
- el.textContent = msg;
- requestAnimationFrame(() => {
- el.style.opacity = '1';
- el.style.transform = 'translateX(-50%) translateY(0)';
- });
- clearTimeout(el._t);
- el._t = setTimeout(() => {
- el.style.opacity = '0';
- el.style.transform = 'translateX(-50%) translateY(20px)';
- }, 1600);
-}
async function copyToClipboard(text) {
try {
diff --git a/src/dashboard-next/pages/settings.js b/src/dashboard-next/pages/settings.js
index 2c124fbf3..82821f931 100644
--- a/src/dashboard-next/pages/settings.js
+++ b/src/dashboard-next/pages/settings.js
@@ -22,38 +22,10 @@
import { mountShell } from '../shell.js';
import { requireUser, get, post, put, del, patch, esc, relTime, ApiError } from '../api.js';
import { emptyStateHTML, errorStateHTML, ensureStateKitStyles, attachRetry } from '../../shared/state-kit.js';
+import { toast } from '../../shared/toast.js';
const MONO = `'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`;
-function toast(msg) {
- let el = document.getElementById('dn-toast');
- if (!el) {
- el = document.createElement('div');
- el.id = 'dn-toast';
- // role=status + polite live region so copy/save/revoke feedback is
- // announced to screen readers, not just shown visually.
- el.setAttribute('role', 'status');
- el.setAttribute('aria-live', 'polite');
- el.style.cssText = `
- position:fixed;left:50%;bottom:32px;transform:translateX(-50%) translateY(20px);
- background:rgba(20,21,28,0.95);border:1px solid var(--nxt-stroke-strong);
- color:var(--nxt-ink);padding:9px 16px;border-radius:999px;font-size:13px;
- z-index:9999;opacity:0;transition:opacity .18s,transform .18s;
- backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
- box-shadow:0 8px 24px rgba(0,0,0,0.4);pointer-events:none;`;
- document.body.appendChild(el);
- }
- el.textContent = msg;
- requestAnimationFrame(() => {
- el.style.opacity = '1';
- el.style.transform = 'translateX(-50%) translateY(0)';
- });
- clearTimeout(el._t);
- el._t = setTimeout(() => {
- el.style.opacity = '0';
- el.style.transform = 'translateX(-50%) translateY(20px)';
- }, 1800);
-}
// Scoped styles for this page — the switch control and shared panel-header
// layout. Uses only design tokens; injected once.
diff --git a/src/dashboard-next/pages/sniper.js b/src/dashboard-next/pages/sniper.js
index c657f59c5..bd07101d5 100644
--- a/src/dashboard-next/pages/sniper.js
+++ b/src/dashboard-next/pages/sniper.js
@@ -17,6 +17,7 @@ import { requireUser, get, post, esc, relTime } from '../api.js';
import { StudioAdapter } from '../studio-adapter.js';
import { mountMoneyStudio } from '../../studio/money/money-studio.js';
import { skeletonHTML, emptyStateHTML, errorStateHTML, ensureStateKitStyles, attachRetry } from '../../shared/state-kit.js';
+import { toast } from '../../shared/toast.js';
const SOL = 1_000_000_000n;
const lamportsToSol = (l) => Number(BigInt(l || '0')) / 1e9;
@@ -1535,21 +1536,4 @@ function scheduleReconnect() {
// ── Toast ─────────────────────────────────────────────────────────────────────
-function toast(msg) {
- let el = document.getElementById('sn-toast');
- if (!el) {
- el = document.createElement('div');
- el.id = 'sn-toast';
- el.style.cssText = `position:fixed;left:50%;bottom:32px;transform:translateX(-50%) translateY(20px);
- background:rgba(20,21,28,0.95);border:1px solid var(--nxt-stroke-strong);
- color:var(--nxt-ink);padding:9px 18px;border-radius:999px;font-size:13px;
- z-index:9999;opacity:0;transition:opacity .18s,transform .18s;
- backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
- box-shadow:0 8px 24px rgba(0,0,0,.4);pointer-events:none;`;
- document.body.appendChild(el);
- }
- el.textContent = msg;
- requestAnimationFrame(() => { el.style.opacity = '1'; el.style.transform = 'translateX(-50%) translateY(0)'; });
- clearTimeout(el._t);
- el._t = setTimeout(() => { el.style.opacity = '0'; el.style.transform = 'translateX(-50%) translateY(20px)'; }, 2500);
-}
+
diff --git a/src/dashboard-next/pages/three-token.js b/src/dashboard-next/pages/three-token.js
index 363649644..0c9d794b6 100644
--- a/src/dashboard-next/pages/three-token.js
+++ b/src/dashboard-next/pages/three-token.js
@@ -16,6 +16,7 @@ import { fetchTokenConfig, fetchTokenPrice } from '../../token-pay.js';
import { fetchAllowanceStatus, grantAllowance, revokeAllowance } from '../../three-allowance.js';
import { createThreeTokenData } from '../../pump/three-token-data.js';
import { errorStateHTML, ensureStateKitStyles } from '../../shared/state-kit.js';
+import { toast } from '../../shared/toast.js';
const MONO = `'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`;
// THREE_MINT is fetched live from /api/token/config below. This fallback is
@@ -53,30 +54,6 @@ function pctColor(n) {
return +n >= 0 ? 'var(--nxt-success)' : 'var(--nxt-danger)';
}
-function toast(msg) {
- let el = document.getElementById('dn-toast');
- if (!el) {
- el = document.createElement('div');
- el.id = 'dn-toast';
- el.style.cssText = `position:fixed;left:50%;bottom:32px;transform:translateX(-50%) translateY(20px);
- background:rgba(20,21,28,0.95);border:1px solid var(--nxt-stroke-strong);
- color:var(--nxt-ink);padding:9px 16px;border-radius:999px;font-size:13px;
- z-index:9999;opacity:0;transition:opacity .18s,transform .18s;
- backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
- box-shadow:0 8px 24px rgba(0,0,0,0.4);pointer-events:none;`;
- document.body.appendChild(el);
- }
- el.textContent = msg;
- requestAnimationFrame(() => {
- el.style.opacity = '1';
- el.style.transform = 'translateX(-50%) translateY(0)';
- });
- clearTimeout(el._t);
- el._t = setTimeout(() => {
- el.style.opacity = '0';
- el.style.transform = 'translateX(-50%) translateY(20px)';
- }, 1800);
-}
// ── Boot ──────────────────────────────────────────────────────────────────────
diff --git a/src/dashboard-next/pages/tokens.js b/src/dashboard-next/pages/tokens.js
index 679530212..7610265a7 100644
--- a/src/dashboard-next/pages/tokens.js
+++ b/src/dashboard-next/pages/tokens.js
@@ -14,6 +14,7 @@
import { mountShell } from '../shell.js';
import { requireUser, get, esc, ApiError } from '../api.js';
import { errorStateHTML, emptyStateHTML, ensureStateKitStyles, attachRetry } from '../../shared/state-kit.js';
+import { toast } from '../../shared/toast.js';
// Page-scoped polish that the shared shell CSS doesn't cover: keyboard focus
// rings on this page's custom controls, stat-cell hover feedback, and a
@@ -40,31 +41,6 @@ function ensureTokensStyles() {
(document.head || document.documentElement).appendChild(style);
}
-function toast(msg) {
- let el = document.getElementById('dn-toast');
- if (!el) {
- el = document.createElement('div');
- el.id = 'dn-toast';
- el.style.cssText = `
- position:fixed;left:50%;bottom:32px;transform:translateX(-50%) translateY(20px);
- background:rgba(20,21,28,0.95);border:1px solid var(--nxt-stroke-strong);
- color:var(--nxt-ink);padding:9px 16px;border-radius:999px;font-size:13px;
- z-index:9999;opacity:0;transition:opacity .18s,transform .18s;
- backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
- box-shadow:0 8px 24px rgba(0,0,0,0.4);pointer-events:none;`;
- document.body.appendChild(el);
- }
- el.textContent = msg;
- requestAnimationFrame(() => {
- el.style.opacity = '1';
- el.style.transform = 'translateX(-50%) translateY(0)';
- });
- clearTimeout(el._t);
- el._t = setTimeout(() => {
- el.style.opacity = '0';
- el.style.transform = 'translateX(-50%) translateY(20px)';
- }, 1800);
-}
(async function boot() {
try {
diff --git a/src/dashboard-next/pages/walk.js b/src/dashboard-next/pages/walk.js
index 6c5ec7ea6..d3fa679b9 100644
--- a/src/dashboard-next/pages/walk.js
+++ b/src/dashboard-next/pages/walk.js
@@ -24,6 +24,7 @@ import {
resolveAvatarUrl,
} from '../../../walk-sdk/src/roster.js';
import { DEFAULT_EXCLUDED_PREFIXES } from '../../../walk-sdk/src/config.js';
+import { toast } from '../../shared/toast.js';
const MONO = `'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`;
@@ -621,28 +622,4 @@ function injectWalkStyles() {
document.head.appendChild(style);
}
-function toast(msg) {
- let el = document.getElementById('dn-toast');
- if (!el) {
- el = document.createElement('div');
- el.id = 'dn-toast';
- el.style.cssText = `
- position:fixed;left:50%;bottom:32px;transform:translateX(-50%) translateY(20px);
- background:rgba(20,21,28,0.95);border:1px solid var(--nxt-stroke-strong);
- color:var(--nxt-ink);padding:9px 16px;border-radius:999px;font-size:13px;
- z-index:9999;opacity:0;transition:opacity .18s,transform .18s;
- backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
- box-shadow:0 8px 24px rgba(0,0,0,0.4);pointer-events:none;`;
- document.body.appendChild(el);
- }
- el.textContent = msg;
- requestAnimationFrame(() => {
- el.style.opacity = '1';
- el.style.transform = 'translateX(-50%) translateY(0)';
- });
- clearTimeout(el._t);
- el._t = setTimeout(() => {
- el.style.opacity = '0';
- el.style.transform = 'translateX(-50%) translateY(20px)';
- }, 1800);
-}
+
diff --git a/src/dashboard-next/pages/wallet-grinder.js b/src/dashboard-next/pages/wallet-grinder.js
index 537108d9c..780a13847 100644
--- a/src/dashboard-next/pages/wallet-grinder.js
+++ b/src/dashboard-next/pages/wallet-grinder.js
@@ -30,6 +30,7 @@ import {
letterCount as evmLetterCount,
} from '../../eth/vanity/eoa-grinder.js';
import { MAX_PATTERN_LENGTH as EVM_MAX } from '../../eth/vanity/validation.js';
+import { toast } from '../../shared/toast.js';
const MONO = `'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`;
const HW = (typeof navigator !== 'undefined' && navigator.hardwareConcurrency) || 4;
@@ -555,34 +556,6 @@ function fmtBig(n) {
return String(Math.round(n));
}
-function toast(msg) {
- let el = document.getElementById('dn-toast');
- if (!el) {
- el = document.createElement('div');
- el.id = 'dn-toast';
- // Live region so copy/download/match feedback is announced, not just shown.
- el.setAttribute('role', 'status');
- el.setAttribute('aria-live', 'polite');
- el.style.cssText = `
- position:fixed;left:50%;bottom:32px;transform:translateX(-50%) translateY(20px);
- background:rgba(20,21,28,0.95);border:1px solid var(--nxt-stroke-strong);
- color:var(--nxt-ink);padding:9px 16px;border-radius:999px;font-size:13px;
- z-index:9999;opacity:0;transition:opacity .18s,transform .18s;
- backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
- box-shadow:0 8px 24px rgba(0,0,0,0.4);pointer-events:none;`;
- document.body.appendChild(el);
- }
- el.textContent = msg;
- requestAnimationFrame(() => {
- el.style.opacity = '1';
- el.style.transform = 'translateX(-50%) translateY(0)';
- });
- clearTimeout(el._t);
- el._t = setTimeout(() => {
- el.style.opacity = '0';
- el.style.transform = 'translateX(-50%) translateY(20px)';
- }, 1800);
-}
// ── Styles ───────────────────────────────────────────────────────────────────
diff --git a/src/editor/embed-editor.js b/src/editor/embed-editor.js
index fedb1fc23..85db23afd 100644
--- a/src/editor/embed-editor.js
+++ b/src/editor/embed-editor.js
@@ -112,9 +112,21 @@ function mountEmbedEditor(root, opts = {}) {
// ── Left: controls panel ───────────────────────────────────────────────
const panel = el('div', { className: 'ee-panel' });
+ // The two embed builders are one product with two jobs: this editor makes a
+ // snippet in seconds with no account, Widget Studio saves reusable widgets
+ // with brand settings and analytics. Each says so and points at the other.
+ const studioLink = el('a', { className: 'ee-crosslink', href: '/studio' });
+ studioLink.textContent = 'Widget Studio →';
+ const crossline = el('p', { className: 'ee-subtitle ee-crossline' });
+ crossline.append(
+ document.createTextNode('Want a saved, brandable widget you can update later? '),
+ studioLink,
+ );
+
panel.append(
el('h1', { className: 'ee-title', textContent: 'Embed editor' }),
- el('p', { className: 'ee-subtitle', textContent: 'Drop a live 3D avatar onto any site. Configure, preview, copy.' }),
+ el('p', { className: 'ee-subtitle', textContent: 'Drop a live 3D avatar onto any site. Configure, preview, copy. No account needed.' }),
+ crossline,
);
// Mode toggle
@@ -692,6 +704,10 @@ function injectStyles() {
.ee-panel { padding:24px; border-right:1px solid #1c2026; overflow-y:auto; background:#0d0f12; }
.ee-title { font-size:18px; margin:0 0 4px; font-weight:700; }
.ee-subtitle { font-size:13px; color:#71717a; margin:0 0 22px; line-height:1.5; }
+ .ee-crossline { margin:-14px 0 22px; }
+ .ee-crosslink { color:#a1a1aa; text-decoration:none; border-bottom:1px solid #3a3f47; transition:color .15s ease, border-color .15s ease; }
+ .ee-crosslink:hover, .ee-crosslink:focus-visible { color:#fff; border-color:#fff; }
+ .ee-crosslink:focus-visible { outline:2px solid #6366f1; outline-offset:3px; border-radius:2px; }
.ee-field { display:block; margin-bottom:16px; }
.ee-label { display:block; font-size:12px; color:#a1a1aa; margin-bottom:7px; font-weight:600; }
.ee-hint { font-size:12px; color:#71717a; margin:-8px 0 16px; min-height:16px; line-height:1.4; }
diff --git a/src/fits-lib.js b/src/fits-lib.js
new file mode 100644
index 000000000..81291a556
--- /dev/null
+++ b/src/fits-lib.js
@@ -0,0 +1,159 @@
+/**
+ * Pure helpers for /fits (the public cosmetics economy page).
+ *
+ * DOM-free and network-free so the money formatting, rarity ordering, and the
+ * derived headline numbers are unit-testable. Every input here comes from
+ * /api/cosmetics/leaderboard or /api/cosmetics/earnings, which read the settled
+ * -sale ledger; nothing is estimated.
+ */
+
+export const RARITY_LABEL = {
+ common: 'Common',
+ rare: 'Rare',
+ epic: 'Epic',
+ legendary: 'Legendary',
+};
+
+// Ascending scarcity. Used to break ties when two fits have the same owner
+// count, so a legendary never sorts below a rare with equal scarcity.
+const RARITY_ORDER = ['common', 'rare', 'epic', 'legendary'];
+
+/** @param {string|null|undefined} rarity */
+export function rarityRank(rarity) {
+ const i = RARITY_ORDER.indexOf(String(rarity || '').toLowerCase());
+ return i === -1 ? 0 : i;
+}
+
+/**
+ * USDC display. The ledger reports decimal USDC (not atomics), and cosmetic
+ * prices run to fractions of a cent, so keep precision below a cent instead of
+ * collapsing every micro-sale to $0.00.
+ * @param {number|string|null|undefined} usdc
+ */
+export function fmtUsdc(usdc) {
+ const n = Number(usdc);
+ if (!Number.isFinite(n)) return '$0.00';
+ if (n === 0) return '$0.00';
+ if (Math.abs(n) < 0.01) return `$${n.toFixed(4).replace(/0+$/, '').replace(/\.$/, '')}`;
+ if (Math.abs(n) >= 1000) return `$${Math.round(n).toLocaleString('en-US')}`;
+ return `$${n.toFixed(2)}`;
+}
+
+/** @param {number|string|null|undefined} n */
+export function fmtCount(n) {
+ const v = Number(n);
+ if (!Number.isFinite(v)) return '0';
+ return v.toLocaleString('en-US');
+}
+
+/** @param {string} addr */
+export function shortWallet(addr) {
+ const s = String(addr || '');
+ if (s.length <= 12) return s;
+ return `${s.slice(0, 4)}…${s.slice(-4)}`;
+}
+
+/**
+ * Collector accounts are a mix of real wallets and guest session handles
+ * (`g_*` / `guest-*`). A guest handle is not an address, so truncating it in
+ * the middle produces noise; label it plainly instead.
+ * @param {string} account
+ */
+export function displayAccount(account) {
+ const s = String(account || '');
+ if (/^(g_|guest-)/.test(s)) return 'Guest';
+ return shortWallet(s);
+}
+
+/**
+ * Fits ranked by scarcity: fewest owners first, then by rarity tier.
+ * @param {Array<{owners?: number, rarity?: string}>} fits
+ */
+export function rankFits(fits) {
+ return [...(fits || [])].sort((a, b) => {
+ const oa = Number(a.owners) || 0;
+ const ob = Number(b.owners) || 0;
+ if (oa !== ob) return oa - ob;
+ return rarityRank(b.rarity) - rarityRank(a.rarity);
+ });
+}
+
+/**
+ * The headline numbers, derived from the board rather than fetched separately
+ * so they can never disagree with the rows rendered underneath them.
+ *
+ * `grossUsdc` sums the recent-sales window the API returns, so it is labelled
+ * as that window in the UI and never presented as an all-time total.
+ *
+ * @param {{rarestFits?: Array, topCollectors?: Array, topCreators?: Array, recent?: Array}} board
+ */
+export function summarizeBoard(board) {
+ const fits = board?.rarestFits || [];
+ const collectors = board?.topCollectors || [];
+ const creators = board?.topCreators || [];
+ const recent = board?.recent || [];
+
+ let grossUsdc = 0;
+ for (const sale of recent) {
+ const n = Number(sale?.priceUsdc);
+ if (Number.isFinite(n)) grossUsdc += n;
+ }
+ let creatorEarnedUsdc = 0;
+ let creatorSales = 0;
+ for (const c of creators) {
+ const n = Number(c?.earnedUsdc);
+ if (Number.isFinite(n)) creatorEarnedUsdc += n;
+ const s = Number(c?.sales);
+ if (Number.isFinite(s)) creatorSales += s;
+ }
+ const rarest = rankFits(fits)[0] || null;
+
+ return {
+ fitsTracked: fits.length,
+ collectors: collectors.length,
+ creators: creators.length,
+ creatorSales,
+ creatorEarnedUsdc,
+ recentGrossUsdc: grossUsdc,
+ recentSales: recent.length,
+ rarest,
+ };
+}
+
+/** True when the board carries nothing worth rendering. */
+export function boardIsEmpty(board) {
+ if (!board) return true;
+ return (
+ !(board.rarestFits || []).length &&
+ !(board.topCollectors || []).length &&
+ !(board.topCreators || []).length &&
+ !(board.recent || []).length
+ );
+}
+
+/**
+ * Deep link to the coin world a fit belongs to. Returns null when the sale
+ * carries no mint, so callers render plain text instead of a dead link.
+ * @param {string|null|undefined} mint
+ */
+export function coinWorldUrl(mint) {
+ const m = String(mint || '').trim();
+ if (!m) return null;
+ return `/play?coin=${encodeURIComponent(m)}`;
+}
+
+/** @param {string|null|undefined} wallet */
+export function solscanAccountUrl(wallet) {
+ const w = String(wallet || '').trim();
+ if (!w) return null;
+ return `https://solscan.io/account/${encodeURIComponent(w)}`;
+}
+
+/**
+ * Basic Solana address shape check, mirroring `isWallet` on the server so the
+ * creator lookup rejects obvious typos before spending a request.
+ * @param {string} value
+ */
+export function looksLikeWallet(value) {
+ return /^[A-HJ-NP-Za-km-z1-9]{32,44}$/.test(String(value || '').trim());
+}
diff --git a/src/fits.css b/src/fits.css
new file mode 100644
index 000000000..de5f0ea6c
--- /dev/null
+++ b/src/fits.css
@@ -0,0 +1,582 @@
+/* The cosmetics economy (/fits). Self-contained (ft- prefix), theme-token
+ driven so it tracks light/dark. Amber/violet tint: this is the "what people
+ wear and what creators earn" surface, distinct from the green revenue page
+ and the violet receipt vault. */
+
+.ft-shell {
+ --ft-accent: #f0a44a;
+ --ft-accent-2: #b07bf4;
+ --ft-grad: linear-gradient(135deg, var(--ft-accent) 0%, var(--ft-accent-2) 100%);
+ --ft-common: #8b94a7;
+ --ft-rare: #4aa3f0;
+ --ft-epic: #b07bf4;
+ --ft-legendary: #f0a44a;
+ position: relative;
+ max-width: 1180px;
+ margin: 0 auto;
+ padding: clamp(20px, 5vw, 56px) clamp(16px, 4vw, 32px) 96px;
+ font-family: var(--font-body, system-ui, sans-serif);
+ color: var(--ink, #d8d8d8);
+}
+
+.ft-glow {
+ position: absolute;
+ inset: -10% auto auto auto;
+ left: max(-20%, calc((100% - 100vw) / 2 + 12px));
+ right: max(-20%, calc((100% - 100vw) / 2 + 12px));
+ height: 400px;
+ mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
+ -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
+ background:
+ radial-gradient(
+ 60% 80% at 22% 0%,
+ color-mix(in srgb, var(--ft-accent) 16%, transparent),
+ transparent 70%
+ ),
+ radial-gradient(
+ 50% 70% at 82% 8%,
+ color-mix(in srgb, var(--ft-accent-2) 15%, transparent),
+ transparent 70%
+ );
+ filter: blur(20px);
+ pointer-events: none;
+ z-index: 0;
+ opacity: 0.8;
+}
+.ft-shell > *:not(.ft-glow) {
+ position: relative;
+ z-index: 1;
+}
+
+/* ── hero ─────────────────────────────────────────────────────────────────── */
+.ft-hero {
+ display: flex;
+ align-items: flex-end;
+ justify-content: space-between;
+ gap: var(--space-lg, 24px);
+ flex-wrap: wrap;
+ margin-bottom: var(--space-xl, 32px);
+}
+.ft-kicker {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5em;
+ font-size: 0.8rem;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 60%, transparent);
+ margin: 0 0 0.6em;
+}
+.ft-live-dot {
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ background: var(--ft-accent);
+ box-shadow: 0 0 0 0 color-mix(in srgb, var(--ft-accent) 60%, transparent);
+ animation: ft-pulse 2.4s ease-out infinite;
+}
+@keyframes ft-pulse {
+ 70% {
+ box-shadow: 0 0 0 8px transparent;
+ }
+ 100% {
+ box-shadow: 0 0 0 0 transparent;
+ }
+}
+.ft-title {
+ font-family: var(--font-display, inherit);
+ font-size: clamp(1.9rem, 5vw, 3rem);
+ line-height: 1.05;
+ margin: 0 0 0.4em;
+}
+.ft-title em {
+ font-style: normal;
+ background: var(--ft-grad);
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+}
+.ft-sub {
+ max-width: 62ch;
+ margin: 0;
+ line-height: 1.6;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 78%, transparent);
+}
+.ft-sub a {
+ color: inherit;
+ text-decoration: underline;
+ text-underline-offset: 2px;
+}
+.ft-updated {
+ font-size: 0.78rem;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 45%, transparent);
+ white-space: nowrap;
+}
+
+/* ── KPI strip ────────────────────────────────────────────────────────────── */
+.ft-kpis {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
+ gap: 12px;
+ margin-bottom: var(--space-xl, 32px);
+}
+.ft-kpi {
+ border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
+ border-radius: var(--radius-md, 12px);
+ background: color-mix(in srgb, var(--panel, #131318) 88%, transparent);
+ padding: 14px 16px;
+}
+.ft-kpi--hero {
+ border-color: color-mix(in srgb, var(--ft-accent) 32%, transparent);
+ background:
+ linear-gradient(135deg, color-mix(in srgb, var(--ft-accent) 10%, transparent), transparent 60%),
+ color-mix(in srgb, var(--panel, #131318) 88%, transparent);
+}
+.ft-kpi--hero .ft-kpi-val {
+ font-size: 1.6rem;
+ background: var(--ft-grad);
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+}
+.ft-kpi-label {
+ display: block;
+ font-size: 0.72rem;
+ letter-spacing: 0.07em;
+ text-transform: uppercase;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 55%, transparent);
+ margin-bottom: 0.35em;
+}
+.ft-kpi-val {
+ display: block;
+ font-size: 1.25rem;
+ font-weight: 650;
+ font-variant-numeric: tabular-nums;
+ overflow-wrap: anywhere;
+}
+.ft-kpi-sub {
+ display: block;
+ margin-top: 0.3em;
+ font-size: 0.72rem;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 45%, transparent);
+}
+
+/* ── layout ───────────────────────────────────────────────────────────────── */
+.ft-section {
+ margin-bottom: var(--space-xl, 32px);
+}
+.ft-section-h {
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: 12px;
+ margin-bottom: var(--space-md, 16px);
+ flex-wrap: wrap;
+}
+.ft-section-h h2 {
+ font-size: 1.05rem;
+ margin: 0;
+}
+.ft-section-note {
+ font-size: 0.8rem;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 50%, transparent);
+}
+.ft-cols {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
+ gap: var(--space-lg, 24px);
+}
+
+/* ── fit cards ────────────────────────────────────────────────────────────── */
+.ft-fits {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
+ gap: 12px;
+}
+.ft-card {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+ align-items: flex-start;
+ border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
+ border-radius: var(--radius-md, 12px);
+ background: color-mix(in srgb, var(--panel, #131318) 84%, transparent);
+ padding: 14px;
+ text-decoration: none;
+ color: inherit;
+ transition:
+ border-color 0.15s ease,
+ transform 0.15s ease,
+ box-shadow 0.15s ease;
+ animation: ft-enter 0.25s ease both;
+}
+a.ft-card:hover {
+ border-color: color-mix(in srgb, var(--ft-accent) 45%, transparent);
+ transform: translateY(-2px);
+ box-shadow: 0 8px 24px color-mix(in srgb, var(--ft-accent) 14%, transparent);
+}
+a.ft-card:focus-visible {
+ outline: 2px solid var(--ft-accent);
+ outline-offset: 2px;
+}
+@keyframes ft-enter {
+ from {
+ opacity: 0;
+ transform: translateY(4px);
+ }
+ to {
+ opacity: 1;
+ transform: none;
+ }
+}
+.ft-card-art {
+ width: 72px;
+ height: 72px;
+ border-radius: 10px;
+ object-fit: cover;
+ background: color-mix(in srgb, var(--ink, #d8d8d8) 6%, transparent);
+}
+.ft-card-art--none {
+ display: grid;
+ place-items: center;
+ font-size: 0.8rem;
+ text-transform: uppercase;
+ letter-spacing: 0.06em;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 40%, transparent);
+}
+.ft-card-name {
+ font-weight: 620;
+ font-size: 0.92rem;
+ line-height: 1.25;
+}
+.ft-card-meta {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5em;
+ flex-wrap: wrap;
+}
+.ft-slot {
+ font-size: 0.72rem;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 50%, transparent);
+ text-transform: capitalize;
+}
+.ft-card-owners {
+ font-size: 0.78rem;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 62%, transparent);
+ font-variant-numeric: tabular-nums;
+}
+
+/* ── rarity pills ─────────────────────────────────────────────────────────── */
+.ft-pill {
+ font-size: 0.68rem;
+ letter-spacing: 0.05em;
+ text-transform: uppercase;
+ padding: 0.15em 0.6em;
+ border-radius: 999px;
+ border: 1px solid currentColor;
+ white-space: nowrap;
+}
+.ft-r-common {
+ color: var(--ft-common);
+}
+.ft-r-rare {
+ color: var(--ft-rare);
+}
+.ft-r-epic {
+ color: var(--ft-epic);
+}
+.ft-r-legendary {
+ color: var(--ft-legendary);
+}
+
+/* ── rows / lists ─────────────────────────────────────────────────────────── */
+.ft-list {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+}
+.ft-row {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ border: 1px solid var(--line, rgba(255, 255, 255, 0.07));
+ border-radius: var(--radius-md, 10px);
+ background: color-mix(in srgb, var(--panel, #131318) 80%, transparent);
+ padding: 10px 14px;
+ font-size: 0.88rem;
+ transition: border-color 0.15s ease;
+ animation: ft-enter 0.25s ease both;
+}
+.ft-row:hover {
+ border-color: color-mix(in srgb, var(--ft-accent) 32%, transparent);
+}
+.ft-rank {
+ font-variant-numeric: tabular-nums;
+ font-size: 0.78rem;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 40%, transparent);
+ min-width: 1.4em;
+}
+.ft-row-main {
+ flex: 1 1 auto;
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-family: var(--font-mono, ui-monospace, monospace);
+ color: inherit;
+ text-decoration: none;
+}
+a.ft-row-main:hover {
+ color: var(--ft-accent);
+ text-decoration: underline;
+}
+.ft-row-sub {
+ font-size: 0.78rem;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 52%, transparent);
+ white-space: nowrap;
+}
+.ft-row-val {
+ font-variant-numeric: tabular-nums;
+ font-weight: 620;
+ white-space: nowrap;
+}
+.ft-earn {
+ color: color-mix(in srgb, var(--ft-accent) 88%, var(--ink, #fff));
+}
+.ft-row-when {
+ font-size: 0.74rem;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 42%, transparent);
+ white-space: nowrap;
+}
+.ft-mini {
+ background: transparent;
+ border: 1px solid var(--line, rgba(255, 255, 255, 0.14));
+ border-radius: 8px;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 72%, transparent);
+ font: inherit;
+ font-size: 0.74rem;
+ padding: 0.2em 0.65em;
+ cursor: pointer;
+ transition:
+ border-color 0.15s ease,
+ color 0.15s ease;
+}
+.ft-mini:hover {
+ border-color: var(--ft-accent);
+ color: var(--ink, #fff);
+}
+.ft-mini:focus-visible {
+ outline: 2px solid var(--ft-accent);
+ outline-offset: 2px;
+}
+
+/* ── creator lookup ───────────────────────────────────────────────────────── */
+.ft-lookup {
+ border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
+ border-radius: var(--radius-lg, 16px);
+ background: color-mix(in srgb, var(--panel, #131318) 86%, transparent);
+ padding: clamp(18px, 3vw, 28px);
+}
+.ft-lookup h2 {
+ margin: 0 0 0.35em;
+ font-size: 1.05rem;
+}
+.ft-lookup p {
+ margin: 0 0 1em;
+ max-width: 58ch;
+ line-height: 1.55;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 68%, transparent);
+ font-size: 0.9rem;
+}
+.ft-lookup-form {
+ display: flex;
+ gap: 10px;
+ flex-wrap: wrap;
+}
+.ft-input {
+ flex: 1 1 260px;
+ min-width: 0;
+ background: color-mix(in srgb, var(--panel, #131318) 92%, transparent);
+ border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
+ border-radius: var(--radius-md, 10px);
+ color: inherit;
+ font: inherit;
+ font-size: 0.9rem;
+ font-family: var(--font-mono, ui-monospace, monospace);
+ padding: 0.6em 0.9em;
+ transition: border-color 0.15s ease;
+}
+.ft-input:focus {
+ outline: none;
+ border-color: var(--ft-accent);
+}
+.ft-btn {
+ border-radius: 999px;
+ padding: 0.6em 1.3em;
+ font: inherit;
+ font-weight: 620;
+ border: 1px solid transparent;
+ background: var(--ft-grad);
+ color: #14100b;
+ cursor: pointer;
+ transition:
+ transform 0.15s ease,
+ box-shadow 0.15s ease;
+}
+.ft-btn:hover {
+ transform: translateY(-1px);
+ box-shadow: 0 6px 20px color-mix(in srgb, var(--ft-accent) 34%, transparent);
+}
+.ft-btn:active {
+ transform: translateY(0);
+}
+.ft-btn:focus-visible {
+ outline: 2px solid var(--ft-accent);
+ outline-offset: 2px;
+}
+
+.ft-earnings {
+ margin-top: var(--space-lg, 20px);
+ border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
+ padding-top: var(--space-lg, 20px);
+}
+.ft-earn-head {
+ display: flex;
+ align-items: baseline;
+ gap: 0.8em;
+ flex-wrap: wrap;
+ margin-bottom: 1em;
+}
+.ft-earn-wallet {
+ font-family: var(--font-mono, ui-monospace, monospace);
+ font-size: 0.9rem;
+}
+.ft-earn-wallet a {
+ color: inherit;
+}
+.ft-earn-total {
+ font-size: 1.6rem;
+ font-weight: 680;
+ font-variant-numeric: tabular-nums;
+ background: var(--ft-grad);
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+}
+.ft-earn-label {
+ font-size: 0.75rem;
+ text-transform: uppercase;
+ letter-spacing: 0.06em;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 45%, transparent);
+}
+.ft-earn-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
+ gap: 10px;
+ margin-bottom: 1.2em;
+}
+.ft-earn-grid > div {
+ border: 1px solid var(--line, rgba(255, 255, 255, 0.07));
+ border-radius: 10px;
+ padding: 10px 12px;
+ background: color-mix(in srgb, var(--panel, #131318) 78%, transparent);
+}
+.ft-earn-block {
+ margin-top: 1.2em;
+}
+.ft-earn-block h3 {
+ font-size: 0.8rem;
+ text-transform: uppercase;
+ letter-spacing: 0.06em;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 50%, transparent);
+ margin: 0 0 0.6em;
+}
+
+/* ── states ───────────────────────────────────────────────────────────────── */
+.ft-skeleton {
+ border-color: transparent;
+ background: linear-gradient(
+ 90deg,
+ color-mix(in srgb, var(--panel, #131318) 85%, transparent) 25%,
+ color-mix(in srgb, var(--ink, #d8d8d8) 8%, transparent) 50%,
+ color-mix(in srgb, var(--panel, #131318) 85%, transparent) 75%
+ );
+ background-size: 200% 100%;
+ animation: ft-shimmer 1.2s linear infinite;
+}
+.ft-card.ft-skeleton {
+ height: 156px;
+}
+li.ft-row.ft-skeleton,
+div.ft-row.ft-skeleton {
+ height: 42px;
+}
+@keyframes ft-shimmer {
+ from {
+ background-position: 200% 0;
+ }
+ to {
+ background-position: -200% 0;
+ }
+}
+@media (prefers-reduced-motion: reduce) {
+ .ft-skeleton,
+ .ft-row,
+ .ft-card,
+ .ft-live-dot {
+ animation: none;
+ }
+}
+
+.ft-none {
+ font-size: 0.86rem;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 50%, transparent);
+ margin: 0;
+ padding: 12px 2px;
+ list-style: none;
+}
+.ft-empty,
+.ft-error {
+ border: 1px dashed var(--line, rgba(255, 255, 255, 0.14));
+ border-radius: var(--radius-lg, 16px);
+ padding: clamp(22px, 4vw, 40px);
+ text-align: center;
+ margin-bottom: var(--space-lg, 24px);
+}
+.ft-empty h2,
+.ft-error h2 {
+ margin: 0 0 0.4em;
+ font-size: 1.05rem;
+}
+.ft-empty p,
+.ft-error p {
+ margin: 0 auto 0.8em;
+ max-width: 52ch;
+ line-height: 1.6;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 70%, transparent);
+}
+.ft-empty a {
+ color: var(--ft-accent);
+}
+.ft-fineprint {
+ margin-top: var(--space-xl, 32px);
+ font-size: 0.8rem;
+ line-height: 1.55;
+ color: color-mix(in srgb, var(--ink, #d8d8d8) 50%, transparent);
+ max-width: 74ch;
+}
+.ft-fineprint a {
+ color: inherit;
+}
+
+@media (max-width: 520px) {
+ .ft-row {
+ flex-wrap: wrap;
+ }
+ .ft-row-when {
+ width: 100%;
+ }
+}
diff --git a/src/fits.js b/src/fits.js
new file mode 100644
index 000000000..0159a845c
--- /dev/null
+++ b/src/fits.js
@@ -0,0 +1,351 @@
+/**
+ * /fits: the public cosmetics economy.
+ *
+ * Premium cosmetics on three.ws are bought with real USDC, and every sale
+ * splits revenue with the creator of the coin world the fit belongs to. That
+ * whole ledger existed only behind a panel inside /play. This page makes it a
+ * first-class surface: the scarcest fits, the collectors wearing them, the
+ * creators actually getting paid, a live sales drip, and a per-wallet earnings
+ * lookup any creator can open without an account.
+ *
+ * GET /api/cosmetics/leaderboard rarest fits, top collectors/creators, recent
+ * GET /api/cosmetics/earnings?creator=<wallet> one creator's settled earnings
+ *
+ * Every number is read from the settled-sale ledger. A quiet economy shows an
+ * honest empty state rather than filler.
+ */
+import {
+ RARITY_LABEL,
+ fmtUsdc,
+ fmtCount,
+ shortWallet,
+ displayAccount,
+ rankFits,
+ summarizeBoard,
+ boardIsEmpty,
+ coinWorldUrl,
+ solscanAccountUrl,
+ looksLikeWallet,
+} from './fits-lib.js';
+import { timeAgo } from './shared/pulse-format.js';
+
+const BOARD_URL = '/api/cosmetics/leaderboard?limit=24';
+const EARNINGS_URL = '/api/cosmetics/earnings';
+const REFRESH_MS = 45_000;
+
+const $ = (id) => document.getElementById(id);
+
+const state = { board: null, refreshTimer: null };
+
+function esc(s) {
+ return String(s ?? '').replace(
+ /[&<>"']/g,
+ (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[c],
+ );
+}
+
+function rarityPill(rarity) {
+ const key = String(rarity || 'common').toLowerCase();
+ return `<span class="ft-pill ft-r-${esc(key)}">${esc(RARITY_LABEL[key] || key)}</span>`;
+}
+
+// ── board ────────────────────────────────────────────────────────────────────
+
+async function loadBoard() {
+ const res = await fetch(BOARD_URL, { headers: { accept: 'application/json' } });
+ if (!res.ok) throw new Error(`The cosmetics ledger returned ${res.status}.`);
+ return res.json();
+}
+
+async function refresh({ silent = false } = {}) {
+ if (!silent) renderSkeleton();
+ try {
+ state.board = await loadBoard();
+ renderBoard();
+ } catch (err) {
+ if (!state.board) renderBoardError(err?.message || 'Could not load the cosmetics ledger.');
+ }
+}
+
+function renderSkeleton() {
+ $('ft-board-error').hidden = true;
+ $('ft-fits').innerHTML = Array.from({ length: 4 })
+ .map(() => '<div class="ft-card ft-skeleton" aria-hidden="true"></div>')
+ .join('');
+ for (const id of ['ft-collectors', 'ft-creators', 'ft-recent']) {
+ $(id).innerHTML = Array.from({ length: 3 })
+ .map(() => '<li class="ft-row ft-skeleton" aria-hidden="true"></li>')
+ .join('');
+ }
+}
+
+function renderBoardError(message) {
+ const el = $('ft-board-error');
+ el.hidden = false;
+ $('ft-board-error-msg').textContent = message;
+ $('ft-fits').innerHTML = '';
+ for (const id of ['ft-collectors', 'ft-creators', 'ft-recent']) $(id).innerHTML = '';
+}
+
+function renderBoard() {
+ const board = state.board;
+ $('ft-board-error').hidden = true;
+ const s = summarizeBoard(board);
+
+ $('ft-k-gross').textContent = fmtUsdc(s.recentGrossUsdc);
+ $('ft-k-gross-note').textContent = s.recentSales
+ ? `across the last ${fmtCount(s.recentSales)} sales`
+ : 'no sales yet';
+ $('ft-k-creators').textContent = fmtCount(s.creators);
+ $('ft-k-creators-note').textContent = `${fmtUsdc(s.creatorEarnedUsdc)} earned`;
+ $('ft-k-collectors').textContent = fmtCount(s.collectors);
+ $('ft-k-fits').textContent = fmtCount(s.fitsTracked);
+ $('ft-k-fits-note').textContent = s.rarest
+ ? `rarest: ${s.rarest.name} (${fmtCount(s.rarest.owners)} owner${Number(s.rarest.owners) === 1 ? '' : 's'})`
+ : 'none minted yet';
+
+ $('ft-empty').hidden = !boardIsEmpty(board);
+
+ renderFits(rankFits(board?.rarestFits));
+ renderCollectors(board?.topCollectors || []);
+ renderCreators(board?.topCreators || []);
+ renderRecent(board?.recent || []);
+ $('ft-updated').textContent = `updated ${new Date().toLocaleTimeString()}`;
+}
+
+function renderFits(fits) {
+ const el = $('ft-fits');
+ if (!fits.length) {
+ el.innerHTML =
+ '<p class="ft-none">No premium fits have been minted yet. The first buyer tops this board.</p>';
+ return;
+ }
+ el.innerHTML = fits
+ .map((f) => {
+ const url = coinWorldUrl(f.worldMint);
+ const art = f.previewImage
+ ? `<img class="ft-card-art" src="${esc(f.previewImage)}" alt="" loading="lazy" width="72" height="72" />`
+ : `<span class="ft-card-art ft-card-art--none" aria-hidden="true">${esc((f.slot || '?').slice(0, 2))}</span>`;
+ const owners = Number(f.owners) || 0;
+ const body = `
+ ${art}
+ <span class="ft-card-name">${esc(f.name || f.cosmeticId)}</span>
+ <span class="ft-card-meta">
+ ${rarityPill(f.rarity)}
+ <span class="ft-slot">${esc(f.slot || '')}</span>
+ </span>
+ <span class="ft-card-owners">${fmtCount(owners)} owner${owners === 1 ? '' : 's'}</span>`;
+ return url
+ ? `<a class="ft-card" href="${esc(url)}" title="Open the coin world this fit belongs to">${body}</a>`
+ : `<div class="ft-card">${body}</div>`;
+ })
+ .join('');
+}
+
+function renderCollectors(collectors) {
+ const el = $('ft-collectors');
+ if (!collectors.length) {
+ el.innerHTML = '<li class="ft-none">No collectors yet.</li>';
+ return;
+ }
+ el.innerHTML = collectors
+ .map((c, i) => {
+ const fits = Number(c.fits) || 0;
+ return `<li class="ft-row">
+ <span class="ft-rank">${i + 1}</span>
+ <span class="ft-row-main" title="${esc(c.account)}">${esc(displayAccount(c.account))}</span>
+ <span class="ft-row-sub">${fmtCount(fits)} fit${fits === 1 ? '' : 's'}</span>
+ <span class="ft-row-val" title="Rarity-weighted flex score">${fmtCount(c.flexScore)}</span>
+ </li>`;
+ })
+ .join('');
+}
+
+function renderCreators(creators) {
+ const el = $('ft-creators');
+ if (!creators.length) {
+ el.innerHTML = '<li class="ft-none">No creator earnings settled yet.</li>';
+ return;
+ }
+ el.innerHTML = creators
+ .map((c, i) => {
+ const sales = Number(c.sales) || 0;
+ const scan = solscanAccountUrl(c.wallet);
+ const name = scan
+ ? `<a class="ft-row-main" href="${esc(scan)}" target="_blank" rel="noopener noreferrer" title="${esc(c.wallet)}">${esc(shortWallet(c.wallet))}</a>`
+ : `<span class="ft-row-main">${esc(shortWallet(c.wallet))}</span>`;
+ return `<li class="ft-row" data-wallet="${esc(c.wallet)}">
+ <span class="ft-rank">${i + 1}</span>
+ ${name}
+ <span class="ft-row-sub">${fmtCount(sales)} sale${sales === 1 ? '' : 's'}</span>
+ <span class="ft-row-val ft-earn">${esc(fmtUsdc(c.earnedUsdc))}</span>
+ <button type="button" class="ft-mini" data-lookup="${esc(c.wallet)}">breakdown</button>
+ </li>`;
+ })
+ .join('');
+}
+
+function renderRecent(recent) {
+ const el = $('ft-recent');
+ if (!recent.length) {
+ el.innerHTML = '<li class="ft-none">No sales settled yet.</li>';
+ return;
+ }
+ el.innerHTML = recent
+ .map((s) => {
+ const url = coinWorldUrl(s.mint);
+ const label = `${esc(s.name || s.cosmeticId)}`;
+ const main = url
+ ? `<a class="ft-row-main" href="${esc(url)}">${label}</a>`
+ : `<span class="ft-row-main">${label}</span>`;
+ return `<li class="ft-row">
+ ${main}
+ ${rarityPill(s.rarity)}
+ <span class="ft-row-sub">${esc(displayAccount(s.buyer))}</span>
+ <span class="ft-row-val ft-earn">${esc(fmtUsdc(s.priceUsdc))}</span>
+ <time class="ft-row-when" datetime="${esc(s.settledAt || '')}">${esc(s.settledAt ? timeAgo(s.settledAt) : '')}</time>
+ </li>`;
+ })
+ .join('');
+}
+
+// ── creator earnings lookup ──────────────────────────────────────────────────
+
+async function lookupCreator(wallet) {
+ const panel = $('ft-earnings');
+ const out = $('ft-earnings-out');
+ panel.hidden = false;
+ $('ft-earnings-error').hidden = true;
+ out.innerHTML = '<div class="ft-row ft-skeleton" aria-hidden="true"></div>';
+ panel.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
+
+ try {
+ const res = await fetch(`${EARNINGS_URL}?creator=${encodeURIComponent(wallet)}`, {
+ headers: { accept: 'application/json' },
+ });
+ const body = await res.json().catch(() => null);
+ if (!res.ok) {
+ throw new Error(body?.error_description || `Lookup returned ${res.status}.`);
+ }
+ renderEarnings(body);
+ } catch (err) {
+ out.innerHTML = '';
+ $('ft-earnings-error').hidden = false;
+ $('ft-earnings-error-msg').textContent =
+ err?.message || 'Could not read earnings for that wallet.';
+ }
+}
+
+function renderEarnings(data) {
+ const t = data?.totals || {};
+ const scan = solscanAccountUrl(data?.creatorWallet);
+ const head = `
+ <div class="ft-earn-head">
+ <span class="ft-earn-wallet">
+ ${scan ? `<a href="${esc(scan)}" target="_blank" rel="noopener noreferrer">${esc(shortWallet(data?.creatorWallet))}</a>` : esc(shortWallet(data?.creatorWallet))}
+ </span>
+ <span class="ft-earn-total">${esc(fmtUsdc(t.earnedUsdc))}</span>
+ <span class="ft-earn-label">lifetime earned</span>
+ </div>
+ <div class="ft-earn-grid">
+ <div><span class="ft-kpi-label">Sales</span><span class="ft-kpi-val">${fmtCount(t.sales)}</span></div>
+ <div><span class="ft-kpi-label">Buyers</span><span class="ft-kpi-val">${fmtCount(t.buyers)}</span></div>
+ <div><span class="ft-kpi-label">Last 30 days</span><span class="ft-kpi-val">${esc(fmtUsdc(t.earned30dUsdc))}</span></div>
+ <div><span class="ft-kpi-label">Paid out</span><span class="ft-kpi-val">${esc(fmtUsdc(t.paidUsdc))}</span></div>
+ <div><span class="ft-kpi-label">Pending</span><span class="ft-kpi-val">${esc(fmtUsdc(t.pendingUsdc))}</span></div>
+ <div><span class="ft-kpi-label">Gross volume</span><span class="ft-kpi-val">${esc(fmtUsdc(t.grossUsdc))}</span></div>
+ </div>`;
+
+ const perCosmetic = (data?.perCosmetic || []).length
+ ? `<div class="ft-earn-block">
+ <h3>By cosmetic</h3>
+ <ul class="ft-list">
+ ${(data.perCosmetic || [])
+ .map(
+ (c) => `<li class="ft-row">
+ <span class="ft-row-main">${esc(c.name || c.cosmeticId)}</span>
+ ${rarityPill(c.rarity)}
+ <span class="ft-row-sub">${fmtCount(c.sales)} sale${Number(c.sales) === 1 ? '' : 's'}</span>
+ <span class="ft-row-val ft-earn">${esc(fmtUsdc(c.earnedUsdc))}</span>
+ </li>`,
+ )
+ .join('')}
+ </ul>
+ </div>`
+ : '';
+
+ const perCoin = (data?.perCoin || []).length
+ ? `<div class="ft-earn-block">
+ <h3>By coin world</h3>
+ <ul class="ft-list">
+ ${(data.perCoin || [])
+ .map((c) => {
+ const url = coinWorldUrl(c.mint);
+ const label = esc(shortWallet(c.mint));
+ return `<li class="ft-row">
+ ${url ? `<a class="ft-row-main" href="${esc(url)}" title="${esc(c.mint)}">${label}</a>` : `<span class="ft-row-main">${label}</span>`}
+ <span class="ft-row-sub">${fmtCount(c.sales)} sale${Number(c.sales) === 1 ? '' : 's'}</span>
+ <span class="ft-row-val ft-earn">${esc(fmtUsdc(c.earnedUsdc))}</span>
+ </li>`;
+ })
+ .join('')}
+ </ul>
+ </div>`
+ : '';
+
+ const nothing =
+ !Number(t.sales) && !perCosmetic && !perCoin
+ ? '<p class="ft-none">No settled cosmetic sales for this wallet yet.</p>'
+ : '';
+
+ $('ft-earnings-out').innerHTML = head + nothing + perCosmetic + perCoin;
+}
+
+// ── boot ─────────────────────────────────────────────────────────────────────
+
+function wire() {
+ $('ft-retry').addEventListener('click', () => refresh());
+
+ $('ft-lookup-form').addEventListener('submit', (e) => {
+ e.preventDefault();
+ const wallet = $('ft-lookup-input').value.trim();
+ if (!looksLikeWallet(wallet)) {
+ $('ft-earnings').hidden = false;
+ $('ft-earnings-out').innerHTML = '';
+ $('ft-earnings-error').hidden = false;
+ $('ft-earnings-error-msg').textContent =
+ 'That does not look like a Solana wallet address. Paste the creator wallet (32 to 44 base58 characters).';
+ return;
+ }
+ lookupCreator(wallet);
+ });
+
+ // The creator rows carry their own wallet, so the board doubles as the
+ // lookup's index: no copy-paste round trip to see a breakdown.
+ $('ft-creators').addEventListener('click', (e) => {
+ const btn = e.target.closest('[data-lookup]');
+ if (!btn) return;
+ $('ft-lookup-input').value = btn.dataset.lookup;
+ lookupCreator(btn.dataset.lookup);
+ });
+
+ // Pause polling while the tab is hidden: a background tab must not keep
+ // hitting the ledger.
+ document.addEventListener('visibilitychange', () => {
+ if (document.hidden) {
+ clearInterval(state.refreshTimer);
+ state.refreshTimer = null;
+ } else if (!state.refreshTimer) {
+ refresh({ silent: true });
+ state.refreshTimer = setInterval(() => refresh({ silent: true }), REFRESH_MS);
+ }
+ });
+}
+
+function boot() {
+ wire();
+ refresh();
+ state.refreshTimer = setInterval(() => refresh({ silent: true }), REFRESH_MS);
+}
+
+boot();
diff --git a/src/forge-directed-prompt.js b/src/forge-directed-prompt.js
new file mode 100644
index 000000000..6c3736c44
--- /dev/null
+++ b/src/forge-directed-prompt.js
@@ -0,0 +1,104 @@
+// Forge: "what we actually asked the model".
+//
+// Text→3D on the reference-image lanes does not send the user's words to the
+// painter. api/forge.js runs a Granite art-director pass first (subject-classed
+// briefing, per-part PBR materials, composition constraints) and the REWRITE is
+// what conditions the reference view the mesh is reconstructed from. That step
+// used to be invisible: two very different results from "a red fox" and "a
+// low-poly red fox" had no visible cause.
+//
+// This module reveals the real rewrite after a generation, straight from the
+// `directed_prompt` field on the /api/forge response. It is never reconstructed
+// client-side and never approximated: no field, no panel. Copy takes it to the
+// clipboard; "Use as my prompt" drops it into the composer so the next run can
+// build on it (the user still presses Generate).
+//
+// Decoupled like the other result-panel modules: src/forge.js dispatches
+// `forge:directed-prompt` with { prompt, directedPrompt, model } (or a null
+// directedPrompt to hide the panel), and this owns everything below that.
+
+const panel = document.getElementById('forge-directed');
+const rawEl = document.getElementById('forge-directed-raw');
+const textEl = document.getElementById('forge-directed-text');
+const modelEl = document.getElementById('forge-directed-model');
+const copyBtn = document.getElementById('forge-directed-copy');
+const useBtn = document.getElementById('forge-directed-use');
+const statusEl = document.getElementById('forge-directed-status');
+
+if (panel && rawEl && textEl && copyBtn && useBtn) {
+ let current = '';
+ let statusTimer = null;
+
+ function say(message) {
+ if (!statusEl) return;
+ statusEl.textContent = message;
+ if (statusTimer) clearTimeout(statusTimer);
+ statusTimer = setTimeout(() => {
+ statusEl.textContent = '';
+ }, 2600);
+ }
+
+ function hide() {
+ current = '';
+ panel.hidden = true;
+ panel.open = false;
+ if (statusEl) statusEl.textContent = '';
+ }
+
+ document.addEventListener('forge:directed-prompt', (event) => {
+ const detail = event.detail || {};
+ const directed = typeof detail.directedPrompt === 'string' ? detail.directedPrompt.trim() : '';
+ const raw = typeof detail.prompt === 'string' ? detail.prompt.trim() : '';
+ if (!directed || directed === raw) {
+ hide();
+ return;
+ }
+ current = directed;
+ rawEl.textContent = raw || '(no prompt: this run started from an image)';
+ textEl.textContent = directed;
+ if (modelEl) {
+ const model = typeof detail.model === 'string' ? detail.model.trim() : '';
+ modelEl.textContent = model ? `via ${model}` : '';
+ modelEl.hidden = !model;
+ }
+ panel.hidden = false;
+ // Collapsed by default: it is context, not the headline. The user opens it.
+ panel.open = false;
+ if (statusEl) statusEl.textContent = '';
+ });
+
+ copyBtn.addEventListener('click', async () => {
+ if (!current) return;
+ try {
+ await navigator.clipboard.writeText(current);
+ say('Copied to your clipboard');
+ } catch {
+ // Clipboard permission denied or an insecure context: select the text so
+ // the user can copy it by hand instead of hitting a dead button.
+ const range = document.createRange();
+ range.selectNodeContents(textEl);
+ const sel = window.getSelection();
+ sel?.removeAllRanges();
+ sel?.addRange(range);
+ say('Selected the prompt: press Ctrl/Cmd+C to copy');
+ }
+ });
+
+ useBtn.addEventListener('click', () => {
+ if (!current) return;
+ const box = document.getElementById('prompt');
+ if (!box) return;
+ // Go through the real text tab so the composer ends up in the state the
+ // user would have reached by clicking it themselves.
+ document.querySelector('#mode-switch button[data-mode="text"]')?.click();
+ // The composer caps prompts at its own maxlength; respect it rather than
+ // silently handing over a value the field would truncate on submit.
+ const max = Number(box.getAttribute('maxlength')) || 1000;
+ box.value = current.slice(0, max);
+ box.dispatchEvent(new Event('input', { bubbles: true }));
+ box.focus();
+ box.setSelectionRange(box.value.length, box.value.length);
+ box.scrollIntoView({ behavior: 'smooth', block: 'center' });
+ say('Loaded into the composer. Edit it, then Generate.');
+ });
+}
diff --git a/src/forge.js b/src/forge.js
index f4f6137d8..71e06760c 100644
--- a/src/forge.js
+++ b/src/forge.js
@@ -15,6 +15,7 @@ import { renderLock, lockStateFromAccess } from './three-lock.js';
import { payForHighGeneration } from './forge-pay.js';
import { initWalletButton, getConnectedWalletAddress } from './wallet.js';
import { generateForgePrompt } from './forge-prompt-gen.js';
+import { createForgeTimeline } from './forge-timeline.js';
ensureStateKitStyles();
//
// Drives /api/forge. Three paths share one polling loop:
@@ -76,11 +77,10 @@ const els = {
genNote: document.getElementById('gen-note'),
genProgress: document.getElementById('gen-progress'),
genProgressFill: document.getElementById('gen-progress-fill'),
- steps: {
- image: document.getElementById('step-image'),
- mesh: document.getElementById('step-mesh'),
- finish: document.getElementById('step-finish'),
- },
+ // Named stage timeline + the cold-start warming card. Both are rendered by
+ // src/forge-timeline.js from real /api/forge signals only.
+ genStages: document.getElementById('gen-stages'),
+ genWarming: document.getElementById('gen-warming'),
cancel: document.getElementById('cancel'),
viewer: document.getElementById('viewer'),
viewerShell: document.getElementById('viewer-shell'),
@@ -338,22 +338,23 @@ function showState(name) {
if (name !== 'result' && cinemaOn) setCinema(false);
}
-function setStep(step, state) {
- if (els.steps[step]) els.steps[step].dataset.state = state;
- // The scanline sweep runs exactly while the mesh step is live.
- if (step === 'mesh') els.genPreview.classList.toggle('is-reconstructing', state === 'active');
-}
-
-function setStepLabel(step, text) {
- const node = els.steps[step]?.querySelector('span:last-child');
- if (node) node.textContent = text;
-}
-
// Human label for a backend id, from the short-label map or the live catalog.
function engineLabel(id) {
+ if (!id) return 'the engine';
return ENGINE_LABELS[id] || catalog?.backends?.find((b) => b.id === id)?.label || id;
}
+// The generation stage timeline. It owns the reference preview, the named
+// stages, and the cold-start warming card inside #state-generating; every
+// transition it renders comes from a real /api/forge response (see the module
+// header for the signal→stage map).
+const timeline = createForgeTimeline({
+ list: els.genStages,
+ preview: els.genPreview,
+ warming: els.genWarming,
+ engineLabel,
+});
+
// Lane-switch notice in the generating panel: makes a mid-flight engine
// failover (server poll-time redispatch, or the client's own automatic retry
// hop) visible instead of silent. Empty text hides the line.
@@ -373,11 +374,21 @@ let pendingLaneNote = '';
// estimate exists — the meter then runs indeterminate rather than inventing a
// duration.
function currentEtaSeconds() {
+ // Once the job is accepted the server's own estimate wins: it names the lane
+ // that actually ran and widens for a cold worker, which the catalog matrix
+ // (always warm, always the requested lane) cannot know.
+ const served = timeline.etaSeconds();
+ if (Number(served) > 0) return Number(served);
+ return warmEtaFor(selectedEngine.backend, selectedEngine.path, selectedTier);
+}
+
+// The catalog's warm estimate for a lane. Also the baseline the cold-start
+// budget is measured against: (server ETA for a cold job) - (this) is the real
+// boot allowance the warming card counts down.
+function warmEtaFor(backendId, path, tierId) {
if (!catalog) return null;
- const backend = catalog.backends?.find((b) => b.id === selectedEngine.backend);
- const est = (backend?.estimates?.[selectedEngine.path] || []).find(
- (e) => e.tier === selectedTier,
- );
+ const backend = catalog.backends?.find((b) => b.id === backendId);
+ const est = (backend?.estimates?.[path] || []).find((e) => e.tier === tierId);
return Number(est?.eta_seconds) > 0 ? Number(est.eta_seconds) : null;
}
@@ -403,16 +414,21 @@ function startElapsed(offsetMs = 0) {
// stays honest about how long the generation has really been running.
const started = performance.now() - Math.max(0, offsetMs);
stopElapsed();
- const typical = currentEtaSeconds();
// Reset the meter to a clean running state for this job.
if (els.genProgress) {
els.genProgress.dataset.done = 'false';
els.genProgress.dataset.over = 'false';
- els.genProgress.dataset.indeterminate = typical ? 'false' : 'true';
+ els.genProgress.dataset.indeterminate = currentEtaSeconds() ? 'false' : 'true';
}
setProgress(0);
const tick = () => {
const s = Math.floor((performance.now() - started) / 1000);
+ // Re-read every tick: the accepted job replaces the catalog guess with the
+ // server's real ETA for the lane that actually ran (cold start included).
+ const typical = currentEtaSeconds();
+ if (els.genProgress) els.genProgress.dataset.indeterminate = typical ? 'false' : 'true';
+ // The timeline's warming card counts real seconds against that same ETA.
+ timeline.tick(s);
if (typical) {
const over = s > typical;
setProgress(honestFill(s, typical) * 100);
@@ -1547,7 +1563,6 @@ async function pollUntilDone(jobId) {
// through "queued" for a beat even when a GPU is free.
let queuedPolls = 0;
let inQueue = false;
- let preQueueMeshLabel = null;
while (!pollAbort && performance.now() < deadline) {
await sleep(POLL_INTERVAL_MS);
if (pollAbort) return null;
@@ -1563,6 +1578,10 @@ async function pollUntilDone(jobId) {
e.kind = 'unconfigured';
throw e;
}
+ // One place folds the poll into the stage timeline: queued vs running, the
+ // lane a poll-time failover moved to, and a reference view that only
+ // becomes visible now (coalesced job, resumed session, failover successor).
+ timeline.applyPoll(data);
if (data.status === 'done' && data.glb_url) return data;
if (data.status === 'failed') {
// The server names the configured lanes that can still serve a fresh
@@ -1576,26 +1595,23 @@ async function pollUntilDone(jobId) {
throw e;
}
if (data.status === 'queued') {
- setStep('mesh', 'active');
// Time spent in line must not consume the run budget: a queued job is
// alive and will get the full window once a GPU picks it up.
deadline = performance.now() + MAX_POLL_MS;
queuedPolls += 1;
- if (!inQueue && queuedPolls >= 3) {
+ // A cold worker has its own designed state in the timeline; the queue
+ // notice is for a warm lane that is simply busy, so it never doubles up.
+ if (!inQueue && queuedPolls >= 3 && !timeline.isCold()) {
inQueue = true;
- preQueueMeshLabel = els.steps.mesh?.querySelector('span:last-child')?.textContent || null;
- setStepLabel('mesh', 'In line for a GPU');
setLaneNote(
'The engine is finishing earlier jobs. Yours is queued and will run at full quality, nothing is downgraded.',
);
}
}
if (data.status === 'running') {
- setStep('mesh', 'active');
queuedPolls = 0;
if (inQueue) {
inQueue = false;
- if (preQueueMeshLabel) setStepLabel('mesh', preQueueMeshLabel);
setLaneNote('');
}
// Poll-time failover: the server moved this job onto a backup lane and
@@ -1605,7 +1621,6 @@ async function pollUntilDone(jobId) {
setLaneNote(
`${engineLabel(data.failover_from)} hit a snag. Continuing on ${engineLabel(data.backend)}, no action needed.`,
);
- setStepLabel('mesh', `Reconstructing on ${engineLabel(data.backend)}`);
}
}
}
@@ -1840,6 +1855,13 @@ function updateRefineButton() {
function showResult(glbUrl, label, meta, { autoSaved = false } = {}) {
stopElapsed();
+ // Every entry into the result state starts with no directed-prompt reveal:
+ // only a fresh generation whose response carried one re-opens it (run()
+ // dispatches it right after this). A gallery card or a share link has no
+ // recorded rewrite, so it must not inherit the previous model's.
+ document.dispatchEvent(
+ new CustomEvent('forge:directed-prompt', { detail: { prompt: '', directedPrompt: null } }),
+ );
resetVerdict();
resetCategoryPicker();
if (els.categoryPicker) els.categoryPicker.hidden = false;
@@ -2093,6 +2115,9 @@ async function openSharedCreation(shareId) {
function showError(message, { allowOverride = false, title = 'Generation failed' } = {}) {
stopElapsed();
+ // Freeze the timeline where it really got to and drop the warming card: the
+ // job is over, so nothing may keep implying work is still happening.
+ timeline.fail();
stopRateLimitCountdown();
if (els.errorTitle) els.errorTitle.textContent = title;
els.errorMessage.textContent = message;
@@ -2164,6 +2189,7 @@ function stopRateLimitCountdown() {
function showRateLimited({ retryAfter = 10, unavailable = false, busy = false }) {
stopElapsed();
+ timeline.fail();
stopRateLimitCountdown();
if (els.generateAnyway) els.generateAnyway.classList.add('is-hidden');
@@ -2225,53 +2251,19 @@ async function run(cfg) {
const isImage = Array.isArray(cfg.imageUrls) && cfg.imageUrls.length > 0;
const isGeometry = selectedEngine.path === 'geometry';
const isSketch = selectedEngine.path === 'sketch';
- const meshLabel = `Generating ${selectedTier} mesh`;
-
- // Reset the generating panel to its real starting state for this run.
- if (isSketch) {
- // The drawing IS the reference — no synthesis step, straight to geometry.
- setStepLabel('image', 'Sketch uploaded');
- setStepLabel('mesh', `Generating ${selectedTier} geometry from the sketch`);
- setStep('image', 'done');
- setStep('mesh', 'active');
- const preview = sketch.objectUrl || sketch.url;
- els.genPreview.innerHTML = preview ? '' : '<div class="shimmer" aria-hidden="true"></div>';
- if (preview) {
- const img = new Image();
- img.alt = 'Your sketch';
- img.src = preview;
- els.genPreview.appendChild(img);
- }
- } else if (isImage) {
- const n = cfg.imageUrls.length;
- setStepLabel('image', `Conditioning on ${n} ${n === 1 ? 'view' : 'views'}`);
- setStepLabel('mesh', isGeometry ? meshLabel : 'Reconstructing textured mesh');
- setStep('image', 'done');
- setStep('mesh', 'active');
- const preview = firstPreviewUrl();
- els.genPreview.innerHTML = preview ? '' : '<div class="shimmer" aria-hidden="true"></div>';
- if (preview) {
- const img = new Image();
- img.alt = 'Reference view';
- img.src = preview;
- els.genPreview.appendChild(img);
- }
- } else if (isGeometry) {
- // Geometry-first: no reference image is painted — the model emits geometry
- // straight from the prompt, so the first step is already complete.
- setStepLabel('image', 'Geometry-first — no reference image');
- setStepLabel('mesh', meshLabel);
- setStep('image', 'done');
- setStep('mesh', 'active');
- els.genPreview.innerHTML = '<div class="shimmer" aria-hidden="true"></div>';
- } else {
- setStepLabel('image', 'Painting photoreal reference image');
- setStepLabel('mesh', 'Reconstructing textured mesh');
- els.genPreview.innerHTML = '<div class="shimmer" aria-hidden="true"></div>';
- setStep('image', 'active');
- setStep('mesh', 'pending');
- }
- setStep('finish', 'pending');
+
+ // Open the timeline on what we genuinely know before the request goes out:
+ // which input the run starts from, which lane was picked, and whether that
+ // lane paints a reference view at all. Geometry-first engines and the free
+ // NVIDIA NIM lane emit the mesh straight from the prompt, so they never get a
+ // reference stage. Everything after this comes from the server's answers.
+ timeline.begin({
+ mode: isSketch ? 'sketch' : isImage ? 'image' : 'text',
+ backend: selectedEngine.backend,
+ viewCount: isImage ? cfg.imageUrls.length : 0,
+ localPreviewUrl: isSketch ? sketch.objectUrl || sketch.url : isImage ? firstPreviewUrl() : null,
+ usesReference: !isGeometry && selectedEngine.backend !== 'nvidia',
+ });
// A fresh panel starts with no lane notice, unless an automatic engine hop
// queued one for this very re-run.
setLaneNote(pendingLaneNote);
@@ -2285,21 +2277,14 @@ async function run(cfg) {
const job = await startJob(cfg);
if (job.creation_id) currentCreationId = job.creation_id;
- // Text→3D: the reference image resolved before the POST returned — show it.
- if (!isImage && job.preview_image_url) {
- setStep('image', 'done');
- setStep('mesh', 'active');
- const img = new Image();
- img.alt = 'Reference image';
- img.src = job.preview_image_url;
- img.onload = () => {
- els.genPreview.innerHTML = '';
- els.genPreview.appendChild(img);
- };
- img.onerror = () => {
- els.genPreview.innerHTML = '';
- };
- }
+ // Fold every real signal the submit response carries into the timeline: the
+ // lane that actually ran, the art-directed prompt, the reference view (shown
+ // the moment it exists), the honest ETA, and the cold-start flag. The warm
+ // baseline is the catalog estimate for that same lane, so the warming card
+ // counts down a real difference rather than an invented number.
+ timeline.applySubmit(job, {
+ warmEtaSeconds: warmEtaFor(job.backend || selectedEngine.backend, job.path || selectedEngine.path, job.tier || selectedTier),
+ });
// The free draft lane (NVIDIA NIM) completes synchronously — the POST
// itself returns the finished model with a null job_id. Polling that
@@ -2316,8 +2301,9 @@ async function run(cfg) {
if (lastJob) delete lastJob.payment;
if (done.creation_id) currentCreationId = done.creation_id;
- setStep('mesh', 'done');
- setStep('finish', 'done');
+ // The mesh is delivered; the remaining work (durable copy already done
+ // server-side, viewer load here) is the finalizing stage.
+ timeline.finalizing();
markProgressDone();
// Prefer the poll's recorded meta; fall back to the submit response.
showResult(
@@ -2334,6 +2320,19 @@ async function run(cfg) {
},
{ autoSaved: !!done.creation_id },
);
+ timeline.complete();
+ // What the model was actually asked for. Only the reference-image lanes run
+ // the art director, so `directed_prompt` is absent on every other lane and
+ // the reveal stays hidden rather than showing a reconstructed guess.
+ document.dispatchEvent(
+ new CustomEvent('forge:directed-prompt', {
+ detail: {
+ prompt: cfg.prompt || '',
+ directedPrompt: done.directed_prompt ?? job.directed_prompt ?? null,
+ model: done.text_to_image_model ?? job.text_to_image_model ?? null,
+ },
+ }),
+ );
loadGallery();
// Geometry-first and sketch lanes have no reference image — render the
// finished mesh itself as the creation's card visual.
@@ -2357,6 +2356,10 @@ async function run(cfg) {
// dead either way. The server-side finalizer still completes the row
// into the gallery if the lane actually finished after our timeout.
clearInflight();
+ // This job is over on every branch below (a designed error state, a gate,
+ // or an automatic lane hop that starts a fresh timeline of its own), so the
+ // stage list stops here rather than sitting on a spinning row.
+ timeline.fail();
if (err.kind === 'unconfigured') {
stopElapsed();
showState('unconfigured');
@@ -2473,21 +2476,16 @@ async function resumeInflight() {
pollAbort = false;
currentCreationId = inflight.creationId || null;
setBusy(true);
- setStepLabel('image', 'Reference ready');
- setStep('image', 'done');
- setStepLabel('mesh', 'Reconstructing textured mesh');
- setStep('mesh', 'active');
- setStep('finish', 'pending');
- els.genPreview.innerHTML = '<div class="shimmer" aria-hidden="true"></div>';
- if (inflight.previewImageUrl) {
- const img = new Image();
- img.alt = 'Reference image';
- img.src = inflight.previewImageUrl;
- img.onload = () => {
- els.genPreview.innerHTML = '';
- els.genPreview.appendChild(img);
- };
- }
+ // Restore the timeline in its mesh phase: the earlier stages provably
+ // finished (the job exists, and the reference view was recorded with it), and
+ // the next real poll refines the rest. A resumed job whose reference view was
+ // never captured locally still gets it: the poll response carries it.
+ timeline.resume({
+ mode: inflight.path === 'sketch' ? 'sketch' : 'text',
+ backend: inflight.backend,
+ referenceUrl: inflight.previewImageUrl || null,
+ elapsedS: Math.max(0, Math.round((Date.now() - inflight.startedAt) / 1000)),
+ });
setLaneNote('Welcome back. This generation kept running while you were away.');
startElapsed(Date.now() - inflight.startedAt);
showState('generating');
@@ -2497,9 +2495,11 @@ async function resumeInflight() {
if (pollAbort || !done) return true;
clearInflight();
if (done.creation_id) currentCreationId = done.creation_id;
- setStep('mesh', 'done');
- setStep('finish', 'done');
+ timeline.finalizing();
markProgressDone();
+ // No directed-prompt reveal on a resumed job: the submit response is long
+ // gone and the rewrite is not persisted with the creation, so showResult's
+ // own reset leaves the panel hidden rather than showing a stale prompt.
showResult(
done.glb_url,
inflight.label || 'Forged model',
@@ -2514,6 +2514,7 @@ async function resumeInflight() {
},
{ autoSaved: !!done.creation_id },
);
+ timeline.complete();
loadGallery();
if (!done.preview_image_url && !inflight.previewImageUrl) {
capturePoster(currentCreationId);
@@ -2813,6 +2814,8 @@ els.cancel.addEventListener('click', () => {
pollAbort = true;
clearInflight();
stopElapsed();
+ // The user ended the job: the stage list stops claiming anything is running.
+ timeline.fail();
setBusy(false);
if (els.categoryPicker) els.categoryPicker.hidden = true;
showState('empty');
diff --git a/src/game/avatar-rig.js b/src/game/avatar-rig.js
index 457acb73b..03d1b5e92 100644
--- a/src/game/avatar-rig.js
+++ b/src/game/avatar-rig.js
@@ -16,6 +16,7 @@ import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
import { AnimationManager } from '../animation-manager.js';
import { getMeshoptDecoder } from '../viewer/internal.js';
import { GUEST_SENTINEL, resolveGuestAvatar } from './play-handoff.js';
+import { installVrmPlugin, prepareVrmModel } from './vrm-loader.js';
import { log } from '../shared/log.js';
export const AVATAR_DEFAULT = '/avatars/default.glb';
@@ -133,8 +134,15 @@ function headAnchorHeight(box) {
export async function buildAvatar(rig, url, anim, opts = {}) {
try {
await meshoptReady; // ensure meshopt-compressed GLBs (incl. the default) parse
+ // P3.4: pick up the reference VRM parser if boot installed one. Free no-op
+ // otherwise, and idempotent, so it can sit on the hot path.
+ installVrmPlugin(_gltf);
const gltf = await _gltf.loadAsync(url);
const model = gltf.scene;
+ // A .vrm is a glTF binary, so it has already parsed by here; this fixes the
+ // VRM-specific facing/culling/material issues a plain glTF load leaves
+ // behind. No-op for every non-VRM avatar. See src/game/vrm-loader.js.
+ prepareVrmModel(gltf);
model.traverse((n) => { if (n.isMesh) { n.castShadow = true; n.receiveShadow = false; } });
const box = new Box3().setFromObject(model);
model.position.y -= box.min.y;
diff --git a/src/game/avatar-upload.js b/src/game/avatar-upload.js
index 125741ec4..c6e90a75a 100644
--- a/src/game/avatar-upload.js
+++ b/src/game/avatar-upload.js
@@ -51,8 +51,14 @@ function disposeScene(scene) {
// on rejection; resolves to { bytes, height } on success.
export async function validateGlb(file) {
if (!file) throw new Error('No file selected.');
- if (!file.name.toLowerCase().endsWith('.glb')) {
- throw new Error('Only .glb files work — they bundle meshes and textures into one file. Export your model as GLB (not .gltf or .fbx).');
+ // .vrm is accepted alongside .glb: a VRM file IS a glTF binary, it parses with
+ // the same loader here, and src/game/vrm-loader.js fixes the VRM-specific
+ // facing/culling on the way into the scene (P3.4). Its skeleton is already
+ // covered by glb-canonicalize's VRM/VRoid bone map, so the shared idle/walk
+ // clips retarget onto it like any other humanoid.
+ const name = (file.name || '').toLowerCase();
+ if (!name.endsWith('.glb') && !name.endsWith('.vrm')) {
+ throw new Error('Only .glb and .vrm files work: they bundle meshes and textures into one file. Export your model as GLB or VRM (not .gltf or .fbx).');
}
if (file.size < 64) throw new Error('That file is empty.');
if (file.size > MAX_GLB_BYTES) {
diff --git a/src/game/coincommunities-ui.js b/src/game/coincommunities-ui.js
index 82476f048..3576aff37 100644
--- a/src/game/coincommunities-ui.js
+++ b/src/game/coincommunities-ui.js
@@ -174,12 +174,12 @@ export class CommunityUI {
// Bring-your-own avatar: drop a .glb on the bar or pick one. It's validated,
// uploaded to storage, then broadcast by its public URL so peers see it too.
this.uploadFile = el('input', {
- type: 'file', accept: '.glb,model/gltf-binary', class: 'cc-upload-file',
+ type: 'file', accept: '.glb,.vrm,model/gltf-binary', class: 'cc-upload-file',
onchange: (e) => { const f = e.target.files?.[0]; if (f) this._handleGlbFile(f); e.target.value = ''; },
});
- this.uploadBtn = el('label', { class: 'cc-upload-btn', title: 'Upload a .glb avatar from your device' }, [
+ this.uploadBtn = el('label', { class: 'cc-upload-btn', title: 'Upload a .glb or .vrm avatar from your device' }, [
el('span', { class: 'cc-upload-ico', text: '⬆' }),
- el('span', { class: 'cc-upload-text', text: 'Upload .glb' }),
+ el('span', { class: 'cc-upload-text', text: 'Upload model' }),
this.uploadFile,
]);
@@ -235,12 +235,12 @@ export class CommunityUI {
el('label', { class: 'cc-name-label', for: 'cc-name-input', text: 'Your name' }),
this.nameInput,
]),
- el('div', { class: 'cc-avatar-label', html: 'Your avatar<small>Create your own, pick a preset, browse the gallery, paste a URL, or drop your own .glb</small>' }),
+ el('div', { class: 'cc-avatar-label', html: 'Your avatar<small>Create your own, pick a preset, browse the gallery, paste a URL, or drop your own .glb / .vrm</small>' }),
this.createBtn,
this.presetRow,
el('div', { class: 'cc-avatar-custom' }, [this.customInput, this.galleryBtn, this.uploadBtn]),
this.uploadStatus,
- el('div', { class: 'cc-avatar-dropmsg', text: 'Drop .glb to use as your avatar' }),
+ el('div', { class: 'cc-avatar-dropmsg', text: 'Drop a .glb or .vrm to use as your avatar' }),
]),
el('p', { class: 'cc-section-title', text: 'Live communities' }),
this.grid,
@@ -438,7 +438,7 @@ export class CommunityUI {
stop(e);
bar.classList.remove('cc-drag');
const files = [...(e.dataTransfer?.files || [])];
- const glb = files.find((f) => f.name.toLowerCase().endsWith('.glb')) || files[0];
+ const glb = files.find((f) => /\.(glb|vrm)$/i.test(f.name)) || files[0];
if (glb) this._handleGlbFile(glb);
});
}
@@ -539,7 +539,7 @@ export class CommunityUI {
const cards = el('div', { class: 'cc-create-methods' }, [
card('✦', 'Design your avatar', 'Build a 3D character from scratch or from a selfie, then drop straight into the world. No sign-in needed.', 'Recommended', () => this._launchEditor()),
- card('⬆', 'Upload a .glb', 'Already have a model from Blender, Mixamo, VRoid, or any avatar tool? Bring it in.', '', () => { this._closeCreate(); this.uploadFile.click(); }),
+ card('⬆', 'Upload a model', 'Already have a .glb or .vrm from Blender, Mixamo, VRoid, or any avatar tool? Bring it in.', '', () => { this._closeCreate(); this.uploadFile.click(); }),
card('✨', 'Advanced studio', 'Sculpt face & body, layer outfits and accessories, and save it to your three.ws account.', 'Opens in a new tab', () => { window.open('/create/studio', '_blank', 'noopener'); this._closeCreate(); }),
]);
@@ -1677,9 +1677,25 @@ export class CommunityUI {
onclick: () => this.h.onRotateProp?.(),
}, [el('span', { 'aria-hidden': 'true', text: '⟳' })]);
+ // P3.3 — bring your own prop. Same drop-a-model gesture as the lobby's avatar
+ // upload, pointed at the build palette: validated here, uploaded to storage,
+ // then armed as the active prop so the very next click places it.
+ this.propUploadFile = el('input', {
+ type: 'file', accept: '.glb,.vrm,model/gltf-binary', class: 'cc-upload-file',
+ onchange: (e) => { const f = e.target.files?.[0]; if (f) this.h.onUploadProp?.(f); e.target.value = ''; },
+ });
+ this.propUploadBtn = el('label', {
+ class: 'cc-prop-upload', title: 'Upload your own .glb or .vrm model to place in this world',
+ }, [
+ el('span', { 'aria-hidden': 'true', text: '⬆' }),
+ el('span', { class: 'cc-prop-upload-text', text: 'Upload' }),
+ this.propUploadFile,
+ ]);
+
const head = el('div', { class: 'cc-prop-head' }, [
el('span', { class: 'cc-prop-title', text: 'Props' }),
this.propSearch,
+ this.propUploadBtn,
this.propRotateBtn,
]);
@@ -1807,6 +1823,37 @@ export class CommunityUI {
this._galleryDivider.hidden = false;
}
+ // ---- player-uploaded props (P3.3) ---------------------------------------------
+ /**
+ * Add an uploaded model to the palette as a first-class prop button and select
+ * it, so the next click in the world places it. Idempotent per model id — a
+ * re-upload of the same file re-selects the existing button instead of stacking
+ * duplicates.
+ * @param {{id:string,name?:string,thumbnail?:string}} def
+ */
+ addUploadedProp(def) {
+ if (!def?.id) return;
+ if (!this._propBtns.has(def.id)) {
+ const btn = this._propButton({ id: def.id, name: def.name || 'Your model', icon: '📤', thumbnail: def.thumbnail });
+ btn.classList.add('cc-prop-upload-item');
+ // Uploads sit with the hand-authored props, ahead of the gallery rule, so
+ // the thing you just added is where you expect it: at the end of "yours".
+ this.propRow.insertBefore(btn, this._galleryDivider);
+ }
+ this.setPropSelected(def.id);
+ }
+
+ /**
+ * One-line status for the prop upload (validating / progress / error), rendered
+ * in the same strip as the gallery status so the palette has one message area.
+ * @param {string} msg
+ * @param {boolean} [isError]
+ */
+ setPropUploadStatus(msg, isError = false) {
+ this._setGalleryStatus(msg, false);
+ this._galleryStatus?.classList.toggle('cc-err', !!isError);
+ }
+
// Render a one-line gallery status (loading / empty / error). The error variant is
// tappable to retry the failed page.
_setGalleryStatus(msg, isError) {
diff --git a/src/game/coincommunities.css b/src/game/coincommunities.css
index 2ffa0a6c2..2a9572c9c 100644
--- a/src/game/coincommunities.css
+++ b/src/game/coincommunities.css
@@ -1593,6 +1593,25 @@ html[data-bg="transparent"] #cc-lobby {
.cc-prop-rotate:active { transform: translateY(1px) rotate(90deg); }
.cc-prop-rotate:focus-visible { outline: 2px solid #66ff8c; outline-offset: 2px; }
.cc-prop-rotate:disabled { opacity: 0.4; cursor: not-allowed; }
+/* Bring-your-own prop (P3.3): a <label> wrapping a hidden file input, styled to
+ sit beside the rotate control as a peer of it. */
+.cc-prop-upload {
+ display: inline-flex; align-items: center; gap: 5px;
+ height: 30px; padding: 0 10px; border-radius: var(--cc-radius-sm);
+ border: 1px solid var(--cc-edge); background: var(--cc-panel); color: var(--cc-text);
+ font-size: 11.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
+ -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
+ transition: background 0.12s, border-color 0.12s, transform 0.08s;
+}
+.cc-prop-upload:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--cc-edge-hi); }
+.cc-prop-upload:active { transform: translateY(1px); }
+.cc-prop-upload:focus-within { outline: 2px solid #66ff8c; outline-offset: 2px; }
+.cc-prop-upload input[type="file"] {
+ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
+ overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
+}
+@media (max-width: 520px) { .cc-prop-upload-text { display: none; } }
+.cc-prop-upload-item { border-color: rgba(102, 255, 140, 0.45); }
.cc-prop-row {
display: flex; align-items: stretch; gap: 6px; padding: 7px;
background: var(--cc-panel); border: 1px solid var(--cc-edge);
diff --git a/src/game/coincommunities.js b/src/game/coincommunities.js
index 28c5931b5..f7816e147 100644
--- a/src/game/coincommunities.js
+++ b/src/game/coincommunities.js
@@ -43,7 +43,16 @@ import {
VoxelWorld, createBuildHud, parseKey, keyOf, MAX_BLOCKS, BLOCK,
COMPOSITE_PIECES, compositeCells,
} from './build-voxels.js';
-import { WorldObjects, PropGhost, propDef } from './world-objects.js';
+import { WorldObjects, PropGhost, propDef, registerUploadedProp } from './world-objects.js';
+// P3.1 — durable per-world build persistence (Postgres index + R2 blob), the same
+// store the authoritative room writes through. See src/game/world-persist.js for
+// which side is the writer when.
+import { WorldBuildStore, worldIdForCoin, docObjects } from './world-persist.js';
+import {
+ MAX_WORLD_OBJECTS, MAX_OBJECTS_PER_PLAYER, OBJ_SCALE_MIN, OBJ_SCALE_MAX,
+ buildClearRadius,
+} from '../../multiplayer/src/build-limits.js';
+import { validatePropModel, uploadPropModel } from './avatar-upload.js';
import { proxiedImageURL } from '../ipfs.js';
import {
loadManifest, getEmoteDefs, getAllEmoteDefs, resolveAvatarUrl, buildAvatar, playEmoteClip,
@@ -504,6 +513,8 @@ export class CoinCommunities {
// Build props (R18): arm/disarm a placeable prop and rotate the armed one.
onPickProp: (id) => this._pickProp(id),
onRotateProp: () => this._rotateProp(),
+ // P3.3: bring your own prop — validate, upload, arm it for placement.
+ onUploadProp: (file) => this._uploadProp(file),
onShareBuild: () => this._shareBuild(),
onOpenFeatured: () => this._openFeatured(),
onPublishBuild: (meta) => this._publishBuild(meta),
@@ -535,7 +546,7 @@ export class CoinCommunities {
// Build permissions (R19) — refreshed from the server's build-perms snapshot:
// the player's per-world block cap + usage, and whether they're the coin creator
// (which unlocks the clear-area moderation tool). Solo builds carry no cap.
- this._buildPerms = { creator: false, cap: 0, used: 0, clearMaxRadius: 12 };
+ this._buildPerms = this._defaultBuildPerms();
this.buildHud.root.hidden = true;
this.buildHud.setEnabled(false);
@@ -1188,6 +1199,15 @@ export class CoinCommunities {
this.propGhost = new PropGhost(this.scene);
this.net.on('objectReject', ({ reason }) => this._onObjectReject(reason));
+ // P3.1 — the durable world store. Read it immediately (so the community's
+ // persisted build is standing here before the room even answers), and keep it
+ // as this client's writer for as long as the room is NOT the authority.
+ this._openWorldStore(coin, tier);
+ // The room's first full state snapshot has landed: it restored the same doc
+ // we did, so our local copies are duplicates. Retire them, and hand any props
+ // built while offline to the room so they become part of the shared world.
+ this.net.on('synced', () => this._onRoomSynced());
+
if (isGuest) uploadPendingGuestAvatar((publicUrl) => this.net?.setAvatar(publicUrl));
this.net.on('status', ({ status }) => {
this.ui.setStatus(status);
@@ -1209,10 +1229,19 @@ export class CoinCommunities {
// has been given up. The connecting window is the only time it's off, so
// the toggle never becomes a dead, silent button.
this.buildHud.setEnabled(this._buildableConnection(), 'Connecting to the world…');
- // Durability badge: online reflects the server's persistent flag; solo
- // single-player isn't saved at all, so hide it (null) to avoid a false
- // promise. Re-sync the budget meter against whatever layer is now live.
- this.buildHud.setPersistent(status === 'online' ? this.net?.persistent : (status === 'offline' || status === 'unavailable' ? false : null));
+ // The room has stopped being the authority: take the pen back so a solo
+ // session keeps building into the same durable document (P3.1).
+ if (status !== 'online' && status !== 'connecting') this._armLocalWorldWriter();
+ // Durability badge: online reflects the server's persistent flag. Offline,
+ // props ARE durable now (they go straight to the world store), so the badge
+ // reflects whether this client may actually write it — never a false promise.
+ this.buildHud.setPersistent(
+ status === 'online'
+ ? this.net?.persistent
+ : (status === 'offline' || status === 'unavailable' || status === 'failed'
+ ? !!this._worldStore?.writable
+ : null),
+ );
this._syncBudget();
// A reconnect reissues every sessionId, stranding the voice mesh — refresh
// our id, drop the stale peers, and re-announce so it re-forms.
@@ -1701,6 +1730,9 @@ export class CoinCommunities {
this._danceFloorPos = null; this._onFloor = false; this._wantsDance = false;
this.ui.setOnFloor(false);
if (this._reactor) { this._reactor.dispose(); this._reactor = null; }
+ // Land any debounced world-store write before the objects it describes are
+ // disposed (P3.1) — leaving a world must not lose the last placement.
+ this._closeWorldStore();
if (this.voxels) { this.voxels.dispose(); this.voxels = null; }
if (this.worldObjects) { this.worldObjects.dispose(); this.worldObjects = null; }
if (this.propGhost) { this.propGhost.dispose(); this.propGhost = null; }
@@ -2964,6 +2996,39 @@ export class CoinCommunities {
this._refreshGhost();
}
+ // P3.3 — bring your own prop. Validate the model locally (size, geometry,
+ // triangle budget, real-world scale), upload it through the same presigned-PUT
+ // storage path avatars use, register it in the palette, and arm it so the next
+ // click drops it into the world. Every failure state is reported in the palette's
+ // own status line with a reason the uploader can act on.
+ async _uploadProp(file) {
+ if (this._propUploading) return;
+ this._propUploading = true;
+ this.ui.setPropUploadStatus('Checking your model…');
+ try {
+ const info = await validatePropModel(file);
+ this.ui.setPropUploadStatus('Uploading… 0%');
+ const url = await uploadPropModel(file, (p) => {
+ this.ui.setPropUploadStatus(`Uploading… ${Math.round(p * 100)}%`);
+ });
+ const name = (file.name || 'Your model').replace(/\.(glb|vrm)$/i, '').slice(0, 24);
+ const def = registerUploadedProp(url, { name });
+ this.ui.addUploadedProp({ id: def.id, name: def.name });
+ this._pickProp(def.id);
+ this.ui.setPropUploadStatus('');
+ this.ui.toast(
+ `${name} is ready${info.vrm ? ' (VRM)' : ''} — click in the world to place it.`,
+ 'info',
+ );
+ } catch (err) {
+ const message = err?.message || 'That model could not be uploaded.';
+ this.ui.setPropUploadStatus(message, true);
+ this.ui.toast(message, 'warn');
+ } finally {
+ this._propUploading = false;
+ }
+ }
+
// Rotate the armed prop a quarter-turn and re-preview it in place.
_rotateProp() {
if (!this.buildProp) return;
@@ -2999,20 +3064,66 @@ export class CoinCommunities {
const target = this._propTarget(clientX, clientY);
if (!target) return;
if (!target.valid) { this._updatePropGhost(clientX, clientY); return; }
- const online = this.net?.status === 'online';
- if (!online) {
- // Solo: there's no shared object channel to place into, so be honest rather
- // than faking a local-only prop that no one else will ever see.
- this.ui.toast('Props need a live connection — reconnect to place them.', 'warn');
+ const yaw = this.buildPropRot * (Math.PI / 2);
+ const url = propDef(this.buildProp)?.upload ? propDef(this.buildProp).glb : '';
+ if (this._roomIsAuthority()) {
+ this.net.spawnObject('block', {
+ type: this.buildProp, x: target.x, y: target.y, z: target.z,
+ yaw, scale: this.buildPropScale, url: url || undefined,
+ });
+ } else if (!this._placeLocalProp(target, yaw, url)) {
return;
}
- const yaw = this.buildPropRot * (Math.PI / 2);
- this.net.spawnObject('block', { type: this.buildProp, x: target.x, y: target.y, z: target.z, yaw, scale: this.buildPropScale });
// A short haptic tick confirms the place on touch devices.
if (typeof navigator !== 'undefined' && navigator.vibrate) navigator.vibrate(12);
this._updatePropGhost(clientX, clientY);
}
+ // Place a prop with no authoritative room in the picture (P3.1). It is a real
+ // object in the scene AND a real row in the durable world document — not a
+ // local-only decoration that quietly disappears — so the same caps the server
+ // enforces are enforced here before anything is written.
+ _placeLocalProp(target, yaw, url) {
+ const store = this._worldStore;
+ if (!store) { this.ui.toast('This world’s build store is still loading — try again in a moment.', 'warn'); return false; }
+ if (!store.writable) {
+ this.ui.toast('Your build here can’t be saved yet, so props are off. Sign in and rejoin to build offline.', 'warn');
+ return false;
+ }
+ const objs = this.worldObjects;
+ if (!objs) return false;
+ if (objs.localCount() >= MAX_WORLD_OBJECTS) {
+ this.ui.toast('This world is full of props — remove some to place more.', 'warn');
+ return false;
+ }
+ if (this._offlineBuilt.size >= MAX_OBJECTS_PER_PLAYER) {
+ this.ui.toast('You’ve hit your prop limit for this world — remove some to place more.', 'warn');
+ return false;
+ }
+ const rec = {
+ id: `loc_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`,
+ type: this.buildProp,
+ kind: 'block',
+ ownerId: this._buildOwnerKey(),
+ x: target.x, y: target.y, z: target.z,
+ yaw,
+ scale: Math.min(OBJ_SCALE_MAX, Math.max(OBJ_SCALE_MIN, this.buildPropScale)),
+ url: url || '',
+ };
+ objs.addLocal(rec, { mine: true });
+ this._offlineBuilt.set(rec.id, rec);
+ this._persistLocalBuild();
+ this._syncBudget();
+ return true;
+ }
+
+ // The id an offline placement is owned by. Matches WalkRoom._ownerKey's
+ // preference order (verified wallet → persisted economy id) so a prop built
+ // offline is still recognisably yours once the room restores the doc.
+ _buildOwnerKey() {
+ return this.account || this.net?.pid || '';
+ }
+
// Delete the nearest prop under the pointer that this client owns. Raycasts only
// owned object nodes, so a click never offers to delete someone else's build.
_deleteOwnPropAt(clientX, clientY) {
@@ -3022,7 +3133,18 @@ export class CoinCommunities {
const hits = this._pointerRay(clientX, clientY).intersectObjects(owned, true);
const id = hits.length ? this.worldObjects.idForHit(hits[0].object) : null;
if (!id) return;
- this.net?.removeObject(id);
+ if (this.worldObjects.isLocal(id)) {
+ // A locally-driven prop (restored from the world doc, or built offline):
+ // remove it here and record the deletion so the next save doesn't just
+ // resurrect it from the doc we loaded.
+ this.worldObjects.removeLocal(id);
+ this._offlineBuilt?.delete(id);
+ this._removedPersisted?.add(id);
+ this._persistLocalBuild();
+ this._syncBudget();
+ } else {
+ this.net?.removeObject(id);
+ }
if (typeof navigator !== 'undefined' && navigator.vibrate) navigator.vibrate(20);
}
@@ -3034,9 +3156,13 @@ export class CoinCommunities {
if (this.buildHud.mode === 'remove') { this.propGhost.hide(); return; }
const target = this._propTarget(clientX, clientY);
if (!target) { this.propGhost.hide(); return; }
- this.propGhost.setType(this.buildProp);
+ const def = propDef(this.buildProp);
+ this.propGhost.setType(this.buildProp, def?.upload ? def.glb : '');
this.propGhost.setPose(target.x, target.y, target.z, this.buildPropRot * (Math.PI / 2), this.buildPropScale);
- this.propGhost.setValid(target.valid && this.net?.status === 'online');
+ // Placement is valid online (the room takes it) or offline once the durable
+ // world store is open and writable (P3.1) — the ghost tells the truth about
+ // which of those is actually available right now.
+ this.propGhost.setValid(target.valid && (this._roomIsAuthority() || !!this._worldStore?.writable));
this.propGhost.show();
}
@@ -3050,10 +3176,154 @@ export class CoinCommunities {
const msg = {
world_full: 'This world is full of props — remove some to place more.',
player_full: 'You’ve hit your prop limit for this world — remove some to place more.',
+ asset_url: 'That model isn’t hosted where this world can load it. Re-upload it and try again.',
}[reason] || 'That prop couldn’t be placed.';
this.ui.toast(msg, 'warn');
}
+ // ---------------------------------------------------------------- durable world build (P3.1)
+ // Two writers, never at once:
+ // • a live `walk_world` room is authoritative and persists the build itself
+ // (multiplayer/src/persistence.js), so this client only READS;
+ // • with no room, this client is the writer: it renders the persisted build
+ // locally and saves its own placements back through the same API.
+ // `WorldBuildStore.setArmed()` is the handover, and `worldIdForCoin()` produces
+ // byte-identical keys to WalkRoom's `worldKey`, so both writers touch one doc.
+
+ /** Is the authoritative room currently the writer? */
+ _roomIsAuthority() { return this.net?.status === 'online'; }
+
+ // Open (and immediately read) this coin's durable build document.
+ _openWorldStore(coin, tier) {
+ this._closeWorldStore();
+ this._roomSynced = false;
+ this._offlineBuilt = new Map(); // id → record, props placed with no room
+ this._removedPersisted = new Set(); // ids deleted locally out of the saved doc
+ const worldId = worldIdForCoin(coin?.mint || '', tier === 'holders' ? 'holders' : '');
+ const store = new WorldBuildStore({
+ worldId,
+ onDenied: (info) => this._onWorldSaveDenied(info),
+ onError: (info) => this._onWorldSaveError(info),
+ onSaved: () => { if (!this._roomIsAuthority()) this.buildHud.setPersistent(true); },
+ });
+ this._worldStore = store;
+ // A closed tab must not eat the last few placements: the debounce window is
+ // seconds long, so flush on the way out. `pagehide` fires for closes, reloads
+ // and bfcache evictions alike, which `beforeunload` does not.
+ this._worldStoreUnload = () => { if (store.pending) store.flush().catch(() => {}); };
+ addEventListener('pagehide', this._worldStoreUnload);
+ const epoch = this._enterEpoch;
+ store.load().then(({ doc, error }) => {
+ // The player may have left (or hopped coins) while the read was in flight.
+ if (this._worldStore !== store || epoch !== this._enterEpoch) return;
+ if (error) {
+ log.warn('[coincommunities] world build load failed:', error);
+ return;
+ }
+ this._restorePersistedBuild(doc);
+ });
+ }
+
+ // Render a loaded doc's props locally. Skipped once the room has synced: from
+ // that point the room's own restore of the SAME doc is already in the scene.
+ _restorePersistedBuild(doc) {
+ if (this._roomSynced || !this.worldObjects) return;
+ const objects = docObjects(doc);
+ if (!objects.length) return;
+ let n = 0;
+ for (const o of objects) {
+ if (n >= MAX_WORLD_OBJECTS) break;
+ this.worldObjects.addLocal(o, { mine: !!this.net?.ownsObject(o) });
+ n++;
+ }
+ this._syncBudget();
+ log.info('[coincommunities] restored', n, 'persisted props from the world store');
+ }
+
+ // The room finished its first state sync. It restored the same document, so our
+ // local copies are duplicates — drop them — and anything we built while offline
+ // is handed to the room as real spawn intents so it joins the shared world (and
+ // gets persisted by the authority) instead of stranding in a local doc.
+ _onRoomSynced() {
+ this._roomSynced = true;
+ this._worldStore?.setArmed(false);
+ const handoff = [...(this._offlineBuilt?.values() || [])];
+ this.worldObjects?.dropLocal();
+ this._offlineBuilt?.clear();
+ this._removedPersisted?.clear();
+ for (const rec of handoff.slice(0, MAX_OBJECTS_PER_PLAYER)) {
+ this.net?.spawnObject(rec.kind || 'prop', {
+ type: rec.type, x: rec.x, y: rec.y, z: rec.z,
+ yaw: rec.yaw, scale: rec.scale, url: rec.url || undefined,
+ });
+ }
+ if (handoff.length) {
+ this.ui.toast(`Shared ${handoff.length} prop${handoff.length === 1 ? '' : 's'} you built offline with everyone here.`, 'info');
+ }
+ this._syncBudget();
+ }
+
+ // Hand the pen back to this client after the room drops, so a solo session can
+ // keep building into the same durable document.
+ _armLocalWorldWriter() {
+ if (!this._worldStore) return;
+ this._roomSynced = false;
+ this._worldStore.setArmed(true);
+ }
+
+ // Arm a debounced durable save of the local build. The producer runs at flush
+ // time against the FRESHEST doc the store has (re-run after a 409), so a
+ // concurrent writer's props are merged rather than overwritten.
+ _persistLocalBuild() {
+ const store = this._worldStore;
+ if (!store || this._roomIsAuthority()) return;
+ store.queueSave((base) => {
+ const mine = new Map();
+ for (const rec of this.worldObjects?.localObjects() || []) mine.set(rec.id, rec);
+ const kept = docObjects(base)
+ .filter((o) => !this._removedPersisted.has(o.id) && !mine.has(o.id));
+ const objects = [...kept, ...mine.values()].slice(0, MAX_WORLD_OBJECTS);
+ return { ...(base && typeof base === 'object' ? base : {}), objects };
+ });
+ }
+
+ // The store refused this client's identity. Terminal for the session, so say so
+ // once, plainly, and stop claiming the build is saved.
+ _onWorldSaveDenied({ reason }) {
+ this.buildHud.setPersistent(false);
+ this.ui.toast(reason === 'signin'
+ ? 'Sign in to save what you build here — until then it only exists in this tab.'
+ : 'This world belongs to someone else, so your offline build can’t be saved to it.', 'warn');
+ }
+
+ _onWorldSaveError({ reason }) {
+ this.buildHud.setPersistent(false);
+ if (reason === 'too_large') {
+ this.ui.toast('This world has hit its saved-build size limit — remove some props to save more.', 'warn');
+ return;
+ }
+ // Network/server blips are transient: the next placement re-arms the save, so
+ // don't shout. The unsaved badge already carries the state.
+ log.warn('[coincommunities] world save failed:', reason);
+ }
+
+ // Flush anything pending and tear the store down (leaving a world / a coin hop).
+ _closeWorldStore() {
+ const store = this._worldStore;
+ this._worldStore = null;
+ this._roomSynced = false;
+ this._offlineBuilt = null;
+ this._removedPersisted = null;
+ if (this._worldStoreUnload) {
+ removeEventListener('pagehide', this._worldStoreUnload);
+ this._worldStoreUnload = null;
+ }
+ if (!store) return;
+ // Fire-and-forget: the flush is a real network write, but leaving must not
+ // wait on it. dispose() after it settles so a late timer can't resurrect.
+ store.flush().catch(() => {}).finally(() => store.dispose());
+ }
+
// Arm a hold-to-break timer for the current press. If the player keeps the
// pointer down and still (no drag) past LONG_PRESS_MS, break the targeted block
// — the touch-native equivalent of a right-click. Cancelled by movement or release.
@@ -3176,7 +3446,12 @@ export class CoinCommunities {
creator: !!p.creator,
cap: Number(p.cap) || 0,
used: Number(p.used) || 0,
- clearMaxRadius: Number(p.clearMaxRadius) || 12,
+ // P3.2: the server sends the radius this player earned (visitor / holder
+ // world / coin creator). Falling back to the same tier function keeps an
+ // older server's omitted field honest instead of guessing a flat number.
+ clearMaxRadius: Number(p.clearMaxRadius) || buildClearRadius({
+ creator: !!p.creator, holder: this.coin?.tier === 'holders',
+ }),
};
this.buildHud.setCreator(this._buildPerms.creator);
this.buildHud.setUsage(this._buildPerms.used, this._buildPerms.cap);
@@ -3184,11 +3459,24 @@ export class CoinCommunities {
this.ui.setWorldCreator(this._buildPerms.creator);
}
+ // The permission snapshot before the server has spoken. The clear radius comes
+ // from the SAME tier function the room enforces (P3.2), seeded with what this
+ // client can honestly claim on its own: no proven creator standing, but it does
+ // know which tier of world it asked to enter.
+ _defaultBuildPerms() {
+ return {
+ creator: false,
+ cap: 0,
+ used: 0,
+ clearMaxRadius: buildClearRadius({ creator: false, holder: this.coin?.tier === 'holders' }),
+ };
+ }
+
// Clear the per-player meter + creator tool — on leave and on every (re)connect,
// before fresh perms arrive, so a solo build or a different world never inherits
// the last one's allowance or moderation control.
_resetBuildPerms() {
- this._buildPerms = { creator: false, cap: 0, used: 0, clearMaxRadius: 12 };
+ this._buildPerms = this._defaultBuildPerms();
this.buildHud.setCreator(false);
this.buildHud.setUsage(0, 0);
this.ui.setWorldCreator(false);
@@ -3243,7 +3531,7 @@ export class CoinCommunities {
this.net.sendClearAll();
return;
}
- const r = this._buildPerms.clearMaxRadius || 12;
+ const r = this._buildPerms.clearMaxRadius || buildClearRadius({ creator: true, holder: this.coin?.tier === 'holders' });
if (typeof confirm === 'function' && !confirm(`Clear all blocks within ${r} cells of where you stand?`)) return;
const gx = Math.round(this.localPos.x / BLOCK);
const gz = Math.round(this.localPos.z / BLOCK);
diff --git a/src/game/community-net.js b/src/game/community-net.js
index f663ae096..78e86877f 100644
--- a/src/game/community-net.js
+++ b/src/game/community-net.js
@@ -461,7 +461,12 @@ export class CommunityNet {
// The first decoded state snapshot: everything the room already held
// (blocks, objects, vehicles) has now been emitted through the callbacks
// registered above. Registered AFTER them so their handlers run first.
- this.room.onStateChange.once(() => { if (!this._destroyed && gen === this._connectGen) this._emit('synced'); });
+ // Guarded like every other optional room surface here: an older server
+ // build (or a stubbed room in a test harness) may not expose the signal,
+ // and a missing sync notification must never take the whole join down.
+ this.room.onStateChange?.once?.(() => {
+ if (!this._destroyed && gen === this._connectGen) this._emit('synced');
+ });
this.room.onLeave((code, reason) => {
this._setStatus('offline');
diff --git a/src/game/vrm-loader.js b/src/game/vrm-loader.js
new file mode 100644
index 000000000..798bfe3e3
--- /dev/null
+++ b/src/game/vrm-loader.js
@@ -0,0 +1,195 @@
+// vrm-loader — VRM avatars and props in /play (W-world-online P3.4).
+//
+// A VRM file IS a glTF binary: same 12-byte header, same JSON + BIN chunks, with
+// the humanoid/material/spring data hanging off `extensions.VRM` (VRM 0.x) or
+// `extensions.VRMC_vrm` (VRM 1.0). That means our existing GLTFLoader already
+// parses one and gets real meshes, real materials and a real skeleton out of it.
+// It does NOT, on its own, get three things right, and those three are exactly
+// what makes an untouched VRM look broken in-engine:
+//
+// 1. Facing. VRM 0.x characters face -Z; VRM 1.0 (and every other avatar we
+// load) faces +Z. Without the flip a VRM 0.x avatar walks backwards.
+// 2. Culling. VRM exporters routinely ship skinned meshes whose bind-pose
+// bounding boxes don't cover the animated pose, so three.js frustum-culls
+// body parts as the camera moves and the avatar flickers apart.
+// 3. Double-sided hair/clothing planes authored for MToon read as one-sided
+// holes under a standard material.
+//
+// This module fixes all three on the plain-glTF path, so VRM avatars and props
+// work today with no new dependency, and the skeleton is picked up by
+// src/glb-canonicalize.js, which already maps both VRM 0.x (`J_Bip_C_Hips`) and
+// VRM 1.0 (`upperChest`) bone naming onto the canonical rig — so the pre-baked
+// idle/walk/emote clips retarget onto a VRM the same as any other humanoid.
+//
+// ── The @pixiv/three-vrm seam ────────────────────────────────────────────────
+// What the plain path does NOT reproduce is MToon's toon shading + outlines,
+// spring-bone physics (hair/skirt secondary motion), the humanoid normalization
+// rig, blend-shape expression presets and look-at. Those need the reference
+// implementation. `setVrmPluginFactory()` is the single integration point for it:
+// call it once at boot with a factory that returns a GLTFLoader plugin, and every
+// avatar/prop load in the app routes through it automatically — no call site
+// changes. To light it up:
+//
+// npm install @pixiv/three-vrm
+//
+// // src/game/boot-avatar.js (or any boot path), once:
+// import { VRMLoaderPlugin, VRMUtils } from '@pixiv/three-vrm';
+// import { setVrmPluginFactory } from './vrm-loader.js';
+// setVrmPluginFactory((parser) => new VRMLoaderPlugin(parser), { VRMUtils });
+//
+// Until that call happens the plain path above runs, which is a real, working
+// VRM load, not a stub: nothing here fakes support it doesn't have.
+
+import { Box3, Vector3, DoubleSide } from 'three';
+import { log } from '../shared/log.js';
+
+const GLB_MAGIC = 0x46546c67; // 'glTF'
+const CHUNK_JSON = 0x4e4f534a; // 'JSON'
+
+/** The glTF extension keys that mark a file as VRM. */
+export const VRM_EXT_0 = 'VRM'; // VRM 0.x
+export const VRM_EXT_1 = 'VRMC_vrm'; // VRM 1.0
+
+// The optional reference implementation, installed by setVrmPluginFactory().
+let _pluginFactory = null;
+let _vrmUtils = null;
+
+/**
+ * Register @pixiv/three-vrm (or any GLTFLoader plugin with the same contract) as
+ * the VRM parser for the whole app. Idempotent; pass null to unregister.
+ * @param {(parser:object)=>object|null} factory returns a GLTFLoader plugin
+ * @param {object} [opts]
+ * @param {object} [opts.VRMUtils] the library's VRMUtils, used for rotateVRM0 /
+ * combineSkeletons / removeUnnecessaryJoints when available
+ */
+export function setVrmPluginFactory(factory, { VRMUtils = null } = {}) {
+ _pluginFactory = typeof factory === 'function' ? factory : null;
+ _vrmUtils = VRMUtils;
+}
+
+/** Is the reference VRM implementation wired up? Honest capability probe. */
+export function hasVrmPlugin() { return !!_pluginFactory; }
+
+/**
+ * Register the VRM plugin on a GLTFLoader, if one has been installed.
+ * Safe (and free) to call on every loader; returns whether anything was added.
+ */
+export function installVrmPlugin(loader) {
+ if (!_pluginFactory || !loader?.register) return false;
+ if (loader.__vrmPluginInstalled) return true;
+ loader.register((parser) => _pluginFactory(parser));
+ loader.__vrmPluginInstalled = true;
+ return true;
+}
+
+/** Does this url name a VRM file? (Cheap pre-check; the buffer probe is truth.) */
+export function isVrmUrl(url) {
+ return typeof url === 'string' && /\.vrm(\?|#|$)/i.test(url);
+}
+
+/**
+ * Read the glTF JSON chunk out of a GLB/VRM ArrayBuffer without a full parse.
+ * Returns the parsed JSON, or null if the bytes are not a GLB.
+ */
+export function readGlbJson(buffer) {
+ try {
+ const view = new DataView(buffer);
+ if (view.byteLength < 20) return null;
+ if (view.getUint32(0, true) !== GLB_MAGIC) return null;
+ const chunkLength = view.getUint32(12, true);
+ if (view.getUint32(16, true) !== CHUNK_JSON) return null;
+ if (20 + chunkLength > view.byteLength) return null;
+ const text = new TextDecoder().decode(new Uint8Array(buffer, 20, chunkLength));
+ return JSON.parse(text);
+ } catch {
+ return null;
+ }
+}
+
+/**
+ * Which VRM generation, if any, does this parsed glTF JSON declare?
+ * @returns {0|1|null} 0 for VRM 0.x, 1 for VRM 1.0, null for a plain glTF
+ */
+export function vrmVersionOfJson(json) {
+ const ext = json?.extensions;
+ const used = Array.isArray(json?.extensionsUsed) ? json.extensionsUsed : [];
+ if (ext?.[VRM_EXT_1] || used.includes(VRM_EXT_1)) return 1;
+ if (ext?.[VRM_EXT_0] || used.includes(VRM_EXT_0)) return 0;
+ return null;
+}
+
+/** Same probe, straight off an ArrayBuffer. */
+export function vrmVersionOfBuffer(buffer) {
+ return vrmVersionOfJson(readGlbJson(buffer));
+}
+
+/** Same probe, off a parsed GLTFLoader result. */
+export function vrmVersionOfGltf(gltf) {
+ if (gltf?.userData?.vrm) return gltf.userData.vrm.meta?.metaVersion === '1' ? 1 : 0;
+ return vrmVersionOfJson(gltf?.parser?.json);
+}
+
+/**
+ * Make a parsed VRM behave like every other avatar in the scene. No-op for a
+ * plain glTF, so it is safe to call on every load.
+ *
+ * @param {object} gltf GLTFLoader result
+ * @returns {{vrm:boolean, version:0|1|null, plugin:boolean}}
+ */
+export function prepareVrmModel(gltf) {
+ const version = vrmVersionOfGltf(gltf);
+ if (version == null) return { vrm: false, version: null, plugin: false };
+
+ const scene = gltf.scene;
+ const vrm = gltf.userData?.vrm || null;
+
+ // With the reference implementation present, let it do the heavy lifting: its
+ // humanoid normalization and skeleton merge are strictly better than anything
+ // re-derived here.
+ if (vrm && _vrmUtils) {
+ try {
+ if (version === 0) _vrmUtils.rotateVRM0?.(vrm);
+ _vrmUtils.combineSkeletons?.(scene);
+ _vrmUtils.removeUnnecessaryVertices?.(scene);
+ } catch (e) {
+ log.warn('[vrm-loader] VRMUtils pass failed', e?.message || e);
+ }
+ } else if (version === 0) {
+ // Plain-glTF path: VRM 0.x faces -Z, everything else in this app faces +Z.
+ // Rotating the scene root (rather than the hips) keeps the skeleton's local
+ // transforms untouched, so retargeted clips still apply cleanly.
+ scene.rotation.y += Math.PI;
+ scene.updateMatrixWorld(true);
+ }
+
+ // Skinned VRM meshes routinely carry bind-pose bounds that don't contain the
+ // animated pose; three.js then culls limbs mid-stride. Opting these meshes out
+ // of frustum culling costs one extra draw call each and fixes the flicker.
+ scene.traverse((n) => {
+ if (!n.isMesh) return;
+ if (n.isSkinnedMesh) n.frustumCulled = false;
+ const mats = Array.isArray(n.material) ? n.material : [n.material];
+ for (const m of mats) {
+ if (!m) continue;
+ // MToon authors hair and cloth as single-quad planes meant to be seen
+ // from both sides; the standard-material fallback renders them
+ // one-sided, which reads as holes through the model.
+ if (m.transparent || m.alphaTest > 0) {
+ m.side = DoubleSide;
+ m.needsUpdate = true;
+ }
+ }
+ });
+
+ return { vrm: true, version, plugin: !!vrm };
+}
+
+/**
+ * Measure a prepared model: standing height and largest horizontal extent. Used
+ * by the prop path to fit an upload onto the ground at a sane size.
+ */
+export function measureModel(object3d) {
+ const size = new Vector3();
+ new Box3().setFromObject(object3d).getSize(size);
+ return { height: size.y, extent: Math.max(size.x, size.y, size.z) };
+}
diff --git a/src/game/world-objects.js b/src/game/world-objects.js
index 2e5d738ad..661ea4d3a 100644
--- a/src/game/world-objects.js
+++ b/src/game/world-objects.js
@@ -69,7 +69,9 @@ export const PROP_CATALOG = [
{ id: 'pole', name: 'Pole', icon: '🎚️', foot: 0.35, glb: '/club/props/pole.glb', fitH: 3.0 },
];
const PROP_BY_ID = new Map(PROP_CATALOG.map((p) => [p.id, p]));
-export function propDef(type) { return PROP_BY_ID.get(type) || GALLERY_PROPS.get(type) || null; }
+export function propDef(type) {
+ return PROP_BY_ID.get(type) || GALLERY_PROPS.get(type) || UPLOAD_PROPS.get(type) || null;
+}
export const DEFAULT_PROP = PROP_CATALOG[0].id;
// ── gallery props ────────────────────────────────────────────────────────────
@@ -282,12 +284,46 @@ function instanceGLB(def, holder) {
// server-side against the storage allow-list), so it needs no catalog entry and
// no id namespace: any client that receives the object can render it. Heights are
// clamped so a mis-scaled export can't become a skybox-filling wall.
-export const UPLOAD_PROP_TYPE = 'upload';
+export const UPLOAD_PROP_PREFIX = 'u:';
const UPLOAD_FIT_MIN_M = 0.25;
const UPLOAD_FIT_MAX_M = 8;
+const UPLOAD_PROPS = new Map(); // 'u:<hash>' → def
function uploadDef(url) {
- return { id: UPLOAD_PROP_TYPE, name: 'Uploaded model', icon: '📤', glb: url, fitH: null, foot: 0.6 };
+ return { id: UPLOAD_PROP_PREFIX, name: 'Uploaded model', icon: '📤', glb: url, fitH: null, foot: 0.6 };
+}
+
+export function isUploadType(type) {
+ return typeof type === 'string' && type.startsWith(UPLOAD_PROP_PREFIX);
+}
+
+// FNV-1a over the model url: a short, stable, collision-resistant-enough id so the
+// same upload always maps to the same palette entry (and the same `type` on the
+// wire) no matter how often it is re-registered. 10 chars, well inside the
+// server's 48-char type budget.
+function uploadIdFor(url) {
+ let h = 0x811c9dc5;
+ for (let i = 0; i < url.length; i++) {
+ h ^= url.charCodeAt(i);
+ h = Math.imul(h, 0x01000193) >>> 0;
+ }
+ return UPLOAD_PROP_PREFIX + h.toString(36).padStart(7, '0');
+}
+
+/**
+ * Register a player-uploaded model as a placeable prop (P3.3). Idempotent — the
+ * same url always yields the same def, so re-uploading or restoring a build never
+ * duplicates a palette entry. The model's url travels with each placed object, so
+ * every other client renders it without needing this registry.
+ * @returns {{id:string,name:string,icon:string,glb:string,fitH:null,foot:number,upload:true}}
+ */
+export function registerUploadedProp(url, { name = 'Your model' } = {}) {
+ const id = uploadIdFor(String(url || ''));
+ let def = UPLOAD_PROPS.get(id);
+ if (def) { def.glb = url; return def; }
+ def = { id, name, icon: '📤', glb: url, fitH: null, foot: 0.6, upload: true };
+ UPLOAD_PROPS.set(id, def);
+ return def;
}
// Build the scene node for a prop. `url` (when present) is a player-uploaded
@@ -492,6 +528,13 @@ export class WorldObjects {
/** Is this id a locally-driven entry (rather than the server's)? */
isLocal(id) { return !!this.entries.get(id)?.local; }
+ /** Remove a locally-driven entry. No-op for a server-owned object. */
+ removeLocal(id) {
+ if (!this.entries.get(id)?.local) return false;
+ this._remove(id);
+ return true;
+ }
+
/** The local entries as plain records — what the world-doc producer persists. */
localObjects(out = []) {
out.length = 0;
diff --git a/src/game/world-persist.js b/src/game/world-persist.js
index 33f0e8bfb..35080e840 100644
--- a/src/game/world-persist.js
+++ b/src/game/world-persist.js
@@ -110,6 +110,22 @@ export class WorldBuildStore {
this._timer = null;
this._inFlight = null;
this._disposed = false;
+ // Armed = this client is the writer. Disarmed the moment an authoritative
+ // room takes over (it writes the same doc with a service token), so the two
+ // never race each other over one document.
+ this._armed = true;
+ }
+
+ get armed() { return this._armed; }
+
+ /**
+ * Hand the pen over, or take it back. Disarming drops any pending debounce
+ * without writing: the room that just took authority has the same objects and
+ * will persist them itself.
+ */
+ setArmed(on) {
+ this._armed = !!on;
+ if (!this._armed && this._timer) { clearTimeout(this._timer); this._timer = null; }
}
/** Has a real round-trip proven this client can write? Drives the HUD badge. */
@@ -151,7 +167,7 @@ export class WorldBuildStore {
if (typeof produce !== 'function') {
throw new TypeError('WorldBuildStore.queueSave(produce): produce must be a function returning the doc');
}
- if (this._disposed || this.denied) return;
+ if (this._disposed || this.denied || !this._armed) return;
this._produce = produce;
if (this._timer) return;
this._timer = setTimeout(() => { this._timer = null; this.flush().catch(() => {}); }, this._debounceMs);
@@ -167,7 +183,7 @@ export class WorldBuildStore {
*/
async flush() {
if (this._timer) { clearTimeout(this._timer); this._timer = null; }
- if (this._disposed || this.denied || !this._produce) return 'idle';
+ if (this._disposed || this.denied || !this._armed || !this._produce) return 'idle';
if (this._inFlight) return this._inFlight;
this._inFlight = this._flushOnce().finally(() => { this._inFlight = null; });
return this._inFlight;
diff --git a/src/glb-canonicalize.js b/src/glb-canonicalize.js
index 9b631f796..6d5f40119 100644
--- a/src/glb-canonicalize.js
+++ b/src/glb-canonicalize.js
@@ -100,6 +100,24 @@ const UNREAL_ALIASES = new Map(Object.entries({
thighr: 'RightUpLeg', calfr: 'RightLeg', footr: 'RightFoot', ballr: 'RightToeBase',
}));
+// Unreal's finger chain: `index_01_l`, `middle_02_r`, `thumb_03_l`, `pinky_01_l`,
+// `ring_02_l`. The zero-padded joint index is what keeps these out of the
+// side-suffix finger table below (`Index1L` normalises to `index1l`, never
+// `index01l`), so an otherwise-mapped mannequin arrived with 30 of its 52 joints
+// unmapped. That is not a cosmetic loss: 30 of the clip library's 53 tracks are
+// finger tracks, so a fingerless mannequin scored 40% coverage and fell under the
+// MIN_COVERAGE gate in animation-retarget.js — the rig built no action at all and
+// stood in its bind pose. Found by scripts/animation-dignity-sweep.mjs.
+for (const [uf, cf] of [
+ ['thumb', 'Thumb'], ['index', 'Index'], ['middle', 'Middle'],
+ ['ring', 'Ring'], ['pinky', 'Pinky'],
+]) {
+ for (let n = 1; n <= 3; n++) {
+ UNREAL_ALIASES.set(`${uf}0${n}l`, `LeftHand${cf}${n}`);
+ UNREAL_ALIASES.set(`${uf}0${n}r`, `RightHand${cf}${n}`);
+ }
+}
+
// Extended humanoid alias map: VRM/VRoid, VRM 1.0, Daz/Genesis, MakeHuman, and
// simple/generic rigs. Keyed by the same separator-stripped, lowercased form
// `_lookupBone` produces (e.g. `J_Bip_L_UpperArm` → `jbiplupperarm`,
@@ -167,6 +185,14 @@ const EXTRA_ALIASES = (() => {
['spine0', 'Spine'],
// UniGLTF/VRM-converter root joint.
['hipMaster', 'Hips'],
+ // Anatomical-Latin rigs. Scan pipelines, medical/anatomy kits, and the
+ // ZBrush/Blender anatomy libraries name every joint for the bone itself
+ // rather than for its role: `pelvis` (already mapped via the Unreal table),
+ // `lumbar`, `thoracic`, `sternum`, `cervical`, `cranium`, with `humerus.L`,
+ // `femur.L` and friends on the limbs below. The whole convention previously
+ // mapped 3 of 52 joints and animated nothing at all.
+ ['lumbar', 'Spine'], ['thoracic', 'Spine1'], ['sternum', 'Spine2'],
+ ['cervical', 'Neck'], ['cranium', 'Head'], ['skull', 'Head'],
]) put(v, c);
// Side-paired limb bones, given as the LEFT spelling + its canonical; the
@@ -228,7 +254,65 @@ const EXTRA_ALIASES = (() => {
// rigs using this convention mapped zero bones.
['lHip', 'LeftUpLeg'], ['lKnee', 'LeftLeg'], ['lAnkle', 'LeftFoot'],
['lElbow', 'LeftForeArm'], ['lWrist', 'LeftHand'], ['lToes', 'LeftToeBase'],
+ // Anatomical-Latin limbs, in both the side-SUFFIX (`humerus.L`) and
+ // side-PREFIX (`l_humerus`) spellings these rigs ship in. The clavicle
+ // (`scapula`) is already covered above. Radius and ulna are both forearm
+ // joints and fibula is a lower-leg joint: whichever the rig actually skins
+ // to is the one the retargeter binds (first-bone-wins), and either drives
+ // the same limb segment.
+ ['humerusL', 'LeftArm'], ['lHumerus', 'LeftArm'],
+ ['ulnaL', 'LeftForeArm'], ['lUlna', 'LeftForeArm'],
+ ['radiusL', 'LeftForeArm'], ['lRadius', 'LeftForeArm'],
+ ['carpusL', 'LeftHand'], ['lCarpus', 'LeftHand'],
+ ['femurL', 'LeftUpLeg'], ['lFemur', 'LeftUpLeg'],
+ ['tibiaL', 'LeftLeg'], ['lTibia', 'LeftLeg'],
+ ['fibulaL', 'LeftLeg'], ['lFibula', 'LeftLeg'],
+ ['talusL', 'LeftFoot'], ['lTalus', 'LeftFoot'],
+ ['tarsusL', 'LeftFoot'], ['lTarsus', 'LeftFoot'],
+ ['calcaneusL', 'LeftFoot'], ['lCalcaneus', 'LeftFoot'],
+ ['metatarsusL', 'LeftToeBase'], ['lMetatarsus', 'LeftToeBase'],
];
+
+ // Finger conventions the side-suffix `Index1L` family below does not reach.
+ // Fingers are 30 of the clip library's 53 tracks, so a rig whose hands don't
+ // name-map scores ~40% coverage and falls under animation-retarget.js's
+ // MIN_COVERAGE gate: production then builds NO action for it and the avatar
+ // stands in its bind pose. Every convention here was measured doing exactly
+ // that by scripts/animation-dignity-sweep.mjs before these entries landed.
+ for (const [vf, cf] of [
+ ['Thumb', 'Thumb'], ['Index', 'Index'], ['Middle', 'Middle'],
+ ['Ring', 'Ring'], ['Pinky', 'Pinky'], ['Little', 'Pinky'],
+ ]) {
+ const lf = vf.toLowerCase();
+ for (let n = 1; n <= 3; n++) {
+ // Daz / Genesis side-PREFIX numbering: `lIndex1`, `rPinky3`. (Genesis
+ // abbreviates the middle finger to `lMid1`, handled just below.)
+ SIDED.push([`l${vf}${n}`, `LeftHand${cf}${n}`]);
+ // Blender Rigify: `f_index.01.L`, `f_pinky.03.R`, and the thumb's own
+ // `thumb.01.L` spelling (Rigify drops the `f_` there).
+ SIDED.push([`f_${lf}.0${n}.L`, `LeftHand${cf}${n}`]);
+ SIDED.push([`${lf}.0${n}.L`, `LeftHand${cf}${n}`]);
+ // MakeHuman numbers the digits 1..5 from the thumb: `finger1-2.L` is the
+ // thumb's middle phalanx, `finger5-1.R` the right pinky's first.
+ const digit = ['Thumb', 'Index', 'Middle', 'Ring', 'Pinky'].indexOf(cf) + 1;
+ if (digit > 0) SIDED.push([`finger${digit}-${n}.L`, `LeftHand${cf}${n}`]);
+ }
+ // VRM 1.0 and anatomical rigs name the phalanges instead of numbering them:
+ // proximal / intermediate / distal, with the thumb starting at its
+ // metacarpal (which is the canonical set's `Thumb1`). VRM 1.0 puts the side
+ // first (`leftIndexProximal`); anatomy-kit rigs put it last
+ // (`index_proximal.L`). Both spellings are listed so either resolves.
+ const phalanges =
+ cf === 'Thumb'
+ ? ['Metacarpal', 'Proximal', 'Distal']
+ : ['Proximal', 'Intermediate', 'Distal'];
+ phalanges.forEach((phalanx, i) => {
+ SIDED.push([`left${vf}${phalanx}`, `LeftHand${cf}${i + 1}`]);
+ SIDED.push([`${lf}_${phalanx.toLowerCase()}.L`, `LeftHand${cf}${i + 1}`]);
+ });
+ }
+ // Genesis abbreviates only the middle finger.
+ for (let n = 1; n <= 3; n++) SIDED.push([`lMid${n}`, `LeftHandMiddle${n}`]);
// Side-suffix finger chains, both conventions found in real uploaded avatars by
// scripts/audit-rig-coverage.mjs:
// • Blender / MakeHuman: `Index.L`, `Index2.L`, `Middle1.L`, `Thumb.L`, `Ring2.R`
diff --git a/src/marketplace.js b/src/marketplace.js
index 670d6efe7..6e66350cb 100644
--- a/src/marketplace.js
+++ b/src/marketplace.js
@@ -2227,7 +2227,7 @@ async function startAgentFromAvatar() {
const params = new URLSearchParams({ avatar_id: activeAvatar.avatarId || '' });
if (activeAvatar.name) params.set('avatar_name', activeAvatar.name);
if (activeAvatar.glbUrl) params.set('avatar_glb', activeAvatar.glbUrl);
- location.href = `/agent/new?${params.toString()}`;
+ location.href = `/create-agent?${params.toString()}`;
}
// ── Skills marketplace tab ───────────────────────────────────────────────
diff --git a/src/procedural/canonical-bones.js b/src/procedural/canonical-bones.js
new file mode 100644
index 000000000..7594269f2
--- /dev/null
+++ b/src/procedural/canonical-bones.js
@@ -0,0 +1,67 @@
+// Resolve canonical bone names to the actual Object3D nodes on a loaded model.
+//
+// `canonicalNodeMapFromObject` (src/animation-retarget.js) returns canonical →
+// bone *name*, which is what the clip retargeter needs because animation tracks
+// address bones by name. Procedural layers need the node itself, and the
+// obvious way to get there — `model.getObjectByName(name)` — is a trap: it only
+// searches descendants of the root, while the canonical map is also built from
+// every `SkinnedMesh.skeleton.bones` entry, which need not be parented under
+// the model at all.
+//
+// That is not a rare shape. A GLB whose armature sits beside the mesh rather
+// than above it, and clones produced by SkeletonUtils, both hand you a model
+// where the skeleton drives the mesh correctly but `getObjectByName` finds
+// nothing. Resolving through name lookup made every layer silently report
+// `enabled === false` on those rigs — the exact "looks fine, does nothing"
+// failure the universal-rig doctrine exists to prevent.
+//
+// So: index nodes from the same two sources the canonical map is built from,
+// and hand back nodes.
+
+import { canonicalizeBoneName } from '../glb-canonicalize.js';
+
+/**
+ * Build canonical bone name → live node for a model.
+ *
+ * Mirrors `canonicalNodeMapFromObject`'s traversal exactly (scene-graph bones
+ * first, then every skinned mesh's skeleton) so the two maps always agree on
+ * which node a canonical name refers to. First writer wins, matching that
+ * function's `if (!map.has(canonical))` rule.
+ *
+ * @param {import('three').Object3D} root
+ * @returns {Map<string, import('three').Object3D>}
+ */
+export function canonicalBoneNodes(root) {
+ const map = new Map();
+ if (!root) return map;
+
+ const consider = (node) => {
+ if (!node?.name) return;
+ const canonical = canonicalizeBoneName(node.name);
+ if (canonical && !map.has(canonical)) map.set(canonical, node);
+ };
+
+ const skinned = [];
+ root.traverse((node) => {
+ if (node.isSkinnedMesh) skinned.push(node);
+ if (node.isBone) consider(node);
+ });
+ for (const sm of skinned) {
+ for (const bone of sm.skeleton?.bones || []) consider(bone);
+ }
+ return map;
+}
+
+/**
+ * Resolve the first canonical name that this rig actually has.
+ * @param {Map<string, import('three').Object3D>} nodes
+ * @param {string[]} candidates canonical names, most preferred first
+ * @returns {import('three').Object3D|null}
+ */
+export function firstCanonical(nodes, candidates) {
+ for (const name of candidates) {
+ const node = nodes.get(name);
+ if (node) return node;
+ }
+ return null;
+}
diff --git a/src/procedural/foot-plant.js b/src/procedural/foot-plant.js
index 5f28e8fcb..16bb8f8f2 100644
--- a/src/procedural/foot-plant.js
+++ b/src/procedural/foot-plant.js
@@ -14,7 +14,7 @@
// missing a full hip-knee-ankle chain reports enabled=false and no-ops.
import { Quaternion, Vector3 } from 'three';
-import { canonicalNodeMapFromObject } from '../animation-retarget.js';
+import { canonicalBoneNodes } from './canonical-bones.js';
import { solveTwoBoneIK } from './two-bone-ik.js';
import { PositionBaseline, QuaternionBaseline } from './pose-baseline.js';
@@ -40,7 +40,8 @@ export class FootPlantController {
* @param {(x: number, z: number) => number} getGroundY world-space terrain
* height sampler (same shape as the walk world's terrain.heightAt)
* @param {object} [opts]
- * @param {Map<string,string>} [opts.canonicalToNode] reuse an existing canonical bone map
+ * @param {Map<string,import('three').Object3D>} [opts.canonicalNodes] reuse an
+ * already-built canonical bone→node map instead of re-traversing the model
* @param {number} [opts.maxDrop] max pelvis drop in world metres (default 0.35)
* @param {number} [opts.maxLift] max per-foot raise in world metres (default 0.6)
* @param {number} [opts.damping] offset smoothing rate, 1/s (default 12)
@@ -60,11 +61,10 @@ export class FootPlantController {
this._legs = [];
if (model && this.getGroundY) {
- const map = opts.canonicalToNode || canonicalNodeMapFromObject(model);
- const resolve = (canonical) => {
- const name = map.get(canonical);
- return name ? model.getObjectByName(name) : null;
- };
+ // Node-based resolution (see canonical-bones.js): name lookup misses
+ // any rig whose armature is not parented under the model root.
+ const nodes = opts.canonicalNodes || canonicalBoneNodes(model);
+ const resolve = (canonical) => nodes.get(canonical) || null;
this.hips = resolve('Hips');
for (const leg of LEGS) {
const up = resolve(leg.up);
diff --git a/src/procedural/index.js b/src/procedural/index.js
index 76a1e97e8..7e90d8d40 100644
--- a/src/procedural/index.js
+++ b/src/procedural/index.js
@@ -5,6 +5,7 @@
// each frame AFTER mixer.update(), and it composes with whatever clip is
// playing without accumulating. Docs: docs/procedural-animation.md.
+export { canonicalBoneNodes, firstCanonical } from './canonical-bones.js';
export { solveTwoBoneIK } from './two-bone-ik.js';
export { LookAtController } from './look-at.js';
export { FootPlantController } from './foot-plant.js';
diff --git a/src/procedural/look-at.js b/src/procedural/look-at.js
index ee31f10fe..85c2b6b8e 100644
--- a/src/procedural/look-at.js
+++ b/src/procedural/look-at.js
@@ -13,7 +13,7 @@
// simply reports enabled=false and update() is a no-op.
import { Euler, Quaternion, Vector3 } from 'three';
-import { canonicalNodeMapFromObject } from '../animation-retarget.js';
+import { canonicalBoneNodes, firstCanonical } from './canonical-bones.js';
import { QuaternionBaseline } from './pose-baseline.js';
const DEG = Math.PI / 180;
@@ -47,8 +47,8 @@ export class LookAtController {
/**
* @param {import('three').Object3D} model a loaded avatar (any humanoid rig)
* @param {object} [opts]
- * @param {Map<string,string>} [opts.canonicalToNode] reuse an existing
- * canonical bone map (e.g. AnimationManager's) instead of re-traversing
+ * @param {Map<string,import('three').Object3D>} [opts.canonicalNodes] reuse an
+ * already-built canonical bone→node map instead of re-traversing the model
* @param {number} [opts.maxYaw] horizontal clamp, radians (default 65deg)
* @param {number} [opts.maxPitchUp] upward clamp, radians (default 30deg)
* @param {number} [opts.maxPitchDown] downward clamp, radians (default 35deg)
@@ -73,25 +73,24 @@ export class LookAtController {
/** @type {Array<{node: import('three').Object3D, share: number}>} */
this._joints = [];
if (model) {
- const map = opts.canonicalToNode || canonicalNodeMapFromObject(model);
- let total = 0;
- for (const { canonical, share } of CHAIN) {
- for (const name of canonical) {
- const nodeName = map.get(name);
- const node = nodeName ? model.getObjectByName(nodeName) : null;
+ // Resolve to nodes, not names: a rig whose armature is not parented
+ // under the model root is invisible to getObjectByName even though the
+ // canonical map finds it via skeleton.bones. See canonical-bones.js.
+ const nodes = opts.canonicalNodes || canonicalBoneNodes(model);
+ const head = nodes.get('Head');
+ // A chain without a head cannot "look"; stay disabled rather than
+ // nodding a torso at the target.
+ if (head) {
+ let total = 0;
+ for (const { canonical, share } of CHAIN) {
+ const node = firstCanonical(nodes, canonical);
if (node) {
this._joints.push({ node, share, baseline: new QuaternionBaseline() });
total += share;
- break;
}
}
+ for (const j of this._joints) j.share /= total || 1;
}
- // A chain without a head cannot "look"; disable rather than nod a torso.
- if (!this._joints.some((j) => j.node.name === map.get('Head'))) {
- this._joints = [];
- total = 0;
- }
- for (const j of this._joints) j.share /= total || 1;
}
}
@@ -100,6 +99,16 @@ export class LookAtController {
return this._joints.length > 0;
}
+ /**
+ * The head bone this chain terminates at, or null on an unusable rig. Exposed
+ * so callers can measure where the gaze actually ended up without re-deriving
+ * the rig's bone naming.
+ * @returns {import('three').Object3D|null}
+ */
+ get headBone() {
+ return this._joints.length ? this._joints[this._joints.length - 1].node : null;
+ }
+
/**
* Aim at a world-space point, or pass null to fade back to the base
* animation. The vector is copied; callers may reuse theirs.
diff --git a/src/runtime/scene.js b/src/runtime/scene.js
index cea02f696..1de62dc6b 100644
--- a/src/runtime/scene.js
+++ b/src/runtime/scene.js
@@ -9,7 +9,7 @@ import { getMeshoptDecoder } from '../viewer/internal.js';
import { resolveURI } from '../ipfs.js';
import { resolveSlot } from './animation-slots.js';
import { LookAtController } from '../procedural/look-at.js';
-import { canonicalNodeMapFromObject } from '../animation-retarget.js';
+import { canonicalBoneNodes } from '../procedural/canonical-bones.js';
import { log } from '../shared/log.js';
const EXPRESSION_MAP = {
@@ -339,10 +339,9 @@ export class SceneController {
if (!content) return null;
if (this._boneMapFor !== content) {
this._boneMapFor = content;
- this._boneMap = canonicalNodeMapFromObject(content);
+ this._boneMap = canonicalBoneNodes(content);
}
- const name = this._boneMap.get(canonical);
- return name ? content.getObjectByName(name) : null;
+ return this._boneMap.get(canonical) || null;
}
// --- Expression (morph targets) ---
diff --git a/src/shared/fuzzy.js b/src/shared/fuzzy.js
new file mode 100644
index 000000000..34b71fd31
--- /dev/null
+++ b/src/shared/fuzzy.js
@@ -0,0 +1,103 @@
+// Shared fuzzy matching for the command palettes and any other search-as-you-type
+// surface, backed by `@leeoniya/ufuzzy` (~7 kB, no dependencies).
+//
+// The two palettes previously each carried a four-branch scorer:
+//
+// exact ? 3 : prefix ? 2 : substring ? 1 : subsequence ? 0.5 : 0
+//
+// which cannot rank within a tier — every subsequence hit tied at 0.5, so
+// "close match" and "barely matches" sorted arbitrarily — and had no typo
+// tolerance, no word-boundary bonus, and no match positions, so highlighting
+// had to re-scan with a regex and could only mark contiguous runs.
+//
+// uFuzzy ranks by contiguity, word-boundary starts, and match position, and
+// hands back exact ranges for highlighting.
+
+import uFuzzy from '@leeoniya/ufuzzy';
+
+// intraMode 1 = single-error mode: one insertion, substitution, transposition,
+// or deletion is tolerated per term, which covers the common typo ("markteplace")
+// without degrading into matching everything. uFuzzy deliberately does NOT do
+// arbitrary sparse subsequence matching here, and that is the point: the old
+// scorer accepted any subsequence and then could not rank the results.
+const uf = new uFuzzy({
+ intraMode: 1,
+ intraIns: 1,
+ intraSub: 1,
+ intraTrn: 1,
+ intraDel: 1,
+});
+
+/**
+ * Rank `items` against `query`.
+ *
+ * @template T
+ * @param {string} query
+ * @param {T[]} items
+ * @param {(item: T) => string} getText Searchable text for an item. Join several
+ * fields with a space to make them all matchable.
+ * @param {object} [opts]
+ * @param {number} [opts.limit] Maximum results to return.
+ * @returns {Array<{ item: T, ranges: number[] }>} Best match first. `ranges` is
+ * uFuzzy's flat [start, end, start, end, …] list into the item's text.
+ */
+export function rank(query, items, getText, { limit } = {}) {
+ const q = String(query || '').trim();
+ if (!q) return items.map((item) => ({ item, ranges: [] }));
+ if (!items.length) return [];
+
+ const haystack = items.map((it) => String(getText(it) ?? ''));
+ const idxs = uf.filter(haystack, q);
+ if (!idxs || !idxs.length) return [];
+
+ const info = uf.info(idxs, haystack, q);
+ const order = uf.sort(info, haystack, q);
+
+ const out = [];
+ for (let i = 0; i < order.length; i++) {
+ if (limit != null && out.length >= limit) break;
+ const infoIdx = order[i];
+ out.push({ item: items[info.idx[infoIdx]], ranges: info.ranges[infoIdx] || [] });
+ }
+ return out;
+}
+
+/**
+ * Whether `text` matches `query` at all. For call sites that only need a
+ * boolean filter rather than an ordering.
+ */
+export function matches(query, text) {
+ const q = String(query || '').trim();
+ if (!q) return true;
+ const idxs = uf.filter([String(text ?? '')], q);
+ return !!(idxs && idxs.length);
+}
+
+/**
+ * Wrap matched ranges in `<mark>`, HTML-escaping everything else. Uses the
+ * ranges uFuzzy already computed, so non-contiguous matches highlight correctly
+ * instead of being re-found with a regex.
+ *
+ * @param {string} text
+ * @param {number[]} ranges Flat [start, end, …] pairs, as returned by `rank`.
+ * @returns {string} HTML.
+ */
+export function highlight(text, ranges) {
+ const s = String(text ?? '');
+ if (!ranges || !ranges.length) return escapeHtml(s);
+ let out = '';
+ let cursor = 0;
+ for (let i = 0; i < ranges.length; i += 2) {
+ const start = ranges[i];
+ const end = ranges[i + 1];
+ out += escapeHtml(s.slice(cursor, start));
+ out += `<mark>${escapeHtml(s.slice(start, end))}</mark>`;
+ cursor = end;
+ }
+ return out + escapeHtml(s.slice(cursor));
+}
+
+const ESC = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' };
+function escapeHtml(s) {
+ return String(s ?? '').replace(/[&<>"']/g, (c) => ESC[c]);
+}
diff --git a/src/walk-npcs.js b/src/walk-npcs.js
index 842ca4f83..9c3a573dd 100644
--- a/src/walk-npcs.js
+++ b/src/walk-npcs.js
@@ -21,11 +21,12 @@
// GLB, mixer, material, and DOM node an NPC creates is released on despawn so
// swapping worlds never leaks geometry or audio.
-import { Box3, Group, Vector3 } from 'three';
+import { Box3, Group, Quaternion, Vector3 } from 'three';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { getMeshoptDecoder } from './viewer/internal.js';
import { clone as cloneSkinnedScene } from 'three/addons/utils/SkeletonUtils.js';
import { AnimationManager } from './animation-manager.js';
+import { LookAtController } from './procedural/look-at.js';
import { log } from './shared/log.js';
// ── Clip names (must exist in /animations/clips + the manifest) ────────────
@@ -42,6 +43,16 @@ const NPC_TURN_LERP = 0.14; // facing smoothing toward heading
const GREET_RANGE = 4.0; // m — player enters → greeter waves + speaks
const GREET_RELEASE = 6.0; // m — hysteresis so the greeting doesn't retrigger on the edge
const GREET_COOLDOWN = 9.0; // s — minimum gap between a greeter's greetings
+
+// m — an NPC turns its head toward the player inside this radius. Deliberately
+// wider than GREET_RANGE: noticing someone is what a person does long before
+// they greet them, and it is the cheapest signal that the world is inhabited
+// rather than populated by props on rails. The gaze layer clamps and fades
+// itself, so a player behind an NPC releases the head rather than pinning it.
+const GAZE_RANGE = 14.0;
+// m — approximate eye height above the player rig's feet, so NPCs meet the
+// player's gaze instead of staring at their shoes.
+const PLAYER_EYE_HEIGHT = 1.5;
const WANDER_PAUSE = [1.8, 4.5]; // s — idle dwell range between wander legs
const WANDER_RADIUS = 8.5; // m — keep wander waypoints inside the walkable disc
const ARRIVE_DIST = 0.55; // m — "reached the waypoint" threshold
@@ -136,6 +147,8 @@ class NPC {
deps.scene.add(this.rig);
this._body = null; // cloned skinned scene
+ this._gaze = null; // LookAtController, or null when the rig has no head chain
+ this._gazeTarget = new Vector3(); // scratch for the player's eye position
this._anim = new AnimationManager();
this._ready = false;
this._disposed = false;
@@ -204,6 +217,13 @@ class NPC {
this._anim.setAnimationDefs(this.deps.animationDefs);
this._supportsClips = this._anim.supportsCanonicalClips();
+ // Head tracking (src/procedural/look-at.js): NPCs notice the player and
+ // follow them with their eyes, on top of whatever clip is playing — so a
+ // wanderer can glance over without breaking stride. Null on a rig with no
+ // mappable head, which makes the per-frame call below a no-op.
+ const gaze = new LookAtController(body);
+ this._gaze = gaze.enabled ? gaze : null;
+
try {
await this._anim.loadAll();
if (this._disposed) return;
@@ -220,6 +240,26 @@ class NPC {
this._ready = true;
}
+ /**
+ * Track the player with the head/neck/chest chain while they are close
+ * enough to notice. Runs after `_anim.update()` (the mixer tick) as every
+ * procedural layer must, so the gaze layers over the current clip instead of
+ * being overwritten by it.
+ * @param {number} dt seconds
+ * @param {Vector3} playerPos player rig position (at their feet)
+ * @param {number} dist metres from this NPC to the player
+ */
+ _updateGaze(dt, playerPos, dist) {
+ if (!this._gaze) return;
+ if (dist <= GAZE_RANGE) {
+ this._gazeTarget.set(playerPos.x, playerPos.y + PLAYER_EYE_HEIGHT, playerPos.z);
+ this._gaze.setTarget(this._gazeTarget);
+ } else {
+ this._gaze.setTarget(null);
+ }
+ this._gaze.update(dt);
+ }
+
// ── State entries ────────────────────────────────────────────────────────
_enterStation() {
this.state = 'station';
@@ -291,6 +331,7 @@ class NPC {
const playerPos = ctx.playerPos;
const distToPlayer = this.rig.position.distanceTo(playerPos);
+ this._updateGaze(dt, playerPos, distToPlayer);
switch (this.type) {
case 'greeter':
@@ -666,6 +707,9 @@ class NPC {
} catch (e) {
log.warn('[walk-npcs] anim dispose failed:', e);
}
+ // Drop the gaze layer before the body: it holds bone references into the
+ // scene graph we are about to dispose.
+ this._gaze = null;
if (this._body) {
disposeObject3D(this._body);
this.rig.remove(this._body);
@@ -827,5 +871,45 @@ export function createWalkNpcs(opts) {
return out;
}
- return { spawn, despawn, update, setEnabled, isEnabled, setTtsEnabled, count, positions };
+ /**
+ * How well each NPC's head is aimed at a world point, for instrumentation.
+ * `alignment` is the cosine between the head's world forward and the
+ * direction to `target`: 1 is dead-on, 0 is side-on. Allocates, so this is
+ * for probes and tests, never the render loop.
+ * @param {Vector3} target world point to measure against (normally the player)
+ * @returns {Array<{name: string, dist: number, alignment: number|null}>}
+ */
+ function gazeReport(target) {
+ const fwd = new Vector3();
+ const toTarget = new Vector3();
+ const q = new Quaternion();
+ const out = [];
+ for (const n of npcs) {
+ if (n._disposed) continue;
+ const dist = n.rig.position.distanceTo(target);
+ const head = n._gaze ? n._gaze.headBone : null;
+ let alignment = null;
+ if (head) {
+ head.updateWorldMatrix(true, false);
+ head.getWorldQuaternion(q);
+ fwd.set(0, 0, 1).applyQuaternion(q).normalize();
+ toTarget.copy(target).sub(head.getWorldPosition(new Vector3())).normalize();
+ alignment = fwd.dot(toTarget);
+ }
+ out.push({ name: n.name, dist: +dist.toFixed(2), alignment: alignment == null ? null : +alignment.toFixed(3) });
+ }
+ return out;
+ }
+
+ return {
+ spawn,
+ despawn,
+ update,
+ setEnabled,
+ isEnabled,
+ setTtsEnabled,
+ count,
+ positions,
+ gazeReport,
+ };
}
diff --git a/src/walk.js b/src/walk.js
index e3473d906..0cc20ca25 100644
--- a/src/walk.js
+++ b/src/walk.js
@@ -4733,6 +4733,11 @@ if (import.meta.env?.DEV) {
feet,
};
};
+
+ // NPC head tracking: how squarely each NPC is looking at the player.
+ // alignment 1 = dead-on, 0 = side-on, null = rig has no head chain.
+ window.__walkNpcGaze = () =>
+ walkNpcs ? walkNpcs.gazeReport(avatarRig.position) : { active: false };
}
// ── Avatar picker ────────────────────────────────────────────────────────
diff --git a/tests/animation-retarget.test.js b/tests/animation-retarget.test.js
index ee2295c44..d6d03583a 100644
--- a/tests/animation-retarget.test.js
+++ b/tests/animation-retarget.test.js
@@ -618,6 +618,146 @@ describe('world-delta correctness — limb retarget preserves world motion', ()
});
});
+// ---------------------------------------------------------------------------
+// The dignity floor: a rig from any supported naming convention must clear
+// MIN_COVERAGE against the REAL shipped clips, with both arms and both legs
+// bound. This is the invariant scripts/animation-dignity-sweep.mjs measures in
+// full (it also checks that the bones actually rotate and that the hands and
+// feet travel through world space); the case below is the cheap CI half of it.
+//
+// Why coverage is the sharp edge: 30 of a clip's 53 tracks address finger bones.
+// A convention whose hands don't name-map scores about 40%, falls under the gate,
+// and `retargetClip` returns a NULL clip — production then builds no action at
+// all and the avatar stands frozen in its bind pose. Every convention here was
+// measured doing exactly that before the finger aliases landed in
+// src/glb-canonicalize.js, and nothing in the suite noticed, because every other
+// test either passes `minCoverage: 0` or uses a synthetic 5-bone rig.
+// ---------------------------------------------------------------------------
+describe('rig-convention coverage floor (real clips)', () => {
+ const REPO2 = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
+ const realClip = (name) => {
+ const clip = AnimationClip.parse(
+ JSON.parse(fs.readFileSync(path.join(REPO2, 'public/animations/clips', `${name}.json`), 'utf8')),
+ );
+ clip.name = name;
+ return clip;
+ };
+
+ const FINGER_STEMS = ['Thumb', 'Index', 'Middle', 'Ring', 'Pinky'];
+
+ // Each entry spells the same humanoid skeleton the way that tool exports it.
+ // `body` is given left-side-first; right twins are derived by the swap fn.
+ const CONVENTIONS = {
+ 'Unreal mannequin': {
+ centre: ['pelvis', 'spine_01', 'spine_02', 'spine_03', 'neck_01', 'head'],
+ limb: (s) => [
+ `clavicle_${s}`, `upperarm_${s}`, `lowerarm_${s}`, `hand_${s}`,
+ `thigh_${s}`, `calf_${s}`, `foot_${s}`, `ball_${s}`,
+ ],
+ finger: (s, f, n) => `${f.toLowerCase()}_0${n}_${s}`,
+ sides: ['l', 'r'],
+ },
+ 'VRM 1.0': {
+ centre: ['hips', 'spine', 'chest', 'upperChest', 'neck', 'head'],
+ limb: (s) => [
+ `${s}Shoulder`, `${s}UpperArm`, `${s}LowerArm`, `${s}Hand`,
+ `${s}UpperLeg`, `${s}LowerLeg`, `${s}Foot`, `${s}Toes`,
+ ],
+ finger: (s, f, n) => {
+ const vf = f === 'Pinky' ? 'Little' : f;
+ const phalanx =
+ f === 'Thumb'
+ ? ['Metacarpal', 'Proximal', 'Distal'][n - 1]
+ : ['Proximal', 'Intermediate', 'Distal'][n - 1];
+ return `${s}${vf}${phalanx}`;
+ },
+ sides: ['left', 'right'],
+ },
+ 'Daz / Genesis 8': {
+ centre: ['hip', 'abdomenLower', 'abdomenUpper', 'chestUpper', 'neckLower', 'head'],
+ limb: (s) => [
+ `${s}Collar`, `${s}ShldrBend`, `${s}ForearmBend`, `${s}Hand`,
+ `${s}ThighBend`, `${s}Shin`, `${s}Foot`, `${s}Toe`,
+ ],
+ finger: (s, f, n) => `${s}${f === 'Middle' ? 'Mid' : f}${n}`,
+ sides: ['l', 'r'],
+ },
+ MakeHuman: {
+ centre: ['pelvis', 'spine', 'chest', 'neck', 'head'],
+ limb: (s) => [
+ `clavicle.${s}`, `upperarm.${s}`, `forearm.${s}`, `hand.${s}`,
+ `thigh.${s}`, `shin.${s}`, `foot.${s}`, `toe.${s}`,
+ ],
+ finger: (s, f, n) => `finger${FINGER_STEMS.indexOf(f) + 1}-${n}.${s}`,
+ sides: ['L', 'R'],
+ },
+ 'Blender Rigify': {
+ centre: ['hips', 'spine', 'chest', 'neck', 'head'],
+ limb: (s) => [
+ `shoulder.${s}`, `upper_arm.${s}`, `forearm.${s}`, `hand.${s}`,
+ `thigh.${s}`, `shin.${s}`, `foot.${s}`, `toe.${s}`,
+ ],
+ finger: (s, f, n) =>
+ f === 'Thumb' ? `thumb.0${n}.${s}` : `f_${f.toLowerCase()}.0${n}.${s}`,
+ sides: ['L', 'R'],
+ },
+ 'anatomical Latin': {
+ centre: ['pelvis', 'lumbar', 'thoracic', 'sternum', 'cervical', 'cranium'],
+ limb: (s) => [
+ `scapula.${s}`, `humerus.${s}`, `ulna.${s}`, `carpus.${s}`,
+ `femur.${s}`, `tibia.${s}`, `talus.${s}`, `metatarsus.${s}`,
+ ],
+ finger: (s, f, n) => {
+ const af = f === 'Pinky' ? 'little' : f.toLowerCase();
+ const phalanx =
+ f === 'Thumb'
+ ? ['metacarpal', 'proximal', 'distal'][n - 1]
+ : ['proximal', 'intermediate', 'distal'][n - 1];
+ return `${af}_${phalanx}.${s}`;
+ },
+ sides: ['L', 'R'],
+ },
+ };
+
+ function boneNames(spec) {
+ const names = [...spec.centre];
+ for (const side of spec.sides) {
+ names.push(...spec.limb(side));
+ for (const f of FINGER_STEMS) {
+ for (let n = 1; n <= 3; n++) names.push(spec.finger(side, f, n));
+ }
+ }
+ return names;
+ }
+
+ describe.each(Object.entries(CONVENTIONS))('%s', (label, spec) => {
+ const rig = makeRig(boneNames(spec));
+ const map = canonicalNodeMapFromObject(rig);
+
+ it.each(['idle', 'walk'])('clears the MIN_COVERAGE gate on %s', (clipName) => {
+ // Default minCoverage on purpose: this asserts what PRODUCTION does, not
+ // what a permissive test harness would allow.
+ const r = retargetClipToObject(realClip(clipName), rig);
+ expect(r.clip, `${label} produced no clip on ${clipName}`).not.toBeNull();
+ expect(r.coverage).toBeGreaterThanOrEqual(MIN_COVERAGE);
+ });
+
+ it('binds both arms and both legs', () => {
+ for (const bone of [
+ 'LeftArm', 'LeftForeArm', 'RightArm', 'RightForeArm',
+ 'LeftUpLeg', 'LeftLeg', 'RightUpLeg', 'RightLeg',
+ ]) {
+ expect(map.get(bone), `${label} lost ${bone}`).toBeTruthy();
+ }
+ });
+
+ it('maps all 30 finger joints', () => {
+ const fingers = [...map.keys()].filter((k) => /Hand(Thumb|Index|Middle|Ring|Pinky)[123]$/.test(k));
+ expect(fingers.length, `${label} mapped only ${fingers.length} finger joints`).toBe(30);
+ });
+ });
+});
+
describe('face (morph target) lanes', () => {
/** A rig with two meshes that share some blendshapes and differ on others. */
function faceRig() {
diff --git a/tests/api/coin-news-gate.test.js b/tests/api/coin-news-gate.test.js
new file mode 100644
index 000000000..d1553b414
--- /dev/null
+++ b/tests/api/coin-news-gate.test.js
@@ -0,0 +1,81 @@
+// /api/coin/news: the related-news rail must not throw away articles it holds.
+//
+// The endpoint gated its 502 on `sources_ok` — publishers whose LAST refresh
+// succeeded. That is a different question from "do we have anything to show":
+// the aggregator also serves recent-but-not-just-refreshed copies, so a rail
+// holding eight real articles could report zero ok sources and 502, discarding
+// them and rendering the page's error state over live content. These tests pin
+// the corrected gate: articles win, and only an empty-handed fan-out is an
+// outage.
+
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+
+vi.mock('../../api/_lib/zauth.js', () => ({ instrument: () => {}, drain: async () => {} }));
+vi.mock('../../api/_lib/sentry.js', () => ({ captureException: () => {} }));
+vi.mock('../../api/_lib/rate-limit.js', () => ({
+ limits: { marketDataIp: async () => ({ success: true }) },
+ clientIp: () => '203.0.113.1',
+}));
+
+const searchNews = vi.fn();
+vi.mock('../../api/_lib/news.js', () => ({ searchNews: (...a) => searchNews(...a) }));
+
+const news = (await import('../../api/coin/news.js')).default;
+
+const article = (title) => ({
+ id: `id-${title}`,
+ title,
+ link: 'https://example.com/a',
+ description: 'desc',
+ image: null,
+ source: 'Publisher',
+ pub_date: '2026-07-29T00:00:00Z',
+});
+
+function makeRes() {
+ return {
+ statusCode: 200,
+ _h: {},
+ setHeader(k, v) { this._h[k.toLowerCase()] = v; },
+ getHeader(k) { return this._h[k.toLowerCase()]; },
+ end(body) { this._body = body; },
+ };
+}
+async function call(query) {
+ const res = makeRes();
+ await news({ url: `/api/coin/news?${query}`, method: 'GET', headers: {} }, res);
+ return { res, body: JSON.parse(res._body) };
+}
+
+describe('/api/coin/news outage gate', () => {
+ beforeEach(() => searchNews.mockReset());
+
+ it('serves articles held from a stale-but-usable cache, even with zero ok sources', async () => {
+ searchNews.mockResolvedValue({ articles: [article('One'), article('Two')], total: 2, sources_ok: 0, sources_total: 158 });
+ const { res, body } = await call('q=Solana&limit=8');
+ expect(res.statusCode).toBe(200);
+ expect(body.articles).toHaveLength(2);
+ expect(body.articles[0].published_at).toBe('2026-07-29T00:00:00Z');
+ });
+
+ it('answers 200 with an empty rail when publishers are healthy but nothing matches', async () => {
+ searchNews.mockResolvedValue({ articles: [], total: 0, sources_ok: 40, sources_total: 158 });
+ const { res, body } = await call('q=SomeUnknownCoin&limit=8');
+ expect(res.statusCode).toBe(200);
+ expect(body.articles).toEqual([]);
+ });
+
+ it('still reports a genuinely empty-handed fan-out as an outage', async () => {
+ searchNews.mockResolvedValue({ articles: [], total: 0, sources_ok: 0, sources_total: 158 });
+ const { res, body } = await call('q=Solana&limit=8');
+ expect(res.statusCode).toBe(502);
+ expect(body.error).toBe('upstream_error');
+ });
+
+ it('still rejects a missing query', async () => {
+ const { res, body } = await call('limit=8');
+ expect(res.statusCode).toBe(400);
+ expect(body.error).toBe('bad_query');
+ expect(searchNews).not.toHaveBeenCalled();
+ });
+});
diff --git a/tests/browser-bundle-node-imports.test.js b/tests/browser-bundle-node-imports.test.js
new file mode 100644
index 000000000..ee9342dfd
--- /dev/null
+++ b/tests/browser-bundle-node-imports.test.js
@@ -0,0 +1,136 @@
+/**
+ * No STATIC `node:` builtin import may be reachable from a browser entry point.
+ *
+ * Why this exists
+ * ---------------
+ * `api/_lib/*` is server code by intent, but parts of it are legitimately
+ * reachable from the browser bundle: the isomorphic SNS resolver imports the
+ * shared Solana connection, which imports the shared cache.
+ *
+ * pages/app.html → src/app.js → src/agent-skills-scene.js → src/agent-skills.js
+ * → src/agent-skills-pumpfun.js → src/solana/sns.js
+ * → api/_lib/solana/connection.js → api/_lib/cache.js
+ *
+ * On 2026-07-29 a gzip wire codec landed in `api/_lib/cache.js` with a static
+ * `import { promisify } from 'node:util'`. Vite externalizes `node:*` for the
+ * browser, so that named binding resolves against `__vite-browser-external`,
+ * which exports nothing — and the ENTIRE frontend build died with
+ * `"promisify" is not exported by "__vite-browser-external"`.
+ *
+ * Nothing caught it. The browser never reaches the codec at RUNTIME, so no test
+ * exercised it; only the bundler sees it, at parse time. The failure therefore
+ * surfaced during a production deploy, after `build:gcp` had already wiped
+ * `dist/` — the most expensive possible moment.
+ *
+ * The fix is always the same: load the builtin lazily (`await import('node:…')`)
+ * inside the function that needs it. That keeps the module graph browser-safe
+ * and leaves the server path unchanged.
+ *
+ * This walks the real import graph offline — no network, no bundler, no flake.
+ */
+
+import { describe, it, expect } from 'vitest';
+import { readFileSync, existsSync } from 'node:fs';
+import { resolve, dirname, join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+
+// Browser entry points. Anything reachable from here is bundled by Vite.
+const ENTRIES = [
+ 'src/app.js',
+ 'src/agent-skills.js',
+ 'src/i18n.js',
+ 'src/notifications.js',
+ 'src/footer-bot.js',
+ 'src/walk-companion.js',
+ 'src/feature-tour.js',
+];
+
+// Static `import ... from 'x'` / `export ... from 'x'` only. A bare
+// `import('x')` is deliberately NOT matched: a dynamic import is exactly the
+// approved escape hatch, since the bundler emits it as a separate chunk that
+// the browser never has to resolve.
+const STATIC_IMPORT = /(?:^|\n)\s*(?:import|export)(?:["'\s]*[\w*{}\n\r\t, $]+from\s*)?\s*['"]([^'"]+)['"]/g;
+
+function resolveSpec(fromFile, spec) {
+ if (!spec.startsWith('.') && !spec.startsWith('/')) return null; // bare pkg
+ const base = spec.startsWith('/') ? join(ROOT, spec.slice(1)) : resolve(dirname(fromFile), spec);
+ for (const cand of [base, `${base}.js`, join(base, 'index.js')]) {
+ if (existsSync(cand)) return cand;
+ }
+ return null;
+}
+
+/** Walk the static graph from `entries`, returning file → shortest chain from an entry. */
+function reachable(entries) {
+ const chains = new Map();
+ const queue = [];
+ for (const e of entries) {
+ const abs = join(ROOT, e);
+ if (!existsSync(abs)) continue;
+ chains.set(abs, [e]);
+ queue.push(abs);
+ }
+ while (queue.length) {
+ const file = queue.shift();
+ let src;
+ try {
+ src = readFileSync(file, 'utf8');
+ } catch {
+ continue;
+ }
+ for (const m of src.matchAll(STATIC_IMPORT)) {
+ const target = resolveSpec(file, m[1]);
+ if (!target || chains.has(target)) continue;
+ chains.set(target, [...chains.get(file), target.replace(`${ROOT}/`, '')]);
+ queue.push(target);
+ }
+ }
+ return chains;
+}
+
+/** Node builtins imported STATICALLY by a file, with the specifier as written. */
+function staticNodeImports(file) {
+ let src;
+ try {
+ src = readFileSync(file, 'utf8');
+ } catch {
+ return [];
+ }
+ return [...src.matchAll(STATIC_IMPORT)]
+ .map((m) => m[1])
+ .filter((spec) => spec.startsWith('node:'));
+}
+
+describe('browser bundle: no static node: builtin imports', () => {
+ const graph = reachable(ENTRIES);
+
+ it('reaches a meaningful slice of the codebase (guards the walker itself)', () => {
+ // If the walker silently stopped resolving, every other assertion here
+ // would pass vacuously. The real graph is thousands of files.
+ expect(graph.size).toBeGreaterThan(200);
+ });
+
+ it('resolves multi-hop transitive imports, not just direct ones', () => {
+ // The leak was four hops deep. If the walker only ever resolved an
+ // entry's direct imports, the assertion below would pass vacuously and
+ // the guard would be worthless. agent-skills.js -> agent-skills-pumpfun.js
+ // is a plain static edge two hops from an entry.
+ expect(graph.has(join(ROOT, 'src/agent-skills-pumpfun.js'))).toBe(true);
+ });
+
+ it('has no browser-reachable file statically importing a node: builtin', () => {
+ const offenders = [];
+ for (const [file, chain] of graph) {
+ const builtins = staticNodeImports(file);
+ if (!builtins.length) continue;
+ offenders.push(
+ `${file.replace(`${ROOT}/`, '')} statically imports ${builtins.join(', ')}\n` +
+ ` reached via: ${chain.join(' -> ')}\n` +
+ ` fix: load it lazily inside the function that needs it — await import('${builtins[0]}')`,
+ );
+ }
+ expect(offenders, `\n\n${offenders.join('\n\n')}\n`).toEqual([]);
+ });
+});
diff --git a/tests/build-limits.test.js b/tests/build-limits.test.js
new file mode 100644
index 000000000..03319c644
--- /dev/null
+++ b/tests/build-limits.test.js
@@ -0,0 +1,99 @@
+// P3.2 / P3.3 — the shared build limits both the authoritative room and the /play
+// client import. These numbers used to live in two places (the server held the
+// only real clear radius; the client defaulted a bare 12 in four spots), so these
+// tests lock the single source of truth and the tier progression it encodes.
+
+import { describe, it, expect, afterEach } from 'vitest';
+import {
+ buildClearRadius, buildTierLabel, normalizePropAssetUrl,
+ BUILD_CLEAR_RADIUS_BASE, BUILD_CLEAR_RADIUS_HOLDER, BUILD_CLEAR_RADIUS_CREATOR,
+ BUILD_CLEAR_RADIUS_MAX, MAX_WORLD_OBJECTS, MAX_OBJECTS_PER_PLAYER,
+ PROP_ASSET_URL_MAX,
+} from '../multiplayer/src/build-limits.js';
+
+describe('build radius progression (P3.2)', () => {
+ it('gives a plain visitor the base radius', () => {
+ expect(buildClearRadius()).toBe(BUILD_CLEAR_RADIUS_BASE);
+ expect(buildClearRadius({})).toBe(BUILD_CLEAR_RADIUS_BASE);
+ expect(buildClearRadius({ creator: false, holder: false })).toBe(BUILD_CLEAR_RADIUS_BASE);
+ });
+
+ it('widens inside a coin holders-tier world', () => {
+ expect(buildClearRadius({ holder: true })).toBe(BUILD_CLEAR_RADIUS_HOLDER);
+ expect(BUILD_CLEAR_RADIUS_HOLDER).toBeGreaterThan(BUILD_CLEAR_RADIUS_BASE);
+ });
+
+ it('widens furthest for the coin creator', () => {
+ expect(buildClearRadius({ creator: true })).toBe(BUILD_CLEAR_RADIUS_CREATOR);
+ expect(BUILD_CLEAR_RADIUS_CREATOR).toBeGreaterThan(BUILD_CLEAR_RADIUS_HOLDER);
+ });
+
+ it('takes the max of the tiers rather than compounding them', () => {
+ expect(buildClearRadius({ creator: true, holder: true })).toBe(BUILD_CLEAR_RADIUS_CREATOR);
+ });
+
+ it('never exceeds the absolute ceiling', () => {
+ for (const standing of [{}, { holder: true }, { creator: true }, { creator: true, holder: true }]) {
+ expect(buildClearRadius(standing)).toBeLessThanOrEqual(BUILD_CLEAR_RADIUS_MAX);
+ }
+ });
+
+ it('labels the tier it granted', () => {
+ expect(buildTierLabel({})).toBe('visitor');
+ expect(buildTierLabel({ holder: true })).toBe('holder');
+ expect(buildTierLabel({ creator: true, holder: true })).toBe('creator');
+ });
+
+ it('keeps the object budget bounded and per-player smaller than per-world', () => {
+ expect(MAX_OBJECTS_PER_PLAYER).toBeLessThan(MAX_WORLD_OBJECTS);
+ });
+});
+
+describe('prop asset url allow-list (P3.3)', () => {
+ afterEach(() => { delete process.env.WORLD_ASSET_HOSTS; });
+
+ it('accepts a model on our own storage', () => {
+ expect(normalizePropAssetUrl('https://pub-test.r2.dev/u/anon/avatar/abc.glb'))
+ .toBe('https://pub-test.r2.dev/u/anon/avatar/abc.glb');
+ expect(normalizePropAssetUrl('https://three.ws/models/thing.vrm'))
+ .toBe('https://three.ws/models/thing.vrm');
+ });
+
+ it('strips query and hash so a signed url never gets persisted', () => {
+ expect(normalizePropAssetUrl('https://pub-test.r2.dev/a.glb?sig=deadbeef#frag'))
+ .toBe('https://pub-test.r2.dev/a.glb');
+ });
+
+ it('refuses a third-party host', () => {
+ expect(normalizePropAssetUrl('https://evil.example.com/a.glb')).toBeNull();
+ });
+
+ it('refuses non-https schemes, including javascript: and data:', () => {
+ expect(normalizePropAssetUrl('http://three.ws/a.glb')).toBeNull();
+ expect(normalizePropAssetUrl('javascript:alert(1)//a.glb')).toBeNull();
+ expect(normalizePropAssetUrl('data:model/gltf-binary;base64,AAAA')).toBeNull();
+ });
+
+ it('refuses credentials embedded in the url', () => {
+ expect(normalizePropAssetUrl('https://user:[email protected]/a.glb')).toBeNull();
+ });
+
+ it('refuses a non-model path', () => {
+ expect(normalizePropAssetUrl('https://three.ws/a.js')).toBeNull();
+ expect(normalizePropAssetUrl('https://three.ws/a.glb.exe')).toBeNull();
+ });
+
+ it('refuses junk, empties and over-long strings', () => {
+ expect(normalizePropAssetUrl('')).toBeNull();
+ expect(normalizePropAssetUrl(null)).toBeNull();
+ expect(normalizePropAssetUrl(12)).toBeNull();
+ expect(normalizePropAssetUrl('not a url')).toBeNull();
+ expect(normalizePropAssetUrl(`https://three.ws/${'a'.repeat(PROP_ASSET_URL_MAX)}.glb`)).toBeNull();
+ });
+
+ it('honours a configured host allow-list over the defaults', () => {
+ process.env.WORLD_ASSET_HOSTS = 'assets.internal';
+ expect(normalizePropAssetUrl('https://assets.internal/a.glb')).toBe('https://assets.internal/a.glb');
+ expect(normalizePropAssetUrl('https://three.ws/a.glb')).toBeNull();
+ });
+});
diff --git a/tests/coinpaprika-budget.test.js b/tests/coinpaprika-budget.test.js
new file mode 100644
index 000000000..8c225f452
--- /dev/null
+++ b/tests/coinpaprika-budget.test.js
@@ -0,0 +1,101 @@
+/**
+ * Shared CoinPaprika client — free-tier budget guard.
+ *
+ * CoinPaprika's free tier allows SIXTY requests per hour and then blocks the
+ * client for an hour with `402 payment_required`. Three surfaces draw on that
+ * one budget — the coin-page profile/listings fallback, the global-stats
+ * fallback, and the paid x402 market-heatmap endpoint — so the health state has
+ * to be process-wide, exactly like the CoinGecko demo-key health next to it.
+ *
+ * These tests pin the two properties that matter: a spent budget is recognised
+ * however it is reported, and once recognised it costs zero further requests
+ * anywhere until the block lifts. An ordinary network fault must NOT bench the
+ * source, or one blip would take the fallback out for an hour.
+ */
+
+import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
+import {
+ PAPRIKA_BASE,
+ paprikaGet,
+ isPaprikaBenched,
+ benchPaprika,
+ notePaprikaStatus,
+ resetPaprikaHealth,
+} from '../api/_lib/coinpaprika.js';
+
+const URL_A = `${PAPRIKA_BASE}/global`;
+const jsonResponse = (body, status = 200) =>
+ new Response(JSON.stringify(body), { status, headers: { 'content-type': 'application/json' } });
+
+beforeEach(() => resetPaprikaHealth());
+afterEach(() => {
+ vi.unstubAllGlobals();
+ resetPaprikaHealth();
+});
+
+describe('budget detection', () => {
+ it('benches on a 402 and stops issuing requests', async () => {
+ const fetchMock = vi.fn(async () =>
+ jsonResponse({ type: 'payment_required', error: 'request limits were reached' }, 402),
+ );
+ vi.stubGlobal('fetch', fetchMock);
+ expect(await paprikaGet(URL_A)).toBeNull();
+ expect(isPaprikaBenched()).toBe(true);
+ expect(await paprikaGet(URL_A)).toBeNull();
+ expect(await paprikaGet(`${PAPRIKA_BASE}/tickers/btc-bitcoin`)).toBeNull();
+ expect(fetchMock).toHaveBeenCalledTimes(1);
+ });
+
+ it('benches on a 429 too', async () => {
+ vi.stubGlobal('fetch', vi.fn(async () => jsonResponse({ error: 'too many requests' }, 429)));
+ await paprikaGet(URL_A);
+ expect(isPaprikaBenched()).toBe(true);
+ });
+
+ it('recognises the budget reply by its body even on a 200', async () => {
+ vi.stubGlobal('fetch', vi.fn(async () => jsonResponse({ type: 'payment_required' })));
+ expect(await paprikaGet(URL_A)).toBeNull();
+ expect(isPaprikaBenched()).toBe(true);
+ });
+
+ it('notePaprikaStatus reports whether it acted, for callers that fetch themselves', () => {
+ expect(notePaprikaStatus(200)).toBe(false);
+ expect(isPaprikaBenched()).toBe(false);
+ expect(notePaprikaStatus(402)).toBe(true);
+ expect(isPaprikaBenched()).toBe(true);
+ });
+});
+
+describe('what must NOT bench the source', () => {
+ it('a network fault is a miss, not a spent budget', async () => {
+ vi.stubGlobal('fetch', vi.fn(async () => { throw new Error('ECONNRESET'); }));
+ expect(await paprikaGet(URL_A)).toBeNull();
+ expect(isPaprikaBenched()).toBe(false);
+ });
+
+ it('a 404 or 500 is a miss, not a spent budget', async () => {
+ vi.stubGlobal('fetch', vi.fn(async () => jsonResponse({ error: 'nope' }, 500)));
+ expect(await paprikaGet(URL_A)).toBeNull();
+ expect(isPaprikaBenched()).toBe(false);
+ });
+
+ it('malformed JSON is a miss, and never throws at the caller', async () => {
+ vi.stubGlobal('fetch', vi.fn(async () => new Response('<html>nope</html>', { status: 200 })));
+ await expect(paprikaGet(URL_A)).resolves.toBeNull();
+ expect(isPaprikaBenched()).toBe(false);
+ });
+});
+
+describe('recovery', () => {
+ it('the bench expires so a fresh hour heals with no redeploy', () => {
+ const now = Date.now();
+ benchPaprika(now);
+ expect(isPaprikaBenched(now + 59 * 60_000)).toBe(true);
+ expect(isPaprikaBenched(now + 61 * 60_000)).toBe(false);
+ });
+
+ it('serves a normal body once the block has lifted', async () => {
+ vi.stubGlobal('fetch', vi.fn(async () => jsonResponse({ market_cap_usd: 123 })));
+ expect(await paprikaGet(URL_A)).toEqual({ market_cap_usd: 123 });
+ });
+});
diff --git a/tests/erc8004-metadata-proxy.test.js b/tests/erc8004-metadata-proxy.test.js
new file mode 100644
index 000000000..b3d51fa5d
--- /dev/null
+++ b/tests/erc8004-metadata-proxy.test.js
@@ -0,0 +1,188 @@
+// GET /api/erc8004/metadata: the registration-JSON proxy.
+//
+// An ERC-8004 agent's registration JSON is hosted wherever its registrant put
+// it, and most of those hosts send no Access-Control-Allow-Origin, so the
+// browser could not read them: every such agent page rendered "Could not fetch
+// registration JSON: Failed to fetch". The server has no same-origin policy, so
+// this endpoint fetches it instead.
+//
+// The URI is attacker-influenced (it comes off-chain from whoever registered the
+// agent), which makes this endpoint a classic SSRF sink. These tests pin the two
+// properties that matter: it fetches ONLY through the platform pinned guard
+// (never a raw fetch that would follow redirects into an internal address), and
+// every failure mode answers with a designed status instead of leaking or 500ing.
+
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+
+const pinned = vi.fn();
+
+vi.mock('../api/_lib/ssrf-guard.js', async (importOriginal) => {
+ const actual = await importOriginal();
+ return {
+ ...actual,
+ fetchSafePublicUrlPinned: (...args) => pinned(...args),
+ };
+});
+
+vi.mock('../api/_lib/rate-limit.js', async (importOriginal) => {
+ const actual = await importOriginal();
+ return {
+ ...actual,
+ clientIp: () => '203.0.113.9',
+ limits: { ...actual.limits, pumpMetaIp: async () => ({ success: true }) },
+ };
+});
+
+const { SsrfBlockedError, MaxBytesExceededError } = await import('../api/_lib/ssrf-guard.js');
+const handler = (await import('../api/erc8004/[action].js')).default;
+
+function makeReq(query) {
+ return { method: 'GET', url: '/api/erc8004/metadata', headers: {}, query };
+}
+
+function makeRes() {
+ const res = {
+ statusCode: 200,
+ headers: {},
+ body: null,
+ setHeader(k, v) {
+ this.headers[k.toLowerCase()] = v;
+ },
+ getHeader(k) {
+ return this.headers[k.toLowerCase()];
+ },
+ removeHeader(k) {
+ delete this.headers[k.toLowerCase()];
+ },
+ writeHead(code) {
+ this.statusCode = code;
+ return this;
+ },
+ end(payload) {
+ if (payload !== undefined && this.body === null) this.body = payload;
+ this.finished = true;
+ return this;
+ },
+ };
+ return res;
+}
+
+async function call(query) {
+ const res = makeRes();
+ await handler(makeReq({ action: 'metadata', ...query }), res);
+ let parsed = null;
+ try {
+ parsed = typeof res.body === 'string' ? JSON.parse(res.body) : res.body;
+ } catch {
+ parsed = res.body;
+ }
+ return { status: res.statusCode, body: parsed, headers: res.headers };
+}
+
+beforeEach(() => {
+ pinned.mockReset();
+});
+
+describe('GET /api/erc8004/metadata', () => {
+ it('returns the registration JSON a CORS-blocked host would not give the browser', async () => {
+ const doc = { type: 'https://eips.ethereum.org/EIPS/eip-8004#registration-v1', name: 'Agent' };
+ pinned.mockResolvedValue({ ok: true, status: 200, text: async () => JSON.stringify(doc) });
+
+ const { status, body } = await call({ uri: 'https://registry.example/agent/1' });
+
+ expect(status).toBe(200);
+ expect(body.data).toEqual(doc);
+ expect(body.resolvedUrl).toBe('https://registry.example/agent/1');
+ });
+
+ it('fetches only through the pinned SSRF guard, with a byte ceiling', async () => {
+ pinned.mockResolvedValue({ ok: true, status: 200, text: async () => '{}' });
+
+ await call({ uri: 'https://registry.example/agent/1' });
+
+ expect(pinned).toHaveBeenCalledTimes(1);
+ const [url, , opts] = pinned.mock.calls[0];
+ expect(url).toBe('https://registry.example/agent/1');
+ expect(opts.maxBytes).toBe(2 * 1024 * 1024);
+ });
+
+ it('resolves ipfs:// and ar:// to their public gateways before fetching', async () => {
+ pinned.mockResolvedValue({ ok: true, status: 200, text: async () => '{}' });
+
+ await call({ uri: 'ipfs://bafyagent' });
+ expect(pinned.mock.calls[0][0]).toBe('https://ipfs.io/ipfs/bafyagent');
+
+ pinned.mockClear();
+ await call({ uri: 'ar://txid123' });
+ expect(pinned.mock.calls[0][0]).toBe('https://arweave.net/txid123');
+ });
+
+ it('rejects a missing uri', async () => {
+ const { status, body } = await call({});
+ expect(status).toBe(400);
+ expect(body.error).toBe('bad_request');
+ expect(pinned).not.toHaveBeenCalled();
+ });
+
+ it('rejects a non-http scheme without ever fetching', async () => {
+ const { status, body } = await call({ uri: 'file:///etc/passwd' });
+ expect(status).toBe(400);
+ expect(body.error).toBe('bad_request');
+ expect(pinned).not.toHaveBeenCalled();
+ });
+
+ it('answers 400 blocked_uri when the guard refuses an internal address', async () => {
+ pinned.mockRejectedValue(new SsrfBlockedError('blocked private address'));
+
+ const { status, body } = await call({ uri: 'http://169.254.169.254/latest/meta-data/' });
+
+ expect(status).toBe(400);
+ expect(body.error).toBe('blocked_uri');
+ // The upstream reason never reaches the caller.
+ expect(JSON.stringify(body)).not.toContain('169.254');
+ });
+
+ it('answers 413 when the host streams past the byte ceiling', async () => {
+ pinned.mockRejectedValue(new MaxBytesExceededError('too big'));
+
+ const { status, body } = await call({ uri: 'https://registry.example/huge' });
+
+ expect(status).toBe(413);
+ expect(body.error).toBe('too_large');
+ });
+
+ it('answers 502 when the registration host is unreachable', async () => {
+ pinned.mockRejectedValue(new Error('ECONNREFUSED'));
+
+ const { status, body } = await call({ uri: 'https://registry.example/down' });
+
+ expect(status).toBe(502);
+ expect(body.error).toBe('upstream_unreachable');
+ });
+
+ it('answers 502 when the host returns a non-OK status', async () => {
+ pinned.mockResolvedValue({ ok: false, status: 404, text: async () => 'nope' });
+
+ const { status, body } = await call({ uri: 'https://registry.example/missing' });
+
+ expect(status).toBe(502);
+ expect(body.error).toBe('upstream_error');
+ });
+
+ it('answers 502 rather than passing through a host that serves HTML', async () => {
+ pinned.mockResolvedValue({ ok: true, status: 200, text: async () => '<html>error page</html>' });
+
+ const { status, body } = await call({ uri: 'https://registry.example/html' });
+
+ expect(status).toBe(502);
+ expect(body.error).toBe('invalid_json');
+ });
+
+ it('lets a successful lookup be edge-cached', async () => {
+ pinned.mockResolvedValue({ ok: true, status: 200, text: async () => '{}' });
+
+ const { headers } = await call({ uri: 'https://registry.example/agent/1' });
+
+ expect(headers['cache-control']).toMatch(/s-maxage=\d+/);
+ });
+});
diff --git a/tests/fits-lib.test.js b/tests/fits-lib.test.js
new file mode 100644
index 000000000..1ee04e922
--- /dev/null
+++ b/tests/fits-lib.test.js
@@ -0,0 +1,199 @@
+// Helpers for /fits (the public cosmetics economy). These format money that
+// real creators are owed and rank fits by scarcity, so the edges matter:
+// sub-cent sales must not collapse to $0.00, and a headline number must never
+// disagree with the rows rendered beneath it.
+import { describe, it, expect } from 'vitest';
+
+import {
+ rarityRank,
+ fmtUsdc,
+ fmtCount,
+ shortWallet,
+ displayAccount,
+ rankFits,
+ summarizeBoard,
+ boardIsEmpty,
+ coinWorldUrl,
+ solscanAccountUrl,
+ looksLikeWallet,
+ RARITY_LABEL,
+} from '../src/fits-lib.js';
+
+const WALLET = '9wgvwps9qK5jNniC5RJdrYCfaV3CLKTnxYVqBjXwegEV';
+
+describe('fmtUsdc', () => {
+ it('renders ordinary amounts as dollars', () => {
+ expect(fmtUsdc(0.25)).toBe('$0.25');
+ expect(fmtUsdc(1)).toBe('$1.00');
+ expect(fmtUsdc(12.5)).toBe('$12.50');
+ });
+
+ it('keeps precision below a cent instead of collapsing to $0.00', () => {
+ expect(fmtUsdc(0.001)).toBe('$0.001');
+ expect(fmtUsdc(0.0005)).toBe('$0.0005');
+ });
+
+ it('rounds and groups large totals', () => {
+ expect(fmtUsdc(1234.56)).toBe('$1,235');
+ });
+
+ it('never throws on garbage', () => {
+ expect(fmtUsdc(null)).toBe('$0.00');
+ expect(fmtUsdc(undefined)).toBe('$0.00');
+ expect(fmtUsdc('not-a-number')).toBe('$0.00');
+ expect(fmtUsdc(0)).toBe('$0.00');
+ });
+});
+
+describe('rarity', () => {
+ it('orders tiers by scarcity', () => {
+ expect(rarityRank('legendary')).toBeGreaterThan(rarityRank('epic'));
+ expect(rarityRank('epic')).toBeGreaterThan(rarityRank('rare'));
+ expect(rarityRank('rare')).toBeGreaterThan(rarityRank('common'));
+ });
+
+ it('treats an unknown tier as the lowest rather than throwing', () => {
+ expect(rarityRank('mythic')).toBe(0);
+ expect(rarityRank(null)).toBe(0);
+ });
+
+ it('has a label for every tier it ranks', () => {
+ for (const tier of ['common', 'rare', 'epic', 'legendary']) {
+ expect(RARITY_LABEL[tier]).toBeTruthy();
+ }
+ });
+});
+
+describe('rankFits', () => {
+ it('puts the fewest-owned fit first', () => {
+ const ranked = rankFits([
+ { name: 'c', owners: 9, rarity: 'rare' },
+ { name: 'a', owners: 1, rarity: 'common' },
+ { name: 'b', owners: 4, rarity: 'epic' },
+ ]);
+ expect(ranked.map((f) => f.name)).toEqual(['a', 'b', 'c']);
+ });
+
+ it('breaks owner-count ties by rarity, not input order', () => {
+ const ranked = rankFits([
+ { name: 'rare-one', owners: 2, rarity: 'rare' },
+ { name: 'legendary-one', owners: 2, rarity: 'legendary' },
+ ]);
+ expect(ranked[0].name).toBe('legendary-one');
+ });
+
+ it('does not mutate the caller array', () => {
+ const input = [{ owners: 5 }, { owners: 1 }];
+ rankFits(input);
+ expect(input[0].owners).toBe(5);
+ });
+
+ it('handles missing input', () => {
+ expect(rankFits(undefined)).toEqual([]);
+ });
+});
+
+describe('displayAccount / shortWallet', () => {
+ it('labels guest session handles rather than truncating them into noise', () => {
+ expect(displayAccount('g_threews_live_demo')).toBe('Guest');
+ expect(displayAccount('guest-t6q8ci22bj')).toBe('Guest');
+ });
+
+ it('truncates real wallets', () => {
+ expect(displayAccount(WALLET)).toBe('9wgv…egEV');
+ expect(shortWallet('short')).toBe('short');
+ });
+});
+
+describe('summarizeBoard', () => {
+ const board = {
+ rarestFits: [
+ { name: 'Headbang', owners: 2, rarity: 'rare' },
+ { name: 'Crimson', owners: 3, rarity: 'rare' },
+ ],
+ topCollectors: [{ account: 'g_a', flexScore: 4, fits: 1 }],
+ topCreators: [
+ { wallet: WALLET, sales: 1, earnedUsdc: 0.25 },
+ { wallet: 'other', sales: 2, earnedUsdc: 0.5 },
+ ],
+ recent: [{ priceUsdc: 0.5 }, { priceUsdc: 0.25 }],
+ };
+
+ it('derives headline numbers from the same rows the page renders', () => {
+ const s = summarizeBoard(board);
+ expect(s.fitsTracked).toBe(2);
+ expect(s.collectors).toBe(1);
+ expect(s.creators).toBe(2);
+ expect(s.creatorSales).toBe(3);
+ expect(s.creatorEarnedUsdc).toBeCloseTo(0.75);
+ expect(s.recentGrossUsdc).toBeCloseTo(0.75);
+ expect(s.recentSales).toBe(2);
+ });
+
+ it('reports the scarcest fit, not merely the first', () => {
+ expect(summarizeBoard(board).rarest.name).toBe('Headbang');
+ });
+
+ it('skips unparseable amounts instead of producing NaN', () => {
+ const s = summarizeBoard({ recent: [{ priceUsdc: 'x' }, { priceUsdc: 1 }], topCreators: [] });
+ expect(s.recentGrossUsdc).toBe(1);
+ });
+
+ it('is safe on an empty or absent board', () => {
+ const s = summarizeBoard(null);
+ expect(s.fitsTracked).toBe(0);
+ expect(s.recentGrossUsdc).toBe(0);
+ expect(s.rarest).toBe(null);
+ });
+});
+
+describe('boardIsEmpty', () => {
+ it('is true only when every section is empty', () => {
+ expect(boardIsEmpty(null)).toBe(true);
+ expect(boardIsEmpty({ rarestFits: [], topCollectors: [], topCreators: [], recent: [] })).toBe(
+ true,
+ );
+ expect(boardIsEmpty({ rarestFits: [], topCollectors: [], topCreators: [], recent: [{}] })).toBe(
+ false,
+ );
+ });
+});
+
+describe('links', () => {
+ it('deep-links a fit to its coin world, URL-encoded', () => {
+ expect(coinWorldUrl('MintABC')).toBe('/play?coin=MintABC');
+ expect(coinWorldUrl('a/b')).toBe('/play?coin=a%2Fb');
+ });
+
+ it('returns null for a missing mint so callers render plain text', () => {
+ expect(coinWorldUrl(null)).toBe(null);
+ expect(coinWorldUrl(' ')).toBe(null);
+ expect(solscanAccountUrl('')).toBe(null);
+ });
+
+ it('builds a solscan account link', () => {
+ expect(solscanAccountUrl(WALLET)).toBe(`https://solscan.io/account/${WALLET}`);
+ });
+});
+
+describe('looksLikeWallet', () => {
+ it('accepts a base58 Solana address', () => {
+ expect(looksLikeWallet(WALLET)).toBe(true);
+ });
+
+ it('rejects obvious typos before spending a request', () => {
+ expect(looksLikeWallet('')).toBe(false);
+ expect(looksLikeWallet('too-short')).toBe(false);
+ expect(looksLikeWallet('0x833589fcd6edb6e08f4c7c32d4f71b54bda02913')).toBe(false);
+ // 0, O, I and l are not in the base58 alphabet.
+ expect(looksLikeWallet('0OIl'.repeat(9))).toBe(false);
+ });
+});
+
+describe('fmtCount', () => {
+ it('groups thousands and survives junk', () => {
+ expect(fmtCount(1234)).toBe('1,234');
+ expect(fmtCount(null)).toBe('0');
+ expect(fmtCount('x')).toBe('0');
+ });
+});
diff --git a/tests/forge-timeline.test.js b/tests/forge-timeline.test.js
new file mode 100644
index 000000000..42e262287
--- /dev/null
+++ b/tests/forge-timeline.test.js
@@ -0,0 +1,177 @@
+// @vitest-environment jsdom
+//
+// The /forge generation timeline (src/forge-timeline.js). The property under
+// test is the one the module exists to guarantee: every stage state is caused by
+// a real /api/forge signal, and a lane that never performs a step never shows a
+// row for it. A regression here would put the page back to inventing progress.
+
+import { describe, it, expect, beforeEach } from 'vitest';
+import { createForgeTimeline } from '../src/forge-timeline.js';
+
+function mount() {
+ document.body.innerHTML = `
+ <div id="preview"></div>
+ <ol id="stages"></ol>
+ <div id="warming" class="is-hidden">
+ <p class="gen-warming-title"></p>
+ <p class="gen-warming-body"></p>
+ <p class="gen-warming-count"></p>
+ </div>`;
+ return createForgeTimeline({
+ list: document.getElementById('stages'),
+ preview: document.getElementById('preview'),
+ warming: document.getElementById('warming'),
+ engineLabel: (id) => ({ nvidia: 'NVIDIA', trellis_selfhost: 'TRELLIS' })[id] || id,
+ });
+}
+
+const stageIds = () =>
+ [...document.querySelectorAll('#stages .step')].map((el) => el.dataset.stage);
+const stateOf = (id) => document.querySelector(`#stages .step[data-stage="${id}"]`)?.dataset.state;
+const labelOf = (id) =>
+ document.querySelector(`#stages .step[data-stage="${id}"] .step-label`)?.textContent;
+
+describe('forge timeline stages', () => {
+ let timeline;
+ beforeEach(() => {
+ timeline = mount();
+ });
+
+ it('shows the director and reference stages for a text lane that paints one', () => {
+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });
+ expect(stageIds()).toEqual(['direct', 'reference', 'mesh', 'finish']);
+ // Before any response: the director is the only thing genuinely running.
+ expect(stateOf('direct')).toBe('active');
+ expect(stateOf('reference')).toBe('pending');
+ expect(stateOf('mesh')).toBe('pending');
+ });
+
+ it('drops both stages for a lane that reports no reference view', () => {
+ timeline.begin({ mode: 'text', backend: 'nvidia', usesReference: false });
+ expect(stageIds()).toEqual(['input', 'mesh', 'finish']);
+ timeline.applySubmit({ status: 'queued', backend: 'nvidia' });
+ expect(stateOf('input')).toBe('done');
+ expect(labelOf('mesh')).toContain('NVIDIA');
+ });
+
+ it('completes the director stage from directed_prompt, not from elapsed time', () => {
+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });
+ timeline.tick(120); // two minutes of waiting changes nothing on its own
+ expect(stateOf('direct')).toBe('active');
+ const out = timeline.applySubmit({
+ status: 'queued',
+ backend: 'trellis_selfhost',
+ directed_prompt: 'a chrome toaster, brushed steel body, warm diner light',
+ preview_image_url: 'https://cdn.example/ref.png',
+ });
+ expect(out.directedPrompt).toBe('a chrome toaster, brushed steel body, warm diner light');
+ expect(stateOf('direct')).toBe('done');
+ expect(labelOf('direct')).toBe('Prompt art-directed');
+ expect(stateOf('reference')).toBe('done');
+ });
+
+ it('says the prompt was used verbatim when no rewrite comes back', () => {
+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });
+ timeline.applySubmit({ status: 'queued', preview_image_url: 'https://cdn.example/ref.png' });
+ expect(labelOf('direct')).toBe('Prompt used as you wrote it');
+ });
+
+ it('reveals a reference view that only arrives on a later poll', () => {
+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });
+ // A coalesced job answers with a job id and nothing else.
+ timeline.applySubmit({ status: 'queued', coalesced: true, backend: 'trellis_selfhost' });
+ expect(stateOf('reference')).toBe('active');
+ expect(document.querySelector('#stages .step-thumb')).toBeNull();
+ timeline.applyPoll({ status: 'running', preview_image_url: 'https://cdn.example/late.png' });
+ expect(stateOf('reference')).toBe('done');
+ expect(document.querySelector('#stages .step-thumb')?.getAttribute('href')).toBe(
+ 'https://cdn.example/late.png',
+ );
+ });
+
+ it('names the lane a poll-time failover moved the job to', () => {
+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });
+ timeline.applySubmit({ status: 'queued', backend: 'trellis_selfhost' });
+ timeline.applyPoll({ status: 'running', backend: 'nvidia', failover_from: 'trellis_selfhost' });
+ expect(labelOf('mesh')).toContain('NVIDIA');
+ expect(
+ document.querySelector('#stages .step[data-stage="mesh"] .step-detail').textContent,
+ ).toContain('TRELLIS');
+ });
+
+ it('starts an image run from the uploaded views, with no director stage', () => {
+ timeline.begin({ mode: 'image', backend: 'trellis_selfhost', viewCount: 3 });
+ expect(stageIds()).toEqual(['input', 'mesh', 'finish']);
+ expect(labelOf('input')).toBe('Conditioning on 3 reference views');
+ expect(stateOf('input')).toBe('done');
+ });
+});
+
+describe('forge timeline cold start', () => {
+ let timeline;
+ beforeEach(() => {
+ timeline = mount();
+ });
+
+ const warming = () => document.getElementById('warming');
+
+ it('stays hidden when the API reports a warm lane', () => {
+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });
+ timeline.applySubmit({ status: 'queued', cold_start: false, eta_seconds: 60 });
+ expect(warming().classList.contains('is-hidden')).toBe(true);
+ });
+
+ it('counts down the real gap between the cold ETA and the warm estimate', () => {
+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });
+ timeline.applySubmit(
+ { status: 'queued', backend: 'trellis_selfhost', cold_start: true, eta_seconds: 110 },
+ { warmEtaSeconds: 60 },
+ );
+ expect(warming().classList.contains('is-hidden')).toBe(false);
+ timeline.tick(20);
+ // 110 - 60 = a 50s boot budget; 30s of it is left after 20s elapsed.
+ expect(warming().querySelector('.gen-warming-count').textContent).toContain('~30s');
+ timeline.tick(80);
+ expect(warming().dataset.phase).toBe('over');
+ });
+
+ it('ends the warming state on the first running poll, never on the clock', () => {
+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });
+ timeline.applySubmit(
+ { status: 'queued', cold_start: true, eta_seconds: 110 },
+ { warmEtaSeconds: 60 },
+ );
+ timeline.tick(999);
+ expect(warming().classList.contains('is-hidden')).toBe(false);
+ expect(timeline.isCold()).toBe(true);
+ timeline.applyPoll({ status: 'running' });
+ expect(warming().classList.contains('is-hidden')).toBe(true);
+ expect(timeline.isCold()).toBe(false);
+ });
+
+ it('drops the warming card when the job ends', () => {
+ timeline.begin({ mode: 'text', backend: 'trellis_selfhost', usesReference: true });
+ timeline.applySubmit(
+ { status: 'queued', cold_start: true, eta_seconds: 110 },
+ { warmEtaSeconds: 60 },
+ );
+ timeline.fail();
+ expect(warming().classList.contains('is-hidden')).toBe(true);
+ });
+});
+
+describe('forge timeline completion', () => {
+ it('only marks the last stage done once the model is on screen', () => {
+ const timeline = mount();
+ timeline.begin({ mode: 'text', backend: 'nvidia', usesReference: false });
+ timeline.applySubmit({ status: 'queued', backend: 'nvidia' });
+ timeline.applyPoll({ status: 'running' });
+ expect(stateOf('finish')).toBe('pending');
+ timeline.finalizing();
+ expect(stateOf('finish')).toBe('active');
+ expect(stateOf('mesh')).toBe('done');
+ timeline.complete();
+ expect(stateOf('finish')).toBe('done');
+ expect(labelOf('finish')).toBe('Model ready');
+ });
+});
diff --git a/tests/fuzzy.test.js b/tests/fuzzy.test.js
new file mode 100644
index 000000000..8bc81d4e2
--- /dev/null
+++ b/tests/fuzzy.test.js
@@ -0,0 +1,104 @@
+// The shared fuzzy matcher (src/shared/fuzzy.js) that replaced the two
+// four-branch substring scorers in the command palettes.
+import { describe, it, expect } from 'vitest';
+import { rank, matches, highlight } from '../src/shared/fuzzy.js';
+
+const ITEMS = [
+ { label: 'Create agent' },
+ { label: 'Create avatar' },
+ { label: 'Agent settings' },
+ { label: 'Billing and usage' },
+ { label: 'Marketplace' },
+];
+const text = (i) => i.label;
+
+describe('rank', () => {
+ it('returns every item for an empty query', () => {
+ expect(rank('', ITEMS, text)).toHaveLength(ITEMS.length);
+ });
+
+ it('finds exact and prefix matches', () => {
+ const out = rank('Marketplace', ITEMS, text);
+ expect(out[0].item.label).toBe('Marketplace');
+ });
+
+ it('ranks a prefix match above a mid-string match', () => {
+ const labels = rank('agent', ITEMS, text).map((r) => r.item.label);
+ expect(labels).toContain('Agent settings');
+ expect(labels).toContain('Create agent');
+ expect(labels.indexOf('Agent settings')).toBeLessThan(labels.indexOf('Create agent'));
+ });
+
+ it('tolerates a transposition, which the substring scorer could not', () => {
+ expect(rank('markteplace', ITEMS, text).map((r) => r.item.label)).toContain('Marketplace');
+ });
+
+ it('tolerates a dropped character', () => {
+ expect(rank('marketplce', ITEMS, text).map((r) => r.item.label)).toContain('Marketplace');
+ });
+
+ it('discriminates within a tier instead of tying every subsequence at one score', () => {
+ const out = rank('crea', ITEMS, text);
+ expect(out.length).toBeGreaterThan(1);
+ // A real ordering exists: the results are not returned in input order by
+ // accident — every returned item genuinely starts with the query.
+ for (const r of out) expect(r.item.label.toLowerCase()).toContain('crea');
+ });
+
+ it('returns nothing for a query that matches nothing', () => {
+ expect(rank('zzzzqqq', ITEMS, text)).toEqual([]);
+ });
+
+ it('honours the limit option', () => {
+ expect(rank('a', ITEMS, text, { limit: 2 }).length).toBeLessThanOrEqual(2);
+ });
+
+ it('handles an empty item list', () => {
+ expect(rank('x', [], text)).toEqual([]);
+ });
+
+ it('exposes match ranges for highlighting', () => {
+ const [first] = rank('market', ITEMS, text);
+ expect(Array.isArray(first.ranges)).toBe(true);
+ expect(first.ranges.length).toBeGreaterThanOrEqual(2);
+ });
+});
+
+describe('matches', () => {
+ it('is true for an empty query', () => {
+ expect(matches('', 'anything')).toBe(true);
+ });
+
+ it('matches a substring', () => {
+ expect(matches('mark', 'Marketplace')).toBe(true);
+ });
+
+ it('rejects an arbitrarily sparse subsequence', () => {
+ // Deliberate: the previous scorer accepted any subsequence and then tied
+ // every such hit at a single score, so "barely matches" ranked level with
+ // "close match". Single-error mode trades that recall for precision.
+ expect(matches('mktpl', 'Marketplace')).toBe(false);
+ });
+
+ it('rejects a non-match', () => {
+ expect(matches('zzz', 'Marketplace')).toBe(false);
+ });
+});
+
+describe('highlight', () => {
+ it('wraps the matched range and escapes the rest', () => {
+ expect(highlight('Marketplace', [0, 6])).toBe('<mark>Market</mark>place');
+ });
+
+ it('escapes HTML in unmatched text', () => {
+ expect(highlight('<b>hi</b>', [])).toBe('&lt;b&gt;hi&lt;/b&gt;');
+ });
+
+ it('escapes HTML inside a matched range', () => {
+ expect(highlight('<script>', [0, 8])).toBe('<mark>&lt;script&gt;</mark>');
+ });
+
+ it('handles multiple disjoint ranges', () => {
+ expect(highlight('abcdef', [0, 1, 3, 4])).toBe('<mark>a</mark>bc<mark>d</mark>ef');
+ });
+});
diff --git a/tests/glb-canonicalize.test.js b/tests/glb-canonicalize.test.js
index aa2c83794..cc2ef3fee 100644
--- a/tests/glb-canonicalize.test.js
+++ b/tests/glb-canonicalize.test.js
@@ -768,6 +768,179 @@ describe('canonicalizeBoneName', () => {
});
});
+// ---------------------------------------------------------------------------
+// Finger conventions, and why they are load-bearing.
+//
+// 30 of the 53 tracks in every clip in public/animations/clips address finger
+// bones. A rig whose hands do not name-map therefore scores about 40% retarget
+// coverage, which is UNDER the MIN_COVERAGE gate in src/animation-retarget.js —
+// so production builds no action for it at all and the avatar stands frozen in
+// its bind pose, arms and legs included. That is how an Unreal mannequin, a VRM
+// 1.0 avatar, a Genesis figure, a MakeHuman export and a Rigify character were
+// all failing before these aliases landed, each measured doing exactly that by
+// scripts/animation-dignity-sweep.mjs. Every case below is a real export
+// spelling from that convention's own tooling.
+// ---------------------------------------------------------------------------
+describe('finger chains across rig conventions', () => {
+ it.each([
+ // Unreal mannequin: zero-padded joint index, side last.
+ ['index_01_l', 'LeftHandIndex1'],
+ ['index_03_r', 'RightHandIndex3'],
+ ['middle_02_l', 'LeftHandMiddle2'],
+ ['ring_01_r', 'RightHandRing1'],
+ ['pinky_03_l', 'LeftHandPinky3'],
+ ['thumb_01_r', 'RightHandThumb1'],
+ ])('Unreal mannequin: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ it.each([
+ // VRM 1.0 names the phalanges instead of numbering them, side first, and
+ // starts the thumb at its metacarpal. "Little" is the pinky.
+ ['leftIndexProximal', 'LeftHandIndex1'],
+ ['leftIndexIntermediate', 'LeftHandIndex2'],
+ ['leftIndexDistal', 'LeftHandIndex3'],
+ ['rightMiddleProximal', 'RightHandMiddle1'],
+ ['leftLittleDistal', 'LeftHandPinky3'],
+ ['rightRingIntermediate', 'RightHandRing2'],
+ ['leftThumbMetacarpal', 'LeftHandThumb1'],
+ ['leftThumbProximal', 'LeftHandThumb2'],
+ ['rightThumbDistal', 'RightHandThumb3'],
+ ])('VRM 1.0: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ it.each([
+ // Daz / Genesis numbers each digit behind a bare side letter, and
+ // abbreviates the middle finger to `Mid`.
+ ['lIndex1', 'LeftHandIndex1'],
+ ['rIndex3', 'RightHandIndex3'],
+ ['lMid2', 'LeftHandMiddle2'],
+ ['rMid1', 'RightHandMiddle1'],
+ ['lRing3', 'LeftHandRing3'],
+ ['rPinky1', 'RightHandPinky1'],
+ ['lThumb2', 'LeftHandThumb2'],
+ ])('Daz / Genesis: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ it.each([
+ // Blender Rigify prefixes the four fingers `f_` and leaves the thumb bare.
+ ['f_index.01.L', 'LeftHandIndex1'],
+ ['f_index.03.R', 'RightHandIndex3'],
+ ['f_middle.02.L', 'LeftHandMiddle2'],
+ ['f_ring.01.R', 'RightHandRing1'],
+ ['f_pinky.03.L', 'LeftHandPinky3'],
+ ['thumb.01.L', 'LeftHandThumb1'],
+ ['thumb.03.R', 'RightHandThumb3'],
+ // Rigify's deform layer carries the same names behind a DEF- prefix.
+ ['DEF-f_index.01.L', 'LeftHandIndex1'],
+ ])('Blender Rigify: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ it.each([
+ // MakeHuman numbers the digits 1..5 starting at the thumb.
+ ['finger1-1.L', 'LeftHandThumb1'],
+ ['finger1-3.R', 'RightHandThumb3'],
+ ['finger2-1.L', 'LeftHandIndex1'],
+ ['finger3-2.R', 'RightHandMiddle2'],
+ ['finger4-3.L', 'LeftHandRing3'],
+ ['finger5-1.R', 'RightHandPinky1'],
+ ])('MakeHuman: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ it.each([
+ // Anatomy-kit / scan rigs name the phalanges with the side as a suffix.
+ ['index_proximal.L', 'LeftHandIndex1'],
+ ['index_distal.R', 'RightHandIndex3'],
+ ['middle_intermediate.L', 'LeftHandMiddle2'],
+ ['little_proximal.R', 'RightHandPinky1'],
+ ['thumb_metacarpal.L', 'LeftHandThumb1'],
+ ])('anatomical phalanx naming: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ it('a full Unreal mannequin hand maps all 15 joints per side', () => {
+ const mapped = new Set();
+ for (const side of ['l', 'r']) {
+ for (const finger of ['thumb', 'index', 'middle', 'ring', 'pinky']) {
+ for (let n = 1; n <= 3; n++) {
+ const canonical = canonicalizeBoneName(`${finger}_0${n}_${side}`);
+ expect(canonical, `${finger}_0${n}_${side}`).not.toBeNull();
+ mapped.add(canonical);
+ }
+ }
+ }
+ // 30 distinct canonical finger bones — no two spellings collapsed onto one,
+ // which would leave a joint undriven while coverage still looked healthy.
+ expect(mapped.size).toBe(30);
+ });
+
+ it('metacarpal scaffolding that has no canonical home stays unmapped', () => {
+ // The canonical set has no palm/metacarpal bone for the four fingers, so
+ // these must keep falling through rather than stealing a phalanx track.
+ // (The THUMB metacarpal is the exception: it IS the canonical Thumb1.)
+ for (const name of ['Palm1.L', 'lCarpal1', 'index_metacarpal.L', 'leftIndexMetacarpal']) {
+ expect(canonicalizeBoneName(name), name).toBeNull();
+ }
+ });
+});
+
+// ---------------------------------------------------------------------------
+// Anatomical-Latin rigs: the convention the canonicalizer had never seen. Scan
+// pipelines and anatomy kits name every joint for the bone itself. Before these
+// aliases the whole skeleton mapped 3 of 52 joints (pelvis, scapula.L/R) and
+// animated nothing at all.
+// ---------------------------------------------------------------------------
+describe('anatomical-Latin skeleton', () => {
+ it.each([
+ ['lumbar', 'Spine'],
+ ['thoracic', 'Spine1'],
+ ['sternum', 'Spine2'],
+ ['cervical', 'Neck'],
+ ['cranium', 'Head'],
+ ['skull', 'Head'],
+ ])('centre chain: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ it.each([
+ ['humerus.L', 'LeftArm'],
+ ['humerus.R', 'RightArm'],
+ ['l_humerus', 'LeftArm'],
+ ['ulna.L', 'LeftForeArm'],
+ ['radius.R', 'RightForeArm'],
+ ['carpus.L', 'LeftHand'],
+ ['femur.R', 'RightUpLeg'],
+ ['l_femur', 'LeftUpLeg'],
+ ['tibia.L', 'LeftLeg'],
+ ['fibula.R', 'RightLeg'],
+ ['talus.L', 'LeftFoot'],
+ ['tarsus.R', 'RightFoot'],
+ ['calcaneus.L', 'LeftFoot'],
+ ['metatarsus.R', 'RightToeBase'],
+ ])('limbs, both side spellings: %s → %s', (input, expected) => {
+ expect(canonicalizeBoneName(input)).toBe(expected);
+ });
+
+ it('never crosses sides', () => {
+ const left = [
+ 'humerus.L', 'ulna.L', 'radius.L', 'carpus.L', 'femur.L', 'tibia.L',
+ 'fibula.L', 'talus.L', 'tarsus.L', 'calcaneus.L', 'metatarsus.L',
+ 'l_humerus', 'l_femur', 'index_proximal.L', 'thumb_metacarpal.L',
+ ];
+ const right = left.map((n) => (n.endsWith('.L') ? n.replace(/\.L$/, '.R') : n.replace(/^l_/, 'r_')));
+ for (const name of left) {
+ expect(canonicalizeBoneName(name)?.startsWith('Right'), name).toBe(false);
+ }
+ for (const name of right) {
+ expect(canonicalizeBoneName(name)?.startsWith('Left'), name).toBe(false);
+ }
+ });
+});
+
describe('canonicalizeJointNodes (in-place rewrite)', () => {
it('only touches nodes referenced by skins[].joints', () => {
const json = {
diff --git a/tests/onboarding-tier.test.js b/tests/onboarding-tier.test.js
index abaf88de4..d9e873b56 100644
--- a/tests/onboarding-tier.test.js
+++ b/tests/onboarding-tier.test.js
@@ -178,6 +178,18 @@ describe('homepage lite path', () => {
expect(gated).not.toContain('embed');
});
+ it('keeps the first screen to the two promises a newcomer can act on', () => {
+ // The hero's third bullet names a payment protocol before the visitor has
+ // made anything; Create and Embed are the journey and always show.
+ const bullets = [...homeHtml.matchAll(/<li([^>]*)data-i18n-html="home\.bullet_(\w+)"/g)].map(
+ (m) => ({ key: m[2], advanced: m[1].includes('data-tier="advanced"') }),
+ );
+ expect(bullets.map((b) => b.key)).toEqual(['create', 'embed', 'earn']);
+ expect(bullets.find((b) => b.key === 'create').advanced).toBe(false);
+ expect(bullets.find((b) => b.key === 'embed').advanced).toBe(false);
+ expect(bullets.find((b) => b.key === 'earn').advanced).toBe(true);
+ });
+
it('reveals a gated section when the URL points into it', () => {
// A shared link to #home-x402 must not land on a blank page.
expect(homeHtml).toContain("el.closest('[data-tier=\"advanced\"]')");
diff --git a/tests/procedural-anim.test.js b/tests/procedural-anim.test.js
index b897b3315..573aed14c 100644
--- a/tests/procedural-anim.test.js
+++ b/tests/procedural-anim.test.js
@@ -9,10 +9,20 @@
*/
import { describe, it, expect } from 'vitest';
-import { Bone, Group, Quaternion, Vector3 } from 'three';
+import {
+ Bone,
+ BufferGeometry,
+ Float32BufferAttribute,
+ Group,
+ Quaternion,
+ Skeleton,
+ SkinnedMesh,
+ Vector3,
+} from 'three';
import { solveTwoBoneIK } from '../src/procedural/two-bone-ik.js';
import { LookAtController } from '../src/procedural/look-at.js';
import { FootPlantController } from '../src/procedural/foot-plant.js';
+import { canonicalBoneNodes } from '../src/procedural/canonical-bones.js';
// A hip->knee->ankle chain hanging straight down from a root group at hip
// height, knee pre-bent slightly forward (+Z) like every real locomotion pose,
@@ -92,6 +102,93 @@ function settle(controller, frames = 120) {
for (let i = 0; i < frames; i++) controller.update(1 / 60);
}
+// A rig whose bones are reachable ONLY through `skeleton.bones` — the armature
+// is not parented under the model root. GLBs that export the armature beside
+// the mesh, and SkeletonUtils clones, both produce this shape, and it is what
+// every NPC in the walkaround world turned out to look like.
+function makeDetachedArmatureRig() {
+ const root = new Group();
+ const bone = (name) => Object.assign(new Bone(), { name });
+ const hips = bone('Hips');
+ const spine = bone('Spine');
+ const spine2 = bone('Spine2');
+ const neck = bone('Neck');
+ const head = bone('Head');
+ spine.position.y = 0.1;
+ spine2.position.y = 0.2;
+ neck.position.y = 0.15;
+ head.position.y = 0.1;
+ hips.add(spine);
+ spine.add(spine2);
+ spine2.add(neck);
+ neck.add(head);
+
+ const bones = [hips, spine, spine2, neck, head];
+ for (const side of ['Left', 'Right']) {
+ const up = bone(`${side}UpLeg`);
+ const leg = bone(`${side}Leg`);
+ const foot = bone(`${side}Foot`);
+ up.position.set(side === 'Left' ? 0.1 : -0.1, -0.05, 0);
+ leg.position.set(0, -0.45, 0.02);
+ foot.position.set(0, -0.45, 0.02);
+ hips.add(up);
+ up.add(leg);
+ leg.add(foot);
+ bones.push(up, leg, foot);
+ }
+ hips.position.y = 0.95;
+
+ const geo = new BufferGeometry();
+ geo.setAttribute('position', new Float32BufferAttribute([0, 0, 0], 3));
+ geo.setAttribute('skinIndex', new Float32BufferAttribute([0, 0, 0, 0], 4));
+ geo.setAttribute('skinWeight', new Float32BufferAttribute([1, 0, 0, 0], 4));
+ const mesh = new SkinnedMesh(geo);
+ mesh.bind(new Skeleton(bones));
+ root.add(mesh); // the MESH is under root; the bone tree is not
+ root.updateWorldMatrix(true, true);
+ return root;
+}
+
+describe('canonical bone resolution', () => {
+ // Regression: the layers used to resolve canonical names to bone *names* and
+ // then call model.getObjectByName(), which only searches descendants of the
+ // root. Every rig with a detached armature therefore reported enabled=false
+ // and silently did nothing — the failure mode that shipped gaze to the walk
+ // world's NPCs with no effect.
+ it('finds bones reachable only through skeleton.bones', () => {
+ const nodes = canonicalBoneNodes(makeDetachedArmatureRig());
+ expect(nodes.get('Head')?.name).toBe('Head');
+ expect(nodes.get('LeftFoot')?.name).toBe('LeftFoot');
+ });
+
+ it('getObjectByName cannot find them, which is why node resolution exists', () => {
+ expect(makeDetachedArmatureRig().getObjectByName('Head')).toBeUndefined();
+ });
+
+ it('LookAtController is enabled on a detached-armature rig', () => {
+ const ctl = new LookAtController(makeDetachedArmatureRig());
+ expect(ctl.enabled).toBe(true);
+ expect(ctl.headBone?.name).toBe('Head');
+ });
+
+ it('FootPlantController is enabled on a detached-armature rig', () => {
+ expect(new FootPlantController(makeDetachedArmatureRig(), () => 0).enabled).toBe(true);
+ });
+
+ it('and the gaze actually turns that rig', () => {
+ const root = makeDetachedArmatureRig();
+ const ctl = new LookAtController(root);
+ ctl.setTarget(new Vector3(2, 1.5, 2));
+ settle(ctl);
+ const head = ctl.headBone;
+ head.updateWorldMatrix(true, false);
+ const q = new Quaternion();
+ head.getWorldQuaternion(q);
+ const fwd = new Vector3(0, 0, 1).applyQuaternion(q);
+ expect(fwd.x).toBeGreaterThan(0.25);
+ });
+});
+
describe('solveTwoBoneIK', () => {
it('places the tip on a reachable target', () => {
const { hip, knee, ankle } = makeLeg();
diff --git a/tests/walkroom-prop-assets.test.js b/tests/walkroom-prop-assets.test.js
new file mode 100644
index 000000000..88c3d8a3a
--- /dev/null
+++ b/tests/walkroom-prop-assets.test.js
@@ -0,0 +1,156 @@
+// P3.2 / P3.3 — the WalkRoom half of the Phase 3 build work:
+// • a player-uploaded prop url is validated against the storage allow-list
+// before it is published to every other client in the world, survives a
+// save/restore round-trip, and is re-validated on the way back in;
+// • the creator clear-area sweep is clamped to the tier the caller EARNED,
+// not a flat constant a client could out-ask.
+//
+// Like the sibling walkroom-* suites, the full room needs the Colyseus runtime,
+// so these drive the pure helpers against a minimal stand-in (Object.create
+// skips the Room constructor).
+
+import { describe, it, expect, beforeEach } from 'vitest';
+import { WalkRoom } from '../multiplayer/src/rooms/WalkRoom.js';
+import { WorldObject } from '../multiplayer/src/schemas.js';
+import {
+ BUILD_CLEAR_RADIUS_BASE, BUILD_CLEAR_RADIUS_HOLDER, BUILD_CLEAR_RADIUS_CREATOR,
+} from '../multiplayer/src/build-limits.js';
+
+const GOOD_URL = 'https://pub-test.r2.dev/u/anon/avatar/8f14e45f.glb';
+
+function makeRoom({ tier = '', creator = '' } = {}) {
+ const room = Object.create(WalkRoom.prototype);
+ room.state = { objects: new Map(), players: new Map(), tier, coin: 'THREEsynthetic1111111111111111111111111111' };
+ room.econ = new Map();
+ room._objCounters = new Map();
+ room._objSeq = 0;
+ room.coinCreator = creator;
+ room.blockCounts = new Map();
+ room.blockOwners = new Map();
+ room.columnCounts = new Map();
+ // _persistObjects reaches the durable store; capture the calls instead.
+ room._persisted = 0;
+ room._persistObjects = () => { room._persisted++; };
+ // Room.roomId is a private-field getter on the Colyseus base class, which an
+ // Object.create stand-in can't read; the restore path logs with it.
+ Object.defineProperty(room, 'roomId', { value: 'test-room' });
+ return room;
+}
+
+function seat(room, sessionId, { account = '' } = {}) {
+ room.econ.set(sessionId, { playerId: sessionId });
+ room.state.players.set(sessionId, { account });
+ return { sessionId, sent: [], send(type, msg) { this.sent.push({ type, msg }); } };
+}
+
+describe('WalkRoom uploaded prop assets (P3.3)', () => {
+ let room;
+ beforeEach(() => { room = makeRoom(); });
+
+ it('publishes a prop url that is on our own storage', () => {
+ const client = seat(room, 's1');
+ room._handleObjSpawn(client, { kind: 'prop', type: 'u:abc', x: 30, y: 0, z: 40, url: GOOD_URL });
+ const [obj] = [...room.state.objects.values()];
+ expect(obj).toBeDefined();
+ expect(obj.url).toBe(GOOD_URL);
+ expect(client.sent).toHaveLength(0);
+ });
+
+ it('refuses a third-party url outright and tells the client why', () => {
+ const client = seat(room, 's1');
+ room._handleObjSpawn(client, { kind: 'prop', type: 'u:abc', x: 30, y: 0, z: 30, url: 'https://evil.example.com/x.glb' });
+ expect(room.state.objects.size).toBe(0);
+ expect(client.sent).toEqual([{ type: 'obj:reject', msg: { reason: 'asset_url' } }]);
+ });
+
+ it('refuses a javascript: payload smuggled through the url field', () => {
+ const client = seat(room, 's1');
+ room._handleObjSpawn(client, { kind: 'prop', type: 'u:abc', x: 30, y: 0, z: 30, url: 'javascript:alert(1)//a.glb' });
+ expect(room.state.objects.size).toBe(0);
+ expect(client.sent[0].msg.reason).toBe('asset_url');
+ });
+
+ it('leaves catalog props with an empty url', () => {
+ const client = seat(room, 's1');
+ room._handleObjSpawn(client, { kind: 'prop', type: 'crate', x: 32, y: 0, z: 22 });
+ const [obj] = [...room.state.objects.values()];
+ expect(obj.url).toBe('');
+ });
+
+ it('round-trips the url through snapshot and restore', () => {
+ const client = seat(room, 's1');
+ room._handleObjSpawn(client, { kind: 'prop', type: 'u:abc', x: 35, y: 0, z: 26, url: GOOD_URL });
+ const snapshot = room._snapshotObjects();
+ expect(snapshot[0].url).toBe(GOOD_URL);
+
+ const fresh = makeRoom();
+ fresh._restoreObjects({ objects: snapshot });
+ const [restored] = [...fresh.state.objects.values()];
+ expect(restored.url).toBe(GOOD_URL);
+ });
+
+ it('omits the url key entirely for catalog props so the doc stays compact', () => {
+ const client = seat(room, 's1');
+ room._handleObjSpawn(client, { kind: 'prop', type: 'crate', x: 34, y: 0, z: 24 });
+ expect(Object.keys(room._snapshotObjects()[0])).not.toContain('url');
+ });
+
+ it('re-validates a stored url on restore, so a doc written elsewhere cannot smuggle one in', () => {
+ const fresh = makeRoom();
+ fresh._restoreObjects({
+ objects: [
+ { id: 'bad', type: 'u:x', kind: 'prop', ownerId: 'u', x: 30, y: 0, z: 30, url: 'https://evil.example.com/x.glb' },
+ { id: 'good', type: 'u:y', kind: 'prop', ownerId: 'u', x: 31, y: 0, z: 31, url: GOOD_URL },
+ ],
+ });
+ expect(fresh.state.objects.get('bad').url).toBe('');
+ expect(fresh.state.objects.get('good').url).toBe(GOOD_URL);
+ });
+});
+
+describe('WalkRoom clear-area radius tiers (P3.2)', () => {
+ it('advertises the base radius to a visitor in an open world', () => {
+ const room = makeRoom();
+ const client = seat(room, 's1');
+ expect(room._clearRadiusFor(client)).toBe(BUILD_CLEAR_RADIUS_BASE);
+ });
+
+ it('advertises the holder radius inside a gated holders world', () => {
+ const room = makeRoom({ tier: 'holders' });
+ const client = seat(room, 's1');
+ expect(room._clearRadiusFor(client)).toBe(BUILD_CLEAR_RADIUS_HOLDER);
+ });
+
+ it('advertises the creator radius to the coin creator', () => {
+ const room = makeRoom({ creator: 'WALLET1' });
+ const client = seat(room, 's1', { account: 'WALLET1' });
+ expect(room._clearRadiusFor(client)).toBe(BUILD_CLEAR_RADIUS_CREATOR);
+ });
+
+ it('sends the same number to the HUD that it will clamp to', () => {
+ const room = makeRoom({ tier: 'holders', creator: 'WALLET1' });
+ room.blockCounts = new Map();
+ const client = seat(room, 's1', { account: 'WALLET1' });
+ room._sendBuildPerms(client);
+ const perms = client.sent.find((m) => m.type === 'build-perms').msg;
+ expect(perms.clearMaxRadius).toBe(room._clearRadiusFor(client));
+ expect(perms.holderWorld).toBe(true);
+ });
+
+ it('clamps a client asking for more than its tier allows', () => {
+ const room = makeRoom();
+ const client = seat(room, 's1');
+ // A visitor is not a creator, so the sweep is refused before radius matters;
+ // the earned radius itself is what a creator's over-ask gets clamped to.
+ const creatorRoom = makeRoom({ creator: 'WALLET1' });
+ const creator = seat(creatorRoom, 's1', { account: 'WALLET1' });
+ expect(Math.min(creatorRoom._clearRadiusFor(creator), 9999)).toBe(BUILD_CLEAR_RADIUS_CREATOR);
+ expect(room._clearRadiusFor(client)).toBeLessThan(BUILD_CLEAR_RADIUS_CREATOR);
+ });
+});
+
+describe('WorldObject schema carries the asset url', () => {
+ it('defaults to an empty string', () => {
+ expect(new WorldObject().url).toBe('');
+ });
+});
diff --git a/tests/world-persist.test.js b/tests/world-persist.test.js
new file mode 100644
index 000000000..d6decd56d
--- /dev/null
+++ b/tests/world-persist.test.js
@@ -0,0 +1,206 @@
+// P3.1 — the browser's half of the durable per-world build store.
+//
+// These lock the invariants that decide whether a community's build survives:
+// the world key must match WalkRoom's byte-for-byte, the client must never write
+// while the authoritative room holds the pen, a 409 must MERGE rather than
+// clobber, and a permission refusal must be terminal and reported (never a
+// silent retry loop that tells the player their work is saved when it isn't).
+
+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
+import { WorldBuildStore, worldIdForCoin, docObjects, WORLD_SAVE_DEBOUNCE_MS } from '../src/game/world-persist.js';
+
+const MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump'; // $THREE
+
+function jsonResponse(status, body) {
+ return {
+ ok: status >= 200 && status < 300,
+ status,
+ json: async () => body,
+ };
+}
+
+// A fetch stand-in that records every call and replies from a queue.
+function fakeFetch(replies) {
+ const calls = [];
+ const fn = vi.fn(async (url, init) => {
+ calls.push({ url, init, body: init?.body ? JSON.parse(init.body) : null });
+ const next = replies.shift();
+ if (typeof next === 'function') return next(url, init);
+ if (next instanceof Error) throw next;
+ return next ?? jsonResponse(200, { etag: 'e', version: 1 });
+ });
+ fn.calls = calls;
+ return fn;
+}
+
+describe('worldIdForCoin', () => {
+ it('mirrors WalkRoom.worldKey for every tier', () => {
+ expect(worldIdForCoin(MINT)).toBe(MINT);
+ expect(worldIdForCoin(MINT, 'holders')).toBe(`${MINT}#holders`);
+ expect(worldIdForCoin('', '')).toBe('mainland');
+ expect(worldIdForCoin(' ')).toBe('mainland');
+ });
+});
+
+describe('docObjects', () => {
+ it('keeps well-formed rows and drops the rest', () => {
+ const objects = docObjects({
+ objects: [
+ { id: 'a', x: 1, y: 0, z: 2, type: 'crate' },
+ { id: '', x: 0, y: 0, z: 0 }, // no id
+ { id: 'b', x: NaN, y: 0, z: 0 }, // NaN position
+ { id: 'c', x: 0, y: 0, z: 0, scale: -3 }, // bad scale is normalised
+ 'nonsense',
+ ],
+ });
+ expect(objects.map((o) => o.id)).toEqual(['a', 'c']);
+ expect(objects[0]).toMatchObject({ kind: 'prop', yaw: 0, scale: 1, url: '' });
+ expect(objects[1].scale).toBe(1);
+ });
+
+ it('never throws on a malformed doc', () => {
+ expect(docObjects(null)).toEqual([]);
+ expect(docObjects({})).toEqual([]);
+ expect(docObjects({ objects: 'nope' })).toEqual([]);
+ });
+});
+
+describe('WorldBuildStore', () => {
+ beforeEach(() => { vi.useFakeTimers(); });
+ afterEach(() => { vi.useRealTimers(); });
+
+ it('loads a world doc and remembers its etag for the next write', async () => {
+ const fetchImpl = fakeFetch([jsonResponse(200, { doc: { objects: [] }, etag: 'v1', version: 3, ownerId: 'u1' })]);
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl });
+ const res = await store.load();
+ expect(res.error).toBeNull();
+ expect(store.etag).toBe('v1');
+ expect(store.version).toBe(3);
+ expect(store.ownerId).toBe('u1');
+ expect(fetchImpl.calls[0].url).toContain(`worldId=${encodeURIComponent(MINT)}`);
+ });
+
+ it('resolves with doc:null (never throws) when the read fails', async () => {
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl: fakeFetch([new Error('offline')]) });
+ const res = await store.load();
+ expect(res.doc).toBeNull();
+ expect(res.error).toBe('offline');
+ });
+
+ it('coalesces a burst of edits into one debounced write', async () => {
+ const fetchImpl = fakeFetch([jsonResponse(200, { etag: 'v2', version: 4 })]);
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl });
+ store.queueSave(() => ({ objects: [{ id: 'a' }] }));
+ store.queueSave(() => ({ objects: [{ id: 'a' }, { id: 'b' }] }));
+ store.queueSave(() => ({ objects: [{ id: 'a' }, { id: 'b' }, { id: 'c' }] }));
+ expect(fetchImpl).not.toHaveBeenCalled();
+ await vi.advanceTimersByTimeAsync(WORLD_SAVE_DEBOUNCE_MS + 1);
+ expect(fetchImpl).toHaveBeenCalledTimes(1);
+ // The LAST producer wins: the write carries the freshest state, not the first.
+ expect(fetchImpl.calls[0].body.doc.objects).toHaveLength(3);
+ expect(store.etag).toBe('v2');
+ });
+
+ it('sends the etag it read as ifMatch', async () => {
+ const fetchImpl = fakeFetch([
+ jsonResponse(200, { doc: null, etag: 'v9', version: 1 }),
+ jsonResponse(200, { etag: 'v10', version: 2 }),
+ ]);
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl });
+ await store.load();
+ store.queueSave(() => ({ objects: [] }));
+ await store.flush();
+ expect(fetchImpl.calls[1].body.ifMatch).toBe('v9');
+ });
+
+ it('merges rather than clobbers on a 409: re-reads, re-runs the producer, retries', async () => {
+ const fetchImpl = fakeFetch([
+ jsonResponse(409, { message: 'conflict' }),
+ jsonResponse(200, { doc: { objects: [{ id: 'theirs', x: 0, y: 0, z: 0 }] }, etag: 'v5', version: 7 }),
+ jsonResponse(200, { etag: 'v6', version: 8 }),
+ ]);
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl });
+ // A real merging producer: keep whatever the freshest doc holds, add ours.
+ store.queueSave((base) => ({ objects: [...docObjects(base), { id: 'mine', x: 1, y: 0, z: 1 }] }));
+ const outcome = await store.flush();
+ expect(outcome).toBe('ok');
+ const finalWrite = fetchImpl.calls[2].body.doc.objects.map((o) => o.id);
+ expect(finalWrite).toEqual(['theirs', 'mine']);
+ expect(fetchImpl.calls[2].body.ifMatch).toBe('v5');
+ });
+
+ it('treats a 401 as terminal, reports it once, and stops writing', async () => {
+ const onDenied = vi.fn();
+ const fetchImpl = fakeFetch([jsonResponse(401, { message: 'authentication required' })]);
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl, onDenied });
+ store.queueSave(() => ({ objects: [] }));
+ expect(await store.flush()).toBe('denied');
+ expect(onDenied).toHaveBeenCalledWith(expect.objectContaining({ reason: 'signin', status: 401 }));
+ expect(store.writable).toBe(false);
+ // Further edits must not queue another doomed request.
+ store.queueSave(() => ({ objects: [{ id: 'x' }] }));
+ await vi.advanceTimersByTimeAsync(WORLD_SAVE_DEBOUNCE_MS + 1);
+ expect(fetchImpl).toHaveBeenCalledTimes(1);
+ });
+
+ it('reports a 403 as an ownership refusal, not a sign-in prompt', async () => {
+ const onDenied = vi.fn();
+ const store = new WorldBuildStore({
+ worldId: MINT, onDenied,
+ fetchImpl: fakeFetch([jsonResponse(403, { message: 'not permitted' })]),
+ });
+ store.queueSave(() => ({ objects: [] }));
+ await store.flush();
+ expect(onDenied).toHaveBeenCalledWith(expect.objectContaining({ reason: 'owner', status: 403 }));
+ });
+
+ it('surfaces a 413 as a size error without going terminal', async () => {
+ const onError = vi.fn();
+ const store = new WorldBuildStore({
+ worldId: MINT, onError,
+ fetchImpl: fakeFetch([jsonResponse(413, { message: 'too large' })]),
+ });
+ store.queueSave(() => ({ objects: [] }));
+ expect(await store.flush()).toBe('too_large');
+ expect(onError).toHaveBeenCalledWith(expect.objectContaining({ reason: 'too_large' }));
+ expect(store.writable).toBe(true);
+ });
+
+ it('writes nothing while disarmed — the authoritative room owns the doc', async () => {
+ const fetchImpl = fakeFetch([]);
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl });
+ store.setArmed(false);
+ store.queueSave(() => ({ objects: [{ id: 'a' }] }));
+ await vi.advanceTimersByTimeAsync(WORLD_SAVE_DEBOUNCE_MS * 2);
+ expect(await store.flush()).toBe('idle');
+ expect(fetchImpl).not.toHaveBeenCalled();
+ });
+
+ it('drops a pending debounce when the room takes over mid-burst', async () => {
+ const fetchImpl = fakeFetch([]);
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl });
+ store.queueSave(() => ({ objects: [{ id: 'a' }] }));
+ expect(store.pending).toBe(true);
+ store.setArmed(false);
+ await vi.advanceTimersByTimeAsync(WORLD_SAVE_DEBOUNCE_MS * 2);
+ expect(fetchImpl).not.toHaveBeenCalled();
+ });
+
+ it('does not double-post when flush races the debounce timer', async () => {
+ const fetchImpl = fakeFetch([jsonResponse(200, { etag: 'v2', version: 2 })]);
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl });
+ store.queueSave(() => ({ objects: [] }));
+ const [a, b] = await Promise.all([store.flush(), store.flush()]);
+ expect([a, b]).toEqual(['ok', 'ok']);
+ expect(fetchImpl).toHaveBeenCalledTimes(1);
+ });
+
+ it('stops writing after dispose', async () => {
+ const fetchImpl = fakeFetch([]);
+ const store = new WorldBuildStore({ worldId: MINT, fetchImpl });
+ store.queueSave(() => ({ objects: [] }));
+ store.dispose();
+ await vi.advanceTimersByTimeAsync(WORLD_SAVE_DEBOUNCE_MS * 2);
+ expect(fetchImpl).not.toHaveBeenCalled();
+ });
+});
diff --git a/vercel.json b/vercel.json
index cc6de3575..ff2f9a25b 100644
--- a/vercel.json
+++ b/vercel.json
@@ -882,6 +882,10 @@
"src": "/receipts/?",
"dest": "/receipts.html"
},
+ {
+ "src": "/fits/?",
+ "dest": "/fits.html"
+ },
{
"src": "/deployments/?",
"dest": "/deployments.html"
@@ -3841,7 +3845,7 @@
"src": "/avatar-edit/?",
"status": 301,
"headers": {
- "Location": "/avatars"
+ "Location": "/dashboard/avatars"
}
},
{
diff --git a/vite.config.js b/vite.config.js
index 78b6e5d7f..8b8050628 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -416,7 +416,6 @@ const appConfig = {
'create-selfie': resolve(__dirname, 'pages/create-selfie.html'),
'create-prompt': resolve(__dirname, 'pages/create-prompt.html'),
genesis: resolve(__dirname, 'pages/genesis.html'),
- scan: resolve(__dirname, 'pages/scan.html'),
worlds: resolve(__dirname, 'pages/worlds.html'),
'avatar-studio': resolve(__dirname, 'pages/avatar-studio.html'),
'create-review': resolve(__dirname, 'pages/create-review.html'),
@@ -455,6 +454,7 @@ const appConfig = {
diorama: resolve(__dirname, 'pages/diorama.html'),
'x402-revenue': resolve(__dirname, 'pages/x402-revenue.html'),
receipts: resolve(__dirname, 'pages/receipts.html'),
+ fits: resolve(__dirname, 'pages/fits.html'),
viability: resolve(__dirname, 'pages/viability.html'),
deployments: resolve(__dirname, 'pages/deployments.html'),
'admin-launcher': resolve(__dirname, 'pages/admin/launcher.html'),
@@ -984,8 +984,6 @@ support: resolve(__dirname, 'pages/support.html'),
'/embed/walk/': resolve(root, 'pages/embed-walk.html'),
'/paywall': resolve(root, 'public/paywall.html'),
'/paywall/': resolve(root, 'public/paywall.html'),
- '/scan': resolve(root, 'pages/scan.html'),
- '/scan/': resolve(root, 'pages/scan.html'),
'/image-to-3d': resolve(root, 'pages/forge.html'),
'/image-to-3d/': resolve(root, 'pages/forge.html'),
'/forge-max': resolve(root, 'pages/forge.html'),
@@ -1079,6 +1077,8 @@ support: resolve(__dirname, 'pages/support.html'),
'/x402-revenue/': resolve(root, 'pages/x402-revenue.html'),
'/receipts': resolve(root, 'pages/receipts.html'),
'/receipts/': resolve(root, 'pages/receipts.html'),
+ '/fits': resolve(root, 'pages/fits.html'),
+ '/fits/': resolve(root, 'pages/fits.html'),
'/viability': resolve(root, 'pages/viability.html'),
'/viability/': resolve(root, 'pages/viability.html'),
'/deployments': resolve(root, 'pages/deployments.html'),
@@ -1382,7 +1382,6 @@ support: resolve(__dirname, 'pages/support.html'),
'/tracker/': resolve(root, 'pages/tracker.html'),
'/features': resolve(root, 'pages/features.html'),
'/features/': resolve(root, 'pages/features.html'),
- '/agent/new': resolve(root, 'pages/agent-edit.html'),
'/docs': resolve(root, 'docs/index.html'),
'/docs/': resolve(root, 'docs/index.html'),
'/bazaar': resolve(root, 'public/bazaar.html'),
@@ -1434,6 +1433,7 @@ support: resolve(__dirname, 'pages/support.html'),
)
return next();
const path = url.split('?')[0];
+ let filePath;
// /api/* is handled by the http proxy in server.proxy above —
// the middleware must not intercept those requests.
if (dirRoutes.has(path)) {
@@ -1468,6 +1468,36 @@ support: resolve(__dirname, 'pages/support.html'),
res.setHeader('Location', '/studio');
return res.end();
}
+ // Creation-surface consolidation (prompts/roadmap/creation-consolidation.md
+ // Phase 2). Each of these mirrors a vercel.json rule so dev matches prod.
+ //
+ // C1: /scan merged into /create/selfie — the selfie flow owns both the
+ // live-camera and the upload input, so the scanner URL is retired.
+ if (path === '/scan' || path === '/scan/') {
+ res.statusCode = 301;
+ res.setHeader('Location', '/create/selfie');
+ return res.end();
+ }
+ // C2: /agent/new → /create-agent. A request carrying the avatar handoff
+ // params is REWRITTEN (not redirected) so the wizard still receives
+ // them; src/create-agent.js consumes them and canonicalises the URL.
+ if (path === '/agent/new' || path === '/agent/new/') {
+ const q = url.slice(path.length);
+ if (/[?&]avatar_(id|glb)=/.test(q)) {
+ filePath = resolve(root, 'pages/create-agent.html');
+ } else {
+ res.statusCode = 301;
+ res.setHeader('Location', '/create-agent');
+ return res.end();
+ }
+ }
+ // C4: the standalone /avatar-edit landing is retired — the editor is
+ // only reachable in-flow at /avatars/:id/edit (or the legacy ?id= form).
+ if ((path === '/avatar-edit' || path === '/avatar-edit/') && !/[?&]id=/.test(url)) {
+ res.statusCode = 301;
+ res.setHeader('Location', '/dashboard/avatars');
+ return res.end();
+ }
// Bare /agent 301s to the agents directory in prod (vercel.json);
// the standalone agent token page lives at /agent/index.html. Mirror
// the redirect so dev matches prod instead of 404ing.
@@ -1517,7 +1547,7 @@ support: resolve(__dirname, 'pages/support.html'),
res.setHeader('Location', dest);
return res.end();
}
- let filePath = fileMap[path];
+ if (!filePath) filePath = fileMap[path];
// /blog/<slug> → resolves to blog/<slug>.html on disk
if (!filePath && /^\/blog\/[a-z0-9-]+\/?$/.test(path)) {
const slug = path.replace(/^\/blog\//, '').replace(/\/$/, '');