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(okx): build every A2MCP listing description from the row's own schema and stop a free service quoting a null amount
nirholas6435b9c07d04
diff --git a/api/_lib/okx-catalog.js b/api/_lib/okx-catalog.jsindex 91b0335c0..866fdb804 100644--- a/api/_lib/okx-catalog.js+++ b/api/_lib/okx-catalog.js@@ -4,11 +4,12 @@// update submitted to OKX all read from this module, so the live endpoints can// never drift from the marketplace listing.//-// OKX listing format: every service carries a 2-part description, part 1 says-// what the service does, part 2 says what the caller must provide, and each-// part must fit in 200 display-width characters, where East-Asian wide glyphs-// count 2 and everything else counts 1 (OKX rejects over-length listings).-// `validateCatalog()` enforces this; tests/okx-catalog.test.js runs it in CI.+// OKX listing format: an A2MCP service carries a FOUR-part description (what it+// does / parameter spec / request method / a working curl). Parts 2 and 4 are+// derived from each row's inputSchema and example arguments, so the listing+// cannot drift from the endpoint. See listingDescription() below for the full+// rule and the review that forced it. `validateCatalog()` enforces every part;+// tests/api/okx-3d-services.test.js runs it in CI.//// The okx-ai campaign's work order 03 (retired; readable in git history)// decomposes the@@ -57,6 +58,15 @@ function usdToAtomics(usd) {export const FORGE_TOOL = 'forge_3d';export const FORGE_STATUS_TOOL = 'forge_status';+// The paid text lanes take the same arguments, so they document them the same+// way. One definition keeps the four listing rows from drifting apart.+const TEXT_FORGE_PARAMS = Object.freeze({+ prompt:+ 'what to build, 3 to 1000 characters, naming one subject plus its style and main colours',+ aspect_ratio:+ 'framing of the concept image, one of 1:1, 4:3, 3:4, 16:9, 9:16 (defaults to 1:1)',+});+// The paid text lanes take the same arguments; only the endpoint's lane and// fee differ. Built fresh per row so no two rows share a mutable schema object.function textForgeSchema() {@@ -87,7 +97,11 @@ function forgeStatusSchema() {// id URL slug, the service's route is /api/okx/3d/<id>// name Listing display name// kind 'a2mcp' (MCP Streamable HTTP JSON-RPC) | 'rest' (plain JSON GET)-// describes 2-part OKX listing description { capability, input }+// describes OKX listing copy { capability, input, params, example }:+// `params` gives every inputSchema property a one-line+// meaning, `example` is a valid argument object for the+// row's own schema. Listing parts 2 and 4 are built from+// them; see listingDescription().// priceUsd Retail price in USD as a string ('0' = free)// amountAtomics x402 amount (USDC 6-decimals atomic string), null = free// endpoint Absolute endpoint URL buyers call@@ -122,13 +136,18 @@ export const OKX_CATALOG = Object.freeze([lane: { tier: 'draft', path: 'image', mode: 'text_to_3d' },describes: {capability:- 'Turns a text description of one object or character into a downloadable textured 3D ' +- 'model in GLB format, with a browser preview link and an augmented-reality link that ' +- 'places it in a real room.',+ 'Turns a text description of one object or character into a downloadable textured 3D model in ' ++ 'GLB format, with a browser preview link and an augmented-reality link that places it in a ' ++ 'real room.',input:- 'Provide a text description of a single subject, 3 to 1000 characters, naming its style ' +- 'and main colours. An aspect ratio is optional. Returns a job id to poll on the free ' +- 'status service.',+ 'Provide a text description of a single subject, 3 to 1000 characters, naming its style and ' ++ 'main colours. An aspect ratio is optional. Returns a job id to poll on the free status ' ++ 'service.',+ params: {+ prompt: 'What to build: one subject, plus its style and main colours.',+ aspect_ratio: 'Framing of the concept image the model is built from.',+ },+ example: {'prompt': 'a low-poly orange fox sitting down'},},priceUsd: '0.01',amountAtomics: usdToAtomics(0.01),@@ -144,13 +163,18 @@ export const OKX_CATALOG = Object.freeze([lane: { tier: 'standard', mode: 'text_to_3d' },describes: {capability:- 'Turns a text description of one object or character into a downloadable textured 3D ' +- 'model in GLB format on the standard quality pass, with a browser preview link and an ' ++ 'Turns a text description of one object or character into a downloadable textured 3D model in ' ++ 'GLB format on the standard quality pass, with a browser preview link and an ' +'augmented-reality link.',input:- 'Provide a text description of a single subject, 3 to 1000 characters, naming its style ' +- 'and main colours. An aspect ratio is optional. Returns a job id to poll on the free ' +- 'status service.',+ 'Provide a text description of a single subject, 3 to 1000 characters, naming its style and ' ++ 'main colours. An aspect ratio is optional. Returns a job id to poll on the free status ' ++ 'service.',+ params: {+ prompt: 'What to build: one subject, plus its style and main colours.',+ aspect_ratio: 'Framing of the concept image the model is built from.',+ },+ example: {'prompt': 'a brass steampunk pocket watch, open lid'},},priceUsd: '0.05',amountAtomics: usdToAtomics(0.05),@@ -166,13 +190,18 @@ export const OKX_CATALOG = Object.freeze([lane: { tier: 'high', mode: 'text_to_3d' },describes: {capability:- 'Turns a text description of one object or character into a downloadable textured 3D ' +- 'model in GLB format on the highest detail pass, with a browser preview link and an ' +- 'augmented-reality link.',+ 'Turns a text description of one object or character into a downloadable textured 3D model in ' ++ 'GLB format on the highest detail pass, with a browser preview link and an augmented-reality ' ++ 'link.',input:- 'Provide a text description of a single subject, 3 to 1000 characters, naming its style ' +- 'and main colours. An aspect ratio is optional. This pass runs longer, so keep polling ' +- 'the free status service.',+ 'Provide a text description of a single subject, 3 to 1000 characters, naming its style and ' ++ 'main colours. An aspect ratio is optional. This pass runs longer, so keep polling the free ' ++ 'status service.',+ params: {+ prompt: 'What to build: one subject, plus its style and main colours.',+ aspect_ratio: 'Framing of the concept image the model is built from.',+ },+ example: {'prompt': 'an ornate marble griffin statue on a plinth', 'aspect_ratio': '3:4'},},priceUsd: '0.25',amountAtomics: usdToAtomics(0.25),@@ -188,13 +217,18 @@ export const OKX_CATALOG = Object.freeze([lane: { mode: 'image_to_3d' },describes: {capability:- 'Rebuilds a downloadable textured 3D model in GLB format from photographs or rendered ' +- 'views of one object, with a browser preview link and an augmented-reality link that ' +- 'places it in a real room.',+ 'Rebuilds a downloadable textured 3D model in GLB format from photographs or rendered views ' ++ 'of one object, with a browser preview link and an augmented-reality link that places it in a ' ++ 'real room.',input:- 'Provide one to four publicly reachable image links showing the same subject. A short ' +- 'text description is optional and sharpens the result. Returns a job id to poll on the ' +- 'free status service.',+ 'Provide one to four publicly reachable image links showing the same subject. A short text ' ++ 'description is optional and sharpens the result. Returns a job id to poll on the free status ' ++ 'service.',+ params: {+ image_urls: 'Public https links to photographs or rendered views of one object.',+ prompt: 'Optional text describing the object, which sharpens the rebuild.',+ },+ example: {'image_urls': ['https://three.ws/og-image.png']},},priceUsd: '0.25',amountAtomics: usdToAtomics(0.25),@@ -223,13 +257,18 @@ export const OKX_CATALOG = Object.freeze([lane: { mode: 'status' },describes: {capability:- 'Reports the live state of any three.ws forge generation job and returns the finished ' +- 'model file, concept image, browser preview link and augmented-reality link once the ' +- 'job completes. Always free.',+ 'Reports the live state of any three.ws forge generation job and returns the finished model ' ++ 'file, concept image, browser preview link and augmented-reality link once the job completes. ' ++ 'Always free.',input:- 'Provide the job id returned when a generation was accepted. Optionally provide the ' +- 'original description so the preview pages carry a title. No payment, account, or key ' +- 'is required to call it.',+ 'Provide the job id returned when a generation was accepted. Optionally provide the original ' ++ 'description so the preview pages carry a title. No payment, account, or key is required to ' ++ 'call it.',+ params: {+ job_id: 'The job id returned when a generation was accepted.',+ title: 'Optional title carried onto the viewer and AR pages.',+ },+ example: {'job_id': 'f1.abc123'},},priceUsd: '0',amountAtomics: null,@@ -540,11 +579,10 @@ export const OKX_CATALOG = Object.freeze([describes: {capability:'Free machine-readable index of every three.ws 3D Studio service sold here: names, ' +- 'descriptions, prices, endpoints, and input formats, always in sync with the live ' +- 'services.',+ 'descriptions, prices, endpoints, and input formats, always in sync with the live services.',input:- 'Provide nothing. No parameters, no payment, and no account are required. Returns the ' +- 'full service list with names, prices, endpoints, and the exact input each one expects.',+ 'Provide nothing. No parameters, no payment, and no account are required. Returns the full ' ++ 'service list with names, prices, endpoints, and the exact input each one expects.',},priceUsd: '0',amountAtomics: null,@@ -577,10 +615,90 @@ export function catalogEntry(id) {return OKX_CATALOG.find((e) => e.id === id) || null;}-// The OKX listing description string: part ① and part ② joined on a newline,-// the layout the approved sellers use. Work order 05 submits this verbatim.+// ── The OKX A2MCP listing description ───────────────────────────────────────+// OKX listing QA requires FOUR newline-separated parts on an A2MCP service and+// rejects a listing missing any of them (`onchainos agent update --help`). The+// 2026-09-02 review rejected #2632 with exactly that remark: "The service you+// submitted is missing a complete description, parameter details, and usage+// examples." We were submitting two parts.+//+// 1. what the service does <- describes.capability+// 2. parameter spec, ALL params on ONE line, `;`-separated, each+// `<name>(<type>, required/optional): <meaning>`+// 3. request method (POST / GET, plus the MCP tool name where there is one)+// 4. a working curl against the real endpoint+//+// Parts 2 and 4 are DERIVED from `inputSchema` + `describes.params` /+// `describes.example`, never+// hand-written: a parameter renamed in the schema renames itself in the+// listing, and validateCatalog() fails a row whose schema and documented+// parameters disagree. The example arguments are validated against the row's+// own schema in tests/api/okx-3d-services.test.js, so a published usage+// example cannot be one the endpoint would reject.+// JSON Schema type as a buyer-readable label: `string`, `number`, `boolean`,+// `string[]`. Anything exotic falls back to the raw schema type rather than+// guessing, so an undocumented shape reads as itself instead of as a lie.+function schemaTypeLabel(prop) {+ const type = prop?.type;+ if (type === 'array') {+ const item = prop.items?.type;+ return item ? `${item}[]` : 'array';+ }+ return typeof type === 'string' ? type : 'string';+}++// Part 2. Order follows the schema's own property order, which puts the+// required arguments first in every row.+export function parameterSpec(entry) {+ const schema = entry.inputSchema;+ const props = schema?.properties ? Object.entries(schema.properties) : [];+ if (!props.length) return 'No parameters. Send an empty request.';+ const required = new Set(schema.required || []);+ const params = entry.describes?.params || {};+ return props+ .map(([name, prop]) => {+ const need = required.has(name) ? 'required' : 'optional';+ // The meanings are written as sentences; `;` is the separator OKX asks+ // for, so a trailing full stop would render as "colours.; aspect_ratio".+ const meaning = String(params[name]).trim().replace(/\.$/, '');+ return `${name} (${schemaTypeLabel(prop)}, ${need}): ${meaning}`;+ })+ .join('; ');+}++// Part 3. A2MCP rows are called as MCP JSON-RPC `tools/call`, so the tool name+// is the part a buyer cannot guess; REST rows answer a plain POST, and the two+// free discovery rows a plain GET.+export function requestMethod(entry) {+ if (entry.kind === 'a2mcp') return `POST (MCP JSON-RPC tools/call, tool name: ${entry.tool})`;+ return entry.inputSchema ? 'POST' : 'GET';+}++// Part 4. A real, runnable call. The A2MCP rows carry the full JSON-RPC+// envelope because that, not a bare argument object, is what their endpoint+// accepts.+export function requestExample(entry) {+ const url = entry.endpoint;+ if (!entry.inputSchema) return `curl ${url}`;+ const args = entry.describes?.example;+ const body =+ entry.kind === 'a2mcp'+ ? { jsonrpc: '2.0', id: 1, method: 'tools/call', params: { name: entry.tool, arguments: args } }+ : args;+ return `curl -X POST ${url} -H "Content-Type: application/json" -d '${JSON.stringify(body)}'`;+}++// OKX caps the whole description at 1000 CJK characters, i.e. 2000 half-width+// display columns.+export const LISTING_MAX_WIDTH = 2000;+export function listingDescription(entry) {- return `${entry.describes.capability}\n${entry.describes.input}`;+ return [+ entry.describes.capability,+ parameterSpec(entry),+ requestMethod(entry),+ requestExample(entry),+ ].join('\n');}// The machine-readable index the free catalog service returns, the exact@@ -646,6 +764,42 @@ export function validateCatalog(catalog = OKX_CATALOG) {throw new Error(`${ctx}: describes.${part} display width ${w} > ${DESCRIPTION_MAX_WIDTH}`);}}+ // The four-part rules below bind the rows we actually submit. A back-burner+ // row is not on the listing, so it is held to the catalog rules only; it+ // picks these up when it returns to the listing, exactly like the+ // `listed` name-width check above.+ if (e.listed) {+ // Every schema property must carry a documented meaning, and every+ // documented meaning must name a real schema property. This is the+ // guard that keeps listing part 2 honest: rename an argument and the+ // listing fails here rather than shipping a parameter buyers cannot+ // send.+ const schemaProps = Object.keys(e.inputSchema?.properties || {});+ const documented = Object.keys(e.describes?.params || {});+ for (const name of schemaProps) {+ if (!e.describes?.params?.[name]) throw new Error(`${ctx}: describes.params is missing "${name}"`);+ }+ for (const name of documented) {+ if (!schemaProps.includes(name)) throw new Error(`${ctx}: describes.params documents unknown param "${name}"`);+ }+ // Listing part 4 has to be a real call, so a row with arguments needs+ // example arguments to build one from.+ if (schemaProps.length && !e.describes?.example) {+ throw new Error(`${ctx}: missing describes.example, listing part 4 would have no usage example`);+ }+ // All four parts present and inside OKX's whole-description cap. A+ // listed row missing any part is rejected at listing QA, which is what+ // happened on 2026-09-02.+ const listing = listingDescription(e);+ const parts = listing.split('\n');+ if (parts.length !== 4 || parts.some((p) => !p.trim())) {+ throw new Error(`${ctx}: listing description must be 4 non-empty parts, got ${parts.length}`);+ }+ const lw = displayWidth(listing);+ if (lw > LISTING_MAX_WIDTH) {+ throw new Error(`${ctx}: listing description display width ${lw} > ${LISTING_MAX_WIDTH}`);+ }+ }if (!/^\d+(\.\d{1,2})?$/.test(e.priceUsd)) throw new Error(`${ctx}: bad priceUsd`);const free = e.priceUsd === '0';if (free && e.amountAtomics !== null) throw new Error(`${ctx}: free row must have null atomics`);diff --git a/api/_okx3d/forge.js b/api/_okx3d/forge.jsindex 986f2a794..86bd21173 100644--- a/api/_okx3d/forge.js+++ b/api/_okx3d/forge.js@@ -261,9 +261,12 @@ function buildStatusTool() {// inherits the default that describes a different server's tools, and an agent// that followed it would pay and then send a call this dispatcher rejects.function forgeBazaarExtension(entry, paidTool) {+ // The image example must point at an image that actually loads: this one is+ // the single runnable example on the image row, and a buyer that follows it+ // pays before finding out. It read /og/three-ws.png, which 404s.const exampleArguments = paidTool? entry.lane?.mode === 'image_to_3d'- ? { image_urls: [`${BASE}/og/three-ws.png`] }+ ? { image_urls: [`${BASE}/logo.png`] }: { prompt: 'a low-poly orange fox sitting down' }: { job_id: 'f1.abc123' };const exampleBody = {diff --git a/api/okx/3d/[service].js b/api/okx/3d/[service].jsindex 9d8683174..c13342006 100644--- a/api/okx/3d/[service].js+++ b/api/okx/3d/[service].js@@ -57,7 +57,6 @@ import {authenticateRequest,handleSse,handleTerminate,- isMcpProtocolClient,} from '../../_mcp/auth.js';import { sendX402Error, reservePaymentProof } from '../../_mcp/payments.js';import {@@ -403,7 +402,11 @@ async function handleA2mcp(req, res, cfg) {// These services sell on OKX.AI, so the 402 must LEAD with the X Layer// (eip155:196) accept or an OKX buyer cannot pay it. Gated on the X Layer// envs being present. Prepended into the MCP challenge + verify path.- const xlayerAcceptsFor = (amount) => (xlayerSettleable() ? [okxXLayerAccept(resourceUrl, amount)] : []);+ // An amount of null stringifies to the literal "null" inside the accept, an+ // unpayable challenge that reads to a reviewer as a broken payment rail. No+ // amount means nothing to charge for, so there is no accept to advertise.+ const xlayerAcceptsFor = (amount) =>+ amount && xlayerSettleable() ? [okxXLayerAccept(resourceUrl, amount)] : [];if (req.method === 'GET' || req.method === 'HEAD') {// A free service has nothing to challenge for. Answering its GET with a@@ -435,6 +438,15 @@ async function handleA2mcp(req, res, cfg) {isFreeName,});+ // A row with no list price sells nothing: every tool it serves is free. A+ // tools/call naming a tool it does NOT serve (forge_3d against the free+ // forge-status row, which is exactly the sweep a reviewer runs across every+ // listed endpoint) priced as null and matched no explicit free name, so it+ // fell through to a 402 quoting an amount of null. A free service must never+ // demand payment; the honest answer is the dispatcher's own unknown-tool+ // error. Same reasoning as the GET 405 above.+ const sellsNothing = !listPrice;+// The X Layer accept must quote the SAME batch total the platform rails// quote. Pinned to the single-identity list price, a 16-call batch verified// (and settled) against ONE identity's price on the OKX rail: the exact@@ -447,7 +459,21 @@ async function handleA2mcp(req, res, cfg) {x402Amount,resourcePath,challenge,- allowFree: allFree || (isDiscoveryOnlyBatch(body) && !isMcpProtocolClient(req)),+ // Discovery (initialize / tools/list / ping) is free for EVERY caller+ // here, protocol clients included. The platform's other MCP surfaces+ // scope free discovery to non-protocol clients on purpose, because an+ // OAuth-capable client has to meet the 401 on initialize or it never+ // starts the OAuth flow. This surface has no OAuth (paymentStatus below+ // forces 402), so that exclusion protected nothing and instead+ // paywalled discovery: a spec-compliant MCP client sends+ // `Accept: text/event-stream` + `MCP-Protocol-Version`, so its+ // `initialize` and `tools/list` were answered 402 and it could never+ // connect, read a tool description, or read a parameter schema. That is+ // what the 2026-09-02 OKX review saw when it rejected the listing for+ // "missing a complete description, parameter details, and usage+ // examples"; curl, which sends neither header, was served 200 and hid+ // it. Paid work is unaffected: tools/call is never a discovery method.+ allowFree: allFree || sellsNothing || isDiscoveryOnlyBatch(body),extraAccepts,// OKX buyers pay a 402 and nothing else; there is no OAuth story on this// surface, so an MCP client must never be diverted to a 401.diff --git a/prompts/finish/okx-ai-PROGRESS.md b/prompts/finish/okx-ai-PROGRESS.mdindex 983d50ad4..2bdddc0fa 100644--- a/prompts/finish/okx-ai-PROGRESS.md+++ b/prompts/finish/okx-ai-PROGRESS.md@@ -6,6 +6,73 @@ Work Order 04 session, no earlier entries existed because no earlier work order---+## 2026-09-02, RUNBOOK repaired: the daily status check had been broken since the CLI moved its approval fields++Companion to the "Work Order 05 dispatched" entry below, same day, different session. That+one read the state and swept production; this one fixed the operator document both of them+read, which had drifted far enough that following it produced wrong answers.++**The document was lying in four places. Each was re-derived from a live source, not edited+from memory.**++1. **Section 1's daily status check did not work.** `onchainos agent get-agents --agent-ids+ 2632` on v4.5.2 still returns the agent, but its payload no longer carries+ `approvalDisplayStatus`, `approvalLabel`, `status` or `statusLabel`. The scripted+ one-liner the runbook told an operator to run dies with `KeyError: 'approvalLabel'`,+ which reads like a broken CLI or an expired session and is neither. `get-my-agents`+ carries all four. Section 1 is rewritten around it and now records the trap, plus two+ look-alike fields that must NOT be read as approval state: `service-list`'s+ `agentInfo.approvalStatus` is a different enum (it read `3` today while the display+ status read `2`), and its `approvalRemark` still quotes the 2026-07-26 rejection verbatim+ in the middle of an open review. `agentInfo.updatedAt` is an online heartbeat, not a+ listing event: it moved 1 ms after `lastOnlineTime` today, so "updated today" means the+ daemon checked in, nothing more. Verified working replacement:+ `Listing under review | status not listed | sold 2`.+2. **Section 2 documented drift that no longer exists.** It described the live listing as+ the 7 old REST rows against an 11-row module, "expected, because WO-05 has never run".+ The 2026-08-27 update closed that. Re-pulled `service-list` and compared it row by row to+ `api/_lib/okx-catalog.js`: 7 rows, ids 39975 to 39981, every name and endpoint matching,+ all `A2MCP` on chain 196 quoting USD₮0. Section retitled "Drift resolved" and now carries+ the real table plus the note that 9 further rows are deployed, payable and deliberately+ `listed: false`.+3. **Section 3 claimed funding gates the resubmission.** "Only then does WO-05 unlock" is+ false and was a live tripwire: WO-08 says plainly that a listing needs no settled payment+ to be submitted, and the 2026-08-27 resubmission went out with all three wallets empty.+ What funding gates is WO-04's first real settlement. Corrected in place rather than+ deleted, so the next reader sees the claim was wrong and why. Balances re-read live at+ block 69606689 (`rpc.xlayer.tech`, direct `balanceOf` + `eth_getBalance`): buyer+ `0x75d0…cf69` 0 USD₮0 / 0 OKB, seller `0x4022de2D…f402` 2.427731 / 0.839596, relayer+ `0xe81DE501…415B` 0 / 0.02. Identical to 2026-08-01 and 2026-07-23. Live `payTo` re-probed+ across all four paid rows: no drift.+4. **Section 7's "probe this before any submission" command probed the wrong endpoint, with+ the wrong headers.** It curled `identity-studio`, which has been `listed: false` since the+ 2026-08-22 rebuild, so the check a submission depended on was aimed at a row no reviewer+ sees. Replaced with a loop over the four listed paid rows carrying the two MCP client+ headers, and an explanation of why a bare curl is a false green here. Verified today: all+ four answer 402 with `eip155:196` leading, `GET /forge-status` answers 405.++Also refreshed: the CLI version line (v4.4.0 to the actual v4.5.2), section 4's confirm step+and section 5's remark-capture command (both pointed at the moved fields), and section 5's+pointer to the retired WO-05, now WO-08.++`npm run check:rules -- --paths prompts/finish/okx-ai-RUNBOOK.md` passes; no banned dashes.++### One thing measured but not resolved, for whoever picks this up++`soldCount` reads **2** on an agent that has never had a settled payment on our rail. It was+already 2 on 2026-08-27, before the current listing existed, so it is not a forge sale, and+the seller wallet's 2.427731 USD₮0 predates it too. Nobody has established what OKX counts+there. Do not cite it as revenue until someone reconciles it against a tx hash.++### State++Under review, day 6. Nothing to submit, nothing on-chain attempted, no funding needed to+keep waiting. The pending discovery fix in `api/okx/3d/[service].js` (another session's, see+the entry below) is the only code between here and the next deploy.++---++## 2026-09-02, Work Order 05 dispatched: RETIRED at the gate, listing verified under review, nothing submittedAsked to execute `okx-ai-05-relisting-resubmission.md`. **It was not executed, deliberately, anddiff --git a/prompts/okx-ai/e2e-evidence/00-catalog-live.json b/prompts/okx-ai/e2e-evidence/00-catalog-live.jsonnew file mode 100644index 000000000..8169d087f--- /dev/null+++ b/prompts/okx-ai/e2e-evidence/00-catalog-live.json@@ -0,0 +1 @@+{"provider":"three.ws 3D Studio","okxAgentId":2632,"chain":"eip155:196","services":[{"id":"forge-draft","name":"Forge 3D Draft","kind":"a2mcp","description":{"capability":"Turns a text description of one object or character into a downloadable textured 3D model in GLB format, with a browser preview link and an augmented-reality link that places it in a real room.","input":"Provide a text description of a single subject, 3 to 1000 characters, naming its style and main colours. An aspect ratio is optional. Returns a job id to poll on the free status service."},"price_usd":"0.01","endpoint":"https://three.ws/api/okx/3d/forge-draft","tool":"forge_3d","input_schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"prompt":{"type":"string","minLength":3,"maxLength":1000},"aspect_ratio":{"type":"string","enum":["1:1","4:3","3:4","16:9","9:16"]}}}},{"id":"forge-standard","name":"Forge 3D Standard","kind":"a2mcp","description":{"capability":"Turns a text description of one object or character into a downloadable textured 3D model in GLB format on the standard quality pass, with a browser preview link and an augmented-reality link.","input":"Provide a text description of a single subject, 3 to 1000 characters, naming its style and main colours. An aspect ratio is optional. Returns a job id to poll on the free status service."},"price_usd":"0.05","endpoint":"https://three.ws/api/okx/3d/forge-standard","tool":"forge_3d","input_schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"prompt":{"type":"string","minLength":3,"maxLength":1000},"aspect_ratio":{"type":"string","enum":["1:1","4:3","3:4","16:9","9:16"]}}}},{"id":"forge-hd","name":"Forge 3D HD","kind":"a2mcp","description":{"capability":"Turns a text description of one object or character into a downloadable textured 3D model in GLB format on the highest detail pass, with a browser preview link and an augmented-reality link.","input":"Provide a text description of a single subject, 3 to 1000 characters, naming its style and main colours. An aspect ratio is optional. This pass runs longer, so keep polling the free status service."},"price_usd":"0.25","endpoint":"https://three.ws/api/okx/3d/forge-hd","tool":"forge_3d","input_schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"prompt":{"type":"string","minLength":3,"maxLength":1000},"aspect_ratio":{"type":"string","enum":["1:1","4:3","3:4","16:9","9:16"]}}}},{"id":"forge-image","name":"Forge 3D from Image","kind":"a2mcp","description":{"capability":"Rebuilds a downloadable textured 3D model in GLB format from photographs or rendered views of one object, with a browser preview link and an augmented-reality link that places it in a real room.","input":"Provide one to four publicly reachable image links showing the same subject. A short text description is optional and sharpens the result. Returns a job id to poll on the free status service."},"price_usd":"0.25","endpoint":"https://three.ws/api/okx/3d/forge-image","tool":"forge_3d","input_schema":{"type":"object","required":["image_urls"],"additionalProperties":false,"properties":{"image_urls":{"type":"array","minItems":1,"maxItems":4,"items":{"type":"string","format":"uri","pattern":"^https://"}},"prompt":{"type":"string","minLength":3,"maxLength":1000}}}},{"id":"forge-status","name":"Forge Job Status","kind":"a2mcp","description":{"capability":"Reports the live state of any three.ws forge generation job and returns the finished model file, concept image, browser preview link and augmented-reality link once the job completes. Always free.","input":"Provide the job id returned when a generation was accepted. Optionally provide the original description so the preview pages carry a title. No payment, account, or key is required to call it."},"price_usd":"0","endpoint":"https://three.ws/api/okx/3d/forge-status","tool":"forge_status","input_schema":{"type":"object","required":["job_id"],"additionalProperties":false,"properties":{"job_id":{"type":"string","minLength":8,"maxLength":1024},"title":{"type":"string","maxLength":200}}}},{"id":"catalog","name":"3D Studio Service Catalog","kind":"rest","description":{"capability":"Free machine-readable index of every three.ws 3D Studio service sold here: names, descriptions, prices, endpoints, and input formats, always in sync with the live services.","input":"Provide nothing. No parameters, no payment, and no account are required. Returns the full service list with names, prices, endpoints, and the exact input each one expects."},"price_usd":"0","endpoint":"https://three.ws/api/okx/3d/catalog"},{"id":"health","name":"3D Studio Health Status","kind":"rest","description":{"capability":"Free live health status for the systems behind every paid service: generation, rigging, rendering, storage, and the payment rail, from real checks rather than a fixed reply.","input":"Provide nothing. No parameters, no payment, and no account are required. Returns a per-system reading so a buyer can confirm everything is up before paying for a job."},"price_usd":"0","endpoint":"https://three.ws/api/okx/3d/health"}],"unlisted":[{"id":"identity-studio","name":"Agent Identity Studio","kind":"a2mcp","description":{"capability":"Creates a complete 3D identity for an AI agent from a text brief: a rigged, animation-ready GLB avatar plus posed studio renders, including a square profile picture and full-body shots.","input":"Provide: 1. the agent name 2. a brand or personality brief in any language 3. optional style hints 4. an optional reference image. Example: name LedgerLynx, brief: a calm on-chain accounting agent."},"price_usd":"1.50","endpoint":"https://three.ws/api/okx/3d/identity-studio","tool":"create_identity","input_schema":{"type":"object","required":["agent_name","brief"],"additionalProperties":false,"properties":{"agent_name":{"type":"string","minLength":1,"maxLength":80,"description":"The agent’s display name. Rendered into the identity brief."},"brief":{"type":"string","minLength":3,"maxLength":4000,"description":"Personality / brand description in any language. Longer than 2000 characters is truncated (the response flags brief_truncated)."},"style_hints":{"type":"string","maxLength":500,"description":"Optional visual direction: palette, materials, era, mood."},"reference_image_url":{"type":"string","format":"uri","description":"Optional public image to guide the look. Validated before any charge, an unreachable URL fails the call without settling payment."}}}},{"id":"text-to-3d","name":"Text to 3D Model (GLB)","kind":"rest","description":{"capability":"Generates a textured, downloadable 3D model in GLB format from a text description on the fast draft lane. Suited to quick props, objects, and concept assets. You pay only when the job is accepted.","input":"Provide: 1. a text description of one object or character, 3 to 1000 characters 2. an optional aspect ratio. Example: a brass steampunk owl, full body. Returns the model link or a free-to-check job."},"price_usd":"0.01","endpoint":"https://three.ws/api/okx/3d/text-to-3d","input_schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"prompt":{"type":"string","minLength":3,"maxLength":1000},"aspect_ratio":{"type":"string","enum":["1:1","4:3","3:4","16:9","9:16"]}}}},{"id":"text-to-3d-pro","name":"Text to 3D Model (Pro)","kind":"rest","description":{"capability":"Art-directed text to 3D: refines your description, then generates a higher-quality textured GLB model. Standard tier by default; the high tier adds maximum detail and PBR materials.","input":"Provide: 1. a text description 2. an optional quality tier, standard or high 3. an optional aspect ratio. Example: an ornate elven longsword, tier high. Returns the model link or a free-to-check job."},"price_usd":"0.30","endpoint":"https://three.ws/api/okx/3d/text-to-3d-pro","input_schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"prompt":{"type":"string","minLength":3,"maxLength":1000},"tier":{"type":"string","enum":["standard","high"]},"aspect_ratio":{"type":"string","enum":["1:1","4:3","3:4","16:9","9:16"]}}}},{"id":"image-to-3d","name":"Image to 3D Model","kind":"rest","description":{"capability":"Reconstructs a textured 3D model in GLB format from photos of a single object, turning product shots or concept art into usable 3D assets.","input":"Provide: 1. one to four public photo links of the same object 2. an optional text hint. Example: front and side photos of one sneaker. Returns the model link or a free-to-check job."},"price_usd":"0.30","endpoint":"https://three.ws/api/okx/3d/image-to-3d","input_schema":{"type":"object","required":["image_urls"],"additionalProperties":false,"properties":{"image_urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":4},"prompt":{"type":"string","maxLength":1000}}}},{"id":"rig","name":"GLB Auto-Rigging","kind":"rest","description":{"capability":"Rigs a static humanoid GLB model into an animation-ready character: adds a skeleton and skin weights so the model can be posed and animated in any engine.","input":"Provide: 1. a public link to the static GLB model. Humanoid models rig best. Example: a knight character model. Returns a job you can check for free until the rigged model is ready."},"price_usd":"0.25","endpoint":"https://three.ws/api/okx/3d/rig","input_schema":{"type":"object","required":["glb_url"],"additionalProperties":false,"properties":{"glb_url":{"type":"string","format":"uri"}}}},{"id":"avatar","name":"Text to Rigged Avatar","kind":"rest","description":{"capability":"One call from text to an animation-ready character: generates the 3D mesh, then rigs a humanoid skeleton. Non-humanoid subjects fall back to plain mesh generation so no rigging pass is wasted.","input":"Provide: 1. a text description of a full-body character, or a reference image link 2. optionally allow non-humanoid subjects. Example: a heroic knight in silver armor, full body."},"price_usd":"0.50","endpoint":"https://three.ws/api/okx/3d/avatar","input_schema":{"type":"object","additionalProperties":false,"properties":{"prompt":{"type":"string","maxLength":1000},"image_url":{"type":"string","format":"uri"},"allow_non_humanoid":{"type":"boolean"}}}},{"id":"retarget","name":"Animation Retargeting","kind":"rest","description":{"capability":"Applies a curated animation clip such as idle, walk, or dance onto any rigged humanoid GLB model, keyed to its skeleton, with a bone coverage report. Finishes within the request.","input":"Provide: 1. a public link to the rigged GLB model 2. the animation name 3. an optional output format and playback speed. Example: your knight model plus the walk animation."},"price_usd":"0.10","endpoint":"https://three.ws/api/okx/3d/retarget","input_schema":{"type":"object","required":["model_url","animation"],"additionalProperties":false,"properties":{"model_url":{"type":"string","format":"uri"},"animation":{"type":"string"},"format":{"type":"string","enum":["glb","clip"]},"speed":{"type":"number","minimum":0.25,"maximum":2.5}}}},{"id":"pose-seed","name":"Pose Seed","kind":"rest","description":{"capability":"Turns a text pose description into a deterministic pose seed and a full joint rotation map for humanoid rigs. The same description always returns the same pose. Finishes within the request.","input":"Provide: 1. a pose description, 1 to 500 characters. Example: confident standing pose, arms crossed. Returns the seed, per-joint rotations, and a preview link."},"price_usd":"0.02","endpoint":"https://three.ws/api/okx/3d/pose-seed","input_schema":{"type":"object","required":["prompt"],"additionalProperties":false,"properties":{"prompt":{"type":"string","minLength":1,"maxLength":500}}}},{"id":"fbx-export","name":"FBX Export (rig-preserving)","kind":"rest","description":{"capability":"Converts a GLB model to FBX for Unity or Unreal. A rigged model keeps its skeleton, skin weights, and blendshapes. Also exports OBJ, STL, PLY, USDZ, and 3MF formats.","input":"Provide: 1. a public link to the GLB model 2. an optional target format, FBX by default; OBJ, STL, PLY, USDZ, and 3MF also work. Example: your rigged knight model to FBX for Unity."},"price_usd":"0.10","endpoint":"https://three.ws/api/okx/3d/fbx-export","input_schema":{"type":"object","required":["model_url"],"additionalProperties":false,"properties":{"model_url":{"type":"string","format":"uri"},"format":{"type":"string","enum":["fbx","obj","stl","ply","usdz","3mf"]}}}}],"docs":"https://three.ws/docs/okx-marketplace"}\ No newline at end of filediff --git a/prompts/okx-ai/e2e-evidence/00-gauntlet-summary.json b/prompts/okx-ai/e2e-evidence/00-gauntlet-summary.jsonindex ebc16fc13..4164e50ca 100644--- a/prompts/okx-ai/e2e-evidence/00-gauntlet-summary.json+++ b/prompts/okx-ai/e2e-evidence/00-gauntlet-summary.json@@ -1,27 +1,14 @@{"base": "https://three.ws","dryRun": true,+ "ranAt": "2026-09-02T19:06:48.912Z","results": [- {- "id": "1",- "title": "free lane serves live data, no payment demanded",- "ok": true,- "detail": "health 200 (5 subsystems, real latencies), catalog 200 (11 rows)",- "evidence": "prompts/okx-ai/e2e-evidence/30-case1-free-lane.json"- },{"id": "5d","title": "garbage payment header gets a clean 4xx, runs no tool","ok": true,"detail": "notBase64=400, wrongShape=402, emptyString=402, truncatedJson=400","evidence": "prompts/okx-ai/e2e-evidence/53-case5d-garbage.json"- },- {- "id": "7",- "title": "legacy rails still offered alongside X Layer, same price",- "ok": true,- "detail": "accepts: eip155:196, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp, eip155:8453, eip155:8453; solana 10000, base 10000, want 10000",- "evidence": "prompts/okx-ai/e2e-evidence/70-case7-legacy-rails.json"}],"settlements": []diff --git a/prompts/okx-ai/e2e-evidence/01-agent-status.json b/prompts/okx-ai/e2e-evidence/01-agent-status.jsonnew file mode 100644index 000000000..cf30bf46c--- /dev/null+++ b/prompts/okx-ai/e2e-evidence/01-agent-status.json@@ -0,0 +1 @@+{"ok":true,"data":{"list":[{"accountName":"Account 1","agentList":[{"accountName":null,"agentId":"2632","agentWalletAddress":"0x75d00a2713565171f33216e5aa2a375e076ecf69","approvalDisplayStatus":2,"approvalLabel":"Listing under review","card":[{"label":"Agent ID","value":"#2632"},{"label":"Name","value":"three.ws 3D Studio"},{"label":"Role","value":"ASP"},{"label":"Status","value":"not listed"},{"label":"Approval status","value":"Listing under review"},{"label":"Address","value":"0x75d0…cf69"},{"label":"Description","value":"Turn a text description or reference images into a real, downloadable 3D model for autonomous agents, pay per call. Four quality lanes from a one-cent draft to high detail, one client shape across all of them. Every job returns the GLB file, a browser viewer link, an augmented-reality link that places the model in a real room, and a shareable model page. Job status, the service catalog and live health are free. You pay only when a job is accepted."},{"label":"Profile photo","value":"https://static.okx.com/cdn/web3/wallet/marketplace/headimages/agent/avatar/fe6a976d-126b-402e-b892-a0c40736fc10.jpg"}],"cells":[{"label":"Agent ID","value":"#2632"},{"label":"Name","value":"three.ws 3D Studio"},{"label":"Role","value":"ASP"},{"label":"Status","value":"not listed"},{"label":"Approval status","value":"Listing under review"},{"label":"Rating","value":"No rating yet"}],"communicationAddress":"0xfaBDeadF019267576a155E166110eDdA8BeE9729","keyUuid":"8848356c-f4a5-418a-a189-6a6ad72c8fdc","lastOnlineTime":1788375636053,"name":"three.ws 3D Studio","onlineStatus":1,"ownerAddress":"0x75d00a2713565171f33216e5aa2a375e076ecf69","profileDescription":"Turn a text description or reference images into a real, downloadable 3D model for autonomous agents, pay per call. Four quality lanes from a one-cent draft to high detail, one client shape across all of them. Every job returns the GLB file, a browser viewer link, an augmented-reality link that places the model in a real room, and a shareable model page. Job status, the service catalog and live health are free. You pay only when a job is accepted.","profilePicture":"https://static.okx.com/cdn/web3/wallet/marketplace/headimages/agent/avatar/fe6a976d-126b-402e-b892-a0c40736fc10.jpg","role":2,"roleLabel":"ASP","securityRate":null,"soldCount":2,"status":2,"statusLabel":"not listed","tagCodes":null}],"ownerAddress":"0x75d00a2713565171f33216e5aa2a375e076ecf69"}],"page":1,"pageSize":5,"total":1}}diff --git a/prompts/okx-ai/e2e-evidence/01-listing-service-list.json b/prompts/okx-ai/e2e-evidence/01-listing-service-list.jsonnew file mode 100644index 000000000..e351fa8bc--- /dev/null+++ b/prompts/okx-ai/e2e-evidence/01-listing-service-list.json@@ -0,0 +1 @@+{"ok":true,"data":[{"agentInfo":{"agentId":"2632","agentWalletAddress":"0x75d00a2713565171f33216e5aa2a375e076ecf69","approvalRemark":"The service you submitted is missing a complete description, parameter details, and usage examples. Please make these updates and resubmit.","approvalStatus":3,"categoryCode":["ART_CREATION"],"chainIndex":196,"communicationAddress":"0xfaBDeadF019267576a155E166110eDdA8BeE9729","createdAt":1782882648423,"keyUuid":"8848356c-f4a5-418a-a189-6a6ad72c8fdc","lastOnlineTime":1788375636053,"name":"three.ws 3D Studio","onlineStatus":1,"ownerAddress":"0x75d00a2713565171f33216e5aa2a375e076ecf69","profileDescription":"Turn a text description or reference images into a real, downloadable 3D model for autonomous agents, pay per call. Four quality lanes from a one-cent draft to high detail, one client shape across all of them. Every job returns the GLB file, a browser viewer link, an augmented-reality link that places the model in a real room, and a shareable model page. Job status, the service catalog and live health are free. You pay only when a job is accepted.","profilePicture":"https://static.okx.com/cdn/web3/wallet/marketplace/headimages/agent/avatar/fe6a976d-126b-402e-b892-a0c40736fc10.jpg","role":2,"salesCount":2,"securityRate":null,"status":2,"tagCodes":[],"updatedAt":1788375636053},"list":[{"cells":[{"label":"#","value":"1"},{"label":"Name","value":"Forge Job Status"},{"label":"Type","value":"API service"},{"label":"Fee","value":"0 USDT"},{"label":"Subscription","value":"—"},{"label":"Free trial","value":"—"},{"label":"Endpoint","value":"https://three.ws/api/okx/3d/forge-status"},{"label":"Description","value":"Reports the live state of any three.ws forge generation job and returns the fini…"}],"chainIndex":196,"contractAddress":"0x779ded0c9e1022225f8e0630b35a9b54be713736","endpoint":"https://three.ws/api/okx/3d/forge-status","fee":"0","freeTrial":null,"id":39979,"salesCount":0,"serviceDescription":"Reports the live state of any three.ws forge generation job and returns the finished model file, concept image, browser preview link and augmented-reality link once the job completes. Always free.\nProvide the job id returned when a generation was accepted. Optionally provide the original description so the preview pages carry a title. No payment, account, or key is required to call it.","serviceId":"1ade7ec4-1ed3-40db-985b-3b5c07c8e4e1","serviceName":"Forge Job Status","serviceType":"A2MCP","subscription":[]},{"cells":[{"label":"#","value":"2"},{"label":"Name","value":"3D Studio Service Catalog"},{"label":"Type","value":"API service"},{"label":"Fee","value":"0 USDT"},{"label":"Subscription","value":"—"},{"label":"Free trial","value":"—"},{"label":"Endpoint","value":"https://three.ws/api/okx/3d/catalog"},{"label":"Description","value":"Free machine-readable index of every three.ws 3D Studio service sold here: names…"}],"chainIndex":196,"contractAddress":"0x779ded0c9e1022225f8e0630b35a9b54be713736","endpoint":"https://three.ws/api/okx/3d/catalog","fee":"0","freeTrial":null,"id":39980,"salesCount":0,"serviceDescription":"Free machine-readable index of every three.ws 3D Studio service sold here: names, descriptions, prices, endpoints, and input formats, always in sync with the live services.\nProvide nothing. No parameters, no payment, and no account are required. Returns the full service list with names, prices, endpoints, and the exact input each one expects.","serviceId":"5c413ae3-423e-46c4-9476-ff7129e06a15","serviceName":"3D Studio Service Catalog","serviceType":"A2MCP","subscription":[]},{"cells":[{"label":"#","value":"3"},{"label":"Name","value":"3D Studio Health Status"},{"label":"Type","value":"API service"},{"label":"Fee","value":"0 USDT"},{"label":"Subscription","value":"—"},{"label":"Free trial","value":"—"},{"label":"Endpoint","value":"https://three.ws/api/okx/3d/health"},{"label":"Description","value":"Free live health status for the systems behind every paid service: generation, r…"}],"chainIndex":196,"contractAddress":"0x779ded0c9e1022225f8e0630b35a9b54be713736","endpoint":"https://three.ws/api/okx/3d/health","fee":"0","freeTrial":null,"id":39981,"salesCount":0,"serviceDescription":"Free live health status for the systems behind every paid service: generation, rigging, rendering, storage, and the payment rail, from real checks rather than a fixed reply.\nProvide nothing. No parameters, no payment, and no account are required. Returns a per-system reading so a buyer can confirm everything is up before paying for a job.","serviceId":"1cbb53e9-09ee-4600-8efb-2741f840b66c","serviceName":"3D Studio Health Status","serviceType":"A2MCP","subscription":[]},{"cells":[{"label":"#","value":"4"},{"label":"Name","value":"Forge 3D Draft"},{"label":"Type","value":"API service"},{"label":"Fee","value":"0.01 USDT"},{"label":"Subscription","value":"—"},{"label":"Free trial","value":"—"},{"label":"Endpoint","value":"https://three.ws/api/okx/3d/forge-draft"},{"label":"Description","value":"Turns a text description of one object or character into a downloadable textured…"}],"chainIndex":196,"contractAddress":"0x779ded0c9e1022225f8e0630b35a9b54be713736","endpoint":"https://three.ws/api/okx/3d/forge-draft","fee":"0.01","freeTrial":null,"id":39975,"salesCount":0,"serviceDescription":"Turns a text description of one object or character into a downloadable textured 3D model in GLB format, with a browser preview link and an augmented-reality link that places it in a real room.\nProvide a text description of a single subject, 3 to 1000 characters, naming its style and main colours. An aspect ratio is optional. Returns a job id to poll on the free status service.","serviceId":"45815ebe-1c7d-4ed0-9b13-cb8b6ea7a3da","serviceName":"Forge 3D Draft","serviceType":"A2MCP","subscription":[]},{"cells":[{"label":"#","value":"5"},{"label":"Name","value":"Forge 3D Standard"},{"label":"Type","value":"API service"},{"label":"Fee","value":"0.05 USDT"},{"label":"Subscription","value":"—"},{"label":"Free trial","value":"—"},{"label":"Endpoint","value":"https://three.ws/api/okx/3d/forge-standard"},{"label":"Description","value":"Turns a text description of one object or character into a downloadable textured…"}],"chainIndex":196,"contractAddress":"0x779ded0c9e1022225f8e0630b35a9b54be713736","endpoint":"https://three.ws/api/okx/3d/forge-standard","fee":"0.05","freeTrial":null,"id":39976,"salesCount":0,"serviceDescription":"Turns a text description of one object or character into a downloadable textured 3D model in GLB format on the standard quality pass, with a browser preview link and an augmented-reality link.\nProvide a text description of a single subject, 3 to 1000 characters, naming its style and main colours. An aspect ratio is optional. Returns a job id to poll on the free status service.","serviceId":"6e6f7841-cd93-4b4d-b411-74cb6a9bcf27","serviceName":"Forge 3D Standard","serviceType":"A2MCP","subscription":[]},{"cells":[{"label":"#","value":"6"},{"label":"Name","value":"Forge 3D HD"},{"label":"Type","value":"API service"},{"label":"Fee","value":"0.25 USDT"},{"label":"Subscription","value":"—"},{"label":"Free trial","value":"—"},{"label":"Endpoint","value":"https://three.ws/api/okx/3d/forge-hd"},{"label":"Description","value":"Turns a text description of one object or character into a downloadable textured…"}],"chainIndex":196,"contractAddress":"0x779ded0c9e1022225f8e0630b35a9b54be713736","endpoint":"https://three.ws/api/okx/3d/forge-hd","fee":"0.25","freeTrial":null,"id":39977,"salesCount":0,"serviceDescription":"Turns a text description of one object or character into a downloadable textured 3D model in GLB format on the highest detail pass, with a browser preview link and an augmented-reality link.\nProvide a text description of a single subject, 3 to 1000 characters, naming its style and main colours. An aspect ratio is optional. This pass runs longer, so keep polling the free status service.","serviceId":"e60f3af4-0364-4f8b-9c9a-68eb3ff00da1","serviceName":"Forge 3D HD","serviceType":"A2MCP","subscription":[]},{"cells":[{"label":"#","value":"7"},{"label":"Name","value":"Forge 3D from Image"},{"label":"Type","value":"API service"},{"label":"Fee","value":"0.25 USDT"},{"label":"Subscription","value":"—"},{"label":"Free trial","value":"—"},{"label":"Endpoint","value":"https://three.ws/api/okx/3d/forge-image"},{"label":"Description","value":"Rebuilds a downloadable textured 3D model in GLB format from photographs or rend…"}],"chainIndex":196,"contractAddress":"0x779ded0c9e1022225f8e0630b35a9b54be713736","endpoint":"https://three.ws/api/okx/3d/forge-image","fee":"0.25","freeTrial":null,"id":39978,"salesCount":0,"serviceDescription":"Rebuilds a downloadable textured 3D model in GLB format from photographs or rendered views of one object, with a browser preview link and an augmented-reality link that places it in a real room.\nProvide one to four publicly reachable image links showing the same subject. A short text description is optional and sharpens the result. Returns a job id to poll on the free status service.","serviceId":"e52b88ba-d3ab-45c2-9f0f-c79f7abab588","serviceName":"Forge 3D from Image","serviceType":"A2MCP","subscription":[]}],"page":1,"pageSize":100,"total":7}]}diff --git a/prompts/okx-ai/e2e-evidence/30-case1-free-lane.json b/prompts/okx-ai/e2e-evidence/30-case1-free-lane.jsonindex 54348097e..54470d56e 100644--- a/prompts/okx-ai/e2e-evidence/30-case1-free-lane.json+++ b/prompts/okx-ai/e2e-evidence/30-case1-free-lane.json@@ -7,37 +7,48 @@{"name": "generation","ok": true,- "latency_ms": 52,- "status": 400+ "latency_ms": 37,+ "tiers": 3,+ "backends": 11+ },+ {+ "name": "submit-latency",+ "ok": true,+ "latency_ms": 195,+ "window_minutes": 60,+ "samples": 0,+ "errors": 0,+ "p50_ms": null,+ "p90_ms": null},{"name": "render","ok": true,- "latency_ms": 34,+ "latency_ms": 23,"poses": 28},{"name": "storage","ok": true,- "latency_ms": 174+ "latency_ms": 117},{"name": "retarget","ok": true,- "latency_ms": 32,+ "latency_ms": 24,"clips": 112},{"name": "payment-rail","ok": true,- "latency_ms": 489,+ "latency_ms": 909,"settleable": true,- "block": "66852007",+ "block": "69606946","token": "USD₮0","facilitator_configured": false}],- "checkedAt": "2026-08-01T21:50:43.562Z"+ "checkedAt": "2026-09-02T19:06:23.596Z"}},"catalog": {@@ -47,6 +58,204 @@"okxAgentId": 2632,"chain": "eip155:196","services": [+ {+ "id": "forge-draft",+ "name": "Forge 3D Draft",+ "kind": "a2mcp",+ "description": {+ "capability": "Turns a text description of one object or character into a downloadable textured 3D model in GLB format, with a browser preview link and an augmented-reality link that places it in a real room.",+ "input": "Provide a text description of a single subject, 3 to 1000 characters, naming its style and main colours. An aspect ratio is optional. Returns a job id to poll on the free status service."+ },+ "price_usd": "0.01",+ "endpoint": "https://three.ws/api/okx/3d/forge-draft",+ "tool": "forge_3d",+ "input_schema": {+ "type": "object",+ "required": [+ "prompt"+ ],+ "additionalProperties": false,+ "properties": {+ "prompt": {+ "type": "string",+ "minLength": 3,+ "maxLength": 1000+ },+ "aspect_ratio": {+ "type": "string",+ "enum": [+ "1:1",+ "4:3",+ "3:4",+ "16:9",+ "9:16"+ ]+ }+ }+ }+ },+ {+ "id": "forge-standard",+ "name": "Forge 3D Standard",+ "kind": "a2mcp",+ "description": {+ "capability": "Turns a text description of one object or character into a downloadable textured 3D model in GLB format on the standard quality pass, with a browser preview link and an augmented-reality link.",+ "input": "Provide a text description of a single subject, 3 to 1000 characters, naming its style and main colours. An aspect ratio is optional. Returns a job id to poll on the free status service."+ },+ "price_usd": "0.05",+ "endpoint": "https://three.ws/api/okx/3d/forge-standard",+ "tool": "forge_3d",+ "input_schema": {+ "type": "object",+ "required": [+ "prompt"+ ],+ "additionalProperties": false,+ "properties": {+ "prompt": {+ "type": "string",+ "minLength": 3,+ "maxLength": 1000+ },+ "aspect_ratio": {+ "type": "string",+ "enum": [+ "1:1",+ "4:3",+ "3:4",+ "16:9",+ "9:16"+ ]+ }+ }+ }+ },+ {+ "id": "forge-hd",+ "name": "Forge 3D HD",+ "kind": "a2mcp",+ "description": {+ "capability": "Turns a text description of one object or character into a downloadable textured 3D model in GLB format on the highest detail pass, with a browser preview link and an augmented-reality link.",+ "input": "Provide a text description of a single subject, 3 to 1000 characters, naming its style and main colours. An aspect ratio is optional. This pass runs longer, so keep polling the free status service."+ },+ "price_usd": "0.25",+ "endpoint": "https://three.ws/api/okx/3d/forge-hd",+ "tool": "forge_3d",+ "input_schema": {+ "type": "object",+ "required": [+ "prompt"+ ],+ "additionalProperties": false,+ "properties": {+ "prompt": {+ "type": "string",+ "minLength": 3,+ "maxLength": 1000+ },+ "aspect_ratio": {+ "type": "string",+ "enum": [+ "1:1",+ "4:3",+ "3:4",+ "16:9",+ "9:16"+ ]+ }+ }+ }+ },+ {+ "id": "forge-image",+ "name": "Forge 3D from Image",+ "kind": "a2mcp",+ "description": {+ "capability": "Rebuilds a downloadable textured 3D model in GLB format from photographs or rendered views of one object, with a browser preview link and an augmented-reality link that places it in a real room.",+ "input": "Provide one to four publicly reachable image links showing the same subject. A short text description is optional and sharpens the result. Returns a job id to poll on the free status service."+ },+ "price_usd": "0.25",+ "endpoint": "https://three.ws/api/okx/3d/forge-image",+ "tool": "forge_3d",+ "input_schema": {+ "type": "object",+ "required": [+ "image_urls"+ ],+ "additionalProperties": false,+ "properties": {+ "image_urls": {+ "type": "array",+ "minItems": 1,+ "maxItems": 4,+ "items": {+ "type": "string",+ "format": "uri",+ "pattern": "^https://"+ }+ },+ "prompt": {+ "type": "string",+ "minLength": 3,+ "maxLength": 1000+ }+ }+ }+ },+ {+ "id": "forge-status",+ "name": "Forge Job Status",+ "kind": "a2mcp",+ "description": {+ "capability": "Reports the live state of any three.ws forge generation job and returns the finished model file, concept image, browser preview link and augmented-reality link once the job completes. Always free.",+ "input": "Provide the job id returned when a generation was accepted. Optionally provide the original description so the preview pages carry a title. No payment, account, or key is required to call it."+ },+ "price_usd": "0",+ "endpoint": "https://three.ws/api/okx/3d/forge-status",+ "tool": "forge_status",+ "input_schema": {+ "type": "object",+ "required": [+ "job_id"+ ],+ "additionalProperties": false,+ "properties": {+ "job_id": {+ "type": "string",+ "minLength": 8,+ "maxLength": 1024+ },+ "title": {+ "type": "string",+ "maxLength": 200+ }+ }+ }+ },+ {+ "id": "catalog",+ "name": "3D Studio Service Catalog",+ "kind": "rest",+ "description": {+ "capability": "Free machine-readable index of every three.ws 3D Studio service sold here: names, descriptions, prices, endpoints, and input formats, always in sync with the live services.",+ "input": "Provide nothing. No parameters, no payment, and no account are required. Returns the full service list with names, prices, endpoints, and the exact input each one expects."+ },+ "price_usd": "0",+ "endpoint": "https://three.ws/api/okx/3d/catalog"+ },+ {+ "id": "health",+ "name": "3D Studio Health Status",+ "kind": "rest",+ "description": {+ "capability": "Free live health status for the systems behind every paid service: generation, rigging, rendering, storage, and the payment rail, from real checks rather than a fixed reply.",+ "input": "Provide nothing. No parameters, no payment, and no account are required. Returns a per-system reading so a buyer can confirm everything is up before paying for a job."+ },+ "price_usd": "0",+ "endpoint": "https://three.ws/api/okx/3d/health"+ }+ ],+ "unlisted": [{"id": "identity-studio","name": "Agent Identity Studio",@@ -352,31 +561,25 @@}}}- },- {- "id": "catalog",- "name": "3D Studio Service Catalog",- "kind": "rest",- "description": {- "capability": "Free machine-readable index of every three.ws 3D Studio service on OKX.AI: names, descriptions, prices, endpoints, and input formats, always in sync with the live services.",- "input": "Provide nothing. No parameters, no payment, no account required. Example: fetch the link to list every service with names, prices, and input details."- },- "price_usd": "0",- "endpoint": "https://three.ws/api/okx/3d/catalog"- },- {- "id": "health",- "name": "3D Studio Health Status",- "kind": "rest",- "description": {- "capability": "Free live health status for the systems behind every paid service: generation, rigging, rendering, storage, and the payment rail, from real checks rather than a fixed reply.",- "input": "Provide nothing. No parameters, no payment, no account required. Example: fetch the link to confirm all systems are up before buying a paid service."- },- "price_usd": "0",- "endpoint": "https://three.ws/api/okx/3d/health"}],"docs": "https://three.ws/docs/okx-marketplace"}+ },+ "freeToolsOnPaidRow": {+ "forge_status": {+ "status": 200,+ "isToolError": true,+ "structured": {+ "ok": false,+ "error": "unknown_job",+ "message": "Malformed job id."+ },+ "text": "unknown_job: Malformed job id."+ },+ "getting_started": {+ "status": 200,+ "text": "# three.ws Forge, Forge 3D Draft: Getting Started\n\nText or images to a real, downloadable 3D model (GLB), with a browser preview and an augmented-reality link that places it in a real room.\n\n## Tools (this getting_started tool is free)\n- forge_3d ($0.01/call): $0.01 per call, charged only when the job is accepted.\n- forge_status: FREE.\n- look_at_model: FREE.\n\n## Access\n- Pay per call with x402 on "+ }}}\ No newline at end of filediff --git a/prompts/okx-ai/e2e-evidence/53-case5d-garbage.json b/prompts/okx-ai/e2e-evidence/53-case5d-garbage.jsonindex f905a15cc..9043d0ba5 100644--- a/prompts/okx-ai/e2e-evidence/53-case5d-garbage.json+++ b/prompts/okx-ai/e2e-evidence/53-case5d-garbage.json@@ -4,7 +4,9 @@"body": {"error": "invalid_payment","error_description": "X-PAYMENT JSON parse failed: Unexpected token '�', \"��~k��j_�k)��ߡy�^\" is not valid JSON"- }+ },+ "receiptHeader": null,+ "structured": null},"wrongShape": {"status": 402,@@ -12,8 +14,18 @@"x402Version": 2,"error": "X Layer payment must carry payload.authorization + payload.signature (EIP-3009)","resource": {- "url": "https://three.ws/api/okx/3d/text-to-3d",- "mimeType": "application/json"+ "url": "https://three.ws/api/okx/3d/forge-draft",+ "description": "three.ws Forge, Forge 3D Draft: A2MCP service that turns a text description into a downloadable 3D model (GLB) with a browser viewer and an augmented-reality link. $0.01 per call on X Layer via x402; job polling is free. Operated by three.ws.",+ "mimeType": "application/json",+ "serviceName": "three.ws Forge, Forge 3D Draft",+ "tags": [+ "x402",+ "mcp",+ "3d",+ "forge",+ "okx"+ ],+ "iconUrl": "https://three.ws/favicon.ico"},"accepts": [{@@ -23,7 +35,7 @@"payTo": "0x4022de2D36C334E73C7a108805Cea11C0564f402","maxTimeoutSeconds": 86400,"asset": "0x779ded0c9e1022225f8e0630b35a9b54be713736",- "resource": "https://three.ws/api/okx/3d/text-to-3d",+ "resource": "https://three.ws/api/okx/3d/forge-draft","extra": {"symbol": "USDT","name": "USD₮0",@@ -34,12 +46,12 @@},{"scheme": "exact",- "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","amount": "10000",+ "maxTimeoutSeconds": 60,+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","payTo": "wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU","asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",- "maxTimeoutSeconds": 60,- "resource": "https://three.ws/api/okx/3d/text-to-3d","extra": {"name": "USDC","decimals": 6,@@ -48,44 +60,337 @@},{"scheme": "exact",- "network": "eip155:8453",- "amount": "10000",- "payTo": "0x4022de2d36c334e73c7a108805cea11c0564f402",- "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",+ "amount": "10000000","maxTimeoutSeconds": 60,- "resource": "https://three.ws/api/okx/3d/text-to-3d",+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",+ "payTo": "wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU",+ "asset": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump","extra": {- "name": "USD Coin",- "version": "2",- "decimals": 6+ "name": "THREE",+ "decimals": 6,+ "feePayer": "WwwuGbqHrwF5RG89KhUbmRWEvjnRH9k5kVM5p7T3WwW"}},{"scheme": "exact",- "network": "eip155:8453","amount": "10000",+ "maxTimeoutSeconds": 60,+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "network": "eip155:8453","payTo": "0x4022de2d36c334e73c7a108805cea11c0564f402","asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",- "maxTimeoutSeconds": 60,- "resource": "https://three.ws/api/okx/3d/text-to-3d","extra": {"name": "USD Coin","version": "2",- "decimals": 6,- "assetTransferMethod": "permit2",- "supportsEip2612": true+ "decimals": 6+ }+ }+ ],+ "extensions": {+ "bazaar": {+ "discoverable": true,+ "info": {+ "input": {+ "type": "http",+ "method": "POST",+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "forge_3d",+ "arguments": {+ "prompt": "a low-poly orange fox sitting down"+ }+ }+ },+ "bodyType": "json"+ },+ "output": {+ "type": "json",+ "example": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "Job accepted. Call forge_status with job_id f1.abc123 until status is \"done\"."+ }+ ],+ "structuredContent": {+ "ok": true,+ "status": "pending",+ "job": "f1.abc123",+ "poll_tool": "forge_status",+ "poll_endpoint": "https://three.ws/api/okx/3d/forge-status",+ "format": "glb",+ "etaSeconds": 45+ }+ }+ }+ }+ },+ "schema": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "properties": {+ "input": {+ "type": "object",+ "properties": {+ "type": {+ "type": "string",+ "const": "http"+ },+ "method": {+ "type": "string",+ "enum": [+ "POST",+ "PUT",+ "PATCH"+ ]+ },+ "bodyType": {+ "type": "string",+ "enum": [+ "json",+ "form-data",+ "text"+ ]+ },+ "body": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "required": [+ "jsonrpc",+ "method"+ ],+ "properties": {+ "jsonrpc": {+ "type": "string",+ "const": "2.0"+ },+ "id": {+ "type": [+ "string",+ "number"+ ]+ },+ "method": {+ "type": "string",+ "enum": [+ "initialize",+ "tools/list",+ "tools/call",+ "ping"+ ],+ "description": "MCP JSON-RPC method."+ },+ "params": {+ "type": "object",+ "description": "For tools/call: { name, arguments }. Tool names: forge_3d (paid, $0.01), forge_status (free job polling), getting_started (free overview). See tools/list."+ }+ }+ }+ },+ "required": [+ "type",+ "method",+ "bodyType",+ "body"+ ],+ "additionalProperties": false+ },+ "output": {+ "type": "object",+ "properties": {+ "type": {+ "type": "string"+ },+ "example": {+ "type": "object",+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "properties": {+ "jsonrpc": {+ "type": "string",+ "const": "2.0"+ },+ "id": {+ "type": [+ "string",+ "number"+ ]+ },+ "result": {+ "type": "object",+ "properties": {+ "content": {+ "type": "array",+ "items": {+ "type": "object",+ "required": [+ "type",+ "text"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "text"+ ]+ },+ "text": {+ "type": "string"+ }+ }+ }+ }+ }+ },+ "error": {+ "type": "object",+ "properties": {+ "code": {+ "type": "number"+ },+ "message": {+ "type": "string"+ }+ }+ }+ }+ }+ },+ "required": [+ "type"+ ]+ }+ },+ "required": [+ "input"+ ]+ }+ },+ "offer-receipt": {+ "includeTxHash": false,+ "offerValiditySeconds": 60,+ "info": {+ "offers": [+ {+ "format": "jws",+ "acceptIndex": 0,+ "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDp3ZWI6dGhyZWUud3Mja2V5LTEifQ.eyJhbW91bnQiOiIxMDAwMCIsImFzc2V0IjoiMHg3NzlkZWQwYzllMTAyMjIyNWY4ZTA2MzBiMzVhOWI1NGJlNzEzNzM2IiwibmV0d29yayI6ImVpcDE1NToxOTYiLCJwYXlUbyI6IjB4NDAyMmRlMkQzNkMzMzRFNzNDN2ExMDg4MDVDZWExMUMwNTY0ZjQwMiIsInJlc291cmNlVXJsIjoiaHR0cHM6Ly90aHJlZS53cy9hcGkvb2t4LzNkL2ZvcmdlLWRyYWZ0Iiwic2NoZW1lIjoiZXhhY3QiLCJ2YWxpZFVudGlsIjoxNzg4Mzc2MzA4LCJ2ZXJzaW9uIjoxfQ.QAwpFNpA28k4iIi3Zhkq2V9CBaTLWYoX2yRZ8Gybm4zisdARdjV7wbHftq8T0kT0bx6DxWUGVyFKd8nsBz6sDg"+ },+ {+ "format": "jws",+ "acceptIndex": 1,+ "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDp3ZWI6dGhyZWUud3Mja2V5LTEifQ.eyJhbW91bnQiOiIxMDAwMCIsImFzc2V0IjoiRVBqRldkZDVBdWZxU1NxZU0ycU4xeHp5YmFwQzhHNHdFR0drWnd5VER0MXYiLCJuZXR3b3JrIjoic29sYW5hOjVleWt0NFVzRnY4UDhOSmRUUkVwWTF2enFLcVpLdmRwIiwicGF5VG8iOiJ3d3d3d0R4RldSbjdncmdyM0VzcnNnNUM2TnZEb0RIU0E0Z2FDZmZjY3JVIiwicmVzb3VyY2VVcmwiOiJodHRwczovL3RocmVlLndzL2FwaS9va3gvM2QvZm9yZ2UtZHJhZnQiLCJzY2hlbWUiOiJleGFjdCIsInZhbGlkVW50aWwiOjE3ODgzNzYzMDgsInZlcnNpb24iOjF9.QJNhqicDloEfcVfxgKoqVqSfIiya1y_DiIzn0ajdpcwfWUADydeeOMdyRJo8TFtoS3qnolEk3Ll1vpSIV5gdDw"+ },+ {+ "format": "jws",+ "acceptIndex": 2,+ "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDp3ZWI6dGhyZWUud3Mja2V5LTEifQ.eyJhbW91bnQiOiIxMDAwMDAwMCIsImFzc2V0IjoiRmVNYkRvWDdSMVBzYzRHRWN2SmRzYk5iWkEzYmZ6dGN5RENhdEpWSnB1bXAiLCJuZXR3b3JrIjoic29sYW5hOjVleWt0NFVzRnY4UDhOSmRUUkVwWTF2enFLcVpLdmRwIiwicGF5VG8iOiJ3d3d3d0R4RldSbjdncmdyM0VzcnNnNUM2TnZEb0RIU0E0Z2FDZmZjY3JVIiwicmVzb3VyY2VVcmwiOiJodHRwczovL3RocmVlLndzL2FwaS9va3gvM2QvZm9yZ2UtZHJhZnQiLCJzY2hlbWUiOiJleGFjdCIsInZhbGlkVW50aWwiOjE3ODgzNzYzMDgsInZlcnNpb24iOjF9.xkI-neVib4irQ0YEvDm-jI3B6DG07gOmyoYz7C59AofTWtIrEG58keko3DghfQ3n0anyktP9s7z7rAHRzUI-CQ"+ },+ {+ "format": "jws",+ "acceptIndex": 3,+ "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDp3ZWI6dGhyZWUud3Mja2V5LTEifQ.eyJhbW91bnQiOiIxMDAwMCIsImFzc2V0IjoiMHg4MzM1ODlmQ0Q2ZURiNkUwOGY0YzdDMzJENGY3MWI1NGJkQTAyOTEzIiwibmV0d29yayI6ImVpcDE1NTo4NDUzIiwicGF5VG8iOiIweDQwMjJkZTJkMzZjMzM0ZTczYzdhMTA4ODA1Y2VhMTFjMDU2NGY0MDIiLCJyZXNvdXJjZVVybCI6Imh0dHBzOi8vdGhyZWUud3MvYXBpL29reC8zZC9mb3JnZS1kcmFmdCIsInNjaGVtZSI6ImV4YWN0IiwidmFsaWRVbnRpbCI6MTc4ODM3NjMwOCwidmVyc2lvbiI6MX0.Pf2FYRsrfIKI7YcAkFwC8HqRoJI9WBxzUaz-6LQixGQ0QIxC8vP7jP8oe3swi7tLipbm6__AfkCvzSNEbetuAA"+ }+ ]+ },+ "schema": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "properties": {+ "offers": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "format": {+ "type": "string"+ },+ "acceptIndex": {+ "type": "integer"+ },+ "payload": {+ "type": "object",+ "properties": {+ "version": {+ "type": "integer"+ },+ "resourceUrl": {+ "type": "string"+ },+ "scheme": {+ "type": "string"+ },+ "network": {+ "type": "string"+ },+ "asset": {+ "type": "string"+ },+ "payTo": {+ "type": "string"+ },+ "amount": {+ "type": "string"+ },+ "validUntil": {+ "type": "integer"+ }+ },+ "required": [+ "version",+ "resourceUrl",+ "scheme",+ "network",+ "asset",+ "payTo",+ "amount"+ ]+ },+ "signature": {+ "type": "string"+ }+ },+ "required": [+ "format",+ "signature"+ ]+ }+ }+ },+ "required": [+ "offers"+ ]}}- ]- }+ }+ },+ "receiptHeader": null,+ "structured": null},"emptyString": {"status": 402,"body": {"x402Version": 2,+ "error": "X-PAYMENT header is required","resource": {- "url": "https://three.ws/api/okx/3d/text-to-3d",- "mimeType": "application/json"+ "url": "https://three.ws/api/okx/3d/forge-draft",+ "description": "three.ws Forge, Forge 3D Draft: A2MCP service that turns a text description into a downloadable 3D model (GLB) with a browser viewer and an augmented-reality link. $0.01 per call on X Layer via x402; job polling is free. Operated by three.ws.",+ "mimeType": "application/json",+ "serviceName": "three.ws Forge, Forge 3D Draft",+ "tags": [+ "x402",+ "mcp",+ "3d",+ "forge",+ "okx"+ ],+ "iconUrl": "https://three.ws/favicon.ico"},"accepts": [{@@ -95,7 +400,7 @@"payTo": "0x4022de2D36C334E73C7a108805Cea11C0564f402","maxTimeoutSeconds": 86400,"asset": "0x779ded0c9e1022225f8e0630b35a9b54be713736",- "resource": "https://three.ws/api/okx/3d/text-to-3d",+ "resource": "https://three.ws/api/okx/3d/forge-draft","extra": {"symbol": "USDT","name": "USD₮0",@@ -106,12 +411,12 @@},{"scheme": "exact",- "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","amount": "10000",+ "maxTimeoutSeconds": 60,+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","payTo": "wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU","asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",- "maxTimeoutSeconds": 60,- "resource": "https://three.ws/api/okx/3d/text-to-3d","extra": {"name": "USDC","decimals": 6,@@ -120,42 +425,326 @@},{"scheme": "exact",- "network": "eip155:8453",- "amount": "10000",- "payTo": "0x4022de2d36c334e73c7a108805cea11c0564f402",- "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",+ "amount": "10000000","maxTimeoutSeconds": 60,- "resource": "https://three.ws/api/okx/3d/text-to-3d",+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",+ "payTo": "wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU",+ "asset": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump","extra": {- "name": "USD Coin",- "version": "2",- "decimals": 6+ "name": "THREE",+ "decimals": 6,+ "feePayer": "WwwuGbqHrwF5RG89KhUbmRWEvjnRH9k5kVM5p7T3WwW"}},{"scheme": "exact",- "network": "eip155:8453","amount": "10000",+ "maxTimeoutSeconds": 60,+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "network": "eip155:8453","payTo": "0x4022de2d36c334e73c7a108805cea11c0564f402","asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",- "maxTimeoutSeconds": 60,- "resource": "https://three.ws/api/okx/3d/text-to-3d","extra": {"name": "USD Coin","version": "2",- "decimals": 6,- "assetTransferMethod": "permit2",- "supportsEip2612": true+ "decimals": 6+ }+ }+ ],+ "extensions": {+ "bazaar": {+ "discoverable": true,+ "info": {+ "input": {+ "type": "http",+ "method": "POST",+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "forge_3d",+ "arguments": {+ "prompt": "a low-poly orange fox sitting down"+ }+ }+ },+ "bodyType": "json"+ },+ "output": {+ "type": "json",+ "example": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "Job accepted. Call forge_status with job_id f1.abc123 until status is \"done\"."+ }+ ],+ "structuredContent": {+ "ok": true,+ "status": "pending",+ "job": "f1.abc123",+ "poll_tool": "forge_status",+ "poll_endpoint": "https://three.ws/api/okx/3d/forge-status",+ "format": "glb",+ "etaSeconds": 45+ }+ }+ }+ }+ },+ "schema": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "properties": {+ "input": {+ "type": "object",+ "properties": {+ "type": {+ "type": "string",+ "const": "http"+ },+ "method": {+ "type": "string",+ "enum": [+ "POST",+ "PUT",+ "PATCH"+ ]+ },+ "bodyType": {+ "type": "string",+ "enum": [+ "json",+ "form-data",+ "text"+ ]+ },+ "body": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "required": [+ "jsonrpc",+ "method"+ ],+ "properties": {+ "jsonrpc": {+ "type": "string",+ "const": "2.0"+ },+ "id": {+ "type": [+ "string",+ "number"+ ]+ },+ "method": {+ "type": "string",+ "enum": [+ "initialize",+ "tools/list",+ "tools/call",+ "ping"+ ],+ "description": "MCP JSON-RPC method."+ },+ "params": {+ "type": "object",+ "description": "For tools/call: { name, arguments }. Tool names: forge_3d (paid, $0.01), forge_status (free job polling), getting_started (free overview). See tools/list."+ }+ }+ }+ },+ "required": [+ "type",+ "method",+ "bodyType",+ "body"+ ],+ "additionalProperties": false+ },+ "output": {+ "type": "object",+ "properties": {+ "type": {+ "type": "string"+ },+ "example": {+ "type": "object",+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "properties": {+ "jsonrpc": {+ "type": "string",+ "const": "2.0"+ },+ "id": {+ "type": [+ "string",+ "number"+ ]+ },+ "result": {+ "type": "object",+ "properties": {+ "content": {+ "type": "array",+ "items": {+ "type": "object",+ "required": [+ "type",+ "text"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "text"+ ]+ },+ "text": {+ "type": "string"+ }+ }+ }+ }+ }+ },+ "error": {+ "type": "object",+ "properties": {+ "code": {+ "type": "number"+ },+ "message": {+ "type": "string"+ }+ }+ }+ }+ }+ },+ "required": [+ "type"+ ]+ }+ },+ "required": [+ "input"+ ]+ }+ },+ "offer-receipt": {+ "includeTxHash": false,+ "offerValiditySeconds": 60,+ "info": {+ "offers": [+ {+ "format": "jws",+ "acceptIndex": 0,+ "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDp3ZWI6dGhyZWUud3Mja2V5LTEifQ.eyJhbW91bnQiOiIxMDAwMCIsImFzc2V0IjoiMHg3NzlkZWQwYzllMTAyMjIyNWY4ZTA2MzBiMzVhOWI1NGJlNzEzNzM2IiwibmV0d29yayI6ImVpcDE1NToxOTYiLCJwYXlUbyI6IjB4NDAyMmRlMkQzNkMzMzRFNzNDN2ExMDg4MDVDZWExMUMwNTY0ZjQwMiIsInJlc291cmNlVXJsIjoiaHR0cHM6Ly90aHJlZS53cy9hcGkvb2t4LzNkL2ZvcmdlLWRyYWZ0Iiwic2NoZW1lIjoiZXhhY3QiLCJ2YWxpZFVudGlsIjoxNzg4Mzc2MzA4LCJ2ZXJzaW9uIjoxfQ.QAwpFNpA28k4iIi3Zhkq2V9CBaTLWYoX2yRZ8Gybm4zisdARdjV7wbHftq8T0kT0bx6DxWUGVyFKd8nsBz6sDg"+ },+ {+ "format": "jws",+ "acceptIndex": 1,+ "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDp3ZWI6dGhyZWUud3Mja2V5LTEifQ.eyJhbW91bnQiOiIxMDAwMCIsImFzc2V0IjoiRVBqRldkZDVBdWZxU1NxZU0ycU4xeHp5YmFwQzhHNHdFR0drWnd5VER0MXYiLCJuZXR3b3JrIjoic29sYW5hOjVleWt0NFVzRnY4UDhOSmRUUkVwWTF2enFLcVpLdmRwIiwicGF5VG8iOiJ3d3d3d0R4RldSbjdncmdyM0VzcnNnNUM2TnZEb0RIU0E0Z2FDZmZjY3JVIiwicmVzb3VyY2VVcmwiOiJodHRwczovL3RocmVlLndzL2FwaS9va3gvM2QvZm9yZ2UtZHJhZnQiLCJzY2hlbWUiOiJleGFjdCIsInZhbGlkVW50aWwiOjE3ODgzNzYzMDgsInZlcnNpb24iOjF9.QJNhqicDloEfcVfxgKoqVqSfIiya1y_DiIzn0ajdpcwfWUADydeeOMdyRJo8TFtoS3qnolEk3Ll1vpSIV5gdDw"+ },+ {+ "format": "jws",+ "acceptIndex": 2,+ "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDp3ZWI6dGhyZWUud3Mja2V5LTEifQ.eyJhbW91bnQiOiIxMDAwMDAwMCIsImFzc2V0IjoiRmVNYkRvWDdSMVBzYzRHRWN2SmRzYk5iWkEzYmZ6dGN5RENhdEpWSnB1bXAiLCJuZXR3b3JrIjoic29sYW5hOjVleWt0NFVzRnY4UDhOSmRUUkVwWTF2enFLcVpLdmRwIiwicGF5VG8iOiJ3d3d3d0R4RldSbjdncmdyM0VzcnNnNUM2TnZEb0RIU0E0Z2FDZmZjY3JVIiwicmVzb3VyY2VVcmwiOiJodHRwczovL3RocmVlLndzL2FwaS9va3gvM2QvZm9yZ2UtZHJhZnQiLCJzY2hlbWUiOiJleGFjdCIsInZhbGlkVW50aWwiOjE3ODgzNzYzMDgsInZlcnNpb24iOjF9.xkI-neVib4irQ0YEvDm-jI3B6DG07gOmyoYz7C59AofTWtIrEG58keko3DghfQ3n0anyktP9s7z7rAHRzUI-CQ"+ },+ {+ "format": "jws",+ "acceptIndex": 3,+ "signature": "eyJhbGciOiJFZERTQSIsImtpZCI6ImRpZDp3ZWI6dGhyZWUud3Mja2V5LTEifQ.eyJhbW91bnQiOiIxMDAwMCIsImFzc2V0IjoiMHg4MzM1ODlmQ0Q2ZURiNkUwOGY0YzdDMzJENGY3MWI1NGJkQTAyOTEzIiwibmV0d29yayI6ImVpcDE1NTo4NDUzIiwicGF5VG8iOiIweDQwMjJkZTJkMzZjMzM0ZTczYzdhMTA4ODA1Y2VhMTFjMDU2NGY0MDIiLCJyZXNvdXJjZVVybCI6Imh0dHBzOi8vdGhyZWUud3MvYXBpL29reC8zZC9mb3JnZS1kcmFmdCIsInNjaGVtZSI6ImV4YWN0IiwidmFsaWRVbnRpbCI6MTc4ODM3NjMwOCwidmVyc2lvbiI6MX0.Pf2FYRsrfIKI7YcAkFwC8HqRoJI9WBxzUaz-6LQixGQ0QIxC8vP7jP8oe3swi7tLipbm6__AfkCvzSNEbetuAA"+ }+ ]+ },+ "schema": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "properties": {+ "offers": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "format": {+ "type": "string"+ },+ "acceptIndex": {+ "type": "integer"+ },+ "payload": {+ "type": "object",+ "properties": {+ "version": {+ "type": "integer"+ },+ "resourceUrl": {+ "type": "string"+ },+ "scheme": {+ "type": "string"+ },+ "network": {+ "type": "string"+ },+ "asset": {+ "type": "string"+ },+ "payTo": {+ "type": "string"+ },+ "amount": {+ "type": "string"+ },+ "validUntil": {+ "type": "integer"+ }+ },+ "required": [+ "version",+ "resourceUrl",+ "scheme",+ "network",+ "asset",+ "payTo",+ "amount"+ ]+ },+ "signature": {+ "type": "string"+ }+ },+ "required": [+ "format",+ "signature"+ ]+ }+ }+ },+ "required": [+ "offers"+ ]}}- ]- }+ }+ },+ "receiptHeader": null,+ "structured": null},"truncatedJson": {"status": 400,"body": {"error": "invalid_payment","error_description": "X-PAYMENT JSON parse failed: Expected property name or '}' in JSON at position 28 (line 1 column 29)"- }+ },+ "receiptHeader": null,+ "structured": null}}\ No newline at end of filediff --git a/prompts/okx-ai/e2e-evidence/70-case7-legacy-rails.json b/prompts/okx-ai/e2e-evidence/70-case7-legacy-rails.jsonindex b7e461f5a..e5dd8990f 100644--- a/prompts/okx-ai/e2e-evidence/70-case7-legacy-rails.json+++ b/prompts/okx-ai/e2e-evidence/70-case7-legacy-rails.json@@ -1,69 +1,267 @@{- "x402Version": 2,- "resource": {- "url": "https://three.ws/api/okx/3d/text-to-3d",- "mimeType": "application/json"- },- "accepts": [- {- "scheme": "exact",- "network": "eip155:196",- "amount": "10000",- "payTo": "0x4022de2D36C334E73C7a108805Cea11C0564f402",- "maxTimeoutSeconds": 86400,- "asset": "0x779ded0c9e1022225f8e0630b35a9b54be713736",- "resource": "https://three.ws/api/okx/3d/text-to-3d",- "extra": {- "symbol": "USDT",- "name": "USD₮0",- "version": "1",- "transferMethod": "eip3009",- "decimals": 6- }- },- {- "scheme": "exact",- "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",- "amount": "10000",- "payTo": "wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU",- "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",- "maxTimeoutSeconds": 60,- "resource": "https://three.ws/api/okx/3d/text-to-3d",- "extra": {- "name": "USDC",- "decimals": 6,- "feePayer": "WwwuGbqHrwF5RG89KhUbmRWEvjnRH9k5kVM5p7T3WwW"- }+ "challenge": {+ "x402Version": 2,+ "error": "X-PAYMENT header is required",+ "resource": {+ "url": "https://three.ws/api/okx/3d/forge-draft",+ "description": "three.ws Forge, Forge 3D Draft: A2MCP service that turns a text description into a downloadable 3D model (GLB) with a browser viewer and an augmented-reality link. $0.01 per call on X Layer via x402; job polling is free. Operated by three.ws.",+ "mimeType": "application/json",+ "serviceName": "three.ws Forge, Forge 3D Draft",+ "tags": [+ "x402",+ "mcp",+ "3d",+ "forge",+ "okx"+ ],+ "iconUrl": "https://three.ws/favicon.ico"},- {- "scheme": "exact",- "network": "eip155:8453",- "amount": "10000",- "payTo": "0x4022de2d36c334e73c7a108805cea11c0564f402",- "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",- "maxTimeoutSeconds": 60,- "resource": "https://three.ws/api/okx/3d/text-to-3d",- "extra": {- "name": "USD Coin",- "version": "2",- "decimals": 6+ "accepts": [+ {+ "scheme": "exact",+ "network": "eip155:196",+ "amount": "10000",+ "payTo": "0x4022de2D36C334E73C7a108805Cea11C0564f402",+ "maxTimeoutSeconds": 86400,+ "asset": "0x779ded0c9e1022225f8e0630b35a9b54be713736",+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "extra": {+ "symbol": "USDT",+ "name": "USD₮0",+ "version": "1",+ "transferMethod": "eip3009",+ "decimals": 6+ }+ },+ {+ "scheme": "exact",+ "amount": "10000",+ "maxTimeoutSeconds": 60,+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",+ "payTo": "wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU",+ "asset": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",+ "extra": {+ "name": "USDC",+ "decimals": 6,+ "feePayer": "WwwuGbqHrwF5RG89KhUbmRWEvjnRH9k5kVM5p7T3WwW"+ }+ },+ {+ "scheme": "exact",+ "amount": "10000000",+ "maxTimeoutSeconds": 60,+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "network": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",+ "payTo": "wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU",+ "asset": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump",+ "extra": {+ "name": "THREE",+ "decimals": 6,+ "feePayer": "WwwuGbqHrwF5RG89KhUbmRWEvjnRH9k5kVM5p7T3WwW"+ }+ },+ {+ "scheme": "exact",+ "amount": "10000",+ "maxTimeoutSeconds": 60,+ "resource": "https://three.ws/api/okx/3d/forge-draft",+ "network": "eip155:8453",+ "payTo": "0x4022de2d36c334e73c7a108805cea11c0564f402",+ "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",+ "extra": {+ "name": "USD Coin",+ "version": "2",+ "decimals": 6+ }}- },- {- "scheme": "exact",- "network": "eip155:8453",- "amount": "10000",- "payTo": "0x4022de2d36c334e73c7a108805cea11c0564f402",- "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",- "maxTimeoutSeconds": 60,- "resource": "https://three.ws/api/okx/3d/text-to-3d",- "extra": {- "name": "USD Coin",- "version": "2",- "decimals": 6,- "assetTransferMethod": "permit2",- "supportsEip2612": true+ ],+ "extensions": {+ "bazaar": {+ "discoverable": true,+ "info": {+ "input": {+ "type": "http",+ "method": "POST",+ "body": {+ "jsonrpc": "2.0",+ "id": 1,+ "method": "tools/call",+ "params": {+ "name": "forge_3d",+ "arguments": {+ "prompt": "a low-poly orange fox sitting down"+ }+ }+ },+ "bodyType": "json"+ },+ "output": {+ "type": "json",+ "example": {+ "jsonrpc": "2.0",+ "id": 1,+ "result": {+ "content": [+ {+ "type": "text",+ "text": "Job accepted. Call forge_status with job_id f1.abc123 until status is \"done\"."+ }+ ],+ "structuredContent": {+ "ok": true,+ "status": "pending",+ "job": "f1.abc123",+ "poll_tool": "forge_status",+ "poll_endpoint": "https://three.ws/api/okx/3d/forge-status",+ "format": "glb",+ "etaSeconds": 45+ }+ }+ }+ }+ },+ "schema": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "properties": {+ "input": {+ "type": "object",+ "properties": {+ "type": {+ "type": "string",+ "const": "http"+ },+ "method": {+ "type": "string",+ "enum": [+ "POST",+ "PUT",+ "PATCH"+ ]+ },+ "bodyType": {+ "type": "string",+ "enum": [+ "json",+ "form-data",+ "text"+ ]+ },+ "body": {+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "type": "object",+ "required": [+ "jsonrpc",+ "method"+ ],+ "properties": {+ "jsonrpc": {+ "type": "string",+ "const": "2.0"+ },+ "id": {+ "type": [+ "string",+ "number"+ ]+ },+ "method": {+ "type": "string",+ "enum": [+ "initialize",+ "tools/list",+ "tools/call",+ "ping"+ ],+ "description": "MCP JSON-RPC method."+ },+ "params": {+ "type": "object",+ "description": "For tools/call: { name, arguments }. Tool names: forge_3d (paid, $0.01), forge_status (free job polling), getting_started (free overview). See tools/list."+ }+ }+ }+ },+ "required": [+ "type",+ "method",+ "bodyType",+ "body"+ ],+ "additionalProperties": false+ },+ "output": {+ "type": "object",+ "properties": {+ "type": {+ "type": "string"+ },+ "example": {+ "type": "object",+ "$schema": "https://json-schema.org/draft/2020-12/schema",+ "properties": {+ "jsonrpc": {+ "type": "string",+ "const": "2.0"+ },+ "id": {+ "type": [+ "string",+ "number"+ ]+ },+ "result": {+ "type": "object",+ "properties": {+ "content": {+ "type": "array",+ "items": {+ "type": "object",+ "required": [+ "type",+ "text"+ ],+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "text"+ ]+ },+ "text": {+ "type": "string"+ }+ }+ }+ }+ }+ },+ "error": {+ "type": "object",+ "properties": {+ "code": {+ "type": "number"+ },+ "message": {+ "type": "string"+ }+ }+ }+ }+ }+ },+ "required": [+ "type"+ ]+ }+ },+ "required": [+ "input"+ ]+ }}}- ]+ },+ "paidLeg": null}\ No newline at end of filediff --git a/scripts/okx-e2e-gauntlet.mjs b/scripts/okx-e2e-gauntlet.mjsindex 4954d7175..a44c270f0 100644--- a/scripts/okx-e2e-gauntlet.mjs+++ b/scripts/okx-e2e-gauntlet.mjs@@ -8,31 +8,43 @@* the settlement transaction off X Layer. Every case writes its evidence to* prompts/okx-ai/e2e-evidence/.*+ * The listed line-up is A2MCP (rebuilt 2026-08-22): every paid row is an MCP+ * Streamable HTTP server whose `forge_3d` tool is x402-gated, and generation is+ * asynchronous, so a buy is submit -> job id -> poll the FREE `forge_status`+ * tool -> GLB. That is the flow exercised here, because it is the flow an OKX+ * reviewer runs. The back-burner REST rows stay payable and case 3r buys one of+ * them, which is where the rigged-artifact assertion lives: forge output is a+ * static mesh, only the `avatar` chain ships a skeleton.+ ** This spends real USD₮0 on X Layer. It refuses to run without --yes.** Cases (each runs individually, none is "covered by" another):* 1 free lane serves live data with no payment demanded- * 2 cheapest paid service ($0.01 text-to-3d) delivers a real GLB- * 3 flagship ($0.50 avatar) delivers a GLB with a skeleton and skin weights+ * 2 cheapest paid row ($0.01 forge-draft) delivers a real GLB+ * 2b mid paid row ($0.05 forge-standard) delivers a real GLB+ * 3 flagship listed row ($0.25 forge-hd) delivers a real GLB+ * 3i image lane ($0.25 forge-image) rebuilds a GLB from a reference image+ * 3r rigged flagship ($0.50 avatar) delivers a GLB with skeleton + skin* 4 settlement verified on-chain for every payment (tx, recipient, amount)* 5a replaying an authorization does not buy a second job* 5b an authorization bound to one price cannot buy a dearer service* 5c an expired authorization is rejected and a fresh challenge offered* 5d a garbage payment header gets a clean 4xx and runs no tool* 6 a job that fails after payment leaves the authorization unspent- * 7 a legacy (non-X-Layer) rail still answers its own challenge+ * 7 a legacy (non-X-Layer) rail still answers, and pays, its own challenge** Usage:* node scripts/okx-e2e-gauntlet.mjs --yes* node scripts/okx-e2e-gauntlet.mjs --yes --only 2,3,4* node scripts/okx-e2e-gauntlet.mjs --dry-run # no signing, no spend+ * node scripts/okx-e2e-gauntlet.mjs --budget # what a full run costs*/import { execFileSync } from 'node:child_process';import { mkdirSync, writeFileSync } from 'node:fs';import { fileURLToPath } from 'node:url';import { dirname, resolve } from 'node:path';-import { catalogEntry, listedCatalog } from '../api/_lib/okx-catalog.js';+import { catalogEntry, listedCatalog, FORGE_TOOL, FORGE_STATUS_TOOL } from '../api/_lib/okx-catalog.js';const REPO = resolve(dirname(fileURLToPath(import.meta.url)), '..');const EVIDENCE = resolve(REPO, 'prompts/okx-ai/e2e-evidence');@@ -40,17 +52,29 @@ const CLI = `${process.env.HOME}/.local/bin/onchainos`;const XLAYER_RPCS = ['https://rpc.xlayer.tech', 'https://xlayerrpc.okx.com', 'https://rpc.ankr.com/xlayer'];const USDT0 = '0x779ded0c9e1022225f8e0630b35a9b54be713736';-// Event/selector hashes: Transfer(address,address,uint256) topic0, and the-// authorizationState(address,bytes32) selector for the EIP-3009 nonce read.+const BUYER = '0x75d00a2713565171f33216e5aa2a375e076ecf69';+// Event/selector hashes: Transfer(address,address,uint256) topic0, the+// authorizationState(address,bytes32) selector for the EIP-3009 nonce read, and+// balanceOf(address) for the spendable-float preflight.const TRANSFER_TOPIC = '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef';const EIP3009_AUTH_STATE = '0xe94a0102';+const ERC20_BALANCE_OF = '0x70a08231';++// A reference image every image-lane case can point at: our own OG asset, so+// the test never depends on a third party staying up.+const REFERENCE_IMAGE = 'https://three.ws/og/three-ws.png';+// How long a forge job may take before the buyer gives up. The HD lane is the+// slow one; the catalog tells buyers to keep polling, so the gauntlet does too.+const POLL_TIMEOUT_MS = 15 * 60 * 1000;+const POLL_INTERVAL_MS = 5000;function parseArgs(argv) {- const args = { base: 'https://three.ws', yes: false, dryRun: false, only: null };+ const args = { base: 'https://three.ws', yes: false, dryRun: false, budget: false, only: null };for (let i = 0; i < argv.length; i++) {if (argv[i] === '--base') args.base = argv[++i].replace(/\/$/, '');else if (argv[i] === '--yes') args.yes = true;else if (argv[i] === '--dry-run') args.dryRun = true;+ else if (argv[i] === '--budget') args.budget = true;else if (argv[i] === '--only') args.only = new Set(argv[++i].split(',').map((s) => s.trim()));}return args;@@ -72,7 +96,7 @@ function record(id, title, ok, detail, ref) {log(`${ok ? 'PASS' : 'FAIL'} [${id}] ${title}${detail ? `: ${detail}` : ''}`);return ok;}-const wanted = (id) => !args.only || args.only.has(id) || args.only.has(id.replace(/[a-z]$/, ''));+const wanted = (id) => !args.only || args.only.has(id);// ── X Layer reads ────────────────────────────────────────────────────────────let rpcId = 1;@@ -105,6 +129,11 @@ async function authorizationUsed(from, nonce) {return BigInt(out) !== 0n;}+async function buyerFloat() {+ const out = await rpc('eth_call', [{ to: USDT0, data: ERC20_BALANCE_OF + pad32(BUYER) }, 'latest']);+ return BigInt(out);+}+// Confirm a settlement moved the advertised amount to the advertised payTo.// A tx hash in a PAYMENT-RESPONSE header proves nothing until its Transfer log// is read back off-chain: this is the check that makes case 4 real.@@ -143,11 +172,11 @@ async function verifySettlement({ txHash, expectPayTo, expectAmount, expectPayer};}-// ── HTTP + buyer-side signing ────────────────────────────────────────────────-async function call(entry, body, { paymentHeader, headerName = 'PAYMENT-SIGNATURE' } = {}) {- const headers = { 'content-type': 'application/json' };+// ── HTTP: A2MCP and REST ─────────────────────────────────────────────────────+async function post(url, body, { paymentHeader, headerName = 'PAYMENT-SIGNATURE', extraHeaders } = {}) {+ const headers = { 'content-type': 'application/json', ...(extraHeaders || {}) };if (paymentHeader) headers[headerName] = paymentHeader;- const res = await fetch(entry.endpoint, {+ const res = await fetch(url, {method: 'POST',headers,body: JSON.stringify(body),@@ -167,19 +196,95 @@ async function call(entry, body, { paymentHeader, headerName = 'PAYMENT-SIGNATURbody: parsed ?? text,};}++let rpcCallId = 1;+const jsonRpc = (name, toolArgs) => ({+ jsonrpc: '2.0',+ id: rpcCallId++,+ method: 'tools/call',+ params: { name, arguments: toolArgs },+});++// One tools/call against an A2MCP row, with the buyer's structured result+// unwrapped so a case reads `.structured.status` instead of walking the+// JSON-RPC envelope every time.+async function mcpCall(entry, toolName, toolArgs, opts = {}) {+ const r = await post(entry.endpoint, jsonRpc(toolName, toolArgs), opts);+ const result = r.body && !Array.isArray(r.body) ? r.body.result : null;+ return {+ ...r,+ rpcError: r.body?.error ?? null,+ isToolError: Boolean(result?.isError),+ structured: result?.structuredContent ?? null,+ text: result?.content?.[0]?.text ?? '',+ };+}++// Poll the FREE forge_status tool until the job finishes. This is the buyer's+// half of the async contract, and it must cost nothing: a poll that ever+// answers 402 is a defect, so the loop records that rather than paying.+async function pollForgeJob(jobId, title) {+ const statusEntry = catalogEntry('forge-status');+ const started = Date.now();+ let frames = 0;+ let last = null;+ while (Date.now() - started < POLL_TIMEOUT_MS) {+ const r = await mcpCall(statusEntry, FORGE_STATUS_TOOL, { job_id: jobId, ...(title ? { title } : {}) });+ frames++;+ last = r;+ if (r.status !== 200) {+ return { ok: false, reason: `free poll answered ${r.status}`, frames, last: r, elapsedMs: Date.now() - started };+ }+ const status = r.structured?.status;+ if (status === 'done') {+ return { ok: true, frames, elapsedMs: Date.now() - started, done: r.structured, last: r };+ }+ if (status === 'error' || r.isToolError) {+ return { ok: false, reason: r.structured?.error || r.text || 'job failed', frames, last: r, elapsedMs: Date.now() - started };+ }+ await new Promise((res) => setTimeout(res, POLL_INTERVAL_MS));+ }+ return { ok: false, reason: `job did not finish within ${POLL_TIMEOUT_MS / 1000}s`, frames, last, elapsedMs: Date.now() - started };+}++// Poll the free REST job route the back-burner rows hand back.+async function pollRestJob(jobId) {+ const started = Date.now();+ let frames = 0;+ let last = null;+ while (Date.now() - started < POLL_TIMEOUT_MS) {+ const res = await fetch(`${args.base}/api/forge?job=${encodeURIComponent(jobId)}`, {+ headers: { accept: 'application/json' },+ signal: AbortSignal.timeout(60_000),+ });+ const body = await res.json().catch(() => null);+ frames++;+ last = { status: res.status, body };+ if (body?.status === 'done' && body?.glb_url) {+ return { ok: true, frames, elapsedMs: Date.now() - started, glbUrl: body.glb_url, last };+ }+ if (body?.status === 'error' || body?.error) {+ return { ok: false, reason: body.error || 'job failed', frames, last, elapsedMs: Date.now() - started };+ }+ await new Promise((r) => setTimeout(r, POLL_INTERVAL_MS));+ }+ return { ok: false, reason: `job did not finish within ${POLL_TIMEOUT_MS / 1000}s`, frames, last, elapsedMs: Date.now() - started };+}+const decodeB64Json = (v) => JSON.parse(Buffer.from(v, 'base64').toString('utf8'));// Sign through the TEE wallet, the exact path an OKX buyer agent takes.// `mutate` lets a case hand the signer a doctored challenge (case 5c needs a// one-second validity window) without ever hand-rolling a signature.-function signChallenge(challengeHeader, { mutate } = {}) {+// `selectedIndex` picks the rail: 0 is always X Layer, case 7 pays another.+function signChallenge(challengeHeader, { mutate, selectedIndex = 0 } = {}) {let payload = challengeHeader;if (mutate) {const decoded = decodeB64Json(challengeHeader);mutate(decoded);payload = Buffer.from(JSON.stringify(decoded), 'utf8').toString('base64');}- const out = execFileSync(CLI, ['payment', 'pay', '--payload', payload, '--selected-index', '0'], {+ const out = execFileSync(CLI, ['payment', 'pay', '--payload', payload, '--selected-index', String(selectedIndex)], {encoding: 'utf8',maxBuffer: 1 << 24,timeout: 180_000,@@ -196,6 +301,22 @@ function authFromHeader(header) {return p.authorization ?? null;}+// Verify the bytes behind a delivered URL are a real model. A 200 is not+// delivery until the container parses and carries geometry.+function verifyArtifact(modelUrl, { rigged, name }) {+ try {+ execFileSync('node', ['scripts/okx-verify-glb.mjs', modelUrl, ...(rigged ? ['--rigged'] : []), '--json', `${EVIDENCE}/${name}`], {+ cwd: REPO,+ encoding: 'utf8',+ stdio: 'pipe',+ timeout: 300_000,+ });+ return { ok: true, detail: '' };+ } catch (err) {+ return { ok: false, detail: (err.stdout || err.message || '').toString().trim().split('\n').slice(-4).join(' / ') };+ }+}+// ── Cases ────────────────────────────────────────────────────────────────────async function case1Free() {@@ -203,25 +324,42 @@ async function case1Free() {const healthBody = await health.json();const catalog = await fetch(`${args.base}/api/okx/3d/catalog`, { signal: AbortSignal.timeout(60_000) });const catalogBody = await catalog.json();- const ref = evidence('30-case1-free-lane.json', { health: { status: health.status, body: healthBody }, catalog: { status: catalog.status, body: catalogBody } });++ // The free tools must be free ON A PAID ROW too: a buyer polls the job where+ // it paid for it. A 402 on either of these strands a paid buyer mid-flight.+ const paidRow = catalogEntry('forge-draft');+ const freePoll = await mcpCall(paidRow, FORGE_STATUS_TOOL, { job_id: 'f1.not-a-real-job' });+ const gettingStarted = await mcpCall(paidRow, 'getting_started', {});++ const ref = evidence('30-case1-free-lane.json', {+ health: { status: health.status, body: healthBody },+ catalog: { status: catalog.status, body: catalogBody },+ freeToolsOnPaidRow: {+ forge_status: { status: freePoll.status, isToolError: freePoll.isToolError, structured: freePoll.structured, text: freePoll.text.slice(0, 400) },+ getting_started: { status: gettingStarted.status, text: gettingStarted.text.slice(0, 400) },+ },+ });const healthOk = health.status === 200 && healthBody.ok === true && Array.isArray(healthBody.subsystems) && healthBody.subsystems.length > 0;const live = healthBody.subsystems?.every((s) => typeof s.latency_ms === 'number');// `services` is the listed line-up; back-burner rows ship under `unlisted`.const catalogOk = catalog.status === 200 && catalogBody.services?.length === listedCatalog().length;+ // A free tool answering anything but 200 means it was paywalled.+ const freeOk = freePoll.status === 200 && gettingStarted.status === 200;record('1','free lane serves live data, no payment demanded',- healthOk && live && catalogOk,- `health ${health.status} (${healthBody.subsystems?.length} subsystems, real latencies), catalog ${catalog.status} (${catalogBody.services?.length} rows)`,+ healthOk && live && catalogOk && freeOk,+ `health ${health.status} (${healthBody.subsystems?.length} subsystems, real latencies), catalog ${catalog.status} (${catalogBody.services?.length} rows), free tools on a paid row: forge_status ${freePoll.status}, getting_started ${gettingStarted.status}`,ref,);}-// The full buy: 402 → sign → replay → artifact → on-chain settlement.-async function buyAndVerify({ id, serviceId, title, body, rigged }) {+// The full A2MCP buy: 402 -> sign -> replay -> job id -> free poll -> artifact+// -> on-chain settlement.+async function buyForge({ id, serviceId, title, toolArgs }) {const entry = catalogEntry(serviceId);- const unpaid = await call(entry, body);+ const unpaid = await mcpCall(entry, FORGE_TOOL, toolArgs);if (unpaid.status !== 402 || !unpaid.challengeHeader) {return record(id, title, false, `expected 402, got ${unpaid.status}`, evidence(`31-case${id}-unpaid.json`, unpaid));}@@ -235,48 +373,110 @@ async function buyAndVerify({ id, serviceId, title, body, rigged }) {const signed = signChallenge(unpaid.challengeHeader);const auth = authFromHeader(signed.header);- const paid = await call(entry, body, { paymentHeader: signed.header, headerName: signed.headerName });+ const paid = await mcpCall(entry, FORGE_TOOL, toolArgs, { paymentHeader: signed.header, headerName: signed.headerName });- const ref = evidence(`31-case${id}-${serviceId}.json`, {- unpaid: { status: unpaid.status, challenge },- signed: { wallet: signed.wallet, headerName: signed.headerName, authorization: auth, authorization_header: signed.header },- paid: { status: paid.status, body: paid.body, receiptHeader: paid.receiptHeader },- });+ const receipt = paid.receiptHeader ? decodeB64Json(paid.receiptHeader) : null;+ if (receipt?.transaction) {+ settlements.push({ case: id, service: serviceId, tx: receipt.transaction, amount: entry.amountAtomics, priceUsd: entry.priceUsd, payTo: accept.payTo, payer: receipt.payer || auth?.from, authorization: auth });+ }- if (paid.status !== 200) {- return record(id, title, false, `paid replay returned ${paid.status}: ${JSON.stringify(paid.body).slice(0, 300)}`, ref);+ const writeEvidence = (extra) =>+ evidence(`31-case${id}-${serviceId}.json`, {+ unpaid: { status: unpaid.status, challenge },+ signed: { wallet: signed.wallet, headerName: signed.headerName, authorization: auth, authorization_header: signed.header },+ paid: { status: paid.status, structured: paid.structured, text: paid.text, receipt },+ ...extra,+ });++ if (paid.status !== 200 || paid.isToolError) {+ return record(id, title, false, `paid call returned ${paid.status}${paid.isToolError ? ' (tool error)' : ''}: ${(paid.text || JSON.stringify(paid.body)).slice(0, 300)}`, writeEvidence({}));+ }++ // Async by contract: a submit answers `pending` with a job id, and the free+ // status tool carries it to `done`. A submit that is already done is fine.+ let doneFrame = paid.structured?.status === 'done' ? paid.structured : null;+ let poll = null;+ if (!doneFrame) {+ const jobId = paid.structured?.job;+ if (!jobId) {+ return record(id, title, false, `200 but no job id and no model: ${JSON.stringify(paid.structured).slice(0, 300)}`, writeEvidence({}));+ }+ poll = await pollForgeJob(jobId, toolArgs.prompt);+ if (!poll.ok) {+ return record(id, title, false, `job ${jobId} did not deliver: ${poll.reason}`, writeEvidence({ poll }));+ }+ doneFrame = poll.done;}- const modelUrl = paid.body?.model_url || paid.body?.glb_url || paid.body?.url || paid.body?.result?.model_url;+ const modelUrl = doneFrame?.glbUrl;if (!modelUrl) {- return record(id, title, false, `200 but no model URL in response: ${JSON.stringify(paid.body).slice(0, 300)}`, ref);+ return record(id, title, false, `job finished with no glbUrl: ${JSON.stringify(doneFrame).slice(0, 300)}`, writeEvidence({ poll }));}+ const artifact = verifyArtifact(modelUrl, { rigged: false, name: `32-case${id}-artifact.json` });+ const ref = writeEvidence({ poll: poll ? { ok: poll.ok, frames: poll.frames, elapsedMs: poll.elapsedMs } : null, done: doneFrame });- // Artifact truth: parse the bytes, do not trust the 200.- let artifactOk = false;- let artifactDetail = '';- try {- execFileSync('node', ['scripts/okx-verify-glb.mjs', modelUrl, ...(rigged ? ['--rigged'] : []), '--json', `${EVIDENCE}/32-case${id}-artifact.json`], {- cwd: REPO,- encoding: 'utf8',- stdio: 'pipe',- timeout: 300_000,- });- artifactOk = true;- } catch (err) {- artifactDetail = (err.stdout || err.message || '').toString().trim().split('\n').slice(-4).join(' / ');+ return record(+ id,+ title,+ artifact.ok && Boolean(receipt?.transaction),+ `200, ${poll ? `job done in ${Math.round(poll.elapsedMs / 1000)}s over ${poll.frames} free polls, ` : ''}artifact ${artifact.ok ? 'verified' : `FAILED (${artifact.detail})`}, tx ${receipt?.transaction || 'MISSING from PAYMENT-RESPONSE'}`,+ ref,+ );+}++// The rigged artifact assertion. The listed forge rows deliver a static mesh by+// design; the `avatar` chain (back burner, still payable) is the row that ships+// a skeleton, so the "flagship delivers bones and skin weights" check lives on+// it rather than being quietly dropped when the listing was rebuilt.+async function case3Rigged() {+ const id = '3r';+ const title = 'rigged row delivers a GLB with a skeleton and skin weights';+ const entry = catalogEntry('avatar');+ const body = { prompt: 'a heroic knight in silver armor, full body' };+ const unpaid = await post(entry.endpoint, body);+ if (unpaid.status !== 402 || !unpaid.challengeHeader) {+ return record(id, title, false, `expected 402, got ${unpaid.status}`, evidence(`31-case${id}-unpaid.json`, unpaid));}+ const challenge = decodeB64Json(unpaid.challengeHeader);+ const accept = challenge.accepts[0];+ if (accept.network !== 'eip155:196' || accept.amount !== entry.amountAtomics) {+ return record(id, title, false, `challenge mismatch: ${accept.network} @ ${accept.amount}, want eip155:196 @ ${entry.amountAtomics}`, evidence(`31-case${id}-unpaid.json`, unpaid));+ }+ if (args.dryRun) return record(id, title, false, 'dry run: signing skipped', null);+ const signed = signChallenge(unpaid.challengeHeader);+ const auth = authFromHeader(signed.header);+ const paid = await post(entry.endpoint, body, { paymentHeader: signed.header, headerName: signed.headerName });const receipt = paid.receiptHeader ? decodeB64Json(paid.receiptHeader) : null;if (receipt?.transaction) {- settlements.push({ case: id, service: serviceId, tx: receipt.transaction, amount: entry.amountAtomics, priceUsd: entry.priceUsd, payTo: accept.payTo, payer: receipt.payer || auth?.from, authorization: auth });+ settlements.push({ case: id, service: entry.id, tx: receipt.transaction, amount: entry.amountAtomics, priceUsd: entry.priceUsd, payTo: accept.payTo, payer: receipt.payer || auth?.from, authorization: auth });}-+ const writeEvidence = (extra) =>+ evidence(`31-case${id}-avatar.json`, {+ unpaid: { status: unpaid.status, challenge },+ signed: { wallet: signed.wallet, authorization: auth, authorization_header: signed.header },+ paid: { status: paid.status, body: paid.body, receipt },+ ...extra,+ });+ if (paid.status !== 200) {+ return record(id, title, false, `paid call returned ${paid.status}: ${JSON.stringify(paid.body).slice(0, 300)}`, writeEvidence({}));+ }+ let modelUrl = paid.body?.glb_url || paid.body?.model_url;+ let poll = null;+ if (!modelUrl) {+ const jobId = paid.body?.job_id;+ if (!jobId) return record(id, title, false, `200 with neither a model nor a job id: ${JSON.stringify(paid.body).slice(0, 300)}`, writeEvidence({}));+ poll = await pollRestJob(jobId);+ if (!poll.ok) return record(id, title, false, `job ${jobId} did not deliver: ${poll.reason}`, writeEvidence({ poll }));+ modelUrl = poll.glbUrl;+ }+ const artifact = verifyArtifact(modelUrl, { rigged: true, name: `32-case${id}-artifact.json` });+ const ref = writeEvidence({ poll: poll ? { ok: poll.ok, frames: poll.frames, elapsedMs: poll.elapsedMs } : null, modelUrl });return record(id,title,- artifactOk && Boolean(receipt?.transaction),- `200, artifact ${artifactOk ? 'verified' : `FAILED (${artifactDetail})`}, tx ${receipt?.transaction || 'MISSING from PAYMENT-RESPONSE'}`,+ artifact.ok && Boolean(receipt?.transaction),+ `200, artifact ${artifact.ok ? 'verified rigged' : `FAILED (${artifact.detail})`}, tx ${receipt?.transaction || 'MISSING from PAYMENT-RESPONSE'}`,ref,);}@@ -292,66 +492,67 @@ async function case4Settlement() {if (!v.ok) allOk = false;}const ref = evidence('40-case4-settlements.json', verified);- return record('4', 'settlement verified on-chain (tx, recipient, exact amount)', allOk && verified.length >= 1, `${verified.filter((v) => v.verification.ok).length}/${verified.length} settlements confirmed`, ref);+ return record('4', 'settlement verified on-chain (tx, recipient, exact amount)', allOk && verified.length >= 3, `${verified.filter((v) => v.verification.ok).length}/${verified.length} settlements confirmed`, ref);}async function case5aReplay() {- const entry = catalogEntry('text-to-3d');- const body = { prompt: 'a small brass astrolabe' };- const unpaid = await call(entry, body);+ const entry = catalogEntry('forge-draft');+ const toolArgs = { prompt: 'a small brass astrolabe' };+ const unpaid = await mcpCall(entry, FORGE_TOOL, toolArgs);if (unpaid.status !== 402) return record('5a', 'replayed authorization buys no second job', false, `setup failed, expected 402 got ${unpaid.status}`, null);if (args.dryRun) return record('5a', 'replayed authorization buys no second job', false, 'dry run', null);const signed = signChallenge(unpaid.challengeHeader);const auth = authFromHeader(signed.header);- const first = await call(entry, body, { paymentHeader: signed.header, headerName: signed.headerName });- const second = await call(entry, body, { paymentHeader: signed.header, headerName: signed.headerName });+ const pay = { paymentHeader: signed.header, headerName: signed.headerName };+ const first = await mcpCall(entry, FORGE_TOOL, toolArgs, pay);+ const second = await mcpCall(entry, FORGE_TOOL, toolArgs, pay);// A different body on the same proof must not be honoured either: that is// the variant that would buy a second, different job on one payment.- const third = await call(entry, { prompt: 'a completely different object, a wooden chair' }, { paymentHeader: signed.header, headerName: signed.headerName });+ const third = await mcpCall(entry, FORGE_TOOL, { prompt: 'a completely different object, a wooden chair' }, pay);const firstReceipt = first.receiptHeader ? decodeB64Json(first.receiptHeader) : null;if (firstReceipt?.transaction) {- settlements.push({ case: '5a', service: 'text-to-3d', tx: firstReceipt.transaction, amount: entry.amountAtomics, priceUsd: entry.priceUsd, payTo: decodeB64Json(unpaid.challengeHeader).accepts[0].payTo, payer: firstReceipt.payer || auth?.from, authorization: auth });+ settlements.push({ case: '5a', service: entry.id, tx: firstReceipt.transaction, amount: entry.amountAtomics, priceUsd: entry.priceUsd, payTo: decodeB64Json(unpaid.challengeHeader).accepts[0].payTo, payer: firstReceipt.payer || auth?.from, authorization: auth });}// Idempotent replay (same proof, same body) must return the SAME job, not a// new one; the differing-body replay must be refused outright.- const sameJob =- second.status === first.status &&- JSON.stringify(second.body) === JSON.stringify(first.body);- const differentBodyRefused = third.status >= 400;+ const firstJob = first.structured?.job ?? null;+ const secondJob = second.structured?.job ?? null;+ const sameJob = second.status === first.status && firstJob !== null && secondJob === firstJob;+ const differentBodyRefused = third.status >= 400 || third.isToolError || Boolean(third.rpcError);const ref = evidence('50-case5a-replay.json', {- first: { status: first.status, body: first.body, receipt: firstReceipt },- secondSameBody: { status: second.status, body: second.body },- thirdDifferentBody: { status: third.status, body: third.body },+ first: { status: first.status, structured: first.structured, receipt: firstReceipt },+ secondSameBody: { status: second.status, structured: second.structured, receipt: second.receiptHeader ? decodeB64Json(second.receiptHeader) : null },+ thirdDifferentBody: { status: third.status, structured: third.structured, rpcError: third.rpcError, text: third.text },authorization: auth,});return record('5a','replayed authorization buys no second job',first.status === 200 && sameJob && differentBodyRefused,- `first 200; same-body replay ${second.status} ${sameJob ? '(identical cached response)' : '(DIFFERENT response, a second job ran)'}; different-body replay ${third.status} ${differentBodyRefused ? '(refused)' : '(ACCEPTED, defect)'}`,+ `first 200 job ${firstJob}; same-body replay ${second.status} job ${secondJob} ${sameJob ? '(identical cached job)' : '(DIFFERENT job, a second job ran)'}; different-body replay ${third.status} ${differentBodyRefused ? '(refused)' : '(ACCEPTED, defect)'}`,ref,);}async function case5bCrossService() {- const cheap = catalogEntry('text-to-3d');- const dear = catalogEntry('avatar');- const unpaid = await call(cheap, { prompt: 'a tin whistle' });+ const cheap = catalogEntry('forge-draft');+ const dear = catalogEntry('forge-hd');+ const unpaid = await mcpCall(cheap, FORGE_TOOL, { prompt: 'a tin whistle' });if (unpaid.status !== 402) return record('5b', 'cheap authorization cannot buy a dearer service', false, `setup failed, expected 402 got ${unpaid.status}`, null);if (args.dryRun) return record('5b', 'cheap authorization cannot buy a dearer service', false, 'dry run', null);const signed = signChallenge(unpaid.challengeHeader);const auth = authFromHeader(signed.header);- const attempt = await call(dear, { prompt: 'a heroic knight in silver armor, full body' }, { paymentHeader: signed.header, headerName: signed.headerName });+ const attempt = await mcpCall(dear, FORGE_TOOL, { prompt: 'a heroic knight in silver armor, full body' }, { paymentHeader: signed.header, headerName: signed.headerName });// The authorization must be untouched: rejected before any redemption.const spent = auth ? await authorizationUsed(auth.from, auth.nonce) : null;const ref = evidence('51-case5b-cross-service.json', {signedFor: { service: cheap.id, amount: cheap.amountAtomics },replayedAgainst: { service: dear.id, amount: dear.amountAtomics },- attempt: { status: attempt.status, body: attempt.body },+ attempt: { status: attempt.status, structured: attempt.structured, body: attempt.body },authorization: auth,authorizationSpentOnChain: spent,});@@ -367,8 +568,9 @@ async function case5bCrossService() {}async function case5cExpired() {- const entry = catalogEntry('text-to-3d');- const unpaid = await call(entry, { prompt: 'a paper lantern' });+ const entry = catalogEntry('forge-draft');+ const toolArgs = { prompt: 'a paper lantern' };+ const unpaid = await mcpCall(entry, FORGE_TOOL, toolArgs);if (unpaid.status !== 402) return record('5c', 'expired authorization is rejected, fresh challenge offered', false, `setup failed, expected 402 got ${unpaid.status}`, null);if (args.dryRun) return record('5c', 'expired authorization is rejected, fresh challenge offered', false, 'dry run', null);@@ -381,7 +583,7 @@ async function case5cExpired() {});const auth = authFromHeader(signed.header);await new Promise((r) => setTimeout(r, 4000));- const attempt = await call(entry, { prompt: 'a paper lantern' }, { paymentHeader: signed.header, headerName: signed.headerName });+ const attempt = await mcpCall(entry, FORGE_TOOL, toolArgs, { paymentHeader: signed.header, headerName: signed.headerName });const spent = auth ? await authorizationUsed(auth.from, auth.nonce) : null;const ref = evidence('52-case5c-expired.json', {authorization: auth,@@ -400,8 +602,8 @@ async function case5cExpired() {}async function case5dGarbage() {- const entry = catalogEntry('text-to-3d');- const body = { prompt: 'a small ceramic teapot' };+ const entry = catalogEntry('forge-draft');+ const toolArgs = { prompt: 'a small ceramic teapot' };const cases = {notBase64: 'not-a-real-payment-header',wrongShape: Buffer.from(JSON.stringify({ hello: 'world' }), 'utf8').toString('base64'),@@ -411,10 +613,14 @@ async function case5dGarbage() {const out = {};let ok = true;for (const [name, header] of Object.entries(cases)) {- const r = await call(entry, body, { paymentHeader: header, headerName: 'x-payment' });- out[name] = { status: r.status, body: r.body };- // Safe failure: a 4xx, and nothing that looks like a delivered artifact.- const clean = r.status >= 400 && r.status < 500 && !JSON.stringify(r.body).includes('model_url');+ const r = await mcpCall(entry, FORGE_TOOL, toolArgs, { paymentHeader: header, headerName: 'x-payment' });+ out[name] = { status: r.status, body: r.body, receiptHeader: r.receiptHeader, structured: r.structured };+ // Safe failure: an actionable 4xx, no job started, no settlement. Read+ // that off the structured result and the receipt header, never off a+ // string match on the body: a 402 carries the bazaar discovery block,+ // whose worked example legitimately contains a specimen job id.+ const startedJob = Boolean(r.structured?.job || r.structured?.glbUrl);+ const clean = r.status >= 400 && r.status < 500 && !startedJob && !r.receiptHeader;if (!clean) ok = false;log(` ${clean ? 'ok ' : 'FAIL'} ${name}: ${r.status} ${r.body?.error || r.body?.error_description || ''}`.slice(0, 160));}@@ -423,72 +629,167 @@ async function case5dGarbage() {}async function case6PayOnlySuccess() {- // A job that passes payment verification and then fails in the engine: a- // well-formed request pointing at a model URL that does not exist. If the- // promise holds, the authorization is still unspent on-chain afterwards.- const entry = catalogEntry('fbx-export');- const body = { model_url: `${args.base}/models/definitely-not-a-real-model-${Date.now()}.glb` };- const unpaid = await call(entry, body);+ // A job that passes payment verification and then fails in the lane: a+ // well-formed image request pointing at a URL that does not resolve to an+ // image. If the promise holds, the authorization is still unspent on-chain+ // afterwards and no settlement receipt was emitted.+ const entry = catalogEntry('forge-image');+ const toolArgs = { image_urls: [`${args.base}/definitely-not-a-real-image-${Date.now()}.png`] };+ const unpaid = await mcpCall(entry, FORGE_TOOL, toolArgs);if (unpaid.status !== 402) return record('6', 'failed job leaves the authorization unspent', false, `setup failed, expected 402 got ${unpaid.status}`, null);if (args.dryRun) return record('6', 'failed job leaves the authorization unspent', false, 'dry run', null);const signed = signChallenge(unpaid.challengeHeader);const auth = authFromHeader(signed.header);const before = await authorizationUsed(auth.from, auth.nonce);- const attempt = await call(entry, body, { paymentHeader: signed.header, headerName: signed.headerName });+ const attempt = await mcpCall(entry, FORGE_TOOL, toolArgs, { paymentHeader: signed.header, headerName: signed.headerName });const after = await authorizationUsed(auth.from, auth.nonce);const ref = evidence('60-case6-pay-only-on-success.json', {- request: body,+ request: toolArgs,authorization: auth,authorizationSpentBefore: before,- attempt: { status: attempt.status, body: attempt.body, receiptHeader: attempt.receiptHeader },+ attempt: { status: attempt.status, structured: attempt.structured, text: attempt.text, isToolError: attempt.isToolError, receiptHeader: attempt.receiptHeader },authorizationSpentAfter: after,});- const failed = attempt.status >= 400;+ // A refusal can be an HTTP 4xx or an MCP tool error inside a 200: both mean+ // the work was not delivered, and both must leave the money alone.+ const failed = attempt.status >= 400 || attempt.isToolError;const notCharged = after === false && !attempt.receiptHeader;return record('6','failed job leaves the authorization unspent (pay-only-on-success)',failed && notCharged,- `job ${attempt.status} (${attempt.body?.error || ''}), nonce redeemed on-chain: ${after}, settlement receipt emitted: ${Boolean(attempt.receiptHeader)}`,+ `job ${attempt.status}${attempt.isToolError ? ' tool error' : ''} (${attempt.structured?.error || ''}), nonce redeemed on-chain: ${after}, settlement receipt emitted: ${Boolean(attempt.receiptHeader)}`,ref,);}async function case7LegacyRail() {- // The pre-OKX rails must still answer their own challenge: adding X Layer- // must not have broken the Solana/Base path the platform already sells on.- const entry = catalogEntry('text-to-3d');- const unpaid = await call(entry, { prompt: 'a copper kettle' });+ // The pre-OKX rails must still answer their own challenge AND still take a+ // real payment: adding X Layer must not have broken the Solana/Base path the+ // platform already sells on. Advertisement is checked always; the paid leg+ // runs when the buyer's Solana account holds the fee.+ const entry = catalogEntry('forge-draft');+ const toolArgs = { prompt: 'a copper kettle' };+ const unpaid = await mcpCall(entry, FORGE_TOOL, toolArgs);if (unpaid.status !== 402 || !unpaid.challengeHeader) {- return record('7', 'legacy rails still offered alongside X Layer', false, `expected 402, got ${unpaid.status}`, null);+ return record('7', 'legacy rail still answers and pays its own challenge', false, `expected 402, got ${unpaid.status}`, null);}const challenge = decodeB64Json(unpaid.challengeHeader);- const solana = challenge.accepts.find((a) => a.network?.startsWith('solana:'));+ const solanaIndex = challenge.accepts.findIndex((a) => a.network?.startsWith('solana:') && a.extra?.name === 'USDC');+ const solana = challenge.accepts[solanaIndex];const base = challenge.accepts.find((a) => a.network === 'eip155:8453');- const ref = evidence('70-case7-legacy-rails.json', challenge);- const amountsMatch = [solana, base].every((a) => a && a.amount === entry.amountAtomics);+ const advertised = Boolean(solana && base) && [solana, base].every((a) => a.amount === entry.amountAtomics);++ let paidLeg = null;+ if (advertised && !args.dryRun) {+ // Sign on the Solana rail rather than X Layer. The rail sponsors gas+ // through its feePayer, so this needs USDC and no SOL.+ try {+ const signed = signChallenge(unpaid.challengeHeader, { selectedIndex: solanaIndex });+ const paid = await mcpCall(entry, FORGE_TOOL, toolArgs, { paymentHeader: signed.header, headerName: signed.headerName });+ const receipt = paid.receiptHeader ? decodeB64Json(paid.receiptHeader) : null;+ paidLeg = {+ rail: solana.network,+ asset: solana.asset,+ status: paid.status,+ job: paid.structured?.job ?? null,+ receipt,+ ok: paid.status === 200 && !paid.isToolError,+ };+ } catch (err) {+ paidLeg = { rail: solana.network, ok: false, error: String(err.message || err).slice(0, 400) };+ }+ }++ const ref = evidence('70-case7-legacy-rails.json', { challenge, paidLeg });return record('7',- 'legacy rails still offered alongside X Layer, same price',- Boolean(solana && base) && amountsMatch,- `accepts: ${challenge.accepts.map((a) => a.network).join(', ')}; solana ${solana?.amount}, base ${base?.amount}, want ${entry.amountAtomics}`,+ 'legacy rail still answers and pays its own challenge',+ advertised && (args.dryRun || paidLeg?.ok === true),+ `accepts: ${challenge.accepts.map((a) => `${a.network}@${a.amount}`).join(', ')}; paid leg: ${paidLeg ? (paidLeg.ok ? `200 on ${paidLeg.rail}, tx ${paidLeg.receipt?.transaction || 'none in receipt'}` : `FAILED (${paidLeg.error || paidLeg.status})`) : 'not attempted'}`,ref,);}+// ── Budget ───────────────────────────────────────────────────────────────────+// What a full run costs, and the floor the buyer must hold at each point. Verify+// refuses any authorization whose value exceeds balanceOf(buyer), including the+// ones designed to be rejected, so the binding constraint is the floor at the+// moment each case signs, not the sum of what settles.+const SPEND_PLAN = [+ { id: '2', service: 'forge-draft', settles: true },+ { id: '2b', service: 'forge-standard', settles: true },+ { id: '3', service: 'forge-hd', settles: true },+ { id: '3i', service: 'forge-image', settles: true },+ { id: '3r', service: 'avatar', settles: true },+ { id: '5a', service: 'forge-draft', settles: true },+ { id: '5b', service: 'forge-draft', settles: false },+ { id: '5c', service: 'forge-draft', settles: false },+ { id: '6', service: 'forge-image', settles: false },+ { id: '7', service: 'forge-draft', settles: false, rail: 'solana USDC' },+];+function budget() {+ let spend = 0n;+ let floor = 0n;+ const rows = [];+ // Walk the plan in order, tracking the balance still required behind each+ // signature: a case that does not settle still has to be affordable.+ let remaining = 0n;+ for (let i = SPEND_PLAN.length - 1; i >= 0; i--) {+ const step = SPEND_PLAN[i];+ const entry = catalogEntry(step.service);+ const amount = BigInt(entry.amountAtomics);+ const needHere = step.settles ? amount + remaining : (amount > remaining ? amount : remaining);+ remaining = needHere;+ rows.unshift({ ...step, priceUsd: entry.priceUsd, amountAtomics: entry.amountAtomics, floorAfterHere: needHere.toString() });+ if (step.settles) spend += amount;+ }+ floor = remaining;+ return { rows, settlesAtomics: spend.toString(), settlesUsd: (Number(spend) / 1e6).toFixed(2), floorAtomics: floor.toString(), floorUsd: (Number(floor) / 1e6).toFixed(2) };+}+// ── Runner ───────────────────────────────────────────────────────────────────async function main() {+ const plan = budget();+ if (args.budget) {+ log('Per-case spend plan (X Layer USD₮0 unless noted):\n');+ for (const r of plan.rows) log(` ${r.id.padEnd(3)} ${r.service.padEnd(16)} $${r.priceUsd.padStart(5)} ${r.settles ? 'settles' : 'rejected before settlement'}${r.rail ? ` [${r.rail}]` : ''}`);+ log(`\n one clean run settles $${plan.settlesUsd} and needs a starting float of $${plan.floorUsd}`);+ log(` buyer ${BUYER}`);+ const held = await buyerFloat();+ log(` held now: ${(Number(held) / 1e6).toFixed(6)} USD₮0 (${held} atomics)`);+ log(held >= BigInt(plan.floorAtomics) ? ' FUNDED: a full run fits.' : ` SHORT by ${(Number(BigInt(plan.floorAtomics) - held) / 1e6).toFixed(2)} USD₮0.`);+ process.exit(0);+ }+if (!args.yes && !args.dryRun) {console.error('This gauntlet spends real USD₮0 on X Layer against production.');- console.error('Re-run with --yes to authorize spending, or --dry-run to exercise the unpaid legs only.');+ console.error(`A full run settles $${plan.settlesUsd} and needs a starting float of $${plan.floorUsd} at ${BUYER}.`);+ console.error('Re-run with --yes to authorize spending, --budget to price it, or --dry-run to exercise the unpaid legs only.');process.exit(2);}log(`OKX.AI end-to-end gauntlet against ${args.base}${args.dryRun ? ' (DRY RUN, no signing)' : ''}\n`);+ // Refuse to start a paid run that cannot finish: a half-funded run burns the+ // cheap cases and then fails the dear ones on balance, which reads like a+ // rail defect and is not one.+ if (!args.dryRun && !args.only) {+ const held = await buyerFloat();+ if (held < BigInt(plan.floorAtomics)) {+ console.error(`Buyer ${BUYER} holds ${(Number(held) / 1e6).toFixed(6)} USD₮0, a full run needs ${plan.floorUsd}.`);+ console.error('Fund the buyer or scope the run with --only. Nothing was signed.');+ process.exit(3);+ }+ log(`buyer float ${(Number(held) / 1e6).toFixed(6)} USD₮0, run needs ${plan.floorUsd}\n`);+ }+if (wanted('1')) await case1Free();- if (wanted('2')) await buyAndVerify({ id: '2', serviceId: 'text-to-3d', title: 'cheapest paid service delivers a real GLB', body: { prompt: 'a brass steampunk owl, full body' }, rigged: false });- if (wanted('3')) await buyAndVerify({ id: '3', serviceId: 'avatar', title: 'flagship delivers a rigged GLB (skeleton + skin weights)', body: { prompt: 'a heroic knight in silver armor, full body' }, rigged: true });+ if (wanted('2')) await buyForge({ id: '2', serviceId: 'forge-draft', title: 'cheapest paid row delivers a real GLB', toolArgs: { prompt: 'a brass steampunk owl, full body' } });+ if (wanted('2b')) await buyForge({ id: '2b', serviceId: 'forge-standard', title: 'mid paid row delivers a real GLB', toolArgs: { prompt: 'a weathered wooden fishing boat' } });+ if (wanted('3')) await buyForge({ id: '3', serviceId: 'forge-hd', title: 'flagship listed row delivers a real GLB', toolArgs: { prompt: 'an ornate Venetian carnival mask, gold leaf' } });+ if (wanted('3i')) await buyForge({ id: '3i', serviceId: 'forge-image', title: 'image lane rebuilds a GLB from a reference image', toolArgs: { image_urls: [REFERENCE_IMAGE] } });+ if (wanted('3r')) await case3Rigged();if (wanted('5a')) await case5aReplay();if (wanted('5b')) await case5bCrossService();if (wanted('5c')) await case5cExpired();@@ -498,7 +799,7 @@ async function main() {// Case 4 runs last: it verifies every settlement the paid cases produced.if (wanted('4')) await case4Settlement();- const ref = evidence('00-gauntlet-summary.json', { base: args.base, dryRun: args.dryRun, results, settlements });+ const ref = evidence('00-gauntlet-summary.json', { base: args.base, dryRun: args.dryRun, ranAt: new Date().toISOString(), results, settlements });const passed = results.filter((r) => r.ok).length;log('\n' + '-'.repeat(72));for (const r of results) log(` ${r.ok ? 'PASS' : 'FAIL'} ${r.id.padEnd(3)} ${r.title}`);diff --git a/tests/api/okx-forge.test.js b/tests/api/okx-forge.test.jsindex f0182167d..2129c98dc 100644--- a/tests/api/okx-forge.test.js+++ b/tests/api/okx-forge.test.js@@ -126,6 +126,13 @@ beforeEach(() => {submitted.length = 0;});+// Every listed A2MCP row, the exact set a reviewer's MCP client connects to.+// The two free REST rows (catalog, health) are plain GET and are covered+// separately.+const LISTED_IDS = listedCatalog()+ .filter((e) => e.kind === 'a2mcp')+ .map((e) => e.id);+const PAID_FORGE = [['forge-draft', '10000', '0.01'],['forge-standard', '50000', '0.05'],@@ -258,6 +265,79 @@ describe('402 challenge: the OKX Agent Payments Protocol integration', () => {expect(sse.statusCode).toBe(402);});+ // The 2026-09-02 review rejected the listing as "missing a complete+ // description, parameter details, and usage examples". It was not the copy:+ // discovery itself was paywalled. Free discovery was scoped to non-protocol+ // clients (an OAuth-capable client must meet the 401 on initialize on the+ // platform's other MCP surfaces), but this surface forces 402 and has no+ // OAuth, so a spec-compliant MCP client, the only kind a reviewer probes an+ // A2MCP listing with, was answered 402 on initialize and tools/list and+ // could never read a single tool description or parameter schema. curl+ // sends neither header and was served 200, which is why every earlier+ // verification pass missed it.+ it('a real MCP client can discover every endpoint without paying', async () => {+ const mcpHeaders = [+ { accept: 'application/json, text/event-stream' },+ { 'mcp-protocol-version': '2025-06-18' },+ { 'mcp-session-id': 'sess-1' },+ ];+ for (const id of LISTED_IDS) {+ for (const headers of mcpHeaders) {+ for (const method of ['initialize', 'tools/list', 'ping']) {+ const res = makeRes();+ await handler(makeReq({ service: id, headers, body: { jsonrpc: '2.0', id: 1, method } }), res);+ expect(res.statusCode, `${id} ${method} ${JSON.stringify(headers)}`).toBe(200);+ expect(res.headers['payment-required']).toBeUndefined();+ }+ }+ }+ });++ // Discovery being free is only useful if what it returns is what the review+ // asked for: every tool named, described, and carrying a typed schema for+ // each argument.+ it('tools/list hands a reviewer the parameter details for every tool', async () => {+ for (const id of LISTED_IDS) {+ const res = makeRes();+ await handler(+ makeReq({+ service: id,+ headers: { 'mcp-protocol-version': '2025-06-18' },+ body: { jsonrpc: '2.0', id: 1, method: 'tools/list' },+ }),+ res,+ );+ const tools = JSON.parse(res.body).result.tools;+ expect(tools.length, id).toBeGreaterThan(0);+ for (const tool of tools) {+ expect(tool.name, id).toBeTruthy();+ expect(String(tool.description || '').length, `${id}/${tool.name}`).toBeGreaterThan(20);+ const props = tool.inputSchema?.properties || {};+ for (const [arg, schema] of Object.entries(props)) {+ expect(schema.type, `${id}/${tool.name}/${arg}`).toBeTruthy();+ }+ }+ }+ });++ // Paid work is not discovery, and must stay behind the 402 for the same+ // clients that now discover freely.+ it('still charges a protocol client for the paid tool', async () => {+ for (const [id] of PAID_FORGE) {+ const res = makeRes();+ await handler(+ makeReq({+ service: id,+ headers: { accept: 'application/json, text/event-stream', 'mcp-protocol-version': '2025-06-18' },+ body: rpc(FORGE_TOOL, { prompt: 'a low-poly orange fox' }),+ }),+ res,+ );+ expect(res.statusCode, id).toBe(402);+ expect(JSON.parse(res.body).accepts[0].network).toBe('eip155:196');+ }+ });+it('free tools need no payment on a paid endpoint', async () => {const res = await post('forge-draft', rpc('getting_started', {}));expect(res.statusCode).toBe(200);@@ -275,6 +355,29 @@ describe('402 challenge: the OKX Agent Payments Protocol integration', () => {expect(get.statusCode).toBe(405);expect(get.headers.allow).toBe('POST, DELETE');});++ // The reviewer sweep runs ONE body across every listed endpoint, so the free+ // row is asked for the paid tool it does not serve. That priced as null and+ // matched no explicit free name, so it fell through to a 402 whose X Layer+ // accept quoted an amount of the literal string "null": a free service+ // demanding an unpayable payment, on the row a reviewer reaches last.+ it('the free status endpoint answers the paid tool it does not serve with an error, not a 402', async () => {+ const res = await post('forge-status', rpc(FORGE_TOOL, { prompt: 'a low-poly orange fox' }));+ expect(res.statusCode).not.toBe(402);+ expect(res.headers['payment-required']).toBeUndefined();+ const out = JSON.parse(res.body);+ expect(out.error?.message || out.result?.content?.[0]?.text || '').toMatch(/unknown|not found|unsupported/i);+ });++ it('no accept ever advertises an amount of "null"', async () => {+ for (const id of [...PAID_FORGE.map(([rowId]) => rowId), 'forge-status']) {+ const res = await post(id, rpc(FORGE_TOOL, { prompt: 'a low-poly orange fox' }));+ if (res.statusCode !== 402) continue;+ for (const accept of JSON.parse(res.body).accepts) {+ expect(accept.amount).toMatch(/^[0-9]+$/);+ }+ }+ });});describe('what a buying agent actually receives', () => {diff --git a/tests/api/okx-identity-studio.test.js b/tests/api/okx-identity-studio.test.jsindex 7fbd439dd..211b9827b 100644--- a/tests/api/okx-identity-studio.test.js+++ b/tests/api/okx-identity-studio.test.js@@ -513,12 +513,17 @@ describe('402 challenge and pricing', () => {// A batch with nothing priced has no total to quote, so the challenge falls// back to the list price it advertises in the catalog and on the SSE lane.+ // Probed with a tools/call rather than a tools/list: discovery (initialize,+ // tools/list, ping) is now free for every caller on this surface, protocol+ // clients included, so a tools/list no longer challenges at all. An unknown+ // tool name is the honest unpriced-but-billable case this fallback exists+ // for, and it must never be served free on a row that sells.it('an unpriced batch still challenges at the single-identity list price', async () => {const res = makeRes();await handler(makeReq({headers: { 'mcp-protocol-version': '2025-06-18' },- body: { jsonrpc: '2.0', id: 1, method: 'tools/list' },+ body: { jsonrpc: '2.0', id: 1, method: 'tools/call', params: { name: 'no_such_tool', arguments: {} } },}),res,);