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
feat: reintroduce coin trade functionality in the 3D world and enhance changelog entries
fudjia566b0ed2af40
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0c8b1306f..c98c7351b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -24,6 +24,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Paid Solana endpoints are back — payments settle end to end again** — Pay-per-call endpoints like the Pole Club cover charge and dance tips had been failing at the final settlement step: the platform advertised a payment sponsor it could no longer sign for, and a missing rate-limiter backend then blocked every payment attempt outright. Both are fixed — the platform now co-signs settlements with its own sponsor wallet (secret held in Google Secret Manager, not on any one machine) and the rate limiter runs on a real Redis backend. Verified with real on-chain USDC payments through both endpoints, and every platform service wallet is now wired and funded above its floor. `[fix, infra, security]`- **The /play lobby no longer fails to load live coins during busy sessions** — The live-coins grid on /play could show "Could not load live coins right now" because the market feed shared one rate-limit budget with more than 160 other endpoints — a busy session with a few tabs open starved its own lobby. Trending and coin search now have their own generous budget, and the lobby quietly retries once on a blip before ever showing the error card. (`/play`) `[fix]`- **The 3D world is locked down — visitors can no longer delete the ground** — Until today, every single person who opened world.three.ws arrived with full build rights. Anyone could move or delete any object in the world, replace the scene, or fill it with broken models — no account, no password, nothing. That is what emptied the world once before, when the ground itself was deleted and everyone who joined fell into a black void. The world now starts locked: visitors can walk around, chat, and explore, but only someone holding the admin code can change anything. Builders unlock their tools in-world by typing /admin followed by the code. The server refuses to start at all if the code is missing, so the world can never quietly come back up unprotected again. `[security, infra]`+- **The coin trade window opens again — buying and selling in the world is back** — Clicking Buy on any coin in the 3D world crashed the trade window before it could draw, so trading from the world had been silently broken since the pre-trade safety firewall shipped. The cause: the new safety panel reported its first verdict a moment before the buy button it updates existed. That order is now handled, and the whole flow — safety verdict, live quote, buy, sell, stage pills, error copy — is covered by browser tests that run on every build. Separately, the risk-disclosure module now loads identically in development and production, so the money-gate acknowledgment you see locally is the real dialog, not a plain browser popup. (`/play`) `[fix]`- **Two broken pages fixed: vanity receipt verifier and Drive Your Avatar** — Both pages failed to load anything at all, and both are working again. The receipt verifier at /vanity/verify loads its cryptography straight into your browser so the audit runs on your machine and nothing is sent anywhere — but the browser had no way to locate those crypto libraries, so the page sat dead and no receipt could be checked. It now resolves them properly: paste a receipt and every check runs, right through to opening a sealed envelope. On /temporary, the payment widget behind the in-world "Feature your content" billboard was loaded the wrong way and crashed on arrival, taking the pay button with it. It now loads the same way it does on every other page that uses it. (`/vanity/verify`) `[fix]`- **x402 discovery listings now render full result cards everywhere** — Seven paid services — the fact checker, mint-to-mesh (single and batch), asset remixing, agent embodiment, 3D NFT minting, and provenance anchoring — were listing on the open x402 indexers without a response example, so their catalog cards rendered empty and ranked poorly. Every one now ships a realistic sample response in the discovery document, and the build-time guard that keeps the catalog fully green is passing again so a future gap can't ship unnoticed. (`/x402`) `[fix, improvement]`- **Your agents can now be placed privately, and nobody can browse /irl locations from afar** — Two changes to how /irl handles where you are. First, reading the agents near you now requires proving you have a recent location fix for that spot — until today anyone could ask our servers what agents sat at any coordinate on earth without ever going there. Second, a placed agent can now be private: you still see it in AR exactly where you left it, but it is withheld from everyone else's nearby feed, from shared rooms, and from the World Lines quest map. New placements are private by default while /irl is still in testing, and the privacy center's unpublish button now makes a pin private instead of hiding it from you too. You can make any pin public again whenever you want. (`/irl-privacy`) `[security, feature, improvement]`diff --git a/data/changelog.json b/data/changelog.jsonindex 28dfd6d0d..dc072bd81 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,15 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-09",+ "title": "The coin trade window opens again — buying and selling in the world is back",+ "summary": "Clicking Buy on any coin in the 3D world crashed the trade window before it could draw, so trading from the world had been silently broken since the pre-trade safety firewall shipped. The cause: the new safety panel reported its first verdict a moment before the buy button it updates existed. That order is now handled, and the whole flow — safety verdict, live quote, buy, sell, stage pills, error copy — is covered by browser tests that run on every build. Separately, the risk-disclosure module now loads identically in development and production, so the money-gate acknowledgment you see locally is the real dialog, not a plain browser popup.",+ "tags": [+ "fix"+ ],+ "link": "/play"+ },{"date": "2026-07-09","title": "Avatars are getting their pictures back — galleries show the model, not a letter",diff --git a/public/changelog.json b/public/changelog.jsonindex 734f45332..ffaf17e42 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-09T22:25:17.658Z",+ "generated_at": "2026-07-09T23:03:13.702Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -198,6 +198,16 @@"infra"]},+ {+ "date": "2026-07-09",+ "type": "update",+ "title": "The coin trade window opens again — buying and selling in the world is back",+ "summary": "Clicking Buy on any coin in the 3D world crashed the trade window before it could draw, so trading from the world had been silently broken since the pre-trade safety firewall shipped. The cause: the new safety panel reported its first verdict a moment before the buy button it updates existed. That order is now handled, and the whole flow — safety verdict, live quote, buy, sell, stage pills, error copy — is covered by browser tests that run on every build. Separately, the risk-disclosure module now loads identically in development and production, so the money-gate acknowledgment you see locally is the real dialog, not a plain browser popup.",+ "link": "/play",+ "tags": [+ "fix"+ ]+ },{"date": "2026-07-09","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 86321e00f..86e7416cf 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -150,6 +150,14 @@<category>security</category><description>Until today, every single person who opened world.three.ws arrived with full build rights. Anyone could move or delete any object in the world, replace the scene, or fill it with broken models — no account, no password, nothing. That is what emptied the world once before, when the ground itself was deleted and everyone who joined fell into a black void. The world now starts locked: visitors can walk around, chat, and explore, but only someone holding the admin code can change anything. Builders unlock their tools in-world by typing /admin followed by the code. The server refuses to start at all if the code is missing, so the world can never quietly come back up unprotected again.</description></item>+ <item>+ <title>The coin trade window opens again — buying and selling in the world is back</title>+ <link>https://three.ws/play</link>+ <guid isPermaLink="false">2026-07-09:The coin trade window opens again — buying and selling in the world is back</guid>+ <pubDate>Thu, 09 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Clicking Buy on any coin in the 3D world crashed the trade window before it could draw, so trading from the world had been silently broken since the pre-trade safety firewall shipped. The cause: the new safety panel reported its first verdict a moment before the buy button it updates existed. That order is now handled, and the whole flow — safety verdict, live quote, buy, sell, stage pills, error copy — is covered by browser tests that run on every build. Separately, the risk-disclosure module now loads identically in development and production, so the money-gate acknowledgment you see locally is the real dialog, not a plain browser popup.</description>+ </item><item><title>Two broken pages fixed: vanity receipt verifier and Drive Your Avatar</title><link>https://three.ws/vanity/verify</link>diff --git a/public/features.json b/public/features.jsonindex 1278a5870..a8bd3ed31 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-09T22:25:17.642Z",+ "generated_at": "2026-07-09T23:03:13.688Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/scripts/tmp-audit-ledger.mjs b/scripts/tmp-audit-ledger.mjsnew file mode 100644index 000000000..954500e76--- /dev/null+++ b/scripts/tmp-audit-ledger.mjs@@ -0,0 +1,9 @@+import { neon } from '@neondatabase/serverless';+const sql = neon(process.env.DATABASE_URL);+const byErr = await sql`+ select coalesce(last_error,'(none)') e, count(*)::int n, max(attempts) max_att+ from avatar_thumbnail_backfill group by e order by n desc limit 10`;+console.table(byErr.map(r=>({error:r.e.slice(0,46), rows:r.n, max_attempts:r.max_att})));+const [tot] = await sql`select count(*)::int n from avatar_thumbnail_backfill`;+const [ret] = await sql`select count(*)::int n from avatar_thumbnail_backfill where attempts>=3`;+console.log('ledger rows:', tot.n, '| retired (attempts>=3):', ret.n);diff --git a/scripts/tmp-cover.mjs b/scripts/tmp-cover.mjsnew file mode 100644index 000000000..fcb9c3a2b--- /dev/null+++ b/scripts/tmp-cover.mjs@@ -0,0 +1,28 @@+import { neon } from '@neondatabase/serverless';+const sql = neon(process.env.DATABASE_URL);+const MISSING = sql`thumbnail_key is null or thumbnail_key ~ '^https?://'`;+const [tot] = await sql`select count(*)::int n from avatars where visibility='public' and deleted_at is null and storage_key is not null and (thumbnail_key is null or thumbnail_key ~ '^https?://')`;+console.log('total missing:', tot.n);++const [fc] = await sql`+ select count(*)::int n from avatars a+ join forge_creations f on f.id = (a.source_meta->>'forge_creation_id')::uuid+ where a.visibility='public' and a.deleted_at is null and a.storage_key is not null+ and (a.thumbnail_key is null or a.thumbnail_key ~ '^https?://')+ and f.preview_image_url is not null`;+console.log(' covered by forge_creations.preview_image_url:', fc.n);++const [cl] = await sql`+ select count(*)::int n from avatars a+ join avatars s on s.id = (a.source_meta->>'cloned_from')::uuid+ where a.visibility='public' and a.deleted_at is null and a.storage_key is not null+ and (a.thumbnail_key is null or a.thumbnail_key ~ '^https?://')+ and s.thumbnail_key is not null and s.thumbnail_key !~ '^https?://'`;+console.log(' covered by cloned_from source thumbnail:', cl.n);++// what preview_image_url extensions look like+const ext = await sql`+ select right(f.preview_image_url, 5) e, count(*)::int n from avatars a+ join forge_creations f on f.id = (a.source_meta->>'forge_creation_id')::uuid+ where f.preview_image_url is not null group by e order by n desc limit 6`;+console.log('\npreview_image_url suffixes:'); console.table(ext);diff --git a/scripts/tmp-fc.mjs b/scripts/tmp-fc.mjsnew file mode 100644index 000000000..a6246e252--- /dev/null+++ b/scripts/tmp-fc.mjs@@ -0,0 +1,15 @@+import { neon } from '@neondatabase/serverless';+const sql = neon(process.env.DATABASE_URL);+const c = await sql`select column_name from information_schema.columns where table_name='forge_creations' order by ordinal_position`;+console.log('forge_creations cols:', c.map(x=>x.column_name).join(', '));+const [a] = await sql`select count(*)::int n from forge_creations where preview_key is not null`;+const [b] = await sql`select count(*)::int n from forge_creations where preview_image_url is not null`;+console.log('fc with preview_key:', a.n, '| with preview_image_url:', b.n);+const [cov] = await sql`+ select count(*)::int n from avatars a+ join forge_creations f on f.id=(a.source_meta->>'forge_creation_id')::uuid+ where a.visibility='public' and a.deleted_at is null and a.thumbnail_key is null+ and f.preview_key is not null`;+console.log('missing-thumb avatars adoptable via fc.preview_key:', cov.n);+const s = await sql`select preview_key, preview_image_url from forge_creations where preview_key is not null limit 2`;+s.forEach(r=>console.log(' key:', r.preview_key, '\n url:', r.preview_image_url));diff --git a/scripts/tmp-meta.mjs b/scripts/tmp-meta.mjsnew file mode 100644index 000000000..7a1035974--- /dev/null+++ b/scripts/tmp-meta.mjs@@ -0,0 +1,9 @@+import { neon } from '@neondatabase/serverless';+const sql = neon(process.env.DATABASE_URL);+for (const s of ['forge','studio']) {+ const rows = await sql`select id, source_meta, storage_key from avatars where source=${s} and visibility='public' and deleted_at is null and thumbnail_key is null limit 3`;+ console.log(`\n=== source=${s} ===`);+ rows.forEach(r=>console.log(' meta:', JSON.stringify(r.source_meta), '\n storage_key:', r.storage_key));+}+const t = await sql`select table_name from information_schema.tables where table_name like '%forge%'`;+console.log('\nforge tables:', t.map(x=>x.table_name).join(', '));diff --git a/scripts/tmp-render-test.mjs b/scripts/tmp-render-test.mjsnew file mode 100644index 000000000..35e3a18b0--- /dev/null+++ b/scripts/tmp-render-test.mjs@@ -0,0 +1,10 @@+import { renderGlbToPng } from '../api/_lib/render-glb.js';+const t0 = Date.now();+try {+ const png = await renderGlbToPng({+ glbUrl: 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/c96c2caf-3c36-4077-93cc-0019320577f3.glb',+ width: 768, height: 768, background: '#0a0a0a',+ });+ console.log('OK bytes=', png.length, 'ms=', Date.now()-t0, 'png?', png.subarray(0,4).toString('hex'));+} catch (e) { console.log('FAIL:', e.message); }+process.exit(0);diff --git a/scripts/tmp-schema.mjs b/scripts/tmp-schema.mjsnew file mode 100644index 000000000..357e7c7eb--- /dev/null+++ b/scripts/tmp-schema.mjs@@ -0,0 +1,6 @@+import { neon } from '@neondatabase/serverless';+const sql = neon(process.env.DATABASE_URL);+const cols = await sql`select column_name, data_type from information_schema.columns where table_name='avatars' order by ordinal_position`;+console.log('avatars cols:', cols.map(c=>c.column_name).join(', '));+const src = await sql`select source, count(*)::int n from avatars where visibility='public' and deleted_at is null and storage_key is not null and (thumbnail_key is null or thumbnail_key ~ '^https?://') group by source order by n desc`;+console.log('\nmissing-thumb avatars by source:'); console.table(src);diff --git a/scripts/tmp-verify-schema.mjs b/scripts/tmp-verify-schema.mjsnew file mode 100644index 000000000..b83558bea--- /dev/null+++ b/scripts/tmp-verify-schema.mjs@@ -0,0 +1,6 @@+import { neon } from '@neondatabase/serverless';+const sql = neon(process.env.DATABASE_URL);+const t = await sql`select to_regclass('public.avatar_thumbnail_backfill') as t`;+console.log('table avatar_thumbnail_backfill:', t[0].t || 'MISSING');+const idx = await sql`select indexname from pg_indexes where tablename in ('avatar_thumbnail_backfill','avatars') and indexname like '%thumbnail%'`;+console.log('indexes:', idx.map(i=>i.indexname).join(', ') || 'none');diff --git a/tests/e2e/irl-discovery.spec.js b/tests/e2e/irl-discovery.spec.jsindex 05f53ac51..33197a079 100644--- a/tests/e2e/irl-discovery.spec.js+++ b/tests/e2e/irl-discovery.spec.js@@ -93,6 +93,10 @@ function trackConsoleErrors(page) {if (m.type() !== 'error') return;const t = m.text();if (/websocket|hmr|wss:|vite|favicon|net::ERR/i.test(t)) return;+ // A 401 resource line from a signed-out auth/session probe is the browser+ // echoing an EXPECTED response (dev /api proxies to prod; no session in a+ // fresh context). Only this spec's own /api/irl/* surface stays fatal.+ if (/status of 401/i.test(t) && !/\/api\/irl\//i.test(m.location()?.url || '')) return;errors.push(t);});page.on('pageerror', (err) => {diff --git a/tests/e2e/launch-token-flow.spec.js b/tests/e2e/launch-token-flow.spec.jsindex 3e12c0c92..29b38cfed 100644--- a/tests/e2e/launch-token-flow.spec.js+++ b/tests/e2e/launch-token-flow.spec.js@@ -66,6 +66,17 @@ async function installHarness(page, { quote = QUOTE_PAYLOAD } = {}) {const calls = { prep: null, confirm: null, broadcast: 0 };const txBase64 = buildPrepTxBase64();+ // Pre-accept the Risk Disclosure (public/risk-ack.js gates the sign step of+ // every money flow since 2026-07-03). This spec's subject is the launch flow,+ // not the disclosure dialog — seed the returning-user acceptance record the+ // module reads from localStorage.+ await page.addInitScript(() => {+ window.localStorage.setItem(+ 'threews:risk-ack',+ JSON.stringify({ version: 1, acceptedAt: new Date().toISOString(), context: 'e2e' }),+ );+ });+// Wallet extension stub — the one acceptable mock (external browser code).await page.addInitScript((addr) => {const pk = { toString: () => addr, toBase58: () => addr };diff --git a/vite.config.js b/vite.config.jsindex 4049d731e..8e360e57c 100644--- a/vite.config.js+++ b/vite.config.js@@ -802,6 +802,27 @@ support: resolve(__dirname, 'pages/support.html'),},},},+ // public/risk-ack.js is the canonical runtime module for the money-gate+ // acknowledgment: app code reaches it via the src/shared/risk-ack.js+ // wrapper's non-analyzable dynamic import('/risk-ack.js'). In production+ // the file is served as-is from the public root, but Vite's dev transform+ // middleware 500s a module request for a /public asset ("should not be+ // imported from source code") — so in dev every money gate silently+ // degraded to the confirm() fallback. Serve it raw ahead of the transform+ // middleware so dev matches production. Serve-only; no build effect.+ {+ name: 'dev-serve-risk-ack',+ apply: 'serve',+ configureServer(server) {+ const file = resolve(__dirname, 'public/risk-ack.js');+ server.middlewares.use((req, res, next) => {+ if ((req.url || '').split('?')[0] !== '/risk-ack.js') return next();+ res.setHeader('content-type', 'text/javascript; charset=utf-8');+ res.setHeader('cache-control', 'no-cache');+ return res.end(readFileSync(file));+ });+ },+ },{name: 'vercel-rewrites',configureServer(server) {