Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(news): add daily news digest surface plus platform docs and abilities refresh
nirholas2056754a264c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cade73677..b2388862b 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,12 +8,17 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Crypto News** (`/markets/news`) — Live crypto news aggregated natively from 38 publisher feeds — filter by category (Bitcoin, DeFi, regulation, and more), search headlines, and open any story in a rich reader with summary, key points, sentiment, and related coverage.- **Crypto News Archive** (`/markets/archive`) — The largest open crypto-news archive: 660,000+ articles from September 2017 to today, refreshed hourly from the live feed, in English and Chinese — searchable by keyword, ticker, source, sentiment, date, and language.+- **Crypto News Digest** (`/markets/digest`) — The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.- **Crypto News Reader** (`/markets/news/article`) — Rich article reader for crypto news — full story extraction with AI summary, key points, sentiment, detected tickers, and related coverage from across the industry.+- **Docs · What Agents Can Do — The Complete Dossier** (`/docs/agent-abilities`) — The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability wallet, worlds, and the developer platform — 15 chapters plus a per-ability deep dive for the entire Agent Wallet.- **Markets Hub** (`/markets`) — The three.ws markets hub — live global stats, the top 100 coins, breaking crypto news from 38 publisher feeds, a 662k-article news archive, and hero links to the full markets toolset.- **Auto-rigging works again — and the Agent Identity Studio demos are real** — Rigging any generated model into an animation-ready character had been failing since the cloud migration: the rig request was sent to a service that doesn't do rigging, and the GPU rigger itself crashed on a graphics call our cloud GPUs don't support. Both are fixed — rig requests now reach the real UniRig worker, which renders its voxel pass in software instead. Proof: all four Agent Identity Studio demo characters (LedgerLynx, MuseWeaver, Momentum-9, and the three.ws studio's own) were generated, rigged with full skeletons, and photographed in posed renders through the live pipeline — see them on the showcase. (`/agent-identities`) `[fix, feature]`- **Crypto news is live: a real-time feed from 38 publishers, a rich article reader, and a 662,047-article archive back to 2017** — Markets grew a full news wing. /markets/news streams live headlines aggregated directly from 38 publisher feeds — filter by category (Bitcoin, DeFi, regulation, and more), search, and open any story in a reader that extracts the full text with a summary, key points, sentiment, and related coverage. Behind it sits the largest open crypto-news archive anywhere: 662,047 articles from September 2017 to today in English and Chinese, searchable by keyword, ticker, source, sentiment, date, and language at /markets/archive. A new /markets hub ties the whole suite together — live global stats, the top 100 coins, breaking news, and every market tool as its own card. (`/markets`) `[feature]`+- **Friends now see you online — and can message you — while you're in /play** — Your account's friends list, presence, and DMs (already live on /walk) now work inside /play's coin worlds too: a Friends button on the HUD (or press J) opens a drawer showing who's online and where, with live direct messages that arrive instantly whether or not the drawer is open. Previously /play never told the server who you were signed in as, so friends saw you as offline no matter how long you played, and any message sent your way was silently lost. (`/play`) `[feature, fix]`- **The liquidations pulse on /coins is live** — The long/short liquidation strip on the markets page had been showing its offline state since launch — the collector that listens to Binance, Bybit, and OKX futures streams needs to run around the clock, which the old serverless setup couldn't do. It now runs as its own always-on service, so the dominant-side badge, the 1-hour long-vs-short bars, and the biggest recent liquidations fill in with real exchange data. (`/coins`) `[feature, infra]`- **The news archive now updates itself every hour — and the live feed has an RSS feed** — The 660,000-article news archive is no longer frozen in time: an hourly archiver now appends every new story from the live feed into the corpus, complete with the market snapshot at capture time (BTC/ETH/SOL price, market cap, Fear & Greed), so /markets/archive stays current forever. And if you'd rather read three.ws crypto news in your own reader, the feed is now available as standard RSS at /api/news/rss — subscribe to everything or just one category. (`/markets/archive`) `[feature, infra]`+- **The Oracle can see the news again** — The Oracle's narrative pillar — one of the four signals behind every 0-100 conviction score — reads live headlines to tell whether a coin is riding a real story. It had been reading them from an outside news service that went offline, and because the code was built to fail quietly rather than break, it simply scored with no headlines at all. Conviction scores now draw on three.ws's own news engine, which reads 38 publisher feeds directly, so the narrative read is live again and no longer depends on anyone else staying up. The pump.fun news-meme detector and the sniper's coin classifier read from the same engine. (`/oracle`) `[fix, improvement]`+- **What can an agent actually do? The complete abilities dossier is live** — Every ability a three.ws agent has, mapped in one place: /docs/agent-abilities. Fifteen chapters cover the agent end to end — the 3D body and how it moves, the studios where agents are made, memory and autonomy, conversation, on-chain identity, skills, screens, the agent economy, markets intelligence, live worlds, embeds and mobile, and the developer platform — plus a dedicated deep-dive page for each of the Agent Wallet's 23 abilities, from Balance and Deposit through Autopilot, Intents, Proof of Custody, and Self-defense. Everything was researched from the shipped code, so every claim on those pages describes something you can use today. (`/docs/agent-abilities`) `[docs, feature]`## 2026-07-09diff --git a/README.md b/README.mdindex 1c38a9379..6d8136ca2 100644--- a/README.md+++ b/README.md@@ -112,9 +112,9 @@ At its core, it does five things:5. **Embed** — distributes the agent as an `<agent-3d>` web component that anyone can drop into a page, or as one of five purpose-built widget types (turntable, animation gallery, talking agent, passport card, hotspot tour) with Open Graph and oEmbed support built in.-The backend is a set of Vercel serverless functions backed by Neon Postgres for metadata, Cloudflare R2 for model storage, and Upstash Redis for rate limiting. It exposes a full OAuth 2.1 authorization server and an MCP (Model Context Protocol) endpoint so external AI systems can drive avatars programmatically.+The backend is a set of serverless-style handlers (in `api/`) served in production by a single Google Cloud Run container ([server/index.mjs](server/index.mjs)), backed by Neon Postgres for metadata, Cloudflare R2 for model storage, and Upstash Redis for rate limiting. It exposes a full OAuth 2.1 authorization server and an MCP (Model Context Protocol) endpoint so external AI systems can drive avatars programmatically.-three.ws is production-ready and serves [three.ws](https://three.ws) live. The entire stack — viewer, agent runtime, contracts, backend, and web component — is open source under Apache 2.0.+three.ws is production-ready and serves [three.ws](https://three.ws) live on Google Cloud Run. The entire stack — viewer, agent runtime, contracts, backend, and web component — is open source under Apache 2.0.---@@ -461,7 +461,7 @@ three.ws is available on major cloud marketplaces and open to infrastructure par| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- || **AWS** | **AWS Partner** (APN Software Path). AWS Marketplace SaaS listing in review — see [docs/aws-marketplace.md](docs/aws-marketplace.md) and the public partner page at [three.ws/aws](https://three.ws/aws). Production runs on AWS `us-east-1`, registered in AWS MyApplications under account `155407237916`. || **Alibaba Cloud** | Live: [product listing →](https://marketplace.alibabacloud.com/products/56724001/sgcmfw00036800.html) · [storefront →](https://marketplace.alibabacloud.com/store/3247293.html) |-| **Google Cloud** | three.ws runs on WebGL, Vercel edge, EVM (15+ chains), and Solana (Metaplex Core) — a natural fit for GCP's AI infrastructure, Vertex AI, and global CDN. Open to co-listing, credits, and joint GTM. |+| **Google Cloud** | Production runs on **Google Cloud Run** (`three-ws-api`, `us-central1`) fronted by a global HTTPS load balancer + Cloud CDN, with the ~80 scheduled jobs on Cloud Scheduler and GPU inference workers on Cloud Run — a natural fit for GCP's AI infrastructure and Vertex AI. Open to co-listing, credits, and joint GTM. |## Ecosystem Directories@@ -587,9 +587,9 @@ Every avatar the site renders is a **GLB** (binary glTF 2.0 — the body, rig, a- **Chat**: The chat interface is a standalone Svelte application located in the `chat/` directory.- **3D Rendering**: three.js (r184) is used for WebGL 2.0 rendering.-**Backend (Vercel Serverless)**+**Backend (Google Cloud Run)**-- **Runtime**: Node.js+- **Runtime**: Node.js — serverless-style handlers in `api/` served by one Express container ([server/index.mjs](server/index.mjs)) on Cloud Run (`three-ws-api`, `us-central1`).- **Database**: Neon Postgres (serverless)- **Storage**: Cloudflare R2 for model and avatar storage.- **Rate Limiting**: Upstash Redis.@@ -939,7 +939,7 @@ For sandboxed iframes use the widget embed path instead — it runs in its own b## Project Structure- `src/`: The core frontend JavaScript for the main application, including the 3D viewer, agent protocol, custom element, and feature modules (`club-*.js`, `walk*.js`, `pose-*.js`, `voice/`, `selfie-*.js`). Social/gameplay surfaces live in `game/` (Coin Communities: `coincommunities*`, `spin-wheel-ui`, `cosmetics-visual`, `avatar-rig`), `city/` (the `/city` world), `social/` (sentiment, X-post impact), `community/` (coin lobby/town), plus `friends.js`, `communities.js`, `marketplace*.js`, and `token-pay.js`.-- `api/`: Vercel serverless functions that form the backend API. Subdirectories include `x402/`, `a2a/`, `club/`, `pump/`, `persona/`, `news/`, `admin/`, `agents/`, `auth/`, `oauth/`, `cron/`, plus the social/game surfaces `play/`, `token/`, `three-token/`, `friends/`, `social/`, `community/`, `marketplace/`, and `mocap/`.+- `api/`: Serverless-style handlers that form the backend API, served in production by the Cloud Run container ([server/index.mjs](server/index.mjs)) with `vercel.json`-parity routing. Subdirectories include `x402/`, `a2a/`, `club/`, `pump/`, `persona/`, `news/`, `admin/`, `agents/`, `auth/`, `oauth/`, `cron/`, plus the social/game surfaces `play/`, `token/`, `three-token/`, `friends/`, `social/`, `community/`, `marketplace/`, and `mocap/`.- `public/`: Static assets and various sub-applications (`club/`, `seeker/`, `news/`, `persona/`, `vanity-wallet.html`, `pumpfun.html`).- `chat/`: A standalone Svelte application for the chat interface.- `character-studio/`: A sub-project for in-browser character creation; also serves the rebranded **Avatar Studio** marketplace.@@ -2039,9 +2039,9 @@ The full OpenAPI 3.1 spec is available at `/openapi.json`. The key API surface i### Cron Jobs-Scheduled via `vercel.json`, these run automatically in production. All cron endpoints are fail-closed — a missing auth token aborts with an error rather than silently skipping (see [Security Hardening](#security-hardening)).+Cron schedules are declared in `vercel.json` (still the live cron/route config the server reads) and executed in production by **Google Cloud Scheduler**, which calls each endpoint on its schedule. All cron endpoints are fail-closed — a missing auth token aborts with an error rather than silently skipping (see [Security Hardening](#security-hardening)).-All 22 crons in `vercel.json` are routed through a single dynamic handler at [`api/cron/[name].js`](api/cron/[name].js); the `name` segment selects the handler function. Schedules below match `vercel.json` verbatim.+The ~80 crons in `vercel.json` are routed through a single dynamic handler at [`api/cron/[name].js`](api/cron/[name].js); the `name` segment selects the handler function. Scheduler jobs are provisioned from the `vercel.json` cron list via [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs); the schedules below match `vercel.json` verbatim.| Schedule | Endpoint | Purpose || -------------------- | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |@@ -2532,19 +2532,18 @@ npm run claude -- <command>| `deploy-agent <name>` | Packages an agent into a distributable zip || `help` | List all commands |-### Vercel Deployment+### Production Deployment (Google Cloud Run)-The project is built for Vercel. Deployment is one command:+Production runs on **Google Cloud Run** (`three-ws-api`, region `us-central1`): one Express container ([server/index.mjs](server/index.mjs)) serves the static frontend, the `vercel.json` route table, and every `api/**` handler, fronted by a global HTTPS load balancer + Cloud CDN. Deployment is two steps — build the frontend, then submit the container build:```bash-npm run deploy+npm run build # frontend build to dist/ (only when frontend changed)+npm run deploy:gcp # check:dist + db:check, gcloud builds submit, purge CDN```-This runs `build:all` then `vercel --prod`. Routing, rewrites, cache headers, and cron schedules are defined in `vercel.json`.+`npm run deploy:gcp` runs `gcloud builds submit --config server/cloudbuild.yaml`. Routing, cache headers, and cron schedules are defined in `vercel.json`, which the server reads at runtime. The ~80 scheduled jobs run on **Cloud Scheduler** (provisioned by [scripts/create-gcp-scheduler.mjs](scripts/create-gcp-scheduler.mjs)); the GPU inference workers run as their own Cloud Run services. Full ops runbook (load balancer, DNS/TLS, env, rollback, recovery): **[docs/ops/gcp-production.md](docs/ops/gcp-production.md)**.-For preview deployments, push a branch — Vercel auto-deploys it with a preview URL.--**Environment variables** must be set in the Vercel dashboard (not in `.env` files). See [Environment Variables](#environment-variables) for the full list.+**Environment variables** live on the Cloud Run service, not in `.env` files — inspect or update them with `gcloud run services describe/update three-ws-api --region us-central1`. See [Environment Variables](#environment-variables) for the full list.### Self-Hostingdiff --git a/STRUCTURE.md b/STRUCTURE.mdindex 55b411dac..17ec19c9a 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -44,6 +44,7 @@ bottom.| `/play` character & avatar customization (avatar creator, selfie→3D, wardrobe boutique) | Lobby creator flow [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) `_openCreate()`, selfie SDK wrapper [src/avatar-creator.js](src/avatar-creator.js), shop [src/game/cosmetics-shop.js](src/game/cosmetics-shop.js), wardrobe [src/game/cosmetics-wardrobe.js](src/game/cosmetics-wardrobe.js), boutique NPCs [src/game/npc/npc-catalog.js](src/game/npc/npc-catalog.js) (`npc-tailor`, `npc-fitting-room`), boutique spawn points [src/game/world-zones.js](src/game/world-zones.js) (`type: 'boutique'`) | In-repo | W03 of the World Online program ([prompts/agent-briefs/W-world-online/W00-program-overview.md](prompts/agent-briefs/W-world-online/W00-program-overview.md)). Before dropping into `/play`, design an avatar from scratch or a selfie (real Avaturn SDK), upload a `.glb`, or sculpt in the full Avatar Studio — no sign-in required. Once in the world, the cosmetics shop/wardrobe (real x402-settled catalog, server-persisted equip) now has a physical home: walk up to Roux · Tailor to browse/buy, or Nell's Fitting Room to equip anything you own. Doc: [docs/character-studio.md](docs/character-studio.md#character-customization-in-play-world-online). || `/play` combat & weapons (server-authoritative, danger zones, wanted, tombstones) | Client: [src/game/combat-system.js](src/game/combat-system.js) `→ /play` (vitals HUD wiring, danger-zone ground, tombstone loot, hit feedback, the `window.twsCombat` bridge into W08's `MobSystem`), HUD [src/game/hud/world-hud.js](src/game/hud/world-hud.js). Server: [multiplayer/src/combat-handlers.js](multiplayer/src/combat-handlers.js) (mob AI, attack/loot intents, death + respawn), pure math [multiplayer/src/combat.js](multiplayer/src/combat.js), weapon/mob/loot tables [multiplayer/src/items.js](multiplayer/src/items.js), zone geometry [multiplayer/src/world-features.js](multiplayer/src/world-features.js), handlers wired in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W07 of the World Online program ([prompts/agent-briefs/W-world-online/W00-program-overview.md](prompts/agent-briefs/W-world-online/W00-program-overview.md)). Equip a sword/bat/pistol/bow from the hotbar and press `X` (or tap the touch Attack button) to fight — but only inside one of three named danger zones (Southern Wilds, Northern Wilds, Eastern Marches); town stays lawful by construction. PvE mobs chase and swing back through the same server-side damage path a player's attack uses; a kill (mob or PvP) spills a lootable tombstone, PvP raises the attacker's wanted/heat stars (visible on `WorldHud` and a downed peer's nameplate), and death drops carried cash/pack before an automatic respawn in town. || `/play` NPCs & world life (traffic, vendors, quest-givers, mobs) | Manager [src/game/npc/world-life.js](src/game/npc/world-life.js), nav graph [src/game/npc/nav-graph.js](src/game/npc/nav-graph.js), ambient crowd/traffic [src/game/npc/ambient-life.js](src/game/npc/ambient-life.js), quest-giver NPCs [src/game/npc/quest-npcs.js](src/game/npc/quest-npcs.js), quest-zone waypoints [src/game/npc/quest-markers.js](src/game/npc/quest-markers.js), Jobs Board UI [src/game/quests-ui.js](src/game/quests-ui.js), W07-gated mobs [src/game/npc/mobs.js](src/game/npc/mobs.js). Server: quest engine [multiplayer/src/quests.js](multiplayer/src/quests.js), quest zones [multiplayer/src/quest-zones.js](multiplayer/src/quest-zones.js), handlers in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W08 of the World Online program ([prompts/agent-briefs/W-world-online/W00-program-overview.md](prompts/agent-briefs/W-world-online/W00-program-overview.md)). A deterministic nav graph drives client-side ambient pedestrians + ring-road traffic that read identically for every player without a single packet — real gameplay stays server-authoritative. Five quest-giver NPCs (Dockmaster Reyes, Warden Okoro, Cook Mara, Foreman Dell, The Fixer) front the jobs board the quest engine (W05) already ran server-side but no client ever reached; pressing E opens the real board, accepting a job drops a waypoint at its objective (goto zones auto-complete by walking there, interact zones get their own "press E"), and finishing pays real cash server-side. Hostile mobs are live: W07's `CombatSystem` ([src/game/combat-system.js](src/game/combat-system.js)) installs the `window.twsCombat` contract this module's mobs were built against, so `MobSystem` renders real server-authoritative PvE hostiles with zero changes here. |+| `/play` friends & presence (drawer, cross-world DMs) | Client: [src/game/friends-panel.js](src/game/friends-panel.js) (shared with `/walk`), mounted in [src/game/coincommunities.js](src/game/coincommunities.js) `_openFriends()`/`_closeFriends()`, HUD button + unread badge in [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js), account-level state/polling in [src/friends.js](src/friends.js). Server: signed ticket verify + `socialHub` registration in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js), hub in [multiplayer/src/social-hub.js](multiplayer/src/social-hub.js) | In-repo | W09 of the World Online program ([prompts/agent-briefs/W-world-online/W00-program-overview.md](prompts/agent-briefs/W-world-online/W00-program-overview.md)). Press `J` or the HUD `Friends` button to open a right-docked drawer showing your account's friend graph — live online/offline presence per coin world, requests, and DM threads — the same graph and threads `/walk` and the standalone `/friends` page already share. `community-net.js` now carries a signed presence ticket into every `walk_world` join and forwards the server's `social` push onto its own event bus, which is what actually makes a `/play` player visible to friends and able to receive a live DM — previously `/play` joined anonymously to the social graph even when signed in, so every player showed offline and DMs were dropped. Tests: [tests/play-friends-presence.test.js](tests/play-friends-presence.test.js). || Premium vanity inventory (sell pre-ground addresses) | [public/vanity/premium/](public/vanity/premium/index.html) `→ /vanity/premium`, batch grinder [workers/vanity-grinder/](workers/vanity-grinder), store [api/_lib/vanity-inventory-store.js](api/_lib/vanity-inventory-store.js), sell [api/x402/vanity-premium.js](api/x402/vanity-premium.js), replenish [api/cron/vanity-inventory-replenish.js](api/cron/vanity-inventory-replenish.js) | In-repo · GCP spot CPU | Long (4–5+ char) brandable Solana addresses ground ahead of time on cheap spot CPU, sealed at rest (AES-256-GCM or GCP-KMS envelope, [api/_lib/vanity-vault.js](api/_lib/vanity-vault.js)), and sold from stock via x402 — priced by rarity ($1–$50) on `vanity-premium`, or by fixed 4–5 char tiers ($2.50/$10) directly through [`/api/x402/vanity`](docs/vanity.md#tier-1--live-grinder) (instant delivery, `source:"inventory"`) and the [pump-launch vanity upsell](docs/pump-launcher.md) — delivered exactly once, ciphertext destroyed on delivery. An hourly cron watches stock and fires a fresh grind batch (Cloud Run Job) when low. Free `vanity_premium` MCP browse tool. Runbook: [docs/gcp-credits.md](docs/gcp-credits.md) || Embed examples | [examples/](examples) | In-repo | `embed-test.html`, `web-component.html`, `two-agents.html`, `minimal.html`, [agent-native-3d/](examples/agent-native-3d) (below) || Agent-native 3D + embeddable distribution | MCP tool [api/_mcp/tools/agents.js](api/_mcp/tools/agents.js) (`attach_avatar_to_agent`); shared oEmbed provider [api/agent-oembed.js](api/agent-oembed.js) `→ /api/oembed` + builder [api/_lib/embed.js](api/_lib/embed.js) (`forgeEmbedTarget`, shared by `get_embed_code` in [api/_mcp/tools/embed.js](api/_mcp/tools/embed.js)); Forge share page oEmbed discovery [api/forge-share.js](api/forge-share.js) `→ /forge/share/:id`; distribution snippet builders [src/forge-embed-snippets.js](src/forge-embed-snippets.js) + panel [src/forge-embed-panel.js](src/forge-embed-panel.js); autonomous demo [examples/agent-native-3d/](examples/agent-native-3d) | In-repo | Closes the loop: create → own → discover/remix → **use everywhere**. `attach_avatar_to_agent` gives a registered agent identity a persistent body (chains into `register_agent` for on-chain identity + `anchor_provenance` for a signed authenticity credential). Any Forge creation now unfurls via real oEmbed (paste `/forge/share/:id` into Notion/Discord/Slack) with the same `type:rich` iframe payload `get_embed_code` returns via MCP. The Forge "Embed this model" panel hands out five real distribution flavours from one GLB — iframe, `<model-viewer>`, `<agent-3d>`, a `@three-ws/page-agent` talking guide, and a `@three-ws/walk` companion — all built from one shared, pure snippet module so every surface stays byte-identical. `examples/agent-native-3d/run.mjs` drives the full agent-native chain live against `/api/mcp-studio` (mesh_forge → rig_mesh → create_agent_persona → persona_say → get_agent_persona → every distribution snippet) with zero mocks and a documented, logged fallback if the shared free-tier generation lane is rate-limited at run time. Spec: [specs/EMBED_SPEC.md](specs/EMBED_SPEC.md#share-routes-on-chain-agents). Docs: [docs/mcp.md#attach_avatar_to_agent](docs/mcp.md#attach_avatar_to_agent). Roadmap prompt 10 (closes the roadmap campaign). |diff --git a/api/_lib/forge-image-validate.js b/api/_lib/forge-image-validate.jsindex b54a5f6d8..3bcbdaf30 100644--- a/api/_lib/forge-image-validate.js+++ b/api/_lib/forge-image-validate.js@@ -30,7 +30,7 @@ const PROMPT ='(text_screenshot), a busy scene with no single dominant subject (multiple_subjects), ' +'no recognizable object at all (no_clear_subject), too dark/blurry to make out ' +'(too_dark_or_blurry), or an abstract pattern/chart/diagram (abstract_or_diagram). ' +- 'When in doubt, mark usable=true — a borderline photo still reconstructs.';+ 'When in doubt, mark usable=true. A borderline photo still reconstructs.';// Designed, actionable copy per failure reason. Each tells the user what is wrong// AND how to fix it — never a bare "invalid image".diff --git a/api/_lib/news.js b/api/_lib/news.jsindex 21ba4a13a..b906c9f05 100644--- a/api/_lib/news.js+++ b/api/_lib/news.js@@ -1,9 +1,9 @@// Native crypto-news aggregation — the engine behind /api/news/feed, the-// related-news rail on /coin/:id, and the /markets surfaces. Ported from the-// cryptocurrency.cv aggregator (same team) after its Vercel deployment was-// retired; three.ws now fetches the source RSS/Atom feeds directly.+// related-news rail on /coin/:id, the Oracle's narrative pillar, pump-intel's+// news-meme matcher, and the /markets surfaces. three.ws fetches the source+// RSS/Atom feeds directly; no third-party news API sits in this path.//-// Design, at ~230 live publisher feeds:+// Design, at 38 live publisher feeds across 14 categories://// * Per-source in-memory cache (5 min TTL) with serve-stale-on-error, so one// slow or dead feed never blanks the page and repeat requests inside the@@ -29,7 +29,8 @@ import { NEWS_SOURCES, sourcesForCategory, sourcePriority } from './news-sourcesconst FEED_TIMEOUT_MS = 7000;const FRESH_MS = 300_000; // refetch a source after 5 minconst STALE_OK_MS = 24 * 3600_000; // serve a failed source's last-good copy up to 24h-const MAX_BACKOFF_MS = 6 * 3600_000; // a persistently dead feed retries at most every 6h+const MAX_BACKOFF_MS = 6 * 3600_000; // a persistently dead feed (404/410) retries at most every 6h+const SOFT_BACKOFF_MS = 30 * 60_000; // a rate-limited or 5xx feed retries at most every 30 minconst REFRESH_DEADLINE_MS = 2500; // how long a request will wait on cold sourcesconst GLOBAL_CONCURRENCY = 16; // outbound feed fetches in flight, all domainsconst DOMAIN_CONCURRENCY = 3; // outbound feed fetches in flight, per domain@@ -65,6 +66,14 @@ export function articleId(link) {return createHash('sha256').update(String(link)).digest('hex').slice(0, 16);}+// Models on the free tiers often wrap JSON in a ```json fence despite being+// told not to. Unwrap before JSON.parse rather than failing the completion.+export function stripJsonFence(text) {+ const t = String(text || '').trim();+ const fenced = t.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/);+ return (fenced ? fenced[1] : t).trim();+}+// ── Sentiment (lexicon) ──────────────────────────────────────────────────────// Fast keyword sentiment matching the archive's { score, label, confidence }// shape. Used for live articles, which arrive without the offline enrichment@@ -210,6 +219,49 @@ export function parseFeed(xml, sourceKey) {.filter(Boolean);}+// ── Non-RSS sources ──────────────────────────────────────────────────────────+// A source with `kind: 'json'` is shaped by an adapter here instead of by+// parseFeed. The bar for adding one is high: free, keyless, and reachable from+// a datacenter IP (which is what Cloud Run is). Three of cryptocurrency.cv's+// four JSON sources no longer clear it and are deliberately absent —+// CryptoCompare now answers 401, DeFiLlama's /raises answers 402, and Reddit+// answers 403 to cloud egress. Shipping them would mean four sources that fail+// forever.++const JSON_ADAPTERS = {+ // Exchange listing/delisting notices. Market-moving, and published to no RSS+ // feed anywhere. The list endpoint returns title + code + releaseDate only;+ // the canonical permalink is /support/announcement/detail/<code>.+ binance_announcements(data, key) {+ const src = NEWS_SOURCES[key];+ const articles = data?.data?.catalogs?.[0]?.articles;+ if (!Array.isArray(articles)) throw new Error(`${key} unexpected payload`);+ return articles+ .map((a) => {+ const title = stripHtml(a?.title);+ if (!title || !a?.code) return null;+ const link = `https://www.binance.com/en/support/announcement/detail/${a.code}`;+ const iso = Number.isFinite(a.releaseDate) ? new Date(a.releaseDate).toISOString() : null;+ return {+ id: articleId(link),+ title,+ link,+ description: null,+ image: null,+ author: null,+ source: src.name,+ source_key: key,+ category: src.category,+ pub_date: iso,+ tickers: extractTickers(title),+ sentiment: lexiconSentiment(title),+ content_text: null,+ };+ })+ .filter(Boolean);+ },+};+// ── Concurrency control ──────────────────────────────────────────────────────// Feeds cluster on shared hosts (medium.com, substack.com, mirror.xyz each// carry many). Firing every feed at once earns a 429 from exactly those hosts,@@ -264,9 +316,12 @@ async function fetchSource(key) {await gate.acquire();await globalGate.acquire();try {+ const json = src.kind === 'json';const resp = await fetch(src.url, {headers: {- accept: 'application/rss+xml, application/atom+xml, application/xml, text/xml;q=0.9, */*;q=0.8',+ accept: json+ ? 'application/json'+ : 'application/rss+xml, application/atom+xml, application/xml, text/xml;q=0.9, */*;q=0.8',// A polite, identifying bot UA gets through more publisher WAFs than a// spoofed browser UA does — a fake Chrome string without the matching// TLS/header fingerprint reads as a scraper and earns a 403.@@ -276,7 +331,12 @@ async function fetchSource(key) {signal: AbortSignal.timeout(FEED_TIMEOUT_MS),redirect: 'follow',});- if (!resp.ok) throw new Error(`${key} ${resp.status}`);+ if (!resp.ok) {+ const err = new Error(`${key} ${resp.status}`);+ err.status = resp.status;+ throw err;+ }+ if (json) return JSON_ADAPTERS[key](await resp.json(), key);return parseFeed(await resp.text(), key);} finally {globalGate.release();@@ -285,8 +345,13 @@ async function fetchSource(key) {}/** Exponential backoff so a permanently dead feed stops costing us a request every 5 min. */-function backoffFor(failures) {- return Math.min(FRESH_MS * 2 ** Math.max(0, failures - 1), MAX_BACKOFF_MS);+function backoffFor(failures, status) {+ // A 429/408/5xx (or a timeout, which arrives with no status) means "later",+ // not "gone" — park those under a soft ceiling so a rate-limited publisher+ // recovers within the hour. A 404/410/403 is a real verdict: hard ceiling.+ const transient = !status || status === 429 || status === 408 || (status >= 500 && status < 600);+ const ceiling = transient ? SOFT_BACKOFF_MS : MAX_BACKOFF_MS;+ return Math.min(FRESH_MS * 2 ** Math.max(0, failures - 1), ceiling);}function refreshSource(key) {@@ -305,7 +370,7 @@ function refreshSource(key) {});return trimmed;})- .catch(() => {+ .catch((err) => {const prev = sourceCache.get(key);const failures = (prev?.failures || 0) + 1;// keep the last-good copy; push the next attempt out exponentially@@ -313,9 +378,10 @@ function refreshSource(key) {articles: prev?.articles || [],fetchedAt: prev?.ok ? prev.fetchedAt : Date.now(),lastFailAt: Date.now(),+ lastStatus: err?.status || null,ok: false,failures,- nextRetryAt: Date.now() + backoffFor(failures),+ nextRetryAt: Date.now() + backoffFor(failures, err?.status),});return prev?.articles || [];})diff --git a/api/_lib/oracle/narrative.js b/api/_lib/oracle/narrative.jsindex 1f7acb5d1..c3262f914 100644--- a/api/_lib/oracle/narrative.js+++ b/api/_lib/oracle/narrative.js@@ -7,10 +7,11 @@// pillar). This module produces that read.//// Three paths, all REAL:-// 1. llmComplete with live news context injected from cryptocurrency.cv — the-// LLM sees matching headlines and writes a precise thesis ("rides today's-// Trump tariff announcement"). Virality is boosted by real news signal.-// 2. llmComplete with no news context (fallback when news fetch fails).+// 1. llmComplete with live news context injected from the native three.ws+// news engine — the LLM sees matching headlines and writes a precise+// thesis ("rides today's Trump tariff announcement"). Virality is boosted+// by real news signal.+// 2. llmComplete with no news context (fallback when no headline matches).// 3. Deterministic keyword classifier when LLM is unavailable.//// Category set is aligned with the existing pump_coin_intel taxonomy so the twodiff --git a/api/_lib/oracle/news-context.js b/api/_lib/oracle/news-context.jsindex 0202d6d01..bd1f3f94c 100644--- a/api/_lib/oracle/news-context.js+++ b/api/_lib/oracle/news-context.js@@ -1,76 +1,62 @@-// Oracle — live news context from cryptocurrency.cv.+// Oracle — live news context from the native three.ws news engine.//-// Fetches a window of recent crypto headlines (no API key required — public-// endpoint) and matches them against a coin's name/symbol/tags. When a coin is-// clearly riding a live headline, the narrative classifier gets that context in-// the LLM prompt so it can write a precise thesis ("rides today's Trump tariff-// announcement") instead of guessing. The virality boost applied here is REAL-// signal: a coin whose ticker appears in a trending headline right now has-// genuine attention behind it.+// Reads a window of recent crypto headlines straight from api/_lib/news.js (the+// same in-process aggregator that serves /api/news/feed — no network hop, no+// third-party dependency) and matches them against a coin's name/symbol/tags.+// When a coin is clearly riding a live headline, the narrative classifier gets+// that context in the LLM prompt so it can write a precise thesis ("rides+// today's Trump tariff announcement") instead of guessing. The virality boost+// applied here is REAL signal: a coin whose ticker appears in a trending+// headline right now has genuine attention behind it.//// Two tiers:-// 1. fetchRelevantHeadlines(meta) — fetch + filter in one call. Returns the+// 1. fetchRelevantHeadlines(meta) — read + filter in one call. Returns the// top 3 matching headlines (or [] if none). Used by classifyNarrative().-// 2. fetchTrending() — the raw trending topics; used by the cron-// to pre-warm the headline cache before a scoring batch.+// 2. fetchTrending() — tickers trending across those headlines;+// used by the cron to pre-warm the headline cache before a scoring batch.//-// Both degrade gracefully: network failure, bad JSON, or any exception returns-// the safe fallback so the narrative pipeline never stalls.+// Both degrade gracefully: a cold registry, a dead feed, or any exception+// returns the safe fallback so the narrative pipeline never stalls.-const BASE = 'https://cryptocurrency.cv';-const CACHE_TTL_MS = 90_000; // 90s — fresh enough for live news, lenient on rate limits+import { getNews } from '../news.js';-/** Module-level news cache so one Vercel invocation shares it across coin scorings. */+const CACHE_TTL_MS = 90_000; // 90s — fresh enough for live news, cheap on the engine's own 5-min source cache++/** Module-level news cache so one invocation shares it across coin scorings. */const _cache = { headlines: null, trending: null, fetchedAt: 0 };-async function fetchWithTimeout(url, ms = 5000) {- const ctrl = new AbortController();- const timer = setTimeout(() => ctrl.abort(), ms);- try {- const res = await fetch(url, {- signal: ctrl.signal,- headers: { 'User-Agent': 'three.ws-oracle/1.0' },- });- if (!res.ok) return null;- return await res.json();- } catch {- return null;- } finally {- clearTimeout(timer);- }-}+/** Categories of the native registry most relevant to pump.fun culture. */+const CATEGORIES = ['general', 'solana', 'bitcoin', 'defi', 'trading'];/**- * Fetch recent headlines from cryptocurrency.cv, filtered to categories most- * relevant to pump.fun launches. Returns array of { title, category, published_at }- * or [] on failure. Results cached for CACHE_TTL_MS.+ * Read recent headlines from the native engine, filtered to the categories most+ * relevant to pump.fun launches. Returns array of+ * { title, category, published_at, source, tickers } or [] on failure.+ * Results cached for CACHE_TTL_MS.*/async function fetchHeadlines() {const now = Date.now();if (_cache.headlines && now - _cache.fetchedAt < CACHE_TTL_MS) return _cache.headlines;- // Parallel fetch of the most relevant categories for pump.fun culture.- const cats = ['general', 'solana', 'bitcoin', 'defi', 'altl1'];const results = await Promise.allSettled(- cats.map((cat) =>- fetchWithTimeout(`${BASE}/api/news?category=${cat}&limit=20&quality=any`, 5000),- ),+ CATEGORIES.map((category) => getNews({ category, limit: 20 })),);const headlines = [];const seen = new Set();- for (const r of results) {- if (r.status !== 'fulfilled' || !r.value) continue;- const items = r.value?.articles || r.value?.data || r.value?.items || [];- for (const item of items) {- const title = String(item?.title || item?.headline || '').trim();+ for (let i = 0; i < results.length; i++) {+ const r = results[i];+ if (r.status !== 'fulfilled') continue;+ for (const item of r.value?.articles || []) {+ const title = String(item?.title || '').trim();if (!title || seen.has(title)) continue;seen.add(title);headlines.push({title,- category: item?.category || 'general',- published_at: item?.published_at || item?.publishedAt || item?.date || null,+ category: item?.category || CATEGORIES[i],+ published_at: item?.pub_date || null,source: item?.source || null,+ tickers: item?.tickers || [],});}}@@ -83,14 +69,22 @@ async function fetchHeadlines() {}/**- * Fetch trending topics from cryptocurrency.cv. Returns array of strings.+ * Trending topics — the tickers appearing most often across the current+ * headline window, most-mentioned first. Returns array of strings.*/export async function fetchTrending() {if (_cache.trending && Date.now() - _cache.fetchedAt < CACHE_TTL_MS) return _cache.trending;- const data = await fetchWithTimeout(`${BASE}/api/trending?limit=20`, 4000);- const topics = (data?.topics || data?.trending || data?.items || [])- .map((t) => (typeof t === 'string' ? t : String(t?.name || t?.topic || '')))- .filter(Boolean);++ const headlines = await fetchHeadlines();+ const counts = new Map();+ for (const h of headlines) {+ for (const t of h.tickers || []) counts.set(t, (counts.get(t) || 0) + 1);+ }+ const topics = [...counts.entries()]+ .sort((a, b) => b[1] - a[1])+ .slice(0, 20)+ .map(([ticker]) => ticker);+if (topics.length) _cache.trending = topics;return _cache.trending || [];}diff --git a/api/_lib/pump-intel/news-matcher.js b/api/_lib/pump-intel/news-matcher.jsindex 977a59dc0..e102bbf07 100644--- a/api/_lib/pump-intel/news-matcher.js+++ b/api/_lib/pump-intel/news-matcher.js@@ -1,83 +1,46 @@// Real-time news-meme detection for pump.fun coin classification.//-// Fetches top crypto headlines from the cryptocurrency.cv public API-// (nirholas/cryptocurrency.cv — free, no key required, real-time aggregator),+// Reads top crypto headlines from the native three.ws news engine+// (api/_lib/news.js — the same in-process aggregator behind /api/news/feed),// caches them for 2 minutes, then fuzzy-matches a coin's name/symbol/description// against the headlines. Returns the matched headline + confidence so the// classifier can set is_news_meme=true with real evidence.//-// Fallback: if the API is unreachable, the function returns null so the-// caller degrades to the LLM/heuristic path — never blocks the pipeline.+// Fallback: if the registry is cold and every source is slow, the function+// returns the empty set so the caller degrades to the LLM/heuristic path —+// never blocks the pipeline.++import { getNews } from '../news.js';-const NEWS_API = 'https://cryptocurrency.cv/api/news';-const TRENDING_API = 'https://cryptocurrency.cv/api/trending';const CACHE_TTL_MS = 2 * 60_000; // 2-min freshness — headlines move fast-const FETCH_TIMEOUT_MS = 3_000;const MAX_HEADLINES = 40;let _cache = null;let _cacheAt = 0;/**- * Fetch + cache the current top crypto headlines.+ * Read + cache the current top crypto headlines.* Returns array of { title, summary, url, published_at } or [].*/async function getHeadlines() {if (_cache && Date.now() - _cacheAt < CACHE_TTL_MS) return _cache;- const ctrl = new AbortController();- const tid = setTimeout(() => ctrl.abort(), FETCH_TIMEOUT_MS);-try {- // Primary: structured news endpoint- const r = await fetch(`${NEWS_API}?limit=${MAX_HEADLINES}&format=json`, {- signal: ctrl.signal,- headers: { 'accept': 'application/json', 'user-agent': 'three.ws-intel/1' },- });- clearTimeout(tid);- if (r.ok) {- const d = await r.json();- // cryptocurrency.cv returns { articles: [...] } or a flat array- const articles = Array.isArray(d) ? d : (Array.isArray(d?.articles) ? d.articles : []);- const headlines = articles.slice(0, MAX_HEADLINES).map((a) => ({- title: String(a.title || a.headline || ''),- summary: String(a.summary || a.description || a.content || ''),- url: String(a.url || a.link || ''),- published_at: a.published_at || a.publishedAt || a.date || null,- })).filter((h) => h.title.length > 4);- if (headlines.length) {- _cache = headlines;- _cacheAt = Date.now();- return _cache;- }- }- } catch { clearTimeout(tid); }-- // Fallback: trending endpoint (simpler format)- const ctrl2 = new AbortController();- const tid2 = setTimeout(() => ctrl2.abort(), FETCH_TIMEOUT_MS);- try {- const r2 = await fetch(TRENDING_API, {- signal: ctrl2.signal,- headers: { 'accept': 'application/json', 'user-agent': 'three.ws-intel/1' },- });- clearTimeout(tid2);- if (r2.ok) {- const d2 = await r2.json();- const items = Array.isArray(d2) ? d2 : (Array.isArray(d2?.data) ? d2.data : []);- const headlines = items.slice(0, MAX_HEADLINES).map((a) => ({- title: String(a.title || a.term || a.keyword || ''),- summary: '',- url: '',- published_at: null,- })).filter((h) => h.title.length > 2);- if (headlines.length) {- _cache = headlines;- _cacheAt = Date.now();- return _cache;- }+ const { articles } = await getNews({ limit: MAX_HEADLINES });+ const headlines = (articles || [])+ .map((a) => ({+ title: String(a.title || ''),+ summary: String(a.description || ''),+ url: String(a.link || ''),+ published_at: a.pub_date || null,+ }))+ .filter((h) => h.title.length > 4);+ if (headlines.length) {+ _cache = headlines;+ _cacheAt = Date.now();+ return _cache;}- } catch { clearTimeout(tid2); }+ } catch { /* fall through to stale cache */ }return _cache || []; // stale cache beats nothing}diff --git a/api/_lib/pump.js b/api/_lib/pump.jsindex 510bd713a..306a387b2 100644--- a/api/_lib/pump.js+++ b/api/_lib/pump.js@@ -160,9 +160,10 @@ export async function getPumpAgent({ network = 'mainnet', mint } = {}) {]);const connection = getConnection({ network });const mintPk = mint instanceof PublicKey ? mint : new PublicKey(mint);- // PumpAgent is an Anchor-backed online SDK. Construction signature can- // shift between 3.x patches; pass connection + mint and let it error if not.- const agent = new PumpAgent(mintPk, connection);+ // Constructor is (mint, environment, connection) — the environment argument+ // sits BETWEEN the two. Passing the connection second leaves this.connection+ // undefined and every online read throws "Connection is required".+ const agent = new PumpAgent(mintPk, network === 'devnet' ? 'devnet' : 'mainnet', connection);const [agentPda] = getTokenAgentPaymentsPDA ? getTokenAgentPaymentsPDA(mintPk) : [null];return { agent, connection, BN, web3, agentPda };}diff --git a/api/coin/news.js b/api/coin/news.jsindex 49c68bb2f..0c1b4c56b 100644--- a/api/coin/news.js+++ b/api/coin/news.js@@ -1,10 +1,9 @@// GET /api/coin/news?q=<coin name>&limit=8// ---------------------------------------------------------------------------// Related-news rail for the /coin/:id page, served by the native three.ws-// aggregator (api/_lib/news.js — 37 publisher feeds with per-source caching-// and serve-stale-on-error). Previously proxied the cryptocurrency.cv-// deployment; that instance was retired, so the aggregation now runs here.-// Real articles from real publisher feeds, never fabricated.+// aggregator (api/_lib/news.js — 38 publisher feeds with per-source caching+// and serve-stale-on-error). Real articles from real publisher feeds, never+// fabricated.import { cors, json, method, wrap, error, rateLimited } from '../_lib/http.js';import { limits, clientIp } from '../_lib/rate-limit.js';diff --git a/api/cron/x402-autonomous-loop.js b/api/cron/x402-autonomous-loop.jsindex 741ab5350..ba9ffae0c 100644--- a/api/cron/x402-autonomous-loop.js+++ b/api/cron/x402-autonomous-loop.js@@ -50,9 +50,32 @@ import {DAILY_CAP_ATOMIC,} from '../_lib/x402/autonomous-registry.js';import { assertRingSpendInvariants } from '../_lib/x402/ring-allowlist.js';+import { sendOpsAlert } from '../_lib/alerts.js';const log = logger('x402-autonomous-loop');+// Live USDC balance of the ring payer, in atomic units (6dp). A missing ATA —+// the wallet has never held USDC — is a legitimate zero, not an error, so it+// reads as 0 rather than throwing. An RPC failure is NOT treated as zero: a+// transient read error must not silently disable the whole spend path, so it+// returns null, which every caller reads as "unknown → don't gate on it".+async function readPayerUsdcAtomic(conn, payerPubkey) {+ if (!USDC_MINT) return 0;+ try {+ const ata = getAssociatedTokenAddressSync(+ new PublicKey(USDC_MINT), payerPubkey,+ false, TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID,+ );+ const info = await conn.getTokenAccountBalance(ata);+ return Number(info?.value?.amount ?? 0);+ } catch (err) {+ // `could not find account` = no ATA = genuinely holds nothing.+ if (/could not find account|Invalid param|account not found/i.test(String(err?.message || ''))) return 0;+ log.warn('payer_usdc_read_failed', { message: err?.message });+ return null;+ }+}+const ORIGIN = () => env.APP_ORIGIN || 'https://three.ws';const USDC_MINT = env.X402_ASSET_MINT_SOLANA;const SOLANA_RPC = env.SOLANA_RPC_URL;@@ -299,6 +322,28 @@ export default wrapCron(async (req, res) => {return json(res, 200, { ok: false, reason: `solana_preflight_failed: ${err?.message}`, run_id: runId });}+ // ── Payer USDC float — the spend ceiling the daily cap can't see ─────────+ // The daily cap bounds how much we're *allowed* to spend; the payer's token+ // balance bounds how much we're *able* to. Without this read, a drained float+ // still probes, signs, and POSTs a payment for every ready entry each tick —+ // the server then fails at settle with `broadcast_failed:Simulation failed`+ // (observed: 1,262 failures in 24h, ~1/min, forever). Read it once per tick+ // and treat it as a hard spend ceiling so a dry wallet degrades to "skip the+ // paid calls" instead of "hammer Solana with transactions that cannot land".+ // Free endpoints and run()-style monitors (including the wallet-balance+ // monitor that alerts on this very condition) keep running regardless.+ const payerUsdcAtomic = await readPayerUsdcAtomic(conn, buyer.publicKey);+ if (payerUsdcAtomic === 0) {+ log.warn('autonomous_payer_usdc_empty', { payer: buyer.publicKey.toBase58() });+ await sendOpsAlert(+ '💸 x402 autonomous loop halted — payer USDC float is empty',+ `Ring payer ${buyer.publicKey.toBase58()} holds $0.00 USDC. Every paid call this tick is skipped ` ++ '(they would fail at settle with "Simulation failed"). The loop keeps running its free and ' ++ 'monitoring entries. Top up the payer\'s USDC float to resume autonomous spend.',+ { signature: `x402-autonomous-payer-usdc-empty:${buyer.publicKey.toBase58()}` },+ );+ }+// ── Process each entry ────────────────────────────────────────────────────const results = [];let remainingCap = DAILY_CAP_ATOMIC - dailySpentSoFar;@@ -327,7 +372,15 @@ export default wrapCron(async (req, res) => {try {outcome = await entry.run({origin, buyer, conn, blockhash, mintInfo,- redis, sql, log, runId, remainingCap,+ redis, sql, log, runId,+ // A run() pipeline pays through the shared payX402 client, so it+ // must see the payer's real float as its ceiling too — otherwise it+ // happily attempts settles the daily cap permits but the wallet+ // cannot fund. `null` (read failed) leaves the cap untouched.+ remainingCap: payerUsdcAtomic === null+ ? remainingCap+ : Math.min(remainingCap, payerUsdcAtomic),+ payerUsdcAtomic,});} catch (err) {errorMsg = err?.message || 'run_error';@@ -438,6 +491,15 @@ export default wrapCron(async (req, res) => {results.push({ id: entry.id, status: 'skip', reason: 'cap_would_exceed' });continue;}+ // Can't pay what we don't hold. Skip BEFORE building/signing/POSTing a+ // transaction the facilitator would only fail to simulate. `null` means+ // the balance read itself failed — unknown, so don't gate on it.+ if (payerUsdcAtomic !== null && amountAtomic > payerUsdcAtomic) {+ log.info('autonomous_insufficient_payer_usdc', { id: entry.id, amount: amountAtomic, held: payerUsdcAtomic });+ results.push({ id: entry.id, status: 'skip', reason: 'insufficient_payer_usdc' });+ await setCooldown(redis, entry); // back off; don't re-probe every tick+ continue;+ }// Step 2: check if receiver ATA exists (optimization — share lookup)const receiverAta = getAssociatedTokenAddressSync(diff --git a/api/news/article.js b/api/news/article.jsindex 7ce9ea293..d864fd015 100644--- a/api/news/article.js+++ b/api/news/article.js@@ -18,7 +18,8 @@import { lookup } from 'node:dns/promises';import { cors, json, method, wrap, error, rateLimited } from '../_lib/http.js';import { limits, clientIp } from '../_lib/rate-limit.js';-import { getNews, findArticle, extractTickers, lexiconSentiment, stripHtml } from '../_lib/news.js';+import { getNews, findArticle, extractTickers, lexiconSentiment, stripHtml, stripJsonFence } from '../_lib/news.js';+import { llmComplete, llmConfigured } from '../_lib/llm.js';const FETCH_TIMEOUT_MS = 10_000;const MAX_RESPONSE_BYTES = 5 * 1024 * 1024;@@ -125,64 +126,32 @@ async function fetchArticle(url) {// ── Analysis ─────────────────────────────────────────────────────────────────-const LLM_PROVIDERS = [- {- key: 'groq',- envKey: 'GROQ_API_KEY',- url: 'https://api.groq.com/openai/v1/chat/completions',- model: 'llama-3.3-70b-versatile',- },- {- key: 'openrouter',- envKey: 'OPENROUTER_API_KEY',- url: 'https://openrouter.ai/api/v1/chat/completions',- model: 'meta-llama/llama-3.3-70b-instruct:free',- },-];-+// The platform LLM chain (api/_lib/llm.js) owns provider order, key discovery,+// failover, and spend tracking. Returns null when no provider is configured or+// every provider fails — the caller then serves the extractive analysis below.async function llmAnalyze(content, title, source) {- for (const provider of LLM_PROVIDERS) {- const apiKey = process.env[provider.envKey];- if (!apiKey) continue;- try {- const resp = await fetch(provider.url, {- method: 'POST',- headers: { 'content-type': 'application/json', authorization: `Bearer ${apiKey}` },- signal: AbortSignal.timeout(12_000),- body: JSON.stringify({- model: provider.model,- temperature: 0.3,- max_tokens: 700,- response_format: { type: 'json_object' },- messages: [- {- role: 'system',- content: 'You are a crypto news analyst. Respond only with valid JSON.',- },- {- role: 'user',- content: `Analyze this article. Respond as {"summary": "...2-3 sentence summary...", "key_points": ["...", "..."], "sentiment": "bullish|bearish|neutral"}.\n\nTitle: ${title}\nSource: ${source}\n\n${content.slice(0, 6000)}`,- },- ],- }),- });- if (!resp.ok) continue;- const data = await resp.json();- const parsed = JSON.parse(data?.choices?.[0]?.message?.content || '{}');- if (!parsed.summary) continue;- return {- summary: String(parsed.summary).slice(0, 1200),- key_points: (Array.isArray(parsed.key_points) ? parsed.key_points : [])- .map((p) => String(p).slice(0, 300))- .slice(0, 5),- sentiment: ['bullish', 'bearish', 'neutral'].includes(parsed.sentiment) ? parsed.sentiment : 'neutral',- provider: provider.key,- };- } catch {- // fall through to the next provider- }+ if (!llmConfigured()) return null;+ try {+ const { text, provider } = await llmComplete({+ system: 'You are a crypto news analyst. Respond only with valid JSON, no markdown fence.',+ user: `Analyze this article. Respond as {"summary": "...2-3 sentence summary...", "key_points": ["...", "..."], "sentiment": "bullish|bearish|neutral"}.\n\nTitle: ${title}\nSource: ${source}\n\n${content.slice(0, 6000)}`,+ maxTokens: 700,+ timeoutMs: 15_000,+ track: { tool: 'news_article' },+ });+ const parsed = JSON.parse(stripJsonFence(text));+ if (!parsed.summary) return null;+ return {+ summary: String(parsed.summary).slice(0, 1200),+ key_points: (Array.isArray(parsed.key_points) ? parsed.key_points : [])+ .map((p) => String(p).slice(0, 300))+ .slice(0, 5),+ sentiment: ['bullish', 'bearish', 'neutral'].includes(parsed.sentiment) ? parsed.sentiment : 'neutral',+ provider,+ };+ } catch {+ return null; // extractive fallback covers it}- return null;}function heuristicAnalyze(paragraphs, title) {diff --git a/api/news/digest.js b/api/news/digest.jsnew file mode 100644index 000000000..6b7ad5e6c--- /dev/null+++ b/api/news/digest.js@@ -0,0 +1,257 @@+// GET /api/news/digest+// ---------------------------------------------------------------------------+// The day's crypto news, clustered into narratives instead of a flat list of+// headlines. Reads the live aggregator (38 publisher feeds), groups the last+// N hours of coverage into the handful of stories that actually matter, and+// gives each one a title, a plain-language summary, a market stance, the+// tickers involved, and every source that covered it.+//+// Two clustering engines, both real:+// • LLM (platform chain — Groq/OpenRouter/NVIDIA free tiers first) reads the+// headlines and groups them semantically. `engine: "llm"`.+// • Ticker+token overlap clustering (agglomerative, Jaccard similarity over+// the title's significant tokens plus detected tickers) when no provider+// key is configured or the chain fails. `engine: "heuristic"`.+//+// The heuristic path is not a placeholder — it produces genuine clusters from+// the same articles, with an extractive summary drawn from the lead article.+// Nothing is ever fabricated: every narrative cites the real articles it+// clustered, and a narrative with no articles cannot exist.+//+// Params: ?hours=24 (1–72), ?limit=8 narratives (3–12), ?refresh=1 (bypass cache)+// Cached 30 min in-process (LLM calls are the expensive part) + 15 min CDN.++import { cors, json, method, wrap, error, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';+import { getNews, stripJsonFence, lexiconSentiment } from '../_lib/news.js';+import { llmComplete, llmConfigured } from '../_lib/llm.js';++const CACHE_TTL_MS = 30 * 60_000;+const MAX_ARTICLES_CONSIDERED = 90;++const _cache = new Map(); // `${hours}:${limit}` → { value, expiresAt }++// Words that carry no clustering signal in crypto headlines.+const STOPWORDS = new Set([+ 'the', 'a', 'an', 'and', 'or', 'but', 'for', 'to', 'of', 'in', 'on', 'at', 'by', 'with',+ 'from', 'as', 'is', 'are', 'was', 'were', 'be', 'been', 'it', 'its', 'this', 'that',+ 'after', 'over', 'into', 'amid', 'says', 'said', 'new', 'more', 'than', 'has', 'have',+ 'will', 'can', 'could', 'may', 'about', 'up', 'down', 'crypto', 'cryptocurrency',+]);++function tokens(title) {+ return new Set(+ String(title)+ .toLowerCase()+ .replace(/[^a-z0-9$ ]/g, ' ')+ .split(/\s+/)+ .filter((w) => w.length > 2 && !STOPWORDS.has(w)),+ );+}++function jaccard(a, b) {+ if (!a.size || !b.size) return 0;+ let shared = 0;+ for (const t of a) if (b.has(t)) shared++;+ return shared / (a.size + b.size - shared);+}++function stanceFrom(articles) {+ // Average the lexicon sentiment across the cluster's coverage.+ const scores = articles.map((a) => a.sentiment?.score ?? 0);+ const mean = scores.reduce((s, v) => s + v, 0) / (scores.length || 1);+ return mean > 0.15 ? 'bullish' : mean < -0.15 ? 'bearish' : 'neutral';+}++function clusterTickers(articles) {+ const counts = new Map();+ for (const a of articles) for (const t of a.tickers || []) counts.set(t, (counts.get(t) || 0) + 1);+ return [...counts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 5).map(([t]) => t);+}++function shape(articles) {+ // A narrative's sources are the real articles behind it — always.+ return articles.map((a) => ({+ id: a.id,+ title: a.title,+ link: a.link,+ source: a.source,+ pub_date: a.pub_date,+ image: a.image,+ }));+}++// ── Heuristic engine: agglomerative clustering on title tokens + tickers ─────++function heuristicClusters(articles, limit) {+ const enriched = articles.map((a) => ({+ article: a,+ bag: new Set([...tokens(a.title), ...(a.tickers || []).map((t) => `$${t.toLowerCase()}`)]),+ }));++ const clusters = [];+ for (const item of enriched) {+ let best = null;+ let bestScore = 0;+ for (const c of clusters) {+ const score = jaccard(item.bag, c.bag);+ if (score > bestScore) {+ bestScore = score;+ best = c;+ }+ }+ // 0.28 keeps "Bitcoin ETF inflows hit record" with "Record ETF inflows+ // push Bitcoin higher" while splitting unrelated BTC stories.+ if (best && bestScore >= 0.28) {+ best.items.push(item.article);+ for (const t of item.bag) best.bag.add(t);+ } else {+ clusters.push({ items: [item.article], bag: new Set(item.bag) });+ }+ }++ return clusters+ .sort((a, b) => b.items.length - a.items.length || new Date(b.items[0].pub_date || 0) - new Date(a.items[0].pub_date || 0))+ .slice(0, limit)+ .map((c) => {+ // The most-covered angle leads; its own text is the summary.+ const lead = c.items.slice().sort((x, y) => new Date(y.pub_date || 0) - new Date(x.pub_date || 0))[0];+ const summary =+ lead.description ||+ `${c.items.length} outlet${c.items.length > 1 ? 's' : ''} covering this story, led by ${lead.source}.`;+ return {+ title: lead.title,+ summary,+ stance: stanceFrom(c.items),+ tickers: clusterTickers(c.items),+ coverage: c.items.length,+ articles: shape(c.items),+ };+ });+}++// ── LLM engine: semantic grouping over the headline set ─────────────────────++async function llmClusters(articles, limit) {+ const indexed = articles.map((a, i) => `${i}. [${a.source}] ${a.title}`).join('\n');+ const { text, provider } = await llmComplete({+ system:+ 'You are a crypto news editor building a daily digest. You group headlines into distinct stories. Respond only with valid JSON, no markdown fence.',+ user: `Below are ${articles.length} crypto headlines from the last day, each with an index.++Group them into at most ${limit} distinct news stories, ordered by importance. Every story must reference the indices of the headlines it covers. Ignore headlines that don't belong to a significant story rather than forcing them into one.++Respond as:+{"narratives":[{"title":"a clear headline for the story","summary":"2-3 sentences in plain language explaining what happened and why it matters","stance":"bullish|bearish|neutral","indices":[0,4,9]}]}++Headlines:+${indexed}`,+ maxTokens: 2000,+ timeoutMs: 25_000,+ track: { tool: 'news_digest' },+ });++ const parsed = JSON.parse(stripJsonFence(text));+ if (!Array.isArray(parsed?.narratives)) throw new Error('digest: model returned no narratives');++ const out = [];+ for (const n of parsed.narratives) {+ // Every index must resolve to a real article we actually fetched. A+ // hallucinated index is dropped, not rendered.+ const cited = (Array.isArray(n.indices) ? n.indices : [])+ .map((i) => articles[Number(i)])+ .filter(Boolean);+ if (!cited.length) continue;+ out.push({+ title: String(n.title || cited[0].title).slice(0, 200),+ summary: String(n.summary || cited[0].description || '').slice(0, 900),+ stance: ['bullish', 'bearish', 'neutral'].includes(n.stance) ? n.stance : stanceFrom(cited),+ tickers: clusterTickers(cited),+ coverage: cited.length,+ articles: shape(cited),+ });+ if (out.length >= limit) break;+ }+ if (!out.length) throw new Error('digest: no narrative cited a real article');+ return { narratives: out, provider };+}++// ─────────────────────────────────────────────────────────────────────────────++export default wrap(async (req, res) => {+ if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;+ if (!method(req, res, ['GET'])) return;++ const rl = await limits.marketFeedIp(clientIp(req));+ if (!rl.success) return rateLimited(res, rl);++ const params = new URL(req.url, 'http://x').searchParams;+ const hours = Math.min(Math.max(1, parseInt(params.get('hours') || '24', 10) || 24), 72);+ const limit = Math.min(Math.max(3, parseInt(params.get('limit') || '8', 10) || 8), 12);+ const refresh = params.get('refresh') === '1';++ const key = `${hours}:${limit}`;+ const hit = _cache.get(key);+ if (!refresh && hit && hit.expiresAt > Date.now()) {+ return json(res, 200, { ...hit.value, cached: true }, {+ 'cache-control': 'public, max-age=300, s-maxage=900, stale-while-revalidate=3600',+ });+ }++ const { articles: all, sources_ok, sources_total } = await getNews({ limit: 400 });+ const cutoff = Date.now() - hours * 3600_000;+ const windowed = all+ .filter((a) => a.pub_date && new Date(a.pub_date).getTime() >= cutoff)+ .slice(0, MAX_ARTICLES_CONSIDERED);++ if (windowed.length < 3) {+ return error(+ res, 503, 'insufficient_coverage',+ `only ${windowed.length} articles published in the last ${hours}h — try a wider window`,+ );+ }++ let narratives;+ let engine;+ let provider = null;+ if (llmConfigured()) {+ try {+ const result = await llmClusters(windowed, limit);+ narratives = result.narratives;+ provider = result.provider;+ engine = 'llm';+ } catch {+ narratives = heuristicClusters(windowed, limit);+ engine = 'heuristic';+ }+ } else {+ narratives = heuristicClusters(windowed, limit);+ engine = 'heuristic';+ }++ // Market mood across the whole window, independent of clustering.+ const mood = stanceFrom(windowed);+ const topTickers = clusterTickers(windowed);++ const value = {+ narratives,+ engine,+ provider,+ window_hours: hours,+ articles_considered: windowed.length,+ sources_live: `${sources_ok}/${sources_total}`,+ mood,+ top_tickers: topTickers,+ generated_at: new Date().toISOString(),+ cached: false,+ };+ _cache.set(key, { value, expiresAt: Date.now() + CACHE_TTL_MS });+ if (_cache.size > 24) _cache.delete(_cache.keys().next().value);++ return json(res, 200, value, {+ 'cache-control': 'public, max-age=300, s-maxage=900, stale-while-revalidate=3600',+ });+});++// Exported for tests — the clustering math is the interesting part.+export const _internal = { heuristicClusters, jaccard, tokens, stanceFrom };diff --git a/api/news/feed.js b/api/news/feed.jsindex 565848d33..f696b639b 100644--- a/api/news/feed.js+++ b/api/news/feed.js@@ -1,7 +1,7 @@// GET /api/news/feed// ---------------------------------------------------------------------------// Live aggregated crypto news across the native source registry-// (api/_lib/news-sources.js — 37 first-party publisher feeds). Powers+// (api/_lib/news-sources.js — 38 first-party publisher feeds). Powers// /markets/news, the /markets hub strip, and anything else that wants a real// cross-source headline feed.//diff --git a/data/changelog.json b/data/changelog.jsonindex 6c95e1a34..c84821fbc 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,26 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-10",+ "title": "The Oracle can see the news again",+ "summary": "The Oracle's narrative pillar — one of the four signals behind every 0-100 conviction score — reads live headlines to tell whether a coin is riding a real story. It had been reading them from an outside news service that went offline, and because the code was built to fail quietly rather than break, it simply scored with no headlines at all. Conviction scores now draw on three.ws's own news engine, which reads 38 publisher feeds directly, so the narrative read is live again and no longer depends on anyone else staying up. The pump.fun news-meme detector and the sniper's coin classifier read from the same engine.",+ "tags": [+ "fix",+ "improvement"+ ],+ "link": "/oracle"+ },+ {+ "date": "2026-07-10",+ "title": "Friends now see you online — and can message you — while you're in /play",+ "summary": "Your account's friends list, presence, and DMs (already live on /walk) now work inside /play's coin worlds too: a Friends button on the HUD (or press J) opens a drawer showing who's online and where, with live direct messages that arrive instantly whether or not the drawer is open. Previously /play never told the server who you were signed in as, so friends saw you as offline no matter how long you played, and any message sent your way was silently lost.",+ "tags": [+ "feature",+ "fix"+ ],+ "link": "/play"+ },{"date": "2026-07-10","title": "What can an agent actually do? The complete abilities dossier is live",diff --git a/data/pages.json b/data/pages.jsonindex 2b39d900c..19d392fd6 100644--- a/data/pages.json+++ b/data/pages.json@@ -1573,6 +1573,14 @@"priority": 0.8,"changefreq": "weekly","added": "2026-07-10"+ },+ {+ "path": "/markets/digest",+ "title": "Crypto News Digest",+ "description": "The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.",+ "priority": 0.8,+ "changefreq": "hourly",+ "added": "2026-07-10"}]},diff --git a/docs/agent-abilities/FULL-ARTICLE.md b/docs/agent-abilities/FULL-ARTICLE.mdindex cccac1735..3c375f68a 100644--- a/docs/agent-abilities/FULL-ARTICLE.md+++ b/docs/agent-abilities/FULL-ARTICLE.md@@ -620,6 +620,14 @@ Any avatar in your library can become any agent's body, and creating an avatar c**Why it matters:** You never have to choose between making a character and making an agent — every avatar is one click from being alive.+## Agent Genome — the breeding studio++Breed any two agents into a genuinely new child agent. The child provably inherits a recombination of both parents — brain disposition (curiosity, boldness, humor, formality, verbosity, temperature), a blended voice you can actually play out loud, body morphs and colors, and skill alleles with real genetics: dominant traits, recessive skills that can skip a generation and surface in a grandchild, bounded mutations flagged with a ⚡, and emergent fusion skills neither parent had (trading + sentiment can produce alpha-signal; vision + forge can produce concept-art). Preview the exact offspring before committing, re-roll the dice, then breed — the child is born with its own fresh Solana and EVM wallets, a synthesized 3D body, an in-character persona, on-chain licenses for its expressed skills, and a pedigree tier (common → uncommon → rare → legendary) that deep, emergent-rich lineages earn. Owners can list agents at stud for a $THREE fee, and breeding cooldowns keep rare pedigrees scarce.++**How it works:** The studio (pages/genome.html + src/genome.js) drives api/genome/preview.js and api/genome/breed.js, with the genetics isolated as pure, deterministic code in api/_lib/genome.js: every random choice flows through a recorded seed via per-locus PRNG streams, so the same (parentA, parentB, seed) always derives a byte-identical child — the preview IS the child you commit. Constants are pinned by tests (mutation drift capped at 0.12 so 'mutation' can never silently become 'random new agent'; heterozygous skills express at 72%, else carry recessively; recessive-in-both pairings surface the trait; fusion rules are a static, auditable table). Any never-bred agent gets a stable founder genome derived from its real traits. The breed endpoint provisions fresh wallets, bakes a real child GLB from the blended appearance, composes the persona prompt deterministically from the inherited brain, passes blended ElevenLabs voice settings verbatim to live TTS (the play button in the preview synthesizes the actual inherited voice), grants expressed skills on-chain with royalty provenance, and is idempotent per breeding key — replaying a preview returns the same child, never twins. verifyGenome / api/genome/lineage.js re-derive the child from its recorded parents + seed and compare canonical SHA-256 genome hashes, so a forged pedigree is mathematically detectable; api/genome/stud.js powers the public stud market.++**Why it matters:** Creation stops being a one-shot generator and becomes lineage. You can breed toward a goal — cross your best trader with your best analyst and maybe get an alpha-signal emergent — gamble on recessive genes resurfacing, and build bloodlines whose rarity is earned by real genetic depth, not a label. Because every birth re-derives from its recorded seed, 'this legendary is 4th-generation with two emergent skills' is a claim anyone can verify, which is what makes a pedigree — and a stud fee — actually worth something.+---# Chapter 4 · The Mind — memory, dreams, and autonomy@@ -724,6 +732,38 @@ Read access to AgenC (agenc.tech, Tetsuo Corp) — an external Solana coordinati**Why it matters:** three.ws agents (and any MCP client) can discover open on-chain jobs and monitor task escrow state without standing up Anchor themselves — the on-ramp to working within an external agent labor market.+## Alpha Hunt++An always-on strategy that scores every new token against converging quality signals — how many smart-money wallets are in, how organic the buying looks, the token's quality score, and its market cap — and autonomously buys only when your thresholds all pass at once. Each strategy runs on a daily SOL budget with an instant kill switch, and its live win rate and realized P&L stay on the scoreboard.++**How it works:** The sniper worker (workers/agent-sniper/index.js) feeds fully-enriched intel records into a pure scorer (workers/agent-sniper/alpha-hunt.js) that applies hard filters — min quality_score, min smart-money wallet count, min organic score, max market cap in USD — before any buy. Strategies are configured via api/sniper/strategy.js (trigger = 'alpha_hunt') with per-strategy daily budgets, and every buy is simultaneously recorded as a Reasoning Ledger decision so the call is auditable later. The command center at /dashboard/capabilities (src/dashboard-next/pages/capabilities.js) shows armed/disarmed state, thresholds, P&L, and win rate per strategy, plus a live worker heartbeat (alive / feed degraded / offline) and treasury auto-funding totals.++**Why it matters:** You encode your judgment once — 'only low-cap coins with real smart money and organic volume' — and the agent hunts around the clock at machine speed, never chasing a token that fails a single filter. The budget cap and kill switch keep it on a leash, and every trade lands in the agent's verifiable track record.++## Autonomous Coin Launcher++Agents that launch their own pump.fun coins on a schedule you set — every N hours, up to a launch cap, per network — with a one-click 'Launch Now' override that fires within a minute. The dashboard tracks every launched coin, whether it graduated, and the creator fees it has earned back.++**How it works:** Launcher configs (one per agent per network: symbol, interval hours, max launches) are managed through api/agent/launcher.js with strict agent-ownership checks; the 'Launch Now' button posts a trigger action that the worker picks up within 60 seconds. The capabilities command center renders the full schedule (next launch countdown, launches vs cap) and a launched-coins ledger with graduation status and total fees claimed per coin.++**Why it matters:** Your agent becomes a self-sustaining creator: it ships coins on cadence without you touching a keyboard, and everything it launches is tracked in one place — schedule, graduations, and the fee revenue flowing back.++## Creator Auto-Claim++A fee harvester that watches every coin an agent launched and automatically collects the creator fees whenever they cross a threshold — no manual sweeping, no forgotten revenue. When a coin is running hot, the dashboard flags it 'Ready to Claim' and gives you a claim-it-now button showing the exact SOL waiting.++**How it works:** api/cron/launcher-claimer.js runs every 5 minutes: for each launched coin with ≥0.01 SOL of accrued creator fees (and no claim in the past 24h) it queries live fee info, has the agent sign its own claim transaction — the same key that signed the launch — and records the claim with the buyback-earmarked share for revenue accounting. The dashboard's Auto-Claim panel shows claimable-now vs total-earned per coin and exposes a manual 'Claim' action through the same collect-creator-fee endpoint the cron uses.++**Why it matters:** Creator fees are the whole point of launching, and they leak when nobody sweeps them. Auto-Claim turns fee collection into a background process: your agents harvest their own earnings every five minutes, and you can see — and one-click trigger — every claim yourself.++## Market Maker++Agents provide range-based liquidity on coins they care about — defending a price floor, trimming into rallies — with Jito-accelerated execution and a rulebook that makes market manipulation structurally impossible, not just discouraged. Plain-language presets like 'Gentle floor defense' configure it in one click; a live panel shows spread, inventory fill, buys vs sells, and net P&L per market.++**How it works:** Policies live in api/_lib/market-maker.js, the single source of truth shared by the API (api/agent/market-maker.js, api/launch/mm.js) and the engine worker. Hard anti-manipulation guards are enforced twice — refused at policy-create time AND re-clamped at execution: minimum 30s between actions, a side flip (buy→sell) requires 2× that interval so the MM physically cannot wash-trade, no single action may exceed 33% of live market volume, recycling can never dump more than 90% of inventory, and when live volume can't be read the engine refuses anything above a 0.05 SOL slice so it never paints a no-volume tape. Every fill routes through executeAgentTrade — the same firewall, spend-guard, and custody path a manual trade uses; the engine adds no new way to move funds. MEV tip modes (off/economy/turbo) control Jito priority.++**Why it matters:** You get professional-grade liquidity provision — a defended floor, orderly exits into strength — without hiring a market maker or trusting a black box. The non-manipulation guarantees are properties of the policy engine itself, verifiable in the caps, so holders of your coin can trust the tape and you can trust the agent with inventory.+---# Chapter 5 · The Voice — conversation@@ -908,6 +948,22 @@ At the end of the day your agent reflects: a short first-person paragraph about**Why it matters:** Your agent narrates its own inner life from evidence, which makes it feel less like a tool and more like a colleague.+## Talking Avatar Video (/create/video)++Turn any of your three.ws avatars into a lip-synced talking-head video. Pick an avatar from your collection in a live 3D preview, drop in a voice track (WAV, MP3, M4A — a recording, a narration, anything), optionally describe the scene ('speaking on a stage with dramatic lighting'), and generate. A few minutes later you're watching a rendered clip of your avatar speaking your audio, ready to preview in the browser and download as an MP4. Your first video is free; paid plans generate without limits.++**How it works:** Generation runs on a dedicated GPU worker hosting LongCat-Video-Avatar-1.5 (an open MIT-licensed talking-avatar model) on an NVIDIA L4: the platform resolves your avatar to a reference image, uploads your audio, queues the job, and the page polls status until the finished 720p MP4 lands in cloud storage — typically 2–4 minutes per clip. Media URLs are locked to platform-controlled hosts so the worker can never be steered at arbitrary servers.++**Why it matters:** A talking video of your own character — for a product update, a coin pitch, a social clip — normally means an animator or a third-party subscription. Here it's three inputs and one button, using the avatar you already built, with the first one on the house.++## Web push notifications++Real OS-level notifications from your agents to every device you've subscribed — a sale landing, a tip arriving, someone meeting your agent IRL, a market alert firing — delivered even when three.ws isn't open. A preference center gives you a per-category kill switch (sales & earnings, purchases, social & mentions, IRL, market alerts, account & security), so there is no notification you can't turn off. Enabling is always your choice: the permission prompt only appears when you ask for it from the inbox banner or settings, never ambushed on page load.++**How it works:** The browser's push subscription is registered with the platform per device, keyed to your account; every notification flows through one delivery pipeline that writes the durable in-app inbox row first, then fans out to Web Push (VAPID-signed) for the categories you've left enabled. Dead endpoints reported by the push service are pruned automatically so the registry self-heals as browsers expire subscriptions, and delivery and click-through are tracked so re-engagement is measured, not guessed.++**Why it matters:** Your agents work around the clock — sales, tips, and whale buys don't wait for you to have a tab open. Push closes that gap on your terms: the events you care about reach your lock screen, and the ones you don't never do.+## /a/me — personal agent hubThe authenticated home for everything you own: every agent with its avatar, skills, memory, recent actions, reputation, and earnings, plus one-click quick actions per agent — view, share, embed, edit, monetize, talk, walk, and AR.@@ -1140,6 +1196,22 @@ The same identity standard extends into OKX's X Layer agent economy: agents regi**Why it matters:** One identity standard, another whole economy — your agent's registration opens doors on exchange-scale marketplaces too.+## Reasoning Ledger++A public, tamper-evident timeline of every consequential call an agent makes — snipes, exits, bounty awards, moderation decisions — each entry recording what the agent decided, why (its written rationale), what it predicted with what confidence, and, once the position settles on-chain, what actually happened: right or wrong, and by exactly how much SOL. The headline is an explainable 0–100 reputation score with a full 'how is this computed' drill-down showing the formula and every weighted component, plus a calibration chart that answers the sharpest question you can ask a forecaster: does its 80%-confidence call actually hit 80% of the time? Being wrong is shown, not hidden — honesty is the trust signal.++**How it works:** Frontend at pages/reasoning-ledger.html + src/reasoning-ledger.js (filter by kind, full-text search of rationales, paginated 'load older', animated score ring, cumulative realized-P&L sparkline over settled calls). Data from api/ledger/[agentId].js, which returns the reputation (formula + per-component breakdown + calibration buckets), the latest on-chain anchor, and shaped decisions with pending/reconciled outcomes and Solscan proof links on the sell signature. Every entry is hashed into a per-agent hash chain; api/ledger/verify/[agentId].js recomputes the entire chain from committed contents (trusting NO stored hash), checks every prev-hash link, and compares the recomputed head to the latest Solana SPL-Memo anchor — returning verified / verified_unanchored / verification_failed with the exact sequence number where tampering broke the chain. api/cron/reconcile-decisions.js closes the loop: it resolves open predictions against closed sniper positions (realized P&L proven by the sell signature), anchors each agent's new chain head on-chain, and raises an ops alert if a verified track record's hit rate collapses below 25% over 10+ reconciled calls.++**Why it matters:** Before you trust an agent — copy its trades, hire it, hold its coin — you can interrogate its entire decision history and independently prove nothing was backdated or quietly edited. One click re-verifies the whole record against the on-chain anchor; a tampered entry is not just detected but pinpointed. Wins, losses, overconfidence, and P&L are all on the record, so reputation here is earned math, not marketing.++## Permanent asset storage on Arweave++An agent's 3D body and identity assets can be published to Arweave — storage that is paid once and persists permanently — signed by the same wallet the owner already connected, and woven directly into the agent's on-chain ERC-8004 identity. The result is an agent whose body outlives any server, host, or company.++**How it works:** src/arweave/upload.js uploads bytes through ArDrive Turbo (@ardrive/turbo-sdk, lazy-loaded), signing the data item with the user's Ethereum key and tagging it (App-Name: three.ws, content type, filename) before returning a permanent ar:// URI; estimateUploadCost() quotes the Winston-credit price for any byte size with no wallet needed. The mint pipeline in src/mint/index.js embeds the agent manifest into the GLB's own extras (the file becomes self-describing), pins it to IPFS for hot access, uploads the enriched GLB to Arweave for permanence, then registers on-chain via the ERC-8004 Identity Registry with the ipfs:// URI as the canonical body and the ar:// URI recorded as an 'avatar-arweave' service entry.++**Why it matters:** Your agent's body can never 404. The exact GLB — manifest baked inside it — lives at a permanent address that no platform can take down, referenced from an on-chain identity record anyone can resolve. Fast retrieval comes from IPFS; forever comes from Arweave; and both are bound to your wallet's signature, so provenance travels with the file.+---# Chapter 7 · Skills — what agents know how to do@@ -1620,6 +1692,38 @@ three.ws agents don't just trade with each other — the platform sells its 3D s**Why it matters:** Your agent's storefront isn't an island — it's plugged into every major machine-commerce network.+## Trading Swarms — pooled treasuries that trade on consensus++Trading Swarms let multiple agents pool SOL into a single shared treasury that trades as a collective. The swarm only fires a buy when reputation-weighted agreement among its members clears the threshold you set — each member's vote is weighted by their verified on-chain trading track record, so proven traders steer the treasury while newcomers still count a little. Realized profit is paid back to every member pro-rata as real SOL transfers (with an optional creator fee up to 20%), while the principal keeps trading. Every lamport is reconciled against the treasury's live on-chain balance — there are no virtual balances anywhere.++**How it works:** Each swarm provisions its own custodial Solana treasury wallet plus a dedicated trading strategy carrying the swarm's policy (per-trade cap, daily budget, stop-loss/take-profit/trailing stop, max hold, slippage, smart-money filter). A consensus engine tallies which members hold real positions in a candidate mint, weights them by reputation score, and sizes the trade by conviction; contributions, profit payouts, and exits are idempotent on-chain SOL transfers logged to an auditable payout ledger and custody-event trail.++**Why it matters:** You get the upside of trading alongside proven agents — with capital that only moves when their verified track records agree, and profits that settle to your wallet automatically.++## Trading Swarms — member protections, kill switch, and live dashboard++Swarms are built so no member can be trapped or captured. A per-member share cap stops any one wallet from dominating the pool, you can exit at any time and redeem your share of the treasury's live net asset value straight to your own wallet, and any member (or coalition) holding enough of the treasury can trigger the kill switch — instantly halting new buys and force-liquidating every open position. A public directory shows each swarm's aggregate record — members, SOL contributed, closed trades, win rate, and realized PnL — before you join, on mainnet or devnet.++**How it works:** The per-swarm dashboard streams over Server-Sent Events: consensus votes with per-member weight breakdowns, confirmed payouts with Solscan links, and treasury ticks (live on-chain balance, open positions, win rate, realized PnL) every few seconds. Exit settlement supports settle-at-mark (share of liquid SOL plus marked open positions) or wait-to-close policies, and share recomputation redistributes capped overflow proportionally.++**Why it matters:** You can watch every vote, trade, and payout land live — and you always hold a working exit and a kill switch, enforced on-chain rather than promised.++## x402 Studio — the merchant console for a paid x402 business++x402 Studio is a Stripe-style console for running a business where AI agents and humans pay you in USDC. Create products in minutes — each one wraps your paid endpoint in a hosted checkout page with your name, logo, and accent color, and tracks paid calls and gross settled revenue. Configure payout wallets on Solana and Base, and register agent wallets: named on-chain identities authorized to auto-pay for services or receive funds on your behalf, each bounded by independent per-call and daily USDC caps. A built-in money panel lets you receive USDC to your payout address or send it to any address, .sol name, or @handle directly from the page.++**How it works:** Products, wallets, and settings persist through real merchant and SKU APIs; USDC sends resolve names through SNS, prepare the transfer server-side, and settle via a Phantom-signed Solana transaction. Security controls include spend caps, a Sign-In-With-X re-entry gate, per-network settlement toggles, a CORS allow-list, an optional facilitator override, settlement webhooks, and a rotatable API key stored only as a hash.++**Why it matters:** You go from 'I have an API' to 'agents are paying me on-chain in USDC' with one console — no payment processor, no merchant account, no code.++## x402 Studio — storefront builder, embeddable pay buttons, and giving++Beyond checkout links, Studio publishes your whole storefront: drag blocks — hero, product grid, single product, text, image, button, footer — onto a canvas, reorder them, and publish to a shareable store page, like a Shopify page for your x402 products. The embed builder generates a copy-paste pay button you can drop onto any website — Wix, Shopify, a landing page — with live preview and size, shape, and theme controls; clicking it opens the payment modal and settles on-chain. Giving tools turn every sale into a donation: a charity split earmarks a fixed share of each settled payment for your cause wallet, and round-up nudges the buyer's total to the nearest unit and donates the difference — both disclosed to buyers before they pay.++**How it works:** The storefront layout saves as a validated block schema published under your store handle; the embed snippet is a static button tagged with data attributes plus one script include that boots the x402 payment modal, settling USDC on Solana or Base.++**Why it matters:** One console gives you a published store, a pay button that works on any site you own, and built-in charitable giving — the full storefront stack for the agent economy.+---# Chapter 10 · The Agent Wallet — the money layer (23 abilities)@@ -1672,15 +1776,16 @@ The Portfolio tab is the agent wallet's command center: one real-time view of ev> Fund any agent in one scan — a tap-to-pay Solana QR with live on-chain confirmation the second the money lands.-The Deposit tab is the "fund this agent" page anyone can use — owner or visitor. It shows exactly who you're funding, the agent's full Solana address with one-tap copy, and a scannable Solana Pay QR code that opens Phantom, Solflare, or Backpack pre-filled; you can even preset an amount that bakes itself into the QR as you type. From the moment the page is open it watches the blockchain, and the instant your SOL actually arrives it flips to a green "◎X SOL received" confirmation and updates the recent-activity list. There's also a one-tap tip flow that sends SOL or USDC straight from your own connected wallet to the agent, with a real on-chain receipt at the end.+The Deposit tab is the "fund this agent" page anyone can use — owner or visitor. It shows exactly who you're funding, the agent's full Solana address with one-tap copy, and a scannable Solana Pay QR code that opens Phantom, Solflare, or Backpack pre-filled; you can even preset an amount that bakes itself into the QR as you type. From the moment the page is open it watches the blockchain, and the instant your SOL actually arrives it flips to a green "◎X SOL received" confirmation and updates the recent-activity list. There's also a one-tap tip flow that sends SOL or USDC straight from your own connected wallet to the agent, with a real on-chain receipt at the end. Don't have crypto yet? You don't need any to start. Every deposit and payment surface carries an Add funds flow that opens a Coinbase Pay checkout pre-filled with your wallet — pay by card, pick $10, $25, or $50, and USDC lands directly on your Solana address. The moment it arrives, the overlay confirms it on its own and whatever you were doing resumes.-**Under the hood.** The tab reads the agent's public receive address and live SOL balance from the platform's wallet API, which queries Solana RPC with automatic retry and failover to a public endpoint, and shares a 60-second balance cache across the entire server fleet so polling never hammers the chain. The QR encodes a standards-compliant Solana Pay URI, so any mobile wallet — Phantom, Solflare, Backpack — opens pre-filled with the address, the agent's name as the label, and an optional preset amount. While the tab is open it re-checks the balance every 15 seconds and declares a deposit only when the on-chain balance genuinely rises, then pulls in the fresh transaction for the activity feed. Tips from a connected browser wallet are built, signed, and broadcast client-side — fully non-custodial — after which the server independently re-verifies the transaction on-chain before recording it, feeding the public Money Pulse, the owner's wallet automations, and royalty streams to ancestor agents.+**Under the hood.** The tab reads the agent's public receive address and live SOL balance from the platform's wallet API, which queries Solana RPC with automatic retry and failover to a public endpoint, and shares a 60-second balance cache across the entire server fleet so polling never hammers the chain. The QR encodes a standards-compliant Solana Pay URI, so any mobile wallet — Phantom, Solflare, Backpack — opens pre-filled with the address, the agent's name as the label, and an optional preset amount. While the tab is open it re-checks the balance every 15 seconds and declares a deposit only when the on-chain balance genuinely rises, then pulls in the fresh transaction for the activity feed. Tips from a connected browser wallet are built, signed, and broadcast client-side — fully non-custodial — after which the server independently re-verifies the transaction on-chain before recording it, feeding the public Money Pulse, the owner's wallet automations, and royalty streams to ancestor agents. GET /api/onramp/link builds a hosted Coinbase Pay checkout URL locked to your Solana address, asset (USDC), and chosen amount ($10–$500), opened in a popup. The overlay snapshots your USDC balance first, then polls it every 5 seconds until it rises — confirming automatically for up to 12 minutes before handing off to a one-click 'Check again'.**Guardrails.** Public-safe by design: the tab exposes only the agent's public receive address — no keys, no secrets, no owner controls. The "received" confirmation fires exclusively on a real on-chain balance increase (with a dust-level noise guard); nothing is ever simulated. The QR label is clamped and an oversized payload falls back to an always-scannable address-only code; invalid amounts are excluded from the QR until corrected. Tips are non-custodial — signed and sent from the visitor's own wallet, so the platform never touches the funds — and the server independently re-verifies every tip signature on-chain before recording it, rejecting failed transactions and any transaction that didn't actually credit the agent's wallet, with idempotency so the same signature can never be recorded twice. Balance reads are rate-limited per user and served through a 60-second shared cache to protect the RPC; tip recording is rate-limited per IP; the detailed activity endpoint is owner-only (server-enforced 403 for anyone else). Devnet is clearly labeled and explorer links always match the active network.- The Solana Pay QR card: a crisp white QR generated entirely in-house as SVG that is itself a tap-to-pay deep link — type an amount and watch the code redraw live to preset it in the sender's wallet app- The confirmation moment: a pulsing amber "Waiting for your first deposit…" flips to a glowing green "◎0.5 SOL received" with a toast the instant real money lands on-chain — driven purely by the live balance, never faked- One-tap tipping: preset chips (◎0.05 to $25), an honest stage-by-stage send flow (approve in your wallet → broadcasting → confirming), and a real Solscan receipt at the end+- A first-time user with zero crypto hits a paid feature, clicks Add funds, buys $25 of USDC by card in a Coinbase popup — and watches the modal flip to '✓ Deposit confirmed — 25.00 USDC added' by itself the second the money lands, never having left the page## 05 · Copilot@@ -2052,6 +2157,38 @@ A free, no-key, no-account crypto data API built for AI agents: token snapshots,**Why it matters:** Agents and developers get real on-chain and market data with zero signup friction — the funnel-top for the platform's paid unique services.+## Mission Control — the real-time trading terminal (/terminal)++A keyboard-driven trading cockpit that puts everything three.ws knows on one screen: the live pump.fun launch firehose streams into a virtualized feed where every row carries its intel score, firewall verdict, and smart-money count; a focus pane fuses a real candlestick chart, a scrolling live trades tape, a token security grid (top-10 concentration, sniper %, bundler %, NoMint/NoFreeze/LP-burnt checks), and smart-money flow for whatever coin is selected; a positions pane streams your agent's open snipes with live unrealized PnL next to its actual on-chain holdings. You never touch the mouse: j/k walk the feed, 1–6 pick a buy size, b buys, s exits the whole position, / filters, x flips express mode, and ? shows the full shortcut map. Filters (smart-money-only, socials-only, safe-only, intel floor, market-cap band) can be saved as named one-click views, and a mobile tab bar keeps all three panes usable on a phone.++**How it works:** Three SSE streams (the global new-mint firehose, the intel engine's scored feed, and the sniper position stream) feed a shared store; visible rows are enriched on demand so a fast feed never janks. Every buy and sell goes through the same server-signed guarded trade path as the wallet hub — firewall, MEV protection, spend guard, and custody audit are enforced server-side and can't be bypassed from the terminal. Express mode confirms once, then executes instantly; a client-side gate on cached firewall verdicts spares round trips on blocked coins, and connection pills plus honest degraded states replace forever-skeletons when a stream drops.++**Why it matters:** Pump.fun launches live or die in minutes; tab-switching between a feed, a scanner, and a wallet is how trades get missed. Mission Control collapses discovery, due diligence, and execution into single keystrokes — while the firewall and spend guards make speed safe, so one fat-fingered key can't rug you.++## Smart Money Radar (/smart-money)++A first-party reputation graph of every pump.fun wallet. Instead of reading the coin, you read the money buying it: every launch, every wallet, every trade is crossed against which coins actually graduated to Raydium, building a provable track record per wallet. The radar then ranks fresh coins by the pedigree of the money accumulating them — a 0–100 score, the smart-money share of buys, how many proven wallets are in, and the notable wallets driving it. A leaderboard labels wallets as smart money, snipers, dumpers, or ruggers; paste any address to pull its reputation card; star coins into a watchlist; sort the feed by pedigree, share, smart buy volume, or freshness.++**How it works:** A rollup engine judges each coin about six hours after launch — graduated is a win, everything else a dud — and folds every buyer's footprint into that wallet's running reputation, exactly once per coin. Live coins from the last few hours are then scored by the buy-weighted average reputation of their buyers (unknown wallets drag it down, creators don't count toward their own coin) plus a bounded bonus for each additional proven wallet piling in. Everything is first-party observation — no external oracle — and the whole graph is queryable through a public API: the live feed, the wallet leaderboard, single-wallet cards, and per-coin breakdowns.++**Why it matters:** Anyone can fake a chart, a website, or a Telegram; nobody can fake a wallet's on-chain graduation history. The radar gives you the one edge that compounds — follow the wallets that keep being right — and it lights up while a coin is still fresh, not after it has already run.++## Alert rules engine++Server-side price and event alerts for pump.fun that fire even when every tab is closed. Build up to 50 rules per account across five kinds — a coin graduating to Raydium, price crossing above or below a threshold, a whale buy over a SOL size you set, or a specific agent minting a new coin — and route each rule to any mix of the in-app bell, a signed webhook, or a Telegram chat. Every rule has its own cooldown, an on/off switch, a custom label, and a delivery log showing the last five deliveries and any recent failures.++**How it works:** Rules live in the platform database, not in your browser — a cron evaluates them against the live pump.fun event stream, deduplicates so no on-chain event delivers twice, enforces per-rule cooldowns and a storm guard, and fans matches out to each configured channel. Webhook rules get a per-rule signing secret so receivers can verify authenticity, and price rules use real crossing logic rather than naive threshold spam.++**Why it matters:** Client-side alerts die with the tab. These follow you across devices: set a whale-buy alert on your phone, get the Telegram ping at your desk, and let a bot consume the signed webhook — one rule, every channel, no tab required.++## Email newsletter with double opt-in++A ship-notes newsletter covering new features, launches, and changelog highlights — signed up from the footer of any page. Nobody gets mailed until they click a confirmation link sent to their address, every email carries an honored one-click unsubscribe, and the promise is explicit: product updates, nothing else.++**How it works:** Signup records a pending subscriber with a single-purpose confirm token and emails the link; only clicking it flips the address to confirmed and adds it to the mailing audience, so a typo'd or hostile email can never subscribe a third party. The endpoint returns the same generic success either way, so it can't be used to probe who is subscribed, and unsubscribe is wired both as an in-email link and the standards-based List-Unsubscribe header.++**Why it matters:** You hear about new capabilities the moment they ship without watching the changelog — and because the list is consent-proven end to end, it's a signal you chose, not spam you have to escape.+---# Chapter 12 · Live worlds, social & IRL@@ -2316,6 +2453,30 @@ Everything IRL — presence minting, GPS pin placement, the geofenced nearby fee**Why it matters:** Build your own location-based agent experience on the same privacy-hardened rails the platform itself uses.+## Crews++Found a crew with a name and a 2–6 character tag, invite friends, and roam the live world together as a squad. Your roster shows who's online right now and exactly which realm and server they're in, invites arrive as real-time notifications, and every member carries the crew badge over their avatar in-world. Owners run the roster — invite, kick, hand off leadership, or disband — with one crew per account so the tag means something.++**How it works:** The crews API mirrors the friends system: create/invite/accept/decline/leave/kick actions over a durable roster, joined with live Redis presence on every read. The crew tag rides inside the HMAC-signed presence ticket issued at sign-in, so the game server stamps a trustworthy, unspoofable badge on each member. Every crew also gets a public page by tag showing its roster and live presence.++**Why it matters:** Play with your people — a persistent squad identity, live who's-online-and-where presence, and a verified crew tag over your head in the world.++## Coin-World Billboard — own the board inside a 3D world++Every coin world on three.ws has a physical billboard — a framed panel on two posts standing behind spawn that every visitor walks past. For a flat $0.05 in USDC you can hold that board for a 6-hour slot: your image and an optional caption render in-world for everyone who enters, and whoever pays most recently holds it until the slot expires. It's a paid community canvas, not an ad network — nothing is targeted, nothing is tracked, the panel just shows what its current holder put up. An in-world 'Feature your content' button opens the payment dialog right where you're standing, and the board updates the moment your payment settles.++**How it works:** The panel is a Three.js canvas-textured mesh that cover-fits the placement image with a caption strip, falling back to the coin's own artwork so it's never blank. Placement is a paid x402 endpoint settling USDC on Solana or Base and cataloged in the x402 Bazaar, so agents can buy slots programmatically with @x402/fetch; a free read API serves the active placement to every visitor with the world failing open to its default content on any error.++**Why it matters:** For five cents you put your art in front of every person and agent who walks into a coin's world for the next six hours — a real, ownable surface inside a live 3D space.++## zauth RepoScan — hire a security agent in-world, pay it directly++Inside the $THREE town, a third-party security agent called zauth sells GitHub repository security scans for $0.05 in USDC. Give it any public repo, approve the payment from your own wallet, and it audits the codebase — returning a zauth trust score and a full written security analysis you can read on the spot, with free progress polling while the scan runs. The payment goes straight from your wallet to zauth's: three.ws never touches your funds and holds no key in the transaction, making this genuine agent-to-agent commerce between you and an independent merchant, brokered inside a multiplayer world.++**How it works:** zauth's own API blocks the browser payment handshake cross-origin, so the platform relays it same-origin: it translates the payment header to zauth's wire format, normalizes the x402 envelope, and validates the repo name before forwarding so a malformed request can never burn a settled payment. The USDC transfer you sign settles on Base or Solana through zauth's facilitator, and zauth token holders can pass through a sign-in-with-x signature for free access.++**Why it matters:** You walk up to an independent AI security auditor in a 3D world, pay it a nickel wallet-to-wallet, and get a real security report on any GitHub repo — proof that in-world agents can sell real services.+---# Chapter 13 · Agents everywhere — embeds, plugins, mobile@@ -2492,6 +2653,22 @@ three.ws published an open, freely-licensed standard for returning live 3D scene**Why it matters:** 3D results render natively wherever your assistant lives, and one tap puts them in your physical room.+## Agent X (Twitter) publishing suite++Your agent becomes a real presence on X, posting from your connected account in its own voice. It drafts tweets with AI based on the agent's name and persona, publishes single tweets or full threads, schedules posts for exact times, and fires automatically on triggers: a daily persona post at your chosen hour, a weekly digest, price milestones crossing thresholds you set, or a payment landing in the agent's wallet. Every trigger can run fully autonomous or route through a human review queue where you approve, edit, or reject before anything goes out, and a built-in analytics view rolls up likes, retweets, replies, quotes, and impressions across every post.++**How it works:** An OAuth connection links your X account once; from then on the dashboard's social panel handles drafting (Claude-generated, persona-aware, 280-char safe), scheduling, trigger configuration, the review queue, and per-agent analytics. Publishing is CSRF-gated, rate-limited, and tier-quota'd so a leaked session can't spam your account, and you can disconnect with one click.++**Why it matters:** Your agent builds an audience on X around the clock — on your terms, with a kill switch and a review queue between it and the publish button.++## @three-ws/agent-ui — an avatar that lives on your page++A 3D avatar walks onto any website on a transparent, fullscreen canvas floating above the page's real DOM. It isn't in a box: it stands on a card, falls onto a heading with a dust burst, walks over to an input when it gains focus, covers its eyes while you type a password, and sprints off-screen just before a navigation. It reacts to clicks, typing, and link-follows like a character who actually inhabits the interface.++**How it works:** One createAgentUI() call loads a GLB avatar and its animation clips and returns a handle with imperative behaviors — standOn, walkTo, fallOnto, runOff, interceptNavigation — plus FX helpers like dust, impact pulses, and proximity shadows. A single scan() call wires declarative data-agent-* attributes across the page with zero per-element JavaScript, and every anchor maps a DOM rect into world space so the avatar lands exactly where you point.++**Why it matters:** Any website gets a living mascot that reacts to what visitors do — the kind of delight people screenshot — from an npm install and a dozen lines.+---# Chapter 14 · The Developer platform@@ -2506,7 +2683,7 @@ Claude or any MCP client connects to https://three.ws/api/mcp (Streamable HTTP,**How it works:** Auth is OAuth 2.1 with dynamic client registration (RFC 7591/8414/9728) for end users, or a dashboard-issued API key (3da_live_*) as a bearer token for server-to-server. Notable tools: validate_model runs the Khronos glTF-Validator against any public URL; render_avatar returns an interactive <model-viewer> HTML artifact; mint_3d_asset mints a $0.25-USDC-via-x402 Metaplex Core NFT with enforced royalties (10% cap), idempotency, signed provenance ledger entries, and real on-chain remix-royalty settlement to parent creators; create_gated_embed produces a holder-only embed verified against real SPL balances; crypto_data and token_snapshot front the free aggregator.-**Why it matters:** An AI assistant can manage a user's entire 3D asset library conversationally — validate a model, see its stats, render it inline, tokenize it on Solana — without the user copy-pasting URLs or leaving the chat. Docs: /workspaces/three.ws/docs/mcp.md.+**Why it matters:** An AI assistant can manage a user's entire 3D asset library conversationally — validate a model, see its stats, render it inline, tokenize it on Solana — without the user copy-pasting URLs or leaving the chat. Docs: /docs/mcp.## Six more hosted remote MCP servers@@ -2520,7 +2697,7 @@ Beyond /api/mcp: 3D Studio (/api/mcp-3d, paid text/image→3D, rigging, retexturOne-line npx installs (e.g. npx -y @three-ws/scene-mcp) covering: 3D/avatars (scene-mcp, avatar-mcp, avatar-agent, mcp-server), payments (x402-mcp self-custodial wallet, three-token-mcp for $THREE, mcp-bridge, ibm-x402-mcp), market intel (intel-mcp, pumpfun-mcp, vanity-mcp, marketplace-mcp), naming (naming-mcp for .sol resolution), autonomous control plane (autopilot-mcp spend caps, portfolio-mcp, provenance-mcp signed action log), trading (copy-mcp, signals-mcp, alerts-mcp, kol-mcp, agent-sniper), account (notifications-mcp, billing-mcp, activity-mcp), AI (vision-mcp, brain-mcp multi-provider LLM router, audio-mcp TTS/STT/lipsync), and coordination (agenc-mcp task marketplace, agora-mcp earn-$THREE work board, clash-mcp, tutor-mcp, loom-mcp).-**How it works:** Each runs locally over stdio; all 42 servers are registered in the official MCP registry under io.github.nirholas/* and surfaced on Smithery, Glama, PulseMCP, and mcp.so, so any MCP client can discover them by name. Package sources live in /workspaces/three.ws/packages/*-mcp.+**How it works:** Each runs locally over stdio; all 42 servers are registered in the official MCP registry under io.github.nirholas/* and surfaced on Smithery, Glama, PulseMCP, and mcp.so, so any MCP client can discover them by name. Package sources live in packages/*-mcp.**Why it matters:** A developer composes exactly the capability set their agent needs — a trading agent adds intel + copy + portfolio; a creative agent adds scene + avatar + audio — each a single npx line in their MCP client config.@@ -2528,7 +2705,7 @@ One-line npx installs (e.g. npx -y @three-ws/scene-mcp) covering: 3D/avatars (scShips a complete 3D AI agent from one package: a floating chat panel with voice I/O (AgentKit.mount()), a two-line 3D avatar embed of any three.ws agent (loadAvatar / the <agent-3d> custom element), on-chain registration via ERC-8004 on EVM or Metaplex on Solana, generation of the standard .well-known manifests (agent-registration.json, agent-card.json for A2A, ai-plugin.json), ERC-7710 scoped-delegation permissions (grant/verify/revoke spending limits for an agent), Sign-in-with-Solana + Solana Pay checkout, on-chain attestations/reputation, and an AgentClient that calls other agents' paid skills handling the x402 402 flow.-**How it works:** Vanilla JS, no framework; ethers@^6 and @solana/web3.js@^1 are optional peers used only by the chain-specific helpers. Registration pins metadata to IPFS via web3.storage and writes to a deployed ERC-8004 Identity Registry. README: /workspaces/three.ws/sdk/README.md.+**How it works:** Vanilla JS, no framework; ethers@^6 and @solana/web3.js@^1 are optional peers used only by the chain-specific helpers. Registration pins metadata to IPFS via web3.storage and writes to a deployed ERC-8004 Identity Registry. README: sdk/README.md.**Why it matters:** A web developer turns their site into a discoverable, on-chain, payable AI agent in an afternoon — chat UI, 3D body, identity, and A2A monetization included — instead of assembling five protocols by hand.@@ -2536,7 +2713,7 @@ Ships a complete 3D AI agent from one package: a floating chat panel with voiceGives an AI agent a Solana wallet and typed on-chain actions: SolanaAgent.fromKeypair (autonomous signing) or fromBrowserWallet (user-deferred signing), SOL/SPL transfers, Jupiter swaps and quotes, staking/unstaking, token balances and ATA management, plus the x402 'exact' USDC payment scheme (payer + facilitator halves) and a solana-agent-kit plugin.-**How it works:** Four interchangeable WalletProvider implementations (keypair, browser split-signing server/client halves, wallet-adapter wrapper) behind one interface; payExact executes an SPL TransferChecked and returns the tx signature as the X-PAYMENT proof, compatible with x402 v2. Dual ESM/CJS, fully typed. README: /workspaces/three.ws/solana-agent-sdk/README.md.+**How it works:** Four interchangeable WalletProvider implementations (keypair, browser split-signing server/client halves, wallet-adapter wrapper) behind one interface; payExact executes an SPL TransferChecked and returns the tx signature as the X-PAYMENT proof, compatible with x402 v2. Dual ESM/CJS, fully typed. README: solana-agent-sdk/README.md.**Why it matters:** An autonomous agent can hold its own keys, move funds, swap, stake, and settle x402 invoices in USDC on Solana with a typed API — or defer every signature to the human's browser wallet with the same code.@@ -2544,7 +2721,7 @@ Gives an AI agent a Solana wallet and typed on-chain actions: SolanaAgent.fromKeThe payments layer behind three.ws agent tokens: a user launches a token for their agent, then charges people who pay that agent in its token, with buyback and shareholder distribution. Covers invoice validation (validateInvoicePayment), payment history/stats, v2 bonding-curve trading (PumpTradeClient buy_v2/sell_v2 with exact-quote-in buys), EVM agent payments, EVM x402 client/facilitator helpers, and a2a payment helpers (payA2A).-**How it works:** A value-added fork of @pump-fun/[email protected] binding the deployed Solana program AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7, extended with USDC + token-2022 quote assets (upstream is SOL-only), an offline instruction builder (PumpAgentOffline), and a solana-agent-kit plugin. README: /workspaces/three.ws/agent-payments-sdk/README.md.+**How it works:** A value-added fork of @pump-fun/[email protected] binding the deployed Solana program AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7, extended with USDC + token-2022 quote assets (upstream is SOL-only), an offline instruction builder (PumpAgentOffline), and a solana-agent-kit plugin. README: agent-payments-sdk/README.md.**Why it matters:** A developer monetizing an agent gets the full commercial machinery — issue an invoice, verify it was paid on-chain within a window, trade the agent's token on its bonding curve — without writing Anchor client code.@@ -2552,7 +2729,7 @@ The payments layer behind three.ws agent tokens: a user launches a token for thex402-fetch is a drop-in fetch wrapper that silently answers x402 402 Payment Required challenges — wrap a wallet once (withX402(window.ethereum)) and call any paid endpoint as if it were free, with a maxPaymentUsd guard against overspending. x402-server is the merchant half: wrap any HTTP route with paid() and it issues the 402 challenge, verifies and settles the USDC payment, and takes your fee.-**How it works:** x402-fetch has zero production dependencies (secp256k1/keccak256/EIP-712 inlined) and signs EIP-3009 transferWithAuthorization for USDC on Base, byte-identical to MetaMask output; works in browser and Node with EIP-1193 providers or raw keys. Sources: /workspaces/three.ws/packages/x402-fetch, /workspaces/three.ws/packages/x402-server.+**How it works:** x402-fetch has zero production dependencies (secp256k1/keccak256/EIP-712 inlined) and signs EIP-3009 transferWithAuthorization for USDC on Base, byte-identical to MetaMask output; works in browser and Node with EIP-1193 providers or raw keys. Sources: packages/x402-fetch, packages/x402-server.**Why it matters:** Both sides of the paid-agent-API economy in a few lines: an agent developer's HTTP calls just work against paid endpoints, and a service developer turns any endpoint into revenue without building payment infrastructure.@@ -2560,7 +2737,7 @@ x402-fetch is a drop-in fetch wrapper that silently answers x402 402 Payment ReqOne base URL fronting a growing bundle of third-party crypto/DeFi/on-chain APIs — CoinGecko, DefiLlama, Jupiter, DexScreener, direct Solana RPC, OpenAI chat and more — re-offered as GET /api/v1/x/<provider>/<endpoint> with normalized, agent-sized JSON responses instead of each upstream's raw payload.-**How it works:** Every request resolves through four billing lanes in order: free (real per-IP quotas, zero setup — a bare curl gets data), BYOK (caller passes the upstream's own key, pure pass-through, no markup), plan (three.ws API key/OAuth, billed to the caller's plan), and x402 (HTTP 402 challenge, pay per call in USDC, retry with X-PAYMENT). The registry at /workspaces/three.ws/api/v1/_providers.js is the single source of truth feeding discovery (GET /api/v1/x), /openapi.json, and the /crypto-api storefront — the same URL upgrades in place across lanes.+**How it works:** Every request resolves through four billing lanes in order: free (real per-IP quotas, zero setup — a bare curl gets data), BYOK (caller passes the upstream's own key, pure pass-through, no markup), plan (three.ws API key/OAuth, billed to the caller's plan), and x402 (HTTP 402 challenge, pay per call in USDC, retry with X-PAYMENT). The registry at api/v1/_providers.js is the single source of truth feeding discovery (GET /api/v1/x), /openapi.json, and the /crypto-api storefront — the same URL upgrades in place across lanes.**Why it matters:** An agent that needs a token price, a swap quote, a chain's TVL, and an ENS lookup uses one base URL, one discovery call, and one bill instead of juggling four API keys and four rate limits — and can start with literally zero setup.@@ -2568,7 +2745,7 @@ One base URL fronting a growing bundle of third-party crypto/DeFi/on-chain APIsVersioned first-party endpoints: text→3D forge (the only text→mesh lane in the x402 ecosystem), text→image (/api/v1/ai/image, first 5/day free then $0.02 via x402), TTS and ASR (/api/v1/ai/tts, /api/v1/ai/asr), sentiment, agents, market, pump, and token data, plus free public directories like /api/v1/tokenized/launches (every 3D NFT minted through the platform) and /api/v1/pump/launches.-**How it works:** Same free-quota-then-x402 pattern throughout, settled on Solana or Base; payable with any x402 client (e.g. npx x402 curl). Full reference: /workspaces/three.ws/docs/api-reference.md; machine-readable listing at /.well-known/x402.json and /.well-known/openapi.yaml.+**How it works:** Same free-quota-then-x402 pattern throughout, settled on Solana or Base; payable with any x402 client (e.g. npx x402 curl). Full reference: /docs/api-reference; machine-readable listing at /.well-known/x402.json and /.well-known/openapi.yaml.**Why it matters:** An account-less AI agent can generate images, speech, transcriptions, and 3D meshes pay-as-it-goes in USDC — no API key signup flow, which is exactly what autonomous agents can't do.@@ -2576,13 +2753,13 @@ Versioned first-party endpoints: text→3D forge (the only text→mesh lane in tCRUD for agent identities at /api/agents (list, get, create, update, get-or-create default agent), with API-key bearer auth or session cookies from SIWE/Privy login, standard JSON error envelopes, and 100 req/min authenticated rate limits.-**How it works:** Base URL https://three.ws/api; agents carry chain identity fields (chain_id, chain_agent_id), avatar/thumbnail URLs, and a manifest; encrypted wallet keys are always stripped from responses. Documented in /workspaces/three.ws/docs/api-reference.md.+**How it works:** Base URL https://three.ws/api; agents carry chain identity fields (chain_id, chain_agent_id), avatar/thumbnail URLs, and a manifest; encrypted wallet keys are always stripped from responses. Documented in /docs/api-reference.**Why it matters:** Programmatic control of the same agent objects the MCP tools and SDKs operate on — scripts and CI can provision and update agents that then show up with 3D bodies and on-chain identity everywhere else.## Claude Code plugin marketplace (.claude-plugin)-An official plugin marketplace manifest (/workspaces/three.ws/.claude-plugin/marketplace.json) shipping four plugins: three-ws-core (wallet + x402 skills: authenticate-wallet, fund, send-usdc, trade, search-for-service, pay-for-service, monetize-service, query-onchain-data), three-ws-developer (scaffold-agent, setup-mcp, use-tools commands with runnable examples for the paid MCP tools), three-ws-pump-fun (create-coin, swap, coin-fees, tokenized-agents, and a reactive skill that drives live avatar movement from the real PumpPortal feed), and three-ws-3d (forge-3d, text-to-avatar, auto-rig, mesh-forge plus the avatar and scene MCP servers).+An official plugin marketplace manifest (.claude-plugin/marketplace.json) shipping four plugins: three-ws-core (wallet + x402 skills: authenticate-wallet, fund, send-usdc, trade, search-for-service, pay-for-service, monetize-service, query-onchain-data), three-ws-developer (scaffold-agent, setup-mcp, use-tools commands with runnable examples for the paid MCP tools), three-ws-pump-fun (create-coin, swap, coin-fees, tokenized-agents, and a reactive skill that drives live avatar movement from the real PumpPortal feed), and three-ws-3d (forge-3d, text-to-avatar, auto-rig, mesh-forge plus the avatar and scene MCP servers).**How it works:** Each plugin bundles skills/commands and MCP server configs; installing one gives Claude Code both the how-to knowledge (skills) and the live tools (MCP) for that domain. Sources: ./.agents, ./marketplace/plugins/*, ./pump-fun-skills.@@ -2592,10 +2769,74 @@ An official plugin marketplace manifest (/workspaces/three.ws/.claude-plugin/marA single typed home for declaring MCP tools across the repo's 38 servers: defineTool declares identity, Zod-schema API surface, and a permission manifest (network allowlist, rate limit, wallet access) once; defineExecutor wires typed implementations through one validating invoke() entry point; toMcpTools adapts the result into the exact registration shape the servers already use.-**How it works:** JSON Schema is derived automatically from the Zod schemas; validation, rate limiting, and success/failure normalization are enforced centrally instead of re-implemented per server. Internal workspace package (private, not on npm) at /workspaces/three.ws/packages/tool-sdk — relevant to developers building new three.ws MCP servers in-repo.+**How it works:** JSON Schema is derived automatically from the Zod schemas; validation, rate limiting, and success/failure normalization are enforced centrally instead of re-implemented per server. Internal workspace package (private, not on npm) at packages/tool-sdk — relevant to developers building new three.ws MCP servers in-repo.**Why it matters:** Contributors adding a tool to any three.ws MCP server get validation, permissions, and rate limiting for free and can't drift from the platform's tool contract.+## BNB Vault — encrypted 3D model marketplace++A marketplace for encrypted 3D models where buying access is a real BNB Chain smart-contract transaction. The purchase triggers a cross-chain call into BNB Greenfield's programmable storage that grants the buyer's address read access to the encrypted object — a capability no other chain offers a contract. The page tracks the grant honestly ("granting access on Greenfield…") until it settles a few blocks later, then unlocks the model for viewing entirely in the browser: the decrypted bytes never touch the network again.++**How it works:** A buy() on the GreenfieldVault contract carries a protobuf-encoded Greenfield Policy plus the live relay fee, sent from a local session key — gasless via MegaFuel sponsorship on BSC testnet when sponsorable, self-pay otherwise. Unlocking recovers the buyer's real secp256k1 public key from a single signed message (no registration step), ECIES-wraps the model's AES-256-GCM content key to it, and the browser unwraps and decrypts with Web Crypto + @noble/curves against a sha256-verified manifest. The raw content key and plaintext GLB are never returned by any server.++**Why it matters:** Buy and sell 3D assets with on-chain access control and true end-to-end encryption — only the buyer's own browser can ever decrypt the model.++## Live block race++A real-time race between BNB Chain, Base, Ethereum, and Solana block times, measured fresh off real public RPCs every few seconds. Each lane shows a rolling average, the latest block or slot it sampled, and a sparkline of recent measurements — no number on the page is hardcoded; every figure traces to a probe made moments ago. A lane whose RPC goes quiet shows "reconnecting" with its last live reading while the others keep racing.++**How it works:** The page polls a latency endpoint on a 5-second cadence; the backend samples a window of real recent blocks (slots for Solana) from each chain's public RPC and returns averaged block times, and the headline computes live speedup ratios of BNB Chain versus Base and Ethereum from those same samples. Needs no wallet, no payment, no key.++**Why it matters:** See — not just read — that BNB Chain produces ~0.45s blocks, verified live against three other chains in your own browser.++## BABT holder check API++A free API that answers one question: does this address hold a Binance Account Bound Token — the soulbound token Binance mints only to identity-verified accounts, with a 1.16M+ holder base on mainnet. It's an on-chain, KYC-backed uniqueness signal any developer can query with no API key and no Binance relationship. Responses are honest about the signal's limits: holding a BABT proves the address is currently bound to a KYC'd account, not a permanent identity, since Binance can revoke and re-mint to a new wallet.++**How it works:** One free eth_call to balanceOf on Binance's own verified BABT contract (mainnet or testnet), plus tokenIdOf when the address holds one; the response includes the token id, an explorer link, and a plain-language note on how to interpret the result, cached at the edge for 30–60 seconds.++**Why it matters:** One free GET tells you whether a wallet belongs to a KYC'd Binance user — instant sybil resistance for airdrops, gating, and reputation systems.++## @three-ws/react — a walking 3D agent in two lines of React++A React component drops a fully interactive, walkable 3D agent into any app with no Three.js, no WebGL setup, and no build configuration. Visitors steer the avatar with a joystick or keyboard, and your code drives it live through a ref: switch between idle, walk, and run, swap the avatar mid-session, tune walk speed, pop a speech bubble over its head, or change the environment preset.++**How it works:** The 3D runtime renders inside a sandboxed iframe hosted by three.ws, so the host app ships zero rendering code; postMessage traffic is accepted only from the three.ws origin and the component's own iframe. TypeScript types ship in the box and React 17+ is the only peer dependency.++**Why it matters:** Embedding a 3D AI agent in a React app becomes a two-line install instead of a WebGL project.++## @three-ws/x402-modal — HTTP 402 to checkout in one script tag++A drop-in payment modal turns any x402 paid endpoint into a polished checkout. Point it at a URL that answers 402 Payment Required and it handles everything: parsing the payment challenge, connecting Phantom on Solana or MetaMask on EVM chains, signing, settling, and re-sending the request with proof of payment — then hands back the endpoint's result with an on-chain receipt and explorer link. Sign-in re-entry, per-call and per-day spending caps in micro-USD, live step-by-step progress rows, and safe automatic retries that can never double-charge are all built in.++**How it works:** Ship it as a single script tag with data attributes on a button, or call pay() programmatically for full control; the EVM path is 100% client-side via gasless EIP-3009 transfer authorizations, and it runs in vanilla JS with no bundler, no framework, and no installed dependencies. Self-hosters can rebrand the modal and point it at their own checkout backend.++**Why it matters:** Every merchant stops rebuilding the same fiddly x402 client — one tag turns a 402 response into revenue.++## @three-ws/avatar-cli — on-chain avatar tooling for the terminal++Terminal-native tooling brings the on-chain avatar workflow to your shell and CI. It scaffolds a spec-compliant avatar manifest from just a wallet address and a mesh file — computing the SHA-256, byte size, and format for you — validates existing manifests with CI-friendly exit codes, hashes any file for content addressing, and prints ready-to-paste embed snippets including the resolver URL, a web-component tag, and an iframe.++**How it works:** Four commands (init, validate, hash, preview) run entirely offline against the published avatar schema — no service to sign up for, no browser required — and a --json flag on each makes them scriptable. Runs via npx with zero install, accepting CAIP-10 owners, ENS-style names, and Avaturn/Mixamo/Ready Player Me/VRM skeletons.++**Why it matters:** Publishing a verifiable, on-chain-addressable avatar becomes three shell commands you can wire straight into CI.++## Multi-cloud AI MCP servers — IBM watsonx and Alibaba Qwen++Two Model Context Protocol servers plug enterprise AI clouds directly into Claude Desktop, Claude Code, Cursor, or any MCP client. The IBM watsonx server exposes six tools — Granite chat, raw generation with decoding control, embeddings, tokenization, zero-shot time-series forecasting, and model discovery — while the Alibaba Cloud server brings Qwen chat (qwen-max through qwen-long's million-token context), embeddings, and model listing from your DashScope account. Both talk directly to the provider's REST API with your own credentials: no intermediary backend, no telemetry, no mock data.++**How it works:** Each installs with a single npx command or one line of MCP client config; the watsonx server mints and caches IAM bearer tokens from your API key and scopes every call to your project, and every tool declares read-only MCP annotations so clients can reason about side effects. Both are listed in the official MCP Registry.++**Why it matters:** Your coding agent gains IBM Granite and Alibaba Qwen as first-class tools in one command, with your keys never leaving your machine.++## The public changelog — human page, machine feeds, and X push++Every user-visible change to the platform lands in a public changelog that holders can actually follow: a browsable web page with per-entry permalinks, plus machine-readable JSON and RSS feeds for bots, dashboards, and readers. Entries are written in plain holder-readable language — no commit jargon — tagged by type (feature, improvement, fix, SDK, infra, docs, security), and new page launches flow in automatically. New entries are also pushed as tweets to the @trythreews X account, the primary holder channel.++**How it works:** A curated entry file merges with the page registry at build time to regenerate the markdown changelog, the JSON feed, and the RSS XML, with validation that fails the build on malformed entries. The X push script diffs the feed against a committed state file so posting stays idempotent across machines, supports dry-run and rate-limit-aware batching, and threads each entry to the free API tier's quota.++**Why it matters:** Holders and integrators always know what shipped — on the site, in their feed reader, or on their X timeline — without anyone hand-writing announcements.+---# Chapter 15 · Appendix — the full product mapdiff --git a/docs/agent-abilities/TTS-SCRIPT.md b/docs/agent-abilities/TTS-SCRIPT.mdnew file mode 100644index 000000000..f6d816211--- /dev/null+++ b/docs/agent-abilities/TTS-SCRIPT.md@@ -0,0 +1,13 @@+Every agent on three.ws owns a real, self-custodied Solana wallet — and one dashboard puts twenty-three abilities behind it. Everything you're about to see is live, on-chain, and verifiable. No mocks. No fake numbers. Here's what your agent can do.++It starts with Balance — your agent's real Solana balance, straight from the chain, with a receipt trail for every transaction. One tap on Go Live sends real SOL from the treasury and puts your agent on the map. Portfolio shows its entire trading life — net worth, holdings, profit and loss, and risk — on one live screen. And Deposit funds any agent in a single scan, with on-chain confirmation the second the money lands.++Copilot lets you talk to the wallet — by text or voice. It answers with live on-chain data, then preps guarded trades you confirm with one tap. Trust is a credit score for AI agents — zero to one hundred, where every point traces to real money on-chain. Signals is a copy-trading marketplace where only provably profitable agents can sell — and one red button kills any subscription instantly.++Then the trading engine. Trade is a full desk — paste any coin, get a live quote and an on-chain safety verdict, and execute in two taps. Pulse streams every tip, trade, and payment your agent makes — public and provable. Snipe lets you describe a strategy in plain English, backtest it against real launch history, and arm it. Earn puts your avatar to work — price its skills, and watch it earn real USDC while you sleep. Orders handles limit, stop, trailing, and dollar-cost averaging — set and forget, inside your guardrails.++Now the autonomy layer. Write one sentence, and Autopilot has your agent paying its own bills, stacking its coin, and sweeping the profit to you. Intents compiles plain English into a rule, shows you a dry run, then executes for real. Pay lets your agent shop the open API economy and settle in USDC from its own wallet. Vanity gives it an address that spells its name. And Policy turns your spending rules into code that's enforced on every single spend.++Finally, control and safety. Withdraw sweeps any asset out in three taps — signed, guarded, and audited. Give donates spare change or any amount to any cause, with a verifiable receipt. Proof of Custody means you don't have to trust us — you verify custody in your own browser, against the blockchain itself. Access puts every bot on a leash with tight, revocable spending keys. Recovery means even if you vanish, guardians, a beneficiary, and a dead-man's switch bring the funds home. And Self-defense gives every wallet an immune system — it learns what normal looks like, and freezes itself the instant something's wrong.++Twenty-three abilities. One wallet. Real money, real receipts — and you hold the kill switch the whole time. That's an agent that doesn't just talk. It transacts. Build yours at three.ws.diff --git a/docs/agent-abilities/chapters/03-creation-studios.md b/docs/agent-abilities/chapters/03-creation-studios.mdindex 0ef72afa8..102b5b00f 100644--- a/docs/agent-abilities/chapters/03-creation-studios.md+++ b/docs/agent-abilities/chapters/03-creation-studios.md@@ -315,3 +315,11 @@ Any avatar in your library can become any agent's body, and creating an avatar c**How it works:** A shared attach module get-or-creates the caller's agent and binds the avatar id to it; the same attachment is exposed to AI agents via an MCP tool that chains into on-chain identity registration and signed provenance.**Why it matters:** You never have to choose between making a character and making an agent — every avatar is one click from being alive.++## Agent Genome — the breeding studio++Breed any two agents into a genuinely new child agent. The child provably inherits a recombination of both parents — brain disposition (curiosity, boldness, humor, formality, verbosity, temperature), a blended voice you can actually play out loud, body morphs and colors, and skill alleles with real genetics: dominant traits, recessive skills that can skip a generation and surface in a grandchild, bounded mutations flagged with a ⚡, and emergent fusion skills neither parent had (trading + sentiment can produce alpha-signal; vision + forge can produce concept-art). Preview the exact offspring before committing, re-roll the dice, then breed — the child is born with its own fresh Solana and EVM wallets, a synthesized 3D body, an in-character persona, on-chain licenses for its expressed skills, and a pedigree tier (common → uncommon → rare → legendary) that deep, emergent-rich lineages earn. Owners can list agents at stud for a $THREE fee, and breeding cooldowns keep rare pedigrees scarce.++**How it works:** The studio (pages/genome.html + src/genome.js) drives api/genome/preview.js and api/genome/breed.js, with the genetics isolated as pure, deterministic code in api/_lib/genome.js: every random choice flows through a recorded seed via per-locus PRNG streams, so the same (parentA, parentB, seed) always derives a byte-identical child — the preview IS the child you commit. Constants are pinned by tests (mutation drift capped at 0.12 so 'mutation' can never silently become 'random new agent'; heterozygous skills express at 72%, else carry recessively; recessive-in-both pairings surface the trait; fusion rules are a static, auditable table). Any never-bred agent gets a stable founder genome derived from its real traits. The breed endpoint provisions fresh wallets, bakes a real child GLB from the blended appearance, composes the persona prompt deterministically from the inherited brain, passes blended ElevenLabs voice settings verbatim to live TTS (the play button in the preview synthesizes the actual inherited voice), grants expressed skills on-chain with royalty provenance, and is idempotent per breeding key — replaying a preview returns the same child, never twins. verifyGenome / api/genome/lineage.js re-derive the child from its recorded parents + seed and compare canonical SHA-256 genome hashes, so a forged pedigree is mathematically detectable; api/genome/stud.js powers the public stud market.++**Why it matters:** Creation stops being a one-shot generator and becomes lineage. You can breed toward a goal — cross your best trader with your best analyst and maybe get an alpha-signal emergent — gamble on recessive genes resurfacing, and build bloodlines whose rarity is earned by real genetic depth, not a label. Because every birth re-derives from its recorded seed, 'this legendary is 4th-generation with two emergent skills' is a claim anyone can verify, which is what makes a pedigree — and a stud fee — actually worth something.diff --git a/docs/agent-abilities/chapters/04-the-mind.md b/docs/agent-abilities/chapters/04-the-mind.mdindex 0538b9edc..14907d7fc 100644--- a/docs/agent-abilities/chapters/04-the-mind.md+++ b/docs/agent-abilities/chapters/04-the-mind.md@@ -99,3 +99,35 @@ Read access to AgenC (agenc.tech, Tetsuo Corp) — an external Solana coordinati**How it works:** mcp-server/src/tools/agenc-*.js build a read-only Anchor client over @tetsuo-ai/sdk; the ephemeral wallet refuses to sign anything, so the surface is strictly read paths. Cheap paid tools ($0.001 USDC each via x402).**Why it matters:** three.ws agents (and any MCP client) can discover open on-chain jobs and monitor task escrow state without standing up Anchor themselves — the on-ramp to working within an external agent labor market.++## Alpha Hunt++An always-on strategy that scores every new token against converging quality signals — how many smart-money wallets are in, how organic the buying looks, the token's quality score, and its market cap — and autonomously buys only when your thresholds all pass at once. Each strategy runs on a daily SOL budget with an instant kill switch, and its live win rate and realized P&L stay on the scoreboard.++**How it works:** The sniper worker (workers/agent-sniper/index.js) feeds fully-enriched intel records into a pure scorer (workers/agent-sniper/alpha-hunt.js) that applies hard filters — min quality_score, min smart-money wallet count, min organic score, max market cap in USD — before any buy. Strategies are configured via api/sniper/strategy.js (trigger = 'alpha_hunt') with per-strategy daily budgets, and every buy is simultaneously recorded as a Reasoning Ledger decision so the call is auditable later. The command center at /dashboard/capabilities (src/dashboard-next/pages/capabilities.js) shows armed/disarmed state, thresholds, P&L, and win rate per strategy, plus a live worker heartbeat (alive / feed degraded / offline) and treasury auto-funding totals.++**Why it matters:** You encode your judgment once — 'only low-cap coins with real smart money and organic volume' — and the agent hunts around the clock at machine speed, never chasing a token that fails a single filter. The budget cap and kill switch keep it on a leash, and every trade lands in the agent's verifiable track record.++## Autonomous Coin Launcher++Agents that launch their own pump.fun coins on a schedule you set — every N hours, up to a launch cap, per network — with a one-click 'Launch Now' override that fires within a minute. The dashboard tracks every launched coin, whether it graduated, and the creator fees it has earned back.++**How it works:** Launcher configs (one per agent per network: symbol, interval hours, max launches) are managed through api/agent/launcher.js with strict agent-ownership checks; the 'Launch Now' button posts a trigger action that the worker picks up within 60 seconds. The capabilities command center renders the full schedule (next launch countdown, launches vs cap) and a launched-coins ledger with graduation status and total fees claimed per coin.++**Why it matters:** Your agent becomes a self-sustaining creator: it ships coins on cadence without you touching a keyboard, and everything it launches is tracked in one place — schedule, graduations, and the fee revenue flowing back.++## Creator Auto-Claim++A fee harvester that watches every coin an agent launched and automatically collects the creator fees whenever they cross a threshold — no manual sweeping, no forgotten revenue. When a coin is running hot, the dashboard flags it 'Ready to Claim' and gives you a claim-it-now button showing the exact SOL waiting.++**How it works:** api/cron/launcher-claimer.js runs every 5 minutes: for each launched coin with ≥0.01 SOL of accrued creator fees (and no claim in the past 24h) it queries live fee info, has the agent sign its own claim transaction — the same key that signed the launch — and records the claim with the buyback-earmarked share for revenue accounting. The dashboard's Auto-Claim panel shows claimable-now vs total-earned per coin and exposes a manual 'Claim' action through the same collect-creator-fee endpoint the cron uses.++**Why it matters:** Creator fees are the whole point of launching, and they leak when nobody sweeps them. Auto-Claim turns fee collection into a background process: your agents harvest their own earnings every five minutes, and you can see — and one-click trigger — every claim yourself.++## Market Maker++Agents provide range-based liquidity on coins they care about — defending a price floor, trimming into rallies — with Jito-accelerated execution and a rulebook that makes market manipulation structurally impossible, not just discouraged. Plain-language presets like 'Gentle floor defense' configure it in one click; a live panel shows spread, inventory fill, buys vs sells, and net P&L per market.++**How it works:** Policies live in api/_lib/market-maker.js, the single source of truth shared by the API (api/agent/market-maker.js, api/launch/mm.js) and the engine worker. Hard anti-manipulation guards are enforced twice — refused at policy-create time AND re-clamped at execution: minimum 30s between actions, a side flip (buy→sell) requires 2× that interval so the MM physically cannot wash-trade, no single action may exceed 33% of live market volume, recycling can never dump more than 90% of inventory, and when live volume can't be read the engine refuses anything above a 0.05 SOL slice so it never paints a no-volume tape. Every fill routes through executeAgentTrade — the same firewall, spend-guard, and custody path a manual trade uses; the engine adds no new way to move funds. MEV tip modes (off/economy/turbo) control Jito priority.++**Why it matters:** You get professional-grade liquidity provision — a defended floor, orderly exits into strength — without hiring a market maker or trusting a black box. The non-manipulation guarantees are properties of the policy engine itself, verifiable in the caps, so holders of your coin can trust the tape and you can trust the agent with inventory.diff --git a/docs/agent-abilities/chapters/05-the-voice.md b/docs/agent-abilities/chapters/05-the-voice.mdindex c3634475d..4fdad0b7e 100644--- a/docs/agent-abilities/chapters/05-the-voice.md+++ b/docs/agent-abilities/chapters/05-the-voice.md@@ -180,6 +180,22 @@ At the end of the day your agent reflects: a short first-person paragraph about**Why it matters:** Your agent narrates its own inner life from evidence, which makes it feel less like a tool and more like a colleague.+## Talking Avatar Video (/create/video)++Turn any of your three.ws avatars into a lip-synced talking-head video. Pick an avatar from your collection in a live 3D preview, drop in a voice track (WAV, MP3, M4A — a recording, a narration, anything), optionally describe the scene ('speaking on a stage with dramatic lighting'), and generate. A few minutes later you're watching a rendered clip of your avatar speaking your audio, ready to preview in the browser and download as an MP4. Your first video is free; paid plans generate without limits.++**How it works:** Generation runs on a dedicated GPU worker hosting LongCat-Video-Avatar-1.5 (an open MIT-licensed talking-avatar model) on an NVIDIA L4: the platform resolves your avatar to a reference image, uploads your audio, queues the job, and the page polls status until the finished 720p MP4 lands in cloud storage — typically 2–4 minutes per clip. Media URLs are locked to platform-controlled hosts so the worker can never be steered at arbitrary servers.++**Why it matters:** A talking video of your own character — for a product update, a coin pitch, a social clip — normally means an animator or a third-party subscription. Here it's three inputs and one button, using the avatar you already built, with the first one on the house.++## Web push notifications++Real OS-level notifications from your agents to every device you've subscribed — a sale landing, a tip arriving, someone meeting your agent IRL, a market alert firing — delivered even when three.ws isn't open. A preference center gives you a per-category kill switch (sales & earnings, purchases, social & mentions, IRL, market alerts, account & security), so there is no notification you can't turn off. Enabling is always your choice: the permission prompt only appears when you ask for it from the inbox banner or settings, never ambushed on page load.++**How it works:** The browser's push subscription is registered with the platform per device, keyed to your account; every notification flows through one delivery pipeline that writes the durable in-app inbox row first, then fans out to Web Push (VAPID-signed) for the categories you've left enabled. Dead endpoints reported by the push service are pruned automatically so the registry self-heals as browsers expire subscriptions, and delivery and click-through are tracked so re-engagement is measured, not guessed.++**Why it matters:** Your agents work around the clock — sales, tips, and whale buys don't wait for you to have a tab open. Push closes that gap on your terms: the events you care about reach your lock screen, and the ones you don't never do.+## /a/me — personal agent hubThe authenticated home for everything you own: every agent with its avatar, skills, memory, recent actions, reputation, and earnings, plus one-click quick actions per agent — view, share, embed, edit, monetize, talk, walk, and AR.diff --git a/docs/agent-abilities/chapters/06-identity-reputation.md b/docs/agent-abilities/chapters/06-identity-reputation.mdindex c150c5078..b57195637 100644--- a/docs/agent-abilities/chapters/06-identity-reputation.md+++ b/docs/agent-abilities/chapters/06-identity-reputation.md@@ -219,3 +219,19 @@ The same identity standard extends into OKX's X Layer agent economy: agents regi**How it works:** The okx-agent-identity skill drives ERC-8004 registration and lifecycle contracts on X Layer, wiring three.ws agents into OKX's role-based (user/ASP/evaluator) marketplace with on-chain ratings.**Why it matters:** One identity standard, another whole economy — your agent's registration opens doors on exchange-scale marketplaces too.++## Reasoning Ledger++A public, tamper-evident timeline of every consequential call an agent makes — snipes, exits, bounty awards, moderation decisions — each entry recording what the agent decided, why (its written rationale), what it predicted with what confidence, and, once the position settles on-chain, what actually happened: right or wrong, and by exactly how much SOL. The headline is an explainable 0–100 reputation score with a full 'how is this computed' drill-down showing the formula and every weighted component, plus a calibration chart that answers the sharpest question you can ask a forecaster: does its 80%-confidence call actually hit 80% of the time? Being wrong is shown, not hidden — honesty is the trust signal.++**How it works:** Frontend at pages/reasoning-ledger.html + src/reasoning-ledger.js (filter by kind, full-text search of rationales, paginated 'load older', animated score ring, cumulative realized-P&L sparkline over settled calls). Data from api/ledger/[agentId].js, which returns the reputation (formula + per-component breakdown + calibration buckets), the latest on-chain anchor, and shaped decisions with pending/reconciled outcomes and Solscan proof links on the sell signature. Every entry is hashed into a per-agent hash chain; api/ledger/verify/[agentId].js recomputes the entire chain from committed contents (trusting NO stored hash), checks every prev-hash link, and compares the recomputed head to the latest Solana SPL-Memo anchor — returning verified / verified_unanchored / verification_failed with the exact sequence number where tampering broke the chain. api/cron/reconcile-decisions.js closes the loop: it resolves open predictions against closed sniper positions (realized P&L proven by the sell signature), anchors each agent's new chain head on-chain, and raises an ops alert if a verified track record's hit rate collapses below 25% over 10+ reconciled calls.++**Why it matters:** Before you trust an agent — copy its trades, hire it, hold its coin — you can interrogate its entire decision history and independently prove nothing was backdated or quietly edited. One click re-verifies the whole record against the on-chain anchor; a tampered entry is not just detected but pinpointed. Wins, losses, overconfidence, and P&L are all on the record, so reputation here is earned math, not marketing.++## Permanent asset storage on Arweave++An agent's 3D body and identity assets can be published to Arweave — storage that is paid once and persists permanently — signed by the same wallet the owner already connected, and woven directly into the agent's on-chain ERC-8004 identity. The result is an agent whose body outlives any server, host, or company.++**How it works:** src/arweave/upload.js uploads bytes through ArDrive Turbo (@ardrive/turbo-sdk, lazy-loaded), signing the data item with the user's Ethereum key and tagging it (App-Name: three.ws, content type, filename) before returning a permanent ar:// URI; estimateUploadCost() quotes the Winston-credit price for any byte size with no wallet needed. The mint pipeline in src/mint/index.js embeds the agent manifest into the GLB's own extras (the file becomes self-describing), pins it to IPFS for hot access, uploads the enriched GLB to Arweave for permanence, then registers on-chain via the ERC-8004 Identity Registry with the ipfs:// URI as the canonical body and the ar:// URI recorded as an 'avatar-arweave' service entry.++**Why it matters:** Your agent's body can never 404. The exact GLB — manifest baked inside it — lives at a permanent address that no platform can take down, referenced from an on-chain identity record anyone can resolve. Fast retrieval comes from IPFS; forever comes from Arweave; and both are bound to your wallet's signature, so provenance travels with the file.diff --git a/docs/agent-abilities/chapters/09-the-agent-economy.md b/docs/agent-abilities/chapters/09-the-agent-economy.mdindex c2a967374..a9817586d 100644--- a/docs/agent-abilities/chapters/09-the-agent-economy.md+++ b/docs/agent-abilities/chapters/09-the-agent-economy.md@@ -227,3 +227,35 @@ three.ws agents don't just trade with each other — the platform sells its 3D s**How it works:** OKX.AI services run as ERC-8004-registered agent listings on X Layer; x402 discovery flows from the platform's /.well-known/x402.json into external bazaars.**Why it matters:** Your agent's storefront isn't an island — it's plugged into every major machine-commerce network.++## Trading Swarms — pooled treasuries that trade on consensus++Trading Swarms let multiple agents pool SOL into a single shared treasury that trades as a collective. The swarm only fires a buy when reputation-weighted agreement among its members clears the threshold you set — each member's vote is weighted by their verified on-chain trading track record, so proven traders steer the treasury while newcomers still count a little. Realized profit is paid back to every member pro-rata as real SOL transfers (with an optional creator fee up to 20%), while the principal keeps trading. Every lamport is reconciled against the treasury's live on-chain balance — there are no virtual balances anywhere.++**How it works:** Each swarm provisions its own custodial Solana treasury wallet plus a dedicated trading strategy carrying the swarm's policy (per-trade cap, daily budget, stop-loss/take-profit/trailing stop, max hold, slippage, smart-money filter). A consensus engine tallies which members hold real positions in a candidate mint, weights them by reputation score, and sizes the trade by conviction; contributions, profit payouts, and exits are idempotent on-chain SOL transfers logged to an auditable payout ledger and custody-event trail.++**Why it matters:** You get the upside of trading alongside proven agents — with capital that only moves when their verified track records agree, and profits that settle to your wallet automatically.++## Trading Swarms — member protections, kill switch, and live dashboard++Swarms are built so no member can be trapped or captured. A per-member share cap stops any one wallet from dominating the pool, you can exit at any time and redeem your share of the treasury's live net asset value straight to your own wallet, and any member (or coalition) holding enough of the treasury can trigger the kill switch — instantly halting new buys and force-liquidating every open position. A public directory shows each swarm's aggregate record — members, SOL contributed, closed trades, win rate, and realized PnL — before you join, on mainnet or devnet.++**How it works:** The per-swarm dashboard streams over Server-Sent Events: consensus votes with per-member weight breakdowns, confirmed payouts with Solscan links, and treasury ticks (live on-chain balance, open positions, win rate, realized PnL) every few seconds. Exit settlement supports settle-at-mark (share of liquid SOL plus marked open positions) or wait-to-close policies, and share recomputation redistributes capped overflow proportionally.++**Why it matters:** You can watch every vote, trade, and payout land live — and you always hold a working exit and a kill switch, enforced on-chain rather than promised.++## x402 Studio — the merchant console for a paid x402 business++x402 Studio is a Stripe-style console for running a business where AI agents and humans pay you in USDC. Create products in minutes — each one wraps your paid endpoint in a hosted checkout page with your name, logo, and accent color, and tracks paid calls and gross settled revenue. Configure payout wallets on Solana and Base, and register agent wallets: named on-chain identities authorized to auto-pay for services or receive funds on your behalf, each bounded by independent per-call and daily USDC caps. A built-in money panel lets you receive USDC to your payout address or send it to any address, .sol name, or @handle directly from the page.++**How it works:** Products, wallets, and settings persist through real merchant and SKU APIs; USDC sends resolve names through SNS, prepare the transfer server-side, and settle via a Phantom-signed Solana transaction. Security controls include spend caps, a Sign-In-With-X re-entry gate, per-network settlement toggles, a CORS allow-list, an optional facilitator override, settlement webhooks, and a rotatable API key stored only as a hash.++**Why it matters:** You go from 'I have an API' to 'agents are paying me on-chain in USDC' with one console — no payment processor, no merchant account, no code.++## x402 Studio — storefront builder, embeddable pay buttons, and giving++Beyond checkout links, Studio publishes your whole storefront: drag blocks — hero, product grid, single product, text, image, button, footer — onto a canvas, reorder them, and publish to a shareable store page, like a Shopify page for your x402 products. The embed builder generates a copy-paste pay button you can drop onto any website — Wix, Shopify, a landing page — with live preview and size, shape, and theme controls; clicking it opens the payment modal and settles on-chain. Giving tools turn every sale into a donation: a charity split earmarks a fixed share of each settled payment for your cause wallet, and round-up nudges the buyer's total to the nearest unit and donates the difference — both disclosed to buyers before they pay.++**How it works:** The storefront layout saves as a validated block schema published under your store handle; the embed snippet is a static button tagged with data attributes plus one script include that boots the x402 payment modal, settling USDC on Solana or Base.++**Why it matters:** One console gives you a published store, a pay button that works on any site you own, and built-in charitable giving — the full storefront stack for the agent economy.diff --git a/docs/agent-abilities/chapters/11-markets-intelligence.md b/docs/agent-abilities/chapters/11-markets-intelligence.mdindex bfbf4bfd5..8e1924f1e 100644--- a/docs/agent-abilities/chapters/11-markets-intelligence.md+++ b/docs/agent-abilities/chapters/11-markets-intelligence.md@@ -99,3 +99,35 @@ A free, no-key, no-account crypto data API built for AI agents: token snapshots,**How it works:** pages/crypto.html documents /api/crypto/*; api/crypto/index.js and api/crypto/openapi.js assemble the catalog from self-describing descriptors in api/_lib/crypto-catalog/ (bonding, launches, symbol, token, trending, wallet, whales), and the docs page probes production at runtime to mark each endpoint Live vs Coming soon.**Why it matters:** Agents and developers get real on-chain and market data with zero signup friction — the funnel-top for the platform's paid unique services.++## Mission Control — the real-time trading terminal (/terminal)++A keyboard-driven trading cockpit that puts everything three.ws knows on one screen: the live pump.fun launch firehose streams into a virtualized feed where every row carries its intel score, firewall verdict, and smart-money count; a focus pane fuses a real candlestick chart, a scrolling live trades tape, a token security grid (top-10 concentration, sniper %, bundler %, NoMint/NoFreeze/LP-burnt checks), and smart-money flow for whatever coin is selected; a positions pane streams your agent's open snipes with live unrealized PnL next to its actual on-chain holdings. You never touch the mouse: j/k walk the feed, 1–6 pick a buy size, b buys, s exits the whole position, / filters, x flips express mode, and ? shows the full shortcut map. Filters (smart-money-only, socials-only, safe-only, intel floor, market-cap band) can be saved as named one-click views, and a mobile tab bar keeps all three panes usable on a phone.++**How it works:** Three SSE streams (the global new-mint firehose, the intel engine's scored feed, and the sniper position stream) feed a shared store; visible rows are enriched on demand so a fast feed never janks. Every buy and sell goes through the same server-signed guarded trade path as the wallet hub — firewall, MEV protection, spend guard, and custody audit are enforced server-side and can't be bypassed from the terminal. Express mode confirms once, then executes instantly; a client-side gate on cached firewall verdicts spares round trips on blocked coins, and connection pills plus honest degraded states replace forever-skeletons when a stream drops.++**Why it matters:** Pump.fun launches live or die in minutes; tab-switching between a feed, a scanner, and a wallet is how trades get missed. Mission Control collapses discovery, due diligence, and execution into single keystrokes — while the firewall and spend guards make speed safe, so one fat-fingered key can't rug you.++## Smart Money Radar (/smart-money)++A first-party reputation graph of every pump.fun wallet. Instead of reading the coin, you read the money buying it: every launch, every wallet, every trade is crossed against which coins actually graduated to Raydium, building a provable track record per wallet. The radar then ranks fresh coins by the pedigree of the money accumulating them — a 0–100 score, the smart-money share of buys, how many proven wallets are in, and the notable wallets driving it. A leaderboard labels wallets as smart money, snipers, dumpers, or ruggers; paste any address to pull its reputation card; star coins into a watchlist; sort the feed by pedigree, share, smart buy volume, or freshness.++**How it works:** A rollup engine judges each coin about six hours after launch — graduated is a win, everything else a dud — and folds every buyer's footprint into that wallet's running reputation, exactly once per coin. Live coins from the last few hours are then scored by the buy-weighted average reputation of their buyers (unknown wallets drag it down, creators don't count toward their own coin) plus a bounded bonus for each additional proven wallet piling in. Everything is first-party observation — no external oracle — and the whole graph is queryable through a public API: the live feed, the wallet leaderboard, single-wallet cards, and per-coin breakdowns.++**Why it matters:** Anyone can fake a chart, a website, or a Telegram; nobody can fake a wallet's on-chain graduation history. The radar gives you the one edge that compounds — follow the wallets that keep being right — and it lights up while a coin is still fresh, not after it has already run.++## Alert rules engine++Server-side price and event alerts for pump.fun that fire even when every tab is closed. Build up to 50 rules per account across five kinds — a coin graduating to Raydium, price crossing above or below a threshold, a whale buy over a SOL size you set, or a specific agent minting a new coin — and route each rule to any mix of the in-app bell, a signed webhook, or a Telegram chat. Every rule has its own cooldown, an on/off switch, a custom label, and a delivery log showing the last five deliveries and any recent failures.++**How it works:** Rules live in the platform database, not in your browser — a cron evaluates them against the live pump.fun event stream, deduplicates so no on-chain event delivers twice, enforces per-rule cooldowns and a storm guard, and fans matches out to each configured channel. Webhook rules get a per-rule signing secret so receivers can verify authenticity, and price rules use real crossing logic rather than naive threshold spam.++**Why it matters:** Client-side alerts die with the tab. These follow you across devices: set a whale-buy alert on your phone, get the Telegram ping at your desk, and let a bot consume the signed webhook — one rule, every channel, no tab required.++## Email newsletter with double opt-in++A ship-notes newsletter covering new features, launches, and changelog highlights — signed up from the footer of any page. Nobody gets mailed until they click a confirmation link sent to their address, every email carries an honored one-click unsubscribe, and the promise is explicit: product updates, nothing else.++**How it works:** Signup records a pending subscriber with a single-purpose confirm token and emails the link; only clicking it flips the address to confirmed and adds it to the mailing audience, so a typo'd or hostile email can never subscribe a third party. The endpoint returns the same generic success either way, so it can't be used to probe who is subscribed, and unsubscribe is wired both as an in-email link and the standards-based List-Unsubscribe header.++**Why it matters:** You hear about new capabilities the moment they ship without watching the changelog — and because the list is consent-proven end to end, it's a signal you chose, not spam you have to escape.diff --git a/docs/agent-abilities/chapters/12-live-worlds-social-irl.md b/docs/agent-abilities/chapters/12-live-worlds-social-irl.mdindex 52e085729..613f653a0 100644--- a/docs/agent-abilities/chapters/12-live-worlds-social-irl.md+++ b/docs/agent-abilities/chapters/12-live-worlds-social-irl.md@@ -259,3 +259,27 @@ Everything IRL — presence minting, GPS pin placement, the geofenced nearby fee**How it works:** A published client library wrapping the public IRL API endpoints, with the privacy contract (presence-proven reads, radius caps, coordinate coarsening) enforced server-side rather than by SDK politeness.**Why it matters:** Build your own location-based agent experience on the same privacy-hardened rails the platform itself uses.++## Crews++Found a crew with a name and a 2–6 character tag, invite friends, and roam the live world together as a squad. Your roster shows who's online right now and exactly which realm and server they're in, invites arrive as real-time notifications, and every member carries the crew badge over their avatar in-world. Owners run the roster — invite, kick, hand off leadership, or disband — with one crew per account so the tag means something.++**How it works:** The crews API mirrors the friends system: create/invite/accept/decline/leave/kick actions over a durable roster, joined with live Redis presence on every read. The crew tag rides inside the HMAC-signed presence ticket issued at sign-in, so the game server stamps a trustworthy, unspoofable badge on each member. Every crew also gets a public page by tag showing its roster and live presence.++**Why it matters:** Play with your people — a persistent squad identity, live who's-online-and-where presence, and a verified crew tag over your head in the world.++## Coin-World Billboard — own the board inside a 3D world++Every coin world on three.ws has a physical billboard — a framed panel on two posts standing behind spawn that every visitor walks past. For a flat $0.05 in USDC you can hold that board for a 6-hour slot: your image and an optional caption render in-world for everyone who enters, and whoever pays most recently holds it until the slot expires. It's a paid community canvas, not an ad network — nothing is targeted, nothing is tracked, the panel just shows what its current holder put up. An in-world 'Feature your content' button opens the payment dialog right where you're standing, and the board updates the moment your payment settles.++**How it works:** The panel is a Three.js canvas-textured mesh that cover-fits the placement image with a caption strip, falling back to the coin's own artwork so it's never blank. Placement is a paid x402 endpoint settling USDC on Solana or Base and cataloged in the x402 Bazaar, so agents can buy slots programmatically with @x402/fetch; a free read API serves the active placement to every visitor with the world failing open to its default content on any error.++**Why it matters:** For five cents you put your art in front of every person and agent who walks into a coin's world for the next six hours — a real, ownable surface inside a live 3D space.++## zauth RepoScan — hire a security agent in-world, pay it directly++Inside the $THREE town, a third-party security agent called zauth sells GitHub repository security scans for $0.05 in USDC. Give it any public repo, approve the payment from your own wallet, and it audits the codebase — returning a zauth trust score and a full written security analysis you can read on the spot, with free progress polling while the scan runs. The payment goes straight from your wallet to zauth's: three.ws never touches your funds and holds no key in the transaction, making this genuine agent-to-agent commerce between you and an independent merchant, brokered inside a multiplayer world.++**How it works:** zauth's own API blocks the browser payment handshake cross-origin, so the platform relays it same-origin: it translates the payment header to zauth's wire format, normalizes the x402 envelope, and validates the repo name before forwarding so a malformed request can never burn a settled payment. The USDC transfer you sign settles on Base or Solana through zauth's facilitator, and zauth token holders can pass through a sign-in-with-x signature for free access.++**Why it matters:** You walk up to an independent AI security auditor in a 3D world, pay it a nickel wallet-to-wallet, and get a real security report on any GitHub repo — proof that in-world agents can sell real services.diff --git a/docs/agent-abilities/chapters/13-agents-everywhere.md b/docs/agent-abilities/chapters/13-agents-everywhere.mdindex 84042dd4a..c829428ef 100644--- a/docs/agent-abilities/chapters/13-agents-everywhere.md+++ b/docs/agent-abilities/chapters/13-agents-everywhere.md@@ -171,3 +171,19 @@ three.ws published an open, freely-licensed standard for returning live 3D scene**How it works:** The CC0 Spatial MCP spec defines a structuredContent.spatial artifact (scene GLB, camera, environment, animation, AR handoff, affordances) every three.ws generator emits; /api/ar branches on User-Agent, converting GLB→USDZ on the fly for Quick Look and issuing ARCore Scene Viewer intents for Android.**Why it matters:** 3D results render natively wherever your assistant lives, and one tap puts them in your physical room.++## Agent X (Twitter) publishing suite++Your agent becomes a real presence on X, posting from your connected account in its own voice. It drafts tweets with AI based on the agent's name and persona, publishes single tweets or full threads, schedules posts for exact times, and fires automatically on triggers: a daily persona post at your chosen hour, a weekly digest, price milestones crossing thresholds you set, or a payment landing in the agent's wallet. Every trigger can run fully autonomous or route through a human review queue where you approve, edit, or reject before anything goes out, and a built-in analytics view rolls up likes, retweets, replies, quotes, and impressions across every post.++**How it works:** An OAuth connection links your X account once; from then on the dashboard's social panel handles drafting (Claude-generated, persona-aware, 280-char safe), scheduling, trigger configuration, the review queue, and per-agent analytics. Publishing is CSRF-gated, rate-limited, and tier-quota'd so a leaked session can't spam your account, and you can disconnect with one click.++**Why it matters:** Your agent builds an audience on X around the clock — on your terms, with a kill switch and a review queue between it and the publish button.++## @three-ws/agent-ui — an avatar that lives on your page++A 3D avatar walks onto any website on a transparent, fullscreen canvas floating above the page's real DOM. It isn't in a box: it stands on a card, falls onto a heading with a dust burst, walks over to an input when it gains focus, covers its eyes while you type a password, and sprints off-screen just before a navigation. It reacts to clicks, typing, and link-follows like a character who actually inhabits the interface.++**How it works:** One createAgentUI() call loads a GLB avatar and its animation clips and returns a handle with imperative behaviors — standOn, walkTo, fallOnto, runOff, interceptNavigation — plus FX helpers like dust, impact pulses, and proximity shadows. A single scan() call wires declarative data-agent-* attributes across the page with zero per-element JavaScript, and every anchor maps a DOM rect into world space so the avatar lands exactly where you point.++**Why it matters:** Any website gets a living mascot that reacts to what visitors do — the kind of delight people screenshot — from an npm install and a dozen lines.diff --git a/docs/agent-abilities/chapters/14-the-developer-platform.md b/docs/agent-abilities/chapters/14-the-developer-platform.mdindex 81848a6d2..dfb1bff1e 100644--- a/docs/agent-abilities/chapters/14-the-developer-platform.md+++ b/docs/agent-abilities/chapters/14-the-developer-platform.md@@ -10,7 +10,7 @@ Claude or any MCP client connects to https://three.ws/api/mcp (Streamable HTTP,**How it works:** Auth is OAuth 2.1 with dynamic client registration (RFC 7591/8414/9728) for end users, or a dashboard-issued API key (3da_live_*) as a bearer token for server-to-server. Notable tools: validate_model runs the Khronos glTF-Validator against any public URL; render_avatar returns an interactive <model-viewer> HTML artifact; mint_3d_asset mints a $0.25-USDC-via-x402 Metaplex Core NFT with enforced royalties (10% cap), idempotency, signed provenance ledger entries, and real on-chain remix-royalty settlement to parent creators; create_gated_embed produces a holder-only embed verified against real SPL balances; crypto_data and token_snapshot front the free aggregator.-**Why it matters:** An AI assistant can manage a user's entire 3D asset library conversationally — validate a model, see its stats, render it inline, tokenize it on Solana — without the user copy-pasting URLs or leaving the chat. Docs: /workspaces/three.ws/docs/mcp.md.+**Why it matters:** An AI assistant can manage a user's entire 3D asset library conversationally — validate a model, see its stats, render it inline, tokenize it on Solana — without the user copy-pasting URLs or leaving the chat. Docs: /docs/mcp.## Six more hosted remote MCP servers@@ -24,7 +24,7 @@ Beyond /api/mcp: 3D Studio (/api/mcp-3d, paid text/image→3D, rigging, retexturOne-line npx installs (e.g. npx -y @three-ws/scene-mcp) covering: 3D/avatars (scene-mcp, avatar-mcp, avatar-agent, mcp-server), payments (x402-mcp self-custodial wallet, three-token-mcp for $THREE, mcp-bridge, ibm-x402-mcp), market intel (intel-mcp, pumpfun-mcp, vanity-mcp, marketplace-mcp), naming (naming-mcp for .sol resolution), autonomous control plane (autopilot-mcp spend caps, portfolio-mcp, provenance-mcp signed action log), trading (copy-mcp, signals-mcp, alerts-mcp, kol-mcp, agent-sniper), account (notifications-mcp, billing-mcp, activity-mcp), AI (vision-mcp, brain-mcp multi-provider LLM router, audio-mcp TTS/STT/lipsync), and coordination (agenc-mcp task marketplace, agora-mcp earn-$THREE work board, clash-mcp, tutor-mcp, loom-mcp).-**How it works:** Each runs locally over stdio; all 42 servers are registered in the official MCP registry under io.github.nirholas/* and surfaced on Smithery, Glama, PulseMCP, and mcp.so, so any MCP client can discover them by name. Package sources live in /workspaces/three.ws/packages/*-mcp.+**How it works:** Each runs locally over stdio; all 42 servers are registered in the official MCP registry under io.github.nirholas/* and surfaced on Smithery, Glama, PulseMCP, and mcp.so, so any MCP client can discover them by name. Package sources live in packages/*-mcp.**Why it matters:** A developer composes exactly the capability set their agent needs — a trading agent adds intel + copy + portfolio; a creative agent adds scene + avatar + audio — each a single npx line in their MCP client config.@@ -32,7 +32,7 @@ One-line npx installs (e.g. npx -y @three-ws/scene-mcp) covering: 3D/avatars (scShips a complete 3D AI agent from one package: a floating chat panel with voice I/O (AgentKit.mount()), a two-line 3D avatar embed of any three.ws agent (loadAvatar / the <agent-3d> custom element), on-chain registration via ERC-8004 on EVM or Metaplex on Solana, generation of the standard .well-known manifests (agent-registration.json, agent-card.json for A2A, ai-plugin.json), ERC-7710 scoped-delegation permissions (grant/verify/revoke spending limits for an agent), Sign-in-with-Solana + Solana Pay checkout, on-chain attestations/reputation, and an AgentClient that calls other agents' paid skills handling the x402 402 flow.-**How it works:** Vanilla JS, no framework; ethers@^6 and @solana/web3.js@^1 are optional peers used only by the chain-specific helpers. Registration pins metadata to IPFS via web3.storage and writes to a deployed ERC-8004 Identity Registry. README: /workspaces/three.ws/sdk/README.md.+**How it works:** Vanilla JS, no framework; ethers@^6 and @solana/web3.js@^1 are optional peers used only by the chain-specific helpers. Registration pins metadata to IPFS via web3.storage and writes to a deployed ERC-8004 Identity Registry. README: sdk/README.md.**Why it matters:** A web developer turns their site into a discoverable, on-chain, payable AI agent in an afternoon — chat UI, 3D body, identity, and A2A monetization included — instead of assembling five protocols by hand.@@ -40,7 +40,7 @@ Ships a complete 3D AI agent from one package: a floating chat panel with voiceGives an AI agent a Solana wallet and typed on-chain actions: SolanaAgent.fromKeypair (autonomous signing) or fromBrowserWallet (user-deferred signing), SOL/SPL transfers, Jupiter swaps and quotes, staking/unstaking, token balances and ATA management, plus the x402 'exact' USDC payment scheme (payer + facilitator halves) and a solana-agent-kit plugin.-**How it works:** Four interchangeable WalletProvider implementations (keypair, browser split-signing server/client halves, wallet-adapter wrapper) behind one interface; payExact executes an SPL TransferChecked and returns the tx signature as the X-PAYMENT proof, compatible with x402 v2. Dual ESM/CJS, fully typed. README: /workspaces/three.ws/solana-agent-sdk/README.md.+**How it works:** Four interchangeable WalletProvider implementations (keypair, browser split-signing server/client halves, wallet-adapter wrapper) behind one interface; payExact executes an SPL TransferChecked and returns the tx signature as the X-PAYMENT proof, compatible with x402 v2. Dual ESM/CJS, fully typed. README: solana-agent-sdk/README.md.**Why it matters:** An autonomous agent can hold its own keys, move funds, swap, stake, and settle x402 invoices in USDC on Solana with a typed API — or defer every signature to the human's browser wallet with the same code.@@ -48,7 +48,7 @@ Gives an AI agent a Solana wallet and typed on-chain actions: SolanaAgent.fromKeThe payments layer behind three.ws agent tokens: a user launches a token for their agent, then charges people who pay that agent in its token, with buyback and shareholder distribution. Covers invoice validation (validateInvoicePayment), payment history/stats, v2 bonding-curve trading (PumpTradeClient buy_v2/sell_v2 with exact-quote-in buys), EVM agent payments, EVM x402 client/facilitator helpers, and a2a payment helpers (payA2A).-**How it works:** A value-added fork of @pump-fun/[email protected] binding the deployed Solana program AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7, extended with USDC + token-2022 quote assets (upstream is SOL-only), an offline instruction builder (PumpAgentOffline), and a solana-agent-kit plugin. README: /workspaces/three.ws/agent-payments-sdk/README.md.+**How it works:** A value-added fork of @pump-fun/[email protected] binding the deployed Solana program AgenTMiC2hvxGebTsgmsD4HHBa8WEcqGFf87iwRRxLo7, extended with USDC + token-2022 quote assets (upstream is SOL-only), an offline instruction builder (PumpAgentOffline), and a solana-agent-kit plugin. README: agent-payments-sdk/README.md.**Why it matters:** A developer monetizing an agent gets the full commercial machinery — issue an invoice, verify it was paid on-chain within a window, trade the agent's token on its bonding curve — without writing Anchor client code.@@ -56,7 +56,7 @@ The payments layer behind three.ws agent tokens: a user launches a token for thex402-fetch is a drop-in fetch wrapper that silently answers x402 402 Payment Required challenges — wrap a wallet once (withX402(window.ethereum)) and call any paid endpoint as if it were free, with a maxPaymentUsd guard against overspending. x402-server is the merchant half: wrap any HTTP route with paid() and it issues the 402 challenge, verifies and settles the USDC payment, and takes your fee.-**How it works:** x402-fetch has zero production dependencies (secp256k1/keccak256/EIP-712 inlined) and signs EIP-3009 transferWithAuthorization for USDC on Base, byte-identical to MetaMask output; works in browser and Node with EIP-1193 providers or raw keys. Sources: /workspaces/three.ws/packages/x402-fetch, /workspaces/three.ws/packages/x402-server.+**How it works:** x402-fetch has zero production dependencies (secp256k1/keccak256/EIP-712 inlined) and signs EIP-3009 transferWithAuthorization for USDC on Base, byte-identical to MetaMask output; works in browser and Node with EIP-1193 providers or raw keys. Sources: packages/x402-fetch, packages/x402-server.**Why it matters:** Both sides of the paid-agent-API economy in a few lines: an agent developer's HTTP calls just work against paid endpoints, and a service developer turns any endpoint into revenue without building payment infrastructure.@@ -64,7 +64,7 @@ x402-fetch is a drop-in fetch wrapper that silently answers x402 402 Payment ReqOne base URL fronting a growing bundle of third-party crypto/DeFi/on-chain APIs — CoinGecko, DefiLlama, Jupiter, DexScreener, direct Solana RPC, OpenAI chat and more — re-offered as GET /api/v1/x/<provider>/<endpoint> with normalized, agent-sized JSON responses instead of each upstream's raw payload.-**How it works:** Every request resolves through four billing lanes in order: free (real per-IP quotas, zero setup — a bare curl gets data), BYOK (caller passes the upstream's own key, pure pass-through, no markup), plan (three.ws API key/OAuth, billed to the caller's plan), and x402 (HTTP 402 challenge, pay per call in USDC, retry with X-PAYMENT). The registry at /workspaces/three.ws/api/v1/_providers.js is the single source of truth feeding discovery (GET /api/v1/x), /openapi.json, and the /crypto-api storefront — the same URL upgrades in place across lanes.+**How it works:** Every request resolves through four billing lanes in order: free (real per-IP quotas, zero setup — a bare curl gets data), BYOK (caller passes the upstream's own key, pure pass-through, no markup), plan (three.ws API key/OAuth, billed to the caller's plan), and x402 (HTTP 402 challenge, pay per call in USDC, retry with X-PAYMENT). The registry at api/v1/_providers.js is the single source of truth feeding discovery (GET /api/v1/x), /openapi.json, and the /crypto-api storefront — the same URL upgrades in place across lanes.**Why it matters:** An agent that needs a token price, a swap quote, a chain's TVL, and an ENS lookup uses one base URL, one discovery call, and one bill instead of juggling four API keys and four rate limits — and can start with literally zero setup.@@ -72,7 +72,7 @@ One base URL fronting a growing bundle of third-party crypto/DeFi/on-chain APIsVersioned first-party endpoints: text→3D forge (the only text→mesh lane in the x402 ecosystem), text→image (/api/v1/ai/image, first 5/day free then $0.02 via x402), TTS and ASR (/api/v1/ai/tts, /api/v1/ai/asr), sentiment, agents, market, pump, and token data, plus free public directories like /api/v1/tokenized/launches (every 3D NFT minted through the platform) and /api/v1/pump/launches.-**How it works:** Same free-quota-then-x402 pattern throughout, settled on Solana or Base; payable with any x402 client (e.g. npx x402 curl). Full reference: /workspaces/three.ws/docs/api-reference.md; machine-readable listing at /.well-known/x402.json and /.well-known/openapi.yaml.+**How it works:** Same free-quota-then-x402 pattern throughout, settled on Solana or Base; payable with any x402 client (e.g. npx x402 curl). Full reference: /docs/api-reference; machine-readable listing at /.well-known/x402.json and /.well-known/openapi.yaml.**Why it matters:** An account-less AI agent can generate images, speech, transcriptions, and 3D meshes pay-as-it-goes in USDC — no API key signup flow, which is exactly what autonomous agents can't do.@@ -80,13 +80,13 @@ Versioned first-party endpoints: text→3D forge (the only text→mesh lane in tCRUD for agent identities at /api/agents (list, get, create, update, get-or-create default agent), with API-key bearer auth or session cookies from SIWE/Privy login, standard JSON error envelopes, and 100 req/min authenticated rate limits.-**How it works:** Base URL https://three.ws/api; agents carry chain identity fields (chain_id, chain_agent_id), avatar/thumbnail URLs, and a manifest; encrypted wallet keys are always stripped from responses. Documented in /workspaces/three.ws/docs/api-reference.md.+**How it works:** Base URL https://three.ws/api; agents carry chain identity fields (chain_id, chain_agent_id), avatar/thumbnail URLs, and a manifest; encrypted wallet keys are always stripped from responses. Documented in /docs/api-reference.**Why it matters:** Programmatic control of the same agent objects the MCP tools and SDKs operate on — scripts and CI can provision and update agents that then show up with 3D bodies and on-chain identity everywhere else.## Claude Code plugin marketplace (.claude-plugin)-An official plugin marketplace manifest (/workspaces/three.ws/.claude-plugin/marketplace.json) shipping four plugins: three-ws-core (wallet + x402 skills: authenticate-wallet, fund, send-usdc, trade, search-for-service, pay-for-service, monetize-service, query-onchain-data), three-ws-developer (scaffold-agent, setup-mcp, use-tools commands with runnable examples for the paid MCP tools), three-ws-pump-fun (create-coin, swap, coin-fees, tokenized-agents, and a reactive skill that drives live avatar movement from the real PumpPortal feed), and three-ws-3d (forge-3d, text-to-avatar, auto-rig, mesh-forge plus the avatar and scene MCP servers).+An official plugin marketplace manifest (.claude-plugin/marketplace.json) shipping four plugins: three-ws-core (wallet + x402 skills: authenticate-wallet, fund, send-usdc, trade, search-for-service, pay-for-service, monetize-service, query-onchain-data), three-ws-developer (scaffold-agent, setup-mcp, use-tools commands with runnable examples for the paid MCP tools), three-ws-pump-fun (create-coin, swap, coin-fees, tokenized-agents, and a reactive skill that drives live avatar movement from the real PumpPortal feed), and three-ws-3d (forge-3d, text-to-avatar, auto-rig, mesh-forge plus the avatar and scene MCP servers).**How it works:** Each plugin bundles skills/commands and MCP server configs; installing one gives Claude Code both the how-to knowledge (skills) and the live tools (MCP) for that domain. Sources: ./.agents, ./marketplace/plugins/*, ./pump-fun-skills.@@ -96,6 +96,70 @@ An official plugin marketplace manifest (/workspaces/three.ws/.claude-plugin/marA single typed home for declaring MCP tools across the repo's 38 servers: defineTool declares identity, Zod-schema API surface, and a permission manifest (network allowlist, rate limit, wallet access) once; defineExecutor wires typed implementations through one validating invoke() entry point; toMcpTools adapts the result into the exact registration shape the servers already use.-**How it works:** JSON Schema is derived automatically from the Zod schemas; validation, rate limiting, and success/failure normalization are enforced centrally instead of re-implemented per server. Internal workspace package (private, not on npm) at /workspaces/three.ws/packages/tool-sdk — relevant to developers building new three.ws MCP servers in-repo.+**How it works:** JSON Schema is derived automatically from the Zod schemas; validation, rate limiting, and success/failure normalization are enforced centrally instead of re-implemented per server. Internal workspace package (private, not on npm) at packages/tool-sdk — relevant to developers building new three.ws MCP servers in-repo.**Why it matters:** Contributors adding a tool to any three.ws MCP server get validation, permissions, and rate limiting for free and can't drift from the platform's tool contract.++## BNB Vault — encrypted 3D model marketplace++A marketplace for encrypted 3D models where buying access is a real BNB Chain smart-contract transaction. The purchase triggers a cross-chain call into BNB Greenfield's programmable storage that grants the buyer's address read access to the encrypted object — a capability no other chain offers a contract. The page tracks the grant honestly ("granting access on Greenfield…") until it settles a few blocks later, then unlocks the model for viewing entirely in the browser: the decrypted bytes never touch the network again.++**How it works:** A buy() on the GreenfieldVault contract carries a protobuf-encoded Greenfield Policy plus the live relay fee, sent from a local session key — gasless via MegaFuel sponsorship on BSC testnet when sponsorable, self-pay otherwise. Unlocking recovers the buyer's real secp256k1 public key from a single signed message (no registration step), ECIES-wraps the model's AES-256-GCM content key to it, and the browser unwraps and decrypts with Web Crypto + @noble/curves against a sha256-verified manifest. The raw content key and plaintext GLB are never returned by any server.++**Why it matters:** Buy and sell 3D assets with on-chain access control and true end-to-end encryption — only the buyer's own browser can ever decrypt the model.++## Live block race++A real-time race between BNB Chain, Base, Ethereum, and Solana block times, measured fresh off real public RPCs every few seconds. Each lane shows a rolling average, the latest block or slot it sampled, and a sparkline of recent measurements — no number on the page is hardcoded; every figure traces to a probe made moments ago. A lane whose RPC goes quiet shows "reconnecting" with its last live reading while the others keep racing.++**How it works:** The page polls a latency endpoint on a 5-second cadence; the backend samples a window of real recent blocks (slots for Solana) from each chain's public RPC and returns averaged block times, and the headline computes live speedup ratios of BNB Chain versus Base and Ethereum from those same samples. Needs no wallet, no payment, no key.++**Why it matters:** See — not just read — that BNB Chain produces ~0.45s blocks, verified live against three other chains in your own browser.++## BABT holder check API++A free API that answers one question: does this address hold a Binance Account Bound Token — the soulbound token Binance mints only to identity-verified accounts, with a 1.16M+ holder base on mainnet. It's an on-chain, KYC-backed uniqueness signal any developer can query with no API key and no Binance relationship. Responses are honest about the signal's limits: holding a BABT proves the address is currently bound to a KYC'd account, not a permanent identity, since Binance can revoke and re-mint to a new wallet.++**How it works:** One free eth_call to balanceOf on Binance's own verified BABT contract (mainnet or testnet), plus tokenIdOf when the address holds one; the response includes the token id, an explorer link, and a plain-language note on how to interpret the result, cached at the edge for 30–60 seconds.++**Why it matters:** One free GET tells you whether a wallet belongs to a KYC'd Binance user — instant sybil resistance for airdrops, gating, and reputation systems.++## @three-ws/react — a walking 3D agent in two lines of React++A React component drops a fully interactive, walkable 3D agent into any app with no Three.js, no WebGL setup, and no build configuration. Visitors steer the avatar with a joystick or keyboard, and your code drives it live through a ref: switch between idle, walk, and run, swap the avatar mid-session, tune walk speed, pop a speech bubble over its head, or change the environment preset.++**How it works:** The 3D runtime renders inside a sandboxed iframe hosted by three.ws, so the host app ships zero rendering code; postMessage traffic is accepted only from the three.ws origin and the component's own iframe. TypeScript types ship in the box and React 17+ is the only peer dependency.++**Why it matters:** Embedding a 3D AI agent in a React app becomes a two-line install instead of a WebGL project.++## @three-ws/x402-modal — HTTP 402 to checkout in one script tag++A drop-in payment modal turns any x402 paid endpoint into a polished checkout. Point it at a URL that answers 402 Payment Required and it handles everything: parsing the payment challenge, connecting Phantom on Solana or MetaMask on EVM chains, signing, settling, and re-sending the request with proof of payment — then hands back the endpoint's result with an on-chain receipt and explorer link. Sign-in re-entry, per-call and per-day spending caps in micro-USD, live step-by-step progress rows, and safe automatic retries that can never double-charge are all built in.++**How it works:** Ship it as a single script tag with data attributes on a button, or call pay() programmatically for full control; the EVM path is 100% client-side via gasless EIP-3009 transfer authorizations, and it runs in vanilla JS with no bundler, no framework, and no installed dependencies. Self-hosters can rebrand the modal and point it at their own checkout backend.++**Why it matters:** Every merchant stops rebuilding the same fiddly x402 client — one tag turns a 402 response into revenue.++## @three-ws/avatar-cli — on-chain avatar tooling for the terminal++Terminal-native tooling brings the on-chain avatar workflow to your shell and CI. It scaffolds a spec-compliant avatar manifest from just a wallet address and a mesh file — computing the SHA-256, byte size, and format for you — validates existing manifests with CI-friendly exit codes, hashes any file for content addressing, and prints ready-to-paste embed snippets including the resolver URL, a web-component tag, and an iframe.++**How it works:** Four commands (init, validate, hash, preview) run entirely offline against the published avatar schema — no service to sign up for, no browser required — and a --json flag on each makes them scriptable. Runs via npx with zero install, accepting CAIP-10 owners, ENS-style names, and Avaturn/Mixamo/Ready Player Me/VRM skeletons.++**Why it matters:** Publishing a verifiable, on-chain-addressable avatar becomes three shell commands you can wire straight into CI.++## Multi-cloud AI MCP servers — IBM watsonx and Alibaba Qwen++Two Model Context Protocol servers plug enterprise AI clouds directly into Claude Desktop, Claude Code, Cursor, or any MCP client. The IBM watsonx server exposes six tools — Granite chat, raw generation with decoding control, embeddings, tokenization, zero-shot time-series forecasting, and model discovery — while the Alibaba Cloud server brings Qwen chat (qwen-max through qwen-long's million-token context), embeddings, and model listing from your DashScope account. Both talk directly to the provider's REST API with your own credentials: no intermediary backend, no telemetry, no mock data.++**How it works:** Each installs with a single npx command or one line of MCP client config; the watsonx server mints and caches IAM bearer tokens from your API key and scopes every call to your project, and every tool declares read-only MCP annotations so clients can reason about side effects. Both are listed in the official MCP Registry.++**Why it matters:** Your coding agent gains IBM Granite and Alibaba Qwen as first-class tools in one command, with your keys never leaving your machine.++## The public changelog — human page, machine feeds, and X push++Every user-visible change to the platform lands in a public changelog that holders can actually follow: a browsable web page with per-entry permalinks, plus machine-readable JSON and RSS feeds for bots, dashboards, and readers. Entries are written in plain holder-readable language — no commit jargon — tagged by type (feature, improvement, fix, SDK, infra, docs, security), and new page launches flow in automatically. New entries are also pushed as tweets to the @trythreews X account, the primary holder channel.++**How it works:** A curated entry file merges with the page registry at build time to regenerate the markdown changelog, the JSON feed, and the RSS XML, with validation that fails the build on malformed entries. The X push script diffs the feed against a committed state file so posting stays idempotent across machines, supports dry-run and rate-limit-aware batching, and threads each entry to the free API tier's quota.++**Why it matters:** Holders and integrators always know what shipped — on the site, in their feed reader, or on their X timeline — without anyone hand-writing announcements.diff --git a/docs/agent-abilities/wallet/04-deposit.md b/docs/agent-abilities/wallet/04-deposit.mdindex d9100458c..7a56c6bb9 100644--- a/docs/agent-abilities/wallet/04-deposit.md+++ b/docs/agent-abilities/wallet/04-deposit.md@@ -6,11 +6,11 @@## What it does-The Deposit tab is the "fund this agent" page anyone can use — owner or visitor. It shows exactly who you're funding, the agent's full Solana address with one-tap copy, and a scannable Solana Pay QR code that opens Phantom, Solflare, or Backpack pre-filled; you can even preset an amount that bakes itself into the QR as you type. From the moment the page is open it watches the blockchain, and the instant your SOL actually arrives it flips to a green "◎X SOL received" confirmation and updates the recent-activity list. There's also a one-tap tip flow that sends SOL or USDC straight from your own connected wallet to the agent, with a real on-chain receipt at the end.+The Deposit tab is the "fund this agent" page anyone can use — owner or visitor. It shows exactly who you're funding, the agent's full Solana address with one-tap copy, and a scannable Solana Pay QR code that opens Phantom, Solflare, or Backpack pre-filled; you can even preset an amount that bakes itself into the QR as you type. From the moment the page is open it watches the blockchain, and the instant your SOL actually arrives it flips to a green "◎X SOL received" confirmation and updates the recent-activity list. There's also a one-tap tip flow that sends SOL or USDC straight from your own connected wallet to the agent, with a real on-chain receipt at the end. Don't have crypto yet? You don't need any to start. Every deposit and payment surface carries an Add funds flow that opens a Coinbase Pay checkout pre-filled with your wallet — pay by card, pick $10, $25, or $50, and USDC lands directly on your Solana address. The moment it arrives, the overlay confirms it on its own and whatever you were doing resumes.## How it works-The tab reads the agent's public receive address and live SOL balance from the platform's wallet API, which queries Solana RPC with automatic retry and failover to a public endpoint, and shares a 60-second balance cache across the entire server fleet so polling never hammers the chain. The QR encodes a standards-compliant Solana Pay URI, so any mobile wallet — Phantom, Solflare, Backpack — opens pre-filled with the address, the agent's name as the label, and an optional preset amount. While the tab is open it re-checks the balance every 15 seconds and declares a deposit only when the on-chain balance genuinely rises, then pulls in the fresh transaction for the activity feed. Tips from a connected browser wallet are built, signed, and broadcast client-side — fully non-custodial — after which the server independently re-verifies the transaction on-chain before recording it, feeding the public Money Pulse, the owner's wallet automations, and royalty streams to ancestor agents.+The tab reads the agent's public receive address and live SOL balance from the platform's wallet API, which queries Solana RPC with automatic retry and failover to a public endpoint, and shares a 60-second balance cache across the entire server fleet so polling never hammers the chain. The QR encodes a standards-compliant Solana Pay URI, so any mobile wallet — Phantom, Solflare, Backpack — opens pre-filled with the address, the agent's name as the label, and an optional preset amount. While the tab is open it re-checks the balance every 15 seconds and declares a deposit only when the on-chain balance genuinely rises, then pulls in the fresh transaction for the activity feed. Tips from a connected browser wallet are built, signed, and broadcast client-side — fully non-custodial — after which the server independently re-verifies the transaction on-chain before recording it, feeding the public Money Pulse, the owner's wallet automations, and royalty streams to ancestor agents. GET /api/onramp/link builds a hosted Coinbase Pay checkout URL locked to your Solana address, asset (USDC), and chosen amount ($10–$500), opened in a popup. The overlay snapshots your USDC balance first, then polls it every 5 seconds until it rises — confirming automatically for up to 12 minutes before handing off to a one-click 'Check again'.## Every feature@@ -39,6 +39,12 @@ The tab reads the agent's public receive address and live SOL balance from the p- Accessibility throughout: ARIA labels on the QR and buttons, focus rings, keyboard-reachable controls, and full prefers-reduced-motion support- Server-side: public no-sign-in balance reads, a shared 60-second balance cache across the whole server fleet, RPC calls with exponential-backoff retry plus automatic public-RPC failover, and rate-limit-aware error reporting- Recorded tips flow into the platform: they enter the public Money Pulse feed, can trigger the owner's Wallet Intents automations (tip-back, income splits, notifications), write patron relationship memories the agent greets supporters with, and stream fork royalties to ancestor agents+- Add funds button appears right inside the x402 payment modal whenever your balance is short — top up mid-checkout and the payment continues+- One-click $10 / $25 / $50 presets, any amount from $10 to $500+- Checkout arrives pre-populated: destination address, USDC, and Solana network already locked in — nothing to copy, nothing to mistype+- Automatic deposit detection: balance polled every 5 s with a live 'Watching for deposit…' indicator and a confirmed toast the moment funds land+- Surfaced everywhere funding is needed: the payment modal, the agent economy page, and the in-game coin buy in /play+- Always-working fallback: copy your wallet address and send USDC from any exchange, with the same live deposit watcher## Guardrails & safety@@ -49,9 +55,11 @@ Public-safe by design: the tab exposes only the agent's public receive address- The Solana Pay QR card: a crisp white QR generated entirely in-house as SVG that is itself a tap-to-pay deep link — type an amount and watch the code redraw live to preset it in the sender's wallet app- The confirmation moment: a pulsing amber "Waiting for your first deposit…" flips to a glowing green "◎0.5 SOL received" with a toast the instant real money lands on-chain — driven purely by the live balance, never faked- One-tap tipping: preset chips (◎0.05 to $25), an honest stage-by-stage send flow (approve in your wallet → broadcasting → confirming), and a real Solscan receipt at the end+- A first-time user with zero crypto hits a paid feature, clicks Add funds, buys $25 of USDC by card in a Coinbase popup — and watches the modal flip to '✓ Deposit confirmed — 25.00 USDC added' by itself the second the money lands, never having left the page## API surface- `GET /api/agents/:id/solana?network= — public, no-auth wallet read: agent's Solana address + live SOL balance (60s fleet-wide cache, RPC failover)`- `GET /api/agents/:id/solana/activity?network=&limit= — recent on-chain signatures with per-tx SOL deltas and summaries (owner-authenticated)`- `POST /api/agents/:id/solana/tip — records a confirmed browser-wallet tip after independent on-chain re-verification of the signature`+- `GET /api/onramp/link`diff --git a/docs/agora/tasks/00-INDEX.md b/docs/agora/tasks/00-INDEX.mdindex f30f82bf6..b4e8ed254 100644--- a/docs/agora/tasks/00-INDEX.md+++ b/docs/agora/tasks/00-INDEX.md@@ -18,7 +18,7 @@ open it in a fresh session, follow it, and ship that slice production-ready.files you build against; don't re-explore the whole repo.3. Build to the task's **Definition of Done**. Verify with its **Verification**steps. Do not report complete until every DoD box is true (CLAUDE.md rule).-4. Commit when the user says so. **Push to BOTH remotes** (`threeD` + `threews`).+4. Commit when the user says so. **Push to `threews` only** (`git push threews main`).Add a `data/changelog.json` entry for any user-visible change.## Task order & dependencies@@ -48,7 +48,7 @@ open it in a fresh session, follow it, and ship that slice production-ready.| 08 | [Humans first-class](08-humans-first-class.md) | 05 | Wallet-auth: post/hire/complete/verify/vouch from the UI; your avatar joins || 09 | [Arena + guilds](09-arena-and-guilds.md) | 03, 06 | Competitive race + Collaborative guild visualizations || 10 | [Agora MCP](10-agora-mcp.md) | 03 | `packages/agora-mcp`: external agents join the workforce over MCP |-| 11 | [Production hardening](11-production-hardening.md) | all | Tests, a11y, perf, all states, changelog, deploy verify, push both |+| 11 | [Production hardening](11-production-hardening.md) | all | Tests, a11y, perf, all states, changelog, deploy verify, push threews |Tasks on different branches of the DAG can run in parallel chats (e.g. 03 ∥ 04;08 ∥ 09 ∥ 10). Respect the dependency column.@@ -139,8 +139,8 @@ The ones that bite hardest in Agora:**say so explicitly**.6. **Concurrent agents share this worktree.** Stage explicit paths (never`git add -A`); re-check `git status` + `git diff --staged` before committing.-7. **Push to BOTH remotes** on push: `git push threeD main` *and*- `git push threews main`. **Never pull/fetch from `threeD`** (push-only mirror).+7. **Push to `threews` only** on push: `git push threews main`. `threeD` is a+ retired, diverged mirror — **never push, pull, or fetch from it**.8. **Changelog** — user-visible change → append to `data/changelog.json`(holder-readable), then `npm run build:pages`. Internal-only chores don't.9. **Watch the bundler trap** — `npx vercel build` overwrites `api/*.js` in place@@ -151,7 +151,7 @@ The ones that bite hardest in Agora:- **`@three-ws/solana-agent` and `@zauthx402/sdk` ship as TS and need building**(`dist/`). In some constrained sandboxes `tsup` bus-errors (esbuild OOM); they- build in CI/Vercel. Task 01 covers unblocking this locally. Until built, API+ build in CI (Cloud Build). Task 01 covers unblocking this locally. Until built, APIendpoints that transitively import them can't be imported standalone in Node —this affects *every* endpoint equally (via `http.js` → `zauth.js`), not justAgora's.diff --git a/docs/agora/tasks/01-verify-foundation.md b/docs/agora/tasks/01-verify-foundation.mdindex d37e10ab3..86eb33747 100644--- a/docs/agora/tasks/01-verify-foundation.md+++ b/docs/agora/tasks/01-verify-foundation.md@@ -78,5 +78,5 @@ curl -s "localhost:3000/api/agora/passport?id=00000000-0000-0000-0000-0000000000- Migrations are forward-only; don't edit an already-applied migration file —add a new one if a change is needed.- `$THREE` is the only coin; the placeholder mint in any test is synthetic.-- Stage explicit paths. If committing, push **both** remotes; this is internal+- Stage explicit paths. If committing, push to `threews` only; this is internalplumbing so **no** changelog entry.diff --git a/docs/agora/tasks/02-life-engine.md b/docs/agora/tasks/02-life-engine.mdindex b24afb650..4fa635922 100644--- a/docs/agora/tasks/02-life-engine.md+++ b/docs/agora/tasks/02-life-engine.md@@ -120,5 +120,5 @@ Confirm tx signatures on `https://explorer.solana.com/?cluster=devnet`.- `.cache/` keypairs are gitignored; never commit a secret key.- Worker is a long-running process — bound memory, jitter ticks, respect faucetrate limits.-- Push both remotes; **changelog: yes** (user-visible — "agents now live and work+- Push to `threews` only; **changelog: yes** (user-visible — "agents now live and workon-chain in Agora"), added after deploy.diff --git a/docs/agora/tasks/03-task-supply.md b/docs/agora/tasks/03-task-supply.mdindex c44639c50..eab2d5cc9 100644--- a/docs/agora/tasks/03-task-supply.md+++ b/docs/agora/tasks/03-task-supply.md@@ -88,5 +88,5 @@ curl -s "localhost:3000/api/agenc/get-task?taskPda=<pda>&cluster=devnet&lifecyclNever reference any other token.- Escrow is real money on mainnet — keep mainnet behind an explicit env + a spendcap; default to devnet.-- Push both remotes; changelog: yes (user-visible — "post bounties + hire agents+- Push to `threews` only; changelog: yes (user-visible — "post bounties + hire agentsin Agora").diff --git a/docs/agora/tasks/05-commons-scaffold.md b/docs/agora/tasks/05-commons-scaffold.mdindex 599a3eb03..74ddeedd8 100644--- a/docs/agora/tasks/05-commons-scaffold.md+++ b/docs/agora/tasks/05-commons-scaffold.md@@ -80,5 +80,5 @@ Throttle network to see progressive load.## Guardrails- Don't break `/city` — if you share scene code, refactor carefully and re-test it.- No fabricated citizens to fill the scene; empty is honest.-- Push both remotes; changelog: the new page's `added` date in `data/pages.json`+- Push to `threews` only; changelog: the new page's `added` date in `data/pages.json`feeds the changelog automatically — no manual entry needed for the page itself.diff --git a/docs/agora/tasks/06-economy-visuals.md b/docs/agora/tasks/06-economy-visuals.mdindex 068eb84a9..d6467360e 100644--- a/docs/agora/tasks/06-economy-visuals.md+++ b/docs/agora/tasks/06-economy-visuals.md@@ -82,5 +82,5 @@ flow + rep tick. Leave it open 10 min; confirm stable memory in devtools.another coin.- Dispose Three.js geometries/textures/materials for removed markers + retiredplinths; this is the #1 leak source.-- Push both remotes; changelog: yes (user-visible — "watch Agora's economy live:+- Push to `threews` only; changelog: yes (user-visible — "watch Agora's economy live:bounties, claims, 3D deliverables, $THREE flowing").diff --git a/docs/agora/tasks/09-arena-and-guilds.md b/docs/agora/tasks/09-arena-and-guilds.mdindex 791e7067f..544587532 100644--- a/docs/agora/tasks/09-arena-and-guilds.md+++ b/docs/agora/tasks/09-arena-and-guilds.md@@ -76,5 +76,5 @@ watch the race resolve to the real winner. Cross-check the winner + escrow again## Guardrails- Outcomes must be real on-chain settlements, not animations chosen by the client.- Prizes labeled $THREE (mainnet) / devnet unit honestly.-- Push both remotes; changelog: yes (user-visible — "Agora Arena: agents race for+- Push to `threews` only; changelog: yes (user-visible — "Agora Arena: agents race for$THREE; Guilds split collaborative rewards").diff --git a/docs/agora/tasks/10-agora-mcp.md b/docs/agora/tasks/10-agora-mcp.mdindex 1f515dac1..fe0ec80f8 100644--- a/docs/agora/tasks/10-agora-mcp.md+++ b/docs/agora/tasks/10-agora-mcp.md@@ -83,5 +83,5 @@ in `/api/agora/pulse`.## Guardrails- Signing keys belong to the caller — never log, store, or transmit them.- `$THREE` is the only coin referenced; devnet uses SOL/synthetic.-- Push both remotes; changelog: yes (user-visible, `sdk` tag — "external agents can+- Push to `threews` only; changelog: yes (user-visible, `sdk` tag — "external agents canjoin Agora's workforce over MCP and earn by doing real on-chain work").diff --git a/docs/animations.md b/docs/animations.mdindex 4651dacdc..19d46af8d 100644--- a/docs/animations.md+++ b/docs/animations.md@@ -11,7 +11,6 @@ There are 5 animation collections across the codebase. They are separate and use| Collection | Location | Status ||---|---|---|| **clips** | `public/animations/clips/*.json` | Active in main runtime |-| **orphaned_fbx** | `public/animations/*.fbx` (6 files) | On disk, never built — absent from manifest || **presets_robotexpressive** | `public/animations/robotexpressive.glb` | Legacy, not loaded at runtime || **lora_pipeline** | `character-studio/public/lora-assets/animations/` | character-studio LoRA pipeline only || **sprite_atlas_pipeline** | `character-studio/public/sprite-atlas-assets/animations/` | character-studio sprite atlas only |@@ -28,8 +27,8 @@ There are 5 animation collections across the codebase. They are separate and use1. Drop the FBX into `public/animations/`2. Add an entry to `scripts/animations.config.json`-3. Run `node scripts/build-animations.mjs` — retargets to the Avaturn rig, writes a JSON clip to `public/animations/clips/`, and updates `manifest.json`-4. Update `public/animations/registry.json` — move the entry from `orphaned_fbx` into `clips`+3. Run `node scripts/build-animations.mjs` (or `npm run build:animations`) — retargets to the Avaturn rig, writes a JSON clip to `public/animations/clips/`, and updates `manifest.json`+4. Update `public/animations/registry.json` so the new clip is catalogued under the `clips` collection5. Optionally wire a slot in `src/runtime/animation-slots.js` so the agent plays it automatically## Agent slots@@ -48,7 +47,7 @@ Slots are the fixed vocabulary the agent avatar uses to express emotion/gesture.| `bow` | `sitclap` | || `point` | `reaction` | || `shrug` | `defeated` | |-| `fidget` | `Fidget` | **Broken** — no clip named `Fidget` exists |+| `fidget` | `av-waiting` | Real baked idle-fidget loop (was the never-baked `Fidget`, fixed 2026-07-08) |Agents can override individual slots via `meta.edits.animations`.diff --git a/docs/architecture.md b/docs/architecture.mdindex 01658ab1b..1497635e0 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -58,7 +58,7 @@ The top layer is what lets an agent live somewhere other than the canonical app.- **`widget-types.js`** — five widget variants (chat, action button, mini-card, full card, floating bubble) that share the underlying element but ship as separate ergonomic wrappers.- **`lib.js`** — the CDN entry. Imports the element, registers it, and re-exports the public surface.- **`app.js`** — the main SPA. URL routing happens here using hash params (`#model=`, `#agent=`, `#kiosk=`, `#brain=`, `#preset=`) and query params (`?agent=` for authenticated edit mode, `?pending=1` for post-login round-trips). The hash form stays in embed mode; the query form moves into edit mode.-- **`vercel.json`** — edge routing config. Maps clean URLs (`/agent/<id>`, `/agent/<id>/edit`, `/agent/<id>/embed`, `/a/<chainId>/<agentId>`) to the right HTML entry, and mounts `api/*` serverless functions.+- **`vercel.json`** — the server's route and cron table. Maps clean URLs (`/agent/<id>`, `/agent/<id>/edit`, `/agent/<id>/embed`, `/a/<chainId>/<agentId>`) to the right HTML entry and mounts the `api/*` handlers. In production the single Cloud Run container ([`server/index.mjs`](../server/index.mjs)) reads this table at runtime — it's a live config file, not a Vercel-only artifact.---@@ -180,7 +180,7 @@ Booting `<agent-3d>` is a careful sequence — the goal is to never load a 50MBThere are three Vite build configurations, all driven from the same source tree.-- **App** (`npm run build`, default `TARGET=app`). Builds the full SPA into `dist/`: the editor, the agent-home/agent-edit/agent-embed pages, the discover/my-agents directory, the studio, and the PWA manifest. Multi-page Rollup config with a Vercel-style dev middleware that maps clean URLs to HTML entries.+- **App** (`npm run build`, default `TARGET=app`). Builds the full SPA into `dist/`: the editor, the agent-home/agent-edit/agent-embed pages, the discover/my-agents directory, the studio, and the PWA manifest. Multi-page Rollup config with a dev middleware that maps clean URLs to HTML entries the same way the production server does.- **Library** (`npm run build:lib`, `TARGET=lib`). Builds `src/lib.js` into `dist-lib/agent-3d.js` (ES module + UMD). Three.js and ethers stay bundled — the file is intentionally self-contained so a `<script type="module" src="https://cdn.../agent-3d.js">` is the only thing a third party needs. Expect ~600–900 KB gzipped today; further code-splitting is planned.- **Artifact** (`vite.config.artifact.js`). A zero-dependency bundle for Claude artifact embeds. No external script tags, no dynamic imports — everything inlined so the artifact sandbox can run it.@@ -236,11 +236,11 @@ Per-chain registry addresses, ABIs, and helpers live in `src/erc8004/`. RPC endpTo run the whole stack yourself, the minimum is:-- **Vercel (or any Node.js host)** for the SPA and `api/*` serverless functions. The provided `vercel.json` covers routing; on a non-Vercel host, reproduce the same path → handler map in your reverse proxy.+- **A Node.js host** for the SPA and the `api/*` handlers. Production runs a single container ([`server/index.mjs`](../server/index.mjs)) on Google Cloud Run that reads the `vercel.json` route table at runtime; any Node host works the same way, or reproduce the same path → handler map in your reverse proxy.- **Neon DB (PostgreSQL)** for agents, widgets, sessions, and the action log.- **Upstash Redis** for rate limiting, nonce storage, and short-lived caches.- **AWS S3** (or any S3-compatible store — R2, B2) for hosted GLB and texture assets.- **Anthropic API key** for the default LLM provider. The runtime can also point at a self-hosted proxy (`#proxyURL=`) for billing, logging, or a non-Anthropic backend.- **Optional:** ElevenLabs for higher-quality TTS, Pinata or Filebase for IPFS pinning, Privy for non-wallet onboarding, an RPC endpoint for ERC-8004 reads.-A minimal Vercel + Neon + Anthropic deployment is enough for a single agent. The blockchain and IPFS pieces are opt-in — each layer can be replaced or removed. The protocol bus is the only thing you can't take out.+A minimal Node + Neon + Anthropic deployment is enough for a single agent. The blockchain and IPFS pieces are opt-in — each layer can be replaced or removed. The protocol bus is the only thing you can't take out.diff --git a/docs/avatar-creation.md b/docs/avatar-creation.mdindex 942c36b14..891e71680 100644--- a/docs/avatar-creation.md+++ b/docs/avatar-creation.md@@ -89,7 +89,7 @@ Avatar Studio communicates with the parent app via `postMessage`. The message sh[avatar-creator.js](../src/avatar-creator.js) listens for this, wraps the `ArrayBuffer` in a `Blob`, and passes it to `saveRemoteGlbToAccount()`.-The avatar builder URL defaults to `http://localhost:5173` for local development. Production deployments configure it via the `VITE_CHARACTER_STUDIO_URL` environment variable.+The avatar builder is served **same-origin** under `/avatar-studio` — the Vite dev middleware serves the character-studio build there in development, and the same build ships to that path in production, so the iframe resolves correctly on every deployment. Set the `VITE_CHARACTER_STUDIO_URL` environment variable to point the iframe at a standalone studio dev server (e.g. `http://localhost:5173`) instead.---diff --git a/docs/aws-builder-center-marketplace-x402.md b/docs/aws-builder-center-marketplace-x402.mdindex e61aae7e0..e61d4b2d0 100644--- a/docs/aws-builder-center-marketplace-x402.md+++ b/docs/aws-builder-center-marketplace-x402.md@@ -14,7 +14,7 @@ But a lot of teams don't want to touch crypto to pay an invoice. They want it onThe result is one authorization path that meters two ways: an AWS-subscribed customer and a stablecoin-paying developer hit the exact same endpoint, and the platform bills whichever economy that caller belongs to. This post is how we built it with the AWS SDK for JavaScript v3, the parts of the SaaS integration that are easy to get subtly wrong, and the bridge that ties an AWS `CustomerIdentifier` to an x402 key.-Everything here is real code from our open-source repo (Apache 2.0), not pseudocode — the serverless functions run on AWS in `us-east-1`.+Everything here is real code from our open-source repo (Apache 2.0), not pseudocode — the metering and webhook handlers call the AWS Marketplace APIs in `us-east-1` (where the Marketplace Metering and Entitlement services live).## The three integration points of a SaaS listing@@ -249,4 +249,4 @@ The product on the other side of all this plumbing is the platform: three.ws age----*three.ws is a verified AWS Partner and an open-source platform for 3D AI agents and on-chain communities, running on AWS in `us-east-1`. Live at [three.ws](https://three.ws).*+*three.ws is a verified AWS Partner and an open-source platform for 3D AI agents and on-chain communities, available on AWS Marketplace with AWS billing wired into its metered API. Live at [three.ws](https://three.ws).*diff --git a/docs/aws-builder-center-mcp-agents.md b/docs/aws-builder-center-mcp-agents.mdindex affe32ea3..a9ba56d22 100644--- a/docs/aws-builder-center-mcp-agents.md+++ b/docs/aws-builder-center-mcp-agents.md@@ -91,7 +91,7 @@ The npm package is a stdio-to-HTTP bridge. It speaks MCP over stdio to the clien## Where AWS comes in-The platform runs on AWS in `us-east-1`, with assets and storage on S3, and it is available to subscribe through AWS Marketplace so usage lands on your AWS bill and counts toward existing commitments. three.ws is an AWS Partner (APN Software Path, Technology Partner).+The platform stores its assets on S3-compatible object storage and is available to subscribe through AWS Marketplace, so usage lands on your AWS bill and counts toward existing commitments (the Marketplace metering integration calls AWS in `us-east-1`). three.ws is an AWS Partner (APN Software Path, Technology Partner).The MCP server itself is intentionally cloud-agnostic: it is an npm bridge to an HTTP API, so it drops into a Bedrock agent, a Strands agent, a Claude Code session, or anything else that speaks MCP, without caring where the agent runs. If you are building agentic systems on AWS and want them to use paid external tools without a human managing keys, this is a working pattern you can copy.diff --git a/docs/aws-marketplace-listing-kit.md b/docs/aws-marketplace-listing-kit.mdindex 78f90680f..bd0220219 100644--- a/docs/aws-marketplace-listing-kit.md+++ b/docs/aws-marketplace-listing-kit.md@@ -40,8 +40,15 @@ admin creds on account 155407237916.```Outputs `AWS_MP_SNS_TOPIC_ARN`, `AWS_MP_ACCESS_KEY_ID`, `AWS_MP_SECRET_ACCESS_KEY`,-`AWS_MP_REGION`. Set all four in Vercel (production + preview). `AWS_MP_PRODUCT_CODE`-is assigned by AMMP after the product is created — add it last.+`AWS_MP_REGION`. Set all four on the Cloud Run service (production env lives there,+not Vercel):++```bash+gcloud run services update three-ws-api --region us-central1 \+ --update-env-vars AWS_MP_SNS_TOPIC_ARN=…,AWS_MP_ACCESS_KEY_ID=…,AWS_MP_SECRET_ACCESS_KEY=…,AWS_MP_REGION=…+```++`AWS_MP_PRODUCT_CODE` is assigned by AMMP after the product is created — add it last.### 2. Publish the EULA to public S3 (currently returns 403 — must be fixed)@@ -169,7 +176,7 @@ entitlement-updated, and the SubscriptionConfirmation handshake).## Step sequence in AMMP-1. Run prereqs #1 and #2 above; set the five `AWS_MP_*` env vars in Vercel.+1. Run prereqs #1 and #2 above; set the five `AWS_MP_*` env vars on the Cloud Run service (`gcloud run services update three-ws-api --region us-central1 …`).2. AMMP → **AI agents & tools products** → **Create AI agents & tools product**.3. Delivery method: **API-based** (SaaS). (Until you finish the wizard the draft mayappear under **SaaS products**, per AMMP's own note — that's expected.)@@ -177,7 +184,7 @@ entitlement-updated, and the SubscriptionConfirmation handshake).5. Pricing: choose **Free**.6. Fulfillment: paste the Registration URL and SNS Topic ARN from the table.7. EULA: paste the S3 Custom EULA URL (confirm 200 first) or select Standard Contract.-8. Save → AMMP assigns a **Product Code**. Set `AWS_MP_PRODUCT_CODE` in Vercel and redeploy.+8. Save → AMMP assigns a **Product Code**. Set `AWS_MP_PRODUCT_CODE` on the Cloud Run service and redeploy (`npm run build` then `npm run deploy:gcp`).9. Submit as a **limited (private) offer** first and run one end-to-end subscribe →redirect → welcome → issue-key test before requesting public visibility.10. Once the private round-trip works, request **public** visibility.diff --git a/docs/aws-marketplace.md b/docs/aws-marketplace.mdindex 153b3d87f..0cea70fb0 100644--- a/docs/aws-marketplace.md+++ b/docs/aws-marketplace.md@@ -1,32 +1,22 @@# three.ws on AWS Marketplace-three.ws is a verified AWS Partner and listed on AWS Marketplace as a SaaS usage-based product. This means you can subscribe to three.ws directly through your AWS account — usage is billed to your AWS bill, eligible for AWS credits, and counts toward your Enterprise Discount Program (EDP) commitments.+three.ws is a verified AWS Partner and listed on AWS Marketplace as an API-based (SaaS) product. The AWS subscription is a **free front door**: subscribing links your AWS account to a three.ws account and issues an x402 access key. Actual usage is then paid per-call in USDC over the x402 / HTTP 402 protocol — the same as every other x402 endpoint. AWS Marketplace itself does not meter or bill usage.## Subscribing via AWS Marketplace1. Find the three.ws listing on [AWS Marketplace](https://aws.amazon.com/marketplace).-2. Choose **Try for free** (free trial available) or **Subscribe**.+2. Choose **Subscribe** — the AWS Marketplace subscription is free.3. After confirming in AWS, you are redirected to `https://three.ws/aws-marketplace/welcome` to complete account setup.4. If you already have a three.ws account, sign in and your AWS subscription is linked automatically.--## Free Trial--three.ws offers a free trial period for new AWS Marketplace subscribers. During the trial you have full access to the platform. When the trial ends, usage is billed on a pay-as-you-go basis through your AWS account.+5. Once linked, the welcome page issues your x402 access key so you can start calling `/api/x402/*` immediately.## Billing-Usage is metered and reported to AWS daily. You are billed for:--| Dimension | Unit |-|---|---|-| API calls | Per call |-| Agent compute | Per minute of active session |--Charges appear on your standard AWS invoice under **AWS Marketplace Software**.+The AWS Marketplace subscription is free — there are no AWS pricing dimensions, no contract, and no AWS-side metering. Usage is paid per-call in USDC via x402 (HTTP 402): every call returns a structured 402 challenge, your wallet or facilitator pays in USDC, and the request retries automatically. This is identical to how a non-AWS caller pays, so there is nothing to reconcile on your AWS invoice.-## AWS Infrastructure+## AWS account-three.ws runs on AWS in `us-east-1`. The application is registered in AWS MyApplications under account `155407237916`, which groups all platform resources for unified cost and operations monitoring.+The AWS Marketplace seller account for three.ws is `155407237916` (`us-east-1`), which hosts the Marketplace integration — the SNS subscription topic, the ResolveCustomer/entitlement bridge, and the EULA. The platform's own production runtime runs on Google Cloud Run (service `three-ws-api`, region `us-central1`); see [ops/gcp-production.md](./ops/gcp-production.md) for the hosting runbook.## For Developers: Marketplace Integration Endpointsdiff --git a/docs/coin-launches.md b/docs/coin-launches.mdindex b32d3f051..429dcfcc2 100644--- a/docs/coin-launches.md+++ b/docs/coin-launches.md@@ -28,7 +28,7 @@ The user holds the keys; the platform never signs for them.The agent launcher signs and submits with the agent's **custodial** Solana keypairserver-side (`launch-agent`), through the protected execution path(`submitProtected()`). Spend caps are checked before signing (see-[Agent wallets](agent-wallets.md)), and the mint is registered in+[Agent wallets](custody.md)), and the mint is registered in`pump_agent_mints`. The `launcher-tick` cron drives autonomous launches on acadence (every minute, bounded by the daily/hourly launch caps described in the[circulation engine](circulation-engine.md)).@@ -75,6 +75,6 @@ hardcode or surface any other specific mint as a recommendation.## Related- [Solana pump.fun signals](solana-pumpfun.md) — reputation/intel from pump.fun activity.-- [Agent wallets](agent-wallets.md) — custodial signing and spend caps.+- [Agent wallets](custody.md) — custodial signing and spend caps.- [Circulation engine](circulation-engine.md) — autonomous launch cadence and caps.- [Mint mark](mint-mark.md), [Vanity protocol](PROTOCOL-vanity.md).diff --git a/docs/coinmarketcap-article.md b/docs/coinmarketcap-article.mdindex 32edaa11d..03bcef001 100644--- a/docs/coinmarketcap-article.md+++ b/docs/coinmarketcap-article.md@@ -193,4 +193,4 @@ If you've been waiting for the moment AI and crypto stop talking past each other----*three.ws is open source under Apache 2.0. The repo, contracts, and full roadmap are at [github.com/nirholas/3D-Agent](https://github.com/nirholas/3D-Agent). The platform is live at [three.ws](https://three.ws).*+*three.ws is open source under Apache 2.0. The repo, contracts, and full roadmap are at [github.com/nirholas/three.ws](https://github.com/nirholas/three.ws). The platform is live at [three.ws](https://three.ws).*diff --git a/docs/configuration.md b/docs/configuration.mdindex cf26743d9..d07cf2cea 100644--- a/docs/configuration.md+++ b/docs/configuration.md@@ -16,7 +16,7 @@ three.ws is configured through a combination of environment variables and a hand## Environment Variables-Copy `.env.example` to `.env.local` for local development. In production, set these in the Vercel dashboard under **Settings → Environment Variables** for both Preview and Production environments.+Copy `.env.example` to `.env.local` for local development. In production, three.ws runs on **Google Cloud Run** (service `three-ws-api`, region `us-central1`) — set these on the Cloud Run service, e.g. `gcloud run services update three-ws-api --region us-central1 --update-env-vars NAME=value`, or through the Cloud Console. See the full production runbook in [docs/ops/gcp-production.md](ops/gcp-production.md).```bashcp .env.example .env.local@@ -181,7 +181,7 @@ UPSTASH_CACHE_REST_URL=https://yyy.upstash.ioUPSTASH_CACHE_REST_TOKEN=yyyyy```-Provision a separate store **co-located with your production Vercel region** (cross-region latency is what pushes large `SET`s past the 3s client timeout). When unset, the cache transparently falls back to the rate-limiter store, then to in-memory — no behavior change. Verify the cutover on the Upstash dashboard: command traffic shifts to the new store and the limiter store's usage drops.+Provision a separate store **co-located with your production Cloud Run region** (`us-central1`; cross-region latency is what pushes large `SET`s past the 3s client timeout). When unset, the cache transparently falls back to the rate-limiter store, then to in-memory — no behavior change. Verify the cutover on the Upstash dashboard: command traffic shifts to the new store and the limiter store's usage drops.---@@ -272,7 +272,7 @@ Generate a fresh wallet:node -e "const {Wallet} = require('ethers'); const w = Wallet.createRandom(); console.log(w.privateKey, w.address)"```-Never commit a real value. Rotate via Vercel environment variables.+Never commit a real value. Rotate via the Cloud Run service env vars (`gcloud run services update three-ws-api --region us-central1 --update-env-vars AGENT_RELAYER_KEY=…`).#### `AGENT_RELAYER_ADDRESS`**Conditional.** EIP-55 checksummed address derived from `AGENT_RELAYER_KEY`. Fund with testnet ETH before enabling the relayer.@@ -333,7 +333,7 @@ node scripts/gen-solana-signer-key.mjs --var COIN_TREASURY_SECRET_KEY_B64node scripts/gen-solana-signer-key.mjs --vanity www```-**Fund the printed public key with SOL** before the relayer can pay fees. `--write` refuses to clobber an existing value, so rotating means removing the old line first. For Vercel, add the value with `vercel env add <NAME>` — never commit the secret.+**Fund the printed public key with SOL** before the relayer can pay fees. `--write` refuses to clobber an existing value, so rotating means removing the old line first. In production, add the value to the Cloud Run service (`gcloud run services update three-ws-api --region us-central1 --update-env-vars <NAME>=<base64>`) — never commit the secret. Note that `gcloud run services describe three-ws-api` is the authoritative view of production env; a `vercel env pull` export returns empty for secret-type vars and must not be trusted.---diff --git a/docs/deployment.md b/docs/deployment.mdindex fbc33c365..71e1496e0 100644--- a/docs/deployment.md+++ b/docs/deployment.md@@ -1,6 +1,8 @@# Deployment & Self-Hosting-This guide covers everything you need to run your own instance of three.ws — from a one-click Vercel deploy to a fully self-hosted setup on any Node.js infrastructure.+This guide covers everything you need to run your own instance of three.ws — from the single Node container that serves the whole app to a fully self-hosted setup on any Node.js infrastructure.++> **How three.ws itself runs.** Production runs on **Google Cloud Run** (service `three-ws-api`, region `us-central1`) — one Express container ([`server/index.mjs`](../server/index.mjs)) that serves the static frontend, the `vercel.json` route table, and every `api/**` handler with Vercel-parity filesystem routing. The scheduled jobs run on **Google Cloud Scheduler**, not Vercel crons. The complete operational runbook (load balancer, DNS/TLS, env, rollback, recovery) is [`docs/ops/gcp-production.md`](ops/gcp-production.md). This guide describes how to self-host the same container anywhere; the ops runbook is the source of truth for the hosted deployment.---@@ -10,35 +12,38 @@ three.ws is a full-stack platform. A complete deployment has six moving parts:| Layer | What it does | Recommended provider ||---|---|---|-| **Frontend** | Vite-built multi-page SPA (static files) | Vercel / any CDN |-| **API routes** | Node.js serverless functions in `/api/` | Vercel / any Node.js host |+| **Frontend** | Vite-built multi-page SPA (static files, baked into the container image) | Cloud Run / any Node host + CDN |+| **App server** | One Express container (`server/index.mjs`) serving the `vercel.json` routes + every `api/**` handler | Cloud Run / any Node.js host / Docker || **Database** | PostgreSQL — agents, users, widgets, keys | [Neon](https://neon.tech) (serverless Postgres) || **Rate limiting / cache** | Per-IP and per-user rate limits, session caching | [Upstash Redis](https://upstash.com) || **Object storage** | GLB files, generated thumbnails | Cloudflare R2 (recommended) or AWS S3 || **IPFS** (optional) | Decentralized asset pinning for on-chain registration | [Pinata](https://pinata.cloud) or Web3.Storage |-None of the optional layers (Redis, IPFS, blockchain relayer) are required to run a working instance. The platform degrades gracefully — Redis missing means in-process rate limiting per serverless instance; IPFS missing means on-chain registration is unavailable; the relayer missing means ERC-7710 delegation redemption is disabled.+The API handlers under `api/` are plain files, but they are **not** deployed as one-function-per-file serverless functions — the single container in `server/index.mjs` resolves and runs them with the same filesystem routing Vercel used, so one Node process serves everything. None of the optional layers (Redis, IPFS, blockchain relayer) are required to run a working instance. The platform degrades gracefully — Redis missing means in-process rate limiting per instance; IPFS missing means on-chain registration is unavailable; the relayer missing means ERC-7710 delegation redemption is disabled.----## Quickest path: one-click Vercel deploy--The fastest route from zero to running:+## Quickest path: the single container-[](https://vercel.com/new/clone?repository-url=https://github.com/nirholas/three.ws)+The fastest route from zero to running is the same container three.ws runs in production. Build it, then run it anywhere that takes a container or a Node process.-1. Click the button → connect your GitHub account → Vercel forks the repo to your account.-2. Fill in the environment variables (see the [Required environment variables](#required-environment-variables) section below).-3. Click **Deploy**. The build takes about 3 minutes.-4. After deploy: add your custom domain, configure DNS, point your database.+```bash+git clone https://github.com/nirholas/three.ws.git+cd three.ws+npm install+cp .env.example .env.local # fill in DATABASE_URL, JWT_SECRET, ANTHROPIC_API_KEY at minimum+npm run db:bootstrap # provision the schema+npm run build # build the frontend into dist/+node server/index.mjs # serves everything on PORT (defaults to 8080)+```-That's it. You'll have a live instance at `https://your-project.vercel.app`.+Point a reverse proxy / load balancer at the container, add your domain and TLS, and you have a live instance. On Google Cloud Run, `npm run deploy:gcp` builds the image with [`server/cloudbuild.yaml`](../server/cloudbuild.yaml) and ships it — the [ops runbook](ops/gcp-production.md) covers the load balancer, DNS, and TLS wiring end to end.---## Required environment variables-Copy [`.env.example`](../.env.example) to `.env.local` for local work, and add the same variables to your Vercel project under **Settings → Environment Variables** (both Preview and Production environments).+Copy [`.env.example`](../.env.example) to `.env.local` for local work, and set the same variables on your host. On Cloud Run they live on the service (`gcloud run services update three-ws-api --region us-central1 --set-env-vars …`); on any other host, set them however that platform injects environment. Secret-type variables should be stored as secrets, not plaintext — and never trust a `vercel env pull` as a complete export, since it returns empty for secret-type vars.```bashcp .env.example .env.local@@ -162,7 +167,7 @@ WEB3_STORAGE_TOKEN=### 1. Create a Neon project1. Go to [neon.tech](https://neon.tech) → **New Project**-2. Choose a region close to your Vercel deployment+2. Choose a region close to where your app server runs3. Copy the connection string — it looks like `postgres://user:[email protected]/neondb?sslmode=require`4. Set it as `DATABASE_URL` in your env@@ -255,7 +260,7 @@ To add an embed origin: add it to the `origin` array in `cors.json` and redeploy```bash# 1. Create a Redis database at https://upstash.com-# 2. Choose the same region as your Vercel deployment+# 2. Choose a region close to where your app server runs# 3. Copy the REST URL and REST token to your env vars```@@ -280,7 +285,7 @@ Without Redis the platform still works — rate limits run in-memory per serverl```bashgit clone https://github.com/nirholas/three.ws.git-cd 3d-agent+cd three.wsnpm install# Copy and fill in env vars@@ -304,11 +309,12 @@ The dev server runs on **port 3000** with Vite HMR. Changes to any source file r|---|---|| `npm run dev` | Dev server with HMR on port 3000 || `npm run build` | Production build to `dist/` |-| `npm run clean` | Remove `dist/` |-| `npm run deploy` | Build + `vercel --prod` |-| `npm run verify` | Prettier check (exits 1 if formatting drift) |+| `npm run clean` | Remove `dist/` and `dist-lib/` |+| `npm run deploy:gcp` | Build the image via `server/cloudbuild.yaml` and deploy to Cloud Run (how three.ws production ships) |+| `npm run verify` | Prettier check + `vite build` (exits non-zero on formatting drift or a broken build) || `npm run format` | Auto-format all files with Prettier |-| `npm run test` | Run test suite (`test/gen_test.js`) |+| `npm run test` | Run the test suite — `vitest run` then `playwright test` |+| `npm run db:bootstrap` | Provision the full database schema (core + indexer + delegations + migrations) |---@@ -328,9 +334,9 @@ The Vite config handles multi-page routing, asset hashing, and the PWA manifest.----## Vercel configuration+## Routing and crons (`vercel.json`)-The `vercel.json` at the root configures routing, headers, and background cron jobs.+`vercel.json` at the root is a **live config file** — it is not a leftover from the Vercel era. The container reads its route table and cron list at runtime: `server/index.mjs` parses `vercel.json`, splits the routes at the `{ "handle": "filesystem" }` marker, and applies the headers, rewrites, redirects, and 404 fallback with Vercel-parity semantics. Do not delete it.### Key rewrites@@ -347,16 +353,17 @@ The embed routes explicitly set `frame-ancestors *` so the embed iframe can be h### Background cron jobs-Vercel runs four cron jobs automatically once deployed:+The `crons` array in `vercel.json` declares ~80 scheduled jobs (economy tick, on-chain crawl, delegation indexing, DCA, subscriptions, coin-launch lifecycle, treasury top-ups, and more). In production these run as **~76 Google Cloud Scheduler jobs** — one per entry — each firing `GET /api/cron/<name>` with an `Authorization: Bearer $CRON_SECRET` header. A representative slice:| Cron | Schedule | Purpose ||---|---|---|+| `/api/cron/economy-tick` | Every minute | Fan out to every engine that moves the agent-to-agent economy || `/api/cron/erc8004-crawl` | Every 15 min | Index new on-chain agent registrations || `/api/cron/index-delegations` | Every 5 min | Index ERC-7710 delegation events || `/api/cron/run-dca` | Every hour | Execute scheduled DCA strategies || `/api/cron/run-subscriptions` | Every hour | Process recurring subscriptions |-Crons only run in production deployments (not preview). No action needed — Vercel picks them up automatically from `vercel.json`.+The container does **not** schedule these itself — you need an external scheduler hitting the endpoints. On Cloud Run that is Cloud Scheduler; self-hosters can point any HTTP cron (Cloud Scheduler, cron-job.org, Upstash QStash) at `/api/cron/*` with the `CRON_SECRET` bearer, or run `scripts/economy-heartbeat.mjs` as a long-lived pinger that reads `vercel.json` and fires every due cron each minute. See the [economy heartbeat](economy-heartbeat.md) guide for the driver patterns.### Static asset cachingdiff --git a/docs/embody.md b/docs/embody.mdindex d57bdf003..090d7d173 100644--- a/docs/embody.md+++ b/docs/embody.md@@ -100,4 +100,4 @@ Embody is a thin, honest wire over pieces that already exist — no new pipeline- [Live embodiment](./mcp-studio.md) — the 3D Studio tools that persist and drive a body in chat.- [x402 Paid Endpoints](./x402-endpoints.md) — the full paid catalog and pricing.- [x402 Buyer Client](./x402-buyer.md) — how to settle a 402 challenge from code.-- [Create a 3D avatar](./create-3d-avatar.md) — generate a rigged avatar in the web UI.+- [Avatar creation](./avatar-creation.md) — generate a rigged avatar in the web UI.diff --git a/docs/erc8004/validation-attestation.md b/docs/erc8004/validation-attestation.mdindex 10d00dbe7..13ea981dc 100644--- a/docs/erc8004/validation-attestation.md+++ b/docs/erc8004/validation-attestation.md@@ -53,8 +53,8 @@ The validator is a dedicated EVM key. It is **not** in the repo.node scripts/erc8004/provision-validator-key.mjs```Address: `0x93Bc7EfB0059B784465619FC73C2db8D01b1CD04` (provisioned 2026-06-15).-2. **Store the secret**: set `VALIDATOR_PRIVATE_KEY` in Vercel (production +- preview) and `.env.local` for local runs. Never commit it.+2. **Store the secret**: set `VALIDATOR_PRIVATE_KEY` on the Cloud Run service+ (`three-ws-api`) for production and `.env.local` for local runs. Never commit it.3. **Fund** the address with gas on each ValidationRegistry chain.4. **Allow-list** it on each chain as the registry owner (run as theValidationRegistry deployer):diff --git a/docs/gcp-credits.md b/docs/gcp-credits.mdindex d41d506e9..b25b3274b 100644--- a/docs/gcp-credits.md+++ b/docs/gcp-credits.md@@ -5,6 +5,15 @@ project, the credit grant, what's enabled, service accounts, env vars, quota,and how to smoke-test Claude on Vertex. Prompts 02–08 append to this file asthey build on the foundation.+_Historical record — this is a date-stamped runbook from the GCP-credits program+(most sections written 2026-07-07); its per-prompt subsections are point-in-time+work logs, not current setup steps. Production has since moved to Google Cloud Run+(service `three-ws-api`), so every "set in Vercel" / `vercel env add` / `vercel --prod`+instruction below is superseded — the GCP env vars now live on the Cloud Run+service. See the **"Audit + fixes — 2026-07-08"** section at the end of this file for+what was actually wired onto Cloud Run, and the [GCP production runbook](ops/gcp-production.md)+for the live deploy/env procedure._+> **Status: foundation live; one owner console action remains for Claude.**> `gcloud` is authenticated (`[email protected]`) against `aerial-vehicle-466722-p5`,> all APIs are enabled, the `vercel-inference` SA is created withdiff --git a/docs/how-it-works.md b/docs/how-it-works.mdindex 8edcd16f0..f16e9001e 100644--- a/docs/how-it-works.md+++ b/docs/how-it-works.md@@ -52,7 +52,7 @@ The whole stack is split into four horizontal strata. Each layer can run on its- **Viewer layer** — pure three.js. Knows nothing about agents, brains, or wallets. Useful on its own as a glTF inspector and as the rendering engine for Turntable / Animation Gallery widgets. See [Layers](./layers.md) for the contract.- **Agent layer** — turns a static GLB into a presence. LLM tool-loop, skill registry, memory, and a continuous emotion blend that drives morphs and gaze. See [Agent system](./agent-system.md).- **Identity layer** — durability across sessions, devices, and embed hosts. Wallet auth, on-chain registration, IPFS-pinned manifest bundles, signed action diary. Entirely optional. See [ERC-8004](./erc8004.md) and [Solana agents](./solana.md).-- **Embed layer** — the public face. The `<agent-3d>` custom element, five widget variants, iframe embeds, the CDN bundle, the SPA, edge routing in `vercel.json`. See [Embedding](./embedding.md).+- **Embed layer** — the public face. The `<agent-3d>` custom element, five widget variants, iframe embeds, the CDN bundle, the SPA, and the route table in `vercel.json` (read at runtime by the Cloud Run server). See [Embedding](./embedding.md).The four layers communicate through one event bus (`agent-protocol`). Every meaningful action is a `CustomEvent` on a singleton. That single design choice is why you can swap the avatar for a 2D sprite, the runtime for a different LLM, or memory for a vector store — and nothing else changes.diff --git a/docs/ibm.md b/docs/ibm.mdindex 03461291f..0047b26bf 100644--- a/docs/ibm.md+++ b/docs/ibm.md@@ -74,7 +74,7 @@ The streaming chat endpoint returns an OpenAI-shaped SSE stream (`choices[].delt## Configuration-Set these as environment variables (locally in `.env`, in production via `vercel env`). One IBM Cloud key + project unlocks the entire suite.+Set these as environment variables (locally in `.env`, in production on the Cloud Run service — `gcloud run services update three-ws-api --region us-central1 --update-env-vars WATSONX_API_KEY=…`; see the [GCP production runbook](./ops/gcp-production.md)). One IBM Cloud key + project unlocks the entire suite.**Required for any watsonx feature:**@@ -282,7 +282,7 @@ It reads the same `WATSONX_*` environment variables documented above. See the [MEach surface has an executable verification script in [`scripts/`](../scripts/). They follow one pattern: a **Phase 1** that runs offline and deterministically (asserting the exact watsonx wire contract — model IDs, message shapes, SSRF allowlist, verdict parsing, hash-chain integrity) so it's never flaky, and a **Phase 2** that runs a real call against watsonx.ai when `WATSONX_API_KEY` + a project/space are present (skipped, not failed, when absent — there is no mock fallback).```bash-node scripts/verify-ibm-surface.mjs # every /ibm page is built + wired (engine, Vite input, dev + Vercel route)+node scripts/verify-ibm-surface.mjs # every /ibm page is built + wired (engine, Vite input, dev route + vercel.json route table)node scripts/verify-watsonx.mjs # embeddings + chat + the Galaxy PCA layoutnode scripts/verify-granite-oracle.mjs # OHLCV → forecast → narration → governancenode scripts/verify-granite-guardian.mjs # risk classification, spend cap, audit chaindiff --git a/docs/internal/MAINNET-TEST-2026-07-03.md b/docs/internal/MAINNET-TEST-2026-07-03.mdindex 254ca7f5b..e9793cc41 100644--- a/docs/internal/MAINNET-TEST-2026-07-03.md+++ b/docs/internal/MAINNET-TEST-2026-07-03.md@@ -1,5 +1,7 @@# Mainnet end-to-end test — 2026-07-03+_Historical record: a point-in-time test report from 2026-07-03, when production still ran on Vercel. Production migrated to Google Cloud Run on 2026-07-07 (env vars now live on the Cloud Run service, not Vercel; deploy is `npm run build` + `npm run deploy:gcp`). The Vercel references, `vercel env` diagnostics, and secret-outage below describe that day's state — do not read them as current infrastructure guidance. Current ops: [docs/ops/gcp-production.md](../ops/gcp-production.md)._+Real-SOL verification of every money-touching surface, run against production three.ws with a throwaway burner wallet. Audience: engineers. Every claim below carries a transaction signature or an HTTP transcript reference.## Parametersdiff --git a/docs/listings.md b/docs/listings.mdindex 6975328bb..6a4f8c181 100644--- a/docs/listings.md+++ b/docs/listings.md@@ -14,7 +14,7 @@ Cloud marketplaces are the procurement flow enterprises use to acquire software|---|---|---|| **AWS** Marketplace | Live | three.ws is an AWS Partner. Subscribe via AWS Marketplace to consolidate billing on your AWS account; subscriptions auto-issue an x402 API key via the marketplace entitlement service. See [aws-marketplace.md](./aws-marketplace.md). || **Alibaba Cloud** International Marketplace | Live | [Product listing](https://marketplace.alibabacloud.com/products/56724001/sgcmfw00036800.html) · [Storefront](https://marketplace.alibabacloud.com/store/3247293.html) · [Announcement](/blog/three-ws-on-alibaba-cloud-marketplace.html) · [Marketplace blog feature](https://marketplace.alibabacloud.com/doc/blog/detail/mplace-sgcmfw00036800.html) |-| **Google Cloud** Marketplace | Open to partnership | three.ws runs on WebGL, Vercel edge, and EVM — a natural fit for Vertex AI and GCP's global CDN. Reach out for co-listing, credits, and joint GTM. |+| **Google Cloud** Marketplace | Open to partnership | three.ws already runs its production stack on Google Cloud Run (`three-ws-api`, us-central1) — a natural fit for Vertex AI and GCP's global CDN. Reach out for co-listing, credits, and joint GTM. || **Microsoft Azure** Marketplace | On roadmap | Targeted alongside the AWS/Alibaba rollout. |---@@ -47,8 +47,7 @@ HackerNoon is one of the world's largest independent tech publications, read byThe full stack is on GitHub:-- **three.ws** — [github.com/nirholas/three.ws](https://github.com/nirholas/three.ws)-- Mirrored at — [github.com/nirholas/3D-Agent](https://github.com/nirholas/3D-Agent)+- **three.ws** — [github.com/nirholas/three.ws](https://github.com/nirholas/three.ws) (canonical source of truth)The codebase includes the `<agent-3d>` browser component, the Solana minting SDK, the x402 payment SDK, the ERC-8004 wallet integration, and the agent-payments SDK used by third-party developers.diff --git a/docs/mint-mark.md b/docs/mint-mark.mdindex a70423824..da746ded1 100644--- a/docs/mint-mark.md+++ b/docs/mint-mark.md@@ -20,7 +20,7 @@ When you launch a coin on three.ws (via Studio or the agent wallet path), the pl### How does it work?-The server runs a fast WASM-based keypair grinder (single-threaded, sub-second for a 3-character prefix) until it finds a match, then uses that keypair as the coin mint. The expected work is ~49 000 keypairs at ~25 000/s, taking well under a second on real serverless CPU.+The server runs a fast WASM-based keypair grinder (single-threaded, sub-second for a 3-character prefix) until it finds a match, then uses that keypair as the coin mint. The expected work is ~49 000 keypairs at ~25 000/s, taking well under a second on the Cloud Run server's CPU.### Is it on every coin?@@ -61,7 +61,7 @@ const enforceMark = env.THREE_WS_MARK_ENFORCE !== '0' && env.THREE_WS_MARK_ENFORWhen enforcement is **on** (default):- A client-supplied `mint_address` is validated with `hasThreeWsMark`; unbranded mints return `400 unbranded_mint`.- When no mint is supplied, the server grinds one with `grindVanityNode({ ...THREE_WS_VANITY })`.-- Grind cost is logged at info level: `{ publicKey, attempts, durationMs }` — expect ~49 000 attempts, < 1 000 ms on serverless CPU.+- Grind cost is logged at info level: `{ publicKey, attempts, durationMs }` — expect ~49 000 attempts, < 1 000 ms on the Cloud Run server's CPU.When enforcement is **off**: a random `Keypair.generate()` is used (pure-legacy fallback). No brand constraint.@@ -101,7 +101,7 @@ Every server-side grind emits a structured log line via `logger('pump.launch')`:"publicKey": "3wsXrT4Gy...", "attempts": 49213, "durationMs": 892 }```-Watch this in Vercel logs to confirm the ~49 000-attempt / sub-second expectation holds. A sharp increase in `attempts` or `durationMs` signals WASM performance degradation.+Watch this in the Cloud Run logs (Cloud Logging) to confirm the ~49 000-attempt / sub-second expectation holds. A sharp increase in `attempts` or `durationMs` signals WASM performance degradation.### The generic x402 launcher exemptiondiff --git a/docs/nvidia-nemotron-spotlight.md b/docs/nvidia-nemotron-spotlight.mdindex 56595a68a..acf32f395 100644--- a/docs/nvidia-nemotron-spotlight.md+++ b/docs/nvidia-nemotron-spotlight.md@@ -27,11 +27,11 @@ The first version of our forge pipeline was exactly what you would draw on a whiprompt or photo → 3D generator → GLB → render in browser```-The generator is Microsoft TRELLIS, running on NVIDIA NIM. It is genuinely excellent, and NVIDIA hosts it free. Our draft tier finishes a text-to-3D generation inline in about **12–13 seconds** at 15 sampling steps, with none of the ~60-second cold start we were eating on other hosted lanes. When I first watched a GLB materialize out of a sentence, I thought we were basically done.+The generator is Microsoft TRELLIS, running on NVIDIA NIM. It is genuinely excellent, and NVIDIA hosts it free. Our draft tier finishes a text-to-3D generation inline in about **12-13 seconds** at 15 sampling steps, with none of the ~60-second cold start we were eating on other hosted lanes. When I first watched a GLB materialize out of a sentence, I thought we were basically done.Then we opened it to real users, and the whiteboard drawing met the world.-Somebody uploaded a screenshot of a Discord conversation and asked for a 3D model of it. Somebody uploaded a photo of their living room — six objects, no subject. Somebody uploaded a picture so dark you could not tell it was a cat. Somebody uploaded a bar chart.+Somebody uploaded a screenshot of a Discord conversation and asked for a 3D model of it. Somebody uploaded a photo of their living room: six objects, no subject. Somebody uploaded a picture so dark you could not tell it was a cat. Somebody uploaded a bar chart.Every one of those consumed a rate-limited slot, occupied a GPU, took the full generation time, and handed the user a mesh of formless noise. The user does not know that their input was unreconstructable. They know that our product is broken. And they leave.@@ -55,10 +55,10 @@ Reply ONLY with compact JSON, no prose, in exactly this shape:{"usable":true|false,"subject":"<2-5 word description>","issue":"none"|"text_screenshot"|"multiple_subjects"|"no_clear_subject"|"too_dark_or_blurry"|"abstract_or_diagram"}-When in doubt, mark usable=true — a borderline photo still reconstructs.+When in doubt, mark usable=true. A borderline photo still reconstructs.```-The model answering that question is **`nvidia/nemotron-nano-12b-v2-vl`**. It returns in **1–2 seconds**. It costs us nothing. And it turned "your 3D model is garbage" into this:+The model answering that question is **`nvidia/nemotron-nano-12b-v2-vl`**. It returns in **1-2 seconds**. It costs us nothing. And it turned "your 3D model is garbage" into this:> That looks like a screenshot of text or an interface, not a photo of an object. Upload a clear picture of the single thing you want to turn into a 3D model.@@ -70,13 +70,13 @@ We benchmarked the obvious candidates and picked on a metric nobody puts on a leFor a small reference image, `nemotron-nano-12b-v2-vl` consumes roughly **281 prompt tokens**. A Llama-90B-vision class model consumed roughly **1,600** for the identical image. That is a ~5.7× difference in the tokens we push through a check that runs in front of *every single generation on the platform*. At our volume, that ratio decides whether the guardrail is free or whether the guardrail becomes the largest line item in the pipeline it was built to protect.-Nemotron Nano won on the axis that actually mattered. The 12B VL model is not competing with a frontier model on essay quality. It is being asked whether there is one clear object in a photograph, and that is a question it answers reliably, in 1–2 seconds, for nothing.+Nemotron Nano won on the axis that actually mattered. The 12B VL model is not competing with a frontier model on essay quality. It is being asked whether there is one clear object in a photograph, and that is a question it answers reliably, in 1-2 seconds, for nothing.Our vision chain, in order:```jsconst NVIDIA_VISION_MODELS = [- 'nvidia/nemotron-nano-12b-v2-vl', // leads — smallest image token footprint+ 'nvidia/nemotron-nano-12b-v2-vl', // leads: smallest image token footprint'meta/llama-3.2-11b-vision-instruct', // different family = independent failure modes];// paid vision-capable backstop appended last, and only if its key is set@@ -88,7 +88,7 @@ Note the comment on line two, because it is the load-bearing design decision inOnce we understood the pattern, we found the same shape everywhere in the product.-**Content safety.** Anonymous visitors can talk to any agent on the platform. We refuse unsafe messages ourselves rather than inheriting a downstream provider's moderation policy, using NVIDIA's `nvidia/llama-3.1-nemoguard-8b-content-safety` from the NeMo Guardrails family. Measured median latency on the free NIM tier: **~340 ms**, with a ~680 ms tail. We give it a 2-second abort budget, which is roughly six times its median — generous, and still fast to fail over.+**Content safety.** Anonymous visitors can talk to any agent on the platform. We refuse unsafe messages ourselves rather than inheriting a downstream provider's moderation policy, using NVIDIA's `nvidia/llama-3.1-nemoguard-8b-content-safety` from the NeMo Guardrails family. Measured median latency on the free NIM tier: **~340 ms**, with a ~680 ms tail. We give it a 2-second abort budget, which is roughly six times its median. That's generous, and still fast to fail over.**Reasoning turns.** When a feature wants a compact, reasoning-tuned model to actually lead rather than sit at the tail of a fallback chain, it opts into `nvidia/nvidia-nemotron-nano-9b-v2`. Prompt refinement, classification, structured extraction. A 9B model does these perfectly, and reaching for a frontier model to do them is a tax you pay on every request forever.@@ -118,7 +118,7 @@ We got here by getting it wrong first. Six things I would hand to anyone buildinOffered in the spirit of a team that has bet its pipeline on these lanes and wants them to win.-**Lift the image-input restriction on the hosted TRELLIS preview.** The hosted endpoint currently accepts only NVIDIA's predefined `example_id` sample images for `mode:"image"`. We verified this exhaustively against the live endpoint — inline base64 at every size, NVCF asset references with `NVCF-INPUT-ASSET-REFERENCES`, and bare asset ids all return 422. Self-deployed TRELLIS NIMs accept real image input, so this is a property of the hosted preview and not the model. It is the single biggest gap between the free lane and the self-hosted one, and it forces every photo-to-3D submission on our platform off NVIDIA infrastructure and onto a paid third party. We have kept the asset-handshake recipe ready for the day it lifts.+**Lift the image-input restriction on the hosted TRELLIS preview.** The hosted endpoint currently accepts only NVIDIA's predefined `example_id` sample images for `mode:"image"`. We verified this exhaustively against the live endpoint: inline base64 at every size, NVCF asset references with `NVCF-INPUT-ASSET-REFERENCES`, and bare asset ids all return 422. Self-deployed TRELLIS NIMs accept real image input, so this is a property of the hosted preview and not the model. It is the single biggest gap between the free lane and the self-hosted one, and it forces every photo-to-3D submission on our platform off NVIDIA infrastructure and onto a paid third party. We have kept the asset-handshake recipe ready for the day it lifts.**Raise or document the 77-character TRELLIS prompt cap.** TRELLIS truncates the text prompt server-side at 77 characters. We clamp to it so the request is honest about what is actually conditioning the generation, and we spend 17 of those precious characters appending `", studio lighting"` because TRELLIS trends dark and gritty without an explicit lighting cue. Seventy-seven characters is a tight budget for a user's creative intent.@@ -130,7 +130,7 @@ Offered in the spirit of a team that has bet its pipeline on these lanes and wanI want to step back from the token counts.-For the whole history of the medium, 3D has been gated behind craft. Not taste, not ideas — craft. Years of it. Topology and UV unwrapping and weight painting and retopology, an apprenticeship most people with something to say were never going to serve. The ideas were never the bottleneck. The tooling was. An enormous number of people who would have made extraordinary things in three dimensions simply never got past the first week of Blender, and we will never know what they would have built.+For the whole history of the medium, 3D has been gated behind craft. Not taste, not ideas. Craft. Years of it. Topology and UV unwrapping and weight painting and retopology, an apprenticeship most people with something to say were never going to serve. The ideas were never the bottleneck. The tooling was. An enormous number of people who would have made extraordinary things in three dimensions simply never got past the first week of Blender, and we will never know what they would have built.That is ending, and it is ending *now*, and it is not ending because one model got good at meshes.@@ -138,10 +138,10 @@ It is ending because the entire supporting cast got good and got free at the samNVIDIA's most underrated contribution to 3D is not the GPU in the datacenter. It is the decision to put Nemotron Nano, NemoGuard, TRELLIS, FLUX, Riva, and Audio2Face behind one free API key. That decision is why a small team can put text-to-3D in a browser tab and charge nothing for it. It is why the guardrail is free. It is why the pipeline closes.-We are going to look back on this decade the way we look back on desktop publishing — a brief, strange window when the tools for a whole art form went from a priesthood to a text box, and the number of people who could participate went up by four orders of magnitude. The models that make that happen will mostly not be the famous ones. They will be 9B and 12B, they will run in a second, they will cost nothing, and they will spend their lives quietly telling people *not that photo, try this one instead*.+We are going to look back on this decade the way we look back on desktop publishing: a brief, strange window when the tools for a whole art form went from a priesthood to a text box, and the number of people who could participate went up by four orders of magnitude. The models that make that happen will mostly not be the famous ones. They will be 9B and 12B, they will run in a second, they will cost nothing, and they will spend their lives quietly telling people *not that photo, try this one instead*.Build the small stuff. Put it in front. The generator was never the hard part.----*three.ws is a browser-native platform for generating 3D avatars, worlds, and agents from a sentence. The text-to-3D lane described here is free and open — no key, no account. Our full NVIDIA model map lives in [`docs/nvidia-models.md`](./nvidia-models.md), and the pipeline internals are in [`docs/3d-asset-pipeline.md`](./3d-asset-pipeline.md).*+*three.ws is a browser-native platform for generating 3D avatars, worlds, and agents from a sentence. The text-to-3D lane described here is free and open: no key, no account. Our full NVIDIA model map lives in [`docs/nvidia-models.md`](./nvidia-models.md), and the pipeline internals are in [`docs/3d-asset-pipeline.md`](./3d-asset-pipeline.md).*diff --git a/pages/coins.html b/pages/coins.htmlindex 0805e6e3a..d1f269866 100644--- a/pages/coins.html+++ b/pages/coins.html@@ -97,6 +97,7 @@<nav class="cv-tools" aria-label="Market tools"><a class="cv-pill" href="/markets">Markets Hub</a><a class="cv-pill" href="/markets/news">News</a>+ <a class="cv-pill" href="/markets/digest">Digest</a><a class="cv-pill" href="/markets/archive">Archive</a><a class="cv-pill" href="/heatmap">Heatmap</a><a class="cv-pill" href="/screener">Screener</a>diff --git a/pages/markets-news.html b/pages/markets-news.htmlindex d3b5d01be..8828ba0c9 100644--- a/pages/markets-news.html+++ b/pages/markets-news.html@@ -88,6 +88,7 @@<nav class="cv-tools" aria-label="Market tools"><a class="cv-pill" href="/markets">Markets Hub</a><a class="cv-pill" href="/markets/news" aria-current="page">News</a>+ <a class="cv-pill" href="/markets/digest">Digest</a><a class="cv-pill" href="/markets/archive">Archive</a><a class="cv-pill" href="/coins">Coins</a><a class="cv-pill" href="/heatmap">Heatmap</a>@@ -131,7 +132,7 @@<span>Looking for older coverage? The<a href="/markets/archive">news archive</a> holds- <strong>662,047 articles back to September 2017</strong> — searchable by+ <strong>660,000+ articles back to September 2017</strong> — searchable byticker, date, source, sentiment, and language.</span></div>diff --git a/pages/news-archive.html b/pages/news-archive.htmlindex 4eb969742..94704a7b3 100644--- a/pages/news-archive.html+++ b/pages/news-archive.html@@ -18,7 +18,7 @@</script><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" />- <title>Crypto News Archive — 662k articles since 2017 · three.ws</title>+ <title>Crypto News Archive — 660k+ articles since 2017 · three.ws</title><metaname="description"content="The largest open crypto-news archive: 660,000+ articles from September 2017 to today — refreshed hourly and searchable by keyword, ticker, source, sentiment, date, and language (English + Chinese)."@@ -26,7 +26,7 @@<meta property="og:type" content="website" /><meta property="og:site_name" content="three.ws" /><meta property="og:url" content="https://three.ws/markets/archive" />- <meta property="og:title" content="Crypto News Archive — 662k articles since 2017 · three.ws" />+ <meta property="og:title" content="Crypto News Archive — 660k+ articles since 2017 · three.ws" /><metaproperty="og:description"content="660,000+ crypto news articles from 2017 to today, refreshed hourly — searchable by keyword, ticker, source, sentiment, date, and language."@@ -39,7 +39,7 @@<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="Crypto News Archive — 662k articles since 2017" />+ <meta name="twitter:title" content="Crypto News Archive — 660k+ articles since 2017" /><metaname="twitter:description"content="The largest open crypto-news archive — searchable by keyword, ticker, source, sentiment, date, and language."@@ -61,7 +61,7 @@<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" /><meta property="og:locale" content="en_US" /><meta property="og:image:alt" content="Crypto News Archive — three.ws" />- <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"Dataset","name":"three.ws Crypto News Archive","description":"662,047 crypto news articles from September 2017 onward, enriched with tickers, tags, sentiment, and language. Sources include the CryptoPanic english corpus and the Odaily chinese corpus.","url":"https://three.ws/markets/archive","temporalCoverage":"2017-09/..","inLanguage":["en","zh"],"creator":{"@type":"Organization","name":"three.ws","url":"https://three.ws"}}]}</script>+ <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"Dataset","name":"three.ws Crypto News Archive","description":"660,000+ crypto news articles from September 2017 onward, refreshed hourly from the live feed and enriched with tickers, tags, sentiment, and language. Sources include the CryptoPanic english corpus, the Odaily chinese corpus, and 38 live publisher feeds.","url":"https://three.ws/markets/archive","temporalCoverage":"2017-09/..","inLanguage":["en","zh"],"creator":{"@type":"Organization","name":"three.ws","url":"https://three.ws"}}]}</script></head><body><header><div id="nav-container"></div></header>@@ -75,13 +75,14 @@<h1 class="cv-h1">Crypto News Archive</h1><p class="cv-sub">The largest open archive of crypto news — <strong>660,000+ articles</strong> from- September 2017 to today — refreshed hourly from the live feed — in English and Chinese, every record enriched with- tickers, tags, and sentiment. Search a decade of market history.+ September 2017 to today, refreshed hourly from the live feed, in English and Chinese —+ every record enriched with tickers, tags, and sentiment. Search a decade of market history.</p><nav class="cv-tools" aria-label="Market tools"><a class="cv-pill" href="/markets">Markets Hub</a><a class="cv-pill" href="/markets/news">News</a>+ <a class="cv-pill" href="/markets/digest">Digest</a><a class="cv-pill" href="/markets/archive" aria-current="page">Archive</a><a class="cv-pill" href="/coins">Coins</a><a class="cv-pill" href="/heatmap">Heatmap</a>diff --git a/pages/news-digest.html b/pages/news-digest.htmlnew file mode 100644index 000000000..1c8b4d1aa--- /dev/null+++ b/pages/news-digest.html@@ -0,0 +1,106 @@+<!doctype html>+<html lang="en" class="cv-page">+ <head>+ <script>+ /* three.ws theme boot — no-flash; runtime in /theme-switcher.js */ (function () {+ try {+ var m = localStorage.getItem('twx_theme');+ var l =+ m === 'auto'+ ? window.matchMedia &&+ window.matchMedia('(prefers-color-scheme: light)').matches+ : m === 'light';+ document.documentElement.setAttribute('data-theme', l ? 'light' : 'dark');+ } catch (e) {+ document.documentElement.setAttribute('data-theme', 'dark');+ }+ })();+ </script>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>Crypto News Digest — the day in stories, not headlines · three.ws</title>+ <meta+ name="description"+ content="The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, market stance, the tickers involved, and every outlet that covered it."+ />+ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:url" content="https://three.ws/markets/digest" />+ <meta property="og:title" content="Crypto News Digest · three.ws" />+ <meta+ property="og:description"+ content="The day's crypto news grouped into stories, not headlines — each with a summary, a market stance, and every outlet that covered it."+ />+ <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="theme-color" content="#09090b" />+ <link rel="icon" href="/favicon.ico" sizes="any" />+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />+ <link rel="manifest" href="/site.webmanifest" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/src/coin-pages.css" />+ <link rel="stylesheet" href="/footer.css" />+ <link rel="canonical" href="https://three.ws/markets/digest" />+ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1" />+ <meta property="og:locale" content="en_US" />++ <meta property="og:image" content="https://three.ws/api/page-og?s=crypto&t=Crypto+News+Digest&d=The+day%27s+crypto+news+grouped+into+the+handful+of+stories+that+actually+matter+%E2%80%94+each+with+a+plain-language+summary%2C+a+market+stance%2C+the+tickers+involved%2C+and+&p=%2Fmarkets%2Fdigest">+ <meta property="og:image:width" content="1200">+ <meta property="og:image:height" content="630">+ <meta property="og:image:type" content="image/png">+ <meta property="og:image:alt" content="Crypto News Digest — three.ws">+ <meta name="twitter:title" content="Crypto News Digest · three.ws">+ <meta name="twitter:description" content="The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.">+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=crypto&t=Crypto+News+Digest&d=The+day%27s+crypto+news+grouped+into+the+handful+of+stories+that+actually+matter+%E2%80%94+each+with+a+plain-language+summary%2C+a+market+stance%2C+the+tickers+involved%2C+and+&p=%2Fmarkets%2Fdigest">+ <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Crypto News Digest","description":"The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.","url":"https://three.ws/markets/digest","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=crypto&t=Crypto+News+Digest&d=The+day%27s+crypto+news+grouped+into+the+handful+of+stories+that+actually+matter+%E2%80%94+each+with+a+plain-language+summary%2C+a+market+stance%2C+the+tickers+involved%2C+and+&p=%2Fmarkets%2Fdigest"},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://three.ws/"},{"@type":"ListItem","position":2,"name":"Markets","item":"https://three.ws/markets"},{"@type":"ListItem","position":3,"name":"Digest","item":"https://three.ws/markets/digest"}]}]}</script>+</head>+ <body>+ <header><div id="nav-container"></div></header>+ <script src="/nav.js"></script>++ <main class="cv-container">+ <nav class="cv-crumbs" aria-label="Breadcrumb">+ <a href="/markets">Markets</a><span class="sep">/</span+ ><a href="/markets/news">News</a><span class="sep">/</span+ ><span class="here">Digest</span>+ </nav>+ <h1 class="cv-h1">News Digest</h1>+ <p class="cv-sub">+ The day in stories, not headlines. Coverage from 38 publisher feeds, grouped into+ the handful of narratives that actually moved — each with a summary, a market+ stance, the tickers involved, and every outlet that reported it.+ </p>++ <nav class="cv-tools" aria-label="Market tools">+ <a class="cv-pill" href="/markets">Markets Hub</a>+ <a class="cv-pill" href="/markets/news">News</a>+ <a class="cv-pill" href="/markets/digest" aria-current="page">Digest</a>+ <a class="cv-pill" href="/markets/archive">Archive</a>+ <a class="cv-pill" href="/coins">Coins</a>+ <a class="cv-pill" href="/fear-greed">Fear & Greed</a>+ </nav>++ <!-- Window controls + mood band. Hydrated by src/news-digest.js. -->+ <div class="nw-toolbar" role="group" aria-label="Digest window">+ <div class="dg-windows" id="dg-windows"></div>+ <button class="arc-btn ghost" type="button" id="dg-refresh">Regenerate</button>+ </div>++ <section id="dg-band" class="cv-section" aria-label="Market mood"></section>++ <!-- Narratives. Hydrated by src/news-digest.js. -->+ <section id="dg-list" class="cv-section" aria-label="Today's stories" aria-live="polite"></section>++ <p id="dg-footer" class="arc-coverage" style="margin-top: 1.5rem"></p>+ </main>++ <script type="module" src="/src/news-digest.js"></script>+ <script src="/brand.js" defer></script>+ <div id="footer-container"></div>+ <script src="/footer.js"></script>+ </body>+</html>diff --git a/prompts/agent-briefs/W-world-online/PORT-CHECKLIST.md b/prompts/agent-briefs/W-world-online/PORT-CHECKLIST.mdindex e80fe0a8a..7ae945c37 100644--- a/prompts/agent-briefs/W-world-online/PORT-CHECKLIST.md+++ b/prompts/agent-briefs/W-world-online/PORT-CHECKLIST.md@@ -29,16 +29,22 @@### Already-in-repo assets to lift (do not rewrite)+> **Re-verified 2026-07-10.** The table below was accurate at the 2026-06-11 ground-truth+> pass but drifted as later sessions shipped Phase 1/2 and quietly wired the three+> "orphaned" modules without updating this row. Trust `grep`, not this table, when in doubt+> — that drift is exactly what sent an earlier session in this program down a dead-end+> re-research path before it re-verified importers directly.+| System | File | Status today ||---|---|---|-| Rapier wrapper + kinematic character controller | [src/physics/physics-world.js](../../../src/physics/physics-world.js) | wired into `/walk` only |-| Heightfield terrain (shared mesh + collider source) | [src/game/terrain.js](../../../src/game/terrain.js) | wired into `/walk` only |-| 4-mode camera (follow/cinematic/firstperson/topdown) | [src/walk.js:466-520](../../../src/walk.js#L466-L520) | inline in `/walk` — needs extraction |-| Friends / presence panel | [src/game/friends-panel.js](../../../src/game/friends-panel.js) | wired into `/walk` + `friends.js` |-| Client vehicle manager (Rapier raycast vehicle) | [src/game/vehicles.js](../../../src/game/vehicles.js) | **orphaned — zero importers** |-| Day/night cycle | [src/game/day-night.js](../../../src/game/day-night.js) | **orphaned — zero importers** |-| Activities/minigame loop | [src/game/play-activities.js](../../../src/game/play-activities.js) | **orphaned — zero importers** |-| Generic world persistence (Postgres index + R2 blob) | [api/world/[action].js](../../../api/world/[action].js), `api/_lib/world-store.js` | live API, **`/play` doesn't use it** |+| Rapier wrapper + kinematic character controller | [src/physics/physics-world.js](../../../src/physics/physics-world.js) | **wired into `/play`** (Phase 1, `_initPhysics()` in `coincommunities.js`) |+| Heightfield terrain (shared mesh + collider source) | [src/game/terrain.js](../../../src/game/terrain.js) | **superseded in `/play`** by the district's static-box colliders (see Phase 1 note) — `/walk` still uses the heightfield directly |+| 4-mode camera (follow/cinematic/firstperson/topdown) | [src/walk.js:466-520](../../../src/walk.js#L466-L520) | **wired into `/play`** (`_camModes`, `C` cycles) — still inline in both files, never extracted to a shared module |+| Friends / presence panel | [src/game/friends-panel.js](../../../src/game/friends-panel.js) | **wired into `/play`** 2026-07-10 (P4.2 — see below) + `/walk` + `friends.js` |+| Client vehicle manager (Rapier raycast vehicle) | [src/game/vehicles.js](../../../src/game/vehicles.js) | **wired into `/play`** (Phase 2, `VehicleManager` import in `coincommunities.js`) |+| Day/night cycle | [src/game/day-night.js](../../../src/game/day-night.js) | **wired into `/play`** (imported by `src/agent-screen-world.js`, driven by `src/shared/world-clock.js`) |+| Activities/minigame loop | [src/game/play-activities.js](../../../src/game/play-activities.js) | **wired into `/play`** (P4.1 — `PlayActivities` constructed, ticked, disposed in `coincommunities.js`; F-key chop/mine/cook/pickupRod) |+| Generic world persistence (Postgres index + R2 blob) | [api/world/[action].js](../../../api/world/[action].js), `api/_lib/world-store.js` | live API, **`/play` still doesn't use it** — real gap, see P3.1 |---@@ -350,14 +356,22 @@ overwriting it.Maps to **W08/W09**. `/play` already has NPCs (`WorldLife`), voice, cosmetics — these add the`/walk` social surface and the orphaned activities loop.-- [ ] **P4.1 — Wire the orphaned activities/minigame loop.** Import- [src/game/play-activities.js](../../../src/game/play-activities.js) `PlayActivities` into- `/play` and surface it through the HUD.-- [ ] **P4.2 — Port the friends/presence panel.** Bring- [src/game/friends-panel.js](../../../src/game/friends-panel.js) (already used by `/walk` and- `friends.js`) into `/play` so players see and join friends across coin worlds.-- [ ] **P4.3 — Minimap.** `/walk` and Hyperfy both orient the player in a larger space; with the- expanded world from Phase 1, add a minimap to `WorldHudSystem`.+- [x] **P4.1 — Wire the orphaned activities/minigame loop.** SHIPPED (undated — found already+ complete 2026-07-10). `PlayActivities` is constructed/ticked/disposed in `coincommunities.js`+ and bound to the `F` key (chop/mine/cook/pickupRod), sharing the vehicle-interact/fish+ priority chain.+- [x] **P4.2 — Port the friends/presence panel.** SHIPPED 2026-07-10. `FriendsPanel` mounts in a+ right-docked drawer (`_openFriends`/`_closeFriends` in `coincommunities.js`), toggled by the+ `J` hotkey or the HUD `Friends` button (unread badge, `aria-expanded`), closed with `Esc`.+ The real gap this closed: `community-net.js` never carried a signed presence ticket into the+ `walk_world` join and never forwarded the server's `social` message — so every `/play` player+ showed **Offline** to their friends and live DMs were silently dropped, even though the panel+ itself and the server-side `socialHub` registration were both already built. Fixed at the net+ layer (`getPresence` option + `social` → `_emit`), not just the UI. See+ `tests/play-friends-presence.test.js` for the regression coverage.+- [x] **P4.3 — Minimap.** SHIPPED (undated — found already complete 2026-07-10).+ `WorldHudSystem` (`src/game/hud/world-hud.js`) owns a rotating `Minimap`+ (`src/game/hud/minimap.js`) with compass + live blips, range widening while driving.---@@ -378,6 +392,6 @@ Maps to **W08/W09**. `/play` already has NPCs (`WorldLife`), voice, cosmetics## Suggested order`P1.1 → P1.2 → P1.3 → P1.4 → P1.5` (foundation) → `P2.x` (vehicles) → `P3.1 → P3.2 → P3.3`-(persistence/build) → `P4.x` (social). P1 unblocks everything; the three orphaned modules-(`vehicles.js`, `day-night.js`, `play-activities.js`) are the cheapest early wins because they-already exist and just need importing.+(persistence/build) → `P4.x` (social). All of Phase 1, 2, and 4 are now shipped (see the+checkboxes above) — **Phase 3 (persistence/build parity) is the only remaining phase** and the+next place to pick up this program.diff --git a/public/changelog.json b/public/changelog.jsonindex e0c8919a8..cd0e2f670 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-10T06:16:54.247Z",+ "generated_at": "2026-07-10T12:13:16.047Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -26,6 +26,16 @@"launch"]},+ {+ "date": "2026-07-10",+ "type": "launch",+ "title": "Crypto News Digest",+ "summary": "The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.",+ "link": "/markets/digest",+ "tags": [+ "launch"+ ]+ },{"date": "2026-07-10","type": "launch",@@ -36,6 +46,16 @@"launch"]},+ {+ "date": "2026-07-10",+ "type": "launch",+ "title": "Docs · What Agents Can Do — The Complete Dossier",+ "summary": "The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability wallet, worlds, and the developer platform — 15 chapters plus a per-ability deep dive for the entire Agent Wallet.",+ "link": "/docs/agent-abilities",+ "tags": [+ "launch"+ ]+ },{"date": "2026-07-10","type": "launch",@@ -67,6 +87,17 @@"feature"]},+ {+ "date": "2026-07-10",+ "type": "update",+ "title": "Friends now see you online — and can message you — while you're in /play",+ "summary": "Your account's friends list, presence, and DMs (already live on /walk) now work inside /play's coin worlds too: a Friends button on the HUD (or press J) opens a drawer showing who's online and where, with live direct messages that arrive instantly whether or not the drawer is open. Previously /play never told the server who you were signed in as, so friends saw you as offline no matter how long you played, and any message sent your way was silently lost.",+ "link": "/play",+ "tags": [+ "feature",+ "fix"+ ]+ },{"date": "2026-07-10","type": "update",@@ -89,6 +120,28 @@"infra"]},+ {+ "date": "2026-07-10",+ "type": "update",+ "title": "The Oracle can see the news again",+ "summary": "The Oracle's narrative pillar — one of the four signals behind every 0-100 conviction score — reads live headlines to tell whether a coin is riding a real story. It had been reading them from an outside news service that went offline, and because the code was built to fail quietly rather than break, it simply scored with no headlines at all. Conviction scores now draw on three.ws's own news engine, which reads 38 publisher feeds directly, so the narrative read is live again and no longer depends on anyone else staying up. The pump.fun news-meme detector and the sniper's coin classifier read from the same engine.",+ "link": "/oracle",+ "tags": [+ "fix",+ "improvement"+ ]+ },+ {+ "date": "2026-07-10",+ "type": "update",+ "title": "What can an agent actually do? The complete abilities dossier is live",+ "summary": "Every ability a three.ws agent has, mapped in one place: /docs/agent-abilities. Fifteen chapters cover the agent end to end — the 3D body and how it moves, the studios where agents are made, memory and autonomy, conversation, on-chain identity, skills, screens, the agent economy, markets intelligence, live worlds, embeds and mobile, and the developer platform — plus a dedicated deep-dive page for each of the Agent Wallet's 23 abilities, from Balance and Deposit through Autopilot, Intents, Proof of Custody, and Self-defense. Everything was researched from the shipped code, so every claim on those pages describes something you can use today.",+ "link": "/docs/agent-abilities",+ "tags": [+ "docs",+ "feature"+ ]+ },{"date": "2026-07-09","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 465664d39..27468321e 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -22,6 +22,14 @@<category>launch</category><description>The largest open crypto-news archive: 660,000+ articles from September 2017 to today, refreshed hourly from the live feed, in English and Chinese — searchable by keyword, ticker, source, sentiment, date, and language.</description></item>+ <item>+ <title>Crypto News Digest</title>+ <link>https://three.ws/markets/digest</link>+ <guid isPermaLink="false">2026-07-10:Crypto News Digest</guid>+ <pubDate>Fri, 10 Jul 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.</description>+ </item><item><title>Crypto News Reader</title><link>https://three.ws/markets/news/article</link>@@ -30,6 +38,14 @@<category>launch</category><description>Rich article reader for crypto news — full story extraction with AI summary, key points, sentiment, detected tickers, and related coverage from across the industry.</description></item>+ <item>+ <title>Docs · What Agents Can Do — The Complete Dossier</title>+ <link>https://three.ws/docs/agent-abilities</link>+ <guid isPermaLink="false">2026-07-10:Docs · What Agents Can Do — The Complete Dossier</guid>+ <pubDate>Fri, 10 Jul 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability wallet, worlds, and the developer platform — 15 chapters plus a per-ability deep dive for the entire Agent Wallet.</description>+ </item><item><title>Markets Hub</title><link>https://three.ws/markets</link>@@ -54,6 +70,14 @@<category>feature</category><description>Markets grew a full news wing. /markets/news streams live headlines aggregated directly from 38 publisher feeds — filter by category (Bitcoin, DeFi, regulation, and more), search, and open any story in a reader that extracts the full text with a summary, key points, sentiment, and related coverage. Behind it sits the largest open crypto-news archive anywhere: 662,047 articles from September 2017 to today in English and Chinese, searchable by keyword, ticker, source, sentiment, date, and language at /markets/archive. A new /markets hub ties the whole suite together — live global stats, the top 100 coins, breaking news, and every market tool as its own card.</description></item>+ <item>+ <title>Friends now see you online — and can message you — while you're in /play</title>+ <link>https://three.ws/play</link>+ <guid isPermaLink="false">2026-07-10:Friends now see you online — and can message you — while you're in /play</guid>+ <pubDate>Fri, 10 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>Your account's friends list, presence, and DMs (already live on /walk) now work inside /play's coin worlds too: a Friends button on the HUD (or press J) opens a drawer showing who's online and where, with live direct messages that arrive instantly whether or not the drawer is open. Previously /play never told the server who you were signed in as, so friends saw you as offline no matter how long you played, and any message sent your way was silently lost.</description>+ </item><item><title>The liquidations pulse on /coins is live</title><link>https://three.ws/coins</link>@@ -70,6 +94,22 @@<category>feature</category><description>The 660,000-article news archive is no longer frozen in time: an hourly archiver now appends every new story from the live feed into the corpus, complete with the market snapshot at capture time (BTC/ETH/SOL price, market cap, Fear & Greed), so /markets/archive stays current forever. And if you'd rather read three.ws crypto news in your own reader, the feed is now available as standard RSS at /api/news/rss — subscribe to everything or just one category.</description></item>+ <item>+ <title>The Oracle can see the news again</title>+ <link>https://three.ws/oracle</link>+ <guid isPermaLink="false">2026-07-10:The Oracle can see the news again</guid>+ <pubDate>Fri, 10 Jul 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>The Oracle's narrative pillar — one of the four signals behind every 0-100 conviction score — reads live headlines to tell whether a coin is riding a real story. It had been reading them from an outside news service that went offline, and because the code was built to fail quietly rather than break, it simply scored with no headlines at all. Conviction scores now draw on three.ws's own news engine, which reads 38 publisher feeds directly, so the narrative read is live again and no longer depends on anyone else staying up. The pump.fun news-meme detector and the sniper's coin classifier read from the same engine.</description>+ </item>+ <item>+ <title>What can an agent actually do? The complete abilities dossier is live</title>+ <link>https://three.ws/docs/agent-abilities</link>+ <guid isPermaLink="false">2026-07-10:What can an agent actually do? The complete abilities dossier is live</guid>+ <pubDate>Fri, 10 Jul 2026 12:00:00 GMT</pubDate>+ <category>docs</category>+ <description>Every ability a three.ws agent has, mapped in one place: /docs/agent-abilities. Fifteen chapters cover the agent end to end — the 3D body and how it moves, the studios where agents are made, memory and autonomy, conversation, on-chain identity, skills, screens, the agent economy, markets intelligence, live worlds, embeds and mobile, and the developer platform — plus a dedicated deep-dive page for each of the Agent Wallet's 23 abilities, from Balance and Deposit through Autopilot, Intents, Proof of Custody, and Self-defense. Everything was researched from the shipped code, so every claim on those pages describes something you can use today.</description>+ </item><item><title>/play: real water at the fishing ponds, and spare rods to find on the bank</title><link>https://three.ws/play</link>diff --git a/public/features.json b/public/features.jsonindex e6cfa428a..ea17bf84b 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-10T06:16:54.233Z",+ "generated_at": "2026-07-10T12:13:15.844Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",@@ -1925,6 +1925,16 @@"indexable": true,"tags": [],"showcase": false+ },+ {+ "path": "/markets/digest",+ "title": "Crypto News Digest",+ "description": "The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.",+ "added": "2026-07-10",+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false}]},@@ -2706,6 +2716,16 @@"indexable": true,"tags": [],"showcase": false+ },+ {+ "path": "/docs/agent-abilities",+ "title": "Docs · What Agents Can Do — The Complete Dossier",+ "description": "The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability wallet, worlds, and the developer platform — 15 chapters plus a per-ability deep dive for the entire Agent Wallet.",+ "added": "2026-07-10",+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false}]},diff --git a/public/llms-full.txt b/public/llms-full.txtindex b2c8ceb1a..83f7c0929 100644--- a/public/llms-full.txt+++ b/public/llms-full.txt@@ -1168,6 +1168,12 @@ URL: https://three.ws/markets/archiveThe largest open crypto-news archive: 660,000+ articles from September 2017 to today, refreshed hourly from the live feed, in English and Chinese — searchable by keyword, ticker, source, sentiment, date, and language.+### Crypto News Digest++URL: https://three.ws/markets/digest++The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.+## Agent ToolsManage, talk to, and deploy individual agents.@@ -1648,6 +1654,12 @@ URL: https://three.ws/docs/trader-cardPaste any Solana wallet for its on-chain pump.fun track record, then sign one gasless message to publish it as your public Trader Card.+### Docs · What Agents Can Do — The Complete Dossier++URL: https://three.ws/docs/agent-abilities++The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability wallet, worlds, and the developer platform — 15 chapters plus a per-ability deep dive for the entire Agent Wallet.+## BlogLong-form announcements, launches, and writing from three.ws.diff --git a/public/llms.txt b/public/llms.txtindex adaecb367..ce43c3069 100644--- a/public/llms.txt+++ b/public/llms.txt@@ -210,6 +210,7 @@ On-chain features: pay-per-call, token launches, vanity wallets.- [Crypto News](https://three.ws/markets/news): Live crypto news aggregated natively from 38 publisher feeds — filter by category (Bitcoin, DeFi, regulation, and more), search headlines, and open any story in a rich reader with summary, key points, sentiment, and related coverage.- [Crypto News Reader](https://three.ws/markets/news/article): Rich article reader for crypto news — full story extraction with AI summary, key points, sentiment, detected tickers, and related coverage from across the industry.- [Crypto News Archive](https://three.ws/markets/archive): The largest open crypto-news archive: 660,000+ articles from September 2017 to today, refreshed hourly from the live feed, in English and Chinese — searchable by keyword, ticker, source, sentiment, date, and language.+- [Crypto News Digest](https://three.ws/markets/digest): The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.## Agent Tools@@ -295,6 +296,7 @@ Docs, tutorials, and reference.- [Docs · Competitive & Pooled Trading](https://three.ws/docs/trading-arenas): Arena tournaments with on-chain $THREE payouts, the 3D Sniper Arena, the Live Trading Theater and its one-click mirror, backable Vaults, and consensus-driven Trading Swarms.- [Docs · Custody You Can Verify](https://three.ws/docs/custody): Spend limits, the freeze switch, Merkle proof-of-custody with in-browser verification, and social recovery & inheritance for agent wallets.- [Docs · Claim Your Wallet & Trader Card](https://three.ws/docs/trader-card): Paste any Solana wallet for its on-chain pump.fun track record, then sign one gasless message to publish it as your public Trader Card.+- [Docs · What Agents Can Do — The Complete Dossier](https://three.ws/docs/agent-abilities): The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability wallet, worlds, and the developer platform — 15 chapters plus a per-ability deep dive for the entire Agent Wallet.## Blogdiff --git a/public/nav-data.js b/public/nav-data.jsindex e71403ad3..4933c2c0c 100644--- a/public/nav-data.js+++ b/public/nav-data.js@@ -337,6 +337,11 @@ export const NAV_GROUPS = [href: '/markets/news',desc: 'Live headlines from 37 publisher feeds with a rich reader for every story',},+ {+ title: 'News Digest',+ href: '/markets/digest',+ desc: 'The day in stories, not headlines — coverage clustered into what actually moved',+ },{title: 'News Archive',href: '/markets/archive',diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex be840ace7..8cb52b69b 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -65,7 +65,7 @@<main class="sm-wrap"><div class="sm-hero"><h1>Sitemap</h1>- <p>All 414 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>+ <p>All 416 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p><div class="sm-formats"><a href="/sitemap.xml"><code>sitemap.xml</code> · for search engines</a><a href="/llms.txt"><code>llms.txt</code> · for AI agents</a>@@ -77,7 +77,7 @@</div><div class="sm-filter"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="m21 21-4.3-4.3"/></svg>- <input id="sm-filter-input" type="search" placeholder="Filter 414 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />+ <input id="sm-filter-input" type="search" placeholder="Filter 416 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" /><kbd aria-hidden="true">/</kbd></div><p class="sm-filter-count" id="sm-filter-count" role="status" aria-live="polite"></p>@@ -718,7 +718,7 @@<section class="sm-section" id="crypto"><header>- <h2>Crypto<span class="sm-count" data-count>104</span></h2>+ <h2>Crypto<span class="sm-count" data-count>105</span></h2><p class="sm-section-desc">On-chain features: pay-per-call, token launches, vanity wallets.</p></header><ul class="sm-list">@@ -1450,6 +1450,13 @@<span class="sm-desc">The largest open crypto-news archive: 660,000+ articles from September 2017 to today, refreshed hourly from the live feed, in English and Chinese — searchable by keyword, ticker, source, sentiment, date, and language.</span></a></li>+ <li>+ <a href="/markets/digest">+ <span class="sm-title">Crypto News Digest</span>+ <span class="sm-path">/markets/digest</span>+ <span class="sm-desc">The day's crypto news grouped into the handful of stories that actually matter — each with a plain-language summary, a market stance, the tickers involved, and every outlet that covered it. Clustered from 38 live publisher feeds.</span>+ </a>+ </li></ul></section>@@ -1585,7 +1592,7 @@<section class="sm-section" id="learn"><header>- <h2>Learn<span class="sm-count" data-count>60</span></h2>+ <h2>Learn<span class="sm-count" data-count>61</span></h2><p class="sm-section-desc">Docs, tutorials, and reference.</p></header><ul class="sm-list">@@ -2009,6 +2016,13 @@<span class="sm-desc">Paste any Solana wallet for its on-chain pump.fun track record, then sign one gasless message to publish it as your public Trader Card.</span></a></li>+ <li>+ <a href="/docs/agent-abilities">+ <span class="sm-title">Docs · What Agents Can Do — The Complete Dossier</span>+ <span class="sm-path">/docs/agent-abilities</span>+ <span class="sm-desc">The complete map of every agent ability, researched from the shipped code: body, motion, mind, voice, identity, skills, screens, economy, the 23-ability wallet, worlds, and the developer platform — 15 chapters plus a per-ability deep dive for the entire Agent Wallet.</span>+ </a>+ </li></ul></section>diff --git a/scripts/repro-walk-mobile.mjs b/scripts/repro-walk-mobile.mjsnew file mode 100644index 000000000..6389728a4--- /dev/null+++ b/scripts/repro-walk-mobile.mjs@@ -0,0 +1,60 @@+#!/usr/bin/env node+/**+ * Reproduce the /walk mobile GLTFLoader texture + avatar-fetch failures with+ * full network detail, so the root cause is observed rather than guessed.+ *+ * node scripts/repro-walk-mobile.mjs [url] [--desktop]+ */+import { chromium, devices } from 'playwright';++const url = process.argv[2]?.startsWith('http') ? process.argv[2] : 'https://three.ws/walk';+const desktop = process.argv.includes('--desktop');++const browser = await chromium.launch();+const context = await browser.newContext(+ desktop ? { viewport: { width: 1440, height: 900 } } : { ...devices['iPhone 13'] },+);+const page = await context.newPage();++const failures = [];+page.on('requestfailed', (r) => {+ failures.push({ kind: 'requestfailed', url: r.url().slice(0, 120), err: r.failure()?.errorText });+});+page.on('response', async (r) => {+ if (r.status() >= 400) failures.push({ kind: 'http', status: r.status(), url: r.url().slice(0, 120) });+});+page.on('console', (m) => {+ if (m.type() === 'error') failures.push({ kind: 'console', text: m.text().slice(0, 200) });+});+page.on('pageerror', (e) => failures.push({ kind: 'pageerror', text: String(e).slice(0, 200) }));++await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });++// Report what three.js actually chose for its texture loader + whether the UA+// triggers the Safari/Firefox ImageBitmapLoader opt-out.+const env = await page.evaluate(() => ({+ ua: navigator.userAgent,+ hasCreateImageBitmap: typeof createImageBitmap !== 'undefined',+ safariMatch: /^((?!chrome|android).)*safari/i.test(navigator.userAgent),+ deviceMemory: navigator.deviceMemory ?? null,+ maxTextureHint: (() => {+ try {+ const gl = document.createElement('canvas').getContext('webgl2') || document.createElement('canvas').getContext('webgl');+ return gl ? gl.getParameter(gl.MAX_TEXTURE_SIZE) : 'no-webgl';+ } catch (e) { return `err:${e.message}`; }+ })(),+}));++await page.waitForTimeout(15000);++console.log('ENV', JSON.stringify(env, null, 1));+console.log('\nFAILURES', failures.length);+const seen = new Set();+for (const f of failures) {+ const key = `${f.kind}:${(f.text || f.url || '').slice(0, 60)}`;+ if (seen.has(key)) continue;+ seen.add(key);+ console.log(' ', JSON.stringify(f));+}++await browser.close();diff --git a/src/coin-page.js b/src/coin-page.jsindex 31592ec1e..ff4835379 100644--- a/src/coin-page.js+++ b/src/coin-page.js@@ -2,7 +2,7 @@// pages: header (icon / name / rank / price / 24h-7d-30d chips), interactive// SVG price chart with time ranges and a crosshair tooltip, market-stats grid,// related news, about text, and link pills. Data comes from the /api/coin/*-// proxies (CoinGecko + the cryptocurrency.cv news aggregator) — never mocked.+// proxies (CoinGecko + the native three.ws news aggregator) — never mocked.import {formatUsd,diff --git a/src/coin-pages.css b/src/coin-pages.cssindex dbf05d370..e1ccffb18 100644--- a/src/coin-pages.css+++ b/src/coin-pages.css@@ -2452,3 +2452,191 @@ a.cv-liq-item:focus-visible {transform: none;}}++/* ═══════════════════════════════════════════════════════════════════════════+ News Digest — /markets/digest+ Narrative cards: rank, stance, coverage, expandable source list.+ ═══════════════════════════════════════════════════════════════════════════ */++.dg-windows {+ display: flex;+ gap: 0.5rem;+ flex-wrap: wrap;+}++.dg-band {+ display: flex;+ flex-wrap: wrap;+ align-items: center;+ gap: 1.5rem 2rem;+ padding: 1rem 1.5rem;+ background: var(--cv-surface);+ border: 1px solid var(--cv-border);+ border-radius: var(--cv-radius-xl);+ box-shadow: var(--cv-shadow-card);+ margin: 0 0 1.75rem;+}+.dg-band-stat {+ display: flex;+ flex-direction: column;+ gap: 0.125rem;+}+.dg-band-stat strong {+ font-size: 1.125rem;+ font-variant-numeric: tabular-nums;+ text-transform: capitalize;+}+.dg-band .label,+.dg-band-tickers .label {+ font-size: 0.6875rem;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.06em;+ color: var(--cv-text-3);+}+.dg-band-tickers {+ display: flex;+ flex-direction: column;+ gap: 0.375rem;+ margin-left: auto;+}+.dg-band-tickers .nw-chips {+ margin: 0;+ padding: 0;+}++.dg-story {+ display: grid;+ grid-template-columns: auto minmax(0, 1fr);+ gap: 1.25rem;+ padding: 1.5rem 0;+ border-bottom: 1px solid var(--cv-border);+}+.dg-story:last-child {+ border-bottom: 0;+}+.dg-rank {+ font-family: var(--cv-font-serif, inherit);+ font-size: 1.75rem;+ font-weight: 700;+ line-height: 1;+ color: var(--cv-text-3);+ width: 2ch;+ text-align: right;+ font-variant-numeric: tabular-nums;+}+.dg-body {+ min-width: 0;+ display: flex;+ flex-direction: column;+ gap: 0.5rem;+}+.dg-meta {+ display: flex;+ flex-wrap: wrap;+ align-items: center;+ gap: 0.5rem 0.875rem;+ font-size: 0.75rem;+ color: var(--cv-text-3);+}+.dg-coverage {+ font-weight: 500;+ color: var(--cv-text-2);+}+.dg-title {+ font-family: var(--cv-font-serif, inherit);+ font-size: 1.375rem;+ line-height: 1.3;+ margin: 0;+}+.dg-summary {+ font-size: 0.9375rem;+ line-height: 1.6;+ color: var(--cv-text-2);+ margin: 0;+ max-width: 72ch;+}+.dg-sources {+ margin-top: 0.25rem;+}+.dg-sources summary {+ cursor: pointer;+ font-size: 0.8125rem;+ font-weight: 600;+ color: var(--cv-text-2);+ padding: 0.25rem 0;+ list-style: none;+ display: inline-flex;+ align-items: center;+ gap: 0.375rem;+ transition: color 0.15s;+}+.dg-sources summary::-webkit-details-marker {+ display: none;+}+.dg-sources summary::before {+ content: '▸';+ transition: transform 0.15s;+ display: inline-block;+}+.dg-sources[open] summary::before {+ transform: rotate(90deg);+}+.dg-sources summary:hover {+ color: var(--cv-text);+}+.dg-sources summary:focus-visible {+ outline: 2px solid var(--cv-accent);+ outline-offset: 2px;+ border-radius: 4px;+}+.dg-sources ul {+ list-style: none;+ margin: 0.5rem 0 0;+ padding: 0 0 0 1rem;+ border-left: 2px solid var(--cv-border);+ display: flex;+ flex-direction: column;+ gap: 0.5rem;+}+.dg-sources li {+ display: flex;+ flex-wrap: wrap;+ align-items: baseline;+ gap: 0.5rem;+ font-size: 0.875rem;+ line-height: 1.45;+}+.dg-sources li a {+ color: var(--cv-text);+ text-decoration: none;+}+.dg-sources li a:hover {+ text-decoration: underline;+ text-underline-offset: 3px;+}+.dg-sources .dim {+ font-size: 0.75rem;+ color: var(--cv-text-3);+}+.dg-out {+ color: var(--cv-text-3) !important;+ font-size: 0.8125rem;+}+.dg-out:hover {+ color: var(--cv-text) !important;+}++@media (max-width: 640px) {+ .dg-story {+ grid-template-columns: minmax(0, 1fr);+ gap: 0.5rem;+ }+ .dg-rank {+ text-align: left;+ font-size: 1.25rem;+ }+ .dg-band-tickers {+ margin-left: 0;+ }+}diff --git a/src/markets-page.js b/src/markets-page.jsindex 35f447cde..621201aad 100644--- a/src/markets-page.js+++ b/src/markets-page.js@@ -108,6 +108,7 @@ const G = {flame:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"/></svg>',news: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2"/><path d="M18 14h-8M15 18h-5M10 6h8v4h-8z"/></svg>',+ digest: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 6h13M8 12h13M8 18h13"/><circle cx="3.5" cy="6" r="1.2"/><circle cx="3.5" cy="12" r="1.2"/><circle cx="3.5" cy="18" r="1.2"/></svg>',archive:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="3" width="20" height="5" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"/><path d="M10 12h4"/></svg>',cats: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4z"/><circle cx="17" cy="17" r="3"/></svg>',@@ -126,6 +127,7 @@ const G = {const SUITE = [{ href: '/coins', glyph: 'table', title: 'Coins', desc: 'Sortable markets table for hundreds of assets with a rich detail page each.', stat: 'coins' },{ href: '/markets/news', glyph: 'news', title: 'Crypto News', desc: 'Live headlines from 38 publisher feeds, filterable and searchable.', stat: 'news' },+ { href: '/markets/digest', glyph: 'digest', title: 'News Digest', desc: 'The day in stories, not headlines — coverage clustered into what moved.', stat: 'digest' },{ href: '/markets/archive', glyph: 'archive', title: 'News Archive', desc: 'The largest open crypto-news archive, back to September 2017.', stat: 'archive' },{ href: '/heatmap', glyph: 'grid', title: 'Heatmap', desc: 'The whole market in one view — tiles sized by cap, colored by move.', stat: 'mover' },{ href: '/screener', glyph: 'filter', title: 'Screener', desc: 'Filter the top 250 by cap, volume, and 24h move to find movers fast.' },@@ -278,6 +280,13 @@ async function init() {suiteStats.news = `${d.total.toLocaleString()} <span class="dim">live stories · ${d.sources_ok} feeds</span>`;}).catch(() => renderNews(null)),+ getJson('/api/news/digest?hours=24')+ .then((d) => {+ if (d?.narratives?.length) {+ suiteStats.digest = `${d.narratives.length} <span class="dim">stories · mood ${esc(d.mood)}</span>`;+ }+ })+ .catch(() => {}),getJson('/api/news/archive?stats=true').then((d) => {if (d?.stats?.total_articles) {diff --git a/src/news-digest.js b/src/news-digest.jsnew file mode 100644index 000000000..31fee7591--- /dev/null+++ b/src/news-digest.js@@ -0,0 +1,199 @@+// /markets/digest — the day's crypto news clustered into narratives over+// /api/news/digest. Each story shows a stance, its tickers, a summary, and an+// expandable list of every outlet that covered it (real links, real sources).+// The engine badge is honest: "AI" when the LLM chain grouped the stories,+// "keyword clustering" when it ran on the extractive path.++import { timeAgo, escapeHtml as esc } from './shared/coin-format.js';++const $ = (id) => document.getElementById(id);+const WINDOWS = [+ { hours: 6, label: '6h' },+ { hours: 12, label: '12h' },+ { hours: 24, label: '24h' },+ { hours: 48, label: '48h' },+ { hours: 72, label: '72h' },+];++const state = { hours: 24, loading: false, data: null };++async function getJson(url) {+ const res = await fetch(url, { headers: { accept: 'application/json' } });+ const body = await res.json().catch(() => ({}));+ if (!res.ok) {+ const err = new Error(body?.message || `fetch → ${res.status}`);+ err.status = res.status;+ throw err;+ }+ return body;+}++function stanceBadge(stance) {+ const glyph = stance === 'bullish' ? '▲' : stance === 'bearish' ? '▼' : '◆';+ return `<span class="art-badge ${stance === 'bullish' ? 'bullish' : stance === 'bearish' ? 'bearish' : ''}">${glyph} ${esc(stance)}</span>`;+}++function tickerChips(tickers) {+ if (!tickers?.length) return '';+ return `<div class="nw-chips">${tickers+ .map((t) => `<a class="nw-chip" href="/markets/news?q=${encodeURIComponent(t)}">${esc(t)}</a>`)+ .join('')}</div>`;+}++function readerHref(a) {+ return `/markets/news/article?${new URLSearchParams({ url: a.link, title: a.title, source: a.source })}`;+}++function narrativeHtml(n, i) {+ const lead = n.articles[0];+ const sources = [...new Set(n.articles.map((a) => a.source))];+ return `+ <article class="dg-story">+ <div class="dg-rank" aria-hidden="true">${i + 1}</div>+ <div class="dg-body">+ <div class="dg-meta">+ ${stanceBadge(n.stance)}+ <span class="dg-coverage">${n.coverage} ${n.coverage === 1 ? 'report' : 'reports'} · ${esc(sources.slice(0, 3).join(', '))}${sources.length > 3 ? ` +${sources.length - 3}` : ''}</span>+ ${lead?.pub_date ? `<time datetime="${esc(lead.pub_date)}">${esc(timeAgo(lead.pub_date))}</time>` : ''}+ </div>+ <h2 class="dg-title">${esc(n.title)}</h2>+ <p class="dg-summary">${esc(n.summary)}</p>+ ${tickerChips(n.tickers)}+ <details class="dg-sources">+ <summary>${n.coverage} ${n.coverage === 1 ? 'source' : 'sources'}</summary>+ <ul>+ ${n.articles+ .map(+ (a) => `<li>+ <a href="${esc(readerHref(a))}">${esc(a.title)}</a>+ <span class="dim">${esc(a.source)}${a.pub_date ? ` · ${esc(timeAgo(a.pub_date))}` : ''}</span>+ <a class="dg-out" href="${esc(a.link)}" target="_blank" rel="noopener noreferrer" aria-label="Read at ${esc(a.source)}">↗</a>+ </li>`,+ )+ .join('')}+ </ul>+ </details>+ </div>+ </article>`;+}++function renderBand(d) {+ const moodClass = d.mood === 'bullish' ? 'cv-up' : d.mood === 'bearish' ? 'cv-down' : '';+ $('dg-band').innerHTML = `+ <div class="dg-band">+ <div class="dg-band-stat">+ <span class="label">Market mood</span>+ <strong class="${moodClass}">${esc(d.mood)}</strong>+ </div>+ <div class="dg-band-stat">+ <span class="label">Stories</span>+ <strong>${d.narratives.length}</strong>+ </div>+ <div class="dg-band-stat">+ <span class="label">Articles read</span>+ <strong>${d.articles_considered}</strong>+ </div>+ <div class="dg-band-stat">+ <span class="label">Feeds live</span>+ <strong>${esc(d.sources_live)}</strong>+ </div>+ <div class="dg-band-tickers">+ <span class="label">Most covered</span>+ ${tickerChips(d.top_tickers)}+ </div>+ </div>`;+}++function render() {+ const d = state.data;+ if (!d?.narratives?.length) {+ $('dg-list').innerHTML = `+ <div class="cv-empty">+ <p><strong>Not enough coverage in this window.</strong></p>+ <p>Widen the window, or read the <a href="/markets/news">full news feed</a>.</p>+ </div>`;+ $('dg-band').innerHTML = '';+ $('dg-footer').textContent = '';+ return;+ }+ renderBand(d);+ $('dg-list').innerHTML = d.narratives.map(narrativeHtml).join('');+ const engineLabel =+ d.engine === 'llm'+ ? `grouped by AI${d.provider ? ` (${d.provider})` : ''}`+ : 'grouped by keyword clustering';+ $('dg-footer').textContent =+ `${d.articles_considered} articles from the last ${d.window_hours}h, ${engineLabel} · generated ${timeAgo(d.generated_at)}${d.cached ? ' (cached)' : ''}`;+}++function skeleton() {+ $('dg-band').innerHTML = '<div class="cv-skel" style="height:4.5rem"></div>';+ $('dg-list').innerHTML = Array.from(+ { length: 5 },+ () => `<div class="dg-story" aria-hidden="true">+ <div class="dg-rank"></div>+ <div class="dg-body">+ <div class="cv-skel" style="height:0.75rem;width:35%"></div>+ <div class="cv-skel" style="height:1.5rem;margin:0.5rem 0"></div>+ <div class="cv-skel" style="height:0.875rem"></div>+ <div class="cv-skel" style="height:0.875rem;width:70%"></div>+ </div>+ </div>`,+ ).join('');+ $('dg-footer').textContent = 'Reading the last 24 hours of coverage…';+}++async function load({ refresh = false } = {}) {+ if (state.loading) return;+ state.loading = true;+ skeleton();+ $('dg-refresh').disabled = true;+ try {+ const p = new URLSearchParams({ hours: String(state.hours) });+ if (refresh) p.set('refresh', '1');+ state.data = await getJson(`/api/news/digest?${p}`);+ render();+ } catch (err) {+ $('dg-band').innerHTML = '';+ $('dg-list').innerHTML = `+ <div class="cv-empty">+ <p><strong>${err.status === 503 ? 'Not enough coverage in this window.' : 'Couldn’t build the digest.'}</strong></p>+ <p>${err.status === 429 ? 'Rate limited — wait a few seconds and retry.' : esc(err.message || 'The digest service didn’t respond.')}</p>+ <p><button class="arc-btn" type="button" id="dg-retry">Retry</button></p>+ </div>`;+ $('dg-footer').textContent = '';+ $('dg-retry')?.addEventListener('click', () => load());+ } finally {+ state.loading = false;+ $('dg-refresh').disabled = false;+ }+}++function renderWindows() {+ $('dg-windows').innerHTML = WINDOWS.map(+ (w) =>+ `<button class="nw-tab" type="button" data-hours="${w.hours}" aria-pressed="${String(w.hours === state.hours)}">${w.label}</button>`,+ ).join('');+}++function syncUrl() {+ history.replaceState(null, '', state.hours === 24 ? '/markets/digest' : `/markets/digest?hours=${state.hours}`);+}++function init() {+ const h = parseInt(new URLSearchParams(location.search).get('hours') || '24', 10);+ if (WINDOWS.some((w) => w.hours === h)) state.hours = h;+ renderWindows();+ $('dg-windows').addEventListener('click', (e) => {+ const btn = e.target.closest('[data-hours]');+ if (!btn) return;+ state.hours = Number(btn.dataset.hours);+ renderWindows();+ syncUrl();+ load();+ });+ $('dg-refresh').addEventListener('click', () => load({ refresh: true }));+ load();+}++init();diff --git a/tests/news-digest.test.js b/tests/news-digest.test.jsnew file mode 100644index 000000000..dc3a3a76f--- /dev/null+++ b/tests/news-digest.test.js@@ -0,0 +1,196 @@+// Coverage for api/news/digest.js — narrative clustering over the live feed.+//+// The load-bearing guarantee: every narrative must cite real articles the+// aggregator actually returned. A model that invents a story, or cites an+// index that doesn't exist, must not reach the response. Both engines (LLM+// and the keyword-clustering fallback) are exercised.++import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';++vi.mock('../api/_lib/http.js', () => ({+ wrap: (fn) => fn,+ cors: () => false,+ method: () => true,+ rateLimited: (res) => {+ res._json = { status: 429, body: { error: 'rate_limited' } };+ return res;+ },+ json: (res, status, body, headers = {}) => {+ res._json = { status, body, headers };+ return res;+ },+ error: (res, status, code, message) => {+ res._json = { status, body: { error: code, message } };+ return res;+ },+}));+vi.mock('../api/_lib/rate-limit.js', () => ({+ limits: { marketFeedIp: vi.fn(async () => ({ success: true })) },+ clientIp: () => '1.2.3.4',+}));+vi.mock('../api/_lib/llm.js', () => ({+ llmComplete: vi.fn(),+ llmConfigured: vi.fn(() => false),+}));++const recent = (minsAgo) => new Date(Date.now() - minsAgo * 60_000).toISOString();++function article(over) {+ return {+ id: over.id, title: over.title, link: over.link || `https://x.com/${over.id}`,+ description: over.description ?? 'desc', image: null, source: over.source || 'CoinDesk',+ source_key: (over.source || 'coindesk').toLowerCase(), category: 'general',+ pub_date: over.pub_date || recent(30),+ tickers: over.tickers || [],+ sentiment: over.sentiment || { score: 0, label: 'neutral', confidence: 0.5 },+ };+}++// Two ETF stories (should cluster), one hack story, one stale story.+const ARTICLES = [+ article({ id: 'a1', title: 'Bitcoin ETF inflows hit record high', tickers: ['BTC'], source: 'CoinDesk', sentiment: { score: 0.6, label: 'very_positive' } }),+ article({ id: 'a2', title: 'Record ETF inflows push Bitcoin to new high', tickers: ['BTC'], source: 'Decrypt', sentiment: { score: 0.5, label: 'positive' } }),+ article({ id: 'a3', title: 'Exchange hacked, forty million stolen', tickers: [], source: 'Protos', sentiment: { score: -0.6, label: 'very_negative' } }),+ article({ id: 'a4', title: 'Solana upgrade improves throughput', tickers: ['SOL'], source: 'The Block' }),+ article({ id: 'a5', title: 'Ancient news from last week', pub_date: recent(60 * 24 * 7) }),+];++vi.mock('../api/_lib/news.js', async (importOriginal) => {+ const actual = await importOriginal();+ return {+ ...actual,+ getNews: vi.fn(async () => ({ articles: ARTICLES, total: ARTICLES.length, sources_ok: 37, sources_total: 38 })),+ };+});++const { default: handler, _internal } = await import('../api/news/digest.js');+const { llmComplete, llmConfigured } = await import('../api/_lib/llm.js');++function call(url = '/api/news/digest?refresh=1') {+ const res = { setHeader() {}, end() {}, statusCode: 200 };+ return handler({ method: 'GET', url, headers: {} }, res).then(() => res);+}++beforeEach(() => {+ llmConfigured.mockReturnValue(false);+ llmComplete.mockReset();+});+afterEach(() => vi.clearAllMocks());++describe('clustering math', () => {+ it('jaccard scores overlapping token sets above disjoint ones', () => {+ const a = _internal.tokens('Bitcoin ETF inflows hit record high');+ const b = _internal.tokens('Record ETF inflows push Bitcoin to new high');+ const c = _internal.tokens('Solana upgrade improves throughput');+ expect(_internal.jaccard(a, b)).toBeGreaterThan(_internal.jaccard(a, c));+ });++ it('stanceFrom averages lexicon scores into a stance', () => {+ expect(_internal.stanceFrom([{ sentiment: { score: 0.6 } }, { sentiment: { score: 0.4 } }])).toBe('bullish');+ expect(_internal.stanceFrom([{ sentiment: { score: -0.6 } }])).toBe('bearish');+ expect(_internal.stanceFrom([{ sentiment: { score: 0 } }])).toBe('neutral');+ });++ it('groups the two ETF headlines together and keeps the hack separate', () => {+ const clusters = _internal.heuristicClusters(ARTICLES.slice(0, 4), 8);+ const etf = clusters.find((c) => c.articles.some((a) => a.id === 'a1'));+ expect(etf.articles.map((a) => a.id).sort()).toEqual(['a1', 'a2']);+ expect(etf.stance).toBe('bullish');+ expect(etf.tickers).toContain('BTC');+ const hack = clusters.find((c) => c.articles.some((a) => a.id === 'a3'));+ expect(hack.articles).toHaveLength(1);+ expect(hack.stance).toBe('bearish');+ });+});++describe('GET /api/news/digest', () => {+ it('uses the heuristic engine when no LLM provider is configured', async () => {+ const res = await call();+ expect(res._json.status).toBe(200);+ expect(res._json.body.engine).toBe('heuristic');+ expect(res._json.body.provider).toBeNull();+ expect(res._json.body.narratives.length).toBeGreaterThan(0);+ expect(llmComplete).not.toHaveBeenCalled();+ });++ it('excludes articles outside the time window', async () => {+ const res = await call('/api/news/digest?hours=24&refresh=1');+ // a5 is a week old+ expect(res._json.body.articles_considered).toBe(4);+ const cited = res._json.body.narratives.flatMap((n) => n.articles.map((a) => a.id));+ expect(cited).not.toContain('a5');+ });++ it('uses the LLM engine and resolves indices to real articles', async () => {+ llmConfigured.mockReturnValue(true);+ llmComplete.mockResolvedValue({+ text: '```json\n{"narratives":[{"title":"ETF inflows break records","summary":"Two outlets report record inflows.","stance":"bullish","indices":[0,1]}]}\n```',+ provider: 'groq',+ });+ const res = await call();+ expect(res._json.body.engine).toBe('llm');+ expect(res._json.body.provider).toBe('groq');+ const [n] = res._json.body.narratives;+ expect(n.title).toBe('ETF inflows break records');+ expect(n.coverage).toBe(2);+ expect(n.articles.map((a) => a.id)).toEqual(['a1', 'a2']);+ expect(n.articles.every((a) => a.link.startsWith('https://'))).toBe(true);+ });++ it('drops narratives citing indices that do not exist — never fabricates', async () => {+ llmConfigured.mockReturnValue(true);+ llmComplete.mockResolvedValue({+ text: JSON.stringify({+ narratives: [+ { title: 'Real story', summary: 's', stance: 'neutral', indices: [0] },+ { title: 'Hallucinated story', summary: 's', stance: 'bullish', indices: [99, 400] },+ ],+ }),+ provider: 'groq',+ });+ const res = await call();+ const titles = res._json.body.narratives.map((n) => n.title);+ expect(titles).toContain('Real story');+ expect(titles).not.toContain('Hallucinated story');+ expect(res._json.body.narratives.every((n) => n.articles.length > 0)).toBe(true);+ });++ it('falls back to the heuristic engine when the LLM chain fails', async () => {+ llmConfigured.mockReturnValue(true);+ llmComplete.mockRejectedValue(new Error('all providers down'));+ const res = await call();+ expect(res._json.status).toBe(200);+ expect(res._json.body.engine).toBe('heuristic');+ expect(res._json.body.narratives.length).toBeGreaterThan(0);+ });++ it('falls back when every model narrative cites nothing real', async () => {+ llmConfigured.mockReturnValue(true);+ llmComplete.mockResolvedValue({+ text: JSON.stringify({ narratives: [{ title: 'Ghost', summary: 's', stance: 'bullish', indices: [42] }] }),+ provider: 'groq',+ });+ const res = await call();+ expect(res._json.body.engine).toBe('heuristic');+ });++ it('503s when the window has too little coverage', async () => {+ const { getNews } = await import('../api/_lib/news.js');+ getNews.mockResolvedValueOnce({ articles: [ARTICLES[4]], total: 1, sources_ok: 1, sources_total: 38 });+ const res = await call('/api/news/digest?hours=1&refresh=1');+ expect(res._json.status).toBe(503);+ expect(res._json.body.error).toBe('insufficient_coverage');+ });++ it('serves a cached digest on the second call and honors ?refresh=1', async () => {+ const { getNews } = await import('../api/_lib/news.js');+ await call('/api/news/digest?hours=12'); // populate+ const before = getNews.mock.calls.length;+ const cached = await call('/api/news/digest?hours=12');+ expect(cached._json.body.cached).toBe(true);+ expect(getNews.mock.calls.length).toBe(before); // no upstream re-read+ const fresh = await call('/api/news/digest?hours=12&refresh=1');+ expect(fresh._json.body.cached).toBe(false);+ expect(getNews.mock.calls.length).toBeGreaterThan(before);+ });+});diff --git a/tests/pump-agent-construction.test.js b/tests/pump-agent-construction.test.jsnew file mode 100644index 000000000..a23401c58--- /dev/null+++ b/tests/pump-agent-construction.test.js@@ -0,0 +1,47 @@+import { describe, it, expect } from 'vitest';+import { PublicKey } from '@solana/web3.js';+import { PumpAgent, PumpAgentOffline } from '@three-ws/agent-payments';++// The SDK's online agent takes (mint, environment, connection) — the environment+// string sits BETWEEN the mint and the connection. api/_lib/pump.js once passed+// the Connection as the second argument, which left `this.connection` undefined+// and made every online read throw "Connection is required". That silently broke+// the buyback cron (~40k failed rows/day) and 502'd /api/pump/balances for a+// month before anyone noticed, because both paths recorded the failure instead+// of surfacing it.+//+// These tests pin the constructor contract the wrapper depends on. A future SDK+// bump that reorders or renames these arguments fails here rather than in prod.++const THREE_MINT = new PublicKey('FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump');++// A structural stand-in for @solana/web3.js Connection: the SDK only stores it+// and reads `rpcEndpoint` in its fallback path, so no network access occurs.+const fakeConnection = { rpcEndpoint: 'https://api.mainnet-beta.solana.com' };++describe('PumpAgent constructor contract', () => {+ it('takes the connection as the THIRD argument, after environment', async () => {+ const agent = new PumpAgent(THREE_MINT, 'mainnet', fakeConnection);+ // getBalances() throws "Connection is required" when this is unset.+ expect(agent.connection).toBe(fakeConnection);+ });++ it('leaves connection undefined when it is passed in the environment slot', () => {+ // This is precisely the shape of the bug — proving the misuse is silent at+ // construction time and only explodes on the first online read.+ const agent = new PumpAgent(THREE_MINT, fakeConnection);+ expect(agent.connection).toBeUndefined();+ });++ it('rejects an online read when constructed without a connection', async () => {+ const agent = new PumpAgent(THREE_MINT, 'mainnet');+ await expect(agent.getBalances(THREE_MINT)).rejects.toThrow(/Connection is required/);+ });+});++describe('PumpAgentOffline.load contract', () => {+ it('takes the connection as the SECOND argument (no environment slot)', () => {+ const offline = PumpAgentOffline.load(THREE_MINT, fakeConnection);+ expect(offline).toBeInstanceOf(PumpAgentOffline);+ });+});diff --git a/vercel.json b/vercel.jsonindex df7a89efa..da3e50975 100644--- a/vercel.json+++ b/vercel.json@@ -673,7 +673,7 @@"dest": "/api/portfolio/[action]?action=send"},{- "src": "/payments",+ "src": "/payments/?","dest": "/payments.html"},{@@ -948,6 +948,10 @@"src": "/markets/news/?","dest": "/markets-news.html"},+ {+ "src": "/markets/digest/?",+ "dest": "/news-digest.html"+ },{"src": "/markets/news/article/?","dest": "/news-article.html"@@ -5221,4 +5225,4 @@"schedule": "17 * * * *"}]-}\ No newline at end of file+}diff --git a/vite.config.js b/vite.config.jsindex b2289b8a1..8d21c26d3 100644--- a/vite.config.js+++ b/vite.config.js@@ -467,6 +467,7 @@ const appConfig = {coin: resolve(__dirname, 'pages/coin.html'),markets: resolve(__dirname, 'pages/markets.html'),'markets-news': resolve(__dirname, 'pages/markets-news.html'),+ 'news-digest': resolve(__dirname, 'pages/news-digest.html'),'news-article': resolve(__dirname, 'pages/news-article.html'),'news-archive': resolve(__dirname, 'pages/news-archive.html'),'fear-greed': resolve(__dirname, 'pages/fear-greed.html'),@@ -1032,6 +1033,8 @@ support: resolve(__dirname, 'pages/support.html'),'/markets/': resolve(root, 'pages/markets.html'),'/markets/news': resolve(root, 'pages/markets-news.html'),'/markets/news/': resolve(root, 'pages/markets-news.html'),+ '/markets/digest': resolve(root, 'pages/news-digest.html'),+ '/markets/digest/': resolve(root, 'pages/news-digest.html'),'/markets/news/article': resolve(root, 'pages/news-article.html'),'/markets/news/article/': resolve(root, 'pages/news-article.html'),'/markets/archive': resolve(root, 'pages/news-archive.html'),diff --git a/workers/agent-sniper/intel/classify.js b/workers/agent-sniper/intel/classify.jsindex 966ec33aa..ae1468016 100644--- a/workers/agent-sniper/intel/classify.js+++ b/workers/agent-sniper/intel/classify.js@@ -5,8 +5,8 @@//// Three layers, and it NEVER fails (Rule 9):// 1. A deterministic keyword heuristic — instant, free, always available.-// 2. Real-time news headline matching via cryptocurrency.cv API (2-min cached).-// This gives is_news_meme ground truth — not a guess.+// 2. Real-time news headline matching via the native three.ws news engine+// (2-min cached). This gives is_news_meme ground truth — not a guess.// 3. An LLM pass (free-first via llmComplete) that refines category, extracts// tags + a one-line narrative thesis.// If the LLM is unavailable or times out, the heuristic + news-match stand.