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: enhance community chat error handling and avatar loading
nirholasaf8574f1ed98
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e9bf27681..15305051a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -9,14 +9,23 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **AR Forge** (`/ar`) — Type a prompt, get a real 3D model, and place it in your room: free text-to-3D with one-tap AR on any phone (WebXR, Scene Viewer, Quick Look) and a QR handoff from desktop.- **Docs · Sketchfab Showcase** (`/docs/sketchfab`) — How the best community forge models get published to the official three.ws Sketchfab account: what gets picked, AI disclosure, and the backlinks that make referrals measurable.- **End-User License Agreement** (`/legal/eula`) — License terms for the three.ws Seeker/Saga app.+- **"Deploy onchain" now opens the real deploy flow with your model loaded** — After forging a model, the "Deploy onchain" shortcut used to drop you on Launchpad Studio (the white-label site builder), which ignored your model entirely. It now opens the on-chain deploy wizard with your model and its name already filled in, so you go straight from forge to a permanent on-chain agent identity. The search palette's "Launch a coin" action was also mispointed and now opens the pump.fun coin launch flow. (`/deploy`) `[fix]`+- **3D previews stop erroring on the scanner and every plain page footer** — The walking robot in the site footer failed to appear on plain pages like /hydrate and /login because its compressed 3D model needed a decoder the page never loaded; the decoder is now wired in before the viewer starts, so the robot renders everywhere. The 3D scanner also downloaded a 748KB placeholder avatar the moment the page opened, even for visitors who never started a scan, and logged a fetch error on every visit to the old /scan address; the placeholder now loads only when the build step is actually on screen, and if its download ever fails the progress view stays clean instead of showing a dead black panel. (`/create/selfie`) `[fix]`+- **Agent and coin art always renders on the Activity and Deployments feeds** — Avatars on the /activity trading floor and the /deployments on-chain feed come from wherever the agent's creator hosted them, and browsers were silently blocking many of those hosts (IPFS gateways serving metadata instead of an image, dead image servers), leaving blank tiles and repeated failed requests. Every third-party image now loads through the platform's own image resolver, which finds the real artwork across multiple IPFS gateways and shows a clean generated placeholder when the original is truly gone. (`/activity`) `[fix]`- **Agent brains upgraded to the newest OpenAI models** — Every OpenAI-powered surface on the platform now runs the GPT-5.6 family released this month. The Brain page and agent model pickers offer three tiers: Sol (flagship reasoning), Terra (balanced), and Luna (fast and cost-efficient), each with a 1M-token context window, up from 128K. Vision fallbacks, the copilot, widgets, and the marketplace default to Luna, and anything still pointed at the retired GPT-4o models is transparently upgraded, so nothing breaks and every answer gets smarter. (`/brain`) `[improvement]`- **AR Forge: type a prompt, place the model in your room** — A new mobile-first app at /ar turns a one-line prompt into a real, downloadable 3D model on the free generation lane, then puts it in your space with one tap: WebXR or Scene Viewer on Android, Quick Look on iPhone. On a desktop it shows a QR code that hands the finished model straight to your phone's camera app, and every creation gets a shareable viewer link. No account, no payment, fair-use rate limits only. (`/ar`) `[feature]`+- **Cleaner pages: sitemap header fits, stray glow clipped, quieter console** — A site-wide polish pass on cosmetic issues found in a full-site sweep. The /sitemap page now uses the standard site header instead of a cramped custom top bar that pushed the navigation past the right edge of the screen. The walk companion's caption bubble and the decorative glow on /x402-revenue are both capped so they can never spill outside the viewport or cause sideways scrolling. The companion's expected avatar fallback (a non-humanoid model handing off to the robot) no longer prints a warning on every page view, and the live demo frames on /labs and /integrations no longer trigger a browser sandbox warning. (`/sitemap`) `[fix]`+- **Coin Clash, coin worlds, and the sign-in page fail gracefully** — When the community battle service is offline, /clash and the /temporary world picker used to keep retrying and logging failed requests in the background. Both now recognize the outage on the first response, stop polling, and show a clear notice with live places to go instead (launches, markets, or walking the default world solo). The sign-in page also no longer throws a background error if its 3D greeter can't load; the form works exactly the same without him. (`/clash`) `[fix]`- **IRL placement grows up: true AR anchoring leads the dock, and you can pinch-resize your agent** — Placing an avatar in the real world through /irl now feels like a native AR app. On phones with a real AR surface the new Place in AR button leads the dock: a floor-finding reticle, a tap to anchor the agent to the actual detected surface, and now a two-finger pinch to resize it live, from a 25% desk figurine to a 400% statue. The size you choose saves with the pin, so everyone who walks up sees your agent exactly where and how big you left it. iPhones open the same placement in ARKit Quick Look. The compass-and-GPS pin path is unchanged and remains the fallback everywhere else. (`/irl`) `[feature, improvement]`- **New doc: IRL, agents in the real world** — The IRL layer finally has a front door in the docs: one page that explains the whole vision and how the shipped pieces fit together. It covers placing an agent at a real GPS spot from your phone, walk-up discovery with proof of presence, paying agents in person via x402, Money Drops (real SOL, USDC, or $THREE escrowed at a place and claimable only by walking up), World Lines (agent-signed proofs that you were really there), and the privacy model that makes it all safe. The docs sidebar now also links the hands-on IRL tutorial, which was previously unreachable from the navigation. (`/docs/irl`) `[docs]`- **Shared 3D viewer links load again** — Opening a shared model link at /viewer could hang on the loading spinner forever even though the model file itself was fine. The viewer now reveals the model as soon as it finishes rendering, and if a model genuinely cannot display, you get a clear message and a working download button instead of an endless spinner. (`/viewer`) `[fix]`+- **The Agora and City worlds survive OpenStreetMap outages** — The 3D city on /agora and /city is built from live OpenStreetMap data, and a single overloaded map server used to mean an empty world with no buildings. Map data now fails over across three independent OpenStreetMap mirrors, and if every mirror is down the world rebuilds from the last map snapshot saved in your browser, so Manhattan stays standing even when the map providers do not. (`/agora`) `[fix, improvement]`- **The AR placement button is visible again on /irl** — On phones, the strip of actions under the camera view had quietly scrolled itself past its own first button, so "Place in AR" (the one-tap way to stand your agent on a real floor) sat just off the left edge of the screen, where almost nobody would swipe back to find it. The strip now opens on its true first action, so AR placement leads the row as intended. Every other control on the page was re-checked for overlap at phone, small-phone, and landscape sizes: nothing is covering anything else. (`/irl`) `[fix]`- **The best community models now go to Sketchfab** — The best forge models are now published to the official three.ws account on Sketchfab, the largest public 3D model site: weekly Forge-Off winners first, then top-voted board models, then creations their makers explicitly accepted. It is a curated showcase, not a firehose: a few validated models a week, each clearly tagged as AI-generated, with its generation prompt and a link back to the creation on three.ws so anyone who finds it can remix it or forge their own. Every link is tagged so we can measure how many visitors the showcase actually brings in. (`/docs/sketchfab`) `[feature]`+- **The trade terminal stops throwing 404s and rides out RPC outages** — The deep-dive on /trades asked the platform for holder cohorts and a smart-money score on every coin, including coins three.ws never launched or scored, so the browser logged a guaranteed failed request for almost every selection. Both panels now know the difference between "no data exists for this coin" and a real error: unscored coins get an honest "not scored yet" card that links to the Smart Money radar, and coins launched elsewhere get a direct link to their on-chain holder list. Live price and bonding-curve reads also became outage-proof: when every Solana RPC provider fails at once, the terminal serves the last real curve data it saw (clearly marked stale) instead of a server error and a blank strip. (`/trades`) `[fix, improvement]`- **Tour and Walk SDK update: switch between Stroll and Platformer from the tour controls** — Embedded tours built with the Tour Builder now include a labeled Stroll / Platformer toggle right in the tour controls next to Exit, so visitors can switch how they explore (tap it or press M) instead of hunting for a hidden corner button. Published as @three-ws/walk 0.2.1 and @three-ws/tour 0.5.1 on npm; the Tour Builder's exported embed snippet now uses the new versions automatically, and also picks up the latest @three-ws/page-agent with its five persona presets. (`/tour-builder`) `[sdk, improvement]`+- **Vanity wallet page loads cleanly again** — Opening /vanity-wallet on desktop threw two script errors the moment the page loaded, which broke the sealed-drop claim and gifting features on that page. The page now ships fully bundled code, so it loads without errors and every feature on it, from the in-browser grinder to sealed drops, works as intended. (`/vanity-wallet`) `[fix]`+- **Wallet and session lists load again across the dashboard** — Signed-in pages that show your linked wallets or active sessions (wallets, account, settings, sessions, voice, and more) were failing to load their lists because the server rejected the request outright. The lists now load correctly, and the settings page's revoke-all-other-sessions button now actually revokes them. The BNB hub page also no longer fires a failing request on every visit. (`/dashboard/wallets`) `[fix]`- **Your profile no longer asks you to sign in when you already are** — New creators who finished making an avatar and tapped "See your profile" were greeted by a sign-in wall, even while signed in. The cause: profile pages live at your @handle, and fresh accounts don't have one yet. That dead end is now a one-field claim screen: pick your handle (we suggest one from your name), press Claim, and you land straight on your new public portfolio at three.ws/u/yourname. And if you really are signed out, the sign-in link now brings you back to your profile afterward instead of dropping you on the dashboard. (`/profile`) `[fix, improvement]`## 2026-07-13diff --git a/api/_lib/launcher-trends.js b/api/_lib/launcher-trends.jsindex bf55e81a3..ca39ede6e 100644--- a/api/_lib/launcher-trends.js+++ b/api/_lib/launcher-trends.js@@ -556,7 +556,7 @@ export async function rankNarratives({ network = 'mainnet', sources, categoriesfor (const r of rows) {const term = String(r.term || '').trim();if (!term) continue;- const ck = `${id} ${term}`;+ const ck = `${id}\u0000${term}`;const already = contributed.get(ck) || 0;if (already >= PER_SOURCE_TERM_CAP) continue;const add = Math.min((Number(r.weight) || 0.6) * sw, PER_SOURCE_TERM_CAP - already);diff --git a/api/_lib/pump-curve-view.js b/api/_lib/pump-curve-view.jsindex 1c5eea23d..74976cb28 100644--- a/api/_lib/pump-curve-view.js+++ b/api/_lib/pump-curve-view.js@@ -39,6 +39,24 @@ export function isPlausibleMint(s) {return /^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(s);}+// Last good curve view per network:mint, kept so an RPC flake degrades the read+// to slightly-old real data instead of an unhandled 500. Same serve-stale tier+// as api/pump/price-history: never fabricated, only ever a body a healthy read+// really produced.+const _lastGood = new Map(); // `${network}:${mint}` → { body, at }+const STALE_MAX_MS = 10 * 60_000;++function rememberGood(network, mint, body) {+ _lastGood.set(`${network}:${mint}`, { body, at: Date.now() });+ if (_lastGood.size > 256) _lastGood.delete(_lastGood.keys().next().value);+}++function recallGood(network, mint) {+ const hit = _lastGood.get(`${network}:${mint}`);+ if (!hit || Date.now() - hit.at > STALE_MAX_MS) return null;+ return hit;+}+async function jupiterPriceFallback(mint) {try {const r = await fetch(`https://lite-api.jup.ag/price/v3?ids=${mint}`, { signal: AbortSignal.timeout(6000) });@@ -93,14 +111,39 @@ export async function getCurveView({ mint, network = 'mainnet' }) {}const rpc = rpcFallbackFromEnv({ network });- const result = await rpc.withFallback(async (connection) => {- const [curve, price, grad] = await Promise.all([- getBondingCurveState(connection, mint),- getTokenPrice(connection, mint),- getGraduationProgress(connection, mint),- ]);- return { curve, price, graduation: grad };- });+ let result;+ try {+ result = await rpc.withFallback(async (connection) => {+ const [curve, price, grad] = await Promise.all([+ getBondingCurveState(connection, mint),+ getTokenPrice(connection, mint),+ getGraduationProgress(connection, mint),+ ]);+ return { curve, price, graduation: grad };+ });+ } catch (err) {+ // Every RPC lane failed. That is an upstream outage, not an answer about+ // the coin, so degrade like price-history does: serve the last good view+ // for this mint marked stale, else a well-formed 502 the clients' existing+ // error states already render.+ console.error('[pump-curve-view] all RPC lanes failed', err?.message);+ const stale = recallGood(network, mint);+ if (stale) {+ return {+ httpStatus: 200,+ cacheControl: 'public, max-age=10, s-maxage=10',+ body: { ...stale.body, stale: true, as_of: Math.floor(stale.at / 1000) },+ };+ }+ return {+ httpStatus: 502,+ cacheControl: null,+ body: {+ error: 'upstream_error',+ error_description: 'bonding-curve state is temporarily unavailable for this mint',+ },+ };+ }if (!result.curve) {// No on-chain bonding curve account. Two cases to disambiguate:@@ -114,18 +157,20 @@ export async function getCurveView({ mint, network = 'mainnet' }) {const graduatedPrice = await jupiterPriceFallback(mint);if (graduatedPrice) {const marketCapUsd = graduatedPrice.priceUsd * PUMP_TOTAL_SUPPLY;+ const body = {+ mint,+ network,+ curve: null,+ graduated: true,+ price: null,+ graduation: { isGraduated: true, progressBps: 10_000 },+ graduatedPrice: { ...graduatedPrice, marketCapUsd },+ };+ rememberGood(network, mint, body);return {httpStatus: 200,cacheControl: 'public, max-age=15, s-maxage=30, stale-while-revalidate=60',- body: {- mint,- network,- curve: null,- graduated: true,- price: null,- graduation: { isGraduated: true, progressBps: 10_000 },- graduatedPrice: { ...graduatedPrice, marketCapUsd },- },+ body,};}return {@@ -151,17 +196,19 @@ export async function getCurveView({ mint, network = 'mainnet' }) {}}+ const body = {+ mint,+ network,+ curve: result.curve,+ ...(curveComplete ? { graduated: true } : {}),+ price: pricePayload,+ graduation: result.graduation ? serializeBNs(result.graduation) : null,+ ...(graduatedPrice ? { graduatedPrice } : {}),+ };+ rememberGood(network, mint, body);return {httpStatus: 200,cacheControl: 'public, max-age=5, s-maxage=10, stale-while-revalidate=30',- body: {- mint,- network,- curve: result.curve,- ...(curveComplete ? { graduated: true } : {}),- price: pricePayload,- graduation: result.graduation ? serializeBNs(result.graduation) : null,- ...(graduatedPrice ? { graduatedPrice } : {}),- },+ body,};}diff --git a/api/_mcp-studio/component.js b/api/_mcp-studio/component.jsindex 35de63713..58960c5b2 100644--- a/api/_mcp-studio/component.js+++ b/api/_mcp-studio/component.js@@ -14,6 +14,8 @@// (a client-side revert view — every version's GLB is already in the lineage).// No identifiers, no payment, no crypto — only what is needed to show the model.+import { env } from '../_lib/env.js';+const MODEL_VIEWER_CDN ='https://cdn.jsdelivr.net/npm/@google/[email protected]/dist/model-viewer.min.js';@@ -262,22 +264,176 @@ export const COMPONENT_URI = 'ui://widget/three-studio-model.html';// Established Apps SDK skybridge MIME for HTML widget resources.export const COMPONENT_MIME = 'text/html+skybridge';+// The public origin generated GLBs are actually served from (the R2 public+// bucket, e.g. https://pub-<hash>.r2.dev). ChatGPT ENFORCES the widget CSP+// inside its sandbox, so leaving this origin out blocks every model fetch and+// the widget error-states on 100% of generations — even though the same widget+// works in permissive test harnesses. Resolved lazily because S3_PUBLIC_DOMAIN+// is a required-env getter (throws when storage isn't configured, e.g. tests).+function glbStorageOrigin() {+ try {+ let v = env.S3_PUBLIC_DOMAIN;+ if (!/^https?:\/\//i.test(v)) v = `https://${v}`;+ const origin = new URL(v).origin;+ return origin.startsWith('https://') ? origin : null;+ } catch {+ return null;+ }+}+// CSP for the widget iframe: where it may connect (fetch GLBs) and load resources// (the model-viewer script + GLB assets). Declared on the resource _meta so the-// ChatGPT host can enforce it.-export const COMPONENT_CSP = {- connect_domains: [+// ChatGPT host can enforce it. Built per-read so the storage origin tracks env.+export function componentCsp() {+ const domains = ['https://three.ws','https://*.three.ws','https://cdn.jsdelivr.net','https://replicate.delivery','https://*.replicate.delivery',- ],- resource_domains: [- 'https://three.ws',- 'https://*.three.ws',- 'https://cdn.jsdelivr.net',- 'https://replicate.delivery',- 'https://*.replicate.delivery',- ],-};+ ];+ const storage = glbStorageOrigin();+ if (storage && !domains.includes(storage)) domains.push(storage);+ return { connect_domains: [...domains], resource_domains: [...domains] };+}++// ── persona widget ──────────────────────────────────────────────────────────+//+// ChatGPT only renders a widget when the TOOL's _meta["openai/outputTemplate"]+// points at a registered ui:// resource — a result-level template on an inline+// artifact is ignored, so the persona tools rendered nothing there. This widget+// closes that gap: it reads the persona structuredContent (embed_url, name,+// status) and mounts the hosted embodiment embed — the same living body the+// inline artifact shows in other MCP hosts. frame_domains opts the widget into+// framing the app origin.++export const PERSONA_COMPONENT_HTML = `<!doctype html>+<html lang="en">+<head>+<meta charset="utf-8" />+<meta name="viewport" content="width=device-width, initial-scale=1" />+<title>three.ws living agent</title>+<style>+ :root { color-scheme: dark; }+ * { box-sizing: border-box; }+ html, body { margin: 0; height: 100%; }+ body {+ font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;+ background: radial-gradient(120% 120% at 50% 0%, #1a1a24 0%, #0c0c12 70%);+ color: #e8eaf0;+ }+ .wrap { position: relative; width: 100%; height: 100%; min-height: 420px; }+ iframe { width: 100%; height: 100%; border: 0; display: block; opacity: 0; transition: opacity .3s ease; }+ iframe.ready { opacity: 1; }+ @media (prefers-reduced-motion: reduce) { iframe { transition: none; } }+ .overlay {+ position: absolute; inset: 0;+ display: flex; flex-direction: column; align-items: center; justify-content: center;+ gap: 12px; text-align: center; padding: 24px;+ }+ .spinner {+ width: 34px; height: 34px; border-radius: 50%;+ border: 3px solid rgba(255,255,255,0.14); border-top-color: #a78bfa;+ animation: spin 0.9s linear infinite;+ }+ @keyframes spin { to { transform: rotate(360deg); } }+ @media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }+ .title { font-size: 14px; font-weight: 600; }+ .muted { color: #9aa3b2; font-size: 13px; line-height: 1.45; max-width: 38ch; }+ .name {+ position: absolute; left: 12px; bottom: 10px;+ font-size: 12px; font-weight: 600; color: #cbd5e1;+ background: rgba(12,12,18,0.66); border: 1px solid rgba(255,255,255,0.1);+ border-radius: 999px; padding: 4px 11px; backdrop-filter: blur(6px);+ }+ .hidden { display: none !important; }+</style>+</head>+<body>+<div class="wrap">+ <iframe id="stage" title="Live agent" allow="autoplay"+ sandbox="allow-scripts allow-same-origin allow-popups"></iframe>+ <span id="name" class="name hidden"></span>++ <div id="loading" class="overlay">+ <div class="spinner" aria-hidden="true"></div>+ <div class="title">Waking your agent…</div>+ <div class="muted">The living body loads, then idles between turns and lip-syncs each reply.</div>+ </div>++ <div id="empty" class="overlay hidden">+ <div class="title">No agent yet</div>+ <div class="muted">Create one with create_agent_persona from a rigged model (forge_avatar makes one), or reload a saved persona_id.</div>+ </div>++ <div id="error" class="overlay hidden">+ <div class="title">Couldn't load the agent</div>+ <div id="errmsg" class="muted">Something went wrong bringing this persona to life.</div>+ </div>+</div>++<script>+(function () {+ var stage = document.getElementById('stage');+ var nameEl = document.getElementById('name');+ var loading = document.getElementById('loading');+ var empty = document.getElementById('empty');+ var errEl = document.getElementById('error');+ var errMsg = document.getElementById('errmsg');++ function show(el) { [loading, empty, errEl].forEach(function (n) { n.classList.add('hidden'); }); if (el) el.classList.remove('hidden'); }++ function isHttps(u) { return typeof u === 'string' && /^https:\\/\\//.test(u); }++ function render(out) {+ if (!out) { show(empty); return; }+ if (out.error) {+ errMsg.textContent = out.message || 'Something went wrong bringing this persona to life.';+ show(errEl);+ return;+ }+ var url = out.embed_url;+ if (!isHttps(url)) { show(empty); return; }+ if (out.name) { nameEl.textContent = out.name; nameEl.classList.remove('hidden'); }+ if (stage.getAttribute('src') !== url) {+ show(loading);+ stage.classList.remove('ready');+ stage.setAttribute('src', url);+ }+ }++ stage.addEventListener('load', function () {+ if (!stage.getAttribute('src')) return;+ show(null);+ stage.classList.add('ready');+ });++ function current() {+ try { return (window.openai && window.openai.toolOutput) || null; } catch (e) { return null; }+ }++ render(current());+ window.addEventListener('openai:set_globals', function () { render(current()); });+ window.addEventListener('message', function (ev) {+ var d = ev && ev.data;+ if (d && d.type === 'openai:set_globals') render(current());+ if (d && d.params && d.params.structuredContent) render(d.params.structuredContent);+ });+})();+</script>+</body>+</html>`;++export const PERSONA_COMPONENT_URI = 'ui://widget/three-studio-persona.html';++// The persona widget frames the hosted embodiment embed; everything the body+// needs (GLB, animation, lip-sync) loads inside that nested document under the+// app origin's own policies, so the widget itself only needs frame access.+export function personaComponentCsp() {+ const origin = env.APP_ORIGIN;+ return {+ connect_domains: [origin],+ resource_domains: [origin],+ frame_domains: [origin],+ };+}diff --git a/api/_mcp-studio/dispatch.js b/api/_mcp-studio/dispatch.jsindex 6047263ed..f1cab5fb7 100644--- a/api/_mcp-studio/dispatch.js+++ b/api/_mcp-studio/dispatch.js@@ -11,11 +11,19 @@ import { recordEvent, logger } from '../_lib/usage.js';import { sanitizeToolError } from '../_lib/mcp-error-sanitize.js';import { TOOL_CATALOG, TOOLS } from './tools.js';import { PERSONA_TOOL_CATALOG, PERSONA_TOOLS } from './persona-tools.js';-import { COMPONENT_HTML, COMPONENT_URI, COMPONENT_MIME, COMPONENT_CSP } from './component.js';+import {+ COMPONENT_HTML,+ COMPONENT_URI,+ COMPONENT_MIME,+ componentCsp,+ PERSONA_COMPONENT_HTML,+ PERSONA_COMPONENT_URI,+ personaComponentCsp,+} from './component.js';// The full catalog the free studio advertises: five generation tools + three-// embodiment/persona tools. The persona tools return their living-body view as an-// inline resource (they don't use the model-viewer widget), so they aren't in the+// embodiment/persona tools. The persona tools render the persona widget (the+// living-body embed) rather than the model-viewer widget, and they aren't in the// generation-quota set — see api/mcp-studio.js callsGenerationTool.const ALL_TOOL_CATALOG = [...TOOL_CATALOG, ...PERSONA_TOOL_CATALOG];const ALL_TOOLS = { ...TOOLS, ...PERSONA_TOOLS };@@ -35,19 +43,39 @@ const INSTRUCTIONS = ['idles between turns.',].join(' ');-// The Apps SDK widget resource — one HTML template all generation tools render.-const RESOURCE = {- uri: COMPONENT_URI,- name: 'three.ws 3D model viewer',- description: 'Interactive 3D viewer that renders a generated GLB model inline.',- mimeType: COMPONENT_MIME,- _meta: {- 'openai/widgetDescription': 'Interactive 3D viewer for a generated model — rotate, view, and download the GLB.',- 'openai/widgetCSP': COMPONENT_CSP,- 'openai/widgetDomain': 'https://three.ws',- 'openai/widgetPrefersBorder': true,- },-};+// The Apps SDK widget resources: the model viewer every generation tool renders,+// and the living-body persona widget the embodiment tools render. _meta (incl.+// the CSP) is built per call so the storage origin always tracks env.+function widgetResources() {+ return [+ {+ uri: COMPONENT_URI,+ name: 'three.ws 3D model viewer',+ description: 'Interactive 3D viewer that renders a generated GLB model inline.',+ mimeType: COMPONENT_MIME,+ text: COMPONENT_HTML,+ _meta: {+ 'openai/widgetDescription': 'Interactive 3D viewer for a generated model — rotate, view, and download the GLB.',+ 'openai/widgetCSP': componentCsp(),+ 'openai/widgetDomain': 'https://three.ws',+ 'openai/widgetPrefersBorder': true,+ },+ },+ {+ uri: PERSONA_COMPONENT_URI,+ name: 'three.ws living agent',+ description: 'Live agent body that idles between turns, lip-syncs replies, and emotes.',+ mimeType: COMPONENT_MIME,+ text: PERSONA_COMPONENT_HTML,+ _meta: {+ 'openai/widgetDescription': 'A live 3D agent body — it idles between turns, lip-syncs each reply, and shows emotion.',+ 'openai/widgetCSP': personaComponentCsp(),+ 'openai/widgetDomain': 'https://three.ws',+ 'openai/widgetPrefersBorder': true,+ },+ },+ ];+}const log = logger('mcp-studio');@@ -111,11 +139,14 @@ export async function dispatch(msg, auth, req) {if (method === 'notifications/initialized') return null;if (method === 'tools/list') return ok(id, { tools: ALL_TOOL_CATALOG });if (method === 'tools/call') return ok(id, await onToolCall(msg.params, auth, started, req));- if (method === 'resources/list') return ok(id, { resources: [RESOURCE] });+ if (method === 'resources/list') {+ return ok(id, { resources: widgetResources().map(({ text: _t, ...r }) => r) });+ }if (method === 'resources/read') {const uri = msg.params?.uri;- if (uri !== COMPONENT_URI) throw rpcError(-32602, `unknown resource: ${uri}`);- return ok(id, { contents: [{ uri: COMPONENT_URI, mimeType: COMPONENT_MIME, text: COMPONENT_HTML, _meta: RESOURCE._meta }] });+ const res = widgetResources().find((r) => r.uri === uri);+ if (!res) throw rpcError(-32602, `unknown resource: ${uri}`);+ return ok(id, { contents: [{ uri: res.uri, mimeType: res.mimeType, text: res.text, _meta: res._meta }] });}if (method === 'resources/templates/list') return ok(id, { resourceTemplates: [] });if (method === 'prompts/list') return ok(id, { prompts: [] });diff --git a/api/auth/sessions/[action].js b/api/auth/sessions/[action].jsindex efe333616..fc086c09f 100644--- a/api/auth/sessions/[action].js+++ b/api/auth/sessions/[action].js@@ -16,7 +16,17 @@ import { limits, clientIp } from '../../_lib/rate-limit.js';const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;export default wrap(async (req, res) => {- const action = req.query?.action ?? new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();+ // action arrives via the route table (?action=$1) when a subpath was hit.+ // Behind the Cloud Run rewrite the bare index path keeps its ORIGINAL+ // pathname on req.url (see server/index.mjs), so the URL fallback must map+ // the endpoint's own directory segment ("sessions") back to "no action";+ // otherwise GET/DELETE /api/auth/sessions dispatches to the per-id revoke+ // branch and 405s.+ let action = req.query?.action;+ if (action === undefined) {+ const last = new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();+ action = last === 'sessions' ? undefined : last;+ }if (action === undefined || action === '' || action === null) {return handleIndex(req, res);diff --git a/api/auth/wallets/[action].js b/api/auth/wallets/[action].jsindex 63f5b76fd..f6cf38906 100644--- a/api/auth/wallets/[action].js+++ b/api/auth/wallets/[action].js@@ -40,7 +40,17 @@ const nonceBody = z.object({});export default wrap(async (req, res) => {- const action = req.query?.action ?? new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();+ // action arrives via the route table (?action=$1) when a subpath was hit.+ // Behind the Cloud Run rewrite the bare index path keeps its ORIGINAL+ // pathname on req.url (see server/index.mjs), so the URL fallback must map+ // the endpoint's own directory segment ("wallets") back to "no action";+ // otherwise GET/POST /api/auth/wallets dispatches to the DELETE-only+ // unlink branch and 405s.+ let action = req.query?.action;+ if (action === undefined) {+ const last = new URL(req.url, 'http://x').pathname.split('/').filter(Boolean).pop();+ action = last === 'wallets' ? undefined : last;+ }// /api/auth/wallets — list (GET) or link (POST)if (action === undefined || action === '' || action === null) {diff --git a/api/pump/smart-money.js b/api/pump/smart-money.jsindex 27f4d842f..cb0c2d528 100644--- a/api/pump/smart-money.js+++ b/api/pump/smart-money.js@@ -7,6 +7,8 @@* &label=smart_money&min_coins=8&limit=50* GET /api/pump/smart-money?wallet=<addr> → one wallet's reputation card* GET /api/pump/smart-money?mint=<addr> → one coin: who's in it + score+ * (a coin the rollup has not scored resolves 200 + found:false, matching+ * the intel / launch-detail convention, so detail pages never 404)** The edge: judge a coin by WHO is buying it. The rollup cron* (api/cron/smart-money-rollup) crosses every coin's per-wallet footprint with@@ -147,7 +149,19 @@ async function coinDetail(res, mint) {WHERE network = ${NETWORK} AND mint = ${mint}LIMIT 1`;- if (!coin) return json(res, 404, { error: 'not_found', message: 'this coin has not been scored yet' });+ if (!coin) {+ // Not scored yet (too new, or outside the rollup's observation window).+ // That is an answer about the coin, not a missing resource, so resolve it+ // the way the other pump detail endpoints (intel, launch-detail) do:+ // 200 + found:false. Cacheable so repeat probes for hot unscored mints+ // are absorbed at the edge.+ return json(+ res,+ 200,+ { found: false, mint, coin: null, notable: [] },+ { 'cache-control': 'public, max-age=30, s-maxage=60' },+ );+ }// Resolve the notable wallets' live labels (in case they ranked up since).const notable = Array.isArray(coin.notable) ? coin.notable : [];@@ -164,6 +178,7 @@ async function coinDetail(res, mint) {res,200,{+ found: true,coin: shapeCoin(coin),notable: notable.map((n) => {const live = labels.get(n.wallet);diff --git a/data/changelog.json b/data/changelog.jsonindex 995a3c37b..5fe50501c 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,24 @@{"$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-14",+ "title": "Coin Clash, coin worlds, and the sign-in page fail gracefully",+ "summary": "When the community battle service is offline, /clash and the /temporary world picker used to keep retrying and logging failed requests in the background. Both now recognize the outage on the first response, stop polling, and show a clear notice with live places to go instead (launches, markets, or walking the default world solo). The sign-in page also no longer throws a background error if its 3D greeter can't load; the form works exactly the same without him.",+ "tags": [+ "fix"+ ],+ "link": "/clash"+ },+ {+ "date": "2026-07-14",+ "title": "\"Deploy onchain\" now opens the real deploy flow with your model loaded",+ "summary": "After forging a model, the \"Deploy onchain\" shortcut used to drop you on Launchpad Studio (the white-label site builder), which ignored your model entirely. It now opens the on-chain deploy wizard with your model and its name already filled in, so you go straight from forge to a permanent on-chain agent identity. The search palette's \"Launch a coin\" action was also mispointed and now opens the pump.fun coin launch flow.",+ "tags": [+ "fix"+ ],+ "link": "/deploy"+ },{"date": "2026-07-14","title": "Your profile no longer asks you to sign in when you already are",@@ -13599,6 +13617,71 @@"fix"],"link": "/viewer"+ },+ {+ "date": "2026-07-14",+ "title": "Vanity wallet page loads cleanly again",+ "summary": "Opening /vanity-wallet on desktop threw two script errors the moment the page loaded, which broke the sealed-drop claim and gifting features on that page. The page now ships fully bundled code, so it loads without errors and every feature on it, from the in-browser grinder to sealed drops, works as intended.",+ "tags": [+ "fix"+ ],+ "link": "/vanity-wallet"+ },+ {+ "date": "2026-07-14",+ "title": "Wallet and session lists load again across the dashboard",+ "summary": "Signed-in pages that show your linked wallets or active sessions (wallets, account, settings, sessions, voice, and more) were failing to load their lists because the server rejected the request outright. The lists now load correctly, and the settings page's revoke-all-other-sessions button now actually revokes them. The BNB hub page also no longer fires a failing request on every visit.",+ "tags": [+ "fix"+ ],+ "link": "/dashboard/wallets"+ },+ {+ "date": "2026-07-14",+ "title": "The Agora and City worlds survive OpenStreetMap outages",+ "summary": "The 3D city on /agora and /city is built from live OpenStreetMap data, and a single overloaded map server used to mean an empty world with no buildings. Map data now fails over across three independent OpenStreetMap mirrors, and if every mirror is down the world rebuilds from the last map snapshot saved in your browser, so Manhattan stays standing even when the map providers do not.",+ "tags": [+ "fix",+ "improvement"+ ],+ "link": "/agora"+ },+ {+ "date": "2026-07-14",+ "title": "Agent and coin art always renders on the Activity and Deployments feeds",+ "summary": "Avatars on the /activity trading floor and the /deployments on-chain feed come from wherever the agent's creator hosted them, and browsers were silently blocking many of those hosts (IPFS gateways serving metadata instead of an image, dead image servers), leaving blank tiles and repeated failed requests. Every third-party image now loads through the platform's own image resolver, which finds the real artwork across multiple IPFS gateways and shows a clean generated placeholder when the original is truly gone.",+ "tags": [+ "fix"+ ],+ "link": "/activity"+ },+ {+ "date": "2026-07-14",+ "title": "The trade terminal stops throwing 404s and rides out RPC outages",+ "summary": "The deep-dive on /trades asked the platform for holder cohorts and a smart-money score on every coin, including coins three.ws never launched or scored, so the browser logged a guaranteed failed request for almost every selection. Both panels now know the difference between \"no data exists for this coin\" and a real error: unscored coins get an honest \"not scored yet\" card that links to the Smart Money radar, and coins launched elsewhere get a direct link to their on-chain holder list. Live price and bonding-curve reads also became outage-proof: when every Solana RPC provider fails at once, the terminal serves the last real curve data it saw (clearly marked stale) instead of a server error and a blank strip.",+ "tags": [+ "fix",+ "improvement"+ ],+ "link": "/trades"+ },+ {+ "date": "2026-07-14",+ "title": "3D previews stop erroring on the scanner and every plain page footer",+ "summary": "The walking robot in the site footer failed to appear on plain pages like /hydrate and /login because its compressed 3D model needed a decoder the page never loaded; the decoder is now wired in before the viewer starts, so the robot renders everywhere. The 3D scanner also downloaded a 748KB placeholder avatar the moment the page opened, even for visitors who never started a scan, and logged a fetch error on every visit to the old /scan address; the placeholder now loads only when the build step is actually on screen, and if its download ever fails the progress view stays clean instead of showing a dead black panel.",+ "tags": [+ "fix"+ ],+ "link": "/create/selfie"+ },+ {+ "date": "2026-07-14",+ "title": "Cleaner pages: sitemap header fits, stray glow clipped, quieter console",+ "summary": "A site-wide polish pass on cosmetic issues found in a full-site sweep. The /sitemap page now uses the standard site header instead of a cramped custom top bar that pushed the navigation past the right edge of the screen. The walk companion's caption bubble and the decorative glow on /x402-revenue are both capped so they can never spill outside the viewport or cause sideways scrolling. The companion's expected avatar fallback (a non-humanoid model handing off to the robot) no longer prints a warning on every page view, and the live demo frames on /labs and /integrations no longer trigger a browser sandbox warning.",+ "tags": [+ "fix"+ ],+ "link": "/sitemap"}]}diff --git a/docs/ops/page-audit.md b/docs/ops/page-audit.mdnew file mode 100644index 000000000..db1d3c32d--- /dev/null+++ b/docs/ops/page-audit.md@@ -0,0 +1,69 @@+# Page audit: authed full-site console sweep++`scripts/page-audit.mjs` drives a real Chromium across every public page (from+`data/pages.json`, skipping the machine-readable section and any non-HTML+path) plus the authenticated dashboard/profile routes and live-seeded dynamic+agent routes. It runs each route in a desktop (1440x900) and a mobile+(iPhone 13) viewport and records what a human would otherwise hunt for with+the dev console open:++- `console.error` / `console.warn` output+- uncaught exceptions (`pageerror`)+- failed network requests (`requestfailed`)+- HTTP responses with status >= 400 (a 402 from an `/api/` path is recorded+ as info-severity `payment-gated`, since x402 endpoints correctly answer 402+ to a non-paying browser)+- horizontal overflow and elements escaping the viewport+- interactive controls below the 32px tap-target floor (mobile pass only)+- accessibility smells: missing `<title>`, missing image alt text, dead links++The sweep is read-only. It never mutates the target.++## Commands++```sh+# One-time: create the auth session (server-set HttpOnly cookie -> storageState)[email protected] AUDIT_PASSWORD=secret npm run audit:web:login++# Full sweep (picks up the saved session automatically)+npm run audit:web+```++Useful direct invocations:++```sh+node scripts/page-audit.mjs / /agents /pay # only these routes+node scripts/page-audit.mjs --desktop-only # skip the mobile viewport+node scripts/page-audit.mjs --mobile-only # skip the desktop viewport+node scripts/page-audit.mjs --concurrency 6 # parallel pages per viewport+node scripts/page-audit.mjs --strict # exit 1 on any error-severity finding+```++## Targeting++`BASE_URL` selects the target and defaults to production:++```sh+BASE_URL=https://three.ws npm run audit:web # default+BASE_URL=http://localhost:3000 npm run audit:web # vite dev server+```++Local targets get an extra noise filter for failures that only exist because+serverless functions and CDNs are absent under a bare dev server.++## Session file++`--login` posts `AUDIT_EMAIL` / `AUDIT_PASSWORD` to `/api/auth/login` on the+chosen `BASE_URL` and saves cookies plus localStorage (including the+optimistic auth hint) to `.auth/audit-state.json`. The `.auth/` directory is+gitignored. Every later run replays that storageState; without it the audit+runs anonymously and skips the authenticated-only routes. Re-run+`npm run audit:web:login` when the session expires.++## Reports++Findings are deduped, grouped per route, scored by severity (error / warn /+info), and written to `reports/page-audit-<timestamp>.json` and `.md`, with a+summary printed to the console. The `reports/` directory is gitignored, so+sweep output never lands in commits. `--strict` makes the process exit+nonzero when any error-severity finding exists, for use as a gate.diff --git a/package.json b/package.jsonindex d63f26b24..a9fb4c380 100644--- a/package.json+++ b/package.json@@ -142,6 +142,7 @@"guard:hidden": "node scripts/inject-hidden-guard.mjs --write","check:images": "node scripts/audit-image-loading.mjs --strict","audit:web": "node scripts/page-audit.mjs",+ "audit:web:login": "node scripts/page-audit.mjs --login","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 & node scripts/build-discovery-cards.mjs & npm run build:club-assets & npm run build:walk-environments & wait) && node scripts/inject-blog-seo.mjs --write && node scripts/inject-hidden-guard.mjs --write && (node scripts/build-page-index.mjs && node scripts/audit-page-index.mjs --strict && node scripts/audit-empty-handlers.mjs && node scripts/audit-hidden-guard.mjs) && node scripts/inject-seo-meta.mjs --write && node scripts/inject-theme-boot.mjs --write",diff --git a/pages/activity.html b/pages/activity.htmlindex 25431700d..d2edd421d 100644--- a/pages/activity.html+++ b/pages/activity.html@@ -425,6 +425,8 @@<script src="/brand.js" defer></script><script type="module">+ import { proxiedImageURL } from '/src/ipfs.js';+const API = '/api/oracle/activity';const STATS_API = '/api/oracle/stats';const REFRESH_MS = 60_000;@@ -435,6 +437,16 @@const sign = (n) => n > 0 ? '+' : '';const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));const imgErr = `this.onerror=null;this.style.visibility='hidden'`;+ // Agent and token art URLs come from third-party data (pump.fun IPFS+ // metadata, per-agent hosts) and routinely fail ORB/CORS when loaded+ // directly as <img> sources: some are metadata JSON documents, some are+ // dead hosts. Route every remote URL through the same-origin /api/img+ // proxy: it retries across IPFS gateways, follows a metadata doc one hop+ // to the real image, and always answers 200 with a valid image+ // (deterministic placeholder on failure) so the page never logs a failed+ // request. Missing URLs keep the favicon tile; the seed keeps placeholders+ // stable per agent/coin.+ const imgSrc = (url, seed) => proxiedImageURL(String(url || ''), String(seed || '')) || '/favicon.ico';function usdc(n) {if (n == null || !isFinite(n)) return null;const a = Math.abs(n);@@ -477,7 +489,7 @@const peakHtml = item.peak_multiple && item.peak_multiple >= 2? `<span style="font-size:10.5px;color:var(--ac-up);font-family:var(--font-mono,monospace)">${Number(item.peak_multiple).toFixed(1)}×</span>` : '';- const av = item.agent_image || item.agent_avatar || '/favicon.ico';+ const av = imgSrc(item.agent_image || item.agent_avatar, item.agent_id || item.mint);const coinUrl = `/oracle/coin/${encodeURIComponent(item.mint)}`;const verb = outcome === 'win' ? 'closed ↑' : outcome === 'loss' ? 'closed ↓' : outcome === 'flat' ? 'closed' : 'entered';@@ -958,7 +970,7 @@const wr = a.win_rate != null ? a.win_rate + '%' : '—';const roi = a.roi_pct != null ? `${a.roi_pct >= 0 ? '+' : ''}${a.roi_pct}% ROI` : `${a.total} calls`;const roiCls = a.roi_pct != null ? (a.roi_pct >= 0 ? 'up' : 'dn') : '';- const av = a.image_url || '/favicon.ico';+ const av = imgSrc(a.image_url, a.agent_id);return `<a class="ac-li" href="/trader/${encodeURIComponent(a.agent_id)}"><span class="ac-li-rank ${a.rank <= 3 ? 'top' : ''}">${a.rank}</span><img class="ac-li-av round" src="${esc(av)}" alt="" onerror="${imgErr}" loading="lazy" />@@ -986,7 +998,7 @@}b.innerHTML = items.map((m) => {const sym = (m.symbol || m.mint.slice(0, 6)).toUpperCase();- const av = m.image_uri || '/favicon.ico';+ const av = imgSrc(m.image_uri, m.mint);const up = (m.delta || 0) >= 0;return `<a class="ac-li" href="/oracle/coin/${encodeURIComponent(m.mint)}"><img class="ac-li-av" src="${esc(av)}" alt="" onerror="${imgErr}" loading="lazy" />@@ -1014,7 +1026,7 @@}b.innerHTML = items.map((w) => {const sym = (w.symbol || w.mint.slice(0, 6)).toUpperCase();- const av = w.image_uri || '/favicon.ico';+ const av = imgSrc(w.image_uri, w.mint);const ath = w.ath_multiple != null ? w.ath_multiple.toFixed(1) + '×' : '—';return `<a class="ac-li" href="${esc(w.pump_url)}" target="_blank" rel="noopener"><img class="ac-li-av" src="${esc(av)}" alt="" onerror="${imgErr}" loading="lazy" />diff --git a/pages/create-selfie.html b/pages/create-selfie.htmlindex 450154a3d..c359e5d68 100644--- a/pages/create-selfie.html+++ b/pages/create-selfie.html@@ -1618,7 +1618,11 @@</div><div class="build-viewer" aria-hidden="true">+ <!-- loading="lazy": this viewer is decoration inside a hidden step.+ It must not cost 748KB on first paint, so it only starts+ fetching once the building step is actually shown. --><model-viewer+ id="build-model"src="/avatars/default.glb"auto-rotaterotation-per-second="12deg"@@ -1629,7 +1633,7 @@environment-image="neutral"exposure="0.9"camera-orbit="0deg 78deg auto"- loading="eager"+ loading="lazy"></model-viewer><img id="build-preview" class="build-preview" alt="" /><div class="build-veil">@@ -2126,6 +2130,15 @@let _notifyPermission =typeof Notification !== 'undefined' ? Notification.permission : 'denied';+ // The build-step viewer is pure decoration (the placeholder avatar+ // spinning behind the veil while reconstruction runs). If its GLB fetch+ // fails (transient network drop, navigation mid-download), fall back to+ // the designed state (the captured-photo preview and progress veil)+ // instead of leaving a dead black canvas behind them.+ document.getElementById('build-model')?.addEventListener('error', (e) => {+ /** @type {HTMLElement} */ (e.currentTarget).style.visibility = 'hidden';+ });+document.addEventListener('selfie:preview', (e) => {const dataUrl = /** @type {CustomEvent} */ (e).detail?.dataUrl;if (!dataUrl) return;diff --git a/pages/integrations.html b/pages/integrations.htmlindex ee722bbc2..85815dd51 100644--- a/pages/integrations.html+++ b/pages/integrations.html@@ -1192,7 +1192,10 @@</button></div><div class="modal-body">- <iframe id="demo-iframe" title="Live widget demo" allow="autoplay; microphone" sandbox="allow-scripts allow-same-origin allow-forms allow-popups"></iframe>+ <!-- No sandbox: the modal frames our own same-origin /widget page, which+ needs its real origin for API and storage access. Sandboxing+ same-origin content with allow-scripts is escapable anyway. -->+ <iframe id="demo-iframe" title="Live widget demo" allow="autoplay; microphone"></iframe></div></div></div>diff --git a/pages/scan.html b/pages/scan.htmlindex 910622c18..a52b84abe 100644--- a/pages/scan.html+++ b/pages/scan.html@@ -1624,7 +1624,14 @@</div><div class="build-viewer" aria-hidden="true">+ <!-- loading="lazy": this viewer is decoration inside a hidden step,+ and this page immediately location.replace()s to /create/selfie.+ An eager load here starts a 748KB GLB fetch that the redirect+ then kills mid-flight, making model-viewer log+ "TypeError: Failed to fetch" on every visit. Lazy means the+ fetch only ever starts if the step actually becomes visible. --><model-viewer+ id="build-model"src="/avatars/default.glb"auto-rotaterotation-per-second="12deg"@@ -1635,7 +1642,7 @@environment-image="neutral"exposure="0.9"camera-orbit="0deg 78deg auto"- loading="eager"+ loading="lazy"></model-viewer><img id="build-preview" class="build-preview" alt="" /><div class="build-veil">@@ -1881,6 +1888,15 @@);});+ // The build-step viewer is pure decoration (the placeholder avatar+ // spinning behind the veil while reconstruction runs). If its GLB fetch+ // fails (transient network drop, navigation mid-download), fall back to+ // the designed state (the captured-photo preview and progress veil)+ // instead of leaving a dead black canvas behind them.+ document.getElementById('build-model')?.addEventListener('error', (e) => {+ e.currentTarget.style.visibility = 'hidden';+ });+document.addEventListener('selfie:preview', (e) => {const dataUrl = e.detail?.dataUrl;if (!dataUrl) return;diff --git a/pages/smart-money.html b/pages/smart-money.htmlindex af5e34f9e..f87712575 100644--- a/pages/smart-money.html+++ b/pages/smart-money.html@@ -832,6 +832,7 @@openDrawer('Loading…', '<div class="skel" style="height:120px"></div>');try {const { coin, notable } = await getJSON(`${API}?mint=${encodeURIComponent(mint)}`);+ if (!coin) throw new Error('not scored yet'); // 200 + found:false → the designed "Not scored yet" state below$('drTitle').textContent = coin.symbol || 'Coin';const share = shareOf(coin);const rows = (notable || []).map((n) => `<div class="nwallet" data-wallet="${esc(n.wallet)}" role="button" tabindex="0">diff --git a/prompts/store-submissions/_generated/openai-gpt-config.md b/prompts/store-submissions/_generated/openai-gpt-config.mdindex 87f5b7911..1c5a129d1 100644--- a/prompts/store-submissions/_generated/openai-gpt-config.md+++ b/prompts/store-submissions/_generated/openai-gpt-config.md@@ -128,19 +128,25 @@ STYLE## 5. Conversation starters-Each reliably produces a model on the first call:+Four chips, one per audience: game developers, tabletop players, designers, and+the merely curious. Specific beats general here (a chip is a one-click demo, not+a filter), but the set must span use cases instead of four samey desk trinkets.+The first three subjects are verified live against `/api/3d/studio` (fox is the+smoke-test prompt; dragon and car re-verified 2026-07-14, both done inline). The+fourth is open-ended by design: the instructions make the GPT rewrite it into+one concrete subject before calling.```-Make me a low-poly fox+Make me a low-poly fox for my game``````-Generate a cute ceramic robot figurine+Create a dragon miniature for my tabletop campaign``````-I need a 3D model of a medieval treasure chest+Design a sleek futuristic concept car``````-Create a cartoon mushroom house+Surprise me with something cool in 3D```## 6. Capabilitiesdiff --git a/public/changelog.json b/public/changelog.jsonindex 3c4bacf87..9e96d703d 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-14T12:42:05.570Z",+ "generated_at": "2026-07-14T13:48:01.626Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -36,6 +36,36 @@"launch"]},+ {+ "date": "2026-07-14",+ "type": "update",+ "title": "\"Deploy onchain\" now opens the real deploy flow with your model loaded",+ "summary": "After forging a model, the \"Deploy onchain\" shortcut used to drop you on Launchpad Studio (the white-label site builder), which ignored your model entirely. It now opens the on-chain deploy wizard with your model and its name already filled in, so you go straight from forge to a permanent on-chain agent identity. The search palette's \"Launch a coin\" action was also mispointed and now opens the pump.fun coin launch flow.",+ "link": "/deploy",+ "tags": [+ "fix"+ ]+ },+ {+ "date": "2026-07-14",+ "type": "update",+ "title": "3D previews stop erroring on the scanner and every plain page footer",+ "summary": "The walking robot in the site footer failed to appear on plain pages like /hydrate and /login because its compressed 3D model needed a decoder the page never loaded; the decoder is now wired in before the viewer starts, so the robot renders everywhere. The 3D scanner also downloaded a 748KB placeholder avatar the moment the page opened, even for visitors who never started a scan, and logged a fetch error on every visit to the old /scan address; the placeholder now loads only when the build step is actually on screen, and if its download ever fails the progress view stays clean instead of showing a dead black panel.",+ "link": "/create/selfie",+ "tags": [+ "fix"+ ]+ },+ {+ "date": "2026-07-14",+ "type": "update",+ "title": "Agent and coin art always renders on the Activity and Deployments feeds",+ "summary": "Avatars on the /activity trading floor and the /deployments on-chain feed come from wherever the agent's creator hosted them, and browsers were silently blocking many of those hosts (IPFS gateways serving metadata instead of an image, dead image servers), leaving blank tiles and repeated failed requests. Every third-party image now loads through the platform's own image resolver, which finds the real artwork across multiple IPFS gateways and shows a clean generated placeholder when the original is truly gone.",+ "link": "/activity",+ "tags": [+ "fix"+ ]+ },{"date": "2026-07-14","type": "update",@@ -56,6 +86,26 @@"feature"]},+ {+ "date": "2026-07-14",+ "type": "update",+ "title": "Cleaner pages: sitemap header fits, stray glow clipped, quieter console",+ "summary": "A site-wide polish pass on cosmetic issues found in a full-site sweep. The /sitemap page now uses the standard site header instead of a cramped custom top bar that pushed the navigation past the right edge of the screen. The walk companion's caption bubble and the decorative glow on /x402-revenue are both capped so they can never spill outside the viewport or cause sideways scrolling. The companion's expected avatar fallback (a non-humanoid model handing off to the robot) no longer prints a warning on every page view, and the live demo frames on /labs and /integrations no longer trigger a browser sandbox warning.",+ "link": "/sitemap",+ "tags": [+ "fix"+ ]+ },+ {+ "date": "2026-07-14",+ "type": "update",+ "title": "Coin Clash, coin worlds, and the sign-in page fail gracefully",+ "summary": "When the community battle service is offline, /clash and the /temporary world picker used to keep retrying and logging failed requests in the background. Both now recognize the outage on the first response, stop polling, and show a clear notice with live places to go instead (launches, markets, or walking the default world solo). The sign-in page also no longer throws a background error if its 3D greeter can't load; the form works exactly the same without him.",+ "link": "/clash",+ "tags": [+ "fix"+ ]+ },{"date": "2026-07-14","type": "update",@@ -87,6 +137,17 @@"fix"]},+ {+ "date": "2026-07-14",+ "type": "update",+ "title": "The Agora and City worlds survive OpenStreetMap outages",+ "summary": "The 3D city on /agora and /city is built from live OpenStreetMap data, and a single overloaded map server used to mean an empty world with no buildings. Map data now fails over across three independent OpenStreetMap mirrors, and if every mirror is down the world rebuilds from the last map snapshot saved in your browser, so Manhattan stays standing even when the map providers do not.",+ "link": "/agora",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-07-14","type": "update",@@ -107,6 +168,17 @@"feature"]},+ {+ "date": "2026-07-14",+ "type": "update",+ "title": "The trade terminal stops throwing 404s and rides out RPC outages",+ "summary": "The deep-dive on /trades asked the platform for holder cohorts and a smart-money score on every coin, including coins three.ws never launched or scored, so the browser logged a guaranteed failed request for almost every selection. Both panels now know the difference between \"no data exists for this coin\" and a real error: unscored coins get an honest \"not scored yet\" card that links to the Smart Money radar, and coins launched elsewhere get a direct link to their on-chain holder list. Live price and bonding-curve reads also became outage-proof: when every Solana RPC provider fails at once, the terminal serves the last real curve data it saw (clearly marked stale) instead of a server error and a blank strip.",+ "link": "/trades",+ "tags": [+ "fix",+ "improvement"+ ]+ },{"date": "2026-07-14","type": "update",@@ -118,6 +190,26 @@"improvement"]},+ {+ "date": "2026-07-14",+ "type": "update",+ "title": "Vanity wallet page loads cleanly again",+ "summary": "Opening /vanity-wallet on desktop threw two script errors the moment the page loaded, which broke the sealed-drop claim and gifting features on that page. The page now ships fully bundled code, so it loads without errors and every feature on it, from the in-browser grinder to sealed drops, works as intended.",+ "link": "/vanity-wallet",+ "tags": [+ "fix"+ ]+ },+ {+ "date": "2026-07-14",+ "type": "update",+ "title": "Wallet and session lists load again across the dashboard",+ "summary": "Signed-in pages that show your linked wallets or active sessions (wallets, account, settings, sessions, voice, and more) were failing to load their lists because the server rejected the request outright. The lists now load correctly, and the settings page's revoke-all-other-sessions button now actually revokes them. The BNB hub page also no longer fires a failing request on every visit.",+ "link": "/dashboard/wallets",+ "tags": [+ "fix"+ ]+ },{"date": "2026-07-14","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 4082eff0e..c50767239 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -30,6 +30,30 @@<category>launch</category><description>License terms for the three.ws Seeker/Saga app.</description></item>+ <item>+ <title>"Deploy onchain" now opens the real deploy flow with your model loaded</title>+ <link>https://three.ws/deploy</link>+ <guid isPermaLink="false">2026-07-14:"Deploy onchain" now opens the real deploy flow with your model loaded</guid>+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>After forging a model, the "Deploy onchain" shortcut used to drop you on Launchpad Studio (the white-label site builder), which ignored your model entirely. It now opens the on-chain deploy wizard with your model and its name already filled in, so you go straight from forge to a permanent on-chain agent identity. The search palette's "Launch a coin" action was also mispointed and now opens the pump.fun coin launch flow.</description>+ </item>+ <item>+ <title>3D previews stop erroring on the scanner and every plain page footer</title>+ <link>https://three.ws/create/selfie</link>+ <guid isPermaLink="false">2026-07-14:3D previews stop erroring on the scanner and every plain page footer</guid>+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The walking robot in the site footer failed to appear on plain pages like /hydrate and /login because its compressed 3D model needed a decoder the page never loaded; the decoder is now wired in before the viewer starts, so the robot renders everywhere. The 3D scanner also downloaded a 748KB placeholder avatar the moment the page opened, even for visitors who never started a scan, and logged a fetch error on every visit to the old /scan address; the placeholder now loads only when the build step is actually on screen, and if its download ever fails the progress view stays clean instead of showing a dead black panel.</description>+ </item>+ <item>+ <title>Agent and coin art always renders on the Activity and Deployments feeds</title>+ <link>https://three.ws/activity</link>+ <guid isPermaLink="false">2026-07-14:Agent and coin art always renders on the Activity and Deployments feeds</guid>+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Avatars on the /activity trading floor and the /deployments on-chain feed come from wherever the agent's creator hosted them, and browsers were silently blocking many of those hosts (IPFS gateways serving metadata instead of an image, dead image servers), leaving blank tiles and repeated failed requests. Every third-party image now loads through the platform's own image resolver, which finds the real artwork across multiple IPFS gateways and shows a clean generated placeholder when the original is truly gone.</description>+ </item><item><title>Agent brains upgraded to the newest OpenAI models</title><link>https://three.ws/brain</link>@@ -46,6 +70,22 @@<category>feature</category><description>A new mobile-first app at /ar turns a one-line prompt into a real, downloadable 3D model on the free generation lane, then puts it in your space with one tap: WebXR or Scene Viewer on Android, Quick Look on iPhone. On a desktop it shows a QR code that hands the finished model straight to your phone's camera app, and every creation gets a shareable viewer link. No account, no payment, fair-use rate limits only.</description></item>+ <item>+ <title>Cleaner pages: sitemap header fits, stray glow clipped, quieter console</title>+ <link>https://three.ws/sitemap</link>+ <guid isPermaLink="false">2026-07-14:Cleaner pages: sitemap header fits, stray glow clipped, quieter console</guid>+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>A site-wide polish pass on cosmetic issues found in a full-site sweep. The /sitemap page now uses the standard site header instead of a cramped custom top bar that pushed the navigation past the right edge of the screen. The walk companion's caption bubble and the decorative glow on /x402-revenue are both capped so they can never spill outside the viewport or cause sideways scrolling. The companion's expected avatar fallback (a non-humanoid model handing off to the robot) no longer prints a warning on every page view, and the live demo frames on /labs and /integrations no longer trigger a browser sandbox warning.</description>+ </item>+ <item>+ <title>Coin Clash, coin worlds, and the sign-in page fail gracefully</title>+ <link>https://three.ws/clash</link>+ <guid isPermaLink="false">2026-07-14:Coin Clash, coin worlds, and the sign-in page fail gracefully</guid>+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>When the community battle service is offline, /clash and the /temporary world picker used to keep retrying and logging failed requests in the background. Both now recognize the outage on the first response, stop polling, and show a clear notice with live places to go instead (launches, markets, or walking the default world solo). The sign-in page also no longer throws a background error if its 3D greeter can't load; the form works exactly the same without him.</description>+ </item><item><title>IRL placement grows up: true AR anchoring leads the dock, and you can pinch-resize your agent</title><link>https://three.ws/irl</link>@@ -70,6 +110,14 @@<category>fix</category><description>Opening a shared model link at /viewer could hang on the loading spinner forever even though the model file itself was fine. The viewer now reveals the model as soon as it finishes rendering, and if a model genuinely cannot display, you get a clear message and a working download button instead of an endless spinner.</description></item>+ <item>+ <title>The Agora and City worlds survive OpenStreetMap outages</title>+ <link>https://three.ws/agora</link>+ <guid isPermaLink="false">2026-07-14:The Agora and City worlds survive OpenStreetMap outages</guid>+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The 3D city on /agora and /city is built from live OpenStreetMap data, and a single overloaded map server used to mean an empty world with no buildings. Map data now fails over across three independent OpenStreetMap mirrors, and if every mirror is down the world rebuilds from the last map snapshot saved in your browser, so Manhattan stays standing even when the map providers do not.</description>+ </item><item><title>The AR placement button is visible again on /irl</title><link>https://three.ws/irl</link>@@ -86,6 +134,14 @@<category>feature</category><description>The best forge models are now published to the official three.ws account on Sketchfab, the largest public 3D model site: weekly Forge-Off winners first, then top-voted board models, then creations their makers explicitly accepted. It is a curated showcase, not a firehose: a few validated models a week, each clearly tagged as AI-generated, with its generation prompt and a link back to the creation on three.ws so anyone who finds it can remix it or forge their own. Every link is tagged so we can measure how many visitors the showcase actually brings in.</description></item>+ <item>+ <title>The trade terminal stops throwing 404s and rides out RPC outages</title>+ <link>https://three.ws/trades</link>+ <guid isPermaLink="false">2026-07-14:The trade terminal stops throwing 404s and rides out RPC outages</guid>+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The deep-dive on /trades asked the platform for holder cohorts and a smart-money score on every coin, including coins three.ws never launched or scored, so the browser logged a guaranteed failed request for almost every selection. Both panels now know the difference between "no data exists for this coin" and a real error: unscored coins get an honest "not scored yet" card that links to the Smart Money radar, and coins launched elsewhere get a direct link to their on-chain holder list. Live price and bonding-curve reads also became outage-proof: when every Solana RPC provider fails at once, the terminal serves the last real curve data it saw (clearly marked stale) instead of a server error and a blank strip.</description>+ </item><item><title>Tour and Walk SDK update: switch between Stroll and Platformer from the tour controls</title><link>https://three.ws/tour-builder</link>@@ -94,6 +150,22 @@<category>sdk</category><description>Embedded tours built with the Tour Builder now include a labeled Stroll / Platformer toggle right in the tour controls next to Exit, so visitors can switch how they explore (tap it or press M) instead of hunting for a hidden corner button. Published as @three-ws/walk 0.2.1 and @three-ws/tour 0.5.1 on npm; the Tour Builder's exported embed snippet now uses the new versions automatically, and also picks up the latest @three-ws/page-agent with its five persona presets.</description></item>+ <item>+ <title>Vanity wallet page loads cleanly again</title>+ <link>https://three.ws/vanity-wallet</link>+ <guid isPermaLink="false">2026-07-14:Vanity wallet page loads cleanly again</guid>+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Opening /vanity-wallet on desktop threw two script errors the moment the page loaded, which broke the sealed-drop claim and gifting features on that page. The page now ships fully bundled code, so it loads without errors and every feature on it, from the in-browser grinder to sealed drops, works as intended.</description>+ </item>+ <item>+ <title>Wallet and session lists load again across the dashboard</title>+ <link>https://three.ws/dashboard/wallets</link>+ <guid isPermaLink="false">2026-07-14:Wallet and session lists load again across the dashboard</guid>+ <pubDate>Tue, 14 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Signed-in pages that show your linked wallets or active sessions (wallets, account, settings, sessions, voice, and more) were failing to load their lists because the server rejected the request outright. The lists now load correctly, and the settings page's revoke-all-other-sessions button now actually revokes them. The BNB hub page also no longer fires a failing request on every visit.</description>+ </item><item><title>Your profile no longer asks you to sign in when you already are</title><link>https://three.ws/profile</link>diff --git a/public/feature-discovery.js b/public/feature-discovery.jsindex c9f1a1a3e..545453be0 100644--- a/public/feature-discovery.js+++ b/public/feature-discovery.js@@ -69,7 +69,9 @@'/embed': { label: 'Embed', desc: 'Put your live agent on any website.' },'/embed.html': { label: 'Embed Editor', desc: 'Tune mode, size, and position — then copy the snippet.' },'/docs': { label: 'Docs', desc: 'SDKs, API reference, and integration guides.' },- '/launchpad': { label: 'Deploy Onchain', desc: 'Build a white-label 3D token launchpad and go live onchain.' },+ '/launchpad': { label: 'Launchpad Studio', desc: 'Build a white-label 3D token launchpad and go live onchain.' },+ '/deploy': { label: 'Deploy Onchain', desc: 'Register your model as a permanent on-chain agent identity.' },+ '/launch': { label: 'Launch a Coin', desc: 'Mint a pump.fun coin for your agent in one flow.' },'/marketplace': { label: 'Marketplace', desc: 'Buy, sell, and remix agents built by the community.' },};@@ -91,7 +93,7 @@forge: { kicker: 'Nice model — what now?', links: [{ route: '/scene', label: 'Open in Scene Studio', primary: true, modelParam: 'model', nameParam: 'name' },{ route: '/embed.html', label: 'Embed editor', modelParam: 'avatar' },- { route: '/launchpad', label: 'Deploy onchain', modelParam: 'avatar' },+ { route: '/deploy', label: 'Deploy onchain', idParam: 'avatar', modelParam: 'model', nameParam: 'name' },{ route: '/play', label: 'Drop it in a world', modelParam: 'avatar' },] },segment: { kicker: 'Parts split — what now?', links: [@@ -114,11 +116,11 @@] },studio: { kicker: 'Widget ready — share it?', links: [{ route: '/embed.html', label: 'Embed editor', primary: true },- { route: '/launchpad', label: 'Deploy onchain' },+ { route: '/deploy', label: 'Deploy onchain', idParam: 'avatar', modelParam: 'model', nameParam: 'name' },{ route: '/docs', label: 'Integration guide' },] },embed: { kicker: 'Embedded — what else?', links: [- { route: '/launchpad', label: 'Deploy onchain', primary: true },+ { route: '/deploy', label: 'Deploy onchain', primary: true, idParam: 'avatar', modelParam: 'model', nameParam: 'name' },{ route: '/marketplace', label: 'List on marketplace' },{ route: '/docs', label: 'API reference' },] },@@ -412,8 +414,12 @@return { href: href, label: l.label, primary: l.primary };});links.push({ href: EXPLORE_MORE, label: 'Explore more' });+ // Name the model in the card so the deep-link promise is concrete: the+ // user sees WHICH model each tool will open with, not an abstract claim.+ var modelLabel = model && model.label ? String(model.label).slice(0, 60) : '';renderCard({kicker: cfg.kicker,+ title: carried && modelLabel ? modelLabel : null,desc: carried ? 'Each tool opens with this model already loaded.' : null,links: links,});diff --git a/public/features.json b/public/features.jsonindex d759bbed4..120c22e37 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-14T12:42:05.557Z",+ "generated_at": "2026-07-14T13:48:01.603Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/footer.js b/public/footer.jsindex 33a8473ea..4d574ee78 100644--- a/public/footer.js+++ b/public/footer.js@@ -26,13 +26,22 @@});}+ // Resolves once the script has loaded so callers can order dependent scripts+ // behind it. A tag that is already in the document resolves immediately:+ // parser-inserted classic scripts have executed by the time footer.js runs+ // (they block parsing, and footer.js initializes at DOMContentLoaded or+ // later), and the only dynamic inserter of these URLs is this file itself.function ensureScript({ src, type, attr }) {- if (document.querySelector(`script[src="${src}"]`)) return;- const s = document.createElement('script');- s.src = src;- if (type) s.type = type;- if (attr) s.setAttribute(attr, '');- document.head.appendChild(s);+ if (document.querySelector(`script[src="${src}"]`)) return Promise.resolve();+ return new Promise((resolve) => {+ const s = document.createElement('script');+ s.src = src;+ if (type) s.type = type;+ if (attr) s.setAttribute(attr, '');+ s.addEventListener('load', resolve, { once: true });+ s.addEventListener('error', resolve, { once: true });+ document.head.appendChild(s);+ });}function init() {@@ -50,21 +59,30 @@ensureScript({ src: '/footer-bot.js', type: 'module' });} else {// Plain HTML page (login, register, etc.) — fall back to model-viewer.- ensureScript({- src: 'https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js',- type: 'module',+ // robotexpressive.glb ships EXT_meshopt_compression, which stock+ // model-viewer cannot decode: without the meshopt shim it throws+ // "THREE.GLTFLoader: setMeshoptDecoder must be called before+ // loading compressed files" the moment the footer scrolls into+ // view. The shim must EXECUTE before model-viewer defines the+ // element (it intercepts customElements.define), so chain the+ // model-viewer load and the element injection behind it.+ ensureScript({ src: '/model-viewer-meshopt.js' }).then(() => {+ ensureScript({+ src: 'https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js',+ type: 'module',+ });+ // model-viewer needs a <model-viewer> element; swap the canvas for one.+ const avatar = container.querySelector('.h-footer-avatar');+ if (avatar) {+ avatar.innerHTML = `<model-viewer+ src="/animations/robotexpressive.glb"+ auto-rotate auto-rotate-delay="0" rotation-per-second="20deg"+ interaction-prompt="none" camera-controls="false" disable-zoom+ shadow-intensity="0" exposure="0.7" environment-image="neutral"+ camera-orbit="0deg 80deg 9m" field-of-view="35deg" loading="lazy"+ ></model-viewer>`;+ }});- // model-viewer needs a <model-viewer> element; swap the canvas for one.- const avatar = container.querySelector('.h-footer-avatar');- if (avatar) {- avatar.innerHTML = `<model-viewer- src="/animations/robotexpressive.glb"- auto-rotate auto-rotate-delay="0" rotation-per-second="20deg"- interaction-prompt="none" camera-controls="false" disable-zoom- shadow-intensity="0" exposure="0.7" environment-image="neutral"- camera-orbit="0deg 80deg 9m" field-of-view="35deg" loading="lazy"- ></model-viewer>`;- }}}diff --git a/public/launch/launch.js b/public/launch/launch.jsindex 88eeeda2c..242475322 100644--- a/public/launch/launch.js+++ b/public/launch/launch.js@@ -175,11 +175,22 @@ export function mountLaunchCoin(root) {// here with the coin's configured name, symbol, description, image, and// initial buy so the launch form opens ready to go instead of blank.const params = new URL(location.href).searchParams;+ // ?imageSession=1 pulls the token image out of sessionStorage instead of a+ // URL: the /viewer "Launch a coin" funnel snapshots the 3D model to a data+ // URL, which is far too long to survive as a query param. The key is left+ // in place so a refresh keeps the prefill (sessionStorage is tab-scoped).+ let prefillImage = params.get('image') || '';+ if (!prefillImage && params.get('imageSession')) {+ try {+ const stored = sessionStorage.getItem('twx.launch.image') || '';+ if (stored.startsWith('data:image/')) prefillImage = stored;+ } catch { /* storage blocked: launch still works, user uploads an image */ }+ }const prefill = {name: params.get('name') || '',symbol: params.get('symbol') || '',description: params.get('description') || '',- imageUrl: params.get('image') || '',+ imageUrl: prefillImage,initialBuy: params.get('initialBuy') || '',};const hasPrefill = Object.values(prefill).some(Boolean);diff --git a/public/login.html b/public/login.htmlindex 9b90ce795..9d0b7c392 100644--- a/public/login.html+++ b/public/login.html@@ -1220,109 +1220,126 @@const emailInput = document.getElementById('email');const passwordInput = document.getElementById('password');- const agent = await createAgentUI({- canvas: document.getElementById('avatar-canvas'),- // Plant him: no camera parallax means he holds his mark and never- // drifts after the cursor.- parallax: false,- clips: ['idle', 'covereyes', 'facepalm', 'dance'],- subclips: {- covereyes: { start: 0, end: 48, fps: 30 },- },- });-- const AVATAR_ANCHOR = { anchor: 'bottom-center', offsetY: -50 };-- // Park him on his mark in the idle pose for the initial frame.- agent.standOn(avatarWrap, AVATAR_ANCHOR);- avatarWrap?.classList.remove('loading');-- // The avatar lives on a viewport-fixed overlay canvas, so left alone he- // would stay glued to the screen and trail the viewport down into the- // footer as you scroll. Re-pin him to his anchor in the panel on every- // scroll/resize so he holds his place in the login card and slides away- // with it instead. Only his position is updated — the active clip is left- // untouched so idle / cover-eyes / facepalm / celebrate keep playing.- function repinAvatar() {- if (!agent.avatar) return;- // When the panel is collapsed (short-viewport breakpoint hides it)- // the wrap has no layout box — leave him where he is rather than- // snapping to the corner.- if (!avatarWrap.offsetParent) return;- const target = agent.worldOfElement(avatarWrap, AVATAR_ANCHOR);- agent.avatar.position.x = target.x;- agent.avatar.position.y = target.y;- }-- let repinQueued = false;- function scheduleRepin() {- if (repinQueued) return;- repinQueued = true;- requestAnimationFrame(() => {- repinQueued = false;- repinAvatar();+ // The avatar's GLB and clip JSONs arrive over the network inside+ // createAgentUI. Awaited at module top level, a transient fetch failure+ // used to reject the whole module and surface as an uncaught+ // "Failed to fetch". The avatar is decoration: if it can't load, hide+ // its stage and let the form carry on (every caller reaches the+ // __avatarReact / __avatarFall / __avatarCelebrate hooks via optional+ // chaining, so their absence is already designed for).+ let agent;+ try {+ agent = await createAgentUI({+ canvas: document.getElementById('avatar-canvas'),+ // Plant him: no camera parallax means he holds his mark and never+ // drifts after the cursor.+ parallax: false,+ clips: ['idle', 'covereyes', 'facepalm', 'dance'],+ subclips: {+ covereyes: { start: 0, end: 48, fps: 30 },+ },});- }+ } catch (err) {+ avatarWrap?.classList.remove('loading');+ if (avatarWrap) avatarWrap.style.display = 'none';+ console.warn('[login] avatar unavailable, continuing without it:', err);+ }++ if (agent) {++ const AVATAR_ANCHOR = { anchor: 'bottom-center', offsetY: -50 };++ // Park him on his mark in the idle pose for the initial frame.+ agent.standOn(avatarWrap, AVATAR_ANCHOR);+ avatarWrap?.classList.remove('loading');++ // The avatar lives on a viewport-fixed overlay canvas, so left alone he+ // would stay glued to the screen and trail the viewport down into the+ // footer as you scroll. Re-pin him to his anchor in the panel on every+ // scroll/resize so he holds his place in the login card and slides away+ // with it instead. Only his position is updated — the active clip is left+ // untouched so idle / cover-eyes / facepalm / celebrate keep playing.+ function repinAvatar() {+ if (!agent.avatar) return;+ // When the panel is collapsed (short-viewport breakpoint hides it)+ // the wrap has no layout box — leave him where he is rather than+ // snapping to the corner.+ if (!avatarWrap.offsetParent) return;+ const target = agent.worldOfElement(avatarWrap, AVATAR_ANCHOR);+ agent.avatar.position.x = target.x;+ agent.avatar.position.y = target.y;+ }++ let repinQueued = false;+ function scheduleRepin() {+ if (repinQueued) return;+ repinQueued = true;+ requestAnimationFrame(() => {+ repinQueued = false;+ repinAvatar();+ });+ }++ window.addEventListener('scroll', scheduleRepin, { passive: true });+ window.addEventListener('resize', scheduleRepin);++ // The avatar shields its eyes whenever the user is typing a+ // credential — email or password — so it never "peeks" at what+ // you enter. It stays covered while focus moves between the two+ // fields (or to the password show/hide toggle) and only relaxes+ // back to idle once you leave the credential inputs entirely.+ const credentialFields = [emailInput, passwordInput];++ function coverEyes() {+ if (agent.currentClip === 'covereyes') return;+ agent.play('covereyes', { loop: false, hold: true });+ agent.faceFront();+ }+ function uncoverEyes(e) {+ const to = e.relatedTarget;+ if (to && (credentialFields.includes(to) || to.closest?.('.password-wrap'))) return;+ agent.play('idle', { loop: true });+ }++ credentialFields.forEach((field) => {+ field.addEventListener('focus', coverEyes);+ field.addEventListener('blur', uncoverEyes);+ });++ // Settle back to a resting pose after a one-shot reaction. If the+ // user is still in a credential field, the eyes stay shielded;+ // otherwise the avatar relaxes to idle.+ function settle() {+ const active = document.activeElement;+ if (active && credentialFields.includes(active)) coverEyes();+ else agent.play('idle', { loop: true });+ }- window.addEventListener('scroll', scheduleRepin, { passive: true });- window.addEventListener('resize', scheduleRepin);-- // The avatar shields its eyes whenever the user is typing a- // credential — email or password — so it never "peeks" at what- // you enter. It stays covered while focus moves between the two- // fields (or to the password show/hide toggle) and only relaxes- // back to idle once you leave the credential inputs entirely.- const credentialFields = [emailInput, passwordInput];-- function coverEyes() {- if (agent.currentClip === 'covereyes') return;- agent.play('covereyes', { loop: false, hold: true });- agent.faceFront();- }- function uncoverEyes(e) {- const to = e.relatedTarget;- if (to && (credentialFields.includes(to) || to.closest?.('.password-wrap'))) return;- agent.play('idle', { loop: true });- }-- credentialFields.forEach((field) => {- field.addEventListener('focus', coverEyes);- field.addEventListener('blur', uncoverEyes);- });-- // Settle back to a resting pose after a one-shot reaction. If the- // user is still in a credential field, the eyes stay shielded;- // otherwise the avatar relaxes to idle.- function settle() {- const active = document.activeElement;- if (active && credentialFields.includes(active)) coverEyes();- else agent.play('idle', { loop: true });- }-- // Empty field — a quick facepalm nudge, no full collapse.- window.__avatarReact = function () {- agent.faceFront();- agent.play('facepalm', { loop: false });- const dur = agent.clip('facepalm') * 1000;- setTimeout(() => {- if (agent.currentClip === 'facepalm') settle();- }, dur - 150);- };-- // Wrong credentials — same upright facepalm nudge as an empty field.- // He reacts with character but stays on his feet and on his mark;- // he never topples or wanders.- window.__avatarFall = window.__avatarReact;-- // Successful sign-in — a happy dance while we redirect.- window.__avatarCelebrate = function () {- agent.faceFront();- agent.play('dance', { loop: true });- // Report one dance-cycle length (ms) so the redirect can wait for a- // natural beat of the animation rather than a hard-coded delay.- const cycle = agent.clip('dance');- return cycle ? cycle * 1000 : 0;- };+ // Empty field — a quick facepalm nudge, no full collapse.+ window.__avatarReact = function () {+ agent.faceFront();+ agent.play('facepalm', { loop: false });+ const dur = agent.clip('facepalm') * 1000;+ setTimeout(() => {+ if (agent.currentClip === 'facepalm') settle();+ }, dur - 150);+ };++ // Wrong credentials — same upright facepalm nudge as an empty field.+ // He reacts with character but stays on his feet and on his mark;+ // he never topples or wanders.+ window.__avatarFall = window.__avatarReact;++ // Successful sign-in — a happy dance while we redirect.+ window.__avatarCelebrate = function () {+ agent.faceFront();+ agent.play('dance', { loop: true });+ // Report one dance-cycle length (ms) so the redirect can wait for a+ // natural beat of the animation rather than a hard-coded delay.+ const cycle = agent.clip('dance');+ return cycle ? cycle * 1000 : 0;+ };+ }</script><script src="/brand.js" defer></script></body>diff --git a/public/search.js b/public/search.jsindex 83c03607c..c3077b81e 100644--- a/public/search.js+++ b/public/search.js@@ -209,7 +209,7 @@{ title: 'Scan yourself to 3D', desc: 'Turn a selfie into a 3D model', href: '/scan', icon: '📸', keys: 'scan selfie photo capture me face camera' },{ title: 'Forge from text', desc: 'Generate a 3D model from a prompt', href: '/forge', icon: '✨', keys: 'forge generate text prompt ai model create' },{ title: 'Deploy an agent on-chain', desc: 'Register an agent on-chain', href: '/deploy', icon: '🚀', keys: 'deploy register onchain erc8004 publish ship launch agent' },- { title: 'Launch a coin', desc: 'Launch a token on pump.fun', href: '/launchpad', icon: '🪙', keys: 'launch coin token mint pump fun money $three' },+ { title: 'Launch a coin', desc: 'Launch a token on pump.fun', href: '/launch', icon: '🪙', keys: 'launch coin token mint pump fun money $three' },{ title: 'Embed an agent', desc: 'Get an embed snippet for your site', href: '/embed.html', icon: '🔗', keys: 'embed iframe widget snippet share script integrate' },{ title: 'Browse all pages', desc: 'The full three.ws directory, filterable', href: '/sitemap', icon: '🗺️', keys: 'sitemap site map all pages everything directory index list browse find' },];diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex c6e200c1c..d68d8c42e 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -51,10 +51,6 @@.sm-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }.sm-badge-auth { background: rgba(255, 200, 80, .15); color: #ffcf66; }.sm-badge-internal { background: rgba(120,200,255,.12); color: #9ad4ff; }- .sm-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 16px 24px; }- .sm-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }- .sm-brand img { width: 24px; height: 24px; border-radius: 5px; }- .sm-brand:hover { text-decoration: none; }</style><meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">@@ -77,10 +73,7 @@<script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script></head><body>- <header class="sm-topbar">- <a class="sm-brand" href="/" aria-label="three.ws home"><img class="brand-mark" src="/three.svg" alt="three.ws" width="24" height="24" /><span>three.ws</span></a>- <div id="nav-container"></div>- </header>+ <header><div id="nav-container"></div></header><main class="sm-wrap"><div class="sm-hero"><h1>Sitemap</h1>diff --git a/public/studio/launch-panel.js b/public/studio/launch-panel.jsindex 318e3c6c6..6158aaf44 100644--- a/public/studio/launch-panel.js+++ b/public/studio/launch-panel.js@@ -391,6 +391,45 @@ const LP_CSS = `color:rgba(255,255,255,.52);margin-top:.1rem}.lp-ok-stamp-sub{font-size:.7rem;color:rgba(255,255,255,.35);line-height:1.5;margin:-.3rem 0 0;text-align:center}++/* Field counters + inline validation */+.lp-frow{display:flex;align-items:baseline;gap:.5rem}+.lp-frow input{flex:1;min-width:0}+.lp-count{flex-shrink:0;font-size:.62rem;color:rgba(255,255,255,.26);+ font-variant-numeric:tabular-nums;letter-spacing:.02em}+.lp-count.warn{color:#f6c498}+.lp-lrow{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem}+.lp-field-msg{font-size:.66rem;color:#f6b3b3;margin-top:.2rem}+.lp-field-msg[hidden]{display:none}+.lp input[aria-invalid="true"],.lp textarea[aria-invalid="true"]{border-color:rgba(246,140,140,.5)}+.lp-iname[aria-invalid="true"]{border-bottom-color:rgba(246,140,140,.5)}+.lp-img-err{font-size:.7rem;color:#f6b3b3;padding:.45rem .65rem;border-radius:8px;line-height:1.45;+ background:rgba(246,179,179,.07);border:1px solid rgba(246,179,179,.18)}+.lp-img-err[hidden]{display:none}++/* Launch progress stepper */+.lp-steps{display:flex;gap:.35rem;list-style:none;margin:.4rem 0 0;padding:0}+.lp-steps li{flex:1;display:flex;flex-direction:column;align-items:center;gap:.28rem;+ font-size:.6rem;color:rgba(255,255,255,.26);letter-spacing:.02em;text-align:center;line-height:1.2}+.lp-steps li::before{content:'';width:100%;height:3px;border-radius:2px;+ background:rgba(255,255,255,.08);transition:background .3s}+.lp-steps li.done{color:rgba(164,240,188,.72)}+.lp-steps li.done::before{background:rgba(164,240,188,.5)}+.lp-steps li.active{color:rgba(255,255,255,.82)}+.lp-steps li.active::before{background:linear-gradient(90deg,rgba(164,240,188,.6),rgba(164,240,188,.16))}++/* Focus visibility, touch targets, reduced motion */+.lp button:focus-visible,.lp a:focus-visible,.lp input:focus-visible,.lp textarea:focus-visible,+.lp-dep button:focus-visible,.lp-dep [role="button"]:focus-visible{+ outline:2px solid rgba(164,240,188,.55);outline-offset:2px}+@media (pointer:coarse){+ .lp-wbtn,.lp-copy,.lp-link-btn,.lp-tbtn,.lp-cap-btn,.lp-ex-new,.lp-again{min-height:44px}+ .lp-ex-link,.lp-ext{display:inline-flex;align-items:center;min-height:44px;box-sizing:border-box}+}+@media (prefers-reduced-motion:reduce){+ .lp *,.lp-dep-bd *{transition-duration:.01ms !important}+ .lp-steps li::before{transition:none}+}`;let _cssInjected = false;@@ -423,7 +462,10 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewname: '', symbol: '', description: '',initialBuy: '0', buybackBps: 500,imageFile: null, imagePreviewUrl: null,+ imageError: '',_symbolEdited: false,+ // Which required fields the user has visited, for inline "required" hints.+ _touched: { name: false, symbol: false, description: false },// coin type: 'agent' (default — buyback-bound), 'regular' (plain pump.fun coin),// 'mayhem' (pump.fun mayhem mode), 'usdc' (USDC-denominated agent — coming soon)@@ -457,7 +499,7 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewerrorMsg: '',// success- mint: null, resolvedAgentId: null,+ mint: null, resolvedAgentId: null, launchSig: null,// timeout escape hatchpendingConfirm: null, // { prepId, sig, network }@@ -822,19 +864,26 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewasync function openAgentDepositModal() {const addr = s.agentWallet?.address;if (!addr) return;++ const prevActive = document.activeElement;+ const prevOverflow = document.body.style.overflow;+ document.body.style.overflow = 'hidden';+const bd = document.createElement('div');bd.className = 'lp-dep-bd';- bd.innerHTML = `<div class="lp-dep" role="dialog" aria-label="Fund agent wallet">+ bd.innerHTML = `<div class="lp-dep" role="dialog" aria-modal="true" aria-labelledby="lp-dep-title"><div class="lp-dep-head"><div>- <p class="lp-dep-title">Fund agent wallet</p>+ <p class="lp-dep-title" id="lp-dep-title">Fund agent wallet</p><p class="lp-dep-sub">Send SOL to your agent's custodial wallet. The agent signs and pays for its own launch.</p></div><button class="lp-dep-x" id="lp-dep-close" aria-label="Close">✕</button></div><span class="lp-dep-net">SOLANA · MAINNET</span>- <div class="lp-dep-qr" id="lp-dep-qr"></div>- <div class="lp-dep-addr" id="lp-dep-addr" role="button" tabindex="0" title="Click to copy">+ <div class="lp-dep-qr" id="lp-dep-qr">+ <div class="lp-dep-qr-load" role="status" aria-live="polite" aria-label="Loading QR code"></div>+ </div>+ <div class="lp-dep-addr" id="lp-dep-addr" role="button" tabindex="0" aria-label="Copy agent wallet address"><code>${esc(addr)}</code><span class="lp-dep-addr-copy" id="lp-dep-addr-label">Copy</span></div>@@ -843,11 +892,37 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView</div>`;document.body.appendChild(bd);- const close = () => { bd.remove(); document.removeEventListener('keydown', onKey); };- const onKey = (e) => { if (e.key === 'Escape') close(); };+ let closed = false;+ const close = () => {+ if (closed) return;+ closed = true;+ bd.remove();+ document.removeEventListener('keydown', onKey);+ document.body.style.overflow = prevOverflow;+ if (prevActive && prevActive.isConnected && typeof prevActive.focus === 'function') {+ prevActive.focus();+ }+ };++ // Focus trap: cycle Tab/Shift+Tab between the modal's interactive elements.+ const FOCUSABLE = '#lp-dep-close, #lp-dep-addr';+ const onKey = (e) => {+ if (e.key === 'Escape') { close(); return; }+ if (e.key !== 'Tab') return;+ const items = Array.from(bd.querySelectorAll(FOCUSABLE));+ if (items.length === 0) return;+ const first = items[0], last = items[items.length - 1];+ const active = document.activeElement;+ if (e.shiftKey && (active === first || !bd.contains(active))) {+ e.preventDefault(); last.focus();+ } else if (!e.shiftKey && (active === last || !bd.contains(active))) {+ e.preventDefault(); first.focus();+ }+ };document.addEventListener('keydown', onKey);bd.addEventListener('click', (e) => { if (e.target === bd) close(); });bd.querySelector('#lp-dep-close').addEventListener('click', close);+ bd.querySelector('#lp-dep-close').focus();const copyAddr = async () => {try { await navigator.clipboard.writeText(addr); } catch { return; }@@ -863,14 +938,18 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewtry {const mod = await import('https://esm.sh/[email protected]');+ if (closed) return;const QRCode = mod.default ?? mod;const canvas = document.createElement('canvas');await QRCode.toCanvas(canvas, addr, { width: 220, margin: 1, color: { dark: '#0c0c0c', light: '#ffffff' } });+ if (closed) return;const slot = bd.querySelector('#lp-dep-qr');if (slot) { slot.innerHTML = ''; slot.appendChild(canvas); }- } catch {+ } catch (err) {+ console.warn('[launch-panel] QR render failed', err);+ if (closed) return;const slot = bd.querySelector('#lp-dep-qr');- if (slot) slot.innerHTML = `<div style="padding:1rem;font-size:.72rem;color:#666">QR unavailable — copy address below</div>`;+ if (slot) slot.innerHTML = `<div class="lp-dep-qr-err">QR unavailable.<br>Copy the address below.</div>`;}}@@ -897,10 +976,28 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView// ── Image handling ─────────────────────────────────────────────────────+ // Inline image error, DOM-patched so showing it never re-renders the form+ // (a full render would drop focus mid-typing).+ function setImageError(msg) {+ s.imageError = msg || '';+ const el = container.querySelector('#lp-img-err');+ if (el) { el.textContent = s.imageError; el.hidden = !s.imageError; }+ }+function handleImageFile(file) {- if (!file?.type.startsWith('image/')) return;- if (file.size > 4 * 1024 * 1024) { alert('Image must be under 4 MB'); return; }+ if (!file) return;+ if (!file.type.startsWith('image/')) {+ setImageError('That file is not an image. Use a PNG, JPG, GIF, or WebP.');+ return;+ }+ if (file.size > 4 * 1024 * 1024) {+ setImageError('Image must be under 4 MB. Resize it and try again.');+ return;+ }+ setImageError('');s.imageFile = file;+ // A new image invalidates any cached metadata upload.+ s._metaUrl = null; s._metaKey = null;const reader = new FileReader();reader.onload = (e) => {s.imagePreviewUrl = e.target.result;@@ -924,13 +1021,13 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewconst camera = viewer?.activeCamera || viewer?.camera;const srcCanvas = renderer?.domElement;if (!renderer || !scene || !camera || !srcCanvas) {- alert('Preview not ready yet — wait for the avatar to load.');+ setImageError('Preview not ready yet. Wait for the avatar to load, then try again.');return;}try {renderer.render(scene, camera);} catch {- alert('Could not capture preview.');+ setImageError('Could not capture the 3D preview. Try again in a moment.');return;}// Crop to a centered square so the token image is balanced.@@ -942,7 +1039,7 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewconst ctx = out.getContext('2d');ctx.drawImage(srcCanvas, sx, sy, size, size, 0, 0, out.width, out.height);const blob = await new Promise((r) => out.toBlob(r, 'image/png'));- if (!blob) { alert('Could not capture preview.'); return; }+ if (!blob) { setImageError('Could not capture the 3D preview. Try again in a moment.'); return; }const file = new File([blob], `avatar-${Date.now()}.png`, { type: 'image/png' });handleImageFile(file);}@@ -983,7 +1080,12 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewView// Preserve the symbol exactly as entered (whitespace/emoji/special chars), cap at 10 codepoints.const symTrim = [...s.symbol].slice(0, 10).join('');const descTrim = s.description.trim().slice(0, 500);- const metaKey = `${nameTrim}|${symTrim}|${descTrim}|${!!s.imageFile}`;+ // Key includes the file's identity, not just its presence, so swapping+ // the image after a failed attempt never reuses stale metadata.+ const fileKey = s.imageFile+ ? `${s.imageFile.name}:${s.imageFile.size}:${s.imageFile.lastModified || 0}`+ : 'none';+ const metaKey = `${nameTrim}|${symTrim}|${descTrim}|${fileKey}`;if (s._metaKey !== metaKey || !s._metaUrl) {let imageDataUrl = null;@@ -1135,6 +1237,7 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViewconst conn = new Connection(RPC_URL, 'confirmed');const sig = await conn.sendRawTransaction(signed.serialize(), { skipPreflight: false });+ s.launchSig = sig;try {await pollConfirmation(conn, sig);@@ -1182,6 +1285,7 @@ export function mountLaunchPanel(container, { getAvatar, getUser, getPreviewViews.resolvedAgentId = data.agent_id;s.mint = data.mint;+ s.launchSig = data.signature || null;s.phase = 'success';// Refresh agent balance so the UI reflects the launch spend.refreshAgentBalance();diff --git a/public/viewer.html b/public/viewer.htmlindex 5e84cd286..b4ddedaed 100644--- a/public/viewer.html+++ b/public/viewer.html@@ -80,6 +80,53 @@.badge.tampered { color: #ffc2c2; background: rgba(255,86,86,.13); border-color: rgba(255,86,86,.36); }.badge.unknown { color: #9aa3b2; background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); }.badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }++ /* ── "Do more" funnel sheet ─────────────────────────────────────────── */+ #more-btn { position: relative; }+ #more-btn.pulse::after {+ content: ""; position: absolute; inset: -3px; border-radius: 13px;+ border: 2px solid rgba(110,168,254,.55); animation: morepulse 1.6s ease-out 2; pointer-events: none;+ }+ @keyframes morepulse { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12); } }+ @media (prefers-reduced-motion: reduce) { #more-btn.pulse::after { animation: none; display: none; } }+ #sheet-wrap { position: fixed; inset: 0; z-index: 40; }+ #sheet-backdrop { position: absolute; inset: 0; background: rgba(4,5,8,.55); backdrop-filter: blur(2px); opacity: 0; transition: opacity .22s ease; }+ #sheet {+ position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 24px);+ width: min(780px, 100%); max-height: min(78dvh, 640px); overflow-y: auto;+ background: #12141a; border: 1px solid rgba(255,255,255,.1); border-bottom: 0;+ border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));+ box-shadow: 0 -18px 60px rgba(0,0,0,.5);+ opacity: 0; transition: opacity .22s ease, transform .22s ease;+ }+ #sheet-wrap.open #sheet-backdrop { opacity: 1; }+ #sheet-wrap.open #sheet { opacity: 1; transform: translate(-50%, 0); }+ @media (prefers-reduced-motion: reduce) { #sheet, #sheet-backdrop { transition: none; } }+ .sheet-head { display: flex; align-items: baseline; gap: 10px; margin: 2px 2px 14px; }+ .sheet-title { font-size: 16px; font-weight: 700; }+ .sheet-sub { flex: 1 1 auto; color: #9aa3b2; font-size: 12.5px; }+ .sheet-close {+ appearance: none; cursor: pointer; border: 0; background: rgba(255,255,255,.07); color: #aeb6c4;+ width: 28px; height: 28px; border-radius: 50%; font-size: 13px; line-height: 1; flex: 0 0 auto;+ transition: background .15s, color .15s; align-self: center;+ }+ .sheet-close:hover { background: rgba(255,255,255,.14); color: #fff; }+ .sheet-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }+ .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }+ .card {+ display: flex; flex-direction: column; gap: 4px; text-align: left; text-decoration: none;+ appearance: none; cursor: pointer; font: inherit; color: #e8eaf0;+ background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);+ border-radius: 13px; padding: 13px 14px;+ transition: background .15s, border-color .15s, transform .12s;+ }+ .card:hover { background: rgba(110,168,254,.09); border-color: rgba(110,168,254,.4); transform: translateY(-1px); }+ .card:active { transform: translateY(0); }+ .card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }+ .card[disabled] { opacity: .55; cursor: progress; transform: none; }+ .card .k { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }+ .card .k .glyph { color: var(--accent); font-size: 15px; width: 18px; text-align: center; flex: 0 0 auto; }+ .card .d { color: #9aa3b2; font-size: 12px; line-height: 1.45; }</style><link rel="canonical" href="https://three.ws/viewer">@@ -135,8 +182,54 @@<button id="ar-btn" class="btn" type="button" aria-label="View this model in augmented reality">View in AR</button><div class="spacer"></div><a id="download" class="btn" download aria-label="Download the GLB file">Download GLB</a>- <a class="btn primary" href="https://three.ws" aria-label="Create your own 3D model at three.ws">Make your own →</a>+ <a id="make-own" class="btn primary" href="https://three.ws" aria-label="Create your own 3D model at three.ws">Make your own →</a>+ <button id="more-btn" class="btn primary hidden" type="button" aria-haspopup="dialog" aria-controls="sheet-wrap" aria-expanded="false">Do more with this model</button></footer>++ <div id="sheet-wrap" class="hidden" role="dialog" aria-modal="true" aria-labelledby="sheet-title">+ <div id="sheet-backdrop"></div>+ <div id="sheet">+ <div class="sheet-head">+ <div id="sheet-title" class="sheet-title">Do more with this model</div>+ <div class="sheet-sub">It's yours. Take it further.</div>+ <button class="sheet-close" type="button" aria-label="Close">✕</button>+ </div>+ <div class="cards">+ <a class="card hidden" id="act-animate">+ <span class="k"><span class="glyph" aria-hidden="true">▶</span>Pose & animate</span>+ <span class="d">Open it in Pose Studio and drive it with the animation library.</span>+ </a>+ <a class="card" id="act-restyle">+ <span class="k"><span class="glyph" aria-hidden="true">◈</span>Restyle it</span>+ <span class="d">Keep the mesh, re-skin the material: chrome, wood, neon, anything.</span>+ </a>+ <a class="card" id="act-scene">+ <span class="k"><span class="glyph" aria-hidden="true">⬢</span>Build a scene</span>+ <span class="d">Drop it into Scene Studio and compose a world around it.</span>+ </a>+ <a class="card" id="act-compose">+ <span class="k"><span class="glyph" aria-hidden="true">⧉</span>Combine parts</span>+ <span class="d">Mix it with other models and forge new parts onto it.</span>+ </a>+ <button class="card" id="act-ar" type="button">+ <span class="k"><span class="glyph" aria-hidden="true">◎</span>See it in your room</span>+ <span class="d">Place it in AR: straight from your phone, or scan a QR from desktop.</span>+ </button>+ <button class="card" id="act-coin" type="button">+ <span class="k"><span class="glyph" aria-hidden="true">◉</span>Launch it as a coin</span>+ <span class="d" id="coin-d">Open a pump.fun launch with this model as the token image.</span>+ </button>+ <button class="card" id="act-embed" type="button">+ <span class="k"><span class="glyph" aria-hidden="true"></></span>Embed it anywhere</span>+ <span class="d" id="embed-d">Copy an iframe snippet that shows this exact viewer on your site.</span>+ </button>+ <a class="card" id="act-forge" href="/forge">+ <span class="k"><span class="glyph" aria-hidden="true">✦</span>Forge another</span>+ <span class="d">Describe anything and get a new 3D model, free.</span>+ </a>+ </div>+ </div>+ </div></div><script>@@ -175,12 +268,185 @@mv.classList.remove('veiled');// Expose the AR button only when the device/model can actually enter AR.if (mv.canActivateAR) { arBtn.style.display = 'inline-flex'; }+ revealFunnel();});mv.addEventListener('error', function () {fail('The 3D model could not be displayed. You can still download the GLB file.');});arBtn.addEventListener('click', function () { try { mv.activateAR(); } catch (e) {} });+ // ── "Do more" funnel: every generated model funnels into a next step:+ // animate, restyle, scene, parts, AR, a pump.fun coin, or an embed. ──────+ var moreBtn = document.getElementById('more-btn');+ var makeOwn = document.getElementById('make-own');+ var sheetWrap = document.getElementById('sheet-wrap');+ var sheetBackdrop = document.getElementById('sheet-backdrop');+ var sheetClose = sheetWrap.querySelector('.sheet-close');+ var enc = encodeURIComponent;+ var tOpt = title ? '&title=' + enc(title) : '';++ document.getElementById('act-animate').href = '/pose?src=' + enc(src) + tOpt;+ document.getElementById('act-restyle').href = '/restyle?url=' + enc(src);+ document.getElementById('act-scene').href = '/scene?model=' + enc(src) + (title ? '&name=' + enc(title) : '');+ document.getElementById('act-compose').href = '/compose?glb=' + enc(src);++ function revealFunnel() {+ makeOwn.classList.add('hidden');+ moreBtn.classList.remove('hidden');+ moreBtn.classList.add('pulse');+ probeSkeleton();+ }++ var lastFocus = null;+ function openSheet() {+ lastFocus = document.activeElement;+ sheetWrap.classList.remove('hidden');+ void sheetWrap.offsetWidth; // commit the hidden→shown frame so the transition runs+ sheetWrap.classList.add('open');+ moreBtn.classList.remove('pulse');+ moreBtn.setAttribute('aria-expanded', 'true');+ sheetClose.focus();+ }+ function closeSheet() {+ sheetWrap.classList.remove('open');+ moreBtn.setAttribute('aria-expanded', 'false');+ setTimeout(function () { sheetWrap.classList.add('hidden'); }, 240);+ if (lastFocus && lastFocus.focus) lastFocus.focus();+ }+ moreBtn.addEventListener('click', openSheet);+ sheetClose.addEventListener('click', closeSheet);+ sheetBackdrop.addEventListener('click', closeSheet);+ document.addEventListener('keydown', function (e) {+ if (sheetWrap.classList.contains('hidden')) return;+ if (e.key === 'Escape') { closeSheet(); return; }+ if (e.key !== 'Tab') return;+ // Keep Tab inside the dialog.+ var focusables = Array.prototype.filter.call(+ sheetWrap.querySelectorAll('button:not([disabled]), a[href]'),+ function (n) { return n.offsetParent !== null; }+ );+ if (!focusables.length) return;+ var first = focusables[0], last = focusables[focusables.length - 1];+ if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last.focus(); }+ else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); }+ });++ // Pose Studio can only animate a model that ships a skeleton. Read just the+ // GLB's JSON chunk (from the HTTP cache; model-viewer already fetched it)+ // and reveal the Animate card unless the model positively has no skins.+ function probeSkeleton() {+ var animateCard = document.getElementById('act-animate');+ fetch(src, { cache: 'force-cache' })+ .then(function (r) {+ if (!r.ok || !r.body) throw new Error('unreadable');+ var reader = r.body.getReader();+ var buf = new Uint8Array(0);+ var need = 20; // 12-byte GLB header + first chunk header+ function pump() {+ return reader.read().then(function (step) {+ if (step.value) {+ var merged = new Uint8Array(buf.length + step.value.length);+ merged.set(buf); merged.set(step.value, buf.length);+ buf = merged;+ }+ if (buf.length >= 20 && need === 20) {+ var dv = new DataView(buf.buffer, buf.byteOffset, buf.length);+ if (dv.getUint32(0, true) !== 0x46546c67) return null; // not binary glTF: assume rigged-capable+ var jsonLen = dv.getUint32(12, true);+ if (jsonLen > 48e6) return null;+ need = 20 + jsonLen;+ }+ if (buf.length >= need && need > 20) {+ var json = JSON.parse(new TextDecoder().decode(buf.subarray(20, need)));+ return Array.isArray(json.skins) && json.skins.length > 0;+ }+ if (step.done) return null;+ return pump();+ });+ }+ return pump().finally(function () { reader.cancel().catch(function () {}); });+ })+ .then(function (hasSkins) {+ // Show on true or unknown (null); hide only when provably unrigged.+ if (hasSkins !== false) animateCard.classList.remove('hidden');+ })+ .catch(function () { animateCard.classList.remove('hidden'); });+ }++ // AR: device AR when this browser can enter it, else the /ar page+ // (which QR-hands-off to a phone from desktop).+ document.getElementById('act-ar').addEventListener('click', function () {+ if (mv.canActivateAR) { closeSheet(); try { mv.activateAR(); } catch (e) {} return; }+ location.href = '/ar?src=' + enc(src) + tOpt;+ });++ // Coin launch: snapshot the rendered model into a token image, hand it to+ // /launch via sessionStorage (a data URL never fits in a query string).+ var coinCard = document.getElementById('act-coin');+ var coinDesc = document.getElementById('coin-d');+ function captureTokenImage() {+ return new Promise(function (resolve, reject) {+ var raw;+ try { raw = mv.toDataURL('image/png'); } catch (e) { reject(e); return; }+ var img = new Image();+ img.onload = function () {+ try {+ var size = 512;+ var c = document.createElement('canvas');+ c.width = size; c.height = size;+ var ctx = c.getContext('2d');+ ctx.fillStyle = '#0b0c10'; ctx.fillRect(0, 0, size, size);+ var s = Math.min(img.width, img.height) || 1;+ ctx.drawImage(img, (img.width - s) / 2, (img.height - s) / 2, s, s, 0, 0, size, size);+ resolve(c.toDataURL('image/webp', 0.9));+ } catch (e) { reject(e); }+ };+ img.onerror = reject;+ img.src = raw;+ });+ }+ coinCard.addEventListener('click', function () {+ if (coinCard.disabled) return;+ coinCard.disabled = true;+ coinDesc.textContent = 'Rendering the token image…';+ var name = (title || 'My 3D creation').slice(0, 32);+ var desc = (title ? title + '. ' : '') + 'Forged in 3D on three.ws.';+ var q = '/launch?name=' + enc(name) + '&description=' + enc(desc.slice(0, 500));+ captureTokenImage()+ .then(function (dataUrl) {+ try { sessionStorage.setItem('twx.launch.image', dataUrl); q += '&imageSession=1'; } catch (e) {}+ })+ .catch(function () { /* no snapshot: the launch form still opens, user uploads an image */ })+ .then(function () { location.href = q; });+ });++ // Embed: copy a paste-anywhere iframe of this exact viewer.+ var embedCard = document.getElementById('act-embed');+ var embedDesc = document.getElementById('embed-d');+ var embedDefault = embedDesc.textContent;+ function escAttr(s) { return s.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<'); }+ embedCard.addEventListener('click', function () {+ var pageUrl = location.origin + '/viewer?src=' + enc(src) + tOpt;+ var snippet = '<iframe src="' + escAttr(pageUrl) + '" width="640" height="480" '+ + 'style="border:0;border-radius:12px;background:#0b0c10" loading="lazy" '+ + 'allow="xr-spatial-tracking; fullscreen" title="' + escAttr(title || '3D model') + ' · three.ws 3D viewer"></iframe>';+ function done(ok) {+ embedDesc.textContent = ok ? 'Copied. Paste it into any HTML page.' : 'Copy failed: select and copy the address bar URL instead.';+ setTimeout(function () { embedDesc.textContent = embedDefault; }, 2600);+ }+ if (navigator.clipboard && navigator.clipboard.writeText) {+ navigator.clipboard.writeText(snippet).then(function () { done(true); }, function () { done(false); });+ } else {+ var ta = document.createElement('textarea');+ ta.value = snippet; ta.style.position = 'fixed'; ta.style.opacity = '0';+ document.body.appendChild(ta); ta.select();+ var ok = false;+ try { ok = document.execCommand('copy'); } catch (e) {}+ ta.remove();+ done(ok);+ }+ });+// Provenance badge — ask the free verify endpoint whether this model carries a// genuine, untampered three.ws content credential. Designed verified / tampered// / unverified states; silent (badge stays hidden) if the check can't run.diff --git a/scripts/build-page-index.mjs b/scripts/build-page-index.mjsindex e58875498..73107a2eb 100644--- a/scripts/build-page-index.mjs+++ b/scripts/build-page-index.mjs@@ -261,17 +261,10 @@ ${items}\t.sm-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }\t.sm-badge-auth { background: rgba(255, 200, 80, .15); color: #ffcf66; }\t.sm-badge-internal { background: rgba(120,200,255,.12); color: #9ad4ff; }-\t.sm-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1080px; margin: 0 auto; padding: 16px 24px; }-\t.sm-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }-\t.sm-brand img { width: 24px; height: 24px; border-radius: 5px; }-\t.sm-brand:hover { text-decoration: none; }</style></head><body>-\t<header class="sm-topbar">-\t\t<a class="sm-brand" href="/" aria-label="three.ws home"><img class="brand-mark" src="/three.svg" alt="three.ws" width="24" height="24" /><span>three.ws</span></a>-\t\t<div id="nav-container"></div>-\t</header>+\t<header><div id="nav-container"></div></header>\t<main class="sm-wrap">\t\t<div class="sm-hero">\t\t\t<h1>Sitemap</h1>diff --git a/scripts/page-audit.mjs b/scripts/page-audit.mjsindex 6c1659dc0..cf4ed207f 100644--- a/scripts/page-audit.mjs+++ b/scripts/page-audit.mjs@@ -100,8 +100,14 @@ function manifestRoutes() {const pages = JSON.parse(readFileSync(resolve(ROOT, 'data/pages.json'), 'utf8'));const out = [];for (const s of pages.sections || []) {+ // `machine` section = non-HTML endpoints (.xml/.txt/.json/.well-known);+ // no DOM, no console. Not part of a browser sweep.+ if (s.id === 'machine') continue;for (const p of s.pages || []) {- if (p.path && p.path.startsWith('/') && !/[:*]/.test(p.path)) out.push(p.path);+ if (!p.path || !p.path.startsWith('/') || /[:*]/.test(p.path)) continue;+ // Skip anything that resolves to a static file rather than an HTML page.+ if (!isHtmlRoute(p.path)) continue;+ out.push(p.path);}}return out;@@ -117,9 +123,9 @@ const STATIC_AUTHED_ROUTES = ['/dashboard','/dashboard/actions','/dashboard/sessions',- '/dashboard/usage',+ '/dashboard/analytics','/dashboard/wallets',- '/dashboard/storage',+ '/dashboard/settings','/dashboard/memory','/dashboard/strategy','/dashboard/voice',@@ -132,7 +138,7 @@ const STATIC_AUTHED_ROUTES = ['/profile','/settings','/my-agents',- '/api-keys',+ '/dashboard/developers',];async function seedDynamicRoutes(ctx) {@@ -154,8 +160,15 @@ async function seedDynamicRoutes(ctx) {return routes;}+// Machine-readable endpoints (.xml/.txt/.json/...) have no DOM to audit.+const isHtmlRoute = (path) => !/\.[a-z0-9]+$/i.test(path) || /\.html$/i.test(path);+function buildRouteList(dynamic) {- if (explicitRoutes.length) return [...new Set(explicitRoutes)];+ if (explicitRoutes.length) {+ const skipped = explicitRoutes.filter((r) => !isHtmlRoute(r));+ for (const r of skipped) console.log(` skipping ${r} (non-HTML endpoint, nothing to audit)`);+ return [...new Set(explicitRoutes.filter(isHtmlRoute))];+ }const authed = existsSync(AUTH_STATE) ? STATIC_AUTHED_ROUTES : [];return [...new Set([...manifestRoutes(), ...authed, ...dynamic])];}@@ -313,7 +326,14 @@ async function auditRoute(ctx, route, viewport) {});page.on('response', (res) => {const s = res.status();- if (s >= 400) push('http-' + s, s >= 500 ? 'error' : 'warn', `HTTP ${s} ${res.url()}`);+ if (s < 400) return;+ // x402 payment-gated endpoints correctly answer 402 to a non-paying+ // browser; that is the product working, not a defect.+ if (s === 402 && new URL(res.url()).pathname.startsWith('/api/')) {+ push('payment-gated', 'info', `HTTP 402 ${res.url()} (x402 payment required, expected)`);+ return;+ }+ push('http-' + s, s >= 500 ? 'error' : 'warn', `HTTP ${s} ${res.url()}`);});let navStatus = null;diff --git a/scripts/x402-bazaar-settle-sweep.mjs b/scripts/x402-bazaar-settle-sweep.mjsnew file mode 100644index 000000000..117286557--- /dev/null+++ b/scripts/x402-bazaar-settle-sweep.mjs@@ -0,0 +1,190 @@+#!/usr/bin/env node+// Settle one real Base USDC payment against every live paid x402 endpoint that+// advertises a Base accept, so the CDP Bazaar (and OpenSea's Agent Tools+// marketplace, which mirrors it) indexes all of them — not just the four that+// have historically settled through the CDP facilitator.+//+// The Bazaar only lists an endpoint after its first verify+settle passes+// through the CDP facilitator on Base; probes and registrations alone never+// get an endpoint listed. Each paid call here is a VALID business request:+// the endpoint's own 402 challenge carries extensions.bazaar.input with a+// runnable example (query params or JSON body), and that example is what gets+// sent — so the settle indexes a 200, not a paid 400.+//+// All Base accepts pay to X402_PAY_TO_BASE (the owner's wallet), so the sweep+// is an internal transfer: buyer wallet -> owner wallet, facilitator pays gas.+//+// Usage:+// X402_BUYER_PRIVATE_KEY=0x... node scripts/x402-bazaar-settle-sweep.mjs --dry-run+// X402_BUYER_PRIVATE_KEY=0x... node scripts/x402-bazaar-settle-sweep.mjs+// ... --max-usd=3 # total spend cap (default 3)+// ... --only=gas-oracle,did # limit to specific slugs+// ... --skip=model-check # skip slugs (e.g. already indexed)+// ... --include-pump-launch # NEVER default: $5 and mints a real coin+//+// Endpoints are paid cheapest-first so a low balance still yields the maximum+// number of listings before the budget or balance runs out.++import { writeFileSync, mkdirSync } from 'node:fs';+import { fileURLToPath } from 'node:url';+import path from 'node:path';++import { wrapFetchWithPayment } from '@x402/fetch';+import { x402Client } from '@x402/core/client';+import { registerExactEvmScheme } from '@x402/evm/exact/client';+import { privateKeyToAccount } from 'viem/accounts';+import { createPublicClient, http, erc20Abi, formatUnits } from 'viem';+import { base } from 'viem/chains';++const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const { getCatalog } = await import(path.join(root, 'api/_lib/service-catalog/index.js'));++const argv = process.argv.slice(2);+const flag = (name) => argv.includes(`--${name}`);+const opt = (name, dflt) => {+ const hit = argv.find((a) => a.startsWith(`--${name}=`));+ return hit ? hit.slice(name.length + 3) : dflt;+};++const DRY_RUN = flag('dry-run');+const MAX_USD = Number(opt('max-usd', '3'));+const ONLY = (opt('only', '') || '').split(',').map((s) => s.trim()).filter(Boolean);+const SKIP = new Set((opt('skip', '') || '').split(',').map((s) => s.trim()).filter(Boolean));+const INCLUDE_PUMP_LAUNCH = flag('include-pump-launch');+const BASE_RPC = process.env.X402_RPC_URL || 'https://mainnet.base.org';+const USDC_BASE = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';++if (!INCLUDE_PUMP_LAUNCH) SKIP.add('pump-launch');++const PRIVATE_KEY = process.env.X402_BUYER_PRIVATE_KEY || process.env.A2A_PAYER_PRIVATE_KEY;+if (!PRIVATE_KEY && !DRY_RUN) {+ console.error('Missing X402_BUYER_PRIVATE_KEY (funded Base USDC wallet). Use --dry-run to plan without one.');+ process.exit(2);+}++const isBaseAccept = (a) => /8453|^base$/.test(String(a?.network || ''));++// ── 1. plan: probe every live paid endpooint's 402 for a Base accept + example input ──+const catalog = await getCatalog();+const live = catalog.filter((e) => e.source === 'x402' && e.status === 'live');++async function probe(entry) {+ const method = (entry.method || 'GET').toUpperCase();+ try {+ const res = await fetch(entry.endpoint, {+ method,+ headers: { accept: 'application/json', ...(method === 'POST' ? { 'content-type': 'application/json' } : {}) },+ ...(method === 'POST' ? { body: '{}' } : {}),+ signal: AbortSignal.timeout(15_000),+ });+ if (res.status !== 402) return { slug: entry.slug, skip: `probe HTTP ${res.status} (not 402)` };+ const body = await res.json().catch(() => null);+ const accept = (body?.accepts || []).find(isBaseAccept);+ if (!accept) return { slug: entry.slug, skip: 'no Base accept advertised' };+ const input = body?.extensions?.bazaar?.input || null;+ const priceUsd = Number(accept.amount ?? accept.maxAmountRequired ?? 0) / 1e6;+ let url = entry.endpoint;+ let requestBody;+ if (input?.type === 'query' && input.example && typeof input.example === 'object') {+ const qs = new URLSearchParams();+ for (const [k, v] of Object.entries(input.example)) qs.set(k, typeof v === 'string' ? v : JSON.stringify(v));+ if ([...qs.keys()].length) url += (url.includes('?') ? '&' : '?') + qs.toString();+ } else if (input?.type === 'json' && input.example !== undefined) {+ requestBody = JSON.stringify(input.example);+ } else if (method === 'POST') {+ requestBody = '{}';+ }+ return { slug: entry.slug, method, url, requestBody, priceUsd, payTo: accept.payTo };+ } catch (err) {+ return { slug: entry.slug, skip: `probe failed: ${String(err?.message || err).slice(0, 80)}` };+ }+}++console.log(`catalog: ${live.length} live paid endpoints; probing for Base accepts…`);+const probes = [];+for (let i = 0; i < live.length; i += 10) {+ probes.push(...(await Promise.all(live.slice(i, i + 10).map(probe))));+}++const skipped = probes.filter((p) => p.skip || SKIP.has(p.slug) || (ONLY.length && !ONLY.includes(p.slug)));+for (const s of skipped) if (!s.skip) s.skip = ONLY.length && !ONLY.includes(s.slug) ? '--only filter' : '--skip filter';+const plan = probes+ .filter((p) => !p.skip && !SKIP.has(p.slug) && (!ONLY.length || ONLY.includes(p.slug)))+ .sort((a, b) => a.priceUsd - b.priceUsd);++const planTotal = plan.reduce((s, p) => s + p.priceUsd, 0);+console.log(`plan: ${plan.length} endpoints, $${planTotal.toFixed(3)} total (cap $${MAX_USD}); ${skipped.length} skipped`);+for (const s of skipped) console.log(` SKIP ${s.slug}: ${s.skip}`);++if (DRY_RUN) {+ for (const p of plan) console.log(` PAY $${p.priceUsd.toFixed(3).padEnd(6)} ${p.method.padEnd(4)} ${p.url}${p.requestBody ? ` body=${p.requestBody.slice(0, 80)}` : ''}`);+ process.exit(0);+}++// ── 2. buyer preflight: enough Base USDC for at least the cheapest call ──+const account = privateKeyToAccount(PRIVATE_KEY.startsWith('0x') ? PRIVATE_KEY : `0x${PRIVATE_KEY}`);+const reader = createPublicClient({ chain: base, transport: http(BASE_RPC) });+const balanceAtomic = await reader.readContract({ address: USDC_BASE, abi: erc20Abi, functionName: 'balanceOf', args: [account.address] });+const balanceUsd = Number(formatUnits(balanceAtomic, 6));+console.log(`buyer ${account.address}: ${balanceUsd} USDC on Base`);+if (!plan.length) { console.log('nothing to pay.'); process.exit(0); }+if (balanceUsd < plan[0].priceUsd) {+ console.error(`buyer balance $${balanceUsd} cannot cover even the cheapest call ($${plan[0].priceUsd}). Fund ${account.address} with Base USDC.`);+ process.exit(3);+}++const client = new x402Client();+registerExactEvmScheme(client, { signer: account, schemeOptions: { [base.id]: { rpcUrl: BASE_RPC } } });+const fetchWithPayment = wrapFetchWithPayment(fetch, client);++// ── 3. pay cheapest-first under the cap, recording every settle ──+const results = [];+let spent = 0;+for (const p of plan) {+ if (spent + p.priceUsd > MAX_USD) { results.push({ ...p, outcome: 'budget-capped' }); continue; }+ if (spent + p.priceUsd > balanceUsd) { results.push({ ...p, outcome: 'balance-exhausted' }); continue; }+ const t0 = Date.now();+ try {+ const res = await fetchWithPayment(p.url, {+ method: p.method,+ headers: { accept: 'application/json', ...(p.requestBody ? { 'content-type': 'application/json' } : {}) },+ ...(p.requestBody ? { body: p.requestBody } : {}),+ });+ const elapsed = Date.now() - t0;+ const text = await res.text();+ let settle = null;+ const settleHeader = res.headers.get('payment-response') || res.headers.get('x-payment-response');+ if (settleHeader) {+ try { settle = JSON.parse(Buffer.from(settleHeader, 'base64').toString('utf8')); } catch { settle = { raw: settleHeader.slice(0, 120) }; }+ }+ const paid = Boolean(settle);+ if (paid) spent += p.priceUsd;+ results.push({+ slug: p.slug, url: p.url, priceUsd: p.priceUsd, status: res.status, elapsedMs: elapsed,+ outcome: paid ? (res.ok ? 'settled-200' : `settled-but-${res.status}`) : `unpaid-${res.status}`,+ tx: settle?.transaction || settle?.txHash || null,+ bodyPreview: text.slice(0, 160),+ });+ console.log(`${paid ? 'PAID' : 'FAIL'} $${p.priceUsd.toFixed(3).padEnd(6)} HTTP ${res.status} ${p.slug}${settle?.transaction ? ` tx ${settle.transaction}` : ''}`);+ } catch (err) {+ results.push({ slug: p.slug, url: p.url, priceUsd: p.priceUsd, outcome: `error: ${String(err?.message || err).slice(0, 100)}` });+ console.log(`ERR ${p.slug}: ${String(err?.message || err).slice(0, 100)}`);+ }+}++const outDir = path.join(root, 'tasks', 'x402-bazaar');+mkdirSync(outDir, { recursive: true });+const report = {+ ranAt: new Date().toISOString(),+ buyer: account.address,+ spentUsd: Number(spent.toFixed(4)),+ settled: results.filter((r) => String(r.outcome).startsWith('settled')).length,+ planned: plan.length,+ results,+ skipped: skipped.map((s) => ({ slug: s.slug, reason: s.skip })),+};+const outFile = path.join(outDir, 'settle-sweep-report.json');+writeFileSync(outFile, `${JSON.stringify(report, null, '\t')}\n`);+console.log(`\nsettled ${report.settled}/${plan.length} for $${report.spentUsd} — report: ${path.relative(root, outFile)}`);+console.log('Bazaar indexing follows the facilitator settle; verify within ~a day via');+console.log('https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources (search "three.ws").');diff --git a/src/agora/agora-world.js b/src/agora/agora-world.jsindex 202f4c5d4..b2a0739c5 100644--- a/src/agora/agora-world.js+++ b/src/agora/agora-world.js@@ -73,7 +73,11 @@ async function main() {try {osmData = await fetchOSMData((frac, label) => progress(20 + frac * 34, label));} catch (err) {- log.error('[agora] OSM fetch failed — empty world', err);+ // Every Overpass instance is down and there is no cached payload. The+ // plaza still opens: citizens, economy layer, and play mode all work+ // without building geometry. Handled degradation, so warn (not error).+ log.warn('[agora] OSM unavailable on every instance with no cache - opening the plaza without city geometry', err);+ progress(54, 'Live map unavailable - opening the plaza without buildings…');osmData = { elements: [] };}diff --git a/src/aws-marketplace-welcome.js b/src/aws-marketplace-welcome.jsindex 908888d31..0ee157134 100644--- a/src/aws-marketplace-welcome.js+++ b/src/aws-marketplace-welcome.js@@ -64,8 +64,8 @@ async function issueApiKey() {async function linkAndIssue() {await linkSubscription();- // Surface the API key alongside success. Failures here are recoverable —- // the user can rotate from /api-keys — but log so we notice patterns.+ // Surface the API key alongside success. Failures here are recoverable+ // (the user can rotate from /dashboard/developers), but log so we notice patterns.try {return await issueApiKey();} catch (err) {diff --git a/src/bnb-hub-helpers.js b/src/bnb-hub-helpers.jsindex 4e082247e..b9541b24c 100644--- a/src/bnb-hub-helpers.js+++ b/src/bnb-hub-helpers.js@@ -40,8 +40,9 @@ export function deltaFromTarget(measuredMs, targetMs) {* A track "exists" the moment its route/API resolves — regardless of which* status it answers with. A 404 means the file genuinely isn't deployed yet* (Vercel/Cloud Run route table has no match). A 405 means the route exists- * but the probe method isn't what it wants (expected for POST-only APIs- * probed with GET/HEAD) — that still counts as live. Any 2xx/3xx/4xx other+ * but the probe method isn't what it wants: that still counts as live+ * (defensive only, since the hub probes POST-only APIs with OPTIONS precisely+ * so no 405 ever shows up in the console). Any 2xx/3xx/4xx other* than 404 counts as live; a network failure (status === null) or a 5xx* fails closed to "coming-soon" — an unreachable/erroring dependency should* never read as a shipped feature.diff --git a/src/bnb.js b/src/bnb.jsindex 31a8a250f..344147660 100644--- a/src/bnb.js+++ b/src/bnb.js@@ -96,7 +96,11 @@ const TRACKS = [production implementation), with an automatic self-pay fallback.`,caveat: 'MegaFuel is one operator (NodeReal); BEP-414 is still Draft status. Sponsorship decline always falls through to self-pay — it never blocks registration.',primary: { label: 'Register an agent gaslessly', href: '/create-agent' },+ // register-agent is POST-only: a HEAD/GET probe 405s (a console error on+ // every page load). OPTIONS resolves the route without invoking it - the+ // handler's CORS preflight answers 204 when deployed, 404 when not.primaryCheck: '/api/bnb/register-agent',+ primaryCheckMethod: 'OPTIONS',secondary: { label: 'Read the payments guide', href: '/docs/bnb-payments' },secondaryCheck: '/docs/bnb-payments.md',},@@ -162,10 +166,14 @@ function cardHtml(track) {</article>`;}-/** Probe a URL and resolve to an HTTP status, or null on network failure/timeout. */-async function probe(url) {+/**+ * Probe a URL and resolve to an HTTP status, or null on network failure/timeout.+ * HEAD by default (pages, docs); POST-only APIs pass OPTIONS via the track's+ * *CheckMethod so the probe never triggers a 405 console error.+ */+async function probe(url, probeMethod = 'HEAD') {try {- const res = await fetch(url, { method: 'HEAD', signal: AbortSignal.timeout(4000) });+ const res = await fetch(url, { method: probeMethod, signal: AbortSignal.timeout(4000) });return res.status;} catch {return null;@@ -173,11 +181,12 @@ async function probe(url) {}async function checkTrack(track) {- const checks = [track.primaryCheck, track.secondaryCheck].filter(Boolean);- const statuses = await Promise.all(checks.map(probe));- const states = statuses.map(trackLiveness);- const primaryState = trackLiveness(statuses[0]);- const secondaryState = track.secondaryCheck ? trackLiveness(statuses[1]) : 'coming-soon';+ const [primaryStatus, secondaryStatus] = await Promise.all([+ probe(track.primaryCheck, track.primaryCheckMethod),+ track.secondaryCheck ? probe(track.secondaryCheck, track.secondaryCheckMethod) : null,+ ]);+ const primaryState = trackLiveness(primaryStatus);+ const secondaryState = track.secondaryCheck ? trackLiveness(secondaryStatus) : 'coming-soon';return { cardState: combineTrackStates([primaryState]), primaryState, secondaryState };}diff --git a/src/city/city-map.js b/src/city/city-map.jsindex 7f3330fdf..d91876842 100644--- a/src/city/city-map.js+++ b/src/city/city-map.js@@ -1,15 +1,43 @@import * as THREE from 'three';import { mergeGeometries } from 'three/addons/utils/BufferGeometryUtils.js';+import { fetchFirst } from '../shared/failover-fetch.js';+import { log } from '../shared/log.js';// Manhattan — Times Square area centreconst CENTER_LAT = 40.7580;const CENTER_LON = -73.9855;const RADIUS_METERS = 700; // ~10 city blocks-// OSM localStorage cache (24h TTL)+// OSM localStorage cache (24h TTL). A payload for this bbox is ~2.2 MB of+// JSON, comfortably inside the ~5 MB localStorage quota.const CACHE_KEY = 'city-osm-manhattan-v2';const CACHE_TTL_MS = 86_400_000;+// Public Overpass instances, tried in order. overpass-api.de is a free shared+// instance that routinely 504s under load; the mirrors keep the city alive+// when it does. One flaky third-party host must never mean an empty world.+const OVERPASS_INSTANCES = [+ { name: 'overpass-api.de', base: 'https://overpass-api.de/api/interpreter' },+ { name: 'overpass.kumi.systems', base: 'https://overpass.kumi.systems/api/interpreter' },+ { name: 'maps.mail.ru', base: 'https://maps.mail.ru/osm/tools/overpass/api/interpreter' },+];+const INSTANCE_TIMEOUT_MS = 20_000; // per instance; worst case ~60s across all three++// Read the cached payload without judging its age. Returns { ts, data } or+// null; freshness is the caller's call (fresh reads honour the TTL, the+// all-instances-down path reuses a stale payload rather than render nothing).+function readOSMCache() {+ try {+ const raw = localStorage.getItem(CACHE_KEY);+ if (!raw) return null;+ const { ts, data } = JSON.parse(raw);+ if (!Number.isFinite(ts) || !Array.isArray(data?.elements)) return null;+ return { ts, data };+ } catch {+ return null; // bad or inaccessible cache+ }+}+export const CITY_HALF = RADIUS_METERS;// Web Mercator projection — returns metres from city centre in XZ world space@@ -22,18 +50,16 @@ function project(lat, lon) {};}-// Fetch building footprints from OpenStreetMap Overpass API (free, no key)+// Fetch building footprints from OpenStreetMap Overpass API (free, no key).+// Resilience ladder: fresh cache -> each Overpass instance in order (bounded+// per-instance timeout via the shared failover chain) -> stale cache. Only a+// cold cache with every instance down throws.export async function fetchOSMData(onProgress) {- try {- const raw = localStorage.getItem(CACHE_KEY);- if (raw) {- const { ts, data } = JSON.parse(raw);- if (Date.now() - ts < CACHE_TTL_MS) {- onProgress?.(0.5, 'Using cached city data…');- return data;- }- }- } catch { /* ignore bad cache */ }+ const cached = readOSMCache();+ if (cached && Date.now() - cached.ts < CACHE_TTL_MS) {+ onProgress?.(0.5, 'Using cached city data…');+ return cached.data;+ }const lat1 = CENTER_LAT - RADIUS_METERS / 111_000;const lat2 = CENTER_LAT + RADIUS_METERS / 111_000;@@ -41,27 +67,53 @@ export async function fetchOSMData(onProgress) {const lon1 = CENTER_LON - RADIUS_METERS / (111_000 * cosC);const lon2 = CENTER_LON + RADIUS_METERS / (111_000 * cosC);- // Query buildings + roads in bounding box+ // Query buildings + roads in bounding box. The server-side [timeout:20]+ // matches the client-side per-instance abort so we never wait on a query+ // the server has already given up on.const query =- `[out:json][timeout:30];` ++ `[out:json][timeout:20];` +`(way["building"](${lat1},${lon1},${lat2},${lon2});` +`way["highway"]["highway"~"^(primary|secondary|tertiary|residential|unclassified)$"](${lat1},${lon1},${lat2},${lon2});` +`);out body;>;out skel qt;`;onProgress?.(0.1, 'Fetching Manhattan map data…');- const res = await fetch(- `https://overpass-api.de/api/interpreter?data=${encodeURIComponent(query)}`,- );- if (!res.ok) throw new Error(`Overpass API ${res.status}`);-- onProgress?.(0.4, 'Parsing city geometry…');- const data = await res.json();-try {- localStorage.setItem(CACHE_KEY, JSON.stringify({ ts: Date.now(), data }));- } catch { /* quota exceeded */ }+ const { value: data, source } = await fetchFirst(+ OVERPASS_INSTANCES.map(({ name, base }) => ({+ name,+ url: `${base}?data=${encodeURIComponent(query)}`,+ parse: async (res) => {+ const body = await res.json();+ if (!Array.isArray(body?.elements)) throw new Error('malformed Overpass response');+ return body;+ },+ })),+ { timeoutMs: INSTANCE_TIMEOUT_MS, label: 'overpass' },+ );+ if (source !== OVERPASS_INSTANCES[0].name) {+ log.warn(`[city-map] Primary Overpass instance unavailable - served by mirror ${source}`);+ }- return data;+ onProgress?.(0.4, 'Parsing city geometry…');+ try {+ localStorage.setItem(CACHE_KEY, JSON.stringify({ ts: Date.now(), data }));+ } catch { /* quota exceeded - render without caching */ }++ return data;+ } catch (err) {+ // Every instance failed. A stale snapshot of Manhattan beats an empty+ // void: reuse the last good payload past its TTL. Handled degradation,+ // so warn (not error).+ if (cached) {+ log.warn(+ `[city-map] All Overpass instances failed - reusing saved city data from ${new Date(cached.ts).toISOString()}`,+ err,+ );+ onProgress?.(0.5, 'Live map unavailable - using saved city data…');+ return cached.data;+ }+ throw err;+ }}// Build the city scene from parsed OSM data.diff --git a/src/city/city-world.js b/src/city/city-world.jsindex 7684b2d58..723f9f0b8 100644--- a/src/city/city-world.js+++ b/src/city/city-world.js@@ -38,7 +38,11 @@ async function main() {progress(22 + frac * 30, label);});} catch (err) {- log.error('OSM fetch failed — loading empty world:', err);+ // Every Overpass instance is down and there is no cached payload. The+ // city still opens (ground, lights, avatar); only the OSM buildings and+ // roads are missing. Handled degradation, so warn (not error).+ log.warn('[city] OSM unavailable on every instance with no cache - loading city without buildings:', err);+ progress(52, 'Live map unavailable - loading city without buildings…');osmData = { elements: [] };}diff --git a/src/clash.css b/src/clash.cssindex b9508b841..cc0c4743e 100644--- a/src/clash.css+++ b/src/clash.css@@ -298,6 +298,14 @@.cl-state h2 { margin: 0 0 var(--space-2, 8px); font: 700 var(--text-lg) var(--font-display); color: var(--ink-bright); }.cl-state p { margin: 0 auto; max-width: 44ch; line-height: 1.5; }.cl-state .cl-fight { margin-top: var(--space-4, 16px); display: inline-block; }+.cl-state-links {+ display: flex;+ justify-content: center;+ align-items: center;+ gap: var(--space-3, 12px);+ flex-wrap: wrap;+}+.cl-state-links .cl-fight { text-decoration: none; }.cl-skel {height: 110px;border-radius: var(--radius-lg);diff --git a/src/clash.js b/src/clash.jsindex 521d8f51f..904f32323 100644--- a/src/clash.js+++ b/src/clash.js@@ -21,6 +21,7 @@ const API = '/api/clash';const game = {state: null, // last /state payloadtab: 'arena',+ ccUnavailable: false, // server answered cc_unconfigured: stop all pollingpollTimer: null,timerRaf: null,enlist: null, // { token, symbol, image, warPass, amount, walletPower, cap }@@ -193,14 +194,55 @@ function errorMessage(err, fallback) {return err?.message || fallback;}+// Designed state for that deployment gap: no retry loop (a retry can't conjure+// the missing key), just an explanation and live surfaces to move on to.+function unavailableState() {+ return el('div', { class: 'cl-state' }, [+ el('h2', { text: 'Coin Clash is temporarily unavailable' }),+ el('p', {+ text: 'The community battle service isn’t connected on this deployment yet. The armies will muster as soon as it comes online. In the meantime, the rest of the platform is live.',+ }),+ el('div', { class: 'cl-state-links' }, [+ el('a', { class: 'cl-fight', href: '/launches', text: 'See live launches →' }),+ el('a', { class: 'cl-fight', href: '/markets', text: 'Browse markets →' }),+ ]),+ ]);+}++// First cc_unconfigured answer wins: kill the 5s poll loop and pin every tab on+// the designed unavailable state, so one page view issues exactly one request.+function markUnavailable() {+ if (game.ccUnavailable) return;+ game.ccUnavailable = true;+ if (game.pollTimer) {+ clearInterval(game.pollTimer);+ game.pollTimer = null;+ }+ setLiveDot($('cl-live'), 'error', 'offline');+ const arena = $('cl-arena');+ arena.replaceChildren(unavailableState());+ arena.setAttribute('aria-busy', 'false');+ $('cl-standings').replaceChildren(unavailableState());+}+// ── Render: standings ────────────────────────────────────────────────────────async function renderStandings() {const root = $('cl-standings');+ if (game.ccUnavailable) {+ // Deployment-wide outage already established: don't issue another+ // request that can only 503 the same way.+ root.replaceChildren(unavailableState());+ return;+ }root.replaceChildren(el('div', { class: 'cl-skel' }), el('div', { class: 'cl-skel' }), el('div', { class: 'cl-skel' }));let data;try {data = await apiGet('leaderboard');} catch (err) {+ if (err?.code === 'cc_unconfigured') {+ markUnavailable();+ return;+ }root.replaceChildren(errorState(errorMessage(err), () => renderStandings()));return;}@@ -242,6 +284,7 @@ async function renderStandings() {// ── State polling + round timer ──────────────────────────────────────────────async function poll() {+ if (game.ccUnavailable) return;try {const data = await apiGet('state');game.state = data;@@ -256,6 +299,11 @@ async function poll() {}setLiveDot($('cl-live'), 'live', 'live');} catch (err) {+ if (err?.code === 'cc_unconfigured') {+ markUnavailable();+ log.warn('clash: CoinCommunities unconfigured, polling stopped', err);+ return;+ }setLiveDot($('cl-live'), game.state ? 'connecting' : 'error', game.state ? 'reconnecting' : 'offline');if (game.tab === 'arena' && !game.state) {$('cl-arena').replaceChildren(diff --git a/src/community/coin-lobby.js b/src/community/coin-lobby.jsindex 69db382bc..843912896 100644--- a/src/community/coin-lobby.js+++ b/src/community/coin-lobby.js@@ -116,16 +116,16 @@ export class CoinLobby {}}- _renderState(emoji, title, sub, retry) {+ _renderState(emoji, title, sub, action) {this.grid.innerHTML = '';const e = el('div', 'clobby__state');e.appendChild(el('div', 'clobby__state-emoji', emoji));e.appendChild(el('div', 'clobby__state-title', title));if (sub) e.appendChild(el('div', 'clobby__state-sub', sub));- if (retry) {- const b = el('button', 'clobby__retry', 'Try again');+ if (action) {+ const b = el('button', 'clobby__retry', action.label);b.type = 'button';- b.addEventListener('click', retry);+ b.addEventListener('click', action.onClick);e.appendChild(b);}this.grid.appendChild(e);@@ -218,16 +218,22 @@ export class CoinLobby {this.worlds = await fetchWorlds();} catch (err) {if (err?.code === 'cc_unconfigured') {+ // Deployment state, not a transient failure: no retry loop. Offer+ // the live surface instead: the walk scene already running behind+ // this overlay.this._renderState('🔌',- 'Worlds are coming online',- 'CoinCommunities isn’t connected on this deployment yet.',- null,+ 'Coin worlds are temporarily unavailable',+ 'The community service isn’t connected on this deployment yet. You can still walk the default world while it comes online.',+ { label: 'Walk solo →', onClick: () => this._skip() },);} else {- this._renderState('⚠️', 'Could not load worlds', err?.message || '', () => {- this._renderSkeleton();- this._load();+ this._renderState('⚠️', 'Could not load worlds', err?.message || '', {+ label: 'Try again',+ onClick: () => {+ this._renderSkeleton();+ this._load();+ },});}return;diff --git a/src/community/town-client.js b/src/community/town-client.jsindex ed5cb839e..739a95d7d 100644--- a/src/community/town-client.js+++ b/src/community/town-client.js@@ -8,8 +8,15 @@const BASE = '/api/community';+// Once the proxy answers cc_unconfigured (503: no CoinCommunities key on this+// deployment), every further call this page load would 503 identically; the+// state only changes with a redeploy. Remember the first such error and fail+// every later call fast, so one page view never spams the endpoint.+let _unconfiguredErr = null;+/** Unwrap the { data, error } envelope the proxy speaks, throwing on error. */async function call(path, init) {+ if (_unconfiguredErr) throw _unconfiguredErr;const res = await fetch(`${BASE}${path}`, init);let body = null;try {@@ -21,6 +28,7 @@ async function call(path, init) {const err = new Error(body?.error_description || body?.error || `HTTP ${res.status}`);err.status = res.status;err.code = body?.error;+ if (err.code === 'cc_unconfigured') _unconfiguredErr = err;throw err;}return body?.data ?? null;@@ -31,10 +39,20 @@ export function fetchCapabilities() {return call('/capabilities');}+// One in-flight /worlds request serves every concurrent caller (the lobby and+// coin-world-boot's enrich() can both want it during a single boot).+let _worldsInflight = null;+/** The lobby of live coin-worlds, most active first. */-export async function fetchWorlds() {- const data = await call('/worlds');- return data?.worlds ?? [];+export function fetchWorlds() {+ if (!_worldsInflight) {+ _worldsInflight = call('/worlds')+ .then((data) => data?.worlds ?? [])+ .finally(() => {+ _worldsInflight = null;+ });+ }+ return _worldsInflight;}/** Recent messages for a coin's community (newest first). */diff --git a/src/community/town.js b/src/community/town.jsindex 2a4c125e4..3b3a5ff01 100644--- a/src/community/town.js+++ b/src/community/town.js@@ -178,10 +178,30 @@ export class Town {e.appendChild(el('div', 'town__state-emoji', '⚠️'));e.appendChild(el('div', 'town__state-title', 'Could not load the feed'));e.appendChild(el('div', 'town__state-sub', msg || 'Something went wrong.'));- const btn = el('button', 'town__retry', 'Try again');- btn.type = 'button';- btn.addEventListener('click', retry);- e.appendChild(btn);+ if (retry) {+ const btn = el('button', 'town__retry', 'Try again');+ btn.type = 'button';+ btn.addEventListener('click', retry);+ e.appendChild(btn);+ }+ this.list.appendChild(e);+ }++ // Deployment-level outage (no CoinCommunities key): retrying can't fix it,+ // so the state explains itself and leaves the visitor free to keep walking+ // the 3D world behind this panel.+ _renderUnavailable() {+ this.list.innerHTML = '';+ const e = el('div', 'town__state');+ e.appendChild(el('div', 'town__state-emoji', '🔌'));+ e.appendChild(el('div', 'town__state-title', 'Community chat is temporarily unavailable'));+ e.appendChild(+ el(+ 'div',+ 'town__state-sub',+ 'The community service isn’t connected on this deployment yet. The world itself is live, so keep exploring while chat comes online.',+ ),+ );this.list.appendChild(e);}@@ -494,9 +514,7 @@ export class Town {if (msgs.status === 'rejected') {const err = msgs.reason;if (err?.code === 'cc_unconfigured') {- this._renderError('This deployment has no CoinCommunities key yet.', () =>- this._load(),- );+ this._renderUnavailable();} else {this._renderError(err?.message, () => this._load());}diff --git a/src/create-video.js b/src/create-video.jsindex 345f6db3d..e86d6e0e7 100644--- a/src/create-video.js+++ b/src/create-video.js@@ -59,9 +59,15 @@ async function loadAvatars() {let avatars = [];try {const res = await apiFetch('/api/avatars');- if (res.ok) avatars = (await res.json()) ?? [];+ if (res.ok) {+ // GET /api/avatars responds with an envelope: { avatars: [...], next_cursor }.+ // Unwrap it, tolerating a bare array so the page keeps working either way.+ const data = await res.json().catch(() => null);+ if (Array.isArray(data?.avatars)) avatars = data.avatars;+ else if (Array.isArray(data)) avatars = data;+ }} catch {- // fall through — show default avatar only+ // fall through: show default avatar only}barLoading.remove();@@ -72,12 +78,30 @@ async function loadAvatars() {}for (const av of avatars) {- addThumb(av.id, av.glb_url ?? av.storage_url, av.thumbnail_url, av.display_name || 'Avatar');+ addThumb(av.id, avatarGlbUrl(av), av.thumbnail_url, av.name || 'Avatar');}// Auto-select the first one.const first = avatars[0];- selectAvatar(first.id, first.glb_url ?? first.storage_url, first.thumbnail_url);+ selectAvatar(first.id, avatarGlbUrl(first), first.thumbnail_url);+}++// The list endpoint only carries a CDN model_url for public/unlisted avatars;+// private ones come back with model_url null and need a short-lived signed URL+// from the single-avatar endpoint (resolved lazily in selectAvatar).+function avatarGlbUrl(av) {+ return av.model_url || av.base_model_url || null;+}++async function fetchSignedGlbUrl(id) {+ try {+ const res = await apiFetch(`/api/avatars/${encodeURIComponent(id)}`);+ if (!res.ok) return null;+ const data = await res.json().catch(() => null);+ return data?.avatar?.url || data?.avatar?.model_url || null;+ } catch {+ return null;+ }}function addDefaultThumb() {@@ -100,7 +124,7 @@ function createThumb(id, glbUrl, thumbUrl, label) {el.setAttribute('tabindex', '0');el.setAttribute('aria-label', `Select ${label}`);el.dataset.id = id;- el.dataset.glb = glbUrl;+ el.dataset.glb = glbUrl || '';el.dataset.thumb = thumbUrl || '';if (thumbUrl) {@@ -119,17 +143,31 @@ function createThumb(id, glbUrl, thumbUrl, label) {return el;}-function selectAvatar(id, glbUrl, thumbUrl) {+async function selectAvatar(id, glbUrl, thumbUrl) {selectedAvatarId = id;- selectedGlbUrl = glbUrl;+ selectedGlbUrl = null;selectedThumbnail = thumbUrl;- viewer.src = glbUrl;-document.querySelectorAll('.avatar-thumb').forEach((el) => {el.classList.toggle('is-selected', el.dataset.id === String(id));});+ updateGenerateBtn();++ // Private avatars have no CDN URL in the list payload: resolve a signed one.+ if (!glbUrl && id !== 'default') glbUrl = await fetchSignedGlbUrl(id);+ if (selectedAvatarId !== id) return; // user picked a different avatar meanwhile++ if (!glbUrl) {+ showToast('Could not load this avatar\'s 3D model. Pick another one.', 'error');+ updateGenerateBtn();+ return;+ }+ selectedGlbUrl = glbUrl;+ // setAttribute (not the .src property): if model-viewer hasn't upgraded yet,+ // a property assignment lands on the plain element and is shadowed once the+ // custom element upgrades, leaving the default GLB on screen.+ viewer.setAttribute('src', glbUrl);updateGenerateBtn();}diff --git a/src/dashboard-next/pages/settings.js b/src/dashboard-next/pages/settings.jsindex b5daa4562..f169189cb 100644--- a/src/dashboard-next/pages/settings.js+++ b/src/dashboard-next/pages/settings.js@@ -10,7 +10,8 @@//// Real endpoints:// GET /api/auth/sessions { sessions: [...] }-// DELETE /api/auth/sessions/:id+// DELETE /api/auth/sessions/:id revoke one session+// DELETE /api/auth/sessions revoke all others + rotate current// GET /api/notifications { notifications: [...], unread: N }// POST /api/notifications/read-all// GET /api/billing/summary { usage: { total_bytes, avatar_count, ... } }@@ -238,7 +239,9 @@ function renderSessions(resp, onRetry) {revokeAllBtn.disabled = true;revokeAllBtn.textContent = 'Revoking…';try {- await post('/api/auth/sessions/revoke-others', {});+ // DELETE on the index revokes every other session and rotates the+ // current one (api/auth/sessions/[action].js handleIndex).+ await del('/api/auth/sessions');toast('All other sessions revoked');const updated = sessions.filter((s) => s.is_current || s.current);renderList(updated);diff --git a/src/deployments.js b/src/deployments.jsindex 046244637..5d9f13b41 100644--- a/src/deployments.js+++ b/src/deployments.js@@ -11,6 +11,7 @@import { createLogger } from './shared/log.js';import { updateValue, enterRow, liveDot, setLiveDot } from './ui-juice.js';+import { proxiedImageURL } from './ipfs.js';const log = createLogger('deployments');@@ -191,9 +192,18 @@ function skeleton() {function rowHTML(r) {const dpId = `${r.chain_id}:${esc(r.agent_id)}`;- const av = r.image- ? `<img class="dp-av" src="${esc(r.image)}" alt="" loading="lazy" onerror="this.style.visibility='hidden'" />`- : `<span class="dp-av dp-av--mono" aria-hidden="true">${esc((r.name || '#').charAt(0).toUpperCase())}</span>`;+ // Registry image URLs are third-party data (ERC-8004 metadata) hosted on+ // arbitrary domains and IPFS gateways that routinely fail ORB/CORS checks or+ // serve non-image bodies. Route every remote URL through the same-origin+ // /api/img proxy: it resolves IPFS across gateways, follows metadata docs to+ // the real art, and always answers 200 with a valid image (deterministic+ // placeholder on failure), so the row never fires a failed request. Anything+ // that is not a remote http(s)/ipfs/ar URL degrades to the monogram tile.+ const mono = `<span class="dp-av dp-av--mono" aria-hidden="true">${esc((r.name || '#').charAt(0).toUpperCase())}</span>`;+ const remote = r.image && /^(https?|ipfs|ar):\/\//i.test(String(r.image));+ const av = remote+ ? `<img class="dp-av" src="${esc(proxiedImageURL(String(r.image), dpId))}" alt="" loading="lazy" onerror="this.onerror=null;this.style.visibility='hidden'" />`+ : mono;const title = r.name || `Agent #${esc(r.agent_id)}`;const nameEl = r.agent_explorer? `<a class="dp-row-name" href="${esc(r.agent_explorer)}" target="_blank" rel="noopener">${esc(title)}</a>`diff --git a/src/erc8004/register-ui.js b/src/erc8004/register-ui.jsindex 33522ac2f..8830672bb 100644--- a/src/erc8004/register-ui.js+++ b/src/erc8004/register-ui.js@@ -1068,16 +1068,26 @@ export class RegisterUI {const step = this.wizardStep;const pageMode = this._isPageMode();const stepLabels = ['Identity', 'Services', 'Avatar', 'Deploy'];+ // Completed steps render as real <button>s so they are keyboard-operable+ // and get a visible focus ring; the current step carries aria-current.const stepBar = `- <ol class="erc8004-steps deploy-steps" role="list">+ <ol class="erc8004-steps deploy-steps" role="list" aria-label="Deploy steps">${[1, 2, 3, 4].map((n) => {const state = n === step ? 'active' : (n < step ? 'done' : '');- const clickable = n < step ? 'data-role="goto-step" data-step="' + n + '"' : '';+ const cls = `erc8004-step deploy-step ${state ? 'deploy-step--' + state : ''} ${n === step ? 'erc8004-step--active' : ''} ${n < step ? 'erc8004-step--done' : ''}`;+ const inner = `+ <span class="erc8004-step-num" aria-hidden="true">${n < step ? '✓' : n}</span>+ <span class="erc8004-step-lbl">${stepLabels[n - 1]}</span>`;+ if (n < step) {+ return `+ <li class="${cls}">+ <button type="button" class="deploy-step-btn" data-role="goto-step" data-step="${n}" aria-label="Back to step ${n}: ${stepLabels[n - 1]} (completed)">${inner}</button>+ </li>`;+ }return `- <li class="erc8004-step deploy-step ${state ? 'deploy-step--' + state : ''} ${n === step ? 'erc8004-step--active' : ''} ${n < step ? 'erc8004-step--done' : ''}" ${clickable}>- <span class="erc8004-step-num">${n < step ? '✓' : n}</span>- <span class="erc8004-step-lbl">${stepLabels[n - 1]}</span>+ <li class="${cls}"${n === step ? ' aria-current="step"' : ''}>+ <span class="deploy-step-static">${inner}</span></li>`;}).join('')}@@ -1137,10 +1147,7 @@ export class RegisterUI {body.querySelectorAll('[data-role="goto-step"]').forEach((el) => {el.addEventListener('click', () => {const n = Number(el.dataset.step);- if (n >= 1 && n < this.wizardStep) {- this.wizardStep = n;- this._renderActiveTab();- }+ if (n >= 1 && n < this.wizardStep) this._goToStep(n);});});const wbody = body.querySelector('[data-role="wizard-body"]');@@ -1150,6 +1157,24 @@ export class RegisterUI {else this._renderStepDeploy(wbody);}+ /**+ * Navigate the wizard to step `n` and move keyboard/screen-reader focus to+ * the new step's heading, so keyboard users aren't dumped back at the top+ * of the document after each transition.+ */+ _goToStep(n) {+ this.wizardStep = n;+ this._renderActiveTab();+ this._focusWizardHeading();+ }++ _focusWizardHeading() {+ const h = this.el.querySelector('[data-role="wizard-body"] .erc8004-h3');+ if (!h) return;+ h.setAttribute('tabindex', '-1');+ h.focus();+ }+/*** Apply one of the Step-0 quick-start modes. Resets wizard state appropriately* and returns to Step 1. Signed-in-only modes bail with a toast if no session.@@ -1211,37 +1236,68 @@ export class RegisterUI {_renderStepIdentity(body) {body.innerHTML = `<h3 class="erc8004-h3">Agent Identity</h3>- <p class="erc8004-p">Define your agent's core identity — name, description, and image.</p>+ <p class="erc8004-p">Define your agent's core identity: name, description, and image.</p><label class="erc8004-label">Agent Name <span class="erc8004-req">*</span>- <input class="erc8004-input" name="name" maxlength="100" placeholder="e.g., DeFi Yield Optimizer" value="${esc(this.form.name)}" />+ <input class="erc8004-input" name="name" maxlength="100" placeholder="e.g., DeFi Yield Optimizer"+ autocomplete="off" spellcheck="false" aria-required="true"+ aria-describedby="deploy-name-hint deploy-name-error" value="${esc(this.form.name)}" /></label>- <p class="erc8004-hint">A short, memorable name (max 100 chars)</p>+ <p class="erc8004-field-error" id="deploy-name-error" hidden>Give your agent a name before continuing.</p>+ <p class="erc8004-hint erc8004-hint-row" id="deploy-name-hint"><span>A short, memorable name</span><span class="erc8004-count" data-role="name-count" aria-hidden="true">${this.form.name.length}/100</span></p><label class="erc8004-label">Description <span class="erc8004-req">*</span>- <textarea class="erc8004-input erc8004-textarea" name="description" maxlength="1000" rows="4" placeholder="Describe what your agent does, capabilities, pricing…">${esc(this.form.description)}</textarea>+ <textarea class="erc8004-input erc8004-textarea" name="description" maxlength="1000" rows="4"+ aria-required="true" aria-describedby="deploy-desc-hint deploy-desc-error"+ placeholder="Describe what your agent does, capabilities, pricing…">${esc(this.form.description)}</textarea></label>- <p class="erc8004-hint">Required before deploying on-chain (max 1000 chars)</p>+ <p class="erc8004-field-error" id="deploy-desc-error" hidden>Add a description: it is written into the on-chain record.</p>+ <p class="erc8004-hint erc8004-hint-row" id="deploy-desc-hint"><span>Required before deploying on-chain</span><span class="erc8004-count" data-role="desc-count" aria-hidden="true">${this.form.description.length}/1000</span></p><label class="erc8004-label">Image URL<div class="erc8004-image-row">- <input class="erc8004-input" name="imageUrl" placeholder="https://example.com/avatar.png or ipfs://…" value="${esc(this.form.imageUrl)}" />+ <input class="erc8004-input" name="imageUrl" inputmode="url" autocomplete="off" spellcheck="false"+ aria-describedby="deploy-image-hint" placeholder="https://example.com/avatar.png or ipfs://…" value="${esc(this.form.imageUrl)}" />${this._viewer ? `<button type="button" class="erc8004-btn erc8004-btn--ghost erc8004-capture-btn btn btn--ghost" data-role="capture3d" title="Snapshot the current 3D viewer and use it as the agent image">📸 Use 3D view</button>` : ''}</div></label>- <p class="erc8004-hint">Avatar or logo for your agent NFT</p>+ <p class="erc8004-hint" id="deploy-image-hint">Avatar or logo for your agent NFT. Optional: leave blank to auto-render one from your 3D model.</p><div class="erc8004-wizard-nav"><span></span><button class="erc8004-btn erc8004-btn--primary btn btn--primary" data-role="next">Next: Services →</button></div>`;- body.querySelector('[name="name"]').addEventListener('input', (e) => {+ const nameInput = body.querySelector('[name="name"]');+ const descInput = body.querySelector('[name="description"]');+ const nameError = body.querySelector('#deploy-name-error');+ const descError = body.querySelector('#deploy-desc-error');+ const nameCount = body.querySelector('[data-role="name-count"]');+ const descCount = body.querySelector('[data-role="desc-count"]');+ const clearInvalid = (input, error) => {+ error.hidden = true;+ input.removeAttribute('aria-invalid');+ input.classList.remove('erc8004-input--invalid');+ };+ const markInvalid = (input, error) => {+ error.hidden = false;+ input.setAttribute('aria-invalid', 'true');+ input.classList.add('erc8004-input--invalid');+ };+ const updateCount = (el, len, max) => {+ el.textContent = `${len}/${max}`;+ el.classList.toggle('erc8004-count--limit', len >= max * 0.9);+ };+ nameInput.addEventListener('input', (e) => {this.form.name = e.target.value;+ updateCount(nameCount, e.target.value.length, 100);+ if (e.target.value.trim()) clearInvalid(nameInput, nameError);this._refreshPreview();});- body.querySelector('[name="description"]').addEventListener('input', (e) => {+ descInput.addEventListener('input', (e) => {this.form.description = e.target.value;+ updateCount(descCount, e.target.value.length, 1000);+ if (e.target.value.trim()) clearInvalid(descInput, descError);this._refreshPreview();});body.querySelector('[name="imageUrl"]').addEventListener('input', (e) => {@@ -1252,12 +1308,17 @@ export class RegisterUI {this._captureFromViewer(body);});body.querySelector('[data-role="next"]').addEventListener('click', () => {- if (!this.form.name.trim()) {- this._toast('Agent name is required.', true);+ // Inline validation next to the fields (both are minted on-chain, so+ // catching them here beats a failed deploy three steps later).+ const invalid = [];+ if (!this.form.name.trim()) invalid.push([nameInput, nameError]);+ if (!this.form.description.trim()) invalid.push([descInput, descError]);+ if (invalid.length) {+ invalid.forEach(([input, error]) => markInvalid(input, error));+ invalid[0][0].focus();return;}- this.wizardStep = 2;- this._renderActiveTab();+ this._goToStep(2);});}@@ -1342,17 +1403,22 @@ export class RegisterUI {`;const list = body.querySelector('[data-role="list"]');const renderList = () => {+ if (!this.form.services.length) {+ list.innerHTML = `<div class="erc8004-svc-empty">No endpoints yet. They're optional: add one if other agents should reach yours over A2A, MCP, or x402.</div>`;+ return;+ }list.innerHTML = this.form.services.map((svc, i) => `<div class="erc8004-svc-row" data-i="${i}">- <select class="erc8004-input erc8004-input--tight" data-field="type">+ <select class="erc8004-input erc8004-input--tight" data-field="type" aria-label="Service type">${SERVICE_TYPES.map((t) => `<option value="${t}" ${svc.type === t ? 'selected' : ''}>${t}</option>`).join('')}</select>- <input class="erc8004-input" data-field="name" placeholder="Name" value="${esc(svc.name)}" />- <input class="erc8004-input" data-field="endpoint" placeholder="https://… or ipfs://…" value="${esc(svc.endpoint)}" />- <button class="erc8004-btn erc8004-btn--ghost erc8004-btn--x btn btn--ghost btn--icon" data-role="rm" title="Remove">✕</button>+ <input class="erc8004-input" data-field="name" placeholder="Name" aria-label="Service name" autocomplete="off" spellcheck="false" value="${esc(svc.name)}" />+ <input class="erc8004-input" data-field="endpoint" inputmode="url" autocomplete="off" spellcheck="false" placeholder="https://… or ipfs://…" aria-label="Service endpoint URL" value="${esc(svc.endpoint)}" />+ <button class="erc8004-btn erc8004-btn--ghost erc8004-btn--x btn btn--ghost btn--icon" data-role="rm" title="Remove endpoint" aria-label="Remove endpoint ${i + 1}">✕</button></div>+ <p class="erc8004-field-error" data-role="svc-error" data-i="${i}" hidden>Endpoint must be an http(s)://, ipfs:// or ar:// URL.</p>`,).join('');@@ -1362,6 +1428,12 @@ export class RegisterUI {row.querySelectorAll('[data-field]').forEach((input) => {input.addEventListener('input', (e) => {this.form.services[i][e.target.dataset.field] = e.target.value;+ if (e.target.dataset.field === 'endpoint') {+ const err = list.querySelector(`[data-role="svc-error"][data-i="${i}"]`);+ if (err) err.hidden = true;+ e.target.removeAttribute('aria-invalid');+ e.target.classList.remove('erc8004-input--invalid');+ }});});row.querySelector('[data-role="rm"]').addEventListener('click', () => {@@ -1375,17 +1447,35 @@ export class RegisterUI {body.querySelector('[data-role="add"]').addEventListener('click', () => {this.form.services.push({ type: 'A2A', name: '', endpoint: '' });renderList();+ // Land the keyboard in the new row so the user can type immediately.+ const rows = list.querySelectorAll('.erc8004-svc-row');+ rows[rows.length - 1]?.querySelector('[data-field="name"]')?.focus();});body.querySelector('[data-role="x402"]').addEventListener('change', (e) => {this.form.x402Support = e.target.checked;});body.querySelector('[data-role="back"]').addEventListener('click', () => {- this.wizardStep = 1;- this._renderActiveTab();+ this._goToStep(1);});body.querySelector('[data-role="next"]').addEventListener('click', () => {- this.wizardStep = 3;- this._renderActiveTab();+ // Non-empty endpoints must look like a real URL before they're minted+ // into the registration JSON. Empty rows are simply skipped at deploy.+ const badIndex = this.form.services.findIndex((s) => {+ const v = (s.endpoint || '').trim();+ return v && !/^(https?:\/\/|ipfs:\/\/|ar:\/\/)\S+$/i.test(v);+ });+ if (badIndex !== -1) {+ const err = list.querySelector(`[data-role="svc-error"][data-i="${badIndex}"]`);+ if (err) err.hidden = false;+ const input = list.querySelector(`.erc8004-svc-row[data-i="${badIndex}"] [data-field="endpoint"]`);+ if (input) {+ input.setAttribute('aria-invalid', 'true');+ input.classList.add('erc8004-input--invalid');+ input.focus();+ }+ return;+ }+ this._goToStep(3);});}@@ -1419,7 +1509,7 @@ export class RegisterUI {<div class="erc8004-avatar-panel" data-role="panel"></div><label class="erc8004-label">IPFS Pinning Token (optional)- <input class="erc8004-input" type="password" name="apiToken" placeholder="Pinata JWT — leave blank to use built-in R2 storage" value="${esc(this.form.apiToken)}" />+ <input class="erc8004-input" type="password" name="apiToken" autocomplete="off" placeholder="Pinata JWT — leave blank to use built-in R2 storage" value="${esc(this.form.apiToken)}" /></label><p class="erc8004-hint">Without a token, uploads go through our backend (R2). Paste a Pinata JWT to pin directly to IPFS.</p>@@ -1506,7 +1596,7 @@ export class RegisterUI {} else if (s === 'url') {panel.innerHTML = `<div class="erc8004-url-paste">- <input class="erc8004-input" type="url" placeholder="https://… or ipfs://… or ar://…" value="${esc(this.form.pastedGlbUrl)}" data-role="glb-url-input" />+ <input class="erc8004-input" type="url" inputmode="url" autocomplete="off" spellcheck="false" aria-label="GLB file URL" placeholder="https://… or ipfs://… or ar://…" value="${esc(this.form.pastedGlbUrl)}" data-role="glb-url-input" /><p class="erc8004-hint">The GLB must include <strong>ARKit / Oculus viseme morph targets</strong> for lip-sync to work.</p></div>`;@@ -1561,8 +1651,7 @@ export class RegisterUI {(e) => (this.form.apiToken = e.target.value),);body.querySelector('[data-role="back"]').addEventListener('click', () => {- this.wizardStep = 2;- this._renderActiveTab();+ this._goToStep(2);});body.querySelector('[data-role="next"]').addEventListener('click', () => {// Validate the selected source before advancing.@@ -1583,8 +1672,7 @@ export class RegisterUI {this._toast('Pick a default avatar, or choose another option.', true);return;}- this.wizardStep = 4;- this._renderActiveTab();+ this._goToStep(4);});}@@ -1609,8 +1697,8 @@ export class RegisterUI {<dt>Registry</dt> <dd><code>${esc(REGISTRY_DEPLOYMENTS[this.selectedChainId].identityRegistry)}</code></dd></dl>- ${!walletOk ? `<div class="erc8004-alert">Connect a wallet before deploying.</div>` : ''}- ${walletOk && !chainOk ? `<div class="erc8004-alert">Your wallet is on chain ${this.wallet.chainId}. <button class="erc8004-link" data-role="switch">Switch to ${esc(meta.name)}</button></div>` : ''}+ ${!walletOk ? `<div class="erc8004-alert">${window.ethereum ? 'Connect a wallet before deploying.' : 'No EVM wallet detected. Install <a class="erc8004-link" href="https://metamask.io/download/" target="_blank" rel="noopener">MetaMask</a>, then reload this page.'} ${window.ethereum ? '<button type="button" class="erc8004-link" data-role="connect-inline">Connect wallet</button>' : ''}</div>` : ''}+ ${walletOk && !chainOk ? `<div class="erc8004-alert">Your wallet is on ${esc(CHAIN_META[this.wallet.chainId]?.name || `chain ${this.wallet.chainId}`)}, but this deploy targets ${esc(meta.name)}. <button type="button" class="erc8004-link" data-role="switch">Switch to ${esc(meta.name)}</button></div>` : ''}${this.selectedChainId === BSC_TESTNET_CHAIN_ID ? `<div class="erc8004-gasless-panel" data-role="gasless-panel">@@ -1679,33 +1767,48 @@ export class RegisterUI {</div></div>- <div class="erc8004-log" data-role="log"></div>+ <div class="erc8004-log" data-role="log" role="log" aria-live="polite" aria-label="Deploy log"></div>- <div class="erc8004-result deploy-result" data-role="result" style="display:none">+ <div class="deploy-error-panel" data-role="deploy-error" role="alert" hidden>+ <div class="deploy-error-panel-title">Deploy failed</div>+ <p class="deploy-error-panel-msg" data-role="deploy-error-msg"></p>+ <button type="button" class="erc8004-btn btn btn--secondary" data-role="deploy-retry">Try again</button>+ </div>++ <div class="erc8004-result deploy-result" data-role="result" style="display:none" tabindex="-1"><div class="deploy-result-badge" data-role="res-badge"></div>- <h4 class="erc8004-h4 deploy-result-heading">Agent registered on-chain</h4>+ <h4 class="erc8004-h4 deploy-result-heading">🎉 Agent registered on-chain</h4><dl class="erc8004-result-dl"><dt>Agent ID</dt> <dd data-role="res-id"></dd><dt>Metadata</dt> <dd data-role="res-uri"></dd><dt>Tx Hash</dt> <dd data-role="res-tx"></dd></dl><div class="erc8004-row">- <button class="erc8004-btn btn btn--secondary" data-role="view-3d">View in 3D</button>- <a class="erc8004-btn btn btn--secondary" data-role="view-explorer" target="_blank" rel="noopener">Explorer ↗</a>+ <a class="erc8004-btn erc8004-btn--primary btn btn--primary" data-role="view-explorer" target="_blank" rel="noopener">View on explorer ↗</a>+ <button class="erc8004-btn btn btn--secondary" data-role="view-3d">View agent page →</button>+ <button class="erc8004-btn btn btn--secondary" data-role="res-embed">Embed </></button>+ <a class="erc8004-btn btn btn--secondary" data-role="res-launch" style="display:none">Launch a coin 🚀</a><a class="erc8004-btn btn btn--secondary" href="/showcase">Browse showcase ↗</a></div></div><div class="erc8004-wizard-nav"><button class="erc8004-btn btn btn--secondary" data-role="back">← Back</button>- <button class="erc8004-btn erc8004-btn--primary btn btn--primary" data-role="deploy" ${walletOk ? '' : 'disabled'}>🚀 Register Agent On-Chain</button>+ <button class="erc8004-btn erc8004-btn--primary btn btn--primary" data-role="deploy" ${walletOk ? '' : 'disabled title="Connect a wallet first"'}>🚀 Register Agent On-Chain</button></div>`;body.querySelector('[data-role="back"]').addEventListener('click', () => {- this.wizardStep = 3;- this._renderActiveTab();+ this._goToStep(3);});+ body.querySelector('[data-role="connect-inline"]')?.addEventListener('click', () =>+ this._connectWallet(),+ );++ body.querySelector('[data-role="deploy-retry"]').addEventListener('click', () =>+ this._doDeploy(body),+ );+const switchBtn = body.querySelector('[data-role="switch"]');if (switchBtn) {switchBtn.addEventListener('click', async () => {@@ -1850,7 +1953,7 @@ export class RegisterUI {${!hasSolanaWallet- ? `<div class="erc8004-alert">No Solana wallet detected. Install <a class="erc8004-link" href="https://phantom.app" target="_blank" rel="noopener">Phantom</a> to deploy.</div>`+ ? `<div class="erc8004-alert">No Solana wallet detected. Install <a class="erc8004-link" href="https://phantom.app" target="_blank" rel="noopener">Phantom</a> (or Backpack / Solflare), then reload this page and click Mint.</div>`: ''}<div class="erc8004-alert erc8004-alert--note">diff --git a/src/labs.js b/src/labs.jsindex eba70ba2d..a60a006a5 100644--- a/src/labs.js+++ b/src/labs.js@@ -115,9 +115,12 @@ function attachPreview(card) {obs.disconnect();const iframe = document.createElement('iframe');+ // No sandbox: previews frame our own first-party pages (paths come from+ // /features.json), which need their real origin for API and storage+ // access. Sandboxing same-origin content with allow-scripts is escapable+ // anyway, so the attribute added nothing but a console warning.iframe.src = path;iframe.setAttribute('loading', 'lazy');- iframe.setAttribute('sandbox', 'allow-scripts allow-same-origin');iframe.setAttribute('tabindex', '-1');iframe.setAttribute('aria-hidden', 'true');iframe.setAttribute('title', '');diff --git a/src/launch-detail.js b/src/launch-detail.jsindex 21e1aa7b5..05de70cc5 100644--- a/src/launch-detail.js+++ b/src/launch-detail.js@@ -848,7 +848,7 @@ async function renderOracleConviction() {// it's "who else is in, and do they win." The Smart Money Radar answers it: it// crosses every wallet's footprint in this coin against which coins those same// wallets historically graduated, scoring the *pedigree of the money* buying in.-// Data: /api/pump/smart-money?mint= (404 until the rollup has scored this coin).+// Data: /api/pump/smart-money?mint= (found:false until the rollup scores the coin).// ════════════════════════════════════════════════════════════════════════════const WALLET_LABEL = {@@ -898,24 +898,33 @@ async function renderSmartMoney() {return;}- let data = null;- try {- data = await fetchJson(`/api/pump/smart-money?mint=${encodeURIComponent(state.mint)}`);- } catch {- // 404 = the rollup hasn't scored this coin yet (too new, or pre-dates the- // engine). Render an honest "not scored yet" rather than hiding the panel.+ // The rollup hasn't scored this coin yet (too new, or pre-dates the engine).+ // Modern API answers 200 + found:false; a fetch failure (or a pre-convention+ // deploy's 404) lands in the same honest "not scored yet" panel.+ function renderNotScored() {section(target,'Smart money',el('div', { class: 'ld-empty ld-empty-sm' }, [el('p', { class: 'ld-empty-title', text: 'No smart-money read yet.' }),el('p', {- text: 'The radar scores a coin once proven wallets touch it. New launches are picked up within minutes — check back, or watch the live radar.',+ text: 'The radar scores a coin once proven wallets touch it. New launches are picked up within minutes. Check back, or watch the live radar.',}),el('a', { class: 'ld-btn ld-btn-ghost', href: '/radar', text: 'Open the Smart Money radar →' }),]),{ tag: 'wallet pedigree' },);+ }++ let data = null;+ try {+ data = await fetchJson(`/api/pump/smart-money?mint=${encodeURIComponent(state.mint)}`);+ } catch {+ renderNotScored();+ return;+ }+ if (!data || data.found === false || !data.coin) {+ renderNotScored();return;}diff --git a/src/launchpad/landing.js b/src/launchpad/landing.jsindex 4f216384e..c0517e281 100644--- a/src/launchpad/landing.js+++ b/src/launchpad/landing.js@@ -205,6 +205,36 @@ const STYLE = `@media (max-width:880px) {.lp-tpl-grid, .lp-gal { grid-template-columns:1fr; }}+ @media (max-width:480px) {+ .lp-wrap { padding:0 16px; }+ .lp-hero { padding:44px 0 32px; }+ .lp-sec { padding:40px 0; }+ }++ /* Keyboard focus — every interactive element gets a visible ring */+ .lp-btn:focus-visible, .lp-coin:focus-visible, .lp-card:focus-visible,+ .lp-sec-head a.more:focus-visible, .lp-cta-row a:focus-visible {+ outline:2px solid #ec4899; outline-offset:2px;+ }+ .lp-tpl:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }++ .lp-cta-row { display:flex; gap:10px; justify-content:center; flex-wrap:wrap; margin-top:22px; }++ /* Studio handoff states (shown while the editor module loads, or if it fails) */+ .lp-studio-wait { min-height:100vh; display:flex; flex-direction:column; gap:16px;+ align-items:center; justify-content:center; text-align:center; padding:24px;+ background:#0b0d10; color:#a1a1aa; font:15px/1.5 system-ui,-apple-system,sans-serif; }+ .lp-studio-wait .spin { width:30px; height:30px; border-radius:50%;+ border:3px solid #262b32; border-top-color:#f4f4f5; animation:lp-spin .8s linear infinite; }+ @keyframes lp-spin { to { transform:rotate(360deg); } }+ .lp-studio-wait h2 { margin:0; font-size:18px; color:#f4f4f5; letter-spacing:-0.01em; }+ .lp-studio-wait .fail-actions { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }++ @media (prefers-reduced-motion: reduce) {+ .lp-land *, .lp-land *::before, .lp-studio-wait * {+ animation:none !important; transition:none !important;+ }+ }`;// ──────────────────────────────────────────────────────────────────────────@@ -275,10 +305,14 @@ function shellHTML() {<h1>Launch your coin — <em>hosted by a 3D agent</em>.</h1><p class="sub">Mint a Pump.fun coin in one flow, right here. Pick your agent, set the name, ticker, and image, then launch straight from your wallet. Creator fees route to you.</p><div class="lp-stats" data-stats>- <div class="lp-stat"><div class="n"><span class="skl"></span></div><div class="l">Coins launched</div></div>- <div class="lp-stat"><div class="n"><span class="skl"></span></div><div class="l">Pages live</div></div>+ <div class="lp-stat"><div class="n"><span class="skl" aria-hidden="true"></span></div><div class="l">Coins launched</div></div>+ <div class="lp-stat"><div class="n"><span class="skl" aria-hidden="true"></span></div><div class="l">Pages live</div></div><div class="lp-stat"><div class="n">∞</div><div class="l">Your wallet, your fees</div></div></div>+ <div class="lp-cta-row">+ <a class="lp-btn ghost" href="#lp-templates">Build a hosted page ↓</a>+ <a class="lp-btn ghost" href="#lp-showcase">See live examples ↓</a>+ </div></div><div class="lp-wrap"><div class="lp-launcher" data-launcher>@@ -296,13 +330,13 @@ function shellHTML() {</div><a class="more" href="/launches">All launches →</a></div>- <div class="lp-feed" data-live-feed>- ${Array.from({ length: 5 }).map(() => '<div class="lp-skel-row"></div>').join('')}+ <div class="lp-feed" data-live-feed aria-busy="true" aria-label="Live coin launches">+ ${Array.from({ length: 5 }).map(() => '<div class="lp-skel-row" aria-hidden="true"></div>').join('')}</div></div></section>- <section class="lp-sec">+ <section class="lp-sec" id="lp-templates"><div class="lp-wrap"><div class="lp-sec-head"><div>@@ -314,7 +348,7 @@ function shellHTML() {</div></section>- <section class="lp-sec">+ <section class="lp-sec" id="lp-showcase"><div class="lp-wrap"><div class="lp-sec-head"><div>@@ -323,8 +357,8 @@ function shellHTML() {</div><a class="more" href="#" data-action="build">Build yours →</a></div>- <div class="lp-gal" data-gallery>- ${Array.from({ length: 6 }).map(() => '<div class="lp-gal-skel"></div>').join('')}+ <div class="lp-gal" data-gallery aria-busy="true" aria-label="Published launchpad pages">+ ${Array.from({ length: 6 }).map(() => '<div class="lp-gal-skel" aria-hidden="true"></div>').join('')}</div></div></section>@@ -366,6 +400,8 @@ async function loadLiveFeed(root) {} catch (err) {log.warn('[launchpad-landing] live feed failed:', err.message);feed.innerHTML = `<a class="lp-empty" href="/launches" style="padding:24px;display:block;text-decoration:none">Live feed unavailable — see all launches →</a>`;+ } finally {+ feed.removeAttribute('aria-busy');}}@@ -414,6 +450,8 @@ async function loadGallery(root, galleryTotalRef) {<div>Couldn't load the showcase right now.</div><button class="lp-btn primary em-cta" type="button" data-action="build">Build yours anyway →</button></div>`;+ } finally {+ gal.removeAttribute('aria-busy');}}@@ -454,11 +492,33 @@ export function mountLaunchpadLanding(root) {loadGallery(root, galleryTotalRef);}+ let lastStudioOpts = null;async function mountStudio(opts) {- root.innerHTML = '';- const { mountLaunchpadStudio } = await import('../editor/launchpad-studio.js');- mountLaunchpadStudio(root, opts);+ lastStudioOpts = opts;document.title = 'Launchpad Studio — three.ws';+ // Real loading state while the (heavy) editor module loads — a blank+ // screen here reads as a broken page on slow connections.+ root.innerHTML = `+ <div class="lp-studio-wait" role="status" aria-live="polite">+ <div class="spin" aria-hidden="true"></div>+ <div>Opening the studio${opts.slug ? ` for /p/${esc(opts.slug)}` : ''}…</div>+ </div>`;+ try {+ const { mountLaunchpadStudio } = await import('../editor/launchpad-studio.js');+ root.innerHTML = '';+ mountLaunchpadStudio(root, opts);+ } catch (err) {+ log.warn('[launchpad-landing] studio failed to load:', err.message);+ root.innerHTML = `+ <div class="lp-studio-wait" role="alert">+ <h2>The studio didn't load</h2>+ <div>${esc(err.message || 'Network error while loading the editor module.')}</div>+ <div class="fail-actions">+ <button class="lp-btn primary" type="button" data-action="studio-retry">Try again</button>+ <button class="lp-btn ghost" type="button" data-action="studio-home">Back to the launchpad</button>+ </div>+ </div>`;+ }}function enterStudio(opts = {}) {@@ -481,6 +541,17 @@ export function mountLaunchpadLanding(root) {if (act) {e.preventDefault();enterStudio({});+ return;+ }+ if (e.target.closest('[data-action="studio-retry"]')) {+ e.preventDefault();+ mountStudio(lastStudioOpts || studioOptionsFromUrl(new URL(location.href)));+ return;+ }+ if (e.target.closest('[data-action="studio-home"]')) {+ e.preventDefault();+ history.pushState({}, '', '/launchpad');+ renderLanding();}});diff --git a/src/pose-studio.js b/src/pose-studio.jsindex f5b288921..3b61e0009 100644--- a/src/pose-studio.js+++ b/src/pose-studio.js@@ -63,6 +63,7 @@ import {import { PoseLibrary } from './pose-library.js';import { AnimationLibrary } from './animation-library.js';import { putSceneHandoff } from './shared/scene-handoff.js';+import { isSafeQueryModelUrl } from './shared/safe-model-url.js';import { log } from './shared/log.js';// ─── DOM helpers ────────────────────────────────────────────────────────@@ -1849,14 +1850,22 @@ function boot() {state.library = library;library.mount();- // ── Boot: honor ?avatar= and ?anim= ─────────────────────────────────────+ // ── Boot: honor ?avatar=, ?src= and ?anim= ───────────────────────────────const _params = new URL(window.location.href).searchParams;const requestedAvatar = _params.get('avatar');+ // ?src=<glb url> loads a model straight off its URL (the /viewer "Animate"+ // funnel). Same trusted-host gate as every other model-URL query param.+ const rawSrc = _params.get('src') || '';+ const requestedSrc = isSafeQueryModelUrl(rawSrc) ? rawSrc : '';const requestedAnim = _params.get('anim');- // An explicit ?anim= deep-link opens a specific saved clip and wins over any- // recovered draft; otherwise we offer back last session's unsaved work.- const recovered = !requestedAnim && autosave?.tryRestore();+ if (rawSrc && !requestedSrc) {+ setStatus('That model link is not from a trusted host. Pick an avatar instead.', 'error');+ }++ // An explicit ?anim= or model deep-link wins over any recovered draft;+ // otherwise we offer back last session's unsaved work.+ const recovered = !requestedAnim && !requestedSrc && autosave?.tryRestore();// A 36-char UUID is a saved community clip (PoseLibrary.openById); anything// else is a built-in preset name from the animation library (AnimationLibrary@@ -1880,6 +1889,17 @@ function boot() {}).then(() => {if (requestedAnim) openRequestedAnim(requestedAnim);});+ } else if (requestedSrc) {+ // /viewer funnel: animate a freshly generated GLB by URL. A model with no+ // humanoid skeleton can't be posed; say so and fall back to the mannequin.+ loadAvatarFromUrl(requestedSrc, { name: _params.get('title') || 'Imported model' })+ .catch((err) => {+ setStatus(`${err?.message || 'Could not load that model.'} Showing the mannequin instead.`, 'error');+ switchToMannequin();+ })+ .then(() => {+ if (requestedAnim) openRequestedAnim(requestedAnim);+ });} else if (requestedAnim) {// Deep-linked to an animation with no avatar chosen (the /animations// gallery "Open in Studio" path). Presets need a rigged figure to play on,diff --git a/src/trades-detail.js b/src/trades-detail.jsindex acffeac28..8ba144a93 100644--- a/src/trades-detail.js+++ b/src/trades-detail.js@@ -7,8 +7,12 @@* /api/pump/launch-detail registry · agent · economics · intel · outcome · trader* /api/pump/curve price · market cap · graduation progress* /api/pump/intel wallet footprint · funder clusters (drives the bubblemap)- * /api/pump/smart-money money pedigree of who is in- * /api/coin/:mint/cohorts holder count · concentration · cohort distribution+ * /api/pump/smart-money money pedigree of who is in (found:false = not scored yet)+ * /api/coin/:mint/cohorts holder count · concentration · cohort distribution.+ * Only fetched for coins the platform tracks (a+ * three.ws launch or agent token, per launch-detail);+ * anything else renders its designed no-data state+ * instead of a guaranteed 404 round-trip.** Plus three self-fetching live widgets: the candlestick chart (reused from* Mission Control), the bonding-curve ring, and the trade tape.@@ -144,11 +148,13 @@ export function mountDetail(host, opts = {}) {try { teardowns.push(mountTradeTape($('[data-host="tape"]'), { mint })); } catch { /* tape optional */ }// ── data fetches ──────────────────────────────────────────────────────────────- loadDetail();+ // Cohorts are chained on launch-detail: the platform only holds holder-cohort+ // data for its own launches, so the answer to "is this ours?" decides whether+ // the fetch happens at all.+ loadDetail().then(loadCohorts);loadCurve();loadIntel();loadSmart();- loadCohorts();async function loadCurve() {const stripEl = $('[data-host="strip"]');@@ -178,13 +184,15 @@ export function mountDetail(host, opts = {}) {const r = await fetch(`/api/pump/launch-detail?mint=${encodeURIComponent(mint)}&network=${network}`, { headers: { accept: 'application/json' } });if (!r.ok) throw new Error(String(r.status));const d = await r.json();- if (destroyed) return;+ if (destroyed) return null;renderIdentityFromIntel(d.intel);renderFootprint(d.intel);renderOutcome(d.outcome);renderAgent(d);+ return d;} catch {if (!destroyed) markUnavailable(['footprint', 'outcome', 'agent']);+ return null;}}@@ -206,18 +214,27 @@ export function mountDetail(host, opts = {}) {async function loadSmart() {try {const r = await fetch(`/api/pump/smart-money?mint=${encodeURIComponent(mint)}`, { headers: { accept: 'application/json' } });+ if (r.status === 404) { if (!destroyed) renderSmartNotScored(); return; } // pre-convention deploysif (!r.ok) throw new Error(String(r.status));const d = await r.json();if (destroyed) return;+ if (d.found === false || !d.coin) { renderSmartNotScored(); return; }renderSmart(d.coin, d.notable);} catch {if (!destroyed) markUnavailable(['smart']);}}- async function loadCohorts() {+ // Only coins the platform launched carry a holder-cohort snapshot; asking for+ // anyone else's mint is a guaranteed not-found. Decide from the launch-detail+ // answer and render the designed no-data state without a doomed round-trip.+ async function loadCohorts(detailBody) {+ if (destroyed) return;+ if (!detailBody) { markUnavailable(['holders']); return; }+ if (!detailBody.found && !detailBody.agent) { renderHoldersNotTracked(); return; }try {const r = await fetch(`/api/coin/${encodeURIComponent(mint)}/cohorts`, { headers: { accept: 'application/json' } });+ if (r.status === 404) { if (!destroyed) renderHoldersNotTracked(); return; }if (!r.ok) throw new Error(String(r.status));const d = await r.json();if (destroyed) return;@@ -309,6 +326,25 @@ export function mountDetail(host, opts = {}) {</div>`).join('')}</div>` : '<p class="dd-note">Holder cohort breakdown will populate as the holder set is indexed.</p>'}`;}+ // Designed no-data state: the platform tracks holder cohorts for its own+ // launches only, so point elsewhere-launched coins at the on-chain truth.+ function renderHoldersNotTracked() {+ const body = $('[data-section="holders"] .dd-card-b');+ if (!body) return;+ body.innerHTML = `+ <p class="dd-note dd-note--na">No holder-cohort snapshot exists for this coin. Cohorts are indexed for coins launched on three.ws; the full holder list lives on-chain.</p>+ <div style="text-align:center"><a href="https://solscan.io/token/${encodeURIComponent(mint)}#holders" target="_blank" rel="noopener" class="dd-btn">View holders on Solscan ↗</a></div>`;+ }++ // Designed no-data state: the radar has not scored this coin (yet).+ function renderSmartNotScored() {+ const body = $('[data-section="smart"] .dd-card-b');+ if (!body) return;+ body.innerHTML = `+ <p class="dd-note dd-note--na">No smart-money read for this coin yet. The radar scores a coin once proven wallets touch it, usually within minutes of real activity.</p>+ <div style="text-align:center"><a href="/radar" class="dd-btn">Open the Smart Money radar →</a></div>`;+ }+function renderBubblemap(coin, wallets, clusters) {const body = $('[data-section="bubblemap"] .dd-card-b');if (!body) return;diff --git a/src/trades.js b/src/trades.jsindex e287575ad..0ac229c8a 100644--- a/src/trades.js+++ b/src/trades.js@@ -133,6 +133,13 @@ function wireControls() {// ── selection ─────────────────────────────────────────────────────────────────function select(mint, seed, { push = true } = {}) {if (!MINT_RE.test(mint)) return;+ // Re-selecting the mounted coin is a no-op: a full remount would re-fire+ // every detail fetch (5 endpoints) for data already on screen.+ if (detail && state.selected === mint) {+ highlightRow(mint);+ if (push) writeUrl();+ return;+ }state.selected = mint;highlightRow(mint);if (push) writeUrl();diff --git a/src/walk-companion-narrator.js b/src/walk-companion-narrator.jsindex 48473cba9..57f3d501c 100644--- a/src/walk-companion-narrator.js+++ b/src/walk-companion-narrator.js@@ -134,17 +134,21 @@ function extractText(el) {// A live-region caption mounted into the companion host, stacked above the SDK's// own greeting bubble so the two never overwrite each other. Styled to match the// SDK bubble (same surface/typography) using design tokens where they apply.+// Width is clamped border-box: the bubble is centered over a host whose center+// sits 116px from the right viewport edge (host right:16px, width 200px), so any+// total width above 2 x (116 - 8) = 216px would escape the viewport. The mobile+// host (right:10px, width 148px) puts the center 84px in, hence the 156px cap.const CAPTION_STYLE_ID = 'walk-companion-narrate-style';function ensureCaptionStyles() {if (document.getElementById(CAPTION_STYLE_ID)) return;const s = document.createElement('style');s.id = CAPTION_STYLE_ID;s.textContent = `-.walk-companion-caption{position:absolute;left:50%;bottom:calc(100% - 30px);z-index:4;transform:translateX(-50%) translateY(8px);max-width:240px;width:max-content;background:var(--surface-glass,rgba(18,20,28,.95));backdrop-filter:blur(var(--blur-sm,8px));-webkit-backdrop-filter:blur(var(--blur-sm,8px));color:var(--ink-bright,#f2f4f8);font:var(--weight-medium,500) var(--text-sm,12.5px)/var(--leading-tight,1.4) var(--font-body,system-ui,-apple-system,'Segoe UI',sans-serif);padding:8px 11px;border-radius:var(--radius-md,12px);border:1px solid var(--stroke-strong,rgba(255,255,255,.14));box-shadow:var(--shadow-2,0 10px 28px rgba(0,0,0,.35));pointer-events:none;opacity:0;transition:opacity .3s ease,transform .3s ease;text-align:left}+.walk-companion-caption{position:absolute;left:50%;bottom:calc(100% - 30px);z-index:4;transform:translateX(-50%) translateY(8px);box-sizing:border-box;max-width:min(216px,calc(100vw - 16px));width:max-content;background:var(--surface-glass,rgba(18,20,28,.95));backdrop-filter:blur(var(--blur-sm,8px));-webkit-backdrop-filter:blur(var(--blur-sm,8px));color:var(--ink-bright,#f2f4f8);font:var(--weight-medium,500) var(--text-sm,12.5px)/var(--leading-tight,1.4) var(--font-body,system-ui,-apple-system,'Segoe UI',sans-serif);padding:8px 11px;border-radius:var(--radius-md,12px);border:1px solid var(--stroke-strong,rgba(255,255,255,.14));box-shadow:var(--shadow-2,0 10px 28px rgba(0,0,0,.35));pointer-events:none;opacity:0;transition:opacity .3s ease,transform .3s ease;text-align:left}.walk-companion-caption.is-in{opacity:1;transform:translateX(-50%) translateY(0)}.walk-companion-caption::after{content:'';position:absolute;left:50%;top:100%;transform:translateX(-50%);border:6px solid transparent;border-top-color:var(--surface-glass,rgba(18,20,28,.95))}.walk-companion-caption .wcn-speaker{display:inline-block;margin-right:5px;opacity:.7;font-size:11px}-@media (max-width:520px){.walk-companion-caption{font-size:11.5px;max-width:170px}}+@media (max-width:520px){.walk-companion-caption{font-size:11.5px;max-width:min(156px,calc(100vw - 12px))}}@media (prefers-reduced-motion:reduce){.walk-companion-caption{transition:none}}.walk-companion-narrate{position:absolute;top:2px;right:106px;z-index:3;width:22px;height:22px;border:none;border-radius:50%;background:rgba(12,14,20,.55);color:#fff;font-size:12px;line-height:1;cursor:pointer;pointer-events:auto;opacity:0;transition:opacity .2s ease,background .2s ease;display:grid;place-items:center;padding:0}.walk-companion:hover .walk-companion-narrate,.walk-companion:focus-within .walk-companion-narrate{opacity:1}diff --git a/src/x402-revenue.css b/src/x402-revenue.cssindex 5d74365f4..c2927ef92 100644--- a/src/x402-revenue.css+++ b/src/x402-revenue.css@@ -16,11 +16,19 @@color: var(--ink, #d8d8d8);}-/* ambient glow behind the hero */+/* ambient glow behind the hero. The side bleed is capped at the viewport:+ the shell is centered, so (100% - 100vw) / 2 is exactly the negative offset+ that reaches the viewport edge; the extra 12px stays clear of the scrollbar+ gutter so the glow can never create horizontal scroll. The mask fades the+ capped edges so the clamp is invisible at any width. */.xr-glow {position: absolute;- inset: -10% -20% auto -20%;+ inset: -10% auto auto auto;+ left: max(-20%, calc((100% - 100vw) / 2 + 12px));+ right: max(-20%, calc((100% - 100vw) / 2 + 12px));height: 420px;+ mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);+ -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);background:radial-gradient(60% 80% at 20% 0%,diff --git a/tests/api/pump-curve.test.js b/tests/api/pump-curve.test.jsindex 7b7a981ba..e8a7fda4e 100644--- a/tests/api/pump-curve.test.js+++ b/tests/api/pump-curve.test.js@@ -171,6 +171,45 @@ describe('GET /api/pump/curve', () => {expect(body.graduatedPrice.marketCapUsd).toBeCloseTo(0.0035 * 1_000_000_000, 3);});+ it('502 upstream_error (well-formed JSON, not a raw 500) when every RPC lane fails cold', async () => {+ // A mint never successfully read on this instance: nothing in the+ // last-good tier, so the outage surfaces as the same typed 502 that+ // api/pump/price-history uses (clients already render it).+ const FLAKY_MINT = '2'.repeat(32) + 'pump';+ getBondingCurveState.mockRejectedValueOnce(new Error('503 Service Unavailable'));+ getTokenPrice.mockRejectedValueOnce(new Error('503 Service Unavailable'));+ getGraduationProgress.mockRejectedValueOnce(new Error('503 Service Unavailable'));+ const res = makeRes();+ await curveHandler(makeReq({ url: `/api/pump/curve?mint=${FLAKY_MINT}` }), res);+ expect(res.statusCode).toBe(502);+ expect(getJson(res).error).toBe('upstream_error');+ });++ it('200 stale view from the last-good tier when RPC fails after a good read', async () => {+ const STALE_MINT = '3'.repeat(32) + 'pump';+ // First read succeeds and is remembered.+ getBondingCurveState.mockResolvedValueOnce({ complete: false, creator: 'CRE' });+ getTokenPrice.mockResolvedValueOnce({ priceSol: '0.0002' });+ getGraduationProgress.mockResolvedValueOnce({ progressBps: 1200 });+ const okRes = makeRes();+ await curveHandler(makeReq({ url: `/api/pump/curve?mint=${STALE_MINT}` }), okRes);+ expect(okRes.statusCode).toBe(200);++ // Second read: every lane down, so the remembered view is served, marked stale.+ getBondingCurveState.mockRejectedValueOnce(new Error('rpc down'));+ getTokenPrice.mockRejectedValueOnce(new Error('rpc down'));+ getGraduationProgress.mockRejectedValueOnce(new Error('rpc down'));+ const res = makeRes();+ await curveHandler(makeReq({ url: `/api/pump/curve?mint=${STALE_MINT}` }), res);+ expect(res.statusCode).toBe(200);+ const body = getJson(res);+ expect(body.stale).toBe(true);+ expect(typeof body.as_of).toBe('number');+ expect(body.curve.creator).toBe('CRE');+ expect(body.price.priceSol).toBe('0.0002');+ expect(res.getHeader('cache-control')).toMatch(/max-age=10/);+ });+it('honors network=devnet', async () => {getBondingCurveState.mockResolvedValueOnce({ creator: 'X' });getTokenPrice.mockResolvedValueOnce(null);diff --git a/tests/server-rewrite-query.test.js b/tests/server-rewrite-query.test.jsindex 41700e9ec..c5c5385c5 100644--- a/tests/server-rewrite-query.test.js+++ b/tests/server-rewrite-query.test.js@@ -74,6 +74,35 @@ describe('rewrite-dest query params reach handlers on req.url', () => {expect(res.headers.get('location')).toBeTruthy();}, 15000);+ it('bare [action] index paths dispatch to the index, not the catch-all branch', async () => {+ // /api/auth/wallets and /api/auth/sessions rewrite to their [action]+ // handlers with NO ?action= in the dest, and req.url keeps the ORIGINAL+ // pathname. The dispatcher's URL fallback must not mistake the endpoint's+ // own directory segment ("wallets"/"sessions") for an address/session id,+ // which routed GET to the DELETE-only branch and 405'd every dashboard+ // page that lists wallets or sessions. Unauthenticated, the healthy index+ // answer is 401 (sign in required); the regression answer was 405.+ for (const path of ['/api/auth/wallets', '/api/auth/sessions']) {+ const res = await fetch(`${BASE}${path}`);+ expect(res.status, path).toBe(401);+ }+ }, 15000);++ it('[action] subpaths still reach their per-action branch', async () => {+ // A concrete session id must still land in the revoke-one branch, whose+ // method gate rejects GET with 405 (it is DELETE-only). Guards against+ // over-correcting the index fix into swallowing real actions.+ const res = await fetch(`${BASE}/api/auth/sessions/00000000-0000-4000-8000-000000000000`);+ expect(res.status).toBe(405);+ }, 15000);++ it('OPTIONS on a POST-only API resolves without a 405 (the /bnb liveness probe)', async () => {+ // src/bnb.js probes /api/bnb/register-agent with OPTIONS to check the+ // route is deployed without triggering the POST-only 405 console error.+ const res = await fetch(`${BASE}/api/bnb/register-agent`, { method: 'OPTIONS' });+ expect(res.status).toBe(204);+ }, 15000);+it('handlers behind a [param].js dest still see the ORIGINAL pathname on req.url', async () => {// /api/marketplace/categories → dest /api/marketplace/[action]?action=categories.// api/marketplace/[action].js routes by parsing req.url's path segments, so ifdiff --git a/vercel.json b/vercel.jsonindex aa44899c2..a962a0609 100644--- a/vercel.json+++ b/vercel.json@@ -1332,6 +1332,12 @@},{"src": "/viewer/?",+ "headers": {+ "content-security-policy": "frame-ancestors *; base-uri 'self'; object-src 'none'; report-uri /api/client-errors",+ "x-content-type-options": "nosniff",+ "referrer-policy": "strict-origin-when-cross-origin",+ "cross-origin-resource-policy": "cross-origin"+ },"dest": "/viewer.html"},{@@ -2032,6 +2038,20 @@},"status": 301},+ {+ "src": "/dashboard/usage",+ "headers": {+ "Location": "/dashboard/analytics"+ },+ "status": 301+ },+ {+ "src": "/dashboard/storage",+ "headers": {+ "Location": "/dashboard/settings"+ },+ "status": 301+ },{"src": "/dashboard/x402-admin","dest": "/dashboard/x402-admin.html"@@ -2425,13 +2445,6 @@"src": "/api/agents/([^/]+)/pumpfun/([^/]+)","dest": "/api/agents/pumpfun/[action]?id=$1&action=$2"},- {- "src": "/dashboard/storage",- "headers": {- "Location": "/dashboard/settings"- },- "status": 301- },{"src": "/api/agents/([^/]+)/embed-policy","dest": "/api/agents/[id]"@@ -4036,13 +4049,6 @@"src": "/api/llm/anthropic","dest": "/api/llm/anthropic.js"},- {- "src": "/dashboard/usage",- "headers": {- "Location": "/dashboard/analytics"- },- "status": 301- },{"src": "/api/erc8004/register-confirm","dest": "/api/erc8004/register-confirm"@@ -4826,6 +4832,22 @@"src": "/labs/","dest": "/labs.html"},+ {+ "src": "/search",+ "dest": "/search.html"+ },+ {+ "src": "/search/",+ "dest": "/search.html"+ },+ {+ "src": "/rankings",+ "dest": "/rankings.html"+ },+ {+ "src": "/rankings/",+ "dest": "/rankings.html"+ },{"src": "/fact-check","dest": "/fact-check.html"diff --git a/vite.config.js b/vite.config.jsindex a55048133..8b5573625 100644--- a/vite.config.js+++ b/vite.config.js@@ -450,6 +450,8 @@ const appConfig = {'a-edit': resolve(__dirname, 'pages/a-edit.html'),'a-me': resolve(__dirname, 'pages/a-me.html'),labs: resolve(__dirname, 'pages/labs.html'),+ search: resolve(__dirname, 'pages/search.html'),+ rankings: resolve(__dirname, 'pages/rankings.html'),'fact-checker': resolve(__dirname, 'pages/fact-checker.html'),unstoppable: resolve(__dirname, 'pages/unstoppable.html'),shopper: resolve(__dirname, 'pages/shopper.html'),@@ -1266,6 +1268,10 @@ support: resolve(__dirname, 'pages/support.html'),'/bazaar/': resolve(root, 'public/bazaar.html'),'/labs': resolve(root, 'pages/labs.html'),'/labs/': resolve(root, 'pages/labs.html'),+ '/search': resolve(root, 'pages/search.html'),+ '/search/': resolve(root, 'pages/search.html'),+ '/rankings': resolve(root, 'pages/rankings.html'),+ '/rankings/': resolve(root, 'pages/rankings.html'),'/forever': resolve(root, 'public/forever.html'),'/forever/': resolve(root, 'public/forever.html'),'/arbitrage': resolve(root, 'public/arbitrage.html'),@@ -2294,6 +2300,11 @@ support: resolve(__dirname, 'pages/support.html'),['dist/public/demos/3d-home.html', 'dist/demos/3d-home.html'],['dist/public/eth-vanity.html', 'dist/eth-vanity.html'],['dist/public/evm-wallet.html', 'dist/evm-wallet.html'],+ // /vanity-wallet: its sealed-drops controller pulls bare deps+ // (bs58, @noble/*, qrcode) that only resolve through the bundler.+ // Serving the raw publicDir copy threw "Failed to resolve module+ // specifier bs58" in production; promote the bundled output.+ ['dist/public/vanity-wallet.html', 'dist/vanity-wallet.html'],// Grind-bounty market: its controller pulls bare deps (bs58, @noble,// sealed-envelope) through the bundler, so the BUNDLED output must be// served — promote it over the raw publicDir copy before dist/publicdiff --git a/walk-sdk/src/companion.js b/walk-sdk/src/companion.jsindex b999e5585..6656c75aa 100644--- a/walk-sdk/src/companion.js+++ b/walk-sdk/src/companion.js@@ -546,10 +546,10 @@ function ensureStyles() {.walk-companion-close:hover{background:rgba(220,60,60,.85)}.walk-companion-swap:hover{background:rgba(122,162,255,.85)}.walk-companion-close:focus-visible,.walk-companion-swap:focus-visible{outline:2px solid #7aa2ff;outline-offset:2px;opacity:1}-.walk-companion-bubble{position:absolute;left:50%;bottom:calc(100% - 38px);z-index:2;transform:translateX(-50%) translateY(6px);max-width:230px;width:max-content;background:rgba(18,20,28,.94);color:#f2f4f8;font:500 12.5px/1.4 system-ui,-apple-system,'Segoe UI',sans-serif;padding:8px 11px;border-radius:12px;border:1px solid rgba(255,255,255,.1);box-shadow:0 10px 28px rgba(0,0,0,.35);pointer-events:none;opacity:0;transition:opacity .3s ease,transform .3s ease;text-align:center}+.walk-companion-bubble{position:absolute;left:50%;bottom:calc(100% - 38px);z-index:2;transform:translateX(-50%) translateY(6px);box-sizing:border-box;max-width:min(216px,calc(100vw - 16px));width:max-content;background:rgba(18,20,28,.94);color:#f2f4f8;font:500 12.5px/1.4 system-ui,-apple-system,'Segoe UI',sans-serif;padding:8px 11px;border-radius:12px;border:1px solid rgba(255,255,255,.1);box-shadow:0 10px 28px rgba(0,0,0,.35);pointer-events:none;opacity:0;transition:opacity .3s ease,transform .3s ease;text-align:center}.walk-companion-bubble.is-in{opacity:1;transform:translateX(-50%) translateY(0)}.walk-companion-bubble::after{content:'';position:absolute;left:50%;top:100%;transform:translateX(-50%);border:6px solid transparent;border-top-color:rgba(18,20,28,.94)}-@media (max-width:520px){.walk-companion{width:148px;height:208px;right:10px;bottom:10px}.walk-companion-bubble{font-size:11.5px;max-width:170px}}+@media (max-width:520px){.walk-companion{width:148px;height:208px;right:10px;bottom:10px}.walk-companion-bubble{font-size:11.5px;max-width:min(156px,calc(100vw - 12px))}}@media (pointer:coarse){.walk-companion-close,.walk-companion-swap{opacity:1;width:26px;height:26px}.walk-companion-swap{right:32px}}@keyframes walk-companion-shimmer{to{transform:translateX(120%)}}@media (prefers-reduced-motion:reduce){.walk-companion,.walk-companion-bubble{transition:none}.walk-companion__skel::after{animation:none;opacity:.5}}diff --git a/walk-sdk/src/internal/load-avatar.js b/walk-sdk/src/internal/load-avatar.jsindex df6bffc30..92baebdab 100644--- a/walk-sdk/src/internal/load-avatar.js+++ b/walk-sdk/src/internal/load-avatar.js@@ -103,7 +103,9 @@ export async function loadWalkAvatar(entry, opts = {}) {// 2. fall back to the default rig (the caller's fallbackEntry).if (err?.code === RIG_UNSUPPORTED) {if (gltf.animations && gltf.animations.length) {- log.warn(+ // Same expected-fallback path: baked clips are a designed recovery,+ // not a failure worth a warning on every page view.+ log.debug(`avatar "${active.id}" isn't a retargetable humanoid — driving its ${gltf.animations.length} baked clip(s) instead`,);// The shared `clips` map names manifest clips, not embedded ones, so@@ -111,7 +113,9 @@ export async function loadWalkAvatar(entry, opts = {}) {// fallback (which never freezes).controller = makeEmbeddedController(model, gltf.animations, {}, { waveMs });} else if (fallbackEntry && fallbackEntry.id !== active.id) {- log.warn(+ // Expected, handled behavior (non-humanoid rigs fall back by design),+ // so log at debug, not warn, to keep every page view's console clean.+ log.debug(`avatar "${active.id}" can't be animated (non-humanoid rig, no baked clips) — falling back to "${fallbackEntry.id}"`,);disposeModel(model);