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(studio): give an agent page its coin, its prices, and a keyboard
nirholas1bd84d715025
diff --git a/data/changelog.json b/data/changelog.jsonindex 595aec8a1..41cb4edd3 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,35 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-08-19",+ "title": "A page that fails to load now tells you which thing went wrong",+ "summary": "When an avatar or agent page could not load, it always said the same thing: not found, followed by whatever internal message the browser happened to throw. A stale link and a temporary server hiccup looked identical, and the explanation was often developer jargon rather than English. The two cases are now told apart. A link to something that no longer exists says exactly that and points you at the marketplace or the agent directory. A genuine failure on our side says so, offers a Try again button, and keeps the technical detail as a small footnote instead of presenting it as the reason.",+ "tags": [+ "improvement",+ "fix"+ ]+ },+ {+ "date": "2026-08-19",+ "title": "Phone fixes: helper widgets no longer sit on top of the controls",+ "summary": "On a phone the floating language control and the Getting started pill landed directly on the page's own bottom controls: the language picker rendered inside the \"Ask the agent\" box and the pill covered the save row. Helper widgets now measure a page's bottom bar and float above it, and the language control shows a compact code (EN) instead of a full-width bar. Gallery cards show all three actions in full, so Animate is no longer clipped mid-word. In the AR Studio, the Add models sheet keeps its tabs at full height on short screens, and each model is labelled with a readable name instead of the whole generation prompt. On the viewer page a long email no longer pushes the account button off the edge of the screen.",+ "tags": [+ "fix",+ "improvement"+ ],+ "link": "/gallery"+ },+ {+ "date": "2026-08-19",+ "title": "Agent pages show what an agent can actually do, and what it charges",+ "summary": "The studio page every agent link opens now carries the agent's real substance. Its Capabilities tab lists the skills it genuinely exposes with the real per-call price of each, and a summary line telling you the cheapest paid call up front (or that everything is free). Skill names read as words instead of raw slugs, with the exact slug shown underneath for anyone wiring an integration. Under the title there is now a row of real counters: skills, conversations, wallet, whether the identity is on-chain, and how long the agent has been around. Below the fold, an agent recommends similar agents rather than unrelated avatars, each rendered as a live 3D card. The page also loads better: a skeleton in the real layout instead of a line of text, cards that show a picture while their 3D model downloads, and full keyboard support on the section tabs with a shareable link per tab.",+ "tags": [+ "improvement",+ "feature"+ ],+ "link": "/agents"+ },{"date": "2026-08-18","title": "Agents and avatars now open in the same studio page",diff --git a/docs/agents-vs-avatars.md b/docs/agents-vs-avatars.mdindex 5d9d66078..bf1f9b5e0 100644--- a/docs/agents-vs-avatars.md+++ b/docs/agents-vs-avatars.md@@ -46,11 +46,24 @@ The two modes differ only where the underlying entity does:| Views in the switcher | 3D, Chat, AR, Embed | 3D, Chat, AR, Embed, Profile || Primary action | `Start an agent` | `Full profile` || Chat | Voices the body | Speaks as the agent, using its brain and memory |+| Third tab | `Skills`: add-ons you attach to the body | `Capabilities`: the skills this agent exposes, and their real per-call price |+| Signals row | Views, forks, version, created | Skills, conversations, wallet, on-chain identity, active since || Relationship card | `Used by`: the agents wearing this body | `Wearing`: the body this agent wears |+| Below the fold | Related avatars | Similar agents || Wallet | Only via a bound agent | The agent's own custodial wallet |Both directions are one click apart: an agent's `Wearing` card opens its body's page, and a body's `Used by` grid opens each agent that wears it.+### Reading an agent's capabilities++The `Capabilities` tab is the honest answer to "what can I call, and what does it cost?" Each row shows the skill's readable name, its exact slug (the string you pass to the API or an x402 call), and a badge: `Free`, a real price such as `1 USDC`, or `Token gated` when access is holding an NFT rather than paying. A summary line above the list names the cheapest paid call, so you learn the floor without reading every row.++Prices are read straight off the agent record as atomic integers in the mint's own decimals and formatted from those digits, never divided into a float, so a nine-decimal mint stays exact. Buying is not duplicated here: trials, time passes and purchase all live on the [full profile](#the-long-form-agent-profile), which every priced row links to.++### Every tab is an address++The section tabs are a real WAI-ARIA tab list: arrow keys move between them, `Home` and `End` jump to the ends, and only the selected tab sits in the page's tab order. Selecting one writes it into the URL (`?view=chat`, `?view=skills`), so any tab can be linked or bookmarked, and `Overview` is the bare canonical URL with no parameter.+### How to tell which page you're on- The type pill under the header says it outright, and its `?` link leads back to this page.diff --git a/pages/avatar-page.html b/pages/avatar-page.htmlindex 8987e069a..a78480982 100644--- a/pages/avatar-page.html+++ b/pages/avatar-page.html@@ -1295,6 +1295,12 @@color: var(--warn);border-color: rgba(251, 191, 36, 0.4);}+ .av-coin {+ margin-top: 18px;+ }+ .av-coin > div {+ margin-top: 8px;+ }.av-row-slug {font-family: ui-monospace, SFMono-Regular, Menlo, monospace;font-size: 11px;diff --git a/public/changelog.json b/public/changelog.jsonindex 0d13de1d7..1b99f6a3d 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-19T01:44:07.271Z",+ "generated_at": "2026-08-19T01:45:06.251Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",diff --git a/public/features.json b/public/features.jsonindex d9e121b33..064961ac6 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-19T01:44:07.172Z",+ "generated_at": "2026-08-19T01:45:06.231Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/avatar-page.js b/src/avatar-page.jsindex 98740f43c..bf0ab0342 100644--- a/src/avatar-page.js+++ b/src/avatar-page.js@@ -36,6 +36,7 @@ import { mountPresence } from './shared/networth-presence.js';import { emitRecallFromChat } from './agents/memory-client.js';import { moodEngine } from './agents/mood-engine.js';import { skillLabel } from './shared/skill-label.js';+import { mountCoinStatus } from './pump/coin-status-card.js';const ATTACHED_KEY_PREFIX = 'avatar_attached_v1:';@@ -81,6 +82,7 @@ mountBackLink();// Stop the wallet-aura live poll and free its rAF when the page unloads.window.addEventListener('pagehide', () => {+ coinStatus?.destroy?.(); coinStatus = null;netWorthAura?.destroy?.(); netWorthAura = null;netWorthPanel?.destroy?.(); netWorthPanel = null;netWorthPlate?.destroy?.(); netWorthPlate = null;@@ -95,6 +97,8 @@ let agent = null;// only present on the GET response for the owner; in agent mode the server// answers directly with `is_owner`.let viewerOwns = false;+// Live coin widget handle, so its refresh timer is cancelled on unload.+let coinStatus = null;let netWorthAura = null;let netWorthPanel = null;let netWorthPlate = null;@@ -231,16 +235,6 @@ function mountBackLink() {// ── API ───────────────────────────────────────────────────────────────-/**- * Load whichever entity the URL names and hand back the pair the renderer- * needs. Agents and avatars live in separate tables with separate UUIDs, so an- * id can land on the wrong route (an old link, a shared URL). Rather than- * dead-end on "not found", probe the other store and redirect to the canonical- * path. The page looks the same either way, but the URL stays truthful.- *- * @param {string} id- * @returns {Promise<{ agent: object|null, avatar: object }>}- *//*** A subject that genuinely does not exist, as opposed to a request that failed.* The two need different words on screen: one is a stale link the visitor can@@ -252,6 +246,16 @@ function notFound(message) {return err;}+/**+ * Load whichever entity the URL names and hand back the pair the renderer+ * needs. Agents and avatars live in separate tables with separate UUIDs, so an+ * id can land on the wrong route (an old link, a shared URL). Rather than+ * dead-end on "not found", probe the other store and redirect to the canonical+ * path. The page looks the same either way, but the URL stays truthful.+ *+ * @param {string} id+ * @returns {Promise<{ agent: object|null, avatar: object }>}+ */async function resolveEntity(id) {if (mode === 'agent') {const rec = await fetchAgentRecord(id);@@ -493,7 +497,9 @@ function signalsHTML() {if (skills) items.push({ v: skills, k: skills === 1 ? 'skill' : 'skills' });const chats = num(agent.chat_count);if (chats) items.push({ v: compactNumber(chats), k: chats === 1 ? 'chat' : 'chats' });- if (agent.solana_address) items.push({ v: 'Solana', k: 'wallet' });+ // No wallet signal here on purpose: the chip directly below already shows+ // the address, its live value and the tip action. Two of the same fact is+ // noise, and the chip is the richer one.if (agent.is_registered) items.push({ v: 'On-chain', k: 'identity' });if (agent.created_at) items.push({ v: sinceLabel(agent.created_at), k: 'active since' });} else {@@ -690,6 +696,12 @@ function renderShell(glbUrl) {<div class="av-panels"><div class="av-panel active" data-panel="overview" id="av-panel-overview" role="tabpanel" aria-labelledby="av-tab-overview" tabindex="0">${avatar.description ? `<p class="av-desc">${esc(avatar.description)}</p>` : '<p class="av-desc" style="color:var(--text-3)">No description provided.</p>'}+ ${mode === 'agent'+ ? `<section class="av-coin" id="av-coin" hidden aria-labelledby="av-coin-heading">+ <h3 class="av-used-by-heading" id="av-coin-heading">Its coin</h3>+ <div id="av-coin-slot"></div>+ </section>`+ : ''}${mode === 'agent' ? bodyCardHTML() : ''}<section class="av-used-by" id="av-used-by" hidden aria-labelledby="av-used-by-heading"><h3 class="av-used-by-heading" id="av-used-by-heading">Used by</h3>@@ -798,6 +810,64 @@ function renderShell(glbUrl) {if (actions && customElements.get('avatar-actions')) actions.avatar = avatar;mountWalletManager();+ mountAgentCoin();+}++/**+ * The live market state of the coin this agent launched, using the same shared+ * widget the full profile mounts, so one mint reads identically on both. Real+ * data only: symbol, price, market cap and graduation come off the pump.fun+ * indexer, falling back to the bonding curve read straight from the cluster+ * (the only source on devnet, where the widget prices in SOL rather than+ * pretending a rehearsal coin is worth dollars).+ *+ * The mint is never hardcoded: it comes from this platform's own launch records+ * at runtime, so the section only exists for an agent that really launched.+ */+async function mountAgentCoin() {+ const slot = $('av-coin-slot');+ if (!slot || mode !== 'agent') return;+ const token = await resolveAgentCoin();+ if (!token?.mint) return; // no coin, section stays hidden+ $('av-coin').hidden = false;+ coinStatus = mountCoinStatus(slot, token.mint, {+ variant: 'chip',+ network: token.cluster === 'devnet' ? 'devnet' : 'mainnet',+ meta: {+ symbol: token.symbol || '',+ name: token.name || '',+ image: token.image || '',+ createdAt: token.launched_at ? Date.parse(token.launched_at) || null : null,+ },+ });+}++/**+ * Which coin, if any, this agent launched. `meta.token` is written by only one+ * of the two launch paths, so an agent that launched from its own custodial+ * wallet has an empty field and a real row in `pump_agent_mints`. Ask the+ * launch records rather than trusting the cached field alone.+ */+async function resolveAgentCoin() {+ if (agent?.token?.mint) return agent.token;+ try {+ const r = await fetch(`/api/pump/by-agent?agent_id=${encodeURIComponent(entityId)}`, {+ credentials: 'include',+ });+ if (!r.ok) return null;+ const rec = (await r.json())?.data;+ if (!rec?.mint) return null;+ return {+ mint: rec.mint,+ cluster: rec.network === 'devnet' ? 'devnet' : 'mainnet',+ symbol: rec.symbol || '',+ name: rec.name || '',+ image: rec.image || '',+ launched_at: rec.created_at || null,+ };+ } catch {+ return null; // optional section, stays hidden on network failure+ }}/**