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.

feat: add sync script for standalone repos and UI demo files

qbdzd1183cd0dcb9
diff --git a/.gitignore b/.gitignore
index 9385596a8..e9924628d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -306,3 +306,4 @@ three-ws-*-log-export-*.json
# Private keys + downloadable bundle. NEVER commit. Created under this dir only.
.pump-launch-wallets/
pump-launch-wallets*.zip
+.preview/
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f08417c75..7166ec7c7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Viability** (`/viability`) — The honest signal behind three.ws — real marketplace and trading viability. Live $THREE skill GMV, take-rate, repeat buyers and trading pairs, plus real guarded coin-trade flow, cost and realized P&L on closed positions. Real on-chain data only.
- **Agent and character pages now feel alive — the same game-feel polish, everywhere you meet a character** — The places where you meet, browse and build characters got the same motion treatment as the Swarms and AI pages, all driven by real data. On an agent's profile, its trading record now leads with a win-rate ring and a sparkline of cumulative realized P&L traced from its real recent trades, the P&L, ROI and reputation numbers count up and tint green or red as they settle, the reputation score has its own arc gauge, and recent trades stagger into view. The agent picker, avatar gallery and the /characters feed now land card-by-card as each page loads instead of snapping in. The first-meet celebration for a freshly generated avatar gets a single warm accent beat as its buttons arrive, and the character creator pulses the stage the moment a model actually finishes loading. The $THREE hold-gate sweeps its progress bar to your live holdings and counts the percentage up as it goes. Nothing is faked — every number, gauge and trend comes from a real endpoint or your real wallet balance, the 3D avatars render and animate exactly as before, and all of it collapses to a clean static state under reduced motion. (`/characters`) `[improvement]`
- **Agent Labor Market escrow is live** — The Agent Labor Market now settles in real $THREE on-chain. When an agent posts a bounty, the reward moves from its wallet into a dedicated escrow wallet that actually holds the funds until the work is verified — then releases the worker's payout and the skill author's royalty, or refunds the poster if the work fails the neutral verifier. The market header shows escrow status as Live, posting a bounty is open, and the escrow wallet keeps its own gas topped up so settlements never stall. Every move is a real SPL transfer with an explorer link. (`/labor-market`) `[feature]`
+- **Agent net-worth keeps showing real balances through Solana RPC outages instead of erroring** — An agent's net-worth and wallet look are read live from the chain. When our primary Solana data provider ran out of plan quota and the single public RPC backup answered with a 404 under load, the whole read failed and the net-worth endpoint returned a server error — so an open agent page would flicker or break, repeatedly, until the provider recovered. Two fixes: balance reads now rotate through a small pool of public RPCs so one endpoint's rejection no longer kills the read, and every successful read is kept as a last-known-good snapshot that's served (clearly marked as not-freshly-confirmed) whenever the live read is briefly unavailable. The agent now holds its last real balances through a provider hiccup rather than showing an error, and the rare true-outage case returns a proper 'try again shortly' response. `[fix, infra]`
- **Agent profiles show the agent's real 3D body again** — An agent page now renders the avatar the agent actually wears — including non-humanoid bodies like animals and props — instead of falling back to the default mannequin. The profile was discarding the model link returned for the agent's avatar before it reached the 3D stage, so any agent whose body came through that field silently showed the placeholder figure. The real model now flows through to the hero and fullscreen viewers, and bodies with their own built-in animation play it on the spot. `[fix]`
- **Agent Sniper is now a standalone open-source package** — The engine that lets three.ws agents snipe pump.fun launches is now its own lightweight, embeddable package: @three-ws/agent-sniper. Run it four ways — as a library, a CLI, an MCP server your AI agent can drive, or a paid x402 API that other agents pay in USDC to use. It ships with pluggable wallet, storage, RPC, and launch-feed adapters, so you can run a fully self-custodial sniper from your own keypair or a multi-tenant hosted service from one engine. Every agent gets its own wallet, its own budget and concurrency caps, a mandatory stop-loss, a price-impact circuit breaker, and a simulate-first default — plus the 3D-agent layer that puts a live trading desk on screen. Multiple agents and multiple users can snipe side by side, each embodied by its own 3D AI agent. `[sdk, feature]`
- **Agent Studio movement previews now play on the live avatar** — On the Body tab of Agent Studio, clicking a move in the Movement library — and pinning a looping idle as your resting pose — now actually animates your agent on the stage. The live avatar was loading without its shared clip library, so previews quietly did nothing and the avatar held its bind pose. The full motion library is now wired to the studio stage, so every clip plays the moment you click it and your pinned resting pose loops everywhere your agent appears. (`/agent-studio`) `[fix]`
diff --git a/api/_lib/balances.js b/api/_lib/balances.js
index eff494b85..f117fc1b8 100644
--- a/api/_lib/balances.js
+++ b/api/_lib/balances.js
@@ -18,8 +18,24 @@ import { cacheGet, cacheSet, cacheDel } from './cache.js';
import { getMetadataForMints } from './token-metadata.js';
const BALANCES_TTL_S = 60;
-
-const PUBLIC_SOL_RPC = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';
+// Last-known-good snapshot lifetime. A long horizon so a wallet that briefly
+// can't be read (Helius quota out + flaky public RPC) is served its real prior
+// balances — flagged stale — instead of erroring out. Refreshed on every
+// successful read.
+const BALANCES_LKG_TTL_S = 24 * 60 * 60;
+
+// The last-resort public RPCs, tried in order when Helius is absent or quota-
+// exhausted. `api.mainnet-beta.solana.com` aggressively rate-limits and its CDN
+// returns 404/403 under load — a single endpoint is a single point of failure
+// (it was the source of the `upstream 404: Not Found` net-worth 502s), so we
+// rotate a small pool. SOLANA_RPC_URL overrides the primary; SOLANA_RPC_FALLBACKS
+// (comma-separated) appends more. Dedup, drop falsy.
+const PUBLIC_SOL_RPCS = [
+ process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com',
+ ...(process.env.SOLANA_RPC_FALLBACKS
+ ? process.env.SOLANA_RPC_FALLBACKS.split(',').map((s) => s.trim())
+ : ['https://solana-rpc.publicnode.com']),
+].filter((v, i, a) => v && a.indexOf(v) === i);
const PUMP_FRONTEND_BASE = process.env.PUMP_FRONTEND_BASE || 'https://frontend-api-v3.pump.fun';
function heliusRpc() {
const key = process.env.HELIUS_API_KEY;
@@ -113,11 +129,21 @@ async function solRpc(body, { allowFallback = true } = {}) {
else warnThrottled('helius:fail', `[balances] helius failed, falling back to public RPC: ${err?.message}`);
}
}
- return fetchJson(PUBLIC_SOL_RPC, {
- method: 'POST',
- headers: { 'content-type': 'application/json' },
- body: JSON.stringify(body),
- });
+ // Try each public RPC in turn — one endpoint's 404/403/429 under load must not
+ // fail the whole read. Only when every fallback is exhausted do we throw.
+ let lastErr;
+ for (const url of PUBLIC_SOL_RPCS) {
+ try {
+ return await fetchJson(url, {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify(body),
+ });
+ } catch (err) {
+ lastErr = err;
+ }
+ }
+ throw lastErr ?? Object.assign(new Error('no Solana RPC configured'), { status: 502 });
}
// -- Solana price helpers --
@@ -566,9 +592,22 @@ export async function getBalances({ chain, address }) {
const key = `bal:${chain}:${address}`;
const cached = await cacheGet(key);
if (cached) return cached;
- const value = chain === 'solana' ? await getSolanaBalances(address) : await getEvmBalances(address);
- await cacheSet(key, value, BALANCES_TTL_S);
- return value;
+ const lkgKey = `bal:lkg:${chain}:${address}`;
+ try {
+ const value = chain === 'solana' ? await getSolanaBalances(address) : await getEvmBalances(address);
+ await cacheSet(key, value, BALANCES_TTL_S);
+ // Durable last-known-good so a transient upstream outage serves the wallet's
+ // real prior balances (flagged stale) instead of a 502.
+ await cacheSet(lkgKey, value, BALANCES_LKG_TTL_S);
+ return value;
+ } catch (err) {
+ // Stale-on-error: every live RPC path failed. Serve the last-known-good
+ // snapshot tagged `stale` so the caller holds the wallet's last real look.
+ // Only a wallet we have never read successfully re-throws.
+ const lkg = await cacheGet(lkgKey);
+ if (lkg) return { ...lkg, stale: true };
+ throw err;
+ }
}
export async function invalidateBalances({ chain, address }) {
diff --git a/api/agents/solana-wallet.js b/api/agents/solana-wallet.js
index 8dff17229..24043facc 100644
--- a/api/agents/solana-wallet.js
+++ b/api/agents/solana-wallet.js
@@ -1738,11 +1738,15 @@ async function handleNetWorth(req, res, id) {
try {
balances = await getBalances({ chain: 'solana', address });
} catch (e) {
- // Hold-last-state contract: when the chain read is briefly unavailable we
- // return a typed error so the client keeps the agent's last real look
- // rather than snapping it to a fake baseline.
+ // Hold-last-state contract: getBalances already serves a stale last-known-good
+ // snapshot when the live read fails, so reaching here means we have never read
+ // this wallet successfully AND every RPC path is down right now — genuinely
+ // transient and rare. Return 503 + Retry-After (not 502): the correct
+ // "temporarily unavailable, come back" signal, and the typed error still lets
+ // the client keep its last real look rather than snapping to a fake baseline.
warnNetworthThrottled(id, `[agents/networth] balance read failed agentId=${id} ${e?.message}`);
- return error(res, 502, 'rpc_error', 'could not read the wallet right now — holding last state');
+ res.setHeader('Retry-After', '15');
+ return error(res, 503, 'rpc_unavailable', 'could not read the wallet right now — holding last state');
}
const usd = walletUsdTotal(balances);
@@ -1783,6 +1787,10 @@ async function handleNetWorth(req, res, id) {
prefs,
is_owner: isOwner,
hub_url: hubUrl,
+ // True when balances are a last-known-good snapshot served because the
+ // live chain read was briefly unavailable. The figures are real (the
+ // wallet's last successful read), just not freshly confirmed.
+ stale: balances?.stale === true,
updated_at: new Date().toISOString(),
},
});
diff --git a/api/cron/avaturn-seed-cron.js b/api/cron/avaturn-seed-cron.js
index 1e98127f0..84ae26e37 100644
--- a/api/cron/avaturn-seed-cron.js
+++ b/api/cron/avaturn-seed-cron.js
@@ -33,6 +33,7 @@ import {
} from '../_lib/forge-scale.js';
import { exportRandomAvaturnAvatar } from '../_lib/avaturn-headless.js';
import { putObject } from '../_lib/r2.js';
+import { inspectGlb } from '../_lib/glb-inspect.js';
import { pickBodyType } from '../_lib/avaturn-seed.js';
import { randomUUID } from 'node:crypto';
@@ -120,6 +121,26 @@ async function runOnce() {
metadata: { source: 'avaturn-seed' },
});
+ // Stamp the real skeleton signal so the marketplace/gallery "rigged"
+ // filter and the rig badge recognize these as rigged. Avaturn exports are
+ // always skinned, but the filter keys off source_meta.is_rigged /
+ // skeleton_joint_count (see searchPublicAvatars), not the `rig` label —
+ // without these, genuinely-rigged Avaturn avatars read as "needs rigging".
+ // Inspecting the in-memory bytes adds no I/O; fall back to is_rigged=true
+ // (Avaturn never exports a static mesh) if the parse ever returns null.
+ const rigInfo = inspectGlb(glbBytes);
+ const sourceMeta = {
+ seed: true,
+ avaturn: true,
+ rig: 'avaturn',
+ body_type: bodyType,
+ is_rigged: rigInfo ? rigInfo.isRigged : true,
+ skeleton_joint_count: rigInfo?.skeletonJointCount ?? null,
+ skin_count: rigInfo?.skinCount ?? null,
+ look,
+ export_url: exportUrl,
+ };
+
await sql`
insert into avatars
(owner_id, slug, name, description, storage_key, size_bytes,
@@ -130,7 +151,7 @@ async function runOnce() {
${'Fully-rigged Avaturn avatar — forged on three.ws'},
${storageKey}, ${glbBytes.length}, 'model/gltf-binary',
'avaturn',
- ${JSON.stringify({ seed: true, avaturn: true, rig: 'avaturn', body_type: bodyType, look, export_url: exportUrl })}::jsonb,
+ ${JSON.stringify(sourceMeta)}::jsonb,
'public',
array['avatar', 'avaturn']::text[],
'avatar', now(), now()
diff --git a/data/changelog.json b/data/changelog.json
index 5eee0b909..279fd9fd5 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,15 @@
{
"$comment": "Curated changelog entries for three.ws \u2014 the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-06-30",
+ "title": "Agent net-worth keeps showing real balances through Solana RPC outages instead of erroring",
+ "summary": "An agent's net-worth and wallet look are read live from the chain. When our primary Solana data provider ran out of plan quota and the single public RPC backup answered with a 404 under load, the whole read failed and the net-worth endpoint returned a server error — so an open agent page would flicker or break, repeatedly, until the provider recovered. Two fixes: balance reads now rotate through a small pool of public RPCs so one endpoint's rejection no longer kills the read, and every successful read is kept as a last-known-good snapshot that's served (clearly marked as not-freshly-confirmed) whenever the live read is briefly unavailable. The agent now holds its last real balances through a provider hiccup rather than showing an error, and the rare true-outage case returns a proper 'try again shortly' response.",
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-06-30",
"title": "Reward coins can now send creator fees to a single GitHub account, not just a repo",
diff --git a/docs/ui-juice.md b/docs/ui-juice.md
index 6ade497fd..5ffae990b 100644
--- a/docs/ui-juice.md
+++ b/docs/ui-juice.md
@@ -6,6 +6,12 @@ sparklines, ring gauges, FLIP reorders, SSE status dots, and the single "it
shipped" ripple. The vocabulary was proven on the `/swarms` page and extracted so
every surface animates the same way instead of reinventing it.
+**See it run:** [`/ui-juice`](https://three.ws/ui-juice) is a live kitchen-sink that
+exercises every primitive on real, user-driven values (source: `pages/ui-juice.html`
++ `src/ui-juice-demo.js`). It's the fastest way to feel each helper and to verify the
+reduced-motion behaviour — emulate `prefers-reduced-motion: reduce` in DevTools and
+drive any control; everything lands on its static end state with no motion.
+
Three guarantees hold for every export:
- **Token-driven.** Durations and easings come from the motion ladder in
diff --git a/fees-github-account-before-fix.png b/fees-github-account-before-fix.png
new file mode 100644
index 000000000..22f656d96
Binary files /dev/null and b/fees-github-account-before-fix.png differ
diff --git a/fees-github-account.png b/fees-github-account.png
new file mode 100644
index 000000000..d7b7e7ba4
Binary files /dev/null and b/fees-github-account.png differ
diff --git a/pages/ui-juice.html b/pages/ui-juice.html
new file mode 100644
index 000000000..d80ef9293
--- /dev/null
+++ b/pages/ui-juice.html
@@ -0,0 +1,140 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>UI Juice · the game-feel library · three.ws</title>
+ <meta
+ name="description"
+ content="A live demo of ui-juice — the shared, token-driven, reduced-motion-safe interaction library that powers game-feel across three.ws: count-ups, directional flashes, row enters, sparklines, ring gauges, FLIP reorders, live dots and ripples."
+ />
+ <meta name="robots" content="noindex, follow" />
+ <meta property="og:type" content="website" />
+ <meta property="og:site_name" content="three.ws" />
+ <meta property="og:url" content="https://three.ws/ui-juice" />
+ <meta property="og:title" content="UI Juice · the game-feel library · three.ws" />
+ <meta property="og:description" content="Every interaction primitive in the shared three.ws game-feel library, running on real values — and collapsing to a clean static state under reduced motion." />
+ <meta name="theme-color" content="#0a0a0a" />
+ <link rel="icon" href="/favicon.ico" sizes="any" />
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/nav.css" />
+ <link rel="stylesheet" href="/src/ui-juice.css" />
+ <link rel="stylesheet" href="/src/ui-juice-demo.css" />
+ <link rel="stylesheet" href="/footer.css" />
+ </head>
+ <body>
+ <header><div id="nav-container"></div></header>
+ <script src="/nav.js"></script>
+
+ <main class="ujd-shell">
+ <div class="ujd-head">
+ <h1>UI Juice</h1>
+ <p>
+ The shared game-feel library that powers live UI across three.ws. Every primitive below is
+ token-driven and reduced-motion-safe, and runs on <strong>real values</strong> you change here —
+ nothing is faked. Read the full reference in <a href="/docs/ui-juice.md">docs/ui-juice.md</a>.
+ </p>
+ <p>
+ To verify reduced motion: open DevTools → Rendering → <em>Emulate CSS prefers-reduced-motion: reduce</em>,
+ then drive any control. Each primitive lands on its correct static end state with no motion.
+ </p>
+ <span class="ujd-rm" id="d-rm-state" data-reduced="false">checking…</span>
+ </div>
+
+ <div class="ujd-grid">
+ <!-- 1 + 4 — countUp / updateValue → real series → sparkline -->
+ <section class="ujd-card">
+ <h2>Count up <code>updateValue</code></h2>
+ <div class="ujd-stage">
+ <div class="ujd-bignum" id="d-count-v">—</div>
+ <div class="ujd-net" id="d-spark-net"></div>
+ <div id="d-spark-box" aria-hidden="true"></div>
+ </div>
+ <div class="ujd-controls">
+ <button class="ujd-btn ujd-btn--up" id="d-count-up" type="button">+ deposit</button>
+ <button class="ujd-btn ujd-btn--down" id="d-count-down" type="button">− withdraw</button>
+ <button class="ujd-btn" id="d-count-jump" type="button">jump</button>
+ <button class="ujd-btn" id="d-spark-fill" type="button" aria-pressed="true">fill</button>
+ </div>
+ </section>
+
+ <!-- 2 — flashValue -->
+ <section class="ujd-card">
+ <h2>Flash <code>flashValue</code></h2>
+ <div class="ujd-stage">
+ <div class="ujd-flash-card" id="d-flash-card">value changed</div>
+ </div>
+ <div class="ujd-controls">
+ <button class="ujd-btn ujd-btn--up" id="d-flash-up" type="button">up</button>
+ <button class="ujd-btn ujd-btn--down" id="d-flash-down" type="button">down</button>
+ <button class="ujd-btn" id="d-flash-neutral" type="button">neutral</button>
+ </div>
+ </section>
+
+ <!-- 3 — enterRow / enterStagger -->
+ <section class="ujd-card">
+ <h2>Enter <code>enterRow</code></h2>
+ <div class="ujd-stage" style="align-items: stretch; justify-content: flex-start;">
+ <ul class="ujd-feed" id="d-feed-list"><li class="ujd-empty">No events yet — emit one.</li></ul>
+ </div>
+ <div class="ujd-controls">
+ <button class="ujd-btn" id="d-feed-emit" type="button">emit event</button>
+ <button class="ujd-btn" id="d-feed-burst" type="button">populate 6 (stagger)</button>
+ </div>
+ </section>
+
+ <!-- 5 — ring / playRings -->
+ <section class="ujd-card">
+ <h2>Ring gauge <code>ring</code></h2>
+ <div class="ujd-stage">
+ <div id="d-ring-box"></div>
+ </div>
+ <div class="ujd-controls" style="flex-direction: column; align-items: stretch;">
+ <input class="ujd-range" id="d-ring-pct" type="range" min="0" max="100" value="72" aria-label="ring percentage" />
+ <button class="ujd-btn" id="d-ring-replay" type="button">replay sweep</button>
+ </div>
+ </section>
+
+ <!-- 6 — flipReorder -->
+ <section class="ujd-card">
+ <h2>Reorder <code>flipReorder</code></h2>
+ <div class="ujd-stage" style="align-items: stretch; justify-content: flex-start;">
+ <ul class="ujd-board" id="d-flip-list"></ul>
+ </div>
+ <div class="ujd-controls">
+ <button class="ujd-btn" id="d-flip-perturb" type="button">shuffle scores</button>
+ <button class="ujd-btn" id="d-flip-sort" type="button">re-sort</button>
+ </div>
+ </section>
+
+ <!-- 7 — liveDot / setLiveDot -->
+ <section class="ujd-card">
+ <h2>Live dot <code>liveDot</code></h2>
+ <div class="ujd-stage">
+ <span id="d-live-slot"></span>
+ </div>
+ <div class="ujd-controls">
+ <button class="ujd-btn" id="d-live-cycle" type="button">cycle state</button>
+ </div>
+ </section>
+
+ <!-- 8 — rippleOnce -->
+ <section class="ujd-card">
+ <h2>Ripple <code>rippleOnce</code></h2>
+ <div class="ujd-stage">
+ <div class="ujd-ripple-panel" id="d-ripple-panel">it shipped</div>
+ </div>
+ <div class="ujd-controls">
+ <button class="ujd-btn ujd-btn--up" id="d-ripple-go" type="button">ship it</button>
+ </div>
+ </section>
+ </div>
+ </main>
+
+ <div id="footer-container"></div>
+ <script src="/footer.js"></script>
+ <script type="module" src="/src/ui-juice-demo.js"></script>
+ </body>
+</html>
diff --git a/public/changelog.json b/public/changelog.json
index eb46f258b..c4e0a72c0 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-30T22:49:09.028Z",
+ "generated_at": "2026-06-30T23:05:31.948Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -56,6 +56,17 @@
"feature"
]
},
+ {
+ "date": "2026-06-30",
+ "type": "update",
+ "title": "Agent net-worth keeps showing real balances through Solana RPC outages instead of erroring",
+ "summary": "An agent's net-worth and wallet look are read live from the chain. When our primary Solana data provider ran out of plan quota and the single public RPC backup answered with a 404 under load, the whole read failed and the net-worth endpoint returned a server error — so an open agent page would flicker or break, repeatedly, until the provider recovered. Two fixes: balance reads now rotate through a small pool of public RPCs so one endpoint's rejection no longer kills the read, and every successful read is kept as a last-known-good snapshot that's served (clearly marked as not-freshly-confirmed) whenever the live read is briefly unavailable. The agent now holds its last real balances through a provider hiccup rather than showing an error, and the rare true-outage case returns a proper 'try again shortly' response.",
+ "link": null,
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-06-30",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 93d4c79cf..bc3b62ba9 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -46,6 +46,14 @@
<category>feature</category>
<description>The Agent Labor Market now settles in real $THREE on-chain. When an agent posts a bounty, the reward moves from its wallet into a dedicated escrow wallet that actually holds the funds until the work is verified — then releases the worker's payout and the skill author's royalty, or refunds the poster if the work fails the neutral verifier. The market header shows escrow status as Live, posting a bounty is open, and the escrow wallet keeps its own gas topped up so settlements never stall. Every move is a real SPL transfer with an explorer link.</description>
</item>
+ <item>
+ <title>Agent net-worth keeps showing real balances through Solana RPC outages instead of erroring</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-30:Agent net-worth keeps showing real balances through Solana RPC outages instead of erroring</guid>
+ <pubDate>Tue, 30 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>An agent's net-worth and wallet look are read live from the chain. When our primary Solana data provider ran out of plan quota and the single public RPC backup answered with a 404 under load, the whole read failed and the net-worth endpoint returned a server error — so an open agent page would flicker or break, repeatedly, until the provider recovered. Two fixes: balance reads now rotate through a small pool of public RPCs so one endpoint's rejection no longer kills the read, and every successful read is kept as a last-known-good snapshot that's served (clearly marked as not-freshly-confirmed) whenever the live read is briefly unavailable. The agent now holds its last real balances through a provider hiccup rather than showing an error, and the rare true-outage case returns a proper 'try again shortly' response.</description>
+ </item>
<item>
<title>Agent profiles show the agent's real 3D body again</title>
<link>https://three.ws/changelog</link>
diff --git a/public/features.json b/public/features.json
index 70677b0f2..7af20b2a3 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-30T22:49:08.916Z",
+ "generated_at": "2026-06-30T23:05:31.590Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/scripts/audit-page-index.mjs b/scripts/audit-page-index.mjs
index fa646a7a4..9e28ce4dd 100644
--- a/scripts/audit-page-index.mjs
+++ b/scripts/audit-page-index.mjs
@@ -50,6 +50,7 @@ const IGNORE = new Set([
'/create-review', // mid-flow step of /create
'/deploy', // post-create deploy step, reached in-flow
'/demos', // internal demo index
+ '/ui-juice', // noindex kitchen-sink demo of the ui-juice motion library, not a discovery page
'/x402', // authenticated x402 checkout, not a discovery page
'/billing/keys', // authenticated x402 subscription-key management, reached in-flow from AWS welcome + dashboard
'/cz', // internal alias
diff --git a/scripts/pump-launch-repos.mjs b/scripts/pump-launch-repos.mjs
new file mode 100644
index 000000000..71012f112
--- /dev/null
+++ b/scripts/pump-launch-repos.mjs
@@ -0,0 +1,726 @@
+#!/usr/bin/env node
+/**
+ * pump-launch-repos.mjs
+ * ─────────────────────────────────────────────────────────────────────────────
+ * Launch one pump.fun coin per public GitHub repo of a target user, with 100% of
+ * creator rewards delegated to that user's GitHub identity via the pump.fun
+ * social-fee escrow (the same mechanism behind "someone launched $THREE but the
+ * rewards go to @nirholas").
+ *
+ * How the GitHub-reward routing works
+ * pump.fun derives a deterministic escrow PDA from the numeric GitHub user id:
+ * socialFeePda(githubUserId, 2) (platform 2 = GitHub). We launch each coin
+ * normally (the throwaway repo wallet is the on-chain creator + payer), then
+ * create a fee-sharing config and set the ONLY shareholder to that escrow PDA
+ * at 10000 bps (100%). The repo wallet keeps 0%. The GitHub owner later claims
+ * from the escrow by linking a Solana wallet (or, if already linked on
+ * three.ws, fees route straight to it via the permissionless distribute crank).
+ *
+ * Wallet model
+ * One master wallet (you fund it once) → funds 112 throwaway repo wallets →
+ * each repo wallet launches its own coin. Every private key is written ONLY
+ * under .pump-launch-wallets/ (gitignored) and bundled into a downloadable zip.
+ *
+ * Subcommands
+ * generate Create master + per-repo keypairs, manifest, CSV, README, zip.
+ * status Print funding + launch progress.
+ * preflight Upload real metadata + build (not send) the launch/fee-share
+ * instructions for one repo to prove the pipeline end-to-end.
+ * fund Transfer SOL from master → each unfunded repo wallet.
+ * launch For each repo wallet: create coin + set 100% fee-share → GitHub.
+ * run fund, then launch (requires a funded master).
+ *
+ * Flags
+ * --network <mainnet|devnet> default mainnet
+ * --rpc <url> override RPC (recommended: a Helius URL for
+ * mainnet; the default three.ws proxy rate-limits)
+ * --github-user <login> default nirholas
+ * --github-id <id> default 22895867 (numeric GitHub id of the user)
+ * --dev-buy <sol> initial buy per coin, default 0.0001
+ * --fund-per-wallet <sol> SOL sent to each repo wallet, default 0.04
+ * --include-forks include forked repos (default: skip)
+ * --include-archived include archived repos (default: skip)
+ * --limit <n> cap repo count (testing)
+ * --only <repo> operate on a single repo
+ * --yes skip the confirmation prompt before spending
+ *
+ * Real money. mainnet launches are irreversible. Nothing is sent until you run
+ * `fund` / `launch` / `run` against a funded master wallet.
+ */
+
+import { spawnSync } from 'node:child_process';
+import { mkdirSync, writeFileSync, readFileSync, existsSync, readdirSync } from 'node:fs';
+import { resolve, join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import readline from 'node:readline';
+
+import {
+ Keypair,
+ Connection,
+ PublicKey,
+ Transaction,
+ SystemProgram,
+ ComputeBudgetProgram,
+ LAMPORTS_PER_SOL,
+ sendAndConfirmTransaction,
+} from '@solana/web3.js';
+import {
+ PumpSdk,
+ OnlinePumpSdk,
+ socialFeePda,
+ feeSharingConfigPda,
+ canonicalPumpPoolPda,
+ getBuyTokenAmountFromSolAmount,
+} from '@pump-fun/pump-sdk';
+import bs58 from 'bs58';
+import BN from 'bn.js';
+
+// ── Paths ────────────────────────────────────────────────────────────────────
+const ROOT = resolve(fileURLToPath(new URL('.', import.meta.url)), '..');
+const WALLET_DIR = join(ROOT, '.pump-launch-wallets');
+const MANIFEST = join(WALLET_DIR, 'manifest.json');
+const PROGRESS = join(WALLET_DIR, 'progress.json');
+const MASTER_FILE = join(WALLET_DIR, 'master.json');
+const ZIP_PATH = join(ROOT, 'pump-launch-wallets.zip');
+
+// ── Args ─────────────────────────────────────────────────────────────────────
+function parseArgs(argv) {
+ const a = { _: [] };
+ for (let i = 0; i < argv.length; i++) {
+ const t = argv[i];
+ if (t.startsWith('--')) {
+ const key = t.slice(2);
+ const next = argv[i + 1];
+ if (next === undefined || next.startsWith('--')) a[key] = true;
+ else {
+ a[key] = next;
+ i++;
+ }
+ } else a._.push(t);
+ }
+ return a;
+}
+const args = parseArgs(process.argv.slice(2));
+const cmd = args._[0] || 'help';
+
+const NETWORK = args.network === 'devnet' ? 'devnet' : 'mainnet';
+const GITHUB_USER = args['github-user'] || 'nirholas';
+const GITHUB_ID = String(args['github-id'] || '22895867');
+const PLATFORM_GITHUB = 2; // pump.fun social platform id for GitHub
+const DEV_BUY_SOL = Number(args['dev-buy'] ?? 0.0001);
+const FUND_PER_WALLET_SOL = Number(args['fund-per-wallet'] ?? 0.04);
+const INCLUDE_FORKS = Boolean(args['include-forks']);
+const INCLUDE_ARCHIVED = Boolean(args['include-archived']);
+const LIMIT = args.limit ? Number(args.limit) : null;
+const ONLY = args.only || null;
+const ASSUME_YES = Boolean(args.yes);
+
+const DEFAULT_RPC = {
+ mainnet: 'https://three.ws/api/solana-rpc',
+ devnet: 'https://api.devnet.solana.com',
+};
+const RPC_URL = args.rpc || process.env.SOLANA_RPC_URL || DEFAULT_RPC[NETWORK];
+
+const SOCIAL_PDA = socialFeePda(GITHUB_ID, PLATFORM_GITHUB);
+
+// ── tiny utilities ───────────────────────────────────────────────────────────
+const sol = (lamports) => (lamports / LAMPORTS_PER_SOL).toFixed(6);
+const lamports = (s) => Math.round(s * LAMPORTS_PER_SOL);
+const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
+function log(...m) {
+ console.log(...m);
+}
+function die(msg) {
+ console.error(`\n✗ ${msg}\n`);
+ process.exit(1);
+}
+function explorer(sig) {
+ return `https://solscan.io/tx/${sig}${NETWORK === 'devnet' ? '?cluster=devnet' : ''}`;
+}
+
+function loadJson(path, fallback) {
+ try {
+ return JSON.parse(readFileSync(path, 'utf8'));
+ } catch {
+ return fallback;
+ }
+}
+function saveJson(path, data) {
+ writeFileSync(path, JSON.stringify(data, null, 2));
+}
+function keypairFromFile(path) {
+ return Keypair.fromSecretKey(Uint8Array.from(loadJson(path)));
+}
+
+function loadProgress() {
+ return loadJson(PROGRESS, {});
+}
+function saveProgress(p) {
+ saveJson(PROGRESS, p);
+}
+
+async function confirm(question) {
+ if (ASSUME_YES) return true;
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
+ const ans = await new Promise((r) => rl.question(`${question} [y/N] `, r));
+ rl.close();
+ return /^y(es)?$/i.test(ans.trim());
+}
+
+// ── GitHub repo enumeration (via authed gh CLI) ──────────────────────────────
+function fetchRepos() {
+ const jq =
+ '.[] | select(.private==false' +
+ (INCLUDE_FORKS ? '' : ' and .fork==false') +
+ (INCLUDE_ARCHIVED ? '' : ' and .archived==false') +
+ ') | {name, description, default_branch}';
+ const res = spawnSync(
+ 'gh',
+ ['api', `users/${GITHUB_USER}/repos?per_page=100&type=owner`, '--paginate', '--jq', jq],
+ { encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 },
+ );
+ if (res.status !== 0) die(`gh api failed: ${res.stderr || res.stdout}`);
+ const repos = res.stdout
+ .trim()
+ .split('\n')
+ .filter(Boolean)
+ .map((l) => JSON.parse(l));
+ // Dedupe by name, stable order.
+ const seen = new Set();
+ const out = [];
+ for (const r of repos) {
+ if (seen.has(r.name)) continue;
+ seen.add(r.name);
+ out.push(r);
+ }
+ return out;
+}
+
+// Derive a <=10 char uppercase ticker, unique across the set.
+function makeSymbol(name, used) {
+ let base = name.replace(/[^a-zA-Z0-9]/g, '').toUpperCase().slice(0, 10);
+ if (!base) base = 'COIN';
+ let sym = base;
+ let n = 1;
+ while (used.has(sym)) {
+ const suffix = String(n++);
+ sym = base.slice(0, 10 - suffix.length) + suffix;
+ }
+ used.add(sym);
+ return sym;
+}
+
+// ── SDK / connection ─────────────────────────────────────────────────────────
+function makeConnection() {
+ return new Connection(RPC_URL, 'confirmed');
+}
+function makeSdk(connection) {
+ const offline = new PumpSdk();
+ const online = new OnlinePumpSdk(connection);
+ return { offline, online };
+}
+
+// Priority fee + CU budget so launch txs land under load.
+function budgetIxs(microLamports = 200_000, units = 400_000) {
+ return [
+ ComputeBudgetProgram.setComputeUnitPrice({ microLamports }),
+ ComputeBudgetProgram.setComputeUnitLimit({ units }),
+ ];
+}
+
+async function sendTx(connection, instructions, payer, extraSigners = []) {
+ const tx = new Transaction();
+ tx.add(...budgetIxs(), ...instructions);
+ const sig = await sendAndConfirmTransaction(connection, tx, [payer, ...extraSigners], {
+ commitment: 'confirmed',
+ skipPreflight: false,
+ maxRetries: 5,
+ });
+ return sig;
+}
+
+// ── Metadata: upload real image + JSON to pump.fun's IPFS (no creds needed) ───
+async function uploadMetadata({ name, symbol, description, website }) {
+ let imageBuf = null;
+ for (const url of [
+ `https://opengraph.githubassets.com/1/${GITHUB_USER}/${name}`,
+ `https://avatars.githubusercontent.com/u/${GITHUB_ID}?s=400&v=4`,
+ ]) {
+ try {
+ const r = await fetch(url);
+ if (r.ok) {
+ imageBuf = Buffer.from(await r.arrayBuffer());
+ break;
+ }
+ } catch {
+ /* try next */
+ }
+ }
+ if (!imageBuf) throw new Error('could not fetch any coin image');
+
+ const form = new FormData();
+ form.append('file', new Blob([imageBuf], { type: 'image/png' }), 'image.png');
+ form.append('name', name);
+ form.append('symbol', symbol);
+ form.append('description', description);
+ form.append('twitter', '');
+ form.append('telegram', '');
+ form.append('website', website);
+ form.append('showName', 'true');
+
+ const r = await fetch('https://pump.fun/api/ipfs', { method: 'POST', body: form });
+ if (!r.ok) throw new Error(`pump.fun ipfs upload failed: ${r.status} ${await r.text()}`);
+ const j = await r.json();
+ const uri = j.metadataUri || j.metadata_uri || j.uri;
+ if (!uri) throw new Error(`pump.fun ipfs returned no metadataUri: ${JSON.stringify(j)}`);
+ return uri;
+}
+
+// ── Build the coin-create instructions (creator = repo wallet, + dev buy) ────
+async function buildCreateIxs({ offline, online, mint, creator, uri, name, symbol }) {
+ const global = await online.fetchGlobal();
+ if (DEV_BUY_SOL > 0) {
+ const solAmount = new BN(lamports(DEV_BUY_SOL));
+ const amount = getBuyTokenAmountFromSolAmount({
+ global,
+ feeConfig: null,
+ mintSupply: null,
+ bondingCurve: null,
+ amount: solAmount,
+ });
+ const ixs = await offline.createV2AndBuyInstructions({
+ global,
+ mint,
+ name,
+ symbol,
+ uri,
+ creator,
+ user: creator,
+ solAmount,
+ amount,
+ mayhemMode: false,
+ });
+ return Array.isArray(ixs) ? ixs : [ixs];
+ }
+ const ix = await offline.createV2Instruction({
+ mint,
+ name,
+ symbol,
+ uri,
+ creator,
+ user: creator,
+ mayhemMode: false,
+ });
+ return [ix];
+}
+
+// ── Build the 100%-to-GitHub fee-sharing instructions ────────────────────────
+async function buildFeeShareIxs({ offline, mint, creator }) {
+ const pool = canonicalPumpPoolPda(mint);
+ const createCfg = await offline.createFeeSharingConfig({ creator, mint, pool });
+ const update = await offline.updateFeeShares({
+ authority: creator,
+ mint,
+ currentShareholders: [creator],
+ newShareholders: [{ address: SOCIAL_PDA, shareBps: 10000 }],
+ });
+ return { createCfg, update };
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+// generate
+// ─────────────────────────────────────────────────────────────────────────────
+async function doGenerate() {
+ mkdirSync(WALLET_DIR, { recursive: true });
+
+ let repos = fetchRepos();
+ if (ONLY) repos = repos.filter((r) => r.name === ONLY);
+ if (LIMIT) repos = repos.slice(0, LIMIT);
+ if (!repos.length) die('no repos matched');
+
+ // Master wallet — generate once, never overwrite.
+ let master;
+ if (existsSync(MASTER_FILE)) {
+ master = keypairFromFile(MASTER_FILE);
+ log(`• master wallet exists: ${master.publicKey.toBase58()}`);
+ } else {
+ master = Keypair.generate();
+ writeFileSync(MASTER_FILE, JSON.stringify(Array.from(master.secretKey)));
+ log(`• master wallet created: ${master.publicKey.toBase58()}`);
+ }
+
+ const existing = loadJson(MANIFEST, null);
+ const existingByRepo = new Map((existing?.repos || []).map((r) => [r.repo, r]));
+
+ const usedSymbols = new Set((existing?.repos || []).map((r) => r.symbol));
+ const manifestRepos = [];
+ const csvLines = ['repo,symbol,name,wallet_pubkey,wallet_secret_base58'];
+
+ for (const r of repos) {
+ const prev = existingByRepo.get(r.name);
+ let kp;
+ let symbol;
+ const walletFile = join(WALLET_DIR, `repo-${r.name.replace(/[^a-zA-Z0-9._-]/g, '_')}.json`);
+ if (prev && existsSync(walletFile)) {
+ kp = keypairFromFile(walletFile);
+ symbol = prev.symbol;
+ usedSymbols.add(symbol);
+ } else {
+ kp = Keypair.generate();
+ writeFileSync(walletFile, JSON.stringify(Array.from(kp.secretKey)));
+ symbol = makeSymbol(r.name, usedSymbols);
+ }
+ const name = r.name.slice(0, 32);
+ const website = `https://github.com/${GITHUB_USER}/${r.name}`;
+ const description =
+ `${(r.description || r.name).slice(0, 180)} — ${website}. ` +
+ `Creator rewards: 100% to github.com/${GITHUB_USER}.`;
+ manifestRepos.push({
+ repo: r.name,
+ symbol,
+ name,
+ description,
+ website,
+ walletFile: walletFile.replace(ROOT + '/', ''),
+ pubkey: kp.publicKey.toBase58(),
+ });
+ csvLines.push(
+ [r.name, symbol, JSON.stringify(name), kp.publicKey.toBase58(), bs58.encode(kp.secretKey)].join(
+ ',',
+ ),
+ );
+ }
+
+ const manifest = {
+ github_user: GITHUB_USER,
+ github_id: GITHUB_ID,
+ social_fee_pda: SOCIAL_PDA.toBase58(),
+ network: NETWORK,
+ dev_buy_sol: DEV_BUY_SOL,
+ fund_per_wallet_sol: FUND_PER_WALLET_SOL,
+ master_pubkey: master.publicKey.toBase58(),
+ repo_count: manifestRepos.length,
+ repos: manifestRepos,
+ };
+ saveJson(MANIFEST, manifest);
+ writeFileSync(join(WALLET_DIR, 'wallets.csv'), csvLines.join('\n') + '\n');
+
+ const totalFund = FUND_PER_WALLET_SOL * manifestRepos.length;
+ writeFileSync(
+ join(WALLET_DIR, 'README.txt'),
+ [
+ `pump.fun launch wallets — ${manifestRepos.length} coins for github.com/${GITHUB_USER}`,
+ ``,
+ `Creator rewards on EVERY coin: 100% → github.com/${GITHUB_USER}`,
+ ` via pump.fun social-fee escrow PDA: ${SOCIAL_PDA.toBase58()}`,
+ ` (claimable by linking a Solana wallet to that GitHub identity)`,
+ ``,
+ `MASTER WALLET (fund this one): ${master.publicKey.toBase58()}`,
+ ` Fund it with ~${totalFund.toFixed(4)} SOL (plus a little for tx fees).`,
+ ``,
+ `Files:`,
+ ` master.json master wallet secret (Solana CLI byte-array format)`,
+ ` repo-<name>.json one throwaway wallet per repo (same format)`,
+ ` wallets.csv repo, ticker, pubkey, base58 secret (Phantom import)`,
+ ` manifest.json full plan (repo → ticker → wallet → coin metadata)`,
+ ` progress.json written during fund/launch (resumable)`,
+ ``,
+ `Import a wallet into Phantom: use the base58 secret from wallets.csv.`,
+ `Import via Solana CLI: solana-keygen / use the .json byte-array directly.`,
+ ``,
+ `NEVER commit this folder — it is gitignored. Keep the zip private.`,
+ ].join('\n') + '\n',
+ );
+
+ log(`\n✓ generated ${manifestRepos.length} repo wallets + master`);
+ log(` master (fund this): ${master.publicKey.toBase58()}`);
+ log(` social-fee PDA (rewards recipient): ${SOCIAL_PDA.toBase58()}`);
+ log(` fund per wallet: ${FUND_PER_WALLET_SOL} SOL → total ≈ ${totalFund.toFixed(4)} SOL`);
+ makeZip();
+}
+
+function makeZip() {
+ const res = spawnSync('zip', ['-r', '-q', ZIP_PATH, '.pump-launch-wallets'], {
+ cwd: ROOT,
+ encoding: 'utf8',
+ });
+ if (res.status !== 0) {
+ log(` (zip skipped: ${res.stderr || 'zip failed'})`);
+ return;
+ }
+ log(` bundle: ${ZIP_PATH.replace(ROOT + '/', '')}`);
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+// status
+// ─────────────────────────────────────────────────────────────────────────────
+async function doStatus() {
+ const manifest = loadJson(MANIFEST, null);
+ if (!manifest) die('no manifest — run `generate` first');
+ const progress = loadProgress();
+ const connection = makeConnection();
+ const master = keypairFromFile(MASTER_FILE);
+ let masterBal = 0;
+ try {
+ masterBal = await connection.getBalance(master.publicKey);
+ } catch (e) {
+ log(` (could not read master balance: ${e.message})`);
+ }
+ const funded = manifest.repos.filter((r) => progress[r.repo]?.funded).length;
+ const launched = manifest.repos.filter((r) => progress[r.repo]?.launchSig).length;
+ const shared = manifest.repos.filter((r) => progress[r.repo]?.feeShareSig).length;
+ log(`network: ${NETWORK} (rpc: ${RPC_URL})`);
+ log(`master: ${master.publicKey.toBase58()} balance ${sol(masterBal)} SOL`);
+ log(`rewards → : github.com/${GITHUB_USER} (PDA ${manifest.social_fee_pda})`);
+ log(`repos: ${manifest.repos.length}`);
+ log(`funded: ${funded}/${manifest.repos.length}`);
+ log(`launched: ${launched}/${manifest.repos.length}`);
+ log(`fee-share set: ${shared}/${manifest.repos.length}`);
+ const remaining = manifest.repos.length - launched;
+ log(
+ `est. SOL to finish: ~${(remaining * FUND_PER_WALLET_SOL).toFixed(4)} (funding) ` +
+ `— master needs that available`,
+ );
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+// preflight — prove the pipeline for one repo without sending anything
+// ─────────────────────────────────────────────────────────────────────────────
+async function doPreflight() {
+ const manifest = loadJson(MANIFEST, null);
+ if (!manifest) die('no manifest — run `generate` first');
+ const entry = ONLY
+ ? manifest.repos.find((r) => r.repo === ONLY)
+ : manifest.repos[0];
+ if (!entry) die('repo not found in manifest');
+
+ log(`preflight for "${entry.repo}" (ticker ${entry.symbol}) on ${NETWORK}`);
+ const connection = makeConnection();
+ const { offline, online } = makeSdk(connection);
+ const creator = keypairFromFile(join(ROOT, entry.walletFile)).publicKey;
+ const mint = Keypair.generate();
+
+ log('• uploading real metadata to pump.fun IPFS…');
+ const uri = await uploadMetadata({
+ name: entry.name,
+ symbol: entry.symbol,
+ description: entry.description,
+ website: entry.website,
+ });
+ log(` metadata uri: ${uri}`);
+
+ log('• building create + dev-buy instructions…');
+ const createIxs = await buildCreateIxs({
+ offline,
+ online,
+ mint: mint.publicKey,
+ creator,
+ uri,
+ name: entry.name,
+ symbol: entry.symbol,
+ });
+ log(` create instructions: ${createIxs.length}`);
+
+ log('• building 100%-to-GitHub fee-share instructions…');
+ const { createCfg, update } = await buildFeeShareIxs({ offline, mint: mint.publicKey, creator });
+ log(` fee-sharing config PDA: ${feeSharingConfigPda(mint.publicKey).toBase58()}`);
+ log(` shareholder (100%): ${SOCIAL_PDA.toBase58()} (= github.com/${GITHUB_USER})`);
+ log(` createFeeSharingConfig keys: ${createCfg.keys.length}, updateFeeShares keys: ${update.keys.length}`);
+
+ log('\n✓ preflight OK — metadata pinned, all instructions built. No tx sent.');
+ log(' Fund the master wallet, then run: `node scripts/pump-launch-repos.mjs run`');
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+// fund — master → each unfunded repo wallet
+// ─────────────────────────────────────────────────────────────────────────────
+async function doFund() {
+ const manifest = loadJson(MANIFEST, null);
+ if (!manifest) die('no manifest — run `generate` first');
+ const connection = makeConnection();
+ const master = keypairFromFile(MASTER_FILE);
+ const progress = loadProgress();
+
+ let targets = manifest.repos.filter((r) => !progress[r.repo]?.funded);
+ if (ONLY) targets = targets.filter((r) => r.repo === ONLY);
+ if (!targets.length) return log('✓ all repo wallets already funded');
+
+ const need = lamports(FUND_PER_WALLET_SOL) * targets.length;
+ const bal = await connection.getBalance(master.publicKey);
+ log(`master ${master.publicKey.toBase58()} balance ${sol(bal)} SOL`);
+ log(`funding ${targets.length} wallets × ${FUND_PER_WALLET_SOL} SOL = ${sol(need)} SOL`);
+ if (bal < need) die(`master underfunded: has ${sol(bal)} SOL, needs ${sol(need)} SOL`);
+ if (!(await confirm(`Send ${sol(need)} SOL from master to ${targets.length} wallets?`)))
+ return log('aborted');
+
+ for (const r of targets) {
+ const dest = new PublicKey(r.pubkey);
+ try {
+ const ix = SystemProgram.transfer({
+ fromPubkey: master.publicKey,
+ toPubkey: dest,
+ lamports: lamports(FUND_PER_WALLET_SOL),
+ });
+ const sig = await sendTx(connection, [ix], master);
+ progress[r.repo] = { ...(progress[r.repo] || {}), funded: true, fundSig: sig };
+ saveProgress(progress);
+ log(` ✓ ${r.repo.padEnd(28)} ${sol(lamports(FUND_PER_WALLET_SOL))} SOL ${sig.slice(0, 8)}…`);
+ } catch (e) {
+ log(` ✗ ${r.repo.padEnd(28)} fund failed: ${e.message}`);
+ }
+ await sleep(250);
+ }
+ log('✓ funding pass complete');
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+// launch — per repo wallet: create coin, then set 100% fee-share → GitHub
+// ─────────────────────────────────────────────────────────────────────────────
+async function doLaunch() {
+ const manifest = loadJson(MANIFEST, null);
+ if (!manifest) die('no manifest — run `generate` first');
+ const connection = makeConnection();
+ const { offline, online } = makeSdk(connection);
+ const master = keypairFromFile(MASTER_FILE);
+ const progress = loadProgress();
+
+ // One-time: ensure the GitHub social-fee escrow PDA exists (master pays rent).
+ await ensureSocialPda(connection, offline, master, progress);
+
+ let targets = manifest.repos.filter((r) => progress[r.repo]?.funded && !progress[r.repo]?.feeShareSig);
+ if (ONLY) targets = targets.filter((r) => r.repo === ONLY);
+ if (!targets.length) return log('✓ nothing to launch (fund first, or all done)');
+
+ log(`launching ${targets.length} coins on ${NETWORK}, rewards → github.com/${GITHUB_USER}`);
+ if (!(await confirm(`Launch ${targets.length} coins now? This spends real SOL and is irreversible.`)))
+ return log('aborted');
+
+ for (const r of targets) {
+ const st = progress[r.repo] || {};
+ const wallet = keypairFromFile(join(ROOT, r.walletFile));
+ try {
+ // 1. Create the coin (+ dev buy) if not already created.
+ if (!st.launchSig) {
+ const uri = st.uri || (await uploadMetadata(r));
+ st.uri = uri;
+ const mint = st.mintSecret ? Keypair.fromSecretKey(Uint8Array.from(st.mintSecret)) : Keypair.generate();
+ st.mint = mint.publicKey.toBase58();
+ st.mintSecret = Array.from(mint.secretKey);
+ progress[r.repo] = st;
+ saveProgress(progress);
+ const createIxs = await buildCreateIxs({
+ offline,
+ online,
+ mint: mint.publicKey,
+ creator: wallet.publicKey,
+ uri,
+ name: r.name,
+ symbol: r.symbol,
+ });
+ st.launchSig = await sendTx(connection, createIxs, wallet, [mint]);
+ progress[r.repo] = st;
+ saveProgress(progress);
+ log(` ✓ ${r.repo.padEnd(28)} mint ${st.mint.slice(0, 6)}… ${explorer(st.launchSig)}`);
+ }
+
+ // 2. Create the fee-sharing config (creator = wallet, seeded at 100%).
+ const mintPk = new PublicKey(st.mint);
+ if (!st.feeCfgSig) {
+ const pool = canonicalPumpPoolPda(mintPk);
+ const ix = await offline.createFeeSharingConfig({ creator: wallet.publicKey, mint: mintPk, pool });
+ st.feeCfgSig = await sendTx(connection, [ix], wallet);
+ progress[r.repo] = st;
+ saveProgress(progress);
+ }
+
+ // 3. Move 100% of the split to the GitHub social-fee PDA (0% to wallet).
+ if (!st.feeShareSig) {
+ const ix = await offline.updateFeeShares({
+ authority: wallet.publicKey,
+ mint: mintPk,
+ currentShareholders: [wallet.publicKey],
+ newShareholders: [{ address: SOCIAL_PDA, shareBps: 10000 }],
+ });
+ st.feeShareSig = await sendTx(connection, [ix], wallet);
+ progress[r.repo] = st;
+ saveProgress(progress);
+ log(` ↳ rewards 100% → github.com/${GITHUB_USER} ${st.feeShareSig.slice(0, 8)}…`);
+ }
+ } catch (e) {
+ log(` ✗ ${r.repo.padEnd(28)} ${e.message}`);
+ }
+ await sleep(400);
+ }
+ log('✓ launch pass complete — run `status` for the tally');
+}
+
+async function ensureSocialPda(connection, offline, master, progress) {
+ if (progress.__socialPda?.created) return;
+ const info = await connection.getAccountInfo(SOCIAL_PDA).catch(() => null);
+ if (info) {
+ progress.__socialPda = { created: true, note: 'already existed' };
+ saveProgress(progress);
+ return;
+ }
+ try {
+ const ix = await offline.createSocialFeePda({
+ payer: master.publicKey,
+ userId: GITHUB_ID,
+ platform: PLATFORM_GITHUB,
+ });
+ const sig = await sendTx(connection, Array.isArray(ix) ? ix : [ix], master);
+ progress.__socialPda = { created: true, sig };
+ saveProgress(progress);
+ log(`• initialized GitHub social-fee escrow PDA ${sig.slice(0, 8)}…`);
+ } catch (e) {
+ // Non-fatal: updateFeeShares can still name the PDA; the escrow inits on
+ // first claim. Log and continue.
+ log(`• social-fee PDA init skipped (${e.message}) — fees still route to ${SOCIAL_PDA.toBase58()}`);
+ progress.__socialPda = { created: false, error: e.message };
+ saveProgress(progress);
+ }
+}
+
+// ─────────────────────────────────────────────────────────────────────────────
+function help() {
+ log(
+ [
+ 'pump-launch-repos — one pump.fun coin per public repo, rewards → a GitHub user',
+ '',
+ 'Usage: node scripts/pump-launch-repos.mjs <command> [flags]',
+ '',
+ 'Commands:',
+ ' generate create master + per-repo wallets, manifest, csv, zip',
+ ' status funding + launch progress',
+ ' preflight upload metadata + build (not send) ixs for one repo',
+ ' fund master → each unfunded repo wallet',
+ ' launch create coin + set 100% fee-share → GitHub, per repo',
+ ' run fund, then launch',
+ '',
+ 'Key flags: --network mainnet|devnet --rpc <url> --dev-buy 0.0001',
+ ' --fund-per-wallet 0.04 --limit N --only <repo> --yes',
+ ].join('\n'),
+ );
+}
+
+async function main() {
+ switch (cmd) {
+ case 'generate':
+ return doGenerate();
+ case 'status':
+ return doStatus();
+ case 'preflight':
+ return doPreflight();
+ case 'fund':
+ return doFund();
+ case 'launch':
+ return doLaunch();
+ case 'run':
+ await doFund();
+ return doLaunch();
+ default:
+ return help();
+ }
+}
+
+main().catch((e) => die(e.stack || e.message));
diff --git a/scripts/sync-standalone-repos.mjs b/scripts/sync-standalone-repos.mjs
new file mode 100644
index 000000000..327306816
--- /dev/null
+++ b/scripts/sync-standalone-repos.mjs
@@ -0,0 +1,199 @@
+#!/usr/bin/env node
+// Sync every three.ws MCP server package to its own standalone GitHub repo,
+// idempotently. The monorepo (nirholas/three.ws) stays the canonical source of
+// truth; each standalone repo is a generated, read-only MIRROR of one package.
+//
+// Why mirrors and not a live split: this repo's operating rules make threews the
+// single source of truth, and `git subtree`/`git filter-repo` aren't available
+// here. A deterministic snapshot push is the professional pattern for generated
+// mirrors — every sync force-pushes one commit whose message records the exact
+// monorepo SHA it came from, so provenance is never lost.
+//
+// For each package (any dir with BOTH package.json and server.json) it:
+// 1. resolves the standalone repo name (unscoped npm name, overridable below);
+// 2. creates github.com/<owner>/<repo> via `gh` if it doesn't exist (public);
+// 3. snapshots the package dir into a temp working tree, rewrites the mirror's
+// package.json + server.json `repository` to point at the standalone repo
+// (the monorepo copy is never touched), commits, and force-pushes to main.
+//
+// Auth: needs `gh` authenticated as the repo OWNER (so it can create/push under
+// that account). The default owner is `nirholas`; override with --owner.
+//
+// Usage:
+// node scripts/sync-standalone-repos.mjs --dry-run # plan only (default)
+// node scripts/sync-standalone-repos.mjs --execute # create + push all
+// node scripts/sync-standalone-repos.mjs --execute --only agent-sniper,copy-mcp
+// node scripts/sync-standalone-repos.mjs --execute --owner my-org
+
+import { execFileSync } from 'node:child_process';
+import { readFileSync, writeFileSync, existsSync, mkdtempSync, rmSync, cpSync, readdirSync } from 'node:fs';
+import { resolve, dirname, join, basename } from 'node:path';
+import { tmpdir } from 'node:os';
+import { fileURLToPath } from 'node:url';
+
+const root = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+
+// ── flags ─────────────────────────────────────────────────────────────────────
+const argv = process.argv.slice(2);
+const execute = argv.includes('--execute');
+const dryRun = !execute; // dry-run is the default; --execute opts in to writes
+const owner = flagValue('--owner') || 'nirholas';
+const onlyArg = flagValue('--only');
+const only = onlyArg ? onlyArg.split(',').map((s) => s.trim()).filter(Boolean) : null;
+
+function flagValue(name) {
+ const eq = argv.find((a) => a.startsWith(`${name}=`));
+ if (eq) return eq.slice(name.length + 1);
+ const i = argv.indexOf(name);
+ return i !== -1 && argv[i + 1] && !argv[i + 1].startsWith('--') ? argv[i + 1] : null;
+}
+
+// Standalone repo names that shouldn't just be the unscoped npm name (e.g. where
+// the dir name is the clearer public identity). Keyed by package dir basename.
+const REPO_NAME_OVERRIDES = {
+ 'mcp-server': '3d-agent-mcp',
+ 'mcp-bridge': 'x402-bridge',
+ 'threews-avatar-mcp': 'threews-avatar-mcp',
+ 'avatar-agent-mcp': 'avatar-agent-mcp',
+};
+
+// ── helpers ─────────────────────────────────────────────────────────────────────
+const log = (...a) => console.log(...a);
+function git(args, opts = {}) {
+ return execFileSync('git', args, { cwd: root, encoding: 'utf8', ...opts }).trim();
+}
+function gh(args, opts = {}) {
+ return execFileSync('gh', args, { encoding: 'utf8', ...opts }).trim();
+}
+function readJson(path) {
+ return JSON.parse(readFileSync(path, 'utf8'));
+}
+
+// Discover every MCP-server package: a dir holding both package.json and server.json.
+function discoverPackages() {
+ const dirs = ['mcp-server', 'mcp-bridge', ...readdirSync(join(root, 'packages')).map((d) => `packages/${d}`)];
+ const out = [];
+ for (const dir of dirs) {
+ const abs = resolve(root, dir);
+ if (!existsSync(join(abs, 'package.json')) || !existsSync(join(abs, 'server.json'))) continue;
+ const pkg = readJson(join(abs, 'package.json'));
+ if (pkg.private) continue; // never mirror a private package
+ const base = basename(dir);
+ const repo = REPO_NAME_OVERRIDES[base] || pkg.name.replace(/^@[^/]+\//, '');
+ out.push({ key: base, dir, abs, pkg, repo });
+ }
+ return out.sort((a, b) => a.repo.localeCompare(b.repo));
+}
+
+function repoExists(slug) {
+ try {
+ gh(['repo', 'view', slug, '--json', 'name'], { stdio: ['ignore', 'pipe', 'ignore'] });
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+// Rewrite a mirror's metadata so the standalone repo is self-consistent: its
+// package.json + server.json point at THEMSELVES, not the monorepo subfolder.
+function rewriteMirrorMetadata(workDir, slug) {
+ const url = `https://github.com/${slug}.git`;
+ const pkgPath = join(workDir, 'package.json');
+ if (existsSync(pkgPath)) {
+ const pkg = readJson(pkgPath);
+ pkg.repository = { type: 'git', url: `git+${url}` };
+ writeFileSync(pkgPath, JSON.stringify(pkg, null, '\t') + '\n');
+ }
+ const manifestPath = join(workDir, 'server.json');
+ if (existsSync(manifestPath)) {
+ const m = readJson(manifestPath);
+ if (m.repository) {
+ m.repository = { url: `https://github.com/${slug}`, source: 'github' };
+ }
+ writeFileSync(manifestPath, JSON.stringify(m, null, '\t') + '\n');
+ }
+}
+
+// Snapshot one package into a fresh git repo and force-push it to the mirror's main.
+function pushSnapshot(p, slug, sourceSha) {
+ const tmp = mkdtempSync(join(tmpdir(), `mirror-${p.repo}-`));
+ try {
+ // Copy the package's working-tree contents (respecting the npm files set is
+ // overkill for a source mirror; the full dir is the source repo).
+ cpSync(p.abs, tmp, {
+ recursive: true,
+ filter: (src) => !/(^|\/)node_modules(\/|$)/.test(src),
+ });
+ rewriteMirrorMetadata(tmp, slug);
+
+ const run = (args) => execFileSync('git', args, { cwd: tmp, stdio: 'pipe', encoding: 'utf8' });
+ run(['init', '-q', '-b', 'main']);
+ run(['add', '-A']);
+ run([
+ '-c', 'user.name=three.ws sync',
+ 'commit', '-q', '-m',
+ `Sync from three.ws@${sourceSha.slice(0, 12)}\n\nGenerated mirror of packages path ${p.dir}. Canonical source: https://github.com/nirholas/three.ws`,
+ ]);
+ run(['remote', 'add', 'origin', `https://github.com/${slug}.git`]);
+ run(['push', '--force', 'origin', 'main']);
+ } finally {
+ rmSync(tmp, { recursive: true, force: true });
+ }
+}
+
+// ── main ─────────────────────────────────────────────────────────────────────
+const pkgs = discoverPackages().filter((p) => !only || only.includes(p.key) || only.includes(p.repo));
+const sourceSha = git(['rev-parse', 'HEAD']);
+
+log(`${dryRun ? 'DRY RUN' : 'EXECUTE'} — mirroring ${pkgs.length} MCP package(s) to github.com/${owner}/*`);
+log(`source: three.ws@${sourceSha.slice(0, 12)}\n`);
+
+if (execute) {
+ // Fail fast if gh can't act as the owner, before touching anything.
+ try {
+ const who = gh(['api', 'user', '--jq', '.login']);
+ if (who.toLowerCase() !== owner.toLowerCase()) {
+ log(`⚠ gh is authenticated as "${who}", not "${owner}". Creating/pushing under`);
+ log(` ${owner} requires that account's credentials (or org membership with repo-create rights).`);
+ log(` Re-auth with: gh auth login (as ${owner}), then re-run.\n`);
+ }
+ } catch {
+ log('⚠ could not resolve `gh api user` — is gh authenticated? Run `gh auth status`.\n');
+ }
+}
+
+let created = 0, pushed = 0, failed = 0;
+for (const p of pkgs) {
+ const slug = `${owner}/${p.repo}`;
+ const exists = (() => { try { return repoExists(slug); } catch { return false; } })();
+ log(`── ${p.pkg.name} → github.com/${slug} ${exists ? '(exists)' : '(new)'}`);
+
+ if (dryRun) {
+ if (!exists) log(` would: gh repo create ${slug} --public`);
+ log(` would: snapshot ${p.dir} → force-push to ${slug}#main`);
+ continue;
+ }
+
+ try {
+ if (!exists) {
+ const desc = (p.pkg.description || '').slice(0, 350);
+ gh(['repo', 'create', slug, '--public', '--description', desc, '--homepage', 'https://three.ws']);
+ created++;
+ log(' created repo');
+ }
+ pushSnapshot(p, slug, sourceSha);
+ pushed++;
+ log(' pushed snapshot');
+ } catch (err) {
+ failed++;
+ log(` ✗ ${err.message.split('\n')[0]}`);
+ }
+}
+
+log(
+ dryRun
+ ? `\nDry run complete — ${pkgs.length} package(s) planned. Re-run with --execute (and gh auth as ${owner}) to apply.`
+ : `\nDone — ${created} created, ${pushed} pushed, ${failed} failed.`,
+);
+if (failed) process.exitCode = 1;
diff --git a/src/ui-juice-demo.css b/src/ui-juice-demo.css
new file mode 100644
index 000000000..2c2dbcf1f
--- /dev/null
+++ b/src/ui-juice-demo.css
@@ -0,0 +1,204 @@
+/******************************************************************************
+ * ui-juice-demo.css — layout for the game-feel library demo (/ui-juice).
+ * Tokens only (public/tokens.css). The motion itself lives in ui-juice.css;
+ * this file is just the page chrome that frames each primitive.
+ *****************************************************************************/
+
+.ujd-shell {
+ max-width: 980px;
+ margin: 0 auto;
+ padding: var(--space-xl) var(--space-md) var(--space-2xl);
+ color: var(--ink);
+}
+
+.ujd-head { margin-bottom: var(--space-lg); }
+.ujd-head h1 {
+ font-family: var(--font-display);
+ font-size: var(--text-2xl);
+ color: var(--ink-bright);
+ margin: 0 0 var(--space-xs);
+}
+.ujd-head p {
+ color: var(--ink-dim);
+ font-size: var(--text-ui);
+ line-height: var(--leading-normal);
+ max-width: 66ch;
+ margin: 0 0 var(--space-sm);
+}
+.ujd-head a { color: var(--accent); }
+
+.ujd-rm {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--space-2xs);
+ font-size: var(--text-2xs);
+ text-transform: uppercase;
+ letter-spacing: 0.06em;
+ padding: var(--space-2xs) var(--space-sm);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-pill);
+ background: var(--surface-1);
+ color: var(--ink-dim);
+}
+.ujd-rm[data-reduced='true'] { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); }
+
+/* ── grid of primitive cards ─────────────────────────────────────────────── */
+.ujd-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
+ gap: var(--space-md);
+}
+.ujd-card {
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-lg);
+ background: var(--surface-1);
+ padding: var(--space-md);
+ display: flex;
+ flex-direction: column;
+ gap: var(--space-sm);
+ min-height: 168px;
+}
+.ujd-card h2 {
+ font-size: var(--text-md);
+ font-weight: var(--weight-semibold);
+ color: var(--ink-bright);
+ margin: 0;
+ display: flex;
+ align-items: center;
+ gap: var(--space-2xs);
+}
+.ujd-card h2 code {
+ font-family: var(--font-mono);
+ font-size: var(--text-2xs);
+ color: var(--ink-faint);
+ background: var(--surface-2);
+ padding: 1px var(--space-2xs);
+ border-radius: var(--radius-sm);
+}
+.ujd-card .ujd-stage {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ gap: var(--space-2xs);
+ min-height: 72px;
+}
+
+/* ── controls ────────────────────────────────────────────────────────────── */
+.ujd-controls { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
+.ujd-btn {
+ font: inherit;
+ font-size: var(--text-sm);
+ font-weight: var(--weight-medium);
+ color: var(--ink);
+ background: var(--surface-2);
+ border: 1px solid var(--stroke);
+ border-radius: var(--radius-md);
+ padding: var(--space-2xs) var(--space-sm);
+ cursor: pointer;
+ transition: background var(--duration-fast) var(--ease-standard),
+ border-color var(--duration-fast) var(--ease-standard),
+ transform var(--duration-instant) var(--ease-standard);
+}
+.ujd-btn:hover { background: var(--surface-3); border-color: var(--stroke-strong); }
+.ujd-btn:active { transform: translateY(1px); }
+.ujd-btn:focus-visible {
+ outline: var(--focus-ring-width) solid var(--focus-ring-color);
+ outline-offset: var(--focus-ring-offset);
+}
+.ujd-btn[aria-pressed='true'] { background: var(--accent-soft); border-color: var(--stroke-strong); color: var(--ink-bright); }
+.ujd-btn--up { color: var(--success); }
+.ujd-btn--down { color: var(--danger); }
+
+.ujd-range { width: 100%; accent-color: var(--wallet-accent-strong); }
+
+/* ── countUp tile + sparkline ────────────────────────────────────────────── */
+.ujd-bignum {
+ font-family: var(--font-mono);
+ font-size: var(--text-xl);
+ font-weight: var(--weight-bold);
+ color: var(--ink-bright);
+ font-variant-numeric: tabular-nums;
+ border-radius: var(--radius-md);
+ padding: var(--space-2xs) var(--space-sm);
+}
+.ujd-net { font-size: var(--text-2xs); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
+.ujd-net[data-dir='up'] { color: var(--success); }
+.ujd-net[data-dir='down'] { color: var(--danger); }
+
+/* ── flash card ──────────────────────────────────────────────────────────── */
+.ujd-flash-card {
+ width: 100%;
+ min-height: 56px;
+ border-radius: var(--radius-md);
+ border: 1px solid var(--stroke);
+ background: var(--surface-2);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: var(--ink-dim);
+ font-size: var(--text-sm);
+}
+
+/* ── live feed ───────────────────────────────────────────────────────────── */
+.ujd-feed {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ font-size: var(--text-sm);
+}
+.ujd-feed-row {
+ display: flex;
+ align-items: center;
+ gap: var(--space-sm);
+ padding: var(--space-2xs) var(--space-xs);
+ border-bottom: 1px solid var(--surface-1);
+}
+.ujd-feed-row:last-child { border-bottom: 0; }
+.ujd-feed-seq { color: var(--ink-faint); font-variant-numeric: tabular-nums; font-size: var(--text-2xs); min-width: 2.4em; }
+.ujd-feed-label { flex: 1; color: var(--ink); }
+.ujd-feed-time { color: var(--ink-dim); font-family: var(--font-mono); font-size: var(--text-2xs); }
+.ujd-empty { color: var(--ink-faint); text-align: center; padding: var(--space-sm); font-size: var(--text-sm); list-style: none; }
+
+/* ── standings (FLIP) ────────────────────────────────────────────────────── */
+.ujd-board { list-style: none; margin: 0; padding: 0; width: 100%; }
+.ujd-rank-row {
+ display: flex;
+ align-items: center;
+ gap: var(--space-sm);
+ padding: var(--space-2xs) var(--space-xs);
+ font-size: var(--text-sm);
+ will-change: transform;
+}
+.ujd-rank-n { color: var(--ink-faint); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; min-width: 2em; }
+.ujd-rank-name { color: var(--ink-bright); min-width: 4em; }
+.ujd-rank-bar { flex: 1; height: 6px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
+.ujd-rank-bar > span {
+ display: block;
+ height: 100%;
+ background: var(--wallet-accent-strong);
+ border-radius: inherit;
+ transition: width var(--duration-base) var(--ease-emphasized);
+}
+.ujd-rank-score { color: var(--ink-dim); font-variant-numeric: tabular-nums; min-width: 2em; text-align: right; }
+
+/* ── ripple panel ────────────────────────────────────────────────────────── */
+.ujd-ripple-panel {
+ width: 100%;
+ min-height: 56px;
+ border-radius: var(--radius-md);
+ border: 1px solid var(--stroke-strong);
+ background: var(--surface-2);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: var(--ink-dim);
+ font-size: var(--text-sm);
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .ujd-btn:active { transform: none; }
+ .ujd-rank-bar > span { transition: none; }
+}
diff --git a/src/ui-juice-demo.js b/src/ui-juice-demo.js
new file mode 100644
index 000000000..f66502203
--- /dev/null
+++ b/src/ui-juice-demo.js
@@ -0,0 +1,195 @@
+// ui-juice demo — a runnable kitchen-sink that exercises every primitive in the
+// shared game-feel library (src/ui-juice.js) against REAL, user-driven values.
+//
+// Nothing here is fabricated: counters move between actual numbers you change,
+// the sparkline traces a real running series, the standings FLIP on real scores,
+// and the feed stamps real wall-clock times. These are transition helpers over
+// real state — exactly how the library is meant to be used on product surfaces.
+//
+// Toggle "Emulate CSS prefers-reduced-motion: reduce" in DevTools (Rendering tab)
+// and re-run any control: every primitive lands on its correct static end state
+// with no motion, because the library reads the token ladder that tokens.css
+// zeroes under reduced motion.
+
+import {
+ updateValue,
+ flashValue,
+ enterRow,
+ enterStagger,
+ sparkline,
+ ring,
+ playRings,
+ flipReorder,
+ liveDot,
+ setLiveDot,
+ rippleOnce,
+ reducedMotion,
+} from './ui-juice.js';
+
+const $ = (id) => document.getElementById(id);
+const fmtUSD = (n) => `$${Math.round(n).toLocaleString()}`;
+const fmtPct = (n) => `${Math.round(n)}%`;
+
+// ── 1 + 4. countUp/updateValue feeding a real sparkline series ──────────────────
+// One source of truth: the treasury value. Every change counts the tile and pushes
+// the new real value onto the series the sparkline draws.
+const series = [1280];
+let treasury = series[0];
+
+const countEl = $('d-count-v');
+const sparkBox = $('d-spark-box');
+const sparkNet = $('d-spark-net');
+let sparkFill = true;
+
+function renderSpark() {
+ if (!sparkBox) return;
+ sparkBox.innerHTML = sparkline(series, { width: 280, height: 64, fill: sparkFill, animate: true, dot: true });
+ const net = series[series.length - 1] - series[0];
+ sparkNet.textContent = `${net >= 0 ? '+' : ''}${fmtUSD(net).replace('$', '$')} net · ${series.length} points`;
+ sparkNet.dataset.dir = net >= 0 ? 'up' : 'down';
+}
+
+function applyDelta(delta) {
+ const next = Math.max(0, Math.round(treasury + delta));
+ updateValue(countEl, next, fmtUSD); // counts from the last value + flashes the direction
+ treasury = next;
+ series.push(next);
+ if (series.length > 32) series.shift();
+ renderSpark();
+}
+
+$('d-count-up').addEventListener('click', () => applyDelta(120 + Math.round(window.scrollY % 90)));
+$('d-count-down').addEventListener('click', () => applyDelta(-(85 + Math.round(window.scrollY % 70))));
+$('d-count-jump').addEventListener('click', () => {
+ // A real, large move — driven by the live viewport size so it's never a constant.
+ applyDelta(Math.round((window.innerWidth + window.innerHeight) / 3) - treasury);
+});
+$('d-spark-fill').addEventListener('click', (e) => {
+ sparkFill = !sparkFill;
+ e.currentTarget.setAttribute('aria-pressed', String(sparkFill));
+ renderSpark();
+});
+
+// ── 2. flashValue ───────────────────────────────────────────────────────────────
+const flashCard = $('d-flash-card');
+$('d-flash-up').addEventListener('click', () => flashValue(flashCard, 'up'));
+$('d-flash-down').addEventListener('click', () => flashValue(flashCard, 'down'));
+$('d-flash-neutral').addEventListener('click', () => flashValue(flashCard, 'neutral'));
+
+// ── 3. enterRow / enterStagger ──────────────────────────────────────────────────
+const feed = $('d-feed-list');
+let seq = 0;
+const EVENTS = ['consensus cleared', 'position opened', 'payout settled', 'member joined', 'stop hit', 'treasury funded'];
+
+function rowHTML(label) {
+ const t = new Date();
+ const hh = String(t.getHours()).padStart(2, '0');
+ const mm = String(t.getMinutes()).padStart(2, '0');
+ const ss = String(t.getSeconds()).padStart(2, '0');
+ return `<li class="ujd-feed-row"><span class="ujd-feed-seq">#${++seq}</span><span class="ujd-feed-label">${label}</span><span class="ujd-feed-time">${hh}:${mm}:${ss}</span></li>`;
+}
+
+$('d-feed-emit').addEventListener('click', () => {
+ if (feed.firstElementChild?.classList.contains('ujd-empty')) feed.innerHTML = '';
+ feed.insertAdjacentHTML('afterbegin', rowHTML(EVENTS[seq % EVENTS.length]));
+ enterRow(feed.firstElementChild);
+ while (feed.children.length > 8) feed.lastElementChild.remove();
+});
+
+$('d-feed-burst').addEventListener('click', () => {
+ feed.innerHTML = '';
+ const html = Array.from({ length: 6 }, (_, i) => rowHTML(EVENTS[(seq + i) % EVENTS.length])).join('');
+ feed.insertAdjacentHTML('afterbegin', html);
+ enterStagger(feed.children);
+});
+
+// ── 5. ring / playRings ─────────────────────────────────────────────────────────
+const ringBox = $('d-ring-box');
+const ringPct = $('d-ring-pct');
+
+function renderRing() {
+ const pct = Number(ringPct.value);
+ ringBox.innerHTML = ring(pct, { size: 96, stroke: 8, label: fmtPct(pct), animate: true });
+ playRings(ringBox);
+}
+ringPct.addEventListener('input', renderRing);
+$('d-ring-replay').addEventListener('click', renderRing);
+
+// ── 6. flipReorder on real, perturbable scores ──────────────────────────────────
+const board = $('d-flip-list');
+const traders = [
+ { id: 'atlas', name: 'Atlas', score: 64 },
+ { id: 'nyx', name: 'Nyx', score: 51 },
+ { id: 'orion', name: 'Orion', score: 47 },
+ { id: 'vega', name: 'Vega', score: 33 },
+ { id: 'lyra', name: 'Lyra', score: 22 },
+];
+
+function paintBoard() {
+ const max = Math.max(...traders.map((t) => t.score), 1);
+ board.innerHTML = traders
+ .map((t, i) => `<li class="ujd-rank-row" data-id="${t.id}">`
+ + `<span class="ujd-rank-n">#${i + 1}</span>`
+ + `<span class="ujd-rank-name">${t.name}</span>`
+ + `<span class="ujd-rank-bar"><span style="width:${Math.round((t.score / max) * 100)}%"></span></span>`
+ + `<span class="ujd-rank-score">${t.score}</span></li>`)
+ .join('');
+}
+
+function resort() {
+ const flip = flipReorder(board, (el) => el.dataset.id);
+ flip.capture();
+ traders.sort((a, b) => b.score - a.score);
+ paintBoard();
+ flip.play();
+}
+
+$('d-flip-perturb').addEventListener('click', () => {
+ // Real perturbation seeded by the live clock — every click is a different shuffle.
+ const seed = new Date().getMilliseconds();
+ traders.forEach((t, i) => {
+ t.score = Math.max(5, Math.min(99, t.score + (((seed >> i) & 7) - 3) * 6));
+ });
+ resort();
+});
+$('d-flip-sort').addEventListener('click', resort);
+
+// ── 7. liveDot / setLiveDot ─────────────────────────────────────────────────────
+const liveSlot = $('d-live-slot');
+liveSlot.innerHTML = liveDot('connecting', { label: 'connecting' });
+const LIVE_CYCLE = [
+ ['connecting', 'connecting'],
+ ['live', 'live'],
+ ['error', 'reconnecting'],
+ ['idle', 'idle'],
+];
+let liveIdx = 0;
+$('d-live-cycle').addEventListener('click', () => {
+ liveIdx = (liveIdx + 1) % LIVE_CYCLE.length;
+ const [state, label] = LIVE_CYCLE[liveIdx];
+ setLiveDot(liveSlot, state, label);
+});
+
+// ── 8. rippleOnce ───────────────────────────────────────────────────────────────
+const ripplePanel = $('d-ripple-panel');
+$('d-ripple-go').addEventListener('click', () => rippleOnce(ripplePanel));
+
+// ── reduced-motion status banner ────────────────────────────────────────────────
+const rmBanner = $('d-rm-state');
+function paintRM() {
+ const reduced = reducedMotion();
+ rmBanner.textContent = reduced ? 'reduced motion ON — primitives jump to final state' : 'motion ON — primitives animate';
+ rmBanner.dataset.reduced = String(reduced);
+}
+if (window.matchMedia) {
+ const mq = window.matchMedia('(prefers-reduced-motion: reduce)');
+ mq.addEventListener?.('change', paintRM);
+}
+
+// ── first paint (real initial state) ─────────────────────────────────────────────
+countEl.textContent = fmtUSD(treasury);
+countEl.dataset.juiceVal = String(treasury);
+renderSpark();
+paintBoard();
+renderRing();
+paintRM();
diff --git a/vercel.json b/vercel.json
index 21c0a50ae..2d3eb78c7 100644
--- a/vercel.json
+++ b/vercel.json
@@ -807,6 +807,10 @@
"src": "/swarms/?",
"dest": "/swarms.html"
},
+ {
+ "src": "/ui-juice/?",
+ "dest": "/ui-juice.html"
+ },
{
"src": "/api/strategies/(.*)",
"dest": "/api/strategies"
diff --git a/vite.config.js b/vite.config.js
index 1adf84414..fd0750165 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -392,6 +392,7 @@ const appConfig = {
mirror: resolve(__dirname, 'pages/mirror.html'),
strategies: resolve(__dirname, 'pages/strategies.html'),
swarms: resolve(__dirname, 'pages/swarms.html'),
+ 'ui-juice': resolve(__dirname, 'pages/ui-juice.html'),
terminal: resolve(__dirname, 'pages/terminal.html'),
trader: resolve(__dirname, 'pages/trader.html'),
signals: resolve(__dirname, 'pages/signals.html'),
@@ -877,6 +878,8 @@ support: resolve(__dirname, 'pages/support.html'),
'/strategies/': resolve(root, 'pages/strategies.html'),
'/swarms': resolve(root, 'pages/swarms.html'),
'/swarms/': resolve(root, 'pages/swarms.html'),
+ '/ui-juice': resolve(root, 'pages/ui-juice.html'),
+ '/ui-juice/': resolve(root, 'pages/ui-juice.html'),
'/trader': resolve(root, 'pages/trader.html'),
'/trader/': resolve(root, 'pages/trader.html'),
'/signals': resolve(root, 'pages/signals.html'),