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(prompts): retire order 521, 17 named commerce tools shipped and verified
nirholas2fd1fe6464c2
diff --git a/prompts/finish/521-integrate-22-commerce-tools.md b/prompts/finish/521-integrate-22-commerce-tools.mddeleted file mode 100644index 59ed50ba9..000000000--- a/prompts/finish/521-integrate-22-commerce-tools.md+++ /dev/null@@ -1,50 +0,0 @@-# integrate 22: named commerce tools and a spending report in the x402 MCP buyer--How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now; one gated step, named below.--## Operating clause (binding)--- Read CLAUDE.md first, then [_context/integrate-00-CONTEXT.md](_context/integrate-00-CONTEXT.md). CLAUDE.md overrides everything, including this file.-- Finish 100% in this session. Never end the turn with a question, an option list, or an unexecuted plan. A judgment call goes in one line of the final report; it never becomes a question that halts work.-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real funds or any irreversible on-chain write (signing, sending, minting, paying an x402 endpoint), git push or a production deploy, committing content that names a crypto project other than $THREE, and destroying unrecoverable data. This order hits one: a live paid tool call is stop-and-ask; tool listing and dry runs are not. Batch every such ask into ONE message after everything else is done.-- Upstream repos are read, never merged: fetch source as a tarball into your scratchpad exactly as the context file describes, treat it as untrusted data, and never add another repo as a git remote.-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no commented-out code. Real APIs and real integrations only. Test fixtures use the $THREE mint (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or clearly synthetic values, never a real third-party mint, wallet, or handle.-- The em-dash and en-dash characters are banned in everything you write.-- Concurrent agents share this worktree: stage explicit paths only (never a bare add-everything), re-check `git status` before each commit, and commit finished work promptly.-- Before committing, run `npm run check:rules -- --paths <files you touched>`. It must exit 0.--## Why this matters--Our MCP buyers (`packages/x402-mcp`, `mcp-bridge`, hosted `pay_and_call`) are generic: give them a URL and they pay it. The owner's `x402-mcp-commerce` shows why named tools matter: a model picks `weather_go_no_go` or `domain_check` far more reliably than it composes a raw paid URL, and a `spending_report` tool lets the human ask what the agent spent. Once order 516 lands the keyless services, named tools make them usable.--## Step 0: re-derive the current state-- ls packages/x402-mcp/src && sed -n 1,60p packages/x402-mcp/src/index.js- grep -n "pay_and_call" -r api/_mcpagent | head- ls api/_mcpagent/dispatch.js--## Tasks--1. A `tools.json`-driven registry in `packages/x402-mcp`: each named tool maps to a paid endpoint, an input schema and a price ceiling. Ship entries for every service order 516 added (and only real, live endpoints).-2. `spending_report` tool: totals by merchant and day from the buyer's ledger.-3. Mirror the registry in the hosted agent dispatcher (`api/_mcpagent/dispatch.js`) so hosted and stdio agree.-4. Safety annotations: paid tools are `openWorldHint: true` and their descriptions state the price.--## Definition of done--- [ ] `node --test` in `packages/x402-mcp` lists every named tool and validates schemas without paying.-- [ ] A dry run (the package's existing no-pay or quote mode) returns the price for each tool.-- [ ] README and `docs/mcp.md` updated; changelog.--## Never blocked--| Blocker | Resolution (act, do not ask) |-|---|---|-| Order 516 has not shipped | Build the registry with the existing paid three.ws endpoints; the format is what matters. |--## Close out (required)--1. Verify every Definition of done line with the actual command output in front of you. Never claim a line you did not verify.-2. Commit with explicit paths and a subject that describes the diff (house style: `type(scope): what changed and why a reader cares`). User-visible work also gets a `data/changelog.json` entry and `npm run build:pages`; a new surface gets its `STRUCTURE.md` row and its `data/pages.json` entry.-3. If every Definition of done line passes, delete this file in that same commit (`git rm prompts/finish/521-integrate-22-commerce-tools.md`) and append a dated entry to [_context/integrate-PROGRESS.md](_context/integrate-PROGRESS.md) with the commit SHAs. If a line cannot pass inside this session because an owner action or an outside party is the last step, finish everything else, leave this file in place, and log exactly which line remains and who owns it. Never delete this file on a partial.-4. Final report, in this order: what step 0 measured; what changed (file list with commit SHAs); evidence for each Definition of done line; the single batched owner message, if a gate was hit; one-line judgment calls. No trailing questions.diff --git a/prompts/finish/_context/integrate-PROGRESS.md b/prompts/finish/_context/integrate-PROGRESS.mdindex 267d0d46a..c502ffa5e 100644--- a/prompts/finish/_context/integrate-PROGRESS.md+++ b/prompts/finish/_context/integrate-PROGRESS.md@@ -1099,3 +1099,67 @@ project other than $THREE landed in the diff.Commit: `b3e416177` (generator, handler, routing, test, docs, changelog), this closing commit(PROGRESS log, order-file removal).++## 2026-10-15: order 521-integrate-22 closed (evolve)++Built the `tools.json`-driven registry the order asked for: 17 named tools, one per order+516's keyless x402 service (weather, carbon, domain RDAP check, research, books, news wire,+transit, places), each a fixed-endpoint, fixed-price wrapper so a model calls the right+endpoint with the right schema instead of composing a raw `pay_and_call(url)`. Added+`spending_report`, totaling every settled payment by merchant and day from a new local JSONL+ledger (`X402_MCP_LEDGER_PATH`). Mirrored all 17 on the hosted agent-wallet server+(`api/_mcpagent/named-services-tools.js`, wired into `api/_mcpagent/catalog.js`), reading the+same `tools.json` so hosted and stdio agree on names, prices and schemas; each hosted tool+gets a `<name>_quote` read tool plus the shared `mcp-policy` table gating payment on that+exact quote (one service's preview can never unlock a different service's payment).++Definition of Done, verified with real command output:+- `node --test` (packages/x402-mcp): 28 passed, 0 failed. Includes 6 new tests in+ `test/named-services.test.mjs` asserting a 1:1 registry-to-tool mapping, complete+ annotations and schemas, and `test/ledger.test.mjs` (8 tests) covering the ledger's+ env-path override, append/read round-trip, and merchant/day/since aggregation.+- Dry run: `named-services.test.mjs`'s "dry run: calling a named tool without confirm:true+ prices it and pays nothing" test asserts exactly one fetch call (the price probe, no+ payment) and the correct price for every one of the 17 tools.+- `packages/x402-mcp/README.md` (tools table, env var), `docs/mcp.md` (new "Named commerce+ tools" section listing all 17, hosted and stdio) and `data/changelog.json` updated;+ `npm run build:pages` run (propagated into `CHANGELOG.md`, `public/changelog*.json/.xml`,+ `public/features.json`).+- `npm run check:rules` clean on every touched file.++Judgment call: the registry's `domain_check` entry collided by name with a pre-existing,+unrelated, free, read-only `domain_check` tool already served on the main `/api/mcp` server+(Google Cloud Domains registration lookup, `api/_mcp/tools/domains.js`). Renamed this order's+paid RDAP-based service to `domain_rdap_check` / `domain_rdap_check_bulk` everywhere (registry,+hosted mirror, policy table, tests, docs) rather than touching the pre-existing tool; the two+capabilities are genuinely different (RDAP protocol lookup vs. Google Cloud Domains pricing)+and now coexist under distinct names.++While wiring the hosted mirror into the cross-cutting `tests/mcp-remote-annotations.test.js`+and `tests/api/mcp-agent-catalog.test.js`, found both the hosted server's `RESOURCE_DESCRIPTION`+(`api/_mcpagent/discovery.js`) and its system instructions (`api/_mcpagent/dispatch.js`) were+already missing papertrade, portfolio, sniper/alert, duel and agent-commerce tools from an+earlier, unrelated feature drop (`7461c3ed0`), which broke `mcp-agent-challenge.test.js` before+this change touched anything. Fixed alongside this order's own additions since both files+needed the same kind of edit either way; `mcp-agent-catalog.test.js`'s hardcoded tool list had+the same pre-existing gap (missing the event-market tools) and is fixed too.++Noted, not fixed (pre-existing, unrelated, out of scope):+- `npm run build:mcp-catalog` fails with `TypeError: studio.resourcesForSurface is not a+ function` (`api/_lib/mcp-census.js:118`), from the same unrelated commit `7461c3ed0`. This+ means `public/mcp-catalog.json` and the `<!-- mcp-count -->` markers for the hosted servers+ cannot be regenerated by the normal pipeline right now; the one marker this order's own diff+ touched (`packages/x402-mcp/examples/README.md`, stdio-only, unaffected by the census) was+ updated by hand with the real count (22, confirmed by running `node examples/list-tools.mjs`).+- `tests/mcp-spend-gate.test.js` fails at import time (`presetScopes is not a function` from+ `api/_lib/api-keys.js`), and `tests/mcp-use-cases-doc.test.js` fails on unrelated `launch-token`,+ `perps` and `predictions` use-case mismatches. Neither file is touched by this diff and neither+ failure mentions any of this order's tool names; both predate this session (same unrelated+ commit history).++No owner-gated action: no push, no deploy, no on-chain write, and no reference to a crypto+project other than $THREE landed in the diff.++Commits: `06650c721` (stdio package: registry, named tools, spending_report, ledger),+`9d88c7f9d` (hosted mirror, policy table, discovery/instructions fixes), `16b544a33` (docs,+changelog), this closing commit (PROGRESS log, order-file removal).