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.

docs(structure): map the /analytics page, its module and its endpoint

nirholasf60d919b86b5
diff --git a/STRUCTURE.md b/STRUCTURE.md
index 315d59c71..0c87fcc59 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -64,6 +64,7 @@ bottom.
| KOL Tracker | [pages/tracker.html](pages/tracker.html) `→ /tracker`, backend [api/kol/[action].js](api/kol/%5Baction%5D.js) `→ GET /api/kol/tracker?window=&limit=`, aggregator [src/kol/tracker.js](src/kol/tracker.js), wallet list [src/kol/wallet-store.js](src/kol/wallet-store.js) (bundled [src/kol/wallets.json](src/kol/wallets.json) + admin R2 imports via `POST /api/kol/import-gmgn`), FIFO P&L engine [src/kol/wallet-pnl.js](src/kol/wallet-pnl.js), cached X follower/avatar lookup [src/kol/x-profile.js](src/kol/x-profile.js) | Live | Solana crypto KOLs ranked by realized P&L computed from each tracked wallet's own on-chain trade history (24h/7d/30d), with win rate, volume, and trade count — every number traceable to real trades, never a competitor's computed leaderboard. A wallet only shows an X handle/avatar/follower-count when an admin has explicitly attached a verified `xHandle` via `import-gmgn`'s `xHandles` map (never inferred or scraped); unattached wallets rank by wallet address alone. Rows with no configured trade source (`PUMPFUN_BOT_URL`) fall back to an imported `pnlUsd`/`winRate` labeled with its `pnlSource` rather than fabricating on-chain numbers. Prewarm cron: [api/cron/kol-tracker-refresh.js](api/cron/kol-tracker-refresh.js). |
| Agent Galaxy (every agent as a star, positioned by meaning) | [pages/galaxy.html](pages/galaxy.html) `→ /galaxy` + [src/galaxy.js](src/galaxy.js), backend [api/galaxy.js](api/galaxy.js) `→ GET/POST /api/galaxy`, assembler [api/_lib/galaxy.js](api/_lib/galaxy.js), embedding cache [api/_lib/agent-embeddings.js](api/_lib/agent-embeddings.js), live-economy overlay over `GET /api/galaxy/flows` | In-repo · awaits watsonx credentials | Every published agent embedded with an IBM Granite model on watsonx.ai, projected to 3D by PCA and grouped into k-means constellations that Granite then names, rendered as a Three.js point cloud. Typing a phrase embeds the query in the same space and lights the matching stars; the Money-Cam layer animates real on-chain transfers between them, and star brightness comes from each agent’s real wallet net worth. No mock path anywhere: with no watsonx credentials on the service `GET /api/galaxy` answers 503 and the page says so, offering the agent list and the integration doc instead of an empty universe. Tests: [tests/e2e/galaxy.spec.js](tests/e2e/galaxy.spec.js), [tests/galaxy-flows.test.js](tests/galaxy-flows.test.js) |
| The Agent Economy (live, network wide) | [pages/economy.html](pages/economy.html) `→ /economy` + page module [src/economy-live.js](src/economy-live.js), hire panel [src/shared/agent-hire.js](src/shared/agent-hire.js), feeds `GET /api/agents/economy?view=offers` ([api/agents/economy.js](api/agents/economy.js)), `GET /api/marketplace/agents`, `GET /api/agenc/x402-services` ([api/agenc/[action].js](api/agenc/%5Baction%5D.js)) over the shared discovery client [api/_lib/x402/bazaar-client.js](api/_lib/x402/bazaar-client.js) | Live | The wide-angle counterpart to the curated two-agent demo at `/agent-economy`: the real population of agents earning on three.ws, the agent-to-agent service market they hire each other through, and the live x402 bazaar of pay-per-call endpoints across Solana and Base. Three feeds, each owning its own loading / empty / error state so a slow or failing one never blanks the page, each retryable in place, and each polled every 45s while the tab is visible. Service rows name themselves from the facilitator's `metadata` when it publishes one and from the endpoint URL when it does not (most listings carry no name), show the endpoint they charge for, and never render a link to a path template or a rejected URL scheme. The A2A offers feed is empty until an owner prices an agent skill (`agent_paid_services`), which is a real state with a route out of it, not a stub. Tests: [tests/api/bazaar-endpoints.test.js](tests/api/bazaar-endpoints.test.js) |
+| Platform analytics (every platform total, one page) | [pages/analytics.html](pages/analytics.html) `→ /analytics` + page module [src/platform-analytics.js](src/platform-analytics.js), endpoint [api/platform/analytics.js](api/platform/analytics.js) `→ GET /api/platform/analytics?window=30d\|90d\|all`, data layer [api/_lib/platform-analytics.js](api/_lib/platform-analytics.js) | Live | The partner and investor view: agents, agents with a wallet, coins launched, 3D models generated, LLM tokens processed, x402 settlements and volume, marketplace sales and volume, and agent-to-agent hire volume, each with an all-time total, a zero-filled daily series and a `method` string rendered under "How each number is calculated". Counting predicates match the endpoints that already publish the same figure (`/api/home-stats`, the `MARKET_PAID_KINDS` gate, `platformEconomyStats()`), so no two pages disagree. A failing source is `null` plus a named `errors` entry, never a zero; the page shows an unavailable tile for it and a whole-page retry only when nothing could be read. Creator fees are listed as pending until per-agent earnings (parity order 015) ship. Docs: [docs/api-reference.md](docs/api-reference.md#platform-analytics-api). Tests: [tests/platform-analytics.test.js](tests/platform-analytics.test.js) |
| Agent Symphony (economy as generative music) | [pages/symphony.html](pages/symphony.html) `→ /symphony`, engine [src/symphony.js](src/symphony.js), grammar [src/symphony-score.js](src/symphony-score.js) | Live | The live activity bus (`GET /api/feed` + `/api/feed-stream` SSE) rendered as WebAudio generative music: one synthesized note per real platform event, voice by event type (payments pluck, coin buys land as bass, new agents chime, guard refusals play dissonance, jackpots glissando), pitch register by amount (whales sit lower), stable per-actor motif + stereo position via FNV-1a hash, all quantized to one pentatonic scale so arbitrary event streams harmonize. Canvas visualization, live ledger with real click-throughs, and a MediaRecorder tap that exports a shareable audio clip of the master bus. A burst gate collapses event floods (a sniper sweep emitting dozens of identical guard events) into one accented note per actor per 1.5s. Solo mode narrows the stream to one participant client-side (`?agent=<id>` exact, `?actor=<label>` case-insensitive), reachable from the per-row "solo" control and from the "Listen →" link on every agent profile's Wallet Story card. No audio assets, no synthetic events. Tests: [tests/symphony-score.test.js](tests/symphony-score.test.js) |
| Platform activity feed | [pages/feed.html](pages/feed.html) `→ /feed` + [pages/community.html](pages/community.html) `→ /community`, backend [api/users/me/feed.js](api/users/me/feed.js) | Live | Reverse-chronological creation events (avatars, agents, coins, models, worlds) plus follow activity, merged at read time from `forge_creations`, `dioramas`, and `user_follows` (no separate event log to drift out of sync). `?scope=following` (default; session-gated, anonymous gets 401) vs `?scope=all` (public; powers `/community` and first-visit feeds); `limit` 1..50, `before` ISO cursor. Items deep-link to creator portfolios. Distinct from the Money Pulse ticker `GET /api/feed` ([docs/money-feed.md](docs/money-feed.md)). Docs: [docs/social-layer.md](docs/social-layer.md) |
| Contributor thank-you roll | [pages/contributors.html](pages/contributors.html) `→ /contributors`, linked from [pages/community.html](pages/community.html) and [README.md](README.md) | In-repo | A public acknowledgment page for people improving three.ws through code, reviews, issue reports, and design ideas. The code-contributor roll reads GitHub's public contributor record live, excludes bots and anonymous-email records, and has explicit loading, failure, and retry states; a curated section credits non-code contributions that led to concrete improvements, beginning with the Forge/R2 outage report in issue #164. |