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.

Club, collection, marketplace analytics, oEmbed, chat, IBM demo, and changelog updates

nirholasd2d37dfb5bae
diff --git a/CHANGELOG.md b/CHANGELOG.md
index aa2ab364b..448e38dde 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -68,6 +68,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Place your IRL agent on the real floor with AR anchoring** — On AR-capable phones (Android Chrome), three.ws/irl now lets you point at your actual floor through a placement ring and tap to set your agent on that exact spot. It binds to a real-world anchor, so it stays put as you walk around it instead of sliding with the camera or jittering with GPS — the world-locked placement you'd expect from a top AR app. Each placement is saved as a pin, capturing the floor height, facing, and how good your GPS fix was, so it reloads near the same place and nearby people can see it. If you tap to anchor before your location is ready, it holds the spot and saves it the instant your first GPS fix lands instead of losing the placement. iPhone, which doesn't support this AR mode, keeps the existing compass-based Pin here flow and simply doesn't show the floor button. (`/irl`) `[feature]`
- **Placed objects in coin worlds now survive restarts** — Props, signs, and decorations placed in a coin's 3D world now persist across room disposal and server restarts. Leave a coin world and come back tomorrow — the build your community placed is still there, exactly where it was left. Durable objects are saved to Postgres + R2 via a debounced write-through that batches rapid edits into a single round-trip; transient objects like thrown balls and effects are intentionally excluded. The world correctly shows its saved state the moment the first player enters, before any new pieces are placed. (`/play`) `[feature]`
- **Pole Club dancer tips now reliably reach their Solana wallets** — When you tip a dancer in the Pole Club, the platform batches your tips and sweeps them on-chain to the dancer's registered wallet. A mismatch in how a settled tip recorded its network meant Solana tips were being set aside as 'no wallet' even when the dancer had a Solana address on file, so they never went out. That's fixed: tips paid on Solana are now matched to the dancer's Solana wallet and swept correctly, alongside the existing Base payouts. No tip was ever lost — stuck tips remained queued and now sweep on the next cycle. (`/club`) `[fix]`
+- **Pole Club dancers are three distinct avatars again** — The three dancers in the Pole Club had collapsed onto a single look. Each pole is now pinned to its own verified, distinct 3D rig — including Dylan from the gallery — so the lineup reads as three different dancers again. You can still swap any pole to a different avatar with the new per-pole Avatar picker. (`/club`) `[fix]`
- **Rarest Fits button styled in the cosmetics shop** — The Rarest Fits leaderboard button in the cosmetics shop header now has proper hover, active, and focus states matching the rest of the shop chrome, and collapses to a compact glyph button on mobile. (`/play`) `[improvement]`
- **Report a bad IRL pin — and guardrails that keep public spots usable** — Now that anyone standing at a location sees the agents others placed there, three.ws/irl has the moderation it needs to stay clean. Tap any agent that isn't yours and a new Report option lets you flag it for spam, hate or harassment, impersonation, a scam, sexual content, or anything else — with a clear sending, thanks, and try-again state, never a dead button. Reports are counted per person, so one account can't bury a pin it dislikes; once enough different people flag the same agent it's hidden from everyone — and if you're nearby when that happens it vanishes from your view within about a second rather than lingering until the next scan. Placing agents is now protected too: captions and names with slurs are refused, a pin can only ever reference $THREE, the only coin on three.ws, and its pay button can only point at three.ws — never an outside link. A single busy block holds a sensible maximum of agents and each person has an active-pin limit, so no one can carpet-bomb a plaza or spam placements, and every refusal tells you exactly what to do. Abandoned anonymous pins are cleaned up automatically while the agents you're signed in for stay put. (`/irl`) `[feature, security]`
- **See a placed agent's on-chain reputation from your dashboard** — Your IRL Placements dashboard now shows each placed agent's on-chain reputation — the exact score and trust tier a passer-by sees when they tap it in the real world, so you know what the public sees. Tap an agent's Reputation chip to open a panel with its 0–100 score and tier (New, Emerging, Trusted, Elite), a star rating, and a breakdown of how many attestations are verified, credentialed, or disputed. A small 30-day trend line shows whether its reputation is climbing. Agents that haven't earned any attestations yet get a clear prompt to share them rather than an empty number, and a 'Manage on passport' link takes you to where you add or dispute attestations. If the reputation service is unreachable the panel offers a retry instead of failing silently. (`/dashboard/irl-placements`) `[feature, improvement]`
@@ -78,6 +79,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Sniper now auto-sells coins that graduate off the bonding curve** — When a coin your sniper holds graduates from the pump.fun bonding curve to its AMM pool, the agent used to be stuck holding it — the position sat parked and your exit rules quietly stopped working. The sniper now follows a graduated coin straight onto the AMM and keeps managing it there: stop-loss, trailing-stop, take-profit, and the hold-time limit all keep working against the real post-graduation price, and the automatic sell goes out with slippage protection. Positions that were stuck before can be cleared with a one-time backfill. (`/dashboard/sniper`) `[fix]`
- **Tag mini-game in /play worlds** — Server-authoritative tag comes to every /play world. When two or more players are in the same room, a random player becomes 'it'. Walk close to another player and tag transfers — the server validates proximity on authoritative positions so no client can cheat. The tagged player gets a red glow ring under their avatar and a 🏃 IT label above their head, visible to everyone. A 'YOU'RE IT!' alert flashes on your screen the moment you're tagged, and a 2-second immunity window prevents instant re-tagging. The tag HUD (bottom-right) shows who's currently 'it' and a live leaderboard of cumulative time-as-it for the session. (`/play`) `[feature]`
- **Tapping an IRL agent is now reliable — hit the body, not just the tiny label** — On three.ws/irl you can now open an agent by tapping its 3D body, not only its small floating name tag. Tapping near a name also works, with a finger-sized target that meets Apple's 44-pixel minimum, so you no longer have to pixel-hunt on a phone. When two agents stand on top of each other, the one in front wins instead of a random pick. As you move, the nearest agent you can reach lights up with a soft focus ring so you can see what you'll tap before you tap it — and if you've turned on Reduce Motion, the ring stays still. Looking and panning around no longer misfires as a tap. (`/irl`) `[improvement]`
+- **The IBM x402 demo grew a 3D agent that pays for itself** — The live x402 demo at three.ws/ibm/x402-demo now has a 3D AI agent below the payment card. When you run the $0.001 call, the agent watches the same on-chain settlement you do and reacts in real time — it celebrates and announces the payment the moment it clears. You can also ask it how x402 and $THREE work. Under it, three new rooms — Forge (text to 3D), Play (live worlds), and IRL (augmented reality) — load the real three.ws surfaces inline on a click, or open full-screen. Everything still loads from three.ws with no build step. (`/ibm/x402-demo`) `[feature]`
- **The Oracle's proof pages — wins, backtest, and live activity — load again** — The conviction Oracle's evidence views had stopped responding: the Wins gallery, the accuracy Backtest, and the global Activity feed were all erroring instead of returning data, and the live activity feed failed on every request. The cause was in how those queries were assembled — optional filters (time window, tier, agent) weren't being stitched into the database query correctly, so the database rejected them. All three views now build their filters cleanly and return the Oracle's track record, hit-rate, and real-time agent actions as intended. (`/oracle`) `[fix]`
- **The sniper now runs as an always-on service — armed strategies fire in real time** — An armed sniper strategy now has a live engine behind it. The sniper runs as a dedicated always-on worker that holds the pump.fun launch feed open continuously and acts the moment a launch matches your rules — not on a slow timer. It starts in a safe simulate mode (real scoring, zero spend) and going live is a deliberate, gated step that needs a funded agent wallet, so nothing trades real money by accident. If the launch feed ever drops, the worker reconnects on its own and pages the operators, and a public health check at /api/sniper/status reports whether it's live, reconnecting, or down — so 'is the sniper actually working right now?' is always answerable. Every safety limit you set — daily budget, per-trade size, max open positions, mandatory stop-loss, price-impact cutoff — is enforced by the running service exactly as configured. (`/dashboard/sniper`) `[infra, feature]`
- **Try x402 live — pay a tenth of a cent to call a real API from your own wallet** — There's now a live, self-contained x402 demo you can try in a browser. Pay $0.001 USDC from your own wallet — MetaMask on Base or Phantom on Solana — and call a real three.ws data API. The page reads the live HTTP 402 price the server quotes, runs the paid call once your wallet signs a gasless authorization, and shows the response next to an on-chain transaction receipt you can open on Basescan or Solscan. Nothing is mocked and there's no account or backend. The same eight-line embed it runs on — one script tag from three.ws plus any button carrying a data-x402-endpoint — is copy-pasteable into any site, so a developer can add a working pay-per-call paywall in minutes. Built with IBM as the public face of the partnership and designed to host cleanly on a strict-CSP enterprise page. (`/ibm/x402-demo`) `[feature, sdk]`
diff --git a/api/widgets/oembed.js b/api/widgets/oembed.js
index fb0d92569..eecf037eb 100644
--- a/api/widgets/oembed.js
+++ b/api/widgets/oembed.js
@@ -120,8 +120,7 @@ function extractWidgetId(target) {
const originStr = `${parsed.protocol}//${parsed.host}`;
const okOrigin =
originStr === env.APP_ORIGIN ||
- /^https?:\/\/localhost(:\d+)?$/.test(originStr) ||
- /^https?:\/\/3d\.irish$/.test(originStr);
+ /^https?:\/\/localhost(:\d+)?$/.test(originStr);
if (!okOrigin) return null;
const pathMatch = parsed.pathname.match(/^\/w\/([A-Za-z0-9_-]+)\/?$/);
diff --git a/chat/src/App.svelte b/chat/src/App.svelte
index c1c4103b5..8f6869d6b 100644
--- a/chat/src/App.svelte
+++ b/chat/src/App.svelte
@@ -177,7 +177,7 @@
transaction.onerror = () => {
console.error('Message save failed', transaction.error);
- notify('Failed to save — your changes may be lost. Check browser storage settings.');
+ notify('Failed to save — your changes may be lost. Check browser storage settings.');
};
}, 500);
@@ -359,7 +359,7 @@
transaction.onerror = () => {
console.error('Conversation save failed', transaction.error);
- notify('Failed to save — your changes may be lost. Check browser storage settings.');
+ notify('Failed to save — your changes may be lost. Check browser storage settings.');
};
}, 500);
@@ -632,7 +632,7 @@
convo.messages[convo.messages.length - 1].reasoning = true;
convo.messages[convo.messages.length - 1].thinking = true;
convo.messages[convo.messages.length - 1].thoughts = '';
- // Keep reasoning collapsed in the thread — the "Thinking…" pill and the
+ // Keep reasoning collapsed in the thread — the "Thinking…" pill and the
// avatar thought bubble surface that the model is reasoning; the raw
// transcript stays behind the pill instead of dumping into the chat.
convo.messages[convo.messages.length - 1].thoughtsExpanded = false;
@@ -727,7 +727,7 @@
if (choice.delta.reasoning && !convo.messages[i].reasoning) {
convo.messages[i].reasoning = true;
convo.messages[i].thoughts = '';
- // Collapsed by default — reasoning lives behind the pill, not inline.
+ // Collapsed by default — reasoning lives behind the pill, not inline.
convo.messages[i].thoughtsExpanded = false;
if (!convo.messages[i].thinking && !unexpandedThinkingOnce) {
unexpandedThinkingOnce = true;
@@ -774,8 +774,14 @@
activeToolcall = convo.messages[i].toolcalls[index];
}
}
- if (tool_call.function.arguments) {
- convo.messages[i].toolcalls[index].arguments += tool_call.function.arguments;
+ if (tool_call.function.arguments != null) {
+ // Most providers stream arguments as JSON-string fragments we concatenate.
+ // Some (e.g. GPT OSS 120B) send the fully-formed arguments object in one chunk —
+ // concatenating that with += would coerce it to the literal "[object Object]"
+ // and break the JSON.parse below. Stringify non-string deltas first.
+ const delta = tool_call.function.arguments;
+ convo.messages[i].toolcalls[index].arguments +=
+ typeof delta === "string" ? delta : JSON.stringify(delta);
if (innerWidth > 1215) {
activeToolcall = convo.messages[i].toolcalls[index];
}
@@ -812,7 +818,13 @@
const toolcall = convo.messages[i].toolcalls[ti];
try {
- toolcall.arguments = JSON.parse(toolcall.arguments);
+ if (typeof toolcall.arguments === 'string') {
+ // Empty string = a tool that takes no arguments; treat as {} rather than a parse error.
+ toolcall.arguments = toolcall.arguments.trim()
+ ? JSON.parse(toolcall.arguments)
+ : {};
+ }
+ // Otherwise arguments is already an object — leave it as-is.
} catch (err) {
convo.messages[i].error =
'Failed to parse tool call arguments: ' + err + toolcall.arguments;
@@ -1598,13 +1610,13 @@
localStorage.setItem('x402PayPackBootstrapped', '1');
}
} catch (err) {
- // Best-effort bootstrap — e.g. Safari private mode blocks
+ // Best-effort bootstrap — e.g. Safari private mode blocks
// localStorage. Don't break the rest of onMount over it.
console.warn('[x402-pay] bootstrap failed:', err);
}
- // Same one-time bootstrap for the Text → 3D Forge pack, so "make me a
- // 3D model of…" works on a fresh chat without a trip through Tool Packs.
+ // Same one-time bootstrap for the Text → 3D Forge pack, so "make me a
+ // 3D model of…" works on a fresh chat without a trip through Tool Packs.
// Honors removal via the bootstrap flag, exactly like the x402 pack.
try {
if (!localStorage.getItem('forgePackBootstrapped')) {
@@ -1625,7 +1637,7 @@
// When the user installs a Local skill from the Skills modal, auto-enable
// the new tools in the current conversation so the LLM can call them on
- // the next turn — same UX as the x402-pay bootstrap above, but
+ // the next turn — same UX as the x402-pay bootstrap above, but
// triggered on-demand instead of once at startup. We only enable for
// the active convo; other convos pick up the new tools through the
// usual Tools dropdown.
@@ -1684,7 +1696,7 @@
).json();
} catch (error) {
console.debug(
- `[tool server] not detected at ${$remoteServer.address} — start it if you want local tools.`
+ `[tool server] not detected at ${$remoteServer.address} — start it if you want local tools.`
);
}
}
@@ -1771,7 +1783,7 @@
// Walk while tokens are actively arriving. `generating` flips false the
// instant the network stream ends, but we want the avatar to keep walking
- // until rendering settles — 600ms tail bridges micro-pauses between tokens
+ // until rendering settles — 600ms tail bridges micro-pauses between tokens
// and the gap between last token and DOM paint.
let tokensFlowing = false;
let _tokensFlowingTimer = null;
@@ -1781,7 +1793,7 @@
_tokensFlowingTimer = setTimeout(() => { tokensFlowing = false; }, 600);
}
- // Live thought bubble above the avatar — streams the active reasoning,
+ // Live thought bubble above the avatar — streams the active reasoning,
// then collapses to a "Thought for Xs" summary while the response streams.
let thoughtBubbleEl;
$: thinkingMessage = (() => {
@@ -1891,7 +1903,7 @@
$: if (agentEl && !agentReady) {
agentEl.addEventListener('agent:ready', () => {
agentReady = true;
- // Re-frame once the canvas has its final on-screen size — the
+ // Re-frame once the canvas has its final on-screen size — the
// internal framing happens at load time, before our ResizeObserver
// has reacted to the host's actual width/height. Without this, the
// avatar's feet can clip on first render at large element sizes.
@@ -1940,9 +1952,9 @@
}
// Blocker #2: prefers-reduced-motion (browsers with this on never start walk)
// We can't change the OS pref, but we sidestep agent-3d's _onStreamChunk
- // path entirely by calling play() directly. So — no early return here.
+ // path entirely by calling play() directly. So — no early return here.
- // Blocker #3: agent-3d's internal _isWalking flag stuck true ⇒ _onStreamChunk
+ // Blocker #3: agent-3d's internal _isWalking flag stuck true ⇒ _onStreamChunk
// no-ops. Reset it so any future stream chunks can re-trigger walk too.
try { agentEl._isWalking = false; } catch {}
clearTimeout(agentEl._walkStopDebounce);
@@ -2815,7 +2827,7 @@
{#if gateState}
<div transition:fade={{ duration: 150 }} class="fixed inset-0 z-[300] flex items-center justify-center bg-black/60 backdrop-blur-sm">
<div class="mx-4 w-full max-w-sm rounded-2xl bg-white p-8 shadow-2xl">
- <div class="mb-2 text-2xl font-bold text-slate-900">🔒 Token-Gated Scene</div>
+ <div class="mb-2 text-2xl font-bold text-slate-900">🔒 Token-Gated Scene</div>
<p class="mb-6 text-sm text-slate-600">This 3D scene requires wallet ownership verification to access. Connect your wallet and prove you hold the required token.</p>
{#if gateState === 'pending'}
@@ -2838,7 +2850,7 @@
{:else if gateState === 'checking'}
<div class="flex flex-col items-center gap-3 py-4">
<div class="h-8 w-8 animate-spin rounded-full border-4 border-purple-200 border-t-purple-600"></div>
- <p class="text-sm text-slate-500">Connecting wallet and verifying…</p>
+ <p class="text-sm text-slate-500">Connecting wallet and verifying…</p>
</div>
{:else if gateState === 'denied'}
<div class="mb-4 rounded-xl bg-red-50 p-4 text-sm text-red-700">
@@ -3028,7 +3040,7 @@
opacity: 1;
}
/* The chat canvas is dark, so let the shared (dark) footer.css show through
- unchanged — only keep the layout spacing tweak. */
+ unchanged — only keep the layout spacing tweak. */
:global(.h-footer-inner) {
margin-bottom: 2rem;
}
@@ -3106,7 +3118,7 @@
</nav>
</div>
<div class="h-footer-bottom">
- <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>
+ <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>
<div class="h-footer-legal-links">
<a href="/legal/privacy">Privacy Policy</a>
<a href="/legal/tos">Terms of Use</a>
diff --git a/data/changelog.json b/data/changelog.json
index 3308c68d2..69b98541c 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,33 @@
{
"$comment": "Curated changelog entries for three.ws \u2014 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-17",
+ "title": "Chat tool calls no longer break on certain models",
+ "summary": "Some models (like GPT OSS 120B) return tool-call arguments as a ready-made object instead of streamed text. Chat assumed text and mangled it into \"[object Object]\", so tools such as ForgeTextTo3D failed with a JSON parse error. Chat now handles both formats, and a tool that takes no arguments no longer errors either — so generating a model from a prompt works across every model.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/chat"
+ },
+ {
+ "date": "2026-06-17",
+ "title": "Pole Club dancers are three distinct avatars again",
+ "summary": "The three dancers in the Pole Club had collapsed onto a single look. Each pole is now pinned to its own verified, distinct 3D rig — including Dylan from the gallery — so the lineup reads as three different dancers again. You can still swap any pole to a different avatar with the new per-pole Avatar picker.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/club"
+ },
+ {
+ "date": "2026-06-17",
+ "title": "The IBM x402 demo grew a 3D agent that pays for itself",
+ "summary": "The live x402 demo at three.ws/ibm/x402-demo now has a 3D AI agent below the payment card. When you run the $0.001 call, the agent watches the same on-chain settlement you do and reacts in real time — it celebrates and announces the payment the moment it clears. You can also ask it how x402 and $THREE work. Under it, three new rooms — Forge (text to 3D), Play (live worlds), and IRL (augmented reality) — load the real three.ws surfaces inline on a click, or open full-screen. Everything still loads from three.ws with no build step.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/ibm/x402-demo"
+ },
{
"date": "2026-06-17",
"title": "Never lose your way in — a minimap on the walk to the Pole Club",
diff --git a/inspect.mjs b/inspect.mjs
new file mode 100644
index 000000000..503be4021
--- /dev/null
+++ b/inspect.mjs
@@ -0,0 +1,28 @@
+import { chromium } from 'playwright';
+const b = await chromium.launch();
+const p = await b.newPage();
+await p.goto('http://localhost:3000/', { waitUntil:'load', timeout:30000 }).catch(()=>{});
+await p.waitForTimeout(4000);
+const info = await p.evaluate(()=>{
+ const el = document.querySelector('.hero-stage agent-3d');
+ if (!el) return 'no agent-3d';
+ const out = { tag: el.tagName, classes: el.className, loaded: el.classList.contains('loaded') };
+ const sr = el.shadowRoot;
+ if (sr) {
+ out.shadow = true;
+ // find skeleton-ish elements
+ out.shadowChildren = [...sr.children].map(c=>`${c.tagName}.${c.className||''}`);
+ const skel = sr.querySelector('.skeleton, [class*=skel], [class*=silhouet], [class*=placeholder]');
+ out.skel = skel ? `${skel.tagName}.${skel.className}` : 'none';
+ if (skel) {
+ const cs = getComputedStyle(skel);
+ out.skelStyle = { display: cs.display, opacity: cs.opacity, visibility: cs.visibility };
+ }
+ const canvas = sr.querySelector('canvas');
+ out.hasCanvas = !!canvas;
+ if (canvas) { const cs=getComputedStyle(canvas); out.canvasStyle={opacity:cs.opacity, display:cs.display}; }
+ } else { out.shadow = false; out.innerHTML = el.innerHTML.slice(0,200); }
+ return out;
+});
+console.log(JSON.stringify(info,null,2));
+await b.close();
diff --git a/pages/club.html b/pages/club.html
index 67f234254..1ea95588c 100644
--- a/pages/club.html
+++ b/pages/club.html
@@ -780,6 +780,62 @@
.club-journey { transition: opacity 0.6s ease; }
}
+ /* Agent switcher — pick which avatar you walk in as, swappable live at
+ any point in the journey. Top-left, clear of the journey nav and the
+ minimap. Toggled with the other walk-in UI by src/club-entrance.js. */
+ .club-agent-switch {
+ position: fixed;
+ top: 18px;
+ left: 18px;
+ z-index: 9445;
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ padding: 7px 10px 7px 13px;
+ border-radius: 999px;
+ background: rgba(8, 5, 12, 0.6);
+ border: 1px solid rgba(255, 59, 214, 0.18);
+ backdrop-filter: blur(10px);
+ -webkit-backdrop-filter: blur(10px);
+ box-shadow: 0 10px 34px -14px rgba(0, 0, 0, 0.85);
+ pointer-events: none;
+ opacity: 0;
+ transform: translateY(-10px);
+ transition: opacity 0.6s ease, transform 0.6s ease;
+ }
+ .club-agent-switch.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
+ .club-agent-label {
+ font: 600 11px/1 'Inter', system-ui, sans-serif;
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--text-3, #7c5d92);
+ }
+ .club-agent-select {
+ appearance: none;
+ -webkit-appearance: none;
+ max-width: 168px;
+ padding: 5px 28px 5px 11px;
+ border-radius: 999px;
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ background:
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ff7fe0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center,
+ rgba(255, 255, 255, 0.06);
+ color: #fff;
+ font: 600 12px/1 'Inter', system-ui, sans-serif;
+ cursor: pointer;
+ text-overflow: ellipsis;
+ transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
+ }
+ .club-agent-select:hover { border-color: rgba(255, 59, 214, 0.5); }
+ .club-agent-select:focus-visible { outline: none; border-color: #ff3bd6; box-shadow: 0 0 0 3px rgba(255, 59, 214, 0.25); }
+ .club-agent-select:disabled { opacity: 0.55; cursor: progress; }
+ .club-agent-select option { background: #120a18; color: #fff; }
+ @media (max-width: 560px) {
+ .club-agent-switch { top: 14px; left: 12px; padding: 6px 9px 6px 11px; gap: 7px; }
+ .club-agent-label { display: none; }
+ .club-agent-select { max-width: 132px; font-size: 11px; }
+ }
+
/* Minimap — top-down radar of the room you're in: your avatar, the
way you're facing, and a pulsing line to the door you're headed
for. Drawn each frame by src/club-entrance.js. */
@@ -1643,6 +1699,12 @@
<li class="club-journey-step" data-step="3"><span class="cj-dot"></span><span class="cj-label">Stage</span></li>
</ol>
</nav>
+ <div id="club-agent-switch" class="club-agent-switch">
+ <span class="club-agent-label">Agent</span>
+ <select id="club-agent-select" class="club-agent-select" aria-label="Choose which agent you walk as">
+ <option value="">Loading…</option>
+ </select>
+ </div>
<div id="club-minimap" class="club-minimap" aria-hidden="true">
<div class="club-minimap-head">
<span id="club-minimap-label" class="club-minimap-label">Alley</span>
diff --git a/pages/home.html b/pages/home.html
index d981b9104..8d03a9597 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -4915,28 +4915,28 @@
return el;
}
async function bootHeroAvatar() {
- const heroInner = document.getElementById(‘hero-stage-inner’);
+ const heroInner = document.getElementById('hero-stage-inner');
try {
const r = await fetch(`${location.origin}/api/avatars/${AVATAR_ID}`);
- if (!r.ok) throw new Error(‘HTTP ‘ + r.status);
+ if (!r.ok) throw new Error('HTTP ' + r.status);
const d = await r.json();
const glb = devProxyGlb(d.avatar?.model_url || d.avatar?.url);
- if (!glb) throw new Error(‘no model url’);
+ if (!glb) throw new Error('no model url');
if (heroInner) {
- heroInner.innerHTML = ‘’;
+ heroInner.innerHTML = '';
const heroEl = spawnAgent(glb);
heroInner.appendChild(heroEl);
initHeroWalk(heroEl);
initHeroChips(heroEl);
}
} catch (e) {
- console.warn(‘[home] avatar boot failed’, e);
+ console.warn('[home] avatar boot failed', e);
if (heroInner) {
- heroInner.innerHTML = ‘<div class="hero-stage-fallback" role="status">’
- + ‘<p>The live preview couldn’t load right now.</p>’
- + ‘<button type="button" class="btn btn--sm" id="hero-retry">Retry</button></div>’;
- heroInner.querySelector(‘#hero-retry’)?.addEventListener(‘click’, () => {
- heroInner.innerHTML = ‘’;
+ heroInner.innerHTML = '<div class="hero-stage-fallback" role="status">'
+ + '<p>The live preview couldn’t load right now.</p>'
+ + '<button type="button" class="btn btn--sm" id="hero-retry">Retry</button></div>';
+ heroInner.querySelector('#hero-retry')?.addEventListener('click', () => {
+ heroInner.innerHTML = '';
bootHeroAvatar();
});
}
diff --git a/pages/ibm/HOSTING.md b/pages/ibm/HOSTING.md
index c9ad10d49..17b536720 100644
--- a/pages/ibm/HOSTING.md
+++ b/pages/ibm/HOSTING.md
@@ -18,6 +18,25 @@ retried with an `X-PAYMENT` header, and the call settles on-chain in about a sec
key, no account, no invoice. The page shows the live `402` challenge, runs a real paid call,
and renders the response plus the on-chain transaction receipt.
+## The 3D agent layer (below the demo)
+
+Below the payment demo the page embeds three live three.ws product surfaces, all loaded at
+runtime from `https://three.ws` (still no build step, still no backend):
+
+- **A 3D AI agent** — the `<agent-3d>` web component renders a WebGL avatar that runs its own
+ brain in the browser and **reacts to the payment**: it celebrates and announces the
+ settlement the moment the visitor's `402` call clears. It lazy-boots only when scrolled into
+ view, and degrades to a calm skeleton if its script is blocked.
+- **Forge / Play / IRL rooms** — three cards that, on click, lazy-load the real
+ `three.ws/forge`, `three.ws/play`, and `three.ws/irl` surfaces inline in an `<iframe>` (each
+ with an "open full-screen" fallback). Nothing loads until the visitor asks for it.
+
+Because these load the agent runtime, an avatar GLB, the agent's model endpoint, and framed
+three.ws pages, the **Tier 2** CSP below adds `https://three.ws` to `frame-src`/`img-src` and
+`blob:` to `worker-src`. If you only want the original payment demo and not the agent layer,
+delete the `#agent` and `#rooms` `<section>`s plus the `agent-3d.js` `<script>` tag, and the
+**Tier 1** policy is all you need.
+
## What to upload
Copy these to the same directory on the host (paths are relative, so they must stay together):
@@ -66,10 +85,16 @@ the Base button works fully.
> `<script>`. If IBM requires nonces, add a per-response nonce to the inline `<style>` and
> `<script>` tags instead of `'unsafe-inline'`.
-### Tier 2 — Full (Base + Solana / Phantom)
+> Under Tier 1 the **3D agent layer** (the agent, and the Forge/Play/IRL rooms) is also
+> blocked — it needs `frame-src`, `worker-src blob:`, and `https://three.ws` in `img-src`,
+> which Tier 1 omits. Use Tier 2 to enable it, or remove those sections (see above) to keep
+> Tier 1.
+
+### Tier 2 — Full (Base + Solana, plus the 3D agent layer)
-The Solana path dynamic-imports `@solana/web3.js` from `esm.sh` and calls a three.ws helper.
-Add those origins:
+The Solana path dynamic-imports `@solana/web3.js` from `esm.sh`. The agent layer adds the
+`<agent-3d>` runtime + avatar GLB + model endpoint (all `https://three.ws`), a WebGL/worker
+`blob:` context, and framed three.ws surfaces. One policy covers all of it:
```
Content-Security-Policy:
@@ -78,7 +103,9 @@ Content-Security-Policy:
connect-src https://three.ws https://esm.sh;
style-src 'self' 'unsafe-inline';
font-src 'self';
- img-src 'self' data:;
+ img-src 'self' data: blob: https://three.ws;
+ worker-src 'self' blob:;
+ frame-src https://three.ws;
base-uri 'self';
```
diff --git a/pages/ibm/x402-demo.html b/pages/ibm/x402-demo.html
index dac12aa92..1dea7a59b 100644
--- a/pages/ibm/x402-demo.html
+++ b/pages/ibm/x402-demo.html
@@ -296,6 +296,61 @@ a:focus-visible{outline-offset:3px}
.raw summary{min-height:44px;display:flex;align-items:center}
}
+/* ── 3D agent layer ── */
+.agent-grid{display:grid;grid-template-columns:1fr;gap:28px;margin-top:28px;align-items:start}
+@media(min-width:760px){.agent-grid{grid-template-columns:minmax(0,360px) 1fr;gap:36px}}
+.agent-stage{position:relative;border:1px solid var(--ibm-divider);background:var(--ibm-field);min-height:420px;overflow:hidden}
+.agent-stage agent-3d{display:block;width:100%;height:460px}
+/* Skeleton silhouette shown until the web component upgrades + boots. The booted
+ agent paints over it; if the script never loads, this stays as a calm fallback. */
+.agent-skel{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:3%;padding-bottom:8%;pointer-events:none}
+.agent-skel .s-head{width:22%;max-width:84px;aspect-ratio:1;border-radius:50%;background:linear-gradient(90deg,var(--ibm-skel-a) 25%,var(--ibm-skel-b) 37%,var(--ibm-skel-a) 63%);background-size:400% 100%;animation:sk 1.6s ease infinite}
+.agent-skel .s-body{width:42%;max-width:160px;height:44%;border-radius:44% 44% 24% 24%/26% 26% 9% 9%;background:linear-gradient(90deg,var(--ibm-skel-a) 25%,var(--ibm-skel-b) 37%,var(--ibm-skel-a) 63%);background-size:400% 100%;animation:sk 1.6s ease infinite}
+agent-3d:defined ~ .agent-skel{display:none}
+.agent-copy h3{font-size:18px;font-weight:600;margin-bottom:8px}
+.agent-copy p{font-size:14px;color:var(--ibm-muted);font-weight:300;line-height:1.65;margin-bottom:14px;max-width:48ch}
+.agent-copy .agent-state{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:500;color:var(--ibm-subtle);border:1px solid var(--ibm-border);padding:5px 12px;border-radius:2px;margin-bottom:14px}
+.agent-copy .agent-state .dot{width:7px;height:7px;border-radius:50%;background:var(--ibm-subtle);flex:0 0 auto;transition:background .2s}
+.agent-copy .agent-state.ready .dot{background:var(--ibm-green)}
+.agent-copy .agent-state.acting .dot{background:var(--ibm-blue);animation:dotpulse 1.2s var(--ease) infinite}
+.agent-copy .agent-state.err .dot{background:var(--ibm-red)}
+.agent-prompts{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
+.agent-prompt{font-size:12px;font-weight:500;color:var(--ibm-blue);background:none;border:1px solid var(--ibm-border);padding:7px 12px;cursor:pointer;border-radius:2px;font-family:inherit;transition:border-color .12s,background .12s}
+.agent-prompt:hover{border-color:var(--ibm-blue);background:var(--ibm-field)}
+
+/* ── Rooms (Forge / Play / IRL) ── */
+.rooms{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--ibm-border);border:1px solid var(--ibm-border);margin-top:28px}
+@media(max-width:760px){.rooms{grid-template-columns:1fr}}
+.room{background:var(--ibm-surface);display:flex;flex-direction:column;min-height:240px}
+.room-head{padding:22px 22px 0;flex:0 0 auto}
+.room-ico{width:34px;height:34px;color:var(--ibm-blue);margin-bottom:12px}
+.room-ico svg{width:100%;height:100%;display:block}
+.room h3{font-size:16px;font-weight:600;margin-bottom:6px}
+.room h3 .verb{font-family:var(--font-mono);font-size:11px;color:var(--ibm-blue);font-weight:500;display:block;letter-spacing:.06em;text-transform:uppercase;margin-bottom:5px}
+.room p{font-size:13px;color:var(--ibm-muted);font-weight:300;line-height:1.55}
+.room-actions{margin-top:auto;padding:16px 22px 20px;display:flex;flex-wrap:wrap;gap:10px;align-items:center}
+.room-open{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--ibm-blue-fill);color:#fff;border:none;cursor:pointer;font-family:inherit;font-size:13px;font-weight:500;padding:9px 16px;transition:background .12s,transform .04s}
+.room-open:hover{background:var(--ibm-blue-fill-hover)}
+.room-open:active{transform:translateY(1px)}
+.room-out{font-size:12px;font-weight:500;color:var(--ibm-muted)}
+.room-out:hover{color:var(--ibm-blue)}
+/* Inline embed slot — hidden until launched, then fills with the live iframe. */
+.room-embed{display:none;position:relative;border-top:1px solid var(--ibm-border);background:var(--ibm-field)}
+.room.is-live .room-embed{display:block}
+.room.is-live .room-head,.room.is-live .room-actions{display:none}
+.room-embed iframe{display:block;width:100%;height:540px;border:0;background:var(--ibm-field)}
+.room-embed .embed-bar{display:flex;justify-content:space-between;align-items:center;padding:8px 14px;border-bottom:1px solid var(--ibm-border);font-size:12px;color:var(--ibm-subtle);font-weight:500}
+.room-embed .embed-bar button{background:none;border:1px solid var(--ibm-divider);color:var(--ibm-ink);font-family:inherit;font-size:12px;font-weight:500;padding:5px 10px;cursor:pointer;border-radius:2px}
+.room-embed .embed-bar button:hover{border-color:var(--ibm-blue);color:var(--ibm-blue)}
+.room-embed .embed-load{position:absolute;left:0;right:0;top:37px;bottom:0;display:flex;align-items:center;justify-content:center;gap:10px;font-size:13px;color:var(--ibm-subtle);background:var(--ibm-field)}
+.room-embed.loaded .embed-load{display:none}
+.room-embed .embed-load .spin{width:16px;height:16px;border:2px solid var(--ibm-divider);border-top-color:var(--ibm-blue);border-radius:50%;animation:spin .8s linear infinite}
+.room-embed .embed-err{position:absolute;left:0;right:0;top:37px;bottom:0;display:none;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:20px;text-align:center;font-size:13px;color:var(--ibm-muted);background:var(--ibm-field)}
+.room-embed.failed .embed-err{display:flex}
+.room-embed.failed .embed-load,.room-embed.failed iframe{display:none}
+.room-embed .embed-err a{font-weight:600}
+@media(pointer:coarse){.room-open,.room-embed .embed-bar button,.agent-prompt{min-height:44px}}
+
@media(prefers-reduced-motion:reduce){
*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
}
@@ -412,6 +467,113 @@ a:focus-visible{outline-offset:3px}
</div>
</section>
+<!-- ══ THE AGENT ══ -->
+<section class="section" id="agent" aria-labelledby="agent-h">
+ <div class="inner">
+ <div class="section-tag">The buyer, embodied</div>
+ <h2 id="agent-h">An <strong>agent</strong> that pays for its own data</h2>
+ <p class="section-lead">Everything you just did by hand — read the price, sign, settle — an autonomous agent can do on its own. This is one of them: a 3D agent from three.ws, running its own brain in your browser. It watches the call above and reacts the moment your payment settles. Ask it how x402 works.</p>
+
+ <div class="agent-grid">
+ <div class="agent-stage">
+ <!-- The web component lazy-boots when scrolled into view; until it upgrades,
+ this skeleton holds the frame so there is never a blank box. -->
+ <agent-3d
+ id="guideAgent"
+ chat
+ body="https://three.ws/avatars/readyplayerme.glb"
+ name="Aria"
+ brain="claude-opus-4-8"
+ background="transparent"
+ width="100%" height="460px"
+ name-plate="on"
+ instructions="You are Aria, the live guide for the x402 demo on three.ws (an IBM Business Partner). x402 reactivates the dormant HTTP 402 Payment Required status as a payment rail: a request to a paid endpoint returns 402 with machine-readable terms (amount, asset, network, recipient); the wallet signs a gasless USDC authorization; the call is retried with an X-PAYMENT header and settles on Base or Solana in about a second — no key, no account, no invoice. You yourself just paid one tenth of a cent to call a real three.ws API. You can also explain Forge (turn a text prompt into a textured 3D model), Play (drop an agent into a live 3D world), and IRL (place an agent in augmented reality on a phone). The only coin three.ws issues is $THREE — never name, invent, or recommend any other token. Be concise, concrete, and friendly. Two or three sentences per answer."
+ style="--agent-accent:#0f62fe;--agent-surface:rgba(22,22,22,.92);--agent-on-surface:#f4f4f4;--agent-bubble-bg:#ffffff;--agent-bubble-color:#161616;--agent-chat-font:'IBM Plex Sans',system-ui,sans-serif">
+ </agent-3d>
+ <div class="agent-skel" aria-hidden="true"><span class="s-head"></span><span class="s-body"></span></div>
+ </div>
+
+ <div class="agent-copy">
+ <div class="agent-state" id="agentState"><span class="dot" aria-hidden="true"></span><span id="agentStateText">Waking the agent…</span></div>
+ <h3>It reacts to the payment above — in real time</h3>
+ <p>Run the $0.001 call and watch: Aria celebrates the moment the transaction settles and announces what just happened on-chain. The same primitives that power the demo button power her — she signs, pays, and reads results exactly the way you just did, only autonomously.</p>
+ <p>She runs on <span class="mono">claude-opus-4-8</span>, rendered live with WebGL — no video, no pre-recording. Ask her anything:</p>
+ <div class="agent-prompts" id="agentPrompts">
+ <button class="agent-prompt" type="button" data-ask="In one breath, what is x402?">What is x402?</button>
+ <button class="agent-prompt" type="button" data-ask="Why settle micropayments on-chain instead of with a credit card?">Why on-chain?</button>
+ <button class="agent-prompt" type="button" data-ask="What is the $THREE token and what is it for?">What is $THREE?</button>
+ <button class="agent-prompt" type="button" data-ask="How could an autonomous agent pay for an API call by itself?">Agents paying agents?</button>
+ </div>
+ </div>
+ </div>
+ </div>
+</section>
+
+<!-- ══ ROOMS ══ -->
+<section class="section" id="rooms" aria-labelledby="rooms-h">
+ <div class="inner">
+ <div class="section-tag">Where agents come from, live, and go</div>
+ <h2 id="rooms-h">Step into the rest of <strong>three.ws</strong></h2>
+ <p class="section-lead">The agent above didn't appear from nowhere. Forge built her body, Play is the world she lives in, and IRL puts her in the room with you. Each one is a real, production three.ws surface — load it right here, or open it full-screen.</p>
+
+ <div class="rooms">
+ <!-- FORGE -->
+ <div class="room" data-room="forge" data-src="https://three.ws/forge" data-allow="clipboard-write; xr-spatial-tracking; fullscreen">
+ <div class="room-head">
+ <div class="room-ico" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M3 7l9-4 9 4-9 4-9-4z"/><path d="M3 7v10l9 4 9-4V7"/><path d="M12 11v10"/></svg></div>
+ <h3><span class="verb">Forge · Text → 3D</span>Describe it, get a model</h3>
+ <p>Type a prompt and Forge returns a textured, downloadable GLB you can orbit, rig, and drop into any agent — bodies like Aria's start here.</p>
+ </div>
+ <div class="room-actions">
+ <button class="room-open" type="button">Open inline →</button>
+ <a class="room-out" href="https://three.ws/forge" target="_blank" rel="noopener">Full page ↗</a>
+ </div>
+ <div class="room-embed">
+ <div class="embed-bar"><span>three.ws/forge</span><button type="button" data-close>Close</button></div>
+ <div class="embed-load"><span class="spin" aria-hidden="true"></span><span>Loading Forge…</span></div>
+ <div class="embed-err">Couldn't load Forge inline. <a href="https://three.ws/forge" target="_blank" rel="noopener">Open it in a new tab ↗</a></div>
+ </div>
+ </div>
+
+ <!-- PLAY -->
+ <div class="room" data-room="play" data-src="https://three.ws/play" data-allow="fullscreen; gamepad; xr-spatial-tracking; autoplay">
+ <div class="room-head">
+ <div class="room-ico" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6"><rect x="2" y="6" width="20" height="12" rx="6"/><path d="M7 12h4M9 10v4"/><circle cx="16" cy="11" r="1"/><circle cx="18.5" cy="13.5" r="1"/></svg></div>
+ <h3><span class="verb">Play · Live worlds</span>Drop an agent into a world</h3>
+ <p>A multiplayer 3D space where agents and visitors share the same room — walk, wave, and watch them react to live on-chain activity.</p>
+ </div>
+ <div class="room-actions">
+ <button class="room-open" type="button">Open inline →</button>
+ <a class="room-out" href="https://three.ws/play" target="_blank" rel="noopener">Full page ↗</a>
+ </div>
+ <div class="room-embed">
+ <div class="embed-bar"><span>three.ws/play</span><button type="button" data-close>Close</button></div>
+ <div class="embed-load"><span class="spin" aria-hidden="true"></span><span>Loading Play…</span></div>
+ <div class="embed-err">Couldn't load Play inline. <a href="https://three.ws/play" target="_blank" rel="noopener">Open it in a new tab ↗</a></div>
+ </div>
+ </div>
+
+ <!-- IRL -->
+ <div class="room" data-room="irl" data-src="https://three.ws/irl" data-allow="camera; gyroscope; accelerometer; magnetometer; xr-spatial-tracking; fullscreen">
+ <div class="room-head">
+ <div class="room-ico" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M3 9l9-6 9 6v6l-9 6-9-6V9z"/><path d="M12 3v18M3 9l9 6 9-6"/></svg></div>
+ <h3><span class="verb">IRL · Augmented reality</span>Put an agent in the room</h3>
+ <p>Anchor a 3D agent to real space and view it through your phone's camera. Best on a mobile device — scan the QR or open IRL on your phone.</p>
+ </div>
+ <div class="room-actions">
+ <button class="room-open" type="button">Open inline →</button>
+ <a class="room-out" href="https://three.ws/irl" target="_blank" rel="noopener">Full page ↗</a>
+ </div>
+ <div class="room-embed">
+ <div class="embed-bar"><span>three.ws/irl</span><button type="button" data-close>Close</button></div>
+ <div class="embed-load"><span class="spin" aria-hidden="true"></span><span>Loading IRL…</span></div>
+ <div class="embed-err">Couldn't load IRL inline — AR works best opened directly on a phone. <a href="https://three.ws/irl" target="_blank" rel="noopener">Open on your device ↗</a></div>
+ </div>
+ </div>
+ </div>
+ </div>
+</section>
+
<!-- ══ EMBED ══ -->
<section class="section" aria-labelledby="embed-h">
<div class="inner">
@@ -441,6 +603,9 @@ a:focus-visible{outline-offset:3px}
<a href="https://three.ws/docs/x402" target="_blank" rel="noopener">x402 Protocol</a>
<a href="https://three.ws/docs/ibm-x402" target="_blank" rel="noopener">IBM × x402 Docs</a>
<a href="https://three.ws/bazaar" target="_blank" rel="noopener">Endpoint Bazaar</a>
+ <a href="https://three.ws/forge" target="_blank" rel="noopener">Forge</a>
+ <a href="https://three.ws/play" target="_blank" rel="noopener">Play</a>
+ <a href="https://three.ws/irl" target="_blank" rel="noopener">IRL</a>
<a href="https://three.ws/changelog" target="_blank" rel="noopener">Changelog</a>
</nav>
<div class="footer-legal">
@@ -451,6 +616,8 @@ a:focus-visible{outline-offset:3px}
<!-- x402 drop-in payment modal (Phantom/MetaMask wallet flow + 402 retry) -->
<script type="module" src="https://three.ws/x402.js"></script>
+<!-- <agent-3d> web component — the whole 3D agent framework in one tag. Lazy-boots when scrolled into view. -->
+<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
<script>
(function () {
@@ -530,6 +697,106 @@ a:focus-visible{outline-offset:3px}
return null;
}
+ // ── 3D agent layer ────────────────────────────────────────────────────────
+ // The <agent-3d> element exposes scripted, LLM-free reactions (expressEmotion,
+ // playEmote, wave, notify). We drive those from the real payment lifecycle so
+ // the agent visibly responds to the same on-chain events the demo renders —
+ // no faked timing, no canned animation loop.
+ var agentReady = false;
+ function agentEl() { return document.getElementById('guideAgent'); }
+ function setAgentState(cls, text) {
+ var s = $('agentState'); if (!s) return;
+ s.className = 'agent-state' + (cls ? ' ' + cls : '');
+ $('agentStateText').textContent = text;
+ }
+ // Fire a reaction only once the component has booted; calls before that no-op
+ // safely inside the element, but gating avoids wasted work.
+ function agentReact(fn) {
+ var el = agentEl();
+ if (!el || !agentReady) return;
+ try { fn(el); } catch (_) {}
+ }
+ function wireAgent() {
+ var el = agentEl();
+ if (!el) return;
+ el.addEventListener('agent:ready', function () {
+ agentReady = true;
+ setAgentState('ready', 'Agent ready — ask it anything');
+ });
+ el.addEventListener('agent:error', function () {
+ setAgentState('err', 'Agent had trouble loading');
+ });
+ // Suggestion buttons hand the question to the agent's own brain.
+ var prompts = $('agentPrompts');
+ if (prompts) prompts.addEventListener('click', function (e) {
+ var btn = e.target.closest('[data-ask]'); if (!btn) return;
+ var el2 = agentEl();
+ if (el2 && typeof el2.say === 'function') {
+ el2.say(btn.getAttribute('data-ask'));
+ setAgentState('acting', 'Agent is answering…');
+ document.getElementById('agent').scrollIntoView({ behavior: prefersReducedMotion() ? 'auto' : 'smooth', block: 'center' });
+ }
+ });
+ }
+ function agentOnWaiting() {
+ setAgentState('acting', 'Watching your wallet…');
+ agentReact(function (el) { if (el.expressEmotion) el.expressEmotion('patience', 0.6); });
+ }
+ function agentOnSettled(out) {
+ var net = networkLabel((out.payment || {}).network);
+ setAgentState('acting', 'Settled — the agent saw it');
+ agentReact(function (el) {
+ if (el.expressEmotion) el.expressEmotion('celebration', 0.95);
+ if (el.playEmote) el.playEmote('cheer');
+ if (el.notify) el.notify('Settled on ' + net + ' — I just paid $0.001 for that call myself.', { priority: 'normal', duration: 7000 });
+ });
+ setTimeout(function () { if (agentReady) setAgentState('ready', 'Agent ready — ask it anything'); }, 7200);
+ }
+ function agentOnError() {
+ setAgentState(agentReady ? 'ready' : '', agentReady ? 'Agent ready — ask it anything' : 'Waking the agent…');
+ agentReact(function (el) { if (el.expressEmotion) el.expressEmotion('concern', 0.8); });
+ }
+
+ // ── rooms: lazy-load real three.ws surfaces inline on demand ───────────────
+ // Nothing loads until the visitor clicks — keeps the page light and respects
+ // data. The iframe streams a live, framable production surface (frame-ancestors
+ // is open for these routes); a load timeout falls back to an "open in tab" path.
+ function wireRooms() {
+ var rooms = document.querySelectorAll('.room');
+ Array.prototype.forEach.call(rooms, function (room) {
+ var openBtn = room.querySelector('.room-open');
+ var embed = room.querySelector('.room-embed');
+ var closeBtn = room.querySelector('[data-close]');
+ var loadedIframe = null, timer = null;
+
+ openBtn.addEventListener('click', function () {
+ if (loadedIframe) { room.classList.add('is-live'); return; }
+ room.classList.add('is-live');
+ embed.classList.remove('failed', 'loaded');
+ var iframe = document.createElement('iframe');
+ iframe.title = room.getAttribute('data-room') + ' — three.ws';
+ iframe.loading = 'lazy';
+ iframe.setAttribute('allow', room.getAttribute('data-allow') || '');
+ iframe.setAttribute('referrerpolicy', 'no-referrer-when-downgrade');
+ iframe.addEventListener('load', function () {
+ clearTimeout(timer);
+ embed.classList.add('loaded');
+ });
+ // If the surface refuses to frame or stalls, surface the new-tab fallback.
+ timer = setTimeout(function () {
+ if (!embed.classList.contains('loaded')) embed.classList.add('failed');
+ }, 12000);
+ iframe.src = room.getAttribute('data-src');
+ embed.appendChild(iframe);
+ loadedIframe = iframe;
+ });
+
+ closeBtn.addEventListener('click', function () {
+ room.classList.remove('is-live');
+ });
+ });
+ }
+
// ── 1. live 402 challenge preview ─────────────────────────────────────────
function loadChallengePreview() {
var ticker = sanitizeTicker($('ticker').value) || 'GRANITE';
@@ -599,11 +866,13 @@ a:focus-visible{outline-offset:3px}
var el = $('result'); el.className = 'result is-empty';
el.innerHTML = 'Run the call to see live, on-chain-paid data appear here.';
announce('');
+ setAgentState(agentReady ? 'ready' : '', agentReady ? 'Agent ready — ask it anything' : 'Waking the agent…');
}
function setResultLoading(msg) {
var el = $('result'); el.className = 'result is-loading';
el.innerHTML = '<div class="r-status"><span class="spin" aria-hidden="true"></span><span>' + escapeHtml(msg || 'Waiting for your wallet…') + '</span></div>';
announce(msg || 'Waiting for your wallet.');
+ agentOnWaiting();
}
function setResultError(msg) {
var text = msg || 'Something went wrong.';
@@ -611,6 +880,7 @@ a:focus-visible{outline-offset:3px}
el.innerHTML = '<div class="r-status err"><span aria-hidden="true">✕</span> <span>' + escapeHtml(text) + '</span></div><button class="retry" type="button" id="retryBtn">Try again</button>';
var rb = $('retryBtn'); if (rb) rb.addEventListener('click', runPayment);
announce('Error: ' + text);
+ agentOnError();
}
function recoPill(result) {
if (result.exact_collision) return '<span class="pill bad">taken</span>';
@@ -622,6 +892,7 @@ a:focus-visible{outline-offset:3px}
var result = out.result || {};
var payment = out.payment || {};
var el = $('result'); el.className = 'result is-done';
+ agentOnSettled(out);
var html = '';
html += '<div class="r-status ok"><span class="r-check" aria-hidden="true">✓</span><span>Payment settled — response delivered</span></div>';
@@ -792,6 +1063,8 @@ a:focus-visible{outline-offset:3px}
}
});
+ wireAgent();
+ wireRooms();
pollForWallet();
loadChallengePreview();
})();
diff --git a/public/changelog.json b/public/changelog.json
index 167d5bab9..3be96fe35 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-17T20:21:48.884Z",
+ "generated_at": "2026-06-17T21:40:08.142Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -645,6 +645,16 @@
"fix"
]
},
+ {
+ "date": "2026-06-17",
+ "type": "update",
+ "title": "Pole Club dancers are three distinct avatars again",
+ "summary": "The three dancers in the Pole Club had collapsed onto a single look. Each pole is now pinned to its own verified, distinct 3D rig — including Dylan from the gallery — so the lineup reads as three different dancers again. You can still swap any pole to a different avatar with the new per-pole Avatar picker.",
+ "link": "/club",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-06-17",
"type": "update",
@@ -748,6 +758,16 @@
"improvement"
]
},
+ {
+ "date": "2026-06-17",
+ "type": "update",
+ "title": "The IBM x402 demo grew a 3D agent that pays for itself",
+ "summary": "The live x402 demo at three.ws/ibm/x402-demo now has a 3D AI agent below the payment card. When you run the $0.001 call, the agent watches the same on-chain settlement you do and reacts in real time — it celebrates and announces the payment the moment it clears. You can also ask it how x402 and $THREE work. Under it, three new rooms — Forge (text to 3D), Play (live worlds), and IRL (augmented reality) — load the real three.ws surfaces inline on a click, or open full-screen. Everything still loads from three.ws with no build step.",
+ "link": "/ibm/x402-demo",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-06-17",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index c66f193a6..5a58c3f3e 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -502,6 +502,14 @@
<category>fix</category>
<description>When you tip a dancer in the Pole Club, the platform batches your tips and sweeps them on-chain to the dancer's registered wallet. A mismatch in how a settled tip recorded its network meant Solana tips were being set aside as 'no wallet' even when the dancer had a Solana address on file, so they never went out. That's fixed: tips paid on Solana are now matched to the dancer's Solana wallet and swept correctly, alongside the existing Base payouts. No tip was ever lost — stuck tips remained queued and now sweep on the next cycle.</description>
</item>
+ <item>
+ <title>Pole Club dancers are three distinct avatars again</title>
+ <link>https://three.ws/club</link>
+ <guid isPermaLink="false">2026-06-17:Pole Club dancers are three distinct avatars again</guid>
+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The three dancers in the Pole Club had collapsed onto a single look. Each pole is now pinned to its own verified, distinct 3D rig — including Dylan from the gallery — so the lineup reads as three different dancers again. You can still swap any pole to a different avatar with the new per-pole Avatar picker.</description>
+ </item>
<item>
<title>Rarest Fits button styled in the cosmetics shop</title>
<link>https://three.ws/play</link>
@@ -582,6 +590,14 @@
<category>improvement</category>
<description>On three.ws/irl you can now open an agent by tapping its 3D body, not only its small floating name tag. Tapping near a name also works, with a finger-sized target that meets Apple's 44-pixel minimum, so you no longer have to pixel-hunt on a phone. When two agents stand on top of each other, the one in front wins instead of a random pick. As you move, the nearest agent you can reach lights up with a soft focus ring so you can see what you'll tap before you tap it — and if you've turned on Reduce Motion, the ring stays still. Looking and panning around no longer misfires as a tap.</description>
</item>
+ <item>
+ <title>The IBM x402 demo grew a 3D agent that pays for itself</title>
+ <link>https://three.ws/ibm/x402-demo</link>
+ <guid isPermaLink="false">2026-06-17:The IBM x402 demo grew a 3D agent that pays for itself</guid>
+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>The live x402 demo at three.ws/ibm/x402-demo now has a 3D AI agent below the payment card. When you run the $0.001 call, the agent watches the same on-chain settlement you do and reacts in real time — it celebrates and announces the payment the moment it clears. You can also ask it how x402 and $THREE work. Under it, three new rooms — Forge (text to 3D), Play (live worlds), and IRL (augmented reality) — load the real three.ws surfaces inline on a click, or open full-screen. Everything still loads from three.ws with no build step.</description>
+ </item>
<item>
<title>The Oracle's proof pages — wins, backtest, and live activity — load again</title>
<link>https://three.ws/oracle</link>
diff --git a/public/features.json b/public/features.json
index 43f65b4a2..3fd4b6924 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-17T20:21:48.872Z",
+ "generated_at": "2026-06-17T21:40:08.097Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/club-entrance.js b/src/club-entrance.js
index 913873be1..0518d4675 100644
--- a/src/club-entrance.js
+++ b/src/club-entrance.js
@@ -65,6 +65,20 @@ const PASS_KEY = 'club:pass:v1';
const MOVE_CLIPS = new Set(['idle', 'walk']);
const VENUE_NAMES = ['Alley', 'Gallery', 'Clubhouse']; // index-aligned with SEQUENCE, for the minimap label
+// The agent switcher's catalog: bundled, known-good humanoid rigs that ship with
+// the app (so the dropdown always has options offline — Hard rule 9), plus public
+// avatars pulled from the gallery at runtime. Deduped by URL. Any rig the clip
+// library can't drive falls back to its bind pose in the AnimationManager, so a
+// pick never freezes the walk.
+const BUNDLED_AGENTS = [
+ { key: 'default', name: 'Aria', url: AVATAR_URL },
+ { key: 'michelle', name: 'Michelle', url: '/avatars/michelle.glb' },
+ { key: 'realistic-female', name: 'Realistic', url: '/avatars/realistic-female.glb' },
+ { key: 'studio', name: 'Studio', url: '/avatars/readyplayerme.glb' },
+ { key: 'mannequin', name: 'Mannequin', url: '/avatars/mannequin.glb' },
+];
+const AGENT_GALLERY_URL = '/api/explore?source=avatar&category=avatar&only3d=1&limit=24';
+
const ROOM_HEIGHT = 7.0; // environments normalised to this Y so the avatar reads human
const AVATAR_HEIGHT = 1.75;
const MOVE_SPEED = 2.6; // metres / second
@@ -252,7 +266,10 @@ async function start(canvasEl) {
}
// ── Avatar ─────────────────────────────────────────────────────────────
- const avatar = avatarGltf.scene;
+ // `avatar` is the swappable child of the rig — the agent switcher (below)
+ // hot-swaps it live without disturbing the rig's position/heading.
+ let avatar = avatarGltf.scene;
+ let currentAvatarUrl = AVATAR_URL;
scaleToHeight(avatar, AVATAR_HEIGHT);
placeOnFloor(avatar);
const rig = new Group(); // yaw the rig; the model sits at the rig origin
@@ -260,7 +277,7 @@ async function start(canvasEl) {
scene.add(rig);
const anim = new AnimationManager();
- anim.attach(avatar);
+ anim.attach(avatar, { avatarUrl: AVATAR_URL });
const moveDefs = (Array.isArray(manifest) ? manifest : []).filter((d) => MOVE_CLIPS.has(d.name));
anim.setAnimationDefs(moveDefs);
// Inject the pre-fetched clip data directly — no second network round-trip,
@@ -324,8 +341,15 @@ async function start(canvasEl) {
const joy = { active: false, id: null, ox: 0, oy: 0, nx: 0, ny: 0 };
const look = { id: null, x: 0, y: 0, moved: false };
+ // Drop any held movement while a form control (the agent switcher) has focus,
+ // so arrow keys page its options instead of walking the avatar.
+ const typingInForm = () => {
+ const a = document.activeElement;
+ return !!a && (a.tagName === 'SELECT' || a.tagName === 'INPUT' || a.tagName === 'TEXTAREA');
+ };
const onKeyDown = (e) => {
approachAudio.arm();
+ if (typingInForm()) return;
const k = e.key.toLowerCase();
if (k === 'e') { tryEnter(); return; }
if (['w', 'a', 's', 'd', 'arrowup', 'arrowdown', 'arrowleft', 'arrowright'].includes(k)) {
@@ -334,8 +358,21 @@ async function start(canvasEl) {
}
};
const onKeyUp = (e) => keys.delete(e.key.toLowerCase());
+ // A held key whose keyup lands on another window (alt-tab, focus loss) would
+ // otherwise stick "down" forever and walk the avatar on its own. Releasing
+ // everything on blur / tab-hide is the fix.
+ const releaseControls = () => {
+ keys.clear();
+ joy.active = false; joy.id = null; joy.nx = 0; joy.ny = 0;
+ if (joyBase) joyBase.classList.remove('is-active');
+ if (joyKnob) joyKnob.style.transform = 'translate(0,0)';
+ };
+ const onBlur = () => releaseControls();
+ const onVisibility = () => { if (document.hidden) releaseControls(); };
window.addEventListener('keydown', onKeyDown);
window.addEventListener('keyup', onKeyUp);
+ window.addEventListener('blur', onBlur);
+ document.addEventListener('visibilitychange', onVisibility);
// Pointer: a drag on the left third of the screen drives the joystick (touch
// only); anything else orbits the camera.
@@ -406,6 +443,92 @@ async function start(canvasEl) {
showMinimap(true);
setJourneyStep(venueIndex);
+ // ── Agent switcher ───────────────────────────────────────────────────────
+ // Pick which avatar you walk as, live, at any point in the journey. Bundled
+ // rigs are offered immediately; public gallery avatars stream in and append.
+ const agentSelect = document.getElementById('club-agent-select');
+ let swappingAgent = false;
+
+ function setupAgentSwitch() {
+ if (!agentSelect) return;
+ renderAgentOptions(BUNDLED_AGENTS);
+ agentSelect.value = currentAvatarUrl;
+ agentSelect.addEventListener('change', onAgentChange);
+ loadGalleryAgents();
+ }
+
+ // Build/refresh the <option> list, keeping the active rig selected. Deduped by
+ // URL so a gallery avatar that matches a bundled one isn't listed twice.
+ function renderAgentOptions(list) {
+ if (!agentSelect) return;
+ const seen = new Set();
+ const opts = [];
+ for (const a of list) {
+ if (!a?.url || seen.has(a.url)) continue;
+ seen.add(a.url);
+ const o = document.createElement('option');
+ o.value = a.url;
+ o.textContent = a.name || 'Agent';
+ opts.push(o);
+ }
+ agentSelect.replaceChildren(...opts);
+ agentSelect.value = currentAvatarUrl;
+ }
+
+ let agentList = [...BUNDLED_AGENTS];
+ async function loadGalleryAgents() {
+ try {
+ const res = await fetch(AGENT_GALLERY_URL, { headers: { accept: 'application/json' } });
+ if (!res.ok) return;
+ const data = await res.json();
+ const items = Array.isArray(data?.items) ? data.items : [];
+ const extra = items
+ .filter((it) => it?.glbUrl && it.has3d !== false && it.kind === 'avatar')
+ .map((it) => ({ key: `gallery-${it.avatarId}`, name: it.name || 'Avatar', url: it.glbUrl }));
+ if (!extra.length) return;
+ agentList = [...BUNDLED_AGENTS, ...extra];
+ renderAgentOptions(agentList);
+ } catch (err) {
+ log.warn('[club-entrance] gallery agents fetch failed', err);
+ }
+ }
+
+ async function onAgentChange() {
+ const url = agentSelect.value;
+ if (!url || url === currentAvatarUrl || swappingAgent) {
+ agentSelect.value = currentAvatarUrl;
+ return;
+ }
+ swappingAgent = true;
+ agentSelect.disabled = true;
+ const movingNow = anim.currentName === 'walk';
+ try {
+ const gltf = await loader.loadAsync(url);
+ const next = gltf.scene;
+ scaleToHeight(next, AVATAR_HEIGHT);
+ placeOnFloor(next);
+ // Swap the rig's child — position, heading and camera are untouched.
+ rig.remove(avatar);
+ disposeObject(avatar);
+ avatar = next;
+ rig.add(avatar);
+ // Rebind the clip library to the new rig (idle/walk are already in memory)
+ // and resume whatever the avatar was doing so there's no T-pose flash.
+ anim.attach(avatar, { avatarUrl: url });
+ await anim.play(movingNow ? 'walk' : 'idle');
+ currentAvatarUrl = url;
+ } catch (err) {
+ log.warn('[club-entrance] agent swap failed', err);
+ agentSelect.value = currentAvatarUrl; // keep the working rig selected
+ } finally {
+ swappingAgent = false;
+ agentSelect.disabled = false;
+ }
+ }
+
+ setupAgentSwitch();
+ showAgentSwitch(true);
+
// Hint + prompt copy track where you are in the journey: the alley door takes
// the cover, the final place opens the stage, the rest just lead onward.
const isFinalVenue = () => venueIndex >= SEQUENCE.length - 1;
@@ -433,10 +556,12 @@ async function start(canvasEl) {
function tryEnter() {
if (!inputEnabled || !nearDoor) return;
inputEnabled = false;
+ releaseControls();
showPrompt(false);
showHint(false);
showJoystick(false);
showMinimap(false);
+ showAgentSwitch(false);
if (currentCover) {
// Hand off to the cover-charge card; we resume on admit (onPaid).
window.dispatchEvent(new CustomEvent('club:enter-door'));
@@ -464,6 +589,7 @@ async function start(canvasEl) {
showHint(true);
showJoystick(isTouch);
showMinimap(true);
+ showAgentSwitch(true);
});
// ── State + render loop ──────────────────────────────────────────────────
@@ -549,6 +675,7 @@ async function start(canvasEl) {
showHint(true);
showJoystick(isTouch);
showMinimap(true);
+ showAgentSwitch(true);
}
break;
}
@@ -618,7 +745,7 @@ async function start(canvasEl) {
paid = true;
currentCover = false;
approachAudio.handOff(); // the anthem (src/club.js) takes the night from here
- showPrompt(false); showHint(false); showJoystick(false); showMinimap(false);
+ showPrompt(false); showHint(false); showJoystick(false); showMinimap(false); showAgentSwitch(false);
advance();
}
onAdmit = onPaid;
@@ -638,6 +765,9 @@ async function start(canvasEl) {
window.removeEventListener('resize', onResize);
window.removeEventListener('keydown', onKeyDown);
window.removeEventListener('keyup', onKeyUp);
+ window.removeEventListener('blur', onBlur);
+ document.removeEventListener('visibilitychange', onVisibility);
+ agentSelect?.removeEventListener('change', onAgentChange);
onAdmit = null;
try { anim.dispose?.(); } catch {}
try { approachAudio?.dispose(); } catch {}
@@ -645,7 +775,7 @@ async function start(canvasEl) {
composer.dispose();
renderer.dispose();
try { canvasEl.remove(); } catch {}
- showHint(false); showJoystick(false); showPrompt(false); showJourney(false); showMinimap(false);
+ showHint(false); showJoystick(false); showPrompt(false); showJourney(false); showMinimap(false); showAgentSwitch(false);
}
}
@@ -655,6 +785,7 @@ function showHint(v) { toggle('club-controls-hint', v); }
function showJoystick(v) { toggle('club-joystick', v); }
function showJourney(v) { toggle('club-journey', v); }
function showMinimap(v) { toggle('club-minimap', v); }
+function showAgentSwitch(v) { toggle('club-agent-switch', v); }
function toggle(id, v) {
const el = document.getElementById(id);
if (el) el.classList.toggle('is-visible', !!v);
@@ -897,12 +1028,12 @@ function buildMinimap() {
}
function scaleToHeight(obj, h) {
- const b = new Box3().setFromObject(obj);
+ const b = new Box3().setFromObject(obj, true);
const cur = b.max.y - b.min.y || 1;
obj.scale.multiplyScalar(h / cur);
}
function placeOnFloor(obj) {
- const b = new Box3().setFromObject(obj);
+ const b = new Box3().setFromObject(obj, true);
obj.position.y -= b.min.y;
}
diff --git a/src/club.js b/src/club.js
index ec13cca1f..290514b52 100644
--- a/src/club.js
+++ b/src/club.js
@@ -423,17 +423,18 @@ document.querySelector('#club-stage')?.setAttribute('data-cam-mode', clubCam.get
// ── Poles + spotlights ───────────────────────────────────────────────────
const POLE_COLORS = [0xff3bd6, 0x4ad6ff, 0xff8a3b, 0x9b5dff];
-// Dancer registry — display names, bios, accent palette, and the gallery
-// avatar each dancer wears. `avatarId` is resolved through /api/avatars/:id at
-// boot (see resolveDancerAvatarUrl); a local `avatar` path can be used instead.
-// All three rigs are verified drivable by the clip library (CharacterStudio +
-// Unreal-mannequin rigs are now retargetable — see src/glb-canonicalize.js),
-// and attachAvatar falls back to the default rig if any ever isn't. Each dancer
-// is still tinted with her pole's accent color so the three read as a set.
+// Dancer registry — display names, bios, accent palette, and the avatar each
+// dancer wears. A local `avatar` path loads that GLB directly; an `avatarId`
+// is resolved through /api/avatars/:id at boot (see resolveDancerAvatarUrl).
+// The three are deliberately three DISTINCT, verified-drivable rigs so the
+// lineup never collapses onto one look: two rock-solid bundled rigs that are
+// guaranteed to retarget, plus Dylan from the gallery. attachAvatar still
+// falls back to the default rig if a rig ever isn't drivable, and each dancer
+// is tinted with her pole's accent color so the three read as a set.
const DANCER_META = [
- { name: 'Aria', bio: 'Neon pink fire. Classical meets street.', palette: 'pink', avatarId: 'cdc245f4-36f8-4e78-a1b6-58c3b73e247f' },
+ { name: 'Aria', bio: 'Neon pink fire. Classical meets street.', palette: 'pink', avatar: '/avatars/michelle.glb' },
{ name: 'Nova', bio: 'Cyan ice. Fluid and hypnotic.', palette: 'cyan', avatarId: '25195a2e-130c-4da5-8cad-8e7490d69b45' },
- { name: 'Blaze', bio: 'Amber heat. Power and precision.', palette: 'amber', avatarId: 'd92b292e-c2db-40cb-bf88-3e141c6b0057' },
+ { name: 'Blaze', bio: 'Amber heat. Power and precision.', palette: 'amber', avatar: '/avatars/realistic-female.glb' },
];
// Every dancer is scaled to this standing height (metres) so a mix of
@@ -1561,13 +1562,18 @@ const POLE_AVATARS_KEY = 'club:poleAvatars';
// key → { key, name, url }. Insertion order drives the dropdown order.
const avatarCatalog = new Map();
+// Track URLs already in the catalog so the same GLB (e.g. a dancer's own look
+// that's also a bundled rig) never appears twice — first registration wins,
+// and dancer defaults register first so each pole's own look keeps her name.
+const catalogUrls = new Set();
// url → Promise<Object3D>, so a re-pick (or two poles sharing a look) loads once.
const avatarTemplateCache = new Map();
let fallbackTemplateRef = null;
function registerAvatar(entry) {
- if (!entry?.key || !entry?.url || avatarCatalog.has(entry.key)) return;
+ if (!entry?.key || !entry?.url || avatarCatalog.has(entry.key) || catalogUrls.has(entry.url)) return;
avatarCatalog.set(entry.key, { key: entry.key, name: entry.name || 'Avatar', url: entry.url });
+ catalogUrls.add(entry.url);
}
function escapeText(value) {
diff --git a/src/collection.js b/src/collection.js
index 7789b6727..3b583fbce 100644
--- a/src/collection.js
+++ b/src/collection.js
@@ -2,7 +2,7 @@
* My Collection page — shows all purchased skills and active subscriptions.
*/
-const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyB7u6a';
+const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';
function fmtDate(iso) {
diff --git a/src/components/PriceBadge.js b/src/components/PriceBadge.js
index f50f20dd3..6e114ce93 100644
--- a/src/components/PriceBadge.js
+++ b/src/components/PriceBadge.js
@@ -1,7 +1,7 @@
// Mapping of mint addresses to human-readable currency symbols.
const CURRENCY_SYMBOLS = {
- 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyB7u6a': 'USDC',
+ 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v': 'USDC',
'So11111111111111111111111111111111111111112': 'SOL',
};
diff --git a/src/marketplace-analytics.js b/src/marketplace-analytics.js
index d907a6f3b..fbdcd3ec4 100644
--- a/src/marketplace-analytics.js
+++ b/src/marketplace-analytics.js
@@ -3,7 +3,7 @@
* Uses Canvas API to draw the volume sparkline (no external charting dependency).
*/
-const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyB7u6a';
+const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';
function fmtVolume(atomic, mint) {