Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

Harden payment lanes, RPC failover, and public surfaces

nirholas05cb96d69521
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 19e983fda..541733cc5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Forge: one-click "Roll & Forge" and a clearer free-to-start welcome** — The Forge now greets you with a Roll & Forge button that picks a great random prompt and generates a model in a single click, so you can reach a finished 3D object without thinking of what to type. The start screen and page header also state plainly that generating is free with no sign-up and the model is yours to download, removing the guesswork about cost. Roll & Forge draws from the same curated prompt library as Surprise me, so every random model is one that reconstructs cleanly. (`/forge`) `[feature, improvement]`
- **Forge: one-tap variations of any model** — Every model you forge now shows a "More like this" row: one tap re-forges the same subject in a different material or finish (brushed brass, translucent glass, carved oak, and more), so you can explore a whole design space without retyping anything. A reshuffle button deals a fresh set of ideas. It appears for text prompts and runs on the free lane, so exploring costs nothing. `[feature]`
- **Free 3D API tells agents exactly when to check back** — When a text-to-3D generation needs a moment and hands back a job to poll, the free /api/3d/generate API now includes how long to wait before checking again (a retryAfter value, also sent as the standard Retry-After header) plus an estimated time-to-ready and a stable creation id. Agents that honor the hint poll on a sensible schedule instead of hammering the endpoint, so they stop tripping the rate limit and the shared free GPU lane carries less needless traffic. Fully backward-compatible: existing callers keep working unchanged. (`/docs/3d-api`) `[improvement]`
+- **Granite-powered features stay up during an IBM outage** — The IBM Granite features (the Granite Oracle, Agent Twin, and Galaxy cluster naming) all run one-shot Granite completions through IBM watsonx. If watsonx dropped a request (an auth, quota, or regional hiccup), those features had no backstop and failed outright. They now fall over to the same Granite model family hosted on OpenRouter, so a watsonx-side blip is invisible to the user and the feature keeps answering. `[infra, improvement]`
- **Image to 3D gets its own front door** — Turning a photo into a 3D model has worked in the Forge for a while, but it hid behind a page titled Text to 3D, and the only photo surface people could find was Selfie to Avatar. There is now a dedicated Image to 3D page (three.ws/image-to-3d) that opens the Forge with the photo tab already selected, an Image to 3D link in the main navigation and footers, and clear pointers between the selfie tools (for making an avatar of you) and Image to 3D (for making a model of any object). The Forge and its feature page are also retitled to say what they actually do: text and images. (`/image-to-3d`) `[improvement]`
- **Image-to-3D leaps forward: true PBR materials on a flagship GPU** — The Forge realism engine (Hunyuan3D 2.1) is now live on a new flagship-class GPU (NVIDIA RTX PRO 6000 Blackwell, 96 GB). High-tier image-to-3D generations now come out with true physically-based materials: real metal, roughness, and color maps that catch light like photographed objects instead of flat plastic. The new hardware is also dramatically faster; the full shape-plus-texture pass finished in about a minute in our live verification, where the previous GPU class could not even load the model. Alongside it, every 3D generation service is healthy again and all of yesterday’s reliability fixes are fully rolled out across the fleet. (`/forge`) `[feature, improvement, infra]`
- **IRL is calmer to use: one clear next step, name tags that stay readable** — The live IRL view stopped talking over itself. Before, you could see "Turn on Camera AR" and "Agent pinned" at the same time, which contradicted each other; now the guidance line and the status line always agree. The floating name tag above each nearby agent is kept clear of the top bar instead of colliding with the Back and Live chips, and when two agents line up front-to-back their tags fan out so both names stay legible rather than stacking into one smudge. The "an agent is near, look around" nudge no longer appears when that agent is already standing in front of you, and it clears itself the moment you turn to face them. (`/irl`) `[improvement]`
@@ -44,11 +45,14 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Photo-to-3D no longer fails when a generation server hands the job between machines** — Turning a photo into a 3D model was failing far too often with a 'task not found' error. The cause was not the generation itself but the hand-off: our GPU workers run across several machines, and a status check made moments after starting could land on a machine that had not yet seen the job, which the site wrongly treated as a permanent failure. The site now recognizes this as the split-second timing gap it is: it re-checks for a finished result, waits out a short grace period so the job can be found, and only reports a real failure (and automatically retries on another engine) once a job is genuinely lost. Fewer dead ends, more finished models. (`/forge`) `[fix, improvement]`
- **Pinning your agent into the real world now feels like a moment** — Anchoring your agent to a real-world spot in IRL used to be confirmed by a single line of text. Now the instant it locks in, a green ring ripples out from your agent's feet with a soft haptic tap, so the payoff of placing an agent in your space actually lands. It respects reduced-motion settings (you still get the haptic), and it's purely a flourish: it never delays the pin. (`/irl`) `[improvement]`
- **Prompt-to-avatar and selfie-to-avatar generation fixed end to end** — Two bugs had been failing every avatar reconstruction job. First, the platform's own 3D worker delivers finished models from our Cloud Storage bucket, but a security allowlist introduced to keep forged URLs out only recognized third-party hosts, so even successful builds were marked failed at the last step. The allowlist now recognizes our own storage bucket (and only ours). Second, avatars generated from a text prompt use a full-body reference image, whose small face the face detector often missed, ending the job with 'no face detected'. The engine now finds the face with a wide-range detector, zooms in, and reads the facial detail from the zoomed view, so full-body renders and distant selfies both work. Describing a person in your prompt still matters: a subject with no human face gets a clear message asking you to reword. (`/create/prompt`) `[fix]`
+- **Real marketplace purchases now land in the Money Pulse** — The Money Pulse's Purchases tab was wired to a source that only ever filled up when a synthetic circulation loop was running, so real skill and time-pass sales never showed. It now reads straight from the marketplace's own purchase ledger: the moment a sale confirms on-chain in $THREE, it appears as a Purchase beat in the live feed, fronted by the agent that earned it, alongside tips, launches, trades and payments. Free trials stay out, so a beat always means value actually changed hands. (`/pulse`) `[fix]`
- **Selfie to 3D works again: finished avatars were being thrown away at the last step** — Since the July infrastructure move, the selfie and photo reconstruction pipeline was failing with a generic "hit a snag" message even though the 3D engine finished every job. The security check that vets where a finished model may be downloaded from did not yet trust our own Google Cloud Storage results, so completed avatars were rejected at the final step. The check now recognizes our own storage, and any generation that was wrongly marked failed has been recovered. If your selfie avatar failed recently, it should now appear, or simply retry. `[fix]`
- **Share a model, and whoever opens the link builds their own** — Forge something you like and hit Share: you now get a remix link. When a friend opens it, the homepage loads with your prompt already in the forge bar and starts building their own version on arrival, no typing and no sign-up. Any link of the form three.ws/?prompt=your idea works the same way, so you can hand-craft or bookmark them too. It turns every creation into an invitation: make something, share it, and the next person is one glance away from making their own. (The Open in Scene action still links your exact finished model.) `[feature]`
- **Sharing a model now shows a preview card and a real link** — When you share a forged model, the share panel now shows the exact preview card the link will unfurl as on X, Farcaster, and in chats, so you can see what people will see before you post. Every share is now a real permalink to your model with that card, instead of sometimes falling back to a generic link. Models forged right on the homepage are shareable the same way. (`/forge`) `[improvement]`
- **Sharper, cleaner models from photos** — Four upgrades to photo-to-3D landed together. Uploaded photos now have their background cleanly removed before reconstruction, so a busy backdrop no longer bleeds into the model. You can supply up to 6 reference angles instead of 4 for fuller coverage. Every uploaded angle is now quality-checked, and a blurry or off-subject one is dropped instead of corrupting the result. And every finished model runs through an automatic geometry cleanup pass that welds and de-duplicates the mesh and trims redundant triangles, so models load faster and render cleaner with no loss of detail. (`/image-to-3d`) `[improvement, feature]`
+- **The 3D world no longer stays blurry after a slow moment** — The world automatically lowers render detail if frames get choppy (loading a crowded plaza, a browser tab hiccup, a background sync). Until now it could only step down and never recovered, so a single rough moment left the 3D permanently soft on high-resolution screens while the interface on top stayed sharp. It now climbs back up to your device's full sharpness once frames are smooth again, so a brief hitch no longer costs you clarity for the rest of the session. `[fix, improvement]`
- **The agent-to-agent payment economy runs far cheaper and now cycles hundreds of distinct payers** — Two improvements to the closed-loop x402 agent economy that dogfoods every paid endpoint on the platform. First, a fix: a background wallet-consolidation job was quietly closing the ring's payment account after every settlement, forcing the next one to recreate it and pay account rent each time. That single bug had pushed the real fee cost to roughly a hundred times where it should be. With it fixed and single-signature settlement turned on, each settlement is back to the network floor of a few thousandths of a cent, and the ring's working balance stays in the loop instead of leaking away. Second, a new capability: the ring can now cycle payments through a reusable pool of hundreds to a thousand distinct wallets instead of one, so the economy reads as many participants rather than a single account, with no extra cost per payment. The pool is off until funded and activated, and every wallet in it stays clearly labeled internal dogfooding, not organic demand. (`/admin/ring`) `[fix, improvement, infra]`
+- **The avatar shop and animation bazaar are now discoverable by paying agents** — Two paid endpoints, the premium cosmetic shop and the animation download bazaar, were being skipped during automated x402 discovery: a probe that arrived without a specific item id got a 400/404 before the payment layer could answer, so directory crawlers read them as "not a paid endpoint" and never listed them. They now return a proper payment challenge to any credential-less probe, so agents can find them, see the price, and pay, while real buyers still get precise errors for a missing or unknown item. `[fix]`
- **The homepage AR showcase leads with the best models, and its QR places the exact one you see** — The "Your 3D agent, in your room" section on the homepage now pulls from the top-voted community Forge gallery instead of a random newest-first bucket, so the model you land on is one of the best the community made, not a half-formed generation. And the desktop QR code finally keeps its promise: scanning it opens the exact model on screen in the AR studio and drops it into your space, instead of dumping you on a generic page. (`/`) `[fix]`
- **The homepage community feed is now a live, browsable loop** — The strip of community models on the homepage used to be a fixed set of six. It is now a live feed you can actually browse: switch between Fresh and Trending, and press Show more to see more. New models made by anyone appear at the top on their own while you watch, with a live indicator so Right now stays honest. Each card still spins the real 3D model and opens it when clicked. (`/`) `[feature, improvement]`
- **The homepage no longer greets you with an empty stage** — The live 3D agent on the homepage is the first thing you see, but on a cold visit it could sit as a blank near-black panel for several seconds while the model and 3D engine loaded. That gap is now filled with a gently breathing agent silhouette and a "summoning your agent" cue, so the stage feels alive from the very first paint instead of looking broken. It fades out the instant the real avatar is ready, respects reduced-motion settings, and if the preview ever stalls it now surfaces a retry instead of hanging on the placeholder. `[improvement]`
diff --git a/api/_lib/forge-store.js b/api/_lib/forge-store.js
index d7a1404a0..719ff5770 100644
--- a/api/_lib/forge-store.js
+++ b/api/_lib/forge-store.js
@@ -799,6 +799,26 @@ export async function listShowcase({ limit = 12, voterKey = null, sort = 'fresh'
}
}
+// Total finished community models with a stored GLB — the same public-artifact
+// bar the showcase feed uses (rejected rows excluded). Powers the live "N models
+// forged" social-proof count. Cheap COUNT(*), CDN-cached by its callers.
+export async function countShowcase() {
+ if (!forgeStoreEnabled()) return 0;
+ try {
+ const [row] = await sql`
+ select count(*)::int as n
+ from forge_creations
+ where status = 'done' and glb_url is not null
+ and (outcome is null or outcome != 'rejected')
+ `;
+ return row?.n ?? 0;
+ } catch (err) {
+ if (isDbUnavailableError(err)) console.warn('[forge-store] countShowcase skipped (db unavailable):', err?.message);
+ else console.error('[forge-store] countShowcase failed:', err?.message);
+ return 0;
+ }
+}
+
// Monday 00:00:00 UTC of the Forge-Off week containing `ref` (default: now).
// The weekly ritual runs Monday→Monday UTC; the crowning cron writes one
// forge_board_winners row per completed week keyed by this Monday. Same idiom
diff --git a/api/_lib/service-catalog/services/animation-download.js b/api/_lib/service-catalog/services/animation-download.js
index 05c154297..d674a0125 100644
--- a/api/_lib/service-catalog/services/animation-download.js
+++ b/api/_lib/service-catalog/services/animation-download.js
@@ -20,7 +20,7 @@ export default {
tags: ['3d', 'animation', 'glb', 'motion', 'avatar'],
description: 'three.ws Animation Bazaar — pay once in USDC to unlock a 3D avatar animation (GLB). Each animation has its own price; the response carries a short-lived presigned URL the client fetches directly. Wallets that have already paid can re-download for free by signing in with SIWX.',
input: {
- id: 'pole-dancer-rumba',
+ id: '00000000-0000-0000-0000-000000000000',
},
inputSchema: {
type: 'object',
@@ -28,9 +28,8 @@ export default {
properties: {
id: {
type: 'string',
- minLength: 1,
- maxLength: 128,
- description: 'Animation slug or UUID from the animations catalog.',
+ format: 'uuid',
+ description: 'Animation clip UUID from the marketplace animations feed (GET /api/marketplace/animations).',
},
},
},
diff --git a/api/_lib/solana/connection.js b/api/_lib/solana/connection.js
index 91dd260a4..907b410c6 100644
--- a/api/_lib/solana/connection.js
+++ b/api/_lib/solana/connection.js
@@ -11,13 +11,13 @@
//
// Priority (per network): the caller's explicit url (if any) → Helius → Alchemy
// → dRPC (authenticated) → Ankr (authenticated only) → operator-supplied
-// SOLANA_RPC_FALLBACK_URLS → PublicNode → Leo RPC (keyless FREE tier) → Tatum →
-// therpc → the official mainnet-beta endpoint, always last. We never depend on the
+// SOLANA_RPC_FALLBACK_URLS → PublicNode → Leo RPC (keyless FREE tier) → Tatum → the
+// official mainnet-beta endpoint, always last. We never depend on the
// public endpoint alone — it is the most aggressively rate-limited (the source of
// the `getBalance 429` log noise) — and we never include a keyless Ankr URL, which
// Ankr now answers with a hard 403. The keyless tail (PublicNode + Leo RPC + Tatum
-// + therpc + mainnet-beta) is what keeps checkout serving when a paid plan lapses:
-// all five were verified serving live getLatestBlockhash/getAccountInfo on Solana
+// + MagicBlock + mainnet-beta) is what keeps checkout serving when a paid plan lapses:
+// all were verified serving live getLatestBlockhash/getAccountInfo on Solana
// mainnet, so even with every API key dead the chain still resolves a working node
// instead of erroring out.
//
@@ -248,17 +248,18 @@ export function solanaRpcEndpoints(network = 'mainnet', url = null) {
// chain still has depth when every paid key is exhausted (e.g. a Helius plan
// lapsing mid-billing-cycle). Verified serving getAccountInfo on mainnet.
'https://solana.leorpc.com/?api_key=FREE',
- // Tatum + therpc — two more keyless public lanes. PublicNode, Leo RPC and
- // Tatum were each verified serving getAccountInfo (the method whose malformed
- // response 500'd checkout); therpc was verified on getLatestBlockhash but is
- // flaky on getAccountInfo (intermittently returns an empty body), so it sits
- // last before mainnet-beta and leans on the classifyRpcBody guard to fail over
- // when it returns garbage — it adds redundancy for the methods it serves
- // without ever handing web3.js something it can't parse. With mainnet-beta this
- // is five keyless fallbacks: a request only errors if all five are down at
- // once. The free public-RPC pool has thinned (most providers now 401/403/429
- // keyless), so this set is curated to ones that actually respond — re-verify
- // any that start cooling persistently in the failover logs.
+ // Tatum keyless lane. PublicNode, Leo RPC and Tatum were each verified serving
+ // getAccountInfo (the method whose malformed response 500'd checkout). Tatum
+ // gates getBalance and getSignaturesForAddress behind a paid tier (a -16401
+ // "available for paid plans only" / "not available for anonymous access"
+ // JSON-RPC error), which isProviderTierError classifies as a fail-over signal,
+ // so it adds redundancy for the methods it serves without ever blinding a
+ // balance/signature caller. The free public-RPC pool has thinned (most
+ // providers now 401/403/429 keyless), so this set is curated to ones that
+ // actually respond; re-verify any that start cooling persistently in the
+ // failover logs. (solana.therpc.io was pruned 2026-07-17 after going fully
+ // unreachable, DNS fetch failures on every probe of both getLatestBlockhash
+ // and getBalance.)
'https://api.tatum.io/v3/blockchain/node/solana-mainnet',
// MagicBlock + Tatum's gateway host — two more keyless lanes verified live
// (getLatestBlockhash + sendTransaction enabled) on 2026-07-04 when the free
@@ -267,7 +268,6 @@ export function solanaRpcEndpoints(network = 'mainnet', url = null) {
// classifyRpcBody guard still fails them over if either returns garbage.
'https://rpc.magicblock.app/mainnet',
'https://solana-mainnet.gateway.tatum.io',
- 'https://solana.therpc.io',
PUBLIC_MAINNET,
// Paid metered reserve (mainnet only — devnet URLs would cross clusters).
// Dead last BY DESIGN: these bill against a monthly quota, so they serve
diff --git a/api/_lib/watsonx.js b/api/_lib/watsonx.js
index 5ab577fbd..2cf33f573 100644
--- a/api/_lib/watsonx.js
+++ b/api/_lib/watsonx.js
@@ -165,24 +165,93 @@ export async function watsonxEmbed(cfg, { inputs, model } = {}) {
// One-shot (non-streaming) chat completion. Used where we need a short, whole
// answer rather than a token stream — e.g. asking Granite to name a cluster of
// semantically-similar agents. Returns the assistant text and token usage.
+//
+// If the watsonx call fails outright (IAM auth, quota, region outage, an
+// unsupported model) AND an OpenRouter key is configured, this falls over to
+// OpenRouter-hosted Granite — the SAME model family (ibm-granite/*), just
+// different hosting — so every Granite consumer (Oracle, Twin, Galaxy, cluster
+// naming) stays up during a watsonx outage instead of hard-failing. Invisible
+// to callers: the return shape is identical and `provider` marks which lane
+// served. When OpenRouter is unset the original watsonx error propagates
+// unchanged, exactly as before.
export async function watsonxChatComplete(cfg, { messages, model, maxTokens, temperature } = {}) {
// Decoding params are TOP-LEVEL on the chat endpoint (it is OpenAI-shaped) —
// not nested under a `parameters` wrapper (that's the older text/generation
// API). Nesting them here silently dropped max_tokens/temperature; keep this
// consistent with watsonxChatRequest() above, which already sends them flat.
- const data = await watsonxPost(cfg, '/ml/v1/text/chat', {
- model_id: model || cfg.chatModel,
- messages,
- ...(maxTokens != null ? { max_tokens: maxTokens } : {}),
- ...(temperature != null ? { temperature } : {}),
- });
- const choice = data.choices?.[0];
- return {
- text: choice?.message?.content ?? '',
- finishReason: choice?.finish_reason,
- usage: data.usage,
- model: data.model_id || model || cfg.chatModel,
- };
+ try {
+ const data = await watsonxPost(cfg, '/ml/v1/text/chat', {
+ model_id: model || cfg.chatModel,
+ messages,
+ ...(maxTokens != null ? { max_tokens: maxTokens } : {}),
+ ...(temperature != null ? { temperature } : {}),
+ });
+ const choice = data.choices?.[0];
+ return {
+ text: choice?.message?.content ?? '',
+ finishReason: choice?.finish_reason,
+ usage: data.usage,
+ model: data.model_id || model || cfg.chatModel,
+ provider: 'watsonx',
+ };
+ } catch (err) {
+ const fallback = await graniteOpenRouterFallback({ messages, maxTokens, temperature });
+ if (fallback) {
+ console.warn(`[watsonx] chat failed, served via OpenRouter Granite: ${err.message}`);
+ return fallback;
+ }
+ throw err;
+ }
+}
+
+// Same-model backstop for watsonxChatComplete: OpenRouter-hosted Granite, tried
+// only when the watsonx call failed. Keeps the platform's Granite features alive
+// through a watsonx-side outage without swapping the model family. Returns null
+// when no OpenRouter key is configured (so the original watsonx error stands) or
+// when OpenRouter itself fails. The key list mirrors llm.js / brain-chat:
+// OPENROUTER_API_KEY first, then the comma-separated OPENROUTER_FALLBACK_KEYS.
+async function graniteOpenRouterFallback({ messages, maxTokens, temperature }) {
+ const keys = [
+ process.env.OPENROUTER_API_KEY?.trim(),
+ ...(process.env.OPENROUTER_FALLBACK_KEYS || '').split(',').map((k) => k.trim()),
+ ].filter(Boolean);
+ if (!keys.length) return null;
+ const model = process.env.OPENROUTER_GRANITE_MODEL?.trim() || 'ibm-granite/granite-4.1-8b';
+ for (const key of [...new Set(keys)]) {
+ try {
+ const res = await fetch('https://openrouter.ai/api/v1/chat/completions', {
+ method: 'POST',
+ headers: {
+ 'content-type': 'application/json',
+ authorization: `Bearer ${key}`,
+ 'HTTP-Referer': 'https://three.ws',
+ 'X-Title': 'three.ws',
+ },
+ body: JSON.stringify({
+ model,
+ messages,
+ ...(maxTokens != null ? { max_tokens: maxTokens } : {}),
+ ...(temperature != null ? { temperature } : {}),
+ }),
+ signal: AbortSignal.timeout(20_000),
+ });
+ if (!res.ok) continue;
+ const data = await res.json();
+ const choice = data.choices?.[0];
+ const text = choice?.message?.content ?? '';
+ if (!text) continue;
+ return {
+ text,
+ finishReason: choice?.finish_reason,
+ usage: data.usage,
+ model: data.model || model,
+ provider: 'openrouter-granite',
+ };
+ } catch {
+ // Try the next key; if all fail we return null and the watsonx error stands.
+ }
+ }
+ return null;
}
// Granite TimeSeries forecasting lives in ./watsonx-forecast.js (the canonical
diff --git a/api/forge-gallery.js b/api/forge-gallery.js
index 3c21ae521..6e60bd312 100644
--- a/api/forge-gallery.js
+++ b/api/forge-gallery.js
@@ -20,7 +20,7 @@
import { cors, json, method, wrap, rateLimited } from './_lib/http.js';
import { limits, clientIp } from './_lib/rate-limit.js';
-import { hashClient, listCreations, listShowcase, forgeStoreEnabled } from './_lib/forge-store.js';
+import { hashClient, listCreations, listShowcase, countShowcase, forgeStoreEnabled } from './_lib/forge-store.js';
export default wrap(async (req, res) => {
if (cors(req, res, { methods: 'GET,OPTIONS' })) return;
@@ -49,13 +49,18 @@ export default wrap(async (req, res) => {
const rawClient = req.headers['x-forge-client'];
const hasClient = Array.isArray(rawClient) ? rawClient[0] : rawClient;
const voterKey = hasClient ? hashClient(hasClient) : null;
- const creations = await listShowcase({ limit, sort, window, voterKey });
+ // `total` is the full community-model count (social proof), independent of
+ // the paginated slice. Cheap enough to run alongside the feed read.
+ const [creations, total] = await Promise.all([
+ listShowcase({ limit, sort, window, voterKey }),
+ countShowcase(),
+ ]);
// Per-voter reads can't be shared across browsers, so only the anonymous
// (no client id) read is CDN-cacheable. A voted-state read is private.
const headers = voterKey
? { 'cache-control': 'private, no-store' }
: { 'cache-control': 'public, s-maxage=60, stale-while-revalidate=300' };
- return json(res, 200, { enabled: true, creations, sort, window }, headers);
+ return json(res, 200, { enabled: true, creations, total, sort, window }, headers);
}
const rawClient = req.headers['x-forge-client'];
diff --git a/api/openapi-json.js b/api/openapi-json.js
index 15ab57893..4e9f54a8c 100644
--- a/api/openapi-json.js
+++ b/api/openapi-json.js
@@ -1208,7 +1208,31 @@ export default wrap(async (req, res) => {
},
],
responses: {
- 200: { description: 'Ownership grant JSON' },
+ 200: {
+ description: 'Ownership grant JSON',
+ content: {
+ 'application/json': {
+ schema: {
+ type: 'object',
+ required: ['ok', 'id', 'name', 'slot', 'rarity', 'account', 'owned'],
+ properties: {
+ ok: { type: 'boolean' },
+ id: { type: 'string' },
+ name: { type: 'string' },
+ slot: { type: 'string' },
+ rarity: { type: 'string' },
+ account: { type: 'string' },
+ owned: { type: 'boolean' },
+ newlyOwned: { type: 'boolean' },
+ payer: { type: ['string', 'null'] },
+ network: { type: ['string', 'null'] },
+ amountAtomics: { type: ['string', 'null'] },
+ asset: { type: ['string', 'null'] },
+ },
+ },
+ },
+ },
+ },
400: { description: 'Missing or invalid id/account' },
402: { description: 'Payment Required (x402)' },
404: { description: 'Cosmetic not found' },
@@ -1231,12 +1255,32 @@ export default wrap(async (req, res) => {
name: 'id',
in: 'query',
required: true,
- schema: { type: 'string', minLength: 1, maxLength: 128 },
- description: 'Animation slug or UUID from the animations catalog.',
+ schema: { type: 'string', format: 'uuid' },
+ description: 'Animation clip UUID from the marketplace animations feed (GET /api/marketplace/animations).',
},
],
responses: {
- 200: { description: 'Presigned download URL JSON' },
+ 200: {
+ description: 'Presigned download URL JSON',
+ content: {
+ 'application/json': {
+ schema: {
+ type: 'object',
+ required: ['ok', 'id', 'name', 'mimeType', 'downloadUrl', 'expiresAt'],
+ properties: {
+ ok: { type: 'boolean' },
+ id: { type: 'string', format: 'uuid' },
+ slug: { type: 'string' },
+ name: { type: 'string' },
+ mimeType: { type: 'string' },
+ sizeBytes: { type: 'integer', minimum: 0 },
+ expiresAt: { type: 'string', format: 'date-time' },
+ downloadUrl: { type: 'string', format: 'uri' },
+ },
+ },
+ },
+ },
+ },
400: { description: 'Missing or invalid id' },
402: { description: 'Payment Required (x402)' },
404: { description: 'Animation not found' },
diff --git a/api/pulse.js b/api/pulse.js
index cce5d073d..a1a0901d4 100644
--- a/api/pulse.js
+++ b/api/pulse.js
@@ -10,6 +10,9 @@
// (event_type='spend', category in 'trade'/'snipe'), and agent-to-agent
// payments (category='x402'). These are already-public, on-chain movements.
// · pump_agent_mints — coins launched by an agent.
+// · skill_purchases — real marketplace purchases (skill / time-pass) confirmed
+// on-chain and settled in $THREE. Surfaced as 'purchase' beats the instant a
+// sale lands, straight from the authoritative purchase ledger.
//
// Privacy is load-bearing (see prompts/agent-wallets/07): private withdrawals,
// spend-limit changes, key-recovery and vanity-swap custody events are OWNER-ONLY
@@ -151,6 +154,7 @@ async function handleFeed(req, res, { network, type, agentId, cursor, since }) {
const agentFilterCe = agentId ? sql`AND ce.agent_id = ${agentId}` : sql``;
const agentFilterPam = agentId ? sql`AND pam.agent_id = ${agentId}` : sql``;
+ const agentFilterSp = agentId ? sql`AND sp.agent_id = ${agentId}` : sql``;
// One UNION ALL of identical columns. Casts on the launch side make the null
// columns type-compatible with the custody side.
@@ -237,6 +241,49 @@ async function handleFeed(req, res, { network, type, agentId, cursor, since }) {
LEFT JOIN avatars av ON av.id = ai.avatar_id AND av.deleted_at IS NULL
WHERE pam.network = ${network}
${agentFilterPam}
+
+ UNION ALL
+
+ -- Real marketplace purchases (skill / time-pass) confirmed on-chain and
+ -- settled in $THREE on Solana mainnet. Read straight from skill_purchases,
+ -- the same authoritative ledger the marketplace stats reconcile against, so a
+ -- confirmed sale becomes a 'purchase' beat the moment it lands, not only when
+ -- the synthetic circulation loop happens to be running. Free trials are
+ -- excluded (MARKET_PAID_KINDS): a beat means value actually changed hands.
+ -- The earning SELLER agent fronts the row, mirroring the top-earners math.
+ -- These rows are always Solana mainnet, so the branch yields nothing on the
+ -- devnet feed.
+ SELECT
+ COALESCE(sp.confirmed_at, sp.created_at) AS ts,
+ 'purchase' AS kind,
+ 'p' || sp.id::text AS row_id,
+ 'mainnet'::text AS network,
+ ai.id AS agent_id,
+ ai.name AS agent_name,
+ ai.meta->>'solana_address' AS agent_addr,
+ ai.meta->>'solana_vanity_prefix' AS vanity_prefix,
+ ai.meta->>'solana_vanity_suffix' AS vanity_suffix,
+ av.thumbnail_key AS thumb_key,
+ av.visibility AS avatar_vis,
+ 'THREE'::text AS asset,
+ NULL::bigint AS amount_lamports,
+ sp.amount::numeric AS amount_raw,
+ NULL::numeric AS usd,
+ sp.tx_signature AS signature,
+ NULL::text AS mint,
+ NULL::text AS symbol,
+ NULL::text AS coin_name,
+ sp.skill AS skill,
+ NULL::text AS counterparty
+ FROM skill_purchases sp
+ JOIN agent_identities ai ON ai.id = sp.agent_id AND ${visGate}
+ LEFT JOIN avatars av ON av.id = ai.avatar_id AND av.deleted_at IS NULL
+ WHERE ${network} = 'mainnet'
+ AND sp.status = 'confirmed'
+ AND sp.kind = ANY(${MARKET_PAID_KINDS})
+ AND sp.currency_mint = ${THREE_MINT}
+ AND sp.chain = 'solana'
+ ${agentFilterSp}
`;
// Keyset bounds. `since` (delta poll) returns only rows strictly newer than
diff --git a/api/x402/animation-download.js b/api/x402/animation-download.js
index b3ededf8c..530affbad 100644
--- a/api/x402/animation-download.js
+++ b/api/x402/animation-download.js
@@ -12,7 +12,8 @@
// response-size limit). Mirrors api/x402/asset-download.js.
import { paidEndpoint } from '../_lib/x402-paid-endpoint.js';
-import { buildBazaarSchema } from '../_lib/x402-spec.js';
+import { buildBazaarSchema, paymentRequirements, send402 } from '../_lib/x402-spec.js';
+import { priceFor } from '../_lib/x402-prices.js';
import { withService } from '../_lib/x402/bazaar-helpers.js';
import { sql } from '../_lib/db.js';
import { presignGet } from '../_lib/r2.js';
@@ -131,13 +132,46 @@ async function presignPayload(row) {
};
}
+// Discovery probes (x402scan registration, Bazaar validators) hit the bare route
+// with placeholder or missing query params and expect a valid 402 challenge, not
+// a 400/404 — the x402 discovery spec treats runtime 402 behavior as the source
+// of truth, so request validation must not reject the probe before the payment
+// middleware runs. This advertises the endpoint at a representative default price
+// (env-overridable via X402_PRICE_ANIMATION_DOWNLOAD) with the full bazaar
+// schema. No money can settle against it: a paid retry still needs a real clip
+// uuid (the paymentPresent branches below keep their 400/404), and an X-PAYMENT
+// envelope is only an authorization — USDC moves at settle, which this path never
+// reaches. Mirrors asset-download.js sendDiscoveryChallenge.
+function sendDiscoveryChallenge(res, errText) {
+ const resourceUrl = `${env.APP_ORIGIN}${ROUTE}`;
+ return send402(res, {
+ resourceUrl,
+ accepts: paymentRequirements(resourceUrl, {
+ amount: priceFor('animation-download', '10000'),
+ }),
+ description: DESCRIPTION,
+ bazaar: BAZAAR,
+ error: errText,
+ serviceName: 'three.ws Animation Bazaar',
+ tags: ['3d', 'animation', 'glb', 'avatar', 'motion', 'download'],
+ });
+}
+
// Exported for contract tests (price/statement/payout logic) without a live DB.
export const __test__ = { priceAtomics, buildSiwxStatement, buildPayToOverride, UUID_RE };
export default async function handler(req, res) {
+ const paymentPresent = Boolean(req.headers['x-payment'] || req.headers['payment-signature']);
+
const id = req.query?.id ? String(req.query.id).trim() : '';
if (!UUID_RE.test(id)) {
- return error(res, 400, 'id_required', 'query parameter "id" must be a clip uuid');
+ if (paymentPresent) {
+ return error(res, 400, 'id_required', 'query parameter "id" must be a clip uuid');
+ }
+ return sendDiscoveryChallenge(
+ res,
+ 'query parameter "id" must be a clip uuid — retry with ?id=<uuid> from the marketplace animations feed for that clip’s exact price',
+ );
}
let row;
@@ -147,7 +181,13 @@ export default async function handler(req, res) {
return error(res, 502, 'animation_lookup_failed', err.message);
}
if (!row || !row.listed || !row.artifact_key) {
- return error(res, 404, 'animation_not_found', `no listed animation with id "${id}"`);
+ if (paymentPresent) {
+ return error(res, 404, 'animation_not_found', `no listed animation with id "${id}"`);
+ }
+ return sendDiscoveryChallenge(
+ res,
+ `no listed animation with id "${id}" — browse /api/marketplace/animations for available clip ids`,
+ );
}
// Free listing — no paywall, hand back the presigned URL directly.
diff --git a/api/x402/cosmetic-purchase.js b/api/x402/cosmetic-purchase.js
index a2b3dd8e2..f54334289 100644
--- a/api/x402/cosmetic-purchase.js
+++ b/api/x402/cosmetic-purchase.js
@@ -19,7 +19,8 @@
// against replay and can never double-grant.
import { paidEndpoint } from '../_lib/x402-paid-endpoint.js';
-import { buildBazaarSchema } from '../_lib/x402-spec.js';
+import { buildBazaarSchema, paymentRequirements, send402 } from '../_lib/x402-spec.js';
+import { priceFor } from '../_lib/x402-prices.js';
import { withService } from '../_lib/x402/bazaar-helpers.js';
import { error } from '../_lib/http.js';
import { env } from '../_lib/env.js';
@@ -121,19 +122,58 @@ const BAZAAR = {
}),
};
+// Discovery probes (x402scan registration, Bazaar validators) hit the bare
+// route with placeholder or missing query params and expect a valid 402
+// challenge, not a 400/404 — the x402 discovery spec treats runtime 402 behavior
+// as the source of truth, so request validation must not reject the probe before
+// the payment middleware runs. This advertises the endpoint at a representative
+// default price (env-overridable via X402_PRICE_COSMETIC_PURCHASE) with the full
+// bazaar schema. No money can settle against it: a paid retry still needs a real
+// ?id= + ?account= (the paymentPresent branches below keep their 400/404), and
+// an X-PAYMENT envelope is only an authorization — USDC moves at settle, which
+// this path never reaches. Mirrors asset-download.js sendDiscoveryChallenge.
+function sendDiscoveryChallenge(res, errText) {
+ const resourceUrl = `${env.APP_ORIGIN}${ROUTE}`;
+ return send402(res, {
+ resourceUrl,
+ accepts: paymentRequirements(resourceUrl, {
+ amount: priceFor('cosmetic-purchase', '500000'),
+ }),
+ description: DESCRIPTION,
+ bazaar: BAZAAR,
+ error: errText,
+ serviceName: 'three.ws Avatar Shop',
+ tags: ['3d', 'avatar', 'cosmetic', 'shop', 'wearable'],
+ });
+}
+
// Per-item paidEndpoint built on the fly: the id picks the catalog row, which
// dictates the USDC price; everything else is shared. Mirrors asset-download.js,
// where the slug drives a per-row price + SIWX grant.
export default async function handler(req, res) {
+ const paymentPresent = Boolean(req.headers['x-payment'] || req.headers['payment-signature']);
+
const id = req.query?.id ? String(req.query.id).trim() : '';
if (!id) {
- return error(res, 400, 'id_required', 'query parameter "id" is required');
+ if (paymentPresent) {
+ return error(res, 400, 'id_required', 'query parameter "id" is required');
+ }
+ return sendDiscoveryChallenge(
+ res,
+ 'query parameter "id" is required — retry with ?id=<cosmeticId>&account=<accountId> from /api/cosmetics/catalog for that item’s exact price',
+ );
}
const account = normalizeAccountId(req.query?.account);
if (!account) {
- return error(res, 400, 'account_required',
- 'query parameter "account" is required (a Solana wallet or guest id)');
+ if (paymentPresent) {
+ return error(res, 400, 'account_required',
+ 'query parameter "account" is required (a Solana wallet or guest id)');
+ }
+ return sendDiscoveryChallenge(
+ res,
+ 'query parameter "account" is required (a Solana wallet or guest id) — retry with ?id=<cosmeticId>&account=<accountId>',
+ );
}
// Coin-tied sale (R25): when bought inside a coin's /play world, the optional
@@ -144,12 +184,24 @@ export default async function handler(req, res) {
const item = getCosmetic(id);
if (!item) {
- return error(res, 404, 'cosmetic_not_found', `no cosmetic with id "${id}"`);
+ if (paymentPresent) {
+ return error(res, 404, 'cosmetic_not_found', `no cosmetic with id "${id}"`);
+ }
+ return sendDiscoveryChallenge(
+ res,
+ `no cosmetic with id "${id}" — browse /api/cosmetics/catalog for available premium ids`,
+ );
}
if (!item.premium) {
// Base-pack items ship owned with every avatar — there's nothing to sell.
- return error(res, 400, 'not_purchasable',
- `cosmetic "${id}" is part of the free base pack and is already owned`);
+ if (paymentPresent) {
+ return error(res, 400, 'not_purchasable',
+ `cosmetic "${id}" is part of the free base pack and is already owned`);
+ }
+ return sendDiscoveryChallenge(
+ res,
+ `cosmetic "${id}" is part of the free base pack and is already owned — pick a premium id from /api/cosmetics/catalog`,
+ );
}
const priceAtomics = priceUsdcAtomicsOf(item);
diff --git a/data/changelog.json b/data/changelog.json
index 29595b9c3..c254bea88 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,41 @@
{
"$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-17",
+ "title": "The 3D world no longer stays blurry after a slow moment",
+ "summary": "The world automatically lowers render detail if frames get choppy (loading a crowded plaza, a browser tab hiccup, a background sync). Until now it could only step down and never recovered, so a single rough moment left the 3D permanently soft on high-resolution screens while the interface on top stayed sharp. It now climbs back up to your device's full sharpness once frames are smooth again, so a brief hitch no longer costs you clarity for the rest of the session.",
+ "tags": [
+ "fix",
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-07-17",
+ "title": "Granite-powered features stay up during an IBM outage",
+ "summary": "The IBM Granite features (the Granite Oracle, Agent Twin, and Galaxy cluster naming) all run one-shot Granite completions through IBM watsonx. If watsonx dropped a request (an auth, quota, or regional hiccup), those features had no backstop and failed outright. They now fall over to the same Granite model family hosted on OpenRouter, so a watsonx-side blip is invisible to the user and the feature keeps answering.",
+ "tags": [
+ "infra",
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-07-17",
+ "title": "The avatar shop and animation bazaar are now discoverable by paying agents",
+ "summary": "Two paid endpoints, the premium cosmetic shop and the animation download bazaar, were being skipped during automated x402 discovery: a probe that arrived without a specific item id got a 400/404 before the payment layer could answer, so directory crawlers read them as \"not a paid endpoint\" and never listed them. They now return a proper payment challenge to any credential-less probe, so agents can find them, see the price, and pay, while real buyers still get precise errors for a missing or unknown item.",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-07-17",
+ "title": "Real marketplace purchases now land in the Money Pulse",
+ "summary": "The Money Pulse's Purchases tab was wired to a source that only ever filled up when a synthetic circulation loop was running, so real skill and time-pass sales never showed. It now reads straight from the marketplace's own purchase ledger: the moment a sale confirms on-chain in $THREE, it appears as a Purchase beat in the live feed, fronted by the agent that earned it, alongside tips, launches, trades and payments. Free trials stay out, so a beat always means value actually changed hands.",
+ "tags": [
+ "fix"
+ ],
+ "link": "/pulse"
+ },
{
"date": "2026-07-17",
"title": "AI chat stays up when the free lanes are busy",
diff --git a/pages/daily.html b/pages/daily.html
index b85ed799d..5633b5960 100644
--- a/pages/daily.html
+++ b/pages/daily.html
@@ -14,7 +14,7 @@
<meta property="og:url" content="https://three.ws/daily" />
<meta property="og:title" content="Daily Forge · three.ws" />
<meta property="og:description" content="A new 3D creative challenge every day. Forge today's theme into a real 3D model, free, and keep your streak alive." />
- <meta property="og:image" content="https://three.ws/api/page-og?s=labs&amp;t=Daily+Forge&amp;d=A+new+3D+creative+challenge+every+day.+Forge+today%27s+theme+into+a+real+3D+model%2C+free+and+no+sign-up%2C+and+build+a+daily+streak.&amp;p=%2Fdaily" />
+ <meta property="og:image" content="https://three.ws/api/page-og?s=labs&amp;t=Daily+Forge&amp;d=A+new+3D+creative+challenge+every+day.+Forge+today%27s+theme+into+a+real+3D+model%2C+free+and+no+sign-up%2C+build+a+daily+streak%2C+and+place+your+creation+in+AR+on+you&amp;p=%2Fdaily" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
@@ -162,6 +162,10 @@
footer.foot a { color: var(--ink-dim); }
footer.foot a:hover { color: var(--ink); }
</style>
+
+ <meta property="og:locale" content="en_US">
+ <meta property="og:image:alt" content="Daily Forge — three.ws">
+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=labs&amp;t=Daily+Forge&amp;d=A+new+3D+creative+challenge+every+day.+Forge+today%27s+theme+into+a+real+3D+model%2C+free+and+no+sign-up%2C+build+a+daily+streak%2C+and+place+your+creation+in+AR+on+you&amp;p=%2Fdaily">
</head>
<body>
<header class="bar">
diff --git a/pages/home.html b/pages/home.html
index 875664695..fe6e99d96 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -2494,12 +2494,22 @@
position: relative;
border-radius: 20px;
overflow: hidden;
- background: #0a0a14;
+ /* A soft floor gradient so the model reads as sitting in a space, not
+ floating in a void — sells the "real-world scale" promise on desktop. */
+ background:
+ radial-gradient(120% 80% at 50% 118%, rgba(139,92,246,.16), transparent 60%),
+ linear-gradient(180deg, #0a0a14 0%, #0a0a14 55%, #12121e 100%);
border: 1px solid var(--hairline);
aspect-ratio: 1 / 1;
display: flex; align-items: center; justify-content: center;
}
- .har-viewer-wrap model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
+ /* Faint horizon line where the "floor" meets the "wall". */
+ .har-viewer-wrap::after {
+ content: ''; position: absolute; left: 8%; right: 8%; bottom: 26%;
+ height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
+ pointer-events: none;
+ }
+ .har-viewer-wrap model-viewer { position: relative; z-index: 1; width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
.har-viewer-nav {
position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
display: flex; align-items: center; gap: 8px;
@@ -2513,6 +2523,15 @@
}
.har-nav-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.har-prompt { font-size: 11px; color: rgba(255,255,255,.5); font-family: var(--font-mono); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+ .har-dots { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index: 2; }
+ .har-dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,.25); border: none; padding: 0; cursor: pointer; transition: background .2s, transform .2s; }
+ .har-dot:hover { background: rgba(255,255,255,.5); }
+ .har-dot[data-active="1"] { background: rgba(255,255,255,.9); transform: scale(1.35); }
+ .har-autobar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: linear-gradient(90deg, rgba(139,92,246,.9), rgba(255,255,255,.9)); z-index: 2; }
+ .har-autobar[data-run="1"] { width: 100%; transition: width var(--har-auto-ms, 5000ms) linear; }
+ @media (prefers-reduced-motion: reduce) { .har-autobar { display: none; } }
+ .har-poster-fade { opacity: 0; transition: opacity .35s ease; }
+ .har-poster-fade[data-shown="1"] { opacity: 1; }
.har-skeleton { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 13px; }
.har-right { display: flex; flex-direction: column; gap: 28px; }
.har-mobile-btn {
@@ -4472,6 +4491,8 @@
<div class="har-viewer-wrap" id="har-viewer-wrap">
<div class="har-skeleton" id="har-skeleton">Loading model&hellip;</div>
<!-- model-viewer injected by JS once the CDN script is ready -->
+ <div class="har-dots" id="har-dots" role="tablist" aria-label="Showcase models" style="display:none"></div>
+ <div class="har-autobar" id="har-autobar" aria-hidden="true"></div>
<div class="har-viewer-nav" id="har-viewer-nav" style="display:none">
<button class="har-nav-btn" id="har-prev" aria-label="Previous model" data-i18n-attr="aria-label:home.previous_model_arialabel">&larr;</button>
<span class="har-prompt" id="har-prompt-label"></span>
@@ -4481,7 +4502,7 @@
<div class="har-right">
<div>
<p style="color:var(--text-2);line-height:1.7;margin:0 0 8px;font-size:15px;" data-i18n-html="home.these_are_real_models_from_the_forge">
- These are real models from the <a href="/forge" style="color:var(--text);text-decoration:underline;text-underline-offset:3px">Forge gallery</a> — generated by users with a text prompt. On a phone, tap the button below to see the current model anchored to a flat surface around you at real-world scale.
+ These are real models from the <a href="/forge" style="color:var(--text);text-decoration:underline;text-underline-offset:3px">Forge gallery</a>, generated by users with a text prompt. On a phone, tap the button below to see the current model anchored to a flat surface around you at real-world scale.
</p>
<div class="har-compat">
<span class="har-compat-pill" data-i18n="home.webxr_android">WebXR &middot; Android</span>
@@ -4542,20 +4563,61 @@
let models = [];
let idx = 0;
let mv = null;
+ let autoTimer = null;
+ let autoPaused = false;
+ const AUTO_MS = 5000;
+ const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
const wrap = document.getElementById('har-viewer-wrap');
const skeleton = document.getElementById('har-skeleton');
const nav = document.getElementById('har-viewer-nav');
+ const dotsWrap = document.getElementById('har-dots');
+ const autobar = document.getElementById('har-autobar');
const promptLabel = document.getElementById('har-prompt-label');
const arBtn = document.getElementById('har-ar-btn');
const qrCanvas = document.getElementById('har-qr-canvas');
const qrWrap = document.getElementById('har-qr-wrap');
- // Render QR pointing to three.ws/forge for this model
- function updateQR(glbUrl) {
- // Link directly to the gallery so mobile users can pick the same model
- // Encode as a forge viewer link if possible; fall back to /forge
- const arUrl = `https://three.ws/forge`;
+ // Dedupe (same prompt or same mesh twice reads as a bug) and interleave by
+ // category so consecutive slides feel varied (a character, an object, a
+ // creature) instead of three carnival tents in a row.
+ function curate(list) {
+ const seen = new Set();
+ const unique = list.filter((c) => {
+ // Two takes on the same subject read as a bug even though each is a
+ // distinct mesh, and near-duplicate prompts (one with extra "photoreal…"
+ // hints appended) share an opening clause. Collapse on a normalized
+ // prompt prefix, keeping the first / best-voted occurrence. Fall back to
+ // the glb url when there is no prompt.
+ const p = String(c.prompt || '').trim().toLowerCase().replace(/\s+/g, ' ').slice(0, 48);
+ const key = p || c.glb_url;
+ if (seen.has(key)) return false;
+ seen.add(key);
+ return true;
+ });
+ const out = [];
+ const pool = unique.slice();
+ let lastCat = null;
+ while (pool.length) {
+ let pick = pool.findIndex((c) => (c.model_category || 'other') !== lastCat);
+ if (pick === -1) pick = 0;
+ const [c] = pool.splice(pick, 1);
+ out.push(c);
+ lastCat = c.model_category || 'other';
+ }
+ return out;
+ }
+
+ // Deep-link the QR at the CURRENTLY SHOWN model in the AR studio, so scanning
+ // it places exactly this model in the room, matching the "place this model"
+ // caption. Falls back to /forge only when no glb is available yet.
+ function updateQR(glbUrl, prompt) {
+ let arUrl = 'https://three.ws/forge';
+ if (glbUrl) {
+ const q = new URLSearchParams({ src: glbUrl });
+ if (prompt) q.set('title', String(prompt).slice(0, 120));
+ arUrl = 'https://three.ws/ar/studio/?' + q.toString();
+ }
try {
const ctx = qrCanvas.getContext('2d');
const tmp = renderQRToCanvas(arUrl, { scale: 8, margin: 2 });
@@ -4569,19 +4631,95 @@
function loadModel(m) {
if (!mv) return;
+ // Poster-first: the rendered thumbnail paints instantly while the GLB
+ // streams in, so the viewer never shows a black "Loading model…" void.
+ if (m.preview_image_url) mv.setAttribute('poster', m.preview_image_url);
+ else mv.removeAttribute('poster');
mv.setAttribute('src', m.glb_url);
mv.setAttribute('alt', m.prompt || '3D model');
promptLabel.textContent = m.prompt || 'model';
arBtn.disabled = false;
- updateQR(m.glb_url);
+ updateQR(m.glb_url, m.prompt);
+ syncDots();
+ }
+
+ function syncDots() {
+ if (!dotsWrap) return;
+ for (const d of dotsWrap.children) {
+ const on = Number(d.dataset.i) === idx;
+ d.dataset.active = on ? '1' : '0';
+ d.setAttribute('aria-selected', on ? 'true' : 'false');
+ }
+ }
+
+ function buildDots() {
+ if (!dotsWrap || models.length < 2) return;
+ dotsWrap.innerHTML = '';
+ models.forEach((m, i) => {
+ const b = document.createElement('button');
+ b.className = 'har-dot';
+ b.dataset.i = String(i);
+ b.setAttribute('role', 'tab');
+ b.setAttribute('aria-label', 'Show model ' + (i + 1) + ' of ' + models.length);
+ b.addEventListener('click', () => { pauseAuto(); show(i); });
+ dotsWrap.appendChild(b);
+ });
+ dotsWrap.style.display = 'flex';
}
+ function show(i) {
+ idx = (i + models.length) % models.length;
+ loadModel(models[idx]);
+ restartAutobar();
+ }
+
+ // The thin progress bar telegraphs the auto-advance; restarting it means
+ // reflowing so the CSS transition replays from 0.
+ function restartAutobar() {
+ if (!autobar || reduceMotion) return;
+ autobar.dataset.run = '0';
+ autobar.style.setProperty('--har-auto-ms', AUTO_MS + 'ms');
+ void autobar.offsetWidth;
+ if (!autoPaused && autoTimer) autobar.dataset.run = '1';
+ }
+
+ function startAuto() {
+ if (reduceMotion || models.length < 2 || autoTimer) return;
+ autoTimer = setInterval(() => { if (!autoPaused) show(idx + 1); }, AUTO_MS);
+ restartAutobar();
+ }
+
+ // Pause is permanent once the visitor takes the wheel (nav, dot, drag).
+ // Autoplay that fights the user is worse than none.
+ function pauseAuto() {
+ if (autoTimer) { clearInterval(autoTimer); autoTimer = null; }
+ if (autobar) autobar.dataset.run = '0';
+ }
+
+ // Hover/focus is a soft pause: hold position, resume on leave.
+ function softPause() { autoPaused = true; if (autobar) autobar.dataset.run = '0'; }
+ function softResume() { autoPaused = false; restartAutobar(); }
+
async function init() {
try {
- const r = await fetch('/api/forge-gallery?limit=12');
+ // Curated community showcase (top-voted first, rejected excluded), not
+ // the anonymous newest-first bucket. The AR hero should lead with the
+ // best models, never a random half-formed generation.
+ const r = await fetch('/api/forge-gallery?scope=community&sort=top&limit=24');
if (!r.ok) throw new Error(r.status);
const d = await r.json();
- models = (d.creations || []).filter(c => c.glb_url);
+ const all = (d.creations || []).filter(c => c.glb_url);
+ // Votes are sparse, so top-sort falls back to newest and can surface
+ // throwaway prompts ("test") or un-rendered results. Prefer entries that
+ // actually produced a poster and carry a real description; keep the
+ // API's vote ordering. Fall back to the raw list if the filter empties.
+ const junk = /^\s*(test|asdf|hello|hi|untitled)\b/i;
+ const quality = all.filter(c =>
+ c.preview_image_url &&
+ String(c.prompt || '').trim().length >= 12 &&
+ !junk.test(String(c.prompt || '')),
+ );
+ models = curate(quality.length ? quality : all).slice(0, 12);
} catch { models = []; }
if (!models.length) {
@@ -4598,28 +4736,39 @@
mv.setAttribute('ar-modes', 'webxr scene-viewer quick-look');
mv.setAttribute('shadow-intensity', '1');
mv.setAttribute('environment-image', 'neutral');
+ if (models[0].preview_image_url) mv.setAttribute('poster', models[0].preview_image_url);
mv.style.cssText = 'width:100%;height:100%;--poster-color:transparent;background:transparent;';
skeleton.style.display = 'none';
wrap.insertBefore(mv, nav);
+ buildDots();
loadModel(models[0]);
nav.style.display = 'flex';
- // Wire AR button to model-viewer
+ // Wire AR button to model-viewer. Launching AR stops the carousel so it
+ // can't advance out from under an active placement.
arBtn.addEventListener('click', () => {
+ pauseAuto();
if (mv && mv.activateAR) mv.activateAR();
});
- // Cycle models
- document.getElementById('har-prev').addEventListener('click', () => {
- idx = (idx - 1 + models.length) % models.length;
- loadModel(models[idx]);
- });
- document.getElementById('har-next').addEventListener('click', () => {
- idx = (idx + 1) % models.length;
- loadModel(models[idx]);
+ // Manual nav takes the wheel: hard-stop autoplay.
+ document.getElementById('har-prev').addEventListener('click', () => { pauseAuto(); show(idx - 1); });
+ document.getElementById('har-next').addEventListener('click', () => { pauseAuto(); show(idx + 1); });
+
+ // Hover/focus/drag softly holds position; leaving resumes.
+ wrap.addEventListener('pointerenter', softPause);
+ wrap.addEventListener('pointerleave', softResume);
+ wrap.addEventListener('pointerdown', pauseAuto);
+ wrap.addEventListener('focusin', softPause);
+ wrap.addEventListener('focusout', softResume);
+ // Don't advance while the tab is backgrounded.
+ document.addEventListener('visibilitychange', () => {
+ if (document.hidden) softPause(); else softResume();
});
+
+ startAuto();
}
// Render initial QR immediately (desktop only, no model needed)
diff --git a/pages/ibm/hello.html b/pages/ibm/hello.html
index 0fa0b5f16..a866dc29a 100644
--- a/pages/ibm/hello.html
+++ b/pages/ibm/hello.html
@@ -421,13 +421,13 @@ a:focus-visible{outline-offset:3px}
<link rel="canonical" href="https://three.ws/ibm/hello">
<meta property="og:site_name" content="three.ws">
<meta property="og:url" content="https://three.ws/ibm/x402-demo">
- <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&amp;t=x402+Live+Demo+%28IBM+%C3%97+three.ws%29&amp;d=A+self-contained+x402+micropayment+demo%3A+pay+%240.001+USDC+from+your+own+wallet+%E2%80%94+MetaMask+on+Base+or+Phantom+on+Solana+%E2%80%94+to+call+a+real+three.ws+data+API.+Watch+&amp;p=%2Fibm%2Fx402-demo">
+ <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&amp;t=IBM+%C3%97+three.ws+partnership&amp;d=The+IBM+%C3%97+three.ws+partnership+page%3A+how+three.ws%27s+agent+identity%2C+x402+payment+rails%2C+and+MCP+servers+integrate+with+IBM+watsonx+and+the+IBM+x402+ecosystem.+A&amp;p=%2Fibm%2Fhello">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="x402 Live Demo (IBM × three.ws) · three.ws" data-i18n-attr="content:ibm_hello.meta_twitter_title">
<meta name="twitter:description" content="A self-contained x402 micropayment demo: pay $0.001 USDC from your own wallet — MetaMask on Base or Phantom on Solana — to call a real three.ws data API. Watch the live HTTP 402 challenge, sign a gasless authorization, and see the on-chain settlement receipt. No backend, no account; built as the public face of the IBM × three.ws partnership." data-i18n-attr="content:ibm_hello.meta_twitter_description">
- <meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&amp;t=x402+Live+Demo+%28IBM+%C3%97+three.ws%29&amp;d=A+self-contained+x402+micropayment+demo%3A+pay+%240.001+USDC+from+your+own+wallet+%E2%80%94+MetaMask+on+Base+or+Phantom+on+Solana+%E2%80%94+to+call+a+real+three.ws+data+API.+Watch+&amp;p=%2Fibm%2Fx402-demo">
+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&amp;t=IBM+%C3%97+three.ws+partnership&amp;d=The+IBM+%C3%97+three.ws+partnership+page%3A+how+three.ws%27s+agent+identity%2C+x402+payment+rails%2C+and+MCP+servers+integrate+with+IBM+watsonx+and+the+IBM+x402+ecosystem.+A&amp;p=%2Fibm%2Fhello">
<script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"x402 Live Demo (IBM × three.ws)","description":"A self-contained x402 micropayment demo: pay $0.001 USDC from your own wallet — MetaMask on Base or Phantom on Solana — to call a real three.ws data API. Watch the live HTTP 402 challenge, sign a gasless authorization, and see the on-chain settlement receipt. No backend, no account; built as the public face of the IBM × three.ws partnership.","url":"https://three.ws/ibm/x402-demo","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
<!-- model-viewer renders the GLB returned by the paid Forge demo (Demo 01).
Self-hosted (travels with this file under ./vendor/) so the page needs no
diff --git a/public/changelog.json b/public/changelog.json
index f85a94553..9035b9a90 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-17T23:01:07.025Z",
+ "generated_at": "2026-07-17T23:15:17.858Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -299,6 +299,17 @@
"improvement"
]
},
+ {
+ "date": "2026-07-17",
+ "type": "update",
+ "title": "Granite-powered features stay up during an IBM outage",
+ "summary": "The IBM Granite features (the Granite Oracle, Agent Twin, and Galaxy cluster naming) all run one-shot Granite completions through IBM watsonx. If watsonx dropped a request (an auth, quota, or regional hiccup), those features had no backstop and failed outright. They now fall over to the same Granite model family hosted on OpenRouter, so a watsonx-side blip is invisible to the user and the feature keeps answering.",
+ "link": null,
+ "tags": [
+ "infra",
+ "improvement"
+ ]
+ },
{
"date": "2026-07-17",
"type": "update",
@@ -404,6 +415,16 @@
"fix"
]
},
+ {
+ "date": "2026-07-17",
+ "type": "update",
+ "title": "Real marketplace purchases now land in the Money Pulse",
+ "summary": "The Money Pulse's Purchases tab was wired to a source that only ever filled up when a synthetic circulation loop was running, so real skill and time-pass sales never showed. It now reads straight from the marketplace's own purchase ledger: the moment a sale confirms on-chain in $THREE, it appears as a Purchase beat in the live feed, fronted by the agent that earned it, alongside tips, launches, trades and payments. Free trials stay out, so a beat always means value actually changed hands.",
+ "link": "/pulse",
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-17",
"type": "update",
@@ -445,6 +466,17 @@
"feature"
]
},
+ {
+ "date": "2026-07-17",
+ "type": "update",
+ "title": "The 3D world no longer stays blurry after a slow moment",
+ "summary": "The world automatically lowers render detail if frames get choppy (loading a crowded plaza, a browser tab hiccup, a background sync). Until now it could only step down and never recovered, so a single rough moment left the 3D permanently soft on high-resolution screens while the interface on top stayed sharp. It now climbs back up to your device's full sharpness once frames are smooth again, so a brief hitch no longer costs you clarity for the rest of the session.",
+ "link": null,
+ "tags": [
+ "fix",
+ "improvement"
+ ]
+ },
{
"date": "2026-07-17",
"type": "update",
@@ -457,6 +489,16 @@
"infra"
]
},
+ {
+ "date": "2026-07-17",
+ "type": "update",
+ "title": "The avatar shop and animation bazaar are now discoverable by paying agents",
+ "summary": "Two paid endpoints, the premium cosmetic shop and the animation download bazaar, were being skipped during automated x402 discovery: a probe that arrived without a specific item id got a 400/404 before the payment layer could answer, so directory crawlers read them as \"not a paid endpoint\" and never listed them. They now return a proper payment challenge to any credential-less probe, so agents can find them, see the price, and pay, while real buyers still get precise errors for a missing or unknown item.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-17",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index d38222c27..616d5c58c 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -230,6 +230,14 @@
<category>improvement</category>
<description>When a text-to-3D generation needs a moment and hands back a job to poll, the free /api/3d/generate API now includes how long to wait before checking again (a retryAfter value, also sent as the standard Retry-After header) plus an estimated time-to-ready and a stable creation id. Agents that honor the hint poll on a sensible schedule instead of hammering the endpoint, so they stop tripping the rate limit and the shared free GPU lane carries less needless traffic. Fully backward-compatible: existing callers keep working unchanged.</description>
</item>
+ <item>
+ <title>Granite-powered features stay up during an IBM outage</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-17:Granite-powered features stay up during an IBM outage</guid>
+ <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>
+ <category>infra</category>
+ <description>The IBM Granite features (the Granite Oracle, Agent Twin, and Galaxy cluster naming) all run one-shot Granite completions through IBM watsonx. If watsonx dropped a request (an auth, quota, or regional hiccup), those features had no backstop and failed outright. They now fall over to the same Granite model family hosted on OpenRouter, so a watsonx-side blip is invisible to the user and the feature keeps answering.</description>
+ </item>
<item>
<title>Image to 3D gets its own front door</title>
<link>https://three.ws/image-to-3d</link>
@@ -310,6 +318,14 @@
<category>fix</category>
<description>Two bugs had been failing every avatar reconstruction job. First, the platform's own 3D worker delivers finished models from our Cloud Storage bucket, but a security allowlist introduced to keep forged URLs out only recognized third-party hosts, so even successful builds were marked failed at the last step. The allowlist now recognizes our own storage bucket (and only ours). Second, avatars generated from a text prompt use a full-body reference image, whose small face the face detector often missed, ending the job with 'no face detected'. The engine now finds the face with a wide-range detector, zooms in, and reads the facial detail from the zoomed view, so full-body renders and distant selfies both work. Describing a person in your prompt still matters: a subject with no human face gets a clear message asking you to reword.</description>
</item>
+ <item>
+ <title>Real marketplace purchases now land in the Money Pulse</title>
+ <link>https://three.ws/pulse</link>
+ <guid isPermaLink="false">2026-07-17:Real marketplace purchases now land in the Money Pulse</guid>
+ <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The Money Pulse's Purchases tab was wired to a source that only ever filled up when a synthetic circulation loop was running, so real skill and time-pass sales never showed. It now reads straight from the marketplace's own purchase ledger: the moment a sale confirms on-chain in $THREE, it appears as a Purchase beat in the live feed, fronted by the agent that earned it, alongside tips, launches, trades and payments. Free trials stay out, so a beat always means value actually changed hands.</description>
+ </item>
<item>
<title>Selfie to 3D works again: finished avatars were being thrown away at the last step</title>
<link>https://three.ws/changelog</link>
@@ -342,6 +358,14 @@
<category>improvement</category>
<description>Four upgrades to photo-to-3D landed together. Uploaded photos now have their background cleanly removed before reconstruction, so a busy backdrop no longer bleeds into the model. You can supply up to 6 reference angles instead of 4 for fuller coverage. Every uploaded angle is now quality-checked, and a blurry or off-subject one is dropped instead of corrupting the result. And every finished model runs through an automatic geometry cleanup pass that welds and de-duplicates the mesh and trims redundant triangles, so models load faster and render cleaner with no loss of detail.</description>
</item>
+ <item>
+ <title>The 3D world no longer stays blurry after a slow moment</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-17:The 3D world no longer stays blurry after a slow moment</guid>
+ <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The world automatically lowers render detail if frames get choppy (loading a crowded plaza, a browser tab hiccup, a background sync). Until now it could only step down and never recovered, so a single rough moment left the 3D permanently soft on high-resolution screens while the interface on top stayed sharp. It now climbs back up to your device's full sharpness once frames are smooth again, so a brief hitch no longer costs you clarity for the rest of the session.</description>
+ </item>
<item>
<title>The agent-to-agent payment economy runs far cheaper and now cycles hundreds of distinct payers</title>
<link>https://three.ws/admin/ring</link>
@@ -350,6 +374,14 @@
<category>fix</category>
<description>Two improvements to the closed-loop x402 agent economy that dogfoods every paid endpoint on the platform. First, a fix: a background wallet-consolidation job was quietly closing the ring's payment account after every settlement, forcing the next one to recreate it and pay account rent each time. That single bug had pushed the real fee cost to roughly a hundred times where it should be. With it fixed and single-signature settlement turned on, each settlement is back to the network floor of a few thousandths of a cent, and the ring's working balance stays in the loop instead of leaking away. Second, a new capability: the ring can now cycle payments through a reusable pool of hundreds to a thousand distinct wallets instead of one, so the economy reads as many participants rather than a single account, with no extra cost per payment. The pool is off until funded and activated, and every wallet in it stays clearly labeled internal dogfooding, not organic demand.</description>
</item>
+ <item>
+ <title>The avatar shop and animation bazaar are now discoverable by paying agents</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-17:The avatar shop and animation bazaar are now discoverable by paying agents</guid>
+ <pubDate>Fri, 17 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Two paid endpoints, the premium cosmetic shop and the animation download bazaar, were being skipped during automated x402 discovery: a probe that arrived without a specific item id got a 400/404 before the payment layer could answer, so directory crawlers read them as &quot;not a paid endpoint&quot; and never listed them. They now return a proper payment challenge to any credential-less probe, so agents can find them, see the price, and pay, while real buyers still get precise errors for a missing or unknown item.</description>
+ </item>
<item>
<title>The homepage AR showcase leads with the best models, and its QR places the exact one you see</title>
<link>https://three.ws/</link>
diff --git a/public/features.json b/public/features.json
index d9136b5a9..a70b3f721 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-17T23:01:07.009Z",
+ "generated_at": "2026-07-17T23:15:17.839Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/locales/en.json b/public/locales/en.json
index 04230495d..479e26ff5 100644
--- a/public/locales/en.json
+++ b/public/locales/en.json
@@ -3689,7 +3689,7 @@
"the_first_3d_agent_platform_with_native": "The first 3D agent platform with native Pump.fun integration. One click from your agent dashboard to a live token on Solana.",
"the_trade_loop": "The trade loop",
"the_vision": "<span class=\"num\">&bull;</span>The vision",
- "these_are_real_models_from_the_forge": "These are real models from the <a href=\"/forge\" style=\"color:var(--text);text-decoration:underline;text-underline-offset:3px\">Forge gallery</a> — generated by users with a text prompt. On a phone, tap the button below to see the current model anchored to a flat surface around you at real-world scale.",
+ "these_are_real_models_from_the_forge": "These are real models from the <a href=\"/forge\" style=\"color:var(--text);text-decoration:underline;text-underline-offset:3px\">Forge gallery</a>, generated by users with a text prompt. On a phone, tap the button below to see the current model anchored to a flat surface around you at real-world scale.",
"three_fembdox7r1psc4gecvjdsbnbza3bfztcydcatj": "<span class=\"foot-ca-label\">$THREE</span> <span class=\"foot-ca-addr\" id=\"foot-ca-addr\">FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump</span>",
"three_steps_one_living_character": "Three steps. <em>One living character.</em>",
"three_ws_agents_are_onchain_native_launch": "three.ws agents are onchain-native. Launch a meme coin, fan token, or governance token directly from your agent's dashboard — no coding, no CLI, no wallet juggling.",
diff --git a/public/locales/es.json b/public/locales/es.json
index dbb33113d..9855063c2 100644
--- a/public/locales/es.json
+++ b/public/locales/es.json
@@ -3775,16 +3775,16 @@
"your_agents_don_t_just_talk_they": "Tus agentes no solo hablan. <em>Comercian.</em>",
"your_ai_deserves_a_body": "Tu IA merece<br>un <em>cuerpo.</em>",
"your_visitors_walk_together": "Tus visitantes caminan<br><em>juntos.</em>",
- "fresh": "Nuevo",
- "trending": "Tendencias",
- "show_more": "Ver más",
- "live": "en vivo",
- "hero_try": "Prueba",
- "forge_it": "Forge it",
- "hero_forge_placeholder": "describe cualquier cosa: una brújula de latón, desgastada…",
- "hero_forge_note": "Gratis, sin registro, un modelo texturizado real en aproximadamente un minuto. <a href=\"/forge\">Abre el Forge completo →</a>",
- "feed_empty_top": "No hay modelos en tendencia esta semana. Vuelve a consultar después de algunos votos, o explora Nuevos.",
- "feed_empty_fresh": "Nada aquí todavía. Sé el primero en forjar uno."
+ "fresh": "Fresh",
+ "trending": "Trending",
+ "show_more": "Show more",
+ "live": "live",
+ "hero_try": "Try",
+ "forge_it": "",
+ "hero_forge_placeholder": "",
+ "hero_forge_note": "",
+ "feed_empty_top": "",
+ "feed_empty_fresh": ""
},
"ibm_hello": {
"01forge": "<span class=\"n\">01</span>Forge",
diff --git a/src/club-perf.js b/src/club-perf.js
index d429873d0..f0d4b36a2 100644
--- a/src/club-perf.js
+++ b/src/club-perf.js
@@ -6,8 +6,13 @@
// The profile gates how expensive the scene is allowed to be — pixel
// ratio, shadows, post-FX, mirror-ball cube cam, volumetric cones, crowd
// instances. Mid-session, the animate loop downgrades one tier on
-// sustained slow frames (never upgrades — a recovery means the user
-// moved off a busy moment, so sticking at lower quality is safer).
+// sustained slow frames and, with strong hysteresis, upgrades one tier
+// back after a much longer sustained-fast window (capped at the tier the
+// device booted into, so we only ever recover lost quality, never exceed
+// the device profile). Recovery matters: without it a single load-time or
+// GC hitch pins the renderer's pixel ratio low for the whole session, so
+// the 3D stays permanently soft on a high-DPI screen while the HTML UI
+// over it renders crisp — the classic "why is it blurry" symptom.
//
// Prompts 01–04 (venue, dancers, postFX, mirror ball) read these flags
// when constructing their parts of the scene. Anything that doesn't
@@ -149,30 +154,64 @@ export function nextLowerTier(tier) {
return PROFILE_TIERS[Math.min(i + 1, PROFILE_TIERS.length - 1)];
}
+/**
+ * Return the next-higher profile tier (low→medium→high). `high` is the
+ * ceiling — calling this on `high` returns `high`. Unknown tiers return
+ * `low` (the safe floor), matching `nextLowerTier`.
+ *
+ * @param {'high'|'medium'|'low'} tier
+ * @returns {'high'|'medium'|'low'}
+ */
+export function nextHigherTier(tier) {
+ const i = PROFILE_TIERS.indexOf(tier);
+ if (i < 0) return 'low';
+ return PROFILE_TIERS[Math.max(i - 1, 0)];
+}
+
/**
* Frame-budget watchdog. Feed it `dt` once per frame; when the EMA of
* frame time stays above the slow-frame threshold for `holdSec`
* consecutive seconds, fire `onDowngrade(nextTier)` and reset the
* sustained counter so we don't fire again until another full slow
- * window passes. We never auto-upgrade.
+ * window passes.
+ *
+ * Recovery (hysteresis): once frames have been comfortably fast
+ * (`frameAvg < fastSec`) for a much longer sustained window
+ * (`recoverSec`, default 6s vs the 2s downgrade window), upgrade one tier
+ * back via `onUpgrade(nextTier)` — but never past `maxTier` (the tier the
+ * device booted into), so a capable machine that hit one load-time hitch
+ * climbs back to full pixel ratio instead of staying soft forever, while
+ * a genuinely weak device that can't sustain fast frames never does. The
+ * long asymmetric window + a neutral dead-band between `fastSec` and
+ * `slowSec` prevent tier flapping.
*
* @param {object} opts
* @param {'high'|'medium'|'low'} opts.initialTier
- * @param {number} [opts.slowSec=1/28] — threshold per frame (sec)
+ * @param {number} [opts.slowSec=1/28] — slow threshold per frame (sec)
+ * @param {number} [opts.fastSec=1/50] — fast threshold for recovery (sec)
* @param {number} [opts.holdSec=2.0] — sustained-slow window (sec)
+ * @param {number} [opts.recoverSec=6.0] — sustained-fast window (sec)
+ * @param {'high'|'medium'|'low'} [opts.maxTier=initialTier] — recovery ceiling
* @param {number} [opts.emaAlpha=0.06] — EMA decay; smaller = smoother
* @param {(tier:'high'|'medium'|'low')=>void} opts.onDowngrade
+ * @param {(tier:'high'|'medium'|'low')=>void} [opts.onUpgrade]
*/
export function createFrameWatchdog({
initialTier,
slowSec = 1 / 28,
+ fastSec = 1 / 50,
holdSec = 2.0,
+ recoverSec = 6.0,
+ maxTier = initialTier,
emaAlpha = 0.06,
onDowngrade,
+ onUpgrade,
}) {
let tier = initialTier;
let frameAvg = 1 / 60;
let slowAccum = 0;
+ let fastAccum = 0;
+ const maxTierIdx = PROFILE_TIERS.indexOf(maxTier);
return {
get tier() { return tier; },
@@ -181,6 +220,8 @@ export function createFrameWatchdog({
frameAvg = frameAvg * (1 - emaAlpha) + dt * emaAlpha;
if (frameAvg > slowSec) {
+ // Slow band: accumulate toward a downgrade, cancel any recovery.
+ fastAccum = 0;
slowAccum += dt;
if (slowAccum >= holdSec && tier !== 'low') {
const next = nextLowerTier(tier);
@@ -191,8 +232,26 @@ export function createFrameWatchdog({
frameAvg = slowSec * 0.9;
try { onDowngrade?.(next); } catch (err) { log.warn('[club-perf] onDowngrade threw', err); }
}
+ } else if (onUpgrade && frameAvg < fastSec) {
+ // Fast band: accumulate toward a recovery, cancel any downgrade.
+ // Recovery is opt-in — a consumer that wired only `onDowngrade`
+ // keeps the original monotone step-down behaviour, tier and all.
+ slowAccum = 0;
+ fastAccum += dt;
+ // Only climb back toward the tier the device booted into.
+ if (fastAccum >= recoverSec && PROFILE_TIERS.indexOf(tier) > maxTierIdx) {
+ const next = nextHigherTier(tier);
+ tier = next;
+ fastAccum = 0;
+ // Nudge the EMA up so the newly heavier tier gets a fair
+ // window before we'd consider climbing again.
+ frameAvg = fastSec * 1.1;
+ try { onUpgrade?.(next); } catch (err) { log.warn('[club-perf] onUpgrade threw', err); }
+ }
} else {
+ // Neutral dead-band: neither fast nor slow — hold steady.
slowAccum = 0;
+ fastAccum = 0;
}
},
getFrameAvg() { return frameAvg; },
diff --git a/src/game/camera-modes.js b/src/game/camera-modes.js
index a693b252b..945ce9a14 100644
--- a/src/game/camera-modes.js
+++ b/src/game/camera-modes.js
@@ -6,9 +6,10 @@
// `computeCameraForMode()` is the pure per-frame pose math (no allocation
// beyond a shared scratch, no side effects) — both `walk.js` and
// `coincommunities.js` can call it directly for a one-shot pose. It is a
-// faithful port of the FOV table / orbit math walk.js carried inline; 'follow'
-// matches the orbit formula `/play` already used so switching to this module
-// doesn't shift the default view.
+// faithful port of the orbit math walk.js carried inline; the 'follow' orbit
+// formula matches what `/play` and `/walk` already used. (The follow FOV was
+// widened from 50° to 58° — see CAMERA_MODE_FOV — so the default view frames
+// more of the world; the orbit geometry itself is unchanged.)
//
// `createCameraModeController()` wraps it with mode cycling, localStorage
// persistence, and a cross-fade transition so a mode swap doesn't pop.
@@ -24,7 +25,12 @@ export const CAMERA_MODE_LABELS = {
topdown: 'Top Down',
};
-export const CAMERA_MODE_FOV = { follow: 50, cinematic: 35, firstperson: 75, topdown: 50 };
+// Follow sits at 58° — wide enough to frame the plaza (totem, jumbotrons, the
+// avatars around you) without the fisheye a 70°+ lens gives a close chase cam.
+// The old 50° read as telephoto: everything felt zoomed in and cropped at the
+// edges. Cinematic stays tight (35°) for its slow hero orbit; first person is a
+// natural 75°; top-down keeps 50° since it looks straight down.
+export const CAMERA_MODE_FOV = { follow: 58, cinematic: 35, firstperson: 75, topdown: 50 };
const CINEMATIC_ORBIT_SPEED = 0.15; // rad/s — the auto-orbit's angular speed
const CINEMATIC_RADIUS_MULT = 1.8; // × avatar height, scaled further by zoom
diff --git a/src/game/coincommunities.js b/src/game/coincommunities.js
index a63d51e14..3377c2054 100644
--- a/src/game/coincommunities.js
+++ b/src/game/coincommunities.js
@@ -34,7 +34,7 @@ import {
} from '../shared/frame-governor.js';
import { createDayNightCycle } from './day-night.js';
import { worldClock } from '../shared/world-clock.js';
-import { createCameraModeController, CAMERA_MODE_LABELS } from './camera-modes.js';
+import { createCameraModeController, CAMERA_MODE_LABELS, CAMERA_MODE_FOV } from './camera-modes.js';
import { createChartScreen } from './chart-screen.js';
import { mountOracleRibbon } from './oracle-ribbon.js';
import { MarketReactor } from './market-reactor.js';
@@ -409,8 +409,10 @@ export class CoinCommunities {
this._powerSaver = getPowerSaver();
// Boot-time quality tier from real capability signals (deviceMemory,
// cores, coarse pointer — same detector /club uses), then a watchdog
- // that steps the tier down on sustained slow frames. Applied to the
- // renderer in _initRenderer / _applyPerfTier.
+ // that steps the tier down on sustained slow frames and climbs it
+ // back (capped at the booted tier) once frames recover, so a single
+ // load-time hitch doesn't pin the pixel ratio low — and the 3D soft —
+ // for the whole session. Applied to the renderer in _applyPerfTier.
this._perfTier = detectProfile();
this._watchdog = createFrameWatchdog({
initialTier: this._perfTier,
@@ -419,6 +421,11 @@ export class CoinCommunities {
this._applyPerfTier();
log.info('[coincommunities] downgrading render tier to', tier);
},
+ onUpgrade: (tier) => {
+ this._perfTier = tier;
+ this._applyPerfTier();
+ log.info('[coincommunities] recovering render tier to', tier);
+ },
});
onPowerSaverChange((on) => { this._powerSaver = on; this._applyPerfTier(); });
@@ -678,6 +685,25 @@ export class CoinCommunities {
this.renderer = r;
this._applyPerfTier();
window.addEventListener('resize', () => this._onResize());
+ this._watchDevicePixelRatio();
+ }
+
+ // devicePixelRatio changes when the window moves to a display with a
+ // different density (retina laptop ↔ external 1x monitor) or the OS/browser
+ // zoom changes. That does NOT reliably fire a 'resize' event, so without
+ // this the canvas keeps rendering at the old ratio — sharp becomes blurry,
+ // or a needlessly high ratio tanks the framerate. A resolution media query
+ // fires once when the current ratio stops matching; we re-sync and re-arm.
+ _watchDevicePixelRatio() {
+ if (typeof window.matchMedia !== 'function') return;
+ const arm = () => {
+ const dpr = window.devicePixelRatio || 1;
+ const mq = window.matchMedia(`(resolution: ${dpr}dppx)`);
+ const onChange = () => { this._onResize(); arm(); };
+ if (mq.addEventListener) mq.addEventListener('change', onChange, { once: true });
+ else if (mq.addListener) { const h = () => { mq.removeListener(h); onChange(); }; mq.addListener(h); }
+ };
+ arm();
}
// Apply the current quality tier (or the power-saver floor) to the renderer.
@@ -707,7 +733,9 @@ export class CoinCommunities {
this.scene = scene;
// Far plane reaches the sky dome; near stays tight for close avatars.
- this.camera = new PerspectiveCamera(50, window.innerWidth / window.innerHeight, 0.1, 9000);
+ // Initial FOV matches the follow mode's (camera-modes.js) so the first
+ // rendered frame doesn't pop before _updateCamera applies the mode.
+ this.camera = new PerspectiveCamera(CAMERA_MODE_FOV.follow, window.innerWidth / window.innerHeight, 0.1, 9000);
// Transparent embed (`?bg=transparent`): the environment skips the sky
// backdrop so the host page shows through; ground, ring, and avatars render.
@@ -3613,9 +3641,17 @@ export class CoinCommunities {
}
_onResize() {
- this.camera.aspect = window.innerWidth / window.innerHeight;
+ const w = window.innerWidth, h = window.innerHeight;
+ // A minimized/hidden tab or an in-flight teardown can report a 0 dimension;
+ // setting a 0 aspect NaNs the projection matrix and blanks the scene.
+ if (!w || !h || !this.camera || !this.renderer) return;
+ this.camera.aspect = w / h;
this.camera.updateProjectionMatrix();
- this.renderer.setSize(window.innerWidth, window.innerHeight);
+ this.renderer.setSize(w, h);
+ // Re-apply the pixel ratio: setSize keeps the renderer's current ratio,
+ // but devicePixelRatio may have changed (display move / zoom). _applyPerfTier
+ // reads the live devicePixelRatio and re-clamps it to the active tier.
+ this._applyPerfTier();
}
}
diff --git a/tests/club-perf.test.js b/tests/club-perf.test.js
index d4dce11e5..8b75f42c5 100644
--- a/tests/club-perf.test.js
+++ b/tests/club-perf.test.js
@@ -10,6 +10,7 @@ import {
detectProfile,
PROFILES,
nextLowerTier,
+ nextHigherTier,
createFrameWatchdog,
} from '../src/club-perf.js';
@@ -154,6 +155,18 @@ describe('nextLowerTier', () => {
});
});
+describe('nextHigherTier', () => {
+ it('walks low → medium → high and ceils at high', () => {
+ expect(nextHigherTier('low')).toBe('medium');
+ expect(nextHigherTier('medium')).toBe('high');
+ expect(nextHigherTier('high')).toBe('high');
+ });
+
+ it('returns low for unknown input (safe fallback)', () => {
+ expect(nextHigherTier('ultra')).toBe('low');
+ });
+});
+
describe('createFrameWatchdog', () => {
it('downgrades after sustained slow frames', () => {
const onDowngrade = vi.fn();
@@ -188,17 +201,61 @@ describe('createFrameWatchdog', () => {
expect(wd.tier).toBe('high');
});
- it('never upgrades on its own', () => {
- const calls = [];
+ it('never climbs above the tier it booted into', () => {
+ const up = [];
const wd = createFrameWatchdog({
initialTier: 'medium',
holdSec: 2.0,
+ recoverSec: 6.0,
emaAlpha: 1.0,
- onDowngrade: (t) => calls.push(t),
+ onDowngrade: () => {},
+ onUpgrade: (t) => up.push(t),
+ });
+ // Run 20 seconds of fast 60fps frames — maxTier defaults to the boot
+ // tier (medium), so it must never climb to high.
+ for (let i = 0; i < 1200; i++) wd.tick(1 / 60);
+ expect(up).toEqual([]);
+ expect(wd.tier).toBe('medium');
+ });
+
+ it('recovers one tier after a sustained-fast window, then caps at the boot tier', () => {
+ const down = [];
+ const up = [];
+ const wd = createFrameWatchdog({
+ initialTier: 'high',
+ holdSec: 2.0,
+ recoverSec: 6.0,
+ emaAlpha: 1.0,
+ onDowngrade: (t) => down.push(t),
+ onUpgrade: (t) => up.push(t),
+ });
+ // A slow burst drops high → medium.
+ for (let i = 0; i < 75; i++) wd.tick(0.040); // ~3s slow
+ expect(down).toEqual(['medium']);
+ expect(wd.tier).toBe('medium');
+ // Sustained fast frames (60fps) climb it back to high — and no further,
+ // since high is the boot ceiling.
+ for (let i = 0; i < 1200; i++) wd.tick(1 / 60); // ~20s fast
+ expect(up).toEqual(['high']);
+ expect(wd.tier).toBe('high');
+ });
+
+ it('does not recover on a brief fast blip inside a slow stretch (hysteresis)', () => {
+ const up = [];
+ const wd = createFrameWatchdog({
+ initialTier: 'high',
+ holdSec: 2.0,
+ recoverSec: 6.0,
+ emaAlpha: 1.0,
+ onDowngrade: () => {},
+ onUpgrade: (t) => up.push(t),
});
- // Run 5 seconds of fast 60fps frames — should remain medium.
- for (let i = 0; i < 300; i++) wd.tick(1 / 60);
- expect(calls).toEqual([]);
+ for (let i = 0; i < 75; i++) wd.tick(0.040); // drop to medium
+ // 3s of fast frames — shorter than the 6s recovery window — must NOT
+ // upgrade. The fast accumulator resets the moment slow frames return.
+ for (let i = 0; i < 180; i++) wd.tick(1 / 60); // ~3s fast
+ for (let i = 0; i < 25; i++) wd.tick(0.040); // ~1s slow (not sustained)
+ expect(up).toEqual([]);
expect(wd.tier).toBe('medium');
});
diff --git a/tests/cosmetics-purchase.test.js b/tests/cosmetics-purchase.test.js
index cfde25ec4..c851efc48 100644
--- a/tests/cosmetics-purchase.test.js
+++ b/tests/cosmetics-purchase.test.js
@@ -118,12 +118,12 @@ describe('cosmetics ownership ledger', () => {
});
// ── purchase endpoint boundary ───────────────────────────────────────────────
-function mockReq(query) {
+function mockReq(query, headers = {}) {
return {
method: 'GET',
url: '/api/x402/cosmetic-purchase?' + new URLSearchParams(query).toString(),
query,
- headers: {},
+ headers,
};
}
@@ -136,15 +136,20 @@ function mockRes() {
return res;
}
-async function call(query) {
+async function call(query, headers = {}) {
const { default: handler } = await import('../api/x402/cosmetic-purchase.js');
- const req = mockReq(query);
+ const req = mockReq(query, headers);
const res = mockRes();
await handler(req, res);
let parsed; try { parsed = JSON.parse(res.body); } catch { parsed = res.body; }
return { status: res.statusCode, parsed };
}
+// A real payer presents an X-PAYMENT envelope; discovery probes never do. The
+// endpoint keeps strict 400/404 validation for the former and serves a spec-valid
+// 402 discovery challenge to the latter (x402scan/Bazaar registration contract).
+const PAID = { 'x-payment': 'probe-authorization-envelope' };
+
describe('cosmetic-purchase endpoint boundary', () => {
// Warm the heavy import chain (x402-paid-endpoint → @coinbase/x402 → Solana
// toolchain) once, outside any single test's 45s budget. A cold import of
@@ -164,18 +169,29 @@ describe('cosmetic-purchase endpoint boundary', () => {
process.env.X402_FEE_PAYER_SOLANA = 'THREEsynthetic1111111111111111111111111PayTo';
});
- it('rejects missing id / account', async () => {
- expect((await call({ account: 'guest-1' })).status).toBe(400);
- expect((await call({ id: 'skin-midnight' })).status).toBe(400);
+ it('rejects missing id / account for a real payer (X-PAYMENT present)', async () => {
+ expect((await call({ account: 'guest-1' }, PAID)).status).toBe(400);
+ expect((await call({ id: 'skin-midnight' }, PAID)).status).toBe(400);
});
- it('404s an unknown cosmetic and 400s a free base item', async () => {
- expect((await call({ id: 'nope', account: 'guest-1' })).status).toBe(404);
- const free = await call({ id: 'hat-baseball', account: 'guest-1' });
+ it('404s an unknown cosmetic and 400s a free base item for a real payer', async () => {
+ expect((await call({ id: 'nope', account: 'guest-1' }, PAID)).status).toBe(404);
+ const free = await call({ id: 'hat-baseball', account: 'guest-1' }, PAID);
expect(free.status).toBe(400);
expect(free.parsed.error).toBe('not_purchasable');
});
+ it('serves a 402 discovery challenge to a credential-less probe (missing/placeholder/unknown params)', async () => {
+ // x402scan hits the bare route or fills required strings with a placeholder;
+ // the endpoint must answer 402, never 400/404, or registration drops it.
+ for (const q of [{}, { account: 'guest-1' }, { id: 'string', account: 'string' }, { id: 'hat-baseball', account: 'guest-1' }]) {
+ const r = await call(q);
+ expect(r.status).toBe(402);
+ expect(Array.isArray(r.parsed.accepts)).toBe(true);
+ expect(r.parsed.accepts.length).toBeGreaterThan(0);
+ }
+ });
+
it('issues a 402 priced in USDC for a premium cosmetic', async () => {
const r = await call({ id: 'skin-midnight', account: 'guest-1' });
expect(r.status).toBe(402);
diff --git a/tests/x402-probe-challenge.test.js b/tests/x402-probe-challenge.test.js
index 277036121..3682b9927 100644
--- a/tests/x402-probe-challenge.test.js
+++ b/tests/x402-probe-challenge.test.js
@@ -102,6 +102,26 @@ describe('credential-less probes always reach the 402 challenge', () => {
await expectChallenge(res);
}, 15000);
+ it('bare probe on cosmetic-purchase serves the challenge (was 400/404)', async () => {
+ const res = await fetch(`${BASE}/api/x402/cosmetic-purchase`);
+ await expectChallenge(res);
+ }, 15000);
+
+ it('placeholder-param probe on cosmetic-purchase serves the challenge, not 404 (x402scan fills required strings with a placeholder)', async () => {
+ const res = await fetch(`${BASE}/api/x402/cosmetic-purchase?id=string&account=string`);
+ await expectChallenge(res);
+ }, 15000);
+
+ it('bare probe on animation-download serves the challenge (was 400)', async () => {
+ const res = await fetch(`${BASE}/api/x402/animation-download`);
+ await expectChallenge(res);
+ }, 15000);
+
+ it('non-uuid placeholder probe on animation-download serves the challenge, not 400', async () => {
+ const res = await fetch(`${BASE}/api/x402/animation-download?id=string`);
+ await expectChallenge(res);
+ }, 15000);
+
it('empty-object POST body on fact-check serves the challenge (was 400)', async () => {
const res = await fetch(`${BASE}/api/x402/fact-check`, {
method: 'POST',