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.

Refine walk voice chat, studio styling, and marketplace page

nirholas1f3a9ef2f206
diff --git a/pages/marketplace.html b/pages/marketplace.html
index c785b5891..5b25500ab 100644
--- a/pages/marketplace.html
+++ b/pages/marketplace.html
@@ -2802,7 +2802,8 @@
<button class="market-hero-secondary" id="market-hero-fork" hidden>
Fork agent
</button>
- <a class="market-hero-secondary" href="/forge">Forge your own from text →</a>
+ <a class="market-hero-secondary" href="/marketplace-walk">Walk-Browse the gallery →</a>
+ <a class="market-hero-secondary" href="/forge">Forge your own from text →</a>
</div>
<div class="market-hero-dots" id="market-hero-dots"></div>
</div>
diff --git a/public/studio/studio.css b/public/studio/studio.css
index fc48ced8a..4e79c1736 100644
--- a/public/studio/studio.css
+++ b/public/studio/studio.css
@@ -1611,6 +1611,49 @@ a:hover {
letter-spacing: 0.04em;
}
+/* ── range slider field (walk speed) ──────────────────────────────────────── */
+.field--range .field--range-label {
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: 0.5rem;
+}
+
+.field--range .range-value {
+ font-family: ui-monospace, 'SF Mono', Menlo, monospace;
+ font-size: 0.78rem;
+ color: var(--accent, #fff);
+ font-variant-numeric: tabular-nums;
+}
+
+.field--range input[type='range'] {
+ width: 100%;
+ accent-color: var(--accent, #fff);
+ cursor: pointer;
+}
+
+/* ── walking-avatar background (transparent toggle + color) ────────────────── */
+.walk-bg-transparent {
+ display: flex;
+ align-items: center;
+ gap: 0.45rem;
+ font-size: 0.82rem;
+ color: rgba(255, 255, 255, 0.72);
+ cursor: pointer;
+}
+
+.walk-bg-transparent input[type='checkbox'] {
+ width: auto;
+ margin: 0;
+}
+
+/* ── walking-avatar custom size inputs ────────────────────────────────────── */
+.walk-size-custom {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 0.5rem;
+}
+
/* ── hotspot editor ───────────────────────────────────────────────────────── */
.hotspot-editor {
display: flex;
diff --git a/public/studio/studio.js b/public/studio/studio.js
index ea29daa83..b6f3aa8ad 100644
--- a/public/studio/studio.js
+++ b/public/studio/studio.js
@@ -1911,7 +1911,31 @@ function _buildEmbedUrl(baseUrl) {
return params.length ? `${baseUrl}&${params.join('&')}` : baseUrl;
}
+// Corner offsets for the floating-position embed (mirrors widget-client.js).
+const WALK_CORNER_CSS = {
+ tl: 'top:16px;left:16px',
+ tr: 'top:16px;right:16px',
+ bl: 'bottom:16px;left:16px',
+ br: 'bottom:16px;right:16px',
+};
+
+function _refreshWalkSnippet() {
+ const w = parseInt($('#embed-width').value) || 480;
+ const h = parseInt($('#embed-height').value) || 420;
+ const pos = state.config.position || 'inline';
+ const base = 'border:0;border-radius:12px;max-width:100%;background:transparent';
+ let snippet;
+ if (pos === 'inline' || !WALK_CORNER_CSS[pos]) {
+ snippet = `<iframe src="${_currentEmbedUrl}" width="${w}" height="${h}" style="${base}" allow="autoplay" loading="lazy"></iframe>`;
+ } else {
+ snippet = `<iframe src="${_currentEmbedUrl}" width="${w}" height="${h}" style="position:fixed;${WALK_CORNER_CSS[pos]};z-index:2147483000;${base}" allow="autoplay" loading="lazy"></iframe>`;
+ }
+ $('#embed-iframe-snippet').value = snippet;
+ $('#embed-preview-iframe').src = _currentEmbedUrl;
+}
+
function _refreshEmbedSnippet() {
+ if (_currentWidgetType === 'walking-avatar') return _refreshWalkSnippet();
if (!_currentEmbedUrl) return;
const url = _buildEmbedUrl(_currentEmbedUrl);
const w = parseInt($('#embed-width').value) || 600;
@@ -1924,12 +1948,33 @@ function _refreshEmbedSnippet() {
function openEmbedModal(widget) {
const origin = location.origin;
const shareUrl = `${origin}/w/${widget.id}`;
- _currentEmbedUrl = `${origin}/widget#widget=${widget.id}&kiosk=true`;
_currentWidgetType = widget.type || state.type;
const demoNote = $('#embed-demo-note');
if (demoNote) demoNote.hidden = !widget.is_demo;
+ if (_currentWidgetType === 'walking-avatar') {
+ // The walking avatar embeds the /walk-embed runtime directly (config baked
+ // into the URL) for the iframe flavor, and uses widget-client.js as the
+ // JS-SDK flavor — which fetches this widget, recognizes the type, and
+ // injects the same iframe (plus optional narration).
+ const avatarParam = walkAvatarParam() || '/avatars/cz.glb';
+ _currentEmbedUrl = `${origin}/walk-embed?${walkEmbedQuery(avatarParam).toString()}`;
+ // No turntable-viewer include-options apply.
+ $('#embed-options').hidden = true;
+ // Prefill the W/H inputs from the chosen size preset.
+ $('#embed-width').value = state.config.width || 480;
+ $('#embed-height').value = state.config.height || 420;
+ $('#embed-share-url').value = shareUrl;
+ _refreshWalkSnippet();
+ $('#embed-script-snippet').value =
+ `<script async src="${origin}/widget-client.js" data-widget="${widget.id}"></` + 'script>';
+ $('#embed-modal').hidden = false;
+ return;
+ }
+
+ _currentEmbedUrl = `${origin}/widget#widget=${widget.id}&kiosk=true`;
+
// Show relevant embed-option checkboxes for this widget type, reset to checked.
const hasAnimations = _currentWidgetType === 'animation-gallery';
const hasChat = _currentWidgetType === 'talking-agent';
diff --git a/src/avatar-edit-walk.js b/src/avatar-edit-walk.js
index 3c993edf0..6aab93d0a 100644
--- a/src/avatar-edit-walk.js
+++ b/src/avatar-edit-walk.js
@@ -158,7 +158,7 @@ export class AvatarWalkPreview {
const box = new Box3().setFromObject(this.scene.root);
this.feetY = -box.min.y;
this.pos.set(CIRCLE_RADIUS, 0, 0);
- this.heading = Math.PI; // face along the initial tangent
+ this.heading = 0; // tangent of a CCW orbit at (R,0) points along +Z
this._motion = null;
this._camReady = false;
@@ -343,6 +343,37 @@ export class AvatarWalkPreview {
}
}
+ // ── On-stage hint ────────────────────────────────────────────────────────
+
+ _installHint() {
+ if (!this.stageEl || this._hintEl) return;
+ const el = document.createElement('div');
+ el.className = 'ae-walk-hint';
+ el.textContent = 'WASD / arrows to drive';
+ el.style.cssText =
+ 'position:absolute;left:50%;bottom:16px;transform:translateX(-50%);' +
+ 'padding:6px 14px;border-radius:999px;font-size:12px;font-weight:600;' +
+ 'letter-spacing:0.01em;color:rgba(255,255,255,0.92);' +
+ 'background:rgba(10,10,10,0.66);border:1px solid rgba(255,255,255,0.16);' +
+ 'backdrop-filter:blur(6px);pointer-events:none;z-index:6;' +
+ 'opacity:0;transition:opacity 0.3s ease;';
+ this.stageEl.appendChild(el);
+ this._hintEl = el;
+ requestAnimationFrame(() => {
+ if (this._hintEl) this._hintEl.style.opacity = '1';
+ });
+ }
+
+ _removeHint() {
+ if (!this._hintEl) return;
+ const el = this._hintEl;
+ this._hintEl = null;
+ el.style.opacity = '0';
+ el.addEventListener('transitionend', () => el.remove(), { once: true });
+ // Failsafe removal in case the element is detached before the transition.
+ setTimeout(() => el.remove(), 400);
+ }
+
// ── Input ──────────────────────────────────────────────────────────────
_isTypingTarget(t) {
diff --git a/src/walk-voice-chat.js b/src/walk-voice-chat.js
index 64a1d821a..3ee795056 100644
--- a/src/walk-voice-chat.js
+++ b/src/walk-voice-chat.js
@@ -398,7 +398,7 @@ export class WalkVoiceChat {
}
await audio.play();
lip?.start();
- } catch (err) {
+ } catch {
// MediaElementSource / autoplay can fail; fall back to a bare element so
// the user still hears the reply.
tap?.disconnect();
@@ -407,7 +407,7 @@ export class WalkVoiceChat {
try {
await audio.play();
} catch (playErr) {
- throw new Error(playErr?.message || 'audio playback blocked');
+ throw new Error(playErr?.message || 'audio playback blocked', { cause: playErr });
}
}
@@ -602,7 +602,7 @@ export class WalkVoiceChat {
// Build a system prompt for avatars that have no linked agent identity, so even
// a plain GLB answers in character instead of as a generic assistant.
-function buildPersonaPrompt(persona) {
+export function buildPersonaPrompt(persona) {
const name = (persona?.name || '').trim();
const desc = (persona?.description || '').trim();
if (!name && !desc) {
diff --git a/src/walk.js b/src/walk.js
index d0026b4de..d30b4adb9 100644
--- a/src/walk.js
+++ b/src/walk.js
@@ -68,6 +68,7 @@ import { createWalkTrails3D, createTrailSetting, TRAIL_STYLE_LABELS } from './wa
import { createWalkSession, showWelcomeBackToast } from './walk-session.js';
import { createWalkNpcs } from './walk-npcs.js';
import { createWalkWalletProximity } from './walk-wallet.js';
+import { createWalkCapture } from './walk-capture.js';
import { createMarketplaceGallery } from './marketplace-gallery.js';
// Walk-Browse: on /marketplace-walk the page boots with ?gallery=marketplace and
@@ -317,7 +318,7 @@ if (envBtn) {
envBtn.setAttribute('aria-expanded', 'false');
envBtn.addEventListener('click', () => toggleEnvPicker());
}
-if (screenshotBtn) screenshotBtn.addEventListener('click', () => takeScreenshot());
+if (screenshotBtn) screenshotBtn.addEventListener('click', () => walkCapture.screenshot());
if (minimapBtn) minimapBtn.addEventListener('click', () => toggleMinimap());
// ── On-screen touch action cluster (mobile) ──────────────────────────────
@@ -991,7 +992,7 @@ const helpOverlay = (() => {
<tr><td style="color:#aaa;padding-right:16px">T / Enter</td><td>Chat</td></tr>
<tr><td style="color:#aaa;padding-right:16px">V</td><td>Cycle environment</td></tr>
<tr><td style="color:#aaa;padding-right:16px">P</td><td>Screenshot</td></tr>
- <tr><td style="color:#aaa;padding-right:16px">R</td><td>Toggle GIF recording</td></tr>
+ <tr><td style="color:#aaa;padding-right:16px">R</td><td>Record a clip (up to 10s)</td></tr>
<tr><td style="color:#aaa;padding-right:16px">M</td><td>Toggle minimap</td></tr>
<tr><td style="color:#aaa;padding-right:16px">Z</td><td>Hide UI (scene + joystick only)</td></tr>
<tr><td style="color:#aaa;padding-right:16px">H / ?</td><td>Toggle this overlay</td></tr>
@@ -1167,11 +1168,11 @@ window.addEventListener('keydown', (e) => {
break;
case 'KeyP':
e.preventDefault();
- takeScreenshot();
+ walkCapture.screenshot();
break;
case 'KeyR':
e.preventDefault();
- toggleGifRecording();
+ walkCapture.toggleRecording();
break;
case 'KeyM':
e.preventDefault();