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
Forge, text-to-image, Replicate, x402, THREE access/economy, nav, and changelog updates
nirholas277cc540136a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 43116e3a9..0827a4a19 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,8 +7,10 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr## 2026-06-18- **Connect a wallet and your $THREE tier is recognized — no account needed** — You no longer need a three.ws account to be seen as a $THREE holder. Connect your Solana wallet and the site reads your tier straight from your on-chain holdings: the holder chip in the top bar shows your live tier (◆ Bronze, Silver, Gold…) and holder features like High-quality generation on Forge unlock from the connected wallet alone. When a feature needs proof the wallet is yours, you approve a single free signature that moves no funds. Switch or disconnect a wallet and your tier updates instantly, no reload. Signed-in accounts keep working exactly as before. (`/forge`) `[improvement]`+- **Forge checkout no longer dead-ends when generation is briefly busy** — When the 3D generator was momentarily rate-limited mid-checkout, Forge could show a raw technical error and look like the payment had failed for good. Now a brief upstream slowdown shows a clear message — your payment was not taken, and the generation retries in a few seconds — and the checkout auto-retries on its own before ever asking you to try again. Your payment only settles once the model is actually produced, so a busy moment never costs you anything. (`/forge`) `[fix]`- **Holding $THREE now unlocks a premium feature** — $THREE gets its first hard utility: High-quality 3D generation on Forge — the 200k-polygon, PBR-textured tier — is now reserved for $THREE holders. Reach the Bronze holder tier (the entry tier) by holding $THREE and the High tier unlocks automatically, with no payment step. Draft and Standard generation stay free forever, and bring-your-own-key generation is unaffected. Sign in, link your Solana wallet, and the economy page shows your live holder tier and exactly what it unlocks. (`/three`) `[feature]`- **Pay $THREE per High generation — no holding required** — Don't hold $THREE yet but want a High-quality model? You can now pay in $THREE for a single High generation instead. Pick High in Forge, choose "Pay" on the holder panel, and a clean payment flow prices it in $THREE, takes one wallet approval, verifies it on-chain, and runs your generation automatically. The platform now genuinely accepts $THREE for compute. One payment buys exactly one High generation, and if a generation fails before it runs your payment stays usable — you're never charged for a model you didn't get. Draft and Standard remain free, and holders still generate High straight away. (`/forge`) `[feature]`+- **The animated 3D bot in the site footer renders again** — The little animated 3D robot that sits in the footer across the site — and on the sign-in page — had gone missing, leaving an empty space. The model files it loads are compressed, but the footer loader wasn't set up to unpack that format, so it failed before the bot could appear. The decoder is now wired in, so the bot loads and spins as intended everywhere the footer shows. `[fix]`- **The disco dance floor in coin worlds works again** — Every coin world has a disco pad beside the totem that pulses to a shared beat and crossfades dancers in lockstep. A wiring gap meant the world tried to listen for a beat the connection didn't know about, which threw an error the moment you entered and left the pad dark. The beat is now delivered properly: step onto the pad, hit Dance, and you and everyone else standing on it move to the same animation on the same beat, with the floor and lights pulsing in time. (`/play`) `[fix]`- **Your $THREE holder tier now shows across the site** — Holding $THREE is now visible everywhere you are. A holder chip in the top bar shows your live tier (◆ Bronze, Silver, Gold…) on every page and links to the full tier breakdown. On Forge, choosing the High quality tier now shows a clear, designed panel instead of a silent block: holders see an "Unlocked" badge and generate straight away, while everyone else gets a "Get $THREE" path, the exact reason (sign in, link a wallet, or hold more), and a one-tap switch back to free Draft or Standard — no dead ends and no raw errors. (`/forge`) `[feature, improvement]`diff --git a/api/_mcp3d/text-to-image.js b/api/_mcp3d/text-to-image.jsindex c80bafdae..0b33a9cc7 100644--- a/api/_mcp3d/text-to-image.js+++ b/api/_mcp3d/text-to-image.js@@ -269,17 +269,27 @@ export async function textToImage(prompt, { aspectRatio = '1:1' } = {}) {const data = await res.json().catch(() => ({}));if (!res.ok) {- const message = data?.detail || data?.title || `text-to-image returned ${res.status}`;+ const detail = data?.detail || data?.title || '';// Replicate throttles prediction creation (notably when account credit is// low). Surface it as a retryable rate limit, not a generic failure, so the- // caller can return 429 + retry hint instead of a hard 5xx.+ // caller can return 429 + retry hint instead of a hard 5xx. The throttle+ // `detail` names the account's credit balance ("…less than $5.0 in credit…")+ // — parse its reset hint for backoff and log it, but never relay that+ // internal state to the buyer.if (res.status === 429) {- throw Object.assign(new Error(message), {- code: 'rate_limited',- retryAfter: parseRetryAfter(res.headers, message),- });+ if (detail) console.warn(`[text-to-image] replicate throttled: ${detail}`);+ throw Object.assign(+ new Error('Image generation is briefly busy upstream — please retry in a few seconds.'),+ {+ code: 'rate_limited',+ providerDetail: detail,+ retryAfter: parseRetryAfter(res.headers, detail),+ },+ );}- throw Object.assign(new Error(message), { providerStatus: res.status });+ throw Object.assign(new Error(detail || `text-to-image returned ${res.status}`), {+ providerStatus: res.status,+ });}// With `Prefer: wait` the prediction usually completes inline. If Replicatediff --git a/api/_providers/replicate.js b/api/_providers/replicate.jsindex 210c24ab3..e6dc11a74 100644--- a/api/_providers/replicate.js+++ b/api/_providers/replicate.js@@ -452,16 +452,24 @@ export function createRegenProvider({ apiToken } = {}) {// Retry-After hint instead of a blind 502, and never settles a// payment it can't fulfill.if (response.status === 429) {- const message =- data?.detail ||- data?.title ||- 'Replicate is throttling new generations (low account credit or rate limit) — retry shortly.';- throw Object.assign(new Error(message), {- code: 'rate_limited',- status: 429,- providerStatus: 429,- retryAfter: Math.ceil(throttleDelayMs(response, data) / 1000),- });+ // Replicate's throttle `detail` names the account's credit balance and+ // raw rate-limit numbers ("…less than $5.0 in credit…"). That's internal+ // infra state — never surface it to the buyer. Keep the real detail for+ // server logs (and on the error for callers that want it), hand the+ // caller a clean, retryable message, and still derive the backoff from+ // the raw body via throttleDelayMs.+ const providerDetail = data?.detail || data?.title || '';+ if (providerDetail) console.warn(`[replicate] create-prediction throttled: ${providerDetail}`);+ throw Object.assign(+ new Error('3D generation is briefly busy upstream — please retry in a few seconds.'),+ {+ code: 'rate_limited',+ status: 429,+ providerStatus: 429,+ providerDetail,+ retryAfter: Math.ceil(throttleDelayMs(response, data) / 1000),+ },+ );}throw Object.assign(new Error(data?.detail || data?.title || `replicate returned ${response.status}`),diff --git a/api/x402/forge.js b/api/x402/forge.jsindex bcd6b1570..ad9444e83 100644--- a/api/x402/forge.js+++ b/api/x402/forge.js@@ -338,12 +338,15 @@ function respondGenerationError(res, err) {const retryAfter =Number.isFinite(err?.retryAfter) && err.retryAfter > 0 ? Math.ceil(err.retryAfter) : 5;res.setHeader('retry-after', String(retryAfter));+ // Own the buyer-facing copy here rather than echoing err.message: the+ // upstream throttle text can name the generator account's internal credit+ // balance, and only this payment boundary can truthfully promise the+ // payment wasn't taken (submit runs before settle).return error(res,429,'rate_limited',- err?.message ||- 'Generation is briefly throttled upstream — your payment was not taken. Retry shortly.',+ 'Generation is briefly busy and your payment was not taken — retry in a few seconds.',{ retry_after: retryAfter },);}diff --git a/data/changelog.json b/data/changelog.jsonindex 4c5937682..d5651e930 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,23 @@{"$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-18",+ "title": "Forge checkout no longer dead-ends when generation is briefly busy",+ "summary": "When the 3D generator was momentarily rate-limited mid-checkout, Forge could show a raw technical error and look like the payment had failed for good. Now a brief upstream slowdown shows a clear message — your payment was not taken, and the generation retries in a few seconds — and the checkout auto-retries on its own before ever asking you to try again. Your payment only settles once the model is actually produced, so a busy moment never costs you anything.",+ "tags": [+ "fix"+ ],+ "link": "/forge"+ },+ {+ "date": "2026-06-18",+ "title": "The animated 3D bot in the site footer renders again",+ "summary": "The little animated 3D robot that sits in the footer across the site — and on the sign-in page — had gone missing, leaving an empty space. The model files it loads are compressed, but the footer loader wasn't set up to unpack that format, so it failed before the bot could appear. The decoder is now wired in, so the bot loads and spins as intended everywhere the footer shows.",+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-18","title": "Connect a wallet and your $THREE tier is recognized — no account needed",diff --git a/pages/forge.html b/pages/forge.htmlindex d1466dc88..4768b2198 100644--- a/pages/forge.html+++ b/pages/forge.html@@ -536,10 +536,84 @@.fq-holder-note[data-state='unlocked'] .fq-holder-ico {color: #6ee7a8;}+ /* Quiet holder free-quota line under Generate + the Forge-local wallet+ connect chip (Part A). Token-only, matches the holder-note treatment. */+ .fq-perk-row {+ display: flex;+ align-items: center;+ gap: 0.6rem;+ flex-wrap: wrap;+ margin: 0.6rem 0 0;+ }+ .fq-perk-line {+ margin: 0;+ font-size: var(--text-xs);+ line-height: 1.5;+ color: var(--ink-dim);+ display: inline-flex;+ align-items: center;+ gap: 0.35rem;+ }+ .fq-perk-line[data-state='perk'] {+ color: var(--ink);+ }+ .fq-perk-line .fq-perk-ico {+ color: #6ee7a8;+ }+ .fq-perk-line strong {+ color: #6ee7a8;+ font-weight: 700;+ }+ .fq-perk-line a {+ color: var(--accent);+ text-decoration: none;+ font-weight: 500;+ }+ .fq-perk-line a:hover {+ text-decoration: underline;+ }+ .fq-perk-line a:focus-visible {+ outline: 2px solid var(--accent);+ outline-offset: 2px;+ border-radius: 2px;+ }+ .fq-connect-btn {+ display: inline-flex;+ align-items: center;+ gap: 0.35rem;+ font-size: var(--text-xs);+ font-weight: 600;+ color: var(--ink);+ background: var(--surface-2);+ border: 1px solid var(--surface-3);+ border-radius: var(--radius-pill);+ padding: 5px 12px;+ cursor: pointer;+ transition: border-color 0.15s, transform 0.15s, background 0.15s;+ }+ .fq-connect-btn:hover {+ border-color: var(--accent);+ transform: translateY(-1px);+ }+ .fq-connect-btn:focus-visible {+ outline: 2px solid var(--accent);+ outline-offset: 2px;+ }+ .fq-connect-btn.is-connected {+ color: #6ee7a8;+ border-color: rgba(110, 231, 168, 0.4);+ }+ .fq-connect-btn .fq-connect-ico {+ font-size: 0.95em;+ opacity: 0.8;+ }@media (prefers-reduced-motion: reduce) {.tier-lock {transition: none;}+ .fq-connect-btn {+ transition: none;+ }}.fq-row:has(> .aspect.is-hidden) {display: none;@@ -2627,6 +2701,18 @@<kbd class="gen-kbd" aria-hidden="true">⌘↵</kbd></button>+ <!-- Quiet holder line under Generate: an active free-quota perk for $THREE+ holders, or a non-blocking upsell + a reachable wallet connect so a+ holder who hasn't connected can reveal their perk. Filled by forge.js+ (updatePerkLine) from the wallet-aware access matrix. -->+ <div class="fq-perk-row" id="forge-perk-row" hidden>+ <p class="fq-perk-line" id="forge-perk-line" aria-live="polite"></p>+ <button type="button" class="fq-connect-btn" id="connect-wallet-btn" hidden>+ <span class="fq-connect-ico" aria-hidden="true">◎</span>+ <span data-wallet-label>Connect wallet</span>+ </button>+ </div>+</form><div class="chips" id="examples" aria-label="Example prompts">diff --git a/public/changelog.json b/public/changelog.jsonindex bf3ad509c..2b39c5a40 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-18T01:18:31.096Z",+ "generated_at": "2026-06-18T01:41:59.073Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -16,6 +16,16 @@"improvement"]},+ {+ "date": "2026-06-18",+ "type": "update",+ "title": "Forge checkout no longer dead-ends when generation is briefly busy",+ "summary": "When the 3D generator was momentarily rate-limited mid-checkout, Forge could show a raw technical error and look like the payment had failed for good. Now a brief upstream slowdown shows a clear message — your payment was not taken, and the generation retries in a few seconds — and the checkout auto-retries on its own before ever asking you to try again. Your payment only settles once the model is actually produced, so a busy moment never costs you anything.",+ "link": "/forge",+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-18","type": "update",@@ -36,6 +46,16 @@"feature"]},+ {+ "date": "2026-06-18",+ "type": "update",+ "title": "The animated 3D bot in the site footer renders again",+ "summary": "The little animated 3D robot that sits in the footer across the site — and on the sign-in page — had gone missing, leaving an empty space. The model files it loads are compressed, but the footer loader wasn't set up to unpack that format, so it failed before the bot could appear. The decoder is now wired in, so the bot loads and spins as intended everywhere the footer shows.",+ "link": null,+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-18","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 863ae334e..a3db9e9f5 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -14,6 +14,14 @@<category>improvement</category><description>You no longer need a three.ws account to be seen as a $THREE holder. Connect your Solana wallet and the site reads your tier straight from your on-chain holdings: the holder chip in the top bar shows your live tier (◆ Bronze, Silver, Gold…) and holder features like High-quality generation on Forge unlock from the connected wallet alone. When a feature needs proof the wallet is yours, you approve a single free signature that moves no funds. Switch or disconnect a wallet and your tier updates instantly, no reload. Signed-in accounts keep working exactly as before.</description></item>+ <item>+ <title>Forge checkout no longer dead-ends when generation is briefly busy</title>+ <link>https://three.ws/forge</link>+ <guid isPermaLink="false">2026-06-18:Forge checkout no longer dead-ends when generation is briefly busy</guid>+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>When the 3D generator was momentarily rate-limited mid-checkout, Forge could show a raw technical error and look like the payment had failed for good. Now a brief upstream slowdown shows a clear message — your payment was not taken, and the generation retries in a few seconds — and the checkout auto-retries on its own before ever asking you to try again. Your payment only settles once the model is actually produced, so a busy moment never costs you anything.</description>+ </item><item><title>Holding $THREE now unlocks a premium feature</title><link>https://three.ws/three</link>@@ -30,6 +38,14 @@<category>feature</category><description>Don't hold $THREE yet but want a High-quality model? You can now pay in $THREE for a single High generation instead. Pick High in Forge, choose "Pay" on the holder panel, and a clean payment flow prices it in $THREE, takes one wallet approval, verifies it on-chain, and runs your generation automatically. The platform now genuinely accepts $THREE for compute. One payment buys exactly one High generation, and if a generation fails before it runs your payment stays usable — you're never charged for a model you didn't get. Draft and Standard remain free, and holders still generate High straight away.</description></item>+ <item>+ <title>The animated 3D bot in the site footer renders again</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-18:The animated 3D bot in the site footer renders again</guid>+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The little animated 3D robot that sits in the footer across the site — and on the sign-in page — had gone missing, leaving an empty space. The model files it loads are compressed, but the footer loader wasn't set up to unpack that format, so it failed before the bot could appear. The decoder is now wired in, so the bot loads and spins as intended everywhere the footer shows.</description>+ </item><item><title>The disco dance floor in coin worlds works again</title><link>https://three.ws/play</link>diff --git a/public/features.json b/public/features.jsonindex 050c89326..1f1611fc6 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-18T01:18:31.072Z",+ "generated_at": "2026-06-18T01:41:59.046Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/nav.css b/public/nav.cssindex 6a457dddf..8f9b2c43e 100644--- a/public/nav.css+++ b/public/nav.css@@ -99,6 +99,12 @@.nav-end .nav-tier-badge a.tg-tier-silver { color: #cfd6e4; }.nav-end .nav-tier-badge a.tg-tier-gold,.nav-end .nav-tier-badge a.tg-tier-genesis { color: #f5c451; }+/* Collapse the chip to just the ◆ on the tightest viewports — the link's aria-label+ keeps the tier reachable and announced; no layout regression at any breakpoint. */+@media (max-width: 520px) {+ .nav-end .nav-tier-badge .tg-tier-label { display: none; }+ .nav-end .nav-tier-badge a { padding: 5px 8px; }+}/* Global search button — opens the Cmd-K command palette */.nav-search-btn {diff --git a/public/x402.js b/public/x402.jsindex feeb87c93..c6b694af5 100644--- a/public/x402.js+++ b/public/x402.js@@ -1354,6 +1354,14 @@ function friendlyError(err) {const msg = err?.shortMessage || err?.message || String(err);// Trim ethers/viem long stacks, Phantom's RPC-error verbosity.if (/user rejected|user denied|reject/i.test(msg)) return 'cancelled in wallet';+ // Upstream throttles (e.g. a generator's create-prediction rate limit) often+ // arrive as raw provider text that names the merchant's internal billing or+ // credit state. Never relay that to the buyer: the payment isn't settled until+ // the merchant call succeeds, so a clean, retryable message is both safer and+ // more accurate than echoing the upstream's account internals.+ if (/throttl|rate.?limit|too many requests|less than \$|in credit|\b429\b/i.test(msg)) {+ return 'The service is briefly busy and your payment was not taken — retry in a few seconds.';+ }return msg.slice(0, 240);}diff --git a/scripts/play-joy-diag.mjs b/scripts/play-joy-diag.mjsnew file mode 100644index 000000000..9e823ee7b--- /dev/null+++ b/scripts/play-joy-diag.mjs@@ -0,0 +1,37 @@+import { chromium } from 'playwright';++const URL = process.env.PROBE_URL || 'http://localhost:3000/play';+const sizes = [{ w: 390, h: 780, label: 'iphone12' }, { w: 360, h: 640, label: 'androidS' }, { w: 768, h: 1024, label: 'ipad' }];+const browser = await chromium.launch();++for (const sz of sizes) {+ const page = await browser.newPage({ viewport: { width: sz.w, height: sz.h }, hasTouch: true, isMobile: true });+ await page.goto(URL, { waitUntil: 'domcontentloaded' });+ await page.waitForSelector('.cc-card', { timeout: 15000 });+ await page.tap('.cc-card');+ await page.waitForFunction(() => window.__CC__?.phase === 'world', { timeout: 20000 }).catch(() => {});+ await page.waitForTimeout(900);+ await page.evaluate(() => { const ov = document.getElementById('po-overlay'); ov?.querySelector('.po-close')?.click(); });+ await page.waitForTimeout(400);++ const r = await page.evaluate(() => {+ const rect = (sel) => { const e = document.querySelector(sel); if (!e) return null; const b = e.getBoundingClientRect(); const s = getComputedStyle(e); return { x: Math.round(b.x), y: Math.round(b.y), w: Math.round(b.width), h: Math.round(b.height), z: s.zIndex, pe: s.pointerEvents }; };+ const joy = document.getElementById('cc-joystick').getBoundingClientRect();+ // Sample 5 points across the joystick face; report what's on top at each.+ const pts = [[0.5, 0.5], [0.5, 0.15], [0.2, 0.5], [0.8, 0.5], [0.5, 0.85]];+ const hits = pts.map(([fx, fy]) => {+ const x = joy.left + joy.width * fx, y = joy.top + joy.height * fy;+ const t = document.elementFromPoint(x, y);+ return `${fx},${fy}=>${t ? (t.id ? '#' + t.id : t.tagName + '.' + String(t.className).split(' ').filter(Boolean)[0]) : 'null'}`;+ });+ return { joystick: rect('#cc-joystick'), hotbar: rect('.ps-hotbar'), psHud: rect('#ps-hud'), ccHud: rect('#cc-hud'), hits };+ });+ console.log(`\n=== ${sz.label} (${sz.w}x${sz.h}) ===`);+ console.log('joystick:', JSON.stringify(r.joystick));+ console.log('ps-hotbar:', JSON.stringify(r.hotbar));+ console.log('#ps-hud :', JSON.stringify(r.psHud));+ console.log('hits across joystick face:');+ r.hits.forEach((h) => console.log(' ', h));+ await page.close();+}+await browser.close();diff --git a/scripts/play-move-probe.mjs b/scripts/play-move-probe.mjsnew file mode 100644index 000000000..7014a1371--- /dev/null+++ b/scripts/play-move-probe.mjs@@ -0,0 +1,66 @@+import { chromium } from 'playwright';++const URL = process.env.PROBE_URL || 'http://localhost:3000/play';+const browser = await chromium.launch();+const page = await browser.newPage({ viewport: { width: 1280, height: 800 } });++const logs = [];+page.on('console', (m) => logs.push(`[${m.type()}] ${m.text()}`));+page.on('pageerror', (e) => logs.push(`[pageerror] ${e.message}`));++await page.goto(URL, { waitUntil: 'domcontentloaded' });++// 1) Click the real lobby card (general world entry).+await page.waitForSelector('.cc-card', { timeout: 15000 });+await page.click('.cc-card');++// 2) Wait for the world.+const reachedWorld = await page.waitForFunction(() => window.__CC__?.phase === 'world', { timeout: 20000 }).then(() => true).catch(() => false);++const atEntry = await page.evaluate(() => {+ const g = window.__CC__;+ return {+ phase: g?.phase,+ activeEl: document.activeElement?.tagName + (document.activeElement?.id ? '#' + document.activeElement.id : ''),+ chatFocused: !!g?.ui?.chatFocused,+ joystickExists: !!document.getElementById('cc-joystick'),+ pos: g?.localPos ? { x: +g.localPos.x.toFixed(3), z: +g.localPos.z.toFixed(3) } : null,+ };+});++// 3) Real keyboard: hold W.+const kbBefore = await page.evaluate(() => ({ ...window.__CC__.localPos }));+await page.keyboard.down('KeyW');+await page.waitForTimeout(700);+const kbWhileDown = await page.evaluate(() => ({ keysHasW: window.__CC__.keys.has('w'), ...window.__CC__.localPos }));+await page.keyboard.up('KeyW');+const kbMoved = Math.abs(kbBefore.x - kbWhileDown.x) > 0.02 || Math.abs(kbBefore.z - kbWhileDown.z) > 0.02;++// 4) Joystick: drag the thumb up from center and hold.+const joyBefore = await page.evaluate(() => ({ ...window.__CC__.localPos }));+const box = await page.evaluate(() => {+ const z = document.getElementById('cc-joystick');+ if (!z) return null;+ const r = z.getBoundingClientRect();+ return { cx: r.left + r.width / 2, cy: r.top + r.height / 2 };+});+let joyMoved = null, joyVec = null;+if (box) {+ await page.mouse.move(box.cx, box.cy);+ await page.mouse.down();+ await page.mouse.move(box.cx, box.cy - 60, { steps: 4 }); // push "up"+ await page.waitForTimeout(500);+ joyVec = await page.evaluate(() => window.__CC__._joy);+ const joyWhile = await page.evaluate(() => ({ ...window.__CC__.localPos }));+ await page.mouse.up();+ joyMoved = Math.abs(joyBefore.x - joyWhile.x) > 0.02 || Math.abs(joyBefore.z - joyWhile.z) > 0.02;+}++console.log('REACHED_WORLD:', reachedWorld);+console.log('AT_ENTRY:', JSON.stringify(atEntry));+console.log('KEYBOARD: before', JSON.stringify(kbBefore), 'while', JSON.stringify(kbWhileDown), '=> moved', kbMoved);+console.log('JOYSTICK: vec', JSON.stringify(joyVec), '=> moved', joyMoved);+console.log('\nCONSOLE (avatar/move relevant):');+console.log(logs.filter((l) => /avatar|meshopt|move|joy|chat|error|Error/i.test(l)).slice(-15).join('\n'));++await browser.close();diff --git a/src/forge.js b/src/forge.jsindex 776f38b59..32422fcc1 100644--- a/src/forge.js+++ b/src/forge.js@@ -5,6 +5,7 @@ import { stampGlbAttribution } from './shared/glb-attribution.js';import { primeTierPass, attachTierPass, getTierPass, getAccess, onGate } from './three-access.js';import { renderLock, lockStateFromAccess } from './three-lock.js';import { payForHighGeneration } from './forge-pay.js';+import { initWalletButton, getConnectedWalletAddress } from './wallet.js';ensureStateKitStyles();//// Drives /api/forge. Three paths share one polling loop:@@ -101,6 +102,10 @@ const els = {byokHint: document.getElementById('byok-hint'),providerKey: document.getElementById('provider-key'),estimate: document.getElementById('estimate'),+ // Holder free-quota perk line + the Forge-local wallet-connect chip (Part A).+ perkRow: document.getElementById('forge-perk-row'),+ perkLine: document.getElementById('forge-perk-line'),+ connectBtn: document.getElementById('connect-wallet-btn'),};let aspectRatio = '1:1';@@ -731,6 +736,36 @@ async function reflectHighButtonAccess() {if (access?.eligible) primeTierPass();}+// $THREE holder free-generation multiplier by tier level — mirrors api/_lib/three-tier.js+// (rateMultiplier), which the free lane applies to a holder's quota via the tier pass.+const FREE_MULT_BY_LEVEL = { 1: 2, 2: 3, 3: 5, 4: 10 };++// The quiet holder line under Generate (Part A): a holder sees their active free-quota+// multiplier; everyone else sees a non-blocking upsell plus a reachable wallet-connect so+// a holder who hasn't connected can reveal their perk. Reads the shared, wallet-aware+// access matrix — never nags, never blocks the free base lane.+async function updatePerkLine() {+ if (!els.perkRow || !els.perkLine) return;+ const data = await getAccess();+ const level = Number(data?.tier?.level) || 0;+ const connected = Boolean(getConnectedWalletAddress());+ els.perkRow.hidden = false;+ if (level >= 1) {+ const mult = FREE_MULT_BY_LEVEL[level] || 1;+ els.perkLine.dataset.state = 'perk';+ els.perkLine.innerHTML =+ '<span class="fq-perk-ico" aria-hidden="true">⚡</span> Holder perk: ' ++ `<strong>${mult}× free quota</strong> · <a href="/three#tiers">your $THREE tier</a>`;+ if (els.connectBtn) els.connectBtn.hidden = true;+ } else {+ els.perkLine.dataset.state = 'upsell';+ els.perkLine.innerHTML =+ '<a href="/three#tiers">Hold $THREE for up to 10× free generations →</a>';+ // Offer connect only when there's no wallet in hand to read a tier from.+ if (els.connectBtn) els.connectBtn.hidden = connected;+ }+}+// Render the honest time/cost/poly estimate for the current engine + tier from// the catalog. No fabricated numbers — everything comes from /api/forge?catalog.function updateEstimate() {@@ -1197,9 +1232,11 @@ async function startJob({ prompt, imageUrls, skipValidation, payment }) {// pass and AWAIT it so forgeHeaders attaches a fresh, RPC-free proof on this very// request. An eligible holder then clears the server gate even if a live on-chain read// would hiccup, and even when they submit faster than the background primeTierPass()- // could finish. No-op for anonymous callers (no linked wallet → no pass), for the free- // tiers, and for BYOK High (server-exempt — no pass needed).- if (highTierNeedsPass()) await getTierPass();+ // could finish. An eligible *connected* wallet (no signed-in account) signs once here to+ // prove ownership — interactive only when eligible so a non-holder is never popped a+ // signature; a signed-in holder still mints silently via their session. No-op for+ // anonymous callers, the free tiers, and BYOK High (server-exempt — no pass needed).+ if (highTierNeedsPass()) await getTierPass({ interactive: Boolean(_highAccess?.eligible) });const res = await fetch('/api/forge', {method: 'POST',@@ -2390,6 +2427,17 @@ loadCatalog();// independent of the catalog so the affordance lands even on older deploys.reflectHighButtonAccess();+// Forge-local wallet connect (Part A): wire the connect chip + auto-connect a trusted+// wallet so a connected holder's High unlock + free-quota perk surface with no reload.+// Re-read the gate + perk line whenever the wallet connects or disconnects.+initWalletButton();+updatePerkLine();+window.addEventListener('wallet:changed', () => {+ reflectHighButtonAccess();+ if (selectedTier === 'high') reflectHighAccess('high');+ updatePerkLine();+});+// Surface any previously forged models for this browser on load.loadGallery().then(() => {const shareId = window.__forgeShareId;diff --git a/src/three-access.js b/src/three-access.jsindex fdd550142..dc26c599b 100644--- a/src/three-access.js+++ b/src/three-access.js@@ -299,7 +299,14 @@ export async function mountTierBadge(target) {t.held_usd > 0? ` · $${Number(t.held_usd).toLocaleString('en-US', { maximumFractionDigits: 0 })} held`: '';- el.innerHTML = `<a class="tg-badge tg-tier-${escapeHtml(t.id)}" href="${ECONOMY_URL}#tiers" title="Your $THREE holder tier — what it unlocks${held}">◆ ${escapeHtml(t.label)}</a>`;+ // Icon + label are separate spans so the nav can collapse the chip to just the ◆ on+ // the tightest viewports (≤520px) without losing the link or its accessible name.+ el.innerHTML =+ `<a class="tg-badge tg-tier-${escapeHtml(t.id)}" href="${ECONOMY_URL}#tiers" ` ++ `aria-label="Your $THREE tier: ${escapeHtml(t.label)}" ` ++ `title="Your $THREE holder tier — what it unlocks${held}">` ++ `<span class="tg-tier-mark" aria-hidden="true">◆</span>` ++ `<span class="tg-tier-label">${escapeHtml(t.label)}</span></a>`;}// ── Inline lock chip (beside a gated control) ─────────────────────────────────diff --git a/src/three-economy.js b/src/three-economy.jsindex 3c584ac91..9c7e543d1 100644--- a/src/three-economy.js+++ b/src/three-economy.js@@ -800,9 +800,10 @@ function accessSignedOutHTML() {return `<div class="ta-empty"><div class="ta-empty-mark" aria-hidden="true">◆</div><h3 class="ta-empty-title">See what your $THREE unlocks</h3>- <p class="ta-empty-sub">We resolve your holder tier from your on-chain $THREE. Sign in to see your unlocks here — or get $THREE first.</p>+ <p class="ta-empty-sub">We resolve your holder tier from your on-chain $THREE. Connect a wallet to see your unlocks instantly — no account needed — or sign in to link one.</p><div class="ta-empty-cta">- <button class="ec-btn primary" id="ec-access-signin" type="button">Sign in</button>+ <button class="ec-btn primary" id="ec-access-connect" type="button">Connect wallet</button>+ <button class="ec-btn" id="ec-access-signin" type="button">Sign in</button><a class="ec-btn" href="/three-token">Get $THREE</a></div></div>`;@@ -882,6 +883,10 @@ function shell() {<a class="ec-pill" href="/"><span class="dot"></span>three.ws</a><a class="ec-pill" href="/three-token">$THREE price ↗</a></div>+ <!-- Hidden global connect button: initWalletButton() wires it; the "Connect wallet"+ CTAs in the ladder + access panel trigger it. The wallet-aware data layer then+ re-reads on wallet:changed and highlights the held tier. -->+ <button id="connect-wallet-btn" type="button" hidden aria-hidden="true" tabindex="-1"><span data-wallet-label>Connect wallet</span></button><header class="ec-hero ec-reveal"><span class="ec-badge">◆ $THREE · the only coin · zero burns</span>@@ -1332,6 +1337,12 @@ function loadAccess() {// matrix (and refreshes the ladder's "You" chip + the pricing discount); a cancelled// or failed sign-in restores the button and shows an inline, recoverable message.function wireAccessActions() {+ // Connect a wallet (no account) to reveal the live matrix — drives the same global+ // connect button as the ladder; wallet:changed then re-reads and re-renders this panel.+ const connect = document.getElementById('ec-access-connect');+ if (connect) {+ connect.addEventListener('click', () => document.getElementById('connect-wallet-btn')?.click());+ }const signin = document.getElementById('ec-access-signin');if (!signin) return;signin.addEventListener('click', async () => {@@ -1376,6 +1387,12 @@ function init() {root.innerHTML = shell();document.body.appendChild(root);+ // Wire the global wallet connect (hidden #connect-wallet-btn) and auto-connect a+ // trusted wallet, so a returning holder's tier highlights with no click. The+ // "Connect wallet" CTAs route through this same button; on connect, wallet:changed+ // (already bound in load()) re-reads the wallet-aware matrix and re-highlights.+ initWalletButton();+// The Flow: start it, and pause when offscreen to save battery/CPU.const canvas = document.getElementById('ec-flow');if (canvas) {diff --git a/tests/api/providers-replicate.test.js b/tests/api/providers-replicate.test.jsindex 6241bfd57..23c665e43 100644--- a/tests/api/providers-replicate.test.js+++ b/tests/api/providers-replicate.test.js@@ -215,31 +215,48 @@ describe('replicate provider — create-prediction throttle', () => {expect(job.extJobId).toBe('pred_throttle_ok');});- it('surfaces an exhausted throttle as a retryable rate_limited error', async () => {+ it('surfaces an exhausted throttle as a retryable rate_limited error without leaking billing state', async () => {// No Retry-After header → the backoff + the surfaced hint are both parsed// from the "resets in ~3s" body phrasing. Fake timers skip the real waits.+ // The raw `detail` names the account credit balance (the production incident):+ // keep it for logs/providerDetail, but never let it become the surfaced message.+ const RAW_DETAIL =+ 'Request was throttled. Your rate limit for creating predictions is reduced to 6 requests ' ++ 'per minute with a burst of 1 requests while you have less than $5.0 in credit. ' ++ 'Your rate limit resets in ~3s.';vi.useFakeTimers();+ vi.spyOn(console, 'warn').mockImplementation(() => {});try {globalThis.fetch = vi.fn(async () =>- new Response(- JSON.stringify({ detail: 'Request was throttled. Your rate limit resets in ~3s.' }),- { status: 429, headers: { 'content-type': 'application/json' } },- ),+ new Response(JSON.stringify({ detail: RAW_DETAIL }), {+ status: 429,+ headers: { 'content-type': 'application/json' },+ }),);const provider = await freshProvider();- const pending = provider.submit({- mode: 'reconstruct',- params: { images: ['https://img/a.jpg'] },- sourceUrl: 'https://img/a.jpg',- });+ let caught;+ const pending = provider+ .submit({+ mode: 'reconstruct',+ params: { images: ['https://img/a.jpg'] },+ sourceUrl: 'https://img/a.jpg',+ })+ .catch((e) => {+ caught = e;+ throw e;+ });const assertion = expect(pending).rejects.toMatchObject({code: 'rate_limited',status: 429,retryAfter: 3,+ providerDetail: RAW_DETAIL, // retained for server logs});await vi.runAllTimersAsync(); // advance through the bounded backoff sleepsawait assertion;+ // The surfaced message is clean — no provider name, credit balance, or raw limits.+ expect(caught.message).toBe('3D generation is briefly busy upstream — please retry in a few seconds.');+ expect(caught.message).not.toMatch(/credit|\$5|throttl|rate limit|replicate/i);} finally {vi.useRealTimers();}diff --git a/tests/api/text-to-image.test.js b/tests/api/text-to-image.test.jsindex 5ec78f9ef..09db7d5a3 100644--- a/tests/api/text-to-image.test.js+++ b/tests/api/text-to-image.test.js@@ -215,6 +215,41 @@ describe('textToImage — Vertex → Replicate fallback', () => {await expect(textToImage('a red teapot')).rejects.toThrow('vertex broke');});+ it('classifies a Replicate 429 as rate_limited without leaking the account credit balance', async () => {+ // The production incident: a low-credit Replicate account throttles+ // prediction creation and its `detail` names the balance. We must parse the+ // reset hint for backoff and keep the raw detail for logs (providerDetail),+ // but the surfaced message must be clean — no credit numbers, no $ amounts.+ process.env.REPLICATE_API_TOKEN = 'r8_test_token';+ const RAW_DETAIL =+ 'Request was throttled. Your rate limit for creating predictions is reduced to 6 requests ' ++ 'per minute with a burst of 1 requests while you have less than $5.0 in credit. ' ++ 'Your rate limit resets in ~10s.';+ stubFetch([+ [+ 'api.replicate.com',+ () =>+ new Response(JSON.stringify({ detail: RAW_DETAIL }), {+ status: 429,+ headers: { 'content-type': 'application/json' },+ }),+ ],+ ]);+ vi.spyOn(console, 'warn').mockImplementation(() => {});++ const textToImage = await freshTextToImage();+ const caught = await textToImage('a red teapot').then(+ () => null,+ (e) => e,+ );+ expect(caught).toBeTruthy();+ expect(caught.code).toBe('rate_limited');+ expect(caught.retryAfter).toBe(10); // parsed from "resets in ~10s"+ expect(caught.providerDetail).toBe(RAW_DETAIL); // retained for server logs+ expect(caught.message).toBe('Image generation is briefly busy upstream — please retry in a few seconds.');+ expect(caught.message).not.toMatch(/credit|\$5|throttl|rate limit/i);+ });+it('persists a Vertex data: URI to object storage and returns the https URL', async () => {process.env.GOOGLE_CLOUD_PROJECT = 'demo-project';vertexState.configured = true;diff --git a/tests/api/x402-forge.test.js b/tests/api/x402-forge.test.jsindex 7a9563722..569bcaa5f 100644--- a/tests/api/x402-forge.test.js+++ b/tests/api/x402-forge.test.js@@ -262,6 +262,13 @@ describe('POST /api/x402/forge — paid generation', () => {expect(body.error).toBe('rate_limited');expect(body.retry_after).toBe(10);expect(res.headers['retry-after']).toBe('10');+ // The buyer sees the endpoint's own clean, payment-aware copy — never the+ // upstream throttle text (which can name the generator account's internal+ // credit balance). The mock threw "Request was throttled. …rate limit…".+ expect(body.error_description).toBe(+ 'Generation is briefly busy and your payment was not taken — retry in a few seconds.',+ );+ expect(body.error_description).not.toMatch(/throttl|rate limit|credit|\$5/i);// Submit failed before settle → no settlement receipt was emitted.expect(res.headers['x-payment-response']).toBeUndefined();});