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
chore: commit pending workspace changes across api, sdk, pages, and docs
nirholasfaf4ee55ddb2
diff --git a/.env.example b/.env.exampleindex 4afedd5d4..fc14f9db6 100644--- a/.env.example+++ b/.env.example@@ -863,6 +863,11 @@ TWITTER_BEARER_TOKEN=# Create a bot via https://t.me/BotFather → /newbot.TELEGRAM_BOT_TOKEN=+# Telegram changelog channel — scripts/changelog-telegram.mjs posts new+# changelog entries here (npm run changelog:push). Use the channel @handle or+# the -100… numeric id; the bot above must be an admin of the channel.+TELEGRAM_CHANGELOG_CHAT_ID=+# ── x402 spending ledger ─────────────────────────────────────────────────────# Set to "1" to allow the per-user x402 spending ledger to fall back to an# in-process Map when Upstash Redis is unreachable. ONLY enable in dev — in@@ -959,3 +964,12 @@ CC_DEFAULT_TOKEN=# Meshy AI — 3D generation MCP server (Pro plan required: meshy.ai/settings/api)MESHY_API_KEY=msy_your_key_here++# ─── DCA strategies (api/dca-strategies.js) ──────────────────────────────────+# Token symbols a DCA strategy may buy (comma-separated, resolved against the+# strategy's chain at execution time). Empty/unset → strategy creation returns+# 400 not_configured. Per project policy no token tickers are hardcoded in code.+DCA_ALLOWED_TOKEN_OUT=+# Default EVM chain id for new strategies when the client omits chain_id+# (e.g. 8453 for Base mainnet). Unset → chain_id is required per-request.+DCA_CHAIN_ID=diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5645bac70..90c96ca8c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1,12 +1,36 @@# Changelog-<!-- Generated from data/pages.json by scripts/build-page-index.mjs — DO NOT EDIT BY HAND. -->+<!-- Generated from data/pages.json + data/changelog.json by scripts/build-page-index.mjs — DO NOT EDIT BY HAND. Add updates to data/changelog.json. -->-Public feature history for [three.ws](https://three.ws), newest first. Feature dates are tracked from 2026-05-25 forward; earlier pages are omitted.+Public history for [three.ws](https://three.ws), newest first. New pages come from `added` dates in data/pages.json; everything else is curated in data/changelog.json. Also available as [JSON](https://three.ws/changelog.json) and [RSS](https://three.ws/changelog.xml), live at [three.ws/changelog](https://three.ws/changelog).++## 2026-06-11++- **Faster, quieter agents directory and site-wide page polish** — The on-chain agents directory now loads from our server-side index instead of contacting every agent's metadata host from your browser — pages render faster and no longer spray network errors. Also: the pump.fun cockpit's sidebar pages are now shareable deep links, mobile nav and footer links meet touch-target guidelines, anonymous visitors no longer trigger failed sign-in requests on Walk and Create, and assorted dead links were removed. (`/agents`) `[improvement, fix]`+- **Text-to-3D and image-to-3D generation restored** — Fixed two provider regressions that blocked Forge generation: model submissions now pin the latest published model version automatically, and the text-to-image step falls back to a healthy provider instead of failing when the preferred one is misconfigured. (`/forge`) `[fix]`++## 2026-06-10++- **WebRTC relay and x402 telemetry** — Added a Session Description Protocol relay for WebRTC handshakes and instrumented every paid x402 surface for Provider Hub telemetry, with hardened rate limiting. `[feature, infra]`## 2026-06-09- **Agent Lookup** (`/lookup`) — Resolve any three.ws agent by Solana mint, agent ID, avatar ID, or slug — renders its interactive 3D avatar alongside its on-chain identity (collection, owner, agent wallet, Active/x402 status, Metaplex/Solscan/Magic Eden links).+- **New Claude models in every agent brain** — Claude Fable 5 and Mythos 5 are now available across agent brain selectors, pricing tables, and the x402 provider catalog. `[feature]`++## 2026-06-08++- **Bounty board with AI judge** — Bounty submissions now support liking, AI-powered scoring, and per-bounty leaderboards — submissions are ranked by a platform-powered judge. `[feature]`+- **Public agent profiles with shared memories** — Agents can now have public profile pages that surface their shared memories, plus Replicate model provider support and public agent directory resolution. `[feature]`++## 2026-06-07++- **AIXBT market intelligence for agents** — Agents and in-world NPCs can now tap AIXBT market intelligence — token analysis, project data, and grounding served through new API endpoints. `[feature]`++## 2026-06-06++- **Forge editing upgrades** — Forge gained an animation system, pose studio, magic-brush stylization, multi-view rendering, and faster segment/animate/texture workers. `[improvement]`+- **IBM Granite models over MCP and x402** — Published an MCP package exposing IBM Granite chat, code, embedding, and forecasting models with x402 pay-per-call routing. `[sdk]`## 2026-06-05@@ -25,10 +49,36 @@ Public feature history for [three.ws](https://three.ws), newest first. Feature d- **Studio — Embeddable AI Widget Builder** (`/features/studio`) — Configure avatar, voice, and knowledge base in the Widget Studio, then copy one script tag to embed a 3D AI agent anywhere.- **Voice Lab** (`/voice`) — Clone your voice from a short recording, then use it for TTS or give it to your agent. Side-by-side comparison of voice models.- **Walk — 3D Avatar AR** (`/features/walk`) — Drive your AI agent's 3D avatar with WASD or joystick. Toggle AR mode and it walks on your real floor through your phone camera.+- **Cosmetics economy in the game world** — A cosmetics shop inside the 3D game world — buy avatar customizations via x402, trade them peer-to-peer, and earn from cosmetics usage. `[feature]`+- **Privy wallet sign-in** — Wallet-native sign-in via Privy with JWKS verification and DID linking — log in securely without managing passwords. `[feature, security]`+- **Pump.fun autopilot and guided agent creation** — Automated token launching and trading via pump.fun autopilot, plus a new create-prompt flow that walks you from idea to deployed on-chain agent. `[feature]`## 2026-06-03- **three.ws on IBM watsonx — Agent Galaxy** (`/ibm/galaxy`) — three.ws is an IBM Business Partner. Open-source 3D AI agents that think on IBM Granite via watsonx.ai and give watsonx Orchestrate agents a face, voice, and on-chain identity.+- **Autonomous agent-to-agent trading** — Agents can now negotiate with each other, pay for crypto intelligence via x402 micropayments, and settle on-chain — fully autonomously. `[feature]`+- **Voice cloning and real-time lip-sync** — ElevenLabs text-to-speech is now wired through the platform: voice cloning, real-time lip-sync, and per-voice settings for every agent. `[feature]`+- **x402 payment hardening** — Hardened payment processing with Solana transaction confirmation, replay-attack guards, payment-intent deduplication, and sanitized errors across MCP bridges. `[security, fix]`++## 2026-06-02++- **Every agent gets its own wallet** — Each agent now has a deterministic Solana wallet for self-custodied payments — agents can send SOL and settle x402 transactions autonomously. `[feature]`+- **Four production MCP servers** — 3D Studio (text-to-3D, model inspection), x402 Bazaar (service discovery and payment), IBM watsonx (LLM access), and Pump.fun (token operations) — all published with manifests and docs. (`/docs/mcp`) `[sdk]`++## 2026-06-01++- **City world** — An isometric 3D city with player movement, collision, minimap, and avatar animation — a new kind of world to explore as your agent. `[feature]`+- **Quests, loot, mounts, and realms** — The multiplayer game layer now includes quests, loot drops, mounts, and realm-based gameplay with a token-managed in-game economy. `[feature]`++## 2026-05-31++- **Holder-gated worlds** — Every coin world now has two rooms: General (open to all) and Holders (gated by minimum token holdings, verified server-side). `[feature]`+- **Keyframe animation in Pose Studio** — Create, edit, and export full-body avatar animations on a keyframe timeline — with easing functions and export to JSON or GLB. `[feature]`+- **Spatial voice chat in coin worlds** — Proximity-based voice chat inside multiplayer worlds — you hear players based on distance, with speaking indicators, voice activity detection, and audio panning. `[feature]`++## 2026-05-30++- **Coin Communities — live 3D coin worlds** — Every pump.fun coin gets a deterministic 3D world. Walk in as your avatar, chat with other holders, and watch real-time charts in-world. `[feature]`## 2026-05-29@@ -37,6 +87,11 @@ Public feature history for [three.ws](https://three.ws), newest first. Feature d- **Pay-As-You-Learn Tutor** (`/tutor`) — Ask anything and pay a cent per answer. A pay-as-you-learn AI tutor that bills $0.01 per explanation in USDC over x402, with a live itemized session invoice and signed attestation.- **x402 Arbitrage** (`/arbitrage`) — Cross-provider price disparities surfaced live from the merged x402 facilitator catalog. Find the cheapest endpoint for any capability.- **x402 Providers** (`/providers`) — Quantified operator profiles for the x402 paid API catalog. Service counts, price bands, dominant categories, and the underlying listings.+- **Live trade streaming and zen mode** — The pump.fun feed now streams per-mint buy/sell flows in real time, and Walk gained a zen mode (Z key) that hides all UI except the 3D scene. `[feature, improvement]`++## 2026-05-28++- **Faster, more reliable deploys** — Updated the Solana SDK bridge and fixed build memory limits and per-file timeouts that could stall deployments. `[fix, infra]`## 2026-05-27@@ -44,6 +99,13 @@ Public feature history for [three.ws](https://three.ws), newest first. Feature d- **Fact Checker** (`/fact-checker`) — Pay $0.10 per claim. The agent searches across authoritative sources, pays per retrieval via x402, and returns a verdict with cited evidence and a signed attestation.- **Get Started** (`/start`) — 5-step onboarding wizard: create a 3D avatar, name your agent, enable skills, deploy an embed widget, and set up monetization — all in under 5 minutes.- **Unstoppable Agent** (`/unstoppable`) — Live dashboard for an autonomous agent that funds itself via x402 micropayments. Watch its balance, earnings, costs, and daily reflections in real time.+- **Brain page — race LLMs side by side** — Run simultaneous inference across Claude, GPT, Qwen, and more with streaming latency comparison, plus a face-quality module that scores avatar facial fidelity. `[feature]`+- **Unified dashboard** — Dashboard routes consolidated under /dashboard — agents, avatars, analytics, settings, and billing in one place. (`/dashboard`) `[improvement]`++## 2026-05-26++- **Avatar regeneration tracking and grounded AR** — Avatar regeneration jobs are now trackable, and AR mode freezes the follow-cam so avatars walk in world space instead of always facing the camera. `[improvement]`+- **three.ws on AWS Marketplace** — Subscribe through AWS Marketplace and automatically receive x402 API keys, with subscription status enforced across the platform. (`/docs/listings`) `[feature, infra]`## 2026-05-25@@ -56,23 +118,133 @@ Public feature history for [three.ws](https://three.ws), newest first. Feature d- **Playground** (`/playground`) — Sandbox for experimenting with agents, prompts, and 3D scenes.- **Selfie to Avatar** (`/create/selfie`) — One selfie. About a minute. A rigged 3D avatar that works everywhere.- **x402 Bazaar** (`/bazaar`) — Search and browse the x402 facilitator catalog. Filter by network, price, and extensions. Pay any service in one click.+- **Search engines find everything faster** — Dynamic chunked sitemaps backed by live database queries, JSON-LD structured data for agents and avatars, and IndexNow integration for instant search discovery. `[infra, improvement]`## 2026-05-24- **Widget Studio** (`/studio`) — Pick an avatar, configure embed options, copy a one-line snippet for your site.+- **Avatar review with live 3D preview** — The create-review step now embeds a full TalkScene 3D viewer with idle animations and a responsive mobile layout. `[improvement]`+- **Marketplace asset pricing and purchases** — Asset pricing, purchase flows, payment modals, and time-pass licensing — avatar customizations and plugins are now monetizable. `[feature]`++## 2026-05-23++- **Pay by name with SNS** — Solana Name Service integration — claim threews.sol subdomains and send USDC via human-readable names through x402 pay-by-name. `[feature]`++## 2026-05-21++- **Agent-to-agent protocol** — A2A client/server, MCP bridge, spending ledger, and receipts storage — agents can securely request services from each other with x402 payment coordination. `[feature, sdk]`+- **Agent-UI SDK released** — Published @three-ws/agent-ui for embedding 3D avatars in any web app — animation, click reactions, mouse tracking, and movement behaviors. `[sdk]`+- **Avatar Agent MCP in Anthropic's registry** — Published avatar-agent-mcp to Anthropic's official MCP registry — 40+ tools for avatar generation, token launches, GLB rendering, and on-chain transactions. `[sdk]`+- **Pole Club — micro-tip performances** — A 3D club with four stages where USDC micro-tips ($0.001) spawn named dancers and trigger choreographed routines, with gasless Permit2 support. (`/club`) `[feature]`+- **x402 Bazaar infrastructure** — Bazaar listing and search with x402 subscriptions, paid-tier access control, idempotency caching, and offer receipts for service monetization. `[feature, infra]`## 2026-05-20- **Hydrate** (`/hydrate`) — Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.+- **Buybacks and WASM vanity addresses** — Added a pump-swap buyback flow and a WebAssembly vanity address grinder for custom token launch addresses. `[feature]`+- **Platform-wide security hardening** — SSRF guards on outbound fetches, CSRF gates on admin and key management, per-IP rate limiting on shared API quotas, and fail-closed cron handlers. `[security]`++## 2026-05-19++- **USDC pairs for pump.fun v2** — USDC trading pair support for pump.fun v2 coins with automatic bonding-curve quote detection. `[feature]`## 2026-05-18- **Launchpad Studio** (`/launchpad`) — Build a hosted 3D launchpad, token page, concierge, or showroom on a three.ws subdomain.+- **Live feed mode in the token visualizer** — The pump.fun visualizer gained a live feed mode with marketplace export, and the avatar creation flow was streamlined under the Avatar Studio brand. `[feature, improvement]`+- **Selfie-to-avatar reconstruction pipeline** — Native photo-to-3D reconstruction — submit selfies and get a fully rigged GLB avatar with automatic mesh optimization, resilient to long-running transforms. `[feature]`+- **Solana Seeker mobile support** — Mobile Wallet Adapter integration for Solana Seeker and Saga devices, with a Solana dApp Store listing and Seed Vault authentication. `[feature]`++## 2026-05-17++- **Agent personalization and on-chain economy scaffolding** — Persona extraction from voice interviews, memory seeds from GitHub/X/Farcaster, instant voice cloning, a bonding-curve simulator, and EAS attestation reputation. `[feature]`+- **News syndication** — News posts auto-publish to Dev.to and Medium with canonical links back to three.ws, and WebSub pushes keep RSS subscribers current. `[infra]`+- **Server-side avatar regeneration** — Restyle, remesh, retexture, and rerig avatars with server-backed Replicate compute — results cached automatically in R2. `[feature]`+- **Talk mode, avatar SDK, and 5–10x smaller avatars** — Talk mode with camera presets and ARKit-52 blendshapes, a public avatar SDK with React exports, new brain/TTS/identity APIs, and a GLB bake pipeline with WebP compression that cuts asset sizes 5–10x. `[feature, sdk]`+- **Talking avatars with audio-driven lip-sync** — Real-time lip-sync reads TTS audio and morphs avatar mouth shapes, integrated into talk scenes with camera presets and emotes. `[feature]`+- **Team launches with creator-signer split** — Token launches now support separate signer and creator wallets — the signer pays gas while the creator receives on-chain royalties. `[feature]`## 2026-05-15- **Strategy Lab** (`/strategy-lab`) — Build DCA and subscription strategies that trade on-chain on your behalf.+- **Avatar accessories and launchpad redesign** — Avatar customization now supports accessories, and the coin launchpad interface was redesigned for clarity. `[improvement]`+- **Token visualizer search and sort** — The interactive 3D token universe gained search by name/symbol/mint and sorting by market cap, live status, replies, and age — refreshing every 60 seconds. `[feature]`++## 2026-05-14++- **15 tutorials and six new paid endpoints** — New developer walkthroughs from embed quickstart to multi-agent coordination, plus six x402 paid endpoints including agent reputation, identity verify, and skill marketplace. `[docs, feature]`+- **Launchpad Studio — no-code hosted pages** — Pick a template, fill a form, and publish a hosted page for your token or service at /p/<slug> — no code required. `[feature]`+- **Multiplayer walk scenes** — Live multiplayer walkaround with websocket infrastructure — multiple players see each other in the same 3D scene. `[feature, infra]`+- **x402 commerce — SKUs and hosted checkout** — Stripe-like payment UX for x402: define SKUs, share hosted checkout links, and track settlement history — settled on Base via Coinbase CDP. `[feature]`++## 2026-05-13++- **Autonomous X Spaces voice agent** — A cloud voice agent that joins X Spaces and holds real-time conversations using streaming audio and transcription. `[feature]`## 2026-05-10- **Walk** (`/walk`) — Drive a 3D avatar around with a joystick or WASD — toggle the back camera for AR-style passthrough.+- **Launch-week recap published** — An interactive case study of launch week (Apr 29 – May 9) with the architecture timeline, partner ecosystem, lessons learned, and live engagement metrics. `[docs]`+- **Marketplace v2 and creator dashboard** — Redesigned marketplace with trials, time passes, billing receipts, featured avatar galleries, and theme selection. `[feature]`+- **Monetization v2** — Trials, time-based access passes, withdrawal processing, signed receipts, multi-wallet support, and 5% referral splits. `[feature]`++## 2026-05-09++- **Vanity wallet addresses** — Vanity address grinders for Solana and Ethereum, plus co-sign helpers for parallel token launches. `[feature]`++## 2026-05-08++- **$THREE holder gating** — Holder-gated access now works with a simple on-chain $THREE balance check — no vault setup required. `[feature]`+- **Agent Payments SDK v3.1.0 — multi-chain** — Solana v2 bonding curve support plus Base, Polygon, and Ethereum with cross-chain payment routing. `[sdk]`+- **Agents that feel the room** — Agents now react to user sentiment with emotion expressions and animations — empathy, concern, celebration, patience, curiosity. `[feature]`+- **Payments inside chat** — The full agent payments lifecycle is available in chat — balance checks, fund distribution, withdrawals, and USDC whitelist monitoring. `[feature]`+- **Pick your agent's model** — Chat moved to unified streaming with per-agent model selection across Anthropic, OpenRouter, Groq, and OpenAI. `[feature]`+- **Trading tools in chat** — Five real trading tools in agent chat: buy, sell, portfolio view, and live price quotes with custom slippage control. `[feature]`+- **x402 spec v2** — Upgraded the payment protocol to spec v2 with CAIP-2 network IDs, Bazaar integration, and marketplace listing support. `[improvement, sdk]`++## 2026-05-04++- **Avatar reactions to market events** — Community and personal avatar selection with real-time gesture animations during market events. `[improvement]`+- **JavaScript SDK launch** — The official three.ws JavaScript SDK with built-in chat and embed methods — integrate 3D agents into any web application. `[sdk]`+- **Real-time multiplayer sync** — Live multiplayer support with real-time room creation, player interactions, and synchronized state. `[feature]`+- **Richer pump.fun feed** — Graduation event parsing, gesture animations, and live market cap display in the pump.fun dashboard. `[improvement]`+- **Sell your agent's skills** — Skill pricing, purchase buttons, and a payment intent API — creators can gate premium skills behind subscriptions or one-time purchases. `[feature]`++## 2026-05-01++- **Lip-sync and Solana Blinks** — Real-time viseme morphing from audio, plus Solana Blinks support so agents can parse and execute on-chain actions. `[feature]`+- **Plugin marketplace** — Search, install, and manage community-published agent skills using the open ToolManifest format. `[feature]`+- **Reputation and staking** — Agent reputation panel with ETH staking for trust signals — reputation accumulates through validator actions tracked on-chain. `[feature]`++## 2026-04-30++- **Chat with voice** — Native LLM chat launched with live voice input/output and real-time transcription for agent conversations. (`/chat`) `[feature]`++## 2026-04-29++- **On-chain agents on Solana and EVM** — Unified deployment stack — agents register on Ethereum, Base, Polygon, and Solana with passport pages, reputation, and attestations. `[feature]`+- **Pump.fun launch and trading stack** — Token creation, bonding-curve swaps, KOL trade tracking, automated wallet monitoring, and a vanity address grinder for custom Solana prefixes. `[feature]`+- **Solana Agent SDK** — Actions for token transfers, SPL swaps, balance queries, and stake attestations, with transaction builders and fee estimation. `[sdk]`+- **three.ws in Anthropic's MCP Registry** — Published to the official MCP Registry — Claude can deploy agents, create tokens, and run wallet operations on three.ws via the standard MCP protocol. `[sdk, infra]`+- **x402 micropayments** — Facilitator-mediated USDC micropayments — MCP clients authorize requests with payment headers, with per-tool pricing and subscription bypass. `[feature, sdk]`++## 2026-04-27++- **3D viewer polish** — Better first-load camera framing, keyboard shortcuts, saved per-agent animation preferences, and improved mobile accessibility. `[improvement]`+- **Create-to-deploy flow** — A streamlined creator path: create, edit, see your 3D body on your public profile, and deploy on-chain with chain selection — with onboarding for first-time creators. `[feature]`+- **Hello, three.ws** — The platform rebranded from 3D Agent to three.ws across every page, with consolidated routing and new Privacy Policy and Terms of Service. `[improvement]`++## 2026-04-17++- **Avatars that never sit still** — A four-channel idle animation loop — breathing, eye saccades, blinks, weight shifts — keeps avatars naturally alive during silence. `[feature]`+- **Embeds with action bridges** — Agent embeds can be hosted on external sites with persistent state, live Studio preview, and bridges for inter-agent communication. `[feature]`+- **On-chain agent discovery** — The /discover page lists every ERC-8004 agent owned by your wallet with one-click import, plus a LobeHub plugin for LLM orchestration. (`/discover`) `[feature]`++## 2026-04-16++- **Widget Studio is born** — The first version of Widget Studio — build, preview, and save custom avatar widgets with a drag-drop editor and live updates. `[feature]`++## 2026-04-15++- **3D model validation tools** — Model validation, inspection, and optimization APIs for GLB/FBX files — asset analysis and format conversion to guarantee avatar quality. `[feature, sdk]`+- **Wallet sign-in and on-chain identity** — Sign-In with Ethereum, wallet integration, and the ERC-8004 Passport widget — agents display cryptographic proof of identity tied to wallet ownership. `[feature, security]`diff --git a/CLAUDE.md b/CLAUDE.mdindex e3de12e43..1e4907290 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -114,6 +114,16 @@ Fix every issue found. Then report complete.- Use TodoWrite for any task with 3+ steps. Mark items complete in real time.- Communication: short. State what you did, what's next. No trailing recaps.+## Changelog: every user-visible change gets an entry++$THREE holders follow the public changelog (three.ws/changelog, RSS, JSON, Telegram). Keep it alive:++- **New page?** Nothing extra — the `added` date in `data/pages.json` feeds the changelog automatically.+- **Everything else users would notice** (feature, improvement, fix, SDK release, security work): append an entry to `data/changelog.json` — date, holder-readable title + summary (plain language, no commit jargon), tags from: feature, improvement, fix, sdk, infra, docs, security. Optional `link` must be a live page path.+- `npm run build:pages` regenerates CHANGELOG.md, public/changelog.json, and public/changelog.xml — it also validates your entry and fails the build on a malformed one.+- After the change is deployed, `npm run changelog:push` posts new entries to the holders' Telegram channel (needs `TELEGRAM_BOT_TOKEN` + `TELEGRAM_CHANGELOG_CHAT_ID`; use `--dry-run` to preview). Skip silently if creds are absent locally.+- Internal-only chores (CI, lockfiles, refactors with no visible effect) do NOT get entries.+## Commit & push: do it immediately, no questionsWhen the user says commit and/or push, execute it right away. Do NOT run the completionist subagent, audits, tests, diff reviews, scans, or any other pre-commit step first. Do NOT ask clarifying questions or pause for confirmation — staging, committing, and pushing IS the explicit approval. Just run the git commands and report the result.diff --git a/agent-payments-sdk/FORK_NOTES.md b/agent-payments-sdk/FORK_NOTES.mdindex 31f9f9b15..b1e6b4bdd 100644--- a/agent-payments-sdk/FORK_NOTES.md+++ b/agent-payments-sdk/FORK_NOTES.md@@ -123,6 +123,15 @@ auto-links from the `workspaces` array.> bundle keeps its own copy on the public package). That duplication predates this> work and is a separate cleanup; it is not a blocker here.+## Test fixtures++`src/solana/fixtures/pump-events/*.json` are real captured pump.fun logs whose+event payloads were re-encoded (same `BorshEventCoder` layouts) so the coin is+`$three` (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`), the bonding curve is+its derived PDA, and wallets/signatures are deterministic synthetics+(`sha256("three.ws/fixture/<label>")`). Amounts, reserves, discriminators, and+program-invoke structure are untouched, so decoder coverage is unchanged.+## Consumers (repo-wide, excluding the fork itself)Core (agent-payments program): `api/agents/payments/[action].js`,diff --git a/agent-payments-sdk/src/solana/PumpTradeClient.test.ts b/agent-payments-sdk/src/solana/PumpTradeClient.test.tsindex c04ae09a4..d59f6d93b 100644--- a/agent-payments-sdk/src/solana/PumpTradeClient.test.ts+++ b/agent-payments-sdk/src/solana/PumpTradeClient.test.ts@@ -25,8 +25,8 @@ import { describe, expect, it, vi } from "vitest";// ─── Shared test fixtures ────────────────────────────────────────────────────-const FAKE_MINT = new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"); // arbitrary test mint-const FAKE_USER = new PublicKey("DRiP2Pn2K6fuMLKQmt5rZWyHiUZ6WK3GChEySUpHSS4");+const FAKE_MINT = new PublicKey("FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump"); // $three+const FAKE_USER = new PublicKey("9TbHoj4ass7pbyp1ihAFD8dXg3wbYTQ8R2kmJBXgbuno"); // synthetic (sha256 "three.ws/fixture/trade-user")const USDC_MINT = new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");// Discriminators from pump-public-docs/idl/pump.ts@@ -43,7 +43,7 @@ function makeBondingCurve(overrides: Partial<Record<string, unknown>> = {}) {realQuoteReserves: new BN(0),tokenTotalSupply: new BN("1000000000000000"),complete: false,- creator: new PublicKey("DRiP2Pn2K6fuMLKQmt5rZWyHiUZ6WK3GChEySUpHSS4"),+ creator: new PublicKey("9TbHoj4ass7pbyp1ihAFD8dXg3wbYTQ8R2kmJBXgbuno"), // synthetic (sha256 "three.ws/fixture/trade-user")isMayhemMode: false,isCashbackCoin: false,quoteMint: PublicKey.default,@@ -55,7 +55,7 @@ function makeGlobal() {return {initialized: true,authority: PublicKey.default,- feeRecipient: new PublicKey("CebN5WGQ4jvEPvsVU4EoHEpgzq1VV7AbicfhtW4xC9iM"),+ feeRecipient: new PublicKey("urRdaqmYh6PSkUXeeymzaUc5EWNydR8gkKsZ5r5sak1") /* synthetic fee recipient */,initialVirtualTokenReserves: new BN("1073000000000000"),initialVirtualSolReserves: new BN("30000000000"),initialRealTokenReserves: new BN("793100000000000"),@@ -70,7 +70,7 @@ function makeGlobal() {adminSetCreatorAuthority: PublicKey.default,createV2Enabled: true,whitelistPda: PublicKey.default,- reservedFeeRecipient: new PublicKey("CebN5WGQ4jvEPvsVU4EoHEpgzq1VV7AbicfhtW4xC9iM"),+ reservedFeeRecipient: new PublicKey("urRdaqmYh6PSkUXeeymzaUc5EWNydR8gkKsZ5r5sak1") /* synthetic fee recipient */,mayhemModeEnabled: false,reservedFeeRecipients: [],isCashbackEnabled: true,diff --git a/agent-payments-sdk/src/solana/fixtures/pump-events/create.json b/agent-payments-sdk/src/solana/fixtures/pump-events/create.jsonindex c82052e6a..d573bcc79 100644--- a/agent-payments-sdk/src/solana/fixtures/pump-events/create.json+++ b/agent-payments-sdk/src/solana/fixtures/pump-events/create.json@@ -1,5 +1,5 @@{- "signature": "3fXpU7cbTdMRJxFxD9Q1ySs8oSzUSBYA2dpBas9r7oz4WpgadDMYGJEfSNoXmdpDV1V3vQHoc1frDyqXyqkj9aMM",+ "signature": "myh6UkE6NiY5NnBVGbdH6AkvJpHkp4eepyTi3Xgvt3eyZ4dLmpajPLg93c8Ss6j2PXWVBeZpf7aeUsBqJNjRqLK","slot": 418302440,"logMessages": ["Program ComputeBudget111111111111111111111111111111 invoke [1]",@@ -88,7 +88,7 @@"Program log: Instruction: SetAuthority","Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb consumed 958 of 116724 compute units","Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb success",- "Program data: G3KpTd7rY3YJAAAAT25seUZyZW5zCQAAAE9OTFlGUkVOU1AAAABodHRwczovL2lwZnMuaW8vaXBmcy9iYWZrcmVpYnB3MnozZ2I2aWlkZWlmZHBleDZucHRlcnJ6azI0c3Q0bWx2ZDR4c3hmY3dla2ZzNXJxNFmXBwdqzOHT/qKt/nTlJHlVU5uvfcj/MDPbmc30jguvBKdowvekdf4keTNdXfxc92Sc9l7FpU7t5h66x0oxbh4lPcM611JHuuH0dAQIH8lrpAKxr0FgLhkZi8UywigtESU9wzrXUke64fR0BAgfyWukArGvQWAuGRmLxTLCKC0R/UL9aQAAAAAAENhH488DAACsI/wGAAAAAHjF+1HRAgAAgMakfo0DAAbd9uHudY/eGEJdvORszdq2GvxNg7kNJ/69+SjYoYv8AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsI/wGAAAA",+ "Program data: G3KpTd7rY3YFAAAAdGhyZWUFAAAAVEhSRUUkAAAAaHR0cHM6Ly90aHJlZS53cy9tZXRhZGF0YS90aHJlZS5qc29u2ZVjWutPpM4GwcaGCtZ/nwnCndz3rr4UV+ClQQF2Px9Ovzbp6+1L0673XjEODyMx+/KnEPyXghVbDHHrgfZNKMr1/cnIjew7vJKLq2Co1+/igxzw7VEobt4RTNmlQ4FeyvX9yciN7Du8kourYKjX7+KDHPDtUShu3hFM2aVDgV79Qv1pAAAAAAAQ2EfjzwMAAKwj/AYAAAAAeMX7UdECAACAxqR+jQMABt324e51j94YQl285GzN2rYa/E2DuQ0n/r35KNihi/wBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKwj/AYAAAA=","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [2]","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 2087 of 108968 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success",@@ -131,7 +131,7 @@"Program 11111111111111111111111111111111 success","Program 11111111111111111111111111111111 invoke [2]","Program 11111111111111111111111111111111 success",- "Program data: vdt/007mYe5ZlwcHaszh0/6irf505SR5VVObr33I/zAz25nN9I4Lr7kFLJMAAAAAfj+0RTZKAAABJT3DOtdSR7rh9HQECB/Ja6QCsa9BYC4ZGYvFMsIoLRH9Qv1pAAAAALmxT48HAAAAgtAjAq2FAwC5BSyTAAAAAII4EbYbhwIA2kw4zW23Q49ZtAi7nsO0yp6K0fHyRlPEmbV5bCDb+bNfAAAAAAAAABfsZQEAAAAAJT3DOtdSR7rh9HQECB/Ja6QCsa9BYC4ZGYvFMsIoLREeAAAAAAAAADAHcQAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAGJ1eQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALkFLJMAAAAAubFPjwcAAAC5BSyTAAAAAA==",+ "Program data: vdt/007mYe7ZlWNa60+kzgbBxoYK1n+fCcKd3PeuvhRX4KVBAXY/H7kFLJMAAAAAfj+0RTZKAAAByvX9yciN7Du8kourYKjX7+KDHPDtUShu3hFM2aVDgV79Qv1pAAAAALmxT48HAAAAgtAjAq2FAwC5BSyTAAAAAII4EbYbhwIA2kw4zW23Q49ZtAi7nsO0yp6K0fHyRlPEmbV5bCDb+bNfAAAAAAAAABfsZQEAAAAAyvX9yciN7Du8kourYKjX7+KDHPDtUShu3hFM2aVDgV4eAAAAAAAAADAHcQAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAGJ1eQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALkFLJMAAAAAubFPjwcAAAC5BSyTAAAAAA==","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [2]","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 2087 of 16423 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success",@@ -141,13 +141,13 @@"expected": {"name": "CreateEvent","data": {- "name": "OnlyFrens",- "symbol": "ONLYFRENS",- "uri": "https://ipfs.io/ipfs/bafkreibpw2z3gb6iideifdpex6npterrzk24st4mlvd4xsxfcwekfs5rq4",- "mint": "72irZhpS2nhxbP3h4xh5cCZq7BNtnUJPho6ZRamspump",- "bonding_curve": "KAgvdxZTMXj8EfaQvk2LCUzcH98iqxsN37tbT5gMZJu",- "user": "3WNi4g2ftVvRyYW68xyDxCBVrfXHbHjJUpdwHs7WsXcC",- "creator": "3WNi4g2ftVvRyYW68xyDxCBVrfXHbHjJUpdwHs7WsXcC",+ "name": "three",+ "symbol": "THREE",+ "uri": "https://three.ws/metadata/three.json",+ "mint": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump",+ "bonding_curve": "6JPusJUySKktd56HCeQ54kZ4WUNb7fD4GqAQvyDDqMqy",+ "user": "EfGuqT1kULbyhKooeTDrWeMTHEDEGhi8rdWGwdK23kMj",+ "creator": "EfGuqT1kULbyhKooeTDrWeMTHEDEGhi8rdWGwdK23kMj","timestamp": "69fd42fd","virtual_token_reserves": "03cfe347d81000","virtual_sol_reserves": "06fc23ac00",@@ -160,4 +160,4 @@"virtual_quote_reserves": "06fc23ac00"}}-}\ No newline at end of file+}diff --git a/agent-payments-sdk/src/solana/fixtures/pump-events/trade-buy.json b/agent-payments-sdk/src/solana/fixtures/pump-events/trade-buy.jsonindex 781c65565..578599409 100644--- a/agent-payments-sdk/src/solana/fixtures/pump-events/trade-buy.json+++ b/agent-payments-sdk/src/solana/fixtures/pump-events/trade-buy.json@@ -1,5 +1,5 @@{- "signature": "2Uz74rkFVbWpCGzeV9pim1ovJ9QHySNoK2nVD5r88irEe4A1ZWFVygR5sK6ygrevSrUn84vnWSDRkf18XR9NSeCT",+ "signature": "WQtDz8rnkNxFZY4733bkTVPKcHomZN2fGMfSk1S54uWMwYJ5Dzx88bGbiZNnv6ihjbauhv7gPKV1S8JYNRS336P","slot": 418302795,"logMessages": ["Program ComputeBudget111111111111111111111111111111 invoke [1]",@@ -29,7 +29,7 @@"Program 11111111111111111111111111111111 success","Program 11111111111111111111111111111111 invoke [3]","Program 11111111111111111111111111111111 success",- "Program data: vdt/007mYe4O/24x5VzPqWJDr96Qfc25ntzvUc4NhKo2lKFmUH90Lzj86QIAAAAAtFOElGIFAAABFi7j8TdlMfQtKZWC0pqayPRhDoJIixsy8cIzj/C+vYKKQ/1pAAAAABKn068BAAAA708fZqEYAwDMfXNhAAAAAO+3DBoQGgIAM5h6nrsTZ5mrWZJbE+XcizCB3wBdtCfBR4+kb/jDR6BfAAAAAAAAAD0WBwAAAAAAAr4R1SMYHf5qg1RUUJi6QDAYiY+u7UY/KWc136eLLMgeAAAAAAAAAOs8AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAGJ1eQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADj86QIAAAAAEqfTrwEAAADMfXNhAAAAAA==",+ "Program data: vdt/007mYe7ZlWNa60+kzgbBxoYK1n+fCcKd3PeuvhRX4KVBAXY/Hzj86QIAAAAAtFOElGIFAAABjtJE5c1FI5Y64C4WkI6mnXR6nps+grSLXFFYkOkhsbuKQ/1pAAAAABKn068BAAAA708fZqEYAwDMfXNhAAAAAO+3DBoQGgIAM5h6nrsTZ5mrWZJbE+XcizCB3wBdtCfBR4+kb/jDR6BfAAAAAAAAAD0WBwAAAAAA5K/rYFWWC8HpJFsHBkvDhogITLSSaSDVJfBhUxoreWQeAAAAAAAAAOs8AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAGJ1eQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADj86QIAAAAAEqfTrwEAAADMfXNhAAAAAA==","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [3]","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 2087 of 71571 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success",@@ -45,11 +45,11 @@"expected": {"name": "TradeEvent","data": {- "mint": "21YcUwFg3XiuscSCvqMhKETd6jqfAZQTD5U2RkeRpump",+ "mint": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump","sol_amount": "02e9fc38","token_amount": "0562948453b4","is_buy": true,- "user": "2VbSVLUJUUQtoEFGnBaJJQAfAegpep75sLMJMBPeP7p5",+ "user": "AcWrf9dw4VhQLHRan1Xkq8pz7LZvoARDEwcDM3dXUgKL","timestamp": "69fd438a","virtual_sol_reserves": "01afd3a712","virtual_token_reserves": "0318a1661f4fef",@@ -58,7 +58,7 @@"fee_recipient": "4UQeTP1T39KZ9Sfxzo3WR5skgsaP6NZa87BAkuazLEKH","fee_basis_points": "5f","fee": "07163d",- "creator": "Bhv1aYJamD2a8ACiGWFiqskFebZqCgapwhtKvm8XvR5",+ "creator": "GPhYGeJrvNztgSZFGfZfXJnXKEQb2Yxb42NV63h2ej3q","creator_fee_basis_points": "1e","creator_fee": "023ceb","track_volume": false,@@ -79,4 +79,4 @@"real_quote_reserves": "61737dcc"}}-}\ No newline at end of file+}diff --git a/agent-payments-sdk/src/solana/fixtures/pump-events/trade-sell.json b/agent-payments-sdk/src/solana/fixtures/pump-events/trade-sell.jsonindex 277dc6fad..5ee88be25 100644--- a/agent-payments-sdk/src/solana/fixtures/pump-events/trade-sell.json+++ b/agent-payments-sdk/src/solana/fixtures/pump-events/trade-sell.json@@ -1,5 +1,5 @@{- "signature": "5o4eDi1zBLjXbnpa13xy9Ayj2NuwtHCHhKensm9d2tcdYBpyLZMhKTuzUJqjzVSbhaAmeAKBVFyTsBx5Npcw6nVP",+ "signature": "4GAzuHY2SL9jUFXZ7o91djRDFBBmcxgN2Aq65PiJY9cCtEAgvYXWpmEp68pczo8dS9tHLmRmpQ5jAmp9mGRKiVYB","slot": 418302435,"logMessages": ["Program ComputeBudget111111111111111111111111111111 invoke [1]",@@ -23,7 +23,7 @@"Program log: Instruction: TransferChecked","Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb consumed 2475 of 171296 compute units","Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb success",- "Program data: vdt/007mYe67uUTvQHS72c4nwlqYTUV9Gw6zLsVmzgdbahRPxuM8/2aS4wcAAAAAQMM7gVcBAAAAEoj8QYBHdCDJ5KSRsagIiFyfr82VJjsxIiQmYPzsliT7Qv1pAAAAAN7sG38MAAAAuVJUwHghAgDeQPiCBQAAALm6QXTnIgEASsL40N1cvJfjKJwZfLUGKlTz2Va5zm5RFfllZ6pcs+ZfAAAAAAAAAJovEwAAAAAALL5V50Ot0DGE811Uepyn0zXOV93nkKBC89spkgkeXj0eAAAAAAAAAAgPBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAHNlbGwAAAAAAAAAAAAAAAAAAAAAAIgTAAAAAAAAzZcJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmkuMHAAAAAN7sG38MAAAA3kD4ggUAAAA=",+ "Program data: vdt/007mYe7ZlWNa60+kzgbBxoYK1n+fCcKd3PeuvhRX4KVBAXY/H2aS4wcAAAAAQMM7gVcBAAAAb24Hb9BQJedE4SGO2LS2bqUsMRH5cXbdDxcpN49Nh3/7Qv1pAAAAAN7sG38MAAAAuVJUwHghAgDeQPiCBQAAALm6QXTnIgEASsL40N1cvJfjKJwZfLUGKlTz2Va5zm5RFfllZ6pcs+ZfAAAAAAAAAJovEwAAAAAA2bmQtyiEHDmJTCni0Pk6os4VbTXMz5p7H/yycw0XqmkeAAAAAAAAAAgPBgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAHNlbGwAAAAAAAAAAAAAAAAAAAAAAIgTAAAAAAAAzZcJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmkuMHAAAAAN7sG38MAAAA3kD4ggUAAAA=","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P invoke [3]","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P consumed 2087 of 157631 compute units","Program 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P success",@@ -39,11 +39,11 @@"expected": {"name": "TradeEvent","data": {- "mint": "Ddo6NQ88fHTVq9jgMm7RQGCvv7QziAtwZX1Psnvnpump",+ "mint": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump","sol_amount": "07e39266","token_amount": "0157813bc340","is_buy": false,- "user": "2FMVNQ3jy21d38YTmvJvfUz9FuGRvbtFNDagpdemKHWb",+ "user": "8VyZkewddHqnHmZ7iSSU9SrwQtw1n6V6YZ6LPBWzQhAE","timestamp": "69fd42fb","virtual_sol_reserves": "0c7f1becde","virtual_token_reserves": "022178c05452b9",@@ -52,7 +52,7 @@"fee_recipient": "62qc2CNXwrYqQScmEdiZFFAnJR262PxWEuNQtxfafNgV","fee_basis_points": "5f","fee": "132f9a",- "creator": "41fGoUUVtUS7YrU5befMz8HDuBix6YN5w4Ckq9Pz8f3A",+ "creator": "FeuawxN6Wj3VuVrB3twtLYcGL72ZmRwaVjCpTdYccF2p","creator_fee_basis_points": "1e","creator_fee": "060f08","track_volume": false,@@ -73,4 +73,4 @@"real_quote_reserves": "0582f840de"}}-}\ No newline at end of file+}diff --git a/api/_lib/admin.js b/api/_lib/admin.jsindex 4a810978b..df49d1147 100644--- a/api/_lib/admin.js+++ b/api/_lib/admin.js@@ -3,9 +3,42 @@import { getSessionUser } from './auth.js';import { sql } from './db.js';-import { env } from './env.js';import { error } from './http.js';+// Mirrors BUILT_IN_ADMIN_ADDRESSES in env.js (public platform-owner addresses,+// safe to commit). env.js's ADMIN_ADDRESSES getter lower-cases every entry —+// correct for EVM hex but wrong for Solana base58, which is case-sensitive:+// lowercasing widens the match to any address that case-folds to the same+// string. env.js can't hand us the raw values without changing its surface, so+// the case-preserving list is reconstructed here from the raw env var plus the+// same built-ins env.js bakes in.+const BUILT_IN_ADMIN_ADDRESSES = ['9MjzHaTB6Jko4YKo9mDzJSaGnktzhbebgsnqPpYWnXC7'];++const EVM_ADDRESS_RE = /^0x[0-9a-fA-F]{40}$/;++function adminAddressList() {+ const raw = process.env.ADMIN_ADDRESSES || '';+ return [...BUILT_IN_ADMIN_ADDRESSES, ...raw.split(',')].map((a) => a.trim()).filter(Boolean);+}++// EVM (0x…) entries compare case-insensitively — checksum casing varies per+// wallet but identifies the same account. Everything else (Solana base58)+// compares as the literal string.+function isAdminAddress(address) {+ if (!address || typeof address !== 'string') return false;+ const candidate = address.trim();+ if (!candidate) return false;+ const candidateIsEvm = EVM_ADDRESS_RE.test(candidate);+ for (const entry of adminAddressList()) {+ if (EVM_ADDRESS_RE.test(entry)) {+ if (candidateIsEvm && entry.toLowerCase() === candidate.toLowerCase()) return true;+ } else if (entry === candidate) {+ return true;+ }+ }+ return false;+}+export async function requireAdmin(req, res) {const user = await getSessionUser(req);if (!user) {@@ -14,7 +47,7 @@ export async function requireAdmin(req, res) {}// Fast path: env-based admin list (wallet address match).- if (user.wallet_address && env.ADMIN_ADDRESSES.has(user.wallet_address.toLowerCase())) {+ if (isAdminAddress(user.wallet_address)) {return user;}@@ -22,12 +55,12 @@ export async function requireAdmin(req, res) {if (user.is_admin) return user;// Check wallet addresses linked to this user against env list.- if (env.ADMIN_ADDRESSES.size > 0) {+ if (adminAddressList().length > 0) {const wallets = await sql`select address from user_wallets where user_id = ${user.id}`;for (const w of wallets) {- if (env.ADMIN_ADDRESSES.has(w.address.toLowerCase())) return user;+ if (isAdminAddress(w.address)) return user;}}diff --git a/api/_lib/agent-spend-policy.js b/api/_lib/agent-spend-policy.jsindex 9138fc904..4ad8f4b07 100644--- a/api/_lib/agent-spend-policy.js+++ b/api/_lib/agent-spend-policy.js@@ -2,16 +2,25 @@//// Policy lives on agent_identities.meta.spend_policy:// {-// max_sol_per_tx: number, // hard cap per individual buy-// daily_sol_cap: number, // rolling 24h sum across pumpfun.buy+// max_sol_per_tx: number, // hard cap per individual SOL-spend tx+// daily_sol_cap: number, // rolling 24h sum across ALL SOL outflows// allowed_mints?: string[], // optional allowlist (omit = any mint)// }//// If no policy is set, a conservative default is applied so a freshly// provisioned agent can't be drained by a stolen session token.+//+// The daily cap counts every action that moves SOL OUT of the agent wallet —+// bonding-curve buys, the initial buy of a launch, and AMM swap-buys. Sells and+// fee withdrawals are inflows and are not counted. Earlier this summed only+// `pumpfun.buy`, so a caller could alternate buys with launches/swaps and blow+// past the daily cap.import { sql } from './db.js';+// SOL-outflow action types that draw down the daily cap.+export const SOL_OUTFLOW_TYPES = ['pumpfun.buy', 'pumpfun.launch', 'pumpfun.swap.buy'];+const DEFAULT_POLICY = {max_sol_per_tx: 1,daily_sol_cap: 5,@@ -21,47 +30,143 @@ const DEFAULT_POLICY = {export function resolveSpendPolicy(meta) {const p = (meta && meta.spend_policy) || {};return {- max_sol_per_tx: Number.isFinite(p.max_sol_per_tx) ? p.max_sol_per_tx : DEFAULT_POLICY.max_sol_per_tx,- daily_sol_cap: Number.isFinite(p.daily_sol_cap) ? p.daily_sol_cap : DEFAULT_POLICY.daily_sol_cap,- allowed_mints: Array.isArray(p.allowed_mints) && p.allowed_mints.length ? p.allowed_mints : null,+ max_sol_per_tx: Number.isFinite(p.max_sol_per_tx)+ ? p.max_sol_per_tx+ : DEFAULT_POLICY.max_sol_per_tx,+ daily_sol_cap: Number.isFinite(p.daily_sol_cap)+ ? p.daily_sol_cap+ : DEFAULT_POLICY.daily_sol_cap,+ allowed_mints:+ Array.isArray(p.allowed_mints) && p.allowed_mints.length ? p.allowed_mints : null,};}-// Returns null if allowed, or { status, code, msg } if blocked.-export async function checkBuyAllowed({ agentId, meta, mint, solAmount }) {- const policy = resolveSpendPolicy(meta);-- if (solAmount > policy.max_sol_per_tx) {+// Static (non-DB) policy checks shared by checkBuyAllowed and reserveSpend.+// Returns null if the per-tx cap and mint allowlist pass, else a blocked object.+function staticBlock(policy, mint, amount) {+ if (amount > policy.max_sol_per_tx) {return {status: 403,code: 'spend_cap_exceeded',- msg: `solAmount ${solAmount} > max_sol_per_tx ${policy.max_sol_per_tx}`,+ msg: `solAmount ${amount} > max_sol_per_tx ${policy.max_sol_per_tx}`,};}-- if (policy.allowed_mints && !policy.allowed_mints.includes(mint)) {+ if (policy.allowed_mints && mint && !policy.allowed_mints.includes(mint)) {return {status: 403,code: 'mint_not_allowed',msg: `mint ${mint} not in allowed_mints`,};}+ return null;+}++// Read-only cap check. Returns null if allowed, or { status, code, msg } if+// blocked. This is a best-effort gate: because it does not hold a lock across+// the on-chain send, two concurrent spends can both pass (TOCTOU). Callers that+// need an exact cap MUST use reserveSpend, which closes that race atomically.+// Retained for callers that record their own action row after sending.+export async function checkBuyAllowed({ agentId, meta, mint, solAmount }) {+ const policy = resolveSpendPolicy(meta);+ const amount = Number(solAmount) || 0;++ const blocked = staticBlock(policy, mint, amount);+ if (blocked) return blocked;const [{ spent_24h } = { spent_24h: 0 }] = await sql`SELECT COALESCE(SUM((payload->>'solAmount')::numeric), 0) AS spent_24hFROM agent_actionsWHERE agent_id = ${agentId}- AND type = 'pumpfun.buy'+ AND type = ANY(${SOL_OUTFLOW_TYPES})AND created_at > NOW() - INTERVAL '24 hours'`;const spent = Number(spent_24h) || 0;- if (spent + solAmount > policy.daily_sol_cap) {+ if (spent + amount > policy.daily_sol_cap) {return {status: 403,code: 'daily_cap_exceeded',- msg: `would spend ${spent + solAmount} SOL in 24h, cap is ${policy.daily_sol_cap}`,+ msg: `would spend ${spent + amount} SOL in 24h, cap is ${policy.daily_sol_cap}`,};}return null;}++// Atomically check the daily cap AND record a pending reservation row under a+// per-agent advisory lock. Concurrent spends for the SAME agent serialize on the+// lock, so two requests can never both read the same 24h total and both pass —+// closing the TOCTOU that checkBuyAllowed leaves open. The reservation row is a+// real agent_actions row (so it counts immediately toward the cap); the caller+// finalizes it with the tx signature on success, or releases it on failure.+//+// Returns { ok: true, reservationId } when allowed, or+// { ok: false, status, code, msg } when blocked.+export async function reserveSpend({ agentId, meta, mint, solAmount, type, payload = {} }) {+ if (!SOL_OUTFLOW_TYPES.includes(type)) {+ throw new Error(`reserveSpend: ${type} is not a SOL-outflow type`);+ }+ const policy = resolveSpendPolicy(meta);+ const amount = Number(solAmount) || 0;++ const blocked = staticBlock(policy, mint, amount);+ if (blocked) return { ok: false, ...blocked };++ const reserved = JSON.stringify({+ ...payload,+ solAmount: amount,+ mint: mint || null,+ status: 'reserved',+ });++ // The advisory xact lock is held for the duration of THIS statement's implicit+ // transaction, serializing concurrent spends per agent. The INSERT…SELECT only+ // materializes a row when the rolling 24h total plus this spend stays within+ // the cap, so the check and the reservation are atomic.+ const rows = await sql`+ WITH locked AS (+ SELECT pg_advisory_xact_lock(hashtextextended(${String(agentId)}, 0))+ ),+ spent AS (+ SELECT COALESCE(SUM((payload->>'solAmount')::numeric), 0) AS s+ FROM agent_actions+ WHERE agent_id = ${agentId}+ AND type = ANY(${SOL_OUTFLOW_TYPES})+ AND created_at > NOW() - INTERVAL '24 hours'+ )+ INSERT INTO agent_actions (agent_id, type, payload, source_skill)+ SELECT ${agentId}, ${type}, ${reserved}::jsonb, ${'pumpfun'}+ FROM spent, locked+ WHERE spent.s + ${amount}::numeric <= ${policy.daily_sol_cap}::numeric+ RETURNING id+ `;++ if (!rows.length) {+ return {+ status: 403,+ code: 'daily_cap_exceeded',+ msg: `would exceed daily_sol_cap ${policy.daily_sol_cap} SOL in 24h`,+ ok: false,+ };+ }+ return { ok: true, reservationId: rows[0].id };+}++// Finalize a reservation after the on-chain send succeeds: merge the real tx+// details (signature, network, …) into the reserved row and mark it confirmed.+export async function finalizeSpend(reservationId, payload = {}) {+ if (!reservationId) return;+ await sql`+ UPDATE agent_actions+ SET payload = payload || ${JSON.stringify({ ...payload, status: 'confirmed' })}::jsonb+ WHERE id = ${reservationId}+ `.catch((e) => console.error('[spend-policy] finalize failed', e));+}++// Release a reservation when the send never lands (build/sign/send failure) so a+// failed attempt does not permanently consume the agent's daily cap.+export async function releaseSpend(reservationId) {+ if (!reservationId) return;+ await sql`+ DELETE FROM agent_actions WHERE id = ${reservationId}+ `.catch((e) => console.error('[spend-policy] release failed', e));+}diff --git a/api/_lib/csrf.js b/api/_lib/csrf.jsindex e7a98975f..fbfcfa40d 100644--- a/api/_lib/csrf.js+++ b/api/_lib/csrf.js@@ -20,10 +20,13 @@ export async function issueCsrf(userId) {}// Middleware: returns true on success (handler may proceed), or sends a 403-// and returns false. Skips enforcement if CSRF_DISABLED=1 (escape hatch for-// machine-to-machine bearer auth which can't carry a CSRF token).+// and returns false. The CSRF_DISABLED=1 escape hatch is honored ONLY outside+// production — a misconfigured env must not silently disable CSRF platform-wide+// on the live site. Machine-to-machine bearer auth is exempted below regardless.+const IS_PROD = process.env.VERCEL_ENV === 'production' || process.env.NODE_ENV === 'production';+export async function requireCsrf(req, res, userId) {- if (process.env.CSRF_DISABLED === '1') return true;+ if (!IS_PROD && process.env.CSRF_DISABLED === '1') return true;// Bearer-token requests are exempt: the token itself is the proof of intent// and bearer tokens aren't auto-attached by browsers like cookies are.@@ -39,16 +42,20 @@ export async function requireCsrf(req, res, userId) {return false;}+ // One-time use, atomically: consume the token in the same statement that+ // validates it. A fire-and-forget DELETE after a SELECT lets two concurrent+ // requests both observe the token before either delete lands — the+ // DELETE … RETURNING makes exactly one request win. The token is valid iff+ // an unexpired row bound to this user came back; a wrong-user token is left+ // in place for its rightful owner.const [row] = await sql`- SELECT user_id FROM csrf_tokens- WHERE token = ${sent} AND expires_at > now()+ DELETE FROM csrf_tokens+ WHERE token = ${sent} AND user_id = ${userId} AND expires_at > now()+ RETURNING user_id`;- if (!row || row.user_id !== userId) {+ if (!row) {error(res, 403, 'csrf_invalid', 'CSRF token invalid or expired');return false;}-- // One-time use: best-effort delete (don't fail the request if delete has issues)- sql`DELETE FROM csrf_tokens WHERE token = ${sent}`.catch(() => {});return true;}diff --git a/api/_lib/env.js b/api/_lib/env.jsindex c9e447df4..2b5afbbf6 100644--- a/api/_lib/env.js+++ b/api/_lib/env.js@@ -66,10 +66,16 @@ export const env = {},get UPSTASH_REDIS_REST_URL() {- return opt('UPSTASH_REDIS_REST_URL') || opt('three_KV_REST_API_URL') || opt('KV_REST_API_URL');+ return (+ opt('UPSTASH_REDIS_REST_URL') || opt('three_KV_REST_API_URL') || opt('KV_REST_API_URL')+ );},get UPSTASH_REDIS_REST_TOKEN() {- return opt('UPSTASH_REDIS_REST_TOKEN') || opt('three_KV_REST_API_TOKEN') || opt('KV_REST_API_TOKEN');+ return (+ opt('UPSTASH_REDIS_REST_TOKEN') ||+ opt('three_KV_REST_API_TOKEN') ||+ opt('KV_REST_API_TOKEN')+ );},get JWT_SECRET() {@@ -275,10 +281,11 @@ export const env = {// api/_lib/siwx-server.js) to validate EIP-1271 / EIP-6492 smart-contract// wallet signatures via viem's publicClient.verifyMessage. Without this,// SIWX falls back to EOA-only verification (still works for MetaMask /- // Phantom EOAs; rejects Coinbase Smart Wallet, Safe, etc.). Defaults to- // the same RPC the club-payouts cron uses so a single env var works.+ // Phantom EOAs; rejects Coinbase Smart Wallet, Safe, etc.). Falls back to+ // the club-payouts cron RPC, then the per-chain RPC_URL_8453 the delegation+ // + indexing crons use, so one provisioned Base RPC serves all of them.get BASE_RPC_URL() {- return opt('BASE_RPC_URL', opt('CLUB_BASE_RPC_URL'));+ return opt('BASE_RPC_URL', opt('CLUB_BASE_RPC_URL', opt('RPC_URL_8453')));},// ── ERC-7710 Delegation Relayer ──────────────────────────────────────────@@ -853,9 +860,15 @@ export const env = {// CZ Agent campaign — on-chain registry contract for the transfer flow.// Set CZ_REGISTRY_CONTRACT to the deployed identity registry address.// CZ_AGENT_ID and CZ_AGENT_NAME can override the defaults.- get CZ_REGISTRY_CONTRACT() { return opt('CZ_REGISTRY_CONTRACT', '0x0000000000000000000000000000000000000000'); },- get CZ_AGENT_ID() { return opt('CZ_AGENT_ID', 'cz-preview'); },- get CZ_AGENT_NAME() { return opt('CZ_AGENT_NAME', 'CZ Agent'); },+ get CZ_REGISTRY_CONTRACT() {+ return opt('CZ_REGISTRY_CONTRACT', '0x0000000000000000000000000000000000000000');+ },+ get CZ_AGENT_ID() {+ return opt('CZ_AGENT_ID', 'cz-preview');+ },+ get CZ_AGENT_NAME() {+ return opt('CZ_AGENT_NAME', 'CZ Agent');+ },// ── aixbt intelligence bridge (api/_lib/aixbt.js) ─────────────────────// REST v2 API key for aixbt.tech. Powers /api/aixbt/* and the aixbt agentdiff --git a/api/_lib/forge-job-token.js b/api/_lib/forge-job-token.jsindex 7c3378844..4bf993379 100644--- a/api/_lib/forge-job-token.js+++ b/api/_lib/forge-job-token.js@@ -6,15 +6,42 @@// callers are handed an opaque token that records which provider + task-kind to// poll. The legacy Replicate path keeps returning its bare prediction id (which// matches JOB_ID_RE), so old links and existing job handles never break.+//+// Tokens are HMAC-SHA256 signed (`f1.<payload>.<sig>`) with the server+// JWT_SECRET — the same canonical signing secret auth.js and saml.js key from.+// Without the signature a caller could forge `f1.*` handles and poll arbitrary+// upstream task ids against the platform-key providers. decodeJobToken rejects+// missing/bad signatures by returning null, which callers already treat as the+// invalid-token path; pre-signing in-flight tokens fail the same way (jobs are+// short-lived, so that window is acceptable).++import { createHmac, timingSafeEqual } from 'node:crypto';++import { env } from './env.js';++function sign(payload) {+ return createHmac('sha256', env.JWT_SECRET).update(payload).digest('base64url');+}export function encodeJobToken({ provider, kind, taskId }) {- return `f1.${Buffer.from(JSON.stringify({ p: provider, k: kind, t: taskId }), 'utf8').toString('base64url')}`;+ const payload = Buffer.from(+ JSON.stringify({ p: provider, k: kind, t: taskId }),+ 'utf8',+ ).toString('base64url');+ return `f1.${payload}.${sign(payload)}`;}export function decodeJobToken(token) {if (typeof token !== 'string' || !token.startsWith('f1.')) return null;+ const parts = token.split('.');+ if (parts.length !== 3) return null;+ const [, payload, sig] = parts;+ if (!payload || !sig) return null;try {- const obj = JSON.parse(Buffer.from(token.slice(3), 'base64url').toString('utf8'));+ const expected = Buffer.from(sign(payload), 'utf8');+ const actual = Buffer.from(sig, 'utf8');+ if (expected.length !== actual.length || !timingSafeEqual(expected, actual)) return null;+ const obj = JSON.parse(Buffer.from(payload, 'base64url').toString('utf8'));if (!obj?.p || !obj?.t) return null;return { provider: obj.p, kind: obj.k || null, taskId: String(obj.t) };} catch {diff --git a/api/_lib/mcp-batch-price.js b/api/_lib/mcp-batch-price.jsnew file mode 100644index 000000000..f486e0e02--- /dev/null+++ b/api/_lib/mcp-batch-price.js@@ -0,0 +1,43 @@+// Total x402 charge for a (possibly batched) JSON-RPC MCP body.+//+// A single X-PAYMENT must cover EVERY priced tools/call the batch will execute.+// Pricing only the lone-call case (and letting multi-call batches fall back to+// the flat env default) let a caller run N priced tools — up to the batch cap —+// for one tool's price, a ~1000–3000× underpayment. We instead SUM the per-tool+// price across all tools/call so the advertised 402 amount, the verified+// payment, and the settled charge all equal the true cost of the batch.+//+// `priceForTool(name)` → atomic-unit price string for a tool, or null if free.+// `isFreeName(name)` → true only for an explicitly public/free tool that may+// be served with no payment at all (e.g. getting_started).+//+// Returns { totalAmount, allFree }:+// totalAmount — atomic-unit string sum of every priced call, or null if the+// batch is entirely free. Passed to authenticateRequest as the+// per-request x402 price.+// allFree — true when there is ≥1 tools/call, nothing is priced, and every+// call targets an explicit free/public tool → serve anonymously.+export function priceBatch(body, { priceForTool, isFreeName }) {+ const batch = Array.isArray(body) ? body : [body];+ const names = batch+ .filter((m) => m && m.method === 'tools/call')+ .map((c) => (typeof c?.params?.name === 'string' ? c.params.name : null));++ let totalAtomic = 0n;+ for (const name of names) {+ const atomic = name ? priceForTool(name) : null;+ if (!atomic) continue;+ try {+ totalAtomic += BigInt(atomic);+ } catch {+ // Non-numeric price string can't be summed; the dispatcher rejects the+ // call as unknown/invalid, so it never executes paid work uncharged.+ }+ }++ const totalAmount = totalAtomic > 0n ? totalAtomic.toString() : null;+ const allFree =+ names.length > 0 && totalAmount === null && names.every((n) => n && isFreeName(n));++ return { totalAmount, allFree };+}diff --git a/api/_lib/mcp-dispatch.js b/api/_lib/mcp-dispatch.jsindex 19a08fd8a..15a15bb6d 100644--- a/api/_lib/mcp-dispatch.js+++ b/api/_lib/mcp-dispatch.js@@ -54,7 +54,9 @@ export function makeDispatcher({ serverInfo, instructions, catalog, tools, logNaasync function onToolCall(params, auth, started, req) {const { name, arguments: args = {} } = params || {};- const tool = tools[name];+ // Own-property lookup only — "__proto__"/"constructor" must not resolve an+ // inherited Object member and bypass the !tool guard.+ const tool = typeof name === 'string' && Object.hasOwn(tools, name) ? tools[name] : null;if (!tool) throw rpcError(-32602, `unknown tool: ${name}`);if (tool.scope && !hasScope(auth.scope, tool.scope)) {throw rpcError(-32002, `insufficient scope, requires ${tool.scope}`);diff --git a/api/_lib/pump-trade-args.js b/api/_lib/pump-trade-args.jsnew file mode 100644index 000000000..2893303dd--- /dev/null+++ b/api/_lib/pump-trade-args.js@@ -0,0 +1,61 @@+// Pure argument helpers for pump.fun trade instruction building.+//+// Two SDK conventions these helpers exist to get right, verified against the+// vendored docs/IDLs in docs/pumpfun-program/ and the installed+// @pump-fun/[email protected] / @pump-fun/[email protected] sources:+//+// 1. Slippage unit. Every @pump-fun builder takes slippage as a PERCENT+// (`slippage: 1` = 1%): pump-sdk pads/floors via+// `amount * floor(slippage * 10) / 1000`, pump-swap-sdk via+// `1 ± slippage / 100`. Passing a fraction (bps / 10_000) silently+// truncates the protection to ~0 on the curve and 100x too tight on the AMM.+//+// 2. Base token program. `create_v2` coins (every coin pump.fun mints today,+// SOL- and USDC-paired alike) use Token-2022 base mints; legacy coins use+// SPL Token. BUY.md/SELL.md require `base_token_program` to match the mint+// owner, so it must be read from the mint account, never assumed.+//+// Pure + dependency-light so it is unit-testable without the chain.++import { PublicKey } from '@solana/web3.js';++export const SPL_TOKEN_PROGRAM_ID = new PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA');+export const TOKEN_2022_PROGRAM_ID = new PublicKey('TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb');++const KNOWN_TOKEN_PROGRAMS = new Set([+ SPL_TOKEN_PROGRAM_ID.toBase58(),+ TOKEN_2022_PROGRAM_ID.toBase58(),+]);++/**+ * Convert user-facing slippage basis points into the percent unit every+ * @pump-fun SDK builder expects. 100 bps -> 1 (percent).+ * Clamps to [0, 100] percent and returns the default (1%) for non-finite input.+ */+export function slippagePercentFromBps(bps, { defaultBps = 100 } = {}) {+ const n = Number(bps);+ const effective = Number.isFinite(n) ? n : defaultBps;+ return Math.max(0, Math.min(10_000, effective)) / 100;+}++/**+ * Resolve the token program for a mint from its account owner.+ * Throws a typed 422 for mints owned by anything other than SPL Token or+ * Token-2022 — building a trade against an unknown token program can only+ * fail on-chain, so fail fast here.+ *+ * @param {PublicKey|string} owner The mint account's `owner` field.+ * @returns {PublicKey} SPL_TOKEN_PROGRAM_ID or TOKEN_2022_PROGRAM_ID.+ */+export function resolveTokenProgramForMintOwner(owner) {+ const ownerPk = owner instanceof PublicKey ? owner : new PublicKey(owner);+ if (!KNOWN_TOKEN_PROGRAMS.has(ownerPk.toBase58())) {+ const e = new Error(+ `mint owned by unknown token program ${ownerPk.toBase58()} — not an SPL/Token-2022 mint`,+ );+ e.status = 422;+ e.code = 'unsupported_token_program';+ throw e;+ }+ return ownerPk.equals(TOKEN_2022_PROGRAM_ID) ? TOKEN_2022_PROGRAM_ID : SPL_TOKEN_PROGRAM_ID;+}diff --git a/api/_lib/purchase-confirm.js b/api/_lib/purchase-confirm.jsindex 0545a9549..eedabda3c 100644--- a/api/_lib/purchase-confirm.js+++ b/api/_lib/purchase-confirm.js@@ -36,7 +36,10 @@ function rpc() {function receiptKey() {return (process.env.PURCHASE_RECEIPT_KEY ||- crypto.createHash('sha256').update((process.env.SESSION_SECRET || 'dev') + ':receipts').digest('hex')+ crypto+ .createHash('sha256')+ .update((process.env.SESSION_SECRET || 'dev') + ':receipts')+ .digest('hex'));}@@ -207,7 +210,8 @@ async function confirmSolanaSkill(pur, payoutAddress) {// Mismatch — but the transfer happened. Mark as tipped if we can pin down// the actual amount that hit the seller's wallet; else mark failed.const actual = await findReferencedTransferAmount(txSignature, recipient, splToken);- if (actual !== null) return markSkillTipped(pur, txSignature, actual.toString(), e.message, payoutAddress);+ if (actual !== null)+ return markSkillTipped(pur, txSignature, actual.toString(), e.message, payoutAddress);return markSkillMismatch(pur, txSignature, e.message);}@@ -219,13 +223,20 @@ async function confirmSolanaSkill(pur, payoutAddress) {async function confirmEvmSkill(pur, payoutAddress, txHash) {if (!txHash) return { status: 'pending' }; // buyer hasn't broadcast / submitted yet- // Idempotency: one settlement tx can confirm at most one purchase.+ // Idempotency pre-check: one settlement tx can confirm at most one purchase.+ // Covers rows in ANY status — a concurrent confirm parks the hash on a+ // still-'pending' row via the atomic claim below, and the unique index on+ // skill_purchases.tx_signature is the hard backstop either way.const [dupe] = await sql`SELECT id FROM skill_purchases- WHERE tx_signature = ${txHash} AND status IN ('confirmed', 'tipped') AND id != ${pur.id}+ WHERE tx_signature = ${txHash} AND id != ${pur.id}LIMIT 1`;- if (dupe) return { status: 'mismatch', message: 'this transaction has already been used for another purchase' };+ if (dupe)+ return {+ status: 'mismatch',+ message: 'this transaction has already been used for another purchase',+ };const result = await verifyEvmUsdcPayment({txHash,@@ -234,10 +245,79 @@ async function confirmEvmSkill(pur, payoutAddress, txHash) {expectedAmount: pur.amount,});if (result.status === 'pending') return { status: 'pending' };++ // Bind the on-chain payment to the buyer. The seller's payout address is+ // public, so "a USDC transfer to the seller exists" is not proof THIS buyer+ // paid — without binding, anyone could confirm a public transfer against+ // their own purchase. EVM USDC transfers carry no reference (unlike the+ // Solana-Pay path), so we bind on the payer address: the funds must+ // originate from a wallet linked to the buyer's account. Mirrors+ // api/payments/evm/[action].js. No DB write on failure — the buyer can+ // link the paying wallet and retry the same tx hash.+ if (result.from) {+ const payer = result.from.toLowerCase();+ const [linked] = await sql`+ SELECT 1 FROM user_wallets+ WHERE user_id = ${pur.user_id} AND lower(address) = ${payer}+ LIMIT 1+ `;+ if (!linked) {+ return {+ status: 'mismatch',+ message:+ 'payment must be sent from a wallet linked to your account — link the paying wallet, then retry',+ };+ }+ } else if (result.status === 'match') {+ return {+ status: 'mismatch',+ message: 'could not determine payer address from transaction',+ };+ }++ // Atomically claim the tx hash for THIS purchase before any ledger write.+ // The unique index on skill_purchases.tx_signature turns a concurrent claim+ // of the same hash for another purchase into a 23505, surfaced as a clean+ // mismatch instead of a double-confirm.+ let claimed;+ try {+ claimed = await sql`+ UPDATE skill_purchases+ SET tx_signature = ${txHash}+ WHERE id = ${pur.id} AND status = 'pending'+ AND (tx_signature IS NULL OR tx_signature = ${txHash})+ RETURNING id+ `;+ } catch (e) {+ if (e?.code === '23505') {+ return {+ status: 'mismatch',+ message: 'this transaction has already been used for another purchase',+ };+ }+ throw e;+ }+ if (claimed.length === 0) {+ // Row is no longer pending (or carries a different hash) — report the+ // settled state instead of double-processing.+ const [row] =+ await sql`SELECT status, tx_signature FROM skill_purchases WHERE id = ${pur.id}`;+ if (row?.status === 'confirmed')+ return { status: 'confirmed', tx_signature: row.tx_signature };+ if (row?.status === 'tipped') return { status: 'tipped', tx_signature: row.tx_signature };+ return { status: 'mismatch', message: 'purchase is no longer pending' };+ }+if (result.status === 'mismatch') {// A short-but-real transfer is a tip; nothing on-chain at all is a mismatch.if (result.actualAmount && BigInt(result.actualAmount) > 0n) {- return markSkillTipped(pur, txHash, result.actualAmount, result.message || 'amount mismatch', payoutAddress);+ return markSkillTipped(+ pur,+ txHash,+ result.actualAmount,+ result.message || 'amount mismatch',+ payoutAddress,+ );}return markSkillMismatch(pur, txHash, result.message || 'no matching transfer');}@@ -267,7 +347,12 @@ async function markSkillTipped(pur, txSignature, actualAmount, reason, payoutAddpurchase_id: pur.id,});}- return { status: 'tipped', tx_signature: txSignature, tipped_amount: actualAmount, message: reason };+ return {+ status: 'tipped',+ tx_signature: txSignature,+ tipped_amount: actualAmount,+ message: reason,+ };}// No matching transfer at all — mark failed, no on-chain side effect.diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.jsindex 54b16633d..f73417049 100644--- a/api/_lib/rate-limit.js+++ b/api/_lib/rate-limit.js@@ -127,11 +127,31 @@ function resilientLimiter(rl, name, opts) {};}+// Eviction for the in-memory fallback. The map otherwise grows one entry per+// distinct key forever (a scanner rotating IPs would balloon a long-lived dev+// process). Only sweeps when the map is over the cap, so the amortized cost on+// the hot path is O(1); the sweep itself drops every bucket whose newest+// timestamp predates the largest window any memory limiter uses (conservative+// — never evicts an entry a live limiter could still count).+const MEMORY_BUCKETS_MAX = 10_000;+let maxMemoryWindowMs = 60_000;+function sweepMemoryBuckets(now) {+ if (memoryBuckets.size <= MEMORY_BUCKETS_MAX) return;+ const cutoff = now - maxMemoryWindowMs;+ for (const [id, timestamps] of memoryBuckets) {+ if (!timestamps.length || timestamps[timestamps.length - 1] <= cutoff) {+ memoryBuckets.delete(id);+ }+ }+}+function memoryLimiter({ limit, window }) {const ms = parseWindowMs(window);+ if (ms > maxMemoryWindowMs) maxMemoryWindowMs = ms;return {async limit(id) {const now = Date.now();+ sweepMemoryBuckets(now);const bucket = memoryBuckets.get(id) || [];const cutoff = now - ms;const kept = bucket.filter((t) => t > cutoff);@@ -156,8 +176,13 @@ function parseWindowMs(w) {// Preset limiters. Tune once viral traffic shape is known.export const limits = {- authIp: (ip) => getLimiter('auth:ip', { limit: 30, window: '10 m' }).limit(ip),- registerIp: (ip) => getLimiter('register:ip', { limit: 5, window: '1 h' }).limit(ip),+ // Auth-critical buckets gate credential guessing / account-creation spam.+ // Marked critical so a Redis outage in prod fails closed (deny) instead of+ // degrading to the per-instance memory map — across serverless fan-out that+ // fallback is effectively no limit at all on a brute-force attempt.+ authIp: (ip) => getLimiter('auth:ip', { limit: 30, window: '10 m', critical: true }).limit(ip),+ registerIp: (ip) =>+ getLimiter('register:ip', { limit: 5, window: '1 h', critical: true }).limit(ip),// pump.fun coin metadata upload (name/symbol/image → R2 JSON). Cheap and// idempotent, so it gets its own bucket instead of draining the strict// `authIp` budget shared by on-chain buy/sell/launch actions. Iterating in@@ -192,7 +217,9 @@ export const limits = {// N × per-send-cap per day. Critical → fails closed in prod without Redis so a// missing limiter can never silently uncap a money-moving endpoint.avatarPayoutDaily: (walletAddr) =>- getLimiter('avatar:payout:daily', { limit: 50, window: '24 h', critical: true }).limit(walletAddr),+ getLimiter('avatar:payout:daily', { limit: 50, window: '24 h', critical: true }).limit(+ walletAddr,+ ),mcpUser: (userId) => getLimiter('mcp:user', { limit: 1200, window: '1 m' }).limit(userId),mcpIp: (ip) => getLimiter('mcp:ip', { limit: 600, window: '1 m' }).limit(ip),// Paid MCP tools — each call runs real compute (glTF validation / inspection@@ -232,8 +259,19 @@ export const limits = {embedUser: (userId) => getLimiter('embed:user', { limit: 120, window: '1 m' }).limit(userId),avatarRollback: (userId) =>getLimiter('avatar:rollback', { limit: 10, window: '1 h' }).limit(userId),- chatUser: (userId) => getLimiter('chat:user', { limit: 40, window: '1 m' }).limit(userId),- chatIp: (ip) => getLimiter('chat:ip', { limit: 60, window: '1 m' }).limit(ip),+ // Chat inference spends real money on the host's LLM keys, so these are+ // critical: a Redis outage in prod fails closed (deny) rather than handing out+ // unbounded paid inference. chatUser/chatIp bound a single account/IP.+ chatUser: (userId) =>+ getLimiter('chat:user', { limit: 40, window: '1 m', critical: true }).limit(userId),+ chatIp: (ip) => getLimiter('chat:ip', { limit: 60, window: '1 m', critical: true }).limit(ip),+ // Global ceiling on inference billed to the HOST's provider keys (i.e. callers+ // who supplied no key of their own). Stops distributed abuse — many accounts+ // each under their per-user limit collectively draining the platform's quota.+ chatHostKeyGlobal: () =>+ getLimiter('chat:hostkey:global', { limit: 1200, window: '1 m', critical: true }).limit(+ 'global',+ ),// AI bounty judge (api/bounties/:id/judge). Each run spends real LLM tokens// scoring a whole field of submissions, so cap per poster and fail closed// without Redis in prod rather than allowing unbounded paid inference.@@ -358,11 +396,18 @@ export const limits = {getLimiter('permissions:revoke', { limit: 20, window: '1 h' }).limit(userId),apiKeyManage: (userId) =>getLimiter('api-key:manage', { limit: 30, window: '1 h' }).limit(userId),- verifyEmailIp: (ip) => getLimiter('verify-email:ip', { limit: 10, window: '15 m' }).limit(ip),+ // Auth-critical (see authIp/registerIp above): brute-forcing verification+ // codes / spamming reset+verify emails must fail closed when Redis is down.+ verifyEmailIp: (ip) =>+ getLimiter('verify-email:ip', { limit: 10, window: '15 m', critical: true }).limit(ip),forgotPasswordEmail: (email) =>- getLimiter('forgot-password:email', { limit: 3, window: '15 m' }).limit(email),+ getLimiter('forgot-password:email', { limit: 3, window: '15 m', critical: true }).limit(+ email,+ ),resendVerifyUser: (userId) =>- getLimiter('resend-verify:user', { limit: 2, window: '10 m' }).limit(userId),+ getLimiter('resend-verify:user', { limit: 2, window: '10 m', critical: true }).limit(+ userId,+ ),newsletterIp: (ip) => getLimiter('newsletter:ip', { limit: 5, window: '1 h' }).limit(ip),// Voice cloning: expensive ElevenLabs API call — 3 per user per day.// Critical (real per-call cost) — fail closed in prod without Redis.@@ -421,13 +466,23 @@ export const limits = {};// Trust only proxy headers that Vercel itself sets and signs. Naively reading-// X-Forwarded-For lets clients supply it directly on direct invocations, which-// trivially bypasses per-IP rate limits by rotating the claimed address.+// X-Forwarded-For (or X-Real-IP, which clients can also supply directly) lets+// callers bypass per-IP rate limits by rotating the claimed address.+//+// Order of trust:+// 1. x-vercel-forwarded-for — set by the Vercel edge on every proxied+// request; clients cannot inject it past the platform.+// 2. socket remote address — authoritative on direct connections (local+// dev / tests, where no Vercel headers exist).+// 3. x-real-ip — last resort only, for non-Vercel reverse-proxy setups where+// the socket address is the proxy's. Client-settable on direct hits, but+// by this point there is no better signal.export function clientIp(req) {const vercel = req.headers['x-vercel-forwarded-for'];if (vercel) return String(vercel).split(',')[0].trim();+ const sock = req.socket?.remoteAddress;+ if (sock) return sock;const real = req.headers['x-real-ip'];- if (real) return String(real).trim();- // Last resort — socket address (only meaningful on direct connections).- return req.socket?.remoteAddress || '0.0.0.0';+ if (real) return String(real).split(',')[0].trim();+ return '0.0.0.0';}diff --git a/api/_lib/ssrf.js b/api/_lib/ssrf.jsindex dbe1f69c1..9295baeea 100644--- a/api/_lib/ssrf.js+++ b/api/_lib/ssrf.js@@ -32,6 +32,7 @@ export function isPrivateIPv4(ip) {if (p[0] === 127) return true;if (p[0] === 0) return true;if (p[0] === 169 && p[1] === 254) return true; // link-local, cloud metadata+ if (p[0] === 100 && p[1] >= 64 && p[1] <= 127) return true; // CGNAT 100.64.0.0/10 (incl. Alibaba metadata 100.100.100.200)if (p[0] === 172 && p[1] >= 16 && p[1] <= 31) return true;if (p[0] === 192 && p[1] === 168) return true;if (p[0] === 192 && p[1] === 0 && p[2] === 0) return true; // IETF@@ -45,9 +46,16 @@ export function isPrivateIPv4(ip) {export function isPrivateIPv6(ip) {const lower = ip.toLowerCase();- if (lower === '::' || lower === '::1') return true;- if (lower.startsWith('fe80:') || lower.startsWith('fe80::')) return true; // link-local+ if (lower === '::' || lower === '::1' || lower === '0:0:0:0:0:0:0:1') return true;+ if (+ lower.startsWith('fe8') ||+ lower.startsWith('fe9') ||+ lower.startsWith('fea') ||+ lower.startsWith('feb')+ )+ return true; // link-local fe80::/10if (lower.startsWith('fc') || lower.startsWith('fd')) return true; // ULA fc00::/7+ if (lower.startsWith('ff')) return true; // multicast ff00::/8if (lower.startsWith('::ffff:')) {const mapped = lower.replace(/^::ffff:/, '');if (/^\d+\.\d+\.\d+\.\d+$/.test(mapped)) return isPrivateIPv4(mapped);@@ -97,7 +105,10 @@ export function pinnedAgent(expectedHost, addrs) {cb(new SsrfError('no public address to connect to', 'private_address'));return;}- cb(null, safe.map((a) => ({ address: a.address, family: a.family })));+ cb(+ null,+ safe.map((a) => ({ address: a.address, family: a.family })),+ );},},});@@ -155,16 +166,21 @@ export async function safeFetchJson(...(body != null ? { 'content-type': 'application/json' } : {}),...headers,},- ...(body != null ? { body: typeof body === 'string' ? body : JSON.stringify(body) } : {}),+ ...(body != null+ ? { body: typeof body === 'string' ? body : JSON.stringify(body) }+ : {}),});if (res.status >= 300 && res.status < 400 && res.headers.get('location')) {if (++redirects > maxRedirects) {throw new SsrfError('too many redirects', 'too_many_redirects');}- currentUrl = validatePublicUrl(new URL(res.headers.get('location'), currentUrl).toString(), {- allowHttp,- });+ currentUrl = validatePublicUrl(+ new URL(res.headers.get('location'), currentUrl).toString(),+ {+ allowHttp,+ },+ );continue;}diff --git a/api/_lib/text-extract.js b/api/_lib/text-extract.jsindex a7597430c..9fb02b1aa 100644--- a/api/_lib/text-extract.js+++ b/api/_lib/text-extract.js@@ -12,6 +12,7 @@// fragile ESM/CJS chain. Our usage is trivial DOM scraping; jsdom was overkill.import { parse } from 'node-html-parser';+import { fetchSafePublicUrl, SsrfBlockedError } from './ssrf-guard.js';const FETCH_TIMEOUT_MS = 12_000;const MAX_BYTES = 4 * 1024 * 1024; // 4 MB hard cap per source@@ -28,24 +29,32 @@ export async function fetchAndExtract(url) {if (u.protocol !== 'http:' && u.protocol !== 'https:') {throw Object.assign(new Error('only http(s) URLs are supported'), { status: 400 });}- if (isPrivateHost(u.hostname)) {- throw Object.assign(new Error('URL must be publicly reachable'), { status: 400 });- }+ // SSRF guard: every hop (including each redirect Location) is DNS-resolved+ // and checked against private/loopback/link-local/metadata ranges before we+ // connect. `fetchSafePublicUrl` follows redirects manually and re-validates+ // each one — a public URL that 302s to 169.254.169.254 (or a decimal/hex IP+ // form) is rejected instead of followed.const controller = new AbortController();const timer = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);let res;try {- res = await fetch(u.toString(), {- redirect: 'follow',- headers: {- 'user-agent': USER_AGENT,- accept: 'text/html,text/plain,application/xhtml+xml',+ res = await fetchSafePublicUrl(+ u.toString(),+ {+ headers: {+ 'user-agent': USER_AGENT,+ accept: 'text/html,text/plain,application/xhtml+xml',+ },+ signal: controller.signal,},- signal: controller.signal,- });+ { allowHttp: true },+ );} catch (err) {clearTimeout(timer);+ if (err instanceof SsrfBlockedError) {+ throw Object.assign(new Error('URL must be publicly reachable'), { status: 400 });+ }throw Object.assign(new Error(`fetch failed: ${err.message}`), { status: 502 });}clearTimeout(timer);@@ -130,17 +139,3 @@ async function readWithCap(res, limit) {}return Buffer.concat(chunks);}--// Block SSRF to private/loopback/link-local ranges. Resolution-time check is-// not perfect (DNS rebinding) but it eliminates accidental leaks; production-// should layer a network egress firewall on top.-function isPrivateHost(host) {- const h = host.toLowerCase();- if (h === 'localhost' || h === '0.0.0.0' || h === 'broadcasthost') return true;- if (/\.local$|\.internal$|\.intranet$/.test(h)) return true;- if (/^(?:127\.|10\.|192\.168\.|169\.254\.|::1$|fe80::|fc[0-9a-f]{2}:|fd[0-9a-f]{2}:)/i.test(h))- return true;- const m = h.match(/^172\.(\d{1,3})\./);- if (m && Number(m[1]) >= 16 && Number(m[1]) <= 31) return true;- return false;-}diff --git a/api/_lib/webhook-dispatch.js b/api/_lib/webhook-dispatch.jsindex edfed8f34..b6f34440a 100644--- a/api/_lib/webhook-dispatch.js+++ b/api/_lib/webhook-dispatch.js@@ -10,6 +10,7 @@import { sql } from './db.js';import { randomToken, hmacSha256 } from './crypto.js';+import { validatePublicUrl, resolvePublicHost, pinnedAgent, SsrfError } from './ssrf.js';const MAX_ATTEMPTS = 3;const BACKOFF_BASE_MS = 1000;@@ -61,9 +62,11 @@ export async function dispatchWebhooks({ userId, eventType, data }) {async function deliverWithRetry(webhook, eventId, timestamp, payload, eventType) {for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {- const { statusCode, responseBody, error: deliveryError } = await deliver(- webhook.url, webhook.secret, eventId, timestamp, payload,- );+ const {+ statusCode,+ responseBody,+ error: deliveryError,+ } = await deliver(webhook.url, webhook.secret, eventId, timestamp, payload);try {await sql`@@ -104,24 +107,53 @@ async function deliverWithRetry(webhook, eventId, timestamp, payload, eventType)async function deliver(url, secret, eventId, timestamp, payload) {const signature = await sign(secret, eventId, timestamp, payload);+ // SSRF guard: the URL is developer-supplied, so resolve it and pin the+ // connection to the validated public address(es). Without this, a webhook+ // pointed at 169.254.169.254 / localhost / RFC-1918 (directly or via a public+ // host that 30x-redirects inward) would have the server POST to an internal+ // target and persist the status/error as a probing oracle. Redirects are NOT+ // followed (manual) so a public host can't bounce the request internally.+ let target;+ let agent;+ try {+ target = validatePublicUrl(url);+ const addrs = await resolvePublicHost(target.hostname);+ agent = pinnedAgent(target.hostname, addrs);+ } catch (err) {+ const reason = err instanceof SsrfError ? `blocked_url:${err.code}` : 'invalid_url';+ return { statusCode: null, responseBody: null, error: reason };+ }+try {const controller = new AbortController();const timeout = setTimeout(() => controller.abort(), DELIVERY_TIMEOUT_MS);- const res = await fetch(url, {- method: 'POST',- headers: {- 'content-type': 'application/json',- 'webhook-id': eventId,- 'webhook-timestamp': String(timestamp),- 'webhook-signature': `v1,${signature}`,- 'user-agent': 'three.ws-webhooks/1.0',- },- body: payload,- signal: controller.signal,- });-- clearTimeout(timeout);+ let res;+ try {+ res = await fetch(target, {+ method: 'POST',+ redirect: 'manual',+ dispatcher: agent,+ headers: {+ 'content-type': 'application/json',+ 'webhook-id': eventId,+ 'webhook-timestamp': String(timestamp),+ 'webhook-signature': `v1,${signature}`,+ 'user-agent': 'three.ws-webhooks/1.0',+ },+ body: payload,+ signal: controller.signal,+ });+ } finally {+ clearTimeout(timeout);+ await agent.close().catch(() => {});+ }++ // A redirect is a misconfigured (or hostile) endpoint — record it as a+ // failure instead of following it to a potentially internal target.+ if (res.status >= 300 && res.status < 400) {+ return { statusCode: res.status, responseBody: null, error: 'redirect_not_followed' };+ }let responseBody = null;try {diff --git a/api/_lib/x402-paid-endpoint.js b/api/_lib/x402-paid-endpoint.jsindex fcd3c1c10..efb014d69 100644--- a/api/_lib/x402-paid-endpoint.js+++ b/api/_lib/x402-paid-endpoint.js@@ -311,11 +311,13 @@ export function paidEndpoint(spec) {// USE-21 auth-hints: append zero-amount accept entries for each declared// auth method and build the auth-hints extension. The free entries// reuse the Base USDC asset block so schema-checking clients accept- // them; amount="0" is the actual paywall bypass — these entries can- // only be "settled" by presenting the matching auth header, never via- // X-PAYMENT. The auth-hints extension maps each method to the index- // of its free entry so the buyer client knows which entry corresponds- // to which auth method.+ // them; amount="0" entries can only be redeemed by presenting the+ // matching auth header, never via X-PAYMENT — verifyPayment enforces+ // this structurally (it excludes amount-0 / extra.authRequired entries+ // from requirement matching), so the guarantee does not depend on+ // these entries being appended after the payable ones. The auth-hints+ // extension maps each method to the index of its free entry so the+ // buyer client knows which entry corresponds to which auth method.let authHintsExtension = null;if (authHints) {const baseTo = payTo?.base || env.X402_PAY_TO_BASE;diff --git a/api/_lib/x402-spec.js b/api/_lib/x402-spec.jsindex 7bbe1013b..db30f575d 100644--- a/api/_lib/x402-spec.js+++ b/api/_lib/x402-spec.js@@ -240,7 +240,11 @@ function facilitatorFor(network) {if (env.CDP_API_KEY_ID && env.CDP_API_KEY_SECRET) {return { url: env.X402_CDP_FACILITATOR_URL, cdp: true };}- if (network === NETWORK_BASE_MAINNET || network === NETWORK_BASE_SEPOLIA || network === 'base') {+ if (+ network === NETWORK_BASE_MAINNET ||+ network === NETWORK_BASE_SEPOLIA ||+ network === 'base'+ ) {return { url: env.X402_FACILITATOR_URL_BASE, token: env.X402_FACILITATOR_TOKEN_BASE };}throw new X402Error(@@ -329,10 +333,22 @@ const TRANSIENT_FACILITATOR_STATUS = new Set([502, 503, 504]);function summarizeUpstream(data, text) {// CDP surfaces the reason under `errorMessage`; PayAI under `error`/`message`.- return String(data.error || data.message || data.errorMessage || data.invalidReason || text.slice(0, 200) || '').slice(0, 300);+ return String(+ data.error ||+ data.message ||+ data.errorMessage ||+ data.invalidReason ||+ text.slice(0, 200) ||+ '',+ ).slice(0, 300);}-async function callFacilitator(network, path, body, { timeoutMs, idempotencyKey, retries = 1 } = {}) {+async function callFacilitator(+ network,+ path,+ body,+ { timeoutMs, idempotencyKey, retries = 1 } = {},+) {const config = facilitatorFor(network);const url = `${config.url}${path}`;const host = hostOf(config.url);@@ -371,13 +387,17 @@ async function callFacilitator(network, path, body, { timeoutMs, idempotencyKey,// calls before giving up.if (retryable && attempt < retries) {attempt += 1;- console.warn(`[x402] facilitator ${path} unreachable (host=${host}, network=${network}): ${err.message} — retry ${attempt}/${retries} in 500ms`);+ console.warn(+ `[x402] facilitator ${path} unreachable (host=${host}, network=${network}): ${err.message} — retry ${attempt}/${retries} in 500ms`,+ );await new Promise((r) => setTimeout(r, 500));continue;}// Server logs keep the host for diagnosis; user-facing X402Error message// omits it so we don't leak internal facilitator topology to clients.- console.warn(`[x402] facilitator ${path} unreachable (host=${host}, network=${network}): ${err.message}`);+ console.warn(+ `[x402] facilitator ${path} unreachable (host=${host}, network=${network}): ${err.message}`,+ );throw new X402Error('facilitator_unreachable',`facilitator ${path} (network=${network}) fetch failed: ${err.message}`,@@ -390,7 +410,9 @@ async function callFacilitator(network, path, body, { timeoutMs, idempotencyKey,try {data = JSON.parse(text);} catch {- console.warn(`[x402] facilitator ${path} non-JSON (host=${host}, network=${network}, status=${res.status})`);+ console.warn(+ `[x402] facilitator ${path} non-JSON (host=${host}, network=${network}, status=${res.status})`,+ );throw new X402Error('facilitator_bad_response',`facilitator ${path} (network=${network}) returned non-JSON (status ${res.status})`,@@ -411,19 +433,28 @@ async function callFacilitator(network, path, body, { timeoutMs, idempotencyKey,// invalid-payment result so verifyPayment emits a clean 402 and the// caller is re-prompted to pay, instead of seeing a server error.if (path === '/verify' && res.status === 400) {- console.warn(`[x402] facilitator /verify rejected payload (host=${host}, network=${network}): ${detail}`);- return { isValid: false, invalidReason: detail || 'payment payload rejected by facilitator' };+ console.warn(+ `[x402] facilitator /verify rejected payload (host=${host}, network=${network}): ${detail}`,+ );+ return {+ isValid: false,+ invalidReason: detail || 'payment payload rejected by facilitator',+ };}// Transient upstream 5xx — the payment network or settlement service// blinked. Retry once for idempotent calls; the Idempotency-Key keeps// a re-sent settle from double-paying.if (retryable && TRANSIENT_FACILITATOR_STATUS.has(res.status) && attempt < retries) {attempt += 1;- console.warn(`[x402] facilitator ${path} ${res.status} (host=${host}, network=${network}): ${detail} — retry ${attempt}/${retries} in 500ms`);+ console.warn(+ `[x402] facilitator ${path} ${res.status} (host=${host}, network=${network}): ${detail} — retry ${attempt}/${retries} in 500ms`,+ );await new Promise((r) => setTimeout(r, 500));continue;}- console.warn(`[x402] facilitator ${path} ${res.status} (host=${host}, network=${network}): ${detail}`);+ console.warn(+ `[x402] facilitator ${path} ${res.status} (host=${host}, network=${network}): ${detail}`,+ );throw new X402Error('facilitator_error',`facilitator ${path} (network=${network}) ${res.status}: ${detail}`,@@ -444,9 +475,10 @@ async function callFacilitator(network, path, body, { timeoutMs, idempotencyKey,// the status surface needs to confirm the facilitator supports each of those// networks. Without CDP creds, Base is the only EVM we can actually settle.export async function probeFacilitators() {- const evmNetworks = env.CDP_API_KEY_ID && env.CDP_API_KEY_SECRET- ? [...CDP_EVM_NETWORKS].filter((n) => n !== NETWORK_BASE_SEPOLIA)- : [NETWORK_BASE_MAINNET];+ const evmNetworks =+ env.CDP_API_KEY_ID && env.CDP_API_KEY_SECRET+ ? [...CDP_EVM_NETWORKS].filter((n) => n !== NETWORK_BASE_SEPOLIA)+ : [NETWORK_BASE_MAINNET];const targets = [...evmNetworks.map((network) => ({ network, ...facilitatorFor(network) })),{ network: NETWORK_SOLANA_MAINNET, ...facilitatorFor(NETWORK_SOLANA_MAINNET) },@@ -522,7 +554,9 @@ export async function probeFacilitators() {: `facilitator does NOT advertise scheme=exact network=${t.network} (configure X402_FACILITATOR_URL_${t.network.toUpperCase()} to a facilitator that does)`,extensions: [...advertisedExtensions],supportsEip2612GasSponsoring: advertisedExtensions.has(EIP2612_EXTENSION_KEY),- supportsErc20ApprovalGasSponsoring: advertisedExtensions.has(ERC20_APPROVAL_EXTENSION_KEY),+ supportsErc20ApprovalGasSponsoring: advertisedExtensions.has(+ ERC20_APPROVAL_EXTENSION_KEY,+ ),});}return results;@@ -542,6 +576,22 @@ function detectAssetTransferMethod(paymentPayload) {return null;}+// True for accepts[] entries that exist only to advertise an authentication+// alternative (USE-21 auth-hints): zero-amount placeholders flagged with+// `extra.authRequired`. They are redeemed by presenting the matching auth+// header (Authorization / SIGN-IN-WITH-X) BEFORE the payment dance — never by+// an X-PAYMENT header. verifyPayment must exclude them from requirement+// matching so the invariant is enforced structurally rather than relying on+// the real entries happening to sort first: otherwise a crafted payload (e.g.+// a Base payment against a Solana-only paid route that still advertises a+// Base auth-hint entry) could select the amount="0" requirement and obtain+// the resource for a zero-value settlement.+function isAuthHintAccept(requirement) {+ if (!requirement || typeof requirement !== 'object') return false;+ if (requirement.extra?.authRequired != null) return true;+ return String(requirement.amount) === '0';+}+// Match the decoded payload to one of the offered requirements. The match is// by (network, assetTransferMethod) when we can detect the method from the// payload shape — needed because we now publish two accept entries per EVM@@ -594,7 +644,11 @@ function decodeSignedAmount(paymentPayload) {if (inner.authorization && typeof inner.authorization === 'object') {const v = inner.authorization.value;if (typeof v === 'string' || typeof v === 'number' || typeof v === 'bigint') {- try { return BigInt(v); } catch { return null; }+ try {+ return BigInt(v);+ } catch {+ return null;+ }}}// Permit2 PermitWitnessTransferFrom — `permitted.amount` is what the user@@ -603,12 +657,20 @@ function decodeSignedAmount(paymentPayload) {const permitted = inner.permit2Authorization?.permit?.permitted;const v = permitted?.amount;if (typeof v === 'string' || typeof v === 'number' || typeof v === 'bigint') {- try { return BigInt(v); } catch { return null; }+ try {+ return BigInt(v);+ } catch {+ return null;+ }}// Some clients flatten to `permit2Authorization.amount`.const flat = inner.permit2Authorization.amount;if (typeof flat === 'string' || typeof flat === 'number' || typeof flat === 'bigint') {- try { return BigInt(flat); } catch { return null; }+ try {+ return BigInt(flat);+ } catch {+ return null;+ }}}return null;@@ -636,11 +698,7 @@ function decodeSignedRecipient(paymentPayload) {// (null = facilitator-trusted) rather than guess when none are present.if (inner.permit2Authorization && typeof inner.permit2Authorization === 'object') {const p2 = inner.permit2Authorization;- const candidate =- p2.transferDetails?.to ??- p2.witness?.to ??- p2.spender ??- p2.to;+ const candidate = p2.transferDetails?.to ?? p2.witness?.to ?? p2.spender ?? p2.to;if (typeof candidate === 'string' && candidate) return candidate.toLowerCase();}return null;@@ -686,8 +744,22 @@ function buildIdempotencyKey({ paymentPayload, requirement }) {// explicitly to opt out (e.g. test harnesses).export async function verifyPayment({ paymentHeader, requirements, builderCode }) {const all = Array.isArray(requirements) ? requirements : [requirements];+ // Auth-hint placeholder entries (amount="0" / extra.authRequired) are never+ // payable via X-PAYMENT — drop them before matching so the zero-amount+ // bypass can't be reached regardless of accepts[] ordering. The auth-hint+ // redemption path never calls verifyPayment (it short-circuits on the auth+ // header in x402-paid-endpoint.js), so this filter only ever removes+ // entries an X-PAYMENT was forbidden from matching in the first place.+ const payable = all.filter((r) => !isAuthHintAccept(r));+ if (!payable.length) {+ throw new X402Error(+ 'invalid_payment',+ 'this resource has no payable accepts[] entries — use the advertised authentication method instead of X-PAYMENT',+ 402,+ );+ }const paymentPayload = decodePaymentHeader(paymentHeader);- const requirement = selectRequirement(paymentPayload, all);+ const requirement = selectRequirement(paymentPayload, payable);const effectiveBuilderCode =builderCode === undefined && env.X402_BUILDER_CODE_APP? declareBuilderCodeExtension({ a: env.X402_BUILDER_CODE_APP })@@ -709,9 +781,14 @@ export async function verifyPayment({ paymentHeader, requirements, builderCode }const signedAmount = decodeSignedAmount(paymentPayload);if (signedAmount !== null) {let required;- try { required = BigInt(requirement.amount); }- catch {- throw new X402Error('invalid_requirement', `requirement.amount must parse as BigInt, got "${requirement.amount}"`, 500);+ try {+ required = BigInt(requirement.amount);+ } catch {+ throw new X402Error(+ 'invalid_requirement',+ `requirement.amount must parse as BigInt, got "${requirement.amount}"`,+ 500,+ );}if (signedAmount < required) {throw new X402Error(@@ -768,7 +845,11 @@ export async function verifyPayment({ paymentHeader, requirements, builderCode }502,);}- if (result.asset && requirement.asset && String(result.asset).toLowerCase() !== String(requirement.asset).toLowerCase()) {+ if (+ result.asset &&+ requirement.asset &&+ String(result.asset).toLowerCase() !== String(requirement.asset).toLowerCase()+ ) {throw new X402Error('facilitator_bad_response',`facilitator /verify asset mismatch: requested ${requirement.asset}, got ${result.asset}`,@@ -810,7 +891,11 @@ export async function settlePayment(args) {const verifiedPayer = verified?.payer || args?.verifiedPayer || null;if (!requirement) {- throw new X402Error('settle_failed', 'settlePayment requires `verified` or `requirement`', 500);+ throw new X402Error(+ 'settle_failed',+ 'settlePayment requires `verified` or `requirement`',+ 500,+ );}const config = facilitatorFor(requirement.network);@@ -854,7 +939,11 @@ export async function settlePayment(args) {502,);}- if (verifiedPayer && result.payer && String(result.payer).toLowerCase() !== String(verifiedPayer).toLowerCase()) {+ if (+ verifiedPayer &&+ result.payer &&+ String(result.payer).toLowerCase() !== String(verifiedPayer).toLowerCase()+ ) {throw new X402Error('facilitator_bad_response',`facilitator /settle payer mismatch: verified ${verifiedPayer}, settled ${result.payer}`,@@ -896,7 +985,13 @@ export const RESOURCE_DESCRIPTION =// from it causes agentic.market's parser to reject the endpoint with// "v2 discovery extension validation failed" even when all surface-level// checks (Transport, Payment Requirements, Bazaar Extension) pass.-export function buildBazaarSchema({ method, queryParamsSchema, bodyType, bodySchema, outputSchema }) {+export function buildBazaarSchema({+ method,+ queryParamsSchema,+ bodyType,+ bodySchema,+ outputSchema,+}) {const upperMethod = String(method || 'GET').toUpperCase();const isBodyMethod = ['POST', 'PUT', 'PATCH'].includes(upperMethod);const inputProperties = {@@ -909,7 +1004,8 @@ export function buildBazaarSchema({ method, queryParamsSchema, bodyType, bodySchconst inputRequired = ['type', 'method'];if (isBodyMethod) {inputProperties.bodyType = { type: 'string', enum: ['json', 'form-data', 'text'] };- inputProperties.body = bodySchema && typeof bodySchema === 'object' ? bodySchema : { type: 'object' };+ inputProperties.body =+ bodySchema && typeof bodySchema === 'object' ? bodySchema : { type: 'object' };inputRequired.push('bodyType', 'body');} else if (queryParamsSchema && typeof queryParamsSchema === 'object') {inputProperties.queryParams = { type: 'object', ...queryParamsSchema };diff --git a/api/_lib/x402-spending-ledger.js b/api/_lib/x402-spending-ledger.jsindex 622434cf7..1379376a2 100644--- a/api/_lib/x402-spending-ledger.js+++ b/api/_lib/x402-spending-ledger.js@@ -145,6 +145,23 @@ export async function reserve({ address, microUsd, timestamp = now() }) {return { hour, day };}+// Atomic floor-at-zero decrement. The memory path clamps negative totals to 0+// (see memoryIncr); without the same clamp here a double-rollback (or a+// rollback racing bucket expiry) would drive the Redis counter negative,+// letting subsequent spend exceed the cap by the deficit. DECRBY + conditional+// INCRBY-back runs as one Lua script so concurrent reserves can't observe (or+// be clobbered by) the intermediate negative value. INCRBY preserves the TTL.+const ROLLBACK_FLOOR_LUA = `local v = redis.call('DECRBY', KEYS[1], ARGV[1])+if v < 0 then+ redis.call('INCRBY', KEYS[1], -v)+ v = 0+end+return v`;++function redisDecrbyFloored(redis, key, delta) {+ return redis.eval(ROLLBACK_FLOOR_LUA, [key], [String(delta)]);+}+// Inverse of reserve(). Decrements the same buckets by the same amount.// Used by the cap hook when admission passed but the payment subsequently// failed (signing rejected, facilitator returned 402, network error, etc.)@@ -165,7 +182,10 @@ export async function rollback({ address, microUsd, timestamp = now() }) {memoryIncr(dKey, -delta, DAY_TTL_SECONDS);return;}- await Promise.all([redis.incrby(hKey, -Number(delta)), redis.incrby(dKey, -Number(delta))]);+ await Promise.all([+ redisDecrbyFloored(redis, hKey, delta),+ redisDecrbyFloored(redis, dKey, delta),+ ]);}// Snapshot of the current hour + day spend without modifying. Used bydiff --git a/api/_lib/x402-user-payer.js b/api/_lib/x402-user-payer.jsindex ef6ed1575..9f8b914e6 100644--- a/api/_lib/x402-user-payer.js+++ b/api/_lib/x402-user-payer.js@@ -15,11 +15,77 @@// resolveSpendEnabled() returns false and callers degrade to a payment-details// handoff instead of moving funds.+import dns from 'node:dns';+import https from 'node:https';+import http from 'node:http';import { sql } from './db.js';import { solanaConnection } from './solana/connection.js';import { env } from './env.js';import { recoverSolanaAgentKeypair } from './agent-wallet.js';import { installSpendingCap } from './x402-spending-cap.js';+import { validatePublicUrl, isPrivateAddress, SsrfError } from './ssrf.js';++// SSRF guard for the user-paying client. `pay_and_call` forwards a caller-+// supplied URL into a server-side HTTP request, so without this an authenticated+// user could steer the request at cloud metadata (169.254.169.254), localhost,+// or RFC-1918 hosts and read the reflected body. We defend in three layers:+// 1. validatePublicUrl() — https-only (http in dev), at the boundary.+// 2. guardedLookup — rejects resolution to any private/loopback/link-local/+// metadata address AT CONNECT TIME, closing the DNS-rebinding window that a+// resolve-then-connect check would leave open.+// 3. maxRedirects: 0 on the axios client — a public host cannot 30x-redirect+// into an internal target.+// This mirrors the guard the local mcp-bridge already applies (assertPayableUrl+// + maxRedirects:0); the hosted path was the one missing it.+function guardedLookup(hostname, options, callback) {+ const cb = typeof options === 'function' ? options : callback;+ const opts = typeof options === 'function' ? {} : options || {};+ dns.lookup(hostname, { ...opts, all: true, verbatim: true }, (err, addresses) => {+ if (err) return cb(err);+ const addrs = Array.isArray(addresses) ? addresses : [addresses];+ for (const a of addrs) {+ if (isPrivateAddress(a.address, a.family)) {+ return cb(+ new SsrfError(`blocked private address for ${hostname}`, 'private_address'),+ );+ }+ }+ if (opts.all) return cb(null, addrs);+ return cb(null, addrs[0].address, addrs[0].family);+ });+}++const ssrfHttpsAgent = new https.Agent({ lookup: guardedLookup, keepAlive: false });+const ssrfHttpAgent = new http.Agent({ lookup: guardedLookup, keepAlive: false });++// Boundary check: scheme + that the literal/resolved host is not private. Throws+// an Error with a safe `.code` for the MCP handler to translate.+async function assertPublicPayableUrl(rawUrl) {+ let url;+ try {+ url = validatePublicUrl(rawUrl);+ } catch (e) {+ throw Object.assign(new Error('target URL is not a permitted public https endpoint'), {+ code: 'invalid_url',+ cause: e,+ });+ }+ // Resolve up front so an obviously-internal target is rejected before we+ // recover the user's key or move any money. The connect-time guardedLookup is+ // the authoritative check; this is a fast fail.+ await new Promise((resolve, reject) => {+ guardedLookup(url.hostname, { all: true }, (err) =>+ err+ ? reject(+ Object.assign(new Error('target URL resolves to a non-public address'), {+ code: 'blocked_url',+ }),+ )+ : resolve(),+ );+ });+ return url.href;+}// Atomic-USDC caps. Defaults are intentionally tiny; operators raise them via// env once they trust the flow. A per-call override from the tool can only@@ -70,14 +136,19 @@ export async function resolveUserAgentWallet(userId) {// Build a paying axios instance bound to the user's Solana keypair, with the// platform spending cap installed. Returns { api, client, uninstall, address }.async function buildUserPayingClient({ wallet, userId, maxPerCallOverride }) {- const [{ default: axios }, { x402Client, x402HTTPClient }, { wrapAxiosWithPayment }, { ExactSvmScheme }, { createKeyPairSignerFromBytes }] =- await Promise.all([- import('axios'),- import('@x402/core/client'),- import('@x402/axios'),- import('@x402/svm/exact/client'),- import('@solana/kit'),- ]);+ const [+ { default: axios },+ { x402Client, x402HTTPClient },+ { wrapAxiosWithPayment },+ { ExactSvmScheme },+ { createKeyPairSignerFromBytes },+ ] = await Promise.all([+ import('axios'),+ import('@x402/core/client'),+ import('@x402/axios'),+ import('@x402/svm/exact/client'),+ import('@solana/kit'),+ ]);const keypair = await recoverSolanaAgentKeypair(wallet.encryptedSecret, {agentId: wallet.agentId,@@ -91,7 +162,9 @@ async function buildUserPayingClient({ wallet, userId, maxPerCallOverride }) {const envPerCall = envAtomic('X402_MAX_PER_CALL_ATOMIC', DEFAULT_MAX_PER_CALL);const perCall =- maxPerCallOverride != null && maxPerCallOverride < envPerCall ? maxPerCallOverride : envPerCall;+ maxPerCallOverride != null && maxPerCallOverride < envPerCall+ ? maxPerCallOverride+ : envPerCall;const uninstall = installSpendingCap(client, {address: wallet.address,maxPerCall: perCall.toString(),@@ -101,7 +174,15 @@ async function buildUserPayingClient({ wallet, userId, maxPerCallOverride }) {const httpClient = new x402HTTPClient(client);const api = wrapAxiosWithPayment(- axios.create({ timeout: 60_000, validateStatus: (s) => s >= 200 && s < 300 }),+ axios.create({+ timeout: 60_000,+ validateStatus: (s) => s >= 200 && s < 300,+ // SSRF defense: pin connects to non-private addresses and never follow+ // a redirect into an internal target. See guardedLookup above.+ maxRedirects: 0,+ httpsAgent: ssrfHttpsAgent,+ httpAgent: ssrfHttpAgent,+ }),client,);return { api, client, httpClient, uninstall, address: wallet.address };@@ -110,7 +191,11 @@ async function buildUserPayingClient({ wallet, userId, maxPerCallOverride }) {function extractReceipt(httpClient, response) {if (!response?.headers) return null;try {- return httpClient.getPaymentSettleResponse((n) => response.headers[n] ?? response.headers[n.toLowerCase()]) || null;+ return (+ httpClient.getPaymentSettleResponse(+ (n) => response.headers[n] ?? response.headers[n.toLowerCase()],+ ) || null+ );} catch {return null;}@@ -124,8 +209,10 @@ const USDC_MAINNET_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';export async function getUserWalletStatus(userId) {const wallet = await resolveUserAgentWallet(userId);const caps = {- max_per_call_usdc: Number(envAtomic('X402_MAX_PER_CALL_ATOMIC', DEFAULT_MAX_PER_CALL)) / 1e6,- max_per_hour_usdc: Number(envAtomic('X402_MAX_PER_HOUR_ATOMIC', DEFAULT_MAX_PER_HOUR)) / 1e6,+ max_per_call_usdc:+ Number(envAtomic('X402_MAX_PER_CALL_ATOMIC', DEFAULT_MAX_PER_CALL)) / 1e6,+ max_per_hour_usdc:+ Number(envAtomic('X402_MAX_PER_HOUR_ATOMIC', DEFAULT_MAX_PER_HOUR)) / 1e6,max_per_day_usdc: Number(envAtomic('X402_MAX_PER_DAY_ATOMIC', DEFAULT_MAX_PER_DAY)) / 1e6,};const spend_enabled = resolveSpendEnabled();@@ -191,7 +278,9 @@ export async function payExternalX402({ userId, url, method = 'GET', body, maxUs}const wallet = await resolveUserAgentWallet(userId);if (!wallet) {- throw Object.assign(new Error('no agent wallet found for this account'), { code: 'no_wallet' });+ throw Object.assign(new Error('no agent wallet found for this account'), {+ code: 'no_wallet',+ });}if (!wallet.address || !wallet.hasSecret) {throw Object.assign(new Error('your agent has no Solana wallet provisioned'), {@@ -199,6 +288,10 @@ export async function payExternalX402({ userId, url, method = 'GET', body, maxUs});}+ // Reject internal / non-public targets before recovering the key or moving+ // money. Throws { code: invalid_url | blocked_url } for the handler.+ const safeUrl = await assertPublicPayableUrl(url);+const maxPerCallOverride =typeof maxUsd === 'number' && maxUsd > 0 ? BigInt(Math.round(maxUsd * 1_000_000)) : null;@@ -210,7 +303,7 @@ export async function payExternalX402({ userId, url, method = 'GET', body, maxUstry {const response = await api.request({- url,+ url: safeUrl,method,...(body != null ? { data: body } : {}),});diff --git a/api/_lib/x402/idempotency-cache.js b/api/_lib/x402/idempotency-cache.jsindex 5537376d9..81dcb00a2 100644--- a/api/_lib/x402/idempotency-cache.js+++ b/api/_lib/x402/idempotency-cache.js@@ -24,14 +24,25 @@ if (env.UPSTASH_REDIS_REST_URL && env.UPSTASH_REDIS_REST_TOKEN) {url: env.UPSTASH_REDIS_REST_URL,token: env.UPSTASH_REDIS_REST_TOKEN,});+} else if (IS_PROD && !ALLOW_MEMORY_FALLBACK) {+ // No Redis in production and no explicit opt-in: refuse to boot rather than+ // silently degrade to a per-instance Map that can't dedup across Vercel+ // replicas (a replay-protection hole). The comment used to claim this was+ // enforced while the code only warned — now it actually is. An operator who+ // truly wants the per-container fallback must set X402_ALLOW_MEMORY_FALLBACK=1.+ throw new Error(+ '[x402-idempotency] refusing to boot in production without Upstash: set ' ++ 'UPSTASH_REDIS_REST_URL + UPSTASH_REDIS_REST_TOKEN for cross-replica replay ' ++ 'protection, or set X402_ALLOW_MEMORY_FALLBACK=1 to explicitly accept the ' ++ 'per-instance memory fallback.',+ );} else if (IS_PROD) {- // No Redis configured. Per-instance memory fallback prevents replays- // within a single function container but not across Vercel replicas.- // Set UPSTASH_REDIS_REST_URL + UPSTASH_REDIS_REST_TOKEN to enable- // cross-replica deduplication.+ // Operator explicitly opted into the per-instance memory fallback. It prevents+ // replays within a single function container but NOT across Vercel replicas.console.warn('[x402-idempotency] UPSTASH_REDIS_REST_URL/TOKEN not set; ' +- 'using per-instance memory fallback. Cross-replica replay protection requires Redis.',+ 'X402_ALLOW_MEMORY_FALLBACK=1 — using per-instance memory fallback. ' ++ 'Cross-replica replay protection requires Redis.',);}diff --git a/api/_lib/zauth.js b/api/_lib/zauth.jsindex b05371d5d..3af323c07 100644--- a/api/_lib/zauth.js+++ b/api/_lib/zauth.js@@ -91,7 +91,8 @@ function buildMiddleware() {rejectEmptyCollections: true,errorFields: ['error', 'error_description'],},- // Auto-refund callers who pay and receive a server error or empty body.+ // Auto-refund callers who pay and then hit a genuine server-side+ // failure (5xx) or a timeout — NOT a valid empty result (see triggers).// Enabled only when at least one refund keypair is present. Caps are// set above our highest tool price ($0.05) with conservative daily/// monthly ceilings; all three are overridable via env without a deploy.@@ -104,7 +105,11 @@ function buildMiddleware() {monthlyCapUsd: Number(process.env.ZAUTH_REFUND_MONTHLY_CAP_USD) || 250.0,triggers: {serverError: true,- emptyResponse: true,+ // Anti-griefing: a valid empty result (search with zero matches, empty+ // claims window) is a normal billable outcome; auto-refunding it let+ // an attacker farm refunds up to the daily cap with empty-result+ // calls. Genuine failures still refund via serverError (5xx)/timeout.+ emptyResponse: false,timeout: true,schemaValidation: false,},diff --git a/api/_mcp/dispatch.js b/api/_mcp/dispatch.jsindex 3b63d8f8c..ee7e431b8 100644--- a/api/_mcp/dispatch.js+++ b/api/_mcp/dispatch.js@@ -1,6 +1,11 @@import { hasScope } from '../_lib/auth.js';import { recordEvent, logger } from '../_lib/usage.js';-import { priceFor, findActiveSubscription, resolveBillingMint, x402AmountForTool } from '../_lib/pump-pricing.js';+import {+ priceFor,+ findActiveSubscription,+ resolveBillingMint,+ x402AmountForTool,+} from '../_lib/pump-pricing.js';import { declareMcpDiscovery } from '../_lib/x402/bazaar-helpers.js';import { sanitizeToolError } from '../_lib/mcp-error-sanitize.js';import { TOOL_CATALOG, TOOLS } from './catalog.js';@@ -117,7 +122,9 @@ async function onInitialize(_params, _auth) {async function onToolCall(params, auth, started, req) {const { name, arguments: args = {} } = params || {};- const tool = TOOLS[name];+ // Own-property lookup only: a name like "__proto__" or "constructor" would+ // otherwise resolve an inherited Object member and slip past the !tool guard.+ const tool = typeof name === 'string' && Object.hasOwn(TOOLS, name) ? TOOLS[name] : null;if (!tool) throw rpcError(-32602, `unknown tool: ${name}`);if (tool.scope && !hasScope(auth.scope, tool.scope)) {throw rpcError(-32002, `insufficient scope, requires ${tool.scope}`);diff --git a/api/_mcpagent/tools.js b/api/_mcpagent/tools.jsindex 36d469374..d5319012a 100644--- a/api/_mcpagent/tools.js+++ b/api/_mcpagent/tools.js@@ -21,10 +21,7 @@ import {payExternalX402,resolveSpendEnabled,} from '../_lib/x402-user-payer.js';-import {- getOrCreateAgentSolanaWallet,- getSolanaAddressBalances,-} from '../_lib/agent-wallet.js';+import { getOrCreateAgentSolanaWallet, getSolanaAddressBalances } from '../_lib/agent-wallet.js';import {createPaidService,validateTargetUrl,@@ -74,7 +71,10 @@ function signInRequired(text) {function scopeRequired(scope) {return {content: [- { type: 'text', text: `This action needs the ${scope} scope. Re-authorize with it granted.` },+ {+ type: 'text',+ text: `This action needs the ${scope} scope. Re-authorize with it granted.`,+ },],structuredContent: { ok: false, reason: 'insufficient_scope', required: scope },isError: true,@@ -159,7 +159,9 @@ export const toolDefs = [`Spending caps: $${status.caps.max_per_call_usdc}/call, $${status.caps.max_per_hour_usdc}/hr, $${status.caps.max_per_day_usdc}/day`,`Autonomous spend: ${status.spend_enabled ? 'enabled' : 'disabled'}`,]- : ['No agent wallet is provisioned for this account yet. Create one on three.ws to enable payments.'];+ : [+ 'No agent wallet is provisioned for this account yet. Create one on three.ws to enable payments.',+ ];return {content: [{ type: 'text', text: lines.join('\n') }],structuredContent: { signed_in: true, ...status },@@ -174,9 +176,15 @@ export const toolDefs = [inputSchema: {type: 'object',properties: {- query: { type: 'string', description: 'What you need, e.g. "weather", "image upscale".' },+ query: {+ type: 'string',+ description: 'What you need, e.g. "weather", "image upscale".',+ },type: { type: 'string', enum: ['http', 'mcp'], default: 'http' },- network: { type: 'string', description: 'CAIP-2 network filter, e.g. "solana:*" or "eip155:8453".' },+ network: {+ type: 'string',+ description: 'CAIP-2 network filter, e.g. "solana:*" or "eip155:8453".',+ },max_price_usdc: { type: 'number', minimum: 0 },limit: { type: 'integer', minimum: 1, maximum: 50, default: 15 },},@@ -201,7 +209,10 @@ export const toolDefs = [}));const text = services.length? services- .map((s, i) => `${i + 1}. ${s.name || s.resource}${s.price ? ` — ${s.price}` : ''}\n ${s.resource}`)+ .map(+ (s, i) =>+ `${i + 1}. ${s.name || s.resource}${s.price ? ` — ${s.price}` : ''}\n ${s.resource}`,+ ).join('\n'): `No services matched "${args.query}".`;return {@@ -218,13 +229,18 @@ export const toolDefs = [inputSchema: {type: 'object',properties: {- resource_url: { type: 'string', format: 'uri', description: 'The x402 endpoint to call.' },+ resource_url: {+ type: 'string',+ format: 'uri',+ description: 'The x402 endpoint to call.',+ },method: { type: 'string', enum: ['GET', 'POST'], default: 'GET' },body: { type: 'object', description: 'JSON body for POST requests.' },max_usd: {type: 'number',minimum: 0,- description: 'Hard ceiling for THIS call in USD. Can only lower the server caps, never raise them.',+ description:+ 'Hard ceiling for THIS call in USD. Can only lower the server caps, never raise them.',},},required: ['resource_url'],@@ -285,6 +301,9 @@ export const toolDefs = [auth_required: 'Sign in to pay from your wallet.',no_wallet: 'No agent wallet found for your account — create one on three.ws.',no_solana_wallet: 'Your agent has no Solana wallet provisioned.',+ invalid_url: 'That resource URL is not a permitted public https endpoint.',+ blocked_url:+ 'That resource URL resolves to a non-public address and was blocked.',};const msg = friendly[err.code] || `Payment failed: ${err.message}`;return {@@ -304,11 +323,15 @@ export const toolDefs = [name: 'provision_wallet',title: "Create the agent's wallet",description:- "Create (or return) the custodial Solana wallet for one of your agents so it can hold and earn USDC. Idempotent — if the agent already has a wallet, its address and live SOL/USDC balances are returned unchanged. On devnet you can request a 1 SOL airdrop for testing; mainnet wallets are never airdropped. Requires sign-in; you can only provision wallets for agents on your own account.",+ 'Create (or return) the custodial Solana wallet for one of your agents so it can hold and earn USDC. Idempotent — if the agent already has a wallet, its address and live SOL/USDC balances are returned unchanged. On devnet you can request a 1 SOL airdrop for testing; mainnet wallets are never airdropped. Requires sign-in; you can only provision wallets for agents on your own account.',inputSchema: {type: 'object',properties: {- agent_id: { type: 'string', format: 'uuid', description: 'The agent to provision a wallet for.' },+ agent_id: {+ type: 'string',+ format: 'uuid',+ description: 'The agent to provision a wallet for.',+ },cluster: { type: 'string', enum: ['mainnet', 'devnet'], default: 'mainnet' },airdrop: {type: 'boolean',@@ -381,14 +404,22 @@ export const toolDefs = [agent_id: { type: 'string', format: 'uuid' },name: { type: 'string', minLength: 1, maxLength: 120 },description: { type: 'string', minLength: 1, maxLength: 2000 },- price_usdc: { type: 'number', exclusiveMinimum: 0, description: 'Price per call in USDC.' },+ price_usdc: {+ type: 'number',+ exclusiveMinimum: 0,+ description: 'Price per call in USDC.',+ },target_url: {type: 'string',format: 'uri',- description: 'The public https upstream you already serve, called after payment settles.',+ description:+ 'The public https upstream you already serve, called after payment settles.',},method: { type: 'string', enum: ['GET', 'POST'], default: 'POST' },- input_schema: { type: 'object', description: 'Optional JSON Schema for the request body.' },+ input_schema: {+ type: 'object',+ description: 'Optional JSON Schema for the request body.',+ },network: { type: 'string', enum: ['base', 'solana'], default: 'base' },},required: ['agent_id', 'name', 'description', 'price_usdc', 'target_url'],@@ -427,7 +458,10 @@ export const toolDefs = [: `This agent needs ${need} (registered at agent creation) before it can earn on Base.`;return {content: [- { type: 'text', text: `This agent has no payout wallet on ${network}. ${hint}` },+ {+ type: 'text',+ text: `This agent has no payout wallet on ${network}. ${hint}`,+ },],structuredContent: { ok: false, reason: 'no_payout_wallet', network },isError: true,@@ -439,7 +473,10 @@ export const toolDefs = [try {targetUrl = await validateTargetUrl(args.target_url);} catch (err) {- const message = err instanceof MonetizeError ? err.message : `target_url rejected: ${err?.message || err}`;+ const message =+ err instanceof MonetizeError+ ? err.message+ : `target_url rejected: ${err?.message || err}`;return {content: [{ type: 'text', text: message }],structuredContent: { ok: false, reason: 'invalid_target_url' },diff --git a/api/admin/[resource].js b/api/admin/[resource].jsindex 92822aec2..3303ea3e9 100644--- a/api/admin/[resource].js+++ b/api/admin/[resource].js@@ -1,5 +1,5 @@import { sql } from '../_lib/db.js';-import { cors, json, method, wrap } from '../_lib/http.js';+import { cors, json, method, wrap, error } from '../_lib/http.js';import { requireAdmin } from '../_lib/admin.js';export default wrap(async (req, res) => {@@ -199,6 +199,5 @@ export default wrap(async (req, res) => {return json(res, 200, { totals, byRoute, byDay });}- res.statusCode = 404;- return res.end();+ return error(res, 404, 'not_found', 'unknown admin resource');});diff --git a/api/admin/bulk-launch.js b/api/admin/bulk-launch.jsindex 10fabd3ab..314ab8f13 100644--- a/api/admin/bulk-launch.js+++ b/api/admin/bulk-launch.js@@ -1,4 +1,4 @@-// GET /api/admin/bulk-launch — SSE stream that deploys agents on-chain as+// POST /api/admin/bulk-launch — SSE stream that deploys agents on-chain as// Metaplex Core assets inside the three.ws Agent Collection (NOT pump.fun).//// Each agent becomes a real Solana Metaplex Core NFT — its on-chain identity:@@ -33,6 +33,7 @@import { LAMPORTS_PER_SOL } from '@solana/web3.js';import { cors, method, error } from '../_lib/http.js';import { requireAdmin } from '../_lib/admin.js';+import { requireCsrf } from '../_lib/csrf.js';import {authoritySecret,buildAuthorityUmi,@@ -54,11 +55,12 @@ function sse(res, event, data) {}export default async function handler(req, res) {- if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;- if (!method(req, res, ['GET'])) return;+ if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;+ if (!method(req, res, ['POST'])) return;const admin = await requireAdmin(req, res);if (!admin) return;+ if (!(await requireCsrf(req, res, admin.id))) return;const q = req.query ?? {};const network = q.network === 'devnet' ? 'devnet' : 'mainnet';@@ -88,7 +90,9 @@ export default async function handler(req, res) {res.setHeader('x-accel-buffering', 'no');let aborted = false;- req.on('close', () => { aborted = true; });+ req.on('close', () => {+ aborted = true;+ });const authorityPk = authoritySigner.publicKey;const startBalance = await funderLamports(umi, authorityPk);@@ -112,7 +116,11 @@ export default async function handler(req, res) {onEvent: dryRun ? undefined : (type, data) => sse(res, type, data),});} catch (err) {- sse(res, 'error', { agent_id: null, name: 'collection', error: `collection: ${err.message}` });+ sse(res, 'error', {+ agent_id: null,+ name: 'collection',+ error: `collection: ${err.message}`,+ });sse(res, 'done', { deployed: 0, errors: 1, skipped: 0 });return res.end();}@@ -175,7 +183,11 @@ export default async function handler(req, res) {avatar_thumb: r.image || null,});} catch (err) {- sse(res, 'error', { agent_id: agent.id, name: agentName, error: `deploy: ${err.message}` });+ sse(res, 'error', {+ agent_id: agent.id,+ name: agentName,+ error: `deploy: ${err.message}`,+ });errors++;}diff --git a/api/admin/register-agents.js b/api/admin/register-agents.jsindex aaeb89d30..e17ded033 100644--- a/api/admin/register-agents.js+++ b/api/admin/register-agents.js@@ -1,4 +1,4 @@-// GET /api/admin/register-agents — SSE stream that back-fills the Metaplex Agent+// POST /api/admin/register-agents — SSE stream that back-fills the Metaplex Agent// Registry for agents already minted as Core assets but missing an Agent Identity// PDA. Minting an asset (api/admin/bulk-launch.js) makes the NFT; this enrols it// in Metaplex's on-chain registry so the agent is discoverable there.@@ -25,6 +25,7 @@import { LAMPORTS_PER_SOL } from '@solana/web3.js';import { cors, method, error } from '../_lib/http.js';import { requireAdmin } from '../_lib/admin.js';+import { requireCsrf } from '../_lib/csrf.js';import {authoritySecret,buildAuthorityUmi,@@ -43,11 +44,12 @@ function sse(res, event, data) {}export default async function handler(req, res) {- if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;- if (!method(req, res, ['GET'])) return;+ if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;+ if (!method(req, res, ['POST'])) return;const admin = await requireAdmin(req, res);if (!admin) return;+ if (!(await requireCsrf(req, res, admin.id))) return;const q = req.query ?? {};const network = q.network === 'devnet' ? 'devnet' : 'mainnet';@@ -77,7 +79,9 @@ export default async function handler(req, res) {res.setHeader('x-accel-buffering', 'no');let aborted = false;- req.on('close', () => { aborted = true; });+ req.on('close', () => {+ aborted = true;+ });const authorityPk = authoritySigner.publicKey;const startBalance = await funderLamports(umi, authorityPk);@@ -137,7 +141,11 @@ export default async function handler(req, res) {if (r.alreadyRegistered) already++;else registered++;} catch (err) {- sse(res, 'error', { agent_id: agent.id, name: agentName, error: `register: ${err.message}` });+ sse(res, 'error', {+ agent_id: agent.id,+ name: agentName,+ error: `register: ${err.message}`,+ });errors++;}diff --git a/api/admin/user/[id].js b/api/admin/user/[id].jsindex b15c20545..d6e98a683 100644--- a/api/admin/user/[id].js+++ b/api/admin/user/[id].js@@ -8,11 +8,13 @@ import { requireAdmin } from '../../_lib/admin.js';import { requireCsrf } from '../../_lib/csrf.js';import { parse } from '../../_lib/validate.js';-const patchSchema = z.object({- plan: z.enum(['free','pro','team','enterprise']).optional(),- is_admin: z.boolean().optional(),- deleted: z.boolean().optional(),-}).refine((d) => Object.keys(d).length > 0, { message: 'nothing to update' });+const patchSchema = z+ .object({+ plan: z.enum(['free', 'pro', 'team', 'enterprise']).optional(),+ is_admin: z.boolean().optional(),+ deleted: z.boolean().optional(),+ })+ .refine((d) => Object.keys(d).length > 0, { message: 'nothing to update' });export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,PATCH,OPTIONS', credentials: true })) return;@@ -20,13 +22,15 @@ export default wrap(async (req, res) => {const admin = await requireAdmin(req, res);if (!admin) return;- const id = req.url.split('/').pop().split('?')[0];- if (!id) return error(res, 400, 'bad_request', 'missing user id');-if (req.method === 'PATCH') {if (!(await requireCsrf(req, res, admin.id))) return;}+ const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;+ const id = req.url.split('/').pop().split('?')[0];+ if (!id) return error(res, 400, 'bad_request', 'missing user id');+ if (!UUID_REGEX.test(id)) return error(res, 400, 'invalid_id', 'user id must be a valid UUID');+if (req.method === 'GET') {const [user] = await sql`selectdiff --git a/api/admin/withdrawals/[id].js b/api/admin/withdrawals/[id].jsindex c35707e60..ea7f7d292 100644--- a/api/admin/withdrawals/[id].js+++ b/api/admin/withdrawals/[id].js@@ -26,7 +26,10 @@ export default wrap(async (req, res) => {if (!admin) return;if (!(await requireCsrf(req, res, admin.id))) return;+ const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;const id = req.query?.id;+ if (!id || !UUID_REGEX.test(id))+ return error(res, 400, 'invalid_id', 'withdrawal id must be a valid UUID');const body = parse(patchBody, await readJson(req));const { status, tx_signature } = body;@@ -47,7 +50,12 @@ export default wrap(async (req, res) => {}if (status === 'processing' && !tx_signature) {- return error(res, 400, 'validation_error', 'tx_signature required when advancing to processing');+ return error(+ res,+ 400,+ 'validation_error',+ 'tx_signature required when advancing to processing',+ );}const [withdrawal] = await sql`diff --git a/api/agent-skill-price.js b/api/agent-skill-price.jsindex 9b6b38287..2e605ec77 100644--- a/api/agent-skill-price.js+++ b/api/agent-skill-price.js@@ -7,16 +7,17 @@import { sql } from './_lib/db.js';import { authenticateBearer, extractBearer, getSessionUser } from './_lib/auth.js';import { cors, error, json, method, readJson, wrap, rateLimited } from './_lib/http.js';+import { requireCsrf } from './_lib/csrf.js';import { clientIp, limits } from './_lib/rate-limit.js';import { z } from 'zod';const BASE58_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;const bodySchema = z.object({- skill: z.string().trim().min(1).max(100),- amount: z.number().int().min(0),+ skill: z.string().trim().min(1).max(100),+ amount: z.number().int().min(0),currency_mint: z.string().trim().regex(BASE58_RE, 'invalid mint address'),- chain: z.string().trim().min(1).max(20).default('solana'),+ chain: z.string().trim().min(1).max(20).default('solana'),});async function resolveAuth(req) {@@ -33,6 +34,8 @@ export default wrap(async (req, res) => {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ // Cookie-session mutation — CSRF required (bearer callers exempt inside requireCsrf).+ if (!(await requireCsrf(req, res, auth.userId))) return;const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);@@ -53,7 +56,12 @@ export default wrap(async (req, res) => {const parsed = bodySchema.safeParse(body);if (!parsed.success) {- return error(res, 400, 'validation_error', parsed.error.issues[0]?.message || 'validation error');+ return error(+ res,+ 400,+ 'validation_error',+ parsed.error.issues[0]?.message || 'validation error',+ );}const { skill, amount, currency_mint, chain } = parsed.data;diff --git a/api/agent-skills.js b/api/agent-skills.jsindex 09bb9968b..481370137 100644--- a/api/agent-skills.js+++ b/api/agent-skills.js@@ -6,6 +6,7 @@import { sql } from './_lib/db.js';import { authenticateBearer, extractBearer, getSessionUser } from './_lib/auth.js';import { cors, error, json, method, readJson, wrap, rateLimited } from './_lib/http.js';+import { requireCsrf } from './_lib/csrf.js';import { clientIp, limits } from './_lib/rate-limit.js';import { z } from 'zod';@@ -19,7 +20,7 @@ const setPriceSchema = z.object({export default wrap(async (req, res) => {const url = new URL(req.url, 'http://x');const agentId = url.searchParams.get('agentId') || url.pathname.split('/').filter(Boolean)[2];- const action = url.searchParams.get('action') || url.pathname.split('/').filter(Boolean)[4];+ const action = url.searchParams.get('action') || url.pathname.split('/').filter(Boolean)[4];if (action === 'set-price') return handleSetPrice(req, res, agentId);@@ -32,6 +33,8 @@ async function handleSetPrice(req, res, agentId) {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ // Cookie-session mutation — CSRF required (bearer callers exempt inside requireCsrf).+ if (!(await requireCsrf(req, res, auth.userId))) return;const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);@@ -50,7 +53,12 @@ async function handleSetPrice(req, res, agentId) {const parsed = setPriceSchema.safeParse(body);if (!parsed.success) {- return error(res, 400, 'validation_error', parsed.error.issues[0]?.message || 'validation error');+ return error(+ res,+ 400,+ 'validation_error',+ parsed.error.issues[0]?.message || 'validation error',+ );}const { skill, amount, currency_mint, chain } = parsed.data;diff --git a/api/agent-strategy.js b/api/agent-strategy.jsindex 02022438a..fccda32a0 100644--- a/api/agent-strategy.js+++ b/api/agent-strategy.js@@ -10,6 +10,7 @@import { sql } from './_lib/db.js';import { authenticateBearer, extractBearer, getSessionUser } from './_lib/auth.js';import { cors, error, json, method, readJson, wrap, rateLimited } from './_lib/http.js';+import { requireCsrf } from './_lib/csrf.js';import { clientIp, limits } from './_lib/rate-limit.js';async function resolveAuth(req) {@@ -48,7 +49,10 @@ export default wrap(async (req, res) => {return json(res, 200, { data: { strategy } });}- // POST / PUT — replace+ // POST / PUT — replace. Cookie-session mutations need a CSRF token (bearer+ // callers are exempt inside requireCsrf).+ if (!(await requireCsrf(req, res, auth.userId))) return;+const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);diff --git a/api/agent-trade/demo.js b/api/agent-trade/demo.jsindex d6c86540e..b88ad070e 100644--- a/api/agent-trade/demo.js+++ b/api/agent-trade/demo.js@@ -47,7 +47,9 @@ function tradeEnv() {const buyer = loadWallet('AGENT_BUYER_SECRET');const seller = loadWallet('AGENT_SELLER_SECRET');const network =- (process.env.AGENT_TRADE_NETWORK || 'mainnet').toLowerCase() === 'devnet' ? 'devnet' : 'mainnet';+ (process.env.AGENT_TRADE_NETWORK || 'mainnet').toLowerCase() === 'devnet'+ ? 'devnet'+ : 'mainnet';const rpcUrl =network === 'devnet'? process.env.SOLANA_RPC_URL_DEVNET || 'https://api.devnet.solana.com'@@ -69,7 +71,11 @@ async function generateAnalysis(topic) {content: `Provide a concise 2–3 sentence crypto market insight on: ${topic}. Be specific, data-driven, and actionable.`,},];- const { text } = await watsonxChatComplete(wx, { messages, maxTokens: 200, temperature: 0.7 });+ const { text } = await watsonxChatComplete(wx, {+ messages,+ maxTokens: 200,+ temperature: 0.7,+ });return {content: text?.trim() || '',model: wx.chatModel || 'ibm/granite-3-8b-instruct',@@ -193,7 +199,9 @@ export default wrap(async (req, res) => {// Bail early if buyer can't cover the trade + fees.if (buyerBal.lamports < env.priceLamports + FEE_BUFFER_LAMPORTS) {- const needed = ((env.priceLamports + FEE_BUFFER_LAMPORTS) / LAMPORTS_PER_SOL).toFixed(5);+ const needed = ((env.priceLamports + FEE_BUFFER_LAMPORTS) / LAMPORTS_PER_SOL).toFixed(+ 5,+ );emit('error', {code: 'insufficient_funds',message: `Nexus has ${buyerBal.sol.toFixed(5)} SOL — needs ~${needed} SOL. Fund: ${env.buyer.address}`,@@ -233,6 +241,24 @@ export default wrap(async (req, res) => {await sleep(1100);+ // Global daily spend ceiling, keyed by the demo wallet itself (not the+ // caller), so IP rotation can't drain it. Reuses the critical+ // avatarPayoutDaily bucket: 50 payouts per wallet per day, fail-closed+ // in prod without Redis. Consumed only when a payment is about to fire.+ const dailyBudget = await limits.avatarPayoutDaily(env.buyer.address);+ if (!dailyBudget.success) {+ emit('error', {+ code: 'daily_budget_exhausted',+ message: 'The demo wallet has reached its daily spend limit. Try again tomorrow.',+ retryAfterSec: Math.max(+ 1,+ Math.ceil(((dailyBudget.reset ?? Date.now()) - Date.now()) / 1000),+ ),+ });+ res.end();+ return;+ }+// ── Step 4: Nexus pays ────────────────────────────────────────────emit('paying', {from: env.buyer.address,@@ -259,7 +285,9 @@ export default wrap(async (req, res) => {// ── Step 5: Confirmed on-chain ────────────────────────────────────const explorer = explorerTxUrl(signature, env.network);- const newBuyerBal = await getSolBalance(connection, env.buyer.address).catch(() => buyerBal);+ const newBuyerBal = await getSolBalance(connection, env.buyer.address).catch(+ () => buyerBal,+ );emit('confirmed', {signature,diff --git a/api/agent-trade/skill.js b/api/agent-trade/skill.jsindex ad30af14a..bc7d3e09d 100644--- a/api/agent-trade/skill.js+++ b/api/agent-trade/skill.js@@ -9,22 +9,26 @@//// Independently callable by any agent — not coupled to the demo orchestrator.-import {- loadAvatarKeypair,- getConnection,- LAMPORTS_PER_SOL,-} from '../_lib/avatar-wallet.js';+import { loadAvatarKeypair, getConnection, LAMPORTS_PER_SOL } from '../_lib/avatar-wallet.js';import { watsonxConfig, watsonxChatComplete } from '../_lib/watsonx.js';import { cors, method, json, error, wrap, rateLimited } from '../_lib/http.js';import { limits, clientIp } from '../_lib/rate-limit.js';+import { cacheGet, cacheSet, cacheDel } from '../_lib/cache.js';const DEFAULT_PRICE_SOL = 0.001;const MAX_PAYMENT_AGE_SEC = 300; // 5 minutes+// Consumed-signature ledger: one verified tx signature buys exactly one call.+// TTL is 3× the freshness window, so a signature is remembered for the entire+// period during which verifyPayment would still accept it (and then some).+const SIG_CONSUMED_TTL_SEC = 900; // 15 minutes+const sigConsumedKey = (sig) => `x402-skill-sig:${sig}`;function skillConfig() {const sellerSecret = process.env.AGENT_SELLER_SECRET || '';const network =- (process.env.AGENT_TRADE_NETWORK || 'mainnet').toLowerCase() === 'devnet' ? 'devnet' : 'mainnet';+ (process.env.AGENT_TRADE_NETWORK || 'mainnet').toLowerCase() === 'devnet'+ ? 'devnet'+ : 'mainnet';const rpcUrl =network === 'devnet'? process.env.SOLANA_RPC_URL_DEVNET || 'https://api.devnet.solana.com'@@ -68,7 +72,9 @@ async function verifyPayment(connection, sig, { sellerAddress, priceLamports, buconst age = Date.now() / 1000 - (tx.blockTime || 0);if (age > MAX_PAYMENT_AGE_SEC) {- throw Object.assign(new Error('payment expired (>5 min old)'), { code: 'payment_expired' });+ throw Object.assign(new Error('payment expired (>5 min old)'), {+ code: 'payment_expired',+ });}const keys = (@@ -79,12 +85,16 @@ async function verifyPayment(connection, sig, { sellerAddress, priceLamports, buconst sellerIdx = keys.indexOf(sellerAddress);if (sellerIdx === -1) {- throw Object.assign(new Error('seller address not in transaction'), { code: 'bad_payment' });+ throw Object.assign(new Error('seller address not in transaction'), {+ code: 'bad_payment',+ });}if (buyerAddress) {const buyerIdx = keys.indexOf(buyerAddress);if (buyerIdx === -1) {- throw Object.assign(new Error('buyer address not in transaction'), { code: 'bad_payment' });+ throw Object.assign(new Error('buyer address not in transaction'), {+ code: 'bad_payment',+ });}}@@ -101,7 +111,9 @@ async function verifyPayment(connection, sig, { sellerAddress, priceLamports, bureturn { verified: true, lamports: sellerGain, blockTime: tx.blockTime };}throw Object.assign(- new Error(lastErr ? `RPC error: ${lastErr.message}` : 'transaction not found after 3 attempts'),+ new Error(+ lastErr ? `RPC error: ${lastErr.message}` : 'transaction not found after 3 attempts',+ ),{ code: 'tx_not_found' },);}@@ -115,7 +127,11 @@ async function generateAnalysis(topic) {content: `Provide a concise 2–3 sentence crypto market insight on: ${topic}. Be specific, data-driven, and actionable.`,},];- const { text } = await watsonxChatComplete(wx, { messages, maxTokens: 200, temperature: 0.7 });+ const { text } = await watsonxChatComplete(wx, {+ messages,+ maxTokens: 200,+ temperature: 0.7,+ });return {content: text?.trim() || '',model: wx.chatModel || 'ibm/granite-3-8b-instruct',@@ -161,7 +177,12 @@ export default wrap(async (req, res) => {const cfg = skillConfig();if (!cfg.configured) {- return error(res, 503, 'not_configured', 'AGENT_SELLER_SECRET is not configured on this deployment.');+ return error(+ res,+ 503,+ 'not_configured',+ 'AGENT_SELLER_SECRET is not configured on this deployment.',+ );}const url = new URL(req.url, 'http://x');@@ -188,6 +209,13 @@ export default wrap(async (req, res) => {return;}+ // Replay check first — a consumed signature never buys a second call, and+ // rejecting before verification saves the RPC round-trips.+ const consumedKey = sigConsumedKey(sig);+ if (await cacheGet(consumedKey)) {+ return error(res, 402, 'payment_replayed', 'this payment signature has already been used');+ }+// Has sig → verify on-chain then analyzeconst connection = getConnection(cfg.rpcUrl);let payment;@@ -201,10 +229,21 @@ export default wrap(async (req, res) => {return error(res, 402, e.code || 'bad_payment', e.message);}+ // Mark the signature consumed BEFORE running the paid work so a concurrent+ // duplicate request can't double-spend it.+ await cacheSet(+ consumedKey,+ { usedAt: Date.now(), buyer: buyerAddress || null, lamports: payment.lamports },+ SIG_CONSUMED_TTL_SEC,+ );+let analysis;try {analysis = await generateAnalysis(topic);} catch (e) {+ // The buyer paid but got nothing — release the signature so a retry+ // within the freshness window isn't treated as a replay.+ await cacheDel(consumedKey).catch(() => {});return error(res, 502, 'analysis_failed', e.message);}diff --git a/api/agents.js b/api/agents.jsindex 63b004e7d..bd86e4d4a 100644--- a/api/agents.js+++ b/api/agents.js@@ -202,6 +202,11 @@ async function handleGetOrCreateMe(req, res, auth) {async function handleCreate(req, res) {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in or provide a bearer token');+ // Creation mints real wallets — same CSRF gate as PUT/PATCH/DELETE (bearer+ // callers are exempt inside requireCsrf) plus a per-IP rate limit.+ if (!(await requireCsrf(req, res, auth.userId))) return;+ const rl = await limits.authIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);const scopeErr = requireScopeForMutation(auth, res, 'avatars:write');if (scopeErr) return scopeErr;@@ -215,7 +220,8 @@ async function handleCreate(req, res) {let avatarId = null;if (body.avatar_id) {const raw = String(body.avatar_id);- if (!UUID_RE.test(raw)) return error(res, 400, 'validation_error', 'avatar_id must be a UUID');+ if (!UUID_RE.test(raw))+ return error(res, 400, 'validation_error', 'avatar_id must be a UUID');const [av] = await sql`SELECT id FROM avatarsWHERE id = ${raw} AND owner_id = ${auth.userId} AND deleted_at IS NULL@@ -264,7 +270,9 @@ async function handleCreate(req, res) {status: integrity.status,uniqueness: integrity.uniqueness,guardian: integrity.guardian ? integrity.guardian.decision : null,- closest: integrity.similar[0] ? { name: integrity.similar[0].name, score: integrity.similar[0].score } : null,+ closest: integrity.similar[0]+ ? { name: integrity.similar[0].name, score: integrity.similar[0].score }+ : null,checked_at: new Date().toISOString(),};}@@ -357,7 +365,10 @@ export async function handleGetOne(req, res, id) {`;row.chat_count = chatRow?.total ?? 0;} catch (err) {- console.warn('[agents] chat_count usage_events query failed, defaulting to 0:', err?.message);+ console.warn(+ '[agents] chat_count usage_events query failed, defaulting to 0:',+ err?.message,+ );row.chat_count = 0;}@@ -396,19 +407,39 @@ async function handleUpdate(req, res, id, auth) {const scopeErr = requireScopeForMutation(auth, res, 'avatars:write');if (scopeErr) return scopeErr;const [existing] = await sql`- SELECT id, user_id FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL+ SELECT id, user_id, meta FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL`;if (!existing) return error(res, 404, 'not_found', 'agent not found');if (existing.user_id !== auth.userId) return error(res, 403, 'forbidden', 'not your agent');const body = await readJson(req);++ // Server-side meta merge. GET strips encrypted_wallet_key /+ // encrypted_solana_secret before returning meta, so a client read-modify-write+ // must never be able to wipe (or set) them: merge the client's meta over the+ // stored row and always carry the stored encrypted_* keys through unchanged.+ let mergedMeta = null;+ if (body.meta && typeof body.meta === 'object' && !Array.isArray(body.meta)) {+ const existingMeta = existing.meta || {};+ const clientMeta = { ...body.meta };+ delete clientMeta.encrypted_wallet_key;+ delete clientMeta.encrypted_solana_secret;+ mergedMeta = { ...existingMeta, ...clientMeta };+ if ('encrypted_wallet_key' in existingMeta) {+ mergedMeta.encrypted_wallet_key = existingMeta.encrypted_wallet_key;+ }+ if ('encrypted_solana_secret' in existingMeta) {+ mergedMeta.encrypted_solana_secret = existingMeta.encrypted_solana_secret;+ }+ }+const [updated] = await sql`UPDATE agent_identities SETname = COALESCE(${body.name || null}, name),description = COALESCE(${body.description || null}, description),avatar_id = COALESCE(${body.avatar_id || null}, avatar_id),skills = COALESCE(${body.skills || null}, skills),- meta = COALESCE(${body.meta ? JSON.stringify(body.meta) : null}::jsonb, meta),+ meta = COALESCE(${mergedMeta ? JSON.stringify(mergedMeta) : null}::jsonb, meta),home_url = COALESCE(${body.home_url || null}, home_url)WHERE id = ${id}RETURNING *@@ -473,7 +504,20 @@ export async function handleWallet(req, res, id) {const address = String(body.wallet_address || '').trim();const chainId = Number(body.chain_id) || null;// Optional: post-mint, the client can patch in the minted ERC-8004 agent id.- const erc8004 = body.erc8004_agent_id != null ? BigInt(body.erc8004_agent_id).toString() : null;+ // Validate before BigInt() — a malformed value would otherwise throw a 500.+ let erc8004 = null;+ if (body.erc8004_agent_id != null) {+ const rawId = String(body.erc8004_agent_id).trim();+ if (!/^\d+$/.test(rawId)) {+ return error(+ res,+ 400,+ 'validation_error',+ 'erc8004_agent_id must be a non-negative integer',+ );+ }+ erc8004 = BigInt(rawId).toString();+ }if (!address) return error(res, 400, 'validation_error', 'wallet_address required');const [updated] = await sql`@@ -499,8 +543,9 @@ async function healStaleAvatarId(row) {if (!av) {const staleId = row.avatar_id;row.avatar_id = null;- sql`UPDATE agent_identities SET avatar_id = NULL WHERE id = ${row.id} AND avatar_id = ${staleId}`- .catch((e) => console.error('[agents] healStaleAvatarId failed', e));+ sql`UPDATE agent_identities SET avatar_id = NULL WHERE id = ${row.id} AND avatar_id = ${staleId}`.catch(+ (e) => console.error('[agents] healStaleAvatarId failed', e),+ );}}@@ -547,15 +592,15 @@ function decorate(row, isOwner = true) {: null;const avatarVisibility = row.avatar_visibility || null;- const avatarPubliclyReadable =- avatarVisibility === 'public' || avatarVisibility === 'unlisted';+ const avatarPubliclyReadable = avatarVisibility === 'public' || avatarVisibility === 'unlisted';const avatarModelUrl =- row.avatar_storage_key && avatarPubliclyReadable- ? publicUrl(row.avatar_storage_key)+ row.avatar_storage_key && avatarPubliclyReadable ? publicUrl(row.avatar_storage_key) : null;+ // Thumbnails get the same public/unlisted gate as model URLs (mirrors+ // characters.js / galaxy.js) — private avatars must not leak via thumbnails.+ const avatarThumbnailUrl =+ row.avatar_thumbnail_key && avatarPubliclyReadable+ ? publicUrl(row.avatar_thumbnail_key): null;- const avatarThumbnailUrl = row.avatar_thumbnail_key- ? publicUrl(row.avatar_thumbnail_key)- : null;const base = {id: row.id,diff --git a/api/agents/[id]/memory-seed-x.js b/api/agents/[id]/memory-seed-x.jsindex 344b47c32..2c28464bf 100644--- a/api/agents/[id]/memory-seed-x.js+++ b/api/agents/[id]/memory-seed-x.js@@ -17,9 +17,9 @@ import { decryptToken, encryptToken } from '../../auth/x/[action].js';async function refreshXToken(conn) {if (!conn.refresh_token) throw Object.assign(new Error('no refresh token'), { status: 400 });const decRefresh = decryptToken(conn.refresh_token);- const creds = Buffer.from(- `${env.X_OAUTH_CLIENT_ID}:${env.X_OAUTH_CLIENT_SECRET}`,- ).toString('base64');+ const creds = Buffer.from(`${env.X_OAUTH_CLIENT_ID}:${env.X_OAUTH_CLIENT_SECRET}`).toString(+ 'base64',+ );const res = await fetch('https://api.twitter.com/2/oauth2/token', {method: 'POST',headers: {@@ -39,7 +39,9 @@ async function refreshXToken(conn) {const tokens = await res.json();const expiresAt = new Date(Date.now() + (tokens.expires_in ?? 7200) * 1000).toISOString();const encAccess = encryptToken(tokens.access_token);- const encRefresh = tokens.refresh_token ? encryptToken(tokens.refresh_token) : conn.refresh_token;+ const encRefresh = tokens.refresh_token+ ? encryptToken(tokens.refresh_token)+ : conn.refresh_token;await sql`UPDATE social_connectionsSET access_token = ${encAccess},@@ -76,7 +78,10 @@ async function distilFacts(profile, tweets) {});try {- const stripped = raw.replace(/^```(?:json)?\s*/i, '').replace(/\s*```$/i, '').trim();+ const stripped = raw+ .replace(/^```(?:json)?\s*/i, '')+ .replace(/\s*```$/i, '')+ .trim();const facts = JSON.parse(stripped);return Array.isArray(facts) ? facts.filter((f) => typeof f === 'string').slice(0, 15) : [];} catch {@@ -123,15 +128,17 @@ async function handlePost(req, res, agentId) {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');- const rl = await limits.xSeed(agentId);- if (!rl.success) return rateLimited(res, rl, 'agent can only be re-seeded every 6 hours');-const [agent] = await sql`SELECT id, user_id FROM agent_identities WHERE id = ${agentId} AND deleted_at IS NULL`;if (!agent) return error(res, 404, 'not_found', 'agent not found');if (agent.user_id !== user.id) return error(res, 403, 'forbidden', 'not your agent');+ // Consume the per-agent seed budget only AFTER ownership is proven —+ // otherwise any signed-in user could burn another agent's 6-hour window.+ const rl = await limits.xSeed(agentId);+ if (!rl.success) return rateLimited(res, rl, 'agent can only be re-seeded every 6 hours');+const [conn] = await sql`SELECT id, username, access_token, refresh_token, expires_at FROM social_connectionsWHERE user_id = ${user.id} AND provider = 'x'diff --git a/api/agents/[id]/skill-prices.js b/api/agents/[id]/skill-prices.jsindex 02b2d83b6..230efe4fc 100644--- a/api/agents/[id]/skill-prices.js+++ b/api/agents/[id]/skill-prices.js@@ -12,6 +12,7 @@ import { sql } from '../../_lib/db.js';import { authenticateBearer, extractBearer, getSessionUser } from '../../_lib/auth.js';import { cors, error, json, method, readJson, wrap, rateLimited } from '../../_lib/http.js';import { clientIp, limits } from '../../_lib/rate-limit.js';+import { requireCsrf } from '../../_lib/csrf.js';import { z } from 'zod';const upsertSchema = z.object({@@ -45,6 +46,9 @@ export default wrap(async (req, res) => {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt.+ if (!(await requireCsrf(req, res, auth.userId))) return;+const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);@@ -66,7 +70,12 @@ export default wrap(async (req, res) => {if (req.method === 'POST') {const parsed = upsertSchema.safeParse(body);if (!parsed.success) {- return error(res, 400, 'validation_error', parsed.error.issues[0]?.message || 'invalid');+ return error(+ res,+ 400,+ 'validation_error',+ parsed.error.issues[0]?.message || 'invalid',+ );}const { skill, amount, currency_mint, chain } = parsed.data;await sql`@@ -85,7 +94,12 @@ export default wrap(async (req, res) => {if (req.method === 'PUT') {const parsed = updateSchema.safeParse(body);if (!parsed.success) {- return error(res, 400, 'validation_error', parsed.error.issues[0]?.message || 'invalid');+ return error(+ res,+ 400,+ 'validation_error',+ parsed.error.issues[0]?.message || 'invalid',+ );}const { skill, amount } = parsed.data;const r = await sql`diff --git a/api/agents/[id]/skills-pricing.js b/api/agents/[id]/skills-pricing.jsindex c79591ee4..5b997cb7f 100644--- a/api/agents/[id]/skills-pricing.js+++ b/api/agents/[id]/skills-pricing.js@@ -1,6 +1,7 @@import { sql } from '../../_lib/db.js';import { getSessionUser, authenticateBearer, extractBearer } from '../../_lib/auth.js';import { cors, json, method, readJson, wrap, error } from '../../_lib/http.js';+import { requireCsrf } from '../../_lib/csrf.js';import { z } from 'zod';const priceSchema = z.object({@@ -27,6 +28,9 @@ export default wrap(async (req, res) => {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt.+ if (req.method === 'PUT' && !(await requireCsrf(req, res, auth.userId))) return;+const [agent] = await sql`SELECT id, user_id FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL`;diff --git a/api/agents/_id/_sub.js b/api/agents/_id/_sub.jsindex ca7dce83f..daafe2fc6 100644--- a/api/agents/_id/_sub.js+++ b/api/agents/_id/_sub.js@@ -8,6 +8,7 @@ import { sql } from '../../_lib/db.js';import { getSessionUser, authenticateBearer, extractBearer } from '../../_lib/auth.js';import { cors, json, method, readJson, wrap, error, rateLimited } from '../../_lib/http.js';import { limits, clientIp } from '../../_lib/rate-limit.js';+import { requireCsrf } from '../../_lib/csrf.js';import { parse } from '../../_lib/validate.js';import { recoverAgentKey } from '../../_lib/agent-wallet.js';import { readEmbedPolicy, validateEmbedPolicy } from '../../_lib/embed-policy.js';@@ -33,9 +34,11 @@ export const handleActions = wrap(async (req, res, id) => {const bearer = session ? null : await authenticateBearer(extractBearer(req));const userId = session?.id ?? bearer?.userId;- const [agent] = await sql`SELECT id, user_id, name, wallet_address FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL`;+ const [agent] =+ await sql`SELECT id, user_id, name, wallet_address FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL`;if (!agent) return error(res, 404, 'not_found', 'agent not found');- if (!userId || agent.user_id !== userId) return error(res, 403, 'forbidden', 'not authorized to view this agent');+ if (!userId || agent.user_id !== userId)+ return error(res, 403, 'forbidden', 'not authorized to view this agent');const url = new URL(req.url, 'http://x');const limit = Math.min(Number(url.searchParams.get('limit')) || 50, 200);@@ -96,11 +99,25 @@ export const handleActions = wrap(async (req, res, id) => {let verified = null;if (row.signature && row.signer_address && row.payload) {try {- const recovered = verifyMessage(JSON.stringify(row.payload) + row.created_at.toISOString(), row.signature);+ const recovered = verifyMessage(+ JSON.stringify(row.payload) + row.created_at.toISOString(),+ row.signature,+ );verified = recovered.toLowerCase() === row.signer_address.toLowerCase();- } catch { verified = false; }+ } catch {+ verified = false;+ }}- return { id: String(row.id), type: row.type, payload: row.payload, sourceSkill: row.source_skill, timestamp: row.created_at.toISOString(), signature: row.signature || null, signer: row.signer_address || null, verified };+ return {+ id: String(row.id),+ type: row.type,+ payload: row.payload,+ sourceSkill: row.source_skill,+ timestamp: row.created_at.toISOString(),+ signature: row.signature || null,+ signer: row.signer_address || null,+ verified,+ };});res.setHeader('Cache-Control', 'private, max-age=10');@@ -115,7 +132,15 @@ export const handleActions = wrap(async (req, res, id) => {const animationEntrySchema = z.object({name: z.string().trim().min(1).max(60),- url: z.string().trim().min(1).max(2048).refine((u) => /^(https?|ipfs|ar):\/\//.test(u) || u.startsWith('/') || /^u\//.test(u), 'url must be http, https, ipfs, ar, root-relative, or storage key'),+ url: z+ .string()+ .trim()+ .min(1)+ .max(2048)+ .refine(+ (u) => /^(https?|ipfs|ar):\/\//.test(u) || u.startsWith('/') || /^u\//.test(u),+ 'url must be http, https, ipfs, ar, root-relative, or storage key',+ ),loop: z.boolean().default(true),clipName: z.string().trim().max(120).optional(),source: z.enum(['mixamo', 'preset', 'custom']),@@ -125,19 +150,23 @@ const animationEntrySchema = z.object({// Animation state machine — optional graph stored alongside the flat clip// list. The runtime AnimationStateMachine fills in defaults for any state// not explicitly mapped here; the editor only persists overrides.-const animationStateSchema = z.object({- clip: z.string().trim().min(1).max(60).optional(),- loop: z.boolean().optional(),- crossfade: z.number().min(0).max(5).optional(),- oneShot: z.boolean().optional(),- returnTo: z.string().trim().min(1).max(40).nullable().optional(),-}).strict();--const animationGraphSchema = z.object({- states: z.record(animationStateSchema).optional(),- transitions: z.record(z.string().trim().min(1).max(40)).optional(),- initial: z.string().trim().min(1).max(40).optional(),-}).strict();+const animationStateSchema = z+ .object({+ clip: z.string().trim().min(1).max(60).optional(),+ loop: z.boolean().optional(),+ crossfade: z.number().min(0).max(5).optional(),+ oneShot: z.boolean().optional(),+ returnTo: z.string().trim().min(1).max(40).nullable().optional(),+ })+ .strict();++const animationGraphSchema = z+ .object({+ states: z.record(animationStateSchema).optional(),+ transitions: z.record(z.string().trim().min(1).max(40)).optional(),+ initial: z.string().trim().min(1).max(40).optional(),+ })+ .strict();const animationsBodySchema = z.object({animations: z.array(animationEntrySchema).max(30),@@ -151,14 +180,25 @@ export const handleAnimations = wrap(async (req, res, id) => {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');- const [existing] = await sql`SELECT id, user_id FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL`;+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt.+ if (!(await requireCsrf(req, res, auth.userId))) return;++ const [existing] =+ await sql`SELECT id, user_id FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL`;if (!existing) return error(res, 404, 'not_found', 'agent not found');if (existing.user_id !== auth.userId) return error(res, 403, 'forbidden', 'not your agent');const rawBody = await readJson(req);let parsed;- try { parsed = animationsBodySchema.parse(rawBody); }- catch (err) { if (err.name === 'ZodError') return error(res, 400, 'validation_error', err.errors[0]?.message || 'invalid body', { fields: err.errors }); throw err; }+ try {+ parsed = animationsBodySchema.parse(rawBody);+ } catch (err) {+ if (err.name === 'ZodError')+ return error(res, 400, 'validation_error', err.errors[0]?.message || 'invalid body', {+ fields: err.errors,+ });+ throw err;+ }// Only touch meta.animationGraph when the request actually carries the// field, so saving the clip-array on its own doesn't clobber an existing@@ -184,7 +224,8 @@ export const handleAnimations = wrap(async (req, res, id) => {}// Read back the persisted graph so the response reflects what's actually stored.- const [row] = await sql`SELECT meta->'animationGraph' AS graph FROM agent_identities WHERE id = ${id}`;+ const [row] =+ await sql`SELECT meta->'animationGraph' AS graph FROM agent_identities WHERE id = ${id}`;return json(res, 200, {animations: parsed.animations,animationGraph: row?.graph ?? null,@@ -208,7 +249,11 @@ export const handleEmbedPolicy = wrap(async (req, res, id) => {const session = await getSessionUser(req);if (!session) return error(res, 401, 'unauthorized', 'sign in required');- const [existing] = await sql`SELECT id, user_id FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL`;+ // CSRF on state-changing session-cookie requests (PUT/DELETE reach here).+ if (!(await requireCsrf(req, res, session.id))) return;++ const [existing] =+ await sql`SELECT id, user_id FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL`;if (!existing) return error(res, 404, 'not_found', 'agent not found');if (existing.user_id !== session.id) return error(res, 403, 'forbidden', 'not your agent');@@ -218,10 +263,18 @@ export const handleEmbedPolicy = wrap(async (req, res, id) => {}let normalized;- try { normalized = validateEmbedPolicy(await readJson(req)); }- catch (err) { if (err.name === 'ZodError') return error(res, 400, 'validation_error', err.errors[0]?.message || 'invalid policy', { fields: err.errors }); throw err; }+ try {+ normalized = validateEmbedPolicy(await readJson(req));+ } catch (err) {+ if (err.name === 'ZodError')+ return error(res, 400, 'validation_error', err.errors[0]?.message || 'invalid policy', {+ fields: err.errors,+ });+ throw err;+ }- const [updated] = await sql`UPDATE agent_identities SET embed_policy = ${JSON.stringify(normalized)}::jsonb WHERE id = ${id} RETURNING embed_policy`;+ const [updated] =+ await sql`UPDATE agent_identities SET embed_policy = ${JSON.stringify(normalized)}::jsonb WHERE id = ${id} RETURNING embed_policy`;return json(res, 200, { policy: updated.embed_policy });});@@ -231,14 +284,22 @@ export const handleManifest = wrap(async (req, res, id) => {if (cors(req, res, { methods: 'GET,OPTIONS', credentials: false })) return;if (!method(req, res, ['GET'])) return;- if (!/^[0-9a-f-]{36}$/i.test(id)) return error(res, 400, 'invalid_request', 'agent id required');+ if (!/^[0-9a-f-]{36}$/i.test(id))+ return error(res, 400, 'invalid_request', 'agent id required');- const [row] = await sql`select a.id, a.name, a.description, a.avatar_id, a.skills, a.meta, a.chain_id, a.erc8004_agent_id, a.erc8004_registry, a.registration_cid, a.created_at, a.voice_provider, a.voice_id, a.persona_prompt_hash, a.persona_tone_tags, a.persona_extracted_at, av.id as avatar_db_id, av.storage_key, av.content_type from agent_identities a left join avatars av on av.id = a.avatar_id and av.deleted_at is null where a.id = ${id} and a.deleted_at is null limit 1`;+ const [row] =+ await sql`select a.id, a.name, a.description, a.avatar_id, a.skills, a.meta, a.chain_id, a.erc8004_agent_id, a.erc8004_registry, a.registration_cid, a.created_at, a.voice_provider, a.voice_id, a.persona_prompt_hash, a.persona_tone_tags, a.persona_extracted_at, av.id as avatar_db_id, av.storage_key, av.content_type from agent_identities a left join avatars av on av.id = a.avatar_id and av.deleted_at is null where a.id = ${id} and a.deleted_at is null limit 1`;if (!row) return error(res, 404, 'not_found', 'agent not found');let bodyUri = '';if (row.avatar_db_id) {- try { const urlInfo = await resolveAvatarUrl({ storage_key: row.storage_key, visibility: 'public' }); bodyUri = urlInfo?.url || ''; } catch {}+ try {+ const urlInfo = await resolveAvatarUrl({+ storage_key: row.storage_key,+ visibility: 'public',+ });+ bodyUri = urlInfo?.url || '';+ } catch {}}const proto = req.headers['x-forwarded-proto'] || 'https';@@ -256,7 +317,15 @@ export const handleManifest = wrap(async (req, res, id) => {body: bodyUri ? { uri: bodyUri, format: row.content_type || 'gltf-binary' } : undefined,skills: Array.isArray(row.skills) ? row.skills : [],homeUrl: `${origin}/agent/${row.id}`,- registrations: row.chain_id && row.erc8004_agent_id ? [{ agentRegistry: `eip155:${row.chain_id}:${row.erc8004_registry}`, agentId: row.erc8004_agent_id }] : [],+ registrations:+ row.chain_id && row.erc8004_agent_id+ ? [+ {+ agentRegistry: `eip155:${row.chain_id}:${row.erc8004_registry}`,+ agentId: row.erc8004_agent_id,+ },+ ]+ : [],voice: row.voice_id? { provider: row.voice_provider || 'elevenlabs', voice_id: row.voice_id }: { provider: 'browser' },@@ -268,7 +337,10 @@ export const handleManifest = wrap(async (req, res, id) => {createdAt: row.created_at,};- return json(res, 200, manifest, { 'cache-control': 'public, max-age=60, s-maxage=300, stale-while-revalidate=86400', 'access-control-allow-origin': '*' });+ return json(res, 200, manifest, {+ 'cache-control': 'public, max-age=60, s-maxage=300, stale-while-revalidate=86400',+ 'access-control-allow-origin': '*',+ });});// ── registration (Metaplex / EIP-8004 agent registry document) ─────────────────@@ -282,14 +354,22 @@ export const handleRegistration = wrap(async (req, res, id) => {if (cors(req, res, { methods: 'GET,OPTIONS', credentials: false })) return;if (!method(req, res, ['GET'])) return;- if (!/^[0-9a-f-]{36}$/i.test(id)) return error(res, 400, 'invalid_request', 'agent id required');+ if (!/^[0-9a-f-]{36}$/i.test(id))+ return error(res, 400, 'invalid_request', 'agent id required');- const [row] = await sql`select a.id, a.name, a.description, a.skills, a.deleted_at, a.chain_id, a.erc8004_agent_id, a.erc8004_registry, av.id as avatar_db_id, av.storage_key, av.thumbnail_key, av.content_type from agent_identities a left join avatars av on av.id = a.avatar_id and av.deleted_at is null where a.id = ${id} and a.deleted_at is null limit 1`;+ const [row] =+ await sql`select a.id, a.name, a.description, a.skills, a.deleted_at, a.chain_id, a.erc8004_agent_id, a.erc8004_registry, av.id as avatar_db_id, av.storage_key, av.thumbnail_key, av.content_type from agent_identities a left join avatars av on av.id = a.avatar_id and av.deleted_at is null where a.id = ${id} and a.deleted_at is null limit 1`;if (!row) return error(res, 404, 'not_found', 'agent not found');let modelUri = '';if (row.avatar_db_id) {- try { const u = await resolveAvatarUrl({ storage_key: row.storage_key, visibility: 'public' }); modelUri = u?.url || ''; } catch {}+ try {+ const u = await resolveAvatarUrl({+ storage_key: row.storage_key,+ visibility: 'public',+ });+ modelUri = u?.url || '';+ } catch {}}const image = row.thumbnail_key ? r2PublicUrl(row.thumbnail_key) : '';@@ -307,17 +387,28 @@ export const handleRegistration = wrap(async (req, res, id) => {agentUrl: `${origin}/agent/${row.id}`,origin,skills: Array.isArray(row.skills) ? row.skills : [],- erc8004: row.chain_id && row.erc8004_agent_id- ? { chainId: row.chain_id, agentId: row.erc8004_agent_id, registry: row.erc8004_registry }- : null,+ erc8004:+ row.chain_id && row.erc8004_agent_id+ ? {+ chainId: row.chain_id,+ agentId: row.erc8004_agent_id,+ registry: row.erc8004_registry,+ }+ : null,});- return json(res, 200, doc, { 'cache-control': 'public, max-age=60, s-maxage=300, stale-while-revalidate=86400', 'access-control-allow-origin': '*' });+ return json(res, 200, doc, {+ 'cache-control': 'public, max-age=60, s-maxage=300, stale-while-revalidate=86400',+ 'access-control-allow-origin': '*',+ });});// ── sign ──────────────────────────────────────────────────────────────────────-const signBody = z.object({ message: z.string().min(1).max(8192), kind: z.enum(['personal']).default('personal') });+const signBody = z.object({+ message: z.string().min(1).max(8192),+ kind: z.enum(['personal']).default('personal'),+});export const handleSign = wrap(async (req, res, id) => {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;@@ -326,10 +417,14 @@ export const handleSign = wrap(async (req, res, id) => {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt.+ if (!(await requireCsrf(req, res, auth.userId))) return;+const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl, 'too many sign requests');- const [row] = await sql`SELECT id, user_id, wallet_address, meta FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL LIMIT 1`;+ const [row] =+ await sql`SELECT id, user_id, wallet_address, meta FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL LIMIT 1`;if (!row) return error(res, 404, 'not_found', 'agent not found');if (row.user_id !== auth.userId) return error(res, 403, 'forbidden', 'not your agent');@@ -359,16 +454,24 @@ export const handleUsage = wrap(async (req, res, id) => {const session = await getSessionUser(req);if (!session) return error(res, 401, 'unauthorized', 'sign in required');- const [agent] = await sql`SELECT id FROM agent_identities WHERE id = ${id} AND user_id = ${session.id} AND deleted_at IS NULL`;+ const [agent] =+ await sql`SELECT id FROM agent_identities WHERE id = ${id} AND user_id = ${session.id} AND deleted_at IS NULL`;if (!agent) return error(res, 404, 'not_found', 'agent not found');const policy = await readEmbedPolicy(id);const monthlyQuota = policy?.brain?.monthly_quota ?? null;- const [monthRow] = await sql`SELECT COUNT(*)::int AS total FROM usage_events WHERE agent_id = ${id} AND kind = 'llm' AND created_at >= date_trunc('month', now())`;- const dailyRows = await sql`SELECT date_trunc('day', created_at)::date AS day, COUNT(*)::int AS calls FROM usage_events WHERE agent_id = ${id} AND kind = 'llm' AND created_at >= now() - interval '30 days' GROUP BY 1 ORDER BY 1`;+ const [monthRow] =+ await sql`SELECT COUNT(*)::int AS total FROM usage_events WHERE agent_id = ${id} AND kind = 'llm' AND created_at >= date_trunc('month', now())`;+ const dailyRows =+ await sql`SELECT date_trunc('day', created_at)::date AS day, COUNT(*)::int AS calls FROM usage_events WHERE agent_id = ${id} AND kind = 'llm' AND created_at >= now() - interval '30 days' GROUP BY 1 ORDER BY 1`;- return json(res, 200, { agentId: id, monthlyQuota, currentMonthCalls: monthRow?.total ?? 0, dailyBreakdown: dailyRows.map((r) => ({ day: r.day, calls: r.calls })) });+ return json(res, 200, {+ agentId: id,+ monthlyQuota,+ currentMonthCalls: monthRow?.total ?? 0,+ dailyBreakdown: dailyRows.map((r) => ({ day: r.day, calls: r.calls })),+ });});// ── memories ──────────────────────────────────────────────────────────────────@@ -400,7 +503,8 @@ export const handleMemories = wrap(async (req, res, id, memoryId) => {if (req.method === 'GET' && !userId) return json(res, 200, { data: [] });if (!userId) return error(res, 401, 'unauthorized', 'sign in required');- const [agent] = await sql`SELECT id FROM agent_identities WHERE id = ${id} AND user_id = ${userId} AND deleted_at IS NULL`;+ const [agent] =+ await sql`SELECT id FROM agent_identities WHERE id = ${id} AND user_id = ${userId} AND deleted_at IS NULL`;if (!agent) {if (req.method === 'GET') return json(res, 200, { data: [] });return error(res, 404, 'not_found', 'agent not found');diff --git a/api/agents/_id/livekit-token.js b/api/agents/_id/livekit-token.jsindex 07c386fb6..ed64ebc1d 100644--- a/api/agents/_id/livekit-token.js+++ b/api/agents/_id/livekit-token.js@@ -4,6 +4,7 @@// livekit-server-sdk is not a project dependency.import { SignJWT } from 'jose';+import { sql } from '../../_lib/db.js';import { getSessionUser, authenticateBearer, extractBearer } from '../../_lib/auth.js';import { cors, json, method, error } from '../../_lib/http.js';@@ -11,19 +12,38 @@ const LIVEKIT_API_KEY = process.env.LIVEKIT_API_KEY;const LIVEKIT_API_SECRET = process.env.LIVEKIT_API_SECRET;const LIVEKIT_SERVER_URL = process.env.LIVEKIT_SERVER_URL;+const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;+export async function handleLiveKitToken(req, res, agentId) {if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;if (!method(req, res, ['GET'])) return;if (!LIVEKIT_API_KEY || !LIVEKIT_API_SECRET || !LIVEKIT_SERVER_URL) {- return error(res, 503, 'livekit_not_configured', 'LiveKit is not configured on this server');+ return error(+ res,+ 503,+ 'livekit_not_configured',+ 'LiveKit is not configured on this server',+ );}const session = await getSessionUser(req);const bearer = session ? null : await authenticateBearer(extractBearer(req));if (!session && !bearer) return error(res, 401, 'unauthorized', 'sign in required');- const userId = session?.id ?? bearer?.userId ?? 'anon';+ const userId = session?.id ?? bearer.userId;++ if (!UUID_RE.test(String(agentId))) return error(res, 404, 'not_found', 'agent not found');++ // The token grants publish rights in the agent's room — only the agent's+ // owner may mint one, otherwise any signed-in user could broadcast into+ // (and listen to) any other agent's room.+ const [agent] = await sql`+ SELECT id FROM agent_identities+ WHERE id = ${agentId} AND user_id = ${userId} AND deleted_at IS NULL+ `;+ if (!agent) return error(res, 404, 'not_found', 'agent not found');+const roomName = `agent-${agentId}`;const participantId = `user-${userId}`;diff --git a/api/agents/_id/memory-seed-farcaster.js b/api/agents/_id/memory-seed-farcaster.jsindex 9bf4a04c6..3e8c2e10c 100644--- a/api/agents/_id/memory-seed-farcaster.js+++ b/api/agents/_id/memory-seed-farcaster.js@@ -54,7 +54,10 @@ async function distillFacts(profile, casts, apiKey) {});try {- const stripped = raw.replace(/^```(?:json)?\s*/i, '').replace(/\s*```$/i, '').trim();+ const stripped = raw+ .replace(/^```(?:json)?\s*/i, '')+ .replace(/\s*```$/i, '')+ .trim();const facts = JSON.parse(stripped);return Array.isArray(facts) ? facts.filter((f) => typeof f === 'string').slice(0, 15) : [];} catch {@@ -107,8 +110,22 @@ export default wrap(async (req, res) => {if (agent.farcaster_seeded_at) {const elapsed = Date.now() - new Date(agent.farcaster_seeded_at).getTime();- if (elapsed < SEED_COOLDOWN_MS)- return rateLimited(res, rl, 'farcaster seed cooldown: try again in 6 hours');+ if (elapsed < SEED_COOLDOWN_MS) {+ // Plain 429: this is a per-agent cooldown, not the IP limiter above —+ // reusing rateLimited(res, rl) here would emit RateLimit-* headers from+ // a limiter result that actually succeeded, misleading clients.+ const retryAfter = Math.max(1, Math.ceil((SEED_COOLDOWN_MS - elapsed) / 1000));+ res.setHeader('retry-after', String(retryAfter));+ return error(+ res,+ 429,+ 'cooldown_active',+ 'farcaster seed cooldown: try again in 6 hours',+ {+ retry_after: retryAfter,+ },+ );+ }}const body = parse(bodySchema, await readJson(req));@@ -135,10 +152,7 @@ export default wrap(async (req, res) => {// Fetch casts and profile in parallelconst [castsData, profileData] = await Promise.all([- neynarGet(- `/feed/user/casts?fid=${fid}&limit=50&include_replies=false`,- env.NEYNAR_API_KEY,- ),+ neynarGet(`/feed/user/casts?fid=${fid}&limit=50&include_replies=false`, env.NEYNAR_API_KEY),neynarGet(`/user?fid=${fid}`, env.NEYNAR_API_KEY),]);diff --git a/api/agents/_id/memory-seed-x.js b/api/agents/_id/memory-seed-x.jsdeleted file mode 100644index 0d5e53eb5..000000000--- a/api/agents/_id/memory-seed-x.js+++ /dev/null@@ -1,221 +0,0 @@-// POST /api/agents/:id/memory/seed/x-//-// Seeds agent memories from the user's X (Twitter) profile and recent tweets-// using Claude Haiku to distill personality, interests, and communication style.-// Requires: session auth, agent ownership, X social connection via OAuth 2.0.-// Rate-limited to once per 24 hours per agent.-//-// Route wired in vercel.json: /api/agents/:id/memory/seed/x → this file.--import { webcrypto } from 'node:crypto';-import { TwitterApi } from 'twitter-api-v2';-import { sql } from '../../_lib/db.js';-import { getSessionUser, authenticateBearer, extractBearer } from '../../_lib/auth.js';-import { cors, json, method, error, rateLimited } from '../../_lib/http.js';-import { env } from '../../_lib/env.js';-import { llmComplete } from '../../_lib/llm.js';-import { limits } from '../../_lib/rate-limit.js';--const subtle = globalThis.crypto?.subtle || webcrypto.subtle;--// ── Token decryption (mirrors the HKDF derivation in auth/x/[action].js) ─────--async function decryptToken(ciphertext) {- const raw = new TextEncoder().encode(env.JWT_SECRET);- const base = await subtle.importKey('raw', raw, 'HKDF', false, ['deriveKey']);- const key = await subtle.deriveKey(- {- name: 'HKDF',- hash: 'SHA-256',- salt: new TextEncoder().encode('oauth-token'),- info: new Uint8Array(0),- },- base,- { name: 'AES-GCM', length: 256 },- false,- ['decrypt'],- );- const buf = Buffer.from(ciphertext, 'base64');- const iv = buf.subarray(0, 12);- const ct = buf.subarray(12);- const plain = await subtle.decrypt({ name: 'AES-GCM', iv }, key, ct);- return new TextDecoder().decode(plain);-}--// ── X data fetch ──────────────────────────────────────────────────────────────--async function fetchXData(accessToken, userId) {- const client = new TwitterApi(accessToken).readOnly;-- const [userResp, tweetsResp] = await Promise.allSettled([- client.v2.user(userId, {- 'user.fields': [- 'name', 'username', 'description', 'public_metrics',- 'location', 'url', 'entities',- ],- }),- client.v2.userTimeline(userId, {- max_results: 100,- exclude: ['retweets', 'replies'],- 'tweet.fields': ['text', 'public_metrics', 'created_at'],- }),- ]);-- const profile =- userResp.status === 'fulfilled'- ? {- name: userResp.value.data?.name,- username: userResp.value.data?.username,- bio: userResp.value.data?.description,- location: userResp.value.data?.location,- followers: userResp.value.data?.public_metrics?.followers_count,- following: userResp.value.data?.public_metrics?.following_count,- tweet_count: userResp.value.data?.public_metrics?.tweet_count,- }- : {};-- const tweets =- tweetsResp.status === 'fulfilled'- ? (tweetsResp.value.data?.data || [])- .slice(0, 80)- .map((t) => ({- text: t.text,- likes: t.public_metrics?.like_count ?? 0,- retweets: t.public_metrics?.retweet_count ?? 0,- created_at: t.created_at,- }))- // Prefer higher-engagement tweets as they represent stronger signals- .sort((a, b) => b.likes + b.retweets - (a.likes + a.retweets))- .slice(0, 40)- .map((t) => t.text)- : [];-- return { profile, tweets };-}--// ── Claude Haiku distillation ─────────────────────────────────────────────────--async function distillFacts(xData) {- const tweetBlock =- xData.tweets.length- ? `\n\nRecent original tweets (highest-engagement first):\n${xData.tweets.map((t, i) => `${i + 1}. ${t}`).join('\n')}`- : '';-- const { text: raw } = await llmComplete({- maxTokens: 1024,- system:- 'You distill a person\'s X (Twitter) profile and posts into concise memory facts ' +- 'for an AI agent that will represent this person. Each fact is a single ' +- 'self-contained sentence about the person — their interests, expertise, communication ' +- 'style, values, typical topics, or notable beliefs. Infer voice/tone from the tweet ' +- 'style. Skip promotional content. Focus on authentic personality signals. ' +- 'Output ONLY a JSON array of strings, no other text.',- user:- `Extract up to 15 memory facts from this X profile:\n` +- JSON.stringify(xData.profile, null, 2) +- tweetBlock,- });- try {- const facts = JSON.parse(raw);- return Array.isArray(facts) ? facts.filter((f) => typeof f === 'string').slice(0, 15) : [];- } catch {- return [];- }-}--// ── Handler ───────────────────────────────────────────────────────────────────--export default async function handleMemorySeedX(req, res, agentId) {- if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;- if (!method(req, res, ['POST'])) return;-- const session = await getSessionUser(req);- const bearer = session ? null : await authenticateBearer(extractBearer(req));- const userId = session?.id ?? bearer?.userId;- if (!userId) return error(res, 401, 'unauthorized', 'sign in required');-- // Verify agent ownership- const [agent] = await sql`- SELECT id FROM agent_identities- WHERE id = ${agentId} AND user_id = ${userId} AND deleted_at IS NULL- `;- if (!agent) return error(res, 404, 'not_found', 'agent not found');-- // Verify X connection- const [conn] = await sql`- SELECT access_token, provider_uid, username FROM social_connections- WHERE user_id = ${userId} AND provider = 'x'- `;- if (!conn) {- return error(- res,- 412,- 'not_connected',- 'connect your X account first at /settings?tab=connected-accounts',- );- }-- // Rate limit: 1 seed per agent per 24 hours- const rl = await limits.memorySeed(agentId);- if (!rl.success) {- return rateLimited(res, rl, 'memory seeding is limited to once per 24 hours');- }-- let accessToken;- try {- accessToken = await decryptToken(conn.access_token);- } catch (e) {- console.error('[memory-seed-x] token decrypt failed', e);- return error(res, 500, 'internal_error', 'could not decrypt stored token');- }-- let xData;- try {- xData = await fetchXData(accessToken, conn.provider_uid);- } catch (e) {- console.error('[memory-seed-x] X API fetch failed', e);- return error(res, 502, 'upstream_error', e.message || 'X API fetch failed');- }-- let facts;- try {- facts = await distillFacts(xData);- } catch (e) {- console.error('[memory-seed-x] distill failed', e);- return error(res, 502, 'distill_error', 'could not distill facts from X data');- }-- if (facts.length === 0) {- return json(res, 200, { seeded: 0, facts: [], seeded_at: new Date().toISOString() });- }-- // Replace previous X memories with the fresh distillation- await sql`DELETE FROM agent_memories WHERE agent_id = ${agentId} AND 'x' = ANY(tags)`;-- const seededAt = new Date().toISOString();- const ctx = JSON.stringify({- source: 'x_seed',- x_username: conn.username,- seeded_at: seededAt,- });- for (const fact of facts) {- await sql`- INSERT INTO agent_memories (agent_id, type, content, tags, context, salience)- VALUES (- ${agentId},- 'user',- ${fact.slice(0, 10000)},- ${['x', 'persona']},- ${ctx}::jsonb,- 0.8- )- `;- }-- return json(res, 200, {- seeded: facts.length,- facts,- x_username: conn.username,- seeded_at: seededAt,- });-}diff --git a/api/agents/_id/voice.js b/api/agents/_id/voice.jsindex 0d8616681..57f87936d 100644--- a/api/agents/_id/voice.js+++ b/api/agents/_id/voice.js@@ -10,6 +10,7 @@ import { sql } from '../../_lib/db.js';import { getSessionUser, authenticateBearer, extractBearer } from '../../_lib/auth.js';import { cors, json, method, wrap, error, readJson, rateLimited } from '../../_lib/http.js';import { limits } from '../../_lib/rate-limit.js';+import { requireCsrf } from '../../_lib/csrf.js';import {isConfigured,listVoices,@@ -19,6 +20,15 @@ import {normalizeVoiceSettings,} from '../../_lib/elevenlabs.js';+// Fire-and-forget ElevenLabs voice deletion. The clone slot is best-effort+// cleanup — a failure must be logged, never crash the process as an+// unhandled rejection.+function deleteVoiceBestEffort(voiceId) {+ deleteVoice(voiceId).catch((err) =>+ console.warn('[voice] deleteVoice failed for', voiceId, err?.message || err),+ );+}+const MAX_AUDIO_BYTES = 10 * 1024 * 1024; // 10 MBconst MIN_DURATION_SEC = 30;@@ -66,6 +76,9 @@ export const handleVoice = wrap(async (req, res, id, action) => {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt.+ if (req.method !== 'GET' && !(await requireCsrf(req, res, auth.userId))) return;+const [agent] =await sql`SELECT id, user_id, name FROM agent_identities WHERE id = ${id} AND deleted_at IS NULL`;if (!agent) return error(res, 404, 'not_found', 'agent not found');@@ -160,7 +173,8 @@ export const handleVoice = wrap(async (req, res, id, action) => {'voice_id is not in the available library',);- if (wasCloned && oldVoiceId && oldVoiceId !== nextVoiceId) deleteVoice(oldVoiceId);+ if (wasCloned && oldVoiceId && oldVoiceId !== nextVoiceId)+ deleteVoiceBestEffort(oldVoiceId);const [row] = await sql`UPDATE agent_identities@@ -173,7 +187,7 @@ export const handleVoice = wrap(async (req, res, id, action) => {}// Clear to browser — resets every voice column.- if (wasCloned && oldVoiceId) deleteVoice(oldVoiceId);+ if (wasCloned && oldVoiceId) deleteVoiceBestEffort(oldVoiceId);const [row] = await sql`UPDATE agent_identitiesSET voice_provider = 'browser', voice_id = NULL, voice_cloned_at = NULL,@@ -201,7 +215,7 @@ export const handleVoice = wrap(async (req, res, id, action) => {await sql`SELECT voice_id, voice_cloned_at FROM agent_identities WHERE id = ${id}`;// Only free *cloned* voices on ElevenLabs — library voices are shared// across the account and must never be deleted here.- if (row?.voice_id && row?.voice_cloned_at) deleteVoice(row.voice_id);+ if (row?.voice_id && row?.voice_cloned_at) deleteVoiceBestEffort(row.voice_id);await sql`UPDATE agent_identitiesSET voice_provider = 'browser', voice_id = NULL, voice_cloned_at = NULL@@ -223,8 +237,7 @@ export const handleVoice = wrap(async (req, res, id, action) => {// Rate limit: 3 clones per user per day.const rl = await limits.voiceClone(auth.userId);- if (!rl.success)- return rateLimited(res, rl, 'voice clone limit reached (3 per day)');+ if (!rl.success) return rateLimited(res, rl, 'voice clone limit reached (3 per day)');// Client can send recording duration in seconds so we can reject short clips// without decoding the audio.@@ -312,7 +325,13 @@ export const handleVoice = wrap(async (req, res, id, action) => {`;} catch (dbErr) {console.error('[voice/clone] DB persist failed, rolling back clone', dbErr);- await deleteVoice(voiceId);+ await deleteVoice(voiceId).catch((err) =>+ console.warn(+ '[voice/clone] rollback deleteVoice failed for',+ voiceId,+ err?.message || err,+ ),+ );return error(res, 500, 'internal_error', 'failed to save cloned voice');}diff --git a/api/agents/payments/[action].js b/api/agents/payments/[action].jsindex 5ef0d8ecf..b11721ee7 100644--- a/api/agents/payments/[action].js+++ b/api/agents/payments/[action].js@@ -13,12 +13,7 @@import { z } from 'zod';import { solanaConnection } from '../../_lib/solana/connection.js';-import {- Connection,- PublicKey,- Transaction,- ComputeBudgetProgram,-} from '@solana/web3.js';+import { Connection, PublicKey, Transaction, ComputeBudgetProgram } from '@solana/web3.js';import {PumpAgentOffline,PumpAgent,@@ -379,7 +374,8 @@ async function handlePayConfirm(req, res) {where id = ${body.intent_id} and payer_user_id = ${user.id} limit 1`;if (!intent) return error(res, 404, 'not_found', 'intent not found');- if (intent.status === 'paid') return json(res, 200, { ok: true, intent_id: intent.id, status: 'paid' });+ if (intent.status === 'paid')+ return json(res, 200, { ok: true, intent_id: intent.id, status: 'paid' });if (intent.payload?.wallet_address !== body.wallet_address) {return error(res, 400, 'validation_error', 'wallet mismatch');}@@ -428,7 +424,7 @@ async function handlePayConfirm(req, res) {sql`select user_id from agent_identities where id = ${updated.agent_id} and deleted_at is null limit 1`.then(([row]) => {if (row?.user_id) {- insertNotification(row.user_id, 'payment-earned', {+ insertNotification(row.user_id, 'payment_received', {agent_id: updated.agent_id,amount: updated.amount.toString(),currency_mint: updated.currency_mint,@@ -453,19 +449,45 @@ const balancesSchema = z.object({async function handleBalances(req, res) {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;+ if (!method(req, res, ['GET'])) return;+ const rl = await limits.publicIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);const body = parse(balancesSchema, { ...req.query });const conn = solanaConnection({ url: rpcUrl(body.cluster), commitment: 'confirmed' });const agent = new PumpAgent(new PublicKey(body.mint), body.cluster, conn);const balances = await agent.getBalances(new PublicKey(body.currency_mint));return json(res, 200, {- paymentVault: { address: balances.paymentVault.address.toBase58(), balance: balances.paymentVault.balance.toString() },- buybackVault: { address: balances.buybackVault.address.toBase58(), balance: balances.buybackVault.balance.toString() },- withdrawVault: { address: balances.withdrawVault.address.toBase58(), balance: balances.withdrawVault.balance.toString() },+ paymentVault: {+ address: balances.paymentVault.address.toBase58(),+ balance: balances.paymentVault.balance.toString(),+ },+ buybackVault: {+ address: balances.buybackVault.address.toBase58(),+ balance: balances.buybackVault.balance.toString(),+ },+ withdrawVault: {+ address: balances.withdrawVault.address.toBase58(),+ balance: balances.withdrawVault.balance.toString(),+ },});}// ── distribute-prep / confirm ─────────────────────────────────────────────────+// payment_configs_pending.agent_id is a NOT NULL uuid FK, but distribute/withdraw+// callers identify the agent by its token mint. Resolve via the partial index on+// meta.payments.mint (only payments-configured, non-deleted agents qualify).+async function resolveAgentByPaymentsMint(mint) {+ const [agent] = await sql`+ select id from agent_identities+ where (meta->'payments'->>'mint') = ${mint}+ and (meta->'payments'->>'configured') = 'true'+ and deleted_at is null+ limit 1+ `;+ return agent || null;+}+const distributePrepSchema = z.object({mint: z.string().min(32).max(44),currency_mint: z.string().min(32).max(44),@@ -476,21 +498,30 @@ const distributePrepSchema = z.object({async function handleDistributePrep(req, res) {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;if (!method(req, res, ['POST'])) return;+ const user = await getSessionUser(req);+ if (!user) return error(res, 401, 'unauthorized', 'sign in required');const body = parse(distributePrepSchema, await readJson(req));+ const agent = await resolveAgentByPaymentsMint(body.mint);+ if (!agent) return error(res, 404, 'not_found', 'no payments-enabled agent for this mint');const conn = solanaConnection({ url: rpcUrl(body.cluster), commitment: 'confirmed' });- const user = new PublicKey(body.wallet_address);+ const wallet = new PublicKey(body.wallet_address);const offline = PumpAgentOffline.load(new PublicKey(body.mint), conn);- const ix = await offline.distributePayments({ user, currencyMint: new PublicKey(body.currency_mint) });+ const ix = await offline.distributePayments({+ user: wallet,+ currencyMint: new PublicKey(body.currency_mint),+ });const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash('confirmed');- const tx = new Transaction({ feePayer: user, blockhash, lastValidBlockHeight }).add(+ const tx = new Transaction({ feePayer: wallet, blockhash, lastValidBlockHeight }).add(ComputeBudgetProgram.setComputeUnitLimit({ units: 120_000 }),ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 100_000 }),ix,);- const txBase64 = tx.serialize({ requireAllSignatures: false, verifySignatures: false }).toString('base64');+ const txBase64 = tx+ .serialize({ requireAllSignatures: false, verifySignatures: false })+ .toString('base64');const prepId = await randomToken(24);await sql`insert into payment_configs_pending (id, user_id, agent_id, cluster, mint, payload, expires_at)- values (${prepId}, ${(await getSessionUser(req))?.id ?? 'anon'}, ${body.mint}, ${body.cluster}, ${body.mint},+ values (${prepId}, ${user.id}, ${agent.id}, ${body.cluster}, ${body.mint},${JSON.stringify({ wallet_address: body.wallet_address, action: 'distribute', currency_mint: body.currency_mint })}::jsonb,${new Date(Date.now() + 10 * 60 * 1000)})on conflict (id) do nothing`;@@ -500,14 +531,23 @@ async function handleDistributePrep(req, res) {async function handleDistributeConfirm(req, res) {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;if (!method(req, res, ['POST'])) return;- const body = parse(z.object({ prep_id: z.string(), tx_signature: z.string() }), await readJson(req));- const [prep] = await sql`select * from payment_configs_pending where id = ${body.prep_id} and expires_at > now() limit 1`;+ const user = await getSessionUser(req);+ if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ const body = parse(+ z.object({ prep_id: z.string(), tx_signature: z.string() }),+ await readJson(req),+ );+ const [prep] =+ await sql`select * from payment_configs_pending where id = ${body.prep_id} and user_id = ${user.id} and expires_at > now() limit 1`;if (!prep) return error(res, 404, 'not_found', 'prep expired');const conn = solanaConnection({ url: rpcUrl(prep.cluster), commitment: 'confirmed' });let tx;const deadline = Date.now() + 20_000;while (Date.now() < deadline) {- tx = await conn.getParsedTransaction(body.tx_signature, { maxSupportedTransactionVersion: 0, commitment: 'confirmed' });+ tx = await conn.getParsedTransaction(body.tx_signature, {+ maxSupportedTransactionVersion: 0,+ commitment: 'confirmed',+ });if (tx) break;await new Promise((r) => setTimeout(r, 1500));}@@ -533,6 +573,8 @@ async function handleWithdrawPrep(req, res) {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');const body = parse(withdrawPrepSchema, await readJson(req));+ const agent = await resolveAgentByPaymentsMint(body.mint);+ if (!agent) return error(res, 404, 'not_found', 'no payments-enabled agent for this mint');const conn = solanaConnection({ url: rpcUrl(body.cluster), commitment: 'confirmed' });const spl = await import('@solana/spl-token');const authority = new PublicKey(body.wallet_address);@@ -548,10 +590,12 @@ async function handleWithdrawPrep(req, res) {ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 100_000 }),ix,);- const txBase64 = tx.serialize({ requireAllSignatures: false, verifySignatures: false }).toString('base64');+ const txBase64 = tx+ .serialize({ requireAllSignatures: false, verifySignatures: false })+ .toString('base64');const prepId = await randomToken(24);await sql`insert into payment_configs_pending (id, user_id, agent_id, cluster, mint, payload, expires_at)- values (${prepId}, ${user.id}, ${body.mint}, ${body.cluster}, ${body.mint},+ values (${prepId}, ${user.id}, ${agent.id}, ${body.cluster}, ${body.mint},${JSON.stringify({ wallet_address: body.wallet_address, action: 'withdraw', currency_mint: body.currency_mint })}::jsonb,${new Date(Date.now() + 10 * 60 * 1000)})on conflict (id) do nothing`;@@ -561,14 +605,23 @@ async function handleWithdrawPrep(req, res) {async function handleWithdrawConfirm(req, res) {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;if (!method(req, res, ['POST'])) return;- const body = parse(z.object({ prep_id: z.string(), tx_signature: z.string() }), await readJson(req));- const [prep] = await sql`select * from payment_configs_pending where id = ${body.prep_id} and expires_at > now() limit 1`;+ const user = await getSessionUser(req);+ if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ const body = parse(+ z.object({ prep_id: z.string(), tx_signature: z.string() }),+ await readJson(req),+ );+ const [prep] =+ await sql`select * from payment_configs_pending where id = ${body.prep_id} and user_id = ${user.id} and expires_at > now() limit 1`;if (!prep) return error(res, 404, 'not_found', 'prep expired');const conn = solanaConnection({ url: rpcUrl(prep.cluster), commitment: 'confirmed' });let tx;const deadline = Date.now() + 20_000;while (Date.now() < deadline) {- tx = await conn.getParsedTransaction(body.tx_signature, { maxSupportedTransactionVersion: 0, commitment: 'confirmed' });+ tx = await conn.getParsedTransaction(body.tx_signature, {+ maxSupportedTransactionVersion: 0,+ commitment: 'confirmed',+ });if (tx) break;await new Promise((r) => setTimeout(r, 1500));}diff --git a/api/agents/pumpfun.js b/api/agents/pumpfun.jsindex 2bf0a1fa9..2149a783b 100644--- a/api/agents/pumpfun.js+++ b/api/agents/pumpfun.js@@ -126,7 +126,9 @@ async function handleFeed(req, res) {res.flushHeaders?.();const started = Date.now();let active = true;- req.on('close', () => { active = false; });+ req.on('close', () => {+ active = false;+ });const wsAbort = new AbortController();req.on('close', () => wsAbort.abort());const queue = [];@@ -134,7 +136,14 @@ async function handleFeed(req, res) {// `trades` is per-mint on PumpPortal — require a mint and stream that token's// buy/sell flow. Other kinds (mint/graduation/all) ignore the mint param.const tradeMints = wsKind === 'trades' && mintParam ? [mintParam] : [];- const stopWs = connectPumpFunFeed({ kind: wsKind, mints: tradeMints, signal: wsAbort.signal, onEvent: ({ kind: evKind, data }) => { if (active) queue.push({ evKind, data }); } });+ const stopWs = connectPumpFunFeed({+ kind: wsKind,+ mints: tradeMints,+ signal: wsAbort.signal,+ onEvent: ({ kind: evKind, data }) => {+ if (active) queue.push({ evKind, data });+ },+ });_writeSse(res, 'open', { kind, minTier: minTierParam || null, source: 'websocket' });// Replay the most recent buffered events so a freshly-opened feed is never// blank. Newest first so the UI's `prepend` results in chronological order.@@ -150,23 +159,32 @@ async function handleFeed(req, res) {}const seen = new Set();let lastSig = null;- const tickClaims = pumpfunBotEnabled() ? async () => {- if (kind !== 'claims' && kind !== 'all') return;- const r = await pumpfunMcp.claimsSince({ sinceSig: lastSig, limit: 25 });- if (!r.ok) return;- const items = Array.isArray(r.data) ? r.data : r.data?.items || [];- for (const ev of items) {- const id = ev.tx_signature || ev.signature || ev.id;- if (!id || seen.has(id)) continue;- seen.add(id);- if (!passesFilters(ev)) continue;- lastSig = id;- _writeSse(res, 'claim', ev);- }- } : null;+ const tickClaims = pumpfunBotEnabled()+ ? async () => {+ if (kind !== 'claims' && kind !== 'all') return;+ const r = await pumpfunMcp.claimsSince({ sinceSig: lastSig, limit: 25 });+ if (!r.ok) return;+ const items = Array.isArray(r.data) ? r.data : r.data?.items || [];+ for (const ev of items) {+ const id = ev.tx_signature || ev.signature || ev.id;+ if (!id || seen.has(id)) continue;+ seen.add(id);+ if (!passesFilters(ev)) continue;+ lastSig = id;+ _writeSse(res, 'claim', ev);+ }+ }+ : null;while (active && Date.now() - started < 90_000) {- while (queue.length > 0 && active) { const { evKind, data } = queue.shift(); if (passesFilters(data)) _writeSse(res, evKind, data); }- if (tickClaims) { try { await tickClaims(); } catch {} }+ while (queue.length > 0 && active) {+ const { evKind, data } = queue.shift();+ if (passesFilters(data)) _writeSse(res, evKind, data);+ }+ if (tickClaims) {+ try {+ await tickClaims();+ } catch {}+ }_writeSse(res, 'ping', { t: Date.now() });await new Promise((r) => setTimeout(r, 4000));}@@ -174,32 +192,66 @@ async function handleFeed(req, res) {_writeSse(res, 'close', { reason: 'duration_limit' });res.end();}-function _writeSse(res, event, data) { res.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`); }+function _writeSse(res, event, data) {+ res.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);+}// ── pumpfun-metadata ──────────────────────────────────────────────────────────import { sql as _sql } from '../_lib/db.js';import { env as _env } from '../_lib/env.js';+const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;+async function handleMetadata(req, res) {if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;if (!method(req, res, ['GET'])) return;+ const rlMeta = await limits.publicIp(clientIp(req));+ if (!rlMeta.success) return rateLimited(res, rlMeta);const url = new URL(req.url, `http://${req.headers.host}`);const id = url.searchParams.get('id');if (!id) return error(res, 400, 'validation_error', 'id required');- const [a] = await _sql`select id, name, description, avatar_id, meta, wallet_address from agent_identities where id = ${id} and deleted_at is null limit 1`;+ // agent_identities.id is a uuid column — a malformed id otherwise leaks+ // Postgres error 22P02 to the caller as a 500. Return a clean 404 instead.+ if (!UUID_RE.test(id)) return error(res, 404, 'not_found', 'agent not found');+ const [a] =+ await _sql`select id, name, description, avatar_id, meta, wallet_address from agent_identities where id = ${id} and deleted_at is null limit 1`;if (!a) return error(res, 404, 'not_found', 'agent not found');const origin = _env.APP_ORIGIN;const image = a.meta?.image_url || `${origin}/api/agents/${a.id}/og`;// `.glb`-terminating proxy URL: marketplaces and glTF viewers that key off// the file extension (not the Content-Type) need the trailing `.glb`.const animation = a.avatar_id ? `${origin}/api/avatars/${a.avatar_id}/model.glb` : null;- const symbol = String(a.name || 'AGENT').toUpperCase().replace(/[^A-Z0-9]/g, '').slice(0, 10) || 'AGENT';- return json(res, 200, {- name: a.name, symbol,- description: a.description || `${a.name} is a 3D AI agent on three.ws with onchain identity and signed action history.`,- image, animation_url: animation, external_url: `${origin}/agent/${a.id}`,- attributes: [{ trait_type: 'platform', value: 'three.ws' }, { trait_type: 'agent_id', value: a.id }, ...(a.wallet_address ? [{ trait_type: 'owner', value: a.wallet_address }] : [])],- properties: { category: 'video', files: [...(animation ? [{ uri: animation, type: 'model/gltf-binary' }] : []), { uri: image, type: 'image/png' }] },- }, { 'cache-control': 'public, max-age=300', 'access-control-allow-origin': '*' });+ const symbol =+ String(a.name || 'AGENT')+ .toUpperCase()+ .replace(/[^A-Z0-9]/g, '')+ .slice(0, 10) || 'AGENT';+ return json(+ res,+ 200,+ {+ name: a.name,+ symbol,+ description:+ a.description ||+ `${a.name} is a 3D AI agent on three.ws with onchain identity and signed action history.`,+ image,+ animation_url: animation,+ external_url: `${origin}/agent/${a.id}`,+ attributes: [+ { trait_type: 'platform', value: 'three.ws' },+ { trait_type: 'agent_id', value: a.id },+ ...(a.wallet_address ? [{ trait_type: 'owner', value: a.wallet_address }] : []),+ ],+ properties: {+ category: 'video',+ files: [+ ...(animation ? [{ uri: animation, type: 'model/gltf-binary' }] : []),+ { uri: image, type: 'image/png' },+ ],+ },+ },+ { 'cache-control': 'public, max-age=300', 'access-control-allow-origin': '*' },+ );}diff --git a/api/agents/pumpfun/[action].js b/api/agents/pumpfun/[action].jsindex 4ea77369b..684b43121 100644--- a/api/agents/pumpfun/[action].js+++ b/api/agents/pumpfun/[action].js@@ -16,7 +16,7 @@ import { getSessionUser, authenticateBearer, extractBearer } from '../../_lib/auimport { cors, json, method, readJson, wrap, error, rateLimited } from '../../_lib/http.js';import { limits, clientIp } from '../../_lib/rate-limit.js';import { loadAgentForSigning, solanaConnection } from '../../_lib/agent-pumpfun.js';-import { checkBuyAllowed } from '../../_lib/agent-spend-policy.js';+import { reserveSpend, finalizeSpend, releaseSpend } from '../../_lib/agent-spend-policy.js';import { grindMintKeypair } from '../../_lib/pump-vanity.js';import { sql } from '../../_lib/db.js';import { Keypair, PublicKey, Transaction } from '@solana/web3.js';@@ -90,20 +90,13 @@ async function handleBuy(req, res, id) {if (loaded.error) return error(res, loaded.error.status, loaded.error.code, loaded.error.msg);const { keypair, meta } = loaded;- const blocked = await checkBuyAllowed({- agentId: id,- meta,- mint: body.mint,- solAmount: body.solAmount,- });- if (blocked) return error(res, blocked.status, blocked.code, blocked.msg);-- const [{ PumpSdk, OnlinePumpSdk, getBuyTokenAmountFromSolAmount }, BN, splToken] =+ const [{ PumpSdk, OnlinePumpSdk, getBuyTokenAmountFromSolAmount, isLegacyQuoteMint }, BN] =await Promise.all([import('@pump-fun/pump-sdk'),import('bn.js').then((m) => m.default || m),- import('@solana/spl-token'),]);+ const { slippagePercentFromBps, resolveTokenProgramForMintOwner } =+ await import('../../_lib/pump-trade-args.js');const conn = solanaConnection(body.network);const online = new OnlinePumpSdk(conn);@@ -113,18 +106,41 @@ async function handleBuy(req, res, id) {let instructions;try {- const [global, state] = await Promise.all([+ // base_token_program must match the mint owner — Token-2022 for create_v2+ // coins (every coin pump.fun mints today), SPL Token for legacy coins.+ const mintInfo = await conn.getAccountInfo(mint);+ if (!mintInfo) return error(res, 404, 'mint_not_found', 'mint not found on this network');+ const tokenProgram = resolveTokenProgramForMintOwner(mintInfo.owner);++ const [global, feeConfig, state] = await Promise.all([online.fetchGlobal(),- online.fetchBuyState(mint, keypair.publicKey),+ online.fetchFeeConfig().catch(() => null),+ online.fetchBuyState(mint, keypair.publicKey, tokenProgram),]);+ // This endpoint spends the custodial wallet's SOL — a USDC-paired coin+ // cannot be bought with solAmount. Reject cleanly instead of building a+ // transaction the program will refuse.+ if (state.bondingCurve.quoteMint && !isLegacyQuoteMint(state.bondingCurve.quoteMint)) {+ return error(+ res,+ 409,+ 'usdc_paired_coin',+ 'coin is stable-paired (non-SOL quote) — custodial buys are SOL-denominated; use /api/pump/buy-prep with usdc_amount',+ );+ }const expected = getBuyTokenAmountFromSolAmount({global,- feeConfig: null,+ feeConfig,mintSupply: state.bondingCurve.tokenTotalSupply,bondingCurve: state.bondingCurve,amount: solLamports,});- instructions = await sdk.buyInstructions({+ if (!expected.gt(new BN(0)))+ return error(res, 400, 'amount_too_small', 'solAmount too small to buy any tokens');+ // Unified v2 buy (UPSTREAM-buy-sell-v2-announcement.md): works for all+ // coins, SDK derives the wSOL quote from the curve, applies the percent+ // slippage pad to max_quote_cost, and handles the mayhem fee pool.+ instructions = await sdk.buyV2Instructions({global,bondingCurveAccountInfo: state.bondingCurveAccountInfo,bondingCurve: state.bondingCurve,@@ -132,15 +148,32 @@ async function handleBuy(req, res, id) {mint,user: keypair.publicKey,amount: expected,- solAmount: solLamports,- slippage: body.slippageBps / 10_000,- tokenProgram: splToken.TOKEN_PROGRAM_ID,+ quoteAmount: solLamports,+ slippage: slippagePercentFromBps(body.slippageBps, { defaultBps: 500 }),+ tokenProgram,});} catch (err) {console.error('[pumpfun/buy] build failed', err);- return error(res, 422, 'build_failed', err.message || 'could not build buy ix');+ return error(+ res,+ err.status || 422,+ err.code || 'build_failed',+ err.message || 'could not build buy ix',+ );}+ // Atomically reserve this spend against the daily cap BEFORE sending so two+ // concurrent buys on a stolen session can't both slip past the limit.+ const reservation = await reserveSpend({+ agentId: id,+ meta,+ mint: body.mint,+ solAmount: body.solAmount,+ type: 'pumpfun.buy',+ payload: { slippageBps: body.slippageBps, network: body.network },+ });+ if (!reservation.ok) return error(res, reservation.status, reservation.code, reservation.msg);+const tx = new Transaction().add(...instructions);tx.feePayer = keypair.publicKey;const { blockhash } = await conn.getLatestBlockhash();@@ -153,24 +186,17 @@ async function handleBuy(req, res, id) {await conn.confirmTransaction(signature, 'confirmed');} catch (err) {console.error('[pumpfun/buy] send failed', err);+ await releaseSpend(reservation.reservationId);return error(res, 502, 'rpc_error', err.message || 'transaction failed');}- await sql`- INSERT INTO agent_actions (agent_id, type, payload, source_skill)- VALUES (- ${id},- ${'pumpfun.buy'},- ${JSON.stringify({- mint: body.mint,- solAmount: body.solAmount,- slippageBps: body.slippageBps,- signature,- network: body.network,- })}::jsonb,- ${'pumpfun'}- )- `.catch((e) => console.error('[pumpfun/buy] log failed', e));+ await finalizeSpend(reservation.reservationId, {+ mint: body.mint,+ solAmount: body.solAmount,+ slippageBps: body.slippageBps,+ signature,+ network: body.network,+ });// Mirror into pump_agent_trades for cross-feature analytics (reputation,// admin health, strategy backtests). Best-effort — agent may not have a@@ -238,7 +264,7 @@ async function handleLaunch(req, res, id) {const loaded = await loadAgentForSigning(id, auth.userId);if (loaded.error) return error(res, loaded.error.status, loaded.error.code, loaded.error.msg);- const { keypair } = loaded;+ const { keypair, meta } = loaded;const { PumpSdk, OnlinePumpSdk } = await import('@pump-fun/pump-sdk');const BN = (await import('bn.js')).default;@@ -253,7 +279,12 @@ async function handleLaunch(req, res, id) {try {mint = Keypair.fromSecretKey(Uint8Array.from(body.mintSecretKey));} catch (e) {- return error(res, 400, 'validation_error', 'mintSecretKey did not parse as a valid Solana keypair');+ return error(+ res,+ 400,+ 'validation_error',+ 'mintSecretKey did not parse as a valid Solana keypair',+ );}const addr = mint.publicKey.toBase58();const ic = !!body.vanityIgnoreCase;@@ -309,6 +340,32 @@ async function handleLaunch(req, res, id) {instructions = [ix];}+ const mintAddr = mint.publicKey.toBase58();++ // Gate the launch's initial buy against the agent's spend policy. Previously+ // a launch could spend up to 1000 SOL with no per-tx or daily cap, so a stolen+ // session could drain the custodial wallet through a single large initial buy.+ // A create-only launch (solAmount 0) passes the cap and is still recorded.+ const reservation = await reserveSpend({+ agentId: id,+ meta,+ mint: mintAddr,+ solAmount: body.solAmount || 0,+ type: 'pumpfun.launch',+ payload: {+ name: body.name,+ symbol: body.symbol,+ uri: body.uri,+ network: body.network,+ vanity_prefix: body.vanityPrefix || null,+ vanity_suffix: body.vanitySuffix || null,+ vanity_ignore_case: body.vanityIgnoreCase || false,+ vanity_iterations: vanityIterations,+ vanity_duration_ms: vanityDurationMs,+ },+ });+ if (!reservation.ok) return error(res, reservation.status, reservation.code, reservation.msg);+const tx = new Transaction().add(...instructions);tx.feePayer = keypair.publicKey;const { blockhash } = await conn.getLatestBlockhash();@@ -321,32 +378,11 @@ async function handleLaunch(req, res, id) {await conn.confirmTransaction(signature, 'confirmed');} catch (err) {console.error('[pumpfun/launch] send failed', err);+ await releaseSpend(reservation.reservationId);return error(res, 502, 'rpc_error', err.message || 'transaction failed');}- const mintAddr = mint.publicKey.toBase58();- await sql`- INSERT INTO agent_actions (agent_id, type, payload, source_skill)- VALUES (- ${id},- ${'pumpfun.launch'},- ${JSON.stringify({- mint: mintAddr,- name: body.name,- symbol: body.symbol,- uri: body.uri,- signature,- network: body.network,- solAmount: body.solAmount || 0,- vanity_prefix: body.vanityPrefix || null,- vanity_suffix: body.vanitySuffix || null,- vanity_ignore_case: body.vanityIgnoreCase || false,- vanity_iterations: vanityIterations,- vanity_duration_ms: vanityDurationMs,- })}::jsonb,- ${'pumpfun'}- )- `.catch((e) => console.error('[pumpfun/launch] log failed', e));+ await finalizeSpend(reservation.reservationId, { mint: mintAddr, signature });// Register the mint in the indexer table so pump-agent-stats cron picks it up.await sql`@@ -647,7 +683,11 @@ async function handlePortfolio(req, res, id) {const mint = p.mint;if (!mint) continue;const e = byMint.get(mint) || { mint, sol_in: 0, sol_out: 0 };- if (row.type === 'pumpfun.buy' || row.type === 'pumpfun.launch' || row.type === 'pumpfun.swap.buy') {+ if (+ row.type === 'pumpfun.buy' ||+ row.type === 'pumpfun.launch' ||+ row.type === 'pumpfun.swap.buy'+ ) {e.sol_in += Number(p.solAmount) || 0;} else if (row.type === 'pumpfun.sell' || row.type === 'pumpfun.swap.sell') {e.sol_out += lamportsToSol(p.expectedSolLamports);@@ -687,7 +727,13 @@ async function handlePortfolio(req, res, id) {const positions = await Promise.all([...byMint.values()].map(async (pos) => {- const out = { ...pos, token_balance: '0', estimated_sol_value: null, unrealized_pnl_sol: null, graduated: null };+ const out = {+ ...pos,+ token_balance: '0',+ estimated_sol_value: null,+ unrealized_pnl_sol: null,+ graduated: null,+ };let mintPk;try {mintPk = new PublicKey(pos.mint);@@ -696,10 +742,30 @@ async function handlePortfolio(req, res, id) {return out;}+ let positionTokenProgram = splToken.TOKEN_PROGRAM_ID;try {- const ata = await splToken.getAssociatedTokenAddress(mintPk, keypair.publicKey);- const bal = await conn.getTokenAccountBalance(ata).catch(() => null);- out.token_balance = bal?.value?.amount || '0';+ // A mint is owned by exactly one token program; create_v2 coins are+ // Token-2022, legacy coins are SPL. Check both ATAs and use the one+ // that exists so v2 positions don't read as zero.+ const ataLegacy = splToken.getAssociatedTokenAddressSync(+ mintPk,+ keypair.publicKey,+ true,+ splToken.TOKEN_PROGRAM_ID,+ );+ const ata2022 = splToken.getAssociatedTokenAddressSync(+ mintPk,+ keypair.publicKey,+ true,+ splToken.TOKEN_2022_PROGRAM_ID,+ );+ const [balLegacy, bal2022] = await Promise.all([+ conn.getTokenAccountBalance(ataLegacy).catch(() => null),+ conn.getTokenAccountBalance(ata2022).catch(() => null),+ ]);+ if (bal2022?.value?.amount != null)+ positionTokenProgram = splToken.TOKEN_2022_PROGRAM_ID;+ out.token_balance = bal2022?.value?.amount ?? balLegacy?.value?.amount ?? '0';} catch (err) {out.error = 'balance_fetch_failed';}@@ -711,7 +777,11 @@ async function handlePortfolio(req, res, id) {}try {- const state = await online.fetchSellState(mintPk, keypair.publicKey);+ const state = await online.fetchSellState(+ mintPk,+ keypair.publicKey,+ positionTokenProgram,+ );out.graduated = !!state.bondingCurve.complete;if (!out.graduated) {const expectedSol = getSellSolAmountFromTokenAmount({@@ -727,9 +797,16 @@ async function handlePortfolio(req, res, id) {// AMM quote: simulate sellBaseInput to get expected SOL out.try {const poolKey = ammMod.canonicalPumpPoolPda(mintPk);- const swapState = await onlineAmm.swapSolanaState(poolKey, keypair.publicKey);+ const swapState = await onlineAmm.swapSolanaState(+ poolKey,+ keypair.publicKey,+ );const result = ammSdk.sellAutocompleteQuoteFromBase- ? ammSdk.sellAutocompleteQuoteFromBase(swapState, new BN(out.token_balance), 0)+ ? ammSdk.sellAutocompleteQuoteFromBase(+ swapState,+ new BN(out.token_balance),+ 0,+ ): null;if (result && result.uiQuote != null) {out.estimated_sol_value = lamportsToSol(result.uiQuote);@@ -770,7 +847,8 @@ async function handlePortfolio(req, res, id) {(acc, p) => {acc.sol_in += p.sol_in;acc.sol_out += p.sol_out;- if (typeof p.estimated_sol_value === 'number') acc.estimated_value_sol += p.estimated_sol_value;+ if (typeof p.estimated_sol_value === 'number')+ acc.estimated_value_sol += p.estimated_sol_value;return acc;},{ sol_in: 0, sol_out: 0, estimated_value_sol: 0 },@@ -816,12 +894,13 @@ async function handleSell(req, res, id) {if (loaded.error) return error(res, loaded.error.status, loaded.error.code, loaded.error.msg);const { keypair } = loaded;- const [{ PumpSdk, OnlinePumpSdk, getSellSolAmountFromTokenAmount }, BN, splToken] =+ const [{ PumpSdk, OnlinePumpSdk, getSellSolAmountFromTokenAmount, isLegacyQuoteMint }, BN] =await Promise.all([import('@pump-fun/pump-sdk'),import('bn.js').then((m) => m.default || m),- import('@solana/spl-token'),]);+ const { slippagePercentFromBps, resolveTokenProgramForMintOwner } =+ await import('../../_lib/pump-trade-args.js');const conn = solanaConnection(body.network);const online = new OnlinePumpSdk(conn);@@ -832,33 +911,55 @@ async function handleSell(req, res, id) {let instructions;let expectedSolStr;try {- const [global, state] = await Promise.all([+ const mintInfo = await conn.getAccountInfo(mint);+ if (!mintInfo) return error(res, 404, 'mint_not_found', 'mint not found on this network');+ const tokenProgram = resolveTokenProgramForMintOwner(mintInfo.owner);++ const [global, feeConfig, state] = await Promise.all([online.fetchGlobal(),- online.fetchSellState(mint, keypair.publicKey),+ online.fetchFeeConfig().catch(() => null),+ online.fetchSellState(mint, keypair.publicKey, tokenProgram),]);+ // Custodial sells are SOL-denominated; stable-paired proceeds would land+ // as USDC the endpoint does not account for. Reject cleanly.+ if (state.bondingCurve.quoteMint && !isLegacyQuoteMint(state.bondingCurve.quoteMint)) {+ return error(+ res,+ 409,+ 'usdc_paired_coin',+ 'coin is stable-paired (non-SOL quote) — custodial sells are SOL-denominated; use /api/pump/sell-prep',+ );+ }const expectedSol = getSellSolAmountFromTokenAmount({global,- feeConfig: null,+ feeConfig,mintSupply: state.bondingCurve.tokenTotalSupply,bondingCurve: state.bondingCurve,amount: tokenAmount,});expectedSolStr = expectedSol.toString();- instructions = await sdk.sellInstructions({+ // Unified v2 sell: percent slippage shaves the expected output into a+ // real min_sol_output floor, and the SDK reads the curve's mayhem flag+ // for fee-recipient selection (the legacy builder needed it passed in).+ instructions = await sdk.sellV2Instructions({global,bondingCurveAccountInfo: state.bondingCurveAccountInfo,bondingCurve: state.bondingCurve,mint,user: keypair.publicKey,amount: tokenAmount,- solAmount: expectedSol,- slippage: body.slippageBps / 10_000,- tokenProgram: splToken.TOKEN_PROGRAM_ID,- mayhemMode: false,+ quoteAmount: expectedSol,+ slippage: slippagePercentFromBps(body.slippageBps, { defaultBps: 500 }),+ tokenProgram,});} catch (err) {console.error('[pumpfun/sell] build failed', err);- return error(res, 422, 'build_failed', err.message || 'could not build sell ix');+ return error(+ res,+ err.status || 422,+ err.code || 'build_failed',+ err.message || 'could not build sell ix',+ );}const tx = new Transaction().add(...instructions);@@ -961,18 +1062,11 @@ async function handleSwap(req, res, id) {if (loaded.error) return error(res, loaded.error.status, loaded.error.code, loaded.error.msg);const { keypair, meta } = loaded;- if (body.side === 'buy') {- const blocked = await checkBuyAllowed({- agentId: id, meta, mint: body.mint, solAmount: body.solAmount,- });- if (blocked) return error(res, blocked.status, blocked.code, blocked.msg);- }-const conn = solanaConnection(body.network);const mint = new PublicKey(body.mint);// Detect graduation. If still on bonding curve, delegate to /buy or /sell.- const { PumpSdk, bondingCurvePda } = await import('@pump-fun/pump-sdk');+ const { PumpSdk, bondingCurvePda, isLegacyQuoteMint } = await import('@pump-fun/pump-sdk');const pumpSdk = new PumpSdk();const bcInfo = await conn.getAccountInfo(bondingCurvePda(mint));const bc = bcInfo ? pumpSdk.decodeBondingCurveNullable(bcInfo) : null;@@ -988,21 +1082,35 @@ async function handleSwap(req, res, id) {}// AMM path.- const { PumpAmmSdk, OnlinePumpAmmSdk, canonicalPumpPoolPda } = await import(- '@pump-fun/pump-swap-sdk'- );+ const { PumpAmmSdk, OnlinePumpAmmSdk, canonicalPumpPoolPda } =+ await import('@pump-fun/pump-swap-sdk');const BN = (await import('bn.js')).default;const amm = new PumpAmmSdk();const online = new OnlinePumpAmmSdk(conn);+ // The canonical pool PDA is keyed by quote mint. SOL curves store the+ // default pubkey; stable-paired coins carry their real quote mint, which a+ // SOL-denominated custodial swap cannot trade — reject those cleanly.+ if (bc?.quoteMint && !isLegacyQuoteMint(bc.quoteMint)) {+ return error(+ res,+ 409,+ 'usdc_paired_coin',+ 'pool is stable-paired (non-SOL quote) — custodial swaps are SOL-denominated; use /api/pump/buy-prep or sell-prep',+ );+ }const poolKey = canonicalPumpPoolPda(mint);- const swapState = await online.swapSolanaState(poolKey, keypair.publicKey).catch(async (err) => {- // Fall back: pool account may not be initialized (race after graduation).- console.error('[pumpfun/swap] swapSolanaState failed', err);- return online.swapSolanaStateNoPool(poolKey, keypair.publicKey);- });+ const swapState = await online+ .swapSolanaState(poolKey, keypair.publicKey)+ .catch(async (err) => {+ // Fall back: pool account may not be initialized (race after graduation).+ console.error('[pumpfun/swap] swapSolanaState failed', err);+ return online.swapSolanaStateNoPool(poolKey, keypair.publicKey);+ });- const slippage = body.slippageBps / 10_000;+ // AMM SDK takes slippage as a PERCENT (1 = 1%) — api/_lib/pump-trade-args.js.+ const { slippagePercentFromBps } = await import('../../_lib/pump-trade-args.js');+ const slippage = slippagePercentFromBps(body.slippageBps, { defaultBps: 500 });let instructions;let quotedAmount;@@ -1033,6 +1141,23 @@ async function handleSwap(req, res, id) {return error(res, 422, 'build_failed', err.message || 'could not build swap ix');}+ // A swap-buy is a SOL outflow — reserve it against the daily cap atomically+ // before sending (closes the concurrent-spend TOCTOU). A swap-sell is an+ // inflow and is recorded after the fact, no reservation needed.+ let reservation = null;+ if (body.side === 'buy') {+ reservation = await reserveSpend({+ agentId: id,+ meta,+ mint: body.mint,+ solAmount: body.solAmount,+ type: 'pumpfun.swap.buy',+ payload: { slippageBps: body.slippageBps, network: body.network, venue: 'amm' },+ });+ if (!reservation.ok)+ return error(res, reservation.status, reservation.code, reservation.msg);+ }+const tx = new Transaction().add(...instructions);tx.feePayer = keypair.publicKey;const { blockhash } = await conn.getLatestBlockhash();@@ -1045,29 +1170,41 @@ async function handleSwap(req, res, id) {await conn.confirmTransaction(signature, 'confirmed');} catch (err) {console.error('[pumpfun/swap] send failed', err);+ if (reservation) await releaseSpend(reservation.reservationId);return error(res, 502, 'rpc_error', err.message || 'transaction failed');}- await sql`- INSERT INTO agent_actions (agent_id, type, payload, source_skill)- VALUES (- ${id},- ${`pumpfun.swap.${body.side}`},- ${JSON.stringify({- mint: body.mint,- side: body.side,- ...(body.side === 'buy'- ? { solAmount: body.solAmount }- : { tokenAmount: body.tokenAmount }),- slippageBps: body.slippageBps,- signature,- network: body.network,- venue: 'amm',- ...quotedAmount,- })}::jsonb,- ${'pumpfun'}- )- `.catch((e) => console.error('[pumpfun/swap] log failed', e));+ if (reservation) {+ await finalizeSpend(reservation.reservationId, {+ mint: body.mint,+ side: 'buy',+ solAmount: body.solAmount,+ slippageBps: body.slippageBps,+ signature,+ network: body.network,+ venue: 'amm',+ ...quotedAmount,+ });+ } else {+ await sql`+ INSERT INTO agent_actions (agent_id, type, payload, source_skill)+ VALUES (+ ${id},+ ${`pumpfun.swap.${body.side}`},+ ${JSON.stringify({+ mint: body.mint,+ side: body.side,+ tokenAmount: body.tokenAmount,+ slippageBps: body.slippageBps,+ signature,+ network: body.network,+ venue: 'amm',+ ...quotedAmount,+ })}::jsonb,+ ${'pumpfun'}+ )+ `.catch((e) => console.error('[pumpfun/swap] log failed', e));+ }return json(res, 200, {data: {diff --git a/api/agents/solana-airdrop.js b/api/agents/solana-airdrop.jsindex 716a05b46..d626377dc 100644--- a/api/agents/solana-airdrop.js+++ b/api/agents/solana-airdrop.js@@ -1,40 +1,16 @@-import { getSessionUser } from '../_lib/auth.js';-import { sql } from '../_lib/db.js';-import { cors, error, json, method, wrap, rateLimited } from '../_lib/http.js';-import { limits, clientIp } from '../_lib/rate-limit.js';-import { recordEvent } from '../_lib/usage.js';-import { solanaConnection } from '../_lib/agent-pumpfun.js';-import { PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';--export default wrap(async (req, res) => {- if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;- if (!method(req, res, ['POST'])) return;-- const user = await getSessionUser(req);- if (!user) return error(res, 401, 'unauthorized', 'sign in required');-- const rl = await limits.authIp(clientIp(req));- if (!rl.success) return rateLimited(res, rl);-+// POST /api/agents/:id/solana/airdrop — thin delegate.+//+// The canonical airdrop implementation lives in solana-wallet.js+// (handleAirdrop), dispatched from api/agents/[id].js via the `solana`+// sub-path. This wrapper exists only for direct imports of the standalone+// module path; it carries no logic of its own so the two paths can never+// drift apart.++import { wrap } from '../_lib/http.js';+import solanaWallet from './solana-wallet.js';++export default wrap(async (req, res, id) => {const url = new URL(req.url, 'http://x');- const agentId = url.searchParams.get('id') || req.query?.id;-- const [row] = await sql`SELECT id, user_id, meta FROM agent_identities WHERE id = ${agentId} AND deleted_at IS NULL`;- if (!row) return error(res, 404, 'not_found', 'agent not found');- if (row.user_id !== user.id) return error(res, 403, 'forbidden', 'not your agent');-- const address = row.meta?.solana_address;- if (!address) return error(res, 404, 'not_found', 'agent has no solana wallet');-- let signature;- try {- const conn = solanaConnection('devnet');- signature = await conn.requestAirdrop(new PublicKey(address), LAMPORTS_PER_SOL);- await conn.confirmTransaction(signature, 'confirmed');- } catch (err) {- return error(res, 502, 'faucet_unavailable', err?.message || 'devnet airdrop failed');- }-- recordEvent({ userId: user.id, agentId, kind: 'solana_airdrop', tool: 'devnet', status: 'ok', meta: { address, signature } });- return json(res, 200, { data: { signature, address, network: 'devnet', lamports: LAMPORTS_PER_SOL, sol: 1 } });+ const agentId = id || url.searchParams.get('id') || req.query?.id;+ return solanaWallet(req, res, agentId, 'airdrop');});diff --git a/api/agents/talk.js b/api/agents/talk.jsindex 9fbaf1884..9039089e2 100644--- a/api/agents/talk.js+++ b/api/agents/talk.js@@ -17,6 +17,7 @@import { z } from 'zod';import { sql } from '../_lib/db.js';+import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.js';import { cors, error, json, method, readJson, wrap, rateLimited } from '../_lib/http.js';import { limits, clientIp } from '../_lib/rate-limit.js';import { normalizeLegacyPolicy } from '../_lib/embed-policy.js';@@ -30,6 +31,8 @@ const ALLOWED_MODELS = new Set(['claude-3-5-haiku-20241022',]);+const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;+const bodySchema = z.object({agentId: z.string().min(1).max(120),message: z.string().min(1).max(4000),@@ -44,6 +47,12 @@ export default wrap(async (req, res) => {return error(res, 400, 'recursion_denied', 'nested agent delegation is not allowed');}+ // Each call burns platform LLM credit, so require an authenticated principal.+ // The x402-paid public path lives in the MCP tool, not here.+ const session = await getSessionUser(req);+ const principal = session ?? (await authenticateBearer(extractBearer(req)));+ if (!principal) return error(res, 401, 'unauthorized', 'sign in required');+const rl = await limits.agentDelegate(clientIp(req));if (!rl.success) return rateLimited(res, rl, 'agent delegate rate limit');@@ -55,10 +64,19 @@ export default wrap(async (req, res) => {}const parsed = bodySchema.safeParse(raw);if (!parsed.success) {- return error(res, 400, 'validation_error', parsed.error.issues[0]?.message ?? 'invalid body');+ return error(+ res,+ 400,+ 'validation_error',+ parsed.error.issues[0]?.message ?? 'invalid body',+ );}const { agentId, message, model: requestedModel } = parsed.data;+ // agent_identities.id is a uuid column — a malformed id otherwise leaks+ // Postgres error 22P02 to the caller as a 500. Return a clean 404 instead.+ if (!UUID_RE.test(agentId)) return error(res, 404, 'agent_not_found', 'agent not found');+const [agent] = await sql`SELECT id, name, description, embed_policy, metaFROM agent_identities@@ -72,7 +90,8 @@ export default wrap(async (req, res) => {}const defaultModel = policy?.brain?.model || 'claude-haiku-4-5-20251001';- const model = requestedModel && ALLOWED_MODELS.has(requestedModel) ? requestedModel : defaultModel;+ const model =+ requestedModel && ALLOWED_MODELS.has(requestedModel) ? requestedModel : defaultModel;const systemPrompt =agent.meta?.brain?.instructions ||@@ -93,7 +112,12 @@ export default wrap(async (req, res) => {});} catch (err) {if (err instanceof LlmUnavailableError) {- return error(res, 503, 'llm_unavailable', 'agent delegation is not available right now');+ return error(+ res,+ 503,+ 'llm_unavailable',+ 'agent delegation is not available right now',+ );}return error(res, 502, 'upstream_error', `LLM call failed: ${err.message}`);}diff --git a/api/agents/tokens/[action].js b/api/agents/tokens/[action].jsindex 0254a994d..6fc11ab73 100644--- a/api/agents/tokens/[action].js+++ b/api/agents/tokens/[action].js@@ -184,8 +184,7 @@ async function handleLaunchPrep(req, res) {});// 4. Build the launch tx- const { Connection, Keypair, PublicKey, Transaction, ComputeBudgetProgram } =- await loadSolanaWeb3();+ const { Keypair, PublicKey, Transaction, ComputeBudgetProgram } = await loadSolanaWeb3();const { PumpSdk, OnlinePumpSdk, getBuyTokenAmountFromSolAmount, BN } = await loadPumpSdk();const conn = solanaConnection({ url: rpcUrl(body.cluster), commitment: 'confirmed' });const onlineSdk = new OnlinePumpSdk(conn);@@ -345,7 +344,6 @@ async function handleLaunchConfirm(req, res) {}// Verify on-chain- const { Connection } = await loadSolanaWeb3();const conn = solanaConnection({ url: rpcUrl(prep.cluster), commitment: 'confirmed' });const deadline = Date.now() + 30_000;@@ -461,7 +459,6 @@ async function handleLaunchQuote(req, res) {let buyEstimate = null;if (q.initial_buy_sol > 0) {try {- const { Connection } = await loadSolanaWeb3();const { OnlinePumpSdk, getBuyTokenAmountFromSolAmount, BN } = await loadPumpSdk();const conn = solanaConnection({ url: rpcUrl(q.cluster), commitment: 'confirmed' });const onlineSdk = new OnlinePumpSdk(conn);@@ -488,8 +485,7 @@ async function handleLaunchQuote(req, res) {}}- const totalSol =- FIXED_LAUNCH_TOTAL + q.initial_buy_sol + (buyEstimate?.protocol_fee_sol || 0);+ const totalSol = FIXED_LAUNCH_TOTAL + q.initial_buy_sol + (buyEstimate?.protocol_fee_sol || 0);return json(res, 200, {cluster: q.cluster,diff --git a/api/agents/x402/[action].js b/api/agents/x402/[action].jsindex df9dea419..27668885d 100644--- a/api/agents/x402/[action].js+++ b/api/agents/x402/[action].js@@ -43,7 +43,11 @@ async function resolveAuth(req) {// ── invoke ────────────────────────────────────────────────────────────────────-const invokeSchema = z.object({ agent_id: z.string().min(1).max(80), skill: z.string().min(1).max(64), args: z.record(z.any()).default({}) });+const invokeSchema = z.object({+ agent_id: z.string().min(1).max(80),+ skill: z.string().min(1).max(64),+ args: z.record(z.any()).default({}),+});async function handleInvoke(req, res) {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;@@ -57,7 +61,8 @@ async function handleInvoke(req, res) {const body = parse(invokeSchema, await readJson(req));if (!isUuid(body.agent_id)) return error(res, 404, 'not_found', 'agent not found');- const [agent] = await sql`select id, user_id, name, meta, skills from agent_identities where id = ${body.agent_id} and deleted_at is null limit 1`;+ const [agent] =+ await sql`select id, user_id, name, meta, skills from agent_identities where id = ${body.agent_id} and deleted_at is null limit 1`;if (!agent) return error(res, 404, 'not_found', 'agent not found');// Determine if the skill is callable: registered server handler OR a skill@@ -66,15 +71,51 @@ async function handleInvoke(req, res) {const handlerExists = !!HANDLERS[body.skill];const skillDeclared = Array.isArray(agent.skills) && agent.skills.includes(body.skill);if (!handlerExists && !skillDeclared) {- return error(res, 404, 'unknown_skill', `skill "${body.skill}" is not registered on this agent`);+ return error(+ res,+ 404,+ 'unknown_skill',+ `skill "${body.skill}" is not registered on this agent`,+ );}const price = await priceFor(agent, body.skill);if (!price) {return error(res, 409, 'no_payments', `skill "${body.skill}" is not priced on this agent`);}- const paid = await verifyPaid(req, { agentId: agent.id, skill: body.skill, expectedAmount: price.amount, expectedCurrency: price.currency });- if (!paid) return emit402(res, { agent, skill: body.skill, amount: price.amount, currency: price.currency });+ const paid = await verifyPaid(req, {+ agentId: agent.id,+ skill: body.skill,+ expectedAmount: price.amount,+ expectedCurrency: price.currency,+ });+ if (!paid)+ return emit402(res, {+ agent,+ skill: body.skill,+ amount: price.amount,+ currency: price.currency,+ });++ // Execute the skill BEFORE consuming the payment intent: if the handler+ // throws, wrap() returns the error with the intent untouched, so the buyer's+ // payment still covers a retry instead of being burned on a failed call.+ let result;+ if (handlerExists) {+ result = await HANDLERS[body.skill](body.args, { agent, caller: auth });+ } else {+ // Delegate to the in-process skill-runtime. The skill name on the agent+ // is treated as a "<skill>.<tool>" qualifier; if the caller passed bare+ // args (no tool), default to the skill name as the tool too — runtime+ // will surface a descriptive error if there's no matching export.+ const { makeRuntime } = await import('../../_lib/skill-runtime.js');+ const runtime = makeRuntime({+ agentId: agent.id,+ signerAddress: paid.payerAddress || null,+ });+ const tool = typeof body.args?._tool === 'string' ? body.args._tool : body.skill;+ result = await runtime.invoke(`${body.skill}.${tool}`, body.args);+ }await consumeIntent(paid.intentId);const gross = parseInt(paid.amount, 10);@@ -83,7 +124,7 @@ async function handleInvoke(req, res) {insert into agent_revenue_events(agent_id, intent_id, skill, gross_amount, fee_amount, net_amount, currency_mint, chain, payer_address)values- (${agent.id}, ${paid.intentId}, ${body.skill}, ${gross}, ${fee}, ${net}, ${paid.currency}, ${'solana'}, ${paid.payerAddress})+ (${agent.id}, ${paid.intentId}, ${body.skill}, ${gross}, ${fee}, ${net}, ${paid.currency}, ${price.chain ?? 'solana'}, ${paid.payerAddress})`;insertNotification(agent.user_id, 'payment_received', {agent_id: agent.id,@@ -92,20 +133,13 @@ async function handleInvoke(req, res) {net_amount: net,currency_mint: paid.currency,});- let result;- if (handlerExists) {- result = await HANDLERS[body.skill](body.args, { agent, caller: auth });- } else {- // Delegate to the in-process skill-runtime. The skill name on the agent- // is treated as a "<skill>.<tool>" qualifier; if the caller passed bare- // args (no tool), default to the skill name as the tool too — runtime- // will surface a descriptive error if there's no matching export.- const { makeRuntime } = await import('../../_lib/skill-runtime.js');- const runtime = makeRuntime({ agentId: agent.id, signerAddress: paid.payerAddress || null });- const tool = typeof body.args?._tool === 'string' ? body.args._tool : body.skill;- result = await runtime.invoke(`${body.skill}.${tool}`, body.args);- }- return json(res, 200, { ok: true, intent_id: paid.intentId, amount: paid.amount, currency: paid.currency, result });+ return json(res, 200, {+ ok: true,+ intent_id: paid.intentId,+ amount: paid.amount,+ currency: paid.currency,+ result,+ });}// ── manifest ──────────────────────────────────────────────────────────────────@@ -120,10 +154,12 @@ async function handleManifest(req, res) {const url = new URL(req.url, 'http://x');const agent_id = url.searchParams.get('agent_id');const skill = url.searchParams.get('skill');- if (!agent_id || !skill) return error(res, 400, 'validation_error', 'agent_id and skill required');+ if (!agent_id || !skill)+ return error(res, 400, 'validation_error', 'agent_id and skill required');if (!isUuid(agent_id)) return error(res, 404, 'not_found', 'agent not found');- const [agent] = await sql`select id, name, meta from agent_identities where id = ${agent_id} and deleted_at is null limit 1`;+ const [agent] =+ await sql`select id, name, meta from agent_identities where id = ${agent_id} and deleted_at is null limit 1`;if (!agent) return error(res, 404, 'not_found', 'agent not found');// Manifest is callable as long as the skill is priced — either in the@@ -131,7 +167,9 @@ async function handleManifest(req, res) {const [hasMarketplacePrice] = await sql`SELECT 1 FROM agent_skill_prices WHERE agent_id = ${agent.id} AND skill = ${skill} AND is_active = true`;- const hasMetaPrice = !!(agent.meta?.skill_prices?.[skill] || agent.meta?.payments?.default_price);+ const hasMetaPrice = !!(+ agent.meta?.skill_prices?.[skill] || agent.meta?.payments?.default_price+ );if (!hasMarketplacePrice && !hasMetaPrice) {return error(res, 409, 'no_payments', 'this skill is not priced');}diff --git a/api/api-keys/[id].js b/api/api-keys/[id].jsindex 78e336dd6..e44af962a 100644--- a/api/api-keys/[id].js+++ b/api/api-keys/[id].js@@ -2,6 +2,7 @@ import { sql } from '../_lib/db.js';import { getSessionUser, authenticateBearer, extractBearer, hasScope } from '../_lib/auth.js';import { logAudit } from '../_lib/audit.js';import { cors, json, error, wrap, method, rateLimited } from '../_lib/http.js';+import { requireCsrf } from '../_lib/csrf.js';import { limits, clientIp } from '../_lib/rate-limit.js';export default wrap(async (req, res) => {@@ -14,6 +15,7 @@ export default wrap(async (req, res) => {if (bearer && !hasScope(bearer.scope, 'profile'))return error(res, 403, 'insufficient_scope', 'requires profile scope');const userId = session?.id ?? bearer.userId;+ if (session && !(await requireCsrf(req, res, session.id))) return;const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);diff --git a/api/artifact.js b/api/artifact.jsindex 70d8b6230..c17c48ed4 100644--- a/api/artifact.js+++ b/api/artifact.js@@ -116,7 +116,9 @@ async function fetchExternalGlb(url) {if (!res.ok) throw new Error(`upstream ${res.status}`);const len = Number(res.headers.get('content-length') || 0);if (len && len > MAX_GLB_BYTES) {- throw new Error(`model ${(len / 1024 / 1024).toFixed(1)} MB exceeds ${MAX_GLB_BYTES / 1024 / 1024} MB limit`);+ throw new Error(+ `model ${(len / 1024 / 1024).toFixed(1)} MB exceeds ${MAX_GLB_BYTES / 1024 / 1024} MB limit`,+ );}const buf = Buffer.from(await res.arrayBuffer());if (buf.byteLength > MAX_GLB_BYTES) {@@ -159,7 +161,9 @@ async function loadAgentArtifactConfig(agentId, opts) {a.id, a.name,av.storage_keyFROM agent_identities a- LEFT JOIN avatars av ON av.id = a.avatar_id AND av.deleted_at IS NULL+ LEFT JOIN avatars av ON av.id = a.avatar_id+ AND av.deleted_at IS NULL+ AND av.visibility IN ('public', 'unlisted')WHERE a.id = ${agentId} AND a.deleted_at IS NULLLIMIT 1`;@@ -223,7 +227,12 @@ export default wrap(async (req, res) => {const bg = (params.get('bg') || '').replace(/^#/, '').match(/^[0-9a-f]{6}$/i)?.[0] || '';if ((agentId === null) === (modelUrl === null)) {- return error(res, 400, 'invalid_request', 'provide exactly one of ?agent=<id> or ?model=<url>');+ return error(+ res,+ 400,+ 'invalid_request',+ 'provide exactly one of ?agent=<id> or ?model=<url>',+ );}const opts = { theme, idle, bg };@@ -231,13 +240,23 @@ export default wrap(async (req, res) => {if (agentId !== null) {if (!AGENT_ID_RE.test(agentId)) {- return error(res, 400, 'invalid_request', 'agent id must be 3–64 alphanumeric/hyphen/underscore chars');+ return error(+ res,+ 400,+ 'invalid_request',+ 'agent id must be 3–64 alphanumeric/hyphen/underscore chars',+ );}result = await loadAgentArtifactConfig(agentId, opts);} else {const safeUrl = validateModelUrl(modelUrl);if (!safeUrl) {- return error(res, 400, 'invalid_request', 'model must be an https URL from a whitelisted origin');+ return error(+ res,+ 400,+ 'invalid_request',+ 'model must be an https URL from a whitelisted origin',+ );}try {result = await loadModelArtifactConfig(safeUrl, opts);diff --git a/api/audit-log.js b/api/audit-log.jsindex 2f14c1c00..bd05939cd 100644--- a/api/audit-log.js+++ b/api/audit-log.js@@ -45,7 +45,10 @@ function decodeCursor(cursor) {function csvEscape(value) {if (value === null || value === undefined) return '';- const s = typeof value === 'string' ? value : JSON.stringify(value);+ let s = typeof value === 'string' ? value : JSON.stringify(value);+ // Neutralize spreadsheet formula injection: Excel/Sheets execute cells that+ // start with = + - @ — prefix with a quote so they render as text.+ if (/^[=+\-@]/.test(s)) s = `'${s}`;if (/[",\n\r]/.test(s)) return `"${s.replace(/"/g, '""')}"`;return s;}@@ -69,7 +72,10 @@ export default wrap(async (req, res) => {async function handleList(userId, url, res) {const rawLimit = parseInt(url.searchParams.get('limit') || String(DEFAULT_LIMIT), 10);- const limit = Math.min(MAX_LIMIT, Math.max(1, Number.isFinite(rawLimit) ? rawLimit : DEFAULT_LIMIT));+ const limit = Math.min(+ MAX_LIMIT,+ Math.max(1, Number.isFinite(rawLimit) ? rawLimit : DEFAULT_LIMIT),+ );const cursor = decodeCursor(url.searchParams.get('cursor'));const rows = cursor@@ -122,14 +128,16 @@ async function handleCsv(userId, res) {const header = ['when', 'action', 'resource_id', 'ip', 'user_agent', 'meta'];const lines = [header.join(',')];for (const r of rows) {- lines.push([- csvEscape(new Date(r.created_at).toISOString()),- csvEscape(r.action),- csvEscape(r.resource_id),- csvEscape(r.ip),- csvEscape(r.user_agent),- csvEscape(r.meta),- ].join(','));+ lines.push(+ [+ csvEscape(new Date(r.created_at).toISOString()),+ csvEscape(r.action),+ csvEscape(r.resource_id),+ csvEscape(r.ip),+ csvEscape(r.user_agent),+ csvEscape(r.meta),+ ].join(','),+ );}const filename = `audit-log-${new Date().toISOString().slice(0, 10)}.csv`;diff --git a/api/auth/session/[action].js b/api/auth/session/[action].jsindex 1bab13d6d..5e6e0271f 100644--- a/api/auth/session/[action].js+++ b/api/auth/session/[action].js@@ -2,8 +2,11 @@ import { getSessionUser, createSession, sessionCookie } from '../../_lib/auth.jsimport { sha256 } from '../../_lib/crypto.js';import { sql } from '../../_lib/db.js';import { cors, json, error, method, wrap, readJson } from '../../_lib/http.js';+import { requireCsrf } from '../../_lib/csrf.js';import { clientIp } from '../../_lib/rate-limit.js';+const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;+function readCookieToken(req) {const cookie = req.headers.cookie || '';const m = cookie.match(/(?:^|;\s*)__Host-sid=([^;]+)/) || cookie.match(/(?:^|;\s*)sid=([^;]+)/);@@ -50,6 +53,7 @@ export default wrap(async (req, res) => {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ if (!(await requireCsrf(req, res, user.id))) return;const token = readCookieToken(req);if (!token) return error(res, 401, 'unauthorized', 'no session cookie');@@ -73,6 +77,7 @@ export default wrap(async (req, res) => {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ if (!(await requireCsrf(req, res, user.id))) return;const body = await readJson(req);@@ -87,6 +92,8 @@ export default wrap(async (req, res) => {}if (body.sessionId) {+ if (typeof body.sessionId !== 'string' || !UUID_REGEX.test(body.sessionId))+ return error(res, 400, 'invalid_id', 'sessionId must be a valid UUID');const revoked = await sql`update sessions set revoked_at = now()where id = ${body.sessionId} and user_id = ${user.id} and revoked_at is nulldiff --git a/api/auth/sessions/[action].js b/api/auth/sessions/[action].jsindex 59c16f28b..f0cd45a10 100644--- a/api/auth/sessions/[action].js+++ b/api/auth/sessions/[action].js@@ -10,6 +10,7 @@import { sql } from '../../_lib/db.js';import { getSessionUser, rotateSession, sessionCookie } from '../../_lib/auth.js';import { cors, json, method, wrap, error, rateLimited } from '../../_lib/http.js';+import { requireCsrf } from '../../_lib/csrf.js';import { limits, clientIp } from '../../_lib/rate-limit.js';const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;@@ -60,6 +61,8 @@ async function handleIndex(req, res) {// DELETE — revoke all other sessions, then rotate the current one so the user// stays signed in on this device with a fresh cookie ("log out everywhere else").+ if (!(await requireCsrf(req, res, user.id))) return;+const ua = req.headers['user-agent'] || null;const result = await sql`update sessions@@ -91,6 +94,7 @@ async function handleRevokeOne(req, res, sessionIdFromAction) {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthenticated', 'not signed in');+ if (!(await requireCsrf(req, res, user.id))) return;const sessionId = req.query.id || sessionIdFromAction || req.url.split('/').pop();if (!UUID_REGEX.test(sessionId))diff --git a/api/auth/siws/[action].js b/api/auth/siws/[action].jsindex 9dc9827f2..4ec410d2c 100644--- a/api/auth/siws/[action].js+++ b/api/auth/siws/[action].js@@ -9,7 +9,7 @@ import { cors, json, method, readJson, wrap, error, rateLimited } from '../../_limport { limits, clientIp } from '../../_lib/rate-limit.js';import { env } from '../../_lib/env.js';import { parse } from '../../_lib/validate.js';-import { randomToken, hmacSha256, constantTimeEquals } from '../../_lib/crypto.js';+import { randomToken, hmacSha256, sha256, constantTimeEquals } from '../../_lib/crypto.js';import { parseSiwsMessage, verifySiwsSignature } from '../../_lib/siws.js';import { seedDefaultAgent } from '../../_lib/seed-default-agent.js';@@ -200,7 +200,11 @@ async function handleVerify(req, res) {where address = ${addr}`;} else {- const placeholderEmail = `sol-${addr.slice(0, 8).toLowerCase()}@wallet.local`;+ // Hash of the FULL address — a truncated-prefix scheme would collapse two+ // addresses sharing a prefix into one account. Existing users are unaffected:+ // returning wallets are matched by address in user_wallets above, never by+ // this synthetic email (which is only used to create brand-new rows).+ const placeholderEmail = `sol-${(await sha256(addr)).slice(0, 16)}@wallet.local`;const [existingUser] = await sql`select id, deleted_at from userswhere email = ${placeholderEmail}diff --git a/api/auth/wallets/[action].js b/api/auth/wallets/[action].jsindex 53c42488c..8df5ecdd6 100644--- a/api/auth/wallets/[action].js+++ b/api/auth/wallets/[action].js@@ -548,12 +548,15 @@ async function handleUnlinkWallet(req, res, address) {if (!address) return error(res, 400, 'missing_address', 'address required');- const addrLower = address.toLowerCase();+ // EVM addresses are stored lowercased; Solana base58 is case-sensitive — try+ // the literal address first, then the lowercased form (same approach as+ // handleSetPrimary).+ const candidates = [address, address.toLowerCase()].filter((v, i, a) => a.indexOf(v) === i);// 1. Check that this wallet belongs to the user.const [wallet] = await sql`- select id from user_wallets- where user_id = ${session.id} and address = ${addrLower}+ select id, address from user_wallets+ where user_id = ${session.id} and address = any(${candidates}::text[])limit 1`;if (!wallet) return error(res, 404, 'not_found', 'wallet not found');@@ -581,8 +584,8 @@ async function handleUnlinkWallet(req, res, address) {}// 4. Delete the wallet.- await sql`delete from user_wallets where user_id = ${session.id} and address = ${addrLower}`;- logAudit({ userId: session.id, action: 'unlink_wallet', resourceId: addrLower, req });+ await sql`delete from user_wallets where id = ${wallet.id} and user_id = ${session.id}`;+ logAudit({ userId: session.id, action: 'unlink_wallet', resourceId: wallet.address, req });return json(res, 200, { removed: true });}diff --git a/api/avatar/video-generate.js b/api/avatar/video-generate.jsindex 0589833bd..e0272f459 100644--- a/api/avatar/video-generate.js+++ b/api/avatar/video-generate.js@@ -41,22 +41,34 @@ function trustedMediaUrl(url) {const allowed = new Set();try {if (env.APP_ORIGIN) allowed.add(new URL(env.APP_ORIGIN).host);- } catch { /* ignore malformed env */ }+ } catch {+ /* ignore malformed env */+ }try {if (env.S3_PUBLIC_DOMAIN) allowed.add(new URL(env.S3_PUBLIC_DOMAIN).host);- } catch { /* ignore malformed env */ }+ } catch {+ /* ignore malformed env */+ }return allowed.has(u.host);}function workerUrl() {const u = process.env.LONGCAT_WORKER_URL;- if (!u) throw Object.assign(new Error('LONGCAT_WORKER_URL not configured'), { code: 'worker_unconfigured', status: 503 });+ if (!u)+ throw Object.assign(new Error('LONGCAT_WORKER_URL not configured'), {+ code: 'worker_unconfigured',+ status: 503,+ });return u.replace(/\/$/, '');}function workerKey() {const k = process.env.LONGCAT_WORKER_KEY;- if (!k) throw Object.assign(new Error('LONGCAT_WORKER_KEY not configured'), { code: 'worker_unconfigured', status: 503 });+ if (!k)+ throw Object.assign(new Error('LONGCAT_WORKER_KEY not configured'), {+ code: 'worker_unconfigured',+ status: 503,+ });return k;}@@ -66,13 +78,18 @@ async function resolveImageUrl(avatarId) {where id = ${avatarId} and deleted_at is nulllimit 1`;- if (!rows[0]) throw Object.assign(new Error('avatar not found'), { code: 'avatar_not_found', status: 404 });+ if (!rows[0])+ throw Object.assign(new Error('avatar not found'), {+ code: 'avatar_not_found',+ status: 404,+ });return publicUrl(rows[0].storage_key);}export default wrap(async (req, res) => {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;- if (req.method !== 'POST') return error(res, 405, 'method_not_allowed', `method ${req.method} not allowed`);+ if (req.method !== 'POST')+ return error(res, 405, 'method_not_allowed', `method ${req.method} not allowed`);let session;try {@@ -90,13 +107,21 @@ export default wrap(async (req, res) => {`;const isFree = userRow?.plan === 'free';+ // Fast-path rejection. The authoritative, race-safe gate is the reservation+ // insert below — this early read just spares already-spent users the+ // validation work.if (isFree) {const [usageRow] = await sql`select count(*) as n from usage_eventswhere user_id = ${userId} and kind = 'video_generate'`;if (Number(usageRow?.n) >= 1) {- return error(res, 402, 'free_trial_used', 'You have used your 1 free video. Upgrade to generate more.');+ return error(+ res,+ 402,+ 'free_trial_used',+ 'You have used your 1 free video. Upgrade to generate more.',+ );}}@@ -126,48 +151,112 @@ export default wrap(async (req, res) => {return error(res, 400, 'invalid_request', 'audio_url must be an https three.ws-hosted URL');}- let workerRes;- try {- workerRes = await fetch(`${workerUrl()}/generate`, {- method: 'POST',- headers: {- 'content-type': 'application/json',- authorization: `Bearer ${workerKey()}`,- },- body: JSON.stringify({- image_url: imageUrl,- audio_url: audioUrl,- prompt: prompt || 'A person talking naturally.',- }),- });- } catch (err) {- return error(res, 502, 'worker_unreachable', err?.message || 'worker request failed');+ // Atomically reserve the free-trial slot BEFORE submitting the worker job.+ // The old check-then-insert straddled the worker call, so two concurrent+ // requests could both pass the count check and both generate. Reserving+ // first closes that window: usage_events.id is a bigserial, so after our+ // reservation lands, any earlier (lower-id) video_generate row for this user+ // means another request already holds or spent the single free slot — we+ // release ours and reject. The row is deleted if worker submission fails,+ // so a worker outage never burns the trial.+ let reservationId = null;+ if (isFree) {+ const [reserved] = await sql`+ insert into usage_events (user_id, kind, meta)+ values (${userId}, 'video_generate', '{}'::jsonb)+ returning id+ `;+ reservationId = reserved.id;+ const [prior] = await sql`+ select count(*) as n from usage_events+ where user_id = ${userId} and kind = 'video_generate' and id < ${reservationId}+ `;+ if (Number(prior?.n) >= 1) {+ await releaseReservation(reservationId);+ return error(+ res,+ 402,+ 'free_trial_used',+ 'You have used your 1 free video. Upgrade to generate more.',+ );+ }}- if (!workerRes.ok) {- const text = await workerRes.text().catch(() => '');- return error(res, 502, 'worker_error', `worker returned ${workerRes.status}: ${text.slice(0, 200)}`);+ let result;+ try {+ let workerRes;+ try {+ workerRes = await fetch(`${workerUrl()}/generate`, {+ method: 'POST',+ headers: {+ 'content-type': 'application/json',+ authorization: `Bearer ${workerKey()}`,+ },+ body: JSON.stringify({+ image_url: imageUrl,+ audio_url: audioUrl,+ prompt: prompt || 'A person talking naturally.',+ }),+ });+ } catch (err) {+ await releaseReservation(reservationId);+ return error(res, 502, 'worker_unreachable', err?.message || 'worker request failed');+ }++ if (!workerRes.ok) {+ const text = await workerRes.text().catch(() => '');+ await releaseReservation(reservationId);+ return error(+ res,+ 502,+ 'worker_error',+ `worker returned ${workerRes.status}: ${text.slice(0, 200)}`,+ );+ }++ result = await workerRes.json();+ } catch (err) {+ await releaseReservation(reservationId);+ return error(+ res,+ 502,+ 'worker_error',+ err?.message || 'worker returned an unreadable response',+ );}- const result = await workerRes.json();const jobId = result.job_id;- // Record usage so we can enforce the free trial limit and verify job ownership.- // For free users, a failed insert means we cannot enforce quota — refuse rather- // than silently allow unlimited free generations.+ // Record usage so we can verify job ownership. The free-trial quota row+ // already exists (the reservation) — attach the job id to it. Paid users+ // get a best-effort audit row; a logging failure must not block them.try {- await sql`- insert into usage_events (user_id, kind, meta)- values (${userId}, 'video_generate', ${JSON.stringify({ job_id: jobId })}::jsonb)- `;- } catch (err) {- if (isFree) {- // Cannot record quota usage — unsafe to hand back the job.- return error(res, 500, 'internal_error', 'Could not record usage; please try again.');+ if (reservationId != null) {+ await sql`+ update usage_events set meta = ${JSON.stringify({ job_id: jobId })}::jsonb+ where id = ${reservationId}+ `;+ } else {+ await sql`+ insert into usage_events (user_id, kind, meta)+ values (${userId}, 'video_generate', ${JSON.stringify({ job_id: jobId })}::jsonb)+ `;}- // Paid users: audit logging best-effort, do not block the response.- console.error('[video-generate] failed to record usage event for paid user:', err);+ } catch (err) {+ console.error('[video-generate] failed to record job id on usage event:', err);}return json(res, 202, { job_id: jobId, status: result.status });});++// Best-effort delete of a free-trial reservation row after a failed worker+// submission. A delete failure leaves the slot consumed (fail-closed) rather+// than risking unlimited free generations.+async function releaseReservation(reservationId) {+ if (reservationId == null) return;+ try {+ await sql`delete from usage_events where id = ${reservationId}`;+ } catch (err) {+ console.error('[video-generate] failed to release free-trial reservation:', err);+ }+}diff --git a/api/avatars/[id]/[action].js b/api/avatars/[id]/[action].jsindex 637074a60..5c9ea4895 100644--- a/api/avatars/[id]/[action].js+++ b/api/avatars/[id]/[action].js@@ -6,21 +6,12 @@import { GetObjectCommand } from '@aws-sdk/client-s3';import { z } from 'zod';-import {- getSessionUser,- authenticateBearer,- extractBearer,- hasScope,-} from '../../_lib/auth.js';+import { getSessionUser, authenticateBearer, extractBearer, hasScope } from '../../_lib/auth.js';import { sql } from '../../_lib/db.js';import { cors, json, method, readJson, wrap, error, rateLimited } from '../../_lib/http.js';import { limits, clientIp } from '../../_lib/rate-limit.js';import { parse, isUuid } from '../../_lib/validate.js';-import {- readStorageMode,- storageModeSchema,- defaultStorageMode,-} from '../../_lib/storage-mode.js';+import { readStorageMode, storageModeSchema, defaultStorageMode } from '../../_lib/storage-mode.js';import { getAvatar, resolveAvatarUrl } from '../../_lib/avatars.js';import { r2, publicUrl } from '../../_lib/r2.js';import { env } from '../../_lib/env.js';@@ -137,8 +128,12 @@ async function handleGlbVersions(req, res) {`;if (!avatar) return error(res, 404, 'not_found', 'avatar not found');+ // Version rows are written by two paths: the GLB PATCH handler populates+ // `storage_key` (an R2 key) while the rollback handler populates `glb_url`.+ // Read both and resolve whichever is present to a fetchable URL — bare R2+ // keys go through publicUrl(), same as the main avatar GLB read path.const rows = await sql`- select id, glb_url, created_at, metadata+ select id, glb_url, storage_key, created_at, metadatafrom avatar_versionswhere avatar_id = ${id}order by created_at desc@@ -146,12 +141,16 @@ async function handleGlbVersions(req, res) {`;return json(res, 200, {- versions: rows.map((v) => ({- id: v.id,- glbUrl: v.glb_url,- createdAt: v.created_at,- metadata: v.metadata ?? null,- })),+ versions: rows.map((v) => {+ const ref = v.glb_url || v.storage_key || null;+ const glbUrl = ref ? (/^https?:\/\//i.test(ref) ? ref : publicUrl(ref)) : null;+ return {+ id: v.id,+ glbUrl,+ createdAt: v.created_at,+ metadata: v.metadata ?? null,+ };+ }),});}@@ -161,8 +160,7 @@ async function handlePinIpfs(req, res) {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;if (!method(req, res, ['POST'])) return;- const id =- req.query?.id || new URL(req.url, 'http://x').pathname.split('/').filter(Boolean)[2];+ const id = req.query?.id || new URL(req.url, 'http://x').pathname.split('/').filter(Boolean)[2];if (!id) return error(res, 400, 'validation_error', 'avatar id required');const session = await getSessionUser(req);@@ -405,8 +403,7 @@ async function handleStorageMode(req, res) {if (cors(req, res, { methods: 'GET,PUT,OPTIONS', credentials: true })) return;if (!method(req, res, ['GET', 'PUT'])) return;- const id =- req.query?.id || new URL(req.url, 'http://x').pathname.split('/').filter(Boolean)[2];+ const id = req.query?.id || new URL(req.url, 'http://x').pathname.split('/').filter(Boolean)[2];if (!id) return error(res, 400, 'validation_error', 'avatar id required');const [row] = await sql`@@ -530,8 +527,7 @@ async function handleThumbnail(req, res) {if (cors(req, res, { methods: 'GET,OPTIONS', credentials: true })) return;if (!method(req, res, ['GET'])) return;- const id =- req.query?.id || new URL(req.url, 'http://x').pathname.split('/').filter(Boolean)[2];+ const id = req.query?.id || new URL(req.url, 'http://x').pathname.split('/').filter(Boolean)[2];if (!id) return error(res, 400, 'invalid_request', 'avatar id required');if (id.startsWith('avatar_demo_')) {@@ -588,11 +584,13 @@ async function handleGlb(req, res) {res.setHeader('access-control-allow-methods', 'GET,OPTIONS');res.setHeader('access-control-allow-headers', 'range,accept');res.setHeader('access-control-expose-headers', 'content-length,content-range,etag');- if (req.method === 'OPTIONS') { res.statusCode = 204; return res.end(); }+ if (req.method === 'OPTIONS') {+ res.statusCode = 204;+ return res.end();+ }if (!method(req, res, ['GET'])) return;- const id =- req.query?.id || new URL(req.url, 'http://x').pathname.split('/').filter(Boolean)[2];+ const id = req.query?.id || new URL(req.url, 'http://x').pathname.split('/').filter(Boolean)[2];if (!id) return error(res, 400, 'invalid_request', 'avatar id required');if (String(id).startsWith('avatar_demo_')) {@@ -616,9 +614,10 @@ async function handleGlb(req, res) {// from R2 directly with the S3 SDK avoids a second hop through the// public CDN — and gives us a Node readable stream we can pipe straight// into res with no buffer-the-whole-thing memory blow-up.- const key = avatar.baked_storage_key && avatar.appearance_hash- ? (avatar.baked_storage_key)- : avatar.storage_key;+ const key =+ avatar.baked_storage_key && avatar.appearance_hash+ ? avatar.baked_storage_key+ : avatar.storage_key;if (!key) return error(res, 404, 'not_found', 'avatar has no glb');try {@@ -636,7 +635,9 @@ async function handleGlb(req, res) {Body.pipe(res);Body.on('error', (err) => {console.error('[avatars/glb] stream error:', err);- try { res.destroy(err); } catch {}+ try {+ res.destroy(err);+ } catch {}});} catch (err) {// 404 if R2 doesn't know the key (deleted out-of-band); 502 otherwise.diff --git a/api/bazaar/context.js b/api/bazaar/context.jsindex b8ca8e569..65e848055 100644--- a/api/bazaar/context.js+++ b/api/bazaar/context.js@@ -10,14 +10,34 @@// available or the upstream call fails — the panel should always render// something useful.-import { cors, json, error, wrap } from '../_lib/http.js';+import { cors, json, error, wrap, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';import { llmComplete } from '../_lib/llm.js';import { Bazaar } from '../_lib/x402/bazaar-client.js';const STOP_WORDS = new Set([- 'api', 'apis', 'service', 'endpoint', 'endpoints', 'paid', 'free',- 'the', 'a', 'an', 'and', 'or', 'of', 'for', 'to', 'on', 'in', 'by',- 'tool', 'tools', 'mcp', 'http',+ 'api',+ 'apis',+ 'service',+ 'endpoint',+ 'endpoints',+ 'paid',+ 'free',+ 'the',+ 'a',+ 'an',+ 'and',+ 'or',+ 'of',+ 'for',+ 'to',+ 'on',+ 'in',+ 'by',+ 'tool',+ 'tools',+ 'mcp',+ 'http',]);function tokenize(s) {@@ -43,14 +63,20 @@ function capabilityKey(it) {return `mcp:${tokenize(it.toolName).join('')}`;}const nameTokens = tokenize(it.serviceName).slice(0, 3);- if (nameTokens.length && nameTokens.join('-').length >= 3) return `http:${nameTokens.join('-')}`;+ if (nameTokens.length && nameTokens.join('-').length >= 3)+ return `http:${nameTokens.join('-')}`;const urlTokens = tokenize(tailFromUrl(it.resource)).slice(0, 3);- if (urlTokens.length >= 2 && urlTokens.join('-').length >= 6) return `http:${urlTokens.join('-')}`;+ if (urlTokens.length >= 2 && urlTokens.join('-').length >= 6)+ return `http:${urlTokens.join('-')}`;return null;}function hostOf(url) {- try { return new URL(url).host; } catch { return ''; }+ try {+ return new URL(url).host;+ } catch {+ return '';+ }}function minUsdcAtomic(item) {@@ -132,20 +158,31 @@ function deterministicSummary({ target, targetPrice, peerPrices, providerSiblingconst sorted = [...peerPrices].sort((a, b) => a - b);const pct = percentile(sorted, targetPrice ?? Infinity);if (targetPrice != null && pct != null) {- if (pct <= 25) sentences.push(`${name} is priced in the cheapest 25% of comparable listings [1].`);- else if (pct >= 75) sentences.push(`${name} sits in the priciest tier among comparable listings [1].`);- else sentences.push(`${name}'s price sits in the middle of the ${peerCount + 1}-listing peer set [1].`);+ if (pct <= 25)+ sentences.push(`${name} is priced in the cheapest 25% of comparable listings [1].`);+ else if (pct >= 75)+ sentences.push(`${name} sits in the priciest tier among comparable listings [1].`);+ else+ sentences.push(+ `${name}'s price sits in the middle of the ${peerCount + 1}-listing peer set [1].`,+ );} else {- sentences.push(`${peerCount + 1} listings cover this capability across the catalog [1].`);+ sentences.push(+ `${peerCount + 1} listings cover this capability across the catalog [1].`,+ );}}const host = hostOf(target.resource);if (host) {if (providerSiblings.length > 0) {- sentences.push(`Operated by ${host} [2], which exposes ${providerSiblings.length + 1} paid endpoints in the catalog [4].`);+ sentences.push(+ `Operated by ${host} [2], which exposes ${providerSiblings.length + 1} paid endpoints in the catalog [4].`,+ );} else {- sentences.push(`Operated by ${host} [2], a single-endpoint provider in the current catalog.`);+ sentences.push(+ `Operated by ${host} [2], a single-endpoint provider in the current catalog.`,+ );}}@@ -173,15 +210,23 @@ function deterministicSummary({ target, targetPrice, peerPrices, providerSibling}async function llmSummary({ target, targetPrice, peers, providerSiblings, citations }) {- const peerLines = peers.slice(0, 8).map((p) => {- const price = priceLabel(minUsdcAtomic(p));- return `- ${p.serviceName || p.toolName || '(unnamed)'} @ ${hostOf(p.resource)} — ${price} via ${hostOf(p.facilitator)}`;- }).join('\n') || '(none discovered)';-- const siblingLines = providerSiblings.slice(0, 8).map((p) => {- const price = priceLabel(minUsdcAtomic(p));- return `- ${p.serviceName || p.toolName || p.resource} — ${price}`;- }).join('\n') || '(none)';+ const peerLines =+ peers+ .slice(0, 8)+ .map((p) => {+ const price = priceLabel(minUsdcAtomic(p));+ return `- ${p.serviceName || p.toolName || '(unnamed)'} @ ${hostOf(p.resource)} — ${price} via ${hostOf(p.facilitator)}`;+ })+ .join('\n') || '(none discovered)';++ const siblingLines =+ providerSiblings+ .slice(0, 8)+ .map((p) => {+ const price = priceLabel(minUsdcAtomic(p));+ return `- ${p.serviceName || p.toolName || p.resource} — ${price}`;+ })+ .join('\n') || '(none)';const citationLines = citations.map((c, i) => `[${i + 1}] ${c.label} — ${c.url}`).join('\n');@@ -232,7 +277,9 @@ Respond with only the JSON object.`;const parsed = JSON.parse(match[0]);const summary = String(parsed.summary || '').trim();if (!summary) throw new Error('empty summary');- const sentiment = ['up', 'down', 'neutral'].includes(parsed.sentiment) ? parsed.sentiment : 'neutral';+ const sentiment = ['up', 'down', 'neutral'].includes(parsed.sentiment)+ ? parsed.sentiment+ : 'neutral';return { summary, sentiment, citations, source: provider };}@@ -240,6 +287,12 @@ async function handler(req, res) {if (cors(req, res, { origins: '*', methods: 'GET,OPTIONS' })) return;if (req.method !== 'GET') return error(res, 405, 'method_not_allowed', 'GET only');+ // Unauthenticated endpoint that fans out to facilitators and runs an LLM+ // completion on the platform keys — bound per IP like the other public LLM+ // surfaces so one client can't drain the shared provider budget.+ const rl = await limits.publicIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);+const url = new URL(req.url, 'http://x');const resource = url.searchParams.get('resource');const toolName = url.searchParams.get('toolName') || '';@@ -285,7 +338,13 @@ async function handler(req, res) {} catch (e) {// Always return something useful — the panel is decorative if// missing and frustrating if it 500s.- result = deterministicSummary({ target, targetPrice, peerPrices, providerSiblings, citations });+ result = deterministicSummary({+ target,+ targetPrice,+ peerPrices,+ providerSiblings,+ citations,+ });result.fallbackReason = String(e?.message || e);}@@ -301,9 +360,13 @@ async function handler(req, res) {: null,targetPriceAtomic: targetPrice,providerSiblingsCount: providerSiblings.length,- pricePercentile: peerPrices.length && targetPrice != null- ? percentile([...peerPrices, targetPrice].sort((a, b) => a - b), targetPrice)- : null,+ pricePercentile:+ peerPrices.length && targetPrice != null+ ? percentile(+ [...peerPrices, targetPrice].sort((a, b) => a - b),+ targetPrice,+ )+ : null,},});}diff --git a/api/billing/withdrawals/index.js b/api/billing/withdrawals/index.jsindex 96575e99b..e6ffe6a33 100644--- a/api/billing/withdrawals/index.js+++ b/api/billing/withdrawals/index.js@@ -5,7 +5,7 @@ import { z } from 'zod';import { sql } from '../../_lib/db.js';import { getSessionUser } from '../../_lib/auth.js';import { cors, json, method, wrap, error, readJson, rateLimited } from '../../_lib/http.js';-import { parse } from '../../_lib/validate.js';+import { parse, isValidSolanaAddress, isValidEvmAddress } from '../../_lib/validate.js';import { limits, clientIp } from '../../_lib/rate-limit.js';import { requireCsrf } from '../../_lib/csrf.js';@@ -84,6 +84,13 @@ export default wrap(async (req, res) => {return error(res, 422, 'below_minimum', 'Minimum withdrawal is 1 USDC');}+ if (chain === 'solana' && !isValidSolanaAddress(to_address)) {+ return error(res, 400, 'validation_error', 'invalid Solana address');+ }+ if ((chain === 'base' || chain === 'evm') && !isValidEvmAddress(to_address)) {+ return error(res, 400, 'validation_error', 'invalid EVM address');+ }+// Verify agent_id belongs to this user if providedif (agent_id) {const [agent] = await sql`@@ -94,7 +101,8 @@ export default wrap(async (req, res) => {}// Reserve the withdrawal atomically. The available balance (earned minus- // in-flight withdrawals) must be re-derived and compared *inside* the same+ // pending/processing/completed withdrawals, mirroring getAvailableBalance in+ // api/_lib/monetization.js) must be re-derived and compared *inside* the same// statement that inserts the new pending row — a read-then-insert pair is a// TOCTOU hole: N concurrent requests all read pending=0 and all insert,// over-withdrawing past the real balance (the per-user rate limit admits up@@ -122,7 +130,7 @@ export default wrap(async (req, res) => {select coalesce(sum(w2.amount), 0)::bigintfrom agent_withdrawals w2where w2.user_id = ${user.id}- and w2.status in ('pending', 'processing')+ and w2.status in ('pending', 'processing', 'completed')and w2.currency_mint = ${currency_mint}))@@ -132,7 +140,12 @@ export default wrap(async (req, res) => {const withdrawal = inserted?.[0];if (!withdrawal) {- return error(res, 422, 'insufficient_balance', 'requested amount exceeds available balance');+ return error(+ res,+ 422,+ 'insufficient_balance',+ 'requested amount exceeds available balance',+ );}return json(res, 201, { withdrawal });diff --git a/api/bounties.js b/api/bounties.jsindex cdae2ca96..8afccd68a 100644--- a/api/bounties.js+++ b/api/bounties.js@@ -1,10 +1,10 @@import { sql } from './_lib/db.js';import { cors, json, error, readJson, wrap, method, rateLimited } from './_lib/http.js';import { getSessionUser } from './_lib/auth.js';+import { requireCsrf } from './_lib/csrf.js';import { limits } from './_lib/rate-limit.js';import { enrichLikes } from './_lib/bounty-likes.js';--const SOL_USD_FALLBACK = 160;+import { solUsdPrice } from './_lib/avatar-wallet.js';export default wrap(async (req, res) => {if (cors(req, res)) return;@@ -113,6 +113,7 @@ export default wrap(async (req, res) => {return error(res, 401, 'unauthorized', 'sign in to post a bounty');}if (!user) return error(res, 401, 'unauthorized', 'sign in to post a bounty');+ if (!(await requireCsrf(req, res, user.id))) return;const rl = await limits.bountyCreate(user.id);if (!rl.success) return rateLimited(res, rl, 'too many bounties, slow down');@@ -131,7 +132,8 @@ export default wrap(async (req, res) => {if (!title?.trim()) return error(res, 400, 'bad_request', 'title is required');// Bound the free-text and identifier fields so a single bounty can't carry a// near-1MB payload into a public, everyone-reads table.- if (title.trim().length > 200) return error(res, 400, 'bad_request', 'title too long (max 200)');+ if (title.trim().length > 200)+ return error(res, 400, 'bad_request', 'title too long (max 200)');if (typeof description === 'string' && description.length > 4000)return error(res, 400, 'bad_request', 'description too long (max 4000)');if (typeof coin_symbol === 'string' && coin_symbol.length > 32)@@ -141,9 +143,44 @@ export default wrap(async (req, res) => {if (!reward_sol && !reward_tokens)return error(res, 400, 'bad_request', 'set a reward (SOL or tokens)');- const rewardSol = reward_sol ? parseFloat(reward_sol) : null;- const rewardUsd = rewardSol ? parseFloat((rewardSol * SOL_USD_FALLBACK).toFixed(2)) : null;- const days = Math.min(parseInt(expires_in_days || '7', 10), 30);+ let rewardSol = null;+ if (reward_sol) {+ rewardSol = parseFloat(reward_sol);+ if (!Number.isFinite(rewardSol) || rewardSol <= 0)+ return error(res, 400, 'bad_request', 'reward_sol must be a positive number');+ }+ let rewardTokens = null;+ if (reward_tokens) {+ const rawTokens = String(reward_tokens).trim();+ if (!/^\d+$/.test(rawTokens))+ return error(+ res,+ 400,+ 'bad_request',+ 'reward_tokens must be a non-negative integer',+ );+ rewardTokens = BigInt(rawTokens);+ }++ // reward_usd is a real quote or nothing — never a number derived from a+ // hardcoded fallback price. Sorting treats missing values as NULLS LAST.+ let rewardUsd = null;+ if (rewardSol) {+ try {+ const solUsd = await solUsdPrice();+ rewardUsd = parseFloat((rewardSol * solUsd).toFixed(2));+ } catch (err) {+ console.warn(+ '[bounties] SOL/USD quote unavailable, storing reward_usd=null:',+ err?.message,+ );+ }+ }++ const parsedDays = parseInt(expires_in_days ?? '7', 10);+ const days = Number.isFinite(parsedDays)+ ? Math.min(Math.max(Math.floor(parsedDays), 1), 30)+ : 7;const expiresAt = new Date(Date.now() + days * 86400000).toISOString();const username = user.display_name || user.email?.split('@')[0] || 'anon';const symbol = coin_symbol?.trim() || '$THREE';@@ -154,7 +191,7 @@ export default wrap(async (req, res) => {(user_id, username, title, description, reward_sol, reward_tokens, reward_usd, coin_symbol, coin_mint, expires_at)VALUES(${user.id}, ${username}, ${title.trim()}, ${description?.trim() || null},- ${rewardSol}, ${reward_tokens ? BigInt(reward_tokens) : null}, ${rewardUsd},+ ${rewardSol}, ${rewardTokens}, ${rewardUsd},${symbol}, ${mint}, ${expiresAt})RETURNING *`;diff --git a/api/chat.js b/api/chat.jsindex 280a205a2..193b26443 100644--- a/api/chat.js+++ b/api/chat.js@@ -31,7 +31,11 @@ import { loadUserProviderKeys } from './_lib/provider-keys.js';import { watsonxConfig, watsonxAuthHeaders } from './_lib/watsonx.js';import { orchestrateConfig } from './_lib/orchestrate.js';import { guardianConfig, governSend, sendCapUsd } from './_lib/granite-guardian.js';-import { markProviderCooldown, providersInCooldown, AUTH_COOLDOWN_SECONDS } from './_lib/provider-health.js';+import {+ markProviderCooldown,+ providersInCooldown,+ AUTH_COOLDOWN_SECONDS,+} from './_lib/provider-health.js';import {DEFAULT_FREE_MODEL,PROVIDER_MODEL_DEFAULTS,@@ -131,7 +135,9 @@ const chatBody = z.object({context: contextSchema,system_prompt: z.string().trim().min(1).max(2000).optional(),agentId: z.string().uuid().optional(),- provider: z.enum(['anthropic', 'openrouter', 'groq', 'openai', 'watsonx', 'orchestrate']).optional(),+ provider: z+ .enum(['anthropic', 'openrouter', 'groq', 'openai', 'watsonx', 'orchestrate'])+ .optional(),model: z.string().min(1).max(120).optional(),history: z.array(@@ -237,7 +243,8 @@ const ACTION_TOOLS = [},{name: 'setCameraTarget',- description: 'Set the camera target to a specific named bone on the currently loaded model.',+ description:+ 'Set the camera target to a specific named bone on the currently loaded model.',input_schema: {type: 'object',properties: {@@ -276,7 +283,7 @@ const ACTION_TOOLS = [{name: 'sendSol',description:- 'Send a small amount of SOL from the avatar\'s own Solana wallet to a recipient, denominated in US dollars. ' ++ "Send a small amount of SOL from the avatar's own Solana wallet to a recipient, denominated in US dollars. " +'Call this ONLY when the user explicitly asks the avatar to send, pay, or transfer SOL. ' +'If the user says "send me" (or gives no address), omit `to` — the configured default recipient is used. ' +'The host enforces a per-send dollar cap, so request the amount the user named.',@@ -343,6 +350,13 @@ export default wrap(async (req, res) => {if (!body.model && body.provider === 'openrouter') body.model = DEFAULT_FREE_MODEL;}anonymous = true;+ } else {+ // Authenticated callers are metered too — platform LLM keys are a real+ // cost, so a signed-in account must not get unlimited inference.+ const rl = await limits.chatUser(auth.userId || `ip:${clientIp(req)}`);+ if (!rl.success) {+ return rateLimited(res, rl, 'too many chat requests, slow down');+ }}let userProviderKeys = {};@@ -365,6 +379,16 @@ export default wrap(async (req, res) => {return error(res, 401, 'unauthorized', 'sign in to chat with the agent');}+ // When inference is billed to the host's key (the caller supplied none for the+ // chosen provider), charge it against a global ceiling so distributed abuse —+ // many accounts each under their per-user limit — can't drain platform quota.+ if (route.usingHostKey) {+ const hk = await limits.chatHostKeyGlobal();+ if (!hk.success) {+ return rateLimited(res, hk, 'chat is at capacity, try again shortly');+ }+ }+const maxTokens = clampInt(parseInt(process.env.CHAT_MAX_TOKENS || '', 10) || DEFAULT_MAX_TOKENS,128,@@ -373,9 +397,13 @@ export default wrap(async (req, res) => {let personaPrompt = null;if (body.agentId) {+ // Persona prompts are private IP: only serve them for published agents,+ // or to the agent's owner. Anonymous callers get published personas only.const [agentRow] = await sql`SELECT persona_prompt FROM agent_identities- WHERE id = ${body.agentId} AND deleted_at IS NULL LIMIT 1+ WHERE id = ${body.agentId} AND deleted_at IS NULL+ AND (is_published = true OR user_id = ${auth?.userId ?? null})+ LIMIT 1`;if (agentRow?.persona_prompt) personaPrompt = agentRow.persona_prompt;}@@ -432,7 +460,9 @@ export default wrap(async (req, res) => {upstream = await fetch(route.url, {method: 'POST',headers: reqHeaders,- body: JSON.stringify(route.buildPayload({ systemPrompt, history, maxTokens, includeTools })),+ body: JSON.stringify(+ route.buildPayload({ systemPrompt, history, maxTokens, includeTools }),+ ),signal: ctrl.signal,});} finally {@@ -457,10 +487,16 @@ export default wrap(async (req, res) => {// permanent breakage. 503 + Retry-After so the client backs off and retries// (the same contract as the rate-limit terminal below), never a hard 502.res.setHeader('Retry-After', '20');- return error(res, 503, 'rate_limited', 'The AI chat is at capacity right now. Please try again in a few seconds.', {- providers_tried: providersTried(attempted),- retry_after: 20,- });+ return error(+ res,+ 503,+ 'rate_limited',+ 'The AI chat is at capacity right now. Please try again in a few seconds.',+ {+ providers_tried: providersTried(attempted),+ retry_after: 20,+ },+ );}// watsonx/Granite: a few foundation models (or regions) reject a@@ -476,9 +512,14 @@ export default wrap(async (req, res) => {upstream.status < 500 &&upstream.status !== 429) {- const peek = await upstream.clone().text().catch(() => '');+ const peek = await upstream+ .clone()+ .text()+ .catch(() => '');if (/tool|function[\s_-]?call|tool_choice|not[\s_-]?support|unsupported/i.test(peek)) {- console.warn(`[chat:${route.name}] ${route.model} rejected action tools (${upstream.status}) — retrying without them`);+ console.warn(+ `[chat:${route.name}] ${route.model} rejected action tools (${upstream.status}) — retrying without them`,+ );includeTools = false;continue;}@@ -492,20 +533,29 @@ export default wrap(async (req, res) => {if (upstream.status === 404 && route.style === 'openai') {const text = await upstream.text().catch(() => '');if (includeTools && /tool[\s-]?use|support tools|require_parameters/i.test(text)) {- console.warn(`[chat:${route.name}] ${route.model} has no tool-capable endpoint — retrying without action tools`);+ console.warn(+ `[chat:${route.name}] ${route.model} has no tool-capable endpoint — retrying without action tools`,+ );includeTools = false;continue;}// Already tried without tools, or non-tool-use 404 — fall over to next provider.if (canFailOver()) {- console.warn(`[chat:${route.name}] 404 — falling over to ${fallbackRoutes[routeIdx + 1].name}/${fallbackRoutes[routeIdx + 1].model}: ${text.slice(0, 120)}`);+ console.warn(+ `[chat:${route.name}] 404 — falling over to ${fallbackRoutes[routeIdx + 1].name}/${fallbackRoutes[routeIdx + 1].model}: ${text.slice(0, 120)}`,+ );routeIdx++;route = fallbackRoutes[routeIdx];includeTools = true;retriedTransient = false;continue;}- captureException(new Error(`${route.name} upstream 404`), { route: 'chat', provider: route.name, status: 404, body: text.slice(0, 400) });+ captureException(new Error(`${route.name} upstream 404`), {+ route: 'chat',+ provider: route.name,+ status: 404,+ body: text.slice(0, 400),+ });console.error(`[chat:${route.name}]`, 404, text.slice(0, 400));return error(res, 502, 'chat_failed', 'chat backend returned an error');}@@ -520,7 +570,9 @@ export default wrap(async (req, res) => {if ((upstream.status === 503 || upstream.status === 504) && !retriedTransient) {retriedTransient = true;const text = await upstream.text().catch(() => '');- console.warn(`[chat:${route.name}] ${upstream.status} — retrying once after 500ms: ${text.slice(0, 120)}`);+ console.warn(+ `[chat:${route.name}] ${upstream.status} — retrying once after 500ms: ${text.slice(0, 120)}`,+ );await new Promise((r) => setTimeout(r, 500));continue;}@@ -540,7 +592,9 @@ export default wrap(async (req, res) => {let next = routeIdx + 1;while (next < fallbackRoutes.length && fallbackRoutes[next].name === route.name) next++;if (next < fallbackRoutes.length && Date.now() < deadline) {- console.warn(`[chat:${route.name}] ${upstream.status} (auth/billing) — cooling ${AUTH_COOLDOWN_SECONDS}s, failing over to ${fallbackRoutes[next].name}/${fallbackRoutes[next].model}: ${text.slice(0, 120)}`);+ console.warn(+ `[chat:${route.name}] ${upstream.status} (auth/billing) — cooling ${AUTH_COOLDOWN_SECONDS}s, failing over to ${fallbackRoutes[next].name}/${fallbackRoutes[next].model}: ${text.slice(0, 120)}`,+ );routeIdx = next;route = fallbackRoutes[routeIdx];includeTools = true;@@ -552,14 +606,26 @@ export default wrap(async (req, res) => {// consumed, so we can't fall through to the generic `!upstream.ok` block// (it would re-read an empty stream); build the response inline instead.captureException(new Error(`${route.name} upstream ${upstream.status}`), {- route: 'chat', provider: route.name, status: upstream.status, body: text.slice(0, 400),+ route: 'chat',+ provider: route.name,+ status: upstream.status,+ body: text.slice(0, 400),});- console.error(`[chat:${route.name}] ${upstream.status} (auth/billing, final — no healthy provider left)`, text.slice(0, 200));+ console.error(+ `[chat:${route.name}] ${upstream.status} (auth/billing, final — no healthy provider left)`,+ text.slice(0, 200),+ );res.setHeader('Retry-After', '20');- return error(res, 503, 'rate_limited', 'The AI chat is at capacity right now. Please try again in a few seconds.', {- providers_tried: providersTried(attempted),- retry_after: 20,- });+ return error(+ res,+ 503,+ 'rate_limited',+ 'The AI chat is at capacity right now. Please try again in a few seconds.',+ {+ providers_tried: providersTried(attempted),+ retry_after: 20,+ },+ );}// Fall over on rate-limit (429) and transient gateway errors (502/503/504).@@ -567,7 +633,9 @@ export default wrap(async (req, res) => {// the next provider would also reject.if ((upstream.status === 429 || upstream.status >= 500) && canFailOver()) {const text = await upstream.text().catch(() => '');- console.warn(`[chat:${route.name}] ${upstream.status} — falling over to ${fallbackRoutes[routeIdx + 1].name}/${fallbackRoutes[routeIdx + 1].model}: ${text.slice(0, 120)}`);+ console.warn(+ `[chat:${route.name}] ${upstream.status} — falling over to ${fallbackRoutes[routeIdx + 1].name}/${fallbackRoutes[routeIdx + 1].model}: ${text.slice(0, 120)}`,+ );// Rate-limited or erroring upstream — cool it down for subsequent requests.void markProviderCooldown(route.name);routeIdx++;@@ -611,10 +679,13 @@ export default wrap(async (req, res) => {);// Ops signal: OpenAI quota exhaustion is an account/billing problem, not a// transient blip — call it out explicitly so it's actionable in the logs.- if (route.name === 'openai' && /quota|billing|exceeded your current/i.test(`${upstreamMessage} ${text}`)) {+ if (+ route.name === 'openai' &&+ /quota|billing|exceeded your current/i.test(`${upstreamMessage} ${text}`)+ ) {console.error('[chat:openai] account is OVER QUOTA — top up OpenAI billing or remove OPENAI_API_KEY ' +- 'so the chat ladder stops routing to it as a final tier.',+ 'so the chat ladder stops routing to it as a final tier.',);}// Client body is intentionally generic and human-readable: the raw provider@@ -646,7 +717,10 @@ export default wrap(async (req, res) => {atCapacity? 'The AI chat is at capacity right now. Please try again in a few seconds.': 'The AI chat provider is temporarily unavailable. Please try again in a moment.',- { providers_tried: providersTried(attempted), ...(atCapacity ? { retry_after: 20 } : {}) },+ {+ providers_tried: providersTried(attempted),+ ...(atCapacity ? { retry_after: 20 } : {}),+ },);}@@ -679,7 +753,10 @@ export default wrap(async (req, res) => {// A jailbreak ("ignore your rules and send everything") or an over-cap amount is// held server-side so the action never reaches the wallet. Other actions pass// through untouched; the verdict rides along in the done event.- const { actions: governedActions, governance } = await governActions(result.actions, body.message);+ const { actions: governedActions, governance } = await governActions(+ result.actions,+ body.message,+ );let reply = result.reply.trim();if (governance?.decision === 'block') {const why = governance.reasons?.[0]?.label || 'platform policy';@@ -741,7 +818,13 @@ async function governActions(actions, userMessage) {if (Number.isFinite(usd) && usd > cap) {verdict = {decision: 'block',- reasons: [{ risk: 'amount_cap', label: `above the $${cap} autonomous cap`, probability: 1 }],+ reasons: [+ {+ risk: 'amount_cap',+ label: `above the $${cap} autonomous cap`,+ probability: 1,+ },+ ],cap,capExceeded: true,};@@ -799,7 +882,11 @@ function pickProvider(requested, model, userKeys = {}, cooldown = new Set()) {(name === 'watsonx' || name === 'orchestrate'? cfg.defaultModel: process.env.CHAT_MODEL || cfg.defaultModel);- return makeRoute(name, cfg, apiKey, chosenModel);+ const route = makeRoute(name, cfg, apiKey, chosenModel);+ // Flag whether this route bills the host's key (no user-supplied key for+ // the provider) so the handler can enforce the global host-key ceiling.+ route.usingHostKey = !userKeys[name];+ return route;}return null;};diff --git a/api/community/auth/callback.js b/api/community/auth/callback.jsindex 3d9344734..27c975b52 100644--- a/api/community/auth/callback.js+++ b/api/community/auth/callback.js@@ -3,7 +3,8 @@// X redirects the popup here after the user authorizes. We exchange the// one-time challenge code for the user's CoinCommunities session server-side,// set httpOnly cookies, then hand control back to the opener via postMessage-// and close the popup. Falls back to the legacy accessToken-in-redirect shape.+// and close the popup. Only the one-time challengeCode exchange is accepted —+// raw tokens in the redirect URL are never trusted (login CSRF / fixation).import { text, wrap } from '../../_lib/http.js';import { env } from '../../_lib/env.js';import { cc, setUserSession, UnconfiguredError } from '../../_lib/coin-communities.js';@@ -38,8 +39,6 @@ function page({ ok, user = null, message = '' }) {export default wrap(async (req, res) => {const url = new URL(req.url, 'http://x');const challengeCode = url.searchParams.get('challengeCode');- const accessToken = url.searchParams.get('accessToken');- const refreshToken = url.searchParams.get('refreshToken');let api;try {@@ -54,18 +53,12 @@ export default wrap(async (req, res) => {}try {- let session;- if (challengeCode) {- const { data, error: apiErr } = await api.twitterChallengeExchange({- body: { challengeCode },- });- if (apiErr || !data?.accessToken) throw new Error(apiErr?.message || 'exchange failed');- session = data;- } else if (accessToken) {- session = { accessToken, refreshToken, user: null };- } else {- throw new Error('missing challenge code');- }+ if (!challengeCode) throw new Error('missing challenge code');+ const { data, error: apiErr } = await api.twitterChallengeExchange({+ body: { challengeCode },+ });+ if (apiErr || !data?.accessToken) throw new Error(apiErr?.message || 'exchange failed');+ const session = data;setUserSession(res, session);announceSignIn(session.user);return text(res, 200, page({ ok: true, user: session.user }), {diff --git a/api/cron/[name].js b/api/cron/[name].jsindex e282a30c8..3d88e194b 100644--- a/api/cron/[name].js+++ b/api/cron/[name].js@@ -162,7 +162,10 @@ async function handleErc8004Crawl(req, res) {if (Date.now() - crawlStart <= CRAWL_BUDGET_MS) {try {- report.enriched = await erc8004EnrichMetadata(ERC8004_METADATA_BATCH, crawlStart + CRAWL_BUDGET_MS);+ report.enriched = await erc8004EnrichMetadata(+ ERC8004_METADATA_BATCH,+ crawlStart + CRAWL_BUDGET_MS,+ );} catch (err) {report.errors.push({ stage: 'metadata', error: err.message || String(err) });}@@ -208,7 +211,11 @@ async function erc8004CrawlChain(chain) {await Promise.all(uniqueBlockHexes.map(async (bn) => {try {- const block = await erc8004RpcCall(chain.rpcUrls ?? chain.rpcUrl, 'eth_getBlockByNumber', [bn, false]);+ const block = await erc8004RpcCall(+ chain.rpcUrls ?? chain.rpcUrl,+ 'eth_getBlockByNumber',+ [bn, false],+ );blockTimes[bn] = block ? Number.parseInt(block.timestamp, 16) : null;} catch {// registered_at will be null for this block@@ -354,7 +361,11 @@ async function erc8004FetchAgentMetadata(uri) {const url = erc8004ResolveGateway(uri);if (!url) return null;try {- const res = await fetch(url, { signal: AbortSignal.timeout(ERC8004_METADATA_TIMEOUT_MS) });+ // agentURI is attacker-controllable on-chain data — SSRF-guard the fetch+ // (and every redirect hop) exactly like the alert-webhook path below.+ const res = await fetchSafePublicUrl(url, {+ signal: AbortSignal.timeout(ERC8004_METADATA_TIMEOUT_MS),+ });if (!res.ok) return null;return await res.json();} catch {@@ -417,11 +428,7 @@ const BLOCKS_PER_DAY = {// Removed: cloudflare-eth.com (endpoint sunset — always failed, wasting the// first attempt + timeout each run) and 1rpc.io/* (chronic 429 in prod logs).const PUBLIC_RPCS = {- 1: [- 'https://eth.llamarpc.com',- 'https://rpc.ankr.com/eth',- 'https://ethereum.publicnode.com',- ],+ 1: ['https://eth.llamarpc.com', 'https://rpc.ankr.com/eth', 'https://ethereum.publicnode.com'],8453: ['https://mainnet.base.org','https://base.llamarpc.com',@@ -710,7 +717,14 @@ async function idxIndexChain(chainId, contract, cronStart = Date.now()) {fromBlock = toBlock + 1;}- return { fromBlock: initialFrom, toBlock, revokedCount, redeemedCount, logErrorCount, earlyExit };+ return {+ fromBlock: initialFrom,+ toBlock,+ revokedCount,+ redeemedCount,+ logErrorCount,+ earlyExit,+ };}async function idxRpc(urls, method, params) {@@ -771,7 +785,15 @@ async function handlePumpAgentStats(req, res) {`;const DEADLINE = Date.now() + 22_000;- const report = { scanned: mints.length, updated: 0, errors: 0, graduations: 0, timeouts: 0, rate_limited: 0, skipped: 0 };+ const report = {+ scanned: mints.length,+ updated: 0,+ errors: 0,+ graduations: 0,+ timeouts: 0,+ rate_limited: 0,+ skipped: 0,+ };let consecutiveRateLimit = 0;for (const m of mints) {@@ -781,7 +803,12 @@ async function handlePumpAgentStats(req, res) {}if (consecutiveRateLimit >= 3) {report.skipped += mints.length - mints.indexOf(m);- console.log(JSON.stringify({ event: 'pump_agent_stats.circuit_open', consecutive_429: consecutiveRateLimit }));+ console.log(+ JSON.stringify({+ event: 'pump_agent_stats.circuit_open',+ consecutive_429: consecutiveRateLimit,+ }),+ );break;}@@ -789,7 +816,11 @@ async function handlePumpAgentStats(req, res) {const stats = await Promise.race([pumpStatsSnapshotMint(m),new Promise((_, rej) =>- setTimeout(() => rej(Object.assign(new Error('snapshot timeout'), { code: 'TIMEOUT' })), PUMP_STATS_MINT_TIMEOUT_MS),+ setTimeout(+ () =>+ rej(Object.assign(new Error('snapshot timeout'), { code: 'TIMEOUT' })),+ PUMP_STATS_MINT_TIMEOUT_MS,+ ),),]);@@ -1008,7 +1039,9 @@ async function handlePumpfunMonitor(req, res) {// attester provisioning, so /api/healthz reports real bot status and the// dashboard's server-side alerts fire even when no tab is open.await writeBotHeartbeat();- const alertReport = await evaluateUserAlerts().catch((e) => ({ error: e?.message || String(e) }));+ const alertReport = await evaluateUserAlerts().catch((e) => ({+ error: e?.message || String(e),+ }));if (!process.env.ATTEST_AGENT_SECRET_KEY) {// Skip the attestation work cleanly when the attester key isn't@@ -1057,7 +1090,14 @@ async function handlePumpfunMonitor(req, res) {`;const attester = loadAttesterKeypair();- const report = { scanned: rows.length, minted: 0, deduped: 0, in_progress: 0, errors: 0, events: [] };+ const report = {+ scanned: rows.length,+ minted: 0,+ deduped: 0,+ in_progress: 0,+ errors: 0,+ events: [],+ };for (const r of rows) {const events = detectEvents(r);@@ -1066,21 +1106,30 @@ async function handlePumpfunMonitor(req, res) {const result = await mintAttestation({...ev,agent_asset: r.agent_asset,- network: r.network,- token_mint: r.token_mint,+ network: r.network,+ token_mint: r.token_mint,attester,});- report[result.status === 'minted' ? 'minted'- : result.status === 'deduped' ? 'deduped' : 'in_progress']++;+ report[+ result.status === 'minted'+ ? 'minted'+ : result.status === 'deduped'+ ? 'deduped'+ : 'in_progress'+ ]++;report.events.push({- mint: r.token_mint, type: ev.event_type, status: result.status,+ mint: r.token_mint,+ type: ev.event_type,+ status: result.status,signature: result.signature,});} catch (e) {report.errors++;report.events.push({- mint: r.token_mint, type: ev.event_type,- status: 'error', error: e?.message || String(e),+ mint: r.token_mint,+ type: ev.event_type,+ status: 'error',+ error: e?.message || String(e),});}}@@ -1213,7 +1262,11 @@ async function evaluateUserAlerts() {`;} catch (e) {report.errors++;- console.error('[pumpfun-monitor] alert eval failed for user', cfg.user_id, e?.message || e);+ console.error(+ '[pumpfun-monitor] alert eval failed for user',+ cfg.user_id,+ e?.message || e,+ );}}@@ -1243,18 +1296,20 @@ async function postAlertWebhook(url, payload) {/** Map a single (stats, cursor) row to the attestation events to emit. */function detectEvents(r) {const out = [];- const slot_or_ts = r.last_signature_at- ? new Date(r.last_signature_at).getTime()- : Date.now();+ const slot_or_ts = r.last_signature_at ? new Date(r.last_signature_at).getTime() : Date.now();// Graduation flip false -> true.if (r.graduated === true && r.last_graduated !== true) {out.push({event_type: 'graduation',- source: 'pumpfun.graduation',- event_id: deriveEventId({ event_type: 'graduation', mint: r.token_mint, slot_or_ts: 'final' }),- task_id: `pumpfun:${r.token_mint}:graduation`,- detail: { network: r.network },+ source: 'pumpfun.graduation',+ event_id: deriveEventId({+ event_type: 'graduation',+ mint: r.token_mint,+ slot_or_ts: 'final',+ }),+ task_id: `pumpfun:${r.token_mint}:graduation`,+ detail: { network: r.network },});}@@ -1262,14 +1317,14 @@ function detectEvents(r) {if (r.agent_authority && r.last_authority && r.agent_authority !== r.last_authority) {out.push({event_type: 'cto_detected',- source: 'pumpfun.cto',- event_id: deriveEventId({+ source: 'pumpfun.cto',+ event_id: deriveEventId({event_type: 'cto',- mint: r.token_mint,+ mint: r.token_mint,slot_or_ts: `${r.last_authority}->${r.agent_authority}`,}),- task_id: `pumpfun:${r.token_mint}:cto:${slot_or_ts}`,- detail: { from: r.last_authority, to: r.agent_authority, network: r.network },+ task_id: `pumpfun:${r.token_mint}:cto:${slot_or_ts}`,+ detail: { from: r.last_authority, to: r.agent_authority, network: r.network },});}@@ -1484,16 +1539,14 @@ async function handleRunBuyback(req, res) {}const { offline } = await getPumpAgentOffline({ network: m.network, mint: m.mint });- const [{ PUMP_PROGRAM_ID }] = await Promise.all([- import('@three-ws/agent-payments'),- ]);+ const [{ PUMP_PROGRAM_ID }] = await Promise.all([import('@three-ws/agent-payments')]);const payerPk = relayer ? relayer.publicKey : solanaPubkey(m.mint);const params = {- globalBuybackAuthority: payerPk, // gated by globalConfig — for skipped-swap form, can be relayer+ globalBuybackAuthority: payerPk, // gated by globalConfig — for skipped-swap form, can be relayercurrencyMint: currency,- swapProgramToInvoke: PUMP_PROGRAM_ID, // pump bonding-curve program (same for burn-only and full-swap)- swapInstructionData: Buffer.alloc(0), // empty = skip swap, just burn+ swapProgramToInvoke: PUMP_PROGRAM_ID, // pump bonding-curve program (same for burn-only and full-swap)+ swapInstructionData: Buffer.alloc(0), // empty = skip swap, just burnremainingAccounts: [],};@@ -1534,7 +1587,12 @@ async function handleRunBuyback(req, res) {values (${m.id}, ${currencyStr}, ${PUMP_PROGRAM_ID.toBase58()}, 'pending', ${buyback.toString()})returning id`;- results.push({ mint: m.mint, status: 'pending', run_id: run.id, tx_base64: txBase64 });+ results.push({+ mint: m.mint,+ status: 'pending',+ run_id: run.id,+ tx_base64: txBase64,+ });continue;}@@ -1885,7 +1943,10 @@ async function handleRunDca(req, res) {`;} catch (err) {if (isTableMissing(err)) {- dcaLog('info', 'tick_skip', { run_id: runId, reason: 'dca_strategies table not yet created' });+ dcaLog('info', 'tick_skip', {+ run_id: runId,+ reason: 'dca_strategies table not yet created',+ });return json(res, 200, { ok: true, skipped: true, reason: 'table_not_ready' });}dcaLog('error', 'fetch_due_failed', { run_id: runId, message: err?.message });@@ -2114,7 +2175,12 @@ async function handleRunDistributePayments(req, res) {values (${m.id}, ${currencyStr}, 'pending', ${JSON.stringify({ payment: paymentBalance.toString() })}::jsonb)returning id`;- results.push({ mint: m.mint, status: 'pending', run_id: run.id, tx_base64: txBase64 });+ results.push({+ mint: m.mint,+ status: 'pending',+ run_id: run.id,+ tx_base64: txBase64,+ });continue;}@@ -2144,9 +2210,9 @@ async function handleRunDistributePayments(req, res) {(${m.id}, ${currencyStr}, ${sig}, 'confirmed',${JSON.stringify({ payment: paymentBalance.toString() })}::jsonb,${JSON.stringify({- buyback: balancesAfter.buybackVault?.balance?.toString?.(),- withdraw: balancesAfter.withdrawVault?.balance?.toString?.(),- })}::jsonb)+ buyback: balancesAfter.buybackVault?.balance?.toString?.(),+ withdraw: balancesAfter.withdrawVault?.balance?.toString?.(),+ })}::jsonb)returning id`;results.push({ mint: m.mint, status: 'confirmed', tx_signature: sig, run_id: run.id });@@ -2277,7 +2343,10 @@ async function handleRunSubscriptions(req, res) {`;} catch (err) {if (isTableMissing(err)) {- subLog('subscription_cron.skip', { runId, reason: 'agent_subscriptions table not yet created' });+ subLog('subscription_cron.skip', {+ runId,+ reason: 'agent_subscriptions table not yet created',+ });return json(res, 200, { ok: true, skipped: true, reason: 'table_not_ready' });}subLogError('subscription_cron.select_failed', { runId, message: err.message });@@ -2450,7 +2519,11 @@ async function handleRunSubscriptions(req, res) {});report.errors.push({ id: row.id, reason: 'unhandled', message: err.message });// Best-effort pause so we don't loop on the same broken row next hour.- await subSafePause(row.id, `unhandled: ${(err.message ?? 'unknown').slice(0, 480)}`, ctx);+ await subSafePause(+ row.id,+ `unhandled: ${(err.message ?? 'unknown').slice(0, 480)}`,+ ctx,+ );report.paused++;}}@@ -2548,8 +2621,8 @@ async function handleSolanaAttestationsCrawl(req, res) {for (const row of agents) {try {const r = await crawlAgentAttestations({- agentAsset: row.agent_asset,- network: row.network,+ agentAsset: row.agent_asset,+ network: row.network,ownerWallet: row.owner_wallet,});report.agents.push({ asset: row.agent_asset, ...r });@@ -2574,7 +2647,7 @@ async function handleProcessSubscriptions(req, res) {const report = {runId,processed: 0,- charged: 0, // succeeded outright (instantaneous settlement)+ charged: 0, // succeeded outright (instantaneous settlement)pendingApproval: 0, // payment intent created; subscriber must approvepastDue: 0,errors: [],@@ -2615,12 +2688,14 @@ async function handleProcessSubscriptions(req, res) {WHERE id = ${row.id} AND status = 'active'`;report.pastDue++;- console.log(JSON.stringify({- event: 'process_subscriptions.past_due',- runId,- subscriptionId: row.id,- failCount,- }));+ console.log(+ JSON.stringify({+ event: 'process_subscriptions.past_due',+ runId,+ subscriptionId: row.id,+ failCount,+ }),+ );// Fire-and-forget email notification.sendEmail({to: row.subscriber_email,@@ -2629,11 +2704,15 @@ async function handleProcessSubscriptions(req, res) {<p>We were unable to process your subscription payment of $${row.price_usd}. Your subscription has been paused. Please update your payment method to continue.</p><p><a href="${env.APP_ORIGIN}/dashboard#subscriptions">Manage subscriptions</a></p>`,text: `Your subscription payment of $${row.price_usd} could not be processed. Visit ${env.APP_ORIGIN}/dashboard#subscriptions to manage your subscriptions.`,- }).catch((e) => console.error(JSON.stringify({- event: 'process_subscriptions.email_failed',- subscriptionId: row.id,- error: e.message,- })));+ }).catch((e) =>+ console.error(+ JSON.stringify({+ event: 'process_subscriptions.email_failed',+ subscriptionId: row.id,+ error: e.message,+ }),+ ),+ );continue;}@@ -2654,11 +2733,15 @@ async function handleProcessSubscriptions(req, res) {<p>Your subscription is up for renewal. The amount is $${result.amount_usd?.toFixed(2) || row.price_usd}.</p><p><a href="${result.payUrl}">Approve renewal payment</a></p>`,text: `Your subscription renewal of $${result.amount_usd?.toFixed(2) || row.price_usd} is ready. Approve at ${result.payUrl}`,- }).catch((e) => console.error(JSON.stringify({- event: 'process_subscriptions.email_failed',- subscriptionId: row.id,- error: e.message,- })));+ }).catch((e) =>+ console.error(+ JSON.stringify({+ event: 'process_subscriptions.email_failed',+ subscriptionId: row.id,+ error: e.message,+ }),+ ),+ );}} else {if (result.paymentId) {@@ -2668,12 +2751,14 @@ async function handleProcessSubscriptions(req, res) {}} catch (e) {report.errors.push({ id: row.id, error: e.message || String(e) });- console.error(JSON.stringify({- event: 'process_subscriptions.row_error',- runId,- subscriptionId: row.id,- error: e.message,- }));+ console.error(+ JSON.stringify({+ event: 'process_subscriptions.row_error',+ runId,+ subscriptionId: row.id,+ error: e.message,+ }),+ );}}@@ -2803,7 +2888,23 @@ async function handleProcessWithdrawals(req, res) {// once an operator wires the key.const supportedChains = [];if (treasuryKeypair) supportedChains.push('solana');- if (evmTreasuryKey) supportedChains.push('ethereum', 'base', 'optimism', 'arbitrum', 'polygon', 'sepolia', 'base-sepolia', '1', '8453', '10', '42161', '137', '11155111', '84532');+ if (evmTreasuryKey)+ supportedChains.push(+ 'ethereum',+ 'base',+ 'optimism',+ 'arbitrum',+ 'polygon',+ 'sepolia',+ 'base-sepolia',+ '1',+ '8453',+ '10',+ '42161',+ '137',+ '11155111',+ '84532',+ );// Fetch pending withdrawals across all supported chains, join user earnings// to verify available balance.@@ -2966,7 +3067,13 @@ async function handleRunXScheduledPosts(req, res) {`;const report = { processed: 0, posted: 0, errored: 0 };- const TERMINAL = new Set(['quota_exceeded', 'duplicate', 'not_connected', 'validation_error', 'reauth_required']);+ const TERMINAL = new Set([+ 'quota_exceeded',+ 'duplicate',+ 'not_connected',+ 'validation_error',+ 'reauth_required',+ ]);for (const row of due) {report.processed++;@@ -3061,16 +3168,22 @@ async function handleRunXTriggers(req, res) {}async function evalTrigger(t) {- if (t.kind === 'daily_persona') return await evalDailyPersona(t);- if (t.kind === 'weekly_digest') return await evalWeeklyDigest(t);- if (t.kind === 'price_milestone') return await evalPriceMilestone(t);+ if (t.kind === 'daily_persona') return await evalDailyPersona(t);+ if (t.kind === 'weekly_digest') return await evalWeeklyDigest(t);+ if (t.kind === 'price_milestone') return await evalPriceMilestone(t);if (t.kind === 'payment_received') return await evalPaymentReceived(t);return false;}-function utcHour(d) { return d.getUTCHours(); }-function utcDay(d) { return d.getUTCDay(); }-function ymdUTC(d) { return `${d.getUTCFullYear()}-${String(d.getUTCMonth()+1).padStart(2,'0')}-${String(d.getUTCDate()).padStart(2,'0')}`; }+function utcHour(d) {+ return d.getUTCHours();+}+function utcDay(d) {+ return d.getUTCDay();+}+function ymdUTC(d) {+ return `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, '0')}-${String(d.getUTCDate()).padStart(2, '0')}`;+}// Either enqueue for immediate publish (auto_publish=true) or stash in the// pending-review queue for the user to approve (auto_publish=false).@@ -3155,7 +3268,11 @@ async function anthropicDraft({ system, user, max }) {async function openaiCompatDraft({ url, key, model, system, user, max, extraHeaders = {} }) {const r = await fetch(url, {method: 'POST',- headers: { 'content-type': 'application/json', authorization: `Bearer ${key}`, ...extraHeaders },+ headers: {+ 'content-type': 'application/json',+ authorization: `Bearer ${key}`,+ ...extraHeaders,+ },body: JSON.stringify({model,max_tokens: max,@@ -3179,14 +3296,18 @@ async function llmDraft({ system, user, max = 200 }) {url: 'https://api.groq.com/openai/v1/chat/completions',key: env.GROQ_API_KEY,model: 'llama-3.3-70b-versatile',- system, user, max,+ system,+ user,+ max,});} else if (env.OPENROUTER_API_KEY) {text = await openaiCompatDraft({url: 'https://openrouter.ai/api/v1/chat/completions',key: env.OPENROUTER_API_KEY,model: 'meta-llama/llama-3.3-70b-instruct',- system, user, max,+ system,+ user,+ max,extraHeaders: { 'HTTP-Referer': 'https://three.ws', 'X-Title': 'three.ws agent' },});} else if (env.ANTHROPIC_API_KEY) {@@ -3210,8 +3331,13 @@ async function evalDailyPersona(t) {const ctx = avatar? `Agent name: ${avatar.name || 'Unnamed'}\nAgent description: ${avatar.description || '(none)'}`: '';- const topic = t.config.topic ? `Topic for today: ${t.config.topic}` : 'Write something engaging and in-character about being an autonomous AI agent today.';- const text = await llmDraft({ system: DRAFT_SYSTEM, user: [ctx, topic].filter(Boolean).join('\n\n') });+ const topic = t.config.topic+ ? `Topic for today: ${t.config.topic}`+ : 'Write something engaging and in-character about being an autonomous AI agent today.';+ const text = await llmDraft({+ system: DRAFT_SYSTEM,+ user: [ctx, topic].filter(Boolean).join('\n\n'),+ });await enqueueTriggerPost(t, text);await setTriggerState(t, { fired_ymd: today });return true;@@ -3219,20 +3345,29 @@ async function evalDailyPersona(t) {async function evalWeeklyDigest(t) {const now = new Date();- if (utcDay(now) !== Number(t.config.day_of_week) || utcHour(now) !== Number(t.config.hour_utc)) return false;- const week = `${now.getUTCFullYear()}-W${Math.floor((now.getUTCDate()+6)/7)}`;+ if (utcDay(now) !== Number(t.config.day_of_week) || utcHour(now) !== Number(t.config.hour_utc))+ return false;+ const week = `${now.getUTCFullYear()}-W${Math.floor((now.getUTCDate() + 6) / 7)}`;if (t.last_state?.fired_week === week) return false;const avatar = await loadAvatarFromAgent(t.agent_id);- const mint = avatar ? (await sql`+ const mint = avatar+ ? (+ await sql`select m.symbol, m.name, s.recent_tx_countfrom pump_agent_mints m left join pump_agent_stats s on s.mint_id = m.idwhere m.agent_id::text = ${avatar.agent_id ?? null} or m.agent_id::text = ${avatar.id}order by m.created_at desc limit 1- `)[0] : null;+ `+ )[0]+ : null;- const ctx = avatar ? `Agent name: ${avatar.name || 'Unnamed'}\nDescription: ${avatar.description || '(none)'}` : '';- const stats = mint ? `\nToken: $${mint.symbol || 'TOKEN'} on pump.fun. Recent transactions: ${mint.recent_tx_count || 0}.` : '';+ const ctx = avatar+ ? `Agent name: ${avatar.name || 'Unnamed'}\nDescription: ${avatar.description || '(none)'}`+ : '';+ const stats = mint+ ? `\nToken: $${mint.symbol || 'TOKEN'} on pump.fun. Recent transactions: ${mint.recent_tx_count || 0}.`+ : '';const text = await llmDraft({system: DRAFT_SYSTEM,user: `${ctx}${stats}\n\nWrite a weekly recap tweet covering the agent's progress this week. If token stats are present, mention them naturally.`,@@ -3247,7 +3382,8 @@ async function evalPriceMilestone(t) {if (!thresholds.length) return false;const avatar = await loadAvatarFromAgent(t.agent_id);if (!avatar) return false;- const mintRow = (await sql`+ const mintRow = (+ await sql`select m.id as mint_id, m.symbol, p.market_cap_lamportsfrom pump_agent_mints mleft join lateral (@@ -3256,7 +3392,8 @@ async function evalPriceMilestone(t) {) p on truewhere m.agent_id::text = ${avatar.agent_id ?? null} or m.agent_id::text = ${avatar.id}order by m.created_at desc limit 1- `)[0];+ `+ )[0];if (!mintRow || !mintRow.market_cap_lamports) return false;const solUsd = Number(t.config.sol_usd) || SOL_USD_FALLBACK;@@ -3295,8 +3432,15 @@ async function evalPaymentReceived(t) {let lastId = null;for (const p of payments) {const approxUsd = Number(p.amount_atomics) / 1e6;- if (approxUsd < minUsd) { lastId = p.id; continue; }- const label = p.tool_name ? `for "${p.tool_name}"` : (p.skill_id ? `for skill ${p.skill_id}` : 'for a paid action');+ if (approxUsd < minUsd) {+ lastId = p.id;+ continue;+ }+ const label = p.tool_name+ ? `for "${p.tool_name}"`+ : p.skill_id+ ? `for skill ${p.skill_id}`+ : 'for a paid action';const text = await llmDraft({system: DRAFT_SYSTEM,user: `Agent name: ${avatar.name || 'Unnamed'}\nDescription: ${avatar.description || '(none)'}\nA user just paid ~$${approxUsd.toFixed(2)} ${label}.\n\nWrite a short thank-you tweet in the agent's voice.`,@@ -3333,15 +3477,21 @@ async function handleFetchXMetrics(req, res) {const report = { users: 0, fetched: 0, errors: 0 };for (const u of users) {report.users++;- const conn = (await sql`+ const conn = (+ await sql`select access_token, expires_at, refresh_token, idfrom social_connectionswhere user_id = ${u.user_id} and provider = 'x' and disconnected_at is nulllimit 1- `)[0];+ `+ )[0];if (!conn || !conn.access_token) continue;let accessToken;- try { accessToken = decryptToken(conn.access_token); } catch { continue; }+ try {+ accessToken = decryptToken(conn.access_token);+ } catch {+ continue;+ }const posts = await sql`select id, tweet_id from x_posts@@ -3355,10 +3505,16 @@ async function handleFetchXMetrics(req, res) {// X allows up to 100 ids per /2/tweets lookup.const ids = posts.map((p) => p.tweet_id).join(',');- const r = await fetch(`https://api.twitter.com/2/tweets?ids=${ids}&tweet.fields=public_metrics`, {- headers: { authorization: `Bearer ${accessToken}` },- });- if (!r.ok) { report.errors++; continue; }+ const r = await fetch(+ `https://api.twitter.com/2/tweets?ids=${ids}&tweet.fields=public_metrics`,+ {+ headers: { authorization: `Bearer ${accessToken}` },+ },+ );+ if (!r.ok) {+ report.errors++;+ continue;+ }const { data = [] } = await r.json();const byId = new Map(data.map((d) => [d.id, d.public_metrics]));@@ -3405,7 +3561,11 @@ async function handleRunCoinCycle(req, res) {// operator opts in by setting COIN_DEMO_ENABLED=true in env. Until then// neither Vercel cron nor a manual call can touch any coin_launches row.if (process.env.COIN_DEMO_ENABLED !== 'true') {- return json(res, 200, { ok: true, disabled: true, hint: 'set COIN_DEMO_ENABLED=true to enable' });+ return json(res, 200, {+ ok: true,+ disabled: true,+ hint: 'set COIN_DEMO_ENABLED=true to enable',+ });}const coinLib = await import('../_lib/coin/index.js');@@ -3413,7 +3573,12 @@ async function handleRunCoinCycle(req, res) {const phaseFilter = (req.query?.phase || '').toString();const onlyPhase = phaseFilter- ? new Set(phaseFilter.split(',').map((s) => s.trim()).filter(Boolean))+ ? new Set(+ phaseFilter+ .split(',')+ .map((s) => s.trim())+ .filter(Boolean),+ ): null;const wantPhase = (name) => !onlyPhase || onlyPhase.has(name);@@ -3427,7 +3592,11 @@ async function handleRunCoinCycle(req, res) {}} catch (err) {result.steps.snapshot = { error: err.message || String(err) };- report.errors.push({ mint: coin.mint, step: 'snapshot', error: result.steps.snapshot.error });+ report.errors.push({+ mint: coin.mint,+ step: 'snapshot',+ error: result.steps.snapshot.error,+ });}// Refresh row after snapshot so we have current last_snapshot_at.@@ -3452,7 +3621,11 @@ async function handleRunCoinCycle(req, res) {}} catch (err) {result.steps.commit_lottery = { error: err.message || String(err) };- report.errors.push({ mint: coin.mint, step: 'commit_lottery', error: result.steps.commit_lottery.error });+ report.errors.push({+ mint: coin.mint,+ step: 'commit_lottery',+ error: result.steps.commit_lottery.error,+ });}try {@@ -3461,7 +3634,11 @@ async function handleRunCoinCycle(req, res) {}} catch (err) {result.steps.resolve_lottery = { error: err.message || String(err) };- report.errors.push({ mint: coin.mint, step: 'resolve_lottery', error: result.steps.resolve_lottery.error });+ report.errors.push({+ mint: coin.mint,+ step: 'resolve_lottery',+ error: result.steps.resolve_lottery.error,+ });}const refreshed3 = await coinLib.loadCoinById(coin.id);@@ -3473,7 +3650,11 @@ async function handleRunCoinCycle(req, res) {}} catch (err) {result.steps.reflection = { error: err.message || String(err) };- report.errors.push({ mint: coin.mint, step: 'reflection', error: result.steps.reflection.error });+ report.errors.push({+ mint: coin.mint,+ step: 'reflection',+ error: result.steps.reflection.error,+ });}report.coins.push(result);@@ -3502,7 +3683,11 @@ async function handleRunCoinPayouts(req, res) {// Demo gate — see handleRunCoinCycle. Until COIN_DEMO_ENABLED=true is set,// the payout drainer cannot fire even if rows are pending.if (process.env.COIN_DEMO_ENABLED !== 'true') {- return json(res, 200, { ok: true, disabled: true, hint: 'set COIN_DEMO_ENABLED=true to enable' });+ return json(res, 200, {+ ok: true,+ disabled: true,+ hint: 'set COIN_DEMO_ENABLED=true to enable',+ });}const coinLib = await import('../_lib/coin/index.js');diff --git a/api/dca-strategies.js b/api/dca-strategies.jsindex 1bb1d3412..b25538090 100644--- a/api/dca-strategies.js+++ b/api/dca-strategies.js@@ -9,8 +9,24 @@ import { requireCsrf } from './_lib/csrf.js';import { parse } from './_lib/validate.js';import { limits, clientIp } from './_lib/rate-limit.js';-// Whitelisted token-out symbols — extend this as new pools become liquid enough-const ALLOWED_TOKEN_OUT_SYMBOLS = new Set(['WETH', 'cbBTC', 'USDT']);+// Whitelisted token-out symbols — runtime operator config, never hardcoded+// tickers. DCA_ALLOWED_TOKEN_OUT is a comma-separated symbol list; when unset+// or empty, strategy creation is rejected until the operator configures it.+function allowedTokenOutSymbols() {+ return new Set(+ (process.env.DCA_ALLOWED_TOKEN_OUT || '')+ .split(',')+ .map((s) => s.trim())+ .filter(Boolean),+ );+}++// Default chain for new strategies — operator config (DCA_CHAIN_ID), never a+// hardcoded network. Required when the request body omits chain_id.+function defaultChainId() {+ const parsed = parseInt(process.env.DCA_CHAIN_ID || '', 10);+ return Number.isInteger(parsed) && parsed > 0 ? parsed : null;+}// Max slippage enforced server-side in addition to the UI capconst MAX_SLIPPAGE_BPS = 500;@@ -23,7 +39,7 @@ const ethAddress = zconst createSchema = z.object({agent_id: z.string().uuid(),delegation_id: z.string().uuid(),- chain_id: z.number().int().positive().default(84532),+ chain_id: z.number().int().positive().optional(),token_in: ethAddress,token_out: ethAddress,token_out_symbol: z.string().min(1).max(10),@@ -143,12 +159,31 @@ export default wrap(async (req, res) => {return error(res, err.status || 400, err.code || 'validation_error', err.message);}- if (!ALLOWED_TOKEN_OUT_SYMBOLS.has(body.token_out_symbol)) {+ const allowedTokenOut = allowedTokenOutSymbols();+ if (allowedTokenOut.size === 0) {+ return error(+ res,+ 400,+ 'not_configured',+ 'DCA token-out whitelist is not configured — set DCA_ALLOWED_TOKEN_OUT (comma-separated symbols)',+ );+ }+ if (!allowedTokenOut.has(body.token_out_symbol)) {return error(res,400,'validation_error',- `token_out_symbol must be one of: ${[...ALLOWED_TOKEN_OUT_SYMBOLS].join(', ')}`,+ `token_out_symbol must be one of: ${[...allowedTokenOut].join(', ')}`,+ );+ }++ const chainId = body.chain_id ?? defaultChainId();+ if (!chainId) {+ return error(+ res,+ 400,+ 'not_configured',+ 'chain_id is required — pass it in the body or set DCA_CHAIN_ID',);}@@ -203,7 +238,7 @@ export default wrap(async (req, res) => {amount_per_execution, period_seconds, slippage_bps,next_execution_at) VALUES (- ${body.agent_id}, ${body.delegation_id}, ${body.chain_id},+ ${body.agent_id}, ${body.delegation_id}, ${chainId},${body.token_in}, ${body.token_out}, ${body.token_out_symbol},${body.amount_per_execution}, ${body.period_seconds}, ${body.slippage_bps},${nextExecAt}diff --git a/api/demo-economy.js b/api/demo-economy.jsindex 22ee178cf..f3fdefbc6 100644--- a/api/demo-economy.js+++ b/api/demo-economy.js@@ -6,11 +6,12 @@// and receives a live crypto market briefing in return.//// Streams structured SSE events so the frontend can animate each step-// in real time. Real blockchain transaction when AVATAR_WALLET_SECRET +-// a recipient are configured; simulation mode otherwise (no real money,-// full UI still plays).+// in real time. Real blockchain transaction only for authenticated callers+// when AVATAR_WALLET_SECRET + a recipient are configured; explicit simulation+// mode otherwise (no real money, no fabricated tx data, full UI still plays).import { cors, method, wrap, setRateLimitHeaders } from './_lib/http.js';+import { getSessionUser, authenticateBearer, extractBearer } from './_lib/auth.js';import { limits, clientIp } from './_lib/rate-limit.js';import { Bazaar } from './_lib/x402/bazaar-client.js';@@ -38,11 +39,16 @@ async function fetchMarketBriefing() {name: attr.name || p.id,price: priceUsd < 0.0001 ? priceUsd.toExponential(2) : priceUsd.toFixed(6),change24h: (change24 >= 0 ? '+' : '') + change24.toFixed(1) + '%',- vol24h: vol24 > 1e6 ? '$' + (vol24 / 1e6).toFixed(1) + 'M' : '$' + (vol24 / 1e3).toFixed(0) + 'K',+ vol24h:+ vol24 > 1e6+ ? '$' + (vol24 / 1e6).toFixed(1) + 'M'+ : '$' + (vol24 / 1e3).toFixed(0) + 'K',up: change24 >= 0,};});- const topGainer = pools.filter((p) => p.up).sort((a, b) => parseFloat(b.change24h) - parseFloat(a.change24h))[0];+ const topGainer = pools+ .filter((p) => p.up)+ .sort((a, b) => parseFloat(b.change24h) - parseFloat(a.change24h))[0];return {headline: topGainer? `${topGainer.name} leads Solana with ${topGainer.change24h} in 24h`@@ -51,14 +57,9 @@ async function fetchMarketBriefing() {fetchedAt: new Date().toISOString(),};} catch {- return {- headline: 'Solana market briefing',- pools: [- { name: 'SOL/USDC', price: '148.20', change24h: '+3.4%', vol24h: '$82M', up: true },- { name: 'THREE/SOL', price: '0.00042', change24h: '+5.1%', vol24h: '$9M', up: true },- ],- fetchedAt: new Date().toISOString(),- };+ // No invented market data: a GeckoTerminal failure degrades to an explicit+ // "unavailable" signal handled by the caller — never fabricated numbers.+ return null;}}@@ -74,13 +75,35 @@ async function discoverServices() {network: r.network || 'base',}));if (top.length) return top;- } catch { /* fall through to demo data */ }+ } catch {+ /* fall through to demo data */+ }// Demo services (shown when bazaar is unreachable)return [- { name: 'Solana market briefing (live)', resource: 'https://three.ws/api/demo-economy', price: '0.001 SOL', network: 'solana' },- { name: 'Token price oracle', resource: 'https://three.ws/api/agents/x402/price', price: '0.50 USDC', network: 'base' },- { name: 'On-chain sentiment feed', resource: 'https://three.ws/api/sentiment', price: '0.25 USDC', network: 'base' },- { name: 'Pump.fun trending coins', resource: 'https://three.ws/api/pump/trending', price: '0.10 USDC', network: 'solana' },+ {+ name: 'Solana market briefing (live)',+ resource: 'https://three.ws/api/demo-economy',+ price: '0.001 SOL',+ network: 'solana',+ },+ {+ name: 'Token price oracle',+ resource: 'https://three.ws/api/agents/x402/price',+ price: '0.50 USDC',+ network: 'base',+ },+ {+ name: 'On-chain sentiment feed',+ resource: 'https://three.ws/api/sentiment',+ price: '0.25 USDC',+ network: 'base',+ },+ {+ name: 'Pump.fun trending coins',+ resource: 'https://three.ws/api/pump/trending',+ price: '0.10 USDC',+ network: 'solana',+ },];}@@ -107,6 +130,18 @@ export default wrap(async (req, res) => {return;}+ // The live branch sends REAL SOL from the platform wallet, so it is reserved+ // for authenticated callers (session or bearer). Anonymous visitors still get+ // the full narrated demo on the explicit-simulation path. Best-effort: any+ // auth-resolution failure is treated as anonymous.+ let authed = false;+ try {+ const session = await getSessionUser(req);+ authed = !!session || !!(await authenticateBearer(extractBearer(req)));+ } catch {+ authed = false;+ }+// SSE setupres.statusCode = 200;res.setHeader('Content-Type', 'text/event-stream; charset=utf-8');@@ -160,79 +195,107 @@ export default wrap(async (req, res) => {});await sleep(pace * 0.5);- // Attempt real transfer+ // Attempt real transfer — authenticated callers only. Anonymous callers+ // always take the explicit-simulation path (no SOL ever leaves the wallet).let payment = null;- let sim = false;- try {- const {- avatarWalletConfig,- loadAvatarKeypair,- getConnection,- getSolBalance,- sendSol,- explorerTxUrl,- LAMPORTS_PER_SOL,- isValidPubkey,- } = await walletDeps();+ let sim = !authed;+ const simReason = authed ? 'wallet_not_configured' : 'auth_required';+ if (!sim) {+ try {+ const {+ avatarWalletConfig,+ loadAvatarKeypair,+ getConnection,+ getSolBalance,+ sendSol,+ explorerTxUrl,+ LAMPORTS_PER_SOL,+ isValidPubkey,+ } = await walletDeps();- const cfg = avatarWalletConfig();- const recipient = (process.env.DEMO_AGENT_B_ADDRESS || cfg.defaultRecipient || '').trim();+ const cfg = avatarWalletConfig();+ const recipient = (+ process.env.DEMO_AGENT_B_ADDRESS ||+ cfg.defaultRecipient ||+ ''+ ).trim();- if (!cfg.configured || !recipient || !isValidPubkey(recipient)) {- sim = true;- } else {- const connection = getConnection(cfg.rpcUrl);- const keypair = loadAvatarKeypair(process.env.AVATAR_WALLET_SECRET);- const sender = keypair.publicKey.toBase58();- const DEMO_LAMPORTS = 1000; // 0.000001 SOL — ~$0.0002, trivially cheap- const { lamports: balBefore } = await getSolBalance(connection, keypair.publicKey);+ if (!cfg.configured || !recipient || !isValidPubkey(recipient)) {+ sim = true;+ } else {+ const connection = getConnection(cfg.rpcUrl);+ const keypair = loadAvatarKeypair(process.env.AVATAR_WALLET_SECRET);+ const sender = keypair.publicKey.toBase58();+ const DEMO_LAMPORTS = 1000; // 0.000001 SOL — ~$0.0002, trivially cheap+ const { lamports: balBefore } = await getSolBalance(+ connection,+ keypair.publicKey,+ );- sseWrite(res, 'wallet', {- agentA: { name: 'NOVA', address: sender, balance_sol: (balBefore / LAMPORTS_PER_SOL).toFixed(6) },- agentB: { name: 'ORACLE', address: recipient },- });+ sseWrite(res, 'wallet', {+ agentA: {+ name: 'NOVA',+ address: sender,+ balance_sol: (balBefore / LAMPORTS_PER_SOL).toFixed(6),+ },+ agentB: { name: 'ORACLE', address: recipient },+ });- const sig = await sendSol({ connection, fromKeypair: keypair, to: recipient, lamports: DEMO_LAMPORTS, memo: 'three.ws agent economy demo' });- const { lamports: balAfter } = await getSolBalance(connection, keypair.publicKey);+ const sig = await sendSol({+ connection,+ fromKeypair: keypair,+ to: recipient,+ lamports: DEMO_LAMPORTS,+ memo: 'three.ws agent economy demo',+ });+ const { lamports: balAfter } = await getSolBalance(+ connection,+ keypair.publicKey,+ );- payment = {- signature: sig,- explorer_url: explorerTxUrl(sig, cfg.network),- amount_sol: (DEMO_LAMPORTS / LAMPORTS_PER_SOL).toFixed(6),- amount_usd: '~$0.0002',- sender,- recipient,- balance_before: (balBefore / LAMPORTS_PER_SOL).toFixed(6),- balance_after: (balAfter / LAMPORTS_PER_SOL).toFixed(6),- };+ payment = {+ signature: sig,+ explorer_url: explorerTxUrl(sig, cfg.network),+ amount_sol: (DEMO_LAMPORTS / LAMPORTS_PER_SOL).toFixed(6),+ amount_usd: '~$0.0002',+ sender,+ recipient,+ balance_before: (balBefore / LAMPORTS_PER_SOL).toFixed(6),+ balance_after: (balAfter / LAMPORTS_PER_SOL).toFixed(6),+ };+ }+ } catch (err) {+ sim = true;+ console.warn('[demo-economy] wallet not configured or send failed:', err.message);}- } catch (err) {- sim = true;- console.warn('[demo-economy] wallet not configured or send failed:', err.message);}if (sim) {- // Simulation: show a plausible fake tx for demo purposes- const fakeSig = Array.from({ length: 88 }, () => '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'[Math.floor(Math.random() * 58)]).join('');+ // Explicit simulation: no fabricated signature, explorer link, addresses,+ // or balances. The client renders this as "simulated / not configured".payment = {- signature: fakeSig,- explorer_url: `https://solscan.io/tx/${fakeSig}`,- amount_sol: '0.001000',- amount_usd: '~$0.15',- sender: 'NOVA••••••••••••••demo',- recipient: 'ORACLE••••••••••••demo',simulated: true,+ reason: simReason,+ signature: null,+ explorer_url: null,};sseWrite(res, 'wallet', {- agentA: { name: 'NOVA', address: 'Fund with AVATAR_WALLET_SECRET', balance_sol: '0.50' },- agentB: { name: 'ORACLE', address: 'Fund with DEMO_AGENT_B_ADDRESS', balance_sol: '0.00' },+ configured: false,+ simulated: true,+ reason: simReason,+ agentA: { name: 'NOVA' },+ agentB: { name: 'ORACLE' },});}sseWrite(res, 'step', {id: 'payment_sent',label: sim ? 'Payment (simulated)' : 'Transaction submitted',- detail: sim ? 'Simulated: set AVATAR_WALLET_SECRET + DEMO_AGENT_B_ADDRESS for live transfers' : `Tx broadcast to Solana mainnet`,+ detail: sim+ ? simReason === 'auth_required'+ ? 'Simulated: sign in to run the live on-chain transfer'+ : 'Simulated: set AVATAR_WALLET_SECRET + DEMO_AGENT_B_ADDRESS for live transfers'+ : `Tx broadcast to Solana mainnet`,icon: '📡',});sseWrite(res, 'payment', payment);@@ -240,8 +303,10 @@ export default wrap(async (req, res) => {sseWrite(res, 'step', {id: 'payment_confirmed',- label: sim ? 'Demo confirmed' : 'On-chain confirmed',- detail: sim ? 'Demo payment complete' : `${payment.amount_sol} SOL transferred · view on Solscan`,+ label: sim ? 'Simulation complete' : 'On-chain confirmed',+ detail: sim+ ? 'Simulated payment — no funds moved'+ : `${payment.amount_sol} SOL transferred · view on Solscan`,icon: '⛓️',});await sleep(pace * 0.6);@@ -257,14 +322,25 @@ export default wrap(async (req, res) => {const briefing = await fetchMarketBriefing();await sleep(pace * 0.5);- sseWrite(res, 'content', briefing);-- sseWrite(res, 'step', {- id: 'done',- label: 'Briefing received',- detail: `"${briefing.headline}"`,- icon: '📺',- });+ if (briefing) {+ sseWrite(res, 'content', briefing);+ sseWrite(res, 'step', {+ id: 'done',+ label: 'Briefing received',+ detail: `"${briefing.headline}"`,+ icon: '📺',+ });+ } else {+ // Degraded: market data source did not respond — say so explicitly+ // instead of inventing numbers.+ sseWrite(res, 'content', { type: 'market_unavailable' });+ sseWrite(res, 'step', {+ id: 'done',+ label: 'Market data unavailable',+ detail: 'Live market data is unavailable right now — try again shortly',+ icon: '📡',+ });+ }sseWrite(res, 'done', {sim,diff --git a/api/demo/economy.js b/api/demo/economy.jsindex e0425bbf4..64d59eee0 100644--- a/api/demo/economy.js+++ b/api/demo/economy.js@@ -25,11 +25,12 @@ import {LAMPORTS_PER_SOL,} from '../_lib/avatar-wallet.js';import { trendingPools } from '../_lib/market/ohlcv.js';-import { cors, wrap } from '../_lib/http.js';+import { cors, wrap, error } from '../_lib/http.js';+import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.js';import { limits, clientIp } from '../_lib/rate-limit.js';-const TRADE_SOL = 0.001; // price Oracle charges per data call-const RPC_URL = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';+const TRADE_SOL = 0.001; // price Oracle charges per data call+const RPC_URL = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';// ── Wallet helpers ─────────────────────────────────────────────────────────@@ -62,7 +63,14 @@ async function walletSnapshot(cfg) {getSolBalance(conn, cfg.address),solUsdPrice().catch(() => 0),]);- return { configured: true, address: cfg.address, sol, usd: price ? sol * price : null, solPriceUsd: price, explorer: cfg.explorer };+ return {+ configured: true,+ address: cfg.address,+ sol,+ usd: price ? sol * price : null,+ solPriceUsd: price,+ explorer: cfg.explorer,+ };} catch {return { configured: true, address: cfg.address, sol: null, usd: null };}@@ -100,14 +108,17 @@ async function fetchMarketData() {export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;- const url = new URL(req.url, 'http://x');- const cfgA = agentAConfig();- const cfgB = agentBConfig();+ const url = new URL(req.url, 'http://x');+ const cfgA = agentAConfig();+ const cfgB = agentBConfig();// ── STATUS: wallet snapshots ──────────────────────────────────────────if (url.searchParams.get('status') === '1') {const [a, b] = await Promise.all([walletSnapshot(cfgA), walletSnapshot(cfgB)]);- res.writeHead(200, { 'content-type': 'application/json', 'access-control-allow-origin': '*' });+ res.writeHead(200, {+ 'content-type': 'application/json',+ 'access-control-allow-origin': '*',+ });res.end(JSON.stringify({ agentA: a, agentB: b, tradeSol: TRADE_SOL }));return;}@@ -119,6 +130,16 @@ export default wrap(async (req, res) => {return;}+ // The trade branch signs + sends a REAL on-chain SOL transfer from the+ // platform-held trader wallet — never expose that to anonymous callers.+ // Read-only callers use ?status=1; the trade stream requires a session+ // cookie or bearer token on top of the per-IP limit below.+ const sessionUser = await getSessionUser(req);+ const bearerUser = sessionUser ? null : await authenticateBearer(extractBearer(req));+ if (!sessionUser && !bearerUser) {+ return error(res, 401, 'unauthorized', 'sign in to run the agent-economy trade demo');+ }+const rl = await limits.publicIp(clientIp(req));if (!rl.success) {res.writeHead(429, { 'content-type': 'application/json' });@@ -151,10 +172,12 @@ export default wrap(async (req, res) => {try {const conn = getConnection(RPC_URL);- const bal = await getSolBalance(conn, cfgB.address);+ const bal = await getSolBalance(conn, cfgB.address);const needed = TRADE_SOL * LAMPORTS_PER_SOL + 15_000;if (bal.lamports < needed) {- emit(res, 'error', { text: `Trader wallet underfunded (${bal.sol.toFixed(5)} SOL). Fund ${cfgB.address} and retry.` });+ emit(res, 'error', {+ text: `Trader wallet underfunded (${bal.sol.toFixed(5)} SOL). Fund ${cfgB.address} and retry.`,+ });res.end();return;}@@ -217,4 +240,6 @@ export default wrap(async (req, res) => {res.end();});-function delay(ms) { return new Promise((r) => setTimeout(r, ms)); }+function delay(ms) {+ return new Promise((r) => setTimeout(r, ms));+}diff --git a/api/developer/webhooks.js b/api/developer/webhooks.jsindex 50494a0ee..7a5c5e845 100644--- a/api/developer/webhooks.js+++ b/api/developer/webhooks.js@@ -6,6 +6,7 @@ import { getSessionUser } from '../_lib/auth.js';import { sql } from '../_lib/db.js';import { randomToken } from '../_lib/crypto.js';import { EVENT_TYPES } from '../_lib/webhook-dispatch.js';+import { assertPublicHttpsUrl } from '../_lib/ssrf.js';const MAX_WEBHOOKS_PER_USER = 10;const URL_MAX_LENGTH = 2048;@@ -24,8 +25,9 @@ export default wrap(async function handler(req, res) {order by created_at desc`;- const withStats = await Promise.all(webhooks.map(async (wh) => {- const [stats] = await sql`+ const withStats = await Promise.all(+ webhooks.map(async (wh) => {+ const [stats] = await sql`selectcount(*)::int as total,count(*) filter (where status_code between 200 and 299)::int as succeeded,@@ -34,8 +36,9 @@ export default wrap(async function handler(req, res) {from webhook_deliverieswhere webhook_id = ${wh.id} and created_at > now() - interval '7 days'`;- return { ...wh, stats_7d: stats };- }));+ return { ...wh, stats_7d: stats };+ }),+ );return json(res, 200, { webhooks: withStats, event_types: EVENT_TYPES });}@@ -51,7 +54,8 @@ export default wrap(async function handler(req, res) {const url = typeof body.url === 'string' ? body.url.trim() : '';if (!url) return error(res, 400, 'bad_request', 'url is required');- if (url.length > URL_MAX_LENGTH) return error(res, 400, 'bad_request', `url exceeds ${URL_MAX_LENGTH} characters`);+ if (url.length > URL_MAX_LENGTH)+ return error(res, 400, 'bad_request', `url exceeds ${URL_MAX_LENGTH} characters`);try {const parsed = new URL(url);@@ -61,15 +65,30 @@ export default wrap(async function handler(req, res) {} catch {return error(res, 400, 'bad_request', 'Invalid URL');}+ // Reject URLs that resolve to a private/loopback/link-local/metadata address+ // at registration time (SSRF). Delivery re-validates and pins per attempt.+ try {+ await assertPublicHttpsUrl(url);+ } catch {+ return error(res, 400, 'bad_request', 'Webhook URL must resolve to a public address');+ }- const events = Array.isArray(body.events) ? body.events.filter((e) => EVENT_TYPES.includes(e)) : [];- const description = typeof body.description === 'string' ? body.description.trim().slice(0, 200) : null;+ const events = Array.isArray(body.events)+ ? body.events.filter((e) => EVENT_TYPES.includes(e))+ : [];+ const description =+ typeof body.description === 'string' ? body.description.trim().slice(0, 200) : null;const [{ count: existing }] = await sql`select count(*)::int as count from developer_webhooks where user_id = ${user.id}`;if (existing >= MAX_WEBHOOKS_PER_USER) {- return error(res, 409, 'limit_reached', `Maximum ${MAX_WEBHOOKS_PER_USER} webhooks per account`);+ return error(+ res,+ 409,+ 'limit_reached',+ `Maximum ${MAX_WEBHOOKS_PER_USER} webhooks per account`,+ );}const secret = `whsec_${randomToken(24)}`;diff --git a/api/developer/webhooks/[id].js b/api/developer/webhooks/[id].jsindex 5506c3487..ac2639b98 100644--- a/api/developer/webhooks/[id].js+++ b/api/developer/webhooks/[id].js@@ -6,6 +6,7 @@ import { cors, error, json, method, readJson, wrap } from '../../_lib/http.js';import { getSessionUser } from '../../_lib/auth.js';import { sql } from '../../_lib/db.js';import { EVENT_TYPES } from '../../_lib/webhook-dispatch.js';+import { assertPublicHttpsUrl } from '../../_lib/ssrf.js';const URL_MAX_LENGTH = 2048;@@ -48,13 +49,27 @@ export default wrap(async function handler(req, res) {const updates = {};if (typeof body.url === 'string') {const trimmed = body.url.trim();- if (trimmed.length > URL_MAX_LENGTH) return error(res, 400, 'bad_request', 'URL too long');+ if (trimmed.length > URL_MAX_LENGTH)+ return error(res, 400, 'bad_request', 'URL too long');try {const parsed = new URL(trimmed);- if (parsed.protocol !== 'https:') return error(res, 400, 'bad_request', 'Must use HTTPS');+ if (parsed.protocol !== 'https:')+ return error(res, 400, 'bad_request', 'Must use HTTPS');} catch {return error(res, 400, 'bad_request', 'Invalid URL');}+ // SSRF: reject a URL that resolves to a non-public address (delivery+ // also re-validates and pins per attempt).+ try {+ await assertPublicHttpsUrl(trimmed);+ } catch {+ return error(+ res,+ 400,+ 'bad_request',+ 'Webhook URL must resolve to a public address',+ );+ }updates.url = trimmed;}if (Array.isArray(body.events)) {diff --git a/api/embed/resolve.js b/api/embed/resolve.jsindex b3f83490f..d9930952c 100644--- a/api/embed/resolve.js+++ b/api/embed/resolve.js@@ -22,6 +22,7 @@ import { DEMO_AVATARS } from '../_lib/demo-avatars.js';const ONCHAIN_RE = /^(?:eip155:)?(\d{1,9})[:/](\d{1,12})$/;const AVATAR_RE = /^avatar:([a-zA-Z0-9_-]{3,64})$/;+const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;@@ -82,6 +83,10 @@ export default wrap(async (req, res) => {});}+ // avatars.id is a uuid column — a non-UUID id here raises Postgres 22P02+ // (invalid input syntax) and surfaces as a 500. Treat it as not-found.+ if (!UUID_RE.test(avatarId)) return error(res, 404, 'not_found', 'avatar not found');+const rows = await sql`SELECT id, name, description, storage_key, thumbnail_keyFROM avatarsdiff --git a/api/feed.js b/api/feed.jsindex b73471924..fed5ddc04 100644--- a/api/feed.js+++ b/api/feed.js@@ -12,7 +12,8 @@ export default wrap(async (req, res) => {if (!method(req, res, ['GET'])) return;const url = new URL(req.url, 'http://x');- const limit = Number(url.searchParams.get('limit')) || 30;+ const rawLimit = Number(url.searchParams.get('limit'));+ const limit = Number.isFinite(rawLimit) ? Math.min(Math.max(Math.floor(rawLimit), 1), 100) : 30;const events = await readFeedEvents(limit);return json(diff --git a/api/ibm-mcp.js b/api/ibm-mcp.jsindex 824a16fa9..42bbc8326 100644--- a/api/ibm-mcp.js+++ b/api/ibm-mcp.js@@ -14,6 +14,7 @@import { cors, readJson, wrap } from './_lib/http.js';import { limits, clientIp } from './_lib/rate-limit.js';import { settlePayment, encodePaymentResponseHeader } from './_lib/x402-spec.js';+import { priceBatch } from './_lib/mcp-batch-price.js';import { PROTOCOL_VERSION, dispatch } from './_mcpibm/dispatch.js';import { graniteX402Amount } from './_mcpibm/pricing.js';import { isFreeTool } from './_mcpibm/catalog.js';@@ -29,20 +30,6 @@ import { sendX402Error } from './_mcp/payments.js';const RESOURCE_PATH = '/api/ibm-mcp';-// Peek the single called tool from a (possibly batched) JSON-RPC body so the-// x402 challenge advertises — and the settle path charges — exactly the per-tool-// price. Only a request calling ONE tool is priced per-tool; mixed batches and-// non-tools/call requests (initialize, tools/list, ping) yield null → no charge.-function peekCalledTool(body) {- const batch = Array.isArray(body) ? body : [body];- const calls = batch.filter((m) => m && m.method === 'tools/call');- if (calls.length === 1) {- const name = calls[0]?.params?.name;- return { toolName: typeof name === 'string' ? name : null };- }- return { toolName: null };-}-export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,HEAD,POST,DELETE,OPTIONS', origins: '*' })) return;@@ -55,21 +42,23 @@ export default wrap(async (req, res) => {// tool actually being called. Malformed JSON throws (status 400) → wrap().const body = await readJson(req, 2_000_000);- // Per-tool x402 price. A non-tools/call request (initialize, tools/list) or a- // mixed batch yields null → the flat env default, which the auth-gated- // discovery path never actually charges.- const { toolName } = peekCalledTool(body);- const x402Amount = toolName ? graniteX402Amount(toolName) : null;+ // x402 price for the WHOLE request — the sum of every priced Granite+ // tools/call in the (possibly batched) body. Charging the per-request total+ // (not just a lone call) stops a multi-call batch from running several billed+ // inferences for one tool's price. A discovery-only batch yields null.+ const { totalAmount: x402Amount, allFree } = priceBatch(body, {+ priceForTool: graniteX402Amount,+ isFreeName: isFreeTool,+ });- // A call to the free public ibm_granite_getting_started tool is served without- // an x402 payment or OAuth token so any client — including non-x402 hosts like- // watsonx Orchestrate — can discover the server before paying. isFreeTool is- // strict: only the registered, unpriced getting_started tool qualifies.+ // A batch composed solely of the free public ibm_granite_getting_started tool+ // is served without an x402 payment or OAuth token so any client — including+ // non-x402 hosts like watsonx Orchestrate — can discover the server first.const result = await authenticateRequest(req, res, {x402Amount,resourcePath: RESOURCE_PATH,challenge: GRANITE_CHALLENGE,- allowFree: Boolean(toolName && isFreeTool(toolName)),+ allowFree: allFree,});if (!result) return;const { auth, x402Ctx } = result;@@ -98,8 +87,12 @@ export default wrap(async (req, res) => {// Settle the x402 payment AFTER the work succeeded — atomic from the caller's// perspective: if settle fails, the payer's signed payload is not broadcast- // and they get an error instead of having paid for nothing.- if (x402Ctx) {+ // and they get an error instead of having paid for nothing. Only settle when+ // at least one call produced a result; a wholesale failure (every call errored+ // or returned isError) charges nothing. A partial failure still settles in+ // full so a single failing call can't reclaim the calls that succeeded.+ const anySuccess = responses.some((r) => r && !r.error && !(r.result && r.result.isError));+ if (x402Ctx && anySuccess) {try {const settled = await settlePayment({ verified: x402Ctx.verified });res.setHeader('x-payment-response', encodePaymentResponseHeader(settled));diff --git a/api/ibm/attest.js b/api/ibm/attest.jsindex b968be492..646a76d08 100644--- a/api/ibm/attest.js+++ b/api/ibm/attest.js@@ -70,9 +70,20 @@ async function verifyOnChain(signature, wallet) {try {tx = await conn.getParsedTransaction(signature, { maxSupportedTransactionVersion: 0 });} catch (e) {- return { signature, found: false, network: wallet.network, reason: String(e?.message || e) };+ return {+ signature,+ found: false,+ network: wallet.network,+ reason: String(e?.message || e),+ };}- if (!tx) return { signature, found: false, network: wallet.network, reason: 'transaction not found on this network' };+ if (!tx)+ return {+ signature,+ found: false,+ network: wallet.network,+ reason: 'transaction not found on this network',+ };const instructions = tx.transaction?.message?.instructions || [];let memo = null;@@ -150,14 +161,22 @@ async function graniteGuardian(cfg, text) {});const verdict = (out || '').trim().toLowerCase();const flagged = verdict.startsWith('yes');- return { flagged, risk: 'harm', label: flagged ? 'Harm' : 'Safe', verdict: flagged ? 'Yes' : 'No', model: model || GUARDIAN_MODEL };+ return {+ flagged,+ risk: 'harm',+ label: flagged ? 'Harm' : 'Safe',+ verdict: flagged ? 'Yes' : 'No',+ model: model || GUARDIAN_MODEL,+ };}// Build the on-chain memo for a claim — kept compact (the SPL-memo write is// truncated at 180 bytes by the wallet layer; we stay well under).function memoFor({ symbol, stats, governance, digest, tsModel }) {const arrow = stats.direction === 'up' ? '+' : stats.direction === 'down' ? '-' : '~';- const ts = String(tsModel || '').replace('ibm/granite-ttm-', 'ttm-').replace('-r2', '');+ const ts = String(tsModel || '')+ .replace('ibm/granite-ttm-', 'ttm-')+ .replace('-r2', '');const gd = governance?.passed === false ? 'flag' : governance?.passed === true ? 'ok' : 'na';return (`three.ws granite-proof/1 ${symbol || '?'} ${arrow}${Math.abs(stats.changePct).toFixed(1)}% ` +@@ -172,16 +191,34 @@ async function loadMarket(params) {let pool = (params.pool || '').trim();const token = (params.token || '').trim();if (!pool && token) {- if (!isBase58(token)) throw { status: 400, code: 'bad_token', message: 'token must be a base58 mint' };+ if (!isBase58(token))+ throw { status: 400, code: 'bad_token', message: 'token must be a base58 mint' };pool = await topPoolForToken(token, network);}if (!pool || !isBase58(pool)) {- throw { status: 400, code: 'bad_request', message: 'provide ?pool=<addr> or ?token=<mint>, or ?list=trending' };+ throw {+ status: 400,+ code: 'bad_request',+ message: 'provide ?pool=<addr> or ?token=<mint>, or ?list=trending',+ };}- const timeframe = ['minute', 'hour', 'day'].includes(params.timeframe) ? params.timeframe : 'hour';+ const timeframe = ['minute', 'hour', 'day'].includes(params.timeframe)+ ? params.timeframe+ : 'hour';const aggregate = Math.max(1, Math.min(60, parseInt(params.aggregate || '1', 10) || 1));- const { candles, base, quote, freq } = await fetchOhlcv({ pool, network, timeframe, aggregate, limit: 1000 });- if (candles.length < 64) throw { status: 422, code: 'insufficient_history', message: 'not enough candle history to chart this pool' };+ const { candles, base, quote, freq } = await fetchOhlcv({+ pool,+ network,+ timeframe,+ aggregate,+ limit: 1000,+ });+ if (candles.length < 64)+ throw {+ status: 422,+ code: 'insufficient_history',+ message: 'not enough candle history to chart this pool',+ };return { network, pool, timeframe, aggregate, candles, base, quote, freq };}@@ -196,7 +233,10 @@ async function runGranite(out, market, attesterAddress) {return out;}if (candles.length < 512) {- out.ibm = { configured: true, error: `need ≥512 candles for Granite TimeSeries, have ${candles.length}` };+ out.ibm = {+ configured: true,+ error: `need ≥512 candles for Granite TimeSeries, have ${candles.length}`,+ };return out;}@@ -219,7 +259,10 @@ async function runGranite(out, market, attesterAddress) {return out;}- const forecast = fc.timestamps.map((iso, i) => ({ t: Math.floor(Date.parse(iso) / 1000), c: Number(fc.values[i]) }));+ const forecast = fc.timestamps.map((iso, i) => ({+ t: Math.floor(Date.parse(iso) / 1000),+ c: Number(fc.values[i]),+ }));const currentPrice = values[values.length - 1];const forecastEnd = forecast[forecast.length - 1]?.c ?? currentPrice;const fVals = forecast.map((p) => p.c).filter(Number.isFinite);@@ -274,7 +317,12 @@ async function runGranite(out, market, attesterAddress) {const claim = {v: 'granite-proof/1',domain: 'three.ws',- token: { symbol: out.token.symbol, name: out.token.name, pool: out.token.pool, network: out.token.network },+ token: {+ symbol: out.token.symbol,+ name: out.token.name,+ pool: out.token.pool,+ network: out.token.network,+ },price: { current: Number(currentPrice), quote: out.token.quoteSymbol },forecast: {end: Number(forecastEnd),@@ -284,7 +332,11 @@ async function runGranite(out, market, attesterAddress) {direction: stats.direction,horizonHours: stats.horizonHours,},- models: { timeseries: fc.model, narrator: narration?.model || null, guardian: governance?.model || null },+ models: {+ timeseries: fc.model,+ narrator: narration?.model || null,+ guardian: governance?.model || null,+ },governance: { risk: governance?.risk || null, passed: governance?.passed ?? null },attester: attesterAddress || null,issuedAt: out.generatedAt,@@ -331,6 +383,16 @@ export default wrap(async (req, res) => {const rl = await limits.publicIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);+ // Global hourly ceiling on the shared watsonx server key (same bucket as+ // api/watsonx/embed) — a hard aggregate cost cap independent of any one IP.+ // Only consumed when watsonx is configured; the unconfigured fallback path+ // stays unaffected.+ if (watsonxConfig().configured) {+ const global = await limits.watsonxEmbedGlobal();+ if (!global.success)+ return rateLimited(res, global, 'watsonx capacity reached — try again shortly');+ }+const url = new URL(req.url, 'http://x');const wallet = avatarWalletConfig();@@ -344,7 +406,12 @@ export default wrap(async (req, res) => {if (req.method === 'GET' && url.searchParams.get('verify')) {const sig = url.searchParams.get('verify').trim();if (!/^[1-9A-HJ-NP-Za-km-z]{64,90}$/.test(sig)) {- return error(res, 400, 'bad_signature', 'verify expects a base58 transaction signature');+ return error(+ res,+ 400,+ 'bad_signature',+ 'verify expects a base58 transaction signature',+ );}const result = await verifyOnChain(sig, wallet);return json(res, 200, result, { 'cache-control': 'public, max-age=60' });@@ -378,7 +445,11 @@ export default wrap(async (req, res) => {const out = baseRecord(market);out.attester = wallet.configured- ? { address: wallet.address, network: wallet.network, explorer: explorerAccountUrl(wallet.address, wallet.network) }+ ? {+ address: wallet.address,+ network: wallet.network,+ explorer: explorerAccountUrl(wallet.address, wallet.network),+ }: { address: null, network: wallet.network, configured: false };await runGranite(out, market, wallet.address);diff --git a/api/ibm/galaxy.js b/api/ibm/galaxy.jsindex 4ece58d5a..4d91eefed 100644--- a/api/ibm/galaxy.js+++ b/api/ibm/galaxy.js@@ -20,8 +20,19 @@ import { cors, method, readJson, error, json, wrap, rateLimited } from '../_lib/import { limits, clientIp } from '../_lib/rate-limit.js';import { publicUrl } from '../_lib/r2.js';import { watsonxConfig, watsonxEmbed, watsonxChatComplete } from '../_lib/watsonx.js';-import { ensureAgentEmbeddings, readAgentVectors, agentEmbedText } from '../_lib/agent-embeddings.js';-import { projectTo3D, kmeans, suggestClusterCount, cosineSimilarity, unit, dot } from '../_lib/embedding-math.js';+import {+ ensureAgentEmbeddings,+ readAgentVectors,+ agentEmbedText,+} from '../_lib/agent-embeddings.js';+import {+ projectTo3D,+ kmeans,+ suggestClusterCount,+ cosineSimilarity,+ unit,+ dot,+} from '../_lib/embedding-math.js';import { createHash } from 'node:crypto';// Hard cap on agents in one galaxy — keeps embedding cost bounded and the scene@@ -38,8 +49,14 @@ const NEIGHBOR_K = 6;// IBM Carbon-derived palette — distinct, accessible hues for up to 8 themes.const CLUSTER_COLORS = [- '#4589ff', '#08bdba', '#a56eff', '#ff7eb6',- '#fa4d56', '#f1c21b', '#42be65', '#82cfff',+ '#4589ff',+ '#08bdba',+ '#a56eff',+ '#ff7eb6',+ '#fa4d56',+ '#f1c21b',+ '#42be65',+ '#82cfff',];let _cacheReady = null;@@ -85,7 +102,11 @@ function dataVersion(agents, model) {}function agentImage(a) {- return a.profile_image_url || a.avatar_url || (a.avatar_storage_key ? publicUrl(a.avatar_storage_key) : null);+ return (+ a.profile_image_url ||+ a.avatar_url ||+ (a.avatar_storage_key ? publicUrl(a.avatar_storage_key) : null)+ );}function agentUrl(a) {@@ -95,8 +116,10 @@ function agentUrl(a) {// ── Cluster naming ───────────────────────────────────────────────────────────const STOPWORDS = new Set(- ('a an the and or of to for with in on at by from your you our we is are be this that ' +- 'agent agents ai assistant bot help can will your their it its as your into about').split(' '),+ (+ 'a an the and or of to for with in on at by from your you our we is are be this that ' ++ 'agent agents ai assistant bot help can will your their it its as your into about'+ ).split(' '),);// Deterministic fallback theme name derived from the most frequent meaningful@@ -112,7 +135,10 @@ function keywordLabel(members) {counts.set(w, (counts.get(w) || 0) + 1);}}- const top = [...counts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 2).map(([w]) => w);+ const top = [...counts.entries()]+ .sort((a, b) => b[1] - a[1])+ .slice(0, 2)+ .map(([w]) => w);if (!top.length) return 'Mixed';return top.map((w) => w[0].toUpperCase() + w.slice(1)).join(' ');}@@ -130,10 +156,13 @@ function sanitizeLabel(text) {// Title-Case label; throws are caught by the caller, which falls back to// keywordLabel.async function graniteThemeLabel(cfg, members) {- const sample = members.slice(0, 8).map((m) => {- const desc = (m.description || '').replace(/\s+/g, ' ').slice(0, 120);- return `- ${m.name}: ${desc}`;- }).join('\n');+ const sample = members+ .slice(0, 8)+ .map((m) => {+ const desc = (m.description || '').replace(/\s+/g, ' ').slice(0, 120);+ return `- ${m.name}: ${desc}`;+ })+ .join('\n');const messages = [{role: 'system',@@ -202,7 +231,11 @@ async function buildGalaxy(cfg) {// Group members per cluster for naming + centroid placement.const groups = Array.from({ length: k }, () => []);for (let i = 0; i < kept.length; i++) {- groups[assignments[i]].push({ index: i, name: kept[i].name, description: kept[i].description });+ groups[assignments[i]].push({+ index: i,+ name: kept[i].name,+ description: kept[i].description,+ });}// Name every theme with Granite in parallel; degrade per-cluster to a@@ -324,7 +357,10 @@ async function handleGet(req, res) {const ageMs = Date.now() - new Date(cached.computed_at).getTime();if (ageMs < CACHE_TTL_MS) {res.setHeader('x-galaxy-cache', 'hit');- return json(res, 200, { ...cached.payload, meta: { ...cached.payload.meta, cache: 'hit' } });+ return json(res, 200, {+ ...cached.payload,+ meta: { ...cached.payload.meta, cache: 'hit' },+ });}}}@@ -343,7 +379,10 @@ async function handleGet(req, res) {`;}res.setHeader('x-galaxy-cache', forceRefresh ? 'refresh' : 'miss');- return json(res, 200, { ...payload, meta: { ...payload.meta, cache: forceRefresh ? 'refresh' : 'miss' } });+ return json(res, 200, {+ ...payload,+ meta: { ...payload.meta, cache: forceRefresh ? 'refresh' : 'miss' },+ });}// ── POST: semantic search ────────────────────────────────────────────────────@@ -351,7 +390,12 @@ async function handleGet(req, res) {async function handleSearch(req, res) {const cfg = watsonxConfig();if (!cfg.configured) {- return error(res, 503, 'watsonx_not_configured', 'IBM watsonx.ai is not configured on this deployment.');+ return error(+ res,+ 503,+ 'watsonx_not_configured',+ 'IBM watsonx.ai is not configured on this deployment.',+ );}let body;@@ -370,7 +414,8 @@ async function handleSearch(req, res) {const vectorMap = await readAgentVectors(ids, { model: cfg.embedModel });const { vectors, model } = await watsonxEmbed(cfg, { inputs: [query] });const qvec = vectors[0];- if (!qvec?.length) return error(res, 502, 'embed_failed', 'watsonx returned no query embedding');+ if (!qvec?.length)+ return error(res, 502, 'embed_failed', 'watsonx returned no query embedding');const ranked = [];for (const [id, vec] of vectorMap) {@@ -396,6 +441,16 @@ export default wrap(async (req, res) => {const rl = await limits.publicIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);+ // Global hourly ceiling on the shared watsonx server key (same bucket as+ // api/watsonx/embed) — a hard aggregate cost cap independent of any one IP.+ // Only consumed when watsonx is configured, i.e. when a request can+ // actually bill Granite inference.+ if (watsonxConfig().configured) {+ const global = await limits.watsonxEmbedGlobal();+ if (!global.success)+ return rateLimited(res, global, 'watsonx capacity reached — try again shortly');+ }+if (req.method === 'POST') return handleSearch(req, res);return handleGet(req, res);});diff --git a/api/ibm/oracle.js b/api/ibm/oracle.jsindex 273aa6441..47edc9449 100644--- a/api/ibm/oracle.js+++ b/api/ibm/oracle.js@@ -59,7 +59,11 @@ function marketUpstreamError(res, err) {const upstream = err?.status;const status = upstream === 429 ? 503 : upstream === 404 ? 404 : 502;const code =- status === 503 ? 'upstream_rate_limited' : status === 404 ? 'pool_not_found' : 'upstream_error';+ status === 503+ ? 'upstream_rate_limited'+ : status === 404+ ? 'pool_not_found'+ : 'upstream_error';return error(res, status, code, `market data upstream: ${err?.message || 'unavailable'}`, {retryable: status === 503,});@@ -72,13 +76,28 @@ export default wrap(async (req, res) => {const rl = await limits.publicIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);+ // Global hourly ceiling on the shared watsonx server key (same bucket as+ // api/watsonx/embed) — a hard aggregate cost cap independent of any one IP.+ // Only consumed when watsonx is configured, i.e. when a request can+ // actually bill Granite inference.+ if (watsonxConfig().configured) {+ const global = await limits.watsonxEmbedGlobal();+ if (!global.success)+ return rateLimited(res, global, 'watsonx capacity reached — try again shortly');+ }+const params = new URL(req.url, 'http://x').searchParams;// ── Picker: trending Solana pools ────────────────────────────────────────if (params.get('list') === 'trending') {try {const pools = await trendingPools('solana', 8);- return json(res, 200, { pools }, { 'cache-control': 'public, max-age=30, s-maxage=60' });+ return json(+ res,+ 200,+ { pools },+ { 'cache-control': 'public, max-age=30, s-maxage=60' },+ );} catch (err) {return marketUpstreamError(res, err);}diff --git a/api/ibm/twin.js b/api/ibm/twin.jsindex 547d87634..8000bb075 100644--- a/api/ibm/twin.js+++ b/api/ibm/twin.js@@ -506,6 +506,16 @@ export default wrap(async (req, res) => {const rl = await limits.publicIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);+ // Global hourly ceiling on the shared watsonx server key (same bucket as+ // api/watsonx/embed) — a hard aggregate cost cap independent of any one IP.+ // Only consumed when watsonx is configured; the keyless candles-only path+ // stays unaffected.+ if (watsonxConfig().configured) {+ const global = await limits.watsonxEmbedGlobal();+ if (!global.success)+ return rateLimited(res, global, 'watsonx capacity reached — try again shortly');+ }+if (req.method === 'POST') return handlePost(req, res);return handleGet(req, res);});diff --git a/api/ibm/vision.js b/api/ibm/vision.jsindex d0faf537a..1c12df3a5 100644--- a/api/ibm/vision.js+++ b/api/ibm/vision.js@@ -27,7 +27,8 @@ import { assertSafePublicUrl } from '../_lib/ssrf-guard.js';// Granite Vision 3.2 (2B) is the default multimodal model on watsonx.ai. Override// per account/region with WATSONX_VISION_MODEL_ID.-export const VISION_MODEL = process.env.WATSONX_VISION_MODEL_ID?.trim() || 'ibm/granite-vision-3-2-2b';+export const VISION_MODEL =+ process.env.WATSONX_VISION_MODEL_ID?.trim() || 'ibm/granite-vision-3-2-2b';// The exact watsonx.ai chat payload for a Granite Vision read: a system message// plus a user message whose content is the multimodal block array Granite expects@@ -93,6 +94,16 @@ export default wrap(async (req, res) => {const rl = await limits.publicIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);+ // Global hourly ceiling on the shared watsonx server key (same bucket as+ // api/watsonx/embed) — a hard aggregate cost cap independent of any one IP.+ // Only consumed when watsonx is configured, i.e. when a request can+ // actually bill Granite inference.+ if (watsonxConfig().configured) {+ const global = await limits.watsonxEmbedGlobal();+ if (!global.success)+ return rateLimited(res, global, 'watsonx capacity reached — try again shortly');+ }+if (req.method === 'GET') return handleSubjects(req, res);return handleVision(req, res);});@@ -181,7 +192,9 @@ async function handleVision(req, res) {// model_unavailable gives the operator a clear signal to check WATSONX_VISION_MODEL_ID// or the regional model catalogue; vision_failed covers everything else.const msg = String(e?.message || 'watsonx vision request failed');- const code = /not.*found|not.*deployed|unsupported.*model/i.test(msg) ? 'model_unavailable' : 'vision_failed';+ const code = /not.*found|not.*deployed|unsupported.*model/i.test(msg)+ ? 'model_unavailable'+ : 'vision_failed';return error(res, 502, code, msg);}@@ -206,7 +219,8 @@ async function resolveImage(body) {const commaAt = image.indexOf(',');const b64 = commaAt >= 0 ? image.slice(commaAt + 1) : '';if (!b64) throw fail(400, 'bad_image', 'image data URL is empty');- if (b64.length * 0.75 > MAX_IMAGE_BYTES) throw fail(413, 'image_too_large', 'image exceeds 6MB');+ if (b64.length * 0.75 > MAX_IMAGE_BYTES)+ throw fail(413, 'image_too_large', 'image exceeds 6MB');return image;}@@ -238,7 +252,11 @@ async function fetchImageAsDataUrl(url) {while (true) {const host = hostOf(current);if (!/^https:\/\//i.test(current) || !host || !allowedImageHost(host)) {- throw fail(400, 'image_host_not_allowed', 'image redirect target host is not allowed');+ throw fail(+ 400,+ 'image_host_not_allowed',+ 'image redirect target host is not allowed',+ );}await assertSafePublicUrl(current);resp = await fetch(current, { signal: controller.signal, redirect: 'manual' });@@ -259,7 +277,8 @@ async function fetchImageAsDataUrl(url) {}if (!resp.ok) throw fail(502, 'image_fetch_failed', `image fetch returned ${resp.status}`);const ct = (resp.headers.get('content-type') || '').split(';')[0].trim().toLowerCase();- if (!ct.startsWith('image/')) throw fail(415, 'not_an_image', `unexpected content-type: ${ct || 'unknown'}`);+ if (!ct.startsWith('image/'))+ throw fail(415, 'not_an_image', `unexpected content-type: ${ct || 'unknown'}`);const len = Number(resp.headers.get('content-length') || 0);if (len && len > MAX_IMAGE_BYTES) throw fail(413, 'image_too_large', 'image exceeds 6MB');const buf = Buffer.from(await resp.arrayBuffer());@@ -277,7 +296,9 @@ function fail(status, code, message) {// ── Prompting ────────────────────────────────────────────────────────────────export function buildPrompt(subject, hint) {- const hintLine = hint ? `\nThe person who made it adds: "${hint}". Take it into account but trust your eyes first.` : '';+ const hintLine = hint+ ? `\nThe person who made it adds: "${hint}". Take it into account but trust your eyes first.`+ : '';if (subject === 'token') {return {system:@@ -352,9 +373,16 @@ export function parseVision(text) {out.bio = str(obj.bio).slice(0, 200);out.voice = str(obj.voice).slice(0, 120);out.tone_tags = Array.isArray(obj.tone_tags)- ? obj.tone_tags.map((t) => str(t).toLowerCase().slice(0, 24)).filter(Boolean).slice(0, 8)+ ? obj.tone_tags+ .map((t) => str(t).toLowerCase().slice(0, 24))+ .filter(Boolean)+ .slice(0, 8): typeof obj.tone_tags === 'string'- ? obj.tone_tags.split(',').map((t) => t.trim().toLowerCase()).filter(Boolean).slice(0, 8)+ ? obj.tone_tags+ .split(',')+ .map((t) => t.trim().toLowerCase())+ .filter(Boolean)+ .slice(0, 8): [];return out;}diff --git a/api/img.js b/api/img.jsindex a669c7719..9e41e53d8 100644--- a/api/img.js+++ b/api/img.js@@ -73,8 +73,16 @@ export default wrap(async function handler(req, res) {const seed = url.searchParams.get('seed') || target || '';if (!target) return error(res, 400, 'missing_url', 'url query parameter is required');- // data: URIs are already inline and same-origin-safe — nothing to proxy.- if (target.startsWith('data:')) return redirect(res, target, 302);+ // data: URIs are not proxyable targets — redirecting to attacker-supplied+ // data: content is an open-redirect/content-injection vector. Reject.+ if (/^data:/i.test(target.trim())) {+ return error(+ res,+ 400,+ 'invalid_url',+ 'data: URIs cannot be proxied — pass an http(s) or ipfs URL',+ );+ }let image = null;for (const candidate of candidates(target)) {diff --git a/api/kol/[action].js b/api/kol/[action].jsindex 8ba795062..98e8ac41c 100644--- a/api/kol/[action].js+++ b/api/kol/[action].js@@ -1,10 +1,12 @@// Consolidated KOL endpoints dispatcher.-import { readFile, writeFile } from 'node:fs/promises';+import { readFile } from 'node:fs/promises';import path from 'node:path';import { fileURLToPath } from 'node:url';import { cors, json, method, readJson, wrap, error, rateLimited } from '../_lib/http.js';import { limits, clientIp } from '../_lib/rate-limit.js';+import { requireAdmin } from '../_lib/admin.js';+import { putObject, getObjectBuffer } from '../_lib/r2.js';// ── wallets (Birdeye P&L proxy) ───────────────────────────────────────────────@@ -108,7 +110,11 @@ const WALLETS_PATH = path.resolve('../../src/kol/wallets.json',);-async function loadWallets() {+// Imported wallets live in R2 — the Vercel filesystem is read-only at runtime,+// so writes to the bundled wallets.json can never persist (or even succeed).+const WALLETS_R2_KEY = 'kol/wallets.json';++async function loadBundledWallets() {try {return JSON.parse(await readFile(WALLETS_PATH, 'utf8'));} catch {@@ -116,6 +122,24 @@ async function loadWallets() {}}+async function loadImportedWallets() {+ try {+ const buf = await getObjectBuffer(WALLETS_R2_KEY);+ const parsed = JSON.parse(buf.toString('utf8'));+ return Array.isArray(parsed) ? parsed : [];+ } catch {+ return []; // nothing imported yet (or storage unreachable) — bundled list only+ }+}++// Merged view: R2-stored imports take precedence over the bundled seed file.+async function loadWallets() {+ const [bundled, imported] = await Promise.all([loadBundledWallets(), loadImportedWallets()]);+ const byWallet = new Map(bundled.map((w) => [w.wallet, w]));+ for (const w of imported) byWallet.set(w.wallet, w);+ return [...byWallet.values()];+}+// ── import-gmgn ───────────────────────────────────────────────────────────────async function handleImportGmgn(req, res) {@@ -123,6 +147,9 @@ async function handleImportGmgn(req, res) {if (!method(req, res, ['POST'])) return;const rl = await limits.mcpIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);+ // Writes the tracked-wallet list that downstream KOL surfaces read — admin only.+ const admin = await requireAdmin(req, res);+ if (!admin) return;const body = await readJson(req);if (!body || body.rawJson == null)return error(res, 400, 'validation_error', 'body.rawJson is required');@@ -137,7 +164,16 @@ async function handleImportGmgn(req, res) {const byWallet = new Map(existing.map((w) => [w.wallet, w]));for (const entry of parsed) byWallet.set(entry.wallet, entry);const merged = [...byWallet.values()];- await writeFile(WALLETS_PATH, JSON.stringify(merged, null, '\t') + '\n', 'utf8');+ try {+ await putObject({+ key: WALLETS_R2_KEY,+ body: JSON.stringify(merged, null, '\t') + '\n',+ contentType: 'application/json',+ });+ } catch (err) {+ console.error('[kol/import-gmgn] R2 write failed:', err?.message || err);+ return error(res, 503, 'storage_unavailable', 'failed to persist imported wallets');+ }return json(res, 200, { imported: parsed.length, wallets: merged });}@@ -168,6 +204,9 @@ async function handleLeaderboard(req, res) {async function handleTrades(req, res) {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;if (!method(req, res, ['GET'])) return;+ // fetchKolTrades fans out one Helius call per tracked wallet — meter per IP.+ const rl = await limits.mcpIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);const url = new URL(req.url, 'http://x');const mint = url.searchParams.get('mint');const limit = Math.min(100, Math.max(1, Number(url.searchParams.get('limit') || '20')));diff --git a/api/kol/trades.js b/api/kol/trades.jsindex 7203af28e..74c3e5e58 100644--- a/api/kol/trades.js+++ b/api/kol/trades.js@@ -1,4 +1,5 @@-import { cors, error, json, method, wrap } from '../_lib/http.js';+import { cors, error, json, method, wrap, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';import { KOL_WALLETS } from '../../src/kol/wallets.js';import { fetchKolTrades } from '../../src/kol/trades.js';@@ -6,6 +7,10 @@ export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;if (!method(req, res, ['GET'])) return;+ // fetchKolTrades fans out one Helius call per tracked wallet — meter per IP.+ const rl = await limits.mcpIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);+const url = new URL(req.url, 'http://x');const mint = url.searchParams.get('mint');const limit = Math.min(100, parseInt(url.searchParams.get('limit') || '20', 10));diff --git a/api/launchpad/publish.js b/api/launchpad/publish.jsindex eaafe05d5..81dfa2985 100644--- a/api/launchpad/publish.js+++ b/api/launchpad/publish.js@@ -10,20 +10,23 @@// The studio stores it in localStorage keyed by slug.// • Subsequent publishes that change anything must include either:// (a) a matching `ownerSecret` in the request body, OR-// (b) an authenticated session whose user_id matches the row, OR-// (c) the same payout wallet as the existing row.+// (b) an authenticated session whose user_id matches the row.// • Without one of those, slug is treated as taken (409 slug_taken).+// (Matching the row's payout wallet is deliberately NOT accepted: the+// owner wallet is publicly readable via /api/launchpad/get, so it would+// let anyone overwrite any page.)//// This lets anonymous CMS-style editing work end-to-end: publish from a// browser → edit later from the same browser → secret travels with the-// localStorage draft. Lose the secret AND the wallet AND the session → you-// can't edit. That's the right tradeoff for a no-auth surface.+// localStorage draft. Lose the secret AND the session → you can't edit.+// That's the right tradeoff for a no-auth surface.import { createHash, randomBytes } from 'node:crypto';import { sql } from '../_lib/db.js';import { authenticateBearer, extractBearer, getSessionUser } from '../_lib/auth.js';import { cors, error, json, method, readJson, wrap, rateLimited } from '../_lib/http.js';import { clientIp, limits } from '../_lib/rate-limit.js';+import { env } from '../_lib/env.js';import { z } from 'zod';const SLUG_RE = /^[a-z0-9](?:[a-z0-9-]{0,38}[a-z0-9])?$/;@@ -49,36 +52,40 @@ const bodySchema = z.object({wallet: z.string().min(20).max(64),website: z.string().max(300).optional().default(''),theme: z.enum(['light', 'dark']).default('light'),- socials: z.object({- twitter: z.string().max(200).optional().default(''),- telegram: z.string().max(200).optional().default(''),- discord: z.string().max(200).optional().default(''),- }).optional(),+ socials: z+ .object({+ twitter: z.string().max(200).optional().default(''),+ telegram: z.string().max(200).optional().default(''),+ discord: z.string().max(200).optional().default(''),+ })+ .optional(),}),avatar: z.object({- src: z.string().min(1).max(500),+ src: z.string().min(1).max(500),name: z.string().max(80),}),copy: z.object({headline: z.string().max(120),- tagline: z.string().max(280),- cta: z.string().max(40),+ tagline: z.string().max(280),+ cta: z.string().max(40),}),- token: z.object({- name: z.string().max(80).optional().default(''),- ticker: z.string().max(10).optional().default(''),- supply: z.number().int().nonnegative().optional().default(0),- description: z.string().max(500).optional().default(''),- imageUrl: z.string().max(500).optional().default(''),- mint: z.string().max(64).optional().default(''),- }).optional(),+ token: z+ .object({+ name: z.string().max(80).optional().default(''),+ ticker: z.string().max(10).optional().default(''),+ supply: z.number().int().nonnegative().optional().default(0),+ description: z.string().max(500).optional().default(''),+ imageUrl: z.string().max(500).optional().default(''),+ mint: z.string().max(64).optional().default(''),+ })+ .optional(),agentSkills: z.array(skillSchema).max(20).optional().default([]),scene: z.object({ src: z.string().max(500).optional().default('') }).optional(),monetize: z.object({- kind: z.string().max(40),- price: z.number().nonnegative(),+ kind: z.string().max(40),+ price: z.number().nonnegative(),currency: z.string().max(10),- chain: z.string().max(20),+ chain: z.string().max(20),}),});@@ -117,7 +124,9 @@ export default wrap(async (req, res) => {const parsed = bodySchema.safeParse(body);if (!parsed.success) {const issue = parsed.error.issues[0];- return error(res, 400, 'validation_error', issue?.message || 'invalid input', { path: issue?.path });+ return error(res, 400, 'validation_error', issue?.message || 'invalid input', {+ path: issue?.path,+ });}const data = parsed.data;@@ -144,14 +153,21 @@ export default wrap(async (req, res) => {ownerSecret = randomBytes(32).toString('hex');ownerSecretHash = hashSecret(ownerSecret);} else {- // Edit auth: any of (a) matching secret, (b) same session user, (c) same wallet.- const secretOk = data.ownerSecret &&+ // Edit auth: (a) matching secret, or (b) same session user. The row's+ // payout wallet is public (returned by /api/launchpad/get), so knowing it+ // proves nothing — it must never grant edit rights.+ const secretOk =+ data.ownerSecret &&existing.owner_secret_hash &&hashSecret(data.ownerSecret) === existing.owner_secret_hash;const sessionOk = auth?.userId && existing.user_id === auth.userId;- const walletOk = existing.owner_wallet?.toLowerCase() === data.identity.wallet.toLowerCase();- if (!secretOk && !sessionOk && !walletOk) {- return error(res, 409, 'slug_taken', 'that slug is already published — pick a different one');+ if (!secretOk && !sessionOk) {+ return error(+ res,+ 409,+ 'slug_taken',+ 'that slug is already published — pick a different one',+ );}// Existing row keeps its secret unless the publisher is rotating it.ownerSecretHash = existing.owner_secret_hash;@@ -163,13 +179,13 @@ export default wrap(async (req, res) => {}const config = {- identity: data.identity,- avatar: data.avatar,- copy: data.copy,- token: data.token || {},+ identity: data.identity,+ avatar: data.avatar,+ copy: data.copy,+ token: data.token || {},agentSkills: data.agentSkills || [],- scene: data.scene || {},- monetize: data.monetize,+ scene: data.scene || {},+ monetize: data.monetize,};const tokenMint = data.token?.mint?.trim() || null;@@ -190,13 +206,9 @@ export default wrap(async (req, res) => {updated_at = now()`;- const origin = req.headers['x-forwarded-host']- ? `https://${req.headers['x-forwarded-host']}`- : 'https://three.ws';-const out = {slug: data.slug,- url: `${origin}/p/${data.slug}`,+ url: `${env.APP_ORIGIN}/p/${data.slug}`,publishedAt: new Date().toISOString(),};// Only return the secret on first publish (or first time we minted one fordiff --git a/api/llm/anthropic.js b/api/llm/anthropic.jsindex b002f3674..448ca90ff 100644--- a/api/llm/anthropic.js+++ b/api/llm/anthropic.js@@ -44,36 +44,60 @@ function getRedis() {const MODELS = {// Anthropic (paid — host's key)- 'claude-fable-5': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },- 'claude-mythos-5': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },- 'claude-opus-4-7': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },- 'claude-opus-4-6': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },- 'claude-sonnet-4-6': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },- 'claude-haiku-4-5-20251001': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },+ 'claude-fable-5': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },+ 'claude-mythos-5': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },+ 'claude-opus-4-7': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },+ 'claude-opus-4-6': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },+ 'claude-sonnet-4-6': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },+ 'claude-haiku-4-5-20251001': { kind: 'anthropic', envKey: 'ANTHROPIC_API_KEY' },// OpenRouter free tier (no per-token cost; daily rate cap shared across host).// All are tool-call capable in OpenRouter's catalog.- 'meta-llama/llama-3.3-70b-instruct:free': { kind: 'openai', provider: 'openrouter', envKey: 'OPENROUTER_API_KEY' },- 'openai/gpt-oss-120b:free': { kind: 'openai', provider: 'openrouter', envKey: 'OPENROUTER_API_KEY' },- 'nousresearch/hermes-3-llama-3.1-405b:free': { kind: 'openai', provider: 'openrouter', envKey: 'OPENROUTER_API_KEY' },+ 'meta-llama/llama-3.3-70b-instruct:free': {+ kind: 'openai',+ provider: 'openrouter',+ envKey: 'OPENROUTER_API_KEY',+ },+ 'openai/gpt-oss-120b:free': {+ kind: 'openai',+ provider: 'openrouter',+ envKey: 'OPENROUTER_API_KEY',+ },+ 'nousresearch/hermes-3-llama-3.1-405b:free': {+ kind: 'openai',+ provider: 'openrouter',+ envKey: 'OPENROUTER_API_KEY',+ },// Groq free tier (sub-second latency; per-IP+per-key minute caps).- 'llama-3.3-70b-versatile': { kind: 'openai', provider: 'groq', envKey: 'GROQ_API_KEY' },- 'llama-3.1-8b-instant': { kind: 'openai', provider: 'groq', envKey: 'GROQ_API_KEY' },+ 'llama-3.3-70b-versatile': { kind: 'openai', provider: 'groq', envKey: 'GROQ_API_KEY' },+ 'llama-3.1-8b-instant': { kind: 'openai', provider: 'groq', envKey: 'GROQ_API_KEY' },// NVIDIA NIM free tier (build.nvidia.com). One nvapi key, OpenAI-compatible,// tool-call capable. Used both as directly-selectable models and as a free// fallback ahead of paid Anthropic in the chain below.- 'nvidia/llama-3.3-nemotron-super-49b-v1.5': { kind: 'openai', provider: 'nvidia', envKey: 'NVIDIA_API_KEY' },- 'nvidia/nvidia-nemotron-nano-9b-v2': { kind: 'openai', provider: 'nvidia', envKey: 'NVIDIA_API_KEY' },- 'meta/llama-4-maverick-17b-128e-instruct': { kind: 'openai', provider: 'nvidia', envKey: 'NVIDIA_API_KEY' },+ 'nvidia/llama-3.3-nemotron-super-49b-v1.5': {+ kind: 'openai',+ provider: 'nvidia',+ envKey: 'NVIDIA_API_KEY',+ },+ 'nvidia/nvidia-nemotron-nano-9b-v2': {+ kind: 'openai',+ provider: 'nvidia',+ envKey: 'NVIDIA_API_KEY',+ },+ 'meta/llama-4-maverick-17b-128e-instruct': {+ kind: 'openai',+ provider: 'nvidia',+ envKey: 'NVIDIA_API_KEY',+ },};const UPSTREAM_URL = {- anthropic: 'https://api.anthropic.com/v1/messages',+ anthropic: 'https://api.anthropic.com/v1/messages',openrouter: 'https://openrouter.ai/api/v1/chat/completions',- groq: 'https://api.groq.com/openai/v1/chat/completions',- nvidia: 'https://integrate.api.nvidia.com/v1/chat/completions',+ groq: 'https://api.groq.com/openai/v1/chat/completions',+ nvidia: 'https://integrate.api.nvidia.com/v1/chat/completions',};const FIRST_PARTY = ['three.ws', 'localhost'];@@ -146,7 +170,10 @@ function warnQuotaDegraded(err) {const t = Date.now();if (t - _quotaWarnedAt < 60_000) return;_quotaWarnedAt = t;- console.warn('[llm/anthropic] quota-counter redis degraded, failing open:', err?.message || err);+ console.warn(+ '[llm/anthropic] quota-counter redis degraded, failing open:',+ err?.message || err,+ );}async function incrementMonthlyQuota(agentId) {@@ -166,6 +193,24 @@ async function incrementMonthlyQuota(agentId) {}}+// Read-only peek at the monthly call counter — used for the pre-flight quota+// check so a request that never reaches a provider (validation error, upstream+// 429/5xx across the whole fallback chain) doesn't consume quota. The counter+// is only incremented after a successful upstream response, mirroring the+// token-budget pattern (getMonthlyTokens before / addMonthlyTokens after).+async function getMonthlyQuotaUsed(agentId) {+ const r = getRedis();+ if (!r) return 0;+ const key = `llm:quota:${agentId}:${monthKey()}`;+ try {+ const v = await r.get(key);+ return typeof v === 'number' ? v : parseInt(v || '0', 10) || 0;+ } catch (err) {+ warnQuotaDegraded(err);+ return 0;+ }+}+async function getMonthlyTokens(agentId) {const r = getRedis();if (!r) return 0;@@ -249,7 +294,12 @@ export default wrap(async (req, res) => {const originHeader = req.headers.origin || req.headers.referer || '';if (!originAllowed(originHeader, policy)) {- return error(res, 403, 'embed_denied_origin', "origin not permitted by this agent's embed policy");+ return error(+ res,+ 403,+ 'embed_denied_origin',+ "origin not permitted by this agent's embed policy",+ );}const ipRl = await limits.embedLlmIp(clientIp(req));@@ -262,9 +312,10 @@ export default wrap(async (req, res) => {}const quota = policy.brain?.monthly_quota;- if (typeof quota === 'number' && quota !== null) {- const used = await incrementMonthlyQuota(agentId);- if (used > quota) {+ const quotaEnforced = typeof quota === 'number' && quota !== null;+ if (quotaEnforced) {+ const used = await getMonthlyQuotaUsed(agentId);+ if (used >= quota) {return error(res, 429, 'quota_exceeded', `monthly quota of ${quota} calls reached`);}}@@ -277,7 +328,8 @@ export default wrap(async (req, res) => {const rawBody = await readJson(req);const body = parse(bodySchema, rawBody);- const requestedModel = body.model || policy.brain?.model || 'meta-llama/llama-3.3-70b-instruct:free';+ const requestedModel =+ body.model || policy.brain?.model || 'meta-llama/llama-3.3-70b-instruct:free';// Ordered fallback chain for 429 / 5xx from OpenRouter free tier:// 1. Requested model (e.g. llama-3.3-70b:free)@@ -291,11 +343,11 @@ export default wrap(async (req, res) => {// empty completion to the embedded agent.const modelFallbacks = [requestedModel,- ...([+ ...['meta-llama/llama-3.1-8b-instruct:free','meta/llama-4-maverick-17b-128e-instruct','claude-haiku-4-5-20251001',- ].filter((m) => m !== requestedModel)),+ ].filter((m) => m !== requestedModel),];const isStreaming = body.stream === true;@@ -318,27 +370,33 @@ export default wrap(async (req, res) => {const apiKey = process.env[route.envKey];if (!apiKey) {if (attempt === 0) {- return error(res, 503, 'provider_unavailable', `${route.envKey} not configured on host`);+ return error(+ res,+ 503,+ 'provider_unavailable',+ `${route.envKey} not configured on host`,+ );}continue;}usedRoute = route;- const upstreamUrl = route.kind === 'anthropic' ? UPSTREAM_URL.anthropic : UPSTREAM_URL[route.provider];+ const upstreamUrl =+ route.kind === 'anthropic' ? UPSTREAM_URL.anthropic : UPSTREAM_URL[route.provider];const upstreamHeaders =route.kind === 'anthropic'? {'content-type': 'application/json','anthropic-version': '2023-06-01','x-api-key': apiKey,- }+ }: {'content-type': 'application/json',authorization: `Bearer ${apiKey}`,...(route.provider === 'openrouter'? { 'HTTP-Referer': 'https://three.ws', 'X-Title': 'three.ws agent' }: {}),- };+ };const upstreamBody =route.kind === 'anthropic'? JSON.stringify({ ...body, model: usedModel })@@ -364,7 +422,7 @@ export default wrap(async (req, res) => {if (attempt + 1 < modelFallbacks.length) {console.warn(`[llm/anthropic] ${provider}/${usedModel} returned ${upstream.status} — ` +- `falling back to ${modelFallbacks[attempt + 1]}`,+ `falling back to ${modelFallbacks[attempt + 1]}`,);continue;}@@ -397,18 +455,27 @@ export default wrap(async (req, res) => {if (usedModel !== requestedModel) {console.info(`[llm/anthropic] agentId=${agentId} used fallback model ${usedModel} ` +- `(requested: ${requestedModel})`,+ `(requested: ${requestedModel})`,);}break;}if (!usedRoute || !upstream) {- return json(res, 503, { error: 'provider_unavailable', message: 'no configured fallback model is available' });+ return json(res, 503, {+ error: 'provider_unavailable',+ message: 'no configured fallback model is available',+ });}const route = usedRoute;+ // Charge the monthly call quota only now that an upstream provider actually+ // accepted the request — failed/rate-limited upstream attempts stay free.+ // incrementMonthlyQuota fails open internally, so a counter outage can't 500+ // an already-accepted call.+ if (quotaEnforced) await incrementMonthlyQuota(agentId);+// ── Streaming path ────────────────────────────────────────────────────────if (isStreaming) {res.statusCode = 200;@@ -437,8 +504,10 @@ export default wrap(async (req, res) => {if (!line.startsWith('data: ')) continue;try {const ev = JSON.parse(line.slice(6));- if (ev.type === 'message_start') inputTokens = ev.message?.usage?.input_tokens ?? 0;- if (ev.type === 'message_delta') outputTokens = ev.usage?.output_tokens ?? 0;+ if (ev.type === 'message_start')+ inputTokens = ev.message?.usage?.input_tokens ?? 0;+ if (ev.type === 'message_delta')+ outputTokens = ev.usage?.output_tokens ?? 0;} catch {// not every data line is JSON (e.g. [DONE]) — skip}@@ -473,8 +542,19 @@ export default wrap(async (req, res) => {model: usedModel,inputTokens,outputTokens,- costMicroUsd: costMicroUsd({ provider: route.provider || 'anthropic', model: usedModel, input: inputTokens, output: outputTokens }),- meta: { model: usedModel, requested_model: requestedModel, input_tokens: inputTokens, output_tokens: outputTokens, upstream_status: upstream.status },+ costMicroUsd: costMicroUsd({+ provider: route.provider || 'anthropic',+ model: usedModel,+ input: inputTokens,+ output: outputTokens,+ }),+ meta: {+ model: usedModel,+ requested_model: requestedModel,+ input_tokens: inputTokens,+ output_tokens: outputTokens,+ upstream_status: upstream.status,+ },});return;}@@ -525,8 +605,19 @@ export default wrap(async (req, res) => {model: usedModel,inputTokens,outputTokens,- costMicroUsd: costMicroUsd({ provider: route.provider || 'anthropic', model: usedModel, input: inputTokens, output: outputTokens }),- meta: { model: usedModel, requested_model: requestedModel, input_tokens: inputTokens, output_tokens: outputTokens, upstream_status: upstream.status },+ costMicroUsd: costMicroUsd({+ provider: route.provider || 'anthropic',+ model: usedModel,+ input: inputTokens,+ output: outputTokens,+ }),+ meta: {+ model: usedModel,+ requested_model: requestedModel,+ input_tokens: inputTokens,+ output_tokens: outputTokens,+ upstream_status: upstream.status,+ },});res.statusCode = 200;@@ -726,7 +817,10 @@ async function pipeOpenAIAsAnthropic(upstream, res, { model }) {function finishToolBlocks() {for (const slot of toolBlocks.values()) {if (slot.started && !slot.finished) {- write({ type: 'content_block_stop', index: slot.anthropicIndex }, 'content_block_stop');+ write(+ { type: 'content_block_stop', index: slot.anthropicIndex },+ 'content_block_stop',+ );slot.finished = true;}}@@ -776,7 +870,13 @@ async function pipeOpenAIAsAnthropic(upstream, res, { model }) {const idx = tc.index ?? 0;let slot = toolBlocks.get(idx);if (!slot) {- slot = { started: false, finished: false, name: '', id: null, argsBuf: '' };+ slot = {+ started: false,+ finished: false,+ name: '',+ id: null,+ argsBuf: '',+ };toolBlocks.set(idx, slot);}if (!slot.started && (tc.id || tc.function?.name)) {@@ -791,7 +891,10 @@ async function pipeOpenAIAsAnthropic(upstream, res, { model }) {{type: 'content_block_delta',index: slot.anthropicIndex,- delta: { type: 'input_json_delta', partial_json: tc.function.arguments },+ delta: {+ type: 'input_json_delta',+ partial_json: tc.function.arguments,+ },},'content_block_delta',);diff --git a/api/mcp-3d.js b/api/mcp-3d.jsindex 5c912ac41..6074e69c1 100644--- a/api/mcp-3d.js+++ b/api/mcp-3d.js@@ -8,8 +8,16 @@import { cors, readJson, wrap } from './_lib/http.js';import { limits, clientIp } from './_lib/rate-limit.js';import { peekCalledTool } from './_lib/mcp-dispatch.js';+import { settlePayment, encodePaymentResponseHeader } from './_lib/x402-spec.js';import { PROTOCOL_VERSION, dispatch, isPublicTool } from './_mcp3d/dispatch.js';-import { send401, sendJsonRpcError, authenticateRequest, handleSse, handleTerminate } from './_mcp/auth.js';+import {+ send401,+ sendJsonRpcError,+ authenticateRequest,+ handleSse,+ handleTerminate,+} from './_mcp/auth.js';+import { sendX402Error } from './_mcp/payments.js';export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,HEAD,POST,DELETE,OPTIONS', origins: '*' })) return;@@ -27,7 +35,7 @@ export default wrap(async (req, res) => {allowFree: Boolean(toolName && isPublicTool(toolName)),});if (!result) return;- const { auth } = result;+ const { auth, x402Ctx } = result;const ipRl = await limits.mcpIp(clientIp(req));if (!ipRl.success)@@ -49,6 +57,27 @@ export default wrap(async (req, res) => {if (r !== null) responses.push(r);}+ // 3D Studio is operator-funded: OAuth users run tools for free (bounded by+ // rate limits), and connecting "with an x402 wallet" is honored. When a caller+ // DID present an x402 payment, settle it so the connection actually costs the+ // nominal minimum and the same signed payment can't be replayed for unlimited+ // free GPU work. Only settle if a call succeeded — a wholesale failure is free.+ if (x402Ctx) {+ const anySuccess = responses.some((r) => r && !r.error && !(r.result && r.result.isError));+ if (anySuccess) {+ try {+ const settled = await settlePayment({ verified: x402Ctx.verified });+ res.setHeader('x-payment-response', encodePaymentResponseHeader(settled));+ } catch (err) {+ return sendX402Error(+ res,+ { resourceUrl: x402Ctx.resourceUrl, accepts: x402Ctx.requirements },+ err,+ );+ }+ }+ }+res.statusCode = 200;res.setHeader('content-type', 'application/json; charset=utf-8');res.setHeader('mcp-protocol-version', PROTOCOL_VERSION);diff --git a/api/mcp-agent.js b/api/mcp-agent.jsindex 15a1fcb0f..53eb5bf76 100644--- a/api/mcp-agent.js+++ b/api/mcp-agent.js@@ -5,9 +5,17 @@// Registered with the MCP Registry as io.github.nirholas/threews-agent.import { cors, readJson, wrap } from './_lib/http.js';import { limits, clientIp } from './_lib/rate-limit.js';+import { settlePayment, encodePaymentResponseHeader } from './_lib/x402-spec.js';import { peekCalledTool } from './_lib/mcp-dispatch.js';import { PROTOCOL_VERSION, dispatch, isPublicTool } from './_mcpagent/dispatch.js';-import { send401, sendJsonRpcError, authenticateRequest, handleSse, handleTerminate } from './_mcp/auth.js';+import {+ send401,+ sendJsonRpcError,+ authenticateRequest,+ handleSse,+ handleTerminate,+} from './_mcp/auth.js';+import { sendX402Error } from './_mcp/payments.js';export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,HEAD,POST,DELETE,OPTIONS', origins: '*' })) return;@@ -25,7 +33,7 @@ export default wrap(async (req, res) => {allowFree: Boolean(toolName && isPublicTool(toolName)),});if (!result) return;- const { auth } = result;+ const { auth, x402Ctx } = result;const ipRl = await limits.mcpIp(clientIp(req));if (!ipRl.success)@@ -47,6 +55,26 @@ export default wrap(async (req, res) => {if (r !== null) responses.push(r);}+ // When the caller presented an x402 payment, settle it AFTER the work+ // succeeded — same atomic verify → work → settle sequence as /api/mcp. The+ // advertised 402 price is only ever charged once useful work was delivered;+ // a wholesale failure leaves the payer's signed payload un-broadcast.+ if (x402Ctx) {+ const anySuccess = responses.some((r) => r && !r.error && !(r.result && r.result.isError));+ if (anySuccess) {+ try {+ const settled = await settlePayment({ verified: x402Ctx.verified });+ res.setHeader('x-payment-response', encodePaymentResponseHeader(settled));+ } catch (err) {+ return sendX402Error(+ res,+ { resourceUrl: x402Ctx.resourceUrl, accepts: x402Ctx.requirements },+ err,+ );+ }+ }+ }+res.statusCode = 200;res.setHeader('content-type', 'application/json; charset=utf-8');res.setHeader('mcp-protocol-version', PROTOCOL_VERSION);diff --git a/api/mcp-bazaar.js b/api/mcp-bazaar.jsindex 5cffb91ec..1a4c04711 100644--- a/api/mcp-bazaar.js+++ b/api/mcp-bazaar.js@@ -7,9 +7,17 @@// Registry as io.github.nirholas/three-ws-x402-bazaar (see server-bazaar.json).import { cors, readJson, wrap } from './_lib/http.js';import { limits, clientIp } from './_lib/rate-limit.js';+import { settlePayment, encodePaymentResponseHeader } from './_lib/x402-spec.js';import { peekCalledTool } from './_lib/mcp-dispatch.js';import { PROTOCOL_VERSION, dispatch, isPublicTool } from './_mcpbazaar/dispatch.js';-import { send401, sendJsonRpcError, authenticateRequest, handleSse, handleTerminate } from './_mcp/auth.js';+import {+ send401,+ sendJsonRpcError,+ authenticateRequest,+ handleSse,+ handleTerminate,+} from './_mcp/auth.js';+import { sendX402Error } from './_mcp/payments.js';export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,HEAD,POST,DELETE,OPTIONS', origins: '*' })) return;@@ -27,7 +35,7 @@ export default wrap(async (req, res) => {allowFree: Boolean(toolName && isPublicTool(toolName)),});if (!result) return;- const { auth } = result;+ const { auth, x402Ctx } = result;const ipRl = await limits.mcpIp(clientIp(req));if (!ipRl.success)@@ -49,6 +57,26 @@ export default wrap(async (req, res) => {if (r !== null) responses.push(r);}+ // When the caller presented an x402 payment, settle it AFTER the work+ // succeeded — same atomic verify → work → settle sequence as /api/mcp. The+ // advertised 402 price is only ever charged once useful work was delivered;+ // a wholesale failure leaves the payer's signed payload un-broadcast.+ if (x402Ctx) {+ const anySuccess = responses.some((r) => r && !r.error && !(r.result && r.result.isError));+ if (anySuccess) {+ try {+ const settled = await settlePayment({ verified: x402Ctx.verified });+ res.setHeader('x-payment-response', encodePaymentResponseHeader(settled));+ } catch (err) {+ return sendX402Error(+ res,+ { resourceUrl: x402Ctx.resourceUrl, accepts: x402Ctx.requirements },+ err,+ );+ }+ }+ }+res.statusCode = 200;res.setHeader('content-type', 'application/json; charset=utf-8');res.setHeader('mcp-protocol-version', PROTOCOL_VERSION);diff --git a/api/mcp.js b/api/mcp.jsindex 35ade6ff6..1895605f2 100644--- a/api/mcp.js+++ b/api/mcp.js@@ -4,24 +4,17 @@ import { cors, readJson, wrap } from './_lib/http.js';import { limits, clientIp } from './_lib/rate-limit.js';import { settlePayment, encodePaymentResponseHeader } from './_lib/x402-spec.js';import { x402AmountForTool } from './_lib/pump-pricing.js';+import { priceBatch } from './_lib/mcp-batch-price.js';import { PROTOCOL_VERSION, dispatch, isPublicTool } from './_mcp/dispatch.js';-import { send401, sendJsonRpcError, authenticateRequest, handleSse, handleTerminate } from './_mcp/auth.js';+import {+ send401,+ sendJsonRpcError,+ authenticateRequest,+ handleSse,+ handleTerminate,+} from './_mcp/auth.js';import { sendX402Error } from './_mcp/payments.js';-// Peek the single called tool name from a (possibly batched) JSON-RPC body so-// the x402 challenge can advertise — and the settle path charge — exactly the-// per-tool price. We only special-case a request that calls ONE tool; mixed-// batches keep the flat default. Returns { toolName } | { toolName: null }.-function peekCalledTool(body) {- const batch = Array.isArray(body) ? body : [body];- const calls = batch.filter((m) => m && m.method === 'tools/call');- if (calls.length === 1) {- const name = calls[0]?.params?.name;- return { toolName: typeof name === 'string' ? name : null };- }- return { toolName: null };-}-export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,HEAD,POST,DELETE,OPTIONS', origins: '*' })) return;@@ -34,17 +27,22 @@ export default wrap(async (req, res) => {// handled by wrap() — identical to the previous post-auth read.const body = await readJson(req, 2_000_000);- // Derive the per-tool x402 price. The advertised 402 amount and the settled- // charge are both keyed off this, so we never advertise a price the flow- // won't honor. A free tool yields null → no per-call charge is required.- const { toolName } = peekCalledTool(body);- const x402Amount = toolName ? x402AmountForTool(toolName) : null;+ // Derive the x402 price for the WHOLE request by summing the per-tool price+ // of every tools/call in the (possibly batched) body. The advertised 402+ // amount, the verified payment, and the settled charge are all keyed off this+ // total, so a multi-call batch can never run several priced tools for one+ // tool's price. A fully-free batch yields null → no charge.+ const { totalAmount: x402Amount, allFree } = priceBatch(body, {+ priceForTool: x402AmountForTool,+ isFreeName: isPublicTool,+ });- // A call to the free public getting_started tool is served without an OAuth- // token or x402 payment so any client can discover the server first.+ // A batch composed solely of free public tools (e.g. getting_started) is+ // served without an OAuth token or x402 payment so any client can discover+ // the server first.const result = await authenticateRequest(req, res, {x402Amount,- allowFree: Boolean(toolName && isPublicTool(toolName)),+ allowFree: allFree,});if (!result) return;const { auth, x402Ctx } = result;@@ -63,8 +61,7 @@ export default wrap(async (req, res) => {const batch = Array.isArray(body) ? body : [body];// Per-request batch cap — each message can trigger DB queries, so an// unbounded batch multiplies rate-limited work by N against the user's budget.- if (batch.length > 32)- return sendJsonRpcError(res, null, -32600, 'batch too large (max 32)');+ if (batch.length > 32) return sendJsonRpcError(res, null, -32600, 'batch too large (max 32)');const responses = [];for (const msg of batch) {@@ -75,7 +72,14 @@ export default wrap(async (req, res) => {// Settle the x402 payment AFTER the work succeeded — atomic from the caller's// perspective: if settle fails, the payer's signed payload is not broadcast// and they get a 502 instead of having paid for nothing.- if (x402Ctx) {+ //+ // Only settle when at least one call actually produced a result. If every+ // call failed (JSON-RPC error or a tool result flagged isError), no useful+ // work was delivered, so we do not broadcast the payment. We deliberately do+ // NOT void settlement on a *partial* failure: a single failing call in a+ // batch must not let the caller reclaim the expensive calls that succeeded.+ const anySuccess = responses.some((r) => r && !r.error && !(r.result && r.result.isError));+ if (x402Ctx && anySuccess) {try {const settled = await settlePayment({ verified: x402Ctx.verified });res.setHeader('x-payment-response', encodePaymentResponseHeader(settled));diff --git a/api/monetization/wallet.js b/api/monetization/wallet.jsindex 015161e39..882797080 100644--- a/api/monetization/wallet.js+++ b/api/monetization/wallet.js@@ -9,6 +9,7 @@ import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.import { cors, json, method, wrap, error, readJson, rateLimited } from '../_lib/http.js';import { parse, isValidSolanaAddress, isValidEvmAddress } from '../_lib/validate.js';import { limits, clientIp } from '../_lib/rate-limit.js';+import { requireCsrf } from '../_lib/csrf.js';const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;@@ -52,7 +53,8 @@ export default wrap(async (req, res) => {WHERE id = ${agentId} AND deleted_at IS NULL`;if (!agent) return error(res, 404, 'not_found', 'Agent not found');- if (agent.user_id !== userId) return error(res, 403, 'forbidden', 'You don\'t own this agent');+ if (agent.user_id !== userId)+ return error(res, 403, 'forbidden', "You don't own this agent");}// Fetch all wallets for the user, optionally filtered by agent_id@@ -72,7 +74,9 @@ export default wrap(async (req, res) => {// Also build a summary view: resolve which addresses would be used for each chainconst evmWallet = wallets.find(- (w) => (w.chain === 'base' || w.chain === 'evm') && (agentId ? w.agent_id === agentId : true),+ (w) =>+ (w.chain === 'base' || w.chain === 'evm') &&+ (agentId ? w.agent_id === agentId : true),);const solanaWallet = wallets.find((w) => w.chain === 'solana' && (agentId ? w.agent_id === agentId : true),@@ -89,6 +93,10 @@ export default wrap(async (req, res) => {}// PUT — set/update payout addresses+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt+ // (the token itself proves intent and isn't auto-attached by browsers).+ if (!(await requireCsrf(req, res, userId))) return;+const body = parse(putBody, await readJson(req));const { agent_id, evm_address, solana_address, preferred_network } = body;@@ -98,18 +106,33 @@ export default wrap(async (req, res) => {WHERE id = ${agent_id} AND deleted_at IS NULL`;if (!agent) return error(res, 404, 'not_found', 'Agent not found');- if (agent.user_id !== userId) return error(res, 403, 'forbidden', 'You don\'t own this agent');+ if (agent.user_id !== userId) return error(res, 403, 'forbidden', "You don't own this agent");// Validate addresses if providedif (evm_address && !isValidEvmAddress(evm_address)) {- return error(res, 400, 'validation_error', 'Invalid EVM address (must start with 0x, 42 characters)');+ return error(+ res,+ 400,+ 'validation_error',+ 'Invalid EVM address (must start with 0x, 42 characters)',+ );}if (solana_address && !isValidSolanaAddress(solana_address)) {- return error(res, 400, 'validation_error', 'Invalid Solana address (must be base58, 32-44 characters)');+ return error(+ res,+ 400,+ 'validation_error',+ 'Invalid Solana address (must be base58, 32-44 characters)',+ );}if (!evm_address && !solana_address) {- return error(res, 400, 'validation_error', 'At least one address (evm_address or solana_address) is required');+ return error(+ res,+ 400,+ 'validation_error',+ 'At least one address (evm_address or solana_address) is required',+ );}const results = [];diff --git a/api/nft/mint-scene.js b/api/nft/mint-scene.jsindex 247153d5d..e96b6b73e 100644--- a/api/nft/mint-scene.js+++ b/api/nft/mint-scene.js@@ -1,6 +1,7 @@import { env } from '../_lib/env.js';import { wrap, cors, error, json, readJson, method, rateLimited } from '../_lib/http.js';import { limits, clientIp } from '../_lib/rate-limit.js';+import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.js';import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';import { mplCore, createV1 } from '@metaplex-foundation/mpl-core';import {@@ -31,16 +32,23 @@ async function uploadToNftStorage(token, bytes, contentType) {}export default wrap(async (req, res) => {- if (cors(req, res)) return;+ if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;if (!method(req, res, ['POST'])) return;const storageToken = env.NFT_STORAGE_TOKEN;- if (!storageToken)- return error(res, 503, 'not_configured', 'NFT_STORAGE_TOKEN not configured');+ if (!storageToken) return error(res, 503, 'not_configured', 'NFT_STORAGE_TOKEN not configured');const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);+ // The uploads below run on the platform's NFT.Storage token — never let an+ // anonymous caller push arbitrary blobs to IPFS on our account.+ const session = await getSessionUser(req);+ const bearer = session ? null : await authenticateBearer(extractBearer(req));+ if (!session && !bearer) {+ return error(res, 401, 'unauthorized', 'sign in or provide a valid bearer token');+ }+const body = await readJson(req);const { ownerPubkey, glbBase64, thumbnailBase64, name, description } = body || {};@@ -56,16 +64,8 @@ export default wrap(async (req, res) => {let glbUri, thumbUri;try {[glbUri, thumbUri] = await Promise.all([- uploadToNftStorage(- storageToken,- Buffer.from(glbBase64, 'base64'),- 'model/gltf-binary',- ),- uploadToNftStorage(- storageToken,- Buffer.from(thumbnailBase64, 'base64'),- 'image/png',- ),+ uploadToNftStorage(storageToken, Buffer.from(glbBase64, 'base64'), 'model/gltf-binary'),+ uploadToNftStorage(storageToken, Buffer.from(thumbnailBase64, 'base64'), 'image/png'),]);} catch (e) {return error(res, e.status || 502, e.code || 'upstream_error', e.message);diff --git a/api/permissions/[action].js b/api/permissions/[action].jsindex 5e725acc0..d181c828a 100644--- a/api/permissions/[action].js+++ b/api/permissions/[action].js@@ -401,7 +401,11 @@ async function handleList(req, res) {LIMIT 1`;} catch (err) {- console.error('[permissions/list] wallet ownership query failed', err?.code, err?.message || err);+ console.error(+ '[permissions/list] wallet ownership query failed',+ err?.code,+ err?.message || err,+ );return error(res, 500, 'db_error', 'Failed to list delegations');}if (!wallet) {@@ -495,6 +499,11 @@ async function handleMetadata(req, res) {const agentId = url.searchParams.get('agentId');if (!agentId) return error(res, 400, 'missing_param', 'agentId is required');+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;+ if (!UUID_RE.test(agentId)) {+ return error(res, 400, 'invalid_id', 'agentId must be a valid UUID');+ }+const chainIdParam = url.searchParams.get('chainId');const chainId = chainIdParam ? parseInt(chainIdParam, 10) : null;if (chainIdParam && (Number.isNaN(chainId) || chainId <= 0)) {@@ -657,11 +666,11 @@ function periodStart(period) {}const PERMISSIONS_PUBLIC_RPCS = {- 1: 'https://cloudflare-eth.com',- 8453: 'https://mainnet.base.org',- 84532: 'https://sepolia.base.org',+ 1: 'https://cloudflare-eth.com',+ 8453: 'https://mainnet.base.org',+ 84532: 'https://sepolia.base.org',11155111: 'https://rpc.sepolia.org',- 421614: 'https://sepolia-rollup.arbitrum.io/rpc',+ 421614: 'https://sepolia-rollup.arbitrum.io/rpc',11155420: 'https://sepolia.optimism.io',};@@ -804,15 +813,17 @@ async function handleRedeem(req, res) {// Sum ETH values in this requestconst requestAmount = calls.reduce((s, c) => s + BigInt(c.value), 0n);- // Query period history+ // Query period history. Sum as numeric, truncate to an integer, and return+ // as text so the cap check stays BigInt end-to-end — Number round-trips+ // lose precision above 2^53 (routine for 18-decimal tokens).const [histRow] = await sql`- SELECT COALESCE(SUM((meta->>'amount')::numeric), 0) AS spent+ SELECT trunc(COALESCE(SUM((meta->>'amount')::numeric), 0))::text AS spentFROM usage_eventsWHERE kind = 'permissions.redeem'AND meta->>'delegation_id' = ${id}AND created_at >= ${pStart.toISOString()}`;- const historicalSpend = BigInt(Math.floor(Number(histRow?.spent ?? '0')));+ const historicalSpend = BigInt(histRow?.spent ?? '0');if (requestAmount + historicalSpend > maxAmount) {return error(@@ -843,14 +854,16 @@ async function handleRedeem(req, res) {requestAmount += decoded;}+ // Sum as numeric → trunc → text so the cap check stays BigInt end-to-end+ // (Number loses precision above 2^53 — routine for 18-decimal tokens).const [histRow] = await sql`- SELECT COALESCE(SUM((meta->>'amount')::numeric), 0) AS spent+ SELECT trunc(COALESCE(SUM((meta->>'amount')::numeric), 0))::text AS spentFROM usage_eventsWHERE kind = 'permissions.redeem'AND meta->>'delegation_id' = ${id}AND created_at >= ${pStart.toISOString()}`;- const historicalSpend = BigInt(Math.floor(Number(histRow?.spent ?? '0')));+ const historicalSpend = BigInt(histRow?.spent ?? '0');if (requestAmount + historicalSpend > maxAmount) {return error(@@ -959,7 +972,10 @@ const revokeBodySchema = z.object({const revokeIface = new Interface(DELEGATION_MANAGER_ABI);const _revokeEvent = revokeIface.getEvent('DisabledDelegation');-if (!_revokeEvent) throw new Error('DisabledDelegation event not found in DELEGATION_MANAGER_ABI — check src/erc7710/abi.js');+if (!_revokeEvent)+ throw new Error(+ 'DisabledDelegation event not found in DELEGATION_MANAGER_ABI — check src/erc7710/abi.js',+ );const DISABLED_TOPIC = _revokeEvent.topicHash;const RPC_TIMEOUT_MS = 5000;@@ -1184,7 +1200,13 @@ async function handleVerify(req, res) {res.setHeader('cache-control', 'no-store');// Don't leak the upstream error string to the client — log it (above) and// return a stable code. The internal message goes to server logs only.- res.end(JSON.stringify({ ok: false, error: 'rpc_error', error_description: 'on-chain verification failed' }));+ res.end(+ JSON.stringify({+ ok: false,+ error: 'rpc_error',+ error_description: 'on-chain verification failed',+ }),+ );return;}diff --git a/api/plugins/[action].js b/api/plugins/[action].jsindex 4efb59129..771e7dca2 100644--- a/api/plugins/[action].js+++ b/api/plugins/[action].js@@ -14,6 +14,7 @@ import { sql } from '../_lib/db.js';import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.js';import { cors, error, json, method, readJson, wrap, rateLimited } from '../_lib/http.js';import { limits, clientIp } from '../_lib/rate-limit.js';+import { fetchSafePublicUrl, SsrfBlockedError } from '../_lib/ssrf-guard.js';const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;@@ -53,14 +54,15 @@ async function resolveAuth(req) {// ── Row → API shape ───────────────────────────────────────────────────────────function toPlugin(row) {- const price = row.asset_price_amount != null- ? {- amount: String(row.asset_price_amount),- currency_mint: row.asset_price_currency_mint,- chain: row.asset_price_chain,- mint_decimals: row.asset_price_mint_decimals ?? 6,- }- : null;+ const price =+ row.asset_price_amount != null+ ? {+ amount: String(row.asset_price_amount),+ currency_mint: row.asset_price_currency_mint,+ chain: row.asset_price_chain,+ mint_decimals: row.asset_price_mint_decimals ?? 6,+ }+ : null;return {id: row.id,identifier: row.identifier,@@ -72,9 +74,7 @@ function toPlugin(row) {tags: row.tags || [],install_count: row.install_count || 0,avg_rating: Number(row.avg_rating) || 0,- author: row.author_id- ? { id: row.author_id, display_name: row.author_display_name }- : null,+ author: row.author_id ? { id: row.author_id, display_name: row.author_display_name } : null,created_at: row.created_at,price,};@@ -226,19 +226,32 @@ async function handleImport(req, res) {if (!['https:', 'http:'].includes(parsed.protocol))return error(res, 400, 'validation_error', 'manifest_url must be http or https');- // Fetch the manifest server-side to avoid CORS issues+ // Fetch the manifest server-side to avoid CORS issues. fetchSafePublicUrl+ // DNS-resolves the host (and every redirect hop) and rejects private,+ // loopback, link-local, and cloud-metadata ranges so a user-supplied+ // manifest_url can't be used to probe internal services (SSRF).let manifest;try {const ac = new AbortController();const timer = setTimeout(() => ac.abort(), FETCH_TIMEOUT_MS);- const resp = await fetch(manifestUrl, { signal: ac.signal });- clearTimeout(timer);+ let resp;+ try {+ resp = await fetchSafePublicUrl(+ manifestUrl,+ { signal: ac.signal },+ { allowHttp: true },+ );+ } finally {+ clearTimeout(timer);+ }if (!resp.ok) throw new Error(`HTTP ${resp.status}`);const text = await resp.text();if (text.length > MAX_MANIFEST_BYTES)throw new Error(`Manifest exceeds ${MAX_MANIFEST_BYTES / 1024}KB limit`);manifest = JSON.parse(text);} catch (err) {+ if (err instanceof SsrfBlockedError)+ return error(res, 400, 'validation_error', `manifest_url rejected: ${err.message}`);return error(res, 422, 'fetch_failed', `Could not fetch manifest: ${err.message}`);}diff --git a/api/pump-fun-mcp.js b/api/pump-fun-mcp.jsindex 1e6626224..e90748bd9 100644--- a/api/pump-fun-mcp.js+++ b/api/pump-fun-mcp.js@@ -21,6 +21,8 @@ import { limits, clientIp } from './_lib/rate-limit.js';import { extractBearer, authenticateBearer } from './_lib/auth.js';import {verifyPayment,+ settlePayment,+ encodePaymentResponseHeader,resolveResourceUrl,paymentRequirements,build402Body,@@ -131,7 +133,9 @@ async function handleGetTokenDetails({ mint, network = 'mainnet' }) {uri,decimals,supply,- mintAuthority: mintAccount.mintAuthorityOption ? mintAccount.mintAuthority.toString() : null,+ mintAuthority: mintAccount.mintAuthorityOption+ ? mintAccount.mintAuthority.toString()+ : null,freezeAuthority: mintAccount.freezeAuthorityOption? mintAccount.freezeAuthority.toString(): null,@@ -205,7 +209,10 @@ function indexerOrUnavailable(name) {// Map our tool names to the upstream bot's tool surface.const upstreamMap = {searchTokens: { tool: 'searchTokens', args: { query: args.query, limit: args.limit } },- getTokenTrades: { tool: 'getTokenTrades', args: { mint: args.mint, limit: args.limit } },+ getTokenTrades: {+ tool: 'getTokenTrades',+ args: { mint: args.mint, limit: args.limit },+ },getTrendingTokens: { tool: 'getTrendingTokens', args: { limit: args.limit } },getNewTokens: { tool: 'getNewTokens', args: { limit: args.limit } },getGraduatedTokens: { tool: 'getGraduatedTokens', args: { limit: args.limit } },@@ -276,9 +283,17 @@ const VANITY_MAX_ATTEMPTS_CEILING = 1_500_000;// hit astronomically unlikely within the budget and just burns CPU.const VANITY_MAX_PATTERN_LEN = 4;-async function handleVanityMint({ suffix = '', prefix = '', caseSensitive = false, maxAttempts = 1_500_000 }) {+async function handleVanityMint({+ suffix = '',+ prefix = '',+ caseSensitive = false,+ maxAttempts = 1_500_000,+}) {if (!suffix && !prefix) throw rpcError(-32602, 'at least one of suffix or prefix is required');- if (String(suffix).length > VANITY_MAX_PATTERN_LEN || String(prefix).length > VANITY_MAX_PATTERN_LEN)+ if (+ String(suffix).length > VANITY_MAX_PATTERN_LEN ||+ String(prefix).length > VANITY_MAX_PATTERN_LEN+ )throw rpcError(-32602, `suffix/prefix must each be ≤ ${VANITY_MAX_PATTERN_LEN} characters`);const budget = Math.min(VANITY_MAX_ATTEMPTS_CEILING,@@ -288,7 +303,13 @@ async function handleVanityMint({ suffix = '', prefix = '', caseSensitive = falsconst timer = setTimeout(() => ac.abort(), 58_000);let result;try {- result = await generateVanityKey({ suffix, prefix, caseSensitive, maxAttempts: budget, signal: ac.signal });+ result = await generateVanityKey({+ suffix,+ prefix,+ caseSensitive,+ maxAttempts: budget,+ signal: ac.signal,+ });} finally {clearTimeout(timer);}@@ -304,7 +325,6 @@ async function handleVanityMint({ suffix = '', prefix = '', caseSensitive = fals};}-// ── Claims handlers (on-chain) ─────────────────────────────────────────────const PUMP_CLAIM_PROGRAMS = new Set([@@ -328,7 +348,9 @@ async function _fetchClaimsFromChain({ creator, limit = 20, network = 'mainnet',maxSupportedTransactionVersion: 0,commitment: 'confirmed',});- } catch { continue; }+ } catch {+ continue;+ }if (!tx) continue;const allIxs = [...(tx.transaction.message.instructions ?? []),@@ -363,9 +385,9 @@ async function handleWatchClaims({ creator, durationMs = 300_000, network = 'maireturn { creator, network, windowMs: window, claims };}-async function handleSocialCashtagSentiment({ posts }) {- if (!Array.isArray(posts) || posts.length === 0) throw rpcError(-32602, 'posts must be a non-empty array');+ if (!Array.isArray(posts) || posts.length === 0)+ throw rpcError(-32602, 'posts must be a non-empty array');const { scoreSentiment } = await import('../src/social/sentiment.js');return scoreSentiment(posts);}@@ -376,7 +398,13 @@ async function handleGetFirstClaims({ sinceMinutes = 60, limit = 20 }) {return { items };}-async function handleQuoteSwap({ inputMint, outputMint, amountIn, slippageBps, network = 'mainnet' }) {+async function handleQuoteSwap({+ inputMint,+ outputMint,+ amountIn,+ slippageBps,+ network = 'mainnet',+}) {if (!solanaPubkey(inputMint)) throw rpcError(-32602, 'invalid inputMint');if (!solanaPubkey(outputMint)) throw rpcError(-32602, 'invalid outputMint');const WSOL = 'So11111111111111111111111111111111111111112';@@ -393,9 +421,11 @@ async function handleQuoteSwap({ inputMint, outputMint, amountIn, slippageBps, nconst { buyQuoteInput, sellBaseInput } = await import('@pump-fun/pump-swap-sdk');const BNMod = await import('bn.js');const BN = BNMod.default || BNMod;- const { poolKey, pool, baseReserve, quoteReserve, baseMintAccount, globalConfig, feeConfig } = state;+ const { poolKey, pool, baseReserve, quoteReserve, baseMintAccount, globalConfig, feeConfig } =+ state;const amountBn = new BN(String(amountIn));- const slip = (slippageBps ?? 100) / 10_000;+ // pump-swap-sdk takes slippage as a PERCENT (1 = 1%): `1 ± slippage / 100`.+ const slip = (slippageBps ?? 100) / 100;const shared = {slippage: slip,baseReserve,@@ -413,13 +443,17 @@ async function handleQuoteSwap({ inputMint, outputMint, amountIn, slippageBps, namountOut = r.base;const num = amountBn.mul(baseReserve);const denom = amountOut.mul(quoteReserve);- priceImpactBps = denom.isZero() ? 0 : Math.max(0, num.muln(10_000).div(denom).subn(10_000).toNumber());+ priceImpactBps = denom.isZero()+ ? 0+ : Math.max(0, num.muln(10_000).div(denom).subn(10_000).toNumber());} else {const r = sellBaseInput({ base: amountBn, ...shared });amountOut = r.uiQuote;const spot = quoteReserve.mul(amountBn);const exec = amountOut.mul(baseReserve);- priceImpactBps = spot.isZero() ? 0 : Math.max(0, spot.sub(exec).muln(10_000).div(spot).toNumber());+ priceImpactBps = spot.isZero()+ ? 0+ : Math.max(0, spot.sub(exec).muln(10_000).div(spot).toNumber());}return {amountOut: amountOut.toString(),@@ -448,7 +482,11 @@ async function handleSocialXPostImpact({ postUrl, mint, windowMin = 30, networkid: postId,ts,author: od.author_name ?? null,- text: od.html?.replace(/<[^>]*>/g, ' ').replace(/\s+/g, ' ').trim() ?? null,+ text:+ od.html+ ?.replace(/<[^>]*>/g, ' ')+ .replace(/\s+/g, ' ')+ .trim() ?? null,};}} catch {}@@ -485,7 +523,6 @@ async function handleSocialXPostImpact({ postUrl, mint, windowMin = 30, network};}-// ── pumpfun_watch_whales ───────────────────────────────────────────────────const NATIVE_SOL_MINT = 'So11111111111111111111111111111111111111112';@@ -728,33 +765,43 @@ const AUTH_REQUIRED_TOOLS = new Set(['pumpfun_watch_claims',]);-// Verify the request is authenticated for a gated tool. Returns true on success;-// on failure it writes the JSON-RPC error envelope and returns false. Accepts a-// bearer (API key / OAuth JWT) or a verified X-PAYMENT header.+// Verify the request is authenticated for a gated tool. Returns+// `{ x402Ctx }` on success — x402Ctx is null for bearer auth, and carries the+// verified payment envelope for x402 callers so the dispatcher can settle it+// AFTER the tool succeeds (verify → work → settle, same sequence as /api/mcp).+// On failure it writes the JSON-RPC error envelope and returns null.async function authorizeGatedTool(req, res, id) {const bearer = extractBearer(req);if (bearer) {const auth = await authenticateBearer(bearer).catch(() => null);- if (auth) return true;- json(res, 401, rpcEnvelope(id, null, {- code: -32001,- message: 'authentication required: invalid or expired bearer token',- }));- return false;+ if (auth) return { x402Ctx: null };+ json(+ res,+ 401,+ rpcEnvelope(id, null, {+ code: -32001,+ message: 'authentication required: invalid or expired bearer token',+ }),+ );+ return null;}const paymentHeader = req.headers['x-payment'];if (paymentHeader) {const resourceUrl = resolveResourceUrl(req, '/api/pump-fun-mcp');const requirements = paymentRequirements(resourceUrl);try {- await verifyPayment({ paymentHeader, requirements });- return true;+ const verified = await verifyPayment({ paymentHeader, requirements });+ return { x402Ctx: { resourceUrl, requirements, verified } };} catch (err) {- json(res, 402, rpcEnvelope(id, null, {- code: -32402,- message: `payment verification failed: ${err?.message || 'invalid payment'}`,- }));- return false;+ json(+ res,+ 402,+ rpcEnvelope(id, null, {+ code: -32402,+ message: `payment verification failed: ${err?.message || 'invalid payment'}`,+ }),+ );+ return null;}}// No bearer, no payment: answer 402 Payment Required with the full x402@@ -772,12 +819,17 @@ async function authorizeGatedTool(req, res, id) {'PAYMENT-REQUIRED',Buffer.from(JSON.stringify(envelope), 'utf8').toString('base64'),);- json(res, 402, rpcEnvelope(id, null, {- code: -32402,- message: 'payment or authentication required for this tool (provide a Bearer token or X-PAYMENT)',- data: envelope,- }));- return false;+ json(+ res,+ 402,+ rpcEnvelope(id, null, {+ code: -32402,+ message:+ 'payment or authentication required for this tool (provide a Bearer token or X-PAYMENT)',+ data: envelope,+ }),+ );+ return null;}export default wrap(async (req, res) => {@@ -815,7 +867,10 @@ export default wrap(async (req, res) => {if (rpcMethod === 'tools/call') {const name = params?.name;const args = params?.arguments || {};- const handler = HANDLERS[name];+ // Own-property lookup only so "__proto__"/"constructor" can't resolve an+ // inherited member and pass the !handler guard.+ const handler =+ typeof name === 'string' && Object.hasOwn(HANDLERS, name) ? HANDLERS[name] : null;if (!handler) {return json(res,@@ -825,13 +880,40 @@ export default wrap(async (req, res) => {}// Auth gate: expensive (vanity grind, long-lived RPC watch) and sensitive// (returns a secret key) tools require a bearer or verified x402 payment.- // authorizeGatedTool writes the 401/402 envelope and returns false on deny.+ // authorizeGatedTool writes the 401/402 envelope and returns null on deny.+ let x402Ctx = null;if (AUTH_REQUIRED_TOOLS.has(name)) {- const okAuth = await authorizeGatedTool(req, res, id);- if (!okAuth) return;+ const authz = await authorizeGatedTool(req, res, id);+ if (!authz) return;+ x402Ctx = authz.x402Ctx;}try {const data = await handler(args);+ // Settle the verified x402 payment AFTER the tool succeeded — atomic+ // from the payer's perspective (verify → work → settle, mirroring+ // /api/mcp): a failed tool never broadcasts the payment, and a+ // successful one is always captured so the gated work can't be+ // delivered free or the same signed payload replayed.+ if (x402Ctx) {+ try {+ const settled = await settlePayment({ verified: x402Ctx.verified });+ res.setHeader('x-payment-response', encodePaymentResponseHeader(settled));+ } catch (settleErr) {+ return json(+ res,+ 402,+ rpcEnvelope(id, null, {+ code: -32402,+ message: `payment settlement failed: ${settleErr?.message || 'settle error'}`,+ data: build402Body({+ resourceUrl: x402Ctx.resourceUrl,+ accepts: x402Ctx.requirements,+ error: settleErr?.message || 'settle error',+ }),+ }),+ );+ }+ }// Mirror MCP content shape so existing skill clients can unwrap text.return json(res,diff --git a/api/pump/[action].js b/api/pump/[action].jsindex 2f8b81101..1e7ed5683 100644--- a/api/pump/[action].js+++ b/api/pump/[action].js@@ -87,13 +87,18 @@ import { solanaConnection, loadAgentForSigning } from '../_lib/agent-pumpfun.js'import { connectPumpFunFeed } from '../_lib/pumpfun-ws-feed.js';import { makeRuntime } from '../_lib/skill-runtime.js';import { loadWallet } from '../_lib/solana-wallet.js';-import { checkBuyAllowed } from '../_lib/agent-spend-policy.js';import {- SOLANA_USDC_MINT,- SOLANA_USDC_MINT_DEVNET,- toUsdcAtomics,-} from '../payments/_config.js';+ checkBuyAllowed,+ reserveSpend,+ finalizeSpend,+ releaseSpend,+} from '../_lib/agent-spend-policy.js';+import { SOLANA_USDC_MINT, SOLANA_USDC_MINT_DEVNET, toUsdcAtomics } from '../payments/_config.js';import { classifyLaunchQuote, usdcMintFor } from '../_lib/pump-quote.js';+import {+ slippagePercentFromBps,+ resolveTokenProgramForMintOwner,+} from '../_lib/pump-trade-args.js';const TOKEN_PROGRAM_ID = new PublicKey('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA');@@ -113,48 +118,90 @@ async function resolveAuth(req) {const wrapped = wrap(async (req, res) => {const action = req.query?.action;switch (action) {- case 'balances': return handleBalances(req, res);- case 'buy-prep': return handleBuyPrep(req, res);- case 'buy-confirm': return handleBuyConfirm(req, res);- case 'sell-prep': return handleSellPrep(req, res);- case 'sell-confirm': return handleSellConfirm(req, res);- case 'build-metadata': return handleBuildMetadata(req, res);- case 'launch-prep': return handleLaunchPrep(req, res);- case 'launch-confirm': return handleLaunchConfirm(req, res);- case 'launch-agent': return handleLaunchAgent(req, res);- case 'agent-wallet': return handleAgentWallet(req, res);- case 'accept-payment-prep': return handleAcceptPaymentPrep(req, res);- case 'accept-payment-confirm': return handleAcceptPaymentConfirm(req, res);- case 'payments-list': return handlePaymentsList(req, res);- case 'portfolio': return handlePortfolio(req, res);- case 'by-agent': return handleByAgent(req, res);- case 'quote': return handleQuote(req, res);- case 'governance-prep': return handleGovernancePrep(req, res);- case 'withdraw-prep': return handleWithdrawPrep(req, res);- case 'withdraw-confirm': return handleWithdrawConfirm(req, res);- case 'strategy-backtest': return handleStrategyBacktest(req, res);- case 'strategy-close-all': return handleStrategyCloseAll(req, res);- case 'strategy-validate': return handleStrategyValidate(req, res);- case 'channel-feed': return handleChannelFeed(req, res);- case 'deliver-telegram': return handleDeliverTelegram(req, res);- case 'first-claims': return handleFirstClaims(req, res);- case 'recent-graduations': return handleRecentGraduations(req, res);- case 'trending': return handleTrending(req, res);- case 'coin': return handleCoin(req, res);- case 'coin-trades': return handleCoinTrades(req, res);- case 'search': return handleSearch(req, res);- case 'collect-creator-fee-prep': return handleCollectCreatorFeePrep(req, res);- case 'distribute-creator-fees-prep': return handleDistributeCreatorFeesPrep(req, res);- case 'create-fee-sharing-prep': return handleCreateFeeSharingPrep(req, res);- case 'update-fee-shares-prep': return handleUpdateFeeSharesPrep(req, res);- case 'fee-info': return handleFeeInfo(req, res);- case 'resolve-github-shareholder': return handleResolveGithubShareholder(req, res);- case 'create-social-fee-pda-prep': return handleCreateSocialFeePdaPrep(req, res);- case 'github-resolve': return handleGithubResolve(req, res);- case 'social-fee-claim-status': return handleSocialFeeClaimStatus(req, res);- case 'collect-creator-fee-agent': return handleCollectCreatorFeeAgent(req, res);- case 'distribute-creator-fees-agent': return handleDistributeCreatorFeesAgent(req, res);- case 'fee-sharing-agent': return handleFeeSharingAgent(req, res);+ case 'balances':+ return handleBalances(req, res);+ case 'buy-prep':+ return handleBuyPrep(req, res);+ case 'buy-confirm':+ return handleBuyConfirm(req, res);+ case 'sell-prep':+ return handleSellPrep(req, res);+ case 'sell-confirm':+ return handleSellConfirm(req, res);+ case 'build-metadata':+ return handleBuildMetadata(req, res);+ case 'launch-prep':+ return handleLaunchPrep(req, res);+ case 'launch-confirm':+ return handleLaunchConfirm(req, res);+ case 'launch-agent':+ return handleLaunchAgent(req, res);+ case 'agent-wallet':+ return handleAgentWallet(req, res);+ case 'accept-payment-prep':+ return handleAcceptPaymentPrep(req, res);+ case 'accept-payment-confirm':+ return handleAcceptPaymentConfirm(req, res);+ case 'payments-list':+ return handlePaymentsList(req, res);+ case 'portfolio':+ return handlePortfolio(req, res);+ case 'by-agent':+ return handleByAgent(req, res);+ case 'quote':+ return handleQuote(req, res);+ case 'governance-prep':+ return handleGovernancePrep(req, res);+ case 'withdraw-prep':+ return handleWithdrawPrep(req, res);+ case 'withdraw-confirm':+ return handleWithdrawConfirm(req, res);+ case 'strategy-backtest':+ return handleStrategyBacktest(req, res);+ case 'strategy-close-all':+ return handleStrategyCloseAll(req, res);+ case 'strategy-validate':+ return handleStrategyValidate(req, res);+ case 'channel-feed':+ return handleChannelFeed(req, res);+ case 'deliver-telegram':+ return handleDeliverTelegram(req, res);+ case 'first-claims':+ return handleFirstClaims(req, res);+ case 'recent-graduations':+ return handleRecentGraduations(req, res);+ case 'trending':+ return handleTrending(req, res);+ case 'coin':+ return handleCoin(req, res);+ case 'coin-trades':+ return handleCoinTrades(req, res);+ case 'search':+ return handleSearch(req, res);+ case 'collect-creator-fee-prep':+ return handleCollectCreatorFeePrep(req, res);+ case 'distribute-creator-fees-prep':+ return handleDistributeCreatorFeesPrep(req, res);+ case 'create-fee-sharing-prep':+ return handleCreateFeeSharingPrep(req, res);+ case 'update-fee-shares-prep':+ return handleUpdateFeeSharesPrep(req, res);+ case 'fee-info':+ return handleFeeInfo(req, res);+ case 'resolve-github-shareholder':+ return handleResolveGithubShareholder(req, res);+ case 'create-social-fee-pda-prep':+ return handleCreateSocialFeePdaPrep(req, res);+ case 'github-resolve':+ return handleGithubResolve(req, res);+ case 'social-fee-claim-status':+ return handleSocialFeeClaimStatus(req, res);+ case 'collect-creator-fee-agent':+ return handleCollectCreatorFeeAgent(req, res);+ case 'distribute-creator-fees-agent':+ return handleDistributeCreatorFeesAgent(req, res);+ case 'fee-sharing-agent':+ return handleFeeSharingAgent(req, res);default:return error(res, 404, 'not_found', 'unknown pump action');}@@ -219,22 +266,24 @@ async function handleBalances(req, res) {// ── buy-prep ───────────────────────────────────────────────────────────────-const buyPrepSchema = z.object({- mint: z.string().min(32).max(44),- network: z.enum(['mainnet', 'devnet']).default('mainnet'),- // For SOL-paired coins pass `sol`; for USDC-paired coins pass `usdc_amount`.- // Exactly one must be provided — validation enforced below.- sol: z.number().positive().max(50).optional(),- usdc_amount: z.number().positive().max(1_000_000).optional(),- // Optional explicit quote mint. When omitted the server auto-detects from- // the on-chain bonding curve (quote_mint field added in pump.fun V2).- quote_mint: z.string().min(32).max(44).optional(),- slippage_bps: z.number().int().min(0).max(5000).default(100),- wallet_address: z.string().min(32).max(44),-}).refine((v) => v.sol != null || v.usdc_amount != null, {- message: 'sol or usdc_amount required',- path: ['sol'],-});+const buyPrepSchema = z+ .object({+ mint: z.string().min(32).max(44),+ network: z.enum(['mainnet', 'devnet']).default('mainnet'),+ // For SOL-paired coins pass `sol`; for USDC-paired coins pass `usdc_amount`.+ // Exactly one must be provided — validation enforced below.+ sol: z.number().positive().max(50).optional(),+ usdc_amount: z.number().positive().max(1_000_000).optional(),+ // Optional explicit quote mint. When omitted the server auto-detects from+ // the on-chain bonding curve (quote_mint field added in pump.fun V2).+ quote_mint: z.string().min(32).max(44).optional(),+ slippage_bps: z.number().int().min(0).max(5000).default(100),+ wallet_address: z.string().min(32).max(44),+ })+ .refine((v) => v.sol != null || v.usdc_amount != null, {+ message: 'sol or usdc_amount required',+ path: ['sol'],+ });async function handleBuyPrep(req, res) {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;@@ -252,14 +301,32 @@ async function handleBuyPrep(req, res) {if (!userPk || !mintPk) return error(res, 400, 'validation_error', 'invalid pubkeys');try {- const { sdk, BN, web3 } = await getPumpSdk({ network: body.network });- const { isLegacyQuoteMint } = await import('@pump-fun/pump-sdk');- const slippage = body.slippage_bps / 10_000;+ const { sdk, BN, web3, connection } = await getPumpSdk({ network: body.network });+ const { isLegacyQuoteMint, getBuyTokenAmountFromSolAmount } =+ await import('@pump-fun/pump-sdk');+ // @pump-fun SDK builders take slippage as a PERCENT (1 = 1%), not a+ // fraction — see api/_lib/pump-trade-args.js for the unit derivation.+ const slippagePct = slippagePercentFromBps(body.slippage_bps);++ // The base mint's owner decides base_token_program: create_v2 coins are+ // Token-2022, legacy coins are SPL Token (docs/instructions/BUY.md #4).+ const mintInfo = await connection.getAccountInfo(mintPk);+ if (!mintInfo)+ return error(+ res,+ 404,+ 'mint_not_found',+ `mint ${body.mint} not found on ${body.network}`,+ );+ const baseTokenProgram = resolveTokenProgramForMintOwner(mintInfo.owner);// Fetch bonding curve state — also gives us the on-chain quote_mint.+ // Pass the real token program so the user-ATA existence check resolves+ // the correct (possibly Token-2022) associated account.let buyState = null;try {- if (sdk.fetchBuyState) buyState = await sdk.fetchBuyState(mintPk, userPk);+ if (sdk.fetchBuyState)+ buyState = await sdk.fetchBuyState(mintPk, userPk, baseTokenProgram);} catch {buyState = null;}@@ -276,86 +343,101 @@ async function handleBuyPrep(req, res) {// clients see a real, usable mint for every coin type.const quoteMintDisplay = isUsdcQuote ? quoteMintPk.toString() : WSOL_MINT;- if (buyState && buyState.bondingCurve && !buyState.bondingCurve.complete) {- const global = await sdk.fetchGlobal();- let tx_base64;- if (isUsdcQuote) {- if (body.usdc_amount == null)- return error(res, 400, 'validation_error', 'usdc_amount required for USDC-paired coin');- const quoteAtomics = new BN(Math.round(body.usdc_amount * 1_000_000));- const ixs = await sdk.buyV2Instructions({- global,- bondingCurveAccountInfo: buyState.bondingCurveAccountInfo,- bondingCurve: buyState.bondingCurve,- associatedUserAccountInfo: buyState.associatedUserAccountInfo,- mint: mintPk,- user: userPk,- amount: new BN(0),- quoteAmount: quoteAtomics,- slippage,- quoteMint: quoteMintPk,- });- tx_base64 = await buildUnsignedTxBase64({- network: body.network, payer: userPk, instructions: ixs,- });- return json(res, 201, {- route: 'bonding_curve',- mint: body.mint,- network: body.network,- quote_mint: quoteMintDisplay,- usdc_in: body.usdc_amount,- slippage_bps: body.slippage_bps,- tx_base64,- });- }+ // quote_token_program must match the quote mint's owner (wSOL/USDC are+ // SPL Token today; read it from chain so a future quote can't break us).+ let quoteTokenProgram = TOKEN_PROGRAM_ID;+ if (isUsdcQuote) {+ const quoteInfo = await connection.getAccountInfo(quoteMintPk);+ if (!quoteInfo)+ return error(+ res,+ 404,+ 'quote_mint_not_found',+ `quote mint ${quoteMintPk.toBase58()} not found`,+ );+ quoteTokenProgram = resolveTokenProgramForMintOwner(quoteInfo.owner);+ }- // SOL-paired (legacy)- if (body.sol == null)- return error(res, 400, 'validation_error', 'sol required for SOL-paired coin');- const lamports = new BN(Math.floor(body.sol * web3.LAMPORTS_PER_SOL));- const ixs = await sdk.buyInstructions({+ // Validate the quote-asset amount up front for both routes.+ if (isUsdcQuote && body.usdc_amount == null)+ return error(res, 400, 'validation_error', 'usdc_amount required for USDC-paired coin');+ if (!isUsdcQuote && body.sol == null)+ return error(res, 400, 'validation_error', 'sol required for SOL-paired coin');+ const quoteAtomics = isUsdcQuote+ ? new BN(Math.round(body.usdc_amount * 1_000_000))+ : new BN(Math.floor(body.sol * web3.LAMPORTS_PER_SOL));++ if (buyState && buyState.bondingCurve && !buyState.bondingCurve.complete) {+ // Unified v2 interface for every coin type (SOL- and USDC-paired,+ // SPL and Token-2022 base mints) per the upstream migration guidance —+ // docs/pumpfun-program/UPSTREAM-buy-sell-v2-announcement.md.+ const [global, feeConfig] = await Promise.all([+ sdk.fetchGlobal(),+ sdk.fetchFeeConfig().catch(() => null),+ ]);+ // buy_v2's `amount` arg is the base-token quantity to buy and must be+ // > 0 (docs/instructions/BUY.md) — derive it from the quote input.+ const tokenAmount = getBuyTokenAmountFromSolAmount({+ global,+ feeConfig,+ mintSupply: buyState.bondingCurve.tokenTotalSupply,+ bondingCurve: buyState.bondingCurve,+ amount: quoteAtomics,+ quoteMint: quoteMintPk,+ });+ if (!tokenAmount.gt(new BN(0)))+ return error(+ res,+ 400,+ 'amount_too_small',+ 'quote amount too small to buy any tokens',+ );+ const ixs = await sdk.buyV2Instructions({global,bondingCurveAccountInfo: buyState.bondingCurveAccountInfo,bondingCurve: buyState.bondingCurve,associatedUserAccountInfo: buyState.associatedUserAccountInfo,mint: mintPk,user: userPk,- amount: new BN(0),- solAmount: lamports,- slippage,+ amount: tokenAmount,+ quoteAmount: quoteAtomics,+ slippage: slippagePct,+ tokenProgram: baseTokenProgram,+ quoteTokenProgram,});- tx_base64 = await buildUnsignedTxBase64({- network: body.network, payer: userPk, instructions: ixs,+ const tx_base64 = await buildUnsignedTxBase64({+ network: body.network,+ payer: userPk,+ instructions: ixs,});return json(res, 201, {route: 'bonding_curve',mint: body.mint,network: body.network,quote_mint: quoteMintDisplay,- sol_in: body.sol,+ ...(isUsdcQuote ? { usdc_in: body.usdc_amount } : { sol_in: body.sol }),+ expected_tokens_out: tokenAmount.toString(),slippage_bps: body.slippage_bps,tx_base64,});}// AMM (post-graduation)- const amm = await getAmmPoolState({ network: body.network, mint: mintPk, quoteMint: isUsdcQuote ? quoteMintPk : null });+ const amm = await getAmmPoolState({+ network: body.network,+ mint: mintPk,+ quoteMint: isUsdcQuote ? quoteMintPk : null,+ });const ammMod = await import('@pump-fun/pump-swap-sdk');const offline = new ammMod.PumpAmmSdk();const onlineAmm = new ammMod.OnlinePumpAmmSdk(getConnection({ network: body.network }));const swapState = await onlineAmm.swapSolanaState(amm.poolKey, userPk);- const quoteIn = isUsdcQuote- ? new BN(Math.round(body.usdc_amount * 1_000_000))- : new BN(Math.floor(body.sol * web3.LAMPORTS_PER_SOL));- if (body.usdc_amount == null && isUsdcQuote)- return error(res, 400, 'validation_error', 'usdc_amount required for USDC AMM pool');- if (body.sol == null && !isUsdcQuote)- return error(res, 400, 'validation_error', 'sol required for SOL AMM pool');-- const ixs = await offline.buyQuoteInput(swapState, quoteIn, slippage);+ const ixs = await offline.buyQuoteInput(swapState, quoteAtomics, slippagePct);const tx_base64 = await buildUnsignedTxBase64({- network: body.network, payer: userPk, instructions: ixs,+ network: body.network,+ payer: userPk,+ instructions: ixs,});return json(res, 201, {route: 'amm',@@ -499,14 +581,29 @@ async function handleSellPrep(req, res) {if (!userPk || !mintPk) return error(res, 400, 'validation_error', 'invalid pubkeys');try {- const { sdk, BN } = await getPumpSdk({ network: body.network });- const { isLegacyQuoteMint } = await import('@pump-fun/pump-sdk');+ const { sdk, BN, connection } = await getPumpSdk({ network: body.network });+ const { isLegacyQuoteMint, getSellSolAmountFromTokenAmount } =+ await import('@pump-fun/pump-sdk');const tokens = new BN(body.tokens);- const slippage = body.slippage_bps / 10_000;+ // SDK builders take slippage as a PERCENT — see api/_lib/pump-trade-args.js.+ const slippagePct = slippagePercentFromBps(body.slippage_bps);++ // base_token_program must match the mint owner (Token-2022 for create_v2+ // coins, SPL for legacy) — docs/instructions/SELL.md #4.+ const mintInfo = await connection.getAccountInfo(mintPk);+ if (!mintInfo)+ return error(+ res,+ 404,+ 'mint_not_found',+ `mint ${body.mint} not found on ${body.network}`,+ );+ const baseTokenProgram = resolveTokenProgramForMintOwner(mintInfo.owner);let sellState = null;try {- if (sdk.fetchSellState) sellState = await sdk.fetchSellState(mintPk, userPk);+ if (sdk.fetchSellState)+ sellState = await sdk.fetchSellState(mintPk, userPk, baseTokenProgram);} catch {sellState = null;}@@ -521,33 +618,71 @@ async function handleSellPrep(req, res) {// SOL curves store quoteMint as PublicKey.default — surface wrapped SOL.const quoteMintDisplay = isUsdcQuote ? quoteMintPk.toString() : WSOL_MINT;+ // quote_token_program must match the quote mint's owner.+ let quoteTokenProgram = TOKEN_PROGRAM_ID;+ if (isUsdcQuote) {+ const quoteInfo = await connection.getAccountInfo(quoteMintPk);+ if (!quoteInfo)+ return error(+ res,+ 404,+ 'quote_mint_not_found',+ `quote mint ${quoteMintPk.toBase58()} not found`,+ );+ quoteTokenProgram = resolveTokenProgramForMintOwner(quoteInfo.owner);+ }+if (sellState && sellState.bondingCurve && !sellState.bondingCurve.complete) {- const global = await sdk.fetchGlobal();- let ixs;+ // Unified v2 sell for every coin type. sell_v2 reads the fee-recipient+ // pool from the curve's mayhem flag inside the SDK builder, and the+ // expected quote output below gives the program a real min_sol_output+ // floor (expected minus slippage) instead of 0.+ const [global, feeConfig] = await Promise.all([+ sdk.fetchGlobal(),+ sdk.fetchFeeConfig().catch(() => null),+ ]);+ const expectedQuoteOut = getSellSolAmountFromTokenAmount({+ global,+ feeConfig,+ mintSupply: sellState.bondingCurve.tokenTotalSupply,+ bondingCurve: sellState.bondingCurve,+ amount: tokens,+ });+ const ixs = [];if (isUsdcQuote) {- ixs = await sdk.sellV2Instructions({- global,- bondingCurveAccountInfo: sellState.bondingCurveAccountInfo,- bondingCurve: sellState.bondingCurve,- mint: mintPk,- user: userPk,- amount: tokens,- quoteAmount: new BN(0),- slippage,- quoteMint: quoteMintPk,- });- } else {- ixs = await sdk.sellInstructions({+ // sell_v2 pays proceeds into the seller's quote ATA, which the+ // program does NOT init (SELL.md #16) — create it idempotently.+ const spl = await import('@solana/spl-token');+ const userQuoteAta = spl.getAssociatedTokenAddressSync(+ quoteMintPk,+ userPk,+ true,+ quoteTokenProgram,+ );+ ixs.push(+ spl.createAssociatedTokenAccountIdempotentInstruction(+ userPk,+ userQuoteAta,+ userPk,+ quoteMintPk,+ quoteTokenProgram,+ ),+ );+ }+ ixs.push(+ ...(await sdk.sellV2Instructions({global,bondingCurveAccountInfo: sellState.bondingCurveAccountInfo,bondingCurve: sellState.bondingCurve,mint: mintPk,user: userPk,amount: tokens,- solAmount: new BN(0),- slippage,- });- }+ quoteAmount: expectedQuoteOut,+ slippage: slippagePct,+ tokenProgram: baseTokenProgram,+ quoteTokenProgram,+ })),+ );const tx_base64 = await buildUnsignedTxBase64({network: body.network,payer: userPk,@@ -559,17 +694,24 @@ async function handleSellPrep(req, res) {network: body.network,quote_mint: quoteMintDisplay,tokens_in: body.tokens,+ ...(isUsdcQuote+ ? { expected_usdc_out: Number(expectedQuoteOut.toString()) / 1_000_000 }+ : { expected_sol_out: Number(expectedQuoteOut.toString()) / 1_000_000_000 }),slippage_bps: body.slippage_bps,tx_base64,});}- const amm = await getAmmPoolState({ network: body.network, mint: mintPk, quoteMint: isUsdcQuote ? quoteMintPk : null });+ const amm = await getAmmPoolState({+ network: body.network,+ mint: mintPk,+ quoteMint: isUsdcQuote ? quoteMintPk : null,+ });const ammMod = await import('@pump-fun/pump-swap-sdk');const offline = new ammMod.PumpAmmSdk();const onlineAmm = new ammMod.OnlinePumpAmmSdk(getConnection({ network: body.network }));const swapState = await onlineAmm.swapSolanaState(amm.poolKey, userPk);- const ixs = await offline.sellBaseInput(swapState, tokens, slippage);+ const ixs = await offline.sellBaseInput(swapState, tokens, slippagePct);const tx_base64 = await buildUnsignedTxBase64({network: body.network,payer: userPk,@@ -718,7 +860,8 @@ async function handleBuildMetadata(req, res) {return error(res, 413, 'payload_too_large', 'image must be under 4 MB');}imageContentType = meta.match(/data:([^;,]+)/)?.[1] || 'image/png';- imageExt = imageContentType.includes('jpeg') || imageContentType.includes('jpg') ? 'jpg' : 'png';+ imageExt =+ imageContentType.includes('jpeg') || imageContentType.includes('jpg') ? 'jpg' : 'png';} else if (body.avatar_id) {const [av] = await sql`select thumbnail_key from avatars@@ -733,7 +876,10 @@ async function handleBuildMetadata(req, res) {if (resp.ok) {imageBuf = Buffer.from(await resp.arrayBuffer());imageContentType = resp.headers.get('content-type') || 'image/png';- imageExt = imageContentType.includes('jpeg') || imageContentType.includes('jpg') ? 'jpg' : 'png';+ imageExt =+ imageContentType.includes('jpeg') || imageContentType.includes('jpg')+ ? 'jpg'+ : 'png';}} catch {/* fall through to direct URL */@@ -804,38 +950,67 @@ async function handleBuildMetadata(req, res) {// so a treasury / DAO wallet can be the creator while a contributor wallet// signs and pays.async function buildLaunchInstructions({- sdk, BN, mint, creator, signer, name, symbol, uri, solBuyIn, usdcBuyIn, quoteMint, isMayhem,+ sdk,+ BN,+ mint,+ creator,+ signer,+ name,+ symbol,+ uri,+ solBuyIn,+ usdcBuyIn,+ quoteMint,+ isMayhem,}) {const LAMPORTS = 1_000_000_000;- const user = signer || creator;+ const user = signer || creator;const { isLegacyQuoteMint } = await import('@pump-fun/pump-sdk');const isUsdcQuote = quoteMint && !isLegacyQuoteMint(quoteMint);if (isUsdcQuote) {// USDC-paired: use V2 buy path regardless of whether there's an initial buy.- const hasBuy = usdcBuyIn > 0;- const global = await sdk.fetchGlobal();- const pumpSdk = await import('@pump-fun/pump-sdk');+ const hasBuy = usdcBuyIn > 0;+ const global = await sdk.fetchGlobal();+ const pumpSdk = await import('@pump-fun/pump-sdk');if (hasBuy) {- const quoteAmount = new BN(Math.round(usdcBuyIn * 1_000_000));+ const quoteAmount = new BN(Math.round(usdcBuyIn * 1_000_000));// Pass `quoteMint` so the SDK seeds a fresh curve from// `initial_virtual_quote_reserves` (USDC) rather than the SOL reserves —// otherwise the base-token estimate is priced against the wrong pool and// the create+buy can over/under-spend or revert on max_quote_cost.- const tokenAmount = pumpSdk.getBuyTokenAmountFromSolAmount({- global, feeConfig: null, mintSupply: null, bondingCurve: null, amount: quoteAmount, quoteMint,+ const tokenAmount = pumpSdk.getBuyTokenAmountFromSolAmount({+ global,+ feeConfig: null,+ mintSupply: null,+ bondingCurve: null,+ amount: quoteAmount,+ quoteMint,});const ixs = await sdk.createV2AndBuyV2Instructions({- global, mint, name, symbol, uri,- creator, user,- quoteAmount, amount: tokenAmount,+ global,+ mint,+ name,+ symbol,+ uri,+ creator,+ user,+ quoteAmount,+ amount: tokenAmount,mayhemMode: !!isMayhem,quoteMint,});return Array.isArray(ixs) ? [...ixs] : [ixs];}const ix = await sdk.createV2Instruction({- mint, name, symbol, uri, creator, user, mayhemMode: !!isMayhem, quoteMint,+ mint,+ name,+ symbol,+ uri,+ creator,+ user,+ mayhemMode: !!isMayhem,+ quoteMint,});return [ix];}@@ -843,9 +1018,9 @@ async function buildLaunchInstructions({// SOL-paired (original behaviour)const hasBuy = solBuyIn > 0;if (hasBuy) {- const global = await sdk.fetchGlobal();+ const global = await sdk.fetchGlobal();const solAmount = new BN(Math.floor(solBuyIn * LAMPORTS));- const pumpSdk = await import('@pump-fun/pump-sdk');+ const pumpSdk = await import('@pump-fun/pump-sdk');const tokenAmount = pumpSdk.getBuyTokenAmountFromSolAmount({global,feeConfig: null,@@ -854,16 +1029,28 @@ async function buildLaunchInstructions({amount: solAmount,});const ixs = await sdk.createV2AndBuyInstructions({- global, mint, name, symbol, uri,- creator, user,- solAmount, amount: tokenAmount,+ global,+ mint,+ name,+ symbol,+ uri,+ creator,+ user,+ solAmount,+ amount: tokenAmount,mayhemMode: !!isMayhem,});return Array.isArray(ixs) ? [...ixs] : [ixs];}const ix = await sdk.createV2Instruction({- mint, name, symbol, uri, creator, user, mayhemMode: !!isMayhem,+ mint,+ name,+ symbol,+ uri,+ creator,+ user,+ mayhemMode: !!isMayhem,});return [ix];}@@ -1015,7 +1202,12 @@ async function handleLaunchPrep(req, res) {limit 1`;if (!creatorWallet) {- return error(res, 403, 'forbidden', 'creator_address must be a solana wallet linked to your account');+ return error(+ res,+ 403,+ 'forbidden',+ 'creator_address must be a solana wallet linked to your account',+ );}creator = creatorPk;}@@ -1039,8 +1231,12 @@ async function handleLaunchPrep(req, res) {const supplied = solanaPubkey(body.mint_address);if (!supplied) return error(res, 400, 'validation_error', 'invalid mint_address');if (enforceMark && !hasThreeWsMark(supplied.toBase58())) {- return error(res, 400, 'unbranded_mint',- 'three.ws launches must use a mint address carrying the "3ws" mark — grind one client-side or omit mint_address to let the server stamp it');+ return error(+ res,+ 400,+ 'unbranded_mint',+ 'three.ws launches must use a mint address carrying the "3ws" mark — grind one client-side or omit mint_address to let the server stamp it',+ );}mint = supplied;} else if (enforceMark) {@@ -1048,10 +1244,19 @@ async function handleLaunchPrep(req, res) {const ground = await grindVanityNode({ ...THREE_WS_VANITY }); // ~49k attempts, sub-secondmintKeypair = Keypair.fromSecretKey(ground.secretKey);mint = mintKeypair.publicKey;- log.info('mint_mark_stamped', { publicKey: ground.publicKey, attempts: ground.attempts, durationMs: Math.round(ground.durationMs) });+ log.info('mint_mark_stamped', {+ publicKey: ground.publicKey,+ attempts: ground.attempts,+ durationMs: Math.round(ground.durationMs),+ });} catch (err) {if (err instanceof GrindExhaustedError) {- return error(res, 503, 'mark_grind_failed', 'could not stamp the three.ws mark — retry');+ return error(+ res,+ 503,+ 'mark_grind_failed',+ 'could not stamp the three.ws mark — retry',+ );}throw err;}@@ -1068,7 +1273,7 @@ async function handleLaunchPrep(req, res) {// agent → V1 path + on-chain agent (PumpAgent.create with buyback_bps)// regular→ V1 path, no agent bindingconst isMayhem = body.coin_type === 'mayhem';- const isAgent = body.coin_type === 'agent';+ const isAgent = body.coin_type === 'agent';const effBuyback = isAgent ? body.buyback_bps : 0;// Resolve the quote pairing: null → SOL-paired; an explicit mint (e.g. USDC)@@ -1084,8 +1289,14 @@ async function handleLaunchPrep(req, res) {const quote = classifyLaunchQuote({ quoteMint: requestedQuoteMint, network: body.network });const launchQuoteMint = quote.quoteMint ? solanaPubkey(quote.quoteMint) : null;const instructions = await buildLaunchInstructions({- sdk, BN, mint, creator, signer,- name: body.name, symbol: body.symbol, uri: body.uri,+ sdk,+ BN,+ mint,+ creator,+ signer,+ name: body.name,+ symbol: body.symbol,+ uri: body.uri,solBuyIn: body.sol_buy_in,usdcBuyIn: body.usdc_buy_in,quoteMint: launchQuoteMint,@@ -1123,15 +1334,15 @@ async function handleLaunchPrep(req, res) {${JSON.stringify({kind: 'pump_launch',agent_id: resolvedAgentId,- wallet_address: body.wallet_address, // signer (pays gas, funds initial buy)- creator_address: creator.toBase58(), // on-chain creator (royalty recipient)+ wallet_address: body.wallet_address, // signer (pays gas, funds initial buy)+ creator_address: creator.toBase58(), // on-chain creator (royalty recipient)mint: mint.toBase58(),name: body.name,symbol: body.symbol,network: body.network,buyback_bps: effBuyback,coin_type: body.coin_type,- quote_mint: quote.quoteMint, // null = SOL-paired; else the stable quote mint+ quote_mint: quote.quoteMint, // null = SOL-paired; else the stable quote mintprep_id: prepId,})}::jsonb,${expiresAt}@@ -1145,7 +1356,9 @@ async function handleLaunchPrep(req, res) {// Mint keypair must co-sign the tx. When server-generated, we hand// the secret to the frontend; when client-supplied (vanity), the// client already holds it and the server never sees it.- mint_secret_key_b64: mintKeypair ? Buffer.from(mintKeypair.secretKey).toString('base64') : null,+ mint_secret_key_b64: mintKeypair+ ? Buffer.from(mintKeypair.secretKey).toString('base64')+ : null,client_supplied_mint: !mintKeypair,tx_base64: txBase64,network: body.network,@@ -1199,9 +1412,7 @@ async function handleLaunchConfirm(req, res) {} catch (e) {return error(res, e.status || 422, e.code || 'tx_failed', e.message);}- const accountKeys = tx.transaction.message.accountKeys.map((k) =>- (k.pubkey || k).toString(),- );+ const accountKeys = tx.transaction.message.accountKeys.map((k) => (k.pubkey || k).toString());if (!accountKeys.includes(p.mint)) {return error(res, 422, 'mint_not_in_tx', 'mint pubkey not present in tx');}@@ -1281,7 +1492,9 @@ async function handleAgentWallet(req, res) {});if (!agent) return error(res, 404, 'not_found', 'agent not found');- const loaded = await loadAgentForSigning(agent.id, user.id, { reason: 'studio_launch_prepare' });+ const loaded = await loadAgentForSigning(agent.id, user.id, {+ reason: 'studio_launch_prepare',+ });if (loaded.error) return error(res, loaded.error.status, loaded.error.code, loaded.error.msg);const address = loaded.keypair.publicKey.toBase58();@@ -1389,17 +1602,30 @@ async function handleLaunchAgent(req, res) {return error(res, 400, 'validation_error', 'mint_address does not match secret key');}if (enforceMark && !hasThreeWsMark(mintKeypair.publicKey.toBase58())) {- return error(res, 400, 'unbranded_mint',- 'three.ws launches must use a mint carrying the "3ws" mark — omit mint_address to let the server stamp it');+ return error(+ res,+ 400,+ 'unbranded_mint',+ 'three.ws launches must use a mint carrying the "3ws" mark — omit mint_address to let the server stamp it',+ );}} else if (enforceMark) {try {const ground = await grindVanityNode({ ...THREE_WS_VANITY }); // ~49k attempts, sub-secondmintKeypair = Keypair.fromSecretKey(ground.secretKey);- log.info('mint_mark_stamped', { publicKey: ground.publicKey, attempts: ground.attempts, durationMs: Math.round(ground.durationMs) });+ log.info('mint_mark_stamped', {+ publicKey: ground.publicKey,+ attempts: ground.attempts,+ durationMs: Math.round(ground.durationMs),+ });} catch (err) {if (err instanceof GrindExhaustedError) {- return error(res, 503, 'mark_grind_failed', 'could not stamp the three.ws mark — retry');+ return error(+ res,+ 503,+ 'mark_grind_failed',+ 'could not stamp the three.ws mark — retry',+ );}throw err;}@@ -1477,12 +1703,17 @@ async function handleLaunchAgent(req, res) {const { sdk, BN } = await getPumpSdk({ network: body.network });const isMayhem = body.coin_type === 'mayhem';- const isAgent = body.coin_type === 'agent';+ const isAgent = body.coin_type === 'agent';const effBuyback = isAgent ? body.buyback_bps : 0;const instructions = await buildLaunchInstructions({- sdk, BN, mint, creator,- name: body.name, symbol: body.symbol, uri: body.uri,+ sdk,+ BN,+ mint,+ creator,+ name: body.name,+ symbol: body.symbol,+ uri: body.uri,solBuyIn: body.sol_buy_in,usdcBuyIn: body.usdc_buy_in,quoteMint: launchQuoteMint,@@ -1529,12 +1760,36 @@ async function handleLaunchAgent(req, res) {throw err;}+ // Spend-policy gate: this path signs server-side with the agent's custodial+ // wallet, so a stolen session could otherwise drive an arbitrarily large SOL+ // dev-buy (up to the schema max) to drain the wallet. Reserve the SOL outflow+ // against the agent's per-tx + rolling-24h caps BEFORE broadcasting — atomic,+ // so concurrent launches can't both pass, and the launch is recorded toward+ // the daily cap. A USDC-paired dev buy moves no SOL (amount 0). Released on+ // send failure, finalized with the signature on success.+ const launchSolOutflow = quote.isUsdc ? 0 : body.sol_buy_in || 0;+ const reservation = await reserveSpend({+ agentId: resolvedAgentId,+ meta: loaded.meta,+ mint: mint.toBase58(),+ solAmount: launchSolOutflow,+ type: 'pumpfun.launch',+ payload: {+ name: body.name,+ symbol: body.symbol,+ network: body.network,+ source: 'studio_agent_wallet',+ },+ });+ if (!reservation.ok) return error(res, reservation.status, reservation.code, reservation.msg);+let signature;try {signature = await conn.sendRawTransaction(vtx.serialize(), { skipPreflight: false });await conn.confirmTransaction(signature, 'confirmed');} catch (err) {console.error('[pump/launch-agent] send failed', err);+ await releaseSpend(reservation.reservationId);return error(res, 502, 'rpc_error', err?.message || 'transaction failed');}@@ -1549,29 +1804,26 @@ async function handleLaunchAgent(req, res) {returning id, mint, network, buyback_bps, quote_mint, created_at`;- await sql`- insert into agent_actions (agent_id, type, payload, source_skill)- values (- ${resolvedAgentId},- ${'pumpfun.launch'},- ${JSON.stringify({- mint: mintAddr,- name: body.name,- symbol: body.symbol,- uri: body.uri,- signature,- network: body.network,- sol_buy_in: body.sol_buy_in || 0,- usdc_buy_in: body.usdc_buy_in || 0,- quote_mint: quote.quoteMint,- quote_currency: quote.label,- buyback_bps: effBuyback,- coin_type: body.coin_type,- source: 'studio_agent_wallet',- })}::jsonb,- ${'pumpfun'}- )- `.catch((e) => console.error('[pump/launch-agent] log failed', e?.message));+ // Finalize the spend reservation in place: merge the launch metadata + tx+ // signature into the reserved row and mark it confirmed. This replaces the+ // previous standalone insert — the reserved row already carries `solAmount`+ // (so the launch counts toward the daily cap, which the old `sol_buy_in`-keyed+ // row never did), and reusing it avoids double-recording the launch.+ await finalizeSpend(reservation.reservationId, {+ mint: mintAddr,+ name: body.name,+ symbol: body.symbol,+ uri: body.uri,+ signature,+ network: body.network,+ sol_buy_in: body.sol_buy_in || 0,+ usdc_buy_in: body.usdc_buy_in || 0,+ quote_mint: quote.quoteMint,+ quote_currency: quote.label,+ buyback_bps: effBuyback,+ coin_type: body.coin_type,+ source: 'studio_agent_wallet',+ });// Surface the confirmed agent-wallet launch on the site-wide live activity ticker.publishFeedEvent({@@ -1608,10 +1860,15 @@ const acceptPaymentPrepSchema = z.object({amount_usdc: z.number().positive().max(100_000),currency_mint: z.string().min(32).max(44).optional(), // defaults to USDCcurrency_token_program: z.string().min(32).max(44).optional(),- user_token_account: z.string().min(32).max(44), // payer ATA+ user_token_account: z.string().min(32).max(44), // payer ATAskill_id: z.string().max(100).optional(),tool_name: z.string().max(100).optional(),- duration_seconds: z.number().int().positive().max(60 * 60 * 24 * 365).default(60),+ duration_seconds: z+ .number()+ .int()+ .positive()+ .max(60 * 60 * 24 * 365)+ .default(60),network: z.enum(['mainnet', 'devnet']).default('mainnet'),});@@ -1750,7 +2007,13 @@ async function handleAcceptPaymentConfirm(req, res) {select id from pump_agent_paymentswhere tx_signature=${body.tx_signature} and status='confirmed' and id != ${payment.id} limit 1`;- if (sigDupe) return error(res, 409, 'tx_already_used', 'this transaction already confirmed another payment');+ if (sigDupe)+ return error(+ res,+ 409,+ 'tx_already_used',+ 'this transaction already confirmed another payment',+ );let tx;try {@@ -1760,9 +2023,7 @@ async function handleAcceptPaymentConfirm(req, res) {return error(res, e.status || 422, e.code || 'tx_failed', e.message);}- const accountKeys = tx.transaction.message.accountKeys.map((k) =>- (k.pubkey || k).toString(),- );+ const accountKeys = tx.transaction.message.accountKeys.map((k) => (k.pubkey || k).toString());if (!accountKeys.includes(payment.mint)) {return error(res, 422, 'mint_not_in_tx', 'agent mint not in tx accounts');}@@ -1772,15 +2033,24 @@ async function handleAcceptPaymentConfirm(req, res) {const signed = tx.transaction.message.accountKeys.some((k) => (k.pubkey || k).toString() === payment.payer_wallet && k.signer === true,);- if (!signed) return error(res, 422, 'payer_not_signer', 'declared payer did not sign the transaction');+ if (!signed)+ return error(res, 422, 'payer_not_signer', 'declared payer did not sign the transaction');// Verify the agent's payment vault was actually credited the invoiced amount// of the invoiced currency. Without this, "the mint pubkey appears in the tx"// is not proof of payment — any cheap unrelated tx referencing the mint would// pass. The vault is the ATA owned by the TokenAgentPayments PDA for this mint.- const { agentPda } = await getPumpAgentOffline({ network: payment.network, mint: payment.mint });+ const { agentPda } = await getPumpAgentOffline({+ network: payment.network,+ mint: payment.mint,+ });if (!agentPda) {- return error(res, 503, 'verification_unavailable', 'unable to derive agent payment vault for verification');+ return error(+ res,+ 503,+ 'verification_unavailable',+ 'unable to derive agent payment vault for verification',+ );}const vaultOwner = agentPda.toString();const expectedAtomics = BigInt(payment.amount_atomics);@@ -1791,12 +2061,18 @@ async function handleAcceptPaymentConfirm(req, res) {if (p.mint !== payment.currency_mint) continue;if (p.owner !== vaultOwner) continue;const before = pre.find((b) => b.accountIndex === p.accountIndex);- const delta = BigInt(p.uiTokenAmount?.amount ?? '0') - BigInt(before?.uiTokenAmount?.amount ?? '0');+ const delta =+ BigInt(p.uiTokenAmount?.amount ?? '0') - BigInt(before?.uiTokenAmount?.amount ?? '0');if (delta > credited) credited = delta;}if (credited < expectedAtomics) {await sql`update pump_agent_payments set status='failed' where id=${payment.id}`;- return error(res, 422, 'amount_not_credited', 'transaction did not credit the invoiced amount to the agent payment vault');+ return error(+ res,+ 422,+ 'amount_not_credited',+ 'transaction did not credit the invoiced amount to the agent payment vault',+ );}try {@@ -1806,7 +2082,13 @@ async function handleAcceptPaymentConfirm(req, res) {where id=${payment.id} and status != 'confirmed'`;} catch (e) {- if (e?.code === '23505') return error(res, 409, 'tx_already_used', 'this transaction already confirmed another payment');+ if (e?.code === '23505')+ return error(+ res,+ 409,+ 'tx_already_used',+ 'this transaction already confirmed another payment',+ );throw e;}@@ -1968,24 +2250,32 @@ async function handlePortfolio(req, res) {// Live price per holding via the read-only pump-fun MCP (parallelized).const rt = makeRuntime();- const priced = await Promise.all(holdings.map(async (h) => {- const [curve, basis] = [- await rt.invoke('pump-fun.getBondingCurve', { mint: h.mint }).catch(() => ({ ok: false })),- basisByMint.get(h.mint),- ];- const priceSol = curve?.ok ? (curve.data?.priceSol ?? curve.data?.price ?? null) : null;- const valueSol = priceSol != null ? priceSol * h.amount : null;- const costBasisSol = basis ? basis.sol : null;- const unrealizedSol = valueSol != null && costBasisSol != null ? valueSol - costBasisSol : null;- return {- ...h,- priceSol,- valueSol,- costBasisSol,- unrealizedPnlSol: unrealizedSol,- unrealizedPnlPct: unrealizedSol != null && costBasisSol > 0 ? (unrealizedSol / costBasisSol) * 100 : null,- };- }));+ const priced = await Promise.all(+ holdings.map(async (h) => {+ const [curve, basis] = [+ await rt+ .invoke('pump-fun.getBondingCurve', { mint: h.mint })+ .catch(() => ({ ok: false })),+ basisByMint.get(h.mint),+ ];+ const priceSol = curve?.ok ? (curve.data?.priceSol ?? curve.data?.price ?? null) : null;+ const valueSol = priceSol != null ? priceSol * h.amount : null;+ const costBasisSol = basis ? basis.sol : null;+ const unrealizedSol =+ valueSol != null && costBasisSol != null ? valueSol - costBasisSol : null;+ return {+ ...h,+ priceSol,+ valueSol,+ costBasisSol,+ unrealizedPnlSol: unrealizedSol,+ unrealizedPnlPct:+ unrealizedSol != null && costBasisSol > 0+ ? (unrealizedSol / costBasisSol) * 100+ : null,+ };+ }),+ );const totalValueSol = priced.reduce((s, p) => s + (p.valueSol ?? 0), 0);const totalCostBasisSol = priced.reduce((s, p) => s + (p.costBasisSol ?? 0), 0);@@ -2001,7 +2291,8 @@ async function handlePortfolio(req, res) {totalValueSol,totalCostBasisSol,unrealizedPnlSol,- unrealizedPnlPct: totalCostBasisSol > 0 ? (unrealizedPnlSol / totalCostBasisSol) * 100 : null,+ unrealizedPnlPct:+ totalCostBasisSol > 0 ? (unrealizedPnlSol / totalCostBasisSol) * 100 : null,},});}@@ -2016,7 +2307,7 @@ async function handleByAgent(req, res) {if (!rl.success) return rateLimited(res, rl);const url = new URL(req.url, `http://${req.headers.host}`);- const agentId = url.searchParams.get('agent_id');+ const agentId = url.searchParams.get('agent_id');const avatarId = url.searchParams.get('avatar_id');if (!agentId && !avatarId)return error(res, 400, 'validation_error', 'agent_id or avatar_id required');@@ -2078,7 +2369,7 @@ async function handleByAgent(req, res) {data: {...row,stats: stats || { confirmed_payments: 0, unique_payers: 0, total_atomics: '0' },- burns: burnRow || { runs: 0, total_burned: '0' },+ burns: burnRow || { runs: 0, total_burned: '0' },burns_feed: burnsFeed,},});@@ -2105,15 +2396,19 @@ async function handleQuote(req, res) {const slippageBps = Number.isFinite(Number(slippageRaw))? Math.max(0, Math.min(5000, Number(slippageRaw))): 100;- const slippage = slippageBps / 10_000;+ // AMM SDK pricing takes slippage as a PERCENT (1 = 1%) — pump-trade-args.js.+ const slippagePct = slippagePercentFromBps(slippageBps);const mint = solanaPubkey(mintStr);if (!mint) return error(res, 400, 'validation_error', 'invalid mint');try {const { sdk, BN, web3 } = await getPumpSdk({ network });- const { isLegacyQuoteMint, getBuyTokenAmountFromSolAmount, getSellSolAmountFromTokenAmount } =- await import('@pump-fun/pump-sdk');+ const {+ isLegacyQuoteMint,+ getBuyTokenAmountFromSolAmount,+ getSellSolAmountFromTokenAmount,+ } = await import('@pump-fun/pump-sdk');const LAMPORTS_PER_SOL_Q = web3.LAMPORTS_PER_SOL || 1_000_000_000;// Fetch bonding curve — exposes on-chain quote_mint for V2 coins.@@ -2139,31 +2434,67 @@ async function handleQuote(req, res) {if (curve && !curve.complete) {const global = typeof sdk.fetchGlobal === 'function' ? await sdk.fetchGlobal() : null;+ const feeConfig =+ typeof sdk.fetchFeeConfig === 'function'+ ? await sdk.fetchFeeConfig().catch(() => null)+ : null;let quote = null;if (direction === 'buy') {const quoteAmountRaw = isUsdcQuote ? usdcRaw : solRaw;if (quoteAmountRaw) {const quoteNum = Number(quoteAmountRaw);- if (!(quoteNum > 0)) return error(res, 400, 'validation_error', `${isUsdcQuote ? 'usdc' : 'sol'} must be > 0`);- const atomics = new BN(isUsdcQuote- ? Math.round(quoteNum * USDC_DECIMALS)- : Math.floor(quoteNum * LAMPORTS_PER_SOL_Q));+ if (!(quoteNum > 0))+ return error(+ res,+ 400,+ 'validation_error',+ `${isUsdcQuote ? 'usdc' : 'sol'} must be > 0`,+ );+ const atomics = new BN(+ isUsdcQuote+ ? Math.round(quoteNum * USDC_DECIMALS)+ : Math.floor(quoteNum * LAMPORTS_PER_SOL_Q),+ );const tokens = getBuyTokenAmountFromSolAmount({- global, feeConfig: null, mintSupply: null, bondingCurve: curve, amount: atomics,+ global,+ feeConfig,+ mintSupply: curve.tokenTotalSupply,+ bondingCurve: curve,+ amount: atomics,});quote = isUsdcQuote- ? { usdc_in: quoteNum, tokens_out: tokens.toString(), source: 'bonding_curve' }- : { sol_in: quoteNum, tokens_out: tokens.toString(), source: 'bonding_curve' };+ ? {+ usdc_in: quoteNum,+ tokens_out: tokens.toString(),+ source: 'bonding_curve',+ }+ : {+ sol_in: quoteNum,+ tokens_out: tokens.toString(),+ source: 'bonding_curve',+ };}} else if (direction === 'sell' && tokenRaw) {const tokens = new BN(tokenRaw);const atomicsOut = getSellSolAmountFromTokenAmount({- global, feeConfig: null, mintSupply: null, bondingCurve: curve, amount: tokens,+ global,+ feeConfig,+ mintSupply: curve.tokenTotalSupply,+ bondingCurve: curve,+ amount: tokens,});quote = isUsdcQuote- ? { tokens_in: tokenRaw, usdc_out: Number(atomicsOut.toString()) / USDC_DECIMALS, source: 'bonding_curve' }- : { tokens_in: tokenRaw, sol_out: Number(atomicsOut.toString()) / LAMPORTS_PER_SOL_Q, source: 'bonding_curve' };+ ? {+ tokens_in: tokenRaw,+ usdc_out: Number(atomicsOut.toString()) / USDC_DECIMALS,+ source: 'bonding_curve',+ }+ : {+ tokens_in: tokenRaw,+ sol_out: Number(atomicsOut.toString()) / LAMPORTS_PER_SOL_Q,+ source: 'bonding_curve',+ };}return json(res, 200, {@@ -2173,9 +2504,15 @@ async function handleQuote(req, res) {// SOL curves store quoteMint as PublicKey.default — surface wSOL.quote_mint: isUsdcQuote ? quoteMintPk.toString() : WSOL_MINT,bonding_curve: {- real_quote_reserves: curve.realQuoteReserves?.toString?.() ?? curve.realSolReserves?.toString?.() ?? null,+ real_quote_reserves:+ curve.realQuoteReserves?.toString?.() ??+ curve.realSolReserves?.toString?.() ??+ null,real_token_reserves: curve.realTokenReserves?.toString?.() ?? null,- virtual_quote_reserves: curve.virtualQuoteReserves?.toString?.() ?? curve.virtualSolReserves?.toString?.() ?? null,+ virtual_quote_reserves:+ curve.virtualQuoteReserves?.toString?.() ??+ curve.virtualSolReserves?.toString?.() ??+ null,virtual_token_reserves: curve.virtualTokenReserves?.toString?.() ?? null,complete: curve.complete ?? false,},@@ -2186,7 +2523,11 @@ async function handleQuote(req, res) {// Post-graduation: canonical AMM pool. For USDC pairs use the quote-keyed PDA.let amm;try {- amm = await getAmmPoolState({ network, mint, quoteMint: isUsdcQuote ? quoteMintPk : null });+ amm = await getAmmPoolState({+ network,+ mint,+ quoteMint: isUsdcQuote ? quoteMintPk : null,+ });} catch (e) {if (e.code === 'pool_not_found') {return json(res, 200, {@@ -2201,7 +2542,15 @@ async function handleQuote(req, res) {throw e;}- const { pool, poolKey, baseReserve, quoteReserve, baseMintAccount, globalConfig, feeConfig } = amm;+ const {+ pool,+ poolKey,+ baseReserve,+ quoteReserve,+ baseMintAccount,+ globalConfig,+ feeConfig,+ } = amm;const ammSdk = await import('@pump-fun/pump-swap-sdk');// Resolved pool quoteMint tells us the definitive quote currency.const resolvedQuoteMintStr = pool.quoteMint?.toString?.() ?? quoteMintPk.toString();@@ -2213,20 +2562,34 @@ async function handleQuote(req, res) {const quoteRaw = resolvedIsUsdc ? usdcRaw : solRaw;if (quoteRaw) {const quoteNum = Number(quoteRaw);- if (!(quoteNum > 0)) return error(res, 400, 'validation_error', `${resolvedIsUsdc ? 'usdc' : 'sol'} must be > 0`);+ if (!(quoteNum > 0))+ return error(+ res,+ 400,+ 'validation_error',+ `${resolvedIsUsdc ? 'usdc' : 'sol'} must be > 0`,+ );const atomics = new BN(Math.round(quoteNum * QUOTE_UNIT));const r = ammSdk.buyQuoteInput({- quote: atomics, slippage, baseReserve, quoteReserve,- globalConfig, baseMintAccount,+ quote: atomics,+ slippage: slippagePct,+ baseReserve,+ quoteReserve,+ globalConfig,+ baseMintAccount,baseMint: pool.baseMint,coinCreator: pool.coinCreator,creator: pool.creator,feeConfig,});+ // buyQuoteInput is a quote-input swap: slippage widens the max quote+ // spend (maxQuote), not a token floor — surface that real bound.+ const maxQuoteIn =+ r.maxQuote != null ? Number(r.maxQuote.toString()) / QUOTE_UNIT : null;quote = {...(resolvedIsUsdc ? { usdc_in: quoteNum } : { sol_in: quoteNum }),tokens_out: r.base?.toString?.() ?? null,- min_tokens_out: r.uiBase?.toString?.() ?? r.minBase?.toString?.() ?? null,+ ...(resolvedIsUsdc ? { max_usdc_in: maxQuoteIn } : { max_sol_in: maxQuoteIn }),slippage_bps: slippageBps,source: 'amm',};@@ -2234,16 +2597,20 @@ async function handleQuote(req, res) {} else if (direction === 'sell' && tokenRaw) {const tokens = new BN(tokenRaw);const r = ammSdk.sellBaseInput({- base: tokens, slippage, baseReserve, quoteReserve,- globalConfig, baseMintAccount,+ base: tokens,+ slippage: slippagePct,+ baseReserve,+ quoteReserve,+ globalConfig,+ baseMintAccount,baseMint: pool.baseMint,coinCreator: pool.coinCreator,creator: pool.creator,feeConfig,});- const atomicsOut = r.quote ?? r.uiQuote ?? r.minQuote;+ const atomicsOut = r.uiQuote ?? r.minQuote;const minAtomicsOut = r.minQuote ?? r.uiQuote;- const toUnit = (v) => v != null ? Number(v.toString()) / QUOTE_UNIT : null;+ const toUnit = (v) => (v != null ? Number(v.toString()) / QUOTE_UNIT : null);quote = {tokens_in: tokenRaw,...(resolvedIsUsdc@@ -2358,8 +2725,7 @@ async function handleWithdrawPrep(req, res) {const body = parse(withdrawPrepSchema, await readJson(req));const authority = solanaPubkey(body.authority_wallet);const receiverAta = solanaPubkey(body.receiver_ata);- if (!authority || !receiverAta)- return error(res, 400, 'validation_error', 'invalid pubkeys');+ if (!authority || !receiverAta) return error(res, 400, 'validation_error', 'invalid pubkeys');const [row] = await sql`select m.id, m.mint, m.user_id, m.agent_authority, m.network from pump_agent_mints m@@ -2491,7 +2857,8 @@ async function handleStrategyBacktest(req, res) {}if (!mints.length) return error(res, 422, 'no_candidates', 'no mints to backtest');- const { backtestStrategy } = await import('../../examples/skills/pump-fun-strategy/handlers.js');+ const { backtestStrategy } =+ await import('../../examples/skills/pump-fun-strategy/handlers.js');const result = await backtestStrategy({ strategy: body.strategy, mints, sinceMs: body.sinceMs ?? 0 },{ skills: { invoke: rt.invoke }, memory: { note: () => {} } },@@ -2536,7 +2903,8 @@ async function handleStrategyCloseAll(req, res) {},});- const { closeAllPositions } = await import('../../examples/skills/pump-fun-strategy/handlers.js');+ const { closeAllPositions } =+ await import('../../examples/skills/pump-fun-strategy/handlers.js');const result = await closeAllPositions({ mints: body.mints, simulate: !!body.simulate },{ skills: { invoke: rt.invoke }, wallet, memory: { note: () => {} } },@@ -2556,7 +2924,11 @@ async function loadAgentWalletForStrategy(agentId, userId) {if (!row) throw Object.assign(new Error('agent not found'), { status: 404 });if (row.user_id !== userId) throw Object.assign(new Error('not your agent'), { status: 403 });const enc = row.meta?.encrypted_solana_secret;- if (!enc) throw Object.assign(new Error('agent has no solana wallet — provision via /api/agents/:id/solana'), { status: 409 });+ if (!enc)+ throw Object.assign(+ new Error('agent has no solana wallet — provision via /api/agents/:id/solana'),+ { status: 409 },+ );const wallet = await loadWallet(enc);return { wallet, address: wallet.publicKey.toBase58(), meta: row.meta };}@@ -2569,26 +2941,37 @@ async function handleStrategyRun(req, res) {if (!rl.success) return rateLimited(res, rl);let body;- try { body = await readJson(req); }- catch (e) { return error(res, 400, 'validation_error', e.message); }+ try {+ body = await readJson(req);+ } catch (e) {+ return error(res, 400, 'validation_error', e.message);+ }if (!body?.strategy) return error(res, 400, 'validation_error', 'strategy required');const durationSec = Math.max(5, Math.min(600, Number(body.durationSec) || 30));const mode = body.mode === 'live' ? 'live' : 'simulate';const network = body.network === 'devnet' ? 'devnet' : 'mainnet';- let wallet = null, walletAddress = null, agentMeta = null;+ let wallet = null,+ walletAddress = null,+ agentMeta = null;if (mode === 'live') {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required for live mode');- if (!body.agentId) return error(res, 400, 'validation_error', 'agentId required for live mode');+ if (!body.agentId)+ return error(res, 400, 'validation_error', 'agentId required for live mode');try {const r = await loadAgentWalletForStrategy(body.agentId, auth.userId);wallet = r.wallet;walletAddress = r.address;agentMeta = r.meta;} catch (e) {- return error(res, e.status ?? 500, e.status === 409 ? 'conflict' : 'unauthorized', e.message);+ return error(+ res,+ e.status ?? 500,+ e.status === 409 ? 'conflict' : 'unauthorized',+ e.message,+ );}}@@ -2603,7 +2986,9 @@ async function handleStrategyRun(req, res) {};let aborted = false;- req.on('close', () => { aborted = true; });+ req.on('close', () => {+ aborted = true;+ });const rt = makeRuntime({wallet,@@ -2626,12 +3011,18 @@ async function handleStrategyRun(req, res) {wallet,};- const policyGuard = mode === 'live'- ? async ({ mint, amountSol }) => {- const block = await checkBuyAllowed({ agentId: body.agentId, meta: agentMeta, mint, solAmount: amountSol });- return block ? { code: block.code, msg: block.msg } : null;- }- : null;+ const policyGuard =+ mode === 'live'+ ? async ({ mint, amountSol }) => {+ const block = await checkBuyAllowed({+ agentId: body.agentId,+ meta: agentMeta,+ mint,+ solAmount: amountSol,+ });+ return block ? { code: block.code, msg: block.msg } : null;+ }+ : null;const abortController = new AbortController();req.on('close', () => abortController.abort());@@ -2642,7 +3033,9 @@ async function handleStrategyRun(req, res) {strategy: body.strategy,durationSec,simulate: mode === 'simulate',- onLog: (entry) => { if (!aborted) send('log', entry); },+ onLog: (entry) => {+ if (!aborted) send('log', entry);+ },policyGuard,abortSignal: abortController.signal,},@@ -2754,8 +3147,19 @@ async function handleChannelFeed(req, res) {const kinds = url.searchParams.get('kinds') || null;const { getMints, getWhales, getClaims } = await import('../_lib/channel-feed-sources.js');const { buildFeed } = await import('../../src/pump/channel-feed.js');- const [mints, whales, claims] = await Promise.all([getMints(limit), getWhales(limit), getClaims(limit)]);- const items = buildFeed([{ kind: 'mint', items: mints }, { kind: 'whale', items: whales }, { kind: 'claim', items: claims }], { limit, kinds });+ const [mints, whales, claims] = await Promise.all([+ getMints(limit),+ getWhales(limit),+ getClaims(limit),+ ]);+ const items = buildFeed(+ [+ { kind: 'mint', items: mints },+ { kind: 'whale', items: whales },+ { kind: 'claim', items: claims },+ ],+ { limit, kinds },+ );return json(res, 200, { items });}@@ -2797,10 +3201,15 @@ async function handleTrending(req, res) {upstream.searchParams.set('sort', 'market_cap');upstream.searchParams.set('order', 'DESC');upstream.searchParams.set('includeNsfw', 'false');- const resp = await fetch(upstream, { headers: { accept: 'application/json' }, signal: AbortSignal.timeout(8000) });+ const resp = await fetch(upstream, {+ headers: { accept: 'application/json' },+ signal: AbortSignal.timeout(8000),+ });if (!resp.ok) return error(res, 502, 'upstream_failed', `pump.fun returned ${resp.status}`);const body = await resp.json();- const arr = repairCoinImages(Array.isArray(body) ? body : Array.isArray(body?.coins) ? body.coins : []);+ const arr = repairCoinImages(+ Array.isArray(body) ? body : Array.isArray(body?.coins) ? body.coins : [],+ );TRENDING_CACHE.at = now;TRENDING_CACHE.body = arr;res.setHeader('cache-control', 'public, max-age=15');@@ -2823,7 +3232,8 @@ async function handleCoin(req, res) {if (!rl.success) return rateLimited(res, rl);const url = new URL(req.url, `http://${req.headers.host}`);const mint = (url.searchParams.get('mint') || '').trim();- if (!MINT_RE.test(mint)) return error(res, 400, 'invalid_mint', 'mint must be a base58 address');+ if (!MINT_RE.test(mint))+ return error(res, 400, 'invalid_mint', 'mint must be a base58 address');const now = Date.now();const hit = COIN_CACHE.get(mint);@@ -2875,7 +3285,8 @@ async function handleCoinTrades(req, res) {if (!rl.success) return rateLimited(res, rl);const url = new URL(req.url, `http://${req.headers.host}`);const mint = (url.searchParams.get('mint') || '').trim();- if (!MINT_RE.test(mint)) return error(res, 400, 'invalid_mint', 'mint must be a base58 address');+ if (!MINT_RE.test(mint))+ return error(res, 400, 'invalid_mint', 'mint must be a base58 address');const limit = Math.min(Math.max(1, Number(url.searchParams.get('limit') || 30)), 100);const upstream = `${PUMP_SWAP_BASE}/v2/coins/${mint}/trades?limit=${limit}`;// "Recent trades" is a soft, continuously-polled feed (the homepage live card@@ -2934,10 +3345,15 @@ async function handleSearch(req, res) {upstream.searchParams.set('sort', 'market_cap');upstream.searchParams.set('order', 'DESC');upstream.searchParams.set('includeNsfw', 'false');- const resp = await fetch(upstream, { headers: { accept: 'application/json' }, signal: AbortSignal.timeout(8000) });+ const resp = await fetch(upstream, {+ headers: { accept: 'application/json' },+ signal: AbortSignal.timeout(8000),+ });if (!resp.ok) return error(res, 502, 'upstream_failed', `pump.fun returned ${resp.status}`);const body = await resp.json();- const arr = repairCoinImages(Array.isArray(body) ? body : Array.isArray(body?.coins) ? body.coins : []);+ const arr = repairCoinImages(+ Array.isArray(body) ? body : Array.isArray(body?.coins) ? body.coins : [],+ );return json(res, 200, arr);}@@ -2946,7 +3362,13 @@ async function handleSearch(req, res) {import { z as _z } from 'zod';const _deliverSchema = _z.object({chatId: _z.union([_z.string(), _z.number()]),- signal: _z.object({ kind: _z.enum(['mint', 'whale', 'claim', 'graduation']), mint: _z.string(), summary: _z.string(), refs: _z.array(_z.string()).optional(), ts: _z.number().optional() }),+ signal: _z.object({+ kind: _z.enum(['mint', 'whale', 'claim', 'graduation']),+ mint: _z.string(),+ summary: _z.string(),+ refs: _z.array(_z.string()).optional(),+ ts: _z.number().optional(),+ }),});async function handleDeliverTelegram(req, res) {@@ -2971,8 +3393,11 @@ const LOOKBACK_MULT = 8;export async function scanFirstClaims({ sinceTs, limit }) {const lim = Math.max(1, Math.min(50, limit));- const lookbackTs = sinceTs - Math.max(3600, (Math.floor(Date.now() / 1000) - sinceTs) * LOOKBACK_MULT);- const allClaims = process.env.PUMPFUN_BOT_URL ? await _fetchFromBot(lookbackTs, lim * LOOKBACK_MULT) : await _fetchFromRpc(lookbackTs, lim * LOOKBACK_MULT);+ const lookbackTs =+ sinceTs - Math.max(3600, (Math.floor(Date.now() / 1000) - sinceTs) * LOOKBACK_MULT);+ const allClaims = process.env.PUMPFUN_BOT_URL+ ? await _fetchFromBot(lookbackTs, lim * LOOKBACK_MULT)+ : await _fetchFromRpc(lookbackTs, lim * LOOKBACK_MULT);return filterFirstClaims(allClaims, sinceTs, lim);}@@ -3009,9 +3434,17 @@ async function handleFirstClaims(req, res) {const url = new URL(req.url, 'http://x');const limit = Math.max(1, Math.min(50, Number(url.searchParams.get('limit')) || 50));let sinceTs;- if (url.searchParams.has('sinceTs')) { sinceTs = Number(url.searchParams.get('sinceTs')); }- else { const sinceMinutes = Math.max(1, Math.min(1440, Number(url.searchParams.get('sinceMinutes')) || 60)); sinceTs = Math.floor(Date.now() / 1000) - sinceMinutes * 60; }- if (!Number.isFinite(sinceTs) || sinceTs <= 0) return error(res, 400, 'validation_error', 'invalid sinceTs');+ if (url.searchParams.has('sinceTs')) {+ sinceTs = Number(url.searchParams.get('sinceTs'));+ } else {+ const sinceMinutes = Math.max(+ 1,+ Math.min(1440, Number(url.searchParams.get('sinceMinutes')) || 60),+ );+ sinceTs = Math.floor(Date.now() / 1000) - sinceMinutes * 60;+ }+ if (!Number.isFinite(sinceTs) || sinceTs <= 0)+ return error(res, 400, 'validation_error', 'invalid sinceTs');const items = await scanFirstClaims({ sinceTs, limit });return json(res, 200, { items });}@@ -3027,61 +3460,112 @@ async function _botCall(tool, args) {const url = process.env.PUMPFUN_BOT_URL;if (!url) return { ok: false };const headers = { 'content-type': 'application/json', accept: 'application/json' };- if (process.env.PUMPFUN_BOT_TOKEN) headers.authorization = `Bearer ${process.env.PUMPFUN_BOT_TOKEN}`;+ if (process.env.PUMPFUN_BOT_TOKEN)+ headers.authorization = `Bearer ${process.env.PUMPFUN_BOT_TOKEN}`;const ctrl = new AbortController();const t = setTimeout(() => ctrl.abort(), 8000);try {- const resp = await fetch(url.replace(/\/$/, ''), { method: 'POST', headers, signal: ctrl.signal, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'tools/call', params: { name: tool, arguments: args || {} } }) });+ const resp = await fetch(url.replace(/\/$/, ''), {+ method: 'POST',+ headers,+ signal: ctrl.signal,+ body: JSON.stringify({+ jsonrpc: '2.0',+ id: 1,+ method: 'tools/call',+ params: { name: tool, arguments: args || {} },+ }),+ });if (!resp.ok) return { ok: false, error: `bot ${resp.status}` };const j = await resp.json();if (j.error) return { ok: false, error: j.error.message || 'rpc error' };const data = j.result?.structuredContent ?? j.result?.content ?? j.result;return { ok: true, data: Array.isArray(data) ? data : (data?.items ?? []) };- } catch (err) { return { ok: false, error: err?.message || 'fetch failed' }; }- finally { clearTimeout(t); }+ } catch (err) {+ return { ok: false, error: err?.message || 'fetch failed' };+ } finally {+ clearTimeout(t);+ }}function _normalise(items) {- return (items || []).map((x) => ({ creator: String(x.claimerWallet || x.creator || x.wallet || ''), mint: String(x.tokenMint || x.mint || ''), signature: String(x.txSignature || x.tx_signature || x.signature || ''), lamports: Number(x.amountLamports || x.lamports || 0), ts: Number(x.timestamp || x.ts || 0) })).filter((x) => x.creator && x.signature && x.ts > 0);+ return (items || [])+ .map((x) => ({+ creator: String(x.claimerWallet || x.creator || x.wallet || ''),+ mint: String(x.tokenMint || x.mint || ''),+ signature: String(x.txSignature || x.tx_signature || x.signature || ''),+ lamports: Number(x.amountLamports || x.lamports || 0),+ ts: Number(x.timestamp || x.ts || 0),+ }))+ .filter((x) => x.creator && x.signature && x.ts > 0);}async function _fetchFromRpc(lookbackTs, maxItems) {try {const connection = getConnection({ network: 'mainnet' });const { PublicKey } = await import('@solana/web3.js');- const sigs = await connection.getSignaturesForAddress(new PublicKey(PUMP_PROGRAM), { limit: 200 });- const inWindow = sigs.filter((s) => s.blockTime != null && s.blockTime >= lookbackTs && !s.err);+ const sigs = await connection.getSignaturesForAddress(new PublicKey(PUMP_PROGRAM), {+ limit: 200,+ });+ const inWindow = sigs.filter(+ (s) => s.blockTime != null && s.blockTime >= lookbackTs && !s.err,+ );if (!inWindow.length) return [];const toFetch = inWindow.slice(0, Math.min(30, maxItems * 2));- const settled = await Promise.allSettled(toFetch.map((s) => connection.getParsedTransaction(s.signature, { maxSupportedTransactionVersion: 0, commitment: 'confirmed' })));+ const settled = await Promise.allSettled(+ toFetch.map((s) =>+ connection.getParsedTransaction(s.signature, {+ maxSupportedTransactionVersion: 0,+ commitment: 'confirmed',+ }),+ ),+ );const claims = [];for (let i = 0; i < settled.length; i++) {if (settled[i].status !== 'fulfilled' || !settled[i].value) continue;- const claim = _parseClaim(settled[i].value, toFetch[i].signature, toFetch[i].blockTime ?? 0);+ const claim = _parseClaim(+ settled[i].value,+ toFetch[i].signature,+ toFetch[i].blockTime ?? 0,+ );if (claim) claims.push(claim);}return claims;- } catch { return []; }+ } catch {+ return [];+ }}function _parseClaim(tx, signature, ts) {if (tx?.meta?.err) return null;const ixs = tx?.transaction?.message?.instructions ?? [];const accountKeys = tx?.transaction?.message?.accountKeys ?? [];- const pre = tx?.meta?.preBalances ?? [], post = tx?.meta?.postBalances ?? [];+ const pre = tx?.meta?.preBalances ?? [],+ post = tx?.meta?.postBalances ?? [];for (const ix of ixs) {if (!ix.data || typeof ix.data !== 'string') continue;const progKey = accountKeys[ix.programIdIndex];const progId = progKey?.pubkey?.toString?.() ?? String(progKey ?? '');if (progId !== PUMP_PROGRAM) continue;let bytes;- try { bytes = bs58.decode(ix.data); } catch { continue; }+ try {+ bytes = bs58.decode(ix.data);+ } catch {+ continue;+ }if (bytes.length < 8) continue;const disc = Buffer.from(bytes.subarray(0, 8)).toString('hex');if (!CLAIM_DISCS.has(disc)) continue;- const creator = (accountKeys[0]?.pubkey?.toString?.() ?? String(accountKeys[0] ?? ''));+ const creator = accountKeys[0]?.pubkey?.toString?.() ?? String(accountKeys[0] ?? '');if (!creator) continue;let lamports = 0;- for (let i = 0; i < accountKeys.length; i++) { const delta = (post[i] ?? 0) - (pre[i] ?? 0); if (delta > lamports) lamports = delta; }+ for (let i = 0; i < accountKeys.length; i++) {+ const delta = (post[i] ?? 0) - (pre[i] ?? 0);+ if (delta > lamports) lamports = delta;+ }let mint = '';- if (disc === 'a537817004b3ca28' && bytes.length >= 48) { try { mint = bs58.encode(bytes.slice(16, 48)); } catch {} }+ if (disc === 'a537817004b3ca28' && bytes.length >= 48) {+ try {+ mint = bs58.encode(bytes.slice(16, 48));+ } catch {}+ }return { creator, mint, signature, lamports, ts };}return null;@@ -3091,33 +3575,76 @@ function _parseClaim(tx, signature, ts) {async function handleVanityKeygen(req, res) {if (cors(req, res, { methods: 'POST,OPTIONS', origins: '*' })) return;- if (req.method !== 'POST') { res.setHeader('allow', 'POST'); return error(res, 405, 'method_not_allowed', 'method POST required'); }+ if (req.method !== 'POST') {+ res.setHeader('allow', 'POST');+ return error(res, 405, 'method_not_allowed', 'method POST required');+ }const rl = await limits.mcpIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);let body;- try { body = await readJson(req); } catch (e) { return error(res, e.status || 400, 'bad_request', e.message); }+ try {+ body = await readJson(req);+ } catch (e) {+ return error(res, e.status || 400, 'bad_request', e.message);+ }const { suffix = '', prefix = '', caseSensitive = false, maxAttempts = 5_000_000 } = body || {};- if (!suffix && !prefix) return error(res, 400, 'validation_error', 'at least one of suffix or prefix is required');+ if (!suffix && !prefix)+ return error(res, 400, 'validation_error', 'at least one of suffix or prefix is required');res.statusCode = 200;res.setHeader('content-type', 'text/event-stream; charset=utf-8');res.setHeader('cache-control', 'no-store');res.setHeader('connection', 'keep-alive');res.setHeader('x-accel-buffering', 'no');const ac = new AbortController();- const timeout = setTimeout(() => { ac.abort(); _sse(res, 'error', { error: 'request_timeout', error_description: 'vanity search exceeded 60 s limit' }); res.statusCode = 408; res.end(); }, 60_000);+ const timeout = setTimeout(() => {+ ac.abort();+ _sse(res, 'error', {+ error: 'request_timeout',+ error_description: 'vanity search exceeded 60 s limit',+ });+ res.statusCode = 408;+ res.end();+ }, 60_000);req.on('close', () => ac.abort());- const progressInterval = setInterval(() => { if (ac.signal.aborted) return clearInterval(progressInterval); _sse(res, 'progress', { elapsed: Date.now() }); }, 2_000);+ const progressInterval = setInterval(() => {+ if (ac.signal.aborted) return clearInterval(progressInterval);+ _sse(res, 'progress', { elapsed: Date.now() });+ }, 2_000);try {const { generateVanityKey } = await import('../../src/pump/vanity-keygen.js');const _bs58 = (await import('bs58')).default;- const result = await generateVanityKey({ suffix, prefix, caseSensitive, maxAttempts, signal: ac.signal });- clearTimeout(timeout); clearInterval(progressInterval);- if (!result) _sse(res, 'error', { error: 'max_attempts_reached', error_description: `no match found in ${maxAttempts} attempts` });- else _sse(res, 'result', { publicKey: result.publicKey, secretKey: _bs58.encode(result.secretKey), attempts: result.attempts, ms: result.ms });+ const result = await generateVanityKey({+ suffix,+ prefix,+ caseSensitive,+ maxAttempts,+ signal: ac.signal,+ });+ clearTimeout(timeout);+ clearInterval(progressInterval);+ if (!result)+ _sse(res, 'error', {+ error: 'max_attempts_reached',+ error_description: `no match found in ${maxAttempts} attempts`,+ });+ else+ _sse(res, 'result', {+ publicKey: result.publicKey,+ secretKey: _bs58.encode(result.secretKey),+ attempts: result.attempts,+ ms: result.ms,+ });} catch (err) {- clearTimeout(timeout); clearInterval(progressInterval);- if (!res.writableEnded) _sse(res, 'error', { error: 'internal_error', error_description: err.message || 'unexpected error' });- } finally { if (!res.writableEnded) res.end(); }+ clearTimeout(timeout);+ clearInterval(progressInterval);+ if (!res.writableEnded)+ _sse(res, 'error', {+ error: 'internal_error',+ error_description: err.message || 'unexpected error',+ });+ } finally {+ if (!res.writableEnded) res.end();+ }}// ── collect-creator-fee-prep ───────────────────────────────────────────────@@ -3145,7 +3672,7 @@ async function handleCollectCreatorFeePrep(req, res) {const body = parse(collectCreatorFeePrepSchema, await readJson(req));const creatorPk = solanaPubkey(body.creator_address);- const feePayer = solanaPubkey(body.wallet_address);+ const feePayer = solanaPubkey(body.wallet_address);if (!creatorPk || !feePayer) return error(res, 400, 'validation_error', 'invalid pubkeys');try {@@ -3164,7 +3691,12 @@ async function handleCollectCreatorFeePrep(req, res) {tx_base64,});} catch (e) {- return error(res, e.status || 502, e.code || 'pump_sdk_error', e.message || 'failed to build collect-creator-fee tx');+ return error(+ res,+ e.status || 502,+ e.code || 'pump_sdk_error',+ e.message || 'failed to build collect-creator-fee tx',+ );}}@@ -3200,7 +3732,7 @@ async function handleDistributeCreatorFeesPrep(req, res) {if (!rl.success) return rateLimited(res, rl);const body = parse(distributeCreatorFeesPrepSchema, await readJson(req));- const mintPk = solanaPubkey(body.mint);+ const mintPk = solanaPubkey(body.mint);const payerPk = solanaPubkey(body.wallet_address);if (!mintPk || !payerPk) return error(res, 400, 'validation_error', 'invalid pubkeys');@@ -3208,7 +3740,8 @@ async function handleDistributeCreatorFeesPrep(req, res) {const { connection } = await getPumpSdk({ network: body.network });const { OnlinePumpSdk } = await import('@pump-fun/pump-sdk');const onlineSdk = new OnlinePumpSdk(connection);- const { instructions, isGraduated } = await onlineSdk.buildDistributeCreatorFeesInstructions(mintPk);+ const { instructions, isGraduated } =+ await onlineSdk.buildDistributeCreatorFeesInstructions(mintPk);const tx_base64 = await buildUnsignedTxBase64({network: body.network,payer: payerPk,@@ -3221,7 +3754,12 @@ async function handleDistributeCreatorFeesPrep(req, res) {tx_base64,});} catch (e) {- return error(res, e.status || 502, e.code || 'pump_sdk_error', e.message || 'failed to build distribute-creator-fees tx');+ return error(+ res,+ e.status || 502,+ e.code || 'pump_sdk_error',+ e.message || 'failed to build distribute-creator-fees tx',+ );}}@@ -3254,14 +3792,12 @@ const updateFeeSharesSchema = z.object({).min(1).max(10)- .refine(- (arr) => arr.reduce((s, x) => s + x.share_bps, 0) === 10_000,- { message: 'share_bps must sum to 10000' },- )- .refine(- (arr) => new Set(arr.map((x) => x.address)).size === arr.length,- { message: 'duplicate shareholder addresses' },- ),+ .refine((arr) => arr.reduce((s, x) => s + x.share_bps, 0) === 10_000, {+ message: 'share_bps must sum to 10000',+ })+ .refine((arr) => new Set(arr.map((x) => x.address)).size === arr.length, {+ message: 'duplicate shareholder addresses',+ }),});async function handleUpdateFeeSharesPrep(req, res) {@@ -3275,16 +3811,25 @@ async function handleUpdateFeeSharesPrep(req, res) {if (!rl.success) return rateLimited(res, rl);const body = parse(updateFeeSharesSchema, await readJson(req));- const mintPk = solanaPubkey(body.mint);- const payerPk = solanaPubkey(body.wallet_address);+ const mintPk = solanaPubkey(body.mint);+ const payerPk = solanaPubkey(body.wallet_address);if (!mintPk || !payerPk) return error(res, 400, 'validation_error', 'invalid pubkeys');- const guard = await assertCoinNotOwnedByOther({ userId: user.id, mint: body.mint, network: body.network, res });+ const guard = await assertCoinNotOwnedByOther({+ userId: user.id,+ mint: body.mint,+ network: body.network,+ res,+ });if (guard.blocked) return;const newShareholders = body.new_shareholders.map((s) => {const addr = solanaPubkey(s.address);- if (!addr) throw Object.assign(new Error(`invalid shareholder ${s.address}`), { status: 400, code: 'validation_error' });+ if (!addr)+ throw Object.assign(new Error(`invalid shareholder ${s.address}`), {+ status: 400,+ code: 'validation_error',+ });return { address: addr, shareBps: s.share_bps };});@@ -3298,14 +3843,23 @@ async function handleUpdateFeeSharesPrep(req, res) {if (body.current_shareholders?.length) {currentShareholders = body.current_shareholders.map((s) => {const pk = solanaPubkey(s);- if (!pk) throw Object.assign(new Error(`invalid current shareholder ${s}`), { status: 400, code: 'validation_error' });+ if (!pk)+ throw Object.assign(new Error(`invalid current shareholder ${s}`), {+ status: 400,+ code: 'validation_error',+ });return pk;});} else {const { feeSharingConfigPda } = await import('@pump-fun/pump-sdk');const cfgInfo = await connection.getAccountInfo(feeSharingConfigPda(mintPk));if (!cfgInfo) {- return error(res, 409, 'no_sharing_config', 'no fee-sharing config for this coin — create one first via create-fee-sharing-prep');+ return error(+ res,+ 409,+ 'no_sharing_config',+ 'no fee-sharing config for this coin — create one first via create-fee-sharing-prep',+ );}const cfg = sdk.decodeSharingConfig(cfgInfo);currentShareholders = cfg.shareholders.map((s) => new PublicKey(s.address));@@ -3329,7 +3883,12 @@ async function handleUpdateFeeSharesPrep(req, res) {tx_base64,});} catch (e) {- return error(res, e.status || 502, e.code || 'pump_sdk_error', e.message || 'failed to build update-fee-shares tx');+ return error(+ res,+ e.status || 502,+ e.code || 'pump_sdk_error',+ e.message || 'failed to build update-fee-shares tx',+ );}}@@ -3356,12 +3915,18 @@ async function handleCreateFeeSharingPrep(req, res) {if (!rl.success) return rateLimited(res, rl);const body = parse(createFeeSharingPrepSchema, await readJson(req));- const mintPk = solanaPubkey(body.mint);+ const mintPk = solanaPubkey(body.mint);const creatorPk = solanaPubkey(body.creator_address);- const payerPk = solanaPubkey(body.wallet_address);- if (!mintPk || !creatorPk || !payerPk) return error(res, 400, 'validation_error', 'invalid pubkeys');+ const payerPk = solanaPubkey(body.wallet_address);+ if (!mintPk || !creatorPk || !payerPk)+ return error(res, 400, 'validation_error', 'invalid pubkeys');- const guard = await assertCoinNotOwnedByOther({ userId: user.id, mint: body.mint, network: body.network, res });+ const guard = await assertCoinNotOwnedByOther({+ userId: user.id,+ mint: body.mint,+ network: body.network,+ res,+ });if (guard.blocked) return;try {@@ -3369,19 +3934,23 @@ async function handleCreateFeeSharingPrep(req, res) {const { bondingCurvePda } = await import('@pump-fun/pump-sdk');const { isLegacyQuoteMint } = await getPumpSdkV2({ network: body.network });const { sdk, connection } = await getPumpSdk({ network: body.network });-+const bcPda = bondingCurvePda(mintPk);const bcInfo = await connection.getAccountInfo(bcPda);const bc = bcInfo ? sdk.decodeBondingCurve(bcInfo) : null;-+let poolPk;if (bc && bc.quoteMint && !isLegacyQuoteMint(bc.quoteMint)) {poolPk = canonicalPumpPoolPda(mintPk, bc.quoteMint);} else {poolPk = canonicalPumpPoolPda(mintPk);}-- const ix = await sdk.createFeeSharingConfig({ creator: creatorPk, mint: mintPk, pool: poolPk });++ const ix = await sdk.createFeeSharingConfig({+ creator: creatorPk,+ mint: mintPk,+ pool: poolPk,+ });const tx_base64 = await buildUnsignedTxBase64({network: body.network,payer: payerPk,@@ -3395,7 +3964,12 @@ async function handleCreateFeeSharingPrep(req, res) {tx_base64,});} catch (e) {- return error(res, e.status || 502, e.code || 'pump_sdk_error', e.message || 'failed to build create-fee-sharing tx');+ return error(+ res,+ e.status || 502,+ e.code || 'pump_sdk_error',+ e.message || 'failed to build create-fee-sharing tx',+ );}}@@ -3434,7 +4008,11 @@ const SOCIAL_PLATFORM_ID = { pump: 0, x: 1, github: 2 };const resolveGithubShareholderSchema = z.object({github_username: z.string().trim().min(1).max(40).optional(),- github_user_id: z.string().trim().regex(/^\d{1,20}$/).optional(),+ github_user_id: z+ .string()+ .trim()+ .regex(/^\d{1,20}$/)+ .optional(),network: z.enum(['mainnet', 'devnet']).default('mainnet'),}).refine((b) => b.github_username || b.github_user_id, {@@ -3546,7 +4124,12 @@ async function handleCreateSocialFeePdaPrep(req, res) {if (!payerPk) return error(res, 400, 'validation_error', 'invalid wallet_address');if (body.mint) {- const guard = await assertCoinNotOwnedByOther({ userId: user.id, mint: body.mint, network: body.network, res });+ const guard = await assertCoinNotOwnedByOther({+ userId: user.id,+ mint: body.mint,+ network: body.network,+ res,+ });if (guard.blocked) return;}@@ -3573,7 +4156,12 @@ async function handleCreateSocialFeePdaPrep(req, res) {tx_base64,});} catch (e) {- return error(res, e.status || 502, e.code || 'pump_sdk_error', e.message || 'failed to build create-social-fee-pda tx');+ return error(+ res,+ e.status || 502,+ e.code || 'pump_sdk_error',+ e.message || 'failed to build create-social-fee-pda tx',+ );}}// ── fee-info ───────────────────────────────────────────────────────────────@@ -3628,12 +4216,17 @@ async function handleFeeInfo(req, res) {try {const pool = await new OnlinePumpAmmSdk(connection).fetchPool(poolPda);poolCoinCreator = pool.coinCreator;- isCashbackCoin = pool.isCashbackCoin === true- || (Array.isArray(pool.is_cashback_coin) && pool.is_cashback_coin[0] === true);- } catch { /* pool not fully initialized */ }+ isCashbackCoin =+ pool.isCashbackCoin === true ||+ (Array.isArray(pool.is_cashback_coin) && pool.is_cashback_coin[0] === true);+ } catch {+ /* pool not fully initialized */+ }} else {- isCashbackCoin = bondingCurve.isCashbackCoin === true- || (Array.isArray(bondingCurve.is_cashback_coin) && bondingCurve.is_cashback_coin[0] === true);+ isCashbackCoin =+ bondingCurve.isCashbackCoin === true ||+ (Array.isArray(bondingCurve.is_cashback_coin) &&+ bondingCurve.is_cashback_coin[0] === true);}const effectiveCreator = poolCoinCreator ?? new PublicKey(bondingCurve.creator);@@ -3681,14 +4274,24 @@ async function handleFeeInfo(req, res) {const ammInfo = await connection.getAccountInfo(ammAta);if (ammInfo) {const parsed = AccountLayout.decode(- new Uint8Array(ammInfo.data.buffer, ammInfo.data.byteOffset, ammInfo.data.byteLength),+ new Uint8Array(+ ammInfo.data.buffer,+ ammInfo.data.byteOffset,+ ammInfo.data.byteLength,+ ),);claimableLamports += BigInt(parsed.amount.toString());}- } catch { /* no AMM vault yet */ }+ } catch {+ /* no AMM vault yet */+ }}- const feeDestination = isCashbackCoin ? 'cashback' : hasSharingConfig ? 'sharing_config' : 'creator';+ const feeDestination = isCashbackCoin+ ? 'cashback'+ : hasSharingConfig+ ? 'sharing_config'+ : 'creator';return json(res, 200, {mint: mintPk.toBase58(),@@ -3703,7 +4306,12 @@ async function handleFeeInfo(req, res) {sharing_config: sharingConfig,});} catch (e) {- return error(res, e.status || 502, e.code || 'pump_sdk_error', e.message || 'failed to read fee info');+ return error(+ res,+ e.status || 502,+ e.code || 'pump_sdk_error',+ e.message || 'failed to read fee info',+ );}}@@ -3731,12 +4339,20 @@ async function signSendWithAgent({ network, agentKeypair, instructions, extraSig// { agent, mintRow, loaded, creator } or sends an error and returns null.async function resolveAgentFeeContext(req, res, body) {const user = await getSessionUser(req);- if (!user) { error(res, 401, 'unauthorized', 'sign in required'); return null; }+ if (!user) {+ error(res, 401, 'unauthorized', 'sign in required');+ return null;+ }const agent = await resolveLaunchAgentId({- userId: user.id, agentId: body.agent_id, avatarId: body.avatar_id,+ userId: user.id,+ agentId: body.agent_id,+ avatarId: body.avatar_id,});- if (!agent) { error(res, 404, 'not_found', 'agent not found'); return null; }+ if (!agent) {+ error(res, 404, 'not_found', 'agent not found');+ return null;+ }const [mintRow] = await sql`select id, mint, network, agent_authority, sharing_config@@ -3744,18 +4360,28 @@ async function resolveAgentFeeContext(req, res, body) {where agent_id=${agent.id} and mint=${body.mint} and network=${body.network}limit 1`;- if (!mintRow) { error(res, 404, 'not_found', 'coin not found for this agent'); return null; }+ if (!mintRow) {+ error(res, 404, 'not_found', 'coin not found for this agent');+ return null;+ }const loaded = await loadAgentForSigning(agent.id, user.id, {reason: 'studio_fee_action',meta: { mint: body.mint, network: body.network },});- if (loaded.error) { error(res, loaded.error.status, loaded.error.code, loaded.error.msg); return null; }+ if (loaded.error) {+ error(res, loaded.error.status, loaded.error.code, loaded.error.msg);+ return null;+ }const creator = loaded.keypair.publicKey.toBase58();if (mintRow.agent_authority && mintRow.agent_authority !== creator) {- error(res, 409, 'creator_mismatch',- 'this coin was launched from a connected wallet — claim with that wallet instead of the agent wallet');+ error(+ res,+ 409,+ 'creator_mismatch',+ 'this coin was launched from a connected wallet — claim with that wallet instead of the agent wallet',+ );return null;}return { user, agent, mintRow, loaded, creator };@@ -3765,12 +4391,14 @@ async function resolveAgentFeeContext(req, res, body) {// Server-signs the creator-fee collection with the agent custodial wallet. Use// for coins launched from the agent wallet (agent_authority == agent wallet).-const collectFeeAgentSchema = z.object({- agent_id: z.string().uuid().optional(),- avatar_id: z.string().uuid().optional(),- mint: z.string().min(32).max(44),- network: z.enum(['mainnet', 'devnet']).default('mainnet'),-}).refine((b) => b.agent_id || b.avatar_id, { message: 'agent_id or avatar_id required' });+const collectFeeAgentSchema = z+ .object({+ agent_id: z.string().uuid().optional(),+ avatar_id: z.string().uuid().optional(),+ mint: z.string().min(32).max(44),+ network: z.enum(['mainnet', 'devnet']).default('mainnet'),+ })+ .refine((b) => b.agent_id || b.avatar_id, { message: 'agent_id or avatar_id required' });async function handleCollectCreatorFeeAgent(req, res) {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;@@ -3801,7 +4429,10 @@ async function handleCollectCreatorFeeAgent(req, res) {${'pumpfun'})`.catch((e) => console.error('[pump/collect-creator-fee-agent] log failed', e?.message));return json(res, 201, {- ok: true, mint: body.mint, network: body.network, signature,+ ok: true,+ mint: body.mint,+ network: body.network,+ signature,explorer: `https://solscan.io/tx/${signature}${body.network === 'devnet' ? '?cluster=devnet' : ''}`,});} catch (e) {@@ -3829,7 +4460,9 @@ async function handleDistributeCreatorFeesAgent(req, res) {const { connection } = await getPumpSdk({ network: body.network });const { OnlinePumpSdk } = await import('@pump-fun/pump-sdk');const onlineSdk = new OnlinePumpSdk(connection);- const { instructions } = await onlineSdk.buildDistributeCreatorFeesInstructions(new PublicKey(body.mint));+ const { instructions } = await onlineSdk.buildDistributeCreatorFeesInstructions(+ new PublicKey(body.mint),+ );const signature = await signSendWithAgent({network: body.network,agentKeypair: ctx.loaded.keypair,@@ -3842,7 +4475,10 @@ async function handleDistributeCreatorFeesAgent(req, res) {${'pumpfun'})`.catch((e) => console.error('[pump/distribute-creator-fees-agent] log failed', e?.message));return json(res, 201, {- ok: true, mint: body.mint, network: body.network, signature,+ ok: true,+ mint: body.mint,+ network: body.network,+ signature,explorer: `https://solscan.io/tx/${signature}${body.network === 'devnet' ? '?cluster=devnet' : ''}`,});} catch (e) {@@ -3857,18 +4493,29 @@ async function handleDistributeCreatorFeesAgent(req, res) {// list of delegated wallets (e.g. GitHub contributors) who can each claim their// share via distribute. Shares are basis points and must sum to 10000.-const feeSharingAgentSchema = z.object({- agent_id: z.string().uuid().optional(),- avatar_id: z.string().uuid().optional(),- mint: z.string().min(32).max(44),- network: z.enum(['mainnet', 'devnet']).default('mainnet'),- shareholders: z.array(z.object({- address: z.string().min(32).max(44),- share_bps: z.number().int().min(1).max(10_000),- })).min(1).max(10)- .refine((arr) => arr.reduce((s, x) => s + x.share_bps, 0) === 10_000, { message: 'share_bps must sum to 10000' })- .refine((arr) => new Set(arr.map((x) => x.address)).size === arr.length, { message: 'duplicate shareholder addresses' }),-}).refine((b) => b.agent_id || b.avatar_id, { message: 'agent_id or avatar_id required' });+const feeSharingAgentSchema = z+ .object({+ agent_id: z.string().uuid().optional(),+ avatar_id: z.string().uuid().optional(),+ mint: z.string().min(32).max(44),+ network: z.enum(['mainnet', 'devnet']).default('mainnet'),+ shareholders: z+ .array(+ z.object({+ address: z.string().min(32).max(44),+ share_bps: z.number().int().min(1).max(10_000),+ }),+ )+ .min(1)+ .max(10)+ .refine((arr) => arr.reduce((s, x) => s + x.share_bps, 0) === 10_000, {+ message: 'share_bps must sum to 10000',+ })+ .refine((arr) => new Set(arr.map((x) => x.address)).size === arr.length, {+ message: 'duplicate shareholder addresses',+ }),+ })+ .refine((b) => b.agent_id || b.avatar_id, { message: 'agent_id or avatar_id required' });async function handleFeeSharingAgent(req, res) {if (cors(req, res, { methods: 'POST,OPTIONS', credentials: true })) return;@@ -3883,7 +4530,11 @@ async function handleFeeSharingAgent(req, res) {const newShareholders = body.shareholders.map((s) => {const pk = solanaPubkey(s.address);- if (!pk) throw Object.assign(new Error(`invalid shareholder ${s.address}`), { status: 400, code: 'validation_error' });+ if (!pk)+ throw Object.assign(new Error(`invalid shareholder ${s.address}`), {+ status: 400,+ code: 'validation_error',+ });return { address: pk, shareBps: s.share_bps };});@@ -3899,12 +4550,12 @@ async function handleFeeSharingAgent(req, res) {getPumpSdkV2({ network: body.network }),]);- const mintPk = new PublicKey(body.mint);- const creator = ctx.loaded.keypair.publicKey;+ const mintPk = new PublicKey(body.mint);+ const creator = ctx.loaded.keypair.publicKey;// The sharing-config account existing on-chain means the split has already// been initialized — skip creation and go straight to updating shares.- const cfgPda = feeSharingConfigPda(mintPk);+ const cfgPda = feeSharingConfigPda(mintPk);const cfgInfo = await connection.getAccountInfo(cfgPda);const configExists = !!cfgInfo;@@ -3915,13 +4566,22 @@ async function handleFeeSharingAgent(req, res) {if (!configExists) {const bcInfo = await connection.getAccountInfo(bondingCurvePda(mintPk));const bc = bcInfo ? sdk.decodeBondingCurve(bcInfo) : null;- const poolPk = (bc && bc.quoteMint && !isLegacyQuoteMint(bc.quoteMint))- ? canonicalPumpPoolPda(mintPk, bc.quoteMint)- : canonicalPumpPoolPda(mintPk);- const createIx = await sdk.createFeeSharingConfig({ creator, mint: mintPk, pool: poolPk });- signatures.push(await signSendWithAgent({- network: body.network, agentKeypair: ctx.loaded.keypair, instructions: [createIx],- }));+ const poolPk =+ bc && bc.quoteMint && !isLegacyQuoteMint(bc.quoteMint)+ ? canonicalPumpPoolPda(mintPk, bc.quoteMint)+ : canonicalPumpPoolPda(mintPk);+ const createIx = await sdk.createFeeSharingConfig({+ creator,+ mint: mintPk,+ pool: poolPk,+ });+ signatures.push(+ await signSendWithAgent({+ network: body.network,+ agentKeypair: ctx.loaded.keypair,+ instructions: [createIx],+ }),+ );}// Step 2 — set the shareholder split. Right after creation the current set@@ -3929,15 +4589,23 @@ async function handleFeeSharingAgent(req, res) {const cached = Array.isArray(ctx.mintRow.sharing_config?.shareholders)? ctx.mintRow.sharing_config.shareholders: null;- const currentShareholders = (configExists && cached?.length)- ? cached.map((s) => new PublicKey(s.address))- : [creator];+ const currentShareholders =+ configExists && cached?.length+ ? cached.map((s) => new PublicKey(s.address))+ : [creator];const updateIx = await sdk.updateFeeShares({- authority: creator, mint: mintPk, currentShareholders, newShareholders,+ authority: creator,+ mint: mintPk,+ currentShareholders,+ newShareholders,});- signatures.push(await signSendWithAgent({- network: body.network, agentKeypair: ctx.loaded.keypair, instructions: [updateIx],- }));+ signatures.push(+ await signSendWithAgent({+ network: body.network,+ agentKeypair: ctx.loaded.keypair,+ instructions: [updateIx],+ }),+ );// Cache the split so the next update knows the current shareholder set and// the UI reflects delegation immediately. On-chain fee-info remains the@@ -3960,13 +4628,21 @@ async function handleFeeSharingAgent(req, res) {`.catch((e) => console.error('[pump/fee-sharing-agent] log failed', e?.message));return json(res, 201, {- ok: true, mint: body.mint, network: body.network,- created: !configExists, signatures,+ ok: true,+ mint: body.mint,+ network: body.network,+ created: !configExists,+ signatures,sharing_config: sharingConfig,explorer: `https://solscan.io/tx/${signatures[signatures.length - 1]}${body.network === 'devnet' ? '?cluster=devnet' : ''}`,});} catch (e) {- return error(res, e.status || 502, e.code || 'rpc_error', e.message || 'fee sharing failed');+ return error(+ res,+ e.status || 502,+ e.code || 'rpc_error',+ e.message || 'fee sharing failed',+ );}}@@ -3993,16 +4669,20 @@ async function handleGithubResolve(req, res) {try {const headers = { 'user-agent': 'three.ws', accept: 'application/vnd.github+json' };if (process.env.GITHUB_TOKEN) headers.authorization = `Bearer ${process.env.GITHUB_TOKEN}`;- const gh = await fetch(`https://api.github.com/users/${encodeURIComponent(handle)}`, { headers });- if (gh.status === 404) return error(res, 404, 'github_user_not_found', `@${handle} not found on GitHub`);- if (gh.status === 403) return error(res, 429, 'github_rate_limited', 'GitHub rate limit — try again shortly');+ const gh = await fetch(`https://api.github.com/users/${encodeURIComponent(handle)}`, {+ headers,+ });+ if (gh.status === 404)+ return error(res, 404, 'github_user_not_found', `@${handle} not found on GitHub`);+ if (gh.status === 403)+ return error(res, 429, 'github_rate_limited', 'GitHub rate limit — try again shortly');if (!gh.ok) return error(res, 502, 'github_error', `github responded ${gh.status}`);const j = await gh.json();if (!j?.id) return error(res, 502, 'github_error', 'github id missing');return json(res, 200, {ok: true,login: j.login,- id: String(j.id), // social-fee user_id (≤20 chars, fits u64)+ id: String(j.id), // social-fee user_id (≤20 chars, fits u64)name: j.name || null,avatar_url: j.avatar_url || null,html_url: j.html_url || `https://github.com/${j.login}`,@@ -4026,7 +4706,9 @@ async function readSocialClaimAuthority(connection) {if (!info?.data || info.data.length < 8 + 1 + 32 + 1 + 32) return null;const off = 8 + 1 + 32 + 1;return new PublicKey(info.data.subarray(off, off + 32)).toBase58();- } catch { return null; }+ } catch {+ return null;+ }}// ── social-fee-claim-status ────────────────────────────────────────────────@@ -4048,8 +4730,10 @@ async function handleSocialFeeClaimStatus(req, res) {const userId = (url.searchParams.get('user_id') || '').trim();const platform = Number(url.searchParams.get('platform') ?? '2'); // 0=pump 1=X 2=GitHubconst network = url.searchParams.get('network') === 'devnet' ? 'devnet' : 'mainnet';- if (!/^\d{1,20}$/.test(userId)) return error(res, 400, 'validation_error', 'numeric user_id required');- if (![0, 1, 2].includes(platform)) return error(res, 400, 'validation_error', 'platform must be 0,1,2');+ if (!/^\d{1,20}$/.test(userId))+ return error(res, 400, 'validation_error', 'numeric user_id required');+ if (![0, 1, 2].includes(platform))+ return error(res, 400, 'validation_error', 'platform must be 0,1,2');try {const connection = getConnection({ network });@@ -4070,7 +4754,9 @@ async function handleSocialFeeClaimStatus(req, res) {total_claimed_lamports: d.totalClaimed?.toString?.() ?? '0',last_claimed: d.lastClaimed?.toString?.() ?? '0',};- } catch { /* layout drift — still return the balance */ }+ } catch {+ /* layout drift — still return the balance */+ }}const social_claim_authority = await readSocialClaimAuthority(connection);@@ -4089,8 +4775,15 @@ async function handleSocialFeeClaimStatus(req, res) {claim_url: 'https://pump.fun/profile',});} catch (e) {- return error(res, e.status || 502, e.code || 'pump_sdk_error', e.message || 'failed to read social fee status');+ return error(+ res,+ e.status || 502,+ e.code || 'pump_sdk_error',+ e.message || 'failed to read social fee status',+ );}}-function _sse(res, event, data) { res.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`); }+function _sse(res, event, data) {+ res.write(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);+}diff --git a/api/pump/autopilot.js b/api/pump/autopilot.jsindex 1dff104d2..564beff67 100644--- a/api/pump/autopilot.js+++ b/api/pump/autopilot.js@@ -13,8 +13,9 @@* caller owns (pump_agent_mints.user_id).*/-import { cors, json, method, readJson, wrap, error } from '../_lib/http.js';+import { cors, json, method, readJson, wrap, error, rateLimited } from '../_lib/http.js';import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.js';+import { limits, clientIp } from '../_lib/rate-limit.js';import { sql } from '../_lib/db.js';import { z } from 'zod';@@ -58,6 +59,9 @@ export default wrap(async (req, res) => {const userId = await resolveUserId(req);if (!userId) return error(res, 401, 'unauthorized', 'sign in to manage autopilot');+ const rl = await limits.authIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);+if (req.method === 'POST') return upsertPolicy(req, res, userId);return listCoins(req, res, userId);});@@ -134,7 +138,8 @@ async function listCoins(req, res, userId) {mint_id: d.mint_id,kind: 'distribute',status: d.status,- amount_atomics: d.balances_before?.payment != null ? String(d.balances_before.payment) : null,+ amount_atomics:+ d.balances_before?.payment != null ? String(d.balances_before.payment) : null,tx_signature: d.tx_signature || null,error: d.error || null,at: d.created_at,diff --git a/api/pump/curve.js b/api/pump/curve.jsindex 748677d27..3e5d90e7f 100644--- a/api/pump/curve.js+++ b/api/pump/curve.js@@ -10,16 +10,20 @@// seconds of staleness is acceptable and keeps RPC cost down on hot mints.import { cors, json, method, wrap, error } from '../_lib/http.js';-import { rpcFallbackFromEnv, getBondingCurveState, getTokenPrice, getGraduationProgress } from '../_lib/solana/index.js';+import {+ rpcFallbackFromEnv,+ getBondingCurveState,+ getTokenPrice,+ getGraduationProgress,+} from '../_lib/solana/index.js';// Mints that can never carry a pump.fun bonding curve. These are coin-agnostic-// settlement / native tokens, listed only so we can *exclude* them from curve-// lookups — never to promote them. (USDC mainnet+devnet, wrapped SOL, USDT.)+// payment-rail / native tokens, listed only so we can *exclude* them from curve+// lookups — never to promote them. (USDC mainnet+devnet, wrapped SOL.)const NON_CURVE_MINTS = new Set(['EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', // USDC (mainnet)'4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU', // USDC (devnet)- 'So11111111111111111111111111111111111111112', // wrapped SOL- 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', // USDT+ 'So11111111111111111111111111111111111111112', // wrapped SOL]);// Every pump.fun mint keypair is ground to end in the literal suffix "pump". A@@ -104,21 +108,31 @@ export default wrap(async (req, res) => {graduatedPrice = await jupiterPriceFallback(mint);}- return json(res, 200, {- mint,- network,- curve: result.curve,- price: pricePayload,- graduation: result.graduation ? serializeBNs(result.graduation) : null,- ...(graduatedPrice ? { graduatedPrice } : {}),- }, { 'cache-control': 'public, max-age=5, s-maxage=10, stale-while-revalidate=30' });+ return json(+ res,+ 200,+ {+ mint,+ network,+ curve: result.curve,+ price: pricePayload,+ graduation: result.graduation ? serializeBNs(result.graduation) : null,+ ...(graduatedPrice ? { graduatedPrice } : {}),+ },+ { 'cache-control': 'public, max-age=5, s-maxage=10, stale-while-revalidate=30' },+ );});function serializeBNs(obj) {if (obj == null || typeof obj !== 'object') return obj;const out = Array.isArray(obj) ? [] : {};for (const [k, v] of Object.entries(obj)) {- if (v && typeof v === 'object' && typeof v.toString === 'function' && (v.constructor?.name === 'BN' || typeof v.toNumber === 'function')) {+ if (+ v &&+ typeof v === 'object' &&+ typeof v.toString === 'function' &&+ (v.constructor?.name === 'BN' || typeof v.toNumber === 'function')+ ) {out[k] = v.toString();} else if (v && typeof v === 'object') {out[k] = serializeBNs(v);diff --git a/api/pump/dashboard.js b/api/pump/dashboard.jsindex 412c78177..a4c10f2ba 100644--- a/api/pump/dashboard.js+++ b/api/pump/dashboard.js@@ -36,20 +36,21 @@ async function fetchWithCache(url, options, ttlMs = 60_000) {export default wrap(async (req, res) => {const user = await getSessionUser(req);- if (!user) return error(res, 401, 'unauthorized');+ if (!user) return error(res, 401, 'unauthorized', 'authentication required');const agentId = new URL(req.url, 'http://x').searchParams.get('agent_id');- if (!agentId) return error(res, 400, 'missing agent_id');+ if (!agentId) return error(res, 400, 'missing_agent_id', 'agent_id is required');const [agent] = await sql`SELECT meta FROM agent_identitiesWHERE id = ${agentId} AND user_id = ${user.id} AND deleted_at IS NULL`;- if (!agent) return error(res, 404, 'agent not found');+ if (!agent) return error(res, 404, 'not_found', 'agent not found');const tokenMint = agent.meta?.token?.mint;- if (!tokenMint) return error(res, 404, 'token not launched for this agent');+ if (!tokenMint)+ return error(res, 404, 'token_not_launched', 'token not launched for this agent');if (!BIRDEYE_API_KEY) {return error(res, 503, 'not_configured', 'On-chain data provider is not configured');@@ -59,15 +60,18 @@ export default wrap(async (req, res) => {try {const [price, history] = await Promise.all([- fetchWithCache(`https://public-api.birdeye.so/defi/price?address=${tokenMint}`, { headers }),- fetchWithCache(`https://public-api.birdeye.so/defi/txs/latest?address=${tokenMint}`, { headers })+ fetchWithCache(`https://public-api.birdeye.so/defi/price?address=${tokenMint}`, {+ headers,+ }),+ fetchWithCache(`https://public-api.birdeye.so/defi/txs/latest?address=${tokenMint}`, {+ headers,+ }),]);return json(res, 200, {price: price.data,history: history?.data?.items ?? [],});-} catch (e) {console.error(`[pump-dashboard] Error fetching token data for ${tokenMint}:`, e);return error(res, 502, 'bad_gateway', 'Failed to fetch on-chain data');diff --git a/api/pump/trades-stream.js b/api/pump/trades-stream.jsindex 3afc8e1e7..45e902c82 100644--- a/api/pump/trades-stream.js+++ b/api/pump/trades-stream.js@@ -8,7 +8,8 @@// so a `mint` is required to receive trade events; without one we degrade to the// public mint/graduation feed rather than emitting an empty stream.-import { cors, method } from '../_lib/http.js';+import { cors, method, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';import { connectPumpFunFeed } from '../_lib/pumpfun-ws-feed.js';const MAX_DURATION_MS = 90_000;@@ -19,6 +20,11 @@ export default async function handleTradesStream(req, res) {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;if (!method(req, res, ['GET'])) return;+ // Each client connection opens an upstream PumpPortal WS — same bucket as+ // the [action].js live-stream path so one IP can't fan out connections.+ const rl = await limits.mcpIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);+const url = new URL(req.url, `http://${req.headers.host || 'x'}`);const mints = (url.searchParams.get('mint') || '').split(',')@@ -60,7 +66,9 @@ export default async function handleTradesStream(req, res) {clearTimeout(durationTimer);abort.abort();stop();- try { res.end(); } catch {}+ try {+ res.end();+ } catch {}};const durationTimer = setTimeout(() => {diff --git a/api/seed/farcaster.js b/api/seed/farcaster.jsindex 269ef1ea6..1c1e257d2 100644--- a/api/seed/farcaster.js+++ b/api/seed/farcaster.js@@ -9,7 +9,8 @@// state cleanly.import { NeynarAPIClient, Configuration } from '@neynar/nodejs-sdk';-import { cors, json, method, wrap, error } from '../_lib/http.js';+import { cors, json, method, wrap, error, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';let _client = null;function client() {@@ -24,6 +25,9 @@ export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;if (!method(req, res, ['GET'])) return;+ const rl = await limits.publicIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);+const url = new URL(req.url, 'http://x');const raw = (url.searchParams.get('handle') || '').trim().replace(/^@/, '');if (!raw) return error(res, 400, 'invalid_request', 'handle query param required');diff --git a/api/seed/github.js b/api/seed/github.jsindex a48cf2acc..b2b0ce25b 100644--- a/api/seed/github.js+++ b/api/seed/github.js@@ -10,7 +10,8 @@// works against unauthenticated GitHub in development.import { Octokit } from '@octokit/rest';-import { cors, json, method, wrap, error } from '../_lib/http.js';+import { cors, json, method, wrap, error, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';const HANDLE_RE = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/;@@ -26,6 +27,9 @@ export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;if (!method(req, res, ['GET'])) return;+ const rl = await limits.publicIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);+const url = new URL(req.url, 'http://x');const handle = (url.searchParams.get('handle') || '').trim();if (!handle) return error(res, 400, 'invalid_request', 'handle query param required');diff --git a/api/seed/x.js b/api/seed/x.jsindex 9c6cf503f..7e818bd40 100644--- a/api/seed/x.js+++ b/api/seed/x.js@@ -9,25 +9,170 @@// render a graceful "connector not configured" state instead of erroring.import { TwitterApi } from 'twitter-api-v2';-import { cors, json, method, wrap, error } from '../_lib/http.js';+import { cors, json, method, wrap, error, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';const HANDLE_RE = /^[A-Za-z0-9_]{1,15}$/;// Compact English stopword list — pure JS so we don't pull in an NLP dep.const STOPWORDS = new Set([- 'the','a','an','and','or','but','if','then','else','of','to','in','on','for',- 'with','at','by','from','up','down','is','am','are','was','were','be','been',- 'being','have','has','had','having','do','does','did','doing','this','that',- 'these','those','i','you','he','she','it','we','they','my','your','his','her',- 'its','our','their','me','him','us','them','myself','yourself','as','about',- 'into','like','through','after','before','between','out','off','over','under',- 'just','only','own','same','so','than','too','very','can','will','would','should',- 'could','may','might','must','here','there','when','where','why','how','all','any',- 'both','each','few','more','most','other','some','such','no','not','nor','one','two',- 'rt','via','amp','http','https','com','www','also','still','really','get','got','go',- 'going','went','let','lets','make','made','use','using','used','new','old','today',- 'tomorrow','yesterday','now','day','days','time','week','year','years','people','thing',- 'things','way','ways','good','great','best','better','well','vs','etc','ok','okay',+ 'the',+ 'a',+ 'an',+ 'and',+ 'or',+ 'but',+ 'if',+ 'then',+ 'else',+ 'of',+ 'to',+ 'in',+ 'on',+ 'for',+ 'with',+ 'at',+ 'by',+ 'from',+ 'up',+ 'down',+ 'is',+ 'am',+ 'are',+ 'was',+ 'were',+ 'be',+ 'been',+ 'being',+ 'have',+ 'has',+ 'had',+ 'having',+ 'do',+ 'does',+ 'did',+ 'doing',+ 'this',+ 'that',+ 'these',+ 'those',+ 'i',+ 'you',+ 'he',+ 'she',+ 'it',+ 'we',+ 'they',+ 'my',+ 'your',+ 'his',+ 'her',+ 'its',+ 'our',+ 'their',+ 'me',+ 'him',+ 'us',+ 'them',+ 'myself',+ 'yourself',+ 'as',+ 'about',+ 'into',+ 'like',+ 'through',+ 'after',+ 'before',+ 'between',+ 'out',+ 'off',+ 'over',+ 'under',+ 'just',+ 'only',+ 'own',+ 'same',+ 'so',+ 'than',+ 'too',+ 'very',+ 'can',+ 'will',+ 'would',+ 'should',+ 'could',+ 'may',+ 'might',+ 'must',+ 'here',+ 'there',+ 'when',+ 'where',+ 'why',+ 'how',+ 'all',+ 'any',+ 'both',+ 'each',+ 'few',+ 'more',+ 'most',+ 'other',+ 'some',+ 'such',+ 'no',+ 'not',+ 'nor',+ 'one',+ 'two',+ 'rt',+ 'via',+ 'amp',+ 'http',+ 'https',+ 'com',+ 'www',+ 'also',+ 'still',+ 'really',+ 'get',+ 'got',+ 'go',+ 'going',+ 'went',+ 'let',+ 'lets',+ 'make',+ 'made',+ 'use',+ 'using',+ 'used',+ 'new',+ 'old',+ 'today',+ 'tomorrow',+ 'yesterday',+ 'now',+ 'day',+ 'days',+ 'time',+ 'week',+ 'year',+ 'years',+ 'people',+ 'thing',+ 'things',+ 'way',+ 'ways',+ 'good',+ 'great',+ 'best',+ 'better',+ 'well',+ 'vs',+ 'etc',+ 'ok',+ 'okay',]);function extractTopTopics(tweets, limit = 8) {@@ -58,6 +203,9 @@ export default wrap(async (req, res) => {if (cors(req, res, { methods: 'GET,OPTIONS' })) return;if (!method(req, res, ['GET'])) return;+ const rl = await limits.publicIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);+const url = new URL(req.url, 'http://x');let handle = (url.searchParams.get('handle') || '').trim().replace(/^@/, '');if (!handle) return error(res, 400, 'invalid_request', 'handle query param required');@@ -79,12 +227,20 @@ export default wrap(async (req, res) => {let userData;try {userData = await client.v2.userByUsername(handle, {- 'user.fields': ['description', 'profile_image_url', 'public_metrics', 'location', 'created_at', 'verified'],+ 'user.fields': [+ 'description',+ 'profile_image_url',+ 'public_metrics',+ 'location',+ 'created_at',+ 'verified',+ ],});} catch (err) {// Rate-limited or upstream issue. Surface gracefully so the demo can show the X card greyed out.const status = err?.code || err?.data?.status || 502;- const msg = err?.data?.detail || err?.data?.title || err.message || 'X profile fetch failed';+ const msg =+ err?.data?.detail || err?.data?.title || err.message || 'X profile fetch failed';if (status === 404 || /not.?found/i.test(msg))return error(res, 404, 'not_found', `no X user named "@${handle}"`);res.setHeader('cache-control', 'no-store');diff --git a/api/studio-assets/[...path].js b/api/studio-assets/[...path].jsindex 842a7dfdd..c565b0c24 100644--- a/api/studio-assets/[...path].js+++ b/api/studio-assets/[...path].js@@ -23,13 +23,7 @@ const TEXT_TYPES = new Set([// Whitelist of upstream prefixes we're willing to mirror. Anything else gets// a 404 — prevents this endpoint from being abused as an open proxy.-const ALLOWED_PREFIXES = [- 'anata/',- '0N1/',- 'tubbycats/',- 'animations/',- 'loot/',-];+const ALLOWED_PREFIXES = ['anata/', '0N1/', 'tubbycats/', 'animations/', 'loot/'];function isAllowed(path) {return ALLOWED_PREFIXES.some((p) => path === p.slice(0, -1) || path.startsWith(p));@@ -55,9 +49,23 @@ export default wrap(async (req, res) => {}const rawPath = joinPath(req.query?.path);- const path = decodeURIComponent(rawPath).replace(/^\/+/, '');+ // Loop-decode until stable (capped) so double-encoded traversal sequences+ // (%252e%252e → %2e%2e → ..) can't slip past a single-decode '..' check.+ let path = rawPath;+ for (let i = 0; i < 3; i++) {+ let decoded;+ try {+ decoded = decodeURIComponent(path);+ } catch {+ return error(res, 404, 'not_found', 'asset not in studio mirror whitelist');+ }+ if (decoded === path) break;+ path = decoded;+ }+ path = path.replace(/^\/+/, '');- if (!path || path.includes('..') || !isAllowed(path)) {+ // Anything still percent-encoded after 3 decode passes is hostile noise.+ if (!path || path.includes('%') || path.includes('..') || !isAllowed(path)) {return error(res, 404, 'not_found', 'asset not in studio mirror whitelist');}@@ -78,7 +86,10 @@ export default wrap(async (req, res) => {const isText = TEXT_TYPES.has(baseType);res.setHeader('content-type', contentType);- res.setHeader('cache-control', 'public, max-age=604800, s-maxage=86400, stale-while-revalidate=86400');+ res.setHeader(+ 'cache-control',+ 'public, max-age=604800, s-maxage=86400, stale-while-revalidate=86400',+ );res.setHeader('access-control-allow-origin', '*');if (req.method === 'HEAD') {diff --git a/api/subscriptions/index.js b/api/subscriptions/index.jsindex abc8c1bc9..707b6ac34 100644--- a/api/subscriptions/index.js+++ b/api/subscriptions/index.js@@ -14,6 +14,7 @@ import { getSessionUser } from '../_lib/auth.js';import { cors, json, method, wrap, error, readJson, rateLimited } from '../_lib/http.js';import { parse } from '../_lib/validate.js';import { limits, clientIp } from '../_lib/rate-limit.js';+import { requireCsrf } from '../_lib/csrf.js';import { chargeSubscription } from '../_lib/subscription-billing.js';const subscribeSchema = z.object({@@ -64,6 +65,10 @@ async function handleSubscribe(req, res) {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt+ // (the token itself proves intent and isn't auto-attached by browsers).+ if (!(await requireCsrf(req, res, user.id))) return;+const ip = clientIp(req);const rl = await limits.publicIp(ip);if (!rl.success) return rateLimited(res, rl);@@ -76,7 +81,8 @@ async function handleSubscribe(req, res) {`;if (!plan) return error(res, 404, 'not_found', 'plan not found');if (!plan.active) return error(res, 409, 'conflict', 'plan is no longer active');- if (plan.creator_id === user.id) return error(res, 409, 'conflict', 'cannot subscribe to your own plan');+ if (plan.creator_id === user.id)+ return error(res, 409, 'conflict', 'cannot subscribe to your own plan');const periodMs = plan.interval === 'weekly' ? 7 * 24 * 3600 * 1000 : 30 * 24 * 3600 * 1000;const periodEnd = new Date(Date.now() + periodMs).toISOString();@@ -123,6 +129,9 @@ async function handleCancel(req, res, subId) {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt.+ if (!(await requireCsrf(req, res, user.id))) return;+const [sub] = await sql`UPDATE creator_subscriptionsSET status = 'cancelled', cancelled_at = now()diff --git a/api/subscriptions/plans.js b/api/subscriptions/plans.jsindex 5347ab29e..c18d58380 100644--- a/api/subscriptions/plans.js+++ b/api/subscriptions/plans.js@@ -14,6 +14,7 @@ import { getSessionUser } from '../_lib/auth.js';import { cors, json, method, wrap, error, readJson, rateLimited } from '../_lib/http.js';import { parse } from '../_lib/validate.js';import { limits, clientIp } from '../_lib/rate-limit.js';+import { requireCsrf } from '../_lib/csrf.js';const planSchema = z.object({agent_id: z.string().uuid().optional(),@@ -93,6 +94,10 @@ async function handleCreate(req, res) {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt+ // (the token itself proves intent and isn't auto-attached by browsers).+ if (!(await requireCsrf(req, res, user.id))) return;+const ip = clientIp(req);const rl = await limits.publicIp(ip);if (!rl.success) return rateLimited(res, rl);@@ -129,6 +134,9 @@ async function handlePatch(req, res, planId) {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt.+ if (!(await requireCsrf(req, res, user.id))) return;+const body = parse(patchSchema, await readJson(req));const [existing] = await sql`@@ -179,6 +187,9 @@ async function handleDelete(req, res, planId) {const user = await getSessionUser(req);if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ // CSRF on state-changing session-cookie requests; bearer tokens are exempt.+ if (!(await requireCsrf(req, res, user.id))) return;+const [plan] = await sql`UPDATE subscription_plansSET active = falsediff --git a/api/widgets/_demo-fixtures.js b/api/widgets/_demo-fixtures.jsindex bee9f21ac..875166d3b 100644--- a/api/widgets/_demo-fixtures.js+++ b/api/widgets/_demo-fixtures.js@@ -127,7 +127,7 @@ export const DEMO_WIDGETS = {id: 'head',label: 'Head',position: [0, 0.75, 0.1],- body: 'The agent\'s head — face mesh, eyes, and the empathy layer that drives six real-time emotion states.',+ body: "The agent's head — face mesh, eyes, and the empathy layer that drives six real-time emotion states.",},{id: 'chest',@@ -139,7 +139,7 @@ export const DEMO_WIDGETS = {id: 'hand',label: 'Hand',position: [-0.35, -0.15, 0.1],- body: 'Right hand — drives wave, point, and reach gestures triggered by the agent\'s skill layer (wave, lookAt, playClip).',+ body: "Right hand — drives wave, point, and reach gestures triggered by the agent's skill layer (wave, lookAt, playClip).",},],},@@ -194,7 +194,7 @@ export const DEMO_WIDGETS = {showControls: false,autoRotate: false,envPreset: 'neutral',- mint: 'So11111111111111111111111111111111111111112',+ mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump',chain: 'solana',bg: '#0d0d14',minUsd: 0,diff --git a/api/wk.js b/api/wk.jsindex 308201f1b..72ba4091a 100644--- a/api/wk.js+++ b/api/wk.js@@ -494,32 +494,36 @@ async function handleX402Discovery(req, res) {const ARB_USDC = env.X402_ASSET_ADDRESS_ARBITRUM;function buildBazaarAccepts(resourceUrl) {const out = [];- pushAcceptWithPermit2Sibling(out, {- scheme: 'exact',- network: NETWORK_BASE_MAINNET,- network_label: 'base-mainnet',- amount: env.X402_MAX_AMOUNT_REQUIRED,- price,- payTo: env.X402_PAY_TO_BASE,- asset: env.X402_ASSET_ADDRESS_BASE,- asset_symbol: 'USDC',- maxTimeoutSeconds: 60,- resource: resourceUrl,- extra: { name: 'USDC', version: '2', decimals: 6 },- });- pushAcceptWithPermit2Sibling(out, {- scheme: 'exact',- network: 'eip155:42161',- network_label: 'arbitrum-one',- amount: env.X402_MAX_AMOUNT_REQUIRED,- price,- payTo: env.X402_PAY_TO_BASE,- asset: ARB_USDC,- asset_symbol: 'USDC',- maxTimeoutSeconds: 60,- resource: resourceUrl,- extra: { name: 'USDC', version: '2', decimals: 6 },- });+ if (env.X402_PAY_TO_BASE) {+ pushAcceptWithPermit2Sibling(out, {+ scheme: 'exact',+ network: NETWORK_BASE_MAINNET,+ network_label: 'base-mainnet',+ amount: env.X402_MAX_AMOUNT_REQUIRED,+ price,+ payTo: env.X402_PAY_TO_BASE,+ asset: env.X402_ASSET_ADDRESS_BASE,+ asset_symbol: 'USDC',+ maxTimeoutSeconds: 60,+ resource: resourceUrl,+ extra: { name: 'USDC', version: '2', decimals: 6 },+ });+ }+ if (env.X402_PAY_TO_BASE && ARB_USDC) {+ pushAcceptWithPermit2Sibling(out, {+ scheme: 'exact',+ network: 'eip155:42161',+ network_label: 'arbitrum-one',+ amount: env.X402_MAX_AMOUNT_REQUIRED,+ price,+ payTo: env.X402_PAY_TO_BASE,+ asset: ARB_USDC,+ asset_symbol: 'USDC',+ maxTimeoutSeconds: 60,+ resource: resourceUrl,+ extra: { name: 'USDC', version: '2', decimals: 6 },+ });+ }if (env.X402_PAY_TO_SOLANA) {out.push({scheme: 'exact',@@ -944,7 +948,11 @@ async function handleX402Discovery(req, res) {extensions: extensionsForAccepts(accepts, {method: 'POST',discoverable: true,- input: { prompt: 'a brass steampunk owl, full body', tier: 'standard', aspect_ratio: '1:1' },+ input: {+ prompt: 'a brass steampunk owl, full body',+ tier: 'standard',+ aspect_ratio: '1:1',+ },inputSchema: {type: 'object',properties: {@@ -952,17 +960,22 @@ async function handleX402Discovery(req, res) {type: 'string',minLength: 3,maxLength: 1000,- description: 'Describe one subject for text→3D. Omit when supplying image_urls.',+ description:+ 'Describe one subject for text→3D. Omit when supplying image_urls.',},image_urls: {type: 'array',items: { type: 'string', format: 'uri' },minItems: 1,maxItems: 4,- description: 'Up to four public https reference views of one object for image→3D.',+ description:+ 'Up to four public https reference views of one object for image→3D.',},tier: { type: 'string', enum: ['draft', 'standard', 'high'] },- aspect_ratio: { type: 'string', enum: ['1:1', '4:3', '3:4', '16:9', '9:16'] },+ aspect_ratio: {+ type: 'string',+ enum: ['1:1', '4:3', '3:4', '16:9', '9:16'],+ },},},}),diff --git a/api/x402-checkout.js b/api/x402-checkout.jsindex 02c0e838c..0908731bd 100644--- a/api/x402-checkout.js+++ b/api/x402-checkout.js@@ -40,10 +40,7 @@ import {import { cors, json, method, readJson, wrap, error, rateLimited } from './_lib/http.js';import { parse } from './_lib/validate.js';import { limits, clientIp } from './_lib/rate-limit.js';-import {- NETWORK_SOLANA_MAINNET,- NETWORK_SOLANA_DEVNET,-} from './_lib/x402-spec.js';+import { NETWORK_SOLANA_MAINNET, NETWORK_SOLANA_DEVNET } from './_lib/x402-spec.js';const SOLANA_RPC = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';const SOLANA_DEVNET_RPC = process.env.SOLANA_RPC_URL_DEVNET || 'https://api.devnet.solana.com';@@ -98,8 +95,14 @@ const prepareSchema = z.object({const builderCodeBlockSchema = z.object({a: z.string().regex(/^[a-z0-9_]{1,32}$/),- w: z.string().regex(/^[a-z0-9_]{1,32}$/).optional(),- s: z.array(z.string().regex(/^[a-z0-9_]{1,32}$/)).max(32).optional(),+ w: z+ .string()+ .regex(/^[a-z0-9_]{1,32}$/)+ .optional(),+ s: z+ .array(z.string().regex(/^[a-z0-9_]{1,32}$/))+ .max(32)+ .optional(),}).optional();@@ -224,6 +227,10 @@ async function handlePrepare(req, res) {}async function handleEncode(req, res) {+ // Per-IP rate limit — same anonymous, cross-origin surface as prepare.+ const rl = await limits.x402PayIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl, 'too many encode requests');+const body = parse(encodeSchema, await readJson(req));const { accept, signed_tx_base64, resource_url, builder_code } = body;const payload = {diff --git a/api/x402-skus.js b/api/x402-skus.jsindex 742e5074e..aa8eb210c 100644--- a/api/x402-skus.js+++ b/api/x402-skus.js@@ -39,7 +39,10 @@ const createSchema = z.object({action_name: z.string().trim().min(1).max(80),description: z.string().trim().max(2000).optional(),logo_url: httpsUrl.optional(),- accent_color: z.string().regex(/^#[0-9a-fA-F]{6}$/).default('#0a84ff'),+ accent_color: z+ .string()+ .regex(/^#[0-9a-fA-F]{6}$/)+ .default('#0a84ff'),success_url: httpsUrl.optional(),});@@ -185,6 +188,9 @@ async function handleUpdate(req, res) {async function handleArchive(req, res) {const user = await getSessionUser(req, res);if (!user) return error(res, 401, 'unauthorized', 'sign in required');+ const rl = await limits.authIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);+const id = req.query?.id;if (!id) return error(res, 400, 'missing_id', 'query param `id` required');diff --git a/api/x402/forge.js b/api/x402/forge.jsindex 90305f61b..93ecd5690 100644--- a/api/x402/forge.js+++ b/api/x402/forge.js@@ -82,7 +82,11 @@ const ROUTE_DESCRIPTION ='($0.05 draft / $0.15 standard / $0.50 high). Pay autonomously on Base or ' +'Solana mainnet — no API key, no account.';-const INPUT_EXAMPLE = { prompt: 'a brass steampunk owl, full body', tier: 'standard', aspect_ratio: '1:1' };+const INPUT_EXAMPLE = {+ prompt: 'a brass steampunk owl, full body',+ tier: 'standard',+ aspect_ratio: '1:1',+};const INPUT_SCHEMA = {$schema: 'https://json-schema.org/draft/2020-12/schema',@@ -305,8 +309,14 @@ export default wrap(async (req, res) => {// Internal / subscription / OAuth callers bypass payment.const acResult = await accessControl(req, routeConfig);if (acResult?.abort) {- if (acResult.headers) for (const [k, v] of Object.entries(acResult.headers)) res.setHeader(k, v);- return error(res, acResult.status || 403, acResult.code || 'access_denied', acResult.reason || 'access denied');+ if (acResult.headers)+ for (const [k, v] of Object.entries(acResult.headers)) res.setHeader(k, v);+ return error(+ res,+ acResult.status || 403,+ acResult.code || 'access_denied',+ acResult.reason || 'access denied',+ );}if (acResult?.grantAccess) {let result;@@ -315,7 +325,8 @@ export default wrap(async (req, res) => {} catch (err) {return error(res, err.status || 500, err.code || 'internal_error', err.message);}- if (acResult.headers) for (const [k, v] of Object.entries(acResult.headers)) res.setHeader(k, v);+ if (acResult.headers)+ for (const [k, v] of Object.entries(acResult.headers)) res.setHeader(k, v);res.setHeader('x-payment-bypass', acResult.reason || 'granted');res.setHeader('cache-control', 'no-store');res.setHeader('content-type', 'application/json; charset=utf-8');@@ -333,9 +344,14 @@ export default wrap(async (req, res) => {// Idempotency: a retried payment (same id, same body) returns the SAME job// token instead of submitting a second generation and double-charging.- const paymentId = extractIdFromHeader(paymentHeader);+ const clientPaymentId = extractIdFromHeader(paymentHeader);const payloadHash = hashRequestPayload({ method: 'POST', url: ROUTE, body: rawBody });const paymentHash = hashPaymentProof(paymentHeader);+ // Always-on replay guard: the payment-identifier extension is client-opt-in,+ // so when the client omits it we fall back to the proof hash itself as the+ // dedup key (reproducible only by the original payer), making replay+ // protection unconditional. Same idiom as api/_lib/x402-paid-endpoint.js.+ const paymentId = clientPaymentId || (paymentHash ? `proof:${paymentHash}` : null);if (paymentId) {const lookup = await checkCache({ route: ROUTE, paymentId, payloadHash, paymentHash });if (lookup.kind === 'hit') return writeCachedResponse(res, lookup.entry);@@ -405,18 +421,25 @@ async function parseRequestFromObject(body) {let imageUrls = [];if (Array.isArray(body.image_urls)) imageUrls = body.image_urls;else if (typeof body.image_url === 'string') imageUrls = [body.image_url];- const rawImageCount = Array.isArray(body.image_urls) ? body.image_urls.length : imageUrls.length;- imageUrls = imageUrls.filter((u) => typeof u === 'string' && HTTP_URL_RE.test(u)).slice(0, MAX_VIEWS);+ const rawImageCount = Array.isArray(body.image_urls)+ ? body.image_urls.length+ : imageUrls.length;+ imageUrls = imageUrls+ .filter((u) => typeof u === 'string' && HTTP_URL_RE.test(u))+ .slice(0, MAX_VIEWS);const isImageMode = imageUrls.length > 0;const prompt = typeof body.prompt === 'string' ? body.prompt.trim() : '';const isProbe = !prompt && !isImageMode;if (!isImageMode && !isProbe && (prompt.length < 3 || prompt.length > 1000)) {- throw Object.assign(new Error('Describe one subject in 3–1000 characters, or pass image_urls.'), {- status: 400,- code: 'invalid_prompt',- });+ throw Object.assign(+ new Error('Describe one subject in 3–1000 characters, or pass image_urls.'),+ {+ status: 400,+ code: 'invalid_prompt',+ },+ );}if (rawImageCount > 0 && imageUrls.length === 0) {throw Object.assign(new Error('image_urls must be public https URLs.'), {diff --git a/api/x402/mint-to-mesh.js b/api/x402/mint-to-mesh.jsindex fe04efb7d..f8362531a 100644--- a/api/x402/mint-to-mesh.js+++ b/api/x402/mint-to-mesh.js@@ -48,7 +48,11 @@ import { withService } from '../_lib/x402/bazaar-helpers.js';const REQUIRED_SCOPE = 'x402:bypass';const accessControl = installAccessControl({ requiredScope: REQUIRED_SCOPE });-const routeConfig = { path: '/api/x402/mint-to-mesh', method: 'GET', requiredScope: REQUIRED_SCOPE };+const routeConfig = {+ path: '/api/x402/mint-to-mesh',+ method: 'GET',+ requiredScope: REQUIRED_SCOPE,+};const ROUTE = '/api/x402/mint-to-mesh';@@ -271,7 +275,12 @@ export default wrap(async (req, res) => {const mint = String(req.query?.mint || '').trim();if (!mint) return error(res, 400, 'missing_mint', 'query param "mint" is required');if (!BASE58_RE.test(mint))- return error(res, 400, 'invalid_mint', 'mint must be a base58 SPL address (32–44 chars)');+ return error(+ res,+ 400,+ 'invalid_mint',+ 'mint must be a base58 SPL address (32–44 chars)',+ );let result;try {result = await buildMesh(mint);@@ -292,13 +301,18 @@ export default wrap(async (req, res) => {if (!paymentHeader) return send402(res, challenge);// USE-15: idempotency cache lookup before paying for /verify.- const paymentId = extractIdFromHeader(paymentHeader);+ const clientPaymentId = extractIdFromHeader(paymentHeader);const payloadHash = hashRequestPayload({method: req.method,url: req.url,body: null,});const paymentHash = hashPaymentProof(paymentHeader);+ // Always-on replay guard: the payment-identifier extension is client-opt-in,+ // so when the client omits it we fall back to the proof hash itself as the+ // dedup key (reproducible only by the original payer), making replay+ // protection unconditional. Same idiom as api/_lib/x402-paid-endpoint.js.+ const paymentId = clientPaymentId || (paymentHash ? `proof:${paymentHash}` : null);if (paymentId) {const lookup = await checkCache({ route: ROUTE, paymentId, payloadHash, paymentHash });if (lookup.kind === 'hit') return writeCachedResponse(res, lookup.entry);diff --git a/api/x402/model-check.js b/api/x402/model-check.jsindex 64e2265fb..a803043c3 100644--- a/api/x402/model-check.js+++ b/api/x402/model-check.js@@ -332,13 +332,18 @@ export default wrap(async (req, res) => {if (!paymentHeader) return send402(res, challenge);// USE-15: idempotency cache lookup before paying for /verify.- const paymentId = extractIdFromHeader(paymentHeader);+ const clientPaymentId = extractIdFromHeader(paymentHeader);const payloadHash = hashRequestPayload({method: req.method,url: req.url,body: null,});const paymentHash = hashPaymentProof(paymentHeader);+ // Always-on replay guard: the payment-identifier extension is client-opt-in,+ // so when the client omits it we fall back to the proof hash itself as the+ // dedup key (reproducible only by the original payer), making replay+ // protection unconditional. Same idiom as api/_lib/x402-paid-endpoint.js.+ const paymentId = clientPaymentId || (paymentHash ? `proof:${paymentHash}` : null);if (paymentId) {const lookup = await checkCache({ route: ROUTE, paymentId, payloadHash, paymentHash });if (lookup.kind === 'hit') return writeCachedResponse(res, lookup.entry);diff --git a/api/x402/vanity.js b/api/x402/vanity.jsindex 2fa86ccad..9f5f41784 100644--- a/api/x402/vanity.js+++ b/api/x402/vanity.js@@ -108,34 +108,38 @@ const DISCOVERY_INPUT_SCHEMA = {},suffix: {type: 'string',- description: 'Base58 characters the address must end with. Combined with prefix, max 3 characters.',+ description:+ 'Base58 characters the address must end with. Combined with prefix, max 3 characters.',},ignoreCase: {type: 'string',enum: ['0', '1', 'true', 'false'],- description: 'When 1/true, match the pattern case-insensitively (faster, less specific).',+ description:+ 'When 1/true, match the pattern case-insensitively (faster, less specific).',},},};+// SECURITY: this is a discovery-schema EXAMPLE only — it documents the response+// shape, it is NOT a real key. The secretKey/secretKeyBase58 below are synthetic+// placeholders (all-zero bytes), never a funded keypair. The live endpoint grinds+// and returns a fresh keypair per request; never paste a real secret key here.const DISCOVERY_OUTPUT_EXAMPLE = {- address: 'Sonh98bek7doEoRsv3kQ4wiGpXKoLjykwwMMW7j855U',+ address: 'SoEXAMPLEdoNotUse1111111111111111111111111111',prefix: 'So',suffix: null,ignoreCase: false,- secretKeyBase58:- '3yDa7yKFum6UDfu1xmMPaD4oi4VoWVs2f3MV8n8W3qb2Aqx6cDEBNs1kPj8M1GHYWBmiQravrwW3vsSVhqKDzfvA',+ secretKeyBase58: '<example-only — the live endpoint returns the ground secret key here>',secretKey: [- 148, 131, 95, 215, 78, 89, 60, 95, 3, 101, 148, 82, 38, 181, 56, 16, 169, 211, 230, 246,- 175, 77, 65, 244, 238, 93, 134, 100, 61, 49, 160, 234, 6, 156, 108, 96, 247, 163, 149, 94,- 138, 213, 165, 193, 67, 185, 170, 128, 123, 198, 234, 243, 158, 120, 123, 177, 250, 231,- 248, 199, 144, 30, 122, 75,+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,+ 0, 0,],attempts: 160000,durationMs: 6030,expectedAttempts: 3364,network: 'solana',- explorerUrl: 'https://solscan.io/account/Sonh98bek7doEoRsv3kQ4wiGpXKoLjykwwMMW7j855U',+ explorerUrl: 'https://solscan.io/account/SoEXAMPLEdoNotUse1111111111111111111111111111',};const DISCOVERY_OUTPUT_SCHEMA = {@@ -149,7 +153,8 @@ const DISCOVERY_OUTPUT_SCHEMA = {ignoreCase: { type: 'boolean' },secretKeyBase58: {type: 'string',- description: 'Base58-encoded 64-byte Ed25519 secret key (import into Phantom/Solflare).',+ description:+ 'Base58-encoded 64-byte Ed25519 secret key (import into Phantom/Solflare).',},secretKey: {type: 'array',@@ -222,7 +227,10 @@ function parsePattern(req) {const suffix = typeof q.suffix === 'string' ? q.suffix.trim() : '';const ignoreCase = q.ignoreCase === '1' || q.ignoreCase === 'true';- for (const [label, pattern] of [['prefix', prefix], ['suffix', suffix]]) {+ for (const [label, pattern] of [+ ['prefix', prefix],+ ['suffix', suffix],+ ]) {if (!pattern) continue;const v = validatePattern(pattern);if (!v.valid) {@@ -313,7 +321,12 @@ export default wrap(async (req, res) => {if (acResult.headers) {for (const [k, v] of Object.entries(acResult.headers)) res.setHeader(k, v);}- return error(res, acResult.status || 403, acResult.code || 'access_denied', acResult.reason || 'access denied');+ return error(+ res,+ acResult.status || 403,+ acResult.code || 'access_denied',+ acResult.reason || 'access denied',+ );}if (acResult?.grantAccess) {let result;@@ -338,9 +351,14 @@ export default wrap(async (req, res) => {// USE-15: idempotency cache lookup before paying for /verify. A retried// payment (same payment-id, same query) returns the SAME ground keypair// instead of grinding a fresh one and double-charging.- const paymentId = extractIdFromHeader(paymentHeader);+ const clientPaymentId = extractIdFromHeader(paymentHeader);const payloadHash = hashRequestPayload({ method: req.method, url: req.url, body: null });const paymentHash = hashPaymentProof(paymentHeader);+ // Always-on replay guard: the payment-identifier extension is client-opt-in,+ // so when the client omits it we fall back to the proof hash itself as the+ // dedup key (reproducible only by the original payer), making replay+ // protection unconditional. Same idiom as api/_lib/x402-paid-endpoint.js.+ const paymentId = clientPaymentId || (paymentHash ? `proof:${paymentHash}` : null);if (paymentId) {const lookup = await checkCache({ route: ROUTE, paymentId, payloadHash, paymentHash });if (lookup.kind === 'hit') return writeCachedResponse(res, lookup.entry);diff --git a/chat/src/three-ui/TopNav.svelte b/chat/src/three-ui/TopNav.svelteindex b903c39b0..444122fb7 100644--- a/chat/src/three-ui/TopNav.svelte+++ b/chat/src/three-ui/TopNav.svelte@@ -6,16 +6,13 @@import NotificationBell from '../NotificationBell.svelte';import PayWalletPicker from '../PayWalletPicker.svelte';- let mobileOpen = false;-// Main-site destinations. These live at the site root (three.ws/…),// outside the chat SPA, so they are real anchors rather than route changes.- const siteLinks = [- { href: '/marketplace', label: 'Marketplace' },- { href: '/pay', label: 'Pay' },- { href: '/features', label: 'Features' },- { href: '/docs', label: 'Docs' }- ];+ // Sourced from the shared nav data so chat and the main-site header can+ // never disagree on labels or hrefs.+ import { CHAT_SITE_LINKS as siteLinks } from '../../../public/nav-data.js';++ let mobileOpen = false;function goChatHome() {route.set('chat');diff --git a/data/changelog.json b/data/changelog.jsonnew file mode 100644index 000000000..abc5e5a56--- /dev/null+++ b/data/changelog.json@@ -0,0 +1,760 @@+{+ "$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-11",+ "title": "Faster, quieter agents directory and site-wide page polish",+ "summary": "The on-chain agents directory now loads from our server-side index instead of contacting every agent's metadata host from your browser — pages render faster and no longer spray network errors. Also: the pump.fun cockpit's sidebar pages are now shareable deep links, mobile nav and footer links meet touch-target guidelines, anonymous visitors no longer trigger failed sign-in requests on Walk and Create, and assorted dead links were removed.",+ "tags": [+ "improvement",+ "fix"+ ],+ "link": "/agents"+ },+ {+ "date": "2026-06-11",+ "title": "Text-to-3D and image-to-3D generation restored",+ "summary": "Fixed two provider regressions that blocked Forge generation: model submissions now pin the latest published model version automatically, and the text-to-image step falls back to a healthy provider instead of failing when the preferred one is misconfigured.",+ "tags": [+ "fix"+ ],+ "link": "/forge"+ },+ {+ "date": "2026-06-10",+ "title": "WebRTC relay and x402 telemetry",+ "summary": "Added a Session Description Protocol relay for WebRTC handshakes and instrumented every paid x402 surface for Provider Hub telemetry, with hardened rate limiting.",+ "tags": [+ "feature",+ "infra"+ ]+ },+ {+ "date": "2026-06-09",+ "title": "New Claude models in every agent brain",+ "summary": "Claude Fable 5 and Mythos 5 are now available across agent brain selectors, pricing tables, and the x402 provider catalog.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-08",+ "title": "Bounty board with AI judge",+ "summary": "Bounty submissions now support liking, AI-powered scoring, and per-bounty leaderboards — submissions are ranked by a platform-powered judge.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-08",+ "title": "Public agent profiles with shared memories",+ "summary": "Agents can now have public profile pages that surface their shared memories, plus Replicate model provider support and public agent directory resolution.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-07",+ "title": "AIXBT market intelligence for agents",+ "summary": "Agents and in-world NPCs can now tap AIXBT market intelligence — token analysis, project data, and grounding served through new API endpoints.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-06",+ "title": "IBM Granite models over MCP and x402",+ "summary": "Published an MCP package exposing IBM Granite chat, code, embedding, and forecasting models with x402 pay-per-call routing.",+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-06-06",+ "title": "Forge editing upgrades",+ "summary": "Forge gained an animation system, pose studio, magic-brush stylization, multi-view rendering, and faster segment/animate/texture workers.",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-06-05",+ "title": "Privy wallet sign-in",+ "summary": "Wallet-native sign-in via Privy with JWKS verification and DID linking — log in securely without managing passwords.",+ "tags": [+ "feature",+ "security"+ ]+ },+ {+ "date": "2026-06-05",+ "title": "Pump.fun autopilot and guided agent creation",+ "summary": "Automated token launching and trading via pump.fun autopilot, plus a new create-prompt flow that walks you from idea to deployed on-chain agent.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-05",+ "title": "Cosmetics economy in the game world",+ "summary": "A cosmetics shop inside the 3D game world — buy avatar customizations via x402, trade them peer-to-peer, and earn from cosmetics usage.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-03",+ "title": "Voice cloning and real-time lip-sync",+ "summary": "ElevenLabs text-to-speech is now wired through the platform: voice cloning, real-time lip-sync, and per-voice settings for every agent.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-03",+ "title": "Autonomous agent-to-agent trading",+ "summary": "Agents can now negotiate with each other, pay for crypto intelligence via x402 micropayments, and settle on-chain — fully autonomously.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-03",+ "title": "x402 payment hardening",+ "summary": "Hardened payment processing with Solana transaction confirmation, replay-attack guards, payment-intent deduplication, and sanitized errors across MCP bridges.",+ "tags": [+ "security",+ "fix"+ ]+ },+ {+ "date": "2026-06-02",+ "title": "Four production MCP servers",+ "summary": "3D Studio (text-to-3D, model inspection), x402 Bazaar (service discovery and payment), IBM watsonx (LLM access), and Pump.fun (token operations) — all published with manifests and docs.",+ "tags": [+ "sdk"+ ],+ "link": "/docs/mcp"+ },+ {+ "date": "2026-06-02",+ "title": "Every agent gets its own wallet",+ "summary": "Each agent now has a deterministic Solana wallet for self-custodied payments — agents can send SOL and settle x402 transactions autonomously.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-01",+ "title": "City world",+ "summary": "An isometric 3D city with player movement, collision, minimap, and avatar animation — a new kind of world to explore as your agent.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-01",+ "title": "Quests, loot, mounts, and realms",+ "summary": "The multiplayer game layer now includes quests, loot drops, mounts, and realm-based gameplay with a token-managed in-game economy.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-31",+ "title": "Spatial voice chat in coin worlds",+ "summary": "Proximity-based voice chat inside multiplayer worlds — you hear players based on distance, with speaking indicators, voice activity detection, and audio panning.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-31",+ "title": "Holder-gated worlds",+ "summary": "Every coin world now has two rooms: General (open to all) and Holders (gated by minimum token holdings, verified server-side).",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-31",+ "title": "Keyframe animation in Pose Studio",+ "summary": "Create, edit, and export full-body avatar animations on a keyframe timeline — with easing functions and export to JSON or GLB.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-30",+ "title": "Coin Communities — live 3D coin worlds",+ "summary": "Every pump.fun coin gets a deterministic 3D world. Walk in as your avatar, chat with other holders, and watch real-time charts in-world.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-29",+ "title": "Live trade streaming and zen mode",+ "summary": "The pump.fun feed now streams per-mint buy/sell flows in real time, and Walk gained a zen mode (Z key) that hides all UI except the 3D scene.",+ "tags": [+ "feature",+ "improvement"+ ]+ },+ {+ "date": "2026-05-28",+ "title": "Faster, more reliable deploys",+ "summary": "Updated the Solana SDK bridge and fixed build memory limits and per-file timeouts that could stall deployments.",+ "tags": [+ "fix",+ "infra"+ ]+ },+ {+ "date": "2026-05-27",+ "title": "Brain page — race LLMs side by side",+ "summary": "Run simultaneous inference across Claude, GPT, Qwen, and more with streaming latency comparison, plus a face-quality module that scores avatar facial fidelity.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-27",+ "title": "Unified dashboard",+ "summary": "Dashboard routes consolidated under /dashboard — agents, avatars, analytics, settings, and billing in one place.",+ "tags": [+ "improvement"+ ],+ "link": "/dashboard"+ },+ {+ "date": "2026-05-26",+ "title": "three.ws on AWS Marketplace",+ "summary": "Subscribe through AWS Marketplace and automatically receive x402 API keys, with subscription status enforced across the platform.",+ "tags": [+ "feature",+ "infra"+ ],+ "link": "/docs/listings"+ },+ {+ "date": "2026-05-26",+ "title": "Avatar regeneration tracking and grounded AR",+ "summary": "Avatar regeneration jobs are now trackable, and AR mode freezes the follow-cam so avatars walk in world space instead of always facing the camera.",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-25",+ "title": "Search engines find everything faster",+ "summary": "Dynamic chunked sitemaps backed by live database queries, JSON-LD structured data for agents and avatars, and IndexNow integration for instant search discovery.",+ "tags": [+ "infra",+ "improvement"+ ]+ },+ {+ "date": "2026-05-24",+ "title": "Marketplace asset pricing and purchases",+ "summary": "Asset pricing, purchase flows, payment modals, and time-pass licensing — avatar customizations and plugins are now monetizable.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-24",+ "title": "Avatar review with live 3D preview",+ "summary": "The create-review step now embeds a full TalkScene 3D viewer with idle animations and a responsive mobile layout.",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-23",+ "title": "Pay by name with SNS",+ "summary": "Solana Name Service integration — claim threews.sol subdomains and send USDC via human-readable names through x402 pay-by-name.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-21",+ "title": "x402 Bazaar infrastructure",+ "summary": "Bazaar listing and search with x402 subscriptions, paid-tier access control, idempotency caching, and offer receipts for service monetization.",+ "tags": [+ "feature",+ "infra"+ ]+ },+ {+ "date": "2026-05-21",+ "title": "Pole Club — micro-tip performances",+ "summary": "A 3D club with four stages where USDC micro-tips ($0.001) spawn named dancers and trigger choreographed routines, with gasless Permit2 support.",+ "tags": [+ "feature"+ ],+ "link": "/club"+ },+ {+ "date": "2026-05-21",+ "title": "Agent-to-agent protocol",+ "summary": "A2A client/server, MCP bridge, spending ledger, and receipts storage — agents can securely request services from each other with x402 payment coordination.",+ "tags": [+ "feature",+ "sdk"+ ]+ },+ {+ "date": "2026-05-21",+ "title": "Agent-UI SDK released",+ "summary": "Published @three-ws/agent-ui for embedding 3D avatars in any web app — animation, click reactions, mouse tracking, and movement behaviors.",+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-05-21",+ "title": "Avatar Agent MCP in Anthropic's registry",+ "summary": "Published avatar-agent-mcp to Anthropic's official MCP registry — 40+ tools for avatar generation, token launches, GLB rendering, and on-chain transactions.",+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-05-20",+ "title": "Platform-wide security hardening",+ "summary": "SSRF guards on outbound fetches, CSRF gates on admin and key management, per-IP rate limiting on shared API quotas, and fail-closed cron handlers.",+ "tags": [+ "security"+ ]+ },+ {+ "date": "2026-05-20",+ "title": "Buybacks and WASM vanity addresses",+ "summary": "Added a pump-swap buyback flow and a WebAssembly vanity address grinder for custom token launch addresses.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-19",+ "title": "USDC pairs for pump.fun v2",+ "summary": "USDC trading pair support for pump.fun v2 coins with automatic bonding-curve quote detection.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-18",+ "title": "Live feed mode in the token visualizer",+ "summary": "The pump.fun visualizer gained a live feed mode with marketplace export, and the avatar creation flow was streamlined under the Avatar Studio brand.",+ "tags": [+ "feature",+ "improvement"+ ]+ },+ {+ "date": "2026-05-18",+ "title": "Solana Seeker mobile support",+ "summary": "Mobile Wallet Adapter integration for Solana Seeker and Saga devices, with a Solana dApp Store listing and Seed Vault authentication.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-18",+ "title": "Selfie-to-avatar reconstruction pipeline",+ "summary": "Native photo-to-3D reconstruction — submit selfies and get a fully rigged GLB avatar with automatic mesh optimization, resilient to long-running transforms.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-17",+ "title": "Agent personalization and on-chain economy scaffolding",+ "summary": "Persona extraction from voice interviews, memory seeds from GitHub/X/Farcaster, instant voice cloning, a bonding-curve simulator, and EAS attestation reputation.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-17",+ "title": "Talking avatars with audio-driven lip-sync",+ "summary": "Real-time lip-sync reads TTS audio and morphs avatar mouth shapes, integrated into talk scenes with camera presets and emotes.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-17",+ "title": "Team launches with creator-signer split",+ "summary": "Token launches now support separate signer and creator wallets — the signer pays gas while the creator receives on-chain royalties.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-17",+ "title": "News syndication",+ "summary": "News posts auto-publish to Dev.to and Medium with canonical links back to three.ws, and WebSub pushes keep RSS subscribers current.",+ "tags": [+ "infra"+ ]+ },+ {+ "date": "2026-05-17",+ "title": "Server-side avatar regeneration",+ "summary": "Restyle, remesh, retexture, and rerig avatars with server-backed Replicate compute — results cached automatically in R2.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-17",+ "title": "Talk mode, avatar SDK, and 5–10x smaller avatars",+ "summary": "Talk mode with camera presets and ARKit-52 blendshapes, a public avatar SDK with React exports, new brain/TTS/identity APIs, and a GLB bake pipeline with WebP compression that cuts asset sizes 5–10x.",+ "tags": [+ "feature",+ "sdk"+ ]+ },+ {+ "date": "2026-05-15",+ "title": "Avatar accessories and launchpad redesign",+ "summary": "Avatar customization now supports accessories, and the coin launchpad interface was redesigned for clarity.",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-15",+ "title": "Token visualizer search and sort",+ "summary": "The interactive 3D token universe gained search by name/symbol/mint and sorting by market cap, live status, replies, and age — refreshing every 60 seconds.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-14",+ "title": "x402 commerce — SKUs and hosted checkout",+ "summary": "Stripe-like payment UX for x402: define SKUs, share hosted checkout links, and track settlement history — settled on Base via Coinbase CDP.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-14",+ "title": "Launchpad Studio — no-code hosted pages",+ "summary": "Pick a template, fill a form, and publish a hosted page for your token or service at /p/<slug> — no code required.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-14",+ "title": "Multiplayer walk scenes",+ "summary": "Live multiplayer walkaround with websocket infrastructure — multiple players see each other in the same 3D scene.",+ "tags": [+ "feature",+ "infra"+ ]+ },+ {+ "date": "2026-05-14",+ "title": "15 tutorials and six new paid endpoints",+ "summary": "New developer walkthroughs from embed quickstart to multi-agent coordination, plus six x402 paid endpoints including agent reputation, identity verify, and skill marketplace.",+ "tags": [+ "docs",+ "feature"+ ]+ },+ {+ "date": "2026-05-13",+ "title": "Autonomous X Spaces voice agent",+ "summary": "A cloud voice agent that joins X Spaces and holds real-time conversations using streaming audio and transcription.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-10",+ "title": "Monetization v2",+ "summary": "Trials, time-based access passes, withdrawal processing, signed receipts, multi-wallet support, and 5% referral splits.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-10",+ "title": "Marketplace v2 and creator dashboard",+ "summary": "Redesigned marketplace with trials, time passes, billing receipts, featured avatar galleries, and theme selection.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-10",+ "title": "Launch-week recap published",+ "summary": "An interactive case study of launch week (Apr 29 – May 9) with the architecture timeline, partner ecosystem, lessons learned, and live engagement metrics.",+ "tags": [+ "docs"+ ]+ },+ {+ "date": "2026-05-09",+ "title": "Vanity wallet addresses",+ "summary": "Vanity address grinders for Solana and Ethereum, plus co-sign helpers for parallel token launches.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "title": "$THREE holder gating",+ "summary": "Holder-gated access now works with a simple on-chain $THREE balance check — no vault setup required.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "title": "Agent Payments SDK v3.1.0 — multi-chain",+ "summary": "Solana v2 bonding curve support plus Base, Polygon, and Ethereum with cross-chain payment routing.",+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-05-08",+ "title": "Payments inside chat",+ "summary": "The full agent payments lifecycle is available in chat — balance checks, fund distribution, withdrawals, and USDC whitelist monitoring.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "title": "Trading tools in chat",+ "summary": "Five real trading tools in agent chat: buy, sell, portfolio view, and live price quotes with custom slippage control.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "title": "Pick your agent's model",+ "summary": "Chat moved to unified streaming with per-agent model selection across Anthropic, OpenRouter, Groq, and OpenAI.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "title": "x402 spec v2",+ "summary": "Upgraded the payment protocol to spec v2 with CAIP-2 network IDs, Bazaar integration, and marketplace listing support.",+ "tags": [+ "improvement",+ "sdk"+ ]+ },+ {+ "date": "2026-05-08",+ "title": "Agents that feel the room",+ "summary": "Agents now react to user sentiment with emotion expressions and animations — empathy, concern, celebration, patience, curiosity.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-04",+ "title": "Real-time multiplayer sync",+ "summary": "Live multiplayer support with real-time room creation, player interactions, and synchronized state.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-04",+ "title": "JavaScript SDK launch",+ "summary": "The official three.ws JavaScript SDK with built-in chat and embed methods — integrate 3D agents into any web application.",+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-05-04",+ "title": "Sell your agent's skills",+ "summary": "Skill pricing, purchase buttons, and a payment intent API — creators can gate premium skills behind subscriptions or one-time purchases.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-04",+ "title": "Richer pump.fun feed",+ "summary": "Graduation event parsing, gesture animations, and live market cap display in the pump.fun dashboard.",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-04",+ "title": "Avatar reactions to market events",+ "summary": "Community and personal avatar selection with real-time gesture animations during market events.",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-01",+ "title": "Plugin marketplace",+ "summary": "Search, install, and manage community-published agent skills using the open ToolManifest format.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-01",+ "title": "Lip-sync and Solana Blinks",+ "summary": "Real-time viseme morphing from audio, plus Solana Blinks support so agents can parse and execute on-chain actions.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-01",+ "title": "Reputation and staking",+ "summary": "Agent reputation panel with ETH staking for trust signals — reputation accumulates through validator actions tracked on-chain.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-30",+ "title": "Chat with voice",+ "summary": "Native LLM chat launched with live voice input/output and real-time transcription for agent conversations.",+ "tags": [+ "feature"+ ],+ "link": "/chat"+ },+ {+ "date": "2026-04-29",+ "title": "three.ws in Anthropic's MCP Registry",+ "summary": "Published to the official MCP Registry — Claude can deploy agents, create tokens, and run wallet operations on three.ws via the standard MCP protocol.",+ "tags": [+ "sdk",+ "infra"+ ]+ },+ {+ "date": "2026-04-29",+ "title": "On-chain agents on Solana and EVM",+ "summary": "Unified deployment stack — agents register on Ethereum, Base, Polygon, and Solana with passport pages, reputation, and attestations.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-29",+ "title": "Pump.fun launch and trading stack",+ "summary": "Token creation, bonding-curve swaps, KOL trade tracking, automated wallet monitoring, and a vanity address grinder for custom Solana prefixes.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-29",+ "title": "x402 micropayments",+ "summary": "Facilitator-mediated USDC micropayments — MCP clients authorize requests with payment headers, with per-tool pricing and subscription bypass.",+ "tags": [+ "feature",+ "sdk"+ ]+ },+ {+ "date": "2026-04-29",+ "title": "Solana Agent SDK",+ "summary": "Actions for token transfers, SPL swaps, balance queries, and stake attestations, with transaction builders and fee estimation.",+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-04-27",+ "title": "Hello, three.ws",+ "summary": "The platform rebranded from 3D Agent to three.ws across every page, with consolidated routing and new Privacy Policy and Terms of Service.",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-04-27",+ "title": "Create-to-deploy flow",+ "summary": "A streamlined creator path: create, edit, see your 3D body on your public profile, and deploy on-chain with chain selection — with onboarding for first-time creators.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-27",+ "title": "3D viewer polish",+ "summary": "Better first-load camera framing, keyboard shortcuts, saved per-agent animation preferences, and improved mobile accessibility.",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-04-17",+ "title": "Avatars that never sit still",+ "summary": "A four-channel idle animation loop — breathing, eye saccades, blinks, weight shifts — keeps avatars naturally alive during silence.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-17",+ "title": "On-chain agent discovery",+ "summary": "The /discover page lists every ERC-8004 agent owned by your wallet with one-click import, plus a LobeHub plugin for LLM orchestration.",+ "tags": [+ "feature"+ ],+ "link": "/discover"+ },+ {+ "date": "2026-04-17",+ "title": "Embeds with action bridges",+ "summary": "Agent embeds can be hosted on external sites with persistent state, live Studio preview, and bridges for inter-agent communication.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-16",+ "title": "Widget Studio is born",+ "summary": "The first version of Widget Studio — build, preview, and save custom avatar widgets with a drag-drop editor and live updates.",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-15",+ "title": "3D model validation tools",+ "summary": "Model validation, inspection, and optimization APIs for GLB/FBX files — asset analysis and format conversion to guarantee avatar quality.",+ "tags": [+ "feature",+ "sdk"+ ]+ },+ {+ "date": "2026-04-15",+ "title": "Wallet sign-in and on-chain identity",+ "summary": "Sign-In with Ethereum, wallet integration, and the ERC-8004 Passport widget — agents display cryptographic proof of identity tied to wallet ownership.",+ "tags": [+ "feature",+ "security"+ ]+ }+ ]+}diff --git a/docs/pumpfun-program/AUDIT-2026-06-11.md b/docs/pumpfun-program/AUDIT-2026-06-11.mdnew file mode 100644index 000000000..71f4f3594--- /dev/null+++ b/docs/pumpfun-program/AUDIT-2026-06-11.md@@ -0,0 +1,251 @@+# pump.fun v2 trade-interface audit — three.ws (follow-up)++**Date:** 2026-06-11+**Scope:** re-audit of every place three.ws builds a bonding-curve buy/sell, the AMM+swap path, the buyback inner instruction, and the launch (create + initial buy) path —+checked against the vendored v2 docs and IDLs in `docs/pumpfun-program/` and the+**installed** SDK sources (`@pump-fun/[email protected]`, `@pump-fun/[email protected]`).+**Prior audit:** [AUDIT-2026-06-08.md](AUDIT-2026-06-08.md). That audit verified account+lists and quote-mint plumbing. This pass re-verified those conclusions on the pinned+1.36.0/1.17.0 SDKs and went one level deeper into **argument semantics** (token amounts,+slippage units, token programs), where it found a cluster of real, reachable defects the+prior pass missed.++## Method++- Account lists / order / flags / discriminators extracted programmatically from+ `idl/pump.json` and compared to our builders and to the SDK builder internals read+ from `node_modules/@pump-fun/pump-sdk/dist/esm/index.js` and+ `node_modules/@pump-fun/pump-swap-sdk/dist/esm/index.js`.+- Argument semantics taken from `docs/instructions/BUY.md` ("`amount` … Must be greater+ than `0`"), `docs/instructions/SELL.md` (`min_sol_output` floor), and+ `docs/instructions/COIN_CREATION.md` (`create_v2` mints are **Token-2022**).+- Three SDK facts drive most verdicts below (verified in the installed sources):+ 1. **Slippage unit is PERCENT.** pump-sdk pads via+ `amount * floor(slippage * 10) / 1000` (so `slippage: 1` = 1%, and any value+ < 0.1 floors to **zero**); pump-swap-sdk uses `1 ± slippage / 100`.+ 2. **`buy`/`buy_v2` `amount` is the base-token quantity to buy** and must be > 0;+ the SDK passes it through untouched. The quote/sol amount is only the max-cost+ bound. A caller that wants "spend X quote" must derive `amount` via+ `getBuyTokenAmountFromSolAmount`.+ 3. **Token programs are caller-supplied.** `fetchBuyState`/`fetchSellState` and the+ legacy builders default to SPL Token; the v2 builders default the base to+ Token-2022. Neither inspects the mint. Since **all** pump.fun launches now go+ through `create_v2` (Token-2022 base mints — including every coin three.ws+ launches), any path that hardcodes/defaults the token program is wrong for one+ class of coin.++## Per-path verdicts++| # | Path | Verdict | Evidence |+|---|------|---------|----------|+| 1 | Buyback inner ix `buy_exact_quote_in_v2` (hand-rolled, CPI'd by `agent_buyback_trigger`) | **PASS** (re-verified) | [pump-swap-ix.js:260](../../api/_lib/pump-swap-ix.js#L260) — 27 accounts bit-for-bit vs IDL; writable mask `{6–17,20,21}`; signer `{13}`; disc `[194,171,28,70,104,77,91,47]`; data `disc‖u64‖u64 LE`; token programs read from mint owners; slippage in real bps math |+| 2 | Dispatcher curve buy (`/api/pump/buy-prep`) | **GAP-1/2/3 (fixed)** | was `amount: new BN(0)` + fraction slippage + SPL-only defaults — see below |+| 3 | Dispatcher curve sell (`/api/pump/sell-prep`) | **GAP-2/3/4/5 (fixed)** | was `min_sol_output = 0`, fraction slippage, SPL defaults, mayhem fee pool ignored, no quote-ATA create |+| 4 | Dispatcher AMM buy/sell | **GAP-3 (fixed)** | slippage fraction → percent; quote-keyed pool PDA already correct (`canonicalPumpPoolPda(mint, quoteMint)` in [email protected] takes the quote mint — re-verified) |+| 5 | Dispatcher quote endpoint (`/api/pump/quote`) | **GAP-3/6 (fixed)** | AMM min/max computed with fraction slippage; buy response read `r.uiBase`/`r.minBase`, fields `buyQuoteInput` never returns (always null); curve estimates passed `feeConfig: null`/`mintSupply: null` |+| 6 | Custodial buy/sell (`/api/agents/:id/pumpfun/{buy,sell}`) | **GAP-2/3 (fixed)** + flagged | `tokenProgram` hardcoded SPL, fraction slippage, legacy builders; sell ignored mayhem; USDC-paired coins now rejected with a typed 409 (product call below) |+| 7 | Custodial AMM swap (`/api/agents/:id/pumpfun/swap`) | **GAP-3 (fixed)** + guard | fraction slippage; SOL-only pool PDA — now rejects stable-paired pools cleanly instead of falling into `swapSolanaStateNoPool` against a nonexistent SOL pool |+| 8 | Custodial portfolio | **GAP-2 (fixed)** | balances and `fetchSellState` derived SPL-only ATAs → every Token-2022 (create_v2) position read as zero / "curve_quote_failed" |+| 9 | Browser skills `pumpfun-buy`/`pumpfun-sell` (in-browser path) | **GAP-1/2/3 (fixed)** | USDC buy sent `amount: new BN(0)`; fraction slippage; SPL `tokenProgram` hardcoded; sells had no min-out floor on the USDC branch |+| 10 | Browser skill `pumpfun-create` (initial dev buy) | **GAP-1 (fixed)** | `createV2AndBuyInstructions` got `amount: new BN(0)` → dev buy purchases zero tokens |+| 11 | Browser skills `pumpfun-amm-buy`/`pumpfun-amm-sell` | **GAP-7 (fixed, was dead)** | called `swapAutocompleteBaseFromQuote`/`swapAutocompleteQuoteFromBase`, which **do not exist** on `[email protected]`, with `canonicalPumpPoolPda(mint)[0]` (indexing a `PublicKey` → `undefined`). Both skills crashed on every invocation |+| 12 | Browser skill `pumpfun-status` | **GAP (fixed)** | `bondingCurveMarketCap({ global, bondingCurve })` — the helper's signature is `{ mintSupply, virtualQuoteReserves, virtualTokenReserves }`, so it multiplied `undefined` and threw; balance lookup was SPL-ATA-only |+| 13 | Launch paths (`buildLaunchInstructions`, launch-prep/agent, `api/agents/tokens`, `api/_lib/pump-launch.js`) | **PASS** | token amounts computed (`getBuyTokenAmountFromSolAmount`, quote-aware per GAP-B of the prior audit); `createV2AndBuy*` applies its own internal 1% pad; USDC preflights in place |+| 14 | Read-side quoting (`src/pump/pump-swap-quote.js`, `api/pump-fun-mcp.js handleQuoteSwap`) | **GAP-3 (fixed)** | fraction slippage skewed reported min/max bounds 100x |+| 15 | Buyback cron consumption (`api/cron/[name].js`) | **PASS** | consumes `buildPumpSwapInnerIx` data/accounts verbatim; own slippage math is correct bps arithmetic ([cron line ~1831](../../api/cron/%5Bname%5D.js)) |+| 16 | `sdk-bridge.js` (read-side pricing, `@nirholas/pump-sdk` fork) | **PASS (informational)** | display-only pricing; passes a real fetched curve + feeConfig. Its `mintSupply = totalSupply − virtualTokenReserves` convention differs from the official SDK's `tokenTotalSupply`; affects fee-tier estimation display only, not any instruction |++## Gaps found and fixed (this pass)++### GAP-1 (critical) — curve buys requested **zero tokens**++`handleBuyPrep` passed `amount: new BN(0)` to `buyV2Instructions` (USDC branch) and+`buyInstructions` (SOL branch). Per `docs/instructions/BUY.md`, `amount` is the base-token+quantity to buy and **must be > 0** — the program rejects the instruction, so every+bonding-curve buy built by `/api/pump/buy-prep` failed at execution. The same defect+existed in the browser skill's USDC buy and in the `pumpfun-create` dev buy+(`createV2AndBuyInstructions` with `amount: 0`). This predates the prior audit (verified+against commit `73e8f91a`) and was missed by it.++**Fix:** every buy path now derives the token amount from the quote input via+`getBuyTokenAmountFromSolAmount({ global, feeConfig, mintSupply, bondingCurve, amount, quoteMint })`+(with the real fetched `feeConfig` where available) and passes the user's quote amount as+the max-cost bound the SDK pads with slippage. Responses now include+`expected_tokens_out`. Zero-token estimates return a typed 400 `amount_too_small`.++### GAP-2 (high) — base token program assumed SPL; create_v2 coins are Token-2022++All pump.fun coins are now minted via `create_v2` with **Token-2022** base mints+(`docs/instructions/COIN_CREATION.md`; our own `buildLaunchInstructions` comment: "Pump.fun+no longer accepts V1 launches"). Yet:++- the dispatcher SOL curve path used legacy `buyInstructions`/`sellInstructions` with the+ default SPL `tokenProgram` and called `fetchBuyState`/`fetchSellState` without a token+ program (SPL ATA lookups);+- the custodial endpoints hardcoded `tokenProgram: splToken.TOKEN_PROGRAM_ID`;+- the custodial portfolio + `pumpfun-status` derived SPL-only ATAs.++Result: wrong `associated_user` ATAs and wrong `token_program` account for every+Token-2022 coin — i.e. **trades of every coin three.ws itself launches failed on-chain**,+and Token-2022 sells fell through to the AMM path (`fetchSellState` threw on the wrong+ATA) and 404'd `pool_not_found`.++**Fix:** all trade handlers read the mint account's owner and resolve the token program+through the new validated helper `resolveTokenProgramForMintOwner`+([api/_lib/pump-trade-args.js](../../api/_lib/pump-trade-args.js)); the quote token+program is likewise read from the quote mint's owner instead of assumed. The dispatcher+curve paths were migrated from the legacy `buy`/`sell` builders to the **unified+`buy_v2`/`sell_v2`** builders for all coins (SOL- and USDC-paired, SPL and Token-2022) —+exactly the migration the upstream announcement urges, with documented identical costs,+and the v2 sell builder also reads the curve's mayhem flag itself (the legacy sell needed+`mayhemMode` passed and we never passed it — mayhem-coin sells picked the wrong fee+recipient pool). Portfolio balances now check both ATA derivations.++### GAP-3 (high) — slippage passed as a fraction; SDKs take percent++Every handler converted `slippage_bps / 10_000` (fraction) and passed it to SDK builders+that expect **percent**. On the curve builders, `floor(slippage * 10)` truncates any+fraction < 0.1 to **zero** — so the live default of 100 bps produced a 0% max-cost pad+(buys revert on any upward tick) and, combined with GAP-4, sells had no floor at all. On+the AMM, bounds came out 100x tighter than requested. Affected: dispatcher buy/sell/quote,+custodial buy/sell/swap, browser skills, `pump-swap-quote.js`, `pump-fun-mcp.js`.++**Fix:** `slippagePercentFromBps()` (clamped, default-aware) used at every SDK call site;+unit equivalence with both SDK formulas is unit-tested. `tests/pump-swap-quote.test.js`+assertions updated from the wrong unit to the verified one.++### GAP-4 (medium) — sells carried `min_sol_output = 0`++`handleSellPrep` passed `solAmount`/`quoteAmount: new BN(0)`; the SDK computes the floor+as `quoteAmount − slippage`, so the program-level minimum output was 0 and the+user-supplied `slippage_bps` was silently ignored (unbounded sandwich exposure).++**Fix:** expected output computed via `getSellSolAmountFromTokenAmount` (real+`feeConfig`) and passed as the quote amount, giving a true `expected − slippage%` floor.+Responses now include `expected_sol_out`/`expected_usdc_out`.++### GAP-5 (low) — stable-quote sells missing the seller's quote ATA++`sell_v2` pays proceeds into `associated_quote_user`, which the program does **not**+initialize (`SELL.md` #16 has no init), and the TS `sellV2Instructions` (unlike the Rust+SDK) prepends no ATA create. A seller without a USDC ATA reverted.++**Fix:** dispatcher and browser sell paths prepend+`createAssociatedTokenAccountIdempotentInstruction` for the quote ATA on non-legacy+quotes.++### GAP-6 (low) — quote endpoint response fields that never existed++The AMM buy quote read `r.uiBase`/`r.minBase` from `buyQuoteInput`, which returns+`{ base, maxQuote, internalQuoteWithoutFees }` — `min_tokens_out` was always null; the+sell path's first fallback `r.quote` likewise never exists. Curve estimates passed+`feeConfig: null` and `mintSupply: null` despite having the fetched curve.++**Fix:** buy quotes return `tokens_out` + the real slippage bound `max_sol_in`/+`max_usdc_in`; sell path reads `uiQuote`/`minQuote`; curve quotes pass the fetched+`feeConfig` and `curve.tokenTotalSupply`.++### GAP-7 (high, dead feature) — AMM browser skills called nonexistent SDK methods++`pumpfun-amm-buy`/`pumpfun-amm-sell` invoked `swapAutocompleteBaseFromQuote` /+`swapAutocompleteQuoteFromBase` on `OnlinePumpAmmSdk` — methods absent from[email protected] (verified by enumerating the prototype) — and passed+`canonicalPumpPoolPda(mint)[0]` (the function returns a `PublicKey`, so `[0]` is+`undefined`). Both skills threw on every call.++**Fix:** rebuilt on the supported surface — `swapSolanaState(poolKey, user)` ++offline `buyQuoteInput`/`sellBaseInput` with percent slippage — the same pattern as the+dispatcher AMM path. Also fixed `pumpfun-status` (`bondingCurveMarketCap` args + dual-ATA+balance) which previously threw for every mint.++### Verified-correct findings worth recording++- **`canonicalPumpPoolPda` version split.** [email protected]'s export takes only `mint`+ (wSOL-keyed) with a separate `canonicalPumpPoolPdaWithQuote`; [email protected]'s+ export takes `(mint, quoteMint = NATIVE_MINT)`. `getAmmPoolState`+ ([pump.js:236](../../api/_lib/pump.js#L236)) imports from **pump-swap-sdk**, so the+ two-arg USDC call is correct. Anyone "simplifying" that import to pump-sdk would+ silently break USDC pools — hence the conformance tests.+- **`buyV2Instructions`/`sellV2Instructions` have no `quoteMint` param** (1.36.0+ signature: `tokenProgram`, `quoteTokenProgram`; quote mint derived from+ `bondingCurve.quoteMint`). The stray `quoteMint:` arguments the old code passed were+ ignored; removed in the rewrite.+- **Legacy `buy`/`sell` builders now append `bondingCurveV2Pda` + `buybackFeeRecipient`+ as remaining accounts** (SDK 1.36.0) — one more reason the unified v2 migration is the+ stable target rather than patching the legacy path.++## Decision: USDC-quoted ("stable paired") coins++The 2026-06-08 decision stands: **adopted** — USDC pairing is live for agent-token+launches (SOL/USDC selector, default USDC) and the quote-asset plumbing (curve + AMM ++launch + confirm) is quote-agnostic. This pass materially hardened that support:++- USDC curve **buys now request a real token amount** (GAP-1) — previously they could+ not execute at all, so USDC trading was wired but non-functional.+- USDC **sells get a real min-out floor** (GAP-4) and a guaranteed **quote ATA** (GAP-5).+- `quote_token_program` is read from the USDC mint's owner rather than assumed (future+ Token-2022 stables keep working).+- USDC mints remain runtime-supplied (`SOLANA_USDC_MINT`/`_DEVNET`, explicit+ `quote_mint`, or `quote_currency: 'usdc'`); no non-`$three` coin is referenced+ anywhere (synthetic keys in tests).++**Remaining productization (unchanged from the prior audit, still open):**++1. Buy/sell widget USDC denomination (`src/game/coin-buy.js` is SOL-only; the API+ already accepts `usdc_amount` end-to-end).+2. `pump_agent_trades.quote_amount`/`quote_mint` columns so USDC trades record amounts+ (USDC buys still store `sol_amount = null`).+3. Portfolio per-quote-asset subtotals.+4. **Custodial USDC trading (new flag from this pass):** `/api/agents/:id/pumpfun/{buy,sell,swap}`+ are SOL-denominated; they now return a typed `409 usdc_paired_coin` for stable-paired+ coins instead of building a doomed transaction. Supporting them custodially needs a+ product decision on USDC accounting for agent wallets (the wallets *do* earn x402+ USDC, so this is a natural follow-up) — flagged, not half-implemented.++## Changes in this pass++- **New** [api/_lib/pump-trade-args.js](../../api/_lib/pump-trade-args.js) —+ `slippagePercentFromBps`, `resolveTokenProgramForMintOwner` (pure, unit-tested).+- [api/pump/[action].js](../../api/pump/%5Baction%5D.js) — buy-prep/sell-prep rebuilt on+ unified `buy_v2`/`sell_v2` with real token amounts, mint-owner token programs,+ percent slippage, fee-config-accurate estimates, quote-ATA create on stable sells,+ expected-out response fields; quote endpoint slippage/fee/field fixes.+- [api/agents/pumpfun/[action].js](../../api/agents/pumpfun/%5Baction%5D.js) —+ custodial buy/sell on v2 builders with token-program detection + percent slippage ++ typed stable-pair rejection; swap slippage + stable-pair guard; portfolio dual-ATA+ balances and token-program-aware sell state.+- [src/agent-skills-pumpfun.js](../../src/agent-skills-pumpfun.js) — in-browser+ buy/sell unified on v2 (computed amounts, detected token programs, percent slippage,+ quote-ATA create), dev-buy token amount, AMM skills rebuilt on the real SDK surface,+ `pumpfun-status` fixed.+- [src/pump/pump-swap-quote.js](../../src/pump/pump-swap-quote.js),+ [api/pump-fun-mcp.js](../../api/pump-fun-mcp.js) — slippage unit.+- **New** [tests/pump-trade-args.test.js](../../tests/pump-trade-args.test.js) — 11+ tests: slippage-unit equivalence against both SDK formulas, token-program resolution,+ and offline `buy_v2`/`sell_v2` builder conformance (account count/order flags/fixed+ addresses/discriminator/arg encoding) against the vendored `idl/pump.json`.+- [tests/pump-swap-quote.test.js](../../tests/pump-swap-quote.test.js) — three+ assertions updated from the wrong fraction unit to the verified percent unit.++## Verification++- **Unit tests:** `pump-trade-args` (11), `pump-swap-ix` (13), `pump-quote` (8) →+ **32 passed**; `pump-swap-quote` (11, post-fix), `pump-mcp-tools`,+ `pumpfun-mcp-tools`, `pumpfun-ported-skills`, `pump-channel-feed`, `pumpfun-mcp` →+ **all passed** (44 across the broader suites).+- **Syntax/imports:** `node --check` clean on every edited file; runtime `import()` of+ `api/pump/[action].js`, `api/agents/pumpfun/[action].js`, and the new lib succeeds.+- **Build:** full `npm run build` was SIGTERM'd twice mid-run by resource contention+ with concurrently running agents in this shared workspace (exit 143, not a compile+ error). Targeted verification instead: an esbuild bundle of the two edited `src/`+ modules succeeds, and vitest (which runs the same Vite transform pipeline) imports+ every changed module cleanly. The `api/` files are serverless functions outside the+ Vite build.+- **Prettier:** the two new files conform. The six edited pre-existing files fail+ `prettier --check` **before and after** this change (the committed style predates the+ current `.prettierrc`, as recorded in the 2026-06-08 audit) — edits match the+ surrounding style; no whole-file reformat.+- **On-chain test:** **not executed** — no funded devnet signer in this environment+ (`SOLANA_RPC_URL_DEVNET` unset). Instruction building is verified offline against the+ vendored IDL via the new conformance tests.diff --git a/package.json b/package.jsonindex 57deb4d93..eacbeab59 100644--- a/package.json+++ b/package.json@@ -1,247 +1,248 @@{- "private": true,- "type": "module",- "version": "1.5.1",- "name": "3d-agent",- "description": "AI-powered 3D model viewer — drag-and-drop glTF/GLB preview tool.",- "author": "nirholas",- "license": "Apache-2.0",- "overrides": {- "serialize-javascript": ">=7.0.5",- "@esbuild-plugins/node-globals-polyfill": "^0.2.0"- },- "engines": {- "node": "24.x"- },- "keywords": [- "3d-viewer",- "gltf-viewer",- "glb-viewer",- "3d-model-viewer",- "webgl",- "threejs",- "drag-and-drop",- "3d-agent"- ],- "workspaces": [- "agent-payments-sdk",- "agent-ui-sdk",- "avatar-sdk",- "character-studio",- "mcp-bridge",- "mcp-server",- "multiplayer",- "packages/avatar-schema",- "packages/avatar-cli",- "packages/viewer-presets",- "packages/pumpfun-mcp",- "packages/ibm-watsonx-mcp",- "packages/ibm-x402-mcp",- "packages/threews-avatar-mcp"- ],- "main": "src/app.js",- "browserslist": [- ">1%",- "not dead"- ],- "staticFiles": {- "staticPath": [- {- "staticPath": "assets",- "staticOutDir": "assets"- }- ]- },- "scripts": {- "postinstall": "(node scripts/build-cache.mjs check agent-payments-sdk agent-payments-sdk/src agent-payments-sdk/package.json || (npm run build --prefix agent-payments-sdk && node scripts/build-cache.mjs stamp agent-payments-sdk agent-payments-sdk/src agent-payments-sdk/package.json)) && (node scripts/fix-pump-sdk-esm.mjs & node scripts/fix-x402-extensions-esm.mjs & node scripts/fix-colyseus-storage.mjs & node scripts/copy-three-decoders.mjs & node scripts/setup-claude-skills.mjs & wait)",- "dev": "vite --port 3000",- "dev:multi": "npm run dev --prefix multiplayer",- "dev:walk-all": "node scripts/dev-walk-all.mjs",- "dev:lib": "TARGET=lib vite",- "presence": "node scripts/three-ws-presence.mjs",- "build:pages": "node scripts/build-page-index.mjs",- "audit:pages": "node scripts/audit-page-index.mjs",- "audit:handlers": "node scripts/audit-empty-handlers.mjs",- "audit:web": "node scripts/page-audit.mjs",- "snapshot": "node scripts/page-snapshot.mjs",- "build:news": "node scripts/build-news.mjs",- "prebuild": "(node scripts/build-news.mjs & node scripts/build-skill-metadata.mjs & node scripts/build-local-skill-packs.mjs & npm run build:club-assets & wait) && (node scripts/build-page-index.mjs && node scripts/audit-page-index.mjs && node scripts/audit-empty-handlers.mjs)",- "build": "NODE_OPTIONS='--no-deprecation --max-old-space-size=6144' vite build && node scripts/strip-sw-from-embeds.mjs",- "build:wasm": "PATH=\"$HOME/.cargo/bin:$PATH\" RUSTFLAGS='-C target-feature=+simd128' wasm-pack build crates/vanity-grinder --target web --release --out-dir ../../src/solana/vanity/wasm && printf '%s\\n' '# wasm-pack writes a default `*` gitignore that excludes everything.' '# Override it: the generated files in this directory ARE checked in so the' '# app builds without requiring a Rust toolchain at install time. Run' '# `npm run build:wasm` after editing /crates/vanity-grinder/src/lib.rs to' '# refresh these artifacts.' '!*' > src/solana/vanity/wasm/.gitignore",- "build:animations": "node scripts/build-animations.mjs",- "bake:mannequin": "node scripts/bake-mannequin-glb.mjs",- "build:club-props": "node scripts/build-club-props.mjs",- "build:club-venue": "node scripts/build-club-venue.mjs",- "build:club-hdri": "node scripts/build-club-hdri.mjs",- "build:club-audio": "node scripts/build-club-audio.mjs",- "build:club-assets": "(npm run build:club-props & npm run build:club-venue & npm run build:club-hdri & wait)",- "build:artifact-viewer": "node scripts/build-artifact-viewer.mjs",- "build:lib": "TARGET=lib vite build",- "build:lib:full": "TARGET=lib LIB_FORMATS=es,umd vite build",- "build:artifact": "vite build --config vite.config.artifact.js",- "publish:lib": "node scripts/publish-lib.mjs",- "build:chat": "cd chat && node scripts/ensure-deps.mjs && npm run build && cd .. && mkdir -p dist/chat && cp -rf public/chat/. dist/chat/",- "build:avatar-studio": "npm run build --prefix character-studio",- "build:fast": "npm run build",- "build:vercel": "node scripts/build-vercel.mjs",- "apply:r2-cors": "node scripts/set-r2-cors.mjs || echo '[apply:r2-cors] skipped (missing creds or transient failure — see build log)'",- "build:all": "npm run build:chat && (npm run build & npm run build:lib & wait)",- "release:lib": "npm run build:lib && npm run publish:lib",- "clean": "rm -rf dist/* dist-lib/* || true",- "generate-icons": "node scripts/generate-pwa-icons.mjs",- "build:extension": "node scripts/build-extension-icons.mjs && node scripts/build-extension.mjs",- "build:extension:prod": "node scripts/build-extension-icons.mjs && node scripts/build-extension.mjs --prod",- "optimize:glb": "node scripts/optimize-glb.mjs",- "compress:glbs": "node scripts/compress-glbs.mjs",- "fetch-animations": "node scripts/download-animations.mjs",- "fetch:mixamo-catalog": "node scripts/fetch-mixamo-catalog.mjs",- "test": "vitest run && playwright test",- "test:core": "vitest run --maxWorkers=1",- "test:e2e": "playwright test",- "test:pages": "node scripts/test-pages.mjs",- "verify:ibm": "node scripts/verify-ibm-pages.mjs",- "verify:zauth": "node scripts/verify-zauth-runtime.mjs",- "zauth:register": "node scripts/zauth-register-endpoints.mjs",- "test:all": "npm run test && npm run test:pages",- "verify": "prettier --check . && vite build",- "format": "prettier --write .",- "check:dist": "node scripts/check-dist.mjs",- "deploy": "npm run build:all && npm run check:dist && vercel --local-config vercel.json --prod",- "postversion": "git push && git push --tags",- "validate:cards": "node scripts/validate-agent-cards.mjs",- "db:migrate": "node scripts/apply-migrations.mjs --apply",- "db:status": "node scripts/apply-migrations.mjs",- "pump:smoke": "node scripts/pumpfun-lifecycle-smoke.js",- "pump:refresh-idls": "node scripts/refresh-pump-idls.mjs",- "seed:skills": "node scripts/seed-skills.js",- "install:sdk": "npm install --prefix agent-payments-sdk && npm run build --prefix agent-payments-sdk && npm install ./agent-payments-sdk",- "claude": "./scripts/claude.sh"- },- "dependencies": {- "@0xsplits/splits-sdk": "^6.5.0",- "@ai-sdk/anthropic": "^3.0.81",- "@ai-sdk/openai": "^3.0.68",- "@avaturn/sdk": "^1.1.4",- "@aws-sdk/client-marketplace-entitlement-service": "^3.1063.0",- "@aws-sdk/client-marketplace-metering": "^3.1063.0",- "@aws-sdk/client-s3": "^3.1063.0",- "@aws-sdk/s3-request-presigner": "^3.1063.0",- "@bonfida/spl-name-service": "0.1.67",- "@chenglou/pretext": "^0.0.7",- "@coin-communities/sdk": "^1.2.1",- "@coinbase/x402": "^2.1.0",- "@coral-xyz/anchor": "^0.32.1",- "@dimforge/rapier3d-compat": "^0.19.3",- "@elevenlabs/elevenlabs-js": "^2.51.0",- "@ethereum-attestation-service/eas-sdk": "^2.9.1",- "@gltf-transform/core": "^4.4.0",- "@gltf-transform/extensions": "^4.4.0",- "@jup-ag/api": "^6.0.48",- "@mediapipe/tasks-vision": "^0.10.35",- "@metaplex-foundation/js": "^0.20.1",- "@metaplex-foundation/mpl-agent-registry": "^0.2.5",- "@metaplex-foundation/mpl-core": "^1.10.0",- "@metaplex-foundation/umi": "^1.5.1",- "@metaplex-foundation/umi-bundle-defaults": "^1.5.1",- "@modelcontextprotocol/sdk": "^1.29.0",- "@neondatabase/serverless": "^0.10.1",- "@neynar/nodejs-sdk": "^3.176.0",- "@nirholas/pump-sdk": "^1.0.0",- "@noble/curves": "^2.2.0",- "@node-saml/node-saml": "^5.1.0",- "@octokit/rest": "^22.0.1",- "@pixiv/three-vrm": "^3.5.3",- "@privy-io/js-sdk-core": "^0.67.0",- "@pump-fun/agent-payments-sdk": "^3.0.3",- "@pump-fun/pump-sdk": "^1.36.0",- "@pump-fun/pump-swap-sdk": "^1.17.0",- "@pythnetwork/hermes-client": "^3.1.0",- "@recast-navigation/core": "^0.43.1",- "@recast-navigation/three": "^0.43.1",- "@sentry/node": "^10.56.0",- "@solana-mobile/mobile-wallet-adapter-protocol": "^2.2.9",- "@solana-mobile/mobile-wallet-adapter-protocol-web3js": "^2.2.9",- "@solana/actions": "^0.0.2",- "@solana/kit": "^6.9.0",- "@solana/pay": "^0.2.6",- "@solana/spl-token": "^0.4.14",- "@solana/wallet-adapter-base": "^0.9.23",- "@solana/wallet-adapter-phantom": "^0.9.24",- "@solana/web3.js": "^1.98.4",- "@sparticuz/chromium-min": "^148.0.0",- "@tetsuo-ai/protocol": "^0.2.0",- "@tetsuo-ai/sdk": "^1.4.0",- "@three-ws/solana-agent": "file:solana-agent-sdk",- "@upstash/qstash": "^2.11.0",- "@upstash/ratelimit": "^2.0.5",- "@upstash/redis": "^1.38.0",- "@vercel/og": "^0.11.1",- "@walletconnect/ethereum-provider": "^2.23.9",- "@x402/axios": "^2.14.0",- "@x402/core": "^2.14.0",- "@x402/evm": "^2.14.0",- "@x402/express": "^2.14.0",- "@x402/extensions": "^2.12.0",- "@x402/mcp": "^2.14.0",- "@x402/svm": "^2.14.0",- "@zauthx402/sdk": "^0.1.14",- "agent0-sdk": "^1.5.3",- "ai": "^6.0.197",- "bcryptjs": "^2.4.3",- "bn.js": "^5.2.3",- "bs58": "^6.0.0",- "colyseus": "^0.17.10",- "colyseus.js": "0.16.22",- "dat.gui": "^0.7.9",- "ethers": "^6.16.0",- "express": "^5.2.1",- "fast-check": "^4.8.0",- "gltf-validator": "^2.0.0-dev.3.10",- "graphql": "^16.14.1",- "helius-sdk": "^2.2.2",- "jose": "^5.9.6",- "lightweight-charts": "^5.2.0",- "livekit-client": "^2.19.2",- "livepeer": "^3.5.0",- "meshoptimizer": "^1.1.1",- "nipplejs": "^1.0.4",- "node-fetch": "^3.3.2",- "node-html-parser": "^7.1.0",- "postprocessing": "^6.39.1",- "puppeteer-core": "^25.1.0",- "qrcode": "^1.5.4",- "query-string": "^9.4.0",- "qwen-ai-provider": "^0.1.1",- "resend": "^6.12.4",- "sas-lib": "^1.0.10",- "short-uuid": "6.0.3",- "simple-dropzone": "^0.8.3",- "three": "latest",- "three-mesh-bvh": "^0.9.10",- "three-pathfinding": "^1.3.0",- "twitter-api-v2": "^1.29.0",- "vhtml": "^2.2.0",- "viem": "^2.52.2",- "wawa-lipsync": "^0.0.2",- "ws": "^8.21.0",- "zod": "^3.23.8"- },- "devDependencies": {- "@gltf-transform/functions": "^4.4.0",- "@playwright/test": "^1.60.0",- "@x402/fetch": "^2.14.0",- "ajv": "^8.20.0",- "ajv-formats": "^3.0.1",- "jsdom": "27.3.0",- "knip": "^6.16.1",- "playwright": "^1.45.1",- "prettier": "^3.2.5",- "sharp": "^0.34.5",- "vite": "^7.3.2",- "vite-plugin-node-polyfills": "^0.28.0",- "vite-plugin-pwa": "^1.3.0",- "vitest": "^4.1.7",- "workbox-build": "^7.4.0",- "workbox-window": "^7.4.0"- }+ "private": true,+ "type": "module",+ "version": "1.5.1",+ "name": "3d-agent",+ "description": "AI-powered 3D model viewer — drag-and-drop glTF/GLB preview tool.",+ "author": "nirholas",+ "license": "Apache-2.0",+ "overrides": {+ "serialize-javascript": ">=7.0.5",+ "@esbuild-plugins/node-globals-polyfill": "^0.2.0"+ },+ "engines": {+ "node": "24.x"+ },+ "keywords": [+ "3d-viewer",+ "gltf-viewer",+ "glb-viewer",+ "3d-model-viewer",+ "webgl",+ "threejs",+ "drag-and-drop",+ "3d-agent"+ ],+ "workspaces": [+ "agent-payments-sdk",+ "agent-ui-sdk",+ "avatar-sdk",+ "character-studio",+ "mcp-bridge",+ "mcp-server",+ "multiplayer",+ "packages/avatar-schema",+ "packages/avatar-cli",+ "packages/viewer-presets",+ "packages/pumpfun-mcp",+ "packages/ibm-watsonx-mcp",+ "packages/ibm-x402-mcp",+ "packages/threews-avatar-mcp"+ ],+ "main": "src/app.js",+ "browserslist": [+ ">1%",+ "not dead"+ ],+ "staticFiles": {+ "staticPath": [+ {+ "staticPath": "assets",+ "staticOutDir": "assets"+ }+ ]+ },+ "scripts": {+ "postinstall": "(node scripts/build-cache.mjs check agent-payments-sdk agent-payments-sdk/src agent-payments-sdk/package.json || (npm run build --prefix agent-payments-sdk && node scripts/build-cache.mjs stamp agent-payments-sdk agent-payments-sdk/src agent-payments-sdk/package.json)) && (node scripts/fix-pump-sdk-esm.mjs & node scripts/fix-x402-extensions-esm.mjs & node scripts/fix-colyseus-storage.mjs & node scripts/copy-three-decoders.mjs & node scripts/setup-claude-skills.mjs & wait)",+ "dev": "vite --port 3000",+ "dev:multi": "npm run dev --prefix multiplayer",+ "dev:walk-all": "node scripts/dev-walk-all.mjs",+ "dev:lib": "TARGET=lib vite",+ "presence": "node scripts/three-ws-presence.mjs",+ "build:pages": "node scripts/build-page-index.mjs",+ "changelog:push": "node scripts/changelog-telegram.mjs",+ "audit:pages": "node scripts/audit-page-index.mjs",+ "audit:handlers": "node scripts/audit-empty-handlers.mjs",+ "audit:web": "node scripts/page-audit.mjs",+ "snapshot": "node scripts/page-snapshot.mjs",+ "build:news": "node scripts/build-news.mjs",+ "prebuild": "(node scripts/build-news.mjs & node scripts/build-skill-metadata.mjs & node scripts/build-local-skill-packs.mjs & npm run build:club-assets & wait) && (node scripts/build-page-index.mjs && node scripts/audit-page-index.mjs && node scripts/audit-empty-handlers.mjs)",+ "build": "NODE_OPTIONS='--no-deprecation --max-old-space-size=6144' vite build && node scripts/strip-sw-from-embeds.mjs",+ "build:wasm": "PATH=\"$HOME/.cargo/bin:$PATH\" RUSTFLAGS='-C target-feature=+simd128' wasm-pack build crates/vanity-grinder --target web --release --out-dir ../../src/solana/vanity/wasm && printf '%s\\n' '# wasm-pack writes a default `*` gitignore that excludes everything.' '# Override it: the generated files in this directory ARE checked in so the' '# app builds without requiring a Rust toolchain at install time. Run' '# `npm run build:wasm` after editing /crates/vanity-grinder/src/lib.rs to' '# refresh these artifacts.' '!*' > src/solana/vanity/wasm/.gitignore",+ "build:animations": "node scripts/build-animations.mjs",+ "bake:mannequin": "node scripts/bake-mannequin-glb.mjs",+ "build:club-props": "node scripts/build-club-props.mjs",+ "build:club-venue": "node scripts/build-club-venue.mjs",+ "build:club-hdri": "node scripts/build-club-hdri.mjs",+ "build:club-audio": "node scripts/build-club-audio.mjs",+ "build:club-assets": "(npm run build:club-props & npm run build:club-venue & npm run build:club-hdri & wait)",+ "build:artifact-viewer": "node scripts/build-artifact-viewer.mjs",+ "build:lib": "TARGET=lib vite build",+ "build:lib:full": "TARGET=lib LIB_FORMATS=es,umd vite build",+ "build:artifact": "vite build --config vite.config.artifact.js",+ "publish:lib": "node scripts/publish-lib.mjs",+ "build:chat": "cd chat && node scripts/ensure-deps.mjs && npm run build && cd .. && mkdir -p dist/chat && cp -rf public/chat/. dist/chat/",+ "build:avatar-studio": "npm run build --prefix character-studio",+ "build:fast": "npm run build",+ "build:vercel": "node scripts/build-vercel.mjs",+ "apply:r2-cors": "node scripts/set-r2-cors.mjs || echo '[apply:r2-cors] skipped (missing creds or transient failure — see build log)'",+ "build:all": "npm run build:chat && (npm run build & npm run build:lib & wait)",+ "release:lib": "npm run build:lib && npm run publish:lib",+ "clean": "rm -rf dist/* dist-lib/* || true",+ "generate-icons": "node scripts/generate-pwa-icons.mjs",+ "build:extension": "node scripts/build-extension-icons.mjs && node scripts/build-extension.mjs",+ "build:extension:prod": "node scripts/build-extension-icons.mjs && node scripts/build-extension.mjs --prod",+ "optimize:glb": "node scripts/optimize-glb.mjs",+ "compress:glbs": "node scripts/compress-glbs.mjs",+ "fetch-animations": "node scripts/download-animations.mjs",+ "fetch:mixamo-catalog": "node scripts/fetch-mixamo-catalog.mjs",+ "test": "vitest run && playwright test",+ "test:core": "vitest run --maxWorkers=1",+ "test:e2e": "playwright test",+ "test:pages": "node scripts/test-pages.mjs",+ "verify:ibm": "node scripts/verify-ibm-pages.mjs",+ "verify:zauth": "node scripts/verify-zauth-runtime.mjs",+ "zauth:register": "node scripts/zauth-register-endpoints.mjs",+ "test:all": "npm run test && npm run test:pages",+ "verify": "prettier --check . && vite build",+ "format": "prettier --write .",+ "check:dist": "node scripts/check-dist.mjs",+ "deploy": "npm run build:all && npm run check:dist && vercel --local-config vercel.json --prod",+ "postversion": "git push && git push --tags",+ "validate:cards": "node scripts/validate-agent-cards.mjs",+ "db:migrate": "node scripts/apply-migrations.mjs --apply",+ "db:status": "node scripts/apply-migrations.mjs",+ "pump:smoke": "node scripts/pumpfun-lifecycle-smoke.js",+ "pump:refresh-idls": "node scripts/refresh-pump-idls.mjs",+ "seed:skills": "node scripts/seed-skills.js",+ "install:sdk": "npm install --prefix agent-payments-sdk && npm run build --prefix agent-payments-sdk && npm install ./agent-payments-sdk",+ "claude": "./scripts/claude.sh"+ },+ "dependencies": {+ "@0xsplits/splits-sdk": "^6.5.0",+ "@ai-sdk/anthropic": "^3.0.81",+ "@ai-sdk/openai": "^3.0.68",+ "@avaturn/sdk": "^1.1.4",+ "@aws-sdk/client-marketplace-entitlement-service": "^3.1063.0",+ "@aws-sdk/client-marketplace-metering": "^3.1063.0",+ "@aws-sdk/client-s3": "^3.1063.0",+ "@aws-sdk/s3-request-presigner": "^3.1063.0",+ "@bonfida/spl-name-service": "0.1.67",+ "@chenglou/pretext": "^0.0.7",+ "@coin-communities/sdk": "^1.2.1",+ "@coinbase/x402": "^2.1.0",+ "@coral-xyz/anchor": "^0.32.1",+ "@dimforge/rapier3d-compat": "^0.19.3",+ "@elevenlabs/elevenlabs-js": "^2.51.0",+ "@ethereum-attestation-service/eas-sdk": "^2.9.1",+ "@gltf-transform/core": "^4.4.0",+ "@gltf-transform/extensions": "^4.4.0",+ "@jup-ag/api": "^6.0.48",+ "@mediapipe/tasks-vision": "^0.10.35",+ "@metaplex-foundation/js": "^0.20.1",+ "@metaplex-foundation/mpl-agent-registry": "^0.2.5",+ "@metaplex-foundation/mpl-core": "^1.10.0",+ "@metaplex-foundation/umi": "^1.5.1",+ "@metaplex-foundation/umi-bundle-defaults": "^1.5.1",+ "@modelcontextprotocol/sdk": "^1.29.0",+ "@neondatabase/serverless": "^0.10.1",+ "@neynar/nodejs-sdk": "^3.176.0",+ "@nirholas/pump-sdk": "^1.0.0",+ "@noble/curves": "^2.2.0",+ "@node-saml/node-saml": "^5.1.0",+ "@octokit/rest": "^22.0.1",+ "@pixiv/three-vrm": "^3.5.3",+ "@privy-io/js-sdk-core": "^0.67.0",+ "@pump-fun/agent-payments-sdk": "^3.0.3",+ "@pump-fun/pump-sdk": "^1.36.0",+ "@pump-fun/pump-swap-sdk": "^1.17.0",+ "@pythnetwork/hermes-client": "^3.1.0",+ "@recast-navigation/core": "^0.43.1",+ "@recast-navigation/three": "^0.43.1",+ "@sentry/node": "^10.56.0",+ "@solana-mobile/mobile-wallet-adapter-protocol": "^2.2.9",+ "@solana-mobile/mobile-wallet-adapter-protocol-web3js": "^2.2.9",+ "@solana/actions": "^0.0.2",+ "@solana/kit": "^6.9.0",+ "@solana/pay": "^0.2.6",+ "@solana/spl-token": "^0.4.14",+ "@solana/wallet-adapter-base": "^0.9.23",+ "@solana/wallet-adapter-phantom": "^0.9.24",+ "@solana/web3.js": "^1.98.4",+ "@sparticuz/chromium-min": "^148.0.0",+ "@tetsuo-ai/protocol": "^0.2.0",+ "@tetsuo-ai/sdk": "^1.4.0",+ "@three-ws/solana-agent": "file:solana-agent-sdk",+ "@upstash/qstash": "^2.11.0",+ "@upstash/ratelimit": "^2.0.5",+ "@upstash/redis": "^1.38.0",+ "@vercel/og": "^0.11.1",+ "@walletconnect/ethereum-provider": "^2.23.9",+ "@x402/axios": "^2.14.0",+ "@x402/core": "^2.14.0",+ "@x402/evm": "^2.14.0",+ "@x402/express": "^2.14.0",+ "@x402/extensions": "^2.12.0",+ "@x402/mcp": "^2.14.0",+ "@x402/svm": "^2.14.0",+ "@zauthx402/sdk": "^0.1.14",+ "agent0-sdk": "^1.5.3",+ "ai": "^6.0.197",+ "bcryptjs": "^2.4.3",+ "bn.js": "^5.2.3",+ "bs58": "^6.0.0",+ "colyseus": "^0.17.10",+ "colyseus.js": "0.16.22",+ "dat.gui": "^0.7.9",+ "ethers": "^6.16.0",+ "express": "^5.2.1",+ "fast-check": "^4.8.0",+ "gltf-validator": "^2.0.0-dev.3.10",+ "graphql": "^16.14.1",+ "helius-sdk": "^2.2.2",+ "jose": "^5.9.6",+ "lightweight-charts": "^5.2.0",+ "livekit-client": "^2.19.2",+ "livepeer": "^3.5.0",+ "meshoptimizer": "^1.1.1",+ "nipplejs": "^1.0.4",+ "node-fetch": "^3.3.2",+ "node-html-parser": "^7.1.0",+ "postprocessing": "^6.39.1",+ "puppeteer-core": "^25.1.0",+ "qrcode": "^1.5.4",+ "query-string": "^9.4.0",+ "qwen-ai-provider": "^0.1.1",+ "resend": "^6.12.4",+ "sas-lib": "^1.0.10",+ "short-uuid": "6.0.3",+ "simple-dropzone": "^0.8.3",+ "three": "latest",+ "three-mesh-bvh": "^0.9.10",+ "three-pathfinding": "^1.3.0",+ "twitter-api-v2": "^1.29.0",+ "vhtml": "^2.2.0",+ "viem": "^2.52.2",+ "wawa-lipsync": "^0.0.2",+ "ws": "^8.21.0",+ "zod": "^3.23.8"+ },+ "devDependencies": {+ "@gltf-transform/functions": "^4.4.0",+ "@playwright/test": "^1.60.0",+ "@x402/fetch": "^2.14.0",+ "ajv": "^8.20.0",+ "ajv-formats": "^3.0.1",+ "jsdom": "27.3.0",+ "knip": "^6.16.1",+ "playwright": "^1.45.1",+ "prettier": "^3.2.5",+ "sharp": "^0.34.5",+ "vite": "^7.3.2",+ "vite-plugin-node-polyfills": "^0.28.0",+ "vite-plugin-pwa": "^1.3.0",+ "vitest": "^4.1.7",+ "workbox-build": "^7.4.0",+ "workbox-window": "^7.4.0"+ }}diff --git a/pages/a-edit.html b/pages/a-edit.htmlindex 295895945..7117885e6 100644--- a/pages/a-edit.html+++ b/pages/a-edit.html@@ -18,6 +18,8 @@<scripttype="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>@@ -201,7 +203,10 @@font-weight: 500;cursor: pointer;border: 1px solid transparent;- transition: background 0.15s, border-color 0.15s, color 0.15s;+ transition:+ background 0.15s,+ border-color 0.15s,+ color 0.15s;}.ce-btn:disabled {@@ -242,10 +247,10 @@text-align: center;}</style>- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/footer.css" />- <link rel="stylesheet" href="/mobile.css" />- <script defer src="/footer-newsletter.js"></script>+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/footer.css" />+ <link rel="stylesheet" href="/mobile.css" />+ <script defer src="/footer-newsletter.js"></script></head><body><header><div id="nav-container"></div></header>@@ -284,9 +289,9 @@});}</script>-+<div id="footer-container"></div><script src="/footer.js"></script>- <script src="/brand.js" defer></script>-</body>+ <script src="/brand.js" defer></script>+ </body></html>diff --git a/pages/agent-detail.html b/pages/agent-detail.htmlindex 6c979a01d..ccea1c120 100644--- a/pages/agent-detail.html+++ b/pages/agent-detail.html@@ -4,19 +4,25 @@<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Agent · three.ws</title>- <meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:url" content="https://three.ws/agent" />- <meta property="og:title" content="Agent · three.ws" />- <meta property="og:description" content="Meet your 3D AI agent — voice, memory, payments, and an on-chain identity. Built on three.ws." />- <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:site" content="@trythreews" />- <meta name="twitter:title" content="Agent · three.ws" />- <meta name="twitter:description" content="Meet your 3D AI agent — voice, memory, payments, and an on-chain identity. Built on three.ws." />- <meta name="twitter:image" content="https://three.ws/og-image.png" />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/agent" />+ <meta property="og:title" content="Agent · three.ws" />+ <meta+ property="og:description"+ content="Meet your 3D AI agent — voice, memory, payments, and an on-chain identity. Built on three.ws."+ />+ <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:site" content="@trythreews" />+ <meta name="twitter:title" content="Agent · three.ws" />+ <meta+ name="twitter:description"+ content="Meet your 3D AI agent — voice, memory, payments, and an on-chain identity. Built on three.ws."+ />+ <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" />@@ -27,7 +33,11 @@<link rel="stylesheet" href="/fonts/fonts.css" /><link rel="stylesheet" href="/src/agent-detail.css" /><link rel="stylesheet" href="/src/pump/launch-token-modal.css" />- <script src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js"></script>+ <script+ src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js"+ integrity="sha384-Dr98ddmUw2QkdCarNQ+OL7xLty7cSxgR0T7v1tq4UErS/qLV0132sBYTolRAFuOV"+ crossorigin="anonymous"+ ></script><style>.ad-main.loading .ad-hero-avatar,.ad-main.loading .ad-hero-body > *,@@ -58,8 +68,12 @@}@keyframes skeleton-shimmer {- 0% { background-position: 200% 0; }- 100% { background-position: -200% 0; }+ 0% {+ background-position: 200% 0;+ }+ 100% {+ background-position: -200% 0;+ }}.ad-main.loading .ad-hero-avatar {@@ -80,11 +94,19 @@@media (prefers-reduced-motion: reduce) {.skeleton,- .ad-main.loading .ad-hero-avatar { animation: none; }+ .ad-main.loading .ad-hero-avatar {+ animation: none;+ }+ }+ .ad-main.loading #ad-name-skeleton {+ display: block;+ }+ .ad-main.loading #ad-meta-skeleton {+ display: block;+ }+ .ad-main.loading #ad-desc-skeleton {+ display: block;}- .ad-main.loading #ad-name-skeleton { display: block; }- .ad-main.loading #ad-meta-skeleton { display: block; }- .ad-main.loading #ad-desc-skeleton { display: block; }.ad-main.loading .ad-card .skeleton-row {display: flex;@@ -99,12 +121,16 @@.ad-main.loading .ad-card .skeleton-text-short {width: 30%;}-</style>- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/footer.css" />- <script defer src="/footer-newsletter.js"></script>- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/footer.css" />+ <script defer src="/footer-newsletter.js"></script>+ <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></head><body><header><div id="nav-container"></div></header>@@ -115,14 +141,18 @@<div class="ad-brand">three.ws</div><nav class="ad-nav"><a href="/">Home</a>- <a class="active" href="/marketplace">Agents <span class="ad-beta">BETA</span></a>+ <a class="active" href="/marketplace"+ >Agents <span class="ad-beta">BETA</span></a+ ><a href="/discover">Discover</a><a href="/create">Create</a><a href="/docs">Docs</a></nav><div class="ad-side-foot"><a href="https://x.com/trythreews" target="_blank" rel="noopener">X</a>- <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a>+ <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener"+ >GitHub</a+ ></div></aside>@@ -131,7 +161,9 @@<input class="ad-search" placeholder="Search agents…" /><div class="ad-actions"><a class="ad-btn" href="/create">Create Agent</a>- <button id="connect-wallet-btn" class="ad-btn ad-btn-primary">Connect Wallet</button>+ <button id="connect-wallet-btn" class="ad-btn ad-btn-primary">+ Connect Wallet+ </button></div></div>@@ -145,26 +177,51 @@<div class="ad-hero-body"><div class="ad-hero-title"><h1 id="ad-name"></h1>- <div id="ad-name-skeleton" class="skeleton" style="width: 200px; height: 36px; display: none;"></div>+ <div+ id="ad-name-skeleton"+ class="skeleton"+ style="width: 200px; height: 36px; display: none"+ ></div><span class="ad-status" id="ad-status">Active</span></div><div class="ad-hero-meta"><span id="ad-id-short" class="ad-mono"></span>- <button class="ad-copy" data-copy-target="ad-id-short" aria-label="Copy">⧉</button>+ <button+ class="ad-copy"+ data-copy-target="ad-id-short"+ aria-label="Copy"+ >+ ⧉+ </button><span class="ad-dot">·</span><span id="ad-asset-kind">Core Asset</span></div><div class="ad-market-meta" id="ad-market-meta" hidden>- <button type="button" id="d-author" class="ad-author-btn" aria-label="View creator profile">—</button>+ <button+ type="button"+ id="d-author"+ class="ad-author-btn"+ aria-label="View creator profile"+ >+ —+ </button><span class="ad-dot">·</span><span id="ad-published"></span><span id="ad-category" class="ad-cat-pill"></span><span id="ad-views" class="ad-stat-pill"></span><span id="ad-forks-pill" class="ad-stat-pill" hidden></span></div>- <div id="ad-meta-skeleton" class="skeleton" style="width: 150px; height: 16px; margin-top: 8px; display: none;"></div>+ <div+ id="ad-meta-skeleton"+ class="skeleton"+ style="width: 150px; height: 16px; margin-top: 8px; display: none"+ ></div><p class="ad-hero-desc" id="ad-desc"></p>- <div id="ad-desc-skeleton" class="skeleton" style="width: 80%; height: 48px; margin-top: 8px; display: none;"></div>+ <div+ id="ad-desc-skeleton"+ class="skeleton"+ style="width: 80%; height: 48px; margin-top: 8px; display: none"+ ></div><div class="ad-hero-trust" id="ad-trust-pills"></div><div class="ad-hero-actions"><a@@ -173,7 +230,24 @@href="/play"aria-label="See this agent's 3D avatar in the three.ws world">- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="margin-right:6px"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ style="margin-right: 6px"+ >+ <path+ d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"+ />+ <polyline points="3.27 6.96 12 12.01 20.73 6.96" />+ <line x1="12" y1="22.08" x2="12" y2="12" />+ </svg>See in 3D</a><button@@ -181,15 +255,43 @@id="ad-share-btn"class="ad-btn"aria-label="Share this agent"- style="display:none"+ style="display: none">- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" style="margin-right:6px"><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>+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ style="margin-right: 6px"+ >+ <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><span class="ad-market-actions" id="ad-market-actions" hidden>- <button type="button" id="ad-fork" class="ad-btn ad-btn-primary">⑂ Fork & Chat</button>- <button type="button" id="ad-bookmark" class="ad-btn" aria-pressed="false">☆ Save</button>- <button type="button" id="ad-export-json" class="ad-btn">↓ Export JSON</button>+ <button type="button" id="ad-fork" class="ad-btn ad-btn-primary">+ ⑂ Fork & Chat+ </button>+ <button+ type="button"+ id="ad-bookmark"+ class="ad-btn"+ aria-pressed="false"+ >+ ☆ Save+ </button>+ <button type="button" id="ad-export-json" class="ad-btn">+ ↓ Export JSON+ </button></span></div></div>@@ -219,7 +321,9 @@maxlength="2000"required/>- <button type="submit" class="ad-btn ad-btn-primary" id="d-preview-send">Send</button>+ <button type="submit" class="ad-btn ad-btn-primary" id="d-preview-send">+ Send+ </button></form><div class="ad-preview-footer" id="d-preview-footer"></div></section>@@ -250,23 +354,26 @@</div><div class="ad-row"><span class="ad-mono" id="ad-holdings-addr"></span>- <button class="ad-copy" data-copy-target="ad-holdings-addr" aria-label="Copy">⧉</button>+ <button+ class="ad-copy"+ data-copy-target="ad-holdings-addr"+ aria-label="Copy"+ >+ ⧉+ </button></div><div class="ad-balance"><span id="ad-holdings-sol">0</span> SOL</div>- <div class="flex space-x-2 mt-4 justify-start" id="ad-holdings-actions">- <button id="receive-btn" class="ad-btn">- Receive- </button>- <button id="withdraw-btn" class="ad-btn">- Withdraw- </button>- <button id="swap-btn" class="ad-btn">- Swap- </button>- </div>- <div id="qr-code-container" class="hidden mt-4 p-4 bg-white rounded-lg shadow-md inline-block">- <canvas id="qr-code"></canvas>- </div>+ <div class="flex space-x-2 mt-4 justify-start" id="ad-holdings-actions">+ <button id="receive-btn" class="ad-btn">Receive</button>+ <button id="withdraw-btn" class="ad-btn">Withdraw</button>+ <button id="swap-btn" class="ad-btn">Swap</button>+ </div>+ <div+ id="qr-code-container"+ class="hidden mt-4 p-4 bg-white rounded-lg shadow-md inline-block"+ >+ <canvas id="qr-code"></canvas>+ </div></section><section class="ad-card">@@ -274,7 +381,9 @@<span class="ad-bullet ad-bullet-amber"></span><h2>AGENT TOKEN</h2></div>- <div id="ad-token-body" class="ad-muted">No agent token linked for this agent yet.</div>+ <div id="ad-token-body" class="ad-muted">+ No agent token linked for this agent yet.+ </div></section><section class="ad-card">@@ -312,17 +421,17 @@<span class="ad-muted">Registry</span><span class="ad-trust-pills" id="ad-registries"></span></div>- <div class="ad-row ad-row-split" id="ad-sns-row" style="display:none">+ <div class="ad-row ad-row-split" id="ad-sns-row" style="display: none"><span class="ad-muted">SNS</span><span class="ad-mono" id="ad-sns"></span></div>- <div class="ad-row ad-row-split" id="ad-voice-row" style="display:none">+ <div class="ad-row ad-row-split" id="ad-voice-row" style="display: none"><span class="ad-muted">Voice</span><span id="ad-voice"></span></div></section>- <section class="ad-card" id="ad-reputation-card" style="display:none">+ <section class="ad-card" id="ad-reputation-card" style="display: none"><div class="ad-card-head"><span class="ad-bullet ad-bullet-amber"></span><h2>REPUTATION</h2>@@ -335,13 +444,13 @@<span class="ad-muted">Feedback count</span><span id="ad-rep-count">0</span></div>- <div class="ad-row ad-row-split" id="ad-rep-stake-row" style="display:none">+ <div class="ad-row ad-row-split" id="ad-rep-stake-row" style="display: none"><span class="ad-muted">Total stake</span><span id="ad-rep-stake"></span></div></section>- <section class="ad-card" id="ad-actions-card" style="display:none">+ <section class="ad-card" id="ad-actions-card" style="display: none"><div class="ad-card-head"><span class="ad-bullet ad-bullet-green"></span><h2>RECENT ACTIONS</h2>@@ -350,7 +459,7 @@<div id="ad-actions-list"></div></section>- <section class="ad-card" id="ad-memory-card" style="display:none">+ <section class="ad-card" id="ad-memory-card" style="display: none"><div class="ad-card-head"><span class="ad-bullet"></span><h2>MEMORY</h2>@@ -359,7 +468,7 @@<div id="ad-memory-list"></div></section>- <section class="ad-card" id="ad-strategy-card" style="display:none">+ <section class="ad-card" id="ad-strategy-card" style="display: none"><div class="ad-card-head"><span class="ad-bullet ad-bullet-dim"></span><h2>STRATEGY</h2>@@ -367,7 +476,7 @@<pre class="ad-raw" id="ad-strategy"></pre></section>- <section class="ad-card" id="ad-embed-policy-card" style="display:none">+ <section class="ad-card" id="ad-embed-policy-card" style="display: none"><div class="ad-card-head"><span class="ad-bullet ad-bullet-muted"></span><h2>EMBED POLICY</h2>@@ -379,7 +488,11 @@<div class="ad-card-head"><span class="ad-bullet ad-bullet-amber"></span><h2 id="ad-reviews-heading">REVIEWS</h2>- <span class="ad-pill ad-pill-muted" id="ad-reviews-count" aria-live="polite"></span>+ <span+ class="ad-pill ad-pill-muted"+ id="ad-reviews-count"+ aria-live="polite"+ ></span></div><div id="ad-reviews-body" aria-live="polite"><div class="ad-reviews-skeleton" aria-hidden="true">@@ -407,17 +520,34 @@<span class="ad-bullet ad-bullet-muted"></span><h2>EMBED THIS AGENT</h2></div>- <p class="ad-embed-lede">Drop the agent anywhere — as a web component, iframe, or direct link.</p>+ <p class="ad-embed-lede">+ Drop the agent anywhere — as a web component, iframe, or direct link.+ </p><div class="ad-embed-section">- <div class="ad-embed-label"><span>Web component</span><button class="ad-embed-copy" type="button" data-embed="wc">Copy</button></div>+ <div class="ad-embed-label">+ <span>Web component</span+ ><button class="ad-embed-copy" type="button" data-embed="wc">+ Copy+ </button>+ </div><pre class="ad-embed-code" id="ad-embed-wc"></pre></div><div class="ad-embed-section">- <div class="ad-embed-label"><span>Iframe</span><button class="ad-embed-copy" type="button" data-embed="iframe">Copy</button></div>+ <div class="ad-embed-label">+ <span>Iframe</span+ ><button class="ad-embed-copy" type="button" data-embed="iframe">+ Copy+ </button>+ </div><pre class="ad-embed-code" id="ad-embed-iframe"></pre></div><div class="ad-embed-section">- <div class="ad-embed-label"><span>Direct link</span><button class="ad-embed-copy" type="button" data-embed="link">Copy</button></div>+ <div class="ad-embed-label">+ <span>Direct link</span+ ><button class="ad-embed-copy" type="button" data-embed="link">+ Copy+ </button>+ </div><pre class="ad-embed-code" id="ad-embed-link"></pre></div></section>@@ -452,28 +582,54 @@<h2>BLOCKCHAIN DETAILS</h2></div><div id="ad-onchain"></div>- <div class="ad-row ad-row-split"><span class="ad-muted">Active</span><span id="ad-active">true</span></div>- <div class="ad-row ad-row-split"><span class="ad-muted">Services</span><span id="ad-svc-count2">0</span></div>- <div class="ad-row ad-row-split"><span class="ad-muted">Supported Trust</span><span class="ad-trust-pills" id="ad-supported-trust"></span></div>- <div class="ad-row ad-row-split"><span class="ad-muted">Pay-per-call Support</span><span id="ad-x402">No</span></div>+ <div class="ad-row ad-row-split">+ <span class="ad-muted">Active</span><span id="ad-active">true</span>+ </div>+ <div class="ad-row ad-row-split">+ <span class="ad-muted">Services</span><span id="ad-svc-count2">0</span>+ </div>+ <div class="ad-row ad-row-split">+ <span class="ad-muted">Supported Trust</span+ ><span class="ad-trust-pills" id="ad-supported-trust"></span>+ </div>+ <div class="ad-row ad-row-split">+ <span class="ad-muted">Pay-per-call Support</span+ ><span id="ad-x402">No</span>+ </div><div class="ad-sub">PROTOCOLS</div><div class="ad-protocols" id="ad-protocols"></div><div class="ad-cta-row">- <a class="ad-cta" id="ad-explorer" target="_blank" rel="noopener">View on Explorer ↗</a>- <a class="ad-cta" id="ad-trade" target="_blank" rel="noopener">Trade on Magic Eden ↗</a>+ <a class="ad-cta" id="ad-explorer" target="_blank" rel="noopener"+ >View on Explorer ↗</a+ >+ <a class="ad-cta" id="ad-trade" target="_blank" rel="noopener"+ >Trade on Magic Eden ↗</a+ ></div></section><footer class="ad-foot"><span>© 2026 three.ws</span>- <span><a href="/terms">Terms</a> · <a href="/privacy">Privacy</a> · <a href="/content-policy">Content Policy</a></span>+ <span+ ><a href="/terms">Terms</a> · <a href="/privacy">Privacy</a> ·+ <a href="/content-policy">Content Policy</a></span+ ></footer></main></div>- <div class="creator-modal-overlay" id="creator-modal-overlay" hidden aria-modal="true" role="dialog" aria-labelledby="creator-modal-title">+ <div+ class="creator-modal-overlay"+ id="creator-modal-overlay"+ hidden+ aria-modal="true"+ role="dialog"+ aria-labelledby="creator-modal-title"+ ><div class="creator-modal" role="document">- <button class="creator-modal-close" id="creator-modal-close" aria-label="Close">×</button>+ <button class="creator-modal-close" id="creator-modal-close" aria-label="Close">+ ×+ </button><header class="creator-modal-head"><div class="creator-modal-avatar" id="creator-modal-avatar"></div><div class="creator-modal-meta">@@ -485,12 +641,20 @@</header><div class="creator-modal-body"><section>- <h3 class="creator-modal-sectiontitle">Published agents <span id="creator-agents-count" class="muted"></span></h3>- <div class="creator-modal-grid" id="creator-agents-grid"><div class="market-empty">Loading…</div></div>+ <h3 class="creator-modal-sectiontitle">+ Published agents <span id="creator-agents-count" class="muted"></span>+ </h3>+ <div class="creator-modal-grid" id="creator-agents-grid">+ <div class="market-empty">Loading…</div>+ </div></section><section>- <h3 class="creator-modal-sectiontitle">Public avatars <span id="creator-avatars-count" class="muted"></span></h3>- <div class="creator-modal-grid" id="creator-avatars-grid"><div class="market-empty">Loading…</div></div>+ <h3 class="creator-modal-sectiontitle">+ Public avatars <span id="creator-avatars-count" class="muted"></span>+ </h3>+ <div class="creator-modal-grid" id="creator-avatars-grid">+ <div class="market-empty">Loading…</div>+ </div></section></div></div>@@ -500,5 +664,5 @@<script src="/brand.js" defer></script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/ar.html b/pages/ar.htmlindex 821f8c481..3aaa2b930 100644--- a/pages/ar.html+++ b/pages/ar.html@@ -19,28 +19,37 @@<scripttype="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><script type="module" src="/src/ar-page.js"></script><style>:root {- --bg: #000000;- --bg2: #0a0a0a;- --text: #e8e8e8;- --text-2: #888888;- --text-3: #555555;- --accent: #ffffff;+ --bg: #000000;+ --bg2: #0a0a0a;+ --text: #e8e8e8;+ --text-2: #888888;+ --text-3: #555555;+ --accent: #ffffff;--accent-2: #ffffff;- --panel: rgba(255,255,255,0.04);- --border: rgba(255,255,255,0.08);- --radius: 14px;+ --panel: rgba(255, 255, 255, 0.04);+ --border: rgba(255, 255, 255, 0.08);+ --radius: 14px;}- *, *::before, *::after { box-sizing: border-box; }+ *,+ *::before,+ *::after {+ box-sizing: border-box;+ }- html, body {- margin: 0; padding: 0;- width: 100%; height: 100%;+ html,+ body {+ margin: 0;+ padding: 0;+ width: 100%;+ height: 100%;overflow: hidden;background: var(--bg);color: var(--text);@@ -60,9 +69,21 @@position: absolute;inset: 0;background:- radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,0.03) 0%, transparent 65%),- radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255,255,255,0.02) 0%, transparent 60%),- radial-gradient(ellipse 50% 40% at 20% 70%, rgba(255,255,255,0.02) 0%, transparent 55%);+ radial-gradient(+ ellipse 80% 60% at 50% 0%,+ rgba(255, 255, 255, 0.03) 0%,+ transparent 65%+ ),+ radial-gradient(+ ellipse 60% 50% at 80% 80%,+ rgba(255, 255, 255, 0.02) 0%,+ transparent 60%+ ),+ radial-gradient(+ ellipse 50% 40% at 20% 70%,+ rgba(255, 255, 255, 0.02) 0%,+ transparent 55%+ );}/* ── Layout shell ────────────────────────────── */@@ -90,7 +111,7 @@padding-right: 16px;padding-top: calc(env(safe-area-inset-top, 0px) + 14px);padding-bottom: 14px;- background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, transparent 100%);backdrop-filter: blur(0px);}.ar-back {@@ -104,8 +125,12 @@transition: color 0.15s;padding: 6px 0;}- .ar-back:hover { color: var(--text); }- .ar-back svg { flex-shrink: 0; }+ .ar-back:hover {+ color: var(--text);+ }+ .ar-back svg {+ flex-shrink: 0;+ }.ar-topbar-center {position: absolute;@@ -123,8 +148,8 @@letter-spacing: 0.08em;text-transform: uppercase;color: var(--accent);- background: rgba(255,255,255,0.08);- border: 1px solid rgba(255,255,255,0.2);+ background: rgba(255, 255, 255, 0.08);+ border: 1px solid rgba(255, 255, 255, 0.2);border-radius: 999px;padding: 4px 10px;}@@ -136,8 +161,15 @@animation: ar-pulse 2s ease-in-out infinite;}@keyframes ar-pulse {- 0%, 100% { opacity: 1; transform: scale(1); }- 50% { opacity: 0.5; transform: scale(0.75); }+ 0%,+ 100% {+ opacity: 1;+ transform: scale(1);+ }+ 50% {+ opacity: 0.5;+ transform: scale(0.75);+ }}.ar-share-btn {@@ -150,9 +182,14 @@font-family: inherit;cursor: pointer;padding: 6px 14px;- transition: border-color 0.15s, color 0.15s;+ transition:+ border-color 0.15s,+ color 0.15s;+ }+ .ar-share-btn:hover {+ border-color: var(--text-3);+ color: var(--text);}- .ar-share-btn:hover { border-color: var(--text-3); color: var(--text); }/* ── Model viewer ────────────────────────────── */model-viewer {@@ -176,14 +213,21 @@z-index: 10;padding: 0 20px;padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);- background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);+ background: linear-gradient(+ to top,+ rgba(0, 0, 0, 0.92) 0%,+ rgba(0, 0, 0, 0.6) 60%,+ transparent 100%+ );display: flex;flex-direction: column;align-items: center;gap: 10px;pointer-events: none;}- .ar-bottom > * { pointer-events: auto; }+ .ar-bottom > * {+ pointer-events: auto;+ }.ar-avatar-name {font-size: 22px;@@ -212,17 +256,23 @@align-items: center;gap: 6px;}- .ar-status.is-error { color: #f87171; }+ .ar-status.is-error {+ color: #f87171;+ }.ar-status-spinner {width: 13px;height: 13px;border-radius: 50%;- border: 2px solid rgba(255,255,255,0.25);+ border: 2px solid rgba(255, 255, 255, 0.25);border-top-color: var(--accent-2);animation: ar-spin 0.7s linear infinite;flex-shrink: 0;}- @keyframes ar-spin { to { transform: rotate(360deg); } }+ @keyframes ar-spin {+ to {+ transform: rotate(360deg);+ }+ }.ar-launch-btn {width: 100%;@@ -241,8 +291,13 @@align-items: center;justify-content: center;gap: 10px;- transition: transform 0.12s, box-shadow 0.2s, opacity 0.15s;- box-shadow: 0 8px 32px -8px rgba(255,255,255,0.2), 0 0 0 1px rgba(255,255,255,0.08) inset;+ transition:+ transform 0.12s,+ box-shadow 0.2s,+ opacity 0.15s;+ box-shadow:+ 0 8px 32px -8px rgba(255, 255, 255, 0.2),+ 0 0 0 1px rgba(255, 255, 255, 0.08) inset;position: relative;overflow: hidden;}@@ -250,19 +305,29 @@content: '';position: absolute;inset: 0;- background: linear-gradient(to bottom, rgba(255,255,255,0.12) 0%, transparent 50%);+ background: linear-gradient(+ to bottom,+ rgba(255, 255, 255, 0.12) 0%,+ transparent 50%+ );pointer-events: none;}.ar-launch-btn:hover:not(:disabled) {transform: translateY(-2px);- box-shadow: 0 14px 40px -8px rgba(255,255,255,0.25), 0 0 0 1px rgba(255,255,255,0.1) inset;+ box-shadow:+ 0 14px 40px -8px rgba(255, 255, 255, 0.25),+ 0 0 0 1px rgba(255, 255, 255, 0.1) inset;+ }+ .ar-launch-btn:active:not(:disabled) {+ transform: translateY(0);}- .ar-launch-btn:active:not(:disabled) { transform: translateY(0); }.ar-launch-btn:disabled {opacity: 0.45;cursor: not-allowed;}- .ar-launch-btn svg { flex-shrink: 0; }+ .ar-launch-btn svg {+ flex-shrink: 0;+ }/* ── Loading / error fallback ─────────────────── */.ar-error {@@ -301,7 +366,19 @@<header class="ar-topbar"><a class="ar-back" id="ar-back-link" href="/marketplace">- <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 18 9 12 15 6"/></svg>+ <svg+ width="18"+ height="18"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <polyline points="15 18 9 12 15 6" />+ </svg>Back</a><div class="ar-topbar-center" id="view-switch-slot">@@ -310,7 +387,9 @@AR Ready</span></div>- <button class="ar-share-btn" id="ar-share-btn" type="button" aria-label="Share">Share</button>+ <button class="ar-share-btn" id="ar-share-btn" type="button" aria-label="Share">+ Share+ </button></header><footer class="ar-bottom">@@ -320,14 +399,32 @@<span class="ar-status-spinner" aria-hidden="true"></span><span id="ar-status-text"></span></p>- <button class="ar-launch-btn" id="ar-launch-btn" type="button" disabled aria-busy="true">- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/>+ <button+ class="ar-launch-btn"+ id="ar-launch-btn"+ type="button"+ disabled+ aria-busy="true"+ >+ <svg+ width="20"+ height="20"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <path+ d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"+ /></svg>Place in your space</button></footer></div><script src="/brand.js" defer></script>-</body>+ </body></html>diff --git a/pages/avatar-artifact.html b/pages/avatar-artifact.htmlindex 8a4eaaa5c..08187cefc 100644--- a/pages/avatar-artifact.html+++ b/pages/avatar-artifact.html@@ -1,306 +1,399 @@-<!DOCTYPE html>+<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <title>Avatar Viewer — three.ws</title>+ <head>+ <meta charset="utf-8" />+ <title>Avatar Viewer — three.ws</title><link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" /><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /><link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/site.webmanifest" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <meta name="theme-color" content="#080808" />- <style>- * { margin: 0; padding: 0; box-sizing: border-box; }- body { background: #080808; overflow: hidden; }- canvas { display: block; }- </style>-- <meta name="description" content="Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page.">- <link rel="canonical" href="https://three.ws/avatar-artifact">- <meta property="og:type" content="website">- <meta property="og:site_name" content="three.ws">- <meta property="og:title" content="Avatar Artifact · three.ws">- <meta property="og:description" content="Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page.">- <meta property="og:url" content="https://three.ws/avatar-artifact">- <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="Avatar Artifact · three.ws">- <meta name="twitter:description" content="Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page.">- <meta name="twitter:image" content="https://three.ws/og-image.png">- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Avatar Artifact","description":"Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page.","url":"https://three.ws/avatar-artifact","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>-<body>-<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>-<script>-const W = window.innerWidth, H = window.innerHeight;-const scene = new THREE.Scene();-const camera = new THREE.PerspectiveCamera(42, W / H, 0.1, 100);-camera.position.set(0, 1.6, 4.2);-camera.lookAt(0, 1.6, 0);--const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });-renderer.setSize(W, H);-renderer.setPixelRatio(Math.min(devicePixelRatio, 2));-renderer.shadowMap.enabled = true;-document.body.appendChild(renderer.domElement);--// Lights-scene.add(new THREE.AmbientLight(0x2a2a5a, 1.2));--const key = new THREE.DirectionalLight(0x99aaff, 2.2);-key.position.set(2, 5, 4);-key.castShadow = true;-scene.add(key);--const rim = new THREE.PointLight(0xff4488, 1.4, 10);-rim.position.set(-3, 2, -1);-scene.add(rim);--const fill = new THREE.PointLight(0x4488ff, 0.8, 8);-fill.position.set(3, 0, 2);-scene.add(fill);--// Materials-const skinMat = new THREE.MeshStandardMaterial({ color: 0x7ba3d4, roughness: 0.25, metalness: 0.05 });-const darkMat = new THREE.MeshStandardMaterial({ color: 0x0d1a2e, roughness: 0.2, metalness: 0.6 });-const irisMat = new THREE.MeshStandardMaterial({ color: 0x55aaff, roughness: 0.05, metalness: 0.3, emissive: 0x1144cc, emissiveIntensity: 0.6 });-const suitMat = new THREE.MeshStandardMaterial({ color: 0x1a2540, roughness: 0.6, metalness: 0.3 });-const glareMat = new THREE.MeshStandardMaterial({ color: 0xffffff, roughness: 0, metalness: 0, transparent: true, opacity: 0.55 });--// ─── Avatar ───────────────────────────────────────────────────────────────────-const avatar = new THREE.Group();-scene.add(avatar);--// Torso-const torsoMesh = new THREE.Mesh(new THREE.CylinderGeometry(0.38, 0.32, 1.0, 20), suitMat);-torsoMesh.position.y = 0.82;-torsoMesh.castShadow = true;-avatar.add(torsoMesh);--// Neck-const neck = new THREE.Mesh(new THREE.CylinderGeometry(0.17, 0.19, 0.28, 16), skinMat);-neck.position.y = 1.47;-avatar.add(neck);--// Head group (rotates for mouse tracking)-const headGroup = new THREE.Group();-headGroup.position.y = 1.94;-avatar.add(headGroup);--const headMesh = new THREE.Mesh(new THREE.SphereGeometry(0.52, 40, 40), skinMat);-headMesh.scale.set(1, 1.08, 0.96);-headMesh.castShadow = true;-headGroup.add(headMesh);--// Eye sockets (slight indents via dark spheres behind eyes)-function makeEye(x) {- const group = new THREE.Group();- group.position.set(x, 0.06, 0.44);-- // White- const white = new THREE.Mesh(new THREE.SphereGeometry(0.105, 20, 20), new THREE.MeshStandardMaterial({ color: 0xddeeff, roughness: 0.3, metalness: 0 }));- group.add(white);-- // Iris- const iris = new THREE.Mesh(new THREE.SphereGeometry(0.065, 16, 16), irisMat);- iris.position.z = 0.055;- group.add(iris);-- // Pupil- const pupil = new THREE.Mesh(new THREE.SphereGeometry(0.036, 12, 12), darkMat);- pupil.position.z = 0.088;- group.add(pupil);-- // Glare- const glare = new THREE.Mesh(new THREE.SphereGeometry(0.014, 8, 8), glareMat);- glare.position.set(0.022, 0.025, 0.1);- group.add(glare);-- return group;-}--const leftEyeGroup = makeEye(-0.185);-const rightEyeGroup = makeEye( 0.185);-headGroup.add(leftEyeGroup, rightEyeGroup);--// Eyelids (scale Y to blink)-function makeLid(x) {- const lid = new THREE.Mesh(- new THREE.SphereGeometry(0.112, 20, 10, 0, Math.PI * 2, 0, Math.PI * 0.5),- new THREE.MeshStandardMaterial({ color: 0x6a95c0, roughness: 0.3, side: THREE.FrontSide })- );- lid.position.set(x, 0.06, 0.43);- lid.rotation.x = Math.PI;- lid.scale.y = 0.01; // starts closed-ish (will animate open)- return lid;-}-const leftLid = makeLid(-0.185);-const rightLid = makeLid( 0.185);-headGroup.add(leftLid, rightLid);--// Eyebrows-function makeBrow(x) {- const geo = new THREE.BoxGeometry(0.16, 0.03, 0.04);- const brow = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({ color: 0x3a6090, roughness: 0.5 }));- brow.position.set(x, 0.215, 0.455);- brow.rotation.z = x > 0 ? -0.12 : 0.12;- return brow;-}-headGroup.add(makeBrow(-0.185), makeBrow(0.185));--// Nose-const noseMesh = new THREE.Mesh(new THREE.SphereGeometry(0.07, 12, 12), skinMat);-noseMesh.scale.set(0.7, 0.65, 0.8);-noseMesh.position.set(0, -0.07, 0.5);-headGroup.add(noseMesh);--// Mouth-const mouthGeo = new THREE.TorusGeometry(0.1, 0.025, 8, 20, Math.PI);-const mouth = new THREE.Mesh(mouthGeo, new THREE.MeshStandardMaterial({ color: 0x3a5a80, roughness: 0.5 }));-mouth.position.set(0, -0.2, 0.46);-mouth.rotation.z = Math.PI;-headGroup.add(mouth);--// Shoulders / arms-function makeArm(x) {- const arm = new THREE.Mesh(new THREE.CylinderGeometry(0.11, 0.09, 0.75, 14), suitMat);- arm.position.set(x, 0.85, 0);- arm.rotation.z = x > 0 ? -0.35 : 0.35;- arm.castShadow = true;- return arm;-}-avatar.add(makeArm(-0.52), makeArm(0.52));--// Shoulder pads-function makePad(x) {- const pad = new THREE.Mesh(new THREE.SphereGeometry(0.18, 16, 16), suitMat);- pad.scale.set(1, 0.7, 1);- pad.position.set(x, 1.3, 0);- return pad;-}-avatar.add(makePad(-0.52), makePad(0.52));--// Chest detail (glowing panel)-const panelMat = new THREE.MeshStandardMaterial({ color: 0x1155cc, emissive: 0x0033aa, emissiveIntensity: 1.2, roughness: 0.2 });-const panel = new THREE.Mesh(new THREE.BoxGeometry(0.22, 0.14, 0.04), panelMat);-panel.position.set(0, 0.88, 0.37);-avatar.add(panel);--// Ground plane (subtle)-const ground = new THREE.Mesh(- new THREE.CircleGeometry(3, 48),- new THREE.MeshStandardMaterial({ color: 0x0a0a20, roughness: 0.9, metalness: 0.1 })-);-ground.rotation.x = -Math.PI / 2;-ground.receiveShadow = true;-scene.add(ground);--// Fog-scene.fog = new THREE.FogExp2(0x070714, 0.06);--// Particles-const pCount = 120;-const pPos = new Float32Array(pCount * 3);-const pVel = new Float32Array(pCount);-for (let i = 0; i < pCount; i++) {- pPos[i*3] = (Math.random() - 0.5) * 8;- pPos[i*3+1] = Math.random() * 5;- pPos[i*3+2] = (Math.random() - 0.5) * 8;- pVel[i] = 0.003 + Math.random() * 0.008;-}-const pGeo = new THREE.BufferGeometry();-pGeo.setAttribute('position', new THREE.BufferAttribute(pPos, 3));-const pMat = new THREE.PointsMaterial({ color: 0x6699ff, size: 0.04, transparent: true, opacity: 0.55 });-const pts = new THREE.Points(pGeo, pMat);-scene.add(pts);--// ─── Mouse tracking ───────────────────────────────────────────────────────────-const mouse = { x: 0, y: 0 };-window.addEventListener('mousemove', e => {- mouse.x = (e.clientX / window.innerWidth - 0.5) * 2;- mouse.y = (e.clientY / window.innerHeight - 0.5) * 2;-});--// ─── Animate ──────────────────────────────────────────────────────────────────-let t = 0;-let blinkTimer = 0;-let blinkInterval = 3 + Math.random() * 3;-let blinking = false;-let blinkT = 0;--const targetHeadRot = { x: 0, y: 0 };-const currentHeadRot = { x: 0, y: 0 };--function animate() {- requestAnimationFrame(animate);- t += 0.016;-- // Breathing- const breathe = Math.sin(t * 1.15) * 0.025;- torsoMesh.scale.y = 1 + breathe;- torsoMesh.position.y = 0.82 + breathe * 0.3;-- // Chest glow pulse- panelMat.emissiveIntensity = 1.0 + Math.sin(t * 2.3) * 0.3;-- // Head follows mouse (smoothed)- targetHeadRot.y = mouse.x * 0.35;- targetHeadRot.x = -mouse.y * 0.2;- currentHeadRot.x += (targetHeadRot.x - currentHeadRot.x) * 0.06;- currentHeadRot.y += (targetHeadRot.y - currentHeadRot.y) * 0.06;- headGroup.rotation.x = currentHeadRot.x;- headGroup.rotation.y = currentHeadRot.y;-- // Idle body sway- avatar.rotation.y = Math.sin(t * 0.35) * 0.06;-- // Blink- blinkTimer += 0.016;- if (!blinking && blinkTimer > blinkInterval) {- blinking = true;- blinkT = 0;- blinkInterval = 2.5 + Math.random() * 4;- blinkTimer = 0;- }- if (blinking) {- blinkT += 0.016;- const half = 0.09;- const progress = blinkT < half- ? blinkT / half- : blinkT < half * 2 ? 1 - (blinkT - half) / half : -1;- if (progress < 0) {- leftLid.scale.y = 0.01;- rightLid.scale.y = 0.01;- blinking = false;- } else {- leftLid.scale.y = progress;- rightLid.scale.y = progress;- }- }-- // Particles drift upward- const pos = pGeo.attributes.position;- for (let i = 0; i < pCount; i++) {- pos.array[i*3+1] += pVel[i];- if (pos.array[i*3+1] > 5) pos.array[i*3+1] = 0;- }- pos.needsUpdate = true;- pts.rotation.y += 0.0006;-- renderer.render(scene, camera);-}-animate();--window.addEventListener('resize', () => {- const w = window.innerWidth, h = window.innerHeight;- camera.aspect = w / h;- camera.updateProjectionMatrix();- renderer.setSize(w, h);-});-</script>-</body>+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <meta name="theme-color" content="#080808" />+ <style>+ * {+ margin: 0;+ padding: 0;+ box-sizing: border-box;+ }+ body {+ background: #080808;+ overflow: hidden;+ }+ canvas {+ display: block;+ }+ </style>++ <meta+ name="description"+ content="Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page."+ />+ <link rel="canonical" href="https://three.ws/avatar-artifact" />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:title" content="Avatar Artifact · three.ws" />+ <meta+ property="og:description"+ content="Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page."+ />+ <meta property="og:url" content="https://three.ws/avatar-artifact" />+ <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="Avatar Artifact · three.ws" />+ <meta+ name="twitter:description"+ content="Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page."+ />+ <meta name="twitter:image" content="https://three.ws/og-image.png" />+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Avatar Artifact",+ "description": "Standalone Three.js viewer for avatar artifacts — embeddable and shareable without any wrapper page.",+ "url": "https://three.ws/avatar-artifact",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head>+ <body>+ <script+ src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"+ integrity="sha384-CI3ELBVUz9XQO+97x6nwMDPosPR5XvsxW2ua7N1Xeygeh1IxtgqtCkGfQY9WWdHu"+ crossorigin="anonymous"+ ></script>+ <script>+ const W = window.innerWidth,+ H = window.innerHeight;+ const scene = new THREE.Scene();+ const camera = new THREE.PerspectiveCamera(42, W / H, 0.1, 100);+ camera.position.set(0, 1.6, 4.2);+ camera.lookAt(0, 1.6, 0);++ const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });+ renderer.setSize(W, H);+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));+ renderer.shadowMap.enabled = true;+ document.body.appendChild(renderer.domElement);++ // Lights+ scene.add(new THREE.AmbientLight(0x2a2a5a, 1.2));++ const key = new THREE.DirectionalLight(0x99aaff, 2.2);+ key.position.set(2, 5, 4);+ key.castShadow = true;+ scene.add(key);++ const rim = new THREE.PointLight(0xff4488, 1.4, 10);+ rim.position.set(-3, 2, -1);+ scene.add(rim);++ const fill = new THREE.PointLight(0x4488ff, 0.8, 8);+ fill.position.set(3, 0, 2);+ scene.add(fill);++ // Materials+ const skinMat = new THREE.MeshStandardMaterial({+ color: 0x7ba3d4,+ roughness: 0.25,+ metalness: 0.05,+ });+ const darkMat = new THREE.MeshStandardMaterial({+ color: 0x0d1a2e,+ roughness: 0.2,+ metalness: 0.6,+ });+ const irisMat = new THREE.MeshStandardMaterial({+ color: 0x55aaff,+ roughness: 0.05,+ metalness: 0.3,+ emissive: 0x1144cc,+ emissiveIntensity: 0.6,+ });+ const suitMat = new THREE.MeshStandardMaterial({+ color: 0x1a2540,+ roughness: 0.6,+ metalness: 0.3,+ });+ const glareMat = new THREE.MeshStandardMaterial({+ color: 0xffffff,+ roughness: 0,+ metalness: 0,+ transparent: true,+ opacity: 0.55,+ });++ // ─── Avatar ───────────────────────────────────────────────────────────────────+ const avatar = new THREE.Group();+ scene.add(avatar);++ // Torso+ const torsoMesh = new THREE.Mesh(+ new THREE.CylinderGeometry(0.38, 0.32, 1.0, 20),+ suitMat,+ );+ torsoMesh.position.y = 0.82;+ torsoMesh.castShadow = true;+ avatar.add(torsoMesh);++ // Neck+ const neck = new THREE.Mesh(new THREE.CylinderGeometry(0.17, 0.19, 0.28, 16), skinMat);+ neck.position.y = 1.47;+ avatar.add(neck);++ // Head group (rotates for mouse tracking)+ const headGroup = new THREE.Group();+ headGroup.position.y = 1.94;+ avatar.add(headGroup);++ const headMesh = new THREE.Mesh(new THREE.SphereGeometry(0.52, 40, 40), skinMat);+ headMesh.scale.set(1, 1.08, 0.96);+ headMesh.castShadow = true;+ headGroup.add(headMesh);++ // Eye sockets (slight indents via dark spheres behind eyes)+ function makeEye(x) {+ const group = new THREE.Group();+ group.position.set(x, 0.06, 0.44);++ // White+ const white = new THREE.Mesh(+ new THREE.SphereGeometry(0.105, 20, 20),+ new THREE.MeshStandardMaterial({+ color: 0xddeeff,+ roughness: 0.3,+ metalness: 0,+ }),+ );+ group.add(white);++ // Iris+ const iris = new THREE.Mesh(new THREE.SphereGeometry(0.065, 16, 16), irisMat);+ iris.position.z = 0.055;+ group.add(iris);++ // Pupil+ const pupil = new THREE.Mesh(new THREE.SphereGeometry(0.036, 12, 12), darkMat);+ pupil.position.z = 0.088;+ group.add(pupil);++ // Glare+ const glare = new THREE.Mesh(new THREE.SphereGeometry(0.014, 8, 8), glareMat);+ glare.position.set(0.022, 0.025, 0.1);+ group.add(glare);++ return group;+ }++ const leftEyeGroup = makeEye(-0.185);+ const rightEyeGroup = makeEye(0.185);+ headGroup.add(leftEyeGroup, rightEyeGroup);++ // Eyelids (scale Y to blink)+ function makeLid(x) {+ const lid = new THREE.Mesh(+ new THREE.SphereGeometry(0.112, 20, 10, 0, Math.PI * 2, 0, Math.PI * 0.5),+ new THREE.MeshStandardMaterial({+ color: 0x6a95c0,+ roughness: 0.3,+ side: THREE.FrontSide,+ }),+ );+ lid.position.set(x, 0.06, 0.43);+ lid.rotation.x = Math.PI;+ lid.scale.y = 0.01; // starts closed-ish (will animate open)+ return lid;+ }+ const leftLid = makeLid(-0.185);+ const rightLid = makeLid(0.185);+ headGroup.add(leftLid, rightLid);++ // Eyebrows+ function makeBrow(x) {+ const geo = new THREE.BoxGeometry(0.16, 0.03, 0.04);+ const brow = new THREE.Mesh(+ geo,+ new THREE.MeshStandardMaterial({ color: 0x3a6090, roughness: 0.5 }),+ );+ brow.position.set(x, 0.215, 0.455);+ brow.rotation.z = x > 0 ? -0.12 : 0.12;+ return brow;+ }+ headGroup.add(makeBrow(-0.185), makeBrow(0.185));++ // Nose+ const noseMesh = new THREE.Mesh(new THREE.SphereGeometry(0.07, 12, 12), skinMat);+ noseMesh.scale.set(0.7, 0.65, 0.8);+ noseMesh.position.set(0, -0.07, 0.5);+ headGroup.add(noseMesh);++ // Mouth+ const mouthGeo = new THREE.TorusGeometry(0.1, 0.025, 8, 20, Math.PI);+ const mouth = new THREE.Mesh(+ mouthGeo,+ new THREE.MeshStandardMaterial({ color: 0x3a5a80, roughness: 0.5 }),+ );+ mouth.position.set(0, -0.2, 0.46);+ mouth.rotation.z = Math.PI;+ headGroup.add(mouth);++ // Shoulders / arms+ function makeArm(x) {+ const arm = new THREE.Mesh(+ new THREE.CylinderGeometry(0.11, 0.09, 0.75, 14),+ suitMat,+ );+ arm.position.set(x, 0.85, 0);+ arm.rotation.z = x > 0 ? -0.35 : 0.35;+ arm.castShadow = true;+ return arm;+ }+ avatar.add(makeArm(-0.52), makeArm(0.52));++ // Shoulder pads+ function makePad(x) {+ const pad = new THREE.Mesh(new THREE.SphereGeometry(0.18, 16, 16), suitMat);+ pad.scale.set(1, 0.7, 1);+ pad.position.set(x, 1.3, 0);+ return pad;+ }+ avatar.add(makePad(-0.52), makePad(0.52));++ // Chest detail (glowing panel)+ const panelMat = new THREE.MeshStandardMaterial({+ color: 0x1155cc,+ emissive: 0x0033aa,+ emissiveIntensity: 1.2,+ roughness: 0.2,+ });+ const panel = new THREE.Mesh(new THREE.BoxGeometry(0.22, 0.14, 0.04), panelMat);+ panel.position.set(0, 0.88, 0.37);+ avatar.add(panel);++ // Ground plane (subtle)+ const ground = new THREE.Mesh(+ new THREE.CircleGeometry(3, 48),+ new THREE.MeshStandardMaterial({ color: 0x0a0a20, roughness: 0.9, metalness: 0.1 }),+ );+ ground.rotation.x = -Math.PI / 2;+ ground.receiveShadow = true;+ scene.add(ground);++ // Fog+ scene.fog = new THREE.FogExp2(0x070714, 0.06);++ // Particles+ const pCount = 120;+ const pPos = new Float32Array(pCount * 3);+ const pVel = new Float32Array(pCount);+ for (let i = 0; i < pCount; i++) {+ pPos[i * 3] = (Math.random() - 0.5) * 8;+ pPos[i * 3 + 1] = Math.random() * 5;+ pPos[i * 3 + 2] = (Math.random() - 0.5) * 8;+ pVel[i] = 0.003 + Math.random() * 0.008;+ }+ const pGeo = new THREE.BufferGeometry();+ pGeo.setAttribute('position', new THREE.BufferAttribute(pPos, 3));+ const pMat = new THREE.PointsMaterial({+ color: 0x6699ff,+ size: 0.04,+ transparent: true,+ opacity: 0.55,+ });+ const pts = new THREE.Points(pGeo, pMat);+ scene.add(pts);++ // ─── Mouse tracking ───────────────────────────────────────────────────────────+ const mouse = { x: 0, y: 0 };+ window.addEventListener('mousemove', (e) => {+ mouse.x = (e.clientX / window.innerWidth - 0.5) * 2;+ mouse.y = (e.clientY / window.innerHeight - 0.5) * 2;+ });++ // ─── Animate ──────────────────────────────────────────────────────────────────+ let t = 0;+ let blinkTimer = 0;+ let blinkInterval = 3 + Math.random() * 3;+ let blinking = false;+ let blinkT = 0;++ const targetHeadRot = { x: 0, y: 0 };+ const currentHeadRot = { x: 0, y: 0 };++ function animate() {+ requestAnimationFrame(animate);+ t += 0.016;++ // Breathing+ const breathe = Math.sin(t * 1.15) * 0.025;+ torsoMesh.scale.y = 1 + breathe;+ torsoMesh.position.y = 0.82 + breathe * 0.3;++ // Chest glow pulse+ panelMat.emissiveIntensity = 1.0 + Math.sin(t * 2.3) * 0.3;++ // Head follows mouse (smoothed)+ targetHeadRot.y = mouse.x * 0.35;+ targetHeadRot.x = -mouse.y * 0.2;+ currentHeadRot.x += (targetHeadRot.x - currentHeadRot.x) * 0.06;+ currentHeadRot.y += (targetHeadRot.y - currentHeadRot.y) * 0.06;+ headGroup.rotation.x = currentHeadRot.x;+ headGroup.rotation.y = currentHeadRot.y;++ // Idle body sway+ avatar.rotation.y = Math.sin(t * 0.35) * 0.06;++ // Blink+ blinkTimer += 0.016;+ if (!blinking && blinkTimer > blinkInterval) {+ blinking = true;+ blinkT = 0;+ blinkInterval = 2.5 + Math.random() * 4;+ blinkTimer = 0;+ }+ if (blinking) {+ blinkT += 0.016;+ const half = 0.09;+ const progress =+ blinkT < half+ ? blinkT / half+ : blinkT < half * 2+ ? 1 - (blinkT - half) / half+ : -1;+ if (progress < 0) {+ leftLid.scale.y = 0.01;+ rightLid.scale.y = 0.01;+ blinking = false;+ } else {+ leftLid.scale.y = progress;+ rightLid.scale.y = progress;+ }+ }++ // Particles drift upward+ const pos = pGeo.attributes.position;+ for (let i = 0; i < pCount; i++) {+ pos.array[i * 3 + 1] += pVel[i];+ if (pos.array[i * 3 + 1] > 5) pos.array[i * 3 + 1] = 0;+ }+ pos.needsUpdate = true;+ pts.rotation.y += 0.0006;++ renderer.render(scene, camera);+ }+ animate();++ window.addEventListener('resize', () => {+ const w = window.innerWidth,+ h = window.innerHeight;+ camera.aspect = w / h;+ camera.updateProjectionMatrix();+ renderer.setSize(w, h);+ });+ </script>+ </body></html>diff --git a/pages/avatar-page.html b/pages/avatar-page.htmlindex 0dabc7507..64b9b2a2c 100644--- a/pages/avatar-page.html+++ b/pages/avatar-page.html@@ -20,6 +20,8 @@<scripttype="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><meta property="og:type" content="website" />@@ -49,7 +51,8 @@--radius: 14px;}- html, body {+ html,+ body {margin: 0;background: var(--bg);color: var(--text);@@ -61,7 +64,9 @@flex-direction: column;min-height: 100vh;}- a { color: inherit; }+ a {+ color: inherit;+ }/* ── Top action bar ────────────────────────────────── */.av-actionbar {@@ -85,16 +90,24 @@text-decoration: none;font-size: 13px;}- .av-back:hover { color: var(--text); }+ .av-back:hover {+ color: var(--text);+ }.av-actionbar-center {flex: 1 1 auto;display: flex;justify-content: center;min-width: 0;}- .av-actionbar-center:empty { display: none; }+ .av-actionbar-center:empty {+ display: none;+ }@media (max-width: 600px) {- .av-actionbar-center { order: 3; flex-basis: 100%; margin-top: 10px; }+ .av-actionbar-center {+ order: 3;+ flex-basis: 100%;+ margin-top: 10px;+ }}.av-share-group {display: inline-flex;@@ -109,9 +122,14 @@cursor: pointer;font-size: 12px;font-family: inherit;- transition: color 0.15s, border-color 0.15s;+ transition:+ color 0.15s,+ border-color 0.15s;+ }+ .av-share-btn:hover {+ color: var(--text);+ border-color: var(--text-3);}- .av-share-btn:hover { color: var(--text); border-color: var(--text-3); }.av-share-btn.copied {color: var(--success);border-color: var(--success);@@ -167,9 +185,21 @@color: var(--text-2);flex-wrap: wrap;}- .av-meta-item { display: flex; flex-direction: column; gap: 1px; }- .av-meta-key { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }- .av-meta-val { color: var(--text); font-weight: 500; }+ .av-meta-item {+ display: flex;+ flex-direction: column;+ gap: 1px;+ }+ .av-meta-key {+ font-size: 10px;+ text-transform: uppercase;+ letter-spacing: 0.06em;+ color: var(--text-3);+ }+ .av-meta-val {+ color: var(--text);+ font-weight: 500;+ }/* ── Sidebar (right column) ───────────────────────── */.av-side {@@ -205,7 +235,9 @@letter-spacing: 0;cursor: help;}- .av-eyebrow-help:hover { color: var(--text); }+ .av-eyebrow-help:hover {+ color: var(--text);+ }.av-source-tag {font-size: 11px;color: var(--text-3);@@ -227,8 +259,13 @@color: var(--text-3);margin: 0 0 10px;}- .av-by a { color: var(--accent-2); text-decoration: none; }- .av-by a:hover { color: var(--text); }+ .av-by a {+ color: var(--accent-2);+ text-decoration: none;+ }+ .av-by a:hover {+ color: var(--text);+ }.av-tags {display: flex;flex-wrap: wrap;@@ -267,7 +304,9 @@align-items: center;justify-content: center;gap: 10px;- transition: transform 0.1s, box-shadow 0.2s;+ transition:+ transform 0.1s,+ box-shadow 0.2s;box-shadow: 0 6px 24px -8px rgba(255, 255, 255, 0.45);}.av-cta-talk:hover {@@ -276,15 +315,21 @@}.av-cta-talk-dot {display: inline-block;- width: 8px; height: 8px;+ width: 8px;+ height: 8px;border-radius: 999px;background: #ef4444;box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);animation: av-cta-talk-pulse 2s ease-in-out infinite;}@keyframes av-cta-talk-pulse {- 0%, 100% { transform: scale(1); }- 50% { transform: scale(1.25); }+ 0%,+ 100% {+ transform: scale(1);+ }+ 50% {+ transform: scale(1.25);+ }}.av-cta-row {display: grid;@@ -312,7 +357,9 @@text-decoration: none;transition: transform 0.1s;}- .av-cta:hover { transform: translateY(-1px); }+ .av-cta:hover {+ transform: translateY(-1px);+ }.av-cta-sec {background: transparent;border: 1px solid var(--border-2);@@ -325,9 +372,13 @@cursor: pointer;text-align: center;text-decoration: none;- transition: border-color 0.15s, color 0.15s;+ transition:+ border-color 0.15s,+ color 0.15s;+ }+ .av-cta-sec:hover {+ border-color: var(--text-2);}- .av-cta-sec:hover { border-color: var(--text-2); }/* ── AR row ──────────────────────────────────── */.av-ar-row {@@ -340,8 +391,12 @@align-items: center;gap: 6px;padding: 9px 18px;- background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.10) 100%);- border: 1px solid rgba(255,255,255,0.28);+ background: linear-gradient(+ 135deg,+ rgba(255, 255, 255, 0.1) 0%,+ rgba(255, 255, 255, 0.1) 100%+ );+ border: 1px solid rgba(255, 255, 255, 0.28);border-radius: 999px;color: var(--accent);font-size: 13px;@@ -349,13 +404,20 @@font-family: inherit;text-decoration: none;cursor: pointer;- transition: background 0.15s, border-color 0.15s, box-shadow 0.2s;+ transition:+ background 0.15s,+ border-color 0.15s,+ box-shadow 0.2s;letter-spacing: 0.01em;}.av-ar-btn:hover {- background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.18) 100%);- border-color: rgba(255,255,255,0.5);- box-shadow: 0 0 18px -4px rgba(255,255,255,0.3);+ background: linear-gradient(+ 135deg,+ rgba(255, 255, 255, 0.18) 0%,+ rgba(255, 255, 255, 0.18) 100%+ );+ border-color: rgba(255, 255, 255, 0.5);+ box-shadow: 0 0 18px -4px rgba(255, 255, 255, 0.3);}/* ── Owner actions row ───────────────────────── */@@ -379,21 +441,26 @@font-family: inherit;cursor: pointer;text-decoration: none;- transition: border-color 0.15s, color 0.15s, background 0.15s;+ transition:+ border-color 0.15s,+ color 0.15s,+ background 0.15s;white-space: nowrap;}.av-owner-btn:hover {border-color: var(--text-3);color: var(--text);- background: rgba(255,255,255,0.04);+ background: rgba(255, 255, 255, 0.04);+ }+ .av-owner-btn svg {+ flex-shrink: 0;}- .av-owner-btn svg { flex-shrink: 0; }/* ── Pump.fun launch modal ────────────────────── */.av-pump-backdrop {position: fixed;inset: 0;- background: rgba(0,0,0,0.72);+ background: rgba(0, 0, 0, 0.72);backdrop-filter: blur(6px);display: flex;align-items: center;@@ -411,7 +478,7 @@border-radius: 16px;display: flex;flex-direction: column;- box-shadow: 0 24px 60px rgba(0,0,0,0.5);+ box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);}.av-pump-header {display: flex;@@ -440,9 +507,14 @@align-items: center;justify-content: center;font-family: inherit;- transition: color 0.15s, border-color 0.15s;+ transition:+ color 0.15s,+ border-color 0.15s;+ }+ .av-pump-close:hover {+ color: var(--text);+ border-color: var(--text-3);}- .av-pump-close:hover { color: var(--text); border-color: var(--text-3); }.av-pump-inner {padding: 18px;flex: 1;@@ -464,8 +536,14 @@animation: avDlFadeIn 0.16s ease-out;}@keyframes avDlFadeIn {- from { opacity: 0; transform: translateY(-4px); }- to { opacity: 1; transform: translateY(0); }+ from {+ opacity: 0;+ transform: translateY(-4px);+ }+ to {+ opacity: 1;+ transform: translateY(0);+ }}.av-download-menu button {appearance: none;@@ -480,7 +558,9 @@display: flex;flex-direction: column;gap: 2px;- transition: background 0.12s, border-color 0.12s;+ transition:+ background 0.12s,+ border-color 0.12s;}.av-download-menu button:hover {background: rgba(255, 255, 255, 0.07);@@ -501,9 +581,15 @@padding: 4px 10px 2px;min-height: 1em;}- .av-download-status[data-tone='busy'] { color: #b9c0ff; }- .av-download-status[data-tone='ok'] { color: #ffffff; }- .av-download-status[data-tone='err'] { color: #ffb3b3; }+ .av-download-status[data-tone='busy'] {+ color: #b9c0ff;+ }+ .av-download-status[data-tone='ok'] {+ color: #ffffff;+ }+ .av-download-status[data-tone='err'] {+ color: #ffb3b3;+ }/* ── Tabs ────────────────────────────────────────── */.av-tabs {@@ -524,10 +610,14 @@cursor: pointer;font-family: inherit;border-bottom: 2px solid transparent;- transition: color 0.15s, border-color 0.15s;+ transition:+ color 0.15s,+ border-color 0.15s;white-space: nowrap;}- .av-tab:hover { color: var(--text-2); }+ .av-tab:hover {+ color: var(--text-2);+ }.av-tab.active {color: var(--text);border-color: var(--text);@@ -538,8 +628,13 @@min-height: 0;overflow-y: auto;}- .av-panel { display: none; padding: 20px 24px; }- .av-panel.active { display: block; }+ .av-panel {+ display: none;+ padding: 20px 24px;+ }+ .av-panel.active {+ display: block;+ }/* ── Overview panel ──────────────────────────────── */.av-desc {@@ -561,9 +656,17 @@flex-direction: column;gap: 4px;}- .av-attribution strong { color: var(--text-2); font-weight: 500; }- .av-attribution a { color: var(--accent); text-decoration: none; }- .av-attribution a:hover { color: var(--text); }+ .av-attribution strong {+ color: var(--text-2);+ font-weight: 500;+ }+ .av-attribution a {+ color: var(--accent);+ text-decoration: none;+ }+ .av-attribution a:hover {+ color: var(--text);+ }/* ── Chat panel ──────────────────────────────────── */.av-chat {@@ -598,7 +701,9 @@outline: none;cursor: pointer;}- .av-chat-model:focus { border-color: var(--accent); }+ .av-chat-model:focus {+ border-color: var(--accent);+ }.av-chat-ibm {display: none;align-items: center;@@ -613,7 +718,9 @@padding: 4px 10px;white-space: nowrap;}- .av-chat-ibm[data-on="1"] { display: inline-flex; }+ .av-chat-ibm[data-on='1'] {+ display: inline-flex;+ }.av-chat-ibm-dot {width: 7px;height: 7px;@@ -660,7 +767,16 @@margin-left: 2px;animation: av-blink 1s steps(2, start) infinite;}- @keyframes av-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }+ @keyframes av-blink {+ 0%,+ 50% {+ opacity: 1;+ }+ 50.01%,+ 100% {+ opacity: 0;+ }+ }.av-chat-empty {align-self: center;font-size: 13px;@@ -668,7 +784,11 @@text-align: center;padding: 32px 0;}- .av-chat-empty strong { color: var(--text); display: block; margin-bottom: 4px; }+ .av-chat-empty strong {+ color: var(--text);+ display: block;+ margin-bottom: 4px;+ }.av-chat-form {display: flex;gap: 8px;@@ -689,7 +809,9 @@min-height: 40px;max-height: 120px;}- .av-chat-input:focus { border-color: var(--accent); }+ .av-chat-input:focus {+ border-color: var(--accent);+ }.av-chat-send {background: var(--text);color: #000;@@ -701,7 +823,10 @@cursor: pointer;font-family: inherit;}- .av-chat-send:disabled { opacity: 0.4; cursor: default; }+ .av-chat-send:disabled {+ opacity: 0.4;+ cursor: default;+ }.av-chat-mic {background: var(--panel);border: 1px solid var(--border-2);@@ -712,9 +837,15 @@cursor: pointer;font-size: 16px;font-family: inherit;- transition: border-color 0.15s, background 0.15s, color 0.15s;+ transition:+ border-color 0.15s,+ background 0.15s,+ color 0.15s;+ }+ .av-chat-mic:hover {+ border-color: var(--text-3);+ color: var(--text);}- .av-chat-mic:hover { border-color: var(--text-3); color: var(--text); }.av-chat-mic.listening {background: rgba(244, 63, 94, 0.16);border-color: rgba(244, 63, 94, 0.6);@@ -722,11 +853,20 @@animation: av-mic-pulse 1.2s ease-in-out infinite;}@keyframes av-mic-pulse {- 0%, 100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }- 50% { box-shadow: 0 0 0 6px rgba(244, 63, 94, 0); }+ 0%,+ 100% {+ box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4);+ }+ 50% {+ box-shadow: 0 0 0 6px rgba(244, 63, 94, 0);+ }+ }+ .av-row-disabled {+ opacity: 0.5;+ }+ .av-row-disabled .av-row-action {+ cursor: not-allowed;}- .av-row-disabled { opacity: 0.5; }- .av-row-disabled .av-row-action { cursor: not-allowed; }/* ── Thought bubble (hotspot above avatar) ────────── */#av-hotspot-thought {@@ -758,7 +898,9 @@white-space: pre-wrap;word-wrap: break-word;opacity: 0;- transition: opacity 0.3s ease, transform 0.3s ease;+ transition:+ opacity 0.3s ease,+ transform 0.3s ease;pointer-events: none;box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);}@@ -807,11 +949,23 @@background: var(--text-2);animation: av-dot-bounce 1.4s ease-in-out infinite;}- .av-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }- .av-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }+ .av-thinking-dots span:nth-child(2) {+ animation-delay: 0.2s;+ }+ .av-thinking-dots span:nth-child(3) {+ animation-delay: 0.4s;+ }@keyframes av-dot-bounce {- 0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }- 40% { transform: translateY(-5px); opacity: 1; }+ 0%,+ 80%,+ 100% {+ transform: translateY(0);+ opacity: 0.35;+ }+ 40% {+ transform: translateY(-5px);+ opacity: 1;+ }}.av-thought-cursor {display: inline-block;@@ -840,8 +994,13 @@border-radius: 10px;transition: border-color 0.15s;}- .av-row:hover { border-color: var(--border-2); }- .av-row-main { min-width: 0; flex: 1; }+ .av-row:hover {+ border-color: var(--border-2);+ }+ .av-row-main {+ min-width: 0;+ flex: 1;+ }.av-row-title {font-size: 13px;font-weight: 600;@@ -873,8 +1032,13 @@color: #000;border-color: var(--text);}- .av-row-action:hover { border-color: var(--text-2); color: var(--text); }- .av-row-action.active:hover { color: #000; }+ .av-row-action:hover {+ border-color: var(--text-2);+ color: var(--text);+ }+ .av-row-action.active:hover {+ color: #000;+ }.av-list-loading {color: var(--text-3);font-size: 13px;@@ -935,7 +1099,9 @@border-radius: 10px;text-decoration: none;color: inherit;- transition: border-color 0.15s, transform 0.15s;+ transition:+ border-color 0.15s,+ transform 0.15s;}.av-used-by-card:hover {border-color: var(--text-3);@@ -980,7 +1146,9 @@}/* ── Embed panel ─────────────────────────────────── */- .av-embed-section { margin-bottom: 18px; }+ .av-embed-section {+ margin-bottom: 18px;+ }.av-embed-label {display: flex;justify-content: space-between;@@ -1014,8 +1182,14 @@cursor: pointer;font-family: inherit;}- .av-embed-copy:hover { color: var(--text); border-color: var(--text-3); }- .av-embed-copy.copied { color: var(--success); border-color: var(--success); }+ .av-embed-copy:hover {+ color: var(--text);+ border-color: var(--text-3);+ }+ .av-embed-copy.copied {+ color: var(--success);+ border-color: var(--success);+ }/* ── Related row ─────────────────────────────────── */.av-related {@@ -1042,7 +1216,9 @@cursor: pointer;text-decoration: none;color: inherit;- transition: border-color 0.15s, transform 0.15s;+ transition:+ border-color 0.15s,+ transform 0.15s;}.av-related-card:hover {border-color: var(--border-2);@@ -1095,14 +1271,29 @@border-right: 0;border-bottom: 1px solid var(--border);}- .av-stage { min-height: 420px; }+ .av-stage {+ min-height: 420px;+ }}@media (max-width: 600px) {- .av-actionbar { padding: 10px 14px; flex-wrap: wrap; }- .av-side-head, .av-cta-row { padding-left: 16px; padding-right: 16px; }- .av-panel { padding: 16px; }- .av-related { padding: 16px; }- .av-name { font-size: 22px; }+ .av-actionbar {+ padding: 10px 14px;+ flex-wrap: wrap;+ }+ .av-side-head,+ .av-cta-row {+ padding-left: 16px;+ padding-right: 16px;+ }+ .av-panel {+ padding: 16px;+ }+ .av-related {+ padding: 16px;+ }+ .av-name {+ font-size: 22px;+ }}</style></head>@@ -1115,7 +1306,9 @@<div class="av-actionbar-center" id="view-switch-slot"></div><div class="av-share-group"><button class="av-share-btn" id="share-link">Copy link</button>- <a class="av-share-btn" id="share-twitter" target="_blank" rel="noopener">Share on X</a>+ <a class="av-share-btn" id="share-twitter" target="_blank" rel="noopener"+ >Share on X</a+ ></div></header>@@ -1150,7 +1343,12 @@<div class="h-footer-link-col"><h4 class="h-footer-link-heading">Developers</h4><a href="/docs">Docs</a>- <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a>+ <a+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener"+ >GitHub</a+ ></div></nav></div>@@ -1165,5 +1363,5 @@<script src="/src/avatar-page.js" type="module"></script><script src="/brand.js" defer></script>-</body>+ </body></html>diff --git a/pages/bulk-launch.html b/pages/bulk-launch.htmlindex 5fa275f51..f670a1ac3 100644--- a/pages/bulk-launch.html+++ b/pages/bulk-launch.html@@ -1,608 +1,765 @@-<!DOCTYPE html>+<!doctype html><html lang="en">-<head>-<meta charset="UTF-8">+ <head>+ <meta charset="UTF-8" /><link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" /><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /><link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/site.webmanifest" />-<meta name="viewport" content="width=device-width, initial-scale=1.0">-<title>Bulk Launch · three.ws Admin</title>-<style>- :root {- --green: #00ff88;- --gold: #f5c542;- --red: #ff4444;- --bg: #080c10;- --surface: #111620;- --border: #1e2a3a;- --text: #c8d8e8;- --muted: #5a7080;- }- * { margin: 0; padding: 0; box-sizing: border-box; }- body {- background: var(--bg);- color: var(--text);- font-family: 'SF Mono', 'Fira Code', monospace;- font-size: 13px;- min-height: 100vh;- }-- header {- display: flex;- align-items: center;- gap: 16px;- padding: 20px 32px;- border-bottom: 1px solid var(--border);- background: var(--surface);- }- header h1 {- font-size: 18px;- font-weight: 600;- color: #fff;- letter-spacing: -0.5px;- }- header .badge {- font-size: 11px;- background: #1a2a1a;- color: var(--green);- border: 1px solid var(--green);- border-radius: 4px;- padding: 2px 8px;- }-- .layout {- display: grid;- grid-template-columns: 320px 1fr;- gap: 0;- height: calc(100vh - 65px);- }-- .sidebar {- background: var(--surface);- border-right: 1px solid var(--border);- padding: 24px;- display: flex;- flex-direction: column;- gap: 20px;- overflow-y: auto;- }-- .stat-block {- background: var(--bg);- border: 1px solid var(--border);- border-radius: 8px;- padding: 16px;- }- .stat-block label {- display: block;- font-size: 11px;- color: var(--muted);- text-transform: uppercase;- letter-spacing: 0.8px;- margin-bottom: 6px;- }- .stat-block .value {- font-size: 22px;- font-weight: 700;- color: #fff;- }- .stat-block .value.green { color: var(--green); }- .stat-block .value.gold { color: var(--gold); }- .stat-block .value.red { color: var(--red); }-- .funder-addr {- background: var(--bg);- border: 1px solid var(--border);- border-radius: 8px;- padding: 16px;- }- .funder-addr label {- display: block;- font-size: 11px;- color: var(--muted);- text-transform: uppercase;- letter-spacing: 0.8px;- margin-bottom: 8px;- }- .funder-addr .addr {- word-break: break-all;- font-size: 12px;- color: var(--green);- cursor: pointer;- user-select: all;- line-height: 1.5;- }- .funder-addr .addr:hover { opacity: 0.8; }- .funder-addr .hint {- margin-top: 8px;- font-size: 11px;- color: var(--muted);- }-- .controls {- display: flex;- flex-direction: column;- gap: 10px;- }- .controls select, .controls input {- background: var(--bg);- border: 1px solid var(--border);- border-radius: 6px;- color: var(--text);- padding: 8px 12px;- font-family: inherit;- font-size: 13px;- width: 100%;- }- .controls label {- font-size: 11px;- color: var(--muted);- margin-bottom: 4px;- display: block;- }-- .btn {- background: var(--green);- color: #000;- border: none;- border-radius: 6px;- padding: 11px 20px;- font-size: 13px;- font-weight: 700;- font-family: inherit;- cursor: pointer;- width: 100%;- transition: opacity 0.15s;- }- .btn:hover { opacity: 0.85; }- .btn:disabled { opacity: 0.4; cursor: not-allowed; }- .btn.danger { background: var(--red); color: #fff; }- .btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }-- .log-panel {- background: var(--bg);- border: 1px solid var(--border);- border-radius: 8px;- padding: 12px;- font-size: 11px;- color: var(--muted);- max-height: 120px;- overflow-y: auto;- line-height: 1.6;- }- .log-panel .log-line { margin-bottom: 2px; }- .log-panel .log-line.ok { color: var(--green); }- .log-panel .log-line.err { color: var(--red); }- .log-panel .log-line.info { color: var(--gold); }-- /* ── Feed ────────────────────────────────────────────────── */- .feed {- padding: 24px;- overflow-y: auto;- display: flex;- flex-direction: column;- gap: 0;- }-- .feed-header {- display: flex;- align-items: center;- justify-content: space-between;- margin-bottom: 20px;- }- .feed-header h2 {- font-size: 14px;- font-weight: 600;- color: #fff;- }- .feed-header .progress-bar-wrap {- width: 240px;- height: 4px;- background: var(--border);- border-radius: 2px;- overflow: hidden;- }- .feed-header .progress-bar-fill {- height: 100%;- background: var(--green);- border-radius: 2px;- transition: width 0.4s ease;- width: 0%;- }-- .cards {- display: grid;- grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));- gap: 12px;- }-- .agent-card {- background: var(--surface);- border: 1px solid var(--border);- border-radius: 10px;- padding: 14px;- display: flex;- flex-direction: column;- gap: 10px;- animation: cardIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);- position: relative;- overflow: hidden;- }- .agent-card::before {- content: '';- position: absolute;- inset: 0;- background: linear-gradient(135deg, rgba(0,255,136,0.04) 0%, transparent 60%);- pointer-events: none;- }- @keyframes cardIn {- from { opacity: 0; transform: translateY(12px) scale(0.95); }- to { opacity: 1; transform: translateY(0) scale(1); }- }-- .card-thumb {- width: 100%;- aspect-ratio: 1;- border-radius: 6px;- background: var(--border);- object-fit: cover;- display: block;- }- .card-thumb-placeholder {- width: 100%;- aspect-ratio: 1;- border-radius: 6px;- background: linear-gradient(135deg, #1a2535 0%, #0d1520 100%);- display: flex;- align-items: center;- justify-content: center;- font-size: 32px;- color: var(--muted);- }-- .card-name {- font-size: 12px;- font-weight: 600;- color: #fff;- white-space: nowrap;- overflow: hidden;- text-overflow: ellipsis;- }- .card-symbol {- font-size: 11px;- color: var(--muted);- margin-top: -6px;- }- .card-mint {- font-size: 10px;- color: var(--green);- word-break: break-all;- line-height: 1.4;- }- .card-link {- display: block;- font-size: 11px;- color: var(--muted);- text-decoration: none;- border: 1px solid var(--border);- border-radius: 4px;- padding: 4px 8px;- text-align: center;- transition: border-color 0.15s, color 0.15s;- }- .card-link:hover { border-color: var(--green); color: var(--green); }-- .card-error {- background: #1a0808;- border-color: var(--red);- }- .card-error .card-name { color: var(--red); }-- .empty-state {- text-align: center;- color: var(--muted);- padding: 60px 20px;- font-size: 14px;- line-height: 2;- }-- .done-banner {- background: #0a1f10;- border: 1px solid var(--green);- border-radius: 8px;- padding: 16px 20px;- display: flex;- align-items: center;- gap: 12px;- margin-bottom: 16px;- font-size: 13px;- color: var(--green);- animation: cardIn 0.3s ease;- }- .done-banner .done-icon { font-size: 20px; }-</style>-</head>-<body>--<header>- <h1>Deploy Agents On-Chain</h1>- <span class="badge">ADMIN</span>- <span class="badge" style="background:#0d1a2a;color:#5aa9ff;border-color:#2a4a6a">SOLANA · METAPLEX CORE</span>-</header>--<div class="layout">- <aside class="sidebar">- <div class="funder-addr">- <label>Authority Wallet — send SOL here</label>- <div class="addr" id="funder-addr" title="Click to copy">—</div>- <div class="hint" id="funder-balance-hint">Loading balance…</div>- <div class="hint">Pays mint rent (~0.004 SOL/agent), signs as collection authority, and deploys the collection on first run.</div>- </div>-- <div class="funder-addr" id="collection-block" style="display:none">- <label>three.ws Agents Collection</label>- <div class="addr" id="collection-addr" title="Click to copy">—</div>- <div class="hint" id="collection-source"></div>- </div>-- <div style="display:grid;grid-template-columns:1fr 1fr;gap:10px">- <div class="stat-block">- <label>Deployed</label>- <div class="value green" id="stat-launched">0</div>- </div>- <div class="stat-block">- <label>Errors</label>- <div class="value red" id="stat-errors">0</div>- </div>- <div class="stat-block">- <label>Remaining</label>- <div class="value" id="stat-remaining">—</div>- </div>- <div class="stat-block">- <label>Funder SOL</label>- <div class="value gold" id="stat-funder-sol">—</div>- </div>- </div>-- <div class="controls">- <div>- <label>Network</label>- <select id="network-select">- <option value="mainnet">mainnet</option>- <option value="devnet">devnet</option>- </select>- </div>- <div>- <label>Agents per run</label>- <input type="number" id="limit-input" value="100" min="1" max="500" />- </div>- <div style="display:flex;align-items:center;gap:8px;padding:4px 0">- <input type="checkbox" id="dry-run" style="width:auto" />- <label style="margin:0;cursor:pointer" for="dry-run">Dry run (preview only)</label>- </div>- </div>-- <button class="btn" id="start-btn" onclick="startLaunch()">Deploy On-Chain</button>- <button class="btn danger" id="stop-btn" style="display:none" onclick="stopLaunch()">Stop</button>-- <div class="log-panel" id="log-panel">- <div class="log-line info">Ready. Fund the wallet above and click Deploy.</div>- </div>- </aside>-- <main class="feed">- <div class="feed-header">- <h2 id="feed-title">Agents</h2>- <div class="progress-bar-wrap">- <div class="progress-bar-fill" id="progress-bar"></div>- </div>- </div>- <div id="done-banner-slot"></div>- <div class="cards" id="cards-grid">- <div class="empty-state">- Fund the wallet and click <strong>Deploy On-Chain</strong> to begin.<br>- Each card appears the moment its agent is minted as a Metaplex Core asset.- </div>- </div>- </main>-</div>--<script type="module">-let es = null;-let deployed = 0, errors = 0, total = 0;--const SOL_PER_AGENT = 0.004;--function setCollection(d) {- if (!d || !d.address) return;- document.getElementById('collection-block').style.display = '';- document.getElementById('collection-addr').textContent = d.address;- const label = d.source === 'deployed' ? 'just deployed' : d.source === 'db' ? 'persisted' : 'configured';- document.getElementById('collection-source').textContent =- `Metaplex Core collection · ${label}`;-}--function setFunder(d) {- document.getElementById('funder-addr').textContent = d.funder;- document.getElementById('stat-funder-sol').textContent = (+d.funder_balance_sol).toFixed(3);- document.getElementById('funder-balance-hint').textContent =- `Balance: ${(+d.funder_balance_sol).toFixed(4)} SOL · covers ~${Math.floor(d.funder_balance_sol / SOL_PER_AGENT)} agents`;-}--// Probe funder address + balance on load via a 1-agent dry run (closes on init).-(() => {- try {- const probe = new EventSource('/api/admin/bulk-launch?dry_run=true&limit=1');- probe.addEventListener('init', e => { setFunder(JSON.parse(e.data)); probe.close(); });- probe.addEventListener('done', () => probe.close());- probe.onerror = () => probe.close();- } catch {}-})();--// Copy address on click (funder + collection)-for (const id of ['funder-addr', 'collection-addr']) {- document.getElementById(id).addEventListener('click', () => {- const addr = document.getElementById(id).textContent.trim();- if (addr && addr !== '—') navigator.clipboard.writeText(addr).catch(() => {});- });-}--window.startLaunch = function () {- if (es) return;- deployed = 0; errors = 0; total = 0;- document.getElementById('stat-launched').textContent = '0';- document.getElementById('stat-errors').textContent = '0';- document.getElementById('done-banner-slot').innerHTML = '';- document.getElementById('cards-grid').innerHTML = '';-- const network = document.getElementById('network-select').value;- const limit = document.getElementById('limit-input').value || 100;- const dryRun = document.getElementById('dry-run').checked;- const url = `/api/admin/bulk-launch?network=${network}&limit=${limit}&dry_run=${dryRun}`;-- document.getElementById('start-btn').style.display = 'none';- document.getElementById('stop-btn').style.display = '';- addLog('Starting…', 'info');-- es = new EventSource(url);-- es.addEventListener('init', e => {- const d = JSON.parse(e.data);- total = d.total;- document.getElementById('stat-remaining').textContent = total;- setFunder(d);- addLog(`Deploying ${total} agents on ${d.network}${d.dry_run ? ' (dry run)' : ''}`, 'info');- });-- es.addEventListener('collection', e => {- const d = JSON.parse(e.data);- setCollection(d);- if (d.address) addLog(`collection ${d.source}: ${d.address}`, d.source === 'deployed' ? 'ok' : 'info');- });-- es.addEventListener('wallet', e => {- const d = JSON.parse(e.data);- addLog(`wallet: ${d.name} → ${shortAddr(d.owner)}`, 'ok');- });-- es.addEventListener('deployed', e => {- const d = JSON.parse(e.data);- deployed++;- document.getElementById('stat-launched').textContent = deployed;- document.getElementById('stat-remaining').textContent = Math.max(0, total - deployed - errors);- document.getElementById('progress-bar').style.width = total > 0 ? `${(deployed / total) * 100}%` : '0%';- addCard(d);- addLog(`deployed: ${d.name} ${d.dry_run ? '(dry)' : shortAddr(d.asset)}`, 'ok');- });-- es.addEventListener('error', e => {- try {- const d = JSON.parse(e.data);- errors++;- document.getElementById('stat-errors').textContent = errors;- addErrorCard(d);- addLog(`error: ${d.name} — ${d.error}`, 'err');- } catch {}- });-- es.addEventListener('skip', e => {- const d = JSON.parse(e.data);- addLog(`skip: ${d.name} — ${d.reason}`, 'info');- });-- es.addEventListener('paused', e => {- const d = JSON.parse(e.data);- document.getElementById('stat-funder-sol').textContent = (+d.funder_balance_sol).toFixed(3);- addLog(`paused — ${d.reason}`, 'err');- done();- });-- es.addEventListener('done', e => {- const d = JSON.parse(e.data);- addLog(`done — deployed: ${d.deployed}, errors: ${d.errors}`, 'ok');- showDoneBanner(d);- done();- });-- es.onerror = () => {- addLog('stream disconnected', 'err');- done();- };-};--window.stopLaunch = function () {- if (es) { es.close(); es = null; }- done();- addLog('Stopped by user.', 'info');-};--function done() {- if (es) { es.close(); es = null; }- document.getElementById('start-btn').style.display = '';- document.getElementById('stop-btn').style.display = 'none';-}--function addLog(msg, type = '') {- const panel = document.getElementById('log-panel');- const el = document.createElement('div');- el.className = `log-line ${type}`;- el.textContent = `${new Date().toLocaleTimeString()} ${msg}`;- panel.appendChild(el);- panel.scrollTop = panel.scrollHeight;-}--function shortAddr(a) {- return a && a.length > 12 ? `${a.slice(0, 4)}…${a.slice(-4)}` : (a || '');-}--function addCard(d) {- const grid = document.getElementById('cards-grid');- const card = document.createElement('div');- card.className = 'agent-card';- card.innerHTML = `- ${d.avatar_thumb- ? `<img class="card-thumb" src="${escHtml(d.avatar_thumb)}" alt="" loading="lazy" onerror="this.style.display='none'">`- : `<div class="card-thumb-placeholder">🤖</div>`}+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Bulk Launch · three.ws Admin</title>+ <style>+ :root {+ --green: #00ff88;+ --gold: #f5c542;+ --red: #ff4444;+ --bg: #080c10;+ --surface: #111620;+ --border: #1e2a3a;+ --text: #c8d8e8;+ --muted: #5a7080;+ }+ * {+ margin: 0;+ padding: 0;+ box-sizing: border-box;+ }+ body {+ background: var(--bg);+ color: var(--text);+ font-family: 'SF Mono', 'Fira Code', monospace;+ font-size: 13px;+ min-height: 100vh;+ }++ header {+ display: flex;+ align-items: center;+ gap: 16px;+ padding: 20px 32px;+ border-bottom: 1px solid var(--border);+ background: var(--surface);+ }+ header h1 {+ font-size: 18px;+ font-weight: 600;+ color: #fff;+ letter-spacing: -0.5px;+ }+ header .badge {+ font-size: 11px;+ background: #1a2a1a;+ color: var(--green);+ border: 1px solid var(--green);+ border-radius: 4px;+ padding: 2px 8px;+ }++ .layout {+ display: grid;+ grid-template-columns: 320px 1fr;+ gap: 0;+ height: calc(100vh - 65px);+ }++ .sidebar {+ background: var(--surface);+ border-right: 1px solid var(--border);+ padding: 24px;+ display: flex;+ flex-direction: column;+ gap: 20px;+ overflow-y: auto;+ }++ .stat-block {+ background: var(--bg);+ border: 1px solid var(--border);+ border-radius: 8px;+ padding: 16px;+ }+ .stat-block label {+ display: block;+ font-size: 11px;+ color: var(--muted);+ text-transform: uppercase;+ letter-spacing: 0.8px;+ margin-bottom: 6px;+ }+ .stat-block .value {+ font-size: 22px;+ font-weight: 700;+ color: #fff;+ }+ .stat-block .value.green {+ color: var(--green);+ }+ .stat-block .value.gold {+ color: var(--gold);+ }+ .stat-block .value.red {+ color: var(--red);+ }++ .funder-addr {+ background: var(--bg);+ border: 1px solid var(--border);+ border-radius: 8px;+ padding: 16px;+ }+ .funder-addr label {+ display: block;+ font-size: 11px;+ color: var(--muted);+ text-transform: uppercase;+ letter-spacing: 0.8px;+ margin-bottom: 8px;+ }+ .funder-addr .addr {+ word-break: break-all;+ font-size: 12px;+ color: var(--green);+ cursor: pointer;+ user-select: all;+ line-height: 1.5;+ }+ .funder-addr .addr:hover {+ opacity: 0.8;+ }+ .funder-addr .hint {+ margin-top: 8px;+ font-size: 11px;+ color: var(--muted);+ }++ .controls {+ display: flex;+ flex-direction: column;+ gap: 10px;+ }+ .controls select,+ .controls input {+ background: var(--bg);+ border: 1px solid var(--border);+ border-radius: 6px;+ color: var(--text);+ padding: 8px 12px;+ font-family: inherit;+ font-size: 13px;+ width: 100%;+ }+ .controls label {+ font-size: 11px;+ color: var(--muted);+ margin-bottom: 4px;+ display: block;+ }++ .btn {+ background: var(--green);+ color: #000;+ border: none;+ border-radius: 6px;+ padding: 11px 20px;+ font-size: 13px;+ font-weight: 700;+ font-family: inherit;+ cursor: pointer;+ width: 100%;+ transition: opacity 0.15s;+ }+ .btn:hover {+ opacity: 0.85;+ }+ .btn:disabled {+ opacity: 0.4;+ cursor: not-allowed;+ }+ .btn.danger {+ background: var(--red);+ color: #fff;+ }+ .btn.secondary {+ background: transparent;+ border: 1px solid var(--border);+ color: var(--text);+ }++ .log-panel {+ background: var(--bg);+ border: 1px solid var(--border);+ border-radius: 8px;+ padding: 12px;+ font-size: 11px;+ color: var(--muted);+ max-height: 120px;+ overflow-y: auto;+ line-height: 1.6;+ }+ .log-panel .log-line {+ margin-bottom: 2px;+ }+ .log-panel .log-line.ok {+ color: var(--green);+ }+ .log-panel .log-line.err {+ color: var(--red);+ }+ .log-panel .log-line.info {+ color: var(--gold);+ }++ /* ── Feed ────────────────────────────────────────────────── */+ .feed {+ padding: 24px;+ overflow-y: auto;+ display: flex;+ flex-direction: column;+ gap: 0;+ }++ .feed-header {+ display: flex;+ align-items: center;+ justify-content: space-between;+ margin-bottom: 20px;+ }+ .feed-header h2 {+ font-size: 14px;+ font-weight: 600;+ color: #fff;+ }+ .feed-header .progress-bar-wrap {+ width: 240px;+ height: 4px;+ background: var(--border);+ border-radius: 2px;+ overflow: hidden;+ }+ .feed-header .progress-bar-fill {+ height: 100%;+ background: var(--green);+ border-radius: 2px;+ transition: width 0.4s ease;+ width: 0%;+ }++ .cards {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));+ gap: 12px;+ }++ .agent-card {+ background: var(--surface);+ border: 1px solid var(--border);+ border-radius: 10px;+ padding: 14px;+ display: flex;+ flex-direction: column;+ gap: 10px;+ animation: cardIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);+ position: relative;+ overflow: hidden;+ }+ .agent-card::before {+ content: '';+ position: absolute;+ inset: 0;+ background: linear-gradient(135deg, rgba(0, 255, 136, 0.04) 0%, transparent 60%);+ pointer-events: none;+ }+ @keyframes cardIn {+ from {+ opacity: 0;+ transform: translateY(12px) scale(0.95);+ }+ to {+ opacity: 1;+ transform: translateY(0) scale(1);+ }+ }++ .card-thumb {+ width: 100%;+ aspect-ratio: 1;+ border-radius: 6px;+ background: var(--border);+ object-fit: cover;+ display: block;+ }+ .card-thumb-placeholder {+ width: 100%;+ aspect-ratio: 1;+ border-radius: 6px;+ background: linear-gradient(135deg, #1a2535 0%, #0d1520 100%);+ display: flex;+ align-items: center;+ justify-content: center;+ font-size: 32px;+ color: var(--muted);+ }++ .card-name {+ font-size: 12px;+ font-weight: 600;+ color: #fff;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ }+ .card-symbol {+ font-size: 11px;+ color: var(--muted);+ margin-top: -6px;+ }+ .card-mint {+ font-size: 10px;+ color: var(--green);+ word-break: break-all;+ line-height: 1.4;+ }+ .card-link {+ display: block;+ font-size: 11px;+ color: var(--muted);+ text-decoration: none;+ border: 1px solid var(--border);+ border-radius: 4px;+ padding: 4px 8px;+ text-align: center;+ transition:+ border-color 0.15s,+ color 0.15s;+ }+ .card-link:hover {+ border-color: var(--green);+ color: var(--green);+ }++ .card-error {+ background: #1a0808;+ border-color: var(--red);+ }+ .card-error .card-name {+ color: var(--red);+ }++ .empty-state {+ text-align: center;+ color: var(--muted);+ padding: 60px 20px;+ font-size: 14px;+ line-height: 2;+ }++ .done-banner {+ background: #0a1f10;+ border: 1px solid var(--green);+ border-radius: 8px;+ padding: 16px 20px;+ display: flex;+ align-items: center;+ gap: 12px;+ margin-bottom: 16px;+ font-size: 13px;+ color: var(--green);+ animation: cardIn 0.3s ease;+ }+ .done-banner .done-icon {+ font-size: 20px;+ }+ </style>+ </head>+ <body>+ <header>+ <h1>Deploy Agents On-Chain</h1>+ <span class="badge">ADMIN</span>+ <span class="badge" style="background: #0d1a2a; color: #5aa9ff; border-color: #2a4a6a"+ >SOLANA · METAPLEX CORE</span+ >+ </header>++ <div class="layout">+ <aside class="sidebar">+ <div class="funder-addr">+ <label>Authority Wallet — send SOL here</label>+ <div class="addr" id="funder-addr" title="Click to copy">—</div>+ <div class="hint" id="funder-balance-hint">Loading balance…</div>+ <div class="hint">+ Pays mint rent (~0.004 SOL/agent), signs as collection authority, and+ deploys the collection on first run.+ </div>+ </div>++ <div class="funder-addr" id="collection-block" style="display: none">+ <label>three.ws Agents Collection</label>+ <div class="addr" id="collection-addr" title="Click to copy">—</div>+ <div class="hint" id="collection-source"></div>+ </div>++ <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 10px">+ <div class="stat-block">+ <label>Deployed</label>+ <div class="value green" id="stat-launched">0</div>+ </div>+ <div class="stat-block">+ <label>Errors</label>+ <div class="value red" id="stat-errors">0</div>+ </div>+ <div class="stat-block">+ <label>Remaining</label>+ <div class="value" id="stat-remaining">—</div>+ </div>+ <div class="stat-block">+ <label>Funder SOL</label>+ <div class="value gold" id="stat-funder-sol">—</div>+ </div>+ </div>++ <div class="controls">+ <div>+ <label>Network</label>+ <select id="network-select">+ <option value="mainnet">mainnet</option>+ <option value="devnet">devnet</option>+ </select>+ </div>+ <div>+ <label>Agents per run</label>+ <input type="number" id="limit-input" value="100" min="1" max="500" />+ </div>+ <div style="display: flex; align-items: center; gap: 8px; padding: 4px 0">+ <input type="checkbox" id="dry-run" style="width: auto" />+ <label style="margin: 0; cursor: pointer" for="dry-run"+ >Dry run (preview only)</label+ >+ </div>+ </div>++ <button class="btn" id="start-btn" onclick="startLaunch()">Deploy On-Chain</button>+ <button+ class="btn danger"+ id="stop-btn"+ style="display: none"+ onclick="stopLaunch()"+ >+ Stop+ </button>++ <div class="log-panel" id="log-panel">+ <div class="log-line info">Ready. Fund the wallet above and click Deploy.</div>+ </div>+ </aside>++ <main class="feed">+ <div class="feed-header">+ <h2 id="feed-title">Agents</h2>+ <div class="progress-bar-wrap">+ <div class="progress-bar-fill" id="progress-bar"></div>+ </div>+ </div>+ <div id="done-banner-slot"></div>+ <div class="cards" id="cards-grid">+ <div class="empty-state">+ Fund the wallet and click <strong>Deploy On-Chain</strong> to begin.<br />+ Each card appears the moment its agent is minted as a Metaplex Core asset.+ </div>+ </div>+ </main>+ </div>++ <script type="module">+ let es = null;+ let deployed = 0,+ errors = 0,+ total = 0;++ const SOL_PER_AGENT = 0.004;++ function setCollection(d) {+ if (!d || !d.address) return;+ document.getElementById('collection-block').style.display = '';+ document.getElementById('collection-addr').textContent = d.address;+ const label =+ d.source === 'deployed'+ ? 'just deployed'+ : d.source === 'db'+ ? 'persisted'+ : 'configured';+ document.getElementById('collection-source').textContent =+ `Metaplex Core collection · ${label}`;+ }++ function setFunder(d) {+ document.getElementById('funder-addr').textContent = d.funder;+ document.getElementById('stat-funder-sol').textContent =+ (+d.funder_balance_sol).toFixed(3);+ document.getElementById('funder-balance-hint').textContent =+ `Balance: ${(+d.funder_balance_sol).toFixed(4)} SOL · covers ~${Math.floor(d.funder_balance_sol / SOL_PER_AGENT)} agents`;+ }++ // CSRF — single-use token, fetched fresh per mutation (same pattern as the+ // other admin dashboards).+ async function getCsrfToken() {+ try {+ const r = await fetch('/api/csrf-token', { credentials: 'include' });+ if (!r.ok) return null;+ const d = await r.json();+ return d.token || d.data?.token || null;+ } catch {+ return null;+ }+ }++ // SSE over POST — the deploy endpoint mutates on-chain state, so it requires+ // POST + x-csrf-token (EventSource is GET-only). Parses the event stream from+ // the fetch body and dispatches by event name. Returns { close() }.+ function postEventStream(url, { onEvent, onError, onClose } = {}) {+ const controller = new AbortController();+ const stream = { close: () => controller.abort() };+ (async () => {+ try {+ const csrf = await getCsrfToken();+ const headers = { accept: 'text/event-stream' };+ if (csrf) headers['x-csrf-token'] = csrf;+ const r = await fetch(url, {+ method: 'POST',+ headers,+ credentials: 'include',+ signal: controller.signal,+ });+ if (!r.ok || !r.body) {+ onError?.(new Error(`HTTP ${r.status}`));+ return;+ }+ const reader = r.body.getReader();+ const decoder = new TextDecoder();+ let buf = '';+ for (;;) {+ const { done, value } = await reader.read();+ if (done) break;+ buf += decoder.decode(value, { stream: true });+ let idx;+ while ((idx = buf.indexOf('\n\n')) !== -1) {+ const block = buf.slice(0, idx);+ buf = buf.slice(idx + 2);+ let event = 'message';+ const dataLines = [];+ for (const line of block.split('\n')) {+ if (line.startsWith('event:')) event = line.slice(6).trim();+ else if (line.startsWith('data:'))+ dataLines.push(line.slice(5).trimStart());+ }+ if (dataLines.length) onEvent?.(event, dataLines.join('\n'));+ }+ }+ onClose?.();+ } catch (err) {+ if (err?.name !== 'AbortError') onError?.(err);+ }+ })();+ return stream;+ }++ // Probe funder address + balance on load via a 1-agent dry run (stream ends on its own).+ postEventStream('/api/admin/bulk-launch?dry_run=true&limit=1', {+ onEvent: (event, data) => {+ if (event === 'init') {+ try {+ setFunder(JSON.parse(data));+ } catch {}+ }+ },+ });++ // Copy address on click (funder + collection)+ for (const id of ['funder-addr', 'collection-addr']) {+ document.getElementById(id).addEventListener('click', () => {+ const addr = document.getElementById(id).textContent.trim();+ if (addr && addr !== '—') navigator.clipboard.writeText(addr).catch(() => {});+ });+ }++ window.startLaunch = function () {+ if (es) return;+ deployed = 0;+ errors = 0;+ total = 0;+ document.getElementById('stat-launched').textContent = '0';+ document.getElementById('stat-errors').textContent = '0';+ document.getElementById('done-banner-slot').innerHTML = '';+ document.getElementById('cards-grid').innerHTML = '';++ const network = document.getElementById('network-select').value;+ const limit = document.getElementById('limit-input').value || 100;+ const dryRun = document.getElementById('dry-run').checked;+ const url = `/api/admin/bulk-launch?network=${network}&limit=${limit}&dry_run=${dryRun}`;++ document.getElementById('start-btn').style.display = 'none';+ document.getElementById('stop-btn').style.display = '';+ addLog('Starting…', 'info');++ const handlers = {+ init(d) {+ total = d.total;+ document.getElementById('stat-remaining').textContent = total;+ setFunder(d);+ addLog(+ `Deploying ${total} agents on ${d.network}${d.dry_run ? ' (dry run)' : ''}`,+ 'info',+ );+ },+ collection(d) {+ setCollection(d);+ if (d.address)+ addLog(+ `collection ${d.source}: ${d.address}`,+ d.source === 'deployed' ? 'ok' : 'info',+ );+ },+ wallet(d) {+ addLog(`wallet: ${d.name} → ${shortAddr(d.owner)}`, 'ok');+ },+ deployed(d) {+ deployed++;+ document.getElementById('stat-launched').textContent = deployed;+ document.getElementById('stat-remaining').textContent = Math.max(+ 0,+ total - deployed - errors,+ );+ document.getElementById('progress-bar').style.width =+ total > 0 ? `${(deployed / total) * 100}%` : '0%';+ addCard(d);+ addLog(+ `deployed: ${d.name} ${d.dry_run ? '(dry)' : shortAddr(d.asset)}`,+ 'ok',+ );+ },+ error(d) {+ errors++;+ document.getElementById('stat-errors').textContent = errors;+ addErrorCard(d);+ addLog(`error: ${d.name} — ${d.error}`, 'err');+ },+ skip(d) {+ addLog(`skip: ${d.name} — ${d.reason}`, 'info');+ },+ paused(d) {+ document.getElementById('stat-funder-sol').textContent =+ (+d.funder_balance_sol).toFixed(3);+ addLog(`paused — ${d.reason}`, 'err');+ done();+ },+ done(d) {+ addLog(`done — deployed: ${d.deployed}, errors: ${d.errors}`, 'ok');+ showDoneBanner(d);+ done();+ },+ };++ es = postEventStream(url, {+ onEvent: (event, data) => {+ const handle = handlers[event];+ if (!handle) return;+ try {+ handle(JSON.parse(data));+ } catch {}+ },+ onError: () => {+ addLog('stream disconnected', 'err');+ done();+ },+ onClose: () => done(),+ });+ };++ window.stopLaunch = function () {+ if (es) {+ es.close();+ es = null;+ }+ done();+ addLog('Stopped by user.', 'info');+ };++ function done() {+ if (es) {+ es.close();+ es = null;+ }+ document.getElementById('start-btn').style.display = '';+ document.getElementById('stop-btn').style.display = 'none';+ }++ function addLog(msg, type = '') {+ const panel = document.getElementById('log-panel');+ const el = document.createElement('div');+ el.className = `log-line ${type}`;+ el.textContent = `${new Date().toLocaleTimeString()} ${msg}`;+ panel.appendChild(el);+ panel.scrollTop = panel.scrollHeight;+ }++ function shortAddr(a) {+ return a && a.length > 12 ? `${a.slice(0, 4)}…${a.slice(-4)}` : a || '';+ }++ function addCard(d) {+ const grid = document.getElementById('cards-grid');+ const card = document.createElement('div');+ card.className = 'agent-card';+ card.innerHTML = `+ ${+ d.avatar_thumb+ ? `<img class="card-thumb" src="${escHtml(d.avatar_thumb)}" alt="" loading="lazy" onerror="this.style.display='none'">`+ : `<div class="card-thumb-placeholder">🤖</div>`+ }<div><div class="card-name">${escHtml(d.name)}</div><div class="card-symbol">${d.owner ? 'owner ' + escHtml(shortAddr(d.owner)) : ''}</div></div>- ${d.asset && !d.dry_run- ? `<div class="card-mint">${escHtml(d.asset)}</div>+ ${+ d.asset && !d.dry_run+ ? `<div class="card-mint">${escHtml(d.asset)}</div><a class="card-link" href="${escHtml(d.explorer_url)}" target="_blank" rel="noopener">Solscan ↗</a>`- : `<div class="card-mint" style="color:var(--muted)">(dry run)</div>`}+ : `<div class="card-mint" style="color:var(--muted)">(dry run)</div>`+ }`;- grid.appendChild(card);-}--function addErrorCard(d) {- const grid = document.getElementById('cards-grid');- const card = document.createElement('div');- card.className = 'agent-card card-error';- card.innerHTML = `+ grid.appendChild(card);+ }++ function addErrorCard(d) {+ const grid = document.getElementById('cards-grid');+ const card = document.createElement('div');+ card.className = 'agent-card card-error';+ card.innerHTML = `<div class="card-thumb-placeholder" style="font-size:24px">⚠</div><div class="card-name">${escHtml(d.name)}</div><div style="font-size:10px;color:var(--red);word-break:break-word">${escHtml(d.error)}</div>`;- grid.appendChild(card);-}+ grid.appendChild(card);+ }-function showDoneBanner(d) {- document.getElementById('done-banner-slot').innerHTML = `+ function showDoneBanner(d) {+ document.getElementById('done-banner-slot').innerHTML = `<div class="done-banner"><span class="done-icon">✓</span>Run complete — <strong>${d.deployed}</strong> deployed, <strong>${d.errors}</strong> errors.Re-run to continue with remaining agents.</div>`;-}--function escHtml(s) {- return String(s ?? '').replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');-}-</script>-</body>+ }++ function escHtml(s) {+ return String(s ?? '')+ .replace(/&/g, '&')+ .replace(/</g, '<')+ .replace(/>/g, '>')+ .replace(/"/g, '"');+ }+ </script>+ </body></html>diff --git a/pages/create-agent.html b/pages/create-agent.htmlindex 126614b42..51789edc3 100644--- a/pages/create-agent.html+++ b/pages/create-agent.html@@ -1039,6 +1039,8 @@<scripttype="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><link rel="canonical" href="https://three.ws/create-agent" /></head>diff --git a/pages/create-prompt.html b/pages/create-prompt.htmlindex a65ed9426..5222536f4 100644--- a/pages/create-prompt.html+++ b/pages/create-prompt.html@@ -1,359 +1,651 @@<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />- <title>Describe it to 3D · three.ws</title>+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />+ <title>Describe it to 3D · three.ws</title><link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" /><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /><link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/site.webmanifest" />- <meta name="description" content="Type a description. About a minute later: a rigged 3D avatar you can animate and download." />- <meta name="robots" content="index, follow" />+ <meta+ name="description"+ content="Type a description. About a minute later: a rigged 3D avatar you can animate and download."+ />+ <meta name="robots" content="index, follow" />- <meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:url" content="https://three.ws/create/prompt" />- <meta property="og:title" content="Describe it to 3D · three.ws" />- <meta property="og:description" content="Type a description. About a minute later: a rigged 3D avatar you can animate and download." />- <meta property="og:image" content="https://three.ws/og-image.png" />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/create/prompt" />+ <meta property="og:title" content="Describe it to 3D · three.ws" />+ <meta+ property="og:description"+ content="Type a description. About a minute later: a rigged 3D avatar you can animate and download."+ />+ <meta property="og:image" content="https://three.ws/og-image.png" />- <style>- :root {- color-scheme: dark;- --bg: #000000;- --panel: #0a0a0a;- --panel-elev: #111111;- --border: #1a1a1a;- --border-strong: #2a2a2a;- --text: #e8e8e8;- --muted: #888888;- --accent: #ffffff;- --accent-ink: #000000;- --danger: #f87171;- --danger-dim: #4a1a1a;- }- * { box-sizing: border-box; }- html, body { margin: 0; padding: 0; }- body {- font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;- color: var(--text);- background: var(--bg);- min-height: 100vh;- overflow-x: hidden;- }- .skip-link {- position: absolute; left: -999px; top: 0;- background: var(--accent); color: var(--accent-ink);- padding: 8px 14px; border-radius: 8px; z-index: 100;- }- .skip-link:focus { left: 12px; top: 12px; }+ <style>+ :root {+ color-scheme: dark;+ --bg: #000000;+ --panel: #0a0a0a;+ --panel-elev: #111111;+ --border: #1a1a1a;+ --border-strong: #2a2a2a;+ --text: #e8e8e8;+ --muted: #888888;+ --accent: #ffffff;+ --accent-ink: #000000;+ --danger: #f87171;+ --danger-dim: #4a1a1a;+ }+ * {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ padding: 0;+ }+ body {+ font:+ 15px/1.55 -apple-system,+ BlinkMacSystemFont,+ 'Segoe UI',+ Roboto,+ sans-serif;+ color: var(--text);+ background: var(--bg);+ min-height: 100vh;+ overflow-x: hidden;+ }+ .skip-link {+ position: absolute;+ left: -999px;+ top: 0;+ background: var(--accent);+ color: var(--accent-ink);+ padding: 8px 14px;+ border-radius: 8px;+ z-index: 100;+ }+ .skip-link:focus {+ left: 12px;+ top: 12px;+ }- .stage {- max-width: 760px;- margin: 0 auto;- padding: 0 20px 80px;- min-height: 100vh;- display: flex;- flex-direction: column;- }- .topbar {- display: flex; align-items: center; gap: 12px;- padding: 18px 0;- }- .back {- display: inline-flex; align-items: center; justify-content: center;- width: 38px; height: 38px;- border-radius: 10px;- border: 1px solid var(--border-strong);- background: var(--panel);- color: var(--text);- cursor: pointer;- transition: border-color .15s, background .15s, transform .12s;- }- .back:hover { border-color: #444; background: var(--panel-elev); }- .back:active { transform: translateY(1px); }- .back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }- .label { color: var(--muted); font-size: 13px; letter-spacing: .01em; }- .label strong { color: var(--text); font-weight: 600; }+ .stage {+ max-width: 760px;+ margin: 0 auto;+ padding: 0 20px 80px;+ min-height: 100vh;+ display: flex;+ flex-direction: column;+ }+ .topbar {+ display: flex;+ align-items: center;+ gap: 12px;+ padding: 18px 0;+ }+ .back {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 38px;+ height: 38px;+ border-radius: 10px;+ border: 1px solid var(--border-strong);+ background: var(--panel);+ color: var(--text);+ cursor: pointer;+ transition:+ border-color 0.15s,+ background 0.15s,+ transform 0.12s;+ }+ .back:hover {+ border-color: #444;+ background: var(--panel-elev);+ }+ .back:active {+ transform: translateY(1px);+ }+ .back:focus-visible {+ outline: 2px solid var(--accent);+ outline-offset: 2px;+ }+ .label {+ color: var(--muted);+ font-size: 13px;+ letter-spacing: 0.01em;+ }+ .label strong {+ color: var(--text);+ font-weight: 600;+ }- /* ── Steps ─────────────────────────────────────────────────────────── */- .step { display: none; flex: 1; flex-direction: column; }- .step.active { display: flex; animation: fade .35s ease; }- @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }+ /* ── Steps ─────────────────────────────────────────────────────────── */+ .step {+ display: none;+ flex: 1;+ flex-direction: column;+ }+ .step.active {+ display: flex;+ animation: fade 0.35s ease;+ }+ @keyframes fade {+ from {+ opacity: 0;+ transform: translateY(6px);+ }+ to {+ opacity: 1;+ transform: none;+ }+ }- h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.1; margin: 12px 0 8px; letter-spacing: -0.02em; }- .sub { color: var(--muted); margin: 0 0 24px; max-width: 56ch; }+ h1 {+ font-size: clamp(26px, 5vw, 36px);+ line-height: 1.1;+ margin: 12px 0 8px;+ letter-spacing: -0.02em;+ }+ .sub {+ color: var(--muted);+ margin: 0 0 24px;+ max-width: 56ch;+ }- /* ── Compose ───────────────────────────────────────────────────────── */- .composer {- border: 1px solid var(--border-strong);- border-radius: 16px;- background: var(--panel);- padding: 6px 6px 14px;- transition: border-color .15s;- }- .composer:focus-within { border-color: #3a3a3a; }- textarea#prompt {- width: 100%;- min-height: 120px;- resize: vertical;- border: 0;- background: transparent;- color: var(--text);- font: inherit;- line-height: 1.5;- padding: 14px 14px 6px;- outline: none;- }- textarea#prompt::placeholder { color: #555; }- .composer-foot {- display: flex; align-items: center; justify-content: space-between;- gap: 12px; padding: 0 10px;- }- .counter { color: #555; font-size: 12px; font-variant-numeric: tabular-nums; }- .counter.warn { color: var(--danger); }+ /* ── Compose ───────────────────────────────────────────────────────── */+ .composer {+ border: 1px solid var(--border-strong);+ border-radius: 16px;+ background: var(--panel);+ padding: 6px 6px 14px;+ transition: border-color 0.15s;+ }+ .composer:focus-within {+ border-color: #3a3a3a;+ }+ textarea#prompt {+ width: 100%;+ min-height: 120px;+ resize: vertical;+ border: 0;+ background: transparent;+ color: var(--text);+ font: inherit;+ line-height: 1.5;+ padding: 14px 14px 6px;+ outline: none;+ }+ textarea#prompt::placeholder {+ color: #555;+ }+ .composer-foot {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ padding: 0 10px;+ }+ .counter {+ color: #555;+ font-size: 12px;+ font-variant-numeric: tabular-nums;+ }+ .counter.warn {+ color: var(--danger);+ }- .examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }- .example {- border: 1px solid var(--border-strong);- background: var(--panel);- color: var(--muted);- border-radius: 999px;- padding: 7px 13px;- font-size: 13px;- cursor: pointer;- transition: border-color .15s, color .15s, background .15s, transform .12s;- }- .example:hover { border-color: #444; color: var(--text); background: var(--panel-elev); }- .example:active { transform: translateY(1px); }- .example:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }+ .examples {+ display: flex;+ flex-wrap: wrap;+ gap: 8px;+ margin: 16px 0 4px;+ }+ .example {+ border: 1px solid var(--border-strong);+ background: var(--panel);+ color: var(--muted);+ border-radius: 999px;+ padding: 7px 13px;+ font-size: 13px;+ cursor: pointer;+ transition:+ border-color 0.15s,+ color 0.15s,+ background 0.15s,+ transform 0.12s;+ }+ .example:hover {+ border-color: #444;+ color: var(--text);+ background: var(--panel-elev);+ }+ .example:active {+ transform: translateY(1px);+ }+ .example:focus-visible {+ outline: 2px solid var(--accent);+ outline-offset: 2px;+ }- .actions { display: flex; align-items: center; gap: 14px; margin-top: 22px; }- .btn-primary {- display: inline-flex; align-items: center; gap: 9px;- background: var(--accent); color: var(--accent-ink);- border: 0; border-radius: 12px;- padding: 13px 22px;- font-size: 15px; font-weight: 600;- cursor: pointer;- transition: opacity .15s, transform .12s;- }- .btn-primary:hover { opacity: .9; }- .btn-primary:active { transform: translateY(1px); }- .btn-primary:disabled { opacity: .4; cursor: not-allowed; }- .btn-primary:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }- .hint { color: #666; font-size: 12.5px; }- .hint .chip-auth { color: var(--muted); }+ .actions {+ display: flex;+ align-items: center;+ gap: 14px;+ margin-top: 22px;+ }+ .btn-primary {+ display: inline-flex;+ align-items: center;+ gap: 9px;+ background: var(--accent);+ color: var(--accent-ink);+ border: 0;+ border-radius: 12px;+ padding: 13px 22px;+ font-size: 15px;+ font-weight: 600;+ cursor: pointer;+ transition:+ opacity 0.15s,+ transform 0.12s;+ }+ .btn-primary:hover {+ opacity: 0.9;+ }+ .btn-primary:active {+ transform: translateY(1px);+ }+ .btn-primary:disabled {+ opacity: 0.4;+ cursor: not-allowed;+ }+ .btn-primary:focus-visible {+ outline: 2px solid #fff;+ outline-offset: 3px;+ }+ .hint {+ color: #666;+ font-size: 12.5px;+ }+ .hint .chip-auth {+ color: var(--muted);+ }- .note {- margin-top: 28px;- color: #666; font-size: 12.5px;- border-top: 1px solid var(--border);- padding-top: 16px;- max-width: 60ch;- }+ .note {+ margin-top: 28px;+ color: #666;+ font-size: 12.5px;+ border-top: 1px solid var(--border);+ padding-top: 16px;+ max-width: 60ch;+ }- /* ── Building ──────────────────────────────────────────────────────── */- .build-wrap { align-items: center; text-align: center; padding-top: 24px; }- .orb {- width: 132px; height: 132px; border-radius: 50%;- margin: 8px auto 26px;- background:- radial-gradient(circle at 32% 30%, #2a2a2a, #0c0c0c 70%);- border: 1px solid var(--border-strong);- position: relative;- overflow: hidden;- }- .orb::after {- content: ''; position: absolute; inset: -40%;- background: conic-gradient(from 0deg, transparent 0 70%, rgba(255,255,255,.14) 85%, transparent 100%);- animation: spin 1.5s linear infinite;- }- .orb::before {- content: ''; position: absolute; inset: 0; border-radius: 50%;- box-shadow: inset 0 0 30px rgba(255,255,255,.05);- z-index: 1;- }- @keyframes spin { to { transform: rotate(360deg); } }- .build-prompt {- color: var(--text); font-size: 16px; max-width: 46ch;- margin: 0 auto 6px; font-style: italic;- }- .build-status { color: var(--muted); font-size: 14px; margin-top: 12px; min-height: 20px; }- .progress-track {- width: min(420px, 90%); height: 4px; border-radius: 4px;- background: var(--border-strong); margin: 22px auto 0; overflow: hidden;- }- .progress-fill {- height: 100%; width: 8%; border-radius: 4px;- background: var(--accent);- transition: width .8s cubic-bezier(.4,0,.2,1);- }- .elapsed { color: #555; font-size: 12px; margin-top: 14px; font-variant-numeric: tabular-nums; }+ /* ── Building ──────────────────────────────────────────────────────── */+ .build-wrap {+ align-items: center;+ text-align: center;+ padding-top: 24px;+ }+ .orb {+ width: 132px;+ height: 132px;+ border-radius: 50%;+ margin: 8px auto 26px;+ background: radial-gradient(circle at 32% 30%, #2a2a2a, #0c0c0c 70%);+ border: 1px solid var(--border-strong);+ position: relative;+ overflow: hidden;+ }+ .orb::after {+ content: '';+ position: absolute;+ inset: -40%;+ background: conic-gradient(+ from 0deg,+ transparent 0 70%,+ rgba(255, 255, 255, 0.14) 85%,+ transparent 100%+ );+ animation: spin 1.5s linear infinite;+ }+ .orb::before {+ content: '';+ position: absolute;+ inset: 0;+ border-radius: 50%;+ box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.05);+ z-index: 1;+ }+ @keyframes spin {+ to {+ transform: rotate(360deg);+ }+ }+ .build-prompt {+ color: var(--text);+ font-size: 16px;+ max-width: 46ch;+ margin: 0 auto 6px;+ font-style: italic;+ }+ .build-status {+ color: var(--muted);+ font-size: 14px;+ margin-top: 12px;+ min-height: 20px;+ }+ .progress-track {+ width: min(420px, 90%);+ height: 4px;+ border-radius: 4px;+ background: var(--border-strong);+ margin: 22px auto 0;+ overflow: hidden;+ }+ .progress-fill {+ height: 100%;+ width: 8%;+ border-radius: 4px;+ background: var(--accent);+ transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);+ }+ .elapsed {+ color: #555;+ font-size: 12px;+ margin-top: 14px;+ font-variant-numeric: tabular-nums;+ }- /* ── Done ──────────────────────────────────────────────────────────── */- .done-wrap { align-items: center; text-align: center; padding-top: 8px; }- .done-viewer {- width: 100%; max-width: 460px; aspect-ratio: 4/5;- margin: 18px auto 0;- border: 1px solid var(--border-strong); border-radius: 16px;- background: var(--panel); overflow: hidden;- }- .done-viewer model-viewer { width: 100%; height: 100%; --poster-color: transparent; }- .done-tags { display: flex; gap: 8px; justify-content: center; margin: 16px 0 0; flex-wrap: wrap; }- .tag {- font-size: 12px; color: var(--muted);- border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 11px;- }- .tag.ok { color: #6ee7a8; border-color: #1f3a2a; }- .done-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }- .btn-ghost {- display: inline-flex; align-items: center; gap: 8px;- background: var(--panel); color: var(--text);- border: 1px solid var(--border-strong); border-radius: 12px;- padding: 12px 20px; font-size: 15px; font-weight: 500; cursor: pointer;- transition: border-color .15s, background .15s, transform .12s;- text-decoration: none;- }- .btn-ghost:hover { border-color: #444; background: var(--panel-elev); }- .btn-ghost:active { transform: translateY(1px); }- .btn-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }+ /* ── Done ──────────────────────────────────────────────────────────── */+ .done-wrap {+ align-items: center;+ text-align: center;+ padding-top: 8px;+ }+ .done-viewer {+ width: 100%;+ max-width: 460px;+ aspect-ratio: 4/5;+ margin: 18px auto 0;+ border: 1px solid var(--border-strong);+ border-radius: 16px;+ background: var(--panel);+ overflow: hidden;+ }+ .done-viewer model-viewer {+ width: 100%;+ height: 100%;+ --poster-color: transparent;+ }+ .done-tags {+ display: flex;+ gap: 8px;+ justify-content: center;+ margin: 16px 0 0;+ flex-wrap: wrap;+ }+ .tag {+ font-size: 12px;+ color: var(--muted);+ border: 1px solid var(--border-strong);+ border-radius: 999px;+ padding: 5px 11px;+ }+ .tag.ok {+ color: #6ee7a8;+ border-color: #1f3a2a;+ }+ .done-actions {+ display: flex;+ gap: 12px;+ justify-content: center;+ margin-top: 24px;+ flex-wrap: wrap;+ }+ .btn-ghost {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ background: var(--panel);+ color: var(--text);+ border: 1px solid var(--border-strong);+ border-radius: 12px;+ padding: 12px 20px;+ font-size: 15px;+ font-weight: 500;+ cursor: pointer;+ transition:+ border-color 0.15s,+ background 0.15s,+ transform 0.12s;+ text-decoration: none;+ }+ .btn-ghost:hover {+ border-color: #444;+ background: var(--panel-elev);+ }+ .btn-ghost:active {+ transform: translateY(1px);+ }+ .btn-ghost:focus-visible {+ outline: 2px solid var(--accent);+ outline-offset: 2px;+ }- /* ── Error ─────────────────────────────────────────────────────────── */- .error-box {- display: none;- margin-top: 18px;- border: 1px solid var(--danger-dim);- background: rgba(248,113,113,.06);- border-radius: 12px;- padding: 14px 16px;- color: #f3b4b4;- font-size: 14px;- }- .error-box.show { display: block; animation: fade .25s ease; }- .error-box strong { color: var(--danger); }+ /* ── Error ─────────────────────────────────────────────────────────── */+ .error-box {+ display: none;+ margin-top: 18px;+ border: 1px solid var(--danger-dim);+ background: rgba(248, 113, 113, 0.06);+ border-radius: 12px;+ padding: 14px 16px;+ color: #f3b4b4;+ font-size: 14px;+ }+ .error-box.show {+ display: block;+ animation: fade 0.25s ease;+ }+ .error-box strong {+ color: var(--danger);+ }- @media (max-width: 520px) {- .actions { flex-direction: column; align-items: stretch; }- .btn-primary { justify-content: center; }- .hint { text-align: center; }- }- </style>+ @media (max-width: 520px) {+ .actions {+ flex-direction: column;+ align-items: stretch;+ }+ .btn-primary {+ justify-content: center;+ }+ .hint {+ text-align: center;+ }+ }+ </style>- <script- type="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"- ></script>- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Describe it to 3D","description":"Type a description. About a minute later: a rigged 3D avatar you can animate and download.","url":"https://three.ws/create/prompt","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>-<body>- <a href="#prompt" class="skip-link">Skip to the prompt box</a>- <main class="stage">- <div class="topbar">- <button class="back" id="back-btn" aria-label="Back to create" type="button">- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="19" y1="12" x2="5" y2="12" />- <polyline points="12 19 5 12 12 5" />- </svg>- </button>- <div class="label"><strong>three.ws</strong> · Describe it to 3D</div>- </div>+ <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>+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Describe it to 3D",+ "description": "Type a description. About a minute later: a rigged 3D avatar you can animate and download.",+ "url": "https://three.ws/create/prompt",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head>+ <body>+ <a href="#prompt" class="skip-link">Skip to the prompt box</a>+ <main class="stage">+ <div class="topbar">+ <button class="back" id="back-btn" aria-label="Back to create" type="button">+ <svg+ width="16"+ height="16"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="19" y1="12" x2="5" y2="12" />+ <polyline points="12 19 5 12 12 5" />+ </svg>+ </button>+ <div class="label"><strong>three.ws</strong> · Describe it to 3D</div>+ </div>- <!-- Step 1: compose -->- <section class="step active" data-step="compose" aria-label="Describe your avatar">- <h1>Describe it. Get a rigged 3D avatar.</h1>- <p class="sub">- Type what you want — a character, a creature, a style. We render a clean- reference, reconstruct it into 3D, and add a skeleton so it can move.- </p>+ <!-- Step 1: compose -->+ <section class="step active" data-step="compose" aria-label="Describe your avatar">+ <h1>Describe it. Get a rigged 3D avatar.</h1>+ <p class="sub">+ Type what you want — a character, a creature, a style. We render a clean+ reference, reconstruct it into 3D, and add a skeleton so it can move.+ </p>- <div class="composer">- <textarea- id="prompt"- maxlength="600"- placeholder="A cyberpunk street samurai in a worn red coat, neon trim, calm expression…"- aria-label="Describe the avatar you want to generate"- ></textarea>- <div class="composer-foot">- <span class="hint" id="cost-hint">Single subject, full body works best.</span>- <span class="counter" id="counter">0 / 600</span>+ <div class="composer">+ <textarea+ id="prompt"+ maxlength="600"+ placeholder="A cyberpunk street samurai in a worn red coat, neon trim, calm expression…"+ aria-label="Describe the avatar you want to generate"+ ></textarea>+ <div class="composer-foot">+ <span class="hint" id="cost-hint"+ >Single subject, full body works best.</span+ >+ <span class="counter" id="counter">0 / 600</span>+ </div></div>- </div>- <div class="examples" role="group" aria-label="Example prompts">- <button class="example" type="button">A friendly robot mascot, rounded white shell, glowing blue eyes</button>- <button class="example" type="button">A medieval knight in battered steel plate, weathered cape</button>- <button class="example" type="button">A fox-eared ranger in green leather, bow on the back</button>- <button class="example" type="button">An astronaut in a sleek matte-black suit, gold visor</button>- </div>+ <div class="examples" role="group" aria-label="Example prompts">+ <button class="example" type="button">+ A friendly robot mascot, rounded white shell, glowing blue eyes+ </button>+ <button class="example" type="button">+ A medieval knight in battered steel plate, weathered cape+ </button>+ <button class="example" type="button">+ A fox-eared ranger in green leather, bow on the back+ </button>+ <button class="example" type="button">+ An astronaut in a sleek matte-black suit, gold visor+ </button>+ </div>- <div class="actions">- <button class="btn-primary" id="generate-btn" type="button" disabled>- <svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <path d="M12 3l1.9 5.3L19 10l-5.1 1.7L12 17l-1.9-5.3L5 10l5.1-1.7z" />- </svg>- Generate avatar- </button>- <span class="hint"><span class="chip-auth">Sign-in required</span> · ~1 min · rigged GLB</span>- </div>+ <div class="actions">+ <button class="btn-primary" id="generate-btn" type="button" disabled>+ <svg+ width="17"+ height="17"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <path d="M12 3l1.9 5.3L19 10l-5.1 1.7L12 17l-1.9-5.3L5 10l5.1-1.7z" />+ </svg>+ Generate avatar+ </button>+ <span class="hint"+ ><span class="chip-auth">Sign-in required</span> · ~1 min · rigged GLB</span+ >+ </div>- <div class="error-box" id="compose-error" role="alert"></div>+ <div class="error-box" id="compose-error" role="alert"></div>- <p class="note">- Avatars come out best with a single, clearly described subject. Abstract- scenes or multiple characters reconstruct poorly. You can refine the face,- outfit, and animations in the editor afterward.- </p>- </section>+ <p class="note">+ Avatars come out best with a single, clearly described subject. Abstract scenes+ or multiple characters reconstruct poorly. You can refine the face, outfit, and+ animations in the editor afterward.+ </p>+ </section>- <!-- Step 2: building -->- <section class="step build-wrap" data-step="building" aria-label="Building your avatar" aria-live="polite">- <div class="orb" aria-hidden="true"></div>- <p class="build-prompt" id="build-prompt"></p>- <div class="progress-track" aria-hidden="true"><div class="progress-fill" id="progress-fill"></div></div>- <p class="build-status" id="build-status">Rendering a reference image…</p>- <p class="elapsed" id="elapsed">0:00</p>- <div class="error-box" id="build-error" role="alert"></div>- </section>+ <!-- Step 2: building -->+ <section+ class="step build-wrap"+ data-step="building"+ aria-label="Building your avatar"+ aria-live="polite"+ >+ <div class="orb" aria-hidden="true"></div>+ <p class="build-prompt" id="build-prompt"></p>+ <div class="progress-track" aria-hidden="true">+ <div class="progress-fill" id="progress-fill"></div>+ </div>+ <p class="build-status" id="build-status">Rendering a reference image…</p>+ <p class="elapsed" id="elapsed">0:00</p>+ <div class="error-box" id="build-error" role="alert"></div>+ </section>- <!-- Step 3: done -->- <section class="step done-wrap" data-step="done" aria-label="Your avatar is ready">- <h1>Your avatar is ready</h1>- <p class="sub" style="margin-bottom:0">Open it in the editor to animate, dress, and export.</p>- <div class="done-viewer">- <model-viewer- id="done-model"- auto-rotate- rotation-per-second="14deg"- interaction-prompt="none"- camera-controls- shadow-intensity="0.7"- shadow-softness="0.8"- environment-image="neutral"- exposure="0.95"- camera-orbit="0deg 80deg auto"- loading="eager"- alt="Your newly generated 3D avatar"- ></model-viewer>- </div>- <div class="done-tags" id="done-tags"></div>- <div class="done-actions">- <a class="btn-primary" id="open-editor" href="#">- Open in editor- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="5" y1="12" x2="19" y2="12" />- <polyline points="12 5 19 12 12 19" />- </svg>- </a>- <button class="btn-ghost" id="make-another" type="button">Make another</button>- </div>- </section>- </main>+ <!-- Step 3: done -->+ <section class="step done-wrap" data-step="done" aria-label="Your avatar is ready">+ <h1>Your avatar is ready</h1>+ <p class="sub" style="margin-bottom: 0">+ Open it in the editor to animate, dress, and export.+ </p>+ <div class="done-viewer">+ <model-viewer+ id="done-model"+ auto-rotate+ rotation-per-second="14deg"+ interaction-prompt="none"+ camera-controls+ shadow-intensity="0.7"+ shadow-softness="0.8"+ environment-image="neutral"+ exposure="0.95"+ camera-orbit="0deg 80deg auto"+ loading="eager"+ alt="Your newly generated 3D avatar"+ ></model-viewer>+ </div>+ <div class="done-tags" id="done-tags"></div>+ <div class="done-actions">+ <a class="btn-primary" id="open-editor" href="#">+ Open in editor+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="5" y1="12" x2="19" y2="12" />+ <polyline points="12 5 19 12 12 19" />+ </svg>+ </a>+ <button class="btn-ghost" id="make-another" type="button">Make another</button>+ </div>+ </section>+ </main>- <script type="module" src="/src/create-prompt.js"></script>- <script src="/brand.js" defer></script>-</body>+ <script type="module" src="/src/create-prompt.js"></script>+ <script src="/brand.js" defer></script>+ </body></html>diff --git a/pages/create-selfie.html b/pages/create-selfie.htmlindex 3cef7948c..ecd18b7bd 100644--- a/pages/create-selfie.html+++ b/pages/create-selfie.html@@ -1,1481 +1,2008 @@<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />- <title>Selfie to avatar · three.ws</title>+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />+ <title>Selfie to avatar · three.ws</title><link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" /><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /><link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/site.webmanifest" />- <meta name="description" content="One selfie. About a minute. A rigged 3D avatar that works everywhere." />- <meta name="robots" content="index, follow" />+ <meta+ name="description"+ content="One selfie. About a minute. A rigged 3D avatar that works everywhere."+ />+ <meta name="robots" content="index, follow" />- <meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:url" content="https://three.ws/create/selfie" />- <meta property="og:title" content="Selfie to avatar · three.ws" />- <meta property="og:description" content="One selfie. About a minute. A rigged 3D avatar that works everywhere." />- <meta property="og:image" content="https://three.ws/og-image.png" />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/create/selfie" />+ <meta property="og:title" content="Selfie to avatar · three.ws" />+ <meta+ property="og:description"+ content="One selfie. About a minute. A rigged 3D avatar that works everywhere."+ />+ <meta property="og:image" content="https://three.ws/og-image.png" />- <style>- :root {- color-scheme: dark;- --bg: #000000;- --panel: #0a0a0a;- --panel-elev: #111111;- --border: #1a1a1a;- --border-strong: #2a2a2a;- --text: #e8e8e8;- --muted: #888888;- --accent: #ffffff;- --accent-ink: #000000;- --danger: #f87171;- --danger-dim: #4a1a1a;- }- * { box-sizing: border-box; }- html, body { margin: 0; padding: 0; }- body {- font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;- color: var(--text);- background: var(--bg);- min-height: 100vh;- overflow-x: hidden;- }- body::before {- content: '';- position: fixed;- inset: 0;- z-index: -1;- pointer-events: none;- background:- radial-gradient(800px 500px at 50% -100px, rgba(255, 255, 255, 0.03) 0, transparent 70%),- radial-gradient(600px 400px at 50% 110%, rgba(255, 255, 255, 0.04) 0, transparent 70%),- #000000;- }- main.stage {- max-width: 720px;- margin: 0 auto;- padding: 32px 20px 96px;- }- .topbar {- display: flex;- align-items: center;- gap: 14px;- margin-bottom: 28px;- }- .topbar button.back {- background: var(--panel);- border: 1px solid var(--border);- color: var(--text);- width: 36px;- height: 36px;- border-radius: 9px;- font: inherit;- cursor: pointer;- display: inline-flex;- align-items: center;- justify-content: center;- }- .topbar button.back:hover { border-color: var(--border-strong); }- .topbar .label {- font-size: 12px;- letter-spacing: 0.06em;- text-transform: uppercase;- color: var(--muted);- }- .topbar .label strong { color: var(--text); font-weight: 600; }- h1 {- font-size: 28px;- line-height: 1.25;- margin: 0 0 8px;- }- .sub {- color: var(--muted);- margin: 0 0 28px;- line-height: 1.55;- }- .step { display: none; opacity: 0; }- .step.active { display: block; animation: step-in 400ms ease forwards; }- @keyframes step-in {- from { opacity: 0; transform: translateY(12px); }- to { opacity: 1; transform: translateY(0); }- }- .unsupported {- display: none;- padding: 12px 14px;- background: rgba(239, 77, 77, 0.08);- border: 1px solid var(--danger-dim);- border-radius: 9px;- color: #f4b5b5;- font-size: 13.5px;- margin: 0 0 20px;- }- .unsupported.show { display: block; }+ <style>+ :root {+ color-scheme: dark;+ --bg: #000000;+ --panel: #0a0a0a;+ --panel-elev: #111111;+ --border: #1a1a1a;+ --border-strong: #2a2a2a;+ --text: #e8e8e8;+ --muted: #888888;+ --accent: #ffffff;+ --accent-ink: #000000;+ --danger: #f87171;+ --danger-dim: #4a1a1a;+ }+ * {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ padding: 0;+ }+ body {+ font:+ 15px/1.55 -apple-system,+ BlinkMacSystemFont,+ 'Segoe UI',+ Roboto,+ sans-serif;+ color: var(--text);+ background: var(--bg);+ min-height: 100vh;+ overflow-x: hidden;+ }+ body::before {+ content: '';+ position: fixed;+ inset: 0;+ z-index: -1;+ pointer-events: none;+ background:+ radial-gradient(+ 800px 500px at 50% -100px,+ rgba(255, 255, 255, 0.03) 0,+ transparent 70%+ ),+ radial-gradient(+ 600px 400px at 50% 110%,+ rgba(255, 255, 255, 0.04) 0,+ transparent 70%+ ),+ #000000;+ }+ main.stage {+ max-width: 720px;+ margin: 0 auto;+ padding: 32px 20px 96px;+ }+ .topbar {+ display: flex;+ align-items: center;+ gap: 14px;+ margin-bottom: 28px;+ }+ .topbar button.back {+ background: var(--panel);+ border: 1px solid var(--border);+ color: var(--text);+ width: 36px;+ height: 36px;+ border-radius: 9px;+ font: inherit;+ cursor: pointer;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ }+ .topbar button.back:hover {+ border-color: var(--border-strong);+ }+ .topbar .label {+ font-size: 12px;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: var(--muted);+ }+ .topbar .label strong {+ color: var(--text);+ font-weight: 600;+ }+ h1 {+ font-size: 28px;+ line-height: 1.25;+ margin: 0 0 8px;+ }+ .sub {+ color: var(--muted);+ margin: 0 0 28px;+ line-height: 1.55;+ }+ .step {+ display: none;+ opacity: 0;+ }+ .step.active {+ display: block;+ animation: step-in 400ms ease forwards;+ }+ @keyframes step-in {+ from {+ opacity: 0;+ transform: translateY(12px);+ }+ to {+ opacity: 1;+ transform: translateY(0);+ }+ }+ .unsupported {+ display: none;+ padding: 12px 14px;+ background: rgba(239, 77, 77, 0.08);+ border: 1px solid var(--danger-dim);+ border-radius: 9px;+ color: #f4b5b5;+ font-size: 13.5px;+ margin: 0 0 20px;+ }+ .unsupported.show {+ display: block;+ }- .choice-grid {- display: grid;- grid-template-columns: 1fr 1fr;- gap: 14px;- }- @media (max-width: 560px) { .choice-grid { grid-template-columns: 1fr; } }- .choice {- padding: 22px 18px;- background: var(--panel);- border: 1px solid var(--border);- border-radius: 12px;- color: var(--text);- font: inherit;- text-align: left;- cursor: pointer;- transition: border-color 120ms, transform 120ms, background 120ms;- }- .choice:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }- .choice:disabled { opacity: 0.45; cursor: not-allowed; }- .choice .icon { font-size: 26px; margin-bottom: 10px; display: block; }- .choice .title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }- .choice .desc { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }+ .choice-grid {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 14px;+ }+ @media (max-width: 560px) {+ .choice-grid {+ grid-template-columns: 1fr;+ }+ }+ .choice {+ padding: 22px 18px;+ background: var(--panel);+ border: 1px solid var(--border);+ border-radius: 12px;+ color: var(--text);+ font: inherit;+ text-align: left;+ cursor: pointer;+ transition:+ border-color 120ms,+ transform 120ms,+ background 120ms;+ }+ .choice:hover:not(:disabled) {+ border-color: var(--accent);+ transform: translateY(-1px);+ }+ .choice:disabled {+ opacity: 0.45;+ cursor: not-allowed;+ }+ .choice .icon {+ font-size: 26px;+ margin-bottom: 10px;+ display: block;+ }+ .choice .title {+ font-size: 16px;+ font-weight: 600;+ margin: 0 0 4px;+ }+ .choice .desc {+ color: var(--muted);+ font-size: 13px;+ line-height: 1.5;+ margin: 0;+ }- .hero-slot-wrap {- margin: 8px 0 18px;- }- .hero-slot {- aspect-ratio: 1 / 1;- max-width: 360px;- margin: 0 auto;- background: var(--panel);- border: 1.5px dashed var(--border-strong);- border-radius: 16px;- position: relative;- overflow: hidden;- cursor: pointer;- display: flex;- flex-direction: column;- align-items: center;- justify-content: center;- gap: 8px;- color: var(--muted);- transition: border-color 120ms, background 120ms;- }- .hero-slot:hover, .hero-slot:focus-visible { border-color: var(--accent); color: var(--text); outline: none; }- .hero-slot.drag { border-color: var(--accent); background: rgba(255, 255, 255, 0.05); cursor: copy; }- .hero-slot.filled { border-style: solid; border-color: var(--border); padding: 0; cursor: default; }- .hero-slot.error { border-color: var(--danger); }- .hero-slot .hero-icon { font-size: 36px; opacity: 0.7; }- .hero-slot .hero-title { font-size: 15.5px; color: var(--text); font-weight: 600; }- .hero-slot .hero-sub { font-size: 13px; color: var(--muted); max-width: 240px; text-align: center; line-height: 1.4; }- .hero-slot img.preview { width: 100%; height: 100%; object-fit: cover; display: block; }- .hero-slot .retake-btn {- position: absolute;- top: 12px;- right: 12px;- background: rgba(0, 0, 0, 0.65);- backdrop-filter: blur(8px);- -webkit-backdrop-filter: blur(8px);- border: 1px solid rgba(255, 255, 255, 0.15);- color: var(--text);- border-radius: 9px;- padding: 8px 12px;- font: 600 12px/1 inherit;- cursor: pointer;- display: inline-flex;- align-items: center;- gap: 6px;- transition: background 120ms;- z-index: 1;- }- .hero-slot .retake-btn:hover { background: rgba(0, 0, 0, 0.85); }- .hero-actions {- display: flex;- justify-content: center;- gap: 10px;- margin-top: 12px;- flex-wrap: wrap;- }- .hero-pill {- background: var(--panel);- border: 1px solid var(--border);- color: var(--muted);- border-radius: 999px;- padding: 7px 14px;- font: 500 12.5px/1 inherit;- cursor: pointer;- transition: color 120ms, border-color 120ms;- display: inline-flex;- align-items: center;- gap: 7px;- }- .hero-pill:hover { color: var(--text); border-color: var(--border-strong); }- .hero-pill[hidden] { display: none; }- .hero-pill svg { display: block; }+ .hero-slot-wrap {+ margin: 8px 0 18px;+ }+ .hero-slot {+ aspect-ratio: 1 / 1;+ max-width: 360px;+ margin: 0 auto;+ background: var(--panel);+ border: 1.5px dashed var(--border-strong);+ border-radius: 16px;+ position: relative;+ overflow: hidden;+ cursor: pointer;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 8px;+ color: var(--muted);+ transition:+ border-color 120ms,+ background 120ms;+ }+ .hero-slot:hover,+ .hero-slot:focus-visible {+ border-color: var(--accent);+ color: var(--text);+ outline: none;+ }+ .hero-slot.drag {+ border-color: var(--accent);+ background: rgba(255, 255, 255, 0.05);+ cursor: copy;+ }+ .hero-slot.filled {+ border-style: solid;+ border-color: var(--border);+ padding: 0;+ cursor: default;+ }+ .hero-slot.error {+ border-color: var(--danger);+ }+ .hero-slot .hero-icon {+ font-size: 36px;+ opacity: 0.7;+ }+ .hero-slot .hero-title {+ font-size: 15.5px;+ color: var(--text);+ font-weight: 600;+ }+ .hero-slot .hero-sub {+ font-size: 13px;+ color: var(--muted);+ max-width: 240px;+ text-align: center;+ line-height: 1.4;+ }+ .hero-slot img.preview {+ width: 100%;+ height: 100%;+ object-fit: cover;+ display: block;+ }+ .hero-slot .retake-btn {+ position: absolute;+ top: 12px;+ right: 12px;+ background: rgba(0, 0, 0, 0.65);+ backdrop-filter: blur(8px);+ -webkit-backdrop-filter: blur(8px);+ border: 1px solid rgba(255, 255, 255, 0.15);+ color: var(--text);+ border-radius: 9px;+ padding: 8px 12px;+ font: 600 12px/1 inherit;+ cursor: pointer;+ display: inline-flex;+ align-items: center;+ gap: 6px;+ transition: background 120ms;+ z-index: 1;+ }+ .hero-slot .retake-btn:hover {+ background: rgba(0, 0, 0, 0.85);+ }+ .hero-actions {+ display: flex;+ justify-content: center;+ gap: 10px;+ margin-top: 12px;+ flex-wrap: wrap;+ }+ .hero-pill {+ background: var(--panel);+ border: 1px solid var(--border);+ color: var(--muted);+ border-radius: 999px;+ padding: 7px 14px;+ font: 500 12.5px/1 inherit;+ cursor: pointer;+ transition:+ color 120ms,+ border-color 120ms;+ display: inline-flex;+ align-items: center;+ gap: 7px;+ }+ .hero-pill:hover {+ color: var(--text);+ border-color: var(--border-strong);+ }+ .hero-pill[hidden] {+ display: none;+ }+ .hero-pill svg {+ display: block;+ }- .fidelity {- margin: 0 0 22px;- border: 1px solid var(--border);- background: var(--panel);- border-radius: 12px;- overflow: hidden;- }- .fidelity summary {- list-style: none;- padding: 14px 16px;- cursor: pointer;- display: flex;- align-items: center;- justify-content: space-between;- gap: 12px;- color: var(--text);- }- .fidelity summary::-webkit-details-marker { display: none; }- .fidelity .fid-label { font-size: 14px; font-weight: 600; }- .fidelity .fid-note { color: var(--muted); font-size: 12.5px; font-weight: 400; }- .fidelity .fid-chev {- color: var(--muted);- transition: transform 200ms;- }- .fidelity[open] .fid-chev { transform: rotate(180deg); }- .fidelity .fid-body {- padding: 4px 16px 18px;- }- .slots {- display: grid;- grid-template-columns: 1fr 1fr;- gap: 12px;- }- .slot-frame {- aspect-ratio: 3 / 4;- background: var(--panel-elev);- border: 1.5px dashed var(--border-strong);- border-radius: 11px;- position: relative;- overflow: hidden;- cursor: pointer;- display: flex;- flex-direction: column;- align-items: center;- justify-content: center;- gap: 6px;- color: var(--muted);- transition: border-color 120ms, background 120ms;- }- .slot-frame:hover, .slot-frame:focus-visible { border-color: var(--accent); color: var(--text); outline: none; }- .slot-frame.drag { border-color: var(--accent); background: rgba(255, 255, 255, 0.05); cursor: copy; }- .slot-frame.filled { border-style: solid; border-color: var(--border); padding: 0; }- .slot-frame.error { border-color: var(--danger); }- .slot-frame .slot-label { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }- .slot-frame .slot-hint { font-size: 13px; color: var(--text); font-weight: 500; }- .slot-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }- .slot-frame .retake-btn {- position: absolute;- top: 8px;- right: 8px;- background: rgba(0, 0, 0, 0.7);- border: 1px solid rgba(255, 255, 255, 0.2);- color: var(--text);- border-radius: 7px;- padding: 4px 9px;- font: 600 11px/1 inherit;- cursor: pointer;- }+ .fidelity {+ margin: 0 0 22px;+ border: 1px solid var(--border);+ background: var(--panel);+ border-radius: 12px;+ overflow: hidden;+ }+ .fidelity summary {+ list-style: none;+ padding: 14px 16px;+ cursor: pointer;+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ color: var(--text);+ }+ .fidelity summary::-webkit-details-marker {+ display: none;+ }+ .fidelity .fid-label {+ font-size: 14px;+ font-weight: 600;+ }+ .fidelity .fid-note {+ color: var(--muted);+ font-size: 12.5px;+ font-weight: 400;+ }+ .fidelity .fid-chev {+ color: var(--muted);+ transition: transform 200ms;+ }+ .fidelity[open] .fid-chev {+ transform: rotate(180deg);+ }+ .fidelity .fid-body {+ padding: 4px 16px 18px;+ }+ .slots {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 12px;+ }+ .slot-frame {+ aspect-ratio: 3 / 4;+ background: var(--panel-elev);+ border: 1.5px dashed var(--border-strong);+ border-radius: 11px;+ position: relative;+ overflow: hidden;+ cursor: pointer;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 6px;+ color: var(--muted);+ transition:+ border-color 120ms,+ background 120ms;+ }+ .slot-frame:hover,+ .slot-frame:focus-visible {+ border-color: var(--accent);+ color: var(--text);+ outline: none;+ }+ .slot-frame.drag {+ border-color: var(--accent);+ background: rgba(255, 255, 255, 0.05);+ cursor: copy;+ }+ .slot-frame.filled {+ border-style: solid;+ border-color: var(--border);+ padding: 0;+ }+ .slot-frame.error {+ border-color: var(--danger);+ }+ .slot-frame .slot-label {+ font-size: 11.5px;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: var(--muted);+ }+ .slot-frame .slot-hint {+ font-size: 13px;+ color: var(--text);+ font-weight: 500;+ }+ .slot-frame img {+ width: 100%;+ height: 100%;+ object-fit: cover;+ display: block;+ }+ .slot-frame .retake-btn {+ position: absolute;+ top: 8px;+ right: 8px;+ background: rgba(0, 0, 0, 0.7);+ border: 1px solid rgba(255, 255, 255, 0.2);+ color: var(--text);+ border-radius: 7px;+ padding: 4px 9px;+ font: 600 11px/1 inherit;+ cursor: pointer;+ }- .opts {- margin: 0 0 22px;- display: flex;- flex-direction: column;- gap: 18px;- }- .opt-group .opt-label {- font-size: 12px;- letter-spacing: 0.06em;- text-transform: uppercase;- color: var(--muted);- margin: 0 0 10px;- }- .toggle {- display: inline-flex;- background: var(--panel);- border: 1px solid var(--border);- border-radius: 9px;- padding: 3px;- gap: 2px;- }- .toggle button {- background: transparent;- border: none;- color: var(--muted);- font: 600 13px/1 inherit;- padding: 8px 14px;- border-radius: 7px;- cursor: pointer;- }- .toggle button[aria-pressed="true"] {- background: var(--panel-elev);- color: var(--text);- }- .toggle button:hover { color: var(--text); }- .opt-hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }+ .opts {+ margin: 0 0 22px;+ display: flex;+ flex-direction: column;+ gap: 18px;+ }+ .opt-group .opt-label {+ font-size: 12px;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: var(--muted);+ margin: 0 0 10px;+ }+ .toggle {+ display: inline-flex;+ background: var(--panel);+ border: 1px solid var(--border);+ border-radius: 9px;+ padding: 3px;+ gap: 2px;+ }+ .toggle button {+ background: transparent;+ border: none;+ color: var(--muted);+ font: 600 13px/1 inherit;+ padding: 8px 14px;+ border-radius: 7px;+ cursor: pointer;+ }+ .toggle button[aria-pressed='true'] {+ background: var(--panel-elev);+ color: var(--text);+ }+ .toggle button:hover {+ color: var(--text);+ }+ .opt-hint {+ font-size: 12px;+ color: var(--muted);+ margin: 6px 0 0;+ }- .style-grid {- display: grid;- grid-template-columns: 1fr 1fr;- gap: 10px;- }- .style-card {- background: var(--panel);- border: 1.5px solid var(--border);- border-radius: 11px;- padding: 12px;- cursor: pointer;- text-align: left;- color: var(--text);- font: inherit;- display: flex;- gap: 12px;- align-items: center;- transition: border-color 120ms, transform 120ms;- }- .style-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }- .style-card[aria-pressed="true"] {- border-color: var(--accent);- background: rgba(255, 255, 255, 0.04);- }- .style-swatch {- width: 44px;- height: 44px;- border-radius: 8px;- flex-shrink: 0;- background-size: cover;- background-position: center;- border: 1px solid var(--border);- }- .style-swatch.photoreal {- background: radial-gradient(circle at 35% 30%, #f6c79b 0%, #c98c61 45%, #4a2e1d 95%);- }- .style-swatch.stylized {- background: radial-gradient(circle at 35% 30%, #ffd5e8 0%, #c4a3ff 45%, #5a3aa3 95%);- }- .style-card .style-title { font-size: 14px; font-weight: 600; line-height: 1.2; margin: 0 0 2px; }- .style-card .style-desc { font-size: 12px; color: var(--muted); line-height: 1.35; }+ .style-grid {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 10px;+ }+ .style-card {+ background: var(--panel);+ border: 1.5px solid var(--border);+ border-radius: 11px;+ padding: 12px;+ cursor: pointer;+ text-align: left;+ color: var(--text);+ font: inherit;+ display: flex;+ gap: 12px;+ align-items: center;+ transition:+ border-color 120ms,+ transform 120ms;+ }+ .style-card:hover {+ border-color: var(--border-strong);+ transform: translateY(-1px);+ }+ .style-card[aria-pressed='true'] {+ border-color: var(--accent);+ background: rgba(255, 255, 255, 0.04);+ }+ .style-swatch {+ width: 44px;+ height: 44px;+ border-radius: 8px;+ flex-shrink: 0;+ background-size: cover;+ background-position: center;+ border: 1px solid var(--border);+ }+ .style-swatch.photoreal {+ background: radial-gradient(+ circle at 35% 30%,+ #f6c79b 0%,+ #c98c61 45%,+ #4a2e1d 95%+ );+ }+ .style-swatch.stylized {+ background: radial-gradient(+ circle at 35% 30%,+ #ffd5e8 0%,+ #c4a3ff 45%,+ #5a3aa3 95%+ );+ }+ .style-card .style-title {+ font-size: 14px;+ font-weight: 600;+ line-height: 1.2;+ margin: 0 0 2px;+ }+ .style-card .style-desc {+ font-size: 12px;+ color: var(--muted);+ line-height: 1.35;+ }- /* ── Step 3: Building ─────────────────────────────────────────────── */- .build-progress {- display: flex;- flex-direction: column;- gap: 0;- margin: 0 0 28px;- }- .build-step {- display: flex;- align-items: flex-start;- gap: 12px;- padding: 10px 0;- position: relative;- }- .build-step:not(:last-child)::after {- content: '';- position: absolute;- left: 9px;- top: 30px;- bottom: -10px;- width: 2px;- background: var(--border);- }- .build-step.completed::after { background: rgba(255, 255, 255, 0.3); }- .bstep-dot {- width: 20px;- height: 20px;- border-radius: 50%;- border: 2px solid var(--border-strong);- background: var(--panel);- flex-shrink: 0;- margin-top: 1px;- position: relative;- z-index: 1;- }- .build-step.completed .bstep-dot {- background: var(--accent);- border-color: var(--accent);- }- .build-step.completed .bstep-dot::after {- content: '';- display: block;- width: 5px;- height: 9px;- border: 2px solid var(--accent-ink);- border-top: none;- border-left: none;- transform: rotate(45deg) translate(-1px, -1px);- position: absolute;- top: 2px;- left: 5px;- }- .build-step.active .bstep-dot {- border-color: var(--accent);- animation: bstep-pulse 1.4s ease-in-out infinite;- }- @keyframes bstep-pulse {- 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }- 50% { box-shadow: 0 0 0 6px rgba(214, 255, 61, 0); }- }- .bstep-label {- font-size: 14px;- color: var(--muted);- line-height: 1.4;- padding-top: 1px;- }- .build-step.active .bstep-label { color: var(--text); font-weight: 500; }- .build-step.completed .bstep-label { color: var(--muted); }- .build-step.failed .bstep-dot {- background: var(--danger);- border-color: var(--danger);- animation: none;- }- .build-step.failed .bstep-dot::after {- content: '×';- display: block;- color: #fff;- font: 700 14px/1 sans-serif;- text-align: center;- position: absolute;- top: -1px;- left: 2px;- }- .build-step.failed .bstep-label { color: var(--danger); font-weight: 500; }- .build-step.failed::after { background: var(--danger-dim); }+ /* ── Step 3: Building ─────────────────────────────────────────────── */+ .build-progress {+ display: flex;+ flex-direction: column;+ gap: 0;+ margin: 0 0 28px;+ }+ .build-step {+ display: flex;+ align-items: flex-start;+ gap: 12px;+ padding: 10px 0;+ position: relative;+ }+ .build-step:not(:last-child)::after {+ content: '';+ position: absolute;+ left: 9px;+ top: 30px;+ bottom: -10px;+ width: 2px;+ background: var(--border);+ }+ .build-step.completed::after {+ background: rgba(255, 255, 255, 0.3);+ }+ .bstep-dot {+ width: 20px;+ height: 20px;+ border-radius: 50%;+ border: 2px solid var(--border-strong);+ background: var(--panel);+ flex-shrink: 0;+ margin-top: 1px;+ position: relative;+ z-index: 1;+ }+ .build-step.completed .bstep-dot {+ background: var(--accent);+ border-color: var(--accent);+ }+ .build-step.completed .bstep-dot::after {+ content: '';+ display: block;+ width: 5px;+ height: 9px;+ border: 2px solid var(--accent-ink);+ border-top: none;+ border-left: none;+ transform: rotate(45deg) translate(-1px, -1px);+ position: absolute;+ top: 2px;+ left: 5px;+ }+ .build-step.active .bstep-dot {+ border-color: var(--accent);+ animation: bstep-pulse 1.4s ease-in-out infinite;+ }+ @keyframes bstep-pulse {+ 0%,+ 100% {+ box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);+ }+ 50% {+ box-shadow: 0 0 0 6px rgba(214, 255, 61, 0);+ }+ }+ .bstep-label {+ font-size: 14px;+ color: var(--muted);+ line-height: 1.4;+ padding-top: 1px;+ }+ .build-step.active .bstep-label {+ color: var(--text);+ font-weight: 500;+ }+ .build-step.completed .bstep-label {+ color: var(--muted);+ }+ .build-step.failed .bstep-dot {+ background: var(--danger);+ border-color: var(--danger);+ animation: none;+ }+ .build-step.failed .bstep-dot::after {+ content: '×';+ display: block;+ color: #fff;+ font: 700 14px/1 sans-serif;+ text-align: center;+ position: absolute;+ top: -1px;+ left: 2px;+ }+ .build-step.failed .bstep-label {+ color: var(--danger);+ font-weight: 500;+ }+ .build-step.failed::after {+ background: var(--danger-dim);+ }- .build-viewer {- position: relative;- width: 100%;- max-width: 320px;- margin: 0 auto 24px;- aspect-ratio: 3 / 4;- border-radius: 16px;- overflow: hidden;- background: var(--panel);- border: 1px solid var(--border);- }- .build-viewer model-viewer {- width: 100%;- height: 100%;- --poster-color: transparent;- }- .build-preview {- position: absolute;- top: 18px;- left: 50%;- transform: translateX(-50%);- width: 110px;- height: 110px;- border-radius: 50%;- object-fit: cover;- border: 2px solid var(--accent);- box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(255, 255, 255, 0.12);- background: var(--panel);- opacity: 0;- transition: opacity 320ms ease;- animation: preview-breathe 2.4s ease-in-out infinite;- }- .build-preview.show { opacity: 1; }- @keyframes preview-breathe {- 0%, 100% { box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(255, 255, 255, 0.12); }- 50% { box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.6), 0 0 0 9px rgba(255, 255, 255, 0.06); }- }- .build-veil {- position: absolute;- inset: 0;- display: flex;- align-items: flex-end;- justify-content: center;- padding-bottom: 18px;- background: linear-gradient(to bottom, rgba(5,6,10,0.05), rgba(5,6,10,0.45) 65%);- pointer-events: none;- }- .build-ring {- width: 36px;- height: 36px;- border-radius: 50%;- border: 2.5px solid rgba(255, 255, 255, 0.15);- border-top-color: var(--accent);- animation: build-spin 1s linear infinite;- }- @keyframes build-spin { to { transform: rotate(360deg); } }+ .build-viewer {+ position: relative;+ width: 100%;+ max-width: 320px;+ margin: 0 auto 24px;+ aspect-ratio: 3 / 4;+ border-radius: 16px;+ overflow: hidden;+ background: var(--panel);+ border: 1px solid var(--border);+ }+ .build-viewer model-viewer {+ width: 100%;+ height: 100%;+ --poster-color: transparent;+ }+ .build-preview {+ position: absolute;+ top: 18px;+ left: 50%;+ transform: translateX(-50%);+ width: 110px;+ height: 110px;+ border-radius: 50%;+ object-fit: cover;+ border: 2px solid var(--accent);+ box-shadow:+ 0 8px 24px -4px rgba(0, 0, 0, 0.6),+ 0 0 0 4px rgba(255, 255, 255, 0.12);+ background: var(--panel);+ opacity: 0;+ transition: opacity 320ms ease;+ animation: preview-breathe 2.4s ease-in-out infinite;+ }+ .build-preview.show {+ opacity: 1;+ }+ @keyframes preview-breathe {+ 0%,+ 100% {+ box-shadow:+ 0 8px 24px -4px rgba(0, 0, 0, 0.6),+ 0 0 0 4px rgba(255, 255, 255, 0.12);+ }+ 50% {+ box-shadow:+ 0 8px 24px -4px rgba(0, 0, 0, 0.6),+ 0 0 0 9px rgba(255, 255, 255, 0.06);+ }+ }+ .build-veil {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: flex-end;+ justify-content: center;+ padding-bottom: 18px;+ background: linear-gradient(+ to bottom,+ rgba(5, 6, 10, 0.05),+ rgba(5, 6, 10, 0.45) 65%+ );+ pointer-events: none;+ }+ .build-ring {+ width: 36px;+ height: 36px;+ border-radius: 50%;+ border: 2.5px solid rgba(255, 255, 255, 0.15);+ border-top-color: var(--accent);+ animation: build-spin 1s linear infinite;+ }+ @keyframes build-spin {+ to {+ transform: rotate(360deg);+ }+ }- .build-error {- display: none;- padding: 12px 14px;- background: rgba(239, 77, 77, 0.08);- border: 1px solid var(--danger-dim);- border-radius: 9px;- color: #f4b5b5;- font-size: 13.5px;- margin: 0 0 16px;- }- .build-error.show { display: block; }- .build-retry {- width: 100%;- max-width: 320px;- margin: 0 auto;- display: none;- padding: 12px 18px;- background: var(--panel);- border: 1px solid var(--border);- border-radius: 10px;- color: var(--text);- font: 600 14px/1 inherit;- cursor: pointer;- text-align: center;- }- .build-retry.show { display: block; }- .build-retry:hover { border-color: var(--border-strong); }- .build-step { transition: opacity 200ms; }- .build-step.completed { opacity: 0.65; }- .build-step.active { opacity: 1; }+ .build-error {+ display: none;+ padding: 12px 14px;+ background: rgba(239, 77, 77, 0.08);+ border: 1px solid var(--danger-dim);+ border-radius: 9px;+ color: #f4b5b5;+ font-size: 13.5px;+ margin: 0 0 16px;+ }+ .build-error.show {+ display: block;+ }+ .build-retry {+ width: 100%;+ max-width: 320px;+ margin: 0 auto;+ display: none;+ padding: 12px 18px;+ background: var(--panel);+ border: 1px solid var(--border);+ border-radius: 10px;+ color: var(--text);+ font: 600 14px/1 inherit;+ cursor: pointer;+ text-align: center;+ }+ .build-retry.show {+ display: block;+ }+ .build-retry:hover {+ border-color: var(--border-strong);+ }+ .build-step {+ transition: opacity 200ms;+ }+ .build-step.completed {+ opacity: 0.65;+ }+ .build-step.active {+ opacity: 1;+ }- /* ── Step 4: Done ─────────────────────────────────────────────────── */- [data-step="done"] h1 { text-align: center; }- [data-step="done"] .sub { text-align: center; }- .done-viewer {- position: relative;- width: 100%;- max-width: 320px;- margin: 0 auto 24px;- aspect-ratio: 3 / 4;- border-radius: 16px;- overflow: hidden;- background: var(--panel);- border: 1px solid var(--border);- }- .done-viewer::after {- content: '';- position: absolute;- inset: -2px;- border-radius: 18px;- background: conic-gradient(from 0deg, var(--accent), rgba(136, 136, 136, 0.3), var(--accent), rgba(136, 136, 136, 0.3));- z-index: -1;- animation: done-glow 6s linear infinite;- opacity: 0.35;- }- @keyframes done-glow { to { transform: rotate(360deg); } }- .done-viewer model-viewer {- width: 100%;- height: 100%;- --poster-color: transparent;- }- /* Skeleton shimmer while the GLB streams in. */- .done-viewer.loading::before {- content: '';- position: absolute;- inset: 0;- z-index: 1;- background: linear-gradient(100deg, var(--panel) 30%, rgba(255, 255, 255, 0.06) 50%, var(--panel) 70%);- background-size: 200% 100%;- animation: done-shimmer 1.4s ease-in-out infinite;- }- @keyframes done-shimmer { to { background-position: -200% 0; } }- /* GLB failed to load — show a recoverable message, never a black void. */- .done-viewer.failed::before {- content: 'Preview unavailable — open your avatar to view it.';- position: absolute;- inset: 0;- z-index: 1;- display: flex;- align-items: center;- justify-content: center;- text-align: center;- padding: 24px;- color: var(--muted);- font-size: 13px;- line-height: 1.5;- }- .name-row {- margin: 0 0 20px;- }- .name-input {- width: 100%;- padding: 12px 14px;- background: var(--panel);- border: 1px solid var(--border-strong);- border-radius: 10px;- color: var(--text);- font: 15px/1 inherit;- outline: none;- transition: border-color 120ms;- }- .name-input:focus { border-color: var(--accent); }- .name-input::placeholder { color: var(--muted); }- .done-actions {- display: flex;- flex-direction: column;- gap: 10px;- }- .btn-save {- width: 100%;- padding: 14px 18px;- background: var(--accent);- color: var(--accent-ink);- border: none;- border-radius: 10px;- font: 600 15px/1 inherit;- cursor: pointer;- transition: filter 120ms;- }- .btn-save:hover { filter: brightness(1.06); }- .btn-save:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }- .btn-ghost {- width: 100%;- padding: 12px 18px;- background: var(--panel);- color: var(--muted);- border: 1px solid var(--border);- border-radius: 10px;- font: 500 14px/1 inherit;- cursor: pointer;- transition: color 120ms, border-color 120ms;- }- .btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }- .portability-note {- margin-top: 24px;- padding: 14px 16px;- background: rgba(255, 255, 255, 0.04);- border: 1px solid rgba(255, 255, 255, 0.12);- border-radius: 10px;- font-size: 13px;- color: var(--muted);- display: flex;- align-items: center;- justify-content: space-between;- gap: 12px;- flex-wrap: wrap;- }- .portability-note a {- color: var(--accent);- text-decoration: none;- white-space: nowrap;- font-weight: 500;- }- .portability-note a:hover { text-decoration: underline; }+ /* ── Step 4: Done ─────────────────────────────────────────────────── */+ [data-step='done'] h1 {+ text-align: center;+ }+ [data-step='done'] .sub {+ text-align: center;+ }+ .done-viewer {+ position: relative;+ width: 100%;+ max-width: 320px;+ margin: 0 auto 24px;+ aspect-ratio: 3 / 4;+ border-radius: 16px;+ overflow: hidden;+ background: var(--panel);+ border: 1px solid var(--border);+ }+ .done-viewer::after {+ content: '';+ position: absolute;+ inset: -2px;+ border-radius: 18px;+ background: conic-gradient(+ from 0deg,+ var(--accent),+ rgba(136, 136, 136, 0.3),+ var(--accent),+ rgba(136, 136, 136, 0.3)+ );+ z-index: -1;+ animation: done-glow 6s linear infinite;+ opacity: 0.35;+ }+ @keyframes done-glow {+ to {+ transform: rotate(360deg);+ }+ }+ .done-viewer model-viewer {+ width: 100%;+ height: 100%;+ --poster-color: transparent;+ }+ /* Skeleton shimmer while the GLB streams in. */+ .done-viewer.loading::before {+ content: '';+ position: absolute;+ inset: 0;+ z-index: 1;+ background: linear-gradient(+ 100deg,+ var(--panel) 30%,+ rgba(255, 255, 255, 0.06) 50%,+ var(--panel) 70%+ );+ background-size: 200% 100%;+ animation: done-shimmer 1.4s ease-in-out infinite;+ }+ @keyframes done-shimmer {+ to {+ background-position: -200% 0;+ }+ }+ /* GLB failed to load — show a recoverable message, never a black void. */+ .done-viewer.failed::before {+ content: 'Preview unavailable — open your avatar to view it.';+ position: absolute;+ inset: 0;+ z-index: 1;+ display: flex;+ align-items: center;+ justify-content: center;+ text-align: center;+ padding: 24px;+ color: var(--muted);+ font-size: 13px;+ line-height: 1.5;+ }+ .name-row {+ margin: 0 0 20px;+ }+ .name-input {+ width: 100%;+ padding: 12px 14px;+ background: var(--panel);+ border: 1px solid var(--border-strong);+ border-radius: 10px;+ color: var(--text);+ font: 15px/1 inherit;+ outline: none;+ transition: border-color 120ms;+ }+ .name-input:focus {+ border-color: var(--accent);+ }+ .name-input::placeholder {+ color: var(--muted);+ }+ .done-actions {+ display: flex;+ flex-direction: column;+ gap: 10px;+ }+ .btn-save {+ width: 100%;+ padding: 14px 18px;+ background: var(--accent);+ color: var(--accent-ink);+ border: none;+ border-radius: 10px;+ font: 600 15px/1 inherit;+ cursor: pointer;+ transition: filter 120ms;+ }+ .btn-save:hover {+ filter: brightness(1.06);+ }+ .btn-save:disabled {+ opacity: 0.55;+ cursor: not-allowed;+ filter: none;+ }+ .btn-ghost {+ width: 100%;+ padding: 12px 18px;+ background: var(--panel);+ color: var(--muted);+ border: 1px solid var(--border);+ border-radius: 10px;+ font: 500 14px/1 inherit;+ cursor: pointer;+ transition:+ color 120ms,+ border-color 120ms;+ }+ .btn-ghost:hover {+ color: var(--text);+ border-color: var(--border-strong);+ }+ .portability-note {+ margin-top: 24px;+ padding: 14px 16px;+ background: rgba(255, 255, 255, 0.04);+ border: 1px solid rgba(255, 255, 255, 0.12);+ border-radius: 10px;+ font-size: 13px;+ color: var(--muted);+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ flex-wrap: wrap;+ }+ .portability-note a {+ color: var(--accent);+ text-decoration: none;+ white-space: nowrap;+ font-weight: 500;+ }+ .portability-note a:hover {+ text-decoration: underline;+ }- .submit-bar {- margin-top: 6px;- position: sticky;- bottom: 16px;- z-index: 2;- }- .submit-bar[hidden] { display: none; }- #submit-btn {- width: 100%;- padding: 16px 18px;- background: var(--panel);- color: var(--muted);- border: 1px solid var(--border);- border-radius: 12px;- font: 600 15px/1.2 inherit;- cursor: not-allowed;- transition: background 120ms, color 120ms, border-color 120ms;- display: flex;- align-items: center;- justify-content: center;- gap: 10px;- }- #submit-btn .meta {- font: 500 12px/1 inherit;- color: var(--muted);- opacity: 0.85;- }- #submit-btn.ready {- background: var(--accent);- color: var(--accent-ink);- border-color: var(--accent);- cursor: pointer;- box-shadow: 0 10px 30px -10px rgba(255, 255, 255, 0.25);- animation: btn-ready 300ms ease;- }- @keyframes btn-ready {- from { transform: scale(0.97); opacity: 0.8; }- to { transform: scale(1); opacity: 1; }- }- #submit-btn.ready .meta { color: rgba(10, 10, 10, 0.7); }- #submit-btn.ready:hover { filter: brightness(0.92); }+ .submit-bar {+ margin-top: 6px;+ position: sticky;+ bottom: 16px;+ z-index: 2;+ }+ .submit-bar[hidden] {+ display: none;+ }+ #submit-btn {+ width: 100%;+ padding: 16px 18px;+ background: var(--panel);+ color: var(--muted);+ border: 1px solid var(--border);+ border-radius: 12px;+ font: 600 15px/1.2 inherit;+ cursor: not-allowed;+ transition:+ background 120ms,+ color 120ms,+ border-color 120ms;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 10px;+ }+ #submit-btn .meta {+ font: 500 12px/1 inherit;+ color: var(--muted);+ opacity: 0.85;+ }+ #submit-btn.ready {+ background: var(--accent);+ color: var(--accent-ink);+ border-color: var(--accent);+ cursor: pointer;+ box-shadow: 0 10px 30px -10px rgba(255, 255, 255, 0.25);+ animation: btn-ready 300ms ease;+ }+ @keyframes btn-ready {+ from {+ transform: scale(0.97);+ opacity: 0.8;+ }+ to {+ transform: scale(1);+ opacity: 1;+ }+ }+ #submit-btn.ready .meta {+ color: rgba(10, 10, 10, 0.7);+ }+ #submit-btn.ready:hover {+ filter: brightness(0.92);+ }- #cam-overlay {- position: fixed;- inset: 0;- background: #000;- z-index: 1000;- display: none;- flex-direction: column;- }- #cam-overlay.open { display: flex; }- #cam-stage {- position: relative;- flex: 1;- min-height: 0;- overflow: hidden;- }- #cam-stage video,- #cam-stage img.preview {- width: 100%;- height: 100%;- object-fit: cover;- }- #cam-stage video { transform: scaleX(-1); }- #cam-mesh-overlay {- position: absolute;- inset: 0;- width: 100%;- height: 100%;- object-fit: cover;- transform: scaleX(-1);- pointer-events: none;- z-index: 1;- }- .cam-badges {- position: absolute;- top: env(safe-area-inset-top, 12px);- left: 12px;- right: 12px;- display: flex;- gap: 5px;- flex-wrap: wrap;- z-index: 3;- padding-top: 50px;- }- .cam-badge-chip {- font-size: 10.5px;- font-weight: 600;- padding: 3px 8px;- border-radius: 6px;- letter-spacing: 0.03em;- text-transform: uppercase;- background: rgba(0, 0, 0, 0.55);- border: 1px solid rgba(255, 255, 255, 0.1);- color: rgba(255, 255, 255, 0.5);- backdrop-filter: blur(6px);- }- .cam-badge-chip.ok {- color: var(--accent);- border-color: rgba(255, 255, 255, 0.25);- background: rgba(255, 255, 255, 0.1);- }- .cam-badge-chip.bad {- color: #ff6b6b;- border-color: rgba(255, 107, 107, 0.3);- background: rgba(255, 107, 107, 0.08);- }- .cam-prompt {- position: absolute;- top: env(safe-area-inset-top, 18px);- left: 0;- right: 0;- text-align: center;- color: rgba(255, 255, 255, 0.92);- font-size: 13px;- letter-spacing: 0.06em;- text-transform: uppercase;- padding: 16px 18px;- background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);- pointer-events: none;- }- .cam-prompt strong { font-weight: 600; color: var(--accent); }- .cam-oval {- position: absolute;- inset: 0;- pointer-events: none;- display: flex;- align-items: center;- justify-content: center;- }- .cam-oval svg {- width: min(70vw, 60vh);- height: auto;- max-height: 75vh;- }- .cam-oval ellipse {- fill: none;- stroke: rgba(255, 255, 255, 0.45);- stroke-width: 3;- stroke-dasharray: 12 8;- transition: stroke 200ms;- }- .cam-oval.detected ellipse {- stroke: var(--accent);- stroke-dasharray: 0;- filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));- }- .cam-hint {- position: absolute;- bottom: 100px;- left: 0;- right: 0;- text-align: center;- color: rgba(255, 255, 255, 0.85);- font-size: 13px;- padding: 8px 18px;- pointer-events: none;- transition: opacity 200ms;- }- .cam-hint.ok { color: var(--accent); }- #cam-error {- position: absolute;- top: 60px;- left: 16px;- right: 16px;- padding: 10px 14px;- background: rgba(239, 77, 77, 0.92);- color: white;- border-radius: 9px;- font-size: 13.5px;- text-align: center;- }- .cam-bar {- padding: 16px 22px calc(env(safe-area-inset-bottom, 18px) + 18px);- background: rgba(0, 0, 0, 0.7);- display: flex;- align-items: center;- justify-content: space-between;- gap: 16px;- }- .cam-bar button {- background: rgba(255, 255, 255, 0.08);- color: var(--text);- border: 1px solid rgba(255, 255, 255, 0.18);- border-radius: 9px;- padding: 10px 16px;- font: 600 14px/1 inherit;- cursor: pointer;- min-width: 88px;- }- .cam-bar button.shutter {- width: 72px;- height: 72px;- border-radius: 50%;- background: var(--accent);- color: var(--accent-ink);- border: none;- padding: 0;- min-width: 72px;- }- .cam-bar button.shutter::before {- content: '';- display: block;- width: 56px;- height: 56px;- border-radius: 50%;- border: 3px solid var(--accent-ink);- margin: 0 auto;- }- .cam-bar button.shutter:disabled {- opacity: 0.35;- cursor: not-allowed;- filter: grayscale(0.6);- transition: opacity 200ms, filter 200ms;- }- .cam-bar .spacer { flex: 1; }- .cam-countdown {- position: absolute;- inset: 0;- display: none;- align-items: center;- justify-content: center;- pointer-events: none;- z-index: 4;- }- .cam-countdown.show { display: flex; }- .cam-countdown .count-num {- font: 700 96px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;- color: var(--accent);- text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 24px rgba(255, 255, 255, 0.4);- animation: cd-pop 1s ease-out forwards;- }- @keyframes cd-pop {- 0% { transform: scale(0.5); opacity: 0; }- 20% { transform: scale(1.15); opacity: 1; }- 80% { transform: scale(1); opacity: 1; }- 100% { transform: scale(0.8); opacity: 0; }- }+ #cam-overlay {+ position: fixed;+ inset: 0;+ background: #000;+ z-index: 1000;+ display: none;+ flex-direction: column;+ }+ #cam-overlay.open {+ display: flex;+ }+ #cam-stage {+ position: relative;+ flex: 1;+ min-height: 0;+ overflow: hidden;+ }+ #cam-stage video,+ #cam-stage img.preview {+ width: 100%;+ height: 100%;+ object-fit: cover;+ }+ #cam-stage video {+ transform: scaleX(-1);+ }+ #cam-mesh-overlay {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ object-fit: cover;+ transform: scaleX(-1);+ pointer-events: none;+ z-index: 1;+ }+ .cam-badges {+ position: absolute;+ top: env(safe-area-inset-top, 12px);+ left: 12px;+ right: 12px;+ display: flex;+ gap: 5px;+ flex-wrap: wrap;+ z-index: 3;+ padding-top: 50px;+ }+ .cam-badge-chip {+ font-size: 10.5px;+ font-weight: 600;+ padding: 3px 8px;+ border-radius: 6px;+ letter-spacing: 0.03em;+ text-transform: uppercase;+ background: rgba(0, 0, 0, 0.55);+ border: 1px solid rgba(255, 255, 255, 0.1);+ color: rgba(255, 255, 255, 0.5);+ backdrop-filter: blur(6px);+ }+ .cam-badge-chip.ok {+ color: var(--accent);+ border-color: rgba(255, 255, 255, 0.25);+ background: rgba(255, 255, 255, 0.1);+ }+ .cam-badge-chip.bad {+ color: #ff6b6b;+ border-color: rgba(255, 107, 107, 0.3);+ background: rgba(255, 107, 107, 0.08);+ }+ .cam-prompt {+ position: absolute;+ top: env(safe-area-inset-top, 18px);+ left: 0;+ right: 0;+ text-align: center;+ color: rgba(255, 255, 255, 0.92);+ font-size: 13px;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ padding: 16px 18px;+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);+ pointer-events: none;+ }+ .cam-prompt strong {+ font-weight: 600;+ color: var(--accent);+ }+ .cam-oval {+ position: absolute;+ inset: 0;+ pointer-events: none;+ display: flex;+ align-items: center;+ justify-content: center;+ }+ .cam-oval svg {+ width: min(70vw, 60vh);+ height: auto;+ max-height: 75vh;+ }+ .cam-oval ellipse {+ fill: none;+ stroke: rgba(255, 255, 255, 0.45);+ stroke-width: 3;+ stroke-dasharray: 12 8;+ transition: stroke 200ms;+ }+ .cam-oval.detected ellipse {+ stroke: var(--accent);+ stroke-dasharray: 0;+ filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));+ }+ .cam-hint {+ position: absolute;+ bottom: 100px;+ left: 0;+ right: 0;+ text-align: center;+ color: rgba(255, 255, 255, 0.85);+ font-size: 13px;+ padding: 8px 18px;+ pointer-events: none;+ transition: opacity 200ms;+ }+ .cam-hint.ok {+ color: var(--accent);+ }+ #cam-error {+ position: absolute;+ top: 60px;+ left: 16px;+ right: 16px;+ padding: 10px 14px;+ background: rgba(239, 77, 77, 0.92);+ color: white;+ border-radius: 9px;+ font-size: 13.5px;+ text-align: center;+ }+ .cam-bar {+ padding: 16px 22px calc(env(safe-area-inset-bottom, 18px) + 18px);+ background: rgba(0, 0, 0, 0.7);+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 16px;+ }+ .cam-bar button {+ background: rgba(255, 255, 255, 0.08);+ color: var(--text);+ border: 1px solid rgba(255, 255, 255, 0.18);+ border-radius: 9px;+ padding: 10px 16px;+ font: 600 14px/1 inherit;+ cursor: pointer;+ min-width: 88px;+ }+ .cam-bar button.shutter {+ width: 72px;+ height: 72px;+ border-radius: 50%;+ background: var(--accent);+ color: var(--accent-ink);+ border: none;+ padding: 0;+ min-width: 72px;+ }+ .cam-bar button.shutter::before {+ content: '';+ display: block;+ width: 56px;+ height: 56px;+ border-radius: 50%;+ border: 3px solid var(--accent-ink);+ margin: 0 auto;+ }+ .cam-bar button.shutter:disabled {+ opacity: 0.35;+ cursor: not-allowed;+ filter: grayscale(0.6);+ transition:+ opacity 200ms,+ filter 200ms;+ }+ .cam-bar .spacer {+ flex: 1;+ }+ .cam-countdown {+ position: absolute;+ inset: 0;+ display: none;+ align-items: center;+ justify-content: center;+ pointer-events: none;+ z-index: 4;+ }+ .cam-countdown.show {+ display: flex;+ }+ .cam-countdown .count-num {+ font:+ 700 96px/1 -apple-system,+ BlinkMacSystemFont,+ 'Segoe UI',+ sans-serif;+ color: var(--accent);+ text-shadow:+ 0 4px 18px rgba(0, 0, 0, 0.6),+ 0 0 24px rgba(255, 255, 255, 0.4);+ animation: cd-pop 1s ease-out forwards;+ }+ @keyframes cd-pop {+ 0% {+ transform: scale(0.5);+ opacity: 0;+ }+ 20% {+ transform: scale(1.15);+ opacity: 1;+ }+ 80% {+ transform: scale(1);+ opacity: 1;+ }+ 100% {+ transform: scale(0.8);+ opacity: 0;+ }+ }- .done-actions .btn-secondary {- width: 100%;- padding: 12px 18px;- background: transparent;- color: var(--text);- border: 1px solid var(--accent);- border-radius: 10px;- font: 600 14px/1 inherit;- cursor: pointer;- transition: background 120ms;- }- .done-actions .btn-secondary:hover { background: rgba(255, 255, 255, 0.06); }+ .done-actions .btn-secondary {+ width: 100%;+ padding: 12px 18px;+ background: transparent;+ color: var(--text);+ border: 1px solid var(--accent);+ border-radius: 10px;+ font: 600 14px/1 inherit;+ cursor: pointer;+ transition: background 120ms;+ }+ .done-actions .btn-secondary:hover {+ background: rgba(255, 255, 255, 0.06);+ }- .photo-tips {- margin: 16px 0 0;- padding: 12px 16px;- background: rgba(255, 255, 255, 0.03);- border: 1px solid rgba(255, 255, 255, 0.08);- border-radius: 10px;- font-size: 13px;- color: var(--muted);- }- .photo-tips .tips-title {- margin: 0 0 6px;- font-weight: 600;- font-size: 12px;- letter-spacing: 0.04em;- text-transform: uppercase;- color: var(--text);- opacity: 0.7;- }- .photo-tips ul {- margin: 0;- padding-left: 18px;- list-style: disc;- }- .photo-tips li {- margin-bottom: 2px;- line-height: 1.45;- }- .photo-tips li:last-child { margin-bottom: 0; }- </style>- <link rel="stylesheet" href="/mobile.css" />- <script- type="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"- ></script>+ .photo-tips {+ margin: 16px 0 0;+ padding: 12px 16px;+ background: rgba(255, 255, 255, 0.03);+ border: 1px solid rgba(255, 255, 255, 0.08);+ border-radius: 10px;+ font-size: 13px;+ color: var(--muted);+ }+ .photo-tips .tips-title {+ margin: 0 0 6px;+ font-weight: 600;+ font-size: 12px;+ letter-spacing: 0.04em;+ text-transform: uppercase;+ color: var(--text);+ opacity: 0.7;+ }+ .photo-tips ul {+ margin: 0;+ padding-left: 18px;+ list-style: disc;+ }+ .photo-tips li {+ margin-bottom: 2px;+ line-height: 1.45;+ }+ .photo-tips li:last-child {+ margin-bottom: 0;+ }+ </style>+ <link rel="stylesheet" href="/mobile.css" />+ <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>- <link rel="canonical" href="https://three.ws/create/selfie">- <meta name="twitter:card" content="summary_large_image">- <meta name="twitter:title" content="Selfie to Avatar · three.ws">- <meta name="twitter:description" content="One selfie. About a minute. A rigged 3D avatar that works everywhere.">- <meta name="twitter:image" content="https://three.ws/og-image.png">- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Selfie to Avatar","description":"One selfie. About a minute. A rigged 3D avatar that works everywhere.","url":"https://three.ws/create/selfie","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>-<body>- <main class="stage">- <div class="topbar">- <button class="back" id="back-btn" aria-label="Back" type="button">- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="19" y1="12" x2="5" y2="12" />- <polyline points="12 19 5 12 12 5" />- </svg>- </button>- <div class="label"><strong>three.ws</strong> · Selfie to avatar</div>- </div>+ <link rel="canonical" href="https://three.ws/create/selfie" />+ <meta name="twitter:card" content="summary_large_image" />+ <meta name="twitter:title" content="Selfie to Avatar · three.ws" />+ <meta+ name="twitter:description"+ content="One selfie. About a minute. A rigged 3D avatar that works everywhere."+ />+ <meta name="twitter:image" content="https://three.ws/og-image.png" />+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Selfie to Avatar",+ "description": "One selfie. About a minute. A rigged 3D avatar that works everywhere.",+ "url": "https://three.ws/create/selfie",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head>+ <body>+ <main class="stage">+ <div class="topbar">+ <button class="back" id="back-btn" aria-label="Back" type="button">+ <svg+ width="16"+ height="16"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="19" y1="12" x2="5" y2="12" />+ <polyline points="12 19 5 12 12 5" />+ </svg>+ </button>+ <div class="label"><strong>three.ws</strong> · Selfie to avatar</div>+ </div>- <p id="unsupported-msg" class="unsupported">- Your browser can't open the camera here — use Upload instead, or open this page in Safari / Chrome on a device with a camera.- </p>+ <p id="unsupported-msg" class="unsupported">+ Your browser can't open the camera here — use Upload instead, or open this page in+ Safari / Chrome on a device with a camera.+ </p>- <!-- Step 1: capture (entry) -->- <section class="step active" data-step="capture">- <h1>One selfie. One avatar.</h1>- <p class="sub">Front-facing, good light, plain background. We downscale and upload locally — your photo never sits on disk.</p>+ <!-- Step 1: capture (entry) -->+ <section class="step active" data-step="capture">+ <h1>One selfie. One avatar.</h1>+ <p class="sub">+ Front-facing, good light, plain background. We downscale and upload locally —+ your photo never sits on disk.+ </p>- <div class="hero-slot-wrap">- <div class="hero-slot" data-slot="frontal" role="button" tabindex="0" aria-label="Front-facing photo">- <span class="hero-icon" aria-hidden="true">👤</span>- <span class="hero-title">Add a front-facing photo</span>- <span class="hero-sub">Tap to open camera or upload — works on phone or desktop.</span>- </div>- <div class="hero-actions">- <button type="button" class="hero-pill" data-action="open-camera" id="hero-camera-btn">- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>- Use camera- </button>- <button type="button" class="hero-pill" data-action="open-upload">- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>- Upload photo- </button>+ <div class="hero-slot-wrap">+ <div+ class="hero-slot"+ data-slot="frontal"+ role="button"+ tabindex="0"+ aria-label="Front-facing photo"+ >+ <span class="hero-icon" aria-hidden="true">👤</span>+ <span class="hero-title">Add a front-facing photo</span>+ <span class="hero-sub"+ >Tap to open camera or upload — works on phone or desktop.</span+ >+ </div>+ <div class="hero-actions">+ <button+ type="button"+ class="hero-pill"+ data-action="open-camera"+ id="hero-camera-btn"+ >+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <path+ d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"+ />+ <circle cx="12" cy="13" r="4" />+ </svg>+ Use camera+ </button>+ <button type="button" class="hero-pill" data-action="open-upload">+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />+ <polyline points="17 8 12 3 7 8" />+ <line x1="12" y1="3" x2="12" y2="15" />+ </svg>+ Upload photo+ </button>+ </div></div>- </div>- <input type="file" data-slot-input="frontal" accept="image/jpeg,image/png,image/webp,image/heic,image/heif" hidden />+ <input+ type="file"+ data-slot-input="frontal"+ accept="image/jpeg,image/png,image/webp,image/heic,image/heif"+ hidden+ />- <div class="photo-tips" id="photo-tips">- <p class="tips-title">Tips for best results</p>- <ul>- <li>Face the camera directly — no extreme angles</li>- <li>Good, even lighting — avoid harsh shadows or backlighting</li>- <li>Remove sunglasses, masks, or anything covering your face</li>- <li>Keep hair away from your forehead and jawline if possible</li>- </ul>- </div>+ <div class="photo-tips" id="photo-tips">+ <p class="tips-title">Tips for best results</p>+ <ul>+ <li>Face the camera directly — no extreme angles</li>+ <li>Good, even lighting — avoid harsh shadows or backlighting</li>+ <li>Remove sunglasses, masks, or anything covering your face</li>+ <li>Keep hair away from your forehead and jawline if possible</li>+ </ul>+ </div>- <details class="fidelity" id="fidelity-boost">- <summary>- <div>- <div class="fid-label">Add side angles <span class="fid-note">(optional — adds ~30s for more detail)</span></div>- </div>- <svg class="fid-chev" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>- </summary>- <div class="fid-body">- <div class="slots">- <div class="slot-frame" data-slot="left" role="button" tabindex="0" aria-label="Left side photo slot">- <span class="slot-label">Left</span>- <span class="slot-hint">Turn ~45° left</span>+ <details class="fidelity" id="fidelity-boost">+ <summary>+ <div>+ <div class="fid-label">+ Add side angles+ <span class="fid-note">(optional — adds ~30s for more detail)</span>+ </div></div>- <div class="slot-frame" data-slot="right" role="button" tabindex="0" aria-label="Right side photo slot">- <span class="slot-label">Right</span>- <span class="slot-hint">Turn ~45° right</span>+ <svg+ class="fid-chev"+ width="16"+ height="16"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.4"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <polyline points="6 9 12 15 18 9" />+ </svg>+ </summary>+ <div class="fid-body">+ <div class="slots">+ <div+ class="slot-frame"+ data-slot="left"+ role="button"+ tabindex="0"+ aria-label="Left side photo slot"+ >+ <span class="slot-label">Left</span>+ <span class="slot-hint">Turn ~45° left</span>+ </div>+ <div+ class="slot-frame"+ data-slot="right"+ role="button"+ tabindex="0"+ aria-label="Right side photo slot"+ >+ <span class="slot-label">Right</span>+ <span class="slot-hint">Turn ~45° right</span>+ </div></div>+ <input+ type="file"+ data-slot-input="left"+ accept="image/jpeg,image/png,image/webp,image/heic,image/heif"+ hidden+ />+ <input+ type="file"+ data-slot-input="right"+ accept="image/jpeg,image/png,image/webp,image/heic,image/heif"+ hidden+ /></div>- <input type="file" data-slot-input="left" accept="image/jpeg,image/png,image/webp,image/heic,image/heif" hidden />- <input type="file" data-slot-input="right" accept="image/jpeg,image/png,image/webp,image/heic,image/heif" hidden />- </div>- </details>+ </details>- <div class="opts">- <div class="opt-group">- <p class="opt-label">Style</p>- <div class="style-grid" role="group" aria-label="Avatar style">- <button type="button" class="style-card" data-type="v1" aria-pressed="true">- <span class="style-swatch photoreal" aria-hidden="true"></span>- <span>- <span class="style-title">Photoreal</span>- <span class="style-desc">Likeness-first. Closest to how you actually look.</span>- </span>- </button>- <button type="button" class="style-card" data-type="v2" aria-pressed="false">- <span class="style-swatch stylized" aria-hidden="true"></span>- <span>- <span class="style-title">Stylized</span>- <span class="style-desc">Cleaner, cartoon-leaning. Good for streaming + games.</span>- </span>- </button>+ <div class="opts">+ <div class="opt-group">+ <p class="opt-label">Style</p>+ <div class="style-grid" role="group" aria-label="Avatar style">+ <button+ type="button"+ class="style-card"+ data-type="v1"+ aria-pressed="true"+ >+ <span class="style-swatch photoreal" aria-hidden="true"></span>+ <span>+ <span class="style-title">Photoreal</span>+ <span class="style-desc"+ >Likeness-first. Closest to how you actually look.</span+ >+ </span>+ </button>+ <button+ type="button"+ class="style-card"+ data-type="v2"+ aria-pressed="false"+ >+ <span class="style-swatch stylized" aria-hidden="true"></span>+ <span>+ <span class="style-title">Stylized</span>+ <span class="style-desc"+ >Cleaner, cartoon-leaning. Good for streaming + games.</span+ >+ </span>+ </button>+ </div></div>- </div>- <div class="opt-group">- <p class="opt-label">Body</p>- <div class="toggle" role="group" aria-label="Body type">- <button type="button" data-body="male" aria-pressed="true">Masc</button>- <button type="button" data-body="female" aria-pressed="false">Femme</button>+ <div class="opt-group">+ <p class="opt-label">Body</p>+ <div class="toggle" role="group" aria-label="Body type">+ <button type="button" data-body="male" aria-pressed="true">Masc</button>+ <button type="button" data-body="female" aria-pressed="false">+ Femme+ </button>+ </div></div></div>- </div>- <div id="submit-bar" class="submit-bar">- <button id="submit-btn" type="button" disabled>- <span class="label">Add a photo to start</span>- </button>- </div>- </section>+ <div id="submit-bar" class="submit-bar">+ <button id="submit-btn" type="button" disabled>+ <span class="label">Add a photo to start</span>+ </button>+ </div>+ </section>- <!-- Step 3: Building your avatar -->- <section class="step" data-step="building">- <h1>Building your avatar…</h1>- <p class="sub">This usually takes 1–2 minutes. Don't close this tab.</p>+ <!-- Step 3: Building your avatar -->+ <section class="step" data-step="building">+ <h1>Building your avatar…</h1>+ <p class="sub">This usually takes 1–2 minutes. Don't close this tab.</p>- <div class="build-progress" role="list" aria-label="Build progress">- <div class="build-step completed" data-bstep="upload" role="listitem">- <span class="bstep-dot" aria-hidden="true"></span>- <span class="bstep-label">Photos uploaded</span>- </div>- <div class="build-step active" data-bstep="process" role="listitem">- <span class="bstep-dot" aria-hidden="true"></span>- <span class="bstep-label" id="build-status-text" aria-live="polite">Processing your face…</span>- </div>- <div class="build-step" data-bstep="finish" role="listitem">- <span class="bstep-dot" aria-hidden="true"></span>- <span class="bstep-label">Finishing rig</span>- </div>- </div>+ <div class="build-progress" role="list" aria-label="Build progress">+ <div class="build-step completed" data-bstep="upload" role="listitem">+ <span class="bstep-dot" aria-hidden="true"></span>+ <span class="bstep-label">Photos uploaded</span>+ </div>+ <div class="build-step active" data-bstep="process" role="listitem">+ <span class="bstep-dot" aria-hidden="true"></span>+ <span class="bstep-label" id="build-status-text" aria-live="polite"+ >Processing your face…</span+ >+ </div>+ <div class="build-step" data-bstep="finish" role="listitem">+ <span class="bstep-dot" aria-hidden="true"></span>+ <span class="bstep-label">Finishing rig</span>+ </div>+ </div>- <div class="build-viewer" aria-hidden="true">- <model-viewer- src="/avatars/default.glb"- auto-rotate- rotation-per-second="12deg"- interaction-prompt="none"- disable-zoom- disable-pan- shadow-intensity="0.5"- environment-image="neutral"- exposure="0.9"- camera-orbit="0deg 78deg auto"- loading="eager"- ></model-viewer>- <img id="build-preview" class="build-preview" alt="" />- <div class="build-veil">- <div class="build-ring"></div>- </div>- </div>+ <div class="build-viewer" aria-hidden="true">+ <model-viewer+ src="/avatars/default.glb"+ auto-rotate+ rotation-per-second="12deg"+ interaction-prompt="none"+ disable-zoom+ disable-pan+ shadow-intensity="0.5"+ environment-image="neutral"+ exposure="0.9"+ camera-orbit="0deg 78deg auto"+ loading="eager"+ ></model-viewer>+ <img id="build-preview" class="build-preview" alt="" />+ <div class="build-veil">+ <div class="build-ring"></div>+ </div>+ </div>- <p id="build-error-msg" class="build-error" role="alert"></p>- <button id="build-retry-btn" class="build-retry" type="button">← Try again</button>- </section>+ <p id="build-error-msg" class="build-error" role="alert"></p>+ <button id="build-retry-btn" class="build-retry" type="button">← Try again</button>+ </section>- <!-- Step 4: Done -->- <section class="step" data-step="done">- <h1>Your avatar is ready</h1>- <p class="sub">Name it and open it in your workspace.</p>+ <!-- Step 4: Done -->+ <section class="step" data-step="done">+ <h1>Your avatar is ready</h1>+ <p class="sub">Name it and open it in your workspace.</p>- <div class="done-viewer">- <model-viewer- id="done-model"- auto-rotate- rotation-per-second="10deg"- interaction-prompt="none"- camera-controls- shadow-intensity="0.7"- shadow-softness="0.8"- environment-image="neutral"- exposure="0.95"- camera-orbit="0deg 78deg auto"- loading="eager"- alt="Your new avatar"- ></model-viewer>- </div>+ <div class="done-viewer">+ <model-viewer+ id="done-model"+ auto-rotate+ rotation-per-second="10deg"+ interaction-prompt="none"+ camera-controls+ shadow-intensity="0.7"+ shadow-softness="0.8"+ environment-image="neutral"+ exposure="0.95"+ camera-orbit="0deg 78deg auto"+ loading="eager"+ alt="Your new avatar"+ ></model-viewer>+ </div>- <div class="name-row">- <input- type="text"- id="done-name"- class="name-input"- placeholder="Name your avatar"- maxlength="60"- autocomplete="off"- aria-label="Avatar name"- />- </div>+ <div class="name-row">+ <input+ type="text"+ id="done-name"+ class="name-input"+ placeholder="Name your avatar"+ maxlength="60"+ autocomplete="off"+ aria-label="Avatar name"+ />+ </div>- <div class="done-actions">- <button id="done-save-btn" class="btn-save" type="button">Open my avatar →</button>- <button id="done-list-btn" class="btn-secondary" type="button">List on marketplace</button>- <button id="done-editor-btn" class="btn-ghost" type="button">Customize in editor</button>- <button id="done-regen-btn" class="btn-ghost" type="button">Not quite right — try again</button>- </div>+ <div class="done-actions">+ <button id="done-save-btn" class="btn-save" type="button">+ Open my avatar →+ </button>+ <button id="done-list-btn" class="btn-secondary" type="button">+ List on marketplace+ </button>+ <button id="done-editor-btn" class="btn-ghost" type="button">+ Customize in editor+ </button>+ <button id="done-regen-btn" class="btn-ghost" type="button">+ Not quite right — try again+ </button>+ </div>- <div class="portability-note">- <span>This avatar works in any three.ws-powered app.</span>- <a href="/docs/embed" target="_blank" rel="noopener">Learn how to embed →</a>- </div>- </section>- </main>+ <div class="portability-note">+ <span>This avatar works in any three.ws-powered app.</span>+ <a href="/docs/embed" target="_blank" rel="noopener">Learn how to embed →</a>+ </div>+ </section>+ </main>- <!-- Step "unavailable" — shown when the avatar-reconstruction backend isn't+ <!-- Step "unavailable" — shown when the avatar-reconstruction backend isn'twired in this environment (no AVATAR_REGEN_PROVIDER + provider creds).Hidden by default; the boot script swaps to this and hides the otherswhen /api/config.features.avatarReconstruct === false. -->- <section class="step" data-step="unavailable" hidden style="text-align:center;max-width:520px;margin:0 auto;padding:48px 24px;">- <h1 style="margin:0 0 12px;">Selfie avatars are still warming up</h1>- <p class="sub" style="margin:0 0 24px;color:#9aa3b2;">- The photo-to-avatar engine is being provisioned for this environment.- In the meantime, you can build an avatar in the studio — same outputs,- same workflow, fully ready today.- </p>- <div class="done-actions" style="justify-content:center;">- <a href="/create" class="btn-save" style="text-decoration:none;display:inline-block;">Open the avatar studio →</a>- <a href="/app" class="btn-ghost" style="text-decoration:none;display:inline-block;">Back to my workspace</a>- </div>- </section>-- <!-- Camera overlay (driven by selfie-capture.js) -->- <div id="cam-overlay" role="dialog" aria-modal="true" aria-label="Camera capture">- <div id="cam-stage">- <video id="cam-video" autoplay playsinline muted></video>- <canvas id="cam-mesh-overlay" aria-hidden="true"></canvas>- <div class="cam-oval" id="cam-oval" aria-hidden="true">- <svg viewBox="0 0 300 400" preserveAspectRatio="xMidYMid meet">- <ellipse cx="150" cy="180" rx="115" ry="155" />- </svg>- </div>- <div class="cam-badges" id="cam-badges" aria-hidden="true"></div>- <div class="cam-hint" id="cam-hint">Center your face in the oval</div>- <div class="cam-countdown" id="cam-countdown" aria-hidden="true">- <span class="count-num" id="cam-count-num">3</span>+ <section+ class="step"+ data-step="unavailable"+ hidden+ style="text-align: center; max-width: 520px; margin: 0 auto; padding: 48px 24px"+ >+ <h1 style="margin: 0 0 12px">Selfie avatars are still warming up</h1>+ <p class="sub" style="margin: 0 0 24px; color: #9aa3b2">+ The photo-to-avatar engine is being provisioned for this environment. In the+ meantime, you can build an avatar in the studio — same outputs, same workflow, fully+ ready today.+ </p>+ <div class="done-actions" style="justify-content: center">+ <a+ href="/create"+ class="btn-save"+ style="text-decoration: none; display: inline-block"+ >Open the avatar studio →</a+ >+ <a+ href="/app"+ class="btn-ghost"+ style="text-decoration: none; display: inline-block"+ >Back to my workspace</a+ ></div>- </div>- <div class="cam-prompt">- Take your <strong id="cam-slot-name">photo</strong>- </div>- <div id="cam-error" hidden></div>- <div class="cam-bar">- <div id="cam-actions-live" style="display: contents;">- <button type="button" data-cam-action="cancel">Cancel</button>- <button type="button" class="shutter" data-cam-action="shoot" aria-label="Take photo" id="cam-shutter"></button>- <div class="spacer"></div>+ </section>++ <!-- Camera overlay (driven by selfie-capture.js) -->+ <div id="cam-overlay" role="dialog" aria-modal="true" aria-label="Camera capture">+ <div id="cam-stage">+ <video id="cam-video" autoplay playsinline muted></video>+ <canvas id="cam-mesh-overlay" aria-hidden="true"></canvas>+ <div class="cam-oval" id="cam-oval" aria-hidden="true">+ <svg viewBox="0 0 300 400" preserveAspectRatio="xMidYMid meet">+ <ellipse cx="150" cy="180" rx="115" ry="155" />+ </svg>+ </div>+ <div class="cam-badges" id="cam-badges" aria-hidden="true"></div>+ <div class="cam-hint" id="cam-hint">Center your face in the oval</div>+ <div class="cam-countdown" id="cam-countdown" aria-hidden="true">+ <span class="count-num" id="cam-count-num">3</span>+ </div></div>- <div id="cam-actions-review" hidden style="display: contents;">- <button type="button" data-cam-action="retake">Retake</button>- <button type="button" data-cam-action="use">Use this</button>+ <div class="cam-prompt">Take your <strong id="cam-slot-name">photo</strong></div>+ <div id="cam-error" hidden></div>+ <div class="cam-bar">+ <div id="cam-actions-live" style="display: contents">+ <button type="button" data-cam-action="cancel">Cancel</button>+ <button+ type="button"+ class="shutter"+ data-cam-action="shoot"+ aria-label="Take photo"+ id="cam-shutter"+ ></button>+ <div class="spacer"></div>+ </div>+ <div id="cam-actions-review" hidden style="display: contents">+ <button type="button" data-cam-action="retake">Retake</button>+ <button type="button" data-cam-action="use">Use this</button>+ </div></div></div>- </div>-- <script type="module">- function showStep(name) {- document.querySelectorAll('.step[data-step]').forEach((s) => {- s.classList.toggle('active', s.dataset.step === name);- if (name === 'unavailable') s.hidden = s.dataset.step !== 'unavailable';- });- }- // Capability probe — /api/avatars/reconstruct returns 501 unless an ML- // backend is wired. If it's not, switch to the "unavailable" step- // instead of letting the user take three selfies for nothing.- const reconstructReady = await fetch('/api/config', { credentials: 'omit' })- .then((r) => (r.ok ? r.json() : null))- .then((j) => j?.features?.avatarReconstruct !== false)- .catch(() => true); // network failure: assume ready, let the real flow surface the truth-- if (!reconstructReady) {- document.querySelectorAll('.step[data-step]').forEach((s) => {- s.classList.remove('active');- s.hidden = s.dataset.step !== 'unavailable';- });- const u = document.querySelector('.step[data-step="unavailable"]');- if (u) { u.hidden = false; u.classList.add('active'); }- const sb = document.getElementById('submit-bar');- if (sb) sb.hidden = true;- } else {- // Only load the camera + pipeline when we actually need them.- await import('/src/selfie-capture.js');- await import('/src/selfie-pipeline.js');- }+ <script type="module">+ function showStep(name) {+ document.querySelectorAll('.step[data-step]').forEach((s) => {+ s.classList.toggle('active', s.dataset.step === name);+ if (name === 'unavailable') s.hidden = s.dataset.step !== 'unavailable';+ });+ }- let _avatarId = null;- let _docTitleBase = document.title;- let _notifyPermission = (typeof Notification !== 'undefined') ? Notification.permission : 'denied';+ // Capability probe — /api/avatars/reconstruct returns 501 unless an ML+ // backend is wired. If it's not, switch to the "unavailable" step+ // instead of letting the user take three selfies for nothing.+ const reconstructReady = await fetch('/api/config', { credentials: 'omit' })+ .then((r) => (r.ok ? r.json() : null))+ .then((j) => j?.features?.avatarReconstruct !== false)+ .catch(() => true); // network failure: assume ready, let the real flow surface the truth- document.addEventListener('selfie:preview', (e) => {- const dataUrl = /** @type {CustomEvent} */ (e).detail?.dataUrl;- if (!dataUrl) return;- const img = /** @type {HTMLImageElement|null} */ (document.getElementById('build-preview'));- if (!img) return;- img.src = dataUrl;- requestAnimationFrame(() => img.classList.add('show'));- });+ if (!reconstructReady) {+ document.querySelectorAll('.step[data-step]').forEach((s) => {+ s.classList.remove('active');+ s.hidden = s.dataset.step !== 'unavailable';+ });+ const u = document.querySelector('.step[data-step="unavailable"]');+ if (u) {+ u.hidden = false;+ u.classList.add('active');+ }+ const sb = document.getElementById('submit-bar');+ if (sb) sb.hidden = true;+ } else {+ // Only load the camera + pipeline when we actually need them.+ await import('/src/selfie-capture.js');+ await import('/src/selfie-pipeline.js');+ }- document.addEventListener('selfie:building', () => {- showStep('building');- // Ask for notification permission once, while the user is engaged — so- // when they switch tabs mid-build we can ping them back.- if (typeof Notification !== 'undefined' && _notifyPermission === 'default') {- Notification.requestPermission().then((p) => { _notifyPermission = p; }).catch(() => {});- }- });+ let _avatarId = null;+ let _docTitleBase = document.title;+ let _notifyPermission =+ typeof Notification !== 'undefined' ? Notification.permission : 'denied';- document.addEventListener('selfie:progress', (e) => {- const label = /** @type {CustomEvent} */ (e).detail?.label;- if (!label) return;- const el = document.getElementById('build-status-text');- if (el) el.textContent = label;+ document.addEventListener('selfie:preview', (e) => {+ const dataUrl = /** @type {CustomEvent} */ (e).detail?.dataUrl;+ if (!dataUrl) return;+ const img = /** @type {HTMLImageElement|null} */ (+ document.getElementById('build-preview')+ );+ if (!img) return;+ img.src = dataUrl;+ requestAnimationFrame(() => img.classList.add('show'));+ });- // Advance the step indicator to "finish" on later attempts- const processStep = document.querySelector('.build-step[data-bstep="process"]');- const finishStep = document.querySelector('.build-step[data-bstep="finish"]');- if (label.toLowerCase().includes('finish') || label.toLowerCase().includes('rig')) {- processStep?.classList.replace('active', 'completed');- finishStep?.classList.add('active');- }- });+ document.addEventListener('selfie:building', () => {+ showStep('building');+ // Ask for notification permission once, while the user is engaged — so+ // when they switch tabs mid-build we can ping them back.+ if (typeof Notification !== 'undefined' && _notifyPermission === 'default') {+ Notification.requestPermission()+ .then((p) => {+ _notifyPermission = p;+ })+ .catch(() => {});+ }+ });- document.addEventListener('selfie:done', async (e) => {- _avatarId = /** @type {CustomEvent} */ (e).detail?.avatarId;- if (!_avatarId) return;+ document.addEventListener('selfie:progress', (e) => {+ const label = /** @type {CustomEvent} */ (e).detail?.label;+ if (!label) return;+ const el = document.getElementById('build-status-text');+ if (el) el.textContent = label;- document.querySelectorAll('.build-step').forEach((s) => {- s.className = 'build-step completed';+ // Advance the step indicator to "finish" on later attempts+ const processStep = document.querySelector('.build-step[data-bstep="process"]');+ const finishStep = document.querySelector('.build-step[data-bstep="finish"]');+ if (label.toLowerCase().includes('finish') || label.toLowerCase().includes('rig')) {+ processStep?.classList.replace('active', 'completed');+ finishStep?.classList.add('active');+ }});- const viewer = document.querySelector('.done-viewer');- viewer?.classList.add('loading');- viewer?.classList.remove('failed');+ document.addEventListener('selfie:done', async (e) => {+ _avatarId = /** @type {CustomEvent} */ (e).detail?.avatarId;+ if (!_avatarId) return;- try {- const res = await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {- credentials: 'include',+ document.querySelectorAll('.build-step').forEach((s) => {+ s.className = 'build-step completed';});- if (res.ok) {- // The API wraps the record: { avatar: { model_url, name, ... } }.- const { avatar } = await res.json();- const modelEl = document.getElementById('done-model');- const modelUrl = avatar?.model_url || avatar?.url;- if (modelEl && modelUrl) {- modelEl.addEventListener('load', () => viewer?.classList.remove('loading'), { once: true });- modelEl.addEventListener('error', () => {++ const viewer = document.querySelector('.done-viewer');+ viewer?.classList.add('loading');+ viewer?.classList.remove('failed');++ try {+ const res = await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {+ credentials: 'include',+ });+ if (res.ok) {+ // The API wraps the record: { avatar: { model_url, name, ... } }.+ const { avatar } = await res.json();+ const modelEl = document.getElementById('done-model');+ const modelUrl = avatar?.model_url || avatar?.url;+ if (modelEl && modelUrl) {+ modelEl.addEventListener(+ 'load',+ () => viewer?.classList.remove('loading'),+ { once: true },+ );+ modelEl.addEventListener(+ 'error',+ () => {+ viewer?.classList.remove('loading');+ viewer?.classList.add('failed');+ },+ { once: true },+ );+ modelEl.setAttribute('src', modelUrl);+ } else {+ // Materialized but no GLB URL — don't leave a silent black void.viewer?.classList.remove('loading');viewer?.classList.add('failed');- }, { once: true });- modelEl.setAttribute('src', modelUrl);+ }+ const nameEl = /** @type {HTMLInputElement|null} */ (+ document.getElementById('done-name')+ );+ if (nameEl && avatar?.name) nameEl.value = avatar.name;} else {- // Materialized but no GLB URL — don't leave a silent black void.viewer?.classList.remove('loading');viewer?.classList.add('failed');}- const nameEl = /** @type {HTMLInputElement|null} */ (document.getElementById('done-name'));- if (nameEl && avatar?.name) nameEl.value = avatar.name;- } else {+ } catch (_) {viewer?.classList.remove('loading');viewer?.classList.add('failed');}- } catch (_) {- viewer?.classList.remove('loading');- viewer?.classList.add('failed');- }- notifyDone();- showStep('done');- });+ notifyDone();+ showStep('done');+ });- function notifyDone() {- // Page-visible: nothing to do. Page-hidden: flash the title and fire a- // real OS-level notification if the user granted permission.- if (!document.hidden) return;- let on = true;- const tick = window.setInterval(() => {- document.title = on ? '✓ Avatar ready — three.ws' : _docTitleBase;- on = !on;- }, 900);- const restore = () => {- clearInterval(tick);- document.title = _docTitleBase;- document.removeEventListener('visibilitychange', restore);- };- document.addEventListener('visibilitychange', restore);+ function notifyDone() {+ // Page-visible: nothing to do. Page-hidden: flash the title and fire a+ // real OS-level notification if the user granted permission.+ if (!document.hidden) return;+ let on = true;+ const tick = window.setInterval(() => {+ document.title = on ? '✓ Avatar ready — three.ws' : _docTitleBase;+ on = !on;+ }, 900);+ const restore = () => {+ clearInterval(tick);+ document.title = _docTitleBase;+ document.removeEventListener('visibilitychange', restore);+ };+ document.addEventListener('visibilitychange', restore);- if (_notifyPermission === 'granted' && typeof Notification !== 'undefined') {- try {- const n = new Notification('Your avatar is ready', {- body: 'Tap to open it on three.ws.',- icon: '/favicon.ico',- tag: 'avatar-ready',- });- n.onclick = () => {- window.focus();- n.close();- };- } catch (_) {}+ if (_notifyPermission === 'granted' && typeof Notification !== 'undefined') {+ try {+ const n = new Notification('Your avatar is ready', {+ body: 'Tap to open it on three.ws.',+ icon: '/favicon.ico',+ tag: 'avatar-ready',+ });+ n.onclick = () => {+ window.focus();+ n.close();+ };+ } catch (_) {}+ }}- }- document.addEventListener('selfie:build-error', (e) => {- const detail = /** @type {CustomEvent} */ (e).detail || {};- const msg = detail.message || 'Something went wrong. Try again.';- const errEl = document.getElementById('build-error-msg');- const retryBtn = document.getElementById('build-retry-btn');- if (errEl) { errEl.textContent = msg; errEl.classList.add('show'); }- if (retryBtn) retryBtn.classList.add('show');+ document.addEventListener('selfie:build-error', (e) => {+ const detail = /** @type {CustomEvent} */ (e).detail || {};+ const msg = detail.message || 'Something went wrong. Try again.';+ const errEl = document.getElementById('build-error-msg');+ const retryBtn = document.getElementById('build-retry-btn');+ if (errEl) {+ errEl.textContent = msg;+ errEl.classList.add('show');+ }+ if (retryBtn) retryBtn.classList.add('show');- // Stop the spinner and mark the active step as failed.- const ring = document.querySelector('.build-ring');- if (ring) ring.style.display = 'none';- const veil = document.querySelector('.build-veil');- if (veil) veil.style.display = 'none';- const activeStep = document.querySelector('.build-step.active');- if (activeStep) {- activeStep.classList.remove('active');- activeStep.classList.add('failed');- const label = activeStep.querySelector('.bstep-label');- if (label) label.textContent = 'Failed';- }- // Update the heading- const heading = document.querySelector('[data-step="building"] h1');- if (heading) heading.textContent = "Couldn't build your avatar";- const sub = document.querySelector('[data-step="building"] .sub');- if (sub) sub.textContent = 'Check the tips below and try again with a new photo.';+ // Stop the spinner and mark the active step as failed.+ const ring = document.querySelector('.build-ring');+ if (ring) ring.style.display = 'none';+ const veil = document.querySelector('.build-veil');+ if (veil) veil.style.display = 'none';+ const activeStep = document.querySelector('.build-step.active');+ if (activeStep) {+ activeStep.classList.remove('active');+ activeStep.classList.add('failed');+ const label = activeStep.querySelector('.bstep-label');+ if (label) label.textContent = 'Failed';+ }+ // Update the heading+ const heading = document.querySelector('[data-step="building"] h1');+ if (heading) heading.textContent = "Couldn't build your avatar";+ const sub = document.querySelector('[data-step="building"] .sub');+ if (sub) sub.textContent = 'Check the tips below and try again with a new photo.';- // If we can identify the failing slot, highlight it for retake.- if (detail.slot) {- const slotFrame = document.querySelector(- detail.slot === 'frontal'- ? `.hero-slot[data-slot="${detail.slot}"]`- : `.slot-frame[data-slot="${detail.slot}"]`,- );- slotFrame?.classList.add('error');- if (detail.slot !== 'frontal') {- const fid = /** @type {HTMLDetailsElement|null} */ (document.getElementById('fidelity-boost'));- if (fid) fid.open = true;+ // If we can identify the failing slot, highlight it for retake.+ if (detail.slot) {+ const slotFrame = document.querySelector(+ detail.slot === 'frontal'+ ? `.hero-slot[data-slot="${detail.slot}"]`+ : `.slot-frame[data-slot="${detail.slot}"]`,+ );+ slotFrame?.classList.add('error');+ if (detail.slot !== 'frontal') {+ const fid = /** @type {HTMLDetailsElement|null} */ (+ document.getElementById('fidelity-boost')+ );+ if (fid) fid.open = true;+ }}- }- });+ });- document.getElementById('build-retry-btn')?.addEventListener('click', () => {- const errEl = document.getElementById('build-error-msg');- const retryBtn = document.getElementById('build-retry-btn');- errEl?.classList.remove('show');- retryBtn?.classList.remove('show');- // Reset the building step UI for next attempt.- const ring = document.querySelector('.build-ring');- if (ring) ring.style.display = '';- const veil = document.querySelector('.build-veil');- if (veil) veil.style.display = '';- const heading = document.querySelector('[data-step="building"] h1');- if (heading) heading.textContent = 'Building your avatar…';- const sub = document.querySelector('[data-step="building"] .sub');- if (sub) sub.textContent = "This usually takes 1–2 minutes. Don't close this tab.";- document.querySelectorAll('.build-step').forEach((s) => {- s.classList.remove('completed', 'active', 'failed');+ document.getElementById('build-retry-btn')?.addEventListener('click', () => {+ const errEl = document.getElementById('build-error-msg');+ const retryBtn = document.getElementById('build-retry-btn');+ errEl?.classList.remove('show');+ retryBtn?.classList.remove('show');+ // Reset the building step UI for next attempt.+ const ring = document.querySelector('.build-ring');+ if (ring) ring.style.display = '';+ const veil = document.querySelector('.build-veil');+ if (veil) veil.style.display = '';+ const heading = document.querySelector('[data-step="building"] h1');+ if (heading) heading.textContent = 'Building your avatar…';+ const sub = document.querySelector('[data-step="building"] .sub');+ if (sub) sub.textContent = "This usually takes 1–2 minutes. Don't close this tab.";+ document.querySelectorAll('.build-step').forEach((s) => {+ s.classList.remove('completed', 'active', 'failed');+ });+ const uploadStep = document.querySelector('.build-step[data-bstep="upload"]');+ if (uploadStep) uploadStep.classList.add('completed');+ const processStep = document.querySelector('.build-step[data-bstep="process"]');+ if (processStep) processStep.classList.add('active');+ const statusText = document.getElementById('build-status-text');+ if (statusText) statusText.textContent = 'Processing your face…';+ showStep('capture');});- const uploadStep = document.querySelector('.build-step[data-bstep="upload"]');- if (uploadStep) uploadStep.classList.add('completed');- const processStep = document.querySelector('.build-step[data-bstep="process"]');- if (processStep) processStep.classList.add('active');- const statusText = document.getElementById('build-status-text');- if (statusText) statusText.textContent = 'Processing your face…';- showStep('capture');- });- document.getElementById('done-list-btn')?.addEventListener('click', async () => {- if (!_avatarId) return;- const btn = /** @type {HTMLButtonElement} */ (document.getElementById('done-list-btn'));- btn.disabled = true;- btn.textContent = 'Saving…';- const nameEl = /** @type {HTMLInputElement|null} */ (document.getElementById('done-name'));- const name = nameEl?.value?.trim();- if (name) {- try {- await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {- method: 'PATCH',- credentials: 'include',- headers: { 'content-type': 'application/json' },- body: JSON.stringify({ name, visibility: 'public' }),- });- } catch (_) {}- }- window.location.assign(`/marketplace/avatars/${encodeURIComponent(_avatarId)}`);- });+ document.getElementById('done-list-btn')?.addEventListener('click', async () => {+ if (!_avatarId) return;+ const btn = /** @type {HTMLButtonElement} */ (+ document.getElementById('done-list-btn')+ );+ btn.disabled = true;+ btn.textContent = 'Saving…';+ const nameEl = /** @type {HTMLInputElement|null} */ (+ document.getElementById('done-name')+ );+ const name = nameEl?.value?.trim();+ if (name) {+ try {+ await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {+ method: 'PATCH',+ credentials: 'include',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ name, visibility: 'public' }),+ });+ } catch (_) {}+ }+ window.location.assign(`/marketplace/avatars/${encodeURIComponent(_avatarId)}`);+ });- document.getElementById('done-save-btn')?.addEventListener('click', async () => {- if (!_avatarId) return;- const btn = /** @type {HTMLButtonElement} */ (document.getElementById('done-save-btn'));- btn.disabled = true;- btn.textContent = 'Saving…';+ document.getElementById('done-save-btn')?.addEventListener('click', async () => {+ if (!_avatarId) return;+ const btn = /** @type {HTMLButtonElement} */ (+ document.getElementById('done-save-btn')+ );+ btn.disabled = true;+ btn.textContent = 'Saving…';- const nameEl = /** @type {HTMLInputElement|null} */ (document.getElementById('done-name'));- const name = nameEl?.value?.trim();- if (name) {- try {- await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {- method: 'PATCH',- credentials: 'include',- headers: { 'content-type': 'application/json' },- body: JSON.stringify({ name }),- });- } catch (_) {}- }+ const nameEl = /** @type {HTMLInputElement|null} */ (+ document.getElementById('done-name')+ );+ const name = nameEl?.value?.trim();+ if (name) {+ try {+ await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {+ method: 'PATCH',+ credentials: 'include',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ name }),+ });+ } catch (_) {}+ }- window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}`);- });+ window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}`);+ });- document.getElementById('done-editor-btn')?.addEventListener('click', () => {- if (!_avatarId) return;- window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}/edit`);- });+ document.getElementById('done-editor-btn')?.addEventListener('click', () => {+ if (!_avatarId) return;+ window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}/edit`);+ });- document.getElementById('done-regen-btn')?.addEventListener('click', () => {- // Drop the just-built avatar and reset the capture step. Photos in- // memory are gone; the user picks fresh ones. We don't delete the- // avatar row — they can still open it later from /dashboard.- _avatarId = null;- const preview = /** @type {HTMLImageElement|null} */ (document.getElementById('build-preview'));- if (preview) { preview.removeAttribute('src'); preview.classList.remove('show'); }- document.dispatchEvent(new CustomEvent('selfie:reset'));- showStep('capture');- });- </script>- <script src="/brand.js" defer></script>- <script src="/getting-started.js" defer></script>-</body>+ document.getElementById('done-regen-btn')?.addEventListener('click', () => {+ // Drop the just-built avatar and reset the capture step. Photos in+ // memory are gone; the user picks fresh ones. We don't delete the+ // avatar row — they can still open it later from /dashboard.+ _avatarId = null;+ const preview = /** @type {HTMLImageElement|null} */ (+ document.getElementById('build-preview')+ );+ if (preview) {+ preview.removeAttribute('src');+ preview.classList.remove('show');+ }+ document.dispatchEvent(new CustomEvent('selfie:reset'));+ showStep('capture');+ });+ </script>+ <script src="/brand.js" defer></script>+ <script src="/getting-started.js" defer></script>+ </body></html>diff --git a/pages/create.html b/pages/create.htmlindex 6051ad959..7608dd541 100644--- a/pages/create.html+++ b/pages/create.html@@ -21,18 +21,24 @@/><meta name="robots" content="noindex" />- <meta property="og:type" content="website">- <meta property="og:site_name" content="three.ws">- <meta property="og:url" content="https://three.ws/create">- <meta property="og:title" content="Create avatar · three.ws">- <meta property="og:description" content="Create a 3D avatar. Start from a ready-made template in our web editor or upload your own GLB.">- <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="Create avatar · three.ws">- <meta name="twitter:description" content="Create a 3D avatar. Start from a ready-made template in our web editor or upload your own GLB.">- <meta name="twitter:image" content="https://three.ws/og-image.png">+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/create" />+ <meta property="og:title" content="Create avatar · three.ws" />+ <meta+ property="og:description"+ content="Create a 3D avatar. Start from a ready-made template in our web editor or upload your own GLB."+ />+ <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="Create avatar · three.ws" />+ <meta+ name="twitter:description"+ content="Create a 3D avatar. Start from a ready-made template in our web editor or upload your own GLB."+ />+ <meta name="twitter:image" content="https://three.ws/og-image.png" /><style>#page-loading,@@ -75,8 +81,15 @@margin-top: -8px;}@keyframes page-loading-pulse {- 0%, 100% { opacity: 0.55; transform: scale(1); }- 50% { opacity: 1; transform: scale(1.06); }+ 0%,+ 100% {+ opacity: 0.55;+ transform: scale(1);+ }+ 50% {+ opacity: 1;+ transform: scale(1.06);+ }}:root {color-scheme: dark;@@ -171,8 +184,14 @@animation: ya-in 0.4s ease both;}@keyframes ya-in {- from { opacity: 0; transform: translateY(6px); }- to { opacity: 1; transform: translateY(0); }+ from {+ opacity: 0;+ transform: translateY(6px);+ }+ to {+ opacity: 1;+ transform: translateY(0);+ }}.your-avatars-head {display: flex;@@ -195,7 +214,9 @@transition: color 0.15s;white-space: nowrap;}- .your-avatars-manage:hover { color: var(--text); }+ .your-avatars-manage:hover {+ color: var(--text);+ }.your-avatars-row {display: flex;gap: 12px;@@ -221,15 +242,25 @@border-radius: 12px;border: 1px solid var(--border);background:- radial-gradient(circle at 50% 30%, rgba(255,255,255,0.05) 0, transparent 65%),+ radial-gradient(+ circle at 50% 30%,+ rgba(255, 255, 255, 0.05) 0,+ transparent 65%+ ),rgba(255, 255, 255, 0.02);object-fit: cover;display: grid;place-items: center;overflow: hidden;- transition: border-color 0.15s, transform 0.15s;+ transition:+ border-color 0.15s,+ transform 0.15s;+ }+ .ya-thumb-img svg {+ width: 26px;+ height: 26px;+ opacity: 0.5;}- .ya-thumb-img svg { width: 26px; height: 26px; opacity: 0.5; }.ya-thumb-label {display: block;margin-top: 6px;@@ -238,13 +269,17 @@overflow: hidden;text-overflow: ellipsis;}- .ya-thumb:hover { color: var(--text); }+ .ya-thumb:hover {+ color: var(--text);+ }.ya-thumb:hover .ya-thumb-img,.ya-thumb:focus-visible .ya-thumb-img {border-color: rgba(255, 255, 255, 0.4);transform: translateY(-2px);}- .ya-thumb:focus-visible { outline: none; }+ .ya-thumb:focus-visible {+ outline: none;+ }/* ── Cards (shared) ───────────────────────────────────────────────── */.create-card {@@ -295,7 +330,9 @@),var(--panel);}- .hero-card:hover { border-color: rgba(255, 255, 255, 0.34); }+ .hero-card:hover {+ border-color: rgba(255, 255, 255, 0.34);+ }.hero-card-body {display: grid;grid-template-columns: 1fr 280px;@@ -313,7 +350,11 @@border-radius: 14px;border: 1px solid var(--border);background:- radial-gradient(circle at 50% 30%, rgba(255,255,255,0.05) 0, transparent 60%),+ radial-gradient(+ circle at 50% 30%,+ rgba(255, 255, 255, 0.05) 0,+ transparent 60%+ ),rgba(255, 255, 255, 0.02);overflow: hidden;}@@ -363,7 +404,9 @@place-items: center;flex: 0 0 auto;color: #cfd2e0;- transition: background 0.18s, border-color 0.18s;+ transition:+ background 0.18s,+ border-color 0.18s;}.create-card:hover .card-icon {background: rgba(255, 255, 255, 0.08);@@ -449,15 +492,22 @@font-size: 13px;font-weight: 600;cursor: pointer;- transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;+ transition:+ transform 0.15s,+ box-shadow 0.15s,+ opacity 0.15s;align-self: flex-start;}.hero-card:hover .card-cta {box-shadow: 0 8px 22px rgba(255, 255, 255, 0.14);transform: translateY(-1px);}- .card-cta svg { transition: transform 0.18s; }- .create-card:hover .card-cta svg { transform: translateX(3px); }+ .card-cta svg {+ transition: transform 0.18s;+ }+ .create-card:hover .card-cta svg {+ transform: translateX(3px);+ }/* secondary tiles use a quieter ghost CTA */.card-cta--ghost {@@ -487,7 +537,9 @@text-decoration: underline;text-underline-offset: 2px;}- .create-footnote a:hover { color: #fff; }+ .create-footnote a:hover {+ color: #fff;+ }/* ── Status toast ─────────────────────────────────────────────────── */.status-toast {@@ -526,9 +578,16 @@grid-template-columns: 1fr;gap: 20px;}- .hero-card-text { order: 2; }- .hero-card-preview { order: 1; height: 200px; }- .hero-card .card-subtitle { max-width: none; }+ .hero-card-text {+ order: 2;+ }+ .hero-card-preview {+ order: 1;+ height: 200px;+ }+ .hero-card .card-subtitle {+ max-width: none;+ }}@media (max-width: 700px) {main.stage {@@ -750,7 +809,9 @@letter-spacing: -0.005em;padding: 0.35rem 0.7rem;border-radius: var(--radius-md);- transition: color 0.18s ease, background 0.18s ease;+ transition:+ color 0.18s ease,+ background 0.18s ease;position: relative;}.features-nav a:hover {@@ -802,7 +863,10 @@padding: 0.35rem 0.7rem;border-radius: var(--radius-md);cursor: pointer;- transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;+ transition:+ color 0.18s ease,+ background 0.18s ease,+ border-color 0.18s ease;font-family: inherit;}#btn-wallet-signin:hover {@@ -814,16 +878,22 @@.features-nav a:not(.nav-sign-in):not(.nav-user):not(#nav-sign-in) {display: none;}- #btn-wallet-signin { display: none; }+ #btn-wallet-signin {+ display: none;+ }}</style><scripttype="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><script>fetch('/api/auth/me', { credentials: 'include' })- .then(function (r) { return r.ok ? r.json() : null; })+ .then(function (r) {+ return r.ok ? r.json() : null;+ }).then(function (data) {window.__authed = !!(data && data.user);var el = document.getElementById('page-loading');@@ -835,10 +905,19 @@if (el) el.remove();});</script>-- <link rel="canonical" href="https://three.ws/create">- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Create Agent","description":"Wizard for building a new agent: avatar, brain (LLM + prompt), skills, and on-chain identity.","url":"https://three.ws/create","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>++ <link rel="canonical" href="https://three.ws/create" />+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Create Agent",+ "description": "Wizard for building a new agent: avatar, brain (LLM + prompt), skills, and on-chain identity.",+ "url": "https://three.ws/create",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head><body><div id="page-loading" aria-hidden="true"><img src="/three.svg" alt="" />@@ -855,8 +934,8 @@<section class="create-hero"><h1 class="create-title">Create your 3D avatar</h1><p class="create-sub">- Pick a starting point. Customize everything in the browser — most- paths are free and take about a minute.+ Pick a starting point. Customize everything in the browser — most paths are free+ and take about a minute.</p><div class="picker-reassure" data-crypto-optional="compact"></div></section>@@ -871,239 +950,404 @@<div class="your-avatars-row" id="your-avatars-row"></div></section>- <!-- Recommended: customize a base avatar (hero) -->- <div- class="create-card hero-card is-recommended"- id="card-default-editor"- role="button"- tabindex="0"- aria-label="Customize a base avatar in our in-browser editor (recommended)"- >- <span class="recommended-badge" aria-hidden="true">Recommended</span>- <div class="hero-card-body">- <div class="hero-card-text">- <div class="card-icon-row">- <div class="card-icon" aria-hidden="true">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">- <circle cx="12" cy="8" r="3.5" />- <path d="M5 20c0-3.87 3.13-7 7-7s7 3.13 7 7" />- <path d="M18 3l3 3-9 9-4 1 1-4 9-9z" />- </svg>- </div>- <h2 class="card-title">Customize a base avatar</h2>- </div>- <p class="card-subtitle">- Sculpt the face, pick outfits and colors in our in-browser- editor. Start from a base and make it unmistakably yours.- </p>- <div class="card-meta" aria-hidden="true">- <span class="chip">Faces & outfits</span>- <span class="chip">~1 min</span>- <span class="chip chip-ok">No sign-in</span>- </div>- <span class="card-cta">- Open editor- <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="5" y1="12" x2="19" y2="12" />- <polyline points="12 5 19 12 12 19" />- </svg>- </span>- </div>- <div class="hero-card-preview">- <model-viewer- src="/avatars/default.glb"- alt="Customizable 3D base avatar"- auto-rotate- auto-rotate-delay="0"- rotation-per-second="18deg"- interaction-prompt="none"- disable-zoom- disable-pan- disable-tap- shadow-intensity="0.4"- shadow-softness="0.8"- exposure="0.95"- environment-image="neutral"- camera-orbit="15deg 80deg auto"- loading="eager"- ></model-viewer>- </div>- </div>- </div>-- <div class="secondary-grid" role="group" aria-label="More ways to create">- <div class="create-card tile" id="card-customize" role="button" tabindex="0" aria-label="Start with a ready-made template">+ <!-- Recommended: customize a base avatar (hero) -->+ <div+ class="create-card hero-card is-recommended"+ id="card-default-editor"+ role="button"+ tabindex="0"+ aria-label="Customize a base avatar in our in-browser editor (recommended)"+ >+ <span class="recommended-badge" aria-hidden="true">Recommended</span>+ <div class="hero-card-body">+ <div class="hero-card-text"><div class="card-icon-row"><div class="card-icon" aria-hidden="true">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">- <rect x="3" y="3" width="7" height="7" rx="1.5" />- <rect x="14" y="3" width="7" height="7" rx="1.5" />- <rect x="3" y="14" width="7" height="7" rx="1.5" />- <rect x="14" y="14" width="7" height="7" rx="1.5" />+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.7"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <circle cx="12" cy="8" r="3.5" />+ <path d="M5 20c0-3.87 3.13-7 7-7s7 3.13 7 7" />+ <path d="M18 3l3 3-9 9-4 1 1-4 9-9z" /></svg></div>- <h2 class="card-title">Start with a template</h2>+ <h2 class="card-title">Customize a base avatar</h2></div><p class="card-subtitle">- Pick a ready-made avatar and make it yours. The fastest way to- start — preview, save, then customize.+ Sculpt the face, pick outfits and colors in our in-browser editor.+ Start from a base and make it unmistakably yours.</p><div class="card-meta" aria-hidden="true">- <span class="chip chip-ok">Free</span>- <span class="chip">~15 sec</span>+ <span class="chip">Faces & outfits</span>+ <span class="chip">~1 min</span><span class="chip chip-ok">No sign-in</span></div>- <span class="card-cta card-cta--ghost">- Browse templates- <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <span class="card-cta">+ Open editor+ <svg+ width="13"+ height="13"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ ><line x1="5" y1="12" x2="19" y2="12" /><polyline points="12 5 19 12 12 19" /></svg></span></div>- <div class="create-card tile" id="card-selfie" role="button" tabindex="0" aria-label="Scan yourself into a 3D avatar">- <div class="card-icon-row">- <div class="card-icon" aria-hidden="true">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">- <rect x="3" y="5" width="18" height="14" rx="2" />- <circle cx="12" cy="11" r="3" />- <path d="M7 19c0-2 2.5-3 5-3s5 1 5 3" />- </svg>- </div>- <h2 class="card-title">Scan yourself to 3D</h2>- </div>- <p class="card-subtitle">- Point your camera and hold still. About a minute later: a rigged- model you can download and use anywhere.- </p>- <div class="card-meta" aria-hidden="true">- <span class="chip">~1 min</span>- <span class="chip chip-auth">Sign-in</span>- <span class="chip">Rigged GLB</span>- </div>- <span class="card-cta card-cta--ghost">- Open the scanner- <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="5" y1="12" x2="19" y2="12" />- <polyline points="12 5 19 12 12 19" />- </svg>- </span>+ <div class="hero-card-preview">+ <model-viewer+ src="/avatars/default.glb"+ alt="Customizable 3D base avatar"+ auto-rotate+ auto-rotate-delay="0"+ rotation-per-second="18deg"+ interaction-prompt="none"+ disable-zoom+ disable-pan+ disable-tap+ shadow-intensity="0.4"+ shadow-softness="0.8"+ exposure="0.95"+ environment-image="neutral"+ camera-orbit="15deg 80deg auto"+ loading="eager"+ ></model-viewer></div>- <div class="create-card tile" id="card-prompt" role="button" tabindex="0" aria-label="Describe an avatar in words and generate it in 3D">- <div class="card-icon-row">- <div class="card-icon" aria-hidden="true">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">- <path d="M12 3l1.9 5.3L19 10l-5.1 1.7L12 17l-1.9-5.3L5 10l5.1-1.7z" />- <circle cx="18.5" cy="5.5" r="1.4" />- </svg>- </div>- <h2 class="card-title">Describe it to 3D</h2>- </div>- <p class="card-subtitle">- Type what you want — a character, creature, or style. We render it,- reconstruct it in 3D, and rig it so it can move.- </p>- <div class="card-meta" aria-hidden="true">- <span class="chip">~1 min</span>- <span class="chip chip-auth">Sign-in</span>- <span class="chip">Rigged GLB</span>- </div>- <span class="card-cta card-cta--ghost">- Start from a prompt- <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="5" y1="12" x2="19" y2="12" />- <polyline points="12 5 19 12 12 19" />+ </div>+ </div>++ <div class="secondary-grid" role="group" aria-label="More ways to create">+ <div+ class="create-card tile"+ id="card-customize"+ role="button"+ tabindex="0"+ aria-label="Start with a ready-made template"+ >+ <div class="card-icon-row">+ <div class="card-icon" aria-hidden="true">+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.7"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <rect x="3" y="3" width="7" height="7" rx="1.5" />+ <rect x="14" y="3" width="7" height="7" rx="1.5" />+ <rect x="3" y="14" width="7" height="7" rx="1.5" />+ <rect x="14" y="14" width="7" height="7" rx="1.5" /></svg>- </span>- </div>- <div class="create-card tile" id="card-video-avatar" role="button" tabindex="0" aria-label="Generate a talking avatar video">- <div class="card-icon-row">- <div class="card-icon" aria-hidden="true">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">- <path d="M15 10l4.553-2.277A1 1 0 0 1 21 8.626v6.748a1 1 0 0 1-1.447.894L15 14" />- <rect x="3" y="7" width="12" height="10" rx="2" />- </svg>- </div>- <h2 class="card-title">Talking avatar video</h2>- </div>- <p class="card-subtitle">- Upload audio and your avatar lip-syncs to it. Generates a video- you can share anywhere.- </p>- <div class="card-meta" aria-hidden="true">- <span class="chip chip-auth">Sign-in</span>- <span class="chip">Lip-sync</span></div>- <span class="card-cta card-cta--ghost">- Generate video- <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="5" y1="12" x2="19" y2="12" />- <polyline points="12 5 19 12 12 19" />- </svg>- </span>+ <h2 class="card-title">Start with a template</h2></div>- <div class="create-card tile" id="card-upload-glb" role="button" tabindex="0" aria-label="Upload a GLB file">- <div class="card-icon-row">- <div class="card-icon" aria-hidden="true">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">- <polyline points="16 16 12 12 8 16" />- <line x1="12" y1="12" x2="12" y2="21" />- <path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" />- </svg>- </div>- <h2 class="card-title">Upload your own GLB</h2>- </div>- <p class="card-subtitle">- Already have a model? Drop a <code>.glb</code> file. Works with- any glTF 2.0 avatar.- </p>- <div class="card-meta" aria-hidden="true">- <span class="chip">glTF 2.0</span>- <span class="chip chip-ok">No sign-in</span>+ <p class="card-subtitle">+ Pick a ready-made avatar and make it yours. The fastest way to start —+ preview, save, then customize.+ </p>+ <div class="card-meta" aria-hidden="true">+ <span class="chip chip-ok">Free</span>+ <span class="chip">~15 sec</span>+ <span class="chip chip-ok">No sign-in</span>+ </div>+ <span class="card-cta card-cta--ghost">+ Browse templates+ <svg+ width="13"+ height="13"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="5" y1="12" x2="19" y2="12" />+ <polyline points="12 5 19 12 12 19" />+ </svg>+ </span>+ </div>+ <div+ class="create-card tile"+ id="card-selfie"+ role="button"+ tabindex="0"+ aria-label="Scan yourself into a 3D avatar"+ >+ <div class="card-icon-row">+ <div class="card-icon" aria-hidden="true">+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.7"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <rect x="3" y="5" width="18" height="14" rx="2" />+ <circle cx="12" cy="11" r="3" />+ <path d="M7 19c0-2 2.5-3 5-3s5 1 5 3" />+ </svg></div>- <span class="card-cta card-cta--ghost">- Choose file- <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="5" y1="12" x2="19" y2="12" />- <polyline points="12 5 19 12 12 19" />+ <h2 class="card-title">Scan yourself to 3D</h2>+ </div>+ <p class="card-subtitle">+ Point your camera and hold still. About a minute later: a rigged model+ you can download and use anywhere.+ </p>+ <div class="card-meta" aria-hidden="true">+ <span class="chip">~1 min</span>+ <span class="chip chip-auth">Sign-in</span>+ <span class="chip">Rigged GLB</span>+ </div>+ <span class="card-cta card-cta--ghost">+ Open the scanner+ <svg+ width="13"+ height="13"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="5" y1="12" x2="19" y2="12" />+ <polyline points="12 5 19 12 12 19" />+ </svg>+ </span>+ </div>+ <div+ class="create-card tile"+ id="card-prompt"+ role="button"+ tabindex="0"+ aria-label="Describe an avatar in words and generate it in 3D"+ >+ <div class="card-icon-row">+ <div class="card-icon" aria-hidden="true">+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.7"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path+ d="M12 3l1.9 5.3L19 10l-5.1 1.7L12 17l-1.9-5.3L5 10l5.1-1.7z"+ />+ <circle cx="18.5" cy="5.5" r="1.4" /></svg>- </span>+ </div>+ <h2 class="card-title">Describe it to 3D</h2></div>- <div class="create-card tile" id="card-agent-studio" role="button" tabindex="0" aria-label="Try the Avatar Studio (beta)">- <div class="card-icon-row">- <div class="card-icon" aria-hidden="true">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">- <circle cx="12" cy="8" r="3.5" />- <path d="M5 20c0-3.87 3.13-7 7-7s7 3.13 7 7" />- <path d="M17 3l2 2-2 2" />- <path d="M21 5h-4" />- </svg>- </div>- <h2 class="card-title">Avatar Studio <span style="font-size:0.7em;opacity:0.5;font-weight:400;">beta</span></h2>+ <p class="card-subtitle">+ Type what you want — a character, creature, or style. We render it,+ reconstruct it in 3D, and rig it so it can move.+ </p>+ <div class="card-meta" aria-hidden="true">+ <span class="chip">~1 min</span>+ <span class="chip chip-auth">Sign-in</span>+ <span class="chip">Rigged GLB</span>+ </div>+ <span class="card-cta card-cta--ghost">+ Start from a prompt+ <svg+ width="13"+ height="13"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="5" y1="12" x2="19" y2="12" />+ <polyline points="12 5 19 12 12 19" />+ </svg>+ </span>+ </div>+ <div+ class="create-card tile"+ id="card-video-avatar"+ role="button"+ tabindex="0"+ aria-label="Generate a talking avatar video"+ >+ <div class="card-icon-row">+ <div class="card-icon" aria-hidden="true">+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.7"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path+ d="M15 10l4.553-2.277A1 1 0 0 1 21 8.626v6.748a1 1 0 0 1-1.447.894L15 14"+ />+ <rect x="3" y="7" width="12" height="10" rx="2" />+ </svg></div>- <p class="card-subtitle">- Build from scratch. Sculpt face and body, pick outfits, add- accessories — all in your browser.- </p>- <div class="card-meta" aria-hidden="true">- <span class="chip">Sculpt & dress</span>- <span class="chip chip-ok">No sign-in</span>+ <h2 class="card-title">Talking avatar video</h2>+ </div>+ <p class="card-subtitle">+ Upload audio and your avatar lip-syncs to it. Generates a video you can+ share anywhere.+ </p>+ <div class="card-meta" aria-hidden="true">+ <span class="chip chip-auth">Sign-in</span>+ <span class="chip">Lip-sync</span>+ </div>+ <span class="card-cta card-cta--ghost">+ Generate video+ <svg+ width="13"+ height="13"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="5" y1="12" x2="19" y2="12" />+ <polyline points="12 5 19 12 12 19" />+ </svg>+ </span>+ </div>+ <div+ class="create-card tile"+ id="card-upload-glb"+ role="button"+ tabindex="0"+ aria-label="Upload a GLB file"+ >+ <div class="card-icon-row">+ <div class="card-icon" aria-hidden="true">+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.7"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <polyline points="16 16 12 12 8 16" />+ <line x1="12" y1="12" x2="12" y2="21" />+ <path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" />+ </svg></div>- <span class="card-cta card-cta--ghost">- Try studio- <svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="5" y1="12" x2="19" y2="12" />- <polyline points="12 5 19 12 12 19" />+ <h2 class="card-title">Upload your own GLB</h2>+ </div>+ <p class="card-subtitle">+ Already have a model? Drop a <code>.glb</code> file. Works with any glTF+ 2.0 avatar.+ </p>+ <div class="card-meta" aria-hidden="true">+ <span class="chip">glTF 2.0</span>+ <span class="chip chip-ok">No sign-in</span>+ </div>+ <span class="card-cta card-cta--ghost">+ Choose file+ <svg+ width="13"+ height="13"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="5" y1="12" x2="19" y2="12" />+ <polyline points="12 5 19 12 12 19" />+ </svg>+ </span>+ </div>+ <div+ class="create-card tile"+ id="card-agent-studio"+ role="button"+ tabindex="0"+ aria-label="Try the Avatar Studio (beta)"+ >+ <div class="card-icon-row">+ <div class="card-icon" aria-hidden="true">+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.7"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <circle cx="12" cy="8" r="3.5" />+ <path d="M5 20c0-3.87 3.13-7 7-7s7 3.13 7 7" />+ <path d="M17 3l2 2-2 2" />+ <path d="M21 5h-4" /></svg>- </span>+ </div>+ <h2 class="card-title">+ Avatar Studio+ <span style="font-size: 0.7em; opacity: 0.5; font-weight: 400"+ >beta</span+ >+ </h2>+ </div>+ <p class="card-subtitle">+ Build from scratch. Sculpt face and body, pick outfits, add accessories+ — all in your browser.+ </p>+ <div class="card-meta" aria-hidden="true">+ <span class="chip">Sculpt & dress</span>+ <span class="chip chip-ok">No sign-in</span></div>+ <span class="card-cta card-cta--ghost">+ Try studio+ <svg+ width="13"+ height="13"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="5" y1="12" x2="19" y2="12" />+ <polyline points="12 5 19 12 12 19" />+ </svg>+ </span></div>-- <p class="create-footnote">- Need a model to upload? Build one in <a href="/studio">three.ws Studio</a>.- Bringing an avatar from another platform? <a href="/import/rpm">import it here</a>.- </p></div>++ <p class="create-footnote">+ Need a model to upload? Build one in <a href="/studio">three.ws Studio</a>.+ Bringing an avatar from another platform?+ <a href="/import/rpm">import it here</a>.+ </p>+ </div></main><labelfor="glb-input"@@ -1147,11 +1391,17 @@const { authed, name } = JSON.parse(raw);if (authed) {const el = document.getElementById('nav-sign-in');- if (el) { el.textContent = 'Dashboard'; el.href = '/dashboard'; }+ if (el) {+ el.textContent = 'Dashboard';+ el.href = '/dashboard';+ }const myAgents = document.getElementById('nav-my-agents');if (myAgents) myAgents.hidden = false;const userEl = document.getElementById('nav-user');- if (userEl && name) { userEl.textContent = name; userEl.hidden = false; }+ if (userEl && name) {+ userEl.textContent = name;+ userEl.hidden = false;+ }}}} catch (_) {}@@ -1165,5 +1415,5 @@<script src="/brand.js" defer></script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/create/video.html b/pages/create/video.htmlindex f8c47d1d7..8aebeda84 100644--- a/pages/create/video.html+++ b/pages/create/video.html@@ -23,10 +23,21 @@--muted: #8a8d98;--radius: 16px;}- * { box-sizing: border-box; }- html, body { margin: 0; padding: 0; }+ * {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ padding: 0;+ }body {- font: 15px/1.55 -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;+ font:+ 15px/1.55 -apple-system,+ system-ui,+ 'Segoe UI',+ Roboto,+ sans-serif;color: var(--text);background: var(--bg);min-height: 100vh;@@ -38,45 +49,167 @@z-index: -1;pointer-events: none;background:- radial-gradient(800px 500px at 50% -100px, rgba(255,255,255,.05) 0, transparent 70%),- radial-gradient(600px 400px at 50% 110%, rgba(255,255,255,.04) 0, transparent 70%),+ radial-gradient(+ 800px 500px at 50% -100px,+ rgba(255, 255, 255, 0.05) 0,+ transparent 70%+ ),+ radial-gradient(+ 600px 400px at 50% 110%,+ rgba(255, 255, 255, 0.04) 0,+ transparent 70%+ ),#060606;}/* ── Page chrome ───────────────────────────────────────────── */:root {- --space-xs: 0.382rem; --space-sm: 0.618rem;- --space-md: 1rem; --space-lg: 1.618rem;- --text-sm: 0.764rem; --text-lg: 1.236rem;- --radius-md: 5px; --header-h: 3.5rem;- --font-display: 'Space Grotesk','Inter',system-ui,sans-serif;- }- .skip-link { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }- .skip-link:focus { left:1rem; top:1rem; width:auto; height:auto; padding:.5rem 1rem; background:var(--bg); border:1px solid var(--border); border-radius:6px; z-index:9999; }+ --space-xs: 0.382rem;+ --space-sm: 0.618rem;+ --space-md: 1rem;+ --space-lg: 1.618rem;+ --text-sm: 0.764rem;+ --text-lg: 1.236rem;+ --radius-md: 5px;+ --header-h: 3.5rem;+ --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;+ }+ .skip-link {+ position: absolute;+ left: -9999px;+ top: auto;+ width: 1px;+ height: 1px;+ overflow: hidden;+ }+ .skip-link:focus {+ left: 1rem;+ top: 1rem;+ width: auto;+ height: auto;+ padding: 0.5rem 1rem;+ background: var(--bg);+ border: 1px solid var(--border);+ border-radius: 6px;+ z-index: 9999;+ }header.site-header {- display:flex; background:rgba(0,0,0,.8);- backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);- padding:0 var(--space-lg); height:var(--header-h);- align-items:center; overflow-x:auto; overflow-y:hidden;- white-space:nowrap; border-bottom:1px solid rgba(255,255,255,.06); z-index:10;+ display: flex;+ background: rgba(0, 0, 0, 0.8);+ backdrop-filter: blur(20px);+ -webkit-backdrop-filter: blur(20px);+ padding: 0 var(--space-lg);+ height: var(--header-h);+ align-items: center;+ overflow-x: auto;+ overflow-y: hidden;+ white-space: nowrap;+ border-bottom: 1px solid rgba(255, 255, 255, 0.06);+ z-index: 10;}header.site-header h1 {- color:#fff; font-family:var(--font-display); font-size:var(--text-lg);- font-weight:600; margin:0; letter-spacing:-.01em;- display:flex; align-items:center; gap:var(--space-xs); line-height:var(--header-h);- }- header.site-header h1>a { color:inherit; font-size:inherit; text-decoration:none; display:flex; align-items:center; gap:.5rem; }- .wordmark-dot { width:8px; height:8px; border-radius:50%; background:linear-gradient(135deg,#ffffff,#ffffff); box-shadow:0 0 10px rgba(255,255,255,.6); display:inline-block; }- .nav-logo-img { width:28px; height:28px; object-fit:contain; border-radius:6px; }- .features-nav { margin-left:auto; display:flex; gap:var(--space-md); align-items:center; }- .features-nav a { color:rgba(255,255,255,.5); text-decoration:none; font-size:var(--text-sm); font-weight:500; padding:.35rem .7rem; border-radius:var(--radius-md); transition:color .18s,background .18s; }- .features-nav a:hover { color:#fff; background:rgba(255,255,255,.04); }- .nav-sign-in { border:1px solid rgba(255,255,255,.12); border-radius:var(--radius-md); }- .nav-user { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:20px; border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.04); font-size:var(--text-sm); color:rgba(255,255,255,.55); max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }- .nav-user::before { content:''; width:6px; height:6px; border-radius:50%; background:#4ade80; flex-shrink:0; }- #btn-wallet-signin { background:none; border:1px solid rgba(255,255,255,.12); color:rgba(255,255,255,.5); font-size:var(--text-sm); font-weight:500; padding:.35rem .7rem; border-radius:var(--radius-md); cursor:pointer; transition:color .18s,background .18s,border-color .18s; font-family:inherit; }- #btn-wallet-signin:hover { color:#fff; background:rgba(255,255,255,.04); border-color:rgba(255,255,255,.2); }+ color: #fff;+ font-family: var(--font-display);+ font-size: var(--text-lg);+ font-weight: 600;+ margin: 0;+ letter-spacing: -0.01em;+ display: flex;+ align-items: center;+ gap: var(--space-xs);+ line-height: var(--header-h);+ }+ header.site-header h1 > a {+ color: inherit;+ font-size: inherit;+ text-decoration: none;+ display: flex;+ align-items: center;+ gap: 0.5rem;+ }+ .wordmark-dot {+ width: 8px;+ height: 8px;+ border-radius: 50%;+ background: linear-gradient(135deg, #ffffff, #ffffff);+ box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);+ display: inline-block;+ }+ .nav-logo-img {+ width: 28px;+ height: 28px;+ object-fit: contain;+ border-radius: 6px;+ }+ .features-nav {+ margin-left: auto;+ display: flex;+ gap: var(--space-md);+ align-items: center;+ }+ .features-nav a {+ color: rgba(255, 255, 255, 0.5);+ text-decoration: none;+ font-size: var(--text-sm);+ font-weight: 500;+ padding: 0.35rem 0.7rem;+ border-radius: var(--radius-md);+ transition:+ color 0.18s,+ background 0.18s;+ }+ .features-nav a:hover {+ color: #fff;+ background: rgba(255, 255, 255, 0.04);+ }+ .nav-sign-in {+ border: 1px solid rgba(255, 255, 255, 0.12);+ border-radius: var(--radius-md);+ }+ .nav-user {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ padding: 4px 10px;+ border-radius: 20px;+ border: 1px solid rgba(255, 255, 255, 0.1);+ background: rgba(255, 255, 255, 0.04);+ font-size: var(--text-sm);+ color: rgba(255, 255, 255, 0.55);+ max-width: 140px;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .nav-user::before {+ content: '';+ width: 6px;+ height: 6px;+ border-radius: 50%;+ background: #4ade80;+ flex-shrink: 0;+ }+ #btn-wallet-signin {+ background: none;+ border: 1px solid rgba(255, 255, 255, 0.12);+ color: rgba(255, 255, 255, 0.5);+ font-size: var(--text-sm);+ font-weight: 500;+ padding: 0.35rem 0.7rem;+ border-radius: var(--radius-md);+ cursor: pointer;+ transition:+ color 0.18s,+ background 0.18s,+ border-color 0.18s;+ font-family: inherit;+ }+ #btn-wallet-signin:hover {+ color: #fff;+ background: rgba(255, 255, 255, 0.04);+ border-color: rgba(255, 255, 255, 0.2);+ }/* ── Layout ─────────────────────────────────────────────────── */main {@@ -98,18 +231,35 @@width: 36px;height: 36px;border-radius: 10px;- background: rgba(255,255,255,.04);+ background: rgba(255, 255, 255, 0.04);border: 1px solid var(--border);color: var(--muted);cursor: pointer;text-decoration: none;flex-shrink: 0;- transition: color .15s, border-color .15s;+ transition:+ color 0.15s,+ border-color 0.15s;+ }+ .back-btn:hover {+ color: var(--text);+ border-color: #2e2e2e;+ }+ .back-btn svg {+ width: 18px;+ height: 18px;+ }+ .page-title {+ font-size: 22px;+ font-weight: 600;+ margin: 0;+ letter-spacing: -0.01em;+ }+ .page-subtitle {+ font-size: 13px;+ color: var(--muted);+ margin: 4px 0 0;}- .back-btn:hover { color: var(--text); border-color: #2e2e2e; }- .back-btn svg { width: 18px; height: 18px; }- .page-title { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }- .page-subtitle { font-size: 13px; color: var(--muted); margin: 4px 0 0; }/* ── Two-panel layout ───────────────────────────────────────── */.workspace {@@ -129,7 +279,13 @@.avatar-preview-wrap {position: relative;aspect-ratio: 4/5;- background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.05) 0, transparent 60%), rgba(255,255,255,.015);+ background:+ radial-gradient(+ circle at 50% 30%,+ rgba(255, 255, 255, 0.05) 0,+ transparent 60%+ ),+ rgba(255, 255, 255, 0.015);}model-viewer {width: 100%;@@ -145,7 +301,9 @@overflow-x: auto;scrollbar-width: none;}- .avatar-select-bar::-webkit-scrollbar { display: none; }+ .avatar-select-bar::-webkit-scrollbar {+ display: none;+ }.avatar-thumb {width: 48px;height: 48px;@@ -155,11 +313,17 @@cursor: pointer;flex-shrink: 0;background: var(--panel2);- transition: border-color .15s;+ transition: border-color 0.15s;position: relative;}- .avatar-thumb.is-selected { border-color: var(--accent); }- .avatar-thumb img { width: 100%; height: 100%; object-fit: cover; }+ .avatar-thumb.is-selected {+ border-color: var(--accent);+ }+ .avatar-thumb img {+ width: 100%;+ height: 100%;+ object-fit: cover;+ }.avatar-thumb-placeholder {width: 100%;height: 100%;@@ -168,7 +332,10 @@justify-content: center;color: var(--muted);}- .avatar-thumb-placeholder svg { width: 20px; height: 20px; }+ .avatar-thumb-placeholder svg {+ width: 20px;+ height: 20px;+ }.avatar-select-loading {color: var(--muted);font-size: 12px;@@ -190,7 +357,7 @@.control-label {font-size: 12px;font-weight: 600;- letter-spacing: .06em;+ letter-spacing: 0.06em;text-transform: uppercase;color: var(--muted);margin: 0 0 12px;@@ -203,18 +370,28 @@padding: 28px 20px;text-align: center;cursor: pointer;- transition: border-color .2s, background .2s;+ transition:+ border-color 0.2s,+ background 0.2s;color: var(--muted);font-size: 13px;position: relative;}- .audio-drop:hover, .audio-drop.is-dragover {- border-color: rgba(255,255,255,.4);- background: rgba(255,255,255,.03);+ .audio-drop:hover,+ .audio-drop.is-dragover {+ border-color: rgba(255, 255, 255, 0.4);+ background: rgba(255, 255, 255, 0.03);color: var(--text);}- .audio-drop svg { width: 28px; height: 28px; margin-bottom: 10px; display: block; margin-left: auto; margin-right: auto; }- .audio-drop input[type="file"] {+ .audio-drop svg {+ width: 28px;+ height: 28px;+ margin-bottom: 10px;+ display: block;+ margin-left: auto;+ margin-right: auto;+ }+ .audio-drop input[type='file'] {position: absolute;inset: 0;opacity: 0;@@ -228,13 +405,25 @@gap: 10px;padding: 10px 12px;border-radius: 10px;- background: rgba(255,255,255,.04);+ background: rgba(255, 255, 255, 0.04);border: 1px solid var(--border);font-size: 13px;}- .audio-file-name.is-visible { display: flex; }- .audio-file-name svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }- .audio-file-name .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+ .audio-file-name.is-visible {+ display: flex;+ }+ .audio-file-name svg {+ width: 16px;+ height: 16px;+ color: var(--accent);+ flex-shrink: 0;+ }+ .audio-file-name .fname {+ flex: 1;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }.audio-file-clear {background: none;border: none;@@ -245,13 +434,18 @@display: flex;align-items: center;}- .audio-file-clear:hover { color: var(--text); }- .audio-file-clear svg { width: 14px; height: 14px; }+ .audio-file-clear:hover {+ color: var(--text);+ }+ .audio-file-clear svg {+ width: 14px;+ height: 14px;+ }/* Prompt */.prompt-input {width: 100%;- background: rgba(255,255,255,.04);+ background: rgba(255, 255, 255, 0.04);border: 1px solid var(--border);border-radius: 10px;padding: 10px 12px;@@ -260,11 +454,15 @@font-size: 13px;resize: vertical;min-height: 72px;- transition: border-color .15s;+ transition: border-color 0.15s;outline: none;}- .prompt-input:focus { border-color: rgba(255,255,255,.35); }- .prompt-input::placeholder { color: var(--muted); }+ .prompt-input:focus {+ border-color: rgba(255, 255, 255, 0.35);+ }+ .prompt-input::placeholder {+ color: var(--muted);+ }/* Generate button */.generate-btn {@@ -282,11 +480,23 @@align-items: center;justify-content: center;gap: 8px;- transition: opacity .15s, transform .12s;+ transition:+ opacity 0.15s,+ transform 0.12s;+ }+ .generate-btn:hover:not(:disabled) {+ opacity: 0.9;+ transform: translateY(-1px);+ }+ .generate-btn:disabled {+ opacity: 0.35;+ cursor: not-allowed;+ transform: none;+ }+ .generate-btn svg {+ width: 18px;+ height: 18px;}- .generate-btn:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }- .generate-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }- .generate-btn svg { width: 18px; height: 18px; }/* ── Progress / result ──────────────────────────────────────── */.result-block {@@ -296,31 +506,49 @@overflow: hidden;display: none;}- .result-block.is-visible { display: block; }+ .result-block.is-visible {+ display: block;+ }.progress-area {padding: 32px 24px;text-align: center;display: none;}- .progress-area.is-visible { display: block; }+ .progress-area.is-visible {+ display: block;+ }.progress-spinner {width: 36px;height: 36px;- border: 3px solid rgba(255,255,255,.08);+ border: 3px solid rgba(255, 255, 255, 0.08);border-top-color: var(--accent);border-radius: 50%;- animation: spin .8s linear infinite;+ animation: spin 0.8s linear infinite;margin: 0 auto 16px;}- @keyframes spin { to { transform: rotate(360deg); } }- .progress-label { font-size: 14px; font-weight: 500; margin: 0 0 6px; }- .progress-sublabel { font-size: 12px; color: var(--muted); margin: 0; }+ @keyframes spin {+ to {+ transform: rotate(360deg);+ }+ }+ .progress-label {+ font-size: 14px;+ font-weight: 500;+ margin: 0 0 6px;+ }+ .progress-sublabel {+ font-size: 12px;+ color: var(--muted);+ margin: 0;+ }.video-area {display: none;}- .video-area.is-visible { display: block; }+ .video-area.is-visible {+ display: block;+ }.result-video {width: 100%;display: block;@@ -337,7 +565,7 @@flex: 1;padding: 9px 14px;border-radius: 10px;- background: rgba(255,255,255,.05);+ background: rgba(255, 255, 255, 0.05);border: 1px solid var(--border);color: var(--text);font: inherit;@@ -349,29 +577,45 @@justify-content: center;gap: 6px;text-decoration: none;- transition: background .15s, border-color .15s;+ transition:+ background 0.15s,+ border-color 0.15s;+ }+ .video-action-btn:hover {+ background: rgba(255, 255, 255, 0.09);+ border-color: #2e2e2e;+ }+ .video-action-btn svg {+ width: 15px;+ height: 15px;}- .video-action-btn:hover { background: rgba(255,255,255,.09); border-color: #2e2e2e; }- .video-action-btn svg { width: 15px; height: 15px; }.error-area {padding: 24px;display: none;text-align: center;}- .error-area.is-visible { display: block; }- .error-msg { font-size: 13px; color: #ffb3b3; margin: 0 0 14px; }+ .error-area.is-visible {+ display: block;+ }+ .error-msg {+ font-size: 13px;+ color: #ffb3b3;+ margin: 0 0 14px;+ }.retry-btn {padding: 8px 16px;border-radius: 10px;- background: rgba(255,255,255,.05);+ background: rgba(255, 255, 255, 0.05);border: 1px solid var(--border);color: var(--text);font: inherit;font-size: 13px;cursor: pointer;}- .retry-btn:hover { background: rgba(255,255,255,.09); }+ .retry-btn:hover {+ background: rgba(255, 255, 255, 0.09);+ }/* ── Status toast ───────────────────────────────────────────── */.status-toast {@@ -390,15 +634,25 @@display: flex;align-items: center;gap: 8px;- box-shadow: 0 8px 24px rgba(0,0,0,.5);+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);+ }+ .status-toast.error {+ border-color: rgba(255, 92, 92, 0.4);+ color: #ffb3b3;+ background: #140a0a;}- .status-toast.error { border-color: rgba(255,92,92,.4); color: #ffb3b3; background: #140a0a; }/* ── Responsive ─────────────────────────────────────────────── */@media (max-width: 780px) {- main { padding: 32px 16px 60px; }- .workspace { grid-template-columns: 1fr; }- .avatar-preview-wrap { aspect-ratio: 1; }+ main {+ padding: 32px 16px 60px;+ }+ .workspace {+ grid-template-columns: 1fr;+ }+ .avatar-preview-wrap {+ aspect-ratio: 1;+ }}</style></head>@@ -412,11 +666,23 @@<main id="main-content"><div class="page-header"><a href="/create" class="back-btn" aria-label="Back to Create">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <line x1="19" y1="12" x2="5" y2="12" />+ <polyline points="12 19 5 12 12 5" />+ </svg></a><div><h1 class="page-title">Talking avatar video</h1>- <p class="page-subtitle">Pick your avatar, upload audio, and generate a lip-synced video.</p>+ <p class="page-subtitle">+ Pick your avatar, upload audio, and generate a lip-synced video.+ </p></div></div>@@ -442,7 +708,9 @@></model-viewer></div><div class="avatar-select-bar" id="avatar-bar">- <span class="avatar-select-loading" id="avatar-bar-loading">Loading avatars…</span>+ <span class="avatar-select-loading" id="avatar-bar-loading"+ >Loading avatars…</span+ ></div></div>@@ -452,27 +720,77 @@<div class="control-block"><p class="control-label">Audio file</p><div class="audio-drop" id="audio-drop">- <input type="file" accept="audio/*,.wav,.mp3,.m4a,.ogg,.flac" id="audio-input" aria-label="Upload audio file" />- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">- <path d="M9 18V5l12-2v13"/>- <circle cx="6" cy="18" r="3"/>- <circle cx="18" cy="16" r="3"/>+ <input+ type="file"+ accept="audio/*,.wav,.mp3,.m4a,.ogg,.flac"+ id="audio-input"+ aria-label="Upload audio file"+ />+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path d="M9 18V5l12-2v13" />+ <circle cx="6" cy="18" r="3" />+ <circle cx="18" cy="16" r="3" /></svg><div>Drop a WAV, MP3, or M4A here</div>- <div style="font-size:11.5px; margin-top:5px; opacity:.6">or click to browse</div>+ <div style="font-size: 11.5px; margin-top: 5px; opacity: 0.6">+ or click to browse+ </div></div><div class="audio-file-name" id="audio-file-name">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path d="M9 18V5l12-2v13" />+ <circle cx="6" cy="18" r="3" />+ <circle cx="18" cy="16" r="3" />+ </svg><span class="fname" id="audio-fname"></span>- <button class="audio-file-clear" id="audio-clear" aria-label="Remove audio">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>+ <button+ class="audio-file-clear"+ id="audio-clear"+ aria-label="Remove audio"+ >+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <line x1="18" y1="6" x2="6" y2="18" />+ <line x1="6" y1="6" x2="18" y2="18" />+ </svg></button></div></div><!-- Prompt --><div class="control-block">- <p class="control-label">Scene description <span style="font-weight:400;text-transform:none;letter-spacing:0;color:var(--muted)">(optional)</span></p>+ <p class="control-label">+ Scene description+ <span+ style="+ font-weight: 400;+ text-transform: none;+ letter-spacing: 0;+ color: var(--muted);+ "+ >(optional)</span+ >+ </p><textareaclass="prompt-input"id="prompt-input"@@ -483,7 +801,16 @@<!-- Generate --><button class="generate-btn" id="generate-btn" disabled>- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"/></svg>+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <polygon points="5 3 19 12 5 21 5 3" />+ </svg>Generate video</button>@@ -497,21 +824,53 @@</div><!-- Video --><div class="video-area" id="video-area">- <video class="result-video" id="result-video" controls playsinline></video>+ <video+ class="result-video"+ id="result-video"+ controls+ playsinline+ ></video><div class="video-actions">- <a class="video-action-btn" id="download-btn" download="avatar-video.mp4">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>+ <a+ class="video-action-btn"+ id="download-btn"+ download="avatar-video.mp4"+ >+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />+ <polyline points="7 10 12 15 17 10" />+ <line x1="12" y1="15" x2="12" y2="3" />+ </svg>Download</a><button class="video-action-btn" id="new-video-btn">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"/><path d="M3.51 15a9 9 0 1 0 .49-3.43"/></svg>+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <polyline points="1 4 1 10 7 10" />+ <path d="M3.51 15a9 9 0 1 0 .49-3.43" />+ </svg>New video</button></div></div><!-- Error --><div class="error-area" id="error-area">- <p class="error-msg" id="error-msg">Generation failed. Please try again.</p>+ <p class="error-msg" id="error-msg">+ Generation failed. Please try again.+ </p><button class="retry-btn" id="retry-btn">Try again</button></div></div>@@ -519,11 +878,20 @@</div></main>- <div class="status-toast" id="status-toast" role="status" aria-live="polite" aria-atomic="true" hidden></div>+ <div+ class="status-toast"+ id="status-toast"+ role="status"+ aria-live="polite"+ aria-atomic="true"+ hidden+ ></div><scripttype="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><script type="module" src="/src/create-video.js"></script><script>@@ -534,11 +902,17 @@const { authed, name } = JSON.parse(raw);if (authed) {const el = document.getElementById('nav-sign-in');- if (el) { el.textContent = 'Dashboard'; el.href = '/dashboard'; }+ if (el) {+ el.textContent = 'Dashboard';+ el.href = '/dashboard';+ }const myAgents = document.getElementById('nav-my-agents');if (myAgents) myAgents.hidden = false;const userEl = document.getElementById('nav-user');- if (userEl && name) { userEl.textContent = name; userEl.hidden = false; }+ if (userEl && name) {+ userEl.textContent = name;+ userEl.hidden = false;+ }}}} catch (_) {}@@ -552,5 +926,5 @@<script src="/brand.js" defer></script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/creating.html b/pages/creating.htmlindex 38b0c2acf..045af0a39 100644--- a/pages/creating.html+++ b/pages/creating.html@@ -5,7 +5,10 @@<title>Your three.ws avatar is ready</title><meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="theme-color" content="#060606" />- <meta name="description" content="Preview the avatar three.ws generated from your selfies, then mint it on-chain." />+ <meta+ name="description"+ content="Preview the avatar three.ws generated from your selfies, then mint it on-chain."+ /><meta name="robots" content="noindex" /><link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" />@@ -20,102 +23,231 @@<scripttype="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>- :root { color-scheme: dark; }- html, body { height: 100%; }+ :root {+ color-scheme: dark;+ }+ html,+ body {+ height: 100%;+ }body {- background: #060606; color: #eee;- font: 15px/1.5 -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;- margin: 0; min-height: 100vh; display: flex; flex-direction: column;+ background: #060606;+ color: #eee;+ font:+ 15px/1.5 -apple-system,+ system-ui,+ 'Segoe UI',+ Roboto,+ sans-serif;+ margin: 0;+ min-height: 100vh;+ display: flex;+ flex-direction: column;+ }+ .crumb {+ padding: 14px 22px;+ font-size: 13px;+ color: #8a8d98;+ }+ .crumb a {+ color: #8a8d98;+ text-decoration: none;+ }+ .crumb a:hover {+ color: #ffffff;}- .crumb { padding: 14px 22px; font-size: 13px; color: #8a8d98; }- .crumb a { color: #8a8d98; text-decoration: none; }- .crumb a:hover { color: #ffffff; }h1 {- font-size: 28px; font-weight: 600; letter-spacing: -0.015em;+ font-size: 28px;+ font-weight: 600;+ letter-spacing: -0.015em;margin: 0 0 6px;}- .sub { color: #8a8d98; margin: 0 0 24px; max-width: 64ch; }+ .sub {+ color: #8a8d98;+ margin: 0 0 24px;+ max-width: 64ch;+ }.stage {- flex: 1; max-width: 1100px; width: 100%; margin: 0 auto;- padding: 16px 22px 80px; box-sizing: border-box;+ flex: 1;+ max-width: 1100px;+ width: 100%;+ margin: 0 auto;+ padding: 16px 22px 80px;+ box-sizing: border-box;}.grid {- display: grid; grid-template-columns: minmax(0, 1fr) 380px;- gap: 28px; align-items: start;+ display: grid;+ grid-template-columns: minmax(0, 1fr) 380px;+ gap: 28px;+ align-items: start;+ }+ @media (max-width: 880px) {+ .grid {+ grid-template-columns: 1fr;+ }}- @media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }.viewer {- background: #101010; border: 1.5px solid #202020; border-radius: 14px;- aspect-ratio: 4 / 5; min-height: 480px; position: relative; overflow: hidden;+ background: #101010;+ border: 1.5px solid #202020;+ border-radius: 14px;+ aspect-ratio: 4 / 5;+ min-height: 480px;+ position: relative;+ overflow: hidden;}.viewer model-viewer {- width: 100%; height: 100%; background: transparent;+ width: 100%;+ height: 100%;+ background: transparent;--poster-color: transparent;}.viewer .skel {- position: absolute; inset: 0; display: flex; align-items: center;- justify-content: center; color: #6a6d7c; font-size: 13px;+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ color: #6a6d7c;+ font-size: 13px;}.panel {- background: #101010; border: 1.5px solid #202020; border-radius: 14px;- padding: 22px; display: flex; flex-direction: column; gap: 14px;+ background: #101010;+ border: 1.5px solid #202020;+ border-radius: 14px;+ padding: 22px;+ display: flex;+ flex-direction: column;+ gap: 14px;+ }+ .panel h2 {+ margin: 0;+ font-size: 18px;+ font-weight: 600;+ letter-spacing: -0.005em;}- .panel h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }.panel .label {- display: block; font-size: 12px; color: #8a8d98;- text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px;+ display: block;+ font-size: 12px;+ color: #8a8d98;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ margin-bottom: 6px;}- .panel input, .panel textarea, .panel select {- width: 100%; box-sizing: border-box;- background: #080808; color: #eee;- border: 1.5px solid #202020; border-radius: 9px;- padding: 10px 12px; font: inherit;+ .panel input,+ .panel textarea,+ .panel select {+ width: 100%;+ box-sizing: border-box;+ background: #080808;+ color: #eee;+ border: 1.5px solid #202020;+ border-radius: 9px;+ padding: 10px 12px;+ font: inherit;}- .panel input:focus, .panel textarea:focus, .panel select:focus {- outline: none; border-color: #ffffff;+ .panel input:focus,+ .panel textarea:focus,+ .panel select:focus {+ outline: none;+ border-color: #ffffff;+ }+ .panel textarea {+ resize: vertical;+ min-height: 64px;}- .panel textarea { resize: vertical; min-height: 64px; }.cta {- background: #ffffff; color: #0a0a0a; border: none; border-radius: 10px;- padding: 11px 16px; font: inherit; font-weight: 600; cursor: pointer;+ background: #ffffff;+ color: #0a0a0a;+ border: none;+ border-radius: 10px;+ padding: 11px 16px;+ font: inherit;+ font-weight: 600;+ cursor: pointer;transition: filter 0.15s;}- .cta:hover { filter: brightness(1.04); }- .cta:disabled { opacity: 0.35; cursor: not-allowed; }+ .cta:hover {+ filter: brightness(1.04);+ }+ .cta:disabled {+ opacity: 0.35;+ cursor: not-allowed;+ }.secondary {- background: transparent; color: #eee;- border: 1.5px solid #202020; border-radius: 10px;- padding: 10px 14px; font: inherit; cursor: pointer;- text-decoration: none; display: inline-flex; align-items: center; gap: 6px;- }- .secondary:hover { border-color: #2e2e2e; }- .row { display: flex; gap: 10px; flex-wrap: wrap; }- .row > * { flex: 1; min-width: 0; }+ background: transparent;+ color: #eee;+ border: 1.5px solid #202020;+ border-radius: 10px;+ padding: 10px 14px;+ font: inherit;+ cursor: pointer;+ text-decoration: none;+ display: inline-flex;+ align-items: center;+ gap: 6px;+ }+ .secondary:hover {+ border-color: #2e2e2e;+ }+ .row {+ display: flex;+ gap: 10px;+ flex-wrap: wrap;+ }+ .row > * {+ flex: 1;+ min-width: 0;+ }.log {- background: #080808; border: 1px solid #202020; border-radius: 9px;- padding: 10px 12px; font-family: ui-monospace, monospace;- font-size: 11.5px; color: #8a8d98; max-height: 140px;- overflow: auto; line-height: 1.5;+ background: #080808;+ border: 1px solid #202020;+ border-radius: 9px;+ padding: 10px 12px;+ font-family: ui-monospace, monospace;+ font-size: 11.5px;+ color: #8a8d98;+ max-height: 140px;+ overflow: auto;+ line-height: 1.5;+ }+ .log .ok {+ color: #ffffff;+ }+ .log .err {+ color: #ff6b6b;}- .log .ok { color: #ffffff; }- .log .err { color: #ff6b6b; }.empty {- background: #101010; border: 1.5px solid #202020; border-radius: 14px;- padding: 32px; text-align: center; color: #8a8d98;+ background: #101010;+ border: 1.5px solid #202020;+ border-radius: 14px;+ padding: 32px;+ text-align: center;+ color: #8a8d98;+ }+ .empty a {+ color: #ffffff;}- .empty a { color: #ffffff; }.meta-tag {- display: inline-block; background: #202020; color: #8a8d98;- padding: 2px 8px; border-radius: 6px; font-size: 11px;+ display: inline-block;+ background: #202020;+ color: #8a8d98;+ padding: 2px 8px;+ border-radius: 6px;+ font-size: 11px;margin-right: 6px;}.banner {background: rgba(255, 255, 255, 0.08);border: 1px solid rgba(255, 255, 255, 0.25);- color: #ffffff; border-radius: 9px;- padding: 8px 12px; font-size: 12px; margin-bottom: 16px;+ color: #ffffff;+ border-radius: 9px;+ padding: 8px 12px;+ font-size: 12px;+ margin-bottom: 16px;}</style></head>@@ -128,22 +260,22 @@<main class="stage"><div class="banner">- Sandbox flow at <code>/creating</code> — once this path is proven end-to-end- it will graduate to the main <code>/create</code> editor.+ Sandbox flow at <code>/creating</code> — once this path is proven end-to-end it will+ graduate to the main <code>/create</code> editor.</div><h1 id="heading">Your three.ws avatar is ready</h1><p class="sub" id="subhead">- Reconstructed from your three selfies. Preview below, then mint it as a- draft ERC-8004 agent or refine it in the editor.+ Reconstructed from your three selfies. Preview below, then mint it as a draft+ ERC-8004 agent or refine it in the editor.</p>- <div id="error-card" class="empty" style="display:none">+ <div id="error-card" class="empty" style="display: none"><p id="error-msg">Something went wrong.</p><p><a href="/demos/selfie-fit">← Try again with new selfies</a></p></div>- <div id="content" class="grid" style="display:none">+ <div id="content" class="grid" style="display: none"><div class="viewer"><div class="skel" id="viewer-skel">Loading 3D model…</div><model-viewer@@ -154,7 +286,7 @@rotation-per-second="20deg"exposure="1"environment-image="neutral"- style="display:none"+ style="display: none"></model-viewer></div>@@ -172,7 +304,11 @@</div><div><label class="label" for="f-desc">Description (optional)</label>- <textarea id="f-desc" maxlength="500" placeholder="Short bio for the agent"></textarea>+ <textarea+ id="f-desc"+ maxlength="500"+ placeholder="Short bio for the agent"+ ></textarea></div><div><label class="label" for="f-vis">Visibility</label>@@ -245,20 +381,32 @@: '—';$('#edit-link').href = `/create?avatarId=${encodeURIComponent(a.id)}`;- const glbUrl = a.url || a.signed_url || (a.storage_key ? `/api/avatars/${a.id}/glb` : null);+ const glbUrl =+ a.url || a.signed_url || (a.storage_key ? `/api/avatars/${a.id}/glb` : null);if (!glbUrl) throw new Error('no GLB URL in avatar payload');log(`✓ metadata loaded`, 'ok');const mv = $('#mv');mv.src = glbUrl;- mv.addEventListener('load', () => {- $('#viewer-skel').style.display = 'none';- mv.style.display = '';- log('✓ 3D model loaded', 'ok');- }, { once: true });- mv.addEventListener('error', (e) => {- log(`model-viewer error: ${e.detail?.sourceError?.message || 'unknown'}`, 'err');- }, { once: true });+ mv.addEventListener(+ 'load',+ () => {+ $('#viewer-skel').style.display = 'none';+ mv.style.display = '';+ log('✓ 3D model loaded', 'ok');+ },+ { once: true },+ );+ mv.addEventListener(+ 'error',+ (e) => {+ log(+ `model-viewer error: ${e.detail?.sourceError?.message || 'unknown'}`,+ 'err',+ );+ },+ { once: true },+ );$('#save-btn').addEventListener('click', () => savePatch(a.id));$('#mint-btn').addEventListener('click', () => mint(a.id));@@ -293,7 +441,10 @@log(`save failed: ${err.message}`, 'err');btn.textContent = original;} finally {- setTimeout(() => { btn.textContent = original; btn.disabled = false; }, 1200);+ setTimeout(() => {+ btn.textContent = original;+ btn.disabled = false;+ }, 1200);}}@@ -336,5 +487,5 @@}</script><script src="/brand.js" defer></script>-</body>+ </body></html>diff --git a/pages/features.html b/pages/features.htmlindex 666435bc5..287feec17 100644--- a/pages/features.html+++ b/pages/features.html@@ -48,31 +48,47 @@<scripttype="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><script defer src="/footer-newsletter.js"></script>-- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Features","description":"Full feature overview of the three.ws platform: avatars, agents, on-chain identity, x402 payments, and embedding.","url":"https://three.ws/features","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>++ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Features",+ "description": "Full feature overview of the three.ws platform: avatars, agents, on-chain identity, x402 payments, and embedding.",+ "url": "https://three.ws/features",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head><body class="features-page"><a href="#main-content" class="skip-link">Skip to main content</a><header><div id="nav-container"></div></header><script src="/nav.js"></script><main id="main-content" class="features-main">-<!-- ── Page hero ── --><section class="feat-hero scroll-reveal"><div class="feat-hero-inner"><p class="feat-eyebrow">Everything three.ws does</p>- <h1 class="feat-hero-title">Start free.<br />Add crypto only if you want it.</h1>+ <h1 class="feat-hero-title">+ Start free.<br />Add crypto only if you want it.+ </h1><p class="feat-hero-sub">The whole product — making avatars, building AI agents, embedding themanywhere — works with nothing but an email. The on-chain features below areoptional extras you can switch on later.</p><nav class="feat-goal-nav" aria-label="Jump to a section">- <a href="#core" class="feat-goal-pill feat-goal-pill--core">Core — free, no crypto</a>- <a href="#optional" class="feat-goal-pill feat-goal-pill--optional">Optional — on-chain & payments</a>+ <a href="#core" class="feat-goal-pill feat-goal-pill--core"+ >Core — free, no crypto</a+ >+ <a href="#optional" class="feat-goal-pill feat-goal-pill--optional"+ >Optional — on-chain & payments</a+ ></nav></div></section>@@ -85,7 +101,10 @@<span class="feat-goal-num">01</span><div><h2 id="goal-core-label" class="feat-goal-title">Core</h2>- <p class="feat-goal-desc">Make avatars, build AI agents, and put them anywhere. Free to start, no wallet required.</p>+ <p class="feat-goal-desc">+ Make avatars, build AI agents, and put them anywhere. Free to start, no+ wallet required.+ </p></div></div>@@ -93,18 +112,30 @@<div class="feat-tier-banner feat-tier-banner--core scroll-reveal" role="note"><span class="feat-tier-banner-icon" aria-hidden="true"><svg viewBox="0 0 24 24" width="22" height="22" fill="none">- <circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="1.6"/>- <path d="M8 12.5l2.5 2.5 5-5.5" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>+ <circle+ cx="12"+ cy="12"+ r="10"+ stroke="currentColor"+ stroke-width="1.6"+ />+ <path+ d="M8 12.5l2.5 2.5 5-5.5"+ stroke="currentColor"+ stroke-width="1.8"+ stroke-linecap="round"+ stroke-linejoin="round"+ /></svg></span><p class="feat-tier-banner-text">- <strong>No crypto needed.</strong> Everything in this section works with just an- email — no wallet, no tokens, no blockchain. Sign up and start in minutes.+ <strong>No crypto needed.</strong> Everything in this section works with+ just an email — no wallet, no tokens, no blockchain. Sign up and start in+ minutes.</p></div><div class="feat-cards">-<!-- Selfie → 3D Avatar --><article class="feat-card scroll-reveal" aria-label="Selfie to 3D Avatar"><div class="feat-card-preview feat-card-preview--avatar">@@ -129,13 +160,17 @@<span class="feat-card-tag">Create</span><h3 class="feat-card-title">Selfie to 3D Avatar</h3><p class="feat-card-what">- Take one photo and get back a fully rigged 3D avatar in about 60 seconds.+ Take one photo and get back a fully rigged 3D avatar in about 60+ seconds.</p><p class="feat-card-who">- <strong>For:</strong> creators who want a personal avatar without hiring a 3D artist.+ <strong>For:</strong> creators who want a personal avatar without+ hiring a 3D artist.</p><p class="feat-card-why">- <strong>Why it's better:</strong> The rig is animation-ready — you can load it straight into the viewer and trigger any animation immediately.+ <strong>Why it's better:</strong> The rig is animation-ready — you+ can load it straight into the viewer and trigger any animation+ immediately.</p><a href="/create/selfie" class="btn-primary feat-card-cta">Try selfie → avatar <span class="btn-arrow">→</span>@@ -149,7 +184,9 @@<div class="feat-forge-demo" aria-hidden="true"><div class="feat-forge-prompt"><span class="feat-forge-cursor"></span>- <span class="feat-forge-text">a crystal wizard with glowing staff</span>+ <span class="feat-forge-text"+ >a crystal wizard with glowing staff</span+ ></div><div class="feat-forge-arrow">→</div><model-viewer@@ -174,13 +211,18 @@<span class="feat-card-tag">Create</span><h3 class="feat-card-title">Text to 3D — Forge</h3><p class="feat-card-what">- Describe a character in plain English. Forge generates a 3D model using a flux→TRELLIS pipeline, with every output stored in the gallery.+ Describe a character in plain English. Forge generates a 3D model+ using a flux→TRELLIS pipeline, with every output stored in the+ gallery.</p><p class="feat-card-who">- <strong>For:</strong> builders who need original 3D characters fast, without Blender.+ <strong>For:</strong> builders who need original 3D characters fast,+ without Blender.</p><p class="feat-card-why">- <strong>Why it's better:</strong> Outputs are GLB-ready — load them straight into the viewer, deploy, or embed without any conversion step.+ <strong>Why it's better:</strong> Outputs are GLB-ready — load them+ straight into the viewer, deploy, or embed without any conversion+ step.</p><a href="/forge" class="btn-primary feat-card-cta">Open Forge <span class="btn-arrow">→</span>@@ -189,7 +231,10 @@</article><!-- Build an Agent -->- <article class="feat-card feat-card--wide scroll-reveal" aria-label="Build an Agent">+ <article+ class="feat-card feat-card--wide scroll-reveal"+ aria-label="Build an Agent"+ ><div class="feat-card-preview feat-card-preview--agent-build"><div class="feat-agent-build-visual" aria-hidden="true"><div class="feat-agent-step feat-agent-step--done">@@ -217,13 +262,16 @@<span class="feat-card-tag">Create</span><h3 class="feat-card-title">Build a Complete Agent</h3><p class="feat-card-what">- Combine a 3D avatar with an LLM brain, voice, and persona into a single agent — ready to chat, answer questions, and take actions.+ Combine a 3D avatar with an LLM brain, voice, and persona into a+ single agent — ready to chat, answer questions, and take actions.</p><p class="feat-card-who">- <strong>For:</strong> developers and creators who want a conversational AI with a real visual presence.+ <strong>For:</strong> developers and creators who want a+ conversational AI with a real visual presence.</p><p class="feat-card-why">- <strong>Why it's better:</strong> Any LLM works via MCP or A2A — Claude, GPT, Gemini, or your own. No vendor lock-in.+ <strong>Why it's better:</strong> Any LLM works via MCP or A2A —+ Claude, GPT, Gemini, or your own. No vendor lock-in.</p><a href="/create" class="btn-primary feat-card-cta">Start building <span class="btn-arrow">→</span>@@ -241,7 +289,9 @@<span class="feat-code-dot"></span><span class="feat-code-label">your-site.html</span></div>- <pre class="feat-code-body"><code><span class="feat-c"><!-- 1. load --></span>+ <pre+ class="feat-code-body"+ ><code><span class="feat-c"><!-- 1. load --></span><span class="feat-tag"><script</span> <span class="feat-attr">src</span>=<span class="feat-val">"https://three.ws/embed.js"</span><span class="feat-tag">></script></span><span class="feat-c"><!-- 2. drop the tag --></span>@@ -255,13 +305,16 @@<span class="feat-card-tag">Embed</span><h3 class="feat-card-title">Widget Studio</h3><p class="feat-card-what">- Pick an avatar, configure size and style, then copy a single script tag. Paste it into Notion, Ghost, WordPress, Framer — anywhere.+ Pick an avatar, configure size and style, then copy a single script+ tag. Paste it into Notion, Ghost, WordPress, Framer — anywhere.</p><p class="feat-card-who">- <strong>For:</strong> site owners who want a 3D AI assistant on their page without touching backend code.+ <strong>For:</strong> site owners who want a 3D AI assistant on+ their page without touching backend code.</p><p class="feat-card-why">- <strong>Why it's better:</strong> No SDK required on the consumer side — one tag, any page, no build step.+ <strong>Why it's better:</strong> No SDK required on the consumer+ side — one tag, any page, no build step.</p><a href="/studio" class="btn-primary feat-card-cta">Open Widget Studio <span class="btn-arrow">→</span>@@ -286,11 +339,42 @@<div class="feat-walk-joystick-thumb"></div></div><div class="feat-walk-ar-toggle" aria-label="AR toggle">- <svg viewBox="0 0 20 20" width="16" height="16" aria-hidden="true" fill="none">- <rect x="2" y="6" width="16" height="10" rx="2" stroke="rgba(255,255,255,0.5)" stroke-width="1.4"/>- <circle cx="7" cy="11" r="2" stroke="rgba(255,255,255,0.5)" stroke-width="1.2"/>- <circle cx="13" cy="11" r="2" stroke="rgba(255,255,255,0.5)" stroke-width="1.2"/>- <path d="M7 6V4M13 6V4" stroke="rgba(255,255,255,0.3)" stroke-width="1.2" stroke-linecap="round"/>+ <svg+ viewBox="0 0 20 20"+ width="16"+ height="16"+ aria-hidden="true"+ fill="none"+ >+ <rect+ x="2"+ y="6"+ width="16"+ height="10"+ rx="2"+ stroke="rgba(255,255,255,0.5)"+ stroke-width="1.4"+ />+ <circle+ cx="7"+ cy="11"+ r="2"+ stroke="rgba(255,255,255,0.5)"+ stroke-width="1.2"+ />+ <circle+ cx="13"+ cy="11"+ r="2"+ stroke="rgba(255,255,255,0.5)"+ stroke-width="1.2"+ />+ <path+ d="M7 6V4M13 6V4"+ stroke="rgba(255,255,255,0.3)"+ stroke-width="1.2"+ stroke-linecap="round"+ /></svg><span>AR mode</span></div>@@ -300,13 +384,18 @@<span class="feat-card-tag">Play</span><h3 class="feat-card-title">Walk + AR</h3><p class="feat-card-what">- Drive your avatar around a 3D scene with WASD or a touch joystick. Flip to back-camera mode and your avatar walks through your real environment.+ Drive your avatar around a 3D scene with WASD or a touch joystick.+ Flip to back-camera mode and your avatar walks through your real+ environment.</p><p class="feat-card-who">- <strong>For:</strong> anyone who wants to experience their avatar in the real world, or demo an agent at an event.+ <strong>For:</strong> anyone who wants to experience their avatar in+ the real world, or demo an agent at an event.</p><p class="feat-card-why">- <strong>Why it's better:</strong> No app install — it runs in the browser with real physics (Rapier) and real terrain, not a flat plane.+ <strong>Why it's better:</strong> No app install — it runs in the+ browser with real physics (Rapier) and real terrain, not a flat+ plane.</p><a href="/walk" class="btn-primary feat-card-cta">Start walking <span class="btn-arrow">→</span>@@ -319,12 +408,27 @@<div class="feat-card-preview feat-card-preview--dashboard"><div class="feat-dash-visual" aria-hidden="true"><div class="feat-dash-tiles">- <div class="feat-dash-tile"><span class="feat-dash-tile-num">4</span><span class="feat-dash-tile-label">Agents</span></div>- <div class="feat-dash-tile"><span class="feat-dash-tile-num">128</span><span class="feat-dash-tile-label">Chats today</span></div>- <div class="feat-dash-tile"><span class="feat-dash-tile-num">12</span><span class="feat-dash-tile-label">Embeds live</span></div>+ <div class="feat-dash-tile">+ <span class="feat-dash-tile-num">4</span+ ><span class="feat-dash-tile-label">Agents</span>+ </div>+ <div class="feat-dash-tile">+ <span class="feat-dash-tile-num">128</span+ ><span class="feat-dash-tile-label">Chats today</span>+ </div>+ <div class="feat-dash-tile">+ <span class="feat-dash-tile-num">12</span+ ><span class="feat-dash-tile-label">Embeds live</span>+ </div></div><div class="feat-dash-bars">- <span style="height:42%"></span><span style="height:66%"></span><span style="height:50%"></span><span style="height:81%"></span><span style="height:58%"></span><span style="height:93%"></span><span style="height:71%"></span>+ <span style="height: 42%"></span+ ><span style="height: 66%"></span+ ><span style="height: 50%"></span+ ><span style="height: 81%"></span+ ><span style="height: 58%"></span+ ><span style="height: 93%"></span+ ><span style="height: 71%"></span></div></div></div>@@ -332,59 +436,103 @@<span class="feat-card-tag">Dashboard</span><h3 class="feat-card-title">Your Dashboard</h3><p class="feat-card-what">- One home for everything you have made — edit each agent's persona, swap its animations, copy embed codes, and watch chat activity roll in as it happens.+ One home for everything you have made — edit each agent's persona,+ swap its animations, copy embed codes, and watch chat activity roll+ in as it happens.</p><p class="feat-card-who">- <strong>For:</strong> anyone running one or more agents who wants a single control panel instead of a pile of scattered links.+ <strong>For:</strong> anyone running one or more agents who wants a+ single control panel instead of a pile of scattered links.</p><p class="feat-card-why">- <strong>Why it's better:</strong> Every avatar and agent you create shows up here automatically — nothing to wire up, one login for all of it.+ <strong>Why it's better:</strong> Every avatar and agent you create+ shows up here automatically — nothing to wire up, one login for all+ of it.</p><a href="/dashboard" class="btn-primary feat-card-cta">Open your dashboard <span class="btn-arrow">→</span></a></div></article>+ </div>+ </section>- </div>- </section>-- <!-- ══ OPTIONAL / ADVANCED — on-chain, payments, tokens ══ -->- <section class="feat-goal-section feat-goal-section--alt" id="optional" aria-labelledby="goal-optional-label">- <div class="feat-goal-header scroll-reveal">- <span class="feat-goal-num">02</span>- <div>- <h2 id="goal-optional-label" class="feat-goal-title">Optional · Advanced</h2>- <p class="feat-goal-desc">Put agents on-chain, charge for what they do, and launch a token. Powerful, but never required.</p>- </div>- </div>-- <!-- Crypto-requirements banner -->- <div class="feat-tier-banner feat-tier-banner--optional scroll-reveal" role="note">- <span class="feat-tier-banner-icon" aria-hidden="true">- <svg viewBox="0 0 24 24" width="22" height="22" fill="none">- <path d="M12 3l7 3.5v5c0 4.4-3 7.6-7 9-4-1.4-7-4.6-7-9v-5L12 3z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/>- <path d="M9 12l2 2 4-4.5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>- </svg>- </span>- <p class="feat-tier-banner-text">- <strong>These features use crypto.</strong> To switch them on you'll need a- <span class="tws-tt" data-term="wallet" tabindex="0">wallet</span> and a small amount of- <span class="tws-tt" data-term="usdc" tabindex="0">USDC</span> or- <span class="tws-tt" data-term="sol" tabindex="0">SOL</span>. Skip them entirely and the Core product above still works in full.+ <!-- ══ OPTIONAL / ADVANCED — on-chain, payments, tokens ══ -->+ <section+ class="feat-goal-section feat-goal-section--alt"+ id="optional"+ aria-labelledby="goal-optional-label"+ >+ <div class="feat-goal-header scroll-reveal">+ <span class="feat-goal-num">02</span>+ <div>+ <h2 id="goal-optional-label" class="feat-goal-title">+ Optional · Advanced+ </h2>+ <p class="feat-goal-desc">+ Put agents on-chain, charge for what they do, and launch a token.+ Powerful, but never required.</p></div>+ </div>- <div class="feat-cards">+ <!-- Crypto-requirements banner -->+ <div class="feat-tier-banner feat-tier-banner--optional scroll-reveal" role="note">+ <span class="feat-tier-banner-icon" aria-hidden="true">+ <svg viewBox="0 0 24 24" width="22" height="22" fill="none">+ <path+ d="M12 3l7 3.5v5c0 4.4-3 7.6-7 9-4-1.4-7-4.6-7-9v-5L12 3z"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linejoin="round"+ />+ <path+ d="M9 12l2 2 4-4.5"+ stroke="currentColor"+ stroke-width="1.6"+ stroke-linecap="round"+ stroke-linejoin="round"+ />+ </svg>+ </span>+ <p class="feat-tier-banner-text">+ <strong>These features use crypto.</strong> To switch them on you'll need a+ <span class="tws-tt" data-term="wallet" tabindex="0">wallet</span> and a+ small amount of+ <span class="tws-tt" data-term="usdc" tabindex="0">USDC</span> or+ <span class="tws-tt" data-term="sol" tabindex="0">SOL</span>. Skip them+ entirely and the Core product above still works in full.+ </p>+ </div>+ <div class="feat-cards"><!-- On-Chain Identity / Deploy --><article class="feat-card scroll-reveal" aria-label="On-Chain Identity"><div class="feat-card-preview feat-card-preview--onchain"><div class="feat-onchain-visual" aria-hidden="true"><div class="feat-onchain-badge">- <svg viewBox="0 0 24 24" width="28" height="28" aria-hidden="true">- <circle cx="12" cy="12" r="10" fill="none" stroke="rgba(74,222,128,0.6)" stroke-width="1.5"/>- <path d="M8 12l3 3 5-5" fill="none" stroke="#4ade80" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>+ <svg+ viewBox="0 0 24 24"+ width="28"+ height="28"+ aria-hidden="true"+ >+ <circle+ cx="12"+ cy="12"+ r="10"+ fill="none"+ stroke="rgba(74,222,128,0.6)"+ stroke-width="1.5"+ />+ <path+ d="M8 12l3 3 5-5"+ fill="none"+ stroke="#4ade80"+ stroke-width="1.8"+ stroke-linecap="round"+ stroke-linejoin="round"+ /></svg><span class="feat-onchain-label">Verified on Solana</span></div>@@ -413,13 +561,18 @@<span class="feat-req">Needs: a wallet · ~$0.01 network fee</span><h3 class="feat-card-title">Deploy to the Blockchain</h3><p class="feat-card-what">- One transaction on Solana gives your agent a permanent, verifiable identity — a Metaplex Core asset that any A2A or MCP client can discover and trust.+ One transaction on Solana gives your agent a permanent, verifiable+ identity — a Metaplex Core asset that any A2A or MCP client can+ discover and trust.</p><p class="feat-card-who">- <strong>For:</strong> builders who want their agent to be portable, transferable, and findable by other AI systems.+ <strong>For:</strong> builders who want their agent to be portable,+ transferable, and findable by other AI systems.</p><p class="feat-card-why">- <strong>Why it's better:</strong> Sub-cent fees. You hold the keys. The agent card is a public JSON URL — nothing is locked to this site.+ <strong>Why it's better:</strong> Sub-cent fees. You hold the keys.+ The agent card is a public JSON URL — nothing is locked to this+ site.</p><a href="/deploy" class="btn-primary feat-card-cta">Deploy your agent <span class="btn-arrow">→</span>@@ -437,10 +590,23 @@<span class="feat-launch-token-name">Your token</span><span class="feat-launch-token-ticker">$TICKER</span></span>- <span class="feat-launch-live"><span class="feat-launch-live-dot"></span>Live</span>+ <span class="feat-launch-live"+ ><span class="feat-launch-live-dot"></span>Live</span+ ></div>- <svg class="feat-launch-curve" viewBox="0 0 120 44" preserveAspectRatio="none" aria-hidden="true">- <path d="M2 42 C 38 40, 66 22, 118 5" fill="none" stroke="rgba(74,222,128,0.65)" stroke-width="2" stroke-linecap="round"/>+ <svg+ class="feat-launch-curve"+ viewBox="0 0 120 44"+ preserveAspectRatio="none"+ aria-hidden="true"+ >+ <path+ d="M2 42 C 38 40, 66 22, 118 5"+ fill="none"+ stroke="rgba(74,222,128,0.65)"+ stroke-width="2"+ stroke-linecap="round"+ /></svg></div></div>@@ -449,13 +615,18 @@<span class="feat-req">Needs: a wallet · SOL</span><h3 class="feat-card-title">Launch a Token</h3><p class="feat-card-what">- Give your agent a community token in a couple of clicks — set a name and image, and it goes live on a pump.fun bonding-curve market that anyone can trade.+ Give your agent a community token in a couple of clicks — set a name+ and image, and it goes live on a pump.fun bonding-curve market that+ anyone can trade.</p><p class="feat-card-who">- <strong>For:</strong> creators who want a community and a live market around their agent.+ <strong>For:</strong> creators who want a community and a live+ market around their agent.</p><p class="feat-card-why">- <strong>Why it's better:</strong> It's a real launch with live trading from the first second — you supply the details, we handle the on-chain mechanics.+ <strong>Why it's better:</strong> It's a real launch with live+ trading from the first second — you supply the details, we handle+ the on-chain mechanics.</p><a href="/launchpad" class="btn-primary feat-card-cta">Open the launchpad <span class="btn-arrow">→</span>@@ -470,7 +641,9 @@<div class="feat-mkt-listing"><div class="feat-mkt-listing-icon">🧠</div><div class="feat-mkt-listing-info">- <span class="feat-mkt-listing-name">Research Assistant</span>+ <span class="feat-mkt-listing-name"+ >Research Assistant</span+ ><span class="feat-mkt-listing-price">$0.05 / call</span></div><span class="feat-mkt-listing-badge">Listed</span>@@ -489,7 +662,9 @@<span class="feat-mkt-listing-name">Market Analyst</span><span class="feat-mkt-listing-price">$0.10 / call</span></div>- <span class="feat-mkt-listing-badge feat-mkt-listing-badge--new">New</span>+ <span class="feat-mkt-listing-badge feat-mkt-listing-badge--new"+ >New</span+ ></div></div></div>@@ -498,13 +673,18 @@<span class="feat-req">Earns: USDC · pay-per-call</span><h3 class="feat-card-title">Marketplace</h3><p class="feat-card-what">- List your agent's skills for others to buy. Each call settles in USDC (a $1 digital dollar) via pay-per-call — payment goes straight to your wallet.+ List your agent's skills for others to buy. Each call settles in+ USDC (a $1 digital dollar) via pay-per-call — payment goes straight+ to your wallet.</p><p class="feat-card-who">- <strong>For:</strong> creators who have built something useful and want to charge for it without building billing infrastructure.+ <strong>For:</strong> creators who have built something useful and+ want to charge for it without building billing infrastructure.</p><p class="feat-card-why">- <strong>Why it's better:</strong> Pay-per-call means no subscriptions to manage — buyers pay exactly what they use, and you get paid per call.+ <strong>Why it's better:</strong> Pay-per-call means no+ subscriptions to manage — buyers pay exactly what they use, and you+ get paid per call.</p><a href="/marketplace" class="btn-primary feat-card-cta">Browse the marketplace <span class="btn-arrow">→</span>@@ -513,7 +693,10 @@</article><!-- Agent Exchange -->- <article class="feat-card scroll-reveal" aria-label="Agent Exchange — Agents Paying Agents">+ <article+ class="feat-card scroll-reveal"+ aria-label="Agent Exchange — Agents Paying Agents"+ ><div class="feat-card-preview feat-card-preview--exchange"><div class="feat-exchange-visual" aria-hidden="true"><div class="feat-exchange-agent feat-exchange-agent--a">@@ -534,13 +717,19 @@<span class="feat-req">Uses: USDC · x402 micropayments</span><h3 class="feat-card-title">Agent Exchange</h3><p class="feat-card-what">- Watch two AI agents — ORACLE and NOVA — negotiate, invoke each other's skills, and settle payments on-chain automatically. No humans in the loop.+ Watch two AI agents — ORACLE and NOVA — negotiate, invoke each+ other's skills, and settle payments on-chain automatically. No+ humans in the loop.</p><p class="feat-card-who">- <strong>For:</strong> builders curious about autonomous agent economies, or anyone who wants to offer a service that other AI systems can pay for.+ <strong>For:</strong> builders curious about autonomous agent+ economies, or anyone who wants to offer a service that other AI+ systems can pay for.</p><p class="feat-card-why">- <strong>Why it's better:</strong> Real on-chain settlement via pay-per-call (micropayments) — every transaction is verifiable, not simulated.+ <strong>Why it's better:</strong> Real on-chain settlement via+ pay-per-call (micropayments) — every transaction is verifiable, not+ simulated.</p><a href="/agent-exchange" class="btn-primary feat-card-cta">See agents pay agents <span class="btn-arrow">→</span>@@ -549,7 +738,10 @@</article><!-- Play — Coin Worlds -->- <article class="feat-card feat-card--wide scroll-reveal" aria-label="Coin Worlds">+ <article+ class="feat-card feat-card--wide scroll-reveal"+ aria-label="Coin Worlds"+ ><div class="feat-card-preview feat-card-preview--play"><model-viewersrc="/avatars/cz.glb"@@ -579,13 +771,18 @@<span class="feat-req">Reads live market prices on-chain</span><h3 class="feat-card-title">Coin Worlds</h3><p class="feat-card-what">- Walk your avatar through 3D worlds tied to live crypto prices. The terrain shifts with the market — each world is a different token's landscape.+ Walk your avatar through 3D worlds tied to live crypto prices. The+ terrain shifts with the market — each world is a different token's+ landscape.</p><p class="feat-card-who">- <strong>For:</strong> crypto enthusiasts who want a more visceral way to follow the market.+ <strong>For:</strong> crypto enthusiasts who want a more visceral+ way to follow the market.</p><p class="feat-card-why">- <strong>Why it's better:</strong> Agents in the world pay each other on-chain in real time — you can watch live x402 micropayment transactions happen as you walk.+ <strong>Why it's better:</strong> Agents in the world pay each other+ on-chain in real time — you can watch live x402 micropayment+ transactions happen as you walk.</p><a href="/play" class="btn-primary feat-card-cta">Enter the world <span class="btn-arrow">→</span>@@ -594,13 +791,37 @@</article><!-- IBM / Granite -->- <article class="feat-card feat-card--wide scroll-reveal" aria-label="IBM Granite on watsonx.ai">+ <article+ class="feat-card feat-card--wide scroll-reveal"+ aria-label="IBM Granite on watsonx.ai"+ ><div class="feat-card-preview feat-card-preview--ibm"><div class="feat-ibm-visual" aria-hidden="true"><div class="feat-ibm-badge">- <svg viewBox="0 0 40 40" width="36" height="36" aria-hidden="true" fill="none">- <rect width="40" height="40" rx="8" fill="rgba(30,80,200,0.12)"/>- <text x="20" y="26" text-anchor="middle" font-size="14" font-weight="700" fill="#5b8fff" font-family="sans-serif">IBM</text>+ <svg+ viewBox="0 0 40 40"+ width="36"+ height="36"+ aria-hidden="true"+ fill="none"+ >+ <rect+ width="40"+ height="40"+ rx="8"+ fill="rgba(30,80,200,0.12)"+ />+ <text+ x="20"+ y="26"+ text-anchor="middle"+ font-size="14"+ font-weight="700"+ fill="#5b8fff"+ font-family="sans-serif"+ >+ IBM+ </text></svg><div class="feat-ibm-badge-text"><span class="feat-ibm-badge-title">watsonx.ai</span>@@ -620,35 +841,48 @@<span class="feat-req">Enterprise · advanced demo</span><h3 class="feat-card-title">IBM Granite on watsonx.ai</h3><p class="feat-card-what">- A suite of demos showing IBM Granite models — time-series forecasting, semantic agent mapping, AI governance, and on-chain proof of AI decisions — all rendered in 3D.+ A suite of demos showing IBM Granite models — time-series+ forecasting, semantic agent mapping, AI governance, and on-chain+ proof of AI decisions — all rendered in 3D.</p><p class="feat-card-who">- <strong>For:</strong> enterprise teams evaluating IBM watsonx, or developers who want to see what Granite models can do inside a live 3D environment.+ <strong>For:</strong> enterprise teams evaluating IBM watsonx, or+ developers who want to see what Granite models can do inside a live+ 3D environment.</p><p class="feat-card-why">- <strong>Why it's better:</strong> These are real Granite API calls — not mocked — with every decision anchored to a Solana transaction as an immutable record.+ <strong>Why it's better:</strong> These are real Granite API calls —+ not mocked — with every decision anchored to a Solana transaction as+ an immutable record.</p><a href="/ibm/galaxy" class="btn-primary feat-card-cta">Explore the IBM suite <span class="btn-arrow">→</span></a></div></article>+ </div>+ </section>- </div>- </section>-- <!-- ── Cross-cutting / developer row ── -->+ <!-- ── Cross-cutting / developer row ── --><section class="feat-dev-section scroll-reveal"><div class="feat-dev-inner"><div class="feat-dev-text"><p class="feat-dev-eyebrow">For developers</p><h2 class="feat-dev-title">One tag. Zero dependencies.</h2><p class="feat-dev-sub">- The <code><agent-3d></code> web component lazy-loads, renders on any device, and connects to your existing AI stack via MCP or A2A. No framework. No build step.+ The <code><agent-3d></code> web component lazy-loads, renders on+ any device, and connects to your existing AI stack via MCP or A2A. No+ framework. No build step.</p><div class="feat-dev-links"><a href="/docs" class="btn-ghost">Read the docs →</a>- <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener noreferrer" class="btn-ghost">GitHub →</a>+ <a+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener noreferrer"+ class="btn-ghost"+ >GitHub →</a+ ></div></div><div class="feat-dev-standards">@@ -844,8 +1078,22 @@<div class="h-footer-badges"><a href="/pay" class="h-footer-badge" aria-label="Built with x402 payments"><svg viewBox="0 0 16 16" aria-hidden="true">- <circle cx="8" cy="8" r="7" fill="none" stroke="currentColor" stroke-width="1.3"/>- <path d="M8 4v8M5.5 6h3.5a1.5 1.5 0 010 3H6.5a1.5 1.5 0 000 3H11" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>+ <circle+ cx="8"+ cy="8"+ r="7"+ fill="none"+ stroke="currentColor"+ stroke-width="1.3"+ />+ <path+ d="M8 4v8M5.5 6h3.5a1.5 1.5 0 010 3H6.5a1.5 1.5 0 000 3H11"+ fill="none"+ stroke="currentColor"+ stroke-width="1.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ /></svg>Built with x402</a>@@ -878,7 +1126,9 @@{ root: null, threshold: 0.1, rootMargin: '0px 0px -40px 0px' },);els.forEach((el, i) => {- const siblings = Array.from(el.parentElement.querySelectorAll('.scroll-reveal'));+ const siblings = Array.from(+ el.parentElement.querySelectorAll('.scroll-reveal'),+ );const idx = siblings.indexOf(el);el.style.transitionDelay = idx * 0.07 + 's';observer.observe(el);@@ -886,7 +1136,7 @@})();</script><script src="/brand.js" defer></script>- <div id="footer-container"></div>- <script src="/footer.js"></script>+ <div id="footer-container"></div>+ <script src="/footer.js"></script></body></html>diff --git a/pages/features/forge.html b/pages/features/forge.htmlindex df60ac336..67961a1da 100644--- a/pages/features/forge.html+++ b/pages/features/forge.html@@ -1,230 +1,376 @@<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Forge — Turn Any Text into a 3D Model · three.ws</title>- <meta name="description" content="Type a description, get a downloadable 3D model. Forge runs Flux + TRELLIS to produce a textured GLB you can inspect in AR, embed anywhere, and attach to your AI agent." />- <meta name="robots" content="index, follow" />- <link rel="canonical" href="https://three.ws/features/forge" />+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Forge — Turn Any Text into a 3D Model · three.ws</title>+ <meta+ name="description"+ content="Type a description, get a downloadable 3D model. Forge runs Flux + TRELLIS to produce a textured GLB you can inspect in AR, embed anywhere, and attach to your AI agent."+ />+ <meta name="robots" content="index, follow" />+ <link rel="canonical" href="https://three.ws/features/forge" />- <meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:title" content="Forge — Turn Any Text into a 3D Model · three.ws" />- <meta property="og:description" content="Type a description, get a downloadable 3D model. Flux + TRELLIS in one click." />- <meta property="og:url" content="https://three.ws/features/forge" />- <meta property="og:image" content="https://three.ws/api/feature-og?feature=forge&title=Type+a+description.+Get+a+3D+model.&sub=Forge+turns+text+into+a+downloadable+GLB+in+seconds." />- <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="Forge — Turn Any Text into a 3D Model · three.ws" />- <meta name="twitter:description" content="Type a description, get a downloadable 3D model. Flux + TRELLIS in one click." />- <meta name="twitter:image" content="https://three.ws/api/feature-og?feature=forge&title=Type+a+description.+Get+a+3D+model.&sub=Forge+turns+text+into+a+downloadable+GLB+in+seconds." />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:title" content="Forge — Turn Any Text into a 3D Model · three.ws" />+ <meta+ property="og:description"+ content="Type a description, get a downloadable 3D model. Flux + TRELLIS in one click."+ />+ <meta property="og:url" content="https://three.ws/features/forge" />+ <meta+ property="og:image"+ content="https://three.ws/api/feature-og?feature=forge&title=Type+a+description.+Get+a+3D+model.&sub=Forge+turns+text+into+a+downloadable+GLB+in+seconds."+ />+ <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="Forge — Turn Any Text into a 3D Model · three.ws" />+ <meta+ name="twitter:description"+ content="Type a description, get a downloadable 3D model. Flux + TRELLIS in one click."+ />+ <meta+ name="twitter:image"+ content="https://three.ws/api/feature-og?feature=forge&title=Type+a+description.+Get+a+3D+model.&sub=Forge+turns+text+into+a+downloadable+GLB+in+seconds."+ />- <link rel="shortcut icon" href="/favicon.ico" />- <link rel="apple-touch-icon" href="/pwa-192x192.png" />- <link rel="stylesheet" href="/style.css" />- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/features-landing.css" />- <link rel="stylesheet" href="/fonts/fonts.css" />+ <link rel="shortcut icon" href="/favicon.ico" />+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/features-landing.css" />+ <link rel="stylesheet" href="/fonts/fonts.css" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>- <script type="application/ld+json">- {- "@context": "https://schema.org",- "@graph": [- {- "@type": "SoftwareApplication",- "name": "Forge — Text to 3D",- "url": "https://three.ws/forge",- "applicationCategory": "DesignApplication",- "description": "Generate textured 3D models from text descriptions using Flux image generation and TRELLIS 3D reconstruction.",- "operatingSystem": "Web",- "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }- },- {- "@type": "FAQPage",- "mainEntity": [- {- "@type": "Question",- "name": "How long does Forge take to generate a model?",- "acceptedAnswer": { "@type": "Answer", "text": "Most models generate in 30–90 seconds. Flux creates the texture image first, then TRELLIS reconstructs the 3D mesh from it." }- },- {- "@type": "Question",- "name": "What file format does Forge output?",- "acceptedAnswer": { "@type": "Answer", "text": "Forge outputs a GLB (binary glTF) file — the industry-standard 3D format readable by Blender, Unity, Unreal, and every major 3D viewer." }- },- {- "@type": "Question",- "name": "Can I use the model commercially?",- "acceptedAnswer": { "@type": "Answer", "text": "Yes. Models you generate with Forge are yours to use, modify, and ship in any project including commercial work." }- }- ]- }- ]- }- </script>-</head>-<body class="fl-page">- <header><div id="nav-container"></div></header>- <script src="/nav.js"></script>+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@graph": [+ {+ "@type": "SoftwareApplication",+ "name": "Forge — Text to 3D",+ "url": "https://three.ws/forge",+ "applicationCategory": "DesignApplication",+ "description": "Generate textured 3D models from text descriptions using Flux image generation and TRELLIS 3D reconstruction.",+ "operatingSystem": "Web",+ "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }+ },+ {+ "@type": "FAQPage",+ "mainEntity": [+ {+ "@type": "Question",+ "name": "How long does Forge take to generate a model?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Most models generate in 30–90 seconds. Flux creates the texture image first, then TRELLIS reconstructs the 3D mesh from it."+ }+ },+ {+ "@type": "Question",+ "name": "What file format does Forge output?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Forge outputs a GLB (binary glTF) file — the industry-standard 3D format readable by Blender, Unity, Unreal, and every major 3D viewer."+ }+ },+ {+ "@type": "Question",+ "name": "Can I use the model commercially?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Yes. Models you generate with Forge are yours to use, modify, and ship in any project including commercial work."+ }+ }+ ]+ }+ ]+ }+ </script>+ </head>+ <body class="fl-page">+ <header><div id="nav-container"></div></header>+ <script src="/nav.js"></script>- <main class="fl-main" id="main-content">- <nav class="fl-breadcrumb" aria-label="Breadcrumb">- <a href="/">three.ws</a>- <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>- <a href="/features">Features</a>- <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>- <span class="fl-breadcrumb-current">Forge</span>- </nav>+ <main class="fl-main" id="main-content">+ <nav class="fl-breadcrumb" aria-label="Breadcrumb">+ <a href="/">three.ws</a>+ <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>+ <a href="/features">Features</a>+ <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>+ <span class="fl-breadcrumb-current">Forge</span>+ </nav>- <!-- Hero -->- <section class="fl-hero" aria-labelledby="forge-hero-h1">- <div class="fl-hero-inner">- <div class="fl-hero-copy">- <span class="fl-eyebrow"><span class="fl-eyebrow-dot" aria-hidden="true"></span>Text to 3D</span>- <h1 id="forge-hero-h1">Type a description.<br>Get a 3D model.</h1>- <p class="fl-hero-sub">Forge runs Flux image generation and TRELLIS 3D reconstruction back-to-back. Describe any object and walk away with a textured GLB you can orbit in AR, embed anywhere, or attach to your AI agent.</p>- <div class="fl-hero-actions">- <a href="/forge" class="fl-btn-primary">Open Forge →</a>- <a href="/features" class="fl-btn-ghost">All features</a>- </div>- </div>- <div class="fl-hero-preview" aria-label="3D model preview — robot expressive sample">- <model-viewer- src="/animations/robotexpressive.glb"- alt="Sample 3D model generated by Forge — robot character"- auto-rotate- auto-rotate-delay="500"- rotation-per-second="12deg"- camera-controls- shadow-intensity="0.4"- environment-image="neutral"- style="background:transparent;width:100%;height:100%;"- ></model-viewer>- <span class="fl-preview-label">Sample GLB · drag to orbit</span>- </div>- </div>- </section>+ <!-- Hero -->+ <section class="fl-hero" aria-labelledby="forge-hero-h1">+ <div class="fl-hero-inner">+ <div class="fl-hero-copy">+ <span class="fl-eyebrow"+ ><span class="fl-eyebrow-dot" aria-hidden="true"></span>Text to 3D</span+ >+ <h1 id="forge-hero-h1">Type a description.<br />Get a 3D model.</h1>+ <p class="fl-hero-sub">+ Forge runs Flux image generation and TRELLIS 3D reconstruction+ back-to-back. Describe any object and walk away with a textured GLB you+ can orbit in AR, embed anywhere, or attach to your AI agent.+ </p>+ <div class="fl-hero-actions">+ <a href="/forge" class="fl-btn-primary">Open Forge →</a>+ <a href="/features" class="fl-btn-ghost">All features</a>+ </div>+ </div>+ <div+ class="fl-hero-preview"+ aria-label="3D model preview — robot expressive sample"+ >+ <model-viewer+ src="/animations/robotexpressive.glb"+ alt="Sample 3D model generated by Forge — robot character"+ auto-rotate+ auto-rotate-delay="500"+ rotation-per-second="12deg"+ camera-controls+ shadow-intensity="0.4"+ environment-image="neutral"+ style="background: transparent; width: 100%; height: 100%"+ ></model-viewer>+ <span class="fl-preview-label">Sample GLB · drag to orbit</span>+ </div>+ </div>+ </section>- <!-- How it works -->- <section class="fl-how fl-section" aria-labelledby="forge-how-h2">- <p class="fl-section-label">How it works</p>- <h2 id="forge-how-h2">Three steps from prompt to model</h2>- <div class="fl-steps" role="list">- <article class="fl-step" role="listitem">- <span class="fl-step-num">01</span>- <h3>Write your prompt</h3>- <p>Describe what you want — "a ceramic coffee mug with blue glaze," "a rusted iron sword," anything. Be specific about material and style for best results.</p>- </article>- <article class="fl-step" role="listitem">- <span class="fl-step-num">02</span>- <h3>Flux + TRELLIS generate it</h3>- <p>Flux renders a detailed texture image from your text. TRELLIS lifts that image into a full 3D mesh with UV-mapped textures, all in one pipeline run.</p>- </article>- <article class="fl-step" role="listitem">- <span class="fl-step-num">03</span>- <h3>Download, embed, or attach</h3>- <p>Inspect the result in the in-browser viewer, download the GLB, share a link, or pin it to your AI agent as its 3D body — all from the same page.</p>- </article>- </div>- </section>+ <!-- How it works -->+ <section class="fl-how fl-section" aria-labelledby="forge-how-h2">+ <p class="fl-section-label">How it works</p>+ <h2 id="forge-how-h2">Three steps from prompt to model</h2>+ <div class="fl-steps" role="list">+ <article class="fl-step" role="listitem">+ <span class="fl-step-num">01</span>+ <h3>Write your prompt</h3>+ <p>+ Describe what you want — "a ceramic coffee mug with blue glaze," "a+ rusted iron sword," anything. Be specific about material and style for+ best results.+ </p>+ </article>+ <article class="fl-step" role="listitem">+ <span class="fl-step-num">02</span>+ <h3>Flux + TRELLIS generate it</h3>+ <p>+ Flux renders a detailed texture image from your text. TRELLIS lifts that+ image into a full 3D mesh with UV-mapped textures, all in one pipeline+ run.+ </p>+ </article>+ <article class="fl-step" role="listitem">+ <span class="fl-step-num">03</span>+ <h3>Download, embed, or attach</h3>+ <p>+ Inspect the result in the in-browser viewer, download the GLB, share a+ link, or pin it to your AI agent as its 3D body — all from the same+ page.+ </p>+ </article>+ </div>+ </section>- <!-- Highlight cards -->- <section class="fl-highlights fl-section" aria-labelledby="forge-highlights-h2">- <h2 id="forge-highlights-h2">What you can do with it</h2>- <div class="fl-cards">- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">⬡</span>- <h3>AR inspection</h3>- <p>Every generated model opens in WebXR AR mode with one tap — place it on your real desk or floor and walk around it.</p>- </div>- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">⬡</span>- <h3>Agent avatar</h3>- <p>Attach the GLB to any AI agent on three.ws so the agent gets a custom 3D body instead of a default avatar.</p>- </div>- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">⬡</span>- <h3>Shareable link</h3>- <p>Each generated model gets a permanent URL you can share — it loads in any browser without plugins or app installs.</p>- </div>- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">⬡</span>- <h3>Data flywheel</h3>- <p>All forge generations feed the three.ws training flywheel — improving model quality for every creator over time.</p>- </div>- </div>- </section>+ <!-- Highlight cards -->+ <section class="fl-highlights fl-section" aria-labelledby="forge-highlights-h2">+ <h2 id="forge-highlights-h2">What you can do with it</h2>+ <div class="fl-cards">+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">⬡</span>+ <h3>AR inspection</h3>+ <p>+ Every generated model opens in WebXR AR mode with one tap — place it on+ your real desk or floor and walk around it.+ </p>+ </div>+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">⬡</span>+ <h3>Agent avatar</h3>+ <p>+ Attach the GLB to any AI agent on three.ws so the agent gets a custom 3D+ body instead of a default avatar.+ </p>+ </div>+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">⬡</span>+ <h3>Shareable link</h3>+ <p>+ Each generated model gets a permanent URL you can share — it loads in+ any browser without plugins or app installs.+ </p>+ </div>+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">⬡</span>+ <h3>Data flywheel</h3>+ <p>+ All forge generations feed the three.ws training flywheel — improving+ model quality for every creator over time.+ </p>+ </div>+ </div>+ </section>- <!-- FAQ -->- <section class="fl-faq fl-section" aria-labelledby="forge-faq-h2">- <h2 id="forge-faq-h2">Frequently asked questions</h2>- <div class="fl-faq-list">- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-1">- How long does generation take?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="forge-faq-1" role="region">Most models complete in 30–90 seconds. Flux renders the texture image first, then TRELLIS reconstructs the mesh — the progress bar shows both stages.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-2">- What file format does Forge export?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="forge-faq-2" role="region">GLB (binary glTF 2.0) — the industry-standard format supported by Blender, Unity, Unreal Engine, and every major 3D viewer including Apple Quick Look.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-3">- Can I use generated models commercially?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="forge-faq-3" role="region">Yes. Models you generate are yours to use, modify, and ship in any project, including commercial products.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-4">- What prompts work best?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="forge-faq-4" role="region">Isolated objects with clear material descriptions generate the cleanest meshes. "A ceramic mug with blue glaze" outperforms "a mug." Avoid scenes with multiple objects or complex backgrounds — those compress poorly into a single mesh.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-5">- Is this different from the selfie scanner?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="forge-faq-5" role="region">Yes. <a href="/features/scan" style="color:var(--ink)">Scan</a> reconstructs a 3D avatar from a real photo of your face. Forge generates any object from a text description — they serve different use cases.</div>- </div>- </div>- </section>+ <!-- FAQ -->+ <section class="fl-faq fl-section" aria-labelledby="forge-faq-h2">+ <h2 id="forge-faq-h2">Frequently asked questions</h2>+ <div class="fl-faq-list">+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-1">+ How long does generation take?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="forge-faq-1" role="region">+ Most models complete in 30–90 seconds. Flux renders the texture image+ first, then TRELLIS reconstructs the mesh — the progress bar shows both+ stages.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-2">+ What file format does Forge export?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="forge-faq-2" role="region">+ GLB (binary glTF 2.0) — the industry-standard format supported by+ Blender, Unity, Unreal Engine, and every major 3D viewer including Apple+ Quick Look.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-3">+ Can I use generated models commercially?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="forge-faq-3" role="region">+ Yes. Models you generate are yours to use, modify, and ship in any+ project, including commercial products.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-4">+ What prompts work best?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="forge-faq-4" role="region">+ Isolated objects with clear material descriptions generate the cleanest+ meshes. "A ceramic mug with blue glaze" outperforms "a mug." Avoid+ scenes with multiple objects or complex backgrounds — those compress+ poorly into a single mesh.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="forge-faq-5">+ Is this different from the selfie scanner?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="forge-faq-5" role="region">+ Yes.+ <a href="/features/scan" style="color: var(--ink)">Scan</a> reconstructs+ a 3D avatar from a real photo of your face. Forge generates any object+ from a text description — they serve different use cases.+ </div>+ </div>+ </div>+ </section>- <!-- Final CTA -->- <section class="fl-cta-band" aria-labelledby="forge-cta-h2">- <div class="fl-cta-inner">- <h2 id="forge-cta-h2">Start generating in 30 seconds</h2>- <p>No account required for your first model. Type a description, watch it appear.</p>- <div class="fl-cta-actions">- <a href="/forge" class="fl-btn-primary">Open Forge →</a>- <a href="/features/scan" class="fl-btn-ghost">Try Scan instead</a>- </div>- </div>- </section>- </main>+ <!-- Final CTA -->+ <section class="fl-cta-band" aria-labelledby="forge-cta-h2">+ <div class="fl-cta-inner">+ <h2 id="forge-cta-h2">Start generating in 30 seconds</h2>+ <p>+ No account required for your first model. Type a description, watch it+ appear.+ </p>+ <div class="fl-cta-actions">+ <a href="/forge" class="fl-btn-primary">Open Forge →</a>+ <a href="/features/scan" class="fl-btn-ghost">Try Scan instead</a>+ </div>+ </div>+ </section>+ </main>- <script>- document.querySelectorAll('.fl-faq-q').forEach(btn => {- btn.addEventListener('click', () => {- const expanded = btn.getAttribute('aria-expanded') === 'true';- btn.setAttribute('aria-expanded', String(!expanded));- const panel = document.getElementById(btn.getAttribute('aria-controls'));- if (panel) panel.classList.toggle('open', !expanded);- });- });- </script>+ <script>+ document.querySelectorAll('.fl-faq-q').forEach((btn) => {+ btn.addEventListener('click', () => {+ const expanded = btn.getAttribute('aria-expanded') === 'true';+ btn.setAttribute('aria-expanded', String(!expanded));+ const panel = document.getElementById(btn.getAttribute('aria-controls'));+ if (panel) panel.classList.toggle('open', !expanded);+ });+ });+ </script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/features/scan.html b/pages/features/scan.htmlindex 8760faf80..807799535 100644--- a/pages/features/scan.html+++ b/pages/features/scan.html@@ -1,230 +1,375 @@<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Scan — Turn Your Selfie into a Rigged 3D Avatar · three.ws</title>- <meta name="description" content="Point your camera at your face, hold still for 60 seconds, and walk away with a rigged 3D avatar ready to animate. Free, entirely in your browser — no app download." />- <meta name="robots" content="index, follow" />- <link rel="canonical" href="https://three.ws/features/scan" />+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Scan — Turn Your Selfie into a Rigged 3D Avatar · three.ws</title>+ <meta+ name="description"+ content="Point your camera at your face, hold still for 60 seconds, and walk away with a rigged 3D avatar ready to animate. Free, entirely in your browser — no app download."+ />+ <meta name="robots" content="index, follow" />+ <link rel="canonical" href="https://three.ws/features/scan" />- <meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:title" content="Scan — Turn Your Selfie into a Rigged 3D Avatar · three.ws" />- <meta property="og:description" content="One photo → rigged 3D avatar. Free, in your browser, no app." />- <meta property="og:url" content="https://three.ws/features/scan" />- <meta property="og:image" content="https://three.ws/api/feature-og?feature=scan&title=Your+face+in+3D.+In+60+seconds.&sub=Point+your+camera+and+walk+away+with+a+rigged+avatar." />- <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="Scan — Turn Your Selfie into a Rigged 3D Avatar · three.ws" />- <meta name="twitter:description" content="One photo → rigged 3D avatar. Free, in your browser, no app." />- <meta name="twitter:image" content="https://three.ws/api/feature-og?feature=scan&title=Your+face+in+3D.+In+60+seconds.&sub=Point+your+camera+and+walk+away+with+a+rigged+avatar." />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta+ property="og:title"+ content="Scan — Turn Your Selfie into a Rigged 3D Avatar · three.ws"+ />+ <meta+ property="og:description"+ content="One photo → rigged 3D avatar. Free, in your browser, no app."+ />+ <meta property="og:url" content="https://three.ws/features/scan" />+ <meta+ property="og:image"+ content="https://three.ws/api/feature-og?feature=scan&title=Your+face+in+3D.+In+60+seconds.&sub=Point+your+camera+and+walk+away+with+a+rigged+avatar."+ />+ <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="Scan — Turn Your Selfie into a Rigged 3D Avatar · three.ws"+ />+ <meta+ name="twitter:description"+ content="One photo → rigged 3D avatar. Free, in your browser, no app."+ />+ <meta+ name="twitter:image"+ content="https://three.ws/api/feature-og?feature=scan&title=Your+face+in+3D.+In+60+seconds.&sub=Point+your+camera+and+walk+away+with+a+rigged+avatar."+ />- <link rel="shortcut icon" href="/favicon.ico" />- <link rel="apple-touch-icon" href="/pwa-192x192.png" />- <link rel="stylesheet" href="/style.css" />- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/features-landing.css" />- <link rel="stylesheet" href="/fonts/fonts.css" />+ <link rel="shortcut icon" href="/favicon.ico" />+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/features-landing.css" />+ <link rel="stylesheet" href="/fonts/fonts.css" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>- <script type="application/ld+json">- {- "@context": "https://schema.org",- "@graph": [- {- "@type": "SoftwareApplication",- "name": "three.ws Scan — Selfie to 3D Avatar",- "url": "https://three.ws/scan",- "applicationCategory": "MultimediaApplication",- "description": "Reconstruct a rigged 3D avatar from a single selfie photo using photogrammetry and neural reconstruction, entirely in the browser.",- "operatingSystem": "Web",- "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }- },- {- "@type": "FAQPage",- "mainEntity": [- {- "@type": "Question",- "name": "Does Scan work on any phone?",- "acceptedAnswer": { "@type": "Answer", "text": "Scan works in any modern browser with camera access — Chrome, Safari, or Firefox on Android or iPhone. No app download needed." }- },- {- "@type": "Question",- "name": "Is my photo stored?",- "acceptedAnswer": { "@type": "Answer", "text": "Your photo is processed server-side to generate the mesh, then stored only as part of your three.ws avatar. You can delete it from your account at any time." }- },- {- "@type": "Question",- "name": "Can I use the avatar for VRChat or other platforms?",- "acceptedAnswer": { "@type": "Answer", "text": "The output is a standard GLB file compatible with any platform that accepts glTF 2.0 models, including VRChat, Meta Horizon, Spatial, and custom WebXR experiences." }- }- ]- }- ]- }- </script>-</head>-<body class="fl-page">- <header><div id="nav-container"></div></header>- <script src="/nav.js"></script>+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@graph": [+ {+ "@type": "SoftwareApplication",+ "name": "three.ws Scan — Selfie to 3D Avatar",+ "url": "https://three.ws/scan",+ "applicationCategory": "MultimediaApplication",+ "description": "Reconstruct a rigged 3D avatar from a single selfie photo using photogrammetry and neural reconstruction, entirely in the browser.",+ "operatingSystem": "Web",+ "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }+ },+ {+ "@type": "FAQPage",+ "mainEntity": [+ {+ "@type": "Question",+ "name": "Does Scan work on any phone?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Scan works in any modern browser with camera access — Chrome, Safari, or Firefox on Android or iPhone. No app download needed."+ }+ },+ {+ "@type": "Question",+ "name": "Is my photo stored?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "Your photo is processed server-side to generate the mesh, then stored only as part of your three.ws avatar. You can delete it from your account at any time."+ }+ },+ {+ "@type": "Question",+ "name": "Can I use the avatar for VRChat or other platforms?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "The output is a standard GLB file compatible with any platform that accepts glTF 2.0 models, including VRChat, Meta Horizon, Spatial, and custom WebXR experiences."+ }+ }+ ]+ }+ ]+ }+ </script>+ </head>+ <body class="fl-page">+ <header><div id="nav-container"></div></header>+ <script src="/nav.js"></script>- <main class="fl-main" id="main-content">- <nav class="fl-breadcrumb" aria-label="Breadcrumb">- <a href="/">three.ws</a>- <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>- <a href="/features">Features</a>- <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>- <span class="fl-breadcrumb-current">Scan</span>- </nav>+ <main class="fl-main" id="main-content">+ <nav class="fl-breadcrumb" aria-label="Breadcrumb">+ <a href="/">three.ws</a>+ <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>+ <a href="/features">Features</a>+ <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>+ <span class="fl-breadcrumb-current">Scan</span>+ </nav>- <!-- Hero -->- <section class="fl-hero" aria-labelledby="scan-hero-h1">- <div class="fl-hero-inner">- <div class="fl-hero-copy">- <span class="fl-eyebrow"><span class="fl-eyebrow-dot" aria-hidden="true"></span>Selfie → 3D Avatar</span>- <h1 id="scan-hero-h1">Your face in 3D.<br>In 60 seconds.</h1>- <p class="fl-hero-sub">Point your phone camera at your face, hold still, and walk away with a rigged 3D avatar you can animate, embed, and use anywhere. Free, entirely in your browser — no download, no app.</p>- <div class="fl-hero-actions">- <a href="/scan" class="fl-btn-primary">Start scanning →</a>- <a href="/features" class="fl-btn-ghost">All features</a>- </div>- </div>- <div class="fl-hero-preview" aria-label="Sample 3D avatar preview">- <model-viewer- src="/animations/soldier.glb"- alt="Sample rigged 3D avatar"- auto-rotate- auto-rotate-delay="500"- rotation-per-second="10deg"- camera-controls- shadow-intensity="0.5"- environment-image="neutral"- style="background:transparent;width:100%;height:100%;"- ></model-viewer>- <span class="fl-preview-label">Sample rigged avatar · drag to orbit</span>- </div>- </div>- </section>+ <!-- Hero -->+ <section class="fl-hero" aria-labelledby="scan-hero-h1">+ <div class="fl-hero-inner">+ <div class="fl-hero-copy">+ <span class="fl-eyebrow"+ ><span class="fl-eyebrow-dot" aria-hidden="true"></span>Selfie → 3D+ Avatar</span+ >+ <h1 id="scan-hero-h1">Your face in 3D.<br />In 60 seconds.</h1>+ <p class="fl-hero-sub">+ Point your phone camera at your face, hold still, and walk away with a+ rigged 3D avatar you can animate, embed, and use anywhere. Free,+ entirely in your browser — no download, no app.+ </p>+ <div class="fl-hero-actions">+ <a href="/scan" class="fl-btn-primary">Start scanning →</a>+ <a href="/features" class="fl-btn-ghost">All features</a>+ </div>+ </div>+ <div class="fl-hero-preview" aria-label="Sample 3D avatar preview">+ <model-viewer+ src="/animations/soldier.glb"+ alt="Sample rigged 3D avatar"+ auto-rotate+ auto-rotate-delay="500"+ rotation-per-second="10deg"+ camera-controls+ shadow-intensity="0.5"+ environment-image="neutral"+ style="background: transparent; width: 100%; height: 100%"+ ></model-viewer>+ <span class="fl-preview-label">Sample rigged avatar · drag to orbit</span>+ </div>+ </div>+ </section>- <!-- How it works -->- <section class="fl-how fl-section" aria-labelledby="scan-how-h2">- <p class="fl-section-label">How it works</p>- <h2 id="scan-how-h2">Camera in, 3D avatar out</h2>- <div class="fl-steps" role="list">- <article class="fl-step" role="listitem">- <span class="fl-step-num">01</span>- <h3>Point your camera</h3>- <p>Open the scanner on any phone or desktop browser with camera access. Position your face in the guide frame — good light, neutral expression, camera at eye level.</p>- </article>- <article class="fl-step" role="listitem">- <span class="fl-step-num">02</span>- <h3>Multi-angle capture</h3>- <p>The scanner captures several angles automatically and sends them to our reconstruction pipeline, which builds a full 3D mesh with UV-mapped skin texture.</p>- </article>- <article class="fl-step" role="listitem">- <span class="fl-step-num">03</span>- <h3>Rigged GLB, ready to use</h3>- <p>The output is a rigged GLB — the skeleton is wired so standard BVH or mixamo animations work out of the box. Download it, embed it, or launch your agent with it.</p>- </article>- </div>- </section>+ <!-- How it works -->+ <section class="fl-how fl-section" aria-labelledby="scan-how-h2">+ <p class="fl-section-label">How it works</p>+ <h2 id="scan-how-h2">Camera in, 3D avatar out</h2>+ <div class="fl-steps" role="list">+ <article class="fl-step" role="listitem">+ <span class="fl-step-num">01</span>+ <h3>Point your camera</h3>+ <p>+ Open the scanner on any phone or desktop browser with camera access.+ Position your face in the guide frame — good light, neutral expression,+ camera at eye level.+ </p>+ </article>+ <article class="fl-step" role="listitem">+ <span class="fl-step-num">02</span>+ <h3>Multi-angle capture</h3>+ <p>+ The scanner captures several angles automatically and sends them to our+ reconstruction pipeline, which builds a full 3D mesh with UV-mapped skin+ texture.+ </p>+ </article>+ <article class="fl-step" role="listitem">+ <span class="fl-step-num">03</span>+ <h3>Rigged GLB, ready to use</h3>+ <p>+ The output is a rigged GLB — the skeleton is wired so standard BVH or+ mixamo animations work out of the box. Download it, embed it, or launch+ your agent with it.+ </p>+ </article>+ </div>+ </section>- <!-- Highlight cards -->- <section class="fl-highlights fl-section" aria-labelledby="scan-highlights-h2">- <h2 id="scan-highlights-h2">What you get</h2>- <div class="fl-cards">- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">◎</span>- <h3>Real face texture</h3>- <p>The mesh uses your actual photo as a texture map — not a cartoon or stylized approximation.</p>- </div>- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">◎</span>- <h3>Standard rig</h3>- <p>The skeleton follows the standard Mixamo humanoid-rig convention so thousands of free animation clips work without re-rigging.</p>- </div>- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">◎</span>- <h3>AR passthrough</h3>- <p>Load your avatar in Walk mode and toggle AR — your 3D self walks on your real floor through your phone camera.</p>- </div>- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">◎</span>- <h3>No account for first scan</h3>- <p>Try the scanner without signing up. Create an account to save, download, and share your avatar.</p>- </div>- </div>- </section>+ <!-- Highlight cards -->+ <section class="fl-highlights fl-section" aria-labelledby="scan-highlights-h2">+ <h2 id="scan-highlights-h2">What you get</h2>+ <div class="fl-cards">+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">◎</span>+ <h3>Real face texture</h3>+ <p>+ The mesh uses your actual photo as a texture map — not a cartoon or+ stylized approximation.+ </p>+ </div>+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">◎</span>+ <h3>Standard rig</h3>+ <p>+ The skeleton follows the standard Mixamo humanoid-rig convention so+ thousands of free animation clips work without re-rigging.+ </p>+ </div>+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">◎</span>+ <h3>AR passthrough</h3>+ <p>+ Load your avatar in Walk mode and toggle AR — your 3D self walks on your+ real floor through your phone camera.+ </p>+ </div>+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">◎</span>+ <h3>No account for first scan</h3>+ <p>+ Try the scanner without signing up. Create an account to save, download,+ and share your avatar.+ </p>+ </div>+ </div>+ </section>- <!-- FAQ -->- <section class="fl-faq fl-section" aria-labelledby="scan-faq-h2">- <h2 id="scan-faq-h2">Frequently asked questions</h2>- <div class="fl-faq-list">- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-1">- Does Scan work on any phone or browser?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="scan-faq-1" role="region">Yes — Chrome, Safari, or Firefox on Android or iPhone. The scanner uses the standard WebRTC camera API. No app download required.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-2">- What lighting conditions give the best result?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="scan-faq-2" role="region">Soft, even front lighting works best — like facing a window on an overcast day. Avoid harsh shadows across your face or bright backlighting.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-3">- Is my photo stored on three.ws servers?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="scan-faq-3" role="region">Your photo is processed server-side and retained as the avatar texture in your account. You can delete your avatar — and its source texture — from your account settings at any time.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-4">- Can I use the avatar in VRChat, Spatial, or other platforms?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="scan-faq-4" role="region">The output is a standard glTF 2.0 GLB, compatible with any platform that accepts that format — VRChat, Meta Horizon Worlds, Spatial, Unity, Unreal Engine, or custom WebXR apps.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-5">- How is this different from Forge?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="scan-faq-5" role="region"><a href="/features/forge" style="color:var(--ink)">Forge</a> generates any object from a text description. Scan reconstructs a real 3D avatar from a photo of your actual face — the two tools are complementary.</div>- </div>- </div>- </section>+ <!-- FAQ -->+ <section class="fl-faq fl-section" aria-labelledby="scan-faq-h2">+ <h2 id="scan-faq-h2">Frequently asked questions</h2>+ <div class="fl-faq-list">+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-1">+ Does Scan work on any phone or browser?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="scan-faq-1" role="region">+ Yes — Chrome, Safari, or Firefox on Android or iPhone. The scanner uses+ the standard WebRTC camera API. No app download required.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-2">+ What lighting conditions give the best result?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="scan-faq-2" role="region">+ Soft, even front lighting works best — like facing a window on an+ overcast day. Avoid harsh shadows across your face or bright+ backlighting.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-3">+ Is my photo stored on three.ws servers?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="scan-faq-3" role="region">+ Your photo is processed server-side and retained as the avatar texture+ in your account. You can delete your avatar — and its source texture —+ from your account settings at any time.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-4">+ Can I use the avatar in VRChat, Spatial, or other platforms?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="scan-faq-4" role="region">+ The output is a standard glTF 2.0 GLB, compatible with any platform that+ accepts that format — VRChat, Meta Horizon Worlds, Spatial, Unity,+ Unreal Engine, or custom WebXR apps.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="scan-faq-5">+ How is this different from Forge?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="scan-faq-5" role="region">+ <a href="/features/forge" style="color: var(--ink)">Forge</a> generates+ any object from a text description. Scan reconstructs a real 3D avatar+ from a photo of your actual face — the two tools are complementary.+ </div>+ </div>+ </div>+ </section>- <!-- Final CTA -->- <section class="fl-cta-band" aria-labelledby="scan-cta-h2">- <div class="fl-cta-inner">- <h2 id="scan-cta-h2">Scan yourself in 60 seconds</h2>- <p>All you need is a camera and decent lighting. No account required to try.</p>- <div class="fl-cta-actions">- <a href="/scan" class="fl-btn-primary">Start scanning →</a>- <a href="/features/forge" class="fl-btn-ghost">Try Forge instead</a>- </div>- </div>- </section>- </main>+ <!-- Final CTA -->+ <section class="fl-cta-band" aria-labelledby="scan-cta-h2">+ <div class="fl-cta-inner">+ <h2 id="scan-cta-h2">Scan yourself in 60 seconds</h2>+ <p>All you need is a camera and decent lighting. No account required to try.</p>+ <div class="fl-cta-actions">+ <a href="/scan" class="fl-btn-primary">Start scanning →</a>+ <a href="/features/forge" class="fl-btn-ghost">Try Forge instead</a>+ </div>+ </div>+ </section>+ </main>- <script>- document.querySelectorAll('.fl-faq-q').forEach(btn => {- btn.addEventListener('click', () => {- const expanded = btn.getAttribute('aria-expanded') === 'true';- btn.setAttribute('aria-expanded', String(!expanded));- const panel = document.getElementById(btn.getAttribute('aria-controls'));- if (panel) panel.classList.toggle('open', !expanded);- });- });- </script>+ <script>+ document.querySelectorAll('.fl-faq-q').forEach((btn) => {+ btn.addEventListener('click', () => {+ const expanded = btn.getAttribute('aria-expanded') === 'true';+ btn.setAttribute('aria-expanded', String(!expanded));+ const panel = document.getElementById(btn.getAttribute('aria-controls'));+ if (panel) panel.classList.toggle('open', !expanded);+ });+ });+ </script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/features/walk.html b/pages/features/walk.htmlindex 14c4dacb2..bac0dec0c 100644--- a/pages/features/walk.html+++ b/pages/features/walk.html@@ -1,225 +1,365 @@<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Walk — Drive Your 3D Avatar in AR · three.ws</title>- <meta name="description" content="Walk your AI agent's 3D avatar through the real world using WASD or a joystick. Flip to AR mode and it walks on your actual floor through your phone camera." />- <meta name="robots" content="index, follow" />- <link rel="canonical" href="https://three.ws/features/walk" />+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Walk — Drive Your 3D Avatar in AR · three.ws</title>+ <meta+ name="description"+ content="Walk your AI agent's 3D avatar through the real world using WASD or a joystick. Flip to AR mode and it walks on your actual floor through your phone camera."+ />+ <meta name="robots" content="index, follow" />+ <link rel="canonical" href="https://three.ws/features/walk" />- <meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:title" content="Walk — Drive Your 3D Avatar in AR · three.ws" />- <meta property="og:description" content="WASD or joystick. Flip to AR and your avatar walks on your real floor." />- <meta property="og:url" content="https://three.ws/features/walk" />- <meta property="og:image" content="https://three.ws/api/feature-og?feature=walk&title=Walk+your+AI+agent.+In+AR.&sub=WASD+or+joystick.+Toggle+AR+and+it+walks+on+your+real+floor." />- <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="Walk — Drive Your 3D Avatar in AR · three.ws" />- <meta name="twitter:description" content="WASD or joystick. Flip to AR and your avatar walks on your real floor." />- <meta name="twitter:image" content="https://three.ws/api/feature-og?feature=walk&title=Walk+your+AI+agent.+In+AR.&sub=WASD+or+joystick.+Toggle+AR+and+it+walks+on+your+real+floor." />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:title" content="Walk — Drive Your 3D Avatar in AR · three.ws" />+ <meta+ property="og:description"+ content="WASD or joystick. Flip to AR and your avatar walks on your real floor."+ />+ <meta property="og:url" content="https://three.ws/features/walk" />+ <meta+ property="og:image"+ content="https://three.ws/api/feature-og?feature=walk&title=Walk+your+AI+agent.+In+AR.&sub=WASD+or+joystick.+Toggle+AR+and+it+walks+on+your+real+floor."+ />+ <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="Walk — Drive Your 3D Avatar in AR · three.ws" />+ <meta+ name="twitter:description"+ content="WASD or joystick. Flip to AR and your avatar walks on your real floor."+ />+ <meta+ name="twitter:image"+ content="https://three.ws/api/feature-og?feature=walk&title=Walk+your+AI+agent.+In+AR.&sub=WASD+or+joystick.+Toggle+AR+and+it+walks+on+your+real+floor."+ />- <link rel="shortcut icon" href="/favicon.ico" />- <link rel="apple-touch-icon" href="/pwa-192x192.png" />- <link rel="stylesheet" href="/style.css" />- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/features-landing.css" />- <link rel="stylesheet" href="/fonts/fonts.css" />+ <link rel="shortcut icon" href="/favicon.ico" />+ <link rel="apple-touch-icon" href="/pwa-192x192.png" />+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/features-landing.css" />+ <link rel="stylesheet" href="/fonts/fonts.css" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>- <script type="application/ld+json">- {- "@context": "https://schema.org",- "@graph": [- {- "@type": "SoftwareApplication",- "name": "three.ws Walk — 3D Avatar AR",- "url": "https://three.ws/walk",- "applicationCategory": "EntertainmentApplication",- "description": "Drive a 3D AI agent avatar in real-time using keyboard or on-screen joystick. Supports WebXR AR passthrough to walk the avatar on a real physical surface.",- "operatingSystem": "Web",- "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }- },- {- "@type": "FAQPage",- "mainEntity": [- {- "@type": "Question",- "name": "Does AR mode work on all phones?",- "acceptedAnswer": { "@type": "Answer", "text": "AR passthrough requires WebXR support — available on most recent Android devices with Chrome, and on iPhone with iOS 17+ and Safari. The 3D walk mode works on all browsers." }- },- {- "@type": "Question",- "name": "Can I walk any avatar or just my own?",- "acceptedAnswer": { "@type": "Answer", "text": "You can walk any avatar on three.ws — pick from the gallery or paste a GLB URL. Pass ?avatar=<id> in the URL to deep-link directly to a specific avatar in walk mode." }- }- ]- }- ]- }- </script>-</head>-<body class="fl-page">- <header><div id="nav-container"></div></header>- <script src="/nav.js"></script>+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@graph": [+ {+ "@type": "SoftwareApplication",+ "name": "three.ws Walk — 3D Avatar AR",+ "url": "https://three.ws/walk",+ "applicationCategory": "EntertainmentApplication",+ "description": "Drive a 3D AI agent avatar in real-time using keyboard or on-screen joystick. Supports WebXR AR passthrough to walk the avatar on a real physical surface.",+ "operatingSystem": "Web",+ "offers": { "@type": "Offer", "price": "0", "priceCurrency": "USD" }+ },+ {+ "@type": "FAQPage",+ "mainEntity": [+ {+ "@type": "Question",+ "name": "Does AR mode work on all phones?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "AR passthrough requires WebXR support — available on most recent Android devices with Chrome, and on iPhone with iOS 17+ and Safari. The 3D walk mode works on all browsers."+ }+ },+ {+ "@type": "Question",+ "name": "Can I walk any avatar or just my own?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "You can walk any avatar on three.ws — pick from the gallery or paste a GLB URL. Pass ?avatar=<id> in the URL to deep-link directly to a specific avatar in walk mode."+ }+ }+ ]+ }+ ]+ }+ </script>+ </head>+ <body class="fl-page">+ <header><div id="nav-container"></div></header>+ <script src="/nav.js"></script>- <main class="fl-main" id="main-content">- <nav class="fl-breadcrumb" aria-label="Breadcrumb">- <a href="/">three.ws</a>- <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>- <a href="/features">Features</a>- <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>- <span class="fl-breadcrumb-current">Walk</span>- </nav>+ <main class="fl-main" id="main-content">+ <nav class="fl-breadcrumb" aria-label="Breadcrumb">+ <a href="/">three.ws</a>+ <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>+ <a href="/features">Features</a>+ <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>+ <span class="fl-breadcrumb-current">Walk</span>+ </nav>- <!-- Hero -->- <section class="fl-hero" aria-labelledby="walk-hero-h1">- <div class="fl-hero-inner">- <div class="fl-hero-copy">- <span class="fl-eyebrow"><span class="fl-eyebrow-dot" aria-hidden="true"></span>3D Avatar + AR</span>- <h1 id="walk-hero-h1">Walk your AI agent.<br>In AR.</h1>- <p class="fl-hero-sub">Use WASD on desktop or a joystick on mobile to move your 3D avatar. Toggle AR mode and the avatar walks on your real floor through your phone camera — no app install required.</p>- <div class="fl-hero-actions">- <a href="/walk" class="fl-btn-primary">Start walking →</a>- <a href="/features" class="fl-btn-ghost">All features</a>- </div>- </div>- <div class="fl-hero-preview" aria-label="3D avatar ready to walk">- <model-viewer- src="/avatars/cz.glb"- alt="3D avatar ready for walk mode"- auto-rotate- auto-rotate-delay="800"- rotation-per-second="8deg"- camera-controls- shadow-intensity="0.6"- environment-image="neutral"- style="background:transparent;width:100%;height:100%;"- ></model-viewer>- <span class="fl-preview-label">Sample avatar · drag to orbit</span>- </div>- </div>- </section>+ <!-- Hero -->+ <section class="fl-hero" aria-labelledby="walk-hero-h1">+ <div class="fl-hero-inner">+ <div class="fl-hero-copy">+ <span class="fl-eyebrow"+ ><span class="fl-eyebrow-dot" aria-hidden="true"></span>3D Avatar ++ AR</span+ >+ <h1 id="walk-hero-h1">Walk your AI agent.<br />In AR.</h1>+ <p class="fl-hero-sub">+ Use WASD on desktop or a joystick on mobile to move your 3D avatar.+ Toggle AR mode and the avatar walks on your real floor through your+ phone camera — no app install required.+ </p>+ <div class="fl-hero-actions">+ <a href="/walk" class="fl-btn-primary">Start walking →</a>+ <a href="/features" class="fl-btn-ghost">All features</a>+ </div>+ </div>+ <div class="fl-hero-preview" aria-label="3D avatar ready to walk">+ <model-viewer+ src="/avatars/cz.glb"+ alt="3D avatar ready for walk mode"+ auto-rotate+ auto-rotate-delay="800"+ rotation-per-second="8deg"+ camera-controls+ shadow-intensity="0.6"+ environment-image="neutral"+ style="background: transparent; width: 100%; height: 100%"+ ></model-viewer>+ <span class="fl-preview-label">Sample avatar · drag to orbit</span>+ </div>+ </div>+ </section>- <!-- How it works -->- <section class="fl-how fl-section" aria-labelledby="walk-how-h2">- <p class="fl-section-label">How it works</p>- <h2 id="walk-how-h2">Three steps to your avatar in motion</h2>- <div class="fl-steps" role="list">- <article class="fl-step" role="listitem">- <span class="fl-step-num">01</span>- <h3>Choose your avatar</h3>- <p>Pick any avatar from your library, browse the gallery, or paste a GLB URL directly. Share a walk link with ?avatar= to deep-link others into the same avatar.</p>- </article>- <article class="fl-step" role="listitem">- <span class="fl-step-num">02</span>- <h3>Move with WASD or joystick</h3>- <p>Desktop: WASD or arrow keys to move, mouse to rotate camera. Mobile: on-screen joystick and swipe. The avatar uses real physics — it walks, runs, and turns naturally.</p>- </article>- <article class="fl-step" role="listitem">- <span class="fl-step-num">03</span>- <h3>Toggle AR for real-world placement</h3>- <p>Tap the AR button on iOS or Android to enter WebXR passthrough. The avatar detects your floor and walks on it. Point your phone at any surface and it adapts.</p>- </article>- </div>- </section>+ <!-- How it works -->+ <section class="fl-how fl-section" aria-labelledby="walk-how-h2">+ <p class="fl-section-label">How it works</p>+ <h2 id="walk-how-h2">Three steps to your avatar in motion</h2>+ <div class="fl-steps" role="list">+ <article class="fl-step" role="listitem">+ <span class="fl-step-num">01</span>+ <h3>Choose your avatar</h3>+ <p>+ Pick any avatar from your library, browse the gallery, or paste a GLB+ URL directly. Share a walk link with ?avatar= to deep-link others into+ the same avatar.+ </p>+ </article>+ <article class="fl-step" role="listitem">+ <span class="fl-step-num">02</span>+ <h3>Move with WASD or joystick</h3>+ <p>+ Desktop: WASD or arrow keys to move, mouse to rotate camera. Mobile:+ on-screen joystick and swipe. The avatar uses real physics — it walks,+ runs, and turns naturally.+ </p>+ </article>+ <article class="fl-step" role="listitem">+ <span class="fl-step-num">03</span>+ <h3>Toggle AR for real-world placement</h3>+ <p>+ Tap the AR button on iOS or Android to enter WebXR passthrough. The+ avatar detects your floor and walks on it. Point your phone at any+ surface and it adapts.+ </p>+ </article>+ </div>+ </section>- <!-- Highlight cards -->- <section class="fl-highlights fl-section" aria-labelledby="walk-highlights-h2">- <h2 id="walk-highlights-h2">Built for real-world use</h2>- <div class="fl-cards">- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">◉</span>- <h3>Real physics</h3>- <p>Powered by Rapier physics — kinematic character controller, heightfield collision, and smooth step-up so the avatar navigates terrain naturally.</p>- </div>- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">◉</span>- <h3>WebXR AR passthrough</h3>- <p>One tap switches to camera passthrough on supported devices. The avatar places itself on your detected floor and walks through your real environment.</p>- </div>- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">◉</span>- <h3>Shareable link</h3>- <p>Pass ?avatar=<id>&handle=<handle> in the URL to generate a shareable OG card that shows the avatar thumbnail when unfurled in Slack, X, or iMessage.</p>- </div>- <div class="fl-card">- <span class="fl-card-icon" aria-hidden="true">◉</span>- <h3>Embeddable</h3>- <p>The walk experience can be embedded as a fullscreen iframe on any website — use it as a live avatar demo on your landing page or product docs.</p>- </div>- </div>- </section>+ <!-- Highlight cards -->+ <section class="fl-highlights fl-section" aria-labelledby="walk-highlights-h2">+ <h2 id="walk-highlights-h2">Built for real-world use</h2>+ <div class="fl-cards">+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">◉</span>+ <h3>Real physics</h3>+ <p>+ Powered by Rapier physics — kinematic character controller, heightfield+ collision, and smooth step-up so the avatar navigates terrain naturally.+ </p>+ </div>+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">◉</span>+ <h3>WebXR AR passthrough</h3>+ <p>+ One tap switches to camera passthrough on supported devices. The avatar+ places itself on your detected floor and walks through your real+ environment.+ </p>+ </div>+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">◉</span>+ <h3>Shareable link</h3>+ <p>+ Pass ?avatar=<id>&handle=<handle> in the URL to generate+ a shareable OG card that shows the avatar thumbnail when unfurled in+ Slack, X, or iMessage.+ </p>+ </div>+ <div class="fl-card">+ <span class="fl-card-icon" aria-hidden="true">◉</span>+ <h3>Embeddable</h3>+ <p>+ The walk experience can be embedded as a fullscreen iframe on any+ website — use it as a live avatar demo on your landing page or product+ docs.+ </p>+ </div>+ </div>+ </section>- <!-- FAQ -->- <section class="fl-faq fl-section" aria-labelledby="walk-faq-h2">- <h2 id="walk-faq-h2">Frequently asked questions</h2>- <div class="fl-faq-list">- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-1">- Does AR mode work on all phones?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="walk-faq-1" role="region">AR passthrough requires WebXR — supported on most Android devices running Chrome (v81+), and on iPhone with iOS 17+ and Safari. Walk mode without AR works on all modern browsers.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-2">- Can I walk any avatar, or just one I created?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="walk-faq-2" role="region">Any avatar on three.ws — yours, the gallery's, or any GLB URL — can be walked. Pass ?avatar=<id> in the URL to open a specific one directly.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-3">- Can I embed Walk on my own website?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="walk-faq-3" role="region">Yes. Use the /walk-embed route as a fullscreen iframe. Pass ?avatar= to pre-load your avatar. For a fully hosted widget with AI chat attached, see <a href="/features/studio" style="color:var(--ink)">Studio</a>.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-4">- What's the difference between Walk and Play?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="walk-faq-4" role="region">Walk is a single-avatar experience with AR passthrough focused on showcasing your agent. <a href="/features/play" style="color:var(--ink)">Play</a> is a multiplayer coin-community world with trading and biome terrain.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-5">- Does it work on desktop too?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="walk-faq-5" role="region">Yes. On desktop use WASD or arrow keys to move and mouse to rotate the camera. AR is mobile-only since it requires a physical camera feed.</div>- </div>- </div>- </section>+ <!-- FAQ -->+ <section class="fl-faq fl-section" aria-labelledby="walk-faq-h2">+ <h2 id="walk-faq-h2">Frequently asked questions</h2>+ <div class="fl-faq-list">+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-1">+ Does AR mode work on all phones?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="walk-faq-1" role="region">+ AR passthrough requires WebXR — supported on most Android devices+ running Chrome (v81+), and on iPhone with iOS 17+ and Safari. Walk mode+ without AR works on all modern browsers.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-2">+ Can I walk any avatar, or just one I created?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="walk-faq-2" role="region">+ Any avatar on three.ws — yours, the gallery's, or any GLB URL — can be+ walked. Pass ?avatar=<id> in the URL to open a specific one+ directly.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-3">+ Can I embed Walk on my own website?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="walk-faq-3" role="region">+ Yes. Use the /walk-embed route as a fullscreen iframe. Pass ?avatar= to+ pre-load your avatar. For a fully hosted widget with AI chat attached,+ see <a href="/features/studio" style="color: var(--ink)">Studio</a>.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-4">+ What's the difference between Walk and Play?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="walk-faq-4" role="region">+ Walk is a single-avatar experience with AR passthrough focused on+ showcasing your agent.+ <a href="/features/play" style="color: var(--ink)">Play</a> is a+ multiplayer coin-community world with trading and biome terrain.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="walk-faq-5">+ Does it work on desktop too?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="walk-faq-5" role="region">+ Yes. On desktop use WASD or arrow keys to move and mouse to rotate the+ camera. AR is mobile-only since it requires a physical camera feed.+ </div>+ </div>+ </div>+ </section>- <!-- Final CTA -->- <section class="fl-cta-band" aria-labelledby="walk-cta-h2">- <div class="fl-cta-inner">- <h2 id="walk-cta-h2">See your agent move</h2>- <p>No install. No account. Open Walk and pick any avatar from the gallery.</p>- <div class="fl-cta-actions">- <a href="/walk" class="fl-btn-primary">Start walking →</a>- <a href="/features/play" class="fl-btn-ghost">Try Play instead</a>- </div>- </div>- </section>- </main>+ <!-- Final CTA -->+ <section class="fl-cta-band" aria-labelledby="walk-cta-h2">+ <div class="fl-cta-inner">+ <h2 id="walk-cta-h2">See your agent move</h2>+ <p>No install. No account. Open Walk and pick any avatar from the gallery.</p>+ <div class="fl-cta-actions">+ <a href="/walk" class="fl-btn-primary">Start walking →</a>+ <a href="/features/play" class="fl-btn-ghost">Try Play instead</a>+ </div>+ </div>+ </section>+ </main>- <script>- document.querySelectorAll('.fl-faq-q').forEach(btn => {- btn.addEventListener('click', () => {- const expanded = btn.getAttribute('aria-expanded') === 'true';- btn.setAttribute('aria-expanded', String(!expanded));- const panel = document.getElementById(btn.getAttribute('aria-controls'));- if (panel) panel.classList.toggle('open', !expanded);- });- });- </script>+ <script>+ document.querySelectorAll('.fl-faq-q').forEach((btn) => {+ btn.addEventListener('click', () => {+ const expanded = btn.getAttribute('aria-expanded') === 'true';+ btn.setAttribute('aria-expanded', String(!expanded));+ const panel = document.getElementById(btn.getAttribute('aria-controls'));+ if (panel) panel.classList.toggle('open', !expanded);+ });+ });+ </script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/forge.html b/pages/forge.htmlindex 194fa6299..86065fdbe 100644--- a/pages/forge.html+++ b/pages/forge.html@@ -1,4 +1,4 @@-<!DOCTYPE html>+<!doctype html><html lang="en"><head><meta charset="UTF-8" />@@ -14,16 +14,19 @@content="Describe an object, watch it become an interactive 3D model. Real generation, real GLB, downloadable."/><meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:url" content="https://three.ws/forge" />- <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:site" content="@trythreews" />- <meta name="twitter:title" content="Forge · Text → 3D · three.ws" />- <meta name="twitter:description" content="Type a description, get a textured 3D model. Forge turns a text prompt into an interactive GLB you can orbit, inspect in AR, and download." />- <meta name="twitter:image" content="https://three.ws/og-image.png" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/forge" />+ <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:site" content="@trythreews" />+ <meta name="twitter:title" content="Forge · Text → 3D · three.ws" />+ <meta+ name="twitter:description"+ content="Type a description, get a textured 3D model. Forge turns a text prompt into an interactive GLB you can orbit, inspect in AR, and download."+ />+ <meta name="twitter:image" content="https://three.ws/og-image.png" /><meta name="theme-color" content="#080814" /><link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" />@@ -36,6 +39,8 @@<scripttype="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-main {@@ -131,7 +136,9 @@padding: 0.32rem 0.55rem;border-radius: var(--radius-sm);cursor: pointer;- transition: background 0.15s, color 0.15s;+ transition:+ background 0.15s,+ color 0.15s;}.aspect button:hover {color: var(--ink);@@ -159,7 +166,10 @@border-radius: var(--radius-md);padding: 0.6rem 1.2rem;cursor: pointer;- transition: transform 0.12s ease, opacity 0.15s, box-shadow 0.15s;+ transition:+ transform 0.12s ease,+ opacity 0.15s,+ box-shadow 0.15s;}.btn:hover {box-shadow: 0 0 0 4px var(--accent-soft);@@ -221,7 +231,9 @@font-size: var(--text-sm);padding: 0.5rem 0.7rem;outline: none;- transition: border-color 0.15s, box-shadow 0.15s;+ transition:+ border-color 0.15s,+ box-shadow 0.15s;}.byok-input:focus-visible {border-color: var(--accent);@@ -278,7 +290,9 @@padding: 0.5rem 1.05rem;border-radius: var(--radius-sm);cursor: pointer;- transition: background 0.15s, color 0.15s;+ transition:+ background 0.15s,+ color 0.15s;}.mode-switch button:hover {color: var(--ink);@@ -317,7 +331,10 @@display: grid;place-items: center;cursor: pointer;- transition: border-color 0.15s, background 0.15s, transform 0.12s;+ transition:+ border-color 0.15s,+ background 0.15s,+ transform 0.12s;}.view-slot:hover {border-color: var(--accent);@@ -512,7 +529,10 @@font-size: var(--text-sm);padding: 0.4rem 0.85rem;cursor: pointer;- transition: color 0.15s, border-color 0.15s, background 0.15s;+ transition:+ color 0.15s,+ border-color 0.15s,+ background 0.15s;}.chip:hover {color: var(--ink);@@ -680,7 +700,9 @@padding: 0.34rem 0.6rem;border-radius: var(--radius-sm);cursor: pointer;- transition: background 0.15s, color 0.15s;+ transition:+ background 0.15s,+ color 0.15s;}.verdict button:hover {color: var(--ink);@@ -771,7 +793,9 @@padding: 0.4rem 0.7rem;border-radius: var(--radius-sm);cursor: pointer;- transition: background 0.15s, color 0.15s;+ transition:+ background 0.15s,+ color 0.15s;}.seg button:hover {color: var(--ink);@@ -876,7 +900,11 @@cursor: pointer;color: var(--ink);font: inherit;- transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s, background 0.15s;+ transition:+ border-color 0.15s,+ transform 0.12s,+ box-shadow 0.15s,+ background 0.15s;}.stylize-card:hover {border-color: var(--stroke-strong);@@ -908,7 +936,9 @@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;+ transition:+ color 0.15s,+ transform 0.2s ease;}.stylize-thumb svg {width: 58%;@@ -1026,7 +1056,10 @@padding: 0;color: inherit;font: inherit;- transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;+ transition:+ border-color 0.15s,+ transform 0.12s,+ box-shadow 0.15s;}.creation:hover {border-color: var(--stroke-strong);@@ -1128,14 +1161,19 @@<span class="forge-eyebrow">Text · Image · Multi-view → 3D · live</span><h1>Forge a 3D model from words or photos</h1><p>- Describe an object, or upload up to four photos of it from different angles. Forge- reconstructs a textured mesh you can orbit, view in AR, and download as GLB — and- more views mean a sharper model with no guessed-at back.+ Describe an object, or upload up to four photos of it from different angles.+ Forge reconstructs a textured mesh you can orbit, view in AR, and download as+ GLB — and more views mean a sharper model with no guessed-at back.</p></header><div class="mode-switch-wrap">- <div class="mode-switch" role="tablist" aria-label="Generation mode" id="mode-switch">+ <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>@@ -1172,7 +1210,9 @@multiplehidden/>- <label for="image-prompt" class="is-hidden">Optional guidance for reconstruction</label>+ <label for="image-prompt" class="is-hidden"+ >Optional guidance for reconstruction</label+ ><textareaid="image-prompt"class="image-prompt"@@ -1180,8 +1220,9 @@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, drag a thumbnail to reorder. PNG/JPG/WebP, up to 8 MB each.+ Add 1–4 views of the <strong>same</strong> object (front · back · left ·+ right). Drag to drop, click to browse, drag a thumbnail to reorder.+ PNG/JPG/WebP, up to 8 MB each.</p></div>@@ -1190,14 +1231,25 @@<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>+ <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+ class="aspect"+ role="group"+ aria-labelledby="engine-label"+ id="engine"+ ></div></div><div class="byok-row is-hidden" id="byok-row"><label class="fq-label" for="provider-key" id="byok-label">API key</label>@@ -1248,9 +1300,9 @@<span class="glyph" aria-hidden="true">◳</span><h3>Nothing forged yet</h3><p>- Type a description and tap an example, or switch to <strong>From photos</strong> and- drop in up to four views of one object. Generation reconstructs a textured mesh —- usually 30–90 seconds.+ Type a description and tap an example, or switch to+ <strong>From photos</strong> and drop in up to four views of one object.+ Generation reconstructs a textured mesh — usually 30–90 seconds.</p></div>@@ -1296,7 +1348,11 @@></model-viewer><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>+ <span+ class="views-badge is-hidden"+ id="result-views"+ title="Reference views fused"+ ></span><div class="actions"><divclass="verdict"@@ -1321,12 +1377,38 @@👎 Discard</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>+ <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><button class="btn" type="button" id="again">Make another</button></div></div>@@ -1359,7 +1441,12 @@<div class="optimize-body" id="optimize-body"><div class="opt-field"><span>Mode</span>- <div class="seg" id="opt-mode" role="group" aria-label="Remesh mode">+ <div+ class="seg"+ id="opt-mode"+ role="group"+ aria-label="Remesh mode"+ ><button type="button" data-mode="triangle" aria-pressed="false">Triangle</button>@@ -1404,7 +1491,12 @@<button class="btn" type="button" id="opt-run"><span id="opt-run-label">Optimize</span></button>- <span class="opt-status" id="opt-status" role="status" aria-live="polite"></span>+ <span+ class="opt-status"+ id="opt-status"+ role="status"+ aria-live="polite"+ ></span></div><div class="opt-stats is-hidden" id="opt-stats"></div>@@ -1416,8 +1508,9 @@<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.+ 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@@ -1433,11 +1526,18 @@<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>+ <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>+ <button+ class="btn btn-ghost"+ type="button"+ id="stylize-revert"+ hidden+ >Revert to original</button></div>@@ -1455,7 +1555,9 @@<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>+ <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></div>@@ -1483,10 +1585,10 @@</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>.+ 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>@@ -1494,7 +1596,7 @@<script type="module" src="/src/forge.js"></script><script type="module" src="/src/forge-stylize.js"></script><script type="module" src="/src/forge-optimize.js"></script>- <div id="footer-container"></div>- <script src="/footer.js"></script>+ <div id="footer-container"></div>+ <script src="/footer.js"></script></body></html>diff --git a/pages/gallery-picker.html b/pages/gallery-picker.htmlindex c89253263..f4e42427c 100644--- a/pages/gallery-picker.html+++ b/pages/gallery-picker.html@@ -9,7 +9,10 @@<meta property="og:type" content="website" /><meta property="og:url" content="https://three.ws/gallery-picker" /><meta property="og:title" content="Avatar Gallery — three.ws" />- <meta property="og:description" content="Browse, preview, and grab any public 3D avatar on three.ws." />+ <meta+ property="og:description"+ content="Browse, preview, and grab any public 3D avatar on three.ws."+ /><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" />@@ -28,6 +31,8 @@<scripttype="module"src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js"+ integrity="sha384-Ftcjj/GNLxPvzNDftO/oryXB9aGxsGZY9JGqsXG0uUKgQDl9RfDgsx9NJ/4IVNPe"+ crossorigin="anonymous"></script><style>body {@@ -89,7 +94,8 @@<p class="gp-crumb"><a href="/">Home</a> / <a href="/gallery">Gallery</a></p><h1 class="gp-title">Avatar Gallery</h1><p class="gp-sub">- Browse every public 3D avatar on three.ws. Preview live in 3D, copy share links, GLB URLs, or embed snippets.+ Browse every public 3D avatar on three.ws. Preview live in 3D, copy share links,+ GLB URLs, or embed snippets.</p></div>@@ -116,5 +122,5 @@<script src="/brand.js" defer></script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/home.html b/pages/home.htmlindex 19780f05f..56f8d3baf 100644--- a/pages/home.html+++ b/pages/home.html@@ -34,6 +34,7 @@<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="/tokens.css" /><link rel="stylesheet" href="/buttons.css" /><style>:root {@@ -83,115 +84,7 @@.wrap-1440 { max-width: 1440px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }@media (max-width: 720px) { .wrap-1280, .wrap-1440 { padding-left: 20px; padding-right: 20px; } }- /* ── NAV ─────────────────────────────────────────────────── */- .nav {- position: sticky; top: 0; z-index: 100;- border-bottom: 1px solid var(--hairline);- background: rgba(5,5,5,0.82);- backdrop-filter: blur(20px) saturate(140%);- }- .nav-inner {- display: flex; align-items: center; gap: 32px;- padding: 16px 32px; max-width: 1440px; margin: 0 auto;- }- .brand {- display: flex; align-items: center; gap: 10px;- font-family: var(--font-display);- font-weight: 600; letter-spacing: -0.025em; font-size: 16.5px;- flex-shrink: 0;- }- .brand-mark {- width: 24px; height: 24px;- border-radius: 5px;- display: block;- flex-shrink: 0;- }- .nav-main { display: flex; gap: 2px; margin-left: 12px; flex: 1; }- .nav-main a {- padding: 7px 12px; font-size: 14px; font-weight: 450;- color: var(--text-2); transition: color 0.12s;- }- .nav-main a:hover { color: var(--text); }- .nav-end { display: flex; align-items: center; gap: 4px; }- .nav-end a { padding: 7px 12px; font-size: 14px; font-weight: 450; color: var(--text-2); }- .nav-end a:hover { color: var(--text); }- .nav-end .console {- color: var(--text); font-weight: 500;- border: 1px solid var(--hairline-strong);- padding: 7px 16px; border-radius: 7px; margin-left: 6px;- transition: border-color 0.15s, background 0.15s;- }- .nav-end .console:hover { border-color: var(--text); background: rgba(255,255,255,0.04); }- @media (max-width: 880px) {- .nav-main { display: none; }- .nav-inner { padding: 14px 20px; gap: 16px; }- }-- /* ── NAV DROPDOWNS ───────────────────────────────────────── */- .nav-grp { position: relative; display: flex; }- .nav-trigger {- display: inline-flex; align-items: center; gap: 5px;- padding: 7px 12px; font-size: 14px; font-weight: 450;- color: var(--text-2); background: none; border: 0;- border-radius: 7px; font-family: inherit; cursor: pointer;- transition: color 0.12s, background 0.12s;- }- .nav-trigger:hover,- .nav-grp.open .nav-trigger { color: var(--text); }- .nav-grp.open .nav-trigger { background: rgba(255,255,255,0.04); }- .nav-caret { font-size: 9px; opacity: 0.55; transition: transform 0.2s ease; }- .nav-grp.open .nav-caret { transform: rotate(180deg); }- .nav-pop {- position: absolute; top: calc(100% + 9px); left: 0;- min-width: 272px; padding: 7px;- background: rgba(11,11,11,0.97);- backdrop-filter: blur(24px) saturate(140%);- -webkit-backdrop-filter: blur(24px) saturate(140%);- border: 1px solid var(--hairline-strong);- border-radius: 13px;- box-shadow: 0 20px 54px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.4);- display: grid; gap: 1px;- opacity: 0; transform: translateY(-6px) scale(0.985);- transform-origin: top left; pointer-events: none;- transition: opacity 0.16s ease, transform 0.16s ease;- z-index: 200;- }- /* invisible hover bridge so the menu doesn't close in the gap */- .nav-pop::before {- content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 12px;- }- .nav-grp.open .nav-pop {- opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;- }- .nav-pop.wide { grid-template-columns: 1fr 1fr; min-width: 540px; }- .nav-mi {- display: block; padding: 9px 12px; border-radius: 9px;- transition: background 0.12s;- }- .nav-mi:hover { background: var(--surface-2); }- .nav-mi-t {- display: flex; align-items: center; gap: 6px;- font-size: 13.5px; font-weight: 500; color: var(--text);- letter-spacing: -0.01em;- }- .nav-mi-d {- display: block; font-size: 12px; color: var(--text-3);- margin-top: 1px; line-height: 1.4;- }- .nav-pill-sm {- display: inline-block; padding: 1px 5px;- font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;- letter-spacing: 0.08em; line-height: 1.5; border-radius: 4px;- background: rgba(255,255,255,0.1); color: var(--text);- text-transform: uppercase;- }- .nav-pop-note {- padding: 6px 12px 8px; font-size: 11px; color: var(--text-4);- line-height: 1.45; grid-column: 1 / -1;- border-bottom: 1px solid var(--hairline); margin-bottom: 2px;- }- .nav-main > a { display: inline-flex; align-items: center; }- .nav-link-pill { display: inline-flex; align-items: center; gap: 6px; }+ /* Header/nav styles live in /nav.css (loaded by /nav.js). *//* Buttons: canonical shared system — see public/buttons.css (loaded above). */.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }@@ -1061,49 +954,6 @@.foot-ca-label { color: #9ad4ff; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }.foot-ca-addr { opacity: .7; }- /* ── MOBILE NAV ─────────────────────────────────────────── */- .nav-toggle {- display: none; align-items: center; justify-content: center;- width: 36px; height: 36px; padding: 0; margin-left: auto;- background: none; border: 1px solid var(--hairline-strong);- border-radius: 7px; color: var(--text); cursor: pointer;- transition: border-color 0.15s, background 0.15s;- }- .nav-toggle:hover { border-color: var(--text); background: rgba(255,255,255,0.04); }- .nav-toggle svg { width: 16px; height: 16px; }- .nav-toggle .close { display: none; }- .nav-toggle[aria-expanded="true"] .open { display: none; }- .nav-toggle[aria-expanded="true"] .close { display: block; }- .nav-drawer {- display: none; position: fixed; inset: 57px 0 0;- z-index: 99; background: rgba(5,5,5,0.96);- backdrop-filter: blur(24px) saturate(140%);- padding: 20px 24px 40px; flex-direction: column; gap: 2px;- overflow-y: auto; -webkit-overflow-scrolling: touch;- overscroll-behavior: contain;- opacity: 0; transform: translateY(-8px);- transition: opacity 0.25s ease, transform 0.25s ease;- }- .nav-drawer.open { display: flex; opacity: 1; transform: translateY(0); }- .nav-drawer .dr-h {- font-family: var(--font-mono); font-size: 11px;- text-transform: uppercase; letter-spacing: 0.16em;- color: var(--text-4); padding: 18px 16px 6px;- }- .nav-drawer .dr-h:first-child { padding-top: 4px; }- .nav-drawer a:not(.btn) {- padding: 11px 16px; font-size: 15.5px; font-weight: 450;- color: var(--text-2); border-radius: 8px;- transition: background 0.12s, color 0.12s;- }- .nav-drawer a:not(.btn):hover { background: var(--surface-1); color: var(--text); }- .nav-drawer .sep { height: 1px; background: var(--hairline); margin: 12px 0; }- .nav-drawer .btn { margin-top: 8px; justify-content: center; }- @media (max-width: 880px) {- .nav-toggle { display: flex; }- .nav-end { display: none; }- }-/* ── HERO LOADING ───────────────────────────────────────── */.hero-stage-shimmer {position: absolute; inset: 0; z-index: 1;@@ -1252,7 +1102,7 @@.bento-card:hover::before { opacity: 1; }/* ── ENHANCED INTERACTIVE STATES ─────────────────────────── */- .copy-btn:focus-visible, .nav-toggle:focus-visible {+ .copy-btn:focus-visible {outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px;}.door-screenshot img[src] { transition: transform 0.4s cubic-bezier(.2,.7,.3,1); }@@ -2445,6 +2295,67 @@.dragon-hint.fade{opacity:0}@media(max-width:720px){.dragon-wrap{height:55vh;min-height:300px}}@media(prefers-reduced-motion:reduce){.dragon-wrap canvas{display:none}}++ /* ── Microinteractions (B11) — focus rings + press states ──────────+ Covers every interactive element above that had hover-only states.+ Ring tokens come from /tokens.css + /buttons.css. */+ .door:focus-visible,+ .stack-card:focus-visible,+ .showcase-agent-card:focus-visible,+ .showcase-cta-card:focus-visible,+ .bento-card a:focus-visible,+ .bento-pill-btn:focus-visible,+ .dev-tab:focus-visible,+ .dev-link:focus-visible,+ .pg-key-hint:focus-visible,+ .pg-send:focus-visible,+ .pg-color-trigger:focus-visible,+ .pg-color-swatch:focus-visible,+ .wyg-card:focus-visible,+ .wyg-anim-chip:focus-visible,+ .wyg-anim-stop:focus-visible,+ .hero-chip:focus-visible,+ .hero-chat-send:focus-visible,+ .hero-chat-input:focus-visible,+ .foot-col a:focus-visible,+ .foot-ca:focus-visible,+ .mint-card-chain a:focus-visible,+ .mktplace-item:focus-visible,+ .mktplace-more:focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);+ outline-offset: var(--focus-ring-offset, 2px);+ }+ /* Press feedback — buttons squash a hair, links/rows tint deeper. */+ .bento-pill-btn:active,+ .dev-tab:active,+ .wyg-anim-chip:active,+ .wyg-anim-stop:active,+ .pg-color-trigger:active,+ .pg-color-swatch:active,+ .mktplace-more:active,+ .hero-chip:active,+ .foot-ca:active {+ transform: scale(0.97);+ }+ .mktplace-item:active { transform: translateY(0) scale(0.97); }+ /* 3D-transformed cards (stack, showcase) and full-bleed cells press via+ a tint instead of a transform so their perspective layout holds. */+ .door:active,+ .stack-card:active,+ .wyg-card:active { background: var(--surface-2); }+ .showcase-agent-card:active,+ .showcase-cta-card:active { border-color: rgba(255,255,255,0.22); }+ .foot-col a:active,+ .dev-link:active,+ .mint-card-chain a:active { opacity: 0.7; }+ @media (prefers-reduced-motion: reduce) {+ .mktplace-item:active,+ .bento-pill-btn:active, .dev-tab:active, .wyg-anim-chip:active,+ .wyg-anim-stop:active, .pg-color-trigger:active, .pg-color-swatch:active,+ .mktplace-more:active, .hero-chip:active, .foot-ca:active {+ transform: none;+ }+ }</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>@@ -2456,286 +2367,12 @@<a class="skip-link" href="#main-content">Skip to content</a><!-- ── NAV ──────────────────────────────────────────────────────── -->-<header class="nav">- <div class="nav-inner">- <a class="brand" href="/">- <img class="brand-mark" src="/three.svg" alt="three.ws" width="24" height="24" />- <span>three.ws</span>- </a>- <nav class="nav-main" aria-label="Primary">- <div class="nav-grp">- <button type="button" class="nav-trigger" aria-haspopup="true" aria-expanded="false">Build<span class="nav-caret" aria-hidden="true">▾</span></button>- <div class="nav-pop" role="menu" aria-label="Build">- <a class="nav-mi" href="/create" role="menuitem"><span class="nav-mi-t">Create agent</span><span class="nav-mi-d">Avatar + brain wizard</span></a>- <a class="nav-mi" href="/create/selfie" role="menuitem"><span class="nav-mi-t">Selfie to avatar <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">One photo → rigged 3D avatar</span></a>- <a class="nav-mi" href="/play" role="menuitem"><span class="nav-mi-t">Worlds <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Every coin is a 3D world — drop in & hang out</span></a>- <a class="nav-mi" href="/app" role="menuitem"><span class="nav-mi-t">Viewer</span><span class="nav-mi-d">Drag-and-drop GLB</span></a>- <a class="nav-mi" href="/playground" role="menuitem"><span class="nav-mi-t">Playground</span><span class="nav-mi-d">Viewer + environment + embed code</span></a>- <a class="nav-mi" href="/validation" role="menuitem"><span class="nav-mi-t">glTF Validator</span><span class="nav-mi-d">Khronos spec check</span></a>- <a class="nav-mi" href="/voice" role="menuitem"><span class="nav-mi-t">Voice Lab <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Clone your voice · TTS playground</span></a>- </div>- </div>- <div class="nav-grp">- <button type="button" class="nav-trigger" aria-haspopup="true" aria-expanded="false">Discover<span class="nav-caret" aria-hidden="true">▾</span></button>- <div class="nav-pop" role="menu" aria-label="Discover">- <a class="nav-mi" href="/what-is" role="menuitem"><span class="nav-mi-t">What is three.ws?</span><span class="nav-mi-d">Plain-English intro + real use-cases — start here</span></a>- <a class="nav-mi" href="/features" role="menuitem"><span class="nav-mi-t">Features</span><span class="nav-mi-d">Everything an agent gets — interactive tour</span></a>- <a class="nav-mi" href="/discover" role="menuitem"><span class="nav-mi-t">ERC-8004 Agents</span><span class="nav-mi-d">On-chain agent directory</span></a>- <a class="nav-mi" href="/agents" role="menuitem"><span class="nav-mi-t">Agents Index</span><span class="nav-mi-d">Browse every registered agent</span></a>- <a class="nav-mi" href="/reputation" role="menuitem"><span class="nav-mi-t">Reputation Explorer</span><span class="nav-mi-d">On-chain scores & attestations</span></a>- <a class="nav-mi" href="/marketplace" role="menuitem"><span class="nav-mi-t">Marketplace</span><span class="nav-mi-d">Buy, sell & remix agents</span></a>- <a class="nav-mi" href="/gallery" role="menuitem"><span class="nav-mi-t">Avatar Gallery</span><span class="nav-mi-d">Every public 3D avatar</span></a>- <a class="nav-mi" href="/skills" role="menuitem"><span class="nav-mi-t">Skills <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Browse agent tool packs & capabilities</span></a>- <a class="nav-mi" href="/bazaar" role="menuitem"><span class="nav-mi-t">Marketplace</span><span class="nav-mi-d">Browse paid APIs and MCP tools</span></a>- <a class="nav-mi" href="/community" role="menuitem"><span class="nav-mi-t">Community</span><span class="nav-mi-d">X, GitHub, and ways to get involved</span></a>- </div>- </div>- <div class="nav-grp">- <button type="button" class="nav-trigger" aria-haspopup="true" aria-expanded="false">Embed<span class="nav-caret" aria-hidden="true">▾</span></button>- <div class="nav-pop" role="menu" aria-label="Embed">- <a class="nav-mi" href="/widgets" role="menuitem"><span class="nav-mi-t">Widgets</span><span class="nav-mi-d">Browse + customize embeddable widgets</span></a>- <a class="nav-mi" href="/studio" role="menuitem"><span class="nav-mi-t">Widget Studio</span><span class="nav-mi-d">Pick avatar → copy snippet</span></a>- <a class="nav-mi" href="/embed.html" role="menuitem"><span class="nav-mi-t">Embed editor</span><span class="nav-mi-d">Tune mode, size, position</span></a>- <a class="nav-mi" href="/avatar-sdk" role="menuitem"><span class="nav-mi-t">Avatar SDK <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">npm · web component · React · GLB upload</span></a>- <a class="nav-mi" href="/docs#embedding" role="menuitem"><span class="nav-mi-t">Embed docs</span><span class="nav-mi-d">iframe + oEmbed</span></a>- <a class="nav-mi" href="/docs#web-component" role="menuitem"><span class="nav-mi-t"><agent-3d></span><span class="nav-mi-d">Web component reference</span></a>- </div>- </div>- <div class="nav-grp">- <button type="button" class="nav-trigger" aria-haspopup="true" aria-expanded="false">Learn<span class="nav-caret" aria-hidden="true">▾</span></button>- <div class="nav-pop" role="menu" aria-label="Learn">- <a class="nav-mi" href="/docs" role="menuitem"><span class="nav-mi-t">Docs</span><span class="nav-mi-d">SDKs + API reference</span></a>- <a class="nav-mi" href="/tutorials" role="menuitem"><span class="nav-mi-t">Tutorials</span><span class="nav-mi-d">Step-by-step guides</span></a>- <a class="nav-mi" href="/brain" role="menuitem"><span class="nav-mi-t">Brain <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Claude · GPT · DeepSeek · Qwen · Llama</span></a>- <a class="nav-mi" href="/chat" role="menuitem"><span class="nav-mi-t">Chat</span><span class="nav-mi-d">Talk to your agent</span></a>- <a class="nav-mi" href="/pay" role="menuitem"><span class="nav-mi-t">Pay <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Agent micropayments + USDC</span></a>- <a class="nav-mi" href="/docs#solana" role="menuitem"><span class="nav-mi-t">Solana SDK</span><span class="nav-mi-d">Attestations + agent-kit</span></a>- </div>- </div>- <div class="nav-grp">- <button type="button" class="nav-trigger" aria-haspopup="true" aria-expanded="false">Integrations<span class="nav-caret" aria-hidden="true">▾</span></button>- <div class="nav-pop wide" role="menu" aria-label="Integrations">- <div class="nav-pop-note">Live partner showcases — built on real platforms, running end-to-end.</div>- <a class="nav-mi" href="/ibm/galaxy" role="menuitem"><span class="nav-mi-t">Agent Galaxy</span><span class="nav-mi-d">Granite embeddings → 3D semantic agent map</span></a>- <a class="nav-mi" href="/ibm/oracle" role="menuitem"><span class="nav-mi-t">Oracle</span><span class="nav-mi-d">Granite TimeSeries forecasting in 3D</span></a>- <a class="nav-mi" href="/ibm/twin" role="menuitem"><span class="nav-mi-t">Digital Twin</span><span class="nav-mi-d">Living market replica + projection</span></a>- <a class="nav-mi" href="/ibm/trust-layer" role="menuitem"><span class="nav-mi-t">Trust Layer</span><span class="nav-mi-d">Granite Guardian governs wallet agents</span></a>- <a class="nav-mi" href="/ibm/identity" role="menuitem"><span class="nav-mi-t">Identity Firewall</span><span class="nav-mi-d">Granite gate against agent impersonation</span></a>- <a class="nav-mi" href="/ibm/proof" role="menuitem"><span class="nav-mi-t">Proof</span><span class="nav-mi-d">On-chain AI notary — forecast → govern → Solana</span></a>- <a class="nav-mi" href="/ibm/vision" role="menuitem"><span class="nav-mi-t">Vision</span><span class="nav-mi-d">Granite Vision — image → understanding</span></a>- <a class="nav-mi" href="/aws" role="menuitem"><span class="nav-mi-t">AWS Marketplace</span><span class="nav-mi-d">three.ws as an AWS Partner listing</span></a>- </div>- </div>- <div class="nav-grp">- <button type="button" class="nav-trigger" aria-haspopup="true" aria-expanded="false">Labs<span class="nav-pill-sm" aria-hidden="true">Beta</span><span class="nav-caret" aria-hidden="true">▾</span></button>- <div class="nav-pop wide" role="menu" aria-label="Labs">- <div class="nav-pop-note">Experimental features — actively iterating. Expect rough edges.</div>- <a class="nav-mi" href="/launchpad" role="menuitem"><span class="nav-mi-t">Launchpad Studio <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Build a 3D launchpad · token · concierge</span></a>- <a class="nav-mi" href="/lipsync" role="menuitem"><span class="nav-mi-t">Lipsync <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">TTS or mic → in-browser viseme → mouth</span></a>- <a class="nav-mi" href="/mocap-studio" role="menuitem"><span class="nav-mi-t">Mocap Studio <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Record face → save clip → replay</span></a>- <a class="nav-mi" href="/pose" role="menuitem"><span class="nav-mi-t">Pose Studio</span><span class="nav-mi-d">Click-to-pose mannequin + export PNG</span></a>- <a class="nav-mi" href="/overlay-control" role="menuitem"><span class="nav-mi-t">OBS Overlay</span><span class="nav-mi-d">Stream deck — emote hotkeys, mic</span></a>- <a class="nav-mi" href="/walk" role="menuitem"><span class="nav-mi-t">Walk <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Walk your avatar — multiplayer + AR</span></a>- <a class="nav-mi" href="/xr" role="menuitem"><span class="nav-mi-t">XR <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Place your avatar in the real world</span></a>- <a class="nav-mi" href="/gmgn" role="menuitem"><span class="nav-mi-t">GMGN Smart Money <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Agent narrates smart wallet signals</span></a>- <a class="nav-mi" href="/pumpfun" role="menuitem"><span class="nav-mi-t">Pump.fun stream</span><span class="nav-mi-d">Mint agent tokens</span></a>- <a class="nav-mi" href="/pump-live" role="menuitem"><span class="nav-mi-t">Live launches</span><span class="nav-mi-d">Real-time launch feed</span></a>- <a class="nav-mi" href="/pump-dashboard" role="menuitem"><span class="nav-mi-t">Pump Dashboard</span><span class="nav-mi-d">Watches · scanner · quotes</span></a>- <a class="nav-mi" href="/pump-visualizer" role="menuitem"><span class="nav-mi-t">Pump Visualizer</span><span class="nav-mi-d">3D view of trending tokens</span></a>- <a class="nav-mi" href="/three-live" role="menuitem"><span class="nav-mi-t">$THREE Live <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Protocol pulse — live trades in 3D</span></a>- <a class="nav-mi" href="/strategy-lab" role="menuitem"><span class="nav-mi-t">Strategy Lab</span><span class="nav-mi-d">DCA + subscriptions</span></a>- <a class="nav-mi" href="/club" role="menuitem"><span class="nav-mi-t">Pole Club <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Pay-per-tip demo — $0.001 / dance</span></a>- <a class="nav-mi" href="/shopper" role="menuitem"><span class="nav-mi-t">Endpoint Shopper <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">AI chains pay-per-call endpoints to answer a task</span></a>- <a class="nav-mi" href="/tutor" role="menuitem"><span class="nav-mi-t">Pay-As-You-Learn Tutor <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">$0.01 per answer in USDC</span></a>- <a class="nav-mi" href="/fact-checker" role="menuitem"><span class="nav-mi-t">Fact Checker <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">$0.10 per claim — cited verdict + attestation</span></a>- <a class="nav-mi" href="/arbitrage" role="menuitem"><span class="nav-mi-t">API Arbitrage <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Cheapest endpoint per capability, live</span></a>- <a class="nav-mi" href="/providers" role="menuitem"><span class="nav-mi-t">API Providers <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Operator profiles for the paid API catalog</span></a>- <a class="nav-mi" href="/unstoppable" role="menuitem"><span class="nav-mi-t">Unstoppable Agent <span class="nav-pill-sm">New</span></span><span class="nav-mi-d">Self-funding agent dashboard, live</span></a>- <a class="nav-mi" href="/forever" role="menuitem"><span class="nav-mi-t">Forever</span><span class="nav-mi-d">Etch a message into Bitcoin — forever</span></a>- <a class="nav-mi" href="/eth-vanity" role="menuitem"><span class="nav-mi-t">ETH vanity (CREATE2)</span><span class="nav-mi-d">Grind a smart-contract address</span></a>- <a class="nav-mi" href="/vanity-wallet" role="menuitem"><span class="nav-mi-t">Vanity wallet</span><span class="nav-mi-d">Grind a Solana address</span></a>- </div>- </div>- <a href="/pricing">Pricing</a>- </nav>- <div class="nav-end">- <a href="/my-agents" data-auth="in" hidden>My Agents</a>- <a href="/login" data-auth="out">Sign in</a>- <a class="console" href="/dashboard" data-auth-name>Console →</a>- </div>- <button class="nav-toggle" aria-label="Menu" aria-expanded="false" id="nav-toggle">- <svg class="open" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"><line x1="2" y1="4" x2="14" y2="4"/><line x1="2" y1="8" x2="14" y2="8"/><line x1="2" y1="12" x2="14" y2="12"/></svg>- <svg class="close" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"><line x1="3" y1="3" x2="13" y2="13"/><line x1="13" y1="3" x2="3" y2="13"/></svg>- </button>- </div>-</header>-<nav class="nav-drawer" id="nav-drawer" aria-label="Mobile" aria-hidden="true">- <div class="dr-h">Build</div>- <a href="/create">Create agent</a>- <a href="/create/selfie">Selfie to avatar</a>- <a href="/worlds">Worlds</a>- <a href="/app">Viewer</a>- <a href="/playground">Playground</a>- <a href="/voice">Voice Lab</a>- <div class="dr-h">Discover</div>- <a href="/what-is">What is three.ws?</a>- <a href="/features">Features</a>- <a href="/discover">ERC-8004 Agents</a>- <a href="/agents">Agents Index</a>- <a href="/reputation">Reputation Explorer</a>- <a href="/marketplace">Marketplace</a>- <a href="/gallery">Avatar Gallery</a>- <a href="/skills">Skills</a>- <a href="/bazaar">Marketplace (paid APIs)</a>- <a href="/community">Community</a>- <div class="dr-h">Embed</div>- <a href="/widgets">Widgets</a>- <a href="/studio">Widget Studio</a>- <a href="/embed.html">Embed editor</a>- <a href="/avatar-sdk">Avatar SDK</a>- <div class="dr-h">Learn</div>- <a href="/docs">Docs</a>- <a href="/tutorials">Tutorials</a>- <a href="/brain">Brain</a>- <a href="/chat">Chat</a>- <a href="/pay">Pay</a>- <div class="dr-h">Integrations</div>- <a href="/ibm/galaxy">Agent Galaxy</a>- <a href="/ibm/oracle">Oracle</a>- <a href="/ibm/twin">Digital Twin</a>- <a href="/ibm/trust-layer">Trust Layer</a>- <a href="/ibm/proof">Proof</a>- <a href="/aws">AWS Marketplace</a>- <div class="dr-h">Labs · Beta</div>- <a href="/launchpad">Launchpad Studio</a>- <a href="/lipsync">Lipsync</a>- <a href="/mocap-studio">Mocap Studio</a>- <a href="/pose">Pose Studio</a>- <a href="/walk">Walk</a>- <a href="/xr">XR</a>- <a href="/gmgn">GMGN Smart Money</a>- <a href="/pumpfun">Pump.fun stream</a>- <a href="/three-live">$THREE Live</a>- <a href="/club">Pole Club</a>- <a href="/shopper">Endpoint Shopper</a>- <a href="/tutor">Pay-As-You-Learn Tutor</a>- <a href="/fact-checker">Fact Checker</a>- <a href="/arbitrage">API Arbitrage</a>- <a href="/providers">API Providers</a>- <a href="/unstoppable">Unstoppable Agent</a>- <a href="/forever">Forever</a>- <div class="dr-h">More</div>- <a href="/pricing">Pricing</a>- <div class="sep"></div>- <a href="/my-agents" data-auth="in" hidden>My Agents</a>- <a href="/login" data-auth="out">Sign in</a>- <a class="btn btn--primary" href="/dashboard" style="margin-top:4px;">Console →</a>-</nav>-<script>- (function () {- var toggle = document.getElementById('nav-toggle');- var drawer = document.getElementById('nav-drawer');- if (!toggle || !drawer) return;- function isOpen() { return drawer.classList.contains('open'); }- function setOpen(open) {- toggle.setAttribute('aria-expanded', open ? 'true' : 'false');- drawer.setAttribute('aria-hidden', open ? 'false' : 'true');- document.body.style.overflow = open ? 'hidden' : '';- drawer.classList.toggle('open', open);- }- toggle.addEventListener('click', function () { setOpen(!isOpen()); });- drawer.addEventListener('click', function (e) {- if (e.target.closest('a')) setOpen(false);- });- document.addEventListener('keydown', function (e) {- if (e.key === 'Escape' && isOpen()) { setOpen(false); toggle.focus(); }- });- window.addEventListener('resize', function () {- if (window.innerWidth > 880 && isOpen()) setOpen(false);- });- })();-- // Auth-aware nav: swap "Sign in" for the account entry points when the visitor- // is signed in. Shared with the site-wide header (public/nav.js) via- // /nav-auth.js so the two navs never drift — see that module for the- // hint-then-reconcile-against-/api/auth/me strategy and data-auth contract.- (function () {- if (typeof window.initNavAuth === 'function') {- window.initNavAuth(document);- return;- }- var s = document.createElement('script');- s.src = '/nav-auth.js';- s.addEventListener('load', function () {- if (typeof window.initNavAuth === 'function') window.initNavAuth(document);- });- document.head.appendChild(s);- })();-- // Desktop nav dropdowns — hover to open, click/keyboard for touch + a11y- (function () {- var groups = Array.prototype.slice.call(document.querySelectorAll('.nav-main .nav-grp'));- if (!groups.length) return;- var hoverCapable = window.matchMedia('(hover: hover)').matches;-- function setOpen(grp, on) {- grp.classList.toggle('open', on);- var t = grp.querySelector('.nav-trigger');- if (t) t.setAttribute('aria-expanded', on ? 'true' : 'false');- }- function closeAll(except) {- groups.forEach(function (g) { if (g !== except) setOpen(g, false); });- }-- groups.forEach(function (grp) {- var trigger = grp.querySelector('.nav-trigger');- var closeTimer;- if (!trigger) return;-- trigger.addEventListener('click', function (e) {- e.stopPropagation();- if (hoverCapable) {- // hover already opens it; a click just pins it open- closeAll(grp);- setOpen(grp, true);- return;- }- var willOpen = !grp.classList.contains('open');- closeAll(grp);- setOpen(grp, willOpen);- });-- if (hoverCapable) {- grp.addEventListener('mouseenter', function () {- clearTimeout(closeTimer);- closeAll(grp);- setOpen(grp, true);- });- grp.addEventListener('mouseleave', function () {- closeTimer = setTimeout(function () { setOpen(grp, false); }, 120);- });- }-- grp.querySelectorAll('.nav-mi').forEach(function (a) {- a.addEventListener('click', function () { setOpen(grp, false); });- });- });-- document.addEventListener('click', function (e) {- if (!e.target.closest('.nav-main .nav-grp')) closeAll();- });- document.addEventListener('keydown', function (e) {- if (e.key === 'Escape') {- var openGrp = document.querySelector('.nav-main .nav-grp.open');- if (openGrp) {- setOpen(openGrp, false);- var t = openGrp.querySelector('.nav-trigger');- if (t) t.focus();- }- }- });- })();-</script>+<!-- Shared site navigation: injected by /nav.js from /nav.html, with every+ menu rendered from /nav-data.js — the single source of truth. The+ homepage uses the same header as every other page; edit menus in+ public/nav-data.js, never here. -->+<div id="nav-container"></div>+<script src="/nav.js" defer></script><!-- ── HERO ─────────────────────────────────────────────────────── --><main id="main-content" tabindex="-1">diff --git a/pages/marketplace.html b/pages/marketplace.htmlindex 56285b09d..41a6aab96 100644--- a/pages/marketplace.html+++ b/pages/marketplace.html@@ -20,7 +20,7 @@<link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/site.webmanifest" /><link rel="canonical" href="https://three.ws/marketplace" />-<link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/style.css" /><link rel="stylesheet" href="/footer.css" /><link rel="stylesheet" href="/marketplace.css" /><link rel="stylesheet" href="/marketplace-v2.css" />@@ -30,7 +30,9 @@[hidden] { display: none } default, so `<div … hidden>` was stillrendering as a grid/flex container — taking up body-grid cells andblocking page scroll. Force display:none whenever hidden is set. */- [hidden] { display: none !important; }+ [hidden] {+ display: none !important;+ }/* Screen-reader-only utility: visible to assistive tech, hidden visually.Used to label search/sort controls without changing the topbar layout. */@@ -52,7 +54,11 @@gap: 10px;margin: 12px 24px 0;padding: 8px 14px;- background: linear-gradient(90deg, rgba(253, 224, 71, 0.07), rgba(253, 224, 71, 0.02));+ background: linear-gradient(+ 90deg,+ rgba(253, 224, 71, 0.07),+ rgba(253, 224, 71, 0.02)+ );border: 1px solid rgba(253, 224, 71, 0.18);border-radius: 10px;color: #fde68a;@@ -88,7 +94,9 @@border-radius: var(--radius-card);overflow: hidden;cursor: pointer;- transition: border-color 0.15s ease, transform 0.15s ease;+ transition:+ border-color 0.15s ease,+ transform 0.15s ease;}.market-card-avatar:hover {border-color: var(--stroke-strong);@@ -204,8 +212,16 @@margin: 16px 24px 0;padding: 28px;background:- radial-gradient(ellipse at top right, rgba(255, 255, 255, 0.08), transparent 60%),- radial-gradient(ellipse at bottom left, rgba(255, 255, 255, 0.04), transparent 50%),+ radial-gradient(+ ellipse at top right,+ rgba(255, 255, 255, 0.08),+ transparent 60%+ ),+ radial-gradient(+ ellipse at bottom left,+ rgba(255, 255, 255, 0.04),+ transparent 50%+ ),linear-gradient(180deg, #0e0e0e, #0a0a0a);border: 1px solid #1f1f1f;border-radius: 20px;@@ -259,14 +275,23 @@content: '';position: absolute;inset: 0;- background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.03) 50%, transparent 70%);+ background: linear-gradient(+ 110deg,+ transparent 30%,+ rgba(255, 255, 255, 0.03) 50%,+ transparent 70%+ );background-size: 200% 100%;animation: hero-shimmer 2.4s ease-in-out infinite;pointer-events: none;}@keyframes hero-shimmer {- 0% { background-position: 200% 0; }- 100% { background-position: -200% 0; }+ 0% {+ background-position: 200% 0;+ }+ 100% {+ background-position: -200% 0;+ }}.market-hero-slide.mv-loaded .market-hero-placeholder {opacity: 0;@@ -275,7 +300,11 @@font-size: 80px;font-weight: 700;line-height: 1;- background: linear-gradient(180deg, rgba(244,244,245,0.5), rgba(161,161,170,0.35));+ background: linear-gradient(+ 180deg,+ rgba(244, 244, 245, 0.5),+ rgba(161, 161, 170, 0.35)+ );-webkit-background-clip: text;background-clip: text;color: transparent;@@ -357,7 +386,9 @@font-weight: 600;font-size: 13px;cursor: pointer;- transition: transform 0.15s ease, box-shadow 0.15s ease;+ transition:+ transform 0.15s ease,+ box-shadow 0.15s ease;}.market-hero-cta:hover {transform: translateY(-1px);@@ -483,8 +514,13 @@/* ── Skeleton loading ─────────────────────────────────────────── */@keyframes mk-skeleton-pulse {- 0%,100% { opacity: 0.4; }- 50% { opacity: 0.7; }+ 0%,+ 100% {+ opacity: 0.4;+ }+ 50% {+ opacity: 0.7;+ }}.market-skeleton {background: linear-gradient(90deg, #111 0%, #1a1a1a 50%, #111 100%);@@ -534,7 +570,9 @@align-items: center;justify-content: center;}- .market-lobby-overlay[hidden] { display: none; }+ .market-lobby-overlay[hidden] {+ display: none;+ }.market-lobby-canvas {width: 100%;height: 100%;@@ -584,7 +622,12 @@gap: 12px;margin: 14px 24px 0;padding: 12px 16px;- background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06) 60%, transparent);+ background: linear-gradient(+ 90deg,+ rgba(255, 255, 255, 0.06),+ rgba(255, 255, 255, 0.06) 60%,+ transparent+ );border: 1px solid rgba(255, 255, 255, 0.12);border-radius: 12px;font-size: 13px;@@ -641,7 +684,9 @@scrollbar-width: thin;scrollbar-color: rgba(255, 255, 255, 0.18) transparent;}- .market-theme-picks::-webkit-scrollbar { height: 6px; }+ .market-theme-picks::-webkit-scrollbar {+ height: 6px;+ }.market-theme-picks::-webkit-scrollbar-thumb {background: rgba(255, 255, 255, 0.18);border-radius: 99px;@@ -656,7 +701,10 @@overflow: hidden;cursor: pointer;scroll-snap-align: start;- transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;+ transition:+ border-color 0.18s ease,+ transform 0.18s ease,+ box-shadow 0.18s ease;text-align: left;appearance: none;color: inherit;@@ -671,7 +719,9 @@outline: none;}.market-theme-pick:focus-visible {- box-shadow: 0 0 0 2px var(--accent, #8b5cf6), 0 8px 22px rgba(0, 0, 0, 0.45);+ box-shadow:+ 0 0 0 2px var(--accent, #8b5cf6),+ 0 8px 22px rgba(0, 0, 0, 0.45);}.market-theme-pick-stage {position: relative;@@ -749,7 +799,9 @@transition: opacity 0.4s ease;pointer-events: none;}- .market-theme-pick.mv-loaded .market-theme-pick-placeholder { opacity: 0; }+ .market-theme-pick.mv-loaded .market-theme-pick-placeholder {+ opacity: 0;+ }/* Skeleton shimmer while the lineup loads. */.market-theme-pick.is-skeleton {cursor: default;@@ -762,15 +814,25 @@animation: market-pick-shimmer 1.2s ease-in-out infinite;}@keyframes market-pick-shimmer {- 0% { background-position: 200% 0; }- 100% { background-position: -200% 0; }+ 0% {+ background-position: 200% 0;+ }+ 100% {+ background-position: -200% 0;+ }}@media (prefers-reduced-motion: reduce) {- .market-theme-pick { transition: border-color 0.18s ease; }+ .market-theme-pick {+ transition: border-color 0.18s ease;+ }.market-theme-pick:hover,- .market-theme-pick:focus-visible { transform: none; }+ .market-theme-pick:focus-visible {+ transform: none;+ }.market-theme-pick.is-skeleton .market-theme-pick-stage,- .market-theme-pick.is-skeleton .market-theme-pick-meta { animation: none; }+ .market-theme-pick.is-skeleton .market-theme-pick-meta {+ animation: none;+ }}/* ── Onchain card variants ────────────────────────────────────── */@@ -817,7 +879,10 @@.market-card-avatar .card-tags .tag-pill {cursor: pointer;font-family: inherit;- transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;+ transition:+ background 0.15s ease,+ color 0.15s ease,+ border-color 0.15s ease;}.market-card-avatar .card-tags .tag-pill:hover {background: rgba(255, 255, 255, 0.18);@@ -855,7 +920,7 @@color: #fde047;border-color: rgba(253, 224, 71, 0.32);}-/* Featured-curated badge over the avatar thumbnail (gold star, top-left) */+ /* Featured-curated badge over the avatar thumbnail (gold star, top-left) */.market-card-avatar.featured {border-color: rgba(253, 224, 71, 0.25);box-shadow: 0 0 0 1px rgba(253, 224, 71, 0.05);@@ -940,7 +1005,9 @@font-weight: 500;font-size: 11px;opacity: 0.6;- transition: opacity 0.15s ease, transform 0.15s ease;+ transition:+ opacity 0.15s ease,+ transform 0.15s ease;}.market-card-avatar:hover .footer .open-cta {opacity: 1;@@ -1107,8 +1174,8 @@font-size: 11px;color: #a1a1aa;}- .avatar-modal-sale input[type="number"],- .avatar-modal-sale input[type="text"] {+ .avatar-modal-sale input[type='number'],+ .avatar-modal-sale input[type='text'] {background: #0a0a0a;border: 1px solid #2a2a2a;border-radius: 8px;@@ -1119,8 +1186,8 @@outline: none;transition: border-color 0.15s;}- .avatar-modal-sale input[type="number"]:focus,- .avatar-modal-sale input[type="text"]:focus {+ .avatar-modal-sale input[type='number']:focus,+ .avatar-modal-sale input[type='text']:focus {border-color: #ffffff;}.avatar-modal-sale .sale-row {@@ -1128,7 +1195,9 @@gap: 8px;align-items: flex-end;}- .avatar-modal-sale .sale-row label { flex: 1; }+ .avatar-modal-sale .sale-row label {+ flex: 1;+ }.avatar-modal-sale .sale-row .sale-currency {background: #1a1a1a;border: 1px solid #2a2a2a;@@ -1173,15 +1242,24 @@color: #a1a1aa;min-height: 14px;}- .avatar-modal-sale .sale-status.ok { color: #ffffff; }- .avatar-modal-sale .sale-status.err { color: #f43f5e; }+ .avatar-modal-sale .sale-status.ok {+ color: #ffffff;+ }+ .avatar-modal-sale .sale-status.err {+ color: #f43f5e;+ }.avatar-modal-sale .sale-hint {font-size: 11px;color: #71717a;line-height: 1.5;}- .avatar-modal-sale .sale-hint a { color: #ffffff; text-decoration: none; }- .avatar-modal-sale .sale-hint a:hover { text-decoration: underline; }+ .avatar-modal-sale .sale-hint a {+ color: #ffffff;+ text-decoration: none;+ }+ .avatar-modal-sale .sale-hint a:hover {+ text-decoration: underline;+ }.avatar-modal-actions button,.avatar-modal-actions a {width: 100%;@@ -1194,7 +1272,9 @@text-align: center;text-decoration: none;display: block;- transition: transform 0.15s ease, background 0.15s ease;+ transition:+ transform 0.15s ease,+ background 0.15s ease;}.avatar-modal-actions .btn-primary {background: #fafafa;@@ -1474,7 +1554,9 @@flex-direction: column;gap: 10px;cursor: pointer;- transition: border-color 0.15s ease, transform 0.15s ease;+ transition:+ border-color 0.15s ease,+ transform 0.15s ease;}.market-skill-card:hover {border-color: var(--stroke-strong);@@ -1487,7 +1569,9 @@transform: translateY(-1px);}/* "Details →" affordance — dim at rest, resolves on card hover/focus */- .market-skill-card .skill-foot { justify-content: space-between; }+ .market-skill-card .skill-foot {+ justify-content: space-between;+ }.market-skill-card .open-cta {color: #fafafa;font-weight: 500;@@ -1499,9 +1583,13 @@transition: transform 0.15s ease;}.market-skill-card:hover .open-cta,- .market-skill-card:focus-visible .open-cta { opacity: 1; }+ .market-skill-card:focus-visible .open-cta {+ opacity: 1;+ }.market-skill-card:hover .open-cta-arrow,- .market-skill-card:focus-visible .open-cta-arrow { transform: translateX(2px); }+ .market-skill-card:focus-visible .open-cta-arrow {+ transform: translateX(2px);+ }.market-skill-card .skill-head {display: flex;justify-content: space-between;@@ -1601,7 +1689,9 @@font-weight: 500;font-size: 13px;cursor: pointer;- transition: background 0.15s ease, border-color 0.15s ease;+ transition:+ background 0.15s ease,+ border-color 0.15s ease;font-family: inherit;}.market-empty-cta-btn:hover {@@ -1710,8 +1800,12 @@text-align: center;min-height: 1.2em;}- .payment-status.ok { color: #86efac; }- .payment-status.err { color: #fca5a5; }+ .payment-status.ok {+ color: #86efac;+ }+ .payment-status.err {+ color: #fca5a5;+ }.payment-qr {display: flex;@@ -1720,14 +1814,21 @@gap: 8px;margin-top: 14px;}- .payment-qr:empty { display: none; }+ .payment-qr:empty {+ display: none;+ }.payment-qr canvas {background: #fff;border-radius: 8px;padding: 8px;}- .payment-qr .muted { color: #9ca3af; }- .payment-qr .small { font-size: 11px; text-align: center; }+ .payment-qr .muted {+ color: #9ca3af;+ }+ .payment-qr .small {+ font-size: 11px;+ text-align: center;+ }.payment-chain-picker {display: flex;@@ -1745,7 +1846,9 @@cursor: pointer;transition: all 0.15s;}- .payment-chain-pill:hover { border-color: #404040; }+ .payment-chain-pill:hover {+ border-color: #404040;+ }.payment-chain-pill.active {background: #ffffff;border-color: #ffffff;@@ -1760,7 +1863,7 @@.payment-modal-badge {margin: -6px 0 14px;padding: 8px 12px;- background: rgba(255, 255, 255, 0.10);+ background: rgba(255, 255, 255, 0.1);border: 1px solid rgba(255, 255, 255, 0.32);border-radius: 8px;font-size: 12px;@@ -1779,7 +1882,7 @@}.payment-modal-badge.warn {background: rgba(253, 224, 71, 0.08);- border-color: rgba(253, 224, 71, 0.30);+ border-color: rgba(253, 224, 71, 0.3);color: #fde68a;}@@ -1799,7 +1902,7 @@height: 56px;border-radius: 50%;background: rgba(134, 239, 172, 0.16);- border: 1px solid rgba(134, 239, 172, 0.40);+ border: 1px solid rgba(134, 239, 172, 0.4);color: #86efac;display: flex;align-items: center;@@ -1842,7 +1945,9 @@background: #ffffff;color: #fff;}- .payment-modal-success .ps-actions .btn-primary:hover { background: #4f46e5; }+ .payment-modal-success .ps-actions .btn-primary:hover {+ background: #4f46e5;+ }.payment-modal-success .ps-actions .btn-secondary {background: transparent;color: rgba(255, 255, 255, 0.78);@@ -1879,7 +1984,9 @@color: rgba(255, 255, 255, 0.55);word-break: break-all;}- .payment-modal-retry .retry-tx a { color: #93c5fd; }+ .payment-modal-retry .retry-tx a {+ color: #93c5fd;+ }.payment-modal-retry .retry-actions {display: flex;gap: 8px;@@ -1930,15 +2037,23 @@/* ── Card entry animations ────────────────────────────────────── */@keyframes mk-card-in {- from { opacity: 0; transform: translateY(14px); }- to { opacity: 1; transform: translateY(0); }+ from {+ opacity: 0;+ transform: translateY(14px);+ }+ to {+ opacity: 1;+ transform: translateY(0);+ }}.mk-card-enter {animation: mk-card-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;animation-delay: var(--card-delay, 0s);}@media (prefers-reduced-motion: reduce) {- .mk-card-enter { animation: none; }+ .mk-card-enter {+ animation: none;+ }}/* ── Animations tab ───────────────────────────────────────────── */@@ -1954,7 +2069,10 @@align-items: center;gap: 12px;cursor: pointer;- transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;+ transition:+ border-color 0.15s ease,+ transform 0.15s ease,+ box-shadow 0.15s ease;}.market-anim-card:hover {border-color: rgba(255, 255, 255, 0.18);@@ -2032,16 +2150,33 @@/* Animation detail page stage */.anim-detail-stage {position: relative;- background: radial-gradient(circle at 50% 60%, rgba(255,255,255,0.05), transparent 70%), linear-gradient(180deg, #050505, #0a0a0a);+ background:+ radial-gradient(circle at 50% 60%, rgba(255, 255, 255, 0.05), transparent 70%),+ linear-gradient(180deg, #050505, #0a0a0a);border: 1px solid var(--stroke);border-radius: 18px;min-height: 420px;overflow: hidden;margin: 8px 0 4px;}- .anim-detail-stage agent-3d { width: 100%; height: 100%; display: block; }- .anim-detail-stage-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }- @media (max-width: 600px) { .anim-detail-stage { min-height: 300px; } }+ .anim-detail-stage agent-3d {+ width: 100%;+ height: 100%;+ display: block;+ }+ .anim-detail-stage-load {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: center;+ justify-content: center;+ pointer-events: none;+ }+ @media (max-width: 600px) {+ .anim-detail-stage {+ min-height: 300px;+ }+ }/* ── Memory tab ───────────────────────────────────────────────── */.market-memory-body {@@ -2055,13 +2190,22 @@gap: 24px;align-items: flex-start;padding: 28px;- background: radial-gradient(ellipse at top right, rgba(255,255,255,0.05), transparent 60%), linear-gradient(180deg, #0e0e0e, #0a0a0a);+ background:+ radial-gradient(+ ellipse at top right,+ rgba(255, 255, 255, 0.05),+ transparent 60%+ ),+ linear-gradient(180deg, #0e0e0e, #0a0a0a);border: 1px solid #1f1f1f;border-radius: 18px;margin-top: 4px;flex-wrap: wrap;}- .memory-intro-text { flex: 1; min-width: 280px; }+ .memory-intro-text {+ flex: 1;+ min-width: 280px;+ }.memory-intro-title {font-family: var(--font-display);font-size: 24px;@@ -2089,12 +2233,14 @@font-weight: 600;font-size: 13px;text-decoration: none;- transition: transform 0.15s ease, box-shadow 0.15s ease;+ transition:+ transform 0.15s ease,+ box-shadow 0.15s ease;white-space: nowrap;}.market-memory-cta-btn:hover {transform: translateY(-1px);- box-shadow: 0 8px 20px rgba(255,255,255,0.08);+ box-shadow: 0 8px 20px rgba(255, 255, 255, 0.08);}.market-memory-section-title {font-family: var(--font-display);@@ -2117,10 +2263,12 @@padding: 20px;display: flex;gap: 14px;- transition: border-color 0.15s ease, transform 0.15s ease;+ transition:+ border-color 0.15s ease,+ transform 0.15s ease;}.market-memory-type-card:hover {- border-color: rgba(255,255,255,0.15);+ border-color: rgba(255, 255, 255, 0.15);transform: translateY(-2px);}.memory-type-icon {@@ -2132,10 +2280,13 @@display: flex;align-items: center;justify-content: center;- background: rgba(255,255,255,0.05);+ background: rgba(255, 255, 255, 0.05);border-radius: 12px;}- .memory-type-body { min-width: 0; flex: 1; }+ .memory-type-body {+ min-width: 0;+ flex: 1;+ }.memory-type-title {font-size: 14px;font-weight: 700;@@ -2164,17 +2315,25 @@line-height: 1.4;margin: 0;padding: 8px 10px;- background: rgba(255,255,255,0.03);- border: 1px solid rgba(255,255,255,0.06);+ background: rgba(255, 255, 255, 0.03);+ border: 1px solid rgba(255, 255, 255, 0.06);border-radius: 8px;- border-left: 3px solid rgba(255,255,255,0.18);+ border-left: 3px solid rgba(255, 255, 255, 0.18);}/* Memory type accent colors */- .market-memory-type-card[data-memory-type="user"] .memory-type-icon { background: rgba(59,130,246,0.1); }- .market-memory-type-card[data-memory-type="feedback"] .memory-type-icon { background: rgba(234,179,8,0.1); }- .market-memory-type-card[data-memory-type="project"] .memory-type-icon { background: rgba(34,197,94,0.1); }- .market-memory-type-card[data-memory-type="reference"] .memory-type-icon { background: rgba(255,255,255,0.06); }+ .market-memory-type-card[data-memory-type='user'] .memory-type-icon {+ background: rgba(59, 130, 246, 0.1);+ }+ .market-memory-type-card[data-memory-type='feedback'] .memory-type-icon {+ background: rgba(234, 179, 8, 0.1);+ }+ .market-memory-type-card[data-memory-type='project'] .memory-type-icon {+ background: rgba(34, 197, 94, 0.1);+ }+ .market-memory-type-card[data-memory-type='reference'] .memory-type-icon {+ background: rgba(255, 255, 255, 0.06);+ }/* How memory works section */.market-memory-how {@@ -2198,12 +2357,14 @@background: var(--surface-1);transition: background 0.15s ease;}- .memory-step:hover { background: #141414; }+ .memory-step:hover {+ background: #141414;+ }.memory-step-num {width: 28px;height: 28px;border-radius: 50%;- background: rgba(255,255,255,0.08);+ background: rgba(255, 255, 255, 0.08);color: #a1a1aa;font-family: var(--font-display);font-weight: 700;@@ -2219,7 +2380,10 @@line-height: 1.55;padding-top: 3px;}- .memory-step-text strong { color: #fafafa; font-weight: 600; }+ .memory-step-text strong {+ color: #fafafa;+ font-weight: 600;+ }/* Memory live feed */.market-memory-live {@@ -2252,7 +2416,10 @@font-size: 14px;flex-shrink: 0;}- .memory-feed-body { min-width: 0; flex: 1; }+ .memory-feed-body {+ min-width: 0;+ flex: 1;+ }.memory-feed-type {font-size: 10px;font-weight: 700;@@ -2273,7 +2440,7 @@font-size: 13px;}.market-memory-live-cta {- background: rgba(255,255,255,0.04);+ background: rgba(255, 255, 255, 0.04);border: 1px solid #2a2a2a;border-radius: 10px;padding: 16px 20px;@@ -2281,8 +2448,13 @@color: #a1a1aa;font-size: 13px;}- .market-memory-live-cta a { color: #ffffff; text-decoration: none; }- .market-memory-live-cta a:hover { text-decoration: underline; }+ .market-memory-live-cta a {+ color: #ffffff;+ text-decoration: none;+ }+ .market-memory-live-cta a:hover {+ text-decoration: underline;+ }</style><meta property="og:type" content="website" /><meta property="og:title" content="Agent Marketplace · three.ws" />@@ -2294,19 +2466,36 @@<meta property="og:image" content="https://three.ws/og-image.png" /><meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="Agent Marketplace · three.ws" />- <meta name="twitter:description" content="Discover, fork, and chat with community-published AI agents." />+ <meta+ name="twitter:description"+ content="Discover, fork, and chat with community-published AI agents."+ /><meta name="twitter:image" content="https://three.ws/og-image.png" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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><script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/footer.css" />- <link rel="stylesheet" href="/mobile.css" />- <script defer src="/footer-newsletter.js"></script>-- <meta property="og:site_name" content="three.ws">- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Marketplace","description":"Buy access to agents, skills, and avatars from other creators.","url":"https://three.ws/marketplace","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/footer.css" />+ <link rel="stylesheet" href="/mobile.css" />+ <script defer src="/footer-newsletter.js"></script>++ <meta property="og:site_name" content="three.ws" />+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Marketplace",+ "description": "Buy access to agents, skills, and avatars from other creators.",+ "url": "https://three.ws/marketplace",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head><body class="market-page"><header><div id="nav-container"></div></header><script src="/nav.js"></script>@@ -2318,18 +2507,42 @@</a><nav class="market-nav"><a href="/" data-nav="home"><span class="ico">⌂</span> <span>Home</span></a>- <a href="/marketplace" data-nav="agent" class="active"><span class="ico">▣</span> <span>Agent</span><span class="nav-count" id="nav-count-agent" hidden></span></a>- <a href="/marketplace?tab=avatars" data-nav="avatars"><span class="ico">◉</span> <span>Avatars</span><span class="nav-count hot" id="nav-count-avatar" hidden></span></a>- <a href="/marketplace?tab=tools" data-nav="tools"><span class="ico">⚙</span> <span>Tools</span></a>- <a href="/marketplace?tab=skills" data-nav="skills"><span class="ico">≡</span> <span>Skills</span></a>- <a href="/create/studio" data-nav="studio"><span class="ico">◆</span> <span>Studio</span></a>- <a href="/marketplace?tab=mine" data-nav="mine"><span class="ico">◱</span> <span>My Agents</span></a>- <a href="/marketplace?tab=purchases" data-nav="purchases"><span class="ico">✓</span> <span>My Purchases</span></a>- <a href="/marketplace?tab=earn" data-nav="earn"><span class="ico">$</span> <span>Earn</span></a>- <a href="/marketplace?tab=animations" data-nav="animations"><span class="ico">▶</span> <span>Animations</span></a>- <a href="/marketplace?tab=memory" data-nav="memory"><span class="ico">◎</span> <span>Memory</span></a>+ <a href="/marketplace" data-nav="agent" class="active"+ ><span class="ico">▣</span> <span>Agent</span+ ><span class="nav-count" id="nav-count-agent" hidden></span+ ></a>+ <a href="/marketplace?tab=avatars" data-nav="avatars"+ ><span class="ico">◉</span> <span>Avatars</span+ ><span class="nav-count hot" id="nav-count-avatar" hidden></span+ ></a>+ <a href="/marketplace?tab=tools" data-nav="tools"+ ><span class="ico">⚙</span> <span>Tools</span></a+ >+ <a href="/marketplace?tab=skills" data-nav="skills"+ ><span class="ico">≡</span> <span>Skills</span></a+ >+ <a href="/create/studio" data-nav="studio"+ ><span class="ico">◆</span> <span>Studio</span></a+ >+ <a href="/marketplace?tab=mine" data-nav="mine"+ ><span class="ico">◱</span> <span>My Agents</span></a+ >+ <a href="/marketplace?tab=purchases" data-nav="purchases"+ ><span class="ico">✓</span> <span>My Purchases</span></a+ >+ <a href="/marketplace?tab=earn" data-nav="earn"+ ><span class="ico">$</span> <span>Earn</span></a+ >+ <a href="/marketplace?tab=animations" data-nav="animations"+ ><span class="ico">▶</span> <span>Animations</span></a+ >+ <a href="/marketplace?tab=memory" data-nav="memory"+ ><span class="ico">◎</span> <span>Memory</span></a+ ></nav>- <button class="market-submit-btn market-sidebar-submit" id="market-submit-btn">+ Submit Agent</button>+ <button class="market-submit-btn market-sidebar-submit" id="market-submit-btn">+ + Submit Agent+ </button></aside><main class="market-main" id="market-main">@@ -2346,38 +2559,76 @@<span class="market-theme-eyebrow">This week</span><strong class="market-theme-title" id="market-theme-title">—</strong><span class="market-theme-blurb" id="market-theme-blurb">—</span>- <button class="market-theme-cta" id="market-theme-cta" hidden>Browse →</button>+ <button class="market-theme-cta" id="market-theme-cta" hidden>+ Browse →+ </button></div>- <div class="market-theme-picks" id="market-theme-picks" role="list" aria-label="Top picks this week" hidden></div>+ <div+ class="market-theme-picks"+ id="market-theme-picks"+ role="list"+ aria-label="Top picks this week"+ hidden+ ></div></aside><!-- Live 3D hero carousel -->- <section class="market-hero" id="market-hero" hidden aria-label="Featured 3D avatars">+ <section+ class="market-hero"+ id="market-hero"+ hidden+ aria-label="Featured 3D avatars"+ ><div class="market-hero-stage" id="market-hero-stage"></div><div class="market-hero-meta"><div class="market-hero-eyebrow">Featured · Community Avatars- <span class="market-hero-beta-pill" aria-label="Marketplace is in beta">BETA</span>+ <span class="market-hero-beta-pill" aria-label="Marketplace is in beta"+ >BETA</span+ ></div><h2 class="market-hero-title" id="market-hero-title">—</h2><p class="market-hero-desc" id="market-hero-desc">—</p><div class="market-hero-actions">- <button class="market-hero-cta" id="market-hero-view">View in 3D →</button>- <button class="market-hero-secondary" id="market-hero-lobby">Open 3D Lobby</button>- <button class="market-hero-secondary" id="market-hero-fork" hidden>Fork agent</button>+ <button class="market-hero-cta" id="market-hero-view">+ View in 3D →+ </button>+ <button class="market-hero-secondary" id="market-hero-lobby">+ Open 3D Lobby+ </button>+ <button class="market-hero-secondary" id="market-hero-fork" hidden>+ Fork agent+ </button></div><div class="market-hero-dots" id="market-hero-dots"></div></div></section><!-- Three.js multi-avatar lobby (opt-in fullscreen overlay). -->- <div class="market-lobby-overlay" id="market-lobby-overlay" hidden aria-modal="true" role="dialog" aria-label="3D Lobby">- <button class="market-lobby-close" id="market-lobby-close" aria-label="Close lobby">×</button>+ <div+ class="market-lobby-overlay"+ id="market-lobby-overlay"+ hidden+ aria-modal="true"+ role="dialog"+ aria-label="3D Lobby"+ >+ <button+ class="market-lobby-close"+ id="market-lobby-close"+ aria-label="Close lobby"+ >+ ×+ </button><canvas class="market-lobby-canvas" id="market-lobby-canvas"></canvas>- <div class="market-lobby-hint">Move your mouse · Click an avatar to inspect</div>+ <div class="market-lobby-hint">+ Move your mouse · Click an avatar to inspect+ </div></div><header class="market-topbar">- <label class="market-visually-hidden" for="market-search">Search agents and avatars</label>+ <label class="market-visually-hidden" for="market-search"+ >Search agents and avatars</label+ ><inputid="market-search"type="search"@@ -2385,29 +2636,100 @@autocomplete="off"aria-label="Search agents and avatars"/>- <div class="market-filter-chips" id="market-filter-chips" role="tablist" aria-label="Filter agents and avatars">- <button class="market-chip active" data-filter="all" role="tab" aria-selected="true">All</button>- <button class="market-chip" data-filter="agents" role="tab" aria-selected="false">Agents</button>- <button class="market-chip" data-filter="avatars" role="tab" aria-selected="false">Avatars</button>- <button class="market-chip" data-filter="onchain" role="tab" aria-selected="false" title="ERC-8004 agents indexed onchain across Base, Polygon, and Solana" aria-label="Onchain — ERC-8004 agents indexed across all supported chains">Onchain <span class="chip-count" id="chip-count-onchain"></span></button>+ <div+ class="market-filter-chips"+ id="market-filter-chips"+ role="tablist"+ aria-label="Filter agents and avatars"+ >+ <button+ class="market-chip active"+ data-filter="all"+ role="tab"+ aria-selected="true"+ >+ All+ </button>+ <button+ class="market-chip"+ data-filter="agents"+ role="tab"+ aria-selected="false"+ >+ Agents+ </button>+ <button+ class="market-chip"+ data-filter="avatars"+ role="tab"+ aria-selected="false"+ >+ Avatars+ </button>+ <button+ class="market-chip"+ data-filter="onchain"+ role="tab"+ aria-selected="false"+ title="ERC-8004 agents indexed onchain across Base, Polygon, and Solana"+ aria-label="Onchain — ERC-8004 agents indexed across all supported chains"+ >+ Onchain <span class="chip-count" id="chip-count-onchain"></span>+ </button></div>- <div class="market-filter-chips" id="market-price-filter-chips" role="group" aria-label="Filter by price">+ <div+ class="market-filter-chips"+ id="market-price-filter-chips"+ role="group"+ aria-label="Filter by price"+ ><button class="market-chip active" data-price-filter="all">Any</button>- <button class="market-chip" data-price-filter="free" title="Show only free listings">Free</button>- <button class="market-chip" data-price-filter="paid" title="Show only paid listings">Paid</button>+ <button+ class="market-chip"+ data-price-filter="free"+ title="Show only free listings"+ >+ Free+ </button>+ <button+ class="market-chip"+ data-price-filter="paid"+ title="Show only paid listings"+ >+ Paid+ </button></div>- <label class="market-visually-hidden" for="market-sort">Sort marketplace results</label>- <select id="market-sort" class="market-sort" aria-label="Sort marketplace results">+ <label class="market-visually-hidden" for="market-sort"+ >Sort marketplace results</label+ >+ <select+ id="market-sort"+ class="market-sort"+ aria-label="Sort marketplace results"+ ><option value="recommended">Recommended</option><option value="recent">Recent</option><option value="popular">Popular</option><option value="top_rated">Top Rated</option></select>- <a class="market-submit-avatar-btn" href="/create" id="market-submit-avatar-btn">+ Create Avatar</a>+ <a class="market-submit-avatar-btn" href="/create" id="market-submit-avatar-btn"+ >+ Create Avatar</a+ ></header>- <div id="market-result-count" class="market-visually-hidden" role="status" aria-live="polite" aria-atomic="true"></div>+ <div+ id="market-result-count"+ class="market-visually-hidden"+ role="status"+ aria-live="polite"+ aria-atomic="true"+ ></div>- <div class="market-cat-chips" id="market-cat-chips" role="navigation" aria-label="Categories"></div>+ <div+ class="market-cat-chips"+ id="market-cat-chips"+ role="navigation"+ aria-label="Categories"+ ></div><div class="market-tag-banner" id="market-tag-banner" role="status" hidden></div>@@ -2424,7 +2746,13 @@<!-- Loading / not-found / error state, overlaid on the detail content.Shown when a deep-linked agent is missing, unpublished, private,or fails to load. Replaces the old dead-end "Agent not found". -->- <div class="market-detail-state" id="d-state" role="alert" aria-live="polite" hidden>+ <div+ class="market-detail-state"+ id="d-state"+ role="alert"+ aria-live="polite"+ hidden+ ><div class="market-detail-state-inner"><div class="md-state-icon" id="d-state-icon" aria-hidden="true">◍</div><h2 class="md-state-title" id="d-state-title">Loading agent…</h2>@@ -2434,7 +2762,9 @@</div><div class="market-detail-head">- <div class="market-detail-avatar" id="d-avatar"><span class="d-avatar-fallback">▣</span></div>+ <div class="market-detail-avatar" id="d-avatar">+ <span class="d-avatar-fallback">▣</span>+ </div><div class="market-detail-meta"><h1 id="d-name">—</h1><div class="market-detail-author">@@ -2472,35 +2802,109 @@</div><!-- Ratings & reviews -->- <section class="d-rating-widget" id="d-rating-widget" aria-label="Ratings and reviews">+ <section+ class="d-rating-widget"+ id="d-rating-widget"+ aria-label="Ratings and reviews"+ ><div class="d-rating-summary" id="d-rating-summary"><span class="avg" id="d-rating-avg">—</span><span class="stars" id="d-rating-stars">☆☆☆☆☆</span><span class="count" id="d-rating-count">No reviews yet</span></div><div class="d-rating-input" id="d-rating-input" hidden>- <span style="font-size:12px;color:var(--ink-dim)">Your rating:</span>- <span class="stars" id="d-rating-pick" role="radiogroup" aria-label="Pick a rating">- <button type="button" class="star-pick" data-rating="1" aria-label="1 star">☆</button>- <button type="button" class="star-pick" data-rating="2" aria-label="2 stars">☆</button>- <button type="button" class="star-pick" data-rating="3" aria-label="3 stars">☆</button>- <button type="button" class="star-pick" data-rating="4" aria-label="4 stars">☆</button>- <button type="button" class="star-pick" data-rating="5" aria-label="5 stars">☆</button>+ <span style="font-size: 12px; color: var(--ink-dim)"+ >Your rating:</span+ >+ <span+ class="stars"+ id="d-rating-pick"+ role="radiogroup"+ aria-label="Pick a rating"+ >+ <button+ type="button"+ class="star-pick"+ data-rating="1"+ aria-label="1 star"+ >+ ☆+ </button>+ <button+ type="button"+ class="star-pick"+ data-rating="2"+ aria-label="2 stars"+ >+ ☆+ </button>+ <button+ type="button"+ class="star-pick"+ data-rating="3"+ aria-label="3 stars"+ >+ ☆+ </button>+ <button+ type="button"+ class="star-pick"+ data-rating="4"+ aria-label="4 stars"+ >+ ☆+ </button>+ <button+ type="button"+ class="star-pick"+ data-rating="5"+ aria-label="5 stars"+ >+ ☆+ </button></span>- <textarea id="d-review-body" placeholder="Write a short review (optional)" maxlength="2000"></textarea>- <button type="button" class="submit-review" id="d-review-submit" disabled>Submit review</button>+ <textarea+ id="d-review-body"+ placeholder="Write a short review (optional)"+ maxlength="2000"+ ></textarea>+ <button+ type="button"+ class="submit-review"+ id="d-review-submit"+ disabled+ >+ Submit review+ </button></div>- <div class="d-rating-msg" id="d-rating-msg" role="status" aria-live="polite"></div>+ <div+ class="d-rating-msg"+ id="d-rating-msg"+ role="status"+ aria-live="polite"+ ></div><div class="d-reviews-list" id="d-reviews-list"></div></section><div class="market-preview-card" id="d-preview-card"><div class="market-preview-head">- <h2 class="market-section-title" style="margin:0">Try it now</h2>- <span class="market-preview-hint">Send a message — no fork required</span>+ <h2 class="market-section-title" style="margin: 0">+ Try it now+ </h2>+ <span class="market-preview-hint"+ >Send a message — no fork required</span+ ></div>- <div class="market-preview-thread" id="d-preview-thread" aria-live="polite"></div>- <form class="market-preview-form" id="d-preview-form" autocomplete="off">+ <div+ class="market-preview-thread"+ id="d-preview-thread"+ aria-live="polite"+ ></div>+ <form+ class="market-preview-form"+ id="d-preview-form"+ autocomplete="off"+ ><inputtype="text"id="d-preview-input"@@ -2509,7 +2913,13 @@maxlength="2000"required/>- <button type="submit" class="market-preview-send" id="d-preview-send">Send</button>+ <button+ type="submit"+ class="market-preview-send"+ id="d-preview-send"+ >+ Send+ </button></form><div class="market-preview-footer" id="d-preview-footer"></div></div>@@ -2523,7 +2933,9 @@</div><div data-panel="capabilities" class="market-panel">- <h2>Built-in Skills <span class="muted" id="d-skills-count">0</span></h2>+ <h2>+ Built-in Skills <span class="muted" id="d-skills-count">0</span>+ </h2><div id="d-skills" class="market-skills"></div><h2>Library <span class="muted" id="d-library-count">0</span></h2><div id="d-library" class="market-library"></div>@@ -2531,7 +2943,13 @@<div data-panel="embed" class="market-panel"><h2>Embed this Agent</h2>- <p class="market-prose" style="font-size:13px;color:var(--ink-dim);margin:0 0 18px">Drop the agent anywhere — as a web component, iframe, or direct link.</p>+ <p+ class="market-prose"+ style="font-size: 13px; color: var(--ink-dim); margin: 0 0 18px"+ >+ Drop the agent anywhere — as a web component, iframe, or direct+ link.+ </p><div class="d-embed-section"><div class="d-embed-label"><span>Web component</span>@@ -2573,8 +2991,20 @@<div class="d-token-eyebrow">On-chain token</div><div class="d-token-mint" id="d-token-mint"></div><div class="d-token-actions">- <a class="d-token-btn" id="d-token-pump" target="_blank" rel="noopener">View on pump.fun</a>- <a class="d-token-btn d-token-btn-sec" id="d-token-jup" target="_blank" rel="noopener">Trade on Jupiter</a>+ <a+ class="d-token-btn"+ id="d-token-pump"+ target="_blank"+ rel="noopener"+ >View on pump.fun</a+ >+ <a+ class="d-token-btn d-token-btn-sec"+ id="d-token-jup"+ target="_blank"+ rel="noopener"+ >Trade on Jupiter</a+ ></div></div><div class="d-reputation-card" id="d-reputation-card" hidden>@@ -2622,9 +3052,13 @@<header class="market-topbar"><div class="market-mine-head"><h2 class="market-section-heading">Earn</h2>- <span class="market-mine-sub" id="earn-subtitle">Revenue from your published agents and skills</span>+ <span class="market-mine-sub" id="earn-subtitle"+ >Revenue from your published agents and skills</span+ ></div>- <button class="market-submit-btn" id="earn-publish-skill-btn">+ Publish Skill</button>+ <button class="market-submit-btn" id="earn-publish-skill-btn">+ + Publish Skill+ </button></header><div class="earn-body"><div id="earn-content"></div>@@ -2636,19 +3070,27 @@<header class="market-topbar"><div class="market-mine-head"><h2 class="market-section-heading">Skills Marketplace</h2>- <span class="market-mine-sub" id="skills-subtitle">Browse capabilities you can unlock or fork</span>+ <span class="market-mine-sub" id="skills-subtitle"+ >Browse capabilities you can unlock or fork</span+ ></div><inputid="skills-search"type="search"placeholder="Search skills…"autocomplete="off"- style="flex:1;max-width:320px"+ style="flex: 1; max-width: 320px"/><div class="market-filter-chips" role="tablist" aria-label="Skill filter">- <button class="market-chip active" data-skill-filter="all" role="tab">All</button>- <button class="market-chip" data-skill-filter="free" role="tab">Free</button>- <button class="market-chip" data-skill-filter="paid" role="tab">Paid</button>+ <button class="market-chip active" data-skill-filter="all" role="tab">+ All+ </button>+ <button class="market-chip" data-skill-filter="free" role="tab">+ Free+ </button>+ <button class="market-chip" data-skill-filter="paid" role="tab">+ Paid+ </button></div><select id="skills-sort" class="market-sort" aria-label="Sort skills"><option value="popular">Popular</option>@@ -2657,7 +3099,12 @@</select></header><div class="market-skills-tab">- <div class="market-cat-chips" id="skills-cat-chips" role="navigation" aria-label="Skill categories"></div>+ <div+ class="market-cat-chips"+ id="skills-cat-chips"+ role="navigation"+ aria-label="Skill categories"+ ></div><div class="market-grid" id="skills-grid"><div class="market-empty">Loading skills…</div></div>@@ -2682,8 +3129,12 @@/></header><div class="market-body">- <aside class="market-cats" id="plugin-cats" aria-label="Plugin Categories"></aside>- <div style="flex:1;min-width:0">+ <aside+ class="market-cats"+ id="plugin-cats"+ aria-label="Plugin Categories"+ ></aside>+ <div style="flex: 1; min-width: 0"><div class="plugin-grid" id="plugin-grid"><div class="market-empty">Loading…</div></div>@@ -2695,11 +3146,18 @@</section><!-- Add by URL modal -->- <div class="plugin-modal-overlay" id="plugin-url-modal" hidden aria-modal="true" role="dialog">+ <div+ class="plugin-modal-overlay"+ id="plugin-url-modal"+ hidden+ aria-modal="true"+ role="dialog"+ ><div class="plugin-modal"><h3>Add Plugin by URL</h3><p class="plugin-modal-hint">- Paste the URL of a hosted <code>plugin/1.0</code> JSON manifest to add a custom plugin.+ Paste the URL of a hosted <code>plugin/1.0</code> JSON manifest to add a+ custom plugin.</p><inputtype="url"@@ -2712,29 +3170,54 @@<div class="plugin-modal-preview" id="plugin-url-preview" hidden></div><div class="plugin-modal-actions"><button id="plugin-url-cancel" class="plugin-modal-btn">Cancel</button>- <button id="plugin-url-fetch" class="plugin-modal-btn plugin-modal-btn-primary">Fetch & Validate</button>+ <button+ id="plugin-url-fetch"+ class="plugin-modal-btn plugin-modal-btn-primary"+ >+ Fetch & Validate+ </button></div></div></div><!-- Avatar deep-link detail page — mirrors market-detail for agents -->- <section class="market-avatar-detail" id="market-avatar-detail" hidden aria-label="Avatar detail">+ <section+ class="market-avatar-detail"+ id="market-avatar-detail"+ hidden+ aria-label="Avatar detail"+ ><div class="market-avatar-detail-inner">- <button class="market-back" id="avatar-detail-back" aria-label="Back to marketplace">←</button>+ <button+ class="market-back"+ id="avatar-detail-back"+ aria-label="Back to marketplace"+ >+ ←+ </button><div class="market-avatar-detail-layout"><!-- Left: interactive 3D stage --><div class="market-avatar-detail-stage" id="avatar-detail-stage"><div class="avatar-detail-load-wrap" id="avatar-detail-load-wrap"><div class="avatar-detail-load-bar-outer">- <div class="avatar-detail-load-bar" id="avatar-detail-load-bar"></div>+ <div+ class="avatar-detail-load-bar"+ id="avatar-detail-load-bar"+ ></div></div><span class="avatar-detail-load-label">Loading 3D…</span></div><div class="avatar-detail-empty" id="avatar-detail-empty" hidden><span class="avatar-detail-empty-glyph" aria-hidden="true">◌</span><h2 class="avatar-detail-empty-title">Avatar not found</h2>- <p class="avatar-detail-empty-msg">This avatar may have been removed or the link is wrong.</p>- <a class="btn-secondary avatar-detail-empty-cta" href="/marketplace?tab=avatars">Browse avatars</a>+ <p class="avatar-detail-empty-msg">+ This avatar may have been removed or the link is wrong.+ </p>+ <a+ class="btn-secondary avatar-detail-empty-cta"+ href="/marketplace?tab=avatars"+ >Browse avatars</a+ ></div></div><!-- Right: meta + actions -->@@ -2745,32 +3228,56 @@<p class="market-avatar-detail-desc" id="avatar-detail-desc"></p><div class="market-avatar-detail-pills" id="avatar-detail-pills"></div><div class="market-avatar-detail-actions">- <button class="btn-primary market-avatar-detail-cta" id="avatar-detail-use">+ <button+ class="btn-primary market-avatar-detail-cta"+ id="avatar-detail-use"+ >Start agent with this avatar →</button>- <a class="btn-secondary" id="avatar-detail-view" href="#" target="_blank" rel="noopener">+ <a+ class="btn-secondary"+ id="avatar-detail-view"+ href="#"+ target="_blank"+ rel="noopener"+ >Open in 3D viewer ↗</a><a class="btn-secondary" id="avatar-detail-download" href="#">Download GLB</a>- <button type="button" class="btn-secondary" id="avatar-detail-share">+ <button+ type="button"+ class="btn-secondary"+ id="avatar-detail-share"+ >Share</button></div></aside></div><!-- Similar avatars grid -->- <div class="market-avatar-detail-similar" id="avatar-detail-similar-wrap" hidden>+ <div+ class="market-avatar-detail-similar"+ id="avatar-detail-similar-wrap"+ hidden+ ><h2 class="market-section-heading">Similar avatars</h2><div class="market-grid" id="avatar-detail-similar-grid"></div></div></div></section><!-- Tool/plugin deep-link detail page — mirrors avatar detail for plugins -->- <section class="market-tool-detail" id="market-tool-detail" hidden aria-label="Plugin detail">+ <section+ class="market-tool-detail"+ id="market-tool-detail"+ hidden+ aria-label="Plugin detail"+ ><div class="market-tool-detail-inner">- <button class="market-back" id="tool-detail-back" aria-label="Back to plugins">←</button>+ <button class="market-back" id="tool-detail-back" aria-label="Back to plugins">+ ←+ </button><!-- Loading skeleton --><div class="tool-detail-skeleton" id="tool-detail-skeleton">@@ -2791,16 +3298,24 @@<div class="tool-detail-empty" id="tool-detail-empty" hidden><span class="tool-detail-empty-glyph" aria-hidden="true">◌</span><h2 class="tool-detail-empty-title">Plugin not found</h2>- <p class="tool-detail-empty-msg">This plugin may have been removed or the link is wrong.</p>- <a class="btn-secondary tool-detail-empty-cta" href="/marketplace?tab=tools">Browse plugins</a>+ <p class="tool-detail-empty-msg">+ This plugin may have been removed or the link is wrong.+ </p>+ <a class="btn-secondary tool-detail-empty-cta" href="/marketplace?tab=tools"+ >Browse plugins</a+ ></div><!-- Loaded content --><div class="tool-detail-body" id="tool-detail-body" hidden><header class="tool-detail-hero">- <div class="tool-detail-icon" id="tool-detail-icon" aria-hidden="true">?</div>+ <div class="tool-detail-icon" id="tool-detail-icon" aria-hidden="true">+ ?+ </div><div class="tool-detail-hero-text">- <div class="market-detail-eyebrow" id="tool-detail-eyebrow">Plugin</div>+ <div class="market-detail-eyebrow" id="tool-detail-eyebrow">+ Plugin+ </div><h1 class="tool-detail-name" id="tool-detail-name">—</h1><p class="tool-detail-id" id="tool-detail-id"></p><p class="tool-detail-author" id="tool-detail-author" hidden></p>@@ -2813,10 +3328,30 @@<p class="tool-detail-desc" id="tool-detail-desc"></p><div class="tool-detail-actions" id="tool-detail-actions">- <button class="btn-primary tool-detail-cta" id="tool-detail-install">Add to Agent</button>- <button type="button" class="btn-secondary" id="tool-detail-share">Share</button>- <a class="btn-secondary" id="tool-detail-homepage" href="#" target="_blank" rel="noopener" hidden>Homepage ↗</a>- <a class="btn-secondary" id="tool-detail-manifest" href="#" target="_blank" rel="noopener" hidden>View manifest ↗</a>+ <button class="btn-primary tool-detail-cta" id="tool-detail-install">+ Add to Agent+ </button>+ <button type="button" class="btn-secondary" id="tool-detail-share">+ Share+ </button>+ <a+ class="btn-secondary"+ id="tool-detail-homepage"+ href="#"+ target="_blank"+ rel="noopener"+ hidden+ >Homepage ↗</a+ >+ <a+ class="btn-secondary"+ id="tool-detail-manifest"+ href="#"+ target="_blank"+ rel="noopener"+ hidden+ >View manifest ↗</a+ ></div><!-- System role / instructions -->@@ -2829,7 +3364,10 @@<section class="tool-detail-block" id="tool-detail-tools-wrap"><div class="tool-detail-block-head"><h2 class="tool-detail-block-title">Tools</h2>- <span class="tool-detail-block-count" id="tool-detail-tools-count"></span>+ <span+ class="tool-detail-block-count"+ id="tool-detail-tools-count"+ ></span></div><div class="tool-detail-tools" id="tool-detail-tools"></div></section>@@ -2837,13 +3375,23 @@</div></section><!-- Skill deep-link detail page -->- <section class="market-tool-detail market-skill-detail" id="market-skill-detail" hidden aria-label="Skill detail">+ <section+ class="market-tool-detail market-skill-detail"+ id="market-skill-detail"+ hidden+ aria-label="Skill detail"+ ><div class="market-tool-detail-inner">- <button class="market-back" id="skill-detail-back" aria-label="Back to skills">←</button>+ <button class="market-back" id="skill-detail-back" aria-label="Back to skills">+ ←+ </button><div class="tool-detail-skeleton" id="skill-detail-skeleton"><div class="tool-skel-head"><div class="tool-skel-icon"></div>- <div class="tool-skel-lines"><div class="tool-skel-line w60"></div><div class="tool-skel-line w30"></div></div>+ <div class="tool-skel-lines">+ <div class="tool-skel-line w60"></div>+ <div class="tool-skel-line w30"></div>+ </div></div><div class="tool-skel-line w90"></div><div class="tool-skel-line w80"></div>@@ -2852,14 +3400,24 @@<div class="tool-detail-empty" id="skill-detail-empty" hidden><span class="tool-detail-empty-glyph" aria-hidden="true">◌</span><h2 class="tool-detail-empty-title">Skill not found</h2>- <p class="tool-detail-empty-msg">This skill may have been removed or the link is wrong.</p>- <a class="btn-secondary tool-detail-empty-cta" href="/marketplace?tab=skills">Browse skills</a>+ <p class="tool-detail-empty-msg">+ This skill may have been removed or the link is wrong.+ </p>+ <a+ class="btn-secondary tool-detail-empty-cta"+ href="/marketplace?tab=skills"+ >Browse skills</a+ ></div><div class="tool-detail-body" id="skill-detail-body" hidden><header class="tool-detail-hero">- <div class="tool-detail-icon" id="skill-detail-icon" aria-hidden="true">?</div>+ <div class="tool-detail-icon" id="skill-detail-icon" aria-hidden="true">+ ?+ </div><div class="tool-detail-hero-text">- <div class="market-detail-eyebrow" id="skill-detail-eyebrow">Skill</div>+ <div class="market-detail-eyebrow" id="skill-detail-eyebrow">+ Skill+ </div><h1 class="tool-detail-name" id="skill-detail-name">—</h1><p class="tool-detail-author" id="skill-detail-author" hidden></p></div>@@ -2868,9 +3426,18 @@<div class="tool-detail-pills" id="skill-detail-pills"></div><p class="tool-detail-desc" id="skill-detail-desc"></p><div class="tool-detail-actions" id="skill-detail-actions">- <button class="btn-primary tool-detail-cta" id="skill-detail-install">Install</button>- <button type="button" class="btn-secondary" id="skill-detail-share">Share</button>- <button type="button" class="btn-secondary" id="skill-detail-author-btn" hidden></button>+ <button class="btn-primary tool-detail-cta" id="skill-detail-install">+ Install+ </button>+ <button type="button" class="btn-secondary" id="skill-detail-share">+ Share+ </button>+ <button+ type="button"+ class="btn-secondary"+ id="skill-detail-author-btn"+ hidden+ ></button></div><section class="tool-detail-block" id="skill-detail-rating-wrap" hidden><h2 class="tool-detail-block-title">Rate this skill</h2>@@ -2879,7 +3446,10 @@<section class="tool-detail-block" id="skill-detail-tools-wrap" hidden><div class="tool-detail-block-head"><h2 class="tool-detail-block-title">Tools provided</h2>- <span class="tool-detail-block-count" id="skill-detail-tools-count"></span>+ <span+ class="tool-detail-block-count"+ id="skill-detail-tools-count"+ ></span></div><div class="tool-detail-tools" id="skill-detail-tools"></div></section>@@ -2887,20 +3457,46 @@<h2 class="tool-detail-block-title">Instructions</h2><pre class="skill-detail-content" id="skill-detail-content"></pre></section>- <section class="tool-detail-block skill-x402-block" id="skill-detail-x402-wrap" hidden>+ <section+ class="tool-detail-block skill-x402-block"+ id="skill-detail-x402-wrap"+ hidden+ ><div class="tool-detail-block-head">- <h2 class="tool-detail-block-title">Call this skill · pay-per-call</h2>+ <h2 class="tool-detail-block-title">+ Call this skill · pay-per-call+ </h2><span class="skill-x402-price" id="skill-detail-x402-price"></span></div>- <p class="skill-x402-lead">Pay per call in <span data-term="usdc">USDC (a $1 digital dollar)</span> on Base or Solana and get the skill's tool schema and instructions back. Payment goes straight to the creator — no account needed, just a wallet.</p>+ <p class="skill-x402-lead">+ Pay per call in+ <span data-term="usdc">USDC (a $1 digital dollar)</span> on Base or+ Solana and get the skill's tool schema and instructions back.+ Payment goes straight to the creator — no account needed, just a+ wallet.+ </p><div class="skill-x402-endpoint"><code id="skill-detail-x402-url"></code>- <button type="button" class="btn-secondary skill-x402-copy" id="skill-detail-x402-copy-url" aria-label="Copy endpoint URL">Copy</button>+ <button+ type="button"+ class="btn-secondary skill-x402-copy"+ id="skill-detail-x402-copy-url"+ aria-label="Copy endpoint URL"+ >+ Copy+ </button></div><div class="skill-x402-snippet"><div class="skill-x402-snippet-head"><span>Call with x402-fetch (pay-per-call client)</span>- <button type="button" class="btn-secondary skill-x402-copy" id="skill-detail-x402-copy-code" aria-label="Copy code snippet">Copy code</button>+ <button+ type="button"+ class="btn-secondary skill-x402-copy"+ id="skill-detail-x402-copy-code"+ aria-label="Copy code snippet"+ >+ Copy code+ </button></div><pre id="skill-detail-x402-code"></pre></div>@@ -2913,21 +3509,42 @@</div></section><!-- Animation deep-link detail page -->- <section class="market-tool-detail market-anim-detail" id="market-anim-detail" hidden aria-label="Animation detail">+ <section+ class="market-tool-detail market-anim-detail"+ id="market-anim-detail"+ hidden+ aria-label="Animation detail"+ ><div class="market-tool-detail-inner">- <button class="market-back" id="anim-detail-back" aria-label="Back to animations">←</button>+ <button+ class="market-back"+ id="anim-detail-back"+ aria-label="Back to animations"+ >+ ←+ </button><div class="tool-detail-empty" id="anim-detail-empty" hidden><span class="tool-detail-empty-glyph" aria-hidden="true">◌</span><h2 class="tool-detail-empty-title">Animation not found</h2>- <p class="tool-detail-empty-msg">This clip may have been renamed or removed.</p>- <a class="btn-secondary tool-detail-empty-cta" href="/marketplace?tab=animations">Browse animations</a>+ <p class="tool-detail-empty-msg">+ This clip may have been renamed or removed.+ </p>+ <a+ class="btn-secondary tool-detail-empty-cta"+ href="/marketplace?tab=animations"+ >Browse animations</a+ ></div><div class="tool-detail-body" id="anim-detail-body" hidden><div class="anim-detail-stage" id="anim-detail-stage">- <div class="anim-detail-stage-load" id="anim-detail-stage-load"><span class="avatar-detail-load-label">Loading preview…</span></div>+ <div class="anim-detail-stage-load" id="anim-detail-stage-load">+ <span class="avatar-detail-load-label">Loading preview…</span>+ </div></div><header class="tool-detail-hero">- <div class="tool-detail-icon" id="anim-detail-icon" aria-hidden="true">▶</div>+ <div class="tool-detail-icon" id="anim-detail-icon" aria-hidden="true">+ ▶+ </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>@@ -2936,36 +3553,81 @@</header><div class="tool-detail-pills" id="anim-detail-pills"></div><div class="tool-detail-actions" id="anim-detail-actions">- <button class="btn-primary tool-detail-cta" id="anim-detail-replay">Replay</button>- <button type="button" class="btn-secondary" id="anim-detail-copy">Copy clip name</button>- <button type="button" class="btn-secondary" id="anim-detail-share">Share</button>- <a class="btn-secondary" id="anim-detail-raw" href="#" target="_blank" rel="noopener">View clip JSON ↗</a>+ <button class="btn-primary tool-detail-cta" id="anim-detail-replay">+ Replay+ </button>+ <button type="button" class="btn-secondary" id="anim-detail-copy">+ Copy clip name+ </button>+ <button type="button" class="btn-secondary" id="anim-detail-share">+ Share+ </button>+ <a+ class="btn-secondary"+ id="anim-detail-raw"+ href="#"+ target="_blank"+ rel="noopener"+ >View clip JSON ↗</a+ ></div><section class="tool-detail-block" id="anim-detail-related-wrap" hidden><h2 class="tool-detail-block-title">More animations</h2>- <div class="market-grid market-anim-grid" id="anim-detail-related"></div>+ <div+ class="market-grid market-anim-grid"+ id="anim-detail-related"+ ></div></section></div></div></section><!-- Onchain (ERC-8004) agent deep-link detail page -->- <section class="market-tool-detail market-onchain-detail" id="market-onchain-detail" hidden aria-label="Onchain agent detail">+ <section+ class="market-tool-detail market-onchain-detail"+ id="market-onchain-detail"+ hidden+ aria-label="Onchain agent detail"+ ><div class="market-tool-detail-inner">- <button class="market-back" id="onchain-detail-back" aria-label="Back to onchain agents">←</button>+ <button+ class="market-back"+ id="onchain-detail-back"+ aria-label="Back to onchain agents"+ >+ ←+ </button><div class="tool-detail-skeleton" id="onchain-detail-skeleton">- <div class="tool-skel-card" style="height:320px"></div>- <div class="tool-skel-head"><div class="tool-skel-icon"></div><div class="tool-skel-lines"><div class="tool-skel-line w60"></div><div class="tool-skel-line w30"></div></div></div>+ <div class="tool-skel-card" style="height: 320px"></div>+ <div class="tool-skel-head">+ <div class="tool-skel-icon"></div>+ <div class="tool-skel-lines">+ <div class="tool-skel-line w60"></div>+ <div class="tool-skel-line w30"></div>+ </div>+ </div></div><div class="tool-detail-empty" id="onchain-detail-empty" hidden><span class="tool-detail-empty-glyph" aria-hidden="true">◌</span><h2 class="tool-detail-empty-title">Agent not found</h2>- <p class="tool-detail-empty-msg">This onchain agent is no longer indexed, or the link is wrong.</p>- <a class="btn-secondary tool-detail-empty-cta" href="/marketplace?tab=onchain">Browse onchain agents</a>+ <p class="tool-detail-empty-msg">+ This onchain agent is no longer indexed, or the link is wrong.+ </p>+ <a+ class="btn-secondary tool-detail-empty-cta"+ href="/marketplace?tab=onchain"+ >Browse onchain agents</a+ ></div><div class="tool-detail-body" id="onchain-detail-body" hidden><div class="onchain-detail-stage" id="onchain-detail-stage" hidden></div><header class="tool-detail-hero">- <div class="tool-detail-icon" id="onchain-detail-icon" aria-hidden="true">?</div>+ <div+ class="tool-detail-icon"+ id="onchain-detail-icon"+ aria-hidden="true"+ >+ ?+ </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>@@ -2975,15 +3637,36 @@<div class="tool-detail-pills" id="onchain-detail-pills"></div><p class="tool-detail-desc" id="onchain-detail-desc"></p><div class="tool-detail-actions" id="onchain-detail-actions">- <a class="btn-primary tool-detail-cta" id="onchain-detail-view" href="#">Open in 3D viewer ↗</a>- <a class="btn-secondary" id="onchain-detail-token" href="#" target="_blank" rel="noopener">View token on explorer ↗</a>- <a class="btn-secondary" id="onchain-detail-owner-link" href="#" target="_blank" rel="noopener">View owner ↗</a>- <button type="button" class="btn-secondary" id="onchain-detail-share">Share</button>+ <a class="btn-primary tool-detail-cta" id="onchain-detail-view" href="#"+ >Open in 3D viewer ↗</a+ >+ <a+ class="btn-secondary"+ id="onchain-detail-token"+ href="#"+ target="_blank"+ rel="noopener"+ >View token on explorer ↗</a+ >+ <a+ class="btn-secondary"+ id="onchain-detail-owner-link"+ href="#"+ target="_blank"+ rel="noopener"+ >View owner ↗</a+ >+ <button type="button" class="btn-secondary" id="onchain-detail-share">+ Share+ </button></div><section class="tool-detail-block" id="onchain-detail-services-wrap" hidden><div class="tool-detail-block-head"><h2 class="tool-detail-block-title">Services</h2>- <span class="tool-detail-block-count" id="onchain-detail-services-count"></span>+ <span+ class="tool-detail-block-count"+ id="onchain-detail-services-count"+ ></span></div><div class="tool-detail-tools" id="onchain-detail-services"></div></section>@@ -2999,10 +3682,22 @@<header class="market-topbar"><div class="market-mine-head"><h2 class="market-section-heading">Animations</h2>- <span class="market-mine-sub" id="animations-subtitle">Browse avatar animation clips</span>+ <span class="market-mine-sub" id="animations-subtitle"+ >Browse avatar animation clips</span+ ></div>- <input id="animations-search" type="search" placeholder="Search animations…" autocomplete="off" style="flex:1;max-width:280px" />- <div class="market-filter-chips" role="group" aria-label="Animation type filter">+ <input+ id="animations-search"+ type="search"+ placeholder="Search animations…"+ autocomplete="off"+ style="flex: 1; max-width: 280px"+ />+ <div+ class="market-filter-chips"+ role="group"+ aria-label="Animation type filter"+ ><button class="market-chip active" data-anim-filter="all">All</button><button class="market-chip" data-anim-filter="loop">Ambient</button><button class="market-chip" data-anim-filter="action">Actions</button>@@ -3020,121 +3715,218 @@<header class="market-topbar"><div class="market-mine-head"><h2 class="market-section-heading">Agent Memory</h2>- <span class="market-mine-sub" id="memory-subtitle">Persistent context that makes agents smarter</span>+ <span class="market-mine-sub" id="memory-subtitle"+ >Persistent context that makes agents smarter</span+ ></div>- <a href="/agent/new" class="market-submit-btn" style="text-decoration:none">+ Create Agent</a>+ <a href="/agent/new" class="market-submit-btn" style="text-decoration: none"+ >+ Create Agent</a+ ></header><div class="market-memory-body" id="market-memory-body"><div class="market-empty">Loading…</div></div></section>-</main><!-- Submit Agent Modal -->- <div class="market-modal-overlay" id="market-submit-overlay" hidden aria-modal="true" role="dialog" aria-labelledby="market-submit-title">- <div class="market-modal">- <div class="market-modal-head">- <h2 id="market-submit-title">Submit an Agent</h2>- <button class="market-modal-close" id="market-submit-close" aria-label="Close">×</button>- </div>-- <div class="market-modal-import">- <button type="button" id="market-import-toggle" class="market-import-btn">Import from JSON ↓</button>- <div id="market-import-area" hidden>- <textarea id="market-import-json" class="market-json-input" rows="5"- placeholder='Paste LobeHub-compatible agent JSON: { "config": { "systemRole": "…" }, "meta": { "title": "…" } }'></textarea>- <button type="button" id="market-import-apply" class="market-btn-sec" style="margin-top:6px">Apply JSON</button>+ <div+ class="market-modal-overlay"+ id="market-submit-overlay"+ hidden+ aria-modal="true"+ role="dialog"+ aria-labelledby="market-submit-title"+ >+ <div class="market-modal">+ <div class="market-modal-head">+ <h2 id="market-submit-title">Submit an Agent</h2>+ <button class="market-modal-close" id="market-submit-close" aria-label="Close">+ ×+ </button></div>- </div>- <form id="market-submit-form" class="market-submit-form" novalidate>- <div class="market-field">- <label for="sf-name">Name <span class="req">*</span></label>- <input id="sf-name" type="text" maxlength="100" placeholder="My Helpful Agent" autocomplete="off" />- </div>- <div class="market-field">- <label for="sf-description">Description <span class="req">*</span></label>- <input id="sf-description" type="text" maxlength="500" placeholder="A short description of what this agent does" />+ <div class="market-modal-import">+ <button type="button" id="market-import-toggle" class="market-import-btn">+ Import from JSON ↓+ </button>+ <div id="market-import-area" hidden>+ <textarea+ id="market-import-json"+ class="market-json-input"+ rows="5"+ placeholder='Paste LobeHub-compatible agent JSON: { "config": { "systemRole": "…" }, "meta": { "title": "…" } }'+ ></textarea>+ <button+ type="button"+ id="market-import-apply"+ class="market-btn-sec"+ style="margin-top: 6px"+ >+ Apply JSON+ </button>+ </div></div>- <div class="market-field-row">++ <form id="market-submit-form" class="market-submit-form" novalidate><div class="market-field">- <label for="sf-category">Category <span class="req">*</span></label>- <select id="sf-category">- <option value="">Select…</option>- <option value="academic">Academic</option>- <option value="career">Career</option>- <option value="copywriting">Copywriting</option>- <option value="design">Design</option>- <option value="education">Education</option>- <option value="emotions">Emotions</option>- <option value="entertainment">Entertainment</option>- <option value="games">Games</option>- <option value="general">General</option>- <option value="life">Life</option>- <option value="marketing">Marketing</option>- <option value="office">Office</option>- <option value="programming">Programming</option>- <option value="translation">Translation</option>- </select>+ <label for="sf-name">Name <span class="req">*</span></label>+ <input+ id="sf-name"+ type="text"+ maxlength="100"+ placeholder="My Helpful Agent"+ autocomplete="off"+ /></div><div class="market-field">- <label for="sf-tags">Tags <span class="field-hint">(comma-separated)</span></label>- <input id="sf-tags" type="text" maxlength="200" placeholder="helpful, writing, code" />- </div>- </div>- <div class="market-field">- <label for="sf-prompt">System Prompt <span class="req">*</span></label>- <textarea id="sf-prompt" rows="6" maxlength="16000"- placeholder="You are a helpful AI assistant specialized in…"></textarea>- </div>- <div class="market-field">- <label for="sf-greeting">Greeting Message</label>- <input id="sf-greeting" type="text" maxlength="1000" placeholder="Hello! I'm here to help you with…" />- </div>-- <details class="market-field-group">- <summary class="market-field-group-title">Monetize <span class="field-hint">(optional)</span></summary>- <div class="market-field" style="margin-top:0.75rem">- <label for="sf-payout-wallet">Payout wallet address <span class="field-hint">(Solana)</span></label>- <input id="sf-payout-wallet" type="text" maxlength="100" placeholder="Your Solana address for receiving payments" autocomplete="off" />+ <label for="sf-description">Description <span class="req">*</span></label>+ <input+ id="sf-description"+ type="text"+ maxlength="500"+ placeholder="A short description of what this agent does"+ /></div>- <div class="sf-skill-prices" id="sf-skill-prices">- <div class="sf-skill-prices-label">Skill prices <span class="field-hint">(USDC per call)</span></div>- <div id="sf-price-rows"></div>- <div class="agent-pricing-add-row">- <input id="sf-new-skill" type="text" maxlength="100" placeholder="skill-name" autocomplete="off" />- <button type="button" id="sf-add-skill" class="market-btn-sec">+ Add Skill</button>+ <div class="market-field-row">+ <div class="market-field">+ <label for="sf-category">Category <span class="req">*</span></label>+ <select id="sf-category">+ <option value="">Select…</option>+ <option value="academic">Academic</option>+ <option value="career">Career</option>+ <option value="copywriting">Copywriting</option>+ <option value="design">Design</option>+ <option value="education">Education</option>+ <option value="emotions">Emotions</option>+ <option value="entertainment">Entertainment</option>+ <option value="games">Games</option>+ <option value="general">General</option>+ <option value="life">Life</option>+ <option value="marketing">Marketing</option>+ <option value="office">Office</option>+ <option value="programming">Programming</option>+ <option value="translation">Translation</option>+ </select>+ </div>+ <div class="market-field">+ <label for="sf-tags"+ >Tags <span class="field-hint">(comma-separated)</span></label+ >+ <input+ id="sf-tags"+ type="text"+ maxlength="200"+ placeholder="helpful, writing, code"+ /></div></div>- </details>+ <div class="market-field">+ <label for="sf-prompt">System Prompt <span class="req">*</span></label>+ <textarea+ id="sf-prompt"+ rows="6"+ maxlength="16000"+ placeholder="You are a helpful AI assistant specialized in…"+ ></textarea>+ </div>+ <div class="market-field">+ <label for="sf-greeting">Greeting Message</label>+ <input+ id="sf-greeting"+ type="text"+ maxlength="1000"+ placeholder="Hello! I'm here to help you with…"+ />+ </div>- <div id="market-submit-error" class="market-form-error" hidden></div>+ <details class="market-field-group">+ <summary class="market-field-group-title">+ Monetize <span class="field-hint">(optional)</span>+ </summary>+ <div class="market-field" style="margin-top: 0.75rem">+ <label for="sf-payout-wallet"+ >Payout wallet address+ <span class="field-hint">(Solana)</span></label+ >+ <input+ id="sf-payout-wallet"+ type="text"+ maxlength="100"+ placeholder="Your Solana address for receiving payments"+ autocomplete="off"+ />+ </div>+ <div class="sf-skill-prices" id="sf-skill-prices">+ <div class="sf-skill-prices-label">+ Skill prices <span class="field-hint">(USDC per call)</span>+ </div>+ <div id="sf-price-rows"></div>+ <div class="agent-pricing-add-row">+ <input+ id="sf-new-skill"+ type="text"+ maxlength="100"+ placeholder="skill-name"+ autocomplete="off"+ />+ <button type="button" id="sf-add-skill" class="market-btn-sec">+ + Add Skill+ </button>+ </div>+ </div>+ </details>- <div class="market-submit-actions">- <button type="button" id="sf-save-draft" class="market-btn-sec">Save Draft</button>- <button type="button" id="sf-publish" class="market-btn-pri">Publish</button>- </div>- </form>+ <div id="market-submit-error" class="market-form-error" hidden></div>++ <div class="market-submit-actions">+ <button type="button" id="sf-save-draft" class="market-btn-sec">+ Save Draft+ </button>+ <button type="button" id="sf-publish" class="market-btn-pri">+ Publish+ </button>+ </div>+ </form>+ </div></div>- </div><!-- Publish Skill Modal -->- <div class="market-modal-overlay" id="skill-publish-overlay" hidden aria-modal="true" role="dialog" aria-labelledby="skill-publish-title">+ <div+ class="market-modal-overlay"+ id="skill-publish-overlay"+ hidden+ aria-modal="true"+ role="dialog"+ aria-labelledby="skill-publish-title"+ ><div class="market-modal"><div class="market-modal-head"><h2 id="skill-publish-title">Publish a Skill</h2>- <button class="market-modal-close" id="skill-publish-close" aria-label="Close">×</button>+ <button class="market-modal-close" id="skill-publish-close" aria-label="Close">+ ×+ </button></div><form id="skill-publish-form" novalidate><div class="market-field"><label for="sp-name">Name <span class="req">*</span></label>- <input id="sp-name" type="text" maxlength="100" placeholder="web-search" autocomplete="off" />+ <input+ id="sp-name"+ type="text"+ maxlength="100"+ placeholder="web-search"+ autocomplete="off"+ /><span class="field-hint">Lowercase slug, e.g. <code>web-search</code></span></div><div class="market-field"><label for="sp-description">Description <span class="req">*</span></label>- <input id="sp-description" type="text" maxlength="500" placeholder="Search the web for current information" />+ <input+ id="sp-description"+ type="text"+ maxlength="500"+ placeholder="Search the web for current information"+ /></div><div class="market-field-row"><div class="market-field">@@ -3151,34 +3943,73 @@</select></div><div class="market-field">- <label for="sp-price">Price per call (USD) <span class="field-hint">0 = free</span></label>- <input id="sp-price" type="number" min="0" max="10" step="0.001" placeholder="0.001" value="0" />+ <label for="sp-price"+ >Price per call (USD)+ <span class="field-hint">0 = free</span></label+ >+ <input+ id="sp-price"+ type="number"+ min="0"+ max="10"+ step="0.001"+ placeholder="0.001"+ value="0"+ /></div></div><div class="market-field">- <label for="sp-tags">Tags <span class="field-hint">(comma-separated)</span></label>- <input id="sp-tags" type="text" maxlength="200" placeholder="search, web, realtime" />+ <label for="sp-tags"+ >Tags <span class="field-hint">(comma-separated)</span></label+ >+ <input+ id="sp-tags"+ type="text"+ maxlength="200"+ placeholder="search, web, realtime"+ /></div><div class="market-field">- <label for="sp-schema">Tool definitions <span class="field-hint">(JSON array — optional)</span></label>- <textarea id="sp-schema" rows="6" placeholder='[{"name":"search","description":"Search the web","input_schema":{"type":"object","properties":{"query":{"type":"string","description":"Search query"}},"required":["query"]}}]'></textarea>+ <label for="sp-schema"+ >Tool definitions+ <span class="field-hint">(JSON array — optional)</span></label+ >+ <textarea+ id="sp-schema"+ rows="6"+ placeholder='[{"name":"search","description":"Search the web","input_schema":{"type":"object","properties":{"query":{"type":"string","description":"Search query"}},"required":["query"]}}]'+ ></textarea></div><div id="skill-publish-error" class="market-form-error" hidden></div><div class="market-submit-actions">- <button type="button" id="sp-publish" class="market-btn-pri">Publish Skill</button>+ <button type="button" id="sp-publish" class="market-btn-pri">+ Publish Skill+ </button></div></form></div></div><!-- Payout Wallet Modal -->- <div class="market-modal-overlay" id="wallet-setup-overlay" hidden aria-modal="true" role="dialog" aria-labelledby="wallet-setup-title">- <div class="market-modal" style="max-width:420px">+ <div+ class="market-modal-overlay"+ id="wallet-setup-overlay"+ hidden+ aria-modal="true"+ role="dialog"+ aria-labelledby="wallet-setup-title"+ >+ <div class="market-modal" style="max-width: 420px"><div class="market-modal-head"><h2 id="wallet-setup-title">Payout Wallet</h2>- <button class="market-modal-close" id="wallet-setup-close" aria-label="Close">×</button>+ <button class="market-modal-close" id="wallet-setup-close" aria-label="Close">+ ×+ </button></div>- <p style="color:#a1a1aa;font-size:0.875rem;margin:0 0 1.25rem">Payments from buyers go directly to this wallet. You can use a Solana or Base wallet address.</p>+ <p style="color: #a1a1aa; font-size: 0.875rem; margin: 0 0 1.25rem">+ Payments from buyers go directly to this wallet. You can use a Solana or Base+ wallet address.+ </p><div class="market-field"><label for="ws-chain">Chain</label><select id="ws-chain">@@ -3188,7 +4019,13 @@</div><div class="market-field"><label for="ws-address">Wallet address <span class="req">*</span></label>- <input id="ws-address" type="text" maxlength="100" placeholder="Solana or wallet address" autocomplete="off" />+ <input+ id="ws-address"+ type="text"+ maxlength="100"+ placeholder="Solana or wallet address"+ autocomplete="off"+ /></div><div id="wallet-setup-error" class="market-form-error" hidden></div><div class="market-submit-actions">@@ -3198,17 +4035,40 @@</div><!-- Agent Pricing Modal -->- <div class="market-modal-overlay" id="agent-pricing-overlay" hidden aria-modal="true" role="dialog" aria-labelledby="agent-pricing-title">- <div class="market-modal" style="max-width:480px">+ <div+ class="market-modal-overlay"+ id="agent-pricing-overlay"+ hidden+ aria-modal="true"+ role="dialog"+ aria-labelledby="agent-pricing-title"+ >+ <div class="market-modal" style="max-width: 480px"><div class="market-modal-head"><h2 id="agent-pricing-title">Set Skill Prices</h2>- <button class="market-modal-close" id="agent-pricing-close" aria-label="Close">×</button>+ <button class="market-modal-close" id="agent-pricing-close" aria-label="Close">+ ×+ </button></div>- <p style="color:#a1a1aa;font-size:0.875rem;margin:0 0 1rem" id="agent-pricing-hint">Set a USDC (a $1 digital dollar) price for each skill. Leave blank or 0 to keep it free.</p>+ <p+ style="color: #a1a1aa; font-size: 0.875rem; margin: 0 0 1rem"+ id="agent-pricing-hint"+ >+ Set a USDC (a $1 digital dollar) price for each skill. Leave blank or 0 to keep+ it free.+ </p><div id="agent-pricing-rows" class="agent-pricing-rows"></div><div class="agent-pricing-add-row">- <input id="ap-new-skill" type="text" maxlength="100" placeholder="skill-name" autocomplete="off" />- <button type="button" id="ap-add-skill" class="market-btn-sec">+ Add Skill</button>+ <input+ id="ap-new-skill"+ type="text"+ maxlength="100"+ placeholder="skill-name"+ autocomplete="off"+ />+ <button type="button" id="ap-add-skill" class="market-btn-sec">+ + Add Skill+ </button></div><div id="agent-pricing-error" class="market-form-error" hidden></div><div class="market-submit-actions">@@ -3217,13 +4077,22 @@</div></div>- <script src="/src/marketplace.js" type="module"></script>+ <script src="/src/marketplace.js" type="module"></script><!-- Avatar Detail Modal -->- <div class="avatar-modal-overlay" id="avatar-modal-overlay" hidden aria-modal="true" role="dialog" aria-labelledby="avatar-modal-title">+ <div+ class="avatar-modal-overlay"+ id="avatar-modal-overlay"+ hidden+ aria-modal="true"+ role="dialog"+ aria-labelledby="avatar-modal-title"+ ><div class="avatar-modal" role="document"><div class="avatar-modal-stage" id="avatar-modal-stage">- <button class="avatar-modal-close" id="avatar-modal-close" aria-label="Close">×</button>+ <button class="avatar-modal-close" id="avatar-modal-close" aria-label="Close">+ ×+ </button></div><div class="avatar-modal-side"><div class="avatar-modal-eyebrow">Community Avatar</div>@@ -3232,9 +4101,20 @@<div class="avatar-modal-meta" id="avatar-modal-meta"></div><div class="avatar-modal-sale" id="avatar-modal-sale" hidden></div><div class="avatar-modal-actions">- <button class="btn-primary" id="avatar-modal-use">Start an agent with this avatar</button>- <a class="btn-secondary" id="avatar-modal-view" href="#" target="_blank" rel="noopener">Open in 3D viewer</a>- <a class="btn-secondary" id="avatar-modal-download" href="#" download>Download GLB</a>+ <button class="btn-primary" id="avatar-modal-use">+ Start an agent with this avatar+ </button>+ <a+ class="btn-secondary"+ id="avatar-modal-view"+ href="#"+ target="_blank"+ rel="noopener"+ >Open in 3D viewer</a+ >+ <a class="btn-secondary" id="avatar-modal-download" href="#" download+ >Download GLB</a+ ><button id="avatar-modal-bookmark" aria-pressed="false">Bookmark</button></div></div>@@ -3242,9 +4122,18 @@</div><!-- Creator Profile Modal -->- <div class="creator-modal-overlay" id="creator-modal-overlay" hidden aria-modal="true" role="dialog" aria-labelledby="creator-modal-title">+ <div+ class="creator-modal-overlay"+ id="creator-modal-overlay"+ hidden+ aria-modal="true"+ role="dialog"+ aria-labelledby="creator-modal-title"+ ><div class="creator-modal" role="document">- <button class="creator-modal-close" id="creator-modal-close" aria-label="Close">×</button>+ <button class="creator-modal-close" id="creator-modal-close" aria-label="Close">+ ×+ </button><header class="creator-modal-head"><div class="creator-modal-avatar" id="creator-modal-avatar"></div><div class="creator-modal-meta">@@ -3256,13 +4145,17 @@</header><div class="creator-modal-body"><section>- <h3 class="creator-modal-sectiontitle">Published agents <span id="creator-agents-count" class="muted"></span></h3>+ <h3 class="creator-modal-sectiontitle">+ Published agents <span id="creator-agents-count" class="muted"></span>+ </h3><div class="creator-modal-grid" id="creator-agents-grid"><div class="market-empty">Loading…</div></div></section><section>- <h3 class="creator-modal-sectiontitle">Public avatars <span id="creator-avatars-count" class="muted"></span></h3>+ <h3 class="creator-modal-sectiontitle">+ Public avatars <span id="creator-avatars-count" class="muted"></span>+ </h3><div class="creator-modal-grid" id="creator-avatars-grid"><div class="market-empty">Loading…</div></div>@@ -3272,49 +4165,83 @@</div><!-- Mobile sidebar backdrop + toggle -->- <button class="market-sidebar-toggle" id="market-sidebar-toggle" aria-label="Open menu" hidden>☰</button>+ <button+ class="market-sidebar-toggle"+ id="market-sidebar-toggle"+ aria-label="Open menu"+ hidden+ >+ ☰+ </button><div class="market-sidebar-backdrop" id="market-sidebar-backdrop" hidden></div>- <!-- Payment Modal -->- <div class="market-modal-overlay" id="payment-modal-overlay" hidden aria-modal="true" role="dialog" aria-labelledby="payment-modal-title">+ <!-- Payment Modal -->+ <div+ class="market-modal-overlay"+ id="payment-modal-overlay"+ hidden+ aria-modal="true"+ role="dialog"+ aria-labelledby="payment-modal-title"+ ><div class="market-modal">- <div class="market-modal-head">- <h2 id="payment-modal-title">Unlock Skill</h2>- <button class="market-modal-close" id="payment-modal-close" aria-label="Close">×</button>+ <div class="market-modal-head">+ <h2 id="payment-modal-title">Unlock Skill</h2>+ <button class="market-modal-close" id="payment-modal-close" aria-label="Close">+ ×+ </button>+ </div>+ <div class="payment-modal-body" id="payment-modal-body">+ <div class="payment-modal-badge" id="payment-modal-badge" hidden></div>++ <p id="payment-modal-lede">You are purchasing access to the following skill:</p>+ <div class="payment-item">+ <strong id="payment-skill-name"></strong>+ <span id="payment-item-from">from agent</span>+ <em id="payment-agent-name"></em></div>- <div class="payment-modal-body" id="payment-modal-body">- <div class="payment-modal-badge" id="payment-modal-badge" hidden></div>-- <p id="payment-modal-lede">You are purchasing access to the following skill:</p>- <div class="payment-item">- <strong id="payment-skill-name"></strong>- <span id="payment-item-from">from agent</span>- <em id="payment-agent-name"></em>- </div>- <div class="payment-price">- <span>Total</span>- <strong id="payment-price-display"></strong>- </div>+ <div class="payment-price">+ <span>Total</span>+ <strong id="payment-price-display"></strong>+ </div>- <div class="payment-wallet-area" id="payment-wallet-area">- <!-- Wallet connection status and button will be rendered here by JS -->- <button class="btn-primary" id="payment-connect-wallet-btn">Connect Wallet</button>- </div>+ <div class="payment-wallet-area" id="payment-wallet-area">+ <!-- Wallet connection status and button will be rendered here by JS -->+ <button class="btn-primary" id="payment-connect-wallet-btn">+ Connect Wallet+ </button>+ </div>- <button class="btn-primary payment-confirm-btn" id="payment-confirm-btn" disabled>Confirm Purchase</button>+ <button+ class="btn-primary payment-confirm-btn"+ id="payment-confirm-btn"+ disabled+ >+ Confirm Purchase+ </button>- <div class="payment-qr" id="payment-qr" aria-live="polite"></div>+ <div class="payment-qr" id="payment-qr" aria-live="polite"></div>- <div class="payment-status" id="payment-status" role="status" aria-live="polite"></div>- </div>- <div class="payment-modal-success" id="payment-modal-success" hidden role="status" aria-live="polite"></div>+ <div+ class="payment-status"+ id="payment-status"+ role="status"+ aria-live="polite"+ ></div>+ </div>+ <div+ class="payment-modal-success"+ id="payment-modal-success"+ hidden+ role="status"+ aria-live="polite"+ ></div></div>- </div>-+ </div>+<div id="footer-container"></div><script src="/footer.js"></script>- <script src="/brand.js" defer></script>-</body>+ <script src="/brand.js" defer></script>+ </body></html>-diff --git a/pages/playground.html b/pages/playground.htmlindex 503f74018..b269005df 100644--- a/pages/playground.html+++ b/pages/playground.html@@ -1,867 +1,1064 @@-<!DOCTYPE html>+<!doctype html><html lang="en">-<head>- <meta charset="UTF-8">- <meta name="viewport" content="width=device-width, initial-scale=1.0">- <title>Playground · three.ws</title>- <link rel="icon" href="/favicon.ico" sizes="any" />+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Playground · three.ws</title>+ <link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" /><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /><link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/site.webmanifest" />- <link rel="stylesheet" href="/style.css">- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/footer.css" />- <link rel="stylesheet" href="/fonts/fonts.css" />- <link rel="stylesheet" href="/mobile.css" />- <script- type="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"- ></script>- <script defer src="/footer-newsletter.js"></script>- <style>- :root {- --bg: #0a0a0a;- --panel: #111;- --panel-2: #161616;- --border: #1f1f1f;- --border-2: #2a2a2a;- --text: #fafafa;- --text-2: #a1a1aa;- --text-3: #52525b;- --accent: #ffffff;- --accent-dim: rgba(255, 255, 255, 0.10);- --success: #e8e8e8;- --err: #f87171;- }-- html, body {- margin: 0;- background: var(--bg);- color: var(--text);- font-family: var(--font-body);- -webkit-font-smoothing: antialiased;- }- body { display: flex; flex-direction: column; min-height: 100vh; }- a { color: inherit; }-- /* ── header ── */- .pg-header {- position: sticky;- top: 0;- z-index: 100;- display: flex;- align-items: center;- justify-content: space-between;- gap: 1rem;- padding: 0.75rem 1.618rem;- border-bottom: 1px solid rgba(255,255,255,0.06);- background: rgba(10,10,10,0.9);- backdrop-filter: blur(14px);- -webkit-backdrop-filter: blur(14px);- }- .pg-header-left { display: inline-flex; align-items: center; gap: 0; }- .pg-header-logo { height: 26px; width: auto; display: block; }- .pg-header-nav {- display: flex;- align-items: center;- gap: 1.25rem;- margin-left: 1.5rem;- }- .pg-header-nav a {- color: rgba(255,255,255,0.4);- text-decoration: none;- font-size: 0.8rem;- transition: color 0.15s;- }- .pg-header-nav a:hover { color: rgba(255,255,255,0.85); }- .pg-header-nav a.active { color: rgba(255,255,255,0.85); }-- /* ── layout ── */- .pg-body {- flex: 1;- display: grid;- grid-template-columns: 1fr 300px;- gap: 0;- min-height: 0;- }-- /* ── viewer column ── */- .pg-viewer-col {- display: flex;- flex-direction: column;- padding: 1.5rem;- gap: 0.75rem;- border-right: 1px solid var(--border);- }- .pg-viewer-wrap {- position: relative;- flex: 1;- border-radius: 14px;- overflow: hidden;- border: 1px solid var(--border);- background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,0.03) 0%, transparent 65%), var(--panel);- min-height: 420px;- }- .pg-viewer-wrap.drag-over {- border-color: var(--accent);- background: radial-gradient(ellipse at 50% 30%, rgba(255,255,255,0.08) 0%, transparent 65%), var(--panel);- }- #viewer {- width: 100%;- height: 100%;- position: absolute;- inset: 0;- --poster-color: transparent;- }-- /* drop overlay shown before any model loads */- .drop-overlay {- position: absolute;- inset: 0;- z-index: 10;- display: flex;- flex-direction: column;- align-items: center;- justify-content: center;- gap: 0.75rem;- pointer-events: none;- transition: opacity 0.2s;- }- .drop-overlay.hidden { opacity: 0; pointer-events: none; }- .drop-icon {- width: 56px;- height: 56px;- border-radius: 14px;- border: 1.5px dashed var(--border-2);- display: flex;- align-items: center;- justify-content: center;- color: var(--text-3);- }- .drop-overlay p {- margin: 0;- font-size: 13px;- color: var(--text-3);- text-align: center;- line-height: 1.5;- }- .drop-overlay small {- display: block;- font-size: 11px;- color: var(--text-3);- opacity: 0.6;- margin-top: 0.1rem;- }-- .pg-viewer-bar {- display: flex;- align-items: center;- gap: 0.5rem;- flex-wrap: wrap;- }- .pg-file-chip {- font-size: 12px;- color: var(--text-3);- background: var(--panel);- border: 1px solid var(--border);- border-radius: 6px;- padding: 0.3rem 0.6rem;- white-space: nowrap;- overflow: hidden;- text-overflow: ellipsis;- max-width: 220px;- }- .pg-file-chip.loaded { color: var(--text-2); border-color: var(--border-2); }-- /* ── controls column ── */- .pg-controls-col {- display: flex;- flex-direction: column;- overflow-y: auto;- padding: 1.25rem;- gap: 0;- scrollbar-width: thin;- scrollbar-color: var(--border) transparent;- }-- .pg-section {- padding: 1rem 0;- border-bottom: 1px solid var(--border);- }- .pg-section:first-child { padding-top: 0.25rem; }- .pg-section:last-child { border-bottom: none; }-- .pg-section-label {- font-size: 10px;- font-weight: 600;- letter-spacing: 0.08em;- text-transform: uppercase;- color: var(--text-3);- margin: 0 0 0.75rem;- }-- /* upload */- .pg-upload-label {- display: flex;- align-items: center;- justify-content: center;- gap: 0.5rem;- padding: 0.65rem 1rem;- border-radius: 8px;- border: 1px dashed var(--border-2);- color: var(--text-2);- font-size: 12.5px;- cursor: pointer;- transition: color 0.15s, border-color 0.15s, background 0.15s;- width: 100%;- box-sizing: border-box;- }- .pg-upload-label:hover {- color: var(--text);- border-color: var(--text-3);- background: var(--panel-2);- }- #avatar-upload { display: none; }-- /* pills */- .pill-row {- display: flex;- gap: 0.35rem;- flex-wrap: wrap;- }- .pill {- padding: 0.35rem 0.75rem;- border-radius: 6px;- border: 1px solid var(--border-2);- background: transparent;- color: var(--text-2);- font-family: inherit;- font-size: 12px;- cursor: pointer;- transition: color 0.12s, border-color 0.12s, background 0.12s;- }- .pill:hover { color: var(--text); border-color: var(--text-3); }- .pill.active {- background: var(--accent-dim);- border-color: var(--accent);- color: var(--accent);- }-- /* sliders */- .pg-slider {- width: 100%;- height: 4px;- border-radius: 2px;- accent-color: var(--accent);- cursor: pointer;- }- .slider-row {- display: flex;- align-items: center;- gap: 0.75rem;- }- .slider-val {- font-size: 11px;- color: var(--text-3);- min-width: 28px;- text-align: right;- font-variant-numeric: tabular-nums;- }-- /* toggle */- .toggle-row {- display: flex;- align-items: center;- justify-content: space-between;- }- .toggle-row span { font-size: 12.5px; color: var(--text-2); }- .toggle { position: relative; display: inline-block; width: 36px; height: 20px; }- .toggle input { opacity: 0; width: 0; height: 0; }- .toggle-slider {- position: absolute;- inset: 0;- background: var(--border-2);- border-radius: 20px;- cursor: pointer;- transition: background 0.2s;- }- .toggle-slider::before {- content: '';- position: absolute;- height: 14px;- width: 14px;- left: 3px;- top: 3px;- background: var(--text-2);- border-radius: 50%;- transition: transform 0.2s, background 0.2s;- }- .toggle input:checked + .toggle-slider { background: var(--accent); }- .toggle input:checked + .toggle-slider::before {- transform: translateX(16px);- background: #fff;- }-- /* animations */- .anim-controls {- display: flex;- gap: 0.5rem;- align-items: center;- }- #anim-select {- flex: 1;- min-width: 0;- padding: 0.4rem 0.6rem;- border-radius: 8px;- border: 1px solid var(--border-2);- background: var(--panel-2);- color: var(--text);- font-family: inherit;- font-size: 12px;- }- #anim-select:focus { outline: none; border-color: var(--accent); }- .anim-btn {- width: 32px;- height: 32px;- border-radius: 8px;- border: 1px solid var(--border-2);- background: var(--panel-2);- color: var(--text-2);- display: flex;- align-items: center;- justify-content: center;- cursor: pointer;- flex-shrink: 0;- transition: color 0.12s, border-color 0.12s, background 0.12s;- }- .anim-btn:hover { color: var(--text); border-color: var(--text-3); }-- /* model info */- .info-grid {- display: grid;- grid-template-columns: auto 1fr;- gap: 0.35rem 0.75rem;- margin: 0;- }- .info-grid dt { font-size: 11.5px; color: var(--text-3); }- .info-grid dd { font-size: 11.5px; color: var(--text-2); margin: 0; font-variant-numeric: tabular-nums; }-- /* embed */- #embed-code {- width: 100%;- box-sizing: border-box;- height: 90px;- padding: 0.65rem;- border-radius: 8px;- border: 1px solid var(--border-2);- background: var(--panel-2);- color: var(--text-2);- font-family: var(--font-mono);- font-size: 10.5px;- resize: none;- line-height: 1.5;- }- #embed-code:focus { outline: none; border-color: var(--accent); }- .embed-note {- font-size: 11px;- color: var(--text-3);- margin: 0.4rem 0 0;- line-height: 1.45;- }-- /* buttons */- .pg-btn {- display: inline-flex;- align-items: center;- justify-content: center;- gap: 0.4rem;- padding: 0.5rem 0.85rem;- border-radius: 8px;- border: 1px solid var(--border-2);- background: var(--panel-2);- color: var(--text-2);- font-family: inherit;- font-size: 12px;- cursor: pointer;- transition: color 0.12s, border-color 0.12s, background 0.12s;- text-decoration: none;- }- .pg-btn:hover { color: var(--text); border-color: var(--text-3); }- .pg-btn.accent {- background: var(--accent);- border-color: var(--accent);- color: #0a0a0a;- font-weight: 600;- }- .pg-btn.accent:hover { background: #e0e0e0; border-color: #e0e0e0; }- .btn-row {- display: flex;- gap: 0.4rem;- flex-wrap: wrap;- margin-top: 0.6rem;- }-- /* status */- #pg-status {- font-size: 11.5px;- color: var(--text-3);- min-height: 14px;- text-align: center;- }- #pg-status.ok { color: var(--success); }- #pg-status.err { color: var(--err); }-- /* loading */- .loading-indicator {- display: none;- position: fixed;- inset: 0;- z-index: 150;- background: rgba(0,0,0,0.45);- backdrop-filter: blur(2px);- -webkit-backdrop-filter: blur(2px);- align-items: center;- justify-content: center;- }- .loading-indicator.open { display: flex; }- .spinner {- width: 44px;- height: 44px;- border: 3px solid rgba(255,255,255,0.08);- border-top-color: var(--accent);- border-radius: 50%;- animation: spin 0.85s linear infinite;- }- @keyframes spin { to { transform: rotate(360deg); } }-- /* responsive */- @media (max-width: 768px) {- .pg-body {- grid-template-columns: 1fr;- }- .pg-viewer-col {- border-right: none;- border-bottom: 1px solid var(--border);- padding: 1rem;- }- .pg-viewer-wrap { min-height: 300px; }- .pg-controls-col { padding: 1rem; }- .pg-header-nav { display: none; }- }- </style>-- <meta name="description" content="Sandbox for experimenting with agents, prompts, and 3D scenes.">- <link rel="canonical" href="https://three.ws/playground">- <meta property="og:type" content="website">- <meta property="og:site_name" content="three.ws">- <meta property="og:title" content="Playground · three.ws">- <meta property="og:description" content="Sandbox for experimenting with agents, prompts, and 3D scenes.">- <meta property="og:url" content="https://three.ws/playground">- <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="Playground · three.ws">- <meta name="twitter:description" content="Sandbox for experimenting with agents, prompts, and 3D scenes.">- <meta name="twitter:image" content="https://three.ws/og-image.png">- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Playground","description":"Sandbox for experimenting with agents, prompts, and 3D scenes.","url":"https://three.ws/playground","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>-<body>-- <header class="pg-header">- <div class="pg-header-left">- <a href="/" aria-label="three.ws home">- <img src="/three.svg" alt="three.ws" class="pg-header-logo">- </a>- <nav class="pg-header-nav" aria-label="Primary">- <a href="/discover">Discover</a>- <a href="/create">Create</a>- <a href="/studio">Studio</a>- <a href="/playground" class="active">Playground</a>- </nav>- </div>- </header>-- <div class="pg-body">-- <!-- viewer column -->- <div class="pg-viewer-col">- <div class="pg-viewer-wrap" id="dropzone">- <!-- shown before a model is loaded -->- <div class="drop-overlay" id="drop-overlay">- <div class="drop-icon">- <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>- <polyline points="17 8 12 3 7 8"/>- <line x1="12" y1="3" x2="12" y2="15"/>- </svg>- </div>- <p>Drop a .glb file here<small>or use the upload button →</small></p>- </div>-- <model-viewer- id="viewer"- src="/avatars/default.glb"- alt="A 3D avatar"- ar- ar-modes="webxr scene-viewer quick-look"- camera-controls- shadow-intensity="1"- environment-image="neutral"- exposure="1"- auto-rotate- autoplay- ></model-viewer>- </div>-- <div class="pg-viewer-bar">- <span id="file-chip" class="pg-file-chip loaded">default.glb</span>- <div id="pg-status"></div>- </div>- </div>-- <!-- controls column -->- <div class="pg-controls-col">-- <!-- upload -->- <div class="pg-section">- <div class="pg-section-label">Model</div>- <label for="avatar-upload" class="pg-upload-label">- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>- <polyline points="17 8 12 3 7 8"/>- <line x1="12" y1="3" x2="12" y2="15"/>- </svg>- Upload .glb file- </label>- <input type="file" id="avatar-upload" accept=".glb">- </div>-- <!-- animations -->- <div class="pg-section" id="anim-section" style="display:none">- <div class="pg-section-label">Animations</div>- <div class="anim-controls">- <button class="anim-btn" id="anim-play-pause" title="Play / Pause" aria-label="Play or pause animation">- <svg id="anim-icon-pause" width="14" height="14" viewBox="0 0 24 24" fill="currentColor">- <rect x="6" y="4" width="4" height="16"/><rect x="14" y="4" width="4" height="16"/>- </svg>- <svg id="anim-icon-play" width="14" height="14" viewBox="0 0 24 24" fill="currentColor" style="display:none">- <polygon points="5 3 19 12 5 21 5 3"/>- </svg>- </button>- <select id="anim-select" aria-label="Select animation"></select>- </div>- </div>-- <!-- environment -->- <div class="pg-section">- <div class="pg-section-label">Environment</div>- <div class="pill-row">- <button class="pill active" data-env="neutral">Neutral</button>- <button class="pill" data-env="legacy">Warm</button>- <button class="pill" data-env="">Dark</button>- </div>- </div>-- <!-- background -->- <div class="pg-section">- <div class="pg-section-label">Background</div>- <div class="pill-row" id="bg-pills">- <button class="pill active" data-bg="#0f0f0f">Dark</button>- <button class="pill" data-bg="#1b1b1b">Midnight</button>- <button class="pill" data-bg="#0d1a0d">Forest</button>- <button class="pill" data-bg="#1a0d0d">Ember</button>- </div>- </div>-- <!-- rotation + shadow -->- <div class="pg-section">- <div class="pg-section-label">Controls</div>- <div class="toggle-row" style="margin-bottom:0.85rem">- <span>Auto-rotate</span>- <label class="toggle">- <input type="checkbox" id="toggle-rotate" checked>- <span class="toggle-slider"></span>- </label>- </div>- <div class="toggle-row">- <span>Shadow</span>- <label class="toggle">- <input type="checkbox" id="toggle-shadow" checked>- <span class="toggle-slider"></span>- </label>- </div>- </div>-- <!-- exposure -->- <div class="pg-section">- <div class="pg-section-label">Exposure</div>- <div class="slider-row">- <input type="range" class="pg-slider" id="exposure-slider" min="0.2" max="2.5" step="0.05" value="1">- <span class="slider-val" id="exposure-val">1.0</span>- </div>- </div>-- <!-- model info -->- <div class="pg-section" id="info-section" style="display:none">- <div class="pg-section-label">Model info</div>- <dl class="info-grid">- <dt>File</dt><dd id="info-filename">—</dd>- <dt>Size</dt><dd id="info-size">—</dd>- <dt>Animations</dt><dd id="info-anims">—</dd>- </dl>- </div>-- <!-- embed -->- <div class="pg-section">- <div class="pg-section-label">Embed</div>- <textarea id="embed-code" readonly spellcheck="false"></textarea>- <p class="embed-note" id="embed-note"></p>- <div class="btn-row">- <button class="pg-btn accent" id="copy-embed">Copy snippet</button>- <button class="pg-btn" id="reset-btn">Reset</button>- </div>- </div>-- </div>- </div>-- <div id="loading-indicator" class="loading-indicator">- <div class="spinner"></div>- </div>-- <div id="footer-container"></div>- <script src="/footer.js"></script>-- <script>- (() => {- const viewer = document.getElementById('viewer');- const upload = document.getElementById('avatar-upload');- const dropzone = document.getElementById('dropzone');- const dropOverlay = document.getElementById('drop-overlay');- const fileChip = document.getElementById('file-chip');- const statusEl = document.getElementById('pg-status');- const loading = document.getElementById('loading-indicator');- const animSection = document.getElementById('anim-section');- const animSelect = document.getElementById('anim-select');- const animPlayPause= document.getElementById('anim-play-pause');- const animIconPause= document.getElementById('anim-icon-pause');- const animIconPlay = document.getElementById('anim-icon-play');- const infoSection = document.getElementById('info-section');- const infoFilename = document.getElementById('info-filename');- const infoSize = document.getElementById('info-size');- const infoAnims = document.getElementById('info-anims');- const embedCode = document.getElementById('embed-code');- const embedNote = document.getElementById('embed-note');- const copyEmbed = document.getElementById('copy-embed');- const resetBtn = document.getElementById('reset-btn');- const exposureSlider = document.getElementById('exposure-slider');- const exposureVal = document.getElementById('exposure-val');-- const DEFAULT_SRC = '/avatars/default.glb';- const DEFAULT_NAME = 'default.glb';-- let isPlaying = true;- let currentFilename = DEFAULT_NAME;- let currentFileSize = null;- let currentIsLocal = false;- let statusTimer = null;-- /* ── status ── */- const setStatus = (msg, kind = '') => {- statusEl.textContent = msg || '';- statusEl.className = kind;- if (statusTimer) clearTimeout(statusTimer);- if (msg) statusTimer = setTimeout(() => setStatus(''), 3000);- };-- /* ── loading overlay ── */- const showLoading = () => loading.classList.add('open');- const hideLoading = () => loading.classList.remove('open');-- /* ── load model ── */- const loadModel = (src, filename, fileSize) => {- showLoading();- currentFilename = filename;- currentFileSize = fileSize || null;- currentIsLocal = src.startsWith('blob:');- viewer.src = src;- dropOverlay.classList.add('hidden');- fileChip.textContent = filename;- fileChip.classList.add('loaded');- viewer.addEventListener('load', onModelLoad, { once: true });- viewer.addEventListener('error', () => {- hideLoading();- setStatus('Could not load model.', 'err');- }, { once: true });- };-- const onModelLoad = () => {- hideLoading();- updateAnimations();- updateInfo();- updateEmbed();- };-- /* ── animations ── */- const updateAnimations = () => {- const anims = viewer.availableAnimations || [];- if (anims.length === 0) {- animSection.style.display = 'none';- return;- }- animSection.style.display = '';- animSelect.innerHTML = anims.map((a, i) =>- `<option value="${i}">${a || `Animation ${i + 1}`}</option>`- ).join('');- isPlaying = true;- setAnimIcon(true);- viewer.animationName = anims[0];- };-- const setAnimIcon = (playing) => {- animIconPause.style.display = playing ? '' : 'none';- animIconPlay.style.display = playing ? 'none' : '';- };-- animPlayPause.addEventListener('click', () => {- if (isPlaying) { viewer.pause(); isPlaying = false; }- else { viewer.play(); isPlaying = true; }- setAnimIcon(isPlaying);- });-- animSelect.addEventListener('change', () => {- const anims = viewer.availableAnimations || [];- viewer.animationName = anims[animSelect.value] ?? anims[0];- if (!isPlaying) { viewer.play(); isPlaying = true; setAnimIcon(true); }- });-- /* ── model info ── */- const formatBytes = (b) => {- if (!b) return '—';- if (b < 1024) return b + ' B';- if (b < 1048576) return (b / 1024).toFixed(1) + ' KB';- return (b / 1048576).toFixed(2) + ' MB';- };-- const updateInfo = () => {- const anims = viewer.availableAnimations || [];- infoFilename.textContent = currentFilename;- infoSize.textContent = formatBytes(currentFileSize);- infoAnims.textContent = anims.length === 0 ? 'None' : anims.length;- infoSection.style.display = '';- };-- /* ── embed code ── */- const updateEmbed = () => {- if (currentIsLocal) {- embedCode.value = `<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"><\/script>\n<model-viewer\n src="YOUR_HOSTED_MODEL_URL.glb"\n camera-controls\n auto-rotate\n autoplay\n style="width:500px;height:500px"\n></model-viewer>`;- embedNote.textContent = 'Host your .glb file on a server and replace the src URL above.';- } else {- const src = `${window.location.origin}${DEFAULT_SRC}`;- embedCode.value = `<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"><\/script>\n<model-viewer\n src="${src}"\n camera-controls\n auto-rotate\n autoplay\n style="width:500px;height:500px"\n></model-viewer>`;- embedNote.textContent = '';- }- };-- updateEmbed();-- /* ── copy embed ── */- copyEmbed.addEventListener('click', async () => {- try {- await navigator.clipboard.writeText(embedCode.value);- } catch {- embedCode.select();- document.execCommand('copy');- }- setStatus('Snippet copied.', 'ok');- });-- /* ── reset ── */- resetBtn.addEventListener('click', () => {- upload.value = '';- animSection.style.display = 'none';- dropOverlay.classList.remove('hidden');- fileChip.textContent = DEFAULT_NAME;- loadModel(DEFAULT_SRC, DEFAULT_NAME, null);- });-- /* ── file upload ── */- const handleFile = (file) => {- if (!file) return;- if (!file.name.toLowerCase().endsWith('.glb')) {- setStatus('Only .glb files are supported.', 'err');- return;- }- const url = URL.createObjectURL(file);- loadModel(url, file.name, file.size);- };-- upload.addEventListener('change', (e) => handleFile(e.target.files[0]));-- /* ── drag & drop ── */- dropzone.addEventListener('dragover', (e) => {- e.preventDefault();- dropzone.classList.add('drag-over');- });- dropzone.addEventListener('dragleave', () => dropzone.classList.remove('drag-over'));- dropzone.addEventListener('drop', (e) => {- e.preventDefault();- dropzone.classList.remove('drag-over');- handleFile(e.dataTransfer.files[0]);- });-- /* ── environment pills ── */- document.querySelectorAll('[data-env]').forEach(btn => {- btn.addEventListener('click', () => {- document.querySelectorAll('[data-env]').forEach(b => b.classList.remove('active'));- btn.classList.add('active');- viewer.setAttribute('environment-image', btn.dataset.env || 'neutral');- if (btn.dataset.env === '') {- viewer.setAttribute('environment-image', 'neutral');- viewer.setAttribute('exposure', '0.35');- exposureSlider.value = '0.35';- exposureVal.textContent = '0.35';- }- });- });-- /* ── background pills ── */- document.querySelectorAll('[data-bg]').forEach(btn => {- btn.addEventListener('click', () => {- document.querySelectorAll('[data-bg]').forEach(b => b.classList.remove('active'));- btn.classList.add('active');- document.querySelector('.pg-viewer-wrap').style.background =- `radial-gradient(ellipse at 50% 30%, rgba(255,255,255,0.03) 0%, transparent 65%), ${btn.dataset.bg}`;- });- });-- /* ── auto-rotate toggle ── */- document.getElementById('toggle-rotate').addEventListener('change', function () {- if (this.checked) viewer.setAttribute('auto-rotate', '');- else viewer.removeAttribute('auto-rotate');- });-- /* ── shadow toggle ── */- document.getElementById('toggle-shadow').addEventListener('change', function () {- viewer.setAttribute('shadow-intensity', this.checked ? '1' : '0');- });-- /* ── exposure slider ── */- exposureSlider.addEventListener('input', () => {- const v = parseFloat(exposureSlider.value).toFixed(2);- exposureVal.textContent = v;- viewer.setAttribute('exposure', v);- });-- /* ── initial load ── */- showLoading();- viewer.addEventListener('load', onModelLoad, { once: true });- })();- </script>-- <script src="/brand.js" defer></script>-</body>+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/footer.css" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <link rel="stylesheet" href="/mobile.css" />+ <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>+ <script defer src="/footer-newsletter.js"></script>+ <style>+ :root {+ --bg: #0a0a0a;+ --panel: #111;+ --panel-2: #161616;+ --border: #1f1f1f;+ --border-2: #2a2a2a;+ --text: #fafafa;+ --text-2: #a1a1aa;+ --text-3: #52525b;+ --accent: #ffffff;+ --accent-dim: rgba(255, 255, 255, 0.1);+ --success: #e8e8e8;+ --err: #f87171;+ }++ html,+ body {+ margin: 0;+ background: var(--bg);+ color: var(--text);+ font-family: var(--font-body);+ -webkit-font-smoothing: antialiased;+ }+ body {+ display: flex;+ flex-direction: column;+ min-height: 100vh;+ }+ a {+ color: inherit;+ }++ /* ── header ── */+ .pg-header {+ position: sticky;+ top: 0;+ z-index: 100;+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 1rem;+ padding: 0.75rem 1.618rem;+ border-bottom: 1px solid rgba(255, 255, 255, 0.06);+ background: rgba(10, 10, 10, 0.9);+ backdrop-filter: blur(14px);+ -webkit-backdrop-filter: blur(14px);+ }+ .pg-header-left {+ display: inline-flex;+ align-items: center;+ gap: 0;+ }+ .pg-header-logo {+ height: 26px;+ width: auto;+ display: block;+ }+ .pg-header-nav {+ display: flex;+ align-items: center;+ gap: 1.25rem;+ margin-left: 1.5rem;+ }+ .pg-header-nav a {+ color: rgba(255, 255, 255, 0.4);+ text-decoration: none;+ font-size: 0.8rem;+ transition: color 0.15s;+ }+ .pg-header-nav a:hover {+ color: rgba(255, 255, 255, 0.85);+ }+ .pg-header-nav a.active {+ color: rgba(255, 255, 255, 0.85);+ }++ /* ── layout ── */+ .pg-body {+ flex: 1;+ display: grid;+ grid-template-columns: 1fr 300px;+ gap: 0;+ min-height: 0;+ }++ /* ── viewer column ── */+ .pg-viewer-col {+ display: flex;+ flex-direction: column;+ padding: 1.5rem;+ gap: 0.75rem;+ border-right: 1px solid var(--border);+ }+ .pg-viewer-wrap {+ position: relative;+ flex: 1;+ border-radius: 14px;+ overflow: hidden;+ border: 1px solid var(--border);+ background:+ radial-gradient(+ ellipse at 50% 30%,+ rgba(255, 255, 255, 0.03) 0%,+ transparent 65%+ ),+ var(--panel);+ min-height: 420px;+ }+ .pg-viewer-wrap.drag-over {+ border-color: var(--accent);+ background:+ radial-gradient(+ ellipse at 50% 30%,+ rgba(255, 255, 255, 0.08) 0%,+ transparent 65%+ ),+ var(--panel);+ }+ #viewer {+ width: 100%;+ height: 100%;+ position: absolute;+ inset: 0;+ --poster-color: transparent;+ }++ /* drop overlay shown before any model loads */+ .drop-overlay {+ position: absolute;+ inset: 0;+ z-index: 10;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 0.75rem;+ pointer-events: none;+ transition: opacity 0.2s;+ }+ .drop-overlay.hidden {+ opacity: 0;+ pointer-events: none;+ }+ .drop-icon {+ width: 56px;+ height: 56px;+ border-radius: 14px;+ border: 1.5px dashed var(--border-2);+ display: flex;+ align-items: center;+ justify-content: center;+ color: var(--text-3);+ }+ .drop-overlay p {+ margin: 0;+ font-size: 13px;+ color: var(--text-3);+ text-align: center;+ line-height: 1.5;+ }+ .drop-overlay small {+ display: block;+ font-size: 11px;+ color: var(--text-3);+ opacity: 0.6;+ margin-top: 0.1rem;+ }++ .pg-viewer-bar {+ display: flex;+ align-items: center;+ gap: 0.5rem;+ flex-wrap: wrap;+ }+ .pg-file-chip {+ font-size: 12px;+ color: var(--text-3);+ background: var(--panel);+ border: 1px solid var(--border);+ border-radius: 6px;+ padding: 0.3rem 0.6rem;+ white-space: nowrap;+ overflow: hidden;+ text-overflow: ellipsis;+ max-width: 220px;+ }+ .pg-file-chip.loaded {+ color: var(--text-2);+ border-color: var(--border-2);+ }++ /* ── controls column ── */+ .pg-controls-col {+ display: flex;+ flex-direction: column;+ overflow-y: auto;+ padding: 1.25rem;+ gap: 0;+ scrollbar-width: thin;+ scrollbar-color: var(--border) transparent;+ }++ .pg-section {+ padding: 1rem 0;+ border-bottom: 1px solid var(--border);+ }+ .pg-section:first-child {+ padding-top: 0.25rem;+ }+ .pg-section:last-child {+ border-bottom: none;+ }++ .pg-section-label {+ font-size: 10px;+ font-weight: 600;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ color: var(--text-3);+ margin: 0 0 0.75rem;+ }++ /* upload */+ .pg-upload-label {+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 0.5rem;+ padding: 0.65rem 1rem;+ border-radius: 8px;+ border: 1px dashed var(--border-2);+ color: var(--text-2);+ font-size: 12.5px;+ cursor: pointer;+ transition:+ color 0.15s,+ border-color 0.15s,+ background 0.15s;+ width: 100%;+ box-sizing: border-box;+ }+ .pg-upload-label:hover {+ color: var(--text);+ border-color: var(--text-3);+ background: var(--panel-2);+ }+ #avatar-upload {+ display: none;+ }++ /* pills */+ .pill-row {+ display: flex;+ gap: 0.35rem;+ flex-wrap: wrap;+ }+ .pill {+ padding: 0.35rem 0.75rem;+ border-radius: 6px;+ border: 1px solid var(--border-2);+ background: transparent;+ color: var(--text-2);+ font-family: inherit;+ font-size: 12px;+ cursor: pointer;+ transition:+ color 0.12s,+ border-color 0.12s,+ background 0.12s;+ }+ .pill:hover {+ color: var(--text);+ border-color: var(--text-3);+ }+ .pill.active {+ background: var(--accent-dim);+ border-color: var(--accent);+ color: var(--accent);+ }++ /* sliders */+ .pg-slider {+ width: 100%;+ height: 4px;+ border-radius: 2px;+ accent-color: var(--accent);+ cursor: pointer;+ }+ .slider-row {+ display: flex;+ align-items: center;+ gap: 0.75rem;+ }+ .slider-val {+ font-size: 11px;+ color: var(--text-3);+ min-width: 28px;+ text-align: right;+ font-variant-numeric: tabular-nums;+ }++ /* toggle */+ .toggle-row {+ display: flex;+ align-items: center;+ justify-content: space-between;+ }+ .toggle-row span {+ font-size: 12.5px;+ color: var(--text-2);+ }+ .toggle {+ position: relative;+ display: inline-block;+ width: 36px;+ height: 20px;+ }+ .toggle input {+ opacity: 0;+ width: 0;+ height: 0;+ }+ .toggle-slider {+ position: absolute;+ inset: 0;+ background: var(--border-2);+ border-radius: 20px;+ cursor: pointer;+ transition: background 0.2s;+ }+ .toggle-slider::before {+ content: '';+ position: absolute;+ height: 14px;+ width: 14px;+ left: 3px;+ top: 3px;+ background: var(--text-2);+ border-radius: 50%;+ transition:+ transform 0.2s,+ background 0.2s;+ }+ .toggle input:checked + .toggle-slider {+ background: var(--accent);+ }+ .toggle input:checked + .toggle-slider::before {+ transform: translateX(16px);+ background: #fff;+ }++ /* animations */+ .anim-controls {+ display: flex;+ gap: 0.5rem;+ align-items: center;+ }+ #anim-select {+ flex: 1;+ min-width: 0;+ padding: 0.4rem 0.6rem;+ border-radius: 8px;+ border: 1px solid var(--border-2);+ background: var(--panel-2);+ color: var(--text);+ font-family: inherit;+ font-size: 12px;+ }+ #anim-select:focus {+ outline: none;+ border-color: var(--accent);+ }+ .anim-btn {+ width: 32px;+ height: 32px;+ border-radius: 8px;+ border: 1px solid var(--border-2);+ background: var(--panel-2);+ color: var(--text-2);+ display: flex;+ align-items: center;+ justify-content: center;+ cursor: pointer;+ flex-shrink: 0;+ transition:+ color 0.12s,+ border-color 0.12s,+ background 0.12s;+ }+ .anim-btn:hover {+ color: var(--text);+ border-color: var(--text-3);+ }++ /* model info */+ .info-grid {+ display: grid;+ grid-template-columns: auto 1fr;+ gap: 0.35rem 0.75rem;+ margin: 0;+ }+ .info-grid dt {+ font-size: 11.5px;+ color: var(--text-3);+ }+ .info-grid dd {+ font-size: 11.5px;+ color: var(--text-2);+ margin: 0;+ font-variant-numeric: tabular-nums;+ }++ /* embed */+ #embed-code {+ width: 100%;+ box-sizing: border-box;+ height: 90px;+ padding: 0.65rem;+ border-radius: 8px;+ border: 1px solid var(--border-2);+ background: var(--panel-2);+ color: var(--text-2);+ font-family: var(--font-mono);+ font-size: 10.5px;+ resize: none;+ line-height: 1.5;+ }+ #embed-code:focus {+ outline: none;+ border-color: var(--accent);+ }+ .embed-note {+ font-size: 11px;+ color: var(--text-3);+ margin: 0.4rem 0 0;+ line-height: 1.45;+ }++ /* buttons */+ .pg-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 0.4rem;+ padding: 0.5rem 0.85rem;+ border-radius: 8px;+ border: 1px solid var(--border-2);+ background: var(--panel-2);+ color: var(--text-2);+ font-family: inherit;+ font-size: 12px;+ cursor: pointer;+ transition:+ color 0.12s,+ border-color 0.12s,+ background 0.12s;+ text-decoration: none;+ }+ .pg-btn:hover {+ color: var(--text);+ border-color: var(--text-3);+ }+ .pg-btn.accent {+ background: var(--accent);+ border-color: var(--accent);+ color: #0a0a0a;+ font-weight: 600;+ }+ .pg-btn.accent:hover {+ background: #e0e0e0;+ border-color: #e0e0e0;+ }+ .btn-row {+ display: flex;+ gap: 0.4rem;+ flex-wrap: wrap;+ margin-top: 0.6rem;+ }++ /* status */+ #pg-status {+ font-size: 11.5px;+ color: var(--text-3);+ min-height: 14px;+ text-align: center;+ }+ #pg-status.ok {+ color: var(--success);+ }+ #pg-status.err {+ color: var(--err);+ }++ /* loading */+ .loading-indicator {+ display: none;+ position: fixed;+ inset: 0;+ z-index: 150;+ background: rgba(0, 0, 0, 0.45);+ backdrop-filter: blur(2px);+ -webkit-backdrop-filter: blur(2px);+ align-items: center;+ justify-content: center;+ }+ .loading-indicator.open {+ display: flex;+ }+ .spinner {+ width: 44px;+ height: 44px;+ border: 3px solid rgba(255, 255, 255, 0.08);+ border-top-color: var(--accent);+ border-radius: 50%;+ animation: spin 0.85s linear infinite;+ }+ @keyframes spin {+ to {+ transform: rotate(360deg);+ }+ }++ /* responsive */+ @media (max-width: 768px) {+ .pg-body {+ grid-template-columns: 1fr;+ }+ .pg-viewer-col {+ border-right: none;+ border-bottom: 1px solid var(--border);+ padding: 1rem;+ }+ .pg-viewer-wrap {+ min-height: 300px;+ }+ .pg-controls-col {+ padding: 1rem;+ }+ .pg-header-nav {+ display: none;+ }+ }+ </style>++ <meta+ name="description"+ content="Sandbox for experimenting with agents, prompts, and 3D scenes."+ />+ <link rel="canonical" href="https://three.ws/playground" />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:title" content="Playground · three.ws" />+ <meta+ property="og:description"+ content="Sandbox for experimenting with agents, prompts, and 3D scenes."+ />+ <meta property="og:url" content="https://three.ws/playground" />+ <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="Playground · three.ws" />+ <meta+ name="twitter:description"+ content="Sandbox for experimenting with agents, prompts, and 3D scenes."+ />+ <meta name="twitter:image" content="https://three.ws/og-image.png" />+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Playground",+ "description": "Sandbox for experimenting with agents, prompts, and 3D scenes.",+ "url": "https://three.ws/playground",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head>+ <body>+ <header class="pg-header">+ <div class="pg-header-left">+ <a href="/" aria-label="three.ws home">+ <img src="/three.svg" alt="three.ws" class="pg-header-logo" />+ </a>+ <nav class="pg-header-nav" aria-label="Primary">+ <a href="/discover">Discover</a>+ <a href="/create">Create</a>+ <a href="/studio">Studio</a>+ <a href="/playground" class="active">Playground</a>+ </nav>+ </div>+ </header>++ <div class="pg-body">+ <!-- viewer column -->+ <div class="pg-viewer-col">+ <div class="pg-viewer-wrap" id="dropzone">+ <!-- shown before a model is loaded -->+ <div class="drop-overlay" id="drop-overlay">+ <div class="drop-icon">+ <svg+ width="22"+ height="22"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />+ <polyline points="17 8 12 3 7 8" />+ <line x1="12" y1="3" x2="12" y2="15" />+ </svg>+ </div>+ <p>Drop a .glb file here<small>or use the upload button →</small></p>+ </div>++ <model-viewer+ id="viewer"+ src="/avatars/default.glb"+ alt="A 3D avatar"+ ar+ ar-modes="webxr scene-viewer quick-look"+ camera-controls+ shadow-intensity="1"+ environment-image="neutral"+ exposure="1"+ auto-rotate+ autoplay+ ></model-viewer>+ </div>++ <div class="pg-viewer-bar">+ <span id="file-chip" class="pg-file-chip loaded">default.glb</span>+ <div id="pg-status"></div>+ </div>+ </div>++ <!-- controls column -->+ <div class="pg-controls-col">+ <!-- upload -->+ <div class="pg-section">+ <div class="pg-section-label">Model</div>+ <label for="avatar-upload" class="pg-upload-label">+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />+ <polyline points="17 8 12 3 7 8" />+ <line x1="12" y1="3" x2="12" y2="15" />+ </svg>+ Upload .glb file+ </label>+ <input type="file" id="avatar-upload" accept=".glb" />+ </div>++ <!-- animations -->+ <div class="pg-section" id="anim-section" style="display: none">+ <div class="pg-section-label">Animations</div>+ <div class="anim-controls">+ <button+ class="anim-btn"+ id="anim-play-pause"+ title="Play / Pause"+ aria-label="Play or pause animation"+ >+ <svg+ id="anim-icon-pause"+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="currentColor"+ >+ <rect x="6" y="4" width="4" height="16" />+ <rect x="14" y="4" width="4" height="16" />+ </svg>+ <svg+ id="anim-icon-play"+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="currentColor"+ style="display: none"+ >+ <polygon points="5 3 19 12 5 21 5 3" />+ </svg>+ </button>+ <select id="anim-select" aria-label="Select animation"></select>+ </div>+ </div>++ <!-- environment -->+ <div class="pg-section">+ <div class="pg-section-label">Environment</div>+ <div class="pill-row">+ <button class="pill active" data-env="neutral">Neutral</button>+ <button class="pill" data-env="legacy">Warm</button>+ <button class="pill" data-env="">Dark</button>+ </div>+ </div>++ <!-- background -->+ <div class="pg-section">+ <div class="pg-section-label">Background</div>+ <div class="pill-row" id="bg-pills">+ <button class="pill active" data-bg="#0f0f0f">Dark</button>+ <button class="pill" data-bg="#1b1b1b">Midnight</button>+ <button class="pill" data-bg="#0d1a0d">Forest</button>+ <button class="pill" data-bg="#1a0d0d">Ember</button>+ </div>+ </div>++ <!-- rotation + shadow -->+ <div class="pg-section">+ <div class="pg-section-label">Controls</div>+ <div class="toggle-row" style="margin-bottom: 0.85rem">+ <span>Auto-rotate</span>+ <label class="toggle">+ <input type="checkbox" id="toggle-rotate" checked />+ <span class="toggle-slider"></span>+ </label>+ </div>+ <div class="toggle-row">+ <span>Shadow</span>+ <label class="toggle">+ <input type="checkbox" id="toggle-shadow" checked />+ <span class="toggle-slider"></span>+ </label>+ </div>+ </div>++ <!-- exposure -->+ <div class="pg-section">+ <div class="pg-section-label">Exposure</div>+ <div class="slider-row">+ <input+ type="range"+ class="pg-slider"+ id="exposure-slider"+ min="0.2"+ max="2.5"+ step="0.05"+ value="1"+ />+ <span class="slider-val" id="exposure-val">1.0</span>+ </div>+ </div>++ <!-- model info -->+ <div class="pg-section" id="info-section" style="display: none">+ <div class="pg-section-label">Model info</div>+ <dl class="info-grid">+ <dt>File</dt>+ <dd id="info-filename">—</dd>+ <dt>Size</dt>+ <dd id="info-size">—</dd>+ <dt>Animations</dt>+ <dd id="info-anims">—</dd>+ </dl>+ </div>++ <!-- embed -->+ <div class="pg-section">+ <div class="pg-section-label">Embed</div>+ <textarea id="embed-code" readonly spellcheck="false"></textarea>+ <p class="embed-note" id="embed-note"></p>+ <div class="btn-row">+ <button class="pg-btn accent" id="copy-embed">Copy snippet</button>+ <button class="pg-btn" id="reset-btn">Reset</button>+ </div>+ </div>+ </div>+ </div>++ <div id="loading-indicator" class="loading-indicator">+ <div class="spinner"></div>+ </div>++ <div id="footer-container"></div>+ <script src="/footer.js"></script>++ <script>+ (() => {+ const viewer = document.getElementById('viewer');+ const upload = document.getElementById('avatar-upload');+ const dropzone = document.getElementById('dropzone');+ const dropOverlay = document.getElementById('drop-overlay');+ const fileChip = document.getElementById('file-chip');+ const statusEl = document.getElementById('pg-status');+ const loading = document.getElementById('loading-indicator');+ const animSection = document.getElementById('anim-section');+ const animSelect = document.getElementById('anim-select');+ const animPlayPause = document.getElementById('anim-play-pause');+ const animIconPause = document.getElementById('anim-icon-pause');+ const animIconPlay = document.getElementById('anim-icon-play');+ const infoSection = document.getElementById('info-section');+ const infoFilename = document.getElementById('info-filename');+ const infoSize = document.getElementById('info-size');+ const infoAnims = document.getElementById('info-anims');+ const embedCode = document.getElementById('embed-code');+ const embedNote = document.getElementById('embed-note');+ const copyEmbed = document.getElementById('copy-embed');+ const resetBtn = document.getElementById('reset-btn');+ const exposureSlider = document.getElementById('exposure-slider');+ const exposureVal = document.getElementById('exposure-val');++ const DEFAULT_SRC = '/avatars/default.glb';+ const DEFAULT_NAME = 'default.glb';++ let isPlaying = true;+ let currentFilename = DEFAULT_NAME;+ let currentFileSize = null;+ let currentIsLocal = false;+ let statusTimer = null;++ /* ── status ── */+ const setStatus = (msg, kind = '') => {+ statusEl.textContent = msg || '';+ statusEl.className = kind;+ if (statusTimer) clearTimeout(statusTimer);+ if (msg) statusTimer = setTimeout(() => setStatus(''), 3000);+ };++ /* ── loading overlay ── */+ const showLoading = () => loading.classList.add('open');+ const hideLoading = () => loading.classList.remove('open');++ /* ── load model ── */+ const loadModel = (src, filename, fileSize) => {+ showLoading();+ currentFilename = filename;+ currentFileSize = fileSize || null;+ currentIsLocal = src.startsWith('blob:');+ viewer.src = src;+ dropOverlay.classList.add('hidden');+ fileChip.textContent = filename;+ fileChip.classList.add('loaded');+ viewer.addEventListener('load', onModelLoad, { once: true });+ viewer.addEventListener(+ 'error',+ () => {+ hideLoading();+ setStatus('Could not load model.', 'err');+ },+ { once: true },+ );+ };++ const onModelLoad = () => {+ hideLoading();+ updateAnimations();+ updateInfo();+ updateEmbed();+ };++ /* ── animations ── */+ const updateAnimations = () => {+ const anims = viewer.availableAnimations || [];+ if (anims.length === 0) {+ animSection.style.display = 'none';+ return;+ }+ animSection.style.display = '';+ animSelect.innerHTML = anims+ .map((a, i) => `<option value="${i}">${a || `Animation ${i + 1}`}</option>`)+ .join('');+ isPlaying = true;+ setAnimIcon(true);+ viewer.animationName = anims[0];+ };++ const setAnimIcon = (playing) => {+ animIconPause.style.display = playing ? '' : 'none';+ animIconPlay.style.display = playing ? 'none' : '';+ };++ animPlayPause.addEventListener('click', () => {+ if (isPlaying) {+ viewer.pause();+ isPlaying = false;+ } else {+ viewer.play();+ isPlaying = true;+ }+ setAnimIcon(isPlaying);+ });++ animSelect.addEventListener('change', () => {+ const anims = viewer.availableAnimations || [];+ viewer.animationName = anims[animSelect.value] ?? anims[0];+ if (!isPlaying) {+ viewer.play();+ isPlaying = true;+ setAnimIcon(true);+ }+ });++ /* ── model info ── */+ const formatBytes = (b) => {+ if (!b) return '—';+ if (b < 1024) return b + ' B';+ if (b < 1048576) return (b / 1024).toFixed(1) + ' KB';+ return (b / 1048576).toFixed(2) + ' MB';+ };++ const updateInfo = () => {+ const anims = viewer.availableAnimations || [];+ infoFilename.textContent = currentFilename;+ infoSize.textContent = formatBytes(currentFileSize);+ infoAnims.textContent = anims.length === 0 ? 'None' : anims.length;+ infoSection.style.display = '';+ };++ /* ── embed code ── */+ const updateEmbed = () => {+ if (currentIsLocal) {+ embedCode.value = `<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>\n<model-viewer\n src="YOUR_HOSTED_MODEL_URL.glb"\n camera-controls\n auto-rotate\n autoplay\n style="width:500px;height:500px"\n></model-viewer>`;+ embedNote.textContent =+ 'Host your .glb file on a server and replace the src URL above.';+ } else {+ const src = `${window.location.origin}${DEFAULT_SRC}`;+ embedCode.value = `<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>\n<model-viewer\n src="${src}"\n camera-controls\n auto-rotate\n autoplay\n style="width:500px;height:500px"\n></model-viewer>`;+ embedNote.textContent = '';+ }+ };++ updateEmbed();++ /* ── copy embed ── */+ copyEmbed.addEventListener('click', async () => {+ try {+ await navigator.clipboard.writeText(embedCode.value);+ } catch {+ embedCode.select();+ document.execCommand('copy');+ }+ setStatus('Snippet copied.', 'ok');+ });++ /* ── reset ── */+ resetBtn.addEventListener('click', () => {+ upload.value = '';+ animSection.style.display = 'none';+ dropOverlay.classList.remove('hidden');+ fileChip.textContent = DEFAULT_NAME;+ loadModel(DEFAULT_SRC, DEFAULT_NAME, null);+ });++ /* ── file upload ── */+ const handleFile = (file) => {+ if (!file) return;+ if (!file.name.toLowerCase().endsWith('.glb')) {+ setStatus('Only .glb files are supported.', 'err');+ return;+ }+ const url = URL.createObjectURL(file);+ loadModel(url, file.name, file.size);+ };++ upload.addEventListener('change', (e) => handleFile(e.target.files[0]));++ /* ── drag & drop ── */+ dropzone.addEventListener('dragover', (e) => {+ e.preventDefault();+ dropzone.classList.add('drag-over');+ });+ dropzone.addEventListener('dragleave', () =>+ dropzone.classList.remove('drag-over'),+ );+ dropzone.addEventListener('drop', (e) => {+ e.preventDefault();+ dropzone.classList.remove('drag-over');+ handleFile(e.dataTransfer.files[0]);+ });++ /* ── environment pills ── */+ document.querySelectorAll('[data-env]').forEach((btn) => {+ btn.addEventListener('click', () => {+ document+ .querySelectorAll('[data-env]')+ .forEach((b) => b.classList.remove('active'));+ btn.classList.add('active');+ viewer.setAttribute('environment-image', btn.dataset.env || 'neutral');+ if (btn.dataset.env === '') {+ viewer.setAttribute('environment-image', 'neutral');+ viewer.setAttribute('exposure', '0.35');+ exposureSlider.value = '0.35';+ exposureVal.textContent = '0.35';+ }+ });+ });++ /* ── background pills ── */+ document.querySelectorAll('[data-bg]').forEach((btn) => {+ btn.addEventListener('click', () => {+ document+ .querySelectorAll('[data-bg]')+ .forEach((b) => b.classList.remove('active'));+ btn.classList.add('active');+ document.querySelector('.pg-viewer-wrap').style.background =+ `radial-gradient(ellipse at 50% 30%, rgba(255,255,255,0.03) 0%, transparent 65%), ${btn.dataset.bg}`;+ });+ });++ /* ── auto-rotate toggle ── */+ document.getElementById('toggle-rotate').addEventListener('change', function () {+ if (this.checked) viewer.setAttribute('auto-rotate', '');+ else viewer.removeAttribute('auto-rotate');+ });++ /* ── shadow toggle ── */+ document.getElementById('toggle-shadow').addEventListener('change', function () {+ viewer.setAttribute('shadow-intensity', this.checked ? '1' : '0');+ });++ /* ── exposure slider ── */+ exposureSlider.addEventListener('input', () => {+ const v = parseFloat(exposureSlider.value).toFixed(2);+ exposureVal.textContent = v;+ viewer.setAttribute('exposure', v);+ });++ /* ── initial load ── */+ showLoading();+ viewer.addEventListener('load', onModelLoad, { once: true });+ })();+ </script>++ <script src="/brand.js" defer></script>+ </body></html>diff --git a/pages/pricing.html b/pages/pricing.htmlindex 0a87f40a2..09c90006d 100644--- a/pages/pricing.html+++ b/pages/pricing.html@@ -1,697 +1,915 @@<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />- <title>Pricing · three.ws</title>- <meta name="description" content="Free during open beta. Pro and Enterprise plans for teams shipping 3D AI agents at scale. No view caps, no chat-turn limits." />- <meta property="og:title" content="Pricing · three.ws" />- <meta property="og:description" content="Free during open beta. Pro and Enterprise plans for teams shipping 3D AI agents at scale." />- <meta property="og:url" content="https://three.ws/pricing" />- <meta property="og:image" content="https://three.ws/og-image.png" />- <meta name="twitter:card" content="summary_large_image" />- <link rel="canonical" href="https://three.ws/pricing" />+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />+ <title>Pricing · three.ws</title>+ <meta+ name="description"+ content="Free during open beta. Pro and Enterprise plans for teams shipping 3D AI agents at scale. No view caps, no chat-turn limits."+ />+ <meta property="og:title" content="Pricing · three.ws" />+ <meta+ property="og:description"+ content="Free during open beta. Pro and Enterprise plans for teams shipping 3D AI agents at scale."+ />+ <meta property="og:url" content="https://three.ws/pricing" />+ <meta property="og:image" content="https://three.ws/og-image.png" />+ <meta name="twitter:card" content="summary_large_image" />+ <link rel="canonical" href="https://three.ws/pricing" /><link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" /><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /><link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/site.webmanifest" />- <link rel="stylesheet" href="/style.css" />- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/pricing.css" />- <link rel="stylesheet" href="/footer.css" />- <link rel="stylesheet" href="/fonts/fonts.css" />- <link rel="stylesheet" href="/mobile.css" />- <script defer src="/footer-newsletter.js"></script>-</head>-<body>- <a href="#main-content" class="h-skip-link">Skip to main content</a>-- <header><div id="nav-container"></div></header>- <script src="/nav.js"></script>-- <main id="main-content">-- <!-- ── HERO ────────────────────────────────────────────────────── -->- <section class="pricing-hero">- <div class="eyebrow"><span class="eyebrow-dot"></span><span>Pricing</span></div>- <h1>Free to start.<br/><em>Scale when you’re ready.</em></h1>- <p class="lead">Every feature is free during open beta — unlimited agents, embeds, voice, animation, and x402 payments. Pro and Enterprise unlock higher limits and dedicated support when you need them.</p>-- <div class="billing-toggle" id="billing-toggle">- <span class="label-monthly is-active" data-period="monthly">Monthly</span>- <div class="toggle-track" role="switch" aria-checked="false" aria-label="Toggle annual billing" tabindex="0">- <div class="toggle-thumb"></div>+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/pricing.css" />+ <link rel="stylesheet" href="/footer.css" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <link rel="stylesheet" href="/mobile.css" />+ <script defer src="/footer-newsletter.js"></script>+ </head>+ <body>+ <a href="#main-content" class="h-skip-link">Skip to main content</a>++ <header><div id="nav-container"></div></header>+ <script src="/nav.js"></script>++ <main id="main-content">+ <!-- ── HERO ────────────────────────────────────────────────────── -->+ <section class="pricing-hero">+ <div class="eyebrow"><span class="eyebrow-dot"></span><span>Pricing</span></div>+ <h1>Free to start.<br /><em>Scale when you’re ready.</em></h1>+ <p class="lead">+ Every feature is free during open beta — unlimited agents, embeds, voice,+ animation, and x402 payments. Pro and Enterprise unlock higher limits and+ dedicated support when you need them.+ </p>++ <div class="billing-toggle" id="billing-toggle">+ <span class="label-monthly is-active" data-period="monthly">Monthly</span>+ <div+ class="toggle-track"+ role="switch"+ aria-checked="false"+ aria-label="Toggle annual billing"+ tabindex="0"+ >+ <div class="toggle-thumb"></div>+ </div>+ <span class="label-annual" data-period="annual"+ >Annual <span class="billing-save">Save 17%</span></span+ >+ </div>+ </section>++ <!-- ── TIERS ───────────────────────────────────────────────────── -->+ <div class="pricing-tiers" id="pricing-tiers">+ <div class="pricing-tier-card" data-tier="free">+ <div class="pricing-tier-name">Free</div>+ <div class="pricing-amount">$0<sub>/forever</sub></div>+ <div class="pricing-cycle-info">No credit card required</div>+ <ul class="pricing-features">+ <li>1 agent + 1 custom avatar</li>+ <li>Unlimited <agent-3d> embeds</li>+ <li>Default rig + 200 animation clips</li>+ <li>Voice chat & lipsync</li>+ <li>Public deploy at three.ws/<name></li>+ <li>x402 paid skills (0% platform fee)</li>+ <li>Community support</li>+ </ul>+ <a href="/create" class="pricing-cta">Start free</a></div>- <span class="label-annual" data-period="annual">Annual <span class="billing-save">Save 17%</span></span>- </div>- </section>-- <!-- ── TIERS ───────────────────────────────────────────────────── -->- <div class="pricing-tiers" id="pricing-tiers">- <div class="pricing-tier-card" data-tier="free">- <div class="pricing-tier-name">Free</div>- <div class="pricing-amount">$0<sub>/forever</sub></div>- <div class="pricing-cycle-info">No credit card required</div>- <ul class="pricing-features">- <li>1 agent + 1 custom avatar</li>- <li>Unlimited <agent-3d> embeds</li>- <li>Default rig + 200 animation clips</li>- <li>Voice chat & lipsync</li>- <li>Public deploy at three.ws/<name></li>- <li>x402 paid skills (0% platform fee)</li>- <li>Community support</li>- </ul>- <a href="/create" class="pricing-cta">Start free</a>- </div>- <div class="pricing-tier-card featured" data-tier="pro">- <span class="pricing-popular">Most popular</span>- <div class="pricing-tier-name">Pro</div>- <div class="pricing-amount" data-monthly="$49" data-annual="$40">$49<sub>/mo</sub></div>- <div class="pricing-cycle-info" data-monthly="Billed monthly" data-annual="$480/yr — billed annually">Billed monthly</div>- <ul class="pricing-features">- <li>Everything in Free</li>- <li>Unlimited agents & custom avatars</li>- <li>Custom voice cloning</li>- <li>Animation studio + memory seeds</li>- <li>Custom subdomain embed</li>- <li>Priority CDN & GPU rendering</li>- <li>Advanced analytics dashboard</li>- <li>Priority email support & SLA</li>- </ul>- <a href="/login?plan=pro" class="pricing-cta primary">Choose Pro</a>- </div>+ <div class="pricing-tier-card featured" data-tier="pro">+ <span class="pricing-popular">Most popular</span>+ <div class="pricing-tier-name">Pro</div>+ <div class="pricing-amount" data-monthly="$49" data-annual="$40">+ $49<sub>/mo</sub>+ </div>+ <div+ class="pricing-cycle-info"+ data-monthly="Billed monthly"+ data-annual="$480/yr — billed annually"+ >+ Billed monthly+ </div>+ <ul class="pricing-features">+ <li>Everything in Free</li>+ <li>Unlimited agents & custom avatars</li>+ <li>Custom voice cloning</li>+ <li>Animation studio + memory seeds</li>+ <li>Custom subdomain embed</li>+ <li>Priority CDN & GPU rendering</li>+ <li>Advanced analytics dashboard</li>+ <li>Priority email support & SLA</li>+ </ul>+ <a href="/login?plan=pro" class="pricing-cta primary">Choose Pro</a>+ </div>- <div class="pricing-tier-card" data-tier="enterprise">- <div class="pricing-tier-name">Enterprise</div>- <div class="pricing-amount" style="font-size:36px;margin-top:6px;">Custom</div>- <div class="pricing-cycle-info">Volume pricing · tailored SLA</div>- <ul class="pricing-features">- <li>Everything in Pro</li>- <li>Self-hosted runtime option</li>- <li>White-label embed & API</li>- <li>On-chain identity (ERC-8004)</li>- <li>Custom rigs & licensing</li>- <li>SSO, audit logs, embed-policy whitelisting</li>- <li>Dedicated infrastructure & solutions engineer</li>- </ul>- <a href="mailto:[email protected]?subject=three.ws%20Enterprise" class="pricing-cta">Contact sales</a>- </div>- </div>-- <!-- ── 3D AVATAR CANVAS ────────────────────────────────────────── -->- <canvas class="pricing-avatar-canvas" id="avatar-canvas"></canvas>-- <!-- ── FEATURE COMPARISON ──────────────────────────────────────── -->- <section class="pricing-comparison">- <h2>Compare every feature</h2>- <table class="comparison-table">- <thead>- <tr>- <th>Feature</th>- <th>Free</th>- <th class="featured-col">Pro</th>- <th>Enterprise</th>- </tr>- </thead>- <tbody>- <tr class="section-row"><td colspan="4">Agents & avatars</td></tr>- <tr>- <td>Agents</td>- <td class="val">1</td>- <td class="val featured-col">Unlimited</td>- <td class="val">Unlimited</td>- </tr>- <tr>- <td>Custom avatars</td>- <td class="val">1</td>- <td class="val featured-col">Unlimited</td>- <td class="val">Unlimited</td>- </tr>- <tr>- <td>Animation clips</td>- <td class="val">200</td>- <td class="val featured-col">200 + custom</td>- <td class="val">Unlimited + custom rigs</td>- </tr>- <tr>- <td>Memory seeds</td>- <td><span class="check"></span></td>- <td class="featured-col"><span class="check yes"></span></td>- <td><span class="check yes"></span></td>- </tr>-- <tr class="section-row"><td colspan="4">Voice & lipsync</td></tr>- <tr>- <td>Voice chat</td>- <td><span class="check yes"></span></td>- <td class="featured-col"><span class="check yes"></span></td>- <td><span class="check yes"></span></td>- </tr>- <tr>- <td>TTS lipsync</td>- <td><span class="check yes"></span></td>- <td class="featured-col"><span class="check yes"></span></td>- <td><span class="check yes"></span></td>- </tr>- <tr>- <td>Custom voice cloning</td>- <td><span class="check"></span></td>- <td class="featured-col"><span class="check yes"></span></td>- <td><span class="check yes"></span></td>- </tr>-- <tr class="section-row"><td colspan="4">Embed & deploy</td></tr>- <tr>- <td><agent-3d> embeds</td>- <td class="val">Unlimited</td>- <td class="val featured-col">Unlimited</td>- <td class="val">Unlimited</td>- </tr>- <tr>- <td>Custom domain embeds</td>- <td><span class="check"></span></td>- <td class="featured-col"><span class="check yes"></span></td>- <td><span class="check yes"></span></td>- </tr>- <tr>- <td>White-label theming</td>- <td><span class="check"></span></td>- <td><span class="check"></span></td>- <td><span class="check yes"></span></td>- </tr>- <tr>- <td>Embed-policy whitelisting</td>- <td><span class="check"></span></td>- <td><span class="check"></span></td>- <td><span class="check yes"></span></td>- </tr>-- <tr class="section-row"><td colspan="4">Platform & infra</td></tr>- <tr>- <td>CDN delivery</td>- <td class="val">Shared</td>- <td class="val featured-col">Priority</td>- <td class="val">Dedicated</td>- </tr>- <tr>- <td>GPU rendering</td>- <td class="val">Shared</td>- <td class="val featured-col">Priority</td>- <td class="val">Dedicated</td>- </tr>- <tr>- <td>Analytics dashboard</td>- <td class="val">Basic</td>- <td class="val featured-col">Advanced</td>- <td class="val">Custom</td>- </tr>- <tr>- <td>Self-hosted runtime</td>- <td><span class="check"></span></td>- <td><span class="check"></span></td>- <td><span class="check yes"></span></td>- </tr>-- <tr class="section-row"><td colspan="4">Monetization & identity</td></tr>- <tr>- <td>x402 paid skills</td>- <td><span class="check yes"></span></td>- <td class="featured-col"><span class="check yes"></span></td>- <td><span class="check yes"></span></td>- </tr>- <tr>- <td>Platform fee</td>- <td class="val">0% (beta)</td>- <td class="val featured-col">2.9%</td>- <td class="val">Custom</td>- </tr>- <tr>- <td>On-chain identity (ERC-8004)</td>- <td><span class="check"></span></td>- <td><span class="check"></span></td>- <td><span class="check yes"></span></td>- </tr>-- <tr class="section-row"><td colspan="4">Support</td></tr>- <tr>- <td>Community (Discord)</td>- <td><span class="check yes"></span></td>- <td class="featured-col"><span class="check yes"></span></td>- <td><span class="check yes"></span></td>- </tr>- <tr>- <td>Priority email</td>- <td><span class="check"></span></td>- <td class="featured-col"><span class="check yes"></span></td>- <td><span class="check yes"></span></td>- </tr>- <tr>- <td>SLA guarantee</td>- <td><span class="check"></span></td>- <td class="featured-col"><span class="check yes"></span></td>- <td><span class="check yes"></span></td>- </tr>- <tr>- <td>Dedicated solutions engineer</td>- <td><span class="check"></span></td>- <td><span class="check"></span></td>- <td><span class="check yes"></span></td>- </tr>- <tr>- <td>SSO & audit logs</td>- <td><span class="check"></span></td>- <td><span class="check"></span></td>- <td><span class="check yes"></span></td>- </tr>- </tbody>- </table>- </section>-- <!-- ── FAQ ─────────────────────────────────────────────────────── -->- <section class="pricing-faq">- <h2>Frequently asked questions</h2>-- <details>- <summary>What's included in the free beta?</summary>- <p>Everything: unlimited embeds, voice, animation, mocap, AR, x402 paid skills, the dashboard, and the API. We're intentionally not metering anything during beta — we want to see how people actually use the platform before drawing pricing lines.</p>- </details>- <details>- <summary>What happens when beta ends?</summary>- <p>A generous free tier stays free forever for hobby and open-source projects. Paid tiers add higher agent limits, custom domains, priority infrastructure, and dedicated support. Existing users get 60 days' notice and a grandfathered transition rate.</p>- </details>- <details>- <summary>Can I monetize my own agents?</summary>- <p>Yes. The x402 protocol lets you charge per skill invocation (per chat turn, per generation, per API call) in USDC. During beta you keep 100% of revenue. After beta the platform fee is 2.9% on Pro and negotiable on Enterprise.</p>- </details>- <details id="no-crypto" open>- <summary>Do I need crypto to use three.ws?</summary>- <p>No. The web component, dashboard, and API work without a wallet. Crypto unlocks: on-chain agent identity (ERC-8004), payable skills (x402), and creator payouts. If you don't need those, the platform works like any other SaaS.</p>- </details>- <details>- <summary>Can I switch plans later?</summary>- <p>Upgrade or downgrade any time from your dashboard. When upgrading, you're prorated for the remainder of the current billing cycle. When downgrading, the change takes effect at the start of the next cycle.</p>- </details>- <details>- <summary>What about enterprise pricing?</summary>- <p>Custom subdomain, SSO, audit logs, embed-policy whitelisting, white-label themes, self-hosted runtime, and SLA. Email [email protected] and we'll set up a call within 24 hours.</p>- </details>- <details>- <summary>How does the annual discount work?</summary>- <p>Annual billing saves 17% compared to monthly. You're billed once per year at the discounted rate. If you cancel mid-year, your access continues through the end of the paid period.</p>- </details>- </section>-- <!-- ── BOTTOM CTA ──────────────────────────────────────────────── -->- <section class="pricing-bottom-cta">- <div class="cta-card">- <h2>Ready to give your<br/>AI agent a body?</h2>- <p>Free during open beta. No credit card. Two lines of HTML.</p>- <div class="cta-row">- <a href="/create" class="pricing-cta primary">Build your first agent</a>- <a href="/docs" class="pricing-cta">Read the docs</a>+ <div class="pricing-tier-card" data-tier="enterprise">+ <div class="pricing-tier-name">Enterprise</div>+ <div class="pricing-amount" style="font-size: 36px; margin-top: 6px">+ Custom+ </div>+ <div class="pricing-cycle-info">Volume pricing · tailored SLA</div>+ <ul class="pricing-features">+ <li>Everything in Pro</li>+ <li>Self-hosted runtime option</li>+ <li>White-label embed & API</li>+ <li>On-chain identity (ERC-8004)</li>+ <li>Custom rigs & licensing</li>+ <li>SSO, audit logs, embed-policy whitelisting</li>+ <li>Dedicated infrastructure & solutions engineer</li>+ </ul>+ <a+ href="mailto:[email protected]?subject=three.ws%20Enterprise"+ class="pricing-cta"+ >Contact sales</a+ ></div></div>- </section>-- <!-- ── FOOTER ──────────────────────────────────────────────────── -->- <footer class="h-footer h-footer-horizon">- <div class="h-footer-glow-line" aria-hidden="true"></div>- <div class="h-footer-floor" aria-hidden="true"></div>- <div class="h-footer-haze" aria-hidden="true"></div>- <div class="h-footer-watermark" aria-hidden="true">three.ws</div>-- <div class="h-footer-cta">- <div class="h-footer-newsletter">- <h3>Stay in the loop</h3>- <p>Get updates on new features, agent tooling, and protocol changes.</p>- <form class="h-footer-newsletter-form" data-newsletter-form novalidate>- <input- type="email"- class="h-footer-newsletter-input"- name="email"- placeholder="Enter your email"- aria-label="Email address"- autocomplete="email"- required- />- <button type="submit" class="h-footer-newsletter-btn" aria-label="Subscribe">- <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" d="M2 8h11m0 0L9 4m4 4l-4 4" /></svg>- </button>- </form>- <p class="h-footer-newsletter-msg" data-newsletter-msg aria-live="polite"></p>- </div>- <div class="h-footer-community">- <h3>Join the community</h3>- <p>Follow along for builds, demos, and conversations with the team.</p>- <a class="h-footer-community-btn" href="https://x.com/trythreews" target="_blank" rel="noopener noreferrer">- <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" /></svg>- Follow on X- </a>++ <!-- ── 3D AVATAR CANVAS ────────────────────────────────────────── -->+ <canvas class="pricing-avatar-canvas" id="avatar-canvas"></canvas>++ <!-- ── FEATURE COMPARISON ──────────────────────────────────────── -->+ <section class="pricing-comparison">+ <h2>Compare every feature</h2>+ <table class="comparison-table">+ <thead>+ <tr>+ <th>Feature</th>+ <th>Free</th>+ <th class="featured-col">Pro</th>+ <th>Enterprise</th>+ </tr>+ </thead>+ <tbody>+ <tr class="section-row">+ <td colspan="4">Agents & avatars</td>+ </tr>+ <tr>+ <td>Agents</td>+ <td class="val">1</td>+ <td class="val featured-col">Unlimited</td>+ <td class="val">Unlimited</td>+ </tr>+ <tr>+ <td>Custom avatars</td>+ <td class="val">1</td>+ <td class="val featured-col">Unlimited</td>+ <td class="val">Unlimited</td>+ </tr>+ <tr>+ <td>Animation clips</td>+ <td class="val">200</td>+ <td class="val featured-col">200 + custom</td>+ <td class="val">Unlimited + custom rigs</td>+ </tr>+ <tr>+ <td>Memory seeds</td>+ <td><span class="check"></span></td>+ <td class="featured-col"><span class="check yes"></span></td>+ <td><span class="check yes"></span></td>+ </tr>++ <tr class="section-row">+ <td colspan="4">Voice & lipsync</td>+ </tr>+ <tr>+ <td>Voice chat</td>+ <td><span class="check yes"></span></td>+ <td class="featured-col"><span class="check yes"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ <tr>+ <td>TTS lipsync</td>+ <td><span class="check yes"></span></td>+ <td class="featured-col"><span class="check yes"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ <tr>+ <td>Custom voice cloning</td>+ <td><span class="check"></span></td>+ <td class="featured-col"><span class="check yes"></span></td>+ <td><span class="check yes"></span></td>+ </tr>++ <tr class="section-row">+ <td colspan="4">Embed & deploy</td>+ </tr>+ <tr>+ <td><agent-3d> embeds</td>+ <td class="val">Unlimited</td>+ <td class="val featured-col">Unlimited</td>+ <td class="val">Unlimited</td>+ </tr>+ <tr>+ <td>Custom domain embeds</td>+ <td><span class="check"></span></td>+ <td class="featured-col"><span class="check yes"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ <tr>+ <td>White-label theming</td>+ <td><span class="check"></span></td>+ <td><span class="check"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ <tr>+ <td>Embed-policy whitelisting</td>+ <td><span class="check"></span></td>+ <td><span class="check"></span></td>+ <td><span class="check yes"></span></td>+ </tr>++ <tr class="section-row">+ <td colspan="4">Platform & infra</td>+ </tr>+ <tr>+ <td>CDN delivery</td>+ <td class="val">Shared</td>+ <td class="val featured-col">Priority</td>+ <td class="val">Dedicated</td>+ </tr>+ <tr>+ <td>GPU rendering</td>+ <td class="val">Shared</td>+ <td class="val featured-col">Priority</td>+ <td class="val">Dedicated</td>+ </tr>+ <tr>+ <td>Analytics dashboard</td>+ <td class="val">Basic</td>+ <td class="val featured-col">Advanced</td>+ <td class="val">Custom</td>+ </tr>+ <tr>+ <td>Self-hosted runtime</td>+ <td><span class="check"></span></td>+ <td><span class="check"></span></td>+ <td><span class="check yes"></span></td>+ </tr>++ <tr class="section-row">+ <td colspan="4">Monetization & identity</td>+ </tr>+ <tr>+ <td>x402 paid skills</td>+ <td><span class="check yes"></span></td>+ <td class="featured-col"><span class="check yes"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ <tr>+ <td>Platform fee</td>+ <td class="val">0% (beta)</td>+ <td class="val featured-col">2.9%</td>+ <td class="val">Custom</td>+ </tr>+ <tr>+ <td>On-chain identity (ERC-8004)</td>+ <td><span class="check"></span></td>+ <td><span class="check"></span></td>+ <td><span class="check yes"></span></td>+ </tr>++ <tr class="section-row">+ <td colspan="4">Support</td>+ </tr>+ <tr>+ <td>Community (Discord)</td>+ <td><span class="check yes"></span></td>+ <td class="featured-col"><span class="check yes"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ <tr>+ <td>Priority email</td>+ <td><span class="check"></span></td>+ <td class="featured-col"><span class="check yes"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ <tr>+ <td>SLA guarantee</td>+ <td><span class="check"></span></td>+ <td class="featured-col"><span class="check yes"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ <tr>+ <td>Dedicated solutions engineer</td>+ <td><span class="check"></span></td>+ <td><span class="check"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ <tr>+ <td>SSO & audit logs</td>+ <td><span class="check"></span></td>+ <td><span class="check"></span></td>+ <td><span class="check yes"></span></td>+ </tr>+ </tbody>+ </table>+ </section>++ <!-- ── FAQ ─────────────────────────────────────────────────────── -->+ <section class="pricing-faq">+ <h2>Frequently asked questions</h2>++ <details>+ <summary>What's included in the free beta?</summary>+ <p>+ Everything: unlimited embeds, voice, animation, mocap, AR, x402 paid skills,+ the dashboard, and the API. We're intentionally not metering anything during+ beta — we want to see how people actually use the platform before drawing+ pricing lines.+ </p>+ </details>+ <details>+ <summary>What happens when beta ends?</summary>+ <p>+ A generous free tier stays free forever for hobby and open-source projects.+ Paid tiers add higher agent limits, custom domains, priority infrastructure,+ and dedicated support. Existing users get 60 days' notice and a+ grandfathered transition rate.+ </p>+ </details>+ <details>+ <summary>Can I monetize my own agents?</summary>+ <p>+ Yes. The x402 protocol lets you charge per skill invocation (per chat turn,+ per generation, per API call) in USDC. During beta you keep 100% of revenue.+ After beta the platform fee is 2.9% on Pro and negotiable on Enterprise.+ </p>+ </details>+ <details id="no-crypto" open>+ <summary>Do I need crypto to use three.ws?</summary>+ <p>+ No. The web component, dashboard, and API work without a wallet. Crypto+ unlocks: on-chain agent identity (ERC-8004), payable skills (x402), and+ creator payouts. If you don't need those, the platform works like any other+ SaaS.+ </p>+ </details>+ <details>+ <summary>Can I switch plans later?</summary>+ <p>+ Upgrade or downgrade any time from your dashboard. When upgrading, you're+ prorated for the remainder of the current billing cycle. When downgrading,+ the change takes effect at the start of the next cycle.+ </p>+ </details>+ <details>+ <summary>What about enterprise pricing?</summary>+ <p>+ Custom subdomain, SSO, audit logs, embed-policy whitelisting, white-label+ themes, self-hosted runtime, and SLA. Email [email protected] and we'll set up+ a call within 24 hours.+ </p>+ </details>+ <details>+ <summary>How does the annual discount work?</summary>+ <p>+ Annual billing saves 17% compared to monthly. You're billed once per year at+ the discounted rate. If you cancel mid-year, your access continues through+ the end of the paid period.+ </p>+ </details>+ </section>++ <!-- ── BOTTOM CTA ──────────────────────────────────────────────── -->+ <section class="pricing-bottom-cta">+ <div class="cta-card">+ <h2>Ready to give your<br />AI agent a body?</h2>+ <p>Free during open beta. No credit card. Two lines of HTML.</p>+ <div class="cta-row">+ <a href="/create" class="pricing-cta primary">Build your first agent</a>+ <a href="/docs" class="pricing-cta">Read the docs</a>+ </div></div>- </div>- <div class="h-footer-inner">- <div class="h-footer-brand-col">- <div class="h-footer-brand">- <img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" />- <span class="wordmark-dot" aria-hidden="true"></span>- <span>three.ws</span>+ </section>++ <!-- ── FOOTER ──────────────────────────────────────────────────── -->+ <footer class="h-footer h-footer-horizon">+ <div class="h-footer-glow-line" aria-hidden="true"></div>+ <div class="h-footer-floor" aria-hidden="true"></div>+ <div class="h-footer-haze" aria-hidden="true"></div>+ <div class="h-footer-watermark" aria-hidden="true">three.ws</div>++ <div class="h-footer-cta">+ <div class="h-footer-newsletter">+ <h3>Stay in the loop</h3>+ <p>Get updates on new features, agent tooling, and protocol changes.</p>+ <form class="h-footer-newsletter-form" data-newsletter-form novalidate>+ <input+ type="email"+ class="h-footer-newsletter-input"+ name="email"+ placeholder="Enter your email"+ aria-label="Email address"+ autocomplete="email"+ required+ />+ <button+ type="submit"+ class="h-footer-newsletter-btn"+ aria-label="Subscribe"+ >+ <svg viewBox="0 0 16 16" aria-hidden="true">+ <path+ fill="none"+ stroke="currentColor"+ stroke-width="1.6"+ stroke-linecap="round"+ stroke-linejoin="round"+ d="M2 8h11m0 0L9 4m4 4l-4 4"+ />+ </svg>+ </button>+ </form>+ <p+ class="h-footer-newsletter-msg"+ data-newsletter-msg+ aria-live="polite"+ ></p></div>- <p class="h-footer-tagline">Give your AI a body.</p>- <div class="h-footer-socials">- <a class="h-footer-social" href="https://x.com/trythreews" target="_blank" rel="noopener noreferrer" aria-label="three.ws on X">- <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" /></svg>- </a>- <a class="h-footer-social" href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener noreferrer" aria-label="three.ws on GitHub">- <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z" /></svg>+ <div class="h-footer-community">+ <h3>Join the community</h3>+ <p>Follow along for builds, demos, and conversations with the team.</p>+ <a+ class="h-footer-community-btn"+ href="https://x.com/trythreews"+ target="_blank"+ rel="noopener noreferrer"+ >+ <svg viewBox="0 0 24 24" aria-hidden="true">+ <path+ fill="currentColor"+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"+ />+ </svg>+ Follow on X</a></div></div>- <nav class="h-footer-links" aria-label="Footer">- <div class="h-footer-link-col">- <h4 class="h-footer-link-heading">Product</h4>- <a href="/create">Create</a>- <a href="/marketplace">Marketplace</a>- <a href="/studio">Studio</a>- <a href="/widgets">Widgets</a>- <a href="/pricing">Pricing</a>+ <div class="h-footer-inner">+ <div class="h-footer-brand-col">+ <div class="h-footer-brand">+ <img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" />+ <span class="wordmark-dot" aria-hidden="true"></span>+ <span>three.ws</span>+ </div>+ <p class="h-footer-tagline">Give your AI a body.</p>+ <div class="h-footer-socials">+ <a+ class="h-footer-social"+ href="https://x.com/trythreews"+ target="_blank"+ rel="noopener noreferrer"+ aria-label="three.ws on X"+ >+ <svg viewBox="0 0 24 24" aria-hidden="true">+ <path+ fill="currentColor"+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"+ />+ </svg>+ </a>+ <a+ class="h-footer-social"+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener noreferrer"+ aria-label="three.ws on GitHub"+ >+ <svg viewBox="0 0 16 16" aria-hidden="true">+ <path+ fill="currentColor"+ d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"+ />+ </svg>+ </a>+ </div></div>- <div class="h-footer-link-col">- <h4 class="h-footer-link-heading">Developers</h4>- <a href="/docs">Docs</a>- <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener noreferrer">GitHub</a>- <a href="/bazaar">x402 Bazaar</a>- <a href="https://developers.metaplex.com/core" target="_blank" rel="noopener noreferrer">Metaplex Core</a>- </div>- <div class="h-footer-link-col">- <h4 class="h-footer-link-heading">Company</h4>- <a href="/blog">Blog</a>- <a href="/community">Community</a>- <a href="/features">Features</a>- <a href="/dashboard">Dashboard</a>+ <nav class="h-footer-links" aria-label="Footer">+ <div class="h-footer-link-col">+ <h4 class="h-footer-link-heading">Product</h4>+ <a href="/create">Create</a>+ <a href="/marketplace">Marketplace</a>+ <a href="/studio">Studio</a>+ <a href="/widgets">Widgets</a>+ <a href="/pricing">Pricing</a>+ </div>+ <div class="h-footer-link-col">+ <h4 class="h-footer-link-heading">Developers</h4>+ <a href="/docs">Docs</a>+ <a+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener noreferrer"+ >GitHub</a+ >+ <a href="/bazaar">x402 Bazaar</a>+ <a+ href="https://developers.metaplex.com/core"+ target="_blank"+ rel="noopener noreferrer"+ >Metaplex Core</a+ >+ </div>+ <div class="h-footer-link-col">+ <h4 class="h-footer-link-heading">Company</h4>+ <a href="/blog">Blog</a>+ <a href="/community">Community</a>+ <a href="/features">Features</a>+ <a href="/dashboard">Dashboard</a>+ </div>+ <div class="h-footer-link-col">+ <h4 class="h-footer-link-heading">Legal</h4>+ <a href="/legal/privacy">Privacy</a>+ <a href="/legal/tos">Terms</a>+ </div>+ </nav>+ </div>+ <div class="h-footer-bottom">+ <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>+ <div class="h-footer-badges">+ <a href="/pay" class="h-footer-badge" aria-label="Built with x402 payments">+ <svg viewBox="0 0 16 16" aria-hidden="true">+ <circle+ cx="8"+ cy="8"+ r="7"+ fill="none"+ stroke="currentColor"+ stroke-width="1.3"+ />+ <path+ d="M8 4v8M5.5 6h3.5a1.5 1.5 0 010 3H6.5a1.5 1.5 0 000 3H11"+ fill="none"+ stroke="currentColor"+ stroke-width="1.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ />+ </svg>+ Built with x402+ </a>+ <span class="h-footer-badge" aria-label="All systems operational">+ <span class="h-footer-status-dot"></span>+ All systems operational+ </span></div>- <div class="h-footer-link-col">- <h4 class="h-footer-link-heading">Legal</h4>- <a href="/legal/privacy">Privacy</a>- <a href="/legal/tos">Terms</a>+ <div class="h-footer-legal-links">+ <a href="/legal/privacy">Privacy Policy</a>+ <a href="/legal/tos">Terms of Use</a></div>- </nav>- </div>- <div class="h-footer-bottom">- <p class="h-footer-legal">© 2026 three.ws — All rights reserved.</p>- <div class="h-footer-badges">- <a href="/pay" class="h-footer-badge" aria-label="Built with x402 payments">- <svg viewBox="0 0 16 16" aria-hidden="true">- <circle cx="8" cy="8" r="7" fill="none" stroke="currentColor" stroke-width="1.3"/>- <path d="M8 4v8M5.5 6h3.5a1.5 1.5 0 010 3H6.5a1.5 1.5 0 000 3H11" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>- </svg>- Built with x402- </a>- <span class="h-footer-badge" aria-label="All systems operational">- <span class="h-footer-status-dot"></span>- All systems operational- </span></div>- <div class="h-footer-legal-links">- <a href="/legal/privacy">Privacy Policy</a>- <a href="/legal/tos">Terms of Use</a>- </div>- </div>- </footer>- </main>-- <!-- ── Billing toggle ──────────────────────────────────────────────── -->- <script>- (function () {- const toggle = document.getElementById('billing-toggle');- if (!toggle) return;- const track = toggle.querySelector('.toggle-track');- const labelM = toggle.querySelector('.label-monthly');- const labelA = toggle.querySelector('.label-annual');- let annual = false;-- function apply() {- toggle.classList.toggle('annual', annual);- track.setAttribute('aria-checked', String(annual));- labelM.classList.toggle('is-active', !annual);- labelA.classList.toggle('is-active', annual);-- document.querySelectorAll('[data-monthly][data-annual]').forEach(el => {- const val = annual ? el.dataset.annual : el.dataset.monthly;- if (el.classList.contains('pricing-amount')) {- el.innerHTML = val + '<sub>/mo</sub>';- } else {- el.textContent = val;+ </footer>+ </main>++ <!-- ── Billing toggle ──────────────────────────────────────────────── -->+ <script>+ (function () {+ const toggle = document.getElementById('billing-toggle');+ if (!toggle) return;+ const track = toggle.querySelector('.toggle-track');+ const labelM = toggle.querySelector('.label-monthly');+ const labelA = toggle.querySelector('.label-annual');+ let annual = false;++ function apply() {+ toggle.classList.toggle('annual', annual);+ track.setAttribute('aria-checked', String(annual));+ labelM.classList.toggle('is-active', !annual);+ labelA.classList.toggle('is-active', annual);++ document.querySelectorAll('[data-monthly][data-annual]').forEach((el) => {+ const val = annual ? el.dataset.annual : el.dataset.monthly;+ if (el.classList.contains('pricing-amount')) {+ el.innerHTML = val + '<sub>/mo</sub>';+ } else {+ el.textContent = val;+ }+ // Crossfade the figure on cycle flip (no-op under reduced motion —+ // the .price-swap animation is disabled in pricing.css).+ el.classList.remove('price-swap');+ void el.offsetWidth; /* restart the animation */+ el.classList.add('price-swap');+ });}- });- }-- track.addEventListener('click', () => { annual = !annual; apply(); });- track.addEventListener('keydown', e => {- if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); annual = !annual; apply(); }- });- labelM.addEventListener('click', () => { annual = false; apply(); });- labelA.addEventListener('click', () => { annual = true; apply(); });- })();- </script>-- <!-- ── 3D Avatar on pricing tiers ──────────────────────────────────── -->- <script type="module">- import * as THREE from 'three';- import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';-- const canvas = document.getElementById('avatar-canvas');- const tierCards = [...document.querySelectorAll('.pricing-tier-card')];- if (!canvas || !tierCards.length) throw new Error('Missing pricing DOM');-- const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });- renderer.setPixelRatio(Math.min(devicePixelRatio, 2));- renderer.outputColorSpace = THREE.SRGBColorSpace;- renderer.toneMapping = THREE.ACESFilmicToneMapping;- renderer.toneMappingExposure = 1.1;-- const scene = new THREE.Scene();- const PX_PER_UNIT = 120;- const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0.1, 100);- camera.position.z = 10;-- function updateFrustum() {- const hw = window.innerWidth / PX_PER_UNIT / 2;- const hh = window.innerHeight / PX_PER_UNIT / 2;- camera.left = -hw; camera.right = hw;- camera.top = hh; camera.bottom = -hh;- camera.updateProjectionMatrix();- }-- const _v3 = new THREE.Vector3();- function domToWorld(sx, sy) {- _v3.set((sx / window.innerWidth) * 2 - 1, -(sy / window.innerHeight) * 2 + 1, 0);- _v3.unproject(camera);- return { x: _v3.x, y: _v3.y };- }-- let avatar = null, mixer = null, rootBone = null, baseRootPos = null;- let phase = 'loading';- let activeTier = null;-- function resize() {- renderer.setSize(window.innerWidth, window.innerHeight, false);- updateFrustum();- if (avatar && activeTier && phase === 'idle') {- const t = standOnTopOf(activeTier);- avatar.position.set(t.x, t.y, 0);- }- }- window.addEventListener('resize', resize);- resize();-- scene.add(new THREE.AmbientLight(0xffffff, 0.6));- const key = new THREE.DirectionalLight(0xfff4dc, 2.0); key.position.set(3, 6, 5); scene.add(key);- const rim = new THREE.DirectionalLight(0x4060ff, 0.6); rim.position.set(-4, 3, -2); scene.add(rim);- const fill = new THREE.DirectionalLight(0xffeedd, 0.4); fill.position.set(0, 2, 7); scene.add(fill);-- const actions = {};- let currentAction = null;- const FADE_S = 0.3;-- function setAnimation(name, { loop = true, hold = false } = {}) {- const next = actions[name];- if (!next || next === currentAction) return;- next.reset();- next.setLoop(loop ? THREE.LoopRepeat : THREE.LoopOnce, loop ? Infinity : 1);- next.clampWhenFinished = hold;- if (currentAction) next.crossFadeFrom(currentAction, FADE_S, false).play();- else next.fadeIn(FADE_S).play();- currentAction = next;- }-- function standOnTopOf(tierEl) {- const r = tierEl.getBoundingClientRect();- return domToWorld(r.left + r.width / 2, r.top);- }-- let walkT = 0, walkStart = null, walkEnd = null, walkDur = 0.85, walkPeakRise = 0;- let onArrival = null;- const WALK_SPEED = 5;-- function smoothstep(t) { return t * t * (3 - 2 * t); }-- function beginMove(tierEl) {- if (activeTier) activeTier.classList.remove('is-active');- activeTier = tierEl;- activeTier.classList.add('is-active');- }-- function walkToTier(tierEl) {- if (!avatar || tierEl === activeTier) return;- beginMove(tierEl);- phase = 'walking';- walkT = 0;- walkStart = { x: avatar.position.x, y: avatar.position.y };- walkEnd = standOnTopOf(tierEl);- const dx = Math.abs(walkEnd.x - walkStart.x);- walkDur = Math.max(0.4, dx / WALK_SPEED);- const minX = Math.min(walkStart.x, walkEnd.x);- const maxX = Math.max(walkStart.x, walkEnd.x);- const baseY = Math.max(walkStart.y, walkEnd.y);- let peakY = baseY;- for (const tt of tierCards) {- const tp = standOnTopOf(tt);- if (tp.x > minX && tp.x < maxX && tp.y > peakY) peakY = tp.y;- }- walkPeakRise = peakY - baseY;- setAnimation('walk', { loop: true });- const dir = Math.sign(walkEnd.x - walkStart.x) || 0;- avatar.rotation.y = dir * (Math.PI / 2);- }-- const CTA_REACTION = { free: 'wave', pro: 'av-celebrating', enterprise: 'av-brag-claps' };- const CTA_REACTION_MAX_MS = 3500;-- function landOnTier() {- phase = 'idle';- const snap = standOnTopOf(activeTier);- avatar.position.set(snap.x, snap.y, 0);- avatar.rotation.y = 0;- setAnimation('idle', { loop: true });- if (onArrival) { const cb = onArrival; onArrival = null; setTimeout(cb, 300); }- }-- let hoverTimer = null, hoverPendingTier = null;- function scheduleMove(tierEl) {- if (!tierEl) { clearTimeout(hoverTimer); hoverPendingTier = null; return; }- if (tierEl === activeTier) { clearTimeout(hoverTimer); hoverPendingTier = null; return; }- if (tierEl === hoverPendingTier) return;- clearTimeout(hoverTimer);- hoverPendingTier = tierEl;- hoverTimer = setTimeout(() => {- hoverPendingTier = null;- if (phase === 'walking') { setTimeout(() => scheduleMove(tierEl), 200); }- else walkToTier(tierEl);- }, 120);- }-- function tierAtPoint(cx, cy) {- for (const t of tierCards) {- const r = t.getBoundingClientRect();- if (cx >= r.left && cx <= r.right && cy >= r.top && cy <= r.bottom) return t;- }- return null;- }-- const tiersGrid = document.getElementById('pricing-tiers');- tiersGrid.addEventListener('mousemove', e => scheduleMove(tierAtPoint(e.clientX, e.clientY)));- tiersGrid.addEventListener('mouseleave', () => scheduleMove(null));-- document.querySelectorAll('.pricing-cta').forEach(cta => {- const tierEl = cta.closest('.pricing-tier-card');- if (!tierEl) return;- cta.addEventListener('click', e => {- if (!avatar) return;- const tierName = tierEl.dataset.tier;- const reactionClip = CTA_REACTION[tierName] ?? 'wave';- const fireReaction = () => {- setAnimation(reactionClip, { loop: false, hold: true });- const clipDur = actions[reactionClip]?.getClip().duration ?? 2.0;- setTimeout(() => { if (phase === 'idle') setAnimation('idle', { loop: true }); }, Math.min(clipDur * 1000, CTA_REACTION_MAX_MS));- };- if (tierEl === activeTier && phase === 'idle') { fireReaction(); }- else { onArrival = fireReaction; if (tierEl !== activeTier) walkToTier(tierEl); }- });- });-- let mouseNx = 0, mouseNy = 0;- window.addEventListener('mousemove', e => {- mouseNx = (e.clientX / window.innerWidth) * 2 - 1;- mouseNy = (e.clientY / window.innerHeight) * 2 - 1;- });-- const ro = new ResizeObserver(() => {- if (avatar && activeTier && phase === 'idle') {- const t = standOnTopOf(activeTier);- avatar.position.set(t.x, t.y, 0);- }- });- tierCards.forEach(t => ro.observe(t));-- const CLIPS = ['idle', 'walk', 'wave', 'av-celebrating', 'av-brag-claps'];-- new GLTFLoader().load('/avatars/cz.glb', gltf => {- avatar = gltf.scene;- avatar.traverse(n => {- if (!rootBone && /^(Hips|Root|mixamorig:?Hips)$/i.test(n.name)) rootBone = n;- });- avatar.rotation.y = 0;- scene.add(avatar);- mixer = new THREE.AnimationMixer(avatar);-- Promise.all(CLIPS.map(name =>- fetch(`/animations/clips/${name}.json`).then(r => r.json())- )).then(jsons => {- CLIPS.forEach((name, i) => { actions[name] = mixer.clipAction(THREE.AnimationClip.parse(jsons[i])); });- if (rootBone) baseRootPos = rootBone.position.clone();- const _r = renderer.render.bind(renderer);- renderer.render = (sc, cam) => {- try { if (rootBone && baseRootPos) rootBone.position.copy(baseRootPos); } catch (_) {}- _r(sc, cam);++ track.addEventListener('click', () => {+ annual = !annual;+ apply();+ });+ track.addEventListener('keydown', (e) => {+ if (e.key === ' ' || e.key === 'Enter') {+ e.preventDefault();+ annual = !annual;+ apply();+ }+ });+ labelM.addEventListener('click', () => {+ annual = false;+ apply();+ });+ labelA.addEventListener('click', () => {+ annual = true;+ apply();+ });+ })();+ </script>++ <!-- ── 3D Avatar on pricing tiers ──────────────────────────────────── -->+ <script type="module">+ import * as THREE from 'three';+ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';++ const canvas = document.getElementById('avatar-canvas');+ const tierCards = [...document.querySelectorAll('.pricing-tier-card')];+ if (!canvas || !tierCards.length) throw new Error('Missing pricing DOM');++ const renderer = new THREE.WebGLRenderer({ canvas, antialias: true, alpha: true });+ renderer.setPixelRatio(Math.min(devicePixelRatio, 2));+ renderer.outputColorSpace = THREE.SRGBColorSpace;+ renderer.toneMapping = THREE.ACESFilmicToneMapping;+ renderer.toneMappingExposure = 1.1;++ const scene = new THREE.Scene();+ const PX_PER_UNIT = 120;+ const camera = new THREE.OrthographicCamera(-1, 1, 1, -1, 0.1, 100);+ camera.position.z = 10;++ function updateFrustum() {+ const hw = window.innerWidth / PX_PER_UNIT / 2;+ const hh = window.innerHeight / PX_PER_UNIT / 2;+ camera.left = -hw;+ camera.right = hw;+ camera.top = hh;+ camera.bottom = -hh;+ camera.updateProjectionMatrix();+ }++ const _v3 = new THREE.Vector3();+ function domToWorld(sx, sy) {+ _v3.set((sx / window.innerWidth) * 2 - 1, -(sy / window.innerHeight) * 2 + 1, 0);+ _v3.unproject(camera);+ return { x: _v3.x, y: _v3.y };+ }++ let avatar = null,+ mixer = null,+ rootBone = null,+ baseRootPos = null;+ let phase = 'loading';+ let activeTier = null;++ function resize() {+ renderer.setSize(window.innerWidth, window.innerHeight, false);+ updateFrustum();+ if (avatar && activeTier && phase === 'idle') {+ const t = standOnTopOf(activeTier);+ avatar.position.set(t.x, t.y, 0);+ }+ }+ window.addEventListener('resize', resize);+ resize();++ scene.add(new THREE.AmbientLight(0xffffff, 0.6));+ const key = new THREE.DirectionalLight(0xfff4dc, 2.0);+ key.position.set(3, 6, 5);+ scene.add(key);+ const rim = new THREE.DirectionalLight(0x4060ff, 0.6);+ rim.position.set(-4, 3, -2);+ scene.add(rim);+ const fill = new THREE.DirectionalLight(0xffeedd, 0.4);+ fill.position.set(0, 2, 7);+ scene.add(fill);++ const actions = {};+ let currentAction = null;+ const FADE_S = 0.3;++ function setAnimation(name, { loop = true, hold = false } = {}) {+ const next = actions[name];+ if (!next || next === currentAction) return;+ next.reset();+ next.setLoop(loop ? THREE.LoopRepeat : THREE.LoopOnce, loop ? Infinity : 1);+ next.clampWhenFinished = hold;+ if (currentAction) next.crossFadeFrom(currentAction, FADE_S, false).play();+ else next.fadeIn(FADE_S).play();+ currentAction = next;+ }++ function standOnTopOf(tierEl) {+ const r = tierEl.getBoundingClientRect();+ return domToWorld(r.left + r.width / 2, r.top);+ }++ let walkT = 0,+ walkStart = null,+ walkEnd = null,+ walkDur = 0.85,+ walkPeakRise = 0;+ let onArrival = null;+ const WALK_SPEED = 5;++ function smoothstep(t) {+ return t * t * (3 - 2 * t);+ }++ function beginMove(tierEl) {+ if (activeTier) activeTier.classList.remove('is-active');+ activeTier = tierEl;+ activeTier.classList.add('is-active');+ }++ function walkToTier(tierEl) {+ if (!avatar || tierEl === activeTier) return;+ beginMove(tierEl);+ phase = 'walking';+ walkT = 0;+ walkStart = { x: avatar.position.x, y: avatar.position.y };+ walkEnd = standOnTopOf(tierEl);+ const dx = Math.abs(walkEnd.x - walkStart.x);+ walkDur = Math.max(0.4, dx / WALK_SPEED);+ const minX = Math.min(walkStart.x, walkEnd.x);+ const maxX = Math.max(walkStart.x, walkEnd.x);+ const baseY = Math.max(walkStart.y, walkEnd.y);+ let peakY = baseY;+ for (const tt of tierCards) {+ const tp = standOnTopOf(tt);+ if (tp.x > minX && tp.x < maxX && tp.y > peakY) peakY = tp.y;+ }+ walkPeakRise = peakY - baseY;+ setAnimation('walk', { loop: true });+ const dir = Math.sign(walkEnd.x - walkStart.x) || 0;+ avatar.rotation.y = dir * (Math.PI / 2);+ }++ const CTA_REACTION = {+ free: 'wave',+ pro: 'av-celebrating',+ enterprise: 'av-brag-claps',};+ const CTA_REACTION_MAX_MS = 3500;++ function landOnTier() {+ phase = 'idle';+ const snap = standOnTopOf(activeTier);+ avatar.position.set(snap.x, snap.y, 0);+ avatar.rotation.y = 0;+ setAnimation('idle', { loop: true });+ if (onArrival) {+ const cb = onArrival;+ onArrival = null;+ setTimeout(cb, 300);+ }+ }- const pro = document.querySelector('[data-tier="pro"]');- activeTier = pro;- pro.classList.add('is-active');- const start = standOnTopOf(pro);- avatar.position.set(start.x, start.y, 0);- setAnimation('idle', { loop: true });- phase = 'idle';- });- });-- const clock = new THREE.Clock();- (function tick() {- requestAnimationFrame(tick);- try {- const dt = Math.min(clock.getDelta(), 0.05);- mixer?.update(dt);- if (phase === 'walking' && avatar && walkStart && walkEnd) {- walkT += dt;- const p = Math.min(walkT / walkDur, 1);- const e = smoothstep(p);- const x = walkStart.x + (walkEnd.x - walkStart.x) * e;- const arc = walkPeakRise * 4 * p * (1 - p);- const y = walkStart.y + (walkEnd.y - walkStart.y) * e + arc;- avatar.position.set(x, y, 0);- if (p >= 1) landOnTier();+ let hoverTimer = null,+ hoverPendingTier = null;+ function scheduleMove(tierEl) {+ if (!tierEl) {+ clearTimeout(hoverTimer);+ hoverPendingTier = null;+ return;+ }+ if (tierEl === activeTier) {+ clearTimeout(hoverTimer);+ hoverPendingTier = null;+ return;+ }+ if (tierEl === hoverPendingTier) return;+ clearTimeout(hoverTimer);+ hoverPendingTier = tierEl;+ hoverTimer = setTimeout(() => {+ hoverPendingTier = null;+ if (phase === 'walking') {+ setTimeout(() => scheduleMove(tierEl), 200);+ } else walkToTier(tierEl);+ }, 120);}- camera.position.x += (mouseNx * 0.1 - camera.position.x) * 0.04;- camera.position.y += (-mouseNy * 0.07 - camera.position.y) * 0.04;- renderer.render(scene, camera);- } catch (_) {}- })();- </script>- <script src="/brand.js" defer></script>++ function tierAtPoint(cx, cy) {+ for (const t of tierCards) {+ const r = t.getBoundingClientRect();+ if (cx >= r.left && cx <= r.right && cy >= r.top && cy <= r.bottom) return t;+ }+ return null;+ }++ const tiersGrid = document.getElementById('pricing-tiers');+ tiersGrid.addEventListener('mousemove', (e) =>+ scheduleMove(tierAtPoint(e.clientX, e.clientY)),+ );+ tiersGrid.addEventListener('mouseleave', () => scheduleMove(null));++ document.querySelectorAll('.pricing-cta').forEach((cta) => {+ const tierEl = cta.closest('.pricing-tier-card');+ if (!tierEl) return;+ cta.addEventListener('click', (e) => {+ if (!avatar) return;+ const tierName = tierEl.dataset.tier;+ const reactionClip = CTA_REACTION[tierName] ?? 'wave';+ const fireReaction = () => {+ setAnimation(reactionClip, { loop: false, hold: true });+ const clipDur = actions[reactionClip]?.getClip().duration ?? 2.0;+ setTimeout(+ () => {+ if (phase === 'idle') setAnimation('idle', { loop: true });+ },+ Math.min(clipDur * 1000, CTA_REACTION_MAX_MS),+ );+ };+ if (tierEl === activeTier && phase === 'idle') {+ fireReaction();+ } else {+ onArrival = fireReaction;+ if (tierEl !== activeTier) walkToTier(tierEl);+ }+ });+ });++ let mouseNx = 0,+ mouseNy = 0;+ window.addEventListener('mousemove', (e) => {+ mouseNx = (e.clientX / window.innerWidth) * 2 - 1;+ mouseNy = (e.clientY / window.innerHeight) * 2 - 1;+ });++ const ro = new ResizeObserver(() => {+ if (avatar && activeTier && phase === 'idle') {+ const t = standOnTopOf(activeTier);+ avatar.position.set(t.x, t.y, 0);+ }+ });+ tierCards.forEach((t) => ro.observe(t));++ const CLIPS = ['idle', 'walk', 'wave', 'av-celebrating', 'av-brag-claps'];++ new GLTFLoader().load('/avatars/cz.glb', (gltf) => {+ avatar = gltf.scene;+ avatar.traverse((n) => {+ if (!rootBone && /^(Hips|Root|mixamorig:?Hips)$/i.test(n.name)) rootBone = n;+ });+ avatar.rotation.y = 0;+ scene.add(avatar);+ mixer = new THREE.AnimationMixer(avatar);++ Promise.all(+ CLIPS.map((name) =>+ fetch(`/animations/clips/${name}.json`).then((r) => r.json()),+ ),+ ).then((jsons) => {+ CLIPS.forEach((name, i) => {+ actions[name] = mixer.clipAction(THREE.AnimationClip.parse(jsons[i]));+ });+ if (rootBone) baseRootPos = rootBone.position.clone();+ const _r = renderer.render.bind(renderer);+ renderer.render = (sc, cam) => {+ try {+ if (rootBone && baseRootPos) rootBone.position.copy(baseRootPos);+ } catch (_) {}+ _r(sc, cam);+ };++ const pro = document.querySelector('[data-tier="pro"]');+ activeTier = pro;+ pro.classList.add('is-active');+ const start = standOnTopOf(pro);+ avatar.position.set(start.x, start.y, 0);+ setAnimation('idle', { loop: true });+ phase = 'idle';+ });+ });++ const clock = new THREE.Clock();+ (function tick() {+ requestAnimationFrame(tick);+ try {+ const dt = Math.min(clock.getDelta(), 0.05);+ mixer?.update(dt);+ if (phase === 'walking' && avatar && walkStart && walkEnd) {+ walkT += dt;+ const p = Math.min(walkT / walkDur, 1);+ const e = smoothstep(p);+ const x = walkStart.x + (walkEnd.x - walkStart.x) * e;+ const arc = walkPeakRise * 4 * p * (1 - p);+ const y = walkStart.y + (walkEnd.y - walkStart.y) * e + arc;+ avatar.position.set(x, y, 0);+ if (p >= 1) landOnTier();+ }+ camera.position.x += (mouseNx * 0.1 - camera.position.x) * 0.04;+ camera.position.y += (-mouseNy * 0.07 - camera.position.y) * 0.04;+ renderer.render(scene, camera);+ } catch (_) {}+ })();+ </script>+ <script src="/brand.js" defer></script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/profile.html b/pages/profile.htmlindex 79446d6cb..d80541790 100644--- a/pages/profile.html+++ b/pages/profile.html@@ -24,20 +24,22 @@<scripttype="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><meta property="og:type" content="profile" />- <meta property="og:site_name" content="three.ws">- <meta property="og:url" content="" id="og-url">+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="" id="og-url" /><meta property="og:title" content="Agent Profile" id="og-title" /><meta property="og:description" content="On-chain agent identity." id="og-description" />- <meta property="og:image" content="https://three.ws/og-image.png" id="og-image">- <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="Agent Profile" id="tw-title">- <meta name="twitter:description" content="On-chain agent identity." id="tw-description">- <meta name="twitter:image" content="https://three.ws/og-image.png" id="tw-image">+ <meta property="og:image" content="https://three.ws/og-image.png" id="og-image" />+ <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="Agent Profile" id="tw-title" />+ <meta name="twitter:description" content="On-chain agent identity." id="tw-description" />+ <meta name="twitter:image" content="https://three.ws/og-image.png" id="tw-image" /><style>body {@@ -86,7 +88,11 @@height: 72px;border-radius: 50%;border: 1px solid rgba(255, 255, 255, 0.12);- background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.06) 0%, transparent 70%);+ background: radial-gradient(+ ellipse at center,+ rgba(255, 215, 0, 0.06) 0%,+ transparent 70%+ );display: flex;align-items: center;justify-content: center;@@ -136,7 +142,10 @@border-radius: 999px;cursor: pointer;font-family: inherit;- transition: color 0.15s, border-color 0.15s, background 0.15s;+ transition:+ color 0.15s,+ border-color 0.15s,+ background 0.15s;}.up-chain-pill:hover {@@ -180,7 +189,9 @@border: 1px solid rgba(255, 255, 255, 0.07);border-radius: 12px;overflow: hidden;- transition: border-color 0.15s, background 0.15s;+ transition:+ border-color 0.15s,+ background 0.15s;display: flex;flex-direction: column;}@@ -198,7 +209,11 @@.up-card-thumb {width: 100%;aspect-ratio: 1;- background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.03) 0%, transparent 70%);+ background: radial-gradient(+ ellipse at center,+ rgba(255, 215, 0, 0.03) 0%,+ transparent 70%+ );overflow: hidden;position: relative;}@@ -299,7 +314,9 @@border-radius: 6px;cursor: pointer;font-family: inherit;- transition: color 0.15s, border-color 0.15s;+ transition:+ color 0.15s,+ border-color 0.15s;}.profile-copy-btn:hover {@@ -466,7 +483,9 @@font-size: 0.764rem;padding: 0.618rem 1rem;cursor: pointer;- transition: color 0.15s, border-color 0.15s;+ transition:+ color 0.15s,+ border-color 0.15s;display: inline-flex;align-items: center;gap: 0.382rem;@@ -512,7 +531,9 @@background: rgba(255, 255, 255, 0.02);border: 1px solid rgba(255, 255, 255, 0.07);border-radius: 12px;- transition: border-color 0.15s, background 0.15s;+ transition:+ border-color 0.15s,+ background 0.15s;text-decoration: none;color: inherit;}@@ -527,7 +548,11 @@height: 56px;flex-shrink: 0;border-radius: 50%;- background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.06) 0%, transparent 70%);+ background: radial-gradient(+ ellipse at center,+ rgba(255, 215, 0, 0.06) 0%,+ transparent 70%+ );display: flex;align-items: center;justify-content: center;@@ -628,7 +653,12 @@}.up-loading-shimmer {- background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 100%);+ background: linear-gradient(+ 90deg,+ rgba(255, 255, 255, 0.02) 0%,+ rgba(255, 255, 255, 0.05) 50%,+ rgba(255, 255, 255, 0.02) 100%+ );background-size: 200% 100%;animation: up-shimmer 1.4s infinite;border-radius: 12px;@@ -636,8 +666,12 @@}@keyframes up-shimmer {- 0% { background-position: 200% 0; }- 100% { background-position: -200% 0; }+ 0% {+ background-position: 200% 0;+ }+ 100% {+ background-position: -200% 0;+ }}@media (max-width: 720px) {@@ -673,8 +707,8 @@}}</style>- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/mobile.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/mobile.css" /></head><body><header><div id="nav-container"></div></header>@@ -729,8 +763,21 @@autocomplete="email"required/>- <button type="submit" class="h-footer-newsletter-btn" aria-label="Subscribe">- <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" d="M2 8h11m0 0L9 4m4 4l-4 4"/></svg>+ <button+ type="submit"+ class="h-footer-newsletter-btn"+ aria-label="Subscribe"+ >+ <svg viewBox="0 0 16 16" aria-hidden="true">+ <path+ fill="none"+ stroke="currentColor"+ stroke-width="1.6"+ stroke-linecap="round"+ stroke-linejoin="round"+ d="M2 8h11m0 0L9 4m4 4l-4 4"+ />+ </svg></button></form><p class="h-footer-newsletter-msg" data-newsletter-msg aria-live="polite"></p>@@ -738,8 +785,18 @@<div class="h-footer-community"><h3>Join the community</h3><p>Follow along for builds, demos, and conversations with the team.</p>- <a class="h-footer-community-btn" href="https://x.com/trythreews" target="_blank" rel="noopener">- <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>+ <a+ class="h-footer-community-btn"+ href="https://x.com/trythreews"+ target="_blank"+ rel="noopener"+ >+ <svg viewBox="0 0 24 24" aria-hidden="true">+ <path+ fill="currentColor"+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"+ />+ </svg>Follow on X</a></div>@@ -753,11 +810,33 @@</div><p class="h-footer-tagline">Give your AI a body.</p><div class="h-footer-socials">- <a class="h-footer-social" href="https://x.com/trythreews" target="_blank" rel="noopener" aria-label="three.ws on X">- <svg viewBox="0 0 24 24" aria-hidden="true"><path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>+ <a+ class="h-footer-social"+ href="https://x.com/trythreews"+ target="_blank"+ rel="noopener"+ aria-label="three.ws on X"+ >+ <svg viewBox="0 0 24 24" aria-hidden="true">+ <path+ fill="currentColor"+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"+ />+ </svg></a>- <a class="h-footer-social" href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener" aria-label="three.ws on GitHub">- <svg viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>+ <a+ class="h-footer-social"+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener"+ aria-label="three.ws on GitHub"+ >+ <svg viewBox="0 0 16 16" aria-hidden="true">+ <path+ fill="currentColor"+ d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"+ />+ </svg></a></div></div>@@ -772,8 +851,18 @@<div class="h-footer-link-col"><h4 class="h-footer-link-heading">Developers</h4><a href="/docs">Docs</a>- <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a>- <a href="https://eips.ethereum.org/EIPS/eip-8004" target="_blank" rel="noopener">ERC-8004</a>+ <a+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener"+ >GitHub</a+ >+ <a+ href="https://eips.ethereum.org/EIPS/eip-8004"+ target="_blank"+ rel="noopener"+ >ERC-8004</a+ ></div><div class="h-footer-link-col"><h4 class="h-footer-link-heading">Resources</h4>@@ -798,7 +887,10 @@const esc = (s) =>String(s ?? '').replace(/[&<>"']/g,- (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c],+ (c) =>+ ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[+ c+ ],);const attr = (s) => esc(s).replace(/"/g, '"');@@ -816,10 +908,14 @@document.title = `${short} — Agents`;const profileUrl = `${location.origin}/u/${slug}`;document.querySelector('#og-title')?.setAttribute('content', `${short} — Agents`);- document.querySelector('#og-description')?.setAttribute('content', `On-chain agent identity profile for ${slug}`);+ document+ .querySelector('#og-description')+ ?.setAttribute('content', `On-chain agent identity profile for ${slug}`);document.querySelector('#og-url')?.setAttribute('content', profileUrl);document.querySelector('#tw-title')?.setAttribute('content', `${short} — Agents`);- document.querySelector('#tw-description')?.setAttribute('content', `On-chain agent identity profile for ${slug}`);+ document+ .querySelector('#tw-description')+ ?.setAttribute('content', `On-chain agent identity profile for ${slug}`);mountUserProfile(root, slug).catch((err) => {root.innerHTML = `<div class="up-error">Could not load profile: ${esc(err.message)}</div>`;});@@ -836,21 +932,39 @@const res = await fetch(`/api/users/${encodeURIComponent(username)}`);if (!res.ok) {const data = await res.json().catch(() => ({}));- const msg = res.status === 404 ? 'User not found.' : (data.error_description || res.statusText);+ const msg =+ res.status === 404+ ? 'User not found.'+ : data.error_description || res.statusText;rootEl.innerHTML = `<div class="up-error">${esc(msg)}</div>`;return;}const data = await res.json();- const { user, stats = {}, social = {}, avatars = [], agents = [], widgets = [], skills = [], plugins = [], coins = [], memories = [] } = data;+ const {+ user,+ stats = {},+ social = {},+ avatars = [],+ agents = [],+ widgets = [],+ skills = [],+ plugins = [],+ coins = [],+ memories = [],+ } = data;// Update page metaconst display = user.display_name || user.username;const title = `@${user.username} — three.ws`;const summaryParts = [];- if (stats.avatars) summaryParts.push(`${stats.avatars} avatar${stats.avatars === 1 ? '' : 's'}`);- if (stats.agents) summaryParts.push(`${stats.agents} agent${stats.agents === 1 ? '' : 's'}`);- if (stats.widgets) summaryParts.push(`${stats.widgets} widget${stats.widgets === 1 ? '' : 's'}`);- if (stats.skills) summaryParts.push(`${stats.skills} skill${stats.skills === 1 ? '' : 's'}`);+ if (stats.avatars)+ summaryParts.push(`${stats.avatars} avatar${stats.avatars === 1 ? '' : 's'}`);+ if (stats.agents)+ summaryParts.push(`${stats.agents} agent${stats.agents === 1 ? '' : 's'}`);+ if (stats.widgets)+ summaryParts.push(`${stats.widgets} widget${stats.widgets === 1 ? '' : 's'}`);+ if (stats.skills)+ summaryParts.push(`${stats.skills} skill${stats.skills === 1 ? '' : 's'}`);const desc = `${display} on three.ws — ${summaryParts.join(' · ') || 'on-chain agent identity'}.`;document.title = title;const profileUrl = `${location.origin}/u/${encodeURIComponent(user.username)}`;@@ -881,14 +995,16 @@loading="lazy"></model-viewer>`: heroAvatar?.thumbnail_url- ? `<img src="${attr(heroAvatar.thumbnail_url)}" alt="${attr(heroAvatar?.name || display)}">`- : `<div class="up-hero-3d-empty">◎</div>`;+ ? `<img src="${attr(heroAvatar.thumbnail_url)}" alt="${attr(heroAvatar?.name || display)}">`+ : `<div class="up-hero-3d-empty">◎</div>`;// Meta line: joined date + socialconst metaBits = [];if (user.created_at) {const joined = new Date(user.created_at);- metaBits.push(`Joined ${joined.toLocaleDateString(undefined, { month: 'long', year: 'numeric' })}`);+ metaBits.push(+ `Joined ${joined.toLocaleDateString(undefined, { month: 'long', year: 'numeric' })}`,+ );}if (social.twitter || social.x) {const x = social.twitter || social.x;@@ -898,7 +1014,9 @@</a>`);}if (social.farcaster) {- metaBits.push(`<a href="https://warpcast.com/${attr(social.farcaster)}" target="_blank" rel="noopener">@${esc(social.farcaster)} on Farcaster</a>`);+ metaBits.push(+ `<a href="https://warpcast.com/${attr(social.farcaster)}" target="_blank" rel="noopener">@${esc(social.farcaster)} on Farcaster</a>`,+ );}const walletPill = user.wallet_address@@ -916,7 +1034,9 @@(async () => {try {const [snsRes, meRes] = await Promise.all([- fetch(`/api/threews/subdomain?label=${encodeURIComponent(user.username)}`),+ fetch(+ `/api/threews/subdomain?label=${encodeURIComponent(user.username)}`,+ ),fetch('/api/auth/me', { credentials: 'include' }).catch(() => null),]);const viewerId = meRes?.ok ? (await meRes.json())?.user?.id : null;@@ -938,7 +1058,11 @@paySlot.outerHTML = `<button class="up-wallet-pill" id="up-pay-btn" style="cursor:pointer;border:0;font-family:inherit" data-name="${attr(d.full)}" data-handle="${attr(user.username)}">Pay @${esc(user.username)} in USDC</button>`;- document.getElementById('up-pay-btn')?.addEventListener('click', () => openPayModal(d.full, user.username));+ document+ .getElementById('up-pay-btn')+ ?.addEventListener('click', () =>+ openPayModal(d.full, user.username),+ );}return;}@@ -963,7 +1087,8 @@modal.id = 'up-pay-modal';modal.setAttribute('role', 'dialog');modal.setAttribute('aria-modal', 'true');- modal.style.cssText = 'position:fixed;inset:0;background:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:9999;padding:1rem;backdrop-filter:blur(6px)';+ modal.style.cssText =+ 'position:fixed;inset:0;background:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:9999;padding:1rem;backdrop-filter:blur(6px)';modal.innerHTML = `<div class="up-pay-card" style="background:var(--bg-0);border:1px solid rgba(255,255,255,.1);border-radius:14px;padding:1.5rem;max-width:420px;width:100%;color:rgba(255,255,255,.95)"><div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:.4rem">@@ -983,9 +1108,16 @@`;document.body.appendChild(modal);const close = () => modal.remove();- modal.addEventListener('click', (e) => { if (e.target === modal) close(); });+ modal.addEventListener('click', (e) => {+ if (e.target === modal) close();+ });modal.querySelector('#up-pay-close').addEventListener('click', close);- document.addEventListener('keydown', function esc(e) { if (e.key === 'Escape') { close(); document.removeEventListener('keydown', esc); } });+ document.addEventListener('keydown', function esc(e) {+ if (e.key === 'Escape') {+ close();+ document.removeEventListener('keydown', esc);+ }+ });const goBtn = modal.querySelector('#up-pay-go');const statusEl = modal.querySelector('#up-pay-status');@@ -1004,7 +1136,9 @@const result = await payByName({name,amount,- onStatus: (s) => { statusEl.textContent = s; },+ onStatus: (s) => {+ statusEl.textContent = s;+ },});statusEl.textContent = '';resultEl.style.display = 'block';@@ -1020,7 +1154,8 @@} catch (err) {statusEl.style.color = '#ff7a7a';if (err?.code === 'no_wallet') {- statusEl.innerHTML = 'Install <a href="https://phantom.app/" target="_blank" rel="noopener" style="color:#ab9ff2">Phantom</a> or another Solana wallet, then retry.';+ statusEl.innerHTML =+ 'Install <a href="https://phantom.app/" target="_blank" rel="noopener" style="color:#ab9ff2">Phantom</a> or another Solana wallet, then retry.';} else if (err?.code === 'confirm_timeout' && err.signature) {statusEl.innerHTML = `Submitted but not confirmed in window. <a href="https://solscan.io/tx/${encodeURIComponent(err.signature)}" target="_blank" rel="noopener" style="color:#69e16f">Check Solscan ↗</a>`;} else {@@ -1042,12 +1177,16 @@['memories', 'Memories'],];if (stats.widget_views > 0) statDefs.push(['widget_views', 'Widget Views']);- const statsHtml = statDefs.map(([key, label]) => `+ const statsHtml = statDefs+ .map(+ ([key, label]) => `<div class="up-stat"><span class="up-stat-num">${formatStat(stats[key] || 0)}</span><span class="up-stat-label">${label}</span></div>- `).join('');+ `,+ )+ .join('');// Tabs: only show those with content; default to first non-emptyconst tabs = [@@ -1062,16 +1201,21 @@const visibleTabs = tabs.filter((t) => t.count > 0);const defaultTab = visibleTabs[0]?.key || 'avatars';- const tabBar = (visibleTabs.length > 1)- ? `<div class="up-tabs" role="tablist">- ${visibleTabs.map((t) => `+ const tabBar =+ visibleTabs.length > 1+ ? `<div class="up-tabs" role="tablist">+ ${visibleTabs+ .map(+ (t) => `<button class="up-tab${t.key === defaultTab ? ' up-tab--active' : ''}" role="tab" data-tab="${t.key}" aria-selected="${t.key === defaultTab}">${esc(t.label)}<span class="up-tab-badge">${t.count}</span></button>- `).join('')}+ `,+ )+ .join('')}</div>`- : '';+ : '';rootEl.innerHTML = `<div class="up-hero-rich">@@ -1137,14 +1281,19 @@if (!avatars.length) {return `<p class="up-empty">No public avatars yet.</p>`;}- const cards = avatars.map((a) => {- const thumb = a.thumbnail_url- ? `<img src="${attr(a.thumbnail_url)}" alt="${attr(a.name)}" style="width:100%;height:100%;object-fit:cover">`- : `<div class="up-card-thumb-placeholder">◎</div>`;- const tags = (a.tags || []).slice(0, 3).map((t) => `<span class="up-tag">#${esc(t)}</span>`).join('');- const sizeKB = a.size_bytes ? Math.round(a.size_bytes / 1024) : 0;- const sizeLabel = sizeKB >= 1024 ? `${(sizeKB / 1024).toFixed(1)} MB` : `${sizeKB} KB`;- return `+ const cards = avatars+ .map((a) => {+ const thumb = a.thumbnail_url+ ? `<img src="${attr(a.thumbnail_url)}" alt="${attr(a.name)}" style="width:100%;height:100%;object-fit:cover">`+ : `<div class="up-card-thumb-placeholder">◎</div>`;+ const tags = (a.tags || [])+ .slice(0, 3)+ .map((t) => `<span class="up-tag">#${esc(t)}</span>`)+ .join('');+ const sizeKB = a.size_bytes ? Math.round(a.size_bytes / 1024) : 0;+ const sizeLabel =+ sizeKB >= 1024 ? `${(sizeKB / 1024).toFixed(1)} MB` : `${sizeKB} KB`;+ return `<article class="up-card"><a href="/avatars/${attr(a.id)}" class="up-card-thumb-link" tabindex="-1" aria-hidden="true"><div class="up-card-thumb">${thumb}</div>@@ -1159,24 +1308,41 @@</div></article>`;- }).join('');+ })+ .join('');return `<div class="up-grid">${cards}</div>`;}function renderAgentsList(agents) {if (!agents.length) return `<p class="up-empty">No public agents yet.</p>`;- const cards = agents.map((a) => {- const img = a.profile_image_url || a.avatar_url;- const thumb = img- ? `<img src="${attr(img)}" alt="${attr(a.name)}">`- : `<span>◎</span>`;- const meta = [];- if (a.sns_domain) meta.push(`<a href="https://www.sns.id/domain?domain=${attr(a.sns_domain)}" target="_blank" rel="noopener">◎ ${esc(a.sns_domain)}</a>`);- if (a.erc8004_agent_id && a.chain_id) meta.push(`ERC-8004 #${esc(a.erc8004_agent_id)} · chain ${esc(String(a.chain_id))}`);- if (a.wallet_address) meta.push(`${esc(a.wallet_address.slice(0, 6))}…${esc(a.wallet_address.slice(-4))}`);- if (a.x_username) meta.push(`<a href="https://x.com/${attr(a.x_username)}" target="_blank" rel="noopener">@${esc(a.x_username)}</a>`);- if (a.farcaster_fname) meta.push(`<a href="https://warpcast.com/${attr(a.farcaster_fname)}" target="_blank" rel="noopener">/${esc(a.farcaster_fname)}</a>`);- return `+ const cards = agents+ .map((a) => {+ const img = a.profile_image_url || a.avatar_url;+ const thumb = img+ ? `<img src="${attr(img)}" alt="${attr(a.name)}">`+ : `<span>◎</span>`;+ const meta = [];+ if (a.sns_domain)+ meta.push(+ `<a href="https://www.sns.id/domain?domain=${attr(a.sns_domain)}" target="_blank" rel="noopener">◎ ${esc(a.sns_domain)}</a>`,+ );+ if (a.erc8004_agent_id && a.chain_id)+ meta.push(+ `ERC-8004 #${esc(a.erc8004_agent_id)} · chain ${esc(String(a.chain_id))}`,+ );+ if (a.wallet_address)+ meta.push(+ `${esc(a.wallet_address.slice(0, 6))}…${esc(a.wallet_address.slice(-4))}`,+ );+ if (a.x_username)+ meta.push(+ `<a href="https://x.com/${attr(a.x_username)}" target="_blank" rel="noopener">@${esc(a.x_username)}</a>`,+ );+ if (a.farcaster_fname)+ meta.push(+ `<a href="https://warpcast.com/${attr(a.farcaster_fname)}" target="_blank" rel="noopener">/${esc(a.farcaster_fname)}</a>`,+ );+ return `<a class="up-card-row" href="/agent/${attr(a.id)}"><div class="up-card-row-thumb">${thumb}</div><div class="up-card-row-body">@@ -1189,12 +1355,14 @@</div></a>`;- }).join('');+ })+ .join('');return `<div class="up-list up-list-cols-2">${cards}</div>`;}function renderWidgetsList(widgets) {- if (!widgets.length) return `<p class="up-empty">No public widgets yet. <a href="/widgets">Build one →</a></p>`;+ if (!widgets.length)+ return `<p class="up-empty">No public widgets yet. <a href="/widgets">Build one →</a></p>`;const typeIcons = {turntable: '◐','animation-gallery': '▶',@@ -1202,9 +1370,10 @@passport: '◉','hotspot-tour': '⊙',};- const cards = widgets.map((w) => {- const icon = typeIcons[w.type] || '◎';- return `+ const cards = widgets+ .map((w) => {+ const icon = typeIcons[w.type] || '◎';+ return `<a class="up-card-row" href="/w/${attr(w.id)}"><div class="up-card-row-thumb">${icon}</div><div class="up-card-row-body">@@ -1219,18 +1388,24 @@</div></a>`;- }).join('');+ })+ .join('');return `<div class="up-list up-list-cols-2">${cards}</div>`;}function renderSkillsList(skills) {if (!skills.length) return `<p class="up-empty">No published skills yet.</p>`;- const cards = skills.map((s) => {- const tags = (s.tags || []).slice(0, 3).map((t) => `<span class="up-tag">#${esc(t)}</span>`).join('');- const price = s.price_per_call_usd > 0- ? `$${Number(s.price_per_call_usd).toFixed(4)}/call`- : 'free';- return `+ const cards = skills+ .map((s) => {+ const tags = (s.tags || [])+ .slice(0, 3)+ .map((t) => `<span class="up-tag">#${esc(t)}</span>`)+ .join('');+ const price =+ s.price_per_call_usd > 0+ ? `$${Number(s.price_per_call_usd).toFixed(4)}/call`+ : 'free';+ return `<a class="up-card-row" href="/marketplace#${attr(s.slug)}"><div class="up-card-row-thumb">⚡</div><div class="up-card-row-body">@@ -1247,15 +1422,20 @@</div></a>`;- }).join('');+ })+ .join('');return `<div class="up-list up-list-cols-2">${cards}</div>`;}function renderPluginsList(plugins) {if (!plugins.length) return `<p class="up-empty">No published plugins yet.</p>`;- const cards = plugins.map((p) => {- const rating = p.rating_count > 0 ? `★ ${Number(p.avg_rating).toFixed(1)} (${p.rating_count})` : 'unrated';- return `+ const cards = plugins+ .map((p) => {+ const rating =+ p.rating_count > 0+ ? `★ ${Number(p.avg_rating).toFixed(1)} (${p.rating_count})`+ : 'unrated';+ return `<div class="up-card-row"><div class="up-card-row-thumb">◈</div><div class="up-card-row-body">@@ -1272,20 +1452,26 @@</div></div>`;- }).join('');+ })+ .join('');return `<div class="up-list up-list-cols-2">${cards}</div>`;}function renderCoinsGrid(coins) {if (!coins.length) return `<p class="up-empty">No coins launched yet.</p>`;- const cards = coins.map((c) => {- const thumb = c.image- ? `<img src="${attr(c.image)}" alt="${attr(c.name)}" style="width:100%;height:100%;object-fit:cover" referrerpolicy="no-referrer">`- : `<div class="up-card-thumb-placeholder">◎</div>`;- const symbol = c.symbol ? `<span class="up-card-chain">$${esc(c.symbol.replace(/^\$/, ''))}</span>` : '';- const devnet = c.cluster && c.cluster !== 'mainnet'- ? `<span class="up-card-id">${esc(c.cluster)}</span>` : '';- const inner = `+ const cards = coins+ .map((c) => {+ const thumb = c.image+ ? `<img src="${attr(c.image)}" alt="${attr(c.name)}" style="width:100%;height:100%;object-fit:cover" referrerpolicy="no-referrer">`+ : `<div class="up-card-thumb-placeholder">◎</div>`;+ const symbol = c.symbol+ ? `<span class="up-card-chain">$${esc(c.symbol.replace(/^\$/, ''))}</span>`+ : '';+ const devnet =+ c.cluster && c.cluster !== 'mainnet'+ ? `<span class="up-card-id">${esc(c.cluster)}</span>`+ : '';+ const inner = `<div class="up-card-thumb">${thumb}</div><div class="up-card-body">${symbol}@@ -1296,26 +1482,35 @@${devnet}</div></div>`;- // Link out to the live coin page when present; otherwise fall back to- // the launching agent so the card is never a dead end.- return c.url- ? `<a class="up-card" href="${attr(c.url)}" target="_blank" rel="noopener" style="text-decoration:none">${inner}</a>`- : `<a class="up-card" href="/agent/${attr(c.agent_id)}" style="text-decoration:none">${inner}</a>`;- }).join('');+ // Link out to the live coin page when present; otherwise fall back to+ // the launching agent so the card is never a dead end.+ return c.url+ ? `<a class="up-card" href="${attr(c.url)}" target="_blank" rel="noopener" style="text-decoration:none">${inner}</a>`+ : `<a class="up-card" href="/agent/${attr(c.agent_id)}" style="text-decoration:none">${inner}</a>`;+ })+ .join('');return `<div class="up-grid">${cards}</div>`;}function renderMemoriesList(memories) {if (!memories.length) return `<p class="up-empty">No public memories yet.</p>`;- const cards = memories.map((m) => {- const tags = (m.tags || []).slice(0, 4).map((t) => `<span class="up-tag">#${esc(t)}</span>`).join('');- const when = m.created_at- ? new Date(m.created_at).toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' })- : '';- const agent = m.agent_name- ? `<a href="/agent/${attr(m.agent_id)}">${esc(m.agent_name)}</a>`- : '';- return `+ const cards = memories+ .map((m) => {+ const tags = (m.tags || [])+ .slice(0, 4)+ .map((t) => `<span class="up-tag">#${esc(t)}</span>`)+ .join('');+ const when = m.created_at+ ? new Date(m.created_at).toLocaleDateString(undefined, {+ month: 'short',+ day: 'numeric',+ year: 'numeric',+ })+ : '';+ const agent = m.agent_name+ ? `<a href="/agent/${attr(m.agent_id)}">${esc(m.agent_name)}</a>`+ : '';+ return `<div class="up-card-row"><div class="up-card-row-thumb">◇</div><div class="up-card-row-body">@@ -1331,7 +1526,8 @@</div></div>`;- }).join('');+ })+ .join('');return `<div class="up-list up-list-cols-2">${cards}</div>`;}@@ -1351,5 +1547,5 @@<script src="/brand.js" defer></script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/pump-dashboard.html b/pages/pump-dashboard.htmlindex dc0adef11..e1ed956ce 100644--- a/pages/pump-dashboard.html+++ b/pages/pump-dashboard.html@@ -5,14 +5,20 @@<meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Pump Dashboard — three.ws</title>- <meta name="description" content="Real-time Pump.fun dashboard — live feed, watch list, claims, token scanner, quoting, vanity addresses." />+ <meta+ name="description"+ content="Real-time Pump.fun dashboard — live feed, watch list, claims, token scanner, quoting, vanity addresses."+ /><meta name="theme-color" content="#070707" /><link rel="canonical" href="https://three.ws/pump-dashboard" /><meta property="og:type" content="website" /><meta property="og:site_name" content="three.ws" /><meta property="og:title" content="Pump Dashboard — three.ws" />- <meta property="og:description" content="Real-time Pump.fun dashboard — live feed, watch list, claims, token scanner, quoting, vanity addresses." />+ <meta+ property="og:description"+ content="Real-time Pump.fun dashboard — live feed, watch list, claims, token scanner, quoting, vanity addresses."+ /><meta property="og:url" content="https://three.ws/pump-dashboard" /><meta property="og:image" content="https://three.ws/og-image.png" />@@ -31,27 +37,84 @@<link rel="stylesheet" href="/mobile.css" /><script defer src="/nav.js"></script><script defer src="/footer-newsletter.js"></script>- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>/* Config connection-test pills (Task 10) */- .pd-probe { display:inline-block; margin-left:0.4rem; font-size:0.66rem; font-weight:600; padding:0.05rem 0.45rem; border-radius:999px; vertical-align:middle; }- .pd-probe.is-ok { color:var(--success); background:rgba(74, 222, 128, 0.14); border:1px solid rgba(74, 222, 128, 0.3); }- .pd-probe.is-err { color:var(--danger); background:rgba(248, 113, 113, 0.14); border:1px solid rgba(248, 113, 113, 0.32); }- .pd-probe.is-pending { color:var(--warn); background:rgba(251, 191, 36, 0.14); border:1px solid rgba(251, 191, 36, 0.3); }+ .pd-probe {+ display: inline-block;+ margin-left: 0.4rem;+ font-size: 0.66rem;+ font-weight: 600;+ padding: 0.05rem 0.45rem;+ border-radius: 999px;+ vertical-align: middle;+ }+ .pd-probe.is-ok {+ color: var(--success);+ background: rgba(74, 222, 128, 0.14);+ border: 1px solid rgba(74, 222, 128, 0.3);+ }+ .pd-probe.is-err {+ color: var(--danger);+ background: rgba(248, 113, 113, 0.14);+ border: 1px solid rgba(248, 113, 113, 0.32);+ }+ .pd-probe.is-pending {+ color: var(--warn);+ background: rgba(251, 191, 36, 0.14);+ border: 1px solid rgba(251, 191, 36, 0.3);+ }/* Stale monitor stat cards (Task 07) */- .pd-stat.is-stale { opacity:0.5; }- .pd-stale-badge { display:inline-block; font-size:0.58rem; color:var(--warn); margin-left:0.35rem; text-transform:uppercase; letter-spacing:0.05em; vertical-align:middle; }+ .pd-stat.is-stale {+ opacity: 0.5;+ }+ .pd-stale-badge {+ display: inline-block;+ font-size: 0.58rem;+ color: var(--warn);+ margin-left: 0.35rem;+ text-transform: uppercase;+ letter-spacing: 0.05em;+ vertical-align: middle;+ }/* Wallet holdings token logos (Task 02) */- .pd-token-logo { width:18px; height:18px; border-radius:50%; vertical-align:middle; margin-right:0.4rem; object-fit:cover; background:var(--surface-1); }- #pd-market-chart { cursor:crosshair; }+ .pd-token-logo {+ width: 18px;+ height: 18px;+ border-radius: 50%;+ vertical-align: middle;+ margin-right: 0.4rem;+ object-fit: cover;+ background: var(--surface-1);+ }+ #pd-market-chart {+ cursor: crosshair;+ }</style>-- <meta name="twitter:card" content="summary_large_image">- <meta name="twitter:title" content="Pump Dashboard · three.ws">- <meta name="twitter:description" content="Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts.">- <meta name="twitter:image" content="https://three.ws/og-image.png">- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Pump Dashboard","description":"Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts.","url":"https://three.ws/pump-dashboard","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>++ <meta name="twitter:card" content="summary_large_image" />+ <meta name="twitter:title" content="Pump Dashboard · three.ws" />+ <meta+ name="twitter:description"+ content="Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts."+ />+ <meta name="twitter:image" content="https://three.ws/og-image.png" />+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Pump Dashboard",+ "description": "Pump.fun trading desk: watchlists, scanner, quotes, portfolio, and live charts.",+ "url": "https://three.ws/pump-dashboard",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head><body class="home-page pump-dashboard-page"><a href="#pd-main" class="h-skip-link">Skip to main content</a>@@ -61,66 +124,182 @@<aside class="pd-sidebar" id="pd-sidebar"><div class="pd-sidebar-head"><a class="pd-sidebar-brand" href="/" aria-label="three.ws home">- <img class="wordmark-logo" src="/three.svg" alt="" aria-hidden="true" />three.ws+ <img+ class="wordmark-logo"+ src="/three.svg"+ alt=""+ aria-hidden="true"+ />three.ws</a><div class="pd-sidebar-eyebrow">Token Cockpit</div></div><nav><div class="pd-nav-section">Overview</div><a href="#dashboard" data-page="dashboard" class="is-active">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><rect x="2" y="2" width="5" height="5" rx="1"/><rect x="9" y="2" width="5" height="5" rx="1"/><rect x="2" y="9" width="5" height="5" rx="1"/><rect x="9" y="9" width="5" height="5" rx="1"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <rect x="2" y="2" width="5" height="5" rx="1" />+ <rect x="9" y="2" width="5" height="5" rx="1" />+ <rect x="2" y="9" width="5" height="5" rx="1" />+ <rect x="9" y="9" width="5" height="5" rx="1" />+ </svg>Dashboard</a><a href="#feed" data-page="feed">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><path d="M2 10c0-3.3 2.7-6 6-6"/><path d="M2 6c0-2.2 1.8-4 4-4"/><circle cx="3" cy="13" r="1.2" fill="currentColor" stroke="none"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <path d="M2 10c0-3.3 2.7-6 6-6" />+ <path d="M2 6c0-2.2 1.8-4 4-4" />+ <circle cx="3" cy="13" r="1.2" fill="currentColor" stroke="none" />+ </svg>Live Feed</a><div class="pd-nav-section">Tracking</div><a href="#watches" data-page="watches">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><path d="M1.5 8s2.5-5 6.5-5 6.5 5 6.5 5-2.5 5-6.5 5S1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2.2"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <path d="M1.5 8s2.5-5 6.5-5 6.5 5 6.5 5-2.5 5-6.5 5S1.5 8 1.5 8z" />+ <circle cx="8" cy="8" r="2.2" />+ </svg>Watch List</a><a href="#claims" data-page="claims">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="6"/><path d="M5.5 8.5l1.8 1.8L10.8 6.5"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <circle cx="8" cy="8" r="6" />+ <path d="M5.5 8.5l1.8 1.8L10.8 6.5" />+ </svg>Fee Claims</a><a href="#alerts" data-page="alerts">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><path d="M3 11c0-3 1-7 5-7s5 4 5 7M2 11h12M7 13h2"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <path d="M3 11c0-3 1-7 5-7s5 4 5 7M2 11h12M7 13h2" />+ </svg>Alerts</a><div class="pd-nav-section">Tools</div><a href="#scanner" data-page="scanner">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="7" cy="7" r="4.5"/><path d="M10.5 10.5l3 3"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <circle cx="7" cy="7" r="4.5" />+ <path d="M10.5 10.5l3 3" />+ </svg>Token Scanner</a><a href="#quoting" data-page="quoting">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><path d="M2 12l3-4 3 2 4-6 2 3"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <path d="M2 12l3-4 3 2 4-6 2 3" />+ </svg>Quote Engine</a><a href="#vanity" data-page="vanity">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="5" cy="11" r="2.5"/><path d="M7 9l6-6M11 4l2 2"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <circle cx="5" cy="11" r="2.5" />+ <path d="M7 9l6-6M11 4l2 2" />+ </svg>Vanity Generator</a><div class="pd-nav-section">Agent</div><a href="#animations" data-page="animations">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="5" r="2.5"/><path d="M3 14c0-3 2.2-5 5-5s5 2 5 5"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <circle cx="8" cy="5" r="2.5" />+ <path d="M3 14c0-3 2.2-5 5-5s5 2 5 5" />+ </svg>Default Agent</a><a href="#revenue" data-page="revenue">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><path d="M2 13l3.5-4 3 2.5L13 5"/><path d="M10 5h3v3"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <path d="M2 13l3.5-4 3 2.5L13 5" />+ <path d="M10 5h3v3" />+ </svg>Revenue</a><div class="pd-nav-section">System</div><a href="#config" data-page="config">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="8" cy="8" r="2"/><path d="M8 1v2M8 13v2M1 8h2M13 8h2M3.05 3.05l1.4 1.4M11.55 11.55l1.4 1.4M3.05 12.95l1.4-1.4M11.55 4.45l1.4-1.4"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <circle cx="8" cy="8" r="2" />+ <path+ d="M8 1v2M8 13v2M1 8h2M13 8h2M3.05 3.05l1.4 1.4M11.55 11.55l1.4 1.4M3.05 12.95l1.4-1.4M11.55 4.45l1.4-1.4"+ />+ </svg>Configuration</a><a href="#api" data-page="api">- <svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><rect x="2" y="6" width="5" height="4" rx="1"/><path d="M7 8h4M11 6v4M14 6v4M11 6h3M11 10h3"/></svg>+ <svg+ viewBox="0 0 16 16"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <rect x="2" y="6" width="5" height="4" rx="1" />+ <path d="M7 8h4M11 6v4M14 6v4M11 6h3M11 10h3" />+ </svg>API Reference</a></nav>@@ -142,16 +321,24 @@<span class="pd-dot" id="pd-ws-dot"></span><span id="pd-ws-status">WS: idle</span></div>- <div class="pd-status-chip" id="pd-sol-chip" title="SOL spot price (via Helius/Pyth)">+ <div+ class="pd-status-chip"+ id="pd-sol-chip"+ title="SOL spot price (via Helius/Pyth)"+ ><span class="pd-dot" id="pd-sol-dot"></span><span id="pd-sol-status">SOL: —</span></div></div><!-- ═══════ Dashboard page ═══════ -->- <section class="pd-page is-active" id="page-dashboard" aria-labelledby="pd-page-title">+ <section+ class="pd-page is-active"+ id="page-dashboard"+ aria-labelledby="pd-page-title"+ ><!-- Bot/monitor stat cards — bound to GET /api/healthz (monitor + watches + uptime). -->- <div class="pd-stat-grid" id="pd-monitor-stats" style="margin-bottom:1rem">+ <div class="pd-stat-grid" id="pd-monitor-stats" style="margin-bottom: 1rem"><div class="pd-stat"><div class="pd-stat-label">Live monitor</div><div class="pd-stat-value" id="stat-bot-status">—</div>@@ -199,12 +386,27 @@></model-viewer></div><div class="pd-featured-info">- <div class="pd-featured-name" id="pd-featured-name">Loading agent…</div>- <p class="pd-featured-desc" id="pd-featured-desc">Fetching the featured agent for this account.</p>- <div class="pd-featured-stats" id="pd-featured-stats" hidden></div>+ <div class="pd-featured-name" id="pd-featured-name">+ Loading agent…+ </div>+ <p class="pd-featured-desc" id="pd-featured-desc">+ Fetching the featured agent for this account.+ </p>+ <div+ class="pd-featured-stats"+ id="pd-featured-stats"+ hidden+ ></div><div>- <a class="pd-btn is-primary pd-btn-sm" id="pd-featured-link" href="/my-agents">View profile</a>- <a class="pd-btn pd-btn-sm" href="/create">Create agent</a>+ <a+ class="pd-btn is-primary pd-btn-sm"+ id="pd-featured-link"+ href="/my-agents"+ >View profile</a+ >+ <a class="pd-btn pd-btn-sm" href="/create"+ >Create agent</a+ ></div></div></div>@@ -215,14 +417,38 @@<div class="pd-panel-head"><h2>Wallet snapshot</h2><div class="pd-spacer"></div>- <button class="pd-btn pd-btn-sm" id="pd-wallet-disconnect" type="button" hidden>Disconnect</button>+ <button+ class="pd-btn pd-btn-sm"+ id="pd-wallet-disconnect"+ type="button"+ hidden+ >+ Disconnect+ </button></div><div class="pd-panel-body" id="pd-wallet-body"><div class="pd-empty" id="pd-wallet-empty">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect x="3" y="6" width="18" height="13" rx="2"/><path d="M3 10h18M16 14h2"/></svg>- <div>Connect your Solana wallet to see SOL & token holdings.</div>+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.5"+ aria-hidden="true"+ >+ <rect x="3" y="6" width="18" height="13" rx="2" />+ <path d="M3 10h18M16 14h2" />+ </svg>+ <div>+ Connect your Solana wallet to see SOL & token holdings.+ </div><div style="margin-top: 0.85rem">- <button class="pd-btn is-primary pd-btn-sm" id="connect-wallet-btn" type="button">Connect Wallet</button>+ <button+ class="pd-btn is-primary pd-btn-sm"+ id="connect-wallet-btn"+ type="button"+ >+ Connect Wallet+ </button></div></div><div id="pd-wallet-holdings" hidden></div>@@ -240,12 +466,16 @@<div class="pd-stat"><div class="pd-stat-label">SOL Price</div><div class="pd-stat-value" id="pd-stat-sol">—</div>- <div class="pd-stat-sub" id="pd-stat-sol-sub">Cached spot</div>+ <div class="pd-stat-sub" id="pd-stat-sol-sub">+ Cached spot+ </div></div><div class="pd-stat"><div class="pd-stat-label">Helius RPC</div><div class="pd-stat-value" id="pd-stat-rpc">—</div>- <div class="pd-stat-sub" id="pd-stat-rpc-sub">Mainnet slot</div>+ <div class="pd-stat-sub" id="pd-stat-rpc-sub">+ Mainnet slot+ </div></div><div class="pd-stat"><div class="pd-stat-label">Mints (24h)</div>@@ -265,16 +495,62 @@<div class="pd-panel-head"><h2>Market chart</h2><div class="pd-spacer"></div>- <select class="pd-select" id="pd-chart-token" aria-label="Select token for the market chart" style="max-width:280px">- <option value="" disabled selected>Loading trending tokens…</option>+ <select+ class="pd-select"+ id="pd-chart-token"+ aria-label="Select token for the market chart"+ style="max-width: 280px"+ >+ <option value="" disabled selected>+ Loading trending tokens…+ </option></select>- <button class="pd-btn pd-btn-sm" id="pd-chart-retry" type="button" hidden>Retry</button>+ <button+ class="pd-btn pd-btn-sm"+ id="pd-chart-retry"+ type="button"+ hidden+ >+ Retry+ </button></div><div class="pd-panel-body">- <div id="pd-chart-meta" style="display:flex;gap:1rem;flex-wrap:wrap;align-items:baseline;margin-bottom:0.6rem;min-height:1.2rem;font-size:0.82rem;color:var(--ink-dim)"></div>- <div style="position:relative">- <canvas id="pd-market-chart" style="width:100%;height:300px;display:block"></canvas>- <div id="pd-chart-tooltip" style="position:absolute;pointer-events:none;display:none;background:var(--surface-1);border:1px solid var(--stroke-strong);border-radius:6px;padding:0.35rem 0.55rem;font-family:var(--font-mono);font-size:0.72rem;color:var(--accent);white-space:nowrap;z-index:3;transform:translate(-50%,-120%)"></div>+ <div+ id="pd-chart-meta"+ style="+ display: flex;+ gap: 1rem;+ flex-wrap: wrap;+ align-items: baseline;+ margin-bottom: 0.6rem;+ min-height: 1.2rem;+ font-size: 0.82rem;+ color: var(--ink-dim);+ "+ ></div>+ <div style="position: relative">+ <canvas+ id="pd-market-chart"+ style="width: 100%; height: 300px; display: block"+ ></canvas>+ <div+ id="pd-chart-tooltip"+ style="+ position: absolute;+ pointer-events: none;+ display: none;+ background: var(--surface-1);+ border: 1px solid var(--stroke-strong);+ border-radius: 6px;+ padding: 0.35rem 0.55rem;+ font-family: var(--font-mono);+ font-size: 0.72rem;+ color: var(--accent);+ white-space: nowrap;+ z-index: 3;+ transform: translate(-50%, -120%);+ "+ ></div></div></div></div>@@ -284,12 +560,38 @@<h2>Live feed</h2><span class="pd-badge" id="pd-activity-count">0</span><div class="pd-spacer"></div>- <button class="pd-btn pd-btn-sm" id="pd-clear-dash-feed" type="button">Clear</button>+ <button+ class="pd-btn pd-btn-sm"+ id="pd-clear-dash-feed"+ type="button"+ >+ Clear+ </button></div><div class="pd-panel-body no-pad">- <div class="pd-feed" id="pd-dashboard-feed" style="max-height: 360px">+ <div+ class="pd-feed"+ id="pd-dashboard-feed"+ style="max-height: 360px"+ ><div class="pd-empty">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M3 12c0-5 4-9 9-9"/><path d="M3 8c0-3 2.4-5 5-5"/><circle cx="5" cy="19" r="1.6" fill="currentColor" stroke="none"/></svg>+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.5"+ aria-hidden="true"+ >+ <path d="M3 12c0-5 4-9 9-9" />+ <path d="M3 8c0-3 2.4-5 5-5" />+ <circle+ cx="5"+ cy="19"+ r="1.6"+ fill="currentColor"+ stroke="none"+ />+ </svg><div>Waiting for the realtime feed…</div></div></div>@@ -305,24 +607,69 @@<h2>Realtime feed</h2><span class="pd-badge" id="pd-feed-count">0</span><div class="pd-spacer"></div>- <label style="display:flex;align-items:center;gap:0.4rem;font-size:0.78rem;color:var(--ink-dim)">- <input type="checkbox" class="pd-toggle" id="pd-feed-pause"> Pause+ <label+ style="+ display: flex;+ align-items: center;+ gap: 0.4rem;+ font-size: 0.78rem;+ color: var(--ink-dim);+ "+ >+ <input type="checkbox" class="pd-toggle" id="pd-feed-pause" /> Pause</label>- <button class="pd-btn pd-btn-sm" id="pd-clear-live-feed" type="button">Clear</button>+ <button class="pd-btn pd-btn-sm" id="pd-clear-live-feed" type="button">+ Clear+ </button></div><div class="pd-filter-row" role="tablist">- <button class="pd-filter-btn is-active" data-filter="all" type="button">All</button>- <button class="pd-filter-btn" data-filter="launch" type="button">Launches</button>- <button class="pd-filter-btn" data-filter="trade" type="button">Trades</button>- <button class="pd-filter-btn" data-filter="whale" type="button">Whales</button>- <button class="pd-filter-btn" data-filter="graduation" type="button">Graduations</button>- <button class="pd-filter-btn" data-filter="claim" type="button">Claims</button>+ <button class="pd-filter-btn is-active" data-filter="all" type="button">+ All+ </button>+ <button class="pd-filter-btn" data-filter="launch" type="button">+ Launches+ </button>+ <button class="pd-filter-btn" data-filter="trade" type="button">+ Trades+ </button>+ <button class="pd-filter-btn" data-filter="whale" type="button">+ Whales+ </button>+ <button class="pd-filter-btn" data-filter="graduation" type="button">+ Graduations+ </button>+ <button class="pd-filter-btn" data-filter="claim" type="button">+ Claims+ </button></div><div class="pd-panel-body no-pad">- <div class="pd-feed" id="pd-live-feed" style="max-height: calc(100vh - 280px)">+ <div+ class="pd-feed"+ id="pd-live-feed"+ style="max-height: calc(100vh - 280px)"+ ><div class="pd-empty">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M3 12c0-5 4-9 9-9"/><path d="M3 8c0-3 2.4-5 5-5"/><circle cx="5" cy="19" r="1.6" fill="currentColor" stroke="none"/></svg>- <div>Connecting to <span class="pd-mono">wss://pumpportal.fun/api/data</span>…</div>+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.5"+ aria-hidden="true"+ >+ <path d="M3 12c0-5 4-9 9-9" />+ <path d="M3 8c0-3 2.4-5 5-5" />+ <circle+ cx="5"+ cy="19"+ r="1.6"+ fill="currentColor"+ stroke="none"+ />+ </svg>+ <div>+ Connecting to+ <span class="pd-mono">wss://pumpportal.fun/api/data</span>…+ </div></div></div></div>@@ -331,9 +678,13 @@<!-- ═══════ Watch List page ═══════ --><section class="pd-page" id="page-watches" aria-label="Watch list">- <div style="display:flex;gap:0.5rem;margin-bottom:1rem">- <button class="pd-btn is-primary" id="pd-add-watch-btn" type="button">+ Add watch</button>- <button class="pd-btn" id="pd-refresh-watches" type="button">Refresh</button>+ <div style="display: flex; gap: 0.5rem; margin-bottom: 1rem">+ <button class="pd-btn is-primary" id="pd-add-watch-btn" type="button">+ + Add watch+ </button>+ <button class="pd-btn" id="pd-refresh-watches" type="button">+ Refresh+ </button></div><div class="pd-panel"><div class="pd-panel-head">@@ -343,10 +694,19 @@<div class="pd-panel-body no-pad"><table class="pd-table"><thead>- <tr><th>Wallet</th><th>Label</th><th>Token filter</th><th>Webhook</th><th>Created</th><th></th></tr>+ <tr>+ <th>Wallet</th>+ <th>Label</th>+ <th>Token filter</th>+ <th>Webhook</th>+ <th>Created</th>+ <th></th>+ </tr></thead><tbody id="pd-watches-table">- <tr><td colspan="6" class="pd-empty">Loading watches…</td></tr>+ <tr>+ <td colspan="6" class="pd-empty">Loading watches…</td>+ </tr></tbody></table></div>@@ -356,11 +716,16 @@<!-- ═══════ Claims page ═══════ --><section class="pd-page" id="page-claims" aria-label="Fee claims"><div class="pd-form-inline">- <div class="pd-form-group" style="flex:2">+ <div class="pd-form-group" style="flex: 2"><label>Filter wallet</label>- <input class="pd-input" type="text" id="pd-claims-wallet-filter" placeholder="Solana address (optional)…" />+ <input+ class="pd-input"+ type="text"+ id="pd-claims-wallet-filter"+ placeholder="Solana address (optional)…"+ /></div>- <div class="pd-form-group" style="flex:1">+ <div class="pd-form-group" style="flex: 1"><label>Type</label><select class="pd-select" id="pd-claims-type-filter"><option value="">All types</option>@@ -368,22 +733,35 @@<option value="cashback">Cashback</option></select></div>- <button class="pd-btn is-primary" id="pd-refresh-claims" type="button">Search</button>+ <button class="pd-btn is-primary" id="pd-refresh-claims" type="button">+ Search+ </button></div><div class="pd-panel"><div class="pd-panel-head"><h2>Fee claims</h2><span class="pd-badge" id="pd-claims-count">0</span><div class="pd-spacer"></div>- <button class="pd-btn pd-btn-sm" id="pd-export-claims" type="button">Export CSV</button>+ <button class="pd-btn pd-btn-sm" id="pd-export-claims" type="button">+ Export CSV+ </button></div><div class="pd-panel-body no-pad"><table class="pd-table"><thead>- <tr><th>Time</th><th>Wallet</th><th>Type</th><th>Token</th><th>Amount</th><th>TX</th></tr>+ <tr>+ <th>Time</th>+ <th>Wallet</th>+ <th>Type</th>+ <th>Token</th>+ <th>Amount</th>+ <th>TX</th>+ </tr></thead><tbody id="pd-claims-table">- <tr><td colspan="6" class="pd-empty">Loading claims…</td></tr>+ <tr>+ <td colspan="6" class="pd-empty">Loading claims…</td>+ </tr></tbody></table></div>@@ -397,19 +775,40 @@<div class="pd-panel-head"><h2>Alert settings</h2></div><div class="pd-panel-body"><div class="pd-toggle-row">- <div class="pd-toggle-label">Graduation alerts<div class="pd-toggle-sub">Notify when tokens graduate to AMM</div></div>- <input class="pd-toggle" type="checkbox" id="pd-alert-graduation" checked />+ <div class="pd-toggle-label">+ Graduation alerts+ <div class="pd-toggle-sub">+ Notify when tokens graduate to AMM+ </div>+ </div>+ <input+ class="pd-toggle"+ type="checkbox"+ id="pd-alert-graduation"+ checked+ /></div><div class="pd-toggle-row">- <div class="pd-toggle-label">Whale trade alerts<div class="pd-toggle-sub">Large buys/sells above threshold</div></div>+ <div class="pd-toggle-label">+ Whale trade alerts+ <div class="pd-toggle-sub">+ Large buys/sells above threshold+ </div>+ </div><input class="pd-toggle" type="checkbox" id="pd-alert-whale" /></div><div class="pd-toggle-row">- <div class="pd-toggle-label">Fee distribution alerts<div class="pd-toggle-sub">Creator fee claim events</div></div>+ <div class="pd-toggle-label">+ Fee distribution alerts+ <div class="pd-toggle-sub">Creator fee claim events</div>+ </div><input class="pd-toggle" type="checkbox" id="pd-alert-fees" /></div><div class="pd-toggle-row">- <div class="pd-toggle-label">New launch alerts<div class="pd-toggle-sub">New token creation events</div></div>+ <div class="pd-toggle-label">+ New launch alerts+ <div class="pd-toggle-sub">New token creation events</div>+ </div><input class="pd-toggle" type="checkbox" id="pd-alert-launch" /></div></div>@@ -420,22 +819,59 @@<div class="pd-panel-body"><div class="pd-form-group"><label>Whale threshold (SOL)</label>- <input class="pd-input" type="number" id="pd-threshold-whale" value="10" min="0.1" step="0.1" />+ <input+ class="pd-input"+ type="number"+ id="pd-threshold-whale"+ value="10"+ min="0.1"+ step="0.1"+ /></div><div class="pd-form-group"><label>Min claim alert (SOL)</label>- <input class="pd-input" type="number" id="pd-threshold-claim" value="0.5" min="0.01" step="0.01" />+ <input+ class="pd-input"+ type="number"+ id="pd-threshold-claim"+ value="0.5"+ min="0.01"+ step="0.01"+ /></div><div class="pd-form-group"><label>Trade alert cooldown (s)</label>- <input class="pd-input" type="number" id="pd-threshold-cooldown" value="30" min="5" step="5" />+ <input+ class="pd-input"+ type="number"+ id="pd-threshold-cooldown"+ value="30"+ min="5"+ step="5"+ /></div><div class="pd-form-group"><label>Webhook URL (optional)</label>- <input class="pd-input" type="url" id="pd-alert-webhook" placeholder="https://your-server.com/pump-alerts" />- <div style="font-size:0.72rem;color:var(--ink-dim);margin-top:0.3rem">Graduation alerts POST here even when no tab is open. Must be https.</div>+ <input+ class="pd-input"+ type="url"+ id="pd-alert-webhook"+ placeholder="https://your-server.com/pump-alerts"+ />+ <div+ style="+ font-size: 0.72rem;+ color: var(--ink-dim);+ margin-top: 0.3rem;+ "+ >+ Graduation alerts POST here even when no tab is open. Must+ be https.+ </div></div>- <button class="pd-btn is-primary" id="pd-save-alerts" type="button">Save settings</button>+ <button class="pd-btn is-primary" id="pd-save-alerts" type="button">+ Save settings+ </button></div></div></div>@@ -444,13 +880,27 @@<div class="pd-panel-head"><h2>Alert history</h2><div class="pd-spacer"></div>- <button class="pd-btn pd-btn-sm" id="pd-clear-alert-feed" type="button">Clear</button>+ <button class="pd-btn pd-btn-sm" id="pd-clear-alert-feed" type="button">+ Clear+ </button></div><div class="pd-panel-body no-pad"><div class="pd-feed" id="pd-alert-feed" style="max-height: 360px"><div class="pd-empty">- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><path d="M5 16c0-4.5 1.5-10 7-10s7 5.5 7 10M3 16h18M10 19h4"/></svg>- <div>No alerts yet — enable rules above to populate this list.</div>+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="1.5"+ aria-hidden="true"+ >+ <path+ d="M5 16c0-4.5 1.5-10 7-10s7 5.5 7 10M3 16h18M10 19h4"+ />+ </svg>+ <div>+ No alerts yet — enable rules above to populate this list.+ </div></div></div></div>@@ -460,14 +910,21 @@<!-- ═══════ Token Scanner page ═══════ --><section class="pd-page" id="page-scanner" aria-label="Token scanner"><div class="pd-form-inline">- <div class="pd-form-group" style="flex:1">+ <div class="pd-form-group" style="flex: 1"><label>Token mint address</label>- <input class="pd-input" type="text" id="pd-scanner-mint" placeholder="Enter Solana token mint…" />+ <input+ class="pd-input"+ type="text"+ id="pd-scanner-mint"+ placeholder="Enter Solana token mint…"+ /></div>- <button class="pd-btn is-primary" id="pd-scan-token" type="button">Scan</button>+ <button class="pd-btn is-primary" id="pd-scan-token" type="button">+ Scan+ </button></div><div id="pd-scanner-results" hidden>- <div class="pd-stat-grid" style="margin-bottom:1rem">+ <div class="pd-stat-grid" style="margin-bottom: 1rem"><div class="pd-stat"><div class="pd-stat-label">Risk score</div><div class="pd-stat-value" id="pd-scan-score">—</div>@@ -490,7 +947,13 @@<div class="pd-panel-head"><h2>Security checks</h2></div><div class="pd-panel-body no-pad"><table class="pd-table">- <thead><tr><th>Check</th><th>Status</th><th>Detail</th></tr></thead>+ <thead>+ <tr>+ <th>Check</th>+ <th>Status</th>+ <th>Detail</th>+ </tr>+ </thead><tbody id="pd-scan-checks"></tbody></table></div>@@ -506,14 +969,32 @@<div class="pd-panel-body"><div class="pd-form-group"><label>Token mint</label>- <input class="pd-input" type="text" id="pd-quote-buy-mint" placeholder="Token mint address…" />+ <input+ class="pd-input"+ type="text"+ id="pd-quote-buy-mint"+ placeholder="Token mint address…"+ /></div><div class="pd-form-group"><label>SOL amount</label>- <input class="pd-input" type="number" id="pd-quote-buy-amount" value="1" min="0.001" step="0.001" />+ <input+ class="pd-input"+ type="number"+ id="pd-quote-buy-amount"+ value="1"+ min="0.001"+ step="0.001"+ /></div>- <button class="pd-btn is-primary" id="pd-get-buy-quote" type="button">Get buy quote</button>- <div id="pd-quote-buy-result" style="margin-top:0.85rem"></div>+ <button+ class="pd-btn is-primary"+ id="pd-get-buy-quote"+ type="button"+ >+ Get buy quote+ </button>+ <div id="pd-quote-buy-result" style="margin-top: 0.85rem"></div></div></div>@@ -522,14 +1003,32 @@<div class="pd-panel-body"><div class="pd-form-group"><label>Token mint</label>- <input class="pd-input" type="text" id="pd-quote-sell-mint" placeholder="Token mint address…" />+ <input+ class="pd-input"+ type="text"+ id="pd-quote-sell-mint"+ placeholder="Token mint address…"+ /></div><div class="pd-form-group"><label>Token amount</label>- <input class="pd-input" type="number" id="pd-quote-sell-amount" value="1000000" min="1" step="1" />+ <input+ class="pd-input"+ type="number"+ id="pd-quote-sell-amount"+ value="1000000"+ min="1"+ step="1"+ /></div>- <button class="pd-btn is-primary" id="pd-get-sell-quote" type="button">Get sell quote</button>- <div id="pd-quote-sell-result" style="margin-top:0.85rem"></div>+ <button+ class="pd-btn is-primary"+ id="pd-get-sell-quote"+ type="button"+ >+ Get sell quote+ </button>+ <div id="pd-quote-sell-result" style="margin-top: 0.85rem"></div></div></div></div>@@ -540,25 +1039,60 @@<div class="pd-panel"><div class="pd-panel-head"><h2>Vanity address generator</h2></div><div class="pd-panel-body">- <div class="pd-callout" style="margin-bottom:1rem">- Grinds Ed25519 keypairs locally in Web Workers. The secret key never leaves your browser. For a fuller UI with worker tuning, use <a href="/vanity-wallet">/vanity-wallet</a>.+ <div class="pd-callout" style="margin-bottom: 1rem">+ Grinds Ed25519 keypairs locally in Web Workers. The secret key never+ leaves your browser. For a fuller UI with worker tuning, use+ <a href="/vanity-wallet">/vanity-wallet</a>.</div><div class="pd-form-row"><div class="pd-form-group"><label>Prefix (optional)</label>- <input class="pd-input" type="text" id="pd-vanity-prefix" placeholder="e.g. pump" maxlength="6" />+ <input+ class="pd-input"+ type="text"+ id="pd-vanity-prefix"+ placeholder="e.g. pump"+ maxlength="6"+ /></div><div class="pd-form-group"><label>Suffix (optional)</label>- <input class="pd-input" type="text" id="pd-vanity-suffix" placeholder="e.g. fun" maxlength="6" />+ <input+ class="pd-input"+ type="text"+ id="pd-vanity-suffix"+ placeholder="e.g. fun"+ maxlength="6"+ /></div></div>- <div style="display:flex;gap:0.5rem">- <button class="pd-btn is-primary" id="pd-vanity-start" type="button">Generate</button>- <button class="pd-btn is-danger" id="pd-vanity-stop" type="button" hidden>Stop</button>+ <div style="display: flex; gap: 0.5rem">+ <button+ class="pd-btn is-primary"+ id="pd-vanity-start"+ type="button"+ >+ Generate+ </button>+ <button+ class="pd-btn is-danger"+ id="pd-vanity-stop"+ type="button"+ hidden+ >+ Stop+ </button></div>- <div id="pd-vanity-status" style="margin-top:0.85rem;font-size:0.82rem;color:var(--ink-dim);font-family:var(--font-mono)"></div>- <div id="pd-vanity-result" style="margin-top:0.85rem"></div>+ <div+ id="pd-vanity-status"+ style="+ margin-top: 0.85rem;+ font-size: 0.82rem;+ color: var(--ink-dim);+ font-family: var(--font-mono);+ "+ ></div>+ <div id="pd-vanity-result" style="margin-top: 0.85rem"></div></div></div></section>@@ -569,24 +1103,76 @@<div class="pd-panel-head"><h2>Default agent</h2></div><div class="pd-panel-body"><div class="pd-config-grid">- <div id="pd-agent-view-container" style="background:#000;border:1px solid var(--stroke);min-height:320px;display:flex;align-items:center;justify-content:center;border-radius:var(--radius-md);overflow:hidden">- <iframe id="pd-agent-iframe" style="width:100%;height:100%;border:none" title="Default agent preview"></iframe>+ <div+ id="pd-agent-view-container"+ style="+ background: #000;+ border: 1px solid var(--stroke);+ min-height: 320px;+ display: flex;+ align-items: center;+ justify-content: center;+ border-radius: var(--radius-md);+ overflow: hidden;+ "+ >+ <iframe+ id="pd-agent-iframe"+ style="width: 100%; height: 100%; border: none"+ title="Default agent preview"+ ></iframe></div><div><div class="pd-form-group"><label>Speech</label>- <input class="pd-input" type="text" id="pd-speech-input" placeholder="Enter text to speak…" />- <div style="display:flex;gap:0.4rem;margin-top:0.5rem">- <button class="pd-btn is-primary" id="pd-speak-btn" type="button">Speak</button>- <button class="pd-btn is-danger" id="pd-speak-stop" type="button" hidden>Stop</button>+ <input+ class="pd-input"+ type="text"+ id="pd-speech-input"+ placeholder="Enter text to speak…"+ />+ <div style="display: flex; gap: 0.4rem; margin-top: 0.5rem">+ <button+ class="pd-btn is-primary"+ id="pd-speak-btn"+ type="button"+ >+ Speak+ </button>+ <button+ class="pd-btn is-danger"+ id="pd-speak-stop"+ type="button"+ hidden+ >+ Stop+ </button></div></div><div class="pd-form-group"><label>Quick actions</label>- <div style="display:flex;gap:0.4rem;flex-wrap:wrap">- <button class="pd-btn" data-agent-action="emote" type="button">Emote</button>- <button class="pd-btn" data-agent-action="wave" type="button">Wave</button>- <button class="pd-btn" data-agent-action="verify" type="button">Verify model</button>+ <div style="display: flex; gap: 0.4rem; flex-wrap: wrap">+ <button+ class="pd-btn"+ data-agent-action="emote"+ type="button"+ >+ Emote+ </button>+ <button+ class="pd-btn"+ data-agent-action="wave"+ type="button"+ >+ Wave+ </button>+ <button+ class="pd-btn"+ data-agent-action="verify"+ type="button"+ >+ Verify model+ </button></div></div><div class="pd-form-group">@@ -597,7 +1183,14 @@<option>Run</option><option>Dance</option></select>- <button class="pd-btn is-primary" id="pd-play-anim" type="button" style="margin-top:0.5rem">Play</button>+ <button+ class="pd-btn is-primary"+ id="pd-play-anim"+ type="button"+ style="margin-top: 0.5rem"+ >+ Play+ </button></div></div></div>@@ -611,9 +1204,18 @@</div><div class="pd-panel-body no-pad"><table class="pd-table">- <thead><tr><th>Name</th><th>Description</th><th>Created</th><th></th></tr></thead>+ <thead>+ <tr>+ <th>Name</th>+ <th>Description</th>+ <th>Created</th>+ <th></th>+ </tr>+ </thead><tbody id="pd-custom-agents-table">- <tr><td colspan="4" class="pd-empty">Loading…</td></tr>+ <tr>+ <td colspan="4" class="pd-empty">Loading…</td>+ </tr></tbody></table></div>@@ -623,13 +1225,13 @@<!-- ═══════ Revenue page ═══════ --><section class="pd-page" id="page-revenue" aria-label="Revenue"><div class="pd-form-inline">- <div class="pd-form-group" style="flex:2">+ <div class="pd-form-group" style="flex: 2"><label>Agent</label><select class="pd-select" id="pd-rev-agent"><option value="">All agents</option></select></div>- <div class="pd-form-group" style="flex:1">+ <div class="pd-form-group" style="flex: 1"><label>Granularity</label><select class="pd-select" id="pd-rev-granularity"><option value="day" selected>Day</option>@@ -637,30 +1239,59 @@<option value="month">Month</option></select></div>- <div class="pd-form-group" style="flex:1">+ <div class="pd-form-group" style="flex: 1"><label>From</label><input class="pd-input" type="date" id="pd-rev-from" /></div>- <div class="pd-form-group" style="flex:1">+ <div class="pd-form-group" style="flex: 1"><label>To</label><input class="pd-input" type="date" id="pd-rev-to" /></div>- <button class="pd-btn is-primary" id="pd-rev-refresh" type="button">Refresh</button>+ <button class="pd-btn is-primary" id="pd-rev-refresh" type="button">+ Refresh+ </button></div>- <div class="pd-stat-grid" id="pd-rev-summary" style="margin-bottom:1rem">- <div class="pd-stat"><div class="pd-stat-label">Gross</div><div class="pd-stat-value" id="pd-rev-gross">—</div><div class="pd-stat-sub" id="pd-rev-currency">—</div></div>- <div class="pd-stat"><div class="pd-stat-label">Platform fees</div><div class="pd-stat-value" id="pd-rev-fees">—</div><div class="pd-stat-sub">Deducted</div></div>- <div class="pd-stat"><div class="pd-stat-label">Net earnings</div><div class="pd-stat-value is-success" id="pd-rev-net">—</div><div class="pd-stat-sub">After fees</div></div>- <div class="pd-stat"><div class="pd-stat-label">Payments</div><div class="pd-stat-value" id="pd-rev-count">—</div><div class="pd-stat-sub" id="pd-rev-chain">—</div></div>+ <div class="pd-stat-grid" id="pd-rev-summary" style="margin-bottom: 1rem">+ <div class="pd-stat">+ <div class="pd-stat-label">Gross</div>+ <div class="pd-stat-value" id="pd-rev-gross">—</div>+ <div class="pd-stat-sub" id="pd-rev-currency">—</div>+ </div>+ <div class="pd-stat">+ <div class="pd-stat-label">Platform fees</div>+ <div class="pd-stat-value" id="pd-rev-fees">—</div>+ <div class="pd-stat-sub">Deducted</div>+ </div>+ <div class="pd-stat">+ <div class="pd-stat-label">Net earnings</div>+ <div class="pd-stat-value is-success" id="pd-rev-net">—</div>+ <div class="pd-stat-sub">After fees</div>+ </div>+ <div class="pd-stat">+ <div class="pd-stat-label">Payments</div>+ <div class="pd-stat-value" id="pd-rev-count">—</div>+ <div class="pd-stat-sub" id="pd-rev-chain">—</div>+ </div></div>- <div class="pd-panel" style="margin-bottom:1rem">+ <div class="pd-panel" style="margin-bottom: 1rem"><div class="pd-panel-head"><h2>Net earnings over time</h2></div><div class="pd-panel-body">- <div id="pd-rev-status" style="font-size:0.85rem;color:var(--ink-dim);margin-bottom:0.5rem;min-height:1.2rem"></div>- <div style="position:relative">- <canvas id="pd-rev-chart" style="width:100%;height:260px;display:block"></canvas>+ <div+ id="pd-rev-status"+ style="+ font-size: 0.85rem;+ color: var(--ink-dim);+ margin-bottom: 0.5rem;+ min-height: 1.2rem;+ "+ ></div>+ <div style="position: relative">+ <canvas+ id="pd-rev-chart"+ style="width: 100%; height: 260px; display: block"+ ></canvas></div></div></div>@@ -669,9 +1300,19 @@<div class="pd-panel-head"><h2>By skill</h2></div><div class="pd-panel-body no-pad"><table class="pd-table">- <thead><tr><th>Skill</th><th style="text-align:right">Payments</th><th style="text-align:right">Net</th></tr></thead>+ <thead>+ <tr>+ <th>Skill</th>+ <th style="text-align: right">Payments</th>+ <th style="text-align: right">Net</th>+ </tr>+ </thead><tbody id="pd-rev-skill-table">- <tr><td colspan="3" class="pd-empty">Open the Revenue tab to load.</td></tr>+ <tr>+ <td colspan="3" class="pd-empty">+ Open the Revenue tab to load.+ </td>+ </tr></tbody></table></div>@@ -680,26 +1321,53 @@<!-- ═══════ Config page ═══════ --><section class="pd-page" id="page-config" aria-label="Configuration">- <div class="pd-callout" style="margin-bottom:1rem">- This page lets you point the dashboard at an external <a href="https://github.com/pumpkit/pumpkit" target="_blank" rel="noopener">PumpKit-style</a> backend for advanced features like watches and fee claim ingestion. By default, the dashboard uses the three.ws-hosted <span class="pd-mono">/api/pump/*</span> endpoints, which power the Live Feed, network health, quotes, and the token scanner without any setup.+ <div class="pd-callout" style="margin-bottom: 1rem">+ This page lets you point the dashboard at an external+ <a href="https://github.com/pumpkit/pumpkit" target="_blank" rel="noopener"+ >PumpKit-style</a+ >+ backend for advanced features like watches and fee claim ingestion. By+ default, the dashboard uses the three.ws-hosted+ <span class="pd-mono">/api/pump/*</span> endpoints, which power the Live+ Feed, network health, quotes, and the token scanner without any setup.</div><div class="pd-config-grid"><div class="pd-panel"><div class="pd-panel-head"><h2>Connection</h2></div><div class="pd-panel-body"><div class="pd-form-group">- <label>API base URL <span class="pd-probe" id="pd-probe-api"></span></label>- <input class="pd-input" type="text" id="pd-cfg-api-url" placeholder="https://your-pumpkit.example" />+ <label+ >API base URL+ <span class="pd-probe" id="pd-probe-api"></span+ ></label>+ <input+ class="pd-input"+ type="text"+ id="pd-cfg-api-url"+ placeholder="https://your-pumpkit.example"+ /></div><div class="pd-form-group">- <label>WebSocket URL <span class="pd-probe" id="pd-probe-ws"></span></label>+ <label+ >WebSocket URL+ <span class="pd-probe" id="pd-probe-ws"></span+ ></label><input class="pd-input" type="text" id="pd-cfg-ws-url" /></div><div class="pd-form-group">- <label>API key <span class="pd-probe" id="pd-probe-key"></span></label>- <input class="pd-input" type="password" id="pd-cfg-api-key" placeholder="Optional API key…" />+ <label+ >API key <span class="pd-probe" id="pd-probe-key"></span+ ></label>+ <input+ class="pd-input"+ type="password"+ id="pd-cfg-api-key"+ placeholder="Optional API key…"+ /></div>- <button class="pd-btn is-primary" id="pd-save-config" type="button">Save & reconnect</button>+ <button class="pd-btn is-primary" id="pd-save-config" type="button">+ Save & reconnect+ </button></div></div>@@ -707,8 +1375,17 @@<div class="pd-panel-head"><h2>Solana RPC</h2></div><div class="pd-panel-body"><div class="pd-form-group">- <label>RPC endpoint <span class="pd-probe" id="pd-probe-rpc"></span></label>- <input class="pd-input" type="text" id="pd-cfg-rpc-url" value="/api/solana-rpc" placeholder="/api/solana-rpc or your own RPC URL" />+ <label+ >RPC endpoint+ <span class="pd-probe" id="pd-probe-rpc"></span+ ></label>+ <input+ class="pd-input"+ type="text"+ id="pd-cfg-rpc-url"+ value="/api/solana-rpc"+ placeholder="/api/solana-rpc or your own RPC URL"+ /></div><div class="pd-form-group"><label>Commitment level</label>@@ -725,37 +1402,124 @@<!-- ═══════ API page ═══════ --><section class="pd-page" id="page-api" aria-label="API reference">- <div class="pd-panel" style="margin-bottom:1rem">+ <div class="pd-panel" style="margin-bottom: 1rem"><div class="pd-panel-head"><h2>Your keys</h2><div class="pd-spacer"></div><span class="pd-badge" id="pd-keys-count">—</span></div><div class="pd-panel-body">- <form id="pd-key-create-form" style="display:flex;gap:0.75rem;flex-wrap:wrap;align-items:flex-end;margin-bottom:1rem">- <div class="pd-form-group" style="flex:2;min-width:200px;margin:0">+ <form+ id="pd-key-create-form"+ style="+ display: flex;+ gap: 0.75rem;+ flex-wrap: wrap;+ align-items: flex-end;+ margin-bottom: 1rem;+ "+ >+ <div+ class="pd-form-group"+ style="flex: 2; min-width: 200px; margin: 0"+ ><label for="pd-key-name">Key name</label>- <input class="pd-input" type="text" id="pd-key-name" maxlength="80" placeholder="e.g. CI pipeline" required />+ <input+ class="pd-input"+ type="text"+ id="pd-key-name"+ maxlength="80"+ placeholder="e.g. CI pipeline"+ required+ /></div>- <div class="pd-form-group" style="flex:1;min-width:160px;margin:0">+ <div+ class="pd-form-group"+ style="flex: 1; min-width: 160px; margin: 0"+ ><label for="pd-key-expiry">Expires (optional)</label>- <input class="pd-input" type="datetime-local" id="pd-key-expiry" />+ <input+ class="pd-input"+ type="datetime-local"+ id="pd-key-expiry"+ /></div>- <div class="pd-form-group" style="flex:2;min-width:240px;margin:0">+ <div+ class="pd-form-group"+ style="flex: 2; min-width: 240px; margin: 0"+ ><label>Scopes</label>- <div style="display:flex;gap:0.85rem;flex-wrap:wrap;font-size:0.82rem;color:var(--ink-dim)">- <label style="display:flex;gap:0.3rem;align-items:center"><input type="checkbox" class="pd-key-scope" value="avatars:read" checked /> avatars:read</label>- <label style="display:flex;gap:0.3rem;align-items:center"><input type="checkbox" class="pd-key-scope" value="avatars:write" checked /> avatars:write</label>- <label style="display:flex;gap:0.3rem;align-items:center"><input type="checkbox" class="pd-key-scope" value="avatars:delete" /> avatars:delete</label>- <label style="display:flex;gap:0.3rem;align-items:center"><input type="checkbox" class="pd-key-scope" value="profile" /> profile</label>+ <div+ style="+ display: flex;+ gap: 0.85rem;+ flex-wrap: wrap;+ font-size: 0.82rem;+ color: var(--ink-dim);+ "+ >+ <label+ style="display: flex; gap: 0.3rem; align-items: center"+ ><input+ type="checkbox"+ class="pd-key-scope"+ value="avatars:read"+ checked+ />+ avatars:read</label+ >+ <label+ style="display: flex; gap: 0.3rem; align-items: center"+ ><input+ type="checkbox"+ class="pd-key-scope"+ value="avatars:write"+ checked+ />+ avatars:write</label+ >+ <label+ style="display: flex; gap: 0.3rem; align-items: center"+ ><input+ type="checkbox"+ class="pd-key-scope"+ value="avatars:delete"+ />+ avatars:delete</label+ >+ <label+ style="display: flex; gap: 0.3rem; align-items: center"+ ><input+ type="checkbox"+ class="pd-key-scope"+ value="profile"+ />+ profile</label+ ></div></div>- <button class="pd-btn is-primary" id="pd-key-create" type="submit">Create key</button>+ <button class="pd-btn is-primary" id="pd-key-create" type="submit">+ Create key+ </button></form><table class="pd-table">- <thead><tr><th>Name</th><th>Prefix</th><th>Scopes</th><th>Created</th><th>Last used</th><th>Expires</th><th></th></tr></thead>+ <thead>+ <tr>+ <th>Name</th>+ <th>Prefix</th>+ <th>Scopes</th>+ <th>Created</th>+ <th>Last used</th>+ <th>Expires</th>+ <th></th>+ </tr>+ </thead><tbody id="pd-keys-table">- <tr><td colspan="7" class="pd-empty">Open the API tab to load your keys.</td></tr>+ <tr>+ <td colspan="7" class="pd-empty">+ Open the API tab to load your keys.+ </td>+ </tr></tbody></table></div>@@ -763,26 +1527,86 @@<div class="pd-panel"><div class="pd-panel-head"><h2>API endpoints</h2></div><div class="pd-panel-body">- <p style="color:var(--ink-dim);font-size:0.88rem;margin-bottom:1rem">+ <p+ style="+ color: var(--ink-dim);+ font-size: 0.88rem;+ margin-bottom: 1rem;+ "+ >three.ws ships these Pump endpoints for free, no auth required.- Resolved against: <span class="pd-mono-inline" id="pd-api-endpoint-display">—</span>+ Resolved against:+ <span class="pd-mono-inline" id="pd-api-endpoint-display">—</span></p><table class="pd-table"><thead>- <tr><th>Method</th><th>Path</th><th>Description</th><th>Auth</th></tr>+ <tr>+ <th>Method</th>+ <th>Path</th>+ <th>Description</th>+ <th>Auth</th>+ </tr></thead><tbody>- <tr><td><span class="pd-tag is-buy">GET</span></td><td class="pd-mono">/api/healthz</td><td>Health check</td><td>No</td></tr>- <tr><td><span class="pd-tag is-buy">GET</span></td><td class="pd-mono">/api/pump/helius-stats</td><td>SOL price, network slot, feed counts</td><td>No</td></tr>- <tr><td><span class="pd-tag is-buy">GET</span></td><td class="pd-mono">/api/pump/channel-feed</td><td>Recent mints, whales, claims (paginated)</td><td>No</td></tr>- <tr><td><span class="pd-tag is-buy">GET</span></td><td class="pd-mono">/api/pump/trades-stream</td><td>SSE live trade stream (PumpPortal proxy)</td><td>No</td></tr>- <tr><td><span class="pd-tag is-buy">GET</span></td><td class="pd-mono">/api/pump/curve?mint=…</td><td>Bonding curve, spot price, graduation progress</td><td>No</td></tr>- <tr><td><span class="pd-tag is-buy">GET</span></td><td class="pd-mono">/api/pump/quote-sdk?mint=…&side=buy|sell&amount=…</td><td>Buy/sell quote with price impact</td><td>No</td></tr>- <tr><td><span class="pd-tag is-buy">GET</span></td><td class="pd-mono">/api/pump/balances</td><td>SOL + token balances for the signed-in wallet</td><td>Session</td></tr>- <tr><td><span class="pd-tag is-buy">GET</span></td><td class="pd-mono">/api/agents/pumpfun?op=claims</td><td>Recent fee claim feed</td><td>Session</td></tr>+ <tr>+ <td><span class="pd-tag is-buy">GET</span></td>+ <td class="pd-mono">/api/healthz</td>+ <td>Health check</td>+ <td>No</td>+ </tr>+ <tr>+ <td><span class="pd-tag is-buy">GET</span></td>+ <td class="pd-mono">/api/pump/helius-stats</td>+ <td>SOL price, network slot, feed counts</td>+ <td>No</td>+ </tr>+ <tr>+ <td><span class="pd-tag is-buy">GET</span></td>+ <td class="pd-mono">/api/pump/channel-feed</td>+ <td>Recent mints, whales, claims (paginated)</td>+ <td>No</td>+ </tr>+ <tr>+ <td><span class="pd-tag is-buy">GET</span></td>+ <td class="pd-mono">/api/pump/trades-stream</td>+ <td>SSE live trade stream (PumpPortal proxy)</td>+ <td>No</td>+ </tr>+ <tr>+ <td><span class="pd-tag is-buy">GET</span></td>+ <td class="pd-mono">/api/pump/curve?mint=…</td>+ <td>Bonding curve, spot price, graduation progress</td>+ <td>No</td>+ </tr>+ <tr>+ <td><span class="pd-tag is-buy">GET</span></td>+ <td class="pd-mono">+ /api/pump/quote-sdk?mint=…&side=buy|sell&amount=…+ </td>+ <td>Buy/sell quote with price impact</td>+ <td>No</td>+ </tr>+ <tr>+ <td><span class="pd-tag is-buy">GET</span></td>+ <td class="pd-mono">/api/pump/balances</td>+ <td>SOL + token balances for the signed-in wallet</td>+ <td>Session</td>+ </tr>+ <tr>+ <td><span class="pd-tag is-buy">GET</span></td>+ <td class="pd-mono">/api/agents/pumpfun?op=claims</td>+ <td>Recent fee claim feed</td>+ <td>Session</td>+ </tr></tbody></table>- <p style="color:var(--ink-dim);font-size:0.82rem;margin-top:0.85rem">+ <p+ style="+ color: var(--ink-dim);+ font-size: 0.82rem;+ margin-top: 0.85rem;+ "+ >For an OpenAPI spec, see <a href="/openapi.json">/openapi.json</a>.</p></div>@@ -792,37 +1616,71 @@</div><!-- ── Add Watch Modal ────────────────── -->- <div class="pd-modal-backdrop" id="pd-add-watch-modal" role="dialog" aria-modal="true" aria-labelledby="pd-add-watch-title">+ <div+ class="pd-modal-backdrop"+ id="pd-add-watch-modal"+ role="dialog"+ aria-modal="true"+ aria-labelledby="pd-add-watch-title"+ ><div class="pd-modal"><h3 id="pd-add-watch-title">Add watch</h3><div class="pd-form-group"><label>Wallet address *</label>- <input class="pd-input" type="text" id="pd-watch-wallet" placeholder="Solana wallet address…" />+ <input+ class="pd-input"+ type="text"+ id="pd-watch-wallet"+ placeholder="Solana wallet address…"+ /></div><div class="pd-form-group"><label>Label</label>- <input class="pd-input" type="text" id="pd-watch-label" placeholder="Optional label…" />+ <input+ class="pd-input"+ type="text"+ id="pd-watch-label"+ placeholder="Optional label…"+ /></div><div class="pd-form-group"><label>Token filter (comma-separated mints)</label>- <input class="pd-input" type="text" id="pd-watch-token-filter" placeholder="Leave empty for all tokens" />+ <input+ class="pd-input"+ type="text"+ id="pd-watch-token-filter"+ placeholder="Leave empty for all tokens"+ /></div><div class="pd-form-group"><label>Webhook URL</label>- <input class="pd-input" type="text" id="pd-watch-webhook" placeholder="https://your-server.com/webhook" />+ <input+ class="pd-input"+ type="text"+ id="pd-watch-webhook"+ placeholder="https://your-server.com/webhook"+ /></div><div class="pd-modal-actions"><button class="pd-btn" id="pd-cancel-watch" type="button">Cancel</button>- <button class="pd-btn is-primary" id="pd-create-watch" type="button">Create watch</button>+ <button class="pd-btn is-primary" id="pd-create-watch" type="button">+ Create watch+ </button></div></div></div><!-- ── API key created modal (shows plaintext token once) ────────────── -->- <div class="pd-modal-backdrop" id="pd-key-modal" role="dialog" aria-modal="true" aria-labelledby="pd-key-modal-title">+ <div+ class="pd-modal-backdrop"+ id="pd-key-modal"+ role="dialog"+ aria-modal="true"+ aria-labelledby="pd-key-modal-title"+ ><div class="pd-modal"><h3 id="pd-key-modal-title">API key created</h3>- <p style="font-size:0.85rem;color:var(--warn);margin:0 0 0.75rem">+ <p style="font-size: 0.85rem; color: var(--warn); margin: 0 0 0.75rem">Copy this token now — you won't be able to see it again.</p><div class="pd-form-group">@@ -849,7 +1707,11 @@import { grindVanity } from '/src/solana/vanity/grinder.js';import { validatePattern } from '/src/solana/vanity/validation.js';- import { initWalletButton, getConnectedWallet, getConnectedWalletAddress } from '/src/wallet.js';+ import {+ initWalletButton,+ getConnectedWallet,+ getConnectedWalletAddress,+ } from '/src/wallet.js';import { emptyStateHTML } from '/src/shared/state-kit.js';const PAGE_TITLES = {@@ -901,15 +1763,29 @@};function safeParseJson(s, fallback) {- try { return JSON.parse(s); } catch { return fallback; }+ try {+ return JSON.parse(s);+ } catch {+ return fallback;+ }}- function $(id) { return document.getElementById(id); }+ function $(id) {+ return document.getElementById(id);+ }function escapeHtml(s) {- return String(s).replace(/[&<>"']/g, (c) => ({- '&': '&', '<': '<', '>': '>', '"': '"', "'": ''',- }[c]));+ return String(s).replace(+ /[&<>"']/g,+ (c) =>+ ({+ '&': '&',+ '<': '<',+ '>': '>',+ '"': '"',+ "'": ''',+ })[c],+ );}function shortAddr(addr) {@@ -928,7 +1804,10 @@div.className = `pd-toast is-${kind}`;div.textContent = message;host.appendChild(div);- setTimeout(() => { div.style.opacity = '0'; div.style.transform = 'translateX(8px)'; }, 3500);+ setTimeout(() => {+ div.style.opacity = '0';+ div.style.transform = 'translateX(8px)';+ }, 3500);setTimeout(() => div.remove(), 4000);}@@ -948,7 +1827,9 @@state.currentPage = page;// Keep the URL shareable: every cockpit page is deep-linkable via its #hash.if (location.hash.slice(1) !== page) history.replaceState(null, '', '#' + page);- document.querySelectorAll('.pd-page').forEach((p) => p.classList.remove('is-active'));+ document+ .querySelectorAll('.pd-page')+ .forEach((p) => p.classList.remove('is-active'));const target = $('page-' + page);if (target) target.classList.add('is-active');document.querySelectorAll('.pd-sidebar nav a').forEach((a) => {@@ -962,7 +1843,11 @@if (page === 'revenue') loadRevenue();if (page === 'api') loadApiKeys();if (page === 'alerts') loadAlertConfig();- if (page === 'dashboard') { loadFeaturedAgent(); loadTrendingTokens(); pollMonitorStats(); }+ if (page === 'dashboard') {+ loadFeaturedAgent();+ loadTrendingTokens();+ pollMonitorStats();+ }}// ── API health + network ─────────────────────────────────────@@ -996,10 +1881,15 @@function updateApiStatus(status) {const dot = $('pd-api-dot');const label = $('pd-api-status');- dot.className = 'pd-dot ' + (status === 'connected' ? 'is-on' : status === 'error' ? 'is-err' : 'is-warm');- label.textContent = status === 'connected' ? 'API: connected'- : status === 'error' ? 'API: disconnected'- : 'API: connecting…';+ dot.className =+ 'pd-dot ' ++ (status === 'connected' ? 'is-on' : status === 'error' ? 'is-err' : 'is-warm');+ label.textContent =+ status === 'connected'+ ? 'API: connected'+ : status === 'error'+ ? 'API: disconnected'+ : 'API: connecting…';}async function refreshNetworkStats() {@@ -1018,9 +1908,16 @@const h = data.helius || {};if (h.enabled) {- $('pd-stat-rpc').textContent = h.slot ? Number(h.slot).toLocaleString() : 'On';+ $('pd-stat-rpc').textContent = h.slot+ ? Number(h.slot).toLocaleString()+ : 'On';$('pd-stat-rpc').classList.add('is-success');- $('pd-stat-rpc-sub').textContent = (h.network || 'mainnet') + ' · ' + (h.blockTime ? new Date(h.blockTime * 1000).toLocaleTimeString() : 'live');+ $('pd-stat-rpc-sub').textContent =+ (h.network || 'mainnet') ++ ' · ' ++ (h.blockTime+ ? new Date(h.blockTime * 1000).toLocaleTimeString()+ : 'live');$('pd-network-badge').textContent = 'Helius live';} else {$('pd-stat-rpc').textContent = 'Public RPC';@@ -1031,13 +1928,18 @@const f = data.feed || {};$('pd-stat-mints').textContent = Number(f.mints || 0).toLocaleString();$('pd-stat-grads').textContent = Number(f.graduations || 0).toLocaleString();- } catch { /* network panel is best-effort */ }+ } catch {+ /* network panel is best-effort */+ }}// ── Featured agent ───────────────────────────────────────────function initialsOf(name) {- const words = String(name || '').trim().split(/\s+/).filter(Boolean);+ const words = String(name || '')+ .trim()+ .split(/\s+/)+ .filter(Boolean);if (!words.length) return '?';if (words.length === 1) return words[0].slice(0, 2).toUpperCase();return (words[0][0] + words[words.length - 1][0]).toUpperCase();@@ -1068,11 +1970,13 @@const resp = await apiFetch('/api/agents/featured');if (resp.status === 404) {nameEl.textContent = 'No agents available yet';- descEl.textContent = 'Be the first — create a 3D agent and it can be featured here.';+ descEl.textContent =+ 'Be the first — create a 3D agent and it can be featured here.';linkEl.textContent = 'Create agent';linkEl.href = '/create';if (statsEl) statsEl.hidden = true;- $('pd-featured-avatar').innerHTML = `<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--ink-dim);font-size:0.8rem">No agents yet</div>`;+ $('pd-featured-avatar').innerHTML =+ `<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--ink-dim);font-size:0.8rem">No agents yet</div>`;return;}if (!resp.ok) throw new Error('featured ' + resp.status);@@ -1080,18 +1984,23 @@nameEl.textContent = agent.display_name || 'Untitled agent';descEl.textContent = agent.bio || 'A featured 3D agent on three.ws.';linkEl.textContent = 'View profile';- linkEl.href = agent.detail_url || ('/agent/' + agent.id);+ linkEl.href = agent.detail_url || '/agent/' + agent.id;if (statsEl) {statsEl.hidden = false;statsEl.innerHTML = [`<span class="pd-featured-stat"><span class="pd-featured-stat-label">ID</span>${shortAddr(agent.id)}</span>`,- agent.net_30d > 0 ? `<span class="pd-featured-stat"><span class="pd-featured-stat-label">30d net</span>${(agent.net_30d / 1e6).toLocaleString(undefined, { maximumFractionDigits: 2 })} USDC</span>` : '',- ].filter(Boolean).join('');+ agent.net_30d > 0+ ? `<span class="pd-featured-stat"><span class="pd-featured-stat-label">30d net</span>${(agent.net_30d / 1e6).toLocaleString(undefined, { maximumFractionDigits: 2 })} USDC</span>`+ : '',+ ]+ .filter(Boolean)+ .join('');}renderFeaturedAvatar(agent);} catch {nameEl.textContent = 'Couldn’t load featured agent';- descEl.textContent = 'Try refreshing, or check connectivity in the Configuration tab.';+ descEl.textContent =+ 'Try refreshing, or check connectivity in the Configuration tab.';if (statsEl) statsEl.hidden = true;}}@@ -1118,7 +2027,8 @@if (empty) empty.hidden = true;if (disconnectBtn) disconnectBtn.hidden = false;holdings.hidden = false;- holdings.innerHTML = '<div style="font-size:0.85rem;color:var(--ink-dim)">Loading balances…</div>';+ holdings.innerHTML =+ '<div style="font-size:0.85rem;color:var(--ink-dim)">Loading balances…</div>';try {const resp = await apiFetch('/api/wallet/balances', {@@ -1128,7 +2038,10 @@});const data = await resp.json().catch(() => ({}));if (!resp.ok) {- const msg = data.error_description || data.error || `Balance lookup failed (${resp.status})`;+ const msg =+ data.error_description ||+ data.error ||+ `Balance lookup failed (${resp.status})`;holdings.innerHTML = `<div style="font-size:0.85rem;color:var(--danger)">${escapeHtml(msg)}</div>`;return;}@@ -1158,27 +2071,37 @@<div class="pd-stat-sub">${solUsd > 0 ? '$' + solUsd.toLocaleString(undefined, { maximumFractionDigits: 2 }) : '—'}</div></div><div style="font-size:0.78rem;color:var(--ink-dim);margin-bottom:0.45rem;font-family:var(--font-display);text-transform:uppercase;letter-spacing:0.08em">Top holdings</div>- ${tokens.length === 0 ? '<div style="font-size:0.85rem;color:var(--ink-dim)">No SPL tokens</div>' : `+ ${+ tokens.length === 0+ ? '<div style="font-size:0.85rem;color:var(--ink-dim)">No SPL tokens</div>'+ : `<table class="pd-table"><thead><tr><th>Token</th><th style="text-align:right">Amount</th><th style="text-align:right">USD</th></tr></thead><tbody>- ${tokens.map((t) => `+ ${tokens+ .map(+ (t) => `<tr><td>${t.logo ? `<img class="pd-token-logo" src="${escapeHtml(t.logo)}" alt="" />` : ''}<span class="pd-mono">${escapeHtml(t.symbol || shortAddr(t.mint || ''))}</span></td><td style="text-align:right" class="pd-mono">${t.amount.toLocaleString(undefined, { maximumFractionDigits: 4 })}</td><td style="text-align:right" class="pd-mono">${t.usd > 0 ? '$' + t.usd.toLocaleString(undefined, { maximumFractionDigits: 2 }) : '—'}</td></tr>- `).join('')}+ `,+ )+ .join('')}</tbody></table>- `}+ `+ }`;}function disconnectWallet() {try {getConnectedWallet()?.disconnect?.();- } catch { /* provider may already be disconnected */ }+ } catch {+ /* provider may already be disconnected */+ }onWalletChanged(null);}@@ -1191,7 +2114,8 @@try {const resp = await apiFetch('/api/agents');if (resp.status === 401) {- tbody.innerHTML = '<tr><td colspan="4" class="pd-empty">Sign in to manage your agents. <a href="/login" style="color:var(--accent)">Sign in</a></td></tr>';+ tbody.innerHTML =+ '<tr><td colspan="4" class="pd-empty">Sign in to manage your agents. <a href="/login" style="color:var(--accent)">Sign in</a></td></tr>';return;}if (!resp.ok) {@@ -1210,9 +2134,12 @@})}</td></tr>`;return;}- tbody.innerHTML = agents.map((a) => {- const created = a.created_at ? new Date(a.created_at).toLocaleDateString() : '—';- return `<tr data-agent-row="${escapeHtml(a.id)}">+ tbody.innerHTML = agents+ .map((a) => {+ const created = a.created_at+ ? new Date(a.created_at).toLocaleDateString()+ : '—';+ return `<tr data-agent-row="${escapeHtml(a.id)}"><td>${escapeHtml(a.name || a.id)}</td><td>${escapeHtml((a.description || '').slice(0, 80))}</td><td class="pd-mono">${created}</td>@@ -1222,12 +2149,16 @@<button class="pd-btn pd-btn-sm is-danger" type="button" data-delete-agent="${escapeHtml(a.id)}" data-agent-name="${escapeHtml(a.name || a.id)}">Delete</button></td></tr>`;- }).join('');+ })+ .join('');tbody.querySelectorAll('[data-delete-agent]').forEach((b) => {- b.addEventListener('click', () => deleteAgent(b.dataset.deleteAgent, b.dataset.agentName));+ b.addEventListener('click', () =>+ deleteAgent(b.dataset.deleteAgent, b.dataset.agentName),+ );});} catch {- tbody.innerHTML = '<tr><td colspan="4" class="pd-empty">Failed to load agents.</td></tr>';+ tbody.innerHTML =+ '<tr><td colspan="4" class="pd-empty">Failed to load agents.</td></tr>';}}@@ -1237,13 +2168,19 @@const csrf = await getCsrfToken();const headers = {};if (csrf) headers['x-csrf-token'] = csrf;- const resp = await apiFetch('/api/agents/' + encodeURIComponent(id), { method: 'DELETE', headers });+ const resp = await apiFetch('/api/agents/' + encodeURIComponent(id), {+ method: 'DELETE',+ headers,+ });if (resp.ok) {toast('Agent deleted', 'success');loadCustomAgents();} else {const err = await resp.json().catch(() => ({}));- toast(err.error_description || err.error || `Delete failed (${resp.status})`, 'error');+ toast(+ err.error_description || err.error || `Delete failed (${resp.status})`,+ 'error',+ );}} catch (e) {toast('Network error: ' + (e.message || 'delete failed'), 'error');@@ -1260,10 +2197,13 @@const { agent } = await resp.json();if (agent && agent.id) {state.agentId = agent.id;- $('pd-agent-iframe').src = `/agent-embed.html?id=${encodeURIComponent(agent.id)}`;+ $('pd-agent-iframe').src =+ `/agent-embed.html?id=${encodeURIComponent(agent.id)}`;}}- } catch { /* show empty state */ }+ } catch {+ /* show empty state */+ }}loadCustomAgents();}@@ -1274,7 +2214,10 @@toast('Agent preview not ready yet', 'error');return false;}- iframe.contentWindow.postMessage({ agentId: state.agentId, type: 'agent:action', action }, '*');+ iframe.contentWindow.postMessage(+ { agentId: state.agentId, type: 'agent:action', action },+ '*',+ );return true;}@@ -1286,14 +2229,24 @@switch (type) {case 'speak': {const text = $('pd-speech-input').value.trim();- if (!text) { toast('Enter something to speak', 'error'); return; }+ if (!text) {+ toast('Enter something to speak', 'error');+ return;+ }if (postAgentAction({ type: 'speak', text })) setSpeaking(true);return;}- case 'emote': action = { type: 'emote', name: 'dance' }; break;- case 'wave': action = { type: 'gesture', name: 'wave' }; break;- case 'verify': action = { type: 'validate-model' }; break;- default: return;+ case 'emote':+ action = { type: 'emote', name: 'dance' };+ break;+ case 'wave':+ action = { type: 'gesture', name: 'wave' };+ break;+ case 'verify':+ action = { type: 'validate-model' };+ break;+ default:+ return;}postAgentAction(action);}@@ -1332,11 +2285,14 @@const name = $('pd-anim-select').value.toLowerCase();const iframe = $('pd-agent-iframe');if (!iframe || !iframe.contentWindow || !state.agentId) return;- iframe.contentWindow.postMessage({- agentId: state.agentId,- type: 'agent:action',- action: { type: 'gesture', name },- }, '*');+ iframe.contentWindow.postMessage(+ {+ agentId: state.agentId,+ type: 'agent:action',+ action: { type: 'gesture', name },+ },+ '*',+ );}// ── Channel feed (pre-populate Live Feed on load) ────────────@@ -1348,20 +2304,38 @@const data = await r.json();const items = data.events || data.items || data;if (!Array.isArray(items)) return;- items.slice().reverse().forEach((evt) => {- const type = evt.kind === 'mint' ? 'launch'- : evt.kind === 'whale' ? 'whale'- : evt.kind === 'claim' ? 'claim'- : 'trade';- handleWsEvent({ type, ...evt, timestamp: evt.created_at || evt.timestamp || Date.now() });- });- } catch { /* preload is best-effort */ }+ items+ .slice()+ .reverse()+ .forEach((evt) => {+ const type =+ evt.kind === 'mint'+ ? 'launch'+ : evt.kind === 'whale'+ ? 'whale'+ : evt.kind === 'claim'+ ? 'claim'+ : 'trade';+ handleWsEvent({+ type,+ ...evt,+ timestamp: evt.created_at || evt.timestamp || Date.now(),+ });+ });+ } catch {+ /* preload is best-effort */+ }}// ── WebSocket (PumpPortal realtime) ──────────────────────────function connectWebSocket() {- if (state.ws) { try { state.ws.close(); } catch {} state.ws = null; }+ if (state.ws) {+ try {+ state.ws.close();+ } catch {}+ state.ws = null;+ }const wsDot = $('pd-ws-dot');const wsLabel = $('pd-ws-status');wsDot.className = 'pd-dot is-warm';@@ -1376,12 +2350,17 @@try {state.ws.send(JSON.stringify({ method: 'subscribeNewToken' }));state.ws.send(JSON.stringify({ method: 'subscribeMigration' }));- } catch { /* socket race; reconnect will retry */ }+ } catch {+ /* socket race; reconnect will retry */+ }}};state.ws.onmessage = (event) => {- try { handleWsEvent(JSON.parse(event.data)); }- catch { /* ignore non-JSON */ }+ try {+ handleWsEvent(JSON.parse(event.data));+ } catch {+ /* ignore non-JSON */+ }};state.ws.onclose = () => {wsDot.className = 'pd-dot';@@ -1465,22 +2444,23 @@div.dataset.type = item.type;const tagInfo = {- launch: { cls: 'is-launch', label: 'LAUNCH' },- create: { cls: 'is-launch', label: 'LAUNCH' },- mint: { cls: 'is-launch', label: 'LAUNCH' },- trade: { cls: 'is-buy', label: 'TRADE' },- buy: { cls: 'is-buy', label: 'BUY' },- sell: { cls: 'is-sell', label: 'SELL' },- whale: { cls: 'is-whale', label: 'WHALE' },- whale_trade:{ cls: 'is-whale', label: 'WHALE' },- graduation: { cls: 'is-grad', label: 'GRAD' },- complete: { cls: 'is-grad', label: 'GRAD' },- claim: { cls: 'is-claim', label: 'CLAIM' },- fee_claim: { cls: 'is-claim', label: 'CLAIM' },+ launch: { cls: 'is-launch', label: 'LAUNCH' },+ create: { cls: 'is-launch', label: 'LAUNCH' },+ mint: { cls: 'is-launch', label: 'LAUNCH' },+ trade: { cls: 'is-buy', label: 'TRADE' },+ buy: { cls: 'is-buy', label: 'BUY' },+ sell: { cls: 'is-sell', label: 'SELL' },+ whale: { cls: 'is-whale', label: 'WHALE' },+ whale_trade: { cls: 'is-whale', label: 'WHALE' },+ graduation: { cls: 'is-grad', label: 'GRAD' },+ complete: { cls: 'is-grad', label: 'GRAD' },+ claim: { cls: 'is-claim', label: 'CLAIM' },+ fee_claim: { cls: 'is-claim', label: 'CLAIM' },}[item.type] || { cls: '', label: item.type.toUpperCase() };const d = item.data;- let title = '', detail = '';+ let title = '',+ detail = '';if (item.type === 'launch' || item.type === 'create' || item.type === 'mint') {title = `${d.name || d.tokenName || d.symbol || 'New token'} (${d.symbol || d.tokenSymbol || '?'})`;detail = d.mint ? shortAddr(d.mint) : '';@@ -1511,7 +2491,10 @@`;// Only the live feed is filterable; hide the new row up front if it// doesn't match the active filter, instead of re-scanning all rows.- if (feedId === 'pd-live-feed' && !rowMatchesFilter(item.type, state.currentFilter)) {+ if (+ feedId === 'pd-live-feed' &&+ !rowMatchesFilter(item.type, state.currentFilter)+ ) {div.style.display = 'none';}@@ -1521,10 +2504,10 @@const FEED_FILTER_GROUPS = {launch: ['launch', 'create', 'mint'],- trade: ['trade', 'buy', 'sell'],- whale: ['whale', 'whale_trade'],+ trade: ['trade', 'buy', 'sell'],+ whale: ['whale', 'whale_trade'],graduation: ['graduation', 'complete'],- claim: ['claim', 'fee_claim'],+ claim: ['claim', 'fee_claim'],};function rowMatchesFilter(type, filter) {@@ -1539,7 +2522,9 @@const feed = $('pd-live-feed');if (!feed) return;feed.querySelectorAll('.pd-feed-item').forEach((item) => {- item.style.display = rowMatchesFilter(item.dataset.type, state.currentFilter) ? '' : 'none';+ item.style.display = rowMatchesFilter(item.dataset.type, state.currentFilter)+ ? ''+ : 'none';});}@@ -1557,13 +2542,17 @@function checkAlerts(item) {const ac = state.alertConfig;const t = item.type;- if ((t === 'graduation' || t === 'complete') && ac.graduation !== false) addAlertItem(item, 'Token graduated');+ if ((t === 'graduation' || t === 'complete') && ac.graduation !== false)+ addAlertItem(item, 'Token graduated');if ((t === 'whale' || t === 'whale_trade') && ac.whale) {const threshold = parseFloat(ac.whaleThreshold) || 10;- if ((Number(item.data.solAmount) || 0) >= threshold) addAlertItem(item, 'Whale trade detected');+ if ((Number(item.data.solAmount) || 0) >= threshold)+ addAlertItem(item, 'Whale trade detected');}- if ((t === 'claim' || t === 'fee_claim') && ac.fees) addAlertItem(item, 'Fee claimed');- if ((t === 'launch' || t === 'create' || t === 'mint') && ac.launch) addAlertItem(item, 'New token launched');+ if ((t === 'claim' || t === 'fee_claim') && ac.fees)+ addAlertItem(item, 'Fee claimed');+ if ((t === 'launch' || t === 'create' || t === 'mint') && ac.launch)+ addAlertItem(item, 'New token launched');}function addAlertItem(item, label) {@@ -1617,7 +2606,9 @@localStorage.setItem('pumpbot-alerts', JSON.stringify(data));applyAlertConfigToForm(data);_alertConfigLoaded = true;- } catch { /* keep local cache */ }+ } catch {+ /* keep local cache */+ }}async function loadServerAlerts() {@@ -1626,14 +2617,27 @@if (!resp.ok) return;const { notifications } = await resp.json();if (!Array.isArray(notifications) || !notifications.length) return;- notifications.slice().reverse().forEach((n) => {- const p = n.payload || {};- addAlertItem({- time: new Date(n.created_at),- data: { name: p.name, tokenSymbol: p.symbol, mint: p.mint, solAmount: p.amount_sol },- }, `Graduated · ${p.symbol || p.name || 'token'}`);- });- } catch { /* server history is best-effort */ }+ notifications+ .slice()+ .reverse()+ .forEach((n) => {+ const p = n.payload || {};+ addAlertItem(+ {+ time: new Date(n.created_at),+ data: {+ name: p.name,+ tokenSymbol: p.symbol,+ mint: p.mint,+ solAmount: p.amount_sol,+ },+ },+ `Graduated · ${p.symbol || p.name || 'token'}`,+ );+ });+ } catch {+ /* server history is best-effort */+ }}async function saveAlertConfig() {@@ -1656,14 +2660,21 @@const csrf = await getCsrfToken();const headers = { 'Content-Type': 'application/json' };if (csrf) headers['x-csrf-token'] = csrf;- const resp = await apiFetch('/api/alerts/config', { method: 'PUT', headers, body: JSON.stringify(payload) });+ const resp = await apiFetch('/api/alerts/config', {+ method: 'PUT',+ headers,+ body: JSON.stringify(payload),+ });if (resp.status === 401) {toast('Sign in to save alerts across devices', 'error');return;}if (!resp.ok) {const err = await resp.json().catch(() => ({}));- toast(err.error_description || err.error || `Save failed (${resp.status})`, 'error');+ toast(+ err.error_description || err.error || `Save failed (${resp.status})`,+ 'error',+ );return;}const { data } = await resp.json();@@ -1696,10 +2707,13 @@const watches = data.data || data.watches || [];$('pd-watches-count').textContent = String(watches.length);if (watches.length === 0) {- tbody.innerHTML = '<tr><td colspan="6" class="pd-empty">No watches yet. Click <strong>+ Add watch</strong> to create one.</td></tr>';+ tbody.innerHTML =+ '<tr><td colspan="6" class="pd-empty">No watches yet. Click <strong>+ Add watch</strong> to create one.</td></tr>';return;}- tbody.innerHTML = watches.map((w) => `+ tbody.innerHTML = watches+ .map(+ (w) => `<tr><td><a class="pd-addr" href="https://solscan.io/account/${escapeHtml(w.wallet)}" target="_blank" rel="noopener">${shortAddr(w.wallet)}</a></td><td>${escapeHtml(w.label || '—')}</td>@@ -1708,7 +2722,9 @@<td class="pd-mono">${w.createdAt ? new Date(w.createdAt).toLocaleDateString() : '—'}</td><td><button class="pd-btn pd-btn-sm is-danger" data-delete-watch="${escapeHtml(w.id)}" type="button">Delete</button></td></tr>- `).join('');+ `,+ )+ .join('');tbody.querySelectorAll('[data-delete-watch]').forEach((b) => {b.addEventListener('click', () => deleteWatch(b.dataset.deleteWatch));});@@ -1719,12 +2735,20 @@async function createWatch() {const wallet = $('pd-watch-wallet').value.trim();- if (!wallet) { toast('Wallet address is required', 'error'); return; }+ if (!wallet) {+ toast('Wallet address is required', 'error');+ return;+ }const tokenFilterRaw = $('pd-watch-token-filter').value.trim();const body = {wallet,label: $('pd-watch-label').value.trim() || undefined,- tokenFilter: tokenFilterRaw ? tokenFilterRaw.split(',').map((s) => s.trim()).filter(Boolean) : undefined,+ tokenFilter: tokenFilterRaw+ ? tokenFilterRaw+ .split(',')+ .map((s) => s.trim())+ .filter(Boolean)+ : undefined,webhookUrl: $('pd-watch-webhook').value.trim() || undefined,};try {@@ -1737,7 +2761,14 @@toast('Watch created', 'success');closeModal('pd-add-watch-modal');refreshWatches();- ['pd-watch-wallet', 'pd-watch-label', 'pd-watch-token-filter', 'pd-watch-webhook'].forEach((id) => { $(id).value = ''; });+ [+ 'pd-watch-wallet',+ 'pd-watch-label',+ 'pd-watch-token-filter',+ 'pd-watch-webhook',+ ].forEach((id) => {+ $(id).value = '';+ });} else {const err = await resp.json().catch(() => ({}));toast(err.error || 'Failed to create watch', 'error');@@ -1750,10 +2781,18 @@async function deleteWatch(id) {if (!confirm('Delete this watch?')) return;try {- const resp = await apiFetch('/api/v1/watches/' + encodeURIComponent(id), { method: 'DELETE' });- if (resp.ok) { toast('Watch deleted', 'success'); refreshWatches(); }- else { toast('Failed to delete watch', 'error'); }- } catch { toast('Network error', 'error'); }+ const resp = await apiFetch('/api/v1/watches/' + encodeURIComponent(id), {+ method: 'DELETE',+ });+ if (resp.ok) {+ toast('Watch deleted', 'success');+ refreshWatches();+ } else {+ toast('Failed to delete watch', 'error');+ }+ } catch {+ toast('Network error', 'error');+ }}// ── Claims ───────────────────────────────────────────────────@@ -1766,7 +2805,8 @@try {const resp = await apiFetch('/api/agents/pumpfun?op=claims&limit=50');if (resp.status === 401) {- tbody.innerHTML = '<tr><td colspan="6" class="pd-empty">Sign in to view fee claims.</td></tr>';+ tbody.innerHTML =+ '<tr><td colspan="6" class="pd-empty">Sign in to view fee claims.</td></tr>';return;}if (!resp.ok) {@@ -1775,26 +2815,42 @@}const data = await resp.json();let claims = (data.items || data.claims || data.data || []).slice();- if (wallet) claims = claims.filter((c) => String(c.claimerWallet || c.wallet || '').toLowerCase().includes(wallet));- if (claimType) claims = claims.filter((c) => {- const t = (c.claimType || (c.isCashback ? 'cashback' : 'creator_fee') || '').toLowerCase();- return t === claimType.toLowerCase();- });+ if (wallet)+ claims = claims.filter((c) =>+ String(c.claimerWallet || c.wallet || '')+ .toLowerCase()+ .includes(wallet),+ );+ if (claimType)+ claims = claims.filter((c) => {+ const t = (+ c.claimType ||+ (c.isCashback ? 'cashback' : 'creator_fee') ||+ ''+ ).toLowerCase();+ return t === claimType.toLowerCase();+ });$('pd-claims-count').textContent = String(claims.length);if (!claims.length) {- tbody.innerHTML = '<tr><td colspan="6" class="pd-empty">No claims match this filter.</td></tr>';+ tbody.innerHTML =+ '<tr><td colspan="6" class="pd-empty">No claims match this filter.</td></tr>';return;}- tbody.innerHTML = claims.map((c) => {- const ts = c.timestamp || c.time || c.at;- const isCashback = c.isCashback || (c.claimType || '').toLowerCase() === 'cashback';- const typeClass = isCashback ? 'is-claim' : 'is-buy';- const typeLabel = isCashback ? 'Cashback' : (c.claimType || 'Creator Fee');- const wal = c.claimerWallet || c.wallet || '';- const tx = c.txSignature || c.signature || '';- const sym = c.tokenSymbol || c.tokenName || shortAddr(c.tokenMint || '');- const amt = Number(c.amountSol ?? c.amount ?? 0);- return `+ tbody.innerHTML = claims+ .map((c) => {+ const ts = c.timestamp || c.time || c.at;+ const isCashback =+ c.isCashback || (c.claimType || '').toLowerCase() === 'cashback';+ const typeClass = isCashback ? 'is-claim' : 'is-buy';+ const typeLabel = isCashback+ ? 'Cashback'+ : c.claimType || 'Creator Fee';+ const wal = c.claimerWallet || c.wallet || '';+ const tx = c.txSignature || c.signature || '';+ const sym =+ c.tokenSymbol || c.tokenName || shortAddr(c.tokenMint || '');+ const amt = Number(c.amountSol ?? c.amount ?? 0);+ return `<tr><td class="pd-mono">${ts ? new Date(ts).toLocaleString() : '—'}</td><td><a class="pd-addr" href="https://solscan.io/account/${escapeHtml(wal)}" target="_blank" rel="noopener">${shortAddr(wal)}</a></td>@@ -1804,7 +2860,8 @@<td>${tx ? `<a class="pd-addr" href="https://solscan.io/tx/${escapeHtml(tx)}" target="_blank" rel="noopener">${shortAddr(tx)}</a>` : '—'}</td></tr>`;- }).join('');+ })+ .join('');} catch (e) {tbody.innerHTML = `<tr><td colspan="6" class="pd-empty">Error: ${escapeHtml(e.message || 'load failed')}</td></tr>`;}@@ -1817,7 +2874,10 @@rows.forEach((tr) => {const cells = tr.querySelectorAll('td');if (cells.length >= 6) {- csv += Array.from(cells).map((c) => '"' + c.textContent.trim().replace(/"/g, '""') + '"').join(',') + '\n';+ csv +=+ Array.from(cells)+ .map((c) => '"' + c.textContent.trim().replace(/"/g, '""') + '"')+ .join(',') + '\n';}});const blob = new Blob([csv], { type: 'text/csv' });@@ -1825,7 +2885,9 @@const a = document.createElement('a');a.href = url;a.download = 'pumpfun-claims-' + new Date().toISOString().slice(0, 10) + '.csv';- document.body.appendChild(a); a.click(); a.remove();+ document.body.appendChild(a);+ a.click();+ a.remove();URL.revokeObjectURL(url);toast('Claims exported', 'success');}@@ -1834,25 +2896,41 @@async function scanToken() {const mint = $('pd-scanner-mint').value.trim();- if (!mint) { toast('Enter a token mint address', 'error'); return; }+ if (!mint) {+ toast('Enter a token mint address', 'error');+ return;+ }$('pd-scanner-results').hidden = true;try {const [scanResp, holdersResp] = await Promise.all([fetch(state.rpcUrl, {method: 'POST',headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'getAccountInfo', params: [mint, { encoding: 'jsonParsed' }] }),+ body: JSON.stringify({+ jsonrpc: '2.0',+ id: 1,+ method: 'getAccountInfo',+ params: [mint, { encoding: 'jsonParsed' }],+ }),}),fetch(state.rpcUrl, {method: 'POST',headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ jsonrpc: '2.0', id: 2, method: 'getTokenLargestAccounts', params: [mint] }),+ body: JSON.stringify({+ jsonrpc: '2.0',+ id: 2,+ method: 'getTokenLargestAccounts',+ params: [mint],+ }),}),]);const scanData = await scanResp.json();const holdersData = await holdersResp.json();const account = scanData.result?.value;- if (!account) { toast('Token not found on-chain', 'error'); return; }+ if (!account) {+ toast('Token not found on-chain', 'error');+ return;+ }const info = account.data?.parsed?.info || {};const holders = holdersData.result?.value || [];@@ -1860,57 +2938,125 @@let score = 100;const owner = account.owner;- checks.program = { status: 'info', detail: owner === 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' ? 'SPL Token' : owner === 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb' ? 'Token-2022' : owner };-- if (info.mintAuthority) { checks.mintAuth = { status: 'warn', detail: 'Active: ' + shortAddr(info.mintAuthority) }; score -= 15; }- else checks.mintAuth = { status: 'pass', detail: 'Revoked' };+ checks.program = {+ status: 'info',+ detail:+ owner === 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'+ ? 'SPL Token'+ : owner === 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb'+ ? 'Token-2022'+ : owner,+ };- if (info.freezeAuthority) { checks.freezeAuth = { status: 'fail', detail: 'Active: ' + shortAddr(info.freezeAuthority) }; score -= 25; }- else checks.freezeAuth = { status: 'pass', detail: 'None' };+ if (info.mintAuthority) {+ checks.mintAuth = {+ status: 'warn',+ detail: 'Active: ' + shortAddr(info.mintAuthority),+ };+ score -= 15;+ } else checks.mintAuth = { status: 'pass', detail: 'Revoked' };++ if (info.freezeAuthority) {+ checks.freezeAuth = {+ status: 'fail',+ detail: 'Active: ' + shortAddr(info.freezeAuthority),+ };+ score -= 25;+ } else checks.freezeAuth = { status: 'pass', detail: 'None' };const totalSupply = Number(info.supply || 0);let topConc = 0;if (holders.length > 0 && totalSupply > 0) {- topConc = parseFloat(((Number(holders[0].amount || 0) / totalSupply) * 100).toFixed(2));+ topConc = parseFloat(+ ((Number(holders[0].amount || 0) / totalSupply) * 100).toFixed(2),+ );}- if (topConc > 50) { checks.concentration = { status: 'warn', detail: `Top holder: ${topConc}%` }; score -= 10; }- else checks.concentration = { status: 'pass', detail: `Top holder: ${topConc}%` };+ if (topConc > 50) {+ checks.concentration = {+ status: 'warn',+ detail: `Top holder: ${topConc}%`,+ };+ score -= 10;+ } else+ checks.concentration = {+ status: 'pass',+ detail: `Top holder: ${topConc}%`,+ };const decimals = info.decimals || 0;- const displaySupply = (Number(info.supply || 0) / Math.pow(10, decimals)).toLocaleString();- checks.supply = { status: 'info', detail: `${displaySupply} (${decimals} decimals)` };+ const displaySupply = (+ Number(info.supply || 0) / Math.pow(10, decimals)+ ).toLocaleString();+ checks.supply = {+ status: 'info',+ detail: `${displaySupply} (${decimals} decimals)`,+ };let isPump = false;try {const bcResp = await fetch(state.rpcUrl, {method: 'POST',headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ jsonrpc: '2.0', id: 3, method: 'getProgramAccounts', params: ['6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P', { filters: [{ memcmp: { offset: 30, bytes: mint } }], dataSlice: { offset: 0, length: 1 } }] }),+ body: JSON.stringify({+ jsonrpc: '2.0',+ id: 3,+ method: 'getProgramAccounts',+ params: [+ '6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P',+ {+ filters: [{ memcmp: { offset: 30, bytes: mint } }],+ dataSlice: { offset: 0, length: 1 },+ },+ ],+ }),});const bcData = await bcResp.json();isPump = bcData.result && bcData.result.length > 0;- } catch { /* skip */ }+ } catch {+ /* skip */+ }- if (isPump) { checks.pumpfun = { status: 'pass', detail: 'Bonding curve active — sells guaranteed by AMM' }; score = Math.min(score + 10, 100); }- else checks.pumpfun = { status: 'info', detail: 'Not a Pump.fun token' };+ if (isPump) {+ checks.pumpfun = {+ status: 'pass',+ detail: 'Bonding curve active — sells guaranteed by AMM',+ };+ score = Math.min(score + 10, 100);+ } else checks.pumpfun = { status: 'info', detail: 'Not a Pump.fun token' };if (isPump) {try {- const curveResp = await fetch(`/api/pump/curve?mint=${encodeURIComponent(mint)}`);+ const curveResp = await fetch(+ `/api/pump/curve?mint=${encodeURIComponent(mint)}`,+ );if (curveResp.ok) {const curve = await curveResp.json();- if (curve.price?.priceSol) checks.spot_price = { status: 'info', detail: `${Number(curve.price.priceSol).toFixed(8)} SOL/token` };- if (curve.price?.marketCapSol) checks.market_cap = { status: 'info', detail: `${Number(curve.price.marketCapSol).toFixed(2)} SOL` };+ if (curve.price?.priceSol)+ checks.spot_price = {+ status: 'info',+ detail: `${Number(curve.price.priceSol).toFixed(8)} SOL/token`,+ };+ if (curve.price?.marketCapSol)+ checks.market_cap = {+ status: 'info',+ detail: `${Number(curve.price.marketCapSol).toFixed(2)} SOL`,+ };if (curve.graduation?.progressBps != null) {const pct = Number(curve.graduation.progressBps) / 100;- checks.graduation = { status: pct >= 80 ? 'warn' : 'pass', detail: `${pct.toFixed(1)}% to graduation` };+ checks.graduation = {+ status: pct >= 80 ? 'warn' : 'pass',+ detail: `${pct.toFixed(1)}% to graduation`,+ };}}- } catch { /* curve enrichment optional */ }+ } catch {+ /* curve enrichment optional */+ }}const riskLevel = score >= 80 ? 'LOW' : score >= 50 ? 'MEDIUM' : 'HIGH';- const riskClass = score >= 80 ? 'is-success' : score >= 50 ? 'is-warn' : 'is-danger';+ const riskClass =+ score >= 80 ? 'is-success' : score >= 50 ? 'is-warn' : 'is-danger';$('pd-scan-score').textContent = score + '/100';$('pd-scan-score').className = 'pd-stat-value ' + riskClass;@@ -1918,20 +3064,37 @@$('pd-scan-level').className = 'pd-stat-value ' + riskClass;$('pd-scan-pump').textContent = isPump ? 'Yes' : 'No';$('pd-scan-pump').className = 'pd-stat-value ' + (isPump ? 'is-success' : '');- $('pd-scan-honeypot').textContent = info.freezeAuthority ? 'Risk' : (isPump ? 'Safe (AMM)' : 'Safe');- $('pd-scan-honeypot').className = 'pd-stat-value ' + (info.freezeAuthority ? 'is-danger' : 'is-success');-- const statusTagClass = { pass: 'is-buy', warn: 'is-whale', fail: 'is-sell', info: 'is-launch' };+ $('pd-scan-honeypot').textContent = info.freezeAuthority+ ? 'Risk'+ : isPump+ ? 'Safe (AMM)'+ : 'Safe';+ $('pd-scan-honeypot').className =+ 'pd-stat-value ' + (info.freezeAuthority ? 'is-danger' : 'is-success');++ const statusTagClass = {+ pass: 'is-buy',+ warn: 'is-whale',+ fail: 'is-sell',+ info: 'is-launch',+ };const tbody = $('pd-scan-checks');- tbody.innerHTML = Object.entries(checks).map(([name, c]) => `+ tbody.innerHTML = Object.entries(checks)+ .map(+ ([name, c]) => `<tr><td>${escapeHtml(name)}</td><td><span class="pd-tag ${statusTagClass[c.status] || ''}">${c.status.toUpperCase()}</span></td><td class="pd-mono">${escapeHtml(c.detail)}</td></tr>- `).join('');+ `,+ )+ .join('');$('pd-scanner-results').hidden = false;- toast('Scan complete: ' + riskLevel.toLowerCase() + ' risk', riskLevel === 'HIGH' ? 'error' : 'success');+ toast(+ 'Scan complete: ' + riskLevel.toLowerCase() + ' risk',+ riskLevel === 'HIGH' ? 'error' : 'success',+ );} catch (e) {toast('Scan failed: ' + (e.message || 'Network error'), 'error');}@@ -1942,7 +3105,8 @@function formatPriceContext(p) {const parts = [];if (p.priceSol) parts.push(`${(Number(p.priceSol) || 0).toFixed(8)} SOL/token`);- if (p.marketCapSol) parts.push(`MC ${(Number(p.marketCapSol) || 0).toFixed(2)} SOL`);+ if (p.marketCapSol)+ parts.push(`MC ${(Number(p.marketCapSol) || 0).toFixed(2)} SOL`);return parts.join(' · ');}@@ -1961,14 +3125,25 @@async function getBuyQuote() {const mint = $('pd-quote-buy-mint').value.trim();const solAmount = parseFloat($('pd-quote-buy-amount').value);- if (!mint) { toast('Enter token mint', 'error'); return; }- if (!Number.isFinite(solAmount) || solAmount <= 0) { toast('Enter a positive SOL amount', 'error'); return; }+ if (!mint) {+ toast('Enter token mint', 'error');+ return;+ }+ if (!Number.isFinite(solAmount) || solAmount <= 0) {+ toast('Enter a positive SOL amount', 'error');+ return;+ }const target = $('pd-quote-buy-result');target.innerHTML = '<span style="color:var(--ink-dim)">Calculating…</span>';try {- const r = await fetch(`/api/pump/quote-sdk?mint=${encodeURIComponent(mint)}&side=buy&amount=${solAmount}`);+ const r = await fetch(+ `/api/pump/quote-sdk?mint=${encodeURIComponent(mint)}&side=buy&amount=${solAmount}`,+ );const data = await r.json();- if (!r.ok) { target.innerHTML = `<span style="color:var(--danger)">${escapeHtml(data.message || data.error || 'Quote failed')}</span>`; return; }+ if (!r.ok) {+ target.innerHTML = `<span style="color:var(--danger)">${escapeHtml(data.message || data.error || 'Quote failed')}</span>`;+ return;+ }renderQuoteResult(target, {amountLabel: 'You receive',amountText: `${Number(data.output?.tokensUi || 0).toLocaleString(undefined, { maximumFractionDigits: 2 })} tokens for ${solAmount} SOL`,@@ -1983,14 +3158,25 @@async function getSellQuote() {const mint = $('pd-quote-sell-mint').value.trim();const tokenAmount = parseFloat($('pd-quote-sell-amount').value);- if (!mint) { toast('Enter token mint', 'error'); return; }- if (!Number.isFinite(tokenAmount) || tokenAmount <= 0) { toast('Enter a positive token amount', 'error'); return; }+ if (!mint) {+ toast('Enter token mint', 'error');+ return;+ }+ if (!Number.isFinite(tokenAmount) || tokenAmount <= 0) {+ toast('Enter a positive token amount', 'error');+ return;+ }const target = $('pd-quote-sell-result');target.innerHTML = '<span style="color:var(--ink-dim)">Calculating…</span>';try {- const r = await fetch(`/api/pump/quote-sdk?mint=${encodeURIComponent(mint)}&side=sell&amount=${tokenAmount}`);+ const r = await fetch(+ `/api/pump/quote-sdk?mint=${encodeURIComponent(mint)}&side=sell&amount=${tokenAmount}`,+ );const data = await r.json();- if (!r.ok) { target.innerHTML = `<span style="color:var(--danger)">${escapeHtml(data.message || data.error || 'Quote failed')}</span>`; return; }+ if (!r.ok) {+ target.innerHTML = `<span style="color:var(--danger)">${escapeHtml(data.message || data.error || 'Quote failed')}</span>`;+ return;+ }renderQuoteResult(target, {amountLabel: 'You receive',amountText: `${Number(data.output?.sol || 0).toFixed(6)} SOL for ${tokenAmount.toLocaleString()} tokens`,@@ -2007,9 +3193,24 @@async function startVanity() {const prefix = $('pd-vanity-prefix').value.trim();const suffix = $('pd-vanity-suffix').value.trim();- if (!prefix && !suffix) { toast('Enter a prefix or suffix', 'error'); return; }- if (prefix) { const v = validatePattern(prefix); if (!v.valid) { toast(`Prefix: ${v.errors.join('; ')}`, 'error'); return; } }- if (suffix) { const v = validatePattern(suffix); if (!v.valid) { toast(`Suffix: ${v.errors.join('; ')}`, 'error'); return; } }+ if (!prefix && !suffix) {+ toast('Enter a prefix or suffix', 'error');+ return;+ }+ if (prefix) {+ const v = validatePattern(prefix);+ if (!v.valid) {+ toast(`Prefix: ${v.errors.join('; ')}`, 'error');+ return;+ }+ }+ if (suffix) {+ const v = validatePattern(suffix);+ if (!v.valid) {+ toast(`Suffix: ${v.errors.join('; ')}`, 'error');+ return;+ }+ }state.vanityAbort = new AbortController();$('pd-vanity-start').hidden = true;$('pd-vanity-stop').hidden = false;@@ -2021,13 +3222,15 @@suffix: suffix || undefined,signal: state.vanityAbort.signal,onProgress: ({ attempts, rate, eta }) => {- $('pd-vanity-status').textContent = `${attempts.toLocaleString()} tries · ${Math.round(rate).toLocaleString()}/s · eta ${eta}`;+ $('pd-vanity-status').textContent =+ `${attempts.toLocaleString()} tries · ${Math.round(rate).toLocaleString()}/s · eta ${eta}`;},});const secretJson = JSON.stringify(Array.from(result.secretKey));const secretB58 = b58encode(result.secretKey);const seconds = (result.durationMs / 1000).toFixed(1);- $('pd-vanity-status').textContent = `Found in ${seconds}s · ${result.attempts.toLocaleString()} attempts · ${result.workers} worker${result.workers > 1 ? 's' : ''}`;+ $('pd-vanity-status').textContent =+ `Found in ${seconds}s · ${result.attempts.toLocaleString()} attempts · ${result.workers} worker${result.workers > 1 ? 's' : ''}`;$('pd-vanity-result').innerHTML = `<div style="padding:0.85rem 1rem;background:var(--surface-1);border-radius:var(--radius-md);border:1px solid var(--stroke-strong)"><div style="font-family:var(--font-display);font-size:0.66rem;text-transform:uppercase;letter-spacing:0.1em;color:var(--ink-dim);margin-bottom:0.25rem">Public key</div>@@ -2046,7 +3249,10 @@</div>`;$('pd-vanity-copy-pub').addEventListener('click', async () => {- try { await navigator.clipboard.writeText(result.publicKey); toast('Address copied', 'success'); } catch {}+ try {+ await navigator.clipboard.writeText(result.publicKey);+ toast('Address copied', 'success');+ } catch {}});$('pd-vanity-reveal').addEventListener('click', () => {const box = $('pd-vanity-secret');@@ -2063,7 +3269,10 @@}});$('pd-vanity-copy-secret').addEventListener('click', async () => {- try { await navigator.clipboard.writeText(secretB58); toast('Secret key copied', 'success'); } catch {}+ try {+ await navigator.clipboard.writeText(secretB58);+ toast('Secret key copied', 'success');+ } catch {}});$('pd-vanity-download-key').addEventListener('click', () => {const blob = new Blob([secretJson], { type: 'application/json' });@@ -2071,13 +3280,18 @@const a = document.createElement('a');a.href = url;a.download = `vanity-${result.publicKey.slice(0, 8)}.json`;- document.body.appendChild(a); a.click(); a.remove();+ document.body.appendChild(a);+ a.click();+ a.remove();URL.revokeObjectURL(url);});toast('Vanity address found', 'success');} catch (e) {if (e?.name === 'AbortError') $('pd-vanity-status').textContent = 'Stopped';- else { $('pd-vanity-status').textContent = `Error: ${e.message || 'grind failed'}`; toast('Grind failed', 'error'); }+ else {+ $('pd-vanity-status').textContent = `Error: ${e.message || 'grind failed'}`;+ toast('Grind failed', 'error');+ }} finally {state.vanityAbort = null;$('pd-vanity-start').hidden = false;@@ -2100,17 +3314,28 @@const el = $(id);if (!el) return;el.className = 'pd-probe is-' + state_;- el.textContent = state_ === 'ok' ? 'OK' : state_ === 'pending' ? 'Testing…' : `Failed: ${detail || 'error'}`;+ el.textContent =+ state_ === 'ok'+ ? 'OK'+ : state_ === 'pending'+ ? 'Testing…'+ : `Failed: ${detail || 'error'}`;el.title = detail || '';}async function probeApi() {try {- const r = await fetch(state.apiUrl.replace(/\/$/, '') + '/api/healthz', { signal: AbortSignal.timeout(5000) });+ const r = await fetch(state.apiUrl.replace(/\/$/, '') + '/api/healthz', {+ signal: AbortSignal.timeout(5000),+ });if (!r.ok) return { ok: false, detail: `HTTP ${r.status}` };const d = await r.json().catch(() => ({}));- return d.ok || d.status === 'ok' ? { ok: true, detail: 'healthy' } : { ok: false, detail: 'no ok flag' };- } catch (e) { return { ok: false, detail: e.name === 'TimeoutError' ? 'timeout' : e.message }; }+ return d.ok || d.status === 'ok'+ ? { ok: true, detail: 'healthy' }+ : { ok: false, detail: 'no ok flag' };+ } catch (e) {+ return { ok: false, detail: e.name === 'TimeoutError' ? 'timeout' : e.message };+ }}async function probeApiKey() {@@ -2121,9 +3346,12 @@signal: AbortSignal.timeout(5000),});if (r.ok) return { ok: true, detail: 'authorized' };- if (r.status === 401 || r.status === 403) return { ok: false, detail: `${r.status} unauthorized` };+ if (r.status === 401 || r.status === 403)+ return { ok: false, detail: `${r.status} unauthorized` };return { ok: false, detail: `HTTP ${r.status}` };- } catch (e) { return { ok: false, detail: e.name === 'TimeoutError' ? 'timeout' : e.message }; }+ } catch (e) {+ return { ok: false, detail: e.name === 'TimeoutError' ? 'timeout' : e.message };+ }}function probeWs() {@@ -2133,7 +3361,9 @@const done = (ok, detail) => {if (settled) return;settled = true;- try { sock?.close(); } catch {}+ try {+ sock?.close();+ } catch {}resolve({ ok, detail });};try {@@ -2141,7 +3371,9 @@sock.onopen = () => done(true, 'connected');sock.onerror = () => done(false, 'connection error');setTimeout(() => done(false, 'timeout'), 3000);- } catch (e) { done(false, e.message); }+ } catch (e) {+ done(false, e.message);+ }});}@@ -2157,7 +3389,9 @@if (d.result === 'ok') return { ok: true, detail: 'healthy' };if (d.error) return { ok: false, detail: d.error.message || 'rpc error' };return { ok: false, detail: `HTTP ${r.status}` };- } catch (e) { return { ok: false, detail: e.name === 'TimeoutError' ? 'timeout' : e.message }; }+ } catch (e) {+ return { ok: false, detail: e.name === 'TimeoutError' ? 'timeout' : e.message };+ }}async function runConfigProbes() {@@ -2165,7 +3399,12 @@setProbe('pd-probe-key', 'pending');setProbe('pd-probe-ws', 'pending');setProbe('pd-probe-rpc', 'pending');- const [api, key, ws, rpc] = await Promise.all([probeApi(), probeApiKey(), probeWs(), probeRpc()]);+ const [api, key, ws, rpc] = await Promise.all([+ probeApi(),+ probeApiKey(),+ probeWs(),+ probeRpc(),+ ]);setProbe('pd-probe-api', api.ok ? 'ok' : 'err', api.detail);setProbe('pd-probe-key', key.ok ? 'ok' : 'err', key.detail);setProbe('pd-probe-ws', ws.ok ? 'ok' : 'err', ws.detail);@@ -2200,8 +3439,12 @@// ── Modals ───────────────────────────────────────────────────- function openModal(id) { $(id)?.classList.add('is-open'); }- function closeModal(id) { $(id)?.classList.remove('is-open'); }+ function openModal(id) {+ $(id)?.classList.add('is-open');+ }+ function closeModal(id) {+ $(id)?.classList.remove('is-open');+ }// ── Uptime ───────────────────────────────────────────────────@@ -2217,10 +3460,14 @@function bindPageLinks() {document.querySelectorAll('[data-page-link]').forEach((a) => {- a.addEventListener('click', (e) => {- e.preventDefault();- navigateTo(a.dataset.pageLink);- }, { once: true });+ a.addEventListener(+ 'click',+ (e) => {+ e.preventDefault();+ navigateTo(a.dataset.pageLink);+ },+ { once: true },+ );});}@@ -2231,7 +3478,9 @@if (!r.ok) return null;const d = await r.json();return d.token || d.data?.token || null;- } catch { return null; }+ } catch {+ return null;+ }}// ── base58 encode (for revealing the vanity secret key) ──────@@ -2245,7 +3494,10 @@digits[j] = carry % 58;carry = (carry / 58) | 0;}- while (carry > 0) { digits.push(carry % 58); carry = (carry / 58) | 0; }+ while (carry > 0) {+ digits.push(carry % 58);+ carry = (carry / 58) | 0;+ }}let str = '';for (let i = 0; i < bytes.length && bytes[i] === 0; i++) str += '1';@@ -2267,16 +3519,24 @@// Monitor stat cards (Task 07) — bound to GET /api/healthz// ════════════════════════════════════════════════════════════function formatUptime(sec) {- const h = Math.floor(sec / 3600), m = Math.floor((sec % 3600) / 60), s = Math.floor(sec % 60);+ const h = Math.floor(sec / 3600),+ m = Math.floor((sec % 3600) / 60),+ s = Math.floor(sec % 60);if (h > 0) return `${h}h ${m}m`;if (m > 0) return `${m}m ${s}s`;return `${s}s`;}function setMonitorStale(stale) {const grid = $('pd-monitor-stats');- if (grid) grid.querySelectorAll('.pd-stat').forEach((c) => c.classList.toggle('is-stale', stale));+ if (grid)+ grid.querySelectorAll('.pd-stat').forEach((c) =>+ c.classList.toggle('is-stale', stale),+ );const sub = $('stat-bot-status-sub');- if (sub) sub.innerHTML = stale ? 'Live monitor <span class="pd-stale-badge">stale</span>' : 'Live monitor';+ if (sub)+ sub.innerHTML = stale+ ? 'Live monitor <span class="pd-stale-badge">stale</span>'+ : 'Live monitor';}async function pollMonitorStats() {try {@@ -2286,10 +3546,13 @@const m = d.monitor || {};setMonitorStale(false);$('stat-bot-status').textContent = m.running ? 'Running' : 'Stopped';- $('stat-bot-status').className = 'pd-stat-value ' + (m.running ? 'is-success' : 'is-danger');+ $('stat-bot-status').className =+ 'pd-stat-value ' + (m.running ? 'is-success' : 'is-danger');$('stat-bot-mode').textContent = m.mode || '—';$('stat-claims').textContent = Number(m.claimsDetected ?? 0).toLocaleString();- $('stat-watches').textContent = Number((d.watches || {}).total ?? 0).toLocaleString();+ $('stat-watches').textContent = Number(+ (d.watches || {}).total ?? 0,+ ).toLocaleString();$('stat-uptime').textContent = formatUptime(d.uptime || 0);} catch {// Keep last real values, flag stale.@@ -2311,7 +3574,10 @@return { ctx, w, h };}function cssVar(name) {- return getComputedStyle(document.documentElement).getPropertyValue(name).trim() || '#fff';+ return (+ getComputedStyle(document.documentElement).getPropertyValue(name).trim() ||+ '#fff'+ );}function fmtPrice(v) {const n = Number(v);@@ -2326,7 +3592,13 @@ctx.clearRect(0, 0, w, h);ctx.strokeStyle = 'rgba(255,255,255,0.05)';ctx.lineWidth = 1;- for (let i = 1; i < 5; i++) { const y = (h * i) / 5; ctx.beginPath(); ctx.moveTo(0, y); ctx.lineTo(w, y); ctx.stroke(); }+ for (let i = 1; i < 5; i++) {+ const y = (h * i) / 5;+ ctx.beginPath();+ ctx.moveTo(0, y);+ ctx.lineTo(w, y);+ ctx.stroke();+ }ctx.fillStyle = 'rgba(255,255,255,0.42)';ctx.font = '12px system-ui';ctx.textAlign = 'center';@@ -2346,7 +3618,9 @@function selectChartToken(mint, symbol) {if (chart.mint === mint) return;- document.dispatchEvent(new CustomEvent('chart:tokenChange', { detail: { mint, symbol } }));+ document.dispatchEvent(+ new CustomEvent('chart:tokenChange', { detail: { mint, symbol } }),+ );}// Render $THREE as an immediate, real default option + chart while the live@@ -2367,7 +3641,7 @@const r = await fetch('/api/pump/trending?limit=25');const d = await r.json().catch(() => ({}));// Tolerate both the normalized { data: [...] } shape and a bare array.- const feed = Array.isArray(d) ? d : (Array.isArray(d.data) ? d.data : []);+ const feed = Array.isArray(d) ? d : Array.isArray(d.data) ? d.data : [];if (!r.ok || !feed.length) return; // keep the $THREE default in place// Pin the $THREE flagship first (de-duped), then the live market below it.@@ -2375,10 +3649,12 @@const tokens = [three, ...feed.filter((t) => t.mint !== THREE_MINT)];const prevMint = chart.mint;- sel.innerHTML = tokens.map((t, i) => {- const tag = t.flagship ? '★ ' : `#${t.rank ?? i} `;- return `<option value="${escapeHtml(t.mint)}" data-symbol="${escapeHtml(t.symbol)}">${tag}${escapeHtml(t.symbol)} (${escapeHtml(shortAddr(t.mint))})</option>`;- }).join('');+ sel.innerHTML = tokens+ .map((t, i) => {+ const tag = t.flagship ? '★ ' : `#${t.rank ?? i} `;+ return `<option value="${escapeHtml(t.mint)}" data-symbol="${escapeHtml(t.symbol)}">${tag}${escapeHtml(t.symbol)} (${escapeHtml(shortAddr(t.mint))})</option>`;+ })+ .join('');// Keep the currently-charted token selected if it survived the refresh;// otherwise fall to the pinned flagship at the top.const keep = Array.from(sel.options).findIndex((o) => o.value === prevMint);@@ -2396,14 +3672,20 @@chart.spotUsd = null;const canvas = $('pd-market-chart');drawChartMessage(canvas, 'skeleton');- $('pd-chart-meta').innerHTML = `<span class="pd-mono" style="color:var(--accent)">${escapeHtml(symbol || '')}</span> <span style="color:var(--ink-dim)">${escapeHtml(shortAddr(mint))}</span>`;+ $('pd-chart-meta').innerHTML =+ `<span class="pd-mono" style="color:var(--accent)">${escapeHtml(symbol || '')}</span> <span style="color:var(--ink-dim)">${escapeHtml(shortAddr(mint))}</span>`;const now = Math.floor(Date.now() / 1000);const from = now - 24 * 3600;try {- const r = await fetch(`/api/pump/price-history?mint=${encodeURIComponent(mint)}&interval=15m&from=${from}&to=${now}`);+ const r = await fetch(+ `/api/pump/price-history?mint=${encodeURIComponent(mint)}&interval=15m&from=${from}&to=${now}`,+ );const d = await r.json().catch(() => ({}));if (!r.ok) {- drawChartMessage(canvas, d.error_description || d.error || `Error ${r.status}`);+ drawChartMessage(+ canvas,+ d.error_description || d.error || `Error ${r.status}`,+ );$('pd-chart-retry').hidden = false;return;}@@ -2414,7 +3696,8 @@} else {drawMarketChart(canvas);const last = chart.candles[chart.candles.length - 1].c;- $('pd-chart-meta').innerHTML += ` · <span style="color:var(--accent)">$${fmtPrice(last)}</span>`;+ $('pd-chart-meta').innerHTML +=+ ` · <span style="color:var(--accent)">$${fmtPrice(last)}</span>`;}fetchSpotOverlay(mint);} catch (e) {@@ -2434,48 +3717,106 @@if (!isFinite(priceSol) || priceSol <= 0 || !state.solPrice) return;chart.spotUsd = priceSol * state.solPrice;if (chart.candles.length) drawMarketChart($('pd-market-chart'));- $('pd-chart-meta').innerHTML += ` · <span style="color:var(--warn)">live ${priceSol.toFixed(9)} SOL</span>`;- } catch { /* overlay optional */ }+ $('pd-chart-meta').innerHTML +=+ ` · <span style="color:var(--warn)">live ${priceSol.toFixed(9)} SOL</span>`;+ } catch {+ /* overlay optional */+ }}function drawMarketChart(canvas) {const candles = chart.candles;- if (!candles.length) { drawChartMessage(canvas, 'No trades in the selected window'); return; }+ if (!candles.length) {+ drawChartMessage(canvas, 'No trades in the selected window');+ return;+ }const { ctx, w, h } = setupCanvas(canvas);ctx.clearRect(0, 0, w, h);- const x0 = 56, x1 = w - 12, y0 = 10, y1 = h - 22;- const tMin = candles[0].t, tMax = candles[candles.length - 1].t;- let pMin = Infinity, pMax = -Infinity;- for (const c of candles) { pMin = Math.min(pMin, c.l ?? c.c); pMax = Math.max(pMax, c.h ?? c.c); }- if (chart.spotUsd != null) { pMin = Math.min(pMin, chart.spotUsd); pMax = Math.max(pMax, chart.spotUsd); }- if (pMin === pMax) { pMin *= 0.99; pMax *= 1.01; }- const padP = (pMax - pMin) * 0.08; pMin -= padP; pMax += padP;- const xFor = (t) => x0 + (tMax === tMin ? 0 : (t - tMin) / (tMax - tMin)) * (x1 - x0);- const yFor = (p) => y1 - (p - pMin) / (pMax - pMin) * (y1 - y0);+ const x0 = 56,+ x1 = w - 12,+ y0 = 10,+ y1 = h - 22;+ const tMin = candles[0].t,+ tMax = candles[candles.length - 1].t;+ let pMin = Infinity,+ pMax = -Infinity;+ for (const c of candles) {+ pMin = Math.min(pMin, c.l ?? c.c);+ pMax = Math.max(pMax, c.h ?? c.c);+ }+ if (chart.spotUsd != null) {+ pMin = Math.min(pMin, chart.spotUsd);+ pMax = Math.max(pMax, chart.spotUsd);+ }+ if (pMin === pMax) {+ pMin *= 0.99;+ pMax *= 1.01;+ }+ const padP = (pMax - pMin) * 0.08;+ pMin -= padP;+ pMax += padP;+ const xFor = (t) =>+ x0 + (tMax === tMin ? 0 : (t - tMin) / (tMax - tMin)) * (x1 - x0);+ const yFor = (p) => y1 - ((p - pMin) / (pMax - pMin)) * (y1 - y0);// Y grid + price ticks- ctx.strokeStyle = 'rgba(255,255,255,0.06)'; ctx.fillStyle = 'rgba(255,255,255,0.42)';- ctx.font = '10px system-ui'; ctx.lineWidth = 1; ctx.textAlign = 'right'; ctx.textBaseline = 'middle';- for (let i = 0; i <= 5; i++) { const p = pMin + (pMax - pMin) * i / 5; const y = yFor(p); ctx.beginPath(); ctx.moveTo(x0, y); ctx.lineTo(x1, y); ctx.stroke(); ctx.fillText('$' + fmtPrice(p), x0 - 6, y); }+ ctx.strokeStyle = 'rgba(255,255,255,0.06)';+ ctx.fillStyle = 'rgba(255,255,255,0.42)';+ ctx.font = '10px system-ui';+ ctx.lineWidth = 1;+ ctx.textAlign = 'right';+ ctx.textBaseline = 'middle';+ for (let i = 0; i <= 5; i++) {+ const p = pMin + ((pMax - pMin) * i) / 5;+ const y = yFor(p);+ ctx.beginPath();+ ctx.moveTo(x0, y);+ ctx.lineTo(x1, y);+ ctx.stroke();+ ctx.fillText('$' + fmtPrice(p), x0 - 6, y);+ }// X time ticks- ctx.textAlign = 'center'; ctx.textBaseline = 'top';+ ctx.textAlign = 'center';+ ctx.textBaseline = 'top';const spanHours = (tMax - tMin) / 3600;for (let i = 0; i <= 6; i++) {- const t = tMin + (tMax - tMin) * i / 6; const x = xFor(t); const dt = new Date(t * 1000);- const label = spanHours <= 24- ? dt.toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit' })- : `${dt.getMonth() + 1}/${dt.getDate()}`;+ const t = tMin + ((tMax - tMin) * i) / 6;+ const x = xFor(t);+ const dt = new Date(t * 1000);+ const label =+ spanHours <= 24+ ? dt.toLocaleTimeString('en-US', {+ hour12: false,+ hour: '2-digit',+ minute: '2-digit',+ })+ : `${dt.getMonth() + 1}/${dt.getDate()}`;ctx.fillText(label, Math.max(x0 + 14, Math.min(x1 - 14, x)), y1 + 5);}// Price line + area- ctx.strokeStyle = cssVar('--accent'); ctx.lineWidth = 1.5; ctx.beginPath();- candles.forEach((c, i) => { const x = xFor(c.t), y = yFor(c.c); i ? ctx.lineTo(x, y) : ctx.moveTo(x, y); });+ ctx.strokeStyle = cssVar('--accent');+ ctx.lineWidth = 1.5;+ ctx.beginPath();+ candles.forEach((c, i) => {+ const x = xFor(c.t),+ y = yFor(c.c);+ i ? ctx.lineTo(x, y) : ctx.moveTo(x, y);+ });ctx.stroke();- ctx.lineTo(xFor(tMax), y1); ctx.lineTo(xFor(tMin), y1); ctx.closePath();- ctx.fillStyle = 'rgba(255,255,255,0.05)'; ctx.fill();+ ctx.lineTo(xFor(tMax), y1);+ ctx.lineTo(xFor(tMin), y1);+ ctx.closePath();+ ctx.fillStyle = 'rgba(255,255,255,0.05)';+ ctx.fill();// Spot overlayif (chart.spotUsd != null) {const y = yFor(chart.spotUsd);- ctx.strokeStyle = cssVar('--warn'); ctx.setLineDash([4, 3]); ctx.beginPath(); ctx.moveTo(x0, y); ctx.lineTo(x1, y); ctx.stroke(); ctx.setLineDash([]);+ ctx.strokeStyle = cssVar('--warn');+ ctx.setLineDash([4, 3]);+ ctx.beginPath();+ ctx.moveTo(x0, y);+ ctx.lineTo(x1, y);+ ctx.stroke();+ ctx.setLineDash([]);}chart.geom = { x0, x1, y0, y1, tMin, tMax, pMin, pMax };}@@ -2497,20 +3838,45 @@const canvas = $('pd-market-chart');const tip = $('pd-chart-tooltip');const g = chart.geom;- if (!g || !chart.candles.length) { tip.style.display = 'none'; return; }+ if (!g || !chart.candles.length) {+ tip.style.display = 'none';+ return;+ }const x = _chartHoverX;- if (x < g.x0 || x > g.x1) { tip.style.display = 'none'; return; }+ if (x < g.x0 || x > g.x1) {+ tip.style.display = 'none';+ return;+ }const frac = (x - g.x0) / (g.x1 - g.x0);const t = g.tMin + frac * (g.tMax - g.tMin);- let nearest = chart.candles[0], best = Infinity;- for (const c of chart.candles) { const dd = Math.abs(c.t - t); if (dd < best) { best = dd; nearest = c; } }- const cx = g.x0 + (g.tMax === g.tMin ? 0 : (nearest.t - g.tMin) / (g.tMax - g.tMin)) * (g.x1 - g.x0);- const cy = g.y1 - (nearest.c - g.pMin) / (g.pMax - g.pMin) * (g.y1 - g.y0);+ let nearest = chart.candles[0],+ best = Infinity;+ for (const c of chart.candles) {+ const dd = Math.abs(c.t - t);+ if (dd < best) {+ best = dd;+ nearest = c;+ }+ }+ const cx =+ g.x0 ++ (g.tMax === g.tMin ? 0 : (nearest.t - g.tMin) / (g.tMax - g.tMin)) *+ (g.x1 - g.x0);+ const cy = g.y1 - ((nearest.c - g.pMin) / (g.pMax - g.pMin)) * (g.y1 - g.y0);drawMarketChart(canvas);const ctx = canvas.getContext('2d');- ctx.strokeStyle = 'rgba(255,255,255,0.4)'; ctx.lineWidth = 1; ctx.setLineDash([3, 3]);- ctx.beginPath(); ctx.moveTo(cx, g.y0); ctx.lineTo(cx, g.y1); ctx.stroke(); ctx.setLineDash([]);- ctx.fillStyle = cssVar('--accent'); ctx.beginPath(); ctx.arc(cx, cy, 3, 0, Math.PI * 2); ctx.fill();+ ctx.strokeStyle = 'rgba(255,255,255,0.4)';+ ctx.lineWidth = 1;+ ctx.setLineDash([3, 3]);+ ctx.beginPath();+ ctx.moveTo(cx, g.y0);+ ctx.lineTo(cx, g.y1);+ ctx.stroke();+ ctx.setLineDash([]);+ ctx.fillStyle = cssVar('--accent');+ ctx.beginPath();+ ctx.arc(cx, cy, 3, 0, Math.PI * 2);+ ctx.fill();const dt = new Date(nearest.t * 1000);tip.textContent = `${dt.toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit' })} · $${fmtPrice(nearest.c)}`;tip.style.left = cx + 'px';@@ -2533,18 +3899,31 @@const r = await fetch(state.rpcUrl, {method: 'POST',headers: { 'Content-Type': 'application/json' },- body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'getAccountInfo', params: [mint, { encoding: 'jsonParsed' }] }),+ body: JSON.stringify({+ jsonrpc: '2.0',+ id: 1,+ method: 'getAccountInfo',+ params: [mint, { encoding: 'jsonParsed' }],+ }),});const d = await r.json();const dec = d.result?.value?.data?.parsed?.info?.decimals;- if (typeof dec === 'number') { _decimalsCache[mint] = dec; return dec; }- } catch { /* fall through */ }+ if (typeof dec === 'number') {+ _decimalsCache[mint] = dec;+ return dec;+ }+ } catch {+ /* fall through */+ }return 6;}let _revAgentsLoaded = false;async function loadRevenue() {- if (!_revAgentsLoaded) { await loadRevenueAgents(); _revAgentsLoaded = true; }+ if (!_revAgentsLoaded) {+ await loadRevenueAgents();+ _revAgentsLoaded = true;+ }await fetchRevenue();}async function loadRevenueAgents() {@@ -2553,9 +3932,17 @@if (!r.ok) return;const j = await r.json();const agents = j.agents || j.data || [];- $('pd-rev-agent').innerHTML = '<option value="">All agents</option>' +- agents.map((a) => `<option value="${escapeHtml(a.id)}">${escapeHtml(a.name || a.id)}</option>`).join('');- } catch { /* keep "All agents" */ }+ $('pd-rev-agent').innerHTML =+ '<option value="">All agents</option>' ++ agents+ .map(+ (a) =>+ `<option value="${escapeHtml(a.id)}">${escapeHtml(a.name || a.id)}</option>`,+ )+ .join('');+ } catch {+ /* keep "All agents" */+ }}async function fetchRevenue() {const status = $('pd-rev-status');@@ -2563,22 +3950,32 @@status.textContent = 'Loading…';skillTbody.innerHTML = '<tr><td colspan="3" class="pd-empty">Loading…</td></tr>';const params = new URLSearchParams();- const agent = $('pd-rev-agent').value; if (agent) params.set('agent_id', agent);+ const agent = $('pd-rev-agent').value;+ if (agent) params.set('agent_id', agent);params.set('granularity', $('pd-rev-granularity').value || 'day');- const from = $('pd-rev-from').value; if (from) params.set('from', new Date(from).toISOString());- const to = $('pd-rev-to').value; if (to) params.set('to', new Date(to + 'T23:59:59').toISOString());+ const from = $('pd-rev-from').value;+ if (from) params.set('from', new Date(from).toISOString());+ const to = $('pd-rev-to').value;+ if (to) params.set('to', new Date(to + 'T23:59:59').toISOString());try {const r = await apiFetch('/api/billing/revenue?' + params.toString());if (r.status === 401) {- status.innerHTML = 'Sign in to view revenue. <a href="/login" style="color:var(--accent)">Sign in</a>';- skillTbody.innerHTML = '<tr><td colspan="3" class="pd-empty">Sign in required.</td></tr>';- ['pd-rev-gross', 'pd-rev-fees', 'pd-rev-net', 'pd-rev-count'].forEach((id) => { $(id).textContent = '—'; });+ status.innerHTML =+ 'Sign in to view revenue. <a href="/login" style="color:var(--accent)">Sign in</a>';+ skillTbody.innerHTML =+ '<tr><td colspan="3" class="pd-empty">Sign in required.</td></tr>';+ ['pd-rev-gross', 'pd-rev-fees', 'pd-rev-net', 'pd-rev-count'].forEach(+ (id) => {+ $(id).textContent = '—';+ },+ );drawChartMessage($('pd-rev-chart'), 'Sign in to view revenue');return;}if (!r.ok) {const err = await r.json().catch(() => ({}));- status.textContent = err.error_description || err.error || `Error ${r.status}`;+ status.textContent =+ err.error_description || err.error || `Error ${r.status}`;return;}await renderRevenue(await r.json());@@ -2590,7 +3987,10 @@const s = d.summary || {};const mint = s.currency_mint;const decimals = mint ? await getMintDecimals(mint) : 6;- const fmt = (v) => (Number(v || 0) / Math.pow(10, decimals)).toLocaleString(undefined, { maximumFractionDigits: Math.min(decimals, 6) });+ const fmt = (v) =>+ (Number(v || 0) / Math.pow(10, decimals)).toLocaleString(undefined, {+ maximumFractionDigits: Math.min(decimals, 6),+ });$('pd-rev-gross').textContent = fmt(s.gross_total);$('pd-rev-fees').textContent = fmt(s.fee_total);$('pd-rev-net').textContent = fmt(s.net_total);@@ -2599,33 +3999,79 @@$('pd-rev-chain').textContent = s.chain || '—';const skills = d.by_skill || [];$('pd-rev-skill-table').innerHTML = skills.length- ? skills.map((r) => `<tr><td>${escapeHtml(r.skill)}</td><td style="text-align:right" class="pd-mono">${Number(r.count || 0).toLocaleString()}</td><td style="text-align:right" class="pd-mono">${fmt(r.net_total)}</td></tr>`).join('')+ ? skills+ .map(+ (r) =>+ `<tr><td>${escapeHtml(r.skill)}</td><td style="text-align:right" class="pd-mono">${Number(r.count || 0).toLocaleString()}</td><td style="text-align:right" class="pd-mono">${fmt(r.net_total)}</td></tr>`,+ )+ .join(''): '<tr><td colspan="3" class="pd-empty">No revenue events in this window.</td></tr>';drawRevenueChart(d.timeseries || [], decimals);- $('pd-rev-status').textContent = (s.payment_count || 0) === 0 ? 'No revenue events in this window.' : '';+ $('pd-rev-status').textContent =+ (s.payment_count || 0) === 0 ? 'No revenue events in this window.' : '';}function drawRevenueChart(series, decimals) {const canvas = $('pd-rev-chart');- if (!series.length) { drawChartMessage(canvas, 'No revenue events in this window'); return; }+ if (!series.length) {+ drawChartMessage(canvas, 'No revenue events in this window');+ return;+ }const { ctx, w, h } = setupCanvas(canvas);ctx.clearRect(0, 0, w, h);- const x0 = 56, x1 = w - 12, y0 = 10, y1 = h - 22;+ const x0 = 56,+ x1 = w - 12,+ y0 = 10,+ y1 = h - 22;const vals = series.map((s) => Number(s.net_total || 0) / Math.pow(10, decimals));- let vMax = Math.max(...vals, 0); if (vMax === 0) vMax = 1;+ let vMax = Math.max(...vals, 0);+ if (vMax === 0) vMax = 1;const n = series.length;const xFor = (i) => x0 + (n === 1 ? 0.5 : i / (n - 1)) * (x1 - x0);const yFor = (v) => y1 - (v / vMax) * (y1 - y0);- ctx.strokeStyle = 'rgba(255,255,255,0.06)'; ctx.fillStyle = 'rgba(255,255,255,0.42)';- ctx.font = '10px system-ui'; ctx.lineWidth = 1; ctx.textAlign = 'right'; ctx.textBaseline = 'middle';- for (let i = 0; i <= 4; i++) { const v = vMax * i / 4; const y = yFor(v); ctx.beginPath(); ctx.moveTo(x0, y); ctx.lineTo(x1, y); ctx.stroke(); ctx.fillText(v.toLocaleString(undefined, { maximumFractionDigits: 2 }), x0 - 6, y); }- ctx.textAlign = 'center'; ctx.textBaseline = 'top';+ ctx.strokeStyle = 'rgba(255,255,255,0.06)';+ ctx.fillStyle = 'rgba(255,255,255,0.42)';+ ctx.font = '10px system-ui';+ ctx.lineWidth = 1;+ ctx.textAlign = 'right';+ ctx.textBaseline = 'middle';+ for (let i = 0; i <= 4; i++) {+ const v = (vMax * i) / 4;+ const y = yFor(v);+ ctx.beginPath();+ ctx.moveTo(x0, y);+ ctx.lineTo(x1, y);+ ctx.stroke();+ ctx.fillText(+ v.toLocaleString(undefined, { maximumFractionDigits: 2 }),+ x0 - 6,+ y,+ );+ }+ ctx.textAlign = 'center';+ ctx.textBaseline = 'top';const step = Math.max(1, Math.floor(n / 6));- for (let i = 0; i < n; i += step) { const x = xFor(i); ctx.fillText(String(series[i].period).slice(5), Math.max(x0 + 12, Math.min(x1 - 12, x)), y1 + 5); }- ctx.strokeStyle = cssVar('--success'); ctx.lineWidth = 1.5; ctx.beginPath();- vals.forEach((v, i) => { const x = xFor(i), y = yFor(v); i ? ctx.lineTo(x, y) : ctx.moveTo(x, y); });+ for (let i = 0; i < n; i += step) {+ const x = xFor(i);+ ctx.fillText(+ String(series[i].period).slice(5),+ Math.max(x0 + 12, Math.min(x1 - 12, x)),+ y1 + 5,+ );+ }+ ctx.strokeStyle = cssVar('--success');+ ctx.lineWidth = 1.5;+ ctx.beginPath();+ vals.forEach((v, i) => {+ const x = xFor(i),+ y = yFor(v);+ i ? ctx.lineTo(x, y) : ctx.moveTo(x, y);+ });ctx.stroke();- ctx.lineTo(xFor(n - 1), y1); ctx.lineTo(xFor(0), y1); ctx.closePath();- ctx.fillStyle = 'rgba(74,222,128,0.08)'; ctx.fill();+ ctx.lineTo(xFor(n - 1), y1);+ ctx.lineTo(xFor(0), y1);+ ctx.closePath();+ ctx.fillStyle = 'rgba(74,222,128,0.08)';+ ctx.fill();}// ════════════════════════════════════════════════════════════@@ -2636,13 +4082,31 @@tbody.innerHTML = '<tr><td colspan="7" class="pd-empty">Loading…</td></tr>';try {const r = await apiFetch('/api/api-keys');- if (r.status === 401) { tbody.innerHTML = '<tr><td colspan="7" class="pd-empty">Sign in to manage keys. <a href="/login" style="color:var(--accent)">Sign in</a></td></tr>'; $('pd-keys-count').textContent = '—'; return; }- if (r.status === 429) { tbody.innerHTML = '<tr><td colspan="7" class="pd-empty">Too many requests, try again shortly.</td></tr>'; return; }- if (!r.ok) { tbody.innerHTML = `<tr><td colspan="7" class="pd-empty">Error ${r.status}.</td></tr>`; return; }+ if (r.status === 401) {+ tbody.innerHTML =+ '<tr><td colspan="7" class="pd-empty">Sign in to manage keys. <a href="/login" style="color:var(--accent)">Sign in</a></td></tr>';+ $('pd-keys-count').textContent = '—';+ return;+ }+ if (r.status === 429) {+ tbody.innerHTML =+ '<tr><td colspan="7" class="pd-empty">Too many requests, try again shortly.</td></tr>';+ return;+ }+ if (!r.ok) {+ tbody.innerHTML = `<tr><td colspan="7" class="pd-empty">Error ${r.status}.</td></tr>`;+ return;+ }const { data } = await r.json();$('pd-keys-count').textContent = String(data.length);- if (!data.length) { tbody.innerHTML = '<tr><td colspan="7" class="pd-empty">You haven\'t created any API keys yet.</td></tr>'; return; }- tbody.innerHTML = data.map((k) => `<tr>+ if (!data.length) {+ tbody.innerHTML =+ '<tr><td colspan="7" class="pd-empty">You haven\'t created any API keys yet.</td></tr>';+ return;+ }+ tbody.innerHTML = data+ .map(+ (k) => `<tr><td>${escapeHtml(k.name)}</td><td class="pd-mono">${escapeHtml(k.prefix)}…</td><td class="pd-mono" style="font-size:0.74rem">${escapeHtml((k.scope || '').split(/\s+/).filter(Boolean).join(', '))}</td>@@ -2650,8 +4114,14 @@<td class="pd-mono">${k.last_used_at ? relTime(k.last_used_at) : 'never'}</td><td class="pd-mono">${k.expires_at ? new Date(k.expires_at).toLocaleDateString() : '—'}</td><td><button class="pd-btn pd-btn-sm is-danger" type="button" data-revoke-key="${escapeHtml(k.id)}">Revoke</button></td>- </tr>`).join('');- tbody.querySelectorAll('[data-revoke-key]').forEach((b) => b.addEventListener('click', () => revokeApiKey(b.dataset.revokeKey)));+ </tr>`,+ )+ .join('');+ tbody+ .querySelectorAll('[data-revoke-key]')+ .forEach((b) =>+ b.addEventListener('click', () => revokeApiKey(b.dataset.revokeKey)),+ );} catch (e) {tbody.innerHTML = `<tr><td colspan="7" class="pd-empty">Failed: ${escapeHtml(e.message || 'load failed')}</td></tr>`;}@@ -2659,9 +4129,17 @@async function createApiKey(e) {e.preventDefault();const name = $('pd-key-name').value.trim();- if (!name) { toast('Key name is required', 'error'); return; }- const scopes = Array.from(document.querySelectorAll('.pd-key-scope:checked')).map((c) => c.value);- if (!scopes.length) { toast('Select at least one scope', 'error'); return; }+ if (!name) {+ toast('Key name is required', 'error');+ return;+ }+ const scopes = Array.from(document.querySelectorAll('.pd-key-scope:checked')).map(+ (c) => c.value,+ );+ if (!scopes.length) {+ toast('Select at least one scope', 'error');+ return;+ }const body = { name, scope: scopes.join(' ') };const expiryRaw = $('pd-key-expiry').value;if (expiryRaw) body.expires_at = new Date(expiryRaw).toISOString();@@ -2671,9 +4149,23 @@const csrf = await getCsrfToken();const headers = { 'Content-Type': 'application/json' };if (csrf) headers['x-csrf-token'] = csrf;- const r = await apiFetch('/api/api-keys', { method: 'POST', headers, body: JSON.stringify(body) });- if (r.status === 429) { toast('Too many requests, try again shortly', 'error'); return; }- if (!r.ok) { const err = await r.json().catch(() => ({})); toast(err.error_description || err.error || `Create failed (${r.status})`, 'error'); return; }+ const r = await apiFetch('/api/api-keys', {+ method: 'POST',+ headers,+ body: JSON.stringify(body),+ });+ if (r.status === 429) {+ toast('Too many requests, try again shortly', 'error');+ return;+ }+ if (!r.ok) {+ const err = await r.json().catch(() => ({}));+ toast(+ err.error_description || err.error || `Create failed (${r.status})`,+ 'error',+ );+ return;+ }const { data } = await r.json();$('pd-key-token').value = data.token;openModal('pd-key-modal');@@ -2684,13 +4176,24 @@}}async function revokeApiKey(id) {- if (!confirm('Revoke this API key? Apps using it will stop working immediately.')) return;+ if (!confirm('Revoke this API key? Apps using it will stop working immediately.'))+ return;try {const csrf = await getCsrfToken();const headers = {};if (csrf) headers['x-csrf-token'] = csrf;- const r = await apiFetch('/api/api-keys/' + encodeURIComponent(id), { method: 'DELETE', headers });- if (!r.ok) { const err = await r.json().catch(() => ({})); toast(err.error_description || err.error || `Revoke failed (${r.status})`, 'error'); return; }+ const r = await apiFetch('/api/api-keys/' + encodeURIComponent(id), {+ method: 'DELETE',+ headers,+ });+ if (!r.ok) {+ const err = await r.json().catch(() => ({}));+ toast(+ err.error_description || err.error || `Revoke failed (${r.status})`,+ 'error',+ );+ return;+ }toast('Key revoked', 'success');loadApiKeys();} catch (e) {@@ -2709,21 +4212,25 @@const ac = state.alertConfig;if (ac.graduation !== undefined) $('pd-alert-graduation').checked = ac.graduation;- if (ac.whale !== undefined) $('pd-alert-whale').checked = ac.whale;- if (ac.fees !== undefined) $('pd-alert-fees').checked = ac.fees;- if (ac.launch !== undefined) $('pd-alert-launch').checked = ac.launch;- if (ac.whaleThreshold) $('pd-threshold-whale').value = ac.whaleThreshold;- if (ac.claimThreshold) $('pd-threshold-claim').value = ac.claimThreshold;- if (ac.cooldown) $('pd-threshold-cooldown').value = ac.cooldown;+ if (ac.whale !== undefined) $('pd-alert-whale').checked = ac.whale;+ if (ac.fees !== undefined) $('pd-alert-fees').checked = ac.fees;+ if (ac.launch !== undefined) $('pd-alert-launch').checked = ac.launch;+ if (ac.whaleThreshold) $('pd-threshold-whale').value = ac.whaleThreshold;+ if (ac.claimThreshold) $('pd-threshold-claim').value = ac.claimThreshold;+ if (ac.cooldown) $('pd-threshold-cooldown').value = ac.cooldown;// Sidebar navdocument.querySelectorAll('.pd-sidebar nav a').forEach((a) => {- a.addEventListener('click', (e) => { e.preventDefault(); navigateTo(a.dataset.page); });+ a.addEventListener('click', (e) => {+ e.preventDefault();+ navigateTo(a.dataset.page);+ });});// Deep links: honor #hash on load and when the URL is edited by hand.const hashPage = location.hash.slice(1);- if (hashPage && hashPage !== state.currentPage && $('page-' + hashPage)) navigateTo(hashPage);+ if (hashPage && hashPage !== state.currentPage && $('page-' + hashPage))+ navigateTo(hashPage);window.addEventListener('hashchange', () => {const page = location.hash.slice(1);if (page && page !== state.currentPage && $('page-' + page)) navigateTo(page);@@ -2732,24 +4239,36 @@// Filter buttonsdocument.querySelectorAll('.pd-filter-btn').forEach((b) => {b.addEventListener('click', () => {- document.querySelectorAll('.pd-filter-btn').forEach((x) => x.classList.remove('is-active'));+ document+ .querySelectorAll('.pd-filter-btn')+ .forEach((x) => x.classList.remove('is-active'));b.classList.add('is-active');state.currentFilter = b.dataset.filter;applyFeedFilter();});});- $('pd-feed-pause').addEventListener('change', (e) => { state.feedPaused = e.target.checked; });+ $('pd-feed-pause').addEventListener('change', (e) => {+ state.feedPaused = e.target.checked;+ });// Dashboard & live feed clears- $('pd-clear-dash-feed').addEventListener('click', () => clearFeed('pd-dashboard-feed'));+ $('pd-clear-dash-feed').addEventListener('click', () =>+ clearFeed('pd-dashboard-feed'),+ );$('pd-clear-live-feed').addEventListener('click', () => clearFeed('pd-live-feed'));- $('pd-clear-alert-feed').addEventListener('click', () => clearFeed('pd-alert-feed'));+ $('pd-clear-alert-feed').addEventListener('click', () =>+ clearFeed('pd-alert-feed'),+ );// Watches- $('pd-add-watch-btn').addEventListener('click', () => openModal('pd-add-watch-modal'));+ $('pd-add-watch-btn').addEventListener('click', () =>+ openModal('pd-add-watch-modal'),+ );$('pd-refresh-watches').addEventListener('click', refreshWatches);- $('pd-cancel-watch').addEventListener('click', () => closeModal('pd-add-watch-modal'));+ $('pd-cancel-watch').addEventListener('click', () =>+ closeModal('pd-add-watch-modal'),+ );$('pd-create-watch').addEventListener('click', createWatch);// Claims@@ -2770,7 +4289,8 @@$('pd-vanity-start').addEventListener('click', startVanity);$('pd-vanity-stop').addEventListener('click', stopVanity);- if (state.alertConfig.webhookUrl) $('pd-alert-webhook').value = state.alertConfig.webhookUrl;+ if (state.alertConfig.webhookUrl)+ $('pd-alert-webhook').value = state.alertConfig.webhookUrl;// Animations + TTS (Task 11)$('pd-speak-btn').addEventListener('click', () => agentAction('speak'));@@ -2786,13 +4306,16 @@// Wallet snapshot (Task 02) — connect via src/wallet.js, react to events.initWalletButton();- window.addEventListener('wallet:changed', (e) => onWalletChanged(e.detail?.address || null));+ window.addEventListener('wallet:changed', (e) =>+ onWalletChanged(e.detail?.address || null),+ );$('connect-wallet-btn')?.addEventListener('click', () => {const holdings = $('pd-wallet-holdings');if (holdings && !getConnectedWalletAddress()) {$('pd-wallet-empty').hidden = true;holdings.hidden = false;- holdings.innerHTML = '<div style="font-size:0.85rem;color:var(--ink-dim)">Connecting…</div>';+ holdings.innerHTML =+ '<div style="font-size:0.85rem;color:var(--ink-dim)">Connecting…</div>';}});$('pd-wallet-disconnect').addEventListener('click', disconnectWallet);@@ -2801,23 +4324,34 @@$('pd-chart-token').addEventListener('change', (e) => {const opt = e.target.selectedOptions[0];if (!opt || !opt.value) return;- document.dispatchEvent(new CustomEvent('chart:tokenChange', { detail: { mint: opt.value, symbol: opt.dataset.symbol || '' } }));+ document.dispatchEvent(+ new CustomEvent('chart:tokenChange', {+ detail: { mint: opt.value, symbol: opt.dataset.symbol || '' },+ }),+ );});$('pd-chart-retry').addEventListener('click', () => {if (chart.mint) fetchChartData(chart.mint, chart.symbol);else loadTrendingTokens();});- document.addEventListener('chart:tokenChange', (e) => fetchChartData(e.detail.mint, e.detail.symbol));+ document.addEventListener('chart:tokenChange', (e) =>+ fetchChartData(e.detail.mint, e.detail.symbol),+ );const marketCanvas = $('pd-market-chart');marketCanvas.addEventListener('mousemove', onChartMove);marketCanvas.addEventListener('mouseleave', () => {- if (_chartHoverRaf) { cancelAnimationFrame(_chartHoverRaf); _chartHoverRaf = 0; }+ if (_chartHoverRaf) {+ cancelAnimationFrame(_chartHoverRaf);+ _chartHoverRaf = 0;+ }$('pd-chart-tooltip').style.display = 'none';});let _chartResizeRaf = 0;new ResizeObserver(() => {cancelAnimationFrame(_chartResizeRaf);- _chartResizeRaf = requestAnimationFrame(() => { if (chart.candles.length) drawMarketChart(marketCanvas); });+ _chartResizeRaf = requestAnimationFrame(() => {+ if (chart.candles.length) drawMarketChart(marketCanvas);+ });}).observe(marketCanvas);// Revenue (Task 08)@@ -2829,9 +4363,16 @@// API keys (Task 09)$('pd-key-create-form').addEventListener('submit', createApiKey);$('pd-key-copy').addEventListener('click', async () => {- try { await navigator.clipboard.writeText($('pd-key-token').value); toast('Token copied', 'success'); } catch {}+ try {+ await navigator.clipboard.writeText($('pd-key-token').value);+ toast('Token copied', 'success');+ } catch {}+ });+ $('pd-key-done').addEventListener('click', () => {+ closeModal('pd-key-modal');+ $('pd-key-token').value = '';+ loadApiKeys();});- $('pd-key-done').addEventListener('click', () => { closeModal('pd-key-modal'); $('pd-key-token').value = ''; loadApiKeys(); });// Boot the data flowsconnectApi();@@ -2850,5 +4391,5 @@<script src="/footer.js" defer></script><script src="/brand.js" defer></script>-</body>+ </body></html>diff --git a/pages/scan.html b/pages/scan.htmlindex 9e037c6a1..24392f317 100644--- a/pages/scan.html+++ b/pages/scan.html@@ -1,909 +1,2202 @@<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />- <title>3D Scanner · Scan yourself into 3D · three.ws</title>+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />+ <title>3D Scanner · Scan yourself into 3D · three.ws</title><link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" /><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /><link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/site.webmanifest" />- <meta name="description" content="Point your camera, hold still, and walk away with a rigged 3D model of yourself — in about a minute. Free, in your browser." />- <meta name="robots" content="index, follow" />-- <meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:url" content="https://three.ws/scan" />- <meta property="og:title" content="3D Scanner · Scan yourself into 3D" />- <meta property="og:description" content="Point your camera, hold still, walk away with a rigged 3D model of yourself. Free, in your browser." />- <meta property="og:image" content="https://three.ws/og-image.png" />- <meta name="twitter:card" content="summary_large_image" />-- <style>- :root {- color-scheme: dark;- --bg: #000000;- --panel: #0a0a0a;- --panel-elev: #111111;- --border: #1a1a1a;- --border-strong: #2a2a2a;- --text: #e8e8e8;- --muted: #888888;- --accent: #ffffff;- --accent-ink: #000000;- --scan: #6ee7ff;- --scan-dim: rgba(110, 231, 255, 0.12);- --danger: #f87171;- --danger-dim: #4a1a1a;- }- * { box-sizing: border-box; }- html, body { margin: 0; padding: 0; }- body {- font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;- color: var(--text);- background: var(--bg);- min-height: 100vh;- overflow-x: hidden;- }- body::before {- content: '';- position: fixed;- inset: 0;- z-index: -1;- pointer-events: none;- background:- radial-gradient(800px 500px at 50% -80px, rgba(110, 231, 255, 0.06) 0, transparent 70%),- radial-gradient(600px 400px at 50% 110%, rgba(110, 231, 255, 0.05) 0, transparent 70%),- #000000;- }- main.stage { max-width: 720px; margin: 0 auto; padding: 28px 20px 96px; }- .topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }- .topbar button.back {- background: var(--panel); border: 1px solid var(--border); color: var(--text);- width: 36px; height: 36px; border-radius: 9px; font: inherit; cursor: pointer;- display: inline-flex; align-items: center; justify-content: center;- }- .topbar button.back:hover { border-color: var(--border-strong); }- .topbar .label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }- .topbar .label strong { color: var(--text); font-weight: 600; }- .topbar .badge {- margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;- text-transform: uppercase; color: var(--scan); border: 1px solid var(--scan-dim);- background: var(--scan-dim); border-radius: 999px; padding: 4px 10px;- }- h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.02em; }- h1 .hl { color: var(--scan); }- .sub { color: var(--muted); margin: 0 0 24px; line-height: 1.55; }-- .step { display: none; opacity: 0; }- .step.active { display: block; animation: step-in 400ms ease forwards; }- @keyframes step-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }-- .unsupported {- display: none; padding: 12px 14px; background: rgba(239, 77, 77, 0.08);- border: 1px solid var(--danger-dim); border-radius: 9px; color: #f4b5b5;- font-size: 13.5px; margin: 0 0 20px;- }- .unsupported.show { display: block; }-- /* ── Scanner hero ─────────────────────────────────────────────────── */- .hero-slot-wrap { margin: 8px 0 18px; }- .hero-slot {- aspect-ratio: 3 / 4; max-width: 380px; margin: 0 auto;- background:- linear-gradient(rgba(110,231,255,0.04), rgba(110,231,255,0.04)),- var(--panel);- border: 1.5px dashed var(--border-strong); border-radius: 18px;- position: relative; overflow: hidden; cursor: pointer;- display: flex; flex-direction: column; align-items: center; justify-content: center;- gap: 10px; color: var(--muted); transition: border-color 120ms, background 120ms;- }- .hero-slot::before {- content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;- background-image:- linear-gradient(var(--scan-dim) 1px, transparent 1px),- linear-gradient(90deg, var(--scan-dim) 1px, transparent 1px);- background-size: 28px 28px; mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 72%);- -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 72%);- }- .hero-slot:hover, .hero-slot:focus-visible { border-color: var(--scan); color: var(--text); outline: none; }- .hero-slot.drag { border-color: var(--scan); background: rgba(110,231,255,0.06); cursor: copy; }- .hero-slot.filled { border-style: solid; border-color: var(--border); padding: 0; cursor: default; }- .hero-slot.error { border-color: var(--danger); }- .hero-slot .hero-icon {- width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;- border: 1.5px solid var(--scan); color: var(--scan); position: relative; z-index: 1;- box-shadow: 0 0 0 6px var(--scan-dim);- }- .hero-slot .hero-title { font-size: 16px; color: var(--text); font-weight: 600; position: relative; z-index: 1; }- .hero-slot .hero-sub { font-size: 13px; color: var(--muted); max-width: 260px; text-align: center; line-height: 1.45; position: relative; z-index: 1; }- .hero-slot img.preview { width: 100%; height: 100%; object-fit: cover; display: block; }- .hero-slot .retake-btn {- position: absolute; top: 12px; right: 12px; background: rgba(0, 0, 0, 0.65);- backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);- border: 1px solid rgba(255, 255, 255, 0.15); color: var(--text); border-radius: 9px;- padding: 8px 12px; font: 600 12px/1 inherit; cursor: pointer;- display: inline-flex; align-items: center; gap: 6px; transition: background 120ms; z-index: 2;- }- .hero-slot .retake-btn:hover { background: rgba(0, 0, 0, 0.85); }- .hero-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }- .hero-pill {- background: var(--panel); border: 1px solid var(--border); color: var(--muted);- border-radius: 999px; padding: 8px 16px; font: 500 12.5px/1 inherit; cursor: pointer;- transition: color 120ms, border-color 120ms; display: inline-flex; align-items: center; gap: 7px;- }- .hero-pill:hover { color: var(--text); border-color: var(--border-strong); }- .hero-pill[data-action="open-camera"] { border-color: var(--scan-dim); color: var(--scan); }- .hero-pill[data-action="open-camera"]:hover { border-color: var(--scan); }- .hero-pill[hidden] { display: none; }- .hero-pill svg { display: block; }-- .fidelity { margin: 0 0 22px; border: 1px solid var(--border); background: var(--panel); border-radius: 12px; overflow: hidden; }- .fidelity summary {- list-style: none; padding: 14px 16px; cursor: pointer; display: flex;- align-items: center; justify-content: space-between; gap: 12px; color: var(--text);- }- .fidelity summary::-webkit-details-marker { display: none; }- .fidelity .fid-label { font-size: 14px; font-weight: 600; }- .fidelity .fid-note { color: var(--muted); font-size: 12.5px; font-weight: 400; }- .fidelity .fid-chev { color: var(--muted); transition: transform 200ms; }- .fidelity[open] .fid-chev { transform: rotate(180deg); }- .fidelity .fid-body { padding: 4px 16px 18px; }- .slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }- .slot-frame {- aspect-ratio: 3 / 4; background: var(--panel-elev); border: 1.5px dashed var(--border-strong);- border-radius: 11px; position: relative; overflow: hidden; cursor: pointer;- display: flex; flex-direction: column; align-items: center; justify-content: center;- gap: 6px; color: var(--muted); transition: border-color 120ms, background 120ms;- }- .slot-frame:hover, .slot-frame:focus-visible { border-color: var(--scan); color: var(--text); outline: none; }- .slot-frame.drag { border-color: var(--scan); background: rgba(110,231,255,0.06); cursor: copy; }- .slot-frame.filled { border-style: solid; border-color: var(--border); padding: 0; }- .slot-frame.error { border-color: var(--danger); }- .slot-frame .slot-label { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }- .slot-frame .slot-hint { font-size: 13px; color: var(--text); font-weight: 500; }- .slot-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }- .slot-frame .retake-btn {- position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, 0.7);- border: 1px solid rgba(255, 255, 255, 0.2); color: var(--text); border-radius: 7px;- padding: 4px 9px; font: 600 11px/1 inherit; cursor: pointer;- }-- .opts { margin: 0 0 22px; display: flex; flex-direction: column; gap: 18px; }- .opt-group .opt-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }- .toggle { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }- .toggle button { background: transparent; border: none; color: var(--muted); font: 600 13px/1 inherit; padding: 8px 14px; border-radius: 7px; cursor: pointer; }- .toggle button[aria-pressed="true"] { background: var(--panel-elev); color: var(--text); }- .toggle button:hover { color: var(--text); }- .style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }- .style-card {- background: var(--panel); border: 1.5px solid var(--border); border-radius: 11px; padding: 12px;- cursor: pointer; text-align: left; color: var(--text); font: inherit; display: flex; gap: 12px;- align-items: center; transition: border-color 120ms, transform 120ms;- }- .style-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }- .style-card[aria-pressed="true"] { border-color: var(--scan); background: rgba(110,231,255,0.05); }- .style-swatch { width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0; background-size: cover; background-position: center; border: 1px solid var(--border); }- .style-swatch.photoreal { background: radial-gradient(circle at 35% 30%, #f6c79b 0%, #c98c61 45%, #4a2e1d 95%); }- .style-swatch.stylized { background: radial-gradient(circle at 35% 30%, #ffd5e8 0%, #c4a3ff 45%, #5a3aa3 95%); }- .style-card .style-title { font-size: 14px; font-weight: 600; line-height: 1.2; margin: 0 0 2px; }- .style-card .style-desc { font-size: 12px; color: var(--muted); line-height: 1.35; }-- .steps-strip { display: flex; gap: 8px; margin: 0 0 22px; flex-wrap: wrap; }- .steps-strip .chip {- font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px;- padding: 6px 12px; display: inline-flex; align-items: center; gap: 7px; background: var(--panel);- }- .steps-strip .chip b { color: var(--scan); font-weight: 700; }-- /* ── Building ─────────────────────────────────────────────────────── */- .build-progress { display: flex; flex-direction: column; gap: 0; margin: 0 0 28px; }- .build-step { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; position: relative; transition: opacity 200ms; }- .build-step:not(:last-child)::after { content: ''; position: absolute; left: 9px; top: 30px; bottom: -10px; width: 2px; background: var(--border); }- .build-step.completed::after { background: rgba(110, 231, 255, 0.4); }- .bstep-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--panel); flex-shrink: 0; margin-top: 1px; position: relative; z-index: 1; }- .build-step.completed .bstep-dot { background: var(--scan); border-color: var(--scan); }- .build-step.completed .bstep-dot::after { content: ''; display: block; width: 5px; height: 9px; border: 2px solid var(--accent-ink); border-top: none; border-left: none; transform: rotate(45deg) translate(-1px, -1px); position: absolute; top: 2px; left: 5px; }- .build-step.active .bstep-dot { border-color: var(--scan); animation: bstep-pulse 1.4s ease-in-out infinite; }- @keyframes bstep-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(110, 231, 255, 0.4); } 50% { box-shadow: 0 0 0 6px rgba(110, 231, 255, 0); } }- .bstep-label { font-size: 14px; color: var(--muted); line-height: 1.4; padding-top: 1px; }- .build-step.active .bstep-label { color: var(--text); font-weight: 500; }- .build-step.completed { opacity: 0.65; }- .build-step.failed .bstep-dot { background: var(--danger); border-color: var(--danger); animation: none; }- .build-step.failed .bstep-dot::after { content: '×'; display: block; color: #fff; font: 700 14px/1 sans-serif; text-align: center; position: absolute; top: -1px; left: 2px; }- .build-step.failed .bstep-label { color: var(--danger); font-weight: 500; }- .build-step.failed::after { background: var(--danger-dim); }-- .build-viewer { position: relative; width: 100%; max-width: 320px; margin: 0 auto 24px; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--border); }- .build-viewer model-viewer { width: 100%; height: 100%; --poster-color: transparent; }- .build-preview { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 2px solid var(--scan); box-shadow: 0 8px 24px -4px rgba(0,0,0,0.6), 0 0 0 4px rgba(110,231,255,0.18); background: var(--panel); opacity: 0; transition: opacity 320ms ease; animation: preview-breathe 2.4s ease-in-out infinite; }- .build-preview.show { opacity: 1; }- @keyframes preview-breathe { 0%, 100% { box-shadow: 0 8px 24px -4px rgba(0,0,0,0.6), 0 0 0 4px rgba(110,231,255,0.18); } 50% { box-shadow: 0 8px 24px -4px rgba(0,0,0,0.6), 0 0 0 9px rgba(110,231,255,0.08); } }- .build-veil { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 18px; background: linear-gradient(to bottom, rgba(5,6,10,0.05), rgba(5,6,10,0.45) 65%); pointer-events: none; }- .build-ring { width: 36px; height: 36px; border-radius: 50%; border: 2.5px solid rgba(110, 231, 255, 0.15); border-top-color: var(--scan); animation: build-spin 1s linear infinite; }- @keyframes build-spin { to { transform: rotate(360deg); } }- .build-error { display: none; padding: 12px 14px; background: rgba(239, 77, 77, 0.08); border: 1px solid var(--danger-dim); border-radius: 9px; color: #f4b5b5; font-size: 13.5px; margin: 0 0 16px; }- .build-error.show { display: block; }- .build-retry { width: 100%; max-width: 320px; margin: 0 auto; display: none; padding: 12px 18px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font: 600 14px/1 inherit; cursor: pointer; text-align: center; }- .build-retry.show { display: block; }- .build-retry:hover { border-color: var(--border-strong); }-- /* ── Done ─────────────────────────────────────────────────────────── */- [data-step="done"] h1 { text-align: center; }- [data-step="done"] .sub { text-align: center; }- .done-viewer { position: relative; width: 100%; max-width: 340px; margin: 0 auto 22px; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--border); }- .done-viewer::after { content: ''; position: absolute; inset: -2px; border-radius: 18px; background: conic-gradient(from 0deg, var(--scan), rgba(136, 136, 136, 0.3), var(--scan), rgba(136, 136, 136, 0.3)); z-index: -1; animation: done-glow 6s linear infinite; opacity: 0.45; }- @keyframes done-glow { to { transform: rotate(360deg); } }- .done-viewer model-viewer { width: 100%; height: 100%; --poster-color: transparent; }- .viewer-error { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px; text-align: center; font-size: 13px; line-height: 1.5; color: var(--muted); background: var(--panel); }- .viewer-error.show { display: flex; }- .name-row { margin: 0 0 18px; }- .name-input { width: 100%; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--text); font: 15px/1 inherit; outline: none; transition: border-color 120ms; }- .name-input:focus { border-color: var(--scan); }- .name-input::placeholder { color: var(--muted); }-- .export-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 14px; }- .export-btn {- padding: 12px 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px;- color: var(--text); font: 600 13px/1.2 inherit; cursor: pointer; transition: border-color 120ms, color 120ms;- display: flex; flex-direction: column; align-items: center; gap: 6px;- }- .export-btn:hover:not(:disabled) { border-color: var(--scan); }- .export-btn:disabled { opacity: 0.5; cursor: progress; }- .export-btn svg { display: block; color: var(--scan); }- .export-btn .ext { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.04em; }-- .done-actions { display: flex; flex-direction: column; gap: 10px; }- .btn-save { width: 100%; padding: 14px 18px; background: var(--scan); color: var(--accent-ink); border: none; border-radius: 10px; font: 700 15px/1 inherit; cursor: pointer; transition: filter 120ms; }- .btn-save:hover { filter: brightness(1.06); }- .btn-save:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }- .btn-share { width: 100%; padding: 13px 18px; background: transparent; color: var(--text); border: 1px solid var(--scan); border-radius: 10px; font: 600 14px/1 inherit; cursor: pointer; transition: background 120ms; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }- .btn-share:hover { background: var(--scan-dim); }- .btn-share svg { color: var(--scan); }- .btn-ghost { width: 100%; padding: 12px 18px; background: var(--panel); color: var(--muted); border: 1px solid var(--border); border-radius: 10px; font: 500 14px/1 inherit; cursor: pointer; transition: color 120ms, border-color 120ms; }- .btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }- .share-toast { text-align: center; font-size: 12.5px; color: var(--scan); min-height: 18px; margin: 6px 0 0; opacity: 0; transition: opacity 200ms; }- .share-toast.show { opacity: 1; }- .portability-note { margin-top: 22px; padding: 14px 16px; background: rgba(110, 231, 255, 0.04); border: 1px solid rgba(110, 231, 255, 0.14); border-radius: 10px; font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }- .portability-note a { color: var(--scan); text-decoration: none; white-space: nowrap; font-weight: 500; }- .portability-note a:hover { text-decoration: underline; }-- .submit-bar { margin-top: 6px; position: sticky; bottom: 16px; z-index: 2; }- .submit-bar[hidden] { display: none; }- #submit-btn { width: 100%; padding: 16px 18px; background: var(--panel); color: var(--muted); border: 1px solid var(--border); border-radius: 12px; font: 700 15px/1.2 inherit; cursor: not-allowed; transition: background 120ms, color 120ms, border-color 120ms; display: flex; align-items: center; justify-content: center; gap: 10px; }- #submit-btn .meta { font: 500 12px/1 inherit; color: var(--muted); opacity: 0.85; }- #submit-btn.ready { background: var(--scan); color: var(--accent-ink); border-color: var(--scan); cursor: pointer; box-shadow: 0 10px 30px -10px rgba(110, 231, 255, 0.4); animation: btn-ready 300ms ease; }- @keyframes btn-ready { from { transform: scale(0.97); opacity: 0.8; } to { transform: scale(1); opacity: 1; } }- #submit-btn.ready .meta { color: rgba(10, 10, 10, 0.7); }- #submit-btn.ready:hover { filter: brightness(0.94); }-- /* ── Camera overlay (driven by selfie-capture.js) ─────────────────── */- #cam-overlay { position: fixed; inset: 0; background: #000; z-index: 1000; display: none; flex-direction: column; }- #cam-overlay.open { display: flex; }- #cam-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }- #cam-stage video, #cam-stage img.preview { width: 100%; height: 100%; object-fit: cover; }- #cam-stage video { transform: scaleX(-1); }- #cam-mesh-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); pointer-events: none; z-index: 1; }- .cam-badges { position: absolute; top: env(safe-area-inset-top, 12px); left: 12px; right: 12px; display: flex; gap: 5px; flex-wrap: wrap; z-index: 3; padding-top: 50px; }- .cam-badge-chip { font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; letter-spacing: 0.03em; text-transform: uppercase; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.5); backdrop-filter: blur(6px); }- .cam-badge-chip.ok { color: var(--scan); border-color: rgba(110, 231, 255, 0.35); background: rgba(110, 231, 255, 0.12); }- .cam-badge-chip.bad { color: #ff6b6b; border-color: rgba(255, 107, 107, 0.3); background: rgba(255, 107, 107, 0.08); }- .cam-prompt { position: absolute; top: env(safe-area-inset-top, 18px); left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.92); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; padding: 16px 18px; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent); pointer-events: none; }- .cam-prompt strong { font-weight: 600; color: var(--scan); }- .cam-oval { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }- .cam-oval svg { width: min(70vw, 60vh); height: auto; max-height: 75vh; }- .cam-oval ellipse { fill: none; stroke: rgba(110, 231, 255, 0.5); stroke-width: 3; stroke-dasharray: 12 8; transition: stroke 200ms; }- .cam-oval.detected ellipse { stroke: var(--scan); stroke-dasharray: 0; filter: drop-shadow(0 0 8px rgba(110, 231, 255, 0.5)); }- .cam-hint { position: absolute; bottom: 100px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.85); font-size: 13px; padding: 8px 18px; pointer-events: none; transition: opacity 200ms; }- .cam-hint.ok { color: var(--scan); }- #cam-error { position: absolute; top: 60px; left: 16px; right: 16px; padding: 10px 14px; background: rgba(239, 77, 77, 0.92); color: white; border-radius: 9px; font-size: 13.5px; text-align: center; }- .cam-bar { padding: 16px 22px calc(env(safe-area-inset-bottom, 18px) + 18px); background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: space-between; gap: 16px; }- .cam-bar button { background: rgba(255, 255, 255, 0.08); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 9px; padding: 10px 16px; font: 600 14px/1 inherit; cursor: pointer; min-width: 88px; }- .cam-bar button.shutter { width: 72px; height: 72px; border-radius: 50%; background: var(--scan); color: var(--accent-ink); border: none; padding: 0; min-width: 72px; }- .cam-bar button.shutter::before { content: ''; display: block; width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--accent-ink); margin: 0 auto; }- .cam-bar button.shutter:disabled { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.6); transition: opacity 200ms, filter 200ms; }- .cam-bar .spacer { flex: 1; }- .cam-countdown { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; z-index: 4; }- .cam-countdown.show { display: flex; }- .cam-countdown .count-num { font: 700 96px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--scan); text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 24px rgba(110, 231, 255, 0.5); animation: cd-pop 1s ease-out forwards; }- @keyframes cd-pop { 0% { transform: scale(0.5); opacity: 0; } 20% { transform: scale(1.15); opacity: 1; } 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.8); opacity: 0; } }-- .photo-tips { margin: 16px 0 0; padding: 12px 16px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; font-size: 13px; color: var(--muted); }- .photo-tips .tips-title { margin: 0 0 6px; font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text); opacity: 0.7; }- .photo-tips ul { margin: 0; padding-left: 18px; list-style: disc; }- .photo-tips li { margin-bottom: 2px; line-height: 1.45; }- .photo-tips li:last-child { margin-bottom: 0; }- </style>- <link rel="stylesheet" href="/mobile.css" />- <script- type="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"- ></script>-</head>-<body>- <main class="stage">- <div class="topbar">- <button class="back" id="back-btn" aria-label="Back" type="button">- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">- <line x1="19" y1="12" x2="5" y2="12" />- <polyline points="12 19 5 12 12 5" />- </svg>- </button>- <div class="label"><strong>three.ws</strong> · 3D Scanner</div>- <span class="badge">Beta</span>- </div>+ <meta+ name="description"+ content="Point your camera, hold still, and walk away with a rigged 3D model of yourself — in about a minute. Free, in your browser."+ />+ <meta name="robots" content="index, follow" />++ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/scan" />+ <meta property="og:title" content="3D Scanner · Scan yourself into 3D" />+ <meta+ property="og:description"+ content="Point your camera, hold still, walk away with a rigged 3D model of yourself. Free, in your browser."+ />+ <meta property="og:image" content="https://three.ws/og-image.png" />+ <meta name="twitter:card" content="summary_large_image" />++ <style>+ :root {+ color-scheme: dark;+ --bg: #000000;+ --panel: #0a0a0a;+ --panel-elev: #111111;+ --border: #1a1a1a;+ --border-strong: #2a2a2a;+ --text: #e8e8e8;+ --muted: #888888;+ --accent: #ffffff;+ --accent-ink: #000000;+ --scan: #6ee7ff;+ --scan-dim: rgba(110, 231, 255, 0.12);+ --danger: #f87171;+ --danger-dim: #4a1a1a;+ }+ * {+ box-sizing: border-box;+ }+ html,+ body {+ margin: 0;+ padding: 0;+ }+ body {+ font:+ 15px/1.55 -apple-system,+ BlinkMacSystemFont,+ 'Segoe UI',+ Roboto,+ sans-serif;+ color: var(--text);+ background: var(--bg);+ min-height: 100vh;+ overflow-x: hidden;+ }+ body::before {+ content: '';+ position: fixed;+ inset: 0;+ z-index: -1;+ pointer-events: none;+ background:+ radial-gradient(+ 800px 500px at 50% -80px,+ rgba(110, 231, 255, 0.06) 0,+ transparent 70%+ ),+ radial-gradient(+ 600px 400px at 50% 110%,+ rgba(110, 231, 255, 0.05) 0,+ transparent 70%+ ),+ #000000;+ }+ main.stage {+ max-width: 720px;+ margin: 0 auto;+ padding: 28px 20px 96px;+ }+ .topbar {+ display: flex;+ align-items: center;+ gap: 14px;+ margin-bottom: 24px;+ }+ .topbar button.back {+ background: var(--panel);+ border: 1px solid var(--border);+ color: var(--text);+ width: 36px;+ height: 36px;+ border-radius: 9px;+ font: inherit;+ cursor: pointer;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ }+ .topbar button.back:hover {+ border-color: var(--border-strong);+ }+ .topbar .label {+ font-size: 12px;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: var(--muted);+ }+ .topbar .label strong {+ color: var(--text);+ font-weight: 600;+ }+ .topbar .badge {+ margin-left: auto;+ font-size: 10.5px;+ font-weight: 700;+ letter-spacing: 0.08em;+ text-transform: uppercase;+ color: var(--scan);+ border: 1px solid var(--scan-dim);+ background: var(--scan-dim);+ border-radius: 999px;+ padding: 4px 10px;+ }+ h1 {+ font-size: 30px;+ line-height: 1.2;+ margin: 0 0 8px;+ letter-spacing: -0.02em;+ }+ h1 .hl {+ color: var(--scan);+ }+ .sub {+ color: var(--muted);+ margin: 0 0 24px;+ line-height: 1.55;+ }++ .step {+ display: none;+ opacity: 0;+ }+ .step.active {+ display: block;+ animation: step-in 400ms ease forwards;+ }+ @keyframes step-in {+ from {+ opacity: 0;+ transform: translateY(12px);+ }+ to {+ opacity: 1;+ transform: translateY(0);+ }+ }++ .unsupported {+ display: none;+ padding: 12px 14px;+ background: rgba(239, 77, 77, 0.08);+ border: 1px solid var(--danger-dim);+ border-radius: 9px;+ color: #f4b5b5;+ font-size: 13.5px;+ margin: 0 0 20px;+ }+ .unsupported.show {+ display: block;+ }++ /* ── Scanner hero ─────────────────────────────────────────────────── */+ .hero-slot-wrap {+ margin: 8px 0 18px;+ }+ .hero-slot {+ aspect-ratio: 3 / 4;+ max-width: 380px;+ margin: 0 auto;+ background:+ linear-gradient(rgba(110, 231, 255, 0.04), rgba(110, 231, 255, 0.04)),+ var(--panel);+ border: 1.5px dashed var(--border-strong);+ border-radius: 18px;+ position: relative;+ overflow: hidden;+ cursor: pointer;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 10px;+ color: var(--muted);+ transition:+ border-color 120ms,+ background 120ms;+ }+ .hero-slot::before {+ content: '';+ position: absolute;+ inset: 0;+ pointer-events: none;+ opacity: 0.5;+ background-image:+ linear-gradient(var(--scan-dim) 1px, transparent 1px),+ linear-gradient(90deg, var(--scan-dim) 1px, transparent 1px);+ background-size: 28px 28px;+ mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 72%);+ -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 0, transparent 72%);+ }+ .hero-slot:hover,+ .hero-slot:focus-visible {+ border-color: var(--scan);+ color: var(--text);+ outline: none;+ }+ .hero-slot.drag {+ border-color: var(--scan);+ background: rgba(110, 231, 255, 0.06);+ cursor: copy;+ }+ .hero-slot.filled {+ border-style: solid;+ border-color: var(--border);+ padding: 0;+ cursor: default;+ }+ .hero-slot.error {+ border-color: var(--danger);+ }+ .hero-slot .hero-icon {+ width: 56px;+ height: 56px;+ border-radius: 50%;+ display: grid;+ place-items: center;+ border: 1.5px solid var(--scan);+ color: var(--scan);+ position: relative;+ z-index: 1;+ box-shadow: 0 0 0 6px var(--scan-dim);+ }+ .hero-slot .hero-title {+ font-size: 16px;+ color: var(--text);+ font-weight: 600;+ position: relative;+ z-index: 1;+ }+ .hero-slot .hero-sub {+ font-size: 13px;+ color: var(--muted);+ max-width: 260px;+ text-align: center;+ line-height: 1.45;+ position: relative;+ z-index: 1;+ }+ .hero-slot img.preview {+ width: 100%;+ height: 100%;+ object-fit: cover;+ display: block;+ }+ .hero-slot .retake-btn {+ position: absolute;+ top: 12px;+ right: 12px;+ background: rgba(0, 0, 0, 0.65);+ backdrop-filter: blur(8px);+ -webkit-backdrop-filter: blur(8px);+ border: 1px solid rgba(255, 255, 255, 0.15);+ color: var(--text);+ border-radius: 9px;+ padding: 8px 12px;+ font: 600 12px/1 inherit;+ cursor: pointer;+ display: inline-flex;+ align-items: center;+ gap: 6px;+ transition: background 120ms;+ z-index: 2;+ }+ .hero-slot .retake-btn:hover {+ background: rgba(0, 0, 0, 0.85);+ }+ .hero-actions {+ display: flex;+ justify-content: center;+ gap: 10px;+ margin-top: 14px;+ flex-wrap: wrap;+ }+ .hero-pill {+ background: var(--panel);+ border: 1px solid var(--border);+ color: var(--muted);+ border-radius: 999px;+ padding: 8px 16px;+ font: 500 12.5px/1 inherit;+ cursor: pointer;+ transition:+ color 120ms,+ border-color 120ms;+ display: inline-flex;+ align-items: center;+ gap: 7px;+ }+ .hero-pill:hover {+ color: var(--text);+ border-color: var(--border-strong);+ }+ .hero-pill[data-action='open-camera'] {+ border-color: var(--scan-dim);+ color: var(--scan);+ }+ .hero-pill[data-action='open-camera']:hover {+ border-color: var(--scan);+ }+ .hero-pill[hidden] {+ display: none;+ }+ .hero-pill svg {+ display: block;+ }- <p id="unsupported-msg" class="unsupported">- Your browser can't open the camera here — use Upload instead, or open this page in Safari / Chrome on a device with a camera.- </p>+ .fidelity {+ margin: 0 0 22px;+ border: 1px solid var(--border);+ background: var(--panel);+ border-radius: 12px;+ overflow: hidden;+ }+ .fidelity summary {+ list-style: none;+ padding: 14px 16px;+ cursor: pointer;+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ color: var(--text);+ }+ .fidelity summary::-webkit-details-marker {+ display: none;+ }+ .fidelity .fid-label {+ font-size: 14px;+ font-weight: 600;+ }+ .fidelity .fid-note {+ color: var(--muted);+ font-size: 12.5px;+ font-weight: 400;+ }+ .fidelity .fid-chev {+ color: var(--muted);+ transition: transform 200ms;+ }+ .fidelity[open] .fid-chev {+ transform: rotate(180deg);+ }+ .fidelity .fid-body {+ padding: 4px 16px 18px;+ }+ .slots {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 12px;+ }+ .slot-frame {+ aspect-ratio: 3 / 4;+ background: var(--panel-elev);+ border: 1.5px dashed var(--border-strong);+ border-radius: 11px;+ position: relative;+ overflow: hidden;+ cursor: pointer;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 6px;+ color: var(--muted);+ transition:+ border-color 120ms,+ background 120ms;+ }+ .slot-frame:hover,+ .slot-frame:focus-visible {+ border-color: var(--scan);+ color: var(--text);+ outline: none;+ }+ .slot-frame.drag {+ border-color: var(--scan);+ background: rgba(110, 231, 255, 0.06);+ cursor: copy;+ }+ .slot-frame.filled {+ border-style: solid;+ border-color: var(--border);+ padding: 0;+ }+ .slot-frame.error {+ border-color: var(--danger);+ }+ .slot-frame .slot-label {+ font-size: 11.5px;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: var(--muted);+ }+ .slot-frame .slot-hint {+ font-size: 13px;+ color: var(--text);+ font-weight: 500;+ }+ .slot-frame img {+ width: 100%;+ height: 100%;+ object-fit: cover;+ display: block;+ }+ .slot-frame .retake-btn {+ position: absolute;+ top: 8px;+ right: 8px;+ background: rgba(0, 0, 0, 0.7);+ border: 1px solid rgba(255, 255, 255, 0.2);+ color: var(--text);+ border-radius: 7px;+ padding: 4px 9px;+ font: 600 11px/1 inherit;+ cursor: pointer;+ }++ .opts {+ margin: 0 0 22px;+ display: flex;+ flex-direction: column;+ gap: 18px;+ }+ .opt-group .opt-label {+ font-size: 12px;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ color: var(--muted);+ margin: 0 0 10px;+ }+ .toggle {+ display: inline-flex;+ background: var(--panel);+ border: 1px solid var(--border);+ border-radius: 9px;+ padding: 3px;+ gap: 2px;+ }+ .toggle button {+ background: transparent;+ border: none;+ color: var(--muted);+ font: 600 13px/1 inherit;+ padding: 8px 14px;+ border-radius: 7px;+ cursor: pointer;+ }+ .toggle button[aria-pressed='true'] {+ background: var(--panel-elev);+ color: var(--text);+ }+ .toggle button:hover {+ color: var(--text);+ }+ .style-grid {+ display: grid;+ grid-template-columns: 1fr 1fr;+ gap: 10px;+ }+ .style-card {+ background: var(--panel);+ border: 1.5px solid var(--border);+ border-radius: 11px;+ padding: 12px;+ cursor: pointer;+ text-align: left;+ color: var(--text);+ font: inherit;+ display: flex;+ gap: 12px;+ align-items: center;+ transition:+ border-color 120ms,+ transform 120ms;+ }+ .style-card:hover {+ border-color: var(--border-strong);+ transform: translateY(-1px);+ }+ .style-card[aria-pressed='true'] {+ border-color: var(--scan);+ background: rgba(110, 231, 255, 0.05);+ }+ .style-swatch {+ width: 44px;+ height: 44px;+ border-radius: 8px;+ flex-shrink: 0;+ background-size: cover;+ background-position: center;+ border: 1px solid var(--border);+ }+ .style-swatch.photoreal {+ background: radial-gradient(+ circle at 35% 30%,+ #f6c79b 0%,+ #c98c61 45%,+ #4a2e1d 95%+ );+ }+ .style-swatch.stylized {+ background: radial-gradient(+ circle at 35% 30%,+ #ffd5e8 0%,+ #c4a3ff 45%,+ #5a3aa3 95%+ );+ }+ .style-card .style-title {+ font-size: 14px;+ font-weight: 600;+ line-height: 1.2;+ margin: 0 0 2px;+ }+ .style-card .style-desc {+ font-size: 12px;+ color: var(--muted);+ line-height: 1.35;+ }++ .steps-strip {+ display: flex;+ gap: 8px;+ margin: 0 0 22px;+ flex-wrap: wrap;+ }+ .steps-strip .chip {+ font-size: 12px;+ color: var(--muted);+ border: 1px solid var(--border);+ border-radius: 999px;+ padding: 6px 12px;+ display: inline-flex;+ align-items: center;+ gap: 7px;+ background: var(--panel);+ }+ .steps-strip .chip b {+ color: var(--scan);+ font-weight: 700;+ }++ /* ── Building ─────────────────────────────────────────────────────── */+ .build-progress {+ display: flex;+ flex-direction: column;+ gap: 0;+ margin: 0 0 28px;+ }+ .build-step {+ display: flex;+ align-items: flex-start;+ gap: 12px;+ padding: 10px 0;+ position: relative;+ transition: opacity 200ms;+ }+ .build-step:not(:last-child)::after {+ content: '';+ position: absolute;+ left: 9px;+ top: 30px;+ bottom: -10px;+ width: 2px;+ background: var(--border);+ }+ .build-step.completed::after {+ background: rgba(110, 231, 255, 0.4);+ }+ .bstep-dot {+ width: 20px;+ height: 20px;+ border-radius: 50%;+ border: 2px solid var(--border-strong);+ background: var(--panel);+ flex-shrink: 0;+ margin-top: 1px;+ position: relative;+ z-index: 1;+ }+ .build-step.completed .bstep-dot {+ background: var(--scan);+ border-color: var(--scan);+ }+ .build-step.completed .bstep-dot::after {+ content: '';+ display: block;+ width: 5px;+ height: 9px;+ border: 2px solid var(--accent-ink);+ border-top: none;+ border-left: none;+ transform: rotate(45deg) translate(-1px, -1px);+ position: absolute;+ top: 2px;+ left: 5px;+ }+ .build-step.active .bstep-dot {+ border-color: var(--scan);+ animation: bstep-pulse 1.4s ease-in-out infinite;+ }+ @keyframes bstep-pulse {+ 0%,+ 100% {+ box-shadow: 0 0 0 0 rgba(110, 231, 255, 0.4);+ }+ 50% {+ box-shadow: 0 0 0 6px rgba(110, 231, 255, 0);+ }+ }+ .bstep-label {+ font-size: 14px;+ color: var(--muted);+ line-height: 1.4;+ padding-top: 1px;+ }+ .build-step.active .bstep-label {+ color: var(--text);+ font-weight: 500;+ }+ .build-step.completed {+ opacity: 0.65;+ }+ .build-step.failed .bstep-dot {+ background: var(--danger);+ border-color: var(--danger);+ animation: none;+ }+ .build-step.failed .bstep-dot::after {+ content: '×';+ display: block;+ color: #fff;+ font: 700 14px/1 sans-serif;+ text-align: center;+ position: absolute;+ top: -1px;+ left: 2px;+ }+ .build-step.failed .bstep-label {+ color: var(--danger);+ font-weight: 500;+ }+ .build-step.failed::after {+ background: var(--danger-dim);+ }++ .build-viewer {+ position: relative;+ width: 100%;+ max-width: 320px;+ margin: 0 auto 24px;+ aspect-ratio: 3 / 4;+ border-radius: 16px;+ overflow: hidden;+ background: var(--panel);+ border: 1px solid var(--border);+ }+ .build-viewer model-viewer {+ width: 100%;+ height: 100%;+ --poster-color: transparent;+ }+ .build-preview {+ position: absolute;+ top: 18px;+ left: 50%;+ transform: translateX(-50%);+ width: 110px;+ height: 110px;+ border-radius: 50%;+ object-fit: cover;+ border: 2px solid var(--scan);+ box-shadow:+ 0 8px 24px -4px rgba(0, 0, 0, 0.6),+ 0 0 0 4px rgba(110, 231, 255, 0.18);+ background: var(--panel);+ opacity: 0;+ transition: opacity 320ms ease;+ animation: preview-breathe 2.4s ease-in-out infinite;+ }+ .build-preview.show {+ opacity: 1;+ }+ @keyframes preview-breathe {+ 0%,+ 100% {+ box-shadow:+ 0 8px 24px -4px rgba(0, 0, 0, 0.6),+ 0 0 0 4px rgba(110, 231, 255, 0.18);+ }+ 50% {+ box-shadow:+ 0 8px 24px -4px rgba(0, 0, 0, 0.6),+ 0 0 0 9px rgba(110, 231, 255, 0.08);+ }+ }+ .build-veil {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: flex-end;+ justify-content: center;+ padding-bottom: 18px;+ background: linear-gradient(+ to bottom,+ rgba(5, 6, 10, 0.05),+ rgba(5, 6, 10, 0.45) 65%+ );+ pointer-events: none;+ }+ .build-ring {+ width: 36px;+ height: 36px;+ border-radius: 50%;+ border: 2.5px solid rgba(110, 231, 255, 0.15);+ border-top-color: var(--scan);+ animation: build-spin 1s linear infinite;+ }+ @keyframes build-spin {+ to {+ transform: rotate(360deg);+ }+ }+ .build-error {+ display: none;+ padding: 12px 14px;+ background: rgba(239, 77, 77, 0.08);+ border: 1px solid var(--danger-dim);+ border-radius: 9px;+ color: #f4b5b5;+ font-size: 13.5px;+ margin: 0 0 16px;+ }+ .build-error.show {+ display: block;+ }+ .build-retry {+ width: 100%;+ max-width: 320px;+ margin: 0 auto;+ display: none;+ padding: 12px 18px;+ background: var(--panel);+ border: 1px solid var(--border);+ border-radius: 10px;+ color: var(--text);+ font: 600 14px/1 inherit;+ cursor: pointer;+ text-align: center;+ }+ .build-retry.show {+ display: block;+ }+ .build-retry:hover {+ border-color: var(--border-strong);+ }++ /* ── Done ─────────────────────────────────────────────────────────── */+ [data-step='done'] h1 {+ text-align: center;+ }+ [data-step='done'] .sub {+ text-align: center;+ }+ .done-viewer {+ position: relative;+ width: 100%;+ max-width: 340px;+ margin: 0 auto 22px;+ aspect-ratio: 3 / 4;+ border-radius: 16px;+ overflow: hidden;+ background: var(--panel);+ border: 1px solid var(--border);+ }+ .done-viewer::after {+ content: '';+ position: absolute;+ inset: -2px;+ border-radius: 18px;+ background: conic-gradient(+ from 0deg,+ var(--scan),+ rgba(136, 136, 136, 0.3),+ var(--scan),+ rgba(136, 136, 136, 0.3)+ );+ z-index: -1;+ animation: done-glow 6s linear infinite;+ opacity: 0.45;+ }+ @keyframes done-glow {+ to {+ transform: rotate(360deg);+ }+ }+ .done-viewer model-viewer {+ width: 100%;+ height: 100%;+ --poster-color: transparent;+ }+ .viewer-error {+ position: absolute;+ inset: 0;+ display: none;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 8px;+ padding: 22px;+ text-align: center;+ font-size: 13px;+ line-height: 1.5;+ color: var(--muted);+ background: var(--panel);+ }+ .viewer-error.show {+ display: flex;+ }+ .name-row {+ margin: 0 0 18px;+ }+ .name-input {+ width: 100%;+ padding: 12px 14px;+ background: var(--panel);+ border: 1px solid var(--border-strong);+ border-radius: 10px;+ color: var(--text);+ font: 15px/1 inherit;+ outline: none;+ transition: border-color 120ms;+ }+ .name-input:focus {+ border-color: var(--scan);+ }+ .name-input::placeholder {+ color: var(--muted);+ }++ .export-row {+ display: grid;+ grid-template-columns: repeat(3, 1fr);+ gap: 10px;+ margin: 0 0 14px;+ }+ .export-btn {+ padding: 12px 8px;+ background: var(--panel);+ border: 1px solid var(--border);+ border-radius: 10px;+ color: var(--text);+ font: 600 13px/1.2 inherit;+ cursor: pointer;+ transition:+ border-color 120ms,+ color 120ms;+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: 6px;+ }+ .export-btn:hover:not(:disabled) {+ border-color: var(--scan);+ }+ .export-btn:disabled {+ opacity: 0.5;+ cursor: progress;+ }+ .export-btn svg {+ display: block;+ color: var(--scan);+ }+ .export-btn .ext {+ font-size: 11px;+ color: var(--muted);+ font-weight: 500;+ letter-spacing: 0.04em;+ }++ .done-actions {+ display: flex;+ flex-direction: column;+ gap: 10px;+ }+ .btn-save {+ width: 100%;+ padding: 14px 18px;+ background: var(--scan);+ color: var(--accent-ink);+ border: none;+ border-radius: 10px;+ font: 700 15px/1 inherit;+ cursor: pointer;+ transition: filter 120ms;+ }+ .btn-save:hover {+ filter: brightness(1.06);+ }+ .btn-save:disabled {+ opacity: 0.55;+ cursor: not-allowed;+ filter: none;+ }+ .btn-share {+ width: 100%;+ padding: 13px 18px;+ background: transparent;+ color: var(--text);+ border: 1px solid var(--scan);+ border-radius: 10px;+ font: 600 14px/1 inherit;+ cursor: pointer;+ transition: background 120ms;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 8px;+ }+ .btn-share:hover {+ background: var(--scan-dim);+ }+ .btn-share svg {+ color: var(--scan);+ }+ .btn-ghost {+ width: 100%;+ padding: 12px 18px;+ background: var(--panel);+ color: var(--muted);+ border: 1px solid var(--border);+ border-radius: 10px;+ font: 500 14px/1 inherit;+ cursor: pointer;+ transition:+ color 120ms,+ border-color 120ms;+ }+ .btn-ghost:hover {+ color: var(--text);+ border-color: var(--border-strong);+ }+ .share-toast {+ text-align: center;+ font-size: 12.5px;+ color: var(--scan);+ min-height: 18px;+ margin: 6px 0 0;+ opacity: 0;+ transition: opacity 200ms;+ }+ .share-toast.show {+ opacity: 1;+ }+ .portability-note {+ margin-top: 22px;+ padding: 14px 16px;+ background: rgba(110, 231, 255, 0.04);+ border: 1px solid rgba(110, 231, 255, 0.14);+ border-radius: 10px;+ font-size: 13px;+ color: var(--muted);+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ flex-wrap: wrap;+ }+ .portability-note a {+ color: var(--scan);+ text-decoration: none;+ white-space: nowrap;+ font-weight: 500;+ }+ .portability-note a:hover {+ text-decoration: underline;+ }++ .submit-bar {+ margin-top: 6px;+ position: sticky;+ bottom: 16px;+ z-index: 2;+ }+ .submit-bar[hidden] {+ display: none;+ }+ #submit-btn {+ width: 100%;+ padding: 16px 18px;+ background: var(--panel);+ color: var(--muted);+ border: 1px solid var(--border);+ border-radius: 12px;+ font: 700 15px/1.2 inherit;+ cursor: not-allowed;+ transition:+ background 120ms,+ color 120ms,+ border-color 120ms;+ display: flex;+ align-items: center;+ justify-content: center;+ gap: 10px;+ }+ #submit-btn .meta {+ font: 500 12px/1 inherit;+ color: var(--muted);+ opacity: 0.85;+ }+ #submit-btn.ready {+ background: var(--scan);+ color: var(--accent-ink);+ border-color: var(--scan);+ cursor: pointer;+ box-shadow: 0 10px 30px -10px rgba(110, 231, 255, 0.4);+ animation: btn-ready 300ms ease;+ }+ @keyframes btn-ready {+ from {+ transform: scale(0.97);+ opacity: 0.8;+ }+ to {+ transform: scale(1);+ opacity: 1;+ }+ }+ #submit-btn.ready .meta {+ color: rgba(10, 10, 10, 0.7);+ }+ #submit-btn.ready:hover {+ filter: brightness(0.94);+ }- <!-- Step 1: capture -->- <section class="step active" data-step="capture">- <h1>Scan yourself into <span class="hl">3D</span>.</h1>- <p class="sub">Point your camera and hold still. In about a minute you get a rigged 3D model of yourself that drops into any app, game, or stream. Photos are downscaled in your browser — nothing is stored on disk.</p>+ /* ── Camera overlay (driven by selfie-capture.js) ─────────────────── */+ #cam-overlay {+ position: fixed;+ inset: 0;+ background: #000;+ z-index: 1000;+ display: none;+ flex-direction: column;+ }+ #cam-overlay.open {+ display: flex;+ }+ #cam-stage {+ position: relative;+ flex: 1;+ min-height: 0;+ overflow: hidden;+ }+ #cam-stage video,+ #cam-stage img.preview {+ width: 100%;+ height: 100%;+ object-fit: cover;+ }+ #cam-stage video {+ transform: scaleX(-1);+ }+ #cam-mesh-overlay {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ object-fit: cover;+ transform: scaleX(-1);+ pointer-events: none;+ z-index: 1;+ }+ .cam-badges {+ position: absolute;+ top: env(safe-area-inset-top, 12px);+ left: 12px;+ right: 12px;+ display: flex;+ gap: 5px;+ flex-wrap: wrap;+ z-index: 3;+ padding-top: 50px;+ }+ .cam-badge-chip {+ font-size: 10.5px;+ font-weight: 600;+ padding: 3px 8px;+ border-radius: 6px;+ letter-spacing: 0.03em;+ text-transform: uppercase;+ background: rgba(0, 0, 0, 0.55);+ border: 1px solid rgba(255, 255, 255, 0.1);+ color: rgba(255, 255, 255, 0.5);+ backdrop-filter: blur(6px);+ }+ .cam-badge-chip.ok {+ color: var(--scan);+ border-color: rgba(110, 231, 255, 0.35);+ background: rgba(110, 231, 255, 0.12);+ }+ .cam-badge-chip.bad {+ color: #ff6b6b;+ border-color: rgba(255, 107, 107, 0.3);+ background: rgba(255, 107, 107, 0.08);+ }+ .cam-prompt {+ position: absolute;+ top: env(safe-area-inset-top, 18px);+ left: 0;+ right: 0;+ text-align: center;+ color: rgba(255, 255, 255, 0.92);+ font-size: 13px;+ letter-spacing: 0.06em;+ text-transform: uppercase;+ padding: 16px 18px;+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);+ pointer-events: none;+ }+ .cam-prompt strong {+ font-weight: 600;+ color: var(--scan);+ }+ .cam-oval {+ position: absolute;+ inset: 0;+ pointer-events: none;+ display: flex;+ align-items: center;+ justify-content: center;+ }+ .cam-oval svg {+ width: min(70vw, 60vh);+ height: auto;+ max-height: 75vh;+ }+ .cam-oval ellipse {+ fill: none;+ stroke: rgba(110, 231, 255, 0.5);+ stroke-width: 3;+ stroke-dasharray: 12 8;+ transition: stroke 200ms;+ }+ .cam-oval.detected ellipse {+ stroke: var(--scan);+ stroke-dasharray: 0;+ filter: drop-shadow(0 0 8px rgba(110, 231, 255, 0.5));+ }+ .cam-hint {+ position: absolute;+ bottom: 100px;+ left: 0;+ right: 0;+ text-align: center;+ color: rgba(255, 255, 255, 0.85);+ font-size: 13px;+ padding: 8px 18px;+ pointer-events: none;+ transition: opacity 200ms;+ }+ .cam-hint.ok {+ color: var(--scan);+ }+ #cam-error {+ position: absolute;+ top: 60px;+ left: 16px;+ right: 16px;+ padding: 10px 14px;+ background: rgba(239, 77, 77, 0.92);+ color: white;+ border-radius: 9px;+ font-size: 13.5px;+ text-align: center;+ }+ .cam-bar {+ padding: 16px 22px calc(env(safe-area-inset-bottom, 18px) + 18px);+ background: rgba(0, 0, 0, 0.7);+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 16px;+ }+ .cam-bar button {+ background: rgba(255, 255, 255, 0.08);+ color: var(--text);+ border: 1px solid rgba(255, 255, 255, 0.18);+ border-radius: 9px;+ padding: 10px 16px;+ font: 600 14px/1 inherit;+ cursor: pointer;+ min-width: 88px;+ }+ .cam-bar button.shutter {+ width: 72px;+ height: 72px;+ border-radius: 50%;+ background: var(--scan);+ color: var(--accent-ink);+ border: none;+ padding: 0;+ min-width: 72px;+ }+ .cam-bar button.shutter::before {+ content: '';+ display: block;+ width: 56px;+ height: 56px;+ border-radius: 50%;+ border: 3px solid var(--accent-ink);+ margin: 0 auto;+ }+ .cam-bar button.shutter:disabled {+ opacity: 0.35;+ cursor: not-allowed;+ filter: grayscale(0.6);+ transition:+ opacity 200ms,+ filter 200ms;+ }+ .cam-bar .spacer {+ flex: 1;+ }+ .cam-countdown {+ position: absolute;+ inset: 0;+ display: none;+ align-items: center;+ justify-content: center;+ pointer-events: none;+ z-index: 4;+ }+ .cam-countdown.show {+ display: flex;+ }+ .cam-countdown .count-num {+ font:+ 700 96px/1 -apple-system,+ BlinkMacSystemFont,+ 'Segoe UI',+ sans-serif;+ color: var(--scan);+ text-shadow:+ 0 4px 18px rgba(0, 0, 0, 0.6),+ 0 0 24px rgba(110, 231, 255, 0.5);+ animation: cd-pop 1s ease-out forwards;+ }+ @keyframes cd-pop {+ 0% {+ transform: scale(0.5);+ opacity: 0;+ }+ 20% {+ transform: scale(1.15);+ opacity: 1;+ }+ 80% {+ transform: scale(1);+ opacity: 1;+ }+ 100% {+ transform: scale(0.8);+ opacity: 0;+ }+ }- <div class="steps-strip" aria-hidden="true">- <span class="chip"><b>1</b> Scan</span>- <span class="chip"><b>2</b> Build</span>- <span class="chip"><b>3</b> Download & share</span>+ .photo-tips {+ margin: 16px 0 0;+ padding: 12px 16px;+ background: rgba(255, 255, 255, 0.03);+ border: 1px solid rgba(255, 255, 255, 0.08);+ border-radius: 10px;+ font-size: 13px;+ color: var(--muted);+ }+ .photo-tips .tips-title {+ margin: 0 0 6px;+ font-weight: 600;+ font-size: 12px;+ letter-spacing: 0.04em;+ text-transform: uppercase;+ color: var(--text);+ opacity: 0.7;+ }+ .photo-tips ul {+ margin: 0;+ padding-left: 18px;+ list-style: disc;+ }+ .photo-tips li {+ margin-bottom: 2px;+ line-height: 1.45;+ }+ .photo-tips li:last-child {+ margin-bottom: 0;+ }+ </style>+ <link rel="stylesheet" href="/mobile.css" />+ <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>+ </head>+ <body>+ <main class="stage">+ <div class="topbar">+ <button class="back" id="back-btn" aria-label="Back" type="button">+ <svg+ width="16"+ height="16"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <line x1="19" y1="12" x2="5" y2="12" />+ <polyline points="12 19 5 12 12 5" />+ </svg>+ </button>+ <div class="label"><strong>three.ws</strong> · 3D Scanner</div>+ <span class="badge">Beta</span></div>- <div class="hero-slot-wrap">- <div class="hero-slot" data-slot="frontal" role="button" tabindex="0" aria-label="Start the scan with your camera or a photo">- <span class="hero-icon" aria-hidden="true">- <svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>- </span>- <span class="hero-title">Tap to start scanning</span>- <span class="hero-sub">Live face tracking guides the shot. Or drop in a photo — works on phone or desktop.</span>+ <p id="unsupported-msg" class="unsupported">+ Your browser can't open the camera here — use Upload instead, or open this page in+ Safari / Chrome on a device with a camera.+ </p>++ <!-- Step 1: capture -->+ <section class="step active" data-step="capture">+ <h1>Scan yourself into <span class="hl">3D</span>.</h1>+ <p class="sub">+ Point your camera and hold still. In about a minute you get a rigged 3D model of+ yourself that drops into any app, game, or stream. Photos are downscaled in your+ browser — nothing is stored on disk.+ </p>++ <div class="steps-strip" aria-hidden="true">+ <span class="chip"><b>1</b> Scan</span>+ <span class="chip"><b>2</b> Build</span>+ <span class="chip"><b>3</b> Download & share</span></div>- <div class="hero-actions">- <button type="button" class="hero-pill" data-action="open-camera" id="hero-camera-btn">- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg>- Scan with camera- </button>- <button type="button" class="hero-pill" data-action="open-upload">- <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>- Upload photo- </button>++ <div class="hero-slot-wrap">+ <div+ class="hero-slot"+ data-slot="frontal"+ role="button"+ tabindex="0"+ aria-label="Start the scan with your camera or a photo"+ >+ <span class="hero-icon" aria-hidden="true">+ <svg+ width="26"+ height="26"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path+ d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"+ />+ <circle cx="12" cy="13" r="4" />+ </svg>+ </span>+ <span class="hero-title">Tap to start scanning</span>+ <span class="hero-sub"+ >Live face tracking guides the shot. Or drop in a photo — works on phone+ or desktop.</span+ >+ </div>+ <div class="hero-actions">+ <button+ type="button"+ class="hero-pill"+ data-action="open-camera"+ id="hero-camera-btn"+ >+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <path+ d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"+ />+ <circle cx="12" cy="13" r="4" />+ </svg>+ Scan with camera+ </button>+ <button type="button" class="hero-pill" data-action="open-upload">+ <svg+ width="14"+ height="14"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />+ <polyline points="17 8 12 3 7 8" />+ <line x1="12" y1="3" x2="12" y2="15" />+ </svg>+ Upload photo+ </button>+ </div></div>- </div>- <input type="file" data-slot-input="frontal" accept="image/jpeg,image/png,image/webp,image/heic,image/heif" hidden />+ <input+ type="file"+ data-slot-input="frontal"+ accept="image/jpeg,image/png,image/webp,image/heic,image/heif"+ hidden+ />- <div class="photo-tips" id="photo-tips">- <p class="tips-title">For the sharpest scan</p>- <ul>- <li>Face the camera directly — no extreme angles</li>- <li>Good, even lighting — avoid harsh shadows or backlighting</li>- <li>Remove sunglasses, masks, or anything covering your face</li>- <li>Keep hair away from your forehead and jawline if possible</li>- </ul>- </div>+ <div class="photo-tips" id="photo-tips">+ <p class="tips-title">For the sharpest scan</p>+ <ul>+ <li>Face the camera directly — no extreme angles</li>+ <li>Good, even lighting — avoid harsh shadows or backlighting</li>+ <li>Remove sunglasses, masks, or anything covering your face</li>+ <li>Keep hair away from your forehead and jawline if possible</li>+ </ul>+ </div>- <details class="fidelity" id="fidelity-boost">- <summary>- <div>- <div class="fid-label">Add side angles <span class="fid-note">(optional — adds ~30s, sharper geometry)</span></div>+ <details class="fidelity" id="fidelity-boost">+ <summary>+ <div>+ <div class="fid-label">+ Add side angles+ <span class="fid-note"+ >(optional — adds ~30s, sharper geometry)</span+ >+ </div>+ </div>+ <svg+ class="fid-chev"+ width="16"+ height="16"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2.4"+ stroke-linecap="round"+ stroke-linejoin="round"+ aria-hidden="true"+ >+ <polyline points="6 9 12 15 18 9" />+ </svg>+ </summary>+ <div class="fid-body">+ <div class="slots">+ <div+ class="slot-frame"+ data-slot="left"+ role="button"+ tabindex="0"+ aria-label="Left side photo slot"+ >+ <span class="slot-label">Left</span>+ <span class="slot-hint">Turn ~45° left</span>+ </div>+ <div+ class="slot-frame"+ data-slot="right"+ role="button"+ tabindex="0"+ aria-label="Right side photo slot"+ >+ <span class="slot-label">Right</span>+ <span class="slot-hint">Turn ~45° right</span>+ </div>+ </div>+ <input+ type="file"+ data-slot-input="left"+ accept="image/jpeg,image/png,image/webp,image/heic,image/heif"+ hidden+ />+ <input+ type="file"+ data-slot-input="right"+ accept="image/jpeg,image/png,image/webp,image/heic,image/heif"+ hidden+ /></div>- <svg class="fid-chev" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>- </summary>- <div class="fid-body">- <div class="slots">- <div class="slot-frame" data-slot="left" role="button" tabindex="0" aria-label="Left side photo slot">- <span class="slot-label">Left</span>- <span class="slot-hint">Turn ~45° left</span>+ </details>++ <div class="opts">+ <div class="opt-group">+ <p class="opt-label">Look</p>+ <div class="style-grid" role="group" aria-label="Avatar style">+ <button+ type="button"+ class="style-card"+ data-type="v1"+ aria-pressed="true"+ >+ <span class="style-swatch photoreal" aria-hidden="true"></span>+ <span>+ <span class="style-title">Photoreal</span>+ <span class="style-desc"+ >Likeness-first. Closest to how you actually look.</span+ >+ </span>+ </button>+ <button+ type="button"+ class="style-card"+ data-type="v2"+ aria-pressed="false"+ >+ <span class="style-swatch stylized" aria-hidden="true"></span>+ <span>+ <span class="style-title">Stylized</span>+ <span class="style-desc"+ >Cleaner, cartoon-leaning. Good for streaming + games.</span+ >+ </span>+ </button></div>- <div class="slot-frame" data-slot="right" role="button" tabindex="0" aria-label="Right side photo slot">- <span class="slot-label">Right</span>- <span class="slot-hint">Turn ~45° right</span>+ </div>+ <div class="opt-group">+ <p class="opt-label">Body</p>+ <div class="toggle" role="group" aria-label="Body type">+ <button type="button" data-body="male" aria-pressed="true">Masc</button>+ <button type="button" data-body="female" aria-pressed="false">+ Femme+ </button></div></div>- <input type="file" data-slot-input="left" accept="image/jpeg,image/png,image/webp,image/heic,image/heif" hidden />- <input type="file" data-slot-input="right" accept="image/jpeg,image/png,image/webp,image/heic,image/heif" hidden /></div>- </details>-- <div class="opts">- <div class="opt-group">- <p class="opt-label">Look</p>- <div class="style-grid" role="group" aria-label="Avatar style">- <button type="button" class="style-card" data-type="v1" aria-pressed="true">- <span class="style-swatch photoreal" aria-hidden="true"></span>- <span>- <span class="style-title">Photoreal</span>- <span class="style-desc">Likeness-first. Closest to how you actually look.</span>- </span>- </button>- <button type="button" class="style-card" data-type="v2" aria-pressed="false">- <span class="style-swatch stylized" aria-hidden="true"></span>- <span>- <span class="style-title">Stylized</span>- <span class="style-desc">Cleaner, cartoon-leaning. Good for streaming + games.</span>- </span>- </button>++ <div id="submit-bar" class="submit-bar">+ <button id="submit-btn" type="button" disabled>+ <span class="label">Start scanning to continue</span>+ </button>+ </div>+ </section>++ <!-- Step 2: Building -->+ <section class="step" data-step="building">+ <h1>Reconstructing you…</h1>+ <p class="sub">+ This usually takes 1–2 minutes. Keep this tab open — we'll ping you when it's+ done.+ </p>++ <div class="build-progress" role="list" aria-label="Scan progress">+ <div class="build-step completed" data-bstep="upload" role="listitem">+ <span class="bstep-dot" aria-hidden="true"></span>+ <span class="bstep-label">Scan captured</span>+ </div>+ <div class="build-step active" data-bstep="process" role="listitem">+ <span class="bstep-dot" aria-hidden="true"></span>+ <span class="bstep-label" id="build-status-text" aria-live="polite"+ >Building 3D mesh from your scan…</span+ >+ </div>+ <div class="build-step" data-bstep="finish" role="listitem">+ <span class="bstep-dot" aria-hidden="true"></span>+ <span class="bstep-label">Auto-rigging skeleton</span></div></div>- <div class="opt-group">- <p class="opt-label">Body</p>- <div class="toggle" role="group" aria-label="Body type">- <button type="button" data-body="male" aria-pressed="true">Masc</button>- <button type="button" data-body="female" aria-pressed="false">Femme</button>++ <div class="build-viewer" aria-hidden="true">+ <model-viewer+ src="/avatars/default.glb"+ auto-rotate+ rotation-per-second="12deg"+ interaction-prompt="none"+ disable-zoom+ disable-pan+ shadow-intensity="0.5"+ environment-image="neutral"+ exposure="0.9"+ camera-orbit="0deg 78deg auto"+ loading="eager"+ ></model-viewer>+ <img id="build-preview" class="build-preview" alt="" />+ <div class="build-veil">+ <div class="build-ring"></div></div></div>- </div>- <div id="submit-bar" class="submit-bar">- <button id="submit-btn" type="button" disabled>- <span class="label">Start scanning to continue</span>- </button>- </div>- </section>+ <p id="build-error-msg" class="build-error" role="alert"></p>+ <button id="build-retry-btn" class="build-retry" type="button">← Scan again</button>+ </section>- <!-- Step 2: Building -->- <section class="step" data-step="building">- <h1>Reconstructing you…</h1>- <p class="sub">This usually takes 1–2 minutes. Keep this tab open — we'll ping you when it's done.</p>+ <!-- Step 3: Done -->+ <section class="step" data-step="done">+ <h1>You're in 3D.</h1>+ <p class="sub">+ Drag to spin it. Download the model, share the scan, or open it in your+ workspace.+ </p>- <div class="build-progress" role="list" aria-label="Scan progress">- <div class="build-step completed" data-bstep="upload" role="listitem">- <span class="bstep-dot" aria-hidden="true"></span>- <span class="bstep-label">Scan captured</span>+ <div class="done-viewer">+ <model-viewer+ id="done-model"+ auto-rotate+ rotation-per-second="14deg"+ interaction-prompt="none"+ camera-controls+ shadow-intensity="0.7"+ shadow-softness="0.8"+ environment-image="neutral"+ exposure="0.95"+ camera-orbit="0deg 78deg auto"+ loading="eager"+ alt="Your 3D scan"+ ></model-viewer></div>- <div class="build-step active" data-bstep="process" role="listitem">- <span class="bstep-dot" aria-hidden="true"></span>- <span class="bstep-label" id="build-status-text" aria-live="polite">Building 3D mesh from your scan…</span>++ <div class="name-row">+ <input+ type="text"+ id="done-name"+ class="name-input"+ placeholder="Name your scan"+ maxlength="60"+ autocomplete="off"+ aria-label="Scan name"+ /></div>- <div class="build-step" data-bstep="finish" role="listitem">- <span class="bstep-dot" aria-hidden="true"></span>- <span class="bstep-label">Auto-rigging skeleton</span>++ <div class="export-row">+ <button class="export-btn" id="dl-glb" type="button" data-format="glb">+ <svg+ width="20"+ height="20"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />+ <polyline points="7 10 12 15 17 10" />+ <line x1="12" y1="15" x2="12" y2="3" />+ </svg>+ Download+ <span class="ext">.GLB</span>+ </button>+ <button class="export-btn" id="dl-fbx" type="button" data-format="fbx">+ <svg+ width="20"+ height="20"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path+ d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"+ />+ <polyline points="3.27 6.96 12 12.01 20.73 6.96" />+ <line x1="12" y1="22.08" x2="12" y2="12" />+ </svg>+ Engines+ <span class="ext">.FBX</span>+ </button>+ <button class="export-btn" id="dl-usdz" type="button" data-format="usdz">+ <svg+ width="20"+ height="20"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <path d="M12 2 2 7l10 5 10-5-10-5z" />+ <path d="m2 17 10 5 10-5" />+ <path d="m2 12 10 5 10-5" />+ </svg>+ iOS AR+ <span class="ext">.USDZ</span>+ </button>+ <button class="export-btn" id="dl-vrm" type="button" data-format="vrm">+ <svg+ width="20"+ height="20"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <circle cx="12" cy="8" r="4" />+ <path d="M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1" />+ </svg>+ VTube+ <span class="ext">.VRM</span>+ </button></div>- </div>- <div class="build-viewer" aria-hidden="true">- <model-viewer- src="/avatars/default.glb"- auto-rotate- rotation-per-second="12deg"- interaction-prompt="none"- disable-zoom- disable-pan- shadow-intensity="0.5"- environment-image="neutral"- exposure="0.9"- camera-orbit="0deg 78deg auto"- loading="eager"- ></model-viewer>- <img id="build-preview" class="build-preview" alt="" />- <div class="build-veil">- <div class="build-ring"></div>+ <div class="done-actions">+ <button id="share-btn" class="btn-share" type="button">+ <svg+ width="16"+ height="16"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <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 my scan+ </button>+ <button id="done-save-btn" class="btn-save" type="button">+ Open in my workspace →+ </button>+ <button id="done-editor-btn" class="btn-ghost" type="button">+ Customize in editor+ </button>+ <button id="done-regen-btn" class="btn-ghost" type="button">+ Not quite right — scan again+ </button></div>- </div>+ <p id="share-toast" class="share-toast" role="status" aria-live="polite"></p>- <p id="build-error-msg" class="build-error" role="alert"></p>- <button id="build-retry-btn" class="build-retry" type="button">← Scan again</button>- </section>+ <div class="portability-note">+ <span>This scan works in any three.ws-powered app, game, or stream.</span>+ <a href="/docs/embed" target="_blank" rel="noopener">Learn how to embed →</a>+ </div>+ </section>+ </main>- <!-- Step 3: Done -->- <section class="step" data-step="done">- <h1>You're in 3D.</h1>- <p class="sub">Drag to spin it. Download the model, share the scan, or open it in your workspace.</p>-- <div class="done-viewer">- <model-viewer- id="done-model"- auto-rotate- rotation-per-second="14deg"- interaction-prompt="none"- camera-controls- shadow-intensity="0.7"- shadow-softness="0.8"- environment-image="neutral"- exposure="0.95"- camera-orbit="0deg 78deg auto"- loading="eager"- alt="Your 3D scan"- ></model-viewer>+ <!-- Step "unavailable" — shown when the reconstruction backend isn't wired. -->+ <section+ class="step"+ data-step="unavailable"+ hidden+ style="text-align: center; max-width: 520px; margin: 0 auto; padding: 48px 24px"+ >+ <h1 style="margin: 0 0 12px">The scanner is warming up</h1>+ <p class="sub" style="margin: 0 0 24px; color: #9aa3b2">+ The photo-to-3D engine is being provisioned for this environment. In the meantime,+ you can build an avatar in the studio — same outputs, fully ready today.+ </p>+ <div class="done-actions" style="justify-content: center">+ <a+ href="/create"+ class="btn-save"+ style="text-decoration: none; display: inline-block"+ >Open the avatar studio →</a+ >+ <a+ href="/app"+ class="btn-ghost"+ style="text-decoration: none; display: inline-block"+ >Back to my workspace</a+ ></div>+ </section>- <div class="name-row">- <input- type="text"- id="done-name"- class="name-input"- placeholder="Name your scan"- maxlength="60"- autocomplete="off"- aria-label="Scan name"- />+ <!-- Camera overlay (driven by selfie-capture.js) -->+ <div id="cam-overlay" role="dialog" aria-modal="true" aria-label="Camera capture">+ <div id="cam-stage">+ <video id="cam-video" autoplay playsinline muted></video>+ <canvas id="cam-mesh-overlay" aria-hidden="true"></canvas>+ <div class="cam-oval" id="cam-oval" aria-hidden="true">+ <svg viewBox="0 0 300 400" preserveAspectRatio="xMidYMid meet">+ <ellipse cx="150" cy="180" rx="115" ry="155" />+ </svg>+ </div>+ <div class="cam-badges" id="cam-badges" aria-hidden="true"></div>+ <div class="cam-hint" id="cam-hint">Center your face in the oval</div>+ <div class="cam-countdown" id="cam-countdown" aria-hidden="true">+ <span class="count-num" id="cam-count-num">3</span>+ </div></div>-- <div class="export-row">- <button class="export-btn" id="dl-glb" type="button" data-format="glb">- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>- Download- <span class="ext">.GLB</span>- </button>- <button class="export-btn" id="dl-fbx" type="button" data-format="fbx">- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>- Engines- <span class="ext">.FBX</span>- </button>- <button class="export-btn" id="dl-usdz" type="button" data-format="usdz">- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2 2 7l10 5 10-5-10-5z"/><path d="m2 17 10 5 10-5"/><path d="m2 12 10 5 10-5"/></svg>- iOS AR- <span class="ext">.USDZ</span>- </button>- <button class="export-btn" id="dl-vrm" type="button" data-format="vrm">- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="4"/><path d="M4 21v-1a6 6 0 0 1 6-6h4a6 6 0 0 1 6 6v1"/></svg>- VTube- <span class="ext">.VRM</span>- </button>+ <div class="cam-prompt">Scanning your <strong id="cam-slot-name">selfie</strong></div>+ <div id="cam-error" hidden></div>+ <div class="cam-bar">+ <div id="cam-actions-live" style="display: contents">+ <button type="button" data-cam-action="cancel">Cancel</button>+ <button+ type="button"+ class="shutter"+ data-cam-action="shoot"+ aria-label="Capture scan"+ id="cam-shutter"+ ></button>+ <div class="spacer"></div>+ </div>+ <div id="cam-actions-review" hidden style="display: contents">+ <button type="button" data-cam-action="retake">Retake</button>+ <button type="button" data-cam-action="use">Use this</button>+ </div></div>+ </div>- <div class="done-actions">- <button id="share-btn" class="btn-share" type="button">- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><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 my scan- </button>- <button id="done-save-btn" class="btn-save" type="button">Open in my workspace →</button>- <button id="done-editor-btn" class="btn-ghost" type="button">Customize in editor</button>- <button id="done-regen-btn" class="btn-ghost" type="button">Not quite right — scan again</button>- </div>- <p id="share-toast" class="share-toast" role="status" aria-live="polite"></p>+ <script type="module">+ function showStep(name) {+ document.querySelectorAll('.step[data-step]').forEach((s) => {+ s.classList.toggle('active', s.dataset.step === name);+ if (name === 'unavailable') s.hidden = s.dataset.step !== 'unavailable';+ });+ window.scrollTo({ top: 0, behavior: 'auto' });+ }- <div class="portability-note">- <span>This scan works in any three.ws-powered app, game, or stream.</span>- <a href="/docs/embed" target="_blank" rel="noopener">Learn how to embed →</a>- </div>- </section>- </main>-- <!-- Step "unavailable" — shown when the reconstruction backend isn't wired. -->- <section class="step" data-step="unavailable" hidden style="text-align:center;max-width:520px;margin:0 auto;padding:48px 24px;">- <h1 style="margin:0 0 12px;">The scanner is warming up</h1>- <p class="sub" style="margin:0 0 24px;color:#9aa3b2;">- The photo-to-3D engine is being provisioned for this environment.- In the meantime, you can build an avatar in the studio — same outputs,- fully ready today.- </p>- <div class="done-actions" style="justify-content:center;">- <a href="/create" class="btn-save" style="text-decoration:none;display:inline-block;">Open the avatar studio →</a>- <a href="/app" class="btn-ghost" style="text-decoration:none;display:inline-block;">Back to my workspace</a>- </div>- </section>-- <!-- Camera overlay (driven by selfie-capture.js) -->- <div id="cam-overlay" role="dialog" aria-modal="true" aria-label="Camera capture">- <div id="cam-stage">- <video id="cam-video" autoplay playsinline muted></video>- <canvas id="cam-mesh-overlay" aria-hidden="true"></canvas>- <div class="cam-oval" id="cam-oval" aria-hidden="true">- <svg viewBox="0 0 300 400" preserveAspectRatio="xMidYMid meet">- <ellipse cx="150" cy="180" rx="115" ry="155" />- </svg>- </div>- <div class="cam-badges" id="cam-badges" aria-hidden="true"></div>- <div class="cam-hint" id="cam-hint">Center your face in the oval</div>- <div class="cam-countdown" id="cam-countdown" aria-hidden="true">- <span class="count-num" id="cam-count-num">3</span>- </div>- </div>- <div class="cam-prompt">- Scanning your <strong id="cam-slot-name">selfie</strong>- </div>- <div id="cam-error" hidden></div>- <div class="cam-bar">- <div id="cam-actions-live" style="display: contents;">- <button type="button" data-cam-action="cancel">Cancel</button>- <button type="button" class="shutter" data-cam-action="shoot" aria-label="Capture scan" id="cam-shutter"></button>- <div class="spacer"></div>- </div>- <div id="cam-actions-review" hidden style="display: contents;">- <button type="button" data-cam-action="retake">Retake</button>- <button type="button" data-cam-action="use">Use this</button>- </div>- </div>- </div>+ // Capability probe — reconstruct returns 501 unless an ML backend is wired.+ const reconstructReady = await fetch('/api/config', { credentials: 'omit' })+ .then((r) => (r.ok ? r.json() : null))+ .then((j) => j?.features?.avatarReconstruct !== false)+ .catch(() => true);++ if (!reconstructReady) {+ document.querySelectorAll('.step[data-step]').forEach((s) => {+ s.classList.remove('active');+ s.hidden = s.dataset.step !== 'unavailable';+ });+ const u = document.querySelector('.step[data-step="unavailable"]');+ if (u) {+ u.hidden = false;+ u.classList.add('active');+ }+ const sb = document.getElementById('submit-bar');+ if (sb) sb.hidden = true;+ } else {+ await import('/src/selfie-capture.js');+ await import('/src/selfie-pipeline.js');+ }++ let _avatarId = null;+ let _modelUrl = null;+ let _avatarName = '3d-scan';+ let _docTitleBase = document.title;+ let _notifyPermission =+ typeof Notification !== 'undefined' ? Notification.permission : 'denied';- <script type="module">- function showStep(name) {- document.querySelectorAll('.step[data-step]').forEach((s) => {- s.classList.toggle('active', s.dataset.step === name);- if (name === 'unavailable') s.hidden = s.dataset.step !== 'unavailable';+ function showViewerError(message) {+ const viewer = document.querySelector('.done-viewer');+ if (!viewer) return;+ let el = viewer.querySelector('.viewer-error');+ if (!el) {+ el = document.createElement('div');+ el.className = 'viewer-error';+ el.setAttribute('role', 'alert');+ viewer.appendChild(el);+ }+ el.textContent = message;+ el.classList.add('show');+ }++ // Surface model-viewer decode/load failures instead of leaving a black box.+ document.getElementById('done-model')?.addEventListener('error', () => {+ showViewerError(+ 'This scan couldn’t be displayed. Try downloading the .GLB instead.',+ );+ });++ document.addEventListener('selfie:preview', (e) => {+ const dataUrl = e.detail?.dataUrl;+ if (!dataUrl) return;+ const img = document.getElementById('build-preview');+ if (!img) return;+ img.src = dataUrl;+ requestAnimationFrame(() => img.classList.add('show'));});- window.scrollTo({ top: 0, behavior: 'auto' });- }-- // Capability probe — reconstruct returns 501 unless an ML backend is wired.- const reconstructReady = await fetch('/api/config', { credentials: 'omit' })- .then((r) => (r.ok ? r.json() : null))- .then((j) => j?.features?.avatarReconstruct !== false)- .catch(() => true);-- if (!reconstructReady) {- document.querySelectorAll('.step[data-step]').forEach((s) => {- s.classList.remove('active');- s.hidden = s.dataset.step !== 'unavailable';++ document.addEventListener('selfie:building', () => {+ showStep('building');+ if (typeof Notification !== 'undefined' && _notifyPermission === 'default') {+ Notification.requestPermission()+ .then((p) => {+ _notifyPermission = p;+ })+ .catch(() => {});+ }});- const u = document.querySelector('.step[data-step="unavailable"]');- if (u) { u.hidden = false; u.classList.add('active'); }- const sb = document.getElementById('submit-bar');- if (sb) sb.hidden = true;- } else {- await import('/src/selfie-capture.js');- await import('/src/selfie-pipeline.js');- }-- let _avatarId = null;- let _modelUrl = null;- let _avatarName = '3d-scan';- let _docTitleBase = document.title;- let _notifyPermission = (typeof Notification !== 'undefined') ? Notification.permission : 'denied';-- function showViewerError(message) {- const viewer = document.querySelector('.done-viewer');- if (!viewer) return;- let el = viewer.querySelector('.viewer-error');- if (!el) {- el = document.createElement('div');- el.className = 'viewer-error';- el.setAttribute('role', 'alert');- viewer.appendChild(el);- }- el.textContent = message;- el.classList.add('show');- }-- // Surface model-viewer decode/load failures instead of leaving a black box.- document.getElementById('done-model')?.addEventListener('error', () => {- showViewerError('This scan couldn’t be displayed. Try downloading the .GLB instead.');- });-- document.addEventListener('selfie:preview', (e) => {- const dataUrl = e.detail?.dataUrl;- if (!dataUrl) return;- const img = document.getElementById('build-preview');- if (!img) return;- img.src = dataUrl;- requestAnimationFrame(() => img.classList.add('show'));- });-- document.addEventListener('selfie:building', () => {- showStep('building');- if (typeof Notification !== 'undefined' && _notifyPermission === 'default') {- Notification.requestPermission().then((p) => { _notifyPermission = p; }).catch(() => {});- }- });-- document.addEventListener('selfie:progress', (e) => {- const label = e.detail?.label;- if (!label) return;- const el = document.getElementById('build-status-text');- if (el) el.textContent = label;- const processStep = document.querySelector('.build-step[data-bstep="process"]');- const finishStep = document.querySelector('.build-step[data-bstep="finish"]');- if (label.toLowerCase().includes('finish') || label.toLowerCase().includes('rig')) {- processStep?.classList.replace('active', 'completed');- finishStep?.classList.add('active');- }- });-- document.addEventListener('selfie:done', async (e) => {- _avatarId = e.detail?.avatarId;- if (!_avatarId) return;- document.querySelectorAll('.build-step').forEach((s) => { s.className = 'build-step completed'; });-- try {- const res = await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, { credentials: 'include' });- if (res.ok) {- const data = await res.json();- // GET /api/avatars/:id wraps the record in { avatar }. Private- // scans expose the playable model as a presigned `url`; the public- // CDN field `model_url` is null until the scan is made public.- const avatar = data.avatar || data;- _modelUrl = avatar.url || avatar.model_url || null;- _avatarName = avatar.name || _avatarName;- const modelEl = document.getElementById('done-model');- if (modelEl && _modelUrl) {- modelEl.setAttribute('src', _modelUrl);++ document.addEventListener('selfie:progress', (e) => {+ const label = e.detail?.label;+ if (!label) return;+ const el = document.getElementById('build-status-text');+ if (el) el.textContent = label;+ const processStep = document.querySelector('.build-step[data-bstep="process"]');+ const finishStep = document.querySelector('.build-step[data-bstep="finish"]');+ if (label.toLowerCase().includes('finish') || label.toLowerCase().includes('rig')) {+ processStep?.classList.replace('active', 'completed');+ finishStep?.classList.add('active');+ }+ });++ document.addEventListener('selfie:done', async (e) => {+ _avatarId = e.detail?.avatarId;+ if (!_avatarId) return;+ document.querySelectorAll('.build-step').forEach((s) => {+ s.className = 'build-step completed';+ });++ try {+ const res = await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {+ credentials: 'include',+ });+ if (res.ok) {+ const data = await res.json();+ // GET /api/avatars/:id wraps the record in { avatar }. Private+ // scans expose the playable model as a presigned `url`; the public+ // CDN field `model_url` is null until the scan is made public.+ const avatar = data.avatar || data;+ _modelUrl = avatar.url || avatar.model_url || null;+ _avatarName = avatar.name || _avatarName;+ const modelEl = document.getElementById('done-model');+ if (modelEl && _modelUrl) {+ modelEl.setAttribute('src', _modelUrl);+ } else {+ showViewerError(+ 'Your scan finished, but the model is still finalizing. Refresh in a moment.',+ );+ }+ const nameEl = document.getElementById('done-name');+ if (nameEl && avatar.name) nameEl.value = avatar.name;} else {- showViewerError('Your scan finished, but the model is still finalizing. Refresh in a moment.');+ showViewerError('Couldn’t load your scan. Refresh to try again.');}- const nameEl = document.getElementById('done-name');- if (nameEl && avatar.name) nameEl.value = avatar.name;- } else {- showViewerError('Couldn’t load your scan. Refresh to try again.');+ } catch (_) {+ showViewerError('Couldn’t load your scan. Check your connection and refresh.');}- } catch (_) {- showViewerError('Couldn’t load your scan. Check your connection and refresh.');- }-- notifyDone();- showStep('done');- // Surface adjacent features now that the avatar exists (walk it / embed- // it). The site-wide discovery layer renders the cross-link card.- document.dispatchEvent(new CustomEvent('tws:feature-done', { detail: { feature: 'scan' } }));- });-- function notifyDone() {- if (!document.hidden) return;- let on = true;- const tick = window.setInterval(() => {- document.title = on ? '✓ Scan ready — three.ws' : _docTitleBase;- on = !on;- }, 900);- const restore = () => {- clearInterval(tick);- document.title = _docTitleBase;- document.removeEventListener('visibilitychange', restore);- };- document.addEventListener('visibilitychange', restore);- if (_notifyPermission === 'granted' && typeof Notification !== 'undefined') {- try {- const n = new Notification('Your 3D scan is ready', { body: 'Tap to open it on three.ws.', icon: '/favicon.ico', tag: 'scan-ready' });- n.onclick = () => { window.focus(); n.close(); };- } catch (_) {}- }- }-- document.addEventListener('selfie:build-error', (e) => {- const detail = e.detail || {};- const msg = detail.message || 'Something went wrong. Try again.';- const errEl = document.getElementById('build-error-msg');- const retryBtn = document.getElementById('build-retry-btn');- if (errEl) { errEl.textContent = msg; errEl.classList.add('show'); }- if (retryBtn) retryBtn.classList.add('show');- const ring = document.querySelector('.build-ring');- if (ring) ring.style.display = 'none';- const veil = document.querySelector('.build-veil');- if (veil) veil.style.display = 'none';- const activeStep = document.querySelector('.build-step.active');- if (activeStep) {- activeStep.classList.remove('active');- activeStep.classList.add('failed');- const label = activeStep.querySelector('.bstep-label');- if (label) label.textContent = 'Failed';- }- const heading = document.querySelector('[data-step="building"] h1');- if (heading) heading.textContent = "Couldn't finish the scan";- const sub = document.querySelector('[data-step="building"] .sub');- if (sub) sub.textContent = 'Check the tips and scan again with a clearer shot.';- if (detail.slot) {- const slotFrame = document.querySelector(- detail.slot === 'frontal' ? `.hero-slot[data-slot="${detail.slot}"]` : `.slot-frame[data-slot="${detail.slot}"]`,++ notifyDone();+ showStep('done');+ // Surface adjacent features now that the avatar exists (walk it / embed+ // it). The site-wide discovery layer renders the cross-link card.+ document.dispatchEvent(+ new CustomEvent('tws:feature-done', { detail: { feature: 'scan' } }),);- slotFrame?.classList.add('error');- if (detail.slot !== 'frontal') {- const fid = document.getElementById('fidelity-boost');- if (fid) fid.open = true;+ });++ function notifyDone() {+ if (!document.hidden) return;+ let on = true;+ const tick = window.setInterval(() => {+ document.title = on ? '✓ Scan ready — three.ws' : _docTitleBase;+ on = !on;+ }, 900);+ const restore = () => {+ clearInterval(tick);+ document.title = _docTitleBase;+ document.removeEventListener('visibilitychange', restore);+ };+ document.addEventListener('visibilitychange', restore);+ if (_notifyPermission === 'granted' && typeof Notification !== 'undefined') {+ try {+ const n = new Notification('Your 3D scan is ready', {+ body: 'Tap to open it on three.ws.',+ icon: '/favicon.ico',+ tag: 'scan-ready',+ });+ n.onclick = () => {+ window.focus();+ n.close();+ };+ } catch (_) {}}}- });-- document.getElementById('build-retry-btn')?.addEventListener('click', () => {- document.getElementById('build-error-msg')?.classList.remove('show');- document.getElementById('build-retry-btn')?.classList.remove('show');- const ring = document.querySelector('.build-ring');- if (ring) ring.style.display = '';- const veil = document.querySelector('.build-veil');- if (veil) veil.style.display = '';- const heading = document.querySelector('[data-step="building"] h1');- if (heading) heading.textContent = 'Reconstructing you…';- const sub = document.querySelector('[data-step="building"] .sub');- if (sub) sub.textContent = "This usually takes 1–2 minutes. Keep this tab open — we'll ping you when it's done.";- document.querySelectorAll('.build-step').forEach((s) => { s.classList.remove('completed', 'active', 'failed'); });- document.querySelector('.build-step[data-bstep="upload"]')?.classList.add('completed');- document.querySelector('.build-step[data-bstep="process"]')?.classList.add('active');- const statusText = document.getElementById('build-status-text');- if (statusText) statusText.textContent = 'Building 3D mesh from your scan…';- showStep('capture');- });-- // ── Share / export loop ─────────────────────────────────────────────- function toast(msg) {- const el = document.getElementById('share-toast');- if (!el) return;- el.textContent = msg;- el.classList.add('show');- window.clearTimeout(toast._t);- toast._t = window.setTimeout(() => el.classList.remove('show'), 2600);- }-- // Persist any name edit before leaving / exporting so downloads + the- // workspace stay consistent with what the user typed.- async function persistName() {- const nameEl = document.getElementById('done-name');- const name = nameEl?.value?.trim();- if (!_avatarId || !name || name === _avatarName) return;- _avatarName = name;- try {- await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {- method: 'PATCH', credentials: 'include',- headers: { 'content-type': 'application/json' },- body: JSON.stringify({ name }),++ document.addEventListener('selfie:build-error', (e) => {+ const detail = e.detail || {};+ const msg = detail.message || 'Something went wrong. Try again.';+ const errEl = document.getElementById('build-error-msg');+ const retryBtn = document.getElementById('build-retry-btn');+ if (errEl) {+ errEl.textContent = msg;+ errEl.classList.add('show');+ }+ if (retryBtn) retryBtn.classList.add('show');+ const ring = document.querySelector('.build-ring');+ if (ring) ring.style.display = 'none';+ const veil = document.querySelector('.build-veil');+ if (veil) veil.style.display = 'none';+ const activeStep = document.querySelector('.build-step.active');+ if (activeStep) {+ activeStep.classList.remove('active');+ activeStep.classList.add('failed');+ const label = activeStep.querySelector('.bstep-label');+ if (label) label.textContent = 'Failed';+ }+ const heading = document.querySelector('[data-step="building"] h1');+ if (heading) heading.textContent = "Couldn't finish the scan";+ const sub = document.querySelector('[data-step="building"] .sub');+ if (sub) sub.textContent = 'Check the tips and scan again with a clearer shot.';+ if (detail.slot) {+ const slotFrame = document.querySelector(+ detail.slot === 'frontal'+ ? `.hero-slot[data-slot="${detail.slot}"]`+ : `.slot-frame[data-slot="${detail.slot}"]`,+ );+ slotFrame?.classList.add('error');+ if (detail.slot !== 'frontal') {+ const fid = document.getElementById('fidelity-boost');+ if (fid) fid.open = true;+ }+ }+ });++ document.getElementById('build-retry-btn')?.addEventListener('click', () => {+ document.getElementById('build-error-msg')?.classList.remove('show');+ document.getElementById('build-retry-btn')?.classList.remove('show');+ const ring = document.querySelector('.build-ring');+ if (ring) ring.style.display = '';+ const veil = document.querySelector('.build-veil');+ if (veil) veil.style.display = '';+ const heading = document.querySelector('[data-step="building"] h1');+ if (heading) heading.textContent = 'Reconstructing you…';+ const sub = document.querySelector('[data-step="building"] .sub');+ if (sub)+ sub.textContent =+ "This usually takes 1–2 minutes. Keep this tab open — we'll ping you when it's done.";+ document.querySelectorAll('.build-step').forEach((s) => {+ s.classList.remove('completed', 'active', 'failed');});- } catch (_) {}- }-- document.querySelectorAll('.export-btn').forEach((btn) => {- btn.addEventListener('click', async () => {- if (!_modelUrl) { toast('Scan still finalizing — try again in a moment.'); return; }- const format = btn.getAttribute('data-format');- const labelNodes = [...btn.childNodes];- btn.disabled = true;+ document+ .querySelector('.build-step[data-bstep="upload"]')+ ?.classList.add('completed');+ document+ .querySelector('.build-step[data-bstep="process"]')+ ?.classList.add('active');+ const statusText = document.getElementById('build-status-text');+ if (statusText) statusText.textContent = 'Building 3D mesh from your scan…';+ showStep('capture');+ });++ // ── Share / export loop ─────────────────────────────────────────────+ function toast(msg) {+ const el = document.getElementById('share-toast');+ if (!el) return;+ el.textContent = msg;+ el.classList.add('show');+ window.clearTimeout(toast._t);+ toast._t = window.setTimeout(() => el.classList.remove('show'), 2600);+ }++ // Persist any name edit before leaving / exporting so downloads + the+ // workspace stay consistent with what the user typed.+ async function persistName() {+ const nameEl = document.getElementById('done-name');+ const name = nameEl?.value?.trim();+ if (!_avatarId || !name || name === _avatarName) return;+ _avatarName = name;try {- await persistName();- if (format === 'fbx') {- // FBX is built server-side (Blender) from the scanned GLB.- const { fbxFromUrl, downloadUrl } = await import('/src/remesh-convert.js');- const fbxUrl = await fbxFromUrl(_modelUrl, {- onStatus: (msg) => toast(msg),- });- downloadUrl(fbxUrl, `${_avatarName || '3d-scan'}.fbx`);- toast('Downloaded FBX');- } else {- const { downloadAvatar } = await import('/src/avatar-export.js');- const { size } = await downloadAvatar(_modelUrl, {- format,- filename: _avatarName || '3d-scan',- meta: { name: _avatarName },- });- toast(`Downloaded ${format.toUpperCase()} · ${(size / 1024 / 1024).toFixed(1)} MB`);+ await fetch(`/api/avatars/${encodeURIComponent(_avatarId)}`, {+ method: 'PATCH',+ credentials: 'include',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ name }),+ });+ } catch (_) {}+ }++ document.querySelectorAll('.export-btn').forEach((btn) => {+ btn.addEventListener('click', async () => {+ if (!_modelUrl) {+ toast('Scan still finalizing — try again in a moment.');+ return;}- } catch (err) {- console.error('[scan] export failed', err);- toast(`Couldn't export ${format.toUpperCase()}. Try GLB.`);- } finally {- btn.disabled = false;+ const format = btn.getAttribute('data-format');+ const labelNodes = [...btn.childNodes];+ btn.disabled = true;+ try {+ await persistName();+ if (format === 'fbx') {+ // FBX is built server-side (Blender) from the scanned GLB.+ const { fbxFromUrl, downloadUrl } =+ await import('/src/remesh-convert.js');+ const fbxUrl = await fbxFromUrl(_modelUrl, {+ onStatus: (msg) => toast(msg),+ });+ downloadUrl(fbxUrl, `${_avatarName || '3d-scan'}.fbx`);+ toast('Downloaded FBX');+ } else {+ const { downloadAvatar } = await import('/src/avatar-export.js');+ const { size } = await downloadAvatar(_modelUrl, {+ format,+ filename: _avatarName || '3d-scan',+ meta: { name: _avatarName },+ });+ toast(+ `Downloaded ${format.toUpperCase()} · ${(size / 1024 / 1024).toFixed(1)} MB`,+ );+ }+ } catch (err) {+ console.error('[scan] export failed', err);+ toast(`Couldn't export ${format.toUpperCase()}. Try GLB.`);+ } finally {+ btn.disabled = false;+ }+ });+ });++ document.getElementById('share-btn')?.addEventListener('click', async () => {+ if (!_avatarId) return;+ await persistName();+ const shareUrl = `${location.origin}/avatars/${encodeURIComponent(_avatarId)}`;+ const { showSharePanel } = await import('/src/shared/share.js');+ showSharePanel(+ {+ kind: 'scan',+ id: _avatarId,+ title: _avatarName || 'My 3D scan',+ description: 'A real-time photogrammetry scan made on three.ws.',+ shareUrl,+ remixUrl: `${location.origin}/scan`,+ },+ document.getElementById('share-btn'),+ );+ });++ document.getElementById('done-save-btn')?.addEventListener('click', async () => {+ if (!_avatarId) return;+ const btn = document.getElementById('done-save-btn');+ btn.disabled = true;+ btn.textContent = 'Opening…';+ await persistName();+ window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}`);+ });++ document.getElementById('done-editor-btn')?.addEventListener('click', async () => {+ if (!_avatarId) return;+ await persistName();+ window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}/edit`);+ });++ document.getElementById('done-regen-btn')?.addEventListener('click', () => {+ _avatarId = null;+ _modelUrl = null;+ const preview = document.getElementById('build-preview');+ if (preview) {+ preview.removeAttribute('src');+ preview.classList.remove('show');}+ document.dispatchEvent(new CustomEvent('selfie:reset'));+ showStep('capture');});- });-- document.getElementById('share-btn')?.addEventListener('click', async () => {- if (!_avatarId) return;- await persistName();- const shareUrl = `${location.origin}/avatars/${encodeURIComponent(_avatarId)}`;- const { showSharePanel } = await import('/src/shared/share.js');- showSharePanel(- {- kind: 'scan',- id: _avatarId,- title: _avatarName || 'My 3D scan',- description: 'A real-time photogrammetry scan made on three.ws.',- shareUrl,- remixUrl: `${location.origin}/scan`,- },- document.getElementById('share-btn'),- );- });-- document.getElementById('done-save-btn')?.addEventListener('click', async () => {- if (!_avatarId) return;- const btn = document.getElementById('done-save-btn');- btn.disabled = true;- btn.textContent = 'Opening…';- await persistName();- window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}`);- });-- document.getElementById('done-editor-btn')?.addEventListener('click', async () => {- if (!_avatarId) return;- await persistName();- window.location.assign(`/avatars/${encodeURIComponent(_avatarId)}/edit`);- });-- document.getElementById('done-regen-btn')?.addEventListener('click', () => {- _avatarId = null;- _modelUrl = null;- const preview = document.getElementById('build-preview');- if (preview) { preview.removeAttribute('src'); preview.classList.remove('show'); }- document.dispatchEvent(new CustomEvent('selfie:reset'));- showStep('capture');- });- </script>- <script src="/brand.js" defer></script>- <script src="/getting-started.js" defer></script>-</body>+ </script>+ <script src="/brand.js" defer></script>+ <script src="/getting-started.js" defer></script>+ </body></html>diff --git a/pages/tutorial.html b/pages/tutorial.htmlindex ff3a41b94..3b5e48b2e 100644--- a/pages/tutorial.html+++ b/pages/tutorial.html@@ -6,13 +6,19 @@<title>three.ws — Tutorial</title><meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="author" content="nirholas" />- <meta name="description" content="Step-by-step tutorials for building, embedding, and shipping 3D agents with three.ws." />+ <meta+ name="description"+ content="Step-by-step tutorials for building, embedding, and shipping 3D agents with three.ws."+ /><meta name="theme-color" content="#000000" /><meta property="og:type" content="article" /><meta property="og:site_name" content="three.ws" /><meta property="og:title" content="three.ws — Tutorial" />- <meta property="og:description" content="Step-by-step tutorials for building, embedding, and shipping 3D agents with three.ws." />+ <meta+ property="og:description"+ content="Step-by-step tutorials for building, embedding, and shipping 3D agents with three.ws."+ /><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" />@@ -37,12 +43,25 @@href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css"/><link rel="stylesheet" href="/mobile.css" />- <script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"></script>- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script>+ <script+ src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"+ integrity="sha384-odPBjvtXVM/5hOYIr3A1dB+flh0c3wAT3bSesIOqEGmyUA4JoKf/YTWy0XKOYAY7"+ crossorigin="anonymous"+ ></script>+ <script+ src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"+ integrity="sha384-F/bZzf7p3Joyp5psL90p/p89AZJsndkSoGwRpXcZhleCWhd8SnRuoYo4d0yirjJp"+ crossorigin="anonymous"+ ></script><script defer src="/nav.js"></script><script defer src="/footer-newsletter.js"></script><script defer src="/tutorials-manifest.js"></script>- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>html.tutorial-page,@@ -87,8 +106,16 @@position: absolute;inset: 0;background:- radial-gradient(ellipse 60% 80% at 15% 50%, var(--tdoc-glow, rgba(255, 255, 255, 0.12)) 0%, transparent 60%),- radial-gradient(ellipse 50% 60% at 85% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 55%);+ radial-gradient(+ ellipse 60% 80% at 15% 50%,+ var(--tdoc-glow, rgba(255, 255, 255, 0.12)) 0%,+ transparent 60%+ ),+ radial-gradient(+ ellipse 50% 60% at 85% 20%,+ rgba(255, 255, 255, 0.05) 0%,+ transparent 55%+ );pointer-events: none;}@@ -115,9 +142,17 @@transition: color 0.15s ease;}- .tdoc-back-link:hover { color: rgba(255, 255, 255, 0.85); }- .tdoc-back-link svg { width: 12px; height: 12px; transition: transform 0.15s ease; }- .tdoc-back-link:hover svg { transform: translateX(-2px); }+ .tdoc-back-link:hover {+ color: rgba(255, 255, 255, 0.85);+ }+ .tdoc-back-link svg {+ width: 12px;+ height: 12px;+ transition: transform 0.15s ease;+ }+ .tdoc-back-link:hover svg {+ transform: translateX(-2px);+ }.tdoc-tier-row {display: flex;@@ -165,7 +200,11 @@color: rgba(255, 255, 255, 0.6);}- .tdoc-meta-chip svg { width: 11px; height: 11px; opacity: 0.7; }+ .tdoc-meta-chip svg {+ width: 11px;+ height: 11px;+ opacity: 0.7;+ }.tdoc-hero h1 {font-family: var(--font-display);@@ -251,7 +290,11 @@.tdoc-article {min-width: 0;- font-family: 'Inter', system-ui, -apple-system, sans-serif;+ font-family:+ 'Inter',+ system-ui,+ -apple-system,+ sans-serif;font-size: 1rem;line-height: 1.72;color: rgba(224, 224, 224, 0.86);@@ -275,8 +318,15 @@}@keyframes tdoc-pulse {- 0%, 100% { opacity: 0.3; transform: scale(0.8); }- 50% { opacity: 1; transform: scale(1.1); }+ 0%,+ 100% {+ opacity: 0.3;+ transform: scale(0.8);+ }+ 50% {+ opacity: 1;+ transform: scale(1.1);+ }}.tdoc-article h1 {@@ -322,7 +372,9 @@scroll-margin-top: 80px;}- .tdoc-article p { margin: 0 0 1.1rem; }+ .tdoc-article p {+ margin: 0 0 1.1rem;+ }.tdoc-article a {color: var(--tdoc-accent, #ffffff);@@ -331,9 +383,14 @@transition: border-color 0.15s ease;}- .tdoc-article a:hover { border-bottom-color: currentColor; }+ .tdoc-article a:hover {+ border-bottom-color: currentColor;+ }- .tdoc-article strong { color: #fff; font-weight: 600; }+ .tdoc-article strong {+ color: #fff;+ font-weight: 600;+ }.tdoc-article ul,.tdoc-article ol {@@ -341,8 +398,12 @@padding-left: 1.4rem;}- .tdoc-article li { margin-bottom: 0.4rem; }- .tdoc-article li > p { margin-bottom: 0.4rem; }+ .tdoc-article li {+ margin-bottom: 0.4rem;+ }+ .tdoc-article li > p {+ margin-bottom: 0.4rem;+ }.tdoc-article hr {border: none;@@ -359,7 +420,9 @@color: rgba(255, 255, 255, 0.78);}- .tdoc-article blockquote p:last-child { margin-bottom: 0; }+ .tdoc-article blockquote p:last-child {+ margin-bottom: 0;+ }.tdoc-article code {font-family: var(--font-mono);@@ -384,8 +447,13 @@scrollbar-color: rgba(255, 255, 255, 0.1) transparent;}- .tdoc-article pre::-webkit-scrollbar { height: 6px; }- .tdoc-article pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }+ .tdoc-article pre::-webkit-scrollbar {+ height: 6px;+ }+ .tdoc-article pre::-webkit-scrollbar-thumb {+ background: rgba(255, 255, 255, 0.1);+ border-radius: 3px;+ }.tdoc-article pre code {padding: 0;@@ -472,7 +540,9 @@padding-left: 0.7rem;}- .tdoc-toc a:hover { color: rgba(255, 255, 255, 0.95); }+ .tdoc-toc a:hover {+ color: rgba(255, 255, 255, 0.95);+ }.tdoc-toc a.is-active {color: var(--tdoc-accent, #ffffff);@@ -505,7 +575,9 @@border: 1px solid rgba(255, 255, 255, 0.07);border-radius: 10px;text-decoration: none;- transition: border-color 0.2s ease, transform 0.2s ease;+ transition:+ border-color 0.2s ease,+ transform 0.2s ease;min-height: 70px;}@@ -514,7 +586,9 @@transform: translateY(-1px);}- .tdoc-pager-btn.next { text-align: right; }+ .tdoc-pager-btn.next {+ text-align: right;+ }.tdoc-pager-btn.placeholder {background: transparent;@@ -543,9 +617,16 @@/* ── Responsive ──────────────────────────────────────────────── */@media (max-width: 880px) {- .tdoc-hero-inner { grid-template-columns: 1fr; }- .tdoc-hero-viewer model-viewer { height: 200px; }- .tdoc-body-inner { grid-template-columns: 1fr; gap: 1.5rem; }+ .tdoc-hero-inner {+ grid-template-columns: 1fr;+ }+ .tdoc-hero-viewer model-viewer {+ height: 200px;+ }+ .tdoc-body-inner {+ grid-template-columns: 1fr;+ gap: 1.5rem;+ }.tdoc-toc {position: static;max-height: none;@@ -555,16 +636,34 @@padding-top: 1.5rem;order: 99;}- .tdoc-toc ol { flex-direction: row; flex-wrap: wrap; gap: 0.5rem 1rem; }- .tdoc-toc a { padding-left: 0; border-left: none; }- .tdoc-toc a.is-h3 { display: none; }- .tdoc-pager { grid-template-columns: 1fr; }+ .tdoc-toc ol {+ flex-direction: row;+ flex-wrap: wrap;+ gap: 0.5rem 1rem;+ }+ .tdoc-toc a {+ padding-left: 0;+ border-left: none;+ }+ .tdoc-toc a.is-h3 {+ display: none;+ }+ .tdoc-pager {+ grid-template-columns: 1fr;+ }}@media (max-width: 540px) {- .tdoc-article { font-size: 0.95rem; }- .tdoc-article h2 { font-size: 1.25rem; }- .tdoc-article pre { font-size: 0.78rem; padding: 0.9rem 1rem; }+ .tdoc-article {+ font-size: 0.95rem;+ }+ .tdoc-article h2 {+ font-size: 1.25rem;+ }+ .tdoc-article pre {+ font-size: 0.78rem;+ padding: 0.9rem 1rem;+ }}</style></head>@@ -579,13 +678,30 @@<div class="tdoc-hero-inner"><div><a href="/tutorials" class="tdoc-back-link">- <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path d="M10 6H2M6 2 2 6l4 4"/></svg>+ <svg+ viewBox="0 0 12 12"+ fill="none"+ stroke="currentColor"+ stroke-width="1.6"+ aria-hidden="true"+ >+ <path d="M10 6H2M6 2 2 6l4 4" />+ </svg>All tutorials</a><div class="tdoc-tier-row"><span class="tdoc-tier-chip" id="tdoc-tier-chip"></span><span class="tdoc-meta-chip">- <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="6" cy="6" r="4.5"/><path d="M6 3v3l2 1.5"/></svg>+ <svg+ viewBox="0 0 12 12"+ fill="none"+ stroke="currentColor"+ stroke-width="1.4"+ aria-hidden="true"+ >+ <circle cx="6" cy="6" r="4.5" />+ <path d="M6 3v3l2 1.5" />+ </svg><span id="tdoc-time"></span></span></div>@@ -603,7 +719,9 @@<div class="tdoc-body"><div class="tdoc-body-inner"><article class="tdoc-article" id="tdoc-article">- <span class="tdoc-loading"><span class="tdoc-loading-dot"></span> Loading tutorial…</span>+ <span class="tdoc-loading"+ ><span class="tdoc-loading-dot"></span> Loading tutorial…</span+ ></article><aside class="tdoc-toc" id="tdoc-toc" hidden><p class="tdoc-toc-heading">On this page</p>@@ -640,10 +758,29 @@<h3>Stay in the loop</h3><p>Get updates on new features, agent tooling, and protocol changes.</p><form class="h-footer-newsletter-form" data-newsletter-form novalidate>- <input type="email" class="h-footer-newsletter-input" name="email" placeholder="Enter your email" aria-label="Email address" autocomplete="email" required />- <button type="submit" class="h-footer-newsletter-btn" aria-label="Subscribe">+ <input+ type="email"+ class="h-footer-newsletter-input"+ name="email"+ placeholder="Enter your email"+ aria-label="Email address"+ autocomplete="email"+ required+ />+ <button+ type="submit"+ class="h-footer-newsletter-btn"+ aria-label="Subscribe"+ ><svg viewBox="0 0 16 16" aria-hidden="true">- <path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" d="M2 8h11m0 0L9 4m4 4l-4 4" />+ <path+ fill="none"+ stroke="currentColor"+ stroke-width="1.6"+ stroke-linecap="round"+ stroke-linejoin="round"+ d="M2 8h11m0 0L9 4m4 4l-4 4"+ /></svg></button></form>@@ -652,9 +789,17 @@<div class="h-footer-community"><h3>Join the community</h3><p>Follow along for builds, demos, and conversations with the team.</p>- <a class="h-footer-community-btn" href="https://x.com/trythreews" target="_blank" rel="noopener">+ <a+ class="h-footer-community-btn"+ href="https://x.com/trythreews"+ target="_blank"+ rel="noopener"+ ><svg viewBox="0 0 24 24" aria-hidden="true">- <path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />+ <path+ fill="currentColor"+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"+ /></svg>Follow on X</a>@@ -669,14 +814,32 @@</div><p class="h-footer-tagline">Give your AI a body.</p><div class="h-footer-socials">- <a class="h-footer-social" href="https://x.com/trythreews" target="_blank" rel="noopener" aria-label="three.ws on X">+ <a+ class="h-footer-social"+ href="https://x.com/trythreews"+ target="_blank"+ rel="noopener"+ aria-label="three.ws on X"+ ><svg viewBox="0 0 24 24" aria-hidden="true">- <path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />+ <path+ fill="currentColor"+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"+ /></svg></a>- <a class="h-footer-social" href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener" aria-label="three.ws on GitHub">+ <a+ class="h-footer-social"+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener"+ aria-label="three.ws on GitHub"+ ><svg viewBox="0 0 16 16" aria-hidden="true">- <path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z" />+ <path+ fill="currentColor"+ d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"+ /></svg></a></div>@@ -692,8 +855,18 @@<div class="h-footer-link-col"><h4 class="h-footer-link-heading">Developers</h4><a href="/docs">Docs</a>- <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a>- <a href="https://eips.ethereum.org/EIPS/eip-8004" target="_blank" rel="noopener">ERC-8004</a>+ <a+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener"+ >GitHub</a+ >+ <a+ href="https://eips.ethereum.org/EIPS/eip-8004"+ target="_blank"+ rel="noopener"+ >ERC-8004</a+ ></div><div class="h-footer-link-col"><h4 class="h-footer-link-heading">Resources</h4>@@ -717,8 +890,14 @@(function () {const cursor = document.getElementById('cursor');if (!cursor || !window.matchMedia('(hover: hover)').matches) return;- let x = 0, y = 0, tx = 0, ty = 0;- document.addEventListener('mousemove', (e) => { tx = e.clientX; ty = e.clientY; });+ let x = 0,+ y = 0,+ tx = 0,+ ty = 0;+ document.addEventListener('mousemove', (e) => {+ tx = e.clientX;+ ty = e.clientY;+ });(function loop() {x += (tx - x) * 0.18;y += (ty - y) * 0.18;@@ -727,7 +906,9 @@})();document.querySelectorAll('a,button').forEach((el) => {el.addEventListener('mouseenter', () => cursor.classList.add('cursor--hover'));- el.addEventListener('mouseleave', () => cursor.classList.remove('cursor--hover'));+ el.addEventListener('mouseleave', () =>+ cursor.classList.remove('cursor--hover'),+ );});})();@@ -738,9 +919,17 @@}function escapeHtml(s) {- return String(s).replace(/[&<>"']/g, (c) => ({- '&': '&', '<': '<', '>': '>', '"': '"', "'": '''- }[c]));+ return String(s).replace(+ /[&<>"']/g,+ (c) =>+ ({+ '&': '&',+ '<': '<',+ '>': '>',+ '"': '"',+ "'": ''',+ })[c],+ );}function renderMissing() {@@ -792,7 +981,10 @@}function slugifyHeading(text) {- return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');+ return text+ .toLowerCase()+ .replace(/[^a-z0-9]+/g, '-')+ .replace(/^-|-$/g, '');}function buildToc(article) {@@ -823,9 +1015,7 @@// Scroll-spyconst links = list.querySelectorAll('a');- const linkByTarget = new Map(- Array.from(links).map((a) => [a.dataset.target, a]),- );+ const linkByTarget = new Map(Array.from(links).map((a) => [a.dataset.target, a]));const observer = new IntersectionObserver((entries) => {entries.forEach((entry) => {@@ -849,21 +1039,31 @@const pager = document.createElement('div');pager.className = 'tdoc-pager';pager.innerHTML = `- ${prev- ? `<a href="/tutorials/${prev.slug}" class="tdoc-pager-btn prev"><span class="tdoc-pager-dir">← Previous</span><span class="tdoc-pager-title">${escapeHtml(prev.title)}</span></a>`- : '<div class="tdoc-pager-btn placeholder"></div>'}- ${next- ? `<a href="/tutorials/${next.slug}" class="tdoc-pager-btn next"><span class="tdoc-pager-dir">Next →</span><span class="tdoc-pager-title">${escapeHtml(next.title)}</span></a>`- : '<div class="tdoc-pager-btn placeholder"></div>'}+ ${+ prev+ ? `<a href="/tutorials/${prev.slug}" class="tdoc-pager-btn prev"><span class="tdoc-pager-dir">← Previous</span><span class="tdoc-pager-title">${escapeHtml(prev.title)}</span></a>`+ : '<div class="tdoc-pager-btn placeholder"></div>'+ }+ ${+ next+ ? `<a href="/tutorials/${next.slug}" class="tdoc-pager-btn next"><span class="tdoc-pager-dir">Next →</span><span class="tdoc-pager-title">${escapeHtml(next.title)}</span></a>`+ : '<div class="tdoc-pager-btn placeholder"></div>'+ }`;article.appendChild(pager);}async function loadTutorial() {const slug = currentSlug();- if (!slug) { renderMissing(); return; }+ if (!slug) {+ renderMissing();+ return;+ }const entry = window.tutorialBySlug(slug);- if (!entry) { renderMissing(); return; }+ if (!entry) {+ renderMissing();+ return;+ }setHeroFromManifest(entry);@@ -890,7 +1090,13 @@// Rewrite internal .md links and /docs/* refs so they navigate cleanlyarticle.querySelectorAll('a[href]').forEach((a) => {const h = a.getAttribute('href');- if (!h || h.startsWith('http') || h.startsWith('#') || h.startsWith('mailto:')) return;+ if (+ !h ||+ h.startsWith('http') ||+ h.startsWith('#') ||+ h.startsWith('mailto:')+ )+ return;if (h.endsWith('.md')) {const rel = h.replace(/^\/docs\//, '').replace(/\.md$/, '');if (rel.startsWith('tutorials/')) {@@ -923,5 +1129,5 @@<script src="/brand.js" defer></script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/tutorials.html b/pages/tutorials.htmlindex 532563af2..73035eb4e 100644--- a/pages/tutorials.html+++ b/pages/tutorials.html@@ -6,13 +6,19 @@<title>three.ws — Tutorials</title><meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="author" content="nirholas" />- <meta name="description" content="Tutorials for building 3D agents with three.ws — from a 30-second embed to on-chain identity and paid x402 endpoints." />+ <meta+ name="description"+ content="Tutorials for building 3D agents with three.ws — from a 30-second embed to on-chain identity and paid x402 endpoints."+ /><meta name="theme-color" content="#000000" /><meta property="og:type" content="website" /><meta property="og:site_name" content="three.ws" /><meta property="og:title" content="three.ws — Tutorials" />- <meta property="og:description" content="Tutorials for building 3D agents with three.ws — from a 30-second embed to on-chain identity and paid x402 endpoints." />+ <meta+ property="og:description"+ content="Tutorials for building 3D agents with three.ws — from a 30-second embed to on-chain identity and paid x402 endpoints."+ /><meta property="og:url" content="https://three.ws/tutorials" /><meta property="og:image" content="https://three.ws/og-image.png" /><meta property="og:image:width" content="1200" />@@ -20,7 +26,10 @@<meta name="twitter:card" content="summary_large_image" /><meta name="twitter:title" content="three.ws — Tutorials" />- <meta name="twitter:description" content="Tutorials for building 3D agents with three.ws — from a 30-second embed to on-chain identity and paid x402 endpoints." />+ <meta+ name="twitter:description"+ content="Tutorials for building 3D agents with three.ws — from a 30-second embed to on-chain identity and paid x402 endpoints."+ /><meta name="twitter:image" content="https://three.ws/og-image.png" /><link rel="canonical" href="https://three.ws/tutorials" />@@ -39,7 +48,12 @@<script defer src="/nav.js"></script><script defer src="/footer-newsletter.js"></script><script defer src="/tutorials-manifest.js"></script>- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>html.tutorials-page,@@ -48,7 +62,9 @@height: auto !important;}- .tutorials-page body { display: block; }+ .tutorials-page body {+ display: block;+ }.tut-page {min-height: 100vh;@@ -92,8 +108,16 @@position: absolute;inset: 0;background:- radial-gradient(ellipse 60% 80% at 15% 50%, rgba(255, 255, 255, 0.12) 0%, transparent 60%),- radial-gradient(ellipse 50% 60% at 85% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 55%);+ radial-gradient(+ ellipse 60% 80% at 15% 50%,+ rgba(255, 255, 255, 0.12) 0%,+ transparent 60%+ ),+ radial-gradient(+ ellipse 50% 60% at 85% 20%,+ rgba(255, 255, 255, 0.06) 0%,+ transparent 55%+ );pointer-events: none;}@@ -161,7 +185,10 @@font-weight: 500;color: rgba(255, 255, 255, 0.7);text-decoration: none;- transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;+ transition:+ background 0.15s ease,+ border-color 0.15s ease,+ color 0.15s ease;}.tut-jump:hover {@@ -195,7 +222,9 @@scroll-margin-top: 80px;}- .tut-tier-section:last-child { margin-bottom: 0; }+ .tut-tier-section:last-child {+ margin-bottom: 0;+ }.tut-tier-head {display: flex;@@ -259,7 +288,10 @@border-radius: 12px;padding: 1.4rem 1.5rem 1.25rem;text-decoration: none;- transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;+ transition:+ border-color 0.2s ease,+ transform 0.2s ease,+ background 0.2s ease;position: relative;overflow: hidden;min-height: 200px;@@ -283,7 +315,9 @@background: rgba(255, 255, 255, 0.028);}- .tut-card-link:hover::after { opacity: 1; }+ .tut-card-link:hover::after {+ opacity: 1;+ }.tut-card-meta {display: flex;@@ -340,7 +374,9 @@transition: transform 0.15s ease;}- .tut-card-link:hover .tut-card-cta svg { transform: translateX(3px); }+ .tut-card-link:hover .tut-card-cta svg {+ transform: translateX(3px);+ }/* ── Bottom CTA banner ──────────────────────────────────────── */@@ -389,7 +425,9 @@font-size: 0.87rem;font-weight: 500;text-decoration: none;- transition: background 0.15s ease, border-color 0.15s ease;+ transition:+ background 0.15s ease,+ border-color 0.15s ease;}.tut-bottom-btn.primary {@@ -415,13 +453,27 @@}@media (max-width: 640px) {- .tut-grid { grid-template-columns: 1fr; }- .tut-bottom-cta { flex-direction: column; align-items: flex-start; }+ .tut-grid {+ grid-template-columns: 1fr;+ }+ .tut-bottom-cta {+ flex-direction: column;+ align-items: flex-start;+ }}</style>-- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Tutorials","description":"Step-by-step build guides.","url":"https://three.ws/tutorials","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>-</head>++ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@type": "WebPage",+ "name": "Tutorials",+ "description": "Step-by-step build guides.",+ "url": "https://three.ws/tutorials",+ "isPartOf": { "@type": "WebSite", "name": "three.ws", "url": "https://three.ws" }+ }+ </script>+ </head><body class="home-page tutorials-page tut-page"><div class="cursor" id="cursor" aria-hidden="true"></div><a href="#main-content" class="h-skip-link">Skip to main content</a>@@ -433,7 +485,10 @@<div class="tut-hero-inner"><p class="tut-hero-eyebrow">Tutorials</p><h1>Build with 3D agents</h1>- <p>Twenty-three step-by-step guides — from a one-line embed to a self-hosted backend with on-chain identity and paid x402 endpoints. Pick your tier.</p>+ <p>+ Twenty-three step-by-step guides — from a one-line embed to a self-hosted+ backend with on-chain identity and paid x402 endpoints. Pick your tier.+ </p><div class="tut-hero-jumps" id="tut-hero-jumps"></div></div></div>@@ -472,10 +527,29 @@<h3>Stay in the loop</h3><p>Get updates on new features, agent tooling, and protocol changes.</p><form class="h-footer-newsletter-form" data-newsletter-form novalidate>- <input type="email" class="h-footer-newsletter-input" name="email" placeholder="Enter your email" aria-label="Email address" autocomplete="email" required />- <button type="submit" class="h-footer-newsletter-btn" aria-label="Subscribe">+ <input+ type="email"+ class="h-footer-newsletter-input"+ name="email"+ placeholder="Enter your email"+ aria-label="Email address"+ autocomplete="email"+ required+ />+ <button+ type="submit"+ class="h-footer-newsletter-btn"+ aria-label="Subscribe"+ ><svg viewBox="0 0 16 16" aria-hidden="true">- <path fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" d="M2 8h11m0 0L9 4m4 4l-4 4" />+ <path+ fill="none"+ stroke="currentColor"+ stroke-width="1.6"+ stroke-linecap="round"+ stroke-linejoin="round"+ d="M2 8h11m0 0L9 4m4 4l-4 4"+ /></svg></button></form>@@ -484,9 +558,17 @@<div class="h-footer-community"><h3>Join the community</h3><p>Follow along for builds, demos, and conversations with the team.</p>- <a class="h-footer-community-btn" href="https://x.com/trythreews" target="_blank" rel="noopener">+ <a+ class="h-footer-community-btn"+ href="https://x.com/trythreews"+ target="_blank"+ rel="noopener"+ ><svg viewBox="0 0 24 24" aria-hidden="true">- <path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />+ <path+ fill="currentColor"+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"+ /></svg>Follow on X</a>@@ -501,14 +583,32 @@</div><p class="h-footer-tagline">Give your AI a body.</p><div class="h-footer-socials">- <a class="h-footer-social" href="https://x.com/trythreews" target="_blank" rel="noopener" aria-label="three.ws on X">+ <a+ class="h-footer-social"+ href="https://x.com/trythreews"+ target="_blank"+ rel="noopener"+ aria-label="three.ws on X"+ ><svg viewBox="0 0 24 24" aria-hidden="true">- <path fill="currentColor" d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" />+ <path+ fill="currentColor"+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"+ /></svg></a>- <a class="h-footer-social" href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener" aria-label="three.ws on GitHub">+ <a+ class="h-footer-social"+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener"+ aria-label="three.ws on GitHub"+ ><svg viewBox="0 0 16 16" aria-hidden="true">- <path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z" />+ <path+ fill="currentColor"+ d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"+ /></svg></a></div>@@ -524,8 +624,18 @@<div class="h-footer-link-col"><h4 class="h-footer-link-heading">Developers</h4><a href="/docs">Docs</a>- <a href="https://github.com/nirholas/three.ws" target="_blank" rel="noopener">GitHub</a>- <a href="https://eips.ethereum.org/EIPS/eip-8004" target="_blank" rel="noopener">ERC-8004</a>+ <a+ href="https://github.com/nirholas/three.ws"+ target="_blank"+ rel="noopener"+ >GitHub</a+ >+ <a+ href="https://eips.ethereum.org/EIPS/eip-8004"+ target="_blank"+ rel="noopener"+ >ERC-8004</a+ ></div><div class="h-footer-link-col"><h4 class="h-footer-link-heading">Resources</h4>@@ -549,8 +659,14 @@(function () {const cursor = document.getElementById('cursor');if (!cursor || !window.matchMedia('(hover: hover)').matches) return;- let x = 0, y = 0, tx = 0, ty = 0;- document.addEventListener('mousemove', (e) => { tx = e.clientX; ty = e.clientY; });+ let x = 0,+ y = 0,+ tx = 0,+ ty = 0;+ document.addEventListener('mousemove', (e) => {+ tx = e.clientX;+ ty = e.clientY;+ });(function loop() {x += (tx - x) * 0.18;y += (ty - y) * 0.18;@@ -559,15 +675,25 @@})();document.querySelectorAll('a,button').forEach((el) => {el.addEventListener('mouseenter', () => cursor.classList.add('cursor--hover'));- el.addEventListener('mouseleave', () => cursor.classList.remove('cursor--hover'));+ el.addEventListener('mouseleave', () =>+ cursor.classList.remove('cursor--hover'),+ );});})();// ── Tutorial index renderer ─────────────────────────────────function escapeHtml(s) {- return String(s).replace(/[&<>"']/g, (c) => ({- '&': '&', '<': '<', '>': '>', '"': '"', "'": '''- }[c]));+ return String(s).replace(+ /[&<>"']/g,+ (c) =>+ ({+ '&': '&',+ '<': '<',+ '>': '>',+ '"': '"',+ "'": ''',+ })[c],+ );}function tutorialCardHtml(entry, tierMeta) {@@ -648,5 +774,5 @@<script src="/brand.js" defer></script><div id="footer-container"></div><script src="/footer.js"></script>-</body>+ </body></html>diff --git a/pages/what-is.html b/pages/what-is.htmlindex 47cd45338..d5c91839e 100644--- a/pages/what-is.html+++ b/pages/what-is.html@@ -1,282 +1,439 @@<!doctype html><html lang="en">-<head>- <meta charset="utf-8" />- <meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>What is three.ws? — One platform for 3D AI agents · three.ws</title>- <meta name="description" content="three.ws is one platform for building a 3D AI agent — a character with a face, a brain, and a voice — that you can embed anywhere. See four real ways people use it: support avatars, streamer characters, community mascots, and personal AI agents." />- <meta name="robots" content="index, follow" />- <link rel="canonical" href="https://three.ws/what-is" />+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>What is three.ws? — One platform for 3D AI agents · three.ws</title>+ <meta+ name="description"+ content="three.ws is one platform for building a 3D AI agent — a character with a face, a brain, and a voice — that you can embed anywhere. See four real ways people use it: support avatars, streamer characters, community mascots, and personal AI agents."+ />+ <meta name="robots" content="index, follow" />+ <link rel="canonical" href="https://three.ws/what-is" />- <meta property="og:type" content="website" />- <meta property="og:site_name" content="three.ws" />- <meta property="og:title" content="What is three.ws? — One platform for 3D AI agents" />- <meta property="og:description" content="Build a 3D AI agent with a face, a brain, and a voice — and embed it anywhere. Four real use-cases, one start-free flow." />- <meta property="og:url" content="https://three.ws/what-is" />- <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="What is three.ws? — One platform for 3D AI agents" />- <meta name="twitter:description" content="Build a 3D AI agent with a face, a brain, and a voice — and embed it anywhere." />- <meta name="twitter:image" content="https://three.ws/og-image.png" />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:title" content="What is three.ws? — One platform for 3D AI agents" />+ <meta+ property="og:description"+ content="Build a 3D AI agent with a face, a brain, and a voice — and embed it anywhere. Four real use-cases, one start-free flow."+ />+ <meta property="og:url" content="https://three.ws/what-is" />+ <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="What is three.ws? — One platform for 3D AI agents" />+ <meta+ name="twitter:description"+ content="Build a 3D AI agent with a face, a brain, and a voice — and embed it anywhere."+ />+ <meta name="twitter:image" content="https://three.ws/og-image.png" />- <link rel="icon" href="/favicon.ico" sizes="any" />+ <link rel="icon" href="/favicon.ico" sizes="any" /><link rel="icon" type="image/svg+xml" href="/favicon.svg" /><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" /><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" /><link rel="apple-touch-icon" href="/apple-touch-icon.png" /><link rel="manifest" href="/site.webmanifest" />- <link rel="stylesheet" href="/style.css" />- <link rel="stylesheet" href="/nav.css" />- <link rel="stylesheet" href="/features-landing.css" />- <link rel="stylesheet" href="/what-is.css" />- <link rel="stylesheet" href="/fonts/fonts.css" />+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/features-landing.css" />+ <link rel="stylesheet" href="/what-is.css" />+ <link rel="stylesheet" href="/fonts/fonts.css" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>- <script type="application/ld+json">- {- "@context": "https://schema.org",- "@graph": [- {- "@type": "WebPage",- "name": "What is three.ws?",- "url": "https://three.ws/what-is",- "description": "A plain-language explainer of three.ws — one platform for building and embedding 3D AI agents — with four concrete use-cases."- },- {- "@type": "FAQPage",- "mainEntity": [- {- "@type": "Question",- "name": "Do I need to know about crypto to use three.ws?",- "acceptedAnswer": { "@type": "Answer", "text": "No. You can create an avatar, give it an AI brain, embed it on a website, and chat with it entirely for free, without ever touching crypto. Owning your agent on-chain or charging for it are optional layers you can add later." }- },- {- "@type": "Question",- "name": "What can I actually build with three.ws?",- "acceptedAnswer": { "@type": "Answer", "text": "A 3D AI character with a face, a brain, and a voice — used as a customer-service avatar embedded on a website, a streamer or VTuber avatar that lip-syncs on camera, a 3D mascot and world for a community, or a personal AI assistant you can talk to." }- },- {- "@type": "Question",- "name": "Is everything one platform or separate tools?",- "acceptedAnswer": { "@type": "Answer", "text": "One platform. The avatar creator, animation, AI chat, embeddable widget, 3D worlds, optional token and on-chain identity, and paid APIs are all building blocks that connect to the same agent you create." }- }- ]- }- ]- }- </script>-</head>-<body class="fl-page">- <header><div id="nav-container"></div></header>- <script src="/nav.js"></script>+ <script type="application/ld+json">+ {+ "@context": "https://schema.org",+ "@graph": [+ {+ "@type": "WebPage",+ "name": "What is three.ws?",+ "url": "https://three.ws/what-is",+ "description": "A plain-language explainer of three.ws — one platform for building and embedding 3D AI agents — with four concrete use-cases."+ },+ {+ "@type": "FAQPage",+ "mainEntity": [+ {+ "@type": "Question",+ "name": "Do I need to know about crypto to use three.ws?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "No. You can create an avatar, give it an AI brain, embed it on a website, and chat with it entirely for free, without ever touching crypto. Owning your agent on-chain or charging for it are optional layers you can add later."+ }+ },+ {+ "@type": "Question",+ "name": "What can I actually build with three.ws?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "A 3D AI character with a face, a brain, and a voice — used as a customer-service avatar embedded on a website, a streamer or VTuber avatar that lip-syncs on camera, a 3D mascot and world for a community, or a personal AI assistant you can talk to."+ }+ },+ {+ "@type": "Question",+ "name": "Is everything one platform or separate tools?",+ "acceptedAnswer": {+ "@type": "Answer",+ "text": "One platform. The avatar creator, animation, AI chat, embeddable widget, 3D worlds, optional token and on-chain identity, and paid APIs are all building blocks that connect to the same agent you create."+ }+ }+ ]+ }+ ]+ }+ </script>+ </head>+ <body class="fl-page">+ <header><div id="nav-container"></div></header>+ <script src="/nav.js"></script>- <main class="fl-main" id="main-content">- <nav class="fl-breadcrumb" aria-label="Breadcrumb">- <a href="/">three.ws</a>- <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>- <span class="fl-breadcrumb-current">What is three.ws?</span>- </nav>+ <main class="fl-main" id="main-content">+ <nav class="fl-breadcrumb" aria-label="Breadcrumb">+ <a href="/">three.ws</a>+ <span class="fl-breadcrumb-sep" aria-hidden="true">/</span>+ <span class="fl-breadcrumb-current">What is three.ws?</span>+ </nav>- <!-- Hero -->- <section class="fl-hero" aria-labelledby="wi-hero-h1">- <div class="fl-hero-inner">- <div class="fl-hero-copy">- <span class="fl-eyebrow"><span class="fl-eyebrow-dot" aria-hidden="true"></span>New here? Start here</span>- <h1 id="wi-hero-h1">A 3D AI agent<br>you can use anywhere.</h1>- <p class="fl-hero-sub">three.ws is one platform for making a 3D character that has a face, a brain, and a voice — and putting it to work on your website, your stream, your community, or your desktop.</p>- <div class="fl-hero-actions">- <a href="/create" class="fl-btn-primary">Start free →</a>- <a href="#use-cases" class="fl-btn-ghost">See what you can build</a>- </div>- </div>- <div class="fl-hero-preview" aria-label="Sample 3D avatar preview">- <model-viewer- src="/animations/soldier.glb"- alt="Sample rigged 3D avatar — an example of what you can create"- auto-rotate- auto-rotate-delay="500"- rotation-per-second="12deg"- camera-controls- shadow-intensity="0.5"- environment-image="neutral"- style="background:transparent;width:100%;height:100%;"- ></model-viewer>- <span class="fl-preview-label">Sample avatar · drag to orbit</span>- </div>- </div>- </section>+ <!-- Hero -->+ <section class="fl-hero" aria-labelledby="wi-hero-h1">+ <div class="fl-hero-inner">+ <div class="fl-hero-copy">+ <span class="fl-eyebrow"+ ><span class="fl-eyebrow-dot" aria-hidden="true"></span>New here? Start+ here</span+ >+ <h1 id="wi-hero-h1">A 3D AI agent<br />you can use anywhere.</h1>+ <p class="fl-hero-sub">+ three.ws is one platform for making a 3D character that has a face, a+ brain, and a voice — and putting it to work on your website, your+ stream, your community, or your desktop.+ </p>+ <div class="fl-hero-actions">+ <a href="/create" class="fl-btn-primary">Start free →</a>+ <a href="#use-cases" class="fl-btn-ghost">See what you can build</a>+ </div>+ </div>+ <div class="fl-hero-preview" aria-label="Sample 3D avatar preview">+ <model-viewer+ src="/animations/soldier.glb"+ alt="Sample rigged 3D avatar — an example of what you can create"+ auto-rotate+ auto-rotate-delay="500"+ rotation-per-second="12deg"+ camera-controls+ shadow-intensity="0.5"+ environment-image="neutral"+ style="background: transparent; width: 100%; height: 100%"+ ></model-viewer>+ <span class="fl-preview-label">Sample avatar · drag to orbit</span>+ </div>+ </div>+ </section>- <!-- Plain definition lede -->- <section class="wi-lede fl-section" aria-labelledby="wi-lede-h2">- <h2 id="wi-lede-h2" class="fl-section-label">In one sentence</h2>- <div class="wi-lede-inner">- <p>three.ws lets <strong>anyone</strong> turn a selfie or a description into a <strong>3D AI agent</strong> — a character you can talk to, animate, and embed on any website with two lines of code. <span class="wi-dim">No 3D modelling, no game engine, and no crypto required to start.</span></p>- </div>- </section>+ <!-- Plain definition lede -->+ <section class="wi-lede fl-section" aria-labelledby="wi-lede-h2">+ <h2 id="wi-lede-h2" class="fl-section-label">In one sentence</h2>+ <div class="wi-lede-inner">+ <p>+ three.ws lets <strong>anyone</strong> turn a selfie or a description into a+ <strong>3D AI agent</strong> — a character you can talk to, animate, and+ embed on any website with two lines of code.+ <span class="wi-dim"+ >No 3D modelling, no game engine, and no crypto required to start.</span+ >+ </p>+ </div>+ </section>- <!-- One platform, many pieces -->- <section class="wi-pieces fl-section" aria-labelledby="wi-pieces-h2">- <h2 id="wi-pieces-h2">One platform, not seven tools</h2>- <p class="wi-cases-intro">The avatar creator, the animation, the AI chat, the embed widget, and the worlds are all building blocks for the same agent. Make it once — use it everywhere.</p>- <div class="wi-pieces-grid">- <a class="wi-piece" href="/create">- <span class="wi-piece-ico" aria-hidden="true">◎</span>- <span><span class="wi-piece-t">Avatar creator</span><span class="wi-piece-d">A selfie, a sculpt, or a text prompt → a rigged 3D character</span></span>- </a>- <a class="wi-piece" href="/brain">- <span class="wi-piece-ico" aria-hidden="true">◍</span>- <span><span class="wi-piece-t">AI brain</span><span class="wi-piece-d">Pick the model — Claude, GPT, and more — and give it knowledge</span></span>- </a>- <a class="wi-piece" href="/overlay-control">- <span class="wi-piece-ico" aria-hidden="true">◐</span>- <span><span class="wi-piece-t">Animation & motion</span><span class="wi-piece-d">Lip-sync, emotes, mocap, and an OBS stream overlay</span></span>- </a>- <a class="wi-piece" href="/studio">- <span class="wi-piece-ico" aria-hidden="true">▦</span>- <span><span class="wi-piece-t">Embeddable widget</span><span class="wi-piece-d">Two lines of HTML drop your agent onto any site</span></span>- </a>- <a class="wi-piece" href="/play">- <span class="wi-piece-ico" aria-hidden="true">◇</span>- <span><span class="wi-piece-t">3D worlds</span><span class="wi-piece-d">A space your agent — and your community — can hang out in</span></span>- </a>- <a class="wi-piece" href="/pay">- <span class="wi-piece-ico" aria-hidden="true">◈</span>- <span><span class="wi-piece-t">Optional payments</span><span class="wi-piece-d">Charge per chat, or give your agent its own on-chain identity</span></span>- </a>- </div>- </section>+ <!-- One platform, many pieces -->+ <section class="wi-pieces fl-section" aria-labelledby="wi-pieces-h2">+ <h2 id="wi-pieces-h2">One platform, not seven tools</h2>+ <p class="wi-cases-intro">+ The avatar creator, the animation, the AI chat, the embed widget, and the worlds+ are all building blocks for the same agent. Make it once — use it everywhere.+ </p>+ <div class="wi-pieces-grid">+ <a class="wi-piece" href="/create">+ <span class="wi-piece-ico" aria-hidden="true">◎</span>+ <span+ ><span class="wi-piece-t">Avatar creator</span+ ><span class="wi-piece-d"+ >A selfie, a sculpt, or a text prompt → a rigged 3D character</span+ ></span+ >+ </a>+ <a class="wi-piece" href="/brain">+ <span class="wi-piece-ico" aria-hidden="true">◍</span>+ <span+ ><span class="wi-piece-t">AI brain</span+ ><span class="wi-piece-d"+ >Pick the model — Claude, GPT, and more — and give it+ knowledge</span+ ></span+ >+ </a>+ <a class="wi-piece" href="/overlay-control">+ <span class="wi-piece-ico" aria-hidden="true">◐</span>+ <span+ ><span class="wi-piece-t">Animation & motion</span+ ><span class="wi-piece-d"+ >Lip-sync, emotes, mocap, and an OBS stream overlay</span+ ></span+ >+ </a>+ <a class="wi-piece" href="/studio">+ <span class="wi-piece-ico" aria-hidden="true">▦</span>+ <span+ ><span class="wi-piece-t">Embeddable widget</span+ ><span class="wi-piece-d"+ >Two lines of HTML drop your agent onto any site</span+ ></span+ >+ </a>+ <a class="wi-piece" href="/play">+ <span class="wi-piece-ico" aria-hidden="true">◇</span>+ <span+ ><span class="wi-piece-t">3D worlds</span+ ><span class="wi-piece-d"+ >A space your agent — and your community — can hang out in</span+ ></span+ >+ </a>+ <a class="wi-piece" href="/pay">+ <span class="wi-piece-ico" aria-hidden="true">◈</span>+ <span+ ><span class="wi-piece-t">Optional payments</span+ ><span class="wi-piece-d"+ >Charge per chat, or give your agent its own on-chain identity</span+ ></span+ >+ </a>+ </div>+ </section>- <!-- Use cases -->- <section class="wi-cases fl-section" id="use-cases" aria-labelledby="wi-cases-h2">- <h2 id="wi-cases-h2">Four ways people use it</h2>- <p class="wi-cases-intro">Same platform, very different jobs. Find the one that sounds like you — every step below links to a real, working flow.</p>- <div class="wi-case-grid">+ <!-- Use cases -->+ <section class="wi-cases fl-section" id="use-cases" aria-labelledby="wi-cases-h2">+ <h2 id="wi-cases-h2">Four ways people use it</h2>+ <p class="wi-cases-intro">+ Same platform, very different jobs. Find the one that sounds like you — every+ step below links to a real, working flow.+ </p>+ <div class="wi-case-grid">+ <article class="wi-case">+ <span class="wi-case-who">For businesses</span>+ <h3 class="wi-case-title">A support avatar on your website</h3>+ <p class="wi-case-what">+ A branded 3D greeter that answers your customers' questions 24/7 — a+ friendlier face than a chat bubble, embedded in minutes.+ </p>+ <ol class="wi-case-steps">+ <li>Create an avatar and feed it your FAQ as its brain.</li>+ <li>Copy the two-line embed snippet from Widget Studio.</li>+ <li>Paste it on your site — visitors chat with it instantly.</li>+ </ol>+ <div class="wi-case-actions">+ <a href="/create" class="fl-btn-primary">Build a support avatar →</a>+ <a href="/studio" class="fl-btn-ghost">See Widget Studio</a>+ </div>+ </article>- <article class="wi-case">- <span class="wi-case-who">For businesses</span>- <h3 class="wi-case-title">A support avatar on your website</h3>- <p class="wi-case-what">A branded 3D greeter that answers your customers' questions 24/7 — a friendlier face than a chat bubble, embedded in minutes.</p>- <ol class="wi-case-steps">- <li>Create an avatar and feed it your FAQ as its brain.</li>- <li>Copy the two-line embed snippet from Widget Studio.</li>- <li>Paste it on your site — visitors chat with it instantly.</li>- </ol>- <div class="wi-case-actions">- <a href="/create" class="fl-btn-primary">Build a support avatar →</a>- <a href="/studio" class="fl-btn-ghost">See Widget Studio</a>- </div>- </article>+ <article class="wi-case">+ <span class="wi-case-who">For streamers & creators</span>+ <h3 class="wi-case-title">An on-stream character that's you</h3>+ <p class="wi-case-what">+ A 3D avatar for YouTube or Twitch that lip-syncs your mic and emotes on+ hotkeys — go on camera as a character without a pro VTuber rig.+ </p>+ <ol class="wi-case-steps">+ <li>Scan your selfie into a rigged 3D avatar.</li>+ <li>Add it to OBS as a browser overlay.</li>+ <li>It lip-syncs your voice and reacts to hotkeys, live.</li>+ </ol>+ <div class="wi-case-actions">+ <a href="/scan" class="fl-btn-primary">Scan your avatar →</a>+ <a href="/overlay-control" class="fl-btn-ghost">Open the OBS overlay</a>+ </div>+ </article>- <article class="wi-case">- <span class="wi-case-who">For streamers & creators</span>- <h3 class="wi-case-title">An on-stream character that's you</h3>- <p class="wi-case-what">A 3D avatar for YouTube or Twitch that lip-syncs your mic and emotes on hotkeys — go on camera as a character without a pro VTuber rig.</p>- <ol class="wi-case-steps">- <li>Scan your selfie into a rigged 3D avatar.</li>- <li>Add it to OBS as a browser overlay.</li>- <li>It lip-syncs your voice and reacts to hotkeys, live.</li>- </ol>- <div class="wi-case-actions">- <a href="/scan" class="fl-btn-primary">Scan your avatar →</a>- <a href="/overlay-control" class="fl-btn-ghost">Open the OBS overlay</a>- </div>- </article>+ <article class="wi-case">+ <span class="wi-case-who">For communities</span>+ <h3 class="wi-case-title">A mascot and a world to gather in</h3>+ <p class="wi-case-what">+ A 3D character that represents your community — and its own little world+ people can drop into and hang out, with an optional token if you want+ one.+ </p>+ <ol class="wi-case-steps">+ <li>Forge or create your mascot character.</li>+ <li>Drop it into its own 3D world people can explore.</li>+ <li>Optionally give it a token and on-chain identity.</li>+ </ol>+ <div class="wi-case-actions">+ <a href="/forge" class="fl-btn-primary">Create your mascot →</a>+ <a href="/play" class="fl-btn-ghost">Explore Worlds</a>+ </div>+ </article>- <article class="wi-case">- <span class="wi-case-who">For communities</span>- <h3 class="wi-case-title">A mascot and a world to gather in</h3>- <p class="wi-case-what">A 3D character that represents your community — and its own little world people can drop into and hang out, with an optional token if you want one.</p>- <ol class="wi-case-steps">- <li>Forge or create your mascot character.</li>- <li>Drop it into its own 3D world people can explore.</li>- <li>Optionally give it a token and on-chain identity.</li>- </ol>- <div class="wi-case-actions">- <a href="/forge" class="fl-btn-primary">Create your mascot →</a>- <a href="/play" class="fl-btn-ghost">Explore Worlds</a>- </div>- </article>+ <article class="wi-case">+ <span class="wi-case-who">For builders & tinkerers</span>+ <h3 class="wi-case-title">A personal AI agent with a face</h3>+ <p class="wi-case-what">+ Your own assistant you can actually look at and talk to — pick its+ brain, give it a personality, then chat with it or call it from the API.+ </p>+ <ol class="wi-case-steps">+ <li>Create an agent and choose its brain — Claude, GPT, and more.</li>+ <li>Give it a personality and the knowledge it needs.</li>+ <li>Chat with it, embed it, or drive it from the API.</li>+ </ol>+ <div class="wi-case-actions">+ <a href="/create" class="fl-btn-primary">Make your agent →</a>+ <a href="/chat" class="fl-btn-ghost">Try the chat</a>+ </div>+ </article>+ </div>+ </section>- <article class="wi-case">- <span class="wi-case-who">For builders & tinkerers</span>- <h3 class="wi-case-title">A personal AI agent with a face</h3>- <p class="wi-case-what">Your own assistant you can actually look at and talk to — pick its brain, give it a personality, then chat with it or call it from the API.</p>- <ol class="wi-case-steps">- <li>Create an agent and choose its brain — Claude, GPT, and more.</li>- <li>Give it a personality and the knowledge it needs.</li>- <li>Chat with it, embed it, or drive it from the API.</li>- </ol>- <div class="wi-case-actions">- <a href="/create" class="fl-btn-primary">Make your agent →</a>- <a href="/chat" class="fl-btn-ghost">Try the chat</a>- </div>- </article>+ <!-- FAQ -->+ <section class="fl-faq fl-section" aria-labelledby="wi-faq-h2">+ <h2 id="wi-faq-h2">Common questions</h2>+ <div class="fl-faq-list">+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="wi-faq-1">+ Do I need to know anything about crypto?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="wi-faq-1" role="region">+ No. Creating an avatar, giving it an AI brain, embedding it, and+ chatting with it are all free and crypto-free. Owning your agent+ on-chain or charging per chat are optional layers you can turn on later+ if you ever want them.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="wi-faq-2">+ Is it free to start?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="wi-faq-2" role="region">+ Yes. You can build a 3D agent from a selfie or a text prompt, give it a+ brain, and embed it without paying anything. You only pay if you opt+ into premium generation or run paid services.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="wi-faq-3">+ Do I need 3D modelling or coding skills?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="wi-faq-3" role="region">+ No. The avatar comes from a photo, a sculpt tool, or a text description+ — no Blender, no game engine. Embedding is a copy-paste snippet.+ Developers who want deeper control get an+ <a href="/docs" style="color: var(--ink)">SDK and API</a>, but neither+ is required.+ </div>+ </div>+ <div class="fl-faq-item">+ <button class="fl-faq-q" aria-expanded="false" aria-controls="wi-faq-4">+ Where can I embed or use my agent?+ <svg+ class="fl-faq-chevron"+ viewBox="0 0 16 16"+ fill="none"+ aria-hidden="true"+ >+ <path+ d="M4 6l4 4 4-4"+ stroke="currentColor"+ stroke-width="1.5"+ stroke-linecap="round"+ />+ </svg>+ </button>+ <div class="fl-faq-a" id="wi-faq-4" role="region">+ Any website, via the+ <a href="/studio" style="color: var(--ink)">embed widget</a>; on a live+ stream, via the OBS overlay; in a 3D world on three.ws; or anywhere that+ accepts a standard glTF 2.0 GLB, since that's the format your avatar+ exports to.+ </div>+ </div>+ </div>+ </section>- </div>- </section>+ <!-- Final CTA -->+ <section class="fl-cta-band" aria-labelledby="wi-cta-h2">+ <div class="fl-cta-inner">+ <h2 id="wi-cta-h2">Make one in a few minutes</h2>+ <p>+ Bring a selfie or just an idea. Building your first agent is free — no+ account needed to try.+ </p>+ <div class="fl-cta-actions">+ <a href="/create" class="fl-btn-primary">Start free →</a>+ <a href="/features" class="fl-btn-ghost">Tour every feature</a>+ </div>+ </div>+ </section>+ </main>- <!-- FAQ -->- <section class="fl-faq fl-section" aria-labelledby="wi-faq-h2">- <h2 id="wi-faq-h2">Common questions</h2>- <div class="fl-faq-list">- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="wi-faq-1">- Do I need to know anything about crypto?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="wi-faq-1" role="region">No. Creating an avatar, giving it an AI brain, embedding it, and chatting with it are all free and crypto-free. Owning your agent on-chain or charging per chat are optional layers you can turn on later if you ever want them.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="wi-faq-2">- Is it free to start?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="wi-faq-2" role="region">Yes. You can build a 3D agent from a selfie or a text prompt, give it a brain, and embed it without paying anything. You only pay if you opt into premium generation or run paid services.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="wi-faq-3">- Do I need 3D modelling or coding skills?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="wi-faq-3" role="region">No. The avatar comes from a photo, a sculpt tool, or a text description — no Blender, no game engine. Embedding is a copy-paste snippet. Developers who want deeper control get an <a href="/docs" style="color:var(--ink)">SDK and API</a>, but neither is required.</div>- </div>- <div class="fl-faq-item">- <button class="fl-faq-q" aria-expanded="false" aria-controls="wi-faq-4">- Where can I embed or use my agent?- <svg class="fl-faq-chevron" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>- </button>- <div class="fl-faq-a" id="wi-faq-4" role="region">Any website, via the <a href="/studio" style="color:var(--ink)">embed widget</a>; on a live stream, via the OBS overlay; in a 3D world on three.ws; or anywhere that accepts a standard glTF 2.0 GLB, since that's the format your avatar exports to.</div>- </div>- </div>- </section>-- <!-- Final CTA -->- <section class="fl-cta-band" aria-labelledby="wi-cta-h2">- <div class="fl-cta-inner">- <h2 id="wi-cta-h2">Make one in a few minutes</h2>- <p>Bring a selfie or just an idea. Building your first agent is free — no account needed to try.</p>- <div class="fl-cta-actions">- <a href="/create" class="fl-btn-primary">Start free →</a>- <a href="/features" class="fl-btn-ghost">Tour every feature</a>- </div>- </div>- </section>- </main>-- <script>- document.querySelectorAll('.fl-faq-q').forEach(btn => {- btn.addEventListener('click', () => {- const expanded = btn.getAttribute('aria-expanded') === 'true';- btn.setAttribute('aria-expanded', String(!expanded));- const panel = document.getElementById(btn.getAttribute('aria-controls'));- if (panel) panel.classList.toggle('open', !expanded);- });- });- </script>- <div id="footer-container"></div>- <script src="/footer.js"></script>-</body>+ <script>+ document.querySelectorAll('.fl-faq-q').forEach((btn) => {+ btn.addEventListener('click', () => {+ const expanded = btn.getAttribute('aria-expanded') === 'true';+ btn.setAttribute('aria-expanded', String(!expanded));+ const panel = document.getElementById(btn.getAttribute('aria-controls'));+ if (panel) panel.classList.toggle('open', !expanded);+ });+ });+ </script>+ <div id="footer-container"></div>+ <script src="/footer.js"></script>+ </body></html>diff --git a/pages/worlds.html b/pages/worlds.htmlindex 874b21684..50579286b 100644--- a/pages/worlds.html+++ b/pages/worlds.html@@ -4,10 +4,7 @@<meta charset="utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge" /><title>Worlds · Coin Communities — three.ws</title>- <meta- name="viewport"- content="width=device-width, initial-scale=1.0, viewport-fit=cover"- />+ <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /><meta name="author" content="three.ws" /><metaname="description"@@ -31,16 +28,24 @@/><meta property="og:url" content="https://three.ws/worlds" /><meta name="twitter:card" content="summary_large_image" />- <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:site" content="@trythreews" />- <meta name="twitter:title" content="Worlds · Coin Communities — three.ws" />- <meta name="twitter:description" content="Explore 3D worlds built around coin communities on three.ws." />- <meta name="twitter:image" content="https://three.ws/og-image.png" />+ <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:site" content="@trythreews" />+ <meta name="twitter:title" content="Worlds · Coin Communities — three.ws" />+ <meta+ name="twitter:description"+ content="Explore 3D worlds built around coin communities on three.ws."+ />+ <meta name="twitter:image" content="https://three.ws/og-image.png" /><!-- model-viewer powers the live avatar preview in the onboarding panel. -->- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js"></script>+ <script+ type="module"+ src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js"+ integrity="sha384-Ftcjj/GNLxPvzNDftO/oryXB9aGxsGZY9JGqsXG0uUKgQDl9RfDgsx9NJ/4IVNPe"+ crossorigin="anonymous"+ ></script><style>:root {@@ -58,20 +63,37 @@--danger: #f87171;--ok: #4ade80;}- * { box-sizing: border-box; }- html, body {+ * {+ box-sizing: border-box;+ }+ html,+ body {margin: 0;padding: 0;min-height: 100%;background:- radial-gradient(1200px 600px at 70% -10%, rgba(129, 140, 248, 0.14), transparent 60%),- radial-gradient(900px 500px at 10% 0%, rgba(34, 211, 238, 0.10), transparent 55%),+ radial-gradient(+ 1200px 600px at 70% -10%,+ rgba(129, 140, 248, 0.14),+ transparent 60%+ ),+ radial-gradient(+ 900px 500px at 10% 0%,+ rgba(34, 211, 238, 0.1),+ transparent 55%+ ),var(--bg);color: var(--text);- font-family: 'Inter', system-ui, -apple-system, sans-serif;+ font-family:+ 'Inter',+ system-ui,+ -apple-system,+ sans-serif;-webkit-font-smoothing: antialiased;}- a { color: inherit; }+ a {+ color: inherit;+ }.wl-shell {max-width: 1200px;@@ -94,9 +116,17 @@font-size: 15px;letter-spacing: 0.01em;}- .wl-brand a { color: var(--text); text-decoration: none; }- .wl-brand span { color: var(--text-3); font-weight: 500; }- .wl-top-spacer { flex: 1; }+ .wl-brand a {+ color: var(--text);+ text-decoration: none;+ }+ .wl-brand span {+ color: var(--text-3);+ font-weight: 500;+ }+ .wl-top-spacer {+ flex: 1;+ }.wl-top-link {color: var(--text-2);text-decoration: none;@@ -104,12 +134,21 @@padding: 7px 12px;border-radius: 999px;border: 1px solid var(--border);- transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;+ transition:+ color 0.12s ease,+ border-color 0.12s ease,+ background 0.12s ease;+ }+ .wl-top-link:hover {+ color: var(--text);+ border-color: var(--border-strong);+ background: rgba(255, 255, 255, 0.04);}- .wl-top-link:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255,255,255,0.04); }/* ── Hero ────────────────────────────────────────────── */- .wl-hero { margin-bottom: 28px; }+ .wl-hero {+ margin-bottom: 28px;+ }.wl-hero h1 {margin: 0 0 10px;font-size: clamp(28px, 5vw, 46px);@@ -155,7 +194,12 @@text-transform: uppercase;color: var(--text-3);}- .wl-panel .wl-hint { margin: 0 0 14px; color: var(--text-3); font-size: 12.5px; line-height: 1.5; }+ .wl-panel .wl-hint {+ margin: 0 0 14px;+ color: var(--text-3);+ font-size: 12.5px;+ line-height: 1.5;+ }.wl-avatar {display: grid;@@ -170,18 +214,40 @@border-radius: 14px;overflow: hidden;background:- radial-gradient(120px 80px at 50% 20%, rgba(129,140,248,0.18), transparent 70%),+ radial-gradient(+ 120px 80px at 50% 20%,+ rgba(129, 140, 248, 0.18),+ transparent 70%+ ),var(--panel-2);border: 1px solid var(--border);display: flex;align-items: center;justify-content: center;}- .wl-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }- .wl-avatar-ph { width: 46px; height: 46px; color: var(--text-3); }- .wl-avatar-ph svg { width: 100%; height: 100%; }- .wl-avatar-name { font-weight: 650; font-size: 16px; }- .wl-avatar-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }+ .wl-avatar-preview img {+ width: 100%;+ height: 100%;+ object-fit: cover;+ }+ .wl-avatar-ph {+ width: 46px;+ height: 46px;+ color: var(--text-3);+ }+ .wl-avatar-ph svg {+ width: 100%;+ height: 100%;+ }+ .wl-avatar-name {+ font-weight: 650;+ font-size: 16px;+ }+ .wl-avatar-sub {+ color: var(--text-3);+ font-size: 12px;+ margin-top: 2px;+ }.wl-quick {display: grid;@@ -202,15 +268,48 @@padding: 9px 11px;border-radius: 10px;cursor: pointer;- transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;+ transition:+ border-color 0.12s ease,+ color 0.12s ease,+ background 0.12s ease;+ }+ .wl-quick-btn:hover {+ color: var(--text);+ border-color: var(--border-strong);+ background: rgba(255, 255, 255, 0.04);+ }+ .wl-quick-btn.is-on {+ border-color: var(--accent);+ color: var(--text);+ box-shadow: 0 0 0 1px var(--accent) inset;+ }+ .wl-quick-btn:disabled {+ opacity: 0.5;+ cursor: wait;+ }+ .wl-quick-dot {+ width: 8px;+ height: 8px;+ border-radius: 50%;+ background: linear-gradient(135deg, var(--accent), var(--accent-2));+ flex: none;}- .wl-quick-btn:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255,255,255,0.04); }- .wl-quick-btn.is-on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 1px var(--accent) inset; }- .wl-quick-btn:disabled { opacity: 0.5; cursor: wait; }- .wl-quick-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex: none; }- .wl-or { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 11px; margin: 12px 0; }- .wl-or::before, .wl-or::after { content: ''; height: 1px; background: var(--border); flex: 1; }+ .wl-or {+ display: flex;+ align-items: center;+ gap: 10px;+ color: var(--text-3);+ font-size: 11px;+ margin: 12px 0;+ }+ .wl-or::before,+ .wl-or::after {+ content: '';+ height: 1px;+ background: var(--border);+ flex: 1;+ }.wl-input {width: 100%;@@ -221,14 +320,36 @@padding: 10px 12px;font: inherit;font-size: 13px;- transition: border-color 0.12s ease, background 0.12s ease;+ transition:+ border-color 0.12s ease,+ background 0.12s ease;+ }+ .wl-input::placeholder {+ color: var(--text-3);+ }+ .wl-input:focus {+ outline: none;+ border-color: var(--accent);+ background: rgba(255, 255, 255, 0.05);}- .wl-input::placeholder { color: var(--text-3); }- .wl-input:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,0.05); }- .wl-id-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 10px; }- .wl-field { margin-bottom: 12px; }- .wl-field label { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 5px; letter-spacing: 0.03em; text-transform: uppercase; }+ .wl-id-form {+ display: grid;+ grid-template-columns: 1fr auto;+ gap: 8px;+ margin-bottom: 10px;+ }+ .wl-field {+ margin-bottom: 12px;+ }+ .wl-field label {+ display: block;+ font-size: 11px;+ color: var(--text-3);+ margin-bottom: 5px;+ letter-spacing: 0.03em;+ text-transform: uppercase;+ }.wl-btn {appearance: none;@@ -241,24 +362,52 @@padding: 10px 14px;border-radius: 10px;cursor: pointer;- transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;+ transition:+ background 0.12s ease,+ border-color 0.12s ease,+ transform 0.08s ease;+ }+ .wl-btn:hover {+ background: rgba(255, 255, 255, 0.07);+ }+ .wl-btn:active {+ transform: translateY(1px);+ }+ .wl-btn:disabled {+ opacity: 0.5;+ cursor: wait;}- .wl-btn:hover { background: rgba(255,255,255,0.07); }- .wl-btn:active { transform: translateY(1px); }- .wl-btn:disabled { opacity: 0.5; cursor: wait; }.wl-btn-primary {border: none;background: linear-gradient(135deg, var(--accent), var(--accent-2));color: #0e0e0e;font-weight: 700;}- .wl-btn-primary:hover { filter: brightness(1.08); }- .wl-btn-block { width: 100%; }- .wl-btn-ghost { background: transparent; }+ .wl-btn-primary:hover {+ filter: brightness(1.08);+ }+ .wl-btn-block {+ width: 100%;+ }+ .wl-btn-ghost {+ background: transparent;+ }- .wl-panel-actions { display: grid; gap: 8px; margin-top: 6px; }- .wl-create-link { text-align: center; color: var(--text-3); font-size: 12px; text-decoration: none; padding: 4px; }- .wl-create-link:hover { color: var(--text-2); }+ .wl-panel-actions {+ display: grid;+ gap: 8px;+ margin-top: 6px;+ }+ .wl-create-link {+ text-align: center;+ color: var(--text-3);+ font-size: 12px;+ text-decoration: none;+ padding: 4px;+ }+ .wl-create-link:hover {+ color: var(--text-2);+ }/* ── Worlds column ───────────────────────────────────── */.wl-worlds-head {@@ -267,9 +416,18 @@gap: 12px;margin-bottom: 14px;}- .wl-worlds-head h2 { margin: 0; font-size: 18px; font-weight: 700; }- .wl-worlds-count { color: var(--text-3); font-size: 13px; }- .wl-worlds-head .wl-top-spacer { flex: 1; }+ .wl-worlds-head h2 {+ margin: 0;+ font-size: 18px;+ font-weight: 700;+ }+ .wl-worlds-count {+ color: var(--text-3);+ font-size: 13px;+ }+ .wl-worlds-head .wl-top-spacer {+ flex: 1;+ }.wl-search {width: 220px;max-width: 50vw;@@ -281,7 +439,10 @@font: inherit;font-size: 13px;}- .wl-search:focus { outline: none; border-color: var(--border-strong); }+ .wl-search:focus {+ outline: none;+ border-color: var(--border-strong);+ }.wl-grid {display: grid;@@ -300,14 +461,20 @@color: var(--text);display: flex;flex-direction: column;- transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;+ transition:+ transform 0.14s ease,+ border-color 0.14s ease,+ box-shadow 0.14s ease;}.wl-card:hover {transform: translateY(-3px);border-color: var(--border-strong);box-shadow: 0 14px 40px -20px rgba(34, 211, 238, 0.5);}- .wl-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }+ .wl-card:focus-visible {+ outline: 2px solid var(--accent);+ outline-offset: 2px;+ }.wl-card-art {position: relative;aspect-ratio: 1 / 1;@@ -316,7 +483,11 @@align-items: center;justify-content: center;}- .wl-card-art img { width: 100%; height: 100%; object-fit: cover; }+ .wl-card-art img {+ width: 100%;+ height: 100%;+ object-fit: cover;+ }.wl-card-art-ph {font-weight: 800;font-size: 26px;@@ -331,7 +502,7 @@display: inline-flex;align-items: center;gap: 5px;- background: rgba(0,0,0,0.6);+ background: rgba(0, 0, 0, 0.6);border: 1px solid var(--border);border-radius: 999px;padding: 3px 8px;@@ -339,14 +510,53 @@color: var(--text-2);backdrop-filter: blur(6px);}- .wl-live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(74,222,128,0.6); animation: wl-pulse 2s infinite; }- @keyframes wl-pulse { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); } 70% { box-shadow: 0 0 0 6px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }- .wl-card-body { padding: 11px 12px 6px; }- .wl-card-sym { font-weight: 700; font-size: 15px; }- .wl-card-stats { display: flex; gap: 12px; margin-top: 7px; color: var(--text-3); font-size: 12px; }- .wl-stat { display: inline-flex; align-items: center; gap: 4px; }- .wl-stat-i { width: 13px; height: 13px; display: inline-flex; }- .wl-stat-i svg { width: 100%; height: 100%; }+ .wl-live-dot {+ width: 6px;+ height: 6px;+ border-radius: 50%;+ background: var(--ok);+ box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);+ animation: wl-pulse 2s infinite;+ }+ @keyframes wl-pulse {+ 0% {+ box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);+ }+ 70% {+ box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);+ }+ 100% {+ box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);+ }+ }+ .wl-card-body {+ padding: 11px 12px 6px;+ }+ .wl-card-sym {+ font-weight: 700;+ font-size: 15px;+ }+ .wl-card-stats {+ display: flex;+ gap: 12px;+ margin-top: 7px;+ color: var(--text-3);+ font-size: 12px;+ }+ .wl-stat {+ display: inline-flex;+ align-items: center;+ gap: 4px;+ }+ .wl-stat-i {+ width: 13px;+ height: 13px;+ display: inline-flex;+ }+ .wl-stat-i svg {+ width: 100%;+ height: 100%;+ }.wl-card-enter {padding: 8px 12px 12px;color: var(--accent);@@ -354,13 +564,36 @@font-weight: 600;opacity: 0;transform: translateX(-4px);- transition: opacity 0.14s ease, transform 0.14s ease;+ transition:+ opacity 0.14s ease,+ transform 0.14s ease;+ }+ .wl-card:hover .wl-card-enter {+ opacity: 1;+ transform: none;}- .wl-card:hover .wl-card-enter { opacity: 1; transform: none; }/* skeletons */- .wl-skel { pointer-events: none; height: 248px; background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: wl-shimmer 1.3s infinite; }- @keyframes wl-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }+ .wl-skel {+ pointer-events: none;+ height: 248px;+ background: linear-gradient(+ 100deg,+ var(--panel) 30%,+ var(--panel-2) 50%,+ var(--panel) 70%+ );+ background-size: 200% 100%;+ animation: wl-shimmer 1.3s infinite;+ }+ @keyframes wl-shimmer {+ 0% {+ background-position: 200% 0;+ }+ 100% {+ background-position: -200% 0;+ }+ }.wl-empty {grid-column: 1 / -1;@@ -368,15 +601,42 @@padding: 48px 20px;border: 1px dashed var(--border);border-radius: 16px;- background: rgba(255,255,255,0.015);+ background: rgba(255, 255, 255, 0.015);+ }+ .wl-empty-icon {+ width: 44px;+ height: 44px;+ margin: 0 auto 14px;+ color: var(--text-3);+ }+ .wl-empty-icon svg {+ width: 100%;+ height: 100%;+ }+ .wl-empty h3 {+ margin: 0 0 8px;+ font-size: 18px;+ }+ .wl-empty p {+ margin: 0 auto 18px;+ color: var(--text-2);+ max-width: 440px;+ font-size: 14px;+ line-height: 1.5;}- .wl-empty-icon { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--text-3); }- .wl-empty-icon svg { width: 100%; height: 100%; }- .wl-empty h3 { margin: 0 0 8px; font-size: 18px; }- .wl-empty p { margin: 0 auto 18px; color: var(--text-2); max-width: 440px; font-size: 14px; line-height: 1.5; }- .wl-mint-form { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 6px; max-width: 520px; margin-left: auto; margin-right: auto; }- .wl-mint-form .wl-input { flex: 1; }+ .wl-mint-form {+ grid-column: 1 / -1;+ display: flex;+ gap: 8px;+ margin-top: 6px;+ max-width: 520px;+ margin-left: auto;+ margin-right: auto;+ }+ .wl-mint-form .wl-input {+ flex: 1;+ }/* toast */.wl-toast {@@ -384,7 +644,7 @@left: 50%;bottom: 26px;transform: translate(-50%, 20px);- background: rgba(10,10,14,0.92);+ background: rgba(10, 10, 14, 0.92);border: 1px solid var(--border-strong);color: var(--text);padding: 10px 16px;@@ -392,17 +652,32 @@font-size: 13px;opacity: 0;pointer-events: none;- transition: opacity 0.2s ease, transform 0.2s ease;+ transition:+ opacity 0.2s ease,+ transform 0.2s ease;backdrop-filter: blur(10px);z-index: 50;}- .wl-toast.show { opacity: 1; transform: translate(-50%, 0); }- .wl-toast[data-kind="error"] { border-color: rgba(248,113,113,0.5); color: #fecaca; }- .wl-toast[data-kind="ok"] { border-color: rgba(74,222,128,0.5); color: #bbf7d0; }+ .wl-toast.show {+ opacity: 1;+ transform: translate(-50%, 0);+ }+ .wl-toast[data-kind='error'] {+ border-color: rgba(248, 113, 113, 0.5);+ color: #fecaca;+ }+ .wl-toast[data-kind='ok'] {+ border-color: rgba(74, 222, 128, 0.5);+ color: #bbf7d0;+ }@media (max-width: 820px) {- .wl-layout { grid-template-columns: 1fr; }- .wl-panel { position: static; }+ .wl-layout {+ grid-template-columns: 1fr;+ }+ .wl-panel {+ position: static;+ }}</style></head>@@ -420,7 +695,10 @@<header class="wl-hero"><h1>Every coin is a <span class="grad">world</span>.</h1>- <p>Drop in your avatar or 3D agent — no sign-in — and hang out with the community inside its own live, multiplayer 3D world.</p>+ <p>+ Drop in your avatar or 3D agent — no sign-in — and hang out with the community+ inside its own live, multiplayer 3D world.+ </p></header><div class="wl-layout">@@ -433,23 +711,47 @@<div class="wl-quick" id="wl-quick"></div>- <button type="button" id="wl-browse" class="wl-btn wl-btn-block">Browse avatars & agents</button>+ <button type="button" id="wl-browse" class="wl-btn wl-btn-block">+ Browse avatars & agents+ </button><div class="wl-or">or drop one in</div><form class="wl-id-form" id="wl-id-form">- <input type="text" id="wl-id-input" class="wl-input" placeholder="three.ws avatar / agent ID" autocomplete="off" aria-label="Avatar or agent ID" />+ <input+ type="text"+ id="wl-id-input"+ class="wl-input"+ placeholder="three.ws avatar / agent ID"+ autocomplete="off"+ aria-label="Avatar or agent ID"+ /><button type="submit" id="wl-id-btn" class="wl-btn">Load</button></form><div class="wl-field"><label for="wl-name">Display name</label>- <input type="text" id="wl-name" class="wl-input" maxlength="24" placeholder="guest" autocomplete="off" />+ <input+ type="text"+ id="wl-name"+ class="wl-input"+ maxlength="24"+ placeholder="guest"+ autocomplete="off"+ /></div><div class="wl-panel-actions">- <button type="button" id="wl-enter-mainland" class="wl-btn wl-btn-primary wl-btn-block">Enter the mainland →</button>- <a class="wl-create-link" id="wl-create-link" href="/create">No avatar? Make one in seconds →</a>+ <button+ type="button"+ id="wl-enter-mainland"+ class="wl-btn wl-btn-primary wl-btn-block"+ >+ Enter the mainland →+ </button>+ <a class="wl-create-link" id="wl-create-link" href="/create"+ >No avatar? Make one in seconds →</a+ ></div></aside>@@ -459,7 +761,14 @@<h2>Live worlds</h2><span class="wl-worlds-count" id="wl-worlds-count"></span><span class="wl-top-spacer"></span>- <input type="search" id="wl-search" class="wl-search" placeholder="Search by symbol or mint…" aria-label="Search worlds" autocomplete="off" />+ <input+ type="search"+ id="wl-search"+ class="wl-search"+ placeholder="Search by symbol or mint…"+ aria-label="Search worlds"+ autocomplete="off"+ /></div><div class="wl-grid" id="wl-worlds"></div></main>@@ -470,5 +779,5 @@<script type="module" src="/src/worlds-lobby.js"></script><script src="/brand.js" defer></script>-</body>+ </body></html>diff --git a/public/buttons.css b/public/buttons.cssindex e6f589587..877d12d20 100644--- a/public/buttons.css+++ b/public/buttons.css@@ -95,12 +95,12 @@position: relative;overflow: hidden;transition:- background 0.18s ease,- border-color 0.18s ease,- color 0.18s ease,- opacity 0.18s ease,- transform 0.1s ease,- box-shadow 0.18s ease;+ background var(--duration-fast, 140ms) var(--ease-standard, ease),+ border-color var(--duration-fast, 140ms) var(--ease-standard, ease),+ color var(--duration-fast, 140ms) var(--ease-standard, ease),+ opacity var(--duration-fast, 140ms) var(--ease-standard, ease),+ transform var(--duration-instant, 80ms) var(--ease-standard, ease),+ box-shadow var(--duration-fast, 140ms) var(--ease-standard, ease);}/* ── Hover ────────────────────────────────────────────────────────────────── */@@ -232,7 +232,7 @@}/* ── Optional arrow microinteraction — a trailing → that slides on hover ───── */-.btn .arrow { transition: transform 0.18s ease; }+.btn .arrow { transition: transform var(--duration-fast, 140ms) var(--ease-standard, ease); }.btn:hover .arrow { transform: translateX(3px); }@media (prefers-reduced-motion: reduce) {diff --git a/public/changelog.json b/public/changelog.jsonnew file mode 100644index 000000000..9b926c13c--- /dev/null+++ b/public/changelog.json@@ -0,0 +1,1339 @@+{+ "generated_at": "2026-06-11T01:05:35.264Z",+ "generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",+ "site": {+ "name": "three.ws",+ "url": "https://three.ws"+ },+ "entries": [+ {+ "date": "2026-06-11",+ "type": "update",+ "title": "Faster, quieter agents directory and site-wide page polish",+ "summary": "The on-chain agents directory now loads from our server-side index instead of contacting every agent's metadata host from your browser — pages render faster and no longer spray network errors. Also: the pump.fun cockpit's sidebar pages are now shareable deep links, mobile nav and footer links meet touch-target guidelines, anonymous visitors no longer trigger failed sign-in requests on Walk and Create, and assorted dead links were removed.",+ "link": "/agents",+ "tags": [+ "improvement",+ "fix"+ ]+ },+ {+ "date": "2026-06-11",+ "type": "update",+ "title": "Text-to-3D and image-to-3D generation restored",+ "summary": "Fixed two provider regressions that blocked Forge generation: model submissions now pin the latest published model version automatically, and the text-to-image step falls back to a healthy provider instead of failing when the preferred one is misconfigured.",+ "link": "/forge",+ "tags": [+ "fix"+ ]+ },+ {+ "date": "2026-06-10",+ "type": "update",+ "title": "WebRTC relay and x402 telemetry",+ "summary": "Added a Session Description Protocol relay for WebRTC handshakes and instrumented every paid x402 surface for Provider Hub telemetry, with hardened rate limiting.",+ "link": null,+ "tags": [+ "feature",+ "infra"+ ]+ },+ {+ "date": "2026-06-09",+ "type": "launch",+ "title": "Agent Lookup",+ "summary": "Resolve any three.ws agent by Solana mint, agent ID, avatar ID, or slug — renders its interactive 3D avatar alongside its on-chain identity (collection, owner, agent wallet, Active/x402 status, Metaplex/Solscan/Magic Eden links).",+ "link": "/lookup",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-09",+ "type": "update",+ "title": "New Claude models in every agent brain",+ "summary": "Claude Fable 5 and Mythos 5 are now available across agent brain selectors, pricing tables, and the x402 provider catalog.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-08",+ "type": "update",+ "title": "Bounty board with AI judge",+ "summary": "Bounty submissions now support liking, AI-powered scoring, and per-bounty leaderboards — submissions are ranked by a platform-powered judge.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-08",+ "type": "update",+ "title": "Public agent profiles with shared memories",+ "summary": "Agents can now have public profile pages that surface their shared memories, plus Replicate model provider support and public agent directory resolution.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-07",+ "type": "update",+ "title": "AIXBT market intelligence for agents",+ "summary": "Agents and in-world NPCs can now tap AIXBT market intelligence — token analysis, project data, and grounding served through new API endpoints.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-06",+ "type": "update",+ "title": "Forge editing upgrades",+ "summary": "Forge gained an animation system, pose studio, magic-brush stylization, multi-view rendering, and faster segment/animate/texture workers.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-06-06",+ "type": "update",+ "title": "IBM Granite models over MCP and x402",+ "summary": "Published an MCP package exposing IBM Granite chat, code, embedding, and forecasting models with x402 pay-per-call routing.",+ "link": null,+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Agent Exchange — AI Agents Paying Each Other",+ "summary": "Watch two AI agents with 3D avatars autonomously negotiate and pay each other for crypto intelligence via x402 micropayments on Solana.",+ "link": "/features/agent-exchange",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Deploy — On-Chain Agent Identity",+ "summary": "Register your AI agent on Solana via ERC-8004 and Metaplex Core. Permanent, verifiable identity — discoverable by any wallet or other agent.",+ "link": "/features/deploy",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Docs · Do I Need Crypto?",+ "summary": "Honest answers to the wallet and payment questions — what requires crypto, what doesn’t, and how payments work.",+ "link": "/docs/do-i-need-crypto",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Docs · Make Your First Agent",+ "summary": "Step-by-step guide to creating a 3D AI agent in the browser with no code required.",+ "link": "/docs/make-your-agent",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Docs · Share & Embed",+ "summary": "Three ways to put your agent in front of people: share a link, embed an iframe, or use the web component.",+ "link": "/docs/share-and-embed",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Docs · Start Here",+ "summary": "Plain-language introduction to three.ws for creators and non-developers — what it is, who it’s for, and where to begin.",+ "link": "/docs/start-here",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Forge — Text to 3D Model",+ "summary": "Type a description, get a downloadable textured 3D model (GLB). Powered by Flux image generation and TRELLIS 3D reconstruction.",+ "link": "/features/forge",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Labs Showcase",+ "summary": "A curated gallery of three.ws's most powerful — and most hidden — features. Find and try things you didn't know existed.",+ "link": "/labs",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Marketplace — Discover and Fork AI Agents",+ "summary": "Browse hundreds of community-built AI agents with 3D avatars and on-chain identities. Fork any agent, buy paid skills, and ship in minutes.",+ "link": "/features/marketplace",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Play — Live 3D Coin Worlds",+ "summary": "Every pump.fun coin gets a deterministic 3D world. Walk in as your avatar, chat with holders, and trade — all in the browser.",+ "link": "/features/play",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Pole Club",+ "summary": "A 3D club where dancers only perform when you send a micro-tip. Pay $0.001 per routine, settled on-chain via x402 on Base or Solana.",+ "link": "/club",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Scan — Selfie to 3D Avatar",+ "summary": "Point your camera at your face, hold still, and walk away with a rigged 3D avatar in 60 seconds. Free, in your browser.",+ "link": "/features/scan",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Studio — Embeddable AI Widget Builder",+ "summary": "Configure avatar, voice, and knowledge base in the Widget Studio, then copy one script tag to embed a 3D AI agent anywhere.",+ "link": "/features/studio",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Voice Lab",+ "summary": "Clone your voice from a short recording, then use it for TTS or give it to your agent. Side-by-side comparison of voice models.",+ "link": "/voice",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "launch",+ "title": "Walk — 3D Avatar AR",+ "summary": "Drive your AI agent's 3D avatar with WASD or joystick. Toggle AR mode and it walks on your real floor through your phone camera.",+ "link": "/features/walk",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "update",+ "title": "Cosmetics economy in the game world",+ "summary": "A cosmetics shop inside the 3D game world — buy avatar customizations via x402, trade them peer-to-peer, and earn from cosmetics usage.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "update",+ "title": "Privy wallet sign-in",+ "summary": "Wallet-native sign-in via Privy with JWKS verification and DID linking — log in securely without managing passwords.",+ "link": null,+ "tags": [+ "feature",+ "security"+ ]+ },+ {+ "date": "2026-06-05",+ "type": "update",+ "title": "Pump.fun autopilot and guided agent creation",+ "summary": "Automated token launching and trading via pump.fun autopilot, plus a new create-prompt flow that walks you from idea to deployed on-chain agent.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-03",+ "type": "launch",+ "title": "three.ws on IBM watsonx — Agent Galaxy",+ "summary": "three.ws is an IBM Business Partner. Open-source 3D AI agents that think on IBM Granite via watsonx.ai and give watsonx Orchestrate agents a face, voice, and on-chain identity.",+ "link": "/ibm/galaxy",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-06-03",+ "type": "update",+ "title": "Autonomous agent-to-agent trading",+ "summary": "Agents can now negotiate with each other, pay for crypto intelligence via x402 micropayments, and settle on-chain — fully autonomously.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-03",+ "type": "update",+ "title": "Voice cloning and real-time lip-sync",+ "summary": "ElevenLabs text-to-speech is now wired through the platform: voice cloning, real-time lip-sync, and per-voice settings for every agent.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-03",+ "type": "update",+ "title": "x402 payment hardening",+ "summary": "Hardened payment processing with Solana transaction confirmation, replay-attack guards, payment-intent deduplication, and sanitized errors across MCP bridges.",+ "link": null,+ "tags": [+ "security",+ "fix"+ ]+ },+ {+ "date": "2026-06-02",+ "type": "update",+ "title": "Every agent gets its own wallet",+ "summary": "Each agent now has a deterministic Solana wallet for self-custodied payments — agents can send SOL and settle x402 transactions autonomously.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-02",+ "type": "update",+ "title": "Four production MCP servers",+ "summary": "3D Studio (text-to-3D, model inspection), x402 Bazaar (service discovery and payment), IBM watsonx (LLM access), and Pump.fun (token operations) — all published with manifests and docs.",+ "link": "/docs/mcp",+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-06-01",+ "type": "update",+ "title": "City world",+ "summary": "An isometric 3D city with player movement, collision, minimap, and avatar animation — a new kind of world to explore as your agent.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-06-01",+ "type": "update",+ "title": "Quests, loot, mounts, and realms",+ "summary": "The multiplayer game layer now includes quests, loot drops, mounts, and realm-based gameplay with a token-managed in-game economy.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-31",+ "type": "update",+ "title": "Holder-gated worlds",+ "summary": "Every coin world now has two rooms: General (open to all) and Holders (gated by minimum token holdings, verified server-side).",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-31",+ "type": "update",+ "title": "Keyframe animation in Pose Studio",+ "summary": "Create, edit, and export full-body avatar animations on a keyframe timeline — with easing functions and export to JSON or GLB.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-31",+ "type": "update",+ "title": "Spatial voice chat in coin worlds",+ "summary": "Proximity-based voice chat inside multiplayer worlds — you hear players based on distance, with speaking indicators, voice activity detection, and audio panning.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-30",+ "type": "update",+ "title": "Coin Communities — live 3D coin worlds",+ "summary": "Every pump.fun coin gets a deterministic 3D world. Walk in as your avatar, chat with other holders, and watch real-time charts in-world.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-29",+ "type": "launch",+ "title": "$THREE Live · Protocol Pulse",+ "summary": "The $THREE protocol as a living 3D organism. Real on-chain trades pulse through it in real time — each transaction emits a particle burst, whales send shockwaves, with a live trade feed and a HUD of price, market cap, holders, and volume.",+ "link": "/three-live",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-29",+ "type": "launch",+ "title": "Forever — etch a message into Bitcoin",+ "summary": "Inscribe a message onto the Bitcoin blockchain. It stays there. Forever.",+ "link": "/forever",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-29",+ "type": "launch",+ "title": "Pay-As-You-Learn Tutor",+ "summary": "Ask anything and pay a cent per answer. A pay-as-you-learn AI tutor that bills $0.01 per explanation in USDC over x402, with a live itemized session invoice and signed attestation.",+ "link": "/tutor",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-29",+ "type": "launch",+ "title": "x402 Arbitrage",+ "summary": "Cross-provider price disparities surfaced live from the merged x402 facilitator catalog. Find the cheapest endpoint for any capability.",+ "link": "/arbitrage",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-29",+ "type": "launch",+ "title": "x402 Providers",+ "summary": "Quantified operator profiles for the x402 paid API catalog. Service counts, price bands, dominant categories, and the underlying listings.",+ "link": "/providers",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-29",+ "type": "update",+ "title": "Live trade streaming and zen mode",+ "summary": "The pump.fun feed now streams per-mint buy/sell flows in real time, and Walk gained a zen mode (Z key) that hides all UI except the 3D scene.",+ "link": null,+ "tags": [+ "feature",+ "improvement"+ ]+ },+ {+ "date": "2026-05-28",+ "type": "update",+ "title": "Faster, more reliable deploys",+ "summary": "Updated the Solana SDK bridge and fixed build memory limits and per-file timeouts that could stall deployments.",+ "link": null,+ "tags": [+ "fix",+ "infra"+ ]+ },+ {+ "date": "2026-05-27",+ "type": "launch",+ "title": "Endpoint Shopper",+ "summary": "Describe a task and set a budget. An AI agent discovers relevant x402 endpoints via the Bazaar, chains them together, and synthesizes a final answer — paying per API call.",+ "link": "/shopper",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-27",+ "type": "launch",+ "title": "Fact Checker",+ "summary": "Pay $0.10 per claim. The agent searches across authoritative sources, pays per retrieval via x402, and returns a verdict with cited evidence and a signed attestation.",+ "link": "/fact-checker",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-27",+ "type": "launch",+ "title": "Get Started",+ "summary": "5-step onboarding wizard: create a 3D avatar, name your agent, enable skills, deploy an embed widget, and set up monetization — all in under 5 minutes.",+ "link": "/start",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-27",+ "type": "launch",+ "title": "Unstoppable Agent",+ "summary": "Live dashboard for an autonomous agent that funds itself via x402 micropayments. Watch its balance, earnings, costs, and daily reflections in real time.",+ "link": "/unstoppable",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-27",+ "type": "update",+ "title": "Brain page — race LLMs side by side",+ "summary": "Run simultaneous inference across Claude, GPT, Qwen, and more with streaming latency comparison, plus a face-quality module that scores avatar facial fidelity.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-27",+ "type": "update",+ "title": "Unified dashboard",+ "summary": "Dashboard routes consolidated under /dashboard — agents, avatars, analytics, settings, and billing in one place.",+ "link": "/dashboard",+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-26",+ "type": "update",+ "title": "Avatar regeneration tracking and grounded AR",+ "summary": "Avatar regeneration jobs are now trackable, and AR mode freezes the follow-cam so avatars walk in world space instead of always facing the camera.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-26",+ "type": "update",+ "title": "three.ws on AWS Marketplace",+ "summary": "Subscribe through AWS Marketplace and automatically receive x402 API keys, with subscription status enforced across the platform.",+ "link": "/docs/listings",+ "tags": [+ "feature",+ "infra"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "launch",+ "title": "Characters",+ "summary": "Discover AI characters on three.ws. Chat, trade, and create.",+ "link": "/characters",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "launch",+ "title": "Claim threews.sol Subdomain",+ "summary": "Claim your own <name>.threews.sol subdomain and get a Brave-resolvable personal showcase page.",+ "link": "/threews/claim",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "launch",+ "title": "Dashboard",+ "summary": "Your account dashboard: agents, avatars, payments, keys, MCP servers, monetization, billing.",+ "link": "/dashboard",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "launch",+ "title": "GMGN Smart Money",+ "summary": "Live smart-money signals narrated by a 3D AI agent. Tracks which wallets are loading on Solana, Ethereum, Base, and BNB Chain in real time.",+ "link": "/gmgn",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "launch",+ "title": "Import an avatar URL",+ "summary": "Import any GLB or glTF avatar into three.ws and give it an agent brain.",+ "link": "/import/rpm",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "launch",+ "title": "New Agent",+ "summary": "Create a new agent from scratch — avatar, brain, skills, and on-chain identity.",+ "link": "/agent/new",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "launch",+ "title": "Playground",+ "summary": "Sandbox for experimenting with agents, prompts, and 3D scenes.",+ "link": "/playground",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "launch",+ "title": "Selfie to Avatar",+ "summary": "One selfie. About a minute. A rigged 3D avatar that works everywhere.",+ "link": "/create/selfie",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "launch",+ "title": "x402 Bazaar",+ "summary": "Search and browse the x402 facilitator catalog. Filter by network, price, and extensions. Pay any service in one click.",+ "link": "/bazaar",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-25",+ "type": "update",+ "title": "Search engines find everything faster",+ "summary": "Dynamic chunked sitemaps backed by live database queries, JSON-LD structured data for agents and avatars, and IndexNow integration for instant search discovery.",+ "link": null,+ "tags": [+ "infra",+ "improvement"+ ]+ },+ {+ "date": "2026-05-24",+ "type": "launch",+ "title": "Widget Studio",+ "summary": "Pick an avatar, configure embed options, copy a one-line snippet for your site.",+ "link": "/studio",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-24",+ "type": "update",+ "title": "Avatar review with live 3D preview",+ "summary": "The create-review step now embeds a full TalkScene 3D viewer with idle animations and a responsive mobile layout.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-24",+ "type": "update",+ "title": "Marketplace asset pricing and purchases",+ "summary": "Asset pricing, purchase flows, payment modals, and time-pass licensing — avatar customizations and plugins are now monetizable.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-23",+ "type": "update",+ "title": "Pay by name with SNS",+ "summary": "Solana Name Service integration — claim threews.sol subdomains and send USDC via human-readable names through x402 pay-by-name.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-21",+ "type": "update",+ "title": "Agent-to-agent protocol",+ "summary": "A2A client/server, MCP bridge, spending ledger, and receipts storage — agents can securely request services from each other with x402 payment coordination.",+ "link": null,+ "tags": [+ "feature",+ "sdk"+ ]+ },+ {+ "date": "2026-05-21",+ "type": "update",+ "title": "Agent-UI SDK released",+ "summary": "Published @three-ws/agent-ui for embedding 3D avatars in any web app — animation, click reactions, mouse tracking, and movement behaviors.",+ "link": null,+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-05-21",+ "type": "update",+ "title": "Avatar Agent MCP in Anthropic's registry",+ "summary": "Published avatar-agent-mcp to Anthropic's official MCP registry — 40+ tools for avatar generation, token launches, GLB rendering, and on-chain transactions.",+ "link": null,+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-05-21",+ "type": "update",+ "title": "Pole Club — micro-tip performances",+ "summary": "A 3D club with four stages where USDC micro-tips ($0.001) spawn named dancers and trigger choreographed routines, with gasless Permit2 support.",+ "link": "/club",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-21",+ "type": "update",+ "title": "x402 Bazaar infrastructure",+ "summary": "Bazaar listing and search with x402 subscriptions, paid-tier access control, idempotency caching, and offer receipts for service monetization.",+ "link": null,+ "tags": [+ "feature",+ "infra"+ ]+ },+ {+ "date": "2026-05-20",+ "type": "launch",+ "title": "Hydrate",+ "summary": "Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.",+ "link": "/hydrate",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-20",+ "type": "update",+ "title": "Buybacks and WASM vanity addresses",+ "summary": "Added a pump-swap buyback flow and a WebAssembly vanity address grinder for custom token launch addresses.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-20",+ "type": "update",+ "title": "Platform-wide security hardening",+ "summary": "SSRF guards on outbound fetches, CSRF gates on admin and key management, per-IP rate limiting on shared API quotas, and fail-closed cron handlers.",+ "link": null,+ "tags": [+ "security"+ ]+ },+ {+ "date": "2026-05-19",+ "type": "update",+ "title": "USDC pairs for pump.fun v2",+ "summary": "USDC trading pair support for pump.fun v2 coins with automatic bonding-curve quote detection.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-18",+ "type": "launch",+ "title": "Launchpad Studio",+ "summary": "Build a hosted 3D launchpad, token page, concierge, or showroom on a three.ws subdomain.",+ "link": "/launchpad",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-18",+ "type": "update",+ "title": "Live feed mode in the token visualizer",+ "summary": "The pump.fun visualizer gained a live feed mode with marketplace export, and the avatar creation flow was streamlined under the Avatar Studio brand.",+ "link": null,+ "tags": [+ "feature",+ "improvement"+ ]+ },+ {+ "date": "2026-05-18",+ "type": "update",+ "title": "Selfie-to-avatar reconstruction pipeline",+ "summary": "Native photo-to-3D reconstruction — submit selfies and get a fully rigged GLB avatar with automatic mesh optimization, resilient to long-running transforms.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-18",+ "type": "update",+ "title": "Solana Seeker mobile support",+ "summary": "Mobile Wallet Adapter integration for Solana Seeker and Saga devices, with a Solana dApp Store listing and Seed Vault authentication.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-17",+ "type": "update",+ "title": "Agent personalization and on-chain economy scaffolding",+ "summary": "Persona extraction from voice interviews, memory seeds from GitHub/X/Farcaster, instant voice cloning, a bonding-curve simulator, and EAS attestation reputation.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-17",+ "type": "update",+ "title": "News syndication",+ "summary": "News posts auto-publish to Dev.to and Medium with canonical links back to three.ws, and WebSub pushes keep RSS subscribers current.",+ "link": null,+ "tags": [+ "infra"+ ]+ },+ {+ "date": "2026-05-17",+ "type": "update",+ "title": "Server-side avatar regeneration",+ "summary": "Restyle, remesh, retexture, and rerig avatars with server-backed Replicate compute — results cached automatically in R2.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-17",+ "type": "update",+ "title": "Talk mode, avatar SDK, and 5–10x smaller avatars",+ "summary": "Talk mode with camera presets and ARKit-52 blendshapes, a public avatar SDK with React exports, new brain/TTS/identity APIs, and a GLB bake pipeline with WebP compression that cuts asset sizes 5–10x.",+ "link": null,+ "tags": [+ "feature",+ "sdk"+ ]+ },+ {+ "date": "2026-05-17",+ "type": "update",+ "title": "Talking avatars with audio-driven lip-sync",+ "summary": "Real-time lip-sync reads TTS audio and morphs avatar mouth shapes, integrated into talk scenes with camera presets and emotes.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-17",+ "type": "update",+ "title": "Team launches with creator-signer split",+ "summary": "Token launches now support separate signer and creator wallets — the signer pays gas while the creator receives on-chain royalties.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-15",+ "type": "launch",+ "title": "Strategy Lab",+ "summary": "Build DCA and subscription strategies that trade on-chain on your behalf.",+ "link": "/strategy-lab",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-15",+ "type": "update",+ "title": "Avatar accessories and launchpad redesign",+ "summary": "Avatar customization now supports accessories, and the coin launchpad interface was redesigned for clarity.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-15",+ "type": "update",+ "title": "Token visualizer search and sort",+ "summary": "The interactive 3D token universe gained search by name/symbol/mint and sorting by market cap, live status, replies, and age — refreshing every 60 seconds.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-14",+ "type": "update",+ "title": "15 tutorials and six new paid endpoints",+ "summary": "New developer walkthroughs from embed quickstart to multi-agent coordination, plus six x402 paid endpoints including agent reputation, identity verify, and skill marketplace.",+ "link": null,+ "tags": [+ "docs",+ "feature"+ ]+ },+ {+ "date": "2026-05-14",+ "type": "update",+ "title": "Launchpad Studio — no-code hosted pages",+ "summary": "Pick a template, fill a form, and publish a hosted page for your token or service at /p/<slug> — no code required.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-14",+ "type": "update",+ "title": "Multiplayer walk scenes",+ "summary": "Live multiplayer walkaround with websocket infrastructure — multiple players see each other in the same 3D scene.",+ "link": null,+ "tags": [+ "feature",+ "infra"+ ]+ },+ {+ "date": "2026-05-14",+ "type": "update",+ "title": "x402 commerce — SKUs and hosted checkout",+ "summary": "Stripe-like payment UX for x402: define SKUs, share hosted checkout links, and track settlement history — settled on Base via Coinbase CDP.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-13",+ "type": "update",+ "title": "Autonomous X Spaces voice agent",+ "summary": "A cloud voice agent that joins X Spaces and holds real-time conversations using streaming audio and transcription.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-10",+ "type": "launch",+ "title": "Walk",+ "summary": "Drive a 3D avatar around with a joystick or WASD — toggle the back camera for AR-style passthrough.",+ "link": "/walk",+ "tags": [+ "launch"+ ]+ },+ {+ "date": "2026-05-10",+ "type": "update",+ "title": "Launch-week recap published",+ "summary": "An interactive case study of launch week (Apr 29 – May 9) with the architecture timeline, partner ecosystem, lessons learned, and live engagement metrics.",+ "link": null,+ "tags": [+ "docs"+ ]+ },+ {+ "date": "2026-05-10",+ "type": "update",+ "title": "Marketplace v2 and creator dashboard",+ "summary": "Redesigned marketplace with trials, time passes, billing receipts, featured avatar galleries, and theme selection.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-10",+ "type": "update",+ "title": "Monetization v2",+ "summary": "Trials, time-based access passes, withdrawal processing, signed receipts, multi-wallet support, and 5% referral splits.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-09",+ "type": "update",+ "title": "Vanity wallet addresses",+ "summary": "Vanity address grinders for Solana and Ethereum, plus co-sign helpers for parallel token launches.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "type": "update",+ "title": "$THREE holder gating",+ "summary": "Holder-gated access now works with a simple on-chain $THREE balance check — no vault setup required.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "type": "update",+ "title": "Agent Payments SDK v3.1.0 — multi-chain",+ "summary": "Solana v2 bonding curve support plus Base, Polygon, and Ethereum with cross-chain payment routing.",+ "link": null,+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-05-08",+ "type": "update",+ "title": "Agents that feel the room",+ "summary": "Agents now react to user sentiment with emotion expressions and animations — empathy, concern, celebration, patience, curiosity.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "type": "update",+ "title": "Payments inside chat",+ "summary": "The full agent payments lifecycle is available in chat — balance checks, fund distribution, withdrawals, and USDC whitelist monitoring.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "type": "update",+ "title": "Pick your agent's model",+ "summary": "Chat moved to unified streaming with per-agent model selection across Anthropic, OpenRouter, Groq, and OpenAI.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "type": "update",+ "title": "Trading tools in chat",+ "summary": "Five real trading tools in agent chat: buy, sell, portfolio view, and live price quotes with custom slippage control.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-08",+ "type": "update",+ "title": "x402 spec v2",+ "summary": "Upgraded the payment protocol to spec v2 with CAIP-2 network IDs, Bazaar integration, and marketplace listing support.",+ "link": null,+ "tags": [+ "improvement",+ "sdk"+ ]+ },+ {+ "date": "2026-05-04",+ "type": "update",+ "title": "Avatar reactions to market events",+ "summary": "Community and personal avatar selection with real-time gesture animations during market events.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-04",+ "type": "update",+ "title": "JavaScript SDK launch",+ "summary": "The official three.ws JavaScript SDK with built-in chat and embed methods — integrate 3D agents into any web application.",+ "link": null,+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-05-04",+ "type": "update",+ "title": "Real-time multiplayer sync",+ "summary": "Live multiplayer support with real-time room creation, player interactions, and synchronized state.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-04",+ "type": "update",+ "title": "Richer pump.fun feed",+ "summary": "Graduation event parsing, gesture animations, and live market cap display in the pump.fun dashboard.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-05-04",+ "type": "update",+ "title": "Sell your agent's skills",+ "summary": "Skill pricing, purchase buttons, and a payment intent API — creators can gate premium skills behind subscriptions or one-time purchases.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-01",+ "type": "update",+ "title": "Lip-sync and Solana Blinks",+ "summary": "Real-time viseme morphing from audio, plus Solana Blinks support so agents can parse and execute on-chain actions.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-01",+ "type": "update",+ "title": "Plugin marketplace",+ "summary": "Search, install, and manage community-published agent skills using the open ToolManifest format.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-05-01",+ "type": "update",+ "title": "Reputation and staking",+ "summary": "Agent reputation panel with ETH staking for trust signals — reputation accumulates through validator actions tracked on-chain.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-30",+ "type": "update",+ "title": "Chat with voice",+ "summary": "Native LLM chat launched with live voice input/output and real-time transcription for agent conversations.",+ "link": "/chat",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-29",+ "type": "update",+ "title": "On-chain agents on Solana and EVM",+ "summary": "Unified deployment stack — agents register on Ethereum, Base, Polygon, and Solana with passport pages, reputation, and attestations.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-29",+ "type": "update",+ "title": "Pump.fun launch and trading stack",+ "summary": "Token creation, bonding-curve swaps, KOL trade tracking, automated wallet monitoring, and a vanity address grinder for custom Solana prefixes.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-29",+ "type": "update",+ "title": "Solana Agent SDK",+ "summary": "Actions for token transfers, SPL swaps, balance queries, and stake attestations, with transaction builders and fee estimation.",+ "link": null,+ "tags": [+ "sdk"+ ]+ },+ {+ "date": "2026-04-29",+ "type": "update",+ "title": "three.ws in Anthropic's MCP Registry",+ "summary": "Published to the official MCP Registry — Claude can deploy agents, create tokens, and run wallet operations on three.ws via the standard MCP protocol.",+ "link": null,+ "tags": [+ "sdk",+ "infra"+ ]+ },+ {+ "date": "2026-04-29",+ "type": "update",+ "title": "x402 micropayments",+ "summary": "Facilitator-mediated USDC micropayments — MCP clients authorize requests with payment headers, with per-tool pricing and subscription bypass.",+ "link": null,+ "tags": [+ "feature",+ "sdk"+ ]+ },+ {+ "date": "2026-04-27",+ "type": "update",+ "title": "3D viewer polish",+ "summary": "Better first-load camera framing, keyboard shortcuts, saved per-agent animation preferences, and improved mobile accessibility.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-04-27",+ "type": "update",+ "title": "Create-to-deploy flow",+ "summary": "A streamlined creator path: create, edit, see your 3D body on your public profile, and deploy on-chain with chain selection — with onboarding for first-time creators.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-27",+ "type": "update",+ "title": "Hello, three.ws",+ "summary": "The platform rebranded from 3D Agent to three.ws across every page, with consolidated routing and new Privacy Policy and Terms of Service.",+ "link": null,+ "tags": [+ "improvement"+ ]+ },+ {+ "date": "2026-04-17",+ "type": "update",+ "title": "Avatars that never sit still",+ "summary": "A four-channel idle animation loop — breathing, eye saccades, blinks, weight shifts — keeps avatars naturally alive during silence.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-17",+ "type": "update",+ "title": "Embeds with action bridges",+ "summary": "Agent embeds can be hosted on external sites with persistent state, live Studio preview, and bridges for inter-agent communication.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-17",+ "type": "update",+ "title": "On-chain agent discovery",+ "summary": "The /discover page lists every ERC-8004 agent owned by your wallet with one-click import, plus a LobeHub plugin for LLM orchestration.",+ "link": "/discover",+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-16",+ "type": "update",+ "title": "Widget Studio is born",+ "summary": "The first version of Widget Studio — build, preview, and save custom avatar widgets with a drag-drop editor and live updates.",+ "link": null,+ "tags": [+ "feature"+ ]+ },+ {+ "date": "2026-04-15",+ "type": "update",+ "title": "3D model validation tools",+ "summary": "Model validation, inspection, and optimization APIs for GLB/FBX files — asset analysis and format conversion to guarantee avatar quality.",+ "link": null,+ "tags": [+ "feature",+ "sdk"+ ]+ },+ {+ "date": "2026-04-15",+ "type": "update",+ "title": "Wallet sign-in and on-chain identity",+ "summary": "Sign-In with Ethereum, wallet integration, and the ERC-8004 Passport widget — agents display cryptographic proof of identity tied to wallet ownership.",+ "link": null,+ "tags": [+ "feature",+ "security"+ ]+ }+ ]+}diff --git a/public/changelog.xml b/public/changelog.xmlnew file mode 100644index 000000000..b407ef5d0--- /dev/null+++ b/public/changelog.xml@@ -0,0 +1,1058 @@+<?xml version="1.0" encoding="UTF-8"?>+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">+ <channel>+ <title>three.ws changelog</title>+ <link>https://three.ws/changelog</link>+ <atom:link href="https://three.ws/changelog.xml" rel="self" type="application/rss+xml"/>+ <description>What's new on three.ws — features, improvements, and releases, newest first.</description>+ <language>en</language>+ <item>+ <title>Faster, quieter agents directory and site-wide page polish</title>+ <link>https://three.ws/agents</link>+ <guid isPermaLink="false">2026-06-11:Faster, quieter agents directory and site-wide page polish</guid>+ <pubDate>Thu, 11 Jun 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The on-chain agents directory now loads from our server-side index instead of contacting every agent's metadata host from your browser — pages render faster and no longer spray network errors. Also: the pump.fun cockpit's sidebar pages are now shareable deep links, mobile nav and footer links meet touch-target guidelines, anonymous visitors no longer trigger failed sign-in requests on Walk and Create, and assorted dead links were removed.</description>+ </item>+ <item>+ <title>Text-to-3D and image-to-3D generation restored</title>+ <link>https://three.ws/forge</link>+ <guid isPermaLink="false">2026-06-11:Text-to-3D and image-to-3D generation restored</guid>+ <pubDate>Thu, 11 Jun 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Fixed two provider regressions that blocked Forge generation: model submissions now pin the latest published model version automatically, and the text-to-image step falls back to a healthy provider instead of failing when the preferred one is misconfigured.</description>+ </item>+ <item>+ <title>WebRTC relay and x402 telemetry</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-10:WebRTC relay and x402 telemetry</guid>+ <pubDate>Wed, 10 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Added a Session Description Protocol relay for WebRTC handshakes and instrumented every paid x402 surface for Provider Hub telemetry, with hardened rate limiting.</description>+ </item>+ <item>+ <title>Agent Lookup</title>+ <link>https://three.ws/lookup</link>+ <guid isPermaLink="false">2026-06-09:Agent Lookup</guid>+ <pubDate>Tue, 09 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Resolve any three.ws agent by Solana mint, agent ID, avatar ID, or slug — renders its interactive 3D avatar alongside its on-chain identity (collection, owner, agent wallet, Active/x402 status, Metaplex/Solscan/Magic Eden links).</description>+ </item>+ <item>+ <title>New Claude models in every agent brain</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-09:New Claude models in every agent brain</guid>+ <pubDate>Tue, 09 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Claude Fable 5 and Mythos 5 are now available across agent brain selectors, pricing tables, and the x402 provider catalog.</description>+ </item>+ <item>+ <title>Bounty board with AI judge</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-08:Bounty board with AI judge</guid>+ <pubDate>Mon, 08 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Bounty submissions now support liking, AI-powered scoring, and per-bounty leaderboards — submissions are ranked by a platform-powered judge.</description>+ </item>+ <item>+ <title>Public agent profiles with shared memories</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-08:Public agent profiles with shared memories</guid>+ <pubDate>Mon, 08 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Agents can now have public profile pages that surface their shared memories, plus Replicate model provider support and public agent directory resolution.</description>+ </item>+ <item>+ <title>AIXBT market intelligence for agents</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-07:AIXBT market intelligence for agents</guid>+ <pubDate>Sun, 07 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Agents and in-world NPCs can now tap AIXBT market intelligence — token analysis, project data, and grounding served through new API endpoints.</description>+ </item>+ <item>+ <title>Forge editing upgrades</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-06:Forge editing upgrades</guid>+ <pubDate>Sat, 06 Jun 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Forge gained an animation system, pose studio, magic-brush stylization, multi-view rendering, and faster segment/animate/texture workers.</description>+ </item>+ <item>+ <title>IBM Granite models over MCP and x402</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-06:IBM Granite models over MCP and x402</guid>+ <pubDate>Sat, 06 Jun 2026 12:00:00 GMT</pubDate>+ <category>sdk</category>+ <description>Published an MCP package exposing IBM Granite chat, code, embedding, and forecasting models with x402 pay-per-call routing.</description>+ </item>+ <item>+ <title>Agent Exchange — AI Agents Paying Each Other</title>+ <link>https://three.ws/features/agent-exchange</link>+ <guid isPermaLink="false">2026-06-05:Agent Exchange — AI Agents Paying Each Other</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Watch two AI agents with 3D avatars autonomously negotiate and pay each other for crypto intelligence via x402 micropayments on Solana.</description>+ </item>+ <item>+ <title>Deploy — On-Chain Agent Identity</title>+ <link>https://three.ws/features/deploy</link>+ <guid isPermaLink="false">2026-06-05:Deploy — On-Chain Agent Identity</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Register your AI agent on Solana via ERC-8004 and Metaplex Core. Permanent, verifiable identity — discoverable by any wallet or other agent.</description>+ </item>+ <item>+ <title>Docs · Do I Need Crypto?</title>+ <link>https://three.ws/docs/do-i-need-crypto</link>+ <guid isPermaLink="false">2026-06-05:Docs · Do I Need Crypto?</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Honest answers to the wallet and payment questions — what requires crypto, what doesn’t, and how payments work.</description>+ </item>+ <item>+ <title>Docs · Make Your First Agent</title>+ <link>https://three.ws/docs/make-your-agent</link>+ <guid isPermaLink="false">2026-06-05:Docs · Make Your First Agent</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Step-by-step guide to creating a 3D AI agent in the browser with no code required.</description>+ </item>+ <item>+ <title>Docs · Share & Embed</title>+ <link>https://three.ws/docs/share-and-embed</link>+ <guid isPermaLink="false">2026-06-05:Docs · Share & Embed</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Three ways to put your agent in front of people: share a link, embed an iframe, or use the web component.</description>+ </item>+ <item>+ <title>Docs · Start Here</title>+ <link>https://three.ws/docs/start-here</link>+ <guid isPermaLink="false">2026-06-05:Docs · Start Here</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Plain-language introduction to three.ws for creators and non-developers — what it is, who it’s for, and where to begin.</description>+ </item>+ <item>+ <title>Forge — Text to 3D Model</title>+ <link>https://three.ws/features/forge</link>+ <guid isPermaLink="false">2026-06-05:Forge — Text to 3D Model</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Type a description, get a downloadable textured 3D model (GLB). Powered by Flux image generation and TRELLIS 3D reconstruction.</description>+ </item>+ <item>+ <title>Labs Showcase</title>+ <link>https://three.ws/labs</link>+ <guid isPermaLink="false">2026-06-05:Labs Showcase</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>A curated gallery of three.ws's most powerful — and most hidden — features. Find and try things you didn't know existed.</description>+ </item>+ <item>+ <title>Marketplace — Discover and Fork AI Agents</title>+ <link>https://three.ws/features/marketplace</link>+ <guid isPermaLink="false">2026-06-05:Marketplace — Discover and Fork AI Agents</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Browse hundreds of community-built AI agents with 3D avatars and on-chain identities. Fork any agent, buy paid skills, and ship in minutes.</description>+ </item>+ <item>+ <title>Play — Live 3D Coin Worlds</title>+ <link>https://three.ws/features/play</link>+ <guid isPermaLink="false">2026-06-05:Play — Live 3D Coin Worlds</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Every pump.fun coin gets a deterministic 3D world. Walk in as your avatar, chat with holders, and trade — all in the browser.</description>+ </item>+ <item>+ <title>Pole Club</title>+ <link>https://three.ws/club</link>+ <guid isPermaLink="false">2026-06-05:Pole Club</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>A 3D club where dancers only perform when you send a micro-tip. Pay $0.001 per routine, settled on-chain via x402 on Base or Solana.</description>+ </item>+ <item>+ <title>Scan — Selfie to 3D Avatar</title>+ <link>https://three.ws/features/scan</link>+ <guid isPermaLink="false">2026-06-05:Scan — Selfie to 3D Avatar</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Point your camera at your face, hold still, and walk away with a rigged 3D avatar in 60 seconds. Free, in your browser.</description>+ </item>+ <item>+ <title>Studio — Embeddable AI Widget Builder</title>+ <link>https://three.ws/features/studio</link>+ <guid isPermaLink="false">2026-06-05:Studio — Embeddable AI Widget Builder</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Configure avatar, voice, and knowledge base in the Widget Studio, then copy one script tag to embed a 3D AI agent anywhere.</description>+ </item>+ <item>+ <title>Voice Lab</title>+ <link>https://three.ws/voice</link>+ <guid isPermaLink="false">2026-06-05:Voice Lab</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Clone your voice from a short recording, then use it for TTS or give it to your agent. Side-by-side comparison of voice models.</description>+ </item>+ <item>+ <title>Walk — 3D Avatar AR</title>+ <link>https://three.ws/features/walk</link>+ <guid isPermaLink="false">2026-06-05:Walk — 3D Avatar AR</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Drive your AI agent's 3D avatar with WASD or joystick. Toggle AR mode and it walks on your real floor through your phone camera.</description>+ </item>+ <item>+ <title>Cosmetics economy in the game world</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-05:Cosmetics economy in the game world</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A cosmetics shop inside the 3D game world — buy avatar customizations via x402, trade them peer-to-peer, and earn from cosmetics usage.</description>+ </item>+ <item>+ <title>Privy wallet sign-in</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-05:Privy wallet sign-in</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Wallet-native sign-in via Privy with JWKS verification and DID linking — log in securely without managing passwords.</description>+ </item>+ <item>+ <title>Pump.fun autopilot and guided agent creation</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-05:Pump.fun autopilot and guided agent creation</guid>+ <pubDate>Fri, 05 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Automated token launching and trading via pump.fun autopilot, plus a new create-prompt flow that walks you from idea to deployed on-chain agent.</description>+ </item>+ <item>+ <title>three.ws on IBM watsonx — Agent Galaxy</title>+ <link>https://three.ws/ibm/galaxy</link>+ <guid isPermaLink="false">2026-06-03:three.ws on IBM watsonx — Agent Galaxy</guid>+ <pubDate>Wed, 03 Jun 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>three.ws is an IBM Business Partner. Open-source 3D AI agents that think on IBM Granite via watsonx.ai and give watsonx Orchestrate agents a face, voice, and on-chain identity.</description>+ </item>+ <item>+ <title>Autonomous agent-to-agent trading</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-03:Autonomous agent-to-agent trading</guid>+ <pubDate>Wed, 03 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Agents can now negotiate with each other, pay for crypto intelligence via x402 micropayments, and settle on-chain — fully autonomously.</description>+ </item>+ <item>+ <title>Voice cloning and real-time lip-sync</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-03:Voice cloning and real-time lip-sync</guid>+ <pubDate>Wed, 03 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>ElevenLabs text-to-speech is now wired through the platform: voice cloning, real-time lip-sync, and per-voice settings for every agent.</description>+ </item>+ <item>+ <title>x402 payment hardening</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-03:x402 payment hardening</guid>+ <pubDate>Wed, 03 Jun 2026 12:00:00 GMT</pubDate>+ <category>security</category>+ <description>Hardened payment processing with Solana transaction confirmation, replay-attack guards, payment-intent deduplication, and sanitized errors across MCP bridges.</description>+ </item>+ <item>+ <title>Every agent gets its own wallet</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-02:Every agent gets its own wallet</guid>+ <pubDate>Tue, 02 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Each agent now has a deterministic Solana wallet for self-custodied payments — agents can send SOL and settle x402 transactions autonomously.</description>+ </item>+ <item>+ <title>Four production MCP servers</title>+ <link>https://three.ws/docs/mcp</link>+ <guid isPermaLink="false">2026-06-02:Four production MCP servers</guid>+ <pubDate>Tue, 02 Jun 2026 12:00:00 GMT</pubDate>+ <category>sdk</category>+ <description>3D Studio (text-to-3D, model inspection), x402 Bazaar (service discovery and payment), IBM watsonx (LLM access), and Pump.fun (token operations) — all published with manifests and docs.</description>+ </item>+ <item>+ <title>City world</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-01:City world</guid>+ <pubDate>Mon, 01 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>An isometric 3D city with player movement, collision, minimap, and avatar animation — a new kind of world to explore as your agent.</description>+ </item>+ <item>+ <title>Quests, loot, mounts, and realms</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-06-01:Quests, loot, mounts, and realms</guid>+ <pubDate>Mon, 01 Jun 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The multiplayer game layer now includes quests, loot drops, mounts, and realm-based gameplay with a token-managed in-game economy.</description>+ </item>+ <item>+ <title>Holder-gated worlds</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-31:Holder-gated worlds</guid>+ <pubDate>Sun, 31 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Every coin world now has two rooms: General (open to all) and Holders (gated by minimum token holdings, verified server-side).</description>+ </item>+ <item>+ <title>Keyframe animation in Pose Studio</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-31:Keyframe animation in Pose Studio</guid>+ <pubDate>Sun, 31 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Create, edit, and export full-body avatar animations on a keyframe timeline — with easing functions and export to JSON or GLB.</description>+ </item>+ <item>+ <title>Spatial voice chat in coin worlds</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-31:Spatial voice chat in coin worlds</guid>+ <pubDate>Sun, 31 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Proximity-based voice chat inside multiplayer worlds — you hear players based on distance, with speaking indicators, voice activity detection, and audio panning.</description>+ </item>+ <item>+ <title>Coin Communities — live 3D coin worlds</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-30:Coin Communities — live 3D coin worlds</guid>+ <pubDate>Sat, 30 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Every pump.fun coin gets a deterministic 3D world. Walk in as your avatar, chat with other holders, and watch real-time charts in-world.</description>+ </item>+ <item>+ <title>$THREE Live · Protocol Pulse</title>+ <link>https://three.ws/three-live</link>+ <guid isPermaLink="false">2026-05-29:$THREE Live · Protocol Pulse</guid>+ <pubDate>Fri, 29 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>The $THREE protocol as a living 3D organism. Real on-chain trades pulse through it in real time — each transaction emits a particle burst, whales send shockwaves, with a live trade feed and a HUD of price, market cap, holders, and volume.</description>+ </item>+ <item>+ <title>Forever — etch a message into Bitcoin</title>+ <link>https://three.ws/forever</link>+ <guid isPermaLink="false">2026-05-29:Forever — etch a message into Bitcoin</guid>+ <pubDate>Fri, 29 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Inscribe a message onto the Bitcoin blockchain. It stays there. Forever.</description>+ </item>+ <item>+ <title>Pay-As-You-Learn Tutor</title>+ <link>https://three.ws/tutor</link>+ <guid isPermaLink="false">2026-05-29:Pay-As-You-Learn Tutor</guid>+ <pubDate>Fri, 29 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Ask anything and pay a cent per answer. A pay-as-you-learn AI tutor that bills $0.01 per explanation in USDC over x402, with a live itemized session invoice and signed attestation.</description>+ </item>+ <item>+ <title>x402 Arbitrage</title>+ <link>https://three.ws/arbitrage</link>+ <guid isPermaLink="false">2026-05-29:x402 Arbitrage</guid>+ <pubDate>Fri, 29 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Cross-provider price disparities surfaced live from the merged x402 facilitator catalog. Find the cheapest endpoint for any capability.</description>+ </item>+ <item>+ <title>x402 Providers</title>+ <link>https://three.ws/providers</link>+ <guid isPermaLink="false">2026-05-29:x402 Providers</guid>+ <pubDate>Fri, 29 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Quantified operator profiles for the x402 paid API catalog. Service counts, price bands, dominant categories, and the underlying listings.</description>+ </item>+ <item>+ <title>Live trade streaming and zen mode</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-29:Live trade streaming and zen mode</guid>+ <pubDate>Fri, 29 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The pump.fun feed now streams per-mint buy/sell flows in real time, and Walk gained a zen mode (Z key) that hides all UI except the 3D scene.</description>+ </item>+ <item>+ <title>Faster, more reliable deploys</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-28:Faster, more reliable deploys</guid>+ <pubDate>Thu, 28 May 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Updated the Solana SDK bridge and fixed build memory limits and per-file timeouts that could stall deployments.</description>+ </item>+ <item>+ <title>Endpoint Shopper</title>+ <link>https://three.ws/shopper</link>+ <guid isPermaLink="false">2026-05-27:Endpoint Shopper</guid>+ <pubDate>Wed, 27 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Describe a task and set a budget. An AI agent discovers relevant x402 endpoints via the Bazaar, chains them together, and synthesizes a final answer — paying per API call.</description>+ </item>+ <item>+ <title>Fact Checker</title>+ <link>https://three.ws/fact-checker</link>+ <guid isPermaLink="false">2026-05-27:Fact Checker</guid>+ <pubDate>Wed, 27 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Pay $0.10 per claim. The agent searches across authoritative sources, pays per retrieval via x402, and returns a verdict with cited evidence and a signed attestation.</description>+ </item>+ <item>+ <title>Get Started</title>+ <link>https://three.ws/start</link>+ <guid isPermaLink="false">2026-05-27:Get Started</guid>+ <pubDate>Wed, 27 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>5-step onboarding wizard: create a 3D avatar, name your agent, enable skills, deploy an embed widget, and set up monetization — all in under 5 minutes.</description>+ </item>+ <item>+ <title>Unstoppable Agent</title>+ <link>https://three.ws/unstoppable</link>+ <guid isPermaLink="false">2026-05-27:Unstoppable Agent</guid>+ <pubDate>Wed, 27 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Live dashboard for an autonomous agent that funds itself via x402 micropayments. Watch its balance, earnings, costs, and daily reflections in real time.</description>+ </item>+ <item>+ <title>Brain page — race LLMs side by side</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-27:Brain page — race LLMs side by side</guid>+ <pubDate>Wed, 27 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Run simultaneous inference across Claude, GPT, Qwen, and more with streaming latency comparison, plus a face-quality module that scores avatar facial fidelity.</description>+ </item>+ <item>+ <title>Unified dashboard</title>+ <link>https://three.ws/dashboard</link>+ <guid isPermaLink="false">2026-05-27:Unified dashboard</guid>+ <pubDate>Wed, 27 May 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Dashboard routes consolidated under /dashboard — agents, avatars, analytics, settings, and billing in one place.</description>+ </item>+ <item>+ <title>Avatar regeneration tracking and grounded AR</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-26:Avatar regeneration tracking and grounded AR</guid>+ <pubDate>Tue, 26 May 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Avatar regeneration jobs are now trackable, and AR mode freezes the follow-cam so avatars walk in world space instead of always facing the camera.</description>+ </item>+ <item>+ <title>three.ws on AWS Marketplace</title>+ <link>https://three.ws/docs/listings</link>+ <guid isPermaLink="false">2026-05-26:three.ws on AWS Marketplace</guid>+ <pubDate>Tue, 26 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Subscribe through AWS Marketplace and automatically receive x402 API keys, with subscription status enforced across the platform.</description>+ </item>+ <item>+ <title>Characters</title>+ <link>https://three.ws/characters</link>+ <guid isPermaLink="false">2026-05-25:Characters</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Discover AI characters on three.ws. Chat, trade, and create.</description>+ </item>+ <item>+ <title>Claim threews.sol Subdomain</title>+ <link>https://three.ws/threews/claim</link>+ <guid isPermaLink="false">2026-05-25:Claim threews.sol Subdomain</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Claim your own <name>.threews.sol subdomain and get a Brave-resolvable personal showcase page.</description>+ </item>+ <item>+ <title>Dashboard</title>+ <link>https://three.ws/dashboard</link>+ <guid isPermaLink="false">2026-05-25:Dashboard</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Your account dashboard: agents, avatars, payments, keys, MCP servers, monetization, billing.</description>+ </item>+ <item>+ <title>GMGN Smart Money</title>+ <link>https://three.ws/gmgn</link>+ <guid isPermaLink="false">2026-05-25:GMGN Smart Money</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Live smart-money signals narrated by a 3D AI agent. Tracks which wallets are loading on Solana, Ethereum, Base, and BNB Chain in real time.</description>+ </item>+ <item>+ <title>Import an avatar URL</title>+ <link>https://three.ws/import/rpm</link>+ <guid isPermaLink="false">2026-05-25:Import an avatar URL</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Import any GLB or glTF avatar into three.ws and give it an agent brain.</description>+ </item>+ <item>+ <title>New Agent</title>+ <link>https://three.ws/agent/new</link>+ <guid isPermaLink="false">2026-05-25:New Agent</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Create a new agent from scratch — avatar, brain, skills, and on-chain identity.</description>+ </item>+ <item>+ <title>Playground</title>+ <link>https://three.ws/playground</link>+ <guid isPermaLink="false">2026-05-25:Playground</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Sandbox for experimenting with agents, prompts, and 3D scenes.</description>+ </item>+ <item>+ <title>Selfie to Avatar</title>+ <link>https://three.ws/create/selfie</link>+ <guid isPermaLink="false">2026-05-25:Selfie to Avatar</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>One selfie. About a minute. A rigged 3D avatar that works everywhere.</description>+ </item>+ <item>+ <title>x402 Bazaar</title>+ <link>https://three.ws/bazaar</link>+ <guid isPermaLink="false">2026-05-25:x402 Bazaar</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Search and browse the x402 facilitator catalog. Filter by network, price, and extensions. Pay any service in one click.</description>+ </item>+ <item>+ <title>Search engines find everything faster</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-25:Search engines find everything faster</guid>+ <pubDate>Mon, 25 May 2026 12:00:00 GMT</pubDate>+ <category>infra</category>+ <description>Dynamic chunked sitemaps backed by live database queries, JSON-LD structured data for agents and avatars, and IndexNow integration for instant search discovery.</description>+ </item>+ <item>+ <title>Widget Studio</title>+ <link>https://three.ws/studio</link>+ <guid isPermaLink="false">2026-05-24:Widget Studio</guid>+ <pubDate>Sun, 24 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Pick an avatar, configure embed options, copy a one-line snippet for your site.</description>+ </item>+ <item>+ <title>Avatar review with live 3D preview</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-24:Avatar review with live 3D preview</guid>+ <pubDate>Sun, 24 May 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The create-review step now embeds a full TalkScene 3D viewer with idle animations and a responsive mobile layout.</description>+ </item>+ <item>+ <title>Marketplace asset pricing and purchases</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-24:Marketplace asset pricing and purchases</guid>+ <pubDate>Sun, 24 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Asset pricing, purchase flows, payment modals, and time-pass licensing — avatar customizations and plugins are now monetizable.</description>+ </item>+ <item>+ <title>Pay by name with SNS</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-23:Pay by name with SNS</guid>+ <pubDate>Sat, 23 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Solana Name Service integration — claim threews.sol subdomains and send USDC via human-readable names through x402 pay-by-name.</description>+ </item>+ <item>+ <title>Agent-to-agent protocol</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-21:Agent-to-agent protocol</guid>+ <pubDate>Thu, 21 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A2A client/server, MCP bridge, spending ledger, and receipts storage — agents can securely request services from each other with x402 payment coordination.</description>+ </item>+ <item>+ <title>Agent-UI SDK released</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-21:Agent-UI SDK released</guid>+ <pubDate>Thu, 21 May 2026 12:00:00 GMT</pubDate>+ <category>sdk</category>+ <description>Published @three-ws/agent-ui for embedding 3D avatars in any web app — animation, click reactions, mouse tracking, and movement behaviors.</description>+ </item>+ <item>+ <title>Avatar Agent MCP in Anthropic's registry</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-21:Avatar Agent MCP in Anthropic's registry</guid>+ <pubDate>Thu, 21 May 2026 12:00:00 GMT</pubDate>+ <category>sdk</category>+ <description>Published avatar-agent-mcp to Anthropic's official MCP registry — 40+ tools for avatar generation, token launches, GLB rendering, and on-chain transactions.</description>+ </item>+ <item>+ <title>Pole Club — micro-tip performances</title>+ <link>https://three.ws/club</link>+ <guid isPermaLink="false">2026-05-21:Pole Club — micro-tip performances</guid>+ <pubDate>Thu, 21 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A 3D club with four stages where USDC micro-tips ($0.001) spawn named dancers and trigger choreographed routines, with gasless Permit2 support.</description>+ </item>+ <item>+ <title>x402 Bazaar infrastructure</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-21:x402 Bazaar infrastructure</guid>+ <pubDate>Thu, 21 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Bazaar listing and search with x402 subscriptions, paid-tier access control, idempotency caching, and offer receipts for service monetization.</description>+ </item>+ <item>+ <title>Hydrate</title>+ <link>https://three.ws/hydrate</link>+ <guid isPermaLink="false">2026-05-20:Hydrate</guid>+ <pubDate>Wed, 20 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Take an existing on-chain agent (ERC-8004 / Solana) and attach a 3D body, voice, and skills.</description>+ </item>+ <item>+ <title>Buybacks and WASM vanity addresses</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-20:Buybacks and WASM vanity addresses</guid>+ <pubDate>Wed, 20 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Added a pump-swap buyback flow and a WebAssembly vanity address grinder for custom token launch addresses.</description>+ </item>+ <item>+ <title>Platform-wide security hardening</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-20:Platform-wide security hardening</guid>+ <pubDate>Wed, 20 May 2026 12:00:00 GMT</pubDate>+ <category>security</category>+ <description>SSRF guards on outbound fetches, CSRF gates on admin and key management, per-IP rate limiting on shared API quotas, and fail-closed cron handlers.</description>+ </item>+ <item>+ <title>USDC pairs for pump.fun v2</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-19:USDC pairs for pump.fun v2</guid>+ <pubDate>Tue, 19 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>USDC trading pair support for pump.fun v2 coins with automatic bonding-curve quote detection.</description>+ </item>+ <item>+ <title>Launchpad Studio</title>+ <link>https://three.ws/launchpad</link>+ <guid isPermaLink="false">2026-05-18:Launchpad Studio</guid>+ <pubDate>Mon, 18 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Build a hosted 3D launchpad, token page, concierge, or showroom on a three.ws subdomain.</description>+ </item>+ <item>+ <title>Live feed mode in the token visualizer</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-18:Live feed mode in the token visualizer</guid>+ <pubDate>Mon, 18 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The pump.fun visualizer gained a live feed mode with marketplace export, and the avatar creation flow was streamlined under the Avatar Studio brand.</description>+ </item>+ <item>+ <title>Selfie-to-avatar reconstruction pipeline</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-18:Selfie-to-avatar reconstruction pipeline</guid>+ <pubDate>Mon, 18 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Native photo-to-3D reconstruction — submit selfies and get a fully rigged GLB avatar with automatic mesh optimization, resilient to long-running transforms.</description>+ </item>+ <item>+ <title>Solana Seeker mobile support</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-18:Solana Seeker mobile support</guid>+ <pubDate>Mon, 18 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Mobile Wallet Adapter integration for Solana Seeker and Saga devices, with a Solana dApp Store listing and Seed Vault authentication.</description>+ </item>+ <item>+ <title>Agent personalization and on-chain economy scaffolding</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-17:Agent personalization and on-chain economy scaffolding</guid>+ <pubDate>Sun, 17 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Persona extraction from voice interviews, memory seeds from GitHub/X/Farcaster, instant voice cloning, a bonding-curve simulator, and EAS attestation reputation.</description>+ </item>+ <item>+ <title>News syndication</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-17:News syndication</guid>+ <pubDate>Sun, 17 May 2026 12:00:00 GMT</pubDate>+ <category>infra</category>+ <description>News posts auto-publish to Dev.to and Medium with canonical links back to three.ws, and WebSub pushes keep RSS subscribers current.</description>+ </item>+ <item>+ <title>Server-side avatar regeneration</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-17:Server-side avatar regeneration</guid>+ <pubDate>Sun, 17 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Restyle, remesh, retexture, and rerig avatars with server-backed Replicate compute — results cached automatically in R2.</description>+ </item>+ <item>+ <title>Talk mode, avatar SDK, and 5–10x smaller avatars</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-17:Talk mode, avatar SDK, and 5–10x smaller avatars</guid>+ <pubDate>Sun, 17 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Talk mode with camera presets and ARKit-52 blendshapes, a public avatar SDK with React exports, new brain/TTS/identity APIs, and a GLB bake pipeline with WebP compression that cuts asset sizes 5–10x.</description>+ </item>+ <item>+ <title>Talking avatars with audio-driven lip-sync</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-17:Talking avatars with audio-driven lip-sync</guid>+ <pubDate>Sun, 17 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Real-time lip-sync reads TTS audio and morphs avatar mouth shapes, integrated into talk scenes with camera presets and emotes.</description>+ </item>+ <item>+ <title>Team launches with creator-signer split</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-17:Team launches with creator-signer split</guid>+ <pubDate>Sun, 17 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Token launches now support separate signer and creator wallets — the signer pays gas while the creator receives on-chain royalties.</description>+ </item>+ <item>+ <title>Strategy Lab</title>+ <link>https://three.ws/strategy-lab</link>+ <guid isPermaLink="false">2026-05-15:Strategy Lab</guid>+ <pubDate>Fri, 15 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Build DCA and subscription strategies that trade on-chain on your behalf.</description>+ </item>+ <item>+ <title>Avatar accessories and launchpad redesign</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-15:Avatar accessories and launchpad redesign</guid>+ <pubDate>Fri, 15 May 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Avatar customization now supports accessories, and the coin launchpad interface was redesigned for clarity.</description>+ </item>+ <item>+ <title>Token visualizer search and sort</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-15:Token visualizer search and sort</guid>+ <pubDate>Fri, 15 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The interactive 3D token universe gained search by name/symbol/mint and sorting by market cap, live status, replies, and age — refreshing every 60 seconds.</description>+ </item>+ <item>+ <title>15 tutorials and six new paid endpoints</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-14:15 tutorials and six new paid endpoints</guid>+ <pubDate>Thu, 14 May 2026 12:00:00 GMT</pubDate>+ <category>docs</category>+ <description>New developer walkthroughs from embed quickstart to multi-agent coordination, plus six x402 paid endpoints including agent reputation, identity verify, and skill marketplace.</description>+ </item>+ <item>+ <title>Launchpad Studio — no-code hosted pages</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-14:Launchpad Studio — no-code hosted pages</guid>+ <pubDate>Thu, 14 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Pick a template, fill a form, and publish a hosted page for your token or service at /p/<slug> — no code required.</description>+ </item>+ <item>+ <title>Multiplayer walk scenes</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-14:Multiplayer walk scenes</guid>+ <pubDate>Thu, 14 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Live multiplayer walkaround with websocket infrastructure — multiple players see each other in the same 3D scene.</description>+ </item>+ <item>+ <title>x402 commerce — SKUs and hosted checkout</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-14:x402 commerce — SKUs and hosted checkout</guid>+ <pubDate>Thu, 14 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Stripe-like payment UX for x402: define SKUs, share hosted checkout links, and track settlement history — settled on Base via Coinbase CDP.</description>+ </item>+ <item>+ <title>Autonomous X Spaces voice agent</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-13:Autonomous X Spaces voice agent</guid>+ <pubDate>Wed, 13 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A cloud voice agent that joins X Spaces and holds real-time conversations using streaming audio and transcription.</description>+ </item>+ <item>+ <title>Walk</title>+ <link>https://three.ws/walk</link>+ <guid isPermaLink="false">2026-05-10:Walk</guid>+ <pubDate>Sun, 10 May 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Drive a 3D avatar around with a joystick or WASD — toggle the back camera for AR-style passthrough.</description>+ </item>+ <item>+ <title>Launch-week recap published</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-10:Launch-week recap published</guid>+ <pubDate>Sun, 10 May 2026 12:00:00 GMT</pubDate>+ <category>docs</category>+ <description>An interactive case study of launch week (Apr 29 – May 9) with the architecture timeline, partner ecosystem, lessons learned, and live engagement metrics.</description>+ </item>+ <item>+ <title>Marketplace v2 and creator dashboard</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-10:Marketplace v2 and creator dashboard</guid>+ <pubDate>Sun, 10 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Redesigned marketplace with trials, time passes, billing receipts, featured avatar galleries, and theme selection.</description>+ </item>+ <item>+ <title>Monetization v2</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-10:Monetization v2</guid>+ <pubDate>Sun, 10 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Trials, time-based access passes, withdrawal processing, signed receipts, multi-wallet support, and 5% referral splits.</description>+ </item>+ <item>+ <title>Vanity wallet addresses</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-09:Vanity wallet addresses</guid>+ <pubDate>Sat, 09 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Vanity address grinders for Solana and Ethereum, plus co-sign helpers for parallel token launches.</description>+ </item>+ <item>+ <title>$THREE holder gating</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-08:$THREE holder gating</guid>+ <pubDate>Fri, 08 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Holder-gated access now works with a simple on-chain $THREE balance check — no vault setup required.</description>+ </item>+ <item>+ <title>Agent Payments SDK v3.1.0 — multi-chain</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-08:Agent Payments SDK v3.1.0 — multi-chain</guid>+ <pubDate>Fri, 08 May 2026 12:00:00 GMT</pubDate>+ <category>sdk</category>+ <description>Solana v2 bonding curve support plus Base, Polygon, and Ethereum with cross-chain payment routing.</description>+ </item>+ <item>+ <title>Agents that feel the room</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-08:Agents that feel the room</guid>+ <pubDate>Fri, 08 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Agents now react to user sentiment with emotion expressions and animations — empathy, concern, celebration, patience, curiosity.</description>+ </item>+ <item>+ <title>Payments inside chat</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-08:Payments inside chat</guid>+ <pubDate>Fri, 08 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The full agent payments lifecycle is available in chat — balance checks, fund distribution, withdrawals, and USDC whitelist monitoring.</description>+ </item>+ <item>+ <title>Pick your agent's model</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-08:Pick your agent's model</guid>+ <pubDate>Fri, 08 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Chat moved to unified streaming with per-agent model selection across Anthropic, OpenRouter, Groq, and OpenAI.</description>+ </item>+ <item>+ <title>Trading tools in chat</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-08:Trading tools in chat</guid>+ <pubDate>Fri, 08 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Five real trading tools in agent chat: buy, sell, portfolio view, and live price quotes with custom slippage control.</description>+ </item>+ <item>+ <title>x402 spec v2</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-08:x402 spec v2</guid>+ <pubDate>Fri, 08 May 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Upgraded the payment protocol to spec v2 with CAIP-2 network IDs, Bazaar integration, and marketplace listing support.</description>+ </item>+ <item>+ <title>Avatar reactions to market events</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-04:Avatar reactions to market events</guid>+ <pubDate>Mon, 04 May 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Community and personal avatar selection with real-time gesture animations during market events.</description>+ </item>+ <item>+ <title>JavaScript SDK launch</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-04:JavaScript SDK launch</guid>+ <pubDate>Mon, 04 May 2026 12:00:00 GMT</pubDate>+ <category>sdk</category>+ <description>The official three.ws JavaScript SDK with built-in chat and embed methods — integrate 3D agents into any web application.</description>+ </item>+ <item>+ <title>Real-time multiplayer sync</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-04:Real-time multiplayer sync</guid>+ <pubDate>Mon, 04 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Live multiplayer support with real-time room creation, player interactions, and synchronized state.</description>+ </item>+ <item>+ <title>Richer pump.fun feed</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-04:Richer pump.fun feed</guid>+ <pubDate>Mon, 04 May 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Graduation event parsing, gesture animations, and live market cap display in the pump.fun dashboard.</description>+ </item>+ <item>+ <title>Sell your agent's skills</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-04:Sell your agent's skills</guid>+ <pubDate>Mon, 04 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Skill pricing, purchase buttons, and a payment intent API — creators can gate premium skills behind subscriptions or one-time purchases.</description>+ </item>+ <item>+ <title>Lip-sync and Solana Blinks</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-01:Lip-sync and Solana Blinks</guid>+ <pubDate>Fri, 01 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Real-time viseme morphing from audio, plus Solana Blinks support so agents can parse and execute on-chain actions.</description>+ </item>+ <item>+ <title>Plugin marketplace</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-01:Plugin marketplace</guid>+ <pubDate>Fri, 01 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Search, install, and manage community-published agent skills using the open ToolManifest format.</description>+ </item>+ <item>+ <title>Reputation and staking</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-05-01:Reputation and staking</guid>+ <pubDate>Fri, 01 May 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Agent reputation panel with ETH staking for trust signals — reputation accumulates through validator actions tracked on-chain.</description>+ </item>+ <item>+ <title>Chat with voice</title>+ <link>https://three.ws/chat</link>+ <guid isPermaLink="false">2026-04-30:Chat with voice</guid>+ <pubDate>Thu, 30 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Native LLM chat launched with live voice input/output and real-time transcription for agent conversations.</description>+ </item>+ <item>+ <title>On-chain agents on Solana and EVM</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-29:On-chain agents on Solana and EVM</guid>+ <pubDate>Wed, 29 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Unified deployment stack — agents register on Ethereum, Base, Polygon, and Solana with passport pages, reputation, and attestations.</description>+ </item>+ <item>+ <title>Pump.fun launch and trading stack</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-29:Pump.fun launch and trading stack</guid>+ <pubDate>Wed, 29 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Token creation, bonding-curve swaps, KOL trade tracking, automated wallet monitoring, and a vanity address grinder for custom Solana prefixes.</description>+ </item>+ <item>+ <title>Solana Agent SDK</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-29:Solana Agent SDK</guid>+ <pubDate>Wed, 29 Apr 2026 12:00:00 GMT</pubDate>+ <category>sdk</category>+ <description>Actions for token transfers, SPL swaps, balance queries, and stake attestations, with transaction builders and fee estimation.</description>+ </item>+ <item>+ <title>three.ws in Anthropic's MCP Registry</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-29:three.ws in Anthropic's MCP Registry</guid>+ <pubDate>Wed, 29 Apr 2026 12:00:00 GMT</pubDate>+ <category>sdk</category>+ <description>Published to the official MCP Registry — Claude can deploy agents, create tokens, and run wallet operations on three.ws via the standard MCP protocol.</description>+ </item>+ <item>+ <title>x402 micropayments</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-29:x402 micropayments</guid>+ <pubDate>Wed, 29 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Facilitator-mediated USDC micropayments — MCP clients authorize requests with payment headers, with per-tool pricing and subscription bypass.</description>+ </item>+ <item>+ <title>3D viewer polish</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-27:3D viewer polish</guid>+ <pubDate>Mon, 27 Apr 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>Better first-load camera framing, keyboard shortcuts, saved per-agent animation preferences, and improved mobile accessibility.</description>+ </item>+ <item>+ <title>Create-to-deploy flow</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-27:Create-to-deploy flow</guid>+ <pubDate>Mon, 27 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A streamlined creator path: create, edit, see your 3D body on your public profile, and deploy on-chain with chain selection — with onboarding for first-time creators.</description>+ </item>+ <item>+ <title>Hello, three.ws</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-27:Hello, three.ws</guid>+ <pubDate>Mon, 27 Apr 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The platform rebranded from 3D Agent to three.ws across every page, with consolidated routing and new Privacy Policy and Terms of Service.</description>+ </item>+ <item>+ <title>Avatars that never sit still</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-17:Avatars that never sit still</guid>+ <pubDate>Fri, 17 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>A four-channel idle animation loop — breathing, eye saccades, blinks, weight shifts — keeps avatars naturally alive during silence.</description>+ </item>+ <item>+ <title>Embeds with action bridges</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-17:Embeds with action bridges</guid>+ <pubDate>Fri, 17 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Agent embeds can be hosted on external sites with persistent state, live Studio preview, and bridges for inter-agent communication.</description>+ </item>+ <item>+ <title>On-chain agent discovery</title>+ <link>https://three.ws/discover</link>+ <guid isPermaLink="false">2026-04-17:On-chain agent discovery</guid>+ <pubDate>Fri, 17 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The /discover page lists every ERC-8004 agent owned by your wallet with one-click import, plus a LobeHub plugin for LLM orchestration.</description>+ </item>+ <item>+ <title>Widget Studio is born</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-16:Widget Studio is born</guid>+ <pubDate>Thu, 16 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The first version of Widget Studio — build, preview, and save custom avatar widgets with a drag-drop editor and live updates.</description>+ </item>+ <item>+ <title>3D model validation tools</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-15:3D model validation tools</guid>+ <pubDate>Wed, 15 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Model validation, inspection, and optimization APIs for GLB/FBX files — asset analysis and format conversion to guarantee avatar quality.</description>+ </item>+ <item>+ <title>Wallet sign-in and on-chain identity</title>+ <link>https://three.ws/changelog</link>+ <guid isPermaLink="false">2026-04-15:Wallet sign-in and on-chain identity</guid>+ <pubDate>Wed, 15 Apr 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Sign-In with Ethereum, wallet integration, and the ERC-8004 Passport widget — agents display cryptographic proof of identity tied to wallet ownership.</description>+ </item>+ </channel>+</rss>diff --git a/public/changelog/index.html b/public/changelog/index.htmlindex 6953a466c..1e2dcd697 100644--- a/public/changelog/index.html+++ b/public/changelog/index.html@@ -4,8 +4,9 @@<meta charset="utf-8" /><meta name="viewport" content="width=device-width,initial-scale=1" /><title>Changelog · three.ws</title>-<meta name="description" content="What's new on three.ws — public feature history, newest first." />+<meta name="description" content="What's new on three.ws — features, improvements, and releases, newest first." /><link rel="canonical" href="https://three.ws/changelog" />+<link rel="alternate" type="application/rss+xml" title="three.ws changelog" href="/changelog.xml" /><link rel="stylesheet" href="/nav.css" /><link rel="stylesheet" href="/footer.css" /><style>@@ -15,16 +16,30 @@.cl-hero h1 { font-size: clamp(34px, 5vw, 52px); margin: 0 0 12px; letter-spacing: -0.02em; }.cl-hero p { color: #b6b6b6; font-size: 17px; margin: 0 0 8px; line-height: 1.55; }.cl-hero a { color: #cccccc; }+ .cl-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; }+ .cl-filter { background: #0d0d0d; border: 1px solid #1d1d1d; color: #b6b6b6; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: border-color .15s, color .15s; }+ .cl-filter:hover { border-color: #555555; color: #ffffff; }+ .cl-filter:focus-visible { outline: 2px solid #66ffaa; outline-offset: 2px; }+ .cl-filter[aria-pressed="true"] { border-color: #66ffaa; color: #66ffaa; background: #0c1c14; }.cl-day { margin: 44px 0 0; padding-top: 28px; border-top: 1px solid #1d1d1d; }.cl-day:first-of-type { border-top: none; padding-top: 0; }.cl-date { font-size: 13px; color: #777777; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; margin: 0 0 16px; }.cl-item { display: block; background: #0d0d0d; border: 1px solid #1d1d1d; border-radius: 12px; padding: 16px 18px; margin-bottom: 10px; text-decoration: none; transition: border-color .15s, transform .15s; }- .cl-item:hover { border-color: #ffffff; transform: translateY(-1px); }+ a.cl-item:hover, a.cl-item:focus-visible { border-color: #ffffff; transform: translateY(-1px); outline: none; }.cl-item-title { color: #fff; font-weight: 600; font-size: 15px; }.cl-item-path { color: #777777; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-left: 8px; }.cl-item-desc { color: #b6b6b6; font-size: 13px; line-height: 1.5; margin-top: 6px; }.cl-empty, .cl-error { color: #9a9a9a; font-size: 15px; }- .cl-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #66ffaa; border: 1px solid #1f4a3f; background: #0c1c14; border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }+ .cl-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }+ .cl-badge-new { color: #66ffaa; border: 1px solid #1f4a3f; background: #0c1c14; }+ .cl-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; margin-right: 6px; border: 1px solid #2a2a2a; color: #9a9a9a; background: #111111; }+ .cl-tag-launch { color: #66ffaa; border-color: #1f4a3f; background: #0c1c14; }+ .cl-tag-feature { color: #7ec8ff; border-color: #1d3a52; background: #0b141d; }+ .cl-tag-improvement { color: #d8b4ff; border-color: #3a2752; background: #150d1d; }+ .cl-tag-fix { color: #ffd27e; border-color: #523f1d; background: #1d150b; }+ .cl-tag-security { color: #ff8e8e; border-color: #521d1d; background: #1d0b0b; }+ .cl-tag-sdk { color: #8effd9; border-color: #1d5240; background: #0b1d16; }+ .cl-tags { margin-top: 10px; }</style></head><body>@@ -33,14 +48,20 @@<main class="cl-wrap"><div class="cl-hero"><h1>Changelog</h1>- <p>What's new on three.ws, newest first. Machine-readable: <a href="/api/features.json">features.json</a>, <a href="/llms.txt">llms.txt</a>, <a href="/sitemap">sitemap</a>.</p>+ <p>Everything shipped on three.ws, newest first — new pages, features, improvements, fixes, and releases.</p>+ <p>Follow along: <a href="/changelog.xml">RSS</a> · <a href="/changelog.json">JSON feed</a> · <a href="/llms.txt">llms.txt</a> · <a href="/sitemap">sitemap</a></p>+ <div class="cl-filters" id="cl-filters" role="group" aria-label="Filter changelog entries"></div></div><div id="cl-content"><p class="cl-empty">Loading…</p></div></main><script type="module">- const RECENT_DAYS = 30;+ const RECENT_DAYS = 14;const elt = document.getElementById('cl-content');+ const filtersElt = document.getElementById('cl-filters');+ const FILTERS = ['all', 'launch', 'feature', 'improvement', 'fix', 'sdk', 'security', 'infra', 'docs'];+ let activeFilter = 'all';+ let entries = [];function fmtDate(iso) {try {@@ -50,46 +71,66 @@} catch { return iso; }}- try {- const res = await fetch('/api/features.json', { headers: { accept: 'application/json' } });- if (!res.ok) throw new Error('manifest ' + res.status);- const data = await res.json();+ const esc = (s) => String(s ?? '').replace(/[<>&"]/g, (c) => ({ '<': '<', '>': '>', '&': '&', '"': '"' })[c]);++ function entryTags(e) {+ return e.type === 'launch' ? ['launch'] : e.tags || [];+ }- const dated = [];- for (const s of data.sections || []) {- for (const p of s.pages || []) {- if (p.added) dated.push(p);- }+ function render() {+ const visible = activeFilter === 'all' ? entries : entries.filter((e) => entryTags(e).includes(activeFilter));+ if (visible.length === 0) {+ elt.innerHTML = '<p class="cl-empty">Nothing here for this filter yet — try another one.</p>';+ return;}- if (dated.length === 0) {- elt.innerHTML = '<p class="cl-empty">No dated features yet — check back soon.</p>';- } else {- const byDate = new Map();- for (const p of dated) {- if (!byDate.has(p.added)) byDate.set(p.added, []);- byDate.get(p.added).push(p);- }- const dates = [...byDate.keys()].sort((a, b) => (a < b ? 1 : -1));- const now = Date.now();- const html = dates.map((date) => {- const isNew = (now - new Date(date + 'T00:00:00Z').getTime()) < RECENT_DAYS * 86400000;- const items = byDate.get(date)- .sort((a, b) => a.title.localeCompare(b.title))- .map((p) => `- <a class="cl-item" href="${p.path}">- <span class="cl-item-title">${p.title}</span>- <span class="cl-item-path">${p.path}</span>- <div class="cl-item-desc">${p.description || ''}</div>- </a>`).join('');- return `<section class="cl-day">- <p class="cl-date">${fmtDate(date)}${isNew ? '<span class="cl-badge">new</span>' : ''}</p>- ${items}- </section>`;- }).join('');- elt.innerHTML = html;+ const byDate = new Map();+ for (const e of visible) {+ if (!byDate.has(e.date)) byDate.set(e.date, []);+ byDate.get(e.date).push(e);}+ const now = Date.now();+ elt.innerHTML = [...byDate.entries()].map(([date, items]) => {+ const isNew = (now - new Date(date + 'T00:00:00Z').getTime()) < RECENT_DAYS * 86400000;+ const cards = items.map((e) => {+ const tags = entryTags(e).map((t) => `<span class="cl-tag cl-tag-${esc(t)}">${esc(t)}</span>`).join('');+ const inner = `+ <span class="cl-item-title">${esc(e.title)}</span>+ ${e.type === 'launch' ? `<span class="cl-item-path">${esc(e.link)}</span>` : ''}+ <div class="cl-item-desc">${esc(e.summary)}</div>+ <div class="cl-tags">${tags}</div>`;+ return e.link+ ? `<a class="cl-item" href="${esc(e.link)}">${inner}</a>`+ : `<div class="cl-item">${inner}</div>`;+ }).join('');+ return `<section class="cl-day">+ <p class="cl-date">${fmtDate(date)}${isNew ? '<span class="cl-badge cl-badge-new">new</span>' : ''}</p>+ ${cards}+ </section>`;+ }).join('');+ }++ function renderFilters() {+ filtersElt.innerHTML = FILTERS.map((f) =>+ `<button class="cl-filter" type="button" data-filter="${f}" aria-pressed="${f === activeFilter}">${f === 'all' ? 'All' : f}</button>`,+ ).join('');+ filtersElt.querySelectorAll('.cl-filter').forEach((btn) => {+ btn.addEventListener('click', () => {+ activeFilter = btn.dataset.filter;+ renderFilters();+ render();+ });+ });+ }++ try {+ const res = await fetch('/changelog.json', { headers: { accept: 'application/json' } });+ if (!res.ok) throw new Error('feed ' + res.status);+ const data = await res.json();+ entries = data.entries || [];+ renderFilters();+ render();} catch (err) {- elt.innerHTML = '<p class="cl-error">Couldn\'t load the changelog right now. Try <a href="/api/features.json">features.json</a> directly.</p>';+ elt.innerHTML = '<p class="cl-error">Couldn\'t load the changelog right now. Try the <a href="/changelog.json">JSON feed</a> directly.</p>';console.error('[changelog]', err);}</script>diff --git a/public/club/props/pole.glb b/public/club/props/pole.glbindex 802ead9de..add08ac35 100644Binary files a/public/club/props/pole.glb and b/public/club/props/pole.glb differdiff --git a/public/club/props/stage.glb b/public/club/props/stage.glbindex 41566f742..545ba2215 100644Binary files a/public/club/props/stage.glb and b/public/club/props/stage.glb differdiff --git a/public/club/venue/club-venue.glb b/public/club/venue/club-venue.glbindex 2c6105cae..dd387df14 100644Binary files a/public/club/venue/club-venue.glb and b/public/club/venue/club-venue.glb differdiff --git a/public/dashboard-next/shell.css b/public/dashboard-next/shell.cssindex 928505f4d..dfefb9ceb 100644--- a/public/dashboard-next/shell.css+++ b/public/dashboard-next/shell.css@@ -620,6 +620,12 @@ button { font: inherit; color: inherit; background: none; border: none; cursor:transform 100ms ease-out;}.dn-btn:active { transform: scale(0.98); }+.dn-topbar-btn:active { transform: scale(0.96); }+.dn-topbar-search:active { background: rgba(255, 255, 255, 0.09); }+.dn-topbar-user { transition: background 120ms ease, border-color 120ms ease; }+.dn-topbar-user:active { background: rgba(255, 255, 255, 0.09); }+.dn-rail-item:active { background: rgba(255, 255, 255, 0.07); color: var(--nxt-ink); }+.dn-rail-mobile-slot:active { background: var(--nxt-accent-soft); }/* ── Sidebar collapse animation ───────────────────────────────────────── */.dn-shell {@@ -666,6 +672,14 @@ button { font: inherit; color: inherit; background: none; border: none; cursor:}.dn-panel:hover { transform: none; }.dn-btn:active { transform: none; }+ .dn-topbar-btn:active { transform: none; }+ .dn-topbar-search,+ .dn-topbar-user,+ .dn-rail-item,+ .dn-rail-mobile-slot,+ .dn-mobile-sheet-item {+ transition: none !important;+ }}/* ── Focus rings ──────────────────────────────────────────────────────── */diff --git a/public/demo/avatar-os/index.html b/public/demo/avatar-os/index.htmlindex 26b1816d6..2ab14e339 100644--- a/public/demo/avatar-os/index.html+++ b/public/demo/avatar-os/index.html@@ -11,9 +11,7 @@</head><body><header class="os-header">- <div class="brand">- three.ws<span class="tag">avatar-os demo</span>- </div>+ <div class="brand">three.ws<span class="tag">avatar-os demo</span></div><nav><a href="/demo/avatar-os/" class="active">overview</a><a href="/demo/avatar-os/studio.html">studio</a>@@ -23,25 +21,25 @@</header><main class="os-main"><div class="banner">- <strong>Isolated demo workspace.</strong> Nothing here touches the- production Avaturn pipeline. Goal: prove out a fully open-source- replacement before promoting it.+ <strong>Isolated demo workspace.</strong> Nothing here touches the production+ Avaturn pipeline. Goal: prove out a fully open-source replacement before promoting+ it.</div><h1 style="margin: 0 0 8px; font-size: 28px">Open-source avatar pipeline</h1><p style="color: var(--text-2); max-width: 720px; line-height: 1.6">- Three parallel paths replace what we currently get from Avaturn. Each- demo is end-to-end functional — capture, generate, preview, export GLB.- No mocks, no fake data.+ Three parallel paths replace what we currently get from Avaturn. Each demo is+ end-to-end functional — capture, generate, preview, export GLB. No mocks, no fake+ data.</p><div class="tile-grid"><a class="tile" href="/demo/avatar-os/studio.html"><h3>Studio · customization editor</h3><p>- Embeds the open-source CharacterStudio (M3-org / Apache-2.0)- editor. Pick a base avatar, customize traits, export GLB. Replaces- the Avaturn iframe editor.+ Embeds the open-source CharacterStudio (M3-org / Apache-2.0) editor. Pick a+ base avatar, customize traits, export GLB. Replaces the Avaturn iframe+ editor.</p><div class="meta">stack: @m3-org/characterstudio · @pixiv/three-vrm · three.js@@ -50,19 +48,16 @@<a class="tile" href="/demo/avatar-os/selfie.html"><h3>Selfie · photo → 3D face mesh</h3><p>- MediaPipe Face Landmarker (Apache-2.0) runs entirely in-browser to- build a textured 3D mesh from one selfie. Replaces the Avaturn- photo-to-avatar API.+ MediaPipe Face Landmarker (Apache-2.0) runs entirely in-browser to build a+ textured 3D mesh from one selfie. Replaces the Avaturn photo-to-avatar API.</p>- <div class="meta">- stack: @mediapipe/tasks-vision · three.js · WebGL- </div>+ <div class="meta">stack: @mediapipe/tasks-vision · three.js · WebGL</div></a><a class="tile" href="/demo/avatar-os/combined.html"><h3>Combined · selfie face + Studio body</h3><p>- Stitches the selfie face mesh onto a Studio body GLB and exports- a single merged GLB. Closest analogue to the Avaturn end product.+ Stitches the selfie face mesh onto a Studio body GLB and exports a single+ merged GLB. Closest analogue to the Avaturn end product.</p><div class="meta">stack: all of the above + GLTFExporter</div></a>@@ -73,8 +68,8 @@<ul style="color: var(--text-2); line-height: 1.8; font-size: 14px"><li>MediaPipe Tasks Vision pulled via npm- (<code>@mediapipe/tasks-vision</code>). WASM + model files- fetch from Google's CDN at runtime.+ (<code>@mediapipe/tasks-vision</code>). WASM + model files fetch from+ Google's CDN at runtime.</li><li>Triangulation indices from@@ -85,12 +80,11 @@(Apache-2.0) — vendored at <code>src/demo/triangulation.js</code>.</li><li>- CharacterStudio is the existing- <code>character-studio/</code> workspace (M3-org, AGPL — under- review). Demo expects the dev server at- <code>http://localhost:5173</code>; run- <code>npm --prefix character-studio run dev</code> in a second- terminal.+ The Avatar Studio is the existing+ <code>character-studio/</code> workspace (M3-org, AGPL — under review),+ served same-origin at <code>/avatar-studio</code> in dev and production.+ Build it once with <code>npm --prefix character-studio run build</code>, or+ point <code>VITE_CHARACTER_STUDIO_URL</code> at a standalone studio server.</li><li>GLB export uses three.js's@@ -115,7 +109,7 @@<div class="status" id="glb-status">checking…</div></div><div class="tile">- <h3>CharacterStudio dev server</h3>+ <h3>Avatar Studio</h3><div class="status" id="cs-status">checking…</div></div></div>@@ -123,5 +117,5 @@</main><script type="module" src="/src/demo/os-hub.js"></script><script src="/brand.js" defer></script>-</body>+ </body></html>diff --git a/public/demo/avatar-os/studio.html b/public/demo/avatar-os/studio.htmlindex c8ead1d2b..b0f61ebcd 100644--- a/public/demo/avatar-os/studio.html+++ b/public/demo/avatar-os/studio.html@@ -11,9 +11,7 @@</head><body><header class="os-header">- <div class="brand">- three.ws<span class="tag">avatar-os · studio</span>- </div>+ <div class="brand">three.ws<span class="tag">avatar-os · studio</span></div><nav><a href="/demo/avatar-os/">overview</a><a href="/demo/avatar-os/studio.html" class="active">studio</a>@@ -23,9 +21,8 @@</header><main class="os-main"><div class="banner">- <strong>CharacterStudio editor.</strong> Open-source customization- editor (M3-org). Built on @pixiv/three-vrm. Replaces the Avaturn iframe- editor.+ <strong>CharacterStudio editor.</strong> Open-source customization editor (M3-org).+ Built on @pixiv/three-vrm. Replaces the Avaturn iframe editor.</div><div class="os-grid">@@ -33,16 +30,16 @@<div class="os-card"><h2>1 · Open editor</h2><p>- Loads CharacterStudio in an iframe. Configure the dev server URL- or use the public CharacterStudio build.+ Loads the three.ws Avatar Studio in an iframe — served same-origin at+ <span class="kbd">/avatar-studio</span> (override with+ <span class="kbd">VITE_CHARACTER_STUDIO_URL</span>) — or use the public+ CharacterStudio build.</p><div class="btn-row">- <button id="btn-open-local" class="btn btn-primary">- Open localhost:5173- </button>- <button id="btn-open-public" class="btn">- Open public build+ <button id="btn-open-studio" class="btn btn-primary">+ Open Avatar Studio</button>+ <button id="btn-open-public" class="btn">Open public build</button></div><div class="status" id="studio-status">idle</div></div>@@ -51,17 +48,12 @@<h2>2 · Export</h2><p>In CharacterStudio, click <span class="kbd">Export</span> ·- <span class="kbd">VRM</span> or <span class="kbd">GLB</span>.- This page listens for the export message and renders the result- below.+ <span class="kbd">VRM</span> or <span class="kbd">GLB</span>. This page+ listens for the export message and renders the result below.</p><div class="btn-row">- <button id="btn-download" class="btn" disabled>- Download GLB- </button>- <button id="btn-save" class="btn" disabled>- Save to my avatars- </button>+ <button id="btn-download" class="btn" disabled>Download GLB</button>+ <button id="btn-save" class="btn" disabled>Save to my avatars</button></div><div class="status" id="export-status">no export yet</div></div>@@ -79,13 +71,9 @@</aside><section>- <div- id="iframe-host"- class="viewer"- style="min-height: 600px; padding: 0"- >+ <div id="iframe-host" class="viewer" style="min-height: 600px; padding: 0"><div class="overlay" id="iframe-empty">- Click <span class="kbd">Open localhost:5173</span> to start+ Click <span class="kbd">Open Avatar Studio</span> to start</div></div>@@ -101,5 +89,5 @@</main><script type="module" src="/src/demo/os-studio.js"></script><script src="/brand.js" defer></script>-</body>+ </body></html>diff --git a/public/demos/brain.html b/public/demos/brain.htmlindex d0f657f68..4f9d27fdf 100644--- a/public/demos/brain.html+++ b/public/demos/brain.html@@ -14,8 +14,8 @@<link rel="stylesheet" href="/style.css"/><link rel="stylesheet" href="/nav.css"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/styles/github-dark-dimmed.min.css"/>-<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>-<script src="https://cdn.jsdelivr.net/npm/marked@12/marked.min.js"></script>+<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js" integrity="sha384-F/bZzf7p3Joyp5psL90p/p89AZJsndkSoGwRpXcZhleCWhd8SnRuoYo4d0yirjJp" crossorigin="anonymous"></script>+<script src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js" integrity="sha384-/TQbtLCAerC3jgaim+N78RZSDYV7ryeoBCVqTuzRrFec2akfBkHS7ACQ3PQhvMVi" crossorigin="anonymous"></script><style>:root{color-scheme:dark;--bg:#060606;--s0:#0b0b0b;--s1:#0f0f0f;--s2:#151515;--b0:#1c1c1c;--b1:#262626;--b2:#323232;--t0:#e8e9f0;--t1:#a0a2b4;--t2:#6e7088;--t3:#484a60;--accent:#3dc1ff;--accent-dim:rgba(61,193,255,0.1);--ok:#22d17a;--ok-dim:rgba(34,209,122,0.12);--warn:#f5a623;--err:#ff5a5a;--r:12px;--rs:8px;--sidebar-w:260px}*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}diff --git a/public/demos/create-v2.html b/public/demos/create-v2.htmlindex 4e7fcd7f8..f71525f46 100644--- a/public/demos/create-v2.html+++ b/public/demos/create-v2.html@@ -5,7 +5,7 @@<meta name="viewport" content="width=device-width, initial-scale=1" /><title>Create avatar v2 demo · three.ws</title><meta name="robots" content="noindex" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>:root {color-scheme: dark;diff --git a/public/demos/gallery-picker.html b/public/demos/gallery-picker.htmlindex 8288ad061..b898f928f 100644--- a/public/demos/gallery-picker.html+++ b/public/demos/gallery-picker.html@@ -9,7 +9,7 @@<link rel="stylesheet" href="/nav.css" /><scripttype="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js"+ src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js" integrity="sha384-Ftcjj/GNLxPvzNDftO/oryXB9aGxsGZY9JGqsXG0uUKgQDl9RfDgsx9NJ/4IVNPe" crossorigin="anonymous"></script><style>:root { color-scheme: dark; }diff --git a/public/demos/usdz-ar.html b/public/demos/usdz-ar.htmlindex ab8792b7a..69ae2163d 100644--- a/public/demos/usdz-ar.html+++ b/public/demos/usdz-ar.html@@ -9,7 +9,7 @@<link rel="stylesheet" href="/nav.css" /><scripttype="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js"+ src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js" integrity="sha384-Ftcjj/GNLxPvzNDftO/oryXB9aGxsGZY9JGqsXG0uUKgQDl9RfDgsx9NJ/4IVNPe" crossorigin="anonymous"></script><style>:root { color-scheme: dark; }diff --git a/public/discover/index.html b/public/discover/index.htmlindex 1ebbb63fc..1d1bbee40 100644--- a/public/discover/index.html+++ b/public/discover/index.html@@ -33,7 +33,7 @@<link rel="stylesheet" href="/fonts/fonts.css" /><scripttype="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"+ 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>.explore-card-thumb model-viewer.explore-card-mv {diff --git a/public/docs-widgets.html b/public/docs-widgets.htmlindex 052285734..8d5a32752 100644--- a/public/docs-widgets.html+++ b/public/docs-widgets.html@@ -26,7 +26,7 @@<link rel="stylesheet" href="/widgets-gallery/gallery.css" /><link rel="stylesheet" href="/footer.css" /><link rel="stylesheet" href="/nav.css" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>.docs-main {max-width: 760px;diff --git a/public/features.json b/public/features.jsonindex 3969ee161..43ab2d7fc 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-10T02:18:53.597Z",+ "generated_at": "2026-06-11T01:05:35.227Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/footer.css b/public/footer.cssindex 1f1094978..3480f30a0 100644--- a/public/footer.css+++ b/public/footer.css@@ -500,12 +500,41 @@background: rgba(255, 255, 255, 0.07);}-.h-footer-horizon a:focus-visible {+.h-footer-horizon a:focus-visible,+.h-footer-horizon button:focus-visible,+.h-footer-newsletter-input:focus-visible {outline: 2px solid rgba(255, 255, 255, 0.5);outline-offset: 3px;border-radius: 4px;}+/* ── Microinteractions (B11) — press states + reduced motion ──────────── */+.h-footer-newsletter-btn:active:not(:disabled) { background: rgba(255, 255, 255, 0.28); transform: translateX(2px) scale(0.95); }+.h-footer-community-btn:active { background: rgba(255, 255, 255, 0.12); transform: translateY(0); }+.h-footer-social:active { background: rgba(255, 255, 255, 0.14); transform: translateY(0); }+.h-footer-badge:active { background: rgba(255, 255, 255, 0.09); transform: translateY(0); }+.h-footer-ca-btn:active { background: rgba(255, 255, 255, 0.12); color: #fff; }+.h-footer-links a:active,+.h-footer-legal-links a:active { color: rgba(255, 255, 255, 0.85); }++@media (prefers-reduced-motion: reduce) {+ .h-footer-floor,+ .h-footer-status-dot {+ animation: none;+ }+ .h-footer-horizon a,+ .h-footer-horizon button,+ .h-footer-newsletter-form,+ .h-footer-social,+ .h-footer-badge {+ transition: none !important;+ }+ .h-footer-newsletter-btn:hover,+ .h-footer-community-btn:hover,+ .h-footer-social:hover,+ .h-footer-badge:hover { transform: none; }+}+@media (max-width: 720px) {.h-footer-horizon {min-height: 320px;diff --git a/public/forgot-password.html b/public/forgot-password.htmlindex 7cd664c8d..773f6a254 100644--- a/public/forgot-password.html+++ b/public/forgot-password.html@@ -8,7 +8,7 @@<link rel="stylesheet" href="/auth.css" /><scripttype="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"+ 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>:root { color-scheme: dark; }diff --git a/public/gallery/index.html b/public/gallery/index.htmlindex f30d00fe3..8da763e21 100644--- a/public/gallery/index.html+++ b/public/gallery/index.html@@ -29,7 +29,7 @@<meta name="twitter:image" content="https://three.ws/og-image.png" /><link rel="shortcut icon" href="/favicon.ico" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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><link rel="stylesheet" href="/style.css" /><link rel="stylesheet" href="/nav.css" /><link rel="stylesheet" href="/gallery/gallery.css" />diff --git a/public/gmgn.html b/public/gmgn.htmlindex b4777c97b..0a63e7442 100644--- a/public/gmgn.html+++ b/public/gmgn.html@@ -21,7 +21,7 @@<link rel="stylesheet" href="/footer.css" /><link rel="stylesheet" href="/nav.css" /><link rel="stylesheet" href="/fonts/fonts.css" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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><script defer src="/footer-newsletter.js"></script><style>:root { color-scheme: dark; --accent: #ffffff; --gmgn: #00c896; --border: #1f1f1f; --bg: #000000; --panel: #141414; --muted: #888; --header-h: 48px; }diff --git a/public/login.html b/public/login.htmlindex 9fc76fe73..0e215323e 100644--- a/public/login.html+++ b/public/login.html@@ -13,7 +13,7 @@<link rel="icon" href="/favicon.ico" /><scripttype="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"+ 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><meta name="wc-project-id" content="e8a3fdf0b2dc66fa96b47582f55ec3d9" /><link rel="stylesheet" href="/wallet-connect.css" />diff --git a/public/lookup.html b/public/lookup.htmlindex f4e2e68b3..4866bf575 100644--- a/public/lookup.html+++ b/public/lookup.html@@ -10,7 +10,7 @@/><scripttype="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"+ 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>* {diff --git a/public/marketplace-v2.css b/public/marketplace-v2.cssindex 3404f316f..5a442972a 100644--- a/public/marketplace-v2.css+++ b/public/marketplace-v2.css@@ -642,6 +642,83 @@ body.market-page > #footer-container {50% { opacity: 1; }}+/* ── Microinteractions (B11) — focus rings, press states, modal motion ── */++/* Shared focus ring for every interactive element this sheet introduces. */+.market-author-btn:focus-visible,+.market-preview-input:focus-visible,+.market-preview-send:focus-visible,+.market-sidebar-toggle:focus-visible,+.creator-modal-close:focus-visible,+.creator-mini-card:focus-visible,+.star-pick:focus-visible,+.submit-review:focus-visible,+.review-login-cta:focus-visible,+.review-edit-btn:focus-visible,+.review-delete-btn:focus-visible,+.review-cancel-btn:focus-visible,+#d-rating-input textarea:focus-visible,+#d-review-body:focus-visible,+#d-review-body-edit:focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);+ outline-offset: var(--focus-ring-offset, 2px);+}++/* Chat preview send — transition the hover lift it already had, add press. */+.market-preview-send {+ transition:+ transform var(--duration-fast, 140ms) var(--ease-standard, ease),+ opacity var(--duration-fast, 140ms) var(--ease-standard, ease);+}+.market-preview-send:active:not(:disabled) { transform: translateY(0) scale(0.97); }+.market-author-btn:active { color: rgba(255, 255, 255, 0.7); }++/* Creator modal — panel scales/slides in with the overlay fade, never pops. */+.creator-modal {+ transform: translateY(10px) scale(0.98);+ transition:+ transform var(--duration-base, 220ms) var(--ease-emphasized, cubic-bezier(0.22, 1, 0.36, 1)),+ opacity var(--duration-base, 220ms) var(--ease-standard, ease);+}+.creator-modal-overlay.show .creator-modal { transform: translateY(0) scale(1); }+.creator-modal-close {+ transition:+ background var(--duration-instant, 80ms) var(--ease-standard, ease),+ border-color var(--duration-instant, 80ms) var(--ease-standard, ease),+ color var(--duration-instant, 80ms) var(--ease-standard, ease);+}+.creator-modal-close:hover { background: rgba(255, 255, 255, 0.1); border-color: #2a2a2a; }+.creator-modal-close:active { background: rgba(255, 255, 255, 0.16); }+.creator-mini-card:active { transform: translateY(0) scale(0.98); }++/* Review controls — press feedback to match their hover states. */+.star-pick:active { transform: scale(0.95); }+.submit-review:active:not(:disabled) { opacity: 0.76; }+.review-edit-btn:active,+.review-cancel-btn:active { background: rgba(255, 255, 255, 0.06); }+.review-delete-btn:active { background: rgba(248, 113, 113, 0.1); }++/* Reduced motion: literal durations in this sheet need an explicit kill. */+@media (prefers-reduced-motion: reduce) {+ .market-preview-bubble.streaming::after { animation: none; opacity: 1; }+ .review-skeleton-line { animation: none; opacity: 0.7; }+ .creator-modal,+ .creator-modal-overlay,+ .creator-modal-close,+ .creator-mini-card,+ .market-author-btn,+ .market-preview-send,+ .star-pick,+ .breakdown-fill,+ .market-sidebar {+ transition: none !important;+ }+ .creator-modal { transform: none; }+ .star-pick:hover,+ .creator-mini-card:hover,+ .market-preview-send:hover:not(:disabled) { transform: none; }+}+/* ── Mobile responsive ─────────────────────────────────────────────────── */.market-sidebar-toggle {display: none;@@ -719,3 +796,24 @@ body.market-sidebar-open .market-sidebar-backdrop {grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));}}++/* Sidebar drawer toggle + backdrop — hover/press states and a soft fade-in+ (the backdrop is display-toggled, so it animates in via keyframe). */+.market-sidebar-toggle {+ transition:+ background var(--duration-instant, 80ms) var(--ease-standard, ease),+ border-color var(--duration-instant, 80ms) var(--ease-standard, ease);+}+.market-sidebar-toggle:hover { background: #181818; border-color: #3a3a3a; }+.market-sidebar-toggle:active { background: #222; }+body.market-sidebar-open .market-sidebar-backdrop {+ animation: mk2-backdrop-in var(--duration-base, 220ms) var(--ease-out, ease-out) both;+}+@keyframes mk2-backdrop-in {+ from { opacity: 0; }+ to { opacity: 1; }+}+@media (prefers-reduced-motion: reduce) {+ body.market-sidebar-open .market-sidebar-backdrop { animation: none; }+ .market-sidebar-toggle { transition: none; }+}diff --git a/public/marketplace.css b/public/marketplace.cssindex 5923766e8..bb58b7728 100644--- a/public/marketplace.css+++ b/public/marketplace.css@@ -4240,3 +4240,129 @@ body.market-page > header {.review-mine-notice { flex-direction: column; align-items: flex-start; gap: 8px; }.review-header { flex-wrap: wrap; }}++/* ══════════════════════════════════════════════════════════════════════════+ Microinteractions (B11) — consolidated focus rings, press states, entrance+ motion for the marketplace surface. Tokens from /tokens.css; transform/+ opacity only; reduced-motion honored at the end of the block.+ ══════════════════════════════════════════════════════════════════════════ */++/* Card grid entrance — staggered fade-up when the grid (re)renders. Capped at+ the first twelve children so deep pagination doesn't animate offscreen. */+.market-grid > * {+ animation: mk-card-rise var(--duration-slow, 420ms) var(--ease-emphasized, cubic-bezier(0.22, 1, 0.36, 1)) both;+}+.market-grid > *:nth-child(2) { animation-delay: 40ms; }+.market-grid > *:nth-child(3) { animation-delay: 80ms; }+.market-grid > *:nth-child(4) { animation-delay: 120ms; }+.market-grid > *:nth-child(5) { animation-delay: 160ms; }+.market-grid > *:nth-child(6) { animation-delay: 200ms; }+.market-grid > *:nth-child(7) { animation-delay: 240ms; }+.market-grid > *:nth-child(8) { animation-delay: 280ms; }+.market-grid > *:nth-child(9) { animation-delay: 320ms; }+.market-grid > *:nth-child(10) { animation-delay: 360ms; }+.market-grid > *:nth-child(11) { animation-delay: 400ms; }+.market-grid > *:nth-child(12) { animation-delay: 440ms; }+@keyframes mk-card-rise {+ from { opacity: 0; transform: translateY(10px); }+ to { opacity: 1; transform: translateY(0); }+}++/* Shared focus ring — every interactive element on this surface. */+.market-nav a:focus-visible,+.cat-row:focus-visible,+.market-cat-chip:focus-visible,+.market-chip:focus-visible,+.market-hero-cta:focus-visible,+.market-hero-secondary:focus-visible,+.market-avatar-detail-cta:focus-visible,+.market-avatar-detail .btn-secondary:focus-visible,+.tool-detail-cta:focus-visible,+.market-tool-detail .btn-secondary:focus-visible,+.tool-detail-pills button.tag-pill:focus-visible,+.purchase-btn:focus-visible,+.skill-btn.purchase:focus-visible,+.market-fork:focus-visible,+.related-card:focus-visible,+.plugin-add-url-btn:focus-visible,+.plugin-install-btn:focus-visible,+.market-submit-btn:focus-visible,+.market-submit-avatar-btn:focus-visible,+.market-mine-cta:focus-visible,+.market-empty-redirect button:focus-visible,+.market-wip-dismiss:focus-visible,+.market-tag-banner-clear:focus-visible,+.earn-txn:focus-visible,+.earn-show-more:focus-visible,+.card-heart:focus-visible,+.card-author:focus-visible,+#avatar-modal-bookmark:focus-visible,+.avatar-modal-author a:focus-visible,+.d-embed-copy:focus-visible,+.d-token-btn:focus-visible,+.d-token-btn-sec:focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);+ outline-offset: var(--focus-ring-offset, 2px);+}++/* Press feedback — one register: a slight scale-down on buttons, a deeper+ tint on rows/links. Matches .card--interactive:active in style.css. */+.market-hero-cta:active,+.market-hero-secondary:active,+.market-avatar-detail-cta:active,+.tool-detail-cta:active,+.purchase-btn:active,+.skill-btn.purchase:active,+.plugin-add-url-btn:active,+.plugin-install-btn:active,+.market-submit-btn:active,+.market-submit-avatar-btn:active,+.market-mine-cta:active,+.market-empty-redirect button:active,+.earn-wallet-btn:active,+.earn-show-more:active,+.d-token-btn:active,+.d-token-btn-sec:active {+ transform: scale(0.98);+}+.market-nav a:active,+.cat-row:active { background: var(--surface-3); color: var(--ink); }+.market-cat-chip:active:not(.active),+.market-chip:active { background: var(--surface-3); color: var(--ink); }+.market-fork:active,+.d-embed-copy:active { background: var(--surface-2); }+.card-heart:active { transform: scale(1); }+.market-wip-dismiss:active,+.market-tag-banner-clear:active { opacity: 0.7; }++/* Pointer affordance + transition on rows that only had hover colors. */+.market-nav a,+.cat-row {+ transition:+ background var(--duration-instant, 80ms) var(--ease-standard, ease),+ color var(--duration-instant, 80ms) var(--ease-standard, ease);+}++/* Reduced motion — this sheet mixes literal durations, so kill explicitly. */+@media (prefers-reduced-motion: reduce) {+ .market-grid > * { animation: none; }+ .market-nav a,+ .cat-row,+ .market-cat-chip,+ .market-chip,+ .market-hero-cta,+ .market-hero-secondary,+ .related-card,+ .plugin-card,+ .plugin-card-clickable,+ .tool-card,+ .earn-card,+ .earn-chip,+ .earn-txn,+ .card-heart,+ .card-star {+ transition: none !important;+ }+ .card-heart:hover,+ .card-star:hover { transform: none; }+}diff --git a/public/nav-data.js b/public/nav-data.jsindex c6329a6e5..47d3d574e 100644--- a/public/nav-data.js+++ b/public/nav-data.js@@ -202,7 +202,6 @@ export const NAV_GROUPS = [{ title: 'OBS Overlay', href: '/overlay-control', desc: 'Stream deck — emote hotkeys, mic' },{ title: 'Walk', href: '/walk', desc: 'Walk your avatar — multiplayer + AR' },{ title: 'XR', href: '/xr', desc: 'Place your avatar in the real world' },- { title: 'Rider (VR)', href: '/rider', desc: 'Open-source VR music visualization' },],},{diff --git a/public/nav.css b/public/nav.cssindex 98e731529..6a46e82da 100644--- a/public/nav.css+++ b/public/nav.css@@ -11,6 +11,13 @@palette when a host page doesn't define them.───────────────────────────────────────────────────────────────────────── */+/* Reserve the header's height before nav.js injects it so pages (notably the+ homepage hero) don't shift down when the nav arrives. */+#nav-container:empty { min-height: 69px; }+@media (max-width: 880px) {+ #nav-container:empty { min-height: 65px; }+}+.nav,.nav-drawer {--nv-bg: var(--bg, #050505);@@ -285,14 +292,29 @@.nav-grp.open .nav-pop {opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;}-/* Labs mega menu — categorized columns, right-anchored (it's the last group). */+/* Two-column popover for mid-size menus (Integrations). */+.nav-pop.wide {+ grid-template-columns: 1fr 1fr;+ min-width: 540px;+ max-width: calc(100vw - 24px);+}+/* Labs mega menu — categorized columns, right-anchored (it's the last group).+ Capped to the viewport so the tail of a long menu scrolls instead of being+ clipped offscreen. */.nav-pop.mega {left: auto; right: 0;transform-origin: top right;min-width: 632px;+ max-width: calc(100vw - 24px);+ max-height: calc(100vh - 90px);+ overflow-y: auto;+ overscroll-behavior: contain;grid-template-columns: repeat(3, 1fr);gap: 2px 6px; padding: 8px;}+.nav-pop.mega::-webkit-scrollbar { width: 4px; }+.nav-pop.mega::-webkit-scrollbar-track { background: transparent; }+.nav-pop.mega::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }.nav-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }.nav-col-h {font-family: var(--nv-font-mono); font-size: var(--text-xs);@@ -335,6 +357,18 @@transition: border-color 0.15s, background 0.15s;}.nav-toggle:hover { border-color: var(--nv-text); background: rgba(255,255,255,0.04); }+.nav .brand:focus-visible,+.nav-toggle:focus-visible,+.nav-trigger:focus-visible,+.nav-walk-toggle:focus-visible,+.nav-mi:focus-visible,+.nav-main > a:focus-visible,+.nav-end a:focus-visible,+.nav-drawer a:focus-visible,+.nav-drawer .btn:focus-visible {+ outline: 2px solid rgba(255,255,255,0.5); outline-offset: 2px;+ border-radius: 7px;+}.nav-toggle svg { width: 16px; height: 16px; }.nav-toggle .close { display: none; }.nav-toggle[aria-expanded="true"] .open { display: none; }@@ -382,3 +416,33 @@.nav-toggle { display: flex; }.nav-end { display: none; }}++/* ── Microinteractions (B11) — press feedback + reduced motion ───────────── */+/* Active states: one tint deeper than hover so every press reads instantly. */+.nav-main > a:active,+.nav-end a:active { color: var(--nv-text); opacity: 0.78; }+.nav-end .console:active,+.nav-toggle:active,+.nav-drawer .btn:active { background: rgba(255,255,255,0.08); }+.nav-trigger:active,+.nav-walk-toggle:active { color: var(--nv-text); background: rgba(255,255,255,0.07); }+.nav-mi:active { background: var(--nv-surface-1); }+.nav-drawer a:active { background: var(--nv-surface-2); color: var(--nv-text); }+.nav-drawer .btn.primary:active { background: rgba(255,255,255,0.86); }+.notif-signin-btn:active { background: rgba(255,255,255,0.2); }+.notif-mark-all:active:not(:disabled) { background: rgba(255,255,255,0.09); }+.notif-row:active { background: rgba(255,255,255,0.06); }++/* Reduced motion: the nav uses literal durations (not the zeroed --duration-*+ tokens), so kill its transitions/animations explicitly. */+@media (prefers-reduced-motion: reduce) {+ .nav *,+ .nav-drawer,+ .nav-drawer *,+ .notif-panel,+ .nav-pop,+ .nav-caret {+ transition-duration: 0ms !important;+ animation: none !important;+ }+}diff --git a/public/next/index.html b/public/next/index.htmlindex eff458f30..5b231d412 100644--- a/public/next/index.html+++ b/public/next/index.html@@ -277,7 +277,7 @@footer .links { display: flex; gap: 20px; flex-wrap: wrap; }</style>- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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><script src="/embed/v1.js" defer></script></head><body>diff --git a/public/pay/calls/index.html b/public/pay/calls/index.htmlindex c038ddb95..60e1f2dd0 100644--- a/public/pay/calls/index.html+++ b/public/pay/calls/index.html@@ -13,7 +13,7 @@<meta name="twitter:card" content="summary_large_image" /><meta name="twitter:image" content="" id="twImage" /><meta name="theme-color" content="#0b0b0b" />-<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+<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>:root {--bg: #0b0b0b; --bg-2: #111111;diff --git a/public/pay/index.html b/public/pay/index.htmlindex 63cea451c..7cf272bd9 100644--- a/public/pay/index.html+++ b/public/pay/index.html@@ -16,7 +16,7 @@<meta name="twitter:image" content="https://three.ws/api/x402-pay/og" /><meta name="theme-color" content="#0b0b0b" /><link rel="preconnect" href="https://api.mainnet-beta.solana.com" />-<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+<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>:root {--bg: #0b0b0b;diff --git a/public/persona/demo.html b/public/persona/demo.htmlindex 1e04dec20..1bdcfaa3a 100644--- a/public/persona/demo.html+++ b/public/persona/demo.html@@ -246,7 +246,7 @@ if (!res.ok) throw new Error(claims.error_description);</div></main>-<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+<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><script src="/persona/widget.js" defer></script><script>const $log = document.getElementById('log');diff --git a/public/pricing.css b/public/pricing.cssindex be919dff1..74428fdc2 100644--- a/public/pricing.css+++ b/public/pricing.css@@ -766,6 +766,90 @@transform: translateX(3px);}+/* ── Microinteractions (B11) — press feedback, focus rings, motion ─────── */++/* Tier cards rise in on load — staggered, transform/opacity only. */+.pricing-tier-card {+ animation: pricing-rise var(--duration-slow, 420ms) var(--ease-emphasized, cubic-bezier(0.22, 1, 0.36, 1)) both;+}+.pricing-tier-card:nth-child(2) { animation-delay: 70ms; }+.pricing-tier-card:nth-child(3) { animation-delay: 140ms; }+@keyframes pricing-rise {+ from { opacity: 0; transform: translateY(12px); }+ to { opacity: 1; transform: translateY(0); }+}++/* Billing toggle — keyboard ring + press feedback */+.billing-toggle span:hover { color: rgba(255, 255, 255, 0.78); }+.billing-toggle span.is-active:hover { color: #fff; }+.billing-toggle .toggle-track:active { background: rgba(255, 255, 255, 0.18); }+.billing-toggle .toggle-track:focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);+ outline-offset: var(--focus-ring-offset, 2px);+}++/* Price figures crossfade when the billing cycle flips (class set by JS). */+.price-swap {+ animation: pricing-price-swap var(--duration-base, 220ms) var(--ease-standard, cubic-bezier(0.2, 0.8, 0.2, 1));+}+@keyframes pricing-price-swap {+ from { opacity: 0; transform: translateY(4px); }+ to { opacity: 1; transform: translateY(0); }+}++/* CTAs — press + focus */+.pricing-cta { transition: background var(--duration-fast, 140ms) var(--ease-standard, ease), border-color var(--duration-fast, 140ms) var(--ease-standard, ease), transform var(--duration-fast, 140ms) var(--ease-standard, ease), box-shadow var(--duration-fast, 140ms) var(--ease-standard, ease); }+.pricing-cta:active {+ transform: translateY(0) scale(0.98);+}+.pricing-cta.primary:active { background: #e4e4e4; }+.pricing-cta:focus-visible,+.upgrade-banner-btn:focus-visible,+.pricing-embed-cta a:focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);+ outline-offset: var(--focus-ring-offset, 2px);+}+.upgrade-banner-btn:active { background: rgba(255, 255, 255, 0.16); }+.pricing-embed-cta a:active { color: rgba(255, 255, 255, 0.78); }++/* FAQ — answers ease in instead of popping; summary gets ring + press */+.pricing-faq details[open] p {+ animation: pricing-faq-open var(--duration-base, 220ms) var(--ease-emphasized, cubic-bezier(0.22, 1, 0.36, 1)) both;+}+@keyframes pricing-faq-open {+ from { opacity: 0; transform: translateY(-4px); }+ to { opacity: 1; transform: translateY(0); }+}+.pricing-faq summary:focus-visible {+ outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, #fff);+ outline-offset: var(--focus-ring-offset, 2px);+ border-radius: var(--radius-sm, 6px);+}+.pricing-faq summary:active::after { background: rgba(255, 255, 255, 0.14); }++/* Reduced motion: this sheet uses literal durations, so disable explicitly. */+@media (prefers-reduced-motion: reduce) {+ .pricing-tier-card,+ .pricing-faq details[open] p,+ .price-swap {+ animation: none !important;+ }+ .pricing-hero *,+ .pricing-tier-card,+ .pricing-cta,+ .billing-toggle *,+ .upgrade-banner,+ .upgrade-banner-btn,+ .pricing-embed-card,+ .pricing-embed-cta a,+ .pricing-faq summary,+ .pricing-faq summary::after {+ transition-duration: 0ms !important;+ }+ .pricing-cta:hover,+ .pricing-cta.primary:hover { transform: none; }+}+/* ── Responsive ────────────────────────────────────────────────────────── */@media (max-width: 860px) {diff --git a/public/pump-grid-poc.html b/public/pump-grid-poc.htmlindex 5849d4ca9..85a2b61ff 100644--- a/public/pump-grid-poc.html+++ b/public/pump-grid-poc.html@@ -5,7 +5,7 @@<meta name="viewport" content="width=device-width, initial-scale=1.0"><title>PumpFun Grid POC</title><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/gridstack.min.css" />- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gridstack-all.js"></script>+ <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gridstack-all.js" integrity="sha384-6IelLg5vJ9FDli+2FiM5mdHxGkb5pvYCGXlIN9Tqlv6ufE1DNgZkrqeIz/me4Phs" crossorigin="anonymous"></script><style>body {font-family: sans-serif;diff --git a/public/pumpfun.html b/public/pumpfun.htmlindex d1cdb92bc..b8d98b0b6 100644--- a/public/pumpfun.html+++ b/public/pumpfun.html@@ -10,7 +10,7 @@<link rel="stylesheet" href="/footer.css" /><link rel="stylesheet" href="/nav.css" /><link rel="stylesheet" href="/fonts/fonts.css" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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><script defer src="/footer-newsletter.js"></script><style>:root { color-scheme: dark; --accent: #ffffff; --border: #202020; --bg: #0a0a0a; --panel: #151515; --muted: #888;diff --git a/public/register.html b/public/register.htmlindex 6ea1a7fbc..603e8373d 100644--- a/public/register.html+++ b/public/register.html@@ -10,7 +10,7 @@<link rel="stylesheet" href="/mobile.css" /><scripttype="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"+ 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>:root {diff --git a/public/reputation/index.html b/public/reputation/index.htmlindex 97d907629..39e3e7c23 100644--- a/public/reputation/index.html+++ b/public/reputation/index.html@@ -31,7 +31,7 @@<script defer src="/footer-newsletter.js"></script><scripttype="module"- src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"+ 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>diff --git a/public/style.css b/public/style.cssindex 408cf6980..19cfb5ad9 100644--- a/public/style.css+++ b/public/style.css@@ -1228,6 +1228,15 @@ footer .separator {background: rgba(255, 255, 255, 0.08);}+.report-download:active {+ background: rgba(255, 255, 255, 0.14);+}++.report-download:focus-visible {+ outline: var(--focus-ring-width) solid var(--focus-ring-color);+ outline-offset: var(--focus-ring-offset);+}+/******************************************************************************* CSS Spinner*@@ -5187,6 +5196,31 @@ body[data-viewer-mode='explore'] #layout-switch {border-color: rgba(255, 255, 255, 0.3);}+/* Microinteractions (B11) — focus + press states for the agent-home panel. */+.agent-home-btn:active {+ color: #fff;+ background: var(--surface-2);+}+.agent-home-show-pill:active { transform: scale(0.97); }+.agent-home-btn:focus-visible,+.agent-home-show-pill:focus-visible,+.agent-home-skills-summary:focus-visible,+.agent-home-address--cta:focus-visible {+ outline: var(--focus-ring-width) solid var(--focus-ring-color);+ outline-offset: var(--focus-ring-offset);+}+@media (prefers-reduced-motion: reduce) {+ .agent-home-show-pill,+ .agent-home-btn,+ .agent-home-avatar-ring,+ .agent-home-chevron {+ transition: none !important;+ animation: none !important;+ }+ .agent-home-show-pill:hover,+ .agent-home-show-pill:active { transform: none; }+}+.agent-home-badge {font-size: 9px;padding: 2px 5px;@@ -10743,3 +10777,97 @@ a.pill--devnet:hover {.tws-disc-card { transition: opacity 0.001s linear; transform: none; }.tws-disc-card.is-in { transform: none; }}++/* =============================================================================+ * Screenshot modal (src/components/screenshot-modal.js) — B11+ * Backdrop fades, panel rises; buttons come from the canonical .btn system.+ * ============================================================================= */+.screenshot-modal-backdrop {+ position: fixed;+ inset: 0;+ z-index: 1000;+ display: flex;+ align-items: center;+ justify-content: center;+ padding: var(--space-lg);+ background: rgba(0, 0, 0, 0.72);+ backdrop-filter: blur(var(--blur-sm));+ -webkit-backdrop-filter: blur(var(--blur-sm));+ animation: screenshot-backdrop-in var(--duration-base) var(--ease-out) both;+}+@keyframes screenshot-backdrop-in {+ from { opacity: 0; }+ to { opacity: 1; }+}+.screenshot-modal {+ width: min(560px, 100%);+ max-height: calc(100svh - 3rem);+ display: flex;+ flex-direction: column;+ overflow: hidden;+ background: var(--bg-0);+ border: 1px solid var(--stroke-strong);+ border-radius: var(--radius-lg);+ box-shadow: var(--shadow-3);+ animation: screenshot-panel-in var(--duration-base) var(--ease-emphasized) both;+}+@keyframes screenshot-panel-in {+ from { opacity: 0; transform: translateY(10px) scale(0.97); }+ to { opacity: 1; transform: translateY(0) scale(1); }+}+.screenshot-modal-header {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: var(--space-sm);+ padding: var(--space-md) var(--space-lg);+ border-bottom: 1px solid var(--stroke);+}+.screenshot-modal-header h3 {+ margin: 0;+ font-size: var(--text-base);+ font-weight: var(--weight-semibold);+ color: var(--ink);+}+.screenshot-modal-close {+ background: none;+ border: none;+ color: var(--ink-dim);+ font-size: var(--text-lg);+ line-height: 1;+ cursor: pointer;+ padding: var(--space-xs) var(--space-sm);+ border-radius: var(--radius-sm);+ transition: color var(--duration-instant) var(--ease-standard), background var(--duration-instant) var(--ease-standard);+}+.screenshot-modal-close:hover { color: var(--ink); background: var(--surface-2); }+.screenshot-modal-close:active { background: var(--surface-3); }+.screenshot-modal-close:focus-visible {+ outline: var(--focus-ring-width) solid var(--focus-ring-color);+ outline-offset: var(--focus-ring-offset);+}+.screenshot-modal-body {+ padding: var(--space-lg);+ overflow-y: auto;+ display: flex;+ justify-content: center;+}+.screenshot-modal-body img {+ max-width: 100%;+ max-height: 52vh;+ border-radius: var(--radius-md);+ border: 1px solid var(--stroke);+ display: block;+}+.screenshot-modal-footer {+ display: flex;+ justify-content: flex-end;+ align-items: center;+ gap: var(--space-sm);+ padding: var(--space-md) var(--space-lg);+ border-top: 1px solid var(--stroke);+}+@media (prefers-reduced-motion: reduce) {+ .screenshot-modal-backdrop,+ .screenshot-modal { animation: none; }+}diff --git a/public/tokens.css b/public/tokens.cssindex 81958da7d..504b7c4a1 100644--- a/public/tokens.css+++ b/public/tokens.css@@ -146,6 +146,16 @@--ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1); /* default UI motion */--ease-emphasized: cubic-bezier(0.22, 1, 0.36, 1); /* expressive enter/reveal */--ease-out: cubic-bezier(0, 0, 0.2, 1); /* decelerate-only */++ /* Interactive states (B11) — shared focus-ring + disabled vocabulary.+ Every :focus-visible outline and disabled control on the platform+ references these (buttons.css re-declares them with identical literal+ fallbacks so it stays portable on pages that load it standalone). */+ --focus-ring-color: var(--accent);+ --focus-ring-width: 2px;+ --focus-ring-offset: 2px;+ --disabled-opacity: 0.4;+ --disabled-cursor: not-allowed;}@media (prefers-reduced-motion: reduce) {diff --git a/public/vanity-wallet.html b/public/vanity-wallet.htmlindex 34c97a379..7331c8dc2 100644--- a/public/vanity-wallet.html+++ b/public/vanity-wallet.html@@ -10,7 +10,7 @@<link rel="stylesheet" href="/nav.css"><link rel="stylesheet" href="/fonts/fonts.css" /><script defer src="/footer-newsletter.js"></script>- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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>* { box-sizing: border-box; }:root {diff --git a/public/widgets-gallery/index.html b/public/widgets-gallery/index.htmlindex b764deead..1d65f545c 100644--- a/public/widgets-gallery/index.html+++ b/public/widgets-gallery/index.html@@ -28,7 +28,7 @@<link rel="stylesheet" href="/nav.css" /><link rel="stylesheet" href="/widgets-gallery/gallery.css" /><link rel="stylesheet" href="/footer.css" />- <script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"></script>+ <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><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="Widgets Gallery · three.ws">diff --git a/scripts/audit-home-probe.mjs b/scripts/audit-home-probe.mjsdeleted file mode 100644index 61058c1e8..000000000--- a/scripts/audit-home-probe.mjs+++ /dev/null@@ -1,77 +0,0 @@-// One-off homepage audit probe — run with: node scripts/audit-home-probe.mjs-import { chromium } from 'playwright';--const URL = 'http://localhost:3000/';--async function probe(viewport, label) {- const browser = await chromium.launch();- const page = await browser.newPage({ viewport });- const consoleMsgs = [];- page.on('console', (m) => {- if (m.type() === 'error' || m.type() === 'warning') {- consoleMsgs.push(`[${m.type()}] ${m.text().slice(0, 200)}`);- }- });- page.on('pageerror', (e) => consoleMsgs.push(`[pageerror] ${String(e).slice(0, 200)}`));-- // Count WebGL context creations- await page.addInitScript(() => {- window.__glContexts = 0;- const orig = HTMLCanvasElement.prototype.getContext;- HTMLCanvasElement.prototype.getContext = function (type, ...args) {- const ctx = orig.call(this, type, ...args);- if (ctx && /webgl/.test(type)) window.__glContexts++;- return ctx;- };- });-- await page.goto(URL, { waitUntil: 'domcontentloaded', timeout: 60000 });- await page.waitForTimeout(4000);-- const aboveFold = await page.evaluate(() => {- const stage = document.querySelector('.hero-stage');- return {- heroStageH: stage ? stage.offsetHeight : null,- heroStageW: stage ? stage.offsetWidth : null,- agentEls: document.querySelectorAll('agent-3d').length,- glContexts: window.__glContexts,- pageH: document.documentElement.scrollHeight,- };- });-- // Scroll through the whole page to trigger reveals + lazy boots- await page.evaluate(async () => {- const step = window.innerHeight * 0.8;- for (let y = 0; y < document.documentElement.scrollHeight; y += step) {- window.scrollTo(0, y);- await new Promise((r) => setTimeout(r, 350));- }- });- await page.waitForTimeout(5000);-- const afterScroll = await page.evaluate(() => {- const reveals = [...document.querySelectorAll('.reveal')];- return {- reveals: reveals.length,- revealed: reveals.filter((el) => el.classList.contains('vis')).length,- agentEls: document.querySelectorAll('agent-3d').length,- glContexts: window.__glContexts,- pageH: document.documentElement.scrollHeight,- heroAgentAlive: (() => {- const a = document.querySelector('#hero-stage-inner agent-3d');- return a ? a.classList.contains('loaded') : null;- })(),- };- });-- console.log(`\n===== ${label} (${viewport.width}x${viewport.height}) =====`);- console.log('above fold:', JSON.stringify(aboveFold));- console.log('after full scroll:', JSON.stringify(afterScroll));- console.log(`console errors/warnings (${consoleMsgs.length}):`);- [...new Set(consoleMsgs)].slice(0, 25).forEach((m) => console.log(' ' + m));-- await browser.close();-}--await probe({ width: 1440, height: 900 }, 'desktop');-await probe({ width: 375, height: 812 }, 'mobile');diff --git a/scripts/build-page-index.mjs b/scripts/build-page-index.mjsindex 5dcab276d..0971b3331 100644--- a/scripts/build-page-index.mjs+++ b/scripts/build-page-index.mjs@@ -8,7 +8,10 @@* public/llms-full.txt — expanded, prose-friendly variant* public/sitemap/index.html — human-readable site map at /sitemap* public/features.json — machine manifest served at /api/features.json- * CHANGELOG.md — derived from per-page `added` dates+ * CHANGELOG.md — page launches (`added` dates) merged with+ * curated entries from data/changelog.json+ * public/changelog.json — machine-readable changelog feed at /changelog.json+ * public/changelog.xml — RSS feed of the same entries at /changelog.xml** Note: the crawler sitemap.xml is NO LONGER static. It's served dynamically* by /api/sitemap (index) + /api/sitemap/[type] (per-entity), which augments@@ -32,6 +35,22 @@ const data = JSON.parse(readFileSync(dataFile, 'utf8'));const { site } = data;const sections = [...data.sections];+// Curated changelog entries — the editorial layer on top of page launches.+// Validated hard: a malformed entry should fail the build, not ship garbage+// to holders.+const changelogFile = resolve(root, 'data/changelog.json');+const CHANGELOG_TAGS = new Set(['feature', 'improvement', 'fix', 'sdk', 'infra', 'docs', 'security']);+const curatedEntries = JSON.parse(readFileSync(changelogFile, 'utf8')).entries;+for (const e of curatedEntries) {+ const ctx = `data/changelog.json entry "${e.title || '?'}" (${e.date || 'no date'})`;+ if (!/^\d{4}-\d{2}-\d{2}$/.test(e.date || '')) throw new Error(`${ctx}: date must be YYYY-MM-DD`);+ if (!e.title || !e.summary) throw new Error(`${ctx}: title and summary are required`);+ if (!Array.isArray(e.tags) || e.tags.length === 0) throw new Error(`${ctx}: at least one tag required`);+ for (const t of e.tags) {+ if (!CHANGELOG_TAGS.has(t)) throw new Error(`${ctx}: unknown tag "${t}" (allowed: ${[...CHANGELOG_TAGS].join(', ')})`);+ }+}+// Splice in a "News" section if scripts/build-news.mjs has written its// routes file. Keeps news entries in the sitemap, llms.txt, and the// human-readable /sitemap page without requiring manual edits.@@ -280,41 +299,112 @@ function buildFeaturesJson() {}// ────────────────────────────────────────────────────────────────────────-// CHANGELOG.md — derived from per-page `added` dates, newest first. Pages-// without an `added` date predate tracking and are omitted; every NEW page-// added to pages.json should carry one (the route-audit guard enforces it).+// Changelog feed — page launches (per-page `added` dates in pages.json)+// merged with curated entries from data/changelog.json, newest first.+// Three renderings: CHANGELOG.md, public/changelog.json, public/changelog.xml.// ────────────────────────────────────────────────────────────────────────+function changelogFeed() {+ const launches = allPages+ .filter((p) => p.added)+ .map((p) => ({+ date: p.added,+ type: 'launch',+ title: p.title,+ summary: p.description,+ link: p.path,+ tags: ['launch'],+ }));+ const updates = curatedEntries.map((e) => ({+ date: e.date,+ type: 'update',+ title: e.title,+ summary: e.summary,+ link: e.link || null,+ tags: e.tags,+ }));+ return [...launches, ...updates].sort(+ (a, b) =>+ (a.date < b.date ? 1 : a.date > b.date ? -1 : 0) ||+ (a.type !== b.type ? (a.type === 'launch' ? -1 : 1) : 0) ||+ a.title.localeCompare(b.title),+ );+}+function buildChangelog() {- const dated = allPages.filter((p) => p.added);+ const feed = changelogFeed();const byDate = new Map();- for (const p of dated) {- if (!byDate.has(p.added)) byDate.set(p.added, []);- byDate.get(p.added).push(p);+ for (const item of feed) {+ if (!byDate.has(item.date)) byDate.set(item.date, []);+ byDate.get(item.date).push(item);}- const dates = [...byDate.keys()].sort((a, b) => (a < b ? 1 : -1));const lines = [];lines.push('# Changelog');lines.push('');- lines.push('<!-- Generated from data/pages.json by scripts/build-page-index.mjs — DO NOT EDIT BY HAND. -->');+ lines.push('<!-- Generated from data/pages.json + data/changelog.json by scripts/build-page-index.mjs — DO NOT EDIT BY HAND. Add updates to data/changelog.json. -->');lines.push('');- lines.push(`Public feature history for [${site.name}](${baseUrl}), newest first. Feature dates are tracked from 2026-05-25 forward; earlier pages are omitted.`);+ lines.push(`Public history for [${site.name}](${baseUrl}), newest first. New pages come from \`added\` dates in data/pages.json; everything else is curated in data/changelog.json. Also available as [JSON](${baseUrl}/changelog.json) and [RSS](${baseUrl}/changelog.xml), live at [${baseUrl.replace(/^https?:\/\//, '')}/changelog](${baseUrl}/changelog).`);lines.push('');- if (dates.length === 0) {- lines.push('_No dated features yet. Add an `"added": "YYYY-MM-DD"` field to a page in data/pages.json to start the log._');- lines.push('');- }- for (const date of dates) {+ for (const [date, items] of byDate) {lines.push(`## ${date}`);lines.push('');- for (const p of byDate.get(date).sort((a, b) => a.title.localeCompare(b.title))) {- lines.push(`- **${p.title}** (\`${p.path}\`) — ${p.description}`);+ for (const item of items) {+ if (item.type === 'launch') {+ lines.push(`- **${item.title}** (\`${item.link}\`) — ${item.summary}`);+ } else {+ lines.push(`- **${item.title}** — ${item.summary}${item.link ? ` (\`${item.link}\`)` : ''} \`[${item.tags.join(', ')}]\``);+ }}lines.push('');}return lines.join('\n').trimEnd() + '\n';}+function buildChangelogJson() {+ return JSON.stringify(+ {+ generated_at: new Date().toISOString(),+ generated_by: 'scripts/build-page-index.mjs from data/pages.json + data/changelog.json',+ site: { name: site.name, url: site.url },+ entries: changelogFeed(),+ },+ null,+ '\t',+ ) + '\n';+}++function buildChangelogRss() {+ const feed = changelogFeed();+ const items = feed+ .map((item) => {+ const link = `${baseUrl}${item.link || '/changelog'}`;+ const pubDate = new Date(`${item.date}T12:00:00Z`).toUTCString();+ return [+ '\t\t<item>',+ `\t\t\t<title>${escapeHtml(item.title)}</title>`,+ `\t\t\t<link>${escapeHtml(link)}</link>`,+ `\t\t\t<guid isPermaLink="false">${escapeHtml(`${item.date}:${item.title}`)}</guid>`,+ `\t\t\t<pubDate>${pubDate}</pubDate>`,+ `\t\t\t<category>${escapeHtml(item.type === 'launch' ? 'launch' : item.tags[0])}</category>`,+ `\t\t\t<description>${escapeHtml(item.summary)}</description>`,+ '\t\t</item>',+ ].join('\n');+ })+ .join('\n');+ return `<?xml version="1.0" encoding="UTF-8"?>+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">+\t<channel>+\t\t<title>${escapeHtml(site.name)} changelog</title>+\t\t<link>${baseUrl}/changelog</link>+\t\t<atom:link href="${baseUrl}/changelog.xml" rel="self" type="application/rss+xml"/>+\t\t<description>What's new on ${escapeHtml(site.name)} — features, improvements, and releases, newest first.</description>+\t\t<language>en</language>+${items}+\t</channel>+</rss>+`;+}+// ────────────────────────────────────────────────────────────────────────// emit// ────────────────────────────────────────────────────────────────────────@@ -333,6 +423,8 @@ const outputs = [{ file: resolve(publicDir, 'sitemap/index.html'), content: buildSitemapHtml() },{ file: resolve(publicDir, 'features.json'), content: buildFeaturesJson() },{ file: resolve(root, 'CHANGELOG.md'), content: buildChangelog() },+ { file: resolve(publicDir, 'changelog.json'), content: buildChangelogJson() },+ { file: resolve(publicDir, 'changelog.xml'), content: buildChangelogRss() },];let wrote = 0;diff --git a/scripts/changelog-telegram.mjs b/scripts/changelog-telegram.mjsnew file mode 100644index 000000000..e281ab8ab--- /dev/null+++ b/scripts/changelog-telegram.mjs@@ -0,0 +1,164 @@+#!/usr/bin/env node+// Push new changelog entries to the $THREE holders Telegram channel.+//+// Reads the generated feed (public/changelog.json — run `npm run build:pages`+// first if it's stale), diffs it against data/changelog-telegram-state.json,+// and posts each unposted entry to Telegram via the Bot API. Successfully+// posted entries are recorded in the state file — commit it so pushes stay+// idempotent across machines and agents.+//+// Env (reads .env.local → .env → environment):+// TELEGRAM_BOT_TOKEN bot token from @BotFather (already used by+// /api/pump/deliver-telegram)+// TELEGRAM_CHANGELOG_CHAT_ID channel id (@handle or -100… numeric). The+// bot must be an admin of the channel.+//+// Usage:+// node scripts/changelog-telegram.mjs # push unposted entries from the last 7 days+// node scripts/changelog-telegram.mjs --since=2026-06-01+// node scripts/changelog-telegram.mjs --all # push every unposted entry (full backfill)+// node scripts/changelog-telegram.mjs --dry-run # print what would be sent, send nothing+// node scripts/changelog-telegram.mjs --limit=5 # cap messages per run++import { readFileSync, writeFileSync } from 'node:fs';+import { resolve, dirname } from 'node:path';+import { fileURLToPath } from 'node:url';++const here = dirname(fileURLToPath(import.meta.url));+const root = resolve(here, '..');+const feedFile = resolve(root, 'public/changelog.json');+const stateFile = resolve(root, 'data/changelog-telegram-state.json');++function loadEnvFile(path) {+ let raw;+ try {+ raw = readFileSync(path, 'utf8');+ } catch {+ return;+ }+ for (const line of raw.split('\n')) {+ const m = line.match(/^\s*([A-Z0-9_]+)\s*=\s*(.*?)\s*$/i);+ if (!m) continue;+ const [, k, v] = m;+ if (process.env[k]) continue;+ process.env[k] = v.replace(/^["']|["']$/g, '');+ }+}+loadEnvFile(resolve(root, '.env.local'));+loadEnvFile(resolve(root, '.env'));++const args = process.argv.slice(2);+const flag = (name) => args.includes(`--${name}`);+const opt = (name) => {+ const a = args.find((x) => x.startsWith(`--${name}=`));+ return a ? a.split('=')[1] : null;+};++const dryRun = flag('dry-run');+const pushAll = flag('all');+const since = opt('since');+const limit = Number(opt('limit') || 10);++const botToken = process.env.TELEGRAM_BOT_TOKEN;+const chatId = process.env.TELEGRAM_CHANGELOG_CHAT_ID;+if (!dryRun && (!botToken || !chatId)) {+ console.error('TELEGRAM_BOT_TOKEN and TELEGRAM_CHANGELOG_CHAT_ID must be set (see .env.example). Use --dry-run to preview without credentials.');+ process.exit(1);+}++let feed;+try {+ feed = JSON.parse(readFileSync(feedFile, 'utf8'));+} catch {+ console.error(`Missing or unreadable ${feedFile} — run \`npm run build:pages\` first.`);+ process.exit(1);+}++let state = { posted: [] };+try {+ state = JSON.parse(readFileSync(stateFile, 'utf8'));+} catch {+ // First run — state file gets created below.+}+const posted = new Set(state.posted);++const entryKey = (e) => `${e.date}:${e.title}`;++const defaultSince = (() => {+ const d = new Date(Date.now() - 7 * 86400000);+ return d.toISOString().slice(0, 10);+})();+const cutoff = pushAll ? '0000-00-00' : (since || defaultSince);++const pending = feed.entries+ .filter((e) => !posted.has(entryKey(e)) && e.date >= cutoff)+ .sort((a, b) => (a.date < b.date ? -1 : a.date > b.date ? 1 : 0))+ .slice(0, limit);++if (pending.length === 0) {+ console.log(`Nothing new to post (cutoff ${cutoff}, ${posted.size} already posted).`);+ process.exit(0);+}++const escapeHtml = (s) =>+ String(s).replace(/[<>&]/g, (c) => ({ '<': '<', '>': '>', '&': '&' })[c]);++function formatMessage(e) {+ const url = `https://three.ws${e.link || '/changelog'}`;+ const label = e.type === 'launch' ? 'New on three.ws' : 'Update';+ const hashtags = (e.type === 'launch' ? ['launch'] : e.tags).map((t) => `#${t}`).join(' ');+ return [+ `<b>${escapeHtml(label)} — ${escapeHtml(e.title)}</b>`,+ '',+ escapeHtml(e.summary),+ '',+ `<a href="${url}">${escapeHtml(url.replace('https://', ''))}</a> · ${escapeHtml(e.date)} · ${escapeHtml(hashtags)}`,+ ].join('\n');+}++async function sendMessage(text) {+ const res = await fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {+ method: 'POST',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({+ chat_id: chatId,+ text,+ parse_mode: 'HTML',+ link_preview_options: { is_disabled: false, prefer_small_media: true },+ }),+ });+ const body = await res.json().catch(() => ({}));+ if (!res.ok || !body.ok) {+ throw new Error(`Telegram sendMessage failed (${res.status}): ${body.description || 'unknown error'}`);+ }+}++console.log(`${pending.length} entr${pending.length === 1 ? 'y' : 'ies'} to post (cutoff ${cutoff})${dryRun ? ' — DRY RUN' : ''}:`);++let sent = 0;+for (const e of pending) {+ const msg = formatMessage(e);+ if (dryRun) {+ console.log(`\n--- ${entryKey(e)} ---\n${msg}`);+ continue;+ }+ try {+ await sendMessage(msg);+ posted.add(entryKey(e));+ sent++;+ console.log(`posted ${entryKey(e)}`);+ // Bot API allows ~20 messages/minute per chat — stay well under it.+ await new Promise((r) => setTimeout(r, 3500));+ } catch (err) {+ // Persist what made it out so a retry doesn't double-post.+ writeFileSync(stateFile, JSON.stringify({ posted: [...posted] }, null, '\t') + '\n');+ console.error(`FAILED ${entryKey(e)}: ${err.message}`);+ console.error(`${sent} posted before the failure; state saved. Re-run to resume.`);+ process.exit(1);+ }+}++if (!dryRun) {+ writeFileSync(stateFile, JSON.stringify({ posted: [...posted] }, null, '\t') + '\n');+ console.log(`\nDone — ${sent} posted, state saved to data/changelog-telegram-state.json (commit it).`);+}diff --git a/scripts/nav-probe.mjs b/scripts/nav-probe.mjsnew file mode 100644index 000000000..31a563e51--- /dev/null+++ b/scripts/nav-probe.mjs@@ -0,0 +1,136 @@+// Probe the refactored shared nav on the dev server: homepage + a nav-container+// page must render identical data-driven menus with no console errors.+import { chromium } from 'playwright';++const BASE = process.env.PROBE_BASE || 'http://localhost:3000';+const failures = [];+const check = (label, ok, detail = '') => {+ console.log(`${ok ? 'PASS' : 'FAIL'} ${label}${detail ? ' — ' + detail : ''}`);+ if (!ok) failures.push(label);+};++const browser = await chromium.launch({ args: ['--disable-dev-shm-usage', '--no-sandbox'] });+const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });+const consoleErrors = [];+page.on('console', (msg) => {+ if (msg.type() === 'error') consoleErrors.push(msg.text());+});+page.on('pageerror', (err) => consoleErrors.push(String(err)));++async function snapshotNav(url) {+ await page.goto(BASE + url, { waitUntil: 'domcontentloaded' });+ await page.waitForSelector('.nav-main .nav-grp', { state: 'attached', timeout: 20000 });+ return page.evaluate(() => {+ const groups = [...document.querySelectorAll('.nav-main .nav-grp')].map((g) => ({+ label: g.querySelector('.nav-trigger').textContent.trim().replace(/[▾\s]+$/, ''),+ items: [...g.querySelectorAll('.nav-mi')].map((a) => ({+ title: a.querySelector('.nav-mi-t').textContent.trim(),+ href: a.getAttribute('href'),+ })),+ }));+ const topLinks = [...document.querySelectorAll('.nav-main > a')].map((a) => a.textContent.trim());+ const drawerLinks = document.querySelectorAll('#nav-drawer a').length;+ return { groups, topLinks, drawerLinks };+ });+}++// ── Homepage ────────────────────────────────────────────────────────────────+const home = await snapshotNav('/');+check('homepage renders 6 dropdown groups', home.groups.length === 6, home.groups.map((g) => g.label).join(', '));+check('homepage has Integrations group', home.groups.some((g) => g.label.startsWith('Integrations')));+check('homepage has Pricing top-level link', home.topLinks.includes('Pricing'));++const discover = home.groups.find((g) => g.label === 'Discover');+const marketplaceLabels = discover.items.filter((i) => i.title === 'Marketplace');+check('Discover has exactly one item labeled "Marketplace"', marketplaceLabels.length === 1);+check('Discover has "x402 Bazaar" → /bazaar', discover.items.some((i) => i.title === 'x402 Bazaar' && i.href === '/bazaar'));++const build = home.groups.find((g) => g.label === 'Build');+check('Build menu has all 12 items', build.items.length === 12, String(build.items.length));++const labs = home.groups.find((g) => g.label.startsWith('Labs'));+check('Labs has no dead /rider link', !labs.items.some((i) => i.href === '/rider'));+check('drawer rendered with full link set', home.drawerLinks > 60, String(home.drawerLinks));++// Labs mega menu: open it, confirm every item is reachable (scrollable, not clipped)+await page.hover('.nav-main .nav-grp:nth-last-of-type(1) .nav-trigger');+await page.waitForTimeout(300);+const mega = await page.evaluate(() => {+ const pop = document.querySelector('.nav-pop.mega');+ const s = getComputedStyle(pop);+ const last = pop.querySelector('.nav-col:last-child .nav-mi:last-child');+ last.scrollIntoView({ block: 'nearest' });+ const r = last.getBoundingClientRect();+ return {+ overflowY: s.overflowY,+ maxHeight: s.maxHeight,+ lastItemVisible: r.bottom <= window.innerHeight && r.height > 0,+ lastItemTitle: last.querySelector('.nav-mi-t').textContent.trim(),+ };+});+await page.screenshot({ path: '/tmp/nav-labs-open.png' });+check('Labs mega menu scrolls', mega.overflowY === 'auto', mega.maxHeight);+check('Labs tail item reachable', mega.lastItemVisible, mega.lastItemTitle);++// Short-viewport regression: the bug from the screenshots+await page.setViewportSize({ width: 1280, height: 640 });+await page.reload({ waitUntil: 'domcontentloaded' });+await page.waitForSelector('.nav-main .nav-grp', { state: 'attached' });+await page.hover('.nav-main .nav-grp:nth-last-of-type(1) .nav-trigger');+await page.waitForTimeout(300);+const short = await page.evaluate(() => {+ const pop = document.querySelector('.nav-pop.mega');+ const last = pop.querySelector('.nav-col:last-child .nav-mi:last-child');+ const popRect = pop.getBoundingClientRect();+ last.scrollIntoView({ block: 'nearest' });+ const r = last.getBoundingClientRect();+ return { popBottom: popRect.bottom, vh: window.innerHeight, lastReachable: r.bottom <= window.innerHeight };+});+check('640px viewport: mega menu fits viewport', short.popBottom <= short.vh, `bottom ${Math.round(short.popBottom)} vs ${short.vh}`);+check('640px viewport: last Labs item reachable by scroll', short.lastReachable);+await page.setViewportSize({ width: 1440, height: 900 });++// Keyboard: Escape closes, focus returns+await page.reload({ waitUntil: 'domcontentloaded' });+await page.waitForSelector('.nav-main .nav-grp', { state: 'attached' });+await page.click('.nav-main .nav-grp:first-of-type .nav-trigger');+await page.keyboard.press('Tab');+await page.keyboard.press('Escape');+const escState = await page.evaluate(() => ({+ open: !!document.querySelector('.nav-grp.open'),+ focusOnTrigger: document.activeElement.classList.contains('nav-trigger'),+}));+check('Escape closes menu and restores focus', !escState.open && escState.focusOnTrigger);++// ── A page that always used the injected nav must match the homepage ───────+const agents = await snapshotNav('/agents');+check(+ 'homepage nav identical to /agents nav',+ JSON.stringify(home.groups) === JSON.stringify(agents.groups) &&+ JSON.stringify(home.topLinks) === JSON.stringify(agents.topLinks),+);++// ── Mobile drawer ───────────────────────────────────────────────────────────+await page.setViewportSize({ width: 375, height: 800 });+await page.goto(BASE + '/', { waitUntil: 'domcontentloaded' });+await page.waitForSelector('#nav-toggle', { state: 'attached' });+await page.click('#nav-toggle');+await page.waitForTimeout(300);+const drawer = await page.evaluate(() => {+ const d = document.querySelector('#nav-drawer');+ const headers = [...d.querySelectorAll('.dr-h')].map((h) => h.textContent.trim());+ return { open: d.classList.contains('open'), headers };+});+await page.screenshot({ path: '/tmp/nav-drawer.png' });+check('mobile drawer opens', drawer.open);+check('drawer has Integrations section', drawer.headers.includes('Integrations'));+check('drawer has Labs column sections', drawer.headers.some((h) => h.startsWith('Labs ·')));++const navErrors = consoleErrors.filter(+ (e) => !/favicon|third-party|net::ERR_|404|Failed to load resource|WebSocket|\[vite\]/i.test(e),+);+check('no console errors from nav code', navErrors.length === 0, navErrors.slice(0, 3).join(' | '));++await browser.close();+console.log(failures.length ? `\n${failures.length} FAILURES` : '\nALL CHECKS PASSED');+process.exit(failures.length ? 1 : 0);diff --git a/scripts/zauth-register-endpoints.mjs b/scripts/zauth-register-endpoints.mjsindex 223389017..7c4f8ce34 100644--- a/scripts/zauth-register-endpoints.mjs+++ b/scripts/zauth-register-endpoints.mjs@@ -31,7 +31,19 @@ const ENDPOINTS = [{ path: '/api/mcp-3d', method: 'POST', body: MCP_BODY, json: true },{ path: '/api/mcp-agent', method: 'POST', body: MCP_BODY, json: true },{ path: '/api/mcp-bazaar', method: 'POST', body: MCP_BODY, json: true },- { path: '/api/pump-fun-mcp', method: 'POST', body: MCP_BODY, json: true },+ // pump-fun-mcp: tools/list is free by design — only a gated tools/call+ // draws the 402 that carries pricing for the registry.+ {+ path: '/api/pump-fun-mcp',+ method: 'POST',+ body: JSON.stringify({+ jsonrpc: '2.0',+ id: 1,+ method: 'tools/call',+ params: { name: 'pumpfun_vanity_mint', arguments: {} },+ }),+ json: true,+ },{ path: '/api/ibm-mcp', method: 'POST', body: MCP_BODY, json: true },// Worker dispatcher x402 surface.{ path: '/api/wk-x402', method: 'GET' },diff --git a/src/agent-skills-pumpfun.js b/src/agent-skills-pumpfun.jsindex 500b866f5..059ffa0b4 100644--- a/src/agent-skills-pumpfun.js+++ b/src/agent-skills-pumpfun.js@@ -31,6 +31,29 @@ import { correlateXPost } from './social/x-post-impact.js';const DEFAULT_NETWORK = 'mainnet';const DEFAULT_SLIPPAGE_BPS = 500;+// Every @pump-fun SDK builder takes slippage as a PERCENT (`slippage: 1` = 1%):+// pump-sdk pads via `amount * floor(slippage * 10) / 1000`, pump-swap-sdk via+// `1 ± slippage / 100`. Convert user-facing bps accordingly (100 bps -> 1).+function slippagePct(bps) {+ const n = Number(bps);+ return Math.max(0, Math.min(10_000, Number.isFinite(n) ? n : DEFAULT_SLIPPAGE_BPS)) / 100;+}++// base_token_program must match the mint account's owner — Token-2022 for+// create_v2 coins (every coin pump.fun mints today), SPL Token for legacy+// coins (docs/pumpfun-program/docs/instructions/BUY.md #4).+const TOKEN_2022_PROGRAM_B58 = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb';+const SPL_TOKEN_PROGRAM_B58 = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA';+async function detectBaseTokenProgram(connection, mint) {+ const info = await connection.getAccountInfo(mint);+ if (!info) throw new Error(`Mint ${mint.toBase58()} not found on this network.`);+ const owner = info.owner.toBase58();+ if (owner !== TOKEN_2022_PROGRAM_B58 && owner !== SPL_TOKEN_PROGRAM_B58) {+ throw new Error(`Mint is owned by unknown token program ${owner} — not a pump.fun coin.`);+ }+ return info.owner;+}+async function loadCore() {const [pump, web3, BN, splToken] = await Promise.all([import('@pump-fun/pump-sdk'),@@ -240,6 +263,15 @@ export function registerPumpFunSkills(skills) {const onlineSdk = new pump.OnlinePumpSdk(connection);const global = await onlineSdk.fetchGlobal();const solLamports = new BN(Math.floor(args.initialBuySol * web3.LAMPORTS_PER_SOL));+ // buy's `amount` arg is the base-token quantity and must be > 0 —+ // derive it from the dev-buy SOL against the fresh-curve reserves.+ const tokenAmount = pump.getBuyTokenAmountFromSolAmount({+ global,+ feeConfig: null,+ mintSupply: null,+ bondingCurve: null,+ amount: solLamports,+ });instructions = await offline.createV2AndBuyInstructions({global,mint: mintKeypair.publicKey,@@ -248,7 +280,7 @@ export function registerPumpFunSkills(skills) {uri: args.uri,creator: pubkey,user: pubkey,- amount: new BN(0),+ amount: tokenAmount,solAmount: solLamports,mayhemMode: false,});@@ -423,8 +455,12 @@ export function registerPumpFunSkills(skills) {const onlineSdk = new pump.OnlinePumpSdk(connection);const offline = new pump.PumpSdk();- const global = await onlineSdk.fetchGlobal();- const state = await onlineSdk.fetchBuyState(mint, pubkey);+ const tokenProgram = await detectBaseTokenProgram(connection, mint);+ const [global, feeConfig, state] = await Promise.all([+ onlineSdk.fetchGlobal(),+ onlineSdk.fetchFeeConfig().catch(() => null),+ onlineSdk.fetchBuyState(mint, pubkey, tokenProgram),+ ]);// Resolve quoteMint: explicit override > on-chain curve > WSOL fallback.const WSOL = new web3.PublicKey('So11111111111111111111111111111111111111112');@@ -433,50 +469,42 @@ export function registerPumpFunSkills(skills) {: (state.bondingCurve?.quoteMint || WSOL);const isUsdcQuote = !pump.isLegacyQuoteMint(quoteMintPk);- let buyIxs;- if (isUsdcQuote) {- if (usdcAmount == null) {- return { success: false, output: 'USDC-paired coin: pass usdcAmount.', sentiment: -0.2 };- }- const quoteAtomics = new BN(Math.round(usdcAmount * 1_000_000));- buyIxs = await offline.buyV2Instructions({- global,- bondingCurveAccountInfo: state.bondingCurveAccountInfo,- bondingCurve: state.bondingCurve,- associatedUserAccountInfo: state.associatedUserAccountInfo,- mint,- user: pubkey,- amount: new BN(0),- quoteAmount: quoteAtomics,- slippage: slippageBps / 10_000,- quoteMint: quoteMintPk,- });- } else {- if (solAmount == null) {- return { success: false, output: 'SOL-paired coin: pass solAmount.', sentiment: -0.2 };- }- const solLamports = new BN(Math.floor(solAmount * web3.LAMPORTS_PER_SOL));- const expected = pump.getBuyTokenAmountFromSolAmount({- global,- feeConfig: null,- mintSupply: state.bondingCurve.tokenTotalSupply,- bondingCurve: state.bondingCurve,- amount: solLamports,- });- buyIxs = await offline.buyInstructions({- global,- bondingCurveAccountInfo: state.bondingCurveAccountInfo,- bondingCurve: state.bondingCurve,- associatedUserAccountInfo: state.associatedUserAccountInfo,- mint,- user: pubkey,- amount: expected,- solAmount: solLamports,- slippage: slippageBps / 10_000,- tokenProgram:- web3.TOKEN_PROGRAM_ID || (await import('@solana/spl-token')).TOKEN_PROGRAM_ID,- });+ if (isUsdcQuote && usdcAmount == null) {+ return { success: false, output: 'USDC-paired coin: pass usdcAmount.', sentiment: -0.2 };+ }+ if (!isUsdcQuote && solAmount == null) {+ return { success: false, output: 'SOL-paired coin: pass solAmount.', sentiment: -0.2 };}+ const quoteAtomics = isUsdcQuote+ ? new BN(Math.round(usdcAmount * 1_000_000))+ : new BN(Math.floor(solAmount * web3.LAMPORTS_PER_SOL));+ // buy_v2's `amount` arg is the base-token quantity to buy (must be > 0);+ // the SDK pads `quoteAmount` into max_quote_cost with percent slippage.+ const expected = pump.getBuyTokenAmountFromSolAmount({+ global,+ feeConfig,+ mintSupply: state.bondingCurve.tokenTotalSupply,+ bondingCurve: state.bondingCurve,+ amount: quoteAtomics,+ quoteMint: quoteMintPk,+ });+ if (!expected.gt(new BN(0))) {+ return { success: false, output: 'Amount too small to buy any tokens.', sentiment: -0.2 };+ }+ // Unified v2 buy for every coin type (SOL/USDC quotes, SPL/Token-2022+ // base mints) per the upstream migration guidance.+ const buyIxs = await offline.buyV2Instructions({+ global,+ bondingCurveAccountInfo: state.bondingCurveAccountInfo,+ bondingCurve: state.bondingCurve,+ associatedUserAccountInfo: state.associatedUserAccountInfo,+ mint,+ user: pubkey,+ amount: expected,+ quoteAmount: quoteAtomics,+ slippage: slippagePct(slippageBps),+ tokenProgram,+ });const sig = await sendIxs({web3,@@ -558,60 +586,72 @@ export function registerPumpFunSkills(skills) {};}- const { pump, web3, BN } = await loadCore();+ const { pump, web3, BN, splToken } = await loadCore();const { wallet, pubkey } = await requireWallet();const connection = getConnection(web3, network);const mint = new web3.PublicKey(args.mint);const onlineSdk = new pump.OnlinePumpSdk(connection);const offline = new pump.PumpSdk();- const global = await onlineSdk.fetchGlobal();- const state = await onlineSdk.fetchSellState(mint, pubkey);+ const tokenProgram = await detectBaseTokenProgram(connection, mint);+ const [global, feeConfig, state] = await Promise.all([+ onlineSdk.fetchGlobal(),+ onlineSdk.fetchFeeConfig().catch(() => null),+ onlineSdk.fetchSellState(mint, pubkey, tokenProgram),+ ]);const tokenAmount = new BN(args.tokenAmount);+ // Expected quote output: the SDK shaves it by the percent slippage to+ // produce a real min_sol_output floor (passing 0 disables protection).const expectedSol = pump.getSellSolAmountFromTokenAmount({global,- feeConfig: null,+ feeConfig,mintSupply: state.bondingCurve.tokenTotalSupply,bondingCurve: state.bondingCurve,amount: tokenAmount,});- // Route based on the on-chain quote mint. USDC-paired v2 coins go- // through sellV2Instructions; SOL-paired stays on the legacy path.+ // Resolve the on-chain quote mint (default pubkey = SOL-paired).const WSOL = new web3.PublicKey('So11111111111111111111111111111111111111112');const quoteMintPk = args.quoteMint? new web3.PublicKey(args.quoteMint): (state.bondingCurve?.quoteMint || WSOL);const isUsdcQuote = !pump.isLegacyQuoteMint(quoteMintPk);- let sellIxs;- if (isUsdcQuote) {- sellIxs = await offline.sellV2Instructions({- global,- bondingCurveAccountInfo: state.bondingCurveAccountInfo,- bondingCurve: state.bondingCurve,- mint,- user: pubkey,- amount: tokenAmount,- quoteAmount: new BN(0),- slippage: slippageBps / 10_000,- quoteMint: quoteMintPk,- });- } else {- sellIxs = await offline.sellInstructions({+ // Unified v2 sell for every coin type. For stable quotes the program+ // pays proceeds into the seller's quote ATA, which sell_v2 does NOT+ // init — create it idempotently first.+ const sellIxs = [];+ if (isUsdcQuote && splToken) {+ const userQuoteAta = splToken.getAssociatedTokenAddressSync(+ quoteMintPk,+ pubkey,+ true,+ splToken.TOKEN_PROGRAM_ID,+ );+ sellIxs.push(+ splToken.createAssociatedTokenAccountIdempotentInstruction(+ pubkey,+ userQuoteAta,+ pubkey,+ quoteMintPk,+ splToken.TOKEN_PROGRAM_ID,+ ),+ );+ }+ sellIxs.push(+ ...(await offline.sellV2Instructions({global,bondingCurveAccountInfo: state.bondingCurveAccountInfo,bondingCurve: state.bondingCurve,mint,user: pubkey,amount: tokenAmount,- solAmount: expectedSol,- slippage: slippageBps / 10_000,- tokenProgram: (await import('@solana/spl-token')).TOKEN_PROGRAM_ID,- mayhemMode: false,- });- }+ quoteAmount: expectedSol,+ slippage: slippagePct(slippageBps),+ tokenProgram,+ })),+ );const sig = await sendIxs({web3,@@ -653,12 +693,16 @@ export function registerPumpFunSkills(skills) {const mint = new web3.PublicKey(args.mint);const curve = await onlineSdk.fetchBondingCurve(mint);- const global = await onlineSdk.fetchGlobal();const graduated = !!curve.complete;- const marketCap = pump.bondingCurveMarketCap({- global,- bondingCurve: curve,- });+ // Graduated curves have zero virtual token reserves, which the SDK+ // helper rejects — report the curve's last market cap as null there.+ const marketCap = curve.virtualTokenReserves.isZero()+ ? null+ : pump.bondingCurveMarketCap({+ mintSupply: curve.tokenTotalSupply,+ virtualQuoteReserves: curve.virtualQuoteReserves ?? curve.virtualSolReserves,+ virtualTokenReserves: curve.virtualTokenReserves,+ });let userBalance = '0';let owner = null;@@ -666,21 +710,25 @@ export function registerPumpFunSkills(skills) {const wallet = detectSolanaWallet();if (wallet?.publicKey && splToken) {owner = wallet.publicKey;- const ata = await splToken.getAssociatedTokenAddress(mint, owner);+ // Token-2022 coins (create_v2) live at a different ATA than SPL —+ // derive with the mint's real token program.+ const tokenProgram = await detectBaseTokenProgram(connection, mint);+ const ata = splToken.getAssociatedTokenAddressSync(mint, owner, true, tokenProgram);const acct = await connection.getTokenAccountBalance(ata).catch(() => null);userBalance = acct?.value?.amount ?? '0';}} catch {}+ const marketCapStr = marketCap ? marketCap.toString() : null;return {success: true,output: graduated- ? `Graduated to AMM. Market cap ~${marketCap.toString()} lamports.`- : `On bonding curve. Market cap ~${marketCap.toString()} lamports.`,+ ? `Graduated to AMM — price now set by the pool${marketCapStr ? `. Last curve market cap ~${marketCapStr} quote units.` : '.'}`+ : `On bonding curve. Market cap ~${marketCapStr} quote units.`,sentiment: graduated ? 0.7 : 0.2,data: {mint: args.mint,- marketCap: marketCap.toString(),+ marketCap: marketCapStr,graduated,userBalance,owner: owner ? owner.toBase58() : null,@@ -710,29 +758,31 @@ export function registerPumpFunSkills(skills) {},handler: async (args, _ctx) => {const network = args.network || DEFAULT_NETWORK;- const slippage = (args.slippageBps ?? DEFAULT_SLIPPAGE_BPS) / 10_000;const { amm, web3, BN } = await loadAmm();const { wallet, pubkey } = await requireWallet();const connection = getConnection(web3, network);const mint = new web3.PublicKey(args.mint);- const sdk = new amm.OnlinePumpAmmSdk(connection);+ const online = new amm.OnlinePumpAmmSdk(connection);+ const offline = new amm.PumpAmmSdk();const solLamports = new BN(Math.floor(args.solAmount * web3.LAMPORTS_PER_SOL));- const ixs = await sdk.swapAutocompleteBaseFromQuote({- pool: amm.canonicalPumpPoolPda(mint)[0],- quote: solLamports,- slippage,- direction: 'quoteToBase',- user: pubkey,- });+ // canonicalPumpPoolPda returns the pool PublicKey directly (keyed to+ // the wSOL quote — this skill is SOL-denominated).+ const poolKey = amm.canonicalPumpPoolPda(mint);+ const swapState = await online.swapSolanaState(poolKey, pubkey);+ const ixs = await offline.buyQuoteInput(+ swapState,+ solLamports,+ slippagePct(args.slippageBps),+ );const sig = await sendIxs({web3,connection,wallet,payer: pubkey,- instructions: Array.isArray(ixs) ? ixs : ixs.instructions || [],+ instructions: ixs,});return {@@ -764,29 +814,29 @@ export function registerPumpFunSkills(skills) {},handler: async (args, _ctx) => {const network = args.network || DEFAULT_NETWORK;- const slippage = (args.slippageBps ?? DEFAULT_SLIPPAGE_BPS) / 10_000;const { amm, web3, BN } = await loadAmm();const { wallet, pubkey } = await requireWallet();const connection = getConnection(web3, network);const mint = new web3.PublicKey(args.mint);- const sdk = new amm.OnlinePumpAmmSdk(connection);+ const online = new amm.OnlinePumpAmmSdk(connection);+ const offline = new amm.PumpAmmSdk();const tokenAmount = new BN(args.tokenAmount);- const ixs = await sdk.swapAutocompleteQuoteFromBase({- pool: amm.canonicalPumpPoolPda(mint)[0],- base: tokenAmount,- slippage,- direction: 'baseToQuote',- user: pubkey,- });+ const poolKey = amm.canonicalPumpPoolPda(mint);+ const swapState = await online.swapSolanaState(poolKey, pubkey);+ const ixs = await offline.sellBaseInput(+ swapState,+ tokenAmount,+ slippagePct(args.slippageBps),+ );const sig = await sendIxs({web3,connection,wallet,payer: pubkey,- instructions: Array.isArray(ixs) ? ixs : ixs.instructions || [],+ instructions: ixs,});return {diff --git a/src/app.js b/src/app.jsindex 759750099..b3b5d8463 100644--- a/src/app.js+++ b/src/app.js@@ -12,6 +12,26 @@ import { NichAgent } from './nich-agent.js';import { ThoughtBubble } from './thought-bubble.js';import { AvatarCreator } from './avatar-creator.js';import { resolveURI, isDecentralizedURI } from './ipfs.js';+// Hosts we trust to serve 3D assets when a model URL arrives from an untrusted+// source (the `?model=` query param). Same-origin, decentralized (ipfs:/ar:),+// and these first-party/gateway hosts only — so a crafted link can't make the+// viewer fetch and render an attacker-hosted GLB under the three.ws origin+// (brand-spoof / phishing).+const TRUSTED_ASSET_HOST_RE = /(^|\.)(three\.ws|r2\.dev|mypinata\.cloud|pinata\.cloud|ipfs\.io|dweb\.link|arweave\.net)$/i;+function isSafeQueryModelUrl(raw) {+ if (!raw || typeof raw !== 'string') return false;+ if (raw.startsWith('/') && !raw.startsWith('//')) return true; // same-origin relative+ if (isDecentralizedURI(raw)) return true; // ipfs:// / ar://+ try {+ const u = new URL(raw, location.origin);+ if (u.origin === location.origin) return true;+ if (u.protocol !== 'https:') return false;+ if (u.hostname === 'storage.googleapis.com') return true;+ return TRUSTED_ASSET_HOST_RE.test(u.hostname);+ } catch {+ return false;+ }+}import { saveRemoteGlbToAccount, getMe, readAuthHint } from './account.js';import { getWidget } from './widgets.js';import { mountAnimationGallery } from './widgets/animation-gallery.js';@@ -277,7 +297,10 @@ class App {// Honor `?model=<url>` passed from the /app deploy button so an// unsaved viewer model still flows through instead of falling to CZ.if (options.deploy) {- const qpModel = new URLSearchParams(location.search).get('model') || '';+ const rawQpModel = new URLSearchParams(location.search).get('model') || '';+ // Only honor a query-param model URL from a trusted asset source; an+ // arbitrary attacker URL falls through to the default avatar.+ const qpModel = isSafeQueryModelUrl(rawQpModel) ? rawQpModel : '';const model = options.model || qpModel || '/avatars/cz.glb';this.view(isDecentralizedURI(model) ? resolveURI(model) : model, '', new Map()).catch(() => {})diff --git a/src/components/screenshot-modal.js b/src/components/screenshot-modal.jsindex 3102f3a0b..e145d3dc6 100644--- a/src/components/screenshot-modal.js+++ b/src/components/screenshot-modal.js@@ -22,11 +22,11 @@ export class ScreenshotModal {<img src="" alt="Screenshot preview" /></div><div class="screenshot-modal-footer">- <button class="btn-secondary screenshot-modal-copy">Copy</button>+ <button class="btn screenshot-modal-copy">Copy</button><a href="https://x.com/intent/tweet?text=Check%20out%20my%203D%20Agent!&url=${encodeURIComponent(window.location.href,- )}" target="_blank" rel="noopener noreferrer" class="btn-secondary screenshot-modal-share">Share on X</a>- <button class="btn-primary screenshot-modal-download">Download</button>+ )}" target="_blank" rel="noopener noreferrer" class="btn screenshot-modal-share">Share on X</a>+ <button class="btn btn--primary screenshot-modal-download">Download</button></div></div>`;diff --git a/src/demo/os-hub.js b/src/demo/os-hub.jsindex 1aaca9bb3..144ca669f 100644--- a/src/demo/os-hub.js+++ b/src/demo/os-hub.js@@ -40,24 +40,48 @@ async function probeBaseGlb() {const res = await fetch('/avatars/default.glb', { method: 'HEAD' });if (!res.ok) throw new Error(`HTTP ${res.status}`);const size = res.headers.get('content-length');- set('glb-status', `/avatars/default.glb · ${size ? `${(size / 1024).toFixed(0)} KB` : 'ok'}`, 'ok');+ set(+ 'glb-status',+ `/avatars/default.glb · ${size ? `${(size / 1024).toFixed(0)} KB` : 'ok'}`,+ 'ok',+ );} catch (err) {set('glb-status', `failed: ${err.message}`, 'err');}}-async function probeCharacterStudio() {- const url = 'http://localhost:5173';+// Same resolution as getStudioUrl() in src/avatar-creator.js: an explicit+// VITE_CHARACTER_STUDIO_URL override wins; otherwise the Avatar Studio is+// served same-origin under /avatar-studio in dev (Vite middleware) and prod+// (copy-avatar-studio build step) — never a dead localhost in production.+function resolveStudioUrl() {+ try {+ const override = import.meta.env?.VITE_CHARACTER_STUDIO_URL;+ if (override) return String(override).trim().replace(/\/$/, '');+ } catch (_) {}+ return `${location.origin}/avatar-studio`;+}++async function probeAvatarStudio() {+ const url = resolveStudioUrl();+ const sameOrigin = url.startsWith(location.origin);try {const controller = new AbortController();- const timer = setTimeout(() => controller.abort(), 1500);- const res = await fetch(url, { method: 'GET', mode: 'no-cors', signal: controller.signal });+ const timer = setTimeout(() => controller.abort(), 4000);+ // A cross-origin override can't be inspected without CORS, so fall back+ // to an opaque no-cors probe there; same-origin gives a real status.+ const res = await fetch(`${url}/`, {+ method: 'GET',+ mode: sameOrigin ? 'same-origin' : 'no-cors',+ signal: controller.signal,+ });clearTimeout(timer);+ if (sameOrigin && !res.ok) throw new Error(`HTTP ${res.status}`);set('cs-status', `reachable · ${url}`, 'ok');} catch (err) {set('cs-status',- `not running · start with: npm --prefix character-studio run dev`,+ `not reachable · ${url} — build with: npm --prefix character-studio run build`,'err',);}@@ -66,4 +90,4 @@ async function probeCharacterStudio() {probeMediapipe();probeTriangulation();probeBaseGlb();-probeCharacterStudio();+probeAvatarStudio();diff --git a/src/demo/os-studio.js b/src/demo/os-studio.jsindex 808a19d01..f696ae15c 100644--- a/src/demo/os-studio.js+++ b/src/demo/os-studio.js@@ -23,13 +23,27 @@ import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';import { OrbitControls } from 'three/addons/controls/OrbitControls.js';const PUBLIC_STUDIO = 'https://m3-org.github.io/CharacterStudio';-const LOCAL_STUDIO = 'http://localhost:5173';++// Same resolution as getStudioUrl() in src/avatar-creator.js: an explicit+// VITE_CHARACTER_STUDIO_URL override wins (e.g. a standalone studio dev server+// on :5173 during character-studio development); otherwise the Avatar Studio is+// served same-origin under /avatar-studio — by the Vite dev middleware in dev+// and the copy-avatar-studio build step in prod (see vite.config.js) — so this+// resolves to a live URL on every deployment instead of a dead localhost.+function resolveStudioUrl() {+ try {+ const override = import.meta.env?.VITE_CHARACTER_STUDIO_URL;+ if (override) return String(override).trim().replace(/\/$/, '');+ } catch (_) {}+ return `${location.origin}/avatar-studio`;+}+const STUDIO_URL = resolveStudioUrl();const iframeHost = document.getElementById('iframe-host');const iframeEmpty = document.getElementById('iframe-empty');const previewViewer = document.getElementById('preview-viewer');const previewBadge = document.getElementById('preview-badge');-const btnLocal = document.getElementById('btn-open-local');+const btnStudio = document.getElementById('btn-open-studio');const btnPublic = document.getElementById('btn-open-public');const btnDownload = document.getElementById('btn-download');const btnSave = document.getElementById('btn-save');@@ -53,8 +67,7 @@ function openStudio(url) {const frame = document.createElement('iframe');frame.className = 'studio-frame';frame.allow = 'camera *; microphone *; clipboard-write';- frame.sandbox =- 'allow-scripts allow-same-origin allow-forms allow-popups allow-downloads';+ frame.sandbox = 'allow-scripts allow-same-origin allow-forms allow-popups allow-downloads';frame.src = url;frame.style.minHeight = '600px';try {@@ -72,7 +85,7 @@ function openStudio(url) {});}-btnLocal.addEventListener('click', () => openStudio(LOCAL_STUDIO));+btnStudio.addEventListener('click', () => openStudio(STUDIO_URL));btnPublic.addEventListener('click', () => openStudio(PUBLIC_STUDIO));// ── Listen for export from CharacterStudio iframe ──────────────────────────@@ -185,7 +198,7 @@ function fitToObject({ camera, controls }, obj) {box.getSize(size);box.getCenter(center);const maxDim = Math.max(size.x, size.y, size.z);- const dist = (maxDim / Math.tan((Math.PI / 180) * camera.fov / 2)) * 1.3;+ const dist = (maxDim / Math.tan(((Math.PI / 180) * camera.fov) / 2)) * 1.3;camera.position.set(center.x, center.y + size.y * 0.2, center.z + dist);controls.target.copy(center);controls.update();diff --git a/src/pump/pump-swap-quote.js b/src/pump/pump-swap-quote.jsindex 2c0ba1cb4..57887fd3f 100644--- a/src/pump/pump-swap-quote.js+++ b/src/pump/pump-swap-quote.js@@ -77,7 +77,8 @@ export async function quoteSwap({ inputMint, outputMint, amountIn, slippageBps =}const { globalConfig, feeConfig, pool, poolBaseAmount, poolQuoteAmount, baseMintAccount } = state;- const slippage = slippageBps / 10_000;+ // pump-swap-sdk takes slippage as a PERCENT (1 = 1%): `1 ± slippage / 100`.+ const slippage = slippageBps / 100;const shared = {slippage,baseReserve: poolBaseAmount,diff --git a/src/walk.js b/src/walk.jsindex d94c5d0c7..9bfb9ccaf 100644--- a/src/walk.js+++ b/src/walk.js@@ -3323,9 +3323,9 @@ if (import.meta.env?.DEV) {const thumb = a.thumbnail_url || '';const name = a.name || a.slug || 'Untitled';const active = currentAvatarId === a.id;- return `<button class="walk-avatar-opt${active ? ' is-active' : ''}" data-avatar-url="${a.url || ''}" data-avatar-id="${a.id}">- ${thumb ? `<img class="walk-avatar-opt-thumb" src="${thumb}" alt="" loading="lazy" />` : `<div class="walk-avatar-opt-thumb" style="display:flex;align-items:center;justify-content:center;font-size:14px;color:#999">${name[0]}</div>`}- <span class="walk-avatar-opt-name">${name.replace(/[<>&"']/g, c => ({'<':'<','>':'>','&':'&','"':'"',"'":"'"})[c])}</span>+ return `<button class="walk-avatar-opt${active ? ' is-active' : ''}" data-avatar-url="${esc(a.url || '')}" data-avatar-id="${esc(a.id ?? '')}">+ ${thumb ? `<img class="walk-avatar-opt-thumb" src="${esc(thumb)}" alt="" loading="lazy" />` : `<div class="walk-avatar-opt-thumb" style="display:flex;align-items:center;justify-content:center;font-size:14px;color:#999">${esc(name[0] || '')}</div>`}+ <span class="walk-avatar-opt-name">${esc(name)}</span></button>`;}).join('')}`;diff --git a/tasks/pumpfun-upstream/03-segments-findings.md b/tasks/pumpfun-upstream/03-segments-findings.mdindex 47752ba53..9a9e5b6cc 100644--- a/tasks/pumpfun-upstream/03-segments-findings.md+++ b/tasks/pumpfun-upstream/03-segments-findings.md@@ -96,3 +96,30 @@ dependency on the lottery/reflection plumbing.Net: snapshot coins get full cohorts incl. tenure; agent tokens getsize/concentration cohorts immediately, and gain tenure automatically if/when amint is ever registered + snapshotted.++## Re-verification (2026-06-11)++Re-checked every upstream signal; **nothing has changed — recommendation stands+(do not adopt; native cohorts already shipped).**++- **npm: still unpublished under every plausible name.** `npm view` → E404 for+ `@pump-fun/segments-sdk` (the name in its manifest), `pump-segments-sdk`, and+ `@pump-fun/pump-segments-sdk`.+- **Maintainer accounts publish no segments package.** npm registry search+ `maintainer:oussama-baton` and `maintainer:security-baton` each return exactly+ the four known packages: `@pump-fun/pump-sdk` 1.36.0,+ `@pump-fun/pump-swap-sdk` 1.17.0, `@pump-fun/agent-payments-sdk` 3.0.3,+ `@pump-fun/shared-contracts` 0.2.2.+- **Repo is dormant.** Full history is still the same 12 commits by "sharuk",+ all 2025-11-25/26 ("Init skeleton" → "update version"). `pushed_at`+ 2026-04-16 corresponds to bot branches only+ (`socket/autopatch-…`, `dependabot/npm_and_yarn-…`); the only open PRs remain+ #2 (Dependabot `fast-xml-parser` bump, 2026-02-11) and #3 (Socket patch for+ CVE-2026-25896, 2026-04-16). Branches: `devnet` + the two bot branches. No+ human activity in over six months.+- **Org recon:** the only newer pump-fun org repo since the prior pass is+ `carbon` (pushed 2026-05-28) — a Rust Solana indexing framework, unrelated to+ segments.+- **Our native replacement is intact and green.** All shipped files present+ (`api/_lib/coin/cohorts.js`, `cohorts-live.js`, `api/coin/[mint]/cohorts.js`,+ migration, tests); `npx vitest run` on both cohort suites → **24/24 passing**.diff --git a/tasks/pumpfun-upstream/README.md b/tasks/pumpfun-upstream/README.mdindex 36689c523..7b411cfb9 100644--- a/tasks/pumpfun-upstream/README.md+++ b/tasks/pumpfun-upstream/README.md@@ -27,7 +27,7 @@ conversation context.| 01 | `01-v2-trade-instructions-usdc-audit.md` | **High** | Audit our buy/sell instruction building against the new `buy_v2`/`sell_v2` interface + decide/implement USDC-quoted-coin support. || 02 | `02-pump-fun-skills-upstream-sync.md` | ✅ Done | Diff our vendored `pump-fun-skills/` against the official repo's latest; sync drift while preserving our additions. Outcome: we're at/ahead of upstream — nothing to pull → [`02-skills-drift-report.md`](02-skills-drift-report.md). || 03 | `03-pump-segments-sdk-investigation.md` | Low | Figure out what `pump-segments-sdk` (new, unpublished) is and whether three.ws should adopt it. |-| 04 | `04-agent-payments-sdk-reconcile.md` | Low | Decide how to handle our local `[email protected]` vs upstream's published 3.0.3. |+| 04 | `04-agent-payments-sdk-reconcile.md` | ✅ Done | Decide how to handle our local `[email protected]` vs upstream's published 3.0.3. Outcome: kept as a deliberate fork, renamed `@three-ws/agent-payments` (workspace); root manifest pins real `@pump-fun/agent-payments-sdk@^3.0.3` for external-facing templates → [`agent-payments-sdk/FORK_NOTES.md`](../../agent-payments-sdk/FORK_NOTES.md). |## Constraints that apply to every task (from CLAUDE.md)diff --git a/tests/api/agents-voice.test.js b/tests/api/agents-voice.test.jsindex 065ab27b3..776d73a70 100644--- a/tests/api/agents-voice.test.js+++ b/tests/api/agents-voice.test.js@@ -12,6 +12,7 @@ import { Readable } from 'node:stream';// wrap() calls these; stub them out before the module under test is imported.vi.mock('../../api/_lib/zauth.js', () => ({ instrument: () => false, drain: async () => {} }));vi.mock('../../api/_lib/sentry.js', () => ({ captureException: () => {} }));+vi.mock('../../api/_lib/csrf.js', () => ({ requireCsrf: vi.fn(async () => true) }));// ── Shared mutable state ──────────────────────────────────────────────────────const state = {@@ -19,7 +20,9 @@ const state = {agentRow: null,voiceRow: null,elevenConfigured: true,- voices: [{ voice_id: 'rachel', name: 'Rachel', category: 'premade', labels: {}, preview_url: null }],+ voices: [+ { voice_id: 'rachel', name: 'Rachel', category: 'premade', labels: {}, preview_url: null },+ ],cloneResult: { voiceId: 'cloned-1', requiresVerification: false },cloneThrows: false,cloneThrowErr: null,@@ -37,7 +40,10 @@ vi.mock('../../api/_lib/auth.js', () => ({// ── DB mock ───────────────────────────────────────────────────────────────────vi.mock('../../api/_lib/db.js', () => ({sql: vi.fn((strings, ...vals) => {- const q = (typeof strings === 'string' ? strings : strings.join('?')).toLowerCase().replace(/\s+/g, ' ').trim();+ const q = (typeof strings === 'string' ? strings : strings.join('?'))+ .toLowerCase()+ .replace(/\s+/g, ' ')+ .trim();if (state.sqlQueue.length) {const next = state.sqlQueue.shift();@@ -63,11 +69,14 @@ vi.mock('../../api/_lib/elevenlabs.js', () => ({isConfigured: vi.fn(() => state.elevenConfigured),listVoices: vi.fn(async () => ({ voices: state.voices, cached: false })),createClonedVoice: vi.fn(async () => {- if (state.cloneThrows) throw state.cloneThrowErr ?? Object.assign(new Error('clone failed'), { status: 502 });+ if (state.cloneThrows)+ throw state.cloneThrowErr ?? Object.assign(new Error('clone failed'), { status: 502 });return state.cloneResult;}),deleteVoice: vi.fn(async () => {}),- isValidModel: vi.fn((id) => ['eleven_flash_v2_5', 'eleven_turbo_v2_5', 'eleven_multilingual_v2'].includes(id)),+ isValidModel: vi.fn((id) =>+ ['eleven_flash_v2_5', 'eleven_turbo_v2_5', 'eleven_multilingual_v2'].includes(id),+ ),normalizeVoiceSettings: vi.fn((input) => {if (input == null) return null;if (typeof input !== 'object' || Array.isArray(input))@@ -98,12 +107,19 @@ function makeRes() {body: null,_headers: {},};- res.setHeader = (k, v) => { res._headers[k.toLowerCase()] = v; };+ res.setHeader = (k, v) => {+ res._headers[k.toLowerCase()] = v;+ };res.getHeader = (k) => res._headers[k.toLowerCase()];res.end = (b) => {res.writableEnded = true;res.headersSent = true;- if (b) try { res.body = JSON.parse(b); } catch { res.body = b; }+ if (b)+ try {+ res.body = JSON.parse(b);+ } catch {+ res.body = b;+ }};res.write = () => {};return res;@@ -150,9 +166,17 @@ async function invoke(method, body, opts = {}) {beforeEach(() => {state.session = { id: 'user-1' };state.agentRow = { id: 'agent-1', user_id: 'user-1', name: 'Test Agent' };- state.voiceRow = { voice_provider: 'browser', voice_id: null, voice_cloned_at: null, voice_model: null, voice_settings: null };+ state.voiceRow = {+ voice_provider: 'browser',+ voice_id: null,+ voice_cloned_at: null,+ voice_model: null,+ voice_settings: null,+ };state.elevenConfigured = true;- state.voices = [{ voice_id: 'rachel', name: 'Rachel', category: 'premade', labels: {}, preview_url: null }];+ state.voices = [+ { voice_id: 'rachel', name: 'Rachel', category: 'premade', labels: {}, preview_url: null },+ ];state.cloneResult = { voiceId: 'cloned-1', requiresVerification: false };state.cloneThrows = false;state.cloneThrowErr = null;@@ -171,8 +195,11 @@ describe('GET /api/agents/:id/voice', () => {it('returns elevenlabs status when a voice is assigned', async () => {state.voiceRow = {- voice_provider: 'elevenlabs', voice_id: 'rachel',- voice_cloned_at: null, voice_model: 'eleven_flash_v2_5', voice_settings: null,+ voice_provider: 'elevenlabs',+ voice_id: 'rachel',+ voice_cloned_at: null,+ voice_model: 'eleven_flash_v2_5',+ voice_settings: null,};const { status, body } = await invoke('GET');expect(status).toBe(200);@@ -219,7 +246,15 @@ describe('PUT /api/agents/:id/voice', () => {state.sqlQueue = [[{ id: 'agent-1', user_id: 'user-1', name: 'Test Agent' }],[{ voice_id: null, voice_cloned_at: null, voice_model: null, voice_settings: null }],- [{ voice_provider: 'elevenlabs', voice_id: 'rachel', voice_cloned_at: null, voice_model: null, voice_settings: null }],+ [+ {+ voice_provider: 'elevenlabs',+ voice_id: 'rachel',+ voice_cloned_at: null,+ voice_model: null,+ voice_settings: null,+ },+ ],];const { status, body } = await invoke('PUT', { voice_id: 'rachel' });expect(status).toBe(200);@@ -237,8 +272,23 @@ describe('PUT /api/agents/:id/voice', () => {it('clears the voice when voice_id is null', async () => {state.sqlQueue = [[{ id: 'agent-1', user_id: 'user-1', name: 'Test Agent' }],- [{ voice_id: 'rachel', voice_cloned_at: null, voice_model: null, voice_settings: null }],- [{ voice_provider: 'browser', voice_id: null, voice_cloned_at: null, voice_model: null, voice_settings: null }],+ [+ {+ voice_id: 'rachel',+ voice_cloned_at: null,+ voice_model: null,+ voice_settings: null,+ },+ ],+ [+ {+ voice_provider: 'browser',+ voice_id: null,+ voice_cloned_at: null,+ voice_model: null,+ voice_settings: null,+ },+ ],];const { status, body } = await invoke('PUT', { voice_id: null });expect(status).toBe(200);@@ -249,11 +299,23 @@ describe('PUT /api/agents/:id/voice', () => {it('updates model and settings without touching the voice assignment', async () => {state.sqlQueue = [[{ id: 'agent-1', user_id: 'user-1', name: 'Test Agent' }],- [{ voice_id: 'rachel', voice_cloned_at: null, voice_model: 'eleven_flash_v2_5', voice_settings: null }],- [{- voice_provider: 'elevenlabs', voice_id: 'rachel', voice_cloned_at: null,- voice_model: 'eleven_turbo_v2_5', voice_settings: null,- }],+ [+ {+ voice_id: 'rachel',+ voice_cloned_at: null,+ voice_model: 'eleven_flash_v2_5',+ voice_settings: null,+ },+ ],+ [+ {+ voice_provider: 'elevenlabs',+ voice_id: 'rachel',+ voice_cloned_at: null,+ voice_model: 'eleven_turbo_v2_5',+ voice_settings: null,+ },+ ],];const { status, body } = await invoke('PUT', { voice_model: 'eleven_turbo_v2_5' });expect(status).toBe(200);@@ -292,12 +354,18 @@ describe('POST /api/agents/:id/voice/clone', () => {});it('returns 415 for a non-audio content-type', async () => {- const { status } = await invoke('POST', Buffer.alloc(60_000), { action: 'clone', contentType: 'video/mp4' });+ const { status } = await invoke('POST', Buffer.alloc(60_000), {+ action: 'clone',+ contentType: 'video/mp4',+ });expect(status).toBe(415);});it('returns 400 for audio shorter than 30s (duration header)', async () => {- const { status, body } = await invoke('POST', VALID_AUDIO, { action: 'clone', duration: 10 });+ const { status, body } = await invoke('POST', VALID_AUDIO, {+ action: 'clone',+ duration: 10,+ });expect(status).toBe(400);expect(body.error).toBe('audio_too_short');});@@ -310,10 +378,7 @@ describe('POST /api/agents/:id/voice/clone', () => {});it('clones successfully and returns the new voice id', async () => {- state.sqlQueue = [- [{ id: 'agent-1', user_id: 'user-1', name: 'Test Agent' }],- [],- ];+ state.sqlQueue = [[{ id: 'agent-1', user_id: 'user-1', name: 'Test Agent' }], []];const { status, body } = await invoke('POST', VALID_AUDIO, { action: 'clone' });expect(status).toBe(201);expect(body.voice_id).toBe('cloned-1');diff --git a/tests/api/ibm-vision.test.js b/tests/api/ibm-vision.test.jsindex d0b753115..e95b50e8a 100644--- a/tests/api/ibm-vision.test.js+++ b/tests/api/ibm-vision.test.js@@ -17,14 +17,18 @@ const state = {fetchStatus: 200,fetchContentType: 'image/jpeg',fetchBody: Buffer.alloc(200), // tiny valid image- graniteText: '{"appearance":"A sleek cobalt android.","vibe":"calm, precise","persona":"A reliable guide.","suggested_name":"Cobalt","bio":"Your co-pilot.","tone_tags":["calm","precise"],"voice":"warm and measured"}',+ graniteText:+ '{"appearance":"A sleek cobalt android.","vibe":"calm, precise","persona":"A reliable guide.","suggested_name":"Cobalt","bio":"Your co-pilot.","tone_tags":["calm","precise"],"voice":"warm and measured"}',graniteThrows: false,graniteThrowMsg: 'watsonx 404: not found',};// ── Mocks ──────────────────────────────────────────────────────────────────────vi.mock('../../api/_lib/rate-limit.js', () => ({- limits: { publicIp: vi.fn(async () => ({ success: true })) },+ limits: {+ publicIp: vi.fn(async () => ({ success: true })),+ watsonxEmbedGlobal: vi.fn(async () => ({ success: true })),+ },clientIp: vi.fn(() => '127.0.0.1'),}));@@ -35,7 +39,14 @@ vi.mock('../../api/_lib/db.js', () => ({vi.mock('../../api/_lib/watsonx.js', () => ({watsonxConfig: vi.fn(() =>state.wxConfigured- ? { configured: true, url: 'https://wx', projectId: 'proj', apiVersion: '2024-05-31', chatModel: 'ibm/granite-3-8b-instruct', embedModel: 'ibm/granite-embedding-278m-multilingual' }+ ? {+ configured: true,+ url: 'https://wx',+ projectId: 'proj',+ apiVersion: '2024-05-31',+ chatModel: 'ibm/granite-3-8b-instruct',+ embedModel: 'ibm/granite-embedding-278m-multilingual',+ }: { configured: false },),watsonxChatComplete: vi.fn(async () => {@@ -55,7 +66,12 @@ vi.mock('../../api/_lib/r2.js', () => ({// Mock global fetch for server-side image fetching.global.fetch = vi.fn(async () => {if (!state.fetchOk) {- return { ok: false, status: state.fetchStatus, headers: { get: () => null }, arrayBuffer: async () => new ArrayBuffer(0) };+ return {+ ok: false,+ status: state.fetchStatus,+ headers: { get: () => null },+ arrayBuffer: async () => new ArrayBuffer(0),+ };}const body = state.fetchBody;return {@@ -68,7 +84,8 @@ global.fetch = vi.fn(async () => {return null;},},- arrayBuffer: async () => body.buffer.slice(body.byteOffset, body.byteOffset + body.byteLength),+ arrayBuffer: async () =>+ body.buffer.slice(body.byteOffset, body.byteOffset + body.byteLength),};});@@ -77,21 +94,36 @@ const handler = (await import('../../api/ibm/vision.js')).default;import { allowedImageHost, buildPrompt, parseVision, VISION_MODEL } from '../../api/ibm/vision.js';// ── Test helpers ──────────────────────────────────────────────────────────────-const TINY_PNG = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==';+const TINY_PNG =+ 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==';function makeReq({ method = 'GET', url = '/api/ibm/vision', body = null } = {}) {const base = body ? Readable.from([Buffer.from(JSON.stringify(body))]) : Readable.from([]);base.method = method;base.url = url;- base.headers = { host: 'localhost', 'content-type': 'application/json', origin: 'http://localhost:3000' };+ base.headers = {+ host: 'localhost',+ 'content-type': 'application/json',+ origin: 'http://localhost:3000',+ };return base;}function makeRes() {return {- statusCode: 200, headers: {}, body: '', writableEnded: false,- setHeader(k, v) { this.headers[k.toLowerCase()] = v; },- getHeader(k) { return this.headers[k.toLowerCase()]; },- end(chunk) { if (chunk !== undefined) this.body += chunk; this.writableEnded = true; },+ statusCode: 200,+ headers: {},+ body: '',+ writableEnded: false,+ setHeader(k, v) {+ this.headers[k.toLowerCase()] = v;+ },+ getHeader(k) {+ return this.headers[k.toLowerCase()];+ },+ end(chunk) {+ if (chunk !== undefined) this.body += chunk;+ this.writableEnded = true;+ },};}async function invoke(reqOpts) {@@ -111,7 +143,8 @@ beforeEach(() => {state.fetchStatus = 200;state.fetchContentType = 'image/jpeg';state.fetchBody = Buffer.alloc(200);- state.graniteText = '{"appearance":"A sleek cobalt android.","vibe":"calm, precise","persona":"A reliable guide.","suggested_name":"Cobalt","bio":"Your co-pilot.","tone_tags":["calm","precise"],"voice":"warm and measured"}';+ state.graniteText =+ '{"appearance":"A sleek cobalt android.","vibe":"calm, precise","persona":"A reliable guide.","suggested_name":"Cobalt","bio":"Your co-pilot.","tone_tags":["calm","precise"],"voice":"warm and measured"}';state.graniteThrows = false;state.graniteThrowMsg = 'watsonx 502: upstream error';});@@ -128,7 +161,15 @@ describe('GET /api/ibm/vision — subjects', () => {it('maps DB rows to subjects with cdn URLs', async () => {state.dbRows = [- { id: 'id-1', slug: 'cobalt', name: 'Cobalt', storage_key: 'avatars/cobalt.glb', thumbnail_key: 'thumbs/cobalt.jpg', featured: true, view_count: 42 },+ {+ id: 'id-1',+ slug: 'cobalt',+ name: 'Cobalt',+ storage_key: 'avatars/cobalt.glb',+ thumbnail_key: 'thumbs/cobalt.jpg',+ featured: true,+ view_count: 42,+ },];const { status, body } = await invoke({ method: 'GET' });expect(status).toBe(200);@@ -168,7 +209,9 @@ describe('POST /api/ibm/vision — watsonx gate', () => {// ── POST /api/ibm/vision — input validation ─────────────────────────────────────describe('POST /api/ibm/vision — input validation', () => {- beforeEach(() => { state.wxConfigured = true; });+ beforeEach(() => {+ state.wxConfigured = true;+ });it('returns 400 bad_image when neither image nor imageUrl is provided', async () => {const { status, body } = await invoke({ method: 'POST', body: { hint: 'hello' } });@@ -177,7 +220,10 @@ describe('POST /api/ibm/vision — input validation', () => {});it('returns 400 bad_image when image data URL has empty data portion', async () => {- const { status, body } = await invoke({ method: 'POST', body: { image: 'data:image/png;base64,' } });+ const { status, body } = await invoke({+ method: 'POST',+ body: { image: 'data:image/png;base64,' },+ });expect(status).toBe(400);expect(body.error).toBe('bad_image');});@@ -191,19 +237,28 @@ describe('POST /api/ibm/vision — input validation', () => {});it('returns 400 bad_image when imageUrl uses http (not https)', async () => {- const { status, body } = await invoke({ method: 'POST', body: { imageUrl: 'http://pub-abc.r2.dev/img.jpg' } });+ const { status, body } = await invoke({+ method: 'POST',+ body: { imageUrl: 'http://pub-abc.r2.dev/img.jpg' },+ });expect(status).toBe(400);expect(body.error).toBe('bad_image');});it('returns 400 image_host_not_allowed for an arbitrary external host', async () => {- const { status, body } = await invoke({ method: 'POST', body: { imageUrl: 'https://evil.example.com/img.jpg' } });+ const { status, body } = await invoke({+ method: 'POST',+ body: { imageUrl: 'https://evil.example.com/img.jpg' },+ });expect(status).toBe(400);expect(body.error).toBe('image_host_not_allowed');});it('returns 400 image_host_not_allowed for internal metadata endpoint (SSRF)', async () => {- const { status, body } = await invoke({ method: 'POST', body: { imageUrl: 'https://169.254.169.254/latest/meta-data/' } });+ const { status, body } = await invoke({+ method: 'POST',+ body: { imageUrl: 'https://169.254.169.254/latest/meta-data/' },+ });expect(status).toBe(400);expect(body.error).toBe('image_host_not_allowed');});@@ -211,7 +266,9 @@ describe('POST /api/ibm/vision — input validation', () => {// ── POST /api/ibm/vision — server-side image fetch ───────────────────────────────describe('POST /api/ibm/vision — server-side image fetch', () => {- beforeEach(() => { state.wxConfigured = true; });+ beforeEach(() => {+ state.wxConfigured = true;+ });it('fetches an allowlisted imageUrl and sends it to Granite', async () => {const { status, body } = await invoke({@@ -250,7 +307,9 @@ describe('POST /api/ibm/vision — server-side image fetch', () => {// ── POST /api/ibm/vision — Granite Vision call ────────────────────────────────describe('POST /api/ibm/vision — Granite Vision result', () => {- beforeEach(() => { state.wxConfigured = true; });+ beforeEach(() => {+ state.wxConfigured = true;+ });it('returns a structured identity when Granite returns valid JSON', async () => {const { status, body } = await invoke({ method: 'POST', body: { image: TINY_PNG } });@@ -269,7 +328,11 @@ describe('POST /api/ibm/vision — Granite Vision result', () => {it('passes usage through to the response', async () => {const { body } = await invoke({ method: 'POST', body: { image: TINY_PNG } });- expect(body.usage).toMatchObject({ prompt_tokens: 120, completion_tokens: 80, total_tokens: 200 });+ expect(body.usage).toMatchObject({+ prompt_tokens: 120,+ completion_tokens: 80,+ total_tokens: 200,+ });});it('does not include "raw" when result is structured', async () => {@@ -278,7 +341,8 @@ describe('POST /api/ibm/vision — Granite Vision result', () => {});it('returns raw fallback (structured:false) when Granite returns prose', async () => {- state.graniteText = 'This avatar appears to be a futuristic character with a calm demeanor.';+ state.graniteText =+ 'This avatar appears to be a futuristic character with a calm demeanor.';const { status, body } = await invoke({ method: 'POST', body: { image: TINY_PNG } });expect(status).toBe(200);expect(body.vision.structured).toBe(false);@@ -286,7 +350,8 @@ describe('POST /api/ibm/vision — Granite Vision result', () => {});it('recovers JSON from a code-fenced response', async () => {- state.graniteText = '```json\n{"appearance":"A bot.","vibe":"calm","persona":"Helpful.","suggested_name":"Bot","bio":"Here to help.","tone_tags":["calm"],"voice":"steady"}\n```';+ state.graniteText =+ '```json\n{"appearance":"A bot.","vibe":"calm","persona":"Helpful.","suggested_name":"Bot","bio":"Here to help.","tone_tags":["calm"],"voice":"steady"}\n```';const { body } = await invoke({ method: 'POST', body: { image: TINY_PNG } });expect(body.vision.structured).toBe(true);expect(body.vision.suggested_name).toBe('Bot');@@ -320,7 +385,10 @@ describe('POST /api/ibm/vision — Granite Vision result', () => {});it('defaults unknown subject to avatar', async () => {- const { status, body } = await invoke({ method: 'POST', body: { image: TINY_PNG, subject: 'spacecraft' } });+ const { status, body } = await invoke({+ method: 'POST',+ body: { image: TINY_PNG, subject: 'spacecraft' },+ });expect(status).toBe(200);expect(body.subject).toBe('avatar');});@@ -365,25 +433,33 @@ describe('POST /api/ibm/vision — Granite Vision result', () => {// ── Unit: parseVision ─────────────────────────────────────────────────────────describe('parseVision — identity parser', () => {it('parses a clean JSON blob', () => {- const v = parseVision('{"appearance":"Blue bot.","vibe":"calm","persona":"A guide.","suggested_name":"Bot","bio":"Here for you.","tone_tags":["calm","helpful"],"voice":"warm"}');+ const v = parseVision(+ '{"appearance":"Blue bot.","vibe":"calm","persona":"A guide.","suggested_name":"Bot","bio":"Here for you.","tone_tags":["calm","helpful"],"voice":"warm"}',+ );expect(v.structured).toBe(true);expect(v.suggested_name).toBe('Bot');expect(v.tone_tags).toEqual(['calm', 'helpful']);});it('strips leading and trailing prose around the JSON', () => {- const v = parseVision('Sure, here it is: {"suggested_name":"Echo","bio":"test","appearance":"","vibe":"","persona":"","tone_tags":[],"voice":""} Hope that helps!');+ const v = parseVision(+ 'Sure, here it is: {"suggested_name":"Echo","bio":"test","appearance":"","vibe":"","persona":"","tone_tags":[],"voice":""} Hope that helps!',+ );expect(v.structured).toBe(true);expect(v.suggested_name).toBe('Echo');});it('splits a comma-joined string into tone_tags array', () => {- const v = parseVision('{"appearance":"x","vibe":"x","persona":"x","suggested_name":"x","bio":"x","tone_tags":"calm, curious, witty","voice":"x"}');+ const v = parseVision(+ '{"appearance":"x","vibe":"x","persona":"x","suggested_name":"x","bio":"x","tone_tags":"calm, curious, witty","voice":"x"}',+ );expect(v.tone_tags).toEqual(['calm', 'curious', 'witty']);});it('clamps fields to their max lengths', () => {- const v = parseVision(`{"appearance":"x","vibe":"x","persona":"x","suggested_name":"${'A'.repeat(100)}","bio":"${'B'.repeat(300)}","tone_tags":[],"voice":"${'C'.repeat(200)}"}`);+ const v = parseVision(+ `{"appearance":"x","vibe":"x","persona":"x","suggested_name":"${'A'.repeat(100)}","bio":"${'B'.repeat(300)}","tone_tags":[],"voice":"${'C'.repeat(200)}"}`,+ );expect(v.suggested_name.length).toBeLessThanOrEqual(60);expect(v.bio.length).toBeLessThanOrEqual(200);expect(v.voice.length).toBeLessThanOrEqual(120);@@ -402,8 +478,23 @@ describe('parseVision — identity parser', () => {// ── Unit: allowedImageHost ─────────────────────────────────────────────────────describe('allowedImageHost — SSRF allowlist', () => {- const allow = ['pub-abc.r2.dev', 'three.ws', 'ipfs.io', 'arweave.net', 'pump.mypinata.cloud', 'bafyb.ipfs.dweb.link', 'user.githubusercontent.com'];- const deny = ['localhost', '127.0.0.1', '169.254.169.254', 'evil.com', '10.0.0.1', 'metadata.google.internal'];+ const allow = [+ 'pub-abc.r2.dev',+ 'three.ws',+ 'ipfs.io',+ 'arweave.net',+ 'pump.mypinata.cloud',+ 'bafyb.ipfs.dweb.link',+ 'user.githubusercontent.com',+ ];+ const deny = [+ 'localhost',+ '127.0.0.1',+ '169.254.169.254',+ 'evil.com',+ '10.0.0.1',+ 'metadata.google.internal',+ ];for (const h of allow) it(`allows ${h}`, () => expect(allowedImageHost(h)).toBe(true));for (const h of deny) it(`rejects ${h}`, () => expect(allowedImageHost(h)).toBe(false));diff --git a/tests/api/security-csrf-gates.test.js b/tests/api/security-csrf-gates.test.jsindex c90bf55e7..61a8e7df9 100644--- a/tests/api/security-csrf-gates.test.js+++ b/tests/api/security-csrf-gates.test.js@@ -58,9 +58,20 @@ vi.mock('../../api/_lib/db.js', () => ({if (row && row.expires_at > Date.now()) return [{ user_id: row.user_id }];return [];}- // CSRF burn: `DELETE FROM csrf_tokens WHERE token = ${sent}`+ // CSRF consume: `DELETE FROM csrf_tokens WHERE token = ${sent} AND user_id = ${userId}+ // AND expires_at > now() RETURNING user_id` — atomic validate-and-burn; a+ // wrong-user token is left in place for its rightful owner.if (/from csrf_tokens/i.test(q) && /^\s*delete/i.test(q)) {- sqlState.csrfRows.delete(values[0]);+ const [submitted, uid] = values;+ const row = sqlState.csrfRows.get(submitted);+ if (+ row &&+ (uid === undefined || row.user_id === uid) &&+ row.expires_at > Date.now()+ ) {+ sqlState.csrfRows.delete(submitted);+ return [{ user_id: row.user_id }];+ }return [];}@@ -117,15 +128,11 @@ vi.mock('../../api/_lib/r2.js', () => ({}));// Import the handlers under test AFTER mocks are wired.-const { default: agentsRoot, handleGetOne, handleWallet } = await import(- '../../api/agents.js'-);+const { default: agentsRoot, handleGetOne, handleWallet } = await import('../../api/agents.js');const { default: keysHandler } = await import('../../api/keys/index.js');const { default: keyByIdHandler } = await import('../../api/keys/[id].js');const { default: adminUserHandler } = await import('../../api/admin/user/[id].js');-const { default: adminWithdrawalsHandler } = await import(- '../../api/admin/withdrawals/[id].js'-);+const { default: adminWithdrawalsHandler } = await import('../../api/admin/withdrawals/[id].js');const { default: adminRiderPassesHandler } = await import('../../api/admin/rider-passes.js');const { default: agentActionsHandler } = await import('../../api/agent-actions.js');const { default: agentMemoryHandler } = await import('../../api/agent-memory.js');@@ -135,9 +142,7 @@ const { default: dcaHandler } = await import('../../api/dca-strategies.js');// ── helpers ───────────────────────────────────────────────────────────────function makeReq({ method = 'GET', url = '/', headers = {}, body = null, query = {} } = {}) {- const stream = body- ? Readable.from([Buffer.from(JSON.stringify(body))])- : Readable.from([]);+ const stream = body ? Readable.from([Buffer.from(JSON.stringify(body))]) : Readable.from([]);stream.method = method;stream.url = url;stream.query = query;@@ -255,16 +260,35 @@ describe('POST /api/keys — CSRF gate', () => {it('burns the CSRF token (single-use)', async () => {authState.session = { id: 'user-3' };const token = issueCsrfFor('user-3');- sqlState.queue.push([{ id: 'k1', name: 'k', prefix: 'sk_live_x', scope: 'avatars:read', expires_at: null, created_at: '2024-01-01T00:00:00Z' }]);+ sqlState.queue.push([+ {+ id: 'k1',+ name: 'k',+ prefix: 'sk_live_x',+ scope: 'avatars:read',+ expires_at: null,+ created_at: '2024-01-01T00:00:00Z',+ },+ ]);- const req1 = makeReq({ method: 'POST', url: '/api/keys', headers: { 'x-csrf-token': token }, body: { name: 'k' } });+ const req1 = makeReq({+ method: 'POST',+ url: '/api/keys',+ headers: { 'x-csrf-token': token },+ body: { name: 'k' },+ });await keysHandler(req1, makeRes());// Give the fire-and-forget DELETE a tick to settle.await new Promise((r) => setImmediate(r));// Second use of the same token must be rejected.- const req2 = makeReq({ method: 'POST', url: '/api/keys', headers: { 'x-csrf-token': token }, body: { name: 'k' } });+ const req2 = makeReq({+ method: 'POST',+ url: '/api/keys',+ headers: { 'x-csrf-token': token },+ body: { name: 'k' },+ });const res2 = makeRes();await keysHandler(req2, res2);expect(res2.statusCode).toBe(403);@@ -368,21 +392,22 @@ describe('PATCH /api/admin/user/:id — CSRF gate', () => {});it('proceeds when a valid CSRF token is presented', async () => {+ const userId = '11111111-2222-4333-8444-555555555555';authState.session = { id: 'admin-1', is_admin: true };const token = issueCsrfFor('admin-1');sqlState.queue.push([- { id: 'u1', email: '[email protected]', plan: 'pro', is_admin: false, deleted_at: null },+ { id: userId, email: '[email protected]', plan: 'pro', is_admin: false, deleted_at: null },]);const req = makeReq({method: 'PATCH',- url: '/api/admin/user/u1',+ url: `/api/admin/user/${userId}`,headers: { 'x-csrf-token': token },body: { plan: 'pro' },});const res = makeRes();await adminUserHandler(req, res);expect(res.statusCode).toBe(200);- expect(parseRes(res).user.id).toBe('u1');+ expect(parseRes(res).user.id).toBe(userId);});});@@ -443,11 +468,25 @@ describe('POST/DELETE /api/admin/rider-passes — CSRF gate', () => {});});-// ── /api/agents (root) is unaffected ──────────────────────────────────────+// ── /api/agents (root) — creation is CSRF-gated like its sibling mutations ─-describe('POST /api/agents — creation path remains unchanged', () => {- it('POST without CSRF still works (root endpoint not gated)', async () => {+describe('POST /api/agents — CSRF gate on creation', () => {+ it('rejects session-authed POST without X-CSRF-Token (403 csrf_missing)', async () => {authState.session = { id: 'user-7' };+ const req = makeReq({+ method: 'POST',+ url: '/api/agents',+ body: { name: 'A' },+ });+ const res = makeRes();+ await agentsRoot(req, res);+ expect(res.statusCode).toBe(403);+ expect(parseRes(res).error).toBe('csrf_missing');+ });++ it('proceeds when a valid CSRF token is presented', async () => {+ authState.session = { id: 'user-7' };+ const token = issueCsrfFor('user-7');sqlState.queue.push([{id: 'a1',@@ -461,6 +500,7 @@ describe('POST /api/agents — creation path remains unchanged', () => {const req = makeReq({method: 'POST',url: '/api/agents',+ headers: { 'x-csrf-token': token },body: { name: 'A' },});const res = makeRes();@@ -492,7 +532,9 @@ describe('POST /api/agent-actions — CSRF gate', () => {authState.bearer = { userId: 'user-1', source: 'bearer' };// requireCsrf returns true for Bearer; handler then verifies ownership.sqlState.queue.push([{ user_id: 'user-1' }]); // agent ownership lookup- sqlState.queue.push([{ id: 1, agent_id: 'ag1', type: 'note', payload: {}, created_at: 'x' }]);+ sqlState.queue.push([+ { id: 1, agent_id: 'ag1', type: 'note', payload: {}, created_at: 'x' },+ ]);const req = makeReq({method: 'POST',url: '/api/agent-actions',diff --git a/tests/cosmetics-purchase.test.js b/tests/cosmetics-purchase.test.jsindex 985dc7c0a..538121b3c 100644--- a/tests/cosmetics-purchase.test.js+++ b/tests/cosmetics-purchase.test.js@@ -10,7 +10,7 @@// behaviour that must hold regardless: server-owned pricing, honest validation,// fail-closed ownership, and a correctly-priced 402.-import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';+import { describe, it, expect, beforeAll, beforeEach, afterEach, vi } from 'vitest';import {buildCatalog, getCosmetic, priceUsdcAtomicsOf, priceUsdcDisplayOf,} from '../api/_lib/cosmetics.js';@@ -146,6 +146,16 @@ async function call(query) {}describe('cosmetic-purchase endpoint boundary', () => {+ // Warm the heavy import chain (x402-paid-endpoint → @coinbase/x402 → Solana+ // toolchain) once, outside any single test's 45s budget. A cold import of+ // this handler takes 5–150s on loaded CI/Codespace hosts (see the note in+ // vitest.config.js); without this, the first test in the block flakes on+ // import latency alone. Env reads in the handler are lazy (api/_lib/env.js+ // getters), so importing before beforeEach sets X402_* vars is safe.+ beforeAll(async () => {+ await import('../api/x402/cosmetic-purchase.js');+ }, 240_000);+beforeEach(() => {// Minimal x402 config so the 402 challenge can build a Solana accept — the// Solana leg needs both a payout address and a co-signing fee payer.diff --git a/tests/pump-swap-quote.test.js b/tests/pump-swap-quote.test.jsindex bd7515aa1..a4a93a8c8 100644--- a/tests/pump-swap-quote.test.js+++ b/tests/pump-swap-quote.test.js@@ -61,7 +61,12 @@ describe('quoteSwap', () => {mockSwapSolanaState.mockResolvedValueOnce(fakeState());mockBuyQuoteInput.mockReturnValueOnce({ base: new BN(9_900), maxQuote: new BN(10_200) });- const result = await quoteSwap({ inputMint: WSOL, outputMint: TOKEN, amountIn: 10_000, slippageBps: 100 });+ const result = await quoteSwap({+ inputMint: WSOL,+ outputMint: TOKEN,+ amountIn: 10_000,+ slippageBps: 100,+ });expect(result.amountOut).toBe('9900');expect(typeof result.priceImpactBps).toBe('number');@@ -80,7 +85,8 @@ describe('quoteSwap', () => {expect(mockBuyQuoteInput).toHaveBeenCalledOnce();const call = mockBuyQuoteInput.mock.calls[0][0];expect(call.quote.toString()).toBe('10000');- expect(call.slippage).toBeCloseTo(0.01);+ // pump-swap-sdk slippage is a PERCENT (1 = 1%): 100 bps -> 1.+ expect(call.slippage).toBeCloseTo(1);expect(call.globalConfig).toEqual({ mock: true });});@@ -99,7 +105,12 @@ describe('quoteSwap', () => {mockSwapSolanaState.mockResolvedValueOnce(fakeState());mockSellBaseInput.mockReturnValueOnce({ uiQuote: new BN(9_800), minQuote: new BN(9_700) });- const result = await quoteSwap({ inputMint: TOKEN, outputMint: WSOL, amountIn: 10_000, slippageBps: 50 });+ const result = await quoteSwap({+ inputMint: TOKEN,+ outputMint: WSOL,+ amountIn: 10_000,+ slippageBps: 50,+ });expect(result.amountOut).toBe('9800');expect(result.priceImpactBps).toBeGreaterThanOrEqual(0);@@ -115,7 +126,8 @@ describe('quoteSwap', () => {expect(mockSellBaseInput).toHaveBeenCalledOnce();const call = mockSellBaseInput.mock.calls[0][0];expect(call.base.toString()).toBe('10000');- expect(call.slippage).toBeCloseTo(0.005);+ // 50 bps -> 0.5 percent (the SDK's unit).+ expect(call.slippage).toBeCloseTo(0.5);});it('sell direction: computes priceImpactBps correctly', async () => {@@ -137,7 +149,8 @@ describe('quoteSwap', () => {await quoteSwap({ inputMint: WSOL, outputMint: TOKEN, amountIn: 5_000 });const call = mockBuyQuoteInput.mock.calls[0][0];- expect(call.slippage).toBeCloseTo(0.01);+ // Default 100 bps -> 1 percent.+ expect(call.slippage).toBeCloseTo(1);});it('throws with clean message on invalid inputMint', async () => {diff --git a/tests/pump-trade-args.test.js b/tests/pump-trade-args.test.jsnew file mode 100644index 000000000..e8bdd263c--- /dev/null+++ b/tests/pump-trade-args.test.js@@ -0,0 +1,193 @@+// Unit tests for api/_lib/pump-trade-args.js plus offline conformance checks+// of the @pump-fun/pump-sdk v2 builders (as called by our buy/sell handlers)+// against the vendored IDL in docs/pumpfun-program/idl/pump.json.+//+// Everything here runs offline — no RPC, no mocks of the SDK itself.++import { describe, it, expect } from 'vitest';+import { readFileSync } from 'node:fs';+import { fileURLToPath } from 'node:url';+import BN from 'bn.js';+import { PublicKey, Keypair } from '@solana/web3.js';+import { NATIVE_MINT, TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID } from '@solana/spl-token';+import { PumpSdk } from '@pump-fun/pump-sdk';++import {+ slippagePercentFromBps,+ resolveTokenProgramForMintOwner,+ SPL_TOKEN_PROGRAM_ID,+ TOKEN_2022_PROGRAM_ID as T22_FROM_LIB,+} from '../api/_lib/pump-trade-args.js';++const idl = JSON.parse(+ readFileSync(+ fileURLToPath(new URL('../docs/pumpfun-program/idl/pump.json', import.meta.url)),+ 'utf8',+ ),+);++// ── slippagePercentFromBps ──────────────────────────────────────────────────++describe('slippagePercentFromBps', () => {+ it('converts basis points to the SDK percent unit (100 bps -> 1)', () => {+ expect(slippagePercentFromBps(100)).toBe(1);+ expect(slippagePercentFromBps(500)).toBe(5);+ expect(slippagePercentFromBps(50)).toBe(0.5);+ expect(slippagePercentFromBps(0)).toBe(0);+ });++ it('falls back to the default for non-finite input', () => {+ expect(slippagePercentFromBps(undefined)).toBe(1);+ expect(slippagePercentFromBps(NaN)).toBe(1);+ expect(slippagePercentFromBps('nope', { defaultBps: 500 })).toBe(5);+ });++ it('clamps to [0, 100] percent', () => {+ expect(slippagePercentFromBps(-5)).toBe(0);+ expect(slippagePercentFromBps(50_000)).toBe(100);+ });++ it('reproduces the user bps exactly through the pump-sdk pad formula', () => {+ // pump-sdk pads max cost via amount * floor(slippage * 10) / 1000.+ // With percent units, floor(pct * 10) / 1000 === bps / 10_000 for any+ // whole multiple of 10 bps — the property the trade handlers rely on.+ for (const bps of [10, 100, 250, 500, 1000, 5000]) {+ const pct = slippagePercentFromBps(bps);+ expect(Math.floor(pct * 10) / 1000).toBeCloseTo(bps / 10_000, 12);+ }+ });++ it('reproduces the user bps through the pump-swap-sdk factor formula', () => {+ // pump-swap-sdk computes maxQuote = quote * (1 + slippage / 100).+ for (const bps of [10, 100, 250, 500, 1000]) {+ const pct = slippagePercentFromBps(bps);+ expect(1 + pct / 100).toBeCloseTo(1 + bps / 10_000, 12);+ }+ });+});++// ── resolveTokenProgramForMintOwner ────────────────────────────────────────++describe('resolveTokenProgramForMintOwner', () => {+ it('maps the SPL Token owner to the SPL program id', () => {+ const p = resolveTokenProgramForMintOwner(SPL_TOKEN_PROGRAM_ID);+ expect(p.equals(TOKEN_PROGRAM_ID)).toBe(true);+ });++ it('maps the Token-2022 owner to the Token-2022 program id', () => {+ const p = resolveTokenProgramForMintOwner(T22_FROM_LIB);+ expect(p.equals(TOKEN_2022_PROGRAM_ID)).toBe(true);+ });++ it('accepts base58 strings', () => {+ const p = resolveTokenProgramForMintOwner('TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb');+ expect(p.equals(TOKEN_2022_PROGRAM_ID)).toBe(true);+ });++ it('throws a typed 422 for unknown owners (e.g. System Program)', () => {+ let err = null;+ try {+ resolveTokenProgramForMintOwner(PublicKey.default);+ } catch (e) {+ err = e;+ }+ expect(err).not.toBeNull();+ expect(err.status).toBe(422);+ expect(err.code).toBe('unsupported_token_program');+ });+});++// ── v2 builder conformance vs the vendored IDL ─────────────────────────────+//+// Our handlers call buyV2Instructions / sellV2Instructions, which bottom out+// in getBuyV2InstructionRaw / getSellV2InstructionRaw. Build both offline with+// synthetic keys and assert account count, order flags (writable/signer), the+// fixed program addresses, and the discriminator all match the vendored IDL.++const sdk = new PumpSdk();+const MINT = Keypair.generate().publicKey;+const USER = Keypair.generate().publicKey;+const CREATOR = Keypair.generate().publicKey;+const FEE_RECIPIENT = Keypair.generate().publicKey;+const BUYBACK_RECIPIENT = Keypair.generate().publicKey;++function idlIx(name) {+ const ix = idl.instructions.find((i) => i.name === name);+ expect(ix, `IDL instruction ${name}`).toBeTruthy();+ return ix;+}++function expectFlagsMatchIdl(built, idlDef) {+ expect(built.keys.length).toBe(idlDef.accounts.length);+ idlDef.accounts.forEach((acc, i) => {+ expect(built.keys[i].isWritable, `${idlDef.name} account[${i}] ${acc.name} writable`).toBe(+ !!acc.writable,+ );+ expect(built.keys[i].isSigner, `${idlDef.name} account[${i}] ${acc.name} signer`).toBe(+ !!acc.signer,+ );+ if (acc.address) {+ expect(+ built.keys[i].pubkey.toBase58(),+ `${idlDef.name} account[${i}] ${acc.name}`,+ ).toBe(acc.address);+ }+ });+}++describe('buy_v2 instruction (SDK getBuyV2InstructionRaw, as used by buy handlers)', () => {+ it('matches the vendored IDL account list, flags, and discriminator', async () => {+ const ix = await sdk.getBuyV2InstructionRaw({+ user: USER,+ mint: MINT,+ creator: CREATOR,+ amount: new BN(123_456),+ quoteAmount: new BN(1_000_000),+ feeRecipient: FEE_RECIPIENT,+ buybackFeeRecipient: BUYBACK_RECIPIENT,+ tokenProgram: TOKEN_2022_PROGRAM_ID,+ quoteMint: NATIVE_MINT,+ quoteTokenProgram: TOKEN_PROGRAM_ID,+ });+ const def = idlIx('buy_v2');+ expectFlagsMatchIdl(ix, def);+ expect([...ix.data.subarray(0, 8)]).toEqual(def.discriminator);+ // args: amount u64 LE, max_sol_cost u64 LE+ expect(new BN(ix.data.subarray(8, 16), 'le').toString()).toBe('123456');+ expect(new BN(ix.data.subarray(16, 24), 'le').toString()).toBe('1000000');+ // identity spot checks per BUY.md+ expect(ix.keys[1].pubkey.equals(MINT)).toBe(true); // base_mint+ expect(ix.keys[2].pubkey.equals(NATIVE_MINT)).toBe(true); // quote_mint+ expect(ix.keys[3].pubkey.equals(TOKEN_2022_PROGRAM_ID)).toBe(true); // base_token_program+ expect(ix.keys[4].pubkey.equals(TOKEN_PROGRAM_ID)).toBe(true); // quote_token_program+ expect(ix.keys[13].pubkey.equals(USER)).toBe(true); // user (sole signer)+ const signers = ix.keys.map((k, i) => (k.isSigner ? i : -1)).filter((i) => i >= 0);+ expect(signers).toEqual([13]);+ });+});++describe('sell_v2 instruction (SDK getSellV2InstructionRaw, as used by sell handlers)', () => {+ it('matches the vendored IDL account list, flags, and discriminator', async () => {+ const ix = await sdk.getSellV2InstructionRaw({+ user: USER,+ mint: MINT,+ creator: CREATOR,+ amount: new BN(42),+ quoteAmount: new BN(7),+ feeRecipient: FEE_RECIPIENT,+ buybackFeeRecipient: BUYBACK_RECIPIENT,+ tokenProgram: TOKEN_2022_PROGRAM_ID,+ quoteMint: NATIVE_MINT,+ quoteTokenProgram: TOKEN_PROGRAM_ID,+ });+ const def = idlIx('sell_v2');+ expectFlagsMatchIdl(ix, def);+ expect([...ix.data.subarray(0, 8)]).toEqual(def.discriminator);+ expect(new BN(ix.data.subarray(8, 16), 'le').toString()).toBe('42');+ expect(new BN(ix.data.subarray(16, 24), 'le').toString()).toBe('7');+ expect(ix.keys[1].pubkey.equals(MINT)).toBe(true);+ expect(ix.keys[2].pubkey.equals(NATIVE_MINT)).toBe(true);+ const signers = ix.keys.map((k, i) => (k.isSigner ? i : -1)).filter((i) => i >= 0);+ expect(signers).toEqual([13]);+ });+});diff --git a/vercel.json b/vercel.jsonindex 5c2946589..9b7b20695 100644--- a/vercel.json+++ b/vercel.json@@ -75,14 +75,14 @@"strict-transport-security": "max-age=63072000; includeSubDomains; preload","x-content-type-options": "nosniff","referrer-policy": "strict-origin-when-cross-origin",- "content-security-policy": "base-uri 'self'; object-src 'none'"+ "content-security-policy": "base-uri 'self'; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://unpkg.com https://esm.sh https://ajax.googleapis.com https://s3.tradingview.com https://platform.twitter.com https://3d-agent.vercel.app https://three.ws https://3d.irish; worker-src 'self' blob:; frame-ancestors *"},"continue": true},{"src": "/(login|register|forgot-password|reset-password|account|settings|wallet|pay|paywall|vanity-wallet|eth-vanity|evm-wallet|dashboard|dashboard-next|dashboard-classic)(/.*)?$","headers": {- "content-security-policy": "frame-ancestors 'self'; base-uri 'self'; object-src 'none'",+ "content-security-policy": "frame-ancestors 'self'; base-uri 'self'; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://unpkg.com https://esm.sh https://ajax.googleapis.com https://s3.tradingview.com https://platform.twitter.com https://3d-agent.vercel.app https://three.ws https://3d.irish; worker-src 'self' blob:","x-frame-options": "SAMEORIGIN"},"continue": true@@ -259,6 +259,22 @@"src": "/changelog/","dest": "/changelog/index.html"},+ {+ "src": "/changelog\\.json",+ "headers": {+ "content-type": "application/json; charset=utf-8",+ "cache-control": "public, max-age=600"+ },+ "dest": "/changelog.json"+ },+ {+ "src": "/changelog\\.xml",+ "headers": {+ "content-type": "application/rss+xml; charset=utf-8",+ "cache-control": "public, max-age=600"+ },+ "dest": "/changelog.xml"+ },{"src": "/\\.well-known/chat-plugin\\.json","dest": "/api/wk?name=chat-plugin"diff --git a/vite.config.js b/vite.config.jsindex fbd6a9919..af60ff022 100644--- a/vite.config.js+++ b/vite.config.js@@ -953,6 +953,9 @@ const appConfig = {// /avatars/:id → avatar studio page (mirrors vercel.json rewrite)else if (!filePath && /^\/avatars\/[^/.]+\/?$/.test(path))filePath = resolve(root, 'pages/avatar-page.html');+ // /changelog → public changelog page (mirrors vercel.json rewrite)+ else if (!filePath && /^\/changelog\/?$/.test(path))+ filePath = resolve(root, 'public/changelog/index.html');// /town → communities (alias; mirrors vercel.json rewrite)else if (!filePath && /^\/town\/?$/.test(path))filePath = resolve(root, 'pages/communities.html');diff --git a/workers/pump-fun-mcp/worker.js b/workers/pump-fun-mcp/worker.jsindex 11263a621..56d80f3cd 100644--- a/workers/pump-fun-mcp/worker.js+++ b/workers/pump-fun-mcp/worker.js@@ -314,7 +314,10 @@ export default {const name = params?.name;const args = params?.arguments || {};const handlers = buildHandlers(env);- const handler = handlers[name];+ // Own-property lookup only — "__proto__"/"constructor" must not resolve+ // an inherited member and pass the !handler guard.+ const handler =+ typeof name === 'string' && Object.hasOwn(handlers, name) ? handlers[name] : null;if (!handler) {return respond(rpcEnvelope(id, null, { code: -32601, message: `unknown tool: ${name}` }));}