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
Changelog wallet-connect launches; pin skill-price detail API contract
nirholas47a63427164f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d69d4e388..184b62157 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,6 +10,8 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **An inbox for your IRL agents — see who tapped, messaged, or paid, and reply** — Your IRL Agents dashboard now has an Inbox: a live, chronological feed of everyone who met your placed agents in real life. Each entry shows what happened — a view, a tap, a message, or a payment — where it happened, and how long ago. Payments show the exact amount and link straight to the block-explorer receipt, and you can reply to anyone who left your agent a message; if they were signed in, your reply lands in their notifications. Unread counts appear on the Inbox button and on each agent's card, the feed refreshes itself every few seconds, and opening the inbox marks everything read. High-signal events (a payment or a message) also ping you in the notification bell, so you find out the moment a stranger across the city engages your agent. (`/dashboard/irl-placements`) `[feature]`- **Change a placed agent's outfit from your dashboard — everyone nearby sees it** — Your IRL Agents dashboard now has a real outfit editor. Open Change outfit on any agent you've placed and a live 3D preview loads with wardrobe controls for the exact layers that avatar has — recolour its hair, skin, and clothing, strip back to the base body and dress it up again, or stack on hats, glasses, and earrings. Because your agents are public, the new look is baked into the agent itself and pushed to its real-world pin, so every person who walks up to that spot sees the updated outfit in their camera — not just you. Save when you're happy; the avatar is re-rendered for real before it confirms, the previous look stays untouched if anything fails, and nearby viewers refresh to the new outfit within seconds. Run a seasonal look, brand your agents as staff for an event, or just keep them fresh — all without walking back to where you pinned them. (`/dashboard/irl-placements`) `[feature]`- **Clearer pricing on every agent's skills in the marketplace** — An agent's detail page now reads cleanly when its skills carry a price. Each skill shows a badge at a glance — green 'Free', a yellow price for paid skills, or an indigo 'Owned' once you've bought it — and when a paid skill offers a free trial or a timed access pass, those now appear as proper buttons styled to match the Purchase button, with hover, focus, and press states. The price badge and action buttons are grouped together on the right of each row instead of spreading out, so a skill with several options stays tidy and easy to scan. (`/marketplace`) `[improvement]`+- **Connect your Solana wallet right from the app header** — The main app now has a Connect Wallet button in the top bar — the first step toward buying an agent's paid skills. Click it and your Solana wallet (Phantom, or the built-in wallet on Solana Mobile / Seeker) prompts you to connect; once you do, the button shows your address shortened to something like '7xKq…9fРa' with a green tick so you can see at a glance that you're connected. If you've connected before, it reconnects silently on load, and if you don't have a wallet yet it points you to Phantom. No wallet, no signature, and nothing on-chain happens just from connecting — it only lets the platform know which wallet to use when you choose to pay. (`/app`) `[feature]`+- **Connect your Solana wallet right from the marketplace** — The marketplace now carries a persistent Connect Wallet control — in the sidebar on desktop, in the search bar on mobile — so you can link Phantom, Solflare, or Backpack once and arrive at any purchase already connected, instead of waiting until checkout. If you have more than one wallet installed you get a quick picker; if you have none, it points you to install one. Once connected it shows your address as a tidy pill with a menu to copy it, view the account on Solscan, or disconnect, and it quietly reconnects a previously approved wallet when you return — no extra pop-up. Connect from the header and the Buy dialog is ready to go; connect at checkout and the header updates too. It rides the same on-chain USDC purchase flow already in place, so there's nothing new to trust. (`/marketplace`) `[feature]`- **Everyone at a location now sees your IRL agent in the same real spot** — three.ws/irl agents now line up across phones. A placed agent renders from its own saved compass bearing and ground height instead of whichever way your phone happens to face, so two people standing in the same place see it standing in the same place, facing the same way. To keep it steady, your own GPS position is now smoothed so anchored agents stop drifting and swimming as your location jitters, and noisy fixes are ignored. Every agent now sits inside a ground ring whose size reflects the real GPS accuracy — honest about the fact that phone GPS is roughly 5–15 metres, and wider (and amber) when the signal is poor — so it never pretends to be pinpoint-perfect. And if an agent landed a little off, its owner can fine-tune it: long-press your own agent (or tap Calibrate position on its card) and drag to nudge it a few centimetres, twist with two fingers to rotate it, or step its floor height up and down. Saving the nudge updates the spot for everyone nearby. Only the owner can calibrate an agent, nudges are capped to small corrections so this can never be used to drag someone's agent across the map, and a failed save keeps your change on screen with a one-tap retry. (`/irl`) `[feature, improvement]`- **iPhone now world-locks your IRL agent — it holds its real spot as you pan and walk** — iPhone Safari has no AR mode, so a placed agent used to drift with the camera. On three.ws/irl it now stays anchored to its real-world spot using the compass and GPS: pan your phone and the agent holds its real bearing instead of following the view, and walk toward it and it grows and keeps its place. Tapping Pin here saves the full placement — facing, ground height, and how good your GPS fix was — so iPhone placements match the AR-anchored version other phones see. If you pin before your location is ready, it waits for the first fix and pins precisely instead of dropping at a default spot. Permission states are designed and recoverable too: if motion or location access is off you get a clear card with the exact iOS Settings path and a Try again button, and if your phone can't read an absolute compass heading you're warned that others may see the agent rotated. (`/irl`) `[improvement]`- **IRL agents now materialize as you walk up to them** — On three.ws/irl, a 3D agent placed further away first appears as a glowing beacon to keep things light. Previously it stayed a beacon even after you walked right up to it; now it upgrades to the full 3D avatar the moment you come within range, so approaching an agent in real life actually reveals it. Distance to each nearby agent is also recalculated live as you move instead of being frozen at the moment you arrived. Long AR sessions are smoother too: agents that leave the area now fully release their 3D model from memory instead of quietly accumulating, which keeps the camera view fast when you're somewhere busy with lots of agents coming and going. (`/irl`) `[fix, improvement]`diff --git a/data/changelog.json b/data/changelog.jsonindex fd98ff1ef..f83902ea7 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,20 @@{"$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-06-17",+ "title": "Connect your Solana wallet right from the marketplace",+ "summary": "The marketplace now carries a persistent Connect Wallet control — in the sidebar on desktop, in the search bar on mobile — so you can link Phantom, Solflare, or Backpack once and arrive at any purchase already connected, instead of waiting until checkout. If you have more than one wallet installed you get a quick picker; if you have none, it points you to install one. Once connected it shows your address as a tidy pill with a menu to copy it, view the account on Solscan, or disconnect, and it quietly reconnects a previously approved wallet when you return — no extra pop-up. Connect from the header and the Buy dialog is ready to go; connect at checkout and the header updates too. It rides the same on-chain USDC purchase flow already in place, so there's nothing new to trust.",+ "tags": ["feature"],+ "link": "/marketplace"+ },+ {+ "date": "2026-06-17",+ "title": "Connect your Solana wallet right from the app header",+ "summary": "The main app now has a Connect Wallet button in the top bar — the first step toward buying an agent's paid skills. Click it and your Solana wallet (Phantom, or the built-in wallet on Solana Mobile / Seeker) prompts you to connect; once you do, the button shows your address shortened to something like '7xKq…9fPa' with a green tick so you can see at a glance that you're connected. If you've connected before, it reconnects silently on load, and if you don't have a wallet yet it points you to Phantom. No wallet, no signature, and nothing on-chain happens just from connecting — it only lets the platform know which wallet to use when you choose to pay.",+ "tags": ["feature"],+ "link": "/app"+ },{"date": "2026-06-17","title": "Clearer pricing on every agent's skills in the marketplace",diff --git a/public/changelog.json b/public/changelog.jsonindex 956e81921..e9bfafb8b 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-17T05:46:02.240Z",+ "generated_at": "2026-06-17T06:00:37.268Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -47,6 +47,26 @@"improvement"]},+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Connect your Solana wallet right from the app header",+ "summary": "The main app now has a Connect Wallet button in the top bar — the first step toward buying an agent's paid skills. Click it and your Solana wallet (Phantom, or the built-in wallet on Solana Mobile / Seeker) prompts you to connect; once you do, the button shows your address shortened to something like '7xKq…9fРa' with a green tick so you can see at a glance that you're connected. If you've connected before, it reconnects silently on load, and if you don't have a wallet yet it points you to Phantom. No wallet, no signature, and nothing on-chain happens just from connecting — it only lets the platform know which wallet to use when you choose to pay.",+ "link": "/app",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-17",+ "type": "update",+ "title": "Connect your Solana wallet right from the marketplace",+ "summary": "The marketplace now carries a persistent Connect Wallet control — in the sidebar on desktop, in the search bar on mobile — so you can link Phantom, Solflare, or Backpack once and arrive at any purchase already connected, instead of waiting until checkout. If you have more than one wallet installed you get a quick picker; if you have none, it points you to install one. Once connected it shows your address as a tidy pill with a menu to copy it, view the account on Solscan, or disconnect, and it quietly reconnects a previously approved wallet when you return — no extra pop-up. Connect from the header and the Buy dialog is ready to go; connect at checkout and the header updates too. It rides the same on-chain USDC purchase flow already in place, so there's nothing new to trust.",+ "link": "/marketplace",+ "tags": [+ "feature"+ ]+ },{"date": "2026-06-17","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 15b2ad63f..795129acc 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -38,6 +38,22 @@<category>improvement</category><description>An agent's detail page now reads cleanly when its skills carry a price. Each skill shows a badge at a glance — green 'Free', a yellow price for paid skills, or an indigo 'Owned' once you've bought it — and when a paid skill offers a free trial or a timed access pass, those now appear as proper buttons styled to match the Purchase button, with hover, focus, and press states. The price badge and action buttons are grouped together on the right of each row instead of spreading out, so a skill with several options stays tidy and easy to scan.</description></item>+ <item>+ <title>Connect your Solana wallet right from the app header</title>+ <link>https://three.ws/app</link>+ <guid isPermaLink="false">2026-06-17:Connect your Solana wallet right from the app header</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The main app now has a Connect Wallet button in the top bar — the first step toward buying an agent's paid skills. Click it and your Solana wallet (Phantom, or the built-in wallet on Solana Mobile / Seeker) prompts you to connect; once you do, the button shows your address shortened to something like '7xKq…9fРa' with a green tick so you can see at a glance that you're connected. If you've connected before, it reconnects silently on load, and if you don't have a wallet yet it points you to Phantom. No wallet, no signature, and nothing on-chain happens just from connecting — it only lets the platform know which wallet to use when you choose to pay.</description>+ </item>+ <item>+ <title>Connect your Solana wallet right from the marketplace</title>+ <link>https://three.ws/marketplace</link>+ <guid isPermaLink="false">2026-06-17:Connect your Solana wallet right from the marketplace</guid>+ <pubDate>Wed, 17 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The marketplace now carries a persistent Connect Wallet control — in the sidebar on desktop, in the search bar on mobile — so you can link Phantom, Solflare, or Backpack once and arrive at any purchase already connected, instead of waiting until checkout. If you have more than one wallet installed you get a quick picker; if you have none, it points you to install one. Once connected it shows your address as a tidy pill with a menu to copy it, view the account on Solscan, or disconnect, and it quietly reconnects a previously approved wallet when you return — no extra pop-up. Connect from the header and the Buy dialog is ready to go; connect at checkout and the header updates too. It rides the same on-chain USDC purchase flow already in place, so there's nothing new to trust.</description>+ </item><item><title>Everyone at a location now sees your IRL agent in the same real spot</title><link>https://three.ws/irl</link>diff --git a/public/features.json b/public/features.jsonindex 20ab5f29d..f2a59b2f7 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-17T05:46:02.139Z",+ "generated_at": "2026-06-17T06:00:37.148Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/tasks/collectible-ux/01-deploy-progress-ui.md b/tasks/collectible-ux/01-deploy-progress-ui.mddeleted file mode 100644index 36b55158c..000000000--- a/tasks/collectible-ux/01-deploy-progress-ui.md+++ /dev/null@@ -1,73 +0,0 @@-# Task: Cinematic Deploy Progress UI--## Goal-The on-chain deployment of a 3D AI Agent is a meaningful moment — it needs to feel like one. Right now `DeployButton._renderProgress` shows tiny monochrome text steps with arrow separators. This task replaces it with a dramatic, animated step-by-step UI that makes the recording worth watching.--## What to build--### Replace `_renderProgress` in `src/erc8004/deploy-button.js`--The existing method signature stays the same:-```js-_renderProgress(steps, activeIdx, extra)-```--New visual design for the progress container:-- Each step is a vertical card/tile, not an inline chip-- Done steps: filled accent color, checkmark icon, full opacity-- Active step: pulsing glow ring around it, animated spinner inside, full opacity-- Pending steps: dim, no icon-- Between each step: a vertical animated "flowing" line (CSS animation, not a static arrow)-- The active step label renders large below the tiles as status text-- Monospace detail text (`extra.text`) renders underneath in a dim terminal style--CSS goes inline in the method (no external file needed for this task) using a `<style>` tag injected once.--### After successful Solana deploy, redirect instead of showing the chip--In `_startSolanaDeploy`, after calling `_renderSuccessChip`, immediately redirect:--```js-// After this._renderSuccessChip(...) call:-const agentId = this._agent.id;-const txSig = result.txSignature;-const assetPubkey = result.assetPubkey;-const chain = this._chainId; // 'solana-mainnet' or 'solana-devnet'--setTimeout(() => {- window.location.href = `/mint-success.html?id=${encodeURIComponent(agentId)}&tx=${encodeURIComponent(txSig)}&asset=${encodeURIComponent(assetPubkey || '')}&chain=${encodeURIComponent(chain)}`;-}, 800); // brief pause so user sees the success chip flash-```--Do the same for EVM deploys in `_startDeploy` — find the section that calls `_renderSuccessChip` and add the same redirect using `chainId` and `txHash` from the registry receipt.--### Cancel button on the vanity grind step--The grind can take minutes. The existing cancel button works but is visually hidden in the dense UI. In the new layout, render it as a proper ghost button below the active step tile, clearly labeled "Stop grinding".--## Files to edit-- `src/erc8004/deploy-button.js` — `_renderProgress` method + `_startSolanaDeploy` + `_startDeploy` redirect logic--## Files NOT to touch-- `src/agent-detail.js` — separate task-- Any CSS files — inline the new styles--## Definition of done-- Deployment progress looks dramatic and cinematic: animated, glowing active step, flowing connector lines-- After successful deploy (Solana and EVM), browser redirects to `/mint-success.html` with tx params in the URL-- Cancel on vanity grind is clearly visible-- No console errors--<!-- AUTO:self-delete-on-complete -->-------## ✅ On completion — delete this file--This file is a unit of work, not a permanent doc. The moment every item above is **built, wired, verified, and committed** to the "Definition of done" in the repo-root `CLAUDE.md`, remove it in the same change:--```bash-git rm "tasks/collectible-ux/01-deploy-progress-ui.md"-```--Stage the deletion alongside your implementation and include it in the completion commit. This directory is the backlog: a file that still exists is unfinished work; a file that is gone has shipped. Do not delete early, and never leave a completed prompt behind.diff --git a/tasks/collectible-ux/02-mint-success-reveal.md b/tasks/collectible-ux/02-mint-success-reveal.mddeleted file mode 100644index aa57c4803..000000000--- a/tasks/collectible-ux/02-mint-success-reveal.md+++ /dev/null@@ -1,124 +0,0 @@-# Task: Post-Mint Reveal Page--## Goal-Create `pages/mint-success.html` — a full-screen cinematic reveal shown immediately after an agent is deployed on-chain. This is the money shot for content recording: the 3D avatar materializing on-screen with the transaction hash confirming beneath it. Nothing else exists like this in the platform today.--## URL and params--```-/mint-success.html?id=<agentId>&tx=<txSignature>&asset=<assetPubkey>&chain=<chainId>-```--All params come from the deploy redirect added in task 01. Read them with `new URLSearchParams(location.search)`.--## Page structure--Single-file implementation: `pages/mint-success.html` (inline `<script type="module">` + inline `<style>`).--### Visual layout (full viewport, dark background `#050508`)--```-┌─────────────────────────────────────────────┐-│ │-│ [3D avatar — large, centered] │-│ spinning slowly on its axis │-│ │-│ ✦ Agent deployed on-chain │-│ [agent name] │-│ │-│ ◈ Solana · [short tx hash] │-│ [View on explorer ↗] │-│ │-│ [ View your agent ] │-│ [ Share ] │-│ │-└─────────────────────────────────────────────┘-```--### Entrance animation sequence (CSS transitions, no library)--1. Page loads: black screen-2. 0ms: starfield/particle canvas fades in (subtle, ~30 white dots drifting)-3. 300ms: 3D avatar fades in and begins slow rotation-4. 800ms: a soft radial glow behind the avatar pulses in (CSS radial-gradient, animated opacity)-5. 1200ms: "Agent deployed on-chain" text fades up from below-6. 1600ms: agent name fades in, larger-7. 2000ms: tx hash row fades in-8. 2400ms: CTA buttons slide up--All transitions: `opacity` + `transform: translateY` with `ease-out` curves. No jarring pops.--### 3D avatar--Fetch `/api/agents/<id>` to get the agent record. Then load the GLB:--```js-import { agentAvatarGlb } from '/src/shared/agent-3d.js';-// agentAvatarGlb(agent) returns the GLB URL--// Use three.js directly — import from the same CDN/module path used by viewer.js-// Lazy import: import('/src/viewer.js').then(({ Viewer }) => ...)-// Mount into a <canvas id="avatar-canvas"> element-// Configure: auto-rotate ON, no orbit controls (just spin), env lighting-// Model fills roughly 60% of viewport height-```--If the agent fetch fails or GLB fails to load: show a large glowing hexagon placeholder (`#4f46e5` fill) with the agent's initial letter. Never show a blank.--### Transaction display--- Chain badge: `SOLANA` in a monochrome pill-- Tx hash: first 8 + `…` + last 8 chars, monospace font-- "View on explorer" link:- - Solana mainnet: `https://solscan.io/tx/<txSig>`- - Solana devnet: `https://explorer.solana.com/tx/<txSig>?cluster=devnet`- - EVM (numeric chainId): look up in `src/erc8004/chain-meta.js` CHAIN_META for explorerUrl pattern--### CTA buttons--**View your agent** → `/agent-detail.html?id=<agentId>` (or `/agent/<agentId>` if that route exists)--**Share** → Opens a native `navigator.share()` if available, else falls back to Twitter/X intent:-```-Pre-filled text:-"Just deployed my 3D AI Agent on-chain.--[agent name] is live on Solana.--three.ws/agent/<agentId>"-```-Twitter intent URL: `https://twitter.com/intent/tweet?text=<encoded>`--### Starfield canvas--Simple `<canvas>` absolutely positioned behind everything. 30–40 dots at random positions, each drifting slowly upward, wrapping. Pure vanilla JS, `requestAnimationFrame`. Keep it subtle — this is background texture, not the hero.--## Files to create-- `pages/mint-success.html` (self-contained)--## Files to read but NOT edit-- `src/shared/agent-3d.js` — to understand `agentAvatarGlb()`-- `src/viewer.js` — to import `Viewer` for the 3D canvas-- `src/erc8004/chain-meta.js` — for explorer URL patterns--## Definition of done-- Navigating to `/mint-success.html?id=<any-valid-agent-id>&tx=abc123&chain=solana-mainnet` shows the full reveal animation-- 3D avatar spins in the center with glow-- Tx hash is displayed and links to the correct explorer-- Both CTA buttons work-- Page looks polished on mobile (375px) and desktop (1440px)-- No console errors--<!-- AUTO:self-delete-on-complete -->-------## ✅ On completion — delete this file--This file is a unit of work, not a permanent doc. The moment every item above is **built, wired, verified, and committed** to the "Definition of done" in the repo-root `CLAUDE.md`, remove it in the same change:--```bash-git rm "tasks/collectible-ux/02-mint-success-reveal.md"-```--Stage the deletion alongside your implementation and include it in the completion commit. This directory is the backlog: a file that still exists is unfinished work; a file that is gone has shipped. Do not delete early, and never leave a completed prompt behind.diff --git a/tasks/collectible-ux/03-agent-detail-collectible-polish.md b/tasks/collectible-ux/03-agent-detail-collectible-polish.mddeleted file mode 100644index e7f1b682b..000000000--- a/tasks/collectible-ux/03-agent-detail-collectible-polish.md+++ /dev/null@@ -1,120 +0,0 @@-# Task: Agent-Detail Collectible Polish--## Goal-`pages/agent-detail.html` / `src/agent-detail.js` currently reads as a feature dashboard. It needs to feel like a premium collectible page — something you'd screenshot and share. The 3D avatar should be the hero, the on-chain provenance should be unmissable, and the overall visual weight should say "this is yours."--This task does NOT add new data sources. It reorganizes and elevates what's already there.--## Key files-- `pages/agent-detail.html` — markup + skeleton CSS-- `src/agent-detail.js` — render logic-- `src/agent-detail.css` — styles--## Changes--### 1. Hero layout — 3D avatar takes the top--Currently the avatar is a small left-aligned element. Rework the hero section:--```-┌─────────────────────────────────────────────────┐-│ [full-width gradient banner — subtle, dark] │-│ │-│ [3D avatar — centered, 280px tall] │-│ slow auto-rotate │-│ │-│ Agent Name │-│ [on-chain badge] [chain pill] │-│ │-│ [description — max 2 lines, truncated] │-└─────────────────────────────────────────────────┘-```--- Avatar container: `min-height: 280px`, centered, no left float-- If the agent has a GLB (via `agentAvatarGlb()`), mount the Viewer with auto-rotate and disable orbit controls (display only, not interactive — tap/click opens a fullscreen modal)-- If no GLB: the existing gradient-initial SVG fallback, but larger (168px → 280px)-- The gradient banner behind the avatar: pull from the agent's name-based GRADIENTS array, use as a subtle radial glow (`background: radial-gradient(ellipse at center, ${c1}22 0%, transparent 70%)`)--### 2. On-chain provenance badge — prominent and glowing--The existing `onchainBadgeEl` is small and easily missed. Elevate it:--- Render it directly below the agent name as a pill with a pulsing dot animation (CSS):- ```css- .ad-onchain-live::before {- content: '';- display: inline-block;- width: 7px; height: 7px;- border-radius: 50%;- background: #10b981;- margin-right: 6px;- animation: pulse-dot 2s ease-in-out infinite;- }- @keyframes pulse-dot {- 0%, 100% { opacity: 1; transform: scale(1); }- 50% { opacity: 0.5; transform: scale(0.7); }- }- ```-- Show the chain name (Solana, Base, etc.) as an adjacent pill-- If the agent is NOT on-chain yet (owner viewing their own undeployed agent), show a "Deploy on-chain" CTA pill instead that scrolls to the deploy section--### 3. Share button — visible, above the fold--The existing `showSharePanel` call exists but the button is buried. Add a share icon button to the hero row (top-right corner of the hero section, floating):--```html-<button class="ad-share-btn" aria-label="Share this agent" title="Share">- <!-- SVG share icon -->-</button>-```--On click: call the existing `showSharePanel` with agent data. Ensure the share URL is `https://three.ws/agent/<id>` and the pre-filled text is:-```-[agent name] — a 3D AI Agent deployed on-chain.-Explore it on three.ws: https://three.ws/agent/<id>-```--### 4. Fullscreen 3D viewer modal--When user taps/clicks the avatar, open a fullscreen dark overlay with:-- The Viewer instance (same GLB) in full orbit-controls mode-- An ✕ close button (top right)-- "View in AR" button if `seeInWorldHref` returns a valid URL--This is a lightweight modal (no library). Inject it into `document.body` on first tap, destroy on close.--### 5. Visual cleanup--Remove or visually demote these elements on the initial view (they can still exist further down the page):-- "Embed code" section — move below the fold, collapse by default behind a "Developers →" disclosure-- Raw wallet address display — keep for owners but visually subdued (monospace, muted color, small font)-- The `ad-card` grid structure — keep the card structure but increase card `border-radius` to 16px and add a subtle `box-shadow` to lift them off the page--## What NOT to change-- The data sources — same API calls, same fetches-- The deploy button section — separate task (01)-- The launch history section — leave as-is-- The validation badge logic--## Definition of done-- The 3D avatar is the first thing you see, centered, auto-rotating-- The on-chain badge is immediately visible with a pulsing green dot-- Share button is in the hero, above the fold-- Tapping the avatar opens the fullscreen 3D viewer-- The page looks like a collectible card, not a dashboard-- No console errors, no regressions on existing functionality-- Works on mobile (375px) and desktop--<!-- AUTO:self-delete-on-complete -->-------## ✅ On completion — delete this file--This file is a unit of work, not a permanent doc. The moment every item above is **built, wired, verified, and committed** to the "Definition of done" in the repo-root `CLAUDE.md`, remove it in the same change:--```bash-git rm "tasks/collectible-ux/03-agent-detail-collectible-polish.md"-```--Stage the deletion alongside your implementation and include it in the completion commit. This directory is the backlog: a file that still exists is unfinished work; a file that is gone has shipped. Do not delete early, and never leave a completed prompt behind.diff --git a/tests/api/marketplace-agent-detail-prices.test.js b/tests/api/marketplace-agent-detail-prices.test.jsnew file mode 100644index 000000000..1e881f6ab--- /dev/null+++ b/tests/api/marketplace-agent-detail-prices.test.js@@ -0,0 +1,131 @@+// GET /api/marketplace/agents/:id must surface per-skill pricing so the+// marketplace detail page can render a premium badge next to paid skills.+//+// handleDetail() reads the agent's active rows from agent_skill_prices and+// folds them into a `skill_prices` map keyed by skill name. These tests pin+// that contract from the outside — driving the real router default export with+// DB / auth / rate-limit / r2 mocked so the suite stays offline:+//+// • a priced agent → skill_prices[skill] = { amount, currency_mint, … }+// • an agent with no priced skills → skill_prices === {} (never null/absent)+// • an unpublished agent stays 404 for an anonymous viewer (access unchanged)++import { describe, it, expect, vi, beforeEach } from 'vitest';+import { makeReq, makeRes } from '../_helpers/monetization.js';++// ── Content-addressed SQL mock ───────────────────────────────────────────────+// handleDetail issues two queries for an anonymous viewer: the agent_identities+// detail row, then the active agent_skill_prices rows. Classify by query text so+// call order never matters; the purchased/bookmark queries only run when a+// session exists, which these anonymous cases never reach.+let agentRow = null; // agent_identities detail → the row, or null (404)+let activePrices = []; // rows returned from agent_skill_prices++const sqlMock = vi.fn((strings) => {+ const q = Array.isArray(strings) ? strings.join(' ') : String(strings);+ if (/FROM agent_skill_prices/i.test(q)) return Promise.resolve(activePrices);+ if (/FROM agent_identities/i.test(q)) return Promise.resolve(agentRow ? [agentRow] : []);+ return Promise.resolve([]);+});+vi.mock('../../api/_lib/db.js', () => ({ sql: sqlMock }));++// Anonymous viewer: every auth probe returns null.+vi.mock('../../api/_lib/auth.js', () => ({+ getSessionUser: vi.fn(async () => null),+ authenticateBearer: vi.fn(async () => null),+ extractBearer: vi.fn(() => null),+}));++vi.mock('../../api/_lib/rate-limit.js', () => ({+ limits: { widgetRead: vi.fn(async () => ({ success: true, reset: Date.now() + 1000, limit: 60, remaining: 59 })) },+ clientIp: vi.fn(() => '127.0.0.1'),+}));++// publicUrl is only hit when a storage key is present; the fixtures keep keys+// null, but mock it so the test never depends on R2 env config.+vi.mock('../../api/_lib/r2.js', () => ({ publicUrl: (k) => (k ? `https://cdn.test/${k}` : null) }));++const { default: router } = await import('../../api/marketplace/[action].js');++// $THREE — the only coin this platform references.+const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';+const AGENT_ID = '11111111-2222-4333-8444-555555555555';++function detailRow(overrides = {}) {+ return {+ id: AGENT_ID,+ name: 'Polyglot',+ description: 'Translates and summarizes.',+ category: 'translation',+ tags: ['translate'],+ skills: ['translate', 'summarize'],+ user_id: 'owner-uuid',+ is_published: true,+ thumbnail_key: null,+ avatar_storage_key: null,+ avatar_visibility: 'public',+ asset_price_amount: null,+ system_prompt: 'You translate.',+ greeting: 'Hola',+ capabilities: {},+ rating_avg: 0,+ rating_count: 0,+ ...overrides,+ };+}++async function getDetail(id = AGENT_ID) {+ const req = makeReq({ method: 'GET', url: `/api/marketplace/agents/${id}` });+ const res = makeRes();+ await router(req, res);+ return { status: res.statusCode, body: res.body ? JSON.parse(res.body) : null };+}++beforeEach(() => {+ sqlMock.mockClear();+ agentRow = detailRow();+ activePrices = [];+});++describe('GET /api/marketplace/agents/:id — skill_prices', () => {+ it('folds active prices into a skill_prices map keyed by skill name', async () => {+ activePrices = [+ { skill: 'translate', amount: 50000, currency_mint: THREE_MINT, chain: 'solana', mint_decimals: 6, trial_uses: 2, time_pass_hours: null, time_pass_amount: null },+ { skill: 'summarize', amount: 100000, currency_mint: THREE_MINT, chain: 'solana', mint_decimals: 6, trial_uses: 0, time_pass_hours: 24, time_pass_amount: 250000 },+ ];++ const { status, body } = await getDetail();+ expect(status).toBe(200);++ const prices = body.data.agent.skill_prices;+ expect(Object.keys(prices).sort()).toEqual(['summarize', 'translate']);+ // Each priced skill carries at minimum its atomic amount + currency mint.+ expect(prices.translate).toMatchObject({ amount: 50000, currency_mint: THREE_MINT });+ expect(prices.summarize).toMatchObject({ amount: 100000, currency_mint: THREE_MINT });+ // Richer pricing dimensions ride along for the purchase UI.+ expect(prices.translate.chain).toBe('solana');+ expect(prices.translate.trial_uses).toBe(2);+ expect(prices.summarize.time_pass_hours).toBe(24);+ });++ it('returns an empty object (never null) when the agent has no priced skills', async () => {+ activePrices = [];+ const { status, body } = await getDetail();+ expect(status).toBe(200);+ expect(body.data.agent.skill_prices).toEqual({});+ });++ it('defaults mint_decimals to 6 and trial_uses to 0 when the row omits them', async () => {+ activePrices = [{ skill: 'translate', amount: 50000, currency_mint: THREE_MINT, chain: 'solana' }];+ const { body } = await getDetail();+ expect(body.data.agent.skill_prices.translate.mint_decimals).toBe(6);+ expect(body.data.agent.skill_prices.translate.trial_uses).toBe(0);+ });++ it('still 404s an unpublished agent for an anonymous viewer (access unchanged)', async () => {+ agentRow = detailRow({ is_published: false });+ const { status, body } = await getDetail();+ expect(status).toBe(404);+ expect(body.error).toBe('not_found');+ });+});