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 daily page-snapshot tooling (scripts/page-snapshot.mjs + snapshots/) and W-world-online README; chat/brain/avatar refinements
nirholas1742bd6b7ace
diff --git a/.gitignore b/.gitignoreindex 1ca10e906..d9c658e81 100644--- a/.gitignore+++ b/.gitignore@@ -175,3 +175,16 @@ docs/3d-generation-api/other/support-faq.mddocs/3d-generation-api/task-query/get-your-task-result.mddocs/3d-generation-api/texture/texture-model-v2-5-20250123.mddocs/3d-generation-api/texture/texture-model-v3-0-20250812.md++# Snapshot day-exports — recoverable from git history, never commit+snapshots/exported/+docs/agent-briefs/W-world-online/W01-open-world-foundation.md+docs/agent-briefs/W-world-online/W02-vehicles-and-driving.md+docs/agent-briefs/W-world-online/W03-character-avatar-customization.md+docs/agent-briefs/W-world-online/W04-economy-and-money.md+docs/agent-briefs/W-world-online/W05-jobs-missions-heists.md+docs/agent-briefs/W-world-online/W06-activities-and-minigames.md+docs/agent-briefs/W-world-online/W07-combat-and-weapons.md+docs/agent-briefs/W-world-online/W08-npcs-and-world-life.md+docs/agent-briefs/W-world-online/W09-social-and-crews.md+docs/agent-briefs/W-world-online/W10-hud-menu-and-gamefeel.mddiff --git a/api/brain/chat.js b/api/brain/chat.jsindex 9772eb444..5a5f7b63e 100644--- a/api/brain/chat.js+++ b/api/brain/chat.js@@ -21,6 +21,17 @@ import { watsonxConfig, watsonxChatRequest } from '../_lib/watsonx.js';export const maxDuration = 120;const PROVIDERS = {+ 'gpt-oss-120b': {+ label: 'GPT-OSS 120B',+ network: 'OpenAI · OpenRouter',+ tier: 'balanced',+ maxOutput: 8192,+ description: "OpenAI's open-weight 120B. Fast, capable, free tier. Platform default.",+ build: () => {+ if (env.OPENROUTER_API_KEY) return openrouter()('openai/gpt-oss-120b:free');+ return null;+ },+ },'claude-opus-4-7': {label: 'Claude Opus 4.7',network: 'Anthropic',@@ -302,7 +313,7 @@ export default wrap(async function handler(req, res) {return error(res, e.status || 400, 'bad_request', e.message);}- const providerKey = String(body.provider || 'claude-sonnet-4-6');+ const providerKey = String(body.provider || 'gpt-oss-120b');const spec = PROVIDERS[providerKey];if (!spec) {return error(res, 400, 'unknown_provider', `unknown provider: ${providerKey}`, {diff --git a/docs/agent-briefs/W-world-online/README.md b/docs/agent-briefs/W-world-online/README.mdnew file mode 100644index 000000000..578ca64a1--- /dev/null+++ b/docs/agent-briefs/W-world-online/README.md@@ -0,0 +1,32 @@+# W — World Online program++Turning `/play` into a **GTA Online–class, high-quality 3D multiplayer world** (not isometric):+drivable open world, in-game economy, jobs/missions/heists, activities & races, combat, deep+avatar customization, and living NPCs — wallet-native to `$THREE`.++**Reuse-first, no engine switch.** We extend our live stack — three.js + Rapier + Colyseus+(already running in `/play` + `/walk`) — and port proven systems from our existing+`world.three.ws` framework. Reference repo for vehicle/ECS netcode: iErcann/Notblox.++## Read order++1. **[W00 — Program overview & shared architecture](W00-program-overview.md)** — READ FIRST.+ Stack, package allowlist, the off-schema networking pattern, coin rules, DoD, dependency+ graph. Every other brief assumes it.++## Briefs (one agent each, end-to-end)++| Brief | Feature | Depends on |+|-------|---------|------------|+| [W01](W01-open-world-foundation.md) | Open-world foundation (drivable, physics, day/night) | — |+| [W02](W02-vehicles-and-driving.md) | Vehicles & driving (Rapier raycast vehicle, networked) | W01 |+| [W03](W03-character-avatar-customization.md) | Character & avatar customization (RPM + selfie→3D + wardrobe) | — |+| [W04](W04-economy-and-money.md) | Economy & money (cash, bank/ATM, vendors, `$THREE` bridge) | — |+| [W05](W05-jobs-missions-heists.md) | Jobs, missions & heists (data-driven quest engine) | W04 |+| [W06](W06-activities-and-minigames.md) | Activities & minigames (gather/craft loop, races, arcade) | W04 (W02 for races) |+| [W07](W07-combat-and-weapons.md) | Combat & weapons (authoritative, zones, wanted) | W01 |+| [W08](W08-npcs-and-world-life.md) | NPCs & world life (traffic, vendors, quest-givers, mobs) | W01 |+| [W09](W09-social-and-crews.md) | Social & crews (crews, parties, profiles, minimap) | — |+| [W10](W10-hud-menu-and-gamefeel.md) | HUD, interaction menu & game-feel polish | W01 |++Suggested build order = the table order (W01 → W10). W01 unblocks the most.diff --git a/package.json b/package.jsonindex 4389f2b10..6c3f9bd63 100644--- a/package.json+++ b/package.json@@ -60,6 +60,7 @@"build:pages": "node scripts/build-page-index.mjs","audit:pages": "node scripts/audit-page-index.mjs","audit:web": "node scripts/page-audit.mjs",+ "snapshot": "node scripts/page-snapshot.mjs","build:news": "node scripts/build-news.mjs","prebuild": "(node scripts/build-news.mjs & node scripts/build-skill-metadata.mjs & node scripts/build-local-skill-packs.mjs & npm run build:club-assets & wait) && (node scripts/build-page-index.mjs && node scripts/audit-page-index.mjs)","build": "NODE_OPTIONS='--no-deprecation --max-old-space-size=6144' vite build && node scripts/strip-sw-from-embeds.mjs",diff --git a/public/feed.js b/public/feed.jsindex 6ed8a3407..8fe4eb413 100644--- a/public/feed.js+++ b/public/feed.js@@ -91,7 +91,7 @@'agent-deploy': {icon: '✦',href: function (e) { return e.agentId ? '/agent/' + encodeURIComponent(e.agentId) : '/discover'; },- parts: function (e) { return [bold(e.name || e.actor || 'A new agent'), ' just deployed on-chain']; },+ parts: function (e) { return [bold(e.name || e.actor || 'A new agent'), ' just joined three.ws']; },},'level-up': {icon: '⬆',diff --git a/scripts/page-snapshot.mjs b/scripts/page-snapshot.mjsnew file mode 100644index 000000000..096780974--- /dev/null+++ b/scripts/page-snapshot.mjs@@ -0,0 +1,352 @@+#!/usr/bin/env node+/**+ * page-snapshot.mjs — daily visual snapshot of every page on the site.+ *+ * Drives a real Chromium across every public page (sourced from data/pages.json,+ * the same manifest that powers /sitemap, llms.txt and page-audit) in a desktop+ * and a mobile viewport, and saves a full-page screenshot of each. The result is+ * a complete picture of how the site looked on a given day — a design memory you+ * can flip back to after any drastic change.+ *+ * ── Storage model: stable paths + git history as the time machine ─────────────+ * Screenshots are written to STABLE filenames (snapshots/current/<viewport>/<slug>.jpg),+ * overwritten on every run. Each day's `git commit` of snapshots/ is the archive:+ *+ * • Browse today: open snapshots/current/index.html+ * • See a page's past: git log --follow -- snapshots/current/desktop/home.jpg+ * • Recover any day: git checkout <sha> -- snapshots/current (or git show <sha>:<path> > old.jpg)+ * • Export a full day: scripts/snapshot-export-day.sh <YYYY-MM-DD> (see that script)+ *+ * This keeps the working tree at ~one day's size (~tens of MB) while git history+ * holds every prior day in full — no unbounded snapshots/<date>/ folder bloat.+ *+ * ── Target ────────────────────────────────────────────────────────────────────+ * BASE_URL=https://three.ws (default — the live, deployed design)+ * BASE_URL=http://localhost:3000 (vite/vercel dev)+ *+ * ── Usage ─────────────────────────────────────────────────────────────────────+ * node scripts/page-snapshot.mjs # full snapshot, desktop + mobile+ * node scripts/page-snapshot.mjs / /pay /ibm # only these routes+ * node scripts/page-snapshot.mjs --desktop-only # skip the mobile viewport+ * node scripts/page-snapshot.mjs --mobile-only # skip the desktop viewport+ * node scripts/page-snapshot.mjs --concurrency 4 # parallel pages per viewport (default 3)+ * node scripts/page-snapshot.mjs --settle 5000 # ms to wait after load for 3D/animations+ * node scripts/page-snapshot.mjs --quality 80 # JPEG quality (default 72)+ *+ * Note: headless Chromium renders WebGL via SWANGLE/SwiftShader. Most 3D heroes+ * render, but some heavy GPU scenes (and backdrop-filter) may come out dark. The+ * full-page layout, type, copy and imagery are always captured faithfully — that+ * is the design record. Raise --settle if a page's data loads slowly.+ */+import { chromium, devices } from 'playwright';+import { readFileSync, writeFileSync, mkdirSync, existsSync, rmSync, statSync } from 'node:fs';+import { resolve, dirname } from 'node:path';+import { fileURLToPath } from 'node:url';++const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');+const BASE_URL = (process.env.BASE_URL || 'https://three.ws').replace(/\/$/, '');+const OUT_DIR = resolve(ROOT, 'snapshots/current');++// ── CLI parsing ───────────────────────────────────────────────────────────────+const argv = process.argv.slice(2);+const flag = (name) => argv.includes(`--${name}`);+const opt = (name, fallback) => {+ const i = argv.indexOf(`--${name}`);+ return i !== -1 && argv[i + 1] ? argv[i + 1] : fallback;+};+const DESKTOP_ONLY = flag('desktop-only');+const MOBILE_ONLY = flag('mobile-only');+const CONCURRENCY = Math.max(1, Number(opt('concurrency', 3)) || 3);+const SETTLE_MS = Math.max(0, Number(opt('settle', 3500)) || 3500);+const QUALITY = Math.min(100, Math.max(30, Number(opt('quality', 72)) || 72));+const explicitRoutes = argv.filter((a) => a.startsWith('/'));++// ── Route discovery ────────────────────────────────────────────────────────────+// Public, user-discoverable pages from the manifest that drives /sitemap and+// llms.txt — the single source of truth. Machine-readable endpoints (.xml/.txt/+// .json, .well-known) and parameterised routes are skipped: they have no design.+function manifestPages() {+ const pages = JSON.parse(readFileSync(resolve(ROOT, 'data/pages.json'), 'utf8'));+ const out = [];+ const seen = new Set();+ for (const s of pages.sections || []) {+ if (s.id === 'machine') continue;+ for (const p of s.pages || []) {+ const path = p.path;+ if (!path || !path.startsWith('/') || /[:*]/.test(path)) continue;+ if (/\.(xml|txt|json)$/.test(path) || path.startsWith('/.well-known')) continue;+ if (seen.has(path)) continue;+ seen.add(path);+ out.push({ path, title: p.title || path, section: s.title || s.id, auth: p.auth || null });+ }+ }+ return out;+}++// Map a route to a filesystem-safe slug: '/' → 'home', '/docs/api' → 'docs-api'.+function slugFor(path) {+ if (path === '/') return 'home';+ return path.replace(/^\//, '').replace(/\/$/, '').replace(/[^a-zA-Z0-9._-]+/g, '-') || 'home';+}++// ── Snapshot one route in one viewport ──────────────────────────────────────────+async function snapshotRoute(ctx, page, route, viewport) {+ const slug = slugFor(route);+ const file = resolve(OUT_DIR, viewport, `${slug}.jpg`);+ let navStatus = 0;+ let title = '';+ try {+ const resp = await page+ .goto(`${BASE_URL}${route}`, { waitUntil: 'networkidle', timeout: 45000 })+ .catch(async () => {+ // networkidle never settles on pages with long-poll/SSE — fall back.+ return page.goto(`${BASE_URL}${route}`, { waitUntil: 'domcontentloaded', timeout: 45000 });+ });+ navStatus = resp ? resp.status() : 0;+ } catch (e) {+ return { route, viewport, slug, ok: false, navStatus, error: String(e).slice(0, 160) };+ }+ // Let data, fonts, lazy images and 3D scenes settle before the shot.+ await page.waitForTimeout(SETTLE_MS);+ await page.evaluate(() => window.scrollTo(0, 0)).catch(() => {});+ title = (await page.title().catch(() => '')) || '';+ mkdirSync(dirname(file), { recursive: true });+ try {+ await page.screenshot({ path: file, fullPage: true, type: 'jpeg', quality: QUALITY });+ } catch {+ // Some pages are taller than the GPU surface limit — clip to a tall viewport shot.+ await page.screenshot({ path: file, fullPage: false, type: 'jpeg', quality: QUALITY });+ }+ const bytes = existsSync(file) ? statSync(file).size : 0;+ return { route, viewport, slug, ok: bytes > 0, navStatus, title, bytes };+}++// Bounded-concurrency pool, one shared-context page per worker.+async function runPool(ctx, routes, viewport, onResult) {+ const queue = [...routes];+ const results = [];+ const worker = async () => {+ const page = await ctx.newPage();+ // Silence page console so a noisy site doesn't drown the run log.+ page.on('console', () => {});+ page.on('pageerror', () => {});+ while (queue.length) {+ const route = queue.shift();+ const r = await snapshotRoute(ctx, page, route, viewport).catch((e) => ({+ route,+ viewport,+ slug: slugFor(route),+ ok: false,+ error: String(e).slice(0, 160),+ }));+ results.push(r);+ onResult(r);+ }+ await page.close();+ };+ await Promise.all(Array.from({ length: Math.min(CONCURRENCY, routes.length) }, worker));+ return results;+}++// ── Gallery (self-contained: data is inlined so file:// works without a server) ──+function writeGallery(meta, byRoute) {+ const data = {+ capturedAt: meta.capturedAt,+ date: meta.date,+ baseUrl: meta.baseUrl,+ viewports: meta.viewports,+ pages: byRoute,+ };+ const html = `<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8" />+<meta name="viewport" content="width=device-width, initial-scale=1" />+<title>three.ws — site snapshot ${meta.date}</title>+<style>+ :root { --bg:#0a0a0b; --panel:#141416; --line:#26262b; --fg:#f4f4f5; --mut:#9a9aa3; --accent:#e8e8ea; }+ * { box-sizing: border-box; }+ body { margin:0; background:var(--bg); color:var(--fg); font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,sans-serif; }+ header { position:sticky; top:0; z-index:10; background:rgba(10,10,11,.85); backdrop-filter:blur(12px); border-bottom:1px solid var(--line); padding:18px 24px; display:flex; align-items:baseline; gap:16px; flex-wrap:wrap; }+ header h1 { font-size:16px; margin:0; letter-spacing:-.01em; }+ header .meta { color:var(--mut); font-size:13px; }+ header .spacer { flex:1; }+ .toggle { display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }+ .toggle button { background:transparent; color:var(--mut); border:0; padding:6px 14px; font:inherit; cursor:pointer; }+ .toggle button[aria-pressed="true"] { background:var(--accent); color:#0a0a0b; font-weight:600; }+ input[type=search] { background:var(--panel); border:1px solid var(--line); color:var(--fg); border-radius:8px; padding:7px 12px; font:inherit; min-width:220px; }+ main { padding:24px; }+ .section-title { color:var(--mut); text-transform:uppercase; letter-spacing:.08em; font-size:11px; margin:28px 0 12px; }+ .grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px; }+ .card { background:var(--panel); border:1px solid var(--line); border-radius:12px; overflow:hidden; transition:border-color .15s, transform .15s; }+ .card:hover { border-color:#3a3a42; transform:translateY(-2px); }+ .card a.shot { display:block; aspect-ratio:16/10; overflow:hidden; background:#000; border-bottom:1px solid var(--line); }+ .card a.shot img { width:100%; height:100%; object-fit:cover; object-position:top center; display:block; }+ .card .body { padding:11px 13px; }+ .card .t { font-weight:600; font-size:13px; margin:0 0 2px; }+ .card .p { color:var(--mut); font-size:12px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }+ .card.missing a.shot { display:flex; align-items:center; justify-content:center; color:var(--mut); font-size:12px; aspect-ratio:16/10; }+ .empty { color:var(--mut); padding:40px; text-align:center; }+</style>+</head>+<body>+<header>+ <h1>three.ws site snapshot</h1>+ <span class="meta" id="meta"></span>+ <span class="spacer"></span>+ <input type="search" id="q" placeholder="Filter pages…" aria-label="Filter pages" />+ <div class="toggle" role="group" aria-label="Viewport">+ <button id="vp-desktop" aria-pressed="true">Desktop</button>+ <button id="vp-mobile" aria-pressed="false">Mobile</button>+ </div>+</header>+<main id="main"></main>+<script>+const DATA = ${JSON.stringify(data)};+let viewport = DATA.viewports.includes('desktop') ? 'desktop' : 'mobile';+let query = '';+const main = document.getElementById('main');+document.getElementById('meta').textContent =+ DATA.pages.length + ' pages · ' + DATA.baseUrl + ' · captured ' + new Date(DATA.capturedAt).toLocaleString();++function bySection() {+ const m = new Map();+ for (const p of DATA.pages) {+ if (query && !(p.path.toLowerCase().includes(query) || (p.title||'').toLowerCase().includes(query))) continue;+ if (!m.has(p.section)) m.set(p.section, []);+ m.get(p.section).push(p);+ }+ return m;+}+function render() {+ const groups = bySection();+ if (!groups.size) { main.innerHTML = '<div class="empty">No pages match "' + query + '".</div>'; return; }+ let html = '';+ for (const [section, pages] of groups) {+ html += '<div class="section-title">' + section + ' · ' + pages.length + '</div><div class="grid">';+ for (const p of pages) {+ const shot = p.shots && p.shots[viewport];+ const src = shot ? viewport + '/' + p.slug + '.jpg' : '';+ html += '<div class="card' + (shot ? '' : ' missing') + '">'+ + (shot+ ? '<a class="shot" href="' + src + '" target="_blank" rel="noopener"><img loading="lazy" src="' + src + '" alt="' + (p.title||p.path) + '"></a>'+ : '<a class="shot">not captured</a>')+ + '<div class="body"><p class="t">' + (p.title||p.path) + '</p><p class="p">' + p.path + '</p></div></div>';+ }+ html += '</div>';+ }+ main.innerHTML = html;+}+function setVp(v) {+ viewport = v;+ document.getElementById('vp-desktop').setAttribute('aria-pressed', String(v==='desktop'));+ document.getElementById('vp-mobile').setAttribute('aria-pressed', String(v==='mobile'));+ render();+}+document.getElementById('vp-desktop').onclick = () => setVp('desktop');+document.getElementById('vp-mobile').onclick = () => setVp('mobile');+if (!DATA.viewports.includes('desktop')) document.getElementById('vp-desktop').disabled = true;+if (!DATA.viewports.includes('mobile')) document.getElementById('vp-mobile').disabled = true;+document.getElementById('q').oninput = (e) => { query = e.target.value.trim().toLowerCase(); render(); };+render();+</script>+</body>+</html>`;+ writeFileSync(resolve(OUT_DIR, 'index.html'), html);+}++// ── Main ────────────────────────────────────────────────────────────────────────+async function main() {+ const pages = explicitRoutes.length+ ? explicitRoutes.map((p) => ({ path: p, title: p, section: 'Selected', auth: null }))+ : manifestPages();+ // Public design record: skip auth-gated pages unless explicitly requested.+ const targets = pages.filter((p) => explicitRoutes.length || !p.auth);+ const routes = targets.map((p) => p.path);++ const viewports = MOBILE_ONLY ? ['mobile'] : DESKTOP_ONLY ? ['desktop'] : ['desktop', 'mobile'];++ // `date` is the local calendar day this run belongs to — stamped into the+ // manifest and gallery so a committed set is self-describing.+ const now = new Date();+ const date = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}`;++ console.log(`■ Snapshotting ${routes.length} pages at ${BASE_URL}`);+ console.log(` viewports: ${viewports.join(', ')} · concurrency: ${CONCURRENCY} · settle: ${SETTLE_MS}ms · jpeg q${QUALITY}`);++ // Clear stale shots so a removed/renamed page never lingers in the committed set.+ for (const vp of viewports) {+ const dir = resolve(OUT_DIR, vp);+ if (existsSync(dir)) rmSync(dir, { recursive: true, force: true });+ mkdirSync(dir, { recursive: true });+ }++ const browser = await chromium.launch({+ args: [+ '--no-sandbox',+ '--disable-dev-shm-usage',+ // Maximise the odds WebGL 3D heroes render under headless Chromium.+ '--ignore-gpu-blocklist',+ '--enable-unsafe-swiftshader',+ '--use-gl=angle',+ '--use-angle=swiftshader',+ ],+ });++ const byRoute = new Map(targets.map((p) => [p.path, { ...p, slug: slugFor(p.path), shots: {} }]));+ let done = 0;+ const total = routes.length * viewports.length;++ for (const viewport of viewports) {+ const ctxOpts =+ viewport === 'mobile'+ ? { ...devices['iPhone 13'] }+ : { viewport: { width: 1440, height: 900 }, deviceScaleFactor: 1 };+ const ctx = await browser.newContext(ctxOpts);+ ctx.setDefaultTimeout(45000);+ console.log(`── ${viewport} ──`);+ await runPool(ctx, routes, viewport, (r) => {+ done++;+ const entry = byRoute.get(r.route);+ if (entry && r.ok) entry.shots[viewport] = { bytes: r.bytes, navStatus: r.navStatus };+ const mark = r.ok ? '✓' : '✗';+ const size = r.ok ? `${Math.round(r.bytes / 1024)}kb` : r.error || `HTTP ${r.navStatus}`;+ console.log(` ${mark} [${String(done).padStart(3)}/${total}] ${viewport} ${r.route} ${size}`);+ });+ await ctx.close();+ }+ await browser.close();++ // ── Manifest + gallery ──────────────────────────────────────────────────────+ const pageList = [...byRoute.values()].map((p) => ({+ path: p.path,+ title: p.title,+ section: p.section,+ slug: p.slug,+ shots: p.shots,+ }));+ const captured = pageList.filter((p) => Object.keys(p.shots).length).length;+ const meta = {+ capturedAt: now.toISOString(),+ date,+ baseUrl: BASE_URL,+ viewports,+ pageCount: pageList.length,+ capturedCount: captured,+ };+ writeFileSync(resolve(OUT_DIR, 'manifest.json'), JSON.stringify({ ...meta, pages: pageList }, null, 2));+ writeGallery(meta, pageList);++ console.log(`\n■ Done. ${captured}/${pageList.length} pages captured for ${date}.`);+ console.log(` Gallery: snapshots/current/index.html`);+ console.log(` Manifest: snapshots/current/manifest.json`);+ if (captured < pageList.length) {+ const missing = pageList.filter((p) => !Object.keys(p.shots).length).map((p) => p.path);+ console.log(` Missing: ${missing.join(', ')}`);+ }+}++main().catch((e) => {+ console.error(e);+ process.exit(1);+});diff --git a/scripts/snapshot-export-day.sh b/scripts/snapshot-export-day.shnew file mode 100755index 000000000..52022f9b4--- /dev/null+++ b/scripts/snapshot-export-day.sh@@ -0,0 +1,43 @@+#!/usr/bin/env bash+# snapshot-export-day.sh — recover a full daily snapshot set from git history.+#+# The daily snapshots live at stable paths (snapshots/current/) that are+# overwritten each run, so the working tree only ever holds the latest day.+# Every prior day is preserved in git history via that day's commit. This+# script checks out the snapshot set as it existed on (or just before) a given+# date and copies it to snapshots/exported/<date>/ so you can browse it.+#+# Usage: scripts/snapshot-export-day.sh 2026-06-05+#+set -euo pipefail++DATE="${1:-}"+if [[ -z "$DATE" ]]; then+ echo "usage: $0 <YYYY-MM-DD>" >&2+ exit 2+fi++ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"+cd "$ROOT"++# Last commit that touched the snapshot set on or before end-of-day DATE.+SHA="$(git log -1 --format=%H --before="${DATE} 23:59:59" -- snapshots/current || true)"+if [[ -z "$SHA" ]]; then+ echo "No snapshot commit found on or before ${DATE}." >&2+ exit 1+fi++OUT="snapshots/exported/${DATE}"+rm -rf "$OUT"+mkdir -p "$OUT"++# Materialise every snapshot file from that commit into the export dir.+git ls-tree -r --name-only "$SHA" -- snapshots/current | while read -r path; do+ rel="${path#snapshots/current/}"+ mkdir -p "$OUT/$(dirname "$rel")"+ git show "${SHA}:${path}" > "$OUT/$rel"+done++COMMIT_DATE="$(git show -s --format=%ci "$SHA")"+echo "Exported snapshot from commit ${SHA:0:10} (${COMMIT_DATE})"+echo " → ${OUT}/index.html"diff --git a/snapshots/README.md b/snapshots/README.mdnew file mode 100644index 000000000..b24603cec--- /dev/null+++ b/snapshots/README.md@@ -0,0 +1,45 @@+# Site snapshots++A daily visual record of how every page on three.ws looks, so we can always see+what a page looked like before a drastic redesign.++## Capture a snapshot++```bash+node scripts/page-snapshot.mjs # all public pages, desktop + mobile, against https://three.ws+node scripts/page-snapshot.mjs --desktop-only+node scripts/page-snapshot.mjs / /ibm /pay # just a few routes+BASE_URL=http://localhost:3000 node scripts/page-snapshot.mjs # snapshot a local build+```++or `npm run snapshot`.++Pages come from [`data/pages.json`](../data/pages.json) — the same manifest that+drives `/sitemap`, `llms.txt`, and the page audit. Add a page there and it's+snapshotted automatically. Auth-gated pages are skipped unless named explicitly.++## How it's stored (and why)++Screenshots are written to **stable paths** under `current/` and overwritten on+every run:++```+current/+ index.html ← open this: a browsable gallery of the latest set+ manifest.json ← machine-readable index, stamped with the capture date+ desktop/<slug>.jpg+ mobile/<slug>.jpg+```++The **archive is git history**. Committing `snapshots/` each day captures that+day; the working tree stays at ~one day's size instead of growing forever.++- Browse today: open `current/index.html`+- A page's history: `git log --follow -- snapshots/current/desktop/home.jpg`+- Recover a past day: `scripts/snapshot-export-day.sh 2026-06-05`+ (writes `exported/<date>/` — gitignored, just for viewing)++## Daily run++The capture script is wired and tested. The daily trigger (GitHub Action cron or+a scheduled agent) is added separately once the output is confirmed.diff --git a/snapshots/current/desktop/ibm.jpg b/snapshots/current/desktop/ibm.jpgnew file mode 100644index 000000000..a7353e9d4Binary files /dev/null and b/snapshots/current/desktop/ibm.jpg differdiff --git a/snapshots/current/index.html b/snapshots/current/index.htmlnew file mode 100644index 000000000..09be4e8cb--- /dev/null+++ b/snapshots/current/index.html@@ -0,0 +1,95 @@+<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8" />+<meta name="viewport" content="width=device-width, initial-scale=1" />+<title>three.ws — site snapshot 2026-06-05</title>+<style>+ :root { --bg:#0a0a0b; --panel:#141416; --line:#26262b; --fg:#f4f4f5; --mut:#9a9aa3; --accent:#e8e8ea; }+ * { box-sizing: border-box; }+ body { margin:0; background:var(--bg); color:var(--fg); font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,sans-serif; }+ header { position:sticky; top:0; z-index:10; background:rgba(10,10,11,.85); backdrop-filter:blur(12px); border-bottom:1px solid var(--line); padding:18px 24px; display:flex; align-items:baseline; gap:16px; flex-wrap:wrap; }+ header h1 { font-size:16px; margin:0; letter-spacing:-.01em; }+ header .meta { color:var(--mut); font-size:13px; }+ header .spacer { flex:1; }+ .toggle { display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; }+ .toggle button { background:transparent; color:var(--mut); border:0; padding:6px 14px; font:inherit; cursor:pointer; }+ .toggle button[aria-pressed="true"] { background:var(--accent); color:#0a0a0b; font-weight:600; }+ input[type=search] { background:var(--panel); border:1px solid var(--line); color:var(--fg); border-radius:8px; padding:7px 12px; font:inherit; min-width:220px; }+ main { padding:24px; }+ .section-title { color:var(--mut); text-transform:uppercase; letter-spacing:.08em; font-size:11px; margin:28px 0 12px; }+ .grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px; }+ .card { background:var(--panel); border:1px solid var(--line); border-radius:12px; overflow:hidden; transition:border-color .15s, transform .15s; }+ .card:hover { border-color:#3a3a42; transform:translateY(-2px); }+ .card a.shot { display:block; aspect-ratio:16/10; overflow:hidden; background:#000; border-bottom:1px solid var(--line); }+ .card a.shot img { width:100%; height:100%; object-fit:cover; object-position:top center; display:block; }+ .card .body { padding:11px 13px; }+ .card .t { font-weight:600; font-size:13px; margin:0 0 2px; }+ .card .p { color:var(--mut); font-size:12px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }+ .card.missing a.shot { display:flex; align-items:center; justify-content:center; color:var(--mut); font-size:12px; aspect-ratio:16/10; }+ .empty { color:var(--mut); padding:40px; text-align:center; }+</style>+</head>+<body>+<header>+ <h1>three.ws site snapshot</h1>+ <span class="meta" id="meta"></span>+ <span class="spacer"></span>+ <input type="search" id="q" placeholder="Filter pages…" aria-label="Filter pages" />+ <div class="toggle" role="group" aria-label="Viewport">+ <button id="vp-desktop" aria-pressed="true">Desktop</button>+ <button id="vp-mobile" aria-pressed="false">Mobile</button>+ </div>+</header>+<main id="main"></main>+<script>+const DATA = {"capturedAt":"2026-06-05T08:31:41.751Z","date":"2026-06-05","baseUrl":"https://three.ws","viewports":["desktop"],"pages":[{"path":"/","title":"/","section":"Selected","slug":"home","shots":{}},{"path":"/ibm","title":"/ibm","section":"Selected","slug":"ibm","shots":{"desktop":{"bytes":700364,"navStatus":200}}},{"path":"/pay","title":"/pay","section":"Selected","slug":"pay","shots":{}},{"path":"/three-live","title":"/three-live","section":"Selected","slug":"three-live","shots":{}},{"path":"/docs","title":"/docs","section":"Selected","slug":"docs","shots":{}}]};+let viewport = DATA.viewports.includes('desktop') ? 'desktop' : 'mobile';+let query = '';+const main = document.getElementById('main');+document.getElementById('meta').textContent =+ DATA.pages.length + ' pages · ' + DATA.baseUrl + ' · captured ' + new Date(DATA.capturedAt).toLocaleString();++function bySection() {+ const m = new Map();+ for (const p of DATA.pages) {+ if (query && !(p.path.toLowerCase().includes(query) || (p.title||'').toLowerCase().includes(query))) continue;+ if (!m.has(p.section)) m.set(p.section, []);+ m.get(p.section).push(p);+ }+ return m;+}+function render() {+ const groups = bySection();+ if (!groups.size) { main.innerHTML = '<div class="empty">No pages match "' + query + '".</div>'; return; }+ let html = '';+ for (const [section, pages] of groups) {+ html += '<div class="section-title">' + section + ' · ' + pages.length + '</div><div class="grid">';+ for (const p of pages) {+ const shot = p.shots && p.shots[viewport];+ const src = shot ? viewport + '/' + p.slug + '.jpg' : '';+ html += '<div class="card' + (shot ? '' : ' missing') + '">'+ + (shot+ ? '<a class="shot" href="' + src + '" target="_blank" rel="noopener"><img loading="lazy" src="' + src + '" alt="' + (p.title||p.path) + '"></a>'+ : '<a class="shot">not captured</a>')+ + '<div class="body"><p class="t">' + (p.title||p.path) + '</p><p class="p">' + p.path + '</p></div></div>';+ }+ html += '</div>';+ }+ main.innerHTML = html;+}+function setVp(v) {+ viewport = v;+ document.getElementById('vp-desktop').setAttribute('aria-pressed', String(v==='desktop'));+ document.getElementById('vp-mobile').setAttribute('aria-pressed', String(v==='mobile'));+ render();+}+document.getElementById('vp-desktop').onclick = () => setVp('desktop');+document.getElementById('vp-mobile').onclick = () => setVp('mobile');+if (!DATA.viewports.includes('desktop')) document.getElementById('vp-desktop').disabled = true;+if (!DATA.viewports.includes('mobile')) document.getElementById('vp-mobile').disabled = true;+document.getElementById('q').oninput = (e) => { query = e.target.value.trim().toLowerCase(); render(); };+render();+</script>+</body>+</html>\ No newline at end of filediff --git a/snapshots/current/manifest.json b/snapshots/current/manifest.jsonnew file mode 100644index 000000000..28d9ccb85--- /dev/null+++ b/snapshots/current/manifest.json@@ -0,0 +1,52 @@+{+ "capturedAt": "2026-06-05T08:31:41.751Z",+ "date": "2026-06-05",+ "baseUrl": "https://three.ws",+ "viewports": [+ "desktop"+ ],+ "pageCount": 5,+ "capturedCount": 1,+ "pages": [+ {+ "path": "/",+ "title": "/",+ "section": "Selected",+ "slug": "home",+ "shots": {}+ },+ {+ "path": "/ibm",+ "title": "/ibm",+ "section": "Selected",+ "slug": "ibm",+ "shots": {+ "desktop": {+ "bytes": 700364,+ "navStatus": 200+ }+ }+ },+ {+ "path": "/pay",+ "title": "/pay",+ "section": "Selected",+ "slug": "pay",+ "shots": {}+ },+ {+ "path": "/three-live",+ "title": "/three-live",+ "section": "Selected",+ "slug": "three-live",+ "shots": {}+ },+ {+ "path": "/docs",+ "title": "/docs",+ "section": "Selected",+ "slug": "docs",+ "shots": {}+ }+ ]+}\ No newline at end of filediff --git a/src/avatar-page.js b/src/avatar-page.jsindex 1be9e5c8b..ec03ca7ce 100644--- a/src/avatar-page.js+++ b/src/avatar-page.js@@ -58,7 +58,13 @@ let selectedModelId = 'auto';// Model choices surfaced in the chat dropdown. `auto` lets the server pick// based on which keys are configured (Anthropic → OpenRouter → Groq → OpenAI).const MODEL_OPTIONS = [- { id: 'auto', label: 'Auto', provider: null, model: null },+ { id: 'auto', label: 'Auto (GPT-OSS 120B)', provider: null, model: null },+ {+ id: 'openrouter:gpt-oss',+ label: 'GPT-OSS 120B (free)',+ provider: 'openrouter',+ model: 'openai/gpt-oss-120b:free',+ },{ id: 'anthropic:sonnet', label: 'Claude Sonnet 4.6', provider: 'anthropic', model: 'claude-sonnet-4-6' },{id: 'openrouter:llama-70b',@@ -66,12 +72,6 @@ const MODEL_OPTIONS = [provider: 'openrouter',model: 'meta-llama/llama-3.3-70b-instruct:free',},- {- id: 'openrouter:gpt-oss',- label: 'GPT-OSS 120B (free)',- provider: 'openrouter',- model: 'openai/gpt-oss-120b:free',- },{id: 'openrouter:hermes',label: 'Hermes 3 405B (free)',diff --git a/src/brain.js b/src/brain.jsindex b00241925..fdfb0fb76 100644--- a/src/brain.js+++ b/src/brain.js@@ -4,6 +4,7 @@ import { sanitizeUrl } from './shared/sanitize-url.js';// ── Provider registry ────────────────────────────────────────────────────────const PROVIDERS = [+ { key: 'gpt-oss-120b', label: 'GPT-OSS 120B', short: 'GPT-OSS', network: 'OpenAI · OpenRouter', color: '#a5b4fc', ctx: '128K', tier: 'Default' },{ key: 'claude-opus-4-7', label: 'Claude Opus 4.7', short: 'Opus 4.7', network: 'Anthropic', color: '#c8a96e', ctx: '200K', tier: 'Flagship' },{ key: 'claude-sonnet-4-6', label: 'Claude Sonnet 4.6', short: 'Sonnet 4.6', network: 'Anthropic', color: '#d4b87a', ctx: '200K', tier: 'Balanced' },{ key: 'claude-haiku-4-5', label: 'Claude Haiku 4.5', short: 'Haiku 4.5', network: 'Anthropic', color: '#e0c88a', ctx: '200K', tier: 'Fast' },@@ -54,8 +55,8 @@ const state = {authed: isAuthedHint(),playMode: 'compare',- focusKey: 'groq-llama',- active: new Set(['groq-llama', 'claude-sonnet-4-6', 'gpt-4o-mini', 'deepseek-r1']),+ focusKey: 'gpt-oss-120b',+ active: new Set(['gpt-oss-120b', 'groq-llama', 'claude-sonnet-4-6', 'gpt-4o-mini']),sessions: [],currentId: null,streaming: false,diff --git a/src/nich-agent.js b/src/nich-agent.jsindex ef1ffc5f1..898b35ee6 100644--- a/src/nich-agent.js+++ b/src/nich-agent.js@@ -898,12 +898,19 @@ function _escapeHTML(s) {.replace(/'/g, ''');}-// Model choices surfaced in the header dropdown. `auto` lets the server pick-// based on which keys are configured (Anthropic → OpenRouter → Groq → OpenAI).+// Model choices surfaced in the header dropdown. `auto` lets the server pick —+// which now resolves to GPT-OSS 120B on OpenRouter (the platform default, free),+// then Groq, then any configured paid keys. See api/_lib/chat-models.js.// Free OpenRouter entries are tool-call capable; Gemma/Qwen omitted because// their tool-calling is unreliable.const MODEL_OPTIONS = [- { id: 'auto', label: 'Auto', provider: null, model: null },+ { id: 'auto', label: 'Auto (GPT-OSS 120B)', provider: null, model: null },+ {+ id: 'openrouter:gpt-oss',+ label: 'GPT-OSS 120B (free)',+ provider: 'openrouter',+ model: 'openai/gpt-oss-120b:free',+ },{ id: 'anthropic:sonnet', label: 'Claude Sonnet 4.6', provider: 'anthropic', model: 'claude-sonnet-4-6' },{id: 'openrouter:llama-70b',@@ -911,12 +918,6 @@ const MODEL_OPTIONS = [provider: 'openrouter',model: 'meta-llama/llama-3.3-70b-instruct:free',},- {- id: 'openrouter:gpt-oss',- label: 'GPT-OSS 120B (free)',- provider: 'openrouter',- model: 'openai/gpt-oss-120b:free',- },{id: 'openrouter:hermes',label: 'Hermes 3 405B (free)',