Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(art): load coin logos and gallery models through our own proxies, not a rate-limited gateway
nirholas795becc00333
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 1b13d1dd6..20288f8eb 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -38,6 +38,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Avatar posters and clips survive a CDN outage instead of coming back blank**: Some of the images we render of an avatar on the server are drawn by a headless browser that loads three.js from a public CDN: the images the render endpoint and the MCP render tools return, rendered clips, and the preview cards for models our fast in-process renderer cannot decode on its own. When that one CDN was slow or unreachable, the page's module load simply hung, the render timed out, and the image came back empty with nothing to explain why. A failover had been written for exactly this and was never connected to the renderers. It is connected now: before each render we check that the CDN is answering and switch to a second one if it is not, remembering the answer for ten minutes so a burst of renders pays for a single check. The three renderers also share one pinned version of three.js instead of keeping three copies that could drift apart, and a test now fails the build if a renderer ever goes back to hardcoding a single CDN. `[fix, infra]`- **Avatar Studio can now dress, rig and walk your avatar, not just paint it**: Avatar Studio picked up everything the older avatar editor could do and it could not. A Wardrobe tab puts real catalog garments on your avatar, bound to its own skeleton so they move with every animation, on top of the show/hide and recolour controls for the clothes the body already came with. A Walk tab lets you drive the avatar around the stage with WASD, which is where a garment that does not follow the hips actually becomes visible, and hands the unsaved look straight to the full Walk page. Editing a saved avatar also gets a Rig tab that turns a static mesh into an animation-ready one, and a Play as this button that saves and drops you into a world wearing it. Saving a dressed avatar keeps the clothes: the outfit is stored as data and rebuilt on the pristine base, so nothing gets baked on twice and the base model you started from is always recoverable. (`/avatar-studio`) `[feature, improvement]`- **Chain logos on the fees tables render instead of breaking**: Every chain row on the fees and revenue tables showed a broken image. The upstream data source hands out chain logo links that are missing a piece of their address, so each one failed to load. We repair the address before the data reaches the page, and any icon that still fails for its own reasons now quietly becomes the same neutral disc a protocol without a logo already gets, rather than a broken-image mark. The same repair covers the DEX volume, protocol and chain pages that draw from the same feed. (`/fees`) `[fix]`+- **Coin art and 3D models load again, wherever the page is running**: Token logos on the launches feed and every coin card were painted straight from a public IPFS gateway that now rate-limits us, so a feed of launches rendered a wall of blank tiles and filled the console with blocked requests. Art now comes through the site's own image service, which retries across gateways, resizes to the size actually shown, and falls back to a generated placeholder instead of an error. Creation gallery models load the same way, through the site's model proxy, so a 3D preview also works inside an embed on somebody else's site. (`/launches`) `[fix, improvement]`- **Coin Radar tells you when it is your filter, not the market, that is empty**: Search the radar for a ticker it has not seen and the board used to say "Radar is clear, waiting for the next launch", which blamed a quiet market for a filter you set and gave you no way back. Most of Radar's filters run on the server, so an over-tight one came back looking exactly like a quiet window. Now the board reads your filters instead of the response: it says no coins match, lists every filter you have on as a chip you can click to drop just that one, and keeps a reset-everything button next to it. The 24-hour pulse strip across the top also got an honest state of its own. It is a separate request from the live feed, and when it failed it used to shimmer as if still loading forever; now it says the aggregate did not load, offers a retry, and leaves the feed below running. On a 320px phone every card was losing about 19 pixels off its right edge to a layout overflow that the mobile scroll guard was quietly clipping; cards now fit the screen they are on. (`/radar`) `[fix, improvement]`- **Connect a home that only exists on your own network**: Most Home Assistant installs sit on a home network with nothing exposed to the internet, so until now three.ws had no way to reach them. Now the house connects to us instead. Install one integration through HACS, paste a ten-minute pairing code, and your agent can see your rooms and run your scenes with nothing listening on your network, no port forwarded, and no firewall rule changed. The part worth saying plainly: three.ws never receives a Home Assistant token for a home connected this way. The integration signs in to Home Assistant on your own machine with a credential it makes for itself and never sends anywhere, so there is nothing stored here that would open your house. What we can do through that connection is a fixed list, enforced twice, once by us and once by the integration on your machine: reads, your room layout, and device controls. It can never run code on the machine Home Assistant lives on, restart or reconfigure your instance, or reach anything else on your network. Unlocking, opening and disarming still stop and ask a person first, every time, exactly as they do for a home connected by address. Disconnecting works from either end and takes effect immediately. There is an honest threat model in the docs, including what a compromise of three.ws would mean for a connected house; read it before you decide. (`/docs/home-relay`) `[feature, security]`- **Connect your house to your agent, and see every way it can go wrong**: The /smart-home page now takes you from "I have a Home Assistant somewhere" to a connected house, and it is honest at every step. An address that only exists on your home network is refused the moment you type it, with the two real ways round it, instead of spinning for fifteen seconds. A rejected token says so and puts the cursor back in the token box. A house that stops answering keeps its rooms on screen, marked stale with how long ago it last replied, rather than blanking out. Your access token is sent once, encrypted at rest, and never comes back to the page: it is not in your browser storage, not in a URL, and not in any response. Disconnecting says plainly that the stored token is erased and reminds you to delete it in Home Assistant too. (`/smart-home`) `[feature]`diff --git a/data/changelog.json b/data/changelog.jsonindex 947fbc451..ff83b8738 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -26363,6 +26363,16 @@"fix","improvement"]+ },+ {+ "date": "2026-09-03",+ "title": "Coin art and 3D models load again, wherever the page is running",+ "summary": "Token logos on the launches feed and every coin card were painted straight from a public IPFS gateway that now rate-limits us, so a feed of launches rendered a wall of blank tiles and filled the console with blocked requests. Art now comes through the site's own image service, which retries across gateways, resizes to the size actually shown, and falls back to a generated placeholder instead of an error. Creation gallery models load the same way, through the site's model proxy, so a 3D preview also works inside an embed on somebody else's site.",+ "link": "/launches",+ "tags": [+ "fix",+ "improvement"+ ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex 61f42d411..a1adc932f 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-04T00:54:16.165Z",+ "generated_at": "2026-09-04T01:30:59.955Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -302,6 +302,17 @@"fix"]},+ {+ "date": "2026-09-03",+ "type": "update",+ "title": "Coin art and 3D models load again, wherever the page is running",+ "summary": "Token logos on the launches feed and every coin card were painted straight from a public IPFS gateway that now rate-limits us, so a feed of launches rendered a wall of blank tiles and filled the console with blocked requests. Art now comes through the site's own image service, which retries across gateways, resizes to the size actually shown, and falls back to a generated placeholder instead of an error. Creation gallery models load the same way, through the site's model proxy, so a 3D preview also works inside an embed on somebody else's site.",+ "link": "/launches",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-09-03","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 30dcbc076..cedec157a 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -238,6 +238,14 @@<category>fix</category><description>Every chain row on the fees and revenue tables showed a broken image. The upstream data source hands out chain logo links that are missing a piece of their address, so each one failed to load. We repair the address before the data reaches the page, and any icon that still fails for its own reasons now quietly becomes the same neutral disc a protocol without a logo already gets, rather than a broken-image mark. The same repair covers the DEX volume, protocol and chain pages that draw from the same feed.</description></item>+ <item>+ <title>Coin art and 3D models load again, wherever the page is running</title>+ <link>https://three.ws/launches</link>+ <guid isPermaLink="false">2026-09-03:Coin art and 3D models load again, wherever the page is running</guid>+ <pubDate>Thu, 03 Sep 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Token logos on the launches feed and every coin card were painted straight from a public IPFS gateway that now rate-limits us, so a feed of launches rendered a wall of blank tiles and filled the console with blocked requests. Art now comes through the site's own image service, which retries across gateways, resizes to the size actually shown, and falls back to a generated placeholder instead of an error. Creation gallery models load the same way, through the site's model proxy, so a 3D preview also works inside an embed on somebody else's site.</description>+ </item><item><title>Coin Radar tells you when it is your filter, not the market, that is empty</title><link>https://three.ws/radar</link>diff --git a/public/features.json b/public/features.jsonindex 13aeab557..4c2337a2c 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-04T00:54:16.149Z",+ "generated_at": "2026-09-04T01:30:59.943Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/scripts/audit-console.mjs b/scripts/audit-console.mjsindex d84cc9768..0a72944a7 100644--- a/scripts/audit-console.mjs+++ b/scripts/audit-console.mjs@@ -28,6 +28,21 @@* mid-sweep and every remaining route then reads as a navigation failure. The* dev server proxies /api/* to https://three.ws, so API calls hit real* endpoints — auth/payment-gated 4xx are classified "expected", never failures.+ *+ * Which API the pages talk to decides what a finding MEANS, so pick it on+ * purpose:+ *+ * • Default (proxy to https://three.ws) measures what users actually get. It+ * is the right run for judging the live site, and the one whose numbers+ * belong in a report.+ * • DEV_API_PROXY=http://localhost:8080, with `node server/index.mjs` running+ * there, measures THIS working tree. Use it to tell a page defect apart+ * from deploy lag: on 2026-09-03 a sweep against production blamed pages+ * for a 404 on /api/home and a 500 on /api/oracle/model, and both handlers+ * were already fixed on main and merely unshipped. Note the reverse trap+ * too: endpoints whose credentials live only on the Cloud Run service+ * answer 503 `not_configured` against a local server, which is environment,+ * not a defect.*/import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs';diff --git a/src/creations.js b/src/creations.jsindex 2e0cb8eba..273b150f2 100644--- a/src/creations.js+++ b/src/creations.js@@ -16,6 +16,7 @@*/import { createLogger } from './shared/log.js';+import { proxiedModelURL } from './ipfs.js';import { enterStagger, liveDot, setLiveDot } from './ui-juice.js';import { ensureX402 } from './shared/x402-loader.js';@@ -77,12 +78,17 @@ function truncate(s, n) {// leaderboard row reach the link that wraps it. The `disable-*` attributes went// with it; they only ever qualified camera-controls.function thumbHTML(glbUrl, alt, posterUrl) {- if (!glbUrl) return `<div class="cr-card-noglb" aria-hidden="true">3D</div>`;+ // The asset bucket allowlists the production origin by name, so a GLB read+ // straight from it dies inside model-viewer on every other origin (partner+ // embeds, notebooks, previews, local audits) with an unrecoverable "Failed+ // to fetch". /api/glb serves the same public object with open CORS.+ const src = proxiedModelURL(glbUrl);+ if (!src) return `<div class="cr-card-noglb" aria-hidden="true">3D</div>`;// The feed ships a rendered still alongside every GLB, so paint that first// and let the interactive mesh swap in once it has streamed.const poster = posterUrl ? ` poster="${esc(posterUrl)}"` : '';return `<model-viewer- src="${esc(glbUrl)}"+ src="${esc(src)}"alt="${esc(alt)}"${poster}class="cr-card-mv"reveal="auto"diff --git a/src/ipfs.js b/src/ipfs.jsindex 9fbb2aedc..004c1b6a8 100644--- a/src/ipfs.js+++ b/src/ipfs.js@@ -175,6 +175,39 @@ export function proxiedImageURL(url, seed = '', { width = 0 } = {}) {return `/api/img?${q.toString()}`;}+/**+ * Route an external model URL through the same-origin /api/glb proxy.+ *+ * Generated models live on the public asset bucket, whose CORS policy is an+ * origin allowlist naming the production site. Every other origin that loads a+ * GLB in a browser (a partner embed, a notebook on localhost, a Codespaces+ * preview, a local audit run) gets no `access-control-allow-origin` header back+ * and the fetch dies inside model-viewer as "Failed to fetch", with nothing on+ * the page able to recover it. `/api/glb` reads the same public object+ * server-side through the SSRF-hardened fetcher and answers with open CORS and+ * an immutable cache header, so the model loads from anywhere and repeat views+ * cost one upstream read.+ *+ * Same-origin, relative, data: and blob: URLs are handed back untouched: the+ * proxy only earns its keep cross-origin. ipfs:// and ar:// resolve to a gateway+ * URL first, so a model pinned on decentralised storage proxies like any other.+ * Anything that is not a safe URL for an asset sink resolves to '' so callers+ * fall through to their own "no model" branch.+ *+ * @param {string} url Model URL (https://, ipfs:// or ar:// accepted).+ * @returns {string}+ */+export function proxiedModelURL(url) {+ if (typeof url !== 'string' || !url) return '';+ const raw = /^\/\/[^/]/.test(url.trim()) ? 'https:' + url.trim() : url.trim();+ if (!isSafeImageURL(raw)) return '';+ if (!/^(https?|ipfs|ar):/i.test(raw)) return raw;+ if (raw.length > MAX_SOURCE_URL) return '';+ const resolved = resolveURI(raw);+ if (typeof location !== 'undefined' && resolved.startsWith(location.origin + '/')) return resolved;+ return `/api/glb?src=${encodeURIComponent(resolved)}`;+}+// Pull the CID (plus any path) back out of a URL that already names a gateway,// so content whose gateway was baked in upstream can still be rotated. Matches// the /ipfs/<cid>[/path] form every gateway in the list serves.diff --git a/src/launches.js b/src/launches.jsindex 84f7bf871..4384cc6f3 100644--- a/src/launches.js+++ b/src/launches.js@@ -21,6 +21,7 @@import { mountCoinStatus, formatMcap } from './pump/coin-status-card.js';import { walletChipEl } from './shared/agent-wallet-chip.js';import { createLogger } from './shared/log.js';+import { proxiedImageURL } from './ipfs.js';import { countUp, updateValue, enterStagger, rippleOnce, liveDot, setLiveDot } from './ui-juice.js';const log = createLogger('launches');@@ -476,8 +477,13 @@ function agentChip(agent) {el('span', { class: 'lx-agent-name', text: 'Unknown agent' }),]);}- const avatar = agent.avatar_thumbnail_url- ? el('img', { src: agent.avatar_thumbnail_url, alt: '', loading: 'lazy' })+ // 22 px circle, so ask the proxy for the 64 px rung: agent thumbnails are+ // stored at render resolution and a raw one is a ~130 KB PNG per row. The+ // proxy is also what keeps a retired or rate-limited art host from painting+ // a broken tile, since it answers a placeholder rather than an error.+ const avatarSrc = proxiedImageURL(agent.avatar_thumbnail_url || '', agent.id || '', { width: 64 });+ const avatar = avatarSrc+ ? el('img', { src: avatarSrc, alt: '', loading: 'lazy' }): el('span', { class: 'lx-agent-fallback', text: (agent.name || '?')[0].toUpperCase() });return el('a',@@ -967,8 +973,9 @@ async function renderAgentFilterChip(agentId) {const agent = body.agent || body;if (state.agentId !== agentId || !agent?.name) return;chip.textContent = '';- if (agent.avatar_thumbnail_url) {- chip.appendChild(el('img', { src: agent.avatar_thumbnail_url, alt: '' }));+ const chipArt = proxiedImageURL(agent.avatar_thumbnail_url || '', agentId, { width: 64 });+ if (chipArt) {+ chip.appendChild(el('img', { src: chipArt, alt: '' }));}chip.appendChild(el('span', { text: agent.name }));} catch {diff --git a/src/model-diff.js b/src/model-diff.jsindex dc3bd6106..da5d97ee5 100644--- a/src/model-diff.js+++ b/src/model-diff.js@@ -18,6 +18,7 @@// import starts only once a model is actually in hand.import { describeModel, diffDescriptions, formatBytes, formatMarkdown, SEVERITY_MEANING } from '@three-ws/glb-diff';+import { proxiedModelURL } from './ipfs.js';const $ = (id) => document.getElementById(id);@@ -117,15 +118,11 @@ function fieldText(change) {// Same-origin models are fetched directly. Anything else goes through the// site's own GLB proxy, which exists precisely because a third-party CDN's CORS-// policy would otherwise make the model unreadable from a browser.+// policy would otherwise make the model unreadable from a browser. The rule+// itself lives in src/ipfs.js beside the image-proxy rule, so a surface that+// paints a model and a surface that paints token art cannot drift apart.function proxied(url) {- try {- const resolved = new URL(url, location.href);- if (resolved.origin === location.origin) return resolved.href;- return `/api/glb?src=${encodeURIComponent(resolved.href)}`;- } catch {- return null;- }+ return proxiedModelURL(url) || null;}function setSlotState(role, slotState) {diff --git a/src/pump/coin-status-card.js b/src/pump/coin-status-card.jsindex 560c2955d..abae896de 100644--- a/src/pump/coin-status-card.js+++ b/src/pump/coin-status-card.js@@ -35,6 +35,7 @@*/import { computeView, getSolUsd } from '../widgets/bonding-curve.js';+import { proxiedImageURL } from '../ipfs.js';const COIN_ENDPOINT = '/api/pump/coin';const CURVE_ENDPOINT = '/api/pump/curve';@@ -411,18 +412,34 @@ function renderCard(coin, opts) {return el('div', { class: 'csc csc-card' }, [head, stats, coin.graduationPct != null ? bar : null, badge, foot]);}+// Every coin logo this widget renders comes from a launch's own metadata: a+// public IPFS gateway, an Arweave tx, or whatever CDN the creator used. Painted+// straight into an <img> those fail in the browser for reasons no page code can+// fix: ipfs.io now answers our art requests 429 behind a sunset notice, and the+// error page it returns is opaque to a no-cors image load, so the browser logs+// ERR_BLOCKED_BY_RESPONSE.NotSameOrigin once per card (89 on a single /launches+// paint). /api/img fetches the same art server-side with multi-gateway IPFS+// retry and answers a deterministic placeholder rather than an error when every+// gateway is down, so the loader always receives a valid image.+//+// The width is the largest this avatar is ever painted (72 px in the featured+// launch cell) at 2x, which the proxy snaps up to its 192 px rung: coin art is+// stored at upload size, and a 40 px tile was pulling 130 KB PNGs.+const COIN_ART_WIDTH = 192;+/*** Avatar for the card variant. A real pump.fun logo fades in over an optional- * caller-supplied placeholder node (e.g. a deterministic identicon) — the same+ * caller-supplied placeholder node (e.g. a deterministic identicon), the same* crossfade the launches feed used before unification. Renders nothing when* there is neither an image nor a placeholder.*/function coinAvatar(coin, placeholder) {- if (!coin.image && !placeholder) return null;+ const art = proxiedImageURL(coin.image, coin.mint || '', { width: COIN_ART_WIDTH });+ if (!art && !placeholder) return null;const box = el('div', { class: 'csc-avatar' });if (placeholder) box.appendChild(placeholder);- if (coin.image) {- const img = el('img', { class: 'csc-card-img', src: coin.image, alt: '', loading: 'lazy' });+ if (art) {+ const img = el('img', { class: 'csc-card-img', src: art, alt: '', loading: 'lazy' });img.addEventListener('load', () => img.classList.add('csc-img-in'), { once: true });// No placeholder behind it → show immediately rather than fading from blank.if (!placeholder) img.classList.add('csc-img-in');diff --git a/tests/ipfs-image-url-safety.test.js b/tests/ipfs-image-url-safety.test.jsindex 665c8547f..3fd40eafa 100644--- a/tests/ipfs-image-url-safety.test.js+++ b/tests/ipfs-image-url-safety.test.js@@ -17,7 +17,7 @@// Server-side fetching of the resolved URL is covered by api-img-proxy.test.js.import { describe, it, expect } from 'vitest';-import { isSafeImageURL, proxiedImageURL, resolveURI } from '../src/ipfs.js';+import { isSafeImageURL, proxiedImageURL, proxiedModelURL, resolveURI } from '../src/ipfs.js';const MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';@@ -174,3 +174,53 @@ describe('proxiedImageURL', () => {}});});++describe('proxiedModelURL', () => {+ // Models have the same trust boundary as art and one extra failure mode: the+ // asset bucket's CORS policy allowlists the production origin by name, so a+ // GLB read straight from it dies inside model-viewer on every other origin+ // (partner embeds, notebooks, previews, a local audit run) as an+ // unrecoverable "Failed to fetch". /api/glb reads the same public object+ // server-side and answers with open CORS.+ const GLB = 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/model.glb';++ it('routes a cross-origin model through the same-origin GLB proxy', () => {+ const out = proxiedModelURL(GLB);+ expect(out.startsWith('/api/glb?')).toBe(true);+ expect(new URLSearchParams(out.split('?')[1]).get('src')).toBe(GLB);+ });++ it('resolves ipfs:// and ar:// to a gateway before proxying', () => {+ const src = (u) => new URLSearchParams(proxiedModelURL(u).split('?')[1]).get('src');+ expect(src('ipfs://bafyexample')).toBe(resolveURI('ipfs://bafyexample'));+ expect(src('ar://sometransactionid')).toBe('https://arweave.net/sometransactionid');+ });++ it('leaves sources the browser can already load alone', () => {+ expect(proxiedModelURL('/forge/local.glb')).toBe('/forge/local.glb');+ expect(proxiedModelURL('models/scene.glb')).toBe('models/scene.glb');+ expect(proxiedModelURL('blob:https://three.ws/6d9a')).toBe('blob:https://three.ws/6d9a');+ });++ it('drops a hostile scheme instead of handing it to a model sink', () => {+ for (const url of [+ 'javascript:window.x=1',+ 'vbscript:msgbox(1)',+ 'data:text/html,<script>window.x=1</script>',+ 'file:///etc/passwd',+ '',+ ]) {+ expect(proxiedModelURL(url), url).toBe('');+ }+ expect(proxiedModelURL(null)).toBe('');+ });++ it('refuses a source too long to be a real model URL', () => {+ expect(proxiedModelURL('https://cdn.example/' + 'a'.repeat(3000) + '.glb')).toBe('');+ });++ it('gives a protocol-relative model the scheme the page is on', () => {+ const out = proxiedModelURL('//cdn.example/model.glb');+ expect(new URLSearchParams(out.split('?')[1]).get('src')).toBe('https://cdn.example/model.glb');+ });+});