Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat: integrate ui-juice for enhanced animations and live indicators across components
qbdz4c113f1fbe96
diff --git a/.smoke-juice.mjs b/.smoke-juice.mjsdeleted file mode 100644index fe9f328c5..000000000--- a/.smoke-juice.mjs+++ /dev/null@@ -1,57 +0,0 @@-import puppeteer from 'puppeteer';--const BASE = process.env.BASE || 'http://localhost:3000';-const PAGES = [- { name: 'agi', url: `${BASE}/agi`, waitMs: 6000 },- { name: 'alpha-copilot', url: `${BASE}/alpha-copilot`, waitMs: 9000 },- { name: 'reasoning-ledger', url: `${BASE}/reasoning-ledger`, waitMs: 5000 },-];--// Console messages we expect when /api is proxied to prod from a logged-out dev-// session (auth-gated endpoints, missing favicons, etc). These are NOT defects in-// the presentation work; real JS exceptions are what we hunt.-const IGNORE = [- /Failed to load resource/i,- /the server responded with a status/i,- /net::ERR/i,- /401|403|404|429|500|502|503/,- /favicon|apple-touch|og-image|\.png|\.svg|\.webmanifest/i,- /Download the React|Lighthouse/i,- /agent-3d|element\.js|GLB|gltf|three\b/i, // 3D body is an enhancement, not in scope-];-const ignored = (t) => IGNORE.some((re) => re.test(t));--const browser = await puppeteer.launch({ args: ['--no-sandbox'], headless: 'new' });-let hardFail = 0;--for (const p of PAGES) {- const page = await browser.newPage();- const errors = [];- page.on('console', (m) => { if (m.type() === 'error' && !ignored(m.text())) errors.push(`console: ${m.text()}`); });- page.on('pageerror', (e) => { if (!ignored(String(e))) errors.push(`pageerror: ${e.message || e}`); });- for (const motion of ['no-preference', 'reduce']) {- await page.emulateMediaFeatures([{ name: 'prefers-reduced-motion', value: motion }]);- await page.goto(p.url, { waitUntil: 'domcontentloaded' });- await new Promise((r) => setTimeout(r, p.waitMs));- }- // Report a few signals of the juice actually mounting against real data.- const probe = await page.evaluate(() => ({- juiceEnter: document.querySelectorAll('.juice-enter').length,- live: document.querySelector('.juice-live')?.dataset.state || null,- spark: document.querySelectorAll('.juice-spark').length,- thoughts: document.querySelectorAll('.agi-thought').length,- launches: document.querySelectorAll('.ac-launch').length,- entries: document.querySelectorAll('.rl-entry').length,- ring: document.querySelectorAll('.agi-ring-val, .rl-score-arc').length,- bodyLen: document.body.innerText.trim().length,- }));- console.log(`\n=== ${p.name} ===`);- console.log('probe:', JSON.stringify(probe));- if (errors.length) { hardFail++; console.log('ERRORS:'); errors.slice(0, 8).forEach((e) => console.log(' -', e)); }- else console.log('no JS errors');- await page.close();-}--await browser.close();-console.log(`\n${hardFail ? 'FAIL' : 'PASS'}: ${hardFail} page(s) with JS errors`);-process.exit(hardFail ? 1 : 0);diff --git a/pages/signals.html b/pages/signals.htmlindex 441649462..79bbcc6fa 100644--- a/pages/signals.html+++ b/pages/signals.html@@ -29,6 +29,7 @@<link rel="manifest" href="/site.webmanifest" /><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/signals.css" /><link rel="stylesheet" href="/footer.css" /><link rel="canonical" href="https://three.ws/signals" />@@ -45,7 +46,7 @@<main class="sm-shell" aria-labelledby="sm-title"><section class="sm-hero"><p class="sm-kicker">- <span class="sm-live-dot" aria-hidden="true"></span>+ <span id="sm-live" class="juice-live" data-state="connecting"><span class="juice-live-dot" aria-hidden="true"></span><span class="juice-live-txt">connecting</span></span>Reputation-gated · x402-metered · accountable on-chain</p><h1 id="sm-title" class="sm-title">Signal Marketplace</h1>diff --git a/scripts/extract-package.sh b/scripts/extract-package.shindex 32603d583..54d494c76 100755--- a/scripts/extract-package.sh+++ b/scripts/extract-package.sh@@ -63,6 +63,32 @@ OWNER="$OWNER" REPO_NAME="$REPO_NAME" node -e 'echo "==> [4/5] add npm publish CI workflow"mkdir -p .github/workflows+# A VS Code extension publishes to the Marketplace (vsce) + Open VSX, not npm.+IS_VSCODE="$(node -p 'require("./package.json").engines?.vscode ? "1" : ""' 2>/dev/null)"+if [ -n "$IS_VSCODE" ]; then+cat > .github/workflows/publish.yml <<'YML'+name: publish+on:+ push:+ tags: ['v*']+jobs:+ publish:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with: { node-version: 20 }+ - run: npm ci || npm install+ - run: npm run build --if-present+ - run: npx --yes @vscode/vsce publish -p "$VSCE_PAT"+ env:+ VSCE_PAT: ${{ secrets.VSCE_PAT }}+ - run: npx --yes ovsx publish -p "$OVSX_PAT"+ env:+ OVSX_PAT: ${{ secrets.OVSX_PAT }}+ continue-on-error: true+YML+elsecat > .github/workflows/publish.yml <<'YML'name: publishon:@@ -86,6 +112,7 @@ jobs:env:NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}YML+fi[ -f .gitignore ] || printf 'node_modules\ndist\n*.log\n.DS_Store\n' > .gitignoregit add -A@@ -93,14 +120,21 @@ echo "==> [5/5] verify publishable (install, build, test, dry-run pack)"npm install --no-audit --no-fund >/dev/null 2>&1 || { echo "npm install failed"; exit 1; }npm run build --if-presentnpm test --if-present || { echo "tests failed"; exit 1; }-echo "--- npm publish --dry-run ---"-DRY="$(npm publish --dry-run --access public 2>&1 || true)"-echo "$DRY" | tail -20-if echo "$DRY" | grep -q "cannot publish over"; then- echo "NOTE: version already on npm — bump 'version' before the real publish (expected for a migration of an already-published package)."-elif echo "$DRY" | grep -qiE "npm error|ERR!"; then- echo "ERROR: publish dry-run reported a real problem above." >&2- exit 1+if [ -n "$IS_VSCODE" ]; then+ echo "--- vsce package (VS Code extension — Marketplace target, not npm) ---"+ npx --yes @vscode/vsce package --no-dependencies -o "/tmp/$REPO_NAME.vsix" 2>&1 | tail -8 \+ && echo "VSIX OK: publish with 'vsce publish' (Marketplace) + 'ovsx publish' (Open VSX), not npm." \+ || echo "NOTE: vsce package needs review (Marketplace target)."+else+ echo "--- npm publish --dry-run ---"+ DRY="$(npm publish --dry-run --access public 2>&1 || true)"+ echo "$DRY" | tail -20+ if echo "$DRY" | grep -q "cannot publish over"; then+ echo "NOTE: version already on npm — bump 'version' before the real publish (expected for a migration of an already-published package)."+ elif echo "$DRY" | grep -qiE "npm error|ERR!"; then+ echo "ERROR: publish dry-run reported a real problem above." >&2+ exit 1+ fifigit -c user.email="[email protected]" -c user.name="three.ws" commit -q -m "chore: standalone repo scaffolding (CI, repository metadata)" || truediff --git a/src/character.js b/src/character.jsindex c08e4eceb..b56f8b24d 100644--- a/src/character.js+++ b/src/character.js@@ -9,6 +9,8 @@import { onchainBadgeEl } from './shared/onchain-badge.js';import { walletChipEl } from './shared/agent-wallet-chip.js';import { hydrateAvatarWallet } from './shared/wallet-aura.js';+import './ui-juice.css';+import { countUp } from './ui-juice.js';let chNetWorthAura = null;@@ -130,10 +132,10 @@ function renderHero(agent) {handle.textContent = '@' + (authorName.toLowerCase().replace(/\s+/g, ''));creatorEl.appendChild(handle);- // Stats- $('ch-stat-chats').textContent = formatNum(agent.chat_count ?? 0);+ // Stats — count up from 0 to the real values, keeping the K/M formatting.+ countUp($('ch-stat-chats'), 0, Number(agent.chat_count ?? 0), { format: formatNum });const holders = agent.token?.holders ?? agent.meta?.token?.holders ?? 0;- $('ch-stat-holders').textContent = formatNum(holders);+ countUp($('ch-stat-holders'), 0, Number(holders), { format: formatNum });// Description$('ch-desc').textContent = agent.description || '';diff --git a/src/launch-copilot.css b/src/launch-copilot.cssindex ad004952a..dcd0f7dd7 100644--- a/src/launch-copilot.css+++ b/src/launch-copilot.css@@ -1,7 +1,9 @@/* Launch Copilot — autonomous market-maker control panel.Scoped under .lc; uses the shared design tokens (public/tokens.css). */+@import './ui-juice.css';.lc { display: block; width: 100%; }+.lc-log-live { display: inline-flex; align-items: center; }.lc-card {background: linear-gradient(165deg, var(--surface-2), transparent 60%), var(--surface-1);diff --git a/src/launch-copilot.js b/src/launch-copilot.jsindex 1f7416059..212396486 100644--- a/src/launch-copilot.js+++ b/src/launch-copilot.js@@ -163,6 +163,9 @@ export function mountLaunchCopilot(host, opts = {}) {state.editing = false;if (body.data?.withdraw_url && action === 'withdraw') window.location.href = body.data.withdraw_url;await load();+ // Configuring the maker (action === null) is the "it shipped" moment — one+ // restrained ripple on the freshly-rendered panel marks the maker going live.+ if (!action) rippleOnce(host.firstElementChild);return body.data;} catch (e) {state.busy = false;@@ -482,7 +485,7 @@ export function mountLaunchCopilot(host, opts = {}) {const wrap = el('div', { class: 'lc-log', id: 'lc-log' });wrap.appendChild(el('div', { class: 'lc-log__head' }, [el('span', { class: 'lc-label', text: 'Live action log' }),- el('span', { class: 'lc-live', 'aria-hidden': 'true' }, [el('span', { class: 'lc-live__dot' }), 'live']),+ el('span', { class: 'lc-log-live', id: 'lc-log-live', html: liveDot(state.es ? 'live' : 'connecting') }),]));wrap.appendChild(buildActionList());return wrap;diff --git a/src/signals.js b/src/signals.jsindex 7cb05115a..c943ead96 100644--- a/src/signals.js+++ b/src/signals.js@@ -8,6 +8,7 @@*/import { escapeHtml, fmtPct, compact, identicon } from './trader-format.js';+import { updateValue, flipReorder, setLiveDot } from './ui-juice.js';const API = '/api/signals/marketplace';const SORTS = new Set(['edge', 'roi', 'hitrate', 'subscribers', 'newest']);@@ -101,7 +102,7 @@ function card(f) {? `<span class="sm-thin" title="Fewer than 10 closed signals — edge is regressed toward neutral until proven">Building track record</span>`: '';return `- <a class="sm-card" href="/signals/${encodeURIComponent(f.slug)}" aria-label="${escapeHtml(f.title)} by ${escapeHtml(f.publisher.name)} — edge ${f.edge_score}">+ <a class="sm-card" href="/signals/${encodeURIComponent(f.slug)}" data-key="${escapeHtml(String(f.slug))}" aria-label="${escapeHtml(f.title)} by ${escapeHtml(f.publisher.name)} — edge ${f.edge_score}"><span class="sm-rank">#${f.rank}</span><div class="sm-card-head">${avatar}@@ -136,14 +137,22 @@ function emptyState() {</div>`;}+// Count a summary tile from its previously-shown real value to the new one and+// flash the direction of change; missing → static dash with the tracker cleared.+function setSummaryNum(el, value, format) {+ if (!el) return;+ if (value == null || !Number.isFinite(value)) { el.textContent = '—'; delete el.dataset.juiceVal; return; }+ updateValue(el, value, format);+}+function renderSummary(feeds) {const verified = feeds.filter((f) => f.publisher.verified).length;const closed = feeds.reduce((a, f) => a + (f.stats.closed_signals || 0), 0);const topEdge = feeds.reduce((a, f) => Math.max(a, f.edge_score || 0), 0);- $('#sm-sum-feeds').textContent = compact(feeds.length);- $('#sm-sum-verified').textContent = compact(verified);- $('#sm-sum-closed').textContent = compact(closed);- $('#sm-sum-edge').textContent = feeds.length ? String(topEdge) : '—';+ setSummaryNum($('#sm-sum-feeds'), feeds.length, compact);+ setSummaryNum($('#sm-sum-verified'), verified, compact);+ setSummaryNum($('#sm-sum-closed'), closed, compact);+ setSummaryNum($('#sm-sum-edge'), feeds.length ? topEdge : null, (n) => String(Math.round(n)));}async function load() {@@ -157,16 +166,28 @@ async function load() {setStatus(null);renderSummary(feeds);if (!feeds.length) emptyState();- else grid.innerHTML = feeds.map(card).join('');+ else {+ // First paint lets cards stagger in; refreshes/re-sorts FLIP cards to+ // their new rank instead of re-flashing the whole grid (the --reflow+ // class suppresses the per-card entrance while ranks settle).+ const flip = firstLoad ? null : flipReorder(grid, (el) => el.dataset.key || '');+ flip?.capture();+ grid.classList.toggle('sm-grid--reflow', !firstLoad);+ grid.innerHTML = feeds.map(card).join('');+ flip?.play();+ }grid.setAttribute('aria-busy', 'false');firstLoad = false;+ setLiveDot($('#sm-live'), 'live', 'live');} catch (err) {if (firstLoad) {grid.innerHTML = '';grid.setAttribute('aria-busy', 'false');setStatus('Could not load the marketplace. Check your connection and try again.', { error: true, retry: true });+ setLiveDot($('#sm-live'), 'error', 'offline');} else {setStatus('Reconnecting — showing the last known board.', { error: false });+ setLiveDot($('#sm-live'), 'connecting', 'reconnecting');}}}diff --git a/src/theater.js b/src/theater.jsindex bebd23c40..4f0967553 100644--- a/src/theater.js+++ b/src/theater.js@@ -17,6 +17,8 @@ import { createStage } from './theater-stage.js';import { connectFeed, loadSnapshot } from './theater-feed.js';import { fetchWalletBalances } from './shared/agent-wallet-identity.js';import { log } from './shared/log.js';+import './ui-juice.css';+import { enterRow } from './ui-juice.js';const THREE_MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';const WATCH_KEY = 'theater:watch:v1';@@ -306,6 +308,7 @@ export function initTheater(root) {el('time', { class: 'th-tick-time', text: timeAgo(n.ts), datetime: new Date(n.ts).toISOString() }),]);refs.ticker.prepend(row);+ enterRow(row); // slide the freshly-landed live event in (reduced-motion safe)while (refs.ticker.children.length > 40) refs.ticker.lastElementChild.remove();// a real event arrived → dismiss the quiet stateif (!refs.quiet.hidden) refs.quiet.hidden = true;diff --git a/src/user-launcher.js b/src/user-launcher.jsindex e671283dc..ea9bf0f92 100644--- a/src/user-launcher.js+++ b/src/user-launcher.js@@ -5,6 +5,8 @@// "On" simply lets the cron pick coins from your agents and record them. All// API-sourced strings are escaped before they touch the DOM.+import { updateValue, enterRow } from './ui-juice.js';+const API = '/api/launcher/me';const REFRESH_MS = 6000;