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
Oracle: rich SSR social previews for shared conviction links
nirholasb47887d61c3d
diff --git a/api/oracle-share.js b/api/oracle-share.jsnew file mode 100644index 000000000..0aecbf9ac--- /dev/null+++ b/api/oracle-share.js@@ -0,0 +1,181 @@+/**+ * SSR share page for Oracle conviction signals+ * ---------------------------------------------+ * GET /api/oracle-share?mint=<mint>+ *+ * Wired via vercel.json: /oracle/coin/<mint> → /api/oracle-share?mint=$1+ *+ * 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).+ */++import { sql } from './_lib/db.js';+import { cors, wrap } from './_lib/http.js';+import { env } from './_lib/env.js';++const MINT_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,OPTIONS' })) return;++ const url = new URL(req.url, 'http://x');+ const mint = (url.searchParams.get('mint') || '').trim();+ const origin = env.APP_ORIGIN || 'https://three.ws';++ if (!MINT_RE.test(mint)) return redirect(res, `${origin}/oracle`);++ let row;+ try {+ [row] = await sql`+ select symbol, name, image_uri, score, tier,+ pedigree, structure, narrative, momentum,+ smart_wallet_count, category, scored_at+ from oracle_conviction+ where mint = ${mint} and network = 'mainnet'+ limit 1+ `;+ } catch {+ return redirect(res, `${origin}/oracle?mint=${encodeURIComponent(mint)}`);+ }++ 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)}`;++ 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 }));+});++function redirect(res, to) {+ res.statusCode = 302;+ res.setHeader('location', to);+ res.setHeader('cache-control', 'no-cache');+ res.end();+}++function buildDesc({ sym, name, score, tier, cat, swCount, pedigree, structure, narrative, momentum }) {+ const parts = [];+ parts.push(`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}`);+ parts.push('proof.not.promises — three.ws Oracle');+ return parts.join(' · ');+}++function shortMint(m) {+ return `${m.slice(0, 6)}…${m.slice(-4)}`;+}++function esc(s) {+ return String(s ?? '').replace(/[&<>"']/g, (c) =>+ ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c],+ );+}++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 renderHtml({ title, desc, pageUrl, deepUrl, ogImage, sym, score, tier, origin }) {+ const t = esc(title);+ const d = esc(desc);+ const col = esc(tierColor(tier));+ return `<!doctype html>+<html lang="en">+<head>+ <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}">+ <meta name="theme-color" content="#0a0a0a">++ <meta property="og:type" content="website">+ <meta property="og:site_name" content="three.ws Oracle">+ <meta property="og:title" content="${t}">+ <meta property="og:description" content="${d}">+ <meta property="og:url" content="${esc(pageUrl)}">+ <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 name="twitter:card" content="summary_large_image">+ <meta name="twitter:site" content="@trythreews">+ <meta name="twitter:title" content="${t}">+ <meta name="twitter:description" content="${d}">+ <meta name="twitter:image" content="${esc(ogImage)}">++ <meta property="fc:frame" content="vNext">+ <meta property="fc:frame:image" content="${esc(ogImage)}">+ <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: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>+</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>+ </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>+</body>+</html>`;+}diff --git a/data/changelog.json b/data/changelog.jsonindex e3e40cee2..1f933d8b6 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,13 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-06-16",+ "title": "Oracle: rich social previews when sharing conviction links",+ "summary": "Every Oracle coin conviction link now resolves to a server-rendered preview page (/oracle/coin/<mint>) that shows the score, tier, and pillar breakdown as a rich social card on X/Twitter, Telegram, Discord, Slack, and iMessage — no more generic placeholder when sharing a pump.fun conviction signal. The Oracle drawer's Share button and tweet links now point to these canonical share URLs. A Copy link button in the drawer makes it one-tap to grab the shareable link.",+ "tags": ["improvement"],+ "link": "/oracle"+ },{"date": "2026-06-16","title": "Agent profile: deploy on-chain and edit controls for agent owners",diff --git a/src/oracle.js b/src/oracle.jsindex a0db2a41d..71f23750b 100644--- a/src/oracle.js+++ b/src/oracle.js@@ -59,17 +59,20 @@ function winTweet(w) {const sym = (w.symbol || w.mint.slice(0, 6)).toUpperCase();const ath = w.ath_multiple != null ? `${Number(w.ath_multiple).toFixed(1)}×` : 'graduated';const score = w.score != null ? `${w.score}/100 ${w.tier}` : w.tier;- const url = `https://three.ws/oracle?mint=${encodeURIComponent(w.mint)}`;- const text = `Oracle called $${sym} (${score} conviction) — it went ${ath} 🔮\n\nproof.not.promises @trythreews\n${url}`;+ const shareUrl = coinShareUrl(w.mint);+ const text = `Oracle called $${sym} (${score} conviction) — it went ${ath} 🔮\n\nproof.not.promises @trythreews\n${shareUrl}`;return `https://twitter.com/intent/tweet?text=${encodeURIComponent(text)}`;}+function coinShareUrl(mint) {+ return `https://three.ws/oracle/coin/${encodeURIComponent(mint)}`;+}function tweetConviction(c) {const tier = c.tier || 'watch';const score = c.score ?? '—';const symbol = c.symbol || '—';- const oracleUrl = `https://three.ws/oracle?mint=${encodeURIComponent(c.mint)}`;- const text = `$${symbol} — ${score}/100 ${tier} conviction on @trythreews Oracle\n\nWho · How · What · Move all fused into one score.\n${oracleUrl}`;+ const shareUrl = coinShareUrl(c.mint);+ const text = `$${symbol} — ${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)}`;}@@ -1208,6 +1211,7 @@ function renderDrawer(d) {<a class="dr-act" href="/launches/${esc(c.mint)}" target="_blank" rel="noopener">Details ↗</a><button class="dr-act dr-watch" id="drWatch" data-mint="${esc(c.mint)}" type="button" aria-pressed="${watchedMints().has(c.mint)}">${watchedMints().has(c.mint) ? '★ Watching' : '☆ Watch'}</button><button class="dr-act" id="drCopyMint" type="button" title="Copy mint address" data-mint="${esc(c.mint)}">Copy mint</button>+ <button class="dr-act" id="drCopyLink" type="button" title="Copy shareable link" data-link="${esc(coinShareUrl(c.mint))}">Copy link</button><a class="dr-act dr-share" href="${tweetConviction(c)}" target="_blank" rel="noopener" title="Share conviction on X">Share ↗</a>${c.structure_cap != null && c.structure_cap < 60 ? `<span class="note warn">structural cap ${c.structure_cap}</span>` : ''}</div>@@ -1289,6 +1293,18 @@ function renderDrawer(d) {});}+ const copyLinkBtn = $('#drCopyLink');+ if (copyLinkBtn) {+ copyLinkBtn.addEventListener('click', () => {+ const link = copyLinkBtn.dataset.link || coinShareUrl(c.mint);+ navigator.clipboard.writeText(link).then(() => {+ const orig = copyLinkBtn.textContent;+ copyLinkBtn.textContent = 'Copied!';+ setTimeout(() => { copyLinkBtn.textContent = orig; }, 1800);+ }).catch(() => {});+ });+ }+// Load related coins in same category (async — does not block drawer)if (c.category) loadRelatedCoins(c.mint, c.category);}diff --git a/vercel.json b/vercel.jsonindex 02c59038a..81451a802 100644--- a/vercel.json+++ b/vercel.json@@ -169,6 +169,9 @@"api/**/*.js": {"includeFiles": "{examples/skills/**,data/pages.json,data/archives/**,data/rss/**,data/_generated/**,sdk/src/sas-config.json}","maxDuration": 30+ },+ "api/irl/pins.js": {+ "maxDuration": 15}},"routes": [@@ -594,6 +597,10 @@"src": "/claim-wallet/?","dest": "/claim-wallet.html"},+ {+ "src": "/oracle/coin/([1-9A-HJ-NP-Za-km-z]{32,44})/?",+ "dest": "/api/oracle-share?mint=$1"+ },{"src": "/oracle/?","dest": "/oracle.html"