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: remove VSCode telemetry settings
udvkb56cefe58ee8
diff --git a/.vscode/settings.json b/.vscode/settings.jsondeleted file mode 100644index 4f2c38a24..000000000--- a/.vscode/settings.json+++ /dev/null@@ -1,4 +0,0 @@-{- "telemetry.feedback.enabled": false,- "telemetry.editStats.enabled": false-}\ No newline at end of filediff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8c4bc3c9d..564d0af05 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -15,6 +15,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Living Worlds video generator is back online** — The Cosmos text-to-world lane — describe a scene and get a short cinematic video that plays as a living backdrop behind your avatar — had stopped generating: NVIDIA moved the hosted Cosmos model to a new address, so every request came back as an error. We've pointed the lane at the new endpoint and it generates worlds again. (`/cosmos`) `[fix]`- **Mission Control's live launch feed never goes dark** — The terminal's Live feed streams brand-new pump.fun launches over a real-time socket — but when that upstream socket goes quiet, the firehose pane could sit empty with nothing to trade. The feed now has a live safety net: it also reads pump.fun's newest launches directly and fills the pane the instant you open the terminal, then keeps backfilling behind the socket so a momentary upstream hiccup never blanks the board. Real launches throughout, de-duplicated so a coin never shows twice — whichever source sees it first wins. (`/terminal`) `[fix, improvement]`- **Steadier live feeds under load** — The real-time money feeds that power the Galaxy money-cam and Money Pulse are now more resilient when our cache layer is under pressure. The platform cache can run on its own dedicated store, separate from the rate limiter, so a busy moment no longer slows feed responses or spends the limiter's budget — and even when the cache is degraded, feeds fall back instantly instead of waiting. You'll see the live maps stay smooth during traffic spikes. `[infra, improvement]`+- **The gallery now seeds itself with studio-quality, fully-rigged Avaturn avatars** — A new background generator quietly grows the public gallery with photorealistic, animation-ready Avaturn avatars — each one a fresh randomized character (body, outfit, hair, and colors) built from Avaturn's own catalog and exported with a complete rig, so it walks and emotes out of the box. They land under brand-new single-word creator accounts just like our other seeded creations. The cadence starts conservative and ramps up over time. `[feature, improvement]`- **The post-create screen now greets you with a living agent** — After you create an avatar or agent, the 'what's next' screen no longer shows your character frozen in a stiff T-pose. It now renders a live, gently breathing 3D agent you can spin with a drag — the same idle motion your embeds use — so the moment your agent is ready actually feels ready. A one-time confetti burst celebrates the milestone (and stays out of the way if you prefer reduced motion). For agents, the embed snippet is right there to copy without leaving the page, plus one-tap buttons to copy your agent's public link or share it on X. The steps you've already done — giving your agent a brain, deploying it on-chain — now show a checkmark, and an 'I'll do this later' link makes the exit obvious. `[feature, improvement]`- **The trader leaderboard is never empty: live top Solana traders until agents take over** — The leaderboard ranks three.ws agents by a provable, on-chain track record — but until an agent has actually traded in a window, the board had nothing to show. Now, whenever no agent yet has a verified record, the flagship board falls back to the live ranking of the top Solana traders by realized profit (real wallets, real P&L, sourced live from kolscan), each row deep-linked to its on-chain account. The moment an agent earns a record it takes precedence again. Real data throughout — if the live feed is briefly unreachable, the board shows an honest 'be the first' state, never fabricated rows. (`/leaderboard`) `[feature, improvement]`- **Trading Swarms: pool capital with other agents and split the profits** — A new way to trade together. Create a swarm and a dedicated treasury wallet is provisioned on-chain; you and other agents fund it with real SOL. The swarm only buys a coin when enough of its members' verified track records already agree on it — a reputation-weighted consensus, not one agent's hunch — and every trade still passes the same safety firewall and spend limits as a solo snipe. When a position closes in profit, the gain is paid back to every member pro-rata by their share, on-chain and fully auditable, minus an optional creator fee. You can see the live vote on every decision, the treasury balance, each member's share, and the full payout ledger. Exit and redeem your share any time, no single member can capture the treasury, and any qualifying member can hit the kill switch. Find it under Discover → Trading Swarms. (`/swarms`) `[feature]`diff --git a/api/_lib/avaturn-headless.js b/api/_lib/avaturn-headless.jsnew file mode 100644index 000000000..e9545f449--- /dev/null+++ b/api/_lib/avaturn-headless.js@@ -0,0 +1,125 @@+// @ts-check+// Headless driver for the avaturn-seed cron.+// --------------------------------------------+// Avaturn has no server-side "export a GLB" REST endpoint — the export only+// happens inside the editor via the SDK's postMessage protocol. So we boot+// headless chromium, load our /internal/avaturn-forge.html harness pointed at a+// fresh catalog session, let the SDK randomize a body + assets + colors and call+// exportAvatar(), then pull the resulting GLB bytes into Node.+//+// Mirrors the lazy-chromium pattern in render-glb.js so Vercel's NFT trace+// doesn't statically pull the chromium tree into unrelated routes.++import { env } from './env.js';+import { fetchModel } from './fetch-model.js';++const DEFAULT_MAX_GLB_BYTES = 30 * 1024 * 1024;++// Keep in lockstep with @sparticuz/chromium-min in package.json (see render-glb.js).+const DEFAULT_CHROMIUM_PACK =+ 'https://github.com/Sparticuz/chromium/releases/download/v148.0.0/chromium-v148.0.0-pack.x64.tar';+const CHROMIUM_PACK = env.CHROMIUM_PACK_URL || DEFAULT_CHROMIUM_PACK;++let _browserPromise = null;+async function getBrowser() {+ if (_browserPromise) return _browserPromise;+ _browserPromise = (async () => {+ const [{ default: puppeteer }, { default: chromium }] = await Promise.all([+ import('puppeteer-core'),+ import('@sparticuz/chromium-min'),+ ]);+ const executablePath = await chromium.executablePath(CHROMIUM_PACK);+ return puppeteer.launch({+ // The Avaturn editor renders + exports through WebGL; @sparticuz/chromium+ // ships swiftshader so WebGL works headless. Use its default arg set.+ args: chromium.args,+ defaultViewport: { width: 900, height: 1200, deviceScaleFactor: 1 },+ executablePath,+ headless: chromium.headless,+ });+ })().catch((err) => {+ _browserPromise = null;+ throw err;+ });+ return _browserPromise;+}++/**+ * Pull the exported avatar's GLB bytes. Avaturn's `export_type: 'url'` resolves+ * to an https asset URL; we still pull it through the SSRF-pinned fetcher. A+ * data: URL (older export modes) is decoded inline.+ *+ * @param {string} exportUrl+ * @param {number} maxBytes+ * @returns {Promise<Buffer>}+ */+async function pullGlb(exportUrl, maxBytes) {+ if (exportUrl.startsWith('data:')) {+ const comma = exportUrl.indexOf(',');+ const meta = exportUrl.slice(5, comma);+ const payload = exportUrl.slice(comma + 1);+ const buf = meta.includes(';base64')+ ? Buffer.from(payload, 'base64')+ : Buffer.from(decodeURIComponent(payload));+ if (buf.length > maxBytes) throw new Error(`exported glb too large: ${buf.length} bytes`);+ return buf;+ }+ const { bytes } = await fetchModel(exportUrl, { maxBytes });+ return Buffer.from(bytes);+}++/**+ * Drive one full headless Avaturn export.+ *+ * @param {{+ * sessionUrl: string,+ * seed: string,+ * bodyType?: 'male'|'female',+ * timeoutMs?: number,+ * maxBytes?: number,+ * }} opts+ * @returns {Promise<{ glbBytes: Buffer, exportUrl: string, look: any }>}+ */+export async function exportRandomAvaturnAvatar({+ sessionUrl,+ seed,+ bodyType = 'male',+ timeoutMs = 110_000,+ maxBytes = DEFAULT_MAX_GLB_BYTES,+}) {+ if (!sessionUrl) throw Object.assign(new Error('sessionUrl required'), { code: 'invalid_args' });++ const harness = new URL('/internal/avaturn-forge.html', env.APP_ORIGIN);+ harness.searchParams.set('session', sessionUrl);+ harness.searchParams.set('seed', String(seed));+ harness.searchParams.set('bodyType', bodyType);++ const browser = await getBrowser();+ const page = await browser.newPage();+ try {+ await page.goto(harness.toString(), { waitUntil: 'domcontentloaded', timeout: 30_000 });+ await page.waitForFunction('window.__avaturnDone === true', { timeout: timeoutMs, polling: 1000 });++ const { error, result } = await page.evaluate(() => ({+ error: window.__avaturnError,+ result: window.__avaturnResult,+ }));+ if (error) {+ throw Object.assign(new Error(`avaturn export failed: ${error}`), { code: 'export_failed' });+ }+ const exportUrl = result?.url;+ if (!exportUrl) {+ throw Object.assign(new Error('avaturn export produced no url'), { code: 'export_failed' });+ }++ const glbBytes = await pullGlb(exportUrl, maxBytes);+ return { glbBytes, exportUrl, look: result?.look ?? null };+ } finally {+ await page.close().catch(() => {});+ }+}++// Test seam — bypass the real launcher without monkey-patching the module path.+export function __setBrowserForTests(browser) {+ _browserPromise = browser ? Promise.resolve(browser) : null;+}diff --git a/api/cron/avaturn-seed-cron.js b/api/cron/avaturn-seed-cron.jsnew file mode 100644index 000000000..ca51e7c55--- /dev/null+++ b/api/cron/avaturn-seed-cron.js@@ -0,0 +1,177 @@+// @ts-check+// GET /api/cron/avaturn-seed-cron — per-minute cron that grows the public+// gallery with randomized, fully-rigged **Avaturn** avatars.+//+// Unlike the forge seeder (text→image→mesh, returns a GLB inline from a server+// API), Avaturn has no headless export endpoint — the GLB only comes out of the+// editor via the SDK's postMessage protocol. So each tick:+//+// 1. Claims an OG single-word username for a fresh synthetic account.+// 2. Opens a no-photo Avaturn *catalog* session for that account.+// 3. Boots headless chromium, lets the SDK randomize a body + assets + colors+// from the account's own catalog, and exports a rigged GLB.+// 4. Stores the GLB in R2 and inserts a public avatar row (source=avaturn).+//+// One avatar per tick — the headless export runs to completion inside the+// invocation (no poll table needed). A Redis blocking slot stops a slow export+// on one instance from overlapping the next minute's tick. A circuit breaker+// goes quiet during Avaturn outages so the cron doesn't burn quota into a dead+// lane. Gated behind AVATURN_SEED_ENABLED so it's a no-op until an operator+// opts in (cadence is set by the cron schedule in vercel.json — start at 1/min).++import { json, method, wrap } from '../_lib/http.js';+import { env } from '../_lib/env.js';+import { sql } from '../_lib/db.js';+import { constantTimeEquals } from '../_lib/crypto.js';+import { OG_USERNAMES } from '../_lib/seed-prompts.js';+import {+ circuitState,+ circuitRecordFailure,+ circuitRecordSuccess,+ acquireBlockingSlot,+} from '../_lib/forge-scale.js';+import { createCatalogSession } from '../_lib/avaturn.js';+import { exportRandomAvaturnAvatar } from '../_lib/avaturn-headless.js';+import { putObject } from '../_lib/r2.js';+import { pickBodyType } from '../_lib/avaturn-seed.js';+import { randomUUID } from 'node:crypto';++const CIRCUIT_NAME = 'avaturn-seed';+const CIRCUIT_THRESHOLD = 3;+const CIRCUIT_BASE_MS = 10 * 60_000; // 10 min × consecutive failures+// One headless export at a time across all instances. TTL is just under the+// function's maxDuration (300 s) so a crashed run's lease self-heals next tick.+const SLOT_TTL_MS = 280_000;++function requireCron(req, res) {+ const secret = process.env.CRON_SECRET || env.CRON_SECRET;+ if (!secret) {+ res.status(503).json({ error: 'not_configured', message: 'CRON_SECRET unset' });+ return false;+ }+ const auth = req.headers['authorization'] || '';+ const presented = auth.startsWith('Bearer ') ? auth.slice(7) : '';+ if (!constantTimeEquals(presented, secret)) {+ res.status(401).json({ error: 'unauthorized' });+ return false;+ }+ return true;+}++// Try to claim `word` as a username, skipping to the next free numbered slot.+// Returns the claimed username or null. (Mirrors the forge seeder's helper.)+async function claimUsername(word) {+ const existing = await sql`+ select username from users where username = ${word} or username like ${word + '%'} limit 100+ `;+ const taken = new Set(existing.map((r) => r.username));+ if (!taken.has(word)) return word;+ for (let n = 2; n <= 99; n++) {+ const candidate = `${word}${n}`;+ if (!taken.has(candidate)) return candidate;+ }+ return `${word}_${randomUUID().slice(0, 4)}`;+}++function toSlug(name) {+ const base = String(name)+ .toLowerCase()+ .replace(/[^a-z0-9]+/g, '-')+ .replace(/^-+|-+$/g, '')+ .slice(0, 48);+ return `${base || 'avatar'}-${randomUUID().slice(0, 6)}`;+}++async function runOnce() {+ const circuit = await circuitState(CIRCUIT_NAME);+ if (circuit.open) {+ const minsLeft = Math.ceil((circuit.openUntil - Date.now()) / 60_000);+ return { skipped: true, reason: `circuit open for ${minsLeft}m more (${circuit.failures} failures)` };+ }++ const baseWord = OG_USERNAMES[Math.floor(Math.random() * OG_USERNAMES.length)];+ const username = await claimUsername(baseWord);+ if (!username) return { skipped: true, reason: 'could not claim OG username — retry next tick' };++ const displayName = username.replace(/\d+$/, '').replace(/\b\w/g, (c) => c.toUpperCase());+ const email = `${username}@avaturn.three.ws`;++ const [user] = await sql`+ insert into users (email, display_name, username, plan, email_verified, created_at, updated_at)+ values (${email}, ${displayName}, ${username}, 'free', false, now(), now())+ on conflict do nothing+ returning id+ `;+ if (!user?.id) return { skipped: true, reason: 'user insert conflict — retry next tick' };++ const seed = randomUUID();+ const bodyType = pickBodyType(seed);++ try {+ const session = await createCatalogSession({ externalUserId: user.id, bodyType });+ const { glbBytes, exportUrl, look } = await exportRandomAvaturnAvatar({+ sessionUrl: session.sessionUrl,+ seed,+ bodyType,+ });++ const slug = toSlug(displayName);+ const storageKey = `u/${user.id}/${slug}.glb`;+ await putObject({+ key: storageKey,+ body: glbBytes,+ contentType: 'model/gltf-binary',+ metadata: { source: 'avaturn-seed' },+ });++ await sql`+ insert into avatars+ (owner_id, slug, name, description, storage_key, size_bytes,+ content_type, source, source_meta, visibility, tags,+ model_category, created_at, updated_at)+ values (+ ${user.id}, ${slug}, ${displayName},+ ${'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,+ 'public',+ array['avatar', 'avaturn']::text[],+ 'avatar', now(), now()+ )+ on conflict do nothing+ `;++ await circuitRecordSuccess(CIRCUIT_NAME);+ return { ok: true, username, user_id: user.id, slug, size_bytes: glbBytes.length, body_type: bodyType };+ } catch (err) {+ await circuitRecordFailure(CIRCUIT_NAME, { threshold: CIRCUIT_THRESHOLD, baseMs: CIRCUIT_BASE_MS });+ // Roll back the synthetic account so the next tick starts clean.+ await sql`delete from users where id = ${user.id}`.catch(() => {});+ return { ok: false, reason: `${err?.code || 'error'}: ${err?.message || err}` };+ }+}++export default wrap(async (req, res) => {+ if (!method(req, res, ['GET'])) return;+ if (!requireCron(req, res)) return;++ if (!env.AVATURN_SEED_ENABLED) {+ return json(res, 200, { ok: true, skipped: 'disabled', hint: 'set AVATURN_SEED_ENABLED=1 to enable' });+ }+ if (!env.AVATURN_API_KEY) {+ return json(res, 200, { ok: true, skipped: 'not_configured', hint: 'AVATURN_API_KEY unset' });+ }++ // Single headless export in flight at a time, fleet-wide.+ const slot = await acquireBlockingSlot(CIRCUIT_NAME, { max: 1, ttlMs: SLOT_TTL_MS });+ if (!slot.ok) {+ return json(res, 200, { ok: true, skipped: 'in_flight', reason: 'a prior export is still running' });+ }+ try {+ const result = await runOnce();+ return json(res, 200, { ok: true, result });+ } finally {+ await slot.release();+ }+});diff --git a/data/changelog.json b/data/changelog.jsonindex e3300cda4..4cb86cddd 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,12 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-06-26",+ "title": "The gallery now seeds itself with studio-quality, fully-rigged Avaturn avatars",+ "summary": "A new background generator quietly grows the public gallery with photorealistic, animation-ready Avaturn avatars — each one a fresh randomized character (body, outfit, hair, and colors) built from Avaturn's own catalog and exported with a complete rig, so it walks and emotes out of the box. They land under brand-new single-word creator accounts just like our other seeded creations. The cadence starts conservative and ramps up over time.",+ "tags": ["feature", "improvement"]+ },{"date": "2026-06-26","title": "Fixed: the Animation Gallery footer no longer covers the page",diff --git a/pages/marketplace.html b/pages/marketplace.htmlindex 2f08e1d97..bd87f93cf 100644--- a/pages/marketplace.html+++ b/pages/marketplace.html@@ -2130,6 +2130,135 @@.market-anim-grid {grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));}++ /* Live sales pulse — a marquee of the most recent skill purchases across+ the marketplace. The track is duplicated in JS so the loop is seamless. */+ .market-pulse {+ display: flex;+ align-items: center;+ gap: 14px;+ margin: 4px 0 18px;+ padding: 9px 14px;+ border: 1px solid var(--stroke);+ border-radius: 12px;+ background:+ linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 22%),+ var(--surface-1);+ overflow: hidden;+ }+ .market-pulse-label {+ display: inline-flex;+ align-items: center;+ gap: 7px;+ flex: 0 0 auto;+ font-size: 11px;+ font-weight: 600;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: var(--text-2, #9aa);+ white-space: nowrap;+ }+ .market-pulse-dot {+ width: 7px;+ height: 7px;+ border-radius: 50%;+ background: var(--accent, #34d399);+ box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent);+ animation: market-pulse-blink 2s ease-out infinite;+ }+ @keyframes market-pulse-blink {+ 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }+ 70% { box-shadow: 0 0 0 6px transparent; }+ 100% { box-shadow: 0 0 0 0 transparent; }+ }+ .market-pulse-viewport {+ position: relative;+ flex: 1 1 auto;+ overflow: hidden;+ -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);+ mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);+ }+ .market-pulse-track {+ display: inline-flex;+ align-items: center;+ gap: 10px;+ white-space: nowrap;+ will-change: transform;+ animation: market-pulse-scroll var(--pulse-duration, 40s) linear infinite;+ }+ .market-pulse:hover .market-pulse-track,+ .market-pulse-track:focus-within {+ animation-play-state: paused;+ }+ @keyframes market-pulse-scroll {+ from { transform: translateX(0); }+ to { transform: translateX(-50%); }+ }+ .market-pulse-item {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ flex: 0 0 auto;+ padding: 5px 11px 5px 6px;+ border: 1px solid var(--stroke);+ border-radius: 999px;+ background: var(--surface-2, rgba(255, 255, 255, 0.03));+ color: var(--text-1, #e6e6e6);+ font-size: 12.5px;+ text-decoration: none;+ transition: border-color 0.15s ease, transform 0.15s ease;+ }+ .market-pulse-item:hover {+ border-color: color-mix(in srgb, var(--accent) 55%, var(--stroke));+ transform: translateY(-1px);+ }+ .market-pulse-item:focus-visible {+ outline: 2px solid var(--accent, #34d399);+ outline-offset: 2px;+ }+ .market-pulse-av {+ width: 22px;+ height: 22px;+ border-radius: 50%;+ object-fit: cover;+ flex: 0 0 auto;+ background: var(--surface-3, #222);+ display: inline-flex;+ align-items: center;+ justify-content: center;+ font-size: 11px;+ font-weight: 700;+ color: var(--accent, #34d399);+ }+ .market-pulse-item b {+ font-weight: 600;+ }+ .market-pulse-skill {+ color: var(--text-2, #9aa);+ }+ .market-pulse-amt {+ font-variant-numeric: tabular-nums;+ font-weight: 600;+ color: var(--accent, #34d399);+ }+ .market-pulse-amt.is-trial {+ color: var(--text-2, #9aa);+ }+ .market-pulse-time {+ color: var(--text-3, #677);+ font-size: 11px;+ }+ @media (prefers-reduced-motion: reduce) {+ .market-pulse-track {+ animation: none;+ overflow-x: auto;+ scrollbar-width: none;+ }+ .market-pulse-track::-webkit-scrollbar { display: none; }+ }+ @media (max-width: 640px) {+ .market-pulse-label span:not(.market-pulse-dot) { display: none; }+ }.market-anim-card {background: var(--surface-1);border: 1px solid var(--stroke);diff --git a/public/changelog.json b/public/changelog.jsonindex 707717c58..c20430353 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-26T04:50:26.091Z",+ "generated_at": "2026-06-26T05:40:42.816Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -102,6 +102,17 @@"improvement"]},+ {+ "date": "2026-06-26",+ "type": "update",+ "title": "The gallery now seeds itself with studio-quality, fully-rigged Avaturn avatars",+ "summary": "A new background generator quietly grows the public gallery with photorealistic, animation-ready Avaturn avatars — each one a fresh randomized character (body, outfit, hair, and colors) built from Avaturn's own catalog and exported with a complete rig, so it walks and emotes out of the box. They land under brand-new single-word creator accounts just like our other seeded creations. The cadence starts conservative and ramps up over time.",+ "link": null,+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-06-26","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 512aa43ad..e8359afa2 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -78,6 +78,14 @@<category>infra</category><description>The real-time money feeds that power the Galaxy money-cam and Money Pulse are now more resilient when our cache layer is under pressure. The platform cache can run on its own dedicated store, separate from the rate limiter, so a busy moment no longer slows feed responses or spends the limiter's budget — and even when the cache is degraded, feeds fall back instantly instead of waiting. You'll see the live maps stay smooth during traffic spikes.</description></item>+ <item>+ <title>The gallery now seeds itself with studio-quality, fully-rigged Avaturn avatars</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-26:The gallery now seeds itself with studio-quality, fully-rigged Avaturn avatars</guid>+ <pubDate>Fri, 26 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A new background generator quietly grows the public gallery with photorealistic, animation-ready Avaturn avatars — each one a fresh randomized character (body, outfit, hair, and colors) built from Avaturn's own catalog and exported with a complete rig, so it walks and emotes out of the box. They land under brand-new single-word creator accounts just like our other seeded creations. The cadence starts conservative and ramps up over time.</description>+ </item><item><title>The post-create screen now greets you with a living agent</title><link>https://three.ws/changelog</link>diff --git a/public/features.json b/public/features.jsonindex d395306a2..1232d08a6 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-26T04:50:26.073Z",+ "generated_at": "2026-06-26T05:40:42.637Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/internal/avaturn-forge.html b/public/internal/avaturn-forge.htmlnew file mode 100644index 000000000..740fa34d3--- /dev/null+++ b/public/internal/avaturn-forge.html@@ -0,0 +1,169 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8" />+<meta name="robots" content="noindex,nofollow" />+<title>three.ws · avaturn forge harness</title>+<style>+ html, body { margin: 0; padding: 0; width: 100vw; height: 100vh; background: #0a0a0a; overflow: hidden; }+ #stage { position: absolute; inset: 0; }+ #stage iframe { width: 100%; height: 100%; border: 0; }+</style>+</head>+<body>+<!--+ Headless harness for the avaturn-seed cron. NOT a user-facing page.++ api/_lib/avaturn-headless.js loads this in headless chromium with a fresh+ Avaturn catalog session URL, lets the official SDK randomize a body + assets+ + colors from the account's own catalog, exports a rigged GLB, and reads the+ result back off window.__avaturnResult. Everything is driven through the+ SDK's disableUi promise API — no human ever sees this.+-->+<div id="stage"></div>+<script type="module">+import { AvaturnSDK } from '/dashboard/avaturn-sdk.js';++// ── result channel (read by puppeteer.waitForFunction) ──────────────────────────+window.__avaturnDone = false;+window.__avaturnError = null;+window.__avaturnResult = null;+window.__avaturnProgress = 'boot';+const fail = (msg) => { window.__avaturnError = String(msg || 'unknown'); window.__avaturnDone = true; };+const step = (s) => { window.__avaturnProgress = s; };++// ── seeded RNG (browser copy of api/_lib/avaturn-seed.js — kept minimal) ────────+function hashSeed(str) {+ let h = 2166136261 >>> 0;+ for (let i = 0; i < str.length; i++) { h ^= str.charCodeAt(i); h = Math.imul(h, 16777619); }+ return h >>> 0;+}+function mulberry32(seed) {+ let a = seed >>> 0;+ return function () {+ a |= 0; a = (a + 0x6d2b79f5) | 0;+ let t = Math.imul(a ^ (a >>> 15), 1 | a);+ t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;+ };+}+const pickOne = (arr, rng) => (Array.isArray(arr) && arr.length ? arr[Math.floor(rng() * arr.length)] : undefined);++const WEARABLE_SLOTS = ['outfit', 'top', 'bottom', 'shoes', 'hair', 'headwear', 'glasses', 'outerwear'];+const SLOT_ALIASES = { clothing: 'outfit', costume: 'outfit', footwear: 'shoes', shoe: 'shoes', hairstyle: 'hair', hat: 'headwear', headgear: 'headwear', eyewear: 'glasses', jacket: 'outerwear', coat: 'outerwear' };+const normalizeSlot = (raw) => { const k = String(raw || '').trim().toLowerCase(); return SLOT_ALIASES[k] || k; };+const HAIR_COLORS = ['#0b0b0b', '#1c1310', '#2a1a0f', '#3b2412', '#4a2f1a', '#5c3a1e', '#6b4423', '#7a5230', '#8d6239', '#a87c4f', '#c69a63', '#d9b380', '#e3c79a', '#9a9a9a', '#d8d8d8'];+const EYE_COLORS = ['brown', 'dark_brown', 'hazel', 'amber', 'green', 'blue', 'gray'];++function pickRandomLook(seed, { bodies, assets, bodyType }) {+ const rng = mulberry32(hashSeed(String(seed)));+ let bodyPool = (bodies || []).filter((b) => b && b.id);+ if (bodyType) {+ const matched = bodyPool.filter((b) => normalizeSlot(b.gender ?? b.body_type) === bodyType);+ if (matched.length) bodyPool = matched;+ }+ const body = pickOne(bodyPool, rng);+ const grouped = {};+ for (const a of assets || []) {+ if (!a || !a.id) continue;+ const slot = normalizeSlot(a.category ?? a.type ?? a.slot);+ if (!WEARABLE_SLOTS.includes(slot)) continue;+ (grouped[slot] ||= []).push(a);+ }+ const assetIds = [];+ for (const slot of WEARABLE_SLOTS) {+ const choice = pickOne(grouped[slot] || [], rng);+ if (choice) assetIds.push(choice.id);+ }+ return {+ bodyId: body?.id ?? null,+ assetIds,+ hairColor: pickOne(HAIR_COLORS, rng) ?? HAIR_COLORS[0],+ eyeColor: pickOne(EYE_COLORS, rng) ?? EYE_COLORS[0],+ skinToneCorrection: Math.round((rng() - 0.5) * 30),+ };+}++// ── helpers ─────────────────────────────────────────────────────────────────────+const sleep = (ms) => new Promise((r) => setTimeout(r, ms));+async function quiet(promise) { try { return await promise; } catch { return null; } }++// Poll an async getter until it returns a non-empty array or we run out of tries.+async function waitForList(getter, { tries = 20, gap = 500 } = {}) {+ for (let i = 0; i < tries; i++) {+ const list = await quiet(getter());+ if (Array.isArray(list) && list.length) return list;+ await sleep(gap);+ }+ return [];+}++function extractExportUrl(result) {+ if (!result) return null;+ return result.url || result.glbUrl || result.avatarUrl || result?.data?.url || (typeof result === 'string' ? result : null);+}++// ── main ─────────────────────────────────────────────────────────────────────────+(async () => {+ try {+ const params = new URLSearchParams(location.search);+ const sessionUrl = params.get('session');+ const seed = params.get('seed') || String(hashSeed(sessionUrl || 'fallback'));+ const bodyType = params.get('bodyType') || 'male';+ if (!sessionUrl) return fail('missing session url');++ step('init');+ const sdk = new AvaturnSDK();+ const stage = document.getElementById('stage');++ // disableUi: no editor chrome; drive everything through the promise API.+ const ready = new Promise((resolve) => {+ let settled = false;+ const done = () => { if (!settled) { settled = true; resolve(); } };+ // 'load' is the one callback allowed in disableUi mode.+ try { sdk.on('load', done); } catch { /* fall through to init resolve */ }+ sdk.init(stage, { url: sessionUrl, disableUi: true })+ .then(() => setTimeout(done, 1500)) // safety net if 'load' never fires+ .catch((e) => fail('init failed: ' + (e?.message || e)));+ });+ await ready;+ if (window.__avaturnDone) return;++ step('catalog');+ const [bodies, assets] = await Promise.all([+ waitForList(() => sdk.getBodyList()),+ waitForList(() => sdk.getAssetList()),+ ]);+ if (!bodies.length && !assets.length) return fail('empty catalog (bodies + assets)');++ const look = pickRandomLook(seed, { bodies, assets, bodyType });+ window.__avaturnLook = look;++ step('apply-body');+ if (look.bodyId) await quiet(sdk.setActiveBody(look.bodyId));++ step('apply-assets');+ for (const id of look.assetIds) await quiet(sdk.setActiveAsset(id));++ step('apply-colors');+ await quiet(sdk.setHairColor(look.hairColor));+ await quiet(sdk.setEyeColor(look.eyeColor));+ await quiet(sdk.setSkinToneCorrection(look.skinToneCorrection));++ // Let the editor settle the last asset swap before exporting.+ await sleep(800);++ step('export');+ const result = await sdk.exportAvatar();+ const url = extractExportUrl(result);+ if (!url) return fail('export returned no url');++ window.__avaturnResult = { url, look, raw: result };+ window.__avaturnDone = true;+ } catch (err) {+ fail(err?.message || err);+ }+})();+</script>+</body>+</html>diff --git a/src/marketplace.js b/src/marketplace.jsindex 71ee0c95d..7db66f324 100644--- a/src/marketplace.js+++ b/src/marketplace.js@@ -172,6 +172,8 @@ const els = {catChips: $('market-cat-chips'),modelCatChips: $('market-model-category-chips'),grid: $('market-grid'),+ pulse: $('market-pulse'),+ pulseTrack: $('market-pulse-track'),search: $('market-search'),sortSel: $('market-sort'),loadMore: $('market-loadmore'),@@ -528,6 +530,7 @@ async function loadList(reset = false, opts = {}) {loadPublicAvatars();loadFeatured();loadOnchainAgents(true);+ loadMarketplacePulse();}}@@ -889,6 +892,97 @@ async function loadFeatured() {}}+// ── Live sales pulse ──────────────────────────────────────────────────────+//+// A marquee of the most recent skill purchases across the whole marketplace.+// It's social proof — a visitor lands and immediately sees real money moving+// through real agents. Pulls from /api/marketplace/analytics (the same feed+// behind the analytics page), so there's one source of truth for "what sold".+// The strip is decorative-but-real: it hides cleanly when the market is empty+// or the fetch fails, and only ever appears on the discovery list view.++// USDC/SOL are the mints that actually carry decimals we care about; everything+// else (agent coins, $THREE) defaults to 6, which is the SPL norm. We only need+// enough precision to render a believable amount, not to settle a transaction.+const PULSE_MINT_META = {+ EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: { symbol: 'USDC', decimals: 6 },+ So11111111111111111111111111111111111111112: { symbol: 'SOL', decimals: 9 },+};++function pulseAmountLabel(atomic, mint) {+ const meta = PULSE_MINT_META[mint] || { symbol: shortMintLabel(mint || ''), decimals: 6 };+ const ui = Number(atomic || 0) / Math.pow(10, meta.decimals);+ if (!Number.isFinite(ui) || ui <= 0) return `Free · ${meta.symbol}`;+ const places = ui >= 100 ? 0 : ui >= 1 ? 2 : 4;+ return `${ui.toLocaleString(undefined, { maximumFractionDigits: places })} ${meta.symbol}`;+}++async function loadMarketplacePulse() {+ // Only the discovery list view has the strip; skip the work entirely on+ // detail/skills/etc. and when a search or category is narrowing the grid+ // (the global pulse would feel disconnected from a filtered result set).+ if (!els.pulse || !els.pulseTrack) return;+ if (state.q || state.category) {+ els.pulse.hidden = true;+ return;+ }+ try {+ const r = await fetch(`${API}/marketplace/analytics`, { credentials: 'include' });+ if (!r.ok) throw new Error(`HTTP ${r.status}`);+ const j = await r.json();+ const sales = (j?.data?.recentSales || []).filter((s) => s.agentId && s.agentName);+ renderMarketplacePulse(sales);+ } catch (err) {+ log.error('[marketplace] pulse', err);+ els.pulse.hidden = true;+ }+}++function pulseItemHTML(sale) {+ const skill = String(sale.skill || 'a skill').replace(/[-_]/g, ' ');+ const amount = pulseAmountLabel(sale.amountAtomic, sale.currencyMint);+ const when = liveTime(sale.confirmedAt);+ const avatar = sale.agentImage+ ? `<img class="market-pulse-av" src="${escapeHtml(sale.agentImage)}" alt="" loading="lazy" decoding="async" />`+ : `<span class="market-pulse-av" aria-hidden="true">${escapeHtml(initial(sale.agentName))}</span>`;+ const verb = sale.trial ? 'started a trial of' : 'unlocked';+ const amtClass = sale.trial ? 'market-pulse-amt is-trial' : 'market-pulse-amt';+ return (+ `<a class="market-pulse-item" href="/marketplace/agents/${encodeURIComponent(sale.agentId)}" ` ++ `data-agent="${escapeHtml(sale.agentId)}" ` ++ `title="${escapeHtml(sale.agentName)} — ${escapeHtml(skill)}${when ? ` · ${when}` : ''}">` ++ `${avatar}` ++ `<span><b>${escapeHtml(sale.agentName)}</b> ` ++ `<span class="market-pulse-skill">${escapeHtml(verb)} ${escapeHtml(skill)}</span></span>` ++ `<span class="${amtClass}">${escapeHtml(amount)}</span>` ++ (when ? `<span class="market-pulse-time">${escapeHtml(when)}</span>` : '') ++ `</a>`+ );+}++function renderMarketplacePulse(sales) {+ if (!els.pulse || !els.pulseTrack) return;+ if (!sales.length) {+ els.pulse.hidden = true;+ return;+ }+ const items = sales.map(pulseItemHTML).join('');+ // Duplicate the run so the -50% keyframe translate lands exactly one full+ // set over, giving a seamless infinite loop. aria-hidden the clone so screen+ // readers announce each sale only once. Pace the scroll to the content so a+ // short feed doesn't whip past and a long one doesn't crawl.+ els.pulseTrack.innerHTML = items + `<span aria-hidden="true">${items}</span>`;+ const seconds = Math.min(90, Math.max(24, sales.length * 6));+ els.pulseTrack.style.setProperty('--pulse-duration', `${seconds}s`);+ els.pulse.hidden = false;+ els.pulseTrack.querySelectorAll('.market-pulse-item').forEach((a) => {+ a.addEventListener('click', (e) => {+ e.preventDefault();+ navTo(`/marketplace/agents/${a.dataset.agent}`);+ });+ });+}+function renderHero() {const hero = $('market-hero');if (!hero) return;diff --git a/tests/avaturn-seed.test.js b/tests/avaturn-seed.test.jsnew file mode 100644index 000000000..01532a1e9--- /dev/null+++ b/tests/avaturn-seed.test.js@@ -0,0 +1,186 @@+/**+ * avaturn-seed — unit tests for the pure look-randomization helpers and the+ * catalog-session request shaping. The headless chromium export path is covered+ * by deployment smoke (it needs a live AVATURN_API_KEY + browser), so here we+ * pin the deterministic, I/O-free logic that decides *what* gets exported.+ */++import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';+import {+ hashSeed,+ mulberry32,+ pickOne,+ normalizeSlot,+ groupAssetsBySlot,+ pickRandomLook,+ pickBodyType,+ WEARABLE_SLOTS,+ HAIR_COLORS,+ EYE_COLORS,+} from '../api/_lib/avaturn-seed.js';++const BODIES = [+ { id: 'body-m1', gender: 'male' },+ { id: 'body-m2', gender: 'male' },+ { id: 'body-f1', gender: 'female' },+];++const ASSETS = [+ { id: 'out-1', category: 'outfit' },+ { id: 'out-2', category: 'clothing' }, // alias → outfit+ { id: 'sho-1', category: 'footwear' }, // alias → shoes+ { id: 'hair-1', category: 'hairstyle' }, // alias → hair+ { id: 'hair-2', category: 'hair' },+ { id: 'gls-1', category: 'eyewear' }, // alias → glasses+ { id: 'hat-1', category: 'headwear' },+ { id: 'misc-1', category: 'tattoo' }, // not a wearable slot — ignored+ { id: 'bad' }, // no category, no id-less guard exercised elsewhere+];++describe('seeded RNG', () => {+ it('hashSeed is deterministic and unsigned 32-bit', () => {+ expect(hashSeed('hello')).toBe(hashSeed('hello'));+ expect(hashSeed('hello')).not.toBe(hashSeed('world'));+ expect(hashSeed('x')).toBeGreaterThanOrEqual(0);+ expect(hashSeed('x')).toBeLessThan(2 ** 32);+ });++ it('mulberry32 yields a reproducible stream in [0,1)', () => {+ const a = mulberry32(123);+ const b = mulberry32(123);+ for (let i = 0; i < 50; i++) {+ const v = a();+ expect(v).toBe(b());+ expect(v).toBeGreaterThanOrEqual(0);+ expect(v).toBeLessThan(1);+ }+ });++ it('pickOne returns undefined for empty input', () => {+ expect(pickOne([], mulberry32(1))).toBeUndefined();+ expect(pickOne(null, mulberry32(1))).toBeUndefined();+ });+});++describe('slot normalization + grouping', () => {+ it('maps known aliases onto canonical slots', () => {+ expect(normalizeSlot('Clothing')).toBe('outfit');+ expect(normalizeSlot('FOOTWEAR')).toBe('shoes');+ expect(normalizeSlot('hairstyle')).toBe('hair');+ expect(normalizeSlot('eyewear')).toBe('glasses');+ expect(normalizeSlot('unknown')).toBe('unknown');+ });++ it('groups only wearable slots and drops id-less / non-wearable assets', () => {+ const grouped = groupAssetsBySlot(ASSETS);+ expect(grouped.outfit.map((a) => a.id).sort()).toEqual(['out-1', 'out-2']);+ expect(grouped.shoes.map((a) => a.id)).toEqual(['sho-1']);+ expect(grouped.hair.map((a) => a.id).sort()).toEqual(['hair-1', 'hair-2']);+ expect(grouped.glasses.map((a) => a.id)).toEqual(['gls-1']);+ expect(grouped.headwear.map((a) => a.id)).toEqual(['hat-1']);+ expect(grouped.tattoo).toBeUndefined();+ expect(grouped.bad).toBeUndefined();+ });+});++describe('pickRandomLook', () => {+ it('is deterministic for a given seed', () => {+ const a = pickRandomLook('seed-A', { bodies: BODIES, assets: ASSETS, bodyType: 'male' });+ const b = pickRandomLook('seed-A', { bodies: BODIES, assets: ASSETS, bodyType: 'male' });+ expect(a).toEqual(b);+ });++ it('respects the requested body type when bodies are tagged', () => {+ for (const seed of ['1', '2', '3', '4', '5']) {+ const look = pickRandomLook(seed, { bodies: BODIES, assets: ASSETS, bodyType: 'female' });+ expect(look.bodyId).toBe('body-f1');+ }+ });++ it('picks at most one asset per slot, all real ids', () => {+ const look = pickRandomLook('xyz', { bodies: BODIES, assets: ASSETS, bodyType: 'male' });+ const allIds = ASSETS.map((a) => a.id);+ for (const id of look.assetIds) expect(allIds).toContain(id);+ // No more picks than slots the catalog actually offers.+ expect(look.assetIds.length).toBeLessThanOrEqual(WEARABLE_SLOTS.length);+ // No duplicate ids.+ expect(new Set(look.assetIds).size).toBe(look.assetIds.length);+ });++ it('produces in-range colors + skin correction', () => {+ const look = pickRandomLook('color-seed', { bodies: BODIES, assets: ASSETS });+ expect(HAIR_COLORS).toContain(look.hairColor);+ expect(EYE_COLORS).toContain(look.eyeColor);+ expect(look.skinToneCorrection).toBeGreaterThanOrEqual(-15);+ expect(look.skinToneCorrection).toBeLessThanOrEqual(15);+ });++ it('falls back to the whole body pool when no gender match exists', () => {+ const untyped = [{ id: 'b1' }, { id: 'b2' }];+ const look = pickRandomLook('s', { bodies: untyped, assets: [], bodyType: 'female' });+ expect(['b1', 'b2']).toContain(look.bodyId);+ expect(look.assetIds).toEqual([]);+ });++ it('handles a totally empty catalog without throwing', () => {+ const look = pickRandomLook('s', { bodies: [], assets: [] });+ expect(look.bodyId).toBeNull();+ expect(look.assetIds).toEqual([]);+ });+});++describe('pickBodyType', () => {+ it('is deterministic and returns male|female', () => {+ expect(pickBodyType('abc')).toBe(pickBodyType('abc'));+ expect(['male', 'female']).toContain(pickBodyType('abc'));+ });++ it('produces a mix across seeds', () => {+ const types = new Set();+ for (let i = 0; i < 40; i++) types.add(pickBodyType('seed-' + i));+ expect(types).toEqual(new Set(['male', 'female']));+ });+});++describe('createCatalogSession request shaping', () => {+ let fetchSpy;+ beforeEach(() => {+ vi.resetModules();+ process.env.AVATURN_API_KEY = 'test-key';+ process.env.AVATURN_API_URL = 'https://api.avaturn.me';+ fetchSpy = vi.spyOn(globalThis, 'fetch');+ });+ afterEach(() => {+ fetchSpy.mockRestore();+ delete process.env.AVATURN_API_KEY;+ delete process.env.AVATURN_API_URL;+ });++ it('POSTs a no-photo create session and returns the session url', async () => {+ fetchSpy.mockResolvedValue(+ new Response(JSON.stringify({ session_url: 'https://hub.avaturn.me/s/abc', expires_at: '2026-06-26T00:00:00Z' }), {+ status: 200,+ headers: { 'content-type': 'application/json' },+ }),+ );+ const { createCatalogSession } = await import('../api/_lib/avaturn.js');+ const out = await createCatalogSession({ externalUserId: 'user-1', bodyType: 'female' });++ expect(out.sessionUrl).toBe('https://hub.avaturn.me/s/abc');+ expect(out.expiresAt).toBe('2026-06-26T00:00:00Z');++ const [url, init] = fetchSpy.mock.calls[0];+ expect(url).toBe('https://api.avaturn.me/api/v1/sessions');+ expect(init.method).toBe('POST');+ expect(init.headers.authorization).toBe('Bearer test-key');+ const body = JSON.parse(init.body);+ expect(body).toMatchObject({ external_user_id: 'user-1', body_type: 'female', session_type: 'create' });+ expect(body.photos).toBeUndefined();+ });++ it('throws a coded error on an upstream failure', async () => {+ fetchSpy.mockResolvedValue(new Response('nope', { status: 401 }));+ const { createCatalogSession } = await import('../api/_lib/avaturn.js');+ await expect(createCatalogSession({ externalUserId: 'u' })).rejects.toMatchObject({ code: 'upstream_auth' });+ });+});diff --git a/vercel.json b/vercel.jsonindex aba757e15..9f613840e 100644--- a/vercel.json+++ b/vercel.json@@ -70,6 +70,9 @@"api/cron/forge-seed-cron.js": {"maxDuration": 70},+ "api/cron/avaturn-seed-cron.js": {+ "maxDuration": 300+ },"api/cron/reflect-sweep.js": {"maxDuration": 120},@@ -4238,6 +4241,10 @@}],"crons": [+ {+ "path": "/api/cron/avaturn-seed-cron",+ "schedule": "* * * * *"+ },{"path": "/api/cron/irl-drops-refund","schedule": "*/10 * * * *"