Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

chore(repo): untrack the root debug scripts and stop new ones from being committed

nirholas210103451a5a
diff --git a/.atlas-dbg.mjs b/.atlas-dbg.mjs
deleted file mode 100644
index dacac97f9..000000000
--- a/.atlas-dbg.mjs
+++ /dev/null
@@ -1,18 +0,0 @@
-import { chromium } from 'playwright';
-const BASE = process.argv[2];
-const b = await chromium.launch();
-const p = await b.newPage();
-await p.goto(BASE + '/pricing', { waitUntil: 'domcontentloaded' });
-await p.waitForTimeout(2500);
-await p.keyboard.press('Control+k');
-await p.waitForSelector('.tws-atlas[data-open]');
-await p.waitForTimeout(50);
-console.log('t+50ms intents:', await p.locator('.tws-atlas-row[data-kind="intent"]').count(),
- 'skeletons:', await p.locator('.tws-atlas-skel').count());
-await p.waitForTimeout(700);
-console.log('t+750ms intents:', await p.locator('.tws-atlas-row[data-kind="intent"]').count());
-await p.fill('.tws-atlas-input', '/status');
-await p.waitForTimeout(300);
-console.log('rows:', JSON.stringify(await p.evaluate(() =>
- [...document.querySelectorAll('.tws-atlas-row')].slice(0,3).map(r => ({k:r.dataset.kind,h:r.dataset.href,s:r.getAttribute('aria-selected')})))));
-await b.close();
diff --git a/.cls-probe.mjs b/.cls-probe.mjs
deleted file mode 100644
index 927dc63ca..000000000
--- a/.cls-probe.mjs
+++ /dev/null
@@ -1,30 +0,0 @@
-import { chromium } from 'playwright';
-const url = process.argv[2];
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.addInitScript(() => {
- window.__shifts = [];
- new PerformanceObserver((l) => {
- for (const e of l.getEntries()) {
- if (e.hadRecentInput) continue;
- window.__shifts.push({
- value: e.value,
- t: Math.round(e.startTime),
- sources: (e.sources || []).map((s) => {
- const n = s.node;
- if (!n || !n.tagName) return '(detached)';
- return n.tagName.toLowerCase() + (n.id ? '#' + n.id : '') +
- (n.className && typeof n.className === 'string' ? '.' + n.className.trim().split(/\s+/).join('.') : '');
- }),
- });
- }
- }).observe({ type: 'layout-shift', buffered: true });
-});
-await p.goto(url, { waitUntil: 'load', timeout: 90000 });
-await p.waitForTimeout(8000);
-const shifts = await p.evaluate(() => window.__shifts);
-const total = shifts.reduce((a, s) => a + s.value, 0);
-console.log('URL', url, 'CLS', total.toFixed(4));
-shifts.sort((a, b) => b.value - a.value).slice(0, 10)
- .forEach((s) => console.log(' ', s.value.toFixed(4), '@' + s.t + 'ms', s.sources.slice(0, 3).join(' | ').slice(0, 160)));
-await b.close();
diff --git a/.cls-probe2.mjs b/.cls-probe2.mjs
deleted file mode 100644
index 65602b7c9..000000000
--- a/.cls-probe2.mjs
+++ /dev/null
@@ -1,29 +0,0 @@
-import { chromium } from 'playwright';
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.goto('https://three.ws/forge', { waitUntil: 'domcontentloaded', timeout: 90000 });
-const snap = () => p.evaluate(() => {
- const ex = document.getElementById('examples');
- if (!ex) return null;
- const rail = ex.closest('.forge-rail') || document.body;
- const out = [];
- const walk = (el, depth) => {
- if (depth > 3) return;
- for (const c of el.children) {
- const r = c.getBoundingClientRect();
- out.push({ k: c.tagName.toLowerCase() + (c.id ? '#' + c.id : '.' + String(c.className).trim().split(/\s+/)[0]), h: Math.round(r.height), y: Math.round(r.top) });
- walk(c, depth + 1);
- }
- };
- walk(rail, 0);
- return out;
-});
-await p.waitForTimeout(1200); const a = await snap();
-await p.waitForTimeout(7000); const c = await snap();
-const am = new Map(a.map((x, i) => [x.k + '#' + i, x]));
-const diffs = [];
-c.forEach((x, i) => { const o = am.get(x.k + '#' + i); if (o && (o.h !== x.h)) diffs.push({ k: x.k, from: o.h, to: x.h, dy: x.h - o.h }); });
-diffs.sort((x, y) => Math.abs(y.dy) - Math.abs(x.dy));
-console.log('Height changes in the forge rail between 1.2s and 8.2s:');
-diffs.slice(0, 15).forEach(d => console.log(' ', d.k, d.from + 'px ->' + d.to + 'px', '(' + (d.dy > 0 ? '+' : '') + d.dy + ')'));
-await b.close();
diff --git a/.cls-probe3.mjs b/.cls-probe3.mjs
deleted file mode 100644
index 6c3cf5735..000000000
--- a/.cls-probe3.mjs
+++ /dev/null
@@ -1,23 +0,0 @@
-import { chromium } from 'playwright';
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.goto('https://three.ws/marketplace', { waitUntil: 'domcontentloaded', timeout: 90000 });
-const snap = () => p.evaluate(() => {
- const out = [];
- document.querySelectorAll('body *').forEach((c) => {
- const r = c.getBoundingClientRect();
- if (!r.height && !r.width) return;
- const key = c.tagName.toLowerCase() + (c.id ? '#' + c.id : (c.className && typeof c.className === 'string' ? '.' + c.className.trim().split(/\s+/)[0] : ''));
- out.push({ key, h: Math.round(r.height), y: Math.round(r.top) });
- });
- return out;
-});
-await p.waitForTimeout(1200); const a = await snap();
-await p.waitForTimeout(7000); const c = await snap();
-const am = new Map(); a.forEach((x, i) => am.set(i, x));
-const grew = [];
-c.forEach((x, i) => { const o = am.get(i); if (o && o.key === x.key && o.h !== x.h) grew.push({ key: x.key, from: o.h, to: x.h, dy: x.h - o.h, y: o.y }); });
-grew.sort((x, y) => Math.abs(y.dy) - Math.abs(x.dy));
-console.log('Elements whose height changed between 1.2s and 8.2s (top 20):');
-grew.slice(0, 20).forEach(d => console.log(' y=' + d.y, d.key, d.from + '->' + d.to, (d.dy > 0 ? '+' : '') + d.dy));
-await b.close();
diff --git a/.cls-probe4.mjs b/.cls-probe4.mjs
deleted file mode 100644
index 1d3db98dd..000000000
--- a/.cls-probe4.mjs
+++ /dev/null
@@ -1,23 +0,0 @@
-import { chromium } from 'playwright';
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.goto('https://three.ws/forge', { waitUntil: 'domcontentloaded', timeout: 90000 });
-const snap = () => p.evaluate(() => {
- const ex = document.getElementById('examples');
- const cs = getComputedStyle(ex);
- return {
- h: Math.round(ex.getBoundingClientRect().height),
- n: ex.children.length,
- font: cs.fontFamily,
- labels: [...ex.children].map(c => c.textContent.trim().slice(0, 34)),
- widths: [...ex.children].map(c => Math.round(c.getBoundingClientRect().width)),
- fontsReady: document.fonts.status,
- };
-});
-await p.waitForTimeout(1200); const a = await snap();
-await p.waitForTimeout(7000); const c = await snap();
-console.log('T=1.2s h=' + a.h, 'chips=' + a.n, 'fonts=' + a.fontsReady);
-a.labels.forEach((l, i) => console.log(' ', String(a.widths[i]).padStart(4), l));
-console.log('T=8.2s h=' + c.h, 'chips=' + c.n, 'fonts=' + c.fontsReady);
-c.labels.forEach((l, i) => console.log(' ', String(c.widths[i]).padStart(4), l));
-await b.close();
diff --git a/.gitignore b/.gitignore
index 02e2ebd6c..7a5946c5b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -117,6 +117,14 @@ x402-test-wallets/
pump-sdk-case-study.html
.claude/scheduled_tasks.lock
threews-launch-week-case-study.html
+# Hidden one-off verification/debug scripts agents drop in the repo root. They
+# hardcode a single session's scratchpad path, so they are dead the moment that
+# session ends, and a `git add -A` sweep commits them permanently. A check that
+# is worth keeping belongs in scripts/ with a name and no session-local paths.
+# Matches the whole family (.verify-x.mjs, .probe-verify.mjs, .reel-probe4.mjs,
+# .atlas-dbg.mjs): a dotfile .mjs in the root is always one of these, never
+# config, so the pattern stays broad on purpose.
+/.*.mjs
# Temp working directories
.tmp/
diff --git a/.grow-probe.mjs b/.grow-probe.mjs
deleted file mode 100644
index 5da1889b0..000000000
--- a/.grow-probe.mjs
+++ /dev/null
@@ -1,15 +0,0 @@
-import { chromium } from 'playwright';
-const ids = process.argv.slice(3);
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.goto(process.argv[2], { waitUntil: 'domcontentloaded', timeout: 90000 });
-const snap = () => p.evaluate((ids) => Object.fromEntries(ids.map((id) => {
- const el = document.getElementById(id);
- if (!el) return [id, 'missing'];
- const r = el.getBoundingClientRect();
- return [id, { h: Math.round(r.height), hidden: el.hidden, kids: el.children.length }];
-})), ids);
-await p.waitForTimeout(400); const t0 = await snap();
-await p.waitForTimeout(9000); const t1 = await snap();
-for (const id of ids) console.log(id.padEnd(24), JSON.stringify(t0[id]), '->', JSON.stringify(t1[id]));
-await b.close();
diff --git a/.grow2.mjs b/.grow2.mjs
deleted file mode 100644
index 993139572..000000000
--- a/.grow2.mjs
+++ /dev/null
@@ -1,28 +0,0 @@
-import { chromium } from 'playwright';
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.goto('https://three.ws/marketplace', { waitUntil: 'domcontentloaded', timeout: 90000 });
-// Everything that sits above #market-grid in document order, keyed by a stable path.
-const snap = () => p.evaluate(() => {
- const grid = document.getElementById('market-grid');
- const out = {};
- const key = (el) => el.tagName.toLowerCase() + (el.id ? '#' + el.id : (typeof el.className === 'string' && el.className ? '.' + el.className.trim().split(/\s+/)[0] : ''));
- document.querySelectorAll('body > *, main > *, main > * > *').forEach((el) => {
- if (grid && (el.compareDocumentPosition(grid) & Node.DOCUMENT_POSITION_FOLLOWING) === 0) return;
- const r = el.getBoundingClientRect();
- out[key(el)] = Math.round(r.height);
- });
- out['@gridTop'] = grid ? Math.round(grid.getBoundingClientRect().top + scrollY) : -1;
- return out;
-});
-const times = [400, 1500, 3000, 6000, 9000];
-const snaps = [];
-let prev = 0;
-for (const t of times) { await p.waitForTimeout(t - prev); prev = t; snaps.push(await snap()); }
-const keys = [...new Set(snaps.flatMap(Object.keys))];
-for (const k of keys) {
- const row = snaps.map(s => s[k] === undefined ? '-' : s[k]);
- if (new Set(row).size > 1) console.log(k.padEnd(34), row.join(' -> '));
-}
-console.log('\n(columns = ' + times.map(t => t + 'ms').join(', ') + ')');
-await b.close();
diff --git a/.mkt-prod.mjs b/.mkt-prod.mjs
deleted file mode 100644
index 38ecec711..000000000
--- a/.mkt-prod.mjs
+++ /dev/null
@@ -1,11 +0,0 @@
-import { chromium } from 'playwright';
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.goto(process.argv[2] + '/marketplace', { waitUntil: 'load', timeout: 90000 });
-await p.waitForTimeout(3000);
-const st = await p.evaluate(() => [...document.querySelectorAll('.market-hero-slide')].map(s => {
- const mv = s.querySelector('model-viewer');
- return (mv?.getAttribute('src') ? 'src' : mv?.dataset.src ? 'deferred' : 'none');
-}));
-console.log(process.argv[2], 'hero slides:', JSON.stringify(st));
-await b.close();
diff --git a/.mkt-verify.mjs b/.mkt-verify.mjs
deleted file mode 100644
index d4a638e36..000000000
--- a/.mkt-verify.mjs
+++ /dev/null
@@ -1,28 +0,0 @@
-import { chromium } from 'playwright';
-const base = process.argv[2];
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-// Real marketplace data from production, local build under test.
-for (const pat of ['**/api/marketplace/**', '**/api/avatars/**', '**/api/explore*']) {
- await p.route(pat, async (route) => {
- const u = new URL(route.request().url());
- try {
- const r = await fetch('https://three.ws' + u.pathname + u.search);
- route.fulfill({ status: r.status, contentType: r.headers.get('content-type') || 'application/json', body: await r.text() });
- } catch { route.abort(); }
- });
-}
-const glb = [];
-p.on('request', (r) => { if (r.url().includes('.glb')) glb.push(r.url()); });
-await p.goto(base + '/marketplace', { waitUntil: 'load', timeout: 90000 });
-await p.waitForTimeout(3000);
-const st = await p.evaluate(() => {
- const slides = [...document.querySelectorAll('.market-hero-slide')];
- return {
- heroSlides: slides.length,
- heroWithSrc: slides.filter(s => s.querySelector('model-viewer')?.getAttribute('src')).length,
- heroDeferred: slides.filter(s => s.querySelector('model-viewer')?.dataset.src).length,
- };
-});
-console.log(base, JSON.stringify(st), 'glbRequests=' + glb.length);
-await b.close();
diff --git a/.mkt-verify2.mjs b/.mkt-verify2.mjs
deleted file mode 100644
index 8d8f05741..000000000
--- a/.mkt-verify2.mjs
+++ /dev/null
@@ -1,21 +0,0 @@
-import { chromium } from 'playwright';
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-for (const pat of ['**/api/marketplace/**', '**/api/avatars/**', '**/api/explore*']) {
- await p.route(pat, async (route) => {
- const u = new URL(route.request().url());
- try { const r = await fetch('https://three.ws' + u.pathname + u.search);
- route.fulfill({ status: r.status, contentType: r.headers.get('content-type') || 'application/json', body: await r.text() });
- } catch { route.abort(); }
- });
-}
-await p.goto('http://127.0.0.1:8099/marketplace', { waitUntil: 'load', timeout: 90000 });
-for (const t of [1500, 3000]) {
- await p.waitForTimeout(t === 1500 ? 1500 : 1500);
- const st = await p.evaluate(() => [...document.querySelectorAll('.market-hero-slide')].map(s => {
- const mv = s.querySelector('model-viewer');
- return { slot: s.dataset.slot, active: s.classList.contains('active'), src: !!mv?.getAttribute('src'), dataSrc: !!mv?.dataset.src, rotate: mv?.hasAttribute('auto-rotate') };
- }));
- console.log('t=' + t + 'ms', JSON.stringify(st));
-}
-await b.close();
diff --git a/.mv-probe.mjs b/.mv-probe.mjs
deleted file mode 100644
index dc3843dff..000000000
--- a/.mv-probe.mjs
+++ /dev/null
@@ -1,20 +0,0 @@
-import { chromium } from 'playwright';
-const url = process.argv[2];
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.goto(url, { waitUntil: 'load', timeout: 90000 });
-await p.waitForTimeout(6000);
-const r = await p.evaluate(() => {
- const mvs = [...document.querySelectorAll('model-viewer')];
- const vh = innerHeight;
- return {
- total: mvs.length,
- inViewport: mvs.filter(m => { const r = m.getBoundingClientRect(); return r.top < vh && r.bottom > 0; }).length,
- withSrc: mvs.filter(m => m.getAttribute('src')).length,
- withDataSrc: mvs.filter(m => m.dataset.src).length,
- canvases: document.querySelectorAll('canvas').length,
- domNodes: document.querySelectorAll('*').length,
- };
-});
-console.log(url, JSON.stringify(r, null, 1));
-await b.close();
diff --git a/.reel-probe4.mjs b/.reel-probe4.mjs
deleted file mode 100644
index b747d2036..000000000
--- a/.reel-probe4.mjs
+++ /dev/null
@@ -1,40 +0,0 @@
-import { chromium } from 'playwright';
-const browser = await chromium.launch({ args: ['--use-gl=swiftshader','--enable-unsafe-swiftshader','--ignore-gpu-blocklist'] });
-const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
-await page.goto('http://localhost:3000/forge', { waitUntil: 'domcontentloaded' });
-await page.waitForTimeout(3000);
-await page.evaluate(() => document.dispatchEvent(new CustomEvent('forge:open-creation', { detail: { creation: { id:'p', prompt:'probe', glb_url:'https://three.ws/avatars/default.glb', backend:'trellis_selfhost' } } })));
-await page.waitForFunction(() => document.getElementById('viewer')?.loaded === true, null, { timeout: 90000 });
-await page.waitForTimeout(1500);
-const out = await page.evaluate(async () => {
- const v = document.getElementById('viewer');
- const cs = [...v.shadowRoot.querySelectorAll('canvas')];
- const target = cs.find(x => x.id === 'webgl-canvas' && x.classList.contains('show')) || cs[0];
- const info = { picked: target.id || '(own)', cls: target.className, w: target.width, h: target.height };
-
- async function run(mode) {
- const stream = mode === 'fps' ? target.captureStream(30) : target.captureStream();
- const track = stream.getVideoTracks()[0];
- const rec = new MediaRecorder(stream, { mimeType: 'video/webm;codecs=vp8' });
- let total = 0, chunks = 0;
- rec.ondataavailable = e => { total += e.data.size; chunks++; };
- const done = new Promise(r => rec.onstop = r);
- rec.start(200);
- const t0 = performance.now();
- while (performance.now() - t0 < 1500) {
- await new Promise(r => requestAnimationFrame(r));
- const a = (performance.now() - t0) / 1500 * 360;
- v.cameraOrbit = `${a}deg 78deg auto`;
- v.jumpCameraToGoal?.();
- if (mode === 'manual') track.requestFrame?.();
- }
- rec.stop(); await done;
- for (const t of stream.getTracks()) t.stop();
- return { mode, total, chunks, hasRequestFrame: typeof track.requestFrame === 'function' };
- }
- info.fps = await run('fps');
- info.manual = await run('manual');
- return info;
-});
-console.log(JSON.stringify(out, null, 2));
-await browser.close();
diff --git a/.reel-verify.mjs b/.reel-verify.mjs
deleted file mode 100644
index 4fc916c5c..000000000
--- a/.reel-verify.mjs
+++ /dev/null
@@ -1,78 +0,0 @@
-// Real-browser verification of Forge Reel: load /forge, put a real model in the
-// result viewer, render an actual reel, and assert the produced files are real
-// bytes with the right magic numbers.
-import { chromium } from 'playwright';
-import { mkdirSync, writeFileSync } from 'node:fs';
-
-const OUT = '/tmp/claude-1000/-workspaces-three-ws/54abdcf2-c800-40d7-8c4b-205b55327f21/scratchpad/reel-shots';
-mkdirSync(OUT, { recursive: true });
-
-const errors = [];
-const browser = await chromium.launch({ args: ['--use-gl=swiftshader','--enable-unsafe-swiftshader','--ignore-gpu-blocklist'] });
-const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
-page.on('console', m => { if (m.type() === 'error') errors.push(m.text()); });
-page.on('pageerror', e => errors.push(`pageerror: ${e.message}`));
-
-page.setDefaultTimeout(120000);
-await page.goto('http://localhost:3210/forge', { waitUntil: 'domcontentloaded', timeout: 120000 });
-await page.waitForTimeout(3000);
-await page.evaluate(() => document.dispatchEvent(new CustomEvent('forge:open-creation', {
- detail: { creation: { id: 'verify-reel', prompt: 'a brass lantern', glb_url: 'https://three.ws/avatars/default.glb', backend: 'trellis_selfhost' } },
-})));
-await page.waitForFunction(() => document.getElementById('viewer')?.loaded === true, null, { timeout: 90000 });
-await page.waitForTimeout(1200);
-await page.screenshot({ path: `${OUT}/01-result.png` });
-
-console.log('trigger visible:', await page.isVisible('#reel-open'));
-await page.click('#reel-open');
-await page.waitForTimeout(400);
-await page.screenshot({ path: `${OUT}/02-dialog.png` });
-console.log('summary:', await page.textContent('.reel-summary'));
-
-await page.click('.reel-durations .reel-chip[data-id="4"]');
-await page.click('.reel-start');
-await page.waitForTimeout(2500);
-await page.screenshot({ path: `${OUT}/03-rendering.png` });
-console.log('phase:', await page.textContent('.reel-working-title'), '|', await page.textContent('.reel-clock'));
-
-await page.waitForSelector('.reel-done:not([hidden]) .reel-file, .reel-error-panel:not([hidden])', { timeout: 180000 });
-if (await page.isVisible('.reel-error-panel')) console.log('ERROR PANEL:', await page.textContent('.reel-error-text'));
-await page.waitForTimeout(1000);
-await page.screenshot({ path: `${OUT}/04-done.png` });
-
-const files = await page.evaluate(async () => {
- const rows = [...document.querySelectorAll('.reel-file')];
- const out = [];
- for (const row of rows) {
- const blob = await (await fetch(row.href)).blob();
- const buf = new Uint8Array(await blob.arrayBuffer());
- let b64 = '';
- for (let i = 0; i < buf.length; i += 8192) b64 += String.fromCharCode(...buf.subarray(i, i + 8192));
- out.push({ name: row.download, type: blob.type, size: blob.size, head: [...buf.slice(0, 12)], b64: btoa(b64) });
- }
- return out;
-});
-for (const f of files) {
- writeFileSync(`${OUT}/${f.name}`, Buffer.from(f.b64, 'base64'));
- console.log(`file ${f.name} type=${f.type} size=${f.size} magic=${f.head.map(b=>b.toString(16).padStart(2,'0')).join(' ')}`);
-}
-console.log('video element has src:', await page.evaluate(() => !!document.querySelector('.reel-video')?.src));
-
-await page.keyboard.press('Escape');
-await page.waitForTimeout(300);
-console.log('closed after Esc:', !(await page.isVisible('.reel-panel')));
-await page.keyboard.press('r');
-await page.waitForTimeout(300);
-console.log('reopened with R:', await page.isVisible('.reel-panel'));
-await page.keyboard.press('Escape');
-await page.waitForTimeout(300);
-
-await page.setViewportSize({ width: 320, height: 720 });
-await page.waitForTimeout(300);
-await page.click('#reel-open');
-await page.waitForTimeout(400);
-await page.screenshot({ path: `${OUT}/05-320.png` });
-console.log('320px overflow:', await page.evaluate(() => document.documentElement.scrollWidth > window.innerWidth + 1));
-
-console.log('console errors:', JSON.stringify(errors.filter(e => !/WebSocket|vite/i.test(e)), null, 2));
-await browser.close();
diff --git a/.req-probe.mjs b/.req-probe.mjs
deleted file mode 100644
index 2ff7621c1..000000000
--- a/.req-probe.mjs
+++ /dev/null
@@ -1,19 +0,0 @@
-import { chromium } from 'playwright';
-const url = process.argv[2];
-const watch = process.argv.slice(3);
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-const reqs = [];
-p.on('request', (r) => reqs.push(r.url()));
-await p.goto(url, { waitUntil: 'load', timeout: 90000 });
-await p.waitForTimeout(6000);
-const atLoad = reqs.length;
-console.log('--- at load+6s ---');
-for (const w of watch) console.log(' ', reqs.some(u => u.includes(w)) ? 'LOADED ' : 'deferred', w);
-console.log(' total requests:', atLoad);
-await p.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
-await p.waitForTimeout(6000);
-console.log('--- after scrolling to bottom ---');
-for (const w of watch) console.log(' ', reqs.some(u => u.includes(w)) ? 'LOADED ' : 'MISSING ', w);
-console.log(' total requests:', reqs.length);
-await b.close();
diff --git a/.req-probe2.mjs b/.req-probe2.mjs
deleted file mode 100644
index c8822aa03..000000000
--- a/.req-probe2.mjs
+++ /dev/null
@@ -1,27 +0,0 @@
-import { chromium } from 'playwright';
-const url = process.argv[2];
-const watch = process.argv.slice(3);
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-const reqs = [];
-p.on('request', (r) => reqs.push(r.url()));
-await p.goto(url, { waitUntil: 'load', timeout: 90000 });
-await p.waitForTimeout(5000);
-const report = (label) => {
- console.log('---', label, '(requests:', reqs.length + ')');
- for (const w of watch) console.log(' ', reqs.some(u => u.includes(w)) ? 'LOADED ' : 'deferred', w);
-};
-report('at load+5s');
-// Progressive scroll, the way a human reads the page.
-for (let i = 0; i < 40; i++) {
- await p.evaluate(() => window.scrollBy(0, innerHeight * 0.9));
- await p.waitForTimeout(350);
-}
-await p.waitForTimeout(4000);
-report('after progressive scroll to bottom');
-const vis = await p.evaluate(() => {
- const g = (id) => { const e = document.getElementById(id); if (!e) return 'absent'; const r = e.getBoundingClientRect(); return { h: Math.round(r.height), hidden: e.hidden, display: getComputedStyle(e).display }; };
- return { dragon: g('dragon-canvas-wrap'), community: g('home-community-forge') };
-});
-console.log('section state:', JSON.stringify(vis));
-await b.close();
diff --git a/.req-probe3.mjs b/.req-probe3.mjs
deleted file mode 100644
index c54592939..000000000
--- a/.req-probe3.mjs
+++ /dev/null
@@ -1,33 +0,0 @@
-import { chromium } from 'playwright';
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-// Serve the LOCAL build, but answer its data calls from production so the
-// community strip has the same real feed the deployed page sees.
-await p.route('**/api/forge-gallery*', async (route) => {
- const u = new URL(route.request().url());
- const r = await fetch('https://three.ws' + u.pathname + u.search);
- route.fulfill({ status: r.status, contentType: 'application/json', body: await r.text() });
-});
-const reqs = [];
-p.on('request', (r) => reqs.push(r.url()));
-const has = (w) => reqs.some(u => u.includes(w));
-await p.goto('http://127.0.0.1:8099/', { waitUntil: 'load', timeout: 90000 });
-await p.waitForTimeout(5000);
-console.log('at load+5s: model-viewer.min.js =', has('model-viewer.min.js') ? 'LOADED' : 'deferred',
- '| GLB fetches =', reqs.filter(u => u.endsWith('.glb')).length);
-const st = await p.evaluate(() => {
- const s = document.getElementById('home-community-forge');
- const t = document.getElementById('hcf-track');
- return { hidden: s?.hidden, cards: t?.children.length, posters: document.querySelectorAll('.hcf-poster').length, viewers: t?.querySelectorAll('model-viewer').length };
-});
-console.log('strip state at load:', JSON.stringify(st));
-// Scroll the strip into view.
-await p.evaluate(() => document.getElementById('home-community-forge')?.scrollIntoView());
-await p.waitForTimeout(6000);
-console.log('after scrolling to strip: model-viewer.min.js =', has('model-viewer.min.js') ? 'LOADED' : 'deferred');
-const st2 = await p.evaluate(() => {
- const t = document.getElementById('hcf-track');
- return { cards: t?.children.length, posters: document.querySelectorAll('.hcf-poster').length, viewers: t?.querySelectorAll('model-viewer').length };
-});
-console.log('strip state after:', JSON.stringify(st2));
-await b.close();
diff --git a/.req-probe4.mjs b/.req-probe4.mjs
deleted file mode 100644
index ca34657c2..000000000
--- a/.req-probe4.mjs
+++ /dev/null
@@ -1,24 +0,0 @@
-import { chromium } from 'playwright';
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.route('**/api/forge-gallery*', async (route) => {
- const u = new URL(route.request().url());
- const r = await fetch('https://three.ws' + u.pathname + u.search);
- route.fulfill({ status: r.status, contentType: 'application/json', body: await r.text() });
-});
-p.on('console', (m) => { if (m.type() === 'error') console.log(' [console.error]', m.text().slice(0, 160)); });
-p.on('pageerror', (e) => console.log(' [pageerror]', String(e).slice(0, 200)));
-await p.goto('http://127.0.0.1:8099/', { waitUntil: 'load', timeout: 90000 });
-await p.waitForTimeout(4000);
-const info = await p.evaluate(() => {
- const s = document.getElementById('home-community-forge');
- const r = s.getBoundingClientRect();
- const chain = [];
- for (let e = s; e && e !== document.body; e = e.parentElement) {
- const cs = getComputedStyle(e);
- chain.push(e.tagName.toLowerCase() + (e.id ? '#' + e.id : '.' + String(e.className).trim().split(/\s+/)[0]) + ' display=' + cs.display + ' vis=' + cs.visibility + ' h=' + Math.round(e.getBoundingClientRect().height));
- }
- return { rect: { top: Math.round(r.top), h: Math.round(r.height) }, chain, liteClass: document.documentElement.className };
-});
-console.log(JSON.stringify(info, null, 1));
-await b.close();
diff --git a/.req-probe5.mjs b/.req-probe5.mjs
deleted file mode 100644
index 334085d52..000000000
--- a/.req-probe5.mjs
+++ /dev/null
@@ -1,26 +0,0 @@
-import { chromium } from 'playwright';
-const b = await chromium.launch({ args: ['--no-sandbox'] });
-const p = await b.newPage({ viewport: { width: 1350, height: 940 } });
-await p.route('**/api/forge-gallery*', async (route) => {
- const u = new URL(route.request().url());
- const r = await fetch('https://three.ws' + u.pathname + u.search);
- route.fulfill({ status: r.status, contentType: 'application/json', body: await r.text() });
-});
-const reqs = [];
-p.on('request', (r) => reqs.push(r.url()));
-await p.goto('http://127.0.0.1:8099/', { waitUntil: 'load', timeout: 90000 });
-await p.waitForTimeout(4000);
-await p.evaluate(() => {
- const s = document.getElementById('home-community-forge');
- window.scrollTo({ top: s.getBoundingClientRect().top + scrollY - 200, behavior: 'instant' });
-});
-await p.waitForTimeout(7000);
-const st = await p.evaluate(() => {
- const s = document.getElementById('home-community-forge');
- const r = s.getBoundingClientRect();
- const t = document.getElementById('hcf-track');
- return { scrollY: Math.round(scrollY), sectionTop: Math.round(r.top), viewers: t.querySelectorAll('model-viewer').length, posters: document.querySelectorAll('.hcf-poster').length };
-});
-console.log('mv bundle requested:', reqs.some(u => u.includes('model-viewer.min.js')));
-console.log(JSON.stringify(st));
-await b.close();
diff --git a/.verify-conversions.mjs b/.verify-conversions.mjs
deleted file mode 100644
index 3e08d1a66..000000000
--- a/.verify-conversions.mjs
+++ /dev/null
@@ -1,187 +0,0 @@
-// Browser verification for /conversions.
-// Serves pages/conversions.html and src/conversions.js straight off disk through
-// a playwright route handler, so the check is immune to a dev server that other
-// agents keep restarting. API responses are REAL payloads captured from the
-// production database (scratchpad/buyer.json, seller.json).
-import { chromium } from 'playwright';
-import { readFileSync, existsSync } from 'node:fs';
-import { resolve } from 'node:path';
-
-const ROOT = '/workspaces/three.ws';
-const DIR = '/tmp/claude-1000/-workspaces-three-ws/ec60ca0e-93bf-42fe-96fb-7df45c0b9015/scratchpad';
-const BASE = 'https://local.test';
-const buyer = readFileSync(`${DIR}/buyer.json`, 'utf8');
-const seller = readFileSync(`${DIR}/seller.json`, 'utf8');
-
-const problems = [];
-const note = (s) => console.log(s);
-
-const MIME = { '.html': 'text/html', '.js': 'text/javascript', '.css': 'text/css', '.json': 'application/json' };
-
-async function newPage(browser, mode, viewport = { width: 1280, height: 900 }) {
- const ctx = await browser.newContext({ viewport, isMobile: viewport.width < 500, hasTouch: viewport.width < 500 });
- const page = await ctx.newPage();
- const noise = [];
- page.on('console', (m) => {
- if (m.type() !== 'error' && m.type() !== 'warning') return;
- // Chrome logs a console error for every non-2xx response. The 401 and 500
- // modes below induce those on purpose, and the page handles them; that
- // browser-native line is not noise from our code.
- if (/Failed to load resource/.test(m.text())) return;
- noise.push(`${m.type()}: ${m.text()}`);
- });
- page.on('pageerror', (e) => noise.push(`pageerror: ${e.message}`));
-
- await page.route('**/*', (route) => {
- const url = new URL(route.request().url());
- const path = url.pathname;
-
- if (path.startsWith('/api/marketplace/trial-status')) {
- const role = url.searchParams.get('role') || 'buyer';
- if (mode === 'signedout') return route.fulfill({ status: 401, contentType: 'application/json', body: '{"error":"unauthorized"}' });
- if (mode === 'error') return route.fulfill({ status: 500, contentType: 'application/json', body: '{"error":"boom","error_description":"The database is briefly unavailable."}' });
- if (mode === 'empty') {
- const body = role === 'seller'
- ? { data: { role: 'seller', queue: [], summary: { skillsWithTrials: 0, activeTrials: 0, warmLeads: 0, lastRun: 0, sold: 0, potential: { atomic: '0', decimals: 6, display: '0' } } } }
- : { data: { role: 'buyer', trials: [], summary: { active: 0, fresh: 0, runningLow: 0, exhausted: 0 } } };
- return route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(body) });
- }
- return route.fulfill({ status: 200, contentType: 'application/json', body: role === 'seller' ? seller : buyer });
- }
-
- if (path === '/conversions') {
- return route.fulfill({ status: 200, contentType: 'text/html', body: readFileSync(resolve(ROOT, 'pages/conversions.html'), 'utf8') });
- }
-
- // Real source files; anything else (nav, footer, i18n, fonts) is site
- // chrome this check does not exercise, so it resolves to an empty 200
- // rather than a 404 that would pollute the console-noise assertion.
- const onDisk = resolve(ROOT, path.replace(/^\//, ''));
- if (onDisk.startsWith(ROOT) && existsSync(onDisk) && !onDisk.endsWith('/')) {
- const ext = onDisk.slice(onDisk.lastIndexOf('.'));
- return route.fulfill({ status: 200, contentType: MIME[ext] || 'application/octet-stream', body: readFileSync(onDisk) });
- }
- return route.fulfill({ status: 200, contentType: path.endsWith('.js') ? 'text/javascript' : 'text/plain', body: '' });
- });
- return { ctx, page, noise };
-}
-
-const browser = await chromium.launch();
-
-// ── populated, keyboard, cache, url sync ─────────────────────────────────────
-{
- const { ctx, page, noise } = await newPage(browser, 'real');
- await page.goto(`${BASE}/conversions`, { waitUntil: 'domcontentloaded' });
- await page.waitForSelector('.cv-row', { timeout: 15000 });
-
- const rows = await page.locator('.cv-row').count();
- const stats = await page.locator('.stat-card .stat-val').allInnerTexts();
- const firstSkill = await page.locator('.cv-row .cv-skill').first().innerText();
- const pill = await page.locator('.cv-row .pill').first().innerText();
- const pips = await page.locator('.cv-row').first().locator('.meter-pip').count();
- const meterLabel = await page.locator('.cv-row').first().locator('.meter').getAttribute('aria-label');
- const cta = await page.locator('.cv-row .btn').first().innerText();
- note(`buyer: ${rows} rows | stats ${JSON.stringify(stats)} | first "${firstSkill}" [${pill}] | ${pips} pips | aria "${meterLabel}" | cta "${cta}"`);
- if (rows !== 114) problems.push(`buyer rendered ${rows} rows, expected 114`);
- if (!meterLabel) problems.push('meter has no aria-label');
-
- await page.locator('#tab-buyer').focus();
- await page.keyboard.press('ArrowRight');
- await page.waitForFunction(() => document.querySelector('#tab-seller')?.getAttribute('aria-selected') === 'true', null, { timeout: 8000 });
- await page.waitForSelector('.cv-metrics', { timeout: 15000 });
- const sRows = await page.locator('.cv-row').count();
- const sStats = await page.locator('.stat-card .stat-val').allInnerTexts();
- const metrics = await page.locator('.cv-row').first().locator('.cv-metric').allInnerTexts();
- const url = page.url();
- note(`seller: ${sRows} rows | stats ${JSON.stringify(sStats)} | metrics ${JSON.stringify(metrics)}`);
- note(`url after tab switch: ${url}`);
- if (sRows !== 3) problems.push(`seller rendered ${sRows} rows, expected 3`);
- if (!url.includes('role=seller')) problems.push(`url did not sync role: ${url}`);
- const focused = await page.evaluate(() => document.activeElement?.id);
- if (focused !== 'tab-seller') problems.push(`ArrowRight did not move focus (activeElement=${focused})`);
-
- await page.keyboard.press('ArrowLeft');
- await page.waitForFunction(() => document.querySelectorAll('.cv-row').length === 114, null, { timeout: 8000 });
- const backUrl = page.url();
- if (backUrl.includes('role=seller')) problems.push(`url did not clear role on return: ${backUrl}`);
- note('cache: ArrowLeft restored the buyer view instantly and cleared the query param');
-
- const ring = await page.evaluate(() => {
- const b = document.querySelector('.cv-row .btn');
- b.focus();
- const s = getComputedStyle(b);
- return `${s.outlineStyle} ${s.outlineWidth}`;
- });
- note(`focus-visible ring on row CTA: ${ring}`);
-
- await page.screenshot({ path: `${DIR}/shot-buyer.png` });
- if (noise.length) problems.push(`console noise: ${noise.slice(0, 5).join(' | ')}`);
- await ctx.close();
-}
-
-// ── empty / signed out / error ───────────────────────────────────────────────
-for (const mode of ['empty', 'signedout', 'error']) {
- const { ctx, page, noise } = await newPage(browser, mode);
- await page.goto(`${BASE}/conversions`, { waitUntil: 'domcontentloaded' });
- await page.waitForSelector('.cv-state', { timeout: 15000 });
- const heading = await page.locator('.cv-state h2').innerText();
- const body = await page.locator('.cv-state p').innerText();
- const cta = await page.locator('.cv-state .btn').count();
- note(`${mode}: "${heading}" | cta=${cta} | ${body.slice(0, 72)}…`);
- if (!heading) problems.push(`${mode}: no heading`);
- if (!cta) problems.push(`${mode}: no call to action`);
- if (mode === 'error') {
- await page.locator('#cv-retry').click();
- await page.waitForSelector('.cv-state.is-error', { timeout: 8000 });
- note('error: retry re-issues the request and re-renders');
- }
- if (mode === 'empty') {
- await page.locator('#tab-seller').click();
- await page.waitForFunction(
- () => document.querySelector('.cv-state h2')?.textContent?.includes('your skills'),
- null,
- { timeout: 8000 },
- );
- note(`empty(seller): "${await page.locator('.cv-state h2').innerText()}"`);
- }
- if (noise.length) problems.push(`${mode} console noise: ${noise.slice(0, 3).join(' | ')}`);
- await ctx.close();
-}
-
-// ── mobile ───────────────────────────────────────────────────────────────────
-{
- const { ctx, page, noise } = await newPage(browser, 'real', { width: 390, height: 844 });
- await page.goto(`${BASE}/conversions`, { waitUntil: 'domcontentloaded' });
- await page.waitForSelector('.cv-row', { timeout: 15000 });
- const overflow = await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
- const tabH = await page.evaluate(() => document.querySelector('.role-tab').getBoundingClientRect().height);
- note(`mobile 390px: horizontal overflow ${overflow}px | tab height ${Math.round(tabH)}px`);
- if (overflow > 0) problems.push(`mobile overflows by ${overflow}px`);
- if (tabH < 32) problems.push(`mobile tab is ${tabH}px tall, below a comfortable touch target`);
- await page.screenshot({ path: `${DIR}/shot-mobile.png` });
- if (noise.length) problems.push(`mobile console noise: ${noise.slice(0, 3).join(' | ')}`);
- await ctx.close();
-}
-
-// ── light theme ──────────────────────────────────────────────────────────────
-{
- const { ctx, page } = await newPage(browser, 'real');
- await page.addInitScript(() => localStorage.setItem('twx_theme', 'light'));
- await page.goto(`${BASE}/conversions`, { waitUntil: 'domcontentloaded' });
- await page.waitForSelector('.cv-row', { timeout: 15000 });
- const theme = await page.evaluate(() => document.documentElement.getAttribute('data-theme'));
- const bg = await page.evaluate(() => getComputedStyle(document.body).backgroundColor);
- note(`light theme: data-theme=${theme} body bg ${bg}`);
- if (theme !== 'light') problems.push(`light theme did not apply (data-theme=${theme})`);
- await page.screenshot({ path: `${DIR}/shot-light.png` });
- await ctx.close();
-}
-
-await browser.close();
-
-if (problems.length) {
- console.log(`\nFAIL (${problems.length}):`);
- for (const p of problems) console.log(` - ${p}`);
- process.exit(1);
-}
-console.log('\nPASS: every state rendered, keyboard works, no console noise, no mobile overflow, light theme applies');