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.

robustness + create-review feature grid

nirholasb587a06ba945
diff --git a/pages/create-review.html b/pages/create-review.html
index 3fc00af38..9667597fa 100644
--- a/pages/create-review.html
+++ b/pages/create-review.html
@@ -226,11 +226,11 @@
.unlocks {
display: flex;
flex-direction: column;
- gap: 8px;
- padding: 12px 14px;
+ gap: 10px;
+ padding: 14px;
background: rgba(255, 255, 255, 0.02);
- border: 1px dashed var(--border);
- border-radius: 10px;
+ border: 1px solid var(--border);
+ border-radius: 12px;
}
.unlocks-title {
font-size: 11px;
@@ -238,23 +238,56 @@
text-transform: uppercase;
letter-spacing: 0.06em;
margin: 0;
- }
- .unlocks ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
- .unlocks li {
display: flex;
align-items: center;
- gap: 8px;
- font-size: 13px;
- color: var(--text);
+ gap: 6px;
}
- .unlocks li::before {
+ .unlocks-title::before {
content: '';
- width: 14px;
- height: 14px;
- flex-shrink: 0;
+ width: 5px;
+ height: 5px;
border-radius: 50%;
- background:
- radial-gradient(circle at 35% 35%, rgba(214, 255, 61, 0.9), rgba(214, 255, 61, 0.15) 70%);
+ background: var(--accent);
+ box-shadow: 0 0 8px rgba(214, 255, 61, 0.5);
+ }
+ .feature-grid {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 6px;
+ }
+ .feature-tile {
+ display: flex;
+ flex-direction: column;
+ gap: 3px;
+ padding: 10px;
+ background: rgba(255, 255, 255, 0.025);
+ border: 1px solid transparent;
+ border-radius: 9px;
+ transition: background 0.15s, border-color 0.15s, transform 0.15s;
+ cursor: default;
+ }
+ .feature-tile:hover {
+ background: rgba(214, 255, 61, 0.04);
+ border-color: rgba(214, 255, 61, 0.18);
+ transform: translateY(-1px);
+ }
+ .feature-icon {
+ font-size: 17px;
+ line-height: 1;
+ }
+ .feature-name {
+ font-size: 12.5px;
+ color: var(--text);
+ font-weight: 600;
+ letter-spacing: -0.005em;
+ }
+ .feature-desc {
+ font-size: 10.5px;
+ color: var(--muted);
+ line-height: 1.35;
}
.cta {
@@ -434,11 +467,38 @@
</button>
<div class="unlocks" aria-label="What saving unlocks">
- <p class="unlocks-title">Saving unlocks</p>
- <ul>
- <li>Use as an agent across three.ws</li>
- <li>Voice, animation, and emotes</li>
- <li>Embed anywhere with one snippet</li>
+ <p class="unlocks-title">Your avatar unlocks</p>
+ <ul class="feature-grid">
+ <li class="feature-tile" title="glTF / GLB body with animations, expressions, and a posable rig — mobile, desktop, and XR-ready.">
+ <span class="feature-icon" aria-hidden="true">🧍</span>
+ <span class="feature-name">3D Body</span>
+ <span class="feature-desc">Animations, expressions, posable rig</span>
+ </li>
+ <li class="feature-tile" title="Low-latency voice via LiveKit, ElevenLabs voices, and a system prompt you control.">
+ <span class="feature-icon" aria-hidden="true">🗣️</span>
+ <span class="feature-name">Voice &amp; Persona</span>
+ <span class="feature-desc">Mic in, LiveKit voice out, pinned memory</span>
+ </li>
+ <li class="feature-tile" title="Each agent is a Metaplex Core asset on Solana — transferable, composable, browsable in any wallet.">
+ <span class="feature-icon" aria-hidden="true">🪪</span>
+ <span class="feature-name">On-Chain Identity</span>
+ <span class="feature-desc">Solana wallet, transferable asset</span>
+ </li>
+ <li class="feature-tile" title="Charge per call in USDC over the x402 protocol. Other agents pay yours automatically.">
+ <span class="feature-icon" aria-hidden="true">💸</span>
+ <span class="feature-name">Paid Skills</span>
+ <span class="feature-desc">Earn USDC per call via x402</span>
+ </li>
+ <li class="feature-tile" title="One-tag embed via /embed.js, or the agent-3d Web Component. Drop your agent on any page.">
+ <span class="feature-icon" aria-hidden="true">🧩</span>
+ <span class="feature-name">Embed Anywhere</span>
+ <span class="feature-desc">One snippet, any site or app</span>
+ </li>
+ <li class="feature-tile" title="Signed feedback, call history, and validation events accrue to your agent — visible to anyone deciding whether to trust it.">
+ <span class="feature-icon" aria-hidden="true">⭐</span>
+ <span class="feature-name">Reputation</span>
+ <span class="feature-desc">Reviews, history, and validation</span>
+ </li>
</ul>
</div>
diff --git a/public/style.css b/public/style.css
index 1e56205a9..b68d4e4c0 100644
--- a/public/style.css
+++ b/public/style.css
@@ -101,11 +101,15 @@ body {
flex-direction: column;
width: 100vw;
flex-grow: 1;
+ /* Hard floor: even if a child fails to mount, the viewport-sized wrap
+ keeps the dropzone anchored to the bottom instead of floating up
+ under the header. */
+ min-height: calc(100vh - var(--header-h, 3.5rem));
position: relative;
}
.viewer-container {
- flex-grow: 1;
+ flex: 1 1 auto;
position: relative;
min-height: 0;
}
diff --git a/scripts/verify-create-review.mjs b/scripts/verify-create-review.mjs
index 10d3732aa..4ac1d643a 100644
--- a/scripts/verify-create-review.mjs
+++ b/scripts/verify-create-review.mjs
@@ -96,9 +96,22 @@ if (nameInputValue !== '') fail(`name input expected empty, got "${nameInputValu
const sourceTag = (await page.textContent('#tag-source'))?.trim();
if (sourceTag !== 'Avaturn') fail(`source tag expected "Avaturn", got "${sourceTag}"`);
-// Unlocks block must be present.
-const unlocks = await page.locator('.unlocks li').allTextContents();
-if (unlocks.length !== 3) fail(`unlocks list expected 3 items, got ${unlocks.length}`);
+// Feature grid must show the full 6-capability suite.
+const featureNames = await page.locator('.feature-tile .feature-name').allTextContents();
+const expectedFeatures = [
+ '3D Body',
+ 'Voice & Persona',
+ 'On-Chain Identity',
+ 'Paid Skills',
+ 'Embed Anywhere',
+ 'Reputation',
+];
+if (featureNames.length !== expectedFeatures.length) {
+ fail(`feature grid expected ${expectedFeatures.length} tiles, got ${featureNames.length}`);
+}
+for (const name of expectedFeatures) {
+ if (!featureNames.includes(name)) fail(`feature grid missing tile "${name}"`);
+}
// Give the emote manifest time to load and the idle clip to start.
await page.waitForTimeout(2500);
diff --git a/src/account.js b/src/account.js
index 0ed754fdf..f4497fba2 100644
--- a/src/account.js
+++ b/src/account.js
@@ -18,15 +18,22 @@ async function getCsrfToken() {
}
const SAFE_METHODS = new Set(['GET', 'HEAD', 'OPTIONS']);
+const TRANSIENT_STATUSES = new Set([502, 503, 504]);
// Wrapped fetch that handles expired sessions centrally. A 401 response is
// treated as a session-expiry signal and redirects to /login?next=<current>
// with the URL hash preserved (SPAs lose it on a naked location.href hop).
// Pass allowAnonymous:true for endpoints where a 401 is a legitimate
// "not signed in" answer the caller wants to inspect itself (e.g. /api/auth/me).
+//
+// Safe-method requests retry once on transient 5xx / network failures —
+// Vercel cold starts and dev-server restarts surface as 502s, and a silent
+// second attempt hides the blip. Mutating methods don't retry: the body is
+// already on the wire and the server may have processed it.
export async function apiFetch(path, options = {}) {
const { allowAnonymous = false, ...init } = options;
const method = (init.method || 'GET').toUpperCase();
+ const canRetry = SAFE_METHODS.has(method);
// Mutating same-origin requests need a CSRF token. Skip for bearer-auth
// callers — the server exempts Authorization: Bearer requests.
@@ -38,11 +45,26 @@ export async function apiFetch(path, options = {}) {
_csrfToken = null;
}
- const res = await fetch(path, {
- credentials: 'include',
- ...init,
- headers,
- });
+ const doFetch = () =>
+ fetch(path, {
+ credentials: 'include',
+ ...init,
+ headers,
+ });
+
+ let res;
+ try {
+ res = await doFetch();
+ } catch (networkErr) {
+ if (!canRetry) throw networkErr;
+ await new Promise((r) => setTimeout(r, 400));
+ res = await doFetch();
+ }
+ if (canRetry && TRANSIENT_STATUSES.has(res.status)) {
+ await new Promise((r) => setTimeout(r, 400));
+ res = await doFetch();
+ }
+
if (res.status === 401 && !allowAnonymous) {
redirectToLogin();
const err = new Error('session expired');
@@ -111,15 +133,12 @@ export async function getMe() {
// Uploads a GLB to our R2 bucket and creates the avatar record.
// `source` may be a Blob (from CharacterStudio postMessage) or a URL string.
-// Throws if the user isn't authenticated.
+//
+// No explicit auth pre-check: `presign` requires a session, so if the cookie
+// is missing or expired apiFetch redirects to /login (and throws with
+// err.redirected = true). Callers that want post-login resume should set
+// their sentinel BEFORE calling — apiFetch's redirect happens synchronously.
export async function saveRemoteGlbToAccount(source, meta = {}) {
- const user = await getMe();
- if (!user) {
- const err = new Error('not_signed_in');
- err.code = 'not_signed_in';
- throw err;
- }
-
let blob;
if (source instanceof Blob) {
blob = source;
diff --git a/src/app.js b/src/app.js
index 61797d384..242860778 100644
--- a/src/app.js
+++ b/src/app.js
@@ -256,7 +256,14 @@ class App {
// Editing an existing agent: ?agent=<uuid> (authenticated editing surface)
if (options.agentEdit) {
- this._loadAgentForEdit(options.agentEdit);
+ this._loadAgentForEdit(options.agentEdit).catch((err) => {
+ // Any throw before view() runs would leave the viewer un-mounted
+ // and the user staring at an empty canvas. Fall back to the
+ // default load so a 3D scene is always on screen.
+ console.warn('[3d-agent] agent-edit load failed', err);
+ if (!this.viewer) this._maybeResumeOrLoad(this.options);
+ if (!this._agentSystemBooted) this._initAgentSystem();
+ });
} else {
// Resume a stashed editor session (post-login round-trip), else
// load the model named in the URL or fall back to the CZ avatar.
@@ -367,6 +374,8 @@ class App {
// ── Agent System Init ─────────────────────────────────────────────────────
async _initAgentSystem() {
+ if (this._agentSystemBooted) return;
+ this._agentSystemBooted = true;
try {
// Wait for identity to resolve (uses local storage immediately, backend async)
await this.identity.load();
@@ -955,10 +964,23 @@ class App {
/* fall through to default */
}
- if (glbUrl) {
- await this.view(glbUrl, '', new Map());
- } else {
- this._maybeResumeOrLoad(this.options);
+ try {
+ if (glbUrl) {
+ await this.view(glbUrl, '', new Map());
+ } else {
+ await this._maybeResumeOrLoad(this.options);
+ }
+ } catch (err) {
+ // If the agent's GLB fails to load (404, decode error, etc.) we
+ // must still mount a viewer so the editor is usable.
+ console.warn('[3d-agent] agent GLB load failed; falling back', err);
+ if (!this.viewer) {
+ try {
+ await this._maybeResumeOrLoad(this.options);
+ } catch (fallbackErr) {
+ console.warn('[3d-agent] fallback load failed', fallbackErr);
+ }
+ }
}
// Restore + auto-save per-agent scene preferences (background, env,