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: Enhance Animation Gallery and Launchpad functionality with new features and improvements

udvkcf69d6cedbcd
diff --git a/pages/home.html b/pages/home.html
index 88d9cb194..76999589b 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -5360,7 +5360,13 @@
return fetch(location.origin + '/api/avatars/' + id)
.then(function(r) { return r.json(); })
.then(function(d) { return devProxyGlb(d.avatar && (d.avatar.model_url || d.avatar.url)) || ''; })
- .catch(function() { return ''; });
+ // The per-avatar detail endpoint can be unavailable; rather than
+ // strand the preview on a blank model, borrow a real, renderable
+ // GLB from the explore-backed pool so the playground always shows
+ // a live agent.
+ .catch(function() {
+ return getAvatarPool().then(function(pool) { return pool.find(Boolean) || ''; }).catch(function() { return ''; });
+ });
}
function switchAvatar(id, directGlb) {
@@ -5418,21 +5424,26 @@
{ id: 'avatar_demo_disk_ai', name: 'AI', glb: O + '/animations/robotexpressive.glb' },
];
renderAvatars(defaults);
- fetch('/api/marketplace')
+ // Source the picker from the explore feed, which returns a ready-to-render
+ // glbUrl per avatar. Carrying the GLB on each chip means selecting one
+ // uses the direct-GLB path in switchAvatar and never depends on the
+ // per-avatar detail endpoint.
+ fetch(O + '/api/explore?source=avatar&only3d=1&limit=24&quality=high', { headers: { accept: 'application/json' } })
.then(function(r) { return r.json(); })
.then(function(d) {
- var items = (d.agents || d.items || d || []).slice(0, 24);
+ var items = (Array.isArray(d.items) ? d.items : []).filter(function(it) { return it.glbUrl && it.avatarId; });
var list = defaults.slice();
var seen = {};
defaults.forEach(function(da) { seen[da.id] = true; });
items.forEach(function(item) {
- var id = item.avatar_id || item.avatarId || item.id;
+ var id = item.avatarId;
if (!id || seen[id]) return;
seen[id] = true;
list.push({
id: id,
- name: item.name || item.agent_name || '',
- thumb: item.thumbnail || (THUMB_CDN + '/' + id + '.png'),
+ name: item.name || '',
+ glb: devProxyGlb(item.glbUrl),
+ thumb: item.thumbUrl || item.image || (THUMB_CDN + '/' + id + '.png'),
});
});
renderAvatars(list.slice(0, 14));
diff --git a/tests/trader-stats.test.js b/tests/trader-stats.test.js
index 79ab36184..6ee1bb27e 100644
--- a/tests/trader-stats.test.js
+++ b/tests/trader-stats.test.js
@@ -248,6 +248,40 @@ describe('computeTraderMetrics — snipe hit-rate', () => {
});
});
+// A trader who earns their record through Strategy Objects is exactly as proven
+// as a sniper — the DB layer aliases agent_strategy_positions into this same
+// canonical shape (entry_lamports→entry_quote_lamports, exit_sig→sell_sig, …).
+// This pins that a normalized strategy record is first-class toward verification,
+// so the unified truth layer can never quietly drop a whole real trading surface.
+describe('strategy-origin records earn the same verified badge', () => {
+ const COINS = ['M1', 'M2', 'M3', 'M4', 'M5', 'M6'];
+ // 12 real round-trips across 6 distinct coins, net-positive, no churn — the
+ // canonical shape produced after aliasing strategy position rows.
+ const strategyRecord = COINS.flatMap((mint, i) => [
+ {
+ status: 'closed', mint, symbol: mint, realized_pnl_lamports: String(0.4 * SOL),
+ realized_pnl_pct: 40, entry_quote_lamports: String(1 * SOL), exit_quote_lamports: String(1.4 * SOL),
+ opened_at: `2026-02-0${(i % 9) + 1}T00:00:00.000Z`, closed_at: `2026-02-0${(i % 9) + 1}T01:00:00.000Z`,
+ buy_sig: `sb${i}a`, sell_sig: `ss${i}a`,
+ },
+ {
+ status: 'closed', mint, symbol: mint, realized_pnl_lamports: String(0.1 * SOL),
+ realized_pnl_pct: 10, entry_quote_lamports: String(1 * SOL), exit_quote_lamports: String(1.1 * SOL),
+ opened_at: `2026-02-1${i % 9}T00:00:00.000Z`, closed_at: `2026-02-1${i % 9}T02:00:00.000Z`,
+ buy_sig: `sb${i}b`, sell_sig: `ss${i}b`,
+ },
+ ]);
+
+ it('verifies a clean 12-trade, 6-coin, net-positive strategy record', () => {
+ const m = computeTraderMetrics(strategyRecord);
+ expect(m.closed_count).toBe(12);
+ expect(m.unique_coins).toBe(6);
+ expect(m.realized_pnl_sol).toBeGreaterThan(0);
+ expect(m.churn_pct).toBe(0);
+ expect(m.verified).toBe(true);
+ });
+});
+
describe('windowStartIso', () => {
const NOW = Date.parse('2026-06-15T12:00:00.000Z');