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
Site overhaul: design tokens, homepage, marketplace, dashboard polish; remove stale pages
nirholas5c467643654c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 97b526cb5..0a547f9ee 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -18,6 +18,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Agent Activity — live oracle trading floor** — New page at /activity shows every Oracle conviction trade made by every autonomous 3D agent, in real time. Filter by tier (prime/strong/lean/watch) and mode (live/simulate). Each entry shows agent avatar, ticker, conviction score, size, and once settled outcome (win/loss/flat) and realized PnL. Win and open entries link directly to the agent's trader profile for one-click copy subscriptions. Platform-level KPIs (agents active, win rate, 7-day PnL) appear at the top. Auto-refreshes every 30 seconds. (`/activity`) `[feature]`- **Agent profile: deploy on-chain and edit controls for agent owners** — When you own an agent, its profile page (/agent/:id) now shows a full owner action bar in the hero section with one-click access to Edit Agent, Manage Agents, and — for agents not yet deployed — a Deploy on-chain button. The BLOCKCHAIN DETAILS section now mounts an inline deploy widget that shows the chain selector and signs on Solana (Metaplex Core) or any EVM chain, with a persistent success chip linking to the explorer once deployed. (`/agents`) `[improvement]`- **Agent trading record — proof-of-edge on every agent profile** — Agent profiles now show a live TRADING RECORD panel that pulls directly from the Oracle's action ledger. Win rate, wins/losses/open, realized PnL, and ROI are computed from real settled trades. Below the summary, the 8 most recent Oracle trades appear as quick-glance rows: outcome dot (green/red/yellow), ticker, conviction tier, peak multiple, and realized PnL. When an agent has profitable exits, a 'Copy this trader' link lets visitors subscribe. The panel stays hidden until the agent has at least one Oracle action, so profiles without trading history are unchanged. (`/agents`) `[feature]`+- **Agent-wallet payment demo fails gracefully when the local bridge isn't running** — The /play/agent-wallet demo pays a real x402 endpoint by signing through a bridge that runs in your terminal. On the live site, with no bridge to reach, the page used to hang on "Connecting to bridge…" while a doomed network request timed out in the background. It now recognizes there's no local bridge and shows the "Bridge offline" banner immediately — with the exact command to start the bridge — instead of stalling. Multiplayer /walk and the avatar creator were also hardened so they degrade cleanly when their server isn't configured rather than trying to reach a local address that doesn't exist in production. (`/play/agent-wallet`) `[fix]`- **Agents Index — browse every public 3D AI agent on three.ws** — A new /agents page lists every public agent on the platform: search by name or description, filter to on-chain-registered agents only, sort by popularity or newest, and paginate through the directory. Each card shows the agent's avatar, top skills, and chat count with a direct link to their profile. My Agents at /my-agents gives registered users a focused view of their own agents with quick Edit and Deploy links. (`/agents`) `[feature]`- **Agents: Oracle and Sniper trading status on agent cards** — The agents dashboard now shows live trading badges on each card. If an agent has Oracle conviction history, its win rate and realized PnL appear inline. If a sniper strategy is armed and active, the agent card shows the strategy's realized PnL. Both badges link to the relevant dashboard so you can drill in from the agents list. (`/dashboard/agents`) `[improvement]`- **Avatar picker: live 3D previews, IRL + XR deeplinks, and XR orbit lock** — The avatar selector sheet on /irl and /xr now renders a real 3D preview of each of your avatars instead of a blank silhouette — models load lazily using an IntersectionObserver so opening the sheet stays instant. The /xr page gains a Lock button: tapping it freezes OrbitControls so the avatar stays centered for headset or camera-AR use (tap again to restore free orbit). Your avatar detail page now has Walk IRL and View in XR buttons that drop you straight into the live experience with that avatar pre-loaded — no setup required. (`/xr`) `[feature, improvement]`@@ -30,12 +31,15 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Copy trading: Oracle conviction gate** — Copy subscriptions now support a minimum Oracle conviction score. Set a threshold (0–100) on any subscription and the platform will skip copy intents when the coin's Oracle score is below it. Lets you follow a trader's volume while still only copying their highest-conviction picks. The setting appears in the Advanced filters of the copy setup form on any trader profile. (`/leaderboard`) `[feature]`- **Copy trading: Telegram notifications when a buy intent arrives** — Copiers who enter a Telegram chat ID in their subscription settings now receive an instant message the moment the fanout cron creates a pending buy intent — coin name, tier, Oracle score, the sized order amount, and a direct link to the copy dashboard. Works for both sniper-sourced and Oracle conviction-sourced intents. (`/dashboard/copy`) `[feature]`- **Create flow: guided "what's next" screen after every avatar save** — Saving an avatar or completing an agent no longer drops you on a blank library page. A new /create/next screen appears immediately after: your 3D model spins in the left panel while three action cards on the right guide you through the natural progression — give it an AI brain, embed it on any site, or optionally deploy it on-chain. Each card deep-links directly with your new avatar or agent pre-loaded so the session continues without starting over. (`/create`) `[feature, improvement]`+- **Create-flow feature previews now show live data, not sample numbers** — The capability previews on the avatar create screen — Reputation, Analytics, and Token Launch — used to display illustrative sample figures (placeholder reviews, made-up revenue, a fake token price). They now pull real numbers live: Reputation and Analytics show the platform's actual on-chain attestation count, registered-agent totals, widgets and chains; Token Launch shows the live $THREE market (price, 24h change, market cap, volume). Each strip loads with a skeleton and quietly collapses if a data source is briefly unreachable, so you never see invented figures. Skill-pricing previews now read "you set the price" instead of fabricated per-call amounts. (`/create-review`) `[improvement]`- **Embed wizard now reachable from every agent and avatar page** — The full-featured embed wizard (/embed) is now one click away from any agent detail page, avatar page, and the dashboard agents list. Open it to configure size, environment, mode, and controls, see a live preview, and copy platform-specific instructions for plain HTML, React, WordPress, Webflow, or Shopify. When the wizard is opened from an agent page it pre-loads the agent and defaults to chat mode. (`/embed`) `[improvement]`+- **Embedded agents and the marketplace lobby fail gracefully instead of crashing** — Hardened the async boundaries on a few load paths so a flaky network never leaves a silent crash in the page. When an embedded agent, a saved widget, or an on-chain agent can't load, you now get a clear "Couldn't load this" message with a retry button instead of a half-rendered viewer. On the marketplace lobby, a hiccup loading the 3D model decoder no longer throws an uncaught error — the gallery degrades quietly and the rest of the page keeps working. `[fix]`- **Every launch now has its own page — the full story of a coin in one place** — Until now, clicking a coin on the launches feed sent you out to pump.fun. Now every launch opens a rich profile that stays on three.ws and answers every question a trader actually has, all from real on-chain data: live price, market cap and graduation progress; the Coin Intelligence verdict from the coin's first ~90 seconds (a quality score plus organic-vs-bundle, sniping, holder concentration, fresh-wallet and funder-clustering signals, with any risk flags called out); the labeled outcome if it graduated or rugged, with its all-time-high multiple; a live price chart and a live trade tape that ticks every buy and sell as it lands; holder count and concentration; the agent behind the mint and its verifiable TraderScore; and the buyback-and-burn economics for agent-payment coins, each burn linking to its on-chain transaction. Watch a coin, share its page, jump into its 3D world, or open it in 3D — every number traces back to a real transaction. (`/launches`) `[feature]`- **Features page — interactive animation showcase with 30+ live demos** — The /features page now has a live animation showcase you can interact with in the browser. Pick from 30+ animations grouped by type (Idle, Dance, Celebration, Athletic, Combat, Walk, Mood) — the 3D avatar switches instantly with no page reload. The Widget Studio card also got a live preview panel showing what the embed looks like on a real site, plus a one-click snippet copy button. (`/features`) `[improvement]`- **Forge: fix 3D model generation on the free NVIDIA lane** — The free TRELLIS text-to-3D lane stopped producing models when NVIDIA changed their API to return a CDN URL instead of inline base64. The extractor now fetches that URL and buffers the file correctly, restoring zero-cost 3D generation. Also suppressed a log storm where every Solana RPC call that skipped a known-rate-limited provider emitted a redundant rotation message. (`/forge`) `[fix]`- **Guided tour engine — spotlight coachmarks with server-backed persistence** — Built a reusable in-app tour engine that any page can use with a simple declarative step list. Tours spotlight DOM elements with an animated overlay, show contextual tooltips with Back/Next/Skip controls, handle keyboard navigation (arrows + Escape), announce each step to screen readers, and remember completion in both localStorage and the server (so tours don't re-appear across devices). The dashboard now shows a 4-step orientation tour to new accounts pointing out the nav, creations, KPIs, and quick actions. (`/dashboard`) `[feature]`- **Home page now features Oracle — live conviction scores on the front page** — The three.ws home page now has an Oracle section between the Pump.fun token economy block and the pay-per-call block. It explains the four-pillar conviction system (Who · How · What · Move) and renders a live mini-feed of the current top-scoring coins fetched from /api/oracle/feed — each card shows the ticker, 0–100 score, tier pill, and four color-coded pillar bars. Clicking any card opens the Oracle drawer for that coin. The live dot pulses while data is streaming. (`/`) `[improvement]`+- **Home page token buttons now land on real pages** — Two buttons in the home page's token-economy section pointed at pages that never existed — "Explore token agents" and "Trending tokens" both led to 404s. They now go to the right places: "Explore token agents" opens the Agent Launches feed, and "Trending tokens" opens Coin Radar, the live pump.fun launch-intelligence view. (`/launches`) `[fix]`- **Home page: Top Traders widget + Oracle proof trades in coin drawer** — The home page now shows a live Top Traders widget ranked by 7-day composite score with direct links to copy each trader. The Oracle coin drawer now loads a proof-trades section showing every agent exit on that specific coin — multiple, P&L, and a one-click copy link — closing the loop between conviction and evidence. Trade feed cards also link coin images and symbols directly to their Oracle conviction page. (`/oracle`) `[feature, improvement]`- **IRL — permanent pins for signed-in users, compass heading, and manage placements from dashboard** — Authenticated users now get permanent GPS pins (no 7-day expiry). Avatars face the correct compass direction when pinned — the heading is captured from the device compass and applied when foreign avatars spawn. New /dashboard/irl-placements page lets you view, edit captions, and remove all your placed avatars from any device without physically going back. (`/irl`) `[improvement]`- **IRL and XR: choose any of your 3D avatars from a bottom-sheet picker** — Both /irl and /xr now let you swap your 3D avatar without leaving the page. Tap Avatar (IRL) or Change (XR) to open a thumbnail grid of all your uploaded avatars. Selecting one hot-swaps the model in the scene instantly — camera, animations, half-body mode, and AR state all carry over. Signed-out users see a prompt to sign in; empty accounts link to the creation flow. (`/irl`) `[feature]`@@ -46,6 +50,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Launch detail: pump.fun comment sentiment in Community section** — The coin detail page now shows live pump.fun comment sentiment in the Community section — bullish / bearish / mixed classification with positive, negative, and neutral percentage bars, and a sample comment. Loads asynchronously after the page renders so it never delays the Oracle conviction score or smart money data. Coins with fewer than 3 comments are silently skipped. (`/launches`) `[feature]`- **Launches: Oracle conviction tier filter** — The Launches feed now has a conviction tier filter: All, Prime, Strong, or Lean. Selecting a tier server-filters the feed — only three.ws agent-launched coins that have reached that Oracle conviction floor appear, sorted by score descending. The Oracle badge on each card is injected synchronously from the API response (no extra batch fetch), so filtered views are faster than before. (`/launches`) `[feature, improvement]`- **Leaderboard: Oracle Conviction Rankings — agents ranked by conviction win rate** — The Trader Leaderboard now includes an Oracle Conviction Rankings section below the main board. Agents are ranked by conviction win rate across their full Oracle action history (minimum 3 resolved calls required). Each row shows wins/losses, realized PnL, and ROI. A new /api/oracle/leaderboard endpoint drives the data. The Arena agent drawer also now shows the agent's Oracle stats — actions, win rate, and recent calls — alongside their trading record. (`/leaderboard`) `[feature]`+- **Live $THREE market signal now greets you on the home page** — Right under the hero, the home page now shows a live $THREE signal bar pulling real market data: current price with its 24h change (green up, red down), market cap, 24h trading volume, and the running total of $THREE permanently burned by agent deployments. Every figure is fetched live from the token API (Birdeye → DexScreener → GeckoTerminal failover, edge-cached) and refreshes every 30 seconds without a reload. If the data source is briefly unreachable it degrades to a quiet link to the token page instead of showing blanks, and it pauses refreshing while the tab is in the background. (`/three-token`) `[feature, improvement]`- **Live Trade Feed — every notable pump.fun win in one public stream** — A new public feed at /trades shows every notable closed position from three.ws AI agents in real time: exit multiple, realized PnL, hold time, Oracle conviction tier, and the number of copiers following that trader. No login needed. Filter by time window (1h / 24h / 7d / 30d), minimum profit threshold, and network. Each card links directly to the trader's profile, the coin on pump.fun, and the on-chain buy/sell transactions. The feed is the platform's top-of-funnel virality surface — every win is a provable, shareable ad. (`/trades`) `[feature]`- **Manage your IRL pins from a new "My pins" panel** — Placed an agent at a real-world spot? A new "My pins" button now appears in the IRL playground once location is ready. Tap it to see every pin you placed from this device — with the agent name, your caption, how far away it is, and when you dropped it — and remove any of them with one tap. Your pins are remembered across page reloads, so you can always find and clean them up later. Deleting the pin you're currently standing on also unpins your agent right away. (`/irl`) `[feature, improvement]`- **On-chain deploy: cinematic step-by-step progress** — Deploying an agent on-chain now shows a dramatic vertical progress flow — each step is a glowing tile with a checkmark when done, a pulsing animated spinner on the active step, and flowing connector lines between them. The current step is called out in large status text with a live terminal-style detail line underneath (handy when grinding a vanity address). The vanity-grind cancel is now a clearly labeled Stop grinding button. After a successful mint on Solana or any EVM chain, you're taken straight to the reveal page for your new on-chain agent. (`/agents`) `[improvement]`@@ -77,6 +82,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Oracle: rich conviction card on every shared link** — Sharing an Oracle link — /oracle?mint=X — now generates a dynamic social card showing the coin's name, conviction score, tier badge, four-pillar breakdown (Who/How/What/Move), and smart wallet count. The card updates when you open the coin drawer, so the URL you share previews real conviction data on X, Telegram, Discord, and iMessage. (`/oracle`) `[feature, improvement]`- **Oracle: rich social previews when sharing conviction links** — Every Oracle coin conviction link now resolves to a server-rendered preview page (/oracle/coin/<mint>) that shows the score, tier, and pillar breakdown as a rich social card on X/Twitter, Telegram, Discord, Slack, and iMessage — no more generic placeholder when sharing a pump.fun conviction signal. The Oracle drawer's Share button and tweet links now point to these canonical share URLs. A Copy link button in the drawer makes it one-tap to grab the shareable link. (`/oracle`) `[improvement]`- **Oracle: Verify Telegram setup with a test message** — The Oracle arm panel now has a Send test button next to the Telegram chat ID field. Clicking it sends an immediate test message to confirm your bot setup is working before you wait for a real signal to arrive. The button shows delivery success or a hint if the bot hasn't been started. (`/oracle`) `[improvement]`+- **Pages that hit a network error now show a retry, never a blank screen** — Audited every data-loading surface across the home page, Discover, the Marketplace, your Dashboard, agent profiles, and the create flow so a flaky connection always lands on a designed state instead of an empty void. Lists that fail to load now show a clear "Couldn't load this — Retry" message with a working retry button; sections still loading show a skeleton instead of a frozen spinner; and the home hero, transcript and knowledge popups, and avatar pickers recover cleanly if a request drops. Toggle your connection off and reload — the page tells you what happened and how to recover. `[improvement]`- **Pay an agent in the IRL playground with one tap via x402** — Walk up to an agent pinned in the real world that offers a paid service, and the interaction sheet now shows a working "Pay via x402" button. Tapping it connects your wallet, signs a USDC payment, and settles the call for real — no more "coming soon" placeholder. The button connects first if your wallet is locked, shows its progress (Connecting → Sending → Paid), stays disabled after a successful payment so you can't accidentally pay twice, and re-enables itself if a payment is cancelled or fails so you can retry. (`/irl`) `[feature, improvement]`- **Portfolio: Oracle conviction for every token you hold** — The portfolio dashboard now shows Oracle conviction scores on Solana tokens. Each row gets a live badge showing the Oracle score and tier (prime / strong / lean). The pump.fun tokens table adds an Oracle column. And when you open any token's detail drawer, a conviction breakdown appears — score dial, pillar bars, and a link to the full Oracle analysis. Helps you make informed hold / sell decisions from the portfolio view. (`/dashboard/portfolio`) `[improvement]`- **Pump Dashboard: live Oracle conviction panel on the main trading desk** — The Pump Dashboard now has a High Conviction panel alongside the live feed — showing the top 5 Oracle-scored coins (score ≥ 60) with their tier badge, 4-pillar bars, and a link to the Oracle drawer. The panel auto-refreshes every 90 seconds and pulses with a live indicator. Clicking any coin opens the full conviction breakdown. (`/pump-dashboard`) `[improvement]`diff --git a/DESIGN-TOKENS.md b/DESIGN-TOKENS.mdindex b5979e7f3..62953abfa 100644--- a/DESIGN-TOKENS.md+++ b/DESIGN-TOKENS.md@@ -97,6 +97,25 @@ transition: transform var(--duration-fast) var(--ease-standard),### Layout`--header-h` (3.5rem) · `--phi` (1.618).+### Semantic alias layer (B12)+Thin, intention-named synonyms that resolve *to* the primitives above (same+sanctioned pattern as `--nxt-*` / `--nv-*` — they alias, never fork). Reach for+these when an intention name reads clearer than the primitive:++- **Colour:** `--color-bg`→`--bg-0` · `--color-surface`→`--surface-1` ·+ `--color-text`→`--ink` · `--color-text-bright`→`--ink-bright` ·+ `--color-text-dim`→`--ink-dim` · `--color-text-faint`→`--ink-faint` ·+ `--color-accent`→`--accent` · `--color-border`/`--color-hairline`→`--stroke` ·+ `--color-danger`→`--danger` · `--color-success`→`--success` ·+ `--color-warning`→`--warn`. Because they point at the remapped primitives they+ flip automatically under `[data-theme='light']`.+- **Spacing (4px UI grid):** `--space-1`…`--space-8` (4/8/12/16/20/24/28/32px).+ Complements — does not replace — the φ display scale (`--space-sm/md/lg…`).+ Use the φ rungs for marketing rhythm; use the 4px ramp for product chrome+ (nav/cards/forms) where dense layouts sit on a 4px grid.+- **Radius:** `--radius-full`→`--radius-pill`.+- **Motion:** `--dur-fast`→`--duration-fast` · `--dur-med`→`--duration-base`.+## The rule: no hardcoded valuesBefore typing a literal, check for a token:diff --git a/data/changelog.json b/data/changelog.jsonindex f593bd2cf..4df1b7867 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,59 @@{"$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-06-16",+ "title": "Pages that hit a network error now show a retry, never a blank screen",+ "summary": "Audited every data-loading surface across the home page, Discover, the Marketplace, your Dashboard, agent profiles, and the create flow so a flaky connection always lands on a designed state instead of an empty void. Lists that fail to load now show a clear \"Couldn't load this — Retry\" message with a working retry button; sections still loading show a skeleton instead of a frozen spinner; and the home hero, transcript and knowledge popups, and avatar pickers recover cleanly if a request drops. Toggle your connection off and reload — the page tells you what happened and how to recover.",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-06-16",+ "title": "Embedded agents and the marketplace lobby fail gracefully instead of crashing",+ "summary": "Hardened the async boundaries on a few load paths so a flaky network never leaves a silent crash in the page. When an embedded agent, a saved widget, or an on-chain agent can't load, you now get a clear \"Couldn't load this\" message with a retry button instead of a half-rendered viewer. On the marketplace lobby, a hiccup loading the 3D model decoder no longer throws an uncaught error — the gallery degrades quietly and the rest of the page keeps working.",+ "tags": [+ "fix"+ ]+ },+ {+ "date": "2026-06-16",+ "title": "Create-flow feature previews now show live data, not sample numbers",+ "summary": "The capability previews on the avatar create screen — Reputation, Analytics, and Token Launch — used to display illustrative sample figures (placeholder reviews, made-up revenue, a fake token price). They now pull real numbers live: Reputation and Analytics show the platform's actual on-chain attestation count, registered-agent totals, widgets and chains; Token Launch shows the live $THREE market (price, 24h change, market cap, volume). Each strip loads with a skeleton and quietly collapses if a data source is briefly unreachable, so you never see invented figures. Skill-pricing previews now read \"you set the price\" instead of fabricated per-call amounts.",+ "tags": [+ "improvement"+ ],+ "link": "/create-review"+ },+ {+ "date": "2026-06-16",+ "title": "Home page token buttons now land on real pages",+ "summary": "Two buttons in the home page's token-economy section pointed at pages that never existed — \"Explore token agents\" and \"Trending tokens\" both led to 404s. They now go to the right places: \"Explore token agents\" opens the Agent Launches feed, and \"Trending tokens\" opens Coin Radar, the live pump.fun launch-intelligence view.",+ "tags": [+ "fix"+ ],+ "link": "/launches"+ },+ {+ "date": "2026-06-16",+ "title": "Live $THREE market signal now greets you on the home page",+ "summary": "Right under the hero, the home page now shows a live $THREE signal bar pulling real market data: current price with its 24h change (green up, red down), market cap, 24h trading volume, and the running total of $THREE permanently burned by agent deployments. Every figure is fetched live from the token API (Birdeye → DexScreener → GeckoTerminal failover, edge-cached) and refreshes every 30 seconds without a reload. If the data source is briefly unreachable it degrades to a quiet link to the token page instead of showing blanks, and it pauses refreshing while the tab is in the background.",+ "tags": [+ "feature",+ "improvement"+ ],+ "link": "/three-token"+ },+ {+ "date": "2026-06-16",+ "title": "Agent-wallet payment demo fails gracefully when the local bridge isn't running",+ "summary": "The /play/agent-wallet demo pays a real x402 endpoint by signing through a bridge that runs in your terminal. On the live site, with no bridge to reach, the page used to hang on \"Connecting to bridge…\" while a doomed network request timed out in the background. It now recognizes there's no local bridge and shows the \"Bridge offline\" banner immediately — with the exact command to start the bridge — instead of stalling. Multiplayer /walk and the avatar creator were also hardened so they degrade cleanly when their server isn't configured rather than trying to reach a local address that doesn't exist in production.",+ "tags": [+ "fix"+ ],+ "link": "/play/agent-wallet"+ },{"date": "2026-06-16","title": "Tipped club dances now always perform",diff --git a/pages/app.html b/pages/app.htmlindex 3da48c176..ec39e4d31 100644--- a/pages/app.html+++ b/pages/app.html@@ -57,8 +57,72 @@<script defer type="module" src="/src/app.js"></script><link rel="stylesheet" href="/nav.css" /><link rel="stylesheet" href="/mobile.css" />+ <style>+ /* ── Accessibility: skip-link, focus rings, reduced motion ──+ Scoped to the agent-home surface (app.html). Uses the global+ focus-ring tokens from tokens.css with literal fallbacks so the+ ring is visible even before tokens resolve. */+ .skip-link {+ position: absolute;+ top: -48px;+ left: 8px;+ z-index: 10000;+ padding: 0.55rem 0.95rem;+ background: #fff;+ color: #000;+ font-size: 14px;+ font-weight: 600;+ text-decoration: none;+ border-radius: 6px;+ transition: top 0.16s ease;+ }+ .skip-link:focus,+ .skip-link:focus-visible {+ top: 8px;+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #6c8cff);+ outline-offset: var(--focus-ring-offset, 2px);+ }+ /* Visible focus indicator for every interactive element on this+ surface. :focus-visible keeps the ring off mouse clicks. */+ main.wrap a:focus-visible,+ main.wrap button:focus-visible,+ main.wrap input:focus-visible,+ main.wrap [tabindex]:focus-visible,+ main.wrap [contenteditable]:focus-visible,+ main.wrap summary:focus-visible,+ .agent-home-panel a:focus-visible,+ .agent-home-panel button:focus-visible,+ .agent-home-panel input:focus-visible,+ .agent-home-panel [contenteditable]:focus-visible,+ .agent-home-panel summary:focus-visible,+ .agent-home-show-pill:focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #6c8cff);+ outline-offset: var(--focus-ring-offset, 2px);+ border-radius: 6px;+ }+ @media (prefers-reduced-motion: reduce) {+ .skip-link {+ transition: none;+ }+ /* Disable non-essential animation/transition on this surface so+ motion-sensitive users aren't subjected to the timeline slide,+ wallet-nudge slide, poster crossfade, or emotion-label fades. */+ main.wrap *,+ main.wrap *::before,+ main.wrap *::after,+ .agent-home-panel *,+ .agent-home-show-pill,+ .agent-wallet-nudge {+ animation-duration: 0.001ms !important;+ animation-iteration-count: 1 !important;+ transition-duration: 0.001ms !important;+ scroll-behavior: auto !important;+ }+ }+ </style></head><body>+ <a class="skip-link" href="#main-content">Skip to content</a><header><h1><a href="/" aria-label="three.ws home"@@ -75,11 +139,13 @@<a href="/chat">Chat</a><a href="/docs">Docs</a><a href="/my-agents">My Agents</a>- <a+ <button+ type="button"class="save-to-account-btn"id="save-to-account-btn"hiddentitle="Save this model to your account"+ aria-label="Save this model to your account"><svgxmlns="http://www.w3.org/2000/svg"@@ -98,7 +164,7 @@<polyline points="7 3 7 8 15 8" /></svg><span>Save to account</span>- </a>+ </button><aclass="make-widget-btn"id="make-widget-btn"@@ -228,7 +294,7 @@</nav></header>- <main class="wrap">+ <main class="wrap" id="main-content"><!-- Agent presence panel — rendered by AgentHome --><div class="agent-presence-sidebar" id="agent-presence-sidebar"><div id="agent-home-container"></div>@@ -318,6 +384,8 @@width="20"height="17"viewBox="0 0 20 17"+ aria-hidden="true"+ focusable="false"><pathd="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"@@ -339,6 +407,8 @@height="16"viewBox="0 0 24 24"fill="currentColor"+ aria-hidden="true"+ focusable="false"><pathd="M9 3l1.6 4.6 4.6 1.6-4.6 1.6L9 15.4 7.4 10.8 2.8 9.2l4.6-1.6L9 3zm9 7l1.1 3.1 3.1 1.1-3.1 1.1L18 18.4l-1.1-3.1-3.1-1.1 3.1-1.1L18 10zM16.5 2.5l.8 2.2 2.2.8-2.2.8-.8 2.2-.8-2.2-2.2-.8 2.2-.8.8-2.2z"@@ -358,6 +428,8 @@height="16"viewBox="0 0 24 24"fill="currentColor"+ aria-hidden="true"+ focusable="false"><pathd="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"@@ -479,6 +551,7 @@class="next-drawer"id="next-drawer"role="dialog"+ aria-modal="true"aria-label="Viewer controls"aria-hidden="true">diff --git a/pages/create-review.html b/pages/create-review.htmlindex 3cc400569..6cd097652 100644--- a/pages/create-review.html+++ b/pages/create-review.html@@ -1096,43 +1096,7 @@.rep-stats strong { font-weight: 600; font-size: 14px; }.rep-stat-big { font-size: 18px !important; }.rep-stats .muted { font-size: 10.5px; }- .rep-stars { color: var(--text); letter-spacing: 1px; font-size: 12px; }- .rep-reviews {- display: flex;- flex-direction: column;- gap: 6px;- max-height: 220px;- overflow-y: auto;- }- .rep-review-item {- background: #080808;- border: 1px solid var(--border);- border-radius: 9px;- padding: 9px 11px;- display: flex;- flex-direction: column;- gap: 4px;- }- .rep-review-header {- display: flex;- align-items: center;- justify-content: space-between;- gap: 8px;- font-size: 11.5px;- }- .rep-review-author { font-family: ui-monospace, monospace; color: var(--muted); }- .rep-comment {- margin: 0;- font-size: 12.5px;- color: var(--text);- line-height: 1.45;- }- .rep-review-footer {- display: flex;- justify-content: space-between;- font-size: 10.5px;- }- .rep-link { color: var(--muted); cursor: default; }+ .rep-card-foot { margin: 10px 0 0; font-size: 11.5px; line-height: 1.45; }.fm-download-list {list-style: none;@@ -1321,33 +1285,6 @@}.fm-tool-item .muted { font-size: 11px; }- /* ── Activity feed (analytics modal) ───────────────────────────── */- .fm-activity-feed {- display: flex;- flex-direction: column;- background: #080808;- border: 1px solid var(--border);- border-radius: 10px;- padding: 4px 0;- }- .fm-activity-item {- display: flex;- align-items: center;- gap: 10px;- padding: 8px 14px;- font-size: 12px;- line-height: 1.4;- }- .fm-activity-item + .fm-activity-item { border-top: 1px solid var(--border); }- .fm-activity-dot {- width: 6px;- height: 6px;- border-radius: 50%;- flex-shrink: 0;- }- .fm-activity-text { flex: 1; min-width: 0; color: var(--text); }- .fm-activity-time { color: var(--muted); font-size: 11px; flex-shrink: 0; }-/* ── Capabilities section (full-width below grid) ──────────────── */.capabilities {margin-top: 32px;diff --git a/pages/forge-v2.html b/pages/forge-v2.htmldeleted file mode 100644index 799e33b39..000000000--- a/pages/forge-v2.html+++ /dev/null@@ -1,2471 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>- <meta charset="UTF-8" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Forge v2 preview · Text → 3D · three.ws</title>- <meta- name="description"- content="Design preview of the next Forge — describe an object or drop in photos, get a textured 3D model."- />- <!-- Internal design preview: keep out of search indexes and the sitemap. -->- <meta name="robots" content="noindex, nofollow" />- <meta name="theme-color" content="#080814" />- <link rel="icon" href="/favicon.ico" sizes="any" />- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />- <link rel="stylesheet" href="/style.css" />- <link rel="preconnect" href="https://ajax.googleapis.com" />- <script- type="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"- integrity="sha384-sr9b4Ux0WhAUGclJ0ym0FSY2zSOMmNSn0bP/SA0e6bNCrpn/5W3QL8mm+LdlQMKw"- crossorigin="anonymous"- ></script>- <style>- /* ── Forge brand layer ─────────────────────────────────────────────- A documented per-surface accent ON TOP of the canonical tokens- (same pattern as the IBM Carbon blue at /ibm/*): Forge gets heat.- Everything else still consumes the canonical tokens by name. */- body.forge-v2 {- --accent: #ff9d57;- --accent-soft: rgba(255, 157, 87, 0.14);- }- html[data-theme='light'] body.forge-v2 {- --accent: #c2530f;- --accent-soft: rgba(194, 83, 15, 0.12);- }- /* Ambient ember glow — gives the page a focal point without panels- having to shout. Fixed so it doesn't repaint on scroll. */- body.forge-v2::before {- content: '';- position: fixed;- inset: 0;- z-index: -1;- pointer-events: none;- background:- radial-gradient(900px 480px at 50% -140px, rgba(255, 140, 60, 0.13), transparent 65%),- radial-gradient(720px 460px at 88% 108%, rgba(255, 140, 60, 0.05), transparent 60%);- }- html[data-theme='light'] body.forge-v2::before {- background:- radial-gradient(900px 480px at 50% -140px, rgba(214, 110, 40, 0.10), transparent 65%),- radial-gradient(720px 460px at 88% 108%, rgba(214, 110, 40, 0.04), transparent 60%);- }-- /* ── Preview banner ──────────────────────────────────────────────── */- .preview-banner {- text-align: center;- font-family: var(--font-mono);- font-size: var(--text-xs);- letter-spacing: 0.04em;- color: var(--ink-dim);- background: var(--accent-soft);- border-bottom: 1px solid var(--stroke);- padding: 0.45rem var(--space-md);- }- .preview-banner a {- color: var(--accent);- text-decoration: none;- }- .preview-banner a:hover {- text-decoration: underline;- }-- /* ── Page frame ──────────────────────────────────────────────────── */- .forge-main {- max-width: 1320px;- margin: 0 auto;- padding: var(--space-lg) var(--space-md) var(--space-2xl);- }- .forge-head {- /* Reset the global site-nav `header` rule from style.css —- this is an in-page hero, not the top bar. */- display: block;- height: auto;- padding: 0;- background: none;- backdrop-filter: none;- -webkit-backdrop-filter: none;- border-bottom: 0;- overflow: visible;- white-space: normal;- line-height: var(--leading-normal);- z-index: auto;- -webkit-app-region: no-drag;- text-align: center;- margin-bottom: var(--space-lg);- }- .forge-eyebrow {- display: inline-flex;- align-items: center;- gap: 0.45rem;- font-family: var(--font-mono);- font-size: var(--text-xs);- letter-spacing: 0.16em;- text-transform: uppercase;- color: var(--ink-dim);- border: 1px solid var(--stroke);- border-radius: 999px;- padding: 0.3rem 0.7rem;- }- .forge-eyebrow::before {- content: '';- width: 6px;- height: 6px;- border-radius: 50%;- background: var(--success);- box-shadow: 0 0 8px var(--success);- }- .forge-head h1 {- display: block;- font-family: var(--font-display);- font-size: clamp(2rem, 4.6vw, var(--text-2xl));- line-height: var(--leading-tight);- margin: var(--space-md) auto var(--space-xs);- max-width: 24ch;- background: linear-gradient(115deg, var(--ink) 55%, var(--accent) 125%);- -webkit-background-clip: text;- background-clip: text;- color: transparent;- }- .forge-head p {- color: var(--ink-dim);- max-width: 52ch;- margin: 0 auto;- line-height: var(--leading-normal);- }-- /* ── Workspace: rail + stage side by side on desktop ─────────────── */- .forge-workspace {- display: grid;- gap: var(--space-lg);- align-items: start;- }- @media (min-width: 1080px) {- .forge-workspace {- grid-template-columns: minmax(370px, 430px) minmax(0, 1fr);- }- .forge-rail {- position: sticky;- top: 84px;- }- }-- /* ── Mode switch ─────────────────────────────────────────────────── */- .mode-switch-wrap {- display: flex;- margin-bottom: var(--space-sm);- }- .mode-switch {- display: flex;- width: 100%;- gap: 2px;- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: var(--radius-md);- padding: 3px;- }- .mode-switch button {- flex: 1;- background: transparent;- border: none;- color: var(--ink-dim);- font-family: var(--font-display);- font-size: var(--text-sm);- font-weight: 600;- padding: 0.5rem 0.6rem;- border-radius: var(--radius-sm);- cursor: pointer;- transition:- background 0.15s,- color 0.15s;- }- .mode-switch button:hover {- color: var(--ink);- }- .mode-switch button[aria-selected='true'] {- background: var(--surface-3);- color: var(--ink);- }- .mode-switch button:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }-- /* ── Composer ────────────────────────────────────────────────────── */- .composer {- background: var(--surface-glass);- border: 1px solid var(--stroke-strong);- border-radius: var(--radius-lg);- padding: var(--space-md);- box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.8);- }- .composer textarea {- width: 100%;- min-height: 96px;- resize: vertical;- background: transparent;- border: none;- outline: none;- color: var(--ink);- font-family: var(--font-body);- font-size: var(--text-lg);- line-height: var(--leading-normal);- }- .composer textarea::placeholder {- color: var(--ink-dim);- }-- /* Prompt tools — surprise · coach · counter */- .prompt-tools {- display: flex;- align-items: center;- gap: var(--space-sm);- margin-top: var(--space-xs);- flex-wrap: wrap;- }- .ptool {- display: inline-flex;- align-items: center;- gap: 0.4rem;- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: 999px;- color: var(--ink-dim);- font-family: var(--font-mono);- font-size: var(--text-xs);- letter-spacing: 0.02em;- padding: 0.32rem 0.72rem;- cursor: pointer;- transition:- color 0.15s,- border-color 0.15s,- background 0.15s;- }- .ptool:hover {- color: var(--ink);- border-color: var(--stroke-strong);- background: var(--surface-2);- }- .ptool:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .ptool svg {- width: 14px;- height: 14px;- }- .ptool.is-rolling svg {- animation: dice-roll 0.5s cubic-bezier(0.3, 0.7, 0.3, 1);- }- @keyframes dice-roll {- from {- transform: rotate(0);- }- to {- transform: rotate(360deg);- }- }- .prompt-coach {- display: inline-flex;- align-items: center;- gap: 0.45rem;- font-size: var(--text-xs);- color: var(--ink-dim);- line-height: 1.4;- min-height: 1.2em;- flex: 1 1 10rem;- min-width: 0;- }- .prompt-coach::before {- content: '';- width: 6px;- height: 6px;- border-radius: 50%;- background: var(--ink-dim);- flex: none;- transition:- background 0.2s,- box-shadow 0.2s;- }- .prompt-coach[data-grade='strong'] {- color: var(--success);- }- .prompt-coach[data-grade='strong']::before {- background: var(--success);- box-shadow: 0 0 8px var(--success);- }- .prompt-coach[data-grade='warn'] {- color: var(--warning, #e0a93e);- }- .prompt-coach[data-grade='warn']::before {- background: var(--warning, #e0a93e);- }- .prompt-coach[data-grade='tip']::before {- background: var(--accent);- }- .prompt-count {- font-family: var(--font-mono);- font-size: var(--text-xs);- color: var(--ink-dim);- flex: none;- font-variant-numeric: tabular-nums;- margin-left: auto;- }- .prompt-count[data-near='true'] {- color: var(--warning, #e0a93e);- }-- /* Settings — quality / engine / aspect, one compact block */- .forge-quality {- display: flex;- flex-direction: column;- gap: var(--space-sm);- margin-top: var(--space-sm);- padding-top: var(--space-sm);- border-top: 1px solid var(--stroke);- }- .fq-row {- display: flex;- align-items: center;- gap: var(--space-sm);- flex-wrap: wrap;- }- .fq-label {- font-family: var(--font-mono);- font-size: var(--text-xs);- text-transform: uppercase;- letter-spacing: 0.04em;- color: var(--ink-dim);- min-width: 4.2rem;- }- /* forge.js hides the #aspect control itself when the mode makes it- irrelevant — collapse the labeled row with it, no orphan label. */- .fq-row:has(> .aspect.is-hidden) {- display: none;- }- .aspect {- display: inline-flex;- gap: 2px;- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: var(--radius-md);- padding: 2px;- }- .aspect button {- background: transparent;- border: none;- color: var(--ink-dim);- font-family: var(--font-mono);- font-size: var(--text-xs);- padding: 0.32rem 0.55rem;- border-radius: var(--radius-sm);- cursor: pointer;- transition:- background 0.15s,- color 0.15s;- }- .aspect button:hover {- color: var(--ink);- }- .aspect button[aria-pressed='true'] {- background: var(--surface-3);- color: var(--ink);- }- /* Live backend health on the engine buttons: a throttled upstream gets- an amber dot, a down/unconfigured one is disabled with the reason in- its tooltip. Dots ride ::after so the label spacing stays put. */- .aspect button[data-health='degraded']::after {- content: '';- display: inline-block;- width: 0.4em;- height: 0.4em;- margin-left: 0.35em;- border-radius: 50%;- background: var(--warning, #e0a93e);- vertical-align: 0.08em;- }- .aspect button:disabled {- opacity: 0.45;- cursor: not-allowed;- }- .aspect button:focus-visible,- .chip:focus-visible,- .btn:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .byok-row {- display: flex;- align-items: center;- gap: var(--space-sm);- flex-wrap: wrap;- }- .byok-input {- flex: 1 1 12rem;- min-width: 0;- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: var(--radius-md);- color: var(--ink);- font-family: var(--font-mono);- font-size: var(--text-sm);- padding: 0.5rem 0.7rem;- outline: none;- transition:- border-color 0.15s,- box-shadow 0.15s;- }- .byok-input:focus-visible {- border-color: var(--accent);- box-shadow: 0 0 0 3px var(--accent-soft);- }- .byok-input[aria-invalid='true'] {- border-color: var(--danger);- }- .byok-hint {- flex-basis: 100%;- font-size: var(--text-xs);- color: var(--ink-dim);- }- .byok-hint a {- color: var(--accent);- text-decoration: none;- }- .byok-hint a:hover {- text-decoration: underline;- }- .fq-estimate {- margin: 0;- font-family: var(--font-mono);- font-size: var(--text-xs);- color: var(--ink-dim);- min-height: 1.1em;- }- .fq-estimate strong {- color: var(--ink);- font-weight: 600;- }-- /* CTA — the one unmistakable action on the page */- .composer-row {- display: flex;- align-items: center;- justify-content: space-between;- gap: var(--space-sm);- margin-top: var(--space-sm);- padding-top: var(--space-sm);- border-top: 1px solid var(--stroke);- flex-wrap: wrap;- }- .btn {- display: inline-flex;- align-items: center;- gap: 0.5rem;- font-family: var(--font-display);- font-weight: 600;- font-size: var(--text-base);- color: #0b0b0b;- background: var(--accent);- border: 1px solid var(--accent);- border-radius: var(--radius-md);- padding: 0.6rem 1.2rem;- cursor: pointer;- transition:- transform 0.12s ease,- opacity 0.15s,- box-shadow 0.15s;- }- .btn:hover {- box-shadow: 0 0 0 4px var(--accent-soft);- }- .btn:active {- transform: translateY(1px);- }- .btn[disabled] {- opacity: 0.45;- cursor: not-allowed;- }- .btn-ghost {- background: transparent;- color: var(--ink);- border: 1px solid var(--stroke-strong);- }- .btn-ghost:hover {- background: var(--surface-2);- box-shadow: none;- }- #generate {- width: 100%;- justify-content: center;- font-size: var(--text-lg);- padding: 0.75rem 1.2rem;- background: linear-gradient(135deg, #ffb877, #ff7a2f);- border-color: transparent;- color: #1a0d04;- text-shadow: none;- }- #generate:hover {- box-shadow:- 0 0 0 4px var(--accent-soft),- 0 8px 28px -8px rgba(255, 130, 50, 0.55);- }- html[data-theme='light'] body.forge-v2 #generate {- background: linear-gradient(135deg, #d96a1e, #b34a08);- color: #fff;- }- .gen-kbd {- font-family: var(--font-mono);- font-size: 0.72em;- line-height: 1;- padding: 0.2em 0.4em;- border-radius: var(--radius-sm);- background: rgba(0, 0, 0, 0.16);- border: 1px solid rgba(0, 0, 0, 0.22);- color: inherit;- opacity: 0.85;- }- @media (max-width: 560px) {- .gen-kbd {- display: none;- }- }-- /* ── View slots — image / multi-view / sketch modes ──────────────── */- .image-pane {- display: flex;- flex-direction: column;- }- .views-grid {- display: grid;- grid-template-columns: repeat(4, 1fr);- gap: var(--space-sm);- }- @media (max-width: 620px) {- .views-grid {- grid-template-columns: repeat(2, 1fr);- }- }- /* Sketch mode reuses the view-slot kit with a single, wider slot.- Declared after both .views-grid rules so it wins at every width. */- .sketch-grid {- grid-template-columns: minmax(140px, 240px);- }- .view-slot {- position: relative;- aspect-ratio: 1 / 1;- border: 1px dashed var(--stroke-strong);- border-radius: var(--radius-md);- background: var(--surface-1);- overflow: hidden;- display: grid;- place-items: center;- cursor: pointer;- transition:- border-color 0.15s,- background 0.15s,- transform 0.12s;- }- .view-slot:hover {- border-color: var(--accent);- }- .view-slot:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .view-slot.drop-target {- border-color: var(--accent);- border-style: solid;- background: var(--accent-soft);- transform: scale(1.02);- }- .view-slot[data-state='uploaded'] {- border-style: solid;- cursor: grab;- }- .view-slot[data-state='uploaded']:active {- cursor: grabbing;- }- .view-slot[data-state='error'] {- border-color: var(--danger);- border-style: solid;- }- .view-slot.dragging {- opacity: 0.4;- }- .vs-empty,- .vs-uploading,- .vs-error {- display: none;- flex-direction: column;- align-items: center;- justify-content: center;- gap: 0.35rem;- color: var(--ink-dim);- font-size: var(--text-xs);- padding: 0.5rem;- text-align: center;- }- .vs-thumb,- .vs-remove,- .vs-badge {- display: none;- }- .view-slot[data-state='empty'] .vs-empty {- display: flex;- }- .view-slot[data-state='uploading'] .vs-uploading {- display: flex;- }- .view-slot[data-state='uploaded'] .vs-thumb {- display: block;- }- .view-slot[data-state='uploaded'] .vs-remove {- display: grid;- }- .view-slot[data-state='uploaded'] .vs-badge {- display: block;- }- .view-slot[data-state='error'] .vs-error {- display: flex;- }- .vs-icon {- font-size: 1.5rem;- line-height: 1;- color: var(--ink-dim);- }- .vs-label {- font-family: var(--font-mono);- letter-spacing: 0.08em;- text-transform: uppercase;- }- .vs-thumb {- width: 100%;- height: 100%;- object-fit: cover;- pointer-events: none;- }- .vs-remove {- position: absolute;- top: 5px;- right: 5px;- width: 22px;- height: 22px;- place-items: center;- border: none;- border-radius: 50%;- background: rgba(0, 0, 0, 0.6);- color: #fff;- font-size: 1rem;- line-height: 1;- cursor: pointer;- backdrop-filter: blur(4px);- transition: background 0.15s;- }- .vs-remove:hover {- background: var(--danger);- }- .vs-badge {- position: absolute;- bottom: 5px;- left: 5px;- font-family: var(--font-mono);- font-size: 0.6rem;- text-transform: uppercase;- letter-spacing: 0.06em;- padding: 1px 6px;- border-radius: 999px;- background: rgba(0, 0, 0, 0.6);- color: var(--ink);- backdrop-filter: blur(4px);- }- .vs-uploading .shimmer {- position: absolute;- inset: 0;- background: linear-gradient(- 100deg,- transparent 20%,- rgba(255, 255, 255, 0.06) 50%,- transparent 80%- );- background-size: 200% 100%;- animation: shimmer 1.4s linear infinite;- }- .vs-retry {- background: transparent;- border: 1px solid var(--stroke-strong);- color: var(--ink);- border-radius: var(--radius-sm);- font-size: var(--text-xs);- padding: 0.2rem 0.5rem;- cursor: pointer;- }- .vs-retry:hover {- border-color: var(--accent);- }- .views-hint {- color: var(--ink-dim);- font-size: var(--text-xs);- margin: var(--space-sm) 0 0;- }- .image-prompt {- width: 100%;- min-height: 52px;- resize: vertical;- margin-top: var(--space-sm);- background: transparent;- border: 1px solid var(--stroke);- border-radius: var(--radius-md);- outline: none;- color: var(--ink);- font-family: var(--font-body);- font-size: var(--text-base);- line-height: var(--leading-normal);- padding: 0.55rem 0.7rem;- }- .image-prompt:focus {- border-color: var(--stroke-strong);- }- .image-prompt::placeholder {- color: var(--ink-dim);- }- .views-badge {- font-family: var(--font-mono);- font-size: 0.62rem;- text-transform: uppercase;- letter-spacing: 0.06em;- color: var(--ink-dim);- border: 1px solid var(--stroke);- border-radius: 999px;- padding: 1px 7px;- margin-left: 0.5rem;- }-- /* ── Example chips ───────────────────────────────────────────────── */- .chips {- display: flex;- flex-wrap: wrap;- gap: var(--space-xs);- margin-top: var(--space-sm);- }- .chip {- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: 999px;- color: var(--ink-dim);- font-size: var(--text-sm);- padding: 0.4rem 0.85rem;- cursor: pointer;- transition:- color 0.15s,- border-color 0.15s,- background 0.15s,- opacity 0.18s ease;- }- .chip:hover {- color: var(--ink);- border-color: var(--accent);- background: var(--accent-soft);- }- .chip.is-swapping {- opacity: 0;- }- .chips-more {- background: transparent;- border: 1px dashed var(--stroke-strong);- border-radius: 999px;- color: var(--ink-dim);- font-family: var(--font-mono);- font-size: var(--text-xs);- letter-spacing: 0.04em;- padding: 0.4rem 0.85rem;- cursor: pointer;- transition:- color 0.15s,- border-color 0.15s,- transform 0.4s ease;- }- .chips-more:hover {- color: var(--ink);- border-color: var(--accent);- }- .chips-more:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .chips-more.is-rolling {- transform: rotate(180deg);- }-- /* ── Stage / states ──────────────────────────────────────────────── */- .stage {- min-height: 480px;- }- .panel {- background: var(--surface-glass);- border: 1px solid var(--stroke);- border-radius: var(--radius-lg);- overflow: hidden;- }- .is-hidden {- display: none !important;- }-- /* Idle — a live model, not a void. Loads the newest community forge- (or a labeled first-party sample) so the first thing a visitor sees- is the product's output. */- .idle-viewer-wrap {- position: relative;- }- .idle-viewer-wrap model-viewer {- width: 100%;- height: min(52vh, 480px);- background: radial-gradient(120% 120% at 50% 0%, #1a1612 0%, #0b0a09 70%);- --poster-color: transparent;- }- html[data-theme='light'] .idle-viewer-wrap model-viewer {- background: radial-gradient(120% 120% at 50% 0%, #f3eee9 0%, #e7e2dc 70%);- }- .idle-tag {- position: absolute;- top: 10px;- left: 12px;- font-family: var(--font-mono);- font-size: 0.65rem;- text-transform: uppercase;- letter-spacing: 0.08em;- color: var(--ink-dim);- background: rgba(0, 0, 0, 0.45);- border: 1px solid var(--stroke);- border-radius: 999px;- padding: 2px 9px;- backdrop-filter: blur(4px);- }- .idle-bar {- display: flex;- align-items: center;- justify-content: space-between;- gap: var(--space-sm);- padding: var(--space-sm) var(--space-md);- border-top: 1px solid var(--stroke);- flex-wrap: wrap;- }- .idle-caption {- display: flex;- flex-direction: column;- gap: 0.15rem;- min-width: 0;- flex: 1 1 16rem;- }- .idle-kicker {- font-family: var(--font-mono);- font-size: var(--text-xs);- text-transform: uppercase;- letter-spacing: 0.06em;- color: var(--accent);- }- .idle-prompt {- color: var(--ink);- font-size: var(--text-sm);- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- }- .idle-hint {- flex-basis: 100%;- margin: 0;- color: var(--ink-dim);- font-size: var(--text-xs);- line-height: var(--leading-normal);- }-- /* Generating */- .gen {- display: grid;- grid-template-columns: 1fr 1.1fr;- gap: var(--space-md);- padding: var(--space-md);- }- @media (max-width: 720px) {- .gen {- grid-template-columns: 1fr;- }- }- .gen-preview {- position: relative;- aspect-ratio: 1 / 1;- border-radius: var(--radius-md);- border: 1px solid var(--stroke);- background: var(--surface-1);- overflow: hidden;- display: grid;- place-items: center;- }- .gen-preview img {- width: 100%;- height: 100%;- object-fit: cover;- animation: paint-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;- }- @keyframes paint-in {- from {- opacity: 0;- filter: blur(16px) saturate(0.7);- transform: scale(1.05);- }- to {- opacity: 1;- filter: blur(0) saturate(1);- transform: none;- }- }- /* Reconstruction scanline — sweeps the reference image while the mesh- step is live, so the wait reads as work, not silence. */- .gen-preview.is-reconstructing::after {- content: '';- position: absolute;- inset: 0;- background: linear-gradient(- 180deg,- transparent 0%,- color-mix(in srgb, var(--accent) 30%, transparent) 50%,- transparent 100%- );- background-size: 100% 34%;- background-repeat: no-repeat;- animation: forge-scan 2.6s ease-in-out infinite;- mix-blend-mode: screen;- pointer-events: none;- }- @keyframes forge-scan {- from {- background-position: 0 -40%;- }- to {- background-position: 0 140%;- }- }- .gen-preview .shimmer {- position: absolute;- inset: 0;- background: linear-gradient(- 100deg,- transparent 20%,- rgba(255, 255, 255, 0.06) 50%,- transparent 80%- );- background-size: 200% 100%;- animation: shimmer 1.4s linear infinite;- }- @keyframes shimmer {- to {- background-position: -200% 0;- }- }- .gen-steps {- display: flex;- flex-direction: column;- justify-content: center;- gap: var(--space-sm);- }- .step {- display: flex;- align-items: center;- gap: 0.7rem;- color: var(--ink-dim);- font-size: var(--text-sm);- }- .step .dot {- width: 14px;- height: 14px;- border-radius: 50%;- border: 2px solid var(--stroke-strong);- flex: none;- }- .step[data-state='active'] {- color: var(--ink);- }- .step[data-state='active'] .dot {- border-color: var(--accent);- border-top-color: transparent;- animation: spin 0.8s linear infinite;- }- .step[data-state='done'] {- color: var(--ink);- }- .step[data-state='done'] .dot {- background: var(--success);- border-color: var(--success);- }- @keyframes spin {- to {- transform: rotate(360deg);- }- }- .gen-meta {- font-family: var(--font-mono);- font-size: var(--text-xs);- color: var(--ink-dim);- margin-top: var(--space-xs);- }- .gen-meta strong {- color: var(--ink);- font-weight: 600;- }-- /* Honest elapsed-vs-typical meter. The fill maps real elapsed time- against the engine's real catalog ETA on an asymptotic curve that- never reaches 100% on its own — only a real finished GLB snaps it to- full. Past the typical time it holds near the cap and recolours to- amber ("longer than usual"), so the bar is informative, never faked. */- .gen-progress {- position: relative;- height: 5px;- margin-top: var(--space-sm);- border-radius: 999px;- background: var(--surface-1);- border: 1px solid var(--stroke);- overflow: hidden;- }- .gen-progress-fill {- position: absolute;- inset: 0;- width: 0%;- border-radius: inherit;- background: linear-gradient(- 90deg,- color-mix(in srgb, var(--accent) 70%, transparent),- var(--accent)- );- transition: width 0.9s cubic-bezier(0.33, 1, 0.68, 1), background 0.4s ease;- }- .gen-progress-fill::after {- content: '';- position: absolute;- inset: 0;- background: linear-gradient(- 100deg,- transparent 30%,- rgba(255, 255, 255, 0.28) 50%,- transparent 70%- );- background-size: 220% 100%;- animation: gen-sheen 1.6s linear infinite;- }- .gen-progress[data-over='true'] .gen-progress-fill {- background: linear-gradient(- 90deg,- color-mix(in srgb, var(--warning, #e0a93e) 70%, transparent),- var(--warning, #e0a93e)- );- }- .gen-progress[data-done='true'] .gen-progress-fill {- background: linear-gradient(- 90deg,- color-mix(in srgb, var(--success) 70%, transparent),- var(--success)- );- }- .gen-progress[data-indeterminate='true'] .gen-progress-fill {- width: 38% !important;- animation: gen-indeterminate 1.5s ease-in-out infinite;- }- @keyframes gen-sheen {- to {- background-position: -220% 0;- }- }- @keyframes gen-indeterminate {- 0% {- transform: translateX(-120%);- }- 100% {- transform: translateX(330%);- }- }-- /* Result */- .viewer-shell {- position: relative;- }- .result model-viewer {- width: 100%;- height: min(62vh, 600px);- background: radial-gradient(120% 120% at 50% 0%, #1a1612 0%, #0b0a09 70%);- --poster-color: transparent;- transition: opacity 0.45s ease;- }- /* Materialize reveal — the WebGL overlay src/forge-reveal.js plays the- dissolve in, then crossfades away to the standing viewer beneath. */- .forge-reveal-overlay {- position: absolute;- inset: 0;- z-index: 2;- pointer-events: none;- transition: opacity 0.42s ease;- }- .forge-reveal-overlay canvas {- display: block;- width: 100%;- height: 100%;- }- .forge-reveal-overlay.is-fading {- opacity: 0;- }-- /* Cinema mode — distraction-free fullscreen turntable (F / Esc). */- body.forge-cinema {- overflow: hidden;- }- .result.is-cinema {- position: fixed;- inset: 0;- z-index: 90;- border: none;- border-radius: 0;- display: flex;- flex-direction: column;- background: radial-gradient(120% 90% at 50% 10%, #181a1f 0%, #0a0b0d 60%, #060708 100%);- }- .result.is-cinema > :not(.viewer-shell):not(.result-bar) {- display: none;- }- .result.is-cinema .viewer-shell {- flex: 1;- min-height: 0;- display: flex;- }- .result.is-cinema model-viewer {- flex: 1;- height: 100%;- background: transparent;- }- .result.is-cinema .result-bar {- position: absolute;- left: 0;- right: 0;- bottom: 0;- border-top: none;- background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));- opacity: 0;- transition: opacity 0.3s ease;- }- .result.is-cinema .result-bar:hover,- .result.is-cinema .result-bar:focus-within {- opacity: 1;- }- .result.is-cinema::after {- content: 'F or Esc to exit · drag to orbit';- position: absolute;- top: 14px;- right: 16px;- font-family: var(--font-mono);- font-size: 12px;- color: rgba(255, 255, 255, 0.55);- pointer-events: none;- animation: cinema-hint 4.5s ease forwards;- }- @keyframes cinema-hint {- 0%,- 70% {- opacity: 1;- }- 100% {- opacity: 0;- }- }- .result-bar {- display: flex;- align-items: center;- justify-content: space-between;- gap: var(--space-sm);- padding: var(--space-sm) var(--space-md);- border-top: 1px solid var(--stroke);- flex-wrap: wrap;- }- .result-bar .label {- font-size: var(--text-sm);- color: var(--ink-dim);- min-width: 0;- overflow: hidden;- text-overflow: ellipsis;- white-space: nowrap;- }- .result-bar .actions {- display: flex;- gap: var(--space-xs);- flex: none;- flex-wrap: wrap;- }-- /* Keep / discard verdict (the flywheel signal) */- .verdict {- display: inline-flex;- gap: 2px;- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: var(--radius-md);- padding: 2px;- }- .verdict button {- display: inline-flex;- align-items: center;- gap: 0.35rem;- background: transparent;- border: none;- color: var(--ink-dim);- font-size: var(--text-sm);- padding: 0.34rem 0.6rem;- border-radius: var(--radius-sm);- cursor: pointer;- transition:- background 0.15s,- color 0.15s;- }- .verdict button svg {- width: 14px;- height: 14px;- }- .verdict button:hover {- color: var(--ink);- }- .verdict button:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .verdict button[aria-pressed='true'][data-outcome='accepted'] {- background: color-mix(in srgb, var(--success) 22%, transparent);- color: var(--success);- }- .verdict button[aria-pressed='true'][data-outcome='rejected'] {- background: color-mix(in srgb, var(--danger) 20%, transparent);- color: var(--danger);- }-- /* Model category picker in result bar */- .forge-category-picker {- display: flex;- align-items: center;- gap: 4px;- flex-wrap: wrap;- }- .forge-cat-label {- font-size: 11px;- color: var(--ink-dim);- font-weight: 500;- margin-right: 2px;- white-space: nowrap;- }- .forge-cat-btn {- padding: 3px 9px;- background: transparent;- border: 1px solid var(--stroke);- border-radius: var(--radius-pill);- color: var(--ink-dim);- font-size: 11px;- font-weight: 500;- cursor: pointer;- transition: background 0.12s, color 0.12s, border-color 0.12s;- }- .forge-cat-btn:hover {- background: var(--surface-2);- color: var(--ink);- }- .forge-cat-btn.active {- background: rgba(99, 102, 241, 0.18);- border-color: rgba(99, 102, 241, 0.5);- color: #a5b4fc;- }- .forge-cat-btn[data-cat='accessory'].active { background: rgba(236,72,153,0.15); border-color: rgba(236,72,153,0.4); color: #f9a8d4; }- .forge-cat-btn[data-cat='item'].active { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.4); color: #fcd34d; }- .forge-cat-btn[data-cat='scene'].active { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4); color: #6ee7b7; }- .forge-cat-btn[data-cat='creature'].active { background: rgba(251,146,60,0.15); border-color: rgba(251,146,60,0.4); color: #fdba74; }- .forge-cat-btn[data-cat='vehicle'].active { background: rgba(56,189,248,0.15); border-color: rgba(56,189,248,0.4); color: #7dd3fc; }- /* Showcase category badge */- .showcase-cat-badge {- font-size: 10px;- font-weight: 600;- padding: 1px 7px;- border-radius: var(--radius-pill, 999px);- background: rgba(255,255,255,0.08);- color: #a1a1aa;- letter-spacing: 0.02em;- }- .showcase-cat-badge.model-cat-avatar { background: rgba(99,102,241,0.18); color: #a5b4fc; }- .showcase-cat-badge.model-cat-accessory { background: rgba(236,72,153,0.18); color: #f9a8d4; }- .showcase-cat-badge.model-cat-item { background: rgba(245,158,11,0.18); color: #fcd34d; }- .showcase-cat-badge.model-cat-scene { background: rgba(16,185,129,0.18); color: #6ee7b7; }- .showcase-cat-badge.model-cat-creature { background: rgba(251,146,60,0.18); color: #fdba74; }- .showcase-cat-badge.model-cat-vehicle { background: rgba(56,189,248,0.18); color: #7dd3fc; }-- /* Optimize / retopology panel (markup injected by forge-optimize.js) */- .optimize {- border-top: 1px solid var(--stroke);- }- .optimize-toggle {- width: 100%;- display: flex;- align-items: center;- justify-content: space-between;- gap: var(--space-sm);- background: transparent;- border: none;- color: var(--ink);- font-family: var(--font-display);- font-weight: 600;- font-size: var(--text-sm);- padding: var(--space-sm) var(--space-md);- cursor: pointer;- }- .optimize-toggle:hover {- background: var(--surface-2);- }- .optimize-toggle:focus-visible {- outline: 2px solid var(--accent);- outline-offset: -2px;- }- .optimize-toggle .chev {- transition: transform 0.18s ease;- color: var(--ink-dim);- }- .optimize[data-open='true'] .optimize-toggle .chev {- transform: rotate(180deg);- }- .optimize-body {- display: none;- flex-direction: column;- gap: var(--space-md);- padding: 0 var(--space-md) var(--space-md);- }- .optimize[data-open='true'] .optimize-body {- display: flex;- }- .opt-field {- display: flex;- flex-direction: column;- gap: 0.4rem;- }- .opt-field > span {- font-size: var(--text-xs);- color: var(--ink-dim);- font-family: var(--font-mono);- text-transform: uppercase;- letter-spacing: 0.04em;- }- .seg {- display: inline-flex;- flex-wrap: wrap;- gap: 2px;- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: var(--radius-md);- padding: 2px;- }- .seg button {- flex: 1 1 auto;- background: transparent;- border: none;- color: var(--ink-dim);- font-family: var(--font-mono);- font-size: var(--text-xs);- padding: 0.4rem 0.7rem;- border-radius: var(--radius-sm);- cursor: pointer;- transition:- background 0.15s,- color 0.15s;- }- .seg button:hover {- color: var(--ink);- }- .seg button[aria-pressed='true'] {- background: var(--surface-3);- color: var(--ink);- }- .seg button:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .opt-mode-hint {- font-size: var(--text-xs);- color: var(--ink-dim);- line-height: 1.4;- min-height: 1.4em;- }- .opt-row {- display: flex;- gap: var(--space-md);- flex-wrap: wrap;- }- .opt-row .opt-field {- flex: 1 1 140px;- }- .opt-select {- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: var(--radius-md);- color: var(--ink);- font-family: var(--font-mono);- font-size: var(--text-xs);- padding: 0.45rem 0.6rem;- }- .opt-select:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 1px;- }- .opt-actions {- display: flex;- align-items: center;- gap: var(--space-md);- flex-wrap: wrap;- }- .opt-status {- font-size: var(--text-xs);- font-family: var(--font-mono);- color: var(--ink-dim);- }- .opt-status[data-kind='error'] {- color: var(--danger);- }- .opt-status[data-kind='done'] {- color: var(--success);- }- .opt-stats {- display: flex;- gap: var(--space-md);- flex-wrap: wrap;- font-family: var(--font-mono);- font-size: var(--text-xs);- color: var(--ink-dim);- }- .opt-stats strong {- color: var(--ink);- font-weight: 600;- }-- /* Stylize — one-click geometric filters */- .stylize {- border-top: 1px solid var(--stroke);- padding: var(--space-md);- }- .stylize-head h3 {- font-family: var(--font-display);- font-size: var(--text-base);- margin: 0 0 0.15rem;- }- .stylize-sub {- color: var(--ink-dim);- font-size: var(--text-sm);- line-height: var(--leading-normal);- margin: 0 0 var(--space-md);- max-width: 60ch;- }- .stylize-gallery {- display: grid;- grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));- gap: var(--space-sm);- }- .stylize-card {- display: flex;- flex-direction: column;- align-items: flex-start;- gap: 0.35rem;- text-align: left;- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: var(--radius-md);- padding: var(--space-sm);- cursor: pointer;- color: var(--ink);- font: inherit;- transition:- border-color 0.15s,- transform 0.12s,- box-shadow 0.15s,- background 0.15s;- }- .stylize-card:hover {- border-color: var(--stroke-strong);- transform: translateY(-2px);- box-shadow: 0 16px 36px -26px rgba(0, 0, 0, 0.9);- }- .stylize-card:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .stylize-card:active {- transform: translateY(0);- }- .stylize-card[aria-pressed='true'] {- border-color: var(--accent);- background: var(--accent-soft);- }- .stylize-card[disabled] {- opacity: 0.5;- cursor: not-allowed;- transform: none;- box-shadow: none;- }- .stylize-thumb {- width: 100%;- aspect-ratio: 16 / 10;- display: grid;- place-items: center;- border-radius: var(--radius-sm);- background: radial-gradient(120% 120% at 50% 0%, #161616 0%, #0c0c0c 75%);- color: var(--ink-dim);- transition:- color 0.15s,- transform 0.2s ease;- }- .stylize-thumb svg {- width: 58%;- height: 58%;- }- .stylize-card:hover .stylize-thumb,- .stylize-card[aria-pressed='true'] .stylize-thumb {- color: var(--accent);- }- .stylize-card:hover .stylize-thumb svg {- transform: scale(1.08) rotate(-4deg);- }- .stylize-name {- font-family: var(--font-display);- font-weight: 600;- font-size: var(--text-sm);- }- .stylize-blurb {- color: var(--ink-dim);- font-size: var(--text-xs);- line-height: var(--leading-snug);- }- .stylize-controls {- display: flex;- align-items: center;- justify-content: space-between;- gap: var(--space-md);- margin-top: var(--space-md);- flex-wrap: wrap;- }- .stylize-slider {- display: inline-flex;- align-items: center;- gap: var(--space-sm);- font-family: var(--font-mono);- font-size: var(--text-xs);- color: var(--ink-dim);- }- .stylize-slider input[type='range'] {- accent-color: var(--accent);- width: 160px;- cursor: pointer;- }- .stylize-slider input[type='range']:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 3px;- }- .stylize-slider output {- color: var(--ink);- min-width: 2.5ch;- text-align: right;- }- .stylize-actions {- display: inline-flex;- align-items: center;- gap: var(--space-xs);- flex-wrap: wrap;- }- .stylize-status {- margin-top: var(--space-sm);- font-family: var(--font-mono);- font-size: var(--text-xs);- color: var(--ink-dim);- min-height: 1.2em;- }- .stylize-status[data-kind='busy'] {- color: var(--accent);- }- .stylize-status[data-kind='error'] {- color: var(--danger);- }- .stylize-status[data-kind='done'] {- color: var(--success);- }- .stylize[data-busy='true'] .stylize-thumb svg {- animation: spin 1.1s linear infinite;- }-- /* ── Galleries: your creations + community showcase ──────────────── */- .creations {- margin-top: var(--space-2xl);- }- .creations-head {- display: flex;- align-items: baseline;- justify-content: space-between;- gap: var(--space-sm);- margin-bottom: var(--space-md);- }- .creations-head h2 {- font-family: var(--font-display);- font-size: var(--text-lg);- margin: 0;- }- .creations-head .count {- font-family: var(--font-mono);- font-size: var(--text-xs);- color: var(--ink-dim);- }- .creations-grid {- display: grid;- grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));- gap: var(--space-sm);- }- .creation {- position: relative;- display: flex;- flex-direction: column;- text-align: left;- background: var(--surface-1);- border: 1px solid var(--stroke);- border-radius: var(--radius-md);- overflow: hidden;- cursor: pointer;- padding: 0;- color: inherit;- font: inherit;- transition:- border-color 0.15s,- transform 0.12s,- box-shadow 0.15s;- }- .creation:hover {- border-color: var(--accent);- transform: translateY(-2px);- box-shadow: 0 16px 36px -24px rgba(0, 0, 0, 0.9);- }- .creation:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .creation .thumb {- aspect-ratio: 1 / 1;- width: 100%;- object-fit: cover;- background: var(--surface-2);- display: block;- }- .creation .thumb.placeholder {- display: grid;- place-items: center;- color: var(--ink-dim);- font-size: 1.6rem;- }- .creation .meta {- padding: 0.5rem 0.6rem;- font-size: var(--text-xs);- color: var(--ink-dim);- line-height: var(--leading-snug);- display: -webkit-box;- -webkit-line-clamp: 2;- -webkit-box-orient: vertical;- overflow: hidden;- }- .creation .badge {- position: absolute;- top: 6px;- right: 6px;- font-size: 0.65rem;- font-family: var(--font-mono);- padding: 1px 6px;- border-radius: 999px;- background: rgba(0, 0, 0, 0.55);- backdrop-filter: blur(4px);- }- .creation .badge[data-outcome='accepted'] {- color: var(--success);- }- .creation .badge[data-outcome='rejected'] {- color: var(--danger);- }-- .showcase-head-right {- display: inline-flex;- align-items: center;- gap: var(--space-xs);- }- .showcase-refresh {- display: inline-grid;- place-items: center;- width: 26px;- height: 26px;- background: transparent;- border: 1px solid var(--stroke);- border-radius: 50%;- color: var(--ink-dim);- cursor: pointer;- transition:- color 0.15s,- border-color 0.15s,- transform 0.3s ease;- }- .showcase-refresh:hover {- color: var(--ink);- border-color: var(--stroke-strong);- transform: rotate(90deg);- }- .showcase-refresh:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .showcase-sub {- margin: calc(-1 * var(--space-sm)) 0 var(--space-md);- color: var(--ink-dim);- font-size: var(--text-sm);- }- .showcase-sub strong {- color: var(--ink);- }- .showcase-foot {- display: flex;- align-items: center;- justify-content: space-between;- gap: var(--space-xs);- padding: 0 0.6rem 0.5rem;- margin-top: auto;- }- .showcase-when {- font-family: var(--font-mono);- font-size: 0.65rem;- color: var(--ink-dim);- opacity: 0.8;- }- .showcase-remix {- font-family: var(--font-mono);- font-size: 0.65rem;- letter-spacing: 0.04em;- padding: 2px 9px;- border-radius: 999px;- border: 1px solid var(--stroke);- background: transparent;- color: var(--ink-dim);- cursor: pointer;- transition:- color 0.15s,- border-color 0.15s,- background 0.15s;- }- .showcase-card:hover .showcase-remix,- .showcase-remix:hover {- color: var(--ink);- border-color: var(--accent);- }- .showcase-remix:hover {- background: var(--accent-soft);- }- .showcase-remix:focus-visible {- outline: 2px solid var(--accent);- outline-offset: 2px;- }- .showcase-preview {- position: absolute;- top: 0;- left: 0;- right: 0;- aspect-ratio: 1 / 1;- width: 100%;- background: var(--surface-2);- opacity: 0;- pointer-events: none;- transition: opacity 0.25s ease;- }- .showcase-card.is-previewing .showcase-preview {- opacity: 1;- }-- /* ── Error / unconfigured notices ────────────────────────────────── */- .notice {- padding: var(--space-2xl) var(--space-lg);- text-align: center;- color: var(--ink-dim);- }- .notice h3 {- color: var(--ink);- font-family: var(--font-display);- margin: 0 0 var(--space-xs);- }- .notice p {- max-width: 48ch;- margin: 0 auto;- line-height: var(--leading-normal);- }- .notice .glyph {- font-size: 2.4rem;- opacity: 0.5;- display: block;- margin-bottom: var(--space-sm);- }- .notice.error h3 {- color: var(--danger);- }- .notice .actions {- margin-top: var(--space-md);- display: inline-flex;- gap: var(--space-xs);- }- .hint-foot {- text-align: center;- color: var(--ink-dim);- font-size: var(--text-xs);- margin-top: var(--space-lg);- line-height: var(--leading-normal);- }- .hint-foot a {- color: var(--ink);- }-- /* ── Reduced motion ──────────────────────────────────────────────── */- @media (prefers-reduced-motion: reduce) {- .ptool.is-rolling svg,- .gen-preview img,- .gen-progress-fill::after {- animation: none;- }- .gen-preview.is-reconstructing::after {- display: none;- }- .chips-more.is-rolling {- transform: none;- }- .gen-progress[data-indeterminate='true'] .gen-progress-fill {- animation: none;- width: 100% !important;- opacity: 0.5;- }- .gen-progress-fill {- transition: none;- }- .showcase-refresh,- .showcase-remix,- .showcase-preview {- transition: none;- }- .showcase-refresh:hover {- transform: none;- }- }- </style>- </head>- <body class="forge-v2">- <div id="nav-container"></div>-- <div class="preview-banner">- Design preview — fully functional, nothing final. Compare with the live- <a href="/forge">/forge</a>.- </div>-- <main class="forge-main">- <header class="forge-head">- <span class="forge-eyebrow">Words & photos → 3D · live</span>- <h1>Forge a 3D model from words or photos</h1>- <p>- Describe an object, or drop in up to four photos of it. Forge builds a- textured mesh you can orbit, view in AR, and download as GLB.- </p>- </header>-- <div class="forge-workspace">- <div class="forge-rail">- <div class="mode-switch-wrap">- <div class="mode-switch" role="tablist" aria-label="Generation mode" id="mode-switch">- <button type="button" role="tab" data-mode="text" aria-selected="true">- Describe it- </button>- <button type="button" role="tab" data-mode="image" aria-selected="false">- From photos- </button>- <!-- Hidden until the catalog reports a live sketch engine (TripoSG- self-host) — no dead tab on deployments without the worker. -->- <button type="button" role="tab" data-mode="sketch" aria-selected="false" hidden>- From a sketch- </button>- </div>- </div>-- <form class="composer" id="composer" autocomplete="off">- <!-- Text → 3D -->- <div id="text-pane">- <label for="prompt" class="is-hidden">Describe the object to generate</label>- <textarea- id="prompt"- name="prompt"- maxlength="1000"- placeholder="a worn leather armchair, studio lighting, plain background"- aria-describedby="prompt-coach"- ></textarea>- <div class="prompt-tools" id="prompt-tools">- <button type="button" class="ptool" id="surprise" aria-label="Fill the box with a random vivid prompt">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <rect x="3" y="3" width="18" height="18" rx="3" />- <circle cx="8.5" cy="8.5" r="1.4" fill="currentColor" stroke="none" />- <circle cx="15.5" cy="15.5" r="1.4" fill="currentColor" stroke="none" />- <circle cx="15.5" cy="8.5" r="1.4" fill="currentColor" stroke="none" />- <circle cx="8.5" cy="15.5" r="1.4" fill="currentColor" stroke="none" />- </svg>- Surprise me- </button>- <span class="prompt-coach" id="prompt-coach" data-grade="tip" aria-live="polite"></span>- <span class="prompt-count" id="prompt-count">0 / 1000</span>- </div>- </div>-- <!-- Image / multi-view → 3D -->- <div id="image-pane" class="image-pane is-hidden">- <div- class="views-grid"- id="views-grid"- aria-label="Reference views — add up to four photos of the same object"- ></div>- <input- type="file"- id="view-file-input"- accept="image/png,image/jpeg,image/webp"- multiple- hidden- />- <label for="image-prompt" class="is-hidden"- >Optional guidance for reconstruction</label- >- <textarea- id="image-prompt"- class="image-prompt"- maxlength="1000"- placeholder="Optional guidance — e.g. “matte plastic, neutral pose, no background”"- ></textarea>- <p class="views-hint">- Add 1–4 views of the <strong>same</strong> object (front · back · left ·- right). Drag to drop, click to browse, paste from the clipboard- (<kbd class="gen-kbd">⌘V</kbd> / <kbd class="gen-kbd">Ctrl+V</kbd>), drag a thumbnail to reorder.- PNG/JPG/WebP, up to 8 MB each.- </p>- </div>-- <!-- Sketch → 3D (TripoSG-scribble) -->- <div id="sketch-pane" class="image-pane is-hidden">- <div- class="views-grid sketch-grid"- id="sketch-grid"- aria-label="Your sketch — add one drawing"- ></div>- <input- type="file"- id="sketch-file-input"- accept="image/png,image/jpeg,image/webp"- hidden- />- <label for="sketch-prompt" class="is-hidden"- >What does the sketch depict? (required)</label- >- <textarea- id="sketch-prompt"- class="image-prompt"- maxlength="1000"- placeholder="What is it? — e.g. “a cartoon rocket with two tail fins” (required)"- ></textarea>- <p class="views-hint">- Drop one drawing — dark strokes on a light background work best — and say- what it depicts. PNG/JPG/WebP, up to 8 MB. The result is untextured- geometry: use <strong>Stylize</strong> or <strong>Retexture</strong> on it- after.- </p>- </div>-- <!-- Quality tier + generation engine + BYOK key -->- <div class="forge-quality" id="forge-quality">- <div class="fq-row">- <span class="fq-label" id="tier-label">Quality</span>- <div class="aspect" role="group" aria-labelledby="tier-label" id="tier">- <button type="button" data-tier="draft" aria-pressed="false">- Draft- </button>- <button type="button" data-tier="standard" aria-pressed="true">- Standard- </button>- <button type="button" data-tier="high" aria-pressed="false">- High- </button>- </div>- </div>- <div class="fq-row">- <span class="fq-label" id="engine-label">Engine</span>- <div- class="aspect"- role="group"- aria-labelledby="engine-label"- id="engine"- ></div>- </div>- <div class="fq-row">- <span class="fq-label" id="aspect-label">Aspect</span>- <div- class="aspect"- role="group"- aria-labelledby="aspect-label"- id="aspect"- >- <button type="button" data-aspect="1:1" aria-pressed="true">1:1</button>- <button type="button" data-aspect="4:3" aria-pressed="false">4:3</button>- <button type="button" data-aspect="3:4" aria-pressed="false">3:4</button>- <button type="button" data-aspect="16:9" aria-pressed="false">16:9</button>- </div>- </div>- <div class="byok-row is-hidden" id="byok-row">- <label class="fq-label" for="provider-key" id="byok-label">API key</label>- <input- class="byok-input"- id="provider-key"- type="password"- autocomplete="off"- autocapitalize="off"- spellcheck="false"- placeholder="Your provider API key (kept in this browser)"- aria-describedby="byok-hint"- />- <span class="byok-hint" id="byok-hint"></span>- </div>- <p class="fq-estimate" id="estimate" aria-live="polite"></p>- </div>-- <div class="composer-row">- <button class="btn" id="generate" type="submit">- <span id="generate-label">Generate</span>- <kbd class="gen-kbd" aria-hidden="true">⌘↵</kbd>- </button>- </div>- </form>-- <div class="chips" id="examples" aria-label="Example prompts">- <button class="chip" type="button">a low-poly red fox, sitting</button>- <button class="chip" type="button">a sci-fi combat helmet, brushed metal</button>- <button class="chip" type="button">a potted monstera plant</button>- <button class="chip" type="button">a vintage film camera</button>- <button class="chip" type="button">a glazed ceramic teapot</button>- <button class="chips-more" type="button" id="chips-more" aria-label="Swap in a fresh set of example prompts">↻ More ideas</button>- </div>- </div>-- <section class="stage" id="stage" aria-live="polite">- <!-- Idle — a live model instead of an empty void. Fed by the real- community feed below; falls back to a labeled first-party- sample GLB when the feed is empty or unavailable. -->- <div class="panel" id="state-empty">- <div class="idle-viewer-wrap">- <model-viewer- id="idle-viewer"- camera-controls- auto-rotate- auto-rotate-delay="0"- rotation-per-second="14deg"- shadow-intensity="1"- shadow-softness="0.9"- exposure="1.05"- tone-mapping="aces"- interaction-prompt="none"- alt="A recently forged 3D model"- ></model-viewer>- <span class="idle-tag" id="idle-tag">Loading…</span>- </div>- <div class="idle-bar">- <div class="idle-caption">- <span class="idle-kicker" id="idle-kicker">Fresh from the Forge</span>- <span class="idle-prompt" id="idle-prompt">Finding a recent creation…</span>- </div>- <button class="btn btn-ghost" type="button" id="idle-remix" hidden>- Remix this prompt- </button>- <p class="idle-hint">- Your model lands right here. Type a description on the left — or tap an- example — and hit <strong>Generate</strong>. Usually 30–90 seconds.- </p>- </div>- </div>-- <!-- Generating -->- <div class="panel gen is-hidden" id="state-generating">- <div class="gen-preview" id="gen-preview">- <div class="shimmer" aria-hidden="true"></div>- </div>- <div class="gen-steps">- <div class="step" id="step-image" data-state="active">- <span class="dot" aria-hidden="true"></span>- <span>Painting reference image</span>- </div>- <div class="step" id="step-mesh" data-state="pending">- <span class="dot" aria-hidden="true"></span>- <span>Reconstructing textured mesh</span>- </div>- <div class="step" id="step-finish" data-state="pending">- <span class="dot" aria-hidden="true"></span>- <span>Finalizing GLB</span>- </div>- <div- class="gen-progress"- id="gen-progress"- role="progressbar"- aria-label="Generation progress"- aria-valuemin="0"- aria-valuemax="100"- aria-valuenow="0"- >- <div class="gen-progress-fill" id="gen-progress-fill"></div>- </div>- <div class="gen-meta" id="gen-meta">Elapsed 0s</div>- <div style="margin-top: var(--space-sm)">- <button class="btn btn-ghost" type="button" id="cancel">Cancel</button>- </div>- </div>- </div>-- <!-- Result -->- <div class="panel result is-hidden" id="state-result">- <div class="viewer-shell" id="viewer-shell">- <model-viewer- id="viewer"- camera-controls- auto-rotate- auto-rotate-delay="0"- rotation-per-second="18deg"- shadow-intensity="1.2"- shadow-softness="0.9"- exposure="1.1"- tone-mapping="aces"- ar- ar-modes="webxr scene-viewer quick-look"- interaction-prompt="none"- alt="Generated 3D model"- ></model-viewer>- </div>- <div class="result-bar">- <span class="label" id="result-label"></span>- <span- class="views-badge is-hidden"- id="result-views"- title="Reference views fused"- ></span>- <div class="actions">- <button- class="btn btn-ghost"- type="button"- id="cinema"- aria-pressed="false"- title="Cinema mode — fullscreen turntable for recording (F)"- >- <svg- width="15"- height="15"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- aria-hidden="true"- >- <path d="M8 3H5a2 2 0 0 0-2 2v3" />- <path d="M16 3h3a2 2 0 0 1 2 2v3" />- <path d="M8 21H5a2 2 0 0 1-2-2v-3" />- <path d="M16 21h3a2 2 0 0 0 2-2v-3" />- </svg>- Cinema- </button>- <div- class="verdict"- id="verdict"- role="group"- aria-label="Rate this model"- >- <button- type="button"- data-outcome="accepted"- aria-pressed="false"- title="Keep — good result"- >- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <path d="M7 10v12" />- <path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z" />- </svg>- Keep- </button>- <button- type="button"- data-outcome="rejected"- aria-pressed="false"- title="Discard — bad result"- >- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <path d="M17 14V2" />- <path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z" />- </svg>- Discard- </button>- </div>- <div class="forge-category-picker" id="forge-category-picker" role="group" aria-label="What kind of model is this?">- <span class="forge-cat-label">What is it?</span>- <button type="button" class="forge-cat-btn" data-cat="avatar" title="Full body character or agent">Avatar</button>- <button type="button" class="forge-cat-btn" data-cat="accessory" title="Wearable item for an agent">Accessory</button>- <button type="button" class="forge-cat-btn" data-cat="item" title="Prop or holdable object">Item</button>- <button type="button" class="forge-cat-btn" data-cat="scene" title="Environment or world">Scene</button>- <button type="button" class="forge-cat-btn" data-cat="creature" title="Animal or companion">Creature</button>- <button type="button" class="forge-cat-btn" data-cat="vehicle" title="Vehicle or mount">Vehicle</button>- </div>- <button- class="btn btn-ghost"- type="button"- id="forge-share-btn"- aria-label="Share this creation"- >- <svg- width="15"- height="15"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- aria-hidden="true"- >- <circle cx="18" cy="5" r="3" />- <circle cx="6" cy="12" r="3" />- <circle cx="18" cy="19" r="3" />- <line x1="8.59" y1="13.51" x2="15.42" y2="17.49" />- <line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />- </svg>- Share- </button>- <a- class="btn btn-ghost"- id="forge-segment-btn"- title="Split this model into selectable parts"- >Split into parts</a- >- <a class="btn btn-ghost" id="download" download>Download GLB</a>- <a class="btn btn-ghost" id="open-in-composer" href="/compose" title="Open this model in the Scene Composer to attach it to an avatar or place it in a scene">Open in Composer</a>- <button class="btn" type="button" id="again">Make another</button>- </div>- </div>-- <!-- Optimize topology panel (triangle / quad / low-poly remesh) is- injected into this result panel by /src/forge-optimize.js. -->-- <!-- Stylize — one-click geometric filters on the current model -->- <div class="stylize" id="stylize-panel" data-busy="false" hidden>- <div class="stylize-head">- <h3>Stylize</h3>- <p class="stylize-sub">- One-click geometric filters. Restyle this model as voxels, bricks,- an open lattice, or low-poly — source color is carried over where- the style allows.- </p>- </div>- <div- class="stylize-gallery"- id="stylize-gallery"- role="group"- aria-label="Stylization filters"- ></div>- <div class="stylize-controls is-hidden" id="stylize-controls">- <div class="stylize-slider">- <label id="stylize-res-label" for="stylize-res">Resolution</label>- <input type="range" id="stylize-res" min="8" max="96" value="32" />- <output id="stylize-res-val" for="stylize-res">32</output>- </div>- <div class="stylize-actions">- <button class="btn btn-ghost" type="button" id="stylize-apply">- Re-apply- </button>- <a class="btn btn-ghost" id="stylize-download" download hidden- >Download stylized GLB</a- >- <button- class="btn btn-ghost"- type="button"- id="stylize-revert"- hidden- >- Revert to original- </button>- </div>- </div>- <div- class="stylize-status"- id="stylize-status"- role="status"- aria-live="polite"- ></div>- </div>- </div>-- <!-- Error -->- <div class="panel notice error is-hidden" id="state-error">- <span class="glyph" aria-hidden="true">⚠</span>- <h3>Generation failed</h3>- <p id="error-message">- Something went wrong. Try a simpler, single-subject prompt.- </p>- <div class="actions">- <button class="btn" type="button" id="retry">Try again</button>- <button class="btn btn-ghost is-hidden" type="button" id="refine-locally">Refine current model instead</button>- <button class="btn btn-ghost is-hidden" type="button" id="generate-anyway">Generate anyway</button>- </div>- </div>-- <!-- Unconfigured -->- <div class="panel notice is-hidden" id="state-unconfigured">- <span class="glyph" aria-hidden="true">◌</span>- <h3>Generator not configured</h3>- <p>- Text-to-3D needs a Replicate API token on this deployment. Once- <code>REPLICATE_API_TOKEN</code> is set, Forge runs the full flux → TRELLIS- pipeline with no further changes.- </p>- </div>- </section>- </div>-- <!-- Your creations — durable, reusable models tied to this browser -->- <section class="creations is-hidden" id="creations" aria-label="Your forged models">- <div class="creations-head">- <h2>Your creations</h2>- <span class="count" id="creations-count"></span>- </div>- <div class="creations-grid" id="creations-grid"></div>- </section>-- <!-- Fresh from the Forge — newest community models (src/forge-showcase.js).- Hidden until the public feed returns real rows, so deployments without- a durable store never show a hollow strip. -->- <section- class="creations showcase is-hidden"- id="showcase"- aria-label="Fresh from the Forge — recent community models"- >- <div class="creations-head">- <h2>Fresh from the Forge</h2>- <div class="showcase-head-right">- <span class="count" id="showcase-count"></span>- <button- type="button"- class="showcase-refresh"- id="showcase-refresh"- title="Refresh the community feed"- aria-label="Refresh the community feed"- >- <svg- width="13"- height="13"- viewBox="0 0 24 24"- fill="none"- stroke="currentColor"- stroke-width="2"- stroke-linecap="round"- stroke-linejoin="round"- aria-hidden="true"- >- <path d="M21 12a9 9 0 1 1-2.64-6.36" />- <path d="M21 3v6h-6" />- </svg>- </button>- </div>- </div>- <p class="showcase-sub">- What other people just forged. Open one in the viewer, or- <strong>Remix</strong> its prompt and make it yours.- </p>- <div class="creations-grid" id="showcase-grid"></div>- </section>-- <p class="hint-foot">- Powered by flux-schnell + Microsoft TRELLIS on Replicate, with multi-view- conditioning when you supply more than one photo. Best results: one clearly- described subject, or clean evenly-lit views from distinct angles. The same pipeline- is available to agents over MCP at <a href="/docs">/api/mcp-3d</a>.- </p>- </main>-- <script src="/nav.js" defer></script>- <script type="module" src="/src/forge.js"></script>- <script type="module" src="/src/forge-prompt-studio.js"></script>- <script type="module" src="/src/forge-enhance.js"></script>- <script type="module" src="/src/forge-refine.js"></script>- <script type="module" src="/src/forge-stylize.js"></script>- <script type="module" src="/src/forge-optimize.js"></script>- <script type="module" src="/src/forge-showcase.js"></script>- <script type="module" src="/src/forge-dropzone.js"></script>-- <!-- Idle-stage live teaser: newest community forge in the empty state, so- the first thing a visitor sees is real output. Falls back to a labeled- first-party sample when the feed is empty or the store is absent. -->- <script type="module">- const viewer = document.getElementById('idle-viewer');- const tag = document.getElementById('idle-tag');- const kicker = document.getElementById('idle-kicker');- const promptEl = document.getElementById('idle-prompt');- const remixBtn = document.getElementById('idle-remix');-- function timeAgo(iso) {- const t = Date.parse(iso);- if (!Number.isFinite(t)) return '';- const s = Math.max(0, (Date.now() - t) / 1000);- if (s < 60) return 'just now';- if (s < 3600) return `${Math.floor(s / 60)}m ago`;- if (s < 86400) return `${Math.floor(s / 3600)}h ago`;- return `${Math.floor(s / 86400)}d ago`;- }-- function showSample() {- viewer.setAttribute('src', '/avatars/fox.glb');- tag.textContent = 'Sample model';- kicker.textContent = 'Sample — drag to orbit';- promptEl.textContent = 'Your forged models replace this the moment one finishes.';- remixBtn.hidden = true;- }-- function remix(prompt) {- document.querySelector('#mode-switch [data-mode="text"]')?.click();- const box = document.getElementById('prompt');- if (!box) return;- box.value = prompt;- box.dispatchEvent(new Event('input', { bubbles: true }));- box.focus();- box.setSelectionRange(box.value.length, box.value.length);- }-- try {- const res = await fetch('/api/forge-gallery?scope=community&limit=8');- const data = await res.json();- const pick = (Array.isArray(data?.creations) ? data.creations : []).find(- (c) => c.glb_url,- );- if (data?.enabled && pick) {- viewer.setAttribute('src', pick.glb_url);- tag.textContent = 'Live · community';- kicker.textContent = `Fresh from the Forge · ${timeAgo(pick.created_at)}`;- promptEl.textContent = pick.prompt || 'Untitled';- promptEl.title = pick.prompt || '';- if (pick.prompt) {- remixBtn.hidden = false;- remixBtn.addEventListener('click', () => remix(pick.prompt));- }- } else {- showSample();- }- } catch {- showSample();- }- </script>- <div id="footer-container"></div>- <script src="/footer.js"></script>- </body>-</html>diff --git a/pages/home.html b/pages/home.htmlindex e2fe09620..a756ee23e 100644--- a/pages/home.html+++ b/pages/home.html@@ -52,8 +52,8 @@--hairline-strong: #2a2a2a;--text: #f6f6f6;--text-2: #a8a8a8;- --text-3: #6a6a6a;- --text-4: #4a4a4a;+ --text-3: #8a8a8a; /* AA: ≥4.5:1 on dark surfaces for secondary text */+ --text-4: #6e6e6e; /* AA: ≥3:1 (large/decorative only) */--accent: #ffffff;--accent-2: #ffffff;--green: #e8e8e8;@@ -184,7 +184,11 @@transition: color 0.15s, border-color 0.15s;}.hero-reassure a:hover, .hero-reassure a:focus-visible {- color: var(--text); border-bottom-color: var(--text-3); outline: none;+ color: var(--text); border-bottom-color: var(--text-3);+ }+ .hero-reassure a:focus-visible {+ outline: var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent));+ outline-offset: var(--focus-ring-offset,2px); border-radius: 2px;}.metrics {@@ -226,7 +230,7 @@position: absolute; bottom: 24px; right: 28px; z-index: 5;text-align: right; font-family: var(--font-mono); font-size: 10.5px;letter-spacing: 0.14em; text-transform: uppercase;- color: var(--text-4); line-height: 1.6;+ color: var(--text-3); line-height: 1.6;}.stage-meta span { display: block; }.stage-meta span:first-child { color: var(--text-3); }@@ -236,8 +240,101 @@transition: transform 0.35s cubic-bezier(.2,.7,.3,1);will-change: transform;}+ .hero-stage-fallback {+ position: absolute; inset: 0;+ display: flex; flex-direction: column;+ align-items: center; justify-content: center;+ gap: 12px; text-align: center; padding: 24px;+ }+ .hero-stage-fallback p {+ margin: 0; color: var(--text-3); font-size: 13.5px; max-width: 240px;+ }++ /* ── LIVE $THREE SIGNAL ──────────────────────────────────── */+ /* A real, self-refreshing market signal pulled from+ /api/three-token/stats. Sits directly under the hero so the+ first thing a holder sees is live proof the token is trading. */+ .three-signal {+ display: flex; align-items: center; gap: 0;+ border-top: 1px solid var(--hairline);+ background: var(--surface-0);+ color: var(--text-2); text-decoration: none;+ font-family: var(--font-mono);+ overflow-x: auto; scrollbar-width: none;+ scroll-snap-type: x proximity;+ }+ .three-signal::-webkit-scrollbar { display: none; }+ .three-signal-inner {+ display: flex; align-items: stretch;+ max-width: 1280px; margin: 0 auto; width: 100%;+ padding: 0 32px; min-width: max-content;+ }+ @media (max-width: 720px) { .three-signal-inner { padding: 0 20px; } }+ .ts-cell {+ display: flex; flex-direction: column; gap: 5px;+ padding: 16px 26px; position: relative;+ scroll-snap-align: start; white-space: nowrap;+ }+ .ts-cell + .ts-cell::before {+ content: ""; position: absolute; left: 0; top: 50%;+ transform: translateY(-50%); width: 1px; height: 26px;+ background: var(--hairline);+ }+ .ts-cell--brand { padding-left: 0; }+ .ts-k {+ font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase;+ color: var(--text-3); display: inline-flex; align-items: center; gap: 7px;+ }+ .ts-k .ts-live-dot {+ width: 6px; height: 6px; border-radius: 50%;+ background: var(--green); box-shadow: 0 0 6px var(--green);+ animation: pulse-green 2.4s ease-in-out infinite;+ }+ .ts-v {+ font-size: 16px; letter-spacing: -0.01em; color: var(--text);+ font-weight: 600; font-variant-numeric: tabular-nums;+ display: inline-flex; align-items: baseline; gap: 8px;+ }+ .ts-cell--brand .ts-v {+ font-family: var(--font-display); letter-spacing: 0.01em;+ }+ .ts-chg { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }+ .ts-chg--up { color: var(--success); }+ .ts-chg--down { color: var(--danger); }+ .ts-chg--flat { color: var(--text-3); }+ /* Loading skeleton: a shimmering bar where each value will land. */+ .three-signal[data-state="loading"] .ts-v { color: transparent; }+ .three-signal[data-state="loading"] .ts-v::after {+ content: ""; position: absolute; bottom: 16px;+ width: 64px; height: 15px; border-radius: 5px;+ background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);+ background-size: 400% 100%; animation: ts-shimmer 1.4s ease infinite;+ }+ .three-signal[data-state="loading"] .ts-cell--brand .ts-v::after { width: 88px; }+ @keyframes ts-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }+ .three-signal .ts-cta {+ margin-left: auto; align-self: center; padding-right: 0;+ display: inline-flex; align-items: center; gap: 8px;+ font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;+ color: var(--text-3); transition: color 0.15s;+ }+ .three-signal .ts-cta .ts-arrow { transition: transform 0.18s; }+ .three-signal:hover .ts-cta, .three-signal:focus-visible .ts-cta { color: var(--text); }+ .three-signal:hover .ts-cta .ts-arrow, .three-signal:focus-visible .ts-cta .ts-arrow { transform: translateX(4px); }+ .three-signal:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }+ /* Error fallback: collapse to a single quiet "view stats" affordance. */+ .three-signal[data-state="error"] .ts-cell:not(.ts-cell--brand):not(.ts-cell--cta) { display: none; }+ .three-signal[data-state="error"] .ts-cell--brand .ts-v { font-size: 14px; color: var(--text-2); }+ .three-signal[data-state="error"] .ts-err { display: inline; }+ .ts-err { display: none; font-size: 12.5px; color: var(--text-3); margin-left: 8px; }+ /* On narrow screens the row scrolls horizontally; hide the CTA arrow to+ save space and let the values breathe. */+ @media (max-width: 720px) {+ .ts-cell { padding: 13px 18px; }+ .ts-cell--brand { padding-left: 0; }+ .three-signal .ts-cta { display: none; }+ }- /* ── STATS BAR ───────────────────────────────────────────── *//* ── CAPABILITY STRIP ──────────────────────────────────── */.capability-strip {position: relative;@@ -303,7 +400,7 @@.press-strip-cap {font-family: var(--font-mono); font-size: 10.5px;letter-spacing: 0.2em; text-transform: uppercase;- color: var(--text-4); text-align: center; margin-bottom: 24px;+ color: var(--text-3); text-align: center; margin-bottom: 24px;}.press-row {display: flex; flex-wrap: wrap; justify-content: center;@@ -409,7 +506,7 @@.door:hover { background: var(--surface-1); }.door-num {font-family: var(--font-mono); font-size: 11.5px;- letter-spacing: 0.18em; color: var(--text-4); margin-bottom: 28px;+ letter-spacing: 0.18em; color: var(--text-3); margin-bottom: 28px;display: flex; justify-content: space-between; align-items: baseline;}.door-num .lbl { color: var(--text-3); }@@ -470,7 +567,7 @@display: inline-flex; align-items: center;font-family: var(--font-mono); font-size: 10.5px;letter-spacing: 0.15em; text-transform: uppercase;- color: var(--text-4); border: 1px solid var(--hairline-strong);+ color: var(--text-3); border: 1px solid var(--hairline-strong);padding: 4px 9px; border-radius: 99px;margin-top: 4px; width: fit-content;}@@ -582,8 +679,8 @@position: absolute; bottom: 10px; left: 50%;transform: translateX(-50%); display: flex; gap: 14px;font-family: var(--font-mono); font-size: 9.5px;- color: var(--text-4); letter-spacing: 0.06em;- opacity: 0.7; pointer-events: none; z-index: 3;+ color: var(--text-2); letter-spacing: 0.06em;+ opacity: 0.85; pointer-events: none; z-index: 3;white-space: nowrap;}.walk-preview-hint kbd {@@ -621,11 +718,11 @@.earn-row:last-child { border-bottom: none; }.earn-row-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }.earn-row-name { font-size: 14px; font-weight: 500; color: var(--text); }- .earn-row-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-4); }+ .earn-row-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }.earn-row-amount { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--green); display: flex; align-items: baseline; gap: 7px; }.earn-row-amount.buy { color: var(--buy); }.earn-row-amount.sell { color: var(--sell); }- .hlt-usd { font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--text-4); }+ .hlt-usd { font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--text-3); }.hlt-side { font-weight: 700; }.hlt-side.buy { color: var(--buy); }.hlt-side.sell { color: var(--sell); }@@ -771,12 +868,13 @@}.dev-tab {padding: 10px 18px; font-family: var(--font-mono); font-size: 11px;- letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-4);+ letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3);cursor: pointer; border-bottom: 2px solid transparent;transition: color 0.15s, border-color 0.15s; user-select: none;background: none; border-top: none; border-left: none; border-right: none;}.dev-tab:hover { color: var(--text-2); }+ .dev-tab:focus-visible { outline: var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent)); outline-offset: -2px; }.dev-tab.active { color: var(--text); border-bottom-color: var(--text); }.dev-tab-content { display: none; }.dev-tab-content.active { display: block; }@@ -802,11 +900,17 @@.dev-link:hover { border-color: var(--text); color: var(--text); }.dev-right { display: flex; flex-direction: column; }.dev-api-row {+ width: 100%; text-align: left; font: inherit; color: inherit;+ background: transparent; border: none;padding: 14px 20px; border-bottom: 1px solid var(--hairline);display: flex; flex-direction: column; gap: 4px;cursor: pointer; transition: background 0.15s;}.dev-api-row:hover { background: var(--surface-1); }+ .dev-api-row:focus-visible {+ outline: var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent));+ outline-offset: -2px;+ }.dev-api-row.active {background: var(--surface-2);box-shadow: inset 3px 0 0 var(--text-3);@@ -818,14 +922,14 @@.dev-api-path {font-family: var(--font-mono); font-size: 13px; color: var(--text);}- .dev-api-desc { font-size: 12px; color: var(--text-4); }+ .dev-api-desc { font-size: 12px; color: var(--text-3); }.dev-badge {display: inline-block; font-family: var(--font-mono); font-size: 10px;letter-spacing: 0.1em; text-transform: uppercase;padding: 2px 7px; border-radius: 4px; font-weight: 700;min-width: 36px; text-align: center;}- .dev-badge.get { background: rgba(74,222,128,0.12); color: #4ade80; }+ .dev-badge.get { background: rgba(74,222,128,0.12); color: var(--success); }.dev-badge.post { background: rgba(96,165,250,0.12); color: #60a5fa; }.dev-badge.mcp { background: rgba(255,92,168,0.12); color: #ff8cc8; }@@ -835,7 +939,7 @@.pg-field-label {font-family: var(--font-mono); font-size: 10.5px;letter-spacing: 0.12em; text-transform: uppercase;- color: var(--text-4); margin-bottom: 6px; display: block;+ color: var(--text-3); margin-bottom: 6px; display: block;}.pg-input {width: 100%; background: var(--surface-2); border: 1px solid var(--hairline-strong);@@ -844,6 +948,10 @@transition: border-color 0.15s;}.pg-input:focus { border-color: var(--text-3); }+ .pg-input:focus-visible, .pg-url-path:focus-visible {+ outline: var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent));+ outline-offset: var(--focus-ring-offset,2px);+ }.pg-input::placeholder { color: var(--text-4); }textarea.pg-input { min-height: 80px; resize: vertical; line-height: 1.6; }.pg-url-bar {@@ -853,7 +961,7 @@}.pg-url-method {padding: 9px 12px; font-family: var(--font-mono); font-size: 11px;- font-weight: 700; letter-spacing: 0.08em; color: #4ade80;+ font-weight: 700; letter-spacing: 0.08em; color: var(--success);border-right: 1px solid var(--hairline-strong); background: var(--surface-1);min-width: 52px; text-align: center; user-select: none;}@@ -875,13 +983,13 @@.pg-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }.pg-status {font-family: var(--font-mono); font-size: 11px;- letter-spacing: 0.05em; color: var(--text-4);+ letter-spacing: 0.05em; color: var(--text-3);}- .pg-status.ok { color: #4ade80; }- .pg-status.err { color: #f87171; }- .pg-status.warn { color: #fbbf24; }- .pg-status.err::before { background: #f87171; box-shadow: 0 0 5px #f87171; }- .pg-status.warn::before { background: #fbbf24; box-shadow: 0 0 5px #fbbf24; }+ .pg-status.ok { color: var(--success); }+ .pg-status.err { color: var(--danger); }+ .pg-status.warn { color: var(--warn); }+ .pg-status.err::before { background: var(--danger); box-shadow: 0 0 5px var(--danger); }+ .pg-status.warn::before { background: var(--warn); box-shadow: 0 0 5px var(--warn); }.pg-key-field { margin-bottom: 16px; }.pg-key-hint {float: right; text-transform: none; letter-spacing: 0;@@ -897,7 +1005,7 @@padding: 10px 16px; border-bottom: 1px solid var(--hairline);font-family: var(--font-mono); font-size: 10.5px;letter-spacing: 0.1em; text-transform: uppercase;- color: var(--text-4); display: flex; justify-content: space-between;+ color: var(--text-3); display: flex; justify-content: space-between;}.pg-response-body {padding: 16px; font-family: var(--font-mono); font-size: 12px;@@ -908,13 +1016,13 @@.pg-response-body::-webkit-scrollbar-track { background: transparent; }.pg-response-body::-webkit-scrollbar-thumb { background: var(--hairline-strong); border-radius: 3px; }.pg-empty {- padding: 40px 24px; text-align: center; color: var(--text-4);+ padding: 40px 24px; text-align: center; color: var(--text-3);font-size: 13px; line-height: 1.6;}.pg-empty-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.3; }.pg-response-body .json-key { color: #60a5fa; }- .pg-response-body .json-str { color: #4ade80; }- .pg-response-body .json-num { color: #fbbf24; }+ .pg-response-body .json-str { color: var(--success); }+ .pg-response-body .json-num { color: var(--warn); }.pg-response-body .json-bool { color: var(--accent); }.pg-response-body .json-null { color: var(--text-4); }.pg-curl-code {@@ -955,7 +1063,7 @@.foot-col-h {font-family: var(--font-mono); font-size: 10px;text-transform: uppercase; letter-spacing: 0.18em;- color: var(--text-4); margin-bottom: 6px;+ color: var(--text-3); margin-bottom: 6px;}.foot-col a {color: rgba(255,255,255,.32); font-size: 13px;@@ -1089,7 +1197,11 @@border-radius: 999px; padding: 4px 4px 4px 16px;transition: border-color 0.2s;}- .hero-chat-form:focus-within { border-color: rgba(255,255,255,0.25); }+ .hero-chat-form:focus-within {+ border-color: rgba(255,255,255,0.25);+ outline: var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent));+ outline-offset: var(--focus-ring-offset,2px);+ }.hero-chat-input {flex: 1; background: transparent; border: none; outline: none;color: var(--text); font-family: var(--font-body);@@ -1177,7 +1289,7 @@font-size: 10px;letter-spacing: 0.22em;text-transform: uppercase;- color: var(--text-4);+ color: var(--text-3);display: flex;align-items: center;gap: 8px;@@ -1227,7 +1339,7 @@font-family: var(--font-mono);font-size: 10px;letter-spacing: 0.12em;- color: var(--text-4);+ color: var(--text-3);}.hero-chips-counter strong { color: var(--text-3); font-weight: 600; }@media (max-width: 980px) {@@ -1318,7 +1430,7 @@font-family: var(--font-mono);font-size: 11px;letter-spacing: 0.18em;- color: var(--text-4);+ color: var(--text-3);margin-bottom: 6px;}.stack-card-title {@@ -1450,7 +1562,7 @@.wyg-anim-label {font-family: var(--font-mono); font-size: 10px;letter-spacing: 0.22em; text-transform: uppercase;- color: var(--text-4);+ color: var(--text-3);}.wyg-anim-stop {width: 14px; height: 14px;@@ -1655,7 +1767,7 @@.pg-control-label {font-family: var(--font-mono); font-size: 10px;letter-spacing: 0.18em; text-transform: uppercase;- color: var(--text-4); flex-shrink: 0;+ color: var(--text-3); flex-shrink: 0;}.pg-chips { display: flex; gap: 4px; flex-wrap: wrap; }.pg-chip {@@ -1718,6 +1830,10 @@.pg-editor {position: relative; flex: 1; min-height: 320px;}+ .pg-editor:focus-within {+ outline: var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent));+ outline-offset: -2px;+ }.pg-editor textarea,.pg-editor pre {font-family: var(--font-mono); font-size: 13px; line-height: 1.75;@@ -1846,7 +1962,7 @@.pg-color-popover-label {font-family: var(--font-mono); font-size: 10px;letter-spacing: 0.15em; text-transform: uppercase;- color: var(--text-4);+ color: var(--text-3);}.pg-color-swatches {display: grid;@@ -1882,6 +1998,10 @@transition: border-color 0.15s;}.pg-color-hex-input:focus { border-color: var(--text-3); }+ .pg-color-hex-input:focus-visible {+ outline: var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent));+ outline-offset: var(--focus-ring-offset,2px);+ }.pg-color-preview {width: 28px; height: 28px; border-radius: 5px;border: 1px solid var(--hairline-strong);@@ -2107,7 +2227,7 @@}.manifesto-neg {font-size: clamp(16px, 1.6vw, 19px);- color: var(--text-4);+ color: var(--text-3);margin: 0;line-height: 1.5;text-decoration: line-through;@@ -2202,8 +2322,9 @@.bento-action-btn.primary:hover{background:#fff;border-color:#fff}.bento-action-btn.ghost{background:transparent;color:var(--text-2)}.studio-zone{display:flex;gap:8px;align-items:stretch}- .studio-drop{flex:1;border:1px dashed var(--hairline-strong);border-radius:8px;padding:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;cursor:pointer;transition:border-color .2s,background .2s;font-family:var(--font-mono);font-size:11px;color:var(--text-3);text-align:center;min-height:80px}+ .studio-drop{flex:1;width:100%;background:transparent;border:1px dashed var(--hairline-strong);border-radius:8px;padding:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;cursor:pointer;transition:border-color .2s,background .2s;font-family:var(--font-mono);font-size:11px;color:var(--text-3);text-align:center;min-height:80px}.studio-drop:hover,.studio-drop.drag-over{border-color:var(--text-2);background:rgba(255,255,255,.03)}+ .studio-drop:focus-visible{outline:var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent));outline-offset:var(--focus-ring-offset,2px)}.studio-drop-icon{font-size:22px;opacity:.5}.studio-preview-img{width:44px;height:44px;border-radius:50%;object-fit:cover;border:1px solid var(--hairline-strong);flex:none}.studio-ready{display:none;flex-direction:column;align-items:stretch;gap:12px;padding:14px;border:1px solid var(--hairline-strong);border-radius:8px;background:rgba(255,255,255,.02)}@@ -2219,43 +2340,44 @@.mocap-demo{display:flex;flex-direction:column;gap:8px}.mocap-bar{display:flex;align-items:center;gap:10px}.mocap-waveform{width:100%;height:48px;border-radius:6px;background:var(--surface-2);border:1px solid var(--hairline-strong);display:block}- .mocap-status{font-family:var(--font-mono);font-size:10px;letter-spacing:.1em;color:var(--text-4);text-align:center}+ .mocap-status{font-family:var(--font-mono);font-size:10px;letter-spacing:.1em;color:var(--text-3);text-align:center}.mocap-status.live{color:var(--text-2)}.walk-minimap-wrap{position:relative;border-radius:8px;overflow:hidden;border:1px solid var(--hairline-strong);background:#0d0d0d}.walk-minimap{width:100%;height:140px;display:block;cursor:crosshair}.walk-minimap:focus{outline:2px solid rgba(255,255,255,.3);outline-offset:-2px}.walk-minimap-hud{position:absolute;top:6px;left:8px;display:flex;align-items:center;gap:6px;font-family:var(--font-mono);font-size:9px;color:var(--text-3);letter-spacing:.08em}- .walk-minimap-dot{width:5px;height:5px;border-radius:50%;background:#4ade80;box-shadow:0 0 4px #4ade8088}- .walk-minimap-hint{position:absolute;bottom:6px;left:50%;transform:translateX(-50%);font-family:var(--font-mono);font-size:8.5px;color:var(--text-4);letter-spacing:.06em;white-space:nowrap}+ .walk-minimap-dot{width:5px;height:5px;border-radius:50%;background:var(--success);box-shadow:0 0 4px #4ade8088}+ .walk-minimap-hint{position:absolute;bottom:6px;left:50%;transform:translateX(-50%);font-family:var(--font-mono);font-size:8.5px;color:var(--text-3);letter-spacing:.06em;white-space:nowrap}.walk-minimap-hint kbd{display:inline-block;padding:0 3px;border:1px solid var(--hairline-strong);border-radius:2px;font-family:var(--font-mono);font-size:8px;background:var(--surface-2)}.x402-demo{display:flex;flex-direction:column;gap:8px}.x402-step{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--surface-2);border:1px solid var(--hairline-strong);border-radius:8px;transition:all .3s ease}.x402-code{font-family:var(--font-mono);font-size:11.5px;color:var(--text-2);flex:1}- .x402-code.err{color:#f87171}- .x402-code.ok{color:#4ade80}+ .x402-code.err{color:var(--danger)}+ .x402-code.ok{color:var(--success)}.x402-spinner{width:16px;height:16px;border:2px solid var(--hairline-strong);border-top-color:var(--text-2);border-radius:50%;animation:walk-spin .6s linear infinite;display:none}- .x402-amount{font-family:var(--font-display);font-size:14px;font-weight:600;color:#4ade80;display:none}+ .x402-amount{font-family:var(--font-display);font-size:14px;font-weight:600;color:var(--success);display:none}.x402-amount.show{display:block}.mint-demo{perspective:600px}.mint-card{position:relative;padding:16px;background:var(--surface-2);border:1px solid var(--hairline-strong);border-radius:10px;transition:transform .6s cubic-bezier(.2,.7,.3,1),box-shadow .3s,border-color .3s}.mint-card.minted{border-color:rgba(255,255,255,.2);box-shadow:0 0 20px -4px rgba(255,255,255,.08)}.mint-card-inner{display:flex;align-items:center;justify-content:space-between;gap:10px}.mint-card-info{display:flex;flex-direction:column;gap:2px}- .mint-card-label{font-family:var(--font-mono);font-size:10px;letter-spacing:.15em;text-transform:uppercase;color:var(--text-4);transition:color .3s}+ .mint-card-label{font-family:var(--font-mono);font-size:10px;letter-spacing:.15em;text-transform:uppercase;color:var(--text-3);transition:color .3s}.mint-card-name{font-family:var(--font-display);font-size:16px;font-weight:600;color:var(--text);background:transparent;border:none;border-bottom:1px dashed transparent;padding:0 1px 1px;margin:0;width:auto;max-width:170px;outline:none;transition:border-color .15s}- .mint-card-name:hover:not(:disabled),.mint-card-name:focus{border-bottom-color:var(--text-4)}+ .mint-card-name:hover:not(:disabled),.mint-card-name:focus{border-bottom-color:var(--text-2)}+ .mint-card-name:focus-visible{outline:var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent));outline-offset:var(--focus-ring-offset,2px);border-radius:2px}.mint-card-name::placeholder{color:var(--text-4)}.mint-card-name:disabled{opacity:.65;cursor:default}.mint-card.error{border-color:rgba(248,113,113,.45)}.mint-card-name.shake{animation:mint-shake .4s cubic-bezier(.36,.07,.19,.97)}@keyframes mint-shake{10%,90%{transform:translateX(-1px)}20%,80%{transform:translateX(2px)}30%,50%,70%{transform:translateX(-4px)}40%,60%{transform:translateX(4px)}}.mint-card-chain{font-family:var(--font-mono);font-size:10px;color:var(--text-3);display:block}- .mint-card-chain a{color:#4ade80;text-decoration:none;border-bottom:1px solid rgba(74,222,128,.3)}- .mint-card-chain a:hover{border-bottom-color:#4ade80}- .mint-card.minted .mint-card-label{color:#4ade80}+ .mint-card-chain a{color:var(--success);text-decoration:none;border-bottom:1px solid rgba(74,222,128,.3)}+ .mint-card-chain a:hover{border-bottom-color:var(--success)}+ .mint-card.minted .mint-card-label{color:var(--success)}.mint-status{margin:11px 0 0;font-family:var(--font-mono);font-size:10.5px;line-height:1.4;color:var(--text-3)}- .mint-status.err{color:#f87171}- .mint-status.ok{color:#4ade80}+ .mint-status.err{color:var(--danger)}+ .mint-status.ok{color:var(--success)}.mint-status a{color:inherit;text-decoration:underline;text-underline-offset:2px}.mint-progress{width:28px;height:28px;position:relative;display:none}.mint-progress.active{display:block}@@ -2264,18 +2386,18 @@@keyframes mint-spin{from{transform:rotate(-90deg)}to{transform:rotate(270deg)}}.mint-progress circle{fill:none;stroke-width:3;stroke:var(--text-2);stroke-linecap:round;stroke-dasharray:78.5;stroke-dashoffset:78.5;transition:stroke-dashoffset 1.2s cubic-bezier(.2,.7,.3,1)}.mint-progress.active:not(.done) circle{stroke-dashoffset:55}- .mint-progress.done circle{stroke-dashoffset:0;stroke:#4ade80;transition:stroke-dashoffset .5s cubic-bezier(.2,.7,.3,1)}+ .mint-progress.done circle{stroke-dashoffset:0;stroke:var(--success);transition:stroke-dashoffset .5s cubic-bezier(.2,.7,.3,1)}.skill-demo{display:flex;flex-direction:column;gap:8px}.skill-result{background:var(--surface-2);border:1px solid var(--hairline-strong);border-radius:7px;padding:10px 14px;font-family:var(--font-mono);font-size:11px;color:var(--text-2);line-height:1.6;max-height:100px;overflow-y:auto;transition:border-color .3s}.skill-result.fresh{border-color:rgba(255,255,255,.2)}.skill-result .json-key{color:#60a5fa}- .skill-result .json-str{color:#4ade80}- .skill-result .json-num{color:#fbbf24}+ .skill-result .json-str{color:var(--success)}+ .skill-result .json-num{color:var(--warn)}.skill-result .json-dim{color:var(--text-3)}.skill-result.loading{color:var(--text-3)}.skill-result.err{border-color:rgba(248,113,113,.4)}.skill-loading .json-key{color:#60a5fa}- .skill-err{color:#f87171}+ .skill-err{color:var(--danger)}.skill-cursor{color:var(--text-3);animation:skillBlink 1s steps(2,end) infinite}.skill-dots::after{content:'';animation:skillDots 1.4s steps(4,end) infinite}@keyframes skillDots{0%{content:''}25%{content:'.'}50%{content:'..'}75%{content:'...'}}@@ -2285,6 +2407,7 @@.memory-input-row{display:flex;gap:6px}.memory-input{flex:1;background:var(--surface-2);border:1px solid var(--hairline-strong);border-radius:6px;padding:7px 10px;font-family:var(--font-mono);font-size:11.5px;color:var(--text);outline:none;transition:border-color .15s}.memory-input:focus{border-color:var(--text-3)}+ .memory-input:focus-visible{outline:var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent));outline-offset:var(--focus-ring-offset,2px)}.memory-input::placeholder{color:var(--text-4)}.memory-log{display:flex;flex-direction:column;gap:4px;max-height:72px;overflow-y:auto}.memory-entry{font-family:var(--font-mono);font-size:10.5px;color:var(--text-3);line-height:1.5;padding:3px 0;animation:mem-in .3s ease}@@ -2304,8 +2427,8 @@.ar-phone-crosshair::before{width:16px;height:1px}.ar-phone-crosshair::after{width:1px;height:16px}.ar-info{display:flex;flex-direction:column;gap:4px}- .ar-status{font-family:var(--font-mono);font-size:10px;color:var(--text-4);letter-spacing:.08em}- .ar-status.ready{color:#4ade80}+ .ar-status{font-family:var(--font-mono);font-size:10px;color:var(--text-3);letter-spacing:.08em}+ .ar-status.ready{color:var(--success)}.mktplace-strip{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:2px 0}.mktplace-strip::-webkit-scrollbar{display:none}.mktplace-item{flex-shrink:0;width:52px;height:52px;border-radius:10px;overflow:hidden;border:1px solid var(--hairline-strong);cursor:pointer;background:var(--surface-2);transition:border-color .15s,transform .15s;position:relative;display:block}@@ -2315,12 +2438,12 @@.mktplace-more{flex-shrink:0;width:52px;height:52px;border-radius:10px;border:1px dashed var(--hairline-strong);display:flex;align-items:center;justify-content:center;font-family:var(--font-mono);font-size:18px;color:var(--text-4);cursor:pointer;transition:border-color .15s,color .15s;text-decoration:none}.mktplace-more:hover{border-color:var(--text-3);color:var(--text-2)}.analytics-demo{display:flex;flex-direction:column;gap:10px;--spark:#34d399;--spark-deep:#10b981}- .analytics-example-tag{align-self:flex-start;font-family:var(--font-mono);font-size:9px;letter-spacing:.12em;text-transform:uppercase;color:var(--text-4);border:1px solid var(--hairline);border-radius:5px;padding:2px 7px}+ .analytics-example-tag{align-self:flex-start;font-family:var(--font-mono);font-size:9px;letter-spacing:.12em;text-transform:uppercase;color:var(--text-3);border:1px solid var(--hairline);border-radius:5px;padding:2px 7px}.analytics-counters{display:flex;gap:16px}.analytics-counter{display:flex;flex-direction:column;gap:1px}.analytics-val{font-family:var(--font-display);font-size:18px;font-weight:600;color:var(--text);font-variant-numeric:tabular-nums;letter-spacing:-0.02em}.analytics-val#an-revenue{color:var(--spark)}- .analytics-lbl{font-family:var(--font-mono);font-size:9px;letter-spacing:.12em;text-transform:uppercase;color:var(--text-4)}+ .analytics-lbl{font-family:var(--font-mono);font-size:9px;letter-spacing:.12em;text-transform:uppercase;color:var(--text-3)}.analytics-spark{width:100%;height:40px;display:block}.analytics-spark path{fill:none;stroke:var(--spark);stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 3px color-mix(in srgb,var(--spark) 55%,transparent))}.analytics-spark .spark-fill{fill:url(#spark-grad);stroke:none;opacity:1;filter:none}@@ -2504,6 +2627,24 @@@keyframes hoc-shimmer { to { background-position: -200% 0; } }.hoc-live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green, #22c55e); margin-right: 7px; vertical-align: middle; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: hoc-pulse 2s infinite; }@keyframes hoc-pulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.5)} 70%{box-shadow:0 0 0 6px rgba(34,197,94,0)} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0)} }++ /* ── MOTION SAFETY ──────────────────────────────────────────+ Honor the OS "reduce motion" setting. This page hardcodes ~30+ keyframe animations and many transitions that tokens.css cannot+ reach; neutralize all decorative motion globally so the layout+ stays static for vestibular-sensitive visitors. Essential state+ feedback still renders — only the animation/transition is dropped. */+ @media (prefers-reduced-motion: reduce) {+ html { scroll-behavior: auto; }+ *, *::before, *::after {+ animation-duration: 0.001ms !important;+ animation-iteration-count: 1 !important;+ animation-delay: 0ms !important;+ transition-duration: 0.001ms !important;+ transition-delay: 0ms !important;+ scroll-behavior: auto !important;+ }+ }</style><noscript><style>.reveal{opacity:1!important;transform:none!important}.hero-text>*{opacity:1!important;transform:none!important}</style></noscript><script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>@@ -2580,6 +2721,37 @@</div></section>+<!-- ── LIVE $THREE SIGNAL — real market data from /api/three-token/stats ── -->+<a class="three-signal" id="three-signal" href="/three-token" data-state="loading"+ aria-label="Live $THREE market stats — open the token page">+ <div class="three-signal-inner">+ <div class="ts-cell ts-cell--brand">+ <span class="ts-k"><span class="ts-live-dot" aria-hidden="true"></span>$THREE · live</span>+ <span class="ts-v">+ <span id="ts-price">—</span>+ <span class="ts-chg ts-chg--flat" id="ts-change"></span>+ <span class="ts-err" id="ts-err">view live stats</span>+ </span>+ </div>+ <div class="ts-cell">+ <span class="ts-k">Market cap</span>+ <span class="ts-v" id="ts-mcap">—</span>+ </div>+ <div class="ts-cell">+ <span class="ts-k">Volume 24h</span>+ <span class="ts-v" id="ts-vol">—</span>+ </div>+ <div class="ts-cell">+ <span class="ts-k">$THREE burned</span>+ <span class="ts-v" id="ts-burned">—</span>+ </div>+ <div class="ts-cell ts-cell--cta ts-cta" aria-hidden="true">+ <span>Token</span>+ <span class="ts-arrow">→</span>+ </div>+ </div>+</a>+<!-- ── CAPABILITY STRIP ───────────────────────────────────────────── --><div class="capability-strip" id="capability-strip" aria-hidden="true"><div class="cap-fade cap-fade--l"></div>@@ -2724,7 +2896,7 @@<div class="pg-color-swatches" id="pg-color-swatches"></div><div class="pg-color-hex-row"><div class="pg-color-preview" id="pg-color-preview"></div>- <input class="pg-color-hex-input" id="pg-color-hex" type="text" placeholder="#1b1b1b" maxlength="7" spellcheck="false" autocomplete="off" />+ <input class="pg-color-hex-input" id="pg-color-hex" type="text" placeholder="#1b1b1b" maxlength="7" spellcheck="false" autocomplete="off" aria-label="Custom background color hex value" /></div></div></div>@@ -2742,7 +2914,7 @@<div class="pg-left"><div class="pg-editor-head">index.html</div><div class="pg-editor" id="pg-editor">- <textarea id="pg-textarea" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off"></textarea>+ <textarea id="pg-textarea" spellcheck="false" autocomplete="off" autocorrect="off" autocapitalize="off" aria-label="Embed code editor"></textarea><pre id="pg-highlight" aria-hidden="true"></pre></div></div>@@ -2960,7 +3132,7 @@<span class="wyg-card-pill"><span class="dot" style="background:#ffffff"></span>Celebration</span><span class="wyg-card-pill"><span class="dot" style="background:#34d399"></span>Curiosity</span><span class="wyg-card-pill"><span class="dot" style="background:#60a5fa"></span>Empathy</span>- <span class="wyg-card-pill"><span class="dot" style="background:#fbbf24"></span>Concern</span>+ <span class="wyg-card-pill"><span class="dot" style="background:var(--warn)"></span>Concern</span></div></div>@@ -3064,7 +3236,7 @@display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;overflow: hidden;}- .hcf-meta { font-size: 11px; font-family: var(--font-mono); color: var(--text-4); margin-top: auto; padding-top: 6px; }+ .hcf-meta { font-size: 11px; font-family: var(--font-mono); color: var(--text-3); margin-top: auto; padding-top: 6px; }.hcf-skel {border-radius: 14px; border: 1px solid var(--hairline);background: var(--surface-1); overflow: hidden;@@ -3258,6 +3430,9 @@#home-pose .hp-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 3px; border-radius: 2px; background: var(--hairline-strong); outline: none; cursor: pointer; }#home-pose .hp-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--text); border: 2px solid #09090a; box-shadow: 0 0 0 1px var(--hairline-strong); cursor: grab; transition: transform .12s; }#home-pose .hp-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }+ #home-pose .hp-slider:focus-visible { outline: var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent)); outline-offset: var(--focus-ring-offset,4px); }+ #home-pose .hp-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--focus-ring-color,var(--accent)); }+ #home-pose .hp-slider:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--focus-ring-color,var(--accent)); }#home-pose .hp-slider::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--text); border: 2px solid #09090a; cursor: grab; }#home-pose .hp-mini-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }#home-pose .hp-btn {@@ -3493,6 +3668,7 @@transition: box-shadow 0.2s ease;}#home-forge .hf-bar:focus-within { box-shadow: 0 18px 48px -20px rgba(0, 0, 0, 0.85), 0 0 0 4px rgba(139, 92, 246, 0.14); }+ #home-forge .hf-bar:focus-within { outline: var(--focus-ring-width,2px) solid var(--focus-ring-color,var(--accent)); outline-offset: var(--focus-ring-offset,2px); }#home-forge .hf-bar-glyph { color: var(--text-3); font-size: 13px; flex: none; }#home-forge [data-hf-state='generating'] .hf-bar-glyph { color: #ffb454; }#home-forge .hf-prompt {@@ -4038,11 +4214,11 @@<p class="bento-desc">Upload a photo, webcam shot, or existing GLB. Our pipeline generates a fully rigged, animatable 3D character compatible with VRM and standard glTF/GLB avatar formats. Retargets to any animation clip instantly.</p><div class="bento-interact" id="studio-interact"><div class="studio-zone" id="studio-zone">- <div class="studio-drop" id="studio-drop">- <div class="studio-drop-icon">↑</div>+ <button type="button" class="studio-drop" id="studio-drop" aria-label="Upload a selfie — drop an image here or activate to choose a file">+ <span class="studio-drop-icon" aria-hidden="true">↑</span><span>Drop a selfie or click to upload</span>- <input type="file" accept="image/*" id="studio-file" style="display:none" />- </div>+ </button>+ <input type="file" accept="image/*" id="studio-file" style="display:none" aria-label="Selfie image file" /><button class="bento-action-btn studio-webcam-btn" id="studio-webcam-btn" type="button">Webcam</button></div><div class="studio-ready" id="studio-ready">@@ -4222,11 +4398,11 @@<p class="bento-desc">Your agent remembers every visitor across devices and sessions. Tie-in to your own data sources or use the built-in vector memory.</p><div class="bento-interact memory-demo" id="memory-demo"><div class="memory-input-row">- <input class="memory-input" id="memory-input" placeholder="Tell the agent something..." maxlength="120" />+ <input class="memory-input" id="memory-input" placeholder="Tell the agent something..." maxlength="120" aria-label="Tell the agent something to remember" /><button class="bento-action-btn sm" id="memory-store-btn">Store</button></div><button class="bento-action-btn sm" id="memory-recall-btn" style="align-self:flex-start">Recall</button>- <div class="memory-log" id="memory-log"></div>+ <div class="memory-log" id="memory-log" aria-live="polite"></div></div></div>@@ -4320,7 +4496,7 @@<li><strong>Trending dashboard</strong> — track your token across the Pump.fun leaderboard in real-time</li></ul><div>- <a class="btn btn--sm" href="/pump-3d-agent">Explore token agents <span class="arrow">→</span></a>+ <a class="btn btn--sm" href="/launches">Explore token agents <span class="arrow">→</span></a></div></div><div class="feat-visual">@@ -4336,7 +4512,7 @@</a><div class="earn-rows" id="hlt-rows" style="border:1px solid var(--hairline);border-radius:8px;overflow:hidden;"></div><div style="display:flex;gap:10px;">- <a class="btn btn--sm" href="/pumpfun-trending" style="flex:1;justify-content:center;">Trending tokens</a>+ <a class="btn btn--sm" href="/radar" style="flex:1;justify-content:center;">Trending tokens</a><button class="btn btn--sm btn--primary" id="hlt-launch" type="button" style="flex:1;justify-content:center;">Launch yours</button></div></div>@@ -4601,25 +4777,25 @@</div><div class="pg-url-bar"><div class="pg-url-method" id="pg-method">GET</div>- <input class="pg-url-path" id="pg-path" readonly />+ <input class="pg-url-path" id="pg-path" readonly aria-label="Request URL path" /></div><div id="pg-params"></div><div id="pg-body-wrap" style="display:none;"><div class="pg-field">- <label class="pg-field-label">Request body</label>+ <label class="pg-field-label" for="pg-body">Request body</label><textarea class="pg-input" id="pg-body" placeholder='{ "key": "value" }'></textarea></div></div><div class="pg-actions"><button type="button" class="pg-send" id="pg-send">Send</button>- <span class="pg-status" id="pg-status"></span>+ <span class="pg-status" id="pg-status" role="status" aria-live="polite"></span></div><div class="pg-response" id="pg-response" style="display:none;"><div class="pg-response-head"><span>Response</span><button type="button" class="pg-copy" id="pg-copy-resp">Copy</button></div>- <div class="pg-response-body" id="pg-response-body"></div>+ <div class="pg-response-body" id="pg-response-body" aria-live="polite" aria-atomic="true"></div></div></div></div>@@ -4668,48 +4844,48 @@<span>Endpoints</span><span>v1</span></div>- <div class="dev-api-row" data-endpoint="list-agents">- <div style="display:flex;align-items:center;gap:8px;">+ <button type="button" class="dev-api-row" aria-pressed="false" data-endpoint="list-agents">+ <span style="display:flex;align-items:center;gap:8px;"><span class="dev-badge get">GET</span><span class="dev-api-path">/v1/agents</span>- </div>- <div class="dev-api-desc">List all agents in your account</div>- </div>- <div class="dev-api-row" data-endpoint="create-agent">- <div style="display:flex;align-items:center;gap:8px;">+ </span>+ <span class="dev-api-desc">List all agents in your account</span>+ </button>+ <button type="button" class="dev-api-row" aria-pressed="false" data-endpoint="create-agent">+ <span style="display:flex;align-items:center;gap:8px;"><span class="dev-badge post">POST</span><span class="dev-api-path">/v1/agents</span>- </div>- <div class="dev-api-desc">Create agent from avatar + prompt</div>- </div>- <div class="dev-api-row" data-endpoint="chat">- <div style="display:flex;align-items:center;gap:8px;">+ </span>+ <span class="dev-api-desc">Create agent from avatar + prompt</span>+ </button>+ <button type="button" class="dev-api-row" aria-pressed="false" data-endpoint="chat">+ <span style="display:flex;align-items:center;gap:8px;"><span class="dev-badge post">POST</span><span class="dev-api-path">/v1/chat</span>- </div>- <div class="dev-api-desc">Send a message, stream a response</div>- </div>- <div class="dev-api-row" data-endpoint="get-avatar">- <div style="display:flex;align-items:center;gap:8px;">+ </span>+ <span class="dev-api-desc">Send a message, stream a response</span>+ </button>+ <button type="button" class="dev-api-row" aria-pressed="false" data-endpoint="get-avatar">+ <span style="display:flex;align-items:center;gap:8px;"><span class="dev-badge get">GET</span><span class="dev-api-path">/v1/avatars/:id</span>- </div>- <div class="dev-api-desc">Fetch avatar metadata and GLB URL</div>- </div>- <div class="dev-api-row" data-endpoint="mcp">- <div style="display:flex;align-items:center;gap:8px;">+ </span>+ <span class="dev-api-desc">Fetch avatar metadata and GLB URL</span>+ </button>+ <button type="button" class="dev-api-row" aria-pressed="false" data-endpoint="mcp">+ <span style="display:flex;align-items:center;gap:8px;"><span class="dev-badge mcp">MCP</span><span class="dev-api-path">three.ws/mcp</span>- </div>- <div class="dev-api-desc">Model Context Protocol server</div>- </div>- <div class="dev-api-row" data-endpoint="a2a">- <div style="display:flex;align-items:center;gap:8px;">+ </span>+ <span class="dev-api-desc">Model Context Protocol server</span>+ </button>+ <button type="button" class="dev-api-row" aria-pressed="false" data-endpoint="a2a">+ <span style="display:flex;align-items:center;gap:8px;"><span class="dev-badge mcp">A2A</span><span class="dev-api-path">/v1/a2a/:agentId</span>- </div>- <div class="dev-api-desc">Agent-to-agent protocol endpoint</div>- </div>+ </span>+ <span class="dev-api-desc">Agent-to-agent protocol endpoint</span>+ </button><div style="padding:14px 20px;margin-top:auto;border-top:1px solid var(--hairline);"><a class="btn btn--sm" href="/dashboard/api">Get API key <span class="arrow">→</span></a></div>@@ -4960,9 +5136,11 @@// Live pump.fun token card + real "Launch yours" flow.import { initHomeLiveToken } from '/src/home-live-token.js';import { initHomepageLauncher } from '/src/pump/homepage-launcher.js';+ import { initHomeThreeSignal } from '/src/home-three-signal.js';const hltCard = document.getElementById('hlt-card');if (hltCard) initHomeLiveToken(hltCard);initHomepageLauncher(document.getElementById('hlt-launch'));+ initHomeThreeSignal(document.getElementById('three-signal'));</script><script type="module">@@ -5165,14 +5343,17 @@for (const [k, v] of Object.entries(AGENT_ATTRS)) el.setAttribute(k, v);return el;}- (async () => {+ async function bootHeroAvatar() {+ const heroInner = document.getElementById('hero-stage-inner');+ const shimmer = document.getElementById('hero-shimmer');try {const r = await fetch(`${location.origin}/api/avatars/${AVATAR_ID}`);+ if (!r.ok) throw new Error('HTTP ' + r.status);const d = await r.json();const glb = devProxyGlb(d.avatar?.model_url || d.avatar?.url);- if (!glb) return;- const heroInner = document.getElementById('hero-stage-inner');+ if (!glb) throw new Error('no model url');if (heroInner) {+ heroInner.innerHTML = '';const heroEl = spawnAgent(glb);heroInner.appendChild(heroEl);initHeroWalk(heroEl);@@ -5180,8 +5361,21 @@}} catch (e) {console.warn('[home] avatar boot failed', e);+ // Designed fallback — never leave the hero shimmering forever on a network failure.+ if (shimmer) shimmer.classList.add('hidden');+ if (heroInner) {+ heroInner.innerHTML = '<div class="hero-stage-fallback" role="status">'+ + '<p>The live preview couldn’t load right now.</p>'+ + '<button type="button" class="btn btn--sm" id="hero-retry">Retry</button></div>';+ heroInner.querySelector('#hero-retry')?.addEventListener('click', () => {+ if (shimmer) shimmer.classList.remove('hidden');+ heroInner.innerHTML = '';+ bootHeroAvatar();+ });+ }}- })();+ }+ bootHeroAvatar();// ── What You Get: avatar viewer + animation gallery ────────────(function initWygSection() {diff --git a/pages/marketplace.html b/pages/marketplace.htmlindex 05a7a3f08..b46d9e3a6 100644--- a/pages/marketplace.html+++ b/pages/marketplace.html@@ -49,6 +49,50 @@border: 0;}+ /* Skip-to-content link — visible only on keyboard focus. Lets keyboard+ and screen-reader users jump past the sidebar nav straight to the+ marketplace content. */+ .skip-link {+ position: absolute;+ left: 12px;+ top: -48px;+ z-index: 4000;+ padding: 10px 16px;+ background: #fafafa;+ color: #000;+ border-radius: 8px;+ font-size: 13px;+ font-weight: 600;+ text-decoration: none;+ transition: top 0.15s ease;+ }+ .skip-link:focus,+ .skip-link:focus-visible {+ top: 12px;+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);+ outline-offset: var(--focus-ring-offset, 2px);+ }++ /* Global keyboard-focus safety net. Many interactive nodes on this page+ are built from JS HTML strings (cards, chips, action buttons, embed+ copy buttons) and rely on the UA outline. Pin a consistent, visible+ focus-visible ring on every focusable element using the shared token+ vocabulary so no keyboard user is ever left without an indicator.+ Elements that declare their own richer focus-visible ring (theme+ picks, skill cards) keep it — this only fills the gaps. */+ .market-page a:focus-visible,+ .market-page button:focus-visible,+ .market-page input:focus-visible,+ .market-page select:focus-visible,+ .market-page textarea:focus-visible,+ .market-page [tabindex]:focus-visible,+ .market-page [role='button']:focus-visible,+ .market-page [role='link']:focus-visible,+ .market-page [role='tab']:focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);+ outline-offset: var(--focus-ring-offset, 2px);+ }+.market-wip-banner {display: flex;align-items: center;@@ -2557,6 +2601,33 @@align-self: stretch;}}++ /* ── Reduced-motion: disable non-essential transitions/animations ──+ Honours the OS "reduce motion" setting. Decorative shimmers, card+ hover lifts, hero cross-fades, skeleton pulses and entry animations+ declared in this sheet are switched off; functional state changes+ (opacity reveals) collapse to instant so nothing is left invisible. */+ @media (prefers-reduced-motion: reduce) {+ .market-page *,+ .market-page *::before,+ .market-page *::after {+ animation-duration: 0.001ms !important;+ animation-iteration-count: 1 !important;+ transition-duration: 0.001ms !important;+ scroll-behavior: auto !important;+ }+ .market-hero-placeholder::after,+ .market-card-avatar:hover,+ .market-anim-card:hover,+ .market-memory-type-card:hover,+ .market-skill-card:hover,+ .market-theme-pick:hover,+ .market-theme-pick:focus-visible,+ .market-hero-cta:hover,+ .market-memory-cta-btn:hover {+ transform: none !important;+ }+ }</style><meta property="og:type" content="website" /><meta property="og:title" content="Agent Marketplace · three.ws" />@@ -2599,6 +2670,7 @@</script></head><body class="market-page">+ <a class="skip-link" href="#main-content">Skip to content</a><header><div id="nav-container"></div></header><script src="/nav.js"></script>@@ -2647,7 +2719,7 @@</button></aside>- <main class="market-main" id="market-main">+ <main class="market-main" id="main-content"><!-- Discovery view --><section class="market-discovery" id="market-discovery"><!-- Stable, screen-reader-only page heading. The hero title below@@ -2884,7 +2956,7 @@<span class="d-avatar-fallback">▣</span></div><div class="market-detail-meta">- <h1 id="d-name">—</h1>+ <h2 id="d-name">—</h2><div class="market-detail-author"><button type="button" id="d-author" class="market-author-btn">—</button><span class="dot">·</span>@@ -3382,7 +3454,7 @@<!-- Right: meta + actions --><aside class="market-avatar-detail-meta"><div class="market-detail-eyebrow">Community Avatar</div>- <h1 class="market-avatar-detail-name" id="avatar-detail-name">—</h1>+ <h2 class="market-avatar-detail-name" id="avatar-detail-name">—</h2><p class="market-avatar-detail-author" id="avatar-detail-author"></p><p class="market-avatar-detail-desc" id="avatar-detail-desc"></p><div class="market-avatar-detail-pills" id="avatar-detail-pills"></div>@@ -3475,7 +3547,7 @@<div class="market-detail-eyebrow" id="tool-detail-eyebrow">Plugin</div>- <h1 class="tool-detail-name" id="tool-detail-name">—</h1>+ <h2 class="tool-detail-name" id="tool-detail-name">—</h2><p class="tool-detail-id" id="tool-detail-id"></p><p class="tool-detail-author" id="tool-detail-author" hidden></p></div>@@ -3577,7 +3649,7 @@<div class="market-detail-eyebrow" id="skill-detail-eyebrow">Skill</div>- <h1 class="tool-detail-name" id="skill-detail-name">—</h1>+ <h2 class="tool-detail-name" id="skill-detail-name">—</h2><p class="tool-detail-author" id="skill-detail-author" hidden></p></div><div class="tool-detail-price" id="skill-detail-price"></div>@@ -3706,7 +3778,7 @@</div><div class="tool-detail-hero-text"><div class="market-detail-eyebrow">Animation clip</div>- <h1 class="tool-detail-name" id="anim-detail-name">—</h1>+ <h2 class="tool-detail-name" id="anim-detail-name">—</h2><p class="tool-detail-id" id="anim-detail-clip"></p></div></header>@@ -3789,7 +3861,7 @@</div><div class="tool-detail-hero-text"><div class="market-detail-eyebrow">ERC-8004 onchain agent</div>- <h1 class="tool-detail-name" id="onchain-detail-name">—</h1>+ <h2 class="tool-detail-name" id="onchain-detail-name">—</h2><p class="tool-detail-id" id="onchain-detail-owner"></p></div></header>diff --git a/pages/strategy-lab.html b/pages/strategy-lab.htmldeleted file mode 100644index ab00a3f34..000000000--- a/pages/strategy-lab.html+++ /dev/null@@ -1,394 +0,0 @@-<!doctype html>-<html lang="en">-<head>- <script>/* three.ws theme boot — no-flash */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Strategy Lab · three.ws</title>- <meta name="description" content="Design your agent's trading strategy, backtest it against Oracle conviction history, and deploy it in one click. See exactly how your parameters would have performed." />- <meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:url" content="https://three.ws/strategy-lab" />- <meta property="og:title" content="Strategy Lab · three.ws" />- <meta property="og:description" content="Design, backtest, and deploy autonomous trading strategies powered by Oracle conviction scoring." />- <meta property="og:image" content="https://three.ws/og-image.png" />- <meta name="twitter:card" content="summary_large_image" />- <meta name="twitter:site" content="@trythreews" />- <meta name="twitter:title" content="Strategy Lab · three.ws" />- <meta name="twitter:description" content="Design, backtest, and deploy your agent's trading strategy. Real Oracle data, real numbers." />- <meta name="twitter:image" content="https://three.ws/og-image.png" />- <meta name="theme-color" content="#0a0a0a" />- <link rel="icon" href="/favicon.ico" sizes="any" />- <link rel="icon" type="image/svg+xml" href="/favicon.svg" />- <link rel="apple-touch-icon" href="/apple-touch-icon.png" />- <link rel="manifest" href="/site.webmanifest" />- <link rel="stylesheet" href="/fonts/fonts.css" />- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/footer.css" />- <link rel="canonical" href="https://three.ws/strategy-lab" />- <style>- :root {- --sl-bg: #080a10;- --sl-panel: rgba(15,18,28,0.9);- --sl-border: rgba(255,255,255,0.07);- --sl-accent: #a78bfa;- --sl-green: #34d399;- --sl-red: #f87171;- --sl-yellow: #fbbf24;- --sl-blue: #60a5fa;- --sl-dim: rgba(255,255,255,0.45);- --sl-faint: rgba(255,255,255,0.22);- --sl-ink: rgba(255,255,255,0.9);- }- [data-theme="light"] {- --sl-bg: #f4f5f9;- --sl-panel: rgba(255,255,255,0.92);- --sl-border: rgba(0,0,0,0.08);- --sl-dim: rgba(0,0,0,0.5);- --sl-faint: rgba(0,0,0,0.3);- --sl-ink: rgba(0,0,0,0.88);- }- *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }- html { background: var(--sl-bg); color: var(--sl-ink); font-family: var(--font-sans, system-ui, sans-serif); font-size: 15px; }- body { min-height: 100vh; }-- /* ── layout ── */- .sl-shell { max-width: 1200px; margin: 0 auto; padding: 0 20px 80px; }- .sl-hero { padding: 72px 0 40px; }- .sl-kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sl-accent); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }- .sl-kicker::before { content: ''; width: 28px; height: 2px; background: var(--sl-accent); border-radius: 2px; display: block; }- .sl-title { font-size: clamp(28px,5vw,48px); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 12px; }- .sl-sub { font-size: 16px; color: var(--sl-dim); max-width: 560px; line-height: 1.6; }-- .sl-grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }- @media (max-width: 860px) { .sl-grid { grid-template-columns: 1fr; } }-- /* ── panels ── */- .sl-panel { background: var(--sl-panel); border: 1px solid var(--sl-border); border-radius: 14px; padding: 22px; backdrop-filter: blur(12px); }- .sl-panel-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sl-dim); margin-bottom: 18px; }-- /* ── form ── */- .sl-form { display: flex; flex-direction: column; gap: 16px; }- .sl-field { display: flex; flex-direction: column; gap: 5px; }- .sl-label { font-size: 12px; font-weight: 500; color: var(--sl-dim); }- .sl-input, .sl-select { background: rgba(255,255,255,0.04); border: 1px solid var(--sl-border); border-radius: 8px; color: var(--sl-ink); font-size: 14px; padding: 9px 12px; width: 100%; outline: none; transition: border-color .15s; }- [data-theme="light"] .sl-input, [data-theme="light"] .sl-select { background: rgba(0,0,0,0.04); }- .sl-input:focus, .sl-select:focus { border-color: var(--sl-accent); }- .sl-hint { font-size: 11px; color: var(--sl-faint); line-height: 1.5; }- .sl-run-btn { background: var(--sl-accent); color: #fff; border: none; border-radius: 10px; padding: 13px 24px; font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity .15s, transform .1s; width: 100%; letter-spacing: -.01em; }- .sl-run-btn:hover { opacity: .88; }- .sl-run-btn:active { transform: scale(.98); }- .sl-run-btn:disabled { opacity: .45; cursor: default; }-- .sl-section { margin-top: 4px; }- .sl-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sl-faint); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--sl-border); }-- .sl-deploy-cta { margin-top: 16px; text-align: center; }- .sl-deploy-btn { display: inline-block; background: rgba(167,139,250,.12); border: 1px solid var(--sl-accent); color: var(--sl-accent); border-radius: 8px; padding: 10px 20px; font-size: 13px; font-weight: 600; text-decoration: none; transition: background .15s; }- .sl-deploy-btn:hover { background: rgba(167,139,250,.22); }-- /* ── results ── */- .sl-results { display: flex; flex-direction: column; gap: 20px; min-height: 300px; }- .sl-state { display: flex; align-items: center; justify-content: center; min-height: 260px; color: var(--sl-faint); font-size: 14px; flex-direction: column; gap: 12px; text-align: center; }- .sl-state-icon { font-size: 36px; opacity: .5; }-- .sl-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }- @media (max-width: 680px) { .sl-kpi-row { grid-template-columns: repeat(2, 1fr); } }- .sl-kpi { background: var(--sl-panel); border: 1px solid var(--sl-border); border-radius: 12px; padding: 16px; }- .sl-kpi-val { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin-bottom: 4px; }- .sl-kpi-lbl { font-size: 11px; color: var(--sl-dim); text-transform: uppercase; letter-spacing: .06em; }- .sl-kpi-sub { font-size: 12px; color: var(--sl-faint); margin-top: 3px; }- .sl-pos { color: var(--sl-green); }- .sl-neg { color: var(--sl-red); }-- /* ── tier table ── */- .sl-tier-table { width: 100%; border-collapse: collapse; font-size: 13px; }- .sl-tier-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sl-faint); text-align: left; padding: 0 10px 10px; }- .sl-tier-table th:not(:first-child) { text-align: right; }- .sl-tier-table td { padding: 9px 10px; border-top: 1px solid var(--sl-border); }- .sl-tier-table td:not(:first-child) { text-align: right; color: var(--sl-dim); }- .sl-tier-table tr:hover td { background: rgba(255,255,255,.03); }- .sl-tier-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }-- /* ── top performers ── */- .sl-top-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }- .sl-coin-card { background: var(--sl-panel); border: 1px solid var(--sl-border); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--sl-ink); transition: border-color .15s, transform .1s; display: block; }- .sl-coin-card:hover { border-color: var(--sl-accent); transform: translateY(-1px); }- .sl-coin-sym { font-weight: 700; font-size: 14px; margin-bottom: 4px; }- .sl-coin-ath { font-size: 20px; font-weight: 700; color: var(--sl-green); }- .sl-coin-meta { font-size: 11px; color: var(--sl-faint); margin-top: 3px; }-- /* ── period tabs ── */- .sl-tabs { display: flex; gap: 6px; flex-wrap: wrap; }- .sl-tab { background: transparent; border: 1px solid var(--sl-border); border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 500; color: var(--sl-dim); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }- .sl-tab.active { background: var(--sl-accent); border-color: var(--sl-accent); color: #fff; }- .sl-tab:hover:not(.active) { border-color: var(--sl-accent); color: var(--sl-accent); }-- /* ── skeleton ── */- .sl-sk { background: var(--sl-border); border-radius: 6px; animation: sl-pulse 1.4s ease-in-out infinite; }- @keyframes sl-pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }-- /* ── tier colors ── */- .tier-prime { color: #c084fc; }- .tier-strong { color: var(--sl-green); }- .tier-lean { color: var(--sl-yellow); }- .tier-watch { color: #94a3b8; }- .tier-avoid { color: var(--sl-red); }- .dot-prime { background: #c084fc; }- .dot-strong { background: var(--sl-green); }- .dot-lean { background: var(--sl-yellow); }- .dot-watch { background: #94a3b8; }- .dot-avoid { background: var(--sl-red); }- </style>-- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Strategy Lab","description":"Build DCA and subscription strategies that trade on-chain on your behalf.","url":"https://three.ws/strategy-lab","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>-<body>- <header><div id="nav-container"></div></header>- <script src="/nav.js"></script>-- <main class="sl-shell">- <section class="sl-hero">- <p class="sl-kicker">Oracle-powered</p>- <h1 class="sl-title">Strategy Lab</h1>- <p class="sl-sub">Design your agent's conviction filter, see how it would have performed against real Oracle history, then deploy it in one click.</p>- </section>-- <div class="sl-grid">- <!-- ── left: strategy configurator ── -->- <aside>- <div class="sl-panel">- <div class="sl-panel-title">Strategy parameters</div>- <form class="sl-form" id="sl-form">- <div class="sl-section">- <div class="sl-section-title">Oracle conviction filter</div>- <div class="sl-field">- <label class="sl-label" for="sl-tier">Conviction tier</label>- <select class="sl-select" id="sl-tier" name="tier">- <option value="all">All tiers</option>- <option value="prime">Prime only</option>- <option value="strong">Strong+</option>- <option value="lean">Lean+</option>- <option value="watch">Watch+</option>- <option value="avoid">Avoid (test only)</option>- </select>- <span class="sl-hint">Prime = highest conviction. Strong = solid. Lean = OK. Watch = low confidence. Avoid = likely rug or poor setup.</span>- </div>- </div>-- <div class="sl-section">- <div class="sl-section-title">Backtest window</div>- <div class="sl-field">- <label class="sl-label">Period</label>- <div class="sl-tabs" id="sl-period-tabs">- <button type="button" class="sl-tab" data-period="1d">1 day</button>- <button type="button" class="sl-tab active" data-period="7d">7 days</button>- <button type="button" class="sl-tab" data-period="30d">30 days</button>- <button type="button" class="sl-tab" data-period="90d">90 days</button>- <button type="button" class="sl-tab" data-period="all">All time</button>- </div>- <span class="sl-hint">Only coins with a resolved outcome (graduated, rugged, or ATH known) are counted — open positions are excluded so the win rate is honest.</span>- </div>- </div>-- <button type="submit" class="sl-run-btn" id="sl-run">Run backtest</button>- </form>-- <div class="sl-deploy-cta">- <a class="sl-deploy-btn" href="/dashboard/sniper" id="sl-deploy-link">Deploy this strategy →</a>- </div>- </div>- </aside>-- <!-- ── right: results ── -->- <section id="sl-results" class="sl-results">- <div class="sl-state" id="sl-state">- <div class="sl-state-icon">⚗️</div>- <div>Run a backtest to see how your strategy would have performed.</div>- <div style="font-size:12px;color:var(--sl-faint)">Powered by real Oracle conviction data from every scored pump.fun launch.</div>- </div>- </section>- </div>- </main>-- <script src="/brand.js" defer></script>- <div id="footer-container"></div>- <script src="/footer.js"></script>-- <script type="module">- const TIER_COLOR = { prime: '#c084fc', strong: '#34d399', lean: '#fbbf24', watch: '#94a3b8', avoid: '#f87171' };- const TIER_ORDER = ['prime', 'strong', 'lean', 'watch', 'avoid'];- const fmt1 = (v) => v != null ? Number(v).toFixed(1) + '×' : '—';- const fmtPct = (v) => v != null ? `${Math.round(v)}%` : '—';- const esc = (s) => String(s ?? '').replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');-- let period = '7d';- let loading = false;-- // Period tabs- document.getElementById('sl-period-tabs').addEventListener('click', (e) => {- const btn = e.target.closest('[data-period]');- if (!btn) return;- period = btn.dataset.period;- document.querySelectorAll('.sl-tab').forEach(b => b.classList.toggle('active', b === btn));- });-- document.getElementById('sl-form').addEventListener('submit', async (e) => {- e.preventDefault();- if (loading) return;- await runBacktest();- });-- async function runBacktest() {- const tier = document.getElementById('sl-tier').value;- const btn = document.getElementById('sl-run');- const results = document.getElementById('sl-results');- const state = document.getElementById('sl-state');-- loading = true;- btn.disabled = true;- btn.textContent = 'Running…';-- // Skeletons while loading- results.innerHTML = `- <div class="sl-kpi-row">- ${[0,1,2,3].map(() => `<div class="sl-kpi"><div class="sl-sk" style="height:26px;width:80%;margin-bottom:6px"></div><div class="sl-sk" style="height:11px;width:55%"></div></div>`).join('')}- </div>- <div class="sl-panel" style="min-height:180px"><div class="sl-sk" style="height:100%;min-height:180px;width:100%;border-radius:10px"></div></div>- <div class="sl-panel" style="min-height:130px"><div class="sl-sk" style="height:100%;min-height:130px;width:100%;border-radius:10px"></div></div>- `;-- try {- const url = `/api/oracle/backtest?period=${encodeURIComponent(period)}&tier=${encodeURIComponent(tier)}&network=mainnet`;- const resp = await fetch(url);- if (!resp.ok) throw new Error(`HTTP ${resp.status}`);- const data = await resp.json();- renderResults(data, tier, period);- updateDeployLink(tier);- } catch (err) {- results.innerHTML = `<div class="sl-state"><div class="sl-state-icon">⚠️</div><div>Backtest unavailable — ${esc(err.message)}. Try again in a moment.</div></div>`;- } finally {- loading = false;- btn.disabled = false;- btn.textContent = 'Run backtest';- }- }-- const TIER_MIN_SCORE = { prime: 75, strong: 55, lean: 40, watch: 20 };- function updateDeployLink(tier) {- const link = document.getElementById('sl-deploy-link');- const label = tier === 'all' ? 'Deploy strategy →' : `Deploy ${tier} strategy →`;- link.textContent = label;- const score = TIER_MIN_SCORE[tier];- const params = new URLSearchParams({ from: 'strategy-lab' });- if (tier && tier !== 'all') params.set('preset_tier', tier);- if (score != null) params.set('preset_score', String(score));- link.href = `/dashboard/sniper?${params.toString()}`;- }-- function renderResults(data, tier, per) {- const agg = data.aggregate || {};- const rows = (data.tiers || []).sort((a, b) => TIER_ORDER.indexOf(a.tier) - TIER_ORDER.indexOf(b.tier));- const top = data.top_performers || [];-- const winRate = agg.win_rate;- const resolved = (agg.wins || 0) + (agg.losses || 0);- const winRateClass = winRate >= 60 ? 'sl-pos' : winRate < 40 ? 'sl-neg' : '';-- const tierLabel = tier === 'all' ? 'All tiers' : tier.charAt(0).toUpperCase() + tier.slice(1);- const periodLabel = { '1d': 'Last 24 h', '7d': 'Last 7 days', '30d': 'Last 30 days', '90d': 'Last 90 days', all: 'All time' }[per] || per;-- const noData = !agg.total || agg.total === 0;-- document.getElementById('sl-results').innerHTML = `- <div style="display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap">- <div style="font-size:13px;color:var(--sl-dim)">${esc(tierLabel)} · ${esc(periodLabel)} · ${(agg.total || 0).toLocaleString()} resolved</div>- ${noData ? '<div style="font-size:12px;color:var(--sl-faint)">No resolved outcomes yet in this window</div>' : ''}- </div>-- <div class="sl-kpi-row">- <div class="sl-kpi">- <div class="sl-kpi-val ${winRateClass}">${fmtPct(winRate)}</div>- <div class="sl-kpi-lbl">Win rate</div>- <div class="sl-kpi-sub">${resolved ? `${agg.wins}W / ${agg.losses}L` : 'no data'}</div>- </div>- <div class="sl-kpi">- <div class="sl-kpi-val">${agg.graduated || 0}</div>- <div class="sl-kpi-lbl">Graduated</div>- <div class="sl-kpi-sub">to Raydium</div>- </div>- <div class="sl-kpi">- <div class="sl-kpi-val sl-pos">${agg.three_x || 0}</div>- <div class="sl-kpi-lbl">Hit 3×+</div>- <div class="sl-kpi-sub">${agg.total ? `${Math.round(((agg.three_x||0)/agg.total)*100)}% of scored` : '—'}</div>- </div>- <div class="sl-kpi">- <div class="sl-kpi-val sl-pos">${agg.five_x || 0}</div>- <div class="sl-kpi-lbl">Hit 5×+</div>- <div class="sl-kpi-sub">${agg.total ? `${Math.round(((agg.five_x||0)/agg.total)*100)}% of scored` : '—'}</div>- </div>- </div>-- ${rows.length > 1 ? `- <div class="sl-panel">- <div class="sl-panel-title">Per-tier breakdown</div>- <table class="sl-tier-table">- <thead>- <tr>- <th>Tier</th>- <th>Win rate</th>- <th>Resolved</th>- <th>3×+</th>- <th>5×+</th>- <th>Avg ATH</th>- </tr>- </thead>- <tbody>- ${rows.map(r => {- const wr = r.win_rate;- const wrClass = wr >= 60 ? 'sl-pos' : wr < 40 ? 'sl-neg' : '';- return `<tr>- <td><span class="sl-tier-dot dot-${esc(r.tier)}"></span><span class="tier-${esc(r.tier)}" style="font-weight:600">${esc(r.tier)}</span></td>- <td><span class="${wrClass}">${fmtPct(wr)}</span></td>- <td>${(r.wins + r.losses).toLocaleString()}</td>- <td>${r.three_x || 0}</td>- <td>${r.five_x || 0}</td>- <td>${fmt1(r.avg_ath)}</td>- </tr>`;- }).join('')}- </tbody>- </table>- </div>` : ''}-- ${top.length ? `- <div class="sl-panel">- <div class="sl-panel-title">Top performers in this window</div>- <div class="sl-top-grid">- ${top.map(c => `- <a class="sl-coin-card" href="/oracle?mint=${encodeURIComponent(c.mint)}" title="Open Oracle conviction for ${esc(c.symbol || c.name)}">- <div class="sl-coin-sym">${esc(c.symbol || c.name || c.mint.slice(0,6))}</div>- <div class="sl-coin-ath">${c.ath_multiple != null ? Number(c.ath_multiple).toFixed(1) + '×' : c.graduated ? 'Grad' : '—'}</div>- <div class="sl-coin-meta tier-${esc(c.tier)}">${esc(c.tier)}${c.score != null ? ` · ${c.score}` : ''}</div>- </a>- `).join('')}- </div>- </div>` : ''}-- <div class="sl-panel" style="background:rgba(167,139,250,.06);border-color:rgba(167,139,250,.2)">- <div style="font-size:13px;font-weight:600;margin-bottom:8px">Ready to deploy?</div>- <p style="font-size:13px;color:var(--sl-dim);line-height:1.6;margin-bottom:14px">- Your agent can act on Oracle conviction automatically. Arm a sniper strategy with a min conviction tier and let it trade while you sleep.- </p>- <div style="display:flex;gap:10px;flex-wrap:wrap">- <a class="sl-deploy-btn" href="/dashboard/sniper">Open Sniper →</a>- <a class="sl-deploy-btn" href="/oracle" style="background:transparent;border-color:var(--sl-border);color:var(--sl-dim)">Browse Oracle →</a>- </div>- </div>- `;- }-- // Auto-run with default params on load- runBacktest();- </script>-</body>-</html>diff --git a/pages/trending.html b/pages/trending.htmlindex dd94831b1..aeeb18ed2 100644--- a/pages/trending.html+++ b/pages/trending.html@@ -13,6 +13,14 @@<meta property="og:description" content="Top 3D AI agents by real chat activity. Top conviction coins by Oracle score." /><meta property="og:image" content="https://three.ws/og-image.png" /><meta name="twitter:card" content="summary_large_image" />++ <meta property="og:type" content="website">+ <meta property="og:site_name" content="three.ws">+ <meta property="og:url" content="https://three.ws/trending">+ <meta name="twitter:title" content="Trending — Top Agents & Coins on three.ws · three.ws">+ <meta name="twitter:description" content="What’s hot on three.ws right now. Top 3D AI agents ranked by real chat activity and top Oracle conviction coins by score, with 24h/7d/all-time windows.">+ <meta name="twitter:image" content="https://three.ws/og-image.png">+ <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Trending — Top Agents & Coins on three.ws","description":"What’s hot on three.ws right now. Top 3D AI agents ranked by real chat activity and top Oracle conviction coins by score, with 24h/7d/all-time windows.","url":"https://three.ws/trending","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script></head><body><div id="nav-container"></div>@@ -233,9 +241,6 @@</style><script type="module">- import '/src/nav.js';- import '/src/footer.js';-const $ = (s) => document.querySelector(s);const $$ = (s) => document.querySelectorAll(s);const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) =>@@ -386,5 +391,7 @@loadData();</script>+ <script src="/nav.js" defer></script>+ <script src="/footer.js" defer></script></body></html>diff --git a/public/agent/index.html b/public/agent/index.htmlindex b68298dce..36c6f4a67 100644--- a/public/agent/index.html+++ b/public/agent/index.html@@ -628,7 +628,7 @@}.mp-badge--expired {background: rgba(251, 191, 36, 0.12);- color: #fbbf24;+ color: var(--warn);}.mp-chain-chip {@@ -696,7 +696,7 @@.mp-revoke-btn {background: rgba(239, 68, 68, 0.1);border: 1px solid rgba(239, 68, 68, 0.25);- color: #f87171;+ color: var(--danger);font-size: 0.718rem;font-family: inherit;padding: 0.3rem 0.7rem;diff --git a/public/changelog.json b/public/changelog.jsonindex 336af4a97..20f750ba8 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-16T11:50:42.858Z",+ "generated_at": "2026-06-16T23:14:50.649Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -126,6 +126,16 @@"feature"]},+ {+ "date": "2026-06-16",+ "type": "update",+ "title": "Agent-wallet payment demo fails gracefully when the local bridge isn't running",+ "summary": "The /play/agent-wallet demo pays a real x402 endpoint by signing through a bridge that runs in your terminal. On the live site, with no bridge to reach, the page used to hang on \"Connecting to bridge…\" while a doomed network request timed out in the background. It now recognizes there's no local bridge and shows the \"Bridge offline\" banner immediately — with the exact command to start the bridge — instead of stalling. Multiplayer /walk and the avatar creator were also hardened so they degrade cleanly when their server isn't configured rather than trying to reach a local address that doesn't exist in production.",+ "link": "/play/agent-wallet",+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-16","type": "update",@@ -250,6 +260,16 @@"improvement"]},+ {+ "date": "2026-06-16",+ "type": "update",+ "title": "Create-flow feature previews now show live data, not sample numbers",+ "summary": "The capability previews on the avatar create screen — Reputation, Analytics, and Token Launch — used to display illustrative sample figures (placeholder reviews, made-up revenue, a fake token price). They now pull real numbers live: Reputation and Analytics show the platform's actual on-chain attestation count, registered-agent totals, widgets and chains; Token Launch shows the live $THREE market (price, 24h change, market cap, volume). Each strip loads with a skeleton and quietly collapses if a data source is briefly unreachable, so you never see invented figures. Skill-pricing previews now read \"you set the price\" instead of fabricated per-call amounts.",+ "link": "/create-review",+ "tags": [+ "improvement"+ ]+ },{"date": "2026-06-16","type": "update",@@ -260,6 +280,16 @@"improvement"]},+ {+ "date": "2026-06-16",+ "type": "update",+ "title": "Embedded agents and the marketplace lobby fail gracefully instead of crashing",+ "summary": "Hardened the async boundaries on a few load paths so a flaky network never leaves a silent crash in the page. When an embedded agent, a saved widget, or an on-chain agent can't load, you now get a clear \"Couldn't load this\" message with a retry button instead of a half-rendered viewer. On the marketplace lobby, a hiccup loading the 3D model decoder no longer throws an uncaught error — the gallery degrades quietly and the rest of the page keeps working.",+ "link": null,+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-16","type": "update",@@ -310,6 +340,16 @@"improvement"]},+ {+ "date": "2026-06-16",+ "type": "update",+ "title": "Home page token buttons now land on real pages",+ "summary": "Two buttons in the home page's token-economy section pointed at pages that never existed — \"Explore token agents\" and \"Trending tokens\" both led to 404s. They now go to the right places: \"Explore token agents\" opens the Agent Launches feed, and \"Trending tokens\" opens Coin Radar, the live pump.fun launch-intelligence view.",+ "link": "/launches",+ "tags": [+ "fix"+ ]+ },{"date": "2026-06-16","type": "update",@@ -414,6 +454,17 @@"feature"]},+ {+ "date": "2026-06-16",+ "type": "update",+ "title": "Live $THREE market signal now greets you on the home page",+ "summary": "Right under the hero, the home page now shows a live $THREE signal bar pulling real market data: current price with its 24h change (green up, red down), market cap, 24h trading volume, and the running total of $THREE permanently burned by agent deployments. Every figure is fetched live from the token API (Birdeye → DexScreener → GeckoTerminal failover, edge-cached) and refreshes every 30 seconds without a reload. If the data source is briefly unreachable it degrades to a quiet link to the token page instead of showing blanks, and it pauses refreshing while the tab is in the background.",+ "link": "/three-token",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-06-16","type": "update",@@ -733,6 +784,16 @@"improvement"]},+ {+ "date": "2026-06-16",+ "type": "update",+ "title": "Pages that hit a network error now show a retry, never a blank screen",+ "summary": "Audited every data-loading surface across the home page, Discover, the Marketplace, your Dashboard, agent profiles, and the create flow so a flaky connection always lands on a designed state instead of an empty void. Lists that fail to load now show a clear \"Couldn't load this — Retry\" message with a working retry button; sections still loading show a skeleton instead of a frozen spinner; and the home hero, transcript and knowledge popups, and avatar pickers recover cleanly if a request drops. Toggle your connection off and reload — the page tells you what happened and how to recover.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },{"date": "2026-06-16","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 84bb2c9c1..083c4d23a 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -102,6 +102,14 @@<category>feature</category><description>Agent profiles now show a live TRADING RECORD panel that pulls directly from the Oracle's action ledger. Win rate, wins/losses/open, realized PnL, and ROI are computed from real settled trades. Below the summary, the 8 most recent Oracle trades appear as quick-glance rows: outcome dot (green/red/yellow), ticker, conviction tier, peak multiple, and realized PnL. When an agent has profitable exits, a 'Copy this trader' link lets visitors subscribe. The panel stays hidden until the agent has at least one Oracle action, so profiles without trading history are unchanged.</description></item>+ <item>+ <title>Agent-wallet payment demo fails gracefully when the local bridge isn't running</title>+ <link>https://three.ws/play/agent-wallet</link>+ <guid isPermaLink="false">2026-06-16:Agent-wallet payment demo fails gracefully when the local bridge isn't running</guid>+ <pubDate>Tue, 16 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The /play/agent-wallet demo pays a real x402 endpoint by signing through a bridge that runs in your terminal. On the live site, with no bridge to reach, the page used to hang on "Connecting to bridge…" while a doomed network request timed out in the background. It now recognizes there's no local bridge and shows the "Bridge offline" banner immediately — with the exact command to start the bridge — instead of stalling. Multiplayer /walk and the avatar creator were also hardened so they degrade cleanly when their server isn't configured rather than trying to reach a local address that doesn't exist in production.</description>+ </item><item><title>Agents Index — browse every public 3D AI agent on three.ws</title><link>https://three.ws/agents</link>@@ -198,6 +206,14 @@<category>feature</category><description>Saving an avatar or completing an agent no longer drops you on a blank library page. A new /create/next screen appears immediately after: your 3D model spins in the left panel while three action cards on the right guide you through the natural progression — give it an AI brain, embed it on any site, or optionally deploy it on-chain. Each card deep-links directly with your new avatar or agent pre-loaded so the session continues without starting over.</description></item>+ <item>+ <title>Create-flow feature previews now show live data, not sample numbers</title>+ <link>https://three.ws/create-review</link>+ <guid isPermaLink="false">2026-06-16:Create-flow feature previews now show live data, not sample numbers</guid>+ <pubDate>Tue, 16 Jun 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The capability previews on the avatar create screen — Reputation, Analytics, and Token Launch — used to display illustrative sample figures (placeholder reviews, made-up revenue, a fake token price). They now pull real numbers live: Reputation and Analytics show the platform's actual on-chain attestation count, registered-agent totals, widgets and chains; Token Launch shows the live $THREE market (price, 24h change, market cap, volume). Each strip loads with a skeleton and quietly collapses if a data source is briefly unreachable, so you never see invented figures. Skill-pricing previews now read "you set the price" instead of fabricated per-call amounts.</description>+ </item><item><title>Embed wizard now reachable from every agent and avatar page</title><link>https://three.ws/embed</link>@@ -206,6 +222,14 @@<category>improvement</category><description>The full-featured embed wizard (/embed) is now one click away from any agent detail page, avatar page, and the dashboard agents list. Open it to configure size, environment, mode, and controls, see a live preview, and copy platform-specific instructions for plain HTML, React, WordPress, Webflow, or Shopify. When the wizard is opened from an agent page it pre-loads the agent and defaults to chat mode.</description></item>+ <item>+ <title>Embedded agents and the marketplace lobby fail gracefully instead of crashing</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-16:Embedded agents and the marketplace lobby fail gracefully instead of crashing</guid>+ <pubDate>Tue, 16 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Hardened the async boundaries on a few load paths so a flaky network never leaves a silent crash in the page. When an embedded agent, a saved widget, or an on-chain agent can't load, you now get a clear "Couldn't load this" message with a retry button instead of a half-rendered viewer. On the marketplace lobby, a hiccup loading the 3D model decoder no longer throws an uncaught error — the gallery degrades quietly and the rest of the page keeps working.</description>+ </item><item><title>Every launch now has its own page — the full story of a coin in one place</title><link>https://three.ws/launches</link>@@ -246,6 +270,14 @@<category>improvement</category><description>The three.ws home page now has an Oracle section between the Pump.fun token economy block and the pay-per-call block. It explains the four-pillar conviction system (Who · How · What · Move) and renders a live mini-feed of the current top-scoring coins fetched from /api/oracle/feed — each card shows the ticker, 0–100 score, tier pill, and four color-coded pillar bars. Clicking any card opens the Oracle drawer for that coin. The live dot pulses while data is streaming.</description></item>+ <item>+ <title>Home page token buttons now land on real pages</title>+ <link>https://three.ws/launches</link>+ <guid isPermaLink="false">2026-06-16:Home page token buttons now land on real pages</guid>+ <pubDate>Tue, 16 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Two buttons in the home page's token-economy section pointed at pages that never existed — "Explore token agents" and "Trending tokens" both led to 404s. They now go to the right places: "Explore token agents" opens the Agent Launches feed, and "Trending tokens" opens Coin Radar, the live pump.fun launch-intelligence view.</description>+ </item><item><title>Home page: Top Traders widget + Oracle proof trades in coin drawer</title><link>https://three.ws/oracle</link>@@ -326,6 +358,14 @@<category>feature</category><description>The Trader Leaderboard now includes an Oracle Conviction Rankings section below the main board. Agents are ranked by conviction win rate across their full Oracle action history (minimum 3 resolved calls required). Each row shows wins/losses, realized PnL, and ROI. A new /api/oracle/leaderboard endpoint drives the data. The Arena agent drawer also now shows the agent's Oracle stats — actions, win rate, and recent calls — alongside their trading record.</description></item>+ <item>+ <title>Live $THREE market signal now greets you on the home page</title>+ <link>https://three.ws/three-token</link>+ <guid isPermaLink="false">2026-06-16:Live $THREE market signal now greets you on the home page</guid>+ <pubDate>Tue, 16 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Right under the hero, the home page now shows a live $THREE signal bar pulling real market data: current price with its 24h change (green up, red down), market cap, 24h trading volume, and the running total of $THREE permanently burned by agent deployments. Every figure is fetched live from the token API (Birdeye → DexScreener → GeckoTerminal failover, edge-cached) and refreshes every 30 seconds without a reload. If the data source is briefly unreachable it degrades to a quiet link to the token page instead of showing blanks, and it pauses refreshing while the tab is in the background.</description>+ </item><item><title>Live Trade Feed — every notable pump.fun win in one public stream</title><link>https://three.ws/trades</link>@@ -574,6 +614,14 @@<category>improvement</category><description>The Oracle arm panel now has a Send test button next to the Telegram chat ID field. Clicking it sends an immediate test message to confirm your bot setup is working before you wait for a real signal to arrive. The button shows delivery success or a hint if the bot hasn't been started.</description></item>+ <item>+ <title>Pages that hit a network error now show a retry, never a blank screen</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-16:Pages that hit a network error now show a retry, never a blank screen</guid>+ <pubDate>Tue, 16 Jun 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Audited every data-loading surface across the home page, Discover, the Marketplace, your Dashboard, agent profiles, and the create flow so a flaky connection always lands on a designed state instead of an empty void. Lists that fail to load now show a clear "Couldn't load this — Retry" message with a working retry button; sections still loading show a skeleton instead of a frozen spinner; and the home hero, transcript and knowledge popups, and avatar pickers recover cleanly if a request drops. Toggle your connection off and reload — the page tells you what happened and how to recover.</description>+ </item><item><title>Pay an agent in the IRL playground with one tap via x402</title><link>https://three.ws/irl</link>diff --git a/public/dashboard-next/shell.css b/public/dashboard-next/shell.cssindex dfefb9ceb..979708474 100644--- a/public/dashboard-next/shell.css+++ b/public/dashboard-next/shell.css@@ -680,22 +680,55 @@ button { font: inherit; color: inherit; background: none; border: none; cursor:.dn-mobile-sheet-item {transition: none !important;}+ .dn-user-menu-item,+ .dnd-row,+ .dnd-chip,+ .dn-pal-item {+ transition: none !important;+ animation: none !important;+ }+ .dn-mobile-sheet.open { transition: none !important; }}/* ── Focus rings ──────────────────────────────────────────────────────── */-.dn-shell :focus { outline: none; }+/* Suppress the default ring only for mouse focus; :focus-visible below+ restores a robust, high-contrast ring for keyboard users. Literal colour+ fallback (#4da3ff) keeps a visible indicator even if the token layer+ fails to load — tokens win when present. */+.dn-shell :focus:not(:focus-visible) { outline: none; }.dn-shell a:focus-visible,.dn-shell button:focus-visible,.dn-shell input:focus-visible,.dn-shell textarea:focus-visible,.dn-shell select:focus-visible,.dn-shell [tabindex]:focus-visible,-#dn-palette :focus-visible {- outline: 2px solid var(--nxt-accent);- outline-offset: 2px;+.dn-shell [role='button']:focus-visible,+.dn-shell [role='tab']:focus-visible,+.dn-shell [role='option']:focus-visible,+.dn-shell [role='article']:focus-visible,+#dn-palette :focus-visible,+[data-topbar-notifs] :focus-visible,+[data-topbar-user-menu] :focus-visible,+.dn-mobile-sheet :focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, var(--nxt-accent, #4da3ff));+ outline-offset: var(--focus-ring-offset, 2px);border-radius: var(--nxt-radius-sm);}+/* Many page modules inject their own `<style>` after this sheet and set+ `outline: none` on bare `input:focus` / `select:focus` / `textarea:focus`+ to lean on a border-colour change. That strips the keyboard ring. This+ body-scoped, !important :focus-visible rule guarantees a visible indicator+ for keyboard users regardless of those later rules, while leaving mouse+ focus (plain :focus) to the page's own styling. */+body.dn-body input:focus-visible,+body.dn-body select:focus-visible,+body.dn-body textarea:focus-visible,+body.dn-body [contenteditable]:focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, var(--nxt-accent, #4da3ff)) !important;+ outline-offset: var(--focus-ring-offset, 2px) !important;+}+/* ── Skip-link ────────────────────────────────────────────────────────── */.dn-skip {position: fixed;diff --git a/public/discover/detail.css b/public/discover/detail.cssindex 8fd06419a..34247c064 100644--- a/public/discover/detail.css+++ b/public/discover/detail.css@@ -202,6 +202,13 @@ body.detail-page {transition: background 0.15s, color 0.15s;}+.detail-error-actions {+ display: flex;+ gap: 10px;+ flex-wrap: wrap;+ justify-content: center;+}+.detail-btn--primary {background: #fff;color: #000;diff --git a/public/discover/detail.html b/public/discover/detail.htmlindex 637fcc2c4..e984f6081 100644--- a/public/discover/detail.html+++ b/public/discover/detail.html@@ -32,7 +32,10 @@<div class="detail-error-icon">⚠</div><h2 data-role="error-title">Not found</h2><p data-role="error-msg">This item could not be loaded.</p>- <a href="/discover" class="detail-btn">← Back to Discover</a>+ <div class="detail-error-actions">+ <button type="button" class="detail-btn detail-btn--primary" data-role="error-retry" hidden>Retry</button>+ <a href="/discover" class="detail-btn">← Back to Discover</a>+ </div></div><!-- Content (populated by JS) -->diff --git a/public/discover/detail.js b/public/discover/detail.jsindex 520765c40..374accd61 100644--- a/public/discover/detail.js+++ b/public/discover/detail.js@@ -422,16 +422,23 @@ async function fetchSolanaReputation(asset, panel, dl) {} catch (_) {}}-function showError(status) {+function showError(status, onRetry) {const $ = (role) => document.querySelector(`[data-role="${role}"]`);$('loading').hidden = true;$('error').hidden = false;+ const retryBtn = $('error-retry');if (status === 404) {$('error-title').textContent = 'Not found';$('error-msg').textContent = 'This item does not exist or has been removed.';+ // 404 is terminal — retry won't help. Offer only "Back to Discover".+ if (retryBtn) retryBtn.hidden = true;} else {$('error-title').textContent = 'Something went wrong';- $('error-msg').textContent = 'Could not load this item. Try refreshing.';+ $('error-msg').textContent = 'Could not load this item. Check your connection and try again.';+ if (retryBtn && typeof onRetry === 'function') {+ retryBtn.hidden = false;+ retryBtn.onclick = onRetry;+ }}}@@ -444,10 +451,17 @@ function showError(status) {return;}- try {- const item = await fetchItem(route);- render(item);- } catch (err) {- showError(err.status || 500);+ async function load() {+ const $ = (role) => document.querySelector(`[data-role="${role}"]`);+ $('error').hidden = true;+ $('loading').hidden = false;+ try {+ const item = await fetchItem(route);+ render(item);+ } catch (err) {+ showError(err.status || 500, load);+ }}++ load();})();diff --git a/public/features.json b/public/features.jsonindex c0dbffd8f..3e98c80cc 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-16T11:50:42.840Z",+ "generated_at": "2026-06-16T23:14:50.511Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex 81eec51d8..41689933e 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -56,6 +56,20 @@.sm-brand img { width: 24px; height: 24px; border-radius: 5px; }.sm-brand:hover { text-decoration: none; }</style>++ <meta property="og:type" content="website">+ <meta property="og:site_name" content="three.ws">+ <meta property="og:title" content="Sitemap · three.ws">+ <meta property="og:description" content="Human-readable index of every page on three.ws.">+ <meta property="og:url" content="https://three.ws/sitemap">+ <meta property="og:image" content="https://three.ws/og-image.png">+ <meta property="og:image:width" content="1200">+ <meta property="og:image:height" content="630">+ <meta name="twitter:card" content="summary_large_image">+ <meta name="twitter:title" content="Sitemap · three.ws">+ <meta name="twitter:description" content="Human-readable index of every page on three.ws.">+ <meta name="twitter:image" content="https://three.ws/og-image.png">+ <script type="application/ld+json">{"@context":"https://schema.org","@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"}}</script></head><body><header class="sm-topbar">diff --git a/public/tokens.css b/public/tokens.cssindex 4a0091e31..5834b2599 100644--- a/public/tokens.css+++ b/public/tokens.css@@ -165,6 +165,59 @@color-scheme: dark;}+/* ════════════════════════════════════════════════════════════════════════════+ * SEMANTIC ALIAS LAYER (B12)+ * Thin, theme-agnostic synonyms layered ON TOP of the primitives above — the+ * same sanctioned pattern as --nxt-* (app shell) and --nv-* (nav): every value+ * resolves *to* a canonical token via var(); nothing here introduces a new+ * colour, surface, or scale. They exist so page authors can reach for an+ * intention-named token (--color-accent, --color-danger) and so common UI px+ * values map 1:1 to a named spacing rung without re-hardcoding the literal.+ *+ * Because the colour aliases point at the remapped primitives (--bg-0, --ink,+ * --accent …), they flip automatically under [data-theme='light'] with zero+ * extra declarations — do NOT re-list them in the light block.+ * ════════════════════════════════════════════════════════════════════════════ */+:root {+ /* Colour — semantic synonyms for the canonical primitives. */+ --color-bg: var(--bg-0); /* deepest page background */+ --color-surface: var(--surface-1); /* default raised glass fill */+ --color-surface-2: var(--surface-2); /* hover / nested surface */+ --color-text: var(--ink); /* default body ink */+ --color-text-bright: var(--ink-bright); /* headings / primary labels */+ --color-text-dim: var(--ink-dim); /* secondary / muted text */+ --color-text-faint: var(--ink-faint); /* tertiary hints / disabled */+ --color-accent: var(--accent); /* brand accent (CTA fill / focus) */+ --color-border: var(--stroke); /* default hairline / control border */+ --color-border-strong: var(--stroke-strong);+ --color-hairline: var(--stroke); /* divider rules */+ --color-danger: var(--danger); /* destructive / error / sell */+ --color-success: var(--success); /* positive / confirm / buy */+ --color-warning: var(--warn); /* caution / pending */++ /* Spacing — 4px UI grid (B12). Complements the phi display scale above:+ phi (--space-sm/md/lg…) sizes marketing rhythm; this linear ramp gives the+ product chrome exact 4px-multiple rungs so dense layouts (nav, cards,+ forms) migrate hardcoded 8/12/16/24/32px to a token WITHOUT shifting a+ pixel. Pick the ramp that already matches the value you're replacing. */+ --space-1: 4px;+ --space-2: 8px;+ --space-3: 12px;+ --space-4: 16px;+ --space-5: 20px;+ --space-6: 24px;+ --space-7: 28px;+ --space-8: 32px;++ /* Radius — fully-rounded alias (pills/circles), completing the sm/md/lg set. */+ --radius-full: var(--radius-pill);++ /* Motion — short duration synonyms over the canonical ladder. --ease-out is+ already defined above; these just name the two most-reached durations. */+ --dur-fast: var(--duration-fast); /* 140ms — controls */+ --dur-med: var(--duration-base); /* 220ms — panels / dropdowns */+}+/* Explicit dark — identical to :root, so toggling data-theme="dark" is a no-opon the palette but still drives color-scheme + the [data-theme] attribute theswitcher reads back. Keep in lockstep with :root. */diff --git a/scripts/console-audit-tmp.mjs b/scripts/console-audit-tmp.mjsnew file mode 100644index 000000000..c0de0e35f--- /dev/null+++ b/scripts/console-audit-tmp.mjs@@ -0,0 +1,71 @@+import { chromium } from 'playwright';++const BASE = 'http://localhost:3000';+const path = process.argv[2];+const label = process.argv[3] || path;+if (!path) { console.error('usage: console-audit-tmp.mjs <path> [label]'); process.exit(2); }++const IGNORE = [+ /\[vite\]/, /vite\/dist\/client/, /\/@vite\/client/, /\/@react-refresh/,+ /posthog|us\.i\.posthog|us-assets/i, /chrome-extension:\/\//, /favicon\.ico/,+ /google-analytics|googletagmanager/, /Download the React DevTools/, /\[HMR\]/,+ /ERR_CONNECTION_REFUSED/, /net::ERR_ABORTED/,+];+const ignore = (t) => IGNORE.some((re) => re.test(t || ''));++const rec = { errors: [], warnings: [], pageerrors: [], failed: [], bad: [] };+const browser = await chromium.launch({ args: ['--disable-dev-shm-usage', '--no-sandbox'] });+const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 } });+const page = await ctx.newPage();++page.on('console', (msg) => {+ const type = msg.type();+ if (type !== 'error' && type !== 'warning') return;+ const text = msg.text();+ if (ignore(text)) return;+ const loc = msg.location();+ const where = loc?.url ? `${loc.url}:${loc.lineNumber}:${loc.columnNumber}` : '';+ (type === 'error' ? rec.errors : rec.warnings).push({ text, where });+});+page.on('pageerror', (err) => {+ if (ignore(err.message)) return;+ rec.pageerrors.push({ text: err.message, stack: (err.stack || '').split('\n').slice(0, 5).join(' | ') });+});+page.on('requestfailed', (req) => {+ const url = req.url();+ if (ignore(url)) return;+ const f = req.failure();+ if (ignore(f?.errorText)) return;+ rec.failed.push({ url, error: f?.errorText || '' });+});+page.on('response', (resp) => {+ const status = resp.status();+ if (status < 400) return;+ const url = resp.url();+ if (ignore(url)) return;+ rec.bad.push({ url, status });+});++try {+ await page.goto(BASE + path, { waitUntil: 'domcontentloaded', timeout: 45000 });+} catch (e) {+ rec.pageerrors.push({ text: `goto failed: ${e.message.split('\n')[0]}`, stack: '' });+}+await page.waitForTimeout(6000);+await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight)).catch(() => {});+await page.waitForTimeout(2500);+await ctx.close();+await browser.close();++console.log(`\n${'='.repeat(70)}\n${label} (${path})`);+const total = rec.errors.length + rec.warnings.length + rec.pageerrors.length + rec.failed.length + rec.bad.length;+if (!total) { console.log(' CLEAN'); }+else {+ if (rec.pageerrors.length) { console.log(` PAGEERRORS (${rec.pageerrors.length}):`); rec.pageerrors.forEach((e) => console.log(` x ${e.text}\n ${e.stack}`)); }+ if (rec.errors.length) { console.log(` CONSOLE.ERROR (${rec.errors.length}):`); rec.errors.forEach((e) => console.log(` x ${e.text}\n @ ${e.where}`)); }+ if (rec.warnings.length) { console.log(` CONSOLE.WARN (${rec.warnings.length}):`); rec.warnings.forEach((e) => console.log(` ! ${e.text}\n @ ${e.where}`)); }+ if (rec.failed.length) { console.log(` REQUEST FAILED (${rec.failed.length}):`); rec.failed.forEach((e) => console.log(` x ${e.url} [${e.error}]`)); }+ if (rec.bad.length) { console.log(` HTTP >=400 (${rec.bad.length}):`); rec.bad.forEach((e) => console.log(` ${e.status} ${e.url}`)); }+}+console.log('ROUTE_DONE');+process.exit(0);diff --git a/scripts/orphan-audit.mjs b/scripts/orphan-audit.mjsnew file mode 100644index 000000000..a9afc34e8--- /dev/null+++ b/scripts/orphan-audit.mjs@@ -0,0 +1,161 @@+#!/usr/bin/env node+// Orphan & duplicate page audit (task A07).+//+// Cross-references every HTML file under pages/ and public/ against the Vite+// build inputs (vite.config.js) and the Vercel route table (vercel.json) to+// classify each file and flag broken routes.+//+// Build model (see vite.config.js):+// pages/<path>.html (a Rollup input) -> dist/pages/<path>.html -> flattened to dist/<path>.html+// pages/dashboard-next/*.html -> auto-discovered inputs (dn-<name>)+// public/** -> copied verbatim to dist/**+// A Vercel route `dest: /X.html` resolves only if dist/X.html exists, i.e. X is+// produced by a flattened pages input OR shipped as public/X.html.+//+// Usage: node scripts/orphan-audit.mjs (human summary)+// node scripts/orphan-audit.mjs --json (machine output)+// node scripts/orphan-audit.mjs --check (exit 1 if broken routes exist)++import { readFileSync, readdirSync, existsSync, statSync } from 'node:fs';+import { resolve, relative, dirname } from 'node:path';+import { fileURLToPath } from 'node:url';++const __dirname = dirname(fileURLToPath(import.meta.url));+const ROOT = resolve(__dirname, '..');+const r = (...p) => resolve(ROOT, ...p);++function walkHtml(dir) {+ const out = [];+ if (!existsSync(dir)) return out;+ for (const name of readdirSync(dir)) {+ const full = resolve(dir, name);+ const st = statSync(full);+ if (st.isDirectory()) {+ if (['node_modules', '.git', 'dist'].includes(name)) continue;+ out.push(...walkHtml(full));+ } else if (name.endsWith('.html')) {+ out.push(full);+ }+ }+ return out;+}++// --- 1. Enumerate every HTML file ---------------------------------------+const pagesFiles = walkHtml(r('pages')).map((f) => relative(ROOT, f));+const publicFiles = walkHtml(r('public')).map((f) => relative(ROOT, f));+const rootFiles = readdirSync(ROOT)+ .filter((f) => f.endsWith('.html'))+ .map((f) => f);++// --- 2. Parse Vite build inputs -----------------------------------------+const viteSrc = readFileSync(r('vite.config.js'), 'utf8');+// `resolve(__dirname, 'pages/<x>.html')` only ever appears in the rollup input+// map, so scanning the whole file is safe (the flatten/promote plugins use+// dist/ paths, never pages/*.html).+const inputPagePaths = new Set();+for (const m of viteSrc.matchAll(/resolve\(__dirname,\s*'(pages\/[^']+\.html)'\)/g)) {+ inputPagePaths.add(m[1]);+}+// Auto-discovered dashboard-next inputs.+for (const f of pagesFiles) {+ if (f.startsWith('pages/dashboard-next/') && f.endsWith('.html')) inputPagePaths.add(f);+}++// Flattened dist name for a pages input: drop the leading "pages/".+const flatten = (p) => p.replace(/^pages\//, '');+const builtDist = new Set([...inputPagePaths].map(flatten)); // e.g. "features/ar.html"++// Public files ship verbatim: dist path = path relative to public/.+const publicDist = new Set(publicFiles.map((f) => f.replace(/^public\//, '')));++// Build-time copied trees (vite.config closeBundle cpSync): docs/ -> dist/docs,+// blog/ -> dist/blog. These never live under pages/ or public/ but DO ship.+const copiedDist = new Set();+for (const top of ['docs', 'blog']) {+ for (const f of walkHtml(r(top))) copiedDist.add(`${top}/${relative(r(top), f)}`);+}++// Final set of HTML files that will exist in dist (keyed by dist-root-relative path).+const distHtml = new Set([...builtDist, ...publicDist, ...copiedDist]);+// Directory prefixes that have at least one backing dist file — used to validate+// parameterized ($1) route dests like /events/$1.html or /blog/$1.html.+const distDirs = new Set();+for (const f of distHtml) {+ const parts = f.split('/');+ for (let i = 1; i < parts.length; i++) distDirs.add(parts.slice(0, i).join('/'));+}++// --- 3. Parse Vercel routes ---------------------------------------------+const vercel = JSON.parse(readFileSync(r('vercel.json'), 'utf8'));+const routes = vercel.routes || [];+const brokenRoutes = []; // literal dest .html with no backing dist file+const dynamicRoutes = []; // parameterized ($n) dests, validated by directory+const htmlDestTargets = new Set(); // literal dist paths referenced by a route dest++for (const route of routes) {+ const dest = route.dest;+ if (!dest || typeof dest !== 'string') continue;+ // Only care about html destinations; strip query + leading slash.+ const destPath = dest.split('?')[0].replace(/^\//, '');+ if (!destPath.endsWith('.html')) continue;++ if (destPath.includes('$')) {+ // Parameterized dest (e.g. events/$1.html). Can't resolve the exact file,+ // so validate that the directory prefix ships at least one html file.+ const prefix = destPath.slice(0, destPath.indexOf('$')).replace(/\/$/, '');+ const dir = prefix.includes('/') ? prefix.slice(0, prefix.lastIndexOf('/')) : prefix;+ const ok = dir === '' || distDirs.has(dir) || distHtml.has(`${dir}.html`);+ dynamicRoutes.push({ src: route.src, dest, backed: ok });+ if (!ok) brokenRoutes.push({ src: route.src, dest, note: 'parameterized: no backing dir' });+ continue;+ }+ htmlDestTargets.add(destPath);+ if (!distHtml.has(destPath)) {+ brokenRoutes.push({ src: route.src, dest });+ }+}++// --- 4. Classify pages/ files -------------------------------------------+// A pages file is "built" if it's a Vite input; otherwise it never ships.+const orphanPages = pagesFiles.filter((f) => !inputPagePaths.has(f));+const builtPages = pagesFiles.filter((f) => inputPagePaths.has(f));++// --- 5. Routability of dist files ---------------------------------------+// cleanUrls: a dist file at <path>.html is reachable at /<path> and /<path>.html+// even without an explicit route, as long as it's not shadowed. We treat any+// dist html as reachable-by-path; explicit route presence is informational.+const builtPagesUnreferenced = [...builtDist].filter((d) => !htmlDestTargets.has(d));++const result = {+ counts: {+ pagesFiles: pagesFiles.length,+ publicFiles: publicFiles.length,+ rootFiles: rootFiles.length,+ viteInputs: inputPagePaths.size,+ distHtml: distHtml.size,+ routeHtmlDests: htmlDestTargets.size,+ dynamicRoutes: dynamicRoutes.length,+ },+ brokenRoutes,+ orphanPages, // pages/*.html NOT wired as a build input -> dead in prod+ rootFiles, // root *.html — should not exist per repo hygiene+ builtPagesUnreferenced, // built but no explicit vercel route (served via cleanUrls)+};++if (process.argv.includes('--json')) {+ console.log(JSON.stringify(result, null, 2));+} else {+ console.log('=== Orphan / duplicate page audit ===\n');+ console.log('Counts:', JSON.stringify(result.counts, null, 2));+ console.log(`\nBROKEN ROUTES (dest .html with no backing dist file): ${brokenRoutes.length}`);+ for (const b of brokenRoutes) console.log(` ${b.src} -> ${b.dest}`);+ console.log(`\nORPHAN pages/ files (not a build input, dead in prod): ${orphanPages.length}`);+ for (const f of orphanPages) console.log(` ${f}`);+ console.log(`\nROOT *.html (violate repo hygiene): ${rootFiles.length}`);+ for (const f of rootFiles) console.log(` ${f}`);+}++if (process.argv.includes('--check') && brokenRoutes.length) {+ console.error(`\n✗ ${brokenRoutes.length} broken route(s).`);+ process.exit(1);+}diff --git a/src/agent-detail.js b/src/agent-detail.jsindex d01fccce1..b310b036b 100644--- a/src/agent-detail.js+++ b/src/agent-detail.js@@ -29,6 +29,7 @@ import { onchainBadgeEl } from './shared/onchain-badge.js';import { mountValidationBadge } from './shared/validation-badge.js';import { seeInWorldHref, agentAvatarGlb } from './shared/agent-3d.js';import { renderError as renderAsyncError } from './shared/async-state.js';+import { skeletonHTML } from './shared/state-kit.js';import { openCoinLaunch } from './shared/agent-coin.js';import { Modal } from './shared/modal.js';import { showSharePanel } from './shared/share.js';@@ -837,6 +838,8 @@ async function loadReviews(agentId, agentRec) {const isOwner = !!agentRec?.user_id;+ body.innerHTML = skeletonHTML(2, 'text');+let data;try {const r = await fetch(`/api/marketplace/agents/${encodeURIComponent(agentId)}/reviews`, {@@ -846,7 +849,12 @@ async function loadReviews(agentId, agentRec) {const json = await r.json();data = json.data;} catch (e) {- body.innerHTML = `<div class="ad-reviews-error">Could not load reviews. Try refreshing.</div>`;+ renderAsyncError(+ body,+ e,+ { error: { title: 'Couldn’t load reviews', body: 'Check your connection and try again.' }, context: 'agent-detail:reviews' },+ () => loadReviews(agentId, agentRec),+ );return;}diff --git a/src/agent-home-pumpfun.js b/src/agent-home-pumpfun.jsindex 63da04274..b52b6261e 100644--- a/src/agent-home-pumpfun.js+++ b/src/agent-home-pumpfun.js@@ -130,7 +130,7 @@ export function mountPumpFunCard({ panel, identity, skills, memory, protocol })<label class="pumpfun-vanity-row" title="Grind a custom mint address ending in your suffix. The three.ws 3ws prefix is always stamped first."><input type="checkbox" data-action="toggle-vanity" ${state.vanityEnabled ? 'checked' : ''} ${isGrinding || isStamped ? 'disabled' : ''}><span>Custom suffix</span>- <input type="text" data-action="vanity-suffix" value="${escapeAttr(state.vanitySuffix)}" maxlength="6" ${state.vanityEnabled && !isGrinding && !isStamped ? '' : 'disabled'} class="pumpfun-vanity-input">+ <input type="text" data-action="vanity-suffix" value="${escapeAttr(state.vanitySuffix)}" maxlength="6" ${state.vanityEnabled && !isGrinding && !isStamped ? '' : 'disabled'} class="pumpfun-vanity-input" aria-label="Custom mint address suffix"></label><div class="pumpfun-stamp-live" role="status" aria-live="polite" aria-atomic="false" id="pf-stamp-live">${stampLabel}</div>${mintDisplay ? `<div class="pumpfun-stamp-success-mint" style="margin-bottom:4px"><div class="pf-mint-addr">${mintDisplay}</div></div>` : ''}diff --git a/src/agent-home.js b/src/agent-home.jsindex 73e11de3c..445602e1f 100644--- a/src/agent-home.js+++ b/src/agent-home.js@@ -87,7 +87,7 @@ export class AgentHome {panel.className = 'agent-home-panel';panel.innerHTML = `<div class="agent-home-identity">- <div class="agent-home-avatar-ring" id="agent-avatar-ring">+ <div class="agent-home-avatar-ring" id="agent-avatar-ring" aria-hidden="true"><div class="agent-home-avatar-inner" id="agent-avatar-inner"><span class="agent-home-avatar-emoji" id="agent-avatar-emoji">◎</span></div>@@ -108,19 +108,19 @@ export class AgentHome {${id.isRegistered? `- <span class="agent-home-badge erc8004" title="Registered on-chain (ERC-8004)">- <svg width="9" height="9" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>+ <span class="agent-home-badge erc8004" title="Registered on-chain (ERC-8004)" aria-label="Registered on-chain (ERC-8004)" role="img">+ <svg width="9" height="9" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg></span>`: ''}</div>- <div class="agent-home-status" id="agent-home-status">- <span class="agent-home-dot online"></span>+ <div class="agent-home-status" id="agent-home-status" role="status" aria-live="polite">+ <span class="agent-home-dot online" aria-hidden="true"></span><span id="agent-home-emotion-label">present</span><span class="agent-home-status-sep" aria-hidden="true">·</span>${id.walletAddress? `<span class="agent-home-address" id="agent-home-address">${_shortAddr(id.walletAddress)}</span>`- : `<button class="agent-home-address agent-home-address--cta" id="agent-home-address" title="Connect wallet to register on-chain">no wallet</button>`+ : `<button class="agent-home-address agent-home-address--cta" id="agent-home-address" type="button" title="Connect wallet to register on-chain" aria-label="Connect wallet to register on-chain">no wallet</button>`}</div><p@@ -134,11 +134,11 @@ export class AgentHome {aria-label="Agent description (editable)">${_esc(id.description || '')}</p></div>- <button class="agent-home-btn" id="agent-copy-link" title="Copy agent link">- <svg width="13" height="13" viewBox="0 0 24 24" fill="currentColor"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>+ <button class="agent-home-btn" id="agent-copy-link" type="button" title="Copy agent link" aria-label="Copy agent link">+ <svg width="13" height="13" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg></button>- <button class="agent-home-btn" id="agent-home-hide" title="Hide panel" aria-label="Hide agent panel">- <svg width="13" height="13" viewBox="0 0 24 24" fill="currentColor"><path d="M19 13H5v-2h14v2z"/></svg>+ <button class="agent-home-btn" id="agent-home-hide" type="button" title="Hide panel" aria-label="Hide agent panel">+ <svg width="13" height="13" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M19 13H5v-2h14v2z"/></svg></button></div>@@ -149,7 +149,7 @@ export class AgentHome {<summary class="agent-home-skills-summary"><span class="agent-home-skills-label">Skills</span><span class="agent-home-skills-count">${skills.length}</span>- <svg class="agent-home-chevron" width="10" height="10" viewBox="0 0 24 24" fill="currentColor"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z"/></svg>+ <svg class="agent-home-chevron" width="10" height="10" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z"/></svg></summary><div class="agent-home-skills-strip" id="agent-skills-strip">${skills.map((s) => `<span class="agent-skill-chip">${_esc(s)}</span>`).join('')}@@ -167,9 +167,9 @@ export class AgentHome {${this._renderMemoryBar()}</div>- <div class="agent-home-timeline" id="agent-timeline">+ <div class="agent-home-timeline" id="agent-timeline" role="log" aria-live="polite" aria-label="Agent activity log"><div class="agent-timeline-empty">- <svg class="agent-timeline-empty-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a6 6 0 0 0-4 10.5V15a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-2.5A6 6 0 0 0 12 2z"/><path d="M10 20h4"/><path d="M11 23h2"/></svg>+ <svg class="agent-timeline-empty-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M12 2a6 6 0 0 0-4 10.5V15a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-2.5A6 6 0 0 0 12 2z"/><path d="M10 20h4"/><path d="M11 23h2"/></svg><span class="agent-timeline-empty-title">Waiting for activity</span><span class="agent-timeline-empty-sub">Your agent's actions will log here once it starts working</span></div>@@ -487,7 +487,7 @@ export class AgentHome {nudge.className = 'agent-wallet-nudge';nudge.innerHTML =`<span class="agent-wallet-nudge-text">Connect wallet to register on-chain</span>` +- `<button class="agent-wallet-nudge-btn" id="agent-wallet-nudge-btn">Connect →</button>`;+ `<button class="agent-wallet-nudge-btn" id="agent-wallet-nudge-btn" type="button">Connect →</button>`;nudge.querySelector('#agent-wallet-nudge-btn').addEventListener('click', () => {document.dispatchEvent(new CustomEvent('agent-home:connect-wallet', { bubbles: true }));});@@ -551,7 +551,7 @@ export class AgentHome {const item = document.createElement('div');item.className = 'agent-timeline-item';item.innerHTML = `- <span class="agent-timeline-icon">${ACTION_ICONS[action.type] || ACTION_ICONS.default}</span>+ <span class="agent-timeline-icon" aria-hidden="true">${ACTION_ICONS[action.type] || ACTION_ICONS.default}</span><span class="agent-timeline-text">${_timelineText(action)}</span><span class="agent-timeline-time">${_relTime(action.timestamp)}</span>`;diff --git a/src/api-playground.js b/src/api-playground.jsindex 64176df20..9dba0f9f8 100644--- a/src/api-playground.js+++ b/src/api-playground.js@@ -168,9 +168,9 @@if (!ep) return;pgActive = key;- pgS.endpoints.querySelectorAll('.dev-api-row').forEach(function(r) { r.classList.remove('active'); });+ pgS.endpoints.querySelectorAll('.dev-api-row').forEach(function(r) { r.classList.remove('active'); r.setAttribute('aria-pressed', 'false'); });var row = pgS.endpoints.querySelector('[data-endpoint="' + key + '"]');- if (row) row.classList.add('active');+ if (row) { row.classList.add('active'); row.setAttribute('aria-pressed', 'true'); }pgS.empty.style.display = 'none';pgS.builder.style.display = 'block';@@ -183,7 +183,7 @@(ep.params || []).forEach(function(param) {var div = document.createElement('div');div.className = 'pg-field';- div.innerHTML = '<label class="pg-field-label">' + param.label + '</label><input class="pg-input" id="pg-param-' + param.key + '" placeholder="' + param.placeholder + '" value="' + param.default + '" />';+ div.innerHTML = '<label class="pg-field-label" for="pg-param-' + param.key + '">' + param.label + '</label><input class="pg-input" id="pg-param-' + param.key + '" placeholder="' + param.placeholder + '" value="' + param.default + '" />';pgS.params.appendChild(div);div.querySelector('input').addEventListener('input', function() {pgS.path.value = pgResolvePath(ep);diff --git a/src/app.js b/src/app.jsindex 7c8801f4a..2c78f6f5d 100644--- a/src/app.js+++ b/src/app.js@@ -322,28 +322,40 @@ class App {// /a/<chainId>/<agentId> — resolve an on-chain agent to its 3D avatar.if (options.onchain) {- this._loadOnChainAgent(options.onchain);+ this._loadOnChainAgent(options.onchain).catch((err) => {+ log.warn('[3d-agent] on-chain agent load failed', err);+ this._showViewerError("Couldn't load this agent.", () => this._retryAgentLoad());+ });this._initAgentSystem();return;}// Load a specific agent by ID: /#agent=<uuid> (embed mode)if (options.agent) {- this._loadAgent(options.agent);+ this._loadAgent(options.agent).catch((err) => {+ log.warn('[3d-agent] agent load failed', err);+ this._showViewerError("Couldn't load this agent.", () => this._retryAgentLoad());+ });return;}// /a/<uuid>?embed=1 — chromeless chat embed. Load the named agent;// NichAgent will initialize because kiosk is false.if (_chatEmbedId) {- this._loadAgent(_chatEmbedId);+ this._loadAgent(_chatEmbedId).catch((err) => {+ log.warn('[3d-agent] chat-embed agent load failed', err);+ this._showViewerError("Couldn't load this agent.", () => this._retryAgentLoad());+ });return;}// Load a saved widget by ID: /widget#widget=<wdgt_...> (slim shell,// canonical) or legacy /app#widget=<wdgt_...> (full SPA, still works).if (options.widget) {- this._loadWidget(options.widget);+ this._loadWidget(options.widget).catch((err) => {+ log.warn('[3d-agent] widget load failed', err);+ this._showViewerError("Couldn't load this widget.", () => this._retryAgentLoad());+ });this._initAgentSystem();this._initWidgetBridge();return;@@ -696,18 +708,31 @@ class App {wrap.hidden = false;+ const closeMenu = ({ restoreFocus = false } = {}) => {+ if (menu.hidden) return;+ menu.hidden = true;+ btn.setAttribute('aria-expanded', 'false');+ if (restoreFocus) btn.focus();+ };+btn.addEventListener('click', (e) => {e.stopPropagation();const open = menu.hidden === false;menu.hidden = open;btn.setAttribute('aria-expanded', String(!open));+ // Move focus to the first menu item when opening via keyboard/click+ // so keyboard users land inside the menu they just expanded.+ if (!open) {+ const first = menu.querySelector('a, button');+ if (first) requestAnimationFrame(() => first.focus());+ }});- document.addEventListener('click', () => {- if (!menu.hidden) {- menu.hidden = true;- btn.setAttribute('aria-expanded', 'false');- }+ document.addEventListener('click', () => closeMenu());++ // Escape closes the menu and returns focus to the trigger.+ document.addEventListener('keydown', (e) => {+ if (e.key === 'Escape') closeMenu({ restoreFocus: true });});menu.addEventListener('click', (e) => e.stopPropagation());@@ -1154,20 +1179,39 @@ class App {if (deployLink) deployLink.href = `/deploy?agent=${agentId}`;if (shareLink) shareLink.href = `/agent/${agentId}`;- const dismiss = () => {+ // Remember what had focus so we can restore it when the dialog closes.+ const prevFocus = document.activeElement;++ const dismiss = ({ restoreFocus = false } = {}) => {banner.hidden = true;+ banner.removeEventListener('keydown', onKeydown);try {localStorage.setItem(key, '1');} catch {}+ if (restoreFocus && prevFocus && typeof prevFocus.focus === 'function') {+ prevFocus.focus();+ }+ };++ // Escape closes the orientation dialog and restores focus to the trigger.+ const onKeydown = (e) => {+ if (e.key === 'Escape') {+ e.preventDefault();+ dismiss({ restoreFocus: true });+ }};+ banner.addEventListener('keydown', onKeydown);- if (closeBtn) closeBtn.addEventListener('click', dismiss);+ if (closeBtn) closeBtn.addEventListener('click', () => dismiss({ restoreFocus: true }));// Auto-dismiss when the user clicks any of the CTAs — they've engaged.[deployLink, shareLink].forEach((el) => {- if (el) el.addEventListener('click', dismiss);+ if (el) el.addEventListener('click', () => dismiss());});banner.hidden = false;+ // Move focus into the dialog so keyboard/screen-reader users are taken+ // to the freshly-revealed orientation message.+ if (closeBtn) requestAnimationFrame(() => closeBtn.focus());}async _loadWidget(widgetId) {@@ -1408,7 +1452,8 @@ class App {const el = document.createElement('div');el.style.cssText ='position:fixed;inset:0;display:grid;place-items:center;background:#0a0a0a;color:#e0e0e0;font-family:Inter,system-ui,sans-serif;text-align:center;padding:2rem;z-index:9999';- el.innerHTML = `<div><h1 style="font-weight:300;margin:0 0 0.5rem">Widget unavailable</h1><p style="opacity:0.7;margin:0">${message.replace(/[<>&"]/g, '')}</p><p style="margin-top:1.5rem"><a href="/" style="color:#ffffff">Open viewer</a> · <a href="/widgets" style="color:#ffffff">Browse gallery</a></p></div>`;+ el.setAttribute('role', 'alert');+ el.innerHTML = `<div><h2 style="font-weight:300;margin:0 0 0.5rem">Widget unavailable</h2><p style="opacity:0.7;margin:0">${message.replace(/[<>&"]/g, '')}</p><p style="margin-top:1.5rem"><a href="/" style="color:#ffffff">Open viewer</a> · <a href="/widgets" style="color:#ffffff">Browse gallery</a></p></div>`;document.body.appendChild(el);}diff --git a/src/create-agent.js b/src/create-agent.jsindex d42a6027b..1d60d7305 100644--- a/src/create-agent.js+++ b/src/create-agent.js@@ -499,6 +499,16 @@ function renderLibrary() {grid.innerHTML = note("Couldn't load your avatars. Pick a starter or upload instead — you can connect one later from the editor.",);+ const retry = document.createElement('button');+ retry.type = 'button';+ retry.className = 'lib-load-more';+ retry.style = 'grid-column:1/-1;margin-top:6px;padding:6px 12px;font-size:0.75rem;opacity:0.6;cursor:pointer;background:transparent;border:1px solid rgba(255,255,255,0.2);border-radius:6px;color:inherit;transition:opacity 0.15s';+ retry.textContent = 'Try again';+ retry.addEventListener('click', () => {+ libraryState = 'idle';+ loadLibraryAvatars();+ });+ grid.appendChild(retry);return;}if (!libraryAvatars.length) {diff --git a/src/create-review-features.js b/src/create-review-features.jsindex 9976ed7b4..ab46eabcc 100644--- a/src/create-review-features.js+++ b/src/create-review-features.js@@ -16,6 +16,56 @@ import { downloadAvatar } from './avatar-export.js';import { fbxFromBlob, downloadUrl } from './remesh-convert.js';import { log } from './shared/log.js';+// ── Live platform stats ──────────────────────────────────────────────────────++// Real, public network counts from /api/home-stats. That endpoint's contract is+// "real numbers or { available:false }" — it never fabricates — so callers that+// get null here must hide their metric strip rather than invent figures.+async function fetchPlatformStats() {+ try {+ const res = await fetch('/api/home-stats', { headers: { accept: 'application/json' } });+ if (!res.ok) return null;+ const data = await res.json();+ return data && data.available ? data : null;+ } catch (err) {+ log('[features] home-stats fetch failed:', err?.message || err);+ return null;+ }+}++// Compact human count: 1_204 → "1.2k", 2_000_000 → "2M".+function fmtCount(n) {+ const v = Number(n) || 0;+ if (v >= 1_000_000) return (v / 1_000_000).toFixed(v % 1_000_000 === 0 ? 0 : 1) + 'M';+ if (v >= 1_000) return (v / 1_000).toFixed(v % 1_000 === 0 ? 0 : 1) + 'k';+ return String(v);+}++// Compact USD for large figures: 3_435_701 → "$3.4M", 264_453 → "$264.5K".+function fmtUsd(n) {+ const v = Number(n);+ if (!Number.isFinite(v)) return null;+ if (v >= 1_000_000) return '$' + (v / 1_000_000).toFixed(1) + 'M';+ if (v >= 1_000) return '$' + (v / 1_000).toFixed(1) + 'K';+ return '$' + v.toFixed(2);+}++// Token price, which can be sub-cent: 0.003435 → "$0.003435", 12.5 → "$12.50".+function fmtPrice(n) {+ const v = Number(n);+ if (!Number.isFinite(v) || v <= 0) return null;+ if (v >= 1) return '$' + v.toFixed(2);+ // Show four significant digits below $1 so sub-cent prices stay legible.+ return '$' + v.toPrecision(4).replace(/0+$/, '').replace(/\.$/, '');+}++// Signed 24h percent: -14.14 → "-14.1%", 8 → "+8.0%".+function fmtPct(n) {+ const v = Number(n);+ if (!Number.isFinite(v)) return null;+ return (v >= 0 ? '+' : '') + v.toFixed(1) + '%';+}+// ── Feature-preview modal ────────────────────────────────────────────────────let activeModal = null;@@ -191,7 +241,22 @@ export async function toggleEmoteStrip({ scene, stripEl }) {// First call: populate the chips. Subsequent calls just toggle visibility.if (!emoteStripWired) {- await emotes.loadManifest();+ try {+ await emotes.loadManifest();+ } catch (err) {+ log.warn('[emote-strip] manifest load failed', err);+ // Don't leave a broken empty strip with no signal — show an inline+ // note, surface it, and bail. emoteStripWired stays false so a later+ // open retries the load.+ stripEl.innerHTML =+ `<span class="emote-strip-note" style="font-size:0.72rem;color:var(--muted);padding:0 8px;white-space:nowrap">Animations couldn't load. Try again in a moment.</span>` ++ `<button class="emote-strip-close" type="button" aria-label="Close animations">✕</button>`;+ stripEl.querySelector('.emote-strip-close')?.addEventListener('click', () => {+ stripEl.classList.remove('is-visible');+ });+ stripEl.classList.add('is-visible');+ return;+ }const present = new Set(emotes.getAllDefs().map((d) => d.name));const available = PREVIEW_EMOTES.filter((e) => present.has(e.name));stripEl.innerHTML =@@ -432,23 +497,23 @@ print(reply.json()) # {"reply": ..., "tx": "<sig>"}`,<div class="fm-pricing-preview"><div class="fm-pricing-head"><span class="fm-pricing-title">Skill pricing</span>- <span class="fm-pricing-pill">CONFIGURE AFTER SAVE</span>+ <span class="fm-pricing-pill">YOU SET THE PRICE</span></div><div class="fm-pricing-rows"><div class="fm-pricing-row"><span class="fm-pricing-skill">Chat</span>- <span class="fm-pricing-amount">$0.02 <span class="muted">USDC / call</span></span>+ <span class="fm-pricing-amount">$— <span class="muted">USDC / call</span></span></div><div class="fm-pricing-row"><span class="fm-pricing-skill">Render</span>- <span class="fm-pricing-amount">$0.10 <span class="muted">USDC / call</span></span>+ <span class="fm-pricing-amount">$— <span class="muted">USDC / call</span></span></div><div class="fm-pricing-row"><span class="fm-pricing-skill">Custom endpoint</span>- <span class="fm-pricing-amount">$0.05 <span class="muted">USDC / call</span></span>+ <span class="fm-pricing-amount">$— <span class="muted">USDC / call</span></span></div></div>- <div class="fm-pricing-foot">Earnings stream into your agent's wallet, withdrawable any time.</div>+ <div class="fm-pricing-foot">Set a per-call price for any skill after save. Earnings stream into your agent's wallet, withdrawable any time.</div></div><div class="fm-tabs" role="tablist" aria-label="Client language">@@ -606,7 +671,11 @@ export default function Page() {if (sourceCanvas) {try {sourceCanvas.toBlob((b) => {- if (!b) return;+ if (!b) {+ // Snapshot failed — don't leave the "Rendering…" spinner stuck.+ skel.textContent = 'Preview will render here once your avatar is loaded.';+ return;+ }shot.src = URL.createObjectURL(b);shot.hidden = false;skel.hidden = true;@@ -735,65 +804,69 @@ function prettyBytes(n) {export function openReputationModal(ctx = {}) {const handle = slugify(ctx.name) || 'your-agent';- // Sample reviews — clearly labelled as such ("EXAMPLE" pill on the card).- // Structure mirrors src/reputation-ui.js so the user sees the actual- // production shape (truncated reviewer address, stars, comment, tx link).- const sample = [- { author: '7xK…aN4q', stars: 5, comment: 'Sharp at SQL — saved me an hour on a gnarly join.', when: '2d ago' },- { author: '9mR…vT8p', stars: 5, comment: 'Voice felt natural over a 30-min call. Recommend.', when: '5d ago' },- { author: 'Bcj…F2zL', stars: 4, comment: 'Solid embed, easy to drop on our docs site.', when: '1w ago' },- ];- const reviewsHtml = sample- .map(- (r) => `- <div class="rep-review-item">- <div class="rep-review-header">- <span class="rep-review-author">${escapeHtml(r.author)}</span>- <span class="rep-stars" aria-label="${r.stars} stars">${'★'.repeat(r.stars)}${'☆'.repeat(5 - r.stars)}</span>+ // Real network reputation: the rep card shows live, platform-wide on-chain+ // reputation scale (signed attestations across registered agents) pulled from+ // /api/home-stats — never fabricated reviews or invented star ratings. Numbers+ // stream in after open; the strip collapses to a copy-only state if the DB is+ // unreachable, so the user never sees made-up figures.+ const body = document.createElement('div');+ body.innerHTML = `+ <ul class="fm-bullets">+ <li>Every paid call is logged with a signed receipt — verifiable, non-repudiable.</li>+ <li>Reviews carry the reviewer's own reputation weight — Sybil-resistant.</li>+ <li>Validators can attest to capability (e.g. "ships valid SQL 9.6/10 of the time").</li>+ </ul>++ <div class="rep-card">+ <div class="rep-card-head">+ <div>+ <strong>${escapeHtml(handle)}</strong>+ <div class="muted">three.ws/@${escapeHtml(handle)}</div>+ </div>+ <span class="rep-sample-pill" data-rep-pill hidden>LIVE</span></div>- <p class="rep-comment">${escapeHtml(r.comment)}</p>- <div class="rep-review-footer">- <span class="muted">${escapeHtml(r.when)}</span>- <span class="rep-link">↗ tx</span>+ <div class="rep-stats" data-rep-stats aria-busy="true">+ <div><strong class="rep-stat-big" data-stat="attestations">—</strong><span class="muted">on-chain attestations</span></div>+ <div><strong data-stat="onchain_agents">—</strong><span class="muted">agents with passports</span></div>+ <div><strong data-stat="chains">—</strong><span class="muted">chains</span></div></div>+ <p class="rep-card-foot muted" data-rep-foot>Loading live network reputation…</p></div>- `,- )- .join('');++ <p class="fm-note">Your starting rep is empty — every paid call and review accrues to your asset, on-chain, and travels with it if you ever transfer.</p>+ `;openFeatureModal({icon: '⭐',title: 'Reputation',lede: 'Signed feedback, call history, and validation events accrue to your agent — public, verifiable, portable.',- body: `- <ul class="fm-bullets">- <li>Every paid call is logged with a signed receipt — verifiable, non-repudiable.</li>- <li>Reviews carry the reviewer's own reputation weight — Sybil-resistant.</li>- <li>Validators can attest to capability (e.g. "ships valid SQL 9.6/10 of the time").</li>- </ul>-- <div class="rep-card">- <div class="rep-card-head">- <div>- <strong>${escapeHtml(handle)}</strong>- <div class="muted">three.ws/@${escapeHtml(handle)}</div>- </div>- <span class="rep-sample-pill">EXAMPLE</span>- </div>- <div class="rep-stats">- <div><strong class="rep-stat-big">4.8</strong><span class="rep-stars">★★★★★</span><span class="muted">37 reviews</span></div>- <div><strong>1,204</strong><span class="muted">paid calls</span></div>- <div><strong>0.41 SOL</strong><span class="muted">staked on rep</span></div>- </div>- <div class="rep-reviews">${reviewsHtml}</div>- </div>-- <p class="fm-note">Your starting rep is empty — every paid call and review accrues to your asset, on-chain, and travels with it if you ever transfer.</p>- `,+ body,actions: [{ label: 'Got it' }],dialogClass: 'fm-dialog--wide',});++ fetchPlatformStats().then((stats) => {+ const statsRow = body.querySelector('[data-rep-stats]');+ const foot = body.querySelector('[data-rep-foot]');+ if (!stats) {+ // No real numbers available — drop the metric strip rather than fake it.+ statsRow?.remove();+ if (foot) foot.textContent = 'Reputation accrues on-chain from your first paid call and review — public and portable.';+ return;+ }+ const set = (key, val) => {+ const el = body.querySelector(`[data-stat="${key}"]`);+ if (el) el.textContent = val;+ };+ set('attestations', fmtCount(stats.attestations));+ set('onchain_agents', fmtCount(stats.onchain_agents));+ set('chains', fmtCount(stats.chains));+ statsRow?.setAttribute('aria-busy', 'false');+ const pill = body.querySelector('[data-rep-pill]');+ if (pill) pill.hidden = false;+ if (foot) foot.textContent = `Live across the three.ws network — ${fmtCount(stats.attestations)} signed attestations and counting.`;+ });}// ── Voice Library modal ─────────────────────────────────────────────────────@@ -920,94 +993,150 @@ export function openMocapModal() {// ── Token Launch modal ──────────────────────────────────────────────────────export function openTokenLaunchModal() {+ // The KPI strip shows the LIVE $THREE market — the platform's own pump.fun+ // token (mint FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump) — so the user sees+ // a real launched-token dashboard, not invented figures. Pulled from+ // /api/three-token/stats; the strip collapses if the market feed is down.+ const body = document.createElement('div');+ body.innerHTML = `+ <ul class="fm-bullets">+ <li>One-click token launch on pump.fun, tied to your agent's on-chain identity and wallet.</li>+ <li>Vanity mint grinding — pick a custom suffix for your token's Solana address.</li>+ <li>Live dashboard with price, holders, volume, bonding curve progress, and full trade history.</li>+ <li>Inline trade panel on your agent's page — visitors can buy and sell without leaving.</li>+ </ul>+ <div class="fm-kpi-row" data-token-row aria-label="Live $THREE market" aria-busy="true">+ <div class="fm-kpi" data-token-cell="price" hidden>+ <span class="fm-kpi-value" data-token="price">—</span>+ <span class="fm-kpi-label">$THREE price</span>+ </div>+ <div class="fm-kpi" data-token-cell="change" hidden>+ <span class="fm-kpi-value" data-token="change">—</span>+ <span class="fm-kpi-label">24h</span>+ </div>+ <div class="fm-kpi" data-token-cell="mcap" hidden>+ <span class="fm-kpi-value" data-token="mcap">—</span>+ <span class="fm-kpi-label">Market cap</span>+ </div>+ <div class="fm-kpi" data-token-cell="vol" hidden>+ <span class="fm-kpi-value" data-token="vol">—</span>+ <span class="fm-kpi-label">Volume 24h</span>+ </div>+ </div>+ <p class="fm-note" data-token-note>Live $THREE market — a real token launched through three.ws. Your own token launches from your agent's dashboard after save, with the same live dashboard.</p>+ `;+openFeatureModal({icon: '🪙',title: 'Token Launch',lede: 'Your agent can launch a pump.fun token in one click — bonding curve, live stats, trade panel, all wired in.',- body: `- <ul class="fm-bullets">- <li>One-click token launch on pump.fun, tied to your agent's on-chain identity and wallet.</li>- <li>Vanity mint grinding — pick a custom suffix for your token's Solana address.</li>- <li>Live dashboard with price, holders, volume, bonding curve progress, and full trade history.</li>- <li>Inline trade panel on your agent's page — visitors can buy and sell without leaving.</li>- </ul>- <div class="fm-kpi-row" aria-label="Sample token stats">- <div class="fm-kpi">- <span class="fm-kpi-value">$0.0042</span>- <span class="fm-kpi-label">Price</span>- </div>- <div class="fm-kpi">- <span class="fm-kpi-value">847</span>- <span class="fm-kpi-label">Holders</span>- </div>- <div class="fm-kpi">- <span class="fm-kpi-value">23.4%</span>- <span class="fm-kpi-label">Bonding</span>- </div>- <div class="fm-kpi">- <span class="fm-kpi-value">$12.8K</span>- <span class="fm-kpi-label">Volume</span>- </div>- </div>- <p class="fm-note">Token launch is available from your agent's dashboard after save. Stats update in real time. Numbers above are illustrative.</p>- `,+ body,actions: [{ label: 'Got it' }],});++ fetchThreeTokenStats().then((token) => {+ const row = body.querySelector('[data-token-row]');+ if (!token) {+ row?.remove();+ const note = body.querySelector('[data-token-note]');+ if (note) note.textContent = 'Token launch runs from your agent\'s dashboard after save — bonding curve, live price/volume/holders dashboard, and an inline trade panel, all wired in.';+ return;+ }+ // Each cell only appears if its underlying value is real (e.g. holders is+ // often null from the market source) — never a fabricated placeholder.+ const show = (cell, key, val) => {+ if (val == null) return;+ const valEl = body.querySelector(`[data-token="${key}"]`);+ const cellEl = body.querySelector(`[data-token-cell="${cell}"]`);+ if (valEl) valEl.textContent = val;+ if (cellEl) cellEl.hidden = false;+ };+ show('price', 'price', fmtPrice(token.price_usd));+ show('change', 'change', fmtPct(token.price_change_24h));+ show('mcap', 'mcap', fmtUsd(token.market_cap));+ show('vol', 'vol', fmtUsd(token.volume_24h));+ row?.setAttribute('aria-busy', 'false');+ // If the feed returned but every field was null, drop the empty strip.+ if (!body.querySelector('[data-token-cell]:not([hidden])')) row?.remove();+ });+}++// Live $THREE market data from /api/three-token/stats. Returns the token block+// or null on failure — callers must not fabricate figures when null.+async function fetchThreeTokenStats() {+ try {+ const res = await fetch('/api/three-token/stats', { headers: { accept: 'application/json' } });+ if (!res.ok) return null;+ const data = await res.json();+ return data && data.token ? data.token : null;+ } catch (err) {+ log('[features] three-token stats fetch failed:', err?.message || err);+ return null;+ }}// ── Analytics modal ─────────────────────────────────────────────────────────export function openAnalyticsModal() {+ // KPI strip shows REAL, live platform-wide numbers from /api/home-stats — not+ // fabricated per-agent revenue/views. The bullets describe what the user's own+ // dashboard tracks once their agent is live; the strip collapses if the stats+ // endpoint is unreachable so we never render invented figures.+ const body = document.createElement('div');+ body.innerHTML = `+ <ul class="fm-bullets">+ <li>Revenue dashboard: net earnings, payment count, top skills by revenue, withdrawal history.</li>+ <li>Engagement metrics: widget views, transcript count, embed reach, and a real-time visitor activity feed.</li>+ <li>Per-tool usage: MCP call volume, latency percentiles, success rate, and top callers.</li>+ </ul>+ <div class="fm-kpi-row" data-stats-row aria-label="Live platform metrics" aria-busy="true">+ <div class="fm-kpi">+ <span class="fm-kpi-value" data-stat="agents">—</span>+ <span class="fm-kpi-label">Agents</span>+ </div>+ <div class="fm-kpi">+ <span class="fm-kpi-value" data-stat="onchain_agents">—</span>+ <span class="fm-kpi-label">On-chain</span>+ </div>+ <div class="fm-kpi">+ <span class="fm-kpi-value" data-stat="widgets">—</span>+ <span class="fm-kpi-label">Widgets</span>+ </div>+ <div class="fm-kpi">+ <span class="fm-kpi-value" data-stat="attestations">—</span>+ <span class="fm-kpi-label">Attestations</span>+ </div>+ </div>+ <p class="fm-note" data-stats-note>Live three.ws platform metrics. Your own dashboard populates the moment your agent goes live — every API call, widget load, and voice session tracked in real time.</p>+ `;+openFeatureModal({icon: '📊',title: 'Analytics',lede: 'Revenue, engagement, and usage — tracked automatically from day one.',- body: `- <ul class="fm-bullets">- <li>Revenue dashboard: net earnings, payment count, top skills by revenue, withdrawal history.</li>- <li>Engagement metrics: widget views, transcript count, embed reach, and a real-time visitor activity feed.</li>- <li>Per-tool usage: MCP call volume, latency percentiles, success rate, and top callers.</li>- </ul>- <div class="fm-kpi-row" aria-label="Sample dashboard KPIs">- <div class="fm-kpi">- <span class="fm-kpi-value">$482</span>- <span class="fm-kpi-label">Revenue (30d)</span>- </div>- <div class="fm-kpi">- <span class="fm-kpi-value">3,291</span>- <span class="fm-kpi-label">Views</span>- </div>- <div class="fm-kpi">- <span class="fm-kpi-value">156</span>- <span class="fm-kpi-label">Transcripts</span>- </div>- <div class="fm-kpi">- <span class="fm-kpi-value">12</span>- <span class="fm-kpi-label">Widgets</span>- </div>- </div>- <div class="fm-activity-feed" aria-label="Sample activity feed">- <div class="fm-activity-item">- <span class="fm-activity-dot" style="background:var(--text)"></span>- <span class="fm-activity-text">Paid API call from <code>9mR…vT8p</code> — $0.05 USDC</span>- <span class="fm-activity-time">2m ago</span>- </div>- <div class="fm-activity-item">- <span class="fm-activity-dot" style="background:var(--muted)"></span>- <span class="fm-activity-text">Widget embed loaded on <code>docs.example.com</code></span>- <span class="fm-activity-time">8m ago</span>- </div>- <div class="fm-activity-item">- <span class="fm-activity-dot" style="background:var(--accent)"></span>- <span class="fm-activity-text">Voice session completed — 4m 12s, 8 turns</span>- <span class="fm-activity-time">23m ago</span>- </div>- </div>- <p class="fm-note">Your dashboard populates the moment your agent goes live — every API call, widget load, and voice session is tracked. Sample data above is illustrative.</p>- `,+ body,actions: [{ label: 'Got it' }],dialogClass: 'fm-dialog--wide',});++ fetchPlatformStats().then((stats) => {+ const row = body.querySelector('[data-stats-row]');+ if (!stats) {+ row?.remove();+ const note = body.querySelector('[data-stats-note]');+ if (note) note.textContent = 'Your dashboard populates the moment your agent goes live — every API call, widget load, and voice session is tracked in real time.';+ return;+ }+ const set = (key, val) => {+ const el = body.querySelector(`[data-stat="${key}"]`);+ if (el) el.textContent = val;+ };+ set('agents', fmtCount(stats.agents));+ set('onchain_agents', fmtCount(stats.onchain_agents));+ set('widgets', fmtCount(stats.widgets));+ set('attestations', fmtCount(stats.attestations));+ row?.setAttribute('aria-busy', 'false');+ });}// ── Widgets modal ───────────────────────────────────────────────────────────diff --git a/src/create-review.js b/src/create-review.jsindex 76a87c044..581b91287 100644--- a/src/create-review.js+++ b/src/create-review.js@@ -688,11 +688,16 @@ async function captureAndUploadThumbnail(avatarId) {reader.readAsDataURL(blob);});+ // Non-critical poster — never let a failed upload surface as an unhandled+ // rejection. Callers also wrap in .catch(), but guard here so the function+ // is self-contained and safe to call bare.await fetch('/api/avatars/thumbnail', {method: 'POST',credentials: 'include',headers: { 'content-type': 'application/json' },body: JSON.stringify({ avatar_id: avatarId, png_base64: dataUrl }),+ }).catch((err) => {+ console.warn('[create-review] thumbnail upload failed (non-critical)', err);});}diff --git a/src/dashboard-next/components/drawer.js b/src/dashboard-next/components/drawer.jsindex 5aea71e59..25d1a0e2f 100644--- a/src/dashboard-next/components/drawer.js+++ b/src/dashboard-next/components/drawer.js@@ -283,11 +283,22 @@ export function mountDrawerBehavior(shellEl) {renderList();});- state.listEl.addEventListener('click', (e) => {- const row = e.target.closest('.dnd-row');- if (!row) return;+ const toggleRow = (row) => {const expanded = row.getAttribute('aria-expanded') === 'true';row.setAttribute('aria-expanded', expanded ? 'false' : 'true');+ };+ state.listEl.addEventListener('click', (e) => {+ // Let links inside the detail panel navigate normally.+ if (e.target.closest('a')) return;+ const row = e.target.closest('.dnd-row');+ if (row) toggleRow(row);+ });+ state.listEl.addEventListener('keydown', (e) => {+ if (e.key !== 'Enter' && e.key !== ' ' && e.key !== 'Spacebar') return;+ const row = e.target.closest('.dnd-row');+ if (!row || e.target.closest('a')) return;+ e.preventDefault();+ toggleRow(row);});window.addEventListener('dn:drawer:toggled', (e) => {@@ -590,7 +601,7 @@ function renderRow(ev) {const fresh = ev.__fresh ? '1' : '0';const read = ev.read ? '1' : '0';return `- <div class="dnd-row" role="article" aria-expanded="false" data-id="${esc(ev.id)}" data-fresh="${fresh}" data-read="${read}">+ <div class="dnd-row" role="button" tabindex="0" aria-expanded="false" aria-label="${esc(detail.title)} — activate to show details" data-id="${esc(ev.id)}" data-fresh="${fresh}" data-read="${read}"><span class="dnd-row-icon" style="color:${colour};background:rgba(255,255,255,0.03)">${icon}</span><div class="dnd-row-body"><div class="dnd-row-title">${esc(detail.title)}</div>diff --git a/src/dashboard-next/components/sidebar.js b/src/dashboard-next/components/sidebar.jsindex caf56491b..2caa0b055 100644--- a/src/dashboard-next/components/sidebar.js+++ b/src/dashboard-next/components/sidebar.js@@ -49,7 +49,7 @@ export function renderSidebar(pathname) {${groups}</nav><div class="dn-rail-foot">- <button type="button" class="dn-rail-item" data-action="rail-collapse" title="Collapse sidebar">+ <button type="button" class="dn-rail-item" data-action="rail-collapse" title="Collapse sidebar" aria-label="Collapse sidebar" aria-expanded="true"><span class="dn-rail-item-icon" aria-hidden="true"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5l-5 5 5 5"/></svg></span>@@ -65,13 +65,24 @@ export function mountSidebarBehavior(shellEl) {try { return localStorage.getItem(STORAGE_KEY) === '1'; }catch { return false; }})();+ const syncCollapseAria = (isCollapsed) => {+ const btn = shellEl.querySelector('[data-action="rail-collapse"]');+ if (!btn) return;+ // aria-expanded reflects the rail's expanded state: collapsed === not expanded.+ btn.setAttribute('aria-expanded', isCollapsed ? 'false' : 'true');+ btn.setAttribute('aria-label', isCollapsed ? 'Expand sidebar' : 'Collapse sidebar');+ btn.setAttribute('title', isCollapsed ? 'Expand sidebar' : 'Collapse sidebar');+ };+if (collapsed) shellEl.setAttribute('data-rail-collapsed', 'true');+ syncCollapseAria(collapsed);shellEl.addEventListener('click', (e) => {const btn = e.target.closest?.('[data-action="rail-collapse"]');if (!btn) return;const next = shellEl.getAttribute('data-rail-collapsed') !== 'true';shellEl.setAttribute('data-rail-collapsed', next ? 'true' : 'false');+ syncCollapseAria(next);try { localStorage.setItem(STORAGE_KEY, next ? '1' : '0'); }catch { /* private mode — ignore */ }});@@ -101,7 +112,7 @@ export function renderMobileNav(pathname) {</a>`;}).join('');const moreActive = SHEET_ROUTES.some((r) => r.path === here) ? ' active' : '';- const moreBtn = `<button type="button" class="dn-rail-mobile-slot${moreActive}" data-action="mobile-more" aria-haspopup="true">+ const moreBtn = `<button type="button" class="dn-rail-mobile-slot${moreActive}" data-action="mobile-more" aria-haspopup="dialog" aria-expanded="false" aria-label="More navigation"><span aria-hidden="true">${MORE_ICON}</span><span class="dn-rail-mobile-label">More</span></button>`;@@ -117,15 +128,20 @@ export function mountMobileNavBehavior(shellEl, pathname) {${renderMobileNav(pathname)}<div class="dn-rail-foot" style="display:none"></div>`;- rail.querySelector('[data-action="mobile-more"]')?.addEventListener('click', openSheet);+ rail.querySelector('[data-action="mobile-more"]')?.addEventListener('click', (e) => openSheet(e.currentTarget));}-function openSheet() {+function openSheet(trigger) {const here = currentRoute(location.pathname)?.path;+ const lastFocused = trigger || document.activeElement;+ if (trigger) trigger.setAttribute('aria-expanded', 'true');const backdrop = document.createElement('div');backdrop.className = 'dn-mobile-sheet-backdrop';const sheet = document.createElement('div');sheet.className = 'dn-mobile-sheet';+ sheet.setAttribute('role', 'dialog');+ sheet.setAttribute('aria-modal', 'true');+ sheet.setAttribute('aria-label', 'More navigation');sheet.innerHTML = `<div class="dn-mobile-sheet-handle" aria-hidden="true"></div>${SHEET_ROUTES.map((r) => `<a href="${esc(r.path)}" class="dn-mobile-sheet-item"${r.path === here ? ' aria-current="page"' : ''}>@@ -144,16 +160,39 @@ function openSheet() {`;document.body.appendChild(backdrop);document.body.appendChild(sheet);- requestAnimationFrame(() => sheet.classList.add('open'));+ requestAnimationFrame(() => {+ sheet.classList.add('open');+ sheet.querySelector('a, button')?.focus();+ });++ const focusables = () => [...sheet.querySelectorAll('a[href], button:not([disabled])')];let closed = false;- const onKey = (e) => { if (e.key === 'Escape') close(); };+ const onKey = (e) => {+ if (e.key === 'Escape') { close(); return; }+ if (e.key === 'Tab') {+ // Trap focus within the sheet while it's open.+ const items = focusables();+ if (!items.length) return;+ const first = items[0];+ const last = items[items.length - 1];+ if (e.shiftKey && document.activeElement === first) {+ e.preventDefault(); last.focus();+ } else if (!e.shiftKey && document.activeElement === last) {+ e.preventDefault(); first.focus();+ }+ }+ };const close = () => {if (closed) return;closed = true;sheet.classList.remove('open');backdrop.style.opacity = '0';window.removeEventListener('keydown', onKey);+ if (trigger) trigger.setAttribute('aria-expanded', 'false');+ if (lastFocused && typeof lastFocused.focus === 'function') {+ try { lastFocused.focus(); } catch { /* element gone */ }+ }setTimeout(() => { sheet.remove(); backdrop.remove(); }, 260);};diff --git a/src/dashboard-next/components/topbar.js b/src/dashboard-next/components/topbar.jsindex 2e006d498..7649a5f00 100644--- a/src/dashboard-next/components/topbar.js+++ b/src/dashboard-next/components/topbar.js@@ -28,7 +28,7 @@ export function renderTopbar(pathname) {</span><kbd>⌘K</kbd></button>- <button type="button" class="dn-topbar-btn" data-action="toggle-notifs" aria-label="Notifications" style="position:relative">+ <button type="button" class="dn-topbar-btn" data-action="toggle-notifs" aria-label="Notifications" aria-haspopup="menu" aria-expanded="false" style="position:relative"><svg width="16" height="16" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M10 2a6 6 0 016 6v3l1.5 2.5H2.5L4 11V8a6 6 0 016-6z"/><path d="M8 17a2 2 0 004 0"/></svg><span data-slot="notif-badge" style="display:none;position:absolute;top:2px;right:2px;@@ -40,11 +40,11 @@ export function renderTopbar(pathname) {<button type="button" class="dn-topbar-btn" data-action="toggle-drawer" aria-label="Toggle activity drawer" aria-pressed="false"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="3"/><path d="M8 1v2M8 13v2M1 8h2M13 8h2M3.2 3.2l1.4 1.4M11.4 11.4l1.4 1.4M3.2 12.8l1.4-1.4M11.4 4.6l1.4-1.4"/></svg></button>- <div class="dn-topbar-user" data-action="toggle-user-menu" data-component="topbar-user" aria-haspopup="true">- <div class="dn-topbar-user-avatar" data-slot="initials">··</div>+ <button type="button" class="dn-topbar-user" data-action="toggle-user-menu" data-component="topbar-user" aria-haspopup="menu" aria-expanded="false" aria-label="Account menu">+ <span class="dn-topbar-user-avatar" data-slot="initials" aria-hidden="true">··</span><span data-slot="label">Loading…</span>- <svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M2 4l4 4 4-4"/></svg>- </div>+ <svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" aria-hidden="true"><path d="M2 4l4 4 4-4"/></svg>+ </button></header>`;}@@ -140,11 +140,14 @@ function setDrawerOpen(shellEl, open) {function toggleNotifsDropdown(btn) {const existing = document.querySelector('[data-topbar-notifs]');- if (existing) { existing.remove(); return; }+ if (existing) { closeNotifsDropdown(existing, btn); return; }const rect = btn.getBoundingClientRect();const drop = document.createElement('div');drop.setAttribute('data-topbar-notifs', '');+ drop.setAttribute('role', 'dialog');+ drop.setAttribute('aria-label', 'Notifications');+ btn.setAttribute('aria-expanded', 'true');drop.style.cssText = `position:fixed;top:${rect.bottom + 8}px;right:${window.innerWidth - rect.right}px;width:320px;max-height:420px;overflow-y:auto;@@ -165,11 +168,20 @@ function toggleNotifsDropdown(btn) {const closeOnOutside = (e) => {if (!drop.contains(e.target) && e.target !== btn) {- drop.remove();- document.removeEventListener('click', closeOnOutside, true);+ closeNotifsDropdown(drop, btn, closeOnOutside, onKey);+ }+ };+ const onKey = (e) => {+ if (e.key === 'Escape') {+ e.stopPropagation();+ closeNotifsDropdown(drop, btn, closeOnOutside, onKey);+ btn.focus();}};- setTimeout(() => document.addEventListener('click', closeOnOutside, true), 0);+ setTimeout(() => {+ document.addEventListener('click', closeOnOutside, true);+ document.addEventListener('keydown', onKey, true);+ }, 0);fetch('/api/notifications?limit=10', { credentials: 'include' }).then((r) => r.ok ? r.json() : null)@@ -194,17 +206,27 @@ function toggleNotifsDropdown(btn) {});}+function closeNotifsDropdown(drop, btn, onOutside, onKey) {+ drop.remove();+ if (btn) btn.setAttribute('aria-expanded', 'false');+ if (onOutside) document.removeEventListener('click', onOutside, true);+ if (onKey) document.removeEventListener('keydown', onKey, true);+}+// ── User menu popover ──────────────────────────────────────────────────────function toggleUserMenu(chip) {const existing = document.querySelector('[data-topbar-user-menu]');- if (existing) { existing.remove(); return; }+ if (existing) { closeUserMenu(existing, chip); return; }const rect = chip.getBoundingClientRect();const rawMe = chip.dataset.me ? JSON.parse(chip.dataset.me) : {};+ chip.setAttribute('aria-expanded', 'true');const menu = document.createElement('div');menu.setAttribute('data-topbar-user-menu', '');+ menu.setAttribute('role', 'menu');+ menu.setAttribute('aria-label', 'Account menu');menu.style.cssText = `position:fixed;top:${rect.bottom + 8}px;right:${window.innerWidth - rect.right}px;min-width:240px;@@ -226,30 +248,32 @@ function toggleUserMenu(chip) {<div style="margin-top:6px"><span class="dn-tag" style="font-size:11px;text-transform:capitalize">${esc(plan)}</span></div></div><div style="padding:6px 0">- <a href="/dashboard/portfolio" class="dn-user-menu-item">Portfolio & NFTs</a>- <a href="/dashboard/account" class="dn-user-menu-item">Account</a>- <a href="/dashboard/settings" class="dn-user-menu-item">Settings</a>- ${wallet ? `<button class="dn-user-menu-item" data-action="copy-wallet" style="width:100%;text-align:left;background:none;border:none;cursor:pointer;color:inherit">Copy wallet address</button>` : ''}- ${email ? `<button class="dn-user-menu-item" data-action="copy-email" style="width:100%;text-align:left;background:none;border:none;cursor:pointer;color:inherit">Copy email</button>` : ''}+ <a href="/dashboard/portfolio" class="dn-user-menu-item" role="menuitem">Portfolio & NFTs</a>+ <a href="/dashboard/account" class="dn-user-menu-item" role="menuitem">Account</a>+ <a href="/dashboard/settings" class="dn-user-menu-item" role="menuitem">Settings</a>+ ${wallet ? `<button type="button" role="menuitem" class="dn-user-menu-item" data-action="copy-wallet" style="width:100%;text-align:left;background:none;border:none;cursor:pointer;color:inherit">Copy wallet address</button>` : ''}+ ${email ? `<button type="button" role="menuitem" class="dn-user-menu-item" data-action="copy-email" style="width:100%;text-align:left;background:none;border:none;cursor:pointer;color:inherit">Copy email</button>` : ''}</div><div style="padding:6px 0;border-top:1px solid var(--nxt-stroke)">- <button class="dn-user-menu-item danger" data-action="sign-out" style="width:100%;text-align:left;background:none;border:none;cursor:pointer">Sign out</button>+ <button type="button" role="menuitem" class="dn-user-menu-item danger" data-action="sign-out" style="width:100%;text-align:left;background:none;border:none;cursor:pointer">Sign out</button></div>`;injectMenuStyles();document.body.appendChild(menu);+ // Move focus into the menu so keyboard users land on the first item.+ requestAnimationFrame(() => menu.querySelector('[role="menuitem"]')?.focus());menu.querySelector('[data-action="copy-wallet"]')?.addEventListener('click', async () => {try { await navigator.clipboard.writeText(wallet); } catch { /* ignore */ }- menu.remove();+ closeUserMenu(menu, chip, closeOnOutside, onKey);});menu.querySelector('[data-action="copy-email"]')?.addEventListener('click', async () => {try { await navigator.clipboard.writeText(email); } catch { /* ignore */ }- menu.remove();+ closeUserMenu(menu, chip, closeOnOutside, onKey);});menu.querySelector('[data-action="sign-out"]')?.addEventListener('click', async () => {- menu.remove();+ closeUserMenu(menu, chip, closeOnOutside, onKey);try { await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' }); }catch { /* best effort */ }location.href = '/';@@ -257,11 +281,36 @@ function toggleUserMenu(chip) {const closeOnOutside = (e) => {if (!menu.contains(e.target) && !chip.contains(e.target)) {- menu.remove();- document.removeEventListener('click', closeOnOutside, true);+ closeUserMenu(menu, chip, closeOnOutside, onKey);}};- setTimeout(() => document.addEventListener('click', closeOnOutside, true), 0);+ // Keyboard: Escape closes (focus returns to the chip); arrow keys roam items.+ const onKey = (e) => {+ const items = [...menu.querySelectorAll('[role="menuitem"]')];+ if (e.key === 'Escape') {+ e.stopPropagation();+ closeUserMenu(menu, chip, closeOnOutside, onKey);+ chip.focus();+ } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {+ e.preventDefault();+ const idx = items.indexOf(document.activeElement);+ const next = e.key === 'ArrowDown'+ ? (idx + 1) % items.length+ : (idx - 1 + items.length) % items.length;+ items[next]?.focus();+ }+ };+ setTimeout(() => {+ document.addEventListener('click', closeOnOutside, true);+ document.addEventListener('keydown', onKey, true);+ }, 0);+}++function closeUserMenu(menu, chip, onOutside, onKey) {+ menu.remove();+ if (chip) chip.setAttribute('aria-expanded', 'false');+ if (onOutside) document.removeEventListener('click', onOutside, true);+ if (onKey) document.removeEventListener('keydown', onKey, true);}// ── Helpers ────────────────────────────────────────────────────────────────diff --git a/src/dashboard-next/pages/account.js b/src/dashboard-next/pages/account.jsindex 066c39e26..ec605dc98 100644--- a/src/dashboard-next/pages/account.js+++ b/src/dashboard-next/pages/account.js@@ -266,6 +266,7 @@ function renderProviderKeys(host, keyStatus) {<button class="dn-btn danger" data-action="clear-key" data-provider="${esc(provider)}" style="padding:5px 10px;font-size:12px">Remove</button>`: `<input type="password" data-key-input data-provider="${esc(provider)}"placeholder="${esc(meta.placeholder)}"+ aria-label="${esc(meta.label)} API key"style="background:rgba(255,255,255,0.04);border:1px solid var(--nxt-stroke-strong);border-radius:6px;padding:6px 10px;color:var(--nxt-ink);font-size:12.5px;width:260px;font-family:${MONO}"autocomplete="off" spellcheck="false" />@@ -394,7 +395,7 @@ function startEditName(host, me) {const row = host.querySelector('[data-slot="name-row"]');const current = me.display_name || '';row.innerHTML = `- <input type="text" value="${esc(current)}" maxlength="60" style="+ <input type="text" value="${esc(current)}" maxlength="60" aria-label="Display name" style="background:rgba(255,255,255,0.04);border:1px solid var(--nxt-stroke-strong);border-radius:6px;padding:6px 10px;color:var(--nxt-ink);@@ -443,7 +444,7 @@ function startEditUsername(host, me) {const current = me.username || '';row.innerHTML = `<span style="color:var(--nxt-ink-fade)">@</span>- <input type="text" value="${esc(current)}" maxlength="30" placeholder="username"+ <input type="text" value="${esc(current)}" maxlength="30" placeholder="username" aria-label="Username"autocapitalize="off" autocomplete="off" autocorrect="off" spellcheck="false" style="background:rgba(255,255,255,0.04);border:1px solid var(--nxt-stroke-strong);diff --git a/src/dashboard-next/pages/agents.js b/src/dashboard-next/pages/agents.jsindex d0956cc6e..9521fe846 100644--- a/src/dashboard-next/pages/agents.js+++ b/src/dashboard-next/pages/agents.js@@ -955,7 +955,7 @@ function openPersonaModal(host, agent, allAgents, avatars) {<button class="dn-btn" data-action="seed-github" type="button" style="flex-shrink:0">Seed from GitHub</button></div><div style="display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:0">- <input data-slot="seed-farcaster" type="text" maxlength="50" placeholder="Farcaster username or FID"+ <input data-slot="seed-farcaster" type="text" maxlength="50" placeholder="Farcaster username or FID" aria-label="Farcaster username or FID"style="padding:8px 11px;border-radius:8px;border:1px solid var(--nxt-stroke);background:rgba(255,255,255,0.04);color:var(--nxt-ink);font:inherit;font-size:13px" /><button class="dn-btn" data-action="seed-farcaster" type="button" style="flex-shrink:0">Seed from Farcaster</button>diff --git a/src/dashboard-next/pages/analytics.js b/src/dashboard-next/pages/analytics.jsindex 119dc47ad..89c3aafe7 100644--- a/src/dashboard-next/pages/analytics.js+++ b/src/dashboard-next/pages/analytics.js@@ -6,6 +6,7 @@import { mountShell } from '../shell.js';import { requireUser, get, esc, relTime, formatUsdc, ApiError } from '../api.js';+import { errorStateHTML, ensureStateKitStyles } from '../../shared/state-kit.js';const RANGES = [{ key: '7d', days: 7, label: '7 days', granularity: 'day' },@@ -63,6 +64,22 @@ async function loadAndRender(root) {safe(() => get(`/api/monetization/revenue?period=${range.key}`)),]);+ // Every primary surface (revenue, agents, widgets, summary) failing means the+ // network is down, not that the user has no data — render a retryable error+ // instead of an all-zero dashboard that looks deceptively "empty".+ if (revenue === null && agents === null && widgets === null && summary === null) {+ ensureStateKitStyles();+ root.innerHTML = errorStateHTML({+ title: "Couldn't load analytics",+ body: 'We had trouble reaching the analytics service. Check your connection and try again.',+ });+ root.querySelector('[data-sk-retry]')?.addEventListener('click', () => {+ renderSkeletons(root);+ loadAndRender(root);+ });+ return;+ }+const agentList = agents?.agents ?? [];const widgetList = widgets?.widgets ?? [];@@ -182,6 +199,13 @@ function paintCanvasLineChart(host, timeseries) {host.innerHTML = '';const canvas = document.createElement('canvas');canvas.style.cssText = 'width:100%;height:100%;display:block';+ // Canvas is opaque to assistive tech — describe the trend it depicts.+ const total = timeseries.reduce((a, p) => a + (Number(p.value) || 0), 0);+ const peak = timeseries.reduce((m, p) => Math.max(m, Number(p.value) || 0), 0);+ canvas.setAttribute('role', 'img');+ canvas.setAttribute('aria-label',+ `Revenue over time line chart, ${timeseries.length} data points, ` ++ `total $${total.toFixed(2)}, peak day $${peak.toFixed(2)}.`);host.appendChild(canvas);const dpr = window.devicePixelRatio || 1;@@ -346,6 +370,12 @@ function paintHorizontalBarChart(host, bySkill) {host.innerHTML = '';const canvas = document.createElement('canvas');canvas.style.cssText = 'width:100%;height:100%;display:block';+ const ranked = [...bySkill].sort((a, b) => Number(b.net_total) - Number(a.net_total)).slice(0, 8);+ const summary = ranked+ .map((s) => `${(s.skill || 'Other').replace(/_/g, ' ')} ${formatUsdc(Number(s.net_total))}`)+ .join(', ');+ canvas.setAttribute('role', 'img');+ canvas.setAttribute('aria-label', `Revenue by skill bar chart. ${summary}.`);host.appendChild(canvas);const dpr = window.devicePixelRatio || 1;diff --git a/src/dashboard-next/pages/api.js b/src/dashboard-next/pages/api.jsindex 50e820d06..8e1c373e8 100644--- a/src/dashboard-next/pages/api.js+++ b/src/dashboard-next/pages/api.js@@ -20,6 +20,7 @@import { mountShell } from '../shell.js';import { requireUser, get, post, del, put, esc, relTime, ApiError } from '../api.js';+import { errorStateHTML, ensureStateKitStyles } from '../../shared/state-kit.js';// Scopes accepted by /api/keys — match api/keys/index.js ALLOWED_SCOPES exactly.const SCOPES = [@@ -39,8 +40,37 @@ const EXPIRY_OPTIONS = [const KEY_PLACEHOLDER = 'YOUR_API_KEY';(async function boot() {- const main = await mountShell();- const me = await requireUser();+ let main;+ try {+ main = await mountShell();+ } catch {+ // Shell failed to mount — nothing renderable yet, surface a full-page retry.+ ensureStateKitStyles();+ const fallback = document.querySelector('.dn-main-inner') || document.body;+ fallback.innerHTML = errorStateHTML({+ title: "Couldn't load this page",+ body: 'We had trouble loading the dashboard. Check your connection and try again.',+ });+ fallback.querySelector('[data-sk-retry]')?.addEventListener('click', () => location.reload());+ return;+ }++ let me;+ try {+ me = await requireUser();+ } catch (err) {+ if (err instanceof ApiError && err.status === 401) {+ location.href = `/login?return=${encodeURIComponent(location.pathname)}`;+ return;+ }+ ensureStateKitStyles();+ main.innerHTML = errorStateHTML({+ title: "Couldn't verify your session",+ body: 'We had trouble confirming you are signed in. Check your connection and try again.',+ });+ main.querySelector('[data-sk-retry]')?.addEventListener('click', () => location.reload());+ return;+ }main.innerHTML = `<h1 class="dn-h1">API & embed</h1>@@ -1037,13 +1067,13 @@ function renderPolicyRow(agent, i) {<div class="dn-dim dn-mono-sm">${esc(agent.id.slice(0, 8))}…</div></div><div>- <select data-policy-mode disabled>+ <select data-policy-mode disabled aria-label="Embed policy mode for ${esc(name)}"><option value="allowlist">Allowlist</option><option value="denylist">Denylist</option></select></div><div>- <textarea data-policy-hosts placeholder="example.com *.partner.io" rows="3" disabled></textarea>+ <textarea data-policy-hosts placeholder="example.com *.partner.io" rows="3" disabled aria-label="Allowed embed hosts for ${esc(name)}, one per line"></textarea></div><div class="dn-policy-actions"><span class="dn-tag" data-policy-status>Loading…</span>diff --git a/src/dashboard-next/pages/avatars.js b/src/dashboard-next/pages/avatars.jsindex e531a0406..fb1cd6d7f 100644--- a/src/dashboard-next/pages/avatars.js+++ b/src/dashboard-next/pages/avatars.js@@ -96,7 +96,7 @@ const state = {<div class="dn-av-filters" data-filters-mine><label class="dn-av-search"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="7" cy="7" r="4.5"/><path d="m10.5 10.5 3 3"/></svg>- <input type="search" placeholder="Search avatars by name…" data-q autocomplete="off" />+ <input type="search" placeholder="Search avatars by name…" data-q autocomplete="off" aria-label="Search avatars by name" /></label><div class="dn-av-chips" role="tablist" aria-label="Visibility filter">${['all', ...VISIBILITIES].map((v) => `@@ -113,7 +113,7 @@ const state = {<div class="dn-av-filters" data-filters-community hidden><label class="dn-av-search"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="7" cy="7" r="4.5"/><path d="m10.5 10.5 3 3"/></svg>- <input type="search" placeholder="Search the community gallery…" data-cq autocomplete="off" />+ <input type="search" placeholder="Search the community gallery…" data-cq autocomplete="off" aria-label="Search the community gallery" /></label><label class="dn-av-sort"><select data-csort aria-label="Sort community avatars">diff --git a/src/dashboard-next/pages/brain.js b/src/dashboard-next/pages/brain.jsindex ebe4813ce..8e2ca2508 100644--- a/src/dashboard-next/pages/brain.js+++ b/src/dashboard-next/pages/brain.js@@ -288,7 +288,7 @@ function renderPage() {</div><div class="brn-method-body" id="brnFreeform" role="tabpanel">- <textarea class="brn-textarea" id="brnFreeformText" placeholder="Paste a bio, collection of tweets, LinkedIn summary, Reddit comments, or describe the personality you want...\n\nThe more context you provide, the richer the extraction." rows="8"></textarea>+ <textarea class="brn-textarea" id="brnFreeformText" placeholder="Paste a bio, collection of tweets, LinkedIn summary, Reddit comments, or describe the personality you want...\n\nThe more context you provide, the richer the extraction." rows="8" aria-label="Source text for persona synthesis"></textarea><div class="brn-form-hint">Paste real writing samples for the most authentic extraction.</div><div class="brn-actions"><button class="brn-btn brn-btn-primary" id="brnFreeformSynth" disabled>Synthesize Persona</button>@@ -332,14 +332,14 @@ function renderPage() {</div><div class="brn-pc-edit" id="brnPcEdit" style="display:none"><div class="brn-form-grid">- <div class="brn-field"><label>Tone</label><input id="brnEditTone" /></div>+ <div class="brn-field"><label>Tone</label><input id="brnEditTone" aria-label="Tone" /></div><div class="brn-field"><label>Style</label>- <select id="brnEditStyle"><option value="terse">Terse</option><option value="detailed">Detailed</option><option value="playful">Playful</option><option value="analytical">Analytical</option><option value="warm">Warm</option></select>+ <select id="brnEditStyle" aria-label="Communication style"><option value="terse">Terse</option><option value="detailed">Detailed</option><option value="playful">Playful</option><option value="analytical">Analytical</option><option value="warm">Warm</option></select></div>- <div class="brn-field"><label>Vocabulary</label><input id="brnEditVocab" placeholder="Comma-separated" /></div>- <div class="brn-field"><label>Interests</label><input id="brnEditInterests" placeholder="Comma-separated" /></div>- <div class="brn-field"><label>Avoid</label><input id="brnEditDont" placeholder="Comma-separated" /></div>- <div class="brn-field brn-field-full"><label>Greeting</label><textarea id="brnEditGreet" rows="2"></textarea></div>+ <div class="brn-field"><label>Vocabulary</label><input id="brnEditVocab" placeholder="Comma-separated" aria-label="Vocabulary" /></div>+ <div class="brn-field"><label>Interests</label><input id="brnEditInterests" placeholder="Comma-separated" aria-label="Interests" /></div>+ <div class="brn-field"><label>Avoid</label><input id="brnEditDont" placeholder="Comma-separated" aria-label="Avoid" /></div>+ <div class="brn-field brn-field-full"><label>Greeting</label><textarea id="brnEditGreet" rows="2" aria-label="Sample greeting"></textarea></div></div><div class="brn-actions" style="justify-content:flex-start"><button class="brn-btn brn-btn-primary brn-btn-sm" id="brnSaveEdit">Save Changes</button>@@ -351,7 +351,7 @@ function renderPage() {<button class="brn-btn brn-btn-primary brn-btn-sm" id="brnTestPlay">Test in Playground</button><button class="brn-btn brn-btn-ghost brn-btn-sm" id="brnResetPersona">Start Over</button><div class="brn-pc-save-wrap">- <select class="brn-select" id="brnAgentSelect"><option value="">Select agent…</option></select>+ <select class="brn-select" id="brnAgentSelect" aria-label="Select agent to save persona to"><option value="">Select agent…</option></select><button class="brn-btn brn-btn-primary brn-btn-sm" id="brnSaveToAgent" disabled>Save to Agent</button></div></div>@@ -384,7 +384,7 @@ function renderPage() {<div class="brn-input-wrap"><details class="brn-sys-details"><summary>System prompt</summary>- <textarea class="brn-sys-area" id="brnSystem" placeholder="Custom system instructions…" rows="3"></textarea>+ <textarea class="brn-sys-area" id="brnSystem" placeholder="Custom system instructions…" rows="3" aria-label="System prompt"></textarea></details><div class="brn-input-row"><textarea class="brn-prompt" id="brnPrompt" placeholder="Send a message…" rows="1" aria-label="Message input"></textarea>@@ -477,7 +477,7 @@ function renderQuestionCards() {<div class="brn-q-card"><span class="brn-q-num">${i + 1}</span><div class="brn-q-text">${esc(q.q)}</div>- <textarea class="brn-q-input" id="brnQ${i}" placeholder="${esc(q.placeholder)}" rows="2"></textarea>+ <textarea class="brn-q-input" id="brnQ${i}" placeholder="${esc(q.placeholder)}" rows="2" aria-label="${esc(q.q)}"></textarea></div>`).join('');el.querySelectorAll('.brn-q-input').forEach(input => input.addEventListener('input', updateSynthBtn));@@ -729,7 +729,7 @@ function renderPlayControls() {}).join('')}</div>`;} else {- ctrl.innerHTML = `<select class="brn-select brn-focus-sel" id="brnFocusSel">${+ ctrl.innerHTML = `<select class="brn-select brn-focus-sel" id="brnFocusSel" aria-label="Model provider">${PROVIDERS.map(p => {const avail = isAvailable(p.key);return `<option value="${esc(p.key)}"${p.key === S.focusKey ? ' selected' : ''}${!avail ? ' disabled' : ''}>${esc(p.label)}${avail ? '' : ' (unavailable)'}</option>`;diff --git a/src/dashboard-next/pages/irl-placements.js b/src/dashboard-next/pages/irl-placements.jsindex b3a0375ac..2139e9c8e 100644--- a/src/dashboard-next/pages/irl-placements.js+++ b/src/dashboard-next/pages/irl-placements.js@@ -211,7 +211,7 @@ async function mount(el) {const id = card.dataset.id;const current = captionEl.dataset.caption || '';captionEl.replaceWith(`<div class="irl-caption-edit">- <input class="irl-caption-input" type="text" value="${esc(current)}" placeholder="Caption…" maxlength="140" />+ <input class="irl-caption-input" type="text" value="${esc(current)}" placeholder="Caption…" maxlength="140" aria-label="Placement caption" /><button class="irl-action" data-save="${esc(id)}">Save</button><button class="irl-action" data-cancel>Cancel</button></div>`);diff --git a/src/dashboard-next/pages/landscape.js b/src/dashboard-next/pages/landscape.jsindex d0413d481..d0ef915f4 100644--- a/src/dashboard-next/pages/landscape.js+++ b/src/dashboard-next/pages/landscape.js@@ -348,6 +348,7 @@ function paintPositionMap(host) {host.innerHTML = '';const canvas = document.createElement('canvas');canvas.style.cssText = 'width:100%;height:100%;display:block;cursor:crosshair';+ canvas.setAttribute('aria-hidden', 'true');host.appendChild(canvas);const tooltip = document.createElement('div');@@ -716,6 +717,7 @@ function paintGrowthChart(host) {host.innerHTML = '';const canvas = document.createElement('canvas');canvas.style.cssText = 'width:100%;height:100%;display:block';+ canvas.setAttribute('aria-hidden', 'true');host.appendChild(canvas);const dpr = window.devicePixelRatio || 1;diff --git a/src/dashboard-next/pages/monetize.js b/src/dashboard-next/pages/monetize.jsindex 4b83b8b6e..cd69fc1f1 100644--- a/src/dashboard-next/pages/monetize.js+++ b/src/dashboard-next/pages/monetize.js@@ -6,6 +6,7 @@import { mountShell } from '../shell.js';import { requireUser, get, post, put, del, esc, relTime, formatUsdc, ApiError } from '../api.js';+import { errorStateHTML, ensureStateKitStyles } from '../../shared/state-kit.js';const USDC_MINTS = {solana: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',@@ -121,6 +122,24 @@ async function loadAndRender(host, me, agents) {selectedAgentId ? safe(() => get(`/api/monetization/revenue?${agentParam}&period=all`)) : Promise.resolve(null),]);+ // If every primary revenue surface failed to load, the page would otherwise+ // render an all-zero hero and empty panels with no signal that the data is+ // simply unreachable. Surface a single retryable error instead.+ const allPrimaryFailed = revenue === null && withdrawalsResp === null+ && walletsResp === null && summary === null;+ if (allPrimaryFailed) {+ ensureStateKitStyles();+ host.innerHTML = errorStateHTML({+ title: "Couldn't load your earnings",+ body: 'We had trouble reaching the billing service. Check your connection and try again.',+ });+ host.querySelector('[data-sk-retry]')?.addEventListener('click', () => {+ renderSkeleton(host);+ loadAndRender(host, me, agents);+ });+ return;+ }+const withdrawals = withdrawalsResp?.withdrawals || [];const wallets = walletsResp?.wallets || [];const creatorPlans = plans?.plans || [];@@ -571,7 +590,7 @@ function renderRevenueChart({ initial, defaultRange }) {<div class="dn-panel-title">Revenue Over Time</div><div class="dn-panel-sub" style="margin:2px 0 0">Net earnings after platform fees.</div></div>- <select data-slot="range" class="mon-select">+ <select data-slot="range" class="mon-select" aria-label="Revenue time range">${RANGES.map((r) => `<option value="${r.key}"${r.key === defaultRange ? ' selected' : ''}>${esc(r.label)}</option>`).join('')}</select></div>@@ -638,6 +657,9 @@ function paintCanvasChart(host, timeseries) {const max = Math.max(0.01, ...data.map(d => d.value));+ canvas.setAttribute('role', 'img');+ canvas.setAttribute('aria-label', `Net revenue over time line chart, ${data.length} period${data.length !== 1 ? 's' : ''}, peak $${max.toFixed(max >= 100 ? 0 : 2)}`);+const points = data.map((d, i) => ({x: PAD.left + (i / Math.max(1, data.length - 1)) * innerW,y: PAD.top + innerH - (d.value / max) * innerH,diff --git a/src/dashboard-next/pages/portfolio.js b/src/dashboard-next/pages/portfolio.jsindex 8a2b8bb29..f159a2e34 100644--- a/src/dashboard-next/pages/portfolio.js+++ b/src/dashboard-next/pages/portfolio.js@@ -1,6 +1,7 @@import { mountShell } from '../shell.js';import { requireUser, get, post, esc, relTime, ApiError } from '../api.js';import { createChart, AreaSeries, LineSeries } from 'lightweight-charts';+import { errorStateHTML, ensureStateKitStyles } from '../../shared/state-kit.js';const MONO = `'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`;const REFRESH_MS = 60_000;@@ -59,39 +60,7 @@ function disposeAssetChart() {const host = main.querySelector('[data-slot="content"]');- const [summaryRes, historyRes, avatarsRes, agentsRes] = await Promise.allSettled([- get('/api/portfolio/summary?snapshot=1'),- get('/api/portfolio/history?days=90'),- get('/api/avatars?limit=100'),- get('/api/agents'),- ]);-- STATE.summary = summaryRes.status === 'fulfilled' ? summaryRes.value : null;- STATE.history = historyRes.status === 'fulfilled' ? historyRes.value : null;- const avatars = avatarsRes.status === 'fulfilled' ? (avatarsRes.value?.avatars ?? []) : [];- const agents = agentsRes.status === 'fulfilled' ? (agentsRes.value?.agents ?? []) : [];-- host.innerHTML = '';-- if (!STATE.summary?.wallets?.length) {- host.appendChild(renderEmptyState());- return;- }-- STATE.merged = mergeHoldings(STATE.summary);-- host.appendChild(renderHero(STATE.summary, STATE.history));- host.appendChild(renderWallets(STATE.summary));- host.appendChild(renderHoldings());-- const nftAvatars = avatars.filter((a) => a.nft_mint || a.nft_address || a.token_id);- if (nftAvatars.length) host.appendChild(renderNftAvatars(nftAvatars));-- const pumpAgents = agents.filter((a) => a.meta?.pumpfun?.mint || a.meta?.token?.mint || a.meta?.token?.ca);- if (pumpAgents.length) host.appendChild(renderPumpTokens(pumpAgents));-- mountDrawerContainer();- startAutoRefresh(host);+ await loadPortfolio(host);window.addEventListener('beforeunload', cleanup);} catch (err) {@@ -103,6 +72,63 @@ function disposeAssetChart() {}})();+async function loadPortfolio(host) {+ host.innerHTML = buildSkeleton();++ const [summaryRes, historyRes, avatarsRes, agentsRes] = await Promise.allSettled([+ get('/api/portfolio/summary?snapshot=1'),+ get('/api/portfolio/history?days=90'),+ get('/api/avatars?limit=100'),+ get('/api/agents'),+ ]);++ // The summary is the primary surface. When it rejects (network down), every+ // downstream render is empty — but renderEmptyState() would wrongly tell the+ // user they have "no wallets". Show a retryable error for the load failure;+ // reserve the empty state for a successful response with zero wallets.+ if (summaryRes.status === 'rejected') {+ const err = summaryRes.reason;+ if (err instanceof ApiError && err.status === 401) {+ location.href = `/login?return=${encodeURIComponent(location.pathname)}`;+ return;+ }+ ensureStateKitStyles();+ host.innerHTML = errorStateHTML({+ title: "Couldn't load your portfolio",+ body: 'We had trouble reaching your wallet balances. Check your connection and try again.',+ });+ host.querySelector('[data-sk-retry]')?.addEventListener('click', () => loadPortfolio(host));+ return;+ }++ STATE.summary = summaryRes.value;+ STATE.history = historyRes.status === 'fulfilled' ? historyRes.value : null;+ const avatars = avatarsRes.status === 'fulfilled' ? (avatarsRes.value?.avatars ?? []) : [];+ const agents = agentsRes.status === 'fulfilled' ? (agentsRes.value?.agents ?? []) : [];++ host.innerHTML = '';++ if (!STATE.summary?.wallets?.length) {+ host.appendChild(renderEmptyState());+ return;+ }++ STATE.merged = mergeHoldings(STATE.summary);++ host.appendChild(renderHero(STATE.summary, STATE.history));+ host.appendChild(renderWallets(STATE.summary));+ host.appendChild(renderHoldings());++ const nftAvatars = avatars.filter((a) => a.nft_mint || a.nft_address || a.token_id);+ if (nftAvatars.length) host.appendChild(renderNftAvatars(nftAvatars));++ const pumpAgents = agents.filter((a) => a.meta?.pumpfun?.mint || a.meta?.token?.mint || a.meta?.token?.ca);+ if (pumpAgents.length) host.appendChild(renderPumpTokens(pumpAgents));++ mountDrawerContainer();+ startAutoRefresh(host);+}+function cleanup() {disposePortfolioChart();disposeAssetChart();@@ -266,6 +292,16 @@ async function handlePeriodChange(heroPanel, days) {function renderPortfolioChart(container, points, currentUsd) {disposePortfolioChart();+ // The charting lib paints into an internal canvas that's opaque to screen+ // readers; describe the series on the container so it has an accessible name.+ const firstUsd = points[0]?.usd ?? 0;+ const dir = currentUsd >= firstUsd ? 'up' : 'down';+ const pct = firstUsd > 0 ? Math.abs(((currentUsd - firstUsd) / firstUsd) * 100).toFixed(1) : '0';+ container.setAttribute('role', 'img');+ container.setAttribute('aria-label',+ `Portfolio value chart over the selected period, ${points.length} points, ` ++ `currently $${fmtUsd(currentUsd)}, trending ${dir} ${pct}%.`);+const chart = createChart(container, {width: container.clientWidth,height: 220,diff --git a/src/dashboard-next/pages/sniper.js b/src/dashboard-next/pages/sniper.jsindex 3c0d9450c..ef2f93d5f 100644--- a/src/dashboard-next/pages/sniper.js+++ b/src/dashboard-next/pages/sniper.js@@ -354,7 +354,7 @@ function stratForm(s) {<div class="sn-section-head">Trigger & Sizing</div><div class="sn-field"><label>Trigger</label>- <select name="trigger">+ <select name="trigger" aria-label="Trigger"><option value="new_mint" ${s.trigger === 'new_mint' || (!s.trigger || (s.trigger !== 'first_claim' && s.trigger !== 'intel_confirmed')) ? 'selected' : ''}>New mint — snipe every launch</option><option value="first_claim" ${s.trigger === 'first_claim' ? 'selected' : ''}>First claim — creator claims for first time</option><option value="intel_confirmed" ${s.trigger === 'intel_confirmed' ? 'selected' : ''}>Intel confirmed — buy after Coin Intelligence verdict</option>@@ -364,86 +364,86 @@ function stratForm(s) {</div><div class="sn-field"><label>Buy delay (ms)</label>- <input name="buy_delay_ms" type="number" min="0" max="600000" value="${s.buy_delay_ms || 0}" />+ <input name="buy_delay_ms" type="number" min="0" max="600000" value="${s.buy_delay_ms || 0}" aria-label="Buy delay in milliseconds" /><span class="sn-hint">Pause before buying. Currently ${fmtDelayMs(s.buy_delay_ms)}.</span></div><div class="sn-field"><label>Daily budget (SOL)</label>- <input name="daily_budget_sol" type="number" min="0" step="0.001" value="${toLamSol(s.daily_budget_lamports)}" />+ <input name="daily_budget_sol" type="number" min="0" step="0.001" value="${toLamSol(s.daily_budget_lamports)}" aria-label="Daily budget in SOL" /><span class="sn-hint">Max SOL to spend per calendar day.</span></div><div class="sn-field"><label>Per-trade size (SOL)</label>- <input name="per_trade_sol" type="number" min="0" step="0.001" value="${toLamSol(s.per_trade_lamports)}" />+ <input name="per_trade_sol" type="number" min="0" step="0.001" value="${toLamSol(s.per_trade_lamports)}" aria-label="Per-trade size in SOL" /><span class="sn-hint">SOL per snipe. Must be ≤ daily budget.</span></div><div class="sn-field"><label>Max concurrent positions</label>- <input name="max_concurrent_positions" type="number" min="1" max="50" value="${s.max_concurrent_positions || 1}" />+ <input name="max_concurrent_positions" type="number" min="1" max="50" value="${s.max_concurrent_positions || 1}" aria-label="Max concurrent positions" /></div><div class="sn-field"><label>Slippage (bps)</label>- <input name="slippage_bps" type="number" min="0" max="5000" value="${s.slippage_bps || 500}" />+ <input name="slippage_bps" type="number" min="0" max="5000" value="${s.slippage_bps || 500}" aria-label="Slippage in basis points" /><span class="sn-hint">100 bps = 1%.</span></div><div class="sn-section-head">Exit Rules</div><div class="sn-field"><label>Take profit (%)</label>- <input name="take_profit_pct" type="number" min="1" step="1" value="${s.take_profit_pct != null ? s.take_profit_pct : ''}" placeholder="e.g. 50" />+ <input name="take_profit_pct" type="number" min="1" step="1" value="${s.take_profit_pct != null ? s.take_profit_pct : ''}" placeholder="e.g. 50" aria-label="Take profit percent" /><span class="sn-hint">Sell when up this %. Leave blank to hold.</span></div><div class="sn-field"><label>Stop loss (%) *</label>- <input name="stop_loss_pct" type="number" min="1" max="99" step="1" value="${s.stop_loss_pct != null ? s.stop_loss_pct : 30}" required />+ <input name="stop_loss_pct" type="number" min="1" max="99" step="1" value="${s.stop_loss_pct != null ? s.stop_loss_pct : 30}" required aria-label="Stop loss percent" /></div><div class="sn-field"><label>Trailing stop (%)</label>- <input name="trailing_stop_pct" type="number" min="1" step="1" value="${s.trailing_stop_pct != null ? s.trailing_stop_pct : ''}" placeholder="e.g. 20" />+ <input name="trailing_stop_pct" type="number" min="1" step="1" value="${s.trailing_stop_pct != null ? s.trailing_stop_pct : ''}" placeholder="e.g. 20" aria-label="Trailing stop percent" /><span class="sn-hint">Sell when peak drops by this %. Optional.</span></div><div class="sn-field"><label>Max hold time (seconds)</label>- <input name="max_hold_seconds" type="number" min="30" max="86400" value="${s.max_hold_seconds || 1800}" />+ <input name="max_hold_seconds" type="number" min="30" max="86400" value="${s.max_hold_seconds || 1800}" aria-label="Max hold time in seconds" /><span class="sn-hint">Force-exit after this. Currently ${fmtHold(s.max_hold_seconds)}.</span></div><div class="sn-section-head">Entry Filters</div><div class="sn-field"><label>Min market cap (USD)</label>- <input name="min_market_cap_usd" type="number" min="0" value="${s.min_market_cap_usd != null ? s.min_market_cap_usd : ''}" placeholder="any" />+ <input name="min_market_cap_usd" type="number" min="0" value="${s.min_market_cap_usd != null ? s.min_market_cap_usd : ''}" placeholder="any" aria-label="Min market cap in USD" /></div><div class="sn-field"><label>Max market cap (USD)</label>- <input name="max_market_cap_usd" type="number" min="0" value="${s.max_market_cap_usd != null ? s.max_market_cap_usd : ''}" placeholder="any" />+ <input name="max_market_cap_usd" type="number" min="0" value="${s.max_market_cap_usd != null ? s.max_market_cap_usd : ''}" placeholder="any" aria-label="Max market cap in USD" /></div><div class="sn-field"><label>Min creator graduated coins</label>- <input name="min_creator_graduated" type="number" min="0" value="${s.min_creator_graduated != null ? s.min_creator_graduated : ''}" placeholder="any" />+ <input name="min_creator_graduated" type="number" min="0" value="${s.min_creator_graduated != null ? s.min_creator_graduated : ''}" placeholder="any" aria-label="Min creator graduated coins" /><span class="sn-hint">Only launch from creators with this many graduates.</span></div><div class="sn-field"><label>Max creator total launches</label>- <input name="max_creator_launches" type="number" min="1" value="${s.max_creator_launches != null ? s.max_creator_launches : ''}" placeholder="any" />+ <input name="max_creator_launches" type="number" min="1" value="${s.max_creator_launches != null ? s.max_creator_launches : ''}" placeholder="any" aria-label="Max creator total launches" /><span class="sn-hint">Skip serial launchers with too many coins.</span></div><div class="sn-field"><label>Require social links</label>- <select name="require_socials">+ <select name="require_socials" aria-label="Require social links"><option value="false" ${!s.require_socials ? 'selected' : ''}>No — any launch</option><option value="true" ${s.require_socials ? 'selected' : ''}>Yes — Twitter/Telegram required</option></select></div><div class="sn-field"><label>Require SOL quote</label>- <select name="require_sol_quote">+ <select name="require_sol_quote" aria-label="Require SOL quote"><option value="true" ${s.require_sol_quote !== false ? 'selected' : ''}>Yes (recommended)</option><option value="false" ${s.require_sol_quote === false ? 'selected' : ''}>No</option></select></div><div class="sn-field"><label>Min Oracle conviction (0–100)</label>- <input name="min_oracle_score" type="number" step="1" min="0" max="100" value="${s.min_oracle_score != null ? s.min_oracle_score : ''}" placeholder="any" />+ <input name="min_oracle_score" type="number" step="1" min="0" max="100" value="${s.min_oracle_score != null ? s.min_oracle_score : ''}" placeholder="any" aria-label="Min Oracle conviction score, 0 to 100" /><span class="sn-hint">Skip the snipe if Oracle conviction is below this. Leave blank to snipe regardless of conviction. New mints without a score are allowed through.</span></div>@@ -453,7 +453,7 @@ function stratForm(s) {<div class="sn-section-head">Notifications</div><div class="sn-field sn-field-full"><label>Telegram chat ID (optional)</label>- <input name="telegram_chat_id" type="text" inputmode="numeric" value="${s.telegram_chat_id || ''}" placeholder="e.g. 123456789" autocomplete="off" />+ <input name="telegram_chat_id" type="text" inputmode="numeric" value="${s.telegram_chat_id || ''}" placeholder="e.g. 123456789" autocomplete="off" aria-label="Telegram chat ID (optional)" /><span class="sn-hint">Get buy/sell alerts in your own Telegram chat. Message <a class="sn-link" href="https://t.me/userinfobot" target="_blank" rel="noopener">@userinfobot</a> to find your chat ID, then forward its reply here. Leave blank to use the platform ops channel.</span></div>@@ -470,16 +470,16 @@ function firstClaimFields(s) {<div class="sn-section-head">First-Claim Filters</div><div class="sn-field"><label>Min claim size (SOL)</label>- <input name="min_claim_lamports_sol" type="number" min="0" step="0.001" value="${toLamSolOptional(s.min_claim_lamports)}" placeholder="any" />+ <input name="min_claim_lamports_sol" type="number" min="0" step="0.001" value="${toLamSolOptional(s.min_claim_lamports)}" placeholder="any" aria-label="Min claim size in SOL" /><span class="sn-hint">Only trigger if the creator claimed this much SOL.</span></div><div class="sn-field"><label>Max claim size (SOL)</label>- <input name="max_claim_lamports_sol" type="number" min="0" step="0.001" value="${toLamSolOptional(s.max_claim_lamports)}" placeholder="any" />+ <input name="max_claim_lamports_sol" type="number" min="0" step="0.001" value="${toLamSolOptional(s.max_claim_lamports)}" placeholder="any" aria-label="Max claim size in SOL" /></div><div class="sn-field"><label>Max claim age (seconds)</label>- <input name="first_claim_max_age_seconds" type="number" min="1" max="86400" value="${s.first_claim_max_age_seconds != null ? s.first_claim_max_age_seconds : ''}" placeholder="300" />+ <input name="first_claim_max_age_seconds" type="number" min="1" max="86400" value="${s.first_claim_max_age_seconds != null ? s.first_claim_max_age_seconds : ''}" placeholder="300" aria-label="Max claim age in seconds" /><span class="sn-hint">Skip if the claim tx is older than this.</span></div>`;}@@ -490,29 +490,29 @@ function intelFields(s) {<div class="sn-section-head">Coin Intelligence Filters</div><div class="sn-field"><label>Min quality score (0–100)</label>- <input name="min_quality_score" type="number" step="1" min="0" max="100" value="${s.min_quality_score != null ? s.min_quality_score : ''}" placeholder="e.g. 60" />+ <input name="min_quality_score" type="number" step="1" min="0" max="100" value="${s.min_quality_score != null ? s.min_quality_score : ''}" placeholder="e.g. 60" aria-label="Min quality score, 0 to 100" /><span class="sn-hint">Overall quality composite. 0 = any, 100 = best only. Higher = fewer but cleaner entries.</span></div><div class="sn-field"><label>Max bundle score (0–1)</label>- <input name="max_bundle_score" type="number" step="0.05" min="0" max="1" value="${s.max_bundle_score != null ? s.max_bundle_score : ''}" placeholder="e.g. 0.5" />+ <input name="max_bundle_score" type="number" step="0.05" min="0" max="1" value="${s.max_bundle_score != null ? s.max_bundle_score : ''}" placeholder="e.g. 0.5" aria-label="Max bundle score, 0 to 1" /><span class="sn-hint">Bundle likelihood from wallet graph analysis. 0 = no bundles tolerated, 1 = allow all.</span></div><div class="sn-field"><label>Max top-wallet concentration (%)</label>- <input name="max_concentration_top1" type="number" step="1" min="0" max="100" value="${s.max_concentration_top1 != null ? s.max_concentration_top1 : ''}" placeholder="e.g. 20" />+ <input name="max_concentration_top1" type="number" step="1" min="0" max="100" value="${s.max_concentration_top1 != null ? s.max_concentration_top1 : ''}" placeholder="e.g. 20" aria-label="Max top-wallet concentration percent" /><span class="sn-hint">Skip if the single largest holder owns more than this % of supply.</span></div><div class="sn-field"><label>Avoid dev dump</label>- <select name="avoid_dev_dump">+ <select name="avoid_dev_dump" aria-label="Avoid dev dump"><option value="true" ${s.avoid_dev_dump !== false ? 'selected' : ''}>Yes — skip if dev sold (recommended)</option><option value="false" ${s.avoid_dev_dump === false ? 'selected' : ''}>No — allow dev sells</option></select></div><div class="sn-field"><label>Allowed categories (comma-separated)</label>- <input name="allowed_categories" type="text" value="${esc(cats)}" placeholder="e.g. meme, animal, culture (blank = allow all)" />+ <input name="allowed_categories" type="text" value="${esc(cats)}" placeholder="e.g. meme, animal, culture (blank = allow all)" aria-label="Allowed categories, comma-separated" /><span class="sn-hint">Only snipe coins classified into these categories. Leave blank to allow all.</span></div>`;}@@ -744,7 +744,7 @@ async function loadTradeHistory(root, append = false) {<span class="sn-chart-label">Cumulative PnL</span><span class="sn-chart-val ${pnlClass}">${totalPnl >= 0 ? '+' : ''}${fmtSol(totalPnl)}</span></div>- <canvas class="sn-chart-canvas" id="sn-pnl-canvas" height="90"></canvas>+ <canvas class="sn-chart-canvas" id="sn-pnl-canvas" height="90" role="img" aria-label="Cumulative PnL line chart, ${cumPoints.length} closed trades, current ${totalPnl >= 0 ? '+' : ''}${fmtSol(totalPnl)}"></canvas></div>` : '';mount.innerHTML = `<div class="sn-hist">@@ -942,23 +942,23 @@ function openArmModal(root) {? '<p style="color:var(--nxt-ink-faint);font-size:13px">All your agents already have a strategy. Edit their config in the cards above.</p>': `<div class="sn-field" style="margin-bottom:16px"><label>Choose agent</label>- <select id="sn-arm-agent">+ <select id="sn-arm-agent" aria-label="Choose agent"><option value="">— select an agent —</option>${unarmed.map((a) => `<option value="${esc(a.id)}">${esc(a.name || a.id)}</option>`).join('')}</select></div><div class="sn-field"><label>Daily budget (SOL)</label>- <input id="sn-arm-budget" type="number" min="0.001" step="0.001" value="0.1" />+ <input id="sn-arm-budget" type="number" min="0.001" step="0.001" value="0.1" aria-label="Daily budget in SOL" /><span class="sn-hint">The agent will spend at most this much per day.</span></div><div class="sn-field" style="margin-top:12px"><label>Per-trade size (SOL)</label>- <input id="sn-arm-per-trade" type="number" min="0.001" step="0.001" value="0.01" />+ <input id="sn-arm-per-trade" type="number" min="0.001" step="0.001" value="0.01" aria-label="Per-trade size in SOL" /></div><div class="sn-field" style="margin-top:12px"><label>Min Oracle conviction score (0–100, blank = no filter)</label>- <input id="sn-arm-oracle" type="number" min="0" max="100" step="1" value="${presetScore != null ? presetScore : ''}" placeholder="e.g. 55 for strong+" />+ <input id="sn-arm-oracle" type="number" min="0" max="100" step="1" value="${presetScore != null ? presetScore : ''}" placeholder="e.g. 55 for strong+" aria-label="Min Oracle conviction score, 0 to 100, blank for no filter" /><span class="sn-hint">Only enter coins that clear this conviction threshold. Higher = fewer, higher-quality entries.</span></div>`}diff --git a/src/dashboard-next/pages/three-token.js b/src/dashboard-next/pages/three-token.jsindex 2f9d4500f..b6acb636a 100644--- a/src/dashboard-next/pages/three-token.js+++ b/src/dashboard-next/pages/three-token.js@@ -508,7 +508,7 @@ function renderLiveConverter(tokenConfig) {<label style="display:block;font-size:12.5px;color:var(--nxt-ink-dim);margin-bottom:8px">Amount in USD</label><div style="position:relative"><span style="position:absolute;left:14px;top:50%;transform:translateY(-50%);font-size:15px;color:var(--nxt-ink-fade);pointer-events:none;font-family:${MONO}">$</span>- <input type="number" data-input="usd" value="1" min="0.01" step="0.01" style="+ <input type="number" data-input="usd" value="1" min="0.01" step="0.01" aria-label="Amount in USD" style="width:100%;box-sizing:border-box;padding:12px 14px 12px 30px;background:rgba(255,255,255,0.04);border:1px solid var(--nxt-stroke);border-radius:var(--nxt-radius-sm);color:var(--nxt-ink);font-size:18px;@@ -648,7 +648,7 @@ function renderRevenueShare(stats, revenueData) {<div><label style="display:block;font-size:12.5px;color:var(--nxt-ink-dim);margin-bottom:8px">Your $THREE holdings</label><div style="position:relative">- <input type="text" data-input="holdings" value="10,000" style="+ <input type="text" data-input="holdings" value="10,000" aria-label="Your $THREE holdings" style="width:100%;box-sizing:border-box;padding:12px 70px 12px 14px;background:rgba(255,255,255,0.04);border:1px solid var(--nxt-stroke);border-radius:var(--nxt-radius-sm);color:var(--nxt-ink);font-size:16px;@@ -656,7 +656,7 @@ function renderRevenueShare(stats, revenueData) {" /><span style="position:absolute;right:14px;top:50%;transform:translateY(-50%);font-size:13px;color:var(--nxt-ink-fade);pointer-events:none">$THREE</span></div>- <input type="range" data-input="slider" min="0" max="1000000" value="10000" style="+ <input type="range" data-input="slider" min="0" max="1000000" value="10000" aria-label="Your $THREE holdings slider" style="width:100%;margin-top:12px;accent-color:#60a5fa;cursor:pointer;" /><div style="display:flex;justify-content:space-between;font-size:11px;color:var(--nxt-ink-fade);margin-top:4px">diff --git a/src/dashboard-next/pages/tokens.js b/src/dashboard-next/pages/tokens.jsindex 8833adb58..fc89ba051 100644--- a/src/dashboard-next/pages/tokens.js+++ b/src/dashboard-next/pages/tokens.js@@ -13,6 +13,7 @@import { mountShell } from '../shell.js';import { requireUser, get, post, esc, relTime, formatUsdc, ApiError } from '../api.js';+import { errorStateHTML, ensureStateKitStyles } from '../../shared/state-kit.js';const MONO = `'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace`;@@ -62,45 +63,7 @@ function toast(msg) {const host = main.querySelector('[data-slot="content"]');- const [agentsResp, dashResp] = await Promise.all([- safeGet('/api/agents'),- safeGet('/api/pump/dashboard'),- ]);-- const agents = agentsResp?.agents || [];- const dashTokens = dashResp?.tokens || [];-- // Build enriched token list: match pump tokens from agent meta + dashboard data- const pumpAgents = agents.filter((a) =>- a.meta?.pumpfun?.mint || a.meta?.token?.mint || a.meta?.token?.ca,- );-- // Fetch per-agent token stats- const tokenData = await Promise.all(- pumpAgents.map(async (a) => {- const mint = a.meta?.pumpfun?.mint || a.meta?.token?.mint || a.meta?.token?.ca;- const byAgent = await safeGet(`/api/pump/by-agent?agent_id=${encodeURIComponent(a.id)}`);- const fromDash = dashTokens.find((t) => t.mint === mint || t.address === mint);- return {- agent: a,- mint: mint || byAgent?.data?.mint || null,- token: byAgent?.token || fromDash || null,- stats: byAgent?.stats || fromDash?.stats || null,- coin: byAgent?.data || null, // { agent_authority, network, symbol, name, sharing_config }- };- }),- );-- host.innerHTML = '';-- if (!pumpAgents.length) {- host.appendChild(renderEmpty());- return;- }-- host.appendChild(renderSummaryStrip(tokenData));- const cards = tokenData.map((td) => { const el = renderTokenCard(td); host.appendChild(el); return { el, mint: td.mint }; });- enrichTokenCardsOracle(cards);+ await loadTokens(host);} catch (err) {if (err instanceof ApiError && err.status === 401) {location.href = `/login?return=${encodeURIComponent(location.pathname)}`;@@ -110,6 +73,69 @@ function toast(msg) {}})();+async function loadTokens(host) {+ host.innerHTML = `<div class="dn-skeleton" style="height:200px;border-radius:12px"></div>`;++ const [agentsSettled, dashSettled] = await Promise.allSettled([+ get('/api/agents'),+ get('/api/pump/dashboard'),+ ]);++ if (agentsSettled.status === 'rejected'+ && agentsSettled.reason instanceof ApiError+ && agentsSettled.reason.status === 401) {+ location.href = `/login?return=${encodeURIComponent(location.pathname)}`;+ return;+ }++ // Both primary surfaces failing means the network is down — render a retryable+ // error rather than renderEmpty(), which would wrongly read as "no tokens".+ if (agentsSettled.status === 'rejected' && dashSettled.status === 'rejected') {+ ensureStateKitStyles();+ host.innerHTML = errorStateHTML({+ title: "Couldn't load your tokens",+ body: 'We had trouble reaching the token service. Check your connection and try again.',+ });+ host.querySelector('[data-sk-retry]')?.addEventListener('click', () => loadTokens(host));+ return;+ }++ const agents = (agentsSettled.status === 'fulfilled' ? agentsSettled.value?.agents : null) || [];+ const dashTokens = (dashSettled.status === 'fulfilled' ? dashSettled.value?.tokens : null) || [];++ // Build enriched token list: match pump tokens from agent meta + dashboard data+ const pumpAgents = agents.filter((a) =>+ a.meta?.pumpfun?.mint || a.meta?.token?.mint || a.meta?.token?.ca,+ );++ // Fetch per-agent token stats+ const tokenData = await Promise.all(+ pumpAgents.map(async (a) => {+ const mint = a.meta?.pumpfun?.mint || a.meta?.token?.mint || a.meta?.token?.ca;+ const byAgent = await safeGet(`/api/pump/by-agent?agent_id=${encodeURIComponent(a.id)}`);+ const fromDash = dashTokens.find((t) => t.mint === mint || t.address === mint);+ return {+ agent: a,+ mint: mint || byAgent?.data?.mint || null,+ token: byAgent?.token || fromDash || null,+ stats: byAgent?.stats || fromDash?.stats || null,+ coin: byAgent?.data || null, // { agent_authority, network, symbol, name, sharing_config }+ };+ }),+ );++ host.innerHTML = '';++ if (!pumpAgents.length) {+ host.appendChild(renderEmpty());+ return;+ }++ host.appendChild(renderSummaryStrip(tokenData));+ const cards = tokenData.map((td) => { const el = renderTokenCard(td); host.appendChild(el); return { el, mint: td.mint }; });+ enrichTokenCardsOracle(cards);+}+async function safeGet(url) {try { return await get(url); }catch { return null; }diff --git a/src/dashboard-next/pages/widgets.js b/src/dashboard-next/pages/widgets.jsindex b3998f7c5..bed80320a 100644--- a/src/dashboard-next/pages/widgets.js+++ b/src/dashboard-next/pages/widgets.js@@ -607,7 +607,13 @@ function openTranscriptsModal(widget) {const threadsEl = root.querySelector('[data-slot="threads"]');const detailEl = root.querySelector('[data-slot="detail"]');- fetch(`/api/widgets/${encodeURIComponent(widget.id)}/transcripts`, { credentials: 'include' })+ const loadThreads = () => {+ threadsEl.innerHTML = `+ <div class="dn-skeleton-line"></div>+ <div class="dn-skeleton-line" style="width:70%"></div>+ <div class="dn-skeleton-line" style="width:85%"></div>+ `;+ fetch(`/api/widgets/${encodeURIComponent(widget.id)}/transcripts`, { credentials: 'include' }).then((r) => r.ok ? r.json() : Promise.reject(r.status)).then((data) => {const threads = data?.transcripts || data?.threads || [];@@ -669,8 +675,17 @@ function openTranscriptsModal(widget) {if (threads[0]) loadThread(threads[0].id);}).catch(() => {- threadsEl.innerHTML = `<div class="dn-wx-tx-empty" style="color:var(--nxt-danger)">Could not load transcripts.</div>`;+ threadsEl.innerHTML = `+ <div class="dn-wx-tx-empty" style="color:var(--nxt-danger)">Could not load transcripts.</div>+ <div style="display:flex;justify-content:center;margin-top:12px">+ <button class="dn-btn" data-retry-threads type="button">Retry</button>+ </div>+ `;+ threadsEl.querySelector('[data-retry-threads]')?.addEventListener('click', loadThreads);});+ };++ loadThreads();}// ── Knowledge base modal ─────────────────────────────────────────────────@@ -705,11 +720,19 @@ function openKnowledgeModal(widget) {const body = root.querySelector('[data-slot="kb-body"]');const loadKb = () => {+ body.innerHTML = `+ <div class="dn-skeleton-line"></div>+ <div class="dn-skeleton-line" style="width:75%"></div>+ `;fetch(`/api/widgets/${encodeURIComponent(widget.id)}/knowledge`, { credentials: 'include' }).then((r) => r.ok ? r.json() : Promise.reject(r.status)).then((data) => renderKb(data?.entries || data?.knowledge || [])).catch(() => {- body.innerHTML = `<p style="color:var(--nxt-danger);font-size:13px">Could not load knowledge base.</p>`;+ body.innerHTML = `+ <p style="color:var(--nxt-danger);font-size:13px">Could not load knowledge base.</p>+ <button class="dn-btn" data-retry-kb type="button">Retry</button>+ `;+ body.querySelector('[data-retry-kb]')?.addEventListener('click', loadKb);});};@@ -731,7 +754,7 @@ function openKnowledgeModal(widget) {${!entries.length ? `<div class="dn-wx-tx-empty">No knowledge entries yet.</div>` : ''}</div><div class="dn-kb-add" style="margin-top:16px">- <textarea class="dn-input" data-slot="new-entry" rows="3" placeholder="Add a knowledge snippet…" style="width:100%;resize:vertical;font-size:13px"></textarea>+ <textarea class="dn-input" data-slot="new-entry" rows="3" placeholder="Add a knowledge snippet…" style="width:100%;resize:vertical;font-size:13px" aria-label="New knowledge snippet"></textarea><div style="display:flex;justify-content:flex-end;margin-top:8px"><button class="dn-btn primary" data-add-kb type="button">Add entry</button></div>@@ -785,7 +808,7 @@ function openKnowledgeModal(widget) {const current = entryEl?.querySelector('.dn-kb-entry-text')?.textContent || '';if (!entryEl) return;entryEl.innerHTML = `- <textarea class="dn-input" rows="3" style="width:100%;resize:vertical;font-size:13px">${esc(current)}</textarea>+ <textarea class="dn-input" rows="3" style="width:100%;resize:vertical;font-size:13px" aria-label="Edit knowledge snippet">${esc(current)}</textarea><div style="display:flex;gap:6px;justify-content:flex-end;margin-top:6px"><button class="dn-btn small" data-cancel-edit type="button">Cancel</button><button class="dn-btn small primary" data-save-edit type="button">Save</button>diff --git a/src/forge-export.js b/src/forge-export.jsindex d1dbafd76..066fdb023 100644--- a/src/forge-export.js+++ b/src/forge-export.js@@ -13,6 +13,10 @@// Like the stylize/optimize panels, this module injects its own markup and// styles and only needs the result panel's download anchor to exist.+import { createLogger } from './shared/log.js';++const log = createLogger('forge-export');+const download = document.getElementById('download');const resultPanel = document.getElementById('state-result');@@ -282,7 +286,7 @@ if (download && resultPanel) {if (status.textContent === 'saved ✓') status.textContent = '';}, 4000);} catch (err) {- console.error('[forge-export]', format.id, err);+ log.error(format.id, err);status.textContent = 'failed — retry';status.classList.add('is-error');} finally {diff --git a/src/home-three-signal.js b/src/home-three-signal.jsnew file mode 100644index 000000000..f048a1d25--- /dev/null+++ b/src/home-three-signal.js@@ -0,0 +1,123 @@+/**+ * Live $THREE signal bar (homepage, under the hero).+ *+ * Pulls real market + protocol data from /api/three-token/stats (Birdeye →+ * DexScreener → GeckoTerminal failover, edge-cached 20s) and renders it as a+ * compact, self-refreshing ticker: price, 24h change, market cap, 24h volume,+ * and lifetime deploy-burn. No sample data — every figure is live. If the fetch+ * fails the bar degrades to a quiet "view live stats →" link instead of blanking.+ *+ * The deploy-burn figure is derived the same way the API documents it:+ * total_agents × agent_deploy_burn $THREE permanently burned per deployment.+ */++const STATS_URL = '/api/three-token/stats';+const REFRESH_MS = 30_000; // matches the 20s edge cache with headroom++function fmtPrice(n) {+ const v = Number(n);+ if (!isFinite(v) || v <= 0) return null;+ // Sub-cent tokens need enough precision to be meaningful without noise.+ if (v >= 1) return `$${v.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;+ if (v >= 0.01) return `$${v.toFixed(4)}`;+ if (v >= 0.0001) return `$${v.toFixed(6)}`;+ return `$${v.toPrecision(2)}`;+}++function fmtCompactUsd(n) {+ const v = Number(n);+ if (!isFinite(v) || v <= 0) return null;+ if (v >= 1_000_000_000) return `$${(v / 1_000_000_000).toFixed(2)}B`;+ if (v >= 1_000_000) return `$${(v / 1_000_000).toFixed(2)}M`;+ if (v >= 1_000) return `$${(v / 1_000).toFixed(1)}K`;+ return `$${v.toFixed(0)}`;+}++function fmtCompactNum(n) {+ const v = Number(n);+ if (!isFinite(v) || v <= 0) return null;+ if (v >= 1_000_000_000) return `${(v / 1_000_000_000).toFixed(2)}B`;+ if (v >= 1_000_000) return `${(v / 1_000_000).toFixed(2)}M`;+ if (v >= 1_000) return `${(v / 1_000).toFixed(1)}K`;+ return `${Math.round(v)}`;+}++function applyChange(el, pct) {+ const v = Number(pct);+ if (!isFinite(v)) {+ el.textContent = '';+ el.className = 'ts-chg ts-chg--flat';+ return;+ }+ const dir = v > 0.05 ? 'up' : v < -0.05 ? 'down' : 'flat';+ const sign = v > 0 ? '+' : '';+ el.textContent = `${sign}${v.toFixed(2)}% 24h`;+ el.className = `ts-chg ts-chg--${dir}`;+}++export function initHomeThreeSignal(root) {+ if (!root) return;++ const el = {+ price: root.querySelector('#ts-price'),+ change: root.querySelector('#ts-change'),+ mcap: root.querySelector('#ts-mcap'),+ vol: root.querySelector('#ts-vol'),+ burned: root.querySelector('#ts-burned'),+ };++ let timer = null;+ let stopped = false;++ async function load() {+ try {+ const res = await fetch(STATS_URL, { headers: { accept: 'application/json' } });+ if (!res.ok) throw new Error(`stats ${res.status}`);+ const data = await res.json();+ const t = data?.token || {};+ const p = data?.protocol || {};++ const price = fmtPrice(t.price_usd);+ // If the price itself is unavailable the signal has nothing real to+ // show — fall through to the error affordance rather than dashes.+ if (!price) throw new Error('no price');++ el.price.textContent = price;+ applyChange(el.change, t.price_change_24h);+ el.mcap.textContent = fmtCompactUsd(t.market_cap) || '—';+ el.vol.textContent = fmtCompactUsd(t.volume_24h) || '—';++ const burned = Number(p.total_agents) * Number(p.agent_deploy_burn || 0);+ el.burned.textContent = fmtCompactNum(burned) || '—';++ root.setAttribute('data-state', 'ready');+ } catch {+ // Keep whatever we last rendered if we already had data; only show the+ // degraded affordance when we never succeeded.+ if (root.getAttribute('data-state') !== 'ready') {+ root.setAttribute('data-state', 'error');+ }+ }+ }++ function schedule() {+ if (stopped) return;+ timer = setTimeout(async () => {+ // Skip refreshes while the tab is hidden to avoid pointless lambda hits.+ if (!document.hidden) await load();+ schedule();+ }, REFRESH_MS);+ }++ load().then(schedule);++ // Refresh promptly when the user returns to the tab after it was idle.+ document.addEventListener('visibilitychange', () => {+ if (!document.hidden && !stopped) load();+ });++ return () => {+ stopped = true;+ if (timer) clearTimeout(timer);+ };+}diff --git a/src/launches.js b/src/launches.jsindex cf433b422..3ee585b92 100644--- a/src/launches.js+++ b/src/launches.js@@ -19,6 +19,9 @@*/import { mountCoinStatus } from './pump/coin-status-card.js';+import { createLogger } from './shared/log.js';++const log = createLogger('launches');const PAGE_SIZE = 24;const ORACLE_TIER_COLOR = { prime: '#c084fc', strong: '#34d399', lean: '#fbbf24', watch: '#94a3b8', avoid: '#f87171' };@@ -733,7 +736,7 @@ async function loadPage({ reset = false } = {}) {renderFooter();updateCount();} catch (err) {- console.error('[launches] feed load failed', err);+ log.error('feed load failed', err);clearSkeletons();if (state.count === 0) renderError(() => loadPage({ reset: true }));else renderFooter();diff --git a/src/marketplace-lobby.js b/src/marketplace-lobby.jsindex c2886a2d2..384b4fe2a 100644--- a/src/marketplace-lobby.js+++ b/src/marketplace-lobby.js@@ -135,7 +135,12 @@ export async function mountLobby(canvas, avatars, options = {}) {// Baked avatars use EXT_meshopt_compression, so the loader needs the// matching decoder before it can parse them.const loader = new GLTFLoader();- const decoderReady = getMeshoptDecoder().then((dec) => loader.setMeshoptDecoder(dec));+ // Resolve regardless of outcome: if the decoder chunk fails to load we still+ // kick off the per-slot loads (they degrade via loader.load's own error cb)+ // rather than leaving an unhandled rejection on the cached decoder promise.+ const decoderReady = getMeshoptDecoder()+ .then((dec) => loader.setMeshoptDecoder(dec))+ .catch((err) => log.warn('[lobby] meshopt decoder failed to load — baked avatars may not render', err?.message || err));slots.forEach((avatar, i) => {const url = avatar?.glbUrl;if (!url) return;diff --git a/src/marketplace.js b/src/marketplace.jsindex 880ebbcb4..5cb70625d 100644--- a/src/marketplace.js+++ b/src/marketplace.js@@ -20,7 +20,7 @@ import {import { onchainBadgeHTML } from './shared/onchain-badge.js';import { seeInWorldHref, hasCustomAvatar } from './shared/agent-3d.js';import { coinChipHTML } from './shared/agent-coin.js';-import { skeletonHTML, ensureStateKitStyles } from './shared/state-kit.js';+import { skeletonHTML, errorStateHTML, ensureStateKitStyles } from './shared/state-kit.js';import { log } from './shared/log.js';ensureStateKitStyles();@@ -357,10 +357,36 @@ async function loadCategories() {if (!els.cats && !els.catChips) return;try {const r = await fetch(`${API}/marketplace/categories`);+ if (!r.ok) throw new Error(`HTTP ${r.status}`);const j = await r.json();renderCategories(j.data);} catch (err) {log.error('[marketplace] categories', err);+ renderCategoriesError();+ }+}++// The category sidebar is secondary chrome — a failure here must never leave a+// blank rail. Render a compact, retryable error in its place; chips collapse to+// just "All" so the user can still browse the full catalog while categories are+// unavailable.+function renderCategoriesError() {+ if (els.cats) {+ els.cats.innerHTML = errorStateHTML({+ title: "Categories unavailable",+ body: "Couldn't load categories. You can still browse all agents.",+ scope: 'categories',+ });+ if (!els.cats.dataset.catErrBound) {+ els.cats.dataset.catErrBound = '1';+ els.cats.addEventListener('click', (e) => {+ if (e.target.closest('[data-sk-retry]')) loadCategories();+ });+ }+ }+ if (els.catChips) {+ // Degrade chips to a single "All" pill so the row isn't left empty.+ renderCategoryChips({ total: state.items.length, categories: [] });}}@@ -523,7 +549,7 @@ async function loadPublicAvatars() {if (state.q) url.searchParams.set('q', state.q);if (state.modelCategory) url.searchParams.set('category', state.modelCategory);const r = await fetch(url);- if (!r.ok) return;+ if (!r.ok) throw new Error(`HTTP ${r.status}`);const j = await r.json();const avatars = (j?.items || []).filter((it) => it.kind === 'avatar' && it.glbUrl && !isAutoNamedAvatar(it.name),@@ -535,9 +561,30 @@ async function loadPublicAvatars() {updateOnchainChipCount();} catch (err) {log.error('[marketplace] public avatars', err);+ // Flip the loaded flag so renderGrid() stops showing a perpetual skeleton+ // when avatars were the only thing the grid was waiting on. Retry is wired+ // through bindEmptyStateActions (data-retry-scope="avatars").+ state.publicAvatars = [];+ state.publicAvatarsLoaded = true;+ if (gridWouldBeEmptyWithout('avatars')) {+ els.grid.removeAttribute('aria-busy');+ els.grid.innerHTML = renderErrorState('avatars');+ } else {+ renderGrid();+ }}}+// True when nothing else (agents, onchain, or the other surface) currently has+// cards in the shared grid, so a failed load would leave it blank/stuck — the+// only case where it's safe to take over the grid with an error state.+function gridWouldBeEmptyWithout(failedScope) {+ const haveAgents = state.items.length > 0;+ const haveAvatars = failedScope !== 'avatars' && state.publicAvatars.length > 0;+ const haveOnchain = failedScope !== 'onchain' && state.onchainItems.length > 0;+ return !haveAgents && !haveAvatars && !haveOnchain;+}+// ── Onchain ERC-8004 agents (102k+ in DB) ────────────────────────────────async function loadOnchainAgents(reset = false) {@@ -554,7 +601,7 @@ async function loadOnchainAgents(reset = false) {if (state.q) url.searchParams.set('q', state.q);if (state.onchainCursor) url.searchParams.set('cursor', state.onchainCursor);const r = await fetch(url);- if (!r.ok) return;+ if (!r.ok) throw new Error(`HTTP ${r.status}`);const j = await r.json();const items = (j?.items || []).filter((it) => it.kind === 'onchain' && it.glbUrl);state.onchainItems = reset ? items : [...state.onchainItems, ...items];@@ -564,6 +611,19 @@ async function loadOnchainAgents(reset = false) {updateOnchainChipCount();} catch (err) {log.error('[marketplace] onchain', err);+ // Mark loaded so the onchain tab doesn't sit on a forever-skeleton. Only+ // commandeer the grid with an error when there's nothing else to show;+ // otherwise leave the populated grid untouched. A pagination failure+ // (append) keeps the rows already on screen. Retry: data-retry-scope.+ state.onchainLoaded = true;+ const isOnchainView = state.filter === 'onchain' || state.filter === 'all';+ if (isOnchainView && reset && gridWouldBeEmptyWithout('onchain')) {+ els.grid.removeAttribute('aria-busy');+ els.grid.innerHTML = renderErrorState('onchain');+ } else if (isOnchainView) {+ renderGrid();+ }+ updateOnchainChipCount();}}@@ -625,15 +685,32 @@ async function loadTheme() {renderThemeSkeleton();try {const r = await fetch(`${API}/marketplace/theme`);- if (!r.ok) return;+ if (!r.ok) throw new Error(`HTTP ${r.status}`);const j = await r.json();const theme = j?.data?.theme;- if (!theme) return;+ if (!theme) {+ hideThemeStrip();+ return;+ }state.theme = theme;renderTheme();} catch (err) {log.error('[marketplace] theme', err);+ hideThemeStrip();+ }+}++// The weekly theme is an optional top-of-page strip. On failure (or an empty+// week) hide it cleanly so the shimmer placeholder from renderThemeSkeleton()+// never sticks on screen.+function hideThemeStrip() {+ const strip = $('market-theme-strip');+ const picks = $('market-theme-picks');+ if (picks) {+ picks.innerHTML = '';+ picks.hidden = true;}+ if (strip) strip.hidden = true;}// Show the strip with a shimmer immediately so the top of the page never pops@@ -768,7 +845,7 @@ async function loadFeatured() {url.searchParams.set('quality', 'high');url.searchParams.set('limit', '12');const r = await fetch(url);- if (!r.ok) return;+ if (!r.ok) throw new Error(`HTTP ${r.status}`);const j = await r.json();const named = (j?.items || []).filter((it) =>@@ -789,6 +866,11 @@ async function loadFeatured() {startHeroAutoplay();} catch (err) {log.error('[marketplace] featured', err);+ // The hero is a non-essential showcase — hide it cleanly on failure+ // rather than risk a half-rendered stage. renderHero() hides when there+ // are no featured items; the grid below carries the page on its own.+ state.featured = [];+ renderHero();}}@@ -6849,8 +6931,130 @@ function render() {}}+// ── Accessible dialog manager ──────────────────────────────────────────────+//+// Every overlay on this page is a `[role="dialog"]` toggled via the `hidden`+// attribute (and, for the avatar modal, a `.show` class for the fade). The+// individual open/close helpers are scattered, so rather than thread focus+// logic through each one we observe the `hidden` attribute on every dialog and+// centrally apply the WCAG keyboard contract: move focus in on open, trap Tab+// inside, close on Escape, and restore focus to the trigger on close.+const FOCUSABLE_SELECTOR = [+ 'a[href]',+ 'button:not([disabled])',+ 'input:not([disabled])',+ 'select:not([disabled])',+ 'textarea:not([disabled])',+ '[tabindex]:not([tabindex="-1"])',+].join(',');++function visibleFocusables(container) {+ return Array.from(container.querySelectorAll(FOCUSABLE_SELECTOR)).filter(+ (el) => !el.hidden && el.offsetParent !== null && el.getClientRects().length > 0,+ );+}++function isDialogOpen(dialog) {+ return !dialog.hidden;+}++function setupAccessibleDialogs() {+ const dialogs = Array.from(document.querySelectorAll('.market-page [role="dialog"]'));+ const triggerByDialog = new WeakMap();++ const closeDialog = (dialog) => {+ // Prefer the dialog's own close affordance so its bespoke teardown+ // (model-viewer disposal, fade-out) runs; fall back to hiding it.+ const closeBtn = dialog.querySelector(+ '[id$="-close"], .market-modal-close, .avatar-modal-close, .creator-modal-close, .market-lobby-close',+ );+ if (closeBtn) closeBtn.click();+ else dialog.hidden = true;+ };++ const onKeydown = (dialog) => (e) => {+ if (!isDialogOpen(dialog)) return;+ if (e.key === 'Escape') {+ e.preventDefault();+ closeDialog(dialog);+ return;+ }+ if (e.key !== 'Tab') return;+ const focusables = visibleFocusables(dialog);+ if (focusables.length === 0) {+ e.preventDefault();+ dialog.focus();+ return;+ }+ const first = focusables[0];+ const last = focusables[focusables.length - 1];+ const active = document.activeElement;+ if (e.shiftKey && (active === first || !dialog.contains(active))) {+ e.preventDefault();+ last.focus();+ } else if (!e.shiftKey && active === last) {+ e.preventDefault();+ first.focus();+ }+ };++ const activate = (dialog) => {+ triggerByDialog.set(+ dialog,+ document.activeElement instanceof HTMLElement ? document.activeElement : null,+ );+ if (!dialog.hasAttribute('tabindex')) dialog.setAttribute('tabindex', '-1');+ // Defer so any content the open() helper injects exists before we focus.+ requestAnimationFrame(() => {+ if (!isDialogOpen(dialog)) return;+ const focusables = visibleFocusables(dialog);+ const target =+ dialog.querySelector('[data-autofocus]') ||+ focusables.find(+ (el) => !/close/i.test(el.id) && !el.classList.contains('market-modal-close'),+ ) ||+ focusables[0] ||+ dialog;+ try {+ target.focus({ preventScroll: true });+ } catch {+ dialog.focus();+ }+ });+ };++ const deactivate = (dialog) => {+ const trigger = triggerByDialog.get(dialog);+ triggerByDialog.delete(dialog);+ if (trigger && document.body.contains(trigger)) {+ try {+ trigger.focus({ preventScroll: true });+ } catch {+ /* trigger may be gone after a re-render — no-op */+ }+ }+ };++ dialogs.forEach((dialog) => {+ dialog.addEventListener('keydown', onKeydown(dialog));++ let wasOpen = isDialogOpen(dialog);+ if (wasOpen) activate(dialog);++ const obs = new MutationObserver(() => {+ const open = isDialogOpen(dialog);+ if (open === wasOpen) return;+ wasOpen = open;+ if (open) activate(dialog);+ else deactivate(dialog);+ });+ obs.observe(dialog, { attributes: true, attributeFilter: ['hidden'] });+ });+}+function init() {bindEvents();+ setupAccessibleDialogs();loadCategories();loadList(true);loadTheme();diff --git a/src/play-agent-wallet.js b/src/play-agent-wallet.jsindex 8c40cd549..c3fdad06c 100644--- a/src/play-agent-wallet.js+++ b/src/play-agent-wallet.js@@ -27,7 +27,21 @@ import { CC_AVATAR_KEY } from './game/play-handoff.js';// ── config ──────────────────────────────────────────────────────────────────const params = new URLSearchParams(location.search);-const BRIDGE_URL = (params.get('bridge') || 'http://127.0.0.1:4402').replace(/\/$/, '');+// The agent-wallet bridge (scripts/agent-wallet-x402-bridge.mjs) holds a signing+// key in the developer's terminal session, so it only ever runs locally — there+// is no hosted production equivalent. Default to the local bridge in dev (or when+// the host is literal localhost); in production stay empty so we surface the+// designed "bridge offline" banner instead of hammering a dead 127.0.0.1 socket.+function defaultBridgeUrl() {+ const explicit = params.get('bridge');+ if (explicit) return explicit.replace(/\/$/, '');+ let isDev = false;+ try { isDev = import.meta?.env?.DEV === true; } catch (_) {}+ const host = typeof location !== 'undefined' ? location.hostname : '';+ const isLocalHost = host === 'localhost' || host === '127.0.0.1';+ return isDev || isLocalHost ? 'http://127.0.0.1:4402' : '';+}+const BRIDGE_URL = defaultBridgeUrl();// The paid endpoint the avatar buys from. three.ws prod by default so the// payment settles against the live facilitator even from local dev.const ENDPOINT = params.get('endpoint') || 'https://three.ws/api/x402/crypto-intel';@@ -529,6 +543,17 @@ function updatePayButton() {// ── bridge client ───────────────────────────────────────────────────────────async function refreshStatus() {+ if (!BRIDGE_URL) {+ // Production / no local bridge configured: skip the doomed socket and go+ // straight to the offline banner that explains how to run the bridge.+ live.bridge = 'offline';+ $('bridgeOffline').classList.add('show');+ $('lowBalance').classList.remove('show');+ $('wBal').innerHTML = '—<small>USD</small>';+ updatePayButton();+ renderStages();+ return;+ }try {const r = await fetch(`${BRIDGE_URL}/status`, { signal: AbortSignal.timeout(4000) });if (!r.ok) throw new Error('HTTP ' + r.status);@@ -555,6 +580,7 @@ async function refreshStatus() {async function loadQuote() {try {+ if (!BRIDGE_URL) throw new Error('no local bridge');const qs = new URLSearchParams({ endpoint: ENDPOINT, method: 'POST', body: JSON.stringify({ topic: activeTopic }) });const r = await fetch(`${BRIDGE_URL}/quote?${qs}`, { signal: AbortSignal.timeout(8000) });if (!r.ok) throw new Error('HTTP ' + r.status);diff --git a/src/play/arena.js b/src/play/arena.jsindex 8337a9ac4..3f577d9bf 100644--- a/src/play/arena.js+++ b/src/play/arena.js@@ -7,6 +7,9 @@// pinned over each agent's head. All data is real — no placeholders.import { ArenaWorld } from './arena-world.js';+import { createLogger } from '../shared/log.js';++const log = createLogger('arena');const NETWORK = new URLSearchParams(location.search).get('network') || 'mainnet';@@ -50,12 +53,12 @@ const labelEls = new Map(); // agentId -> { el, pos }try {await world.loadAnimations();} catch (e) {- console.warn('[arena] animations failed', e);+ log.warn('animations failed', e);}// Spectator avatar: restore saved pick, else a sensible default.const saved = localStorage.getItem(PLAYER_KEY);- try { await world.spawnPlayer(saved || '/avatars/default.glb'); } catch (e) { console.warn('[arena] player spawn', e); }+ try { await world.spawnPlayer(saved || '/avatars/default.glb'); } catch (e) { log.warn('player spawn', e); }world.setLabelUpdater(updateLabels);mountControls();@@ -144,7 +147,7 @@ async function spawnAgentsProgressively(board) {});createLabel(agent);} catch (err) {- console.warn('[arena] spawn agent', err);+ log.warn('spawn agent', err);}}};diff --git a/src/radar.js b/src/radar.jsindex 7e327550d..24a7b50d2 100644--- a/src/radar.js+++ b/src/radar.js@@ -12,6 +12,10 @@// "not measured", never as 0.// ════════════════════════════════════════════════════════════════════════════+import { createLogger } from './shared/log.js';++const log = createLogger('radar');+const POLL_MS = 12000;const DEFAULT_LIMIT = 60;@@ -182,7 +186,7 @@ async function fetchFeed({ silent = false } = {}) {render();} catch (err) {if (err.name === 'AbortError') return;- console.error('[radar] feed fetch failed:', err.message || err);+ log.error('feed fetch failed:', err.message || err);// Keep previously rendered coins on a silent (poll) failure; only blank// out to the error state when we have nothing to show.if (!state.coins.length) {@@ -734,7 +738,7 @@ async function openDrawer(mint) {renderDrawerContent(panel, coin);} catch (err) {if (err.name === 'AbortError') return;- console.error('[radar] detail fetch failed:', err.message || err);+ log.error('detail fetch failed:', err.message || err);renderDrawerError(panel, mint);}}diff --git a/src/scene-compose.js b/src/scene-compose.jsindex 50c7f0f50..2d0a83249 100644--- a/src/scene-compose.js+++ b/src/scene-compose.js@@ -23,12 +23,15 @@*/import * as THREE from 'three';+import { createLogger } from './shared/log.js';import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';import { GLTFExporter } from 'three/examples/jsm/exporters/GLTFExporter.js';import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';import { RoomEnvironment } from 'three/examples/jsm/environments/RoomEnvironment.js';+const log = createLogger('scene-compose');+// ── DOM refs ──────────────────────────────────────────────────────────────────const $ = (id) => document.getElementById(id);const canvasEl = $('cc');@@ -915,7 +918,7 @@ async function loadAvatar(url, name = 'Avatar') {}frameObject(id);} catch (err) {- console.error('Avatar load failed:', err);+ log.error('avatar load failed:', err);avatarPrompt.classList.remove('h');toast(`Failed to load avatar: ${err.message}`);} finally {diff --git a/src/viewer.js b/src/viewer.jsindex 31b3576da..cbb6def77 100644--- a/src/viewer.js+++ b/src/viewer.js@@ -245,7 +245,20 @@ export class Viewer {this._intersectionObserver.observe(this.el);}- this._onResize = this.resize.bind(this);+ // Coalesce resize bursts (a window drag, or the ResizeObserver firing+ // alongside the window 'resize' event) into one resize() per animation+ // frame — resize() reallocates the renderer + composer framebuffers and+ // may re-frame the model, which is wasteful to run several times per+ // frame. _resizeRaf holds the pending frame id; resize() runs once when+ // it fires.+ this._resizeRaf = null;+ this._onResize = () => {+ if (this._resizeRaf != null) return;+ this._resizeRaf = requestAnimationFrame(() => {+ this._resizeRaf = null;+ if (!this._disposed) this.resize();+ });+ };this._onKeyDown = (e) => {if (this.isInputFocused()) return;if (e.key === 'p' || e.key === 'P') {@@ -1321,7 +1334,10 @@ export class Viewer {_ensureAxesRenderer() {if (this.axesRenderer || !this.axesDiv) return this.axesRenderer;this.axesRenderer = new WebGLRenderer({ alpha: true });- this.axesRenderer.setPixelRatio(window.devicePixelRatio);+ // Match the main renderer's DPR cap — the tiny axes gizmo gains nothing+ // from rendering at full retina density and the extra fragments are pure+ // waste on high-DPI phones.+ this.axesRenderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));this.axesRenderer.setSize(this.axesDiv.clientWidth, this.axesDiv.clientHeight);this.axesDiv.appendChild(this.axesRenderer.domElement);return this.axesRenderer;@@ -1830,6 +1846,10 @@ export class Viewer {cancelAnimationFrame(this._rafId);this._rafId = null;}+ if (this._resizeRaf != null) {+ cancelAnimationFrame(this._resizeRaf);+ this._resizeRaf = null;+ }document.removeEventListener('visibilitychange', this._onVisibilityChange);window.removeEventListener('resize', this._onResize, false);diff --git a/vercel.json b/vercel.jsonindex 1df49e7fa..ef540b81e 100644--- a/vercel.json+++ b/vercel.json@@ -621,6 +621,22 @@"src": "/oracle/?","dest": "/oracle.html"},+ {+ "src": "/radar/?",+ "dest": "/radar.html"+ },+ {+ "src": "/smart-money/?",+ "dest": "/smart-money.html"+ },+ {+ "src": "/coin-intel/?",+ "dest": "/coin-intel.html"+ },+ {+ "src": "/compose/?",+ "dest": "/compose.html"+ },{"src": "/activity/?","dest": "/activity.html"diff --git a/vite.config.js b/vite.config.jsindex b74fae616..e715d3f22 100644--- a/vite.config.js+++ b/vite.config.js@@ -125,6 +125,15 @@ const appConfig = {},}: {}),+ // /openapi.json is generated by the api/openapi-json function and+ // rewritten from /openapi.json in prod (vercel.json). Vite dev does+ // not run that function, so forward the bare path to the upstream so+ // the API-reference link on /pump-dashboard resolves in dev too.+ '/openapi.json': {+ target: DEV_API_PROXY,+ changeOrigin: true,+ secure: true,+ },'/api': {target: DEV_API_PROXY,changeOrigin: true,@@ -340,6 +349,12 @@ const appConfig = {'pump-live': resolve(__dirname, 'pages/pump-live.html'),radar: resolve(__dirname, 'pages/radar.html'),oracle: resolve(__dirname, 'pages/oracle.html'),+ activity: resolve(__dirname, 'pages/activity.html'),+ 'coin-intel': resolve(__dirname, 'pages/coin-intel.html'),+ trending: resolve(__dirname, 'pages/trending.html'),+ compose: resolve(__dirname, 'pages/compose.html'),+ 'create-next': resolve(__dirname, 'pages/create-next.html'),+ 'mint-success': resolve(__dirname, 'pages/mint-success.html'),'bulk-launch': resolve(__dirname, 'pages/bulk-launch.html'),'pump-dashboard': resolve(__dirname, 'pages/pump-dashboard.html'),autopilot: resolve(__dirname, 'pages/autopilot.html'),@@ -688,6 +703,18 @@ support: resolve(__dirname, 'pages/support.html'),'/radar/': resolve(root, 'pages/radar.html'),'/oracle': resolve(root, 'pages/oracle.html'),'/oracle/': resolve(root, 'pages/oracle.html'),+ '/activity': resolve(root, 'pages/activity.html'),+ '/activity/': resolve(root, 'pages/activity.html'),+ '/trending': resolve(root, 'pages/trending.html'),+ '/trending/': resolve(root, 'pages/trending.html'),+ '/coin-intel': resolve(root, 'pages/coin-intel.html'),+ '/coin-intel/': resolve(root, 'pages/coin-intel.html'),+ '/compose': resolve(root, 'pages/compose.html'),+ '/compose/': resolve(root, 'pages/compose.html'),+ '/create/next': resolve(root, 'pages/create-next.html'),+ '/create/next/': resolve(root, 'pages/create-next.html'),+ '/mint-success': resolve(root, 'pages/mint-success.html'),+ '/mint-success/': resolve(root, 'pages/mint-success.html'),'/pump-dashboard': resolve(root, 'pages/pump-dashboard.html'),'/pump-dashboard/': resolve(root, 'pages/pump-dashboard.html'),'/autopilot': resolve(root, 'pages/autopilot.html'),@@ -873,6 +900,14 @@ support: resolve(__dirname, 'pages/support.html'),res.setHeader('Location', '/studio');return res.end();}+ // Bare /agent 301s to the agents directory in prod (vercel.json);+ // the standalone agent token page lives at /agent/index.html. Mirror+ // the redirect so dev matches prod instead of 404ing.+ if (path === '/agent' || path === '/agent/') {+ res.statusCode = 301;+ res.setHeader('Location', '/agents');+ return res.end();+ }// /coin is the legacy URL for /demo/coin (the lottery+reflection// demo). Kept as a 301 so old links and shares keep working.if (path === '/coin' || path === '/coin/') {@@ -920,6 +955,17 @@ support: resolve(__dirname, 'pages/support.html'),const slug = path.replace(/^\/blog\//, '').replace(/\/$/, '');filePath = resolve(root, `blog/${slug}.html`);}+ // /news and /news/<slug> → public/news/(index|<slug>).html on disk.+ // Mirrors the prod vercel.json rewrite so the homepage press-strip+ // links resolve in dev instead of 404ing (slug allows underscores+ // and the numeric post ids used by some entries).+ else if (!filePath && /^\/news\/?$/.test(path)) {+ filePath = resolve(root, 'public/news/index.html');+ } else if (!filePath && /^\/news\/[a-z0-9_-]+\/?$/.test(path)) {+ const slug = path.replace(/^\/news\//, '').replace(/\/$/, '');+ const candidate = resolve(root, `public/news/${slug}.html`);+ if (existsSync(candidate)) filePath = candidate;+ }// /demos/<slug> or /demos/<slug>.html → resolves to public/demos/<slug>.html on diskelse if (!filePath && /^\/demos\/[a-z0-9-]+(\.html)?\/?$/.test(path)) {const slug = path