Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(catalog): unified service catalog — one source of truth, two storefronts (prompt 21)
fudjia8bcdaa04c5db
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 12f2d1fb2..1223d6a95 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -38,6 +38,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **three.ws 3D API: free text→3D + inspection for AI agents, with pro tiers** — One URL now discovers the whole free, keyless 3D API for agents. GET /api/3d returns every free endpoint — turn a text prompt into a real GLB (/api/3d/generate) and validate/optimize any glTF/GLB (/api/3d/inspect) — with a live example each, plus the paid ladder it graduates to. GET /api/3d/openapi.json is a real OpenAPI 3.1 spec generated straight from the catalog, so LangChain, openapi-generator, and Swagger UI get typed tools with no key and no account. A new docs page at /3d shows a hero, a live endpoint table, a runnable quickstart with a "run it live" inspection console, an embedded 3D viewer of a real model, and a clear free→paid path: free draft + inspect → Forge Pro quality tiers → animation-ready Rigged Avatars. No other agent-payments platform gives away 3D generation and inspection. (`/3d`) `[feature, docs]`- **three.ws Crypto Data API: one free, keyless crypto data bundle for AI agents** — The free crypto endpoints are now one product with a single front door. GET /api/crypto lists the whole bundle — bonding-curve status, whale activity, trending tokens, wallet portfolios, and symbol availability — each with its inputs, outputs, and a live example, so an agent discovers everything in one call (ask for HTML and it renders a browsable page instead of JSON). GET /api/crypto/openapi.json is a real OpenAPI 3.1 spec generated straight from that catalog, so LangChain, openapi-generator, and Swagger UI produce typed clients and callable tools with no key and no account. New endpoints join the index and the spec automatically the moment they ship, and a zero-endpoint state is a valid "coming soon", never an error. Full reference lives at /docs/crypto-api. (`/docs/crypto-api`) `[feature, sdk]`- **Trimmed low-value endpoints so agents find the tools that matter** — The agent-facing x402 catalog got a spring clean. Nine novelty and me-too endpoints that powered in-product experiences (the club stage, the town NPCs, demo pages) no longer appear as standalone products on x402scan and agentic.market — they keep working inside the product, but they were diluting the catalog and burying the tools agents actually use. What agents now find first: the free Crypto Data API and 3D API, Forge, the pump.fun launcher, vanity addresses, and cross-chain trust primitives. (`/docs/crypto-api`) `[improvement]`+- **Unified service catalog powering all agent storefronts** — Every service three.ws offers — the paid x402 endpoints, the free Crypto Data and 3D APIs, and the OKX.AI 3D Studio listings — is now described in one canonical catalog that every storefront renders from. Before, the same service could carry different descriptions on x402scan versus our own discovery doc versus OKX, and they quietly drifted apart. Now a listing is written once and projected everywhere, automated checks fail the build if any storefront ever disagrees with the catalog, and the 3D Asset Pipeline endpoint — which had been live but invisible to marketplace crawlers — is discoverable. (`/docs/start-here`) `[infra, improvement]`- **Vanity address grinder listing overhauled** — Our Solana vanity grinder — grind a brand-new address that starts with your ticker for a branded token mint or agent/treasury wallet — now reads like the flagship it is on the x402 agent marketplaces. The listing leads with what agents actually use it for, spells out both output formats (a raw keypair or an importable BIP-39 seed phrase), the character caps and the full price ladder ($0.01–$0.25 for a keypair, $0.05–$0.50 for a mnemonic), and the security model: nothing is ever stored, the secret is served once over TLS and stripped from the replay cache, and an optional sealed-delivery key means the plaintext never appears in the response or any log. The discovery schema is now complete enough for an agent to grind an address blind, and the premium pre-ground inventory tier is now indexable too — so all three vanity tiers surface on the marketplaces and can never drift from what the live payment charges. New reference doc at /docs/vanity. (`/docs/vanity`) `[improvement]`## 2026-07-06diff --git a/STRUCTURE.md b/STRUCTURE.mdindex 6c7ac96c9..8f90bbbcf 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -28,6 +28,7 @@ bottom.| Crypto Data API docs / landing | [pages/crypto.html](pages/crypto.html) `→ /crypto` | In-repo · docs surface | Screenshot-worthy public docs + funnel-top for the free, keyless Crypto Data API (`/api/crypto/*` — token snapshot, security, holders, launches, bonding, whales, symbol, wallet, trending). Renders hero, endpoint table, tabbed quickstart (curl/JS/Python), per-endpoint request/response reference and a live "Try it" console. Probes production at runtime and marks each endpoint Live vs Coming soon (degrades gracefully while sibling endpoints roll out). CTAs funnel to paid uniques: [/launcher](pages/launcher.html), [/vanity-wallet](public/vanity-wallet.html), [/forge](pages/forge.html). Spec: [prompts/x402-overhaul/](prompts/x402-overhaul) || Free Crypto Data API + discovery | [api/crypto/index.js](api/crypto/index.js) `→ /api/crypto`, [api/crypto/openapi.js](api/crypto/openapi.js) `→ /api/crypto/openapi.json`, docs [docs/crypto-api.md](docs/crypto-api.md) `→ /docs/crypto-api` | Live · docs surface | Front door + OpenAPI 3.1 for the free, keyless Crypto Data API. Catalog assembler [api/_lib/crypto-catalog/index.js](api/_lib/crypto-catalog/index.js) merges `api/_lib/crypto-catalog/*.js` self-describing descriptors (currently `bonding`, `launches`, `symbol`, `token`, `trending`, `wallet`, `whales`) via a static import barrel — the production source of truth, since Vercel's bundler only ships what static imports reach — plus an additive dev-time directory glob; skips malformed/throwing entries, never throws, valid-empty when zero. New descriptor = drop the file AND add its import line to the barrel. OpenAPI built from the same catalog via [api/_lib/crypto-catalog/openapi.js](api/_lib/crypto-catalog/openapi.js). Index does HTML/JSON content negotiation. Endpoint handlers live in `api/crypto/*.js`. Spec: [prompts/x402-overhaul/](prompts/x402-overhaul) || Free 3D API + docs | [api/3d/index.js](api/3d/index.js) `→ /api/3d`, [api/3d/openapi.js](api/3d/openapi.js) `→ /api/3d/openapi.json`, docs [public/3d.html](public/3d.html) `→ /3d` (alias `/docs/3d-api`) | Live · docs surface | Front door + OpenAPI 3.1 for the free, keyless 3D API. Catalog assembler [api/_lib/3d-catalog/index.js](api/_lib/3d-catalog/index.js) merges `api/_lib/3d-catalog/*.js` descriptors (currently `generate`, `inspect`) via a static import barrel (production source of truth) plus an additive dev-time directory glob; new descriptor = drop the file AND add its barrel import line; skips malformed, never throws; OpenAPI built from the same catalog via [api/_lib/3d-catalog/openapi.js](api/_lib/3d-catalog/openapi.js). Index does HTML/JSON content negotiation and advertises the paid ladder (Forge Pro, Rigged Avatars). Docs page: hero, live endpoint table, runnable quickstart with a live "Run inspect" console, embedded `<model-viewer>` GLB preview, and the free→paid ladder. Free endpoints: [api/3d/generate.js](api/3d/generate.js) (prompt 12), [api/3d/inspect.js](api/3d/inspect.js) (prompt 13). Spec: [prompts/x402-overhaul/](prompts/x402-overhaul) |+| Unified service catalog (one source, two storefronts) | [api/_lib/service-catalog/index.js](api/_lib/service-catalog/index.js), descriptors [api/_lib/service-catalog/services/](api/_lib/service-catalog/services/index.js) | Live | The canonical written-once record of every service (paid x402 + free crypto/3D bundles + OKX.AI rows). `toBazaarDiscovery()` generates every static `/api/x402/*` entry in the [api/wk.js](api/wk.js) discovery doc (replacing ~1,400 lines of hand-mirrored blocks); `toOkxCatalog()` reproduces the OKX `catalogIndex()` payload exactly, with an `include:'all'` projection ready for listing expansion. New paid service = drop `services/<slug>.js` + add its barrel import row. No-drift guards: [tests/service-catalog.test.js](tests/service-catalog.test.js). Spec: [specs/SERVICE_CATALOG.md](specs/SERVICE_CATALOG.md) || Sperax partnership + SperaxOS plugin | [pages/sperax.html](pages/sperax.html) `→ /sperax`, plugin [public/sperax/](public/sperax/README.md), manifest `→ /.well-known/sperax-plugin.json`, tools [api/chat-plugin/[tool].js](api/chat-plugin/%5Btool%5D.js) `→ /api/chat-plugin/*`, panel `→ /sperax/iframe/` | In-repo · Live | Partnership landing for the SperaxOS integration: three.ws ships as a standalone `plugin.delivery` plugin that gives a SperaxOS agent an embodied 3D avatar (speak/gesture/emote/render_agent), bound to an ERC-8004 identity, settling over Base x402. Launch offer: free AI credits for three.ws users on [chat.sperax.io](https://chat.sperax.io) — page explains what it is and how to claim. Blog: [/blog/three-ws-speraxusd-integration](blog/three-ws-speraxusd-integration.html) || Live Agents wall (mission control) | [pages/agents-live.html](pages/agents-live.html) + [src/agents-live.js](src/agents-live.js) `→ /agents-live` | In-repo · roster [api/agents/public.js](api/agents/public.js) (`sort=live`), per-agent SSE [api/agent-screen-stream.js](api/agent-screen-stream.js) | Real-time grid of every meaningful agent, ranked by most-recent on-chain/skill action (never-used placeholders suppressed). Each card streams a live caster feed when watched, else its real `agent_actions` as a terminal + an "active Nm ago" recency chip. Layers: showrunner spotlight ([src/showrunner.js](src/showrunner.js)), reputation arena ([src/agents-live-arena.js](src/agents-live-arena.js)), platform ticker ([src/theater-feed.js](src/theater-feed.js)) || X/Twitter automation toolkit | [nirholas/XActions](https://github.com/nirholas/XActions) (external repo, also on npm as `xactions`) | External | Formerly vendored in-repo; removed 2026-07-03 — install from npm or use the upstream repo |@@ -139,7 +140,7 @@ Launch state: **published to npm** as `@three-ws/<name>` — install with`npm i @three-ws/<name>`. The merchant SDK (`@three-ws/x402-server`) advertisesthe two main x402 assets, **USDC and $THREE**, in one 402 challenge. Re-publishis idempotent via `node scripts/publish-packages.mjs` (skips versions already on-npm); see [docs/sdk-launch.md](docs/sdk-launch.md) for the runbook.+npm).| Package | Location | Wraps | What it does ||---|---|---|---|diff --git a/api/_lib/service-catalog/index.js b/api/_lib/service-catalog/index.jsnew file mode 100644index 000000000..961176a48--- /dev/null+++ b/api/_lib/service-catalog/index.js@@ -0,0 +1,285 @@+// Unified service catalog — ONE source of truth, two storefronts.+//+// x402scan/agentic.market (Base) and OKX.AI (X Layer) are storefronts over the+// same backend. Before this module, listing metadata was scattered: each paid+// endpoint's BAZAAR export, ~1,400 lines of hand-mirrored resource blocks in+// api/wk.js, and a separate OKX catalog — drift was inevitable (and real:+// descriptions for the same route differed between surfaces). Now every+// storefront renders from here, so a description is written once.+//+// Sources (imported, never duplicated):+// • services/*.js — one descriptor per paid x402 service (static+// barrel, discovery-doc order)+// • ../crypto-catalog — the free Crypto Data API bundle+// • ../3d-catalog — the free 3D API bundle+// • ../okx-catalog.js — the OKX.AI 3D Studio listing rows (owned by+// the OKX stream; read-only here)+//+// Consumers:+// • api/wk.js — derives every static /api/x402/* resource entry in+// /.well-known/x402.json from toBazaarDiscovery()+// • the OKX stream — toOkxCatalog() emits the exact catalogIndex() shape+// api/_lib/okx-catalog.js serves today, so it can point at this module+// • tests/service-catalog.test.js — no-drift + projection-shape guards+//+// Contract: specs/service-catalog.md.++import { PAID_SERVICES } from './services/index.js';+import { loadCatalog as loadCryptoCatalog } from '../crypto-catalog/index.js';+import { loadCatalog as load3dCatalog } from '../3d-catalog/index.js';+import {+ OKX_CATALOG,+ catalogIndex as okxCatalogIndex,+ displayWidth,+ DESCRIPTION_MAX_WIDTH,+} from '../okx-catalog.js';+import { withService } from '../x402/bazaar-helpers.js';++const BASE = 'https://three.ws';++// Networks each accepts-builder advertises (mirrors api/wk.js acceptsForPrice /+// buildBazaarAccepts / the permit2-only block). Informational on the canonical+// entry; the live accepts[] are always built by wk.js from env at render time.+const NETWORKS_BY_BUILDER = Object.freeze({+ standard: Object.freeze(['solana', 'base']),+ 'cdp-bazaar': Object.freeze(['solana', 'base', 'arbitrum']),+ 'permit2-only': Object.freeze(['base']),+});++export function priceUsdFromAtomics(atomics) {+ const n = Number(atomics || 0) / 1_000_000;+ const s = n.toFixed(n < 0.01 ? 4 : 2);+ return s.includes('.') ? s.replace(/0+$/, '').replace(/\.$/, '') : s;+}++function firstSentence(text) {+ const m = String(text || '').match(/^.*?[.!?](?=\s|$)/s);+ return (m ? m[0] : String(text || '')).trim();+}++function normalizePaid(s) {+ return {+ slug: s.slug,+ title: s.title,+ category: s.category,+ useCase: s.useCase,+ free: false,+ status: s.status,+ method: s.method,+ path: s.path,+ endpoint: `${BASE}${s.path}`,+ price: {+ usd: priceUsdFromAtomics(s.priceAtomics),+ atomics: s.priceAtomics,+ networks: [...(NETWORKS_BY_BUILDER[s.acceptsBuilder] || NETWORKS_BY_BUILDER.standard)],+ },+ serviceName: s.serviceName,+ tags: [...s.tags],+ description: s.description,+ ...(s.input !== undefined ? { input: s.input } : {}),+ ...(s.inputSchema !== undefined ? { inputSchema: s.inputSchema } : {}),+ storefronts: [...s.storefronts],+ source: 'x402',+ };+}++function normalizeCrypto(e) {+ return {+ slug: `crypto-${e.slug}`,+ title: e.title,+ category: 'crypto-data',+ useCase: firstSentence(e.summary),+ free: true,+ status: 'live',+ method: e.method,+ path: e.path,+ endpoint: `${BASE}${e.path}`,+ price: null,+ tags: ['crypto', 'free', 'keyless'],+ description: e.summary,+ ...(e.inputSchema ? { inputSchema: e.inputSchema } : {}),+ ...(e.outputSchema ? { outputSchema: e.outputSchema } : {}),+ ...(e.example != null ? { example: e.example } : {}),+ storefronts: ['crypto-index'],+ source: 'crypto-catalog',+ };+}++function normalize3d(e) {+ return {+ slug: `3d-${e.slug}`,+ title: e.title,+ category: e.category || '3d',+ useCase: e.useCase || firstSentence(e.summary),+ free: Boolean(e.free),+ status: 'live',+ method: Array.isArray(e.methods) && e.methods.length ? e.methods[0] : 'GET',+ path: e.path,+ endpoint: `${BASE}${e.path}`,+ price: null,+ tags: Array.isArray(e.tags) && e.tags.length ? [...e.tags] : ['3d', 'free', 'keyless'],+ description: e.summary || e.description || '',+ ...(e.input !== undefined ? { input: e.input } : {}),+ ...(e.inputSchema ? { inputSchema: e.inputSchema } : {}),+ ...(e.outputSchema ? { outputSchema: e.outputSchema } : {}),+ ...(e.example != null ? { example: e.example } : {}),+ storefronts: ['3d-index'],+ source: '3d-catalog',+ };+}++function normalizeOkx(e) {+ const free = e.priceUsd === '0';+ return {+ slug: `okx-${e.id}`,+ title: e.name,+ category: '3d',+ useCase: e.describes.capability,+ free,+ status: 'live',+ method: e.kind === 'a2mcp' || !free ? 'POST' : 'GET',+ path: new URL(e.endpoint).pathname,+ endpoint: e.endpoint,+ price: free ? null : { usd: e.priceUsd, atomics: e.amountAtomics, networks: ['xlayer'] },+ tags: ['okx', '3d', e.kind],+ description: `${e.describes.capability}\n${e.describes.input}`,+ ...(e.inputSchema ? { inputSchema: e.inputSchema } : {}),+ storefronts: ['okx'],+ source: 'okx',+ };+}++// ── The canonical catalog ────────────────────────────────────────────────────++// Full merged catalog: paid x402 services (discovery order), free crypto + 3D+// bundles, and the OKX.AI listing rows. A failing free-catalog loader degrades+// to the entries that did load (matching each loader's own robustness+// contract) — the paid + OKX sections are static imports and always present.+export async function getCatalog() {+ const [crypto, threeD] = await Promise.all([+ loadCryptoCatalog().catch(() => []),+ load3dCatalog().catch(() => []),+ ]);+ return [+ ...PAID_SERVICES.map(normalizePaid),+ ...crypto.map(normalizeCrypto),+ ...threeD.map(normalize3d),+ ...OKX_CATALOG.map(normalizeOkx),+ ];+}++// Storefront views: 'x402scan' (paid x402 discovery), 'okx' (OKX.AI listing),+// 'crypto-index' (/api/crypto), '3d-index' (/api/3d).+export async function getByStorefront(storefront) {+ const all = await getCatalog();+ return all.filter((e) => e.storefronts.includes(storefront));+}++// ── x402scan projection ──────────────────────────────────────────────────────++// Emit the static /api/x402/* resource entries for /.well-known/x402.json in+// catalog order. wk.js injects its env-aware builders:+// acceptsFor(service, url) — returns the accepts[] for the service's+// acceptsBuilder ('standard' | 'cdp-bazaar' | 'permit2-only'), or null to+// omit the resource entirely (permit2 without CDP creds).+// extensionsForAccepts(accepts, bazaar) — wk.js's normalizer, so gasless+// Permit2 extensions attach exactly as before.+export function toBazaarDiscovery({ origin, acceptsFor, extensionsForAccepts }) {+ const out = [];+ for (const s of PAID_SERVICES) {+ if (s.status !== 'live') continue;+ const url = `${origin}${s.path}`;+ const accepts = acceptsFor(s, url);+ if (!accepts) continue;+ const svc = withService({ serviceName: s.serviceName, tags: s.tags });+ out.push({+ path: s.path,+ url,+ method: s.method,+ description: s.description,+ mimeType: 'application/json',+ serviceName: svc.serviceName,+ tags: svc.tags,+ iconUrl: svc.iconUrl,+ accepts,+ // A descriptor may carry a fully-built {discoverable, info, schema}+ // bazaar block (forge does — its shared listing module builds one with+ // the output schema included); extensionsForAccepts passes such blocks+ // through verbatim. Otherwise the block is derived from input/inputSchema.+ extensions: extensionsForAccepts(+ accepts,+ s.bazaar || {+ method: s.method,+ discoverable: true,+ ...(s.input !== undefined ? { input: s.input } : {}),+ ...(s.inputSchema !== undefined ? { inputSchema: s.inputSchema } : {}),+ // Descriptors added before the catalog existed get their output+ // example backfilled by wk.js's REST_OUTPUT_EXAMPLES map; new+ // descriptors carry it here so the whole listing is one record.+ ...(s.outputExample !== undefined ? { output: { example: s.outputExample } } : {}),+ },+ ),+ });+ }+ return out;+}++// ── OKX projection ───────────────────────────────────────────────────────────++// Truncate to the OKX listing's 200-display-width budget (East-Asian wide+// glyphs count 2), appending '…' when cut so a clipped description reads as+// clipped instead of silently malformed.+function clampWidth(text, max = DESCRIPTION_MAX_WIDTH) {+ const s = String(text || '').trim();+ if (displayWidth(s) <= max) return s;+ let out = '';+ let width = 0;+ for (const ch of s) {+ const w = displayWidth(ch);+ if (width + w > max - 1) break;+ out += ch;+ width += w;+ }+ return `${out.trimEnd()}…`;+}++// Human-readable "what the caller provides" line for an x402 service, derived+// from its input schema — the second half of an OKX 2-part description.+function okxInputHint(s) {+ const required = Array.isArray(s.inputSchema?.required) ? s.inputSchema.required : [];+ const params = required.length+ ? `with ${required.join(', ')}`+ : s.method === 'GET'+ ? 'with the documented query params'+ : 'with the documented JSON body';+ return `${s.method} ${s.endpoint} ${params}. Pays ${priceUsdFromAtomics(+ s.price.atomics,+ )} USDC per call via x402 (HTTP 402).`;+}++// The OKX.AI storefront projection. Default ('okx') reproduces the EXACT+// payload api/_lib/okx-catalog.js's catalogIndex() serves today — the OKX+// stream can point its module here with zero behavior change (deep-equality+// is asserted in tests/service-catalog.test.js). Pass {include:'all'} to also+// project every live paid x402 service into the same row schema, ready for a+// listing expansion beyond the 3D studio.+export function toOkxCatalog({ include = 'okx' } = {}) {+ const index = okxCatalogIndex();+ if (include === 'okx') return index;+ const projected = PAID_SERVICES.filter((s) => s.status === 'live').map((s) => {+ const entry = normalizePaid(s);+ return {+ id: entry.slug,+ name: clampWidth(entry.title, 80),+ kind: 'rest',+ description: {+ capability: clampWidth(entry.useCase),+ input: clampWidth(okxInputHint(entry)),+ },+ price_usd: entry.price.usd,+ endpoint: entry.endpoint,+ ...(entry.inputSchema ? { input_schema: entry.inputSchema } : {}),+ };+ });+ return { ...index, services: [...index.services, ...projected] };+}diff --git a/api/_lib/service-catalog/services/forge.js b/api/_lib/service-catalog/services/forge.jsindex 6ae1f3f2b..e98c06ff1 100644--- a/api/_lib/service-catalog/services/forge.js+++ b/api/_lib/service-catalog/services/forge.js@@ -4,60 +4,45 @@// the OKX storefront projection reads the same record (toOkxCatalog).// Contract: specs/service-catalog.md. Do not re-add a hand-written mirror// for this route in api/wk.js — edit this descriptor instead.+//+// Forge already has its own single listing source (api/_lib/forge-listing.js,+// shared with the live 402 challenge and guarded by+// tests/x402-forge-listing.test.js) — this descriptor imports it rather than+// copying it. `bazaar` is the fully-built {discoverable, info, schema} block;+// the discovery generator passes it through verbatim so the output schema+// survives (re-deriving from input/inputSchema would drop it). Price is+// tier-based: the catalog advertises the standard tier from forge-tiers.js —+// the single price source — while the live 402 quotes the exact tier requested.++import {+ FORGE_SERVICE_NAME,+ FORGE_TAGS,+ FORGE_ROUTE_DESCRIPTION,+ FORGE_INPUT_EXAMPLE,+ FORGE_INPUT_SCHEMA,+ FORGE_OUTPUT_SCHEMA,+ FORGE_BAZAAR,+} from '../../forge-listing.js';+import { priceAtomicsForTier } from '../../forge-tiers.js';export default {slug: 'forge',title: 'Forge: text/image to 3D',category: '3d',- useCase: 'three.ws Forge — pay-per-call text→3D and image→3D generation for autonomous agents.',+ useCase:+ 'Forge — production text/image→3D for agents that need real assets, not drafts: game assets, NFT art, scene props, and product visualization as textured GLB.',path: '/api/x402/forge',method: 'POST',free: false,status: 'live',- priceAtomics: '150000',+ priceAtomics: String(priceAtomicsForTier('standard')),acceptsBuilder: 'standard',- serviceName: 'three.ws Forge: text/image to 3D',- tags: ['3d', 'ai', 'text-to-3d', 'image-to-3d', 'utility'],- description: 'three.ws Forge — pay-per-call text→3D and image→3D generation for autonomous agents. Turn a text prompt (or up to four reference photos of one object) into a production-ready GLB mesh for game assets, NFT collections, 3D scenes, and product visualization — the only real 3D generation on any agent marketplace. Three quality tiers in USDC: draft $0.05 (fast low-poly blockout), standard $0.15 (balanced detail, the default), high $0.50 (maximum geometry + PBR textures). Pay autonomously in USDC on Solana mainnet — no API key, no account, no signup. Returns a job token you poll for FREE at GET /api/forge?job=<id>; draft prompts often finish inline and hand back the GLB url with status:"done". New here? Start on the free keyless draft lane at POST /api/3d/generate, then upgrade to a paid tier for standard/high quality or image→3D.',- input: {- prompt: 'a brass steampunk owl, full body',- tier: 'standard',- aspect_ratio: '1:1',- },- inputSchema: {- $schema: 'https://json-schema.org/draft/2020-12/schema',- type: 'object',- description: 'Provide exactly one of prompt (text→3D) or image_urls (image→3D). tier and aspect_ratio are optional; tier defaults to "standard".',- properties: {- prompt: {- type: 'string',- minLength: 3,- maxLength: 1000,- description: 'Describe one subject for text→3D. Omit when supplying image_urls.',- },- image_urls: {- type: 'array',- items: {- type: 'string',- format: 'uri',- },- minItems: 1,- maxItems: 4,- description: 'Up to four public https reference views of one object for image→3D. Omit when supplying a prompt.',- },- tier: {- type: 'string',- enum: ['draft', 'standard', 'high'],- default: 'standard',- description: 'Quality/price tier: draft $0.05 (low-poly), standard $0.15 (default), high $0.50 (PBR textures). The 402 quotes the price for the requested tier.',- },- aspect_ratio: {- type: 'string',- enum: ['1:1', '4:3', '3:4', '16:9', '9:16'],- default: '1:1',- description: 'Aspect ratio of the synthesized reference view for text→3D.',- },- },- },+ serviceName: FORGE_SERVICE_NAME,+ tags: [...FORGE_TAGS],+ description: FORGE_ROUTE_DESCRIPTION,+ input: FORGE_INPUT_EXAMPLE,+ inputSchema: FORGE_INPUT_SCHEMA,+ outputSchema: FORGE_OUTPUT_SCHEMA,+ bazaar: FORGE_BAZAAR,storefronts: ['x402scan'],};diff --git a/api/_lib/service-catalog/services/index.js b/api/_lib/service-catalog/services/index.jsindex da76bd918..9700eb1e5 100644--- a/api/_lib/service-catalog/services/index.js+++ b/api/_lib/service-catalog/services/index.js@@ -35,6 +35,7 @@ import pipelineRemesh from './pipeline-remesh.js';import pipelineGameready from './pipeline-gameready.js';import pipelineStylize from './pipeline-stylize.js';import pipelineRembg from './pipeline-rembg.js';+import pipeline from './pipeline.js';import bazaarFeed from './bazaar-feed.js';import billboard from './billboard.js';import crossChain from './cross-chain.js';@@ -80,6 +81,7 @@ export const PAID_SERVICES = Object.freeze([pipelineGameready,pipelineStylize,pipelineRembg,+ pipeline,bazaarFeed,billboard,crossChain,diff --git a/api/_lib/service-catalog/services/pipeline.js b/api/_lib/service-catalog/services/pipeline.jsnew file mode 100644index 000000000..1b7f6bde6--- /dev/null+++ b/api/_lib/service-catalog/services/pipeline.js@@ -0,0 +1,84 @@+// Service-catalog descriptor — the single written-once listing for this+// service. api/wk.js derives its /.well-known/x402.json resource entry from+// this file via api/_lib/service-catalog/index.js (toBazaarDiscovery), and+// the OKX storefront projection reads the same record (toOkxCatalog).+// Contract: specs/service-catalog.md. Do not re-add a hand-written mirror+// for this route in api/wk.js — edit this descriptor instead.+//+// Pricing is per-stage and dynamic: the live 402 quotes the EXACT sum of the+// requested stages (api/_lib/pipeline.js priceForChain). The catalog+// advertises the example chain's price — generate (draft, $0.05) + rig+// ($0.10) = $0.15 — so facilitators can index the route; per-stage prices are+// env-overridable via X402_PRICE_PIPELINE_STAGE_*.++export default {+ slug: 'pipeline',+ title: '3D Asset Pipeline',+ category: '3d',+ useCase:+ 'One call, full 3D asset pipeline — text or GLB in, rigged/optimized game-ready GLB out; the only asset pipeline in the x402 ecosystem.',+ path: '/api/x402/pipeline',+ method: 'POST',+ free: false,+ status: 'live',+ priceAtomics: '150000',+ acceptsBuilder: 'standard',+ serviceName: 'three.ws 3D Asset Pipeline',+ tags: ['3d', 'pipeline', 'rig', 'gameready', 'glb'],+ description:+ 'One call, full 3D asset pipeline — text or GLB in, rigged/optimized ' ++ 'game-ready GLB out; the only asset pipeline in the x402 ecosystem. Submit an ' ++ 'ordered chain of stages (generate → rig → remesh → gameready → stylize) and ' ++ 'get back a job token you poll for FREE at GET /api/forge?job=<id>, watching ' ++ 'per-stage progress until the final GLB is delivered. Priced per stage and ' ++ 'quoted EXACTLY in the 402 challenge (the sum of the requested stages). Pay ' ++ 'autonomously in USDC on Solana mainnet — no API key, no account.',+ input: {+ stages: ['generate', 'rig'],+ prompt: 'a brass steampunk owl, full body',+ options: { tier: 'draft', rig: { rig_type: 'biped' } },+ },+ inputSchema: {+ type: 'object',+ required: ['stages'],+ properties: {+ stages: {+ type: 'array',+ minItems: 1,+ maxItems: 5,+ items: { type: 'string', enum: ['generate', 'rig', 'remesh', 'gameready', 'stylize'] },+ description:+ 'Ordered subsequence of ["generate","rig","remesh","gameready","stylize"]. ' ++ 'generate must be first and requires prompt; without generate, glb_url is required.',+ },+ prompt: {+ type: 'string',+ minLength: 3,+ maxLength: 1000,+ description: 'Subject for the generate stage. Required when stages starts with generate.',+ },+ glb_url: {+ type: 'string',+ format: 'uri',+ description:+ 'Public https GLB to feed the first stage when the chain does not start with generate.',+ },+ options: {+ type: 'object',+ description:+ 'Per-stage options: { tier, aspect_ratio, rig:{rig_type}, remesh:{...}, gameready:{topology,poly_budget,texture_size}, stylize:{style,resolution} }.',+ },+ },+ },+ outputExample: {+ job_id: 'f1.eyJwIjoicGlwZWxpbmUifQ.sig',+ status: 'running',+ poll_url: '/api/forge?job=f1.eyJwIjoicGlwZWxpbmUifQ.sig',+ price_usdc: '0.15',+ stages: [+ { id: 'generate', status: 'done', output_url: 'https://cdn.three.ws/forge/example/model.glb' },+ { id: 'rig', status: 'running', output_url: null },+ ],+ },+ storefronts: ['x402scan'],+};diff --git a/api/wk.js b/api/wk.jsindex 56e686fba..e61b4d651 100644--- a/api/wk.js+++ b/api/wk.js@@ -27,15 +27,9 @@ import { STUDIO_CHALLENGE } from './_mcp3d/discovery.js';import { TOOL_CATALOG as STUDIO_TOOL_CATALOG } from './_mcp3d/catalog.js';import { priceFor as studioPriceFor } from './_mcp3d/pricing.js';import { priceFor } from './_lib/pump-pricing.js';-import { priceAtomicsForTier } from './_lib/forge-tiers.js';-import {- FORGE_SERVICE_NAME,- FORGE_TAGS,- FORGE_ROUTE_DESCRIPTION,- FORGE_OUTPUT_EXAMPLE,- FORGE_BAZAAR,-} from './_lib/forge-listing.js';+import { FORGE_OUTPUT_EXAMPLE } from './_lib/forge-listing.js';import { listBazaarServices, serviceResourceUrl } from './_lib/agent-paid-services.js';+import { toBazaarDiscovery } from './_lib/service-catalog/index.js';// ── agent-attestation-schemas ─────────────────────────────────────────────────@@ -284,6 +278,9 @@ function extensionsForAccepts(accepts, bazaar) {method: bazaar?.method || 'GET',input: bazaar?.input,inputSchema: bazaar?.inputSchema,+ // Catalog descriptors that carry their own output example declare it+ // here; older entries get theirs backfilled by addOutputExample.+ output: bazaar?.output,});const exts = { bazaar: normalized };if (accepts.some((a) => a?.extra?.assetTransferMethod === 'permit2')) {@@ -1234,7 +1231,6 @@ async function handleX402Discovery(req, res) {const origin = env.APP_ORIGIN;const mcpUrl = `${origin}/api/mcp`;const mcp3dUrl = `${origin}/api/mcp-3d`;- const modelCheckUrl = `${origin}/api/x402/model-check`;const price = RAW_AMOUNT_TO_USDC(env.X402_MAX_AMOUNT_REQUIRED);// Build the MCP accept list (Base + Solana). `resource` is echoed on every@@ -1345,191 +1341,14 @@ async function handleX402Discovery(req, res) {const mcpAccepts = buildMcpAccepts(mcpUrl);const mcp3dAccepts = buildMcpAccepts(mcp3dUrl);- const modelCheckAccepts = buildBazaarAccepts(modelCheckUrl);-- // USE-13: per-route Bazaar service metadata. Echoed on each resource[]- // entry so facilitators crawling /.well-known/x402-discovery surface a- // human-readable serviceName + topical tags + icon in their search UI.- // Tags are deliberately short (≤32 chars each) and ≤5 entries per the- // spec; iconUrl falls back to THREEWS_SERVICE.iconUrl when unset.- const routeMeta = {- modelCheck: withService({- serviceName: 'three.ws Model Check',- tags: ['3d', 'gltf', 'glb', 'inspection', 'validation'],- }),- mcp: withService({- serviceName: 'three.ws MCP',- tags: ['mcp', '3d', 'gltf', 'solana', 'agent'],- }),- agentReputation: withService({- serviceName: 'Cross-chain Agent Reputation',- tags: ['reputation', 'trust', 'cross-chain', 'agent', 'x402'],- }),- agentBouncer: withService({- serviceName: 'three.ws Agent Bouncer',- tags: ['reputation', 'trust', 'gate', 'agent', 'solana'],- }),- onchainIdentity: withService({- serviceName: 'three.ws Identity Verify',- tags: ['identity', 'verification', 'agent', 'trust', 'onchain'],- }),- pumpLaunch: withService({- serviceName: 'three.ws Pump Launcher',- tags: ['pump.fun', 'launch', 'deploy', 'token', 'solana', 'mint'],- }),- skillMarket: withService({- serviceName: 'three.ws Skill Market',- tags: ['marketplace', 'agent', 'skills', 'pricing', 'discovery'],- }),- skillCall: withService({- serviceName: 'three.ws Skill Call',- tags: ['skill', 'agent', 'tool', 'pay-per-call'],- }),- symbolCheck: withService({- serviceName: 'three.ws Symbol Check',- tags: ['ticker', 'pump.fun', 'collision', 'launch', 'solana'],- }),- vanity: withService({- serviceName: 'three.ws Vanity Grinder',- tags: ['solana', 'vanity', 'keypair', 'wallet', 'address'],- }),- vanityVerifiable: withService({- serviceName: 'three.ws Provable Vanity Grinder',- tags: ['solana', 'vanity', 'keypair', 'wallet', 'verifiable', 'commit-reveal'],- }),- vanityPremium: withService({- serviceName: 'three.ws Premium Vanity',- tags: ['solana', 'vanity', 'wallet', 'address', 'premium'],- }),- permit2Demo: withService({- serviceName: 'three.ws Permit2 Demo',- tags: ['x402', 'permit2', 'eip2612', 'gasless', 'demo'],- }),- assetDownload: withService({- serviceName: 'three.ws Asset Bazaar',- tags: ['3d', 'asset', 'glb', 'avatar', 'download'],- }),- tokenIntel: withService({- serviceName: 'three.ws Token Oracle',- tags: ['crypto', 'market', 'signal', 'oracle', 'solana'],- }),- avatarShop: withService({- serviceName: 'three.ws Avatar Shop',- tags: ['3d', 'avatar', 'cosmetic', 'shop', 'wearable'],- }),- animationDownload: withService({- serviceName: 'three.ws Animation Bazaar',- tags: ['3d', 'animation', 'glb', 'motion', 'avatar'],- }),- clubCover: withService({- serviceName: 'three.ws Pole Club Cover',- tags: ['3d', 'avatar', 'club', 'access', 'cover'],- }),- forge: withService({- serviceName: FORGE_SERVICE_NAME,- tags: [...FORGE_TAGS],- }),- analytics: withService({- serviceName: 'three.ws Social Analytics',- tags: ['analytics', 'club', 'social', 'metrics', 'solana'],- }),- apiKeyHealth: withService({- serviceName: 'three.ws API Key Health Check',- tags: ['health', 'api-key', 'autonomous', 'access-control'],- }),- authHealth: withService({- serviceName: 'three.ws Auth Session Health',- tags: ['auth', 'session', 'jwt', 'health', 'security'],- }),- avatarOptimizeBatch: withService({- serviceName: 'three.ws Avatar Optimizer',- tags: ['3d', 'avatar', 'optimization', 'glb', 'batch'],- }),- bazaarFeed: withService({- serviceName: 'three.ws Bazaar Feed',- tags: ['bazaar', 'listings', 'discovery', 'market', 'x402'],- }),- pipelineRig: withService({- serviceName: 'three.ws Pipeline - Rig',- tags: ['3d', 'rigging', 'skeleton', 'glb', 'pipeline'],- }),- pipelineRemesh: withService({- serviceName: 'three.ws Pipeline - Remesh',- tags: ['3d', 'remesh', 'retopology', 'glb', 'pipeline'],- }),- pipelineGameready: withService({- serviceName: 'three.ws Pipeline - Game-Ready',- tags: ['3d', 'gameready', 'retopology', 'glb', 'pipeline'],- }),- pipelineStylize: withService({- serviceName: 'three.ws Pipeline - Stylize',- tags: ['3d', 'stylize', 'voxel', 'glb', 'pipeline'],- }),- pipelineRembg: withService({- serviceName: 'three.ws Pipeline - RemBG',- tags: ['image', 'rembg', 'cutout', 'segmentation', 'pipeline'],- }),- billboard: withService({- serviceName: 'three.ws Coin-World Billboard',- tags: ['3d', 'world', 'billboard', 'content', 'placement'],- }),- crossChain: withService({- serviceName: 'three.ws Bridge Status',- tags: ['bridge', 'cross-chain', 'health', 'solana', 'wormhole'],- }),- did: withService({- serviceName: 'three.ws DID Health',- tags: ['did', 'identity', 'health', 'verification', 'x402'],- }),- feedHealth: withService({- serviceName: 'three.ws Feed Health',- tags: ['rss', 'feed', 'health', 'changelog', 'validation'],- }),- llmProxy: withService({- serviceName: 'three.ws LLM Inference Proxy',- tags: ['llm', 'inference', 'completion', 'proxy', 'benchmark'],- }),- mcpToolCatalog: withService({- serviceName: 'three.ws MCP Tool Discovery',- tags: ['mcp', 'discovery', 'tools', 'catalog', 'agent'],- }),- modelValidationSweep: withService({- serviceName: 'three.ws Model Validation Sweep',- tags: ['3d', 'gltf', 'glb', 'validation', 'quality'],- }),- notify: withService({- serviceName: 'three.ws Notification Delivery',- tags: ['notification', 'canary', 'health', 'delivery', 'ops'],- }),- payByName: withService({- serviceName: 'Pay-By-Name Resolution',- tags: ['identity', 'resolution', 'solana'],- }),- rateLimitProbe: withService({- serviceName: 'three.ws Rate-Limit Probe',- tags: ['rate-limit', 'capacity', 'health', 'oracle', 'agent'],- }),- schemaCheck: withService({- serviceName: 'three.ws JSON API Schema Check',- tags: ['schema', 'validation', 'changelog', 'health', 'api'],- }),- solanaRegisterHealth: withService({- serviceName: 'three.ws Solana Reg Health',- tags: ['health', 'solana', 'registration', 'agent', 'canary'],- }),- spendSession: withService({- serviceName: 'three.ws Spend Session Health',- tags: ['health', 'governance', 'payment-session', 'canary', 'x402'],- }),- telegramHealth: withService({- serviceName: 'three.ws Telegram Bot Health',- tags: ['health', 'telegram', 'bot', 'changelog', 'canary'],- }),- walletConnect: withService({- serviceName: 'three.ws Wallet Connect Health',- tags: ['health', 'wallet', 'siws', 'session', 'auth'],- }),- };+ // Service metadata for the two MCP transport entries. Every static+ // /api/x402/* resource entry now derives from the unified service catalog+ // (api/_lib/service-catalog/) — its per-service descriptors carry each+ // route's serviceName/tags, which used to be mapped inline here.+ const mcpService = withService({+ serviceName: 'three.ws MCP',+ tags: ['mcp', '3d', 'gltf', 'solana', 'agent'],+ });// USE-13: per-tool MCP catalog entries. Each priced tool is its own// catalog row keyed on (resource, toolName) so search can find them@@ -1540,7 +1359,7 @@ async function handleX402Discovery(req, res) {path: '/api/mcp',mcpUrl,mcpAccepts,- mcpService: routeMeta.mcp,+ mcpService,catalog: TOOL_CATALOG,priceForTool: priceFor,});@@ -1562,6 +1381,45 @@ async function handleX402Discovery(req, res) {priceForTool: studioPriceFor,});+ // Every static /api/x402/* resource entry, derived from the unified+ // service catalog (one descriptor per service — the single source of truth+ // both storefronts read; see specs/service-catalog.md). The env-aware+ // accepts builders stay here so the advertised rails keep matching the+ // live 402 exactly.+ const x402CatalogItems = toBazaarDiscovery({+ origin,+ extensionsForAccepts,+ acceptsFor(service, url) {+ // model-check is CDP-Bazaar-cataloged: Base + Arbitrum + Solana.+ if (service.acceptsBuilder === 'cdp-bazaar') return buildBazaarAccepts(url);+ if (service.acceptsBuilder === 'permit2-only') {+ // Permit2-only demo: skip the EIP-3009 entry that acceptsForPrice+ // would push first, so SDK clients are forced through the gasless+ // EIP-2612 → settleWithPermit path the endpoint is meant to prove.+ // permit2VariantOf returns null without CDP creds, in which case we+ // omit the resource from discovery (matches the runtime 402 behavior).+ const baseAccept = env.X402_PAY_TO_BASE+ ? {+ scheme: 'exact',+ network: NETWORK_BASE_MAINNET,+ network_label: 'base-mainnet',+ amount: service.priceAtomics,+ price: RAW_AMOUNT_TO_USDC(service.priceAtomics),+ payTo: env.X402_PAY_TO_BASE,+ asset: env.X402_ASSET_ADDRESS_BASE,+ asset_symbol: 'USDC',+ maxTimeoutSeconds: 60,+ resource: url,+ extra: { name: 'USD Coin', version: '2', decimals: 6 },+ }+ : null;+ const permit2 = baseAccept ? permit2VariantOf(baseAccept) : null;+ return permit2 ? [permit2] : null;+ }+ return acceptsForPrice(service.priceAtomics, url);+ },+ });+// Agent-published paid services — dynamic, one entry per active listing.const agentServiceItems = await buildAgentServiceItems(origin);@@ -1612,34 +1470,6 @@ async function handleX402Discovery(req, res) {// backfills a realistic response example onto every entry so indexers// render and rank each one (no empty result cards, no verifier warnings).resources: [- {- path: '/api/x402/model-check',- url: modelCheckUrl,- method: 'GET',- description:- 'Model Check — an agent handed a 3D asset URL verifies it before using or paying for it: $0.001 USDC per call returns structural stats (vertex/triangle counts, materials, textures, animations, extensions) and prioritized optimization recommendations. Single GET with ?url=…; USDC on Solana, Base, or Arbitrum. Free tier: the same inspection is keyless at /api/3d/inspect.',- mimeType: 'application/json',- serviceName: routeMeta.modelCheck.serviceName,- tags: routeMeta.modelCheck.tags,- iconUrl: routeMeta.modelCheck.iconUrl,- accepts: modelCheckAccepts,- extensions: extensionsForAccepts(modelCheckAccepts, {- method: 'GET',- discoverable: true,- input: { url: 'https://three.ws/avatar/character-studio/sample.glb' },- inputSchema: {- type: 'object',- required: ['url'],- properties: {- url: {- type: 'string',- format: 'uri',- description: 'Public HTTPS URL of a glTF/GLB model.',- },- },- },- }),- },{path: '/api/mcp',url: mcpUrl,@@ -1647,9 +1477,9 @@ async function handleX402Discovery(req, res) {description:'MCP 2025-06-18 Streamable HTTP transport — 3D avatar viewer, glTF model validation/inspection/optimization, and Solana agent data exposed as MCP tools. JSON-RPC 2.0 batch-aware. Currency: USDC.',mimeType: 'application/json',- serviceName: routeMeta.mcp.serviceName,- tags: routeMeta.mcp.tags,- iconUrl: routeMeta.mcp.iconUrl,+ serviceName: mcpService.serviceName,+ tags: mcpService.tags,+ iconUrl: mcpService.iconUrl,accepts: mcpAccepts,extensions: extensionsForAccepts(mcpAccepts, bazaarExtension()),links: {@@ -1675,1360 +1505,10 @@ async function handleX402Discovery(req, res) {payment_config: `${origin}/.well-known/x402`,},},- (() => {- const url = `${origin}/api/x402/agent-reputation`;- const accepts = acceptsForPrice('10000', url);- return {- path: '/api/x402/agent-reputation',- url,- method: 'GET',- description:- 'Cross-chain Agent Reputation — get a deterministic 0–100 trust score for ANY counterparty (Solana wallet, EVM wallet, pump.fun mint, ERC-8004 agent id, or three.ws agent_id — auto-detected) before you pay, trade, or delegate to it. Scored from real on-chain evidence: transaction history, age, distinct counterparties, holdings, settlement reliability, prior settled agent payments, and ERC-8004 feedback. Unknown subjects return score:null, not a fabricated score.',- mimeType: 'application/json',- serviceName: routeMeta.agentReputation.serviceName,- tags: routeMeta.agentReputation.tags,- iconUrl: routeMeta.agentReputation.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { subject: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump' },- inputSchema: {- type: 'object',- required: ['subject'],- properties: {- subject: { type: 'string' },- chain: { type: ['integer', 'string'] },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/agent-bouncer`;- const accepts = acceptsForPrice('10000', url);- return {- path: '/api/x402/agent-bouncer',- url,- method: 'GET',- description:- 'Agent Bouncer — the Pole Club door check, opened to the whole platform’s Solana reputation. Given a three.ws agent_id and an optional trust policy, read the agent’s Solana track record (confirmed on-chain payments, distinct payers, payment failure rate, distribute/buyback follow-through, signed Solana attestations, Club ban/tip ledger) and return an admit/refuse verdict with a door tier (newcomer / regular / trusted / vip). Vet a counterparty before paying, hiring, or delegating.',- mimeType: 'application/json',- serviceName: routeMeta.agentBouncer.serviceName,- tags: routeMeta.agentBouncer.tags,- iconUrl: routeMeta.agentBouncer.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: {- agent_id: '7b9a4f30-2d11-4e2d-9d12-1cdb1f6a3a55',- min_payments: 10,- min_distinct_payers: 3,- max_failure_rate: 0.2,- },- inputSchema: {- type: 'object',- required: ['agent_id'],- properties: {- agent_id: { type: 'string', format: 'uuid' },- min_payments: { type: 'integer' },- min_distinct_payers: { type: 'integer' },- max_failure_rate: { type: 'number' },- min_attestations: { type: 'integer' },- allow_newcomers: { type: 'boolean' },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/onchain-identity-verify`;- const accepts = acceptsForPrice('5000', url);- return {- path: '/api/x402/onchain-identity-verify',- url,- method: 'GET',- description:- 'Cross-platform On-Chain Identity Verifier — prove any claim that an identity controls an address. `identity` can be an ENS name, an SNS (.sol) name, an EVM or Solana wallet, an ERC-8004 agent id, or a three.ws agent_id; `address` is the contract/mint/wallet it claims. Returns on-chain evidence (deploy tx + deployer, mint/update authority, ENS/SNS resolution, ERC-8004 registration, three.ws deploy record) with verified true/false/unverifiable. Trust primitive before paying counterparty agents.',- mimeType: 'application/json',- serviceName: routeMeta.onchainIdentity.serviceName,- tags: routeMeta.onchainIdentity.tags,- iconUrl: routeMeta.onchainIdentity.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: {- identity: 'vitalik.eth',- address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',- chain: 'eip155:1',- },- inputSchema: {- type: 'object',- required: ['identity', 'address'],- properties: {- identity: {- type: 'string',- description:- 'ENS/SNS name, EVM/Solana wallet, ERC-8004 id (eip155:8453:42), or three.ws agent_id (uuid)',- },- address: {- type: 'string',- description: 'the contract/mint/wallet the identity claims to control',- },- chain: { type: 'string', description: 'optional CAIP-2 chain hint' },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/pump-launch`;- const accepts = acceptsForPrice('5000000', url);- return {- path: '/api/x402/pump-launch',- url,- method: 'POST',- description:- 'Pump Launcher — launch a pump.fun token autonomously in one paid call: no SOL, no wallet, no account. You pay USDC; the server fronts the ~0.022 SOL deploy cost, optionally grinds a vanity mint, and signs the bonding-curve create tx. Supply name + symbol and either a pre-pinned metadataUri or an imageUrl (we pin the image + descriptor to pump.fun IPFS). Creator rewards accrue to any Solana wallet you nominate; optional vanity prefix/suffix brands the mint address. Funnel: check the ticker is free first with the FREE GET /api/crypto/symbol, then confirm the deploy on the FREE GET /api/crypto/launches feed. Returns mint + tx signature + metadataUri + pump.fun URL.',- mimeType: 'application/json',- serviceName: routeMeta.pumpLaunch.serviceName,- tags: routeMeta.pumpLaunch.tags,- iconUrl: routeMeta.pumpLaunch.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: {- name: 'Helios',- symbol: 'HELIO',- imageUrl: 'https://example.com/helios.png',- creator: 'wwwPqsM4N7T9J69tB82nLyzxqsH159j4orftLTQfUGV',- },- inputSchema: {- type: 'object',- required: ['name', 'symbol'],- oneOf: [{ required: ['metadataUri'] }, { required: ['imageUrl'] }],- properties: {- name: { type: 'string', minLength: 1, maxLength: 32 },- symbol: { type: 'string', minLength: 1, maxLength: 10 },- metadataUri: { type: 'string', maxLength: 2048 },- imageUrl: { type: 'string', maxLength: 2048 },- description: { type: 'string', maxLength: 2000 },- twitter: { type: 'string', maxLength: 2048 },- telegram: { type: 'string', maxLength: 2048 },- website: { type: 'string', maxLength: 2048 },- creator: { type: 'string', minLength: 32, maxLength: 44 },- vanityPrefix: { type: 'string', maxLength: 5 },- vanitySuffix: { type: 'string', maxLength: 5 },- vanityIgnoreCase: { type: 'boolean' },- },- },- }),- };- })(),- (() => {- // Forge generation is tier-priced ($0.05 draft / $0.15 standard /- // $0.50 high). The catalog advertises the standard tier (sourced- // from forge-tiers.js — the single price source); the live 402- // quotes the exact price for the requested tier.- const url = `${origin}/api/x402/forge`;- const accepts = acceptsForPrice(String(priceAtomicsForTier('standard')), url);- return {- path: '/api/x402/forge',- url,- method: 'POST',- // Description + schemas come from the shared ../_lib/forge-listing.js- // so this mirror can never drift from the live 402 challenge.- description: FORGE_ROUTE_DESCRIPTION,- mimeType: 'application/json',- serviceName: routeMeta.forge.serviceName,- tags: routeMeta.forge.tags,- iconUrl: routeMeta.forge.iconUrl,- accepts,- // Pass the fully-built shared bazaar block (it already carries- // `info` + `schema`, so extensionsForAccepts uses it verbatim rather- // than re-deriving a schema that would drop the output schema). This- // is what makes the discovery doc byte-identical to the live 402.- extensions: extensionsForAccepts(accepts, FORGE_BAZAAR),- };- })(),- (() => {- const url = `${origin}/api/x402/skill-marketplace`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/skill-marketplace',- url,- method: 'GET',- description:- 'Skill Marketplace — list active skill listings with prices across all three.ws agents. Filter by skill name to find the cheapest provider for a given capability. Returns price atomics, chain, currency, trial offer, and time-pass terms.',- mimeType: 'application/json',- serviceName: routeMeta.skillMarket.serviceName,- tags: routeMeta.skillMarket.tags,- iconUrl: routeMeta.skillMarket.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { skill: 'inspect_model', limit: 20 },- inputSchema: {- type: 'object',- properties: {- skill: { type: 'string' },- limit: { type: 'integer', minimum: 1, maximum: 200 },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/symbol-availability`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/symbol-availability',- url,- method: 'GET',- description:- "Symbol Availability — pre-launch ticker collision check against three.ws's pump.fun mint index. Returns exact-symbol collisions plus trigram-similar tickers so launch agents can avoid name confusion and aggregator-search dilution.",- mimeType: 'application/json',- serviceName: routeMeta.symbolCheck.serviceName,- tags: routeMeta.symbolCheck.tags,- iconUrl: routeMeta.symbolCheck.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { ticker: 'HELIO', network: 'mainnet' },- inputSchema: {- type: 'object',- required: ['ticker'],- properties: {- ticker: { type: 'string', minLength: 1, maxLength: 32 },- network: { type: 'string', enum: ['mainnet', 'devnet'] },- },- },- }),- };- })(),- (() => {- // Vanity grind is difficulty-tiered ($0.01–$0.25); the catalog- // advertises the 1-char entry tier ('10000' = $0.01) while the live- // 402 quotes the exact price for the requested pattern length.- const url = `${origin}/api/x402/vanity`;- const accepts = acceptsForPrice('10000', url);- return {- path: '/api/x402/vanity',- url,- method: 'GET',- description:- 'Vanity Grinder — put your brand on-chain: get a Solana address that starts with your ticker/prefix and/or ends with a chosen suffix, for a branded token MINT address, a recognizable agent/treasury wallet, or any wallet identifiable at a glance. The server grinds a brand-new keypair to match (no wallet, account, or SOL needed) and never stores it — the secret is served once over TLS and stripped from the replay cache. format=keypair (default) returns the address + secret key (Base58 + 64-byte array) importable into any Solana wallet, capped at 3 Base58 chars, priced $0.01 (1 char) / $0.05 (2) / $0.25 (3). format=mnemonic returns a BIP-39 seed phrase (12/24 words) whose derived key lands on the address, capped at 2 chars (~100× slower), priced $0.05 / $0.50. Optional sealTo=<X25519 pubkey> ECIES-seals the secret to you so plaintext never appears in the response or any log. Settlement runs only after a successful grind, so an exhausted budget costs nothing. Keyless — no API keys, no accounts.',- mimeType: 'application/json',- serviceName: routeMeta.vanity.serviceName,- tags: routeMeta.vanity.tags,- iconUrl: routeMeta.vanity.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { prefix: 'So', suffix: '', ignoreCase: '0', format: 'keypair' },- inputSchema: {- type: 'object',- anyOf: [{ required: ['prefix'] }, { required: ['suffix'] }],- properties: {- prefix: {- type: 'string',- maxLength: 3,- description:- 'Base58 characters the address must start with (excludes 0, O, I, l). Combined with suffix, max 3 (keypair) or 2 (mnemonic).',- },- suffix: {- type: 'string',- maxLength: 3,- description:- 'Base58 characters the address must end with. Combined with prefix, max 3 (keypair) or 2 (mnemonic).',- },- ignoreCase: {- type: 'string',- enum: ['0', '1', 'true', 'false'],- description:- 'When 1/true, match case-insensitively (faster, less specific).',- },- format: {- type: 'string',- enum: ['keypair', 'mnemonic'],- description:- 'keypair (default): raw 64-byte Ed25519 secret key, up to 3 chars, $0.01–$0.25. mnemonic: BIP-39 seed phrase importable into any wallet, up to 2 chars, $0.05–$0.50.',- },- strength: {- type: 'string',- enum: ['128', '256'],- description:- 'Mnemonic mode only. 128 → 12 words (default), 256 → 24 words. Ignored for keypair.',- },- sealTo: {- type: 'string',- description:- 'Optional. Your 32-byte X25519 public key (Base58/Base64url/hex). When set, the secret is ECIES-sealed to it and the plaintext is omitted from the response.',- },- },- },- }),- };- })(),- (() => {- // Provably-fair vanity grind: same difficulty tiers as /vanity with a- // small premium for the deterministic derivation + signed receipt. The- // catalog advertises the 1-char entry tier ('20000' = $0.02); the live- // 402 quotes the exact price for the requested pattern length.- const url = `${origin}/api/x402/vanity-verifiable`;- const accepts = acceptsForPrice('20000', url);- return {- path: '/api/x402/vanity-verifiable',- url,- method: 'GET',- description:- 'Provably-Fair Vanity Grinder — generate a brand-new Solana keypair whose Base58 address starts with a chosen prefix and/or ends with a chosen suffix, with a SIGNED receipt that proves the key was ground fresh and never kept. The server commits to a random 32-byte seed (commitment = SHA-256(serverSeed)) BEFORE grinding, mixes in your optional clientSeed, derives each candidate deterministically (HMAC-SHA256 → Ed25519), and signs the receipt with its long-lived service key (published at /.well-known/three-vanity.json). Pass sealTo=<X25519 public key> and the secret is ECIES-sealed to you — plaintext never appears in the response or any log. Verify entirely client-side with @three-ws/solana-agent verifyVanityReceipt(), the CLI, or three.ws/vanity/verify. Combined pattern capped at 3 Base58 chars, priced $0.02–$0.40; settlement runs only after a successful grind, so an exhausted budget costs nothing.',- mimeType: 'application/json',- serviceName: routeMeta.vanityVerifiable.serviceName,- tags: routeMeta.vanityVerifiable.tags,- iconUrl: routeMeta.vanityVerifiable.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { prefix: 'So', suffix: '', ignoreCase: '0', sealTo: '' },- inputSchema: {- type: 'object',- anyOf: [{ required: ['prefix'] }, { required: ['suffix'] }],- properties: {- prefix: {- type: 'string',- maxLength: 3,- description:- 'Base58 characters the address must start with (excludes 0, O, I, l). Combined with suffix, max 3.',- },- suffix: {- type: 'string',- maxLength: 3,- description:- 'Base58 characters the address must end with. Combined with prefix, max 3.',- },- ignoreCase: {- type: 'string',- enum: ['0', '1', 'true', 'false'],- description:- 'When 1/true, match case-insensitively (faster, less specific).',- },- sealTo: {- type: 'string',- description:- 'Recommended. Your 32-byte X25519 public key (Base58/Base64url/hex). When set, the secret is ECIES-sealed to it and omitted from the response.',- },- },- },- }),- };- })(),- (() => {- // Premium vanity inventory: buy a PRE-GROUND long (4–5+ char)- // brandable address from stock, delivered instantly once. Price- // scales per item ($1–$50); the catalog advertises the $1 floor tier- // ('1000000') while the live 402 quotes the exact price for the- // requested address. Distinct from /api/x402/vanity (live <=3-char- // grind) — this tier sells addresses too rare to grind on demand.- const url = `${origin}/api/x402/vanity-premium`;- const accepts = acceptsForPrice('1000000', url);- return {- path: '/api/x402/vanity-premium',- url,- method: 'GET',- description:- 'Premium Vanity Inventory — buy a PRE-GROUND Solana address with a long (4–5+ char) brandable prefix, delivered instantly from stock. Browse available patterns and prices with a plain GET; buy one with GET ?address=<base58> via x402 (USDC on Base or Solana). Price scales with grind difficulty ($1–$50). The key is delivered exactly ONCE and its stored ciphertext is destroyed on delivery (delete-after-reveal). Optional sealTo=<X25519 public key> seals the key to you so plaintext never appears in the response. CUSTODY: keys are platform-generated — use one as a token MINT address or sweep assets to self-generated custody, not as a long-term treasury. Distinct from the live /api/x402/vanity grinder (fresh <=3-char keypair per request) — this tier sells rarer addresses too slow to grind on demand.',- mimeType: 'application/json',- serviceName: routeMeta.vanityPremium.serviceName,- tags: routeMeta.vanityPremium.tags,- iconUrl: routeMeta.vanityPremium.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { address: '<base58 from the listing>' },- inputSchema: {- type: 'object',- properties: {- address: {- type: 'string',- description:- 'A Base58 address from the premium inventory listing (GET with no address to browse). Buys that exact pre-ground address.',- },- sealTo: {- type: 'string',- description:- 'Optional. Your 32-byte X25519 public key (Base58/Base64url/hex) to receive the key ECIES-sealed — plaintext never appears in the response.',- },- },- },- }),- };- })(),- (() => {- // Permit2-only demo: skip the EIP-3009 entry that acceptsForPrice- // would push first, so SDK clients are forced through the gasless- // EIP-2612 → settleWithPermit path the endpoint is meant to prove.- // permit2VariantOf returns null without CDP creds, in which case we- // omit the resource from discovery (matches the runtime 402 behavior).- const url = `${origin}/api/x402/permit2-paid-demo`;- const price = RAW_AMOUNT_TO_USDC('1000');- const baseAccept = env.X402_PAY_TO_BASE- ? {- scheme: 'exact',- network: NETWORK_BASE_MAINNET,- network_label: 'base-mainnet',- amount: '1000',- price,- payTo: env.X402_PAY_TO_BASE,- asset: env.X402_ASSET_ADDRESS_BASE,- asset_symbol: 'USDC',- maxTimeoutSeconds: 60,- resource: url,- extra: { name: 'USD Coin', version: '2', decimals: 6 },- }- : null;- const permit2 = baseAccept ? permit2VariantOf(baseAccept) : null;- if (!permit2) return null;- const accepts = [permit2];- return {- path: '/api/x402/permit2-paid-demo',- url,- method: 'GET',- description:- "Permit2 + EIP-2612 Gas Sponsoring Demo — forces the gasless Permit2 path so a fresh wallet holding USDC but ZERO ETH can complete the flow. CDP's x402ExactPermit2Proxy submits the EIP-2612 permit + Permit2 transfer atomically via settleWithPermit. Response surfaces the on-chain tx hash and a Basescan link.",- mimeType: 'application/json',- serviceName: routeMeta.permit2Demo.serviceName,- tags: routeMeta.permit2Demo.tags,- iconUrl: routeMeta.permit2Demo.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: {},- inputSchema: {- type: 'object',- properties: {},- additionalProperties: false,- },- }),- };- })(),- (() => {- // Asset Bazaar advertises a representative price ($0.10 USDC =- // 100_000 atomics); the live 402 challenge always reflects the- // per-asset row from the paid_assets table. The discovery entry- // is a placeholder so the Bazaar indexer can find the route;- // per-asset listings would explode the catalog and aren't worth- // the noise here. The `?slug=<slug>` query param is documented- // in the input schema so crawlers know how to drive it.- const url = `${origin}/api/x402/asset-download`;- const accepts = acceptsForPrice('100000', url);- return {- path: '/api/x402/asset-download',- url,- method: 'GET',- description:- 'three.ws Asset Bazaar — pay once in USDC to unlock a 3D asset (GLB, avatar, or accessory) hosted on R2. Wallets that have already paid can re-download for free by signing in with SIWX (CAIP-122). Each asset has its own price and creator payout address; the response carries a short-lived presigned R2 URL the client uses to fetch the file directly.',- mimeType: 'application/json',- serviceName: routeMeta.assetDownload.serviceName,- tags: routeMeta.assetDownload.tags,- iconUrl: routeMeta.assetDownload.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { slug: 'pole-dancer-rumba' },- inputSchema: {- type: 'object',- required: ['slug'],- properties: {- slug: {- type: 'string',- minLength: 1,- maxLength: 128,- description:- 'Unique asset slug from the paid_assets catalog.',- },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/skill-call`;- // Per-call price is set per skill from marketplace_skills; advertise- // a representative $0.01 so facilitators can index the route.- const accepts = acceptsForPrice('10000', url);- return {- path: '/api/x402/skill-call',- url,- method: 'GET',- description:- "three.ws Skill Call — pay the per-call price of a marketplace skill in USDC (Base or Solana) and receive its executable payload: the tool schema and content the calling agent runs. Payment settles straight to the skill author's wallet. Per-call pricing — every invocation is a fresh payment.",- mimeType: 'application/json',- serviceName: routeMeta.skillCall.serviceName,- tags: routeMeta.skillCall.tags,- iconUrl: routeMeta.skillCall.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { skill: 'wallet-balance' },- inputSchema: {- type: 'object',- required: ['skill'],- properties: {- skill: {- type: 'string',- minLength: 1,- maxLength: 128,- description:- 'Unique skill slug from the marketplace_skills catalog.',- },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/token-intel`;- const accepts = acceptsForPrice('10000', url);- return {- path: '/api/x402/token-intel',- url,- method: 'GET',- description:- 'three.ws Token Oracle — pay $0.01 USDC per call for live market intel on ANY token by contract address: price, 24 h change, market cap, liquidity, 24 h volume, and a bullish / bearish / neutral signal with a two-sentence rationale. Pass ?mint=<contract-address> (Solana mint or EVM 0x). The mint is supplied at runtime — generic coin-agnostic plumbing. Powered by live DexScreener data; this is the paid endpoint the CA-to-x402 resolver generates.',- mimeType: 'application/json',- serviceName: routeMeta.tokenIntel.serviceName,- tags: routeMeta.tokenIntel.tags,- iconUrl: routeMeta.tokenIntel.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { mint: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump' },- inputSchema: {- type: 'object',- required: ['mint'],- properties: {- mint: {- type: 'string',- description:- 'Token contract address — Solana base58 mint or EVM 0x address.',- },- },- },- }),- };- })(),- (() => {- // Avatar Shop pricing is per-rarity ($0.25 common → $3.00- // legendary). The catalog advertises the rare tier ('500000' =- // $0.50) as a representative price; the live 402 challenge always- // quotes the exact USDC amount for the requested cosmetic id.- const url = `${origin}/api/x402/cosmetic-purchase`;- const accepts = acceptsForPrice('500000', url);- return {- path: '/api/x402/cosmetic-purchase',- url,- method: 'GET',- description:- 'three.ws Avatar Shop — pay once in USDC to unlock a premium avatar cosmetic (skin or emote) for an account. Pay on Base or Solana; the cosmetic is recorded to the buyer-specified account and is wearable across /play and /walk. Wallets that already purchased an item re-confirm for free by signing in with SIWX (CAIP-122). Price varies by rarity ($0.25–$3.00 USDC).',- mimeType: 'application/json',- serviceName: routeMeta.avatarShop.serviceName,- tags: routeMeta.avatarShop.tags,- iconUrl: routeMeta.avatarShop.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { id: 'skin-midnight', account: 'g_5f3c9a21b8' },- inputSchema: {- type: 'object',- required: ['id', 'account'],- properties: {- id: {- type: 'string',- minLength: 1,- maxLength: 64,- description:- 'Premium cosmetic id from /api/cosmetics/catalog.',- },- account: {- type: 'string',- minLength: 3,- maxLength: 64,- description:- 'Account the cosmetic is granted to — a Solana wallet address or a guest id (g_…).',- },- },- },- }),- };- })(),- (() => {- // Animation price is per-animation (from DB); advertise a- // representative $0.01 so facilitators can index the route.- const url = `${origin}/api/x402/animation-download`;- const accepts = acceptsForPrice('10000', url);- return {- path: '/api/x402/animation-download',- url,- method: 'GET',- description:- 'three.ws Animation Bazaar — pay once in USDC to unlock a 3D avatar animation (GLB). Each animation has its own price; the response carries a short-lived presigned URL the client fetches directly. Wallets that have already paid can re-download for free by signing in with SIWX.',- mimeType: 'application/json',- serviceName: routeMeta.animationDownload.serviceName,- tags: routeMeta.animationDownload.tags,- iconUrl: routeMeta.animationDownload.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: { id: 'pole-dancer-rumba' },- inputSchema: {- type: 'object',- required: ['id'],- properties: {- id: {- type: 'string',- minLength: 1,- maxLength: 128,- description: 'Animation slug or UUID from the animations catalog.',- },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/club-cover`;- const accepts = acceptsForPrice('10000', url);- return {- path: '/api/x402/club-cover',- url,- method: 'GET',- description:- 'three.ws Pole Club Cover Charge — pay $0.01 USDC to access the three.ws Pole Club. Once the payment settles the caller receives an entry token granting access to the live club scene for 24 hours.',- mimeType: 'application/json',- serviceName: routeMeta.clubCover.serviceName,- tags: routeMeta.clubCover.tags,- iconUrl: routeMeta.clubCover.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: {},- inputSchema: { type: 'object', properties: {} },- }),- };- })(),- // Platform-operations + autonomous-loop paid endpoints. Each is a- // real x402-gated route (paidEndpoint / send402) that powers the- // self-running platform — health canaries, analytics oracles, the- // LLM proxy, the bazaar/feed monitors. Cataloged here so x402- // indexers (CDP Bazaar / agentic.market / x402scan) can find them.- (() => {- const url = `${origin}/api/x402/analytics`;- const accepts = acceptsForPrice('5000', url);- return {- path: '/api/x402/analytics',- url,- method: 'POST',- description:- 'three.ws Economy Analytics — pay $0.005 USDC per call for a live, aggregated view of platform activity. "clubs": Pole Club economy — active stages, patrons, tip volume, cover charges, fastest-growing leaderboard. "agent_leaderboard": top agents by USDC spend over a trailing window. "marketplace": catalog stats — active listing count, price distribution normalised to USD + SOL at the live rate, new listings in the window, and the most-viewed / most-forked listing. All numbers are read live from the real ledgers and catalog tables.',- mimeType: 'application/json',- serviceName: routeMeta.analytics.serviceName,- tags: routeMeta.analytics.tags,- iconUrl: routeMeta.analytics.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { report: 'clubs', period: '24h' },- inputSchema: {- type: 'object',- properties: {- report: {- type: 'string',- enum: ['clubs', 'agent_leaderboard', 'marketplace', 'revenue', 'sniper_trades', 'user_activity', 'x402_volume'],- default: 'clubs',- },- period: { type: 'string', enum: ['1h', '6h', '24h', '7d', '30d', 'all'], default: '24h' },- limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },- window_days: { type: 'integer', minimum: 1, maximum: 90, default: 7 },- network: { type: 'string', enum: ['mainnet', 'devnet', 'all'], default: 'mainnet' },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/api-key-health`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/api-key-health',- url,- method: 'POST',- description:- 'API Key Validity Health Check — verifies that the platform has a valid, non-expired access key covering a given scope. Checks x402 subscription keys and the internal service key. Returns valid, scopes, expires_at, and key_type. Used by the autonomous loop to confirm its access lane is healthy before each tick. Pay-per-call in USDC on Solana or Base mainnet.',- mimeType: 'application/json',- serviceName: routeMeta.apiKeyHealth.serviceName,- tags: routeMeta.apiKeyHealth.tags,- iconUrl: routeMeta.apiKeyHealth.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { scope: 'autonomous_loop' },- inputSchema: {- type: 'object',- properties: { scope: { type: 'string', default: 'autonomous_loop' } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/auth-health`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/auth-health',- url,- method: 'POST',- description:- 'Auth Session Lifecycle Health — pay $0.001 USDC to exercise the full JWT auth session lifecycle: create, validate, refresh, and expiry-rejection. Returns { all_pass, failed_step, latency_ms } so a monitoring loop can detect a broken auth subsystem before users do.',- mimeType: 'application/json',- serviceName: routeMeta.authHealth.serviceName,- tags: routeMeta.authHealth.tags,- iconUrl: routeMeta.authHealth.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { mode: 'session_lifecycle' },- inputSchema: {- type: 'object',- properties: { mode: { type: 'string', enum: ['session_lifecycle'], default: 'session_lifecycle' } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/avatar-optimize-batch`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/avatar-optimize-batch',- url,- method: 'POST',- description:- 'three.ws Avatar Optimization Pipeline — pay $0.001 USDC to trigger a batch glTF/GLB analysis of the top most-viewed public avatars. Returns a ranked list of optimization suggestions (Draco/Meshopt compression, oversized textures, non-indexed primitives) and stores results per-avatar so owners can be notified of actionable improvements.',- mimeType: 'application/json',- serviceName: routeMeta.avatarOptimizeBatch.serviceName,- tags: routeMeta.avatarOptimizeBatch.tags,- iconUrl: routeMeta.avatarOptimizeBatch.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { limit: 50 },- inputSchema: {- type: 'object',- properties: { limit: { type: 'integer', minimum: 1, maximum: 50, default: 50 } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/pipeline-rig`;- const accepts = acceptsForPrice('50000', url);- return {- path: '/api/x402/pipeline-rig',- url,- method: 'POST',- description:- '3D Asset Pipeline — Rig: pay $0.05 USDC to make a static GLB animation-ready. A humanoid skeleton is inferred and bound to the mesh with skin weights so the model can walk, wave, and emote. POST a public glb_url; get back a durable first-party rigged GLB URL. No other x402 resource rigs a mesh.',- mimeType: 'application/json',- serviceName: routeMeta.pipelineRig.serviceName,- tags: routeMeta.pipelineRig.tags,- iconUrl: routeMeta.pipelineRig.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { glb_url: 'https://three.ws/forge/character.glb', rig_type: 'biped' },- inputSchema: {- type: 'object',- required: ['glb_url'],- properties: {- glb_url: { type: 'string', format: 'uri', description: 'Public HTTPS URL of the static .glb mesh to rig.' },- rig_type: { type: 'string', enum: ['biped', 'quadruped'], default: 'biped' },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/pipeline-remesh`;- const accepts = acceptsForPrice('30000', url);- return {- path: '/api/x402/pipeline-remesh',- url,- method: 'POST',- description:- '3D Asset Pipeline — Remesh: pay $0.03 USDC to retopologize a GLB. Triangle, quad, or low-poly remeshing plus repair and decimation to a target face count, with the texture re-baked onto the new topology. POST a public glb_url and options; get back a durable first-party GLB URL.',- mimeType: 'application/json',- serviceName: routeMeta.pipelineRemesh.serviceName,- tags: routeMeta.pipelineRemesh.tags,- iconUrl: routeMeta.pipelineRemesh.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { glb_url: 'https://three.ws/forge/sample.glb', remesh_mode: 'quad', target_faces: 20000 },- inputSchema: {- type: 'object',- required: ['glb_url'],- properties: {- glb_url: { type: 'string', format: 'uri', description: 'Public HTTPS URL of the source .glb mesh.' },- remesh_mode: { type: 'string', enum: ['triangle', 'quad', 'lowpoly'], default: 'triangle' },- operation: { type: 'string', enum: ['full', 'simplify', 'repair', 'convert'], default: 'full' },- target_faces: { type: 'integer', minimum: 1000, maximum: 500000, default: 50000 },- texture_size: { type: 'integer', enum: [512, 1024, 2048], default: 1024 },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/pipeline-gameready`;- const accepts = acceptsForPrice('30000', url);- return {- path: '/api/x402/pipeline-gameready',- url,- method: 'POST',- description:- '3D Asset Pipeline — Game-Ready: pay $0.03 USDC to make a GLB engine-ready. The mesh is retopologized to a fixed polygon budget (quad QuadriFlow or silhouette-preserving low-poly) with PBR re-baked onto the new topology. POST a public glb_url + poly_budget; get back a durable first-party GLB URL.',- mimeType: 'application/json',- serviceName: routeMeta.pipelineGameready.serviceName,- tags: routeMeta.pipelineGameready.tags,- iconUrl: routeMeta.pipelineGameready.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { glb_url: 'https://three.ws/forge/prop.glb', topology: 'quad', poly_budget: 12000 },- inputSchema: {- type: 'object',- required: ['glb_url'],- properties: {- glb_url: { type: 'string', format: 'uri', description: 'Public HTTPS URL of the source .glb mesh.' },- topology: { type: 'string', enum: ['quad', 'tri'], default: 'quad' },- poly_budget: { type: 'integer', minimum: 1000, maximum: 500000, default: 15000 },- texture_size: { type: 'integer', enum: [1024, 2048], default: 1024 },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/pipeline-stylize`;- const accepts = acceptsForPrice('30000', url);- return {- path: '/api/x402/pipeline-stylize',- url,- method: 'POST',- description:- '3D Asset Pipeline — Stylize: pay $0.03 USDC to geometrically restyle a GLB. Voxel, brick, Voronoi-shatter, or faceted low-poly filters that rebuild the mesh itself (not a shader), so the look survives export to any engine. POST a public glb_url + style; get back a durable first-party GLB URL.',- mimeType: 'application/json',- serviceName: routeMeta.pipelineStylize.serviceName,- tags: routeMeta.pipelineStylize.tags,- iconUrl: routeMeta.pipelineStylize.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { glb_url: 'https://three.ws/forge/statue.glb', style: 'voxel', resolution: 48 },- inputSchema: {- type: 'object',- required: ['glb_url'],- properties: {- glb_url: { type: 'string', format: 'uri', description: 'Public HTTPS URL of the source .glb mesh.' },- style: { type: 'string', enum: ['voxel', 'brick', 'voronoi', 'lowpoly'], default: 'voxel' },- resolution: { type: 'integer', description: 'Style density, clamped per filter.' },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/pipeline-rembg`;- const accepts = acceptsForPrice('10000', url);- return {- path: '/api/x402/pipeline-rembg',- url,- method: 'POST',- description:- '3D Asset Pipeline — Background Removal: pay $0.01 USDC to strip the background from an image, returning a transparent PNG — the clean reference view image→3D reconstruction needs so it never bakes a room into the mesh. POST a public image_url; get back a durable first-party PNG URL.',- mimeType: 'application/json',- serviceName: routeMeta.pipelineRembg.serviceName,- tags: routeMeta.pipelineRembg.tags,- iconUrl: routeMeta.pipelineRembg.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { image_url: 'https://three.ws/uploads/photo.jpg', model: 'rmbg2' },- inputSchema: {- type: 'object',- required: ['image_url'],- properties: {- image_url: { type: 'string', format: 'uri', description: 'Public HTTPS URL of the source image (PNG, JPEG, WEBP, or GIF).' },- model: { type: 'string', enum: ['rmbg2', 'u2net', 'isnet', 'u2net_human_seg', 'silueta'], default: 'rmbg2' },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/bazaar-feed`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/bazaar-feed',- url,- method: 'POST',- description:- 'Bazaar Feed — pay $0.001 USDC per call for two live views of the x402 service marketplace. filter "new"/"active": newest service listings (id, name, price, networks, tags, first_seen) plus category rollup and listing-velocity signal (spike/active/quiet). filter "price_trends": 24h price-movement across all tracked services — trending up/down/stable and net market pressure as bullish/bearish/neutral. Live data from the platform bazaar index.',- mimeType: 'application/json',- serviceName: routeMeta.bazaarFeed.serviceName,- tags: routeMeta.bazaarFeed.tags,- iconUrl: routeMeta.bazaarFeed.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { filter: 'new', limit: 10 },- inputSchema: {- type: 'object',- properties: {- filter: { type: 'string', enum: ['new', 'active', 'price_trends'], default: 'new' },- limit: { type: 'integer', minimum: 1, maximum: 50, default: 10 },- period: { type: 'string', default: '24h' },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/billboard`;- const accepts = acceptsForPrice('50000', url);- return {- path: '/api/x402/billboard',- url,- method: 'GET',- description:- 'three.ws coin worlds — feature your content on a 3D world’s billboard. Pay once to hold the framed panel behind spawn: pass the coin-world mint plus an image URL and/or a short caption. The coin world renders your placement in place of its default content for everyone who walks in until the slot expires. It is a paid content canvas, not an ad unit — nothing is targeted or tracked.',- mimeType: 'application/json',- serviceName: routeMeta.billboard.serviceName,- tags: routeMeta.billboard.tags,- iconUrl: routeMeta.billboard.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: {- coin: 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump',- image: 'https://three.ws/og-image.png',- caption: 'gm from the gallery',- },- inputSchema: {- type: 'object',- required: ['coin'],- properties: {- coin: { type: 'string', pattern: '^[1-9A-HJ-NP-Za-km-z]{32,44}$' },- image: { type: 'string', format: 'uri' },- caption: { type: 'string', maxLength: 80 },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/cross-chain`;- const accepts = acceptsForPrice('5000', url);- return {- path: '/api/x402/cross-chain',- url,- method: 'POST',- description:- 'Cross-Chain Bridge Status Monitor — pay $0.005 USDC to receive the live operational status and latency of major Solana bridge providers (Wormhole, Li.Fi, deBridge). Any bridge with status=down is flagged as a platform risk.',- mimeType: 'application/json',- serviceName: routeMeta.crossChain.serviceName,- tags: routeMeta.crossChain.tags,- iconUrl: routeMeta.crossChain.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { mode: 'bridge_status' },- inputSchema: {- type: 'object',- properties: { mode: { type: 'string', enum: ['bridge_status'], default: 'bridge_status' } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/did`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/did',- url,- method: 'POST',- description:- "DID Verification Canary — pay $0.001 USDC to resolve three.ws's published W3C DID document over its real public route, structurally validate it, and measure end-to-end resolution latency. Returns { verified, latency_ms } plus a per-check breakdown. verified=false when the document is unreachable, malformed, or slower than 1500ms — the same failure an external x402 verifier would hit resolving our offer/receipt signing key.",- mimeType: 'application/json',- serviceName: routeMeta.did.serviceName,- tags: routeMeta.did.tags,- iconUrl: routeMeta.did.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { did: 'did:three:canary', mode: 'verify' },- inputSchema: {- type: 'object',- properties: {- did: { type: 'string', default: 'did:three:canary' },- mode: { type: 'string', enum: ['verify'], default: 'verify' },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/feed-health`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/feed-health',- url,- method: 'POST',- description:- 'three.ws Feed Health Validator — fetches a named public feed (changelog RSS, sitemap, etc.) and returns a structural health verdict: { valid, item_count, latest_title }. Pays $0.001 USDC per check. Supported feeds: changelog_rss. The latest_title is cross-checked against the canonical changelog record so both a broken XML feed and a stale/diverged feed surface as valid:false.',- mimeType: 'application/json',- serviceName: routeMeta.feedHealth.serviceName,- tags: routeMeta.feedHealth.tags,- iconUrl: routeMeta.feedHealth.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { feed: 'changelog_rss' },- inputSchema: {- type: 'object',- required: ['feed'],- properties: { feed: { type: 'string', enum: ['changelog_rss'] } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/llm-proxy`;- const accepts = acceptsForPrice('5000', url);- return {- path: '/api/x402/llm-proxy',- url,- method: 'POST',- description:- "three.ws LLM Inference Proxy — pay per completion with no API key required. Runs one-shot text prompts through the platform's free-first provider chain. Response includes measured latency, token counts, and the provider actually used. Ideal for latency benchmarking, agent pipelines, and one-off completions. Model aliases: \"fast\" (sub-second) · \"smart\" (quality backstop). Price: $0.005 USDC per completion on Base or Solana.",- mimeType: 'application/json',- serviceName: routeMeta.llmProxy.serviceName,- tags: routeMeta.llmProxy.tags,- iconUrl: routeMeta.llmProxy.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { model: 'fast', prompt: 'Count to 3.', max_tokens: 10 },- inputSchema: {- type: 'object',- required: ['prompt'],- properties: {- model: { type: 'string', default: 'fast' },- prompt: { type: 'string', minLength: 1, maxLength: 4000 },- max_tokens: { type: 'integer', minimum: 1, maximum: 2048, default: 256 },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/mcp-tool-catalog`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/mcp-tool-catalog',- url,- method: 'POST',- description:- 'three.ws MCP Tool Discovery — pay $0.001 USDC to discover MCP tools that were registered (or whose price/shape changed, or that were removed) on the three.ws MCP server since you last probed. Returns the diff against a durable tool registry so agents can feature-flag new capabilities the moment they ship instead of re-fetching and diffing tools/list themselves.',- mimeType: 'application/json',- serviceName: routeMeta.mcpToolCatalog.serviceName,- tags: routeMeta.mcpToolCatalog.tags,- iconUrl: routeMeta.mcpToolCatalog.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { mode: 'discover' },- inputSchema: {- type: 'object',- additionalProperties: false,- properties: { mode: { type: 'string', enum: ['discover', 'sync', 'list'], default: 'discover' } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/model-validation-sweep`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/model-validation-sweep',- url,- method: 'POST',- description:- 'three.ws model quality sweep — picks the next public GLB avatar in the database that has never been inspected (or whose inspection is older than 24 hours), downloads the file, runs the glTF-Transform inspector, computes a 0-100 quality score, and records a time-series row. Use to proactively detect geometry errors, missing rigs, and unsupported features before users encounter them in the viewer.',- mimeType: 'application/json',- serviceName: routeMeta.modelValidationSweep.serviceName,- tags: routeMeta.modelValidationSweep.tags,- iconUrl: routeMeta.modelValidationSweep.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: {},- inputSchema: { type: 'object', additionalProperties: false, properties: {} },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/notify`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/notify',- url,- method: 'POST',- description:- 'Notification Delivery Probe — pay $0.001 USDC to send a canary message through the platform notification channel and confirm delivery. Returns { delivered, channel, latency_ms } so the autonomous loop can assert the notification subsystem is alive within a 2-second SLA. Channel "canary" is the x402 loop heartbeat lane; "ops" and "system" route to the ops alert surface.',- mimeType: 'application/json',- serviceName: routeMeta.notify.serviceName,- tags: routeMeta.notify.tags,- iconUrl: routeMeta.notify.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { channel: 'canary', message: 'x402 loop heartbeat', priority: 'low' },- inputSchema: {- type: 'object',- properties: {- channel: { type: 'string', enum: ['canary', 'ops', 'system'], default: 'canary' },- message: { type: 'string', maxLength: 500, default: 'x402 loop heartbeat' },- priority: { type: 'string', enum: ['low', 'normal', 'high'], default: 'low' },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/pay-by-name`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/pay-by-name',- url,- method: 'POST',- description:- 'Pay-By-Name Resolution — pay $0.001 USDC to resolve a wallet name (@username, a *.sol name, or a raw base58 address) to a verified on-chain Solana address via the three.ws pay-by-name registry. Returns the resolved address, an on-curve verification flag, and the resolution source.',- mimeType: 'application/json',- serviceName: routeMeta.payByName.serviceName,- tags: routeMeta.payByName.tags,- iconUrl: routeMeta.payByName.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { name: 'nich.threews.sol' },- inputSchema: {- type: 'object',- required: ['name'],- properties: { name: { type: 'string', description: '@username, a *.sol name, or a base58 address.' } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/rate-limit-probe`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/rate-limit-probe',- url,- method: 'POST',- description:- 'Rate-Limit Capacity Probe — pay $0.001 USDC to learn how many more calls the x402 autonomous loop can make to a target endpoint today before hitting its daily USDC spend cap. Returns remaining_calls, reset_at, and cooldown_active so agents can throttle dynamically instead of discovering the cap by failure.',- mimeType: 'application/json',- serviceName: routeMeta.rateLimitProbe.serviceName,- tags: routeMeta.rateLimitProbe.tags,- iconUrl: routeMeta.rateLimitProbe.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { endpoint: '/api/x402/forge' },- inputSchema: {- type: 'object',- required: ['endpoint'],- properties: { endpoint: { type: 'string', pattern: '^/api/' } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/schema-check`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/schema-check',- url,- method: 'POST',- description:- 'three.ws JSON API schema conformance checker — pay $0.001 USDC to fetch a named three.ws public API and validate its response against the declared schema. Surfaces breaking schema changes before users notice a broken feed. Current target: changelog_json — the /changelog.json feed holders and RSS consumers depend on. Returns { valid, version, entry_count, schema_errors }.',- mimeType: 'application/json',- serviceName: routeMeta.schemaCheck.serviceName,- tags: routeMeta.schemaCheck.tags,- iconUrl: routeMeta.schemaCheck.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { api: 'changelog_json' },- inputSchema: {- type: 'object',- required: ['api'],- additionalProperties: false,- properties: { api: { type: 'string', enum: ['changelog_json'] } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/solana-register-health`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/solana-register-health',- url,- method: 'GET',- description:- "Solana Agent Registration Health Check — verifies three.ws's server-custodial Solana agent-registration subsystem end-to-end by resolving a known canary agent's on-chain Metaplex Agent Registry record (Identity PDA + Core asset) and confirming both accounts exist on-chain right now. Returns a health snapshot with latency and the checked asset. Pay-per-call in USDC on Solana or Base mainnet.",- mimeType: 'application/json',- serviceName: routeMeta.solanaRegisterHealth.serviceName,- tags: routeMeta.solanaRegisterHealth.tags,- iconUrl: routeMeta.solanaRegisterHealth.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'GET',- discoverable: true,- input: {},- inputSchema: { type: 'object', properties: {} },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/spend-session`;- const accepts = acceptsForPrice('10000', url);- return {- path: '/api/x402/spend-session',- url,- method: 'POST',- description:- 'three.ws Spend Session Health — pay $0.01 USDC to probe the Agent Payment Sessions governance layer. mode:"canary" creates a canary session row and immediately consumes it, returning { created, consumed, latency_ms } — the most important health check for the x402 governance layer. mode:"audit" returns a live aggregate snapshot of all payment sessions (active count, remaining budget, expired_count_24h). Pay-per-call in USDC on Solana mainnet.',- mimeType: 'application/json',- serviceName: routeMeta.spendSession.serviceName,- tags: routeMeta.spendSession.tags,- iconUrl: routeMeta.spendSession.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { mode: 'canary', budget: 0.01 },- inputSchema: {- type: 'object',- properties: {- mode: { type: 'string', enum: ['canary', 'audit'], default: 'canary' },- budget: { type: 'number', minimum: 0 },- },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/telegram-health`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/telegram-health',- url,- method: 'POST',- description:- 'Changelog Telegram Bot Health Check — pays $0.001 USDC to verify that the three.ws platform bot can reach the Telegram API and is alive. Returns { reachable, bot_id, bot_username, latency_ms }. If unreachable, new changelog entries will not reach $THREE holders until the bot is restored.',- mimeType: 'application/json',- serviceName: routeMeta.telegramHealth.serviceName,- tags: routeMeta.telegramHealth.tags,- iconUrl: routeMeta.telegramHealth.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { bot: 'changelog' },- inputSchema: {- type: 'object',- required: ['bot'],- additionalProperties: false,- properties: { bot: { type: 'string', enum: ['changelog'] } },- },- }),- };- })(),- (() => {- const url = `${origin}/api/x402/wallet-connect`;- const accepts = acceptsForPrice('1000', url);- return {- path: '/api/x402/wallet-connect',- url,- method: 'POST',- description:- 'Wallet Connection Session Health Check — probes the SIWS (Sign-In With Solana) session initiation path: issues a real nonce challenge against the platform auth gateway, validates its structure and expiry, and measures roundtrip latency. Returns { session_created, latency_ms }. Pay-per-call in USDC on Solana or Base mainnet.',- mimeType: 'application/json',- serviceName: routeMeta.walletConnect.serviceName,- tags: routeMeta.walletConnect.tags,- iconUrl: routeMeta.walletConnect.iconUrl,- accepts,- extensions: extensionsForAccepts(accepts, {- method: 'POST',- discoverable: true,- input: { mode: 'health' },- inputSchema: {- type: 'object',- required: ['mode'],- properties: { mode: { type: 'string', enum: ['health'] } },- },- }),- };- })(),+ // Every static /api/x402/* entry (model-check through wallet-connect),+ // generated from the unified service catalog in catalog order. Editing+ // a listing = editing api/_lib/service-catalog/services/<slug>.js.+ ...x402CatalogItems,// USE-13: one Bazaar catalog row per priced MCP tool. The shared// `/api/mcp` and `/api/mcp-3d` resources above are the transport// entries; these are the individual paid tools facilitatorsdiff --git a/data/changelog.json b/data/changelog.jsonindex c74b8171e..88d0eea4a 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,16 @@{"$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-07",+ "title": "Unified service catalog powering all agent storefronts",+ "summary": "Every service three.ws offers — the paid x402 endpoints, the free Crypto Data and 3D APIs, and the OKX.AI 3D Studio listings — is now described in one canonical catalog that every storefront renders from. Before, the same service could carry different descriptions on x402scan versus our own discovery doc versus OKX, and they quietly drifted apart. Now a listing is written once and projected everywhere, automated checks fail the build if any storefront ever disagrees with the catalog, and the 3D Asset Pipeline endpoint — which had been live but invisible to marketplace crawlers — is discoverable.",+ "tags": [+ "infra",+ "improvement"+ ],+ "link": "/docs/start-here"+ },{"date": "2026-07-07","title": "Refreshed our agent-marketplace profile and product descriptions",diff --git a/prompts/x402-overhaul/PROGRESS.md b/prompts/x402-overhaul/PROGRESS.mdindex 342ee0115..51615ea6d 100644--- a/prompts/x402-overhaul/PROGRESS.md+++ b/prompts/x402-overhaul/PROGRESS.md@@ -1932,3 +1932,84 @@ Deploy landed (~8 min after the previous check). Live `/.well-known/x402.json`:**65 clean / 0 warnings / 0 dropped by CDP/indexers.**Prompts 20 and 22 fully closed. Campaign remainder: prompt 21 only.++---++## 2026-07-07 — Prompt 21: Unified Service Catalog (one source of truth, two storefronts)++**Shipped.** `api/_lib/service-catalog/` — ONE canonical catalog every storefront renders+from. Listing metadata for the same route used to live in up to three drifting places+(endpoint `BAZAAR` exports, ~1,400 lines of hand-mirrored resource blocks in `api/wk.js`,+the OKX catalog); a listing is now written once.++- **Canonical catalog** `api/_lib/service-catalog/index.js`:+ - `getCatalog()` — 66 normalized entries merged from 4 imported (never duplicated)+ sources: 44 paid x402 descriptors + free crypto-catalog (9) + free 3d-catalog (2) ++ `okx-catalog.js` rows (11). Canonical shape: slug/title/category/useCase/free/status/+ method/path/endpoint/price{usd,atomics,networks}/serviceName/tags/description/+ schemas/storefronts/source.+ - `getByStorefront('x402scan'|'okx'|'crypto-index'|'3d-index')`.+ - `toBazaarDiscovery({origin, acceptsFor, extensionsForAccepts})` — emits every static+ `/api/x402/*` resource entry for `/.well-known/x402.json`; wk.js injects its env-aware+ accepts builders (`standard` | `cdp-bazaar` | `permit2-only`, the last returning null+ without CDP creds so permit2-paid-demo stays omitted exactly as at runtime).+ - `toOkxCatalog()` — reproduces `okx-catalog.js#catalogIndex()` BYTE-FOR-BYTE (deep-equal+ asserted in tests), so the OKX stream can point its module at ours with zero behavior+ change. `{include:'all'}` additionally projects all 44 paid x402 services into the OKX+ row schema with both description parts clamped to the 200-display-width rule.+ **Note to the OKX stream:** `toOkxCatalog()` is drop-in — import it from+ `api/_lib/service-catalog/index.js` whenever you want the expanded set.+- **Descriptors** `api/_lib/service-catalog/services/<slug>.js` (44 files + static-import+ barrel `services/index.js`, same production-bundling pattern as crypto-catalog): pure-data+ listings extracted faithfully from the live discovery doc. forge's descriptor imports the+ existing shared `forge-listing.js` + `forge-tiers.js` single sources instead of copying.+- **wk.js refactor** — the 43 hand-written IIFE resource blocks + the routeMeta map are+ gone (−1,540 lines; 3,198 → ~1,700): all static x402 entries now `...toBazaarDiscovery(…)`.+ MCP transport/tool rows and dynamic agent-published listings keep their existing single+ sources. `extensionsForAccepts` learned to pass a descriptor's `output` example through.+- **Parity proven** (snapshot A = pre-refactor doc, snapshot C = post): 0 field diffs on+ all 65 pre-existing resources (deep-equal keyed by path+toolName; only ordering change is+ model-check moving after the two MCP entries — indexers key on url/toolName). Service+ profile block byte-identical.+- **Bonus fix, proving the workflow:** `/api/x402/pipeline` (shipped live by another agent+ without a discovery entry — `tests/api/x402-discovery-parity.test.js` was already red on+ main) is now cataloged via `services/pipeline.js` + one barrel row, with its output+ example. That parity test is green again.+- **Docs**: `specs/SERVICE_CATALOG.md` (descriptor contract, projections, CI invariants),+ STRUCTURE.md row, `data/changelog.json` (infra+improvement) + `npm run build:pages` regen.++**Tests — `tests/service-catalog.test.js` (10 tests):** assembly (source counts, unique+slugs, canonical-field completeness, price shapes), descriptor hygiene (path=slug, ≤32-char+serviceName, ≤5 tags), storefront filters, toBazaarDiscovery order/omission with stub+builders, **no-drift** (renders the real wk.js discovery handler; asserts every catalog+entry is served with identical description/serviceName/tags/method/priceAtomics AND that no+un-cataloged static x402 resource is served), OKX strict deep-equality + all-mode width/shape.++```+npx vitest run tests/service-catalog.test.js tests/api/x402-discovery-parity.test.js+ Test Files 2 passed (2) Tests 17 passed (17)+npx vitest run tests/api/x402-discovery-green.test.js tests/x402-forge-listing.test.js \+ tests/x402-pump-launch-listing.test.js tests/okx-catalog.test.js \+ tests/api/x402-gas-sponsoring.test.js tests/api/x402-spec.test.js+ Test Files 6 passed (6) Tests 87 passed (87) (parity failure pre-dated this work; fixed)+Full suite: 11,343 passed | 3 failed — all 3 reproduce with this change stashed+(pre-existing, other streams: x402-ring-catalog missing api/v1/ai/* + pipeline-* rows,+token-market-single-flight, x402-pipeline partial-failure semantics).+```++**`scripts/verify-x402-discovery.mjs --file=<locally built doc>` (env-stubbed render):**++```+--- summary ---+ ✓ clean: 66+ ▲ warnings: 0+ ✗ will be DROPPED by CDP/indexers: 0+```++**Adjacent gaps noticed (for other prompts / future passes):**+- 402-challenge descriptions in a few endpoints (e.g. `api/x402/pump-launch.js`) still differ+ from the storefront listing copy — converge them by having endpoints import their+ descriptor (forge already does this via forge-listing.js).+- `tests/x402-ring-catalog.test.js` is red on main: the ring catalog lacks rows for the new+ `api/v1/ai/{asr,image,tts}.js` and the five `pipeline-*` stage routes — belongs to the+ ring-economy stream.diff --git a/public/changelog.json b/public/changelog.jsonindex d00b29440..d0b9bea9d 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-07T03:24:14.799Z",+ "generated_at": "2026-07-07T04:39:44.829Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -337,6 +337,17 @@"improvement"]},+ {+ "date": "2026-07-07",+ "type": "update",+ "title": "Unified service catalog powering all agent storefronts",+ "summary": "Every service three.ws offers — the paid x402 endpoints, the free Crypto Data and 3D APIs, and the OKX.AI 3D Studio listings — is now described in one canonical catalog that every storefront renders from. Before, the same service could carry different descriptions on x402scan versus our own discovery doc versus OKX, and they quietly drifted apart. Now a listing is written once and projected everywhere, automated checks fail the build if any storefront ever disagrees with the catalog, and the 3D Asset Pipeline endpoint — which had been live but invisible to marketplace crawlers — is discoverable.",+ "link": "/docs/start-here",+ "tags": [+ "infra",+ "improvement"+ ]+ },{"date": "2026-07-07","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex aa288044a..13ba44bfd 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -262,6 +262,14 @@<category>improvement</category><description>The agent-facing x402 catalog got a spring clean. Nine novelty and me-too endpoints that powered in-product experiences (the club stage, the town NPCs, demo pages) no longer appear as standalone products on x402scan and agentic.market — they keep working inside the product, but they were diluting the catalog and burying the tools agents actually use. What agents now find first: the free Crypto Data API and 3D API, Forge, the pump.fun launcher, vanity addresses, and cross-chain trust primitives.</description></item>+ <item>+ <title>Unified service catalog powering all agent storefronts</title>+ <link>https://three.ws/docs/start-here</link>+ <guid isPermaLink="false">2026-07-07:Unified service catalog powering all agent storefronts</guid>+ <pubDate>Tue, 07 Jul 2026 12:00:00 GMT</pubDate>+ <category>infra</category>+ <description>Every service three.ws offers — the paid x402 endpoints, the free Crypto Data and 3D APIs, and the OKX.AI 3D Studio listings — is now described in one canonical catalog that every storefront renders from. Before, the same service could carry different descriptions on x402scan versus our own discovery doc versus OKX, and they quietly drifted apart. Now a listing is written once and projected everywhere, automated checks fail the build if any storefront ever disagrees with the catalog, and the 3D Asset Pipeline endpoint — which had been live but invisible to marketplace crawlers — is discoverable.</description>+ </item><item><title>Vanity address grinder listing overhauled</title><link>https://three.ws/docs/vanity</link>diff --git a/public/features.json b/public/features.jsonindex a19a8857f..84bcf38a0 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-07T03:24:14.787Z",+ "generated_at": "2026-07-07T04:39:44.817Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/specs/SERVICE_CATALOG.md b/specs/SERVICE_CATALOG.mdnew file mode 100644index 000000000..323f31ade--- /dev/null+++ b/specs/SERVICE_CATALOG.md@@ -0,0 +1,120 @@+# Unified Service Catalog v1++The canonical, written-once record of every service three.ws sells or gives away, and the wire+formats the storefronts render from it. This is a load-bearing contract: the x402 discovery doc+(`/.well-known/x402.json`) and the OKX.AI listing are both projections of this catalog, and+`tests/service-catalog.test.js` fails the build on any drift between the catalog and what is+actually served.++- **Module:** [`api/_lib/service-catalog/index.js`](../api/_lib/service-catalog/index.js)+- **Descriptors:** [`api/_lib/service-catalog/services/*.js`](../api/_lib/service-catalog/services/)+- **Companion specs:** [okx-agent-payments.md](okx-agent-payments.md) (payment rails),+ x402 bazaar extension (see `api/_lib/x402/bazaar-helpers.js` header)++## Why++x402scan/agentic.market (Base) and OKX.AI (X Layer) are two storefronts over the same backend.+Before this catalog, the listing metadata for one service lived in up to three places: the+endpoint's `BAZAAR` export, a hand-mirrored resource block in `api/wk.js` (~1,400 lines of them),+and the OKX catalog. They drifted — the same route carried different descriptions on different+surfaces. Now a listing is one file; every storefront derives from it.++## The descriptor (one file per paid service)++`api/_lib/service-catalog/services/<slug>.js` default-exports one record:++| Field | Type | Meaning |+|---|---|---|+| `slug` | string | Route basename; `path` must equal `/api/x402/<slug>` |+| `title` | string | Human name without the `three.ws` prefix |+| `category` | string | Browse facet: `3d`, `trust`, `launch`, `market-data`, `payments`, `agent-infra` |+| `useCase` | string | One sentence: which agent, doing what task, uses this |+| `path`, `method` | string | The route and its primary verb |+| `free`, `status` | bool, `'live'\|'deprecated'` | Only `live` entries are projected |+| `priceAtomics` | string | USDC 6-decimal atomics advertised in discovery (env-overridable at the endpoint via `X402_PRICE_<SLUG>`) |+| `acceptsBuilder` | `'standard'\|'cdp-bazaar'\|'permit2-only'` | Which env-aware accepts builder `api/wk.js` applies (Solana+Base / +Arbitrum / Permit2-only-and-omit-without-CDP-creds) |+| `serviceName`, `tags` | string, string[] | Bazaar service metadata (≤32 ASCII chars; ≤5 tags) |+| `description` | string | THE listing description — written once here |+| `input`, `inputSchema` | any, JSON Schema | Example call + params schema for the bazaar discovery extension |+| `outputExample` | any | Response example (older entries are backfilled from `REST_OUTPUT_EXAMPLES` in `api/wk.js`) |+| `bazaar` | object | Optional pre-built `{discoverable, info, schema}` block, passed through verbatim (forge uses this — its shared `forge-listing.js` builds one with the output schema) |+| `storefronts` | string[] | Which storefronts list it (`x402scan` today) |++Descriptors are pure data (plus light imports from an existing single-source listing module,+never from an endpoint handler). The barrel `services/index.js` fixes production bundling and+discovery-doc order: **adding a service = adding the descriptor file + one import row.**++## The API++```js+import {+ getCatalog, // async → every service: paid x402 + free crypto/3D bundles + OKX rows+ getByStorefront, // async ('x402scan'|'okx'|'crypto-index'|'3d-index') → filtered view+ toBazaarDiscovery, // sync — the /api/x402/* resource entries for /.well-known/x402.json+ toOkxCatalog, // sync — the OKX.AI catalogIndex() payload+} from './api/_lib/service-catalog/index.js';+```++`getCatalog()` merges four sources — the paid descriptors above, `api/_lib/crypto-catalog`+(free Crypto Data API), `api/_lib/3d-catalog` (free 3D API), and `api/_lib/okx-catalog.js`+(OKX 3D Studio rows, read-only) — into one normalized shape:++```json+{+ "slug": "agent-reputation",+ "title": "Cross-chain Agent Reputation",+ "category": "trust",+ "useCase": "…one sentence…",+ "free": false,+ "status": "live",+ "method": "GET",+ "path": "/api/x402/agent-reputation",+ "endpoint": "https://three.ws/api/x402/agent-reputation",+ "price": { "usd": "0.01", "atomics": "10000", "networks": ["solana", "base"] },+ "serviceName": "Cross-chain Agent Reputation",+ "tags": ["reputation", "trust", "cross-chain", "agent", "x402"],+ "description": "…the one listing description…",+ "inputSchema": {},+ "storefronts": ["x402scan"],+ "source": "x402"+}+```++## Storefront projections++**x402scan** — `api/wk.js` calls `toBazaarDiscovery({ origin, acceptsFor, extensionsForAccepts })`+to emit every static `/api/x402/*` resource entry. The env-aware pieces stay in `wk.js`: it+injects `acceptsFor(service, url)` (settleable-rail gating per `acceptsBuilder`; returning `null`+omits the resource, which is how `permit2-paid-demo` disappears without CDP creds) and its+`extensionsForAccepts` normalizer. Everything content-shaped comes from the descriptor.+`node scripts/verify-x402-discovery.mjs` validates the result exactly as before.++**OKX.AI** — `toOkxCatalog()` returns, byte-for-byte, the payload `api/_lib/okx-catalog.js`'s+`catalogIndex()` serves today (asserted by deep-equality in tests), so the OKX stream can point+its module here with zero behavior change. `toOkxCatalog({ include: 'all' })` additionally+projects every live paid x402 service into the same row schema+(`{ id, name, kind, description: { capability, input }, price_usd, endpoint, input_schema }`),+with both description parts clamped to OKX's 200-display-width rule (`displayWidth`, East-Asian+wide glyphs count 2) — ready for a listing expansion beyond the 3D studio.++## Invariants (CI-enforced)++1. Every catalog `x402scan` entry appears in the rendered discovery doc with an **identical**+ description, serviceName, tags, method, and price — and the doc serves no static `/api/x402/*`+ resource the catalog doesn't know about (`tests/service-catalog.test.js`).+2. Every paid `/api/x402/*` route file is either cataloged or explicitly exempted with a reason+ (`tests/api/x402-discovery-parity.test.js`).+3. `toOkxCatalog()` ≡ `catalogIndex()`; projected rows respect the 200-width listing rule.+4. Descriptor hygiene: `path === /api/x402/<slug>`, description ≥ 60 chars, serviceName ≤ 32+ chars, ≤ 5 tags, numeric atomics.++## What stays outside the catalog++- **402-challenge internals** — each endpoint still owns its runtime challenge (its `BAZAAR`+ export, price env override, SIWX/OAuth hints). The catalog owns *listing* copy; storefront+ descriptions and challenge descriptions are converging per-route as endpoints adopt the+ descriptor as their import source (forge already does via `forge-listing.js`).+- **MCP tool rows** — generated from the live tool catalogs (`api/_mcp/catalog.js`,+ `api/_mcp3d/catalog.js`) in `api/wk.js`; they already have a single source.+- **Agent-published listings** (`/api/x402/service/<slug>`) — dynamic rows from+ `agent_paid_services`, cataloged per-listing at render time.diff --git a/tests/service-catalog.test.js b/tests/service-catalog.test.jsnew file mode 100644index 000000000..d7becac8f--- /dev/null+++ b/tests/service-catalog.test.js@@ -0,0 +1,208 @@+// Unified service catalog (api/_lib/service-catalog/) — the no-drift guards.+//+// One source of truth, two storefronts: the x402 discovery doc (api/wk.js)+// and the OKX.AI listing must both render from the catalog. These tests make+// drift a red build:+// • every catalog x402scan entry appears in the LIVE discovery doc with an+// identical description / serviceName / tags / price (the scattered-mirror+// drift the catalog was built to kill),+// • the OKX projection reproduces api/_lib/okx-catalog.js's catalogIndex()+// byte-for-byte, so the OKX stream can point at toOkxCatalog() with zero+// behavior change,+// • projected OKX rows respect the 200-display-width listing rule.++import { describe, it, expect } from 'vitest';++// Discovery env must be set BEFORE api/wk.js (and the env module it imports)+// loads — same stub set tests/api/x402-discovery-parity.test.js uses.+Object.assign(process.env, {+ APP_ORIGIN: 'https://three.ws',+ X402_PAY_TO_BASE: '0x0000000000000000000000000000000000000001',+ X402_PAY_TO_SOLANA: 'So11111111111111111111111111111111111111112',+ X402_ASSET_ADDRESS_BASE: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',+ X402_ASSET_MINT_SOLANA: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',+ X402_ASSET_ADDRESS_ARBITRUM: '0xaf88d065e77c8cC2239327C5EDb3A432268e5831',+ X402_MAX_AMOUNT_REQUIRED: '1000',+ X402_FEE_PAYER_SOLANA: 'So11111111111111111111111111111111111111112',+});++const {+ getCatalog,+ getByStorefront,+ toBazaarDiscovery,+ toOkxCatalog,+ priceUsdFromAtomics,+} = await import('../api/_lib/service-catalog/index.js');+const { PAID_SERVICES } = await import('../api/_lib/service-catalog/services/index.js');+const { catalogIndex, displayWidth, DESCRIPTION_MAX_WIDTH } = await import(+ '../api/_lib/okx-catalog.js'+);++async function renderDiscovery() {+ const mod = await import('../api/wk.js');+ const res = {+ statusCode: 0,+ headers: {},+ setHeader(k, v) {+ this.headers[k.toLowerCase()] = v;+ },+ end(body) {+ this.body = body;+ },+ };+ const req = {+ method: 'GET',+ url: '/.well-known/x402-discovery?name=x402-discovery',+ query: { name: 'x402-discovery' },+ headers: {},+ };+ await mod.default(req, res);+ return JSON.parse(res.body);+}++describe('catalog assembly', () => {+ it('merges every source with unique slugs and complete canonical fields', async () => {+ const all = await getCatalog();+ const bySource = (s) => all.filter((e) => e.source === s);+ expect(bySource('x402').length).toBe(PAID_SERVICES.length);+ expect(bySource('crypto-catalog').length).toBeGreaterThanOrEqual(9);+ expect(bySource('3d-catalog').length).toBeGreaterThanOrEqual(2);+ expect(bySource('okx').length).toBeGreaterThanOrEqual(10);+ expect(new Set(all.map((e) => e.slug)).size).toBe(all.length);+ for (const e of all) {+ for (const field of ['slug', 'title', 'category', 'useCase', 'method', 'path', 'endpoint', 'description']) {+ expect(e[field], `${e.slug}.${field}`).toBeTruthy();+ }+ expect(Array.isArray(e.tags) && e.tags.length >= 2, `${e.slug}.tags`).toBe(true);+ expect(Array.isArray(e.storefronts) && e.storefronts.length > 0, `${e.slug}.storefronts`).toBe(true);+ expect(typeof e.free).toBe('boolean');+ if (e.free) expect(e.price).toBeNull();+ else {+ expect(e.price?.usd, `${e.slug}.price.usd`).toMatch(/^\d+(\.\d+)?$/);+ expect(e.price?.atomics, `${e.slug}.price.atomics`).toMatch(/^\d+$/);+ expect(e.price.networks.length).toBeGreaterThan(0);+ }+ }+ });++ it('paid descriptors carry the discovery-listing essentials', () => {+ for (const s of PAID_SERVICES) {+ expect(s.path, s.slug).toBe(`/api/x402/${s.slug}`);+ expect(s.description.length, `${s.slug} description`).toBeGreaterThanOrEqual(60);+ expect(s.serviceName.length, `${s.slug} serviceName`).toBeLessThanOrEqual(32);+ expect(s.tags.length).toBeLessThanOrEqual(5);+ expect(['standard', 'cdp-bazaar', 'permit2-only']).toContain(s.acceptsBuilder);+ expect(s.priceAtomics).toMatch(/^\d+$/);+ }+ });++ it('getByStorefront filters by storefront membership', async () => {+ const x402scan = await getByStorefront('x402scan');+ const okx = await getByStorefront('okx');+ expect(x402scan.length).toBe(PAID_SERVICES.length);+ expect(x402scan.every((e) => e.source === 'x402')).toBe(true);+ expect(okx.every((e) => e.source === 'okx')).toBe(true);+ expect(okx.length).toBeGreaterThanOrEqual(10);+ });++ it('priceUsdFromAtomics matches the discovery formatter', () => {+ expect(priceUsdFromAtomics('10000')).toBe('0.01');+ expect(priceUsdFromAtomics('1000')).toBe('0.001');+ expect(priceUsdFromAtomics('5000000')).toBe('5');+ expect(priceUsdFromAtomics('150000')).toBe('0.15');+ });+});++describe('x402scan projection (toBazaarDiscovery)', () => {+ const stubAccepts = (service, url) =>+ service.acceptsBuilder === 'permit2-only'+ ? null+ : [{ scheme: 'exact', network: 'solana:mainnet', amount: service.priceAtomics, resource: url }];+ const stubExtensions = (accepts, bazaar) => ({ bazaar });++ it('emits one resource per live non-gated service, in catalog order', () => {+ const items = toBazaarDiscovery({+ origin: 'https://three.ws',+ acceptsFor: stubAccepts,+ extensionsForAccepts: stubExtensions,+ });+ const expected = PAID_SERVICES.filter(+ (s) => s.status === 'live' && s.acceptsBuilder !== 'permit2-only',+ );+ expect(items.map((r) => r.path)).toEqual(expected.map((s) => s.path));+ for (const r of items) {+ expect(r.url).toBe(`https://three.ws${r.path}`);+ expect(r.mimeType).toBe('application/json');+ expect(r.iconUrl).toMatch(/^https:\/\//);+ expect(r.accepts[0].amount).toMatch(/^\d+$/);+ expect(r.extensions.bazaar).toBeTruthy();+ }+ });++ it('omits a service whose acceptsFor returns null (permit2 without CDP creds)', () => {+ const items = toBazaarDiscovery({+ origin: 'https://three.ws',+ acceptsFor: stubAccepts,+ extensionsForAccepts: stubExtensions,+ });+ expect(items.some((r) => r.path === '/api/x402/permit2-paid-demo')).toBe(false);+ });+});++describe('no drift: live discovery doc ⇄ catalog', () => {+ it('every catalog x402scan entry is served with identical listing metadata', async () => {+ const doc = await renderDiscovery();+ const byPath = new Map(doc.resources.filter((r) => !r.toolName).map((r) => [r.path, r]));+ for (const s of PAID_SERVICES) {+ const live = byPath.get(s.path);+ if (s.acceptsBuilder === 'permit2-only' && !live) continue; // omitted without CDP creds — matches the runtime 402+ expect(live, `${s.path} missing from discovery doc`).toBeTruthy();+ expect(live.description, `${s.path} description drift`).toBe(s.description);+ expect(live.serviceName, `${s.path} serviceName drift`).toBe(s.serviceName);+ expect(live.tags, `${s.path} tags drift`).toEqual(s.tags);+ expect(live.method, `${s.path} method drift`).toBe(s.method);+ expect(live.accepts[0].amount, `${s.path} price drift`).toBe(s.priceAtomics);+ }+ });++ it('serves no static x402 resource the catalog does not know about', async () => {+ const doc = await renderDiscovery();+ const catalogPaths = new Set(PAID_SERVICES.map((s) => s.path));+ const rogue = doc.resources+ .filter((r) => !r.toolName && r.path?.startsWith('/api/x402/'))+ .filter((r) => !catalogPaths.has(r.path))+ // agent-published listings are dynamic rows from agent_paid_services,+ // cataloged per-listing by design.+ .filter((r) => !r.path.startsWith('/api/x402/service/'));+ expect(rogue.map((r) => r.path)).toEqual([]);+ });+});++describe('OKX projection (toOkxCatalog)', () => {+ it('default mode reproduces okx-catalog.js catalogIndex() exactly', () => {+ expect(toOkxCatalog()).toEqual(catalogIndex());+ });++ it('include:"all" appends every live paid x402 service in the OKX row schema', () => {+ const full = toOkxCatalog({ include: 'all' });+ const base = catalogIndex();+ expect(full.services.slice(0, base.services.length)).toEqual(base.services);+ const projected = full.services.slice(base.services.length);+ expect(projected.length).toBe(PAID_SERVICES.filter((s) => s.status === 'live').length);+ for (const row of projected) {+ expect(row.id).toMatch(/^[a-z0-9-]+$/);+ expect(row.kind).toBe('rest');+ expect(row.name).toBeTruthy();+ expect(row.price_usd).toMatch(/^\d+(\.\d+)?$/);+ expect(row.endpoint).toMatch(/^https:\/\/three\.ws\/api\/x402\/[a-z0-9-]+$/);+ for (const part of ['capability', 'input']) {+ const text = row.description[part];+ expect(text, `${row.id} description.${part}`).toBeTruthy();+ expect(+ displayWidth(text),+ `${row.id} description.${part} exceeds ${DESCRIPTION_MAX_WIDTH}`,+ ).toBeLessThanOrEqual(DESCRIPTION_MAX_WIDTH);+ }+ }+ });+});