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.

fix: dedupe homepage 3D showcase to real distinct avatars; drop @sentry/node from api bundle externals

nirholas1ae851444050
diff --git a/api/_lib/sentry.js b/api/_lib/sentry.js
index c351b061f..3106a053b 100644
--- a/api/_lib/sentry.js
+++ b/api/_lib/sentry.js
@@ -119,7 +119,8 @@ function send(event) {
export function captureException(err, context = {}) {
if (!dsn()) return;
- const error = err instanceof Error ? err : new Error(typeof err === 'string' ? err : JSON.stringify(err));
+ const error =
+ err instanceof Error ? err : new Error(typeof err === 'string' ? err : JSON.stringify(err));
send({
...baseEvent('error'),
exception: {
diff --git a/pages/home.html b/pages/home.html
index 2ee073b3d..97d5c1b56 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -4784,14 +4784,16 @@
(function () {
const SHOWCASE_ANIMS = ['idle', 'dance', 'wave', 'celebrate', 'capoeira', 'thriller'];
const SHOWCASE_TAGS = ['3D', 'animated', 'rigged', 'ERC-8004', 'pay-per-call', 'community'];
- const EXPLORE_SHOWCASE_URL = '/api/explore?source=all&limit=6&quality=high';
+ // Pull real public 3D avatars (each a distinct GLB). source=all is dominated
+ // by GLB-less on-chain registrations, which would fall through to duplicated
+ // placeholder models — so we ask the avatar source for 3D rows only, then
+ // dedupe by model + name and take the first 6 unique ones.
+ const EXPLORE_SHOWCASE_URL = '/api/explore?source=avatar&only3d=1&limit=24&quality=high';
const FALLBACK_AGENTS = [
{ name: 'CZ', description: 'Stylized humanoid', glbUrl: '/avatars/cz.glb', viewerUrl: '/avatars/avatar_demo_disk_cz', kind: 'avatar' },
- { name: 'Ansem', description: 'CT legend', glbUrl: '/avatars/default.glb', viewerUrl: '/avatars/avatar_demo_disk_ansem', kind: 'avatar' },
- { name: 'Boss Vernington', description: 'Degen sovereign', glbUrl: '/animations/soldier.glb', viewerUrl: '/avatars/avatar_demo_disk_boss_vernington', kind: 'avatar' },
- { name: 'Goblin', description: 'Anon deployer', glbUrl: '/animations/robotexpressive.glb', viewerUrl: '/avatars/avatar_demo_disk_goblin', kind: 'avatar' },
- { name: 'Agent', description: 'Autonomous operative', glbUrl: '/animations/soldier.glb', viewerUrl: '/avatars/avatar_demo_disk_agent', kind: 'avatar' },
- { name: 'Claude', description: 'AI persona', glbUrl: '/avatars/default.glb', viewerUrl: '/avatars/avatar_demo_disk_claude', kind: 'avatar' },
+ { name: 'Ansem', description: 'Trader persona', glbUrl: '/avatars/default.glb', viewerUrl: '/avatars/avatar_demo_disk_ansem', kind: 'avatar' },
+ { name: 'Saga', description: 'Expressive robot rig', glbUrl: '/animations/robotexpressive.glb', viewerUrl: '/avatars/avatar_demo_disk_saga', kind: 'avatar' },
+ { name: 'Boss Vernington', description: 'Soldier rig with locomotion', glbUrl: '/animations/soldier.glb', viewerUrl: '/avatars/avatar_demo_disk_boss', kind: 'avatar' },
];
const grid = document.getElementById('showcase-3d-grid');
if (!grid) return;
@@ -4902,6 +4904,21 @@
return d.innerHTML;
}
+ // Drop repeats so every showcase card is a distinct character: collapse on
+ // both the underlying model (glbUrl/avatarId) and the display name.
+ function dedupeAgents(list) {
+ var seen = Object.create(null);
+ return list.filter(function (it) {
+ var modelKey = String(it.glbUrl || it.avatarId || '').toLowerCase();
+ var nameKey = String(it.name || '').trim().toLowerCase();
+ if (modelKey && seen['m:' + modelKey]) return false;
+ if (nameKey && seen['n:' + nameKey]) return false;
+ if (modelKey) seen['m:' + modelKey] = true;
+ if (nameKey) seen['n:' + nameKey] = true;
+ return true;
+ });
+ }
+
function renderShowcase(agentItems) {
agentItems.forEach(function (item, i) {
grid.appendChild(makeAgentCard(item, i));
@@ -4920,7 +4937,7 @@
.then(function (r) { return r.json(); })
.then(function (data) {
var items = Array.isArray(data.items) ? data.items : [];
- var agentItems = items.filter(function (it) { return it.glbUrl || it.avatarId; }).slice(0, 6);
+ var agentItems = dedupeAgents(items.filter(function (it) { return it.glbUrl || it.avatarId; })).slice(0, 6);
renderShowcase(agentItems.length >= 3 ? agentItems : FALLBACK_AGENTS);
})
.catch(function () {
diff --git a/scripts/bundle-api.mjs b/scripts/bundle-api.mjs
index 0910f172d..4f8401253 100644
--- a/scripts/bundle-api.mjs
+++ b/scripts/bundle-api.mjs
@@ -35,7 +35,7 @@ const isCiBuild =
process.env.CI === '1';
if (!isCiBuild && process.env.FORCE_BUNDLE_API !== '1') {
console.log(
- '[bundle-api] Skipping — not on Vercel/CI. This script overwrites api/*.js in place; running it locally destroys route sources. Set FORCE_BUNDLE_API=1 to override (preferably in a throwaway worktree).'
+ '[bundle-api] Skipping — not on Vercel/CI. This script overwrites api/*.js in place; running it locally destroys route sources. Set FORCE_BUNDLE_API=1 to override (preferably in a throwaway worktree).',
);
process.exit(0);
}
@@ -60,11 +60,15 @@ async function collectRouteFiles(dir, out = []) {
// or lazy-loaded deps as external so:
// 1. The bundle stays small (faster Vercel function packaging).
// 2. Dynamic imports stay dynamic at runtime instead of being inlined.
-// @sentry/node is the biggest offender — sentry.js uses `await import(...)`
-// to defer the ~15 MB OpenTelemetry instrumentation tree, but esbuild's
-// --bundle inlines dynamic imports unless the target is external.
+// Caveat: an external is left as a bare import, so NFT DOES trace it — once per
+// function that imports it. Keep this list to deps that are genuinely heavy AND
+// narrowly imported. A heavy external pulled in by a widely-shared module (e.g.
+// _lib/http.js → ~360 routes) multiplies into a build-timeout; that is exactly
+// why @sentry/node was removed from the http.js path (see api/_lib/sentry.js).
const EXTERNALS = [
- 'sharp', 'canvas', 'fsevents',
+ 'sharp',
+ 'canvas',
+ 'fsevents',
'@ipshipyard/node-datachannel',
'@three-ws/solana-agent',
'@solana/*',
@@ -202,8 +206,15 @@ for (let i = 0; i < routeFiles.length; i += BATCH_SIZE) {
process.stdout.write('!');
batchErrors++;
const stderr = err.stderr?.toString().trim() || err.message || '';
- const short = stderr.split('\n').filter((l) => l.includes('ERROR')).slice(0, 5).join('\n ') || stderr.slice(0, 400);
- console.error(`\n[bundle-api] Batch ${batchIdx}/${totalBatches} failed — retrying individually:\n ${short}`);
+ const short =
+ stderr
+ .split('\n')
+ .filter((l) => l.includes('ERROR'))
+ .slice(0, 5)
+ .join('\n ') || stderr.slice(0, 400);
+ console.error(
+ `\n[bundle-api] Batch ${batchIdx}/${totalBatches} failed — retrying individually:\n ${short}`,
+ );
// Retry each file in the failed batch on its own so one bad file
// doesn't poison the other 19. Anything still failing is definitively
// unbundled and will block the build below.
@@ -213,7 +224,12 @@ for (let i = 0; i < routeFiles.length; i += BATCH_SIZE) {
runEsbuild([file], 30_000);
} catch (singleErr) {
const ss = singleErr.stderr?.toString().trim() || singleErr.message || '';
- const sshort = ss.split('\n').filter((l) => l.includes('ERROR')).slice(0, 3).join('\n ') || ss.slice(0, 300);
+ const sshort =
+ ss
+ .split('\n')
+ .filter((l) => l.includes('ERROR'))
+ .slice(0, 3)
+ .join('\n ') || ss.slice(0, 300);
individualFailures.push({ file: relative(ROOT, file), error: sshort });
}
}
@@ -234,21 +250,28 @@ const sizes = await Promise.all(routeFiles.map(async (f) => (await stat(f)).size
const totalKB = (sizes.reduce((s, n) => s + n, 0) / 1024).toFixed(0);
console.log(
`\n[bundle-api] Done in ${elapsed}s — ${routeFiles.length} files, ${totalKB} KB` +
- (batchErrors ? `, ${batchErrors}/${totalBatches} batch errors (${individualRetries} individual retries)` : '') +
+ (batchErrors
+ ? `, ${batchErrors}/${totalBatches} batch errors (${individualRetries} individual retries)`
+ : '') +
(individualFailures.length ? `, ${individualFailures.length} routes still failing` : '') +
- (stillRaw.length ? `, ${stillRaw.length} routes left as raw source` : '')
+ (stillRaw.length ? `, ${stillRaw.length} routes left as raw source` : ''),
);
if (individualFailures.length) {
- console.error(`\n[bundle-api] FAILED — ${individualFailures.length} routes could not be bundled:`);
+ console.error(
+ `\n[bundle-api] FAILED — ${individualFailures.length} routes could not be bundled:`,
+ );
for (const { file, error } of individualFailures.slice(0, 25)) {
console.error(` ${file}\n ${error}`);
}
- if (individualFailures.length > 25) console.error(` …and ${individualFailures.length - 25} more`);
+ if (individualFailures.length > 25)
+ console.error(` …and ${individualFailures.length - 25} more`);
}
if (stillRaw.length) {
- console.error(`\n[bundle-api] FAILED — ${stillRaw.length} routes left as raw source (NFT would scan full node_modules):`);
+ console.error(
+ `\n[bundle-api] FAILED — ${stillRaw.length} routes left as raw source (NFT would scan full node_modules):`,
+ );
for (const f of stillRaw.slice(0, 25)) console.error(` ${f}`);
if (stillRaw.length > 25) console.error(` …and ${stillRaw.length - 25} more`);
}