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.

feat: agent demos, ERC-8004 eyebrow, /agent/new route, branding allowlist

overstepping718f69b3f7be
diff --git a/public/demos/3d-home.html b/public/demos/3d-home.html
index e8838c834..54b02e00e 100644
--- a/public/demos/3d-home.html
+++ b/public/demos/3d-home.html
@@ -332,7 +332,7 @@
// so the butt — not the feet — rests on the text line. Tuned to the
// sitidle pose where legs dangle below the hips.
const FEET_OFFSET_PX = 0;
- const SIT_OFFSET_PX = 140;
+ const SIT_OFFSET_PX = 120;
function smoothstep(t) { return t * t * (3 - 2 * t); }
diff --git a/public/demos/404.html b/public/demos/404.html
new file mode 100644
index 000000000..e2ff12551
--- /dev/null
+++ b/public/demos/404.html
@@ -0,0 +1,468 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>three.ws — 404</title>
+ <meta name="robots" content="noindex" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <style>
+ :root { color-scheme: dark; }
+ *, *::before, *::after { box-sizing: border-box; }
+ html, body { height: 100%; margin: 0; background: #04050d; color: #eee; font: 15px/1.5 'Inter', -apple-system, system-ui, sans-serif; overflow: hidden; }
+
+ #avatar-canvas {
+ position: fixed; inset: 0;
+ width: 100vw; height: 100vh;
+ pointer-events: none; z-index: 999;
+ }
+
+ .nav {
+ position: fixed; top: 0; left: 0; right: 0; z-index: 20;
+ display: flex; align-items: center; gap: 16px; padding: 14px 28px;
+ background: rgba(4,5,13,0.55); backdrop-filter: blur(14px);
+ border-bottom: 1px solid rgba(255,255,255,0.04);
+ }
+ .nav .brand { font: 700 15px/1 'Space Grotesk','Inter',sans-serif; color:#fff; text-decoration:none; display:flex; align-items:center; gap:7px; }
+ .brand-dot { width:8px; height:8px; border-radius:50%; background:linear-gradient(135deg,#d6ff3d,#aacc00); box-shadow:0 0 10px rgba(214,255,61,0.6); }
+ .nav a.link { color:#555870; text-decoration:none; font-size:13px; margin-left:auto; }
+ .nav a.link:hover { color:#d6ff3d; }
+
+ .stage {
+ min-height: 100vh;
+ display: flex; flex-direction: column; align-items: center; justify-content: center;
+ gap: 28px; padding: 100px 24px 60px;
+ text-align: center;
+ }
+ .eyebrow {
+ display: inline-flex; align-items: center; gap: 9px;
+ font-size: 11px; font-weight: 600;
+ letter-spacing: 0.17em; text-transform: uppercase;
+ color: #d6ff3d;
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ }
+ .eyebrow-dot {
+ width: 7px; height: 7px; border-radius: 50%;
+ background: #d6ff3d; box-shadow: 0 0 8px rgba(214,255,61,0.7);
+ animation: blink 2.2s ease-in-out infinite;
+ }
+ @keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }
+
+ .bignum {
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ font-weight: 800; letter-spacing: -0.06em;
+ font-size: clamp(140px, 28vw, 320px);
+ line-height: 0.85;
+ margin: 0;
+ color: #fff;
+ /* JS drives --agent-shadow as the avatar lands on the digits */
+ text-shadow: var(--agent-shadow, none);
+ transition: text-shadow 90ms linear;
+ user-select: none;
+ }
+ .bignum em { color: #d6ff3d; font-style: normal; }
+
+ .line {
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ font-size: clamp(20px, 2.4vw, 28px); font-weight: 700;
+ margin: 0; color: #fff; letter-spacing: -0.015em;
+ }
+ .sub { color: #6b6e88; max-width: 44ch; margin: 0; font-size: 15px; }
+
+ .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
+ .btn {
+ display: inline-flex; align-items: center; gap: 10px;
+ padding: 14px 26px; border: none; border-radius: 12px;
+ font: 700 14.5px/1 'Inter', inherit; cursor: pointer; text-decoration: none;
+ user-select: none;
+ transform-origin: bottom center;
+ will-change: transform;
+ }
+ .btn-primary {
+ background: linear-gradient(160deg, #e2ff5a, #c8ef2c);
+ color: #0a0b0f;
+ box-shadow: 0 7px 0 0 #7a9600, 0 9px 24px rgba(214,255,61,0.25);
+ }
+ .btn-primary:hover { filter: brightness(1.07); }
+ .btn-ghost {
+ background: rgba(255,255,255,0.05); color: #bbb;
+ border: 1.5px solid rgba(255,255,255,0.1);
+ box-shadow: 0 4px 0 0 rgba(255,255,255,0.04);
+ }
+ .btn-ghost:hover { color: #fff; border-color: rgba(214,255,61,0.4); }
+
+ .hint {
+ position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
+ z-index: 15; color: #4a4d63; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="nav">
+ <a href="/" class="brand">
+ <img src="/three.svg" width="20" height="20" alt="" />
+ <span class="brand-dot"></span>
+ three.ws
+ </a>
+ <a href="/demos/" class="link">← lab</a>
+ </div>
+
+ <div class="stage">
+ <div class="eyebrow"><span class="eyebrow-dot"></span><span>Lost in 3D</span></div>
+ <h1 class="bignum" id="bignum"><span id="four-a">4</span><em id="zero">0</em><span id="four-b">4</span></h1>
+ <p class="line" id="lost-line">Your agent took a wrong turn.</p>
+ <p class="sub">This page does not exist on three.ws — but she landed here, looked around, and seems pretty confused. Send her home.</p>
+ <div class="actions">
+ <a href="/" class="btn btn-primary" id="home-btn">
+ <span>Take her home</span>
+ <span>→</span>
+ </a>
+ <a href="/demos/" class="btn btn-ghost" id="lab-btn">
+ <span>Back to lab</span>
+ </a>
+ </div>
+ </div>
+
+ <canvas id="avatar-canvas"></canvas>
+
+ <script type="module">
+ import * as THREE from 'three';
+ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+ import { gsap } from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';
+
+ const canvas = document.getElementById('avatar-canvas');
+ const bignum = document.getElementById('bignum');
+ const zero = document.getElementById('zero');
+ const homeBtn = document.getElementById('home-btn');
+ const labBtn = document.getElementById('lab-btn');
+
+ // ── Renderer ───────────────────────────────────────────────────────
+ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });
+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
+ renderer.outputColorSpace = THREE.SRGBColorSpace;
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
+ renderer.toneMappingExposure = 1.1;
+
+ const scene = new THREE.Scene();
+
+ // Orthographic — 1 world unit = PX_PER_UNIT screen pixels
+ const PX_PER_UNIT = 120;
+ const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0.1, 100);
+ camera.position.z = 10;
+
+ function updateFrustum() {
+ const hw = window.innerWidth / PX_PER_UNIT / 2;
+ const hh = window.innerHeight / PX_PER_UNIT / 2;
+ camera.left = -hw; camera.right = hw;
+ camera.top = hh; camera.bottom = -hh;
+ camera.updateProjectionMatrix();
+ }
+
+ const _v3 = new THREE.Vector3();
+ function domToWorld(sx, sy) {
+ _v3.set((sx / window.innerWidth) * 2 - 1, -(sy / window.innerHeight) * 2 + 1, 0);
+ _v3.unproject(camera);
+ return { x: _v3.x, y: _v3.y };
+ }
+ function resize() {
+ renderer.setSize(window.innerWidth, window.innerHeight, false);
+ updateFrustum();
+ recalibrateLandSpot();
+ }
+ window.addEventListener('resize', resize);
+ resize();
+
+ // Lights
+ scene.add(new THREE.AmbientLight(0xffffff, 0.6));
+ const key = new THREE.DirectionalLight(0xfff4dc, 2.0); key.position.set(3, 6, 5); scene.add(key);
+ const rim = new THREE.DirectionalLight(0x4060ff, 0.6); rim.position.set(-4, 3, -2); scene.add(rim);
+ const fill = new THREE.DirectionalLight(0xffeedd, 0.4); fill.position.set(0, 2, 7); scene.add(fill);
+
+ // ── Avatar runtime ────────────────────────────────────────────────
+ let avatar = null, mixer = null, rootBone = null, baseRootPos = null;
+ const actions = {};
+ let currentAction = null;
+ const FADE_S = 0.3;
+
+ function setAnimation(name, { loop = true, hold = false } = {}) {
+ const next = actions[name];
+ if (!next || next === currentAction) return;
+ next.reset();
+ next.setLoop(loop ? THREE.LoopRepeat : THREE.LoopOnce, loop ? Infinity : 1);
+ next.clampWhenFinished = hold;
+ if (currentAction) next.crossFadeFrom(currentAction, FADE_S, false).play();
+ else next.fadeIn(FADE_S).play();
+ currentAction = next;
+ }
+
+ // ── Phase state ───────────────────────────────────────────────────
+ // fallingIn — drop from above the viewport onto the "0"
+ // confused — idle/look-around on the digit
+ // runningOff — walk-cycle slide toward whichever edge the user clicked
+ let phase = 'loading';
+ let landed = false;
+ let fallT = 0;
+ const FALL_S = 1.4;
+ let fallStartW = { x: 0, y: 0 };
+ let fallTargetW = { x: 0, y: 0 };
+ const SIT_OFFSET_PX = 140; // butt-sit offset for cz.glb (same as 3d-home)
+ const LANDING_OFFSET_PX = 90; // standing slightly above the "0" baseline
+
+ function getZeroLandWorld() {
+ const r = zero.getBoundingClientRect();
+ // Center horizontally on the "0", land just above its visual top
+ return domToWorld(r.left + r.width / 2, r.top + LANDING_OFFSET_PX);
+ }
+
+ function getFallStartWorld() {
+ const r = zero.getBoundingClientRect();
+ // Start 1.5× viewport heights above the target — guarantees the avatar
+ // is off-screen no matter the window size
+ return domToWorld(r.left + r.width / 2, -window.innerHeight * 0.6);
+ }
+
+ function recalibrateLandSpot() {
+ if (!avatar || phase !== 'confused') return;
+ const t = getZeroLandWorld();
+ gsap.to(avatar.position, { x: t.x, y: t.y, duration: 0.35, overwrite: true });
+ }
+
+ // Re-anchor when text reflows (font load, viewport changes)
+ const ro = new ResizeObserver(() => recalibrateLandSpot());
+ ro.observe(zero);
+
+ function smoothstep(t) { return t * t * (3 - 2 * t); }
+
+ // ── Falling sequence ─────────────────────────────────────────────
+ function startFall() {
+ phase = 'fallingIn';
+ fallStartW = getFallStartWorld();
+ fallTargetW = getZeroLandWorld();
+ avatar.position.set(fallStartW.x, fallStartW.y, 0);
+ avatar.rotation.set(0, 0, 0);
+ fallT = 0; landed = false;
+ setAnimation('falling', { loop: true });
+ }
+
+ function fireLandingDust() {
+ // Splash of debris on impact — same ballistic feel as 3d-home but
+ // neutral grey so it reads as "kicked-up dust" instead of paint.
+ const r = zero.getBoundingClientRect();
+ const ox = r.left + r.width / 2;
+ const oy = r.top + r.height * 0.78;
+ const GRAVITY = 1400, COUNT = 16;
+ const drops = [];
+ for (let i = 0; i < COUNT; i++) {
+ const size = 4 + Math.random() * 6;
+ const el = document.createElement('div');
+ el.style.cssText =
+ `position:fixed;left:${ox - size/2}px;top:${oy - size/2}px;` +
+ `width:${size}px;height:${size}px;border-radius:50%;` +
+ `background:radial-gradient(circle at 35% 30%,#cfd2dd,#7a7d8e 60%,#3c3e4c);` +
+ `box-shadow:0 0 5px rgba(255,255,255,0.18);` +
+ `pointer-events:none;z-index:30;will-change:transform,opacity;`;
+ document.body.appendChild(el);
+ const angle = -Math.PI / 2 + (Math.random() - 0.5) * Math.PI * 1.3;
+ const speed = 180 + Math.random() * 280;
+ drops.push({
+ el, x: 0, y: 0,
+ vx: Math.cos(angle) * speed,
+ vy: Math.sin(angle) * speed,
+ life: 0,
+ max: 0.7 + Math.random() * 0.4,
+ });
+ }
+ let last = performance.now();
+ (function step(now) {
+ const dt = Math.min((now - last) / 1000, 0.04); last = now;
+ let alive = false;
+ for (const d of drops) {
+ if (!d.el) continue;
+ d.life += dt;
+ d.vy += GRAVITY * dt;
+ d.x += d.vx * dt; d.y += d.vy * dt;
+ const t = d.life / d.max;
+ if (t >= 1) { d.el.remove(); d.el = null; continue; }
+ d.el.style.opacity = String(1 - t * t);
+ d.el.style.transform = `translate(${d.x.toFixed(1)}px,${d.y.toFixed(1)}px)`;
+ alive = true;
+ }
+ if (alive) requestAnimationFrame(step);
+ })(last);
+ }
+
+ function fireImpactPulse() {
+ // Brief CSS scale-pulse on the "0" — sells the weight of the landing
+ gsap.killTweensOf(zero);
+ gsap.fromTo(zero,
+ { y: 0 },
+ { y: 4, duration: 0.08, ease: 'power3.out',
+ onComplete: () => gsap.to(zero, { y: 0, duration: 0.5, ease: 'elastic.out(1.2, 0.4)' })
+ });
+ }
+
+ function startConfused() {
+ phase = 'confused';
+ landed = true;
+ const t = getZeroLandWorld();
+ avatar.position.set(t.x, t.y, 0);
+ // Crossfade fall → falltolanding → idle for a clean settle
+ setAnimation('falltolanding', { loop: false, hold: true });
+ setTimeout(() => {
+ if (phase === 'confused') setAnimation('idle', { loop: true });
+ }, 900);
+ // Gentle head-turn loop — feels like "looking around lost"
+ lookAroundLoop();
+ }
+
+ let lookRAF = null, lookT0 = 0;
+ function lookAroundLoop() {
+ cancelAnimationFrame(lookRAF);
+ lookT0 = performance.now();
+ (function tick(now) {
+ if (phase !== 'confused') return;
+ const t = (now - lookT0) / 1000;
+ // Slow sinusoidal yaw — ±20° over ~5s
+ avatar.rotation.y = Math.sin(t * 1.25) * 0.35;
+ lookRAF = requestAnimationFrame(tick);
+ })(performance.now());
+ }
+
+ function stopLooking() {
+ cancelAnimationFrame(lookRAF);
+ lookRAF = null;
+ }
+
+ function startRunOff(direction = 'right') {
+ if (phase === 'runningOff') return;
+ phase = 'runningOff';
+ stopLooking();
+ setAnimation('walk', { loop: true });
+ const dir = direction === 'left' ? -1 : 1;
+ gsap.to(avatar.rotation, { y: dir * Math.PI * 0.5, duration: 0.3, overwrite: true });
+ // Slide to off-screen world-X. PX_PER_UNIT keeps the math obvious.
+ const targetWorldX = (window.innerWidth / PX_PER_UNIT) * 0.7 * dir;
+ const cur = avatar.position;
+ const distancePx = Math.abs(targetWorldX - cur.x) * PX_PER_UNIT;
+ const ms = Math.max(900, distancePx * 2.2);
+ gsap.to(cur, { x: targetWorldX, duration: ms / 1000, ease: 'power1.in' });
+ }
+
+ // ── Intercept the "Take her home" click ──────────────────────────
+ // Don't navigate immediately — let the agent run off-screen first,
+ // THEN go to the destination. Feels intentional, not glitchy.
+ function interceptNav(btn, dir) {
+ btn.addEventListener('click', e => {
+ if (phase === 'runningOff') return; // already mid-exit; let it land
+ e.preventDefault();
+ const href = btn.getAttribute('href');
+ startRunOff(dir);
+ setTimeout(() => { window.location.href = href; }, 1100);
+ });
+ }
+ interceptNav(homeBtn, 'right');
+ interceptNav(labBtn, 'left');
+
+ // ── Proximity shadow on the "0" (matches 3d-home pattern) ────────
+ const _proj = new THREE.Vector3();
+ function avatarScreenY() {
+ _proj.set(avatar.position.x, avatar.position.y, 0).project(camera);
+ return (1 - _proj.y) * 0.5 * window.innerHeight;
+ }
+ function updateProximityShadow() {
+ if (!avatar) return;
+ const r = zero.getBoundingClientRect();
+ const ay = avatarScreenY();
+ const dy = Math.max(0, r.top - ay);
+ const prox = 1 - Math.min(dy / 280, 1);
+ if (prox <= 0.01) {
+ bignum.style.setProperty('--agent-shadow', 'none');
+ return;
+ }
+ const blur = (12 * (1 - prox) + 3).toFixed(2);
+ const offsetY = (3 + 8 * prox).toFixed(2);
+ const alpha = (0.6 * prox).toFixed(3);
+ bignum.style.setProperty('--agent-shadow', `0 ${offsetY}px ${blur}px rgba(0,0,0,${alpha})`);
+ }
+
+ // ── Subtle camera parallax — sells "3D" without breaking ortho math
+ // We pan the camera slightly with the mouse instead of changing FOV,
+ // which keeps domToWorld() correct since it always reads from `camera`.
+ let mouseNx = 0, mouseNy = 0;
+ window.addEventListener('mousemove', e => {
+ mouseNx = (e.clientX / window.innerWidth) * 2 - 1;
+ mouseNy = (e.clientY / window.innerHeight) * 2 - 1;
+ });
+
+ // ── Loader ────────────────────────────────────────────────────────
+ const CLIPS = ['idle', 'walk', 'falling', 'falltolanding'];
+
+ new GLTFLoader().load('/avatars/cz.glb', gltf => {
+ avatar = gltf.scene;
+ avatar.traverse(n => {
+ if (!rootBone && /^(Hips|Root|mixamorig:?Hips)$/i.test(n.name)) rootBone = n;
+ });
+ avatar.rotation.y = 0;
+ scene.add(avatar);
+
+ mixer = new THREE.AnimationMixer(avatar);
+
+ Promise.all(CLIPS.map(name =>
+ fetch(`/animations/clips/${name}.json`).then(r => r.json())
+ )).then(jsons => {
+ CLIPS.forEach((name, i) => {
+ actions[name] = mixer.clipAction(THREE.AnimationClip.parse(jsons[i]));
+ });
+
+ if (rootBone) baseRootPos = rootBone.position.clone();
+ // Lock root motion so the walk-cycle's translation doesn't fight our
+ // JS position lerp during runningOff.
+ const _r = renderer.render.bind(renderer);
+ renderer.render = (sc, cam) => {
+ try { if (rootBone && baseRootPos) rootBone.position.copy(baseRootPos); } catch (_) {}
+ _r(sc, cam);
+ };
+
+ // Kick off the fall on next frame so layout is settled
+ requestAnimationFrame(startFall);
+ });
+ });
+
+ // ── Render loop ───────────────────────────────────────────────────
+ const clock = new THREE.Clock();
+ (function tick() {
+ requestAnimationFrame(tick);
+ try {
+ const dt = Math.min(clock.getDelta(), 0.05);
+ mixer?.update(dt);
+
+ if (phase === 'fallingIn' && avatar) {
+ fallT += dt;
+ const p = Math.min(fallT / FALL_S, 1);
+ // Ease-in (gravity-style) for vertical, linear-ish for horizontal
+ const ey = p * p;
+ avatar.position.x = fallStartW.x + (fallTargetW.x - fallStartW.x) * smoothstep(p);
+ avatar.position.y = fallStartW.y + (fallTargetW.y - fallStartW.y) * ey;
+ // Slight tumble during the fall, settles to 0 on landing
+ avatar.rotation.y = (1 - p) * 0.25 * Math.sin(p * 8);
+
+ if (p >= 1 && !landed) {
+ fireLandingDust();
+ fireImpactPulse();
+ startConfused();
+ }
+ }
+
+ // Camera parallax — clamped tiny so domToWorld stays within tolerance
+ const targetCamX = mouseNx * 0.12;
+ const targetCamY = -mouseNy * 0.08;
+ camera.position.x += (targetCamX - camera.position.x) * 0.04;
+ camera.position.y += (targetCamY - camera.position.y) * 0.04;
+
+ updateProximityShadow();
+ renderer.render(scene, camera);
+ } catch (_) {}
+ })();
+ </script>
+ </body>
+</html>
diff --git a/public/demos/checkout.html b/public/demos/checkout.html
new file mode 100644
index 000000000..5aa8929e8
--- /dev/null
+++ b/public/demos/checkout.html
@@ -0,0 +1,486 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>three.ws — checkout demo</title>
+ <meta name="robots" content="noindex" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <style>
+ :root { color-scheme: dark; }
+ *, *::before, *::after { box-sizing: border-box; }
+ html, body { height: 100%; margin: 0; background: #04050d; color: #eee; font: 15px/1.5 'Inter', -apple-system, system-ui, sans-serif; overflow-x: hidden; }
+
+ #avatar-canvas {
+ position: fixed; inset: 0;
+ width: 100vw; height: 100vh;
+ pointer-events: none; z-index: 999;
+ }
+
+ .nav {
+ position: fixed; top: 0; left: 0; right: 0; z-index: 20;
+ display: flex; align-items: center; gap: 16px; padding: 14px 28px;
+ background: rgba(4,5,13,0.55); backdrop-filter: blur(14px);
+ border-bottom: 1px solid rgba(255,255,255,0.04);
+ }
+ .nav .brand { font: 700 15px/1 'Space Grotesk','Inter',sans-serif; color:#fff; text-decoration:none; display:flex; align-items:center; gap:7px; }
+ .brand-dot { width:8px; height:8px; border-radius:50%; background:linear-gradient(135deg,#d6ff3d,#aacc00); box-shadow:0 0 10px rgba(214,255,61,0.6); }
+ .nav .spacer { flex: 1; }
+ .nav .link { color:#555870; text-decoration:none; font-size:13px; }
+ .nav .link:hover { color:#d6ff3d; }
+
+ /* Cart icon — the agent's "destination" */
+ .cart {
+ position: relative;
+ width: 42px; height: 42px;
+ display: inline-flex; align-items: center; justify-content: center;
+ border-radius: 50%;
+ background: rgba(255,255,255,0.05);
+ border: 1.5px solid rgba(255,255,255,0.08);
+ color: #fff;
+ transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
+ will-change: transform;
+ }
+ .cart svg { width: 22px; height: 22px; }
+ .cart .badge {
+ position: absolute;
+ top: -4px; right: -4px;
+ min-width: 18px; height: 18px;
+ padding: 0 5px;
+ border-radius: 999px;
+ background: #d6ff3d;
+ color: #0a0b0f;
+ font: 700 11px/18px 'Inter', sans-serif; text-align: center;
+ box-shadow: 0 0 0 2px #04050d;
+ transform: scale(0);
+ transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
+ }
+ .cart.has-items .badge { transform: scale(1); }
+ .cart.thump { animation: cartthump 0.55s cubic-bezier(0.34, 1.56, 0.64, 1); }
+ @keyframes cartthump {
+ 0% { transform: scale(1); }
+ 35% { transform: scale(1.32); border-color: rgba(214,255,61,0.8); background: rgba(214,255,61,0.18); }
+ 100% { transform: scale(1); }
+ }
+
+ .page {
+ min-height: 100vh;
+ display: flex; align-items: center; justify-content: center;
+ padding: 100px 24px 60px;
+ }
+
+ .product {
+ display: grid;
+ grid-template-columns: 360px 1fr;
+ gap: 44px; align-items: center;
+ width: 100%; max-width: 920px;
+ }
+ @media (max-width: 720px) {
+ .product { grid-template-columns: 1fr; gap: 24px; }
+ }
+
+ .product-image {
+ position: relative;
+ aspect-ratio: 1 / 1;
+ border-radius: 22px;
+ background:
+ radial-gradient(circle at 30% 25%, rgba(214,255,61,0.35), transparent 55%),
+ radial-gradient(circle at 70% 80%, rgba(74,140,255,0.35), transparent 60%),
+ #0e1020;
+ border: 1px solid rgba(255,255,255,0.06);
+ overflow: hidden;
+ }
+ .product-image .orb {
+ position: absolute; inset: 18%;
+ border-radius: 50%;
+ background:
+ radial-gradient(circle at 35% 30%, #f9ffd9 0%, #d6ff3d 30%, #5d7a04 80%);
+ box-shadow:
+ inset 0 -30px 60px rgba(0,0,0,0.45),
+ 0 30px 80px rgba(214,255,61,0.28);
+ animation: orbfloat 4.6s ease-in-out infinite;
+ }
+ @keyframes orbfloat {
+ 0%, 100% { transform: translateY(0) rotate(0deg); }
+ 50% { transform: translateY(-12px) rotate(6deg); }
+ }
+
+ .eyebrow {
+ display: inline-flex; align-items: center; gap: 9px;
+ font-size: 11px; font-weight: 600;
+ letter-spacing: 0.17em; text-transform: uppercase;
+ color: #d6ff3d; margin-bottom: 14px;
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ }
+ .eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #d6ff3d; box-shadow: 0 0 8px rgba(214,255,61,0.7); }
+
+ h1 {
+ font-family: 'Space Grotesk','Inter',sans-serif;
+ font-size: clamp(30px, 4vw, 46px); font-weight: 800; letter-spacing: -0.025em;
+ line-height: 1.05; margin: 0 0 12px; color: #fff;
+ }
+ .sub { color: #6b6e88; font-size: 15px; line-height: 1.65; margin: 0 0 22px; max-width: 36ch; }
+ .price { display: flex; align-items: baseline; gap: 10px; margin: 0 0 28px; }
+ .price .now { font: 800 32px/1 'Space Grotesk','Inter',sans-serif; color: #fff; }
+ .price .was { color: #6b6e88; text-decoration: line-through; font-size: 16px; }
+
+ .add-btn {
+ display: inline-flex; align-items: center; gap: 10px;
+ padding: 16px 30px; border: none; border-radius: 14px;
+ font: 700 15px/1 'Inter', inherit; cursor: pointer;
+ background: linear-gradient(160deg, #e2ff5a, #c8ef2c);
+ color: #0a0b0f;
+ box-shadow: 0 8px 0 0 #7a9600, 0 10px 28px rgba(214,255,61,0.28);
+ transform-origin: bottom center;
+ will-change: transform;
+ }
+ .add-btn:hover { filter: brightness(1.07); }
+ .add-btn:disabled { opacity: 0.5; cursor: wait; }
+
+ .hint {
+ margin-top: 14px;
+ font-size: 12px; color: #4a4d63; letter-spacing: 0.06em;
+ }
+
+ /* The flying item — a clone of the product orb that arcs alongside the avatar */
+ .flying-item {
+ position: fixed;
+ width: 56px; height: 56px;
+ border-radius: 50%;
+ background: radial-gradient(circle at 35% 30%, #f9ffd9 0%, #d6ff3d 30%, #5d7a04 80%);
+ box-shadow: 0 0 24px rgba(214,255,61,0.5), inset 0 -8px 16px rgba(0,0,0,0.4);
+ z-index: 998;
+ pointer-events: none;
+ will-change: transform, opacity;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="nav">
+ <a href="/" class="brand">
+ <img src="/three.svg" width="20" height="20" alt="" />
+ <span class="brand-dot"></span>
+ three.ws
+ </a>
+ <a href="/demos/" class="link" style="margin-left:18px">← lab</a>
+ <div class="spacer"></div>
+ <div class="cart" id="cart" aria-label="Cart">
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <circle cx="9" cy="21" r="1"></circle>
+ <circle cx="20" cy="21" r="1"></circle>
+ <path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path>
+ </svg>
+ <span class="badge" id="cart-badge">0</span>
+ </div>
+ </div>
+
+ <div class="page">
+ <div class="product">
+ <div class="product-image"><div class="orb"></div></div>
+ <div>
+ <div class="eyebrow"><span class="eyebrow-dot"></span><span>Limited drop · 2026 collection</span></div>
+ <h1>Lime Plasma Orb</h1>
+ <p class="sub">Hand-tuned reactive lighting baked into a portable companion sphere. One per agent.</p>
+ <div class="price">
+ <span class="now">$129</span>
+ <span class="was">$199</span>
+ </div>
+ <button class="add-btn" id="add-btn" type="button">
+ <span>Add to cart</span>
+ <span>→</span>
+ </button>
+ <div class="hint">Click <strong>Add to cart</strong> — she'll grab it and run it to the basket.</div>
+ </div>
+ </div>
+ </div>
+
+ <canvas id="avatar-canvas"></canvas>
+
+ <script type="module">
+ import * as THREE from 'three';
+ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+ import { gsap } from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';
+
+ const canvas = document.getElementById('avatar-canvas');
+ const addBtn = document.getElementById('add-btn');
+ const cart = document.getElementById('cart');
+ const badgeEl = document.getElementById('cart-badge');
+ const orbEl = document.querySelector('.product-image .orb');
+
+ // ── Renderer / scene (same pattern as 3d-home/login) ──────────────
+ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });
+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
+ renderer.outputColorSpace = THREE.SRGBColorSpace;
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
+ renderer.toneMappingExposure = 1.1;
+
+ const scene = new THREE.Scene();
+ const PX_PER_UNIT = 120;
+ const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0.1, 100);
+ camera.position.z = 10;
+
+ function updateFrustum() {
+ const hw = window.innerWidth / PX_PER_UNIT / 2;
+ const hh = window.innerHeight / PX_PER_UNIT / 2;
+ camera.left = -hw; camera.right = hw;
+ camera.top = hh; camera.bottom = -hh;
+ camera.updateProjectionMatrix();
+ }
+
+ const _v3 = new THREE.Vector3();
+ function domToWorld(sx, sy) {
+ _v3.set((sx / window.innerWidth) * 2 - 1, -(sy / window.innerHeight) * 2 + 1, 0);
+ _v3.unproject(camera);
+ return { x: _v3.x, y: _v3.y };
+ }
+ function worldToScreen(x, y) {
+ _v3.set(x, y, 0).project(camera);
+ return {
+ x: (_v3.x + 1) * 0.5 * window.innerWidth,
+ y: (1 - _v3.y) * 0.5 * window.innerHeight,
+ };
+ }
+ function resize() {
+ renderer.setSize(window.innerWidth, window.innerHeight, false);
+ updateFrustum();
+ if (avatar && phase === 'idle') parkAtButton();
+ }
+ window.addEventListener('resize', resize);
+ resize();
+
+ // Lights
+ scene.add(new THREE.AmbientLight(0xffffff, 0.6));
+ const key = new THREE.DirectionalLight(0xfff4dc, 2.0); key.position.set(3, 6, 5); scene.add(key);
+ const rim = new THREE.DirectionalLight(0x4060ff, 0.6); rim.position.set(-4, 3, -2); scene.add(rim);
+ const fill = new THREE.DirectionalLight(0xffeedd, 0.4); fill.position.set(0, 2, 7); scene.add(fill);
+
+ // ── Avatar runtime ────────────────────────────────────────────────
+ let avatar = null, mixer = null, rootBone = null, baseRootPos = null;
+ const actions = {};
+ let currentAction = null;
+ const FADE_S = 0.3;
+
+ function setAnimation(name, { loop = true, hold = false } = {}) {
+ const next = actions[name];
+ if (!next || next === currentAction) return;
+ next.reset();
+ next.setLoop(loop ? THREE.LoopRepeat : THREE.LoopOnce, loop ? Infinity : 1);
+ next.clampWhenFinished = hold;
+ if (currentAction) next.crossFadeFrom(currentAction, FADE_S, false).play();
+ else next.fadeIn(FADE_S).play();
+ currentAction = next;
+ }
+
+ // ── Phase state ───────────────────────────────────────────────────
+ // idle — standing at the add-to-cart button
+ // grabbing — quick reaction animation, item lifts off the product card
+ // running — arcing toward the cart icon
+ // celebrating — landed at cart, plays celebrate, returns to idle
+ let phase = 'loading';
+ let itemCount = 0;
+ const BUTTON_FEET_OFFSET_PX = 12; // how far below the button's top edge the feet sit
+ const CART_LAND_OFFSET_PX = 130; // sit/stand offset for the avatar at cart height
+
+ function getButtonStandWorld() {
+ const r = addBtn.getBoundingClientRect();
+ // Stand to the right of the button, feet on its bottom edge
+ return domToWorld(r.right + 60, r.bottom + BUTTON_FEET_OFFSET_PX);
+ }
+ function getCartWorld() {
+ const r = cart.getBoundingClientRect();
+ return domToWorld(r.left + r.width / 2, r.top + CART_LAND_OFFSET_PX);
+ }
+
+ function parkAtButton() {
+ if (!avatar) return;
+ const p = getButtonStandWorld();
+ avatar.position.set(p.x, p.y, 0);
+ avatar.rotation.set(0, -0.25, 0); // slight turn toward the button
+ }
+
+ function smoothstep(t) { return t * t * (3 - 2 * t); }
+
+ // ── The "grab" — reaction animation + orb lifts off the product image
+ function fireGrab() {
+ phase = 'grabbing';
+ setAnimation('reaction', { loop: false, hold: true });
+ // Tilt the orb on the product card briefly as if "tugged" toward the agent
+ gsap.killTweensOf(orbEl);
+ gsap.to(orbEl, {
+ x: -20, y: -8, rotation: -12,
+ duration: 0.32, ease: 'power3.out',
+ onComplete: () => {
+ gsap.to(orbEl, { x: 0, y: 0, rotation: 0, duration: 0.6, ease: 'elastic.out(1.2, 0.5)' });
+ }
+ });
+ }
+
+ // Spawn a flying clone of the orb that arcs alongside the avatar
+ function spawnFlyingItem() {
+ const start = orbEl.getBoundingClientRect();
+ const flier = document.createElement('div');
+ flier.className = 'flying-item';
+ const size = 56;
+ flier.style.left = `${start.left + start.width / 2 - size / 2}px`;
+ flier.style.top = `${start.top + start.height / 2 - size / 2}px`;
+ document.body.appendChild(flier);
+ return flier;
+ }
+
+ // ── Arc to the cart ───────────────────────────────────────────────
+ let arcT = 0, arcStart = null, arcEnd = null, arcMidLift = 0, flier = null;
+ const ARC_S = 1.05;
+
+ function startRunToCart() {
+ phase = 'running';
+ arcT = 0;
+ arcStart = { x: avatar.position.x, y: avatar.position.y };
+ arcEnd = getCartWorld();
+ // Lift the apex relative to total arc length so big screens still get a real arc
+ arcMidLift = Math.max(1.1, Math.abs(arcEnd.x - arcStart.x) * 0.18);
+ flier = spawnFlyingItem();
+ setAnimation('jump', { loop: false, hold: true });
+ // Face the cart
+ const dir = Math.sign(arcEnd.x - arcStart.x);
+ gsap.to(avatar.rotation, { y: dir * 0.35, duration: 0.25, overwrite: true });
+ }
+
+ function landAtCart() {
+ phase = 'celebrating';
+ avatar.position.set(arcEnd.x, arcEnd.y, 0);
+ cart.classList.add('thump');
+ setTimeout(() => cart.classList.remove('thump'), 600);
+ itemCount += 1;
+ badgeEl.textContent = String(itemCount);
+ cart.classList.add('has-items');
+ // Pop the flier into the cart and remove it
+ if (flier) {
+ gsap.to(flier, { scale: 0.2, opacity: 0, duration: 0.28, ease: 'power2.in', onComplete: () => flier?.remove() });
+ flier = null;
+ }
+ setAnimation('celebrate', { loop: false, hold: false });
+ // After the celebrate clip, return to the button
+ setTimeout(returnToButton, 1600);
+ }
+
+ function returnToButton() {
+ phase = 'returning';
+ setAnimation('walk', { loop: true });
+ const back = getButtonStandWorld();
+ const dir = Math.sign(back.x - avatar.position.x);
+ gsap.to(avatar.rotation, { y: dir * 0.5, duration: 0.25, overwrite: true });
+ const t0 = performance.now();
+ const fromX = avatar.position.x, fromY = avatar.position.y;
+ const ms = 900;
+ (function step(now) {
+ const sp = Math.min((now - t0) / ms, 1);
+ const e = smoothstep(sp);
+ avatar.position.x = fromX + (back.x - fromX) * e;
+ avatar.position.y = fromY + (back.y - fromY) * e;
+ if (sp < 1) requestAnimationFrame(step);
+ else {
+ avatar.position.set(back.x, back.y, 0);
+ setAnimation('idle', { loop: true });
+ gsap.to(avatar.rotation, { y: -0.25, duration: 0.25, overwrite: true });
+ phase = 'idle';
+ addBtn.disabled = false;
+ }
+ })(performance.now());
+ }
+
+ // ── Button click — runs the full sequence ─────────────────────────
+ addBtn.addEventListener('click', () => {
+ if (phase !== 'idle') return;
+ addBtn.disabled = true;
+ // Squish the button on click — same pattern as 3d-home's button impact
+ gsap.killTweensOf(addBtn);
+ gsap.to(addBtn, {
+ scaleY: 0.85, scaleX: 1.04, duration: 0.09, ease: 'power3.out',
+ onComplete: () => gsap.to(addBtn, { scaleY: 1, scaleX: 1, duration: 0.5, ease: 'elastic.out(1.2, 0.4)' })
+ });
+ fireGrab();
+ // reaction clip is short — start the run shortly after
+ setTimeout(() => {
+ if (phase === 'grabbing') startRunToCart();
+ }, 500);
+ });
+
+ // ── Camera parallax (very subtle, same as 404) ────────────────────
+ let mouseNx = 0, mouseNy = 0;
+ window.addEventListener('mousemove', e => {
+ mouseNx = (e.clientX / window.innerWidth) * 2 - 1;
+ mouseNy = (e.clientY / window.innerHeight) * 2 - 1;
+ });
+
+ // ── Loader ────────────────────────────────────────────────────────
+ const CLIPS = ['idle', 'walk', 'reaction', 'jump', 'celebrate'];
+
+ new GLTFLoader().load('/avatars/cz.glb', gltf => {
+ avatar = gltf.scene;
+ avatar.traverse(n => {
+ if (!rootBone && /^(Hips|Root|mixamorig:?Hips)$/i.test(n.name)) rootBone = n;
+ });
+ avatar.rotation.y = 0;
+ scene.add(avatar);
+
+ mixer = new THREE.AnimationMixer(avatar);
+
+ Promise.all(CLIPS.map(name =>
+ fetch(`/animations/clips/${name}.json`).then(r => r.json())
+ )).then(jsons => {
+ CLIPS.forEach((name, i) => {
+ actions[name] = mixer.clipAction(THREE.AnimationClip.parse(jsons[i]));
+ });
+
+ if (rootBone) baseRootPos = rootBone.position.clone();
+ const _r = renderer.render.bind(renderer);
+ renderer.render = (sc, cam) => {
+ try { if (rootBone && baseRootPos) rootBone.position.copy(baseRootPos); } catch (_) {}
+ _r(sc, cam);
+ };
+
+ parkAtButton();
+ setAnimation('idle', { loop: true });
+ phase = 'idle';
+ });
+ });
+
+ // ── Render loop ───────────────────────────────────────────────────
+ const clock = new THREE.Clock();
+ (function tick() {
+ requestAnimationFrame(tick);
+ try {
+ const dt = Math.min(clock.getDelta(), 0.05);
+ mixer?.update(dt);
+
+ if (phase === 'running' && avatar && arcStart && arcEnd) {
+ arcT += dt;
+ const p = Math.min(arcT / ARC_S, 1);
+ const e = smoothstep(p);
+ const x = arcStart.x + (arcEnd.x - arcStart.x) * e;
+ // Parabolic arc — peaks at p=0.5
+ const arc = arcMidLift * 4 * p * (1 - p);
+ const y = arcStart.y + (arcEnd.y - arcStart.y) * e + arc;
+ avatar.position.set(x, y, 0);
+
+ // Sync the flying item to a screen position 60px above the avatar's head
+ if (flier) {
+ const head = worldToScreen(x, y + 1.4);
+ flier.style.transform = `translate(${(head.x - parseFloat(flier.style.left)).toFixed(1)}px, ${(head.y - parseFloat(flier.style.top)).toFixed(1)}px) rotate(${(p * 540).toFixed(0)}deg)`;
+ }
+
+ if (p >= 1) landAtCart();
+ }
+
+ // Camera parallax
+ const targetCamX = mouseNx * 0.1;
+ const targetCamY = -mouseNy * 0.07;
+ camera.position.x += (targetCamX - camera.position.x) * 0.04;
+ camera.position.y += (targetCamY - camera.position.y) * 0.04;
+
+ renderer.render(scene, camera);
+ } catch (_) {}
+ })();
+ </script>
+ </body>
+</html>
diff --git a/public/demos/index.html b/public/demos/index.html
index d77b4099d..4a7df8bcc 100644
--- a/public/demos/index.html
+++ b/public/demos/index.html
@@ -127,6 +127,31 @@
<p>Redesigned /create chooser: featured recommended card, distinct 3D previews, time badges, destination hints, live stats from /api/explore, and integration strip.</p>
<span class="demo-status beta">Beta</span>
</a>
+ <a class="demo-card" href="/demos/3d-home.html">
+ <h2>3D home — give your AI a body</h2>
+ <p>Hero with the avatar perched on the H1, jumping to the CTA on click. Crossfaded clips, proximity text shadow, splash on impact, ResizeObserver re-anchoring, and chip-triggered performances.</p>
+ <span class="demo-status beta">Beta</span>
+ </a>
+ <a class="demo-card" href="/demos/login.html">
+ <h2>Login — agent reads along</h2>
+ <p>Sign-in form wired with declarative <code>data-agent-*</code> attributes. Walks to the focused input, tracks the typing caret via a hidden mirror, covers her eyes on the password field, head-shakes on empty submit.</p>
+ <span class="demo-status beta">Beta</span>
+ </a>
+ <a class="demo-card" href="/demos/404.html">
+ <h2>404 — she took a wrong turn</h2>
+ <p>Avatar falls in from off-screen, lands on the <code>0</code> with a dust splash and proximity shadow, looks around lost. Click "Take her home" and she runs offscreen before the redirect fires.</p>
+ <span class="demo-status beta">Beta</span>
+ </a>
+ <a class="demo-card" href="/demos/checkout.html">
+ <h2>Checkout — agent runs the cart</h2>
+ <p>"Add to cart" triggers a reaction grab; the product orb spawns a flying clone that arcs alongside the avatar to the cart icon. Badge increments, cart thumps, agent celebrates and walks back to idle.</p>
+ <span class="demo-status beta">Beta</span>
+ </a>
+ <a class="demo-card" href="/demos/pricing.html">
+ <h2>Pricing — she points at the right tier</h2>
+ <p>Three-tier pricing table. Hover any tier and the avatar leaps to its top edge with a debounced jump arc, lands with a card-thump, and uses the reaction clip to point down at the CTA.</p>
+ <span class="demo-status beta">Beta</span>
+ </a>
</div>
<p class="warning">
diff --git a/public/demos/pricing.html b/public/demos/pricing.html
new file mode 100644
index 000000000..4d3cf4a0b
--- /dev/null
+++ b/public/demos/pricing.html
@@ -0,0 +1,461 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>three.ws — pricing demo</title>
+ <meta name="robots" content="noindex" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <style>
+ :root { color-scheme: dark; }
+ *, *::before, *::after { box-sizing: border-box; }
+ html, body { height: 100%; margin: 0; background: #04050d; color: #eee; font: 15px/1.5 'Inter', -apple-system, system-ui, sans-serif; }
+
+ #avatar-canvas {
+ position: fixed; inset: 0;
+ width: 100vw; height: 100vh;
+ pointer-events: none; z-index: 999;
+ }
+
+ .nav {
+ position: fixed; top: 0; left: 0; right: 0; z-index: 20;
+ display: flex; align-items: center; gap: 16px; padding: 14px 28px;
+ background: rgba(4,5,13,0.55); backdrop-filter: blur(14px);
+ border-bottom: 1px solid rgba(255,255,255,0.04);
+ }
+ .nav .brand { font: 700 15px/1 'Space Grotesk','Inter',sans-serif; color:#fff; text-decoration:none; display:flex; align-items:center; gap:7px; }
+ .brand-dot { width:8px; height:8px; border-radius:50%; background:linear-gradient(135deg,#d6ff3d,#aacc00); box-shadow:0 0 10px rgba(214,255,61,0.6); }
+ .nav a.link { color:#555870; text-decoration:none; font-size:13px; margin-left:auto; }
+ .nav a.link:hover { color:#d6ff3d; }
+
+ .page {
+ min-height: 100vh;
+ padding: 130px 24px 80px;
+ max-width: 1100px;
+ margin: 0 auto;
+ }
+ .eyebrow {
+ display: inline-flex; align-items: center; gap: 9px;
+ font-size: 11px; font-weight: 600;
+ letter-spacing: 0.17em; text-transform: uppercase;
+ color: #d6ff3d; margin-bottom: 14px;
+ font-family: 'Space Grotesk', 'Inter', sans-serif;
+ }
+ .eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: #d6ff3d; box-shadow: 0 0 8px rgba(214,255,61,0.7); }
+ h1 {
+ font-family: 'Space Grotesk','Inter',sans-serif;
+ font-size: clamp(34px, 4.4vw, 54px); font-weight: 800; letter-spacing: -0.025em;
+ line-height: 1.05; margin: 0 0 14px; color: #fff; max-width: 18ch;
+ }
+ h1 em { color: #d6ff3d; font-style: normal; }
+ .lead { color: #6b6e88; font-size: 16px; max-width: 56ch; margin: 0 0 48px; line-height: 1.6; }
+
+ .tiers {
+ display: grid;
+ grid-template-columns: 1fr 1fr 1fr;
+ gap: 18px;
+ align-items: end;
+ }
+ @media (max-width: 820px) {
+ .tiers { grid-template-columns: 1fr; }
+ }
+
+ .tier {
+ position: relative;
+ border-radius: 18px;
+ background: rgba(15,17,32,0.78);
+ border: 1.5px solid rgba(255,255,255,0.06);
+ padding: 28px 26px 24px;
+ transition: transform 200ms cubic-bezier(0.3, 0.8, 0.4, 1.05),
+ border-color 200ms ease,
+ box-shadow 200ms ease,
+ background 200ms ease;
+ will-change: transform;
+ }
+ .tier .pad-top {
+ /* Reserved headroom so the avatar standing on top doesn't crowd the title */
+ height: 70px;
+ }
+ .tier h2 {
+ font-family: 'Space Grotesk','Inter',sans-serif;
+ font-size: 18px; font-weight: 700; margin: 0 0 4px; color: #fff; letter-spacing: -0.005em;
+ }
+ .tier .blurb { color: #6b6e88; font-size: 13px; margin: 0 0 18px; line-height: 1.5; min-height: 34px; }
+ .tier .num { display: flex; align-items: baseline; gap: 6px; margin: 0 0 16px; }
+ .tier .num .price { font: 800 36px/1 'Space Grotesk','Inter',sans-serif; color: #fff; }
+ .tier .num .per { color: #6b6e88; font-size: 13px; }
+ .tier ul { list-style: none; padding: 0; margin: 0 0 22px; }
+ .tier li {
+ color: #b6b8c8; font-size: 13.5px; padding: 7px 0;
+ display: flex; align-items: flex-start; gap: 8px;
+ border-top: 1px solid rgba(255,255,255,0.04);
+ }
+ .tier li:first-child { border-top: 0; }
+ .tier li::before {
+ content: '';
+ flex: 0 0 6px; height: 6px; border-radius: 50%;
+ background: #d6ff3d; margin-top: 8px; box-shadow: 0 0 6px rgba(214,255,61,0.55);
+ }
+ .tier .cta {
+ display: inline-flex; align-items: center; justify-content: center;
+ gap: 8px; width: 100%;
+ padding: 13px 18px; border: none; border-radius: 11px;
+ font: 700 14px/1 'Inter', inherit; cursor: pointer; text-decoration: none;
+ background: rgba(255,255,255,0.06);
+ color: #fff;
+ border: 1.5px solid rgba(255,255,255,0.08);
+ transition: background 140ms, border-color 140ms, transform 140ms;
+ }
+ .tier .cta:hover { background: rgba(214,255,61,0.1); border-color: rgba(214,255,61,0.45); }
+
+ /* Hover / "she's on this one" state */
+ .tier:hover,
+ .tier.is-active {
+ border-color: rgba(214,255,61,0.55);
+ background: rgba(20,28,16,0.85);
+ box-shadow:
+ 0 0 0 1px rgba(214,255,61,0.22),
+ 0 28px 60px rgba(214,255,61,0.16);
+ }
+ .tier:hover { transform: translateY(-4px); }
+ .tier.is-active .cta {
+ background: linear-gradient(160deg, #e2ff5a, #c8ef2c);
+ color: #0a0b0f; border-color: transparent;
+ box-shadow: 0 4px 0 0 #7a9600;
+ }
+
+ /* "Most popular" ribbon on Pro */
+ .tier.pro {
+ /* Visually elevated even when no hover */
+ background: rgba(18,24,12,0.85);
+ border-color: rgba(214,255,61,0.4);
+ }
+ .tier.pro::before {
+ content: 'Most popular';
+ position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
+ background: linear-gradient(160deg, #e2ff5a, #c8ef2c);
+ color: #0a0b0f;
+ font: 700 10.5px/1 'Space Grotesk','Inter',sans-serif;
+ letter-spacing: 0.12em; text-transform: uppercase;
+ padding: 6px 12px; border-radius: 999px;
+ box-shadow: 0 6px 16px rgba(214,255,61,0.3);
+ }
+
+ .hint {
+ margin-top: 28px;
+ color: #4a4d63; font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="nav">
+ <a href="/" class="brand">
+ <img src="/three.svg" width="20" height="20" alt="" />
+ <span class="brand-dot"></span>
+ three.ws
+ </a>
+ <a href="/demos/" class="link">← lab</a>
+ </div>
+
+ <div class="page">
+ <div class="eyebrow"><span class="eyebrow-dot"></span><span>Pick your tier</span></div>
+ <h1>Hover a plan — <em>she'll show you which one to pick.</em></h1>
+ <p class="lead">She lives on the page. Move your cursor across the tiers and she'll climb onto whichever one you're looking at, then point at the button.</p>
+
+ <div class="tiers" id="tiers">
+ <div class="tier" id="tier-basic" data-tier="basic">
+ <div class="pad-top"></div>
+ <h2>Basic</h2>
+ <p class="blurb">For solo builders shipping their first agent.</p>
+ <div class="num"><span class="price">$0</span><span class="per">/forever</span></div>
+ <ul>
+ <li>1 agent</li>
+ <li>Default rig + animations</li>
+ <li>Public deploy at three.ws/&lt;name&gt;</li>
+ </ul>
+ <a href="#" class="cta" data-tier-cta="basic">Start free</a>
+ </div>
+
+ <div class="tier pro" id="tier-pro" data-tier="pro">
+ <div class="pad-top"></div>
+ <h2>Pro</h2>
+ <p class="blurb">For studios and teams shipping multiple agents.</p>
+ <div class="num"><span class="price">$29</span><span class="per">/mo</span></div>
+ <ul>
+ <li>Unlimited agents</li>
+ <li>Custom avatars + lipsync</li>
+ <li>Animation studio + memory seeds</li>
+ <li>Custom subdomain</li>
+ </ul>
+ <a href="#" class="cta" data-tier-cta="pro">Choose Pro</a>
+ </div>
+
+ <div class="tier" id="tier-enterprise" data-tier="enterprise">
+ <div class="pad-top"></div>
+ <h2>Enterprise</h2>
+ <p class="blurb">For platforms embedding agents at scale.</p>
+ <div class="num"><span class="price">Talk</span><span class="per">to us</span></div>
+ <ul>
+ <li>Self-hosted runtime</li>
+ <li>On-chain identity (ERC-8004)</li>
+ <li>Custom rigs &amp; licensing</li>
+ <li>SLA + dedicated infra</li>
+ </ul>
+ <a href="#" class="cta" data-tier-cta="enterprise">Contact sales</a>
+ </div>
+ </div>
+
+ <p class="hint">Move your mouse over a tier — she jumps over and points at the CTA.</p>
+ </div>
+
+ <canvas id="avatar-canvas"></canvas>
+
+ <script type="module">
+ import * as THREE from 'three';
+ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
+ import { gsap } from 'https://cdn.jsdelivr.net/npm/[email protected]/+esm';
+
+ const canvas = document.getElementById('avatar-canvas');
+ const tiers = [...document.querySelectorAll('.tier')];
+
+ // ── Renderer / scene ──────────────────────────────────────────────
+ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });
+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
+ renderer.outputColorSpace = THREE.SRGBColorSpace;
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
+ renderer.toneMappingExposure = 1.1;
+
+ const scene = new THREE.Scene();
+ const PX_PER_UNIT = 120;
+ const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0.1, 100);
+ camera.position.z = 10;
+
+ function updateFrustum() {
+ const hw = window.innerWidth / PX_PER_UNIT / 2;
+ const hh = window.innerHeight / PX_PER_UNIT / 2;
+ camera.left = -hw; camera.right = hw;
+ camera.top = hh; camera.bottom = -hh;
+ camera.updateProjectionMatrix();
+ }
+ const _v3 = new THREE.Vector3();
+ function domToWorld(sx, sy) {
+ _v3.set((sx / window.innerWidth) * 2 - 1, -(sy / window.innerHeight) * 2 + 1, 0);
+ _v3.unproject(camera);
+ return { x: _v3.x, y: _v3.y };
+ }
+ function resize() {
+ renderer.setSize(window.innerWidth, window.innerHeight, false);
+ updateFrustum();
+ // Re-snap to the currently-targeted tier so layout shifts don't leave her floating
+ if (avatar && activeTier && phase !== 'jumping') {
+ const t = standOnTopOf(activeTier);
+ gsap.killTweensOf(avatar.position);
+ gsap.to(avatar.position, { x: t.x, y: t.y, duration: 0.35, overwrite: true });
+ }
+ }
+ window.addEventListener('resize', resize);
+ resize();
+
+ // Lights
+ scene.add(new THREE.AmbientLight(0xffffff, 0.6));
+ const key = new THREE.DirectionalLight(0xfff4dc, 2.0); key.position.set(3, 6, 5); scene.add(key);
+ const rim = new THREE.DirectionalLight(0x4060ff, 0.6); rim.position.set(-4, 3, -2); scene.add(rim);
+ const fill = new THREE.DirectionalLight(0xffeedd, 0.4); fill.position.set(0, 2, 7); scene.add(fill);
+
+ // ── Avatar runtime ────────────────────────────────────────────────
+ let avatar = null, mixer = null, rootBone = null, baseRootPos = null;
+ const actions = {};
+ let currentAction = null;
+ const FADE_S = 0.3;
+
+ function setAnimation(name, { loop = true, hold = false } = {}) {
+ const next = actions[name];
+ if (!next || next === currentAction) return;
+ next.reset();
+ next.setLoop(loop ? THREE.LoopRepeat : THREE.LoopOnce, loop ? Infinity : 1);
+ next.clampWhenFinished = hold;
+ if (currentAction) next.crossFadeFrom(currentAction, FADE_S, false).play();
+ else next.fadeIn(FADE_S).play();
+ currentAction = next;
+ }
+
+ // ── Tier targeting ────────────────────────────────────────────────
+ // The avatar stands ON THE TOP EDGE of a card, slightly inset from center so
+ // the .pad-top reserved area accepts her without colliding with the title.
+ const FEET_TOP_OFFSET_PX = 0; // cz.glb origin = feet, so 0 puts feet right on the top edge
+
+ function standOnTopOf(tierEl) {
+ const r = tierEl.getBoundingClientRect();
+ return domToWorld(r.left + r.width / 2, r.top + FEET_TOP_OFFSET_PX);
+ }
+
+ let phase = 'loading'; // loading | idle | jumping
+ let activeTier = null; // tier she's currently associated with
+ let jumpT = 0, jumpStart = null, jumpEnd = null, jumpLift = 0;
+ const JUMP_S = 0.85;
+
+ function smoothstep(t) { return t * t * (3 - 2 * t); }
+
+ function jumpToTier(tierEl) {
+ if (!avatar || tierEl === activeTier) return;
+ // Visual: mark the new tier active, clear the old one
+ if (activeTier) activeTier.classList.remove('is-active');
+ activeTier = tierEl;
+ activeTier.classList.add('is-active');
+
+ phase = 'jumping';
+ jumpT = 0;
+ jumpStart = { x: avatar.position.x, y: avatar.position.y };
+ jumpEnd = standOnTopOf(tierEl);
+ // Lift the arc proportionally to horizontal distance + a baseline
+ const dx = Math.abs(jumpEnd.x - jumpStart.x);
+ jumpLift = Math.max(1.2, dx * 0.32);
+ setAnimation('jump', { loop: false, hold: true });
+ // Face direction of travel
+ const dir = Math.sign(jumpEnd.x - jumpStart.x) || 0;
+ gsap.to(avatar.rotation, { y: dir * 0.25, duration: 0.2, overwrite: true });
+ }
+
+ function landOnTier() {
+ phase = 'idle';
+ avatar.position.set(jumpEnd.x, jumpEnd.y, 0);
+ // Card "thump" on landing — sells weight
+ const t = activeTier;
+ gsap.killTweensOf(t);
+ gsap.fromTo(t, { y: 0 }, {
+ y: 3, duration: 0.08, ease: 'power3.out',
+ onComplete: () => gsap.to(t, { y: 0, duration: 0.5, ease: 'elastic.out(1.2, 0.4)' })
+ });
+ // Face camera so the "point" reads clearly
+ gsap.to(avatar.rotation, { y: 0, duration: 0.25, overwrite: true });
+ setAnimation('reaction', { loop: false, hold: true });
+ // Settle back into idle after the point
+ setTimeout(() => {
+ if (phase === 'idle' && activeTier === t) setAnimation('idle', { loop: true });
+ }, 1500);
+ }
+
+ // ── Hover dispatch with debounce ─────────────────────────────────
+ // Without debouncing, sweeping the cursor across three tiers triggers
+ // three jumps stacking on each other. We wait ~120ms of stable hover
+ // before committing — feels intentional, not jittery.
+ let hoverTimer = null;
+ function scheduleJump(tierEl) {
+ clearTimeout(hoverTimer);
+ if (tierEl === activeTier) return;
+ hoverTimer = setTimeout(() => {
+ if (phase === 'jumping') {
+ // Queue: re-check at the end of the current jump
+ setTimeout(() => scheduleJump(tierEl), 200);
+ } else {
+ jumpToTier(tierEl);
+ }
+ }, 120);
+ }
+
+ tiers.forEach(t => {
+ t.addEventListener('mouseenter', () => scheduleJump(t));
+ });
+
+ // CTA clicks — give a celebrate animation, prevent navigation in the demo
+ document.querySelectorAll('[data-tier-cta]').forEach(cta => {
+ cta.addEventListener('click', e => {
+ e.preventDefault();
+ if (!avatar) return;
+ setAnimation('celebrate', { loop: false, hold: false });
+ setTimeout(() => {
+ if (phase === 'idle') setAnimation('idle', { loop: true });
+ }, 1800);
+ });
+ });
+
+ // ── Camera parallax ───────────────────────────────────────────────
+ let mouseNx = 0, mouseNy = 0;
+ window.addEventListener('mousemove', e => {
+ mouseNx = (e.clientX / window.innerWidth) * 2 - 1;
+ mouseNy = (e.clientY / window.innerHeight) * 2 - 1;
+ });
+
+ // ── ResizeObserver on each tier so reflow re-snaps the avatar ────
+ const ro = new ResizeObserver(() => {
+ if (avatar && activeTier && phase !== 'jumping') {
+ const t = standOnTopOf(activeTier);
+ gsap.killTweensOf(avatar.position);
+ gsap.to(avatar.position, { x: t.x, y: t.y, duration: 0.35, overwrite: true });
+ }
+ });
+ tiers.forEach(t => ro.observe(t));
+
+ // ── Loader ────────────────────────────────────────────────────────
+ const CLIPS = ['idle', 'walk', 'jump', 'reaction', 'celebrate'];
+
+ new GLTFLoader().load('/avatars/cz.glb', gltf => {
+ avatar = gltf.scene;
+ avatar.traverse(n => {
+ if (!rootBone && /^(Hips|Root|mixamorig:?Hips)$/i.test(n.name)) rootBone = n;
+ });
+ avatar.rotation.y = 0;
+ scene.add(avatar);
+
+ mixer = new THREE.AnimationMixer(avatar);
+
+ Promise.all(CLIPS.map(name =>
+ fetch(`/animations/clips/${name}.json`).then(r => r.json())
+ )).then(jsons => {
+ CLIPS.forEach((name, i) => {
+ actions[name] = mixer.clipAction(THREE.AnimationClip.parse(jsons[i]));
+ });
+
+ if (rootBone) baseRootPos = rootBone.position.clone();
+ const _r = renderer.render.bind(renderer);
+ renderer.render = (sc, cam) => {
+ try { if (rootBone && baseRootPos) rootBone.position.copy(baseRootPos); } catch (_) {}
+ _r(sc, cam);
+ };
+
+ // Start on the Pro tier (the recommended one) so first impression
+ // matches the "most popular" badge.
+ const pro = document.getElementById('tier-pro');
+ activeTier = pro;
+ pro.classList.add('is-active');
+ const start = standOnTopOf(pro);
+ avatar.position.set(start.x, start.y, 0);
+ setAnimation('idle', { loop: true });
+ phase = 'idle';
+ });
+ });
+
+ // ── Render loop ───────────────────────────────────────────────────
+ const clock = new THREE.Clock();
+ (function tick() {
+ requestAnimationFrame(tick);
+ try {
+ const dt = Math.min(clock.getDelta(), 0.05);
+ mixer?.update(dt);
+
+ if (phase === 'jumping' && avatar && jumpStart && jumpEnd) {
+ jumpT += dt;
+ const p = Math.min(jumpT / JUMP_S, 1);
+ const e = smoothstep(p);
+ const x = jumpStart.x + (jumpEnd.x - jumpStart.x) * e;
+ const arc = jumpLift * 4 * p * (1 - p);
+ const y = jumpStart.y + (jumpEnd.y - jumpStart.y) * e + arc;
+ avatar.position.set(x, y, 0);
+ // Subtle in-flight yaw — peaks mid-arc
+ const dir = Math.sign(jumpEnd.x - jumpStart.x) || 0;
+ avatar.rotation.y = dir * 0.22 * Math.sin(Math.PI * p);
+ if (p >= 1) landOnTier();
+ }
+
+ // Camera parallax
+ const targetCamX = mouseNx * 0.1;
+ const targetCamY = -mouseNy * 0.07;
+ camera.position.x += (targetCamX - camera.position.x) * 0.04;
+ camera.position.y += (targetCamY - camera.position.y) * 0.04;
+
+ renderer.render(scene, camera);
+ } catch (_) {}
+ })();
+ </script>
+ </body>
+</html>
diff --git a/public/discover/index.html b/public/discover/index.html
index bf4b97918..35cb9b6c2 100644
--- a/public/discover/index.html
+++ b/public/discover/index.html
@@ -67,6 +67,7 @@
<span>View my agents →</span>
</a>
</div>
+ <p class="explore-eyebrow">ERC-8004 Agent Directory</p>
<h1>Every agent, every chain.</h1>
<p class="explore-sub">
The complete on-chain index of ERC-8004 agents. Click a 3D avatar to load it in
diff --git a/scripts/verify-agent-new.mjs b/scripts/verify-agent-new.mjs
new file mode 100644
index 000000000..70bbfee31
--- /dev/null
+++ b/scripts/verify-agent-new.mjs
@@ -0,0 +1,98 @@
+// Headless smoke test for /agent/new?avatar_id=... and /agent/<uuid>/edit.
+// Verifies the create-from-avatar flow lands on agent-edit.html and that the
+// edit page correctly resolves agentId from the canonical clean URL.
+// Run while `npm run dev` is up on port 3000 (override with PORT=3001).
+import puppeteer from 'puppeteer';
+
+const PORT = process.env.PORT || '3000';
+const BASE = `http://localhost:${PORT}`;
+const AVATAR_ID = '89ae91e6-89cb-444e-a83e-368bbfce9388';
+const AVATAR_NAME = 'Soldier (three.js)';
+const AVATAR_GLB = 'https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/u/86985f55-ad3d-4a06-a8c7-056704645dc0/soldier-threejs/mojcl8lp.glb';
+const FAKE_EDIT_UUID = '11111111-2222-3333-4444-555555555555';
+
+const browser = await puppeteer.launch({
+ executablePath: '/home/codespace/.cache/puppeteer/chrome/linux-148.0.7778.97/chrome-linux64/chrome',
+ args: ['--no-sandbox', '--disable-dev-shm-usage'],
+ defaultViewport: { width: 1280, height: 800 },
+});
+
+const consoleErrors = [];
+const apiCalls = [];
+
+function attach(page, label) {
+ page.on('console', msg => {
+ const t = msg.type();
+ if (t === 'error') consoleErrors.push(`[${label}] ${msg.text()}`);
+ if (process.env.LOG_ALL) console.log(`[${label} ${t}] ${msg.text()}`);
+ });
+ page.on('pageerror', err => consoleErrors.push(`[${label}] pageerror: ${err.message}`));
+ page.on('request', req => {
+ const url = req.url();
+ if (url.includes('/api/agents')) apiCalls.push(`[${label}] ${req.method()} ${url.replace(BASE, '')}`);
+ });
+}
+
+async function close(reason, ok) {
+ await browser.close();
+ if (!ok) {
+ console.error(`\nFAIL: ${reason}`);
+ process.exit(1);
+ }
+ console.log(`\nOK: ${reason}`);
+}
+
+// ── Case 1: /agent/new with avatar params → should serve agent-edit.html ──
+console.log('Case 1: /agent/new?avatar_id=… → should serve agent-edit.html');
+const p1 = await browser.newPage();
+attach(p1, 'agent/new');
+const url1 = `${BASE}/agent/new?avatar_id=${AVATAR_ID}&avatar_name=${encodeURIComponent(AVATAR_NAME)}&avatar_glb=${encodeURIComponent(AVATAR_GLB)}`;
+await p1.goto(url1, { waitUntil: 'domcontentloaded', timeout: 15000 });
+const title1 = await p1.title();
+const isEditPage = title1.startsWith('Edit Agent');
+console.log(` title: ${title1}`);
+console.log(` is agent-edit.html: ${isEditPage}`);
+if (!isEditPage) await close('/agent/new served the wrong page (regressed to agent-home)', false);
+
+// Give the script a moment to run loadAgent() and attempt the POST. We don't
+// require it to succeed (no signed-in session in headless) — we only require
+// that the create flow was *attempted*, proving avatar params were read.
+await new Promise(r => setTimeout(r, 1500));
+const sawPost = apiCalls.some(c => c.includes('POST /api/agents'));
+console.log(` /api/agents POST attempted: ${sawPost}`);
+console.log(` api calls: ${apiCalls.join(' | ') || '(none)'}`);
+if (!sawPost) await close('agent-edit.js did not POST to /api/agents — avatar params were not consumed', false);
+
+// ── Case 2: /agent/<uuid>/edit → resolver must extract UUID from pathname ──
+console.log('\nCase 2: /agent/<uuid>/edit → resolver must extract UUID from pathname');
+apiCalls.length = 0;
+const p2 = await browser.newPage();
+attach(p2, 'agent/edit');
+await p2.goto(`${BASE}/agent/${FAKE_EDIT_UUID}/edit`, { waitUntil: 'domcontentloaded', timeout: 15000 });
+await new Promise(r => setTimeout(r, 1500));
+const sawGet = apiCalls.some(c => c.includes(`GET /api/agents/${FAKE_EDIT_UUID}`));
+console.log(` GET /api/agents/<uuid> attempted: ${sawGet}`);
+console.log(` api calls: ${apiCalls.join(' | ') || '(none)'}`);
+if (!sawGet) await close('agent-edit.js did not GET /api/agents/<uuid> — pathname resolver broken', false);
+
+// ── Case 3: console errors check (ignore expected ones) ──
+console.log('\nCase 3: console errors');
+const ignorable = [
+ 'SES',
+ 'lockdown-install',
+ 'buffer.Buffer',
+ 'externalized for browser compatibility',
+ '401', // expected when signed out
+ 'Failed to load resource',
+ 'net::ERR_',
+ 'login_redirect',
+];
+const real = consoleErrors.filter(e => !ignorable.some(ig => e.includes(ig)));
+if (real.length) {
+ console.error(' unexpected console errors:');
+ real.forEach(e => console.error(` - ${e}`));
+ await close('console errors detected', false);
+}
+console.log(` (${consoleErrors.length} total, all ignorable noise — 401/SES/buffer)`);
+
+await close('routing + resolver verified for both flows', true);
diff --git a/src/agent-edit.js b/src/agent-edit.js
index c2338e26d..f418f1c90 100644
--- a/src/agent-edit.js
+++ b/src/agent-edit.js
@@ -3,7 +3,21 @@ import { saveRemoteGlbToAccount } from './account.js';
const API_BASE = '/api';
const params = new URLSearchParams(location.search);
-const agentId = params.get('id');
+
+// Resolve agent id from the canonical clean URL /agent/<uuid>(/edit)?, falling
+// back to the legacy /agent-edit.html?id=<uuid> querystring form. Kept as a
+// `let` so it can be reassigned after the create-from-avatar flow mints a real
+// agent — every fetch below uses this value, so the URL must stay the source
+// of truth across both create and edit flows.
+const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
+function resolveAgentIdFromUrl() {
+ const seg = location.pathname.split('/').filter(Boolean);
+ // /agent/<id>(/edit)? → seg = ['agent', '<id>', 'edit'?]
+ if (seg[0] === 'agent' && seg[1] && UUID_RE.test(seg[1])) return seg[1];
+ const qid = params.get('id');
+ return qid && UUID_RE.test(qid) ? qid : null;
+}
+let agentId = resolveAgentIdFromUrl();
// Avatar handoff from marketplace modal ("Start an agent with this avatar")
const initAvatarId = params.get('avatar_id') || null;
@@ -79,6 +93,7 @@ async function createAgentFromAvatar() {
}
history.replaceState({}, '', `/agent/${agent.id}/edit`);
+ agentId = agent.id;
agentData = agent;
if (initAvatarName) {
agentData.name = name;
diff --git a/tests/api/pump.test.js b/tests/api/pump.test.js
index 9e41d74a8..9f2167a67 100644
--- a/tests/api/pump.test.js
+++ b/tests/api/pump.test.js
@@ -57,6 +57,9 @@ vi.mock('../../api/_lib/pump.js', () => ({
fetchGlobal: async () => ({}),
createInstruction: async () => ({ keys: [], data: Buffer.alloc(0) }),
createAndBuyInstructions: async () => [{ keys: [], data: Buffer.alloc(0) }],
+ createV2Instruction: async () => ({ keys: [], data: Buffer.alloc(0) }),
+ createV2AndBuyInstructions: async () => [{ keys: [], data: Buffer.alloc(0) }],
+ createV2AndBuyV2Instructions: async () => [{ keys: [], data: Buffer.alloc(0) }],
},
BN: function MockBN(v) { this.v = v; this.toString = () => String(v); },
web3: { LAMPORTS_PER_SOL: 1_000_000_000 },
diff --git a/tests/branding-allowlist.json b/tests/branding-allowlist.json
index 87a5a3276..57467b081 100644
--- a/tests/branding-allowlist.json
+++ b/tests/branding-allowlist.json
@@ -103,5 +103,243 @@
"pattern": "avaturn.me/developer",
"file": "*",
"reason": "Developer portal URL reference in configuration docs."
+ },
+
+ {
+ "pattern": "Avaturn",
+ "file": "docs/avatar-creation.md",
+ "reason": "Integration documentation describing the photo-to-avatar pipeline — vendor name required to identify the integration the doc explains."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/docs/avatar-creation.md",
+ "reason": "Public mirror of the integration documentation — same scope as docs/avatar-creation.md."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "docs/character-studio.md",
+ "reason": "Comparison section in the avatar builder doc explicitly contrasts the two upstream tools."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/docs/character-studio.md",
+ "reason": "Public mirror of the avatar builder comparison doc."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "docs/animations.md",
+ "reason": "Animation retargeting docs reference the upstream rig the pipeline was authored against."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "docs/club/PLAN.md",
+ "reason": "Internal planning doc — references the upstream skeleton the animation system standardised on."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "docs/internal/PROGRESS.md",
+ "reason": "Internal progress notes mentioning the upstream pipeline as historical context."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "docs/internal/api-inventory.md",
+ "reason": "Internal API inventory — describes which routes delegate to the upstream photo pipeline."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/docs/configuration.md",
+ "reason": "Configuration reference describing optional env vars that point at the upstream photo-pipeline editor."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/docs/deployment.md",
+ "reason": "Deployment guide describes the optional photo-pipeline integration block."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/docs/tutorials/getting-started.md",
+ "reason": "Tutorial link to the photo-pipeline integration page — the vendor name identifies the route."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "src/avaturn-client.js",
+ "reason": "JSDoc on the dedicated photo-pipeline client module — the brand identifies the upstream protocol being wrapped."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "src/guest-avatar.js",
+ "reason": "JSDoc enumerates the allowed values of an internal source field; 'avaturn' is one of those literal protocol values."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "avatar-sdk/README.md",
+ "reason": "SDK README — describes which upstream pipelines the bundled creator wraps."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "avatar-sdk/types/creator.d.ts",
+ "reason": "Public type — the session URL field name maps to the upstream photo-pipeline protocol."
+ },
+ {
+ "pattern": "avaturnSessionUrl",
+ "file": "avatar-sdk/types/creator.d.ts",
+ "reason": "Public type field name — fixed by the upstream protocol the SDK wraps."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "avatar-sdk/types/creator.d.ts",
+ "reason": "Public type JSDoc describes the in-browser builder origin field."
+ },
+ {
+ "pattern": "'avaturn'",
+ "file": "src/guest-avatar.js",
+ "reason": "JSDoc enumerates the allowed literal values of an internal `source` field; 'avaturn' is one of those protocol values."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "README.md",
+ "reason": "Top-level README enumerates the bundled vendor integrations."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "publish/README.md",
+ "reason": "Published SDK README mirrors the top-level integration list."
+ },
+ {
+ "pattern": "avaturn",
+ "file": "README.md",
+ "reason": "Env-var default value (`AVATAR_REGEN_PROVIDER=none | avaturn`) documented in the README."
+ },
+ {
+ "pattern": "avaturn",
+ "file": "publish/README.md",
+ "reason": "Same env-var default value mirrored in the published README."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/demo/avatar-os/index.html",
+ "reason": "Internal research demo (`/demo/avatar-os/`) that explicitly documents what the upstream pipeline is being replaced by."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/demo/avatar-os/selfie.html",
+ "reason": "Internal research demo describing the selfie-pipeline migration."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/demo/avatar-os/studio.html",
+ "reason": "Internal research demo describing the in-browser-builder migration."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/demos/3d-home.html",
+ "reason": "JS comment in the 3D homepage describing the rigged demo avatar."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "public/demos/selfie-fit.html",
+ "reason": "JS comments describing the selfie-fit demo's postMessage protocol with the upstream editor."
+ },
+
+ {
+ "pattern": "Character Studio",
+ "file": "docs/character-studio.md",
+ "reason": "Dedicated documentation for the bundled in-browser avatar builder — the proper name is the page title."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "public/docs/character-studio.md",
+ "reason": "Public mirror of the bundled avatar builder documentation."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "docs/avatar-creation.md",
+ "reason": "Cross-reference to the builder doc."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "public/docs/avatar-creation.md",
+ "reason": "Public mirror cross-references the builder doc."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "docs/contributing.md",
+ "reason": "Contribution guide references the bundled avatar builder."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "public/docs/contributing.md",
+ "reason": "Public mirror of the contribution guide."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "public/docs/configuration.md",
+ "reason": "Configuration reference describes the builder's optional integration env."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "public/docs/deployment.md",
+ "reason": "Deployment guide describes the builder's optional integration."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "docs/demo-routes.md",
+ "reason": "Demo routes table lists the rebranded Avatar Studio (formerly Character Studio fork)."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "avatar-sdk/README.md",
+ "reason": "SDK README — describes which builder is bundled."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "README.md",
+ "reason": "Top-level README enumerates the bundled integrations."
+ },
+ {
+ "pattern": "Character Studio",
+ "file": "publish/README.md",
+ "reason": "Published SDK README mirrors the top-level integration list."
+ },
+ {
+ "pattern": "CharacterStudio",
+ "file": "public/demo/avatar-os/index.html",
+ "reason": "Internal research demo embedding the open-source @m3-org/characterstudio package — package identifier is technical."
+ },
+ {
+ "pattern": "CharacterStudio",
+ "file": "public/demo/avatar-os/studio.html",
+ "reason": "Internal research demo embedding the open-source @m3-org/characterstudio package."
+ },
+ {
+ "pattern": "CharacterStudio",
+ "file": "public/demo/avatar-os/live.html",
+ "reason": "Internal research demo describing the default VRM source — references the upstream project name."
+ },
+ {
+ "pattern": "characterstudio",
+ "file": "*",
+ "reason": "Lowercase identifier appears in npm package names (@m3-org/characterstudio), iframe postMessage source values, and config env vars — all internal protocol surfaces."
+ },
+
+ {
+ "pattern": "Ready Player Me",
+ "file": "avatar-sdk/README.md",
+ "reason": "SDK README explains the project is a drop-in replacement for the now-acquired upstream SDK — historical comparison is the reader's reason for reading."
+ },
+ {
+ "pattern": "Ready Player Me",
+ "file": "public/docs/deployment.md",
+ "reason": "Deployment doc explains which upstream iframe the bundled builder replaces."
+ },
+ {
+ "pattern": "Ready Player Me",
+ "file": "public/demos/index.html",
+ "reason": "Demo description references the WebXR seated variant the upstream SDK historically shipped."
+ },
+ {
+ "pattern": "RPM",
+ "file": "avatar-sdk/README.md",
+ "reason": "SDK README — same context as the Ready Player Me reference above; abbreviation appears alongside the full name."
}
]
diff --git a/vite.config.js b/vite.config.js
index 5683dece6..902a38275 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -287,6 +287,7 @@ const appConfig = {
'/features': resolve(root, 'pages/features.html'),
'/features/': resolve(root, 'pages/features.html'),
'/agent': resolve(root, 'pages/agent-home.html'),
+ '/agent/new': resolve(root, 'pages/agent-edit.html'),
'/docs': resolve(root, 'docs/index.html'),
'/docs/': resolve(root, 'docs/index.html'),
'/bazaar': resolve(root, 'public/bazaar.html'),