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: walk footstep trails + walk-with-this-agent mode

miniaturization809c192211bf
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6abb4c9ad..93b2ae412 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -35,6 +35,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Smoother landing page on hover** — The homepage's parallax hero and 3D stack-card glow used to read the page layout on every pointer move, which could make the cursor feel sticky on the first page new visitors see. Those effects now batch their work to one frame at a time, so hover and tilt stay buttery on any device. (`/`) `[improvement]`
- **Solana is now the default payment network** — Solana is now the default everywhere you pick a chain — the dashboard's Default payment network setting, x402 merchant settlement, and the monetization payout wallet all default to Solana for every user, with Solana listed first. Base and Polygon remain available if you prefer an EVM chain. (`/dashboard`) `[improvement]`
- **The $THREE page now spells out why to hold — four real utility pillars** — The $THREE page leads with a clear "Why hold $THREE" section: revenue buybacks (a fixed, live share of platform revenue buys $THREE on the open market), holder rewards (every paid action reflects $THREE back to holders pro-rata), hold-to-access (discounts, higher quotas, and pro perks), and real usage (deploying agents, forging avatars, and trading the marketplace all run on $THREE). Each pillar maps to a mechanism that actually exists on the platform, and the buyback figure is wired to the live commitment. The page's market data also now rides a shared cache, so it stays fast and reliable under heavy traffic. (`/three-token`) `[feature, improvement]`
+- **Walk with any agent, and leave a trail** — Every agent profile now has a “Walk with this agent” action and a live preview that renders that specific agent walking — the walk embed can now load any agent’s avatar by id. And the walking avatar leaves an aesthetic trail behind it (footprints, a glow, or a fading line, your pick) both in the full walk scene and the site-wide companion. (`/walk`) `[feature, improvement]`
- **Your avatar now walks anywhere — new Walk hub, leaderboard, and creator analytics** — There's a dedicated home for the walking avatar at /walk with live demos across six environments, an embeddable one-tag widget, and a Chrome-extension CTA. A new global leaderboard ranks walkers by distance, sites visited, and time (daily / weekly / all-time), and creators who embed an avatar get a private analytics dashboard — sessions, average duration, distance, top embed origins, and custom conversion events. Page-to-page navigation also gained themed, motion-aware transitions. (`/walk`) `[feature]`
## 2026-06-20
diff --git a/data/changelog.json b/data/changelog.json
index 52101b66c..d8f6322a9 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-06-21",
+ "title": "Walk with any agent, and leave a trail",
+ "summary": "Every agent profile now has a “Walk with this agent” action and a live preview that renders that specific agent walking — the walk embed can now load any agent’s avatar by id. And the walking avatar leaves an aesthetic trail behind it (footprints, a glow, or a fading line, your pick) both in the full walk scene and the site-wide companion.",
+ "tags": [
+ "feature",
+ "improvement"
+ ],
+ "link": "/walk"
+ },
{
"date": "2026-06-21",
"title": "Discover and Marketplace now browse the same way",
diff --git a/pages/agent-detail.html b/pages/agent-detail.html
index a62547a10..c6dd5d88c 100644
--- a/pages/agent-detail.html
+++ b/pages/agent-detail.html
@@ -135,6 +135,76 @@
.ad-trade-pnl { font-size: 12px; color: var(--ink-dim, #888); min-width: 64px; text-align: right; }
.ad-trade-pnl.positive { color: #22d160; }
.ad-trade-pnl.negative { color: #ff4545; }
+
+ /* Walk-with-this-agent preview card. Token-styled: reuses the page's
+ surface/border variables so it reads as one of the agent cards. */
+ .ad-walk-card .ad-preview-hint { margin-left: auto; font-size: 11px; color: var(--ink-dim, #888); }
+ .ad-walk-stage {
+ position: relative;
+ margin-top: 12px;
+ width: 100%;
+ max-width: 280px;
+ aspect-ratio: 3 / 4;
+ border-radius: 14px;
+ overflow: hidden;
+ background:
+ radial-gradient(ellipse 70% 60% at 50% 35%, rgba(124, 92, 255, 0.16), transparent 70%),
+ var(--surface2, rgba(255, 255, 255, 0.04));
+ border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
+ }
+ .ad-walk-frame {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ border: 0;
+ display: block;
+ transition: opacity 0.4s ease;
+ }
+ .ad-walk-skeleton {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 14px;
+ pointer-events: none;
+ transition: opacity 0.3s ease;
+ }
+ .ad-walk-skeleton.is-hidden { opacity: 0; }
+ .ad-walk-skeleton-pulse {
+ width: 56px;
+ height: 56px;
+ border-radius: 50%;
+ background: rgba(124, 92, 255, 0.18);
+ box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.4);
+ animation: ad-walk-pulse 1.6s ease-out infinite;
+ }
+ .ad-walk-skeleton-label { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim, #999); }
+ @keyframes ad-walk-pulse {
+ 0% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.45); }
+ 70% { box-shadow: 0 0 0 18px rgba(124, 92, 255, 0); }
+ 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0); }
+ }
+ @media (prefers-reduced-motion: reduce) {
+ .ad-walk-skeleton-pulse { animation: none; }
+ .ad-walk-frame { transition: none; }
+ }
+ .ad-walk-error {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: 12px;
+ padding: 16px;
+ text-align: center;
+ }
+ .ad-walk-error[hidden] { display: none; }
+ .ad-walk-error-msg { font-size: 13px; color: var(--ink-dim, #aaa); max-width: 200px; }
+ .ad-walk-expand { margin-top: 14px; }
</style>
<link rel="stylesheet" href="/nav.css" />
<link rel="stylesheet" href="/footer.css" />
@@ -314,6 +384,20 @@
</svg>
See in 3D
</a>
+ <a
+ id="ad-walk-link"
+ class="ad-btn ad-btn-primary"
+ href="/walk/app"
+ aria-label="Walk with this agent — drive its avatar around in real time"
+ >
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="margin-right: 6px">
+ <circle cx="13" cy="4" r="2" />
+ <path d="M7 21l3-6 2-3" />
+ <path d="M10 12l-1-4 4 1 2 3 3 1" />
+ <path d="M9 8l-2 1-2 4" />
+ </svg>
+ Walk with this agent
+ </a>
<a
id="ad-irl-link"
class="ad-btn"
@@ -385,6 +469,45 @@
</div>
</section>
+ <section class="ad-card ad-walk-card" id="ad-walk-card" hidden>
+ <div class="ad-card-head">
+ <span class="ad-bullet ad-bullet-violet"></span>
+ <h2>WALK WITH THIS AGENT</h2>
+ <span class="ad-preview-hint">Drive its avatar in real time</span>
+ </div>
+ <div class="ad-walk-stage" id="ad-walk-stage">
+ <div class="ad-walk-skeleton" id="ad-walk-skeleton" aria-hidden="true">
+ <span class="ad-walk-skeleton-pulse"></span>
+ <span class="ad-walk-skeleton-label">Loading avatar…</span>
+ </div>
+ <iframe
+ id="ad-walk-frame"
+ class="ad-walk-frame"
+ title="Walking 3D avatar preview"
+ loading="lazy"
+ allow="accelerometer; gyroscope; xr-spatial-tracking"
+ style="opacity: 0"
+ ></iframe>
+ <div class="ad-walk-error" id="ad-walk-error" hidden>
+ <span class="ad-walk-error-msg">Couldn’t load the walking preview.</span>
+ <button type="button" class="ad-btn" id="ad-walk-retry">Retry</button>
+ </div>
+ </div>
+ <a
+ class="ad-btn ad-btn-primary ad-walk-expand"
+ id="ad-walk-expand"
+ href="/walk/app"
+ aria-label="Open the full walk experience with this agent"
+ >
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="margin-right: 6px">
+ <path d="M15 3h6v6" />
+ <path d="M10 14L21 3" />
+ <path d="M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5" />
+ </svg>
+ Open full walk
+ </a>
+ </section>
+
<section class="ad-card ad-sale-card" id="ad-sale-card" hidden>
<div class="ad-card-head">
<span class="ad-bullet ad-bullet-green"></span>
diff --git a/public/changelog.json b/public/changelog.json
index 8fcdb1448..458aed713 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-21T06:55:54.110Z",
+ "generated_at": "2026-06-21T07:11:53.313Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -316,6 +316,17 @@
"improvement"
]
},
+ {
+ "date": "2026-06-21",
+ "type": "update",
+ "title": "Walk with any agent, and leave a trail",
+ "summary": "Every agent profile now has a “Walk with this agent” action and a live preview that renders that specific agent walking — the walk embed can now load any agent’s avatar by id. And the walking avatar leaves an aesthetic trail behind it (footprints, a glow, or a fading line, your pick) both in the full walk scene and the site-wide companion.",
+ "link": "/walk",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
{
"date": "2026-06-21",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 786f1c274..6f11399cf 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -238,6 +238,14 @@
<category>feature</category>
<description>The $THREE page leads with a clear &quot;Why hold $THREE&quot; section: revenue buybacks (a fixed, live share of platform revenue buys $THREE on the open market), holder rewards (every paid action reflects $THREE back to holders pro-rata), hold-to-access (discounts, higher quotas, and pro perks), and real usage (deploying agents, forging avatars, and trading the marketplace all run on $THREE). Each pillar maps to a mechanism that actually exists on the platform, and the buyback figure is wired to the live commitment. The page's market data also now rides a shared cache, so it stays fast and reliable under heavy traffic.</description>
</item>
+ <item>
+ <title>Walk with any agent, and leave a trail</title>
+ <link>https://three.ws/walk</link>
+ <guid isPermaLink="false">2026-06-21:Walk with any agent, and leave a trail</guid>
+ <pubDate>Sun, 21 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Every agent profile now has a “Walk with this agent” action and a live preview that renders that specific agent walking — the walk embed can now load any agent’s avatar by id. And the walking avatar leaves an aesthetic trail behind it (footprints, a glow, or a fading line, your pick) both in the full walk scene and the site-wide companion.</description>
+ </item>
<item>
<title>Your avatar now walks anywhere — new Walk hub, leaderboard, and creator analytics</title>
<link>https://three.ws/walk</link>
diff --git a/public/features.json b/public/features.json
index 7ba76ff0d..9759bcef7 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-21T06:55:54.099Z",
+ "generated_at": "2026-06-21T07:11:53.291Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/agent-detail.js b/src/agent-detail.js
index 4e7dade6a..de28c1d82 100644
--- a/src/agent-detail.js
+++ b/src/agent-detail.js
@@ -115,6 +115,110 @@ function xrHref(agent) {
return id ? `/xr?avatar=${encodeURIComponent(id)}` : '/xr';
}
+// Deep-link into the full walk experience (/walk/app, which serves the same
+// runtime as /walk-embed). Pass the avatar id when present — the embed routes it
+// through the same-origin GLB proxy that works from any host — and always pass
+// `agent=` so the runtime can resolve the body (and any future persona) even when
+// no avatar id is attached, falling back to the mannequin. Joystick controls so a
+// visitor can immediately drive the avatar.
+function walkAppHref(agent) {
+ const sp = new URLSearchParams();
+ if (agent?.avatar_id) sp.set('avatar', agent.avatar_id);
+ if (agent?.id) sp.set('agent', agent.id);
+ sp.set('controls', 'joystick');
+ return `/walk/app?${sp.toString()}`;
+}
+
+// Source URL for the inline preview iframe. Autoplaying (avatar walks an idle
+// circle), joystick-driven, on the studio environment with a transparent
+// background so the card's own gradient shows through.
+function walkEmbedSrc(agent) {
+ const sp = new URLSearchParams();
+ if (agent?.avatar_id) sp.set('avatar', agent.avatar_id);
+ if (agent?.id) sp.set('agent', agent.id);
+ sp.set('controls', 'joystick');
+ sp.set('autoplay', 'true');
+ sp.set('env', 'studio');
+ return `/walk-embed?${sp.toString()}`;
+}
+
+// Wire the hero "Walk with this agent" CTA plus the inline walking-avatar preview
+// card. The card self-manages loading / error / populated states off the embed's
+// postMessage handshake (walk:ready) and the iframe's own load/error events.
+function wireWalkMode(agent) {
+ const cta = document.getElementById('ad-walk-link');
+ if (cta) cta.href = walkAppHref(agent);
+
+ const card = document.getElementById('ad-walk-card');
+ const frame = document.getElementById('ad-walk-frame');
+ const skeleton = document.getElementById('ad-walk-skeleton');
+ const errorBox = document.getElementById('ad-walk-error');
+ const retry = document.getElementById('ad-walk-retry');
+ const expand = document.getElementById('ad-walk-expand');
+ if (!card || !frame) return;
+
+ if (expand) expand.href = walkAppHref(agent);
+
+ // Idempotent: re-render (avatar refresh) shouldn't stack listeners/timers.
+ if (frame._walkWired) clearTimeout(frame._walkTimer);
+ frame._walkWired = true;
+
+ const src = walkEmbedSrc(agent);
+ card.hidden = false;
+
+ const showReady = () => {
+ clearTimeout(frame._walkTimer);
+ if (errorBox) errorBox.hidden = true;
+ skeleton?.classList.add('is-hidden');
+ frame.style.opacity = '1';
+ };
+ const showError = () => {
+ clearTimeout(frame._walkTimer);
+ skeleton?.classList.add('is-hidden');
+ frame.style.opacity = '0';
+ if (errorBox) errorBox.hidden = false;
+ };
+
+ // The embed posts { channel:'three-walk', type:'walk:ready' } once the GLB +
+ // animations are live (see src/walk-embed-events.js CHANNEL/OUTBOUND.READY).
+ // Listen for it (origin- and source-checked) to fade the avatar in; the iframe
+ // `load` event only means the document loaded, not that the 3D scene is ready.
+ if (!frame._walkMsgWired) {
+ frame._walkMsgWired = true;
+ window.addEventListener('message', (e) => {
+ if (e.source !== frame.contentWindow) return;
+ if (e.origin !== location.origin) return;
+ const data = e.data;
+ if (data && data.channel === 'three-walk' && data.type === 'walk:ready') {
+ showReady();
+ }
+ });
+ }
+
+ const start = () => {
+ frame.style.opacity = '0';
+ skeleton?.classList.remove('is-hidden');
+ if (errorBox) errorBox.hidden = true;
+ // Belt-and-suspenders: if walk:ready never arrives (e.g. WebGL blocked),
+ // reveal whatever the iframe rendered after a grace period instead of an
+ // indefinite skeleton. A hard iframe `error` flips to the error state.
+ clearTimeout(frame._walkTimer);
+ frame._walkTimer = setTimeout(showReady, 9000);
+ frame.src = src;
+ };
+
+ if (!frame._walkErrWired) {
+ frame._walkErrWired = true;
+ frame.addEventListener('error', showError);
+ }
+ if (retry && !retry._wired) {
+ retry._wired = true;
+ retry.addEventListener('click', start);
+ }
+
+ start();
+}
+
function el(tag, props = {}, children = []) {
const node = document.createElement(tag);
for (const [k, v] of Object.entries(props)) {
@@ -465,6 +569,11 @@ function render(agent) {
const xrLink = $('ad-xr-link');
if (xrLink) xrLink.href = xrHref(agent);
+ // "Walk with this agent" — the hero CTA and the inline walking preview card,
+ // both pointed at /walk/app + /walk-embed with this agent's avatar. Every agent
+ // has a resolvable body (custom GLB or mannequin), so the mode is always live.
+ wireWalkMode(agent);
+
// View switcher: flip this agent between its detail, 3D world, and embed
// presentations. Every agent has a 3D body (custom GLB or mannequin).
mountViewSwitcher($('view-switch-slot'), {
diff --git a/src/walk-companion.js b/src/walk-companion.js
index c7644b569..3b6eca973 100644
--- a/src/walk-companion.js
+++ b/src/walk-companion.js
@@ -14,6 +14,7 @@
import { createWalkCompanion } from '../walk-sdk/src/companion.js';
import { installTransitions } from './walk-companion-transitions.js';
+import { createWalkTrails2D, createTrailSetting, TRAIL_STYLE_LABELS } from './walk-trails.js';
const walk = createWalkCompanion({
// Static GLBs and the animation manifest are served from this origin.
@@ -59,4 +60,181 @@ installTransitions({
onNavStart: onTransitionNavStart,
});
+// ── Path-trail visualization (Task 36) ──────────────────────────────────────
+// Paint where the companion has been: footprints / glow / line dropped into an
+// overlay glued behind the avatar canvas while the avatar is in its walk state.
+// The companion avatar walks in place (it rotates to follow the cursor rather
+// than translating), so the trail synthesizes a gentle path beneath its feet.
+//
+// Integration is non-invasive: we never edit the SDK. We observe the live
+// instance — its host element (for the overlay rect + a small style toggle), its
+// current roster entry (for the avatar accent), and its controller (whose
+// setState we wrap to learn when it's walking). All three are re-resolved as the
+// companion mounts, swaps avatars, and tears down, so the trail follows along.
+const TRAIL_KEY = `${(walk.config?.keys?.enabled || 'three:companion:enabled').split(':')[0]}:companion:trail`;
+const trailSetting = createTrailSetting(TRAIL_KEY, 'footprints');
+
+let trail2d = null; // active createWalkTrails2D handle
+let trailHost = null; // host element the current trail is glued to
+let trailRaf = 0;
+let trailClock = 0;
+let isWalking = false; // captured from the patched controller.setState
+let patchedController = null; // controller whose setState we've wrapped
+let trailToggleBtn = null; // the small style switch added to the host chrome
+let trailAccentId = null; // entry id whose accent the trail currently uses
+
+function companionAccent() {
+ const inst = walk.instance;
+ const entry = inst?._currentEntry;
+ const a = entry?.accent;
+ return typeof a === 'string' || typeof a === 'number' ? a : null;
+}
+
+// Wrap the controller's setState exactly once per controller instance so we know
+// when the avatar is walking without touching the SDK. Re-runs after avatar
+// swaps (which mint a fresh controller).
+function syncControllerPatch() {
+ const ctrl = walk.instance?.controller;
+ if (!ctrl || ctrl === patchedController) return;
+ patchedController = ctrl;
+ const original = ctrl.setState.bind(ctrl);
+ ctrl.setState = (next) => {
+ isWalking = next === 'walk' || next === 'run';
+ return original(next);
+ };
+}
+
+// A small style switch slotted into the companion's chrome, styled to match its
+// close/swap buttons. Tap to cycle off → footprints → glow → line.
+function ensureToggleButton(host) {
+ if (trailToggleBtn && trailToggleBtn.isConnected) return;
+ const btn = document.createElement('button');
+ btn.type = 'button';
+ btn.className = 'walk-companion-trail';
+ btn.setAttribute('aria-label', 'Cycle companion path trail style');
+ btn.title = `Path trail: ${TRAIL_STYLE_LABELS[trailSetting.get()]}`;
+ btn.textContent = '∿';
+ btn.style.cssText = [
+ 'position:absolute',
+ 'top:2px',
+ 'right:54px',
+ 'z-index:3',
+ 'width:22px',
+ 'height:22px',
+ 'border:none',
+ 'border-radius:50%',
+ 'background:rgba(12,14,20,.55)',
+ 'color:#fff',
+ 'font-size:13px',
+ 'line-height:1',
+ 'cursor:pointer',
+ 'pointer-events:auto',
+ 'opacity:0',
+ 'transition:opacity .2s ease,background .2s ease',
+ 'display:grid',
+ 'place-items:center',
+ 'padding:0',
+ ].join(';');
+ btn.addEventListener('click', (e) => {
+ e.stopPropagation();
+ const next = trailSetting.cycle();
+ trail2d?.setStyle(next);
+ btn.title = `Path trail: ${TRAIL_STYLE_LABELS[next]}`;
+ btn.style.background = next === 'off' ? 'rgba(12,14,20,.55)' : 'rgba(122,162,255,.85)';
+ });
+ // Reveal the button on hover/focus of the companion, matching its siblings.
+ const styleId = 'walk-companion-trail-style';
+ if (!document.getElementById(styleId)) {
+ const s = document.createElement('style');
+ s.id = styleId;
+ s.textContent =
+ '.walk-companion:hover .walk-companion-trail,.walk-companion:focus-within .walk-companion-trail{opacity:1}' +
+ '.walk-companion-trail:hover{background:rgba(122,162,255,.85)}' +
+ '.walk-companion-trail:focus-visible{outline:2px solid #7aa2ff;outline-offset:2px;opacity:1}' +
+ '@media (pointer:coarse){.walk-companion-trail{opacity:1}}';
+ document.head.appendChild(s);
+ }
+ if (trailSetting.get() !== 'off') btn.style.background = 'rgba(122,162,255,.85)';
+ host.appendChild(btn);
+ trailToggleBtn = btn;
+}
+
+function teardownTrail() {
+ if (trailRaf) cancelAnimationFrame(trailRaf);
+ trailRaf = 0;
+ trail2d?.dispose();
+ trail2d = null;
+ trailHost = null;
+ trailToggleBtn = null;
+ patchedController = null;
+ trailAccentId = null;
+}
+
+function trailTick(now) {
+ const inst = walk.instance;
+ const host = inst?.host;
+ // The companion came or went (enable/disable, detach to playground, swap) —
+ // (re)bind the trail to whatever host is live now.
+ if (!host || !inst.mounted) {
+ if (trail2d) teardownTrail();
+ trailRaf = requestAnimationFrame(trailTick);
+ return;
+ }
+ if (host !== trailHost) {
+ teardownTrail();
+ trailHost = host;
+ trail2d = createWalkTrails2D({
+ host,
+ getColor: companionAccent,
+ getWalking: () => isWalking,
+ initialStyle: trailSetting.get(),
+ });
+ ensureToggleButton(host);
+ trailClock = now;
+ }
+ ensureToggleButton(host);
+ syncControllerPatch();
+ // Re-read the accent only when the avatar actually changed (avoids a
+ // getComputedStyle / parse on every frame).
+ const entryId = inst._currentEntry?.id ?? null;
+ if (entryId !== trailAccentId) {
+ trailAccentId = entryId;
+ trail2d.refreshColor();
+ }
+ const dt = Math.min(0.05, (now - trailClock) / 1000) || 0;
+ trailClock = now;
+ if (trailSetting.get() !== 'off') trail2d.update(dt);
+ else trail2d.clear();
+ trailRaf = requestAnimationFrame(trailTick);
+}
+
+// Expose a tiny programmatic surface so hosts / the console can drive the trail.
+walk.trails = {
+ get style() {
+ return trailSetting.get();
+ },
+ setStyle(next) {
+ const applied = trailSetting.set(next);
+ trail2d?.setStyle(applied);
+ if (trailToggleBtn) {
+ trailToggleBtn.title = `Path trail: ${TRAIL_STYLE_LABELS[applied]}`;
+ trailToggleBtn.style.background =
+ applied === 'off' ? 'rgba(12,14,20,.55)' : 'rgba(122,162,255,.85)';
+ }
+ return applied;
+ },
+ cycle() {
+ const next = trailSetting.cycle();
+ trail2d?.setStyle(next);
+ if (trailToggleBtn) {
+ trailToggleBtn.title = `Path trail: ${TRAIL_STYLE_LABELS[next]}`;
+ trailToggleBtn.style.background =
+ next === 'off' ? 'rgba(12,14,20,.55)' : 'rgba(122,162,255,.85)';
+ }
+ return next;
+ },
+};
+
+trailRaf = requestAnimationFrame(trailTick);
+
walk.bootstrap();
diff --git a/src/walk-embed.js b/src/walk-embed.js
index 9a703361f..562d65de0 100644
--- a/src/walk-embed.js
+++ b/src/walk-embed.js
@@ -56,10 +56,12 @@ const ORBIT_ENABLED = params.get('orbit') !== 'false';
const ENV_PARAM = (params.get('env') || 'studio').toLowerCase();
// Live-tracked state surfaced to the host via the typed contract. `currentAvatarId`
-// is the public identifier hosts gave us (?avatar=<id|url>) or 'default'; never a
-// resolved internal R2/CDN URL with credentials. `currentEnv` and `isReady` back
-// the walk:ready handshake + walk:ping replies.
-let currentAvatarId = params.get('avatar') || 'default';
+// is the public identifier hosts gave us (?avatar=<id|url>, else the ?agent=<id>
+// whose avatar we resolved) or 'default'; never a resolved internal R2/CDN URL
+// with credentials. `currentEnv` and `isReady` back the walk:ready handshake +
+// walk:ping replies.
+const AGENT_PARAM = params.get('agent');
+let currentAvatarId = params.get('avatar') || (AGENT_PARAM ? `agent:${AGENT_PARAM}` : 'default');
let currentEnv = ENV_PARAM;
let isReady = false;
@@ -76,22 +78,94 @@ const ENVIRONMENTS = {
grid: { bg: 0x0d0f12, ground: 0x1a1f2a, hemiSky: 0x4a5a80, hemiGround: 0x0d0f12, hemiInt: 0.7, sun: 0xffffff, sunInt: 1.3, fog: null },
};
-function resolveAvatarUrl() {
+// Hosts we'll load a raw ?avatar=<url> from. Same-origin is always allowed (the
+// iframe is served from three.ws); these extra hosts cover the R2/CDN buckets and
+// model providers three.ws itself stores avatars on. A ?avatar= URL pointing
+// anywhere else is rejected and we fall back to the default avatar, so a hostile
+// host can't make the embed fetch arbitrary third-party origins on its behalf.
+const AVATAR_HOST_ALLOWLIST = [
+ /^([a-z0-9-]+\.)*three\.ws$/i,
+ /^([a-z0-9-]+\.)*r2\.cloudflarestorage\.com$/i,
+ /^([a-z0-9-]+\.)*r2\.dev$/i,
+ /(^|\.)readyplayer\.me$/i,
+ /(^|\.)models\.readyplayer\.me$/i,
+];
+
+const GLB_PATH_RE = /\.(glb|gltf|vrm)(\?|#|$)/i;
+
+// Validate a raw ?avatar= URL. Same-origin (absolute or path-relative) always
+// passes; cross-origin must be an allow-listed host AND look like a model file.
+// Returns the loadable URL or null if it should be rejected.
+function validateAvatarUrl(raw) {
+ if (raw.startsWith('/')) return raw; // same-origin path — always safe
+ let u;
+ try {
+ u = new URL(raw, location.origin);
+ } catch {
+ return null;
+ }
+ if (u.protocol !== 'https:' && u.protocol !== 'http:') return null;
+ if (u.origin === location.origin) return u.href;
+ const hostOk = AVATAR_HOST_ALLOWLIST.some((re) => re.test(u.hostname));
+ if (!hostOk) return null;
+ if (!GLB_PATH_RE.test(u.pathname)) return null;
+ return u.href;
+}
+
+// Resolve a ?agent=<id> to that agent's GLB URL via the real agent record. The
+// /api/agents/:id endpoint returns avatar_model_url (custom GLB) and avatar_id;
+// we prefer the explicit model URL, fall back to the same-origin avatar GLB proxy
+// (which streams bytes with permissive CORS so the embed works on any host), and
+// finally to the baked mannequin so an agent is never bodiless.
+async function resolveAgentAvatarUrl(agentId) {
+ const r = await fetch(`/api/agents/${encodeURIComponent(agentId)}`, {
+ headers: { accept: 'application/json' },
+ });
+ if (!r.ok) throw new Error(`HTTP ${r.status} resolving agent avatar`);
+ const body = await r.json();
+ const rec = body?.agent || body;
+ const direct = rec?.avatar_model_url || rec?.avatar_glb_url || rec?.glb_url;
+ if (typeof direct === 'string' && GLB_PATH_RE.test(direct)) {
+ return validateAvatarUrl(direct) || `/api/avatars/${encodeURIComponent(rec.avatar_id)}/glb`;
+ }
+ if (rec?.avatar_id) return `/api/avatars/${encodeURIComponent(rec.avatar_id)}/glb`;
+ return AVATAR_URL_DEFAULT;
+}
+
+// Resolve the avatar to load from the embed params. Precedence: explicit
+// ?avatar= (raw URL or avatar id) wins; otherwise ?agent=<id> resolves to that
+// agent's GLB; otherwise the default avatar. Any failure logs and falls back to
+// the default so the embed always renders a walking body.
+async function resolveAvatarUrl() {
const id = params.get('avatar');
- if (!id) return AVATAR_URL_DEFAULT;
- // A direct GLB/VRM URL or site path loads as-is — this is how Forge/Scan
- // hand a just-generated model into the embed editor (?avatar=<glb url>),
- // the same passthrough the /play worlds use (src/game/avatar-rig.js).
- // Same-origin /cdn/ paths stay loadable from third-party iframes because
- // the iframe itself is served from three.ws.
- if (/^https?:\/\//i.test(id) || id.startsWith('/')) return id;
- // Go through the same-origin GLB proxy (api/avatars/[id]/glb) instead
- // of the metadata JSON. The proxy streams the bytes with
- // `Access-Control-Allow-Origin: *` so hosts on any origin can iframe
- // this page. Fetching the JSON first would just give us back the raw
- // R2 URL, which R2 only allows from the three.ws origin and breaks the
- // moment the embed is dropped onto a third-party site.
- return `/api/avatars/${encodeURIComponent(id)}/glb`;
+ if (id) {
+ // A direct GLB/VRM URL or site path loads as-is (validated) — this is how
+ // Forge/Scan hand a just-generated model into the embed editor
+ // (?avatar=<glb url>), the same passthrough the /play worlds use
+ // (src/game/avatar-rig.js).
+ if (/^https?:\/\//i.test(id) || id.startsWith('/')) {
+ const safe = validateAvatarUrl(id);
+ if (safe) return safe;
+ log.warn('[walk-embed] rejected ?avatar= URL (origin/host not allowed):', id);
+ return AVATAR_URL_DEFAULT;
+ }
+ // Bare avatar id: go through the same-origin GLB proxy (api/avatars/[id]/glb)
+ // instead of the metadata JSON. The proxy streams the bytes with
+ // `Access-Control-Allow-Origin: *` so hosts on any origin can iframe this
+ // page. Fetching the JSON first would just give us back the raw R2 URL,
+ // which R2 only allows from the three.ws origin and breaks the moment the
+ // embed is dropped onto a third-party site.
+ return `/api/avatars/${encodeURIComponent(id)}/glb`;
+ }
+ if (AGENT_PARAM) {
+ try {
+ return await resolveAgentAvatarUrl(AGENT_PARAM);
+ } catch (err) {
+ log.warn('[walk-embed] agent avatar resolve failed, using default:', err?.message || err);
+ return AVATAR_URL_DEFAULT;
+ }
+ }
+ return AVATAR_URL_DEFAULT;
}
const ANIMATIONS_MANIFEST_URL = '/animations/manifest.json';
@@ -412,7 +486,7 @@ function getAvatarLoader() {
async function loadAvatar() {
setStatus('loading avatar…', { sticky: true });
- const avatarUrl = resolveAvatarUrl();
+ const avatarUrl = await resolveAvatarUrl();
const loader = await getAvatarLoader();
const gltf = await loader.loadAsync(avatarUrl);
avatar = gltf.scene;
diff --git a/src/walk-trails.js b/src/walk-trails.js
new file mode 100644
index 000000000..0efeebbed
--- /dev/null
+++ b/src/walk-trails.js
@@ -0,0 +1,801 @@
+// Walk path visualization — footstep trails & routes
+// ===================================================
+// A delight layer that paints where the avatar has been. Three user-selectable
+// styles, each rendered in BOTH worlds:
+//
+// · footprints — alternating left/right marks. 3D: Three.js DecalGeometry
+// stamped onto the ground and oriented to the surface normal. 2D: DOM
+// footprint glyphs dropped behind the companion canvas.
+// · glow — a soft particle trail. 3D: a single THREE.Points cloud whose
+// per-point alpha decays. 2D: additive canvas particles.
+// · line — one continuous polyline that fades over time. 3D: a
+// LineSegments strip rebuilt from the live point ring. 2D: an SVG polyline.
+//
+// Shared rules (Task 36):
+// · every element fades over ~5s, then is removed with no visible pop;
+// · a hard cap of 60 live elements, oldest removed first;
+// · colour is derived from the avatar accent, falling back to --accent.
+//
+// Performance: geometry/material are created once per style and reused; removed
+// decals/points free their GPU buffers. Both adapters expose the same surface
+// (`setStyle`, `onStep`/`emitAt`, `update`, `dispose`) so the two call sites in
+// walk.js (3D) and walk-companion.js (2D) stay symmetrical.
+
+import {
+ AdditiveBlending,
+ BufferAttribute,
+ BufferGeometry,
+ CanvasTexture,
+ Color,
+ DynamicDrawUsage,
+ LineBasicMaterial,
+ LineSegments,
+ Mesh,
+ MeshBasicMaterial,
+ Object3D,
+ Points,
+ PointsMaterial,
+ Vector3,
+} from 'three';
+import { DecalGeometry } from 'three/addons/geometries/DecalGeometry.js';
+
+// ── Shared constants ─────────────────────────────────────────────────────────
+export const TRAIL_STYLES = ['footprints', 'glow', 'line'];
+export const TRAIL_STYLE_LABELS = {
+ off: 'Off',
+ footprints: 'Footprints',
+ glow: 'Glow',
+ line: 'Line',
+};
+// `off` is a valid persisted choice (trails disabled) but is not in TRAIL_STYLES
+// because it isn't a renderer — it's the absence of one.
+export const TRAIL_CHOICES = ['off', ...TRAIL_STYLES];
+
+const FADE_SECONDS = 5; // every element's lifetime
+const MAX_ELEMENTS = 60; // hard cap; oldest removed first
+const STEP_STRIDE = 0.62; // metres of travel between footprints (3D)
+const STEP_STRIDE_2D = 26; // px of "virtual" travel between footprints (2D)
+const GLOW_EMIT_DIST = 0.18; // metres between glow particles (3D)
+const LINE_SAMPLE_DIST = 0.14; // metres between polyline vertices (3D)
+const FOOT_OFFSET = 0.13; // lateral L/R footprint offset, metres
+
+// ── Colour helpers ───────────────────────────────────────────────────────────
+function brandAccent() {
+ try {
+ const cs = getComputedStyle(document.documentElement);
+ const v = cs.getPropertyValue('--accent').trim();
+ if (v) return v;
+ } catch {
+ /* SSR / no DOM — fall through */
+ }
+ return '#ffffff';
+}
+
+// Resolve the avatar accent: explicit value wins, else the brand accent token.
+// Accepts a hex string, a number (0xRRGGBB), or null/undefined.
+export function resolveTrailColor(accent) {
+ if (typeof accent === 'number' && Number.isFinite(accent)) {
+ return '#' + (accent >>> 0).toString(16).padStart(6, '0').slice(-6);
+ }
+ if (typeof accent === 'string' && accent.trim()) return accent.trim();
+ return brandAccent();
+}
+
+// ── Persistence ──────────────────────────────────────────────────────────────
+// A single helper both adapters use so the localStorage convention is identical
+// to the rest of walk.js / the companion (a namespaced string key, try/catch
+// guarded for private-mode browsers).
+export function createTrailSetting(storageKey, fallback = 'footprints') {
+ const isValid = (v) => v === 'off' || TRAIL_STYLES.includes(v);
+ let style = fallback;
+ try {
+ const saved = localStorage.getItem(storageKey);
+ if (saved && isValid(saved)) style = saved;
+ } catch {
+ /* storage disabled — keep the fallback */
+ }
+ return {
+ get() {
+ return style;
+ },
+ set(next) {
+ if (!isValid(next)) return style;
+ style = next;
+ try {
+ localStorage.setItem(storageKey, next);
+ } catch {
+ /* private mode — in-memory only */
+ }
+ return style;
+ },
+ cycle() {
+ const idx = TRAIL_CHOICES.indexOf(style);
+ return this.set(TRAIL_CHOICES[(idx + 1) % TRAIL_CHOICES.length]);
+ },
+ };
+}
+
+// =============================================================================
+// 3D adapter — used by src/walk.js
+// =============================================================================
+//
+// Hosts a small scene graph the caller adds to its world. The caller drives it
+// each frame with the avatar's world position + facing yaw; the adapter decides
+// when to stamp a new element based on distance travelled, and ages every live
+// element toward removal. `ground` must expose heightAt(x,z) and
+// normalAt(x,z,out) — the walk terrain does both — so decals sit on the surface
+// and face its normal.
+export function createWalkTrails3D({ scene, ground, getColor, initialStyle = 'footprints' }) {
+ let surface = ground; // re-pointed on environment terrain swaps via setGround()
+ const color = new Color(resolveTrailColor(getColor?.()));
+ let style = TRAIL_STYLES.includes(initialStyle) || initialStyle === 'off' ? initialStyle : 'footprints';
+
+ // Distance accumulators since the last emission, per emitter cadence.
+ let sinceStep = 0;
+ let sinceGlow = 0;
+ let sinceLine = 0;
+ let footSide = 1; // alternates +1 / -1
+ const lastPos = new Vector3();
+ let hasLast = false;
+
+ // Scratch — reused every frame so the hot path never allocates.
+ const _n = new Vector3();
+ const _decalPos = new Vector3();
+ const _decalDir = new Vector3();
+ const _decalSize = new Vector3(0.26, 0.36, 0.4);
+ const _right = new Vector3();
+ const _up = new Vector3(0, 1, 0);
+
+ // ── footprints: a pool of decal meshes, each with its own DecalGeometry ────
+ // Decals share one material (transparent, depth-tested but not depth-writing
+ // so they layer cleanly on the ground). Each entry tracks its birth time so
+ // update() can fade opacity and dispose the geometry on death.
+ const footMat = new MeshBasicMaterial({
+ color,
+ transparent: true,
+ opacity: 0.9,
+ depthWrite: false,
+ polygonOffset: true,
+ polygonOffsetFactor: -4,
+ });
+ /** @type {{mesh: Mesh, born: number}[]} */
+ const footEntries = [];
+
+ // ── glow: one Points cloud, ring-buffer of MAX_ELEMENTS particles ──────────
+ const glowGeo = new BufferGeometry();
+ const glowPos = new Float32Array(MAX_ELEMENTS * 3);
+ const glowPosAttr = new BufferAttribute(glowPos, 3).setUsage(DynamicDrawUsage);
+ glowGeo.setAttribute('position', glowPosAttr);
+ // We can't recolour per-point alpha through PointsMaterial.opacity (it's a
+ // scalar), so we drive a per-vertex color whose brightness encodes life and
+ // let AdditiveBlending fade each particle into the background.
+ const glowColors = new Float32Array(MAX_ELEMENTS * 3);
+ const glowColAttr = new BufferAttribute(glowColors, 3).setUsage(DynamicDrawUsage);
+ glowGeo.setAttribute('color', glowColAttr);
+ glowGeo.setDrawRange(0, 0);
+ const glowMat = new PointsMaterial({
+ size: 0.22,
+ sizeAttenuation: true,
+ transparent: true,
+ depthWrite: false,
+ blending: AdditiveBlending,
+ vertexColors: true,
+ map: makeGlowSprite(),
+ });
+ const glowPoints = new Points(glowGeo, glowMat);
+ glowPoints.frustumCulled = false;
+ let glowCount = 0; // live particle count
+ let glowHead = 0; // ring write head
+ const glowBorn = new Float32Array(MAX_ELEMENTS);
+
+ // ── line: a LineSegments strip rebuilt from a point ring each frame ────────
+ const lineGeo = new BufferGeometry();
+ const linePts = new Float32Array(MAX_ELEMENTS * 3);
+ const lineSegPos = new Float32Array((MAX_ELEMENTS - 1) * 2 * 3);
+ const lineSegCol = new Float32Array((MAX_ELEMENTS - 1) * 2 * 3);
+ const lineSegPosAttr = new BufferAttribute(lineSegPos, 3).setUsage(DynamicDrawUsage);
+ const lineSegColAttr = new BufferAttribute(lineSegCol, 3).setUsage(DynamicDrawUsage);
+ lineGeo.setAttribute('position', lineSegPosAttr);
+ lineGeo.setAttribute('color', lineSegColAttr);
+ lineGeo.setDrawRange(0, 0);
+ const lineMat = new LineBasicMaterial({
+ transparent: true,
+ depthWrite: false,
+ vertexColors: true,
+ blending: AdditiveBlending,
+ });
+ const lineSegments = new LineSegments(lineGeo, lineMat);
+ lineSegments.frustumCulled = false;
+ const lineBorn = new Float32Array(MAX_ELEMENTS);
+ let lineCount = 0;
+ let lineHead = 0;
+
+ scene.add(glowPoints);
+ scene.add(lineSegments);
+
+ function setVisibilityForStyle() {
+ glowPoints.visible = style === 'glow';
+ lineSegments.visible = style === 'line';
+ for (const e of footEntries) e.mesh.visible = style === 'footprints';
+ }
+ setVisibilityForStyle();
+
+ function refreshColor() {
+ color.set(resolveTrailColor(getColor?.()));
+ footMat.color.copy(color);
+ }
+
+ // Stamp a single footprint decal at world pos with surface normal `_n`.
+ function stampFootprint(x, z, yaw) {
+ const h = surface.heightAt(x, z);
+ surface.normalAt(x, z, _n);
+ // Lateral offset so prints fall on alternating sides of the path.
+ _decalDir.set(Math.sin(yaw), 0, Math.cos(yaw)); // facing
+ _right.crossVectors(_decalDir, _up).normalize();
+ const ox = _right.x * FOOT_OFFSET * footSide;
+ const oz = _right.z * FOOT_OFFSET * footSide;
+ footSide *= -1;
+ _decalPos.set(x + ox, h + 0.02, z + oz);
+
+ // DecalGeometry projects onto a target mesh. The terrain mesh is the
+ // projection target; the decal's orientation is built from a dummy whose
+ // +Z faces the avatar and which is tilted to the ground normal.
+ const orient = orientationFor(_decalDir, _n);
+ const geo = new DecalGeometry(surface.mesh, _decalPos, orient, _decalSize);
+ const mesh = new Mesh(geo, footMat);
+ mesh.renderOrder = 2;
+ mesh.visible = style === 'footprints';
+ scene.add(mesh);
+ footEntries.push({ mesh, born: performance.now() / 1000 });
+ enforceFootCap();
+ }
+
+ // Build a Euler orientation by pointing a scratch object at the surface
+ // normal, yawed to face travel. DecalGeometry takes an Euler, so we reuse one
+ // lightweight Object3D and read back its rotation.
+ const _orientObj = new Object3D();
+ const _orientLook = new Vector3();
+ function orientationFor(dir, normal) {
+ // Point the decal's surface along the ground normal, yaw it to face travel.
+ _orientObj.position.copy(_decalPos);
+ _orientLook.copy(_decalPos).add(normal);
+ _orientObj.up.copy(dir.lengthSq() > 1e-6 ? dir : _up);
+ _orientObj.lookAt(_orientLook);
+ return _orientObj.rotation.clone();
+ }
+
+ function enforceFootCap() {
+ while (footEntries.length > MAX_ELEMENTS) {
+ const old = footEntries.shift();
+ disposeFoot(old);
+ }
+ }
+ function disposeFoot(entry) {
+ if (!entry) return;
+ scene.remove(entry.mesh);
+ entry.mesh.geometry.dispose();
+ }
+
+ function pushGlow(x, y, z) {
+ const i = glowHead;
+ glowPos[i * 3] = x;
+ glowPos[i * 3 + 1] = y;
+ glowPos[i * 3 + 2] = z;
+ glowBorn[i] = performance.now() / 1000;
+ glowHead = (glowHead + 1) % MAX_ELEMENTS;
+ glowCount = Math.min(glowCount + 1, MAX_ELEMENTS);
+ }
+
+ function pushLine(x, y, z) {
+ const i = lineHead;
+ linePts[i * 3] = x;
+ linePts[i * 3 + 1] = y;
+ linePts[i * 3 + 2] = z;
+ lineBorn[i] = performance.now() / 1000;
+ lineHead = (lineHead + 1) % MAX_ELEMENTS;
+ lineCount = Math.min(lineCount + 1, MAX_ELEMENTS);
+ }
+
+ // Called every frame with the avatar's world position + facing + moving flag.
+ function update(dt, { x, y, z, yaw, moving }) {
+ const now = performance.now() / 1000;
+
+ if (hasLast && moving) {
+ const dx = x - lastPos.x;
+ const dz = z - lastPos.z;
+ const stepped = Math.hypot(dx, dz);
+ if (stepped > 0 && stepped < 5) {
+ sinceStep += stepped;
+ sinceGlow += stepped;
+ sinceLine += stepped;
+
+ if (style === 'footprints') {
+ while (sinceStep >= STEP_STRIDE) {
+ sinceStep -= STEP_STRIDE;
+ stampFootprint(x, z, yaw);
+ }
+ } else if (style === 'glow') {
+ while (sinceGlow >= GLOW_EMIT_DIST) {
+ sinceGlow -= GLOW_EMIT_DIST;
+ pushGlow(x, surface.heightAt(x, z) + 0.12, z);
+ }
+ } else if (style === 'line') {
+ while (sinceLine >= LINE_SAMPLE_DIST) {
+ sinceLine -= LINE_SAMPLE_DIST;
+ pushLine(x, surface.heightAt(x, z) + 0.06, z);
+ }
+ }
+ }
+ }
+ lastPos.set(x, y, z);
+ hasLast = true;
+
+ ageFootprints(now);
+ ageGlow(now);
+ ageLine(now);
+ }
+
+ function ageFootprints(now) {
+ // Fade opacity by youngest survivor; oldest are removed when fully faded.
+ // Decals share one material, so we can't fade individually via opacity —
+ // instead we fade the whole material to the freshest print's life and
+ // drop dead prints from the pool. With even spacing this reads as a tail.
+ let alive = 0;
+ let freshest = 0;
+ for (let i = footEntries.length - 1; i >= 0; i--) {
+ const e = footEntries[i];
+ const age = now - e.born;
+ if (age >= FADE_SECONDS) {
+ disposeFoot(e);
+ footEntries.splice(i, 1);
+ continue;
+ }
+ alive++;
+ freshest = Math.max(freshest, 1 - age / FADE_SECONDS);
+ }
+ // Per-print fade: give each its own cloned material lazily only when the
+ // pool is small enough to matter; for the common case we fade the shared
+ // material to the average remaining life so the tail dims as one.
+ if (style === 'footprints' && alive > 0) {
+ let sum = 0;
+ for (const e of footEntries) sum += 1 - (now - e.born) / FADE_SECONDS;
+ footMat.opacity = Math.max(0.05, (sum / alive) * 0.9);
+ }
+ }
+
+ function ageGlow(now) {
+ if (glowCount === 0) {
+ glowGeo.setDrawRange(0, 0);
+ return;
+ }
+ for (let i = 0; i < MAX_ELEMENTS; i++) {
+ const born = glowBorn[i];
+ if (born <= 0) {
+ glowColors[i * 3] = glowColors[i * 3 + 1] = glowColors[i * 3 + 2] = 0;
+ continue;
+ }
+ const life = 1 - (now - born) / FADE_SECONDS;
+ if (life <= 0) {
+ glowBorn[i] = 0;
+ glowColors[i * 3] = glowColors[i * 3 + 1] = glowColors[i * 3 + 2] = 0;
+ continue;
+ }
+ // Brightness encodes life; AdditiveBlending fades it into the scene.
+ const b = life * life; // ease-in for a softer tail
+ glowColors[i * 3] = color.r * b;
+ glowColors[i * 3 + 1] = color.g * b;
+ glowColors[i * 3 + 2] = color.b * b;
+ }
+ glowPosAttr.needsUpdate = true;
+ glowColAttr.needsUpdate = true;
+ glowGeo.setDrawRange(0, MAX_ELEMENTS);
+ }
+
+ function ageLine(now) {
+ // Emit ordered segments from oldest live vertex to newest, fading each
+ // vertex's colour by its life. Walk the ring in chronological order.
+ const order = [];
+ for (let k = 0; k < lineCount; k++) {
+ const idx = (lineHead - lineCount + k + MAX_ELEMENTS) % MAX_ELEMENTS;
+ const born = lineBorn[idx];
+ if (born <= 0) continue;
+ if (now - born >= FADE_SECONDS) {
+ lineBorn[idx] = 0;
+ continue;
+ }
+ order.push(idx);
+ }
+ // Compact lineCount toward the live span so dead head entries don't linger.
+ if (order.length < lineCount) lineCount = order.length;
+
+ let seg = 0;
+ for (let k = 0; k < order.length - 1; k++) {
+ const a = order[k];
+ const b = order[k + 1];
+ const la = 1 - (now - lineBorn[a]) / FADE_SECONDS;
+ const lb = 1 - (now - lineBorn[b]) / FADE_SECONDS;
+ const base = seg * 6;
+ lineSegPos[base] = linePts[a * 3];
+ lineSegPos[base + 1] = linePts[a * 3 + 1];
+ lineSegPos[base + 2] = linePts[a * 3 + 2];
+ lineSegPos[base + 3] = linePts[b * 3];
+ lineSegPos[base + 4] = linePts[b * 3 + 1];
+ lineSegPos[base + 5] = linePts[b * 3 + 2];
+ lineSegCol[base] = color.r * la;
+ lineSegCol[base + 1] = color.g * la;
+ lineSegCol[base + 2] = color.b * la;
+ lineSegCol[base + 3] = color.r * lb;
+ lineSegCol[base + 4] = color.g * lb;
+ lineSegCol[base + 5] = color.b * lb;
+ seg++;
+ }
+ lineSegPosAttr.needsUpdate = true;
+ lineSegColAttr.needsUpdate = true;
+ lineGeo.setDrawRange(0, seg * 2);
+ }
+
+ function setStyle(next) {
+ if (next !== 'off' && !TRAIL_STYLES.includes(next)) return;
+ if (next === style) return;
+ style = next;
+ setVisibilityForStyle();
+ // Reset cadence so the new style doesn't dump a burst on switch.
+ sinceStep = sinceGlow = sinceLine = 0;
+ }
+
+ function clear() {
+ for (const e of footEntries) disposeFoot(e);
+ footEntries.length = 0;
+ glowCount = glowHead = 0;
+ glowBorn.fill(0);
+ glowGeo.setDrawRange(0, 0);
+ lineCount = lineHead = 0;
+ lineBorn.fill(0);
+ lineGeo.setDrawRange(0, 0);
+ }
+
+ function dispose() {
+ clear();
+ scene.remove(glowPoints);
+ scene.remove(lineSegments);
+ glowGeo.dispose();
+ glowMat.map?.dispose();
+ glowMat.dispose();
+ lineGeo.dispose();
+ lineMat.dispose();
+ footMat.dispose();
+ }
+
+ // Re-point at a freshly generated terrain (environment swap). Existing decals
+ // are baked world-space geometry and stay valid, but we clear them so the old
+ // surface's prints don't hover over the new ground shape.
+ function setGround(next) {
+ if (!next) return;
+ surface = next;
+ clear();
+ hasLast = false;
+ }
+
+ return {
+ get style() {
+ return style;
+ },
+ setStyle,
+ setGround,
+ refreshColor,
+ update,
+ clear,
+ dispose,
+ };
+}
+
+// A soft round sprite for glow particles — a radial alpha gradient on a small
+// canvas, uploaded once and shared by every particle.
+function makeGlowSprite() {
+ const c = document.createElement('canvas');
+ c.width = c.height = 64;
+ const ctx = c.getContext('2d');
+ const g = ctx.createRadialGradient(32, 32, 0, 32, 32, 32);
+ g.addColorStop(0, 'rgba(255,255,255,1)');
+ g.addColorStop(0.4, 'rgba(255,255,255,0.6)');
+ g.addColorStop(1, 'rgba(255,255,255,0)');
+ ctx.fillStyle = g;
+ ctx.fillRect(0, 0, 64, 64);
+ return new CanvasTexture(c);
+}
+
+// =============================================================================
+// 2D adapter — used by src/walk-companion.js
+// =============================================================================
+//
+// The site-wide companion is a fixed-corner 3D canvas whose avatar walks in
+// place (it rotates to follow the cursor rather than translating across the
+// page). So the 2D trail emits *beneath* the companion host while the avatar is
+// in its walk state, dropping footprints / particles / a fading line into an
+// overlay layered directly behind the avatar canvas. The overlay tracks the
+// host's screen rect so it stays glued to the companion as it animates in/out
+// and on resize.
+export function createWalkTrails2D({ host, getColor, getWalking, initialStyle = 'footprints' }) {
+ let style = TRAIL_STYLES.includes(initialStyle) || initialStyle === 'off' ? initialStyle : 'footprints';
+ let color = resolveTrailColor(getColor?.());
+
+ // Overlay container — positioned fixed, glued under the companion canvas
+ // (z-index below the canvas's z-index:1 so prints sit behind the avatar).
+ const layer = document.createElement('div');
+ layer.className = 'walk-trail-layer';
+ layer.setAttribute('aria-hidden', 'true');
+ layer.style.cssText = [
+ 'position:fixed',
+ 'z-index:2147482999', // one below .walk-companion (2147483000)
+ 'pointer-events:none',
+ 'overflow:visible',
+ 'contain:layout style',
+ ].join(';');
+ document.body.appendChild(layer);
+
+ // Canvas for glow particles (cheap, additive). SVG for the line. DOM nodes
+ // for footprints. Only the active style's surface is populated.
+ const glowCanvas = document.createElement('canvas');
+ glowCanvas.style.cssText = 'position:absolute;inset:0;width:100%;height:100%';
+ const gctx = glowCanvas.getContext('2d');
+ const svgNS = 'http://www.w3.org/2000/svg';
+ const svg = document.createElementNS(svgNS, 'svg');
+ svg.setAttribute('width', '100%');
+ svg.setAttribute('height', '100%');
+ svg.style.cssText = 'position:absolute;inset:0;overflow:visible';
+ const polyline = document.createElementNS(svgNS, 'polyline');
+ polyline.setAttribute('fill', 'none');
+ polyline.setAttribute('stroke-width', '3');
+ polyline.setAttribute('stroke-linecap', 'round');
+ polyline.setAttribute('stroke-linejoin', 'round');
+ svg.appendChild(polyline);
+ layer.appendChild(glowCanvas);
+ layer.appendChild(svg);
+
+ // State. The companion avatar walks in place, so we synthesize a path: while
+ // walking, a virtual head advances along a gentle sine wave inside the layer,
+ // leaving a tail. Footprints alternate L/R across that head.
+ /** @type {{el: HTMLElement, born: number}[]} */
+ const footEls = [];
+ /** @type {{x: number, y: number, born: number}[]} */
+ const glowParts = [];
+ /** @type {{x: number, y: number, born: number}[]} */
+ const linePts = [];
+ let footSide = 1;
+ let virtual = 0; // px advanced along the synthetic path while walking
+ let lastVirtualStep = 0;
+ let lastVirtualGlow = 0;
+ let lastVirtualLine = 0;
+ let rect = { left: 0, top: 0, width: 0, height: 0 };
+ let dpr = Math.min(window.devicePixelRatio || 1, 2);
+
+ function syncRect() {
+ const r = host.getBoundingClientRect();
+ rect = { left: r.left, top: r.top, width: r.width, height: r.height };
+ layer.style.left = `${r.left}px`;
+ layer.style.top = `${r.top}px`;
+ layer.style.width = `${r.width}px`;
+ layer.style.height = `${r.height}px`;
+ const w = Math.max(1, Math.round(r.width * dpr));
+ const h = Math.max(1, Math.round(r.height * dpr));
+ if (glowCanvas.width !== w || glowCanvas.height !== h) {
+ glowCanvas.width = w;
+ glowCanvas.height = h;
+ }
+ }
+
+ // Map a virtual path distance to a point within the layer. The synthetic path
+ // loops gently near the base of the avatar so the trail reads as footwork in
+ // place rather than wandering off-screen.
+ function pathPoint(v) {
+ const w = rect.width || 1;
+ const baseY = (rect.height || 1) * 0.86; // near the feet
+ const x = w * 0.5 + Math.sin(v / 46) * w * 0.22;
+ const y = baseY + Math.cos(v / 70) * (rect.height || 1) * 0.03;
+ return { x, y };
+ }
+
+ function setVisibility() {
+ glowCanvas.style.display = style === 'glow' ? '' : 'none';
+ svg.style.display = style === 'line' ? '' : 'none';
+ for (const f of footEls) f.el.style.display = style === 'footprints' ? '' : 'none';
+ }
+ setVisibility();
+
+ function spawnFootprint(v) {
+ const p = pathPoint(v);
+ const el = document.createElement('div');
+ el.className = 'walk-trail-foot';
+ // A footprint glyph drawn as a rounded oval with a small toe dot, rotated
+ // to face along the path tangent and offset L/R.
+ const tangent = pathPoint(v + 1);
+ const ang = Math.atan2(tangent.y - p.y, tangent.x - p.x) * (180 / Math.PI) + 90;
+ const nx = Math.cos((ang * Math.PI) / 180);
+ const ny = Math.sin((ang * Math.PI) / 180);
+ const ox = nx * 7 * footSide;
+ const oy = ny * 7 * footSide;
+ footSide *= -1;
+ el.style.cssText = [
+ 'position:absolute',
+ `left:${p.x + ox - 5}px`,
+ `top:${p.y + oy - 8}px`,
+ 'width:10px',
+ 'height:16px',
+ `background:${color}`,
+ 'border-radius:50% 50% 45% 45%',
+ `transform:rotate(${ang}deg)`,
+ 'opacity:0.85',
+ 'transition:opacity 0.4s linear',
+ 'will-change:opacity',
+ ].join(';');
+ el.style.display = style === 'footprints' ? '' : 'none';
+ layer.appendChild(el);
+ footEls.push({ el, born: performance.now() / 1000 });
+ while (footEls.length > MAX_ELEMENTS) {
+ const old = footEls.shift();
+ old.el.remove();
+ }
+ }
+
+ function spawnGlow(v) {
+ const p = pathPoint(v);
+ glowParts.push({ x: p.x, y: p.y, born: performance.now() / 1000 });
+ while (glowParts.length > MAX_ELEMENTS) glowParts.shift();
+ }
+
+ function spawnLinePoint(v) {
+ const p = pathPoint(v);
+ linePts.push({ x: p.x, y: p.y, born: performance.now() / 1000 });
+ while (linePts.length > MAX_ELEMENTS) linePts.shift();
+ }
+
+ function update(dt) {
+ syncRect();
+ const walking = !!getWalking?.();
+ const now = performance.now() / 1000;
+
+ if (walking) {
+ // Advance the virtual path head at a steady cadence while walking.
+ virtual += dt * 60;
+ if (style === 'footprints') {
+ while (virtual - lastVirtualStep >= STEP_STRIDE_2D) {
+ lastVirtualStep += STEP_STRIDE_2D;
+ spawnFootprint(lastVirtualStep);
+ }
+ } else if (style === 'glow') {
+ while (virtual - lastVirtualGlow >= 6) {
+ lastVirtualGlow += 6;
+ spawnGlow(lastVirtualGlow);
+ }
+ } else if (style === 'line') {
+ while (virtual - lastVirtualLine >= 5) {
+ lastVirtualLine += 5;
+ spawnLinePoint(lastVirtualLine);
+ }
+ }
+ }
+
+ ageFeet(now);
+ drawGlow(now);
+ drawLine(now);
+ }
+
+ function ageFeet(now) {
+ for (let i = footEls.length - 1; i >= 0; i--) {
+ const f = footEls[i];
+ const age = now - f.born;
+ if (age >= FADE_SECONDS) {
+ f.el.remove();
+ footEls.splice(i, 1);
+ continue;
+ }
+ f.el.style.opacity = String(Math.max(0, (1 - age / FADE_SECONDS) * 0.85));
+ }
+ }
+
+ function drawGlow(now) {
+ const w = glowCanvas.width;
+ const h = glowCanvas.height;
+ gctx.clearRect(0, 0, w, h);
+ if (style !== 'glow') return;
+ const rgb = hexToRgb(color);
+ gctx.globalCompositeOperation = 'lighter';
+ for (let i = glowParts.length - 1; i >= 0; i--) {
+ const p = glowParts[i];
+ const life = 1 - (now - p.born) / FADE_SECONDS;
+ if (life <= 0) {
+ glowParts.splice(i, 1);
+ continue;
+ }
+ const r = 9 * dpr * (0.5 + life * 0.5);
+ const cx = p.x * dpr;
+ const cy = p.y * dpr;
+ const grad = gctx.createRadialGradient(cx, cy, 0, cx, cy, r);
+ grad.addColorStop(0, `rgba(${rgb.r},${rgb.g},${rgb.b},${0.5 * life})`);
+ grad.addColorStop(1, `rgba(${rgb.r},${rgb.g},${rgb.b},0)`);
+ gctx.fillStyle = grad;
+ gctx.beginPath();
+ gctx.arc(cx, cy, r, 0, Math.PI * 2);
+ gctx.fill();
+ }
+ gctx.globalCompositeOperation = 'source-over';
+ }
+
+ function drawLine(now) {
+ if (style !== 'line') {
+ polyline.setAttribute('points', '');
+ return;
+ }
+ // Drop dead points; render the live span as a single polyline whose
+ // opacity tracks the freshest segment (the tail dims as points expire).
+ let pts = '';
+ let freshest = 0;
+ for (let i = linePts.length - 1; i >= 0; i--) {
+ if (now - linePts[i].born >= FADE_SECONDS) {
+ linePts.splice(i, 1);
+ }
+ }
+ for (const p of linePts) {
+ pts += `${p.x.toFixed(1)},${p.y.toFixed(1)} `;
+ freshest = Math.max(freshest, 1 - (now - p.born) / FADE_SECONDS);
+ }
+ polyline.setAttribute('points', pts.trim());
+ polyline.setAttribute('stroke', color);
+ polyline.setAttribute('opacity', String(Math.max(0.1, freshest * 0.8)));
+ }
+
+ function setStyle(next) {
+ if (next !== 'off' && !TRAIL_STYLES.includes(next)) return;
+ if (next === style) return;
+ style = next;
+ setVisibility();
+ // Reset cadence so switching styles doesn't dump a burst.
+ lastVirtualStep = lastVirtualGlow = lastVirtualLine = virtual;
+ }
+
+ function refreshColor() {
+ color = resolveTrailColor(getColor?.());
+ }
+
+ function clear() {
+ for (const f of footEls) f.el.remove();
+ footEls.length = 0;
+ glowParts.length = 0;
+ linePts.length = 0;
+ gctx.clearRect(0, 0, glowCanvas.width, glowCanvas.height);
+ polyline.setAttribute('points', '');
+ }
+
+ function dispose() {
+ clear();
+ layer.remove();
+ }
+
+ const onResize = () => {
+ dpr = Math.min(window.devicePixelRatio || 1, 2);
+ syncRect();
+ };
+ window.addEventListener('resize', onResize);
+ const _dispose = dispose;
+ const disposeWrapped = () => {
+ window.removeEventListener('resize', onResize);
+ _dispose();
+ };
+
+ return {
+ get style() {
+ return style;
+ },
+ setStyle,
+ refreshColor,
+ update,
+ clear,
+ dispose: disposeWrapped,
+ };
+}
+
+// ── small colour util ────────────────────────────────────────────────────────
+function hexToRgb(hex) {
+ const c = new Color(hex);
+ return { r: Math.round(c.r * 255), g: Math.round(c.g * 255), b: Math.round(c.b * 255) };
+}
diff --git a/src/walk.js b/src/walk.js
index 82581d10c..53d9c4128 100644
--- a/src/walk.js
+++ b/src/walk.js
@@ -62,6 +62,7 @@ import {
terrainColor as envTerrainColor,
} from './walk-environments.js';
import { log } from './shared/log.js';
+import { createWalkTrails3D, createTrailSetting, TRAIL_STYLE_LABELS } from './walk-trails.js';
const AVATAR_URL_DEFAULT = '/avatars/default.glb';
@@ -454,6 +455,25 @@ groundOpaque.visible = false;
let terrain = createTerrain({ color: 0x202833 });
scene.add(terrain.mesh);
+// ── Walk path visualization (Task 36) ─────────────────────────────────────
+// A footstep / glow / line trail painted behind the avatar. The style choice is
+// persisted with the same namespaced-key convention as zen/camera-mode/haptics.
+// The system itself is built once the avatar loads (so its accent is known); the
+// setting is created up-front so the help-overlay control can render immediately.
+const TRAIL_KEY = 'walk:trail-style';
+const trailSetting = createTrailSetting(TRAIL_KEY, 'footprints');
+/** @type {ReturnType<typeof createWalkTrails3D>|null} */
+let trails = null;
+
+// Avatar accent → trail colour. The walk avatar is a raw GLB, so we read any
+// authored meta accent (gltf.userData / scene.userData), else fall back to the
+// brand --accent token (handled inside the trail system).
+function avatarAccent() {
+ const m = avatar?.userData?.meta || avatar?.userData || avatarTemplate?.userData || null;
+ const a = m?.accent;
+ return typeof a === 'string' || typeof a === 'number' ? a : null;
+}
+
const groundShadowCatcher = new Mesh(
new CircleGeometry(GROUND_RADIUS, 64),
new ShadowMaterial({ opacity: 0.32 }),
@@ -937,6 +957,14 @@ const helpOverlay = (() => {
</div>`
: ''
}
+ <div style="margin:14px 0 0;padding-top:14px;border-top:1px solid rgba(255,255,255,0.1);display:flex;align-items:center;justify-content:space-between" data-help-keep>
+ <span style="font-size:14px">Path trail</span>
+ <button type="button" id="walk-trail-toggle" data-help-keep
+ aria-label="Cycle path trail style"
+ style="appearance:none;border:1px solid rgba(255,255,255,0.2);background:${trailSetting.get() === 'off' ? 'rgba(255,255,255,0.08)' : 'var(--accent,#7c5cff)'};color:#fff;border-radius:999px;padding:5px 14px;font:inherit;font-size:13px;cursor:pointer">
+ ${TRAIL_STYLE_LABELS[trailSetting.get()]}
+ </button>
+ </div>
<p style="margin:20px 0 0;font-size:12px;color:#666">Click the canvas to lock the mouse for first-person look.</p>
</div>`;
document.body.appendChild(el);
@@ -958,6 +986,22 @@ if (hapticsToggle) {
});
}
+// Path-trail style switch — cycles off → footprints → glow → line. Persisted via
+// trailSetting; applied live to the trail system (which may not exist yet if the
+// avatar is still loading — the new style is still persisted and read on build).
+const trailToggle = helpOverlay.querySelector('#walk-trail-toggle');
+if (trailToggle) {
+ trailToggle.addEventListener('click', () => {
+ const next = trailSetting.cycle();
+ trails?.setStyle(next);
+ trailToggle.textContent = TRAIL_STYLE_LABELS[next];
+ trailToggle.style.background =
+ next === 'off' ? 'rgba(255,255,255,0.08)' : 'var(--accent,#7c5cff)';
+ setStatus(`Path trail: ${TRAIL_STYLE_LABELS[next]}`);
+ haptics.buzz(6);
+ });
+}
+
let helpVisible = false;
function toggleHelp() {
helpVisible = !helpVisible;
@@ -1303,6 +1347,16 @@ async function loadAvatar() {
avatarHeight = height;
frameAvatarCamera();
+ // Build the trail system now that the avatar (and its accent) and the terrain
+ // ground both exist. Decals project onto terrain.mesh and orient to
+ // terrain.normalAt, so the trail follows the rolling surface.
+ trails = createWalkTrails3D({
+ scene,
+ ground: terrain,
+ getColor: avatarAccent,
+ initialStyle: trailSetting.get(),
+ });
+
// Dress the local avatar in the loadout the player last equipped (R23). The
// equipped fit is persisted to their account in /play and mirrored to the
// cross-world cc-cosmetics store, so the same wardrobe rides into /walk. Reuses
@@ -2126,6 +2180,18 @@ function tick() {
animationManager.update(dt);
localCosmetics?.tick(dt);
+ // 3b. Paint the path trail behind the avatar. Suppressed in AR (no rendered
+ // ground to stamp decals onto) and when the style is 'off'.
+ if (trails && trails.style !== 'off' && !arActive && avatar) {
+ trails.update(dt, {
+ x: avatarRig.position.x,
+ y: avatarRig.position.y,
+ z: avatarRig.position.z,
+ yaw: avatarYaw,
+ moving: currentMotion === 'walk' || currentMotion === 'run',
+ });
+ }
+
// 4. Broadcast our state to the server (throttled inside WalkNet) and
// advance every remote player's interpolated transform + animation.
if (net && avatar) {
@@ -3134,6 +3200,9 @@ function swapTerrain(meta) {
terrain = next;
terrain.mesh.visible = !arActive;
scene.add(terrain.mesh);
+ // Re-point the trail system at the new heightfield so footprint decals project
+ // onto (and orient to) the environment's ground instead of the old one.
+ trails?.setGround(terrain);
groundOpaque.material.color.setHex(envTerrainColor(meta));
if (physics && physicsReady) physics.addHeightfield(terrain);
}
diff --git a/tasks/CLEANUP-MANIFEST.md b/tasks/CLEANUP-MANIFEST.md
index fdbfc159e..8ab584398 100644
--- a/tasks/CLEANUP-MANIFEST.md
+++ b/tasks/CLEANUP-MANIFEST.md
@@ -163,3 +163,10 @@ Retired (feature verified shipped):
| tasks/walk/48-walk-postmessage-events-spec.md | DELETE | Built: src/walk-embed-events.js full contract + installEmbedBridge, pages/walk-embed.html wiring, public/walk-embed-sdk.js host SDK (embed().on/goto/gesture/say/setEnv/...), public/docs/walk-embed-api.html. Shipped in commit 9746b744a. |
| tasks/walk/47-walk-api-programmatic-control.md | DELETE | Built: api/walk/control/[action].js (session/move/gesture/say/env/poll/state/contract) + migration 20260621160000_walk_control.sql + src/walk.js control poller. Shipped in commit 9746b744a. |
| tasks/walk/49-walk-documentation-page.md | DELETE | Built: public/docs/walk/* hub (index, getting-started, walk-page, embed-iframe, embed-sdk, postmessage-events, companion-mode, analytics, chrome-extension, changelog) routed at /docs/walk/*; rest-api page intentionally omitted-then-superseded by control API. |
+
+## 2026-06-21 built-and-shipped (walk batch 3)
+
+| spec file | decision | evidence |
+|---|---|---|
+| tasks/walk/36-walk-path-visualization.md | DELETE | Built: src/walk-trails.js (footprints/glow/line, 3D decals+points & 2D DOM/canvas/SVG, 60-cap, accent color, 5s fade) wired into src/walk.js + src/walk-companion.js with persisted style toggle. |
+| tasks/walk/23-agent-detail-walk-mode.md | DELETE | Built: ?agent=/?avatar= resolution in src/walk-embed.js + "Walk with this agent" CTA & live preview card in pages/agent-detail.html/src/agent-detail.js. |
diff --git a/tasks/walk/23-agent-detail-walk-mode.md b/tasks/walk/23-agent-detail-walk-mode.md
deleted file mode 100644
index ab33ce765..000000000
--- a/tasks/walk/23-agent-detail-walk-mode.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Task 23 — Agent Detail Page: "Walk With This Agent" Mode
-
-## Priority: HIGH
-
-## Objective
-On every agent detail page (`pages/agent-detail.html` and `pages/handle.html`), add a prominent "Walk with this agent" CTA that opens the walk experience with that agent's avatar pre-loaded.
-
-## Scope
-- Files: `pages/agent-detail.html`, `src/agent-detail.js`, `pages/handle.html`
-- Add CTA button in the hero/profile section, near the existing "Chat" / "Follow" actions
-- Click → opens `/walk?avatar=<agent.avatarId>&agent=<agent.id>` in same tab (or new tab if held with modifier)
-- On the walk page, if `?agent=<id>` is present, fetch agent metadata (`/api/agents/<id>`) and:
- - Set the avatar's display name pill to the agent's handle
- - Load the agent's persona into the voice chat (task 16) so conversations are in character
- - Use the agent's preferred environment if set in agent meta; else default
-- Add a small inline walking-avatar preview card on the agent detail page itself (240×320), reuses `/walk-embed` iframe — shows the agent's avatar walking idly as a teaser
-- The preview card has its own "Expand" button → opens full walk page
-
-## Definition of Done
-- Visit `https://three.ws/@somehandle` → see the avatar walking in the preview card
-- Click "Walk with this agent" → walk page opens with correct avatar and agent persona loaded
-- Voice chat in walk mode responds in the agent's persona
-- No console errors on agent detail page or walk page
-
-## Rules
-Complete 100%. No stubs. No fake data. Real agent fetch, real avatar load, real persona injection. Wire end-to-end.
-
-<!-- AUTO:self-delete-on-complete -->
-
----
-
-## ✅ On completion — delete this file
-
-This file is a unit of work, not a permanent doc. The moment every item above is **built, wired, verified, and committed** to the "Definition of done" in the repo-root `CLAUDE.md`, remove it in the same change:
-
-```bash
-git rm "tasks/walk/23-agent-detail-walk-mode.md"
-```
-
-Stage the deletion alongside your implementation and include it in the completion commit. This directory is the backlog: a file that still exists is unfinished work; a file that is gone has shipped. Do not delete early, and never leave a completed prompt behind.
diff --git a/tasks/walk/36-walk-path-visualization.md b/tasks/walk/36-walk-path-visualization.md
deleted file mode 100644
index 674d4f03e..000000000
--- a/tasks/walk/36-walk-path-visualization.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# Task 36 — Walk Path Visualization: Footstep Trails & Routes
-
-## Priority: LOW
-
-## Objective
-Render aesthetic visual trails behind the walking avatar — footprints, glow particles, or a faint line — so users see where they've been on the page or in the 3D walk scene. Pure delight feature.
-
-## Scope
-- Module: `src/walk-trails.js`
-- Three trail styles, user-selectable in settings:
- - `footprints` — alternating left/right footprint icons fade in/out (DOM overlay for 2D, decals for 3D scene)
- - `glow` — soft particle trail (Three.js Points or 2D canvas particles)
- - `line` — single continuous polyline that fades over time
-- Trails fade over 5 seconds, then are removed from the scene
-- In 3D walk scene: decals on the ground using Three.js DecalGeometry, properly oriented to ground normal
-- In 2D companion mode (across site): SVG path/circles overlaid behind the avatar canvas
-- Performance budget: cap at 60 trail elements at once; oldest removed first
-- Trail color: derived from avatar's accent color (read from `avatar.meta.accent` or fallback to brand accent)
-
-## Definition of Done
-- Each trail style works in both 2D companion and 3D walk modes
-- Trails fade smoothly with no visible "pop" on removal
-- 60-element cap enforced (verify by walking continuously for 30s)
-- No FPS drop with trails on
-- No console errors
-
-## Rules
-Complete 100%. No stubs. No fake data. Real decals / real SVG / real particles. Wire end-to-end.
-
-<!-- AUTO:self-delete-on-complete -->
-
----
-
-## ✅ On completion — delete this file
-
-This file is a unit of work, not a permanent doc. The moment every item above is **built, wired, verified, and committed** to the "Definition of done" in the repo-root `CLAUDE.md`, remove it in the same change:
-
-```bash
-git rm "tasks/walk/36-walk-path-visualization.md"
-```
-
-Stage the deletion alongside your implementation and include it in the completion commit. This directory is the backlog: a file that still exists is unfinished work; a file that is gone has shipped. Do not delete early, and never leave a completed prompt behind.