Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
chore: pick up the cookbook page dash cleanup and related surface refreshes
nirholas13d66322ba84
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8fa609e38..42aa19ff1 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -20,6 +20,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Repository guards** (`/guards`) — Every mechanical guard that protects the three.ws codebase, and the stage each one runs in. This repository has no CI, so correctness is enforced by fast local checks wired into the prebuild, the gate, the deploy build, and the git pre-push hook. Filter by stage, search by command, and read the incident behind each one.- **three.ws on NVIDIA** (`/nvidia`) — three.ws is a member of the NVIDIA Inception program. Every 3D model, avatar, and voice on the platform runs on NVIDIA: a free hosted lane behind one API key covering text-to-3D, chat, vision, embeddings, safety and speech, plus a self-hosted fleet of Cloud Run GPU workers on L4 and RTX PRO 6000.- **Tutorial · Character Library to a Live Embed** (`/tutorials/character-library-to-embed`) — Pick a rigged character from the free library of 107, prove its skeleton drives the animation clip library, and embed it on your own site with one script tag and a gesture button. No modeling, no cost, ten minutes.+- **Tutorial · Earn and spend in /play** (`/tutorials/earn-and-spend-in-play`) — Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin the wheel. Covers why the world has two currencies that never touch, and why the server decides every price.- **Tutorial · Explore the docs as a 3D world** (`/tutorials/explore-docs-world`) — Walk an avatar through the documentation: fourteen sections as glowing pavilions, live pages read in-world, shareable deep links, and your own GLB as the body.- **Tutorial · Give an Agent a Spending Envelope** (`/tutorials/agent-spending-envelope`) — Fund a budget from prepaid credits, hand an agent a capped bearer token, and let it buy real x402 services with no private key: total budget, per-call ceiling, host allowlist, expiry, audit ledger, and a refund on cancel.- **Tutorial · Monetize an MCP server: charge per tool call** (`/tutorials/monetize-mcp-server`) — Build an MCP server whose tools charge other agents per call in USDC on Solana. One free orientation tool, one paid tool that does real work, and a test that proves the product never escapes unpaid.@@ -35,8 +36,11 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **A browsable map of every check that guards this codebase** — This project ships without CI, so the checks that keep it correct run locally, on paths nobody can skip. Until now there was no way to see what they were: several working checks had no command to run them at all, and were findable only by reading the scripts folder. There is now a single registry behind a new page at /guards, where you can filter every guard by the stage it runs in, search by command, and read the specific failure that caused each one to be written. A new check keeps that page honest by refusing to pass if a guard claims to run somewhere it no longer does, which is the way this kind of page normally goes quietly out of date. A reference page and a step-by-step tutorial for writing your own guard ship alongside it. (`/guards`) `[feature, docs]`- **A healthy Solana node no longer benches itself for half an hour** — Everything that reads the Solana chain (wallet balances, coin prices, launch history, agent payments) runs through a chain of providers tried in order, and a provider that fails is set aside for a while so callers stop paying for a request that cannot succeed. How long it is set aside depends on what went wrong, and one case was being read incorrectly. Some free providers refuse a single kind of request while serving everything else perfectly, and they say so with the same response code used for a rejected password. We were treating that as a broken login and taking the node out of service for thirty minutes. Because the request being refused was the one used to read token balances, which the platform makes constantly, our fastest provider kept removing itself from service during normal work and traffic piled onto providers that had already hit their limits. A refusal of one specific request now skips only that request and keeps the node in service, while a genuinely rejected key is still set aside in full. Chain reads are noticeably steadier as a result. `[fix, infra]`- **A home for everything three.ws runs on NVIDIA** — A new page at three.ws/nvidia explains the whole NVIDIA side of the platform in one place: the free hosted lane that makes text-to-3D cost you nothing, the exact model behind each capability, the twelve GPU workers the platform runs itself, and a request you can paste into a terminal to generate a model right now. It links out to both NVIDIA tutorials, the engineering write-up on the GPU fleet, and the membership page. The partner directory now points here instead of at the membership doc. (`/nvidia`) `[feature, docs]`+- **A runnable wallet sign-in example and a step-by-step tutorial** — Signing in with a Solana or Ethereum wallet was documented as a reference but there was nothing you could run. There is now a working demo page that performs the whole round trip against the live API, shows you the exact message your wallet signed, and logs every request with its real status code, plus a tutorial that walks the same flow line by line. Both spell out the four things that quietly break a first integration: the domain check that rejects a message built from a development address, the anti-forgery header the verify step requires, the two different responses that both mean signed out, and the field the API puts its error code in. (`/tutorials/wallet-sign-in`) `[docs, sdk]`+- **A searchable catalog of every tool three.ws gives an AI assistant** — three.ws publishes 270 tools that AI assistants can call, spread across 36 servers, and until now the only way to see them all was to query each server. The new catalog page lists every one in a single searchable view: what it does, which server hosts it, what it costs in USDC, and whether an assistant can run it without asking you first. Filter by any of those and the link you copy keeps the filter. The same data is published as a single file any agent can fetch to discover the whole surface in one request. Both are generated from the source of each tool on every build, so unlike the hand-written table they replace they cannot fall out of date. (`/mcp-tools`) `[feature, docs]`- **A slow data provider can no longer freeze a live trading position** — When a trading bot checks whether it still holds a coin, it asks a Solana data provider for its token accounts. An overloaded provider sometimes answers with an empty list for a wallet that demonstrably still holds the coin. The platform read that empty answer as proof the coin had been sold, set the position aside as needing manual reconciliation, and because each strategy allows only one position at a time, the strategy stopped trading entirely while still holding the coin. Four strategies sat frozen this way for up to 57 hours against a 30-minute time limit. An empty or malformed answer is now treated as unknown rather than as zero, and is double-checked against the wallet's own token account addresses before any position is set aside. A position set aside without a recorded timestamp is also no longer exempt from the existing time limit, which is what made these freezes permanent instead of self-clearing. (`/trades`) `[fix]`- **A working example and tutorial for charging other agents to use your tools** — If you want other people's AI assistants to pay you per call, there is now a complete worked example you can run in a minute and a step-by-step tutorial that builds it with you. The example is a real server with two tools: a free one that explains the prices and how paying works, and a paid one that inspects a 3D model and returns a report on what is wrong with it and how to fix it. It refuses to hand over the report until payment clears, and it refuses to take payment unless it actually produced a report, so a broken link or an unreachable file costs the caller nothing. It ships with fifteen tests, including one whose only job is to prove the paid result cannot escape unpaid. (`/tutorials/monetize-mcp-server`) `[docs, sdk]`+- **Agent payment sessions are now fully documented, tested, and easier to size correctly** — Payment sessions let an AI agent spend a budget you set without ever holding a private key, and the feature shipped without a full reference entry or a single test on the code that enforces the limits. The complete API is now documented endpoint by endpoint, including every governance refusal and what happens when a payment is submitted but never confirmed. The enforcement layer has 49 tests covering the budget race, the host allowlist, per-payment ceilings, and refunds. Two runnable examples ship with the payments MCP package, one of which reads what a paid endpoint actually charges so you can size a budget from real prices instead of guessing. A configuration bug meant setting PAYMENT_SESSION_SECRET had no effect and session tokens were quietly keyed to an unrelated secret, which is fixed. (`/docs/api-reference`) `[docs, fix, improvement]`- **Agent Symphony: listen to the agent economy as it happens** — The live activity of the platform is now playable as music. Every payment, coin buy, new agent and safety refusal on three.ws becomes a note the moment it happens, synthesized in your browser from the same real event stream that feeds the money feed. Nothing is prerecorded and nothing is simulated. The page works fully with sound off: a live ledger lists the actual events behind the notes with real links through to agent profiles and block explorers, and a visualization spawns an orb per note. Audio only ever starts when you ask it to, and you can record a clip and share it. (`/symphony`) `[feature]`- **Agents can now actually buy from the marketplace, and operators get an Economy Health dashboard** — When one agent bought a skill or asset from another it first had to acquire $THREE, and it always bought the same tiny fixed amount no matter what the listing cost. Almost every listing was priced above what that bought, so purchases failed, retried on the next tick, and paid a real trading fee every time, which is why marketplace sales sat at zero. The purchase now prices the listing first, buys exactly what it needs, and declines up front (spending nothing) when a listing is beyond what the engine can fund that minute. Alongside it, a new operator dashboard reads the live economy and states in one line whether money is flowing and, if not, which link in the funding chain broke. `[fix, feature, infra]`- **An oversized 3D model is now refused instead of quietly hanging** — The endpoint that shrinks a 3D model caps its input at 50 MB. It only checked that cap after pulling the entire file into memory, and it could only stop early when the hosting server announced the size up front. Plenty of servers do not, so an enormous file was downloaded in full before anything measured it, and the request looked frozen rather than refused. The size is now counted as the file arrives: the moment it passes the cap the download is cut off and you get the clear too-large answer the endpoint always documented. A source that never responds, or that stalls halfway through, now times out with a specific message instead of holding the request open. `[fix]`diff --git a/STRUCTURE.md b/STRUCTURE.mdindex 6589ffad1..d8f8c01a0 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -34,6 +34,7 @@ bottom.| Diorama (text → 3D world) | [src/diorama/](src/diorama) `→ /diorama` | In-repo · backend [api/diorama.js](api/diorama.js) | One sentence → an explorable 3D diorama: Claude composes the scene, each object is forged to a real GLB, assembled live, saved to a public gallery + shareable permalink || Creator portfolio (human profile) | [pages/profile.html](pages/profile.html) `→ /u/:username` (self-view `/profile`), backend [api/users/[username].js](api/users/%5Busername%5D.js) + paginated [api/users/[username]/creations.js](api/users/%5Busername%5D/creations.js) `→ /api/users/:username/creations` | Live | Every three.ws user's public portfolio: avatars, agents, widgets, skills, plugins, coins, memories, items for sale, and (added 2026-07-12, extended 2026-07-23) a **Creations** tab merging forged 3D models + Scene Studio worlds + Material Studio restyles — real, live, spinning `<model-viewer>` cards, cursor-paginated for 100+ items. `/forge`, `/diorama`, and `/restyle` all stay anonymous by default (no login required); a signed-in creator's `user_id` is attached to `forge_creations`/`dioramas` rows at generation/save time (migration [api/_lib/migrations/20260712010000_creator_portfolio_user_ids.sql](api/_lib/migrations/20260712010000_creator_portfolio_user_ids.sql)) and to a new `material_restyles` row per AI restyle or colorway variant (migration [api/_lib/migrations/20260723140000_material_restyles.sql](api/_lib/migrations/20260723140000_material_restyles.sql), store [api/_lib/material-restyle-store.js](api/_lib/material-restyle-store.js)) so those creations surface here. The same opt-in attribution now links back from the diorama viewer HUD, the diorama gallery cards, and the forge result bar ("by @user") whenever a creation's creator is known. `/@:handle` ([pages/handle.html](pages/handle.html)) is a separate, narrower agent-embed page — not the human portfolio. || Labs (hidden-gems hub) | [pages/labs.html](pages/labs.html) + [src/labs.js](src/labs.js) `→ /labs` | In-repo | Data-driven discovery hub: renders every `data/pages.json` entry flagged `showcase: true` as a live card (status check + iframe preview), filterable by category |+| Examples gallery | [pages/examples.html](pages/examples.html) `→ /examples`, curated snippets [public/examples.js](public/examples.js), generated index renderer [public/examples-index.js](public/examples-index.js), styles [public/examples.css](public/examples.css) | Live | Two halves. The top is six copy-paste snippets that RUN on the page: each is a complete document loading the production CDN bundle into a sandboxed iframe, so "Run" executes exactly the code shown. The bottom is every example that ships in the repo (39 as of 2026-07-30), generated by [scripts/build-examples-index.mjs](scripts/build-examples-index.mjs) scanning every `examples/` directory into [data/examples.json](data/examples.json), mirrored to the served [public/examples.json](public/examples.json) by [scripts/mirror-examples-index.mjs](scripts/mirror-examples-index.mjs) (`npm run build:examples` runs both). Because it is scanned, the page cannot advertise a deleted example or miss an added one; each card carries the files it contains and the command that runs it. Tests: [tests/examples-page.test.js](tests/examples-page.test.js), [tests/examples-index.test.js](tests/examples-index.test.js) || Cross-entity search | [pages/search.html](pages/search.html) `→ /search`, backend [api/search.js](api/search.js) + query layer [api/_lib/cross-search.js](api/_lib/cross-search.js) | Live | The one search across every creation type — avatars, on-chain/Solana agents, forged 3D models, worlds, and coins. Federates (not one SQL UNION — the stores are genuinely heterogeneous, two of five aren't even in the same database) five parallel queries, normalizes into one card shape, and ranks by recency plus real signals (follower count via `user_follows`, remix count, view count) — see the file header in `api/search.js` for the full unify-vs-federate writeup. Model results carry a working "Remix — $0.25" action against the existing paid rail ([api/x402/remix-asset.js](api/x402/remix-asset.js)), reused from [pages/creations.html](pages/creations.html) rather than re-derived. Coin search checks three.ws's own launch directory (`pump_agent_mints`) first, then falls back to market-wide pump.fun/Birdeye search for broader coverage (those external matches carry no verified timestamp or creator profile, and are ranked/labelled accordingly). Linked from the Discover nav menu. || Cross-surface rankings, streaks & badges | [pages/rankings.html](pages/rankings.html) `→ /rankings`, backend [api/leaderboard/unified.js](api/leaderboard/unified.js), streak/badge engine [api/_lib/streaks.js](api/_lib/streaks.js) (migration [api/_lib/migrations/20260712020000_leaderboard_streaks_badges.sql](api/_lib/migrations/20260712020000_leaderboard_streaks_badges.sql)), daily Top-10 badge sweep [api/cron/leaderboard-rollup.js](api/cron/leaderboard-rollup.js) | Live | Five real, queried leaderboard metrics — creations (forge models + worlds), remixes received, coin launches, followers, and walk distance (signed-in walkers, all-time) — ranked live with the viewer's own rank pinned even off-page. Every signed-in qualifying action (login, a finished forge model, a saved world, a `/walk` session) rolls a per-user daily streak in `user_streaks` via `recordDailyActivity()`, called from [api/_lib/auth.js](api/_lib/auth.js), [api/_lib/forge-store.js](api/_lib/forge-store.js), [api/_lib/diorama-store.js](api/_lib/diorama-store.js), and [api/walk/metrics.js](api/walk/metrics.js). Four real earned badges persist in `user_badges`: First Creation, Remixed (awarded in [api/x402/remix-asset.js](api/x402/remix-asset.js) when a remix lands on your creation), 7-Day Streak, and a daily-refreshed `top10_<metric>` per leaderboard. Streak + badges surface on the profile ([pages/profile.html](pages/profile.html)) and the Rankings page itself. Rejected metrics (documented in `api/leaderboard/unified.js`'s header): royalties earned in USD (the settlement record is a single overwritten JSONB column, not a cumulative ledger) and `/play` activity (no per-human-user session table exists). || Daily Match (agent output arena) | [pages/daily-match.html](pages/daily-match.html) `→ /daily-match`, backend [api/leaderboard/daily-match.js](api/leaderboard/daily-match.js) | Live | Live daily standings ranking public agents by real output shipped since 00:00 UTC: agent_actions events, sniper + pump trades, confirmed skill sales, and coin launches, with realized sniper P&L shown for context (never scored). Computed live per request (no rollup cron), resets naturally at UTC midnight; includes yesterday's champion and a live-output feed. Reputation-first: no payouts hang off the score. Format adopted with credit from Bowyer's Arena (bowyer.app/arena), who build their agent pages on three.ws avatars. |@@ -126,7 +127,7 @@ bottom.| Avatar Seeder control room | [pages/admin/seeder.html](pages/admin/seeder.html) + [src/admin-seeder.js](src/admin-seeder.js) `→ /admin/seeder`, backend [api/admin/seeder.js](api/admin/seeder.js) | In-repo (admin, noindex) | Arm/disarm the headless [Avaturn seed cron](api/cron/avaturn-seed-cron.js), watch live throughput + rig rate, and preview freshly-forged rigged avatars in 3D. Toggles the `avaturn_seed` runtime flag. Flags: [api/_lib/flags.js](api/_lib/flags.js) + [api/admin/flags.js](api/admin/flags.js). Docs: [docs/ops/runtime-flags.md](docs/ops/runtime-flags.md) || On-chain agent invocation | [contracts/agent-invocation/](contracts/agent-invocation) | In-repo | Anchor program: verifiable agent-to-agent skill invocation events. SDK: [agent-protocol-sdk/](agent-protocol-sdk) || Cross-chain SDKs | [sdk/](sdk), [solana-agent-sdk/](solana-agent-sdk), [agent-payments-sdk/](agent-payments-sdk), [agent-protocol-sdk/](agent-protocol-sdk) | Published | Cross-chain agent SDKs |-| MCP integration | [mcp-server/](mcp-server), [mcp-bridge/](mcp-bridge), [packages/*-mcp/](packages) | 35 npm servers + 7 hosted remote (42 total, incl. the free `/api/mcp-studio` 3D Studio), all in the [MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas) — canonical metadata: [prompts/store-submissions/_generated/mcp-listing-source.json](prompts/store-submissions/_generated/mcp-listing-source.json) | Model Context Protocol surface — full server list in [docs/mcp.md](docs/mcp.md) |+| MCP integration | [mcp-server/](mcp-server), [mcp-bridge/](mcp-bridge), [packages/*-mcp/](packages) | 35 npm servers + 7 hosted remote (42 total, incl. the free `/api/mcp-studio` 3D Studio), all in the [MCP registry](https://registry.modelcontextprotocol.io/?q=io.github.nirholas). Canonical metadata: [prompts/store-submissions/_generated/mcp-listing-source.json](prompts/store-submissions/_generated/mcp-listing-source.json) | Model Context Protocol surface, full server list in [docs/mcp.md](docs/mcp.md). Searchable index of every tool: [pages/mcp-tools.html](pages/mcp-tools.html) `→ /mcp-tools`, rendered from the generated [public/mcp-catalog.json](public/mcp-catalog.json) ([scripts/build-mcp-catalog.mjs](scripts/build-mcp-catalog.mjs), `npm run build:mcp-catalog`, staleness gated by `npm run audit:mcp-catalog`). Tool safety annotations are verified against each handler by [scripts/audit-mcp-safety.mjs](scripts/audit-mcp-safety.mjs) (`npm run audit:mcp-safety`, rules in [scripts/lib/mcp-safety-check.mjs](scripts/lib/mcp-safety-check.mjs), guarded-file list shared with the golden snapshot via [scripts/lib/mcp-tool-sources.mjs](scripts/lib/mcp-tool-sources.mjs)); docs [docs/mcp-safety.md](docs/mcp-safety.md) `→ /docs/mcp-safety`. Tests: [tests/mcp-safety-audit.test.js](tests/mcp-safety-audit.test.js), [tests/mcp-catalog.test.js](tests/mcp-catalog.test.js) || Agent Skills pack | [.agents/skills/](.agents/skills) → manifest [.agents/skills/SKILLS.md](.agents/skills/SKILLS.md), [.agents/skills/skills-pack.json](.agents/skills/skills-pack.json) | In-repo; bundled in the `three-ws-core` [plugin](.claude-plugin/marketplace.json) | 40 portable `SKILL.md` folders (Agent Skills open standard) for any Claude surface — 3d/creative (cross-platform-safe), wallet/payments, intel/trading. Regenerate manifest: `node scripts/build-skills-pack.mjs`. Docs: [docs/agent-skills.md](docs/agent-skills.md) || Claude Code plugin marketplace | [marketplace/](marketplace) → plugins [three-ws-3d](marketplace/plugins/three-ws-3d), [three-ws-developer](marketplace/plugins/three-ws-developer) | In-repo · installable via `/plugin marketplace add nirholas/three.ws` | 3D generation + rigged avatars inside Claude Code (free lane + paid x402 tools) and developer tooling for building on three.ws. Index: [marketplace/README.md](marketplace/README.md) || SNS naming + pay-by-name | [api/sns.js](api/sns.js), [api/sns-subdomain.js](api/sns-subdomain.js), [api/threews/subdomain.js](api/threews/subdomain.js), [api/x402/pay-by-name.js](api/x402/pay-by-name.js), [src/solana/sns-subdomain.js](src/solana/sns-subdomain.js), [pages/threews-claim.html](pages/threews-claim.html) | In-repo | `*.threews.sol` subdomain mint, x402 payments addressed by name. Env: `THREEWS_SOL_PARENT_SECRET_BASE58` |diff --git a/blog/monetize-mcp-server-x402-paid-tools.html b/blog/monetize-mcp-server-x402-paid-tools.htmlindex 6b59d999c..c77b9134c 100644--- a/blog/monetize-mcp-server-x402-paid-tools.html+++ b/blog/monetize-mcp-server-x402-paid-tools.html@@ -236,50 +236,45 @@ export default paid(<h2 id="inside">Step 4: charge inside a tool call</h2><p>For shape B the payment rides in the MCP message itself. An unpaid <code>tools/call</code> returns a payment-required envelope quoting the price and the receiving address. The client signs, retries with the payload in <code>_meta["x402/payment"]</code>, and the settlement receipt comes back in <code>_meta["x402/payment-response"]</code>. x402-capable clients run that loop without asking the user anything.</p>- <p>The same three primitives that back <code>paid()</code> are exported for this, so you keep one wire contract across both shapes:</p>- <pre><code>import {- buildChallenge,- verifyPayment,- settlePayment,- NETWORK_SOLANA_MAINNET,-} from '@three-ws/x402-server';--const requirements = [{- scheme: 'exact',- network: NETWORK_SOLANA_MAINNET,- asset: 'usdc',- payTo: process.env.X402_PAY_TO_SOLANA,- amount: '20000', // $0.02- maxTimeoutSeconds: 60,-}];--server.registerTool('summarize_document', schema, async (args, extra) => {- const header = extra?._meta?.['x402/payment'];-- if (!header) {- const challenge = buildChallenge({- price: '20000',- asset: 'usdc',- payTo: { solana: process.env.X402_PAY_TO_SOLANA },- description: 'Document summarization',- });- return { isError: true, content: [{ type: 'text', text: JSON.stringify(challenge) }] };- }-- const verified = await verifyPayment({ paymentHeader: header, requirements });- if (!verified.ok) {- return { isError: true, content: [{ type: 'text', text: JSON.stringify(verified.body) }] };- }-- const summary = await summarize(args.text);- const receipt = await settlePayment({ verified });-- return {- content: [{ type: 'text', text: summary }],- _meta: { 'x402/payment-response': receipt },- };-});</code></pre>+ <p>Do not hand-roll that envelope. The <code>@x402/mcp</code> transport package builds it, and one resource server per process handles verification and settlement for every paid tool you register:</p>+ <pre><code>import { HTTPFacilitatorClient, x402ResourceServer } from '@x402/core/server';+import { declareDiscoveryExtension } from '@x402/extensions/bazaar';+import { createPaymentWrapper, createToolResourceUrl } from '@x402/mcp';+import { registerExactSvmScheme } from '@x402/svm/exact/server';++const NETWORK_SOLANA_MAINNET = 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp';++const resourceServer = new x402ResourceServer([+ new HTTPFacilitatorClient({ url: 'https://facilitator.payai.network' }),+]);+registerExactSvmScheme(resourceServer, {});+await resourceServer.initialize();++const resourceUrl = createToolResourceUrl('summarize_document');+const accepts = await resourceServer.buildPaymentRequirementsFromOptions(+ [{+ scheme: 'exact',+ network: NETWORK_SOLANA_MAINNET,+ payTo: process.env.X402_PAY_TO_SOLANA,+ price: '$0.02',+ maxTimeoutSeconds: 60,+ extra: { name: 'USDC', decimals: 6 },+ }],+ { resourceUrl },+);++const wrap = createPaymentWrapper(resourceServer, {+ accepts,+ resource: { url: resourceUrl, description, mimeType: 'application/json' },+ extensions: declareDiscoveryExtension({ toolName: 'summarize_document', description, transport: 'stdio', inputSchema }),+});++server.registerTool('summarize_document', schema, wrap(async (args) => ({+ content: [{ type: 'text', text: await summarize(args.text) }],+})));</code></pre>+ <p>The wrapper answers an unpaid call with the challenge, verifies the retry, runs your handler, settles, and attaches the receipt. <code>declareDiscoveryExtension</code> is the part people skip: it is what puts your tool in the catalogs agents search when they go shopping.</p><p><strong>Ship one free tool alongside the paid ones.</strong> A tool named something like <code>getting_started</code> that returns your price list and explains the payment flow costs you nothing and removes the guesswork for a client that has never paid an MCP tool before. Every paid connector we run has one, and it is consistently the first tool a new caller invokes.</p>+ <p>A complete, runnable version of this shape (one free tool, one paid tool, 15 tests, real SSRF-guarded work) is in <a href="https://github.com/nirholas/three.ws/tree/main/examples/paid-mcp-server" rel="noopener">examples/paid-mcp-server</a>, and the step-by-step build is the tutorial <a href="/tutorials/monetize-mcp-server">Monetize an MCP server</a>.</p><h2 id="verify">Step 5: verify it against a real 402</h2><p>Before trusting your own implementation, look at a working one. This is a live production endpoint, and the response below is what it returns right now to an unpaid request:</p>diff --git a/data/changelog.json b/data/changelog.jsonindex ff2aa6761..6f4ce02c9 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,27 @@{"$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-30",+ "title": "A searchable catalog of every tool three.ws gives an AI assistant",+ "summary": "three.ws publishes 270 tools that AI assistants can call, spread across 36 servers, and until now the only way to see them all was to query each server. The new catalog page lists every one in a single searchable view: what it does, which server hosts it, what it costs in USDC, and whether an assistant can run it without asking you first. Filter by any of those and the link you copy keeps the filter. The same data is published as a single file any agent can fetch to discover the whole surface in one request. Both are generated from the source of each tool on every build, so unlike the hand-written table they replace they cannot fall out of date.",+ "tags": [+ "feature",+ "docs"+ ],+ "link": "/mcp-tools"+ },+ {+ "date": "2026-07-30",+ "title": "Agent payment sessions are now fully documented, tested, and easier to size correctly",+ "summary": "Payment sessions let an AI agent spend a budget you set without ever holding a private key, and the feature shipped without a full reference entry or a single test on the code that enforces the limits. The complete API is now documented endpoint by endpoint, including every governance refusal and what happens when a payment is submitted but never confirmed. The enforcement layer has 49 tests covering the budget race, the host allowlist, per-payment ceilings, and refunds. Two runnable examples ship with the payments MCP package, one of which reads what a paid endpoint actually charges so you can size a budget from real prices instead of guessing. A configuration bug meant setting PAYMENT_SESSION_SECRET had no effect and session tokens were quietly keyed to an unrelated secret, which is fixed.",+ "tags": [+ "docs",+ "fix",+ "improvement"+ ],+ "link": "/docs/api-reference"+ },{"date": "2026-07-30","title": "The examples page now lists every example that ships, not a hand-picked five",@@ -17388,6 +17409,16 @@"feature","infra"]+ },+ {+ "date": "2026-07-30",+ "title": "A runnable wallet sign-in example and a step-by-step tutorial",+ "summary": "Signing in with a Solana or Ethereum wallet was documented as a reference but there was nothing you could run. There is now a working demo page that performs the whole round trip against the live API, shows you the exact message your wallet signed, and logs every request with its real status code, plus a tutorial that walks the same flow line by line. Both spell out the four things that quietly break a first integration: the domain check that rejects a message built from a development address, the anti-forgery header the verify step requires, the two different responses that both mean signed out, and the field the API puts its error code in.",+ "tags": [+ "docs",+ "sdk"+ ],+ "link": "/tutorials/wallet-sign-in"}]}diff --git a/data/pages.json b/data/pages.jsonindex 0de66fde8..46b82f10e 100644--- a/data/pages.json+++ b/data/pages.json@@ -3368,6 +3368,13 @@"changefreq": "monthly","added": "2026-07-30"},+ {+ "path": "/tutorials/wallet-sign-in",+ "title": "Tutorial · Add Wallet Sign-In to Your App",+ "description": "Authenticate visitors with Phantom, Backpack, Solflare, or MetaMask: the Sign-In with Solana round trip end to end, the domain check that rejects dev origins, CSRF on verify, both signed-out response shapes, and error codes mapped to fixes.",+ "priority": 0.8,+ "changefreq": "monthly"+ },{"path": "/tutorials/agent-spending-envelope","title": "Tutorial · Give an Agent a Spending Envelope",@@ -4384,6 +4391,21 @@"priority": 0.5,"changefreq": "monthly","added": "2026-07-30"+ },+ {+ "path": "/tutorials/earn-and-spend-in-play",+ "title": "Tutorial · Earn and spend in /play",+ "description": "Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin the wheel. Covers why the world has two currencies that never touch, and why the server decides every price.",+ "priority": 0.8,+ "changefreq": "monthly",+ "added": "2026-07-30"+ },+ {+ "path": "/docs/showcase",+ "title": "Docs: The showcase",+ "description": "The public directory of ERC-8004 agents that registered a real 3D avatar. Nothing is curated: an agent appears because the crawler verified its on-chain metadata resolves to a usable model. Covers the qualifying rules and the keyset-paginated API.",+ "priority": 0.7,+ "changefreq": "monthly"}]},diff --git a/docs/animations.md b/docs/animations.mdindex e62ad2bdb..cedf1cb3e 100644--- a/docs/animations.md+++ b/docs/animations.md@@ -53,24 +53,65 @@ Retarget sources are deliberately never committed: everything in `animation-sour## Agent slots-Slots are the fixed vocabulary the agent avatar uses to express emotion/gesture. They resolve to clip names at runtime. Defined in `src/runtime/animation-slots.js`.+Slots are the fixed vocabulary the agent avatar uses to express emotion and gesture. They resolve to clip names at runtime. Defined in `src/runtime/animation-slots.js`.| Slot | Default clip | Notes ||---|---|---|| `idle` | `idle` | Always playing |-| `wave` | `reaction` | Maps to `reaction`, not the `wave` clip |-| `nod` | `reaction` | |-| `shake` | `angry` | |-| `think` | `pray` | |+| `wave` | `wave` | |+| `nod` | `nod` | |+| `shake` | `xbot-head-shake` | A "no" head shake. The only baked head-shake clip |+| `think` | `think` | || `celebrate` | `celebrate` | || `concern` | `defeated` | |-| `bow` | `sitclap` | |-| `point` | `reaction` | |-| `shrug` | `defeated` | |+| `bow` | `sitclap` | **Approximation.** No bow clip is baked; `sitclap` reads as gratitude. The one slot whose clip does not mean what the slot means |+| `point` | `point` | |+| `shrug` | `shrug` | || `fidget` | `av-waiting` | Real baked idle-fidget loop (was the never-baked `Fidget`, fixed 2026-07-08) || `dance` | `rumba` | |+| `inspect` | `lookdown` | Reading data, examining a chart |+| `present` | `av-brag-claps` | Showing a result off |+| `sign` | `xbot-agree` | Authorizing a wallet signature |+| `curiosity` | `av-spy` | Looking around, alert |+| `patience` | `av-waiting` | Waiting on a long task |+| `manipulate` | `av-push-block` | Handling a scene object |+| `conjure` | `av-conductor` | Creating something from nothing |-Agents can override individual slots via `meta.edits.animations`.+Agents can override individual slots via `meta.edits.animations`:++```json+{ "edits": { "animations": { "dance": "av-offabean-dance", "think": "av-smoking" } } }+```++An override wins over the default; any clip name in the manifest is valid. Unmapped slot names fall through to a clip of the same name, so an agent can point a slot at a clip the platform never wired.++## Skill animation hints++A skill declares `animationHint` (see `src/agent-skills.js` and its siblings) and the avatar plays the matching slot when that skill starts. `resolveHint()` maps a hint to a slot: exact slot names pass through, the namespaced `gesture-*` family aliases onto one, and an unknown hint in a known family falls back to that family so a new `gesture-something` still animates.++| Hint | Slot | Declared by |+|---|---|---|+| `inspect` | `inspect` | read-only lookups (19 skills, the most common hint in the catalog) |+| `gesture` | `point` | trade and launch actions (19 skills) |+| `curiosity` | `curiosity` | scanning and discovery skills |+| `think` | `think` | reasoning skills |+| `celebrate` | `celebrate` | successful launches and claims |+| `present` | `present` | `present-model` |+| `wave` | `wave` | greetings |+| `nod` | `nod` | acknowledgements |+| `sign` | `sign` | `sign-action` (wallet signature) |+| `patience` | `patience` | long-running work |+| `concern` | `concern` | failure paths |+| `gesture-magic` | `conjure` | `scene-create-object` |+| `gesture-manipulate` | `manipulate` | `scene-update-object` |++`tests/animation-slots.test.js` scans every `animationHint` literal under `src/` and fails if one resolves to no slot, or to a clip missing from the manifest. That guard exists because a hint nobody wired up reads exactly like a working one at the call site: `inspect`, `gesture`, `present`, `sign`, `curiosity` and `patience` silently played nothing until 2026-07-30, and the two commonest of them covered 38 skill declarations.++The walk state machine keeps a parallel gesture library (`src/animation-state-machine.js` `GESTURES`) for player-driven gestures on `/walk`, with an `upper`/`full` layer per gesture so an avatar can wave or shrug while it keeps walking. Those clip names are held to the manifest by `tests/walk-gestures.test.js`.++## Keeping the registry true++`public/animations/registry.json` is regenerated by `scripts/sync-animation-registry.mjs` (`npm run sync:animation-registry`, and automatically at the end of `npm run build:animations`). It derives each clip's label, icon and loop flag from the built manifest, its source path from `scripts/animations.config.json`, and its `agent_slots` by reversing `DEFAULT_ANIMATION_MAP`, so a slot can never be recorded on two clips. Hand-written `note` fields survive. `tests/animation-registry.test.js` fails if the committed file is not what the script would produce.## The /animations gallerydiff --git a/docs/cookbook/mcp-3d-tool.md b/docs/cookbook/mcp-3d-tool.mdnew file mode 100644index 000000000..58aa73202--- /dev/null+++ b/docs/cookbook/mcp-3d-tool.md@@ -0,0 +1,130 @@+# Give your AI assistant a 3D tool++Model Context Protocol is how Claude Code, Claude Desktop, Cursor, and a growing+list of other clients pick up tools. This recipe is an MCP server that hands any+of them two abilities: generate a 3D model from text, and look at a 3D model.++**[Download `mcp_3d_server.mjs`](/cookbook/recipes/mcp_3d_server.mjs)**, then:++```bash+npm install @modelcontextprotocol/sdk zod+claude mcp add three-ws-3d -- node /absolute/path/to/mcp_3d_server.mjs+```++Or wire it into any MCP client's config by hand:++```json+{+ "mcpServers": {+ "three-ws-3d": {+ "command": "node",+ "args": ["/absolute/path/to/mcp_3d_server.mjs"]+ }+ }+}+```++Then ask your assistant for a model and it will build one. No API key anywhere+in that config, because the underlying lane is keyless.++## The two tools++| Tool | Input | Returns |+|---|---|---|+| `generate_3d_model` | `prompt` | The GLB URL, a viewer link, and an AR link |+| `render_3d_model` | `glbUrl`, `size` | A PNG **inline as an image**, so the model can see it |++`render_3d_model` is the interesting half. Returning the image as MCP image+content rather than a URL means a vision-capable client actually looks at the+geometry it just produced:++```js+const bytes = Buffer.from(await res.arrayBuffer());+return {+ content: [{ type: 'image', data: bytes.toString('base64'), mimeType: 'image/png' }],+};+```++That closes the generate-then-inspect loop inside the conversation. The+[self-correcting 3D notebook](/cookbook/self-correcting-3d) builds the same loop+explicitly with the Responses API; here you get it for free because the client+already has vision.++## Verifying it before you wire it up++An MCP server that fails to boot looks identical to one that is merely not+configured yet, which is a miserable thing to debug from inside a client. Smoke+test it over stdio first:++```bash+printf '%s\n' \+ '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"smoke","version":"1"}}}' \+ '{"jsonrpc":"2.0","method":"notifications/initialized"}' \+ '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \+ | node mcp_3d_server.mjs+```++A healthy server answers the initialize handshake and then lists both tools. If+that works, any conforming client will work.++## Annotations are not decoration++Both tools declare what they do to the world:++```js+annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true },+```++Clients use these to decide what needs a confirmation prompt. `readOnlyHint`+says this call changes nothing the user owns; `openWorldHint` says it reaches+the public internet. Getting them wrong in either direction is a real bug:+too permissive and a destructive tool runs unprompted, too strict and every+harmless call nags. Declare them honestly.++## Description text is the tool's real interface++The model never reads your code. It reads the description, and that is the only+thing standing between a good call and a wasted 90 seconds:++```js+description:+ 'Turn a text prompt into a real, textured 3D model (GLB) and return its URL. ' ++ 'Free draft tier: single-subject prompts work best ("a wooden treasure chest"), ' ++ 'no rigging. Takes roughly 60 to 120 seconds.',+```++Three things are packed in there deliberately: what the tool produces, what kind+of prompt actually works on this tier, and how long it takes. The last one stops+a client from firing a duplicate call because it assumed the first had hung.++## Polling, again++The server carries the same poll discipline as the+[command-line recipe](/cookbook/text-to-3d-cli): honor `retryAfter`, clamp it to+a sane window, and bound the total wait.++```js+function pollDelay(payload) {+ const seconds = Number(payload?.retryAfter);+ if (!Number.isFinite(seconds)) return MIN_POLL_MS;+ return Math.max(MIN_POLL_MS, Math.min(MAX_POLL_MS, seconds * 1000));+}+```++Ten minutes is the ceiling. A tool call that hangs forever is worse than one that+fails with a clear message, because the client has no way to tell the difference+between slow and stuck.++## Already using three.ws?++If you want the full platform surface (avatars, rigging, animation, agents)+rather than just text-to-3D, the hosted MCP server at `https://three.ws/api/mcp`+exposes it, and [the MCP docs](/docs/mcp) cover the tool list. This recipe is the+opposite trade: a small file you own and can modify, wrapping only the free+endpoints.++## Where to go next++- **The MCP surface three.ws already hosts** → [MCP docs](/docs/mcp)+- **The same loop, driven explicitly** → [A self-correcting 3D collectible set](/cookbook/self-correcting-3d)+- **The full endpoint reference** → [3D API docs](/docs/3d-api)diff --git a/docs/cookbook/parallel-asset-pack.md b/docs/cookbook/parallel-asset-pack.mdnew file mode 100644index 000000000..a0ddb98a3--- /dev/null+++ b/docs/cookbook/parallel-asset-pack.md@@ -0,0 +1,149 @@+# Build a whole asset pack in parallel++One model is a demo. A game level, a product catalog, or a scene needs twenty,+and generating them one at a time means waiting half an hour for something that+should take three minutes.++**[Download `asset_pack.py`](/cookbook/recipes/asset_pack.py)** (it imports+[`text_to_3d.py`](/cookbook/recipes/text_to_3d.py), so keep both in the same+folder) and run:++```bash+python3 asset_pack.py "a clay flower pot with a saucer" "a woven wicker basket" "a brass watering can" --out ./garden-pack+```++```+building 3 models with 3 workers into garden-pack/+ [ok ] a clay flower pot with a saucer 82s+ [ok ] a woven wicker basket 85s+ [ok ] a brass watering can 101s++3/3 built in 101s+open garden-pack/index.html+```++101 seconds for three models, not 268. The slowest job sets the wall clock.++## What it writes++```+garden-pack/+ manifest.json every prompt, its GLB URL, local paths, timings+ index.html an interactive gallery (orbit, zoom, AR on phones)+ models/<slug>.glb the downloaded models+ stills/<slug>.png a 1024px render of each model+```++`manifest.json` is the part you build on. It records what succeeded, what failed+and why, and how long each took, so a later step can retry only the failures:++```jsonc+{+ "generator": "three.ws cookbook / parallel-asset-pack",+ "tier": "free draft",+ "seconds": 101.4,+ "assets": [+ {+ "prompt": "a woven wicker basket",+ "slug": "a-woven-wicker-basket",+ "ok": true,+ "glb_url": "https://.../cf3af68b.glb",+ "glb_path": "models/a-woven-wicker-basket.glb",+ "still_path": "stills/a-woven-wicker-basket.png",+ "seconds": 85.1,+ "warnings": []+ }+ ]+}+```++Feed prompts from a file when there are more than a handful:++```bash+python3 asset_pack.py --prompts-file props.txt --out ./level-01 --workers 3+```++Blank lines and `#` comments in the file are skipped, so it doubles as a+readable asset list you can keep in version control.++## Three decisions worth copying++### Concurrency is deliberately low++```python+DEFAULT_WORKERS = 3+```++The free lane is a shared GPU pool. Twenty concurrent submissions do not finish+sooner; they queue behind each other while every one of them burns poll requests+against the flood guard. Two or three is the sweet spot. Raise it only after you+have measured that the lane keeps up.++### A failed still is a warning, a failed generation is a failure++```python+try:+ render_still(asset.glb_url, still_path)+ asset.still_path = str(still_path.relative_to(out))+except (ForgeError, urllib.error.URLError, OSError) as exc:+ asset.warnings.append(f"still render skipped: {exc}")++asset.ok = True+```++The still is a convenience. If the renderer is briefly unavailable, the model is+still perfectly good, and failing the whole asset over a missing thumbnail would+be the pipeline sabotaging itself. Generation failing is different: there is no+asset, so the entry is marked failed and carries its error into the manifest.++This is the same principle the [self-correcting 3D notebook](/cookbook/self-correcting-3d)+applies to its vision critic: a guardrail that can take down the pipeline it+guards is worse than no guardrail.++### Results keep their input order++`as_completed` yields futures in finish order, which is not submission order.+Writing results into a pre-sized list by index keeps the manifest and the gallery+in the order you asked for:++```python+assets = [None] * len(prompts)+futures = {pool.submit(build_one, prompt, out, slug): i for i, (...) in enumerate(...)}+for future in concurrent.futures.as_completed(futures):+ assets[futures[future]] = future.result()+```++Small detail, but a pack whose order shuffles on every run is miserable to diff.++## The gallery++`index.html` is written from a template in the script. It uses+`<model-viewer>` from a CDN for orbit, zoom, and AR on phones, and it degrades+honestly: failed prompts render as dashed cards carrying their error text, so a+partial pack looks partial instead of looking complete.++Filenames are deduplicated before anything is written:++```python+def unique_slugs(prompts):+ """Stable, collision-free filenames even when two prompts slugify alike."""+```++Two prompts that slugify to the same string would otherwise silently overwrite+each other's GLB, and you would ship a pack with a duplicate model in it.++## Gate the output++A pack is exactly the point where you want a budget check before anything ships:++```bash+python3 asset_gate.py garden-pack/models/*.glb --max-triangles 100000+```++See [Gate 3D assets in CI](/cookbook/asset-quality-gate).++## Where to go next++- **The single-model client this builds on** → [Text to 3D from the command line](/cookbook/text-to-3d-cli)+- **Let a model choose the prompts** → [A self-correcting 3D collectible set](/cookbook/self-correcting-3d)+- **The full endpoint reference** → [3D API docs](/docs/3d-api)diff --git a/docs/cookbook/text-to-3d-cli.md b/docs/cookbook/text-to-3d-cli.mdnew file mode 100644index 000000000..12a2851a4--- /dev/null+++ b/docs/cookbook/text-to-3d-cli.md@@ -0,0 +1,140 @@+# Text to 3D from the command line++**[Download `text_to_3d.py`](/cookbook/recipes/text_to_3d.py)** and run it:++```bash+python3 text_to_3d.py "a wooden treasure chest with iron bands"+```++```+prompt: a wooden treasure chest with iron bands+ glb: https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/.../176ed971.glb+ viewer: https://three.ws/viewer?src=...+ ar: https://three.ws/api/ar?src=... (open on a phone to place it in your room)+saved 1651 KB to a-wooden-treasure-chest-with-iron-bands.glb+```++That is the whole recipe. No API key, no account, no `pip install`. The file is+about 160 lines of standard-library Python, and roughly a third of it is there+to handle the two things that actually go wrong in production.++## What you get++A single file with three reusable pieces:++| Function | What it does |+|---|---|+| `generate(prompt)` | Submits the prompt, waits out the queue, returns the finished payload |+| `download(url, path)` | Streams a GLB to disk without loading it all into memory |+| `slugify(text)` | Turns a prompt into a safe filename |++Import it as a module and you have a text-to-3D client:++```python+from text_to_3d import generate, download++result = generate("a small ceramic teapot with a bamboo handle")+download(result["glbUrl"], "teapot.glb")+print(result["viewerUrl"])+```++## The two things that go wrong++### 1. The response has two shapes, not one++`POST /api/3d/generate` answers **inline** when the draft finishes quickly:++```jsonc+{ "status": "done", "glbUrl": "https://.../model.glb", "viewerUrl": "...", "arUrl": "..." }+```++and hands back a **job handle** when the shared GPU lane is busy:++```jsonc+{ "status": "pending", "job": "f1.eyJ...", "retryAfter": 8, "etaSeconds": 45 }+```++A client that only handles the first shape works perfectly in testing and breaks+the first time the lane is under load. The recipe folds both into one loop that+always ends at the same place:++```python+payload = _request(API, {"prompt": prompt, "format": "glb"})++while payload.get("status") == "pending":+ ...+ time.sleep(delay)+ payload = _request(f"{API}?job={job}&title={prompt}")+```++### 2. Polling faster than you were told++Every pending response carries `retryAfter` in seconds, and the endpoint sets+the standard `Retry-After` header alongside it. Ignore it and you trip the poll+flood guard, get a 429, and slow down the exact lane you are waiting on.++```python+def _poll_delay(payload):+ """Honor the server's retryAfter hint, clamped to a sane range."""+ hint = payload.get("retryAfter")+ try:+ seconds = float(hint)+ except (TypeError, ValueError):+ return MIN_POLL_SECONDS+ return max(MIN_POLL_SECONDS, min(MAX_POLL_SECONDS, seconds))+```++The clamp only ever fires when the hint is missing or absurd. Inside the 2 to 30+second window, the server's number wins. This is the polite-client pattern, and+it is the difference between a script that scales and one that gets rate limited.++## Errors you can act on++`urllib` raises `HTTPError` with the body still unread, so the useful part of a+failure is easy to lose. The recipe reads it and surfaces the API's own message:++```python+except urllib.error.HTTPError as exc:+ body = exc.read().decode(errors="replace")+ detail = json.loads(body).get("error_description")+ raise ForgeError(f"HTTP {exc.code} from {url}: {detail}")+```++So a rejected prompt tells you why:++```+generation failed: HTTP 400 from https://three.ws/api/3d/generate: prompt must be at least 3 characters+```++instead of the stack trace you would otherwise get.++## What the free tier actually is++The free lane is NVIDIA NIM TRELLIS. Be honest with yourself about what it+produces:++- **Single subject.** "a brass watering can" works. "a kitchen scene with a+ table, three chairs and a window" does not; you get a blob.+- **Draft fidelity.** Expect 20k to 150k triangles of reasonable silhouette with+ soft detail.+- **Often vertex-colored, with no material.** Color lives in a `COLOR_0`+ attribute rather than a PBR material. It renders in full color and ignores+ your lighting rig. The [asset quality gate](/cookbook/asset-quality-gate)+ recipe explains how to check for this.+- **No rigging.** Nothing to animate. Rigged, animation-ready characters are a+ paid tier.++Every response links to the paid tiers in an `upgrade` block if you need more.++## Timing++Measured on the live lane while writing this recipe: a single model took roughly+60 to 105 seconds end to end, including the download. Anything much longer means+the lane is queued, which is exactly when `retryAfter` starts mattering.++## Where to go next++- **Many prompts at once** → [Build a whole asset pack in parallel](/cookbook/parallel-asset-pack)+- **Give the tool to an AI assistant** → [Give your AI assistant a 3D tool](/cookbook/mcp-3d-tool)+- **Stop bad models reaching production** → [Gate 3D assets in CI](/cookbook/asset-quality-gate)+- **The full endpoint reference** → [3D API docs](/docs/3d-api)diff --git a/docs/mcp-tools.md b/docs/mcp-tools.mdindex b70d57989..8c6584ed2 100644--- a/docs/mcp-tools.md+++ b/docs/mcp-tools.md@@ -138,3 +138,6 @@ promote no specific token.- [MCP](mcp.md) overview · [3D Studio MCP](mcp-studio.md) ·[3D Studio (paid)](mcp-3d-studio.md) · [x402 bazaar](mcp-x402-bazaar.md)- [x402 paid endpoints](x402-endpoints.md) — the same capabilities over REST.+- [MCP tool safety](mcp-safety.md) - what each tool's safety annotations mean,+ and the build check that verifies them against the code.+- [The full catalog](/mcp-tools) - every tool, searchable by safety and price.diff --git a/docs/mcp.md b/docs/mcp.mdindex 1113881b6..8dd8d647a 100644--- a/docs/mcp.md+++ b/docs/mcp.md@@ -807,6 +807,8 @@ Contributors: `npm run audit:mcp-safety` enforces this. It parses each tool's ha## Related- [MCP Tools Catalog](/docs/mcp-tools): every three.ws MCP tool, its server, and its price+- [MCP tool safety](/docs/mcp-safety): what the safety annotations promise, and how they are verified+- [MCP Tool Catalog](/mcp-tools): the searchable index of all 270 tools, generated from source- [3D Studio MCP (free)](/docs/mcp-studio): the no-auth, no-payment 3D generation server- [Spatial MCP](/docs/spatial-mcp): returning live 3D scenes as native MCP responses- [x402](/docs/x402): the USDC micropayment rail behind the paid toolsdiff --git a/docs/showcase.md b/docs/showcase.mdnew file mode 100644index 000000000..f9b2ff23e--- /dev/null+++ b/docs/showcase.md@@ -0,0 +1,69 @@+# The showcase: on-chain agents that have a body++`/showcase` is the public directory of **ERC-8004 agents that registered a 3D avatar**. It is not a curated editorial list and nothing here is hand-picked. An agent appears because it registered on-chain and its metadata resolved to a real 3D model, which is a fact the crawler checks rather than a claim anyone makes.++That filter is the whole point of the surface. The ERC-8004 registries hold plenty of agents that are only an address and a URI. The showcase answers a narrower question: which of them can actually be seen and embedded.++Live at [three.ws/showcase](https://three.ws/showcase). Related reading: [ERC-8004](./erc8004.md) for the identity standard itself, [on-chain deployments](./deployments.md) for the live feed of every registration as it lands (with no avatar filter), and [on-chain agents](./onchain-agents.md) for registering one yourself.++Code: [api/showcase.js](../api/showcase.js). Data comes from `erc8004_agents_index`, populated by the `erc8004-crawl` cron.++---++## What qualifies an agent++Two conditions, both checked against indexed on-chain data:++1. The agent is registered in an ERC-8004 Identity Registry the crawler indexes.+2. `has_3d` is true, meaning its resolved metadata carries a usable 3D model.++Nothing else. There is no ranking score, no editorial pass, and no way to buy a slot. Ordering is purely chronological by registration time.++## API++`GET /api/showcase` is public, needs no key, and is rate-limited per IP.++```bash+# Newest registrations with a 3D avatar, across mainnet chains+curl -s 'https://three.ws/api/showcase?limit=5'++# Oldest first+curl -s 'https://three.ws/api/showcase?sort=oldest'++# One or more specific chains, by numeric chain id+curl -s 'https://three.ws/api/showcase?chain=8453'+```++| Parameter | Default | Accepts | Notes |+|---|---|---|---|+| `sort` | `newest` | `newest`, `oldest` | Anything else is a `400 validation_error` |+| `limit` | `24` | 1 to 60 | Values above 60 clamp to 60; unparseable values fall back to 24 |+| `chain` | all mainnet chains | comma-separated numeric chain ids | An unknown id is a `400`, naming the offending value |+| `cursor` | none | opaque string from `next_cursor` | An unparseable cursor is a `400`, not a silent first page |++Omitting `chain` selects every mainnet chain the crawler knows. Testnet chains are excluded unless you ask for them explicitly.++### Pagination is keyset, not offset++Paging uses a keyset cursor over `(registered_at, chain_id, agent_id)` rather than an offset. That matters here because the crawler inserts continuously: with an offset, a registration landing between two requests shifts every later page and you would see duplicates or skip agents. The keyset cursor is stable under concurrent inserts.++Follow `next_cursor` until it comes back `null`:++```bash+curl -s 'https://three.ws/api/showcase?limit=24'+# then, with next_cursor from that response:+curl -s 'https://three.ws/api/showcase?limit=24&cursor=<NEXT_CURSOR>'+```++Do not construct a cursor by hand. It encodes the sort key triple, and a malformed one is rejected rather than guessed at.++### Response++Each agent carries its on-chain identity plus explorer links resolved from the chain's metadata: the chain id and name, the agent id, its owner and registry addresses, and its agent URI. Because every field is derived from indexed chain state, anything the showcase shows can be checked independently on that chain's explorer.++## Related++- [ERC-8004](./erc8004.md): the identity standard behind every row here.+- [On-chain deployments](./deployments.md): the same registration stream without the 3D filter, including Solana Metaplex Core mints.+- [Deploy agents on-chain](./onchain-agents.md): how to register an agent so it can appear here.+- [Agent manifest](./agent-manifest.md): the metadata format whose 3D model field decides `has_3d`.diff --git a/pages/avatar-cli.html b/pages/avatar-cli.htmlindex 56f83bc99..68e609e23 100644--- a/pages/avatar-cli.html+++ b/pages/avatar-cli.html@@ -267,7 +267,10 @@ $ echo "$sha"see the <a href="/docs/web-component">web component reference</a>.</span></p>- <script type="module" src="/agent-3d/latest/agent-3d.js"></script>+ <script+ type="module"+ src="https://three.ws/agent-3d/latest/agent-3d.js"+ ></script><agent-3dsrc="https://three.ws/avatars/michelle.glb"style="width:100%;height:420px"diff --git a/pages/recipe.html b/pages/recipe.htmlnew file mode 100644index 000000000..890eb3765--- /dev/null+++ b/pages/recipe.html@@ -0,0 +1,345 @@+<!doctype html>+<html lang="en" class="cookbook-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 http-equiv="X-UA-Compatible" content="IE=edge" />+ <title>three.ws — Cookbook recipe</title>+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <meta name="author" content="nirholas" />+ <meta+ name="description"+ content="A runnable three.ws cookbook recipe: the file, why it is shaped that way, and what it produces."+ />+ <meta name="theme-color" content="#000000" />+ <meta property="og:type" content="article" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:title" content="three.ws — Cookbook recipe" />+ <meta+ property="og:description"+ content="A runnable three.ws cookbook recipe: the file, why it is shaped that way, and what it produces."+ />++ <link rel="icon" href="/favicon.ico" sizes="any" />+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />+ <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />+ <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />+ <link rel="manifest" href="/manifest.webmanifest" />+ <link rel="stylesheet" href="/style.css" />+ <link rel="stylesheet" href="/nav.css" />+ <link rel="stylesheet" href="/footer.css" />+ <link rel="stylesheet" href="/fonts/fonts.css" />+ <link+ rel="stylesheet"+ href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark.min.css"+ />+ <link rel="stylesheet" href="/mobile.css" />+ <link rel="stylesheet" href="/cookbook.css" />+ <script+ src="https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js"+ integrity="sha384-odPBjvtXVM/5hOYIr3A1dB+flh0c3wAT3bSesIOqEGmyUA4JoKf/YTWy0XKOYAY7"+ crossorigin="anonymous"+ ></script>+ <script+ src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"+ integrity="sha384-F/bZzf7p3Joyp5psL90p/p89AZJsndkSoGwRpXcZhleCWhd8SnRuoYo4d0yirjJp"+ crossorigin="anonymous"+ ></script>+ <script defer src="/nav.js"></script>+ <script defer src="/footer-newsletter.js"></script>+ <script defer src="/cookbook-manifest.js"></script>+ </head>+ <body>+ <div class="cb-page">+ <header></header>++ <main class="cb-main">+ <nav class="cb-crumbs" aria-label="Breadcrumb">+ <a href="/cookbook">Cookbook</a> <span aria-hidden="true">/</span>+ <span id="cb-crumb-title">Recipe</span>+ </nav>++ <div class="cb-doc">+ <article class="cb-article" id="cb-article">+ <div class="cb-skeleton" aria-hidden="true">+ <span></span><span></span><span></span><span></span><span></span>+ </div>+ <p class="sr-only" role="status">Loading the recipe.</p>+ </article>++ <aside class="cb-side" id="cb-side" hidden>+ <div class="cb-side-card" id="cb-facts-card">+ <h2>The file</h2>+ <dl class="cb-facts" id="cb-facts"></dl>+ <p style="margin: 0.9rem 0 0">+ <a class="cb-btn primary" id="cb-download" href="#" download>Download</a>+ </p>+ </div>+ <nav class="cb-side-card" id="cb-toc-card" aria-label="On this page">+ <h2>On this page</h2>+ <ul class="cb-toc" id="cb-toc"></ul>+ </nav>+ </aside>+ </div>+ </main>++ <footer id="site-footer"></footer>+ </div>++ <script>+ (function () {+ 'use strict';++ const article = document.getElementById('cb-article');+ const side = document.getElementById('cb-side');+ const facts = document.getElementById('cb-facts');+ const toc = document.getElementById('cb-toc');+ const tocCard = document.getElementById('cb-toc-card');+ const crumb = document.getElementById('cb-crumb-title');+ const download = document.getElementById('cb-download');++ const ICON_COPY =+ '<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>';++ function escapeHtml(value) {+ return String(value == null ? '' : value).replace(+ /[&<>"']/g,+ (c) =>+ ({+ '&': '&',+ '<': '<',+ '>': '>',+ '"': '"',+ "'": ''',+ })[c],+ );+ }++ function currentSlug() {+ const match = location.pathname.match(/^\/cookbook\/([a-z0-9-]+)\/?$/);+ return match ? match[1] : '';+ }++ function slugifyHeading(text) {+ return String(text)+ .toLowerCase()+ .replace(/[^a-z0-9]+/g, '-')+ .replace(/^-+|-+$/g, '');+ }++ function fillFacts(recipe) {+ const rows = [+ ['Language', recipe.language],+ ['Level', recipe.level],+ ['Time', recipe.time],+ ['Needs', recipe.needs],+ ['Builds', recipe.builds],+ ];+ facts.innerHTML = rows+ .filter(([, value]) => value)+ .map(+ ([label, value]) =>+ '<dt>' ++ escapeHtml(label) ++ '</dt><dd>' ++ escapeHtml(value) ++ '</dd>',+ )+ .join('');+ if (recipe.download) {+ download.href = recipe.download.href;+ download.textContent = recipe.download.label;+ } else {+ download.hidden = true;+ }+ side.hidden = false;+ }++ /* Anchor every heading and mirror it into the sidebar, so a long recipe is+ linkable section by section. */+ function buildToc() {+ const headings = article.querySelectorAll('h2, h3');+ const seen = new Set();+ const items = [];+ headings.forEach((heading) => {+ let id = slugifyHeading(heading.textContent);+ let unique = id;+ let n = 2;+ while (seen.has(unique)) unique = id + '-' + n++;+ seen.add(unique);+ heading.id = unique;+ items.push(+ '<li' ++ (heading.tagName === 'H3' ? ' class="sub"' : '') ++ '><a href="#' ++ unique ++ '">' ++ escapeHtml(heading.textContent) ++ '</a></li>',+ );+ });+ if (!items.length) {+ tocCard.hidden = true;+ return;+ }+ toc.innerHTML = items.join('');+ trackActiveHeading(headings);+ }++ function trackActiveHeading(headings) {+ if (!('IntersectionObserver' in window) || !headings.length) return;+ const links = new Map(+ Array.from(toc.querySelectorAll('a')).map((a) => [+ a.getAttribute('href').slice(1),+ a,+ ]),+ );+ const observer = new IntersectionObserver(+ (entries) => {+ entries.forEach((entry) => {+ const link = links.get(entry.target.id);+ if (!link) return;+ if (entry.isIntersecting) {+ links.forEach((other) => other.removeAttribute('aria-current'));+ link.setAttribute('aria-current', 'true');+ }+ });+ },+ { rootMargin: '-80px 0px -70% 0px' },+ );+ headings.forEach((heading) => observer.observe(heading));+ }++ /* Every code block gets a copy button. Wrapping wide blocks in a scroller+ keeps the page itself from scrolling sideways on a phone. */+ function enhanceCode() {+ article.querySelectorAll('pre code').forEach((code) => {+ if (window.hljs) {+ try {+ window.hljs.highlightElement(code);+ } catch (err) {+ /* Highlighting is decoration; unstyled code still reads fine. */+ }+ }+ const pre = code.parentElement;+ const button = document.createElement('button');+ button.type = 'button';+ button.className = 'cb-copy';+ button.innerHTML = ICON_COPY + '<span>Copy</span>';+ button.addEventListener('click', async () => {+ const label = button.querySelector('span');+ try {+ await navigator.clipboard.writeText(code.textContent);+ label.textContent = 'Copied';+ } catch (err) {+ label.textContent = 'Press Ctrl+C';+ }+ setTimeout(() => {+ label.textContent = 'Copy';+ }, 1600);+ });+ pre.appendChild(button);+ });+ article.querySelectorAll('table').forEach((table) => {+ const scroller = document.createElement('div');+ scroller.className = 'cb-table-scroll';+ table.parentNode.insertBefore(scroller, table);+ scroller.appendChild(table);+ });+ }++ function appendPager(slug) {+ const recipes = window.RECIPES || [];+ const here = window.recipeIndex(slug);+ if (here < 0) return;+ const prev = recipes[here - 1];+ const next = recipes[here + 1];+ if (!prev && !next) return;+ const nav = document.createElement('nav');+ nav.className = 'cb-pager';+ nav.setAttribute('aria-label', 'More recipes');+ nav.innerHTML =+ (prev+ ? '<a class="prev" href="' ++ escapeHtml(prev.href) ++ '"><span class="cb-pager-dir">Previous</span><span class="cb-pager-title">' ++ escapeHtml(prev.title) ++ '</span></a>'+ : '<span></span>') ++ (next+ ? '<a class="next" href="' ++ escapeHtml(next.href) ++ '"><span class="cb-pager-dir">Next</span><span class="cb-pager-title">' ++ escapeHtml(next.title) ++ '</span></a>'+ : '<span></span>');+ article.appendChild(nav);+ }++ function showError(slug, detail) {+ article.innerHTML =+ '<div class="cb-error"><h1>This recipe did not load</h1><p>' ++ escapeHtml(detail) ++ '</p><p><a class="cb-btn primary" href="/cookbook">Back to the cookbook</a> ' ++ '<a class="cb-btn" href="/docs/3d-api">API docs</a></p></div>';+ document.title = 'three.ws — recipe not found';+ }++ async function load() {+ const slug = currentSlug();+ if (!slug) {+ showError('', 'No recipe was named in the URL.');+ return;+ }+ const recipe = window.recipeBySlug(slug);+ if (recipe) {+ document.title = recipe.title + ' — three.ws Cookbook';+ crumb.textContent = recipe.title;+ fillFacts(recipe);+ }++ let markdown;+ try {+ const res = await fetch('/docs/cookbook/' + slug + '.md');+ if (!res.ok) throw new Error('HTTP ' + res.status);+ markdown = await res.text();+ } catch (err) {+ showError(+ slug,+ 'We could not fetch /docs/cookbook/' ++ slug ++ '.md (' ++ err.message ++ '). It may have moved.',+ );+ return;+ }++ window.marked.setOptions({ gfm: true, breaks: false, mangle: false, headerIds: false });+ article.innerHTML = window.marked.parse(markdown);++ /* Internal .md links point at files in the repo; rewrite them to routes. */+ article.querySelectorAll('a[href$=".md"]').forEach((link) => {+ const href = link.getAttribute('href');+ if (/^https?:/.test(href)) return;+ link.setAttribute(+ 'href',+ '/docs/' + href.replace(/^\.?\/?(docs\/)?/, '').replace(/\.md$/, ''),+ );+ });++ buildToc();+ enhanceCode();+ appendPager(slug);+ }++ if (document.readyState === 'loading') {+ document.addEventListener('DOMContentLoaded', load);+ } else {+ load();+ }+ })();+ </script>+ </body>+</html>diff --git a/public/changelog.json b/public/changelog.jsonindex 257503042..4e5e80557 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-30T22:49:50.337Z",+ "generated_at": "2026-07-30T22:52:32.200Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -146,6 +146,16 @@"launch"]},+ {+ "date": "2026-07-30",+ "type": "launch",+ "title": "Tutorial · Earn and spend in /play",+ "summary": "Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin the wheel. Covers why the world has two currencies that never touch, and why the server decides every price.",+ "link": "/tutorials/earn-and-spend-in-play",+ "tags": [+ "launch"+ ]+ },{"date": "2026-07-30","type": "launch",@@ -300,6 +310,28 @@"docs"]},+ {+ "date": "2026-07-30",+ "type": "update",+ "title": "A runnable wallet sign-in example and a step-by-step tutorial",+ "summary": "Signing in with a Solana or Ethereum wallet was documented as a reference but there was nothing you could run. There is now a working demo page that performs the whole round trip against the live API, shows you the exact message your wallet signed, and logs every request with its real status code, plus a tutorial that walks the same flow line by line. Both spell out the four things that quietly break a first integration: the domain check that rejects a message built from a development address, the anti-forgery header the verify step requires, the two different responses that both mean signed out, and the field the API puts its error code in.",+ "link": "/tutorials/wallet-sign-in",+ "tags": [+ "docs",+ "sdk"+ ]+ },+ {+ "date": "2026-07-30",+ "type": "update",+ "title": "A searchable catalog of every tool three.ws gives an AI assistant",+ "summary": "three.ws publishes 270 tools that AI assistants can call, spread across 36 servers, and until now the only way to see them all was to query each server. The new catalog page lists every one in a single searchable view: what it does, which server hosts it, what it costs in USDC, and whether an assistant can run it without asking you first. Filter by any of those and the link you copy keeps the filter. The same data is published as a single file any agent can fetch to discover the whole surface in one request. Both are generated from the source of each tool on every build, so unlike the hand-written table they replace they cannot fall out of date.",+ "link": "/mcp-tools",+ "tags": [+ "feature",+ "docs"+ ]+ },{"date": "2026-07-30","type": "update",@@ -321,6 +353,18 @@"sdk"]},+ {+ "date": "2026-07-30",+ "type": "update",+ "title": "Agent payment sessions are now fully documented, tested, and easier to size correctly",+ "summary": "Payment sessions let an AI agent spend a budget you set without ever holding a private key, and the feature shipped without a full reference entry or a single test on the code that enforces the limits. The complete API is now documented endpoint by endpoint, including every governance refusal and what happens when a payment is submitted but never confirmed. The enforcement layer has 49 tests covering the budget race, the host allowlist, per-payment ceilings, and refunds. Two runnable examples ship with the payments MCP package, one of which reads what a paid endpoint actually charges so you can size a budget from real prices instead of guessing. A configuration bug meant setting PAYMENT_SESSION_SECRET had no effect and session tokens were quietly keyed to an unrelated secret, which is fixed.",+ "link": "/docs/api-reference",+ "tags": [+ "docs",+ "fix",+ "improvement"+ ]+ },{"date": "2026-07-30","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex e93c1ded2..7c11d33c0 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -118,6 +118,14 @@<category>launch</category><description>Pick a rigged character from the free library of 107, prove its skeleton drives the animation clip library, and embed it on your own site with one script tag and a gesture button. No modeling, no cost, ten minutes.</description></item>+ <item>+ <title>Tutorial · Earn and spend in /play</title>+ <link>https://three.ws/tutorials/earn-and-spend-in-play</link>+ <guid isPermaLink="false">2026-07-30:Tutorial · Earn and spend in /play</guid>+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin the wheel. Covers why the world has two currencies that never touch, and why the server decides every price.</description>+ </item><item><title>Tutorial · Explore the docs as a 3D world</title><link>https://three.ws/tutorials/explore-docs-world</link>@@ -238,6 +246,22 @@<category>feature</category><description>A new page at three.ws/nvidia explains the whole NVIDIA side of the platform in one place: the free hosted lane that makes text-to-3D cost you nothing, the exact model behind each capability, the twelve GPU workers the platform runs itself, and a request you can paste into a terminal to generate a model right now. It links out to both NVIDIA tutorials, the engineering write-up on the GPU fleet, and the membership page. The partner directory now points here instead of at the membership doc.</description></item>+ <item>+ <title>A runnable wallet sign-in example and a step-by-step tutorial</title>+ <link>https://three.ws/tutorials/wallet-sign-in</link>+ <guid isPermaLink="false">2026-07-30:A runnable wallet sign-in example and a step-by-step tutorial</guid>+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>+ <category>docs</category>+ <description>Signing in with a Solana or Ethereum wallet was documented as a reference but there was nothing you could run. There is now a working demo page that performs the whole round trip against the live API, shows you the exact message your wallet signed, and logs every request with its real status code, plus a tutorial that walks the same flow line by line. Both spell out the four things that quietly break a first integration: the domain check that rejects a message built from a development address, the anti-forgery header the verify step requires, the two different responses that both mean signed out, and the field the API puts its error code in.</description>+ </item>+ <item>+ <title>A searchable catalog of every tool three.ws gives an AI assistant</title>+ <link>https://three.ws/mcp-tools</link>+ <guid isPermaLink="false">2026-07-30:A searchable catalog of every tool three.ws gives an AI assistant</guid>+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>three.ws publishes 270 tools that AI assistants can call, spread across 36 servers, and until now the only way to see them all was to query each server. The new catalog page lists every one in a single searchable view: what it does, which server hosts it, what it costs in USDC, and whether an assistant can run it without asking you first. Filter by any of those and the link you copy keeps the filter. The same data is published as a single file any agent can fetch to discover the whole surface in one request. Both are generated from the source of each tool on every build, so unlike the hand-written table they replace they cannot fall out of date.</description>+ </item><item><title>A slow data provider can no longer freeze a live trading position</title><link>https://three.ws/trades</link>@@ -254,6 +278,14 @@<category>docs</category><description>If you want other people's AI assistants to pay you per call, there is now a complete worked example you can run in a minute and a step-by-step tutorial that builds it with you. The example is a real server with two tools: a free one that explains the prices and how paying works, and a paid one that inspects a 3D model and returns a report on what is wrong with it and how to fix it. It refuses to hand over the report until payment clears, and it refuses to take payment unless it actually produced a report, so a broken link or an unreachable file costs the caller nothing. It ships with fifteen tests, including one whose only job is to prove the paid result cannot escape unpaid.</description></item>+ <item>+ <title>Agent payment sessions are now fully documented, tested, and easier to size correctly</title>+ <link>https://three.ws/docs/api-reference</link>+ <guid isPermaLink="false">2026-07-30:Agent payment sessions are now fully documented, tested, and easier to size correctly</guid>+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>+ <category>docs</category>+ <description>Payment sessions let an AI agent spend a budget you set without ever holding a private key, and the feature shipped without a full reference entry or a single test on the code that enforces the limits. The complete API is now documented endpoint by endpoint, including every governance refusal and what happens when a payment is submitted but never confirmed. The enforcement layer has 49 tests covering the budget race, the host allowlist, per-payment ceilings, and refunds. Two runnable examples ship with the payments MCP package, one of which reads what a paid endpoint actually charges so you can size a budget from real prices instead of guessing. A configuration bug meant setting PAYMENT_SESSION_SECRET had no effect and session tokens were quietly keyed to an unrelated secret, which is fixed.</description>+ </item><item><title>Agent Symphony: listen to the agent economy as it happens</title><link>https://three.ws/symphony</link>diff --git a/public/features.json b/public/features.jsonindex d6bfeca92..0741f49ae 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-30T22:49:50.305Z",+ "generated_at": "2026-07-30T22:52:32.153Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",@@ -4317,6 +4317,16 @@"tags": [],"showcase": false},+ {+ "path": "/tutorials/wallet-sign-in",+ "title": "Tutorial · Add Wallet Sign-In to Your App",+ "description": "Authenticate visitors with Phantom, Backpack, Solflare, or MetaMask: the Sign-In with Solana round trip end to end, the domain check that rejects dev origins, CSRF on verify, both signed-out response shapes, and error codes mapped to fixes.",+ "added": null,+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false+ },{"path": "/tutorials/agent-spending-envelope","title": "Tutorial · Give an Agent a Spending Envelope",@@ -5696,6 +5706,16 @@"indexable": true,"tags": [],"showcase": false+ },+ {+ "path": "/tutorials/earn-and-spend-in-play",+ "title": "Tutorial · Earn and spend in /play",+ "description": "Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin the wheel. Covers why the world has two currencies that never touch, and why the server decides every price.",+ "added": "2026-07-30",+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false}]},diff --git a/public/llms-full.txt b/public/llms-full.txtindex 08ff89759..b9f68edd0 100644--- a/public/llms-full.txt+++ b/public/llms-full.txt@@ -2621,6 +2621,12 @@ URL: https://three.ws/docs/guardsThe local guards that protect this codebase in place of CI: what each one blocks, which stage runs it, and how to add a new one.+### Tutorial · Add Wallet Sign-In to Your App++URL: https://three.ws/tutorials/wallet-sign-in++Authenticate visitors with Phantom, Backpack, Solflare, or MetaMask: the Sign-In with Solana round trip end to end, the domain check that rejects dev origins, CSRF on verify, both signed-out response shapes, and error codes mapped to fixes.+### Tutorial · Give an Agent a Spending EnvelopeURL: https://three.ws/tutorials/agent-spending-envelope@@ -3449,6 +3455,12 @@ URL: https://three.ws/docs/tutorials/write-a-guardBuild a real guard end to end: write the checker, give it an npm script, register it in data/guards.json, wire it into a stage, and cover it with a test that includes the false positive it must never report.+### Tutorial · Earn and spend in /play++URL: https://three.ws/tutorials/earn-and-spend-in-play++Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin the wheel. Covers why the world has two currencies that never touch, and why the server decides every price.+## BlogLong-form announcements, launches, and writing from three.ws.diff --git a/public/llms.txt b/public/llms.txtindex c7bc2eb39..b52e3f331 100644--- a/public/llms.txt+++ b/public/llms.txt@@ -452,6 +452,7 @@ Docs, tutorials, and reference.- [Docs: World Lines](https://three.ws/docs/world-lines): A World Line is a quest an agent leaves at a real place. Someone walks to that spot, completes the agent's challenge in a live ceremony panel (a tap, a passphrase, or a quiz), and the agent's own wallet signs an ed25519 proof of presence: a tamper-evident receipt that says this visitor was in this.- [Docs: Walk Leaderboard](https://three.ws/docs/walk-leaderboard): Every step your avatar takes on three.ws is measured, rolled up, and ranked. The Walk Leaderboard is the public board for it: walkers ordered by distance walked, sites visited, or time on their feet, over today, this week, or all time.- [Repository guards](https://three.ws/docs/guards): The local guards that protect this codebase in place of CI: what each one blocks, which stage runs it, and how to add a new one.+- [Tutorial · Add Wallet Sign-In to Your App](https://three.ws/tutorials/wallet-sign-in): Authenticate visitors with Phantom, Backpack, Solflare, or MetaMask: the Sign-In with Solana round trip end to end, the domain check that rejects dev origins, CSRF on verify, both signed-out response shapes, and error codes mapped to fixes.- [Tutorial · Give an Agent a Spending Envelope](https://three.ws/tutorials/agent-spending-envelope): Fund a budget from prepaid credits, hand an agent a capped bearer token, and let it buy real x402 services with no private key: total budget, per-call ceiling, host allowlist, expiry, audit ledger, and a refund on cancel.- [Tutorial · Render Avatars as Images](https://three.ws/tutorials/render-avatar-images): Put a live 3D avatar in an image tag: four camera framings, 28 poses, ARKit facial morphs, social cards, turntables, and a CORS-open GLB proxy. No 3D engine anywhere in your stack.- [Tutorial · Character Library to a Live Embed](https://three.ws/tutorials/character-library-to-embed): Pick a rigged character from the free library of 107, prove its skeleton drives the animation clip library, and embed it on your own site with one script tag and a gesture button. No modeling, no cost, ten minutes.@@ -590,6 +591,7 @@ Docs, tutorials, and reference.- [Tutorial · Write a repository guard](https://three.ws/tutorials/write-a-guard): This repo has no CI, so a guard is the only thing between a mistake and production. Build one that fails the build when an API handler forgets its error boundary, wire it into the gate, cover it with tests, and register it.- [Repository guards](https://three.ws/guards): Every mechanical guard that protects the three.ws codebase, and the stage each one runs in. This repository has no CI, so correctness is enforced by fast local checks wired into the prebuild, the gate, the deploy build, and the git pre-push hook. Filter by stage, search by command, and read the incident behind each one.- [Tutorial · Write a repository guard](https://three.ws/docs/tutorials/write-a-guard): Build a real guard end to end: write the checker, give it an npm script, register it in data/guards.json, wire it into a stage, and cover it with a test that includes the false positive it must never report.+- [Tutorial · Earn and spend in /play](https://three.ws/tutorials/earn-and-spend-in-play): Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin the wheel. Covers why the world has two currencies that never touch, and why the server decides every price.## Blogdiff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex eccf7e365..573627865 100644--- a/public/sitemap/index.html+++ b/public/sitemap/index.html@@ -79,7 +79,7 @@<main class="sm-wrap"><div class="sm-hero"><h1>Sitemap</h1>- <p>All 727 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>+ <p>All 729 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>@@ -91,7 +91,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 727 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />+ <input id="sm-filter-input" type="search" placeholder="Filter 729 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>@@ -2048,7 +2048,7 @@<section class="sm-section" id="learn"><header>- <h2>Learn<span class="sm-count" data-count>306</span></h2>+ <h2>Learn<span class="sm-count" data-count>308</span></h2><p class="sm-section-desc">Docs, tutorials, and reference.</p></header><ul class="sm-list">@@ -3228,6 +3228,13 @@<span class="sm-desc">The local guards that protect this codebase in place of CI: what each one blocks, which stage runs it, and how to add a new one.</span></a></li>+ <li>+ <a href="/tutorials/wallet-sign-in">+ <span class="sm-title">Tutorial · Add Wallet Sign-In to Your App</span>+ <span class="sm-path">/tutorials/wallet-sign-in</span>+ <span class="sm-desc">Authenticate visitors with Phantom, Backpack, Solflare, or MetaMask: the Sign-In with Solana round trip end to end, the domain check that rejects dev origins, CSRF on verify, both signed-out response shapes, and error codes mapped to fixes.</span>+ </a>+ </li><li><a href="/tutorials/agent-spending-envelope"><span class="sm-title">Tutorial · Give an Agent a Spending Envelope</span>@@ -4194,6 +4201,13 @@<span class="sm-desc">Build a real guard end to end: write the checker, give it an npm script, register it in data/guards.json, wire it into a stage, and cover it with a test that includes the false positive it must never report.</span></a></li>+ <li>+ <a href="/tutorials/earn-and-spend-in-play">+ <span class="sm-title">Tutorial · Earn and spend in /play</span>+ <span class="sm-path">/tutorials/earn-and-spend-in-play</span>+ <span class="sm-desc">Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin the wheel. Covers why the world has two currencies that never touch, and why the server decides every price.</span>+ </a>+ </li></ul></section>diff --git a/public/tutorials-manifest.js b/public/tutorials-manifest.jsindex 85d064007..ecaa275ae 100644--- a/public/tutorials-manifest.js+++ b/public/tutorials-manifest.js@@ -514,6 +514,16 @@previewModel: '/animations/robotexpressive.glb',ctaPrimary: { label: 'Read the example code', href: 'https://github.com/nirholas/three.ws/tree/main/examples/paid-mcp-server' },},+ {+ slug: 'wallet-sign-in',+ tier: 'middle',+ title: 'Add wallet sign-in to your app',+ blurb: 'Authenticate visitors with Phantom, Backpack, Solflare, or MetaMask. The Sign-In with Solana round trip end to end, plus the four things that quietly break it: the domain check that rejects dev origins, the CSRF header on verify, the two different signed-out responses, and error codes that arrive in a field most people read wrong.',+ builds: 'A working wallet sign-in button that produces a real three.ws session',+ time: '20 min',+ previewModel: '/avatars/cz.glb',+ ctaPrimary: { label: 'Run the example', href: 'https://github.com/nirholas/three.ws/tree/main/examples/wallet-sign-in' },+ },{slug: 'agent-spending-envelope',tier: 'advanced',diff --git a/scripts/.aa/probe3.mjs b/scripts/.aa/probe3.mjsnew file mode 100644index 000000000..eabd91f90--- /dev/null+++ b/scripts/.aa/probe3.mjs@@ -0,0 +1,13 @@+import { chromium } from 'playwright';+const b = await chromium.launch();+const p = await b.newPage({ viewport: { width: 900, height: 800 } });+p.on('console', (m) => {+ const t = m.text();+ if (/GL Driver|WebSocket|vite/i.test(t)) return;+ console.log('[' + m.type() + ']', t.slice(0, 200));+});+p.on('pageerror', (e) => console.log('[pageerror]', e.message.slice(0, 200)));+await p.goto('http://localhost:3007/asl-alphabet', { waitUntil: 'networkidle' });+await p.waitForTimeout(6000);+console.log('status:', await p.textContent('#aa-status'));+await b.close();diff --git a/src/trading-hub.css b/src/trading-hub.cssindex ba8764982..c0441c342 100644--- a/src/trading-hub.css+++ b/src/trading-hub.css@@ -65,13 +65,18 @@outline-offset: 2px;}+/* --accent is white on the dark theme, so the label has to be the page+ * background rather than a light foreground. --btn-primary-fg is defined in+ * public/style.css, which this page does not load, so it is only the first rung+ * of the chain and --color-bg carries it when absent. Same reason+ * --btn-primary-bg-hover falls back to --accent-soft. */.th-btn-primary {background: var(--accent);- color: var(--btn-primary-fg);+ color: var(--btn-primary-fg, var(--color-bg));}.th-btn-primary:hover {- background: var(--btn-primary-bg-hover);+ background: var(--btn-primary-bg-hover, var(--accent-soft, var(--accent)));}.th-btn-secondary {diff --git a/tests/mcp-catalog.test.js b/tests/mcp-catalog.test.jsnew file mode 100644index 000000000..f9456dfbb--- /dev/null+++ b/tests/mcp-catalog.test.js@@ -0,0 +1,98 @@+// The generated MCP tool catalog (public/mcp-catalog.json).+//+// The catalog is what /mcp-tools renders and what an agent fetches to discover+// the whole tool surface in one request, so a wrong field here is a wrong answer+// given to every caller. `npm run audit:mcp-catalog` already fails the build when+// the committed file drifts from source; these tests pin the properties that a+// regenerate would happily preserve if the generator itself were wrong.++import { readFileSync } from 'node:fs';++import { describe, it, expect } from 'vitest';++const catalog = JSON.parse(readFileSync('public/mcp-catalog.json', 'utf8'));++describe('MCP tool catalog', () => {+ it('covers every tool with a resolved server', () => {+ expect(catalog.tools.length).toBeGreaterThan(200);+ expect(catalog.counts.tools).toBe(catalog.tools.length);++ // An unresolved server means a new tool directory landed that the+ // generator's path map does not know about, which would render as a raw+ // file path in the UI.+ const unknown = catalog.tools.filter((t) => t.server.id === 'unknown');+ expect(unknown.map((t) => t.source)).toEqual([]);+ });++ it('derives the safety class from the annotations, consistently', () => {+ for (const tool of catalog.tools) {+ const { readOnlyHint, destructiveHint } = tool.annotations;+ const expected =+ readOnlyHint === true ? 'read' : destructiveHint === true ? 'irreversible' : 'write';+ expect(tool.safety, `${tool.name} safety class`).toBe(expected);+ }+ });++ it('never labels a read-only tool as irreversible, or vice versa', () => {+ for (const tool of catalog.tools) {+ if (tool.safety === 'read') expect(tool.annotations.readOnlyHint).toBe(true);+ if (tool.safety === 'irreversible') {+ expect(tool.annotations.readOnlyHint).not.toBe(true);+ expect(tool.annotations.destructiveHint).toBe(true);+ }+ }+ });++ it('agrees with its own summary counts', () => {+ const tally = (predicate) => catalog.tools.filter(predicate).length;+ expect(catalog.counts.read).toBe(tally((t) => t.safety === 'read'));+ expect(catalog.counts.write).toBe(tally((t) => t.safety === 'write'));+ expect(catalog.counts.irreversible).toBe(tally((t) => t.safety === 'irreversible'));+ expect(catalog.counts.free).toBe(tally((t) => t.price.free));+ expect(catalog.counts.paid).toBe(tally((t) => !t.price.free));+ expect(catalog.counts.free + catalog.counts.paid).toBe(catalog.tools.length);+ expect(catalog.counts.servers).toBe(catalog.servers.length);+ });++ it('prices every paid tool with a real number, tiered ones included', () => {+ const paid = catalog.tools.filter((t) => !t.price.free);+ expect(paid.length).toBeGreaterThan(0);+ for (const tool of paid) {+ expect(tool.price.usd, `${tool.name} price`).toBeGreaterThan(0);+ expect(Number.isFinite(tool.price.usd)).toBe(true);+ }+ // A tier-priced tool resolves against the real forge tier table rather than+ // falling through to "free", which is what a literal-only reader would do.+ const tiered = catalog.tools.find((t) => t.price.tiers);+ expect(tiered).toBeDefined();+ expect(tiered.price.tiers.length).toBeGreaterThan(1);+ for (const tier of tiered.price.tiers) expect(tier.usd).toBeGreaterThan(0);+ // Tiers are ordered cheapest first so the UI can quote a "from" price.+ const usd = tiered.price.tiers.map((t) => t.usd);+ expect([...usd].sort((a, b) => a - b)).toEqual(usd);+ });++ it('reads a description for all but the handful composed at request time', () => {+ const missing = catalog.tools.filter((t) => !t.description);+ // Those few must say so, so the page can explain the blank instead of+ // rendering an empty card.+ for (const tool of missing) expect(tool.descriptionIsDynamic).toBe(true);+ expect(missing.length).toBeLessThan(catalog.tools.length * 0.05);+ });++ it('gives every tool a name unique within its server', () => {+ const seen = new Set();+ for (const tool of catalog.tools) {+ const key = `${tool.server.id}::${tool.name}`;+ expect(seen.has(key), `duplicate ${key}`).toBe(false);+ seen.add(key);+ }+ });++ it('counts the tools each server reports', () => {+ for (const server of catalog.servers) {+ const actual = catalog.tools.filter((t) => t.server.id === server.id).length;+ expect(actual, `${server.id} tool count`).toBe(server.tools);+ }+ });+});diff --git a/vercel.json b/vercel.jsonindex 373172c8c..e60a6ca2f 100644--- a/vercel.json+++ b/vercel.json@@ -4040,10 +4040,6 @@"src": "/objects/?","dest": "/objects.html"},- {- "src": "/examples/?",- "dest": "/examples.html"- },{"src": "/forged/?","dest": "/forged.html"diff --git a/vite.config.js b/vite.config.jsindex 34cd3f63a..f7ee6c73b 100644--- a/vite.config.js+++ b/vite.config.js@@ -520,6 +520,7 @@ const appConfig = {arm: resolve(__dirname, 'pages/arm.html'),ca2x402: resolve(__dirname, 'pages/ca2x402.html'),activity: resolve(__dirname, 'pages/activity.html'),+ guards: resolve(__dirname, 'pages/guards.html'),pipeline: resolve(__dirname, 'pages/pipeline.html'),'coin-intel': resolve(__dirname, 'pages/coin-intel.html'),coins: resolve(__dirname, 'pages/coins.html'),