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.

Forge x402, Replicate provider, element, club audio asset, and changelog updates

nirholas064b51bd8c68
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6320f52d6..8ee361fd1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Creator revenue splits — earn USDC when your coin's cosmetics sell** — When a player buys a premium avatar cosmetic inside one of your coin's /play worlds, a configurable share of the settled USDC is paid out to your wallet on-chain — no simulated balance, a real Solana transfer. Default split is 50 %; creators can sign a message to adjust their share (up to 90 %). The Monetize dashboard now includes a Creator Earnings panel showing lifetime + 30-day totals, per-cosmetic breakdown, and payout status with on-chain tx links. A new Rarest Fits leaderboard in the shop overlay ranks the scarcest cosmetics, top collectors by rarity-weighted flex score, and top earning creators. (`/play`) `[feature]`
- **Dance floor in /play worlds** — A synchronized dance floor pad now appears in /play worlds, near the coin totem. Step onto the glowing circular stage and a 🪩 Dance button appears in your HUD. Press it to arm — when the server's 4-second beat tick fires, everyone armed on the floor crossfades to the same dance clip at the same moment. Leave the floor or press again to stop. The pad features animated emissive tiles and pulsing coloured lights that react to every beat. (`/play`) `[feature]`
- **Drop in <agent-3d> and you get just the avatar — chat is now opt-in** — The one-line embed is cleaner by default. A plain <agent-3d> tag now ships only the 3D avatar on a transparent background — no chat box, no input bar, no debug color picker, no name-plate. That makes it perfect for dropping a living avatar onto a landing page, hero section, or card without any extra UI to hide. When you want the full talking agent, add the new chat attribute: <agent-3d chat body="...">. Published agents you embed by agent-id, manifest, or an agent:// link still chat automatically — they carry their own brain and persona — so existing agent embeds are unchanged. The reference docs and examples were updated to match. (`/docs/web-component`) `[feature, sdk]`
+- **Embeddable 3D agents now default to a clean, bare avatar** — The <agent-3d> embed tag now starts as the simplest thing it can be: a plain 3D avatar on a transparent background, with no chat box, text input, microphone, or name plate unless you ask for them. Drop the tag with a body and you get just the avatar — perfect for hero sections and decorative scenes. Everything richer is opt-in: add chat for a conversation panel, set background to dark, light, or any color, and theme it with CSS variables. Binding a live agent still turns chat on automatically, and you can now force a bare avatar even for a bound agent with chat="off". `[sdk, improvement]`
- **Embedded avatars: polished loading, seamless looping, and smarter framing** — The live 3D avatars dotted around the site — the ones in the home-page feature cards and anywhere an <agent-3d> embed appears — now feel intentional from the first frame. Each one fades in behind a soft skeleton placeholder while its model streams, instead of popping in cold. Animations no longer hard-snap: a one-shot gesture like a wave plays once and settles smoothly back into an idle stance rather than jumping at the loop boundary. A new framing option crops the avatar to head-to-mid-thigh so it fills its card instead of standing tiny and low. If a body ever fails to load, you get a tasteful silhouette rather than a blank or broken box. Avatars pause themselves when scrolled off-screen to save battery, and anyone who's asked their device to reduce motion gets a calm, held pose instead of looping animation. (`/embed`) `[improvement]`
- **Emoji reactions now float above avatars in every coin world** — Tap any of the 6 reaction buttons (🎉 😂 🔥 ❤️ 👏 🤔) to broadcast a floating emoji that rises above your avatar for everyone in the room to see. The 🎉 reaction also triggers a small confetti burst. Reactions are server-rate-limited so the world stays readable when multiple people react at once; the button dims briefly after each tap to signal that the next one is queued. Keyboard- and screen-reader-accessible; works on touch and desktop. (`/play`) `[feature]`
- **Emote wheel — all 70 animations at your fingertips** — Hold Q (or long-press the ⋯ button on mobile) to open the full emote wheel in any /play world. Five category arcs — Social, Dances, Flips, Combat, Poses — surface every animation in the library. Move the cursor (or left thumbstick on gamepad) to pick a category, choose a clip from the panel that slides up, then release Q to play it. The existing quick-tray keeps your top 6 one-tap emotes. All clips load lazily on first use so the initial load time is unchanged. (`/play`) `[feature]`
diff --git a/api/_providers/replicate.js b/api/_providers/replicate.js
index 51cc91ff6..210c24ab3 100644
--- a/api/_providers/replicate.js
+++ b/api/_providers/replicate.js
@@ -255,6 +255,65 @@ function extractGlbUrl(output) {
return null;
}
+// Replicate throttles prediction CREATION (not polling) with HTTP 429. The cap
+// tightens hard when the account balance is under $5: Replicate drops the
+// create-prediction limit to ~6/min with a burst of 1, so a single forge (one
+// reconstruct create) can be throttled by any other in-flight create on the
+// account even though the window resets within seconds. A 429 means the
+// prediction was never created, so retrying is safe — no duplicate job, and a
+// paid caller has not settled yet (submit runs before settle). We honor
+// Retry-After, fall back to the "resets in ~Ns" hint Replicate puts in the body,
+// and cap each wait so a paid request still settles inside its authorization
+// window (x402 maxTimeoutSeconds: 60).
+const THROTTLE_MAX_ATTEMPTS = 3;
+const THROTTLE_MAX_WAIT_MS = 12_000;
+const THROTTLE_DEFAULT_WAIT_MS = 2_000;
+
+function sleep(ms) {
+ return new Promise((resolve) => setTimeout(resolve, ms));
+}
+
+// Backoff (ms) before retrying a throttled create. Prefers the standard
+// Retry-After header (seconds); falls back to the "resets in ~Ns" phrasing in
+// the throttle body; otherwise a short sane default. Capped so one slow reset
+// can't blow the settlement window.
+function throttleDelayMs(response, data) {
+ const header = response?.headers?.get?.('retry-after');
+ const fromHeader = header ? Number.parseInt(header, 10) : NaN;
+ if (Number.isFinite(fromHeader) && fromHeader >= 0) {
+ return Math.min(fromHeader * 1000, THROTTLE_MAX_WAIT_MS);
+ }
+ const detail = typeof data?.detail === 'string' ? data.detail : '';
+ const m = /resets? in ~?(\d+)\s*s/i.exec(detail);
+ if (m) return Math.min(Number.parseInt(m[1], 10) * 1000, THROTTLE_MAX_WAIT_MS);
+ return THROTTLE_DEFAULT_WAIT_MS;
+}
+
+// POST a prediction-create request, transparently retrying a 429 throttle with a
+// bounded backoff. A network failure surfaces as `provider_unreachable`; the
+// final response (ok, a 404 for the version-resolve fallback, or an exhausted
+// 429) is returned for the caller to interpret. Both create sites in submit()
+// route through this so the throttle resilience is uniform.
+async function createPrediction(endpoint, body, authHeaders) {
+ let last = null;
+ for (let attempt = 0; attempt < THROTTLE_MAX_ATTEMPTS; attempt++) {
+ let response;
+ try {
+ response = await fetch(endpoint, { method: 'POST', headers: authHeaders, body });
+ } catch (err) {
+ throw Object.assign(new Error(`replicate submit failed: ${err?.message}`), {
+ code: 'provider_unreachable',
+ status: 502,
+ });
+ }
+ const data = await response.json().catch(() => ({}));
+ if (response.status !== 429) return { response, data };
+ last = { response, data };
+ if (attempt < THROTTLE_MAX_ATTEMPTS - 1) await sleep(throttleDelayMs(response, data));
+ }
+ return last;
+}
+
// `apiToken` overrides the platform REPLICATE_API_TOKEN — passed by the forge
// BYOK lane so a user can run the same reconstruction models on their own
// Replicate account. When omitted the provider uses the platform token.
@@ -371,21 +430,7 @@ export function createRegenProvider({ apiToken } = {}) {
);
}
- let response;
- try {
- response = await fetch(endpoint, {
- method: 'POST',
- headers: authHeaders,
- body,
- });
- } catch (err) {
- throw Object.assign(new Error(`replicate submit failed: ${err?.message}`), {
- code: 'provider_unreachable',
- status: 502,
- });
- }
-
- let data = await response.json().catch(() => ({}));
+ let { response, data } = await createPrediction(endpoint, body, authHeaders);
// Community models 404 on the unversioned model-level endpoint even
// though the model exists — resolve the latest published version and
@@ -393,22 +438,31 @@ export function createRegenProvider({ apiToken } = {}) {
if (response.status === 404 && slugMatch && !isVersionHash) {
const [, owner, name, pinnedVersion] = slugMatch;
const version = pinnedVersion || (await resolveLatestVersion(owner, name, authHeaders));
- try {
- response = await fetch(`${REPLICATE_BASE}/predictions`, {
- method: 'POST',
- headers: authHeaders,
- body: JSON.stringify({ ...requestBody, version }),
- });
- } catch (err) {
- throw Object.assign(new Error(`replicate submit failed: ${err?.message}`), {
- code: 'provider_unreachable',
- status: 502,
- });
- }
- data = await response.json().catch(() => ({}));
+ ({ response, data } = await createPrediction(
+ `${REPLICATE_BASE}/predictions`,
+ JSON.stringify({ ...requestBody, version }),
+ authHeaders,
+ ));
}
if (!response.ok) {
+ // A 429 that survives the bounded retry is a real throttle the caller
+ // can act on — classify it as a retryable rate limit (mirrors
+ // text-to-image.js) so the paid forge endpoint returns 429 + a
+ // Retry-After hint instead of a blind 502, and never settles a
+ // payment it can't fulfill.
+ if (response.status === 429) {
+ const message =
+ data?.detail ||
+ data?.title ||
+ 'Replicate is throttling new generations (low account credit or rate limit) — retry shortly.';
+ throw Object.assign(new Error(message), {
+ code: 'rate_limited',
+ status: 429,
+ providerStatus: 429,
+ retryAfter: Math.ceil(throttleDelayMs(response, data) / 1000),
+ });
+ }
throw Object.assign(
new Error(data?.detail || data?.title || `replicate returned ${response.status}`),
{ code: 'provider_error', status: 502, providerStatus: response.status },
diff --git a/api/x402/forge.js b/api/x402/forge.js
index 93ecd5690..bcd6b1570 100644
--- a/api/x402/forge.js
+++ b/api/x402/forge.js
@@ -5,9 +5,14 @@
// USDC with no account, key, or signup — cataloged by the CDP x402 Bazaar.
//
// One payment buys one generation. After verifying payment the server submits the
-// real Forge job (FLUX→TRELLIS image pipeline — text→image→mesh, or image→mesh
-// from supplied reference views), then settles. The response hands back a job
-// token the buyer polls for FREE on the existing provider-aware endpoint:
+// real Forge job, then settles. Text→3D runs on the FREE NVIDIA NIM TRELLIS lane
+// (native text→mesh, zero vendor cost) as the primary engine for every tier; if
+// that lane is unconfigured or unavailable it degrades to the FLUX→TRELLIS
+// reconstruct lane so a paid call never dead-ends. Image→3D (caller-supplied
+// reference views) always reconstructs — NVIDIA's hosted preview is text-only.
+// The response hands back a job token the buyer polls for FREE on the existing
+// provider-aware endpoint, OR — when the free lane completes inside the submit
+// window (typical for draft) — the finished GLB url inline with status:"done":
// GET /api/forge?job=<job_id> → { status, glb_url, ... }
//
// Pricing is per-tier and lives in one place (api/_lib/forge-tiers.js): draft
@@ -54,6 +59,8 @@ import { withService } from '../_lib/x402/bazaar-helpers.js';
import { assertSafePublicUrl } from '../_lib/ssrf-guard.js';
import { textToImage } from '../_mcp3d/text-to-image.js';
import { createRegenProvider } from '../_providers/replicate.js';
+import { createNvidiaProvider } from '../_providers/nvidia.js';
+import { encodeJobToken } from '../_lib/forge-job-token.js';
import {
TIER_IDS,
DEFAULT_TIER,
@@ -72,15 +79,18 @@ const routeConfig = { path: ROUTE, method: 'POST', requiredScope: REQUIRED_SCOPE
const VALID_ASPECT = new Set(['1:1', '4:3', '3:4', '16:9', '9:16']);
const HTTP_URL_RE = /^https:\/\/[^\s]+$/i;
const MAX_VIEWS = 4;
-const BACKEND = 'trellis'; // the platform image pipeline this paid route serves
+// The reconstruct lane: serves image→3D (NVIDIA's hosted preview can't take user
+// photos) and the text→3D fallback when the free NVIDIA NIM lane is unavailable.
+const BACKEND = 'trellis';
const ROUTE_DESCRIPTION =
'three.ws Forge — pay-per-call text→3D and image→3D. Submit a prompt (or up ' +
'to four reference views of one object) and get back a job token; poll it for ' +
- 'free at GET /api/forge?job=<id> for the finished GLB. Runs the FLUX→TRELLIS ' +
- 'pipeline (text→image→mesh, or image→mesh). Priced per quality tier in USDC ' +
- '($0.05 draft / $0.15 standard / $0.50 high). Pay autonomously on Base or ' +
- 'Solana mainnet — no API key, no account.';
+ 'free at GET /api/forge?job=<id> for the finished GLB (draft prompts often ' +
+ 'finish inline and return the GLB url with status:"done"). Text→3D runs on the ' +
+ 'free NVIDIA NIM TRELLIS lane (native text→mesh); image→3D reconstructs via ' +
+ 'TRELLIS. Priced per quality tier in USDC ($0.05 draft / $0.15 standard / ' +
+ '$0.50 high). Pay autonomously on Base or Solana mainnet — no API key, no account.';
const INPUT_EXAMPLE = {
prompt: 'a brass steampunk owl, full body',
@@ -111,24 +121,37 @@ const INPUT_SCHEMA = {
};
const OUTPUT_EXAMPLE = {
- job_id: 'abc123def4567890',
+ job_id: 'f1.eyJwIjoibnZpZGlhIn0.sig',
status: 'queued',
- poll_url: '/api/forge?job=abc123def4567890',
+ poll_url: '/api/forge?job=f1.eyJwIjoibnZpZGlhIn0.sig',
mode: 'text_to_3d',
tier: 'standard',
- backend: 'trellis',
- eta_seconds: 60,
+ backend: 'nvidia',
+ eta_seconds: 22,
price_usdc: '0.15',
};
const OUTPUT_SCHEMA = {
$schema: 'https://json-schema.org/draft/2020-12/schema',
type: 'object',
- required: ['job_id', 'status', 'poll_url'],
+ // `status` is the only guaranteed field: a queued job carries job_id + poll_url,
+ // while a job that completes inside the submit window (the free NVIDIA NIM lane,
+ // typical for draft) carries glb_url with status:"done" and a null job_id.
+ required: ['status'],
properties: {
- job_id: { type: 'string', description: 'Poll this on GET /api/forge?job=<id>.' },
- status: { type: 'string' },
- poll_url: { type: 'string', description: 'Free, provider-aware status endpoint.' },
+ job_id: {
+ type: ['string', 'null'],
+ description: 'Poll this on GET /api/forge?job=<id>. Null when the model finished inline.',
+ },
+ status: { type: 'string', description: '"queued" (poll it) or "done" (glb_url is ready).' },
+ poll_url: {
+ type: ['string', 'null'],
+ description: 'Free, provider-aware status endpoint. Null on inline completion.',
+ },
+ glb_url: {
+ type: 'string',
+ description: 'The finished GLB — present only when status is "done".',
+ },
mode: { type: 'string', enum: ['text_to_3d', 'image_to_3d'] },
tier: { type: 'string' },
backend: { type: 'string' },
@@ -181,12 +204,81 @@ function buildRequirements(resourceUrl, priceAtomics) {
return out;
}
-// Submit the real generation job and return its poll token. Reuses the same
-// text-to-image + reconstruction libs the free endpoint uses, so there is one
-// source of truth for the pipeline; the token is the upstream prediction id,
-// pollable on GET /api/forge?job=. Throws on any submit failure so the caller
-// can avoid settling payment.
+// Submit the real generation job and return its poll token (or the finished GLB
+// when the lane completes inline). Text→3D runs on the free NVIDIA NIM TRELLIS
+// lane first; if that lane is unconfigured or unavailable it degrades to the
+// FLUX→TRELLIS reconstruct lane so a paid call never dead-ends. Image→3D always
+// reconstructs (NVIDIA's hosted preview is text-only). Throws on any submit
+// failure so the caller can avoid settling payment.
async function submitGeneration({ prompt, imageUrls, isImageMode, aspect, tier }) {
+ // Text prompts → the free NVIDIA NIM TRELLIS lane first (zero vendor cost).
+ if (!isImageMode) {
+ const viaNvidia = await submitTextViaNvidia({ prompt, tier });
+ if (viaNvidia) return viaNvidia;
+ // NIM unconfigured / unreachable / over capacity — fall through to the
+ // FLUX→TRELLIS reconstruct lane so the paid call still produces a model.
+ }
+ return submitViaReconstruct({ prompt, imageUrls, isImageMode, aspect, tier });
+}
+
+// Free NVIDIA NIM native text→3D. Returns the finished/queued response shape, or
+// null when the lane is unavailable so submitGeneration can fall back. Never
+// throws: a free-lane hiccup must degrade, not fail the whole paid call.
+async function submitTextViaNvidia({ prompt, tier }) {
+ let provider;
+ try {
+ provider = createNvidiaProvider();
+ } catch (err) {
+ console.warn(`[x402/forge] free NVIDIA NIM lane unavailable: ${err?.message || err}`);
+ return null;
+ }
+
+ let submitted;
+ try {
+ submitted = await provider.textTo3d({ prompt, tier });
+ } catch (err) {
+ console.warn(`[x402/forge] free NVIDIA NIM text→3D failed: ${err?.message || err}`);
+ return null;
+ }
+
+ const backend = 'nvidia';
+ const base = {
+ mode: 'text_to_3d',
+ tier: resolveTier(tier).id,
+ backend,
+ eta_seconds: estimateEtaSeconds({ backendId: backend, tier }),
+ price_usdc: priceUsdcForTier(tier),
+ };
+
+ // Synchronous completion: NVCF already persisted the GLB to R2 inside the
+ // submit window (typical for draft). Hand back the durable url directly — the
+ // buyer's client renders it without polling.
+ if (submitted?.resultGlbUrl) {
+ return { job_id: null, status: 'done', poll_url: null, glb_url: submitted.resultGlbUrl, ...base };
+ }
+
+ // Async: wrap the NVCF request id in a signed forge token so the free poll
+ // endpoint routes the status check back to the NIM provider.
+ if (submitted?.taskId) {
+ const token = encodeJobToken({ provider: 'nvidia', kind: submitted.kind, taskId: submitted.taskId });
+ return {
+ job_id: token,
+ status: 'queued',
+ poll_url: `/api/forge?job=${encodeURIComponent(token)}`,
+ ...base,
+ };
+ }
+
+ // Neither a url nor a task id came back — treat as unavailable and fall back.
+ console.warn('[x402/forge] NVIDIA NIM returned neither a GLB nor a task id; falling back');
+ return null;
+}
+
+// FLUX→TRELLIS reconstruct lane: synthesize a reference image from the prompt
+// (text fallback) or take the caller's reference views (image→3D), then
+// reconstruct to a mesh on Replicate TRELLIS. The token is the upstream
+// prediction id, pollable on GET /api/forge?job=.
+async function submitViaReconstruct({ prompt, imageUrls, isImageMode, aspect, tier }) {
let provider;
try {
provider = createRegenProvider();
@@ -236,6 +328,28 @@ async function submitGeneration({ prompt, imageUrls, isImageMode, aspect, tier }
};
}
+// Map a submitGeneration failure onto the right HTTP response. A provider 429 is
+// a transient throttle (Replicate's create-prediction limit, tightest when the
+// account runs low on credit). Because submit runs BEFORE settle, the payment
+// was never taken — so we answer 429 with a Retry-After hint and say so plainly,
+// rather than burying it as a generic 5xx the buyer can't reason about.
+function respondGenerationError(res, err) {
+ if (err?.status === 429 || err?.code === 'rate_limited') {
+ const retryAfter =
+ Number.isFinite(err?.retryAfter) && err.retryAfter > 0 ? Math.ceil(err.retryAfter) : 5;
+ res.setHeader('retry-after', String(retryAfter));
+ return error(
+ res,
+ 429,
+ 'rate_limited',
+ err?.message ||
+ 'Generation is briefly throttled upstream — your payment was not taken. Retry shortly.',
+ { retry_after: retryAfter },
+ );
+ }
+ return error(res, err?.status || 502, err?.code || 'generation_failed', err?.message);
+}
+
// GET — free price/usage discovery. No payment, no generation.
function handleGet(req, res) {
const url = new URL(req.url, 'http://localhost');
@@ -323,7 +437,7 @@ export default wrap(async (req, res) => {
try {
result = await submitGeneration(parsed);
} catch (err) {
- return error(res, err.status || 500, err.code || 'internal_error', err.message);
+ return respondGenerationError(res, err);
}
if (acResult.headers)
for (const [k, v] of Object.entries(acResult.headers)) res.setHeader(k, v);
@@ -378,7 +492,7 @@ export default wrap(async (req, res) => {
try {
result = await submitGeneration(parsed);
} catch (err) {
- return error(res, err.status || 502, err.code || 'generation_failed', err.message);
+ return respondGenerationError(res, err);
}
let settled;
diff --git a/club.mp3 b/club.mp3
new file mode 100644
index 000000000..425d0b59b
Binary files /dev/null and b/club.mp3 differ
diff --git a/data/changelog.json b/data/changelog.json
index 0903481d6..5a34312f9 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,15 @@
{
"$comment": "Curated changelog entries for three.ws \u2014 the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-06-17",
+ "title": "Embeddable 3D agents now default to a clean, bare avatar",
+ "summary": "The <agent-3d> embed tag now starts as the simplest thing it can be: a plain 3D avatar on a transparent background, with no chat box, controls, or name plate unless you ask for them. Drop the tag with a body and you get just the avatar — perfect for hero sections and decorative scenes. Everything richer is opt-in: add chat for a conversation panel, set background to dark, light, or any color, and theme it with CSS variables. Binding a live agent still turns chat on automatically, and you can now force a bare avatar even for a bound agent with chat=\"off\".",
+ "tags": [
+ "sdk",
+ "improvement"
+ ]
+ },
{
"date": "2026-06-17",
"title": "Text → 3D in chat, now with live progress and a real viewer",
diff --git a/pages/ibm/x402-demo.html b/pages/ibm/x402-demo.html
index 43d5e5123..3adfa455c 100644
--- a/pages/ibm/x402-demo.html
+++ b/pages/ibm/x402-demo.html
@@ -439,13 +439,13 @@ agent-3d:defined ~ .agent-skel{display:none}
<div class="inner">
<div class="section-tag">Demo 01 · Creation</div>
<h2 id="forge-h">Forge a <strong>3D model</strong> from a sentence</h2>
- <p class="section-lead">This pays the same x402 rail as the demo below — one USDC micropayment runs a real text→3D pipeline (FLUX→TRELLIS) and hands back a textured GLB you can orbit and download. The price below is read live from the server's own 402 response.</p>
+ <p class="section-lead">This pays the same x402 rail as the demo below — one USDC micropayment runs a real text→3D pipeline (Microsoft TRELLIS on NVIDIA NIM) and hands back a textured GLB you can orbit and download. The price below is read live from the server's own 402 response.</p>
<div class="demo">
<div class="demo-head">
<div>
<h3 class="demo-title">three<span>.ws</span> Forge</h3>
- <div class="demo-desc">Describe one object; pay; get back a textured, downloadable 3D model. Runs FLUX→TRELLIS (text→image→mesh) — the same pipeline that builds the bodies our agents wear.</div>
+ <div class="demo-desc">Describe one object; pay; get back a textured, downloadable 3D model. Runs Microsoft TRELLIS on NVIDIA NIM (native text→mesh) — the same engine that builds the bodies our agents wear.</div>
</div>
<div class="price-tag">
<div class="amt" id="fgPriceAmt" aria-hidden="true">$<strong>0.05</strong></div>
diff --git a/public/changelog.json b/public/changelog.json
index d6f643315..a2fa27eea 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-17T22:46:11.205Z",
+ "generated_at": "2026-06-17T22:52:45.827Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -302,6 +302,17 @@
"sdk"
]
},
+ {
+ "date": "2026-06-17",
+ "type": "update",
+ "title": "Embeddable 3D agents now default to a clean, bare avatar",
+ "summary": "The <agent-3d> embed tag now starts as the simplest thing it can be: a plain 3D avatar on a transparent background, with no chat box, text input, microphone, or name plate unless you ask for them. Drop the tag with a body and you get just the avatar — perfect for hero sections and decorative scenes. Everything richer is opt-in: add chat for a conversation panel, set background to dark, light, or any color, and theme it with CSS variables. Binding a live agent still turns chat on automatically, and you can now force a bare avatar even for a bound agent with chat=\"off\".",
+ "link": null,
+ "tags": [
+ "sdk",
+ "improvement"
+ ]
+ },
{
"date": "2026-06-17",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 7b58e347d..591d8a890 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -238,6 +238,14 @@
<category>feature</category>
<description>The one-line embed is cleaner by default. A plain &lt;agent-3d&gt; tag now ships only the 3D avatar on a transparent background — no chat box, no input bar, no debug color picker, no name-plate. That makes it perfect for dropping a living avatar onto a landing page, hero section, or card without any extra UI to hide. When you want the full talking agent, add the new chat attribute: &lt;agent-3d chat body=&quot;...&quot;&gt;. Published agents you embed by agent-id, manifest, or an agent:// link still chat automatically — they carry their own brain and persona — so existing agent embeds are unchanged. The reference docs and examples were updated to match.</description>
</item>
+ <item>
+ <title>Embeddable 3D agents now default to a clean, bare avatar</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-17:Embeddable 3D agents now default to a clean, bare avatar</guid>
+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>
+ <category>sdk</category>
+ <description>The &lt;agent-3d&gt; embed tag now starts as the simplest thing it can be: a plain 3D avatar on a transparent background, with no chat box, text input, microphone, or name plate unless you ask for them. Drop the tag with a body and you get just the avatar — perfect for hero sections and decorative scenes. Everything richer is opt-in: add chat for a conversation panel, set background to dark, light, or any color, and theme it with CSS variables. Binding a live agent still turns chat on automatically, and you can now force a bare avatar even for a bound agent with chat=&quot;off&quot;.</description>
+ </item>
<item>
<title>Embedded avatars: polished loading, seamless looping, and smarter framing</title>
<link>https://three.ws/embed</link>
diff --git a/public/features.json b/public/features.json
index c51b1dec5..2bff7fd0b 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-17T22:46:11.179Z",
+ "generated_at": "2026-06-17T22:52:45.808Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/element.js b/src/element.js
index 76868d538..6d60cedc0 100644
--- a/src/element.js
+++ b/src/element.js
@@ -419,27 +419,6 @@ const BASE_STYLE = `
pointer-events: none;
z-index: 4;
}
- /* Static decoration fallback — a calm avatar silhouette shown when a bare
- (chat-less) embed's body fails to load, instead of a blank frame or a
- broken/empty canvas. Chat embeds get the richer .error card instead. */
- .fallback {
- position: absolute;
- inset: 0;
- display: grid;
- place-items: center;
- pointer-events: none;
- z-index: 4;
- animation: agent-err-in 0.3s ease both;
- }
- .fallback svg {
- width: 38%;
- max-width: 132px;
- height: auto;
- color: rgba(140, 140, 162, 0.5);
- }
- @media (prefers-reduced-motion: reduce) {
- .fallback { animation: none; }
- }
.error, .agent-3d-error {
position: absolute;
inset: 16px;
@@ -690,8 +669,7 @@ class Agent3DElement extends HTMLElement {
// WebGL context budget bookkeeping.
this._inViewport = false;
this._lastVisibleAt = 0;
- // Decoration fallback + reduced-motion bookkeeping.
- this._fallbackEl = null;
+ // Reduced-motion bookkeeping.
this._mqReduce = null;
this._mqReduceHandler = null;
}
@@ -732,7 +710,13 @@ class Agent3DElement extends HTMLElement {
// agent-binding heuristic, for embeds that want a bound agent rendered as
// pure decoration.
_isChatMode() {
- if (this.hasAttribute('chat')) return true;
+ // Explicit `chat` always wins, in both directions. `chat` / `chat="on"`
+ // forces the chat shell; `chat="off"` (or false/0/no) forces a bare
+ // avatar even for a bound agent — the explicit opt-out so the minimal
+ // transparent avatar is reachable for every kind of source.
+ if (this.hasAttribute('chat')) {
+ return !/^(off|false|0|no)$/i.test((this.getAttribute('chat') || '').trim());
+ }
if (this.hasAttribute('kiosk') || this.hasAttribute('viewer')) return false;
if (this.hasAttribute('agent-id') || this.hasAttribute('manifest')) return true;
// An `src` pointing at a published agent (the `agent://` scheme) is a
@@ -755,7 +739,6 @@ class Agent3DElement extends HTMLElement {
this.shadowRoot.replaceChildren();
// Null cached element refs so _renderShell recreates them from scratch.
this._loadingEl = null;
- this._fallbackEl = null;
this._stageEl = null;
this._posterEl = null;
this._nameplateEl = null;
@@ -1465,12 +1448,6 @@ class Agent3DElement extends HTMLElement {
async _boot() {
if (this._booting || this._mounted) return;
this._renderShell();
- // Clear any decoration fallback left by a prior failed attempt so the
- // fresh boot's avatar isn't drawn underneath a stale silhouette.
- if (this._fallbackEl) {
- this._fallbackEl.remove();
- this._fallbackEl = null;
- }
this._booting = true;
try {
this._loadingEl.hidden = false;
@@ -1980,8 +1957,8 @@ class Agent3DElement extends HTMLElement {
// Resolve errors should already have been caught and replaced with the
// default-avatar manifest in _resolveManifest. Anything reaching here is
// a deeper boot failure (e.g. the GLB or rig failed to load): chat mode
- // shows the error card, a bare decoration avatar paints the static
- // silhouette/poster fallback. Both also emit agent:error below.
+ // shows the error card, a bare decoration avatar shows its poster (or
+ // stays transparent). Both also emit agent:error below.
this._showError(err);
this.dispatchEvent(
new CustomEvent('agent:error', {
@@ -2524,9 +2501,9 @@ class Agent3DElement extends HTMLElement {
}
_showError(err) {
- // Bare/decoration avatars degrade to a tasteful static silhouette (or the
- // supplied poster) rather than a chat-style error card — clean decoration,
- // but never a blank frame or a broken canvas. Chat agents get the card.
+ // Bare/decoration avatars degrade to the supplied poster (or stay
+ // transparent) rather than a chat-style error card — clean decoration,
+ // never a broken canvas. Chat agents get the card.
if (!this._isChatMode()) {
this._showDecorationFallback();
return;
@@ -2949,30 +2926,18 @@ class Agent3DElement extends HTMLElement {
}
/**
- * Tasteful static fallback for a bare/decoration avatar whose body failed to
- * load: keep the poster if one was supplied, otherwise paint a calm avatar
- * silhouette — never a blank frame or a broken canvas.
+ * Quiet fallback for a bare/decoration avatar whose body failed to load:
+ * keep the poster if one was supplied, otherwise leave the frame transparent
+ * so it blends into the host page — never a placeholder silhouette.
*/
_showDecorationFallback() {
- if (this._fallbackEl) return;
this._loadingEl && (this._loadingEl.hidden = true);
- // A poster already fills the frame — just make sure it stays visible.
+ // A bare (chat-less) embed that can't paint stays transparent so it
+ // blends into the host page — unless a poster was supplied, in which
+ // case it stays visible as the decoration. No silhouette placeholder.
if (this.getAttribute('poster') && this._posterEl) {
this._posterEl.style.opacity = '1';
- return;
}
- const el = document.createElement('div');
- el.className = 'fallback';
- el.setAttribute('role', 'img');
- el.setAttribute('aria-label', 'Avatar preview unavailable');
- el.innerHTML = `
- <svg viewBox="0 0 64 64" fill="none" stroke="currentColor" stroke-width="2.4"
- stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
- <circle cx="32" cy="22" r="11"/>
- <path d="M12 55a20 20 0 0 1 40 0"/>
- </svg>`;
- this.shadowRoot.appendChild(el);
- this._fallbackEl = el;
}
/**
diff --git a/tests/api/x402-forge.test.js b/tests/api/x402-forge.test.js
index 20bd057dc..5ec9a3be4 100644
--- a/tests/api/x402-forge.test.js
+++ b/tests/api/x402-forge.test.js
@@ -43,6 +43,20 @@ vi.mock('../../api/_providers/replicate.js', () => ({
}),
}));
+// Free NVIDIA NIM TRELLIS lane — the primary text→3D engine. Hoisted so each test
+// controls it: by default createNvidiaProvider THROWS (no NVIDIA_API_KEY), which
+// exercises the never-dead-end degrade to the Replicate reconstruct lane. The
+// NVIDIA-path tests override it per-call with mockReturnValueOnce.
+const nvidiaMock = vi.hoisted(() => ({
+ createNvidiaProvider: vi.fn(() => {
+ throw Object.assign(new Error('NVIDIA_API_KEY is required for the nvidia (TRELLIS) provider'), {
+ code: 'missing_key',
+ status: 503,
+ });
+ }),
+}));
+vi.mock('../../api/_providers/nvidia.js', () => nvidiaMock);
+
// Rate limiter: deterministic success, no Upstash dependency.
vi.mock('../../api/_lib/rate-limit.js', async (importActual) => {
const actual = await importActual();
diff --git a/tests/src/bare-default.test.js b/tests/src/bare-default.test.js
new file mode 100644
index 000000000..608a355be
--- /dev/null
+++ b/tests/src/bare-default.test.js
@@ -0,0 +1,69 @@
+// @vitest-environment jsdom
+import { describe, it, expect, vi } from 'vitest';
+
+// The element pulls in a WebGL Viewer and the dat.GUI debug panel on boot.
+// Neither survives jsdom, and we only care about which chrome the shell builds,
+// so stub both. boot() will still no-op-fail on the stubbed viewer — that's
+// fine; _renderShell (the thing under test) runs synchronously before boot.
+vi.mock('../../src/viewer.js', () => ({ Viewer: class {} }));
+vi.mock('dat.gui', () => ({
+ GUI: class {
+ addFolder() { return this; }
+ add() { return { onChange: () => this, name: () => this }; }
+ addColor() { return { onChange: () => this, name: () => this }; }
+ destroy() {}
+ },
+}));
+
+import '../../src/element.js';
+
+describe('<agent-3d> chrome policy', () => {
+ it('a plain element is a bare, transparent avatar — no chat chrome', () => {
+ const el = document.createElement('agent-3d');
+ document.body.appendChild(el);
+ const sr = el.shadowRoot;
+ const has = (sel) => !!sr.querySelector(sel);
+
+ // The avatar canvas host is always present…
+ expect(has('.stage')).toBe(true);
+ // …but none of the conversational chrome is built by default.
+ expect(has('.chrome')).toBe(false);
+ expect(has('.chat')).toBe(false);
+ expect(has('.input-row')).toBe(false);
+ expect(has('.icon.mic')).toBe(false);
+ expect(has('.thought-bubble')).toBe(false);
+
+ // Bare mode is reflected for CSS (hides debug GUI / axes) and the
+ // background composites transparently by default.
+ expect(el.hasAttribute('data-bare')).toBe(true);
+ expect(el.getAttribute('background') || 'transparent').toBe('transparent');
+ });
+
+ it('the `chat` attribute opts into the full conversational chrome', () => {
+ const el = document.createElement('agent-3d');
+ el.setAttribute('chat', '');
+ document.body.appendChild(el);
+
+ expect(!!el.shadowRoot.querySelector('.chat')).toBe(true);
+ expect(el.hasAttribute('data-bare')).toBe(false);
+ });
+
+ it('binding a published agent (agent-id) talks by default', () => {
+ const el = document.createElement('agent-3d');
+ el.setAttribute('agent-id', '11111111-1111-1111-1111-111111111111');
+ document.body.appendChild(el);
+
+ expect(!!el.shadowRoot.querySelector('.chat')).toBe(true);
+ expect(el.hasAttribute('data-bare')).toBe(false);
+ });
+
+ it('`viewer` forces a bound agent back to bare decoration', () => {
+ const el = document.createElement('agent-3d');
+ el.setAttribute('agent-id', '11111111-1111-1111-1111-111111111111');
+ el.setAttribute('viewer', '');
+ document.body.appendChild(el);
+
+ expect(!!el.shadowRoot.querySelector('.chat')).toBe(false);
+ expect(el.hasAttribute('data-bare')).toBe(true);
+ });
+});