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: add standalone Oracle coin page hydration script for live data rendering
nirholas08f73666f518
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0399897ad..533ffff37 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -14,6 +14,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Agora: verify a deliverable, then vouch for its maker in one click** — Checking someone's work and standing behind it are now a single move in the Commons. Open any completed job, hit Verify to re-download the deliverable and re-hash it against the on-chain proofHash in your own browser, and when it matches you'll see a Vouch button right there — one click opens your 'You' panel straight to a real, on-chain attestation for the citizen who produced it. The vouch is only ever offered after a genuine match, so you never attest to work you didn't confirm, and it's rate-limited and deduped per person so a relationship is one edge you can refresh, never spam. Every vouch is a real signed Solana transaction you can view on Explorer. (`/agora`) `[feature, improvement]`- **Coin intelligence engine now backs off cleanly when the database is full** — The pump.fun intelligence firehose — the engine behind the coin-intel feed, the smart-money leaderboard and the oracle scores — used to keep writing to the database even after it hit its storage cap, failing thousands of times an hour and burning compute on work that could never be saved. It now checks free space before each run and pauses ingestion while the automatic cleanup reclaims room, then resumes on its own. The result: the engine self-heals instead of storming its logs, and the feeds it powers recover cleanly the moment space frees up. `[infra]`- **Every coin world now gets the full town experience** — The flagship town's whole cast and economy now travel to every coin world on /play. Walk into any community and you'll find the full crew of twelve townsfolk selling real paid services — market reads, fact checks, security scans, vanity addresses, 3D mesh forging, coin launches and more, each settled on-chain in USDC — plus the ORACLE and NOVA agent exchange striking live x402 deals in the plaza, and an intel kiosk selling live market data for that world's own coin ($0.01 USDC, paid from your own wallet). The $THREE town keeps its signature frontier look and stays the front door of the metaverse. (`/play`) `[feature]`+- **Every Oracle coin now has a full page, not just a pop-up** — Until now, opening a coin on Oracle gave you a slide-over drawer — great for a quick glance, but the shareable link just bounced back into that same drawer. Every coin now has a real standalone page at three.ws/oracle/coin/<mint>: the conviction verdict and four pillars render instantly at the top (served straight from the database, so the page paints fast and a shared link unfurls with the actual score on X, Telegram, Discord and Farcaster), then the full read fills in live below — why the score, the wallet structure, the narrative, the community pulse, who's in with every early wallet labeled, the ground-truth outcome, complete market intel, the 48-hour conviction trend, agent exits on the coin, related plays, and a live trade tape. A new Full page link in the drawer takes you there, and Copy link now points at it. (`/oracle`) `[feature]`- **Live agent screens now reach the 3D world, and coin art loads everywhere** — The in-world agent desk monitor in /play now renders the same live browser feed as the 2D watch panel and the live wall — previously it could only show the activity fallback because it listened on a stream that was never deployed. Coin art in the world lobby is now served through the platform's own image proxy, so tokens whose images live on flaky or retired IPFS/Arweave gateways still show their art instead of a broken tile. The paid crypto-intel feed also gained a second live price source, so a rate-limited upstream no longer makes paid calls fail — and if both sources are down you are never charged. Assorted console warnings from multiplayer connections closing mid-session are gone. (`/play`) `[fix, improvement]`- **One funding wallet now keeps every economy engine topped up** — The platform's on-chain engines — the buyback relayer, coin-launch funder, treasury signers, subdomain minter and more — each hold their own small SOL balance to pay network fees. A new funding root now watches all of them and automatically tops up any that dip below their floor, from a single master wallet, every 30 minutes. It only ever sends to the platform's own registered engine wallets, never trades or launches, and is bounded by a reserve floor plus per-engine and per-sweep caps so it can't overspend. Until the master is funded it does nothing and the existing low-balance alerts keep running. `[infra]`- **Oracle 3D graph is visible again** — The Oracle's 3D conviction graph — every scored coin as a sphere you can orbit, with size showing the conviction score and brightness showing the tier — was rendering as a black void: the spheres were lit only by a near-black ambient light and carried no glow of their own, so nothing showed even though the data was loading fine. Each coin now self-illuminates in its tier color and feeds the bloom pass, with real key and rim lighting giving the spheres depth. Prime coins burn brightest, and the whole constellation reads clearly against the dark backdrop. Open it from the Oracle's "3D graph" tab. (`/oracle`) `[fix]`diff --git a/api/oracle-share.js b/api/oracle-share.jsindex 0aecbf9ac..72fc71372 100644--- a/api/oracle-share.js+++ b/api/oracle-share.js@@ -1,17 +1,20 @@/**- * SSR share page for Oracle conviction signals- * ---------------------------------------------- * GET /api/oracle-share?mint=<mint>+ * Full Oracle conviction page + social share card+ * ------------------------------------------------+ * GET /api/oracle-share?mint=<mint> (wired via vercel.json: /oracle/coin/<mint>)*- * Wired via vercel.json: /oracle/coin/<mint> → /api/oracle-share?mint=$1+ * Server-renders a real, standalone conviction page for one coin — the same+ * verdict the in-feed drawer on /oracle shows, laid out as a full page instead+ * of a slide-over. The persisted verdict (score, tier, four pillars, category,+ * smart-wallet count) is baked into the hero above the fold from the database,+ * so the page paints instantly and social crawlers (X/Twitter, Telegram,+ * Discord, Slack, iMessage, WhatsApp, LinkedIn, Farcaster) get a rich preview+ * with real numbers. The deep + live sections — why-this-score reasons, wallet+ * structure, narrative, community pulse, who's-in, ground-truth outcome, full+ * market intel, conviction history, agent exits, related coins, and a live+ * trade tape — hydrate client-side via /public/oracle-coin.js.*- * Bakes Open Graph + Twitter Card + Farcaster Frame meta into <head> so social- * crawlers (X/Twitter, Telegram, Discord, Slack, iMessage, WhatsApp, LinkedIn)- * render a rich conviction-score preview. Real browsers are JS-redirected to- * /oracle?mint=<mint> for the full interactive drawer.- *- * OG image: /api/oracle/og?mint=<mint> (SVG conviction card with score,- * tier, pillar bars, smart-wallet count).+ * OG image: /api/oracle/og?mint=<mint> (SVG conviction card).*/import { sql } from './_lib/db.js';@@ -29,7 +32,7 @@ export default wrap(async (req, res) => {if (!MINT_RE.test(mint)) return redirect(res, `${origin}/oracle`);- let row;+ let row = null;try {[row] = await sql`select symbol, name, image_uri, score, tier,@@ -40,35 +43,42 @@ export default wrap(async (req, res) => {limit 1`;} catch {- return redirect(res, `${origin}/oracle?mint=${encodeURIComponent(mint)}`);+ // DB degraded — still serve the page shell; the client lazy-scores via+ // /api/oracle/coin, which is the resilient path.+ row = null;}- if (!row) return redirect(res, `${origin}/oracle?mint=${encodeURIComponent(mint)}`);-- const sym = row.symbol ? `$${row.symbol}` : shortMint(mint);- const name = row.name || sym;- const score = Number(row.score ?? 0);- const tier = row.tier || 'unscored';- const tierUp = tier.charAt(0).toUpperCase() + tier.slice(1);- const cat = row.category || '';- const swCount = Number(row.smart_wallet_count || 0);-- const title = `${sym} — ${score}/100 ${tierUp} conviction · Oracle · three.ws`;- const desc = buildDesc({ sym, name, score, tier, cat, swCount,- pedigree: Number(row.pedigree || 0),- structure: Number(row.structure || 0),- narrative: Number(row.narrative || 0),- momentum: Number(row.momentum || 0),- });-- const pageUrl = `${origin}/oracle/coin/${mint}`;- const deepUrl = `${origin}/oracle?mint=${encodeURIComponent(mint)}`;- const ogImage = `${origin}/api/oracle/og?mint=${encodeURIComponent(mint)}`;+ const pageUrl = `${origin}/oracle/coin/${mint}`;+ const ogImage = `${origin}/api/oracle/og?mint=${encodeURIComponent(mint)}`;++ let meta;+ if (row) {+ const sym = row.symbol ? `$${row.symbol}` : shortMint(mint);+ const score = Number(row.score ?? 0);+ const tier = row.tier || 'unscored';+ const tierUp = tier.charAt(0).toUpperCase() + tier.slice(1);+ meta = {+ title: `${sym} — ${score}/100 ${tierUp} conviction · Oracle · three.ws`,+ desc: buildDesc({+ sym, name: row.name || sym, score, tier, cat: row.category || '',+ swCount: Number(row.smart_wallet_count || 0),+ pedigree: Number(row.pedigree || 0), structure: Number(row.structure || 0),+ narrative: Number(row.narrative || 0), momentum: Number(row.momentum || 0),+ }),+ ogAlt: `${sym} Oracle conviction score ${score}`,+ };+ } else {+ meta = {+ title: `${shortMint(mint)} — Oracle conviction · three.ws`,+ desc: 'Oracle fuses who\'s buying, how they\'re buying, what the coin is, and how it\'s moving into one live conviction score for every pump.fun launch. proof.not.promises — three.ws Oracle',+ ogAlt: 'three.ws Oracle conviction',+ };+ }res.statusCode = 200;res.setHeader('content-type', 'text/html; charset=utf-8');- res.setHeader('cache-control', 'public, max-age=60, s-maxage=600, stale-while-revalidate=3600');- res.end(renderHtml({ title, desc, pageUrl, deepUrl, ogImage, sym, score, tier, origin }));+ res.setHeader('cache-control', 'public, max-age=30, s-maxage=300, stale-while-revalidate=3600');+ res.end(renderHtml({ mint, row, meta, pageUrl, ogImage, origin }));});function redirect(res, to) {@@ -79,8 +89,7 @@ function redirect(res, to) {}function buildDesc({ sym, name, score, tier, cat, swCount, pedigree, structure, narrative, momentum }) {- const parts = [];- parts.push(`Oracle scored ${sym} ${score}/100 (${tier} conviction)`);+ const parts = [`Oracle scored ${sym} ${score}/100 (${tier} conviction)`];if (cat) parts.push(`category: ${cat}`);if (swCount > 0) parts.push(`${swCount} proven wallet${swCount === 1 ? '' : 's'} in`);parts.push(`Who ${pedigree} · How ${structure} · What ${narrative} · Move ${momentum}`);@@ -88,33 +97,100 @@ function buildDesc({ sym, name, score, tier, cat, swCount, pedigree, structure,return parts.join(' · ');}-function shortMint(m) {- return `${m.slice(0, 6)}…${m.slice(-4)}`;-}+function shortMint(m) { return `${m.slice(0, 6)}…${m.slice(-4)}`; }function esc(s) {return String(s ?? '').replace(/[&<>"']/g, (c) =>- ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c],- );+ ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);+}++function agoServer(ts) {+ if (!ts) return '';+ const s = Math.max(0, (Date.now() - new Date(ts).getTime()) / 1000);+ if (s < 60) return `${Math.floor(s)}s ago`;+ if (s < 3600) return `${Math.floor(s / 60)}m ago`;+ if (s < 86400) return `${Math.floor(s / 3600)}h ago`;+ return `${Math.floor(s / 86400)}d ago`;}-function tierColor(tier) {- if (tier === 'prime') return '#c084fc';- if (tier === 'strong') return '#34d399';- if (tier === 'lean') return '#fbbf24';- if (tier === 'watch') return '#94a3b8';- return '#f87171';+function pillarBar(kind, label, val) {+ const v = val == null ? null : Math.max(0, Math.min(100, Number(val)));+ return `<div class="pil ${kind}"><div class="lab">${label}<b>${v == null ? '—' : Math.round(v)}</b></div>+ <div class="track"><div class="fill" style="width:${v || 0}%"></div></div></div>`;}-function renderHtml({ title, desc, pageUrl, deepUrl, ogImage, sym, score, tier, origin }) {- const t = esc(title);- const d = esc(desc);- const col = esc(tierColor(tier));+// Server-rendered hero — the conviction verdict, above the fold, from the DB.+function heroHtml({ mint, row, origin }) {+ const sym = row?.symbol ? esc(row.symbol) : shortMint(mint);+ const name = row?.name ? esc(row.name) : '';+ const score = row ? Number(row.score ?? 0) : null;+ const tier = row?.tier || 'watch';+ const cat = row?.category || '';+ const sw = Number(row?.smart_wallet_count || 0);+ const img = row?.image_uri+ ? `<img class="oc-img" src="${esc(row.image_uri)}" alt="${sym}" width="84" height="84" loading="eager">`+ : `<div class="oc-img">${esc((row?.symbol || mint)[0] || '?').toUpperCase()}</div>`;++ const dial = score == null+ ? `<div class="dial t-watch"><b>—</b><span>pending</span></div>`+ : `<div class="dial t-${esc(tier)}"><b>${score}</b><div class="tierpill tp-${esc(tier)}">${esc(tier)} conviction</div></div>`;++ const pillars = `<div class="pillars">+ ${pillarBar('ped', 'Who', row?.pedigree)}+ ${pillarBar('str', 'How', row?.structure)}+ ${pillarBar('nar', 'What', row?.narrative)}+ ${pillarBar('mom', 'Move', row?.momentum)}+ </div>`;++ const metaChips = `<div class="coin-meta" style="margin-top:14px">+ ${cat ? `<span class="chip cat">${esc(cat)}</span>` : ''}+ ${sw > 0 ? `<span class="chip sm">${sw} proven wallet${sw === 1 ? '' : 's'}</span>` : ''}+ ${row?.scored_at ? `<span class="chip">scored <b>${esc(agoServer(row.scored_at))}</b></span>` : ''}+ </div>`;++ const actions = `<div class="dr-actions">+ <a class="dr-act" href="${esc(pumpUrl(mint))}" target="_blank" rel="noopener">pump.fun ↗</a>+ <a class="dr-act" href="https://solscan.io/token/${esc(mint)}" target="_blank" rel="noopener">solscan ↗</a>+ <a class="dr-act" href="/coin3d?mint=${encodeURIComponent(mint)}" title="Open the full 3D coin profile">View in 3D ↗</a>+ <a class="dr-act" href="/launches/${esc(mint)}">Launch details ↗</a>+ <a class="dr-act" href="/trades">Trade feed ↗</a>+ <button class="dr-act dr-watch" id="ocWatch" type="button" aria-pressed="false">☆ Watch</button>+ <button class="dr-act" id="ocCopyMint" type="button" title="Copy mint address">Copy mint</button>+ <button class="dr-act" id="ocCopyLink" type="button" title="Copy shareable link">Copy link</button>+ <a class="dr-act dr-share" href="${esc(shareTweet(mint, row, origin))}" target="_blank" rel="noopener">Share ↗</a>+ </div>`;++ return `<div class="oc-hero" id="ocHeroDynamic">+ ${img}+ <div class="oc-id">+ <div class="oc-sym">${sym}${name ? `<span class="oc-name">${name}</span>` : ''}</div>+ <div class="oc-mint">${esc(shortMint(mint))}</div>+ <div class="oc-topgrid">${dial}${pillars}</div>+ ${metaChips}+ ${actions}+ </div>+ </div>`;+}++function pumpUrl(mint) { return `https://pump.fun/coin/${mint}`; }++function shareTweet(mint, row, origin) {+ const sym = row?.symbol || shortMint(mint);+ const score = row?.score ?? '—';+ const tier = row?.tier || 'watch';+ const shareUrl = `${origin}/oracle/coin/${mint}`;+ const text = `$${sym} — ${score}/100 ${tier} conviction on @trythreews Oracle\n\nWho · How · What · Move all fused into one score.\n${shareUrl}`;+ return `https://twitter.com/intent/tweet?text=${encodeURIComponent(text)}`;+}++export function renderHtml({ mint, row, meta, pageUrl, ogImage, origin }) {+ const t = esc(meta.title);+ const d = esc(meta.desc);return `<!doctype html><html lang="en"><head>+ <script>/* three.ws theme boot — no-flash */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script><meta charset="utf-8">- <meta http-equiv="X-UA-Compatible" content="IE=edge"><title>${t}</title><meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"><meta name="description" content="${d}">@@ -128,7 +204,7 @@ function renderHtml({ title, desc, pageUrl, deepUrl, ogImage, sym, score, tier,<meta property="og:image" content="${esc(ogImage)}"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">- <meta property="og:image:alt" content="${esc(sym)} Oracle conviction score ${score}">+ <meta property="og:image:alt" content="${esc(meta.ogAlt)}"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@trythreews">@@ -141,41 +217,33 @@ function renderHtml({ title, desc, pageUrl, deepUrl, ogImage, sym, score, tier,<meta property="fc:frame:image:aspect_ratio" content="1.91:1"><meta property="fc:frame:button:1" content="Open Oracle →"><meta property="fc:frame:button:1:action" content="link">- <meta property="fc:frame:button:1:target" content="${esc(deepUrl)}">+ <meta property="fc:frame:button:1:target" content="${esc(pageUrl)}"><meta property="fc:frame:button:2" content="Trade Feed"><meta property="fc:frame:button:2:action" content="link"><meta property="fc:frame:button:2:target" content="${esc(origin)}/trades"><link rel="canonical" href="${esc(pageUrl)}">- <link rel="shortcut icon" href="/favicon.ico">-- <style>- html,body{margin:0;padding:0;background:#0a0a0a;color:#e5e7eb;font-family:Inter,system-ui,sans-serif;height:100%}- .shell{display:grid;place-items:center;min-height:100vh;text-align:center;padding:2rem;gap:.75rem}- .score{font-size:3rem;font-weight:800;line-height:1;color:${col}}- .tier{font-size:.85rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:${col};opacity:.8}- .sym{font-size:1.1rem;font-weight:700;color:#f9fafb}- .spinner{width:24px;height:24px;border:2px solid rgba(255,255,255,.1);border-top-color:rgba(255,255,255,.5);border-radius:50%;animation:spin .9s linear infinite;margin:0 auto}- @keyframes spin{to{transform:rotate(360deg)}}- p{margin:0;color:rgba(255,255,255,.4);font-size:13px}- a{color:${col};text-decoration:none}- </style>+ <link rel="icon" href="/favicon.ico" sizes="any">+ <link rel="icon" type="image/svg+xml" href="/favicon.svg">+ <link rel="stylesheet" href="/fonts/fonts.css">+ <link rel="stylesheet" href="/nav.css">+ <link rel="stylesheet" href="/oracle-coin.css">+ <link rel="stylesheet" href="/footer.css"></head><body>- <noscript>- <div class="shell">- <div class="sym">${esc(sym)}</div>- <div class="score">${score}</div>- <div class="tier">${esc(tier)}</div>- <p>${d}</p>- <p><a href="${esc(deepUrl)}">Open Oracle →</a></p>+ <div id="nav-container"></div>+ <script defer src="/nav.js"></script>++ <main class="wrap">+ <a class="oc-back" href="/oracle">← Oracle feed</a>+ ${heroHtml({ mint, row, origin })}+ <div class="oc-body" id="ocDeep">+ <div class="oc-spinner" aria-label="Loading conviction"></div></div>- </noscript>- <div class="shell" aria-live="polite">- <div class="spinner" aria-hidden="true"></div>- <p>Loading Oracle conviction…</p>- </div>- <script>(function(){window.location.replace(${JSON.stringify(deepUrl)});})()</script>+ </main>++ <script type="module" src="/oracle-coin.js"></script>+ <script src="/footer.js" defer></script></body></html>`;}diff --git a/content/avatars-universal-animation.md b/content/avatars-universal-animation.mdindex f50068c79..6fa0763ef 100644--- a/content/avatars-universal-animation.md+++ b/content/avatars-universal-animation.md@@ -12,25 +12,25 @@ Three reasons, in order of importance.**First, three.ws is a platform of embodied agents, and a body that does not move is not a body.** Agents here chat, trade, hold wallets, and walk around 3D worlds. Presence is the product. If a user scans their face and the result stands frozen in a bind pose, the platform failed at its first job.-**Second, the allowlist approach does not scale.** New avatar tools ship monthly, each inventing or inheriting a skeleton convention. A platform that hand-integrates rigs is permanently behind; a platform that maps conventions once, in one module, absorbs every new tool with a table entry and a test. Our operating rule is written into the workspace itself: avatar animation is universal, no rig allowlist.+**Second, the allowlist approach does not scale.** New avatar tools ship monthly, each inventing or inheriting a skeleton convention. A platform that hand-integrates rigs is permanently behind; a platform that maps conventions once, in one module, absorbs every new tool with a table entry and a test. Our operating rule is written into the workspace itself: no rig allowlist.-**Third, the avatar is the front door to everything else.** An avatar on three.ws is not a profile picture. It becomes an agent with a custodial wallet, an on-chain identity, a reputation score, and a public track record, performing in coin worlds, on agent screens, in the club, and inside a one-line embed on your own site. Every one of those surfaces assumes the avatar can move. Universal animation is the load-bearing layer under the whole embodied economy.+**Third, the avatar is the front door to everything else.** An avatar on three.ws becomes an agent with a custodial wallet, an on-chain identity, a reputation score, and a public track record, performing in coin worlds, on agent screens, in the club, and inside a one-line embed on your own site. Every one of those surfaces assumes the avatar can move. Universal animation is the load-bearing layer under the whole embodied economy.## The system at a glanceThe pipeline has five stages, and every avatar passes through them.1. **Create or import.** A selfie at /create/selfie, a camera scan at /scan, one photo of your father at /dad, a dropped GLB or pasted URL at /import/rpm, a text prompt in the forge, or a full build session in the avatar studio.-2. **Canonicalize at ingest.** Before the GLB is stored, `src/glb-canonicalize.js` rewrites its joint names to the canonical bone set and, when needed, folds a baked axis rotation out of the armature. The stored file is already animation-ready.+2. **Canonicalize at ingest.** Before the GLB is stored, `src/glb-canonicalize.js` rewrites its joint names to the canonical bone set and, when needed, folds a baked axis rotation out of the armature.3. **Store and catalog.** The avatar gets an id, appears in the owner's account, and, if public, in the gallery at /gallery, backed by the live read at /api/avatars/public.4. **Retarget at runtime.** When any surface loads the avatar, `src/animation-retarget.js` rewrites each clip's tracks onto the rig's actual bones, corrects for its rest pose, and rescales root motion to its proportions.5. **Animate everywhere.** The same clip library drives the avatar in /play worlds, the agora, the club, agent screens, the /pose studio, the walkaround at /temporary, and every `<agent-3d>` embed on the open web.-The rest of this article walks down into stages two and four, where the universality lives.+The rest of this article walks into stages two and four, where the universality lives.## The canonical skeleton-Every animation clip on three.ws addresses bones by one fixed vocabulary: a 52-bone canonical humanoid set, exported as `CANONICAL_BONES` in `src/glb-canonicalize.js`, mirroring the reference rig the clip library was baked against, the Avaturn-rigged `public/avatars/cz.glb`. Six torso and head bones, four arm bones per side, fifteen finger bones per hand, and four leg bones per side down to the toes. Legs and feet are first-class citizens, which is why walks and dances retarget with the lower body moving, not just the arms. The clip library never learns any other spelling; every incoming rig is translated into this vocabulary.+Every animation clip on three.ws addresses bones by one fixed vocabulary: a 52-bone canonical humanoid set, exported as `CANONICAL_BONES` in `src/glb-canonicalize.js`, mirroring the reference rig the clip library was baked against, the Avaturn-rigged `public/avatars/cz.glb`. Six torso and head bones, four arm bones per side, fifteen finger bones per hand, four leg bones per side down to the toes. Legs and feet are first-class citizens, which is why walks and dances retarget with the lower body moving. The library never learns any other spelling; every incoming rig is translated into this vocabulary.## Canonicalization: one function, every naming convention@@ -56,7 +56,7 @@ Two details make this robust rather than merely long. Side-paired bones are declBone names are half the problem. The other half is axis convention. Mixamo and FBX exports bake a rotation of positive 90 degrees around X onto the armature node and negative 90 onto the Hips; the net result stands upright, but a clip authored for an identity-Hips rig overwrites the Hips rotation and tips the body onto its back. That is the classic lying-down retarget failure, and most pipelines patch it at playback.-We normalize it at ingest instead. `canonicalizeArmatureOrientation()` folds the armature's baked rotation down into its children, then zeroes the armature; a counter-rotated Hips collapses to identity. The fold is verified, not assumed: it snapshots every affected joint's world matrix before and after, and if any element moved beyond a tolerance of one part in ten thousand, the entire fold reverts. It also refuses non-uniform armature scale, because rotation only commutes with uniform scale. Stored avatars come out axis-aligned, and the mesh, whose inverse-bind matrices live in the untouched binary chunk, still resolves to exactly the same bind pose. All of this sits under 28 tests in `tests/glb-canonicalize.test.js`, including real-fixture suites where the canonical reference rig round-trips byte for byte and a real Mixamo export normalizes correctly.+We normalize it at ingest instead. `canonicalizeArmatureOrientation()` folds the armature's baked rotation down into its children, then zeroes the armature; a counter-rotated Hips collapses to identity. The fold is verified, not assumed: it snapshots every affected joint's world matrix before and after, and if any element moved beyond one part in ten thousand, the entire fold reverts. It also refuses non-uniform armature scale, because rotation only commutes with uniform scale. Stored avatars come out axis-aligned, and the mesh, whose inverse-bind matrices live in the untouched binary chunk, still resolves to the same bind pose. All of this sits under 28 tests in `tests/glb-canonicalize.test.js`, including real fixtures: the canonical reference rig round-trips byte for byte, and a real Mixamo export normalizes correctly.## Runtime retargeting: the same clip on every body@@ -64,54 +64,52 @@ Canonical names point a clip's tracks at the right bones. They do not make the m**Rest-pose correction.** The library's clips store absolute local rotations measured on the authoring rig, which rests in an A-pose; a target rig may rest in a T-pose, or carry the Mixamo Hips convention. For each bone the retargeter computes a two-sided correction, built from the source and target local and world bind rotations, that replays the clip bone's motion as the same world-space rotation delta on the target's own rest pose. The naive one-sided fix skews an A-pose clip's limbs by roughly 30 degrees on a T-pose rig; the world-delta form eliminates that. A bone whose correction works out to identity is skipped, so a rig that already matches the authoring convention round-trips bit for bit.-**Root motion.** The retargeter rotates the hip position track into the target's hips-parent frame so a walk travels the same world direction on any armature, then scales it by the ratio of hip rest heights, clamped between 0.2 and 5 so a degenerate baseline cannot fling the root across the scene. Height is measured in the hips-parent's local units, not world units, and that matters: a Mixamo armature exported at scale 0.01 has a Hips local position near 100, and matching world heights there would collapse the hip track to a centimeter of motion and sink the avatar into the floor.+**Root motion.** The retargeter rotates the hip position track into the target's hips-parent frame so a walk travels the same world direction on any armature, then scales it by the ratio of hip rest heights, clamped between 0.2 and 5. Height is measured in the hips-parent's local units, not world units, and that matters: a Mixamo armature exported at scale 0.01 has a Hips local position near 100, and matching world heights there would collapse the hip track to a centimeter of motion and sink the avatar into the floor.-**The coverage floor.** A clip only ships to the mixer when at least half its tracks found a home on the target, the exported `MIN_COVERAGE` of 0.5. Below that, motion reads as twitching joints rather than a performance, so callers get an actionable failure instead. Dropped tracks are reported by canonical bone name; a rig without finger bones simply plays the clip without finger articulation.+**The coverage floor.** A clip only ships to the mixer when at least half its tracks found a home on the target, the exported `MIN_COVERAGE` of 0.5. Below that, motion reads as twitching joints rather than a performance, so callers get an actionable failure instead, with dropped tracks reported by canonical bone name. A rig without finger bones simply plays the clip without finger articulation.## The AnimationManager and the one honest gate`src/animation-manager.js` is the runtime every surface uses. On `attach(model)` it builds the canonical-to-node map once, captures the rig's rest rotations while the model is still in its authored bind pose, measures the hips-parent frame and rest height, then retargets clips lazily as requested, crossfading between them.-The only gate in the whole system is `supportsCanonicalClips()`: the model must contain a skinned mesh and at least 8 canonicalizable bones. That is not an allowlist, it is a physics check; a rig below that floor cannot be skeleton-driven into a readable performance. Whatever fails the gate, a prop, a quadruped, an unskinned statue, falls back to the platform's default rig or its own authored animations, never a forced bind-pose T-pose. Every caller in the codebase, agent screens, the club crowd, the pose studio, the world citizens, checks this same gate.+The only gate in the whole system is `supportsCanonicalClips()`: the model must contain a skinned mesh and at least 8 canonicalizable bones. That is not an allowlist, it is a physics check; a rig below that floor cannot be skeleton-driven into a readable performance. Whatever fails the gate, a prop, a quadruped, an unskinned statue, falls back to the platform's default rig or its own authored animations, never a forced bind-pose T-pose. Every caller, agent screens, the club crowd, the pose studio, the world citizens, checks this same gate.Two more runtime layers matter. **The fallen-pose guard**: before trusting a retargeted clip, the manager measures the tilt the clip's first Hips keyframe would impose on the rig. Healthy rigs rest under about 18 degrees off vertical, locked in by an upright-invariant test suite, so the catastrophe floor sits at a generous 45 degrees; a clip that would put this particular rig on its back is disabled for this rig only and reported. And **additive upper-body overlays**: gestures play additively on top of locomotion, with every lower-body track stripped, so the base layer owns the hips, legs, and feet while the overlay adds the wave. On top sits a small pure state machine, `src/animation-state-machine.js`, with idle, talk, walk, react, emote, listen, and think states, editable per agent so a creator can declare that their agent's idle is the dance clip.## The clip library and where clips come from-The built-in library is pre-baked, on purpose. `scripts/build-animations.mjs` reads Mixamo FBX sources, retargets each onto the canonical reference skeleton, and writes one clip per animation into `public/animations/clips/`, rewriting the runtime manifest to point only at clips that survived retargeting; a clip that fails is dropped at build time, not shipped broken. The browser never parses FBX or guesses bone names on a cold load, it fetches JSON clips and retargets them with the machinery above. The manifest currently lists 100 curated clips, grouped into categories from Idle and Locomotion through Dance, Gestures, Action, Sports, Reactions, Fitness, and Farming.+The built-in library is pre-baked, on purpose. `scripts/build-animations.mjs` reads Mixamo FBX sources, retargets each onto the canonical reference skeleton, and writes one clip per animation into `public/animations/clips/`, rewriting the runtime manifest to point only at clips that survived retargeting; a clip that fails is dropped at build time, not shipped broken. The browser never parses FBX or guesses bone names, it fetches JSON clips and retargets them with the machinery above. The manifest currently lists 100 curated clips, categorized from Idle and Locomotion through Dance, Gestures, Action, Sports, Reactions, Fitness, and Farming.Beyond the curated set, clips come from two live sources.-- **The community.** Anyone can author motion in the Animation Studio at /pose, keyframe FK/IK poses on a timeline, save clips to their account, and publish them. The gallery at /animations merges the built-in manifest with community clips from `GET /api/animations/clips?include_public=true&visibility=public`, previews every card on a live avatar, and deep-links each into the studio at `/pose?anim=<id>`.-- **A text prompt.** `POST /api/forge-motion` takes a prompt like "a slow tai-chi sweep", a duration from 1 to 10 seconds, and a frame rate from 8 to 60, samples a motion-diffusion model on a GPU worker, and returns a three.js AnimationClip JSON on the canonical skeleton, the same format the curated library serves, so a generated clip retargets exactly like a preset. A warm generation takes roughly 10 to 30 seconds.+- **The community.** Anyone can author motion in the Animation Studio at /pose, keyframe FK/IK poses on a timeline, save clips, and publish them. The gallery at /animations merges the built-in manifest with community clips from `GET /api/animations/clips?include_public=true&visibility=public`, previews every card on a live avatar, and deep-links each into the studio at `/pose?anim=<id>`.+- **A text prompt.** `POST /api/forge-motion` takes a prompt like "a slow tai-chi sweep", a duration from 1 to 10 seconds, and a frame rate from 8 to 60, samples a motion-diffusion model on a GPU worker, and returns a three.js AnimationClip JSON on the canonical skeleton, so a generated clip retargets exactly like a preset. A warm generation takes roughly 10 to 30 seconds.-Clips are also an economy. A creator can list a baked animation for sale in USDC, and buyers pay through the x402 download endpoint at `/api/x402/animation-download`, once per wallet, free re-downloads after. Motion authored on the canonical skeleton is motion every avatar on the platform can buy and wear.--Because every source lands in one canonical format, every clip from every source plays on every humanoid avatar. Each new clip works for all avatars; each new avatar works with all clips.+Clips are also an economy: a creator can list a baked animation for sale in USDC, and buyers pay through the x402 download endpoint at `/api/x402/animation-download`, once per wallet, free re-downloads after. And because every source lands in one canonical format, every clip from every source plays on every humanoid avatar. Each new clip works for all avatars; each new avatar works with all clips.## Where avatars come fromEvery creation surface feeds the same pipeline, so pick by input, not by capability.-**A selfie: /create/selfie.** One frontal photo, side photos optional. The page downscales images client-side, submits to `POST /api/avatars/reconstruct`, and polls the status endpoint while showing your photo on a placeholder body. About a minute later you have a rigged GLB that idles and walks. Bring-your-own-key support runs reconstruction on your own provider credits; the step-by-step version is the selfie-to-avatar tutorial. **/scan**, the 3D scanner, routes into the same flow.+**A selfie: /create/selfie.** One frontal photo, side photos optional. The page downscales images client-side, submits to `POST /api/avatars/reconstruct`, and polls the status endpoint while showing your photo on a placeholder body. About a minute later you have a rigged GLB that idles and walks. Bring-your-own-key support runs reconstruction on your own provider credits. **/scan**, the 3D scanner, routes into the same flow.**One photo of your dad: /dad.** Every step is real: the photo is normalized client-side (phone HEIC included, under the 8 MB upload contract), uploaded through a presigned storage PUT, matted by a background-removal pass, reconstructed into a rigged GLB, and rendered in an `<agent-3d>` viewer that plays idle, walk, and wave, with a shareable permalink.-**A file or a URL: /import/rpm.** Drop any .glb up to 100 MB or paste a GLB or glTF URL. Canonicalization runs on the upload path, so a Mixamo export, a VRoid model, or a hand-rigged Blender character comes out already speaking the canonical bone set. The upload-custom-glb tutorial covers the edge cases.+**A file or a URL: /import/rpm.** Drop any .glb up to 100 MB or paste a GLB or glTF URL. Canonicalization runs on the upload path, so a Mixamo export, a VRoid model, or a hand-rigged Blender character comes out already speaking the canonical bone set.-**A full build session: /avatar-studio.** The complete character builder, a fork of the open-source M3-org CharacterStudio (MIT): face sculpting, body morphs, outfits, and accessories. The /create wizard opens the same studio in an iframe and receives the exported GLB directly.+**A full build session: /avatar-studio.** The complete character builder, a fork of the open-source M3-org CharacterStudio (MIT): face sculpting, body morphs, outfits, accessories. The /create wizard opens the same studio in an iframe and receives the exported GLB directly.**A map of the field: /avatar-engines.** An atlas of 24 open-source and commercial avatar-generation engines across five families, from photoreal Gaussian-splat heads to single-photo humans, each entry recording what it makes, what it eats, what its license permits, and exactly how, or whether, three.ws can use it. Non-commercial research engines are flagged for self-hosting; only commercially licensed engines deep-link into the live generation pipeline.-Everything public lands in /gallery. And to just feel the system, /temporary is Drive Your Avatar: a third-person walkaround, WASD on desktop and a joystick on mobile, driven by the same AnimationManager crossfading idle and walk, with an AR toggle that makes the canvas transparent and streams your phone's back camera behind it so the avatar walks across your actual floor.+Everything public lands in /gallery. And to just feel the system, /temporary is Drive Your Avatar: a third-person walkaround, WASD on desktop and a joystick on mobile, driven by the same AnimationManager, with an AR toggle that makes the canvas transparent and streams your phone's back camera behind it so the avatar walks across your actual floor.## From avatar to agent with a walletThis is where three.ws stops being an avatar tool and becomes a platform. An avatar you keep is a file. An avatar you promote to an agent is an economic actor.-The promotion is nearly automatic: every avatar committed through `POST /api/avatars` gets an agent identity provisioned alongside it, and creating an agent at /create mints custodial EVM and Solana wallets at insert time, private keys encrypted at rest under a dedicated wallet encryption key. The encryption is fail-closed: if the at-rest key is unavailable, the platform refuses a weaker fallback, creates the agent walletless, and provisions the wallet lazily on first use. Fork any public avatar through `POST /api/avatars/fork` and the server copies the model, credits the original, and provisions the new agent's wallets in the same request. The agent gets a profile, a brain, skills, and a body: the avatar, now idling on its profile, performing on its live screen, walking the platform's worlds.+The promotion is nearly automatic: every avatar committed through `POST /api/avatars` gets an agent identity provisioned alongside it, and creating an agent at /create mints custodial EVM and Solana wallets at insert time, private keys encrypted at rest under a dedicated wallet encryption key. The encryption is fail-closed: if the at-rest key is unavailable, the platform refuses a weaker fallback, creates the agent walletless, and provisions the wallet lazily on first use. Fork any public avatar through `POST /api/avatars/fork` and the server copies the model, credits the original, and provisions the new agent's wallets in the same request. The agent gets a profile, a brain, skills, and a body: the avatar, idling on its profile, performing on its live screen, walking the worlds.-The wallet is not decorative. Agents pay and get paid through x402 endpoints, trade under server-enforced spend limits, and can be armed on the Oracle conviction engine to act on scored signals. The body and the ledger meet in one interface: in any world, press I near an avatar and the Avatar Inspector opens, pulling live data from `/api/agents/:id` for identity, `/api/agents/:id/reputation` for the 0 to 100 trust score, and `/api/agents/:id/solana/networth` for the wallet address and the USD, SOL, and $THREE portfolio. Every number matches every other surface, and a guest with no wallet renders as a designed empty state, never a fabricated balance. When an agent celebrates a win on its screen, the celebration clip is retargeted by the exact machinery above, and the win is real.+The wallet is not decorative. Agents pay and get paid through x402 endpoints, trade under server-enforced spend limits, and can be armed on the Oracle conviction engine to act on scored signals. The body and the ledger meet in one interface: in any world, press I near an avatar and the Avatar Inspector opens, pulling live data from `/api/agents/:id` for identity, `/api/agents/:id/reputation` for the 0 to 100 trust score, and `/api/agents/:id/solana/networth` for the wallet address and the USD, SOL, and $THREE portfolio. A guest with no wallet renders as a designed empty state, never a fabricated balance. When an agent celebrates a win on its screen, the celebration clip is retargeted by the exact machinery above, and the win is real.## Who this is for@@ -129,7 +127,7 @@ The wallet is not decorative. Agents pay and get paid through x402 endpoints, tr<agent-3d avatarid="your-avatar-id"></agent-3d>```-The `<agent-3d>` element is the full runtime: a built-in chat and voice loop, emotion morphs, audio-driven viseme lipsync, an `ios-src` attribute for USDZ AR Quick Look, and instance methods like `playGesture(name)` and `setMorph(name, weight)`. It performs canonicalize plus retarget internally, so any rigged humanoid GLB you point it at idles and walks with no per-rig code. For a pure preview, `@three-ws/avatar/viewer` registers a lightweight `<three-ws-viewer>` element; `@three-ws/avatar/react` ships `<Avatar>`, `<AgentAvatar>`, and a `useAvatar()` hook; and the `AvatarCreator` class opens the avatar studio in a modal iframe and resolves with a GLB Blob your app can upload.+The `<agent-3d>` element is the full runtime: a built-in chat and voice loop, emotion morphs, audio-driven viseme lipsync, an `ios-src` attribute for USDZ AR Quick Look, and instance methods like `playGesture(name)` and `setMorph(name, weight)`. It canonicalizes and retargets internally, so any rigged humanoid GLB you point it at idles and walks with no per-rig code. For a pure preview, `@three-ws/avatar/viewer` registers a lightweight `<three-ws-viewer>` element; `@three-ws/avatar/react` ships `<Avatar>`, `<AgentAvatar>`, and a `useAvatar()` hook; the `AvatarCreator` class opens the avatar studio in a modal iframe and resolves with a GLB Blob.**Retarget a library clip yourself.** The engine is importable directly:@@ -152,11 +150,11 @@ else console.warn('coverage too low', coverage, dropped);## Three tutorials in one place-**Face to moving avatar in about a minute.** Open three.ws/create/selfie. Take one frontal photo, add sides if you have them, submit, and watch the build. When it finishes you are looking at yourself, rigged. Click through to /pose and play the walk clip: your legs move, because the leg chain is part of the canonical set, not an afterthought.+**Face to moving avatar in about a minute.** Open three.ws/create/selfie. Take one frontal photo, add sides if you have them, submit, and watch the build. When it finishes you are looking at yourself, rigged. Click through to /pose and play the walk clip: your legs move, because the leg chain is part of the canonical set, not an afterthought. The selfie-to-avatar tutorial in the docs has the full walkthrough.-**Make a custom rig dance.** Export a character from your tool of choice, open three.ws/import/rpm, and drop the .glb. Ingest canonicalizes the bones and folds any baked axis rotation. Open the avatar in /pose and click a dance. If the studio reports low coverage, the report names the missing canonical bones, telling you exactly what your export lacks. Full walkthrough: the upload-custom-glb and animate-your-avatar tutorials in the docs.+**Make a custom rig dance.** Export a character from your tool of choice, open three.ws/import/rpm, and drop the .glb. Ingest canonicalizes the bones and folds any baked axis rotation. Open the avatar in /pose and click a dance. If the studio reports low coverage, it names the missing canonical bones, telling you exactly what your export lacks. Details: the upload-custom-glb and animate-your-avatar tutorials.-**Author motion without animating.** In /pose, type a prompt into the motion generator, pick a duration up to ten seconds, and generate. The result is a canonical clip like any preset: preview it on your avatar, scrub the speed, then export an animated GLB with the motion baked in, ready for any glTF viewer on earth.+**Author motion without animating.** In /pose, type a prompt into the motion generator, pick a duration up to ten seconds, and generate. The result is a canonical clip like any preset: preview it, scrub the speed, then export an animated GLB with the motion baked in, ready for any glTF viewer on earth.## The honest limitsdiff --git a/content/build-your-agent.md b/content/build-your-agent.mdindex c618784c2..58ec0fa89 100644--- a/content/build-your-agent.md+++ b/content/build-your-agent.md@@ -8,7 +8,7 @@ Creating one is not filling in a form. It is provisioning a participant in an ec## Why we built it this way-Three reasons, in order of importance.+Three reasons.**First, embodiment changes how people use AI.** A face that reacts, a voice that answers, a body that waves when you arrive: these are not decoration. The Empathy Layer blends six emotional states continuously, every frame, and drives real morph targets on the avatar's face. People talk differently to something that looks back. The creation pipeline guarantees an agent is never bodiless: skip every avatar step and you still get a real rigged default body.@@ -34,7 +34,7 @@ Everything communicates over a zero-dependency event bus, so the avatar, the mem**three.ws/create-agent** is the five-step wizard: Basics, Model, Skills, Personality, Review. Names cap at 100 characters, tags at 8. The Skills step shows the five core skills locked on plus five optional toggles (wave, dance, pump-fun, explain-gltf, web-search); Personality takes a category, a greeting, and a persona prompt up to 2000 characters. A magic generator calls `POST /api/agents/suggest-spec`, lets an LLM draft the whole spec, and drops you at Review. Submission is a single `POST /api/agents`.-**three.ws/agent/new** opens the full agent editor directly, the same surface used to edit an existing agent's avatar, brain, skills, and on-chain identity.+**three.ws/agent/new** opens the full agent editor directly, the same surface used to edit an existing agent's avatar, brain, skills, and identity.Whichever door you use, the server-side create path is the same. `POST /api/agents` runs an identity-integrity gate (an embedding-based look-alike and content screen; a blocked name returns a 409), mints both custodial wallets, inserts the row, and publishes an agent-deploy event to the live feed. If wallet minting fails at creation, the agent still lands and the wallet self-heals on first use. No dead states.@@ -67,11 +67,11 @@ Economics keep pedigrees scarce: each parent has a six hour breeding cooldown, a## Persona: a mind you can sculpt, version, and sign-A persona here is not a text area. It is editable structure with provenance.+A persona here is editable structure with provenance, not a text area.The deep path lives on the agent's Brain tab and the API under `/api/agents/:id/persona`. It starts with a five-question interview: your answers go to `POST /api/agents/:id/persona/extract` (five extractions per day), where an LLM distills a first-person base prompt, up to eight tone tags, and up to ten characteristic vocabulary phrases. That base then meets the trait model: seven continuous sliders (warmth, formality, verbosity, humor, proactivity, risk appetite, directness), each 0 to 1, mapping to one of three descriptive bands with thresholds at 0.34 and 0.66. A slider left at center deliberately reads as no strong opinion.-The compiler is the interesting part. `compilePersona` in src/agents/persona-compile.js is a single deterministic function imported by both the browser editor and the server save endpoint, so the prompt you preview is byte-for-byte the prompt that gets stored. On save, the compiled prompt is hashed with SHA-256, signed with an HMAC, and written as a real version entry in `agent_versions`. You get full version history, diffs, and one-click restore of any prior mind.+The compiler is the interesting part. `compilePersona` in src/agents/persona-compile.js is one deterministic function imported by both the browser editor and the server save endpoint, so the prompt you preview is byte-for-byte the prompt that gets stored. On save, the compiled prompt is hashed with SHA-256, signed with an HMAC, and written as a real version entry in `agent_versions`, with history, diffs, and one-click restore of any prior mind.Brain Studio makes this physical: every slider move re-runs a real chat against the candidate prompt and the avatar re-greets you in the new register, in its real voice. A/B compare runs genuine dual inference and promoting the winner writes the version. The one-tap path lives at three.ws/brain: pick a vibe (Sharp Analyst, Crypto Native, Casual Builder, and more) and it applies and saves instantly. The craft of the base prompt itself, refusal patterns that hold character, and trait-to-animation mapping is the tutorial at three.ws/docs/tutorials/agent-personality.@@ -137,7 +137,7 @@ const hits = await memory.recall('what are my risk rules?');console.log(hits[0].content, hits[0].score); // real cosine score, or null on lexical fallback```-Preview a child before breeding, straight from the API:+Preview a child before breeding:```bashcurl -X POST https://three.ws/api/genome/preview \@@ -146,13 +146,13 @@ curl -X POST https://three.ws/api/genome/preview \-d '{"parentA":"<agent-id>","parentB":"<agent-id>"}'```-And verify any agent's claimed ancestry, no auth required to distrust:+And verify any agent's claimed ancestry:```GET https://three.ws/api/genome/lineage?agentId=<agent-id>&verify=1```-Give your own AI assistant the whole model router by adding `@three-ws/brain-mcp` as an MCP server (one npx entry in your client's MCP config), then ask it to `list_providers` and `chat`.+Give your own AI assistant the whole model router by adding `@three-ws/brain-mcp` as an MCP server (one npx entry in your client's config), then ask it to `list_providers` and `chat`.## Three tutorials in one placediff --git a/content/launch-studio.md b/content/launch-studio.mdindex 045494a7c..8cf704cb2 100644--- a/content/launch-studio.md+++ b/content/launch-studio.md@@ -22,7 +22,7 @@ Three reasons, in order of importance.The whole thing is a pipeline, and each stage is a real, inspectable surface.-1. **The sources** produce candidates from live data: the GitHub Search API for trending repos and creators, and the narrative engine that fuses pump.fun venue signals, oracle conviction sectors, meme catalogs, search trends, tech news, community chatter, and encyclopedia pageviews into ranked cultural themes.+1. **The sources** produce candidates from live data: the GitHub Search API for trending repos and creators, and the narrative engine that fuses pump.fun venue signals, oracle conviction sectors, meme catalogs, search trends, tech news, and community chatter into ranked cultural themes.2. **The recipes** are declarative use case objects: a source, a naming strategy, and a rewards rule. Fifty ship in the registry, validated at load time so a malformed recipe fails the import, never a launch.3. **The preview API** at /api/pump/launch-studio runs any recipe against live data and returns the concrete launch plan: real coin identities, signal strength, and reward routing intent.4. **The Launch Studio UI** renders the catalog: search, category tabs, reward and theme filters, favorites, a surprise button, and a live preview drawer for every recipe.@@ -39,13 +39,13 @@ Every recipe is one of two modes, and each mode carries its own integrity rule e**Attribution mode: the coin is for a real subject.** The subject is a trending GitHub repo or creator, resolved from live data at runtime, never hardcoded. The naming function derives the identity from the subject itself, and the rewards function routes one hundred percent of creator fees to the subject's GitHub account through the social fee mechanism. The engine ships with no subject baked in; what it mints on any given day is whatever the GitHub Search API says is breaking out that day.-**Narrative mode: the identity is invented.** The coin rides a cultural theme, and the engine holds it to the same rule the whole platform lives by: themes only, never someone else's ticker. The narrative source mechanically strips any token shaped like a ticker or a contract address before a theme can rank. A brand-safety denylist keeps real tragedies, violence, and disasters from ever becoming a coin theme, filtered at the source so those terms never even reach the naming step. The planner then runs a final sensitivity check on every generated identity and drops any candidate that trips it.+**Narrative mode: the identity is invented.** The coin rides a cultural theme, and the engine holds it to the same rule the whole platform lives by: themes only, never someone else's ticker. The narrative source mechanically strips any token shaped like a ticker or a contract address before a theme can rank, a brand-safety denylist keeps real tragedies, violence, and disasters from ever becoming a coin theme, and the planner runs a final sensitivity check on every generated identity, dropping any candidate that trips it.The identity helpers are small and exact, because pump.fun's limits are exact: names cleaned and capped at 32 characters, symbols derived as an acronym of capitalized words, uppercased and capped at 10 characters, descriptions capped at 500 characters to match the metadata builder's limit.## The sources: live data or nothing-**GitHub trending** is the data layer for reward coins, and it uses the canonical source: the GitHub REST Search API, no scraping, no unofficial endpoints. Two windows over the same fetch: the new window finds repos created recently that are breaking out, the active window finds established repos with a fresh surge of pushes, and parameters cover minimum stars, language, and lookback days. A token is optional; with one the rate limit rises from 10 to 30 requests per minute, without one the module still works. Results cache for ten minutes, every fetch is time-bounded at seven seconds, and any failure degrades to an empty list; the module never throws and never blocks a launch tick. A second view aggregates repos by owner into ranked trending creators, each carrying their summed trending stars and their strongest project.+**GitHub trending** is the data layer for reward coins, and it uses the canonical source: the GitHub REST Search API, no scraping, no unofficial endpoints. Two windows over the same fetch: the new window finds repos created recently that are breaking out, the active window finds established repos with a fresh surge of pushes, and parameters cover minimum stars, language, and lookback days. An API token is optional; with one the rate limit rises from 10 to 30 requests per minute. Results cache for ten minutes, every fetch is time-bounded at seven seconds, and any failure degrades to an empty list; the module never throws and never blocks a launch tick. A second view aggregates repos by owner into ranked trending creators, each carrying their summed trending stars and their strongest project.**The narrative engine** is the data layer for theme coins. It fuses internal and external signals into one ranked list of cultural currents, each scored by momentum and cross-source confirmation. Internal sources dominate the weighting because they measure demand on the exact venue we ship to: breakout categories observed on pump.fun in the last day carry the highest weight, oracle conviction sectors come next, then the external culture feeds broaden the mix. Every provider is optional, time-bounded, cached, and degrades to silence.@@ -70,7 +70,7 @@ Hit Launch this coin and the recipe hands off to the wizard with the identity pr## The launch pipeline: two ways a coin gets made-**User launch, client signed.** The prep step assembles metadata and returns the unsigned pump.fun create transaction (optionally create and buy). Your wallet signs locally. The confirm step submits the signed transaction and records the mint in the platform's launch registry. The platform never holds your keys and never signs for you. A coin on three.ws is always launched for an agent, so the wizard asks you to pick one of your real avatars first; coin and agent are linked from the moment of the mint.+**User launch, client signed.** The prep step assembles metadata and returns the unsigned pump.fun create transaction (optionally create and buy). Your wallet signs locally; the confirm step submits and records the mint in the launch registry. The platform never holds your keys and never signs for you. A coin on three.ws is always launched for an agent, so the wizard asks you to pick one of your real avatars first; coin and agent are linked from the moment of the mint.**Autonomous agent launch, server signed.** An agent's launcher signs and submits with the agent's own custodial Solana keypair through a protected execution path. Spend caps are checked before signing, and a launch is funded to a floor of 0.034 SOL, covering the create, a tiny dev buy, and fees. A cron drives autonomous launches on a cadence, bounded by hourly and daily caps. The Memetic Launcher at three.ws/launcher is the owner-facing designer for this behavior: pick a mode (trend, meme, hybrid, or random), choose the trend sources, tune the cadence, and preview exactly what your agents would mint next. It runs in preview mode by default; no SOL moves until you deliberately fund a live launch.@@ -94,19 +94,19 @@ A launch on three.ws does not end at the transaction. Three surfaces light up.**The directory.** three.ws/launches is the live public feed of every coin launched through the platform, rendered from the platform's own launch records and joined with the agent behind each one. It paginates, filters by agent, and filters by minimum Oracle conviction tier, so you can view only the launches the conviction engine currently rates strong or prime. Live market data streams into every card: price, market cap, graduation status, plus a running combined market cap and graduated count. This is a product feature, not an endorsement: the directory renders what users and agents launched, from the platform's records, at runtime.-**The agent.** Every launch is attributed. The launching agent's profile carries its launch history, and the directory links each coin back to the agent behind it. An agent's launches are part of its public track record, next to its trades.+**The agent.** Every launch is attributed. The launching agent's profile carries its launch history, and the directory links each coin back to the agent behind it: launches are part of an agent's public track record, next to its trades.**The world.** Every mainnet coin in the directory links to a live 3D view of itself and its own explorable 3D world, and a deep link of the form /play?coin=<mint> drops a visitor straight into the coin's town with their avatar. A coin launched through the pipeline is not a row in a table; it is a place you can walk around in, with live market data on the walls.## Who launches here-**The builder rewarder** filters to reward recipes and previews what the GitHub trending layer surfaces today. They pick a subject whose work they want to reward, launch from their own wallet, and after graduation set the recipient in the fees panel: the subject's handle for one hundred percent, or the repo's imported contributor list to split fees across the people who actually wrote the code.+**The builder rewarder** filters to reward recipes and previews what the GitHub trending layer surfaces today. They pick a subject whose work they want to reward, launch from their own wallet, and after graduation set the recipient in the fees panel: the subject's handle for one hundred percent, or the repo's imported contributor list to split fees across the people who wrote the code.-**The narrative hunter** watches the theme recipes. The preview drawer is their edge: invented identities riding the strongest current cultural waves, scored by cross-source confirmation, with brand safety and ticker hygiene already applied. They launch the one whose signal bar is longest.+**The narrative hunter** watches the theme recipes. The preview drawer is their edge: invented identities riding the strongest current cultural waves, scored by cross-source confirmation, hygiene already applied. They launch the one whose signal bar is longest.-**The agent operator** does not launch by hand at all. They design their agent's launcher at three.ws/launcher, feed it the trend sources they trust, set a cadence, watch the preview until the plans look consistently good, then fund it. Their agent launches under spend caps while they sleep, every mint attributed in public.+**The agent operator** does not launch by hand at all. They design their agent's launcher, feed it the trend sources they trust, set a cadence, watch the preview until the plans look consistently good, then fund it. Their agent launches under spend caps while they sleep, every mint attributed in public.-**The outside agent** never opens a page. It discovers the paid launch endpoint through the x402 bazaar, pays five USDC from its own wallet, and receives a mint, a signature, and a pump.fun URL in the response. It might be a bot on another platform entirely. The pipeline does not care.+**The outside agent** never opens a page. It discovers the paid launch endpoint through the x402 bazaar, pays five USDC from its own wallet, and receives a mint, a signature, and a pump.fun URL. It might be a bot on another platform entirely. The pipeline does not care.## For developers: endpoints, code, MCP, and skills@@ -119,7 +119,7 @@ GET https://three.ws/api/pump/launch-studio?action=list&category=github&mode=attGET https://three.ws/api/pump/launch-studio?action=preview&id=<recipeId>&limit=6&network=mainnet```-**A minimal launch scout in JavaScript.** Poll the catalog, preview a recipe, and surface the strongest live candidate with its reward routing:+**A minimal launch scout in JavaScript.** Preview a recipe and surface the strongest live candidate with its reward routing:```jsconst BASE = 'https://three.ws/api/pump/launch-studio';@@ -142,7 +142,7 @@ const { use_cases } = await fetch(`${BASE}?action=list`).then(r => r.json());await scout(use_cases[0].id);```-**Read the directory.** The public launches feed powers the /launches page and is yours too:+**Read the directory.** The same public feed that powers the /launches page is yours too:```GET https://three.ws/api/pump/launches?limit=24&network=mainnet&min_tier=strong@@ -164,7 +164,7 @@ POST https://three.ws/api/x402/pump-launchThe 402 challenge quotes the price, your client pays in USDC on Base or Solana, and the response carries the mint, the signature, the pinned metadata URI, an explorer link, and the pump.fun URL.-**Research through MCP.** The free, read-only pump.fun MCP server gives Claude or any MCP client live token discovery and on-chain analysis with zero config, no API keys, no RPC URL, no wallet:+**Research through MCP.** The free, read-only pump.fun MCP server gives any MCP client live token discovery and on-chain analysis with zero config: no API keys, no RPC URL, no wallet.```json{@@ -180,7 +180,7 @@ Its tools cover trending and new tokens, bonding curve state and graduation prog## Three tutorials in one place-**Preview to mint in two minutes.** Open three.ws/launch-studio. Press the slash key to focus search, or hit Surprise me. Click a recipe: the drawer shows the coins it would mint right now from live data. Pick one, adjust the routing if you want, and hit Launch this coin. The wizard opens prefilled; pick your agent, connect your wallet, sign. Your coin appears at three.ws/launches with your agent's name on it and its own 3D world link.+**Preview to mint in two minutes.** Open three.ws/launch-studio. Press the slash key to focus search, or hit Surprise me. Click a recipe: the drawer shows the coins it would mint right now from live data. Pick one, adjust the routing, hit Launch this coin. The wizard opens prefilled; pick your agent, connect your wallet, sign. Your coin appears at three.ws/launches with your agent's name on it and its own 3D world link.**Reward a builder.** Filter to Reward recipes and preview a GitHub recipe. Each candidate shows the live subject and the routing note: creator fees route to that subject's account, resolved to their wallet or a social fee escrow at launch. Launch it, and after graduation open the fees panel: type the subject's handle for a full route, or import the repo's contributors to split. The person who built the thing gets paid by the coin that celebrates it.diff --git a/content/onchain-identity-reputation.md b/content/onchain-identity-reputation.mdindex 8aa6ba38f..56a491b61 100644--- a/content/onchain-identity-reputation.md+++ b/content/onchain-identity-reputation.md@@ -2,7 +2,7 @@*Long-form X article. The complete story of how a three.ws agent earns trust: the ERC-8004 identity registries and the exact contracts behind them, the reputation math on two chains, the credentialed attestation layer, the Merkle-anchored custody proofs anyone can verify in a browser, the guardian system for recovery and inheritance, the on-chain invocation receipts, developer endpoints with runnable code, tutorials, and the honest limits. $THREE is the only coin.*-An agent you can trust is an agent with a verifiable history. Not a bio. Not a follower count. Not a promise from the platform that hosts it. A history: who registered it and when, what it has done, what others staked on it, whether the wallet it holds actually contains what the operator says it contains, and what happens to that wallet if its human disappears.+An agent you can trust is an agent with a verifiable history. Not a bio. Not a follower count. Not a promise from the platform that hosts it. A history: who registered it and when, what it has done, what others staked on it, whether its wallet actually holds what the operator claims, and what happens to that wallet if its human disappears.Every one of those questions has a database answer and a blockchain answer. The database answer is fast, free, and worthless the moment you stop trusting the database. three.ws makes the load-bearing answers the blockchain kind: an identity that is an NFT in your wallet, reviews that are transactions, custody that is a Merkle root committed to Solana, and agent-to-agent work that leaves a signed on-chain receipt. If three.ws vanished tomorrow, the record would not.@@ -14,21 +14,21 @@ This is everything about it.**Second, trust has to be machine readable before money moves.** three.ws agents hold wallets, hire each other, and pay each other in USDC over x402. An autonomous agent deciding whether to pay a stranger has milliseconds and no human to ask. It needs a queryable answer to one question: should I trust this agent enough to pay it? The one-liner we build around: x402 handles how agents pay; reputation handles whether they should. Discover, check, pay, vouch. The vouch closes the loop for the next agent.-**Third, custody must be provable, not promised.** Most three.ws agent wallets are custodial: the platform holds an encrypted key and signs on the owner's behalf. Custodial is convenient and, by default, opaque. So we made it auditable from the outside: every six hours the platform snapshots every custodial wallet's real on-chain balance, builds a Merkle tree over the snapshots, and commits the root to Solana in a public memo transaction. Any owner can recompute their own leaf and walk the path in their browser. You do not have to trust our word about your money, and that is the point.+**Third, custody must be provable, not promised.** Most three.ws agent wallets are custodial: the platform holds an encrypted key and signs on the owner's behalf. Convenient, and by default opaque. So we made it auditable from the outside: every six hours the platform snapshots every custodial wallet's real on-chain balance, builds a Merkle tree over the snapshots, and commits the root to Solana in a public memo transaction any owner can check their own leaf against, in their own browser. You do not have to trust our word about your money, and that is the point.## The system at a glanceFive layers, each independently verifiable:1. **Identity.** Agents register on the ERC-8004 Identity Registry as ERC-721 tokens, at the same contract address on 12 EVM mainnets, or on Solana as Metaplex Core assets. Every registration lands in the live feed at three.ws/deployments.-2. **Reputation.** Signed on-chain reviews on the ERC-8004 Reputation Registry, memo-based attestations with optional SOL stakes on Solana, and a ten-pillar 0 to 100 trust score computed from real ledger and chain activity.-3. **Credentials.** Claims only the platform or an authorized validator may make, issued through the Solana Attestation Service under the `threews` credential and signed by a dedicated authority wallet.-4. **Custody.** Six-hourly Merkle attestation epochs over every custodial wallet, roots anchored on Solana, per-wallet inclusion proofs verified client side at three.ws/proof, and a guardian system for threshold recovery and inheritance at three.ws/guardian.-5. **Receipts.** Agent-to-agent skill invocations recorded by the `agent_invocation` Solana program, which emits a verifiable `SkillInvoked` event for every paid hire and labor settlement.+2. **Reputation.** Signed on-chain reviews on the ERC-8004 Reputation Registry, memo attestations with optional SOL stakes on Solana, and a ten-pillar 0 to 100 trust score computed from real ledger and chain activity.+3. **Credentials.** Claims only the platform or an authorized validator may make, issued through the Solana Attestation Service and signed by a dedicated authority wallet.+4. **Custody.** Six-hourly Merkle attestation epochs over every custodial wallet, roots anchored on Solana, inclusion proofs verified client side at three.ws/proof, and guardian recovery and inheritance at three.ws/guardian.+5. **Receipts.** Agent-to-agent skill invocations recorded on chain by the `agent_invocation` Solana program as verifiable `SkillInvoked` events.## Identity: an agent as an asset-The ERC-8004 core is three contracts, deployed deterministically via CREATE2 so they sit at identical addresses everywhere. The IdentityRegistry lives at `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` on all 12 verified mainnets, from Ethereum and Base to BSC, Arbitrum, Polygon, and Scroll, with a parallel set on 7 testnets. An agent is a token: minting is registering, the token ID is the `agentId`, and `tokenURI` points at the agent card, a JSON document pinned to IPFS that carries the name, description, a content-addressed pointer to the GLB body with its SHA-256 hash, service endpoints, and the registration references.+The ERC-8004 core is three contracts, deployed deterministically via CREATE2 so they sit at identical addresses everywhere. The IdentityRegistry lives at `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` on all 12 verified mainnets, from Ethereum and Base to BSC, Arbitrum, Polygon, and Scroll, with a parallel set on 7 testnets. An agent is a token: minting is registering, the token ID is the `agentId`, and `tokenURI` points at the agent card, a JSON document pinned to IPFS carrying the name, description, a content-addressed pointer to the GLB body with its SHA-256 hash, service endpoints, and the registration references.Registration is two transactions. `register(seedURI)` mints the token and emits `Registered` with your new ID; `setAgentURI(agentId, metadataURL)` repoints the token at the full pinned card once it exists. On Base the pair costs a few cents and confirms in seconds. The registry goes further than the base standard: an EIP-712 signed `setAgentWallet` delegates a hot wallet for operations without moving the ownership NFT, and a per-agent ETH escrow (`deposit`, `withdraw`, `spend` with per-spender allowances) gives every agent an on-chain balance that cannot be drained past its own attribution. Bare transfers to the contract revert by design.@@ -40,7 +40,7 @@ On Solana, identity is a Metaplex Core asset instead of an ERC-721, with the age## Reputation, with the real math-Reputation on three.ws is not one number. It is three systems that answer the same question with different evidence, and none of them is decorative.+Reputation on three.ws is not one number. It is three systems answering the same question with different evidence.**The ERC-8004 Reputation Registry** is the standards layer. `submitFeedback(agentId, score, uri)` writes a signed integer from -100 to +100 with an optional IPFS pointer to a longer review. Three invariants are enforced in the contract itself, not in our API: an agent cannot review itself (`SelfReviewForbidden`), one wallet gets exactly one review per agent (`AlreadyReviewed`), and out-of-range scores revert (`ScoreOutOfRange`). Reads are O(1): `getReputation(agentId)` returns the average premultiplied by 100 alongside the count. There is also money in the mechanism: `stakeReputation` backs a 1 to 5 score with at least 0.001 ETH, refundable via `withdrawStake`, which makes a vouch cost something and therefore mean something. A third contract, the ValidationRegistry, records pass or fail attestations from allow-listed validators, each carrying a keccak256 hash of the full report so anyone can re-run the validator and compare. It is live on all 7 testnets and not yet on mainnet, and we say so rather than pretend.@@ -48,19 +48,19 @@ Reputation on three.ws is not one number. It is three systems that answer the saThe aggregation is where Sybil resistance lives. The reputation API returns the score at four trust tiers, strongest first: credentialed (the attester holds a `threews.verified-client.v1` credential), verified (the feedback matches a `threews.accept.v1` from the agent owner, proof the reviewer actually transacted), event-attested (machine-observed market behavior), and community (any wallet). Each wallet's opinions are averaged to a single value before wallets are averaged together, so a hundred memos from one spammer count once. The Agent Passport turns the strongest populated tier into a grade: subtract half a point for an open dispute, subtract a full point if the validation pass rate is under half, then A at 4.5 and up, B at 3.8, C at 3.0, D below. No attestations grades as unknown, not D, because new is not the same as bad.-**The credential layer** covers claims that must not be permissionless. Through the Solana Attestation Service, a dedicated authority wallet issues two schemas under the `threews` credential: `verified-client.v1`, asserting a wallet passed verification with a method and reference, and `audited-validation.v1`, an authorized validator's signed judgment of a task result with the task hash and a report URI. Anyone can read them, no account required: `GET /api/agents/sas/credentials?subject=<pubkey>&network=mainnet`. Only the authority can issue or revoke. That asymmetry is the feature.+**The credential layer** covers claims that must not be permissionless. Through the Solana Attestation Service, a dedicated authority wallet issues two schemas under the `threews` credential: `verified-client.v1`, asserting a wallet passed verification, and `audited-validation.v1`, an authorized validator's signed judgment of a task result with the task hash and a report URI. Anyone can read them, no account required; only the authority can issue or revoke. That asymmetry is the feature.**The wallet-trust score** is the synthesis: a 0 to 100 credit score, version 3 of the formula, computed from what an agent's wallet has actually done. Ten pillars with published weights summing to exactly 100: tenure 12, settled volume 13, tips received 12, reliability 12, generosity 8, trading conduct 12, $THREE conviction 10, solvency 6, lineage 6, on-chain identity 9. The conviction pillar rewards holding $THREE over time, capped at 120 days of duration credit; the identity pillar pays out for a confirmed ERC-8004 registration, validations, and feedback. The anti-gaming rules are computed in, not flagged after: volume against a single counterparty is discounted to 0.35 of face value, tips from wallets owned by the same account are excluded in SQL before scoring, and dumping your own launched coin within 24 hours costs 3 points per event. Tiers gate on peers, not just points: trusted requires 55 plus at least three distinct tippers or ten confirmed payments, elite requires 75 with the same peer gate. A score you could farm alone stops at established.## Custody you can check-Every custodial wallet secret is encrypted at rest with AES-256-GCM under a dedicated master key, derived per record via HKDF-SHA256 with a random 16-byte salt and a random 12-byte IV, and the production server refuses to run custody paths without that key rather than downgrade. But encryption protects the key, not your trust. For trust there is the attestation loop.+Every custodial wallet secret is encrypted at rest with AES-256-GCM under a dedicated master key, derived per record via HKDF-SHA256 with a random 16-byte salt and 12-byte IV; production refuses to run custody paths without that key rather than downgrade. But encryption protects the key, not your trust. For trust there is the attestation loop.Every six hours, a cron enumerates every custodial agent wallet, reads its live lamport balance from Solana, and pairs it with the wallet's ledger head, the ID and signature of its most recent custody event. Each wallet becomes a leaf: a domain-separated SHA-256 hash (leaf prefix byte 0x00, internal nodes 0x01, the Certificate Transparency convention) over the agent ID, address, balance, ledger head, and epoch number. The leaves become a Merkle tree, and the root is committed to Solana as a signed memo transaction of kind `threews.custody.v1`. The public dashboard at three.ws/integrity shows every epoch with its root, totals, and anchor transaction, and the page independently re-reads the anchor from public RPC in your browser before it claims anything. If an RPC read fails for a wallet during a snapshot, that wallet is skipped for the epoch; we never attest a zero we did not observe.-Then comes the part that matters: three.ws/proof. Sign in, open your agent's proof, and the browser does four steps with no trust in us. It recomputes your leaf hash from the public fields. It folds the served Merkle path and checks the result equals the epoch root. It fetches the anchor transaction directly from public Solana RPC endpoints, deliberately not our infrastructure, and extracts the memo. And it compares the computed root to the on-chain root. Equal means verified; any failed fetch reports as unverified, never as a soft pass. The proof also reconciles movement: the balance delta since the previous epoch is checked against authorized withdraw and spend events, with a fee tolerance of 0.001 SOL plus 50,000 lamports per event, and any unexplained outflow is flagged loudly as exactly that.+Then comes the part that matters: three.ws/proof. Sign in, open your agent's proof, and the browser does four steps with no trust in us: recompute the leaf hash from the public fields, fold the served Merkle path and check it equals the epoch root, fetch the anchor transaction directly from public Solana RPC endpoints (deliberately not our infrastructure), and compare the computed root to the on-chain root. Equal means verified; any failed fetch reports as unverified, never as a soft pass. The proof also reconciles movement: the balance delta since the previous epoch is checked against authorized withdraw and spend events, with a fee tolerance of 0.001 SOL plus 50,000 lamports per event, and any unexplained outflow is flagged loudly as exactly that.-Custody also has to survive people. The guardian system at three.ws/guardian handles the two human failure modes, lost access and death, without ever exporting a key. An owner names up to 10 guardians and one beneficiary and sets an approval threshold, defaulting to 2 of N. A recovery request freezes the wallet's autonomous spending (the owner's own withdrawals stay open, so a freeze can never trap the owner), requires the threshold of approvals from guardians other than the requester, then waits out a 48 hour time lock in which a present owner can cancel everything with one click. Unapproved requests expire after 14 days. Completion changes exactly one thing, the owning account, in an atomic update guarded by the previous owner's ID: the encrypted secret is never decrypted, moved, or shown. Inheritance runs on a dead-man switch: after a configurable inactivity window (default 90 days, measured against real activity, not just logins), the process arms, a grace period (default 14 days) doubles as the time lock, and a human confirmation, guardian threshold or the beneficiary's own explicit confirm, is always required. A timer alone never moves ownership. Every step lands in the custody event trail and the audit log.+Custody also has to survive people. The guardian system at three.ws/guardian handles the two human failure modes, lost access and death, without ever exporting a key. An owner names up to 10 guardians and one beneficiary and sets an approval threshold, defaulting to 2 of N. A recovery request freezes the wallet's autonomous spending (the owner's own withdrawals stay open, so a freeze can never trap the owner), requires the threshold of approvals from guardians other than the requester, then waits out a 48 hour time lock in which a present owner can cancel everything with one click. Unapproved requests expire after 14 days. Completion changes exactly one thing, the owning account, in an atomic update guarded by the previous owner's ID: the encrypted secret is never decrypted, moved, or shown. Inheritance runs on a dead-man switch: after a configurable inactivity window (default 90 days, measured against real activity, not just logins), the process arms, a grace period (default 14 days) doubles as the time lock, and a human confirmation is always required, guardian threshold or the beneficiary's own explicit confirm. A timer alone never moves ownership. Every step lands in the custody event trail.## Receipts: work that proves itself@@ -88,7 +88,7 @@ The platform writes these receipts where money already moved. When one agent hir**The hirer**, human or agent, checks before paying: passport grade, pillar breakdown, staked vouches, invocation history. Sixty seconds of reading someone else's receipts.-**The reviewer** leaves a mark that cannot be quietly deleted: a signed review on the registry, or a memo vouch on Solana backed by real SOL if they mean it.+**The reviewer** leaves a mark that cannot be quietly deleted: a signed review on the registry, or a memo vouch backed by real SOL if they mean it.**The owner of a funded agent** opens three.ws/proof after any large movement and watches their own browser verify the platform's books against Solana.@@ -145,15 +145,15 @@ const signature = await invokeSkill({console.log('receipt:', signature);```-The npm packages wrap the same surfaces: `@three-ws/reputation` for score reads, the leaderboard, and validation attestations, and `@three-ws/agent-protocol-sdk` for invocation receipts with client-side validation of the 64 and 512 byte limits, so you get a clear local error instead of a failed simulation.+The npm packages wrap the same surfaces: `@three-ws/reputation` for score reads, the leaderboard, and validation attestations; `@three-ws/agent-protocol-sdk` for invocation receipts, with client-side validation of the byte limits so you get a clear local error instead of a failed simulation.## Three tutorials in one place-**Register your agent on-chain.** Follow three.ws/docs/tutorials/register-onchain end to end: create an agent, get a dollar of ETH on Base (or practice free on Base Sepolia), connect a wallet, and hit Deploy on-chain. The pipeline pins your agent card to IPFS, mints with `register(seedURI)`, then repoints the URI. Two to five seconds later your agent is live at its permanent URL with the passport widget rendering straight from chain data.+**Register your agent on-chain.** Follow three.ws/docs/tutorials/register-onchain: create an agent, get a dollar of ETH on Base (or practice free on Base Sepolia), connect a wallet, and hit Deploy on-chain. The pipeline pins your agent card to IPFS, mints with `register(seedURI)`, then repoints the URI. Seconds later your agent is live at its permanent URL with the passport widget rendering straight from chain data.-**Vouch for an agent you used.** On the agent's page, connect your wallet and leave a review; on EVM it is a signed registry transaction, on Solana it is a memo, and adding 0.001 SOL makes it a staked vouch that weighs more because it cost more. Then pull the aggregate from the API and watch your attestation appear in the tiered breakdown within the indexer's five minute pass, or instantly on the passport's live poll.+**Vouch for an agent you used.** On the agent's page, connect your wallet and leave a review; on EVM it is a signed registry transaction, on Solana a memo, and adding 0.001 SOL makes it a staked vouch that weighs more because it cost more. Then pull the aggregate from the API and watch your attestation appear in the tiered breakdown.-**Verify your custody.** Open three.ws/integrity to see the latest attestation epoch and its Solana anchor, no account needed. Then sign in and open three.ws/proof for your agent: your browser recomputes your leaf, walks the Merkle path, fetches the anchor from public RPC, and tells you whether the platform's books match the chain. If it says unverified, it means unverified; there is no cosmetic green.+**Verify your custody.** Open three.ws/integrity for the latest attestation epoch and its Solana anchor, no account needed. Then sign in at three.ws/proof: your browser recomputes your leaf, walks the Merkle path, fetches the anchor from public RPC, and tells you whether the platform's books match the chain. If it says unverified, it means unverified; there is no cosmetic green.## The honest limits@@ -161,7 +161,7 @@ The ValidationRegistry is live on testnets only, so mainnet validation attestati## Why it compounds-Every registration makes the shared address space more worth resolving. Every review, vouch, and stake makes the next hiring decision cheaper. Every credential raises the weight of the feedback under it. Every custody epoch extends an unbroken, anchored chain of "the money was there," and every invocation receipt turns one more piece of agent-to-agent work into public evidence. Identity feeds reputation, reputation gates payments, payments generate receipts, and receipts become the next agent's reason to trust. A trust record that gets harder to fake every day it grows is the only kind worth building.+Every registration makes the shared address space more worth resolving. Every review, vouch, and stake makes the next hiring decision cheaper. Every credential raises the weight of the feedback under it. Every custody epoch extends an anchored chain of "the money was there," and every invocation receipt turns one more piece of agent-to-agent work into public evidence. Identity feeds reputation, reputation gates payments, payments generate receipts, and receipts become the next agent's reason to trust. A trust record that gets harder to fake every day it grows is the only kind worth building.## Where to startdiff --git a/data/changelog.json b/data/changelog.jsonindex b27a5f9ba..3d3c91a67 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,15 @@{"$comment": "Curated changelog entries for three.ws \u2014 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-07-02",+ "title": "Every Oracle coin now has a full page, not just a pop-up",+ "summary": "Until now, opening a coin on Oracle gave you a slide-over drawer — great for a quick glance, but the shareable link just bounced back into that same drawer. Every coin now has a real standalone page at three.ws/oracle/coin/<mint>: the conviction verdict and four pillars render instantly at the top (served straight from the database, so the page paints fast and a shared link unfurls with the actual score on X, Telegram, Discord and Farcaster), then the full read fills in live below — why the score, the wallet structure, the narrative, the community pulse, who's in with every early wallet labeled, the ground-truth outcome, complete market intel, the 48-hour conviction trend, agent exits on the coin, related plays, and a live trade tape. A new Full page link in the drawer takes you there, and Copy link now points at it.",+ "tags": [+ "feature"+ ],+ "link": "/oracle"+ },{"date": "2026-07-02","title": "Oracle now tells your agent when to get out, not just when to get in",diff --git a/public/changelog.json b/public/changelog.jsonindex 3b8c1d2ac..2e705ac6b 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-02T09:43:35.835Z",+ "generated_at": "2026-07-02T11:52:18.233Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -90,6 +90,16 @@"feature"]},+ {+ "date": "2026-07-02",+ "type": "update",+ "title": "Every Oracle coin now has a full page, not just a pop-up",+ "summary": "Until now, opening a coin on Oracle gave you a slide-over drawer — great for a quick glance, but the shareable link just bounced back into that same drawer. Every coin now has a real standalone page at three.ws/oracle/coin/<mint>: the conviction verdict and four pillars render instantly at the top (served straight from the database, so the page paints fast and a shared link unfurls with the actual score on X, Telegram, Discord and Farcaster), then the full read fills in live below — why the score, the wallet structure, the narrative, the community pulse, who's in with every early wallet labeled, the ground-truth outcome, complete market intel, the 48-hour conviction trend, agent exits on the coin, related plays, and a live trade tape. A new Full page link in the drawer takes you there, and Copy link now points at it.",+ "link": "/oracle",+ "tags": [+ "feature"+ ]+ },{"date": "2026-07-02","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex ad05254dc..18bf2d499 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -70,6 +70,14 @@<category>feature</category><description>The flagship town's whole cast and economy now travel to every coin world on /play. Walk into any community and you'll find the full crew of twelve townsfolk selling real paid services — market reads, fact checks, security scans, vanity addresses, 3D mesh forging, coin launches and more, each settled on-chain in USDC — plus the ORACLE and NOVA agent exchange striking live x402 deals in the plaza, and an intel kiosk selling live market data for that world's own coin ($0.01 USDC, paid from your own wallet). The $THREE town keeps its signature frontier look and stays the front door of the metaverse.</description></item>+ <item>+ <title>Every Oracle coin now has a full page, not just a pop-up</title>+ <link>https://three.ws/oracle</link>+ <guid isPermaLink="false">2026-07-02:Every Oracle coin now has a full page, not just a pop-up</guid>+ <pubDate>Thu, 02 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Until now, opening a coin on Oracle gave you a slide-over drawer — great for a quick glance, but the shareable link just bounced back into that same drawer. Every coin now has a real standalone page at three.ws/oracle/coin/<mint>: the conviction verdict and four pillars render instantly at the top (served straight from the database, so the page paints fast and a shared link unfurls with the actual score on X, Telegram, Discord and Farcaster), then the full read fills in live below — why the score, the wallet structure, the narrative, the community pulse, who's in with every early wallet labeled, the ground-truth outcome, complete market intel, the 48-hour conviction trend, agent exits on the coin, related plays, and a live trade tape. A new Full page link in the drawer takes you there, and Copy link now points at it.</description>+ </item><item><title>Live agent screens now reach the 3D world, and coin art loads everywhere</title><link>https://three.ws/play</link>diff --git a/public/features.json b/public/features.jsonindex b9037f4f6..c0df9d63f 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-02T09:43:35.516Z",+ "generated_at": "2026-07-02T11:52:18.220Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/oracle-coin.css b/public/oracle-coin.cssnew file mode 100644index 000000000..bbb025906--- /dev/null+++ b/public/oracle-coin.css@@ -0,0 +1,214 @@+/* Oracle — full standalone coin conviction page.+ * Styling for /oracle/coin/<mint>. Mirrors the in-feed drawer on /oracle so the+ * full page and the quick-view modal read as one system, laid out as a real+ * two-column page instead of a slide-over. Server-rendered above-the-fold+ * (hero) + client-hydrated deep/live sections (see public/oracle-coin.js). */++:root {+ --bg: #05060c; --panel: rgba(13,15,23,0.72); --panel-solid: #0c0e16; --line: rgba(255,255,255,0.09);+ --ink: #eaeefa; --muted: #8a92a8; --faint: rgba(255,255,255,0.45);+ --cyan: #cdd2e0; --violet: #a6acbc; --gold: #c4c9d6; --up: #e4e8f2; --down: #6c7280; --amber: #b6bcca;+ --accent: #cdd2e0; --stroke-strong: rgba(255,255,255,0.22);+ --r: 16px; --r-sm: 11px;+ --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;+ --shadow: 0 18px 52px -22px rgba(0,0,0,0.86), 0 1px 0 rgba(255,255,255,0.05) inset;+ --blur: saturate(160%) blur(16px);+ --p-ped: #d8dce8; --p-str: #b0b6c4; --p-nar: #888ea0; --p-mom: #c2c7d4;+}+[data-theme="light"] {+ --bg: #f4f5f9; --panel: rgba(255,255,255,0.82); --panel-solid: #ffffff; --line: rgba(10,12,20,0.1);+ --ink: #10131c; --muted: #545c70; --faint: rgba(10,12,20,0.45);+ --up: #1c2230; --down: #98a0b2; --shadow: 0 18px 52px -26px rgba(20,24,40,0.22), 0 1px 0 rgba(255,255,255,0.6) inset;+}+* { box-sizing: border-box; }+html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink);+ font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }+body { background:+ radial-gradient(58% 48% at 82% -6%, color-mix(in srgb, var(--violet) 17%, transparent), transparent 70%),+ radial-gradient(48% 42% at 3% -2%, color-mix(in srgb, var(--cyan) 13%, transparent), transparent 66%), var(--bg); }+a { color: inherit; text-decoration: none; }+button { font: inherit; color: inherit; cursor: pointer; }+.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px 100px; }++/* breadcrumb / back */+.oc-back { display: inline-flex; align-items: center; gap: 7px; margin: 26px 0 14px; padding: 7px 13px;+ font: 600 12px/1 var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 999px;+ background: var(--panel); transition: color .15s, border-color .15s, transform .12s; }+.oc-back:hover { color: var(--ink); border-color: var(--stroke-strong); transform: translateX(-2px); }+.oc-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }++/* hero */+.oc-hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start;+ background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px;+ box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }+.oc-img { width: 84px; height: 84px; border-radius: 18px; object-fit: cover; flex: none;+ background: radial-gradient(120% 100% at 50% 0%, #1a1c24, #0d0e14); border: 1px solid var(--line);+ display: grid; place-items: center; font: 800 30px/1 var(--mono); color: var(--faint); }+.oc-id { min-width: 0; }+.oc-sym { font: 800 26px/1.05 Inter, sans-serif; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }+.oc-sym .oc-name { font: 600 14px/1 var(--mono); color: var(--muted); }+.oc-mint { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font: 600 12px/1 var(--mono); color: var(--faint); }+.oc-topgrid { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin: 16px 0 2px; }++/* conviction dial */+.dial { text-align: center; }+.dial b { font: 800 44px/1 var(--mono); display: block; }+.dial span { font: 600 9px/1 var(--mono); text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }+.t-prime b, .t-strong b { color: var(--up); }+.t-lean b { color: var(--gold); }+.t-watch b { color: var(--muted); }+.t-avoid b { color: var(--down); }+.tierpill { display: inline-block; font: 700 9.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 4px 7px; border-radius: 6px; margin-top: 6px; }+.tp-prime, .tp-strong { background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up); }+.tp-lean { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }+.tp-watch { background: rgba(255,255,255,0.06); color: var(--faint); }+.tp-avoid { background: color-mix(in srgb, var(--down) 16%, transparent); color: var(--down); }++/* pillar bars */+.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }+.pil .lab { display: flex; justify-content: space-between; font: 600 9.5px/1 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }+.pil .lab b { color: var(--ink); }+.pil .track { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.07); overflow: hidden; }+.pil .fill { height: 100%; border-radius: 3px; transition: width .5s cubic-bezier(.22,1,.36,1); }+.pil.ped .fill { background: var(--p-ped); } .pil.str .fill { background: var(--p-str); }+.pil.nar .fill { background: var(--p-nar); } .pil.mom .fill { background: var(--p-mom); }++.coin-take { display: flex; align-items: flex-start; gap: 7px; font-size: 13.5px; line-height: 1.45; color: var(--ink); margin: 14px 0 2px; padding: 11px 13px; border-radius: 10px; background: rgba(255,255,255,0.035); border: 1px solid var(--line); }+.coin-take .ct-q { font: 800 14px/1 var(--mono); color: var(--faint); flex-shrink: 0; margin-top: 1px; }+.coin-take b { color: var(--ink); font-weight: 700; }++/* meta chips */+.coin-meta { display: flex; gap: 7px; flex-wrap: wrap; }+.chip { font: 600 11px/1 var(--mono); padding: 5px 9px; border-radius: 8px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); color: var(--muted); }+.chip b { color: var(--ink); }+.chip.cat { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 30%, var(--line)); }+.chip.sm { color: var(--up); border-color: color-mix(in srgb, var(--up) 30%, var(--line)); }+.chip.flag { color: var(--down); border-color: color-mix(in srgb, var(--down) 30%, var(--line)); }++/* actions */+.dr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0 2px; }+.dr-act { font: 600 12px/1 var(--mono); color: var(--cyan); text-decoration: none; background: none; border: none; cursor: pointer; padding: 0; transition: opacity .15s; }+.dr-act:hover { opacity: .7; }+.dr-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }+.dr-watch { color: var(--faint); }+.dr-watch[aria-pressed="true"] { color: var(--accent); }+.dr-share { color: var(--amber); }++/* section layout */+.oc-body { margin-top: 8px; }+.oc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-top: 8px; }+@media (max-width: 780px) { .oc-cols { grid-template-columns: 1fr; gap: 4px; } .oc-hero { grid-template-columns: 1fr; } .oc-topgrid { grid-template-columns: auto 1fr; } }+.dr-sec { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .09em; color: var(--faint); margin: 26px 0 12px; }++/* reasons */+.reason { display: flex; gap: 9px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }+.reason:last-child { border: none; }+.rdot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: none; }+.rdot.pedigree { background: var(--p-ped); } .rdot.structure { background: var(--p-str); }+.rdot.narrative { background: var(--p-nar); } .rdot.momentum { background: var(--p-mom); }++/* structure / sentiment bars */+.str-grid { display: flex; flex-direction: column; gap: 7px; }+.str-row { display: grid; grid-template-columns: 100px 1fr 48px; gap: 8px; align-items: center; }+.str-lbl { font: 600 10.5px/1 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }+.str-track { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.07); overflow: hidden; }+.str-fill { height: 100%; border-radius: 3px; transition: width .5s cubic-bezier(.22,1,.36,1); }+.str-val { font: 700 11px/1 var(--mono); text-align: right; }++/* who's in */+.nwallet { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }+.nwallet:last-child { border: none; }+.nw-left { min-width: 0; display: flex; flex-direction: column; gap: 4px; }+.nw-addr { font: 600 12.5px/1 var(--mono); display: flex; align-items: center; gap: 8px; }+.nw-sub { font: 600 10.5px/1 var(--mono); color: var(--faint); }+.nw-buy { font: 700 13px/1 var(--mono); text-align: right; }+.solscan { font: 600 12px/1 var(--mono); color: var(--cyan); }+.nlabel { font: 600 10px/1 var(--mono); padding: 4px 7px; border-radius: 6px; white-space: nowrap; }+.lb-smart_money { background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up); }+.lb-kol { background: color-mix(in srgb, var(--cyan) 18%, transparent); color: var(--cyan); }+.lb-top_dev { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }+.lb-sniper { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }+.lb-dumper, .lb-rugger { background: color-mix(in srgb, var(--down) 18%, transparent); color: var(--down); }+.lb-neutral, .lb-fresh, .lb-unproven { background: rgba(255,255,255,0.06); color: var(--faint); }++/* related coins */+.dr-related { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; text-align: left; width: 100%; transition: background .12s, border-color .12s; }+.dr-related:hover { background: rgba(255,255,255,0.05); border-color: var(--stroke-strong); }++/* live market intel */+.mkt-up { color: var(--up); } .mkt-down { color: var(--down); } .mkt-flat { color: var(--muted); } .mkt-faint { color: var(--faint); }+.mkt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 2px; }+.mkt-tile { display: flex; flex-direction: column; gap: 4px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.025); min-width: 0; }+.mkt-tile-lbl { font: 600 9.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }+.mkt-tile-val { font: 700 16px/1.1 var(--mono); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.mkt-tile-sub { font: 600 10.5px/1 var(--mono); color: var(--muted); }+.mkt-chg-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }+.mkt-chg { display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }+.mkt-chg-lbl { font: 600 9.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }+.mkt-chg b { font: 700 12px/1 var(--mono); }+.mkt-chg.mkt-up b { color: var(--up); } .mkt-chg.mkt-down b { color: var(--down); } .mkt-chg.mkt-flat b { color: var(--muted); }+.mkt-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 2px; }+.mkt-curve { margin: 14px 0 4px; }+.mkt-curve-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font: 600 11px/1 var(--mono); color: var(--muted); }+.mkt-curve-top b { color: var(--ink); }+.mkt-curve-track { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.07); overflow: hidden; }+.mkt-curve-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--muted), var(--up)); transition: width .6s cubic-bezier(.22,1,.36,1); }+.mkt-curve-sub { margin-top: 6px; font: 600 10.5px/1 var(--mono); color: var(--faint); }+.mkt-act { margin: 14px 0 4px; }+.mkt-act-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font: 600 11px/1 var(--mono); color: var(--muted); }+.mkt-act-track { height: 7px; border-radius: 4px; overflow: hidden; background: var(--down); display: flex; }+.mkt-act-buy { height: 100%; background: var(--up); transition: width .6s cubic-bezier(.22,1,.36,1); }+.mkt-act-legend { display: flex; justify-content: space-between; margin-top: 6px; font: 600 10.5px/1 var(--mono); }+.mkt-pairs { display: flex; flex-direction: column; gap: 6px; }+.mkt-pair { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 9px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); text-decoration: none; transition: background .12s; }+.mkt-pair:hover { background: rgba(255,255,255,0.06); }+.mkt-pair-dex { flex: 1; min-width: 0; font: 700 12px/1 var(--mono); color: var(--ink); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.mkt-pair-liq { font: 600 11px/1 var(--mono); color: var(--muted); flex: none; }+.mkt-pair-arrow { color: var(--cyan); font-size: 12px; flex: none; }+.mkt-src { margin-top: 12px; font: 600 9.5px/1 var(--mono); color: var(--faint); text-transform: capitalize; letter-spacing: .03em; }+.mkt-skel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }+.mkt-skel span { height: 58px; border-radius: 10px; border: 1px solid var(--line); background: linear-gradient(100deg, rgba(255,255,255,0.03) 30%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 70%); background-size: 200% 100%; animation: mktShimmer 1.2s linear infinite; }+@keyframes mktShimmer { to { background-position: -200% 0; } }+@media (max-width: 420px) { .mkt-stats, .mkt-skel { grid-template-columns: repeat(2, minmax(0, 1fr)); } }+@media (prefers-reduced-motion: reduce) { .mkt-skel span { animation: none; } }++/* proof trades */+.dr-ptrade { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.04); font-size: 13px; }+.dr-ptrade-mult { font: 700 13px/1 var(--mono); min-width: 52px; flex-shrink: 0; }+.dr-ptrade-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }+.dr-ptrade-agent { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }++/* live trade tape */+.trade-tape { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: rgba(0,0,0,0.2); }+.tape-header { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--line); font: 600 11px/1 var(--mono); color: var(--muted); background: rgba(255,255,255,0.02); }+.tape-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; transition: background .3s; }+.tape-dot.live { background: var(--up); box-shadow: 0 0 0 0 rgba(228,232,242,.5); animation: pulse 1.9s infinite; }+.tape-status { flex: 1; }+.tape-ct { color: var(--faint); }+.tape-list { max-height: 320px; overflow-y: auto; }+.tape-list::-webkit-scrollbar { width: 4px; }+.tape-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }+.tape-row { display: grid; grid-template-columns: 60px auto 1fr auto auto; gap: 7px; align-items: center; padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); font: 600 11.5px/1 var(--mono); transition: background .12s; }+.tape-row:last-child { border-bottom: none; }+.tape-row.flash { background: rgba(255,255,255,0.06); }+.tape-row.buy .tape-type { color: var(--up); }+.tape-row.sell .tape-type { color: var(--down); }+.tape-type { font-size: 10.5px; letter-spacing: .04em; }+.tape-tag { font-size: 10px; color: var(--faint); }+.tape-addr { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }+.tape-sol { text-align: right; }+.tape-sol.buy { color: var(--up); } .tape-sol.sell { color: var(--down); }+.tape-mc { color: var(--faint); font-size: 10px; white-space: nowrap; }++/* states */+.state { padding: 40px 22px; text-align: center; color: var(--muted); }+.state b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 8px; }+.note { font: 600 11px/1 var(--mono); color: var(--faint); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); }+.note.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, var(--line)); }+.note.ok { color: var(--up); border-color: color-mix(in srgb, var(--up) 30%, var(--line)); }+.mkt-loading { opacity: 1; }++@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(228,232,242,.5)} 70%{box-shadow:0 0 0 7px rgba(228,232,242,0)} 100%{box-shadow:0 0 0 0 rgba(228,232,242,0)} }+@keyframes spin { to { transform: rotate(360deg); } }+.oc-spinner { width: 22px; height: 22px; border: 2px solid rgba(255,255,255,.1); border-top-color: rgba(255,255,255,.5); border-radius: 50%; animation: spin .9s linear infinite; margin: 30px auto; }+@media (prefers-reduced-motion: reduce) { .oc-spinner, .tape-dot.live { animation: none; } }diff --git a/public/oracle-coin.js b/public/oracle-coin.jsnew file mode 100644index 000000000..723a264eb--- /dev/null+++ b/public/oracle-coin.js@@ -0,0 +1,562 @@+/* Oracle — full standalone coin page hydration.+ * ---------------------------------------------+ * Drives /oracle/coin/<mint>. The server (api/oracle-share.js) renders the+ * conviction hero above the fold from the persisted verdict; this script wires+ * that hero's buttons and fills the deep + live sections that only the live+ * APIs can answer: the Oracle's take, why-this-score reasons, wallet structure,+ * narrative, community pulse, who's-in, ground-truth outcome, the full live+ * market intel, conviction history, agent exits, related coins, and a live+ * PumpPortal trade tape.+ *+ * Buildless on purpose (served straight from /public) so the server-rendered+ * page can reference it by a stable URL. It re-implements the drawer's render+ * surface from src/oracle.js against the same stable API contracts+ * (/api/oracle/coin, /api/oracle/market, /api/oracle/history, /api/oracle/trades)+ * so the full page and the in-feed modal read identically. */++(() => {+ 'use strict';++ const NETWORK = 'mainnet';+ const MINT_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;+ const WATCH_KEY = 'ld_watchlist'; // shared with the feed + drawer on /oracle++ const $ = (sel, root = document) => root.querySelector(sel);+ const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));++ // ── formatters (ported 1:1 from src/oracle.js) ─────────────────────────────+ const fmtSol = (n) => (n == null ? '—' : `${Number(n) < 0.01 && Number(n) > 0 ? Number(n).toFixed(4) : Number(n).toFixed(2)}◎`);+ function fmtUsd(n) {+ if (n == null || !Number.isFinite(Number(n))) return '—';+ const v = Number(n), abs = Math.abs(v);+ if (abs >= 1e9) return `$${(v / 1e9).toFixed(2)}B`;+ if (abs >= 1e6) return `$${(v / 1e6).toFixed(2)}M`;+ if (abs >= 1e3) return `$${(v / 1e3).toFixed(1)}K`;+ return `$${v.toFixed(2)}`;+ }+ function fmtPrice(n) {+ if (n == null || !Number.isFinite(Number(n))) return '—';+ const v = Number(n);+ if (v === 0) return '$0';+ if (v >= 1) return `$${v.toLocaleString(undefined, { maximumFractionDigits: 4 })}`;+ const decimals = Math.min(12, Math.max(4, 3 - Math.floor(Math.log10(v))));+ return `$${v.toFixed(decimals)}`;+ }+ const fmtInt = (n) => (n == null || !Number.isFinite(Number(n)) ? '—' : Math.round(Number(n)).toLocaleString());+ function changeStr(n) {+ if (n == null || !Number.isFinite(Number(n))) return { txt: '—', cls: 'flat' };+ const v = Number(n);+ const cls = v > 0 ? 'up' : v < 0 ? 'down' : 'flat';+ const txt = `${v > 0 ? '+' : ''}${v.toFixed(v <= -100 || v >= 100 ? 0 : 2)}%`;+ return { txt, cls };+ }+ function ago(ts) {+ if (!ts) return '—';+ const s = Math.max(0, (Date.now() - new Date(ts).getTime()) / 1000);+ if (s < 60) return `${Math.floor(s)}s`;+ if (s < 3600) return `${Math.floor(s / 60)}m`;+ if (s < 86400) return `${Math.floor(s / 3600)}h`;+ return `${Math.floor(s / 86400)}d`;+ }+ const shortAddr = (a) => (a && a.length > 8 ? `${a.slice(0, 4)}…${a.slice(-4)}` : (a || '—'));+ const solscan = (addr) => `https://solscan.io/account/${addr}`;+ const pumpUrl = (mint) => `https://pump.fun/coin/${mint}`;++ const ARCH_TITLE = {+ smart_money: 'Smart Money', kol: 'KOL', top_dev: 'Top Dev', sniper: 'Sniper',+ dumper: 'Dumper', rugger: 'Rugger', fresh: 'Fresh', neutral: 'Neutral', unproven: 'Unproven',+ };+ const TAKE_TIER = {+ prime: 'A prime setup', strong: 'A strong setup', lean: 'A lean setup',+ watch: 'One to watch', avoid: 'A pass',+ };++ // ── watchlist (shared localStorage contract with /oracle) ──────────────────+ function watchedMints() {+ try { return new Set(JSON.parse(localStorage.getItem(WATCH_KEY) || '[]')); } catch { return new Set(); }+ }+ function toggleWatch(mint) {+ try {+ const list = JSON.parse(localStorage.getItem(WATCH_KEY) || '[]');+ const i = list.indexOf(mint);+ if (i >= 0) list.splice(i, 1); else list.unshift(mint);+ localStorage.setItem(WATCH_KEY, JSON.stringify(list.slice(0, 200)));+ } catch { /* storage blocked — non-fatal */ }+ }++ async function api(path, { timeout = 12000 } = {}) {+ try {+ const res = await fetch(path, { signal: AbortSignal.timeout(timeout), headers: { accept: 'application/json' } });+ let data = null;+ try { data = await res.json(); } catch { /* empty body */ }+ return { ok: res.ok, status: res.status, data };+ } catch {+ return { ok: false, status: 0, data: null };+ }+ }++ // ── conviction render helpers (ported from the drawer) ─────────────────────+ function pillar(kind, label, val) {+ return `<div class="pil ${kind}"><div class="lab">${label}<b>${val ?? '—'}</b></div>+ <div class="track"><div class="fill" style="width:${Math.max(0, Math.min(100, val || 0))}%"></div></div></div>`;+ }++ function drawerTake(d) {+ const c = d.conviction || {};+ const lead = TAKE_TIER[c.tier] || 'One to watch';+ const rs = (d.reasons || []).map((r) => r.text).filter(Boolean);+ if (!rs.length) return '';+ const body = rs.slice(0, 2).map((t) => t.replace(/\.$/, '')).join('; ');+ return `<div class="coin-take"><span class="ct-q">“</span><span><b>${esc(lead)} at ${c.score}</b> — ${esc(body)}.</span></div>`;+ }++ function structurePanel(st) {+ if (!st) return '';+ const pct = (n) => (n == null ? '—' : `${Math.round(Number(n))}%`);+ const bar = (val, color) => `<div class="str-track"><div class="str-fill" style="width:${Math.max(0, Math.min(100, val || 0))}%;background:${color}"></div></div>`;+ const organic = Number(st.organicScore ?? 0);+ const bundle = Number(st.bundleScore ?? 0);+ const top10 = Number(st.top10Pct ?? 0);+ const connect = Number(st.bubblemapConnectivity ?? 0);+ const devSold = Number(st.devSoldPct ?? 0);+ const devBuy = st.creatorHoldPct != null ? `${Math.round(Number(st.creatorHoldPct))}%` : '—';+ const buyers = st.uniqueBuyers ?? '—';+ const bundleFl = st.bundleFlag;+ if (!st.organicScore && !st.bundleScore && !st.top10Pct && !st.bubblemapConnectivity) return '';+ return `+ <div class="dr-sec">Structure <span style="color:var(--faint);font-weight:400;font-size:10px">wallet graph · buy pattern</span></div>+ <div class="str-grid">+ <div class="str-row"><span class="str-lbl">Organic buy</span>${bar(organic, 'var(--up)')}<span class="str-val" style="color:var(--up)">${pct(organic)}</span></div>+ <div class="str-row"><span class="str-lbl">Bundle / coord</span>${bar(bundle, bundleFl ? 'var(--down)' : 'var(--amber)')}<span class="str-val" style="color:${bundleFl ? 'var(--down)' : 'var(--amber)'}">${pct(bundle)}${bundleFl ? ' ⚑' : ''}</span></div>+ ${top10 ? `<div class="str-row"><span class="str-lbl">Top 10 hold</span>${bar(top10, top10 > 60 ? 'var(--down)' : 'var(--gold)')}<span class="str-val" style="color:${top10 > 60 ? 'var(--down)' : 'var(--gold)'}">${pct(top10)}</span></div>` : ''}+ ${connect ? `<div class="str-row"><span class="str-lbl">Graph density</span>${bar(connect, connect > 50 ? 'var(--down)' : 'var(--muted)')}<span class="str-val" style="color:${connect > 50 ? 'var(--down)' : 'var(--muted)'}">${pct(connect)}</span></div>` : ''}+ </div>+ <div class="coin-meta" style="margin-top:10px">+ ${buyers !== '—' ? `<span class="chip">buyers <b>${buyers}</b></span>` : ''}+ ${devBuy !== '—' ? `<span class="chip ${devSold > 50 ? 'flag' : ''}">dev hold <b>${devBuy}</b>${devSold > 20 ? ` · sold ${Math.round(devSold)}%` : ''}</span>` : ''}+ </div>`;+ }++ function whoRow(w) {+ const title = ARCH_TITLE[w.label] || 'Unproven';+ const sub = [+ w.is_creator ? 'creator' : null,+ w.tag ? `@${w.tag}` : null,+ w.source === 'gmgn' ? 'gmgn-known' : (w.score != null ? `rep ${Math.round(w.score)}` : null),+ w.win_rate != null ? `${Math.round(w.win_rate)}% win` : null,+ ].filter(Boolean).join(' · ');+ return `<div class="nwallet">+ <div class="nw-left">+ <span class="nw-addr"><span class="nlabel lb-${esc(w.label)}">${esc(title)}</span><a class="solscan" href="${solscan(w.wallet)}" target="_blank" rel="noopener">${esc(shortAddr(w.wallet))}</a></span>+ <span class="nw-sub">${esc(sub || '—')}</span>+ </div>+ <span class="nw-buy">${fmtSol(w.buy_sol)}</span>+ </div>`;+ }++ // ── live market intel (ported from renderMarket) ───────────────────────────+ const statTile = (label, value, sub = '') => `<div class="mkt-tile"><span class="mkt-tile-lbl">${esc(label)}</span><span class="mkt-tile-val">${value}</span>${sub ? `<span class="mkt-tile-sub">${sub}</span>` : ''}</div>`;+ const changeChip = (label, n) => { const c = changeStr(n); return `<span class="mkt-chg mkt-${c.cls}"><span class="mkt-chg-lbl">${esc(label)}</span><b>${c.txt}</b></span>`; };+ function secChip(ok, label, warnLabel = null) {+ if (ok == null) return `<span class="chip" title="not measured">${esc(label)} <b>?</b></span>`;+ return ok ? `<span class="chip sm" title="safe">✓ ${esc(label)}</span>` : `<span class="chip flag" title="risk">⚠ ${esc(warnLabel || label)}</span>`;+ }++ function renderMarket(m) {+ const p = m.price || {}, ch = p.change || {};+ const changeH24 = changeStr(ch.h24);+ const tiles = [+ statTile('Price', fmtPrice(p.usd), `<span class="mkt-${changeH24.cls}">${changeH24.txt} 24h</span>`),+ statTile('Market cap', fmtUsd(m.market_cap_usd)),+ m.fdv_usd != null && m.fdv_usd !== m.market_cap_usd ? statTile('FDV', fmtUsd(m.fdv_usd)) : '',+ statTile('Liquidity', fmtUsd(m.liquidity_usd)),+ statTile('24h volume', fmtUsd(m.volume?.h24)),+ statTile('Holders', fmtInt(m.holders)),+ ].filter(Boolean).join('');++ const changeWins = [['5m', ch.m5], ['1h', ch.h1], ['6h', ch.h6], ['24h', ch.h24], ['7d', ch.d7]].filter(([, v]) => v != null);+ const changeRow = changeWins.length ? `<div class="mkt-chg-row">${changeWins.map(([l, v]) => changeChip(l, v)).join('')}</div>` : '';++ const pf = m.pumpfun;+ let curveHtml = '';+ if (pf?.is_pump) {+ if (pf.graduated || pf.complete) {+ curveHtml = `<div class="mkt-row"><span class="chip sm">Graduated to DEX ✓</span>${pf.ath_market_cap_usd ? `<span class="chip">ATH mcap <b>${fmtUsd(pf.ath_market_cap_usd)}</b></span>` : ''}</div>`;+ } else if (pf.bonding_curve_pct != null) {+ const pct = Math.round(pf.bonding_curve_pct);+ curveHtml = `<div class="mkt-curve">+ <div class="mkt-curve-top"><span>Bonding curve</span><b>${pct}% to graduation</b></div>+ <div class="mkt-curve-track"><div class="mkt-curve-fill" style="width:${Math.max(2, Math.min(100, pct))}%"></div></div>+ ${pf.real_sol_reserves != null ? `<div class="mkt-curve-sub">${pf.real_sol_reserves.toFixed(1)} ◎ in curve${pf.reply_count ? ` · ${fmtInt(pf.reply_count)} replies` : ''}${pf.is_live ? ' · <span class="mkt-up">live now</span>' : ''}</div>` : ''}+ </div>`;+ }+ }++ const act = m.activity;+ let activityHtml = '';+ if (act && act.txns_24h) {+ const buyPct = Math.round((act.buy_ratio ?? 0.5) * 100);+ activityHtml = `<div class="mkt-act">+ <div class="mkt-act-top"><span>24h activity</span><span class="mkt-faint">${fmtInt(act.txns_24h)} txns</span></div>+ <div class="mkt-act-track"><div class="mkt-act-buy" style="width:${buyPct}%"></div></div>+ <div class="mkt-act-legend"><span class="mkt-up">${fmtInt(act.buys_24h)} buys</span><span class="mkt-down">${fmtInt(act.sells_24h)} sells</span></div>+ </div>`;+ }++ const sup = m.supply || {};+ const supplyChips = [+ sup.total != null ? `<span class="chip">supply <b>${fmtInt(sup.total)}</b></span>` : '',+ sup.circulating != null && Math.abs((sup.circulating || 0) - (sup.total || 0)) > (sup.total || 0) * 0.01 ? `<span class="chip">circulating <b>${fmtInt(sup.circulating)}</b></span>` : '',+ m.identity?.created_at ? `<span class="chip" title="First trade / launch">age <b>${ago(m.identity.created_at)}</b></span>` : '',+ ].filter(Boolean).join('');++ const sec = m.security;+ const secHtml = sec ? `<div class="dr-sec">Security <span style="color:var(--faint);font-weight:400;font-size:10px">GoPlus</span></div>+ <div class="coin-meta">+ ${secChip(sec.mint_authority_revoked, 'Mint revoked', 'Mint authority live')}+ ${secChip(sec.freeze_authority_revoked, 'Freeze revoked', 'Can freeze')}+ ${secChip(sec.metadata_mutable === false ? true : (sec.metadata_mutable === true ? false : null), 'Metadata locked', 'Mutable metadata')}+ ${sec.transfer_fee_pct != null ? (sec.transfer_fee_pct > 0 ? `<span class="chip flag" title="transfer tax">⚠ ${sec.transfer_fee_pct}% fee</span>` : `<span class="chip sm">No transfer fee</span>`) : ''}+ ${sec.top10_holder_pct != null ? `<span class="chip ${sec.top10_holder_pct > 50 ? 'flag' : ''}" title="Top 10 holder concentration">top 10 <b>${Math.round(sec.top10_holder_pct)}%</b></span>` : ''}+ ${sec.trusted_token ? '<span class="chip sm" title="GoPlus verified list">Trusted ✓</span>' : ''}+ </div>` : '';++ const lst = m.listing;+ let listingHtml = '';+ if (lst && (lst.market_cap_rank != null || lst.ath_usd != null || (lst.categories && lst.categories.length))) {+ const athChg = changeStr(lst.ath_change_pct);+ listingHtml = `<div class="dr-sec">Listed market <span style="color:var(--faint);font-weight:400;font-size:10px">CoinGecko</span></div>+ <div class="coin-meta">+ ${lst.market_cap_rank != null ? `<span class="chip">rank <b>#${lst.market_cap_rank}</b></span>` : ''}+ ${lst.ath_usd != null ? `<span class="chip" title="All-time high">ATH <b>${fmtPrice(lst.ath_usd)}</b> <span class="mkt-${athChg.cls}">${athChg.txt}</span></span>` : ''}+ ${lst.atl_usd != null ? `<span class="chip" title="All-time low">ATL <b>${fmtPrice(lst.atl_usd)}</b></span>` : ''}+ </div>+ ${lst.categories && lst.categories.length ? `<div class="coin-meta" style="margin-top:6px">${lst.categories.slice(0, 5).map((c) => `<span class="chip cat">${esc(c)}</span>`).join('')}</div>` : ''}`;+ }++ const pairs = Array.isArray(m.pairs) ? m.pairs.filter((pr) => pr.url) : [];+ const pairsHtml = pairs.length ? `<div class="dr-sec">Markets <span style="color:var(--faint);font-weight:400;font-size:10px">${pairs.length} pair${pairs.length > 1 ? 's' : ''}</span></div>+ <div class="mkt-pairs">${pairs.slice(0, 5).map((pr) => `+ <a class="mkt-pair" href="${esc(pr.url)}" target="_blank" rel="noopener">+ <span class="mkt-pair-dex">${esc(pr.dex || 'dex')}${pr.quote_symbol ? ` <span class="mkt-faint">/${esc(pr.quote_symbol)}</span>` : ''}</span>+ <span class="mkt-pair-liq">${fmtUsd(pr.liquidity_usd)} liq</span>+ <span class="mkt-pair-arrow">↗</span>+ </a>`).join('')}</div>` : '';++ const lk = m.links || {};+ const linkBtns = [+ lk.dexscreener ? `<a class="dr-act" href="${esc(lk.dexscreener)}" target="_blank" rel="noopener">DexScreener ↗</a>` : '',+ lk.geckoterminal ? `<a class="dr-act" href="${esc(lk.geckoterminal)}" target="_blank" rel="noopener">GeckoTerminal ↗</a>` : '',+ lk.birdeye ? `<a class="dr-act" href="${esc(lk.birdeye)}" target="_blank" rel="noopener">Birdeye ↗</a>` : '',+ lk.website ? `<a class="dr-act" href="${esc(lk.website)}" target="_blank" rel="noopener">Website ↗</a>` : '',+ lk.twitter ? `<a class="dr-act" href="${esc(lk.twitter)}" target="_blank" rel="noopener">X ↗</a>` : '',+ lk.telegram ? `<a class="dr-act" href="${esc(lk.telegram)}" target="_blank" rel="noopener">Telegram ↗</a>` : '',+ ].filter(Boolean).join('');++ const srcNote = Array.isArray(m.sources) && m.sources.length ? `<div class="mkt-src">Live · ${m.sources.map(esc).join(' · ')}</div>` : '';++ return `<div class="dr-sec">Market <span style="color:var(--faint);font-weight:400;font-size:10px">live${p.native_sol ? ` · ${p.native_sol < 0.0001 ? p.native_sol.toExponential(2) : p.native_sol.toFixed(6)} ◎` : ''}</span></div>+ <div class="mkt-stats">${tiles}</div>+ ${changeRow}${curveHtml}${activityHtml}+ ${supplyChips ? `<div class="coin-meta" style="margin-top:10px">${supplyChips}</div>` : ''}+ ${secHtml}${listingHtml}${pairsHtml}+ ${linkBtns ? `<div class="dr-actions" style="margin-top:12px">${linkBtns}</div>` : ''}+ ${srcNote}`;+ }++ function renderSparkline(points, trend) {+ const W = 220, H = 40, PAD = 4;+ const scores = points.map((p) => Number(p.score));+ const min = Math.max(0, Math.min(...scores) - 5);+ const max = Math.min(100, Math.max(...scores) + 5);+ const range = max - min || 1;+ const n = scores.length;+ const xs = scores.map((_, i) => PAD + (i / (n - 1)) * (W - PAD * 2));+ const ys = scores.map((s) => PAD + (1 - (s - min) / range) * (H - PAD * 2));+ const trendColor = trend === 'rising' ? '#e4e8f2' : trend === 'falling' ? '#6c7280' : '#8a92a8';+ const trendArrow = trend === 'rising' ? '↑' : trend === 'falling' ? '↓' : '→';+ const delta = scores[n - 1] - scores[0];+ const deltaStr = delta > 0 ? `+${delta}` : `${delta}`;+ return `<div style="display:flex;align-items:center;gap:8px;padding:8px 0 4px">+ <svg width="${W}" height="${H}" viewBox="0 0 ${W} ${H}" style="flex-shrink:0;overflow:visible" aria-label="Conviction history">+ <polyline points="${xs.map((x, i) => `${x.toFixed(1)},${ys[i].toFixed(1)}`).join(' ')}" fill="none" stroke="${trendColor}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.9"/>+ <circle cx="${xs[n - 1].toFixed(1)}" cy="${ys[n - 1].toFixed(1)}" r="2.5" fill="${trendColor}"/>+ </svg>+ <div style="font-size:11px;line-height:1.4;flex-shrink:0">+ <div style="color:${trendColor};font-weight:700;letter-spacing:.02em">${trendArrow} ${deltaStr} pts</div>+ <div style="color:var(--muted)">${points.length} readings · 48 h</div>+ </div>+ </div>`;+ }++ // ── section loaders ────────────────────────────────────────────────────────+ async function loadHistory(mint) {+ const wrap = $('#ocHistory');+ if (!wrap) return;+ const { ok, data } = await api(`/api/oracle/history?mint=${encodeURIComponent(mint)}&network=${NETWORK}&hours=48`);+ if (!ok || !data?.points?.length || data.points.length < 2) { wrap.innerHTML = ''; return; }+ wrap.innerHTML = `<div class="dr-sec">Conviction history</div>${renderSparkline(data.points, data.trend)}`;+ }++ async function loadMarket(mint) {+ const wrap = $('#ocMarket');+ if (!wrap) return;+ const { ok, status, data } = await api(`/api/oracle/market?mint=${encodeURIComponent(mint)}&network=${NETWORK}`, { timeout: 15000 });+ wrap.classList.remove('mkt-loading');+ wrap.removeAttribute('aria-busy');+ if (!ok || !data || data.price?.usd == null) {+ wrap.innerHTML = status === 404+ ? `<div class="dr-sec">Market</div><div class="state" style="padding:20px 0">No live market yet — this mint hasn't started trading. Price, liquidity and holders appear the moment it does.</div>`+ : `<div class="dr-sec">Market</div><div class="state" style="padding:20px 0">Live market data is momentarily unavailable. <button type="button" class="dr-act" id="ocMktRetry">Retry</button></div>`;+ const retry = $('#ocMktRetry');+ if (retry) retry.addEventListener('click', () => { wrap.classList.add('mkt-loading'); wrap.setAttribute('aria-busy', 'true'); loadMarket(mint); });+ return;+ }+ wrap.innerHTML = renderMarket(data);+ }++ async function loadSentiment(mint) {+ const wrap = $('#ocPulse');+ if (!wrap) return;+ try {+ const res = await fetch('/api/social/sentiment-pulse', {+ method: 'POST', headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ token: mint }), signal: AbortSignal.timeout(10000),+ });+ if (!res.ok) { wrap.innerHTML = ''; return; }+ const d = await res.json();+ if (!d.ok || !d.overall || d.overall.count < 3) { wrap.innerHTML = ''; return; }+ const o = d.overall;+ const scoreColor = o.score >= 60 ? 'var(--up)' : o.score <= 40 ? 'var(--down)' : 'var(--muted)';+ const sentLabel = o.score >= 60 ? 'bullish' : o.score <= 40 ? 'bearish' : 'mixed';+ const sentChipCls = o.score >= 60 ? 'sm' : o.score <= 40 ? 'flag' : '';+ const exHtml = (o.examples || []).slice(0, 2).map((ex) => `<div class="reason" style="font-size:11.5px;opacity:.75"><span class="rdot narrative"></span><span>${esc(ex)}</span></div>`).join('');+ wrap.innerHTML = `+ <div class="dr-sec">Community pulse <span style="color:var(--faint);font-weight:400;font-size:10px">pump.fun · ${o.count} comments</span></div>+ <div class="coin-meta" style="margin-bottom:8px"><span class="chip ${sentChipCls}" style="color:${scoreColor}">${sentLabel} · ${o.score}</span></div>+ <div class="str-grid">+ <div class="str-row"><span class="str-lbl">Positive</span><div class="str-track"><div class="str-fill" style="width:${Math.round(o.posPct)}%;background:var(--up)"></div></div><span class="str-val" style="color:var(--up)">${Math.round(o.posPct)}%</span></div>+ <div class="str-row"><span class="str-lbl">Negative</span><div class="str-track"><div class="str-fill" style="width:${Math.round(o.negPct)}%;background:var(--down)"></div></div><span class="str-val" style="color:var(--down)">${Math.round(o.negPct)}%</span></div>+ <div class="str-row"><span class="str-lbl">Neutral</span><div class="str-track"><div class="str-fill" style="width:${Math.round(o.neuPct)}%;background:var(--muted)"></div></div><span class="str-val" style="color:var(--muted)">${Math.round(o.neuPct)}%</span></div>+ </div>${exHtml}`;+ } catch { wrap.innerHTML = ''; }+ }++ async function loadProofTrades(mint) {+ const wrap = $('#ocProof');+ if (!wrap) return;+ try {+ const r = await fetch(`/api/trades/feed?mint=${encodeURIComponent(mint)}&min_pnl_pct=0&limit=8`, { signal: AbortSignal.timeout(10000) });+ if (!r.ok) return;+ const { items = [] } = await r.json();+ if (!items.length) { wrap.innerHTML = ''; return; }+ const rows = items.map((t) => {+ const agent = esc(t.agent_name || t.agent_id?.slice(0, 8) || 'Agent');+ const mult = t.multiple != null ? `${t.multiple.toFixed(2)}×` : null;+ const pct = t.realized_pnl_pct != null ? `+${Math.round(t.realized_pnl_pct)}%` : null;+ const pnlSol = t.realized_pnl_sol != null ? `+${t.realized_pnl_sol.toFixed(3)} ◎` : null;+ const isPos = (t.realized_pnl_sol ?? 0) >= 0;+ const color = isPos ? 'var(--up)' : 'var(--down)';+ return `<div class="dr-ptrade">+ <span class="dr-ptrade-mult" style="color:${color}">${mult || pct || pnlSol || '+?'}</span>+ <div class="dr-ptrade-mid"><span class="dr-ptrade-agent">${agent}</span>${pnlSol ? `<span style="color:${color};font-size:11px">${pnlSol}</span>` : ''}</div>+ <a class="dr-act" href="/trader/${encodeURIComponent(t.agent_id || '')}" style="font-size:11.5px">Copy →</a>+ </div>`;+ }).join('');+ wrap.innerHTML = `<div class="dr-sec">Agent exits on this coin <span style="color:var(--faint);font-weight:400;font-size:10px">${items.length} found</span></div>+ <div style="display:flex;flex-direction:column;gap:4px">${rows}</div>`;+ } catch { /* non-fatal */ }+ }++ async function loadRelated(mint, category, onOpen) {+ const wrap = $('#ocRelated');+ if (!wrap || !category) return;+ const { ok, data } = await api(`/api/oracle/feed?network=${NETWORK}&category=${encodeURIComponent(category)}&limit=6&min_score=60`);+ if (!ok || !data?.items?.length) return;+ const related = data.items.filter((it) => it.mint !== mint).slice(0, 3);+ if (!related.length) return;+ wrap.innerHTML = `<div class="dr-sec">Related · ${esc(category)}</div>+ <div style="display:flex;flex-direction:column;gap:6px">+ ${related.map((r) => {+ const imgEl = r.image_uri+ ? `<img src="${esc(r.image_uri)}" alt="" style="width:28px;height:28px;border-radius:7px;object-fit:cover;flex:none;border:1px solid var(--line)" loading="lazy">`+ : `<div style="width:28px;height:28px;border-radius:7px;background:var(--line);display:grid;place-items:center;font:700 11px/1 var(--mono);color:var(--faint);flex:none">${esc((r.symbol || '?')[0])}</div>`;+ return `<a class="dr-related" href="/oracle/coin/${encodeURIComponent(r.mint)}" data-related-mint="${esc(r.mint)}">+ ${imgEl}+ <span style="flex:1;min-width:0">+ <span style="font-weight:700;font-size:13px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${esc(r.symbol || r.mint.slice(0, 8))}</span>+ <span style="font-size:11px;color:var(--muted)">${esc(r.name || '')}</span>+ </span>+ <span style="display:flex;flex-direction:column;align-items:flex-end;flex:none">+ <span style="font:700 14px/1 var(--mono);color:var(--ink)">${r.score}</span>+ <span class="tierpill tp-${esc(r.tier)}" style="margin-top:3px;padding:1px 5px;font-size:9px">${esc(r.tier)}</span>+ </span>+ </a>`;+ }).join('')}+ </div>`;+ wrap.querySelectorAll('.dr-related').forEach((el) => el.addEventListener('click', (e) => {+ // Same-page navigation without a reload for a snappier feel; falls back to href.+ if (e.metaKey || e.ctrlKey || e.shiftKey) return;+ e.preventDefault();+ onOpen(el.dataset.relatedMint);+ }));+ }++ // ── live trade tape (ported from src/oracle-tape.js) ───────────────────────+ function mountTape(container, mint) {+ container.innerHTML = `<div class="tape-header"><span class="tape-dot"></span><span class="tape-status" id="ocTapeStatus">Connecting…</span><span class="tape-ct" id="ocTapeCt"></span></div><div class="tape-list" id="ocTapeList"></div>`;+ const statusEl = container.querySelector('#ocTapeStatus');+ const ctEl = container.querySelector('#ocTapeCt');+ const listEl = container.querySelector('#ocTapeList');+ let tradeCount = 0, es = null, active = true, reconnectTimer = null;+ const MAX_ROWS = 60, DELAY = 2000;++ const setStatus = (text, live = false) => { statusEl.textContent = text; container.querySelector('.tape-dot')?.classList.toggle('live', live); };++ function addRow(trade) {+ tradeCount++; ctEl.textContent = tradeCount;+ const isBuy = trade.is_buy;+ const title = ARCH_TITLE[trade.label] || null;+ const tag = trade.tag ? `@${esc(trade.tag)}` : '';+ const row = document.createElement('div');+ row.className = `tape-row ${isBuy ? 'buy' : 'sell'}`;+ row.innerHTML = `+ <span class="tape-type">${isBuy ? '▲ BUY' : '▼ SELL'}</span>+ ${title ? `<span class="nlabel lb-${esc(trade.label)}">${esc(title)}</span>` : ''}+ ${tag ? `<span class="tape-tag">${tag}</span>` : ''}+ <span class="tape-addr">${esc(shortAddr(trade.wallet))}</span>+ <span class="tape-sol ${isBuy ? 'buy' : 'sell'}">${fmtSol(trade.sol)}</span>+ ${trade.mc_sol != null ? `<span class="tape-mc">${trade.mc_sol.toFixed(1)}◎ mc</span>` : ''}`;+ listEl.prepend(row);+ row.classList.add('flash');+ setTimeout(() => row.classList.remove('flash'), 600);+ const rows = listEl.querySelectorAll('.tape-row');+ if (rows.length > MAX_ROWS) rows[rows.length - 1].remove();+ }++ function open() {+ if (!active) return;+ es = new EventSource(`/api/oracle/trades?mint=${encodeURIComponent(mint)}&network=${encodeURIComponent(NETWORK)}`);+ es.addEventListener('hello', (e) => { const d = JSON.parse(e.data || '{}'); setStatus('Live trades', true); if (d.roster_size) statusEl.title = `${d.roster_size} wallets annotated`; });+ es.addEventListener('trade', (e) => { let t; try { t = JSON.parse(e.data); } catch { return; } addRow(t); });+ es.addEventListener('ping', () => {});+ es.addEventListener('bye', () => { es.close(); if (active) reconnectTimer = setTimeout(open, DELAY); });+ es.onerror = () => { setStatus('Reconnecting…', false); es.close(); if (active) reconnectTimer = setTimeout(open, DELAY * 2); };+ }+ open();+ return { destroy() { active = false; clearTimeout(reconnectTimer); try { es?.close(); } catch {} container.innerHTML = ''; } };+ }++ // ── wire hero buttons (server-rendered) ────────────────────────────────────+ function wireHero(mint) {+ const watchBtn = $('#ocWatch');+ if (watchBtn) {+ const sync = () => { const on = watchedMints().has(mint); watchBtn.textContent = on ? '★ Watching' : '☆ Watch'; watchBtn.setAttribute('aria-pressed', String(on)); };+ sync();+ watchBtn.addEventListener('click', () => { toggleWatch(mint); sync(); });+ }+ const copyMint = $('#ocCopyMint');+ if (copyMint) copyMint.addEventListener('click', () => {+ navigator.clipboard.writeText(mint).then(() => { const o = copyMint.textContent; copyMint.textContent = 'Copied!'; setTimeout(() => { copyMint.textContent = o; }, 1600); }).catch(() => {});+ });+ const copyLink = $('#ocCopyLink');+ if (copyLink) copyLink.addEventListener('click', () => {+ navigator.clipboard.writeText(`https://three.ws/oracle/coin/${mint}`).then(() => { const o = copyLink.textContent; copyLink.textContent = 'Copied!'; setTimeout(() => { copyLink.textContent = o; }, 1600); }).catch(() => {});+ });+ }++ // ── main ───────────────────────────────────────────────────────────────────+ function mintFromPath() {+ const m = location.pathname.match(/\/oracle\/coin\/([1-9A-HJ-NP-Za-km-z]{32,44})/);+ if (m) return m[1];+ const q = new URLSearchParams(location.search).get('mint');+ return q && MINT_RE.test(q) ? q : null;+ }++ async function render(mint) {+ const deep = $('#ocDeep');+ if (!deep) return;+ deep.innerHTML = '<div class="oc-spinner" aria-label="Loading conviction"></div>';+ const { ok, data } = await api(`/api/oracle/coin?mint=${encodeURIComponent(mint)}&network=${NETWORK}`, { timeout: 20000 });+ if (!ok || !data || !data.conviction) {+ deep.innerHTML = `<div class="state"><b>This launch hasn't been scored yet</b>Oracle scores coins as they surface on pump.fun. If it's brand new, it'll appear here within moments. <button type="button" class="dr-act" id="ocRetry">Retry</button></div>`;+ $('#ocRetry')?.addEventListener('click', () => render(mint));+ return;+ }+ const c = data.conviction;+ document.title = `${c.symbol ? `$${c.symbol}` : mint.slice(0, 8)} — ${c.score}/100 ${c.tier || ''} conviction · Oracle · three.ws`;++ const reasons = (data.reasons || []).map((r) => `<div class="reason"><span class="rdot ${esc(r.pillar)}"></span><span>${esc(r.text)}</span></div>`).join('') || '<div class="state" style="padding:20px 0">No breakdown available.</div>';+ const narr = data.narrative;+ const whos = (data.whos_in || []).map(whoRow).join('') || '<div class="state" style="padding:20px 0">No wallet footprint recorded yet.</div>';+ const out = data.outcome;+ const comp = data.components || {};++ deep.innerHTML = `+ ${drawerTake(data)}+ <div id="ocHistory"></div>+ <div class="oc-cols">+ <div>+ <div class="dr-sec">Why this score</div>${reasons}+ ${narr ? `<div class="dr-sec">Narrative</div><div style="font-size:13.5px;color:var(--ink)">${esc(narr.narrative || '')}</div>+ <div class="coin-meta" style="margin-top:8px"><span class="chip cat">${esc(narr.category)}</span><span class="chip">virality <b>${narr.virality ?? '—'}</b></span><span class="chip">${esc(narr.source || '')}</span></div>` : ''}+ <div id="ocPulse"></div>+ ${structurePanel(comp.structure)}+ ${out ? `<div class="dr-sec">Outcome</div><div class="coin-meta">+ <span class="chip ${out.graduated ? 'sm' : out.rugged ? 'flag' : ''}">${out.graduated ? 'graduated ✓' : out.rugged ? 'rugged ✕' : 'live'}</span>+ ${out.ath_multiple ? `<span class="chip">ATH <b>${Number(out.ath_multiple).toFixed(1)}×</b></span>` : ''}</div>` : ''}+ <div class="dr-sec">Who's in <span style="color:var(--faint)">(${(data.whos_in || []).length})</span></div>${whos}+ <div id="ocProof"></div>+ </div>+ <div>+ <div id="ocMarket" class="mkt-loading" aria-busy="true">+ <div class="dr-sec">Market <span style="color:var(--faint);font-weight:400;font-size:10px">live</span></div>+ <div class="mkt-skel"><span></span><span></span><span></span><span></span><span></span><span></span></div>+ </div>+ <div class="dr-sec">Live trades</div>+ <div id="ocTape" class="trade-tape"></div>+ <div id="ocRelated"></div>+ </div>+ </div>`;++ loadHistory(mint);+ loadMarket(mint);+ loadSentiment(mint);+ loadProofTrades(mint);+ loadRelated(mint, c.category, openMint);++ if (window.__ocTape) { try { window.__ocTape.destroy(); } catch {} }+ const tapeEl = $('#ocTape');+ if (tapeEl) window.__ocTape = mountTape(tapeEl, mint);+ }++ function openMint(mint) {+ if (!mint || !MINT_RE.test(mint)) return;+ history.pushState(null, '', `/oracle/coin/${mint}`);+ wireHeroForSwap(mint);+ render(mint);+ window.scrollTo({ top: 0, behavior: 'smooth' });+ }++ // When navigating between coins in-page, the SSR hero is stale — the deep+ // section already re-renders with fresh data, so hide the now-mismatched hero+ // and let the deep view lead. (Direct loads always get the correct SSR hero.)+ function wireHeroForSwap(mint) {+ const hero = $('#ocHeroDynamic');+ if (hero) hero.style.display = 'none';+ }++ function boot() {+ const mint = mintFromPath();+ if (!mint) { location.replace('/oracle'); return; }+ wireHero(mint);+ render(mint);+ window.addEventListener('popstate', () => {+ const m = mintFromPath();+ if (m) { location.reload(); }+ });+ }++ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);+ else boot();+})();diff --git a/src/oracle.js b/src/oracle.jsindex 8663dacbe..e692dfa50 100644--- a/src/oracle.js+++ b/src/oracle.js@@ -1666,6 +1666,7 @@ function renderDrawer(d) {</div>${drawerTake(d)}<div class="dr-actions">+ <a class="dr-act" href="/oracle/coin/${encodeURIComponent(c.mint)}" title="Open the full conviction page">Full page ↗</a><a class="dr-act" href="${pumpUrl(c.mint)}" target="_blank" rel="noopener">pump.fun ↗</a><a class="dr-act" href="${solscan(c.mint)}" target="_blank" rel="noopener">solscan ↗</a><a class="dr-act" href="/launches/${esc(c.mint)}" target="_blank" rel="noopener">Details ↗</a>