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
Club audio assets, audio manager, vite config, gitignore, and changelog updates
nirholas967010cb4058
diff --git a/.gitignore b/.gitignoreindex b42d4fae4..0920727d6 100644--- a/.gitignore+++ b/.gitignore@@ -240,6 +240,7 @@ scripts/.corr-*# the public/club/venue/alleyway.glb runtime asset is NOT ignored./space_smugglers_club_house_-_dark_version.glb/im-in-love-wit-a-stripper-fast.mp3+/club.mp3/alleyway.glb/tour.glbdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex 30675c6b4..e5387fcf0 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -75,6 +75,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **My Cosmetics — owned-item wardrobe with cross-world equip persistence** — A new 'My Fits' wardrobe panel in the /play HUD lists every cosmetic you own (free items + premium unlocks), grouped by slot. Click any item to equip it — the change is validated server-side, written to your account, reflected instantly on your avatar, and visible to other players in the room. Equipped looks persist across sessions and carry automatically into every world (/play and /walk). Purchasing a cosmetic from the shop now equips it durably too, not just as a temporary preview. (`/play`) `[feature]`- **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]`+- **Paid Forge rides out a busy generator instead of failing** — When you pay to forge a 3D model and the generator is momentarily busy, the checkout no longer dead-ends on a "request was throttled" error. It now waits out the brief cooldown and retries automatically — you see a short "retrying in Ns" countdown right in the payment panel — and your USDC is never taken when generation can't run, so a throttle costs you nothing. This covers building a model from your own uploaded photos too, which always uses the reconstruction engine. (`/ibm/x402-demo`) `[fix, improvement]`- **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]`- **Pay-per-model: forge a 3D model with x402 on the IBM demo** — The IBM × three.ws demo page now lets you turn a sentence into a real 3D model by paying with x402 — right on the page. Type a prompt, pick a quality tier (draft $0.05, standard $0.15, high $0.50), and approve a single USDC micropayment from MetaMask or Phantom; three.ws runs the real text-to-3D pipeline and the finished GLB appears inline for you to orbit and download. The price is read live from the server's own HTTP 402 challenge, and the on-chain settlement receipt is shown after it lands. No account, no API key. (`/ibm/x402-demo`) `[feature, improvement]`- **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]`diff --git a/data/changelog.json b/data/changelog.jsonindex 02ff62b8e..9863b1464 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,16 @@{"$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": "Paid Forge rides out a busy generator instead of failing",+ "summary": "When you pay to forge a 3D model and the generator is momentarily busy, the checkout no longer dead-ends on a \"request was throttled\" error. It now waits out the brief cooldown and retries automatically — you see a short \"retrying in Ns\" countdown right in the payment panel — and your USDC is never taken when generation can't run, so a throttle costs you nothing. This covers building a model from your own uploaded photos too, which always uses the reconstruction engine.",+ "tags": [+ "fix",+ "improvement"+ ],+ "link": "/ibm/x402-demo"+ },{"date": "2026-06-17","title": "Forge now generates on the free NVIDIA engine — faster, no throttling",diff --git a/public/changelog.json b/public/changelog.jsonindex 885cb5eb6..f6892c797 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-17T23:07:55.647Z",+ "generated_at": "2026-06-17T23:11:44.772Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -719,6 +719,17 @@"feature"]},+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Paid Forge rides out a busy generator instead of failing",+ "summary": "When you pay to forge a 3D model and the generator is momentarily busy, the checkout no longer dead-ends on a \"request was throttled\" error. It now waits out the brief cooldown and retries automatically — you see a short \"retrying in Ns\" countdown right in the payment panel — and your USDC is never taken when generation can't run, so a throttle costs you nothing. This covers building a model from your own uploaded photos too, which always uses the reconstruction engine.",+ "link": "/ibm/x402-demo",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-06-17","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex e578e523f..0c37ca117 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -558,6 +558,14 @@<category>feature</category><description>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.</description></item>+ <item>+ <title>Paid Forge rides out a busy generator instead of failing</title>+ <link>https://three.ws/ibm/x402-demo</link>+ <guid isPermaLink="false">2026-06-17:Paid Forge rides out a busy generator instead of failing</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>When you pay to forge a 3D model and the generator is momentarily busy, the checkout no longer dead-ends on a "request was throttled" error. It now waits out the brief cooldown and retries automatically — you see a short "retrying in Ns" countdown right in the payment panel — and your USDC is never taken when generation can't run, so a throttle costs you nothing. This covers building a model from your own uploaded photos too, which always uses the reconstruction engine.</description>+ </item><item><title>Pay an IRL agent for its services — and open its full profile — right from the card</title><link>https://three.ws/irl</link>diff --git a/public/club/audio/club.mp3 b/public/club/audio/club.mp3new file mode 100644index 000000000..425d0b59bBinary files /dev/null and b/public/club/audio/club.mp3 differdiff --git a/public/club/audio/im-in-love-wit-a-stripper-fast.mp3 b/public/club/audio/im-in-love-wit-a-stripper-fast.mp3new file mode 100644index 000000000..1ad4f7a9cBinary files /dev/null and b/public/club/audio/im-in-love-wit-a-stripper-fast.mp3 differdiff --git a/public/features.json b/public/features.jsonindex 093756c4c..42e1f4e21 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-17T23:07:55.629Z",+ "generated_at": "2026-06-17T23:11:44.760Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/club-audio.js b/src/club-audio.jsindex 07fa98d93..6884c5dde 100644--- a/src/club-audio.js+++ b/src/club-audio.js@@ -25,11 +25,24 @@ const MASTER_GAIN = 0.75;// Walk-in anthem — plays once, full-volume, the moment the rope drops.const ENTRANCE_GAIN = 0.9;+// ── Music bed ────────────────────────────────────────────────────────────────+// Full-length tracks are the club's soundtrack. Unlike the short synth loops+// (which decodeAudioData into memory), these stream through an <audio> element+// piped into the graph via createMediaElementSource — a 30 MB+ song never gets+// fully decoded into a Float32 buffer. The element loops the sequence below in+// order, forever: club anthem → the stripper cut → back to the top.+const MUSIC_SEQUENCE = ['club', 'im-in-love-wit-a-stripper-fast'];+const MUSIC_GAIN = 0.85;+// Ducked level while a tipped dancer's style loop or the walk-in anthem plays+// over the top, so the foreground track stays clearly audible.+const MUSIC_DUCK_GAIN = 0.18;+export class ClubAudio {constructor() {this.ctx = null;this.master = null;this.ambience = null; // { source, gain }+ this.music = null; // { el, source, gain, index } — looping full-track bedthis.style = null; // { name, source, gain }this.entrance = null; // { source, gain } — one-shot walk-in anthemthis._entrancePlayed = false;@@ -182,6 +195,91 @@ export class ClubAudio {this.ambience = this._makeLayer(buf, AMBIENCE_GAIN);}+ // Start the full-length music bed and loop MUSIC_SEQUENCE forever+ // (club anthem → the stripper cut → back to the top). The track streams+ // through an <audio> element wired into the effects chain, so it picks up+ // the outdoor-muffle → indoor-clarity transition and the master mute for+ // free, and a 30 MB song never gets decoded into a Float32 buffer.+ //+ // Browser autoplay policy blocks the first play() until a user gesture, so+ // this rejects in that case — the caller catches it and retries on the next+ // interaction. `this.music` is wired up before the play attempt, so the+ // retry resumes the same element instead of building a second graph.+ async startMusic() {+ await this.ensureContext();+ if (this.ctx.state === 'suspended') {+ try {+ await this.ctx.resume();+ } catch {}+ }++ // Already wired — just make sure it's actually playing. Covers the+ // autoplay-blocked retry and a tab switch that paused the element.+ if (this.music) {+ await this.music.el.play();+ return this.music;+ }++ const AudioCtor =+ typeof window !== 'undefined' && window.Audio+ ? window.Audio+ : typeof Audio !== 'undefined'+ ? Audio+ : null;+ if (!AudioCtor) throw new Error('HTMLAudioElement unavailable');++ // One element, one MediaElementSource — the Web Audio API forbids a+ // second source node on the same element, so we swap `.src` between+ // tracks on `ended` rather than creating a node per track.+ const el = new AudioCtor();+ el.preload = 'auto';+ el.loop = false;+ const source = this.ctx.createMediaElementSource(el);+ const gain = this.ctx.createGain();+ // Start ducked if a foreground layer is already playing over the bed.+ gain.gain.value = this.style || this.entrance ? MUSIC_DUCK_GAIN : MUSIC_GAIN;+ source.connect(gain).connect(this.effectsBus);++ this.music = { el, source, gain, index: 0, source_errStreak: 0 };++ const srcFor = (i) => `${AUDIO_BASE}/${MUSIC_SEQUENCE[i]}.mp3`;+ const advance = (delta) => {+ const len = MUSIC_SEQUENCE.length;+ this.music.index = (((this.music.index + delta) % len) + len) % len;+ el.src = srcFor(this.music.index);+ el.play().catch(() => {});+ this._announceTrack(MUSIC_SEQUENCE[this.music.index]);+ };++ // A clean playthrough resets the failure streak; an error skips to the+ // next track. If every track in the sequence fails in a row we stop+ // advancing so one outage can't spin a hot reload loop.+ el.addEventListener('playing', () => {+ this.music.source_errStreak = 0;+ });+ el.addEventListener('ended', () => advance(1));+ el.addEventListener('error', () => {+ this.music.source_errStreak += 1;+ if (this.music.source_errStreak > MUSIC_SEQUENCE.length) return;+ advance(1);+ });++ // Kick off track 0. Keep this explicit (not via advance) so the first+ // play() rejection propagates to the caller's gesture-retry arming.+ el.src = srcFor(0);+ this._announceTrack(MUSIC_SEQUENCE[0]);+ await el.play();+ return this.music;+ }++ _announceTrack(name) {+ if (this._onStatus) {+ try {+ this._onStatus(name);+ } catch {}+ }+ }+async fadeToStyle(name, durationMs = 800) {if (!name) return;await this.ensureContext();@@ -207,11 +305,7 @@ export class ClubAudio {layer.gain.gain.linearRampToValueAtTime(STYLE_GAIN, end);this.style = { name, ...layer };- if (this.ambience) {- this.ambience.gain.gain.cancelScheduledValues(now);- this.ambience.gain.gain.setValueAtTime(this.ambience.gain.gain.value, now);- this.ambience.gain.gain.linearRampToValueAtTime(AMBIENCE_DUCK_GAIN, end);- }+ this._duckBeds(durationMs);if (this._onStatus) {try {@@ -223,18 +317,12 @@ export class ClubAudio {async fadeOutStyle(durationMs = 800) {if (!this.ctx) return;- const now = this.ctx.currentTime;- const end = now + Math.max(0.05, durationMs / 1000);if (this.style) {this._fadeOutLayer(this.style, durationMs);this.style = null;}- if (this.ambience) {- this.ambience.gain.gain.cancelScheduledValues(now);- this.ambience.gain.gain.setValueAtTime(this.ambience.gain.gain.value, now);- this.ambience.gain.gain.linearRampToValueAtTime(AMBIENCE_GAIN, end);- }+ this._restoreBeds(durationMs);}// One-shot walk-in anthem: the moment the bouncer admits the wallet we@@ -269,25 +357,15 @@ export class ClubAudio {g.gain.value = gain;source.connect(g).connect(this.effectsBus);- const now = this.ctx.currentTime;- // Duck ambience under the anthem if it's already running.- if (this.ambience) {- this.ambience.gain.gain.cancelScheduledValues(now);- this.ambience.gain.gain.setValueAtTime(this.ambience.gain.gain.value, now);- this.ambience.gain.gain.linearRampToValueAtTime(AMBIENCE_DUCK_GAIN, now + 0.4);- }+ // Duck the music beds under the anthem if either is already running.+ this._duckBeds(400);source.onended = () => {try {source.disconnect();} catch {}- // Bring ambience back up if it's still around when the anthem ends.- if (this.ambience && this.ctx) {- const t = this.ctx.currentTime;- this.ambience.gain.gain.cancelScheduledValues(t);- this.ambience.gain.gain.setValueAtTime(this.ambience.gain.gain.value, t);- this.ambience.gain.gain.linearRampToValueAtTime(AMBIENCE_GAIN, t + 1.2);- }+ // Bring the beds back up when the anthem ends.+ this._restoreBeds(1200);this.entrance = null;};source.start();@@ -348,6 +426,30 @@ export class ClubAudio {}}+ // Ramp a single GainNode to `target`, gliding from its current value so the+ // fade is click-free even mid-ramp.+ _rampGain(gainNode, target, durationMs) {+ if (!gainNode || !this.ctx) return;+ const now = this.ctx.currentTime;+ const end = now + Math.max(0.05, durationMs / 1000);+ gainNode.gain.cancelScheduledValues(now);+ gainNode.gain.setValueAtTime(gainNode.gain.value, now);+ gainNode.gain.linearRampToValueAtTime(target, end);+ }++ // Duck both music beds — the synth ambience loop and the full-track music —+ // under a foreground layer (a tipped style loop or the walk-in anthem).+ _duckBeds(durationMs = 400) {+ this._rampGain(this.ambience?.gain, AMBIENCE_DUCK_GAIN, durationMs);+ this._rampGain(this.music?.gain, MUSIC_DUCK_GAIN, durationMs);+ }++ // Bring the music beds back up to their resting level.+ _restoreBeds(durationMs = 800) {+ this._rampGain(this.ambience?.gain, AMBIENCE_GAIN, durationMs);+ this._rampGain(this.music?.gain, MUSIC_GAIN, durationMs);+ }+_fadeOutLayer(layer, durationMs) {const now = this.ctx.currentTime;const end = now + Math.max(0.05, durationMs / 1000);@@ -377,6 +479,14 @@ export class ClubAudio {const muted = !!v;this.muted = muted;this._writeMutedPref(muted);+ // Pause/resume the streaming music element so muting actually halts the+ // download instead of just zeroing its gain; position is preserved.+ if (this.music?.el) {+ try {+ if (muted) this.music.el.pause();+ else this.music.el.play().catch(() => {});+ } catch {}+ }if (!this.ctx || !this.master) return;const target = muted ? 0 : MASTER_GAIN;const now = this.ctx.currentTime;@@ -424,6 +534,8 @@ export function styleAudioFor(dance) {export const TRACK_LABELS = Object.freeze({ambience: 'Crowd ambience',entrance: 'Walk-in anthem',+ club: 'Club anthem',+ 'im-in-love-wit-a-stripper-fast': 'In Love With a Stripper',rumba: 'Rumba mix',silly: 'Silly mix',thriller: 'Thriller mix',diff --git a/vite.config.js b/vite.config.jsindex 30d0c07e2..e2891f8fd 100644--- a/vite.config.js+++ b/vite.config.js@@ -580,6 +580,50 @@ support: resolve(__dirname, 'pages/support.html'),globals: { Buffer: true, process: true, global: true },protocolImports: true,}),+ // Dev only: serve the <agent-3d> custom-element bundle from the locally+ // built dist-lib/ and rewrite pages' absolute CDN loader to a same-origin+ // path. The homepage and other surfaces hardcode+ // https://three.ws/agent-3d/latest/agent-3d.js, which on localhost loads+ // the separately-deployed (and possibly stale) CDN bundle instead of the+ // local build — so element.js changes never showed up in dev. This makes+ // dev reflect the local lib. No effect on production builds (apply:'serve').+ {+ name: 'dev-local-agent-3d',+ apply: 'serve',+ configureServer(server) {+ const libFiles = {+ js: resolve(__dirname, 'dist-lib/agent-3d.js'),+ 'umd.cjs': resolve(__dirname, 'dist-lib/agent-3d.umd.cjs'),+ };+ server.middlewares.use((req, res, next) => {+ const path = (req.url || '').split('?')[0];+ const m = /^\/agent-3d\/[^/]+\/agent-3d\.(js|umd\.cjs)$/.exec(path);+ if (!m) return next();+ const file = libFiles[m[1]];+ if (!file || !existsSync(file)) {+ res.statusCode = 503;+ res.setHeader('content-type', 'text/plain; charset=utf-8');+ return res.end('agent-3d dev bundle missing — run `npm run build:lib`');+ }+ res.setHeader('content-type', 'text/javascript; charset=utf-8');+ res.setHeader('cache-control', 'no-cache');+ res.setHeader('access-control-allow-origin', '*');+ return res.end(readFileSync(file));+ });+ },+ transformIndexHtml: {+ order: 'pre',+ handler(html) {+ // Only the real loader <script src="…"></script> is rewritten;+ // the copy-paste snippet strings keep the absolute URL embedders+ // need (their escaped `\n`/`<\/script>` don't match this pattern).+ return html.replace(+ /(<script\b[^>]*\bsrc=")https:\/\/three\.ws(\/agent-3d\/[^"]+\/agent-3d\.js"\s*)><\/script>/g,+ '$1$2></script>',+ );+ },+ },+ },{name: 'vercel-rewrites',configureServer(server) {