Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
Agent picker, walk, worlds lobby, animation manager, and changelog updates
nirholas377c68acb325
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 762a36999..fd3900da9 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,6 +16,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Agents placed from an iPhone now land in the right real-world spot for everyone** — iPhone Safari can't use WebXR, so placing an agent in the real world relies on the phone's motion sensors and GPS. Until now it leaned on a relative gyro reading with no fixed sense of north, which meant an agent you pinned could show up rotated — or facing the wrong way — for other people standing at the same spot. IRL now reads the iPhone's true compass heading when you pin, so your agent is anchored to a real-world direction: pan your phone and it stays planted on its actual bearing instead of sliding with the camera, and walk toward it and it holds its place and grows as you approach. Everyone nearby sees it in the same orientation you intended. If your compass needs calibrating we still place the agent and tell you it may look rotated to others, rather than failing silently — and Android, which already had richer world-anchoring, is unchanged. (`/irl`) `[improvement, fix]`- **An inbox for your IRL agents — see who tapped, messaged, or paid, and reply** — Your IRL Agents dashboard now has an Inbox: a live, chronological feed of everyone who met your placed agents in real life. Each entry shows what happened — a view, a tap, a message, or a payment — where it happened, and how long ago. Payments show the exact amount and link straight to the block-explorer receipt, and you can reply to anyone who left your agent a message; if they were signed in, your reply lands in their notifications. Unread counts appear on the Inbox button and on each agent's card, the feed refreshes itself every few seconds, and opening the inbox marks everything read. High-signal events (a payment or a message) also ping you in the notification bell, so you find out the moment a stranger across the city engages your agent. (`/dashboard/irl-placements`) `[feature]`- **Animation Gallery — browse, preview, and remix community animations** — Saved and public animations are now playable anywhere three.ws renders an avatar. The new /animations gallery lists every public clip with live previews (hover a card to see the animation on a real avatar), one-click "Open in Studio" to remix any clip, and an "Animate this avatar" shortcut from the avatar gallery. Any page with an avatar panel now also shows your saved and community animations alongside the built-in library. Share a clip by its id — ?anim=<id> plays it directly in the viewer, the embed, or the Studio editor. (`/animations`) `[feature]`+- **Avatar feet stay planted on the floor** — Fixed your avatar sinking partway through the floor in the Pole Club walk-in — most noticeable in the Clubhouse. The avatar now re-checks the ground beneath it every frame and keeps its feet on the surface as you move between rooms, instead of standing at the height it spawned at. (`/club`) `[fix]`- **Avatars from any tool animate perfectly when uploaded** — Avatars exported from Mixamo, Blender, Unreal Engine, and other tools are now canonicalized at upload time — bone names are normalized and the up-axis convention is baked out — so they animate correctly out of the box with no manual fixup. Previously, Mixamo-rigged avatars needed a runtime correction that could leave limbs in unexpected poses on some clips; now the stored model is already in the canonical form every animation clip expects. (`/avatars`) `[improvement, fix]`- **Avatars now wear hats, glasses, and earrings in every coin world** — Cosmetic accessories — baseball cap, beanie, cowboy hat, round frames, shades, hoop earrings, stud earrings — are now fully rendered on every avatar in the shared worlds. Each GLB is auto-fitted to the avatar's head bone so accessories track movement and animations on any rig. Wear state syncs in real time: equipping an item shows it on your head for everyone, survives avatar swaps, and persists across sessions. A new setCosmetics network call lets the client broadcast a full loadout in one shot; the server re-validates ownership before publishing, so an unowned item can never appear on a player. (`/play`) `[feature]`- **Build mode — place, rotate, and delete props in every coin world** — Every /play coin world now has a build mode for free-standing props. Press B (or tap the ⛏ button) to open the prop palette: pick from 12 hand-crafted primitives (crate, barrel, planter, lamp, bench, pillar, arch, ramp, sign, crystal, stage, pole) or browse thousands of community gallery models that stream in as you scroll. A translucent ghost preview snaps to the floor grid under your cursor so you always know exactly where a prop will land — green when the placement is valid, red when it's outside the world radius. Press R to quarter-turn the ghost before committing. Click or tap to place; right-click or hold to remove a prop you placed. Props appear for everyone instantly through the shared object channel and survive server restarts. (`/play`) `[feature]`@@ -68,6 +69,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Nearby agents on IRL now update live — no reload** — Open three.ws/irl and the agents other people have placed around you now update in real time. When anyone nearby drops a new agent, moves one, changes its outfit, or takes one down, you see it appear, shift, or vanish on your screen within about a second — no refresh, no waiting for the next scan. It works both ways: pin an agent and everyone standing near you sees it pop in too, and walk into a new area and the live view follows you to the agents there. A small status pill next to the nearby count shows whether you're getting live updates; if the realtime connection can't be reached — some networks block it — IRL automatically falls back to refreshing every few seconds and the pill reads 'Polling', still fully working, just a touch slower. (`/irl`) `[feature, improvement]`- **Never lose your way in — a minimap on the walk to the Pole Club** — The walk-in to the Pole Club now has a live minimap in the top-right corner. It shows a top-down radar of the room you're in, your avatar as an arrow that points the way you're facing, and a pulsing line to the door you're headed for — so you always know which way the exit is. It re-fits to each room as you move from the alley to the gallery to the clubhouse, and the door marker turns green once you're in range to enter. (`/club`) `[feature]`- **Pay an IRL agent for its services — and open its full profile — right from the card** — When you tap an agent on three.ws/irl, its card now does real things. View profile opens that agent's full page so you can see who you just met. If the agent offers paid services, each one shows its price and a Use button: tap it, approve the payment in your wallet, and you pay in USDC on the spot — the standard x402 flow, capped at the price shown so a misconfigured service can never overcharge you. The response you paid for appears right inside the card instead of vanishing into a toast. Every state is handled: no wallet, a cancelled signature, or a service error each show a clear message and leave the button ready to try again, and each service button works on its own so paying for one never freezes the others. Completed encounters quietly notify the agent's owner, receipt and all. (`/irl`) `[feature]`+- **Pick a 3D agent to drop into any world** — Added a dedicated agent picker to the worlds lobby. Tap “Browse 3D agents” to search the full directory of public agents, filter by skill or on-chain status, sort by popular/newest/name, and spin each agent's avatar in a live 3D preview before you commit. Choose one and you drop into the world wearing its avatar — no more sifting through raw avatars and accessories to find an actual agent. (`/worlds`) `[feature]`- **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]`diff --git a/data/changelog.json b/data/changelog.jsonindex 8ddc943b2..12b7cb47b 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,24 @@{"$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": "Pick a 3D agent to drop into any world",+ "summary": "Added a dedicated agent picker to the worlds lobby. Tap “Browse 3D agents” to search the full directory of public agents, filter by skill or on-chain status, sort by popular/newest/name, and spin each agent's avatar in a live 3D preview before you commit. Choose one and you drop into the world wearing its avatar — no more sifting through raw avatars and accessories to find an actual agent.",+ "tags": [+ "feature"+ ],+ "link": "/worlds"+ },+ {+ "date": "2026-06-17",+ "title": "Avatar feet stay planted on the floor",+ "summary": "Fixed your avatar sinking partway through the floor in the Pole Club walk-in — most noticeable in the Clubhouse. The avatar now re-checks the ground beneath it every frame and keeps its feet on the surface as you move between rooms, instead of standing at the height it spawned at.",+ "tags": [+ "fix"+ ],+ "link": "/club"+ },{"date": "2026-06-17","title": "Quieter walk-up to the Pole Club",diff --git a/pages/ibm/x402-demo.html b/pages/ibm/x402-demo.htmlindex 7e91b85ef..7b610a980 100644--- a/pages/ibm/x402-demo.html+++ b/pages/ibm/x402-demo.html@@ -318,51 +318,39 @@ agent-3d:defined ~ .agent-skel{display:none}.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}}-/* When a room is launched it takes over the whole width — these apps are built- for a full viewport, not a one-third column. The other tiles collapse away. */-.rooms.has-live{grid-template-columns:1fr}-.rooms.has-live .room:not(.is-live){display:none}-.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}-/* Full-bleed once launched: fill the section width and most of the viewport- height so the embedded app has room to breathe. */-.room-embed iframe{display:block;width:100%;height:min(78vh,820px);border:0;background:var(--ibm-field)}-.room-embed .embed-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 14px;border-bottom:1px solid var(--ibm-border);font-size:12px;color:var(--ibm-subtle);font-weight:500}-.room-embed .embed-bar .bar-url{display:inline-flex;align-items:center;gap:8px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}-.room-embed .embed-bar .bar-actions{display:flex;gap:8px;flex:0 0 auto}-.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)}+/* ── Demo nav strip (hero) ── */+.demo-nav{display:flex;flex-wrap:wrap;gap:8px;margin-top:26px}+.demo-nav a{font-size:13px;font-weight:500;color:var(--ibm-ink);border:1px solid var(--ibm-border);padding:8px 14px;border-radius:2px;transition:border-color .12s,color .12s,background .12s}+.demo-nav a:hover{border-color:var(--ibm-blue);color:var(--ibm-blue);background:var(--ibm-field);text-decoration:none}+.demo-nav a .n{font-family:var(--font-mono);color:var(--ibm-blue);margin-right:8px;font-size:11px}++/* ── Full-size live demo embed (Forge / Play / IRL) ── */+/* Each runs at full content width and most of the viewport height — these are+ real production apps, presented full-size, lazy-loaded as they scroll in. */+.live-embed{border:1px solid var(--ibm-divider);background:var(--ibm-surface);margin-top:28px}+.live-embed .embed-bar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:9px 16px;border-bottom:1px solid var(--ibm-border);font-size:12px;color:var(--ibm-subtle);font-weight:500}+.live-embed .bar-url{display:inline-flex;align-items:center;gap:8px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--font-mono)}+.live-embed .bar-url .dot{width:7px;height:7px;border-radius:50%;background:var(--ibm-amber);flex:0 0 auto;transition:background .2s}+.live-embed.loaded .bar-url .dot{background:var(--ibm-green)}+.live-embed.failed .bar-url .dot{background:var(--ibm-red)}+.live-embed .bar-actions{display:flex;gap:8px;flex:0 0 auto}+.live-embed .bar-actions button,.live-embed .bar-actions a{background:none;border:1px solid var(--ibm-divider);color:var(--ibm-ink);font-family:inherit;font-size:12px;font-weight:500;padding:6px 11px;cursor:pointer;border-radius:2px;display:inline-flex;align-items:center;gap:5px;text-decoration:none}+.live-embed .bar-actions button:hover,.live-embed .bar-actions a:hover{border-color:var(--ibm-blue);color:var(--ibm-blue)}+.embed-frame{position:relative;background:var(--ibm-field);height:min(78vh,820px)}+.embed-frame iframe{display:block;width:100%;height:100%;border:0;background:var(--ibm-field)}/* True full-screen via the Fullscreen API — the app fills the whole display. */-.room-embed:fullscreen{background:var(--ibm-surface);display:flex;flex-direction:column}-.room-embed:fullscreen iframe{height:100%;flex:1}-.room-embed:-webkit-full-screen{background:var(--ibm-surface)}-.room-embed:-webkit-full-screen iframe{height:100%}-.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}}+.live-embed:fullscreen{display:flex;flex-direction:column;background:var(--ibm-surface)}+.live-embed:fullscreen .embed-frame{flex:1;height:auto}+.live-embed:-webkit-full-screen{background:var(--ibm-surface)}+.embed-state{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;padding:24px;color:var(--ibm-subtle);font-size:14px;background:var(--ibm-field)}+.embed-state .spin{width:18px;height:18px;border:2px solid var(--ibm-divider);border-top-color:var(--ibm-blue);border-radius:50%;animation:spin .8s linear infinite}+.embed-state .es-hint{font-size:12px;color:var(--ibm-subtle);max-width:44ch;font-weight:300;line-height:1.55}+.embed-err{display:none}+.live-embed.loaded .embed-load{display:none}+.live-embed.failed .embed-load{display:none}+.live-embed.failed .embed-err{display:flex}+.embed-err a{font-weight:600}+@media(pointer:coarse){.agent-prompt,.demo-nav a,.live-embed .bar-actions button,.live-embed .bar-actions a{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}@@ -401,8 +389,16 @@ agent-3d:defined ~ .agent-skel{display:none}<span style="color:var(--ibm-border)" aria-hidden="true">|</span><span class="mono">three.ws</span></div>- <h1>See <strong>x402</strong> work — pay a fraction of a cent for a real API call</h1>- <p class="hero-sub">x402 turns the dormant HTTP <span class="mono">402 Payment Required</span> status into a payment rail. A normal request comes back with machine-readable payment terms; your wallet signs a stablecoin authorization and retries; the call settles on-chain in about a second. No keys, no account, no invoice. Try it below with your own wallet.</p>+ <h1>A live showcase of agentic commerce, built with <strong>IBM</strong></h1>+ <p class="hero-sub">IBM has shaped computing for over a century — and it stays at the frontier by backing what comes next. three.ws is one of those bets: a platform for on-chain micropayments and embodied AI agents. As an IBM Business Partner, we built this page to demonstrate that partnership in the open — every demo below runs against real, production three.ws systems. Nothing is mocked, nothing is a slide.</p>+ <p class="hero-sub" style="margin-top:14px">Five things we want to show you: pay-per-call micropayments over <span class="mono">x402</span>, an autonomous 3D agent that buys its own data, text turned into a 3D model, a shared 3D world, and an agent placed in augmented reality. Try each one yourself.</p>+ <nav class="demo-nav" aria-label="The demos on this page">+ <a href="#demo"><span class="n">01</span>x402 payments</a>+ <a href="#agent"><span class="n">02</span>3D agent</a>+ <a href="#forge"><span class="n">03</span>Forge</a>+ <a href="#play"><span class="n">04</span>Play</a>+ <a href="#irl"><span class="n">05</span>IRL</a>+ </nav></div></header>@@ -435,7 +431,7 @@ agent-3d:defined ~ .agent-skel{display:none}<!-- ══ LIVE DEMO ══ --><section class="section" id="demo" aria-labelledby="demo-h"><div class="inner">- <div class="section-tag">Live · production endpoint</div>+ <div class="section-tag">Demo 01 · Payments</div><h2 id="demo-h">Buy a <strong>data call</strong> for $0.001</h2><p class="section-lead">This calls a real three.ws API — a token-symbol availability check — for one tenth of a cent in USDC, settled on Base or Solana mainnet. Nothing here is mocked: the price below is read live from the server's own 402 response.</p>@@ -495,7 +491,7 @@ agent-3d:defined ~ .agent-skel{display:none}<!-- ══ THE AGENT ══ --><section class="section" id="agent" aria-labelledby="agent-h"><div class="inner">- <div class="section-tag">The buyer, embodied</div>+ <div class="section-tag">Demo 02 · Embodiment</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>diff --git a/pages/worlds.html b/pages/worlds.htmlindex 3a752cf58..1284265fb 100644--- a/pages/worlds.html+++ b/pages/worlds.html@@ -713,7 +713,10 @@<div class="wl-quick" id="wl-quick"></div><button type="button" id="wl-browse" class="wl-btn wl-btn-block">- Browse avatars & agents+ Browse avatars+ </button>+ <button type="button" id="wl-browse-agents" class="wl-btn wl-btn-block">+ Browse 3D agents</button><div class="wl-or">or drop one in</div>diff --git a/public/changelog.json b/public/changelog.jsonindex bb7655376..fd19f3ec4 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-17T21:52:04.009Z",+ "generated_at": "2026-06-17T22:12:47.201Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -107,6 +107,16 @@"feature"]},+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Avatar feet stay planted on the floor",+ "summary": "Fixed your avatar sinking partway through the floor in the Pole Club walk-in — most noticeable in the Clubhouse. The avatar now re-checks the ground beneath it every frame and keeps its feet on the surface as you move between rooms, instead of standing at the height it spawned at.",+ "link": "/club",+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-17","type": "update",@@ -645,6 +655,16 @@"feature"]},+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Pick a 3D agent to drop into any world",+ "summary": "Added a dedicated agent picker to the worlds lobby. Tap “Browse 3D agents” to search the full directory of public agents, filter by skill or on-chain status, sort by popular/newest/name, and spin each agent's avatar in a live 3D preview before you commit. Choose one and you drop into the world wearing its avatar — no more sifting through raw avatars and accessories to find an actual agent.",+ "link": "/worlds",+ "tags": [+ "feature"+ ]+ },{"date": "2026-06-17","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex ac4f05b3a..ca636ebb5 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -86,6 +86,14 @@<category>feature</category><description>Saved and public animations are now playable anywhere three.ws renders an avatar. The new /animations gallery lists every public clip with live previews (hover a card to see the animation on a real avatar), one-click "Open in Studio" to remix any clip, and an "Animate this avatar" shortcut from the avatar gallery. Any page with an avatar panel now also shows your saved and community animations alongside the built-in library. Share a clip by its id — ?anim=<id> plays it directly in the viewer, the embed, or the Studio editor.</description></item>+ <item>+ <title>Avatar feet stay planted on the floor</title>+ <link>https://three.ws/club</link>+ <guid isPermaLink="false">2026-06-17:Avatar feet stay planted on the floor</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Fixed your avatar sinking partway through the floor in the Pole Club walk-in — most noticeable in the Clubhouse. The avatar now re-checks the ground beneath it every frame and keeps its feet on the surface as you move between rooms, instead of standing at the height it spawned at.</description>+ </item><item><title>Avatars from any tool animate perfectly when uploaded</title><link>https://three.ws/avatars</link>@@ -502,6 +510,14 @@<category>feature</category><description>When you tap an agent on three.ws/irl, its card now does real things. View profile opens that agent's full page so you can see who you just met. If the agent offers paid services, each one shows its price and a Use button: tap it, approve the payment in your wallet, and you pay in USDC on the spot — the standard x402 flow, capped at the price shown so a misconfigured service can never overcharge you. The response you paid for appears right inside the card instead of vanishing into a toast. Every state is handled: no wallet, a cancelled signature, or a service error each show a clear message and leave the button ready to try again, and each service button works on its own so paying for one never freezes the others. Completed encounters quietly notify the agent's owner, receipt and all.</description></item>+ <item>+ <title>Pick a 3D agent to drop into any world</title>+ <link>https://three.ws/worlds</link>+ <guid isPermaLink="false">2026-06-17:Pick a 3D agent to drop into any world</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Added a dedicated agent picker to the worlds lobby. Tap “Browse 3D agents” to search the full directory of public agents, filter by skill or on-chain status, sort by popular/newest/name, and spin each agent's avatar in a live 3D preview before you commit. Choose one and you drop into the world wearing its avatar — no more sifting through raw avatars and accessories to find an actual agent.</description>+ </item><item><title>Place your IRL agent on the real floor with AR anchoring</title><link>https://three.ws/irl</link>diff --git a/public/features.json b/public/features.jsonindex 454844d14..9f2dc71bd 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-17T21:52:03.993Z",+ "generated_at": "2026-06-17T22:12:47.184Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/agent-picker.css b/src/agent-picker.cssnew file mode 100644index 000000000..d13a569e7--- /dev/null+++ b/src/agent-picker.css@@ -0,0 +1,524 @@+/* ── 3D Agent Picker ──────────────────────────────────────────────────────+ Reusable browser for public 3D agents (agent_identities). Search, sort,+ skill filters, an on-chain toggle, a live 3D preview of the agent's avatar,+ and a single selection callback. Modal overlay or inline embed.++ Uses canonical B01 tokens for consistency with the monochrome system and+ mirrors the avatar-gallery-picker layout so the two feel like one family.+ ─────────────────────────────────────────────────────────────────────── */++/* ── Overlay (modal mode) ───────────────────────────────────────────── */++.apk-overlay {+ position: fixed;+ inset: 0;+ z-index: 1000;+ background: rgba(0, 0, 0, 0.72);+ backdrop-filter: blur(8px);+ -webkit-backdrop-filter: blur(8px);+ display: grid;+ place-items: center;+ padding: 20px;+ opacity: 0;+ transition: opacity 180ms ease;+}+.apk-overlay.apk-open { opacity: 1; }++/* ── Shell ──────────────────────────────────────────────────────────── */++.apk-shell {+ width: 100%;+ max-width: 1080px;+ max-height: calc(100vh - 40px);+ background: var(--surface-1);+ border: 1px solid var(--stroke);+ border-radius: 14px;+ display: flex;+ flex-direction: column;+ overflow: hidden;+ box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);+ transform: translateY(8px);+ transition: transform 180ms ease;+}+.apk-open .apk-shell { transform: translateY(0); }++.apk-shell--inline {+ max-height: none;+ box-shadow: none;+ border-radius: 12px;+ transform: none;+}++/* ── Header ─────────────────────────────────────────────────────────── */++.apk-header {+ display: flex;+ align-items: center;+ gap: 12px;+ padding: 14px 18px;+ border-bottom: 1px solid var(--stroke);+ flex-shrink: 0;+}+.apk-title {+ font-size: 15px;+ font-weight: 600;+ color: var(--ink);+ flex: 1;+ min-width: 0;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+}+.apk-close {+ width: 28px;+ height: 28px;+ display: grid;+ place-items: center;+ background: transparent;+ border: 1px solid var(--stroke);+ border-radius: 8px;+ color: var(--ink-dim);+ cursor: pointer;+ font-size: 16px;+ line-height: 1;+ transition: background 120ms ease, color 120ms ease, border-color 120ms ease;+ flex-shrink: 0;+}+.apk-close:hover {+ background: var(--surface-2);+ color: var(--ink);+ border-color: var(--stroke-strong);+}++/* ── Toolbar ────────────────────────────────────────────────────────── */++.apk-toolbar {+ display: flex;+ align-items: center;+ gap: 10px;+ padding: 12px 18px;+ flex-shrink: 0;+ flex-wrap: wrap;+}+.apk-search {+ flex: 1 1 220px;+ display: flex;+ align-items: center;+ gap: 8px;+ padding: 8px 12px;+ background: var(--surface-1);+ border: 1px solid var(--stroke);+ border-radius: 10px;+ transition: border-color 150ms ease, background 150ms ease;+}+.apk-search:focus-within {+ border-color: var(--stroke-strong);+ background: var(--surface-2);+}+.apk-search svg { flex-shrink: 0; color: var(--ink-dim); }+.apk-search input {+ flex: 1;+ background: transparent;+ border: 0;+ outline: 0;+ color: var(--ink);+ font: inherit;+ font-size: 13px;+ min-width: 0;+}+.apk-search input::placeholder { color: var(--ink-dim); }+.apk-search-clear {+ background: transparent;+ border: 0;+ color: var(--ink-dim);+ cursor: pointer;+ padding: 2px 4px;+ font-size: 14px;+ line-height: 1;+ transition: color 120ms ease;+}+.apk-search-clear:hover { color: var(--ink); }+.apk-status {+ font-size: 12px;+ color: var(--ink-dim);+ flex-shrink: 0;+ white-space: nowrap;+}++/* Sort segmented control + on-chain toggle */+.apk-sort {+ display: flex;+ gap: 3px;+ background: #000;+ border: 1px solid var(--stroke);+ border-radius: 9px;+ padding: 3px;+ flex-shrink: 0;+}+.apk-sort-btn {+ padding: 6px 11px;+ border-radius: 7px;+ font: inherit;+ font-size: 12px;+ color: var(--ink-dim);+ background: transparent;+ border: 0;+ cursor: pointer;+ transition: background 120ms ease, color 120ms ease;+ white-space: nowrap;+}+.apk-sort-btn.active { background: var(--surface-2); color: var(--ink); }+.apk-sort-btn:hover:not(.active) { color: var(--ink); }++.apk-onchain-toggle {+ display: inline-flex;+ align-items: center;+ gap: 7px;+ font-size: 12px;+ color: var(--ink-dim);+ cursor: pointer;+ user-select: none;+ flex-shrink: 0;+ padding: 6px 4px;+}+.apk-onchain-toggle input { accent-color: var(--accent); cursor: pointer; }+.apk-onchain-toggle:hover { color: var(--ink); }++/* ── Skill filter chips ─────────────────────────────────────────────── */++.apk-skills {+ display: flex;+ flex-wrap: wrap;+ gap: 5px;+ padding: 0 18px 10px;+ flex-shrink: 0;+ min-height: 0;+}+.apk-skill {+ background: var(--surface-1);+ color: var(--ink-dim);+ border: 1px solid var(--stroke);+ border-radius: 999px;+ padding: 4px 10px;+ font: inherit;+ font-size: 11.5px;+ cursor: pointer;+ transition: all 120ms ease;+}+.apk-skill:hover { border-color: var(--stroke-strong); color: var(--ink); }+.apk-skill.active {+ background: var(--accent);+ color: #000;+ border-color: var(--accent);+}++/* ── Body ───────────────────────────────────────────────────────────── */++.apk-body {+ flex: 1;+ min-height: 0;+ display: grid;+ grid-template-columns: 1fr 340px;+ gap: 0;+ overflow: hidden;+}++.apk-grid-col {+ overflow-y: auto;+ padding: 12px 18px 18px;+ border-right: 1px solid var(--stroke);+}+.apk-grid {+ display: grid;+ gap: 10px;+ grid-template-columns: repeat(3, minmax(0, 1fr));+}++/* ── Card ───────────────────────────────────────────────────────────── */++.apk-card {+ background: var(--surface-2);+ border: 1.5px solid var(--stroke);+ border-radius: var(--radius-card, 14px);+ overflow: hidden;+ cursor: pointer;+ display: flex;+ flex-direction: column;+ text-align: left;+ color: inherit;+ font: inherit;+ padding: 0;+ transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;+}+.apk-card:hover {+ border-color: var(--stroke-strong);+ transform: translateY(-1px);+ box-shadow: var(--shadow-2, 0 4px 24px rgba(0, 0, 0, 0.4));+}+.apk-card:focus-visible {+ outline: 2px solid var(--accent);+ outline-offset: 2px;+}+.apk-card.selected {+ border-color: var(--accent);+ box-shadow: 0 0 0 1px var(--accent) inset, 0 4px 20px rgba(255, 255, 255, 0.06);+}+.apk-card-thumb {+ aspect-ratio: 1 / 1;+ background: var(--surface-3);+ position: relative;+ display: flex;+ align-items: center;+ justify-content: center;+ overflow: hidden;+}+.apk-card-thumb img {+ width: 100%;+ height: 100%;+ object-fit: cover;+ display: block;+}+.apk-card-ph {+ width: 100%;+ height: 100%;+ background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);+ display: flex;+ align-items: center;+ justify-content: center;+}+.apk-card-ph svg { width: 32px; height: 32px; color: var(--ink-dim); opacity: 0.5; }+/* On-chain badge floats top-right of the thumbnail */+.apk-card-badge {+ position: absolute;+ top: 6px;+ right: 6px;+ z-index: 1;+}+.apk-card-body { padding: 8px 10px 10px; }+.apk-card-name {+ font-size: 12.5px;+ font-weight: 600;+ color: var(--ink);+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ margin: 0 0 3px;+}+.apk-card-desc {+ font-size: 11px;+ color: var(--ink-dim);+ line-height: 1.4;+ margin: 0 0 6px;+ display: -webkit-box;+ -webkit-line-clamp: 2;+ -webkit-box-orient: vertical;+ overflow: hidden;+}+.apk-card-meta {+ display: flex;+ align-items: center;+ gap: 4px;+ flex-wrap: wrap;+}+.apk-card-chip {+ font-size: 10px;+ color: var(--ink-dim);+ background: var(--surface-1);+ border-radius: 999px;+ padding: 1px 6px;+}++/* ── Preview column ─────────────────────────────────────────────────── */++.apk-preview-col {+ display: flex;+ flex-direction: column;+ padding: 14px;+ gap: 12px;+ overflow-y: auto;+}+.apk-preview-stage {+ aspect-ratio: 1 / 1;+ border-radius: 10px;+ overflow: hidden;+ background: #000;+ border: 1px solid var(--stroke);+ display: flex;+ align-items: center;+ justify-content: center;+ flex-shrink: 0;+ position: relative;+}+.apk-preview-stage model-viewer {+ width: 100%;+ height: 100%;+ --poster-color: transparent;+ background: #000;+}+.apk-preview-empty {+ color: var(--ink-dim);+ font-size: 12.5px;+ text-align: center;+ padding: 0 16px;+ line-height: 1.5;+}+.apk-preview-spinner {+ position: absolute;+ width: 22px;+ height: 22px;+ border: 2px solid var(--stroke);+ border-top-color: var(--ink-dim);+ border-radius: 50%;+ animation: apk-spin 0.8s linear infinite;+}+.apk-preview-head {+ display: flex;+ align-items: center;+ gap: 8px;+ flex-wrap: wrap;+}+.apk-preview-name {+ font-size: 15px;+ font-weight: 600;+ color: var(--ink);+ margin: 0;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ flex: 1;+ min-width: 0;+}+.apk-preview-sub {+ color: var(--ink-dim);+ font-size: 12px;+ margin: -4px 0 0;+}+.apk-preview-desc {+ color: var(--ink-dim);+ font-size: 12.5px;+ line-height: 1.5;+ margin: 0;+ max-height: 96px;+ overflow-y: auto;+}+.apk-preview-skills {+ display: flex;+ flex-wrap: wrap;+ gap: 4px;+}+.apk-preview-skill {+ font-size: 10.5px;+ color: var(--ink-dim);+ background: var(--surface-1);+ border: 1px solid var(--stroke);+ border-radius: 999px;+ padding: 2px 8px;+}+.apk-preview-profile {+ font-size: 12px;+ color: var(--ink-dim);+ text-decoration: none;+ display: inline-flex;+ align-items: center;+ gap: 4px;+ transition: color 120ms ease;+ align-self: flex-start;+}+.apk-preview-profile:hover { color: var(--ink); text-decoration: underline; }++.apk-spacer { flex: 1; min-height: 4px; }++/* ── CTA button ─────────────────────────────────────────────────────── */++.apk-cta {+ background: var(--accent);+ color: #000;+ border: 0;+ border-radius: 9px;+ padding: 10px 14px;+ font: inherit;+ font-size: 13px;+ font-weight: 600;+ cursor: pointer;+ width: 100%;+ transition: opacity 120ms ease;+}+.apk-cta:disabled { opacity: 0.35; cursor: not-allowed; }++/* ── Loading / empty / error ────────────────────────────────────────── */++@keyframes apk-spin { to { transform: rotate(360deg); } }++.apk-empty, .apk-error {+ grid-column: 1 / -1;+ padding: 36px 16px;+ text-align: center;+ color: var(--ink-dim);+ border: 1.5px dashed var(--stroke);+ border-radius: 10px;+ font-size: 13px;+ line-height: 1.5;+}+.apk-error { color: var(--danger); border-color: rgba(248, 113, 113, 0.2); }+.apk-empty-cta {+ display: inline-block;+ margin-top: 12px;+ padding: 8px 16px;+ background: var(--accent);+ color: #000;+ border-radius: 8px;+ font-size: 12.5px;+ font-weight: 600;+ text-decoration: none;+}++/* ── Skeleton cards ─────────────────────────────────────────────────── */++.apk-skel {+ background: var(--surface-2);+ border: 1.5px solid var(--stroke);+ border-radius: 10px;+ overflow: hidden;+}+.apk-skel-thumb {+ aspect-ratio: 1 / 1;+ background: linear-gradient(110deg, var(--surface-3) 30%, var(--surface-2) 50%, var(--surface-3) 70%);+ background-size: 200% 100%;+ animation: apk-shimmer 1.4s ease-in-out infinite;+}+.apk-skel-bar {+ height: 10px;+ margin: 8px 10px;+ border-radius: 4px;+ background: var(--surface-3);+}+.apk-skel-bar:last-child { width: 55%; margin-top: 4px; }+@keyframes apk-shimmer {+ 0% { background-position: 200% 0; }+ 100% { background-position: -200% 0; }+}++/* ── Responsive ─────────────────────────────────────────────────────── */++@media (max-width: 860px) {+ .apk-body { grid-template-columns: 1fr; }+ .apk-grid-col {+ border-right: 0;+ border-bottom: 1px solid var(--stroke);+ max-height: 50vh;+ }+ .apk-preview-col { max-height: 50vh; }+ .apk-preview-stage { aspect-ratio: auto; height: 240px; }+ .apk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }+}++@media (max-width: 520px) {+ .apk-shell { max-height: calc(100vh - 20px); border-radius: 10px; }+ .apk-overlay { padding: 10px; }+ .apk-header { padding: 10px 14px; }+ .apk-toolbar { padding: 8px 14px; }+ .apk-skills { padding: 0 14px 8px; }+ .apk-grid-col { padding: 10px 14px 14px; }+ .apk-preview-col { padding: 10px; }+ .apk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }+}diff --git a/src/agent-picker.js b/src/agent-picker.jsnew file mode 100644index 000000000..e91329fc7--- /dev/null+++ b/src/agent-picker.js@@ -0,0 +1,647 @@+/**+ * AgentPicker — reusable 3D agent browser.+ *+ * Opens as a modal overlay or mounts inline. Fetches public agents from+ * /api/agents/public, renders a searchable/sortable/skill-filterable grid+ * with a live 3D preview of each agent's avatar, and fires a callback with+ * the selected agent.+ *+ * Unlike the avatar gallery (raw GLBs, including accessories), this picker+ * surfaces deployed *agents* — identities with a name, persona, skills, an+ * optional on-chain identity, and a wearable avatar.+ *+ * Usage:+ *+ * import { openAgentPicker } from './agent-picker.js';+ * const agent = await openAgentPicker(); // resolves agent | null+ * const agent = await openAgentPicker({ onchainOnly: true });+ *+ * // Or drive it directly for inline / custom flows:+ * const picker = new AgentPicker({ onSelect: (a) => {...} });+ * picker.openModal();+ */++import './agent-picker.css';+import { onchainBadgeHTML } from './shared/onchain-badge.js';++const PAGE_SIZE = 24;++let _mvLoaded = false;+function ensureModelViewer() {+ if (_mvLoaded || customElements.get('model-viewer')) return;+ _mvLoaded = true;+ const s = document.createElement('script');+ s.type = 'module';+ s.src = 'https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js';+ document.head.appendChild(s);+}++function esc(s) {+ return String(s ?? '')+ .replace(/&/g, '&')+ .replace(/</g, '<')+ .replace(/>/g, '>')+ .replace(/"/g, '"');+}++const compact = new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 1 });+const integer = new Intl.NumberFormat('en');++const AGENT_PH_SVG = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="8" width="14" height="11" rx="3"/><path d="M12 8V4"/><circle cx="12" cy="3" r="1.4"/><circle cx="9.5" cy="13" r="1.1"/><circle cx="14.5" cy="13" r="1.1"/><path d="M2.5 12v3M21.5 12v3"/></svg>`;+const SEARCH_SVG = `<svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="7" cy="7" r="4.5"/><path d="m10.5 10.5 3 3"/></svg>`;++const SORTS = [+ { key: 'popular', label: 'Popular' },+ { key: 'newest', label: 'Newest' },+ { key: 'name', label: 'A–Z' },+];++export class AgentPicker {+ /**+ * @param {Object} opts+ * @param {string} [opts.title='Choose a 3D agent']+ * @param {string} [opts.selectedId] Pre-selected agent ID+ * @param {boolean} [opts.onchainOnly=false] Start filtered to on-chain agents+ * @param {'popular'|'newest'|'name'} [opts.sort='popular']+ * @param {string} [opts.ctaLabel='Select agent']+ * @param {Function} [opts.onSelect] Callback with the selected agent object+ * @param {Function} [opts.onClose] Called when the picker is closed+ */+ constructor(opts = {}) {+ this.opts = {+ title: opts.title || 'Choose a 3D agent',+ selectedId: opts.selectedId || '',+ onchainOnly: !!opts.onchainOnly,+ sort: SORTS.some((s) => s.key === opts.sort) ? opts.sort : 'popular',+ ctaLabel: opts.ctaLabel || 'Select agent',+ onSelect: opts.onSelect || (() => {}),+ onClose: opts.onClose || (() => {}),+ };++ this._state = {+ query: '',+ skill: '',+ sort: this.opts.sort,+ onchainOnly: this.opts.onchainOnly,+ cursor: null,+ loading: false,+ loaded: 0,+ hasMore: false,+ selected: null,+ loadedSkills: new Set(),+ cardsById: new Map(),+ modelCache: new Map(), // id -> { model_url, thumbnail_url } | null (no model)+ firstPageDone: false,+ reqSeq: 0,+ };++ this._overlay = null;+ this._shell = null;+ this._els = {};+ this._io = null;+ this._searchTimer = null;+ this._onKey = this._onKey.bind(this);+ }++ // ── Public API ──────────────────────────────────────────────────────++ openModal() {+ if (this._overlay) return;+ ensureModelViewer();++ this._overlay = document.createElement('div');+ this._overlay.className = 'apk-overlay';+ this._overlay.addEventListener('click', (e) => {+ if (e.target === this._overlay) this.close();+ });++ this._shell = this._buildShell();+ this._overlay.appendChild(this._shell);+ document.body.appendChild(this._overlay);+ document.addEventListener('keydown', this._onKey);++ requestAnimationFrame(() => {+ this._overlay.classList.add('apk-open');+ this._els.searchInput?.focus();+ });++ this._loadPage();+ }++ mountInline(container) {+ ensureModelViewer();+ this._shell = this._buildShell();+ this._shell.classList.add('apk-shell--inline');+ this._shell.querySelector('.apk-close')?.remove();+ container.appendChild(this._shell);+ this._loadPage();+ }++ close() {+ if (this._io) { this._io.disconnect(); this._io = null; }+ document.removeEventListener('keydown', this._onKey);+ clearTimeout(this._searchTimer);+ if (this._overlay) {+ this._overlay.classList.remove('apk-open');+ const ov = this._overlay;+ setTimeout(() => { ov.remove(); }, 200);+ this._overlay = null;+ } else if (this._shell) {+ this._shell.remove();+ }+ this._shell = null;+ this.opts.onClose();+ }++ getSelected() { return this._state.selected; }++ // ── Build ───────────────────────────────────────────────────────────++ _buildShell() {+ const shell = document.createElement('div');+ shell.className = 'apk-shell';++ shell.innerHTML = `+ <div class="apk-header">+ <span class="apk-title">${esc(this.opts.title)}</span>+ <button type="button" class="apk-close" aria-label="Close">×</button>+ </div>++ <div class="apk-toolbar">+ <div class="apk-search">+ ${SEARCH_SVG}+ <input type="text" placeholder="Search 3D agents..." autocomplete="off" aria-label="Search agents" />+ <button type="button" class="apk-search-clear" hidden aria-label="Clear">×</button>+ </div>+ <div class="apk-sort" role="tablist" aria-label="Sort agents">+ ${SORTS.map((s) => `+ <button type="button" class="apk-sort-btn${s.key === this._state.sort ? ' active' : ''}" data-sort="${s.key}" role="tab" aria-selected="${s.key === this._state.sort}">${s.label}</button>+ `).join('')}+ </div>+ <label class="apk-onchain-toggle">+ <input type="checkbox" ${this._state.onchainOnly ? 'checked' : ''} />+ On-chain+ </label>+ <span class="apk-status" aria-live="polite">Loading...</span>+ </div>++ <div class="apk-skills" aria-label="Skill filters"></div>++ <div class="apk-body">+ <div class="apk-grid-col">+ <div class="apk-grid"></div>+ </div>+ <div class="apk-preview-col">+ <div class="apk-preview-stage">+ <div class="apk-preview-empty">Select an agent to preview</div>+ </div>+ <div class="apk-preview-head">+ <h2 class="apk-preview-name">No agent selected</h2>+ </div>+ <p class="apk-preview-sub">Browse and pick a 3D agent</p>+ <p class="apk-preview-desc" hidden></p>+ <div class="apk-preview-skills"></div>+ <a class="apk-preview-profile" target="_blank" rel="noopener" hidden>View full profile →</a>+ <div class="apk-spacer"></div>+ <button type="button" class="apk-cta" disabled>${esc(this.opts.ctaLabel)}</button>+ </div>+ </div>+ `;++ this._els = {+ searchInput: shell.querySelector('.apk-search input'),+ searchClear: shell.querySelector('.apk-search-clear'),+ status: shell.querySelector('.apk-status'),+ skills: shell.querySelector('.apk-skills'),+ grid: shell.querySelector('.apk-grid'),+ gridCol: shell.querySelector('.apk-grid-col'),+ previewStage: shell.querySelector('.apk-preview-stage'),+ previewName: shell.querySelector('.apk-preview-name'),+ previewHead: shell.querySelector('.apk-preview-head'),+ previewSub: shell.querySelector('.apk-preview-sub'),+ previewDesc: shell.querySelector('.apk-preview-desc'),+ previewSkills: shell.querySelector('.apk-preview-skills'),+ previewProfile: shell.querySelector('.apk-preview-profile'),+ cta: shell.querySelector('.apk-cta'),+ };++ this._wireEvents(shell);+ return shell;+ }++ _wireEvents(shell) {+ shell.querySelector('.apk-close')?.addEventListener('click', () => this.close());++ // Sort+ shell.querySelectorAll('.apk-sort-btn').forEach((btn) => {+ btn.addEventListener('click', () => {+ if (btn.dataset.sort === this._state.sort) return;+ this._state.sort = btn.dataset.sort;+ shell.querySelectorAll('.apk-sort-btn').forEach((b) => {+ const on = b === btn;+ b.classList.toggle('active', on);+ b.setAttribute('aria-selected', String(on));+ });+ this._resetAndLoad();+ });+ });++ // On-chain toggle+ shell.querySelector('.apk-onchain-toggle input')?.addEventListener('change', (e) => {+ this._state.onchainOnly = e.target.checked;+ this._resetAndLoad();+ });++ // Search+ this._els.searchInput.addEventListener('input', () => {+ this._els.searchClear.hidden = !this._els.searchInput.value;+ clearTimeout(this._searchTimer);+ this._searchTimer = setTimeout(() => {+ this._state.query = this._els.searchInput.value.trim();+ this._resetAndLoad();+ }, 250);+ });+ this._els.searchClear.addEventListener('click', () => {+ this._els.searchInput.value = '';+ this._els.searchClear.hidden = true;+ this._state.query = '';+ this._resetAndLoad();+ this._els.searchInput.focus();+ });++ // Skill chips+ this._els.skills.addEventListener('click', (e) => {+ const btn = e.target.closest('.apk-skill');+ if (!btn) return;+ this._state.skill = btn.dataset.skill === this._state.skill ? '' : btn.dataset.skill;+ this._renderSkills();+ this._resetAndLoad();+ });++ // CTA — guarantee the avatar (GLB + id) is resolved before handing off,+ // since the list endpoint only ships a thumbnail.+ this._els.cta.addEventListener('click', async () => {+ const a = this._state.selected;+ if (!a || this._els.cta.disabled) return;+ this._els.cta.disabled = true;+ const prev = this._els.cta.textContent;+ this._els.cta.textContent = 'Loading…';+ await this._resolveAvatar(a);+ this._els.cta.textContent = prev;+ this.opts.onSelect(a);+ this.close();+ });++ this._setupInfiniteScroll();+ }++ _setupInfiniteScroll() {+ if (!('IntersectionObserver' in window)) return;+ const sentinel = document.createElement('div');+ sentinel.style.height = '1px';+ sentinel.className = 'apk-sentinel';+ this._els.grid.parentNode.appendChild(sentinel);++ this._io = new IntersectionObserver((entries) => {+ for (const entry of entries) {+ if (entry.isIntersecting && this._state.hasMore && this._state.cursor && !this._state.loading) {+ this._loadPage();+ }+ }+ }, { root: this._els.gridCol, rootMargin: '300px 0px' });+ this._io.observe(sentinel);+ }++ // ── Data ────────────────────────────────────────────────────────────++ _resetAndLoad() {+ this._state.cursor = null;+ this._state.loaded = 0;+ this._state.hasMore = false;+ this._state.loadedSkills = new Set();+ this._state.firstPageDone = false;+ this._state.cardsById = new Map();+ this._els.grid.innerHTML = '';+ this._renderSkeletons(6);+ this._loadPage();+ }++ async _loadPage() {+ if (this._state.loading) return;+ this._state.loading = true;+ this._updateStatus();+ const seq = ++this._state.reqSeq;++ const params = new URLSearchParams();+ if (this._state.query) params.set('q', this._state.query);+ if (this._state.skill) params.set('skill', this._state.skill);+ if (this._state.sort) params.set('sort', this._state.sort);+ if (this._state.onchainOnly) params.set('onchain', '1');+ if (this._state.cursor) params.set('before', this._state.cursor);+ params.set('limit', String(PAGE_SIZE));++ try {+ const res = await fetch(`/api/agents/public?${params.toString()}`, { credentials: 'include' });+ if (!res.ok) throw new Error(`HTTP ${res.status}`);+ const data = await res.json();+ // A newer request superseded this one (filters changed mid-flight).+ if (seq !== this._state.reqSeq) return;+ const agents = Array.isArray(data.agents) ? data.agents : [];++ if (!this._state.firstPageDone) this._els.grid.innerHTML = '';++ for (const a of agents) {+ this._state.cardsById.set(a.id, a);+ this._els.grid.appendChild(this._renderCard(a));+ this._state.loaded += 1;+ for (const s of a.skills || []) this._state.loadedSkills.add(s);+ }++ this._state.firstPageDone = true;+ this._state.hasMore = !!data.has_more;+ this._state.cursor = data.next_cursor || null;++ if (this._els.grid.children.length === 0) {+ this._els.grid.appendChild(this._renderEmpty());+ }++ this._renderSkills();+ this._hydratePreselection();+ } catch (err) {+ if (seq !== this._state.reqSeq) return;+ if (this._state.loaded === 0) {+ this._els.grid.innerHTML = '';+ const errDiv = document.createElement('div');+ errDiv.className = 'apk-error';+ errDiv.textContent = `Couldn't load agents: ${err.message}. Check your connection and try again.`;+ this._els.grid.appendChild(errDiv);+ }+ } finally {+ if (seq === this._state.reqSeq) {+ this._state.loading = false;+ this._updateStatus();+ }+ }+ }++ _hydratePreselection() {+ if (!this.opts.selectedId || this._state.selected) return;+ const match = this._state.cardsById.get(this.opts.selectedId);+ if (match) this._selectAgent(match);+ }++ // ── Rendering ───────────────────────────────────────────────────────++ _renderSkeletons(n) {+ for (let i = 0; i < n; i++) {+ const sk = document.createElement('div');+ sk.className = 'apk-skel';+ sk.innerHTML = `<div class="apk-skel-thumb"></div><div class="apk-skel-bar"></div><div class="apk-skel-bar"></div>`;+ this._els.grid.appendChild(sk);+ }+ }++ _renderEmpty() {+ const div = document.createElement('div');+ div.className = 'apk-empty';+ const filtered = this._state.query || this._state.skill || this._state.onchainOnly;+ if (filtered) {+ div.innerHTML = `No agents match these filters.<br>Try a different search or clear the filters.`;+ } else {+ div.innerHTML = `No public 3D agents yet.<a class="apk-empty-cta" href="/create">Deploy the first one →</a>`;+ }+ return div;+ }++ _renderCard(a) {+ const card = document.createElement('button');+ card.type = 'button';+ card.className = 'apk-card';+ card.dataset.id = a.id;+ if (a.id === this._state.selected?.id) card.classList.add('selected');++ const thumb = a.avatar_thumbnail+ ? `<img src="${esc(a.avatar_thumbnail)}" alt="${esc(a.name || 'Agent')}" loading="lazy" decoding="async" />`+ : `<div class="apk-card-ph">${AGENT_PH_SVG}</div>`;++ const badge = onchainBadgeHTML(a, { link: false, size: 'sm', showChain: false });+ const skills = (a.skills || []).slice(0, 2).map((s) =>+ `<span class="apk-card-chip">${esc(s)}</span>`).join('');+ const chats = Number(a.chat_count) || 0;+ const desc = a.description+ ? `<p class="apk-card-desc">${esc(a.description)}</p>`+ : '';++ card.innerHTML = `+ <div class="apk-card-thumb">+ ${badge ? `<span class="apk-card-badge">${badge}</span>` : ''}+ ${thumb}+ </div>+ <div class="apk-card-body">+ <div class="apk-card-name">${esc(a.name || 'Untitled agent')}</div>+ ${desc}+ <div class="apk-card-meta">+ ${skills}+ ${chats ? `<span class="apk-card-chip">${compact.format(chats)} chats</span>` : ''}+ </div>+ </div>+ `;++ card.addEventListener('click', () => this._selectAgent(a));+ return card;+ }++ _selectAgent(a) {+ this._state.selected = a;++ // Card selection visual+ this._els.grid.querySelectorAll('.apk-card.selected').forEach((c) =>+ c.classList.remove('selected'));+ const card = this._els.grid.querySelector(`.apk-card[data-id="${CSS.escape(a.id)}"]`);+ if (card) {+ card.classList.add('selected');+ card.scrollIntoView({ block: 'nearest', behavior: 'smooth' });+ }++ // Header: name + on-chain badge+ this._els.previewName.textContent = a.name || 'Untitled agent';+ this._els.previewHead.querySelector('.apk-card-badge')?.remove();+ const badge = onchainBadgeHTML(a, { link: false, size: 'sm', showChain: true });+ if (badge) {+ const span = document.createElement('span');+ span.className = 'apk-card-badge';+ span.innerHTML = badge;+ this._els.previewHead.appendChild(span);+ }++ // Subtitle+ const chats = Number(a.chat_count) || 0;+ const bits = [];+ if (chats) bits.push(`${compact.format(chats)} chats`);+ bits.push(a.is_registered ? 'On-chain agent' : 'three.ws agent');+ this._els.previewSub.textContent = bits.join(' · ');++ // Description+ if (a.description) {+ this._els.previewDesc.textContent = a.description;+ this._els.previewDesc.hidden = false;+ } else {+ this._els.previewDesc.hidden = true;+ }++ // Skills+ this._els.previewSkills.innerHTML = (a.skills || []).slice(0, 8).map((s) =>+ `<span class="apk-preview-skill">${esc(s)}</span>`).join('');++ // Profile link+ this._els.previewProfile.hidden = false;+ this._els.previewProfile.href = a.home_url || `/agent/${a.id}`;++ // CTA+ this._els.cta.disabled = false;++ // 3D preview (lazy — the list endpoint only ships a thumbnail).+ this._renderPreviewModel(a);+ }++ async _renderPreviewModel(a) {+ const stage = this._els.previewStage;+ stage.innerHTML = '';++ // Cached model resolution from a prior selection.+ if (this._state.modelCache.has(a.id)) {+ this._mountPreview(a, this._state.modelCache.get(a.id));+ return;+ }++ // Show the thumbnail immediately while the GLB URL resolves.+ const spinner = document.createElement('div');+ spinner.className = 'apk-preview-spinner';+ if (a.avatar_thumbnail) {+ const img = document.createElement('img');+ img.src = a.avatar_thumbnail;+ img.alt = a.name || 'Agent';+ img.style.cssText = 'width:100%;height:100%;object-fit:contain;opacity:.5';+ stage.appendChild(img);+ }+ stage.appendChild(spinner);++ const resolved = await this._resolveAvatar(a);++ // A different agent was selected while this resolved — drop the stale render.+ if (this._state.selected?.id !== a.id) return;+ stage.innerHTML = '';+ this._mountPreview(a, resolved);+ }++ /**+ * Resolve an agent's wearable avatar (GLB url, thumbnail, avatar id) from+ * /api/agents/:id — the public list only ships a thumbnail. Cached per id,+ * and the resolved fields are stamped onto the agent object so onSelect+ * callers receive a fully-hydrated record. Returns the resolved descriptor.+ */+ async _resolveAvatar(a) {+ if (this._state.modelCache.has(a.id)) return this._state.modelCache.get(a.id);+ let resolved = {+ model_url: '',+ thumbnail_url: a.avatar_thumbnail || '',+ avatar_id: a.avatar_id || null,+ };+ try {+ const res = await fetch(`/api/agents/${encodeURIComponent(a.id)}`, { credentials: 'include' });+ if (res.ok) {+ const { agent } = await res.json();+ resolved = {+ model_url: agent?.avatar_model_url || '',+ thumbnail_url: agent?.avatar_thumbnail_url || a.avatar_thumbnail || '',+ avatar_id: agent?.avatar_id || a.avatar_id || null,+ };+ }+ } catch {+ /* fall through to thumbnail-only resolution */+ }+ this._state.modelCache.set(a.id, resolved);+ // Hydrate the agent record so onSelect handoff carries the avatar.+ a.avatar_model_url = resolved.model_url;+ a.avatar_thumbnail_url = resolved.thumbnail_url;+ a.avatar_id = resolved.avatar_id;+ return resolved;+ }++ _mountPreview(a, resolved) {+ const stage = this._els.previewStage;+ stage.innerHTML = '';+ const modelUrl = resolved?.model_url;+ const thumb = resolved?.thumbnail_url || a.avatar_thumbnail;++ if (modelUrl) {+ const mv = document.createElement('model-viewer');+ mv.setAttribute('src', modelUrl);+ mv.setAttribute('alt', a.name || 'three.ws agent');+ mv.setAttribute('camera-controls', '');+ mv.setAttribute('auto-rotate', '');+ mv.setAttribute('rotation-per-second', '16deg');+ mv.setAttribute('interaction-prompt', 'none');+ mv.setAttribute('exposure', '1.05');+ mv.setAttribute('shadow-intensity', '0.8');+ mv.setAttribute('environment-image', 'neutral');+ if (thumb) mv.setAttribute('poster', thumb);+ stage.appendChild(mv);+ } else if (thumb) {+ const img = document.createElement('img');+ img.src = thumb;+ img.alt = a.name || 'Agent';+ img.style.cssText = 'width:100%;height:100%;object-fit:contain';+ stage.appendChild(img);+ } else {+ const div = document.createElement('div');+ div.className = 'apk-preview-empty';+ div.textContent = 'This agent has no avatar yet.';+ stage.appendChild(div);+ }+ }++ _renderSkills() {+ const skills = [...this._state.loadedSkills].sort((a, b) => a.localeCompare(b)).slice(0, 24);+ if (!skills.length && !this._state.skill) {+ this._els.skills.innerHTML = '';+ return;+ }+ const all = this._state.skill && !skills.includes(this._state.skill)+ ? [this._state.skill, ...skills]+ : skills;+ this._els.skills.innerHTML = all.map((s) =>+ `<button type="button" class="apk-skill${s === this._state.skill ? ' active' : ''}" data-skill="${esc(s)}">${esc(s)}</button>`+ ).join('');+ }++ _updateStatus() {+ if (!this._els.status) return;+ if (this._state.loading && this._state.loaded === 0) {+ this._els.status.textContent = 'Loading...';+ return;+ }+ const n = integer.format(this._state.loaded);+ const word = this._state.loaded === 1 ? 'agent' : 'agents';+ this._els.status.textContent = this._state.hasMore ? `${n}+ ${word}` : `${n} ${word}`;+ }++ // ── Keyboard ────────────────────────────────────────────────────────++ _onKey(e) {+ if (e.key === 'Escape') this.close();+ }+}++// ── Convenience wrapper: opens modal, returns a promise ─────────────────++export function openAgentPicker(opts = {}) {+ return new Promise((resolve) => {+ const picker = new AgentPicker({+ ...opts,+ onSelect: (agent) => resolve(agent),+ onClose: () => resolve(null),+ });+ picker.openModal();+ });+}diff --git a/src/animation-manager.js b/src/animation-manager.jsindex 788793ca5..cfb77b654 100644--- a/src/animation-manager.js+++ b/src/animation-manager.js@@ -120,6 +120,8 @@ export class AnimationManager {this._fallenReported = new Set();/** @type {Set<string>} Clip names disabled because they retargeted to a fallen pose on this rig. */this._fallen = new Set();+ /** @type {string|null} Name of the most-recently-requested crossfade target. Used to cancel stale async requests. */+ this._latestCrossfadeTarget = null;}/**@@ -256,6 +258,7 @@ export class AnimationManager {this.actions.clear();this.currentAction = null;this.currentName = null;+ this._latestCrossfadeTarget = null;this._fallen.clear();}@@ -539,6 +542,7 @@ export class AnimationManager {if (this.currentAction) this.currentAction.paused = true;this.currentAction = null;this.currentName = null;+ this._latestCrossfadeTarget = null;}/**@@ -550,16 +554,21 @@ export class AnimationManager {async crossfadeTo(name, duration = DEFAULT_CROSSFADE) {duration = Math.max(0, Math.min(duration, 5));if (name === this.currentName) return;+ // Record this as the latest-requested clip before the async load so that+ // if a newer crossfadeTo call arrives while this one is fetching, we can+ // detect the race and abort — preventing a slow-loading walk clip from+ // overriding an idle/dance that was applied while it was still fetching.+ this._latestCrossfadeTarget = name;const ready = await this.ensureLoaded(name);if (!ready) {if (this._failed.has(name) || this._animationDefs.some((d) => d.name === name))log.warn(`[AnimationManager] "${name}" unavailable`);return;}- // Re-check after the async load: stepAvatar calls crossfadeTo every frame,- // so many calls queue up while the clip is fetching. The first one to resume- // sets currentName; all subsequent ones must exit here or they'll all try to- // crossfade the action to itself, zeroing out its weight and causing T-pose.+ // Re-check after the async load: if a newer crossfadeTo superseded this+ // request while the clip was fetching, discard this stale crossfade.+ // Also catches the common case where stepAvatar queues many identical calls.+ if (this._latestCrossfadeTarget !== name) return;if (name === this.currentName) return;const next = this.actions.get(name);if (!next) return;diff --git a/src/club-entrance.js b/src/club-entrance.jsindex 7c9feb2a9..8777ec39c 100644--- a/src/club-entrance.js+++ b/src/club-entrance.js@@ -311,10 +311,30 @@ async function start(canvasEl) {// in rooms like the gallery; starting from y=1.2 samples only floor-level// surfaces (floor is always near y=0 after mountEnvironment normalises).function sampleFloor(x, z) {+ const y = rayFloor(x, z);+ return y == null ? 0 : y;+ }++ // Raw floor height under (x, z), or null when the ray finds no surface.+ // Origin sits above the walkable band so it samples the floor, not the+ // avatar's own mesh; the band reaches a little below 0 for venues whose+ // floor normalises slightly under the origin.+ function rayFloor(x, z) {groundRay.set(new Vector3(x, 1.2, z), DOWN);groundRay.far = 1.5; // covers y ∈ [−0.3, 1.2] — the floor bandconst hit = groundRay.intersectObject(env.root, true)[0];- return hit ? Math.max(0, hit.point.y) : 0;+ return hit ? Math.max(0, hit.point.y) : null;+ }++ // Keep the avatar's feet planted as it walks: the floor height varies from+ // venue to venue (and across a single floor), so re-sample under the rig+ // each frame and ease toward it. Holding the last height on a ray miss+ // avoids dropping the avatar to y=0 over gaps in the floor geometry.+ function trackFloor(dt) {+ const y = rayFloor(rig.position.x, rig.position.z);+ if (y == null) return;+ floorY = y;+ rig.position.y += (floorY - rig.position.y) * (1 - Math.exp(-14 * dt));}function placeSpawn() {@@ -612,6 +632,7 @@ async function start(canvasEl) {if (joy.active) { ix += joy.nx; iz += -joy.ny; }}stepAvatar(ix, iz, dt);+ trackFloor(dt);anim.update(dt);updateCamera(dt);if (phase === 'walk') minimap.update(rig.position, rig.rotation.y, nearDoor, now / 1000, prefersReducedMotion);diff --git a/src/walk-embed-preview.js b/src/walk-embed-preview.jsindex f4fb4f2c8..689a2a348 100644--- a/src/walk-embed-preview.js+++ b/src/walk-embed-preview.js@@ -464,6 +464,18 @@ export function initWalkPreview(container) {const next = onScreen && document.visibilityState !== 'hidden';if (next === running) return;running = next;+ if (!running) {+ // Clear all input so joystick/keys don't stay stuck on when the+ // preview scrolls out of view or the tab goes hidden.+ input.joy.x = 0;+ input.joy.y = 0;+ input.joy.active = false;+ input.keys.forward = 0;+ input.keys.back = 0;+ input.keys.left = 0;+ input.keys.right = 0;+ input.keys.run = false;+ }if (running) { clock.reset(); tick(); }}diff --git a/src/walk.js b/src/walk.jsindex 94331e23b..673d74c01 100644--- a/src/walk.js+++ b/src/walk.js@@ -923,6 +923,23 @@ window.addEventListener('keyup', (e) => {}});+// Clear all movement input when the window loses focus or the page is hidden+// so keys/joystick don't get stuck on (keyup events won't fire while unfocused).+function clearInput() {+ input.keys.forward = 0;+ input.keys.back = 0;+ input.keys.left = 0;+ input.keys.right = 0;+ input.keys.run = false;+ input.joy.x = 0;+ input.joy.y = 0;+ input.joy.active = false;+}+window.addEventListener('blur', clearInput);+document.addEventListener('visibilitychange', () => {+ if (document.visibilityState === 'hidden') clearInput();+});+// Touch devices and narrow viewports get the on-screen sticks + action// cluster; wide pointer-fine screens drive everything from WASD + mouse-look.const wantsTouchControls = (() => {diff --git a/src/worlds-lobby.js b/src/worlds-lobby.jsindex 23e4ffdea..6f7338a50 100644--- a/src/worlds-lobby.js+++ b/src/worlds-lobby.js@@ -13,6 +13,7 @@// path where the social layer is offline but worlds are still enterable.import { AvatarGalleryPicker } from './avatar-gallery-picker.js';+import { AgentPicker } from './agent-picker.js';// ── tiny DOM helpers ─────────────────────────────────────────────────────────const $ = (sel, root = document) => root.querySelector(sel);@@ -187,6 +188,31 @@ function wireAvatarActions() {picker.openModal();});+ // Browse deployed 3D agents — pick one and drop into the world wearing its avatar.+ $('#wl-browse-agents')?.addEventListener('click', () => {+ const picker = new AgentPicker({+ title: 'Choose your 3D agent',+ ctaLabel: 'Drop in as this agent',+ onSelect: (agent) => {+ picker.close();+ const modelUrl = agent.avatar_model_url || '';+ const thumb = agent.avatar_thumbnail_url || agent.avatar_thumbnail || '';+ if (!modelUrl && !thumb) {+ toast(`${agent.name || 'That agent'} has no avatar to wear yet.`, 'error');+ return;+ }+ setAvatar({+ id: agent.avatar_id || agent.id,+ name: agent.name || 'Agent',+ model_url: modelUrl,+ thumbnail_url: thumb,+ });+ toast(`Dropping in as ${agent.name || 'agent'}.`, 'ok');+ },+ });+ picker.openModal();+ });+// Drop in by id / paste — three.ws avatar id or agent avatar id.const idForm = $('#wl-id-form');idForm?.addEventListener('submit', async (e) => {