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.

Add hidden-guard tooling, account tier tests, and site-wide page updates

nirholasd1cc197ec0e6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3079cabf2..d65a8cb8e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -56,6 +56,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Imported avatars now animate with correct arm and leg orientation** — Animations are authored on one reference rig and retargeted onto whatever avatar you bring — Mixamo, Ready Player Me, VRoid, and more. We found that limbs on those rigs could play roughly 30° off from where they should be, because the retarget replayed each joint's motion in the wrong frame when a rig's rest pose differed from ours. The retarget now preserves each joint's true world-space motion, so idle, walk, and every other clip drive a foreign rig's arms and legs the way they were animated. Avatars matching the reference rig are byte-for-byte unchanged. `[fix, improvement]`
- **Launch-and-snipe: atomic dev buy at token launch** — Atomic pump.fun launches can now include a first buy in the very same transaction that creates the token. The creator's buy lands in the same block as the mint — inside one Jito bundle — so no external sniper can wedge in ahead of the floor. Set a buy size and slippage; the funder covers it on top of rent, and the same spend caps apply. `[feature]`
- **Live market feed stays up through provider blips** — The trending-tokens feed that powers the home card, communities, the token constellation, and the 3D visualizer is now resilient to upstream outages. If a market data provider goes down or rate-limits us, we transparently fall back to a second source; if both are briefly unavailable, the surfaces keep showing the last good data (clearly marked as a moment stale) instead of going blank. We also added a fast-fail circuit breaker so a slow provider can't drag the feed down during a traffic spike. Net effect: the live market views stay populated and snappy even when a data provider hiccups. `[infra, improvement]`
+- **Membership tiers: see your mode on your member card** — Your dashboard membership card now shows your tier — User, Beta, Pro, Holder, or Three Dimensional. A new panel on the Referrals page lays out the full ladder: which modes you already hold, and exactly what unlocks the rest. Holder is detected live from the $THREE you hold across any linked Solana wallet (hold more to climb the Bronze→Genesis ladder), Pro comes with a paid plan, and Beta and Three Dimensional are granted by the team. Everyone starts as a User with full free-forever access. (`/dashboard/referrals`) `[feature]`
- **More reliable on-chain transactions across the platform** — Every on-chain action that moves funds — agent transfers, token launches, buys and sells, creator-fee claims, club and lottery payouts, buybacks, and skill purchases — now goes through one hardened sender. It estimates the right priority fee, automatically re-broadcasts your transaction with a fresh blockhash until it actually lands instead of giving up after one try, and treats a transaction that reverts on-chain as a clear failure rather than a silent success. In practice that means far fewer 'stuck' or dropped transactions when the network is busy, and an honest error (with your funds untouched) when something genuinely can't go through. Nothing to do on your end. `[improvement, fix, infra]`
- **My Collection page now loads** — The /collection page — where your unlocked skills and active subscriptions live — was returning a 404 because its route pointed at the wrong build path, and its subscriptions list was calling an endpoint that rejected the request. Both are fixed: the page loads, your purchased skills and NFT receipts render, and the Subscriptions tab now shows your active creator subscriptions with plan, price, renewal date, and a link to each creator. The marketplace analytics page had the same routing fault and now loads too. (`/collection`) `[fix]`
- **Nav now points straight to your Dashboard** — Once you're signed in, the site navigation now shows a single 'Dashboard' entry that takes you to your full console — wallets, agents, portfolio, usage and more — instead of the narrower 'My Agents' link. One clear door to everything you manage on three.ws. (`/dashboard`) `[improvement]`
@@ -72,6 +73,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Pole Club: every dancer stands on her stage** — Fixed a dancer who sank through her platform instead of standing on it. Avatars exported at centimetre scale (common for Mixamo-rigged characters) had their idle motion collapse, dropping them a metre into the floor. The animation engine now scales each dancer's footing to her own rig, so any avatar you pick stands cleanly at her pole. (`/club`) `[fix]`
- **Pole Club: tipping now works with the built-in three.ws wallet** — Tipping a dancer in the Pole Club opens an on-chain payment for $0.001 USDC. On Solana Mobile (Seeker), the payment window only recognized browser extensions like Phantom, so anyone using the three.ws wallet saw a checkout that couldn't be completed — the window opened but the pay button was greyed out. The checkout now recognizes the three.ws wallet (and Backpack and Solflare) the same way the rest of the site does, and names whichever wallet you're using throughout the flow, so tips go through. (`/club`) `[fix]`
- **Profiles you can edit — and follow** — Your three.ws profile at three.ws/u/<your-username> is now a real social home. Edit it in place: add a bio, a profile picture and banner image, your location, and a website link — all from an Edit button on your own profile. You can now follow other creators and agents, and they can follow you; every profile shows live follower and following counts you can tap to browse the lists, with one-tap follow buttons throughout. And there's a new Feed at three.ws/feed that gathers the latest avatars, agents, and coin launches from everyone you follow, newest first. Find your profile and Feed links from your account page. (`/feed`) `[feature]`
+- **Profiles: a storefront for what you sell, and fork any agent** — Your profile now has a For sale tab that gathers every avatar, agent, and plugin you've priced into one storefront — each card shows the asking price and links straight to its purchase page. And published agents now carry a Fork button, so anyone can clone an agent (its prompt, skills, and settings) into their own account in one tap, with a running fork count on every card. `[feature]`
- **Profiles: your whole on-chain self in one place** — Your profile at three.ws/u/<username> now shows everything you make and own. New Collectibles and Accessories tabs surface the NFTs held across your wallets — 3D NFTs rotate live right in the grid — and the premium avatar items you've bought. Your linked wallets appear as chain-tagged chips with one-tap copy and a block-explorer link, spanning both Solana and EVM. Every avatar now has a Fork button so anyone can save a copy of it (and its agent) to their own account, with a running fork count on each card. And a new Share menu lets you post your profile straight to X or share it through your phone's native share sheet, alongside copy-link. `[feature]`
- **Provably-fair vanity grinder now listed in the x402 bazaar** — The provably-fair Solana vanity grinder — which returns a signed, independently-verifiable receipt proving the key was ground fresh and never kept — is now published in the x402 discovery catalog, so paying agents and bazaar crawlers can find and call it directly. (`/vanity/verify`) `[feature, sdk]`
- **Referrals: claim a custom code that's yours** — Your referral code now starts as your name instead of a random string — and you can change it to anything you like. Open Referrals in your dashboard, hit Customize, and pick a code (3–20 letters or numbers); it checks availability as you type and updates your shareable link, QR, and membership card the moment you save. Existing links keep working, codes are matched case-insensitively, and you still earn 5% in USDC on every referred purchase. (`/dashboard/referrals`) `[feature]`
diff --git a/api/admin/user/[id].js b/api/admin/user/[id].js
index d6e98a683..0180b05a8 100644
--- a/api/admin/user/[id].js
+++ b/api/admin/user/[id].js
@@ -13,6 +13,10 @@ const patchSchema = z
plan: z.enum(['free', 'pro', 'team', 'enterprise']).optional(),
is_admin: z.boolean().optional(),
deleted: z.boolean().optional(),
+ // Account tier ("mode") grant. null / 'none' clears it to the default
+ // 'user' tier; 'holder' is derived on-chain and isn't grantable here.
+ // See api/_lib/account-tier.js.
+ account_tier: z.enum(['beta', 'pro', 'three-dimensional', 'none']).nullable().optional(),
})
.refine((d) => Object.keys(d).length > 0, { message: 'nothing to update' });
@@ -34,7 +38,7 @@ export default wrap(async (req, res) => {
if (req.method === 'GET') {
const [user] = await sql`
select
- u.id, u.email, u.display_name, u.plan, u.is_admin,
+ u.id, u.email, u.display_name, u.plan, u.is_admin, u.account_tier,
u.wallet_address, u.email_verified, u.created_at, u.updated_at, u.deleted_at,
(
select json_agg(json_build_object(
@@ -68,6 +72,13 @@ export default wrap(async (req, res) => {
params.push(body.is_admin);
setFrags.push(`is_admin = $${params.length}`);
}
+ if (body.account_tier !== undefined) {
+ // 'none' / null clears the grant; the resolver treats NULL as the default
+ // 'user' tier.
+ const grant = body.account_tier && body.account_tier !== 'none' ? body.account_tier : null;
+ params.push(grant);
+ setFrags.push(`account_tier = $${params.length}`);
+ }
if (body.deleted !== undefined) {
if (body.deleted) {
setFrags.push(`deleted_at = now()`);
@@ -85,7 +96,7 @@ export default wrap(async (req, res) => {
`
update users set ${setFrags.join(', ')}
where id = $${idIdx}
- returning id, email, display_name, plan, is_admin, deleted_at
+ returning id, email, display_name, plan, is_admin, account_tier, deleted_at
`,
params,
);
diff --git a/api/users/[username].js b/api/users/[username].js
index 3e3bc013c..e325ce989 100644
--- a/api/users/[username].js
+++ b/api/users/[username].js
@@ -243,9 +243,7 @@ export default wrap(async (req, res) => {
? `/avatars/${r.item_id}`
: isAgent
? `/agent/${r.item_id}`
- : r.plugin_identifier
- ? `/plugins#${r.plugin_identifier}`
- : '/plugins';
+ : '/marketplace';
const decimals = Number(r.mint_decimals || 0);
const price = Number(r.amount || 0) / 10 ** decimals;
return {
diff --git a/data/changelog.json b/data/changelog.json
index c3a67fae9..d1031cebf 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,19 @@
{
"$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-06-21",
+ "title": "Membership tiers: see your mode on your member card",
+ "summary": "Your dashboard membership card now shows your tier — User, Beta, Pro, Holder, or Three Dimensional. A new panel on the Referrals page lays out the full ladder: which modes you already hold, and exactly what unlocks the rest. Holder is detected live from the $THREE you hold across any linked Solana wallet (hold more to climb the Bronze→Genesis ladder), Pro comes with a paid plan, and Beta and Three Dimensional are granted by the team. Everyone starts as a User with full free-forever access.",
+ "tags": ["feature"],
+ "link": "/dashboard/referrals"
+ },
+ {
+ "date": "2026-06-21",
+ "title": "Profiles: a storefront for what you sell, and fork any agent",
+ "summary": "Your profile now has a For sale tab that gathers every avatar, agent, and plugin you've priced into one storefront — each card shows the asking price and links straight to its purchase page. And published agents now carry a Fork button, so anyone can clone an agent (its prompt, skills, and settings) into their own account in one tap, with a running fork count on every card.",
+ "tags": ["feature"]
+ },
{
"date": "2026-06-21",
"title": "Referrals: claim a custom code that's yours",
diff --git a/package.json b/package.json
index b82e82b6c..d50c5e7f7 100644
--- a/package.json
+++ b/package.json
@@ -95,11 +95,13 @@
"test:mcp": "node scripts/test-mcp-all.mjs",
"audit:pages": "node scripts/audit-page-index.mjs",
"audit:handlers": "node scripts/audit-empty-handlers.mjs",
+ "audit:hidden-guard": "node scripts/audit-hidden-guard.mjs",
+ "guard:hidden": "node scripts/inject-hidden-guard.mjs --write",
"check:images": "node scripts/audit-image-loading.mjs --strict",
"audit:web": "node scripts/page-audit.mjs",
"snapshot": "node scripts/page-snapshot.mjs",
"build:news": "node scripts/build-news.mjs",
- "prebuild": "(node scripts/build-news.mjs & node scripts/build-skill-metadata.mjs & node scripts/build-local-skill-packs.mjs & npm run build:club-assets & npm run build:walk-environments & wait) && node scripts/inject-blog-seo.mjs --write && (node scripts/build-page-index.mjs && node scripts/audit-page-index.mjs --strict && node scripts/audit-empty-handlers.mjs) && node scripts/inject-seo-meta.mjs --write && node scripts/inject-theme-boot.mjs --write",
+ "prebuild": "(node scripts/build-news.mjs & node scripts/build-skill-metadata.mjs & node scripts/build-local-skill-packs.mjs & npm run build:club-assets & npm run build:walk-environments & wait) && node scripts/inject-blog-seo.mjs --write && node scripts/inject-hidden-guard.mjs --write && (node scripts/build-page-index.mjs && node scripts/audit-page-index.mjs --strict && node scripts/audit-empty-handlers.mjs && node scripts/audit-hidden-guard.mjs) && node scripts/inject-seo-meta.mjs --write && node scripts/inject-theme-boot.mjs --write",
"seo:meta": "node scripts/inject-blog-seo.mjs --write && node scripts/build-page-index.mjs && node scripts/inject-seo-meta.mjs --write",
"build": "NODE_OPTIONS='--no-deprecation --max-old-space-size=6144' vite build && node scripts/strip-sw-from-embeds.mjs",
"build:wasm": "PATH=\"$HOME/.cargo/bin:$PATH\" RUSTFLAGS='-C target-feature=+simd128' wasm-pack build crates/vanity-grinder --target web --release --out-dir ../../src/solana/vanity/wasm && printf '%s\\n' '# wasm-pack writes a default `*` gitignore that excludes everything.' '# Override it: the generated files in this directory ARE checked in so the' '# app builds without requiring a Rust toolchain at install time. Run' '# `npm run build:wasm` after editing /crates/vanity-grinder/src/lib.rs to' '# refresh these artifacts.' '!*' > src/solana/vanity/wasm/.gitignore",
diff --git a/pages/a-embed.html b/pages/a-embed.html
index 71054046e..0adad2030 100644
--- a/pages/a-embed.html
+++ b/pages/a-embed.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
diff --git a/pages/a-me.html b/pages/a-me.html
index 44d82a45f..5308c9eef 100644
--- a/pages/a-me.html
+++ b/pages/a-me.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/agenc/embodied.html b/pages/agenc/embodied.html
index e8cc8a997..a35f810cf 100644
--- a/pages/agenc/embodied.html
+++ b/pages/agenc/embodied.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>AgenC × three.ws — embodied agent demo</title>
diff --git a/pages/agenc/room.html b/pages/agenc/room.html
index 3261d65b3..63f0f41db 100644
--- a/pages/agenc/room.html
+++ b/pages/agenc/room.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>AgenC task room — three.ws</title>
diff --git a/pages/agent-economy.html b/pages/agent-economy.html
index a41d8211d..bcbae080a 100644
--- a/pages/agent-economy.html
+++ b/pages/agent-economy.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/agent-embed.html b/pages/agent-embed.html
index 5c84ee701..e53097dc7 100644
--- a/pages/agent-embed.html
+++ b/pages/agent-embed.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
diff --git a/pages/agent-trade.html b/pages/agent-trade.html
index 317cf7c12..9ea4927a2 100644
--- a/pages/agent-trade.html
+++ b/pages/agent-trade.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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">
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/ar.html b/pages/ar.html
index 2e66042a1..54450aadd 100644
--- a/pages/ar.html
+++ b/pages/ar.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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, viewport-fit=cover" />
diff --git a/pages/autopilot.html b/pages/autopilot.html
index b82a188eb..5273fbd77 100644
--- a/pages/autopilot.html
+++ b/pages/autopilot.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/avatar-embed.html b/pages/avatar-embed.html
index 476bb6cd7..dd7adefe4 100644
--- a/pages/avatar-embed.html
+++ b/pages/avatar-embed.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
diff --git a/pages/avatar-wallet-chat.html b/pages/avatar-wallet-chat.html
index 6a44e350f..dc12b9f9e 100644
--- a/pages/avatar-wallet-chat.html
+++ b/pages/avatar-wallet-chat.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/aws-marketplace/welcome.html b/pages/aws-marketplace/welcome.html
index 6a0761dc9..bb47a85f8 100644
--- a/pages/aws-marketplace/welcome.html
+++ b/pages/aws-marketplace/welcome.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Welcome to three.ws · AWS Marketplace</title>
diff --git a/pages/aws/index.html b/pages/aws/index.html
index 250501bfa..74784e5db 100644
--- a/pages/aws/index.html
+++ b/pages/aws/index.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>three.ws on AWS — 3D AI Agent Platform · AWS Partner</title>
diff --git a/pages/bounties.html b/pages/bounties.html
index 9ac0da133..39a4bf8d4 100644
--- a/pages/bounties.html
+++ b/pages/bounties.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/bounty.html b/pages/bounty.html
index e90897c69..0b1220d9b 100644
--- a/pages/bounty.html
+++ b/pages/bounty.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/bulk-launch.html b/pages/bulk-launch.html
index 68f11b535..0c482d289 100644
--- a/pages/bulk-launch.html
+++ b/pages/bulk-launch.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/city.html b/pages/city.html
index edb560706..4cc76fed0 100644
--- a/pages/city.html
+++ b/pages/city.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
<meta charset="utf-8" />
<title>City · three.ws</title>
diff --git a/pages/coin3d.html b/pages/coin3d.html
index ca8724b1a..fe849dff3 100644
--- a/pages/coin3d.html
+++ b/pages/coin3d.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/collection.html b/pages/collection.html
index 199f1ae44..bda203008 100644
--- a/pages/collection.html
+++ b/pages/collection.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<script>/* three.ws theme boot */(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" />
diff --git a/pages/communities.html b/pages/communities.html
index ad1138960..5e8e530e2 100644
--- a/pages/communities.html
+++ b/pages/communities.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/constellation.html b/pages/constellation.html
index f2ddb1b43..65174400d 100644
--- a/pages/constellation.html
+++ b/pages/constellation.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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,viewport-fit=cover" />
diff --git a/pages/create-character.html b/pages/create-character.html
index d4567ecb9..7246d419e 100644
--- a/pages/create-character.html
+++ b/pages/create-character.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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, maximum-scale=1, viewport-fit=cover" />
diff --git a/pages/create-next.html b/pages/create-next.html
index 7044fa69b..2724f31b0 100644
--- a/pages/create-next.html
+++ b/pages/create-next.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<script>/* three.ws theme boot — no-flash */(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, viewport-fit=cover" />
diff --git a/pages/create-prompt.html b/pages/create-prompt.html
index e39681e6e..37354b495 100644
--- a/pages/create-prompt.html
+++ b/pages/create-prompt.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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, maximum-scale=1" />
diff --git a/pages/demo-economy.html b/pages/demo-economy.html
index cc08bbeec..67b522bc0 100644
--- a/pages/demo-economy.html
+++ b/pages/demo-economy.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/embed-demo.html b/pages/embed-demo.html
index 73cc449f1..6eef35080 100644
--- a/pages/embed-demo.html
+++ b/pages/embed-demo.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
diff --git a/pages/embed-walk.html b/pages/embed-walk.html
index e3aa1906c..449934880 100644
--- a/pages/embed-walk.html
+++ b/pages/embed-walk.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Walk Avatar Embed Generator · three.ws</title>
diff --git a/pages/embed.html b/pages/embed.html
index a859a5536..1a1dbfccd 100644
--- a/pages/embed.html
+++ b/pages/embed.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" sizes="any" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
diff --git a/pages/fact-checker.html b/pages/fact-checker.html
index 6d10d5410..13e6ae1ef 100644
--- a/pages/fact-checker.html
+++ b/pages/fact-checker.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/go.html b/pages/go.html
index 09c33e7ff..92c8741df 100644
--- a/pages/go.html
+++ b/pages/go.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/ibm/x402-demo.html b/pages/ibm/x402-demo.html
index 79f3d441a..47a7aa385 100644
--- a/pages/ibm/x402-demo.html
+++ b/pages/ibm/x402-demo.html
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="color-scheme" content="light dark">
diff --git a/pages/import-rpm.html b/pages/import-rpm.html
index 67938e5f7..3773113d4 100644
--- a/pages/import-rpm.html
+++ b/pages/import-rpm.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
<meta charset="utf-8" />
<title>Import Your 3D Avatar · three.ws</title>
diff --git a/pages/launchpad.html b/pages/launchpad.html
index 275a3a255..648831597 100644
--- a/pages/launchpad.html
+++ b/pages/launchpad.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/live.html b/pages/live.html
index 32922294b..ab2ba8e99 100644
--- a/pages/live.html
+++ b/pages/live.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/marketplace-analytics.html b/pages/marketplace-analytics.html
index 6490ca4b7..71b1ef301 100644
--- a/pages/marketplace-analytics.html
+++ b/pages/marketplace-analytics.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<script>/* three.ws theme boot */(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" />
diff --git a/pages/mint-success.html b/pages/mint-success.html
index fa6f57ca6..6df8e6c6f 100644
--- a/pages/mint-success.html
+++ b/pages/mint-success.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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, viewport-fit=cover" />
diff --git a/pages/overlay-control.html b/pages/overlay-control.html
index b98aedbb3..a2bc70a6b 100644
--- a/pages/overlay-control.html
+++ b/pages/overlay-control.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
<meta charset="utf-8" />
<title>Overlay Control · three.ws</title>
diff --git a/pages/play/agent-wallet.html b/pages/play/agent-wallet.html
index 2b79eabee..27d44f026 100644
--- a/pages/play/agent-wallet.html
+++ b/pages/play/agent-wallet.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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,viewport-fit=cover" />
diff --git a/pages/play/arena.html b/pages/play/arena.html
index 6f38628cf..aed804e39 100644
--- a/pages/play/arena.html
+++ b/pages/play/arena.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en" data-theme="dark">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, maximum-scale=1" />
<title>Sniper Arena — a live 3D world of AI agents trading pump.fun · three.ws</title>
diff --git a/pages/play/ufo.html b/pages/play/ufo.html
index 8dbcc72b4..2b01b9708 100644
--- a/pages/play/ufo.html
+++ b/pages/play/ufo.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<script>/* three.ws theme boot */(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, viewport-fit=cover, maximum-scale=1" />
diff --git a/pages/shopper.html b/pages/shopper.html
index e823766b0..f94d0a22f 100644
--- a/pages/shopper.html
+++ b/pages/shopper.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/skills.html b/pages/skills.html
index 493d985d7..ad08c0d60 100644
--- a/pages/skills.html
+++ b/pages/skills.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/pages/start.html b/pages/start.html
index e9dccda40..24f8558af 100644
--- a/pages/start.html
+++ b/pages/start.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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, viewport-fit=cover" />
diff --git a/pages/support.html b/pages/support.html
index a3ec9673d..5a008c2c5 100644
--- a/pages/support.html
+++ b/pages/support.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/three-token.html b/pages/three-token.html
index 4a5e8ba8f..081648ff3 100644
--- a/pages/three-token.html
+++ b/pages/three-token.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/trending.html b/pages/trending.html
index 6521888ef..9f401a028 100644
--- a/pages/trending.html
+++ b/pages/trending.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<script>/* three.ws theme boot */(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, viewport-fit=cover" />
diff --git a/pages/unstoppable.html b/pages/unstoppable.html
index bae00e0d2..47b5276d5 100644
--- a/pages/unstoppable.html
+++ b/pages/unstoppable.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/pages/walk-embed.html b/pages/walk-embed.html
index 7dea7c580..319c6d5f4 100644
--- a/pages/walk-embed.html
+++ b/pages/walk-embed.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Walk Embed · three.ws</title>
diff --git a/pages/worlds.html b/pages/worlds.html
index adc353ea9..6b9d5d872 100644
--- a/pages/worlds.html
+++ b/pages/worlds.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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 http-equiv="X-UA-Compatible" content="IE=edge" />
diff --git a/pages/x-pricing.html b/pages/x-pricing.html
index 4d8a39172..5551aa2c1 100644
--- a/pages/x-pricing.html
+++ b/pages/x-pricing.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/public/brain-studio.css b/public/brain-studio.css
index edcb247c7..e8b432030 100644
--- a/public/brain-studio.css
+++ b/public/brain-studio.css
@@ -179,8 +179,12 @@ textarea.brainstudio__input { resize: vertical; }
.brainstudio__compose textarea:focus { outline: none; border-color: var(--accent); }
/* ── Modal (templates + behavior diff) ──────────────────────────────────── */
-.brainstudio__modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); padding: var(--space-md); }
-.brainstudio__modal[hidden] { display: none; }
+/* Resting state sets NO `display`, so the UA `[hidden]{display:none}` rule alone
+ * keeps the overlay collapsed — the component is correct even without the global
+ * guard in tokens.css. Visibility lives on `:not([hidden])`, applied only when
+ * _showTemplateModal()/_showBehavior() drop the attribute. */
+.brainstudio__modal { position: fixed; inset: 0; z-index: 1000; }
+.brainstudio__modal:not([hidden]) { display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); padding: var(--space-md); }
.brainstudio__modal-card { width: min(720px, 100%); max-height: 86vh; overflow: auto; background: var(--bg-1); border: 1px solid var(--surface-3); border-radius: var(--radius-lg); padding: var(--space-lg); }
.brainstudio__modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2xs); }
.brainstudio__modal-head h2 { margin: 0; font-size: var(--text-lg); color: var(--ink-bright); }
diff --git a/public/changelog.json b/public/changelog.json
index 4cfd8d583..ff92c4ca9 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-21T18:25:29.194Z",
+ "generated_at": "2026-06-21T18:33:13.627Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -528,6 +528,16 @@
"improvement"
]
},
+ {
+ "date": "2026-06-21",
+ "type": "update",
+ "title": "Membership tiers: see your mode on your member card",
+ "summary": "Your dashboard membership card now shows your tier — User, Beta, Pro, Holder, or Three Dimensional. A new panel on the Referrals page lays out the full ladder: which modes you already hold, and exactly what unlocks the rest. Holder is detected live from the $THREE you hold across any linked Solana wallet (hold more to climb the Bronze→Genesis ladder), Pro comes with a paid plan, and Beta and Three Dimensional are granted by the team. Everyone starts as a User with full free-forever access.",
+ "link": "/dashboard/referrals",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-06-21",
"type": "update",
@@ -695,6 +705,16 @@
"feature"
]
},
+ {
+ "date": "2026-06-21",
+ "type": "update",
+ "title": "Profiles: a storefront for what you sell, and fork any agent",
+ "summary": "Your profile now has a For sale tab that gathers every avatar, agent, and plugin you've priced into one storefront — each card shows the asking price and links straight to its purchase page. And published agents now carry a Fork button, so anyone can clone an agent (its prompt, skills, and settings) into their own account in one tap, with a running fork count on every card.",
+ "link": null,
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-06-21",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index feddd8f15..0a7363137 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -406,6 +406,14 @@
<category>infra</category>
<description>The trending-tokens feed that powers the home card, communities, the token constellation, and the 3D visualizer is now resilient to upstream outages. If a market data provider goes down or rate-limits us, we transparently fall back to a second source; if both are briefly unavailable, the surfaces keep showing the last good data (clearly marked as a moment stale) instead of going blank. We also added a fast-fail circuit breaker so a slow provider can't drag the feed down during a traffic spike. Net effect: the live market views stay populated and snappy even when a data provider hiccups.</description>
</item>
+ <item>
+ <title>Membership tiers: see your mode on your member card</title>
+ <link>https://three.ws/dashboard/referrals</link>
+ <guid isPermaLink="false">2026-06-21:Membership tiers: see your mode on your member card</guid>
+ <pubDate>Sun, 21 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Your dashboard membership card now shows your tier — User, Beta, Pro, Holder, or Three Dimensional. A new panel on the Referrals page lays out the full ladder: which modes you already hold, and exactly what unlocks the rest. Holder is detected live from the $THREE you hold across any linked Solana wallet (hold more to climb the Bronze→Genesis ladder), Pro comes with a paid plan, and Beta and Three Dimensional are granted by the team. Everyone starts as a User with full free-forever access.</description>
+ </item>
<item>
<title>More reliable on-chain transactions across the platform</title>
<link>https://three.ws/changelog</link>
@@ -534,6 +542,14 @@
<category>feature</category>
<description>Your three.ws profile at three.ws/u/&lt;your-username&gt; is now a real social home. Edit it in place: add a bio, a profile picture and banner image, your location, and a website link — all from an Edit button on your own profile. You can now follow other creators and agents, and they can follow you; every profile shows live follower and following counts you can tap to browse the lists, with one-tap follow buttons throughout. And there's a new Feed at three.ws/feed that gathers the latest avatars, agents, and coin launches from everyone you follow, newest first. Find your profile and Feed links from your account page.</description>
</item>
+ <item>
+ <title>Profiles: a storefront for what you sell, and fork any agent</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-21:Profiles: a storefront for what you sell, and fork any agent</guid>
+ <pubDate>Sun, 21 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Your profile now has a For sale tab that gathers every avatar, agent, and plugin you've priced into one storefront — each card shows the asking price and links straight to its purchase page. And published agents now carry a Fork button, so anyone can clone an agent (its prompt, skills, and settings) into their own account in one tap, with a running fork count on every card.</description>
+ </item>
<item>
<title>Profiles: your whole on-chain self in one place</title>
<link>https://three.ws/changelog</link>
diff --git a/public/features.json b/public/features.json
index 233778015..65e494a46 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-21T18:25:29.182Z",
+ "generated_at": "2026-06-21T18:33:13.608Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/paywall.html b/public/paywall.html
index b654ac890..211fca0b2 100644
--- a/public/paywall.html
+++ b/public/paywall.html
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
+ <style>/* three.ws hidden-guard — make the `hidden` attribute authoritative; see scripts/lib/hidden-guard.mjs */[hidden]{display:none!important}</style>
<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" />
diff --git a/public/tokens.css b/public/tokens.css
index 3c606cbb1..1020e364b 100644
--- a/public/tokens.css
+++ b/public/tokens.css
@@ -20,6 +20,27 @@
* Monochrome on near-black + golden-ratio (φ = 1.618) spacing & type.
******************************************************************************/
+/* ── Universal [hidden] guard ─────────────────────────────────────────────────
+ * The `hidden` HTML attribute hides an element via the UA rule `[hidden]{display:none}`.
+ * That rule has specificity (0,1,0) and loses to ANY component rule that sets
+ * `display` on a class/id (e.g. `.modal{display:grid}`) — at which point a `hidden`
+ * element renders anyway. A full-screen overlay authored that way then covers the
+ * page and swallows every click (this is exactly how the Brain Studio modal once
+ * blocked /agent-studio#brain).
+ *
+ * tokens.css is imported by BOTH style.css and nav.css, so it reaches every surface.
+ * Defining the guard here — with `!important` so it beats base-class `display` — makes
+ * `hidden` authoritative platform-wide. Components no longer depend on each page
+ * carrying its own copy. To SHOW a toggled element, remove the attribute (the
+ * intended API) or gate visibility on `:not([hidden])`; never lean on a bare
+ * `display` that a stray `hidden` can't override.
+ *
+ * Enforced by scripts/audit-hidden-guard.mjs (every page must resolve this guard)
+ * and tests/e2e/studio-overlay.spec.js (the studio stays click-through at rest). */
+[hidden] {
+ display: none !important;
+}
+
:root {
/* Phi ratio */
--phi: 1.618;
diff --git a/scripts/audit-hidden-guard.mjs b/scripts/audit-hidden-guard.mjs
new file mode 100644
index 000000000..d92dc4613
--- /dev/null
+++ b/scripts/audit-hidden-guard.mjs
@@ -0,0 +1,44 @@
+#!/usr/bin/env node
+/**
+ * Universal [hidden] guard audit — the VERIFIER half of the inject+audit pair.
+ *
+ * The `hidden` HTML attribute hides an element only while some CSS maps `[hidden]`
+ * to `display:none`. The UA default does that, but its specificity (0,1,0) loses
+ * to any component rule that sets `display` on a class/id (`.modal{display:grid}`),
+ * so a `hidden` element renders anyway. A full-screen overlay authored that way
+ * then covers the page and eats every click — exactly how the Brain Studio modal
+ * once blocked /agent-studio#brain (that page skipped style.css, which carries the
+ * global guard, and leaned on a fragile per-page inline copy).
+ *
+ * The canonical guard lives in public/tokens.css (imported by style.css and
+ * nav.css, so it reaches every page that links any shared stylesheet); pages that
+ * link none are stamped with an inline copy by scripts/inject-hidden-guard.mjs.
+ * This audit fails the build if any product page still fails to RESOLVE a guard —
+ * via a linked stylesheet (directly or through @import), an inline <style>, or the
+ * injector's marker. It is self-validating: tokens/style/nav are checked through
+ * the same resolver, so deleting the guard from tokens.css fails this audit too.
+ *
+ * Usage:
+ * node scripts/audit-hidden-guard.mjs # exit 1 if any page is unguarded
+ * node scripts/audit-hidden-guard.mjs --strict # same; explicit for prebuild parity
+ */
+import { relative } from 'node:path';
+import { ROOT, collectPages, pageIsGuarded } from './lib/hidden-guard.mjs';
+
+const pages = collectPages();
+const offenders = pages.filter((p) => !pageIsGuarded(p)).map((p) => relative(ROOT, p));
+
+if (offenders.length) {
+ console.error(`\n✗ ${offenders.length} page(s) do not resolve a [hidden]{display:none} guard:\n`);
+ for (const rel of offenders) console.error(` ${rel}`);
+ console.error(
+ '\nEvery page must guarantee the `hidden` attribute actually hides — otherwise a\n' +
+ 'component that sets `display` on a class/id (e.g. a full-screen modal) renders\n' +
+ 'on top of the page and blocks all interaction. Run\n' +
+ ' node scripts/inject-hidden-guard.mjs --write\n' +
+ 'to stamp the inline guard, or link /tokens.css, /style.css, or /nav.css.\n',
+ );
+ process.exit(1);
+}
+
+console.log(`✓ audit-hidden-guard: all ${pages.length} pages resolve the [hidden] guard`);
diff --git a/scripts/inject-hidden-guard.mjs b/scripts/inject-hidden-guard.mjs
new file mode 100644
index 000000000..9cfd9650e
--- /dev/null
+++ b/scripts/inject-hidden-guard.mjs
@@ -0,0 +1,65 @@
+#!/usr/bin/env node
+/**
+ * Universal [hidden] guard injector — the WRITER half of the inject+audit pair.
+ *
+ * Most pages get the guard for free: public/tokens.css carries
+ * `[hidden]{display:none!important}` and is imported by style.css and nav.css, so
+ * any page linking a shared stylesheet resolves it. A minority link only
+ * page-specific CSS and rely on the UA `[hidden]` default — which silently breaks
+ * the moment a component sets `display` on a class/id (the Brain Studio modal that
+ * covered /agent-studio#brain was this exact failure). This step stamps a tiny
+ * inline guard into the <head> of every product page that does NOT already resolve
+ * one, so `hidden` is authoritative everywhere regardless of which CSS a page loads.
+ *
+ * Safe by construction: the rule only collapses elements that carry the `hidden`
+ * attribute (i.e. ones already meant to be off), and it matches the global guard
+ * style.css has shipped for the rest of the site for years.
+ *
+ * Idempotent: pages that already resolve a guard (shared stylesheet, prior inline
+ * rule, or this injector's marker) are left untouched.
+ *
+ * Usage:
+ * node scripts/inject-hidden-guard.mjs # report what would change
+ * node scripts/inject-hidden-guard.mjs --write # apply
+ */
+import { readFileSync, writeFileSync } from 'node:fs';
+import { relative } from 'node:path';
+import { ROOT, collectPages, pageIsGuarded, INLINE_GUARD } from './lib/hidden-guard.mjs';
+
+const write = process.argv.includes('--write');
+
+/** Insert the inline guard right after the opening <head> tag, matching its indent. */
+function injectGuard(html) {
+ const headOpen = html.match(/<head\b[^>]*>/i);
+ if (!headOpen) return { html, changed: false };
+ const at = headOpen.index + headOpen[0].length;
+ const lineStart = html.lastIndexOf('\n', headOpen.index) + 1;
+ const indent = html.slice(lineStart, headOpen.index).match(/^[\t ]*/)[0] + '\t';
+ return { html: html.slice(0, at) + `\n${indent}${INLINE_GUARD}` + html.slice(at), changed: true };
+}
+
+const changed = [];
+const skippedNoHead = [];
+
+for (const path of collectPages()) {
+ if (pageIsGuarded(path)) continue;
+ const orig = readFileSync(path, 'utf8');
+ const { html, changed: didChange } = injectGuard(orig);
+ if (!didChange) { skippedNoHead.push(relative(ROOT, path)); continue; }
+ changed.push(relative(ROOT, path));
+ if (write) writeFileSync(path, html);
+}
+
+if (skippedNoHead.length) {
+ console.warn(`⚠ ${skippedNoHead.length} unguarded page(s) have no <head> to stamp:`);
+ for (const rel of skippedNoHead) console.warn(` ${rel}`);
+}
+
+if (!changed.length) {
+ console.log('✓ inject-hidden-guard: every page already resolves the [hidden] guard');
+} else if (write) {
+ console.log(`✓ inject-hidden-guard: stamped the inline guard into ${changed.length} page(s)`);
+} else {
+ console.log(`inject-hidden-guard: ${changed.length} page(s) would be stamped (run with --write):`);
+ for (const rel of changed) console.log(` ${rel}`);
+}
diff --git a/scripts/lib/hidden-guard.mjs b/scripts/lib/hidden-guard.mjs
new file mode 100644
index 000000000..6462ea6e4
--- /dev/null
+++ b/scripts/lib/hidden-guard.mjs
@@ -0,0 +1,109 @@
+/**
+ * Shared logic for the universal [hidden] guard — used by both the injector
+ * (scripts/inject-hidden-guard.mjs, the writer) and the audit
+ * (scripts/audit-hidden-guard.mjs, the verifier).
+ *
+ * Background: the `hidden` HTML attribute hides an element only while some CSS
+ * maps `[hidden]` to `display:none`. The UA rule does that but its specificity
+ * (0,1,0) loses to any component rule that sets `display` on a class/id
+ * (`.modal{display:grid}`) — so a `hidden` element renders anyway. A full-screen
+ * overlay authored that way then covers the page and blocks every click (this is
+ * how the Brain Studio modal once broke /agent-studio#brain). The platform's
+ * canonical guard lives in public/tokens.css (imported by style.css and nav.css),
+ * and every page must resolve it; pages that link neither get an inline copy.
+ */
+import { readFileSync, readdirSync, existsSync } from 'node:fs';
+import { resolve, dirname, join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+export const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..', '..');
+const PAGES_DIR = resolve(ROOT, 'pages');
+const PUBLIC_DIR = resolve(ROOT, 'public');
+
+// A rule that makes `hidden` collapse: `[hidden] … { … display: none … }`.
+// Tolerant of whitespace, `!important`, and combined selectors (`a[hidden], b`).
+export const GUARD_RE = /\[hidden\][^{]*\{[^}]*display\s*:\s*none/i;
+
+// The inline guard stamped into pages that don't otherwise resolve one. The
+// MARKER makes injection idempotent and lets the audit recognise stamped pages.
+export const MARKER = 'three.ws hidden-guard';
+export const INLINE_GUARD =
+ `<style>/* ${MARKER} — make the \`hidden\` attribute authoritative; see scripts/lib/hidden-guard.mjs */` +
+ `[hidden]{display:none!important}</style>`;
+
+/** Resolve a CSS href/import to an absolute path on disk, or null (external CDN). */
+function resolveCssPath(spec, fromDir) {
+ if (!spec || /^https?:|^\/\//.test(spec)) return null;
+ const clean = spec.split(/[?#]/)[0];
+ const candidates = clean.startsWith('/')
+ ? [join(PUBLIC_DIR, clean), join(ROOT, clean.slice(1))]
+ : [join(fromDir, clean)];
+ for (const c of candidates) if (existsSync(c)) return c;
+ return null;
+}
+
+// Memoised "does this CSS file (transitively via @import) define the guard?"
+const guardCache = new Map();
+function cssProvidesGuard(absPath, seen = new Set()) {
+ if (!absPath || seen.has(absPath)) return false;
+ if (guardCache.has(absPath)) return guardCache.get(absPath);
+ seen.add(absPath);
+ let provides = false;
+ try {
+ const src = readFileSync(absPath, 'utf8');
+ if (GUARD_RE.test(src)) provides = true;
+ else {
+ const dir = dirname(absPath);
+ for (const m of src.matchAll(/@import\s+(?:url\()?\s*['"]?([^'")\s]+)['"]?/gi)) {
+ const imp = resolveCssPath(m[1], dir);
+ if (imp && cssProvidesGuard(imp, seen)) { provides = true; break; }
+ }
+ }
+ } catch { provides = false; }
+ guardCache.set(absPath, provides);
+ return provides;
+}
+
+/** Does an HTML page resolve the guard — inline <style>, the stamped marker, or any linked CSS? */
+export function pageIsGuarded(htmlPath) {
+ const html = readFileSync(htmlPath, 'utf8');
+ if (html.includes(MARKER)) return true;
+ const fromDir = dirname(htmlPath);
+ for (const m of html.matchAll(/<style[^>]*>([\s\S]*?)<\/style>/gi)) {
+ if (GUARD_RE.test(m[1])) return true;
+ }
+ for (const tag of html.matchAll(/<link\b[^>]*>/gi)) {
+ const t = tag[0];
+ if (!/rel\s*=\s*['"]?stylesheet/i.test(t)) continue;
+ const href = t.match(/href\s*=\s*['"]([^'"]+)['"]/i)?.[1];
+ const css = resolveCssPath(href, fromDir);
+ if (css && cssProvidesGuard(css)) return true;
+ }
+ return false;
+}
+
+function walkHtml(dir) {
+ const out = [];
+ if (!existsSync(dir)) return out;
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
+ const full = join(dir, entry.name);
+ if (entry.isDirectory()) {
+ if (entry.name === 'node_modules' || entry.name.startsWith('.')) continue;
+ out.push(...walkHtml(full));
+ } else if (entry.name.endsWith('.html')) out.push(full);
+ }
+ return out;
+}
+
+// Product HTML lives under pages/ (clean-URL surfaces) plus a curated set of
+// standalone public/ pages. Vendored/generated public/ trees (sdk demos, model
+// viewers) are not ours to guard — listing public pages explicitly avoids them.
+const PUBLIC_GUARDED = ['login.html', 'paywall.html', 'bazaar.html', 'forever.html'];
+
+/** The full set of product HTML pages the guard must cover. */
+export function collectPages() {
+ return [
+ ...walkHtml(PAGES_DIR),
+ ...PUBLIC_GUARDED.map((f) => join(PUBLIC_DIR, f)).filter(existsSync),
+ ];
+}
diff --git a/src/dashboard-next/pages/referrals.js b/src/dashboard-next/pages/referrals.js
index be51bf44f..82802c35a 100644
--- a/src/dashboard-next/pages/referrals.js
+++ b/src/dashboard-next/pages/referrals.js
@@ -292,6 +292,49 @@ function injectStyles() {
.ref-pager{flex-wrap:wrap}
.ref-pager-info{width:100%;margin-bottom:6px}
}
+
+ /* ── membership tier ─────────────────────────────────────────────────── */
+ .ref-tier-pill{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;
+ letter-spacing:.01em;padding:4px 9px 4px 8px;border-radius:999px;line-height:1;white-space:nowrap;
+ background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.22);color:#fff;
+ backdrop-filter:blur(4px)}
+ .ref-tier-pill .ref-tier-dot{width:7px;height:7px;border-radius:50%;flex:0 0 auto;
+ box-shadow:0 0 6px 1px currentColor}
+ .ref-tier-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:6px}
+ .ref-tier-badge{display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:999px;
+ font-size:14px;font-weight:700;letter-spacing:-0.01em;border:1px solid}
+ .ref-tier-badge .ref-tier-dot{width:9px;height:9px;border-radius:50%;box-shadow:0 0 8px 1px currentColor}
+ .ref-tier-desc{font-size:13px;color:var(--nxt-ink-dim);line-height:1.55;margin:0 0 16px;max-width:62ch}
+ .ref-tier-badges{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px}
+ .ref-tier-chip{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:600;
+ padding:5px 11px;border-radius:999px;background:rgba(255,255,255,.04);border:1px solid var(--nxt-stroke-strong);color:var(--nxt-ink)}
+ .ref-tier-chip .ref-tier-dot{width:7px;height:7px;border-radius:50%;box-shadow:0 0 6px 1px currentColor}
+ .ref-tier-ladder{display:flex;flex-direction:column;gap:2px}
+ .ref-tier-rung{display:flex;align-items:center;gap:13px;padding:12px 14px;border-radius:12px;
+ border:1px solid transparent;transition:background .14s ease,border-color .14s ease}
+ .ref-tier-rung[data-active="true"]{background:rgba(167,139,250,.07);border-color:rgba(167,139,250,.22)}
+ .ref-tier-rung[data-active="false"]{opacity:.72}
+ .ref-tier-rung:hover{background:rgba(255,255,255,.03)}
+ .ref-tier-marker{flex:0 0 auto;width:34px;height:34px;border-radius:9px;display:grid;place-items:center;
+ border:1px solid;font-size:13px;font-weight:700;font-family:${MONO}}
+ .ref-tier-rung-body{flex:1;min-width:0}
+ .ref-tier-rung-title{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--nxt-ink)}
+ .ref-tier-rung-tag{font-size:11px;color:var(--nxt-ink-fade);font-weight:500;text-transform:uppercase;letter-spacing:.05em}
+ .ref-tier-rung-desc{font-size:12.5px;color:var(--nxt-ink-dim);line-height:1.45;margin-top:3px}
+ .ref-tier-status{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600;
+ padding:4px 10px;border-radius:999px;white-space:nowrap}
+ .ref-tier-status.active{background:rgba(134,239,172,.12);color:#86efac;border:1px solid rgba(134,239,172,.3)}
+ .ref-tier-status.locked{background:rgba(255,255,255,.04);color:var(--nxt-ink-fade);border:1px solid var(--nxt-stroke-strong)}
+ a.ref-tier-status.locked:hover{background:rgba(167,139,250,.16);color:#c4b5fd;border-color:rgba(167,139,250,.5)}
+ .ref-tier-next{margin-top:16px;display:flex;align-items:center;gap:12px;padding:13px 16px;border-radius:12px;
+ background:rgba(167,139,250,.08);border:1px solid rgba(167,139,250,.25)}
+ .ref-tier-next svg{flex:0 0 auto;color:#c4b5fd}
+ .ref-tier-next-body{flex:1;min-width:0;font-size:13px;color:var(--nxt-ink);line-height:1.45}
+ .ref-tier-next-body b{color:#c4b5fd}
+ @media (max-width:560px){
+ .ref-tier-rung{flex-wrap:wrap}
+ .ref-tier-status{margin-left:47px}
+ }
`;
document.head.appendChild(s);
}
@@ -321,7 +364,10 @@ function frontFace(card, refUrl) {
<span>EXP <b>${esc(expLabel(card.member_since))}</b> &nbsp; Member since ${esc(memberSinceLabel(card.member_since))}</span>
<span>#${String(card.position).padStart(6, '0')}</span>
</div>
- <div class="ref-name" style="margin-top:10px">${esc(card.display_name || 'Member')}</div>
+ <div class="ref-name" style="margin-top:10px;display:flex;align-items:center;justify-content:space-between;gap:10px">
+ <span style="min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${esc(card.display_name || 'Member')}</span>
+ <span class="ref-tier-pill" data-tier-pill hidden></span>
+ </div>
</div>`;
}
@@ -500,6 +546,8 @@ function renderCard(host, card) {
<div class="ref-tile"><div class="ref-tile-k">Score</div><div class="ref-tile-v">${fmtInt(card.score)}</div></div>
</div>
+ <section class="dn-panel" style="margin-top:20px" data-slot="tier-panel" aria-label="Your membership tier"></section>
+
<section class="dn-panel" style="margin-top:20px" data-slot="referrals-list" aria-label="Your referrals"></section>
<section class="dn-panel" style="margin-top:20px">
@@ -513,6 +561,7 @@ function renderCard(host, card) {
`;
wireCard(host, card, refUrl);
+ loadTier(host, card);
mountReferralsList(host.querySelector('[data-slot="referrals-list"]'), refUrl, card.referred_users);
}
@@ -735,6 +784,147 @@ function wireCodeEditor(host, card) {
showCollapsed();
}
+// ── membership tier ───────────────────────────────────────────────────────────
+//
+// Every member wears a "mode": user, beta, pro, holder, or three-dimensional.
+// The card shows the highest one as a pill; this panel shows the full ladder,
+// which badges you already hold, and what unlocks the rest. Data is real, from
+// /api/users/me/tier — holder status is read live from your on-chain $THREE.
+
+// Where a locked mode is earned, and where to go to get there. Derived modes
+// link to the surface that unlocks them; granted modes are invite-only.
+const TIER_UNLOCK = {
+ beta: { label: 'By invitation', href: null },
+ pro: { label: 'Upgrade plan', href: '/dashboard/monetize' },
+ holder: { label: 'Hold $THREE', href: '/dashboard/three-token' },
+ 'three-dimensional': { label: 'By invitation', href: null },
+};
+
+const ARROW_UP_ICON = '<svg width="18" height="18" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M10 16V5M5.5 9.5 10 5l4.5 4.5"/></svg>';
+
+function tierDot(color) {
+ return `<span class="ref-tier-dot" style="background:${color};color:${color}"></span>`;
+}
+
+/** Fill the small tier pill on the card front. */
+function fillTierPill(pill, tier) {
+ if (!pill || !tier) return;
+ pill.style.color = tier.color;
+ pill.style.borderColor = `${tier.color}66`;
+ pill.style.background = `${tier.color}24`;
+ pill.innerHTML = `${tierDot(tier.color)}${esc(tier.label)}`;
+ pill.hidden = false;
+}
+
+function renderTierSkeleton(host) {
+ host.innerHTML = `
+ <div class="ref-tier-head">
+ <h3 class="dn-panel-title" style="margin:0">Your membership tier</h3>
+ <span class="ref-skel-bar" style="width:96px;height:26px;border-radius:999px"></span>
+ </div>
+ <div class="ref-tier-ladder" style="margin-top:10px">
+ ${[0, 1, 2].map(() => `
+ <div class="ref-tier-rung" data-active="false">
+ <span class="ref-skel-bar" style="width:34px;height:34px;border-radius:9px"></span>
+ <div class="ref-tier-rung-body"><span class="ref-skel-bar" style="width:120px"></span>
+ <div style="margin-top:8px"><span class="ref-skel-bar" style="width:220px"></span></div></div>
+ </div>`).join('')}
+ </div>`;
+}
+
+function renderTierError(host, onRetry) {
+ host.innerHTML = `
+ <div class="ref-tier-head"><h3 class="dn-panel-title" style="margin:0">Your membership tier</h3></div>
+ <p class="ref-tier-desc" style="margin-top:8px">Couldn't load your tier just now.</p>
+ <button class="dn-btn" data-action="retry-tier" style="padding:0 16px;height:36px">Retry</button>`;
+ host.querySelector('[data-action="retry-tier"]').addEventListener('click', onRetry);
+}
+
+function tierRung(tier, active, holder) {
+ const unlock = TIER_UNLOCK[tier.id];
+ let status;
+ if (active) {
+ status = `<span class="ref-tier-status active">${CHECK_ICON} Active</span>`;
+ } else if (unlock?.href) {
+ status = `<a class="ref-tier-status locked" href="${esc(unlock.href)}">${esc(unlock.label)} →</a>`;
+ } else if (unlock) {
+ status = `<span class="ref-tier-status locked">${esc(unlock.label)}</span>`;
+ } else {
+ status = '';
+ }
+
+ // Holders see how much they hold, right where the badge lives.
+ const heldNote = tier.id === 'holder' && active && holder?.usd > 0
+ ? ` · holding ${fmtUsd(holder.usd)}`
+ : '';
+
+ return `
+ <div class="ref-tier-rung" data-active="${active}">
+ <span class="ref-tier-marker" style="color:${tier.color};border-color:${tier.color}59;background:${tier.color}1f">${tierDot(tier.color)}</span>
+ <div class="ref-tier-rung-body">
+ <div class="ref-tier-rung-title">${esc(tier.label)} <span class="ref-tier-rung-tag">${esc(tier.tagline)}${heldNote}</span></div>
+ <div class="ref-tier-rung-desc">${esc(tier.description)}</div>
+ </div>
+ ${status}
+ </div>`;
+}
+
+function renderTierPanel(host, data) {
+ const primary = data.tier;
+ const activeIds = new Set((data.badges || []).map((b) => b.id));
+ const badgeChips = (data.badges || [])
+ .map((b) => `<span class="ref-tier-chip">${tierDot(b.color)}${esc(b.label)}</span>`)
+ .join('');
+
+ const nextHtml = data.next
+ ? `<div class="ref-tier-next">
+ ${ARROW_UP_ICON}
+ <div class="ref-tier-next-body">Next up: <b>${esc(data.next.label)}</b> — ${esc(data.next.description)}</div>
+ ${TIER_UNLOCK[data.next.id]?.href
+ ? `<a class="ref-tier-status locked" href="${esc(TIER_UNLOCK[data.next.id].href)}">${esc(TIER_UNLOCK[data.next.id].label)} →</a>`
+ : `<span class="ref-tier-status locked">${esc(TIER_UNLOCK[data.next.id]?.label || 'By invitation')}</span>`}
+ </div>`
+ : '';
+
+ host.innerHTML = `
+ <div class="ref-tier-head">
+ <h3 class="dn-panel-title" style="margin:0">Your membership tier</h3>
+ <span class="ref-tier-badge" style="color:${primary.color};border-color:${primary.color}59;background:${primary.color}1f">
+ ${tierDot(primary.color)}${esc(primary.label)}
+ </span>
+ </div>
+ <p class="ref-tier-desc">${esc(primary.description)}</p>
+ ${badgeChips ? `<div class="ref-tier-badges">${badgeChips}</div>` : ''}
+ <div class="ref-tier-ladder">
+ ${(data.tiers || []).map((t) => tierRung(t, activeIds.has(t.id), data.holder)).join('')}
+ </div>
+ ${nextHtml}`;
+}
+
+// Load the member's tier once, cache it on the card (so a code-save re-render
+// doesn't refetch), then fill both the card pill and the ladder panel.
+function loadTier(host, card) {
+ const panel = host.querySelector('[data-slot="tier-panel"]');
+ const pill = host.querySelector('[data-tier-pill]');
+ if (!panel) return;
+
+ const apply = (data) => {
+ fillTierPill(pill, data.tier);
+ renderTierPanel(panel, data);
+ };
+
+ if (card.tierData) { apply(card.tierData); return; }
+
+ renderTierSkeleton(panel);
+ get('/api/users/me/tier')
+ .then((data) => {
+ if (!data || !data.tier) throw new Error('no tier');
+ card.tierData = data;
+ apply(data);
+ })
+ .catch(() => renderTierError(panel, () => loadTier(host, card)));
+}
+
// ── referred-users table ──────────────────────────────────────────────────────
const PEOPLE_ICON = '<svg width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="#a78bfa" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M16 19v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 19v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/></svg>';
diff --git a/tests/account-tier.test.js b/tests/account-tier.test.js
new file mode 100644
index 000000000..870038ffa
--- /dev/null
+++ b/tests/account-tier.test.js
@@ -0,0 +1,184 @@
+// Unit tests for account tiers ("modes") — api/_lib/account-tier.js.
+//
+// resolveAccountTier is pure (takes a precomputed holder read), so it tests
+// without any RPC. detectHolder's on-chain read is mocked at the three-tier
+// boundary to prove fail-closed dedupe + best-of behaviour.
+
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+
+const holderUsd = vi.fn();
+vi.mock('../api/_lib/three-tier.js', () => ({ holderUsd: (...a) => holderUsd(...a) }));
+
+import {
+ ACCOUNT_TIERS,
+ GRANTABLE_TIER_IDS,
+ DEFAULT_TIER_ID,
+ tierById,
+ isGrantableTier,
+ normalizeTierGrant,
+ detectHolder,
+ resolveAccountTier,
+} from '../api/_lib/account-tier.js';
+
+const NO_HOLDER = { isHolder: false, amount: 0, usd: 0 };
+
+beforeEach(() => {
+ vi.clearAllMocks();
+});
+
+describe('tier ladder', () => {
+ it('is ordered low→high by rank and starts at the default user tier', () => {
+ expect(ACCOUNT_TIERS[0].id).toBe(DEFAULT_TIER_ID);
+ expect(ACCOUNT_TIERS[0].rank).toBe(0);
+ for (let i = 1; i < ACCOUNT_TIERS.length; i++) {
+ expect(ACCOUNT_TIERS[i].rank).toBeGreaterThan(ACCOUNT_TIERS[i - 1].rank);
+ }
+ });
+
+ it('every tier carries the fields the UI renders', () => {
+ for (const t of ACCOUNT_TIERS) {
+ expect(typeof t.label).toBe('string');
+ expect(t.color).toMatch(/^#[0-9a-f]{6}$/i);
+ expect(typeof t.description).toBe('string');
+ expect(Array.isArray(t.perks)).toBe(true);
+ expect(t.perks.length).toBeGreaterThan(0);
+ }
+ });
+
+ it('exposes exactly the admin-grantable modes (derived ones excluded)', () => {
+ expect(GRANTABLE_TIER_IDS).toEqual(['beta', 'pro', 'three-dimensional']);
+ expect(GRANTABLE_TIER_IDS).not.toContain('holder');
+ expect(GRANTABLE_TIER_IDS).not.toContain('user');
+ });
+});
+
+describe('helpers', () => {
+ it('tierById resolves known ids and rejects unknown', () => {
+ expect(tierById('holder').label).toBe('Holder');
+ expect(tierById('nope')).toBeNull();
+ });
+
+ it('isGrantableTier gates the admin grant set', () => {
+ expect(isGrantableTier('beta')).toBe(true);
+ expect(isGrantableTier('three-dimensional')).toBe(true);
+ expect(isGrantableTier('holder')).toBe(false);
+ expect(isGrantableTier('user')).toBe(false);
+ });
+
+ it('normalizeTierGrant canonicalizes, clears, and rejects', () => {
+ expect(normalizeTierGrant(' BETA ')).toBe('beta');
+ expect(normalizeTierGrant('three-dimensional')).toBe('three-dimensional');
+ expect(normalizeTierGrant('none')).toBeNull();
+ expect(normalizeTierGrant('user')).toBeNull();
+ expect(normalizeTierGrant('')).toBeNull();
+ expect(normalizeTierGrant(null)).toBeNull();
+ expect(normalizeTierGrant('holder')).toBeNull(); // derived, not grantable
+ expect(normalizeTierGrant('bogus')).toBeNull();
+ });
+});
+
+describe('resolveAccountTier', () => {
+ it('defaults a plain account to the user tier with beta next', () => {
+ const r = resolveAccountTier({ plan: 'free', account_tier: null }, { holder: NO_HOLDER });
+ expect(r.primary.id).toBe('user');
+ expect(r.badges.map((b) => b.id)).toEqual(['user']);
+ expect(r.next.id).toBe('beta');
+ expect(r.granted).toBeNull();
+ });
+
+ it('applies a granted beta mode', () => {
+ const r = resolveAccountTier({ plan: 'free', account_tier: 'beta' }, { holder: NO_HOLDER });
+ expect(r.granted).toBe('beta');
+ expect(r.primary.id).toBe('beta');
+ expect(r.badges.map((b) => b.id)).toEqual(['user', 'beta']);
+ expect(r.next.id).toBe('pro');
+ });
+
+ it('derives the pro badge from a paid plan without a grant', () => {
+ for (const plan of ['pro', 'team', 'enterprise']) {
+ const r = resolveAccountTier({ plan, account_tier: null }, { holder: NO_HOLDER });
+ expect(r.badges.some((b) => b.id === 'pro')).toBe(true);
+ expect(r.primary.id).toBe('pro');
+ }
+ });
+
+ it('awards the holder badge from an on-chain read and ranks it above pro', () => {
+ const r = resolveAccountTier(
+ { plan: 'pro', account_tier: null },
+ { holder: { isHolder: true, amount: 1000, usd: 42 } },
+ );
+ const ids = r.badges.map((b) => b.id);
+ expect(ids).toContain('holder');
+ expect(ids).toContain('pro');
+ expect(r.primary.id).toBe('holder');
+ expect(r.next.id).toBe('three-dimensional');
+ });
+
+ it('lets three-dimensional sit at the top with nothing next', () => {
+ const r = resolveAccountTier(
+ { plan: 'free', account_tier: 'three-dimensional' },
+ { holder: NO_HOLDER },
+ );
+ expect(r.primary.id).toBe('three-dimensional');
+ expect(r.next).toBeNull();
+ });
+
+ it('ignores a non-grantable stored value (e.g. a stale holder grant)', () => {
+ const r = resolveAccountTier({ plan: 'free', account_tier: 'holder' }, { holder: NO_HOLDER });
+ expect(r.granted).toBeNull();
+ expect(r.badges.map((b) => b.id)).toEqual(['user']);
+ });
+
+ it('stacks every active badge in rank order', () => {
+ const r = resolveAccountTier(
+ { plan: 'team', account_tier: 'beta' },
+ { holder: { isHolder: true, amount: 5, usd: 9 } },
+ );
+ expect(r.badges.map((b) => b.id)).toEqual(['user', 'beta', 'pro', 'holder']);
+ expect(r.primary.id).toBe('holder');
+ });
+
+ it('degrades to user when called with no holder read', () => {
+ const r = resolveAccountTier({ plan: 'free', account_tier: null });
+ expect(r.primary.id).toBe('user');
+ expect(r.holder.isHolder).toBe(false);
+ });
+});
+
+describe('detectHolder', () => {
+ it('returns not-a-holder for no wallets without any RPC call', async () => {
+ const r = await detectHolder([]);
+ expect(r).toEqual({ isHolder: false, amount: 0, usd: 0 });
+ expect(holderUsd).not.toHaveBeenCalled();
+ });
+
+ it('flags a holder from a single funded wallet', async () => {
+ holderUsd.mockResolvedValueOnce({ amount: 1234, usd: 56.7, priceUsd: 0.046 });
+ const r = await detectHolder(['Wallet1']);
+ expect(r.isHolder).toBe(true);
+ expect(r.amount).toBe(1234);
+ expect(r.usd).toBeCloseTo(56.7);
+ });
+
+ it('dedupes repeated addresses', async () => {
+ holderUsd.mockResolvedValue({ amount: 10, usd: 1, priceUsd: 0.1 });
+ await detectHolder(['W', 'W', 'W']);
+ expect(holderUsd).toHaveBeenCalledTimes(1);
+ });
+
+ it('keeps the best holding across multiple wallets', async () => {
+ holderUsd
+ .mockResolvedValueOnce({ amount: 5, usd: 1, priceUsd: 0.2 })
+ .mockResolvedValueOnce({ amount: 500, usd: 100, priceUsd: 0.2 });
+ const r = await detectHolder(['A', 'B']);
+ expect(r.amount).toBe(500);
+ expect(r.usd).toBe(100);
+ expect(r.isHolder).toBe(true);
+ });
+
+ it('fails closed — a zero read is not a holder', async () => {
+ holderUsd.mockResolvedValue({ amount: 0, usd: 0, priceUsd: 0 });
+ const r = await detectHolder(['A', 'B']);
+ expect(r.isHolder).toBe(false);
+ });
+});
diff --git a/tests/e2e/studio-overlay.spec.js b/tests/e2e/studio-overlay.spec.js
new file mode 100644
index 000000000..c24a5509e
--- /dev/null
+++ b/tests/e2e/studio-overlay.spec.js
@@ -0,0 +1,87 @@
+import { test, expect } from '@playwright/test';
+
+// Regression guard for the invisible-overlay class of bug.
+//
+// The Brain Studio modal (#bsModal) is a full-screen `position:fixed; inset:0;
+// z-index:1000` layer meant to stay hidden (via the `hidden` attribute) until you
+// open Templates or the behaviour view. A CSS rule that set `display:grid` on the
+// base class once defeated `hidden`, so the empty overlay rendered on top of the
+// whole Brain tab and swallowed every click — /agent-studio#brain looked dead.
+//
+// This drives a real Chromium against the studio with auth + agent stubbed at the
+// network seam (the same technique as nav-auth.spec.js) so the Brain panel
+// actually mounts, then proves: at rest nothing covers the canvas, the overlay is
+// genuinely hidden, and the open→close lifecycle still works. Any future rule that
+// lets a hidden overlay paint will fail here regardless of its root cause.
+
+const USER = { id: 'studio-test-user', handle: 'tester', wallet: 'THREEsynthetic1111111111111111111111111111' };
+const AGENT = {
+ id: 'studio-test-agent',
+ name: 'Overlay Probe',
+ description: 'Brain Studio overlay regression probe',
+ avatarId: null,
+ skills: [],
+ meta: {},
+ isOwner: true,
+ isRegistered: false,
+ walletAddress: null,
+ chainId: null,
+};
+
+function stubStudioApis(page) {
+ const json = (body) => ({ status: 200, contentType: 'application/json', body: JSON.stringify(body) });
+ return Promise.all([
+ page.route('**/api/auth/me', (route) => route.fulfill(json({ user: USER }))),
+ page.route('**/api/agents/me', (route) => route.fulfill(json({ agent: AGENT }))),
+ ]);
+}
+
+/** True when the viewport centre is interactive (no element
+ * with the given selector sits on top, intercepting clicks). */
+async function centreIsClickThrough(page, selector) {
+ return page.evaluate((sel) => {
+ const el = document.elementFromPoint(window.innerWidth / 2, window.innerHeight / 2);
+ return !(el && el.closest(sel));
+ }, selector);
+}
+
+test.describe('Agent Studio · Brain tab overlay', () => {
+ test('the modal overlay never covers the page at rest', async ({ page }) => {
+ await stubStudioApis(page);
+ await page.goto('/agent-studio#brain', { waitUntil: 'domcontentloaded' });
+
+ // Brain panel mounts once the shell loads the (stubbed) agent.
+ const brain = page.locator('.brainstudio');
+ await expect(brain).toBeVisible({ timeout: 60_000 });
+
+ // Enter the editor view so #bsModal exists in the DOM (onboarding renders
+ // a "Blank brain" CTA; an already-configured agent renders the editor).
+ const blank = page.locator('#bsBlank');
+ if (await blank.count()) await blank.click();
+
+ const modal = page.locator('#bsModal');
+ await expect(modal).toBeHidden();
+ // The empty overlay must not be the element under the viewport centre.
+ expect(await centreIsClickThrough(page, '#bsModal')).toBe(true);
+ });
+
+ test('opening a modal shows it and closing returns the page to click-through', async ({ page }) => {
+ await stubStudioApis(page);
+ await page.goto('/agent-studio#brain', { waitUntil: 'domcontentloaded' });
+ await expect(page.locator('.brainstudio')).toBeVisible({ timeout: 60_000 });
+
+ const blank = page.locator('#bsBlank');
+ if (await blank.count()) await blank.click();
+
+ // Templates opens the shared modal…
+ await page.locator('#bsTpl').click();
+ const modal = page.locator('#bsModal');
+ await expect(modal).toBeVisible();
+ expect(await centreIsClickThrough(page, '#bsModal')).toBe(false); // it covers, by design
+
+ // …and the close (×) hides it again, restoring interaction.
+ await page.locator('#bsModalCard .brainstudio__modal-x').click();
+ await expect(modal).toBeHidden();
+ expect(await centreIsClickThrough(page, '#bsModal')).toBe(true);
+ });
+});