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.

3.2 KB
Raw Blame
// One-off evidence script for the robinhood-chain campaign, work order 13
// (three.ws /play integration; retired, see git history).
// Drives a real headless Chromium against the local server/index.mjs (built
// dist/ + real api/** handlers, no mocks) to verify the Robinhood Chain /play
// integration end to end: the /worlds lobby renders the Robinhood Chain tab,
// and /temporary?coin=<real RH coin address> renders the world with zero
// console errors.

import { chromium } from 'playwright';

const BASE = process.env.BASE_URL || 'http://localhost:8080';
// Real Odyssey bonding-curve coin captured live during development.
const RH_COIN = process.argv[2] || '0x6b21b4567EfAd992B65f8a92457B45a74ed59486';

const errors = [];
const warnings = [];

async function run() {
	const browser = await chromium.launch({ headless: true });
	const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
	page.on('console', (msg) => {
		if (msg.type() === 'error') errors.push(`[${page.url()}] ${msg.text()}`);
		if (msg.type() === 'warning') warnings.push(`[${page.url()}] ${msg.text()}`);
	});
	page.on('pageerror', (err) => errors.push(`[pageerror ${page.url()}] ${err.message}`));

	console.log('--- /worlds lobby ---');
	await page.goto(`${BASE}/worlds`, { waitUntil: 'domcontentloaded', timeout: 30000 });
	await page.waitForTimeout(1500);
	const tabsVisible = await page.locator('#wl-tabs').isVisible().catch(() => false);
	const rhTabText = await page.locator('.wl-tab[data-chain="robinhood-chain"]').textContent().catch(() => null);
	console.log('tabs visible:', tabsVisible, '| RH tab label:', rhTabText);
	await page.locator('.wl-tab[data-chain="robinhood-chain"]').click().catch(() => {});
	await page.waitForTimeout(800);
	const worldsCount = await page.locator('#wl-worlds-count').textContent().catch(() => '');
	console.log('Robinhood tab world count text:', worldsCount);
	await page.screenshot({ path: '/tmp/claude-1000/-workspaces-three-ws/bbd67923-b6d3-4593-92c8-9acb04d85900/scratchpad/rh-worlds-lobby.png' });

	console.log('--- /temporary?coin=' + RH_COIN + ' (Robinhood world) ---');
	await page.goto(`${BASE}/temporary?coin=${RH_COIN}&name=E2ETester`, { waitUntil: 'domcontentloaded', timeout: 45000 });
	await page.waitForTimeout(6000); // let the scene boot + first trade poll land
	await page.screenshot({ path: '/tmp/claude-1000/-workspaces-three-ws/bbd67923-b6d3-4593-92c8-9acb04d85900/scratchpad/rh-world.png' });

	// Confirm the biome actually resolved to 'hoodchain' by checking the fog
	// color three.js applied to the scene (proves createWorldEnvironment ran
	// with our biome, not a generic fallback) — read it straight off the
	// window's exposed three.js scene if the app exposes one, else skip.
	const canvasPresent = await page.locator('canvas').first().isVisible().catch(() => false);
	console.log('world canvas visible:', canvasPresent);

	await browser.close();

	console.log('\n=== console errors:', errors.length, '===');
	for (const e of errors.slice(0, 30)) console.log(e);
	console.log('\n=== console warnings:', warnings.length, '(showing first 10) ===');
	for (const w of warnings.slice(0, 10)) console.log(w);
}

run().catch((err) => { console.error('FATAL', err); process.exit(1); });