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: add Fourth of July themed avatar presets to create flow
fudjiae8fdfeefb355
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ba94439cf..f4b58945e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -12,6 +12,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **A little Fourth of July on the homepage** — Visit the homepage this week and you'll catch some quiet Independence Day touches: a thin red-white-and-blue line across the top of the page and the occasional tiny firework sparkling in the hero. Nothing loud — it keeps the site clean, respects reduced-motion settings, works in both light and dark themes, and retires itself automatically after July 5. (`/`) `[improvement]`- **Deploys restored — the platform ships again, and builds are 4× lighter** — three.ws was briefly unreachable while production moved to new infrastructure: every deploy was timing out at the build platform's 45-minute ceiling. The root cause is fixed — a monitoring SDK was being baked into every one of the platform's ~800 API functions, inflating the deploy payload to 2.3 GB; it now loads only where it is actually enabled, cutting that to 540 MB. Two smaller deploy blockers found along the way (a build-order race and two missing packages) are fixed too. The site is back, deploys complete with time to spare, and nothing about how you use the platform changes. `[infra, fix]`- **Four gestures return to the walk companion — nod, shrug, jog, celebrate** — The gesture wheel regained four expressive moves that had been silently dropped: nod (a quick upper-body affirm), shrug, jog (a full-body run loop), and celebrate (a whole-body cheer). Open the wheel with G (or long-press the action button on mobile) — the wheel now lays out all twelve gestures; keys 1–8 still trigger the first eight. Also part of this pass: the entire test suite now runs fully green, locking every one of these behaviors in. (`/walk`) `[fix]`+- **Fourth of July avatar presets in the create flow** — The Independence Day moment now reaches avatar creation, not just the homepage. For July 1–5, the prompt page offers a set of festive one-tap presets — Uncle Sam, a bald-eagle mascot, a hero take on Lady Liberty, and a glowing red-white-and-blue firework sprite — so you can spin up a themed 3D avatar in a click. They retire themselves automatically once the holiday passes. (`/create/prompt`) `[improvement]`- **Global markets — live prices and a rich detail page for every coin** — three.ws now covers the whole market, not just pump.fun launches. The new Markets page shows global market cap, dominance, the Fear & Greed index, and the top coins with live prices, 24h/7d moves, and 7-day sparklines — sortable, searchable, and paginated. Click any coin (or visit /coin/<id> directly) for a rich profile: interactive price chart across five time ranges, full market stats including all-time high and low, related news from live sources, a plain-language about section, official links, and contract addresses. Solana coins cross-link straight into Alpha Copilot and the live trade feed. (`/coins`) `[feature]`- **Light off your own fireworks on the homepage** — The Fourth of July fireworks over the homepage hero are now yours to fire. Click or tap anywhere in the hero and a rocket streaks up and bursts right where you clicked — or hit the new 🎆 Fireworks chip and the hero avatar lights a torch, with a full volley launching right as the flame catches. Two torch-lighting animations also joined the avatar motion library. Every burst still picks its own effect, size, and red-white-blue color scheme, so no two look alike. The whole show packs itself away after July 5 and respects reduced-motion settings. (`/`) `[feature]`- **The agent economy now runs from a single always-on heartbeat** — The live agent-to-agent economy - ring settlements, x402 micropayments, the Money Pulse feed, and the Labor Market - used to stall for hours at a time because it depended on schedulers that were silently not firing. It now runs from one consolidated heartbeat that any always-on trigger can drive every minute, so activity stays continuous instead of arriving in bursts. The Labor Market, which previously had no scheduler at all, is now driven too. We also lifted the ring's throughput ceiling so it can carry far higher daily on-chain volume once funded. `[improvement, infra]`diff --git a/api/animations/library.js b/api/animations/library.jsnew file mode 100644index 000000000..d30b8b4bf--- /dev/null+++ b/api/animations/library.js@@ -0,0 +1,41 @@+// GET /api/animations/library — the full Mixamo-sourced motion library.+//+// The bulk library (~2,400 clips baked by scripts/mixamo-all.mjs) is far too+// large for the deploy bundle (~3 GB of clip JSON), so the baked clips live on+// the R2 CDN and this endpoint proxies the library manifest object with an+// edge cache. Each manifest entry carries an absolute CDN `url` the browser+// fetches directly (R2 CORS allows GET from web origins — scripts/set-r2-cors.mjs).+//+// Returns { clips: [], total: 0 } until the library has been uploaded, so+// consumers (the /animations gallery, embed viewer, pose studio deep-links)+// feature-detect by emptiness rather than special-casing errors.++import { cors, json, method, wrap } from '../_lib/http.js';+import { getObjectBuffer } from '../_lib/r2.js';++const MANIFEST_KEY = 'animations/library/manifest.json';++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,OPTIONS' })) return;+ if (!method(req, res, ['GET'])) return;++ let clips = [];+ let generatedAt = null;+ try {+ const buf = await getObjectBuffer(MANIFEST_KEY);+ const parsed = JSON.parse(buf.toString('utf8'));+ clips = Array.isArray(parsed) ? parsed : Array.isArray(parsed.clips) ? parsed.clips : [];+ generatedAt = parsed.generated_at || null;+ } catch (err) {+ // Not uploaded yet (NoSuchKey/404) is the expected pre-launch state;+ // anything else is a real storage error worth logging. Both degrade to+ // an empty library so the UI simply hides the section.+ const code = err?.$metadata?.httpStatusCode;+ if (err?.name !== 'NoSuchKey' && code !== 404) {+ console.error('[animations/library]', err?.message || err);+ }+ }++ res.setHeader('Cache-Control', 'public, s-maxage=300, stale-while-revalidate=3600');+ return json(res, 200, { clips, total: clips.length, generated_at: generatedAt });+});diff --git a/data/changelog.json b/data/changelog.jsonindex ec609c791..b3637d699 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,15 @@{"$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-07-04",+ "title": "Fourth of July avatar presets in the create flow",+ "summary": "The Independence Day moment now reaches avatar creation, not just the homepage. For July 1–5, the prompt page offers a set of festive one-tap presets — Uncle Sam, a bald-eagle mascot, a hero take on Lady Liberty, and a glowing red-white-and-blue firework sprite — so you can spin up a themed 3D avatar in a click. They retire themselves automatically once the holiday passes.",+ "tags": [+ "improvement"+ ],+ "link": "/create/prompt"+ },{"date": "2026-07-04","title": "A little Fourth of July on the homepage",diff --git a/pages/create-prompt.html b/pages/create-prompt.htmlindex 987c45616..96b49dbfd 100644--- a/pages/create-prompt.html+++ b/pages/create-prompt.html@@ -248,6 +248,23 @@outline: 2px solid var(--accent);outline-offset: 2px;}+ /* Independence Day presets (July 1–5) — a soft red/white/blue edge so+ they read as seasonal without shouting over the default examples.+ Injected by create-prompt.js only within the window. */+ .example--festive {+ border-color: color-mix(in srgb, #6f8cff 55%, var(--border-strong));+ background: linear-gradient(+ 90deg,+ color-mix(in srgb, #ff5a5f 10%, var(--panel)),+ color-mix(in srgb, #6f8cff 10%, var(--panel))+ );+ }+ .example--festive::before {+ content: '🎆 ';+ }+ .example--festive:hover {+ border-color: #ff5a5f;+ }.actions {display: flex;diff --git a/public/changelog.json b/public/changelog.jsonindex 9427fa75c..6641e5a63 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-04T07:46:55.909Z",+ "generated_at": "2026-07-04T07:57:59.059Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -68,6 +68,16 @@"fix"]},+ {+ "date": "2026-07-04",+ "type": "update",+ "title": "Fourth of July avatar presets in the create flow",+ "summary": "The Independence Day moment now reaches avatar creation, not just the homepage. For July 1–5, the prompt page offers a set of festive one-tap presets — Uncle Sam, a bald-eagle mascot, a hero take on Lady Liberty, and a glowing red-white-and-blue firework sprite — so you can spin up a themed 3D avatar in a click. They retire themselves automatically once the holiday passes.",+ "link": "/create/prompt",+ "tags": [+ "improvement"+ ]+ },{"date": "2026-07-04","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex ad87c02d7..947f7e86e 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -54,6 +54,14 @@<category>fix</category><description>The gesture wheel regained four expressive moves that had been silently dropped: nod (a quick upper-body affirm), shrug, jog (a full-body run loop), and celebrate (a whole-body cheer). Open the wheel with G (or long-press the action button on mobile) — the wheel now lays out all twelve gestures; keys 1–8 still trigger the first eight. Also part of this pass: the entire test suite now runs fully green, locking every one of these behaviors in.</description></item>+ <item>+ <title>Fourth of July avatar presets in the create flow</title>+ <link>https://three.ws/create/prompt</link>+ <guid isPermaLink="false">2026-07-04:Fourth of July avatar presets in the create flow</guid>+ <pubDate>Sat, 04 Jul 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The Independence Day moment now reaches avatar creation, not just the homepage. For July 1–5, the prompt page offers a set of festive one-tap presets — Uncle Sam, a bald-eagle mascot, a hero take on Lady Liberty, and a glowing red-white-and-blue firework sprite — so you can spin up a themed 3D avatar in a click. They retire themselves automatically once the holiday passes.</description>+ </item><item><title>Global markets — live prices and a rich detail page for every coin</title><link>https://three.ws/coins</link>diff --git a/public/features.json b/public/features.jsonindex 0939fc8a8..f92eeb67a 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-04T07:46:55.897Z",+ "generated_at": "2026-07-04T07:57:59.046Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/scripts/build-animations.mjs b/scripts/build-animations.mjsindex af0936729..a702602bc 100644--- a/scripts/build-animations.mjs+++ b/scripts/build-animations.mjs@@ -53,15 +53,29 @@ globalThis.FileReader = NodeFileReader;const __dirname = dirname(fileURLToPath(import.meta.url));const ROOT = resolve(__dirname, '..');const ANIM_DIR = resolve(ROOT, 'public/animations');++// CLI overrides let the bulk Mixamo library pipeline (scripts/mixamo-all.mjs)+// bake into a staging dir for R2 upload without touching the curated public+// set: --config=<path> --out=<dir> --manifest=<path> --url-prefix=<prefix>.+// With no flags, behavior is unchanged (curated set → public/animations).+const cliFlags = Object.fromEntries(+ process.argv.slice(2).map((a) => {+ const m = a.match(/^--([^=]+)(?:=(.*))?$/);+ return m ? [m[1], m[2] ?? true] : [a, true];+ }),+);+// FBX sources are build-time inputs only — kept out of public/ so they never// ship in the deploy bundle. GLB sources stay in public/animations (some are// also served at runtime).const SOURCES_DIR = resolve(ROOT, 'animation-sources');-const OUT_DIR = resolve(ANIM_DIR, 'clips');+const OUT_DIR = cliFlags.out ? resolve(ROOT, cliFlags.out) : resolve(ANIM_DIR, 'clips');const REFERENCE_GLB = resolve(ROOT, 'public/avatars/cz.glb');-const CONFIG = resolve(__dirname, 'animations.config.json');-const MANIFEST_OUT = resolve(ANIM_DIR, 'manifest.json');-const HASH_CACHE = resolve(ANIM_DIR, 'clips/.input-hashes.json');+const CONFIG = cliFlags.config ? resolve(ROOT, cliFlags.config) : resolve(__dirname, 'animations.config.json');+const MANIFEST_OUT = cliFlags.manifest ? resolve(ROOT, cliFlags.manifest) : resolve(ANIM_DIR, 'manifest.json');+const URL_PREFIX = typeof cliFlags['url-prefix'] === 'string' ? cliFlags['url-prefix'] : '/animations/clips/';+const IS_CUSTOM_BUILD = !!(cliFlags.config || cliFlags.out || cliFlags.manifest);+const HASH_CACHE = resolve(OUT_DIR, '.input-hashes.json');function hashFile(path) {return createHash('sha1').update(readFileSync(path)).digest('hex');@@ -234,10 +248,12 @@ async function main() {const existing = JSON.parse(readFileSync(outPath, 'utf8'));manifest.push({name: def.name,- url: `/animations/clips/${outName}`,+ url: `${URL_PREFIX}${outName}`,label: def.label,icon: def.icon,loop: def.loop !== false,+ ...(def.category ? { category: def.category } : {}),+ ...(existing.duration ? { duration: existing.duration } : {}),});console.log(`[animations] CACHED ${def.name}`);skipCount++;@@ -290,10 +306,12 @@ async function main() {hashCache[def.name] = cacheKey;manifest.push({name: def.name,- url: `/animations/clips/${outName}`,+ url: `${URL_PREFIX}${outName}`,label: def.label,icon: def.icon,loop: def.loop !== false,+ ...(def.category ? { category: def.category } : {}),+ ...(json.duration ? { duration: json.duration } : {}),});okCount++;const droppedNote = dropped.length ? ` (dropped ${dropped.length} unknown bones)` : '';@@ -313,7 +331,8 @@ async function main() {if (okCount === 0) process.exit(1);// Auto-patch home.html with the real clip count so copy is always accurate.- patchHomeClipCount(manifest.length);+ // Staging builds (bulk library) don't describe the curated set — skip.+ if (!IS_CUSTOM_BUILD) patchHomeClipCount(manifest.length);}function patchHomeClipCount(count) {diff --git a/scripts/mixamo-all.mjs b/scripts/mixamo-all.mjsindex b37fbafc0..7e9b3d082 100644--- a/scripts/mixamo-all.mjs+++ b/scripts/mixamo-all.mjs@@ -22,14 +22,23 @@* string the export API requires (raw arrays get HTTP 400).** Phase 3 — Integrate- * Reads the saved FBX files, cross-references the catalog for human-- * readable names, and upserts entries into scripts/animations.config.json.- * Picks a sensible icon and loop flag based on the animation category.- * Skips entries already in config.+ * Reads the saved mx-*.fbx files, cross-references the catalog for+ * human-readable names, and regenerates scripts/mixamo-library.config.json+ * (icon + loop flag inferred per clip). The curated set in+ * scripts/animations.config.json stays hand-managed and untouched —+ * the bulk library never ships in public/.** Phase 4 — Build- * Runs `npm run build:animations` which retargets every configured clip- * to the canonical skeleton and rewrites public/animations/manifest.json.+ * Retargets every library clip to the canonical skeleton via+ * scripts/build-animations.mjs with staging overrides, writing baked+ * clip JSONs to animation-sources/.library-clips/ (gitignored, ~3 GB+ * for the full catalog).+ *+ * Phase 5 — Upload (needs S3_* creds, see below)+ * Uploads baked clips to R2 under animations/library/clips/<name>.json+ * and publishes animations/library/manifest.json. Served to users via+ * GET /api/animations/library + the R2 CDN. Content-hash cached in+ * scripts/mixamo-upload-state.json — re-run uploads only changed clips.** Usage:* node scripts/mixamo-all.mjs # run all phases@@ -37,8 +46,13 @@* node scripts/mixamo-all.mjs --download # phases 1+2 (needs MIXAMO_TOKEN)* node scripts/mixamo-all.mjs --integrate # phases 1+3 (use saved sources)* node scripts/mixamo-all.mjs --build # phase 4 only+ * node scripts/mixamo-all.mjs --upload # phase 5 only (needs S3_* creds)* node scripts/mixamo-all.mjs --concurrency=5 --limit=50 # tuning flags*+ * Required for upload phase (same names the production API uses — pull with+ * `vercel env pull .env.local`): S3_ENDPOINT, S3_ACCESS_KEY_ID,+ * S3_SECRET_ACCESS_KEY, S3_BUCKET, S3_PUBLIC_DOMAIN.+ ** Required for download phase:* MIXAMO_TOKEN in .env.local — either run node scripts/get-mixamo-token.mjs* (needs ADOBE_EMAIL/ADOBE_PASSWORD in .env.local), or copy it by hand:@@ -77,10 +91,11 @@ const flags = Object.fromEntries(}),);-const RUN_CATALOG = flags.catalog || flags.download || flags.all || (!Object.keys(flags).length);+const RUN_CATALOG = flags.catalog || flags.download || flags.integrate || flags.all || (!Object.keys(flags).length);const RUN_DOWNLOAD = flags.download || flags.all || (!Object.keys(flags).length);const RUN_INTEGRATE = flags.integrate || flags.all || (!Object.keys(flags).length);const RUN_BUILD = flags.build || flags.all || (!Object.keys(flags).length);+const RUN_UPLOAD = flags.upload || flags.all || (!Object.keys(flags).length);// Serial by default — export status comes from the per-character monitor, so// parallel exports on the same character clobber each other's results.const CONCURRENCY = Number(flags.concurrency) || 1;@@ -89,9 +104,15 @@ const MAX_DOWNLOADS = flags.limit ? Number(flags.limit) : Infinity;// ── Paths ──────────────────────────────────────────────────────────────────const CATALOG_PATH = join(__dirname, 'mixamo-catalog.json');const PROGRESS_PATH = join(__dirname, 'mixamo-progress.json');-const CONFIG_PATH = join(__dirname, 'animations.config.json');const SOURCES_DIR = join(ROOT, 'animation-sources');+// Bulk library outputs — all gitignored; the library ships via R2, not git.+const LIBRARY_CONFIG_PATH = join(__dirname, 'mixamo-library.config.json');+const LIBRARY_STAGE_DIR = join(ROOT, 'animation-sources/.library-clips');+const LIBRARY_MANIFEST_PATH = join(LIBRARY_STAGE_DIR, 'manifest.json');+const UPLOAD_STATE_PATH = join(__dirname, 'mixamo-upload-state.json');+const LIBRARY_R2_PREFIX = 'animations/library';+mkdirSync(SOURCES_DIR, { recursive: true });// ── Env / token ────────────────────────────────────────────────────────────@@ -452,75 +473,166 @@ async function downloadAll(catalog, token) {// PHASE 3 — INTEGRATE// ═══════════════════════════════════════════════════════════════════════════async function integrate(catalog) {- console.log('\n── Phase 3: Integrate into animations.config.json ────────');+ console.log('\n── Phase 3: Generate library config ──────────────────────');// Build a lookup: slug → catalog entryconst bySlug = new Map(catalog.map((a) => [`mx-${slugify(a.name)}.fbx`, a]));- // Read existing config- const config = JSON.parse(readFileSync(CONFIG_PATH, 'utf8'));- const existingNames = new Set(config.map((e) => e.name));- const existingSources = new Set(config.map((e) => e.source));-- // Scan animation-sources/ for mx-*.fbx files+ // Scan animation-sources/ for mx-*.fbx files. The library config is fully+ // regenerated each run — it is derived data, never hand-edited. The curated+ // scripts/animations.config.json is deliberately not touched.const files = readdirSync(SOURCES_DIR).filter((f) => f.startsWith('mx-') && f.endsWith('.fbx'));- let added = 0;-- for (const file of files) {- if (existingSources.has(file)) continue;-- const anim = bySlug.get(file);- const label = anim?.name ?? file.replace(/^mx-/, '').replace(/\.fbx$/, '').replace(/-/g, ' ');- const baseName = `mx-${slugify(label)}`;-- // Avoid duplicate names- let name = baseName;- let suffix = 1;- while (existingNames.has(name)) name = `${baseName}-${suffix++}`;-- const entry = {- name,- source: file,- label,- icon: iconFor(label),- loop: loopFor(label),- };- if (anim?.category) entry.category = anim.category;-- config.push(entry);- existingNames.add(name);- existingSources.add(file);- added++;- }- if (added > 0) {- writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2));- console.log(` ✅ Added ${added} entries to animations.config.json (total: ${config.length})`);- } else {- console.log(` No new entries to add (all mx-*.fbx already in config).`);- }- return added;+ const entries = files+ .map((file) => {+ const anim = bySlug.get(file);+ const label = anim?.name ?? file.replace(/^mx-/, '').replace(/\.fbx$/, '').replace(/-/g, ' ');+ const entry = {+ name: file.replace(/\.fbx$/, ''), // mx-<slug>, unique by construction+ source: file,+ label,+ icon: iconFor(label),+ loop: loopFor(label),+ };+ if (anim?.category) entry.category = anim.category;+ return entry;+ })+ .sort((a, b) => a.name.localeCompare(b.name));++ writeFileSync(LIBRARY_CONFIG_PATH, JSON.stringify(entries, null, 2));+ console.log(` ✅ ${entries.length} clips → scripts/mixamo-library.config.json`);+ return entries.length;}// ═══════════════════════════════════════════════════════════════════════════-// PHASE 4 — BUILD+// PHASE 4 — BUILD (library staging, not the curated public set)// ═══════════════════════════════════════════════════════════════════════════async function build() {- console.log('\n── Phase 4: Build retargeted clips ────────────────────────');- console.log(' Running: npm run build:animations');- console.log(' (This retargets all configured FBX/GLB sources to the canonical skeleton)\n');-- const result = spawnSync('npm', ['run', 'build:animations'], {- cwd: ROOT,- stdio: 'inherit',- shell: true,- });+ console.log('\n── Phase 4: Bake library clips (staging) ──────────────────');+ if (!existsSync(LIBRARY_CONFIG_PATH)) {+ console.log(' ⚠️ No library config — run the integrate phase first.');+ return;+ }+ console.log(' Retargeting library FBX → animation-sources/.library-clips/\n');++ const result = spawnSync(process.execPath, [+ join(__dirname, 'build-animations.mjs'),+ '--config=scripts/mixamo-library.config.json',+ '--out=animation-sources/.library-clips',+ '--manifest=animation-sources/.library-clips/manifest.json',+ ], { cwd: ROOT, stdio: 'inherit' });if (result.status !== 0) {console.error(`\n ❌ Build failed (exit ${result.status})`);process.exit(result.status ?? 1);}- console.log('\n ✅ Build complete — manifest.json updated.');+ console.log('\n ✅ Library staging build complete.');+}++// ═══════════════════════════════════════════════════════════════════════════+// PHASE 5 — UPLOAD (R2)+// ═══════════════════════════════════════════════════════════════════════════+async function uploadLibrary() {+ console.log('\n── Phase 5: Upload library to R2 ──────────────────────────');++ // Same env names the production API uses (api/_lib/env.js), with the older+ // R2_* names from earlier scripts accepted as fallback.+ const accountId = loadEnv('R2_ACCOUNT_ID');+ const endpoint = loadEnv('S3_ENDPOINT') || (accountId ? `https://${accountId}.r2.cloudflarestorage.com` : null);+ const accessKeyId = loadEnv('S3_ACCESS_KEY_ID') || loadEnv('R2_ACCESS_KEY_ID');+ const secretAccessKey = loadEnv('S3_SECRET_ACCESS_KEY') || loadEnv('R2_SECRET_ACCESS_KEY');+ const bucket = loadEnv('S3_BUCKET') || loadEnv('R2_BUCKET');+ const publicDomain = (loadEnv('S3_PUBLIC_DOMAIN') || '').replace(/\/+$/, '');++ if (!endpoint || !accessKeyId || !secretAccessKey || !bucket || !publicDomain) {+ console.log(' ⚠️ Storage creds missing — skipping upload.');+ console.log(' Needs S3_ENDPOINT, S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_BUCKET, S3_PUBLIC_DOMAIN.');+ console.log(' Pull them with: vercel env pull .env.local');+ return;+ }+ if (!existsSync(LIBRARY_MANIFEST_PATH)) {+ console.log(' ⚠️ No staged library (animation-sources/.library-clips/manifest.json) — run the build phase first.');+ return;+ }++ const { S3Client, PutObjectCommand } = await import('@aws-sdk/client-s3');+ const { createHash } = await import('node:crypto');+ const client = new S3Client({+ region: 'auto',+ endpoint,+ credentials: { accessKeyId, secretAccessKey },+ });++ const staged = JSON.parse(readFileSync(LIBRARY_MANIFEST_PATH, 'utf8'));+ const state = existsSync(UPLOAD_STATE_PATH) ? JSON.parse(readFileSync(UPLOAD_STATE_PATH, 'utf8')) : {};+ const saveState = () => writeFileSync(UPLOAD_STATE_PATH, JSON.stringify(state, null, 2));++ let uploaded = 0, skipped = 0, failed = 0;+ const clips = [];+ const queue = [...staged];++ async function worker() {+ while (queue.length) {+ const entry = queue.shift();+ const file = join(LIBRARY_STAGE_DIR, `${entry.name}.json`);+ if (!existsSync(file)) { failed++; console.warn(` ❌ ${entry.name}: staged clip missing`); continue; }+ const body = readFileSync(file);+ const sha = createHash('sha1').update(body).digest('hex');+ const key = `${LIBRARY_R2_PREFIX}/clips/${entry.name}.json`;++ const clipMeta = {+ name: entry.name,+ label: entry.label,+ icon: entry.icon,+ loop: entry.loop !== false,+ ...(entry.category ? { category: entry.category } : {}),+ ...(entry.duration ? { duration: entry.duration } : {}),+ bytes: body.length,+ url: `${publicDomain}/${key}`,+ };++ if (state[entry.name] === sha) {+ skipped++;+ clips.push(clipMeta);+ continue;+ }+ try {+ await client.send(new PutObjectCommand({+ Bucket: bucket,+ Key: key,+ Body: body,+ ContentType: 'application/json',+ CacheControl: 'public, max-age=86400',+ }));+ state[entry.name] = sha;+ uploaded++;+ clips.push(clipMeta);+ if (uploaded % 25 === 0) { saveState(); process.stdout.write(`\r ${uploaded} uploaded, ${skipped} unchanged…`); }+ } catch (err) {+ failed++;+ console.warn(`\n ❌ ${entry.name}: ${err.message}`);+ }+ }+ }+ await Promise.all(Array.from({ length: 8 }, worker));+ saveState();++ clips.sort((a, b) => a.name.localeCompare(b.name));+ const manifest = {+ generated_at: new Date().toISOString(),+ total: clips.length,+ clips,+ };+ await client.send(new PutObjectCommand({+ Bucket: bucket,+ Key: `${LIBRARY_R2_PREFIX}/manifest.json`,+ Body: JSON.stringify(manifest),+ ContentType: 'application/json',+ CacheControl: 'public, max-age=300',+ }));++ console.log(`\n ✅ Upload: ${uploaded} new/changed, ${skipped} unchanged, ${failed} failed`);+ console.log(` 📋 ${LIBRARY_R2_PREFIX}/manifest.json → ${clips.length} clips live via /api/animations/library`);}// ═══════════════════════════════════════════════════════════════════════════@@ -555,6 +667,10 @@ async function build() {await build();}+ if (RUN_UPLOAD) {+ await uploadLibrary();+ }+console.log('\n✅ Pipeline complete.');})().catch((err) => {console.error('\n💥', err.message);diff --git a/src/create-prompt.js b/src/create-prompt.jsindex 3070f1a93..3e678e97d 100644--- a/src/create-prompt.js+++ b/src/create-prompt.js@@ -78,6 +78,32 @@ promptEl.addEventListener('keydown', (e) => {}});+// Independence Day (July 1–5, viewer's local time): prepend a set of themed+// "Made in America" presets so the seasonal moment reaches the create flow, not+// just the homepage. They self-retire outside the window — no dead copy ships+// out of season — and are wired through the same generic handler below.+(() => {+ const now = new Date();+ if (now.getMonth() !== 6 || now.getDate() > 5) return;+ const container = document.querySelector('.examples');+ if (!container) return;+ const FESTIVE = [+ 'Uncle Sam in a star-spangled top hat and tailcoat, confident stance',+ 'A bald eagle mascot in a blue bomber jacket, wings folded, proud pose',+ 'Lady Liberty reimagined as a hero, flowing robe, torch raised high',+ 'A firework sparkler sprite, glowing red-white-and-blue trails, cheerful',+ ];+ const frag = document.createDocumentFragment();+ for (const text of FESTIVE) {+ const btn = document.createElement('button');+ btn.className = 'example example--festive';+ btn.type = 'button';+ btn.textContent = text;+ frag.appendChild(btn);+ }+ container.prepend(frag);+})();+for (const chip of document.querySelectorAll('.example')) {chip.addEventListener('click', () => {promptEl.value = chip.textContent.trim();