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 wallet sign-in tutorial, cookbook styles, and examples index refresh
nirholasd69978abc451
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 6f460fb0f..8fa609e38 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,6 +8,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Autonomous Trading** (`/trading`) — The control room for three.ws autonomous trading: live fleet vitals, the agent scoreboard, the entry-to-exit pipeline, and every trading surface and doc in one place.- **Docs · Economy Health Dashboard** (`/docs/economy-health-dashboard`) — The operator dashboard that answers whether the Money Pulse is quiet and which link in the funding chain broke, plus the ranked diagnosis rules behind its verdict.+- **Docs · MCP tool safety** (`/docs/mcp-safety`) — What an MCP tool's safety annotations mean on three.ws and why you can trust them: read-only tools never change what you asked about, anything that spends is labelled as spending, and a build check verifies every hint against the tool's own code before it can ship.- **Docs · The 10 SOL trading experiment** (`/docs/trading-experiment`) — The full risk policy behind the autonomous fleet: entry band, position sizing, taking initials at 2x, the moon-bag floor, trailing and hard stops, and how to read the decision journal.- **Docs · The in-game economy** (`/docs/in-game-economy`) — The complete reference for the /play open-world economy: gathering and selling materials, the cash purse and bank, tool upgrades, every vendor and gate, $THREE cosmetics that settle on Solana, and the catalog wire format for reading it from code.- **Docs · The trading hub** (`/docs/trading-hub`) — The front door to the autonomous trading system: live fleet vitals read off the running bots, the strategy arena and experiments board, and the smart-money radar, with the twenty pages behind them organised into one path.@@ -31,9 +32,11 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Tutorial: Make Your Avatar Sign (ASL)** (`/tutorials/sign-with-your-avatar`) — Step-by-step tutorial for signing avatars: type a phrase and watch it signed in ASL, share it as a link, export a spelled word as an animated GLB, turn on signed chat replies, and fingerspell back with your webcam.- **Your master wallet** (`/wallet`) — One custodial wallet for your account, separate from your agents'. Hold SOL and USDC across Solana and Base, top up any agent you own, send to any Solana address, and read every transaction straight from chain.- **87 documentation pages that search engines could not see are now discoverable** — The platform serves a page for every documentation file, but only pages listed in the site's page index reach the sitemap, the machine-readable llms.txt, and the feature list. 87 docs had never been listed, which meant they answered normally if you had the link and were invisible to every search engine and AI crawler otherwise. Each one now carries a real title and summary written from the doc itself, covering the API reference, the avatar and animation pipeline, memory, permissions, security, self-hosting, the MCP servers, and the troubleshooting guide. A new check in the documentation audit fails the build if a future doc lands unlisted, so this cannot silently happen again. `[docs, improvement]`+- **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 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 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]`@@ -50,6 +53,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Every code sample in the docs now points at a real, loadable 3D model** — Docs, tutorials, and package READMEs previously used made-up model URLs (example.com GLBs and dead three.ws paths) that failed if you copied the code. Every sample now references a real avatar from the three.ws library, so quick starts, embed snippets, AR examples, and paid model-check calls work as pasted. Example inspection outputs were re-run against the live API so the numbers shown are the numbers you get. The snippets that embed an avatar by id got the same treatment: the Avatar SDK docs and the embed snippets on the site now carry a real public avatar id that resolves, in place of a fill-in-the-blank id that rendered nothing, and the on-chain manifest example ships the real file hashes for the avatar it names. The agent card other agents read to discover our 3D skills got the same fix, with each example naming a model that actually produces the result it advertises, including one that genuinely returns compression suggestions. `[docs, improvement]`- **Every MCP tool's safety label is now verified, not just asserted** — AI clients read a tool's safety label to decide whether they can run it without asking you first. A tool marked read-only gets run unattended. Across the 270 tools on the three.ws MCP servers those labels were only ever declarations: nothing checked that a tool marked read-only actually reads. A new build check now reads each tool's code, follows the functions it really calls, and refuses to ship a tool that claims to be read-only while writing to the database or sending a transaction, one that hides an irreversible action behind a non-destructive label, or one that ships no label at all. Four read tools that warm an internal cache while answering are recorded as reviewed exceptions with the reason written down, and the guarantee is documented for anyone integrating. (`/docs/mcp`) `[security, docs]`- **Forge Max: the highest-quality 3D lane now has its own address, and it is a $THREE holder perk** — The best result the platform can produce used to live behind a quality selector most people never opened. It now has a permanent home at three.ws/forge-max, which lands on the Forge with the High tier already pinned: 200k-poly geometry, 4K PBR and HD textures, and subject-aware routing that picks the engine best suited to what you asked for. Holding $THREE unlocks the tier, and anyone who brings their own Meshy, Tripo or Rodin key can use it too. Any Forge link also accepts a tier directly, so you can hand someone a URL that opens at draft, standard or high quality. (`/forge-max`) `[feature]`+- **Forty-one tutorials that search engines could not see are now indexed** — The tutorial library, the tutorial text, and the site's page index are three separate files that all have to agree, and they had drifted: forty-one tutorials were live and readable but missing from the sitemap, so search engines and AI assistants never learned they existed. Three more had text written but no card in the library, which meant nobody could find them by browsing either. All of them are now registered and reachable, and a new check runs over the three files and fails when they disagree, so a tutorial can no longer go missing quietly. (`/tutorials`) `[improvement, docs]`- **Free trials are no longer counted as marketplace sales** — The public marketplace numbers were wrong in the way that flatters us most: a free trial of a skill was counted as a sale, and the price it would have cost was added to reported volume. On the live data that published more than ten thousand sales and millions in volume at a moment when the number of purchases anyone had actually paid for was zero. Paid sales and free trials are now separate everywhere they are reported. Trials get their own count and a drop-off view showing how many were started, used, used up, and turned into a purchase, which is genuinely useful to a creator deciding whether a trial is working, and can no longer be mistaken for revenue. `[fix]`- **Full API reference for the agent wallet control surfaces** — Every owner-only endpoint on an agent's Solana wallet is now documented in one place: minting and revoking scoped session keys, creating and streaming programmable orders, compiling plain-language wallet rules, arming Treasury Autopilot, reading portfolio profit and loss, configuring guardians and the dead-man switch, and adjudicating an anomaly freeze. Each route lists its exact request and response, every error it can return, and a copy-paste example. (`/docs/agent-wallet-api`) `[docs]`- **Marketplace analytics no longer counts free trials as sales** — The public marketplace analytics page was reporting more than ten thousand skill sales and millions of $THREE in volume when the marketplace had never completed a single paid sale. Every one of those was a free trial: the page counted a trial the same as a purchase, and summed the price the trial would have cost as though it had been paid. Sales, volume, revenue and buyer counts now count paid purchases only. Free trials are still shown, as their own figure and as a conversion funnel from trials granted through to trials that turned into a sale, so you can see how the marketplace is really doing instead of a number that flattered it. (`/marketplace/analytics`) `[fix, improvement]`@@ -72,6 +76,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **The cosmetics economy has a public ledger: who owns the rarest fits, and who is getting paid** — Every cosmetic sale on three.ws settles in real USDC, and until now none of it was visible. The Fits page ranks the scarcest premium pieces by how few wallets own them, lists the top collectors wearing them, names the creators actually earning from their designs, and streams each sale as it lands. There is also a free earnings lookup: paste any Solana wallet and see what it has made as a creator, broken down per cosmetic and per coin world. No account needed to read any of it. (`/fits`) `[feature]`- **The docs tell you when something is missing instead of showing an empty column** — The documentation sidebar is now built from a shared list of pages that both the classic docs and the new 3D Docs World read, which means it arrives over the network and can occasionally fail. When it does, the contents column used to just sit there empty, which reads like the product has no documentation rather than like one request failed. It now says what happened, notes that the page you are reading is unaffected (it is), and offers a Retry button. Searching the sidebar for something with no matches also says so and offers to clear the search, instead of leaving you looking at a blank space. And opening a stale or mistyped /docs/world link no longer greets you with a load error over the 3D scene; it simply drops you into the world. (`/docs/world`) `[improvement, docs]`- **The economy's self-refuel can no longer mistake an unreadable balance for an empty wallet** — When the autonomous economy runs short of SOL it converts a small, capped slice of its own USDC revenue to keep paying agents. That check treated a failed balance lookup exactly like a zero balance, so whenever a Solana data provider was rate-limited the platform concluded its revenue was spent and stopped refuelling, with the funds it needed sitting in its own wallet. The balance read now has a second, cheaper path, and a lookup that genuinely fails is reported as unknown rather than empty, so recovery no longer waits on a human. `[fix, infra]`+- **The examples page now lists every example that ships, not a hand-picked five** — The /examples page had six runnable snippets you can execute on the page, then a short section naming five example projects by hand. The repository actually ships 39 of them: complete example agents, installable skill bundles, end-to-end scripts, and an examples folder beside every SDK and published package. The page now lists all of them, with a search box and filters by kind, and each card shows the files the example contains plus the exact command that runs it, with a copy button. The list is built by scanning the repository, so it cannot advertise an example that was deleted or miss one that was added. (`/examples`) `[docs, improvement]`- **The GitHub README now shows the real product** — The project README on GitHub was rebuilt around live proof: fresh screenshots captured from the production site (Forge, the viewer, discovery, the Club, Coin Communities, the x402 bazaar, the Money Pulse, and more), every tutorial linked to its live page, npm links for all 22 published packages, block-explorer links for the on-chain registries, and stale links to retired pages cleaned up. `[docs]`- **The in-game economy is now published, prices and odds included** — The open world at /play has always had a real economy: a purse you can lose when you die, a bank that protects it, a general store that prices every trade, a cosmetics boutique that settles on Solana, and a wheel. None of it was written down. The only way to learn a price was to walk up to the vendor and read the panel, and the wheel's odds were not published at all. There is now a public reference at /play/economy showing every catalog, gate and payout, including the full wheel paytable with the real chance of each outcome. It is not a copy: the page reads the same tables the game server prices trades with, so a number shown there is the number you will be charged, and it cannot fall out of date when the game is retuned. A written reference and a hands-on tutorial covering the whole earn-and-spend loop ship alongside it. (`/play/economy`) `[feature, docs]`- **The pages that shipped without docs now have them** — Thirteen surfaces that launched with no guide are now fully documented: the Agent-Forged Gallery, Generation Watch, the KOL Tracker, the Character and Object Libraries, the Minted gallery, the Reasoning Ledger, the 3D history timeline, Daily Match, Agent Symphony, the notifications center, the creator portfolio, and the Token Screener. Each guide explains what the page shows, where every number comes from, and the public API behind it, and all of them are linked from the Start Here page. (`/docs/start-here`) `[docs]`diff --git a/STRUCTURE.md b/STRUCTURE.mdindex fcfa243ce..6589ffad1 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -331,6 +331,7 @@ npm).- **Marketing assets** — [marketing/](marketing/README.md) (produced promo videos + re-render scripts, e.g. [marketing/imessage-video/](marketing/imessage-video); source-of-truth assets, not shipped to production)- **Platform agents (server-side)**: [agents/](agents/README.md) (endpoint-shopper, fact-checker, tutor, unstoppable, x402-buildout: library modules imported by `api/` handlers, each with its own README)- **Site data files**: [data/](data/README.md) (pages.json, changelog.json, skills seed, RSS items: what each file drives and which script regenerates it)+- **Repository guards**: [data/guards.json](data/guards.json) is the registry of every mechanical check and the stage it runs in (prebuild, gate, deploy build, pre-push, on demand). [scripts/audit-guards.mjs](scripts/audit-guards.mjs) proves each entry is real and each stage claim is true, [scripts/build-guards.mjs](scripts/build-guards.mjs) publishes it to `public/guards.json`, [pages/guards.html](pages/guards.html) renders it at `/guards`, and [docs/guards.md](docs/guards.md) plus [docs/tutorials/write-a-guard.md](docs/tutorials/write-a-guard.md) document it. There is no CI here, so this is the enforcement layer.- **Blog**: [blog/](blog/README.md) (hand-authored post HTML plus dataset and syndication companions; SEO injection and routing documented there)- **Agent work-order packs**: [prompts/](prompts/README.md) (internal campaign prompts for Claude agents); machine-written x402 sweep reports: [tasks/](tasks/README.md)- **Rust crates (WASM)**: [crates/](crates/README.md) (vanity-grinder, built via `npm run build:wasm`)diff --git a/data/changelog.json b/data/changelog.jsonindex 2713ebbc6..ff2aa6761 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,46 @@{"$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": "The examples page now lists every example that ships, not a hand-picked five",+ "summary": "The /examples page had six runnable snippets you can execute on the page, then a short section naming five example projects by hand. The repository actually ships 39 of them: complete example agents, installable skill bundles, end-to-end scripts, and an examples folder beside every SDK and published package. The page now lists all of them, with a search box and filters by kind, and each card shows the files the example contains plus the exact command that runs it, with a copy button. The list is built by scanning the repository, so it cannot advertise an example that was deleted or miss one that was added.",+ "tags": [+ "docs",+ "improvement"+ ],+ "link": "/examples"+ },+ {+ "date": "2026-07-30",+ "title": "A browsable map of every check that guards this codebase",+ "summary": "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.",+ "tags": [+ "feature",+ "docs"+ ],+ "link": "/guards"+ },+ {+ "date": "2026-07-30",+ "title": "A working example and tutorial for charging other agents to use your tools",+ "summary": "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.",+ "tags": [+ "docs",+ "sdk"+ ],+ "link": "/tutorials/monetize-mcp-server"+ },+ {+ "date": "2026-07-30",+ "title": "Forty-one tutorials that search engines could not see are now indexed",+ "summary": "The tutorial library, the tutorial text, and the site's page index are three separate files that all have to agree, and they had drifted: forty-one tutorials were live and readable but missing from the sitemap, so search engines and AI assistants never learned they existed. Three more had text written but no card in the library, which meant nobody could find them by browsing either. All of them are now registered and reachable, and a new check runs over the three files and fails when they disagree, so a tutorial can no longer go missing quietly.",+ "tags": [+ "improvement",+ "docs"+ ],+ "link": "/tutorials"+ },{"date": "2026-07-30","title": "Free trials are no longer counted as marketplace sales",diff --git a/data/pages.json b/data/pages.jsonindex f0fb24990..0de66fde8 100644--- a/data/pages.json+++ b/data/pages.json@@ -2161,7 +2161,7 @@},{"path": "/docs/swarms",- "title": "Docs \u00b7 Trading swarms",+ "title": "Docs · Trading swarms","description": "How a group of agents pools real SOL into one on-chain Solana treasury and trades it by weighted consensus: reputation-weighted voting, spend-guarded contribute and exit transfers, the shared kill switch, and why no balance is virtual.","priority": 0.6,"changefreq": "monthly",@@ -4017,6 +4017,14 @@"changefreq": "monthly","added": "2026-07-30"},+ {+ "path": "/docs/mcp-safety",+ "title": "Docs · MCP tool safety",+ "description": "What an MCP tool's safety annotations mean on three.ws and why you can trust them: read-only tools never change what you asked about, anything that spends is labelled as spending, and a build check verifies every hint against the tool's own code before it can ship.",+ "priority": 0.7,+ "changefreq": "monthly",+ "added": "2026-07-30"+ },{"path": "/mcp-tools","title": "MCP Tool Catalog",diff --git a/docs/examples.md b/docs/examples.mdindex 405aaa53c..49b28ae9b 100644--- a/docs/examples.md+++ b/docs/examples.md@@ -750,13 +750,13 @@ The repo ships 39 examples: 10 web component demos, 10 end-to-end projects, and| [`examples/paid-mcp-server`](../examples/paid-mcp-server) | A complete, runnable MCP server whose tools charge per call in USDC on Solana over x402. It ships two tools on purpose: | `cd examples/paid-mcp-server && npm install && npm run start` || [`examples/pump-fun-agent`](../examples/pump-fun-agent) | An example agent manifest that composes all four production pump.fun skills into one 3D trading agent: swap, coin creation, creator-fee collection, and token payments. | Reference files, nothing to execute || [`examples/three-concierge`](../examples/three-concierge) | The reference agent for manifest spec agent-manifest/0.2. Trinity welcomes users to three.ws, explains the platform, and launches and trades $three on pump.fun through the real pump.fun skills in pump-fun-skills/. | Reference files, nothing to execute |-| [`examples/wallet-sign-in`](../examples/wallet-sign-in) | See the directory for details. | `npm run dev, then open /examples/wallet-sign-in/index.html` |+| [`examples/wallet-sign-in`](../examples/wallet-sign-in) | A single-page, no-build demo of the two wallet authentication rails three.ws runs itself: Sign-In with Solana (SIWS) and Sign-In with Ethereum (SIWE). | `npm run dev, then open /examples/wallet-sign-in/index.html` |### Package examples| Example | What it shows | Run it ||---|---|---|-| [`packages/agentcore-payments-mcp/examples`](../packages/agentcore-payments-mcp/examples) | MCP server for three.ws Agent Payment Sessions - govern agent x402 spending without exposing private keys. | `node packages/agentcore-payments-mcp/examples/list-tools.mjs` |+| [`packages/agentcore-payments-mcp/examples`](../packages/agentcore-payments-mcp/examples) | Two runnable examples. Neither one spends money, needs a wallet, or needs an account, so you can run both before deciding whether to fund anything. | `node packages/agentcore-payments-mcp/examples/list-tools.mjs` || [`assistant-sdk/examples`](../assistant-sdk/examples) | A 3D avatar assistant for any website, in one script tag. A floating launcher opens a real, animated 3D avatar in a panel, standing directly on your page (transparent), or against a color or gradient. It has two modes: | `npm run dev, then open /assistant-sdk/examples/index.html` || [`avatar-sdk/examples`](../avatar-sdk/examples) | A self-contained page, no build step. It loads the SDK's @three-ws/avatar/agent entry from a CDN, awaits ensureAgent3D() to register the <agent-3d> element, and renders the real three.ws default avatar using the documented src and kiosk attributes. | `npm run dev, then open /avatar-sdk/examples/index.html` || [`packages/avatar-schema/examples`](../packages/avatar-schema/examples) | JSON Schema and validator for three.ws on-chain avatar manifests - the canonical, hash-anchored format any cross-chain client can use to resolve an avatar. | Reference files, nothing to execute |diff --git a/docs/mcp-tools.md b/docs/mcp-tools.mdindex 73af74f0a..b70d57989 100644--- a/docs/mcp-tools.md+++ b/docs/mcp-tools.md@@ -3,8 +3,16 @@three.ws ships several [MCP](mcp.md) servers: tool servers that AI assistants(Claude, ChatGPT, any MCP client) can call directly. One is free and 3D-only; theothers expose paid tools that settle per call in USDC over [x402](x402.md). This-page is the catalog: which server hosts which tool, whether it's free or paid, and-what it does.+page explains how the servers are grouped and how the paid ones charge.++> **Looking for a specific tool?** The complete, always-current list lives at+> **[/mcp-tools](/mcp-tools)**: every tool on every server, searchable, with its+> price and whether an AI client can run it unattended. That page is generated+> from the source of each tool on every build, so it cannot drift. The same data+> is machine-readable at [`/mcp-catalog.json`](/mcp-catalog.json).+>+> The tables below are a curated orientation to the servers, not the full index.+> Where a figure here and the catalog disagree, the catalog is right.> Source: [`api/mcp-studio.js`](../api/mcp-studio.js) (free),> [`api/mcp-3d.js`](../api/mcp-3d.js) + [`api/_mcp3d/pricing.js`](../api/_mcp3d/pricing.js)diff --git a/docs/nav.json b/docs/nav.jsonindex 0c3560a08..8a64dd75e 100644--- a/docs/nav.json+++ b/docs/nav.json@@ -829,6 +829,10 @@"label": "MCP tools catalog","path": "mcp-tools"},+ {+ "label": "MCP tool safety",+ "path": "mcp-safety"+ },{"label": "Spatial MCP (3D responses)","path": "spatial-mcp"@@ -1004,6 +1008,10 @@"label": "Add a 3D avatar assistant","path": "tutorials/add-a-3d-assistant"},+ {+ "label": "Add wallet sign-in",+ "path": "tutorials/wallet-sign-in"+ },{"label": "Register on-chain","path": "tutorials/register-onchain"diff --git a/docs/start-here.md b/docs/start-here.mdindex 67fdda83b..f61d918f2 100644--- a/docs/start-here.md+++ b/docs/start-here.md@@ -103,12 +103,14 @@ Curious what happens between the prompt and the model? [How the Forge works](./h- **Browsing what the agents bought?** → [The Agent-Forged Gallery](./forged.md): 3D props purchased by autonomous agents with real USDC over x402, each carrying its paying wallet, price, and on-chain settlement receipt- **Need a ready-made character or prop?** → The [Character Library](./character-library.md) has 106 rigged characters (one click into the Studio, Animation Studio, or an embed) and the [Object Library](./object-library.md) has hundreds of CC0 props with live preview, AR placement, and direct GLB download- **Rendering avatars outside the viewer?** → [Media and render API](./media-api.md): avatar PNG renders for `<img>` tags, posed clip renders, the runtime GLB optimizer, the CORS-open model proxy, and the free vision and speech-to-text endpoints; companion to the [3D API](./3d-api.md)+- **Putting avatars in your build pipeline?** → [Avatar CLI](./avatar-cli.md): four offline commands that scaffold a hash-anchored avatar manifest from a wallet and a GLB, validate it against the published schema, and print an embed snippet that renders. Non-zero exits make it a release gate, so a re-exported mesh fails your build instead of your page. [Ship an avatar manifest](./tutorials/ship-an-avatar-manifest.md) is the guided walkthrough- **Minting your work on-chain?** → [Minted 3D assets](./minted.md): the /minted gallery of avatars minted as Metaplex Core NFTs, the opt-in mint flow, baked provenance, and enforced remix royalties- **Letting an agent spend without your key?** → [Payment Sessions](./payment-sessions.md): fund a capped envelope from prepaid credits, hand the agent a bearer token, and it pays x402 endpoints under your caps and allowlist, refundable on cancel- **Earning proof you were somewhere?** → [World Lines](./world-lines.md): walk to an agent's real-world spot, complete its challenge (a tap, a passphrase, or a quiz), and its wallet signs an ed25519 proof of presence you own and anyone can verify. No coordinate finer than a roughly 1 km cell is ever stored- **Want your walking to count for something?** → [The Walk Leaderboard](./walk-leaderboard.md): distance, sites, and time ranked daily, weekly, and all-time, for signed-in and anonymous walkers alike, with an honest account of how a session is counted and what a guard can and cannot prove- **Driving an agent wallet from code?** → [The agent wallet control API](./agent-wallet-api.md): the reference for all seven owner-only surfaces on an agent's Solana wallet (scoped session keys, programmable orders, plain-language intents, Treasury Autopilot, portfolio P&L, guardians and the dead-man switch, and the anomaly guard), each with its exact JSON, every error, and a curl example- **Turning a token into a paid endpoint?** → [CA to x402](./ca2x402.md): paste a contract address and get a live agent-payable market-intel endpoint, discoverable in the bazaar, with the generated snippets+- **Want other agents to pay for your tools?** → [Monetize an MCP server](./tutorials/monetize-mcp-server.md): build an MCP server that charges per `tools/call` in USDC on Solana, with a free orientation tool in front of the paid ones and the verify-work-settle ordering that means a failed call never takes money. The runnable code is [examples/paid-mcp-server](https://github.com/nirholas/three.ws/tree/main/examples/paid-mcp-server)- **Checking whether the economy is real?** → [Agent economy volume](./agent-economy-volume.md) counts only settled agent-to-agent USDC for paid skills, and [Viability](./viability.md) shows the unit economics (GMV, take rate, repeat buyers, realized P&L) from on-chain data with no projections- **Designing an agent's look and brand?** → [Agent Identity Studio](./agent-identities.md) turns a brand brief into a rigged avatar plus posed studio renders; [Living Stages](./stage.md) covers shareable stages; [the Avatar Engines Atlas](./avatar-engines.md) is the factual survey of the engines in this space and which ones we animate- **Writing about us?** → [The press kit](./press-kit.md) has the logos, the usage rules, and the boilerplate (editorial use needs no permission), and [the partner ecosystem](./partners.md) maps every partner program to what the integration actually isdiff --git a/docs/tutorials/wallet-sign-in.md b/docs/tutorials/wallet-sign-in.mdnew file mode 100644index 000000000..41f05a13d--- /dev/null+++ b/docs/tutorials/wallet-sign-in.md@@ -0,0 +1,253 @@+# Add Wallet Sign-In to Your App++By the end of this tutorial a visitor will click one button, approve a signature in Phantom, and land on your page authenticated as a three.ws user, with a session cookie your backend calls can rely on. No password, no email, no transaction, and no fee. The signature is free and off-chain: it proves the visitor controls the wallet, nothing more.++You will build it on **Sign-In with Solana** first, because Solana is the home chain and the wallet most three.ws users already have. The Ethereum path is the same shape and gets its own step at the end.++**What you'll build:**++- A working sign-in button that produces a real three.ws session+- The [CAIP-122](https://chainagnostic.org/CAIPs/caip-122) message construction, done the way that survives being served from a dev origin+- Correct CSRF handling on the verify call+- A session check that handles both signed-out shapes, not just the obvious one+- Error handling that tells a developer what to change instead of showing a raw code++**Prerequisites:**++- A Solana wallet extension: [Phantom](https://phantom.app), Backpack, or Solflare. You do not need any SOL: nothing here touches the chain.+- A page that can make same-origin requests to `/api/*` on three.ws. Running `npm run dev` in this repo gives you that, because the dev server proxies `/api/*` to production.+- No API key and no account are required up front. Signing in with a new wallet creates the account.++The finished code is [examples/wallet-sign-in/index.html](https://github.com/nirholas/three.ws/blob/main/examples/wallet-sign-in/index.html), and you can run it right now:++```bash+npm run dev # port 3000+# open http://localhost:3000/examples/wallet-sign-in/+```++Read on for why each piece is shaped the way it is.++---++## Step 1 - Understand the three round trips++Wallet sign-in is three HTTP calls and one wallet interaction. Everything else is detail.++| # | Call | Why it exists |+|---|---|---|+| 1 | `GET /api/auth/siws/nonce` | Server issues a single-use nonce (5 minute TTL), a CSRF token, and the canonical `domain`/`uri` you must sign against |+| 2 | *(wallet)* `signMessage` | The visitor proves control of the address by signing a message containing that nonce |+| 3 | `POST /api/auth/siws/verify` | Server checks domain, URI, chain, time window, nonce, and signature, then sets a session cookie |++The nonce is what makes the signature un-replayable: it is burned on first use, so a captured message cannot be submitted twice.++---++## Step 2 - Get a nonce++```js+const res = await fetch('/api/auth/siws/nonce', { credentials: 'include' });+const { nonce, csrf, domain, uri } = await res.json();+```++`credentials: 'include'` matters: the endpoint sets a `__Host-csrf-siws` cookie that the verify call is checked against. Drop it and step 4 fails with `invalid_request`.++A real response:++```json+{+ "nonce": "cZ80BjC39R47lSY8mo3T0P",+ "issuedAt": "2026-07-30T22:42:54.093Z",+ "expiresAt": "2026-07-30T22:47:54.093Z",+ "csrf": "k7ixNoodRVLBhXwgLxVihxY_KFZ5twjqETCzHKNHbww",+ "ttl": 300,+ "domain": "three.ws",+ "uri": "https://three.ws"+}+```++Note `domain` and `uri`. Step 3 explains why they are in there.++---++## Step 3 - Build the message (the step everyone gets wrong)++The verify endpoint checks that the `domain` and `URI` lines inside the signed message match the deployment's own origin. The obvious implementation reaches for `location.host`:++```js+// Wrong when your page is not served from three.ws itself+const message = `${location.host} wants you to sign in with your Solana account:` /* ... */;+```++Served from `localhost:3000` while `/api/*` proxies to production, that signs `localhost:3000`, and the server rejects it with `invalid_domain`. Everything else about your integration can be perfect and it will still fail.++Use the values the nonce response gave you:++```js+const statement =+ 'Sign in to three.ws. This request will not trigger any blockchain transaction or cost ' ++ 'any fees. By signing, you agree to the Terms of Service (https://three.ws/legal/tos) and ' ++ 'Privacy Policy (https://three.ws/legal/privacy).';++const message = [+ `${domain} wants you to sign in with your Solana account:`,+ address,+ '',+ statement,+ '',+ `URI: ${uri}`,+ 'Version: 1',+ 'Chain ID: mainnet',+ `Nonce: ${nonce}`,+ `Issued At: ${new Date().toISOString()}`,+ `Expiration Time: ${new Date(Date.now() + 5 * 60 * 1000).toISOString()}`,+].join('\n');+```++Three rules about this block:++- **The blank lines are structural.** One after the address, one after the statement. The parser relies on them; lose them and you get `invalid_message`.+- **`Chain ID` must be `mainnet`, `devnet`, or `testnet`.** A numeric EVM-style chain id gets `invalid_chain`.+- **Put the Terms agreement inside the statement.** The signature then evidences acceptance, which is what lets you send `tosAccepted: true` on verify honestly.++---++## Step 4 - Sign it, then verify++```js+const provider = window.phantom?.solana ?? window.solana;+const { publicKey } = await provider.connect();+const address = publicKey.toString();++// ...build `message` from step 3 using `address`...++const { signature: sigBytes } = await provider.signMessage(+ new TextEncoder().encode(message),+ 'utf8',+);+const signature = btoa(String.fromCharCode(...sigBytes)); // base58 also accepted++const verify = await fetch('/api/auth/siws/verify', {+ method: 'POST',+ credentials: 'include',+ headers: { 'content-type': 'application/json', 'x-csrf-token': csrf },+ body: JSON.stringify({ message, signature, tosAccepted: true }),+});+```++The `x-csrf-token` header is mandatory, and its value is the `csrf` string from the nonce response. The server compares it against the `__Host-csrf-siws` cookie it set alongside it. Omitting the header returns `403 invalid_request` no matter how good the signature is.++On success the response sets `__Host-sid`, a 30-day rolling session cookie, and returns the user. From here the visitor is authenticated exactly like someone who signed in with an email and password.++---++## Step 5 - Read the session back, correctly++```js+const res = await fetch('/api/auth/me', { credentials: 'include' });+const { user } = res.ok ? await res.json() : {};+if (!user) showSignedOut();+```++This looks like a formality and is not. `GET /api/auth/me` has **two** signed-out shapes:++| Situation | Status | Body |+|---|---|---|+| No session cookie at all | `200` | `{"user":null}` |+| Cookie present but expired or revoked | `401` | `{"error":"invalid_session"}` |++A client that checks only `res.status === 401` treats the first case as signed in and renders an empty account panel to every signed-out visitor. Check `!res.ok || !body.user`.++A signed-in response carries `id`, `email`, `display_name`, `plan`, `is_admin`, and `sid`. Render the first few; **never render `sid`**, which is the live session identifier and should not end up in a screenshot or a copied DOM node.++For a wallet-created account, `email` is a synthetic placeholder like `[email protected]` and `display_name` is the truncated address. Treat both as display fallbacks, not as a real inbox.++---++## Step 6 - Turn error codes into instructions++The API answers failures with `{ "error": "<code>", "error_description": "<prose>" }`. The machine-readable code is in `error`, not in a `code` field, which is an easy thing to get backwards.++Map the codes a developer will actually hit onto sentences that name the fix:++```js+const CODES = {+ invalid_domain: 'Build the message from the nonce response, not location.host.',+ invalid_uri: 'Use the uri the nonce response returned.',+ invalid_chain: 'Chain ID must be mainnet, devnet, or testnet.',+ invalid_message: 'The message is not parseable. Check the line order and the blank lines.',+ invalid_nonce: 'That nonce is unknown to the server. Request a fresh one.',+ nonce_reused: 'Nonces are single use. Request a fresh one.',+ nonce_expired: 'The nonce expired. They last five minutes.',+ expired: 'The message expiration time has passed.',+ invalid_signature: 'The signature does not verify against that address.',+ invalid_request: 'CSRF: send the csrf value from the nonce response as x-csrf-token.',+ account_deleted: 'That wallet belongs to a deleted account.',+};++const describe = (data) =>+ CODES[data?.error] || data?.error_description || 'Sign-in failed.';+```++Separately, catch the user simply declining in their wallet. That is not an error worth a red banner:++```js+if (/reject|denied|cancel|refused/i.test(err.message)) return 'Signature cancelled.';+```++---++## Step 7 - One-tap sign-in on Seeker++Wallets implementing the [Sign In With Solana](https://github.com/phantom/sign-in-with-solana) wallet feature merge authorization and signing into a single approval. The three.ws mobile wallet advertises this with `supportsSignIn`:++```js+if (provider.supportsSignIn && typeof provider.signIn === 'function') {+ const siws = await provider.signIn({+ domain, statement, uri, version: '1', chainId: 'mainnet',+ nonce, issuedAt, expirationTime,+ });+ // Forward the EXACT bytes the wallet signed, not a message you rebuilt.+ await postVerify(siws.signedMessageText, btoa(String.fromCharCode(...siws.signature)), csrf);+}+```++Two things to get right: forward `signedMessageText` verbatim, because a message you reconstruct will differ by a character somewhere and fail signature verification. And if the one-tap attempt fails for any reason other than the user cancelling, **request a fresh nonce** before falling back to the two-step path: the first nonce may already be burned.++---++## Step 8 - Add the Ethereum button++Same three round trips, different endpoints and a different signing call:++| Solana | Ethereum |+|---|---|+| `GET /api/auth/siws/nonce` | `GET /api/auth/siwe/nonce` |+| `POST /api/auth/siws/verify` | `POST /api/auth/siwe/verify` |+| `provider.signMessage(bytes, 'utf8')` | `window.ethereum.request({ method: 'personal_sign', params: [message, address] })` |+| `Chain ID: mainnet` | `Chain ID: 1` (the numeric EIP-155 id) |+| `... sign in with your Solana account:` | `... sign in with your Ethereum account:` |++The SIWE nonce endpoint returns `domain` and `uri` too, so the step 3 rule is unchanged. Note that this is the platform's **own** SIWE rail. The quick "connect wallet" button on the three.ws login page runs SIWE through Privy instead, which is a different integration with its own CAPTCHA requirement, documented in the [Authentication guide](/docs/authentication).++---++## Step 9 - Sign out++```js+await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' });+```++This revokes the session server-side and clears the cookie. To drop every session for the account, for example after a suspected compromise, use `POST /api/auth/logout-everywhere`.++---++## What you built++A wallet sign-in that works from any origin that can reach the API, survives the domain check, handles CSRF, distinguishes both signed-out states, and explains its own failures. The running version is [examples/wallet-sign-in/](https://github.com/nirholas/three.ws/tree/main/examples/wallet-sign-in).++## Related++- [Authentication](/docs/authentication) - the complete contract: SIWS, SIWE, Privy, sessions, API keys, OAuth+- [API reference](/docs/api-reference) - every endpoint, including the auth routes+- [Give an agent a spending envelope](/docs/tutorials/agent-spending-envelope) - what an authenticated account can hand to an agentdiff --git a/packages/avatar-cli/test/cli.test.js b/packages/avatar-cli/test/cli.test.jsindex 567db3181..e24d52514 100644--- a/packages/avatar-cli/test/cli.test.js+++ b/packages/avatar-cli/test/cli.test.js@@ -197,8 +197,52 @@ test('preview outputs resolver url and embed snippet', async () => {const { code, stdout } = await captured(() => main(['preview', outPath]));assert.equal(code, 0);assert.ok(stdout.includes('https://three.ws/a/b.eth'));- assert.ok(stdout.includes('<three-ws-avatar'));+ assert.ok(stdout.includes('<agent-3d'));assert.ok(stdout.includes('<iframe'));+ // The element does nothing until the loader registers it, so a snippet+ // without the script is a snippet that renders an empty box.+ assert.ok(stdout.includes('/agent-3d/latest/agent-3d.js'));+});++test('preview never emits an element the platform does not register', async () => {+ const outPath = join(workDir, 'm-preview-element.json');+ await captured(() =>+ main(['init', '--owner', '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', '--name', 'b.eth', '--mesh', meshPath, '--out', outPath]),+ );+ const { stdout } = await captured(() => main(['preview', outPath]));+ // `three-ws-avatar` is the binary name, not a custom element: nothing in the+ // codebase calls customElements.define('three-ws-avatar'), so emitting it+ // produced markup that silently rendered nothing.+ assert.ok(!stdout.includes('<three-ws-avatar'));+});++test('preview warns when the mesh uri is still a local path', async () => {+ const outPath = join(workDir, 'm-preview-local.json');+ await captured(() =>+ main(['init', '--owner', '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', '--name', 'e.eth', '--mesh', meshPath, '--out', outPath]),+ );+ const { code, stderr } = await captured(() => main(['preview', outPath]));+ assert.equal(code, 0);+ assert.match(stderr, /local path/);+ assert.match(stderr, /--mesh-uri/);+});++test('preview stays quiet when the mesh uri is public', async () => {+ const outPath = join(workDir, 'm-preview-public.json');+ await captured(() =>+ main([+ 'init',+ '--owner', '0xffffffffffffffffffffffffffffffffffffffff',+ '--name', 'f.eth',+ '--mesh', meshPath,+ '--mesh-uri', 'https://three.ws/avatars/michelle.glb',+ '--out', outPath,+ ]),+ );+ const { code, stdout, stderr } = await captured(() => main(['preview', outPath]));+ assert.equal(code, 0);+ assert.ok(!stderr.includes('local path'));+ assert.ok(stdout.includes('src="https://three.ws/avatars/michelle.glb"'));});test('preview --json emits structured output', async () => {@@ -211,6 +255,10 @@ test('preview --json emits structured output', async () => {const obj = JSON.parse(stdout);assert.equal(obj.id, 'c.eth');assert.match(obj.resolverUrl, /three\.ws\/a\/c\.eth/);+ assert.match(obj.loader, /<script type="module" src="https:\/\/three\.ws\/agent-3d\/latest\/agent-3d\.js"><\/script>/);+ assert.match(obj.element, /^<agent-3d /);+ assert.equal(obj.meshIsLocal, true);+ assert.ok(obj.meshUri.startsWith('file://'));});test('preview honors custom --viewer flag', async () => {@@ -224,4 +272,8 @@ test('preview honors custom --viewer flag', async () => {assert.equal(code, 0);const obj = JSON.parse(stdout);assert.match(obj.resolverUrl, /localhost:3000/);+ // --viewer has to move the loader too, or a staging page pulls the element+ // registration from production while everything else points at staging.+ assert.match(obj.loader, /localhost:3000\/agent-3d\/latest\/agent-3d\.js/);+ assert.match(obj.iframe, /localhost:3000/);});diff --git a/pages/cookbook.html b/pages/cookbook.htmlnew file mode 100644index 000000000..f56744fdc--- /dev/null+++ b/pages/cookbook.html@@ -0,0 +1,290 @@+<!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</title>+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <meta name="author" content="nirholas" />+ <meta+ name="description"+ content="Runnable recipes for building with three.ws: text to 3D from the command line, parallel asset packs, an MCP tool for your AI assistant, a CI quality gate, and a self-correcting generation loop. Every recipe ships a file you can run."+ />+ <meta name="theme-color" content="#000000" />++ <meta property="og:type" content="website" />+ <meta property="og:site_name" content="three.ws" />+ <meta property="og:title" content="three.ws — Cookbook" />+ <meta+ property="og:description"+ content="Runnable recipes for building with three.ws. Every recipe ships a file you can run, against the free and keyless 3D API."+ />+ <meta property="og:url" content="https://three.ws/cookbook" />+ <meta+ property="og:image"+ content="https://three.ws/api/page-og?s=learn&t=Cookbook&d=Runnable+recipes+for+building+with+three.ws&p=%2Fcookbook"+ />+ <meta property="og:image:width" content="1200" />+ <meta property="og:image:height" content="630" />++ <meta name="twitter:card" content="summary_large_image" />+ <meta name="twitter:title" content="three.ws — Cookbook" />+ <meta+ name="twitter:description"+ content="Runnable recipes for building with three.ws. Every recipe ships a file you can run, against the free and keyless 3D API."+ />+ <meta+ name="twitter:image"+ content="https://three.ws/api/page-og?s=learn&t=Cookbook&d=Runnable+recipes+for+building+with+three.ws&p=%2Fcookbook"+ />++ <link rel="canonical" href="https://three.ws/cookbook" />+ <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="/mobile.css" />+ <link rel="stylesheet" href="/cookbook.css" />+ <script defer src="/nav.js"></script>+ <script defer src="/footer-newsletter.js"></script>+ <script defer src="/cookbook-manifest.js"></script>+ <script+ type="module"+ src="https://ajax.googleapis.com/ajax/libs/model-viewer/4.0.0/model-viewer.min.js"+ integrity="sha384-sr9b4Ux0WhAUGclJ0ym0FSY2zSOMmNSn0bP/SA0e6bNCrpn/5W3QL8mm+LdlQMKw"+ crossorigin="anonymous"+ ></script>+ </head>+ <body>+ <div class="cb-page">+ <header></header>++ <section class="cb-hero">+ <div class="cb-hero-inner">+ <span class="cb-eyebrow">Cookbook</span>+ <h1>Recipes you can run.</h1>+ <p>+ Not walkthroughs. Every recipe here is a real file that was executed against the+ live API before it was published: a command-line tool, a batch pipeline, an MCP+ server, a CI gate, a self-correcting agent loop. Copy one, run it, change it.+ </p>+ <div class="cb-hero-meta">+ <span><strong id="cb-total">0</strong> recipes</span>+ <span>Free, keyless <a href="/docs/3d-api">3D API</a></span>+ <span>Python and Node</span>+ </div>+ </div>+ </section>++ <main class="cb-main">+ <div class="cb-toolbar" role="group" aria-label="Filter recipes by level">+ <button class="cb-filter" type="button" data-level="all" aria-pressed="true">+ All+ </button>+ <button class="cb-filter" type="button" data-level="beginner" aria-pressed="false">+ Beginner+ </button>+ <button+ class="cb-filter"+ type="button"+ data-level="intermediate"+ aria-pressed="false"+ >+ Intermediate+ </button>+ <button class="cb-filter" type="button" data-level="advanced" aria-pressed="false">+ Advanced+ </button>+ <span class="cb-count" id="cb-count" aria-live="polite"></span>+ </div>++ <ul class="cb-grid" id="cb-grid"></ul>++ <div class="cb-empty" id="cb-empty" hidden>+ <h2>No recipes at that level yet</h2>+ <p>+ The cookbook is small and growing. Clear the filter to see everything, or open an+ issue with the recipe you wish existed.+ </p>+ <button type="button" id="cb-clear">Show all recipes</button>+ </div>++ <section class="cb-outro">+ <div>+ <h2>Write one</h2>+ <p>+ A recipe is a file that runs, plus the prose explaining why it is shaped that+ way. If you built something on the 3D API worth copying, send it.+ </p>+ </div>+ <div class="cb-outro-links">+ <a class="cb-btn primary" href="/docs/3d-api">Read the API docs</a>+ <a class="cb-btn" href="https://github.com/nirholas/three.ws">Contribute on GitHub</a>+ <a class="cb-btn" href="/tutorials">Browse tutorials</a>+ </div>+ </section>+ </main>++ <footer id="site-footer"></footer>+ </div>++ <script>+ (function () {+ 'use strict';++ const grid = document.getElementById('cb-grid');+ const empty = document.getElementById('cb-empty');+ const count = document.getElementById('cb-count');+ const total = document.getElementById('cb-total');+ const filters = Array.from(document.querySelectorAll('.cb-filter'));++ function escapeHtml(value) {+ return String(value == null ? '' : value).replace(+ /[&<>"']/g,+ (c) =>+ ({+ '&': '&',+ '<': '<',+ '>': '>',+ '"': '"',+ "'": ''',+ })[c],+ );+ }++ /* A poster image is cheaper and sharper than a live canvas, so it wins when+ a recipe has one. The rotating model is the fallback, and it is paused+ for anyone who asked for reduced motion. */+ function media(recipe) {+ if (recipe.poster) {+ return (+ '<img src="' ++ escapeHtml(recipe.poster) ++ '" alt="" loading="lazy" decoding="async" width="640" height="360">'+ );+ }+ if (!recipe.previewModel) return '';+ const still = window.matchMedia('(prefers-reduced-motion: reduce)').matches;+ return (+ '<model-viewer src="' ++ escapeHtml(recipe.previewModel) ++ '" camera-controls disable-zoom touch-action="pan-y"' ++ (still ? '' : ' auto-rotate rotation-per-second="16deg"') ++ ' interaction-prompt="none" shadow-intensity="0.6" exposure="0.9"' ++ ' alt="" aria-hidden="true"></model-viewer>'+ );+ }++ function card(recipe) {+ const tags = (recipe.tags || [])+ .slice(0, 3)+ .map((t) => '<span class="cb-chip">' + escapeHtml(t) + '</span>')+ .join('');+ const download = recipe.download+ ? '<a class="cb-dl" href="' ++ escapeHtml(recipe.download.href) ++ '" download>' ++ escapeHtml(recipe.download.label) ++ '</a>'+ : '';+ return (+ '<li class="cb-card" data-level="' ++ escapeHtml(recipe.level) ++ '">' ++ '<div class="cb-card-media">' ++ media(recipe) ++ '</div>' ++ '<div class="cb-card-body">' ++ '<h2><a href="' ++ escapeHtml(recipe.href) ++ '">' ++ escapeHtml(recipe.title) ++ '</a></h2>' ++ '<p>' ++ escapeHtml(recipe.blurb) ++ '</p>' ++ '<p class="cb-card-builds">Builds: ' ++ escapeHtml(recipe.builds) ++ '</p>' ++ '<div class="cb-card-foot">' ++ '<span class="cb-chip" data-level="' ++ escapeHtml(recipe.level) ++ '">' ++ escapeHtml(recipe.level) ++ '</span>' ++ '<span class="cb-chip">' ++ escapeHtml(recipe.language) ++ '</span>' ++ '<span class="cb-chip">' ++ escapeHtml(recipe.time) ++ '</span>' ++ tags ++ download ++ '</div></div></li>'+ );+ }++ function render(level) {+ const recipes = window.RECIPES || [];+ const shown = level === 'all' ? recipes : recipes.filter((r) => r.level === level);+ grid.innerHTML = shown.map(card).join('');+ grid.hidden = shown.length === 0;+ empty.hidden = shown.length !== 0;+ count.textContent =+ shown.length === recipes.length+ ? recipes.length + ' recipes'+ : shown.length + ' of ' + recipes.length;+ }++ function select(level) {+ filters.forEach((btn) =>+ btn.setAttribute('aria-pressed', String(btn.dataset.level === level)),+ );+ render(level);+ const url = new URL(location.href);+ if (level === 'all') url.searchParams.delete('level');+ else url.searchParams.set('level', level);+ history.replaceState(null, '', url);+ }++ filters.forEach((btn) => btn.addEventListener('click', () => select(btn.dataset.level)));+ document.getElementById('cb-clear').addEventListener('click', () => select('all'));++ /* Left/right arrows walk the filter chips, the way a segmented control should. */+ document.querySelector('.cb-toolbar').addEventListener('keydown', (event) => {+ const step = event.key === 'ArrowRight' ? 1 : event.key === 'ArrowLeft' ? -1 : 0;+ if (!step) return;+ const here = filters.indexOf(document.activeElement);+ if (here < 0) return;+ event.preventDefault();+ const next = filters[(here + step + filters.length) % filters.length];+ next.focus();+ select(next.dataset.level);+ });++ function boot() {+ const recipes = window.RECIPES || [];+ total.textContent = String(recipes.length);+ const wanted = new URL(location.href).searchParams.get('level');+ select(+ wanted && filters.some((b) => b.dataset.level === wanted) ? wanted : 'all',+ );+ }++ /* The manifest is a deferred classic script, so it has run by DOMContentLoaded. */+ if (document.readyState === 'loading') {+ document.addEventListener('DOMContentLoaded', boot);+ } else {+ boot();+ }+ })();+ </script>+ </body>+</html>diff --git a/pages/payments.html b/pages/payments.htmlindex 62276ee69..206542003 100644--- a/pages/payments.html+++ b/pages/payments.html@@ -842,6 +842,9 @@const d = await api('/api/pay/session?limit=50');sessions = d.items || [];stats = d.stats;+ // Derive the chips' visibility from this load rather than latching it,+ // so a reload after signing in restores them without a hard refresh.+ $('pwFilters').hidden = false;if (stats) renderStats(stats);renderList();} catch (err) {diff --git a/public/animations/LICENSES.md b/public/animations/LICENSES.mdindex 6b765252a..89f065019 100644--- a/public/animations/LICENSES.md+++ b/public/animations/LICENSES.md@@ -58,6 +58,13 @@ non-profit projects).| `av-listening-music` | Listening To Music | — || `av-leaning-wall` | Leaning On A Wall | — || `av-rap-dance` | Rap Dancing | — |+| `nod` | Nodding Head Yes | agent `nod` slot |+| `shrug` | Shoulder Shrug | agent `shrug` slot |+| `point` | Pointing (arm bent)| agent `point` slot |+| `think` | Thoughtfully Nodding Head Yes | agent `think` slot |+| `sitloop` | Sitting With Breathing Idle | loop; the walk `sit` gesture |+| `turn` | Standing 180 Left Turn | — |+| `jog` | Jog Forward | loop; the walk `jog` gesture |To add a new Mixamo clip:diff --git a/public/changelog.json b/public/changelog.jsonindex a3bc9be03..257503042 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-30T22:49:04.049Z",+ "generated_at": "2026-07-30T22:49:50.337Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -26,6 +26,16 @@"launch"]},+ {+ "date": "2026-07-30",+ "type": "launch",+ "title": "Docs · MCP tool safety",+ "summary": "What an MCP tool's safety annotations mean on three.ws and why you can trust them: read-only tools never change what you asked about, anything that spends is labelled as spending, and a build check verifies every hint against the tool's own code before it can ship.",+ "link": "/docs/mcp-safety",+ "tags": [+ "launch"+ ]+ },{"date": "2026-07-30","type": "launch",@@ -257,6 +267,17 @@"improvement"]},+ {+ "date": "2026-07-30",+ "type": "update",+ "title": "A browsable map of every check that guards this codebase",+ "summary": "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.",+ "link": "/guards",+ "tags": [+ "feature",+ "docs"+ ]+ },{"date": "2026-07-30","type": "update",@@ -289,6 +310,17 @@"fix"]},+ {+ "date": "2026-07-30",+ "type": "update",+ "title": "A working example and tutorial for charging other agents to use your tools",+ "summary": "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.",+ "link": "/tutorials/monetize-mcp-server",+ "tags": [+ "docs",+ "sdk"+ ]+ },{"date": "2026-07-30","type": "update",@@ -457,6 +489,17 @@"feature"]},+ {+ "date": "2026-07-30",+ "type": "update",+ "title": "Forty-one tutorials that search engines could not see are now indexed",+ "summary": "The tutorial library, the tutorial text, and the site's page index are three separate files that all have to agree, and they had drifted: forty-one tutorials were live and readable but missing from the sitemap, so search engines and AI assistants never learned they existed. Three more had text written but no card in the library, which meant nobody could find them by browsing either. All of them are now registered and reachable, and a new check runs over the three files and fails when they disagree, so a tutorial can no longer go missing quietly.",+ "link": "/tutorials",+ "tags": [+ "improvement",+ "docs"+ ]+ },{"date": "2026-07-30","type": "update",@@ -691,6 +734,17 @@"infra"]},+ {+ "date": "2026-07-30",+ "type": "update",+ "title": "The examples page now lists every example that ships, not a hand-picked five",+ "summary": "The /examples page had six runnable snippets you can execute on the page, then a short section naming five example projects by hand. The repository actually ships 39 of them: complete example agents, installable skill bundles, end-to-end scripts, and an examples folder beside every SDK and published package. The page now lists all of them, with a search box and filters by kind, and each card shows the files the example contains plus the exact command that runs it, with a copy button. The list is built by scanning the repository, so it cannot advertise an example that was deleted or miss one that was added.",+ "link": "/examples",+ "tags": [+ "docs",+ "improvement"+ ]+ },{"date": "2026-07-30","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 51e664172..e93c1ded2 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -22,6 +22,14 @@<category>launch</category><description>The operator dashboard that answers whether the Money Pulse is quiet and which link in the funding chain broke, plus the ranked diagnosis rules behind its verdict.</description></item>+ <item>+ <title>Docs · MCP tool safety</title>+ <link>https://three.ws/docs/mcp-safety</link>+ <guid isPermaLink="false">2026-07-30:Docs · MCP tool safety</guid>+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>+ <category>launch</category>+ <description>What an MCP tool's safety annotations mean on three.ws and why you can trust them: read-only tools never change what you asked about, anything that spends is labelled as spending, and a build check verifies every hint against the tool's own code before it can ship.</description>+ </item><item><title>Docs · The 10 SOL trading experiment</title><link>https://three.ws/docs/trading-experiment</link>@@ -206,6 +214,14 @@<category>docs</category><description>The platform serves a page for every documentation file, but only pages listed in the site's page index reach the sitemap, the machine-readable llms.txt, and the feature list. 87 docs had never been listed, which meant they answered normally if you had the link and were invisible to every search engine and AI crawler otherwise. Each one now carries a real title and summary written from the doc itself, covering the API reference, the avatar and animation pipeline, memory, permissions, security, self-hosting, the MCP servers, and the troubleshooting guide. A new check in the documentation audit fails the build if a future doc lands unlisted, so this cannot silently happen again.</description></item>+ <item>+ <title>A browsable map of every check that guards this codebase</title>+ <link>https://three.ws/guards</link>+ <guid isPermaLink="false">2026-07-30:A browsable map of every check that guards this codebase</guid>+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>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.</description>+ </item><item><title>A healthy Solana node no longer benches itself for half an hour</title><link>https://three.ws/changelog</link>@@ -230,6 +246,14 @@<category>fix</category><description>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.</description></item>+ <item>+ <title>A working example and tutorial for charging other agents to use your tools</title>+ <link>https://three.ws/tutorials/monetize-mcp-server</link>+ <guid isPermaLink="false">2026-07-30:A working example and tutorial for charging other agents to use your tools</guid>+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>+ <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 Symphony: listen to the agent economy as it happens</title><link>https://three.ws/symphony</link>@@ -358,6 +382,14 @@<category>feature</category><description>The best result the platform can produce used to live behind a quality selector most people never opened. It now has a permanent home at three.ws/forge-max, which lands on the Forge with the High tier already pinned: 200k-poly geometry, 4K PBR and HD textures, and subject-aware routing that picks the engine best suited to what you asked for. Holding $THREE unlocks the tier, and anyone who brings their own Meshy, Tripo or Rodin key can use it too. Any Forge link also accepts a tier directly, so you can hand someone a URL that opens at draft, standard or high quality.</description></item>+ <item>+ <title>Forty-one tutorials that search engines could not see are now indexed</title>+ <link>https://three.ws/tutorials</link>+ <guid isPermaLink="false">2026-07-30:Forty-one tutorials that search engines could not see are now indexed</guid>+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The tutorial library, the tutorial text, and the site's page index are three separate files that all have to agree, and they had drifted: forty-one tutorials were live and readable but missing from the sitemap, so search engines and AI assistants never learned they existed. Three more had text written but no card in the library, which meant nobody could find them by browsing either. All of them are now registered and reachable, and a new check runs over the three files and fails when they disagree, so a tutorial can no longer go missing quietly.</description>+ </item><item><title>Free trials are no longer counted as marketplace sales</title><link>https://three.ws/changelog</link>@@ -534,6 +566,14 @@<category>fix</category><description>When the autonomous economy runs short of SOL it converts a small, capped slice of its own USDC revenue to keep paying agents. That check treated a failed balance lookup exactly like a zero balance, so whenever a Solana data provider was rate-limited the platform concluded its revenue was spent and stopped refuelling, with the funds it needed sitting in its own wallet. The balance read now has a second, cheaper path, and a lookup that genuinely fails is reported as unknown rather than empty, so recovery no longer waits on a human.</description></item>+ <item>+ <title>The examples page now lists every example that ships, not a hand-picked five</title>+ <link>https://three.ws/examples</link>+ <guid isPermaLink="false">2026-07-30:The examples page now lists every example that ships, not a hand-picked five</guid>+ <pubDate>Thu, 30 Jul 2026 12:00:00 GMT</pubDate>+ <category>docs</category>+ <description>The /examples page had six runnable snippets you can execute on the page, then a short section naming five example projects by hand. The repository actually ships 39 of them: complete example agents, installable skill bundles, end-to-end scripts, and an examples folder beside every SDK and published package. The page now lists all of them, with a search box and filters by kind, and each card shows the files the example contains plus the exact command that runs it, with a copy button. The list is built by scanning the repository, so it cannot advertise an example that was deleted or miss one that was added.</description>+ </item><item><title>The GitHub README now shows the real product</title><link>https://three.ws/changelog</link>diff --git a/public/cookbook.css b/public/cookbook.cssnew file mode 100644index 000000000..f63e99913--- /dev/null+++ b/public/cookbook.css@@ -0,0 +1,814 @@+/*+ * Cookbook — the recipe index (/cookbook) and the recipe viewer (/cookbook/<slug>).+ *+ * Everything here is expressed in the shared design tokens from tokens.css, so+ * both surfaces follow the site's light/dark themes with no per-theme overrides+ * of their own. Reach for a token before inventing a colour.+ */++html.cookbook-page,+html.cookbook-page body {+ overflow: auto !important;+ height: auto !important;+}++.cookbook-page body {+ display: block;+}++.cb-page {+ min-height: 100vh;+ display: flex;+ flex-direction: column;+}++/* The injected .nav owns its own height, padding, blur and border. Neutralise+ the legacy app-shell `header {}` rule from style.css so its line-height does+ not cascade into the nav links. This wrapper is a pure positioning context. */+.cb-page header {+ position: sticky;+ top: 0;+ z-index: 200;+ flex-shrink: 0;+ display: block;+ height: auto;+ padding: 0;+ line-height: normal;+ white-space: normal;+ overflow: visible;+ background: none;+ backdrop-filter: none;+ -webkit-backdrop-filter: none;+ border-bottom: none;+}++.cb-main {+ flex: 1;+ width: 100%;+ max-width: 1140px;+ margin: 0 auto;+ padding: 0 clamp(1.15rem, 4vw, 2rem) clamp(3rem, 8vh, 5rem);+}++/* ── Hero ──────────────────────────────────────────────────────────────── */++.cb-hero {+ position: relative;+ overflow: hidden;+ border-bottom: 1px solid var(--stroke);+ padding: clamp(2.75rem, 8vh, 5rem) clamp(1.15rem, 4vw, 2rem) clamp(2rem, 5vh, 3rem);+}++.cb-hero::before {+ content: '';+ position: absolute;+ inset: 0;+ pointer-events: none;+ background:+ radial-gradient(ellipse 55% 75% at 12% 40%, rgba(255, 255, 255, 0.1) 0%, transparent 62%),+ radial-gradient(ellipse 45% 60% at 88% 12%, rgba(255, 255, 255, 0.05) 0%, transparent 58%);+}++:root[data-theme='light'] .cb-hero::before {+ background:+ radial-gradient(ellipse 55% 75% at 12% 40%, rgba(0, 0, 0, 0.05) 0%, transparent 62%),+ radial-gradient(ellipse 45% 60% at 88% 12%, rgba(0, 0, 0, 0.03) 0%, transparent 58%);+}++.cb-hero-inner {+ position: relative;+ max-width: 1140px;+ margin: 0 auto;+}++.cb-eyebrow {+ display: inline-flex;+ align-items: center;+ gap: 0.5rem;+ font-size: 0.75rem;+ letter-spacing: 0.09em;+ text-transform: uppercase;+ color: var(--ink-faint);+ border: 1px solid var(--stroke);+ background: var(--surface-1);+ border-radius: 999px;+ padding: 0.3rem 0.75rem;+ margin-bottom: 1.15rem;+}++.cb-hero h1 {+ font-family: var(--font-display, inherit);+ font-size: clamp(2rem, 6vw, 3.4rem);+ line-height: 1.04;+ letter-spacing: -0.03em;+ margin: 0 0 0.9rem;+ color: var(--ink-bright);+}++.cb-hero p {+ margin: 0;+ max-width: 62ch;+ font-size: clamp(1rem, 2.1vw, 1.15rem);+ line-height: 1.65;+ color: var(--ink-dim);+}++.cb-hero-meta {+ display: flex;+ flex-wrap: wrap;+ gap: 0.5rem 1.5rem;+ margin-top: 1.6rem;+ font-size: 0.875rem;+ color: var(--ink-faint);+}++.cb-hero-meta strong {+ color: var(--ink);+ font-weight: 600;+}++/* ── Filter bar ────────────────────────────────────────────────────────── */++.cb-toolbar {+ display: flex;+ flex-wrap: wrap;+ align-items: center;+ gap: 0.6rem;+ margin: clamp(1.75rem, 5vh, 2.75rem) 0 1.5rem;+}++.cb-filter {+ appearance: none;+ font: inherit;+ font-size: 0.85rem;+ color: var(--ink-dim);+ background: var(--surface-1);+ border: 1px solid var(--stroke);+ border-radius: 999px;+ padding: 0.42rem 0.95rem;+ cursor: pointer;+ transition:+ background var(--duration-fast, 140ms) ease,+ border-color var(--duration-fast, 140ms) ease,+ color var(--duration-fast, 140ms) ease;+}++.cb-filter:hover {+ background: var(--surface-2);+ color: var(--ink);+ border-color: var(--stroke-strong);+}++.cb-filter:focus-visible {+ outline: 2px solid var(--ink);+ outline-offset: 2px;+}++.cb-filter[aria-pressed='true'] {+ background: var(--ink-bright);+ color: var(--bg-0);+ border-color: transparent;+ font-weight: 600;+}++.cb-count {+ margin-left: auto;+ font-size: 0.8rem;+ color: var(--ink-faint);+ font-variant-numeric: tabular-nums;+}++/* ── Recipe grid ───────────────────────────────────────────────────────── */++.cb-grid {+ display: grid;+ gap: clamp(1rem, 2.2vw, 1.4rem);+ grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));+ list-style: none;+ margin: 0;+ padding: 0;+}++.cb-card {+ position: relative;+ display: flex;+ flex-direction: column;+ border: 1px solid var(--stroke);+ background: var(--surface-1);+ border-radius: var(--radius-lg, 14px);+ overflow: hidden;+ transition:+ transform var(--duration-base, 220ms) var(--ease-standard, ease),+ border-color var(--duration-base, 220ms) ease,+ box-shadow var(--duration-base, 220ms) ease;+}++.cb-card:hover,+.cb-card:focus-within {+ transform: translateY(-3px);+ border-color: var(--stroke-strong);+ box-shadow: var(--shadow-2);+}++.cb-card-media {+ position: relative;+ aspect-ratio: 16 / 9;+ background:+ radial-gradient(ellipse 80% 90% at 50% 110%, rgba(255, 255, 255, 0.08), transparent 70%),+ var(--surface-2);+ border-bottom: 1px solid var(--stroke);+ overflow: hidden;+}++.cb-card-media img,+.cb-card-media model-viewer {+ width: 100%;+ height: 100%;+ display: block;+ object-fit: cover;+ background: transparent;+}++.cb-card-body {+ display: flex;+ flex-direction: column;+ gap: 0.6rem;+ padding: 1.05rem 1.15rem 1.25rem;+ flex: 1;+}++.cb-card h2 {+ margin: 0;+ font-size: 1.06rem;+ line-height: 1.32;+ letter-spacing: -0.012em;+ color: var(--ink-bright);+}++.cb-card h2 a {+ color: inherit;+ text-decoration: none;+}++/* Stretch the title link over the whole card so the card is one click target,+ while the download link below stays independently clickable (z-index). */+.cb-card h2 a::after {+ content: '';+ position: absolute;+ inset: 0;+}++.cb-card h2 a:focus-visible {+ outline: none;+}++.cb-card h2 a:focus-visible::after {+ outline: 2px solid var(--ink);+ outline-offset: -3px;+ border-radius: var(--radius-lg, 14px);+}++.cb-card p {+ margin: 0;+ font-size: 0.9rem;+ line-height: 1.6;+ color: var(--ink-dim);+}++.cb-card-builds {+ font-size: 0.82rem;+ color: var(--ink-faint);+ border-left: 2px solid var(--stroke-strong);+ padding-left: 0.7rem;+}++.cb-card-foot {+ display: flex;+ flex-wrap: wrap;+ align-items: center;+ gap: 0.45rem;+ margin-top: auto;+ padding-top: 0.9rem;+ font-size: 0.75rem;+ color: var(--ink-faint);+}++.cb-chip {+ display: inline-flex;+ align-items: center;+ gap: 0.3rem;+ border: 1px solid var(--stroke);+ border-radius: 999px;+ padding: 0.2rem 0.6rem;+ white-space: nowrap;+}++.cb-chip[data-level='beginner'] {+ color: var(--success);+ border-color: color-mix(in srgb, var(--success) 34%, transparent);+}++.cb-chip[data-level='intermediate'] {+ color: var(--warn);+ border-color: color-mix(in srgb, var(--warn) 34%, transparent);+}++.cb-chip[data-level='advanced'] {+ color: var(--wallet-accent);+ border-color: var(--wallet-stroke);+}++.cb-dl {+ position: relative;+ z-index: 1;+ margin-left: auto;+ color: var(--ink-dim);+ text-decoration: none;+ border-bottom: 1px solid var(--stroke-strong);+ padding-bottom: 1px;+ transition: color var(--duration-fast, 140ms) ease;+}++.cb-dl:hover,+.cb-dl:focus-visible {+ color: var(--ink-bright);+}++/* ── Empty state ───────────────────────────────────────────────────────── */++.cb-empty {+ border: 1px dashed var(--stroke-strong);+ border-radius: var(--radius-lg, 14px);+ padding: clamp(2rem, 6vw, 3.5rem);+ text-align: center;+ color: var(--ink-dim);+}++.cb-empty h2 {+ margin: 0 0 0.5rem;+ font-size: 1.1rem;+ color: var(--ink-bright);+}++.cb-empty p {+ margin: 0 0 1.15rem;+ font-size: 0.92rem;+}++.cb-empty button {+ font: inherit;+ font-size: 0.85rem;+ cursor: pointer;+ color: var(--btn-secondary-fg);+ background: var(--btn-secondary-bg);+ border: 1px solid var(--btn-secondary-border);+ border-radius: 999px;+ padding: 0.45rem 1.1rem;+}++.cb-empty button:hover {+ background: var(--btn-secondary-bg-hover);+}++/* ── Contribute strip ──────────────────────────────────────────────────── */++.cb-outro {+ margin-top: clamp(2.5rem, 7vh, 4rem);+ border: 1px solid var(--stroke);+ border-radius: var(--radius-lg, 14px);+ background: var(--surface-1);+ padding: clamp(1.4rem, 4vw, 2rem);+ display: flex;+ flex-wrap: wrap;+ gap: 1rem 2rem;+ align-items: center;+ justify-content: space-between;+}++.cb-outro h2 {+ margin: 0 0 0.35rem;+ font-size: 1.05rem;+ color: var(--ink-bright);+}++.cb-outro p {+ margin: 0;+ font-size: 0.9rem;+ color: var(--ink-dim);+ max-width: 56ch;+}++.cb-outro-links {+ display: flex;+ flex-wrap: wrap;+ gap: 0.6rem;+}++.cb-btn {+ display: inline-flex;+ align-items: center;+ gap: 0.4rem;+ font-size: 0.85rem;+ text-decoration: none;+ border-radius: 999px;+ padding: 0.5rem 1.1rem;+ border: 1px solid var(--btn-secondary-border);+ background: var(--btn-secondary-bg);+ color: var(--btn-secondary-fg);+ transition: background var(--duration-fast, 140ms) ease;+}++.cb-btn:hover {+ background: var(--btn-secondary-bg-hover);+}++.cb-btn.primary {+ background: var(--btn-primary-bg);+ color: var(--btn-primary-fg);+ border-color: var(--btn-primary-border);+ font-weight: 600;+}++.cb-btn.primary:hover {+ background: var(--btn-primary-bg-hover);+}++.cb-btn:focus-visible {+ outline: 2px solid var(--ink);+ outline-offset: 2px;+}++/* ── Recipe viewer ─────────────────────────────────────────────────────── */++.cb-doc {+ display: grid;+ gap: clamp(1.5rem, 4vw, 3rem);+ grid-template-columns: minmax(0, 1fr);+ padding-top: clamp(1.5rem, 4vh, 2.5rem);+}++@media (min-width: 1000px) {+ .cb-doc {+ grid-template-columns: minmax(0, 1fr) 232px;+ align-items: start;+ }+}++.cb-crumbs {+ font-size: 0.82rem;+ color: var(--ink-faint);+ margin-bottom: 1.1rem;+}++.cb-crumbs a {+ color: inherit;+ text-decoration: none;+ border-bottom: 1px solid transparent;+}++.cb-crumbs a:hover,+.cb-crumbs a:focus-visible {+ color: var(--ink);+ border-bottom-color: var(--stroke-strong);+}++.cb-article {+ min-width: 0;+ font-size: 1rem;+ line-height: 1.75;+ color: var(--ink);+}++.cb-article h1 {+ font-family: var(--font-display, inherit);+ font-size: clamp(1.8rem, 4.5vw, 2.6rem);+ line-height: 1.1;+ letter-spacing: -0.028em;+ margin: 0 0 1rem;+ color: var(--ink-bright);+}++.cb-article h2 {+ font-size: clamp(1.25rem, 3vw, 1.55rem);+ line-height: 1.25;+ letter-spacing: -0.018em;+ margin: 2.6rem 0 0.85rem;+ padding-top: 1.4rem;+ border-top: 1px solid var(--stroke);+ color: var(--ink-bright);+}++.cb-article h3 {+ font-size: 1.08rem;+ margin: 1.9rem 0 0.6rem;+ color: var(--ink-bright);+}++.cb-article p,+.cb-article li {+ color: var(--ink-dim);+}++.cb-article a {+ color: var(--ink);+ text-decoration: none;+ border-bottom: 1px solid var(--stroke-strong);+}++.cb-article a:hover,+.cb-article a:focus-visible {+ color: var(--ink-bright);+ border-bottom-color: var(--ink-bright);+}++.cb-article ul,+.cb-article ol {+ padding-left: 1.35rem;+}++.cb-article li + li {+ margin-top: 0.35rem;+}++.cb-article code {+ font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);+ font-size: 0.87em;+ background: var(--surface-2);+ border: 1px solid var(--stroke);+ border-radius: 5px;+ padding: 0.1em 0.35em;+}++.cb-article pre {+ position: relative;+ background: var(--surface-1);+ border: 1px solid var(--stroke);+ border-radius: var(--radius-md, 10px);+ padding: 1rem 1.1rem;+ overflow-x: auto;+ line-height: 1.55;+ font-size: 0.85rem;+}++.cb-article pre code {+ background: none;+ border: 0;+ padding: 0;+ font-size: inherit;+}++.cb-article blockquote {+ margin: 1.4rem 0;+ padding: 0.1rem 0 0.1rem 1.1rem;+ border-left: 2px solid var(--stroke-strong);+ color: var(--ink-faint);+}++.cb-article table {+ width: 100%;+ border-collapse: collapse;+ font-size: 0.9rem;+ margin: 1.4rem 0;+}++.cb-article th,+.cb-article td {+ text-align: left;+ padding: 0.55rem 0.7rem;+ border-bottom: 1px solid var(--hairline);+}++.cb-article th {+ color: var(--ink-bright);+ font-weight: 600;+}++.cb-table-scroll {+ overflow-x: auto;+}++.cb-copy {+ position: absolute;+ top: 0.55rem;+ right: 0.55rem;+ display: inline-flex;+ align-items: center;+ gap: 0.3rem;+ font: inherit;+ font-size: 0.72rem;+ cursor: pointer;+ color: var(--ink-faint);+ background: var(--surface-2);+ border: 1px solid var(--stroke);+ border-radius: 7px;+ padding: 0.25rem 0.55rem;+ opacity: 0;+ transition:+ opacity var(--duration-fast, 140ms) ease,+ color var(--duration-fast, 140ms) ease;+}++.cb-article pre:hover .cb-copy,+.cb-copy:focus-visible {+ opacity: 1;+}++.cb-copy:hover {+ color: var(--ink-bright);+}++/* ── Viewer sidebar ────────────────────────────────────────────────────── */++.cb-side {+ position: sticky;+ top: calc(var(--header-h, 64px) + 1.25rem);+ display: flex;+ flex-direction: column;+ gap: 1.25rem;+ font-size: 0.85rem;+}++.cb-side-card {+ border: 1px solid var(--stroke);+ background: var(--surface-1);+ border-radius: var(--radius-lg, 14px);+ padding: 1rem 1.05rem;+}++.cb-side-card h2 {+ margin: 0 0 0.7rem;+ font-size: 0.72rem;+ letter-spacing: 0.09em;+ text-transform: uppercase;+ color: var(--ink-faint);+ font-weight: 600;+}++.cb-facts {+ margin: 0;+ display: grid;+ grid-template-columns: auto 1fr;+ gap: 0.4rem 0.75rem;+}++.cb-facts dt {+ color: var(--ink-faint);+}++.cb-facts dd {+ margin: 0;+ color: var(--ink);+}++.cb-toc {+ list-style: none;+ margin: 0;+ padding: 0;+ display: flex;+ flex-direction: column;+ gap: 0.4rem;+ max-height: 46vh;+ overflow-y: auto;+}++.cb-toc a {+ color: var(--ink-dim);+ text-decoration: none;+ line-height: 1.4;+ display: block;+ border-left: 2px solid transparent;+ padding-left: 0.6rem;+ transition:+ color var(--duration-fast, 140ms) ease,+ border-color var(--duration-fast, 140ms) ease;+}++.cb-toc a:hover,+.cb-toc a:focus-visible,+.cb-toc a[aria-current='true'] {+ color: var(--ink-bright);+ border-left-color: var(--ink-bright);+}++.cb-toc li.sub a {+ padding-left: 1.3rem;+ font-size: 0.8rem;+}++/* ── Pager ─────────────────────────────────────────────────────────────── */++.cb-pager {+ display: grid;+ gap: 0.85rem;+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));+ margin-top: 3rem;+ padding-top: 1.75rem;+ border-top: 1px solid var(--stroke);+}++.cb-pager a {+ display: flex;+ flex-direction: column;+ gap: 0.25rem;+ border: 1px solid var(--stroke);+ border-radius: var(--radius-lg, 14px);+ padding: 0.85rem 1rem;+ text-decoration: none;+ color: var(--ink);+ transition:+ border-color var(--duration-fast, 140ms) ease,+ background var(--duration-fast, 140ms) ease;+}++.cb-pager a:hover,+.cb-pager a:focus-visible {+ border-color: var(--stroke-strong);+ background: var(--surface-1);+}++.cb-pager a.next {+ text-align: right;+}++.cb-pager-dir {+ font-size: 0.72rem;+ letter-spacing: 0.07em;+ text-transform: uppercase;+ color: var(--ink-faint);+}++.cb-pager-title {+ font-size: 0.92rem;+ color: var(--ink-bright);+}++/* ── Loading + error states ────────────────────────────────────────────── */++.cb-skeleton {+ display: flex;+ flex-direction: column;+ gap: 0.9rem;+}++.cb-skeleton span {+ display: block;+ height: 0.85rem;+ border-radius: 6px;+ background: linear-gradient(90deg, var(--surface-1), var(--surface-3), var(--surface-1));+ background-size: 200% 100%;+ animation: cb-shimmer 1.3s linear infinite;+}++.cb-skeleton span:first-child {+ height: 2.2rem;+ width: 65%;+ margin-bottom: 0.6rem;+}++.cb-skeleton span:nth-child(3) {+ width: 92%;+}++.cb-skeleton span:nth-child(4) {+ width: 78%;+}++.cb-skeleton span:nth-child(5) {+ width: 85%;+}++@keyframes cb-shimmer {+ from {+ background-position: 200% 0;+ }+ to {+ background-position: -200% 0;+ }+}++.cb-error {+ border: 1px solid color-mix(in srgb, var(--danger) 34%, transparent);+ background: color-mix(in srgb, var(--danger) 8%, transparent);+ border-radius: var(--radius-lg, 14px);+ padding: 1.25rem 1.35rem;+}++.cb-error h1 {+ margin: 0 0 0.5rem;+ font-size: 1.15rem;+ color: var(--ink-bright);+}++.cb-error p {+ margin: 0 0 0.9rem;+ color: var(--ink-dim);+ font-size: 0.92rem;+}++@media (prefers-reduced-motion: reduce) {+ .cb-card,+ .cb-skeleton span {+ transition: none;+ animation: none;+ }+}diff --git a/public/examples.json b/public/examples.jsonindex 864dec6f8..d8c446016 100644--- a/public/examples.json+++ b/public/examples.json@@ -1,5 +1,5 @@{- "$comment": "Generated by scripts/build-examples-index.mjs from what is on disk. Do not edit by hand; run npm run build:examples.",+ "$comment": "GENERATED by scripts/mirror-examples-index.mjs from data/examples.json. Do not edit; run `npm run build:examples`.","generated_by": "scripts/build-examples-index.mjs","counts": {"total": 39,diff --git a/public/features.json b/public/features.jsonindex c021fc5f7..d6bfeca92 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-30T22:49:03.981Z",+ "generated_at": "2026-07-30T22:49:50.305Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",@@ -5237,6 +5237,16 @@"tags": [],"showcase": false},+ {+ "path": "/docs/mcp-safety",+ "title": "Docs · MCP tool safety",+ "description": "What an MCP tool's safety annotations mean on three.ws and why you can trust them: read-only tools never change what you asked about, anything that spends is labelled as spending, and a build check verifies every hint against the tool's own code before it can ship.",+ "added": "2026-07-30",+ "auth": null,+ "indexable": true,+ "tags": [],+ "showcase": false+ },{"path": "/mcp-tools","title": "MCP Tool Catalog",diff --git a/public/llms-full.txt b/public/llms-full.txtindex f2cb90167..08ff89759 100644--- a/public/llms-full.txt+++ b/public/llms-full.txt@@ -3173,6 +3173,12 @@ URL: https://three.ws/tutorials/read-the-trading-fleetTell a working autonomous strategy from a lucky one: why realized profit is the only profit, how to read profit factor against win rate and drawdown, the sample size below which a rank means nothing, and how to spot a broken fleet that still shows a green light.+### Docs · MCP tool safety++URL: https://three.ws/docs/mcp-safety++What an MCP tool's safety annotations mean on three.ws and why you can trust them: read-only tools never change what you asked about, anything that spends is labelled as spending, and a build check verifies every hint against the tool's own code before it can ship.+### MCP Tool CatalogURL: https://three.ws/mcp-toolsdiff --git a/public/llms.txt b/public/llms.txtindex 0ea1c2fd3..c7bc2eb39 100644--- a/public/llms.txt+++ b/public/llms.txt@@ -544,6 +544,7 @@ Docs, tutorials, and reference.- [Docs · Docs World](https://three.ws/docs/docs-world): The three.ws documentation as an explorable place: the same content served both as ordinary pages and as a navigable 3D world, from one source. How the two surfaces stay in sync.- [Docs · Package extraction](https://three.ws/docs/package-extraction): How reusable packages graduate out of the three.ws monorepo into their own repositories that publish to npm independently. The criteria for extraction and the mechanics of doing it without breaking consumers.- [Tutorial · Read the trading fleet](https://three.ws/tutorials/read-the-trading-fleet): Tell a working autonomous strategy from a lucky one: why realized profit is the only profit, how to read profit factor against win rate and drawdown, the sample size below which a rank means nothing, and how to spot a broken fleet that still shows a green light.+- [Docs · MCP tool safety](https://three.ws/docs/mcp-safety): What an MCP tool's safety annotations mean on three.ws and why you can trust them: read-only tools never change what you asked about, anything that spends is labelled as spending, and a build check verifies every hint against the tool's own code before it can ship.- [MCP Tool Catalog](https://three.ws/mcp-tools): Every MCP tool three.ws publishes, searchable in one place: what it does, which server hosts it, what it costs in USDC, and whether an AI client can run it unattended. Generated from the source of each tool, so it never drifts from what the servers serve.- [Docs · The 10 SOL trading experiment](https://three.ws/docs/trading-experiment): The full risk policy behind the autonomous fleet: entry band, position sizing, taking initials at 2x, the moon-bag floor, trailing and hard stops, and how to read the decision journal.- [Tutorial · Getting started (hosted)](https://three.ws/tutorials/getting-started): A five-minute, no-code tour: create an agent, pick a body, give it a personality, share the URL.diff --git a/public/locales/localized-pages.json b/public/locales/localized-pages.jsonindex e9141e873..651c0a78a 100644--- a/public/locales/localized-pages.json+++ b/public/locales/localized-pages.json@@ -1,6 +1,6 @@{"generated": true,- "count": 350,+ "count": 349,"paths": ["/","/3d",@@ -62,7 +62,6 @@"/concierge","/constellation","/converter",- "/cookbook","/cosmos","/create","/create-agent",diff --git a/public/sitemap/index.html b/public/sitemap/index.htmlindex b38ed9aa3..eccf7e365 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 726 pages on three.ws, grouped by purpose. Looking for the machine-readable versions?</p>+ <p>All 727 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 726 pages by name, path, or description…" aria-label="Filter pages" autocomplete="off" spellcheck="false" />+ <input id="sm-filter-input" type="search" placeholder="Filter 727 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>305</span></h2>+ <h2>Learn<span class="sm-count" data-count>306</span></h2><p class="sm-section-desc">Docs, tutorials, and reference.</p></header><ul class="sm-list">@@ -3872,6 +3872,13 @@<span class="sm-desc">Tell a working autonomous strategy from a lucky one: why realized profit is the only profit, how to read profit factor against win rate and drawdown, the sample size below which a rank means nothing, and how to spot a broken fleet that still shows a green light.</span></a></li>+ <li>+ <a href="/docs/mcp-safety">+ <span class="sm-title">Docs · MCP tool safety</span>+ <span class="sm-path">/docs/mcp-safety</span>+ <span class="sm-desc">What an MCP tool's safety annotations mean on three.ws and why you can trust them: read-only tools never change what you asked about, anything that spends is labelled as spending, and a build check verifies every hint against the tool's own code before it can ship.</span>+ </a>+ </li><li><a href="/mcp-tools"><span class="sm-title">MCP Tool Catalog</span>diff --git a/public/tutorials-manifest.js b/public/tutorials-manifest.jsindex 39e726f0c..2e1d57493 100644--- a/public/tutorials-manifest.js+++ b/public/tutorials-manifest.js@@ -422,6 +422,16 @@previewModel: '/avatars/cz.glb',ctaPrimary: { label: 'Open the Bazaar', href: '/bazaar' },},+ {+ slug: 'earn-and-spend-in-play',+ tier: 'middle',+ title: 'Earn and spend in /play',+ blurb: "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.",+ builds: 'A funded character who has run the whole gather → sell → bank loop',+ time: '25 min',+ previewModel: '/animations/soldier.glb',+ ctaPrimary: { label: 'Open /play', href: '/play' },+ },/* ───────────────────────── ADVANCED ───────────────────────── */{diff --git a/robinhood/robinhood-chain-examples/README.md b/robinhood/robinhood-chain-examples/README.mdindex 9f6737c90..6df1948b4 100644--- a/robinhood/robinhood-chain-examples/README.md+++ b/robinhood/robinhood-chain-examples/README.md@@ -16,7 +16,7 @@ you at each step.## Website-The landing page in [`docs/`](docs/) is a single self-contained `index.html` (inline CSS + JS, zero external requests, works from `file://`). Its signature interaction is a **darkroom contact sheet**: the fourteen examples are frames of unexposed film. Hover a frame and its real source *develops* in like film in developer fluid; click to enlarge the whole thing with its run command and status. The four not-yet-built examples ship as honest blank, unexposed frames. Every code excerpt is a real capture from the example's own source.+The landing page in [`docs/`](docs/) is a single self-contained `index.html` (inline CSS + JS, zero external requests, works from `file://`). Its signature interaction is a **darkroom contact sheet**: the fourteen examples are frames of unexposed film. Hover a frame and its real source *develops* in like film in developer fluid; click to enlarge the whole thing with its run command and status. Every code excerpt is a real capture from the example's own source.Deploy the `docs/` folder anywhere static:@@ -39,9 +39,12 @@ Config lives in [`wrangler.toml`](wrangler.toml), [`netlify.toml`](netlify.toml)on npm as `hoodchain`. Examples pin `^0.1.0` in their `package.json` — aplain `npm install` resolves it. If you're developing against an unreleasedlocal SDK build instead, see [Installing `hoodchain`](#installing-hoodchain).-- Examples 09, 10, 11, and 13 are **not built** — they depend on sibling- packages (`hood-api`, `hood402`, `hood-mcp`, `hood-launcher`) that haven't- shipped yet. Each has a README explaining exactly what's missing.+- **All fourteen examples are built and runnable.** The four that depend on+ sibling packages (`hood402` for 09 and 10, `hood-mcp` for 11,+ `hood-launcher` for 13) now resolve them from npm like any other dependency.+ Each runs end to end with no key: 09 and 10 complete a real x402 challenge+ and signature and stop honestly at an unfunded balance, 11 is fully+ read-only, and 13 runs a real on-chain preflight without broadcasting.## Installing `hoodchain`@@ -125,11 +128,11 @@ robinhood-chain-examples/│ ├── 06-firehose/ raw sequencer feed decoder│ ├── 07-live-price-webpage/ zero-dependency static price page│ ├── 08-portfolio-dashboard/ Vite + React dashboard-│ ├── 09-x402-paid-api-call/ gap note — blocked on hood-api/hood402-│ ├── 10-x402-sell-your-api/ gap note — blocked on hood402-│ ├── 11-mcp-agent-session/ gap note — blocked on hood-mcp+│ ├── 09-x402-paid-api-call/ x402 client: 402, sign, retry, settle+│ ├── 10-x402-sell-your-api/ x402 paywall middleware over a quote route+│ ├── 11-mcp-agent-session/ MCP client driving hood-mcp over stdio│ ├── 12-telegram-price-bot/ grammY bot-│ ├── 13-launch-a-coin-testnet/ gap note — blocked on hood-launcher+│ ├── 13-launch-a-coin-testnet/ launch pipeline: screen, preflight, send│ └── 14-agent-paper-trader/ paper-trading strategy loop├── docs/ static gallery site (GitHub Pages, generated)├── tools/build-docs.mjs docs generator (marked + highlight.js)diff --git a/robinhood/robinhood-chain-examples/docs/examples/09-x402-paid-api-call/index.html b/robinhood/robinhood-chain-examples/docs/examples/09-x402-paid-api-call/index.htmlindex c82dd1a7c..01deb537e 100644--- a/robinhood/robinhood-chain-examples/docs/examples/09-x402-paid-api-call/index.html+++ b/robinhood/robinhood-chain-examples/docs/examples/09-x402-paid-api-call/index.html@@ -13,36 +13,74 @@<a class="brand" href="../index.html">Robinhood Chain Examples</a><a class="ghlink" href="https://github.com/nirholas/robinhood-chain-examples">GitHub ↗</a></div>- <div class="wrap"><div class="readme"><h1>09 · x402 paid API call — blocked on siblings</h1>-<p><strong>Status: not built.</strong> This example is supposed to show a client paying a-<code>hood-api</code> endpoint via <code>hood402</code>. Neither package exists yet in the-<code>robinhood/</code> workspace as of this writing — only the core SDK-(<a href="https://github.com/nirholas/robinhood-chain-sdk"><code>hoodchain</code></a>) has shipped.-Per this repo's mission ("check which siblings exist and cover what's-actually there; note any gaps"), this folder is a placeholder-free gap note,-not a stub implementation.</p>-<h2>What's missing</h2>+ <div class="wrap"><div class="readme"><h1>09 · Pay for an API call</h1>+<p>A metered endpoint answers an unpaid request with HTTP 402 and a+machine-readable price. This example is the client side of that exchange,+step by step: decode the challenge, sign an EIP-3009 USDG authorization for+exactly the quoted amount, retry with the <code>X-PAYMENT</code> header, and read the+settlement receipt off <code>X-PAYMENT-RESPONSE</code>. Nothing is hidden inside a+wrapper.</p>+<p>The endpoint being paid is a <code>hood-api</code>-shaped quote route (<code>/v1/quote/:symbol</code>)+gated by <a href="https://www.npmjs.com/package/hood402"><code>hood402</code></a>'s <code>paywall()</code>. By+default this file starts one locally so the example is standalone. It is the+buy side of <a href="../10-x402-sell-your-api">example 10</a>, which is the sell side.</p>+<p><strong>What it proves:</strong> x402 on Robinhood Chain runs on USDG, which has 6 decimals+and <strong>no</strong> EIP-2612 <code>permit</code>, so the gasless path is EIP-3009+<code>transferWithAuthorization</code>. The payer signs; the resource server or a+facilitator broadcasts and pays the gas.</p>+<h2>Prerequisites</h2><ul>-<li><strong><code>hood-api</code></strong> — a market-data API server for Robinhood Chain (Stock Token-quotes, portfolios, launches) with metered endpoints.</li>-<li><strong><code>hood402</code></strong> — an <a href="https://github.com/coinbase/x402">x402</a> payment client-and middleware for USDG on Robinhood Chain (the payment rail this example-would use).</li>+<li>Node ≥ 20.</li>+<li><strong>No key needed to see the full flow.</strong> Without+<code>ROBINHOOD_CHAIN_PRIVATE_KEY</code> a fresh keypair is generated: the 402, the+signature, and the on-chain verification are all still real, the payer just+genuinely holds 0 USDG, so the server correctly reports+<code>insufficient_funds</code>.</li>+<li>To settle for real, fund a testnet wallet with USDG and set+<code>ROBINHOOD_CHAIN_PRIVATE_KEY</code>. Faucet:+<a href="https://faucet.testnet.chain.robinhood.com/">https://faucet.testnet.chain.robinhood.com/</a></li></ul>-<h2>What this example will do once they exist</h2>-<pre><code>Client → GET /api/quote/AAPL on a hood-api endpoint- → 402 Payment Required (x402 challenge, USDG on Robinhood Chain)- → hood402 client signs and attaches payment- → retry → 200 OK with the priced quote-</code></pre><p>The general x402 pattern is proven elsewhere on three.ws (see the-<a href="https://three.ws"><code>pay-for-service</code></a> skill and <code>x402</code> catalog) — the gap here-is Robinhood-Chain-specific: a <code>hood402</code> client that speaks USDG (6 decimals,-no EIP-2612 <code>permit</code>, so approvals are on-chain — see <code>hoodchain</code>'s <code>usdg.ts</code>)-instead of the USDC flow those examples use.</p>-<h2>Owner action</h2>-<p>Build <code>hood-api</code> and <code>hood402</code> (prompts 04 and 05 in-<code>prompts/robinhood-chain/</code>), then this example becomes a ~40-line client-script. No further action needed from this repo until then.</p>+<h2>Run</h2>+<pre><code class="hljs language-bash">npm install+npm start <span class="hljs-comment"># local endpoint, testnet rail</span>+node index.js --url https://api.example.com/v1/quote/AAPL+HOOD_API_URL=http://localhost:8787 node index.js <span class="hljs-comment"># paywall a real hood-api</span>+ROBINHOOD_CHAIN_PRIVATE_KEY=0x... node index.js <span class="hljs-comment"># pay for real</span>+</code></pre><h2>Expected output</h2>+<pre><code>x402 paid API call - robinhood-testnet (chain 46630)+ payer 0x387D8c3A54e1aE791a6025B2BA9Db2bED45da432 (ephemeral: no ROBINHOOD_CHAIN_PRIVATE_KEY set)+ USDG 0x7E955252E15c84f5768B83c41a71F9eba181802F 6 decimals, EIP-3009 rail+ seller 0xcc2210aff3F61eFe8EFC14236fe10ddd718C2271 (local endpoint, self-settling)+ source hoodchain getQuote on mainnet 4663+ target http://127.0.0.1:38751/v1/quote/AAPL++1. GET without payment+ HTTP 402 · x402Version 1+ price 0.01 USDG+ payTo 0xcc2210aff3F61eFe8EFC14236fe10ddd718C2271+ asset 0x7E955252E15c84f5768B83c41a71F9eba181802F+ expires 60s after payment++2. Sign an EIP-3009 authorization for exactly that amount+ from 0x387D8c3A54e1aE791a6025B2BA9Db2bED45da432+ to 0xcc2210aff3F61eFe8EFC14236fe10ddd718C2271+ value 10000 atomic (0.01 USDG)+ validAfter 1785451436 validBefore 1785451741+ nonce 0xe9c5b80b60e8857976241657997e63624ebf09f09d98d306545ef3cdbbbe824c+ signature 0xeb78586ebe14d4016a76…9474671b++3. Retry with the X-PAYMENT header+ HTTP 402+ error The payer does not hold enough USDG to cover the payment.+</code></pre><p>That third step is the honest ending for an unfunded payer, and it is the+interesting one: the server verified a real signature against a real balance+and refused to settle a payment that would revert. Fund the payer and step 3+returns the quote plus a settlement tx hash instead.</p>+<h2>The shape of the challenge</h2>+<p>Everything the client needs to pay arrives in the 402 body: the scheme, the+network, the asset contract, the maximum amount, and where to send it. That is+what makes x402 machine-payable. No account, no API key, and no prior+relationship, just a price an agent can read and satisfy.</p><hr><p>Built by <a href="https://x.com/nichxbt">nirholas</a> · <a href="https://three.ws">three.ws</a></p></div></div>diff --git a/robinhood/robinhood-chain-examples/docs/examples/10-x402-sell-your-api/index.html b/robinhood/robinhood-chain-examples/docs/examples/10-x402-sell-your-api/index.htmlindex ca6d377dc..a884df51a 100644--- a/robinhood/robinhood-chain-examples/docs/examples/10-x402-sell-your-api/index.html+++ b/robinhood/robinhood-chain-examples/docs/examples/10-x402-sell-your-api/index.html@@ -13,26 +13,86 @@<a class="brand" href="../index.html">Robinhood Chain Examples</a><a class="ghlink" href="https://github.com/nirholas/robinhood-chain-examples">GitHub ↗</a></div>- <div class="wrap"><div class="readme"><h1>10 · Sell your API with x402 — blocked on siblings</h1>-<p><strong>Status: not built.</strong> This example is supposed to be a ~20-line paid-endpoint using <code>hood402</code> middleware. That package doesn't exist yet in the-<code>robinhood/</code> workspace — see <a href="../09-x402-paid-api-call">example 09</a> for the-same gap on the client side, and the root README's SDK feedback for the full-picture of what's shipped vs. pending.</p>-<h2>What's missing</h2>-<p><strong><code>hood402</code></strong> — the Wave-2 payment package (prompt 05 in-<code>prompts/robinhood-chain/</code>). This example needs its server-side middleware:-something like</p>-<pre><code class="hljs language-js"><span class="hljs-keyword">import</span> { hood402 } <span class="hljs-keyword">from</span> <span class="hljs-string">'hood402'</span>-app.<span class="hljs-title function_">get</span>(<span class="hljs-string">'/quote/:symbol'</span>, <span class="hljs-title function_">hood402</span>({ <span class="hljs-attr">priceUsdg</span>: <span class="hljs-string">'0.01'</span> }), <span class="hljs-title function_">async</span> (req, res) => {- res.<span class="hljs-title function_">json</span>(<span class="hljs-keyword">await</span> <span class="hljs-title function_">getQuote</span>(hood, req.<span class="hljs-property">params</span>.<span class="hljs-property">symbol</span>))-})-</code></pre><p>wrapping any Express/Fastify/Hono route in a USDG-denominated x402 paywall.</p>-<h2>Owner action</h2>-<p>Build <code>hood402</code> (prompt 05), then this example becomes a real deployable-endpoint (Cloud Run, matching this campaign's existing serverless pattern) —-no further action needed from this repo until then.</p>-<hr>+ <div class="wrap"><div class="readme"><h1>10 · Sell your API</h1>+<p>Put a USDG paywall in front of any Robinhood Chain endpoint. The entire paid+route is one <code>paywall()</code> middleware from+<a href="https://www.npmjs.com/package/hood402"><code>hood402</code></a> plus one handler that reads+the chain with <code>hoodchain</code>. Everything else in the file is startup wiring and+a self-check that proves the gate is live.</p>+<p>This is the sell side of <a href="../09-x402-paid-api-call">example 09</a>. Run them+together and you have a complete market: an agent discovers a price it can+read, pays it, and gets data back, with no account and no API key anywhere.</p>+<p><strong>What it proves:</strong> monetizing an endpoint is middleware, not architecture.+Any spec-compliant x402 client can pay this route, and a free route can sit+directly beside a paid one in the same app.</p>+<h2>Prerequisites</h2>+<ul>+<li>Node ≥ 20.</li>+<li><strong>No key needed.</strong> With no settlement credentials the server self-settles+from a freshly generated gas key that holds nothing: challenges and+signature verification are fully real, and a paid request stops honestly at+"insufficient gas wallet" instead of pretending to settle.</li>+</ul>+<h2>Run</h2>+<pre><code class="hljs language-bash">npm install+npm start <span class="hljs-comment"># boot on testnet, self-check, keep serving</span>+npm start -- --once <span class="hljs-comment"># boot, self-check, exit (what CI runs)</span>+HOOD402_NETWORK=robinhood npm start <span class="hljs-comment"># mainnet 4663 instead</span>+HOOD402_PAY_TO=0x... npm start <span class="hljs-comment"># your own settlement address</span>+</code></pre><h2>Expected output</h2>+<pre><code>hood402 paid endpoint - robinhood-testnet (chain 46630)+ paid : GET http://127.0.0.1:8010/v1/quote/:symbol 0.01 USDG+ free : GET http://127.0.0.1:8010/v1/symbols+ payTo: 0xA9b426C23E7dDc33Eb2B2fB69A058f2749F61daC+ settle: self-settle (ephemeral unfunded gas key)+ USDG : 0x7E955252E15c84f5768B83c41a71F9eba181802F+ data : mainnet 4663 Chainlink feeds (reads are free and public)++GET /v1/quote/AAPL with no payment -> HTTP 402+ x402Version 1+ scheme exact+ network robinhood-testnet+ asset 0x7E955252E15c84f5768B83c41a71F9eba181802F (USDG, 6 decimals)+ maxAmount 10000 atomic = 0.01 USDG+ payTo 0xA9b426C23E7dDc33Eb2B2fB69A058f2749F61daC+ description Robinhood Chain Stock Token quote: Chainlink oracle price, feed, and freshness.++GET /v1/symbols (free) -> HTTP 200, 95 Stock Tokens, no payment required++--once: self-check done, shutting down. Drop the flag to keep serving.+</code></pre><h2>Two ways to settle, both real</h2>+<p>Pick one with an environment variable:</p>+<table>+<thead>+<tr>+<th>Setting</th>+<th>What happens</th>+<th>Who pays gas</th>+</tr>+</thead>+<tbody><tr>+<td><code>FACILITATOR_URL=https://...</code></td>+<td>Verify and settle are delegated. This process never holds a key.</td>+<td>The facilitator</td>+</tr>+<tr>+<td><code>FACILITATOR_PRIVATE_KEY=0x...</code></td>+<td>This process broadcasts the authorization itself. Needs ETH on the chosen network.</td>+<td>You</td>+</tr>+<tr>+<td>neither</td>+<td>Self-settle from an ephemeral unfunded key. Challenges and verification are real; settlement stops honestly.</td>+<td>Nobody</td>+</tr>+</tbody></table>+<p>The third row is the default because it makes the example runnable by anyone+in one command while refusing to fake the part it cannot actually do.</p>+<h2>Charging for your own endpoint</h2>+<p>Swap the handler and keep the middleware. The price, the asset, and the+settlement address are all arguments:</p>+<pre><code class="hljs language-js">app.<span class="hljs-title function_">get</span>(<span class="hljs-string">'/v1/quote/:symbol'</span>, <span class="hljs-title function_">paywall</span>({ <span class="hljs-attr">price</span>: <span class="hljs-string">'0.01'</span>, <span class="hljs-attr">payTo</span>: <span class="hljs-variable constant_">MY_ADDRESS</span> }), handler)+</code></pre><hr><p>Built by <a href="https://x.com/nichxbt">nirholas</a> · <a href="https://three.ws">three.ws</a></p></div></div><footer>diff --git a/robinhood/robinhood-chain-examples/docs/examples/11-mcp-agent-session/index.html b/robinhood/robinhood-chain-examples/docs/examples/11-mcp-agent-session/index.htmlindex 6eeca8b78..d9a0201c9 100644--- a/robinhood/robinhood-chain-examples/docs/examples/11-mcp-agent-session/index.html+++ b/robinhood/robinhood-chain-examples/docs/examples/11-mcp-agent-session/index.html@@ -13,26 +13,91 @@<a class="brand" href="../index.html">Robinhood Chain Examples</a><a class="ghlink" href="https://github.com/nirholas/robinhood-chain-examples">GitHub ↗</a></div>- <div class="wrap"><div class="readme"><h1>11 · MCP agent session — blocked on siblings</h1>-<p><strong>Status: not built.</strong> This example is supposed to be a scripted MCP client-driving <code>hood-mcp</code> tools (quote, portfolio, launches, swap exposed as MCP tool-calls for an LLM agent). <code>hood-mcp</code> doesn't exist yet in the <code>robinhood/</code>-workspace — see the root README's SDK feedback for the full picture.</p>-<h2>What's missing</h2>-<p><strong><code>hood-mcp</code></strong> — an MCP server wrapping <code>hoodchain</code> (prompt 06 in-<code>prompts/robinhood-chain/</code>), exposing tools like <code>get_stock_quote</code>,-<code>get_portfolio</code>, <code>get_recent_launches</code>, <code>quote_swap</code> to any MCP-speaking-agent host (Claude Code, Claude Desktop, etc.) — the same pattern three.ws's-own <code>3d-agent-local</code> MCP server uses for its tools.</p>-<h2>What this example will do once it exists</h2>-<p>A minimal Node script using <code>@modelcontextprotocol/sdk</code>'s client to connect to-a locally-spawned <code>hood-mcp</code> server over stdio, list its tools, and call-<code>get_stock_quote</code> for a symbol — printing the same kind of output as-<a href="../02-stock-price-sdk">example 02</a>, but routed through MCP instead of a-direct SDK import.</p>-<h2>Owner action</h2>-<p>Build <code>hood-mcp</code> (prompt 06), then this example becomes a ~30-line MCP client-script — no further action needed from this repo until then.</p>+ <div class="wrap"><div class="readme"><h1>11 · MCP agent session</h1>+<p>Every other example here imports <code>hoodchain</code> and calls it directly. An LLM+agent cannot do that: it only reaches the world through tools its host has+been given. <a href="https://www.npmjs.com/package/hood-mcp"><code>hood-mcp</code></a> is the bridge</p>+<ul>+<li>a Model Context Protocol server that exposes Robinhood Chain reads as+protocol tools, so Claude Code, Claude Desktop, Cursor, or any MCP host can+answer "what is AAPL worth on Robinhood Chain?" without a line of chain code.</li>+</ul>+<p>This example is the client half of that conversation, written longhand: it+spawns the real <code>hood-mcp</code> data server over stdio, completes the MCP+initialize handshake, lists the tools the server advertises, then calls three+of them. It is exactly what an agent host does internally, with the protocol+traffic made visible.</p>+<p><strong>What it proves:</strong> the SDK, the MCP server, and an agent host are three+layers over one chain. Tool annotations (<code>readOnlyHint</code>) let a host know which+calls are safe before it makes them, and the read-only data server is a+separate binary from the trading server, so an agent cannot spend by accident.</p>+<h2>Prerequisites</h2>+<ul>+<li>Node ≥ 20. No wallet, key, or funds: all nine tools here are read-only.</li>+</ul>+<h2>Run</h2>+<pre><code class="hljs language-bash">npm install+npm start <span class="hljs-comment"># handshake + tool list + three real calls</span>+node index.js --symbol TSLA <span class="hljs-comment"># price a different Stock Token</span>+node index.js --list-only <span class="hljs-comment"># stop after the tool inventory</span>+</code></pre><h2>Expected output</h2>+<pre><code>1 · Spawning the MCP server over stdio+ server …/node_modules/hood-mcp/dist/data-server.js+ network mainnet+ connected to hood-mcp v0.1.0+ capabilities tools++2 · Tools the server advertises+ get_chain_stats read-only (no inputs)+ list_stock_tokens read-only (pricedOnly, limit, offset)+ get_stock_quote read-only (symbol, maxAgeSeconds)+ get_portfolio read-only (address)+ get_coin read-only (address)+ list_trending_coins read-only (limit)+ get_recent_launches read-only (lookbackBlocks, launchpad, limit)+ watch_launches read-only (waitSeconds, launchpad, limit, includeRecentIfEmpty)+ search_token read-only (query, limit)+ 9 tools total.++3 · get_chain_stats, the tool with no arguments+ chain mainnet (id 4663)+ block 23563878+ gas price 0.02 gwei+ TVL $355,018,487.24++4 · get_stock_quote, the same call an agent makes for "what is AAPL worth?"+ AAPL Apple • Robinhood Token+ oracle $333.01+ DEX mid $333.10+ premium 0.026%+ underlying $333.01 per share (ERC-8056 multiplier 1000000000000000000)++5 · list_trending_coins, a list-shaped result+ YODA / WETH $0.00000927 -95.7% 24h vol $264,059.93+ ASTEROID / WETH $0.00192937 +132.9% 24h vol $973,870.39+ HOODRAT / WETH $0.00563021 +170.0% 24h vol $7,800,285.23+</code></pre><p>Captured live against mainnet at block 23,563,878. Your numbers will differ:+the oracle price moves with the market, and the trending list is whatever is+hot when you run it. The <code>premium</code> line is the DEX mid against the Chainlink+oracle, so a fraction of a percent is normal and a wide gap is the signal.</p>+<h2>Wire it into a real agent</h2>+<p>The point of the server is that you do not write this client at all. Register+it once and the nine tools become things your agent can simply ask for:</p>+<pre><code class="hljs language-bash">claude mcp add hood-mcp -- npx -y hood-mcp+</code></pre><p>For Claude Desktop or Cursor, add the same command to the host's MCP config:</p>+<pre><code class="hljs language-json"><span class="hljs-punctuation">{</span>+ <span class="hljs-attr">"mcpServers"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>+ <span class="hljs-attr">"hood-mcp"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> <span class="hljs-attr">"command"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"npx"</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"args"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"-y"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"hood-mcp"</span><span class="hljs-punctuation">]</span> <span class="hljs-punctuation">}</span>+ <span class="hljs-punctuation">}</span>+<span class="hljs-punctuation">}</span>+</code></pre><p>Then ask in plain language: <em>"What's the premium on TSLA on Robinhood Chain?"</em>+or <em>"Show me coins that launched in the last hour."</em> The host picks the tool.</p>+<h2>Trading tools are opt-in, deliberately</h2>+<p><code>hood-mcp</code> ships a second binary, <code>hood-mcp-trading</code>, that is not started+here. It requires an explicit private key plus a spend cap, and every+state-changing tool is annotated <code>readOnlyHint: false</code> with a confirmation+gate. Read-only and spending capabilities never share a process, so pointing+an agent at the data server cannot move funds.</p><hr><p>Built by <a href="https://x.com/nichxbt">nirholas</a> · <a href="https://three.ws">three.ws</a></p></div></div>diff --git a/robinhood/robinhood-chain-examples/docs/index.html b/robinhood/robinhood-chain-examples/docs/index.htmlindex 7c06d1bab..f0d7bb8b6 100644--- a/robinhood/robinhood-chain-examples/docs/index.html+++ b/robinhood/robinhood-chain-examples/docs/index.html@@ -1,695 +1,151 @@<!doctype html><html lang="en">-<head>-<meta charset="utf-8" />-<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />-<title>robinhood-chain-examples, a darkroom contact sheet of runnable code</title>-<meta name="description" content="Fourteen runnable Robinhood Chain examples laid out as a photographic contact sheet. Hover a frame to develop it, the real code fades in like film in a tray, click to enlarge. From a raw viem read to a firehose decoder, a Telegram bot, and a paper-trading agent." />-<link rel="canonical" href="https://nirholas.github.io/robinhood-chain-examples/" />-<meta name="theme-color" content="#0a0a0b" />-<meta property="og:type" content="website" />-<meta property="og:title" content="robinhood-chain-examples, develop the frame to read the code" />-<meta property="og:description" content="A darkroom contact sheet of fourteen runnable Robinhood Chain examples. Hover to develop each frame; the real code appears like film in developer fluid. Click to enlarge." />-<meta property="og:url" content="https://nirholas.github.io/robinhood-chain-examples/" />-<meta name="twitter:card" content="summary_large_image" />-<meta name="twitter:title" content="robinhood-chain-examples, a darkroom contact sheet" />-<meta name="twitter:description" content="Fourteen runnable Robinhood Chain examples as a contact sheet. Hover to develop the frame, click to enlarge the real code." />-<meta name="twitter:creator" content="@nichxbt" />-<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' fill='%230a0a0b'/><rect x='6' y='9' width='20' height='14' fill='none' stroke='%23e6e4de' stroke-width='1.6'/><rect x='4' y='6' width='3' height='2.4' fill='%23e6e4de'/><rect x='11' y='6' width='3' height='2.4' fill='%23e6e4de'/><rect x='18' y='6' width='3' height='2.4' fill='%23e6e4de'/><rect x='25' y='6' width='3' height='2.4' fill='%23e6e4de'/><rect x='4' y='23.6' width='3' height='2.4' fill='%23e6e4de'/><rect x='11' y='23.6' width='3' height='2.4' fill='%23e6e4de'/><rect x='18' y='23.6' width='3' height='2.4' fill='%23e6e4de'/><rect x='25' y='23.6' width='3' height='2.4' fill='%23e6e4de'/></svg>" />-<script type="application/ld+json">-{"@context":"https://schema.org","@type":"SoftwareSourceCode","name":"robinhood-chain-examples","description":"Fourteen runnable example projects for Robinhood Chain (chain ID 4663), from a raw viem price read to a sequencer-firehose decoder, a Telegram bot, and a paper-trading agent, presented as a darkroom contact sheet.","codeRepository":"https://github.com/nirholas/robinhood-chain-examples","programmingLanguage":"JavaScript","runtimePlatform":"Node.js >= 20","author":{"@type":"Person","name":"nirholas","url":"https://x.com/nichxbt"},"license":"https://github.com/nirholas/robinhood-chain-examples/blob/main/LICENSE"}-</script>-<style>- :root{- --ink:#0a0a0b; --film:#17171a; --paper:#e6e4de; --graphite:#79776f; --dim:#4a4842;- --hair:rgba(230,228,222,.13); --hair2:rgba(230,228,222,.26);- --mono:ui-monospace,"SFMono-Regular","JetBrains Mono","Menlo","Consolas",monospace;- --grot:"Helvetica Neue","Inter","Arial",system-ui,sans-serif;- --ease:cubic-bezier(.16,1,.3,1);- }- *{margin:0;padding:0;box-sizing:border-box}- html{-webkit-text-size-adjust:100%}- body{background:var(--ink); color:var(--paper); font-family:var(--grot);- font-size:clamp(14px,1.1vw,17px); line-height:1.5; overflow-x:hidden; -webkit-font-smoothing:antialiased}- ::selection{background:var(--paper); color:var(--ink)}- a{color:inherit}- .mono{font-family:var(--mono)}- b{font-weight:700}-- /* darkroom grain, static, cheap */- body::before{content:""; position:fixed; inset:0; z-index:0; pointer-events:none; opacity:.5;- background:- radial-gradient(120% 90% at 50% -20%, rgba(230,228,222,.045), transparent 55%),- radial-gradient(140% 90% at 50% 120%, rgba(0,0,0,.55), transparent 55%);}- @media(prefers-reduced-motion:reduce){*{animation-duration:.001s!important; transition-duration:.001s!important}}-- main{position:relative; z-index:1; max-width:1280px; margin:0 auto; padding:0 clamp(16px,3.4vw,52px)}-- /* ---- film edge header ---- */- .edge{display:flex; align-items:center; gap:14px; padding:16px 0 10px;- font:600 10px/1 var(--mono); letter-spacing:.26em; text-transform:uppercase; color:var(--graphite)}- .edge .sprk{flex:1; height:12px; background:- repeating-linear-gradient(90deg, var(--hair2) 0 8px, transparent 8px 20px);- -webkit-mask:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);- mask:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent)}- .edge .brand{color:var(--paper)}-- header.hero{padding:clamp(30px,6vh,74px) 0 clamp(24px,4vh,44px); border-bottom:1px solid var(--hair)}- .eyebrow{font:600 11px/1 var(--mono); letter-spacing:.3em; text-transform:uppercase; color:var(--graphite);- display:flex; align-items:center; gap:12px; margin-bottom:24px}- .eyebrow::after{content:"";flex:1;height:1px;background:var(--hair)}- .eyebrow .n{color:var(--paper)}- h1{font-weight:700; letter-spacing:-.03em; line-height:.97; font-size:clamp(38px,7vw,98px)}- h1 .lo{color:var(--graphite)}- .lede{max-width:60ch; margin-top:24px; font-size:clamp(16px,1.55vw,21px); line-height:1.45; color:#c5c2bb}- .metarow{display:flex; flex-wrap:wrap; gap:10px 26px; margin-top:26px;- font:600 11px/1 var(--mono); letter-spacing:.14em; text-transform:uppercase; color:var(--graphite)}- .metarow b{color:var(--paper); font-weight:700}- .metarow .devcount b{transition:color .3s}-- .hint{margin-top:22px; font:500 12px/1 var(--mono); letter-spacing:.04em; color:var(--graphite);- display:inline-flex; align-items:center; gap:10px}- .hint svg{width:26px; height:26px}- @media(hover:none){.hint .desk{display:none}}- @media(hover:hover){.hint .touch{display:none}}-- /* ================= CONTACT SHEET ================= */- .sheet{display:grid; grid-template-columns:repeat(auto-fill, minmax(300px,1fr));- gap:clamp(20px,2.4vw,34px); padding:clamp(30px,5vh,58px) 0}- @media(max-width:640px){.sheet{grid-template-columns:1fr; gap:26px}}-- .frame{position:relative; cursor:pointer; -webkit-tap-highlight-color:transparent;- outline:none; background:transparent; border:0; text-align:left; font:inherit; color:inherit; padding:0}- .frame:focus-visible .cell{box-shadow:0 0 0 2px var(--paper)}-- /* sprocket rails top+bottom */- .cell{position:relative; background:var(--film); border:1px solid var(--hair2);- aspect-ratio:4/3; overflow:hidden; transition:border-color .3s, transform .4s var(--ease)}- .frame:hover .cell{border-color:var(--hair2); transform:translateY(-3px)}- .cell::before,.cell::after{content:""; position:absolute; left:0; right:0; height:11px; z-index:3;- background:repeating-linear-gradient(90deg, rgba(10,10,11,.9) 0 7px, transparent 7px 17px);- pointer-events:none}- .cell::before{top:0; border-bottom:1px solid var(--hair)}- .cell::after{bottom:0; border-top:1px solid var(--hair)}-- /* frame code + note, grease-pencil register marks */- .reg{position:absolute; z-index:4; font:600 10px/1 var(--mono); letter-spacing:.14em; color:var(--graphite); pointer-events:none}- .reg.tl{top:14px; left:12px; color:var(--paper)}- .reg.br{bottom:14px; right:12px}-- /* the latent negative → develops on hover */- .neg{position:absolute; inset:11px 0; z-index:1; padding:16px 16px 14px; overflow:hidden}- .code{font:500 11.5px/1.62 var(--mono); white-space:pre; color:var(--paper);- opacity:.05; transform:translateZ(0); transition:opacity .75s var(--ease); letter-spacing:0}- .code .cm{color:var(--graphite)}- .code .st{color:#b7b4ac}- @media(max-width:640px){.code{font-size:12px}}-- /* developer-fluid wash: a meniscus sweeps down once */- .fluid{position:absolute; inset:0; z-index:2; pointer-events:none; opacity:0;- background:linear-gradient(180deg, transparent 0%, rgba(230,228,222,.10) 46%, rgba(230,228,222,.16) 50%, transparent 62%);- transform:translateY(-100%);}- .frame.dev .code{opacity:1}- .frame.dev .fluid{animation:wash .85s var(--ease) forwards}- @keyframes wash{0%{opacity:.9; transform:translateY(-100%)}100%{opacity:0; transform:translateY(110%)}}-- /* grain that settles as it develops */- .grain{position:absolute; inset:11px 0; z-index:2; pointer-events:none; opacity:.5; mix-blend-mode:overlay;- background-image:repeating-linear-gradient(0deg, rgba(230,228,222,.05) 0 1px, transparent 1px 2px),- repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 1px, transparent 1px 2px);- transition:opacity .75s var(--ease)}- .frame.dev .grain{opacity:.14}-- /* undeveloped hint badge */- .latent{position:absolute; inset:0; z-index:2; display:flex; align-items:center; justify-content:center;- pointer-events:none; transition:opacity .5s var(--ease)}- .latent span{font:600 10px/1 var(--mono); letter-spacing:.24em; text-transform:uppercase; color:var(--dim);- border:1px solid var(--hair); padding:8px 12px}- .frame.dev .latent{opacity:0}-- /* grease-pencil ring on recommended frames */- .ring{position:absolute; z-index:5; inset:-6px; pointer-events:none; opacity:.7}- .ring path{fill:none; stroke:var(--paper); stroke-width:1.4; stroke-linecap:round; opacity:.55}-- /* caption strip below the cell */- .cap{display:flex; justify-content:space-between; align-items:baseline; gap:12px; padding:12px 2px 0}- .cap .nm{font-size:clamp(15px,1.5vw,18px); font-weight:600; letter-spacing:-.01em}- .cap .nm small{display:block; font:500 12.5px/1.4 var(--grot); color:#9a978f; margin-top:3px; letter-spacing:0}- .cap .df{font:600 9.5px/1.5 var(--mono); letter-spacing:.16em; text-transform:uppercase; color:var(--graphite);- white-space:nowrap; border:1px solid var(--hair2); padding:5px 8px}- .frame.unbuilt .cell{background:repeating-linear-gradient(135deg, var(--film) 0 9px, #131315 9px 18px)}- .frame.unbuilt .cap .df{color:var(--dim)}-- /* ================= LIGHTBOX ================= */- .lb{position:fixed; inset:0; z-index:80; display:none; background:rgba(6,6,7,.86);- -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); padding:clamp(14px,4vw,54px);- align-items:center; justify-content:center; opacity:0; transition:opacity .3s var(--ease)}- .lb.open{display:flex; opacity:1}- .lb-inner{position:relative; width:min(920px,100%); max-height:92vh; overflow:auto;- background:var(--film); border:1px solid var(--hair2);- transform:translateY(14px) scale(.985); transition:transform .4s var(--ease)}- .lb.open .lb-inner{transform:none}- .lb-inner::before,.lb-inner::after{content:""; position:sticky; left:0; right:0; height:13px; display:block; z-index:2;- background:repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 20px)}- .lb-inner::before{top:0; border-bottom:1px solid var(--hair)}- .lb-inner::after{bottom:0; border-top:1px solid var(--hair)}- .lb-head{display:flex; justify-content:space-between; align-items:flex-start; gap:18px; padding:22px clamp(20px,3vw,34px) 6px}- .lb-head .code-id{font:600 11px/1 var(--mono); letter-spacing:.2em; color:var(--graphite)}- .lb-head h3{font-size:clamp(22px,2.6vw,32px); font-weight:700; letter-spacing:-.02em; line-height:1.05; margin-top:8px}- .lb-head .sub{margin-top:10px; font-size:15px; color:#c5c2bb; max-width:56ch; line-height:1.45}- .lb-x{appearance:none; flex-shrink:0; background:transparent; border:1px solid var(--hair2); color:var(--paper);- font:600 11px/1 var(--mono); letter-spacing:.12em; padding:10px 13px; cursor:pointer; transition:background .2s}- .lb-x:hover{background:rgba(230,228,222,.1)}- .lb-body{padding:16px clamp(20px,3vw,34px) 8px}- .lb-code{border:1px solid var(--hair2); background:var(--ink); padding:20px 20px; overflow-x:auto;- font:500 13px/1.7 var(--mono); white-space:pre; color:var(--paper)}- .lb-code .cm{color:var(--graphite)} .lb-code .st{color:#b7b4ac}- .lb-meta{display:grid; grid-template-columns:120px 1fr; gap:0; margin:20px 0 6px; border-top:1px solid var(--hair)}- .lb-meta .k{font:600 10px/1 var(--mono); letter-spacing:.16em; text-transform:uppercase; color:var(--graphite);- padding:14px 0; border-bottom:1px solid var(--hair)}- .lb-meta .v{padding:14px 0; border-bottom:1px solid var(--hair); font-size:14.5px; color:#d6d3cc; word-break:break-word}- .lb-meta .v.mono{font-family:var(--mono); font-size:13px}- .lb-foot{display:flex; flex-wrap:wrap; gap:12px; padding:8px clamp(20px,3vw,34px) 26px}- .lb-run{display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:6px 0 2px}- .a{appearance:none; text-decoration:none; border:1px solid var(--paper); color:var(--paper); background:transparent;- font:600 11px/1 var(--mono); letter-spacing:.12em; text-transform:uppercase; padding:12px 18px; cursor:pointer;- transition:background .2s,color .2s,transform .25s var(--ease)}- .a:hover{background:var(--paper); color:var(--ink); transform:translateY(-2px)}- .a.solid{background:var(--paper); color:var(--ink)}- .a.solid:hover{background:transparent; color:var(--paper)}-- /* ================= FOOTER SECTIONS ================= */- section{padding:clamp(44px,7vh,88px) 0; border-top:1px solid var(--hair)}- h2{font-weight:700; letter-spacing:-.03em; line-height:1; font-size:clamp(26px,4.4vw,52px)}- .cols{display:grid; grid-template-columns:1fr 1fr; gap:clamp(28px,5vw,72px); align-items:start; margin-top:6px}- @media(max-width:840px){.cols{grid-template-columns:1fr; gap:30px}}- .install{border:1px solid var(--hair2); background:rgba(230,228,222,.03); padding:20px 22px;- font:500 13.5px/1.9 var(--mono); position:relative; overflow-x:auto}- .install .c{color:var(--graphite)} .install .p::before{content:"$ "; color:var(--graphite)}- .copy{position:absolute; top:12px; right:12px; appearance:none; border:1px solid var(--hair2); background:transparent;- color:var(--paper); font:600 10px/1 var(--mono); letter-spacing:.14em; padding:7px 11px; cursor:pointer; transition:background .2s}- .copy:hover{background:rgba(230,228,222,.1)}- .lede2{max-width:58ch; font-size:clamp(16px,1.55vw,20px); color:#c5c2bb; line-height:1.5}- .notelist{list-style:none; margin-top:20px; border-top:1px solid var(--hair)}- .notelist li{position:relative; padding:13px 0 13px 26px; border-bottom:1px solid var(--hair); font-size:15px; color:#c5c2bb; line-height:1.5}- .noteList li:last-child, .notelist li:last-child{border-bottom:0}- .notelist li::before{content:"\2192"; position:absolute; left:0; top:13px; color:var(--graphite); font-family:var(--mono)}- .notelist li b{color:var(--paper)}- .btns{display:flex; flex-wrap:wrap; gap:12px; margin-top:24px}-- footer{padding:clamp(38px,6vh,64px) 0; display:flex; flex-wrap:wrap; justify-content:space-between; gap:22px; align-items:flex-end; border-top:1px solid var(--hair)}- footer .big{font:700 clamp(28px,5.6vw,60px)/.92 var(--grot); letter-spacing:-.03em}- footer .meta{font:500 12px/1.7 var(--mono); color:var(--graphite); text-align:right}- footer a{text-decoration:none; border-bottom:1px solid var(--hair2); transition:border-color .2s}- footer a:hover{border-color:var(--paper)}-</style>-</head>-<body>-<main>- <div class="edge" aria-hidden="true">- <span class="brand">ROBINHOOD-CHAIN</span><span class="sprk"></span><span>EXAMPLES · 4663 · ISO monochrome</span>- </div>-- <header class="hero">- <div class="eyebrow"><span class="n">00</span> / CONTACT SHEET · develop to read</div>- <h1>Fourteen frames.<br><span class="lo">Develop the code.</span></h1>- <p class="lede">A contact sheet of runnable Robinhood Chain examples. Each frame is a latent negative until you touch it: hover and the real source develops in like film in a tray. Click any frame to enlarge it, read the whole thing, and copy the command that runs it.</p>- <div class="metarow">- <span>chain <b>4663</b></span>- <span><b>14</b> frames</span>- <span><b>10</b> runnable · <b>4</b> awaiting deps</span>- <span class="devcount">developed <b id="devnum">0</b> / 14</span>- </div>- <div class="hint">- <svg viewBox="0 0 40 40" fill="none" aria-hidden="true"><circle cx="16" cy="16" r="9" stroke="#79776f" stroke-width="1.5"/><path d="M23 23 L32 32" stroke="#79776f" stroke-width="1.5" stroke-linecap="round"/></svg>- <span class="desk">hover to develop · click to enlarge · 1-9 jumps a frame</span>- <span class="touch">tap a frame to develop · tap again to enlarge</span>- </div>- </header>-- <div class="sheet" id="sheet" aria-label="Example contact sheet"></div>-- <!-- ============ INSTALL ============ -->- <section id="run">- <div class="eyebrow"><span class="n">01</span> / RUN ANY FRAME</div>- <div class="cols">- <div>- <h2>Every frame runs<br>in under a minute.</h2>- <p class="lede2" style="margin-top:22px">Each example is a small, self-contained project. Ten of the fourteen are read-only against the public Robinhood Chain RPC (no wallet, no key, no funds). Enlarge a frame for its exact run command; the pattern is always the same.</p>- <div class="btns">- <a class="a solid" href="https://github.com/nirholas/robinhood-chain-examples">browse the source</a>- <a class="a" href="https://github.com/nirholas/robinhood-chain-sdk">the hoodchain SDK</a>- </div>- </div>- <div>- <div class="install">- <button class="copy" data-copy="cd examples/01-read-stock-price && npm install && npm start">COPY</button>-<span class="c"># clone, pick a frame, run it</span>-<span class="p">git clone https://github.com/nirholas/robinhood-chain-examples</span>-<span class="p">cd examples/01-read-stock-price</span>-<span class="p">npm install</span>-<span class="p">npm start</span>-<span class="c"># reads AAPL's Chainlink feed on chain 4663, no key</span>- </div>- <p class="lede2" style="margin-top:16px; font-size:14.5px; color:#9a978f">Node ≥ 20. Only two examples take a secret: a funded testnet key to <em>execute</em> a swap (04), and a Telegram bot token (12). Everything else reads straight from the public RPC.</p>- </div>- </div>- </section>-- <!-- ============ THE FOUR BLANKS ============ -->- <section id="gaps">- <div class="eyebrow"><span class="n">02</span> / THE FOUR BLANK FRAMES</div>- <div class="cols">- <div>- <h2>Four frames are<br>unexposed on purpose.</h2>- <p class="lede2" style="margin-top:22px">Examples 09, 10, 11 and 13 depend on sibling packages that haven't shipped yet. Rather than fake them, they ship as blank frames with a note explaining exactly what's missing, so the contact sheet stays honest about the state of the roll.</p>- </div>- <div>- <ul class="notelist">- <li><b>09 · 10</b> pay for and sell an API over x402, blocked on <span class="mono">hood-api</span> and <span class="mono">hood402</span>. USDG has no EIP-2612 permit, so the approve step ships from day one.</li>- <li><b>11</b> a scripted MCP client driving chain tools, blocked on <span class="mono">hood-mcp</span>.</li>- <li><b>13</b> launching a token on testnet, blocked on <span class="mono">hood-launcher</span>. The launchpad factory addresses already live in the SDK.</li>- <li>Every published frame (01-08, 12, 14) worked first try against the real registry, feeds, and testnet pools, no workarounds needed.</li>- </ul>- </div>- </div>- </section>-- <footer>- <div class="big">develop<br>the roll.</div>- <div class="meta">- Robinhood Chain · ID 4663 · testnet 46630<br>- <a href="https://github.com/nirholas/robinhood-chain-examples">github.com/nirholas/robinhood-chain-examples</a><br>- <a href="https://github.com/nirholas/robinhood-chain-sdk">the hoodchain SDK</a><br>- built by <a href="https://x.com/nichxbt">@nichxbt</a> · <a href="https://three.ws">three.ws</a> · not affiliated with Robinhood Markets+ <head>+ <meta charset="utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1" />+ <title>Gallery · Robinhood Chain Examples</title>+ <meta name="description" content="Runnable Robinhood Chain examples, from a raw viem read to a live dashboard." />+ <link rel="stylesheet" href="style.css" />+ <link rel="stylesheet" href="hljs-theme.css" />+ </head>+ <body>+ <div class="topbar">+ <a class="brand" href="./index.html">Robinhood Chain Examples</a>+ <a class="ghlink" href="https://github.com/nirholas/robinhood-chain-examples">GitHub ↗</a></div>- </footer>-</main>--<!-- lightbox -->-<div class="lb" id="lb" role="dialog" aria-modal="true" aria-labelledby="lb-title">- <div class="lb-inner">- <div class="lb-head">- <div>- <div class="code-id" id="lb-id"></div>- <h3 id="lb-title"></h3>- <div class="sub" id="lb-sub"></div>- </div>- <button class="lb-x" id="lb-x" aria-label="Close">CLOSE ×</button>- </div>- <div class="lb-body">- <div class="lb-code" id="lb-code"></div>- <div class="lb-meta" id="lb-meta"></div>- <div class="lb-run" id="lb-run"></div>- </div>- <div class="lb-foot" id="lb-foot"></div>+ <div class="wrap">+<h1>Robinhood Chain Examples</h1>+<p class="hero-sub">14 small, runnable projects for Robinhood Chain (mainnet 4663 / testnet 46630) —+from a raw viem read to a live dashboard, a Telegram bot, and a paper trader. Every read below is real.</p>++<div class="embed-frame">+ <iframe src="embed/07-live-price-webpage.html" title="Live Robinhood Chain Stock Token prices" loading="lazy"></iframe>+ <div class="embed-label">+ <span>Example 07, running live — client-side JSON-RPC, no backend.</span>+ <a href="examples/07-live-price-webpage/index.html">How it works →</a></div></div>-<script>-"use strict";-/* =====================================================================- Every code excerpt below is a trimmed, real capture from the actual- example's source in this repo, nothing invented. Fields (demonstrates,- difficulty, run) mirror the repo README's example table exactly.- ===================================================================== */-const FRAMES = [- { id:'01', reg:'01A', dir:'01-read-stock-price', star:true, built:true,- name:'read-stock-price', diff:'Beginner',- sub:"Read one Stock Token's Chainlink price feed with viem only, no SDK, every address and ABI spelled out by hand.",- run:'cd examples/01-read-stock-price && npm install && npm start',- needs:'none, read-only, public RPC',- code:-`import { createPublicClient, http, formatUnits } from 'viem'-import { robinhood } from 'viem/chains'--// Stock Token -> its Chainlink feed (8-decimal answers)-const FEEDS = { AAPL: { feed: '0x6B22…2cD0' } }--const client = createPublicClient({ chain: robinhood, transport: http() })-const [, answer] = await client.readContract({- address: FEEDS.AAPL.feed, abi: aggregatorV3Abi,- functionName: 'latestRoundData',-})-console.log('AAPL', formatUnits(answer, 8))` },-- { id:'02', reg:'02A', dir:'02-stock-price-sdk', star:true, built:true,- name:'stock-price-sdk', diff:'Beginner',- sub:"The same read in three lines using hoodchain's bundled 95-token registry and typed errors.",- run:'cd examples/02-stock-price-sdk && npm install && npm start',- needs:'none, read-only, public RPC',- code:-`import { createHoodClient, getQuote } from 'hoodchain'--const hood = createHoodClient() // mainnet 4663, public RPC-const q = await getQuote(hood, 'AAPL')--console.log(\`AAPL $\${q.priceUsd.toFixed(2)} feed \${q.feed}\`)-// typed errors: UnknownSymbolError, FeedNotFoundError,-// StaleFeedError, never a silent NaN` },-- { id:'03', reg:'03B', dir:'03-portfolio-valuation', built:true,- name:'portfolio-valuation', diff:'Intermediate',- sub:'Multiplier-correct valuation, the ERC-8056 uiMultiplier math generic trackers get wrong, swept across all 95 tokens in one multicall.',- run:'cd examples/03-portfolio-valuation && npm install && npm start',- needs:'none, read-only, public RPC',- code:-`import { createHoodClient, getPortfolio } from 'hoodchain'--const hood = createHoodClient()-// one multicall sweeps all 95 tokens-const p = await getPortfolio(hood, owner,- { maxAgeSeconds: 7 * 24 * 3600 })--// value = balance × feedPrice (feed is ALREADY adjusted)-// shares = balance × uiMultiplier ÷ 1e18-// applying the multiplier twice is the classic bug` },-- { id:'04', reg:'04A', dir:'04-swap-memecoin', built:true,- name:'swap-memecoin', diff:'Intermediate',- sub:'Quote (and, with a funded key, execute) a Uniswap v3 swap on testnet, the same code path swaps mainnet memecoins.',- run:'ROBINHOOD_CHAIN_PRIVATE_KEY=0x… node index.js --execute',- needs:'quote: none · execute: a funded testnet key',- code:-`import { createHoodClient, quoteSwap, executeSwap } from 'hoodchain'--const reader = createHoodClient({ chain: 'testnet' })-const quote = await quoteSwap(reader,- { tokenIn, tokenOut, amountIn })--console.log('out', formatUnits(quote.amountOut, 18), 'NFLX')--// no key -> print the quote and stop.-// it never fabricates a transaction.-if (!execute) process.exit(0)` },-- { id:'05', reg:'05B', dir:'05-watch-launches', built:true,- name:'watch-launches', diff:'Intermediate',- sub:'Stream NOXA and The Odyssey launchpad activity into one Launch shape.',- run:'cd examples/05-watch-launches && npm install && npm start',- needs:'none, read-only, public RPC',- code:-`import { createHoodClient, getRecentLaunches,- watchLaunches } from 'hoodchain'--const hood = createHoodClient()-const recent = await getRecentLaunches(hood,- { lookbackBlocks: 1_000_000n })--// NOXA (instant Uniswap) + The Odyssey (bonding curve)-// collapse into ONE Launch shape-const stop = watchLaunches(hood, (l) =>- console.log(l.launchpad, l.token, l.pool ?? '(on curve)'))` },-- { id:'06', reg:'06A', dir:'06-firehose', built:true,- name:'firehose', diff:'Advanced',- sub:'Decode the raw Arbitrum Nitro sequencer feed into typed transactions ~100-300ms before RPC sees them.',- run:'cd examples/06-firehose && npm install && npm start',- needs:'none, read-only, sequencer feed',- code:-`import { subscribeFeed } from 'hoodchain'--// wss://feed.mainnet.chain.robinhood.com-// decode each frame ~100-300ms BEFORE RPC can answer-const stop = subscribeFeed((tx) => {- if (matches(tx))- console.log(tx.transaction.hash, tx.transaction.to)-})--// front-of-block awareness, no node to run` },-- { id:'07', reg:'07A', dir:'07-live-price-webpage', star:true, built:true,- name:'live-price-webpage', diff:'Beginner',- sub:'A dependency-free index.html showing live prices for 11 Stock Tokens via client-side JSON-RPC.',- run:'cd examples/07-live-price-webpage && npm install && npm start',- needs:'none, zero dependencies, no build step',- code:-`<!-- zero dependencies, no build step -->-<script>-const RPC = 'https://rpc.mainnet.chain.robinhood.com'-async function price(feed) {- const r = await fetch(RPC, { method: 'POST',- body: JSON.stringify({ jsonrpc:'2.0', id:1,- method:'eth_call',- params:[{ to: feed, data:'0xfeaf968c' }, 'latest'] })})- // decode latestRoundData by hand -> paint it-}-<\/script>` },-- { id:'08', reg:'08B', dir:'08-portfolio-dashboard', built:true,- name:'portfolio-dashboard', diff:'Intermediate',- sub:'A Vite + React dashboard wrapping example 03 in a polling hook with designed loading, empty and error states.',- run:'cd examples/08-portfolio-dashboard && npm install && npm run dev',- needs:'none, read-only, public RPC',- code:-`import { createHoodClient, getPortfolio } from 'hoodchain'--// local stand-in for hoodkit's useHoodPortfolio (Wave 2)-export function useHoodPortfolio(owner, { pollMs = 20000 } = {}) {- const [state, setState] =- useState({ status: 'idle', portfolio: null })- // polls getPortfolio; loading / empty / error all designed- // upgrading later is a one-line import swap to hoodkit-}` },-- { id:'09', reg:'09·', dir:'09-x402-paid-api-call', built:false,- name:'x402-paid-api-call', diff:'Not built',- sub:'A client paying a hood-api endpoint via hood402. Blocked until those packages ship.',- run:'blocked on hood-api, hood402',- needs:'hood-api + hood402 (not shipped)',- note:'UNEXPOSED',- code:-`// blocked on hood-api + hood402-//-// A client pays a metered endpoint in USDG over x402,-// then reads the response.-//-// USDG has NO EIP-2612 permit, so the flow needs an-// explicit on-chain approve() baked in from day one.` },-- { id:'10', reg:'10·', dir:'10-x402-sell-your-api', built:false,- name:'x402-sell-your-api', diff:'Not built',- sub:'A paid endpoint using hood402 middleware. Blocked until hood402 ships.',- run:'blocked on hood402',- needs:'hood402 (not shipped)',- note:'UNEXPOSED',- code:-`// blocked on hood402-//-// A server wraps a route in hood402 middleware:-// 402 Payment Required -> verify USDG payment -> serve.-//-// The natural next build on top of hoodchain, the-// launchpad + registry plumbing already exists.` },-- { id:'11', reg:'11·', dir:'11-mcp-agent-session', built:false,- name:'mcp-agent-session', diff:'Not built',- sub:'A scripted MCP client driving hood-mcp tools. Blocked until hood-mcp ships.',- run:'blocked on hood-mcp',- needs:'hood-mcp (not shipped)',- note:'UNEXPOSED',- code:-`// blocked on hood-mcp-//-// A scripted MCP client calls typed chain tools ·-// getQuote, getPortfolio, getRecentLaunches, so an-// LLM agent can read chain 4663 without touching RPC.-//-// A thin wrap of the SDK once hood-mcp lands.` },-- { id:'12', reg:'12A', dir:'12-telegram-price-bot', built:true,- name:'telegram-price-bot', diff:'Intermediate',- sub:'A grammY Telegram bot: /price AAPL, /trending, deployable on any free tier.',- run:'TELEGRAM_BOT_TOKEN=… node index.js',- needs:'a free Telegram bot token from @BotFather',- code:-`import { Bot } from 'grammy'-import { createHoodClient, getQuote,- getRecentLaunches } from 'hoodchain'--const bot = new Bot(process.env.TELEGRAM_BOT_TOKEN)-bot.command('price', async (ctx) => {- const q = await getQuote(hood, symbol)- ctx.reply(\`\${symbol} $\${q.priceUsd.toFixed(2)}\`)-})-bot.start() // long-polling, no webhook, free-tier ready` },-- { id:'13', reg:'13·', dir:'13-launch-a-coin-testnet', built:false,- name:'launch-a-coin-testnet', diff:'Not built',- sub:"Launching a token via hood-launcher's direct rail. Blocked until hood-launcher ships.",- run:'blocked on hood-launcher',- needs:'hood-launcher (not shipped)',- note:'UNEXPOSED',- code:-`// blocked on hood-launcher-//-// Launch a token on the NOXA / Odyssey factory from a-// script, on testnet 46630 first.-//-// Factory addresses already live in the SDK's-// launchpads.ts, the wrap is thin.` },-- { id:'14', reg:'14B', dir:'14-agent-paper-trader', built:true,- name:'agent-paper-trader', diff:'Intermediate',- sub:'A minimal momentum strategy loop polling real prices, simulating fills against a virtual USDG balance, no real funds.',- run:'cd examples/14-agent-paper-trader && npm install && npm start',- needs:'none, read-only, paper fills in memory',- code:-`import { createHoodClient, getQuote } from 'hoodchain'--// virtual USDG balance, no wallet, no real funds-const book = new Map(SYMBOLS.map((s) =>- [s, { high: null, position: null }]))--// BUY when price is >= DIP_PCT below the session high-// SELL when price is >= TAKE_PROFIT_PCT above entry-// every fill logged in memory only, paper mode` },-];--const REPO = 'https://github.com/nirholas/robinhood-chain-examples/tree/main/examples/';--/* one-line captions for the contact strip */-const TAGS = {- '01':'Raw viem, no SDK', '02':'Three lines with hoodchain',- '03':'Multiplier-correct across 95 tokens', '04':'Uniswap v3 quote + guarded execute',- '05':'NOXA + Odyssey into one stream', '06':'Sequencer feed, decoded early',- '07':'Zero-dependency price page', '08':'Vite + React dashboard',- '09':'Pay an API over x402', '10':'Sell an API over x402',- '11':'MCP tools for an agent', '12':'grammY Telegram price bot',- '13':'Launch a token from a script', '14':'Paper-trading strategy loop',-};--/* ---- monochrome pseudo-highlight: comments + strings only ---- */-function hi(src){- const esc = s => s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');- const lines = src.split('\n').map(line=>{- const ci = line.indexOf('//');- // avoid matching // inside a string/url roughly: only treat as comment if not preceded by ':' url pattern is rare here- if(ci>=0 && !/https?:$/.test(line.slice(0,ci))){- const before = esc(line.slice(0,ci));- const comment = esc(line.slice(ci));- return hiStrings(before) + '<span class="cm">'+comment+'</span>';- }- return hiStrings(esc(line));- });- return lines.join('\n');-}-function hiStrings(escaped){- return escaped.replace(/('|"|')([^'"&]*?)('|"|')/g, m=>'<span class="st">'+m+'</span>')- .replace(/(`[^`]*`)/g, m=>'<span class="st">'+m+'</span>');-}--/* ---- build the sheet ---- */-const sheet = document.getElementById('sheet');-const developed = new Set();-const devnum = document.getElementById('devnum');--const ringPaths = [- 'M30 8 C 8 6, 4 40, 30 46 C 62 52, 66 4, 34 6',- 'M28 6 C 4 12, 8 44, 34 46 C 64 48, 62 2, 30 8',-];--FRAMES.forEach((f, idx)=>{- const btn = document.createElement('button');- btn.className = 'frame' + (f.built?'':' unbuilt');- btn.type = 'button';- btn.setAttribute('aria-label', `Frame ${f.id}: ${f.name}, ${f.built?'develop and enlarge':'unexposed frame'}`);- btn.dataset.idx = idx;- btn.innerHTML =- `<div class="cell">- ${f.star?`<svg class="ring" viewBox="0 0 72 54" preserveAspectRatio="none" aria-hidden="true"><path d="${ringPaths[idx%ringPaths.length].replace(/(\d+)/g,(n)=>Math.round(n*0.98))}"/></svg>`:''}- <span class="reg tl">${f.reg}</span>- <span class="reg br">${f.built?'● exp':'✕ blank'}</span>- <div class="neg"><pre class="code">${hi(f.code)}</pre></div>- <div class="grain"></div>- <div class="fluid"></div>- <div class="latent"><span>${f.note||'latent · develop'}</span></div>- </div>- <div class="cap">- <span class="nm">${f.name}<small>${TAGS[f.id]||''}.</small></span>- <span class="df">${f.diff}</span>- </div>`;- sheet.appendChild(btn);-- let devd = false, swallow = false;- function develop(){- if(devd) return; devd = true;- btn.classList.add('dev');- if(!developed.has(f.id)){ developed.add(f.id); devnum.textContent = developed.size; }- }- btn.addEventListener('pointerenter', e=>{ if(e.pointerType!=='touch') develop(); });- btn.addEventListener('focus', develop);- btn.addEventListener('pointerdown', e=>{- if(e.pointerType==='touch' && !devd){ develop(); swallow = true; }- });- btn.addEventListener('click', ()=>{- if(swallow){ swallow = false; return; } // first touch only developed the frame- develop(); openLB(idx);- });-});--/* ---- keyboard: 1-9 develop+enlarge that frame ---- */-addEventListener('keydown', e=>{- if(lb.classList.contains('open')){- if(e.key==='Escape') closeLB();- return;- }- const n = parseInt(e.key,10);- if(n>=1 && n<=9){ openLB(n-1); }-});--/* ---- lightbox ---- */-const lb = document.getElementById('lb');-const lbId = document.getElementById('lb-id');-const lbTitle = document.getElementById('lb-title');-const lbSub = document.getElementById('lb-sub');-const lbCode = document.getElementById('lb-code');-const lbMeta = document.getElementById('lb-meta');-const lbRun = document.getElementById('lb-run');-const lbFoot = document.getElementById('lb-foot');-let lastFocus = null;--function openLB(idx){- const f = FRAMES[idx]; if(!f) return;- lastFocus = document.activeElement;- lbId.textContent = `FRAME ${f.reg} · chain 4663`;- lbTitle.textContent = f.name;- lbSub.textContent = f.sub;- lbCode.innerHTML = hi(f.code);- lbMeta.innerHTML =- `<div class="k">status</div><div class="v">${f.built?'runnable, verified on-chain':'unexposed, awaiting a sibling package'}</div>- <div class="k">difficulty</div><div class="v">${f.diff}</div>- <div class="k">needs</div><div class="v">${f.needs}</div>`;- lbRun.innerHTML = `<div class="install" style="width:100%"><button class="copy" data-copy="${f.run.replace(/"/g,'"')}">COPY</button><span class="${f.built?'p':'c'}">${f.built?f.run:('# '+f.run)}</span></div>`;- lbFoot.innerHTML =- `<a class="a solid" href="${REPO}${f.dir}">open the folder</a>- <a class="a" href="${REPO}${f.dir}#readme">read its walkthrough</a>`;- bindCopies(lbRun);- lb.classList.add('open');- document.body.style.overflow='hidden';- document.getElementById('lb-x').focus();-}-function closeLB(){- lb.classList.remove('open');- document.body.style.overflow='';- if(lastFocus) lastFocus.focus();-}-document.getElementById('lb-x').addEventListener('click', closeLB);-lb.addEventListener('click', e=>{ if(e.target===lb) closeLB(); });--/* ---- copy buttons ---- */-function bindCopies(root){- root.querySelectorAll('.copy').forEach(btn=>{- if(btn.dataset.bound) return; btn.dataset.bound='1';- btn.addEventListener('click', e=>{- e.stopPropagation();- navigator.clipboard.writeText(btn.dataset.copy||'').then(()=>{- const t=btn.textContent; btn.textContent='COPIED'; setTimeout(()=>btn.textContent=t,1200);- }).catch(()=>{});- });- });-}-bindCopies(document);-</script>-</body>+<div class="section-title">Which package do I need?</div>+<table>+ <thead><tr><th>You want to…</th><th>Use</th><th>Try</th></tr></thead>+ <tbody>+ <tr><td>Read one price, no dependency</td><td><code>viem</code> only</td><td>Example 01</td></tr>+ <tr><td>Read prices / portfolios in a Node script</td><td><code>hoodchain</code></td><td>Examples 02, 03</td></tr>+ <tr><td>Ship a static page with live prices</td><td><code>hoodchain</code>-derived raw RPC (no build step)</td><td>Example 07</td></tr>+ <tr><td>Build a React app</td><td><code>hoodchain</code> + a local hook (hoodkit not shipped yet)</td><td>Example 08</td></tr>+ <tr><td>Trade or launch on-chain</td><td><code>hoodchain</code>'s <code>swap</code> / <code>launchpads</code> modules</td><td>Examples 04, 05, 14</td></tr>+ <tr><td>Charge or pay for an API call</td><td><code>hood402</code> (not shipped yet)</td><td>Examples 09, 10</td></tr>+ <tr><td>Give an LLM agent chain tools</td><td><code>hood-mcp</code> (not shipped yet)</td><td>Example 11</td></tr>+ </tbody>+</table>++<div class="section-title">All examples</div>+<div class="grid">+<a class="card" href="examples/01-read-stock-price/index.html">+ <div class="num">01</div>+ <div class="title">Read a stock price</div>+ <div class="concept">viem only, no SDK</div>+ <div class="proves">Robinhood Chain is a normal EVM L2 — viem ships its chain def, Chainlink feeds are a plain readContract.</div>+ <span class="badge Beginner">Beginner</span>+ </a>+<a class="card" href="examples/02-stock-price-sdk/index.html">+ <div class="num">02</div>+ <div class="title">Stock price with the SDK</div>+ <div class="concept">hoodchain basics</div>+ <div class="proves">hoodchain collapses example 01 to 3 lines and covers all 95 registry tokens.</div>+ <span class="badge Beginner">Beginner</span>+ </a>+<a class="card" href="examples/03-portfolio-valuation/index.html">+ <div class="num">03</div>+ <div class="title">Portfolio valuation</div>+ <div class="concept">ERC-8056 multiplier math</div>+ <div class="proves">The correct way to value Stock Token holdings without double-counting corporate actions.</div>+ <span class="badge Intermediate">Intermediate</span>+ </a>+<a class="card" href="examples/04-swap-memecoin/index.html">+ <div class="num">04</div>+ <div class="title">Swap a token</div>+ <div class="concept">Uniswap v3 quote + execute</div>+ <div class="proves">One code path quotes and (with a funded key) executes swaps on testnet and mainnet alike.</div>+ <span class="badge Intermediate">Intermediate</span>+ </a>+<a class="card" href="examples/05-watch-launches/index.html">+ <div class="num">05</div>+ <div class="title">Watch launches</div>+ <div class="concept">NOXA + Odyssey event streams</div>+ <div class="proves">Two different launchpad contract shapes decode into one Launch type.</div>+ <span class="badge Intermediate">Intermediate</span>+ </a>+<a class="card" href="examples/06-firehose/index.html">+ <div class="num">06</div>+ <div class="title">Sequencer firehose</div>+ <div class="concept">Raw Nitro feed decoding</div>+ <div class="proves">Transactions are visible ~100–300ms before they hit RPC, straight off the public feed socket.</div>+ <span class="badge Advanced">Advanced</span>+ </a>+<a class="card" href="examples/07-live-price-webpage/index.html">+ <div class="num">07</div>+ <div class="title">Live price webpage</div>+ <div class="concept">Client-side JSON-RPC</div>+ <div class="proves">Read-only chain calls work from a static page — no backend, no build step, live on this gallery below.</div>+ <span class="badge Beginner">Beginner</span>+ </a>+<a class="card" href="examples/08-portfolio-dashboard/index.html">+ <div class="num">08</div>+ <div class="title">Portfolio dashboard</div>+ <div class="concept">React + polling hook</div>+ <div class="proves">A production-shaped dashboard (loading/empty/error states) is a thin wrapper over example 03.</div>+ <span class="badge Intermediate">Intermediate</span>+ </a>+<a class="card" href="examples/09-x402-paid-api-call/index.html">+ <div class="num">09</div>+ <div class="title">Pay for an API call</div>+ <div class="concept">x402 client</div>+ <div class="proves">USDG has no EIP-2612 permit, so the gasless rail is EIP-3009 transferWithAuthorization: the payer signs, the server broadcasts.</div>+ <span class="badge Advanced">Advanced</span>+ </a>+<a class="card" href="examples/10-x402-sell-your-api/index.html">+ <div class="num">10</div>+ <div class="title">Sell your API</div>+ <div class="concept">x402 server middleware</div>+ <div class="proves">Monetizing an endpoint is middleware, not architecture: one paywall() call, and a free route sits beside the paid one.</div>+ <span class="badge Advanced">Advanced</span>+ </a>+<a class="card" href="examples/11-mcp-agent-session/index.html">+ <div class="num">11</div>+ <div class="title">MCP agent session</div>+ <div class="concept">Model Context Protocol</div>+ <div class="proves">The SDK, an MCP server, and an agent host are three layers over one chain, and read-only tools never share a process with spending ones.</div>+ <span class="badge Advanced">Advanced</span>+ </a>+<a class="card" href="examples/12-telegram-price-bot/index.html">+ <div class="num">12</div>+ <div class="title">Telegram price bot</div>+ <div class="concept">grammY + hoodchain</div>+ <div class="proves">A full user-facing bot is ~70 lines once the SDK does the chain work.</div>+ <span class="badge Intermediate">Intermediate</span>+ </a>+<a class="card" href="examples/13-launch-a-coin-testnet/index.html">+ <div class="num">13</div>+ <div class="title">Launch a coin (testnet)</div>+ <div class="concept">Launchpad direct rail</div>+ <div class="proves">A launch is a pipeline, not a transaction: screening, ticker uniqueness, artwork, caps and a live preflight all clear before any ETH moves.</div>+ <span class="badge Advanced">Advanced</span>+ </a>+<a class="card" href="examples/14-agent-paper-trader/index.html">+ <div class="num">14</div>+ <div class="title">Agent paper trader</div>+ <div class="concept">Strategy loop, simulated</div>+ <div class="proves">A strategy loop is just getQuote on a timer — real execution slots in later without a rewrite.</div>+ <span class="badge Intermediate">Intermediate</span>+ </a>+</div>+</div>+ <footer>+ Built by <a href="https://x.com/nichxbt">nirholas</a> ·+ <a href="https://three.ws">three.ws</a> ·+ powered by <a href="https://github.com/nirholas/robinhood-chain-sdk">hoodchain</a>+ </footer>+ </body></html>diff --git a/robinhood/robinhood-chain-examples/package-lock.json b/robinhood/robinhood-chain-examples/package-lock.jsonindex 552197c4b..8a3fe4f32 100644--- a/robinhood/robinhood-chain-examples/package-lock.json+++ b/robinhood/robinhood-chain-examples/package-lock.json@@ -7,7 +7,7 @@"": {"name": "robinhood-chain-examples","version": "0.1.0",- "license": "Apache-2.0",+ "license": "UNLICENSED","devDependencies": {"highlight.js": "^11.11.1","marked": "^18.0.6",diff --git a/scripts/.aa/probe2.mjs b/scripts/.aa/probe2.mjsnew file mode 100644index 000000000..d2e7a5ab5--- /dev/null+++ b/scripts/.aa/probe2.mjs@@ -0,0 +1,16 @@+import { chromium } from 'playwright';+const b = await chromium.launch();+const p = await b.newPage({ viewport: { width: 900, height: 800 } });+const errs = [];+p.on('pageerror', (e) => errs.push('pageerror: ' + e.message));+await p.goto('http://localhost:3007/asl-alphabet', { waitUntil: 'networkidle' });+await p.waitForTimeout(4000);+const el = await p.$('.aa-stage-wrap');+await p.click('.aa-key[data-char="W"]');+for (const t of [400, 900, 1600]) {+ await p.waitForTimeout(t === 400 ? 400 : 500);+ await el.screenshot({ path: `/tmp/claude-1000/-workspaces-three-ws/ac683624-d99b-4e76-bfbe-4e0283327d2c/scratchpad/click-${t}.png` });+}+console.log('status:', await p.textContent('#aa-status'));+console.log('errors:', errs);+await b.close();diff --git a/scripts/mirror-examples-index.mjs b/scripts/mirror-examples-index.mjsindex 60b364897..1dd4d7701 100644--- a/scripts/mirror-examples-index.mjs+++ b/scripts/mirror-examples-index.mjs@@ -49,9 +49,13 @@ if (missingFields.length) {process.exit(1);}+// The banner goes last so it wins: data/examples.json carries its own+// $comment naming the generator, and a reader who opens the served copy needs+// to be told to edit neither this file nor that one by hand.const payload = {- $comment: 'GENERATED by scripts/mirror-examples-index.mjs from data/examples.json. Do not edit.',...index,+ $comment:+ 'GENERATED by scripts/mirror-examples-index.mjs from data/examples.json. Do not edit; run `npm run build:examples`.',};const serialized = `${JSON.stringify(payload, null, '\t')}\n`;const previous = existsSync(target) ? readFileSync(target, 'utf8') : '';diff --git a/tests/examples-page.test.js b/tests/examples-page.test.jsindex 2f57194be..c6f715fb1 100644--- a/tests/examples-page.test.js+++ b/tests/examples-page.test.js@@ -81,9 +81,16 @@ describe('examples index: generated, mirrored, and served', () => {});it('mirrors idempotently, so a rebuild produces no phantom diff', () => {- const before = readFileSync(resolve(root, 'public/examples.json'), 'utf8');- execFileSync('node', ['scripts/mirror-examples-index.mjs'], { cwd: root, encoding: 'utf8' });- expect(readFileSync(resolve(root, 'public/examples.json'), 'utf8')).toBe(before);+ // Compare two consecutive mirror runs rather than the committed file+ // against one run: other agents share this worktree and regenerate+ // data/examples.json, and a legitimately updated source would otherwise+ // read as a broken mirror.+ const read = () => readFileSync(resolve(root, 'public/examples.json'), 'utf8');+ const run = () => execFileSync('node', ['scripts/mirror-examples-index.mjs'], { cwd: root, encoding: 'utf8' });+ run();+ const first = read();+ run();+ expect(read()).toBe(first);});});