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: introduce living-agent functionality for AR avatars
nirholas4e667b09b7cd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e2715381b..6fa6c6234 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -4,6 +4,10 @@Public history for [three.ws](https://three.ws), newest first. New pages come from `added` dates in data/pages.json; everything else is curated in data/changelog.json. Also available as [JSON](https://three.ws/changelog.json) and [RSS](https://three.ws/changelog.xml), live at [three.ws/changelog](https://three.ws/changelog).+## 2026-07-15++- **AR avatars now come alive in your room** — Avatars no longer land in AR as frozen statues. Every rigged avatar generated on three.ws now carries a Bring it to life link that opens IRL: the agent walks, animates, and talks with you through your camera, standing in your real space. Static placement is still one tap away for props or anyone who just wants the model on a desk. The living link ships everywhere avatars are made: the AR launch page, the 3D Studio tools in ChatGPT and Claude, and the developer MCP tools. (`/irl`) `[feature, improvement]`+## 2026-07-14- **AR Forge** (`/ar`) — Type a prompt, get a real 3D model, and place it in your room: free text-to-3D with one-tap AR on any phone (WebXR, Scene Viewer, Quick Look) and a QR handoff from desktop.diff --git a/api/_lib/ar-launch.js b/api/_lib/ar-launch.jsindex a89005faf..c9222a723 100644--- a/api/_lib/ar-launch.js+++ b/api/_lib/ar-launch.js@@ -11,6 +11,14 @@// Scene Viewer source), with a browser fallback to the WebGL viewer.// • desktop → the interactive WebGL viewer (no AR hardware).//+// AR here is not a prop viewer: it is how three.ws agents cross into physical+// space. A static object gets Quick Look / Scene Viewer placement; a LIVE asset+// (a rigged avatar, an agent's body) additionally gets the IRL handoff+// (/irl?avatar=<glb>): camera passthrough, animation, movement, and conversation+// with the AI in the user's real room. `live: true` in planArLaunch marks that+// lane; it keeps Android on the launch page (instead of the blind Scene Viewer+// redirect) so the living-agent path is always visible.+//// It is dependency-free and side-effect-free so the routing decision is unit-// tested in isolation, and carries ZERO payment/wallet/coin surface — AR is pure// consumer value and ships on both the Claude and OpenAI tracks.@@ -70,26 +78,42 @@ export function buildViewerUrl(origin, glbUrl, title = '') {return `${base}/viewer?src=${encodeURIComponent(glbUrl)}${t}`;}-/** The device-aware AR launch URL (this endpoint) for a GLB. */-export function buildArLaunchUrl(origin, glbUrl, title = '') {+/** The device-aware AR launch URL (this endpoint) for a GLB. `live` marks a rigged avatar. */+export function buildArLaunchUrl(origin, glbUrl, title = '', { live = false } = {}) {const base = String(origin || 'https://three.ws').replace(/\/$/, '');const t = title ? `&title=${encodeURIComponent(title)}` : '';- return `${base}/api/ar?src=${encodeURIComponent(glbUrl)}${t}`;+ const k = live ? '&kind=avatar' : '';+ return `${base}/api/ar?src=${encodeURIComponent(glbUrl)}${t}${k}`;+}++/**+ * The IRL living-agent URL for an avatar GLB: /irl loads it as the user's agent+ * body: camera AR passthrough, retargeted animation, joystick movement, and+ * conversation. The full digital-to-physical experience, not a frozen placement.+ */+export function buildIrlUrl(origin, glbUrl) {+ const base = String(origin || 'https://three.ws').replace(/\/$/, '');+ return `${base}/irl?avatar=${encodeURIComponent(glbUrl)}`;}/*** Resolve the launch plan for a request. Returns:- * { target, action:'redirect', url } — Android: 302 to Scene Viewer- * { target, action:'page' } — iOS/desktop: serve the launch page- * plus the resolved viewer + scene-viewer URLs for the page/tool to use.+ * { target, action:'redirect', url } Android static model: 302 to Scene Viewer+ * { target, action:'page' } iOS/desktop, and any live avatar+ * plus the resolved viewer + scene-viewer URLs for the page/tool to use, and+ * `irlUrl` when live (a rigged avatar) so the launch surface can offer the+ * walking, talking agent experience alongside static placement.*/-export function planArLaunch({ glbUrl, userAgent, origin, title = '' }) {+export function planArLaunch({ glbUrl, userAgent, origin, title = '', live = false }) {const asset = assertArAssetUrl(glbUrl);const target = detectArTarget(userAgent);const viewerUrl = buildViewerUrl(origin, asset, title);const sceneViewerUrl = buildSceneViewerUrl(asset, { title, fallbackUrl: viewerUrl });- if (target === 'android') {- return { target, action: 'redirect', url: sceneViewerUrl, asset, viewerUrl, sceneViewerUrl };+ const irlUrl = live ? buildIrlUrl(origin, asset) : '';+ // Live avatars always get the launch page: a straight Scene Viewer redirect+ // would place a frozen body and hide the "bring it to life" path entirely.+ if (target === 'android' && !live) {+ return { target, action: 'redirect', url: sceneViewerUrl, asset, viewerUrl, sceneViewerUrl, irlUrl };}- return { target, action: 'page', asset, viewerUrl, sceneViewerUrl };+ return { target, action: 'page', asset, viewerUrl, sceneViewerUrl, irlUrl, live };}diff --git a/api/_mcp-studio/component.js b/api/_mcp-studio/component.jsindex d346a44d6..546a7a100 100644--- a/api/_mcp-studio/component.js+++ b/api/_mcp-studio/component.js@@ -224,7 +224,7 @@ export const COMPONENT_HTML = `<!doctype html>chip.classList.add('active');openEl.href = v.viewerUrl || v.glbUrl;downloadEl.href = v.glbUrl;- if (v.arUrl) { arEl.href = v.arUrl; arEl.classList.remove('hidden'); }+ if (v.arUrl) { arEl.href = v.arUrl; arEl.textContent = 'View in your space'; arEl.classList.remove('hidden'); }if (v.instruction) { promptEl.textContent = v.instruction; promptEl.title = v.instruction; }swapTo(v.glbUrl);});@@ -255,8 +255,14 @@ export const COMPONENT_HTML = `<!doctype html>downloadEl.href = glb;// Device-aware AR launch (/api/ar): the same one-tap "place it in your// home" flow the forge site uses. ChatGPT opens it in the system browser,- // where iPhone enters Quick Look and Android enters Scene Viewer.- if (out.arUrl) { arEl.href = out.arUrl; arEl.classList.remove('hidden'); }+ // where iPhone enters Quick Look and Android enters Scene Viewer. An+ // avatar's launch (irlUrl present) leads with the IRL living experience,+ // so the button says what it does.+ if (out.arUrl) {+ arEl.href = out.arUrl;+ arEl.textContent = isHttps(out.irlUrl) ? 'Bring it to life' : 'View in your space';+ arEl.classList.remove('hidden');+ }else { arEl.classList.add('hidden'); }bar.classList.remove('hidden');renderVersions(out.lineage, glb);diff --git a/api/_mcp-studio/forge-client.js b/api/_mcp-studio/forge-client.jsindex 5b61f43cb..5f11cee8d 100644--- a/api/_mcp-studio/forge-client.js+++ b/api/_mcp-studio/forge-client.js@@ -45,9 +45,20 @@ export function viewerUrl(base, glbUrl) {// Viewer, iOS gets a Quick Look launch page (GLB→USDZ converted in-page), and// desktop falls back to the WebGL viewer. One URL places the model in the// user's real room on any phone — the same lane the /ar and /forge pages use.-export function arLaunchUrl(base, glbUrl, title) {+// `live: true` marks a rigged avatar (an agent's body): the launch page then+// leads with the IRL living handoff instead of static placement.+export function arLaunchUrl(base, glbUrl, title, { live = false } = {}) {const t = typeof title === 'string' && title.trim() ? `&title=${encodeURIComponent(title.trim().slice(0, 80))}` : '';- return `${base}/api/ar?src=${encodeURIComponent(glbUrl)}${t}`;+ const k = live ? '&kind=avatar' : '';+ return `${base}/api/ar?src=${encodeURIComponent(glbUrl)}${t}${k}`;+}++// IRL living-agent link: /irl loads the avatar as an agent body in the user's+// real space: camera passthrough, animation, movement, conversation. This is+// the digital-to-physical bridge for the agent economy; static AR placement is+// the fallback for props, not the destination for avatars.+export function irlUrl(base, glbUrl) {+ return `${base}/irl?avatar=${encodeURIComponent(glbUrl)}`;}function failure(code, message, extra = {}) {diff --git a/api/_mcp-studio/tools.js b/api/_mcp-studio/tools.jsindex 752a7559a..4babfcfc1 100644--- a/api/_mcp-studio/tools.js+++ b/api/_mcp-studio/tools.js@@ -22,6 +22,7 @@ import {originFromReq,viewerUrl,arLaunchUrl,+ irlUrl,generate,rig,directPrompt,@@ -60,8 +61,12 @@ function firstPartyGlbUrl(glbUrl, base) {// the widget + model read; content is the human/agent-readable narration.function ok({ glbUrl, base, kind, prompt, rigged }) {glbUrl = firstPartyGlbUrl(glbUrl, base);+ // An avatar (rigged or humanoid) is an agent's body, not a prop: it also gets+ // the IRL living handoff: walk it, talk to it, camera AR in the real room.+ const live = Boolean(rigged) || kind === 'avatar';const vUrl = viewerUrl(base, glbUrl);- const aUrl = arLaunchUrl(base, glbUrl, prompt);+ const aUrl = arLaunchUrl(base, glbUrl, prompt, { live });+ const iUrl = live ? irlUrl(base, glbUrl) : '';const structured = {kind,glbUrl,@@ -70,6 +75,7 @@ function ok({ glbUrl, base, kind, prompt, rigged }) {format: 'glb',...(prompt ? { prompt } : {}),...(rigged ? { rigged: true } : {}),+ ...(iUrl ? { irlUrl: iUrl } : {}),// Spatial MCP artifact — the open, coin-clean shape for a 3D-native tool// result (specs/SPATIAL_MCP.md). Additive to the fields the widget already// reads, so any Spatial-MCP renderer can display this model, not just ours.@@ -87,9 +93,12 @@ function ok({ glbUrl, base, kind, prompt, rigged }) {content: [{type: 'text',- text:- `Generated a ${label} (GLB). View it: ${structured.viewerUrl}\n` +- `Place it in your room (AR, open on a phone): ${aUrl}\nDownload: ${glbUrl}`,+ text: iUrl+ ? `Generated a ${label} (GLB). View it: ${structured.viewerUrl}\n` ++ `Bring it to life in your real room (it moves and talks through the camera, open on a phone): ${iUrl}\n` ++ `Place a static copy in AR: ${aUrl}\nDownload: ${glbUrl}`+ : `Generated a ${label} (GLB). View it: ${structured.viewerUrl}\n` ++ `Place it in your room (AR, open on a phone): ${aUrl}\nDownload: ${glbUrl}`,},],structuredContent: structured,diff --git a/api/_mcp3d/tools/ar.js b/api/_mcp3d/tools/ar.jsindex 350c166df..e76a2c139 100644--- a/api/_mcp3d/tools/ar.js+++ b/api/_mcp3d/tools/ar.js@@ -15,6 +15,7 @@ import {buildArLaunchUrl,buildViewerUrl,buildSceneViewerUrl,+ buildIrlUrl,} from '../../_lib/ar-launch.js';const DEFAULT_ORIGIN = 'https://three.ws';@@ -40,7 +41,9 @@ export const toolDefs = ['Turn a generated 3D model (GLB URL) into a one-tap "View in your space" AR experience. Returns a ' +'device-aware AR launch link (iOS Quick Look, Android Scene Viewer, desktop WebGL — branched on the ' +"viewer's device), the interactive viewer link, and a conformant Spatial MCP artifact with the AR handoff " +- 'populated. Use it after generating a model so the user can place it on their desk through their phone.',+ 'populated. Use it after generating a model so the user can place it on their desk through their phone. ' ++ 'For a rigged avatar (an agent\'s body) pass kind:"avatar": the response then also carries irlUrl, a ' ++ 'living-agent link that walks, animates, and talks with the user through their camera in their real room.',inputSchema: {type: 'object',additionalProperties: false,@@ -48,6 +51,11 @@ export const toolDefs = [properties: {glb_url: { type: 'string', format: 'uri', description: 'Public https URL of a .glb (or .gltf) model to export for AR.' },title: { type: 'string', maxLength: 120, description: 'Optional name shown in the AR/viewer experience.' },+ kind: {+ type: 'string',+ enum: ['model', 'avatar'],+ description: 'What the GLB is. "avatar" (a rigged agent body) adds the IRL living-agent link (irlUrl) and makes the AR launch page lead with it. Default "model".',+ },},},async handler(args, _auth, req) {@@ -63,13 +71,15 @@ export const toolDefs = [}const origin = originFrom(req);const title = typeof args.title === 'string' ? args.title.slice(0, 120) : '';- const arLaunchUrl = buildArLaunchUrl(origin, asset, title);+ const live = args.kind === 'avatar';+ const arLaunchUrl = buildArLaunchUrl(origin, asset, title, { live });const viewerUrl = buildViewerUrl(origin, asset, title);const sceneViewerUrl = buildSceneViewerUrl(asset, { title, fallbackUrl: viewerUrl });+ const irlUrl = live ? buildIrlUrl(origin, asset) : '';const spatial = buildSpatialArtifact({glbUrl: asset,- kind: 'model',+ kind: live ? 'avatar' : 'model',viewerUrl,title: title || undefined,ar: { glbUrl: asset, launchUrl: arLaunchUrl },@@ -79,7 +89,10 @@ export const toolDefs = [content: [{type: 'text',- text: `Ready for AR. Open on a phone to place it in your space: ${arLaunchUrl}\nInteractive viewer: ${viewerUrl}`,+ text: live+ ? `Ready for AR. Bring it to life in the real room (it moves and talks through the camera, open on a phone): ${irlUrl}\n` ++ `Place a static copy in your space: ${arLaunchUrl}\nInteractive viewer: ${viewerUrl}`+ : `Ready for AR. Open on a phone to place it in your space: ${arLaunchUrl}\nInteractive viewer: ${viewerUrl}`,},],structuredContent: {@@ -87,6 +100,7 @@ export const toolDefs = [arLaunchUrl,viewerUrl,sceneViewerUrl,+ ...(irlUrl ? { irlUrl } : {}),format: 'glb',spatial,},diff --git a/api/_studio/tools.js b/api/_studio/tools.jsindex be24f0469..06d12eadb 100644--- a/api/_studio/tools.js+++ b/api/_studio/tools.js@@ -24,7 +24,7 @@ import {runForgeAvatar,} from '../../mcp-server/src/tools/_studio-core.js';import { renderModelViewerHtml } from '../_mcp/render.js';-import { buildArLaunchUrl } from '../_lib/ar-launch.js';+import { buildArLaunchUrl, buildIrlUrl } from '../_lib/ar-launch.js';// Public origin used to build viewer / pose-studio links in the SANITIZED// response — independent of whichever internal origin the cores call. Always a@@ -35,8 +35,14 @@ const viewerUrl = (glbUrl) => `${PUBLIC_BASE}/viewer?src=${encodeURIComponent(glconst poseUrl = (glbUrl) => `${PUBLIC_BASE}/pose?src=${encodeURIComponent(glbUrl)}`;// Device-aware AR launch (/api/ar): iPhone → Quick Look, Android → Scene// Viewer, desktop → WebGL viewer. The SAME one-tap "place it in your home"-// flow the forge site uses; every generation response carries it.-const arUrl = (glbUrl) => buildArLaunchUrl(PUBLIC_BASE, glbUrl);+// flow the forge site uses; every generation response carries it. `live`+// marks an avatar (an agent's body): the launch page then leads with the+// IRL living handoff instead of static placement.+const arUrl = (glbUrl, live = false) => buildArLaunchUrl(PUBLIC_BASE, glbUrl, '', { live });+// IRL living-agent link: the avatar walks, animates, and talks with the user+// through their camera in their real room. AR here bridges the agent economy+// into physical space; static placement is for props.+const irlUrl = (glbUrl) => buildIrlUrl(PUBLIC_BASE, glbUrl);// Generation annotations (per Apps SDK guidance): these tools mint a fresh// external artifact, so they are writes, non-destructive, non-idempotent, and@@ -51,7 +57,7 @@ const GEN_ANNOTATIONS = {// Build the MCP CallToolResult for a SUCCESSFUL generation. `structured` is the// already-sanitized public payload; `glbUrl` drives the inline 3D artifact and// the human-readable text mirror. The component reads `structuredContent.glbUrl`.-function ok(structured, glbUrl, name) {+function ok(structured, glbUrl, name, { live = false } = {}) {const artifact = {type: 'resource',resource: {@@ -65,7 +71,7 @@ function ok(structured, glbUrl, name) {width: '100%',autoRotate: true,ar: true,- arHref: arUrl(glbUrl),+ arHref: arUrl(glbUrl, live),}),},};@@ -179,11 +185,12 @@ const textToAvatar = {kind: 'avatar',glbUrl: r.glbUrl,viewerUrl: viewerUrl(r.glbUrl),- arUrl: arUrl(r.glbUrl),+ arUrl: arUrl(r.glbUrl, true),+ irlUrl: irlUrl(r.glbUrl),prompt: r.prompt,durationMs: r.durationMs,};- return ok(structured, r.glbUrl, args.prompt || 'avatar');+ return ok(structured, r.glbUrl, args.prompt || 'avatar', { live: true });},};@@ -279,11 +286,12 @@ const rigMesh = {glbUrl: r.riggedGlbUrl,sourceGlbUrl: r.sourceGlbUrl,viewerUrl: viewerUrl(r.riggedGlbUrl),- arUrl: arUrl(r.riggedGlbUrl),+ arUrl: arUrl(r.riggedGlbUrl, true),+ irlUrl: irlUrl(r.riggedGlbUrl),poseStudioUrl: poseUrl(r.riggedGlbUrl),durationMs: r.durationMs,};- return ok(structured, r.riggedGlbUrl, 'rigged model');+ return ok(structured, r.riggedGlbUrl, 'rigged model', { live: true });},};@@ -349,13 +357,14 @@ const forgeAvatar = {glbUrl: r.riggedGlbUrl,meshGlbUrl: r.meshGlbUrl,viewerUrl: viewerUrl(r.riggedGlbUrl),- arUrl: arUrl(r.riggedGlbUrl),+ arUrl: arUrl(r.riggedGlbUrl, true),+ irlUrl: irlUrl(r.riggedGlbUrl),poseStudioUrl: poseUrl(r.riggedGlbUrl),prompt: r.prompt,animationReady: true,durationMs: r.durationMs,};- return ok(structured, r.riggedGlbUrl, args.prompt || 'avatar');+ return ok(structured, r.riggedGlbUrl, args.prompt || 'avatar', { live: true });},};diff --git a/api/ar.js b/api/ar.jsindex 1c3016d89..07e8f1fd5 100644--- a/api/ar.js+++ b/api/ar.js@@ -1,6 +1,6 @@/**- * Device-aware AR launch — GET /api/ar?src=<glbUrl>&title=<name>- * -------------------------------------------------------------+ * Device-aware AR launch: GET /api/ar?src=<glbUrl>&title=<name>&kind=<avatar?>+ * -----------------------------------------------------------------------------* Places a generated GLB in the user's space, branching on the request's* User-Agent (server-side, from the header — no client round-trip):*@@ -12,6 +12,12 @@* • desktop → the same launch page, which falls back to the interactive WebGL* viewer (no AR hardware).*+ * `kind=avatar` marks a LIVE asset (a rigged avatar, an agent's body). AR is how+ * three.ws agents cross into the physical world, so an avatar launch always+ * serves the page (Android included) with a "Bring it to life" handoff into+ * /irl?avatar=<glb>: camera passthrough, animation, movement, and conversation+ * with the AI in the user's real room, alongside the static AR placement.+ ** Bad input (non-https, non-GLB, missing) is rejected at the boundary with a* clean, designed error page — never a crash. Zero payment/coin surface.*/@@ -41,8 +47,8 @@ border-radius:10px;padding:9px 14px;text-decoration:none;font-weight:600;font-si<a href="https://three.ws">Create a 3D model</a></div></body></html>`;}-function launchPage({ target, asset, viewerUrl, title }) {- const t = title ? esc(title) : '3D model';+function launchPage({ target, asset, viewerUrl, title, irlUrl }) {+ const t = title ? esc(title) : irlUrl ? '3D avatar' : '3D model';return `<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"/><title>View ${t} in AR · three.ws</title><meta name="robots" content="noindex"/>@@ -55,6 +61,8 @@ model-viewer{width:100%;height:100%;--progress-bar-color:var(--accent);backgroun.bar{display:flex;gap:10px;align-items:center;justify-content:center;padding:14px 16px;border-top:1px solid rgba(255,255,255,.07);background:rgba(10,11,14,.55);backdrop-filter:blur(8px)}button.ar,a.ar{appearance:none;cursor:pointer;text-decoration:none;font-size:14px;font-weight:700;color:#0b0c10;background:var(--accent);border:0;border-radius:12px;padding:12px 20px;display:inline-flex;align-items:center;gap:8px}button.ar:active{transform:translateY(1px)}button.ar:focus-visible{outline:2px solid #fff;outline-offset:2px}+.ghost{appearance:none;cursor:pointer;text-decoration:none;font-size:14px;font-weight:700;color:var(--accent);background:rgba(110,168,254,.14);border:1px solid rgba(110,168,254,.45);border-radius:12px;padding:11px 18px;display:inline-flex;align-items:center;gap:8px;transition:background .15s ease}+.ghost:hover{background:rgba(110,168,254,.24)}.ghost:active{transform:translateY(1px)}.ghost:focus-visible{outline:2px solid #fff;outline-offset:2px}.hint{position:absolute;left:0;right:0;bottom:16px;text-align:center;color:#9aa3b2;font-size:12px;pointer-events:none}a.alt{color:#aeb6c4;font-size:12.5px;text-decoration:underline}</style></head><body><div class="wrap"><div class="stage">@@ -62,15 +70,15 @@ a.alt{color:#aeb6c4;font-size:12.5px;text-decoration:underline}</style></head>environment-image="neutral" exposure="1.05" shadow-intensity="1" tone-mapping="aces"ar ar-modes="webxr scene-viewer quick-look" ar-scale="auto" ${target === 'ios' ? 'reveal="auto"' : ''}></model-viewer>-<div class="hint" id="hint">Move your phone to place the model in your space.</div>+<div class="hint" id="hint">${irlUrl ? 'This is a living agent. Bring it to life to walk and talk with it in your room.' : 'Move your phone to place the model in your space.'}</div></div><div class="bar">-<button class="ar" id="ar-btn" type="button" aria-label="View this model in augmented reality">📱 View in your space</button>+${irlUrl ? `<a class="ar" href="${esc(irlUrl)}" aria-label="Bring this avatar to life in your room: it moves and talks through your camera">🤖 Bring it to life</a>\n<button class="ghost" id="ar-btn" type="button" aria-label="Place a static copy of this avatar in augmented reality">📱 Place in your space</button>` : `<button class="ar" id="ar-btn" type="button" aria-label="View this model in augmented reality">📱 View in your space</button>`}<a class="alt" href="${esc(viewerUrl)}">Open in 3D viewer</a></div></div><script>-(function(){var mv=document.getElementById('mv'),btn=document.getElementById('ar-btn'),hint=document.getElementById('hint');-function sync(){ if(!mv.canActivateAR){ btn.textContent='View in 3D'; hint.style.display='none'; } }+(function(){var mv=document.getElementById('mv'),btn=document.getElementById('ar-btn'),hint=document.getElementById('hint'),live=${irlUrl ? 'true' : 'false'};+function sync(){ if(!mv.canActivateAR){ btn.textContent='View in 3D'; if(!live){ hint.style.display='none'; } } }mv.addEventListener('load',sync);btn.addEventListener('click',function(){ if(mv.canActivateAR){ try{mv.activateAR();}catch(e){} } else { window.location.href='${esc(viewerUrl)}'; } });})();@@ -83,10 +91,12 @@ export default wrap(async (req, res) => {const url = new URL(req.url, 'http://x');const src = url.searchParams.get('src') || '';const title = (url.searchParams.get('title') || '').slice(0, 120);+ // kind=avatar marks a rigged agent body; it unlocks the IRL living handoff.+ const live = url.searchParams.get('kind') === 'avatar';let plan;try {- plan = planArLaunch({ glbUrl: src, userAgent: req.headers['user-agent'], origin: originFrom(req), title });+ plan = planArLaunch({ glbUrl: src, userAgent: req.headers['user-agent'], origin: originFrom(req), title, live });} catch (err) {res.statusCode = 400;res.setHeader('content-type', 'text/html; charset=utf-8');@@ -105,6 +115,11 @@ export default wrap(async (req, res) => {res.statusCode = 200;res.setHeader('content-type', 'text/html; charset=utf-8');+ // The page is UA-branched (iOS Quick Look vs desktop fallback) while Android+ // gets a 302 above — without Vary a CDN-cached desktop page can be served to+ // an Android phone and swallow the straight-into-AR redirect. Vary keeps the+ // browser cache (one UA per browser) and stops the cross-device bleed.+ res.setHeader('vary', 'user-agent');res.setHeader('cache-control', 'public, max-age=60, s-maxage=600');- res.end(launchPage({ target: plan.target, asset: plan.asset, viewerUrl: plan.viewerUrl, title }));+ res.end(launchPage({ target: plan.target, asset: plan.asset, viewerUrl: plan.viewerUrl, title, irlUrl: plan.irlUrl }));});diff --git a/data/changelog.json b/data/changelog.jsonindex 727251000..c3bc8b58e 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,16 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-15",+ "title": "AR avatars now come alive in your room",+ "summary": "Avatars no longer land in AR as frozen statues. Every rigged avatar generated on three.ws now carries a Bring it to life link that opens IRL: the agent walks, animates, and talks with you through your camera, standing in your real space. Static placement is still one tap away for props or anyone who just wants the model on a desk. The living link ships everywhere avatars are made: the AR launch page, the 3D Studio tools in ChatGPT and Claude, and the developer MCP tools.",+ "tags": [+ "feature",+ "improvement"+ ],+ "link": "/irl"+ },{"date": "2026-07-14","title": "ChatGPT generations now place straight into your room",diff --git a/docs/ar.md b/docs/ar.mdindex 18ce198f8..5fb7f994f 100644--- a/docs/ar.md+++ b/docs/ar.md@@ -413,6 +413,7 @@ Any generated model (or any public https `.glb`/`.gltf`) gets a device-aware "Vi```https://three.ws/api/ar?src=<glbUrl>&title=<name>+https://three.ws/api/ar?src=<glbUrl>&title=<name>&kind=avatar // living agent```The endpoint branches on the request's **User-Agent**, server-side:@@ -423,6 +424,8 @@ The endpoint branches on the request's **User-Agent**, server-side:| **Android** | `302` → Google **Scene Viewer** ARCore intent (the GLB is the source), with a browser fallback to the WebGL viewer. || **Desktop** | Launch page → interactive **WebGL** viewer (no AR hardware). |+**`kind=avatar`: the living-agent lane.** AR on three.ws is not a prop viewer; it is how agents cross into physical space. When the GLB is a rigged avatar (an agent's body), add `kind=avatar`: the launch page then leads with a **Bring it to life** handoff into [`/irl?avatar=<glbUrl>`](/irl), where the avatar walks, animates, and talks with the user through their camera in their real room. Static placement stays available alongside it, and Android serves the launch page instead of the blind Scene Viewer redirect so the living path is always visible.+Bad input (non-https, non-GLB, missing) returns a clean, designed error page — never a crash.**For agents (MCP):** the free, read-only `export_ar` tool on the [3D Studio server](/docs/mcp) turns a GLB into the AR launch link plus a conformant [Spatial MCP](/docs/spatial-mcp) artifact (with the `ar` handoff populated):@@ -430,8 +433,14 @@ Bad input (non-https, non-GLB, missing) returns a clean, designed error page —```jsonc// tools/call → export_ar { "glb_url": "https://three.ws/cdn/creations/model.glb", "title": "Robot" }// → { arLaunchUrl: "https://three.ws/api/ar?src=…", viewerUrl: "…", sceneViewerUrl: "intent://…", spatial: { … } }++// Rigged avatar? Pass kind:"avatar" to also get the living-agent link:+// tools/call → export_ar { "glb_url": "…/scout.glb", "title": "Scout", "kind": "avatar" }+// → { arLaunchUrl: "…&kind=avatar", irlUrl: "https://three.ws/irl?avatar=…", … }```+The avatar-producing studio tools (`text_to_avatar`, `rig_mesh`, `forge_avatar`) return `irlUrl` automatically, on both the free and paid tracks.+The response carries no payment, wallet, token, or internal-id surface, so it ships on both the Claude and OpenAI tracks.---diff --git a/pages/ar.html b/pages/ar.htmlindex 2812ea252..59d9a83db 100644--- a/pages/ar.html+++ b/pages/ar.html@@ -331,6 +331,50 @@flex-shrink: 0;}+ /* Living-agent handoff: the avatar walks and talks in your room on /irl. */+ .ar-live-btn {+ width: 100%;+ max-width: 380px;+ height: 52px;+ margin-top: 10px;+ background: rgba(255, 255, 255, 0.08);+ color: #ffffff;+ border: 1px solid rgba(255, 255, 255, 0.22);+ border-radius: 16px;+ font-family: 'Space Grotesk', system-ui, sans-serif;+ font-size: 15.5px;+ font-weight: 700;+ letter-spacing: -0.01em;+ cursor: pointer;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 9px;+ text-decoration: none;+ transition:+ transform 0.12s,+ background 0.2s,+ border-color 0.2s;+ }+ .ar-live-btn:hover {+ transform: translateY(-2px);+ background: rgba(255, 255, 255, 0.14);+ border-color: rgba(255, 255, 255, 0.34);+ }+ .ar-live-btn:active {+ transform: translateY(0);+ }+ .ar-live-btn:focus-visible {+ outline: 2px solid #ffffff;+ outline-offset: 2px;+ }+ .ar-live-btn[hidden] {+ display: none;+ }+ .ar-live-btn svg {+ flex-shrink: 0;+ }+/* ── Footer links ─────────────────────────────── */.ar-footer-links {display: flex;@@ -444,6 +488,31 @@</svg>Place in your space</button>+ <a+ class="ar-live-btn"+ id="ar-live-link"+ href="/irl"+ aria-label="Bring this avatar to life: it walks and talks with you through your camera"+ hidden+ >+ <svg+ width="19"+ height="19"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <circle cx="12" cy="5" r="3" />+ <path d="M12 8v6" />+ <path d="M9 22l3-8 3 8" />+ <path d="M8 12h8" />+ </svg>+ Bring it to life+ </a><div class="ar-footer-links"><a href="/features/ar" class="ar-footer-link">AR feature overview</a><span class="ar-footer-sep" aria-hidden="true">·</span>diff --git a/public/ar-forge.html b/public/ar-forge.htmlindex d90a43d66..26affab0a 100644--- a/public/ar-forge.html+++ b/public/ar-forge.html@@ -225,7 +225,8 @@<footer class="foot">Free lane, fair-use rate limited · Models are meshopt-compressed glTF binaries ·- <a href="/forge">Forge studio</a> · <a href="/viewer">GLB viewer</a> · <a href="/features/ar">How AR works</a>+ <a href="/forge">Forge studio</a> · <a href="/viewer">GLB viewer</a> · <a href="/features/ar">How AR works</a> ·+ <a href="/irl">Living agents in AR</a></footer><script>diff --git a/public/changelog.json b/public/changelog.jsonindex 4cec85731..787502280 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,11 +1,22 @@{- "generated_at": "2026-07-14T23:51:46.820Z",+ "generated_at": "2026-07-15T00:05:54.372Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},"entries": [+ {+ "date": "2026-07-15",+ "type": "update",+ "title": "AR avatars now come alive in your room",+ "summary": "Avatars no longer land in AR as frozen statues. Every rigged avatar generated on three.ws now carries a Bring it to life link that opens IRL: the agent walks, animates, and talks with you through your camera, standing in your real space. Static placement is still one tap away for props or anyone who just wants the model on a desk. The living link ships everywhere avatars are made: the AR launch page, the 3D Studio tools in ChatGPT and Claude, and the developer MCP tools.",+ "link": "/irl",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-07-14","type": "launch",diff --git a/public/changelog.xml b/public/changelog.xmlindex 0c49fb028..ce7e57f4f 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -6,6 +6,14 @@<atom:link href="https://three.ws/changelog.xml" rel="self" type="application/rss+xml"/><description>What's new on three.ws — features, improvements, and releases, newest first.</description><language>en</language>+ <item>+ <title>AR avatars now come alive in your room</title>+ <link>https://three.ws/irl</link>+ <guid isPermaLink="false">2026-07-15:AR avatars now come alive in your room</guid>+ <pubDate>Wed, 15 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Avatars no longer land in AR as frozen statues. Every rigged avatar generated on three.ws now carries a Bring it to life link that opens IRL: the agent walks, animates, and talks with you through your camera, standing in your real space. Static placement is still one tap away for props or anyone who just wants the model on a desk. The living link ships everywhere avatars are made: the AR launch page, the 3D Studio tools in ChatGPT and Claude, and the developer MCP tools.</description>+ </item><item><title>AR Forge</title><link>https://three.ws/ar</link>diff --git a/public/features.json b/public/features.jsonindex 074be100f..0d10f9f9a 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-14T23:51:46.807Z",+ "generated_at": "2026-07-15T00:05:54.359Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/ar-page.js b/src/ar-page.jsindex c1145dca4..2e3f89dc3 100644--- a/src/ar-page.js+++ b/src/ar-page.js@@ -77,6 +77,14 @@ function renderPage(avatar, glbUrl) {const id = avatar.id || avatarId;$('ar-back-link').href = `/avatars/${encodeURIComponent(id)}`;+ // Living-agent handoff: /irl loads this avatar as the agent's body in the+ // user's real space (camera passthrough, animation, conversation). Static+ // placement is one option; alive is the point.+ const liveLink = $('ar-live-link');+ if (liveLink) {+ liveLink.href = `/irl?avatar=${encodeURIComponent(id)}`;+ liveLink.hidden = false;+ }mountViewSwitcher($('view-switch-slot'), { kind: 'avatar', id, active: 'ar' });$('ar-share-btn').addEventListener('click', () => shareAvatar(avatar));diff --git a/tests/ar-export.test.js b/tests/ar-export.test.jsindex 72413a349..39c2f54f1 100644--- a/tests/ar-export.test.js+++ b/tests/ar-export.test.js@@ -6,6 +6,7 @@ import {buildSceneViewerUrl,buildViewerUrl,buildArLaunchUrl,+ buildIrlUrl,planArLaunch,} from '../api/_lib/ar-launch.js';import { toolDefs as arDefs } from '../api/_mcp3d/tools/ar.js';@@ -78,6 +79,52 @@ describe('planArLaunch — device routing', () => {});});+describe('GET /api/ar — response caching is UA-safe', () => {+ function makeReq(ua) {+ return {+ method: 'GET',+ url: `/api/ar?src=${encodeURIComponent(GLB)}&title=Robot`,+ headers: { 'user-agent': ua, host: 'three.ws' },+ };+ }+ function makeRes() {+ return {+ statusCode: 200,+ _h: {},+ writableEnded: false,+ headersSent: false,+ setHeader(k, v) {+ this._h[k.toLowerCase()] = v;+ },+ getHeader(k) {+ return this._h[k.toLowerCase()];+ },+ end(body) {+ this._body = body;+ this.writableEnded = true;+ },+ };+ }++ it('the launch page varies on User-Agent so a CDN never serves a desktop page to a phone', async () => {+ const { default: handler } = await import('../api/ar.js');+ const res = makeRes();+ await handler(makeReq(IOS), res);+ expect(res.statusCode).toBe(200);+ expect(res.getHeader('vary')).toMatch(/user-agent/i);+ expect(res.getHeader('cache-control')).toContain('public');+ });++ it('the Android Scene Viewer redirect stays uncached (no-store)', async () => {+ const { default: handler } = await import('../api/ar.js');+ const res = makeRes();+ await handler(makeReq(ANDROID), res);+ expect(res.statusCode).toBe(302);+ expect(res.getHeader('location')).toContain('scene-viewer');+ expect(res.getHeader('cache-control')).toBe('no-store');+ });+});+describe('buildViewerUrl / buildArLaunchUrl', () => {it('build https viewer and AR launch URLs', () => {expect(buildViewerUrl('https://three.ws', GLB)).toBe(`https://three.ws/viewer?src=${encodeURIComponent(GLB)}`);@@ -119,4 +166,108 @@ describe('export_ar MCP tool', () => {const FORBIDDEN = /x402|payment|wallet|usdc|\$three|\btoken\b|\bcoin\b|price|\bpaid\b|onchain|web3|mint|session|trace|job_id|creation_id/i;expect(FORBIDDEN.test(JSON.stringify(r))).toBe(false);});++ it('kind:"avatar" adds the IRL living-agent link and marks the launch as live', async () => {+ const r = await tool.handler({ glb_url: GLB, title: 'Scout', kind: 'avatar' }, null, req);+ const sc = r.structuredContent;+ expect(sc.irlUrl).toBe(`https://three.ws/irl?avatar=${encodeURIComponent(GLB)}`);+ expect(sc.arLaunchUrl).toContain('kind=avatar');+ expect(sc.spatial.kind).toBe('avatar');+ expect(validateSpatialArtifact(sc.spatial).valid).toBe(true);+ // The narration leads with the living experience, not the static placement.+ expect(r.content[0].text).toContain(sc.irlUrl);+ });++ it('plain models stay static: no irlUrl, no live flag on the launch link', async () => {+ const r = await tool.handler({ glb_url: GLB }, null, req);+ expect(r.structuredContent.irlUrl).toBeUndefined();+ expect(r.structuredContent.arLaunchUrl).not.toContain('kind=avatar');+ });+});++describe('live (avatar) AR lane: the agent-economy bridge into physical space', () => {+ it('buildIrlUrl builds the /irl living handoff for a GLB', () => {+ expect(buildIrlUrl('https://three.ws', GLB)).toBe(`https://three.ws/irl?avatar=${encodeURIComponent(GLB)}`);+ expect(buildIrlUrl('https://three.ws/', GLB)).toBe(`https://three.ws/irl?avatar=${encodeURIComponent(GLB)}`);+ });++ it('buildArLaunchUrl marks live launches with kind=avatar', () => {+ expect(buildArLaunchUrl('https://three.ws', GLB, '', { live: true })).toContain('&kind=avatar');+ expect(buildArLaunchUrl('https://three.ws', GLB)).not.toContain('kind=avatar');+ });++ it('planArLaunch live: Android gets the page (never a blind Scene Viewer redirect), with irlUrl', () => {+ const p = planArLaunch({ glbUrl: GLB, userAgent: ANDROID, origin: 'https://three.ws', live: true });+ expect(p.action).toBe('page');+ expect(p.irlUrl).toContain('/irl?avatar=');+ });++ it('planArLaunch live: iOS and desktop carry irlUrl on the page plan', () => {+ for (const ua of [IOS, DESKTOP]) {+ const p = planArLaunch({ glbUrl: GLB, userAgent: ua, origin: 'https://three.ws', live: true });+ expect(p.action).toBe('page');+ expect(p.irlUrl).toContain('/irl?avatar=');+ }+ });++ it('planArLaunch static: Android redirect unchanged, no irlUrl anywhere', () => {+ const android = planArLaunch({ glbUrl: GLB, userAgent: ANDROID, origin: 'https://three.ws' });+ expect(android.action).toBe('redirect');+ expect(android.irlUrl).toBe('');+ const ios = planArLaunch({ glbUrl: GLB, userAgent: IOS, origin: 'https://three.ws' });+ expect(ios.irlUrl).toBe('');+ });+});++describe('GET /api/ar?kind=avatar: living-agent launch page', () => {+ function makeReq(ua, extra = '') {+ return {+ method: 'GET',+ url: `/api/ar?src=${encodeURIComponent(GLB)}&title=Scout${extra}`,+ headers: { 'user-agent': ua, host: 'three.ws' },+ };+ }+ function makeRes() {+ return {+ statusCode: 200,+ _h: {},+ writableEnded: false,+ headersSent: false,+ setHeader(k, v) {+ this._h[k.toLowerCase()] = v;+ },+ getHeader(k) {+ return this._h[k.toLowerCase()];+ },+ end(body) {+ this._body = body;+ this.writableEnded = true;+ },+ };+ }++ it('an avatar launch serves the page on Android with the Bring-it-to-life handoff', async () => {+ const { default: handler } = await import('../api/ar.js');+ const res = makeRes();+ await handler(makeReq(ANDROID, '&kind=avatar'), res);+ expect(res.statusCode).toBe(200);+ expect(res._body).toContain('Bring it to life');+ expect(res._body).toContain('/irl?avatar=');+ });++ it('an avatar launch on iOS offers both the living handoff and static placement', async () => {+ const { default: handler } = await import('../api/ar.js');+ const res = makeRes();+ await handler(makeReq(IOS, '&kind=avatar'), res);+ expect(res._body).toContain('Bring it to life');+ expect(res._body).toContain('Place in your space');+ });++ it('a static model launch page has no living-agent surface', async () => {+ const { default: handler } = await import('../api/ar.js');+ const res = makeRes();+ await handler(makeReq(IOS), res);+ expect(res._body).not.toContain('Bring it to life');+ expect(res._body).not.toContain('/irl?avatar=');+ });});diff --git a/tests/fixtures/mcp-golden-tools.json b/tests/fixtures/mcp-golden-tools.jsonindex 15d5fbf59..c767a6a11 100644--- a/tests/fixtures/mcp-golden-tools.json+++ b/tests/fixtures/mcp-golden-tools.json@@ -14,7 +14,7 @@"descHead": "dynamic","descHash": "dynamic","annotations": "ref:GEN_ANNOTATIONS",- "schemaHash": "324b0832b9e2"+ "schemaHash": "c515ce38f402"},{"name": "mesh_forge",@@ -500,7 +500,7 @@"idempotentHint": true,"openWorldHint": false},- "schemaHash": "e5d96ef9555d"+ "schemaHash": "4f88431f681a"}],"api/_mcp3d/tools/persona-identity.js": [diff --git a/tests/mcp-studio.test.js b/tests/mcp-studio.test.jsindex 2a87121a5..ca8ed057d 100644--- a/tests/mcp-studio.test.js+++ b/tests/mcp-studio.test.js@@ -200,6 +200,32 @@ describe('mcp-studio dispatch', () => {expect(serialized).not.toContain('creation_id');});+ it('avatar results carry the IRL living-agent handoff; props stay static (AR bridges agents into the real world)', async () => {+ globalThis.fetch = vi.fn(async () => ({+ ok: true,+ status: 200,+ json: async () => ({ status: 'done', glb_url: 'https://three.ws/cdn/creations/scout.glb' }),+ }));+ const avatar = await dispatch(+ { jsonrpc: '2.0', id: 63, method: 'tools/call', params: { name: 'text_to_avatar', arguments: { prompt: 'a friendly robot scout' } } },+ auth,+ mkReq(),+ );+ const sc = avatar.result.structuredContent;+ expect(sc.irlUrl).toBe(`https://three.ws/irl?avatar=${encodeURIComponent('https://three.ws/cdn/creations/scout.glb')}`);+ expect(sc.arUrl).toContain('kind=avatar');+ // The narration offers the living experience, not just static placement.+ expect(avatar.result.content[0].text).toContain(sc.irlUrl);++ const model = await dispatch(+ { jsonrpc: '2.0', id: 64, method: 'tools/call', params: { name: 'forge_free', arguments: { prompt: 'a ceramic vase' } } },+ auth,+ mkReq(),+ );+ expect(model.result.structuredContent.irlUrl).toBeUndefined();+ expect(model.result.structuredContent.arUrl).not.toContain('kind=avatar');+ });+it('rewrites bucket-domain GLB URLs to the first-party /cdn proxy (sandboxed widgets need open CORS)', async () => {// The public r2.dev domain only answers CORS for our own origin; ChatGPT's// widget iframe is cross-origin, so tool results must carry the /cdn form.