Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

refactor(routes): use canonical clean URLs across JS, pages, and api redirects

nirholas2071392cf490
diff --git a/api/auth/x/[action].js b/api/auth/x/[action].js
index 355874d71..606cecac8 100644
--- a/api/auth/x/[action].js
+++ b/api/auth/x/[action].js
@@ -169,13 +169,13 @@ async function handleCallback(req, res) {
const { codeVerifier, userId, agentId: stateAgentId } = stateData;
const successRedirect = stateAgentId
- ? `/agent-edit.html?id=${encodeURIComponent(stateAgentId)}&tab=social&x=connected`
+ ? `/agent/${encodeURIComponent(stateAgentId)}/edit?tab=social&x=connected`
: `/settings?tab=connected-accounts&x=connected`;
const errorRedirect = stateAgentId
- ? `/agent-edit.html?id=${encodeURIComponent(stateAgentId)}&tab=social&x=error`
+ ? `/agent/${encodeURIComponent(stateAgentId)}/edit?tab=social&x=error`
: `/settings?tab=connected-accounts&x=error`;
const deniedRedirect = stateAgentId
- ? `/agent-edit.html?id=${encodeURIComponent(stateAgentId)}&tab=social&x=denied`
+ ? `/agent/${encodeURIComponent(stateAgentId)}/edit?tab=social&x=denied`
: `/settings?tab=connected-accounts&x=denied`;
if (url.searchParams.get('error')) return redirect(res, deniedRedirect);
diff --git a/pages/a-edit.html b/pages/a-edit.html
index c490d28d4..4dae4f243 100644
--- a/pages/a-edit.html
+++ b/pages/a-edit.html
@@ -251,7 +251,7 @@
<script src="/nav.js"></script>
<header class="ce-page-header">
- <a id="back-link" href="/marketplace.html">← Back</a>
+ <a id="back-link" href="/marketplace">← Back</a>
</header>
<main>
diff --git a/pages/agent-detail.html b/pages/agent-detail.html
index bb7cf84b1..d2696a523 100644
--- a/pages/agent-detail.html
+++ b/pages/agent-detail.html
@@ -95,7 +95,7 @@
<nav class="ad-nav">
<a href="/">Home</a>
<a href="/leaderboard">Leaderboard</a>
- <a class="active" href="/marketplace.html">Agents <span class="ad-beta">BETA</span></a>
+ <a class="active" href="/marketplace">Agents <span class="ad-beta">BETA</span></a>
<a href="/spotlight">Apply for Spotlight</a>
<a href="/developers">Developers</a>
<a href="/about">About</a>
diff --git a/pages/agent-edit.html b/pages/agent-edit.html
index 9ce68e75a..677702c53 100644
--- a/pages/agent-edit.html
+++ b/pages/agent-edit.html
@@ -1313,7 +1313,7 @@
<datalist id="skills-marketplace"></datalist>
<button class="btn-primary" id="skill-add-btn">Add</button>
</div>
- <p class="hint">Browse the marketplace for community skills: <a href="/marketplace.html" target="_blank" rel="noopener" style="color:#93c5fd">marketplace ›</a></p>
+ <p class="hint">Browse the marketplace for community skills: <a href="/marketplace" target="_blank" rel="noopener" style="color:#93c5fd">marketplace ›</a></p>
</div>
<div class="form-actions">
@@ -1591,7 +1591,7 @@
<div class="studio-tile-title">Avatar studio</div>
<div class="studio-tile-desc">Customize materials, animations, and metadata.</div>
</a>
- <a class="studio-tile" id="studio-marketplace" href="/marketplace.html" target="_blank" rel="noopener">
+ <a class="studio-tile" id="studio-marketplace" href="/marketplace" target="_blank" rel="noopener">
<div class="studio-tile-title">Marketplace</div>
<div class="studio-tile-desc">Browse and remix published agents.</div>
</a>
diff --git a/pages/agent-home.html b/pages/agent-home.html
index eb3529062..88c19c639 100644
--- a/pages/agent-home.html
+++ b/pages/agent-home.html
@@ -773,14 +773,14 @@
<a href="#main" class="skip-link">Skip to main content</a>
<header class="agent-page-header" style="justify-content: space-between">
<div style="display:inline-flex;align-items:center">
- <a href="/marketplace.html?tab=mine" aria-label="Back to three.ws home">
+ <a href="/marketplace?tab=mine" aria-label="Back to three.ws home">
<img src="/three.svg" alt="three.ws" class="agent-header-logo" />
</a>
<nav class="agent-header-nav" aria-label="Primary">
<a href="/discover">Discover</a>
<a href="/create">Create</a>
<a href="/studio">Studio</a>
- <a href="/playground.html">Playground</a>
+ <a href="/playground">Playground</a>
</nav>
</div>
<!-- BEGIN:AGENT_HOME_ORPHANS_DOM -->
@@ -1037,7 +1037,7 @@
<h4 class="h-footer-link-heading">Product</h4>
<a href="/create">Create</a>
<a href="/studio">Studio</a>
- <a href="/widgets.html">Widgets</a>
+ <a href="/widgets">Widgets</a>
<a href="/discover">Discover</a>
</div>
<div class="h-footer-link-col">
diff --git a/pages/features.html b/pages/features.html
index 3f05bee2d..7a6b24ae8 100644
--- a/pages/features.html
+++ b/pages/features.html
@@ -849,7 +849,7 @@
<h4 class="h-footer-link-heading">Product</h4>
<a href="/create">Create</a>
<a href="/studio">Studio</a>
- <a href="/widgets.html">Widgets</a>
+ <a href="/widgets">Widgets</a>
<a href="/discover">Discover</a>
</div>
<div class="h-footer-link-col">
diff --git a/pages/home.html b/pages/home.html
index d32ae5534..7e451d06f 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -66,7 +66,7 @@
<a href="#main-content" class="h-skip-link">Skip to main content</a>
<header>
<h1>
- <a href="/marketplace.html?tab=mine" aria-label="three.ws home"
+ <a href="/marketplace?tab=mine" aria-label="three.ws home"
><img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" /><span
class="wordmark-dot"
aria-hidden="true"
@@ -672,7 +672,7 @@
<h4 class="h-footer-link-heading">Product</h4>
<a href="/create">Create</a>
<a href="/studio">Studio</a>
- <a href="/widgets.html">Widgets</a>
+ <a href="/widgets">Widgets</a>
<a href="/discover">Discover</a>
</div>
<div class="h-footer-link-col">
diff --git a/pages/playground.html b/pages/playground.html
index d69f37daa..93a623d41 100644
--- a/pages/playground.html
+++ b/pages/playground.html
@@ -301,7 +301,7 @@
<a href="/discover">Discover</a>
<a href="/create">Create</a>
<a href="/studio">Studio</a>
- <a href="/playground.html">Playground</a>
+ <a href="/playground">Playground</a>
</nav>
</div>
</header>
diff --git a/pages/pump-dashboard.html b/pages/pump-dashboard.html
index 416450958..c488fb868 100644
--- a/pages/pump-dashboard.html
+++ b/pages/pump-dashboard.html
@@ -60,7 +60,7 @@
<ul class="nav-menu" role="menu" aria-label="Solana">
<li role="none"><a href="/pumpfun" role="menuitem"><span class="nav-mi-title">Pump.fun stream</span><span class="nav-mi-sub">Mint agent tokens</span></a></li>
<li role="none"><a href="/vanity-wallet" role="menuitem"><span class="nav-mi-title">Vanity wallet</span><span class="nav-mi-sub">Grind a Solana address</span></a></li>
- <li role="none"><a href="/pump-live.html" role="menuitem"><span class="nav-mi-title">Live launches</span><span class="nav-mi-sub">Real-time mint feed</span></a></li>
+ <li role="none"><a href="/pump-live" role="menuitem"><span class="nav-mi-title">Live launches</span><span class="nav-mi-sub">Real-time mint feed</span></a></li>
<li role="none"><a href="/pump-dashboard" role="menuitem" aria-current="page"><span class="nav-mi-title">Pump Dashboard</span><span class="nav-mi-sub">Watches · scanner · quotes</span></a></li>
<li role="none"><a href="/docs#solana" role="menuitem"><span class="nav-mi-title">Solana SDK</span><span class="nav-mi-sub">Attestations + agent-kit</span></a></li>
</ul>
@@ -74,7 +74,7 @@
<li role="none"><a href="/docs#embedding" role="menuitem"><span class="nav-mi-title">Embed docs</span><span class="nav-mi-sub">iframe + oEmbed</span></a></li>
</ul>
</li>
- <li class="nav-item" role="none"><a href="/marketplace.html" role="menuitem">Marketplace</a></li>
+ <li class="nav-item" role="none"><a href="/marketplace" role="menuitem">Marketplace</a></li>
<li class="nav-item" role="none"><a href="/chat" role="menuitem">Chat</a></li>
<li class="nav-item" role="none"><a href="/tutorials" role="menuitem">Tutorials</a></li>
<li class="nav-item" id="home-nav-my-agents-li" role="none" hidden>
diff --git a/pages/pump-live.html b/pages/pump-live.html
index f9933eeea..bc90de947 100644
--- a/pages/pump-live.html
+++ b/pages/pump-live.html
@@ -6,7 +6,7 @@
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>�</text></svg>">
<title>3D-Agent · PumpFun Live</title>
<meta name="description" content="Real-time stream of new PumpFun token launches on Solana, presented by a 3D Agent.">
-<link rel="canonical" href="/pump-live.html">
+<link rel="canonical" href="/pump-live">
<script type="importmap">
{
"imports": {
diff --git a/pages/tutorial.html b/pages/tutorial.html
index 2cf80be2a..d70bdb9ac 100644
--- a/pages/tutorial.html
+++ b/pages/tutorial.html
@@ -598,8 +598,8 @@
<li role="none"><a href="/vanity-wallet" role="menuitem"><span class="nav-mi-title">Vanity wallet</span><span class="nav-mi-sub">Grind a Solana address</span></a></li>
<li role="none"><a href="/eth-vanity" role="menuitem"><span class="nav-mi-title">ETH vanity (CREATE2)</span><span class="nav-mi-sub">Grind a smart-contract address</span></a></li>
<li role="none"><a href="/strategy-lab" role="menuitem"><span class="nav-mi-title">Strategy Lab</span><span class="nav-mi-sub">DCA + subscriptions</span></a></li>
- <li role="none"><a href="/pump-live.html" role="menuitem"><span class="nav-mi-title">Live launches</span><span class="nav-mi-sub">Real-time mint feed</span></a></li>
- <li role="none"><a href="/pump-dashboard.html" role="menuitem"><span class="nav-mi-title">Pump Dashboard</span><span class="nav-mi-sub">Watches · scanner · quotes</span></a></li>
+ <li role="none"><a href="/pump-live" role="menuitem"><span class="nav-mi-title">Live launches</span><span class="nav-mi-sub">Real-time mint feed</span></a></li>
+ <li role="none"><a href="/pump-dashboard" role="menuitem"><span class="nav-mi-title">Pump Dashboard</span><span class="nav-mi-sub">Watches · scanner · quotes</span></a></li>
<li role="none"><a href="/docs#solana" role="menuitem"><span class="nav-mi-title">Solana SDK</span><span class="nav-mi-sub">Attestations + agent-kit</span></a></li>
</ul>
</li>
@@ -614,7 +614,7 @@
<li role="none"><a href="/docs#web-component" role="menuitem"><span class="nav-mi-title">&lt;agent-3d&gt;</span><span class="nav-mi-sub">Web component reference</span></a></li>
</ul>
</li>
- <li class="nav-item" role="none"><a href="/marketplace.html" role="menuitem">Marketplace</a></li>
+ <li class="nav-item" role="none"><a href="/marketplace" role="menuitem">Marketplace</a></li>
<li class="nav-item" role="none"><a href="/chat" role="menuitem">Chat</a></li>
<li class="nav-item" role="none"><a href="/tutorials" role="menuitem" aria-current="page">Tutorials</a></li>
<li class="nav-item" id="home-nav-my-agents-li" role="none" hidden>
@@ -742,7 +742,7 @@
<h4 class="h-footer-link-heading">Product</h4>
<a href="/create">Create</a>
<a href="/studio">Studio</a>
- <a href="/widgets.html">Widgets</a>
+ <a href="/widgets">Widgets</a>
<a href="/discover">Discover</a>
</div>
<div class="h-footer-link-col">
diff --git a/pages/tutorials.html b/pages/tutorials.html
index d3bce80cb..e11da75b2 100644
--- a/pages/tutorials.html
+++ b/pages/tutorials.html
@@ -436,8 +436,8 @@
<li role="none"><a href="/vanity-wallet" role="menuitem"><span class="nav-mi-title">Vanity wallet</span><span class="nav-mi-sub">Grind a Solana address</span></a></li>
<li role="none"><a href="/eth-vanity" role="menuitem"><span class="nav-mi-title">ETH vanity (CREATE2)</span><span class="nav-mi-sub">Grind a smart-contract address</span></a></li>
<li role="none"><a href="/strategy-lab" role="menuitem"><span class="nav-mi-title">Strategy Lab</span><span class="nav-mi-sub">DCA + subscriptions</span></a></li>
- <li role="none"><a href="/pump-live.html" role="menuitem"><span class="nav-mi-title">Live launches</span><span class="nav-mi-sub">Real-time mint feed</span></a></li>
- <li role="none"><a href="/pump-dashboard.html" role="menuitem"><span class="nav-mi-title">Pump Dashboard</span><span class="nav-mi-sub">Watches · scanner · quotes</span></a></li>
+ <li role="none"><a href="/pump-live" role="menuitem"><span class="nav-mi-title">Live launches</span><span class="nav-mi-sub">Real-time mint feed</span></a></li>
+ <li role="none"><a href="/pump-dashboard" role="menuitem"><span class="nav-mi-title">Pump Dashboard</span><span class="nav-mi-sub">Watches · scanner · quotes</span></a></li>
<li role="none"><a href="/docs#solana" role="menuitem"><span class="nav-mi-title">Solana SDK</span><span class="nav-mi-sub">Attestations + agent-kit</span></a></li>
</ul>
</li>
@@ -452,7 +452,7 @@
<li role="none"><a href="/docs#web-component" role="menuitem"><span class="nav-mi-title">&lt;agent-3d&gt;</span><span class="nav-mi-sub">Web component reference</span></a></li>
</ul>
</li>
- <li class="nav-item" role="none"><a href="/marketplace.html" role="menuitem">Marketplace</a></li>
+ <li class="nav-item" role="none"><a href="/marketplace" role="menuitem">Marketplace</a></li>
<li class="nav-item" role="none"><a href="/chat" role="menuitem">Chat</a></li>
<li class="nav-item" role="none"><a href="/tutorials" role="menuitem" aria-current="page">Tutorials</a></li>
<li class="nav-item" id="home-nav-my-agents-li" role="none" hidden>
@@ -558,7 +558,7 @@
<h4 class="h-footer-link-heading">Product</h4>
<a href="/create">Create</a>
<a href="/studio">Studio</a>
- <a href="/widgets.html">Widgets</a>
+ <a href="/widgets">Widgets</a>
<a href="/discover">Discover</a>
</div>
<div class="h-footer-link-col">
diff --git a/public/dashboard/dashboard.js b/public/dashboard/dashboard.js
index e542817ca..e608d0bfd 100644
--- a/public/dashboard/dashboard.js
+++ b/public/dashboard/dashboard.js
@@ -329,7 +329,7 @@ function agentCard(a, onRemoved) {
<div class="footer">
<div class="actions">
<a class="btn sec" href="/agent/${agentIdEnc}" title="Open public agent page">Open</a>
- <a class="btn sec" href="/agent-edit.html?id=${agentIdEnc}" title="Edit name, persona, avatar, skills">Edit</a>
+ <a class="btn sec" href="/agent/${agentIdEnc}/edit" title="Edit name, persona, avatar, skills">Edit</a>
<button class="btn sec" data-share type="button" title="Copy public agent link">Share</button>
<button class="btn sec" data-embed type="button" ${embedDisabledAttr}>Embed</button>
${token?.mint
@@ -788,7 +788,7 @@ async function makeAgentFromAvatar(a, btn) {
// calls makeAgentFromAvatar can't fire again and race a second create.
const link = document.createElement('a');
link.className = 'btn sec';
- link.href = `/agent-edit.html?id=${encodeURIComponent(agent.id)}`;
+ link.href = `/agent/${encodeURIComponent(agent.id)}/edit`;
link.textContent = 'Open agent →';
link.title = 'Open the newly-created agent';
btn.replaceWith(link);
diff --git a/public/eth-vanity.html b/public/eth-vanity.html
index 7cf1a784e..f25836e12 100644
--- a/public/eth-vanity.html
+++ b/public/eth-vanity.html
@@ -507,7 +507,7 @@
host.innerHTML = `
<div class="card" style="margin-top:1rem">
<h2>Assign to an agent</h2>
- <p class="desc" style="margin:0">No agents yet. <a href="/create.html" style="color:#a78bfa">Create one</a> and come back to assign this address.</p>
+ <p class="desc" style="margin:0">No agents yet. <a href="/create" style="color:#a78bfa">Create one</a> and come back to assign this address.</p>
</div>`;
return;
}
diff --git a/public/hydrate/index.html b/public/hydrate/index.html
index b0c6ab64b..03b2e52ee 100644
--- a/public/hydrate/index.html
+++ b/public/hydrate/index.html
@@ -279,7 +279,7 @@
<div class="container">
<div class="breadcrumb">
- <a href="/marketplace.html?tab=mine">Home</a> / <a href="/dashboard/">Dashboard</a> / Import Agents
+ <a href="/marketplace?tab=mine">Home</a> / <a href="/dashboard/">Dashboard</a> / Import Agents
</div>
<h1>Import My Agents</h1>
diff --git a/public/legal/privacy.html b/public/legal/privacy.html
index ac7a36ce7..bdd46921a 100644
--- a/public/legal/privacy.html
+++ b/public/legal/privacy.html
@@ -103,7 +103,7 @@
<p>Privacy questions: <a href="mailto:[email protected]">[email protected]</a></p>
<hr>
- <p class="foot">three.ws &nbsp;·&nbsp; <a href="/legal/tos.html">Terms of Service</a> &nbsp;·&nbsp; <a href="/marketplace.html?tab=mine">Home</a></p>
+ <p class="foot">three.ws &nbsp;·&nbsp; <a href="/legal/tos.html">Terms of Service</a> &nbsp;·&nbsp; <a href="/marketplace?tab=mine">Home</a></p>
</div>
</body>
</html>
diff --git a/public/login.html b/public/login.html
index c3c386348..3ecd9f2f6 100644
--- a/public/login.html
+++ b/public/login.html
@@ -479,7 +479,7 @@
<a href="#main-content" class="skip-link">Skip to main content</a>
<header class="site-header">
<h1>
- <a href="/marketplace.html?tab=mine" aria-label="three.ws home"
+ <a href="/marketplace?tab=mine" aria-label="three.ws home"
><span class="wordmark-dot" aria-hidden="true"></span>three.ws</a
>
</h1>
diff --git a/public/pumpfun.html b/public/pumpfun.html
index a0dcef973..2aa6ffe8d 100644
--- a/public/pumpfun.html
+++ b/public/pumpfun.html
@@ -498,7 +498,7 @@
<h4 class="h-footer-link-heading">Product</h4>
<a href="/create">Create</a>
<a href="/studio">Studio</a>
- <a href="/widgets.html">Widgets</a>
+ <a href="/widgets">Widgets</a>
<a href="/discover">Discover</a>
</div>
<div class="h-footer-link-col">
diff --git a/public/pumpfun.html.bak b/public/pumpfun.html.bak
deleted file mode 100644
index 6a36fc54d..000000000
--- a/public/pumpfun.html.bak
+++ /dev/null
@@ -1,2546 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta charset="utf-8" />
- <meta name="viewport" content="width=device-width,initial-scale=1" />
- <title>PumpFun migrations · three.ws</title>
- <link rel="icon" href="/favicon.ico" />
- <link rel="preconnect" href="https://fonts.googleapis.com" />
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
- <link rel="stylesheet" href="/style.css" />
- <link rel="stylesheet" href="/home.css" />
- <link rel="stylesheet" href="/footer.css" />
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap" rel="stylesheet" />
- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>
- <script defer src="/footer-newsletter.js"></script>
- <style>
- :root { color-scheme: dark; --accent: #6a5cff; --border: #1f1f29; --bg: #0a0a0f; --panel: #14141c; --muted: #888;
- --header-h: 64px; }
- * { box-sizing: border-box; }
- html, body { margin: 0; background: var(--bg); color: #eee;
- font: 14px/1.55 -apple-system, system-ui, Segoe UI, Roboto, sans-serif; }
- body.home-page { padding-top: var(--header-h); display: flex; flex-direction: column; min-height: 100vh; }
- .pf-filterbar { padding: 10px 18px; border-bottom: 1px solid var(--border);
- display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel);
- position: sticky; top: var(--header-h); z-index: 50; }
- .status-pill[data-state="down"] { cursor: pointer; color: #f87171; border-color: #4a1f23; }
- .status-pill[data-state="down"]:hover { background: #1f1418; }
- .pf-filterbar h1 { margin: 0; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
- .dot { width: 8px; height: 8px; border-radius: 50%; background: #555; box-shadow: 0 0 0 0 currentColor; }
- .dot.live { background: #4ade80; animation: pulse 1.6s ease-in-out infinite; }
- .dot.connecting { background: #fbbf24; }
- .dot.down { background: #f87171; }
- .dot.quiet { background: #94a3b8; animation: pulse 4s ease-in-out infinite; }
- @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
- .pf-filterbar .status-pill { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px;
- padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: transparent; }
- .pf-filterbar .status-pill:hover { background: transparent; }
- .helius-pill { font-size: 10px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px;
- padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none;
- background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(168,85,247,0.06));
- transition: color 0.15s ease, border-color 0.15s ease; vertical-align: middle; margin-left: 8px;
- letter-spacing: 0.02em; text-transform: uppercase; font-weight: 500; }
- .helius-pill:hover { color: #eee; border-color: #4a4a58; }
- .helius-pill .helius-dot { width: 6px; height: 6px; border-radius: 50%;
- background: linear-gradient(135deg, #f59e0b, #a855f7); box-shadow: 0 0 6px rgba(168,85,247,0.55); }
- #feed-wrap h2 { display: inline-flex; align-items: center; flex-wrap: wrap; }
- .pf-filterbar .desc { color: var(--muted); font-size: 12px; }
- .pf-filterbar .ctl { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
- .pf-filterbar label { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
- .pf-filterbar input[type="text"], .pf-filterbar input[type="number"], .pf-filterbar select, .pf-filterbar button {
- background: #161620; color: #eee; border: 1px solid #2a2a36;
- border-radius: 6px; padding: 6px 10px; font-size: 13px; }
- .pf-filterbar input[type="number"].ctl-num { width: 108px; -moz-appearance: textfield; appearance: textfield; }
- .pf-filterbar input[type="number"].ctl-num::-webkit-outer-spin-button,
- .pf-filterbar input[type="number"].ctl-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
- .pf-filterbar .ctl-sep { width: 1px; height: 20px; background: #2a2a36; margin: 0 2px; }
- .pf-filterbar button { cursor: pointer; }
- .pf-filterbar button:hover { background: #20202c; }
- .pf-filterbar button.toggle[data-on="0"] { color: var(--muted); }
- #ctl-avatar-wrap { display: inline-flex; align-items: center; gap: 6px; }
- #ctl-avatar-btn { display: inline-flex; align-items: center; gap: 8px; max-width: 240px; }
- #ctl-avatar-btn .avatar-thumb { width: 22px; height: 22px; border-radius: 4px; background: #1a1a24 center/cover no-repeat; border: 1px solid #2a2a36; flex: 0 0 auto; }
- #ctl-avatar-btn .avatar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
- #ctl-avatar-btn .avatar-caret { color: var(--muted); font-size: 10px; }
-
- /* Picker modal */
- .pf-modal-backdrop { position: fixed; inset: 0; background: rgba(4,4,8,0.72); backdrop-filter: blur(4px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; animation: fade-in 0.15s ease; }
- .pf-modal-backdrop[data-open="true"] { display: flex; }
- .pf-modal { width: min(1080px, 100%); max-height: min(760px, calc(100vh - 48px)); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,0.5); animation: pop-in 0.18s ease; }
- .pf-modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
- .pf-modal-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
- .pf-modal-head .spacer { flex: 1; }
- .pf-modal-close { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px 8px; border-radius: 4px; }
- .pf-modal-close:hover { background: #1f1f29; color: #eee; }
- .pf-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--border); background: #10101a; overflow-x: auto; }
- .pf-tab { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
- .pf-tab:hover { color: #eee; }
- .pf-tab[aria-selected="true"] { color: #eee; border-bottom-color: var(--accent); }
- .pf-tab .badge { display: inline-block; margin-left: 6px; font-size: 10px; color: var(--muted); }
- .pf-toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
- .pf-toolbar input[type="search"] { flex: 1; background: #161620; color: #eee; border: 1px solid #2a2a36; border-radius: 6px; padding: 7px 10px; font-size: 13px; }
- .pf-toolbar input[type="search"]:focus { outline: none; border-color: var(--accent); }
- .pf-toolbar .custom-row { display: flex; gap: 6px; align-items: center; }
- .pf-toolbar .custom-row input { background: #161620; color: #eee; border: 1px solid #2a2a36; border-radius: 6px; padding: 7px 10px; font-size: 13px; width: 220px; }
- .pf-toolbar .custom-row button { background: var(--accent); border: 0; color: #fff; border-radius: 6px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
- .pf-toolbar .custom-row button:hover { filter: brightness(1.1); }
- .pf-tags { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 10px; border-bottom: 1px solid var(--border); }
- .pf-tags:empty { display: none; }
- .pf-tag { background: #161620; border: 1px solid #2a2a36; color: #cbd5e1; border-radius: 999px; padding: 3px 10px; font-size: 11px; cursor: pointer; }
- .pf-tag:hover { background: #20202c; }
- .pf-tag[data-active="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
- .pf-content { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 280px; }
- .pf-body { min-height: 0; overflow-y: auto; padding: 16px 18px; }
- .pf-preview { border-left: 1px solid var(--border); background: #0d0d15; display: flex; flex-direction: column; min-height: 0; }
- .pf-preview-stage { flex: 1; min-height: 0; position: relative; background: radial-gradient(ellipse at center, #1a1a26 0%, #0a0a12 70%); }
- .pf-preview-stage model-viewer { width: 100%; height: 100%; --poster-color: transparent; background: transparent; }
- .pf-preview-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #2a2a3a; font-size: 48px; pointer-events: none; }
- .pf-preview-meta { padding: 12px 14px; border-top: 1px solid var(--border); }
- .pf-preview-meta .name { font-size: 13px; font-weight: 600; }
- .pf-preview-meta .sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
- .pf-preview-meta .actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
- .pf-preview-meta .actions a, .pf-preview-meta .actions button { font-size: 11px; padding: 5px 10px; border-radius: 5px; background: #161620; border: 1px solid #2a2a36; color: #cbd5e1; text-decoration: none; cursor: pointer; }
- .pf-preview-meta .actions a:hover, .pf-preview-meta .actions button:hover { background: #20202c; text-decoration: none; }
- .pf-preview-meta .actions .primary { background: var(--accent); border-color: var(--accent); color: #fff; }
- .pf-preview-meta .actions .primary:hover { filter: brightness(1.1); background: var(--accent); }
- .pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
- .pf-card { position: relative; background: #161620; border: 1px solid #232330; border-radius: 8px; overflow: hidden; cursor: pointer; transition: border-color 0.15s, transform 0.1s; display: flex; flex-direction: column; text-align: left; padding: 0; color: #eee; font: inherit; }
- .pf-card:hover, .pf-card:focus-visible { border-color: #3a3a4a; outline: none; }
- .pf-card:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
- .pf-card:active { transform: scale(0.98); }
- .pf-card[data-selected="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
- .pf-card .thumb { aspect-ratio: 1/1; background: #0e0e16 center/cover no-repeat; border-bottom: 1px solid #232330; position: relative; display: flex; align-items: center; justify-content: center; color: #2a2a3a; font-size: 32px; }
- .pf-card .meta { padding: 8px 10px; }
- .pf-card .name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
- .pf-card .sub { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
- .pf-card .vis-tag { position: absolute; top: 6px; right: 6px; font-size: 9px; padding: 2px 6px; border-radius: 999px; background: rgba(0,0,0,0.6); color: #cbd5e1; text-transform: uppercase; letter-spacing: 0.05em; }
- .pf-card .vis-tag.private { background: rgba(74,31,35,0.85); color: #fbbf24; }
- .pf-card .selected-mark { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); display: none; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; }
- .pf-card[data-selected="true"] .selected-mark { display: flex; }
- .pf-card .fav { position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,0.55); border: 0; color: #cbd5e1; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s; padding: 0; }
- .pf-card:hover .fav, .pf-card:focus-within .fav, .pf-card .fav[data-on="true"] { opacity: 1; }
- .pf-card .fav[data-on="true"] { color: #fbbf24; }
- .pf-skeleton { background: linear-gradient(90deg, #161620 0%, #1f1f2a 50%, #161620 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; aspect-ratio: 1/1.25; }
- @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
- .pf-status { padding: 32px 16px; text-align: center; color: var(--muted); font-size: 13px; }
- .pf-status .cta { display: inline-block; margin-top: 10px; padding: 8px 14px; background: var(--accent); color: #fff; border-radius: 6px; font-size: 13px; }
- .pf-status .cta:hover { filter: brightness(1.1); text-decoration: none; }
- .pf-loadmore { display: block; margin: 16px auto 0; background: #161620; color: #eee; border: 1px solid #2a2a36; border-radius: 6px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
- .pf-loadmore:hover { background: #20202c; }
- .pf-loadmore[disabled] { opacity: 0.5; cursor: wait; }
- .pf-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; background: #161620; border: 1px solid #2a2a36; color: #eee; padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.4); animation: toast-in 0.2s ease; max-width: 90vw; }
- .pf-toast.error { border-color: #4a1f23; background: #1f1418; color: #fbbf24; }
- .pf-toast.success { border-color: #1f4232; background: #0e1f17; color: #4ade80; }
- @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
- @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
- @keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
- @media (max-width: 760px) {
- .pf-modal-backdrop { padding: 0; }
- .pf-modal { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; border: 0; }
- .pf-content { grid-template-columns: 1fr; grid-template-rows: 220px 1fr; }
- .pf-preview { border-left: 0; border-bottom: 1px solid var(--border); order: -1; flex-direction: row; }
- .pf-preview-stage { flex: 1; }
- .pf-preview-meta { width: 50%; border-top: 0; border-left: 1px solid var(--border); }
- .pf-toolbar { flex-direction: column; align-items: stretch; }
- .pf-toolbar .custom-row input { width: 100%; }
- }
- @media (prefers-reduced-motion: reduce) {
- .pf-modal-backdrop, .pf-modal, .pf-skeleton, .pf-toast { animation: none; }
- }
- main.pf-main { position: relative; flex: 1; min-height: calc(100vh - var(--header-h) - 56px); display: grid; grid-template-columns: 1fr; }
- #stage { position: relative; display: flex; flex-direction: column; }
- iframe { width: 100%; flex: 1; border: 0; display: block; background: var(--bg); }
- #anim-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px;
- border-top: 1px solid var(--border); background: rgba(20,20,28,0.85);
- backdrop-filter: blur(6px); max-height: 96px; overflow-y: auto; }
- #anim-chips:empty::before { content: 'loading animations…'; color: var(--muted); font-size: 11px; }
- .anim-chip { background: #161620; color: #ddd; border: 1px solid #2a2a36;
- border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
- transition: background 0.15s, border-color 0.15s, transform 0.1s; user-select: none; }
- .anim-chip:hover { background: #20202c; border-color: #3a3a4a; }
- .anim-chip:active { transform: scale(0.96); }
- .anim-chip[data-active="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
- .anim-chip[disabled] { opacity: 0.5; cursor: wait; }
- @media (min-width: 721px) {
- #side {
- position: absolute;
- right: 16px;
- top: 16px;
- width: 360px;
- max-height: 80vh;
- z-index: 100;
- border-radius: 8px;
- box-shadow: 0 8px 24px rgba(0,0,0,0.4);
- border: 1px solid var(--border);
- background: var(--panel);
- display: flex;
- flex-direction: column;
- overflow: hidden;
- }
- }
-
- #side-content {
- flex: 1;
- min-height: 0;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- }
- #side-header {
- display: none; /* hidden on mobile by default */
- }
- @media (min-width: 721px) {
- #side-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 6px 12px;
- background: #1a1a24;
- cursor: move;
- border-bottom: 1px solid var(--border);
- user-select: none;
- }
- }
- #side-header .side-title {
- font-weight: 600;
- font-size: 13px;
- }
- .side-controls {
- display: flex;
- gap: 4px;
- }
- .side-control-btn {
- background: transparent;
- border: 0;
- color: var(--muted);
- cursor: pointer;
- font-size: 16px;
- line-height: 1;
- padding: 4px;
- width: 24px;
- height: 24px;
- border-radius: 4px;
- }
- .side-control-btn:hover {
- background: #2a2a36;
- color: #eee;
- }
- #side.minimized #side-content {
- display: none;
- }
- #side.minimized {
- max-height: none;
- height: auto;
- }
- #side h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
- color: var(--muted); margin: 12px 16px 6px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
- #agent-card { padding: 4px 16px 12px; border-bottom: 1px solid var(--border); }
- #first-claims-section { border-bottom: 1px solid var(--border); padding-bottom: 8px; max-height: 30%; display: flex; flex-direction: column; }
- #first-claims { padding: 0 12px 4px; overflow-y: auto; flex: 1; min-height: 0; }
- #first-claims .empty { padding: 6px 4px; }
- #feed-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
- #feed { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
- .kv { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; gap: 8px; }
- .kv span:first-child { color: var(--muted); }
- .kv code { font-size: 11px; background: #1a1a24; padding: 1px 5px; border-radius: 3px; }
- .signal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 16px 12px; }
- .signal { background: #1a1a24; border: 1px solid #232330; border-radius: 6px; padding: 8px; }
- .signal .v { font-size: 18px; font-weight: 600; }
- .signal .l { font-size: 11px; color: var(--muted); margin-top: 2px; }
- .signal.neg { border-color: #4a1f23; background: #1f1418; }
- .empty { color: var(--muted); font-size: 12px; padding: 8px 16px; }
- a { color: #9a8cff; text-decoration: none; }
- a:hover { text-decoration: underline; }
- .warn { background: #2a1f0d; border: 1px solid #463a14; padding: 8px 10px; border-radius: 6px;
- color: #fbbf24; font-size: 12px; margin: 12px 16px; }
-
- /* Event cards */
- .evt { border: 1px solid #232330; background: #15151d; border-radius: 8px; padding: 10px 12px; margin: 6px 0;
- animation: evt-in 0.35s ease; font-size: 12px; position: relative; }
- .evt.first { border-color: #1f4232; background: #0e1f17; }
- .evt.fake { border-color: #4a1f23; background: #1f1418; }
- .evt.grad { border-color: #2c1f4a; background: #18142a; }
- .evt.replay { opacity: 0.62; animation: none; }
- .evt.replay::after { content: 'replay'; position: absolute; top: 8px; right: 10px; font-size: 9px; letter-spacing: 0.08em;
- text-transform: uppercase; color: #6a6a82; padding: 1px 6px; border: 1px solid #2a2a3c; border-radius: 999px; background: #0e0e16; }
- .evt-head { display: flex; gap: 10px; align-items: flex-start; }
- .evt-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid #2a2a3c;
- background: #0e0e16; flex: 0 0 44px; }
- .evt-head-text { flex: 1; min-width: 0; }
- .evt-socials { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
- .evt-socials a { font-size: 10px; padding: 2px 7px; border-radius: 4px; background: #1e1e2c;
- border: 1px solid #2a2a3c; color: #cbd5e1; }
- .evt-socials a:hover { background: #26263a; color: #fff; }
- .evt-pool { font-size: 10px; color: #9a8cff; margin-top: 4px; }
- .evt-copy, .evt-focus { background: transparent; border: 0; color: #888; cursor: pointer; font-size: 11px; padding: 0 2px; }
- .evt-copy:hover, .evt-focus:hover { color: #fff; }
- .evt-copy[data-copied="1"]::after { content: ' ✓'; color: #4ade80; }
- .evt-row { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
- .evt-kind { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
- .evt-tier { font-size: 10px; color: #fbbf24; }
- .evt-title { font-weight: 700; font-size: 13px; margin: 3px 0 2px; }
- .evt-who { font-weight: 600; font-size: 13px; margin-top: 3px; word-break: break-all; }
- .evt-amt { font-size: 12px; color: #cbd5e1; }
- .evt-take { font-size: 11px; color: var(--muted); margin-top: 4px; font-style: italic; }
- .evt-time { font-size: 10px; color: #555; }
- .evt-links { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; }
- .evt-links a { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #1e1e2c; border: 1px solid #2a2a3c; color: #9a8cff; text-decoration: none; }
- .evt-links a:hover { background: #26263a; }
- .evt-meta { margin-top: 5px; font-size: 10px; color: #555; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
- .evt-meta a { color: #666; text-decoration: none; }
- .evt-meta a:hover { color: #9a8cff; }
- .evt-mint { font-size: 9px; color: #444; word-break: break-all; margin-top: 4px; font-family: monospace; }
- .evt-desc { font-size: 11px; color: #8a8a9a; margin: 2px 0; }
- .evt-section { margin-top: 6px; padding-top: 6px; border-top: 1px solid #1e1e2c; }
- .evt-row2 { display: flex; gap: 10px; flex-wrap: wrap; margin: 3px 0; font-size: 11px; color: #cbd5e1; }
- .evt-stat { color: var(--muted); }
- .evt-gh { font-size: 11px; margin: 2px 0; }
- .evt-repo { font-size: 11px; background: #1a1a24; border-radius: 4px; padding: 4px 7px; margin-top: 4px; }
- .evt-repo-name { font-weight: 600; color: #9a8cff; }
- .evt-topics { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 3px; }
- .evt-topic { font-size: 9px; padding: 1px 5px; background: #1f1f30; border: 1px solid #2a2a3c; border-radius: 10px; color: #7a7aaa; }
- @keyframes evt-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
-
- /* Helius pill live event counter */
- .helius-pill .helius-count { font-variant-numeric: tabular-nums; color: #cbd5e1; font-weight: 600;
- padding: 1px 5px; border-radius: 4px; background: rgba(168,85,247,0.12); margin-right: 4px;
- min-width: 16px; text-align: center; display: none; letter-spacing: 0; text-transform: none; }
- .helius-pill[data-count="active"] .helius-count { display: inline-block; }
-
- /* Jump-to-top button shown when feed is scrolled and new events queue up */
- .feed-jump { position: absolute; left: 50%; transform: translateX(-50%); top: 38px; z-index: 4;
- background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 6px 12px;
- font-size: 11px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px rgba(106,92,255,0.4);
- display: none; animation: fade-in 0.18s ease; }
- .feed-jump[data-visible="true"] { display: inline-flex; align-items: center; gap: 6px; }
- .feed-jump:hover { filter: brightness(1.1); }
- #feed-wrap { position: relative; }
-
- /* Share/copy-link button */
- .pf-icon-btn { background: #161620; color: #ddd; border: 1px solid #2a2a36; border-radius: 6px;
- padding: 6px 10px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
- .pf-icon-btn:hover { background: #20202c; }
- .pf-icon-btn[data-flash="true"] { border-color: #4ade80; color: #4ade80; }
-
- /* Mobile side-panel toggle */
- #side-toggle { display: none; }
- @media (max-width: 720px) {
- main.pf-main { grid-template-columns: 1fr; }
- #side { position: fixed; top: calc(var(--header-h) + 56px); right: 0; bottom: 0;
- width: min(360px, 92vw); transform: translateX(100%); transition: transform 0.22s ease;
- z-index: 60; box-shadow: -8px 0 24px rgba(0,0,0,0.5); }
- body.side-open #side { transform: translateX(0); }
- #side-toggle { display: inline-flex; align-items: center; gap: 5px; }
- body.side-open #side-toggle { background: var(--accent); color: #fff; border-color: var(--accent); }
- }
-
- .config-section { margin-bottom: 24px; }
- .config-section h3 { font-size: 13px; font-weight: 600; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
- .config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
- .config-item { background: #161620; border: 1px solid #232330; border-radius: 6px; padding: 10px 12px; }
- .config-item label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
- .config-item select, .config-item input { width: 100%; background: #101018; color: #eee; border: 1px solid #2a2a36; border-radius: 4px; padding: 6px 8px; font-size: 12px; }
- .config-item input { margin-top: 6px; }
- .config-save-bar { padding: 12px 18px; border-top: 1px solid var(--border); text-align: right; background: #10101a; }
- .config-save-btn { background: var(--accent); border: 0; color: #fff; border-radius: 6px; padding: 8px 16px; font-size: 13px; cursor: pointer; }
- .config-save-btn:hover { filter: brightness(1.1); }
- </style>
-</head>
-<body class="home-page">
- <header>
- <h1>
- <a href="https://three.ws/marketplace?tab=mine" aria-label="three.ws home"
- ><img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" /><span
- class="wordmark-dot"
- aria-hidden="true"
- ></span
- >three.ws</a
- >
- </h1>
- <nav class="home-nav" aria-label="Primary">
- <ul class="nav-root" role="menubar">
- <li class="nav-item nav-has-menu" role="none">
- <button
- type="button"
- class="nav-trigger"
- aria-haspopup="true"
- aria-expanded="false"
- role="menuitem"
- >
- Build<span class="nav-caret" aria-hidden="true">▾</span>
- </button>
- <ul class="nav-menu" role="menu" aria-label="Build">
- <li role="none">
- <a href="/create" role="menuitem"
- ><span class="nav-mi-title">Create agent</span
- ><span class="nav-mi-sub">Avatar + brain wizard</span></a
- >
- </li>
- <li role="none">
- <a href="/app" role="menuitem"
- ><span class="nav-mi-title">Viewer</span
- ><span class="nav-mi-sub">Drag-and-drop GLB</span></a
- >
- </li>
- <li role="none">
- <a href="/validation" role="menuitem"
- ><span class="nav-mi-title">glTF Validator</span
- ><span class="nav-mi-sub">Khronos spec check</span></a
- >
- </li>
- </ul>
- </li>
- <li class="nav-item nav-has-menu" role="none">
- <button
- type="button"
- class="nav-trigger"
- aria-haspopup="true"
- aria-expanded="false"
- role="menuitem"
- >
- Discover<span class="nav-caret" aria-hidden="true">▾</span>
- </button>
- <ul class="nav-menu" role="menu" aria-label="Discover">
- <li role="none">
- <a href="/discover" role="menuitem"
- ><span class="nav-mi-title">Agents</span
- ><span class="nav-mi-sub">Public directory</span></a
- >
- </li>
- <li role="none">
- <a href="/widgets.html" role="menuitem"
- ><span class="nav-mi-title">Widgets gallery</span
- ><span class="nav-mi-sub">Embeddable showcases</span></a
- >
- </li>
- <li role="none">
- <a href="/reputation" role="menuitem"
- ><span class="nav-mi-title">Reputation</span
- ><span class="nav-mi-sub">ERC-8004 registry</span></a
- >
- </li>
- </ul>
- </li>
- <li class="nav-item nav-has-menu" role="none">
- <button
- type="button"
- class="nav-trigger"
- aria-haspopup="true"
- aria-expanded="false"
- role="menuitem"
- >
- Solana<span class="nav-caret" aria-hidden="true">▾</span>
- </button>
- <ul class="nav-menu" role="menu" aria-label="Solana">
- <li role="none">
- <a href="/pumpfun" role="menuitem"
- ><span class="nav-mi-title">Pump.fun stream</span
- ><span class="nav-mi-sub">Mint agent tokens</span></a
- >
- </li>
- <li role="none">
- <a href="/vanity-wallet" role="menuitem"
- ><span class="nav-mi-title">Vanity wallet</span
- ><span class="nav-mi-sub">Grind a Solana address</span></a
- >
- </li>
- <li role="none">
- <a href="/strategy-lab" role="menuitem"
- ><span class="nav-mi-title">Strategy Lab</span
- ><span class="nav-mi-sub">DCA + subscriptions</span></a
- >
- </li>
- <li role="none">
- <a href="/pump-live.html" role="menuitem"
- ><span class="nav-mi-title">Live launches</span
- ><span class="nav-mi-sub">Real-time mint feed</span></a
- >
- </li>
- <li role="none">
- <a href="/pump-dashboard.html" role="menuitem"
- ><span class="nav-mi-title">Pump Dashboard</span
- ><span class="nav-mi-sub">Watches · scanner · quotes</span></a
- >
- </li>
- <li role="none">
- <a href="/docs#solana" role="menuitem"
- ><span class="nav-mi-title">Solana SDK</span
- ><span class="nav-mi-sub">Attestations + agent-kit</span></a
- >
- </li>
- </ul>
- </li>
- <li class="nav-item nav-has-menu" role="none">
- <button
- type="button"
- class="nav-trigger"
- aria-haspopup="true"
- aria-expanded="false"
- role="menuitem"
- >
- Embed<span class="nav-caret" aria-hidden="true">▾</span>
- </button>
- <ul class="nav-menu" role="menu" aria-label="Embed">
- <li role="none">
- <a href="/studio" role="menuitem"
- ><span class="nav-mi-title">Widget Studio</span
- ><span class="nav-mi-sub">Pick avatar → copy snippet</span></a
- >
- </li>
- <li role="none">
- <a href="/artifact" role="menuitem"
- ><span class="nav-mi-title">Artifact viewer</span
- ><span class="nav-mi-sub">Claude artifact bundle</span></a
- >
- </li>
- <li role="none">
- <a href="/docs#embedding" role="menuitem"
- ><span class="nav-mi-title">Embed docs</span
- ><span class="nav-mi-sub">iframe + oEmbed</span></a
- >
- </li>
- <li role="none">
- <a href="/docs#web-component" role="menuitem"
- ><span class="nav-mi-title">&lt;agent-3d&gt;</span
- ><span class="nav-mi-sub">Web component reference</span></a
- >
- </li>
- </ul>
- </li>
- <li class="nav-item" role="none"><a href="/marketplace.html" role="menuitem">Marketplace</a></li>
- <li class="nav-item" role="none"><a href="/chat" role="menuitem">Chat</a></li>
- <li class="nav-item" role="none">
- <a href="/features" role="menuitem">Features</a>
- </li>
- <li class="nav-item" role="none"><a href="/tutorials.html" role="menuitem">Tutorials</a></li>
- <li class="nav-item" id="home-nav-my-agents-li" role="none" hidden>
- <a href="/my-agents" id="home-nav-my-agents" role="menuitem">My Agents</a>
- </li>
- <li class="nav-item" id="home-nav-user-li" role="none" hidden>
- <a href="/dashboard" id="home-nav-user" class="nav-user" role="menuitem"></a>
- </li>
- <li class="nav-item" role="none">
- <a href="/login" class="nav-cta" id="home-nav-cta" role="menuitem"
- >Get started</a
- >
- </li>
- </ul>
- </nav>
- </header>
- <div class="pf-filterbar">
- <h1>✦ PumpFun migrations</h1>
- <button type="button" class="status-pill" id="status-pill" data-state="connecting" title="Click to reconnect when offline"><span class="dot connecting" id="status-dot"></span><span id="status-label">connecting…</span></button>
- <div class="ctl">
- <input id="ctl-asset" type="text" placeholder="Solana asset pubkey (optional)" size="22" />
- <input id="ctl-mint" type="text" placeholder="Filter mint…" size="18" />
- <select id="ctl-kind" title="Event type">
- <option value="all">All events</option>
- <option value="mint">New tokens</option>
- <option value="graduation">Graduations</option>
- <option value="claims">Claims only</option>
- </select>
- <select id="ctl-tier" title="Minimum tier">
- <option value="">Any tier</option>
- <option value="notable">Notable+</option>
- <option value="influencer">Influencer+</option>
- <option value="mega">Mega only</option>
- </select>
- <span class="ctl-sep" aria-hidden="true"></span>
- <input id="ctl-mc-min" type="number" placeholder="Min MC $" class="ctl-num" min="0" step="1000" title="Min market cap in USD (graduations &amp; claims)" />
- <input id="ctl-mc-max" type="number" placeholder="Max MC $" class="ctl-num" min="0" step="1000" title="Max market cap in USD" />
- <input id="ctl-min-buy" type="number" placeholder="Min buy SOL" class="ctl-num" min="0" step="1" title="Min initial buy in SOL — new tokens only" />
- <input id="ctl-whale" type="number" placeholder="Whale ≥ SOL" class="ctl-num" min="0" step="5" title="Whale filter — only show trades/claims ≥ N SOL" />
- <div id="ctl-avatar-wrap">
- <button id="ctl-avatar-btn" type="button" aria-haspopup="dialog" aria-expanded="false" title="Choose avatar">
- <span class="avatar-thumb" id="ctl-avatar-thumb" aria-hidden="true"></span>
- <span class="avatar-name" id="ctl-avatar-label">Avatar</span>
- <span class="avatar-caret" aria-hidden="true">▾</span>
- </button>
- </div>
- <button id="ctl-narrate" class="toggle" type="button" data-on="1" title="Toggle agent narration">🔊 Narration</button>
- <button id="ctl-announce-mints" class="toggle" type="button" data-on="0" title="Toggle new coin announcements">🚀 New coins</button>
- <select id="ctl-mood" title="Avatar mood — biases reaction intensity">
- <option value="chill">😎 Chill</option>
- <option value="normal" selected>🙂 Normal</option>
- <option value="hype">🤩 Hype</option>
- </select>
- <button id="ctl-config" class="pf-icon-btn" type="button" title="Configure agent reactions">⚙️ Config</button>
- <button id="ctl-share" class="pf-icon-btn" type="button" title="Copy a shareable link with current filters">🔗 <span id="ctl-share-label">Share</span></button>
- <button id="side-toggle" class="pf-icon-btn" type="button" aria-pressed="false" aria-controls="side" title="Toggle live feed">📡 Feed</button>
- </div>
- </div>
- <main class="pf-main">
- <div id="stage">
- <iframe id="agent" allow="autoplay" title="3D agent"></iframe>
- <div id="anim-chips" role="group" aria-label="Trigger animation"></div>
- </div>
- <aside id="side">
- <div class="side-header" id="side-header">
- <span class="side-title">Live Feed</span>
- <div class="side-controls">
- <button id="side-minimize" class="side-control-btn" title="Minimize">_</button>
- <button id="side-close" class="side-control-btn" title="Close">×</button>
- </div>
- </div>
- <div id="side-content">
- <h2>Agent</h2>
- <div id="agent-card"><div class="empty">Default narrator avatar. Paste a Solana asset pubkey above to bind a specific agent.</div></div>
- <div id="signals-section" hidden>
- <h2>Reputation signals</h2>
- <div class="signal-grid" id="signals"></div>
- </div>
- <div id="first-claims-section">
- <h2>
- <span>First-time fee claims</span>
- <select id="fc-window" title="Lookback window" style="margin-left:8px;background:#0f0f17;color:#e6e6f0;border:1px solid #20202c;border-radius:6px;padding:2px 6px;font-size:12px">
- <option value="60">1h</option>
- <option value="360">6h</option>
- <option value="1440" selected>24h</option>
- </select>
- <button type="button" id="fc-refresh" class="pf-icon-btn" title="Refresh first-time claims" style="margin-left:6px">↻</button>
- </h2>
- <div id="first-claims"><div class="empty">Loading first-time claims…</div></div>
- </div>
- <div id="feed-wrap">
- <h2><span id="feed-title">Live feed</span><a id="helius-pill" class="helius-pill" href="https://helius.dev" target="_blank" rel="noopener" title="Real-time Solana data via Helius webhooks"><span class="helius-dot" aria-hidden="true"></span><span id="helius-count" class="helius-count">0</span>Powered by Helius</a></h2>
- <button type="button" class="feed-jump" id="feed-jump" data-visible="false" aria-live="polite">↑ <span id="feed-jump-count">0</span> new</button>
- <div id="feed"><div class="empty">Waiting for events…</div></div>
- </div>
- </div>
- </aside>
- </main>
- <footer class="h-footer h-footer-horizon">
- <div class="h-footer-glow-line" aria-hidden="true"></div>
- <div class="h-footer-floor" aria-hidden="true"></div>
- <div class="h-footer-haze" aria-hidden="true"></div>
- <div class="h-footer-watermark" aria-hidden="true">three.ws</div>
- <div class="h-footer-avatar" aria-hidden="true">
- <model-viewer src="/animations/robotexpressive.glb" auto-rotate auto-rotate-delay="0" rotation-per-second="20deg" interaction-prompt="none" camera-controls="false" disable-zoom shadow-intensity="0" exposure="0.7" environment-image="neutral" camera-orbit="0deg 80deg 9m" field-of-view="45deg" loading="lazy"></model-viewer>
- </div>
- <div class="h-footer-cta">
- <div class="h-footer-newsletter">
- <h3>Stay in the loop</h3>
- <p>Get updates on new features, agent tooling, and protocol changes.</p>
- <form class="h-footer-newsletter-form" data-newsletter-form novalidate>
- <input type="email" class="h-footer-newsletter-input" name="email" placeholder="Enter your email" aria-label="Email address" autocomplete="email" required />
- <button type="submit" class="h-footer-newsletter-btn" aria-label="Subscribe">
- <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" d="M2 8h11m0 0L9 4m4 4l-4 4"/></svg>
- </button>
- </form>
- <p class="h-footer-newsletter-msg" data-newsletter-msg aria-live="polite"></p>
- </div>
- <div class="h-footer-community">
- <h3>Join the community</h3>
- <p>Follow along for builds, demos, and conversations with the team.</p>
- <a class="h-footer-community-btn" href="https://x.com/trythreews" target="_blank" rel="noopener">
- <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
- Follow on X
- </a>
- </div>
- </div>
- <div class="h-footer-inner">
- <div class="h-footer-brand-col">
- <div class="h-footer-brand">
- <img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" />
- <span class="wordmark-dot" aria-hidden="true"></span>
- <span>three.ws</span>
- </div>
- <p class="h-footer-tagline">Give your AI a body.</p>
- <div class="h-footer-socials">
- <a class="h-footer-social" href="https://x.com/trythreews" target="_blank" rel="noopener" aria-label="three.ws on X">
- <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
- </a>
- <a class="h-footer-social" href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener" aria-label="three.ws on GitHub">
- <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
- </a>
- </div>
- </div>
- <nav class="h-footer-links" aria-label="Footer">
- <div class="h-footer-link-col">
- <h4 class="h-footer-link-heading">Product</h4>
- <a href="/create">Create</a>
- <a href="/studio">Studio</a>
- <a href="/widgets.html">Widgets</a>
- <a href="/discover">Discover</a>
- </div>
- <div class="h-footer-link-col">
- <h4 class="h-footer-link-heading">Developers</h4>
- <a href="/docs">Docs</a>
- <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a>
- <a href="https://eips.ethereum.org/EIPS/eip-8004" target="_blank" rel="noopener">ERC-8004</a>
- </div>
- <div class="h-footer-link-col">
- <h4 class="h-footer-link-heading">Resources</h4>
- <a href="/features">Features</a>
- <a href="/dashboard">Dashboard</a>
- </div>
- </nav>
- </div>
- <div class="h-footer-bottom">
- <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>
- <div class="h-footer-legal-links">
- <a href="/legal/privacy">Privacy Policy</a>
- <a href="/legal/tos">Terms of Use</a>
- </div>
- </div>
- </footer>
- <div class="pf-modal-backdrop" id="avatar-picker" data-open="false" role="dialog" aria-modal="true" aria-labelledby="avatar-picker-title">
- <div class="pf-modal" role="document">
- <div class="pf-modal-head">
- <h2 id="avatar-picker-title">Choose an avatar</h2>
- <span class="spacer"></span>
- <button class="pf-modal-close" type="button" aria-label="Close" data-picker-close>×</button>
- </div>
- <div class="pf-tabs" role="tablist">
- <button class="pf-tab" role="tab" type="button" data-tab="defaults" aria-selected="true">Defaults<span class="badge" id="tab-count-defaults"></span></button>
- <button class="pf-tab" role="tab" type="button" data-tab="recent" aria-selected="false">Recent<span class="badge" id="tab-count-recent"></span></button>
- <button class="pf-tab" role="tab" type="button" data-tab="favorites" aria-selected="false">Favorites<span class="badge" id="tab-count-favorites"></span></button>
- <button class="pf-tab" role="tab" type="button" data-tab="community" aria-selected="false">Community<span class="badge" id="tab-count-community"></span></button>
- <button class="pf-tab" role="tab" type="button" data-tab="mine" aria-selected="false">My Agents<span class="badge" id="tab-count-mine"></span></button>
- </div>
- <div class="pf-toolbar">
- <input type="search" id="picker-search" placeholder="Search by name…" autocomplete="off" aria-label="Search avatars" />
- <div class="custom-row">
- <input type="url" id="picker-custom-url" placeholder="https://…/avatar.glb" aria-label="Custom avatar URL" />
- <button type="button" id="picker-custom-go">Use URL</button>
- </div>
- </div>
- <div class="pf-tags" id="picker-tags" role="group" aria-label="Filter by tag"></div>
- <div class="pf-content">
- <div class="pf-body" id="picker-body" role="tabpanel" aria-live="polite"></div>
- <aside class="pf-preview" aria-label="Avatar preview">
- <div class="pf-preview-stage" id="picker-preview-stage">
- <div class="pf-preview-empty" id="picker-preview-empty" aria-hidden="true">◇</div>
- </div>
- <div class="pf-preview-meta" id="picker-preview-meta">
- <div class="name" id="picker-preview-name">Hover or focus an avatar</div>
- <div class="sub" id="picker-preview-sub">3D preview shown here</div>
- <div class="actions" id="picker-preview-actions"></div>
- </div>
- </aside>
- </div>
- </div>
- </div>
- <div id="pf-toast-host" aria-live="polite" aria-atomic="true"></div>
- <!-- Agent Config Modal -->
- <div class="pf-modal-backdrop" id="config-modal" data-open="false" role="dialog" aria-modal="true" aria-labelledby="config-modal-title">
- <div class="pf-modal" role="document">
- <div class="pf-modal-head">
- <h2 id="config-modal-title">Configure Agent Reactions</h2>
- <span class="spacer"></span>
- <button class="pf-modal-close" type="button" aria-label="Close" data-config-close>×</button>
- </div>
- <div class="pf-tabs" role="tablist">
- <button class="pf-tab" id="config-tab-emotions" role="tab" type="button" data-tab="emotions" aria-selected="true">Emotion Mapping</button>
- <button class="pf-tab" id="config-tab-actions" role="tab" type="button" data-tab="actions">Action Triggers</button>
- </div>
- <div class="pf-content" style="grid-template-columns: 1fr;">
- <div class="pf-body" id="config-body" role="tabpanel">
- <!-- Content will be generated by JS -->
- </div>
- </div>
- <div class="config-save-bar">
- <button class="config-save-btn" id="config-save-btn">Save Configuration</button>
- </div>
- </div>
- </div>
- <script>
- const url = new URL(location.href);
- const $ = (id) => document.getElementById(id);
- const iframe = $('agent');
-
- // ── Agent Configuration ──────────────────────────────────────────────
- const config = {
- modal: $('config-modal'),
- body: $('config-body'),
- trigger: $('ctl-config'),
- tabs: [$('config-tab-emotions'), $('config-tab-actions')],
- activeTab: 'emotions',
- lastFocus: null,
- emotions: ['Default', 'Idle', 'Happy', 'Sad', 'Angry', 'Surprised', 'Thinking', 'Victory', 'Defeat', 'Greeting'],
- actions: {
- 'mint': 'New Token',
- 'whale_buy': 'Whale Buy (>50 SOL)',
- 'big_buy': 'Big Buy (>10 SOL)',
- 'dip_buy': 'Dip Buy',
- 'med_buy': 'Medium Buy (>1 SOL)',
- 'small_buy': 'Small Buy',
- 'whale_sell': 'Whale Sell (>50 SOL)',
- 'big_sell': 'Big Sell (>10 SOL)',
- 'med_sell': 'Medium Sell (>1 SOL)',
- 'small_sell': 'Small Sell',
- 'graduation': 'Graduation',
- 'rug': 'Rugpull',
- 'claim': 'Fee Claim',
- },
- settings: {
- emotions: {},
- actions: {}
- },
- };
-
- function openConfig() {
- config.lastFocus = document.activeElement;
- config.modal.dataset.open = 'true';
- document.body.style.overflow = 'hidden';
- renderConfigBody();
- }
-
- function closeConfig() {
- config.modal.dataset.open = 'false';
- document.body.style.overflow = '';
- config.lastFocus?.focus?.();
- }
-
- config.trigger.addEventListener('click', openConfig);
- config.modal.addEventListener('click', (e) => {
- if (e.target === config.modal || e.target.closest('[data-config-close]')) closeConfig();
- });
- document.addEventListener('keydown', (e) => {
- if (e.key === 'Escape' && config.modal.dataset.open === 'true') closeConfig();
- });
-
- config.tabs.forEach((tab) => {
- tab.addEventListener('click', () => {
- config.tabs.forEach((t) => t.setAttribute('aria-selected', String(t === tab)));
- config.activeTab = tab.dataset.tab;
- renderConfigBody();
- });
- });
-
- function renderConfigBody() {
- const body = config.body;
- body.innerHTML = '';
- if (config.activeTab === 'emotions') {
- body.innerHTML = `
- <div class="config-section">
- <h3>Map animations to emotions</h3>
- <div class="config-grid">
- ${config.emotions.map(emotion => `
- <div class="config-item">
- <label for="config-emotion-${emotion}">${emotion}</label>
- <select id="config-emotion-${emotion}" data-emotion="${emotion}">
- <option value="">(default)</option>
- ${(animations || []).map(anim => `<option value="${anim}" ${config.settings.emotions[emotion] === anim ? 'selected' : ''}>${anim}</option>`).join('')}
- </select>
- </div>
- `).join('')}
- </div>
- </div>`;
- } else {
- body.innerHTML = `
- <div class="config-section">
- <h3>Configure reactions for actions</h3>
- <div class="config-grid">
- ${Object.entries(config.actions).map(([actionKey, actionLabel]) => `
- <div class="config-item">
- <label for="config-action-${actionKey}">${actionLabel}</label>
- <select id="config-action-${actionKey}" data-action="${actionKey}" data-field="emotion">
- <option value="">(no emotion)</option>
- ${config.emotions.map(emotion => `<option value="${emotion}" ${config.settings.actions[actionKey]?.emotion === emotion ? 'selected' : ''}>${emotion}</option>`).join('')}
- </select>
- <input type="text" id="config-tts-${actionKey}" data-action="${actionKey}" data-field="tts" placeholder="TTS message (e.g. Wow, a whale!)" value="${config.settings.actions[actionKey]?.tts || ''}">
- </div>
- `).join('')}
- </div>
- </div>`;
- }
- }
-
- function saveConfig() {
- const newSettings = { emotions: {}, actions: {} };
- // Emotions
- document.querySelectorAll('#config-body [data-emotion]').forEach(el => {
- if (el.value) newSettings.emotions[el.dataset.emotion] = el.value;
- });
- // Actions
- document.querySelectorAll('#config-body [data-action]').forEach(el => {
- const action = el.dataset.action;
- const field = el.dataset.field;
- if (!newSettings.actions[action]) newSettings.actions[action] = {};
- if (el.value) newSettings.actions[action][field] = el.value;
- });
-
- config.settings = newSettings;
- try {
- localStorage.setItem('pumpfun-agent-config', JSON.stringify(config.settings));
- toast('Configuration saved!', 'success');
- closeConfig();
- } catch (err) {
- console.error('Failed to save config', err);
- toast('Error saving configuration.', 'error');
- }
- }
-
- function loadConfig() {
- try {
- const saved = localStorage.getItem('pumpfun-agent-config');
- if (saved) {
- const parsed = JSON.parse(saved);
- if (parsed.emotions) config.settings.emotions = parsed.emotions;
- if (parsed.actions) config.settings.actions = parsed.actions;
- }
- } catch (err) {
- console.error('Failed to load config', err);
- }
- }
-
- $('config-save-btn').addEventListener('click', saveConfig);
- loadConfig();
-
- const params = {
- asset: url.searchParams.get('asset') || '',
- mint: url.searchParams.get('mint') || '',
- kind: url.searchParams.get('kind') || 'all',
- minTier: url.searchParams.get('minTier') || '',
- network: url.searchParams.get('network') || 'mainnet',
- narrate: url.searchParams.get('narrate') !== '0',
- announceMints: url.searchParams.get('announceMints') === '1',
- mood: url.searchParams.get('mood') || 'normal',
- avatar: url.searchParams.get('avatar') || '/avatars/cz.glb',
- mcMin: Number(url.searchParams.get('mcMin')) || 0,
- mcMax: Number(url.searchParams.get('mcMax')) || 0,
- minBuy: Number(url.searchParams.get('minBuy')) || 0,
- whale: Number(url.searchParams.get('whale')) || 0,
- };
- if (!['chill', 'normal', 'hype'].includes(params.mood)) params.mood = 'normal';
- $('ctl-asset').value = params.asset;
- $('ctl-mint').value = params.mint;
- $('ctl-kind').value = params.kind;
- $('ctl-tier').value = params.minTier;
- $('ctl-narrate').dataset.on = params.narrate ? '1' : '0';
- $('ctl-announce-mints').dataset.on = params.announceMints ? '1' : '0';
- $('ctl-mood').value = params.mood;
- $('ctl-mc-min').value = params.mcMin || '';
- $('ctl-mc-max').value = params.mcMax || '';
- $('ctl-min-buy').value = params.minBuy || '';
- $('ctl-whale').value = params.whale || '';
-
- // ── Avatar picker ────────────────────────────────────────────────────
- const DEFAULT_AVATARS = [
- { url: '/avatars/cz.glb', name: 'CZ', sub: 'Default narrator', emoji: '🟡' },
- { url: '/avatars/default.glb', name: 'Default', sub: 'Generic agent', emoji: '🤖' },
- ];
-
- // Tracks the picker selection independently of params.avatar so private
- // 'mine' avatars (which resolve to a presigned URL on click) still
- // highlight as selected when the picker reopens.
- let selectedAvatarId = null;
- const picker = {
- modal: $('avatar-picker'),
- body: $('picker-body'),
- search: $('picker-search'),
- customUrl: $('picker-custom-url'),
- customGo: $('picker-custom-go'),
- tabs: Array.from(document.querySelectorAll('.pf-tab')),
- trigger: $('ctl-avatar-btn'),
- label: $('ctl-avatar-label'),
- thumb: $('ctl-avatar-thumb'),
- activeTab: 'defaults',
- query: '',
- loaded: { defaults: true, community: false, mine: false },
- loading: { community: false, mine: false },
- data: { defaults: DEFAULT_AVATARS.map((a) => ({ ...a, _kind: 'default' })), community: [], mine: [] },
- cursor: { community: null, mine: null },
- hasMore: { community: false, mine: false },
- authed: null, // null = unknown, true/false after first /api/avatars probe
- lastFocus: null,
- };
-
- function openPicker() {
- picker.lastFocus = document.activeElement;
- picker.modal.dataset.open = 'true';
- picker.trigger.setAttribute('aria-expanded', 'true');
- document.body.style.overflow = 'hidden';
- renderPickerBody();
- // Pre-fetch lists for every tab so badges and switching feel instant.
- ensureLoaded('community');
- ensureLoaded('mine');
- setTimeout(() => picker.search.focus(), 30);
- }
- function closePicker() {
- picker.modal.dataset.open = 'false';
- picker.trigger.setAttribute('aria-expanded', 'false');
- document.body.style.overflow = '';
- picker.lastFocus?.focus?.();
- }
- picker.trigger.addEventListener('click', openPicker);
- picker.modal.addEventListener('click', (e) => {
- if (e.target === picker.modal || e.target.closest('[data-picker-close]')) closePicker();
- });
- document.addEventListener('keydown', (e) => {
- if (e.key === 'Escape' && picker.modal.dataset.open === 'true') closePicker();
- });
-
- picker.tabs.forEach((tab) => {
- tab.addEventListener('click', () => {
- picker.tabs.forEach((t) => t.setAttribute('aria-selected', String(t === tab)));
- picker.activeTab = tab.dataset.tab;
- renderPickerBody();
- ensureLoaded(picker.activeTab);
- });
- });
-
- picker.search.addEventListener('input', (e) => {
- picker.query = e.target.value.trim().toLowerCase();
- renderPickerBody();
- });
-
- picker.customGo.addEventListener('click', () => useCustomUrl());
- picker.customUrl.addEventListener('keydown', (e) => { if (e.key === 'Enter') useCustomUrl(); });
-
- function useCustomUrl() {
- const v = picker.customUrl.value.trim();
- if (!v) return;
- let parsed;
- try { parsed = new URL(v, location.href); } catch { alert('That does not look like a valid URL.'); return; }
- const path = parsed.pathname.toLowerCase();
- if (!/\.(glb|gltf|vrm)(\?|$)/.test(path + parsed.search)) {
- if (!confirm('URL does not end in .glb / .gltf / .vrm. Try anyway?')) return;
- }
- picker.customUrl.value = '';
- const name = parsed.pathname.split('/').pop() || 'Custom';
- selectAvatar({ url: parsed.href, name, sub: shortenUrl(parsed.href) });
- }
-
- function shortenUrl(u) {
- try { const x = new URL(u, location.href); return x.host + x.pathname.split('/').slice(-1)[0]; }
- catch { return u.slice(0, 40); }
- }
-
- async function ensureLoaded(tab) {
- if (tab === 'defaults' || picker.loaded[tab] || picker.loading[tab]) return;
- picker.loading[tab] = true;
- renderPickerBody();
- try {
- if (tab === 'community') {
- const r = await fetch('/api/avatars/public?limit=48');
- if (!r.ok) throw new Error('http ' + r.status);
- const data = await r.json();
- picker.data.community = (data.avatars || []).filter((a) => a.model_url).map((a) => ({
- id: a.id,
- url: a.model_url,
- name: a.name || a.slug || 'untitled',
- sub: a.description ? a.description.slice(0, 60) : 'community',
- thumbnail_url: a.thumbnail_url,
- visibility: a.visibility,
- _kind: 'community',
- }));
- picker.cursor.community = data.next_cursor;
- picker.hasMore.community = !!data.next_cursor;
- updateTabBadge('community', picker.data.community.length + (picker.hasMore.community ? '+' : ''));
- } else if (tab === 'mine') {
- const r = await fetch('/api/avatars?limit=100', { credentials: 'include' });
- if (r.status === 401) { picker.authed = false; picker.loaded.mine = true; return; }
- picker.authed = true;
- if (!r.ok) throw new Error('http ' + r.status);
- const data = await r.json();
- picker.data.mine = (data.avatars || []).map((a) => ({
- id: a.id,
- url: a.model_url, // null for private — we'll presign on click
- name: a.name || a.slug || 'untitled',
- sub: (a.visibility || 'private') + (a.description ? ' · ' + a.description.slice(0, 40) : ''),
- thumbnail_url: a.thumbnail_url,
- visibility: a.visibility,
- needsPresign: !a.model_url,
- _kind: 'mine',
- }));
- picker.cursor.mine = data.next_cursor;
- picker.hasMore.mine = !!data.next_cursor;
- updateTabBadge('mine', picker.data.mine.length + (picker.hasMore.mine ? '+' : ''));
- }
- picker.loaded[tab] = true;
- } catch (err) {
- console.warn('[picker] load failed', tab, err);
- } finally {
- picker.loading[tab] = false;
- renderPickerBody();
- }
- }
-
- async function loadMore(tab) {
- if (!picker.cursor[tab]) return;
- picker.loading[tab] = true;
- renderPickerBody();
- try {
- const cursor = encodeURIComponent(picker.cursor[tab]);
- const endpoint = tab === 'community'
- ? `/api/avatars/public?limit=48&cursor=${cursor}`
- : `/api/avatars?limit=100&cursor=${cursor}`;
- const opts = tab === 'mine' ? { credentials: 'include' } : {};
- const r = await fetch(endpoint, opts);
- if (!r.ok) throw new Error('http ' + r.status);
- const data = await r.json();
- const mapper = tab === 'community'
- ? (a) => ({ id: a.id, url: a.model_url, name: a.name || a.slug || 'untitled', sub: a.description ? a.description.slice(0, 60) : 'community', thumbnail_url: a.thumbnail_url, visibility: a.visibility, _kind: 'community' })
- : (a) => ({ id: a.id, url: a.model_url, name: a.name || a.slug || 'untitled', sub: (a.visibility || 'private') + (a.description ? ' · ' + a.description.slice(0, 40) : ''), thumbnail_url: a.thumbnail_url, visibility: a.visibility, needsPresign: !a.model_url, _kind: 'mine' });
- const incoming = (data.avatars || []).filter((a) => tab === 'mine' || a.model_url).map(mapper);
- picker.data[tab] = picker.data[tab].concat(incoming);
- picker.cursor[tab] = data.next_cursor;
- picker.hasMore[tab] = !!data.next_cursor;
- updateTabBadge(tab, picker.data[tab].length + (picker.hasMore[tab] ? '+' : ''));
- } catch (err) {
- console.warn('[picker] loadMore failed', tab, err);
- } finally {
- picker.loading[tab] = false;
- renderPickerBody();
- }
- }
-
- function updateTabBadge(tab, text) {
- const el = document.getElementById('tab-count-' + tab);
- if (el) el.textContent = text ? ' (' + text + ')' : '';
- }
-
- function renderPickerBody() {
- const body = picker.body;
- const tab = picker.activeTab;
- body.innerHTML = '';
-
- if (tab === 'mine' && picker.authed === false) {
- body.innerHTML = `<div class="pf-status">
- Sign in to use avatars you've created.
- <br><a class="cta" href="/login?next=${encodeURIComponent(location.pathname + location.search)}">Sign in</a>
- </div>`;
- return;
- }
- if (picker.loading[tab] && !picker.data[tab].length) {
- body.innerHTML = `<div class="pf-status">Loading…</div>`;
- return;
- }
-
- let items = picker.data[tab];
- if (picker.query) items = items.filter((a) => a.name.toLowerCase().includes(picker.query));
-
- if (!items.length) {
- const msg = tab === 'mine'
- ? `No avatars yet. <br><a class="cta" href="/create">Create your first agent</a>`
- : picker.query ? `No matches for "${escapeHtml(picker.query)}".` : 'Nothing here yet.';
- body.innerHTML = `<div class="pf-status">${msg}</div>`;
- return;
- }
-
- const grid = document.createElement('div');
- grid.className = 'pf-grid';
- items.forEach((a) => grid.appendChild(renderCard(a)));
- body.appendChild(grid);
-
- if (picker.hasMore[tab]) {
- const btn = document.createElement('button');
- btn.className = 'pf-loadmore';
- btn.textContent = picker.loading[tab] ? 'Loading…' : 'Load more';
- btn.disabled = picker.loading[tab];
- btn.addEventListener('click', () => loadMore(tab));
- body.appendChild(btn);
- }
- }
-
- function renderCard(a) {
- const card = document.createElement('button');
- card.type = 'button';
- card.className = 'pf-card';
- const isSelected = (a.id && a.id === selectedAvatarId) || (a.url && a.url === params.avatar);
- if (isSelected) card.dataset.selected = 'true';
- const thumbStyle = a.thumbnail_url ? `style="background-image:url('${attr(a.thumbnail_url)}')"` : '';
- const fallback = a.thumbnail_url ? '' : (a.emoji || '◇');
- const visTag = a._kind === 'mine' && a.visibility
- ? `<span class="vis-tag ${a.visibility === 'private' ? 'private' : ''}">${escapeHtml(a.visibility)}</span>`
- : '';
- card.innerHTML = `
- <div class="thumb" ${thumbStyle}>${fallback}${visTag}<span class="selected-mark">✓</span></div>
- <div class="meta">
- <div class="name">${escapeHtml(a.name)}</div>
- <div class="sub">${escapeHtml(a.sub || '')}</div>
- </div>
- `;
- card.addEventListener('click', () => selectAvatar(a, card));
- return card;
- }
-
- async function selectAvatar(a, cardEl) {
- let resolvedUrl = a.url;
- if (a.needsPresign) {
- if (cardEl) { cardEl.style.opacity = '0.5'; cardEl.style.pointerEvents = 'none'; }
- try {
- const r = await fetch(`/api/avatars/${encodeURIComponent(a.id)}`, { credentials: 'include' });
- if (!r.ok) throw new Error('http ' + r.status);
- const { avatar } = await r.json();
- resolvedUrl = avatar?.url || avatar?.model_url;
- if (!resolvedUrl) throw new Error('no url');
- } catch (err) {
- alert('Could not load that avatar (' + (err.message || 'error') + ').');
- if (cardEl) { cardEl.style.opacity = ''; cardEl.style.pointerEvents = ''; }
- return;
- }
- }
- params.avatar = resolvedUrl;
- selectedAvatarId = a.id || null;
- updateTriggerLabel(a);
- syncURL();
- mountAgent();
- closePicker();
- }
-
- function updateTriggerLabel(a) {
- picker.label.textContent = a.name || 'Avatar';
- if (a.thumbnail_url) {
- picker.thumb.style.backgroundImage = `url('${a.thumbnail_url}')`;
- picker.thumb.textContent = '';
- } else {
- picker.thumb.style.backgroundImage = '';
- picker.thumb.textContent = '';
- }
- }
-
- updateTabBadge('defaults', String(picker.data.defaults.length));
-
- // Initial label from URL param
- (function initTriggerLabel() {
- const preset = DEFAULT_AVATARS.find((a) => a.url === params.avatar);
- if (preset) { updateTriggerLabel(preset); return; }
- updateTriggerLabel({ name: 'Custom', sub: shortenUrl(params.avatar) });
- // Try to upgrade label once lists load
- const tryMatch = () => {
- const all = picker.data.defaults.concat(picker.data.community, picker.data.mine);
- const m = all.find((a) => a.url === params.avatar);
- if (m) updateTriggerLabel(m);
- };
- ensureLoaded('community').then(tryMatch);
- ensureLoaded('mine').then(tryMatch);
- })();
-
- function setStatus(state, label) {
- const dot = $('status-dot');
- dot.className = 'dot ' + state;
- $('status-label').textContent = label;
- $('status-pill').dataset.state = state;
- }
- $('status-pill').addEventListener('click', () => {
- if ($('status-pill').dataset.state === 'down' || $('status-pill').dataset.state === 'connecting') {
- connectFeed();
- }
- });
-
- function syncURL() {
- const u = new URL(location.href);
- const set = (k, v) => v ? u.searchParams.set(k, v) : u.searchParams.delete(k);
- set('asset', params.asset);
- set('mint', params.mint);
- set('kind', params.kind === 'all' ? '' : params.kind);
- set('minTier', params.minTier);
- set('narrate', params.narrate ? '' : '0');
- set('announceMints', params.announceMints ? '1' : '');
- set('avatar', params.avatar === '/avatars/cz.glb' ? '' : params.avatar);
- set('mcMin', params.mcMin || '');
- set('mcMax', params.mcMax || '');
- set('minBuy', params.minBuy || '');
- set('whale', params.whale || '');
- history.replaceState(null, '', u.toString());
- }
-
- async function mountAgent() {
- const cfgPart = `&type=pumpfun-feed&kind=${encodeURIComponent(params.kind)}` +
- (params.minTier ? `&minTier=${encodeURIComponent(params.minTier)}` : '') +
- (params.narrate ? '' : '&narrate=0');
- let modelHash = '&model=' + encodeURIComponent(params.avatar || '/avatars/cz.glb');
- const widgetId = 'wdgt_demo_pumpfun';
- if (params.asset) {
- try {
- const r = await fetch(`/api/agents/solana-card?asset=${encodeURIComponent(params.asset)}`);
- if (r.ok) {
- const card = await r.json();
- renderAgentCard(card);
- const avatarUrl = card?.identity?.avatar_url || card?.avatar_url;
- if (avatarUrl) modelHash = `&model=${encodeURIComponent(avatarUrl)}`;
- }
- const repR = await fetch(`/api/agents/solana-reputation?asset=${encodeURIComponent(params.asset)}&network=${params.network}`);
- if (repR.ok) renderSignals(await repR.json());
- } catch {}
- } else {
- $('agent-card').innerHTML = `<div class="empty">Custom avatar narrator. Paste a Solana asset pubkey above to bind a different agent.</div>`;
- $('signals-section').hidden = true;
- }
- iframe.src = `/app#widget=${widgetId}&kiosk=true${cfgPart}${modelHash}`;
- resetBridge();
- }
-
- // ── Animation chips → iframe gesture bridge ─────────────────────────
- const BRIDGE_VERSION = 1;
- let bridgeReady = false;
- let bridgeQueue = [];
- let activeChipName = null;
- let manifestPromise = null;
-
- function genId() {
- if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function')
- return crypto.randomUUID();
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
- const r = (Math.random() * 16) | 0;
- return (c === 'x' ? r : (r & 0x3) | 0x8).toString(16);
- });
- }
-
- function resetBridge() {
- bridgeReady = false;
- bridgeQueue = [];
- activeChipName = null;
- lastClipsKey = '';
- document.querySelectorAll('.anim-chip').forEach((c) => delete c.dataset.active);
- }
-
- function sendToAgent(op, payload) {
- const msg = { v: BRIDGE_VERSION, source: 'agent-host', id: genId(), kind: 'request', op, payload };
- if (bridgeReady) {
- iframe.contentWindow?.postMessage(msg, location.origin);
- } else {
- bridgeQueue.push(msg);
- }
- }
-
- window.addEventListener('message', (event) => {
- if (event.source !== iframe.contentWindow) return;
- if (event.origin !== location.origin) return;
- const msg = event.data;
- if (!msg || msg.v !== BRIDGE_VERSION || msg.source !== 'agent-3d') return;
- if (msg.kind === 'event' && msg.op === 'ready') {
- iframe.contentWindow.postMessage(
- { v: BRIDGE_VERSION, source: 'agent-host', id: genId(), kind: 'request', op: 'ping', payload: {} },
- location.origin,
- );
- return;
- }
- if (msg.kind === 'response' && msg.op === 'pong') {
- const wasReady = bridgeReady;
- bridgeReady = true;
- for (const m of bridgeQueue) iframe.contentWindow.postMessage(m, location.origin);
- bridgeQueue = [];
- const caps = msg.payload?.capabilities || [];
- // Subscribe so the embed pushes us `op:'clips'` change events when
- // the loaded model swaps inside the same iframe (otherwise those
- // events stay queued in the embed and we'd only see them on reload).
- if (!wasReady && caps.includes('subscribe')) {
- sendToAgent('subscribe', {});
- }
- // Pull authoritative clip list from the iframe — replaces the
- // manifest-only fallback whenever the loaded model has its own
- // non-Mixamo skeleton (e.g. RobotExpressive bakes 7 emotes).
- if (caps.includes('listClips')) {
- sendToAgent('listClips', {});
- }
- return;
- }
- if (msg.kind === 'response' && msg.op === 'listClips') {
- const clips = msg.payload?.clips || [];
- if (clips.length) renderAnimChips(clips);
- return;
- }
- if (msg.kind === 'event' && msg.op === 'clips') {
- const clips = msg.payload?.clips || [];
- if (clips.length) renderAnimChips(clips);
- return;
- }
- });
-
- function loadManifest() {
- if (!manifestPromise) {
- manifestPromise = fetch('/animations/manifest.json')
- .then((r) => r.json())
- .catch(() => []);
- }
- return manifestPromise;
- }
-
- function chipLabel(def) {
- const icon = def.icon || '✨';
- const label = (def.label || def.name).replace(/\s*\([^)]*\)/g, '').trim();
- return icon + ' ' + label;
- }
-
- // Clips that are part of the agent's idle/locomotion state machine and
- // shouldn't appear as user-triggerable chips (firing them via gesture
- // would interrupt the embed's automatic state loop).
- const SYSTEM_CLIPS = new Set(['idle', 'walk', 'walking', 'running', 'run']);
-
- // Tracks the rendered clip list so we don't redundantly rebuild on every
- // duplicate `op:'clips'` event from the iframe.
- let lastClipsKey = '';
- let oneShotResetTimer = null;
- let chipDefs = []; // currently-rendered defs, indexed for keyboard shortcuts.
-
- function clearActiveChip() {
- activeChipName = null;
- document.querySelectorAll('.anim-chip').forEach((c) => delete c.dataset.active);
- }
-
- function triggerChip(def) {
- document.querySelectorAll('.anim-chip').forEach((c) => delete c.dataset.active);
- const target = document.querySelector(`.anim-chip[data-anim="${CSS.escape(def.name)}"]`);
- if (target) target.dataset.active = 'true';
- activeChipName = def.name;
- // Loop-aware: looping clips (dance/thriller/capoeira) keep running until
- // the user picks another chip; the embed's avatar layer auto-reverts
- // one-shots to idle (~1.5s) — we mirror that timing on the chip.
- sendToAgent('gesture', { name: def.name, loop: !!def.loop });
- clearTimeout(oneShotResetTimer);
- if (!def.loop) {
- oneShotResetTimer = setTimeout(() => {
- if (activeChipName === def.name) clearActiveChip();
- }, 1800);
- }
- }
-
- function renderAnimChips(defs) {
- const wrap = $('anim-chips');
- if (!wrap) return;
- const safe = Array.isArray(defs)
- ? defs.filter((d) => d && d.name && !SYSTEM_CLIPS.has(d.name.toLowerCase()))
- : [];
- const key = safe.map((d) => d.name + '|' + (d.loop ? 'L' : 'O')).join(',');
- if (key === lastClipsKey && wrap.childElementCount === safe.length) return;
- lastClipsKey = key;
- chipDefs = safe;
- wrap.innerHTML = '';
- if (!safe.length) {
- wrap.dataset.state = 'empty';
- wrap.innerHTML = '<span class="anim-empty">no animations available for this avatar</span>';
- return;
- }
- wrap.dataset.state = 'ready';
- safe.forEach((def, idx) => {
- const btn = document.createElement('button');
- btn.type = 'button';
- btn.className = 'anim-chip';
- btn.dataset.anim = def.name;
- btn.dataset.source = def.source || 'manifest';
- btn.dataset.loop = def.loop ? 'true' : 'false';
- const shortcut = idx < 9 ? ` [${idx + 1}]` : '';
- btn.title =
- (def.source === 'glb' ? `${def.name} (baked clip)` : def.name) +
- (def.loop ? ' · loops' : ' · one-shot') +
- shortcut;
- btn.textContent = chipLabel(def);
- if (def.name === activeChipName) btn.dataset.active = 'true';
- btn.addEventListener('click', () => triggerChip(def));
- wrap.appendChild(btn);
- });
- }
-
- // Keyboard shortcuts: digits 1-9 trigger the first 9 chips, "Esc" returns
- // to idle. Disabled while typing into form fields so the asset-pubkey and
- // mint-filter inputs continue to behave normally.
- window.addEventListener('keydown', (e) => {
- if (e.metaKey || e.ctrlKey || e.altKey) return;
- const tag = (e.target?.tagName || '').toLowerCase();
- if (tag === 'input' || tag === 'textarea' || tag === 'select') return;
- if (e.target?.isContentEditable) return;
- if (e.key >= '1' && e.key <= '9') {
- const idx = Number(e.key) - 1;
- const def = chipDefs[idx];
- if (def) {
- e.preventDefault();
- triggerChip(def);
- }
- } else if (e.key === 'Escape' && activeChipName) {
- clearActiveChip();
- // Return to idle to stop the looping clip currently playing.
- sendToAgent('gesture', { name: 'idle', loop: true });
- }
- });
-
- async function buildAnimChips() {
- // Initial paint from the manifest. The iframe replaces this with its
- // authoritative clip list (`op:'clips'`) once the model is loaded —
- // e.g. baked-only for RobotExpressive (skeletal mismatch with Mixamo).
- const defs = await loadManifest();
- renderAnimChips(defs);
- }
-
- function renderAgentCard(card) {
- const id = card?.identity || {};
- $('agent-card').innerHTML = `
- <div class="kv"><span>Name</span><strong>${escapeHtml(card?.name || '—')}</strong></div>
- <div class="kv"><span>Network</span><code>${escapeHtml(id.network || '—')}</code></div>
- <div class="kv"><span>Asset</span><code>${shortKey(id.asset_pubkey || '')}</code></div>
- ${id.owner ? `<div class="kv"><span>Owner</span><code>${shortKey(id.owner)}</code></div>` : ''}
- ${id.passport_url ? `<div class="kv"><span>Passport</span><a href="${attr(id.passport_url)}" target="_blank">open ↗</a></div>` : ''}
- `;
- }
-
- function renderSignals(rep) {
- const pf = rep?.pumpfun_signals || { count: 0, weight: 0, by_kind: {} };
- const section = $('signals-section');
- const el = $('signals');
- if (!pf.count) { section.hidden = true; return; }
- section.hidden = false;
- const cards = [
- `<div class="signal"><div class="v">${pf.count}</div><div class="l">total signals</div></div>`,
- `<div class="signal ${pf.weight < 0 ? 'neg' : ''}"><div class="v">${pf.weight >= 0 ? '+' : ''}${pf.weight.toFixed(2)}</div><div class="l">aggregate weight</div></div>`,
- ...Object.entries(pf.by_kind).map(([k, info]) =>
- `<div class="signal ${info.weight < 0 ? 'neg' : ''}"><div class="v">${info.count}</div><div class="l">${escapeHtml(k.replace('_', ' '))}</div></div>`),
- ];
- el.innerHTML = cards.join('');
- }
-
- // ── Draggable panel ──────────────────────────────────────────────────
- const side = $('side');
- const sideHeader = $('side-header');
- if (side && sideHeader) {
- let isDragging = false;
- let offsetX, offsetY;
- sideHeader.addEventListener('mousedown', (e) => {
- if (e.target.closest('.side-control-btn')) return;
- isDragging = true;
- offsetX = e.clientX - side.offsetLeft;
- offsetY = e.clientY - side.offsetTop;
- document.body.style.cursor = 'move';
- document.body.style.userSelect = 'none';
- });
- document.addEventListener('mousemove', (e) => {
- if (!isDragging) return;
- e.preventDefault();
-
- const main = document.querySelector('main.pf-main');
- const parentRect = main.getBoundingClientRect();
- const sideRect = side.getBoundingClientRect();
-
- let newLeft = e.clientX - offsetX;
- let newTop = e.clientY - offsetY;
-
- // Constrain to parent (main element)
- newLeft = Math.max(0, Math.min(newLeft, main.offsetWidth - side.offsetWidth));
- newTop = Math.max(0, Math.min(newTop, main.offsetHeight - side.offsetHeight));
-
- side.style.left = `${newLeft}px`;
- side.style.top = `${newTop}px`;
- side.style.right = 'auto';
- side.style.bottom = 'auto';
- });
- document.addEventListener('mouseup', () => {
- isDragging = false;
- document.body.style.cursor = '';
- document.body.style.userSelect = '';
- });
- const minimizeBtn = $('side-minimize');
- if (minimizeBtn) {
- minimizeBtn.addEventListener('click', () => {
- side.classList.toggle('minimized');
- });
- }
- const closeBtn = $('side-close');
- if (closeBtn) {
- closeBtn.addEventListener('click', () => {
- side.style.display = 'none';
- if ($('side-toggle')) {
- $('side-toggle').setAttribute('aria-pressed', 'false');
- document.body.classList.remove('side-open');
- }
- });
- }
- // When side-toggle is used (mobile), ensure panel is visible
- if ($('side-toggle')) {
- $('side-toggle').addEventListener('click', () => {
- if (side.style.display === 'none') {
- side.style.display = 'flex';
- }
- });
- }
- }
-
-
- // ── Live event feed (host-side, mirrors what the iframe receives) ────
- let es = null;
- const TIER_BADGE = { mega: '🔥🔥', influencer: '🔥', notable: '⭐' };
- const MAX_EVENTS = 30;
-
- // Host-side reaction map. Mirrors src/widgets/pumpfun-reactions.js so
- // the avatar reacts even when the in-iframe widget overlay is hidden.
- const REACT_COOLDOWN_MS = 2200;
- const REACT_DEDUPE_MS = 30000;
- const REACT_MAX_QUEUE = 6;
- const REACT_MAX_HISTORY = 50;
- const MOOD_PROFILE = {
- chill: { gestureScale: 0.7, threshold: 30, speakRate: 0.4 },
- normal: { gestureScale: 1.0, threshold: 0, speakRate: 1.0 },
- hype: { gestureScale: 1.25, threshold: -20, speakRate: 1.5 },
- };
- const _reactSeen = new Map();
- let _reactActiveUntil = 0;
- let _reactActivePri = 0;
- const _reactQueue = [];
- const _reactHistory = [];
- let _reactQueueTimer = null;
-
- function reactionFor(kind, ev) {
- if (!ev) return null;
- let r = _baseReaction(kind, ev);
- if (!r) return null;
- const profile = MOOD_PROFILE[params.mood] || MOOD_PROFILE.normal;
- const priority = (r.priority || 0) + profile.threshold;
- if (priority < 0) return null;
- if (r.gesture) r.gesture = { ...r.gesture, duration: Math.round(r.gesture.duration * profile.gestureScale) };
- r.priority = priority;
- return r;
- }
-
- function _baseReaction(kind, ev) {
- const symbol = ev.symbol || ev.token_symbol || '';
- const name = ev.name || ev.token_name || symbol || 'a token';
- const num = (x) => { const n = Number(x); return Number.isFinite(n) ? n : 0; };
- const mcInitial = num(ev.market_cap_usd_initial ?? ev.initial_market_cap_usd ?? ev.market_cap_at_launch);
- const mcCurrent = num(ev.usd_market_cap ?? ev.market_cap_usd ?? ev.market_cap);
- const mcMultiple = mcInitial && mcCurrent ? mcCurrent / mcInitial : 0;
- const lifetimeSol = num(ev.lifetime_claim_sol ?? ev.lifetime_sol);
- const creatorLaunches = num(ev.creator_launches);
- const creatorGraduated = num(ev.creator_graduated);
- const ghLinked = !!(ev.github_user || ev.github_repo || ev.github_account_age_days != null);
- const ghVerified = !!(ev.verified ?? ev.signal_verified);
- const ghCredible = ghLinked && (num(ev.github_account_age_days) >= 365 || num(ev.github_followers) >= 50 || num(ev.github_repo_stars ?? ev.repo_stars) >= 10);
- const isWhaleClaim = lifetimeSol >= 50;
- const isSerialCreator = creatorGraduated >= 3;
- const isDevRelaunch = creatorLaunches >= 2 && creatorGraduated === 0;
- const fmtMult = (m) => !Number.isFinite(m) || m <= 0 ? '—' : m >= 100 ? Math.round(m)+'×' : m >= 10 ? m.toFixed(0)+'×' : m.toFixed(1)+'×';
- const fmtSol = (n) => !Number.isFinite(n) || n <= 0 ? '0 SOL' : n >= 1000 ? Math.round(n)+' SOL' : n.toFixed(2)+' SOL';
-
- if (kind === 'graduation') {
- const ageSec = ev.created_at ? Math.max(0, Math.floor(Date.now() / 1000) - Number(ev.created_at)) : 0;
- const fresh = ageSec === 0 || ageSec < 1800;
- const stale = ageSec > 86400;
- if (mcMultiple >= 100) return { variant:'graduation_moonshot', icon:'🚀🌕', emote:{ trigger:'celebration', weight:1 }, gesture:{ name:'thriller', duration:9000 }, speak:{ text:`Moonshot! $${symbol||name} just went ${fmtMult(mcMultiple)} — bonded to PumpAMM.`, sentiment:0.95 }, lookAt:'camera', priority:100 };
- if (mcMultiple >= 10) return { variant:'graduation_giant', icon:'🎓🔥', emote:{ trigger:'celebration', weight:0.95 }, gesture:{ name:'rumba', duration:7000 }, speak:{ text:`Giant pump: $${symbol||name} ${fmtMult(mcMultiple)} into PumpAMM.`, sentiment:0.85 }, lookAt:'camera', priority:95 };
- if (isSerialCreator) return { variant:'graduation_serial_dev', icon:'🎓👑', emote:{ trigger:'celebration', weight:0.85 }, gesture:{ name:'capoeira', duration:6500 }, speak:{ text:`Serial creator strikes again — $${symbol||name} graduated. ${creatorGraduated} grads now.`, sentiment:0.7 }, lookAt:'camera', priority:92 };
- const dur = stale ? 2500 : Math.min(9000, Math.max(4500, 4500 + Math.log10(Math.max(mcMultiple,1)+1)*1500));
- const mcPart = mcCurrent > 0 ? ` at ${formatMcSpoken(mcCurrent)} market cap` : '';
- const ageWord = ev.age ? ` after ${ageWordSpoken(ev.age)}` : '';
- const launchesPart = creatorLaunches > 1 ? ` Dev's ${ordinalSpoken(creatorLaunches)} launch.` : '';
- return {
- variant: stale ? 'graduation_stale' : 'graduation_standard',
- icon: stale ? '🎓⏳' : '🎓',
- emote: { trigger: 'celebration', weight: stale ? 0.4 : fresh ? 0.95 : 0.7 },
- gesture: { name: stale ? 'wave' : 'rumba', duration: dur },
- speak: { text: `${symbol||name} bonded to PumpAMM${mcPart}${ageWord}.${launchesPart}`, sentiment: stale ? 0.3 : 0.7 },
- lookAt: 'camera',
- priority: stale ? 40 : 90,
- };
- }
- if (kind === 'claim') {
- if (ev.fake_claim) {
- const who = ev.github_user ? '@' + ev.github_user : shortAddrLocal(ev.claimer);
- return { variant:'claim_fake', icon:'⚠️', emote:{ trigger:'concern', weight:0.85 }, gesture:{ name:'shake', duration:1800 }, speak:{ text:`Fake claim spotted from ${who}. Ignore it.`, sentiment:-0.6 }, lookAt:'down', priority:75 };
- }
- if (ev.first_time_claim) {
- if (ghCredible && ghVerified) return { variant:'claim_first_verified_credible', icon:'🚨✅', emote:{ trigger:'celebration', weight:1 }, gesture:{ name:'thriller', duration:6000 }, speak:{ text:`Verified first claim by @${ev.github_user}${ev.ai_take?' — '+ev.ai_take:''}.`, sentiment:0.85 }, lookAt:'camera', priority:88 };
- if (ghLinked && ghVerified) return { variant:'claim_first_verified', icon:'🚨', emote:{ trigger:'celebration', weight:0.95 }, gesture:{ name:'silly', duration:5500 }, speak:{ text:`First claim by @${ev.github_user||'dev'}${ev.ai_take?' — '+ev.ai_take:''}.`, sentiment:0.8 }, lookAt:'camera', priority:86 };
- if (ghLinked) return { variant:'claim_first_unverified_gh', icon:'🚨❓', emote:{ trigger:'curiosity', weight:0.7 }, gesture:{ name:'capoeira', duration:4500 }, speak:{ text:`First claim — @${ev.github_user||'dev'} unverified. Watch closely.`, sentiment:0.4 }, lookAt:'token', priority:82 };
- if (isWhaleClaim) return { variant:'claim_first_whale', icon:'🐋', emote:{ trigger:'celebration', weight:0.85 }, gesture:{ name:'taunt', duration:3000 }, speak:{ text:`Whale claimer — ${fmtSol(lifetimeSol)} lifetime on $${symbol||'this'}.`, sentiment:0.6 }, lookAt:'token', priority:80 };
- return { variant:'claim_first_raw', icon:'🚨', emote:{ trigger:'celebration', weight:0.85 }, gesture:{ name:'celebrate', duration:4500 }, speak:{ text:`First-time claim on $${symbol||'a new token'}.`, sentiment:0.7 }, lookAt:'camera', priority:78 };
- }
- if (isWhaleClaim) return { variant:'claim_whale_repeat', icon:'🐋', emote:{ trigger:'curiosity', weight:0.6 }, gesture:{ name:'taunt', duration:2200 }, speak:{ text:`Whale claim — ${fmtSol(num(ev.amount_sol))} on $${symbol||'token'}.`, sentiment:0.4 }, lookAt:'token', priority:55 };
- if (ev.tier === 'mega') return { variant:'claim_tier_mega', icon:'🔥🔥', emote:{ trigger:'celebration', weight:0.7 }, gesture:{ name:'taunt', duration:2500 }, speak:{ text:`Mega claim — ${fmtSol(num(ev.amount_sol))}.`, sentiment:0.5 }, lookAt:'token', priority:50 };
- if (ev.tier === 'influencer') return { variant:'claim_tier_influencer', icon:'🔥', emote:{ trigger:'curiosity', weight:0.55 }, gesture:{ name:'reaction', duration:1800 }, speak:{ text:`Influencer claim on $${symbol||'token'}.`, sentiment:0.3 }, lookAt:'token', priority:35 };
- if (ev.tier === 'notable') return { variant:'claim_tier_notable', icon:'⭐', emote:{ trigger:'curiosity', weight:0.4 }, speak:{ text:`Notable claim seen.`, sentiment:0.2 }, lookAt:'token', priority:20 };
- return null;
- }
- if (kind === 'mint') {
- const initSol = num(ev.initial_buy_sol);
- if (initSol >= 20) return { variant:'mint_giant_buy', icon:'🚀💸', emote:{ trigger:'curiosity', weight:0.85 }, gesture:{ name:'jump', duration:2000 }, speak:{ text:`Massive launch: $${symbol||'new token'} opens with ${fmtSol(initSol)}.`, sentiment:0.6 }, lookAt:'camera', priority:60 };
- if (isDevRelaunch) return { variant:'mint_dev_relaunch', icon:'🔁', emote:{ trigger:'concern', weight:0.5 }, gesture:{ name:'reaction', duration:1600 }, speak:{ text:`Dev's back — ${creatorLaunches} launches, 0 grads. $${symbol}.`, sentiment:-0.2 }, lookAt:'down', priority:40 };
- if (isSerialCreator) return { variant:'mint_serial_creator', icon:'👑', emote:{ trigger:'curiosity', weight:0.7 }, gesture:{ name:'wave', duration:1500 }, speak:{ text:`Pro dev launching $${symbol||'a new token'} — ${creatorGraduated} prior grads.`, sentiment:0.5 }, lookAt:'camera', priority:45 };
- if (ev.tier === 'mega' || initSol >= 5) return { variant:'mint_notable', icon:'🌱🔥', emote:{ trigger:'curiosity', weight:0.55 }, gesture:{ name:'wave', duration:1500 }, speak:{ text:`New token $${symbol||'?'} — ${fmtSol(initSol)} initial.`, sentiment:0.3 }, lookAt:'token', priority:25 };
- if (ev.tier === 'influencer' || initSol >= 1) return { variant:'mint_warm', icon:'🌱', emote:{ trigger:'curiosity', weight:0.35 }, lookAt:'token', priority:10 };
- return null;
- }
- return null;
- }
-
- function _recordReaction(reaction, kind, ev) {
- _reactHistory.push({ at: Date.now(), kind, variant: reaction.variant || kind, icon: reaction.icon || '✨', symbol: ev?.symbol || ev?.token_symbol || '', mint: ev?.mint || ev?.token_mint || '' });
- while (_reactHistory.length > REACT_MAX_HISTORY) _reactHistory.shift();
- renderReactionPanel();
- showReactionToast(reaction, ev);
- }
-
- function _fireReaction(reaction, kind, ev) {
- const dur = reaction.gesture?.duration || REACT_COOLDOWN_MS;
- _reactActiveUntil = Date.now() + Math.max(REACT_COOLDOWN_MS, dur);
- _reactActivePri = reaction.priority || 0;
- _recordReaction(reaction, kind, ev);
- iframe.contentWindow?.postMessage(
- { type: 'pumpfun-feed:react', reaction, speak: params.narrate },
- location.origin,
- );
- }
-
- function _drainReactionQueue() {
- _reactQueueTimer = null;
- if (!_reactQueue.length) return;
- const t = Date.now();
- if (t < _reactActiveUntil) {
- _reactQueueTimer = setTimeout(_drainReactionQueue, _reactActiveUntil - t + 5);
- return;
- }
- _reactQueue.sort((a, b) => b.priority - a.priority);
- const next = _reactQueue.shift();
- const reaction = reactionFor(next.kind, next.ev);
- if (reaction) _fireReaction(reaction, next.kind, next.ev);
- if (_reactQueue.length) _reactQueueTimer = setTimeout(_drainReactionQueue, REACT_COOLDOWN_MS + 5);
- }
-
- function dispatchReaction(kind, ev) {
- if (kind === 'mint' && !params.announceMints) return;
- const reaction = reactionFor(kind, ev);
- if (!reaction) return;
- const t = Date.now();
- const mint = ev?.mint || ev?.token_mint;
- const key = mint ? (kind === 'claim' ? `claim:${mint}:${ev?.tx_signature || ev?.signature || ev?.claim_number || ''}` : `${kind}:${mint}`) : null;
- if (key) {
- const last = _reactSeen.get(key);
- if (last != null && t - last < REACT_DEDUPE_MS) return;
- _reactSeen.set(key, t);
- if (_reactSeen.size > 200) {
- for (const [k, v] of _reactSeen) if (t - v > REACT_DEDUPE_MS) _reactSeen.delete(k);
- }
- }
- const pri = reaction.priority || 0;
- if (t < _reactActiveUntil) {
- if (pri > _reactActivePri) {
- _fireReaction(reaction, kind, ev);
- } else if (pri >= 30 && _reactQueue.length < REACT_MAX_QUEUE) {
- _reactQueue.push({ kind, ev, priority: pri });
- if (!_reactQueueTimer) _reactQueueTimer = setTimeout(_drainReactionQueue, _reactActiveUntil - t + 5);
- }
- return;
- }
- _fireReaction(reaction, kind, ev);
- }
-
- // ── Visual reaction toast over the stage ───────────────────────────
- function showReactionToast(reaction, ev) {
- const stage = $('stage');
- if (!stage) return;
- let host = $('reaction-toast-host');
- if (!host) {
- host = document.createElement('div');
- host.id = 'reaction-toast-host';
- host.style.cssText = 'position:absolute;left:16px;top:16px;display:flex;flex-direction:column;gap:6px;pointer-events:none;z-index:7';
- stage.appendChild(host);
- }
- const el = document.createElement('div');
- el.style.cssText = 'background:rgba(20,20,28,0.85);border:1px solid rgba(255,255,255,0.12);border-radius:999px;padding:6px 12px;color:#fff;font-size:12px;display:flex;gap:8px;align-items:center;box-shadow:0 4px 14px rgba(0,0,0,0.45);opacity:0;transform:translateY(-4px);transition:opacity .22s ease,transform .22s ease;max-width:280px';
- const sym = ev?.symbol || ev?.token_symbol || '';
- const variant = (reaction.variant || '').replace(/_/g, ' ');
- el.innerHTML = `<span style="font-size:16px">${reaction.icon || '✨'}</span><span style="font-weight:600">${escapeHtml(variant)}</span>${sym ? `<span style="opacity:0.7">$${escapeHtml(sym)}</span>` : ''}`;
- host.appendChild(el);
- requestAnimationFrame(() => { el.style.opacity = '1'; el.style.transform = 'translateY(0)'; });
- const lifeMs = Math.max(2200, (reaction.gesture?.duration || 1500) - 500);
- setTimeout(() => {
- el.style.opacity = '0';
- el.style.transform = 'translateY(-4px)';
- setTimeout(() => el.remove(), 250);
- }, lifeMs);
- while (host.children.length > 4) host.firstChild?.remove();
- }
-
- // ── Side-rail reaction history ──────────────────────────────────────
- function renderReactionPanel() {
- const el = $('reaction-history');
- if (!el) return;
- if (!_reactHistory.length) { el.innerHTML = '<div class="empty">No reactions yet…</div>'; return; }
- const recent = _reactHistory.slice().reverse().slice(0, 12);
- el.innerHTML = recent.map((h) => {
- const ago = Math.max(0, Math.floor((Date.now() - h.at) / 1000));
- const agoStr = ago < 60 ? ago + 's' : Math.floor(ago / 60) + 'm';
- return `<div class="rh-row" title="${escapeHtml(h.variant)}">
- <span class="rh-ic">${h.icon}</span>
- <span class="rh-var">${escapeHtml(h.variant.replace(/_/g, ' '))}</span>
- ${h.symbol ? `<span class="rh-sym">$${escapeHtml(h.symbol)}</span>` : ''}
- <span class="rh-ago">${agoStr}</span>
- </div>`;
- }).join('');
- }
-
- function eventMatchesFilters(ev) {
- if (params.mint && ev?.mint !== params.mint && ev?.token_mint !== params.mint) return false;
- const mc = ev?.usd_market_cap ?? ev?.market_cap_usd ?? ev?.market_cap ?? null;
- if (params.mcMin && mc != null && mc < params.mcMin) return false;
- if (params.mcMax && mc != null && mc > params.mcMax) return false;
- const initBuy = ev?.initial_buy_sol ?? null;
- if (params.minBuy && initBuy != null && initBuy < params.minBuy) return false;
- const tradeSol = ev?.initial_buy_sol ?? ev?.amount_sol ?? null;
- if (params.whale && tradeSol != null && tradeSol < params.whale) return false;
- return true;
- }
-
- function shortAddrLocal(s) {
- const str = String(s || '');
- if (!str) return 'unknown';
- if (str.length <= 12) return str;
- return `${str.slice(0, 4)}…${str.slice(-4)}`;
- }
-
- function fmtUsd(n) {
- if (n == null) return '';
- return '$' + Number(n).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
- }
- function fmtSol(n) {
- if (n == null) return '';
- return Number(n).toFixed(3) + ' SOL';
- }
- // Speech-friendly market-cap formatter — "$245k", "$1.2 million", "$24 thousand".
- function formatMcSpoken(n) {
- n = Number(n);
- if (!isFinite(n) || n <= 0) return '';
- if (n >= 1_000_000_000) return `$${(n / 1_000_000_000).toFixed(1)} billion`;
- if (n >= 1_000_000) return `$${(n / 1_000_000).toFixed(1)} million`;
- if (n >= 1_000) return `$${Math.round(n / 1_000)} thousand`;
- return `$${Math.round(n)}`;
- }
- // Convert a compact age tag like "3m" / "2h" / "1d" into spoken words
- // the TTS layer reads naturally ("3 minutes", "2 hours").
- function ageWordSpoken(age) {
- const m = String(age || '').match(/^(\d+)([smhd])$/);
- if (!m) return age || '';
- const n = Number(m[1]);
- const unit = { s: 'second', m: 'minute', h: 'hour', d: 'day' }[m[2]];
- return `${n} ${unit}${n === 1 ? '' : 's'}`;
- }
- function ordinalSpoken(n) {
- const i = Math.abs(Math.floor(Number(n) || 0));
- if (i === 1) return 'first';
- if (i === 2) return 'second';
- if (i === 3) return 'third';
- const s = ['th', 'st', 'nd', 'rd'];
- const v = i % 100;
- return i + (s[(v - 20) % 10] || s[v] || s[0]);
- }
- function timeAgo(ts) {
- if (!ts) return '';
- const s = Math.floor(Date.now() / 1000) - ts;
- if (s < 60) return s + 's ago';
- if (s < 3600) return Math.floor(s / 60) + 'm ago';
- return Math.floor(s / 3600) + 'h ago';
- }
- function toolLinks(mint) {
- const m = encodeURIComponent(mint);
- return [
- ['pump.fun', `https://pump.fun/coin/${mint}`],
- ['DEX', `https://dexscreener.com/solana/${mint}`],
- ['Axiom', `https://axiom.trade/meme/${mint}`],
- ['GMGN', `https://gmgn.ai/sol/token/${mint}`],
- ['BullX', `https://bullx.io/terminal?chainId=1399811149&address=${mint}`],
- ['Photon', `https://photon-sol.tinyastro.io/en/r/@bonk/${mint}`],
- ].map(([label, url]) => `<a href="${attr(url)}" target="_blank" rel="noopener">${label}</a>`).join('');
- }
-
- function renderMint(ev) {
- const mint = ev.mint || '';
- const mcSol = Number.isFinite(Number(ev.market_cap_sol)) ? Number(ev.market_cap_sol).toFixed(2) + ' SOL' : '';
- const mcUsd = Number.isFinite(Number(ev.market_cap_usd)) ? fmtUsd(ev.market_cap_usd) : '';
- const mcStr = [mcUsd, mcSol].filter(Boolean).join(' / ');
- const buyStr = ev.initial_buy_sol ? `${fmtSol(ev.initial_buy_sol)}${ev.initial_buy_usd ? ' (' + fmtUsd(ev.initial_buy_usd) + ')' : ''}` : '';
- const social = [
- ev.twitter ? `<a href="${attr(twitterUrl(ev.twitter))}" target="_blank" rel="noopener">𝕏 ${escapeHtml(twitterLabel(ev.twitter))}</a>` : '',
- ev.telegram ? `<a href="${attr(ev.telegram)}" target="_blank" rel="noopener">TG</a>` : '',
- ev.website ? `<a href="${attr(ev.website)}" target="_blank" rel="noopener">🌐</a>` : '',
- ].filter(Boolean).join(' ');
-
- const launches = ev.creator_launches;
- const graduated = ev.creator_graduated;
- const devStats = launches != null
- ? (graduated != null ? `${launches} launches · 🎓 ${graduated}` : `${launches} launches`)
- : '';
-
- const replay = ev.replay ? ' replay' : '';
- const thumb = ev.image_uri
- ? `<img class="evt-thumb" src="${attr(ev.image_uri)}" alt="" loading="lazy" decoding="async" referrerpolicy="no-referrer" onerror="this.style.display='none'" />`
- : '';
-
- return `<div class="evt${replay}" data-mint="${attr(mint)}">
- <div class="evt-row">
- <span class="evt-kind">🌱 new token</span>
- <span class="evt-time">${escapeHtml(timeAgo(ev.created_at))}</span>
- </div>
- <div class="evt-head" style="margin-top:4px">
- ${thumb}
- <div class="evt-head-text">
- <div class="evt-title">${escapeHtml(ev.name || '—')} — $${escapeHtml(ev.symbol || '?')}</div>
- ${ev.description ? `<div class="evt-desc">${escapeHtml(ev.description.slice(0, 100))}</div>` : ''}
- ${social ? `<div class="evt-socials">${social}</div>` : ''}
- </div>
- </div>
- ${mcStr ? `<div class="evt-amt" style="margin-top:6px">💎 MC: ${escapeHtml(mcStr)}${buyStr ? ' &nbsp;·&nbsp; initial: ' + escapeHtml(buyStr) : ''}</div>` : ''}
- ${devStats ? `<div class="evt-row2" style="margin-top:4px">👨‍💻 ${devStats}${ev.creator ? ' &nbsp;·&nbsp; <code>' + shortKey(ev.creator) + '</code>' : ''}</div>` : (ev.creator ? `<div class="evt-meta"><span>dev: <code>${shortKey(ev.creator)}</code></span></div>` : '')}
- <div class="evt-links">${toolLinks(mint)}</div>
- <div class="evt-mint">${escapeHtml(mint)}</div>
- <div class="evt-meta">
- ${ev.signature ? `<a href="https://solscan.io/tx/${encodeURIComponent(ev.signature)}" target="_blank" rel="noopener">TX ↗</a>` : ''}
- ${mint ? ` · <a href="https://pump.fun/coin/${encodeURIComponent(mint)}" target="_blank" rel="noopener">pump.fun</a>` : ''}
- ${tsStr ? ` · 🕐 ${escapeHtml(tsStr)}` : ''}
- ${mint ? ` · <button class="evt-copy" type="button" data-copy="${attr(mint)}" title="Copy mint">📋</button>` : ''}
- ${mint ? ` · <button class="evt-focus" type="button" data-focus="${attr(mint)}" title="Filter to this mint">🎯</button>` : ''}
- </div>
- </div>`;
- }
-
- function fmtUtc(ts) {
- if (ts == null) return '';
- const d = new Date(typeof ts === 'number' ? (ts < 1e12 ? ts * 1000 : ts) : ts);
- if (Number.isNaN(d.getTime())) return '';
- return d.toISOString().replace('T', ' ').replace(/\..+$/, '') + ' UTC';
- }
-
- function renderGraduation(ev) {
- const mint = ev.mint || '';
- const name = ev.name || ev.symbol || '—';
- const symbol = ev.symbol || '?';
- const age = ev.age || (ev.created_at ? timeAgo(ev.created_at) : '');
- const descRaw = ev.description ? String(ev.description) : '';
- const desc = descRaw ? escapeHtml(descRaw.slice(0, 100)) + (descRaw.length > 100 ? '…' : '') : '';
-
- const mcInitial = ev.market_cap_usd_initial ?? ev.initial_market_cap_usd ?? ev.market_cap_at_launch;
- const mcCurrent = ev.usd_market_cap ?? ev.market_cap_usd ?? ev.market_cap;
- const mcStr = (mcInitial != null && mcCurrent != null)
- ? `${fmtUsd(mcInitial)} ⇨ ${fmtUsd(mcCurrent)}`
- : (mcCurrent != null ? fmtUsd(mcCurrent) : '');
-
- const ath = ev.ath_market_cap ?? ev.ath_usd ?? null;
- const athStr = ath != null && ath !== mcCurrent ? fmtUsd(ath) : '';
-
- const launches = ev.creator_launches;
- const graduated = ev.creator_graduated;
- const bestToken = Array.isArray(ev.creator_tokens) && ev.creator_tokens.length
- ? ev.creator_tokens.slice().sort((a, b) => (b?.mc || 0) - (a?.mc || 0))[0]
- : null;
- const bestStr = bestToken
- ? (bestToken.symbol === symbol
- ? `best $${escapeHtml(bestToken.symbol)}${bestToken.mc ? ' ' + fmtUsd(bestToken.mc) : ''} (this)`
- : `best $${escapeHtml(bestToken.symbol || '?')}${bestToken.mc ? ' ' + fmtUsd(bestToken.mc) : ''}`)
- : '';
- const amountStr = ev.amount_sol != null
- ? `${Number(ev.amount_sol).toFixed(2)} SOL${ev.amount_usd != null ? ' [' + fmtUsd(ev.amount_usd) + ']' : ''}`
- : '';
- const launchesPart = launches != null
- ? (graduated != null ? `${launches} launches · 🎓 ${graduated}` : `${launches} launches`)
- : '';
- const devParts = [launchesPart, bestStr, amountStr].filter(Boolean).join(' &nbsp;⋅&nbsp; ');
-
- const m = encodeURIComponent(mint);
- const chartLinks = mint ? [
- `<a href="https://dexscreener.com/solana/${m}" target="_blank" rel="noopener">DEX</a>`,
- `<a href="https://www.defined.fi/sol/${m}" target="_blank" rel="noopener">DEF</a>`,
- ].join('⋅') : '';
- const toolAbbr = mint ? [
- ['AXI', `https://axiom.trade/meme/${mint}`],
- ['GMG', `https://gmgn.ai/sol/token/${mint}`],
- ['PDR', `https://trade.padre.gg/trade/solana/${mint}`],
- ['PHO', `https://photon-sol.tinyastro.io/en/r/@bonk/${mint}`],
- ['BLX', `https://bullx.io/terminal?chainId=1399811149&address=${mint}`],
- ].map(([l, u]) => `<a href="${attr(u)}" target="_blank" rel="noopener">${l}</a>`).join('⋅') : '';
-
- const socials = [
- ev.twitter ? `<a href="${attr(twitterUrl(ev.twitter))}" target="_blank" rel="noopener">𝕏 ${escapeHtml(twitterLabel(ev.twitter))}</a>` : '',
- ev.telegram ? `<a href="${attr(ev.telegram)}" target="_blank" rel="noopener">TG</a>` : '',
- ev.website ? `<a href="${attr(ev.website)}" target="_blank" rel="noopener">🌐 site</a>` : '',
- ].filter(Boolean).join('');
-
- const poolStr = ev.pump_swap_pool
- ? `Pool: <code>${shortKey(ev.pump_swap_pool)}</code> (PumpAMM)`
- : ev.raydium_pool
- ? `Pool: <code>${shortKey(ev.raydium_pool)}</code> (Raydium)`
- : ev.pool ? `Pool: ${escapeHtml(String(ev.pool))}` : '';
-
- const tsStr = fmtUtc(ev.timestamp ?? ev.block_time ?? ev.created_at);
- const sig = ev.signature || ev.tx_signature;
- const replay = ev.replay ? ' replay' : '';
- const thumb = ev.image_uri
- ? `<img class="evt-thumb" src="${attr(ev.image_uri)}" alt="" loading="lazy" referrerpolicy="no-referrer" onerror="this.style.display='none'" />`
- : '';
-
- return `<div class="evt grad${replay}">
- <div class="evt-head">
- ${thumb}
- <div class="evt-head-text">
- <div class="evt-title">🆕💊 ${escapeHtml(name)} — $${escapeHtml(symbol)}${age ? ' [' + escapeHtml(age) + ']' : ''}</div>
- ${desc ? `<div class="evt-desc">${desc}</div>` : ''}
- ${socials ? `<div class="evt-socials">${socials}</div>` : ''}
- </div>
- </div>
- ${mcStr ? `<div class="evt-amt" style="margin-top:6px">💎 MC: ${mcStr}${athStr ? ' &nbsp;·&nbsp; 🏆 ATH: ' + athStr : ''}</div>` : ''}
- ${devParts ? `<div class="evt-row2" style="margin-top:6px">👨‍💻 ${devParts}</div>` : ''}
- ${chartLinks ? `<div class="evt-row2">💹 Chart: ${chartLinks}</div>` : ''}
- ${toolAbbr ? `<div class="evt-row2">🧰 ${toolAbbr}</div>` : ''}
- ${poolStr ? `<div class="evt-pool">${poolStr}</div>` : ''}
- <div class="evt-mint">${escapeHtml(mint)}</div>
- <div class="evt-meta">
- ${sig ? `🔗 <a href="https://solscan.io/tx/${encodeURIComponent(sig)}" target="_blank" rel="noopener">TX</a>` : ''}
- ${mint ? ` · <a href="https://pump.fun/coin/${encodeURIComponent(mint)}" target="_blank" rel="noopener">pump.fun</a>` : ''}
- ${tsStr ? ` · 🕐 ${escapeHtml(tsStr)}` : ''}
- ${mint ? ` · <button class="evt-copy" type="button" data-copy="${attr(mint)}" title="Copy mint">📋</button>` : ''}
- ${mint ? ` · <button class="evt-focus" type="button" data-focus="${attr(mint)}" title="Filter to this mint">🎯</button>` : ''}
- </div>
- </div>`;
- }
-
- function renderClaim(ev) {
- const mint = ev.mint || ev.token_mint || '';
- const isFirst = ev.first_time_claim;
- const isFake = ev.fake_claim;
- const cls = isFake ? 'fake' : isFirst ? 'first' : '';
- const tier = ev.tier ? `${TIER_BADGE[ev.tier] || ''} ${ev.tier}` : '';
- const mcUsd = ev.usd_market_cap ?? ev.market_cap;
- const athUsd = ev.ath_market_cap ?? ev.ath;
-
- // Claim header
- let kindLabel = isFirst ? '🚨🚨🚨 FIRST CREATOR FEE CLAIM' : '💸 creator fee claim';
-
- // GitHub repo section
- const repoHtml = ev.repo_name ? `
- <div class="evt-repo">
- <div class="evt-repo-name">🐙 ${escapeHtml(ev.repo_name)}</div>
- ${ev.repo_description ? `<div style="color:#8a8a9a;font-size:11px;margin-top:2px">${escapeHtml(ev.repo_description.slice(0,120))}</div>` : ''}
- <div class="evt-row2" style="margin-top:4px">
- ${ev.repo_language ? `<span>🔤 ${escapeHtml(ev.repo_language)}</span>` : ''}
- ${ev.repo_stars != null ? `<span>⭐ ${ev.repo_stars}</span>` : ''}
- ${ev.repo_forks != null ? `<span>🍴 ${ev.repo_forks}</span>` : ''}
- ${ev.repo_last_push ? `<span class="evt-stat">push ${escapeHtml(ev.repo_last_push)}</span>` : ''}
- </div>
- ${ev.repo_topics?.length ? `<div class="evt-topics">${ev.repo_topics.map(t => `<span class="evt-topic">${escapeHtml(t)}</span>`).join('')}</div>` : ''}
- </div>` : '';
-
- // GitHub dev section
- const ghUser = ev.github_user;
- const ghHtml = ghUser ? `
- <div class="evt-section">
- <div class="evt-gh">👨‍💻 <strong>${escapeHtml(ev.github_name || ghUser)}</strong> (<a href="https://github.com/${encodeURIComponent(ghUser)}" target="_blank" rel="noopener">@${escapeHtml(ghUser)}</a>)
- ${ev.github_twitter ? ` &nbsp;·&nbsp; <a href="${attr(twitterUrl(ev.github_twitter))}" target="_blank" rel="noopener">𝕏 ${escapeHtml(twitterLabel(ev.github_twitter))}</a>` : ''}</div>
- <div class="evt-row2">
- ${ev.github_repos != null ? `<span>📦 ${ev.github_repos} repos</span>` : ''}
- ${ev.github_followers != null ? `<span>👁 ${ev.github_followers} followers</span>` : ''}
- ${ev.github_account_age ? `<span class="evt-stat">${escapeHtml(ev.github_account_age)}</span>` : ''}
- ${ev.github_location ? `<span class="evt-stat">📍 ${escapeHtml(ev.github_location)}</span>` : ''}
- </div>
- ${ev.github_bio ? `<div class="evt-desc" style="margin-top:2px">${escapeHtml(ev.github_bio.slice(0,100))}</div>` : ''}
- ${repoHtml}
- </div>` : '';
-
- // Creator token history
- const creatorTokens = ev.creator_tokens?.length
- ? ev.creator_tokens.map(t => `${t.symbol ? '$' + escapeHtml(t.symbol) : '?'}${t.mc ? ' [' + fmtUsd(t.mc) + ']' : ''}`).join(' · ')
- : '';
- const creatorHtml = ev.creator_launches != null ? `
- <div class="evt-section">
- <div class="evt-gh">🧑‍💻 dev: <code>${shortKey(ev.claimer || ev.creator || '')}</code> &nbsp;·&nbsp; 🚀 ${ev.creator_launches} launches${ev.creator_graduated ? ' &nbsp;·&nbsp; 🎓 ' + ev.creator_graduated + ' graduated' : ''}</div>
- ${creatorTokens ? `<div class="evt-desc" style="margin-top:2px">${creatorTokens}</div>` : ''}
- </div>` : '';
-
- // Trade links
- const tradeLinks = mint ? `<div class="evt-links">${toolLinks(mint)}</div>` : '';
-
- return `<div class="evt ${cls}">
- <div class="evt-row">
- <span class="evt-kind">${kindLabel}</span>
- ${tier ? `<span class="evt-tier">${escapeHtml(tier)}</span>` : ''}
- </div>
- <div class="evt-title">${escapeHtml(ev.token_name || ev.name || '—')} — $${escapeHtml(ev.token_symbol || ev.symbol || '?')}</div>
- <div class="evt-row2">
- ${mcUsd != null ? `<span>💎 MC: ${fmtUsd(mcUsd)}</span>` : ''}
- ${ev.bonding_curve_pct != null ? `<span class="evt-stat">curve ${ev.bonding_curve_pct}%</span>` : ''}
- ${athUsd != null ? `<span>🏆 ATH: ${fmtUsd(athUsd)}</span>` : ''}
- ${ev.age ? `<span class="evt-stat">created ${escapeHtml(ev.age)}</span>` : ''}
- </div>
- <div class="evt-section">
- <div class="evt-row2">
- ${ev.amount_sol != null ? `<span>💸 ${fmtSol(ev.amount_sol)}${ev.amount_usd != null ? ' (' + fmtUsd(ev.amount_usd) + ')' : ''}</span>` : ''}
- ${ev.claim_number != null ? `<span class="evt-stat">claim #${ev.claim_number}</span>` : ''}
- </div>
- ${ev.claim_type ? `<div class="evt-desc">${escapeHtml(ev.claim_type)}</div>` : ''}
- ${ev.lifetime_sol != null ? `<div class="evt-desc">lifetime: ${fmtSol(ev.lifetime_sol)}${ev.lifetime_usd != null ? ' (' + fmtUsd(ev.lifetime_usd) + ')' : ''}</div>` : ''}
- </div>
- ${ghHtml}
- ${creatorHtml}
- ${ev.signals ? `<div class="evt-section"><div class="evt-desc">⚡ ${escapeHtml(ev.signals)}</div></div>` : ''}
- ${ev.ai_take ? `<div class="evt-desc evt-take" style="margin-top:6px">${escapeHtml(ev.ai_take)}</div>` : ''}
- ${tradeLinks}
- <div class="evt-mint">${escapeHtml(mint)}</div>
- <div class="evt-meta">
- ${ev.tx_signature || ev.signature ? `<a href="https://solscan.io/tx/${encodeURIComponent(ev.tx_signature || ev.signature)}" target="_blank" rel="noopener">TX ↗</a>` : ''}
- ${mint ? `<a href="https://pump.fun/coin/${encodeURIComponent(mint)}" target="_blank" rel="noopener">pump.fun</a>` : ''}
- </div>
- </div>`;
- }
-
- // Total live events received, surfaced on the Helius pill.
- let liveEventCount = 0;
- function bumpEventCount() {
- liveEventCount++;
- const pill = $('helius-pill');
- pill.dataset.count = 'active';
- $('helius-count').textContent = liveEventCount > 999 ? '999+' : String(liveEventCount);
- }
-
- // Pause-on-scroll: queue HTML strings when user has scrolled the feed
- // down. They drain into the DOM when the user clicks the jump button or
- // scrolls back to top.
- const feedQueue = [];
- const feedEl = () => $('feed');
- const FEED_SCROLL_THRESHOLD = 24;
- function feedIsAtTop() {
- const f = feedEl();
- return !f || f.scrollTop <= FEED_SCROLL_THRESHOLD;
- }
- function updateJumpButton() {
- const btn = $('feed-jump');
- if (!btn) return;
- if (feedQueue.length > 0) {
- $('feed-jump-count').textContent = feedQueue.length > 99 ? '99+' : String(feedQueue.length);
- btn.dataset.visible = 'true';
- } else {
- btn.dataset.visible = 'false';
- }
- }
- function appendNow(html) {
- const feed = feedEl();
- if (feed.querySelector('.empty')) feed.innerHTML = '';
- feed.insertAdjacentHTML('afterbegin', html);
- while (feed.children.length > MAX_EVENTS) feed.lastChild?.remove();
- }
- function pushEvent(html) {
- bumpEventCount();
- if (feedIsAtTop()) {
- appendNow(html);
- return;
- }
- feedQueue.unshift(html); // newest first
- if (feedQueue.length > MAX_EVENTS) feedQueue.length = MAX_EVENTS;
- updateJumpButton();
- }
- function flushQueued() {
- while (feedQueue.length) appendNow(feedQueue.pop()); // pop oldest first so newest ends on top
- updateJumpButton();
- feedEl().scrollTo({ top: 0, behavior: 'smooth' });
- }
- $('feed-jump').addEventListener('click', flushQueued);
- feedEl().addEventListener('scroll', () => {
- if (feedIsAtTop() && feedQueue.length) flushQueued();
- }, { passive: true });
-
- // Per-card actions: copy mint, focus filter to mint. Delegated so newly
- // rendered cards work without re-binding.
- feedEl().addEventListener('click', (e) => {
- const target = e.target.closest('button');
- if (!target) return;
- const copy = target.dataset.copy;
- if (copy) {
- navigator.clipboard?.writeText(copy).then(() => {
- target.dataset.copied = '1';
- setTimeout(() => delete target.dataset.copied, 1200);
- }).catch(() => {});
- return;
- }
- const focus = target.dataset.focus;
- if (focus) {
- $('ctl-mint').value = focus;
- params.mint = focus;
- syncURL();
- iframe.contentWindow?.postMessage({ type: 'pumpfun-feed:focus-mint', mint: focus || null }, '*');
- }
- });
-
- // Cross-source dedupe (HTTP backfill + SSE replay + live) by tx signature.
- // Without this the same graduation can render twice when the page calls
- // the backfill endpoint AND the WS layer replays its in-memory buffer.
- const SEEN_SIG_LIMIT = 500;
- const _seenSigs = new Map();
- function sigOf(ev) { return ev?.signature || ev?.tx_signature || null; }
- function seenSig(sig) {
- if (!sig) return false;
- if (_seenSigs.has(sig)) return true;
- _seenSigs.set(sig, Date.now());
- if (_seenSigs.size > SEEN_SIG_LIMIT) {
- const drop = Math.floor(SEEN_SIG_LIMIT / 4);
- const it = _seenSigs.keys();
- for (let i = 0; i < drop; i++) _seenSigs.delete(it.next().value);
- }
- return false;
- }
-
- // Stale-upstream watchdog. The SSE socket can read `live` while
- // PumpPortal's upstream WS is silent (their maintenance windows). Surface
- // a "quiet" state so users see the silence isn't their connection.
- const STALE_AFTER_MS = 5 * 60_000;
- let staleTimer = null;
- function bumpAlive() {
- if (staleTimer) { clearTimeout(staleTimer); staleTimer = null; }
- const dot = $('status-dot');
- if (dot && dot.classList.contains('quiet')) setStatus('live', 'live');
- staleTimer = setTimeout(() => {
- const d = $('status-dot');
- if (d && d.classList.contains('live')) setStatus('quiet', 'upstream quiet');
- }, STALE_AFTER_MS);
- }
-
- // HTTP backfill before the SSE opens — gives the user a non-empty feed
- // instantly even on a cold container that has no WS buffer yet.
- async function backfillFromHttp() {
- try {
- const r = await fetch('/api/pump/recent-graduations?limit=15', { credentials: 'include' });
- if (!r.ok) return;
- const { items } = await r.json();
- if (!Array.isArray(items)) return;
- for (const ev of items.slice().reverse()) {
- if (!eventMatchesFilters(ev)) continue;
- if (seenSig(sigOf(ev))) continue;
- pushEvent(renderGraduation({ ...ev, replay: true }));
- }
- } catch {}
- }
-
- function connectFeed() {
- if (es) { try { es.close(); } catch {} }
- const qs = new URLSearchParams();
- qs.set('kind', params.kind);
- if (params.minTier) qs.set('minTier', params.minTier);
- if (params.mcMin) qs.set('mcMin', String(params.mcMin));
- if (params.mcMax) qs.set('mcMax', String(params.mcMax));
- if (params.minBuy) qs.set('minBuy', String(params.minBuy));
- if (params.whale) qs.set('whale', String(params.whale));
- setStatus('connecting', 'connecting…');
- es = new EventSource(`/api/agents/pumpfun-feed?${qs.toString()}`, { withCredentials: true });
- es.addEventListener('open', () => { setStatus('live', 'live'); bumpAlive(); });
- es.addEventListener('error', () => {
- if (es.readyState === EventSource.CLOSED) setStatus('down', 'disconnected');
- else setStatus('connecting', 'reconnecting…');
- });
- es.addEventListener('claim', (msg) => {
- const ev = safeJson(msg.data); if (!ev || !eventMatchesFilters(ev)) return;
- if (seenSig(sigOf(ev))) return;
- pushEvent(renderClaim(ev));
- if (!ev.replay) dispatchReaction('claim', ev);
- bumpAlive();
- });
- es.addEventListener('graduation', (msg) => {
- const ev = safeJson(msg.data); if (!ev || !eventMatchesFilters(ev)) return;
- if (seenSig(sigOf(ev))) return;
- pushEvent(renderGraduation(ev));
- if (!ev.replay) dispatchReaction('graduation', ev);
- bumpAlive();
- });
- es.addEventListener('mint', (msg) => {
- const ev = safeJson(msg.data); if (!ev || !eventMatchesFilters(ev)) return;
- if (seenSig(sigOf(ev))) return;
- pushEvent(renderMint(ev));
- if (!ev.replay) dispatchReaction('mint', ev);
- bumpAlive();
- });
- }
-
- function safeJson(s) { try { return JSON.parse(s); } catch { return null; } }
- function shortKey(s) { s = String(s || ''); return s.length > 12 ? `${s.slice(0,4)}…${s.slice(-4)}` : s; }
- function escapeHtml(s) { return String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;' }[c])); }
- function attr(s) { return escapeHtml(s); }
- function twitterUrl(v) {
- const s = String(v ?? '').trim();
- if (!s) return '';
- if (/^https?:\/\//i.test(s)) return s;
- const handle = s.replace(/^@+/, '').split(/[/?#]/)[0];
- return `https://x.com/${encodeURIComponent(handle)}`;
- }
- function twitterLabel(v) {
- const s = String(v ?? '').trim();
- const m = s.match(/^https?:\/\/(?:www\.)?(?:x|twitter)\.com\/([^/?#]+)/i);
- if (m) return '@' + m[1];
- return s.startsWith('@') ? s : '@' + s.replace(/^@+/, '');
- }
-
- // ── Filter changes apply instantly. Mint filter only re-filters; asset/kind/tier remount. ──
- $('ctl-mint').addEventListener('input', (e) => {
- params.mint = e.target.value.trim();
- syncURL();
- iframe.contentWindow?.postMessage(
- { type: 'pumpfun-feed:focus-mint', mint: params.mint || null },
- location.origin,
- );
- });
-
- $('ctl-narrate').addEventListener('click', (e) => {
- params.narrate = e.currentTarget.dataset.on !== '1';
- e.currentTarget.dataset.on = params.narrate ? '1' : '0';
- syncURL();
- iframe.contentWindow?.postMessage(
- { type: 'pumpfun-feed:set-narrate', on: params.narrate },
- location.origin,
- );
- });
-
- $('ctl-announce-mints').addEventListener('click', (e) => {
- params.announceMints = e.currentTarget.dataset.on !== '1';
- e.currentTarget.dataset.on = params.announceMints ? '1' : '0';
- syncURL();
- });
-
- let kindTimer;
- const onFilterChange = (delay = 200) => {
- clearTimeout(kindTimer);
- kindTimer = setTimeout(() => {
- const newKind = $('ctl-kind').value;
- const newTier = $('ctl-tier').value;
- const newAsset = $('ctl-asset').value.trim();
- const feedChanged = newKind !== params.kind || newTier !== params.minTier;
- const agentChanged = newAsset !== params.asset;
- params.kind = newKind;
- params.minTier = newTier;
- params.asset = newAsset;
- syncURL();
- if (feedChanged) connectFeed();
- if (agentChanged) mountAgent();
- }, delay);
- };
- $('ctl-kind').addEventListener('change', () => onFilterChange(0));
- $('ctl-tier').addEventListener('change', () => onFilterChange(0));
- $('ctl-asset').addEventListener('input', () => onFilterChange(450));
-
- let numTimer;
- const onNumFilterChange = (delay = 600) => {
- clearTimeout(numTimer);
- numTimer = setTimeout(() => {
- params.mcMin = Number($('ctl-mc-min').value) || 0;
- params.mcMax = Number($('ctl-mc-max').value) || 0;
- params.minBuy = Number($('ctl-min-buy').value) || 0;
- params.whale = Number($('ctl-whale').value) || 0;
- syncURL();
- connectFeed();
- }, delay);
- };
- $('ctl-mc-min').addEventListener('input', () => onNumFilterChange());
- $('ctl-mc-max').addEventListener('input', () => onNumFilterChange());
- $('ctl-min-buy').addEventListener('input', () => onNumFilterChange());
- $('ctl-whale').addEventListener('input', () => onNumFilterChange());
-
- // Share button — copies a URL with all current filters/avatar to clipboard.
- $('ctl-share').addEventListener('click', async () => {
- const btn = $('ctl-share');
- const label = $('ctl-share-label');
- const link = location.href;
- try {
- if (navigator.clipboard?.writeText) {
- await navigator.clipboard.writeText(link);
- } else {
- const ta = document.createElement('textarea');
- ta.value = link; ta.style.position = 'fixed'; ta.style.opacity = '0';
- document.body.appendChild(ta); ta.select();
- document.execCommand('copy'); ta.remove();
- }
- const prev = label.textContent;
- label.textContent = 'Copied!';
- btn.dataset.flash = 'true';
- setTimeout(() => { label.textContent = prev; delete btn.dataset.flash; }, 1400);
- } catch {
- label.textContent = 'Press ⌘C';
- setTimeout(() => { label.textContent = 'Share'; }, 1400);
- }
- });
-
- // Mobile side-panel toggle
- $('side-toggle').addEventListener('click', () => {
- const open = document.body.classList.toggle('side-open');
- $('side-toggle').setAttribute('aria-pressed', String(open));
- });
-
- // First-time fee claims panel — pulls historical first-claims from
- // /api/pump/first-claims (a backend scan over the pump.fun program's
- // recent signatures). Refreshes via button or window selector, plus
- // every 90s while the page is visible.
- const fcState = { loading: false, timer: 0 };
- async function loadFirstClaims() {
- if (fcState.loading) return;
- fcState.loading = true;
- const host = $('first-claims');
- const win = Number($('fc-window').value) || 1440;
- const btn = $('fc-refresh');
- btn.dataset.flash = 'true';
- try {
- const r = await fetch(
- `/api/pump/first-claims?sinceMinutes=${win}&limit=20`,
- { credentials: 'include' },
- );
- if (!r.ok) throw new Error('status ' + r.status);
- const data = await r.json();
- const items = data?.items || [];
- if (!items.length) {
- host.innerHTML = `<div class="empty">No first-time claims in the last ${win >= 60 ? Math.round(win / 60) + 'h' : win + 'm'}.</div>`;
- } else {
- host.innerHTML = items.map(renderFirstClaim).join('');
- }
- } catch (err) {
- host.innerHTML = `<div class="empty">Could not load first claims: ${escapeHtml(err.message || 'error')}</div>`;
- } finally {
- fcState.loading = false;
- setTimeout(() => delete btn.dataset.flash, 350);
- }
- }
- function renderFirstClaim(c) {
- const sol = (Number(c.lamports) / 1e9).toFixed(4);
- const tsSec = Number(c.ts || 0);
- const when = tsSec ? timeAgo(tsSec) : '';
- const creator = c.creator || '';
- const mint = c.mint || '';
- const sig = c.signature || '';
- const cShort = creator ? `${creator.slice(0, 4)}…${creator.slice(-4)}` : '';
- const mShort = mint ? `${mint.slice(0, 4)}…${mint.slice(-4)}` : '';
- return `
- <div style="background:#0d2d1a;border:1px solid rgba(108,224,200,0.25);border-radius:8px;padding:8px 10px;margin-bottom:6px;font-size:12px;line-height:1.5">
- <div style="display:flex;justify-content:space-between;font-size:11px;opacity:0.8">
- <span style="color:#6ce0c8;font-weight:600">🚨 First claim</span>
- <span>${escapeHtml(when)}</span>
- </div>
- <div style="font-weight:600;margin-top:2px">${sol} SOL</div>
- ${creator ? `<div style="font-family:ui-monospace,monospace;font-size:11px;opacity:0.8"><a href="https://solscan.io/account/${encodeURIComponent(creator)}" target="_blank" rel="noopener" style="color:#6ce0c8">${escapeHtml(cShort)}</a></div>` : ''}
- ${mint ? `<div style="font-family:ui-monospace,monospace;font-size:11px;opacity:0.8"><a href="https://pump.fun/coin/${encodeURIComponent(mint)}" target="_blank" rel="noopener" style="color:#6ce0c8">${escapeHtml(mShort)}</a></div>` : ''}
- ${sig ? `<div style="margin-top:2px"><a href="https://solscan.io/tx/${encodeURIComponent(sig)}" target="_blank" rel="noopener" style="color:#6ce0c8;font-size:11px">view tx ↗</a></div>` : ''}
- </div>
- `;
- }
- $('fc-refresh').addEventListener('click', loadFirstClaims);
- $('fc-window').addEventListener('change', loadFirstClaims);
- function scheduleFcRefresh() {
- if (fcState.timer) clearInterval(fcState.timer);
- fcState.timer = setInterval(() => {
- if (document.visibilityState === 'visible') loadFirstClaims();
- }, 90_000);
- }
- document.addEventListener('visibilitychange', () => {
- if (document.visibilityState === 'visible') loadFirstClaims();
- });
- loadFirstClaims();
- scheduleFcRefresh();
-
- // Initial load — paint historical graduations from Postgres before the
- // SSE opens so the feed is never blank. Then start the live stream.
- backfillFromHttp().finally(connectFeed);
-
- mountAgent();
- buildAnimChips();
-
- // Auth-aware nav CTA
- (function () {
- try {
- const raw = localStorage.getItem('3dagent:auth-hint');
- if (!raw) return;
- const { authed, name } = JSON.parse(raw);
- if (!authed) return;
- const cta = document.getElementById('home-nav-cta');
- if (cta) { cta.textContent = 'Dashboard'; cta.href = '/dashboard'; }
- const myAgentsLi = document.getElementById('home-nav-my-agents-li');
- if (myAgentsLi) myAgentsLi.hidden = false;
- const userLi = document.getElementById('home-nav-user-li');
- const userEl = document.getElementById('home-nav-user');
- if (userEl && userLi && name) { userEl.textContent = name; userLi.hidden = false; }
- } catch (_) {}
- })();
-
- // Dropdown nav
- (function () {
- const triggers = document.querySelectorAll('.home-nav .nav-trigger');
- if (!triggers.length) return;
- function closeAll(except) {
- triggers.forEach((t) => { if (t !== except) t.setAttribute('aria-expanded', 'false'); });
- }
- triggers.forEach((trigger) => {
- trigger.addEventListener('click', (e) => {
- e.stopPropagation();
- const open = trigger.getAttribute('aria-expanded') === 'true';
- closeAll(open ? null : trigger);
- trigger.setAttribute('aria-expanded', open ? 'false' : 'true');
- if (!open) trigger.nextElementSibling?.querySelector('a')?.focus();
- });
- const menu = trigger.nextElementSibling;
- if (!menu) return;
- menu.addEventListener('keydown', (e) => {
- const items = Array.from(menu.querySelectorAll('a'));
- const idx = items.indexOf(document.activeElement);
- if (e.key === 'ArrowDown') { e.preventDefault(); items[(idx + 1) % items.length]?.focus(); }
- else if (e.key === 'ArrowUp') { e.preventDefault(); items[(idx - 1 + items.length) % items.length]?.focus(); }
- else if (e.key === 'Escape') { trigger.setAttribute('aria-expanded', 'false'); trigger.focus(); }
- });
- });
- document.addEventListener('click', (e) => { if (!e.target.closest('.home-nav')) closeAll(null); });
- document.addEventListener('keydown', (e) => { if (e.key === 'Escape') closeAll(null); });
- })();
- </script>
-
- <footer class="h-footer h-footer-horizon">
- <div class="h-footer-glow-line" aria-hidden="true"></div>
- <div class="h-footer-floor" aria-hidden="true"></div>
- <div class="h-footer-haze" aria-hidden="true"></div>
- <div class="h-footer-watermark" aria-hidden="true">three.ws</div>
- <div class="h-footer-avatar" aria-hidden="true">
- <model-viewer src="/animations/robotexpressive.glb" auto-rotate auto-rotate-delay="0" rotation-per-second="20deg" interaction-prompt="none" camera-controls="false" disable-zoom shadow-intensity="0" exposure="0.7" environment-image="neutral" camera-orbit="0deg 80deg 9m" field-of-view="45deg" loading="lazy"></model-viewer>
- </div>
- <div class="h-footer-cta">
- <div class="h-footer-newsletter">
- <h3>Stay in the loop</h3>
- <p>Get updates on new features, agent tooling, and protocol changes.</p>
- <form class="h-footer-newsletter-form" data-newsletter-form novalidate>
- <input type="email" class="h-footer-newsletter-input" name="email" placeholder="Enter your email" aria-label="Email address" autocomplete="email" required />
- <button type="submit" class="h-footer-newsletter-btn" aria-label="Subscribe">
- <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" d="M2 8h11m0 0L9 4m4 4l-4 4"/></svg>
- </button>
- </form>
- <p class="h-footer-newsletter-msg" data-newsletter-msg aria-live="polite"></p>
- </div>
- <div class="h-footer-community">
- <h3>Join the community</h3>
- <p>Follow along for builds, demos, and conversations with the team.</p>
- <a class="h-footer-community-btn" href="https://x.com/trythreews" target="_blank" rel="noopener">
- <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
- Follow on X
- </a>
- </div>
- </div>
- <div class="h-footer-inner">
- <div class="h-footer-brand-col">
- <div class="h-footer-brand">
- <img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" />
- <span class="wordmark-dot" aria-hidden="true"></span>
- <span>three.ws</span>
- </div>
- <p class="h-footer-tagline">Give your AI a body.</p>
- <div class="h-footer-socials">
- <a class="h-footer-social" href="https://x.com/trythreews" target="_blank" rel="noopener" aria-label="three.ws on X">
- <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
- </a>
- <a class="h-footer-social" href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener" aria-label="three.ws on GitHub">
- <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
- </a>
- </div>
- </div>
- <nav class="h-footer-links" aria-label="Footer">
- <div class="h-footer-link-col">
- <h4 class="h-footer-link-heading">Product</h4>
- <a href="/create">Create</a>
- <a href="/studio">Studio</a>
- <a href="/widgets">Widgets</a>
- <a href="/discover">Discover</a>
- </div>
- <div class="h-footer-link-col">
- <h4 class="h-footer-link-heading">Developers</h4>
- <a href="/docs">Docs</a>
- <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a>
- <a href="https://eips.ethereum.org/EIPS/eip-8004" target="_blank" rel="noopener">ERC-8004</a>
- </div>
- <div class="h-footer-link-col">
- <h4 class="h-footer-link-heading">Resources</h4>
- <a href="/features">Features</a>
- <a href="/dashboard">Dashboard</a>
- </div>
- </nav>
- </div>
- <div class="h-footer-bottom">
- <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>
- <div class="h-footer-legal-links">
- <a href="/legal/privacy">Privacy Policy</a>
- <a href="/legal/tos">Terms of Use</a>
- </div>
- </div>
- </footer>
-</body>
-</html>
diff --git a/public/reputation/index.html b/public/reputation/index.html
index 1a4dc6781..95ad38e1a 100644
--- a/public/reputation/index.html
+++ b/public/reputation/index.html
@@ -548,8 +548,8 @@
<li role="none"><a href="/vanity-wallet" role="menuitem"><span class="nav-mi-title">Vanity wallet</span><span class="nav-mi-sub">Grind a Solana address</span></a></li>
<li role="none"><a href="/eth-vanity" role="menuitem"><span class="nav-mi-title">ETH vanity (CREATE2)</span><span class="nav-mi-sub">Grind a smart-contract address</span></a></li>
<li role="none"><a href="/strategy-lab" role="menuitem"><span class="nav-mi-title">Strategy Lab</span><span class="nav-mi-sub">DCA + subscriptions</span></a></li>
- <li role="none"><a href="/pump-live.html" role="menuitem"><span class="nav-mi-title">Live launches</span><span class="nav-mi-sub">Real-time mint feed</span></a></li>
- <li role="none"><a href="/pump-dashboard.html" role="menuitem"><span class="nav-mi-title">Pump Dashboard</span><span class="nav-mi-sub">Watches · scanner · quotes</span></a></li>
+ <li role="none"><a href="/pump-live" role="menuitem"><span class="nav-mi-title">Live launches</span><span class="nav-mi-sub">Real-time mint feed</span></a></li>
+ <li role="none"><a href="/pump-dashboard" role="menuitem"><span class="nav-mi-title">Pump Dashboard</span><span class="nav-mi-sub">Watches · scanner · quotes</span></a></li>
<li role="none"><a href="/docs#solana" role="menuitem"><span class="nav-mi-title">Solana SDK</span><span class="nav-mi-sub">Attestations + agent-kit</span></a></li>
</ul>
</li>
@@ -564,9 +564,9 @@
<li role="none"><a href="/docs#web-component" role="menuitem"><span class="nav-mi-title">&lt;agent-3d&gt;</span><span class="nav-mi-sub">Web component reference</span></a></li>
</ul>
</li>
- <li class="nav-item" role="none"><a href="/marketplace.html" role="menuitem">Marketplace</a></li>
+ <li class="nav-item" role="none"><a href="/marketplace" role="menuitem">Marketplace</a></li>
<li class="nav-item" role="none"><a href="/chat" role="menuitem">Chat</a></li>
- <li class="nav-item" role="none"><a href="/tutorials.html" role="menuitem">Tutorials</a></li>
+ <li class="nav-item" role="none"><a href="/tutorials" role="menuitem">Tutorials</a></li>
<li class="nav-item" id="home-nav-my-agents-li" role="none" hidden>
<a href="/my-agents" id="home-nav-my-agents" role="menuitem">My Agents</a>
</li>
@@ -664,7 +664,7 @@
<h4 class="h-footer-link-heading">Product</h4>
<a href="/create">Create</a>
<a href="/studio">Studio</a>
- <a href="/widgets.html">Widgets</a>
+ <a href="/widgets">Widgets</a>
<a href="/discover">Discover</a>
</div>
<div class="h-footer-link-col">
diff --git a/public/reputation/reputation.js b/public/reputation/reputation.js
index 06bad4c18..336be42bd 100644
--- a/public/reputation/reputation.js
+++ b/public/reputation/reputation.js
@@ -176,7 +176,7 @@ function showSkeleton(appEl) {
</div>`;
appEl.innerHTML = `
<div class="rep-breadcrumb">
- <a href="/marketplace.html">Marketplace</a>
+ <a href="/marketplace">Marketplace</a>
<span class="rep-breadcrumb-sep">/</span>
<span>Reputation</span>
</div>
@@ -290,7 +290,7 @@ async function main() {
const html = `
<div class="rep-breadcrumb">
- <a href="/marketplace.html">Marketplace</a>
+ <a href="/marketplace">Marketplace</a>
<span class="rep-breadcrumb-sep">/</span>
<span>Reputation</span>
</div>
diff --git a/public/tutorials-manifest.js b/public/tutorials-manifest.js
index 9ae737d2c..70edde3f2 100644
--- a/public/tutorials-manifest.js
+++ b/public/tutorials-manifest.js
@@ -1,7 +1,7 @@
/*
* Tutorial manifest — single source of truth for the tutorial library.
*
- * Loaded as a classic script by /tutorials.html (the 3-tier index) and
+ * Loaded as a classic script by /tutorials (the 3-tier index) and
* /tutorials/<slug> (the viewer template) — exposes window.TUTORIALS.
*
* Each entry maps to a long-form markdown file at /docs/tutorials/<slug>.md
diff --git a/public/vanity-wallet.html b/public/vanity-wallet.html
index 886826c62..c1efd62ee 100644
--- a/public/vanity-wallet.html
+++ b/public/vanity-wallet.html
@@ -608,7 +608,7 @@
host.innerHTML = `
<div class="assign">
<h4>Use this wallet with an agent</h4>
- <p style="font-size:.8rem;color:#888;margin:0">No agents yet. <a href="/create.html" style="color:#a78bfa">Create one</a> and come back to assign this wallet.</p>
+ <p style="font-size:.8rem;color:#888;margin:0">No agents yet. <a href="/create" style="color:#a78bfa">Create one</a> and come back to assign this wallet.</p>
</div>`;
return;
}
diff --git a/scripts/test-pages.mjs b/scripts/test-pages.mjs
index 555c47c20..0bcb7c966 100644
--- a/scripts/test-pages.mjs
+++ b/scripts/test-pages.mjs
@@ -66,8 +66,8 @@ const ROUTES = [
'/settings',
'/admin',
'/pumpfun',
- '/pump-live.html',
- '/pump-dashboard.html',
+ '/pump-live',
+ '/pump-dashboard',
'/strategy-lab',
// Legal
@@ -79,7 +79,7 @@ const ROUTES = [
'/embed-test.html',
'/avatar-page.html',
`/avatars/${SAMPLE_AGENT}`,
- '/avatar-artifact.html',
+ '/avatar-artifact',
'/agent-embed.html',
'/a-edit.html',
'/a-embed.html',
diff --git a/scripts/tmp-http-sweep.mjs b/scripts/tmp-http-sweep.mjs
deleted file mode 100644
index 510c6e416..000000000
--- a/scripts/tmp-http-sweep.mjs
+++ /dev/null
@@ -1,101 +0,0 @@
-// HTTP-level sweep: for each HTML path, fetch it, then fetch every <script src>, <link href>,
-// and <img src> it references. Report broken (4xx/5xx) sub-resources.
-
-import { load as loadHtml } from 'cheerio';
-
-const BASE = 'http://127.0.0.1:4173';
-
-const paths = [
- '/',
- '/app.html',
- '/home.html',
- '/features.html',
- '/create.html',
- '/agent-home.html',
- '/agent-edit.html',
- '/agent-embed.html',
- '/embed.html',
- '/a-embed.html',
- '/login.html',
- '/register.html',
- '/agent/',
- '/dashboard/',
- '/dashboard/storage.html',
- '/dashboard/usage.html',
- '/dashboard/wallets.html',
- '/dashboard/sessions.html',
- '/dashboard/embed-policy.html',
- '/hydrate/',
- '/studio/',
- '/discover/',
- '/artifact/',
- '/widgets-gallery/',
- '/docs-widgets.html',
- '/reputation/',
- '/discover/',
- '/wallet-connect-demo.html',
-];
-
-async function probe(url) {
- try {
- const r = await fetch(url, { redirect: 'manual' });
- return {
- status: r.status,
- ok: r.ok || r.status < 400,
- body: r.status < 400 ? await r.text() : null,
- };
- } catch (e) {
- return { status: 0, ok: false, err: e.message };
- }
-}
-
-async function head(url) {
- try {
- const r = await fetch(url, { method: 'GET', redirect: 'manual' });
- return r.status;
- } catch {
- return 0;
- }
-}
-
-const findings = [];
-for (const p of paths) {
- const r = await probe(BASE + p);
- const entry = { path: p, status: r.status, broken: [] };
- if (!r.ok || !r.body) {
- console.log(`[SKIP ${r.status}] ${p}`);
- findings.push(entry);
- continue;
- }
- try {
- const $ = loadHtml(r.body);
- const refs = new Set();
- $('script[src]').each((_, el) => refs.add($(el).attr('src')));
- $('link[href]').each((_, el) => refs.add($(el).attr('href')));
- $('img[src]').each((_, el) => refs.add($(el).attr('src')));
- const refList = [...refs].filter(
- (u) => u && !u.startsWith('http') && !u.startsWith('//') && !u.startsWith('data:'),
- );
- const results = await Promise.all(
- refList.map(async (ref) => {
- const abs = ref.startsWith('/') ? BASE + ref : new URL(ref, BASE + p).toString();
- return { ref, status: await head(abs) };
- }),
- );
- for (const { ref, status } of results) {
- if (status >= 400 || status === 0) entry.broken.push({ ref, status });
- }
- } catch (e) {
- entry.broken.push({ ref: '<parse>', status: e.message });
- }
- const n = entry.broken.length;
- console.log(`[${n === 0 ? 'OK' : 'BAD'}] ${p} ${n} broken sub-resource${n === 1 ? '' : 's'}`);
- findings.push(entry);
-}
-
-console.log('\n==== DETAILS ====');
-for (const f of findings) {
- if (!f.broken?.length) continue;
- console.log(`\n${f.path} (status ${f.status}):`);
- for (const b of f.broken) console.log(` ${b.status} ${b.ref}`);
-}
diff --git a/scripts/tmp-page-sweep.mjs b/scripts/tmp-page-sweep.mjs
deleted file mode 100644
index 4a755e229..000000000
--- a/scripts/tmp-page-sweep.mjs
+++ /dev/null
@@ -1,103 +0,0 @@
-import { chromium } from 'playwright';
-import { readFileSync } from 'fs';
-
-const BASE = 'http://127.0.0.1:4173';
-
-// Pages to probe — mix of HTML files at root and vercel-route paths served by preview.
-// Vite preview will 404 on paths not in dist/, so we focus on direct HTML entries.
-const paths = [
- '/',
- '/index.html',
- '/app.html',
- '/home.html',
- '/features.html',
- '/create.html',
- '/agent-home.html',
- '/agent-edit.html',
- '/agent-embed.html',
- '/embed.html',
- '/a-embed.html',
- '/public/login.html',
- '/public/register.html',
- '/public/agent/index.html',
- '/public/dashboard/index.html',
- '/public/dashboard/storage.html',
- '/public/dashboard/usage.html',
- '/public/dashboard/wallets.html',
- '/public/dashboard/sessions.html',
- '/public/dashboard/embed-policy.html',
- '/public/hydrate/index.html',
- '/public/studio/index.html',
- '/public/discover/index.html',
- '/public/artifact/index.html',
- '/public/widgets-gallery/index.html',
- '/public/docs-widgets.html',
- '/public/reputation/index.html',
- '/public/discover/index.html',
-];
-
-const browser = await chromium.launch();
-const report = [];
-
-for (const p of paths) {
- const ctx = await browser.newContext();
- const page = await ctx.newPage();
- const consoleErrors = [];
- const pageErrors = [];
- const failed = [];
- page.on('console', (msg) => {
- if (msg.type() === 'error') consoleErrors.push(msg.text().slice(0, 300));
- });
- page.on('pageerror', (err) => {
- pageErrors.push((err.message || String(err)).slice(0, 300));
- });
- page.on('requestfailed', (req) => {
- failed.push(`${req.failure()?.errorText || '?'} ${req.url()}`);
- });
- page.on('response', (resp) => {
- const s = resp.status();
- if (s >= 400) failed.push(`${s} ${resp.url()}`);
- });
-
- let loadErr = null;
- try {
- const resp = await page.goto(BASE + p, { waitUntil: 'networkidle', timeout: 15000 });
- if (!resp || !resp.ok()) loadErr = `status=${resp?.status() ?? 'none'}`;
- } catch (e) {
- loadErr = e.message.slice(0, 200);
- }
- await ctx.close();
-
- const entry = {
- path: p,
- loadErr,
- consoleErrors,
- pageErrors,
- failed: failed.filter((x) => !/\/@vite\/|vite\/client|hot-update/.test(x)),
- };
- report.push(entry);
- const problems =
- (entry.loadErr ? 1 : 0) +
- entry.consoleErrors.length +
- entry.pageErrors.length +
- entry.failed.length;
- console.log(
- `[${problems === 0 ? 'OK' : 'WARN'}] ${p} (${problems} issue${problems === 1 ? '' : 's'})`,
- );
-}
-
-await browser.close();
-
-// Print details
-console.log('\n\n==== DETAILS ====');
-for (const r of report) {
- const issues =
- (r.loadErr ? 1 : 0) + r.consoleErrors.length + r.pageErrors.length + r.failed.length;
- if (issues === 0) continue;
- console.log(`\n--- ${r.path} ---`);
- if (r.loadErr) console.log(' LOAD:', r.loadErr);
- for (const e of r.pageErrors) console.log(' PAGE-ERR:', e);
- for (const e of r.consoleErrors) console.log(' CONSOLE:', e);
- for (const e of r.failed.slice(0, 10)) console.log(' REQ:', e);
- if (r.failed.length > 10) console.log(` (+${r.failed.length - 10} more req failures)`);
-}
diff --git a/src/agent-edit.js b/src/agent-edit.js
index eb3d83abe..ae204b922 100644
--- a/src/agent-edit.js
+++ b/src/agent-edit.js
@@ -78,7 +78,7 @@ async function createAgentFromAvatar() {
}
}
- history.replaceState({}, '', `/agent-edit.html?id=${agent.id}`);
+ history.replaceState({}, '', `/agent/${agent.id}/edit`);
agentData = agent;
if (initAvatarName) {
agentData.name = name;
@@ -116,7 +116,7 @@ function render() {
$('panel-persona').hidden = false;
$('panel-persona').classList.add('active');
$('agent-title').textContent = `Edit Agent: ${agentData.name || 'Untitled'}`;
- $('back-link').href = `/agent-detail.html?id=${agentId}`;
+ $('back-link').href = `/agents/${agentId}`;
// Persona
$('f-name').value = agentData.name || '';
@@ -848,7 +848,7 @@ $('publish-save').addEventListener('click', async () => {
status.className = 'form-status ok';
const view = $('publish-view');
if (view) {
- view.href = `/marketplace.html#${agentId}`;
+ view.href = `/marketplace#${agentId}`;
view.hidden = false;
}
} catch (err) {
@@ -2041,8 +2041,8 @@ function ensureStudioTab() {
if (studioTabMounted) return;
studioTabMounted = true;
const origin = embedOrigin();
- $('studio-playground').href = `/playground.html?agent_id=${encodeURIComponent(agentId)}`;
- $('studio-avatar').href = agentData.avatar_id ? `/avatar-page.html?id=${encodeURIComponent(agentData.avatar_id)}` : '/dashboard/#avatars';
+ $('studio-playground').href = `/playground?agent_id=${encodeURIComponent(agentId)}`;
+ $('studio-avatar').href = agentData.avatar_id ? `/avatars/${encodeURIComponent(agentData.avatar_id)}` : '/dashboard/#avatars';
$('studio-public').href = `/agent/${agentId}`;
$('studio-manifest').href = `${origin}/api/agents/${agentId}/manifest`;
diff --git a/src/avatar-page.js b/src/avatar-page.js
index fe66aaba7..0e80694fb 100644
--- a/src/avatar-page.js
+++ b/src/avatar-page.js
@@ -477,7 +477,7 @@ async function startAgentWithAvatar() {
if (!r.ok) throw new Error(j.error_description || j.error || 'Failed to create agent');
const newId = j?.data?.agent?.id;
if (!newId) throw new Error('Server did not return new agent id');
- location.href = `/agent-edit.html?id=${encodeURIComponent(newId)}`;
+ location.href = `/agent/${encodeURIComponent(newId)}/edit`;
} catch (err) {
console.error('[avatar] start agent', err);
btn.textContent = original;
diff --git a/src/marketplace.js b/src/marketplace.js
index 27c4f2082..03acaa22e 100644
--- a/src/marketplace.js
+++ b/src/marketplace.js
@@ -1080,7 +1080,7 @@ async function startAgentFromAvatar() {
const params = new URLSearchParams({ avatar_id: activeAvatar.avatarId || '' });
if (activeAvatar.name) params.set('avatar_name', activeAvatar.name);
if (activeAvatar.glbUrl) params.set('avatar_glb', activeAvatar.glbUrl);
- location.href = `/agent-edit.html?${params.toString()}`;
+ location.href = `/agent/new?${params.toString()}`;
}
// ── Skills marketplace tab ───────────────────────────────────────────────
@@ -1361,7 +1361,7 @@ function renderMineGrid() {
<button id="mine-empty-new">+ New Agent</button>
</div>`;
$('mine-empty-new')?.addEventListener('click', () => {
- location.href = '/agent-edit.html';
+ location.href = '/agent/new';
});
return;
}
@@ -2049,7 +2049,7 @@ async function fork() {
if (!r.ok) throw new Error(j?.error_description || 'Fork failed');
// Send the user to chat with their new fork.
const newId = j?.data?.agent?.id;
- if (newId) location.href = `/agent-detail.html?id=${newId}`;
+ if (newId) location.href = `/agents/${newId}`;
} catch (err) {
alert(err.message || 'Fork failed');
}
@@ -2195,7 +2195,7 @@ function bindEvents() {
// New Agent CTA on Mine tab
$('market-new-agent-btn')?.addEventListener('click', () => {
- location.href = '/agent-edit.html';
+ location.href = '/agent/new';
});
// Sidebar nav: intercept marketplace links so we route via SPA
diff --git a/src/pump/launch-token-boot.js b/src/pump/launch-token-boot.js
index 2e5254747..af17a9d24 100644
--- a/src/pump/launch-token-boot.js
+++ b/src/pump/launch-token-boot.js
@@ -30,7 +30,7 @@ function _mount() {
// Token launched, show dashboard button
btn.textContent = 'View Token Dashboard';
btn.addEventListener('click', () => {
- window.open(`/pump-dashboard.html?agent=${agentId}`, '_blank');
+ window.open(`/pump-dashboard?agent=${agentId}`, '_blank');
});
} else {
const imageUrl =
diff --git a/vercel.json b/vercel.json
index 46080cae9..e1e7200f8 100644
--- a/vercel.json
+++ b/vercel.json
@@ -248,6 +248,14 @@
"src": "/launchpad/?",
"dest": "/launchpad.html"
},
+ {
+ "src": "/playground",
+ "dest": "/playground.html"
+ },
+ {
+ "src": "/playground/",
+ "dest": "/playground.html"
+ },
{
"src": "/p/([a-z0-9-]+)/?",
"dest": "/p/index.html"
@@ -982,6 +990,10 @@
"src": "/a/(\\d+)/(\\d+)/edit",
"dest": "/a-edit.html"
},
+ {
+ "src": "/agent/new",
+ "dest": "/agent-edit.html"
+ },
{
"src": "/agent/([^/]+)/edit",
"dest": "/agent-edit.html"