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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat: enhance explore API to prioritize avatar display and update routing for agent index
nirholasdc0e2baf12d6
diff --git a/api/explore.js b/api/explore.jsindex 9f988ed87..fd9d60594 100644--- a/api/explore.js+++ b/api/explore.js@@ -140,10 +140,31 @@ export default wrap(async (req, res) => {avatarItems.push(...matching);}- // Merge by date desc and trim to page size; cursor is the date of the last item.- const merged = [...onchainItems, ...avatarItems].sort(+ // Merge by date desc, but guarantee avatars surface on page 1 so the+ // onchain firehose doesn't drown them. Reserve up to a third of the page+ // for avatars when both sources are present and this is the first page.+ const onchainSorted = [...onchainItems].sort((a, b) => new Date(b.sortDate).getTime() - new Date(a.sortDate).getTime(),);+ const avatarSorted = [...avatarItems].sort(+ (a, b) => new Date(b.sortDate).getTime() - new Date(a.sortDate).getTime(),+ );++ let merged;+ if (!cursorDate && onchainSorted.length && avatarSorted.length) {+ const avatarQuota = Math.min(avatarSorted.length, Math.max(1, Math.ceil(limit / 3)));+ const avatarHead = avatarSorted.slice(0, avatarQuota);+ const avatarTail = avatarSorted.slice(avatarQuota);+ const rest = [...onchainSorted, ...avatarTail].sort(+ (a, b) => new Date(b.sortDate).getTime() - new Date(a.sortDate).getTime(),+ );+ merged = [...avatarHead, ...rest];+ } else {+ merged = [...onchainSorted, ...avatarSorted].sort(+ (a, b) => new Date(b.sortDate).getTime() - new Date(a.sortDate).getTime(),+ );+ }+const hasMore = merged.length > limit;const items = merged.slice(0, limit);const nextCursor = hasMore && items.length > 0 ? items[items.length - 1].sortDate : null;diff --git a/public/discover/index.html b/public/discover/index.htmlindex 525c0671a..dc590f12d 100644--- a/public/discover/index.html+++ b/public/discover/index.html@@ -139,6 +139,6 @@</section></main>- <script type="module" src="./discover.js"></script>+ <script type="module" src="/discover/discover.js"></script></body></html>diff --git a/src/home-act2-viewer.js b/src/home-act2-viewer.jsindex 1dfe8999a..a781d83cc 100644--- a/src/home-act2-viewer.js+++ b/src/home-act2-viewer.js@@ -196,9 +196,23 @@ export class Act2Viewer {this.mixer = new AnimationMixer(this.model);- /* register baked-in clips */+ /* collect node names available on this skeleton so we can drop+ * tracks that target bones the current model doesn't have — otherwise+ * three.js floods the console with "No target node found" warnings+ * for every mismatched bone, every frame the clip plays. */+ const knownNodes = new Set();+ this.model.traverse((n) => {+ if (n.name) knownNodes.add(n.name);+ });++ /* register baked-in clips, filtering tracks to those that bind */for (const clip of gltf.animations || []) {- this.clips.set(clip.name, clip);+ const tracks = clip.tracks.filter((t) => {+ const nodeName = t.name.split('.')[0];+ return knownNodes.has(nodeName);+ });+ if (tracks.length === 0) continue;+ this.clips.set(clip.name, new AnimationClip(clip.name, clip.duration, tracks));}/* ensure manifest is fetched */@@ -247,6 +261,14 @@ export class Act2Viewer {const def = this._manifest.find((d) => d.name === name);if (!def) return;clip = await this._fetchClip(def.url);+ const knownNodes = new Set();+ this.model?.traverse((n) => {+ if (n.name) knownNodes.add(n.name);+ });+ const tracks = clip.tracks.filter((t) =>+ knownNodes.has(t.name.split('.')[0]),+ );+ clip = new AnimationClip(clip.name, clip.duration, tracks);this.clips.set(name, clip);}diff --git a/vercel.json b/vercel.jsonindex c81cea80d..322e6cb7c 100644--- a/vercel.json+++ b/vercel.json@@ -118,6 +118,7 @@},"dest": "/agent-embed.html"},+ { "src": "/agent/index.html", "dest": "/agent/index.html" },{"src": "/agent/([^/]+)","has": [{ "type": "query", "key": "_spa", "value": "1" }],