Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(providers): BYOK provider registry, forge/studio/feed-stream updates, MCP metadata sync
nirholas3d48a4d82756
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c1263678b..d5a90f11e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,7 +9,10 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Describe it to 3D joins the rest of the site — and the two generators now point at each other** — The avatar generator at /create/prompt was a cul-de-sac: no site navigation, no footer, no way onward except a back button. It now carries the full three.ws header and footer like every other page, and finishing an avatar pops the same 'what now?' card the Forge shows — open it in Studio, make it an agent, walk it, or embed it, with your new avatar carried along. The two text-to-3D tools also cross-link: Forge points character-makers to Describe it to 3D (rigged avatars), and Describe it to 3D points prop-makers to Forge (textured objects), so you always land in the right tool. (`/create/prompt`) `[improvement]`- **Embed any Forge model on your own site with one line** — Every model you forge now has an Embed button next to Download. It hands you a ready-to-paste snippet — an iframe by default, or a <model-viewer> web component for builders — that drops a live, orbitable, AR-ready 3D model onto any website, with a live preview and size presets (16:9, square, 4:5) right in the panel. The iframe points at a new lightweight three.ws viewer (/forge/embed) that needs no scripts on the host page, and clicking its corner badge brings visitors back to Forge with your prompt pre-loaded to remix. Same idea as the <agent-3d> embed, now for any generated object. (`/forge`) `[feature]`- **Embed straight from the homepage demo — no trip to the full Forge** — The text-to-3D demo on the homepage now has an Embed button right in its result toolbar, so a model you forge there can go on your own site without opening the full Forge first. It pops a panel with a live preview, an iframe or <model-viewer> snippet, and the same 16:9 / square / 4:5 size presets, ready to copy in one tap. It's the same one-line embed the full Forge gives you, now one step shorter from the front page. (`/`) `[feature]`+- **Forge adds four more 3D engines — bring your own Rodin, Stability, Tripo, or Replicate key** — Forge now speaks to more best-in-class 3D generators, so you can pick the engine that fits the job. Rodin (Hyper3D) joins for native text-to-geometry and image-to-3D with clean quad topology and a real polygon target; Stable Fast 3D turns a single photo into a textured model in seconds; and you can now run reconstructions on your own Replicate account. Tripo, which was already supported, finally has a key field in your account settings alongside Meshy. All of these are bring-your-own-key — add a key under Account, then Provider Keys, and the engine lights up. The free, no-setup lanes for prompts and sketches are unchanged, and if you choose the geometry path without a key, Forge now quietly falls back to the free engine instead of asking for one. (`/forge`) `[feature]`+- **pump.fun MCP server now listed in the official MCP registry** — Our free, read-only pump.fun and Solana tools are now discoverable in the official Model Context Protocol registry, so any MCP-compatible client (Claude, Cursor, and others) can find and connect to them by name. It's a remote server — no install, no API key for the free tools — covering token discovery, bonding-curve and holder analysis, creator intelligence, and Solana Name Service lookups. This brings the number of three.ws servers in the registry to six. (`/`) `[feature, sdk]`- **Refine any Forge model to higher quality in one click — plus sharper multi-view guidance** — Three upgrades to the Forge (/forge). After a model generates, a new Refine button re-runs that exact prompt or photos one quality tier higher — Draft to Standard to High — so you can preview cheaply, then commit to the best version without retyping anything. When building from photos, a live counter now shows how many of the four reference views you've added and reminds you that more angles make a sharper mesh. And the action bar under each finished model now reflows cleanly on phones, with Refine and Make-another leading at full width. Sketch mode also makes its required description unmistakable. (`/forge`) `[improvement]`+- **Reliability pass: steadier live feed, token art that never blanks, and fewer Forge timeouts** — We traced a batch of production errors to their roots and fixed them. The live activity ticker no longer hammers our rate store on every open tab — one shared reader now fans updates out to everyone on a server and quiets down while the feed is idle, which is what was silently exhausting our request quota and freezing the feed. Remote token artwork that stalls now always falls back to a placeholder instead of timing out and showing nothing. Text-to-3D generations that take a little longer to start no longer get cut off early. And a stray click-handling error on the homepage, search, and glossary is gone. `[fix, infra]`- **See any Forge model in AR — scan from your desktop, place it in your room** — Every finished model now has a View in AR button. On a phone it drops the model into your space through the camera; on a desktop it shows a QR code you scan with your phone to open the same model, one tap from AR — so you can walk around what you just made at real-world scale. The embed viewer gained a big one-tap AR launcher on phones too, so models embedded on other sites are placeable in AR as well. No app, no download — it runs in the browser. (`/forge`) `[feature]`- **The full page directory is now one click away — and instantly filterable** — three.ws has grown past 200 pages, so the sitemap directory got a real upgrade. A new "All pages" link in the Discover menu takes you straight to it, and the page itself now has an instant filter — press / and type to narrow every page by name, path, or description, with live per-section counts. Filtered views are shareable links, so you can send someone exactly the slice of the platform you mean. The directory now finds you when you're lost, too: it's a quick action in the ⌘K search palette, a no-results search hands you off to it with your query carried over, the 404 page offers it pre-filtered to the closest matches for the address you tried, and /pages, /directory, /everything, and /all-pages all take you there. Eighteen pages that had never been registered in the index — What is three.ws?, the 3D Scanner, the Glossary, Support, the agent-economy demos, and all six IBM watsonx showcases under a new Integrations section — are now in the directory, the search palette, and the crawler sitemap. (`/sitemap`) `[improvement]`- **Tutorials read better: one-tap copy on every code block, live progress, and a jump-to-the-tool button** — The tutorial reader (/tutorials) got a polish pass that applies to every guide. Code blocks now have a one-click Copy button, so you can lift a snippet without selecting it by hand. A slim progress rail across the top tracks how far you've read, and a back-to-top button appears once you scroll in. Each section heading has a hover link for sharing a deep link to that exact spot, and every tutorial now opens with a clear call-to-action button — the new text-to-3D guides drop you straight into the Forge. New this release: four beginner guides for turning a text prompt or photos into a downloadable 3D model, a copy-paste prompt cookbook, and an API walkthrough. (`/tutorials`) `[docs, improvement]`diff --git a/api/_mcp3d/tools/studio.js b/api/_mcp3d/tools/studio.jsindex cbf30966e..9bdcbd5c7 100644--- a/api/_mcp3d/tools/studio.js+++ b/api/_mcp3d/tools/studio.js@@ -20,8 +20,7 @@ import { limits } from '../../_lib/rate-limit.js';import { assertSafePublicUrl } from '../../_lib/ssrf-guard.js';import { createRegenProvider as createReplicateProvider } from '../../_providers/replicate.js';import { createRegenProvider as createGcpProvider } from '../../_providers/gcp.js';-import { createMeshyProvider } from '../../_providers/meshy.js';-import { createTripoProvider } from '../../_providers/tripo.js';+import { BYOK_PROVIDER_FACTORIES, isByokGeometryBackend } from '../../_providers/byok-registry.js';import { textToImage } from '../text-to-image.js';import {PATHS,@@ -203,13 +202,16 @@ const PATH_PROP = {enum: PATHS,default: DEFAULT_PATH,description:- 'Generation path: "image" (FLUX→TRELLIS reference-image reconstruction, the platform-keyed default) or "geometry" (native text/image→mesh via Meshy/Tripo — cleaner topology, but BYOK: needs your own provider key).',+ 'Generation path: "image" (FLUX→TRELLIS reference-image reconstruction, the platform-keyed default) or "geometry" (native text/image→mesh via Meshy/Tripo/Rodin — cleaner topology, but BYOK: needs your own provider key).',};const BACKEND_PROP = {type: 'string',- enum: Object.keys(BACKENDS),+ // replicate_byok runs on the platform reconstruction path with the caller's+ // own Replicate account; that BYOK-token routing only exists on /api/forge, so+ // it isn't offered over MCP. Every other backend is selectable here.+ enum: Object.keys(BACKENDS).filter((id) => id !== 'replicate_byok'),description:- 'Force a specific backend (trellis, meshy, tripo, hunyuan3d). Defaults to the best one for the chosen path. Backends outside the path are ignored.',+ 'Force a specific backend (trellis, meshy, tripo, rodin, stability, hunyuan3d). Defaults to the best one for the chosen path. Backends outside the path are ignored.',};// "needs a BYOK key" — a designed, branchable result (mirrors /api/forge's@@ -222,7 +224,7 @@ function needsKeyResult(backendId) {{type: 'text',text:- `The geometry path uses ${meta?.label || backendId}, which needs your own API key. ` ++ `${meta?.label || backendId} needs your own API key. ` +`Send it as the "x-forge-provider-key" request header (or store a ${meta?.byok || backendId} key on your three.ws account) and retry, ` +'or use the default image path (omit "path", or set path="image").',},@@ -249,20 +251,59 @@ async function submitGeometryJob({tier,path,}) {- const providerName = BACKENDS[backendId].byok; // 'meshy' | 'tripo'+ const providerName = BACKENDS[backendId].byok; // 'meshy' | 'tripo' | 'rodin' | 'stability'const key = await resolveProviderKey(req, args, providerName);if (!key) return needsKeyResult(backendId);let gp;try {- gp = backendId === 'tripo' ? createTripoProvider(key) : createMeshyProvider(key);+ gp = BYOK_PROVIDER_FACTORIES[providerName](key);} catch {return needsKeyResult(backendId);}- const submitted = isImageMode- ? await gp.imageTo3d({ imageUrl: primaryImage, prompt: prompt || undefined, tier })- : await gp.textToGeometry({ prompt, tier });+ let submitted;+ if (isImageMode) {+ submitted = await gp.imageTo3d({ imageUrl: primaryImage, prompt: prompt || undefined, tier });+ } else if (typeof gp.textToGeometry === 'function') {+ submitted = await gp.textToGeometry({ prompt, tier });+ } else {+ // Image-only backend (e.g. Stable Fast 3D) asked to run text→3D.+ return {+ content: [+ {+ type: 'text',+ text: `${BACKENDS[backendId].label} reconstructs from a reference image — use image_to_3d with this backend, or drop it to run text→3D.`,+ },+ ],+ structuredContent: { status: 'failed', error: 'backend_image_only', backend: backendId },+ isError: true,+ };+ }++ // Synchronous completion (Stable Fast 3D): the GLB is already persisted to R2,+ // so there is no job to poll — return it done.+ if (!submitted.taskId && submitted.resultGlbUrl) {+ return {+ content: [+ {+ type: 'text',+ text: `Generated a 3D model on ${BACKENDS[backendId].label} (${path} path, ${tier.id} tier).\nGLB: ${submitted.resultGlbUrl}`,+ },+ ],+ structuredContent: {+ status: 'done',+ glb_url: submitted.resultGlbUrl,+ mode: isImageMode ? 'image_to_3d' : 'text_to_3d',+ path,+ tier: tier.id,+ backend: backendId,+ prompt: prompt || null,+ source_image_url: isImageMode ? primaryImage : null,+ },+ };+ }+const token = encodeJobToken({provider: providerName,kind: submitted.kind,@@ -299,7 +340,7 @@ async function submitGeometryJob({async function pollAnyProvider(req, jobId) {const token = decodeJobToken(jobId);if (token) {- if (token.provider === 'meshy' || token.provider === 'tripo') {+ if (BYOK_PROVIDER_FACTORIES[token.provider]) {const key = await resolveProviderKey(req, null, token.provider);if (!key) {return {@@ -307,8 +348,7 @@ async function pollAnyProvider(req, jobId) {error: 'Your provider API key is required to check this job. Send it as the x-forge-provider-key header and retry.',};}- const gp =- token.provider === 'tripo' ? createTripoProvider(key) : createMeshyProvider(key);+ const gp = BYOK_PROVIDER_FACTORIES[token.provider](key);return gp.status({ kind: token.kind, taskId: token.taskId });}if (token.provider === 'gcp') {@@ -438,8 +478,10 @@ export const toolDefs = [const tier = resolveTier(parseTierArg(args));const backendId = resolveBackendId({ path, backend: args.backend });- // Geometry-first path (Meshy/Tripo, BYOK) — native text→mesh.- if (path === 'geometry') {+ // BYOK geometry-style backends (Meshy/Tripo/Rodin) — native text→mesh.+ // Routed by registry membership, not just path, so an explicitly chosen+ // BYOK backend is honoured even if its default path is "image".+ if (isByokGeometryBackend(BACKENDS[backendId])) {return submitGeometryJob({req,args,@@ -574,9 +616,10 @@ export const toolDefs = [const tier = resolveTier(parseTierArg(args));const backendId = resolveBackendId({ path, backend: args.backend });- // Geometry-first path (Meshy/Tripo, BYOK) reconstructs from the primary- // view; multi-view fusion stays on the image/TRELLIS path below.- if (path === 'geometry') {+ // BYOK geometry-style backends (Meshy/Tripo/Rodin/Stability) reconstruct+ // from the primary view; multi-view fusion stays on the image/TRELLIS+ // path below. Routed by registry membership, not just path.+ if (isByokGeometryBackend(BACKENDS[backendId])) {return submitGeometryJob({req,args,diff --git a/api/_providers/byok-registry.js b/api/_providers/byok-registry.jsnew file mode 100644index 000000000..4d61ffedc--- /dev/null+++ b/api/_providers/byok-registry.js@@ -0,0 +1,30 @@+// BYOK geometry-style provider registry — the single source of truth shared by+// the /api/forge endpoint and the 3D Studio MCP server (/api/mcp-3d).+//+// Every provider here exposes the same async surface: `imageTo3d` and/or+// `textToGeometry` returning either a poll handle ({ kind, taskId }) or a+// synchronous completion ({ taskId: null, resultGlbUrl }), plus `status` for the+// pollable ones. Keyed by the `byok` name a backend declares in forge-tiers, so+// both surfaces dispatch by registry lookup instead of a hardcoded ternary.+//+// Replicate BYOK is intentionally NOT here: it speaks the reconstruction+// `submit`/`status` interface (multi-view fusion, platform-shaped jobs), so it+// rides the image-intermediate reconstruction path with the caller's token.++import { createMeshyProvider } from './meshy.js';+import { createTripoProvider } from './tripo.js';+import { createRodinProvider } from './rodin.js';+import { createStabilityProvider } from './stability.js';++export const BYOK_PROVIDER_FACTORIES = Object.freeze({+ meshy: createMeshyProvider,+ tripo: createTripoProvider,+ rodin: createRodinProvider,+ stability: createStabilityProvider,+});++// True when `backendId` is a BYOK geometry-style backend dispatched through this+// registry (so callers can branch without reaching into BACKENDS internals).+export function isByokGeometryBackend(backend) {+ return Boolean(backend?.byok && BYOK_PROVIDER_FACTORIES[backend.byok]);+}diff --git a/api/feed-stream.js b/api/feed-stream.jsindex cb4ba4f6a..14113e9fd 100644--- a/api/feed-stream.js+++ b/api/feed-stream.js@@ -4,14 +4,30 @@// opens this stream. Every event produced anywhere on the platform (see// api/_lib/feed.js) lands in the capped Redis list `feed:events`; this handler// tails that list and pushes only the events that appear AFTER the client-// connected, so new activity reaches an open tab within one poll tick (~1.5s)-// instead of the 20s the bare poll path settles for.+// connected, so new activity reaches an open tab within one poll tick instead+// of the 20s the bare poll path settles for.//// Why poll Redis instead of native pub/sub? The Upstash REST client this repo-// uses has no long-lived SUBSCRIBE; a cheap LRANGE of the list head every tick-// (one command, deduped by event id) survives Vercel's stateless model and costs-// far less than every open tab independently polling /api/feed. One warm function-// fans a single Redis read out to its connected clients.+// uses has no long-lived SUBSCRIBE; a cheap LRANGE of the list head (one+// command, deduped by event id) survives Vercel's stateless model.+//+// ── Quota discipline (this is why the poller is shared) ──────────────────────+// Vercel runs each SSE connection in its own function invocation, but multiple+// concurrent connections frequently land on the SAME warm instance. A naive+// per-connection poll loop therefore multiplies Redis reads by the open-tab+// count — and at a 1.5s tick a SINGLE always-open tab alone issues ~1.7M reads+// a month, blowing the 500k Upstash quota on its own (it did: the feed-stream+// poll storm on 2026-06-12). Two mechanisms keep the burn bounded:+// 1. One poll loop PER INSTANCE, fanned out to every client connected to it —+// N concurrent tabs on a warm instance now cost one Redis read per tick,+// not N. This is the fan-out the file always claimed but never had.+// 2. Adaptive cadence: poll fast right after activity, then ramp the interval+// up while the feed is idle (which it mostly is). An idle instance settles+// to one read every POLL_MS_MAX, cutting steady-state burn by ~7x.+// A circuit breaker (below) caps the damage if the quota is exhausted anyway:+// on the Upstash "max requests" error we stop polling instance-wide for a+// cooldown and degrade to heartbeats, so we never spam the error log or pile+// load onto a dead quota.//// Vercel: registered with maxDuration 300 in vercel.json so the connection can// stay open up to the Hobby ceiling; we send a `retry` directive and close just@@ -23,8 +39,11 @@ import { env } from './_lib/env.js';const FEED_KEY = 'feed:events';const HEARTBEAT_MS = 15_000;-const POLL_MS = 1_500;+const POLL_MS_MIN = 2_000; // fast cadence right after activity+const POLL_MS_MAX = 15_000; // idle ceiling — feed is idle most of the time+const IDLE_TICKS_BEFORE_RAMP = 4; // empty polls tolerated before we slow downconst HEAD_N = 30; // how far back we scan each tick for unseen events+const BREAKER_COOLDOWN_MS = 60_000; // pause polling this long after a quota errorconst MAX_DURATION_MS = 275_000; // close before Vercel's 300s hard timeoutfunction redis() {@@ -38,6 +57,123 @@ function parseRow(row) {try { return JSON.parse(row); } catch { return null; }}+function isQuotaError(err) {+ const m = (err && (err.message || String(err))) || '';+ return /max requests limit exceeded|quota|429/i.test(m);+}++// ── Per-instance shared poller ───────────────────────────────────────────────+// All SSE connections served by one warm Lambda share this single loop. Each+// connection registers an `(event) => void` listener; the loop reads Redis once+// per tick and fans every fresh event out to all of them.+const listeners = new Set();+let sharedClient = null;+let pollTimer = null;+let seen = new Set();+let primed = false; // snapshot the backlog on the first poll, don't replay it+let polling = false;+let currentDelay = POLL_MS_MIN;+let idleTicks = 0;+let breakerUntil = 0; // epoch ms; while now < this, skip Redis entirely+let breakerLogged = false; // log the quota trip once, not every tick++function resetSharedState() {+ if (pollTimer) { clearTimeout(pollTimer); pollTimer = null; }+ seen = new Set();+ primed = false;+ polling = false;+ currentDelay = POLL_MS_MIN;+ idleTicks = 0;+ breakerUntil = 0;+ breakerLogged = false;+ sharedClient = null;+}++function scheduleNextPoll() {+ if (pollTimer) clearTimeout(pollTimer);+ if (listeners.size === 0) { pollTimer = null; return; }+ pollTimer = setTimeout(runPoll, currentDelay);+}++async function runPoll() {+ pollTimer = null;+ if (listeners.size === 0) return;+ if (polling) { scheduleNextPoll(); return; }++ const now = Date.now();+ if (now < breakerUntil) { scheduleNextPoll(); return; } // cooling down++ polling = true;+ try {+ const rows = await sharedClient.lrange(FEED_KEY, 0, HEAD_N - 1);+ breakerLogged = false; // a successful read clears the trip state+ const fresh = [];+ for (const row of rows || []) {+ const obj = parseRow(row);+ if (!obj || !obj.id) continue;+ if (!seen.has(obj.id)) {+ seen.add(obj.id);+ if (primed) fresh.push(obj); // skip the initial backlog+ }+ }+ primed = true;++ if (fresh.length) {+ // List is newest-first; emit oldest→newest so the client prepends in order.+ for (let i = fresh.length - 1; i >= 0; i--) {+ const evt = fresh[i];+ for (const listener of listeners) {+ try { listener(evt); } catch { /* a dead socket — its own cleanup will unregister it */ }+ }+ }+ currentDelay = POLL_MS_MIN; // activity → speed back up+ idleTicks = 0;+ } else {+ // Idle: ramp the interval up toward the ceiling to spare the quota.+ if (++idleTicks >= IDLE_TICKS_BEFORE_RAMP) {+ currentDelay = Math.min(POLL_MS_MAX, currentDelay * 2);+ }+ }++ // Bound the seen-set so a long-lived instance can't grow it unbounded.+ if (seen.size > HEAD_N * 8) {+ const keep = (rows || []).map(parseRow).filter(Boolean).map((o) => o.id);+ seen = new Set();+ for (const id of keep) if (id) seen.add(id);+ }+ } catch (err) {+ if (isQuotaError(err)) {+ breakerUntil = Date.now() + BREAKER_COOLDOWN_MS;+ if (!breakerLogged) {+ console.error('[feed-stream] Redis quota exhausted — pausing poll for', BREAKER_COOLDOWN_MS, 'ms');+ breakerLogged = true;+ }+ } else {+ console.error('[feed-stream] poll failed', err?.message || err);+ }+ } finally {+ polling = false;+ scheduleNextPoll();+ }+}++function addListener(client, fn) {+ if (!sharedClient) sharedClient = client; // first connection on this instance wins+ listeners.add(fn);+ if (!pollTimer && !polling) {+ currentDelay = POLL_MS_MIN; // a new subscriber wants prompt updates+ idleTicks = 0;+ scheduleNextPoll();+ }+}++function removeListener(fn) {+ listeners.delete(fn);+ // Last client gone: tear the loop down and reset so the next connection+ // re-primes (snapshots the head) instead of replaying stale backlog.+ if (listeners.size === 0) resetSharedState();+}+export default async function handleFeedStream(req, res) {if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;if (!method(req, res, ['GET'])) return;@@ -60,6 +196,7 @@ export default async function handleFeedStream(req, res) {const r = redis();send('hello', { ts: Date.now() });+// No Redis configured (e.g. local dev): keep the socket alive with heartbeats// so the client's fallback poll path still runs, but emit nothing.if (!r) {@@ -72,41 +209,9 @@ export default async function handleFeedStream(req, res) {return;}- // Snapshot the current head so we only push events that arrive AFTER connect —- // the client already rendered the backlog from GET /api/feed.- const seen = new Set();- let primed = false;- let polling = false;-- const tick = async () => {- if (closed || polling) return;- polling = true;- try {- const rows = await r.lrange(FEED_KEY, 0, HEAD_N - 1);- const fresh = [];- for (const row of rows || []) {- const obj = parseRow(row);- if (!obj || !obj.id) continue;- if (!seen.has(obj.id)) {- seen.add(obj.id);- if (primed) fresh.push(obj); // skip the initial backlog- }- }- primed = true;- // List is newest-first; emit oldest→newest so the client prepends in order.- for (let i = fresh.length - 1; i >= 0; i--) send('event', fresh[i]);- // Bound the seen-set so a long-lived connection can't grow unbounded.- if (seen.size > HEAD_N * 8) {- const keep = (rows || []).map(parseRow).filter(Boolean).map((o) => o.id);- seen.clear();- for (const id of keep) if (id) seen.add(id);- }- } catch (err) {- console.error('[feed-stream] poll failed', err?.message || err);- } finally {- polling = false;- }- };+ // Register with the shared per-instance poller; it fans fresh events to us.+ const onEvent = (obj) => send('event', obj);+ addListener(r, onEvent);const startMs = Date.now();const heartbeat = setInterval(() => {@@ -118,13 +223,12 @@ export default async function handleFeedStream(req, res) {}res.write(':hb\n\n');}, HEARTBEAT_MS);- const poll = setInterval(tick, POLL_MS);function cleanup() {if (closed) return;closed = true;+ removeListener(onEvent);clearInterval(heartbeat);- clearInterval(poll);if (!res.writableEnded) { try { res.end(); } catch { /* torn down */ } }}diff --git a/api/forge.js b/api/forge.jsindex 826578664..76889dc48 100644--- a/api/forge.js+++ b/api/forge.js@@ -35,8 +35,7 @@ import { limits, clientIp } from './_lib/rate-limit.js';import { textToImage } from './_mcp3d/text-to-image.js';import { createRegenProvider } from './_providers/replicate.js';import { createRegenProvider as createGcpProvider } from './_providers/gcp.js';-import { createMeshyProvider } from './_providers/meshy.js';-import { createTripoProvider } from './_providers/tripo.js';+import { BYOK_PROVIDER_FACTORIES } from './_providers/byok-registry.js';import {PATHS,DEFAULT_PATH,@@ -113,7 +112,7 @@ function needsKey(res, providerName) {return json(res, 501, {error: 'needs_key',provider: providerName,- message: `The geometry path uses ${meta?.label || providerName}, which needs your own API key. Add a ${meta?.byok || providerName} key to use it.`,+ message: `${meta?.label || providerName} needs your own API key. Add a ${meta?.byok || providerName} key to use it.`,});}@@ -167,9 +166,25 @@ async function startJob(req, res) {// gets a generous fail-open bucket; the paid Replicate/BYOK lanes keep the// tight critical 12/h ceiling that protects real money. Both still gate the// expensive work below (image moderation, FLUX, reconstruction).- const path = parsePath(body);+ let path = parsePath(body);const tier = resolveTier(parseTier(body));- const backendId = resolveBackendId({ path, tier, backend: body?.backend, userImages: isImageMode });+ let backendId = resolveBackendId({ path, tier, backend: body?.backend, userImages: isImageMode });++ // The geometry path is BYOK-only — no free model does native text→geometry.+ // So when the caller didn't explicitly pick a backend and has no key for the+ // default geometry engine, transparently serve the free image lane (NVIDIA+ // NIM on draft, TRELLIS otherwise) instead of a dead "needs key" error. The+ // platform works with zero setup; Meshy/Tripo/Rodin stay fully selectable the+ // moment a key is present or a backend is explicitly chosen.+ const backendExplicit = Boolean(body?.backend && BACKENDS[body.backend]);+ if (path === 'geometry' && !backendExplicit) {+ const defaultByok = BACKENDS[backendId]?.byok;+ if (defaultByok && !(await resolveProviderKey(req, body, defaultByok))) {+ path = 'image';+ backendId = resolveBackendId({ path, tier, userImages: isImageMode });+ }+ }+const isFreeLane = BACKENDS[backendId]?.free === true;const rl = isFreeLane ? await limits.mcp3dGenerateFree(ip) : await limits.mcp3dGenerate(ip);if (!rl.success) {@@ -348,19 +363,22 @@ async function startJob(req, res) {});}- // ── Geometry-first path (Meshy / Tripo, BYOK) ───────────────────────────+ // ── BYOK geometry-style providers (Meshy / Tripo / Rodin / Stability) ────// A native 3D model emits mesh geometry directly — from the prompt// (text→geometry) or a single photo (image→3D) — with no synthesized// intermediate view, so detail isn't capped by one image. These backends- // have no platform key; the caller supplies their own.- if (path === 'geometry') {- const providerName = BACKENDS[backendId].byok; // 'meshy' | 'tripo'- const key = await resolveProviderKey(req, body, providerName);+ // have no platform key; the caller supplies their own. Dispatch is a+ // registry lookup on the backend's `byok` name (Replicate BYOK is handled+ // on the image-intermediate path below — it speaks a different interface).+ const byokProvider = BACKENDS[backendId].byok;+ const byokFactory = BYOK_PROVIDER_FACTORIES[byokProvider];+ if (byokFactory) {+ const key = await resolveProviderKey(req, body, byokProvider);if (!key) return needsKey(res, backendId);let gp;try {- gp = backendId === 'tripo' ? createTripoProvider(key) : createMeshyProvider(key);+ gp = byokFactory(key);} catch {return needsKey(res, backendId);}@@ -376,12 +394,65 @@ async function startJob(req, res) {prompt: prompt || undefined,tier,});- } else {+ } else if (typeof gp.textToGeometry === 'function') {submitted = await gp.textToGeometry({ prompt, tier });+ } else {+ // Image-only backend (e.g. Stable Fast 3D) asked to run text→3D.+ return json(res, 422, {+ error: 'backend_image_only',+ backend: backendId,+ message: `${BACKENDS[backendId].label} reconstructs from a reference image — attach one, or drop the backend to use a text→3D engine.`,+ });+ }++ const clientKey = clientKeyFrom(req);++ // Synchronous completion (Stable Fast 3D): the provider already persisted+ // the GLB to R2 and handed back a durable url — no task to poll. Record a+ // finished creation and return done so the client skips polling, exactly+ // like the NVIDIA NIM synchronous path.+ if (!submitted.taskId && submitted.resultGlbUrl) {+ const syntheticJob = randomUUID().replace(/-/g, '');+ const creationId = await createCreation({+ clientKey,+ ipHash: hashIp(ip),+ prompt: prompt || (isImageMode ? 'image-to-3d' : ''),+ aspect: isImageMode ? null : aspect,+ previewImageUrl,+ replicateJobId: syntheticJob,+ textToImageModel: null,+ viewsRequested: isImageMode ? imageUrls.length : 0,+ viewsUsed: isImageMode ? 1 : null,+ multiview: false,+ backend: backendId,+ tier: tier.id,+ path,+ });+ const durable = await materializeCreation({+ replicateJobId: syntheticJob,+ clientKey,+ glbUrl: submitted.resultGlbUrl,+ });+ return json(res, 200, {+ job_id: null,+ creation_id: durable?.id ?? creationId,+ status: 'done',+ glb_url: durable?.glbUrl ?? submitted.resultGlbUrl,+ durable: Boolean(durable),+ mode: isImageMode ? 'image_to_3d' : 'text_to_3d',+ path,+ tier: tier.id,+ backend: backendId,+ prompt: prompt || null,+ preview_image_url: previewImageUrl,+ reference_image_urls: isImageMode ? [imageUrls[0]] : [],+ eta_seconds: estimateEtaSeconds({ backendId, tier }),+ estimated_credits: estimateCredits({ backendId, path, tier }),+ });}const token = encodeJobToken({- provider: providerName,+ provider: byokProvider,kind: submitted.kind,taskId: submitted.taskId,});@@ -389,7 +460,7 @@ async function startJob(req, res) {// Store the upstream task id as the job handle so findByJob/materialize// resolve it on poll, exactly like the Replicate path.const creationId = await createCreation({- clientKey: clientKeyFrom(req),+ clientKey,ipHash: hashIp(ip),prompt: prompt || (isImageMode ? 'image-to-3d' : ''),aspect: isImageMode ? null : aspect,@@ -523,12 +594,23 @@ async function startJob(req, res) {// Hunyuan3D runs on its own Cloud Run worker (GCP_HUNYUAN3D_URL) — never// the avatar pipeline controller, whose face pipeline fails every// non-face image with "no face detected".+ // Replicate BYOK runs the same reconstruction models on the caller's own+ // Replicate account — resolve their token up front (distinct from the+ // platform-keyed TRELLIS default).+ let byokReplicateKey = null;+ if (backendId === 'replicate_byok') {+ byokReplicateKey = await resolveProviderKey(req, body, 'replicate');+ if (!byokReplicateKey) return needsKey(res, backendId);+ }+let provider;try {if (backendId === 'hunyuan3d') {const hunyuanUrl = process.env.GCP_HUNYUAN3D_URL;if (!hunyuanUrl) throw new Error('GCP_HUNYUAN3D_URL is not set');provider = createGcpProvider({ reconstructUrl: hunyuanUrl });+ } else if (backendId === 'replicate_byok') {+ provider = createRegenProvider({ apiToken: byokReplicateKey });} else {provider = createRegenProvider();}@@ -542,6 +624,7 @@ async function startJob(req, res) {message: 'Hunyuan3D self-host is not configured on this deployment.',});}+ if (backendId === 'replicate_byok') return needsKey(res, backendId);return unconfigured(res);}@@ -589,11 +672,15 @@ async function startJob(req, res) {// TRELLIS returns a bare Replicate prediction id (kept as the job handle// for backward compatibility); the GCP/Hunyuan3D provider returns its own// opaque envelope, which we wrap in a forge token so polling routes back to- // the GCP provider. Either way the upstream id is what the store keys on.+ // the GCP provider. Replicate BYOK uses the same bare id but a distinct+ // token tag so polling re-resolves the caller's key (not the platform one).+ // Either way the upstream id is what the store keys on.const jobHandle =backendId === 'hunyuan3d'? encodeJobToken({ provider: 'gcp', kind: null, taskId: job.extJobId })- : job.extJobId;+ : backendId === 'replicate_byok'+ ? encodeJobToken({ provider: 'replicate_byok', kind: null, taskId: job.extJobId })+ : job.extJobId;// Record the generation the moment it starts so the prompt + reference// image survive even if the mesh step later fails. Fail-soft: a missing@@ -776,7 +863,7 @@ async function pollJob(req, res, jobId) {// poll (the client resends it, or it loads from the session store).let result;try {- if (provider === 'meshy' || provider === 'tripo') {+ if (BYOK_PROVIDER_FACTORIES[provider]) {const key = await resolveProviderKey(req, null, provider);if (!key) {return json(res, 200, {@@ -786,8 +873,26 @@ async function pollJob(req, res, jobId) {...metaFields,});}- const gp = provider === 'tripo' ? createTripoProvider(key) : createMeshyProvider(key);+ const gp = BYOK_PROVIDER_FACTORIES[provider](key);result = await gp.status({ kind: token.kind, taskId: upstreamId });+ } else if (provider === 'replicate_byok') {+ // Replicate BYOK polls the caller's own account (key name 'replicate').+ const key = await resolveProviderKey(req, null, 'replicate');+ if (!key) {+ return json(res, 200, {+ job_id: jobId,+ status: 'failed',+ error: 'Your API key is required to check this job. Re-enter it and retry.',+ ...metaFields,+ });+ }+ let rep;+ try {+ rep = createRegenProvider({ apiToken: key });+ } catch {+ return unconfigured(res);+ }+ result = await rep.status(upstreamId);} else if (provider === 'nvidia') {let nv;try {diff --git a/api/img.js b/api/img.jsindex 9e41e53d8..8efca2e03 100644--- a/api/img.js+++ b/api/img.js@@ -28,6 +28,12 @@ import { fetchModel } from './_lib/fetch-model.js';const MAX_BYTES = 8 * 1024 * 1024; // 8 MB — generous for token art, bounded for abuseconst TIMEOUT_MS = 10_000;+// Overall budget for ALL gateway attempts combined. The function's Vercel+// maxDuration is 30s; trying 4 IPFS gateways at 10s each can reach 40s and get+// the invocation killed BEFORE the placeholder redirect below ever runs —+// defeating the "always hand back a valid 200" contract. Cap the total spend so+// we always have time left to redirect to the placeholder.+const TOTAL_BUDGET_MS = 24_000;// Public IPFS gateways tried in order. ipfs.io is the canonical resolver the// rest of the platform pins to (api/_lib/onchain.js), but it is also the one@@ -85,11 +91,17 @@ export default wrap(async function handler(req, res) {}let image = null;+ const deadline = Date.now() + TOTAL_BUDGET_MS;for (const candidate of candidates(target)) {+ // Shrink each attempt's timeout to fit the remaining overall budget so the+ // loop never overruns into the function's hard kill. Once too little time+ // is left to bother, stop and fall through to the placeholder.+ const remaining = deadline - Date.now();+ if (remaining < 1_000) break;try {const result = await fetchModel(candidate, {maxBytes: MAX_BYTES,- timeoutMs: TIMEOUT_MS,+ timeoutMs: Math.min(TIMEOUT_MS, remaining),});if (!result.contentType.startsWith('image/')) continue; // HTML error page etc. — try nextimage = result;diff --git a/data/changelog.json b/data/changelog.jsonindex 929005e80..3a2e852f1 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,34 @@{"$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-06-13",+ "title": "Forge adds four more 3D engines — bring your own Rodin, Stability, Tripo, or Replicate key",+ "summary": "Forge now speaks to more best-in-class 3D generators, so you can pick the engine that fits the job. Rodin (Hyper3D) joins for native text-to-geometry and image-to-3D with clean quad topology and a real polygon target; Stable Fast 3D turns a single photo into a textured model in seconds; and you can now run reconstructions on your own Replicate account. Tripo, which was already supported, finally has a key field in your account settings alongside Meshy. All of these are bring-your-own-key — add a key under Account, then Provider Keys, and the engine lights up. The free, no-setup lanes for prompts and sketches are unchanged, and if you choose the geometry path without a key, Forge now quietly falls back to the free engine instead of asking for one.",+ "tags": [+ "feature"+ ],+ "link": "/forge"+ },+ {+ "date": "2026-06-13",+ "title": "Reliability pass: steadier live feed, token art that never blanks, and fewer Forge timeouts",+ "summary": "We traced a batch of production errors to their roots and fixed them. The live activity ticker no longer hammers our rate store on every open tab — one shared reader now fans updates out to everyone on a server and quiets down while the feed is idle, which is what was silently exhausting our request quota and freezing the feed. Remote token artwork that stalls now always falls back to a placeholder instead of timing out and showing nothing. Text-to-3D generations that take a little longer to start no longer get cut off early. And a stray click-handling error on the homepage, search, and glossary is gone.",+ "tags": [+ "fix",+ "infra"+ ]+ },+ {+ "date": "2026-06-13",+ "title": "pump.fun MCP server now listed in the official MCP registry",+ "summary": "Our free, read-only pump.fun and Solana tools are now discoverable in the official Model Context Protocol registry, so any MCP-compatible client (Claude, Cursor, and others) can find and connect to them by name. It's a remote server — no install, no API key for the free tools — covering token discovery, bonding-curve and holder analysis, creator intelligence, and Solana Name Service lookups. This brings the number of three.ws servers in the registry to six.",+ "tags": [+ "feature",+ "sdk"+ ],+ "link": "/"+ },{"date": "2026-06-13","title": "Embed straight from the homepage demo — no trip to the full Forge",diff --git a/mcp-bridge/server.json b/mcp-bridge/server.jsonindex a6aadc277..f738ef6be 100644--- a/mcp-bridge/server.json+++ b/mcp-bridge/server.json@@ -8,7 +8,9 @@{"src": "https://three.ws/three-ws-mcp-icon.svg","mimeType": "image/svg+xml",- "sizes": ["any"]+ "sizes": [+ "any"+ ]}],"repository": {@@ -22,6 +24,7 @@"registryType": "npm","identifier": "@3d-agent/mcp-bridge","version": "1.0.0",+ "runtimeHint": "npx","transport": {"type": "stdio"},diff --git a/mcp-server/server.json b/mcp-server/server.jsonindex 364d1ff65..fa9fc3d99 100644--- a/mcp-server/server.json+++ b/mcp-server/server.json@@ -8,7 +8,9 @@{"src": "https://three.ws/three-ws-mcp-icon.svg","mimeType": "image/svg+xml",- "sizes": ["any"]+ "sizes": [+ "any"+ ]}],"repository": {@@ -22,6 +24,7 @@"registryType": "npm","identifier": "@3d-agent/mcp-server","version": "1.1.0",+ "runtimeHint": "npx","transport": {"type": "stdio"},diff --git a/packages/avatar-agent-mcp/server.json b/packages/avatar-agent-mcp/server.jsonindex 770767e5f..8375bff7a 100644--- a/packages/avatar-agent-mcp/server.json+++ b/packages/avatar-agent-mcp/server.json@@ -8,7 +8,9 @@{"src": "https://three.ws/three-ws-mcp-icon.svg","mimeType": "image/svg+xml",- "sizes": ["any"]+ "sizes": [+ "any"+ ]}],"repository": {@@ -22,6 +24,7 @@"registryType": "npm","identifier": "@three-ws/avatar-agent","version": "1.2.0",+ "runtimeHint": "npx","transport": {"type": "stdio"},diff --git a/packages/ibm-watsonx-mcp/server.json b/packages/ibm-watsonx-mcp/server.jsonindex 25d6bd528..37138b0c4 100644--- a/packages/ibm-watsonx-mcp/server.json+++ b/packages/ibm-watsonx-mcp/server.json@@ -8,7 +8,9 @@{"src": "https://three.ws/three-ws-mcp-icon.svg","mimeType": "image/svg+xml",- "sizes": ["any"]+ "sizes": [+ "any"+ ]}],"repository": {@@ -22,6 +24,7 @@"registryType": "npm","identifier": "@three-ws/ibm-watsonx-mcp","version": "0.2.0",+ "runtimeHint": "npx","transport": {"type": "stdio"},diff --git a/packages/ibm-x402-mcp/server.json b/packages/ibm-x402-mcp/server.jsonindex cc2b96aa7..6b66c5643 100644--- a/packages/ibm-x402-mcp/server.json+++ b/packages/ibm-x402-mcp/server.json@@ -8,7 +8,9 @@{"src": "https://three.ws/three-ws-mcp-icon.svg","mimeType": "image/svg+xml",- "sizes": ["any"]+ "sizes": [+ "any"+ ]}],"repository": {@@ -22,6 +24,7 @@"registryType": "npm","identifier": "@three-ws/ibm-x402-mcp","version": "1.1.0",+ "runtimeHint": "npx","transport": {"type": "stdio"},diff --git a/packages/pumpfun-mcp/server.json b/packages/pumpfun-mcp/server.jsonindex 7db357017..01e3e2909 100644--- a/packages/pumpfun-mcp/server.json+++ b/packages/pumpfun-mcp/server.json@@ -8,7 +8,9 @@{"src": "https://three.ws/three-ws-mcp-icon.svg","mimeType": "image/svg+xml",- "sizes": ["any"]+ "sizes": [+ "any"+ ]}],"repository": {@@ -22,6 +24,7 @@"registryType": "npm","identifier": "@three-ws/pumpfun-mcp","version": "0.2.0",+ "runtimeHint": "npx","transport": {"type": "stdio"},diff --git a/packages/three-token-mcp/server.json b/packages/three-token-mcp/server.jsonindex 4527b7324..3dc0071e0 100644--- a/packages/three-token-mcp/server.json+++ b/packages/three-token-mcp/server.json@@ -8,7 +8,9 @@{"src": "https://three.ws/three-ws-mcp-icon.svg","mimeType": "image/svg+xml",- "sizes": ["any"]+ "sizes": [+ "any"+ ]}],"repository": {@@ -22,6 +24,7 @@"registryType": "npm","identifier": "@three-ws/three-token-mcp","version": "1.1.0",+ "runtimeHint": "npx","transport": {"type": "stdio"},diff --git a/packages/threews-avatar-mcp/server.json b/packages/threews-avatar-mcp/server.jsonindex 4573341df..81c29fc76 100644--- a/packages/threews-avatar-mcp/server.json+++ b/packages/threews-avatar-mcp/server.json@@ -8,7 +8,9 @@{"src": "https://three.ws/three-ws-mcp-icon.svg","mimeType": "image/svg+xml",- "sizes": ["any"]+ "sizes": [+ "any"+ ]}],"repository": {@@ -22,6 +24,7 @@"registryType": "npm","identifier": "@three-ws/avatar-mcp","version": "0.3.0",+ "runtimeHint": "npx","transport": {"type": "stdio"},diff --git a/public/changelog.json b/public/changelog.jsonindex 463f92c48..148bec8c8 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-13T02:58:50.108Z",+ "generated_at": "2026-06-13T05:04:14.903Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -36,6 +36,27 @@"feature"]},+ {+ "date": "2026-06-13",+ "type": "update",+ "title": "Forge adds four more 3D engines — bring your own Rodin, Stability, Tripo, or Replicate key",+ "summary": "Forge now speaks to more best-in-class 3D generators, so you can pick the engine that fits the job. Rodin (Hyper3D) joins for native text-to-geometry and image-to-3D with clean quad topology and a real polygon target; Stable Fast 3D turns a single photo into a textured model in seconds; and you can now run reconstructions on your own Replicate account. Tripo, which was already supported, finally has a key field in your account settings alongside Meshy. All of these are bring-your-own-key — add a key under Account, then Provider Keys, and the engine lights up. The free, no-setup lanes for prompts and sketches are unchanged, and if you choose the geometry path without a key, Forge now quietly falls back to the free engine instead of asking for one.",+ "link": "/forge",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-13",+ "type": "update",+ "title": "pump.fun MCP server now listed in the official MCP registry",+ "summary": "Our free, read-only pump.fun and Solana tools are now discoverable in the official Model Context Protocol registry, so any MCP-compatible client (Claude, Cursor, and others) can find and connect to them by name. It's a remote server — no install, no API key for the free tools — covering token discovery, bonding-curve and holder analysis, creator intelligence, and Solana Name Service lookups. This brings the number of three.ws servers in the registry to six.",+ "link": "/",+ "tags": [+ "feature",+ "sdk"+ ]+ },{"date": "2026-06-13","type": "update",@@ -46,6 +67,17 @@"improvement"]},+ {+ "date": "2026-06-13",+ "type": "update",+ "title": "Reliability pass: steadier live feed, token art that never blanks, and fewer Forge timeouts",+ "summary": "We traced a batch of production errors to their roots and fixed them. The live activity ticker no longer hammers our rate store on every open tab — one shared reader now fans updates out to everyone on a server and quiets down while the feed is idle, which is what was silently exhausting our request quota and freezing the feed. Remote token artwork that stalls now always falls back to a placeholder instead of timing out and showing nothing. Text-to-3D generations that take a little longer to start no longer get cut off early. And a stray click-handling error on the homepage, search, and glossary is gone.",+ "link": null,+ "tags": [+ "fix",+ "infra"+ ]+ },{"date": "2026-06-13","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex f3402d7a4..9bac4a7fe 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -30,6 +30,22 @@<category>feature</category><description>The text-to-3D demo on the homepage now has an Embed button right in its result toolbar, so a model you forge there can go on your own site without opening the full Forge first. It pops a panel with a live preview, an iframe or <model-viewer> snippet, and the same 16:9 / square / 4:5 size presets, ready to copy in one tap. It's the same one-line embed the full Forge gives you, now one step shorter from the front page.</description></item>+ <item>+ <title>Forge adds four more 3D engines — bring your own Rodin, Stability, Tripo, or Replicate key</title>+ <link>https://three.ws/forge</link>+ <guid isPermaLink="false">2026-06-13:Forge adds four more 3D engines — bring your own Rodin, Stability, Tripo, or Replicate key</guid>+ <pubDate>Sat, 13 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Forge now speaks to more best-in-class 3D generators, so you can pick the engine that fits the job. Rodin (Hyper3D) joins for native text-to-geometry and image-to-3D with clean quad topology and a real polygon target; Stable Fast 3D turns a single photo into a textured model in seconds; and you can now run reconstructions on your own Replicate account. Tripo, which was already supported, finally has a key field in your account settings alongside Meshy. All of these are bring-your-own-key — add a key under Account, then Provider Keys, and the engine lights up. The free, no-setup lanes for prompts and sketches are unchanged, and if you choose the geometry path without a key, Forge now quietly falls back to the free engine instead of asking for one.</description>+ </item>+ <item>+ <title>pump.fun MCP server now listed in the official MCP registry</title>+ <link>https://three.ws/</link>+ <guid isPermaLink="false">2026-06-13:pump.fun MCP server now listed in the official MCP registry</guid>+ <pubDate>Sat, 13 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Our free, read-only pump.fun and Solana tools are now discoverable in the official Model Context Protocol registry, so any MCP-compatible client (Claude, Cursor, and others) can find and connect to them by name. It's a remote server — no install, no API key for the free tools — covering token discovery, bonding-curve and holder analysis, creator intelligence, and Solana Name Service lookups. This brings the number of three.ws servers in the registry to six.</description>+ </item><item><title>Refine any Forge model to higher quality in one click — plus sharper multi-view guidance</title><link>https://three.ws/forge</link>@@ -38,6 +54,14 @@<category>improvement</category><description>Three upgrades to the Forge (/forge). After a model generates, a new Refine button re-runs that exact prompt or photos one quality tier higher — Draft to Standard to High — so you can preview cheaply, then commit to the best version without retyping anything. When building from photos, a live counter now shows how many of the four reference views you've added and reminds you that more angles make a sharper mesh. And the action bar under each finished model now reflows cleanly on phones, with Refine and Make-another leading at full width. Sketch mode also makes its required description unmistakable.</description></item>+ <item>+ <title>Reliability pass: steadier live feed, token art that never blanks, and fewer Forge timeouts</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-13:Reliability pass: steadier live feed, token art that never blanks, and fewer Forge timeouts</guid>+ <pubDate>Sat, 13 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>We traced a batch of production errors to their roots and fixed them. The live activity ticker no longer hammers our rate store on every open tab — one shared reader now fans updates out to everyone on a server and quiets down while the feed is idle, which is what was silently exhausting our request quota and freezing the feed. Remote token artwork that stalls now always falls back to a placeholder instead of timing out and showing nothing. Text-to-3D generations that take a little longer to start no longer get cut off early. And a stray click-handling error on the homepage, search, and glossary is gone.</description>+ </item><item><title>See any Forge model in AR — scan from your desktop, place it in your room</title><link>https://three.ws/forge</link>diff --git a/public/features.json b/public/features.jsonindex 3486d9ac5..391cad807 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-13T02:58:50.090Z",+ "generated_at": "2026-06-13T05:04:14.891Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/glossary.js b/public/glossary.jsindex 9bde8c8fb..edba35f0c 100644--- a/public/glossary.js+++ b/public/glossary.js@@ -393,7 +393,11 @@// Handles [data-glossary-open] clicks even on late-injected nav elements.function initGlossaryOpener() {document.addEventListener('click', function (e) {- var btn = e.target.closest('[data-glossary-open]');+ // e.target may be a non-Element (text node, document); closest() lives+ // on Elements only, so resolve the nearest Element before calling it.+ var t = e.target;+ var el = t && t.nodeType === 1 ? t : (t && t.parentElement) || null;+ var btn = el && el.closest('[data-glossary-open]');if (btn) {e.preventDefault();openModal(btn);diff --git a/public/nav.js b/public/nav.jsindex 88c4ae5d0..9c6addae6 100644--- a/public/nav.js+++ b/public/nav.js@@ -304,7 +304,11 @@ function initDropdowns(root) {});document.addEventListener('click', (e) => {- if (!e.target.closest('.nav-main .nav-grp')) closeAll(null);+ // e.target can be a non-Element (text node, document) — closest() only+ // exists on Elements, so resolve the nearest Element before calling it.+ const t = e.target;+ const el = t && t.nodeType === 1 ? t : (t && t.parentElement) || null;+ if (!el || !el.closest('.nav-main .nav-grp')) closeAll(null);});document.addEventListener('keydown', (e) => {if (e.key === 'Escape') {diff --git a/public/search.js b/public/search.jsindex 3e132fb93..f84983f8f 100644--- a/public/search.js+++ b/public/search.js@@ -767,7 +767,11 @@// Wire any nav search button that nav.html injectsdocument.addEventListener('click', function (e) {- var btn = e.target.closest('[data-search-open]');+ // e.target may be a non-Element (text node, document); closest() lives on+ // Elements only, so resolve the nearest Element before calling it.+ var t = e.target;+ var el = t && t.nodeType === 1 ? t : (t && t.parentElement) || null;+ var btn = el && el.closest('[data-search-open]');if (btn) { e.preventDefault(); open(); }});diff --git a/server-pumpfun.json b/server-pumpfun.jsonnew file mode 100644index 000000000..fa1d70ca6--- /dev/null+++ b/server-pumpfun.json@@ -0,0 +1,25 @@+{+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",+ "name": "io.github.nirholas/threews-pumpfun",+ "title": "three.ws pump.fun MCP",+ "websiteUrl": "https://three.ws",+ "icons": [+ {+ "src": "https://three.ws/three-ws-mcp-icon.svg",+ "mimeType": "image/svg+xml",+ "sizes": ["any"]+ }+ ],+ "description": "Free, read-only pump.fun and Solana token discovery and on-chain analysis tools, by three.ws.",+ "repository": {+ "url": "https://github.com/nirholas/three.ws",+ "source": "github"+ },+ "version": "1.0.0",+ "remotes": [+ {+ "type": "streamable-http",+ "url": "https://three.ws/api/pump-fun-mcp"+ }+ ]+}diff --git a/src/dashboard-next/pages/account.js b/src/dashboard-next/pages/account.jsindex 8db7e02fe..066c39e26 100644--- a/src/dashboard-next/pages/account.js+++ b/src/dashboard-next/pages/account.js@@ -233,9 +233,13 @@ async function copyToClipboard(text) {// ── AI Provider Keys (BYOK) ───────────────────────────────────────────────const PROVIDER_META = {- anthropic: { label: 'Anthropic (Claude)', placeholder: 'sk-ant-api03-…', url: 'https://console.anthropic.com/settings/keys' },- openai: { label: 'OpenAI (GPT-4)', placeholder: 'sk-proj-…', url: 'https://platform.openai.com/api-keys' },- meshy: { label: 'Meshy AI (3D gen)', placeholder: 'msy_…', url: 'https://www.meshy.ai/settings/api' },+ anthropic: { label: 'Anthropic (Claude)', placeholder: 'sk-ant-api03-…', url: 'https://console.anthropic.com/settings/keys' },+ openai: { label: 'OpenAI (GPT-4)', placeholder: 'sk-proj-…', url: 'https://platform.openai.com/api-keys' },+ meshy: { label: 'Meshy AI (3D gen)', placeholder: 'msy_…', url: 'https://www.meshy.ai/settings/api' },+ tripo: { label: 'Tripo AI (3D gen)', placeholder: 'tsk_…', url: 'https://platform.tripo3d.ai/api-keys' },+ rodin: { label: 'Rodin · Hyper3D (3D gen)', placeholder: 'your Rodin key', url: 'https://developer.hyper3d.ai' },+ stability: { label: 'Stability AI (3D gen)', placeholder: 'sk-…', url: 'https://platform.stability.ai/account/keys' },+ replicate: { label: 'Replicate (3D gen)', placeholder: 'r8_…', url: 'https://replicate.com/account/api-tokens' },};async function loadProviderKeys(host) {diff --git a/tests/api/forge-byok-providers.test.js b/tests/api/forge-byok-providers.test.jsnew file mode 100644index 000000000..7229a3e6e--- /dev/null+++ b/tests/api/forge-byok-providers.test.js@@ -0,0 +1,230 @@+// BYOK provider expansion — registry, backend registration, and the two new+// adapter contracts (Rodin async, Stability synchronous).+//+// No network and no mocked product data: global fetch is stubbed to model each+// vendor's real wire protocol (verified against their live API docs), and the+// R2 helper is mocked so the synchronous Stability persist doesn't touch object+// storage. Covers what unit tests can own; live behavior is exercised by BYOK+// keys in production.++import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';++const ORIGINAL_FETCH = globalThis.fetch;+afterEach(() => {+ globalThis.fetch = ORIGINAL_FETCH;+ vi.restoreAllMocks();+});++// R2 is mocked once for the whole file — only the Stability adapter reaches it.+vi.mock('../../api/_lib/r2.js', () => ({+ putObject: vi.fn(async () => ({})),+ publicUrl: (key) => `https://three.ws/cdn/${key}`,+}));++describe('forge-tiers — new BYOK backend registration', () => {+ it('registers Rodin as a geometry+image BYOK backend with poly control', async () => {+ const { BACKENDS } = await import('../../api/_lib/forge-tiers.js');+ const r = BACKENDS.rodin;+ expect(r).toBeTruthy();+ expect(r.byok).toBe('rodin');+ expect(r.provider).toBe('rodin');+ expect(r.paths).toEqual(['geometry', 'image']);+ expect(r.polyControl).toBe(true);+ });++ it('registers Stability as an image-only BYOK backend', async () => {+ const { BACKENDS } = await import('../../api/_lib/forge-tiers.js');+ const s = BACKENDS.stability;+ expect(s.byok).toBe('stability');+ expect(s.paths).toEqual(['image']);+ });++ it('registers Replicate BYOK pointing at the replicate provider + key', async () => {+ const { BACKENDS } = await import('../../api/_lib/forge-tiers.js');+ const rb = BACKENDS.replicate_byok;+ expect(rb.byok).toBe('replicate');+ expect(rb.provider).toBe('replicate');+ expect(rb.paths).toEqual(['image']);+ });++ it('treats every BYOK backend as configured (liveness depends on the key)', async () => {+ const { backendIsConfigured } = await import('../../api/_lib/forge-tiers.js');+ expect(backendIsConfigured('rodin')).toBe(true);+ expect(backendIsConfigured('stability')).toBe(true);+ expect(backendIsConfigured('replicate_byok')).toBe(true);+ });++ it('honors an explicit selection of each new backend on its path', async () => {+ const { resolveBackendId } = await import('../../api/_lib/forge-tiers.js');+ expect(resolveBackendId({ path: 'geometry', backend: 'rodin' })).toBe('rodin');+ expect(resolveBackendId({ path: 'image', backend: 'stability' })).toBe('stability');+ expect(resolveBackendId({ path: 'image', backend: 'replicate_byok' })).toBe('replicate_byok');+ });++ it('surfaces them in the public catalog with byok set', async () => {+ const { buildCatalog } = await import('../../api/_lib/forge-tiers.js');+ const cat = buildCatalog();+ for (const [id, key] of [['rodin', 'rodin'], ['stability', 'stability'], ['replicate_byok', 'replicate']]) {+ const b = cat.backends.find((x) => x.id === id);+ expect(b, id).toBeTruthy();+ expect(b.byok).toBe(key);+ expect(b.configured).toBe(true);+ }+ });+});++describe('byok-registry — shared dispatch table', () => {+ it('contains the geometry-style providers and excludes Replicate', async () => {+ const { BYOK_PROVIDER_FACTORIES } = await import('../../api/_providers/byok-registry.js');+ expect(Object.keys(BYOK_PROVIDER_FACTORIES).sort()).toEqual(+ ['meshy', 'rodin', 'stability', 'tripo'],+ );+ expect(BYOK_PROVIDER_FACTORIES.replicate).toBeUndefined();+ });++ it('isByokGeometryBackend matches registry backends only', async () => {+ const { isByokGeometryBackend } = await import('../../api/_providers/byok-registry.js');+ const { BACKENDS } = await import('../../api/_lib/forge-tiers.js');+ expect(isByokGeometryBackend(BACKENDS.rodin)).toBe(true);+ expect(isByokGeometryBackend(BACKENDS.stability)).toBe(true);+ expect(isByokGeometryBackend(BACKENDS.replicate_byok)).toBe(false); // byok 'replicate', not in registry+ expect(isByokGeometryBackend(BACKENDS.trellis)).toBe(false); // not byok+ });+});++describe('rodin provider — async text→geometry', () => {+ const TIER = { id: 'standard', polycount: 30_000, pbr: false, hd: false };++ it('rejects construction without a key', async () => {+ const { createRodinProvider } = await import('../../api/_providers/rodin.js');+ expect(() => createRodinProvider('')).toThrowError(/key is required/i);+ });++ it('submits Gen-2 quad geometry and returns a poll handle (subKey in kind, uuid in taskId)', async () => {+ const { createRodinProvider } = await import('../../api/_providers/rodin.js');+ let captured;+ globalThis.fetch = vi.fn(async (url, opts) => {+ captured = { url: String(url), form: opts.body };+ return {+ ok: true,+ status: 201,+ json: async () => ({ uuid: 'task-uuid-1', jobs: { subscription_key: 'sub-key-1' } }),+ };+ });+ const gp = createRodinProvider('rodin-key');+ const out = await gp.textToGeometry({ prompt: 'a brass key', tier: TIER });++ expect(captured.url).toBe('https://api.hyper3d.com/api/v2/rodin');+ expect(captured.form.get('tier')).toBe('Gen-2');+ expect(captured.form.get('mesh_mode')).toBe('Quad');+ expect(captured.form.get('prompt')).toBe('a brass key');+ expect(Number(captured.form.get('quality_override'))).toBe(30_000);+ expect(out).toEqual({ kind: 'sub-key-1', taskId: 'task-uuid-1' });+ });++ it('maps 401 to an invalid_key error', async () => {+ const { createRodinProvider } = await import('../../api/_providers/rodin.js');+ globalThis.fetch = vi.fn(async () => ({ ok: false, status: 401, json: async () => ({}) }));+ const gp = createRodinProvider('bad');+ await expect(gp.textToGeometry({ prompt: 'x', tier: TIER })).rejects.toMatchObject({+ code: 'invalid_key',+ });+ });++ it('polls status, then resolves the GLB from the download list when Done', async () => {+ const { createRodinProvider } = await import('../../api/_providers/rodin.js');+ const calls = [];+ globalThis.fetch = vi.fn(async (url, opts) => {+ const u = String(url);+ calls.push(u);+ if (u.endsWith('/status')) {+ const body = JSON.parse(opts.body);+ expect(body.subscription_key).toBe('sub-key-1');+ return { ok: true, status: 200, json: async () => ({ jobs: [{ uuid: 'j1', status: 'Done' }] }) };+ }+ if (u.endsWith('/download')) {+ const body = JSON.parse(opts.body);+ expect(body.task_uuid).toBe('task-uuid-1');+ return {+ ok: true,+ status: 200,+ json: async () => ({+ list: [+ { name: 'preview.webp', url: 'https://x/p.webp' },+ { name: 'model.glb', url: 'https://x/model.glb' },+ ],+ }),+ };+ }+ throw new Error(`unexpected url ${u}`);+ });+ const gp = createRodinProvider('rodin-key');+ const res = await gp.status({ kind: 'sub-key-1', taskId: 'task-uuid-1' });+ expect(res.status).toBe('done');+ expect(res.resultGlbUrl).toBe('https://x/model.glb');+ expect(calls.some((u) => u.endsWith('/download'))).toBe(true);+ });++ it('reports running while Generating (no download call yet)', async () => {+ const { createRodinProvider } = await import('../../api/_providers/rodin.js');+ const calls = [];+ globalThis.fetch = vi.fn(async (url) => {+ calls.push(String(url));+ return { ok: true, status: 200, json: async () => ({ jobs: [{ uuid: 'j1', status: 'Generating' }] }) };+ });+ const gp = createRodinProvider('rodin-key');+ const res = await gp.status({ kind: 'sub-key-1', taskId: 'task-uuid-1' });+ expect(res.status).toBe('running');+ expect(calls.some((u) => u.endsWith('/download'))).toBe(false);+ });+});++describe('stability provider — synchronous image→3D', () => {+ const TIER = { id: 'standard', polycount: 30_000, pbr: false, hd: false };++ it('exposes no textToGeometry (image-only)', async () => {+ const { createStabilityProvider } = await import('../../api/_providers/stability.js');+ const gp = createStabilityProvider('sk-test');+ expect(typeof gp.imageTo3d).toBe('function');+ expect(gp.textToGeometry).toBeUndefined();+ });++ it('persists the returned GLB to R2 and hands back a durable url (no taskId)', async () => {+ const { createStabilityProvider } = await import('../../api/_providers/stability.js');+ const r2 = await import('../../api/_lib/r2.js');+ globalThis.fetch = vi.fn(async (url, opts) => {+ const u = String(url);+ if (u === 'https://img.test/in.png') {+ return { ok: true, status: 200, blob: async () => new Blob([new Uint8Array([1, 2, 3])]) };+ }+ // Stability endpoint — assert the multipart submit + binary accept header.+ expect(u).toBe('https://api.stability.ai/v2beta/3d/stable-fast-3d');+ expect(opts.headers.accept).toBe('model/gltf-binary');+ expect(opts.headers.authorization).toBe('Bearer sk-test');+ expect(opts.body.get('image')).toBeTruthy();+ return { ok: true, status: 200, arrayBuffer: async () => new Uint8Array([7, 7, 7, 7]).buffer };+ });+ const gp = createStabilityProvider('sk-test');+ const out = await gp.imageTo3d({ imageUrl: 'https://img.test/in.png', tier: TIER });++ expect(out.taskId).toBeNull();+ expect(out.resultGlbUrl).toMatch(/^https:\/\/three\.ws\/cdn\/forge\/stability\/.*\.glb$/);+ expect(r2.putObject).toHaveBeenCalledWith(+ expect.objectContaining({ contentType: 'model/gltf-binary' }),+ );+ });++ it('maps a 401 from Stability to invalid_key', async () => {+ const { createStabilityProvider } = await import('../../api/_providers/stability.js');+ globalThis.fetch = vi.fn(async (url) => {+ if (String(url).includes('img.test')) {+ return { ok: true, status: 200, blob: async () => new Blob([new Uint8Array([1])]) };+ }+ return { ok: false, status: 401, json: async () => ({ errors: ['bad key'] }) };+ });+ const gp = createStabilityProvider('sk-bad');+ await expect(gp.imageTo3d({ imageUrl: 'https://img.test/in.png', tier: TIER })).rejects.toMatchObject({+ code: 'invalid_key',+ });+ });+});diff --git a/vercel.json b/vercel.jsonindex be8d89ed5..99c07adb4 100644--- a/vercel.json+++ b/vercel.json@@ -67,6 +67,10 @@"includeFiles": "{examples/skills/**,data/pages.json,data/archives/**,data/rss/**,data/_generated/**,sdk/src/sas-config.json}","maxDuration": 60},+ "api/forge.js": {+ "includeFiles": "{examples/skills/**,data/pages.json,data/archives/**,data/rss/**,data/_generated/**,sdk/src/sas-config.json}",+ "maxDuration": 60+ },"api/brain/chat.js": {"includeFiles": "{examples/skills/**,data/pages.json,data/archives/**,data/rss/**,data/_generated/**,sdk/src/sas-config.json}","maxDuration": 120