Skip to content

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.

Add three.ws 3D Studio GPT configuration and compliance audit

fudjia617aab85edaf
diff --git a/.agents/skills/SKILLS.md b/.agents/skills/SKILLS.md
index 0f05c2610..26a9944d5 100644
--- a/.agents/skills/SKILLS.md
+++ b/.agents/skills/SKILLS.md
@@ -19,7 +19,7 @@ Categories:
| Skill | Origin | Trigger |
| --- | --- | --- |
| [`create-3d-avatar`](create-3d-avatar/SKILL.md) ✅ cross-platform-safe | three.ws | Turn a text prompt (or reference image) into a rigged, animation-ready 3D avatar (GLB). Use when you or the user want to create, generate, or make a 3D avatar, character, or humanoid figure that can be posed and animated — "make a 3D avatar of a knight", "generate a character I can animate", "create a rigged astronaut". Generates the mesh and adds a humanoid skeleton in one step. Returns a GLB URL plus a pose-studio link. |
-| [`generate-3d-model`](generate-3d-model/SKILL.md) ✅ cross-platform-safe | three.ws | Turn a text prompt into a downloadable, textured 3D model (GLB). Use when you or the user want to generate, create, make, or forge a 3D model, asset, object, mesh, or prop from a text description — "make a 3D model of a robot", "generate a GLB of a sword", "I need a 3D chair". Runs on the FREE text→3D lane (no key, no account, no payment). Returns a GLB URL plus a browser viewer link. |
+| [`generate-3d-model`](generate-3d-model/SKILL.md) ✅ cross-platform-safe | three.ws | Turn a text prompt into a downloadable, textured 3D model (GLB). Use when you or the user want to generate, create, make, or forge a 3D model, asset, object, mesh, or prop from a text description — "make a 3D model of a robot", "generate a GLB of a sword", "I need a 3D chair". Runs on the FREE text→3D lane (no key, no account, free). Returns a GLB URL plus a browser viewer link. |
| [`rig-a-model`](rig-a-model/SKILL.md) ✅ cross-platform-safe | three.ws | Auto-rig a static 3D GLB model into an animation-ready one. Use when you or the user have an existing GLB and want to rig it, add a skeleton, add bones, make it posable, or make it animatable — "rig this model", "add a skeleton to my GLB", "make this character animation-ready". Takes a GLB URL, adds a humanoid skeleton plus skin weights, and returns the rigged GLB URL and a pose-studio link. |
## intel/trading
diff --git a/.agents/skills/generate-3d-model/SKILL.md b/.agents/skills/generate-3d-model/SKILL.md
index 325e89592..1e2f0c4b6 100644
--- a/.agents/skills/generate-3d-model/SKILL.md
+++ b/.agents/skills/generate-3d-model/SKILL.md
@@ -1,6 +1,6 @@
---
name: generate-3d-model
-description: Turn a text prompt into a downloadable, textured 3D model (GLB). Use when you or the user want to generate, create, make, or forge a 3D model, asset, object, mesh, or prop from a text description — "make a 3D model of a robot", "generate a GLB of a sword", "I need a 3D chair". Runs on the FREE text→3D lane (no key, no account, no payment). Returns a GLB URL plus a browser viewer link.
+description: Turn a text prompt into a downloadable, textured 3D model (GLB). Use when you or the user want to generate, create, make, or forge a 3D model, asset, object, mesh, or prop from a text description — "make a 3D model of a robot", "generate a GLB of a sword", "I need a 3D chair". Runs on the FREE text→3D lane (no key, no account, free). Returns a GLB URL plus a browser viewer link.
when_to_use: User wants a 3D object/asset/prop from text. For a posable character with a skeleton, use create-3d-avatar. To rig an existing GLB, use rig-a-model.
license: MIT
metadata:
@@ -12,8 +12,8 @@ metadata:
# Generate a 3D model from text
Turn a natural-language prompt into a textured, downloadable **GLB** model on the
-**free** three.ws text→3D lane (NVIDIA NIM / Microsoft TRELLIS). No API key, no
-account, no payment — the platform's server-side keys cover provider cost.
+**free** three.ws text→3D lane (NVIDIA NIM / Microsoft TRELLIS). No API key and no
+account — the platform's server-side keys cover provider cost.
The result is always two things: a durable **`glbUrl`** (download / import into any
3D tool) and a **viewer link** that renders the model in the browser.
@@ -46,7 +46,7 @@ image / multi-view → 3D, use the art-directed lanes described in
## Portable path — the hosted HTTP endpoint
No MCP client required. The same free lane is a public JSON-RPC endpoint at
-`https://three.ws/api/mcp-studio` (no auth, no payment):
+`https://three.ws/api/mcp-studio` (no auth, no account):
```bash
curl -s -X POST https://three.ws/api/mcp-studio \
diff --git a/.agents/skills/skills-pack.json b/.agents/skills/skills-pack.json
index d7e412d18..9d124b8d4 100644
--- a/.agents/skills/skills-pack.json
+++ b/.agents/skills/skills-pack.json
@@ -26,7 +26,7 @@
},
{
"name": "generate-3d-model",
- "description": "Turn a text prompt into a downloadable, textured 3D model (GLB). Use when you or the user want to generate, create, make, or forge a 3D model, asset, object, mesh, or prop from a text description — \"make a 3D model of a robot\", \"generate a GLB of a sword\", \"I need a 3D chair\". Runs on the FREE text→3D lane (no key, no account, no payment). Returns a GLB URL plus a browser viewer link.",
+ "description": "Turn a text prompt into a downloadable, textured 3D model (GLB). Use when you or the user want to generate, create, make, or forge a 3D model, asset, object, mesh, or prop from a text description — \"make a 3D model of a robot\", \"generate a GLB of a sword\", \"I need a 3D chair\". Runs on the FREE text→3D lane (no key, no account, free). Returns a GLB URL plus a browser viewer link.",
"whenToUse": "User wants a 3D object/asset/prop from text. For a posable character with a skeleton, use create-3d-avatar. To rig an existing GLB, use rig-a-model.",
"category": "3d/creative",
"origin": "three.ws",
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a1b1fb2d4..938df0543 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **3D model inspection is now free** — Validating and optimizing a glTF/GLB no longer costs anything. The new free, keyless /api/3d/inspect takes a model URL (or a raw upload) and returns whether it's spec-valid, its full structural stats — vertices, triangles, materials, textures, animations, extensions — and a severity-ranked list of exactly what to fix to make it smaller and faster for the web. It runs the official Khronos glTF-Validator plus the same inspection core the platform's paid pipelines use. This capability used to be a paid x402 endpoint (model-check); a validation utility should be free — it builds trust and points agents at the paid Forge Pro, Rigged Avatar, and optimization tiers when they need the heavy lifting done for them. `[feature, improvement]`
- **Agent reputation now scores any wallet or agent on any chain** — The paid Agent Reputation endpoint no longer only works on three.ws agents — pass ANY counterparty and get a deterministic 0–100 trust score before you pay, trade, or delegate to it. It auto-detects the type — a Solana wallet, an EVM 0x address, a pump.fun mint, an ERC-8004 agent id, or a three.ws agent_id — and scores it from real on-chain evidence: transaction history, account age, distinct counterparties, holdings, settlement reliability, prior settled agent payments, and ERC-8004 feedback. Every score comes with the underlying evidence links and a clear list of what couldn't be read; an unknown or unscannable subject returns score:null, never a fabricated number. A new batch mode scores up to 25 counterparties in one call. It's a genuine pre-transaction trust primitive that works across chains, not just on our own platform. (`/docs/trust-primitives`) `[feature, improvement]`
- **Cleaner 3D models from stylized prompts** — Text-to-3D prompts that name an art style — "a cartoon fox," "a stylized robot" — now reliably produce a single, cleanly-isolated model instead of one baked into a busy background scene. The image step that seeds every 3D generation was skipping its "isolated subject on a plain white background" instruction whenever a prompt mentioned a style, which let the image model paint a whole illustrated scene the 3D reconstructor then struggled with. It now keeps that isolation instruction for stylized subjects (and no longer trips on unrelated words like "lightsaber"), so stylized characters and props reconstruct as sharp standalone assets. (`/forge`) `[improvement, fix]`
+- **Find the wallet grinder from the contract grinder** — The two EVM vanity tools now point at each other. The CREATE2 grinder — which searches a salt for a vanity smart-contract address, with no private key involved — now carries a note explaining that difference and linking to the EVM Vanity Wallet generator for anyone who actually wants a wallet they hold the key to. The wallet generator already linked back; this closes the loop so you can no longer land on one and miss the other. (`/eth-vanity`) `[improvement]`
- **Forge listing sharpened: clear 3D generation tiers for agents** — Forge — our text→3D and image→3D generation — now reads like the crown jewel it is on the x402 agent marketplaces. The listing leads with what agents actually build (game assets, NFT collections, 3D scenes, product viz), spells out the three quality tiers and their flat USDC prices (draft $0.05 / standard $0.15 / high $0.50), and points newcomers to the free keyless draft lane as an on-ramp. The input and output schemas are now complete enough for an agent to call it blind — the prompt, the reference-image mode, the free job-token poll, and the finished GLB — and it's tagged so it surfaces under 3D, AI, and Utility. Under the hood the discovery listing and the live payment challenge now share one source of truth, so what an agent sees can never drift from what it pays for. (`/docs/3d-api`) `[improvement]`
- **Free bonding-curve status API for pump.fun tokens** — A new free, keyless endpoint tells an agent exactly where a pump.fun token sits on its bonding curve: how far along it is toward graduation (%), how much SOL is in the curve, how many tokens are left to buy, and whether it has already graduated and migrated to Raydium or PumpSwap. Timing entries and exits around graduation is a core meme-trading move, and this is the one call that answers it — no account, no key, just GET /api/crypto/bonding?mint=<mint>. It pairs with the live launches feed to watch fresh mints climb their curve. Part of the free three.ws Crypto Data API; full reference with runnable curls at /docs/crypto-api. (`/docs/crypto-api`) `[feature]`
- **Free holder distribution / concentration API** — New free endpoint in the Crypto Data API: GET /api/crypto/holders shows who actually holds a Solana token before you size a position — the top wallets with their share of supply, the cumulative top-10 percentage, and a clear low/medium/high concentration verdict on documented thresholds. When the platform's indexer key is available holders are aggregated by wallet with an exact count; without it the endpoint still returns the chain's real top accounts, clearly labeled. No API key, no account, honest nulls for anything unknowable. (`/docs/crypto-api`) `[feature]`
@@ -37,7 +38,11 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Symbol-availability check is now free** — Checking whether a token ticker is already taken is now free and keyless at /api/crypto/symbol — no account, no payment. Send up to 20 candidate tickers in one call and get back, for each, whether it's available plus any exact collisions and fuzzy look-alikes (e.g. MOONZ vs MOONS) already live across the market, so your name won't get lost among clones. It's the natural first step before minting: clear the name here for free, then launch through the Pump Launcher. Previously this was a paid endpoint; it's now a free discovery utility with exact + fuzzy matching across live registries, and it degrades gracefully (never a false 'available') if a data source is down. (`/docs/crypto-api`) `[feature, improvement]`
- **Text→image API for agents — 5 free a day, then pay per image** — Agents can now turn a text prompt into a real image with one call to /api/v1/ai/image — no API key, no account. The first 5 images a day per IP are free; after that each image is a single $0.02 USDC micropayment over x402, settled on Solana or Base, with nothing to sign up for. It runs on the same subsidized lanes as the 3D forge (NVIDIA NIM FLUX and the Google Vertex/Gemini image lane) and returns a durable URL to the rendered image. Pick an aspect ratio, pass an optional seed for reproducible results, and check lane health at /api/v1/ai/image?health=1. A quota slot is only spent when an image actually ships — a bad prompt or a provider content refusal never costs you a free generation. (`/docs/api-reference`) `[feature]`
- **The 3D asset pipeline is now purchasable stage-by-stage** — Every working stage of the platform's 3D pipeline is now its own pay-per-call x402 endpoint, so an agent can buy exactly the step it needs and get a finished asset URL back in one call — no account, no API key. Rig a static model into an animation-ready one ($0.05), remesh or retopologize to a clean topology ($0.03), make a mesh game-ready to a poly budget ($0.03), geometrically restyle it — voxel, brick, voronoi, low-poly ($0.03), or strip an image's background to a transparent PNG for image→3D ($0.01). Each call validates your input, runs the real worker, checks the output is a valid asset, and hands back a durable first-party URL — and if anything fails, you're never charged. Nobody else in the x402 ecosystem sells a 3D asset pipeline. (`/docs/3d-pipeline`) `[feature]`
+- **The animation library API now pages, so it stays fast as the catalog grows** — The motion library is heading past its current 2,800+ clips as we add generatively-produced animations. Its public API (GET /api/animations/library) can now return the catalog in bounded pages — pass ?limit and ?offset and page until there's no next_offset — so a single response never balloons no matter how large the library gets. The /animations gallery already fetches the catalog this way. Calling it with no parameters still returns the whole list exactly as before, so nothing built on the old behavior breaks. (`/animations`) `[improvement, infra]`
+- **The free 3D Studio in ChatGPT stays up even when our rate-limiter has a blip** — The free 3D Studio generates entirely on no-cost engines, so there's no spend to protect by shutting it off. We fixed a case where a hiccup in the rate-limiting backend could make the studio refuse every generation with a "try again shortly" — an outage of a free feature for no reason. Its usage caps now stay enforced when everything is healthy but step aside during a backend blip, so a prompt still returns your model. Nothing about paid features changed: those still stop safely if the same backend is unavailable. `[fix]`
- **three.ws 3D API: free text→3D + inspection for AI agents, with pro tiers** — One URL now discovers the whole free, keyless 3D API for agents. GET /api/3d returns every free endpoint — turn a text prompt into a real GLB (/api/3d/generate) and validate/optimize any glTF/GLB (/api/3d/inspect) — with a live example each, plus the paid ladder it graduates to. GET /api/3d/openapi.json is a real OpenAPI 3.1 spec generated straight from the catalog, so LangChain, openapi-generator, and Swagger UI get typed tools with no key and no account. A new docs page at /3d shows a hero, a live endpoint table, a runnable quickstart with a "run it live" inspection console, an embedded 3D viewer of a real model, and a clear free→paid path: free draft + inspect → Forge Pro quality tiers → animation-ready Rigged Avatars. No other agent-payments platform gives away 3D generation and inspection. (`/3d`) `[feature, docs]`
+- **three.ws 3D Studio for the GPT Store — generate 3D models in ChatGPT, free** — You can now turn a text prompt into a real, downloadable 3D model right inside ChatGPT. The three.ws 3D Studio custom GPT is backed by a free, keyless REST endpoint — describe something like "a low-poly fox" or "a ceramic robot figurine" and get back a GLB you can open in Blender, Unity, Godot, or three.js, plus a browser viewer link. No account, no key, no cost. Every prompt is screened by a content-safety filter so it stays appropriate for all ages, and the model file is served from a public URL so it's easy to download and share. `[feature]`
+- **three.ws Agent Skills pack — for any Claude surface** — Everything three.ws can do is now packaged as portable Agent Skills — self-contained folders that teach any Claude (Claude Code, the Claude apps, or an Agent SDK build) how to use the platform: generate a 3D model from text, make a rigged avatar, rig a GLB you already have, run a wallet, and buy or sell services in the x402 agent economy. Forty skills in all, each with a precise trigger and runnable examples, grouped into three sets — 3D creation, wallet & payments, and market intelligence. The three 3D-creation skills are the newest and run free with no key or account. Install the pack as a Claude Code plugin, drop a skill folder into any project, or upload one to a Claude project. `[sdk, feature]`
- **three.ws Crypto Data API: one free, keyless crypto data bundle for AI agents** — The free crypto endpoints are now one product with a single front door. GET /api/crypto lists the whole bundle — bonding-curve status, whale activity, trending tokens, wallet portfolios, and symbol availability — each with its inputs, outputs, and a live example, so an agent discovers everything in one call (ask for HTML and it renders a browsable page instead of JSON). GET /api/crypto/openapi.json is a real OpenAPI 3.1 spec generated straight from that catalog, so LangChain, openapi-generator, and Swagger UI produce typed clients and callable tools with no key and no account. New endpoints join the index and the spec automatically the moment they ship, and a zero-endpoint state is a valid "coming soon", never an error. Full reference lives at /docs/crypto-api. (`/docs/crypto-api`) `[feature, sdk]`
- **Trimmed low-value endpoints so agents find the tools that matter** — The agent-facing x402 catalog got a spring clean. Nine novelty and me-too endpoints that powered in-product experiences (the club stage, the town NPCs, demo pages) no longer appear as standalone products on x402scan and agentic.market — they keep working inside the product, but they were diluting the catalog and burying the tools agents actually use. What agents now find first: the free Crypto Data API and 3D API, Forge, the pump.fun launcher, vanity addresses, and cross-chain trust primitives. (`/docs/crypto-api`) `[improvement]`
- **Unified service catalog powering all agent storefronts** — Every service three.ws offers — the paid x402 endpoints, the free Crypto Data and 3D APIs, and the OKX.AI 3D Studio listings — is now described in one canonical catalog that every storefront renders from. Before, the same service could carry different descriptions on x402scan versus our own discovery doc versus OKX, and they quietly drifted apart. Now a listing is written once and projected everywhere, automated checks fail the build if any storefront ever disagrees with the catalog, and the 3D Asset Pipeline endpoint — which had been live but invisible to marketplace crawlers — is discoverable. (`/docs/start-here`) `[infra, improvement]`
diff --git a/STRUCTURE.md b/STRUCTURE.md
index a2fd7fa9f..5ccc718bb 100644
--- a/STRUCTURE.md
+++ b/STRUCTURE.md
@@ -27,7 +27,7 @@ bottom.
| OKX.AI marketplace services | [api/okx/3d/[service].js](api/okx/3d/%5Bservice%5D.js) `→ /api/okx/3d/*` | Live | 3D services sold to other agents on OKX.AI (agent #2632): Agent Identity Studio flagship + decomposed studio services. Catalog source of truth: [api/_lib/okx-catalog.js](api/_lib/okx-catalog.js); pipeline: [api/_okx3d/](api/_okx3d); showcase: [pages/agent-identities.html](pages/agent-identities.html) `→ /agent-identities`; docs: [docs/okx-marketplace.md](docs/okx-marketplace.md) |
| Crypto Data API docs / landing | [pages/crypto.html](pages/crypto.html) `→ /crypto` | In-repo · docs surface | Screenshot-worthy public docs + funnel-top for the free, keyless Crypto Data API (`/api/crypto/*` — token snapshot, security, holders, launches, bonding, whales, symbol, wallet, trending). Renders hero, endpoint table, tabbed quickstart (curl/JS/Python), per-endpoint request/response reference and a live "Try it" console. Probes production at runtime and marks each endpoint Live vs Coming soon (degrades gracefully while sibling endpoints roll out). CTAs funnel to paid uniques: [/launcher](pages/launcher.html), [/vanity-wallet](public/vanity-wallet.html), [/forge](pages/forge.html). Spec: [prompts/x402-overhaul/](prompts/x402-overhaul) |
| Free Crypto Data API + discovery | [api/crypto/index.js](api/crypto/index.js) `→ /api/crypto`, [api/crypto/openapi.js](api/crypto/openapi.js) `→ /api/crypto/openapi.json`, docs [docs/crypto-api.md](docs/crypto-api.md) `→ /docs/crypto-api` | Live · docs surface | Front door + OpenAPI 3.1 for the free, keyless Crypto Data API. Catalog assembler [api/_lib/crypto-catalog/index.js](api/_lib/crypto-catalog/index.js) merges `api/_lib/crypto-catalog/*.js` self-describing descriptors (currently `bonding`, `launches`, `symbol`, `token`, `trending`, `wallet`, `whales`) via a static import barrel — the production source of truth, since Vercel's bundler only ships what static imports reach — plus an additive dev-time directory glob; skips malformed/throwing entries, never throws, valid-empty when zero. New descriptor = drop the file AND add its import line to the barrel. OpenAPI built from the same catalog via [api/_lib/crypto-catalog/openapi.js](api/_lib/crypto-catalog/openapi.js). Index does HTML/JSON content negotiation. Endpoint handlers live in `api/crypto/*.js`. Spec: [prompts/x402-overhaul/](prompts/x402-overhaul) |
-| Free 3D API + docs | [api/3d/index.js](api/3d/index.js) `→ /api/3d`, [api/3d/openapi.js](api/3d/openapi.js) `→ /api/3d/openapi.json`, docs [public/3d.html](public/3d.html) `→ /3d` (alias `/docs/3d-api`) | Live · docs surface | Front door + OpenAPI 3.1 for the free, keyless 3D API. Catalog assembler [api/_lib/3d-catalog/index.js](api/_lib/3d-catalog/index.js) merges `api/_lib/3d-catalog/*.js` descriptors (currently `generate`, `inspect`) via a static import barrel (production source of truth) plus an additive dev-time directory glob; new descriptor = drop the file AND add its barrel import line; skips malformed, never throws; OpenAPI built from the same catalog via [api/_lib/3d-catalog/openapi.js](api/_lib/3d-catalog/openapi.js). Index does HTML/JSON content negotiation and advertises the paid ladder (Forge Pro, Rigged Avatars). Docs page: hero, live endpoint table, runnable quickstart with a live "Run inspect" console, embedded `<model-viewer>` GLB preview, and the free→paid ladder. Free endpoints: [api/3d/generate.js](api/3d/generate.js) (prompt 12), [api/3d/inspect.js](api/3d/inspect.js) (prompt 13). Spec: [prompts/x402-overhaul/](prompts/x402-overhaul) |
+| Free 3D API + docs | [api/3d/index.js](api/3d/index.js) `→ /api/3d`, [api/3d/openapi.js](api/3d/openapi.js) `→ /api/3d/openapi.json`, docs [public/3d.html](public/3d.html) `→ /3d` (alias `/docs/3d-api`) | Live · docs surface | Front door + OpenAPI 3.1 for the free, keyless 3D API. Catalog assembler [api/_lib/3d-catalog/index.js](api/_lib/3d-catalog/index.js) merges `api/_lib/3d-catalog/*.js` descriptors (currently `generate`, `inspect`) via a static import barrel (production source of truth) plus an additive dev-time directory glob; new descriptor = drop the file AND add its barrel import line; skips malformed, never throws; OpenAPI built from the same catalog via [api/_lib/3d-catalog/openapi.js](api/_lib/3d-catalog/openapi.js). Index does HTML/JSON content negotiation and advertises the paid ladder (Forge Pro, Rigged Avatars). Docs page: hero, live endpoint table, runnable quickstart with a live "Run inspect" console, embedded `<model-viewer>` GLB preview, and the free→paid ladder. Free endpoints: [api/3d/generate.js](api/3d/generate.js) (prompt 12), [api/3d/inspect.js](api/3d/inspect.js) (prompt 13). GPT Store Actions surface: [api/3d/studio.js](api/3d/studio.js) `→ /api/3d/studio` — a store-compliant twin of `generate` that strips the x402/upgrade block, drops internal ids, and runs the [api/_mcp-studio/safety.js](api/_mcp-studio/safety.js) age-13+ content gate before any GPU work; backs the "three.ws 3D Studio" custom GPT ([prompts/store-submissions/_generated/openai-actions.yaml](prompts/store-submissions/_generated/openai-actions.yaml) + [openai-gpt-config.md](prompts/store-submissions/_generated/openai-gpt-config.md), store-submission prompt 12). Spec: [prompts/x402-overhaul/](prompts/x402-overhaul) |
| Unified service catalog (one source, two storefronts) | [api/_lib/service-catalog/index.js](api/_lib/service-catalog/index.js), descriptors [api/_lib/service-catalog/services/](api/_lib/service-catalog/services/index.js) | Live | The canonical written-once record of every service (paid x402 + free crypto/3D bundles + OKX.AI rows). `toBazaarDiscovery()` generates every static `/api/x402/*` entry in the [api/wk.js](api/wk.js) discovery doc (replacing ~1,400 lines of hand-mirrored blocks); `toOkxCatalog()` reproduces the OKX `catalogIndex()` payload exactly, with an `include:'all'` projection ready for listing expansion. New paid service = drop `services/<slug>.js` + add its barrel import row. No-drift guards: [tests/service-catalog.test.js](tests/service-catalog.test.js). Spec: [specs/SERVICE_CATALOG.md](specs/SERVICE_CATALOG.md) |
| Sperax partnership + SperaxOS plugin | [pages/sperax.html](pages/sperax.html) `→ /sperax`, plugin [public/sperax/](public/sperax/README.md), manifest `→ /.well-known/sperax-plugin.json`, tools [api/chat-plugin/[tool].js](api/chat-plugin/%5Btool%5D.js) `→ /api/chat-plugin/*`, panel `→ /sperax/iframe/` | In-repo · Live | Partnership landing for the SperaxOS integration: three.ws ships as a standalone `plugin.delivery` plugin that gives a SperaxOS agent an embodied 3D avatar (speak/gesture/emote/render_agent), bound to an ERC-8004 identity, settling over Base x402. Launch offer: free AI credits for three.ws users on [chat.sperax.io](https://chat.sperax.io) — page explains what it is and how to claim. Blog: [/blog/three-ws-speraxusd-integration](blog/three-ws-speraxusd-integration.html) |
| Live Agents wall (mission control) | [pages/agents-live.html](pages/agents-live.html) + [src/agents-live.js](src/agents-live.js) `→ /agents-live` | In-repo · roster [api/agents/public.js](api/agents/public.js) (`sort=live`), per-agent SSE [api/agent-screen-stream.js](api/agent-screen-stream.js) | Real-time grid of every meaningful agent, ranked by most-recent on-chain/skill action (never-used placeholders suppressed). Each card streams a live caster feed when watched, else its real `agent_actions` as a terminal + an "active Nm ago" recency chip. Layers: showrunner spotlight ([src/showrunner.js](src/showrunner.js)), reputation arena ([src/agents-live-arena.js](src/agents-live-arena.js)), platform ticker ([src/theater-feed.js](src/theater-feed.js)) |
diff --git a/api/_lib/embodiment-artifact.js b/api/_lib/embodiment-artifact.js
new file mode 100644
index 000000000..b82e95117
--- /dev/null
+++ b/api/_lib/embodiment-artifact.js
@@ -0,0 +1,80 @@
+// Embodiment artifact — the inline "living body" an MCP tool hands back.
+//
+// A persona tool (create / reload / speak) returns one of these: a self-contained
+// text/html resource that mounts the hosted embodiment embed
+// (pages/embodiment/embed.html → apps-sdk/embodiment/EmbodimentStage) in a
+// sandboxed iframe and passes this turn's speak/emotion payload as query params.
+// The Apps SDK host (ChatGPT/Claude) renders it inline: the rigged body idles
+// between turns, lip-syncs the reply, and shows the matching expression + gesture.
+//
+// Shared by the paid studio (api/_mcp3d) and the free studio (api/_mcp-studio) so
+// both drive the SAME body from the SAME hosted page — one embodiment surface, two
+// front doors. Nothing here references a token, wallet, coin, or payment: a
+// persona is a name and a 3D body.
+
+import { env } from './env.js';
+
+// The hosted embed page. Absolute + env-derived so the URL is framable from any
+// host (ChatGPT, Claude), not tied to the request origin of the MCP call.
+export const EMBODIMENT_EMBED_URL = `${env.APP_ORIGIN}/embodiment/embed`;
+
+const escapeHtml = (s) =>
+ String(s).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[c]);
+
+/**
+ * Build the embed URL for a persona in a given conversational state. `glb` is
+ * always passed inline so the body loads without a round-trip; `persona` is passed
+ * too so a bare-id reload (no glb) still resolves via /api/mcp3d/persona.
+ *
+ * @param {{ persona: object, state?: string, text?: string, emotion?: string, intensity?: number, gesture?: string|null }} args
+ * @returns {string}
+ */
+export function buildEmbedUrl({ persona, state, text, emotion, intensity, gesture }) {
+ const u = new URL(EMBODIMENT_EMBED_URL);
+ u.searchParams.set('persona', persona.persona_id);
+ if (persona.glb_url) u.searchParams.set('glb', persona.glb_url);
+ if (persona.name) u.searchParams.set('name', persona.name);
+ if (state) u.searchParams.set('state', state);
+ if (text) u.searchParams.set('text', String(text).slice(0, 600));
+ if (emotion) u.searchParams.set('emotion', emotion);
+ if (intensity != null) u.searchParams.set('intensity', String(intensity));
+ if (gesture) u.searchParams.set('gesture', gesture);
+ return u.toString();
+}
+
+/**
+ * Render the embodied persona as an inline MCP resource: a self-contained HTML
+ * document that frames the hosted embed and carries the turn's payload. The
+ * `openai/outputTemplate` _meta lets Apps SDK hosts that key off a registered
+ * template reuse the same embed URL.
+ *
+ * @param {{ persona: object, state?: string, text?: string, emotion?: string, intensity?: number, gesture?: string|null }} args
+ * @returns {{ type: 'resource', resource: object }}
+ */
+export function embodimentArtifact({ persona, state = 'idle', text = '', emotion = 'neutral', intensity = 0, gesture = null }) {
+ const embedUrl = buildEmbedUrl({ persona, state, text, emotion, intensity, gesture });
+ const name = persona.name || 'Agent';
+ const html =
+ `<!doctype html><html lang="en"><head><meta charset="utf-8">` +
+ `<meta name="viewport" content="width=device-width,initial-scale=1">` +
+ `<title>${escapeHtml(name)} — live</title>` +
+ `<style>html,body{margin:0;height:100%;background:transparent}` +
+ `.wrap{position:relative;width:100%;height:480px;border-radius:16px;overflow:hidden;` +
+ `background:radial-gradient(120% 120% at 50% 0%,#1a1a24 0%,#0c0c12 70%)}` +
+ `iframe{width:100%;height:100%;border:0;display:block}` +
+ `.fb{position:absolute;inset:auto 0 0 0;padding:8px 12px;font:600 12px system-ui;color:#cbd5e1;text-align:center}` +
+ `.fb a{color:#a78bfa}</style></head><body>` +
+ `<div class="wrap"><iframe title="${escapeHtml(name)} live avatar" ` +
+ `src="${escapeHtml(embedUrl)}" allow="autoplay" sandbox="allow-scripts allow-same-origin allow-popups"></iframe>` +
+ `<noscript class="fb">Open <a href="${escapeHtml(embedUrl)}">${escapeHtml(name)}</a> in a browser.</noscript>` +
+ `</div></body></html>`;
+ return {
+ type: 'resource',
+ resource: {
+ uri: embedUrl,
+ mimeType: 'text/html',
+ text: html,
+ _meta: { 'openai/outputTemplate': embedUrl },
+ },
+ };
+}
diff --git a/api/_lib/migrations/20260707120000_tokenized_3d_assets.sql b/api/_lib/migrations/20260707120000_tokenized_3d_assets.sql
new file mode 100644
index 000000000..22bd654d8
--- /dev/null
+++ b/api/_lib/migrations/20260707120000_tokenized_3d_assets.sql
@@ -0,0 +1,59 @@
+-- Migration: tokenized 3D assets — the platform launch record for a generated
+-- GLB minted as a Metaplex Core NFT (see api/_lib/tokenize-3d.js).
+-- Apply: psql "$DATABASE_URL" -f api/_lib/migrations/20260707120000_tokenized_3d_assets.sql
+-- Idempotent.
+--
+-- One row per mint attempt. The row is CLAIMED (status='pending') before any
+-- on-chain call so a double-call for the same idempotency key can never
+-- double-mint — the second caller reads back the winner's row. On success the
+-- row flips to 'minted' with the mint + tx; on a clean failure it flips to
+-- 'failed' so the same key can be retried.
+--
+-- This is the reused "launch record" for tokenized 3D (the NFT analogue of
+-- pump_agent_mints, which is pump.fun-coin-specific): the /launches-style read
+-- surface (get_3d_asset_onchain + the provenance read-back) keys on it.
+
+begin;
+
+create table if not exists tokenized_3d_assets (
+ id uuid primary key default gen_random_uuid(),
+ idempotency_key text not null, -- caller-supplied or derived
+ network text not null check (network in ('mainnet','devnet')),
+ status text not null default 'pending'
+ check (status in ('pending','minted','failed')),
+ mint text, -- Core asset pubkey (base58), null until minted
+ owner_wallet text not null, -- NFT recipient (base58 Solana pubkey)
+ creator_user_id uuid references users(id) on delete set null,
+ source_avatar_id uuid references avatars(id) on delete set null,
+ parent_mint text, -- lineage: the asset this was remixed from
+ name text not null,
+ glb_url text not null, -- durable GLB (R2 https)
+ image_url text, -- durable thumbnail (R2 https)
+ viewer_url text, -- live three.ws viewer link
+ metadata_uri text, -- Metaplex off-chain JSON (R2 https), null until built
+ royalty_bps int not null default 500
+ check (royalty_bps between 0 and 1000), -- hard cap: 10%
+ royalty_recipient text, -- creator wallet the royalty routes to
+ provenance jsonb not null default '{}'::jsonb,
+ tx_signature text,
+ mint_error text,
+ created_at timestamptz not null default now(),
+ updated_at timestamptz not null default now()
+);
+
+-- One claim per (idempotency_key, network) — the double-mint guard.
+create unique index if not exists tokenized_3d_assets_idem_uniq
+ on tokenized_3d_assets(idempotency_key, network);
+
+-- One row per minted asset — the read-back key.
+create unique index if not exists tokenized_3d_assets_mint_uniq
+ on tokenized_3d_assets(mint, network) where mint is not null;
+
+create index if not exists tokenized_3d_assets_creator
+ on tokenized_3d_assets(creator_user_id);
+create index if not exists tokenized_3d_assets_owner
+ on tokenized_3d_assets(owner_wallet);
+create index if not exists tokenized_3d_assets_created
+ on tokenized_3d_assets(created_at desc);
+
+commit;
diff --git a/api/_lib/pump-pricing.js b/api/_lib/pump-pricing.js
index b4620c2d5..c95d89425 100644
--- a/api/_lib/pump-pricing.js
+++ b/api/_lib/pump-pricing.js
@@ -41,7 +41,12 @@ export const TOOL_PRICING = Object.freeze({
// autonomous reputation-refresh pipeline exercises it as a real x402 call and
// external agents pay the going rate to vet a counterparty.
solana_agent_reputation: { amount_usdc: 0.001, description: 'Per call — on-chain agent reputation summary' },
- // Discovery / lookups (incl. list_animations) — free
+ // Tokenize a 3D asset — a real on-chain Solana mint: durable media promotion
+ // (R2 + IPFS), a headless thumbnail render, metadata upload, and a Metaplex
+ // Core mint whose rent the platform authority pays. Priced to cover rent +
+ // compute. The read-back (get_3d_asset_onchain) is a free public read.
+ mint_3d_asset: { amount_usdc: 0.25, description: 'Per mint — on-chain Solana 3D NFT (media + rent)' },
+ // Discovery / lookups (incl. list_animations, get_3d_asset_onchain) — free
});
export function priceFor(toolName) {
diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.js
index 776ee7700..1f21ace84 100644
--- a/api/_lib/rate-limit.js
+++ b/api/_lib/rate-limit.js
@@ -394,20 +394,38 @@ export const limits = {
// distinct override gets its own isolated bucket under the rl:api:ip prefix.
apiIp: (ip, opts = {}) =>
getLimiter('api:ip', { limit: 120, window: '1 m', ...opts }).limit(ip),
- // Free, unauthenticated 3D Studio (api/mcp-studio.js) abuse protection. The
- // studio runs generation operator-funded for anonymous ChatGPT users, so each
- // generation call costs the platform real GPU/provider spend. These are the
- // real per-IP quota (NOT a comment): a short burst cap stops hammering and an
- // hourly cap bounds cost per source. Critical — fail closed in prod when Redis
- // is absent rather than allow unbounded spend across serverless instances.
+ // Free, unauthenticated 3D Studio (api/mcp-studio.js) abuse protection. Every
+ // studio tool routes through a FREE lane (NVIDIA NIM text→3D, HF Spaces
+ // image→3D) — zero marginal vendor cost — because the studio never names the
+ // paid Replicate backend and this deployment has free engines configured, so
+ // forge's free-first router never falls back to paid (see BACKENDS.trellis:
+ // "Free deployments never route here automatically"). These per-IP caps (a
+ // short burst cap that stops hammering + an hourly cap per source) still
+ // enforce whenever Redis is healthy — they are real quota, not a comment.
+ //
+ // NON-critical on purpose (fail OPEN on a Redis outage), mirroring the paid
+ // server's own free lane (mcp3dGenerateFree): "a Redis outage must never deny
+ // a zero-cost generation." Failing these closed took the whole free studio
+ // down during the June-2026 Upstash over-quota outage — a self-inflicted
+ // denial of a free feature for no spend saved. Spend is still protected in
+ // depth: /api/forge underneath fail-CLOSES its own paid-lane global breaker
+ // (mcp3dGenerateGlobal), so even a misrouted paid call can't drain budget.
studioGenBurst: (ip) =>
- getLimiter('studio:gen:burst', { limit: 4, window: '1 m', critical: true }).limit(ip),
+ getLimiter('studio:gen:burst', { limit: 4, window: '1 m' }).limit(ip),
studioGenHourly: (ip) =>
- getLimiter('studio:gen:hourly', { limit: 30, window: '1 h', critical: true }).limit(ip),
+ getLimiter('studio:gen:hourly', { limit: 30, window: '1 h' }).limit(ip),
// Cheap per-IP cap on studio transport/discovery (initialize, tools/list,
// ping, resources). Bounds discovery floods without touching the generation
// budget. Non-critical: a missing-Redis misconfig degrades gracefully.
studioIp: (ip) => getLimiter('studio:ip', { limit: 300, window: '1 m' }).limit(ip),
+ // Free-studio persona writes (create_agent_persona / persona_say): each fetches
+ // or restores a bounded GLB and writes a small identity record — cheap, but not
+ // free, so a per-IP burst cap stops a scripted flood from filling storage. The
+ // read path (get_agent_persona) rides the studioIp transport cap above.
+ // Non-critical: like the generation lanes, a Redis outage must never deny a
+ // zero-cost embodiment feature (spend is protected in depth downstream).
+ studioPersonaWrite: (ip) =>
+ getLimiter('studio:persona:write', { limit: 20, window: '1 m' }).limit(ip),
// Per-principal ceiling on the expensive/gated pump-fun MCP tools (vanity grind,
// whale/claim watches, metadata upload that burns shared IPFS pinning credits).
// A bearer authorizes these for free, so without a per-principal cap one account
@@ -464,15 +482,17 @@ export const limits = {
getLimiter('mcp3d:status', { limit: 240, window: '1 m', local: true }).limit(key),
// Platform-wide hourly circuit breaker across ALL free-studio IPs, so
// distributed callers each under their own studioGenHourly cap can't
- // collectively drain the shared GPU/provider budget. Shares the
- // FORGE_PAID_GLOBAL_HOURLY envelope with the paid lane. Critical → fails closed
- // in prod without Redis rather than uncapping spend. (studioIp / studioGenBurst
- // / studioGenHourly are defined above next to the other mcp buckets.)
+ // collectively flood the free NVIDIA / HF allocation. Enforced whenever Redis
+ // is healthy. NON-critical (fail OPEN on a Redis outage) for the same reason as
+ // studioGenBurst/Hourly above: the studio's lanes are zero marginal cost, so a
+ // Redis outage must never dead-end a free generation. Real paid spend is still
+ // fail-CLOSED one layer down at forge's own mcp3dGenerateGlobal, which this
+ // breaker only backstops. (studioIp / studioGenBurst / studioGenHourly are
+ // defined above next to the other mcp buckets.)
studioGenerateGlobal: () =>
getLimiter('studio:generate:global', {
limit: FORGE_PAID_GLOBAL_HOURLY,
window: '1 h',
- critical: true,
}).limit('global'),
// Forge prompt enhancer — one free-tier LLM rewrite per call. Cheap text
// completion, but each one hits an upstream provider, so cap per principal to
diff --git a/api/_lib/tokenize-3d-metadata.js b/api/_lib/tokenize-3d-metadata.js
new file mode 100644
index 000000000..8996c5309
--- /dev/null
+++ b/api/_lib/tokenize-3d-metadata.js
@@ -0,0 +1,183 @@
+// Tokenized-3D metadata + policy — the PURE core (no DB, no chain, no storage).
+//
+// This module owns the two things that must be provably correct in isolation:
+// 1. The Metaplex-compliant metadata JSON for a 3D NFT — the GLB under
+// `animation_url` + `properties.files` (mimeType model/gltf-binary), the
+// thumbnail under `image`, the live viewer under `external_url`, and baked
+// provenance under `properties.provenance`.
+// 2. The enforced-royalty hard cap.
+// Both are unit-tested in tests/tokenize-3d.test.js without any network.
+//
+// $THREE-policy clean: $THREE is the only coin named in the copy/metadata. SOL
+// (Core rent + royalty rail) is a settlement mechanic only; no other mint is
+// ever hardcoded here — the $THREE mint comes from env via three-brand.js.
+
+import { createHash } from 'node:crypto';
+
+import { THREE_WS, threeTokenLinks } from './three-brand.js';
+
+// ── Royalty policy ───────────────────────────────────────────────────────────
+
+/**
+ * Hard cap on the enforced secondary-sale royalty (10%). A caller asking for
+ * more is clamped to this — the holder always keeps the clear majority of a
+ * resale, and the platform never mints an asset that taxes the secondary market
+ * beyond a sane ceiling. This is enforced twice: here (before the mint) and by
+ * the CHECK constraint on tokenized_3d_assets.royalty_bps.
+ */
+export const TOKENIZE_3D_ROYALTY_CAP_BPS = 1000;
+
+/** Default enforced royalty when the caller doesn't specify one (5%, to creator). */
+export const TOKENIZE_3D_ROYALTY_DEFAULT_BPS = 500;
+
+/**
+ * Clamp a requested seller-fee to [0, cap]. Non-finite / negative → the default.
+ * @param {number|string|null|undefined} bps
+ * @returns {{ bps: number, capped: boolean, requestedBps: number }}
+ */
+export function clampSellerFeeBps(bps) {
+ if (bps === null || bps === undefined || bps === '') {
+ return { bps: TOKENIZE_3D_ROYALTY_DEFAULT_BPS, capped: false, requestedBps: TOKENIZE_3D_ROYALTY_DEFAULT_BPS };
+ }
+ const requested = Math.round(Number(bps));
+ if (!Number.isFinite(requested) || requested < 0) {
+ return { bps: TOKENIZE_3D_ROYALTY_DEFAULT_BPS, capped: false, requestedBps: TOKENIZE_3D_ROYALTY_DEFAULT_BPS };
+ }
+ const clamped = Math.min(requested, TOKENIZE_3D_ROYALTY_CAP_BPS);
+ return { bps: clamped, capped: requested > TOKENIZE_3D_ROYALTY_CAP_BPS, requestedBps: requested };
+}
+
+// ── Idempotency ──────────────────────────────────────────────────────────────
+
+/**
+ * Deterministic idempotency key for a mint request. Same (owner, source,
+ * network, creator) → same key → the claim-first guard collapses a double-call
+ * onto one on-chain mint. Callers may override with their own key.
+ *
+ * @param {{ ownerWallet: string, glbSource: string, network: string, creatorUserId?: string|null }} p
+ * @returns {string} 64-char hex
+ */
+export function deriveIdempotencyKey({ ownerWallet, glbSource, network, creatorUserId = null }) {
+ return createHash('sha256')
+ .update(`${network}\n${ownerWallet}\n${glbSource}\n${creatorUserId || ''}`)
+ .digest('hex');
+}
+
+// ── Metadata ─────────────────────────────────────────────────────────────────
+
+function clamp(str, max) {
+ const s = String(str ?? '');
+ return s.length > max ? s.slice(0, max) : s;
+}
+
+/**
+ * Build the Metaplex-compliant off-chain metadata JSON for a tokenized 3D asset.
+ * A strict superset of the Metaplex token-metadata standard so Phantom / Solscan
+ * / Magic Eden render it, with `animation_url` = the rigged GLB so the NFT media
+ * is a live 3D model, not a static PNG.
+ *
+ * @param {object} a
+ * @param {string} a.name
+ * @param {string} [a.description]
+ * @param {string} a.glbUrl durable GLB (https)
+ * @param {string} a.imageUrl durable thumbnail (https)
+ * @param {string} a.viewerUrl live three.ws viewer link
+ * @param {string} [a.glbIpfs] optional ipfs:// GLB (permanence copy)
+ * @param {string} [a.imageIpfs] optional ipfs:// thumbnail
+ * @param {string} a.creatorWallet base58 creator/owner wallet
+ * @param {string} [a.creatorUserId]
+ * @param {string} [a.prompt] generation prompt (provenance)
+ * @param {string} [a.generationModel]
+ * @param {string} [a.generationProvider]
+ * @param {string} [a.parentMint] lineage parent asset (remix source)
+ * @param {string[]} [a.lineage] ancestor mints, root-last
+ * @param {number} a.royaltyBps effective (already-clamped) seller fee
+ * @param {string} a.royaltyRecipient wallet the royalty routes to
+ * @param {'mainnet'|'devnet'} a.network
+ * @param {string} a.createdAt ISO timestamp
+ * @returns {object} Metaplex metadata JSON
+ */
+export function buildTokenized3dMetadata(a) {
+ const tok = threeTokenLinks();
+ const description =
+ a.description?.trim() ||
+ `${a.name} — a 3D asset generated on ${THREE_WS.name}, minted on Solana as a live, ` +
+ `interactive 3D NFT. Its media is a rigged glTF model, not a static image.`;
+
+ const files = [
+ { uri: a.glbUrl, type: 'model/gltf-binary' },
+ ...(a.glbIpfs ? [{ uri: a.glbIpfs, type: 'model/gltf-binary' }] : []),
+ { uri: a.imageUrl, type: 'image/png' },
+ ...(a.imageIpfs ? [{ uri: a.imageIpfs, type: 'image/png' }] : []),
+ ];
+
+ const attributes = [
+ { trait_type: 'Platform', value: THREE_WS.name },
+ { trait_type: 'Standard', value: 'Metaplex Core' },
+ { trait_type: 'Media', value: '3D / glTF-binary' },
+ { trait_type: 'Creator', value: a.creatorWallet },
+ ...(a.prompt ? [{ trait_type: 'Prompt', value: clamp(a.prompt, 256) }] : []),
+ ...(a.generationModel ? [{ trait_type: 'Model', value: clamp(a.generationModel, 96) }] : []),
+ ...(a.generationProvider ? [{ trait_type: 'Provider', value: clamp(a.generationProvider, 64) }] : []),
+ ...(a.parentMint ? [{ trait_type: 'Parent', value: a.parentMint }] : []),
+ { trait_type: 'Royalty', value: `${(a.royaltyBps / 100).toFixed(2)}%` },
+ { trait_type: '$THREE', value: tok.mint },
+ { trait_type: 'Network', value: a.network },
+ { trait_type: 'Created', value: a.createdAt },
+ ];
+
+ const provenance = {
+ platform: THREE_WS.name,
+ creator: a.creatorWallet,
+ ...(a.creatorUserId ? { creator_user_id: a.creatorUserId } : {}),
+ ...(a.prompt ? { prompt: a.prompt } : {}),
+ ...(a.generationModel ? { generation_model: a.generationModel } : {}),
+ ...(a.generationProvider ? { generation_provider: a.generationProvider } : {}),
+ ...(a.parentMint ? { parent_mint: a.parentMint } : {}),
+ ...(a.lineage?.length ? { lineage: a.lineage } : {}),
+ minted_at: a.createdAt,
+ network: a.network,
+ };
+
+ return {
+ // ── Metaplex token-metadata standard ──
+ name: a.name,
+ symbol: '3D',
+ description,
+ image: a.imageUrl,
+ animation_url: a.glbUrl,
+ external_url: a.viewerUrl,
+ // Standard TM location for the royalty (legacy marketplace readers). The
+ // enforced copy is the on-chain Core Royalties plugin; this mirrors it.
+ seller_fee_basis_points: a.royaltyBps,
+ attributes,
+ properties: {
+ category: '3d',
+ files,
+ creators: [{ address: a.royaltyRecipient, share: 100 }],
+ seller_fee_basis_points: a.royaltyBps,
+ provenance,
+ },
+ // ── three.ws brand block — links travel with the asset ──
+ platform: {
+ name: THREE_WS.name,
+ url: THREE_WS.website,
+ tagline: THREE_WS.tagline,
+ x: THREE_WS.x,
+ github: THREE_WS.github,
+ },
+ token: { symbol: tok.symbol, mint: tok.mint, url: tok.pumpfun },
+ $schema: 'https://three.ws/schemas/tokenized-3d/0.1.json',
+ spec: 'tokenized-3d/0.1',
+ };
+}
+
+/**
+ * The live three.ws viewer link for a GLB. Canonical format used across the
+ * platform (api/_mcp-studio/forge-client.js viewerUrl).
+ * @param {string} appOrigin
+ * @param {string} glbUrl
+ */
+export function viewerLinkFor(appOrigin, glbUrl) {
+ return `${appOrigin.replace(/\/$/, '')}/viewer?src=${encodeURIComponent(glbUrl)}`;
+}
diff --git a/api/_lib/tokenize-3d.js b/api/_lib/tokenize-3d.js
new file mode 100644
index 000000000..73ada3e6c
--- /dev/null
+++ b/api/_lib/tokenize-3d.js
@@ -0,0 +1,667 @@
+/**
+ * Tokenized 3D — mint a generated/owned GLB as a Metaplex Core NFT whose media
+ * is a live, interactive 3D viewer, with baked provenance and enforced royalties.
+ * ---------------------------------------------------------------------------
+ * The payoff of infrastructure that already coexists in this repo: text→3D→rig
+ * generation, R2 avatar storage, and Solana signing rails. This module ties them
+ * together so a generated avatar becomes ownable, transferable, composable
+ * on-chain property.
+ *
+ * Flow (mintTokenized3dAsset):
+ * 1. Resolve the source GLB (an owned avatar or a supplied GLB URL) and the
+ * recipient wallet (OAuth-linked or supplied).
+ * 2. CLAIM an idempotency row *before* any on-chain call — the double-mint
+ * guard. A second call with the same key reads back the winner's mint.
+ * 3. Promote media to durable storage: copy the GLB + a fresh thumbnail into a
+ * tokenize-namespaced R2 key (so the NFT media never moves even if the
+ * source avatar is later deleted), and pin to IPFS when configured.
+ * 4. Build + upload Metaplex-compliant metadata (GLB under animation_url).
+ * 5. Mint a Core asset with an enforced Royalties plugin (capped), owned by the
+ * recipient, signed + paid by the three.ws collection authority.
+ * 6. Persist the launch record (mint, tx, provenance) and return the mint +
+ * explorer + viewer links.
+ *
+ * Heavy Solana/Umi + render deps are imported here (not in the pure metadata
+ * module) so callers that only need metadata shape stay dependency-light.
+ *
+ * $THREE-policy clean: $THREE is the only coin named. SOL is the Core rent +
+ * royalty rail (a settlement mechanic); no other mint is ever referenced.
+ */
+
+import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
+import { mplCore, create, fetchAsset, ruleSet } from '@metaplex-foundation/mpl-core';
+import {
+ generateSigner,
+ publicKey as umiPublicKey,
+ signerIdentity,
+} from '@metaplex-foundation/umi';
+import bs58 from 'bs58';
+
+import { sql } from './db.js';
+import { env } from './env.js';
+import { collectionAuthoritySigner, collectionAuthorityAddress } from './solana-collection.js';
+import { solanaConnection } from './solana/connection.js';
+import { explorerTxUrl } from './avatar-wallet.js';
+import { putObject, publicUrl, getObjectBuffer } from './r2.js';
+import { pinToIPFS, ipfsPinningConfigured } from './ipfs-pin.js';
+import { fetchSafePublicUrl } from './ssrf-guard.js';
+import { getAvatar, resolveAvatarUrl } from './avatars.js';
+import { getUserSolanaWallets } from './nft-gate.js';
+import { resolveRenderParams, renderAvatarScene } from './avatar-render.js';
+import {
+ buildTokenized3dMetadata,
+ viewerLinkFor,
+ clampSellerFeeBps,
+ deriveIdempotencyKey,
+ TOKENIZE_3D_ROYALTY_CAP_BPS,
+} from './tokenize-3d-metadata.js';
+
+export { TOKENIZE_3D_ROYALTY_CAP_BPS };
+
+/** Networks we mint on. Devnet is the default; mainnet is explicit. */
+export const TOKENIZE_3D_NETWORKS = /** @type {const} */ (['mainnet', 'devnet']);
+
+/**
+ * Resolve the minting network. Devnet-default is deliberate: real value only
+ * moves when a caller explicitly asks for mainnet.
+ * @param {string|null|undefined} preferred
+ * @returns {'mainnet'|'devnet'}
+ */
+export function resolveNetwork(preferred) {
+ return preferred === 'mainnet' ? 'mainnet' : 'devnet';
+}
+
+function rpcForNetwork(network) {
+ return network === 'devnet' ? env.SOLANA_RPC_URL_DEVNET : env.SOLANA_RPC_URL;
+}
+
+function isValidBase58Pubkey(addr) {
+ try {
+ umiPublicKey(addr);
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+function encodeSignature(sig) {
+ return typeof sig === 'string' ? sig : bs58.encode(sig);
+}
+
+function assetExplorerUrl(mint, network) {
+ const cluster = network === 'devnet' ? '?cluster=devnet' : '';
+ return `https://solscan.io/token/${mint}${cluster}`;
+}
+
+// ── Source + owner resolution ────────────────────────────────────────────────
+
+/**
+ * Resolve the GLB source into { glbUrl, name, sourceAvatarId, provenance } and
+ * the durable-storage bytes fetcher. Accepts either an owned avatar id or a raw
+ * GLB URL.
+ *
+ * @param {object} p
+ * @param {string} [p.avatarId]
+ * @param {string} [p.glbUrl]
+ * @param {string|null} p.requesterId OAuth userId (visibility gate for avatars)
+ * @param {string} [p.name]
+ */
+async function resolveSource({ avatarId, glbUrl, requesterId, name }) {
+ if (avatarId) {
+ const avatar = await getAvatar({ id: avatarId, requesterId });
+ if (!avatar) {
+ throw Object.assign(new Error('avatar not found'), { status: 404, code: 'not_found' });
+ }
+ const urlInfo = await resolveAvatarUrl(avatar);
+ if (!urlInfo?.url) {
+ throw Object.assign(new Error('this avatar has no model to tokenize yet'), {
+ status: 409,
+ code: 'no_model',
+ });
+ }
+ const meta = avatar.source_meta || {};
+ return {
+ sourceUrl: urlInfo.url,
+ sourceAvatarId: avatar.id,
+ name: name || avatar.name || 'three.ws 3D asset',
+ description: avatar.description || '',
+ parentAvatarId: avatar.parent_avatar_id || null,
+ provenance: {
+ prompt: meta.source_prompt || null,
+ generationModel: meta.generator || meta.model || null,
+ generationProvider: meta.provider || (meta.generator ? 'three.ws' : null),
+ },
+ };
+ }
+ if (glbUrl) {
+ if (!/^https?:\/\//i.test(glbUrl)) {
+ throw Object.assign(new Error('glb_url must be an absolute http(s) URL'), {
+ status: 400,
+ code: 'validation_error',
+ });
+ }
+ return {
+ sourceUrl: glbUrl,
+ sourceAvatarId: null,
+ name: name || 'three.ws 3D asset',
+ description: '',
+ parentAvatarId: null,
+ provenance: { prompt: null, generationModel: null, generationProvider: null },
+ };
+ }
+ throw Object.assign(new Error('provide either avatar_id or glb_url'), {
+ status: 400,
+ code: 'validation_error',
+ });
+}
+
+/**
+ * Resolve the NFT recipient wallet: an explicitly supplied base58 address, else
+ * the OAuth user's linked Solana wallet.
+ */
+async function resolveOwnerWallet({ ownerWallet, requesterId }) {
+ if (ownerWallet) {
+ if (!isValidBase58Pubkey(ownerWallet)) {
+ throw Object.assign(new Error('owner_wallet is not a valid Solana address'), {
+ status: 400,
+ code: 'validation_error',
+ });
+ }
+ return ownerWallet;
+ }
+ if (requesterId) {
+ const wallets = await getUserSolanaWallets(requesterId);
+ if (wallets.length) return wallets[0];
+ }
+ throw Object.assign(
+ new Error('no recipient wallet — connect a Solana wallet (sign in) or pass owner_wallet'),
+ { status: 400, code: 'no_wallet' },
+ );
+}
+
+// ── Durable storage promotion ────────────────────────────────────────────────
+
+/**
+ * Copy the source GLB and a freshly-rendered thumbnail into a tokenize-namespaced
+ * R2 key so the NFT media is permanent + first-party, and pin both to IPFS when
+ * a provider is configured. Returns the durable URLs.
+ *
+ * @returns {Promise<{ glbUrl: string, imageUrl: string, glbIpfs: string|null, imageIpfs: string|null }>}
+ */
+async function promoteToDurableStorage({ idempotencyKey, sourceUrl, name }) {
+ const base = `tokenized/${idempotencyKey}`;
+
+ // 1. GLB bytes → durable R2 key.
+ const glbResp = await fetchSafePublicUrl(sourceUrl, {}, { allowHttp: false });
+ if (!glbResp.ok) {
+ throw Object.assign(new Error(`could not fetch source GLB (${glbResp.status})`), {
+ status: 502,
+ code: 'source_unreachable',
+ });
+ }
+ const glbBuf = Buffer.from(await glbResp.arrayBuffer());
+ const glbKey = `${base}/model.glb`;
+ await putObject({ key: glbKey, body: glbBuf, contentType: 'model/gltf-binary' });
+ const glbUrl = publicUrl(glbKey);
+
+ // 2. Thumbnail — render the model once, store it durably. A 3D NFT needs a
+ // real image for wallets/marketplaces that don't render glTF.
+ const { params, error } = resolveRenderParams({
+ scene: 'full-body',
+ size: 1024,
+ bg: '#0b0b0f',
+ format: 'png',
+ });
+ if (error) {
+ throw Object.assign(new Error(`thumbnail params invalid: ${error.message}`), {
+ status: 400,
+ code: 'render_params',
+ });
+ }
+ let png;
+ try {
+ ({ png } = await renderAvatarScene({
+ glbUrl,
+ width: params.width,
+ height: params.height,
+ background: params.bg,
+ posePresetId: params.posePresetId,
+ cameraOrbit: { theta: params.scenePreset.theta, phi: params.scenePreset.phi, radius: null },
+ expression: null,
+ scenePreset: params.scenePreset,
+ }));
+ } catch (err) {
+ throw Object.assign(
+ new Error(`could not render a thumbnail for the asset: ${err?.message || 'render failed'}`),
+ { status: 502, code: 'thumbnail_failed' },
+ );
+ }
+ const imageKey = `${base}/thumb.png`;
+ await putObject({ key: imageKey, body: png, contentType: 'image/png' });
+ const imageUrl = publicUrl(imageKey);
+
+ // 3. Optional IPFS permanence copies (best-effort; R2 https is the primary).
+ let glbIpfs = null;
+ let imageIpfs = null;
+ if (ipfsPinningConfigured()) {
+ try {
+ const safeName = (name || 'asset').replace(/[^a-z0-9._-]/gi, '_').slice(0, 40);
+ const [g, i] = await Promise.all([
+ pinToIPFS(glbBuf, `${safeName}.glb`),
+ pinToIPFS(png, `${safeName}.png`),
+ ]);
+ glbIpfs = g?.uri || null;
+ imageIpfs = i?.uri || null;
+ } catch (err) {
+ // Permanence is a bonus; a pin failure must not fail the mint.
+ console.warn('[tokenize-3d] IPFS pin failed (continuing on R2):', err?.message);
+ }
+ }
+
+ return { glbUrl, imageUrl, glbIpfs, imageIpfs };
+}
+
+async function uploadMetadataJson({ idempotencyKey, metadata }) {
+ const key = `tokenized/${idempotencyKey}/metadata.json`;
+ await putObject({
+ key,
+ body: Buffer.from(JSON.stringify(metadata)),
+ contentType: 'application/json',
+ });
+ let ipfs = null;
+ if (ipfsPinningConfigured()) {
+ try {
+ ipfs = (await pinToIPFS(Buffer.from(JSON.stringify(metadata)), 'metadata.json'))?.uri || null;
+ } catch (err) {
+ console.warn('[tokenize-3d] metadata IPFS pin failed:', err?.message);
+ }
+ }
+ return { uri: publicUrl(key), ipfs };
+}
+
+// ── On-chain mint ────────────────────────────────────────────────────────────
+
+/**
+ * Mint the Core asset with an enforced Royalties plugin. The three.ws collection
+ * authority is the fee payer + update authority (authority-managed model: the
+ * holder owns/transfers the asset, three.ws can curate its on-chain metadata);
+ * the recipient wallet is the owner.
+ */
+async function mintCoreAsset({ network, ownerWallet, name, metadataUri, royaltyBps, royaltyRecipient }) {
+ const umi = createUmi(solanaConnection({ url: rpcForNetwork(network), network })).use(mplCore());
+ const authority = collectionAuthoritySigner(umi);
+ umi.use(signerIdentity(authority));
+
+ const assetSigner = generateSigner(umi);
+ const { signature } = await create(umi, {
+ asset: assetSigner,
+ owner: umiPublicKey(ownerWallet),
+ name: String(name).slice(0, 32) || '3D Asset',
+ uri: metadataUri,
+ plugins: [
+ {
+ type: 'Royalties',
+ basisPoints: royaltyBps,
+ creators: [{ address: umiPublicKey(royaltyRecipient), percentage: 100 }],
+ ruleSet: ruleSet('None'),
+ },
+ ],
+ }).sendAndConfirm(umi, { confirm: { commitment: 'confirmed' } });
+
+ return { mint: assetSigner.publicKey.toString(), signature: encodeSignature(signature) };
+}
+
+// ── Public API: mint ─────────────────────────────────────────────────────────
+
+/**
+ * Default dependency set — real DB + real chain/storage. Tests inject fakes to
+ * exercise the idempotency guard without touching Solana or R2.
+ */
+function defaultDeps() {
+ return {
+ sql,
+ resolveSource,
+ resolveOwnerWallet,
+ promoteToDurableStorage,
+ uploadMetadataJson,
+ mintCoreAsset,
+ now: () => new Date().toISOString(),
+ };
+}
+
+/**
+ * Mint a generated/owned GLB as a Metaplex Core 3D NFT.
+ *
+ * @param {object} input
+ * @param {string} [input.avatarId] owned avatar to tokenize
+ * @param {string} [input.glbUrl] or a GLB URL to tokenize
+ * @param {string} [input.ownerWallet] recipient (base58); defaults to OAuth wallet
+ * @param {string|null} [input.requesterId] OAuth userId
+ * @param {string} [input.name]
+ * @param {string} [input.description]
+ * @param {number} [input.sellerFeeBasisPoints] requested royalty (clamped to cap)
+ * @param {string} [input.royaltyRecipient] wallet royalty routes to (default: owner)
+ * @param {string} [input.network] 'devnet' (default) | 'mainnet'
+ * @param {string} [input.parentMint] lineage parent (remix source)
+ * @param {string} [input.prompt] provenance override
+ * @param {string} [input.generationModel]
+ * @param {string} [input.generationProvider]
+ * @param {string} [input.idempotencyKey] override the derived key
+ * @param {object} [deps] injected dependencies (testing)
+ * @returns {Promise<object>} mint result
+ */
+export async function mintTokenized3dAsset(input, deps = defaultDeps()) {
+ const network = resolveNetwork(input.network);
+ const src = await deps.resolveSource({
+ avatarId: input.avatarId,
+ glbUrl: input.glbUrl,
+ requesterId: input.requesterId ?? null,
+ name: input.name,
+ });
+ const ownerWallet = await deps.resolveOwnerWallet({
+ ownerWallet: input.ownerWallet,
+ requesterId: input.requesterId ?? null,
+ });
+ const royaltyRecipient =
+ input.royaltyRecipient && isValidBase58Pubkey(input.royaltyRecipient)
+ ? input.royaltyRecipient
+ : ownerWallet;
+ const { bps: royaltyBps, capped, requestedBps } = clampSellerFeeBps(input.sellerFeeBasisPoints);
+
+ const idempotencyKey =
+ input.idempotencyKey ||
+ deriveIdempotencyKey({
+ ownerWallet,
+ glbSource: src.sourceAvatarId ? `avatar:${src.sourceAvatarId}` : `url:${src.sourceUrl}`,
+ network,
+ creatorUserId: input.requesterId ?? null,
+ });
+
+ const provenance = {
+ prompt: input.prompt ?? src.provenance.prompt,
+ generationModel: input.generationModel ?? src.provenance.generationModel,
+ generationProvider: input.generationProvider ?? src.provenance.generationProvider,
+ parentMint: input.parentMint ?? null,
+ };
+
+ // ── Claim-first idempotency guard: insert a pending row; a conflict means a
+ // prior call already owns this key. ──
+ const [claimed] = await deps.sql`
+ insert into tokenized_3d_assets
+ (idempotency_key, network, status, owner_wallet, creator_user_id, source_avatar_id,
+ parent_mint, name, glb_url, viewer_url, royalty_bps, royalty_recipient, provenance)
+ values
+ (${idempotencyKey}, ${network}, 'pending', ${ownerWallet}, ${input.requesterId ?? null},
+ ${src.sourceAvatarId}, ${provenance.parentMint}, ${src.name}, ${src.sourceUrl},
+ ${viewerLinkFor(env.APP_ORIGIN, src.sourceUrl)}, ${royaltyBps}, ${royaltyRecipient},
+ ${JSON.stringify(provenance)}::jsonb)
+ on conflict (idempotency_key, network) do nothing
+ returning id, status
+ `;
+
+ let rowId = claimed?.id;
+ if (!claimed) {
+ const [existing] = await deps.sql`
+ select id, status, mint, network, name, glb_url, image_url, viewer_url,
+ metadata_uri, royalty_bps, royalty_recipient, tx_signature
+ from tokenized_3d_assets
+ where idempotency_key = ${idempotencyKey} and network = ${network}
+ `;
+ if (existing?.status === 'minted') {
+ // Idempotent hit — return the already-minted asset, do NOT mint again.
+ return formatMintResult(existing, { idempotent: true, capped, requestedBps, royaltyBps });
+ }
+ if (existing?.status === 'pending') {
+ return {
+ status: 'pending',
+ idempotent: true,
+ message: 'A mint for this asset is already in progress. Read it back once it confirms.',
+ id: existing.id,
+ network,
+ };
+ }
+ // status === 'failed' → reclaim for a retry (only one winner flips it back).
+ const [reclaimed] = await deps.sql`
+ update tokenized_3d_assets
+ set status = 'pending', mint_error = null, updated_at = now()
+ where idempotency_key = ${idempotencyKey} and network = ${network} and status = 'failed'
+ returning id
+ `;
+ if (!reclaimed) {
+ return {
+ status: 'pending',
+ idempotent: true,
+ message: 'A retry for this asset is already in progress.',
+ id: existing?.id,
+ network,
+ };
+ }
+ rowId = reclaimed.id;
+ }
+
+ try {
+ // 1. Durable media.
+ const media = await deps.promoteToDurableStorage({
+ idempotencyKey,
+ sourceUrl: src.sourceUrl,
+ name: src.name,
+ });
+ const viewerUrl = viewerLinkFor(env.APP_ORIGIN, media.glbUrl);
+ const createdAt = deps.now();
+
+ // 2. Metaplex metadata.
+ const metadata = buildTokenized3dMetadata({
+ name: src.name,
+ description: input.description || src.description,
+ glbUrl: media.glbUrl,
+ imageUrl: media.imageUrl,
+ viewerUrl,
+ glbIpfs: media.glbIpfs,
+ imageIpfs: media.imageIpfs,
+ creatorWallet: ownerWallet,
+ creatorUserId: input.requesterId ?? null,
+ prompt: provenance.prompt,
+ generationModel: provenance.generationModel,
+ generationProvider: provenance.generationProvider,
+ parentMint: provenance.parentMint,
+ royaltyBps,
+ royaltyRecipient,
+ network,
+ createdAt,
+ });
+ const { uri: metadataUri, ipfs: metadataIpfs } = await deps.uploadMetadataJson({
+ idempotencyKey,
+ metadata,
+ });
+
+ // 3. Mint.
+ const { mint, signature } = await deps.mintCoreAsset({
+ network,
+ ownerWallet,
+ name: src.name,
+ metadataUri,
+ royaltyBps,
+ royaltyRecipient,
+ });
+
+ // 4. Persist the launch record.
+ const [row] = await deps.sql`
+ update tokenized_3d_assets
+ set status = 'minted', mint = ${mint}, tx_signature = ${signature},
+ glb_url = ${media.glbUrl}, image_url = ${media.imageUrl}, viewer_url = ${viewerUrl},
+ metadata_uri = ${metadataUri},
+ provenance = ${JSON.stringify({ ...metadata.properties.provenance, metadata_ipfs: metadataIpfs })}::jsonb,
+ updated_at = now()
+ where id = ${rowId}
+ returning id, status, mint, network, name, glb_url, image_url, viewer_url,
+ metadata_uri, royalty_bps, royalty_recipient, tx_signature
+ `;
+
+ return formatMintResult(row, {
+ idempotent: false,
+ capped,
+ requestedBps,
+ royaltyBps,
+ metadataIpfs,
+ });
+ } catch (err) {
+ // Clean failure at the boundary: mark the row failed so the key can retry,
+ // then surface a sanitized error. Never leak a key/secret.
+ await deps
+ .sql`update tokenized_3d_assets set status='failed', mint_error=${String(err?.message || 'mint failed').slice(0, 500)}, updated_at=now() where id=${rowId}`
+ .catch(() => {});
+ throw err;
+ }
+}
+
+function formatMintResult(row, { idempotent, capped, requestedBps, royaltyBps, metadataIpfs = null }) {
+ return {
+ status: 'minted',
+ idempotent: Boolean(idempotent),
+ mint: row.mint,
+ network: row.network,
+ name: row.name,
+ owner: row.royalty_recipient, // recipient == owner unless royaltyRecipient overridden
+ glb_url: row.glb_url,
+ image_url: row.image_url,
+ viewer_url: row.viewer_url,
+ metadata_uri: row.metadata_uri,
+ metadata_ipfs: metadataIpfs,
+ royalty: {
+ basis_points: row.royalty_bps ?? royaltyBps,
+ percent: (row.royalty_bps ?? royaltyBps) / 100,
+ recipient: row.royalty_recipient,
+ cap_basis_points: TOKENIZE_3D_ROYALTY_CAP_BPS,
+ capped: Boolean(capped),
+ ...(capped ? { requested_basis_points: requestedBps } : {}),
+ },
+ tx_signature: row.tx_signature,
+ explorer_tx_url: row.tx_signature ? explorerTxUrl(row.tx_signature, row.network) : null,
+ explorer_asset_url: assetExplorerUrl(row.mint, row.network),
+ };
+}
+
+// ── Public API: read-back ────────────────────────────────────────────────────
+
+/**
+ * Resolve a mint to its live 3D asset + holder + provenance + royalty terms.
+ * Reads the on-chain Core asset, fetches its off-chain metadata, joins our
+ * launch record, and confirms it resolves to a live viewer.
+ *
+ * @param {object} p
+ * @param {string} p.mint
+ * @param {string} [p.network] 'devnet' (default) | 'mainnet'
+ * @returns {Promise<object>}
+ */
+export async function readTokenized3dAsset({ mint, network: preferredNetwork }) {
+ if (!isValidBase58Pubkey(mint)) {
+ throw Object.assign(new Error('mint is not a valid Solana address'), {
+ status: 400,
+ code: 'validation_error',
+ });
+ }
+
+ // Our launch record (if this was minted through three.ws) — the source of
+ // truth for provenance, and it tells us which network to read.
+ const [record] = await sql`
+ select mint, network, owner_wallet, name, glb_url, image_url, viewer_url,
+ metadata_uri, royalty_bps, royalty_recipient, provenance, tx_signature, created_at
+ from tokenized_3d_assets
+ where mint = ${mint} and status = 'minted'
+ limit 1
+ `;
+ const network = resolveNetwork(record?.network || preferredNetwork);
+
+ // On-chain read: holder + enforced royalty live here, authoritative over the DB.
+ const umi = createUmi(solanaConnection({ url: rpcForNetwork(network), network })).use(mplCore());
+ let asset;
+ try {
+ asset = await fetchAsset(umi, umiPublicKey(mint));
+ } catch (err) {
+ throw Object.assign(new Error(`asset not found on ${network}: ${err?.message || 'read failed'}`), {
+ status: 404,
+ code: 'asset_not_found',
+ });
+ }
+
+ const holder = asset.owner?.toString?.() || null;
+ const onchainRoyalty = asset.royalties
+ ? {
+ basis_points: asset.royalties.basisPoints,
+ percent: asset.royalties.basisPoints / 100,
+ creators: (asset.royalties.creators || []).map((c) => ({
+ address: c.address?.toString?.() || String(c.address),
+ percent: c.percentage,
+ })),
+ }
+ : null;
+
+ // Off-chain metadata (media + provenance). Prefer the on-chain URI so an
+ // asset not in our DB still resolves.
+ const metadataUri = asset.uri || record?.metadata_uri || null;
+ let metadata = null;
+ if (metadataUri) {
+ try {
+ const resp = await fetchSafePublicUrl(metadataUri, {}, { allowHttp: false });
+ if (resp.ok) metadata = await resp.json();
+ } catch (err) {
+ console.warn('[tokenize-3d] metadata fetch failed:', err?.message);
+ }
+ }
+
+ const glbUrl = metadata?.animation_url || record?.glb_url || null;
+ const viewerUrl =
+ metadata?.external_url ||
+ record?.viewer_url ||
+ (glbUrl ? viewerLinkFor(env.APP_ORIGIN, glbUrl) : null);
+
+ // Confirm the media resolves to a live viewer (HEAD the GLB).
+ let viewerLive = false;
+ if (glbUrl) {
+ try {
+ const head = await fetchSafePublicUrl(glbUrl, { method: 'HEAD' }, { allowHttp: false });
+ viewerLive = head.ok;
+ } catch {
+ viewerLive = false;
+ }
+ }
+
+ const provenance = metadata?.properties?.provenance || record?.provenance || null;
+
+ return {
+ mint,
+ network,
+ holder,
+ name: asset.name || metadata?.name || record?.name || null,
+ media: {
+ glb_url: glbUrl,
+ image_url: metadata?.image || record?.image_url || null,
+ viewer_url: viewerUrl,
+ viewer_live: viewerLive,
+ media_kind: '3d/gltf-binary',
+ },
+ provenance,
+ royalty: {
+ // The enforced on-chain terms are authoritative; fall back to the record.
+ basis_points: onchainRoyalty?.basis_points ?? record?.royalty_bps ?? null,
+ percent:
+ onchainRoyalty?.percent ??
+ (record?.royalty_bps != null ? record.royalty_bps / 100 : null),
+ recipient:
+ onchainRoyalty?.creators?.[0]?.address || record?.royalty_recipient || null,
+ cap_basis_points: TOKENIZE_3D_ROYALTY_CAP_BPS,
+ enforced_onchain: Boolean(onchainRoyalty),
+ creators: onchainRoyalty?.creators || null,
+ },
+ metadata_uri: metadataUri,
+ minted_through_threews: Boolean(record),
+ tx_signature: record?.tx_signature || null,
+ explorer_tx_url: record?.tx_signature ? explorerTxUrl(record.tx_signature, network) : null,
+ explorer_asset_url: assetExplorerUrl(mint, network),
+ };
+}
+
+/** The three.ws authority that pays rent + holds update authority for these mints. */
+export function tokenizeAuthorityAddress() {
+ return collectionAuthorityAddress();
+}
diff --git a/api/_mcp-studio/component.js b/api/_mcp-studio/component.js
index 8887ecb8e..35de63713 100644
--- a/api/_mcp-studio/component.js
+++ b/api/_mcp-studio/component.js
@@ -7,7 +7,11 @@
// the returned GLB with Google's <model-viewer> (loaded from jsdelivr, declared
// in the resource CSP). Every state is designed: loading, ready, empty, error.
//
-// Reads structuredContent shape: { glbUrl, viewerUrl, kind, prompt, rigged? }.
+// Reads structuredContent shape: { glbUrl, viewerUrl, kind, prompt, rigged?,
+// lineage?: [{ index, parentIndex, glbUrl, viewerUrl, label, instruction, active }],
+// activeIndex? }. When a lineage is present (a conversational refinement) the
+// widget shows a version strip: click any version to swap it in with a cross-fade
+// (a client-side revert view — every version's GLB is already in the lineage).
// No identifiers, no payment, no crypto — only what is needed to show the model.
const MODEL_VIEWER_CDN =
@@ -36,7 +40,10 @@ export const COMPONENT_HTML = `<!doctype html>
--poster-color: transparent;
--progress-bar-color: #6ea8fe;
background: transparent;
+ transition: opacity .28s ease;
}
+ model-viewer.fading { opacity: 0; }
+ @media (prefers-reduced-motion: reduce) { model-viewer { transition: none; } }
.overlay {
position: absolute; inset: 0;
display: flex; flex-direction: column; align-items: center; justify-content: center;
@@ -66,6 +73,26 @@ export const COMPONENT_HTML = `<!doctype html>
border: 1px solid rgba(110,168,254,0.28); border-radius: 999px;
padding: 3px 9px; text-transform: capitalize;
}
+ .versions {
+ display: flex; align-items: center; gap: 6px; overflow-x: auto;
+ padding: 8px 12px; border-top: 1px solid rgba(255,255,255,0.07);
+ background: rgba(10,11,14,0.5); scrollbar-width: thin;
+ }
+ .versions::-webkit-scrollbar { height: 6px; }
+ .versions::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 3px; }
+ .vlabel { font-size: 10.5px; font-weight: 600; color: #8b93a3; letter-spacing: .03em; text-transform: uppercase; flex: 0 0 auto; margin-right: 2px; }
+ button.vchip {
+ appearance: none; cursor: pointer; flex: 0 0 auto;
+ font-size: 11.5px; font-weight: 600; color: #cdd4e0;
+ background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
+ border-radius: 8px; padding: 5px 10px; max-width: 160px;
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
+ transition: background .15s, border-color .15s, color .15s, transform .05s;
+ }
+ button.vchip:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.24); color: #fff; }
+ button.vchip:active { transform: translateY(1px); }
+ button.vchip:focus-visible { outline: 2px solid #6ea8fe; outline-offset: 2px; }
+ button.vchip.active { color: #eaf1ff; background: rgba(110,168,254,0.16); border-color: rgba(110,168,254,0.5); }
.actions { display: flex; gap: 8px; }
a.btn, button.btn {
appearance: none; cursor: pointer; text-decoration: none;
@@ -104,6 +131,8 @@ export const COMPONENT_HTML = `<!doctype html>
</div>
</div>
+ <div id="versions" class="versions hidden" role="group" aria-label="Model versions"></div>
+
<div id="bar" class="bar hidden">
<span id="kind" class="chip">model</span>
<span id="prompt" class="prompt"></span>
@@ -126,36 +155,90 @@ export const COMPONENT_HTML = `<!doctype html>
var kindEl = document.getElementById('kind');
var openEl = document.getElementById('open');
var downloadEl = document.getElementById('download');
+ var versionsEl = document.getElementById('versions');
+
+ // Tracks whether the next model-viewer 'load' is a fresh render (show the
+ // stage, hide overlays) or a cross-fade swap between versions (just fade in).
+ var swapping = false;
function show(el) { [loading, empty, errEl].forEach(function (n) { n.classList.add('hidden'); }); if (el) el.classList.remove('hidden'); }
function fail(msg) {
mv.classList.add('hidden');
bar.classList.add('hidden');
+ versionsEl.classList.add('hidden');
errMsg.textContent = msg || 'Something went wrong displaying this model.';
show(errEl);
}
+ function isHttps(u) { return typeof u === 'string' && /^https:\\/\\//.test(u); }
+
+ // Swap the displayed GLB with a cross-fade (no hard pop). Used both for the
+ // initial refined result and for clicking an earlier version in the strip.
+ function swapTo(glb) {
+ if (!isHttps(glb) || mv.getAttribute('src') === glb) return;
+ swapping = true;
+ mv.classList.add('fading');
+ setTimeout(function () { mv.setAttribute('src', glb); }, 200);
+ }
+
+ // Build the version strip from a lineage. Each chip swaps its GLB in on click;
+ // the active one is highlighted. A single-entry lineage (origin only) is hidden.
+ function renderVersions(lineage, activeGlb) {
+ versionsEl.textContent = '';
+ if (!Array.isArray(lineage) || lineage.length < 2) { versionsEl.classList.add('hidden'); return; }
+ var label = document.createElement('span');
+ label.className = 'vlabel';
+ label.textContent = 'Versions';
+ versionsEl.appendChild(label);
+ lineage.forEach(function (v) {
+ if (!v || !isHttps(v.glbUrl)) return;
+ var chip = document.createElement('button');
+ chip.className = 'vchip' + (v.glbUrl === activeGlb ? ' active' : '');
+ chip.type = 'button';
+ var text = v.label || (v.index === 0 ? 'Original' : 'Version ' + v.index);
+ chip.textContent = text;
+ chip.title = v.instruction ? '“' + v.instruction + '”' : text;
+ chip.addEventListener('click', function () {
+ for (var i = 0; i < versionsEl.children.length; i++) versionsEl.children[i].classList.remove('active');
+ chip.classList.add('active');
+ openEl.href = v.viewerUrl || v.glbUrl;
+ downloadEl.href = v.glbUrl;
+ if (v.instruction) { promptEl.textContent = v.instruction; promptEl.title = v.instruction; }
+ swapTo(v.glbUrl);
+ });
+ versionsEl.appendChild(chip);
+ });
+ versionsEl.classList.remove('hidden');
+ }
+
function render(out) {
- if (!out) { mv.classList.add('hidden'); bar.classList.add('hidden'); show(empty); return; }
+ if (!out) { mv.classList.add('hidden'); bar.classList.add('hidden'); versionsEl.classList.add('hidden'); show(empty); return; }
if (out.error || out.message && !out.glbUrl) { fail(out.message || 'Generation did not return a model.'); return; }
var glb = out.glbUrl;
- if (!glb || typeof glb !== 'string' || !/^https:\\/\\//.test(glb)) { mv.classList.add('hidden'); bar.classList.add('hidden'); show(empty); return; }
+ if (!isHttps(glb)) { mv.classList.add('hidden'); bar.classList.add('hidden'); versionsEl.classList.add('hidden'); show(empty); return; }
+ swapping = false;
show(loading);
+ mv.classList.remove('fading');
mv.classList.add('hidden');
mv.setAttribute('src', glb);
var kind = (out.kind || 'model').replace(/_/g, ' ');
kindEl.textContent = out.rigged ? 'rigged ' + kind : kind;
- if (out.prompt) { promptEl.textContent = out.prompt; promptEl.title = out.prompt; }
+ var caption = out.instruction || out.prompt || '';
+ if (caption) { promptEl.textContent = caption; promptEl.title = caption; }
else { promptEl.textContent = ''; }
openEl.href = out.viewerUrl || glb;
downloadEl.href = glb;
bar.classList.remove('hidden');
+ renderVersions(out.lineage, glb);
}
- mv.addEventListener('load', function () { show(null); mv.classList.remove('hidden'); });
+ mv.addEventListener('load', function () {
+ if (swapping) { swapping = false; mv.classList.remove('fading'); return; }
+ show(null); mv.classList.remove('hidden');
+ });
mv.addEventListener('error', function () { fail('The 3D model could not be displayed. You can still download the GLB file.'); });
function current() {
diff --git a/api/_mcp-studio/persona-tools.js b/api/_mcp-studio/persona-tools.js
new file mode 100644
index 000000000..0b997415a
--- /dev/null
+++ b/api/_mcp-studio/persona-tools.js
@@ -0,0 +1,288 @@
+// three.ws 3D Studio (free) — embodiment / persona tools.
+//
+// The layer that turns a generated GLB into a LIVING agent body: a named,
+// persistent persona the assistant reuses turn after turn and session after
+// session. Three tools:
+//
+// create_agent_persona(glb_url, name) — save a rigged GLB as a named body and
+// get back a stable persona_id + an inline living-body artifact (idles).
+// get_agent_persona(persona_id) — bring the SAME body back in a fresh
+// session (continuity by id — no sign-in).
+// persona_say(persona_id, text) — perform a reply: the body lip-syncs
+// the text and shows the matching expression + gesture for this turn.
+//
+// All FREE and unauthenticated — same posture as the generation tools. The body
+// renders inline via the hosted embodiment embed (shared embodimentArtifact), so
+// the SAME living body appears in ChatGPT/Claude and on the site. There is NO
+// token, wallet, coin, or payment surface anywhere here — a persona is a name and
+// a 3D body. (The free-studio catalog test asserts that invariant.)
+
+import { limits, clientIp } from '../_lib/rate-limit.js';
+import { assertSafePublicUrl } from '../_lib/ssrf-guard.js';
+import { isValidGlbHeader, inspectGlb } from '../_lib/glb-inspect.js';
+import {
+ createPersona,
+ getPersona,
+ touchPersona,
+ personaPublicView,
+ isPersonaId,
+} from '../_lib/persona-store.js';
+import { expressionForText, expressionFor } from '../../src/embodiment/emotion.js';
+import { embodimentArtifact } from '../_lib/embodiment-artifact.js';
+
+const MAX_GLB_BYTES = 64 * 1024 * 1024;
+
+function toolError(message) {
+ return {
+ content: [{ type: 'text', text: message }],
+ structuredContent: { error: true, message },
+ isError: true,
+ };
+}
+
+async function isPublicHttpsUrl(s) {
+ try {
+ await assertSafePublicUrl(String(s), { allowHttp: false });
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+// Fetch a GLB into a Buffer with a hard size cap so a persona's body can be copied
+// into durable storage before the provider URL expires. Returns null on any
+// failure (caller surfaces a clean message).
+async function fetchGlbBuffer(url) {
+ try {
+ const resp = await fetch(url);
+ if (!resp.ok) return null;
+ const declared = Number(resp.headers.get('content-length') || 0);
+ if (declared && declared > MAX_GLB_BYTES) return null;
+ const buf = Buffer.from(await resp.arrayBuffer());
+ if (buf.length > MAX_GLB_BYTES) return null;
+ return buf;
+ } catch {
+ return null;
+ }
+}
+
+// Cheap per-IP burst cap on the two write tools; reads ride the transport cap.
+async function guardWrite(req) {
+ const rl = await limits.studioPersonaWrite(clientIp(req));
+ return rl.success;
+}
+
+// ── handlers ──────────────────────────────────────────────────────────────────
+
+async function handleCreatePersona(args, _auth, req) {
+ if (!(await guardWrite(req))) return toolError('Too many requests — slow down and try again shortly.');
+ const glbUrl = String(args.glb_url || '').trim();
+ const name = String(args.name || '').trim();
+ if (!name) return toolError('Provide a display name for the agent (1–80 characters).');
+ if (!(await isPublicHttpsUrl(glbUrl))) return toolError('Provide a public https URL to a rigged GLB (e.g. one you generated with forge_avatar).');
+
+ const buf = await fetchGlbBuffer(glbUrl);
+ if (!buf || !isValidGlbHeader(buf)) {
+ return toolError('That URL did not return a valid GLB (binary glTF). Pass a .glb model URL.');
+ }
+ const info = inspectGlb(buf) || {};
+
+ let record;
+ try {
+ record = await createPersona({
+ name,
+ glbUrl,
+ glbBuffer: buf,
+ voice: args.voice ? String(args.voice).slice(0, 64) : null,
+ sourcePrompt: args.source_prompt ? String(args.source_prompt).slice(0, 1000) : null,
+ look: {
+ rigged: info.isRigged ?? null,
+ mesh_count: info.meshCount ?? null,
+ animation_count: info.animationCount ?? null,
+ },
+ });
+ } catch {
+ return toolError('Could not save this persona right now. Please try again.');
+ }
+ const persona = personaPublicView(record);
+
+ return {
+ content: [
+ {
+ type: 'text',
+ text:
+ `Saved "${persona.name}" as a living persona.\n` +
+ `Persona ID: ${persona.persona_id}\n` +
+ (persona.look?.rigged
+ ? 'Rig: humanoid — full body animation + lip-sync.\n'
+ : 'Rig: static/non-humanoid — falls back to a gentle idle gracefully.\n') +
+ 'Show the attached view to see the body. Call persona_say with this persona_id to make it ' +
+ 'speak a reply, or get_agent_persona to bring it back in a future session.',
+ },
+ embodimentArtifact({ persona, state: 'idle' }),
+ ],
+ structuredContent: { ...persona, status: 'created' },
+ };
+}
+
+async function handleGetPersona(args) {
+ const id = String(args.persona_id || '').trim();
+ if (!isPersonaId(id)) return toolError('That is not a valid persona id.');
+ const record = await getPersona(id);
+ if (!record) return toolError('No persona found for that id. Create one with create_agent_persona.');
+ const persona = personaPublicView(record);
+ return {
+ content: [
+ {
+ type: 'text',
+ text:
+ `Welcome back, ${persona.name}.\n` +
+ `Persona ID: ${persona.persona_id}\n` +
+ `Turns spoken so far: ${persona.turn_count}.\n` +
+ 'Show the attached view to see the body; call persona_say to make it speak.',
+ },
+ embodimentArtifact({ persona, state: 'idle' }),
+ ],
+ structuredContent: { ...persona, status: 'loaded' },
+ };
+}
+
+async function handlePersonaSay(args, _auth, req) {
+ if (!(await guardWrite(req))) return toolError('Too many requests — slow down and try again shortly.');
+ const id = String(args.persona_id || '').trim();
+ const text = String(args.text || '').trim();
+ if (!isPersonaId(id)) return toolError('That is not a valid persona id.');
+ if (!text) return toolError('Provide the reply text the agent is saying this turn.');
+
+ const record = await getPersona(id);
+ if (!record) return toolError('No persona found for that id. Create one with create_agent_persona.');
+
+ const expr = args.emotion
+ ? { ...expressionFor(args.emotion, 0.85) }
+ : expressionForText(text);
+ const updated = await touchPersona(id).catch(() => null);
+ const persona = personaPublicView(updated || record);
+
+ return {
+ content: [
+ {
+ type: 'text',
+ text:
+ `${persona.name} says it with a ${expr.emotion} expression` +
+ (expr.gesture ? ` and a ${expr.gesture} gesture` : '') +
+ '. Show the attached view — the body lip-syncs the reply and emotes.',
+ },
+ embodimentArtifact({
+ persona,
+ state: 'speaking',
+ text,
+ emotion: expr.emotion,
+ intensity: expr.intensity,
+ gesture: expr.gesture,
+ }),
+ ],
+ structuredContent: {
+ persona_id: persona.persona_id,
+ name: persona.name,
+ glb_url: persona.glb_url,
+ text,
+ emotion: expr.emotion,
+ intensity: expr.intensity,
+ gesture: expr.gesture,
+ turn_count: persona.turn_count,
+ status: 'spoken',
+ },
+ };
+}
+
+// ── annotations ───────────────────────────────────────────────────────────────
+// create saves a new body (write, non-destructive). get is a pure read. say is a
+// render directive that also bumps the persona's turn counter (a write).
+const CREATE_ANNOTATIONS = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true };
+const READ_ANNOTATIONS = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
+const SAY_ANNOTATIONS = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
+
+// The persona tools return their living-body artifact as an inline text/html
+// resource (embodimentArtifact carries its own openai/outputTemplate), so the
+// tool-level _meta only advertises the invocation labels + widget accessibility.
+function personaMeta(invoking, invoked) {
+ return {
+ 'openai/toolInvocation/invoking': invoking,
+ 'openai/toolInvocation/invoked': invoked,
+ 'openai/widgetAccessible': true,
+ };
+}
+
+const DEFS = [
+ {
+ name: 'create_agent_persona',
+ title: 'Save a rigged model as a living, persistent agent body',
+ description:
+ 'Turn a generated GLB into a NAMED, persistent agent body — a "persona" the assistant reuses across ' +
+ 'turns and across sessions. The model is copied into durable storage so the body survives the source ' +
+ 'URL expiring, then registered under a stable persona_id. The returned view renders the LIVING body ' +
+ 'inline: it idles between turns, and persona_say makes it lip-sync and emote a reply. The persona_id is ' +
+ 'the handle — keep it and pass it to get_agent_persona or persona_say later to bring the exact same body ' +
+ 'back. No sign-in required.',
+ inputSchema: {
+ type: 'object',
+ additionalProperties: false,
+ required: ['glb_url', 'name'],
+ properties: {
+ glb_url: { type: 'string', format: 'uri', description: 'Public https URL of the rigged GLB to embody (e.g. from forge_avatar).' },
+ name: { type: 'string', minLength: 1, maxLength: 80, description: 'A display name for the persona, 1–80 characters.' },
+ voice: { type: 'string', maxLength: 64, description: 'Optional voice name to speak with (used for audio-driven lip-sync when available).' },
+ source_prompt: { type: 'string', maxLength: 1000, description: 'Optional: the prompt that generated this body, kept as provenance.' },
+ },
+ },
+ annotations: CREATE_ANNOTATIONS,
+ _meta: personaMeta('Saving your agent…', 'Your agent is ready'),
+ handler: handleCreatePersona,
+ },
+ {
+ name: 'get_agent_persona',
+ title: 'Reload a persona by id (continuity across sessions)',
+ description:
+ 'Bring back a previously saved persona by its persona_id — the SAME body and identity, in a fresh ' +
+ 'session. Returns the persona name, its model, the accumulated turn count, and the inline living-body ' +
+ 'view. Use this at the start of a conversation when the user returns to a named agent.',
+ inputSchema: {
+ type: 'object',
+ additionalProperties: false,
+ required: ['persona_id'],
+ properties: {
+ persona_id: { type: 'string', minLength: 8, maxLength: 64, description: 'The persona_id returned by create_agent_persona.' },
+ },
+ },
+ annotations: READ_ANNOTATIONS,
+ _meta: personaMeta('Bringing your agent back…', 'Your agent is back'),
+ handler: handleGetPersona,
+ },
+ {
+ name: 'persona_say',
+ title: 'Speak a reply through a persona — lip-sync + emotion + gesture',
+ description:
+ 'Make a persona PERFORM a reply: the body lip-syncs the text and shows the matching facial expression ' +
+ 'and body gesture. Pass the persona_id and the exact text the agent is saying this turn; the emotion is ' +
+ 'detected from the text automatically (or set it explicitly). The returned view animates the body for ' +
+ 'this turn — show it alongside the reply. This is the turn-by-turn embodiment hook.',
+ inputSchema: {
+ type: 'object',
+ additionalProperties: false,
+ required: ['persona_id', 'text'],
+ properties: {
+ persona_id: { type: 'string', minLength: 8, maxLength: 64, description: 'The persona to speak through.' },
+ text: { type: 'string', minLength: 1, maxLength: 2000, description: 'The reply text the agent is saying this turn — drives lip-sync and emotion.' },
+ emotion: { type: 'string', enum: ['neutral', 'joy', 'sad', 'angry', 'surprised', 'thinking'], description: 'Optional explicit emotion override; omit to auto-detect from the text.' },
+ },
+ },
+ annotations: SAY_ANNOTATIONS,
+ _meta: personaMeta('Performing the reply…', 'Here is your agent'),
+ handler: handlePersonaSay,
+ },
+];
+
+// Schemas for tools/list — strip the handler.
+export const PERSONA_TOOL_CATALOG = DEFS.map(({ handler: _h, ...schema }) => schema);
+export const PERSONA_DEFS = DEFS;
+export const PERSONA_TOOL_NAMES = DEFS.map((d) => d.name);
diff --git a/api/_mcp-studio/tools.js b/api/_mcp-studio/tools.js
index 81e4eeda4..6981afe1d 100644
--- a/api/_mcp-studio/tools.js
+++ b/api/_mcp-studio/tools.js
@@ -22,6 +22,16 @@ import {
directPrompt,
} from './forge-client.js';
import { COMPONENT_URI } from './component.js';
+// Pure, dependency-free lineage core — the SAME module the paid stdio server's
+// runRefineModel uses (mcp-server/src/tools/_lineage.js), so conversational
+// iteration behaves identically on both tracks and never drifts. It carries
+// zero payment/coin/wallet surface — safe to import into the free studio bundle.
+import {
+ composeRefinement,
+ seedLineage,
+ appendVersion,
+ summarizeLineage,
+} from '../../mcp-server/src/tools/_lineage.js';
const VALID_TIER = new Set(['draft', 'standard', 'high']);
@@ -58,6 +68,34 @@ function toolError(message) {
};
}
+// Success envelope for a conversational refinement. Carries the same minimal,
+// identifier-free fields as ok() PLUS the version lineage the widget renders as
+// a version strip. The lineage is the durable record the client passes back on
+// the next refinement (parent_lineage) so branch/revert work without any
+// server-side session — a pointer move over an immutable array, never a mutation.
+function refineOk({ glbUrl, base, prompt, instruction, lineage, activeIndex }) {
+ const structured = {
+ kind: 'refined model',
+ glbUrl,
+ viewerUrl: viewerUrl(base, glbUrl),
+ format: 'glb',
+ ...(prompt ? { prompt } : {}),
+ ...(instruction ? { instruction } : {}),
+ lineage: summarizeLineage(lineage, activeIndex),
+ activeIndex,
+ };
+ const versionNo = activeIndex; // 0 = original, 1 = first refinement, …
+ return {
+ content: [
+ {
+ type: 'text',
+ text: `Refined the model (v${versionNo}: "${instruction}"). View it: ${structured.viewerUrl}\nDownload: ${glbUrl}`,
+ },
+ ],
+ structuredContent: structured,
+ };
+}
+
// Map a coded forge-client failure to a clean, user-facing message — never leak
// provider internals, hostnames, or stack text.
function failureMessage(err) {
@@ -274,6 +312,83 @@ async function handleForgeAvatar(args, _auth, req) {
return ok({ glbUrl: rigged.glb_url, base, kind: 'avatar', prompt: prompt || undefined, rigged: true });
}
+// Conversational refinement — carry a prior model forward with a natural-language
+// change ("make it metallic", "bigger helmet"). REAL anchored re-generation: the
+// parent prompt is folded into the new prompt so form/subject/materials carry
+// forward, and when a reference image of the parent is supplied it anchors the
+// generation as image→3D. No faked diffing — the composed prompt is what the
+// generator actually runs. Every version is recorded in an immutable lineage the
+// client passes back to branch/revert. Free, stateless, zero payment surface.
+async function handleRefineModel(args, _auth, req) {
+ const base = originFromReq(req);
+ const glbUrl = String(args.glb_url || '').trim();
+ if (!/^https?:\/\//i.test(glbUrl)) return toolError('Provide the http(s) glb_url of the model to refine.');
+ const instruction = String(args.instruction || '').trim();
+ if (!instruction) return toolError('Provide an instruction describing the change, e.g. "make it metallic".');
+ const safety = checkPromptSafety(instruction);
+ if (!safety.allowed) return toolError(safety.message);
+
+ const parentPrompt = typeof args.parent_prompt === 'string' ? args.parent_prompt.trim() : '';
+ if (parentPrompt) {
+ const ps = checkPromptSafety(parentPrompt);
+ if (!ps.allowed) return toolError(ps.message);
+ }
+ const refImageUrl = args.reference_image_url ? String(args.reference_image_url).trim() : '';
+ try {
+ await guardImage(glbUrl);
+ if (refImageUrl) await guardImage(refImageUrl);
+ } catch (err) {
+ return toolError(err.userMessage ? err.message : 'That URL could not be used.');
+ }
+
+ const composed = composeRefinement(parentPrompt, instruction);
+
+ // Resolve the starting lineage: extend the one the client passed, or seed a
+ // fresh lineage rooted at the parent model. summarizeLineage() emits compact
+ // records; re-hydrate them into full version records for appendVersion.
+ const clientLineage = Array.isArray(args.parent_lineage) ? args.parent_lineage : null;
+ const baseLineage =
+ clientLineage && clientLineage.length > 0
+ ? clientLineage.map((v, i) => ({
+ index: Number.isInteger(v.index) ? v.index : i,
+ parentIndex: v.parentIndex ?? (i > 0 ? i - 1 : null),
+ glbUrl: v.glbUrl,
+ viewerUrl: v.viewerUrl || null,
+ prompt: v.prompt || null,
+ instruction: v.instruction || null,
+ refKind: v.refKind || (i === 0 ? 'origin' : 'text'),
+ }))
+ : seedLineage({ glbUrl, viewerUrl: viewerUrl(base, glbUrl), prompt: parentPrompt || null });
+
+ // Branch point: refine off an earlier version instead of the leaf.
+ const parentIndex =
+ Number.isInteger(args.parent_index) && args.parent_index >= 0 && args.parent_index < baseLineage.length
+ ? args.parent_index
+ : undefined;
+
+ let job;
+ try {
+ job = await generate(
+ base,
+ refImageUrl ? { prompt: composed, imageUrls: [refImageUrl], aspect: '1:1' } : { prompt: composed },
+ { timeoutEnv: 'STUDIO_REFINE_TIMEOUT_MS' },
+ );
+ } catch (err) {
+ return toolError(failureMessage(err));
+ }
+ if (job._timedOut || !job.glb_url) return toolError('Refinement is taking longer than expected. Please try again.');
+
+ const lineage = appendVersion(baseLineage, {
+ glbUrl: job.glb_url,
+ viewerUrl: viewerUrl(base, job.glb_url),
+ prompt: composed,
+ instruction,
+ refKind: refImageUrl ? 'image' : 'text',
+ ...(parentIndex !== undefined ? { parentIndex } : {}),
+ });
+ return refineOk({ glbUrl: job.glb_url, base, prompt: composed, instruction, lineage, activeIndex: lineage.length - 1 });
+}
+
// ── definitions ─────────────────────────────────────────────────────────────
const GEN_ANNOTATIONS = {
@@ -399,6 +514,54 @@ const DEFS = [
_meta: widgetMeta('Generating your rigged avatar…', 'Here is your rigged avatar'),
handler: handleForgeAvatar,
},
+ {
+ name: 'refine_model',
+ title: 'Refine a 3D model by describing a change',
+ description:
+ 'Iterate on a model you already generated — just describe the change in words ("make it metallic", ' +
+ '"bigger helmet", "add wings"). The studio re-generates a new version anchored to the previous one, ' +
+ 'carrying its form and materials forward. Pass the previous model\'s glb_url and, when you have it, the ' +
+ 'prompt that made it (parent_prompt) so the change builds on it. Each refinement is recorded as a new ' +
+ 'version in a lineage you can revert to or branch from — the returned lineage drives a version strip in ' +
+ 'the viewer. Renders the new version inline in the interactive 3D viewer.',
+ inputSchema: {
+ type: 'object',
+ additionalProperties: false,
+ required: ['glb_url', 'instruction'],
+ properties: {
+ glb_url: { type: 'string', format: 'uri', description: 'http(s) URL of the model to refine (e.g. the glbUrl a previous generation returned).' },
+ instruction: {
+ type: 'string',
+ minLength: 1,
+ maxLength: 500,
+ description: 'The change to make, in plain language: "make it metallic", "bigger helmet", "add a cape".',
+ },
+ parent_prompt: {
+ type: 'string',
+ maxLength: 1000,
+ description: 'Optional — the prompt that produced the model being refined, so the change builds on it instead of starting over.',
+ },
+ reference_image_url: {
+ type: 'string',
+ format: 'uri',
+ description: 'Optional http(s) image of the current model to anchor the re-generation (image→3D). Omit for text-guided refinement.',
+ },
+ parent_lineage: {
+ type: 'array',
+ description: 'Optional — the lineage array from a previous refine_model result, to extend the same version history.',
+ items: { type: 'object', additionalProperties: true },
+ },
+ parent_index: {
+ type: 'integer',
+ minimum: 0,
+ description: 'Optional — branch off an earlier version in parent_lineage (its index) instead of the latest.',
+ },
+ },
+ },
+ annotations: GEN_ANNOTATIONS,
+ _meta: widgetMeta('Refining your 3D model…', 'Here is the refined model'),
+ handler: handleRefineModel,
+ },
];
// Schemas for tools/list — strip the handler (and any server-only field).
diff --git a/api/_mcp/catalog.js b/api/_mcp/catalog.js
index fe5c81687..9d6ce5095 100644
--- a/api/_mcp/catalog.js
+++ b/api/_mcp/catalog.js
@@ -13,6 +13,7 @@ import { toolDefs as memoryDefs } from './tools/memory.js';
import { toolDefs as embedDefs } from './tools/embed.js';
import { toolDefs as oracleDefs } from './tools/oracle.js';
import { toolDefs as traderDefs } from './tools/trader.js';
+import { toolDefs as tokenizeDefs } from './tools/tokenize.js';
const baseDefs = [
...avatarDefs,
@@ -25,6 +26,7 @@ const baseDefs = [
...memoryDefs,
...oracleDefs,
...traderDefs,
+ ...tokenizeDefs,
];
// Free, public entry point — listed first so discovery clients see it up top.
diff --git a/api/_mcp/tools/tokenize.js b/api/_mcp/tools/tokenize.js
new file mode 100644
index 000000000..eae82f5e6
--- /dev/null
+++ b/api/_mcp/tools/tokenize.js
@@ -0,0 +1,167 @@
+import { mintTokenized3dAsset, readTokenized3dAsset, TOKENIZE_3D_ROYALTY_CAP_BPS } from '../../_lib/tokenize-3d.js';
+
+// A handled boundary error carries a status + code; surface it as a clean MCP
+// tool error (isError) rather than letting an unexpected 500 bubble.
+function isHandled(err) {
+ return err && typeof err.code === 'string' && Number.isInteger(err.status);
+}
+
+function toolError(message) {
+ return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true };
+}
+
+export const toolDefs = [
+ {
+ name: 'mint_3d_asset',
+ title: 'Mint a 3D asset as a Solana NFT',
+ // Creates an on-chain Core NFT. Not destructive (it mints, never deletes),
+ // and idempotent: the claim-first guard means repeating a call with the
+ // same arguments returns the same mint instead of minting twice. Open-world
+ // (writes to the Solana network). destructiveHint is explicit (spec defaults
+ // it to true when omitted).
+ annotations: {
+ readOnlyHint: false,
+ destructiveHint: false,
+ idempotentHint: true,
+ openWorldHint: true,
+ },
+ description:
+ 'Mint a generated or owned GLB as a Metaplex Core NFT on Solana whose media is a ' +
+ 'LIVE, interactive 3D viewer (the rigged glTF model under animation_url — not a static ' +
+ 'image). Bakes provenance (creator, prompt, generation model, parent lineage, timestamp) ' +
+ 'into the metadata and enforces capped creator royalties on secondary sales. Supply an ' +
+ 'owned avatar_id or a glb_url, and a recipient (owner_wallet, or your OAuth-linked Solana ' +
+ 'wallet). Devnet by default; pass network="mainnet" for a real mainnet mint. Idempotent — ' +
+ `a repeat call for the same asset returns the same mint. Royalty is capped at ` +
+ `${TOKENIZE_3D_ROYALTY_CAP_BPS / 100}%. Returns the mint address, explorer + viewer links, ` +
+ 'and royalty terms. Priced per call via x402 (USDC); an OAuth bearer token bypasses payment.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ avatar_id: {
+ type: 'string',
+ format: 'uuid',
+ description: 'An owned avatar to tokenize (its GLB becomes the NFT media).',
+ },
+ glb_url: {
+ type: 'string',
+ format: 'uri',
+ description: 'Or a GLB URL to tokenize (absolute http(s)).',
+ },
+ owner_wallet: {
+ type: 'string',
+ description:
+ 'Recipient Solana wallet (base58). Defaults to your OAuth-linked wallet when omitted.',
+ },
+ name: { type: 'string', maxLength: 200, description: 'Display name for the NFT.' },
+ description: { type: 'string', maxLength: 2000 },
+ network: {
+ type: 'string',
+ enum: ['devnet', 'mainnet'],
+ default: 'devnet',
+ description: 'Cluster to mint on. Devnet by default; mainnet is a real mint.',
+ },
+ seller_fee_basis_points: {
+ type: 'integer',
+ minimum: 0,
+ maximum: TOKENIZE_3D_ROYALTY_CAP_BPS,
+ description: `Enforced secondary-sale royalty in basis points. Clamped to the ${TOKENIZE_3D_ROYALTY_CAP_BPS / 100}% hard cap.`,
+ },
+ royalty_recipient: {
+ type: 'string',
+ description: 'Wallet the royalty routes to (base58). Defaults to the owner.',
+ },
+ parent_mint: {
+ type: 'string',
+ description: 'Lineage: the asset this was remixed from (baked into provenance).',
+ },
+ prompt: { type: 'string', maxLength: 1000, description: 'Generation prompt (provenance).' },
+ generation_model: { type: 'string', maxLength: 96 },
+ generation_provider: { type: 'string', maxLength: 64 },
+ idempotency_key: {
+ type: 'string',
+ maxLength: 128,
+ description: 'Override the derived idempotency key to force-dedupe a specific request.',
+ },
+ },
+ additionalProperties: false,
+ },
+ async handler(args, auth) {
+ try {
+ const result = await mintTokenized3dAsset({
+ avatarId: args.avatar_id,
+ glbUrl: args.glb_url,
+ ownerWallet: args.owner_wallet,
+ requesterId: auth?.userId ?? null,
+ name: args.name,
+ description: args.description,
+ network: args.network || 'devnet',
+ sellerFeeBasisPoints: args.seller_fee_basis_points,
+ royaltyRecipient: args.royalty_recipient,
+ parentMint: args.parent_mint,
+ prompt: args.prompt,
+ generationModel: args.generation_model,
+ generationProvider: args.generation_provider,
+ idempotencyKey: args.idempotency_key,
+ });
+ const text =
+ result.status === 'minted'
+ ? `${result.idempotent ? 'Already minted' : 'Minted'} "${result.name}" on ${result.network}.\n` +
+ `Mint: ${result.mint}\n` +
+ `Explorer: ${result.explorer_asset_url}\n` +
+ (result.explorer_tx_url ? `Tx: ${result.explorer_tx_url}\n` : '') +
+ `Viewer: ${result.viewer_url}\n` +
+ `Royalty: ${result.royalty.percent}% (cap ${result.royalty.cap_basis_points / 100}%)` +
+ (result.royalty.capped ? ` — requested ${result.royalty.requested_basis_points / 100}%, clamped` : '')
+ : `Mint in progress for this asset — read it back with get_3d_asset_onchain once it confirms.`;
+ return { content: [{ type: 'text', text }], structuredContent: result };
+ } catch (err) {
+ if (isHandled(err)) return toolError(err.message);
+ throw err;
+ }
+ },
+ },
+ {
+ name: 'get_3d_asset_onchain',
+ title: 'Resolve a 3D NFT to its live asset + provenance',
+ // A read over live on-chain state — the holder can change between calls, so
+ // not idempotent. Open-world (reads the Solana network).
+ annotations: {
+ readOnlyHint: true,
+ destructiveHint: false,
+ idempotentHint: false,
+ openWorldHint: true,
+ },
+ description:
+ 'Resolve a Solana mint address to its live 3D asset: current holder, the interactive ' +
+ 'viewer link + GLB (confirmed live), baked provenance (creator, prompt, model, lineage, ' +
+ 'timestamp), and the enforced on-chain royalty terms. Works on any Metaplex Core mint — ' +
+ 'assets minted through three.ws also return their platform launch record. Read-only, public.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ mint: { type: 'string', description: 'The Metaplex Core asset (mint) pubkey, base58.' },
+ network: {
+ type: 'string',
+ enum: ['devnet', 'mainnet'],
+ default: 'devnet',
+ description: 'Cluster to read (ignored if the mint is in our launch records).',
+ },
+ },
+ required: ['mint'],
+ additionalProperties: false,
+ },
+ async handler(args) {
+ try {
+ const data = await readTokenized3dAsset({ mint: args.mint, network: args.network || 'devnet' });
+ return {
+ content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
+ structuredContent: data,
+ };
+ } catch (err) {
+ if (isHandled(err)) return toolError(err.message);
+ throw err;
+ }
+ },
+ },
+];
diff --git a/api/_mcp3d/tools/studio.js b/api/_mcp3d/tools/studio.js
index c8c4c7e98..f4ba0ed6d 100644
--- a/api/_mcp3d/tools/studio.js
+++ b/api/_mcp3d/tools/studio.js
@@ -49,6 +49,7 @@ import {
isPersonaId,
} from '../../_lib/persona-store.js';
import { expressionForText, expressionFor } from '../../../src/embodiment/emotion.js';
+import { embodimentArtifact } from '../../_lib/embodiment-artifact.js';
import { PRESETS, PRESET_GROUPS } from '../../../src/pose-presets.js';
import {
renderModelViewerHtml,
@@ -202,56 +203,9 @@ function pointCloudArtifact({ plyUrl, name }) {
};
}
-// The Apps SDK template URL the embodiment component is served from. A persona
-// tool result references this so a host (ChatGPT/Claude) renders the LIVING body
-// inline — the same hosted page the local demo harness drives.
-const EMBODIMENT_EMBED = `${env.APP_ORIGIN}/embodiment/embed`;
-
-function buildEmbedUrl({ persona, state, text, emotion, intensity, gesture }) {
- const u = new URL(EMBODIMENT_EMBED);
- u.searchParams.set('persona', persona.persona_id);
- u.searchParams.set('glb', persona.glb_url);
- if (persona.name) u.searchParams.set('name', persona.name);
- if (state) u.searchParams.set('state', state);
- if (text) u.searchParams.set('text', text.slice(0, 600));
- if (emotion) u.searchParams.set('emotion', emotion);
- if (intensity != null) u.searchParams.set('intensity', String(intensity));
- if (gesture) u.searchParams.set('gesture', gesture);
- return u.toString();
-}
-
-// Render the embodied persona as an inline, sandboxed artifact: a self-contained
-// HTML document that mounts the hosted embodiment component (the live, rigged body
-// that lip-syncs + emotes) and passes the turn's speak/emotion payload. Mirrors the
-// viewerArtifact contract; adds the `_meta` openai/outputTemplate key so Apps SDK
-// hosts that prefer a registered template can use the same embed URL.
-function embodimentArtifact({ persona, state = 'idle', text = '', emotion = 'neutral', intensity = 0, gesture = null }) {
- const embedUrl = buildEmbedUrl({ persona, state, text, emotion, intensity, gesture });
- const safe = (s) => String(s).replace(/[&<>"]/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' })[c]);
- const html =
- `<!doctype html><html lang="en"><head><meta charset="utf-8">` +
- `<meta name="viewport" content="width=device-width,initial-scale=1">` +
- `<title>${safe(persona.name || 'Agent')} — live</title>` +
- `<style>html,body{margin:0;height:100%;background:transparent}` +
- `.wrap{position:relative;width:100%;height:480px;border-radius:16px;overflow:hidden;` +
- `background:radial-gradient(120% 120% at 50% 0%,#1a1a24 0%,#0c0c12 70%)}` +
- `iframe{width:100%;height:100%;border:0;display:block}` +
- `.fb{position:absolute;inset:auto 0 0 0;padding:8px 12px;font:600 12px system-ui;color:#cbd5e1;text-align:center}` +
- `.fb a{color:#a78bfa}</style></head><body>` +
- `<div class="wrap"><iframe title="${safe(persona.name || 'Agent')} live avatar" ` +
- `src="${safe(embedUrl)}" allow="autoplay" sandbox="allow-scripts allow-same-origin allow-popups"></iframe>` +
- `<noscript class="fb">Open <a href="${safe(embedUrl)}">${safe(persona.name || 'this agent')}</a> in a browser.</noscript>` +
- `</div></body></html>`;
- return {
- type: 'resource',
- resource: {
- uri: embedUrl,
- mimeType: 'text/html',
- text: html,
- _meta: { 'openai/outputTemplate': embedUrl },
- },
- };
-}
+// The inline "living body" artifact (buildEmbedUrl + embodimentArtifact) is shared
+// with the free studio in api/_lib/embodiment-artifact.js so both front doors drive
+// the SAME hosted embed page.
// Annotations for the persona lifecycle tools. create mints a new body (write,
// non-destructive). get is a pure read. say is a render directive that also bumps
diff --git a/api/_okx3d/identity.js b/api/_okx3d/identity.js
index 485906b33..d507a6fd8 100644
--- a/api/_okx3d/identity.js
+++ b/api/_okx3d/identity.js
@@ -26,6 +26,7 @@ import { createHash } from 'node:crypto';
import { putObject, getObjectBuffer, publicUrl } from '../_lib/r2.js';
import { encodeJobToken, decodeJobToken } from '../_lib/forge-job-token.js';
import { assertSafePublicUrl } from '../_lib/ssrf-guard.js';
+import { llmComplete } from '../_lib/llm.js';
import { PRESETS } from '../../src/pose-presets.js';
const BASE = 'https://three.ws';
@@ -106,56 +107,30 @@ async function saveState(state) {
// Prompt shaping
// ---------------------------------------------------------------------------
-// Granite director over the deployed /api/chat SSE endpoint — same fail-soft
-// contract as the avatar lane: any failure returns null and the deterministic
+// LLM prompt director over the in-process free-provider chain (Groq → OpenRouter
+// → NVIDIA NIM via api/_lib/llm.js — the same server keys the platform funds).
+// Runs in-process instead of over the deployed /api/chat SSE endpoint: this
+// module executes inside the Vercel function, and a server-to-server call to
+// /api/chat is anonymous, so it hits the anon rate limiter / provider gate and
+// never actually reaches a model. Fail-soft: any failure (no keys configured,
+// every provider down, empty completion) returns null and the deterministic
// template below takes over. Never fabricates.
-async function directIdentityPrompt({ base, agentName, brief, styleHints }) {
+async function directIdentityPrompt({ agentName, brief, styleHints }) {
const idea =
`Agent name: ${agentName}\nBrand brief: ${brief}` +
(styleHints ? `\nStyle hints: ${styleHints}` : '');
- let res;
+ let out;
try {
- res = await fetch(`${base}/api/chat`, {
- method: 'POST',
- headers: { 'content-type': 'application/json', accept: 'text/event-stream' },
- body: JSON.stringify({
- provider: 'watsonx',
- message: `${IDENTITY_DIRECTOR_INSTRUCTION}\n\nIdea: ${idea}`,
- }),
- signal: AbortSignal.timeout(30_000),
+ out = await llmComplete({
+ system: IDENTITY_DIRECTOR_INSTRUCTION,
+ user: `Idea: ${idea}`,
+ maxTokens: 200,
+ timeoutMs: 30_000,
});
} catch {
return null;
}
- if (!res.ok || !res.body) return null;
- let acc = '';
- try {
- const reader = res.body.getReader();
- const decoder = new TextDecoder();
- let buf = '';
- for (;;) {
- const { value, done } = await reader.read();
- if (done) break;
- buf += decoder.decode(value, { stream: true });
- const lines = buf.split('\n');
- buf = lines.pop() ?? '';
- for (const line of lines) {
- if (!line.startsWith('data: ')) continue;
- let evt;
- try {
- evt = JSON.parse(line.slice(6));
- } catch {
- continue;
- }
- if (evt.type === 'chunk' && typeof evt.text === 'string') acc += evt.text;
- else if (evt.type === 'error') return null;
- else if (evt.type === 'done' && typeof evt.text === 'string' && !acc) acc = evt.text;
- }
- }
- } catch {
- return null;
- }
- const refined = acc.trim().replace(/^["']|["']$/g, '').split('\n')[0].trim();
+ const refined = (out?.text || '').trim().replace(/^["']|["']$/g, '').split('\n')[0].trim();
return refined.length >= 3 && refined.length <= 1000 ? refined : null;
}
@@ -190,8 +165,8 @@ export function fallbackIdentityPrompt({ brief, styleHints }) {
);
}
-export async function shapeIdentityPrompt({ base = BASE, agentName, brief, styleHints }) {
- const directed = await directIdentityPrompt({ base, agentName, brief, styleHints });
+export async function shapeIdentityPrompt({ agentName, brief, styleHints }) {
+ const directed = await directIdentityPrompt({ agentName, brief, styleHints });
return {
directed,
effective: clampPrompt(directed || fallbackIdentityPrompt({ brief, styleHints })),
@@ -450,7 +425,6 @@ export async function createIdentityJob({
if (refUrl) await validateReferenceImage(refUrl);
const prompt = await shapeIdentityPrompt({
- base,
agentName: name,
brief: effectiveBrief,
styleHints: hints,
diff --git a/api/animations/library.js b/api/animations/library.js
index d30b8b4bf..dc1905c68 100644
--- a/api/animations/library.js
+++ b/api/animations/library.js
@@ -1,19 +1,29 @@
// GET /api/animations/library — the full Mixamo-sourced motion library.
//
-// The bulk library (~2,400 clips baked by scripts/mixamo-all.mjs) is far too
-// large for the deploy bundle (~3 GB of clip JSON), so the baked clips live on
-// the R2 CDN and this endpoint proxies the library manifest object with an
-// edge cache. Each manifest entry carries an absolute CDN `url` the browser
-// fetches directly (R2 CORS allows GET from web origins — scripts/set-r2-cors.mjs).
+// The bulk library (2,800+ clips baked by scripts/mixamo-all.mjs, growing as the
+// generative text→motion seeding lands) is far too large for the deploy bundle
+// (~3 GB of clip JSON), so the baked clips live on the R2 CDN and this endpoint
+// proxies the library manifest object with an edge cache. Each manifest entry
+// carries an absolute CDN `url` the browser fetches directly (R2 CORS allows GET
+// from web origins — scripts/set-r2-cors.mjs).
//
// Returns { clips: [], total: 0 } until the library has been uploaded, so
// consumers (the /animations gallery, embed viewer, pose studio deep-links)
// feature-detect by emptiness rather than special-casing errors.
+//
+// Pagination (opt-in, backward compatible): the manifest is a stable ordered
+// array, so a caller can page it with ?limit= (1..1000) and ?offset= to keep any
+// single response bounded as the catalog grows past thousands of clips. With no
+// ?limit the full array is returned exactly as before, so existing consumers
+// (embed viewer, pose deep-link lookup, the older gallery build) are unchanged.
+// Paged responses add `offset` + `next_offset` (null on the last page); `total`
+// is always the full catalog size regardless of paging.
import { cors, json, method, wrap } from '../_lib/http.js';
import { getObjectBuffer } from '../_lib/r2.js';
const MANIFEST_KEY = 'animations/library/manifest.json';
+const MAX_PAGE = 1000;
export default wrap(async (req, res) => {
if (cors(req, res, { methods: 'GET,OPTIONS' })) return;
@@ -36,6 +46,25 @@ export default wrap(async (req, res) => {
}
}
+ const total = clips.length;
res.setHeader('Cache-Control', 'public, s-maxage=300, stale-while-revalidate=3600');
- return json(res, 200, { clips, total: clips.length, generated_at: generatedAt });
+
+ const url = new URL(req.url, 'http://x');
+ const rawLimit = url.searchParams.get('limit');
+ if (rawLimit == null) {
+ // Legacy full-catalog response — unchanged contract.
+ return json(res, 200, { clips, total, generated_at: generatedAt });
+ }
+
+ const limit = Math.min(Math.max(Number(rawLimit) || 0, 1), MAX_PAGE);
+ const offset = Math.max(Number(url.searchParams.get('offset')) || 0, 0);
+ const page = clips.slice(offset, offset + limit);
+ const nextOffset = offset + limit < total ? offset + limit : null;
+ return json(res, 200, {
+ clips: page,
+ total,
+ offset,
+ next_offset: nextOffset,
+ generated_at: generatedAt,
+ });
});
diff --git a/api/mcp-studio.js b/api/mcp-studio.js
index 4fcd75b34..d8911e80a 100644
--- a/api/mcp-studio.js
+++ b/api/mcp-studio.js
@@ -10,10 +10,13 @@
// platform's server-side keys cover provider cost). Built for the ChatGPT App
// Directory, whose policy disqualifies tokens/credits and embedded payments.
//
-// Abuse protection is real (it costs the platform money): a per-IP transport cap
-// plus a per-IP generation burst + hourly quota (api/_lib/rate-limit.js), which
-// fail closed in production when Redis is absent rather than allow unbounded
-// spend. The paid, crypto-enabled studio lives separately at /api/mcp-3d.
+// Abuse protection is real: a per-IP transport cap plus a per-IP generation
+// burst + hourly quota (api/_lib/rate-limit.js), enforced whenever Redis is
+// healthy. Because every studio tool routes through a zero-cost free lane
+// (NVIDIA NIM / HF Spaces), these generation caps fail OPEN on a Redis outage —
+// a Redis blip must never dead-end a free feature — mirroring the paid server's
+// own free lane. Real paid spend stays fail-closed one layer down in /api/forge.
+// The paid, crypto-enabled studio lives separately at /api/mcp-3d.
import { cors, wrap, readJson, rateLimited } from './_lib/http.js';
import { limits, clientIp } from './_lib/rate-limit.js';
import { dispatch, PROTOCOL_VERSION } from './_mcp-studio/dispatch.js';
diff --git a/api/mcp3d/persona.js b/api/mcp3d/persona.js
new file mode 100644
index 000000000..ffebe4415
--- /dev/null
+++ b/api/mcp3d/persona.js
@@ -0,0 +1,57 @@
+// Persona resolve — the durable-reload endpoint behind the embodiment embed.
+//
+// GET /api/mcp3d/persona?id=persona_xxx → { persona_id, name, glb_url, … }
+//
+// The embodiment embed (pages/embodiment/embed.html) calls this when it is
+// opened with only a persona id (no inline glb param) so a fresh session — a new
+// ChatGPT/Claude turn, a reopened panel, a shared link — reloads the exact same
+// body by id. The persona id is an unguessable capability, so no auth is
+// required to read; the response is the safe public projection only
+// (personaPublicView strips storage keys + owner ids). No token, wallet, or
+// payment surface — a persona is a name and a body.
+//
+// CORS is open and the response is CDN-cacheable for a short window because the
+// embed is framed cross-origin by arbitrary hosts and a persona's body rarely
+// changes within a session.
+
+import { cors, json, wrap } from '../_lib/http.js';
+import { getPersona, isPersonaId, personaPublicView } from '../_lib/persona-store.js';
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,HEAD,OPTIONS', origins: '*' })) return;
+
+ if (req.method !== 'GET' && req.method !== 'HEAD') {
+ json(res, 405, { error: 'method_not_allowed', message: 'GET this endpoint with ?id=persona_…' }, { allow: 'GET, HEAD, OPTIONS' });
+ return;
+ }
+
+ // Parse the id from the query string without depending on a framework-specific
+ // req.query (this handler runs under the plain Node wrap()).
+ const url = new URL(req.url, `http://${req.headers.host || 'localhost'}`);
+ const id = url.searchParams.get('id') || '';
+
+ if (!isPersonaId(id)) {
+ json(res, 400, { error: 'invalid_id', message: 'Provide a valid persona id (?id=persona_…).' });
+ return;
+ }
+
+ let record;
+ try {
+ record = await getPersona(id);
+ } catch {
+ // A storage hiccup must not leak internals — report a clean unavailable.
+ json(res, 503, { error: 'unavailable', message: 'Could not load that persona right now. Please try again.' });
+ return;
+ }
+
+ if (!record) {
+ json(res, 404, { error: 'not_found', message: 'No persona found for that id.' });
+ return;
+ }
+
+ // Public projection only — never the storage key or owner id. Short CDN cache:
+ // the body is durable, and the embed re-fetches on each cold load anyway.
+ res.setHeader('cache-control', 'public, s-maxage=60, stale-while-revalidate=300');
+ res.setHeader('cross-origin-resource-policy', 'cross-origin');
+ json(res, 200, personaPublicView(record));
+});
diff --git a/data/changelog.json b/data/changelog.json
index 006aa2af9..c0d9f4e88 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,50 @@
{
"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-07-07",
+ "title": "The animation library API now pages, so it stays fast as the catalog grows",
+ "summary": "The motion library is heading past its current 2,800+ clips as we add generatively-produced animations. Its public API (GET /api/animations/library) can now return the catalog in bounded pages — pass ?limit and ?offset and page until there's no next_offset — so a single response never balloons no matter how large the library gets. The /animations gallery already fetches the catalog this way. Calling it with no parameters still returns the whole list exactly as before, so nothing built on the old behavior breaks.",
+ "tags": [
+ "improvement",
+ "infra"
+ ],
+ "link": "/animations"
+ },
+ {
+ "date": "2026-07-07",
+ "title": "The free 3D Studio in ChatGPT stays up even when our rate-limiter has a blip",
+ "summary": "The free 3D Studio generates entirely on no-cost engines, so there's no spend to protect by shutting it off. We fixed a case where a hiccup in the rate-limiting backend could make the studio refuse every generation with a \"try again shortly\" — an outage of a free feature for no reason. Its usage caps now stay enforced when everything is healthy but step aside during a backend blip, so a prompt still returns your model. Nothing about paid features changed: those still stop safely if the same backend is unavailable.",
+ "tags": [
+ "fix"
+ ]
+ },
+ {
+ "date": "2026-07-07",
+ "title": "three.ws 3D Studio for the GPT Store — generate 3D models in ChatGPT, free",
+ "summary": "You can now turn a text prompt into a real, downloadable 3D model right inside ChatGPT. The three.ws 3D Studio custom GPT is backed by a free, keyless REST endpoint — describe something like \"a low-poly fox\" or \"a ceramic robot figurine\" and get back a GLB you can open in Blender, Unity, Godot, or three.js, plus a browser viewer link. No account, no key, no cost. Every prompt is screened by a content-safety filter so it stays appropriate for all ages, and the model file is served from a public URL so it's easy to download and share.",
+ "tags": [
+ "feature"
+ ]
+ },
+ {
+ "date": "2026-07-07",
+ "title": "three.ws Agent Skills pack — for any Claude surface",
+ "summary": "Everything three.ws can do is now packaged as portable Agent Skills — self-contained folders that teach any Claude (Claude Code, the Claude apps, or an Agent SDK build) how to use the platform: generate a 3D model from text, make a rigged avatar, rig a GLB you already have, run a wallet, and buy or sell services in the x402 agent economy. Forty skills in all, each with a precise trigger and runnable examples, grouped into three sets — 3D creation, wallet & payments, and market intelligence. The three 3D-creation skills are the newest and run free with no key or account. Install the pack as a Claude Code plugin, drop a skill folder into any project, or upload one to a Claude project.",
+ "tags": [
+ "sdk",
+ "feature"
+ ]
+ },
+ {
+ "date": "2026-07-07",
+ "title": "Find the wallet grinder from the contract grinder",
+ "summary": "The two EVM vanity tools now point at each other. The CREATE2 grinder — which searches a salt for a vanity smart-contract address, with no private key involved — now carries a note explaining that difference and linking to the EVM Vanity Wallet generator for anyone who actually wants a wallet they hold the key to. The wallet generator already linked back; this closes the loop so you can no longer land on one and miss the other.",
+ "tags": [
+ "improvement"
+ ],
+ "link": "/eth-vanity"
+ },
{
"date": "2026-07-07",
"title": "Cleaner 3D models from stylized prompts",
diff --git a/docs/api-reference.md b/docs/api-reference.md
index 5a13f9352..1abf7a7b3 100644
--- a/docs/api-reference.md
+++ b/docs/api-reference.md
@@ -1494,10 +1494,26 @@ feeds directly (`source: "rss"`).
GET /api/animations/library
```
-Returns the full three.ws motion library manifest — the complete Mixamo-sourced catalog of retargeted animation clips (~2,400), hosted on the R2 CDN. No auth required. CORS open. Edge-cached for 5 minutes.
+Returns the three.ws motion library manifest — the complete catalog of retargeted animation clips (2,800+ and growing as generative text→motion clips are seeded), hosted on the R2 CDN. No auth required. CORS open. Edge-cached for 5 minutes.
Each entry's `url` is an absolute CDN URL to the baked clip JSON (`THREE.AnimationClip.toJSON()` format, canonical skeleton) — fetch it directly and load with `THREE.AnimationClip.parse()`, or pass the `name` to the embed viewer (`/embed/avatar?anim=<name>`) and pose studio (`/pose?anim=<name>`).
+**Query parameters** (optional — omit for the full catalog)
+
+| Param | Description |
+| --- | --- |
+| `limit` | Page size, `1`–`1000`. When set, the response is a bounded page instead of the whole catalog — use this to keep a single response small as the library grows. |
+| `offset` | Zero-based start index into the ordered catalog. Default `0`. |
+
+The manifest is a stable ordered array, so paging is offset-based. A paged response adds `offset` and `next_offset` (`null` on the last page); `total` is always the full catalog size. Page until `next_offset` is `null`:
+
+```
+GET /api/animations/library?limit=1000 # first 1000 → next_offset: 1000
+GET /api/animations/library?limit=1000&offset=1000 # next 1000 → next_offset: 2000
+```
+
+Omitting `limit` returns the full array exactly as before (no `offset`/`next_offset` fields) — the legacy contract is unchanged.
+
**Response**
```json
diff --git a/docs/mcp-studio.md b/docs/mcp-studio.md
index b3cd46eec..c6d5795ac 100644
--- a/docs/mcp-studio.md
+++ b/docs/mcp-studio.md
@@ -68,17 +68,21 @@ needs to display the model — no internal identifiers:
## Funding & limits
Generation is **operator-funded**: the platform's server-side keys cover provider
-cost, so the ChatGPT user pays nothing. Because each generation costs real GPU
-spend, the endpoint enforces real per-IP abuse protection
-(`api/_lib/rate-limit.js`):
+cost, so the ChatGPT user pays nothing. Every tool routes through a **free lane**
+(NVIDIA NIM text→3D, Hugging Face Spaces image→3D) — the studio never selects the
+paid Replicate backend — so the platform's marginal cost per generation is zero.
+The endpoint still enforces real per-IP abuse protection (`api/_lib/rate-limit.js`):
- **Burst:** 4 generations / minute / IP
- **Hourly:** 30 generations / hour / IP
- **Transport:** 300 requests / minute / IP (discovery, never throttled by the
generation quota)
-These fail closed in production if the rate-limiter backend is unavailable, so a
-misconfiguration never results in unbounded spend.
+Because the lanes are zero-cost, these caps **fail open** if the rate-limiter
+backend has an outage — a Redis blip must never dead-end a free feature (the same
+posture as the paid server's own free lane). They enforce normally whenever the
+backend is healthy, and any accidental paid-lane spend is still fail-closed one
+layer down in `/api/forge`.
## Safety
diff --git a/mcp-server/src/index.js b/mcp-server/src/index.js
index cd9bc2731..4d4d234c2 100755
--- a/mcp-server/src/index.js
+++ b/mcp-server/src/index.js
@@ -37,6 +37,7 @@ import { buildMeshForgeTool } from './tools/mesh-forge.js';
import { buildForgeFreeTool } from './tools/forge-free.js';
import { buildRigMeshTool } from './tools/rig-mesh.js';
import { buildForgeAvatarTool } from './tools/forge-avatar.js';
+import { buildRefineModelTool } from './tools/refine-model.js';
import { buildSentimentPulseTool } from './tools/sentiment-pulse.js';
import { buildEnsSnsResolveTool } from './tools/ens-sns-resolve.js';
import { buildAgentDelegateActionTool } from './tools/agent-delegate-action.js';
@@ -65,6 +66,8 @@ const SERVER_INSTRUCTIONS =
'auto-rigging a GLB into an animation-ready model (rig_mesh), ' +
'one-call text→rigged-avatar generation that chains mesh generation and auto-rigging with a ' +
'humanoid gate (forge_avatar), ' +
+ 'conversational refinement that iterates on a model by describing a change ("make it metallic", ' +
+ '"bigger helmet") with a revertable/branchable version lineage (refine_model), ' +
'ENS + SNS name resolution ' +
'(ens_sns_resolve), agent-to-agent delegation (agent_delegate_action), token sentiment pulse ' +
'(sentiment_pulse), pose generation (get_pose_seed), Solana token snapshots (pump_snapshot), ' +
@@ -94,6 +97,7 @@ const TOOL_BUILDERS = [
buildForgeFreeTool,
buildRigMeshTool,
buildForgeAvatarTool,
+ buildRefineModelTool,
buildEnsSnsResolveTool,
buildAgentDelegateActionTool,
buildAgentHireDiscoverTool,
diff --git a/mcp-server/src/lib/agent-registry.js b/mcp-server/src/lib/agent-registry.js
index 30cd2161c..1f399bdd4 100644
--- a/mcp-server/src/lib/agent-registry.js
+++ b/mcp-server/src/lib/agent-registry.js
@@ -18,6 +18,16 @@ function baseUrl() {
/**
* Fetch candidate agents from the live three.ws public directory.
*
+ * The directory's full-text `q` is a strict pre-filter — a natural-language task
+ * sentence ("help me run a pump.fun token launch") routinely matches nothing even
+ * when the individual agents are perfectly relevant. So when a `q`-filtered query
+ * comes back empty we broaden: retry without `q` and hand the reputation/
+ * engagement-ranked pool to the client-side relevance scorer (rankCandidates),
+ * which orders it by task-token overlap anyway. Discovery therefore never
+ * dead-ends on phrasing — it degrades to "the best agents we have" rather than an
+ * empty shortlist. When the directory grows, the `q` pre-filter still does the
+ * heavy lifting on the happy path.
+ *
* @param {object} opts
* @param {string} [opts.q] — full-text query (task keywords)
* @param {string} [opts.skill] — skill-slug filter
@@ -25,6 +35,16 @@ function baseUrl() {
* @returns {Promise<object[]>} raw agent rows from /api/agents/public
*/
export async function fetchCandidates({ q, skill, limit = 24 } = {}) {
+ const rows = await fetchDirectory({ q, skill, limit });
+ // A skill filter is an explicit, honored constraint — never widen past it.
+ // A `q` that filtered everything out is just phrasing noise: broaden it away.
+ if (rows.length === 0 && q) {
+ return fetchDirectory({ skill, limit });
+ }
+ return rows;
+}
+
+async function fetchDirectory({ q, skill, limit = 24 } = {}) {
const url = new URL(`${baseUrl()}/api/agents/public`);
if (q) url.searchParams.set('q', String(q).slice(0, 100));
if (skill) url.searchParams.set('skill', String(skill).toLowerCase());
diff --git a/mcp-server/src/lib/delegate-transport.js b/mcp-server/src/lib/delegate-transport.js
index e12a73907..baf70e95d 100644
--- a/mcp-server/src/lib/delegate-transport.js
+++ b/mcp-server/src/lib/delegate-transport.js
@@ -16,6 +16,21 @@ function talkEndpoint() {
return v && v.trim() ? v.trim() : 'https://three.ws/api/agents/talk';
}
+// The talk endpoint requires an authenticated principal — each delegation burns
+// platform LLM credit, so it will not run for an anonymous caller (401). The MCP
+// tool has already collected the x402 payment; it presents a platform service
+// credential (a bearer API key) so the delegation the caller paid for can
+// actually execute. Without a token configured the delegation returns a clean
+// 401 error (which cancels the x402 payment — the caller is never charged for a
+// hire that could not run).
+function talkAuthToken() {
+ for (const k of ['MCP_AGENT_TALK_TOKEN', 'THREE_WS_MCP_TOKEN', 'MCP_SERVICE_TOKEN']) {
+ const v = process.env[k];
+ if (v && v.trim()) return v.trim();
+ }
+ return null;
+}
+
/**
* Run a delegated message against a three.ws agent.
*
@@ -28,13 +43,17 @@ function talkEndpoint() {
* On transport failure, ok=false with an error string (never throws).
*/
export async function runDelegation({ agentId, message, model, timeoutMs = 60_000 }) {
+ const headers = { 'content-type': 'application/json' };
+ const token = talkAuthToken();
+ if (token) headers.authorization = `Bearer ${token}`;
+
let res;
try {
res = await resilientFetch(
talkEndpoint(),
{
method: 'POST',
- headers: { 'content-type': 'application/json' },
+ headers,
body: JSON.stringify({ agentId, message, model }),
},
{ timeoutMs, retries: 0, label: 'agent-delegate' },
diff --git a/mcp-server/src/tools/refine-model.js b/mcp-server/src/tools/refine-model.js
new file mode 100644
index 000000000..50c1bc046
--- /dev/null
+++ b/mcp-server/src/tools/refine-model.js
@@ -0,0 +1,120 @@
+// `refine_model` — paid MCP tool: conversational, iterative 3D.
+//
+// Carry a model you already generated forward with a natural-language change
+// ("make it metallic", "bigger helmet", "add wings"). This is a REAL anchored
+// re-generation — the prior prompt is folded into the new one so form, subject,
+// and materials carry forward, and an optional reference image of the current
+// model anchors it as image→3D. No faked diffing: the composed prompt is what
+// the generator actually runs.
+//
+// Every refinement is recorded in an immutable version lineage (parent → child)
+// so the caller can branch or revert — a pointer move over the returned array,
+// never a mutation. Pass `parent_lineage` from a previous result to extend the
+// same thread; omit it to start a fresh lineage rooted at `glb_url`.
+//
+// Pricing: $0.25 USDC (a full regeneration, priced like mesh_forge). Settled
+// `exact` on Solana. The generation logic lives in `_studio-core.js`
+// (runRefineModel) so the paid stdio transport and the hosted FREE 3D Studio
+// endpoint (/api/mcp-studio) share ONE implementation and never drift. Iteration
+// carries no royalty/wallet surface — that lives only on the remix rails.
+//
+// Environment (all optional — sensible prod defaults):
+// MESH_FORGE_API_BASE — three.ws origin. Default https://three.ws
+// REFINE_MODEL_TIMEOUT_MS — overall reconstruct poll budget. Default 180000.
+// REFINE_MODEL_POLL_MS — poll interval. Default 3000.
+
+import { z } from 'zod';
+
+import { paid } from '../payments.js';
+import { jsonSchemaFromZod } from './_shared.js';
+import { runRefineModel } from './_studio-core.js';
+
+const TOOL_NAME = 'refine_model';
+const TOOL_DESCRIPTION =
+ 'Iterate on a 3D model by describing a change in plain language ("make it metallic", "bigger helmet", ' +
+ '"add wings"). Re-generates a NEW version anchored to the previous model: the prior prompt is carried ' +
+ 'forward and folded with your change, and an optional reference image of the current model anchors the ' +
+ 'regeneration as image→3D. Real generation — never a fake diff. Each refinement is appended to an ' +
+ 'immutable version lineage (parent → child) so you can branch off an earlier version (parent_index) or ' +
+ 'revert (a pointer move over the returned lineage). Pass parent_lineage from a previous refine_model ' +
+ 'result to extend the same thread; omit it to start a fresh lineage rooted at glb_url. Returns the new ' +
+ 'GLB URL, a three.ws viewer link, the composed prompt, the full lineage, and the active version index. ' +
+ 'Paid: $0.25 USDC.';
+
+const inputZodShape = {
+ glb_url: z
+ .string()
+ .url()
+ .describe('http(s) URL of the model to refine — e.g. the glbUrl a previous generation or refinement returned.'),
+ instruction: z
+ .string()
+ .min(1)
+ .max(500)
+ .describe('The change to make, in plain language: "make it metallic", "bigger helmet", "add a cape".'),
+ parent_prompt: z
+ .string()
+ .max(1000)
+ .describe('Optional — the prompt that produced the model being refined, so the change builds on it instead of starting over.')
+ .optional(),
+ reference_image_url: z
+ .string()
+ .url()
+ .describe('Optional http(s) image of the current model to anchor the regeneration (image→3D). Omit for text-guided refinement.')
+ .optional(),
+ parent_lineage: z
+ .array(z.record(z.any()))
+ .describe('Optional — the lineage array from a previous refine_model result, to extend the same version history.')
+ .optional(),
+ parent_index: z
+ .number()
+ .int()
+ .min(0)
+ .describe('Optional — branch off an earlier version in parent_lineage (its index) instead of the latest.')
+ .optional(),
+};
+
+const inputJsonSchema = jsonSchemaFromZod(inputZodShape);
+
+export async function buildRefineModelTool() {
+ const handler = await paid(
+ {
+ toolName: TOOL_NAME,
+ description: TOOL_DESCRIPTION,
+ scheme: 'exact',
+ priceUsd: '$0.25',
+ inputSchema: inputJsonSchema,
+ example: { glb_url: 'https://three.ws/cdn/creations/abc123/mesh.glb', instruction: 'make it metallic', parent_prompt: 'a round robot mascot' },
+ outputExample: {
+ ok: true,
+ mode: 'refine',
+ glbUrl: 'https://three.ws/cdn/creations/def456/mesh.glb',
+ viewerUrl: 'https://three.ws/viewer?src=https%3A%2F%2Fthree.ws%2F...',
+ composedPrompt: 'a round robot mascot, metallic',
+ instruction: 'make it metallic',
+ anchored: false,
+ lineage: [
+ { index: 0, parentIndex: null, glbUrl: 'https://three.ws/cdn/creations/abc123/mesh.glb', instruction: null, refKind: 'origin' },
+ { index: 1, parentIndex: 0, glbUrl: 'https://three.ws/cdn/creations/def456/mesh.glb', instruction: 'make it metallic', refKind: 'text' },
+ ],
+ activeIndex: 1,
+ },
+ },
+ (args) => runRefineModel(args),
+ );
+
+ return {
+ name: TOOL_NAME,
+ title: 'Refine a 3D model by describing a change',
+ description: TOOL_DESCRIPTION,
+ inputSchema: inputZodShape,
+ // Mints a fresh version anchored to the parent; never overwrites the source
+ // and a given change can yield a slightly different mesh each call.
+ annotations: {
+ readOnlyHint: false,
+ destructiveHint: false,
+ idempotentHint: false,
+ openWorldHint: true,
+ },
+ handler,
+ };
+}
diff --git a/prompts/bnb-chain/09-vault-upload-pipeline.md b/prompts/bnb-chain/09-vault-upload-pipeline.md
new file mode 100644
index 000000000..aa550f681
--- /dev/null
+++ b/prompts/bnb-chain/09-vault-upload-pipeline.md
@@ -0,0 +1,47 @@
+# 09 — Vault upload pipeline (encrypt → Greenfield)
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: 07** (`greenfield.js` read client) and **08** (`vault-crypto.js` + manifest spec).
+Run whichever is missing first.
+
+## Why
+A seller lists a 3D model: we encrypt it (08), create/ensure a Greenfield bucket, upload the
+ciphertext object via a Storage Provider, write the manifest, and return refs the vault
+contract (10) will gate. This is where the "storage you control from a contract" story
+becomes real bytes on Greenfield testnet.
+
+## Build
+- Extend `api/_lib/bnb/greenfield.js` (or a sibling `greenfield-write.js`) with write helpers
+ using `@bnb-chain/greenfield-js-sdk`: `ensureBucket(name)`, `createObject(bucket, name, bytes, { contentType, visibility:'private' })` (uploads via SP; remember from 00-CONTEXT that
+ object CREATE from BSC is pending — creation goes through the Greenfield SDK/SP path, not a
+ BSC contract, and settles async: poll for the object to become readable).
+- `api/bnb/vault-upload.js` — server endpoint. Input: a GLB (multipart or a URL to one of our
+ own generated GLBs — reuse `api/forge*.js` outputs), plus `{ priceAtomic, sellerAddress }`.
+ Steps: fetch GLB → `encryptGlb` (08) → `ensureBucket` → `createObject(ciphertext)` → build
+ the manifest per `specs/vault-manifest.md` → store the manifest (as its own small Greenfield
+ object or in our existing DB/KV — pick what the codebase already uses and say which) →
+ return `{ manifestRef, glbObjectRef, sha256, status:'stored'|'pending' }`.
+- The wrapped content key is NOT uploaded in the clear — it's released only at unlock (11).
+ Store the seller-side key material so 11 can re-wrap it to the buyer (or use a
+ deterministic re-encryption the contract authorizes — document the exact choice).
+
+## States
+Bucket already exists → reuse, don't fail. SP upload interrupted → resumable or clean retry;
+never leave a half-object referenced by a manifest. Object still mirroring → return
+`status:'pending'` with a poll hint, not a lie that it's ready. Oversized GLB → enforce a
+sane max, typed 413.
+
+## Tests (`tests/bnb-vault-upload.test.js`)
+- End-to-end with mocked SP: GLB in → manifest out matching the spec, ciphertext object
+ referenced, key NOT present in the manifest.
+- `ensureBucket` idempotent (second call no-ops).
+- `pending` surfaced when the mocked mirror hasn't settled.
+- Synthetic GLB + synthetic addresses.
+
+## Definition of done
+Inherit 00-CONTEXT DoD. Additionally:
+- [ ] REAL testnet proof: upload one encrypted GLB to a Greenfield testnet bucket; paste the
+ bucket name, object name, the GreenfieldScan link, and the manifest JSON. Confirm the
+ object is NOT publicly decryptable (download ciphertext, show it's not a valid GLB
+ without the key).
+- [ ] Docs deferred to 13; note the manifest-storage choice you made in PROGRESS.
diff --git a/prompts/bnb-chain/10-vault-contract.md b/prompts/bnb-chain/10-vault-contract.md
new file mode 100644
index 000000000..bc7d5d8f9
--- /dev/null
+++ b/prompts/bnb-chain/10-vault-contract.md
@@ -0,0 +1,50 @@
+# 10 — GreenfieldVault.sol (pay → PermissionHub grant)
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: 01** (chain constants for hub addresses). Run it first if missing. Independent of
+07–09 at the contract level (they meet at prompt 11).
+
+## Why
+The heart of the "only on BNB Chain" claim: a BSC smart contract that, on payment, grants the
+buyer a Greenfield **object permission** cross-chain via PermissionHub — on-chain logic gating
+decentralized storage. No equivalent on Ethereum/Base/Solana. Build + deploy the contract to
+BSC testnet.
+
+## Build — `contracts/GreenfieldVault.sol` (Foundry; see `contracts/README.md`)
+- Uses the live Greenfield hub interfaces. Reference `bnb-chain/greenfield-contracts` for the
+ `PermissionHub`, `IGnfdAccessControl`, and cross-chain interfaces (add them under
+ `contracts/lib/` or interface stubs — real ABIs, not invented). Hub addresses per network:
+ mainnet from 00-CONTEXT; testnet from the greenfield-contracts README (read it).
+- Functions:
+ - `list(bytes32 objectId, uint256 price, address seller)` — seller registers a for-sale
+ encrypted object (the one uploaded in 09), the vault must control its permissions.
+ - `buy(bytes32 objectId)` payable / or pull-payment in a token — on sufficient payment,
+ call `PermissionHub.createPolicy(...)` granting the buyer read permission on that object,
+ and record the sale. Handle the PermissionHub cross-chain **relayer fee** (these calls
+ require paying the cross-chain fee — read the interface; get it right).
+ - `revoke` path for refunds/expiry via `deletePolicy` (design a sane policy: e.g. grants are
+ permanent on purchase; if you add expiry, make it explicit).
+ - Emit `Listed`, `Purchased(objectId, buyer, policyId)` events the API (11) indexes.
+- Follow `contracts/README.md` build/test/deploy conventions; add a deploy script
+ `contracts/script/DeployGreenfieldVault.s.sol`.
+
+## States
+Underpayment → revert with reason. Buying an unlisted object → revert. Cross-chain fee not
+covered → revert clearly (don't half-execute). Double-buy → idempotent or explicit re-grant,
+your choice, documented. Re-entrancy → guarded.
+
+## Tests (`contracts/test/GreenfieldVault.t.sol`, `forge test -vv`)
+- `list` then `buy` with exact payment emits `Purchased` and calls `createPolicy` (mock the
+ hub in-test via a mock PermissionHub).
+- Underpayment reverts; unlisted reverts; missing cross-chain fee reverts.
+- Re-entrancy attempt blocked.
+
+## Definition of done
+Inherit 00-CONTEXT DoD. Additionally:
+- [ ] `forge test -vv` green; paste output.
+- [ ] REAL deploy to BSC testnet; record address in `contracts/DEPLOYMENTS.md` (bytecode-
+ verified style with today's date). Paste the deploy tx hash + BscScan link in PROGRESS.
+- [ ] Execute one real `buy` on testnet that triggers a real `PermissionHub.createPolicy`
+ cross-chain call; paste the BSC tx hash AND the resulting Greenfield permission change
+ (GreenfieldScan) once it settles. This cross-chain grant IS the campaign's signature proof.
+- [ ] `data/changelog.json`: entry (tags `feature`, `infra`) — "On-chain gated 3D asset vault on BNB Chain".
diff --git a/prompts/bnb-chain/11-vault-unlock-api.md b/prompts/bnb-chain/11-vault-unlock-api.md
new file mode 100644
index 000000000..d1dac667e
--- /dev/null
+++ b/prompts/bnb-chain/11-vault-unlock-api.md
@@ -0,0 +1,46 @@
+# 11 — Vault API: list, status, unlock
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: 09** (upload pipeline + manifests) and **10** (deployed vault contract). Run
+whichever is missing first — this prompt wires them together and must not stub either.
+
+## Why
+The API layer the vault UI (12) calls: browse listings, check a buyer's access, and — after
+an on-chain purchase — deliver the decryption key so the buyer can download + decrypt the GLB.
+This is where payment (contract), storage (Greenfield), and crypto (envelope) meet.
+
+## Build — `api/vault/[action].js` (or discrete files under `api/vault/`)
+Free plain-handler pattern for reads; the unlock step verifies on-chain state, not a paywall.
+- `GET /api/vault/list` — enumerate listed objects from the contract's `Listed`/`Purchased`
+ events (index via viem `getLogs` through `chains.js`) joined with manifest metadata
+ (name, price, seller, thumbnail if any). Handle 0 listings (empty state data).
+- `GET /api/vault/status?objectId=&buyer=` — is this buyer's purchase on-chain? Is the
+ Greenfield permission grant settled yet? Return `{ purchased, policySettled, state:
+ 'unlisted'|'available'|'pending-grant'|'unlocked' }`. The `pending-grant` state (cross-chain
+ async from 00-CONTEXT) MUST be represented honestly.
+- `POST /api/vault/unlock` — body proves the caller controls `buyer` (a signed message) AND
+ the contract shows they purchased + the Greenfield policy is settled. Only then release the
+ content key: re-wrap it to the buyer's pubkey (`vault-crypto.wrapKey`) and return
+ `{ wrappedKey, glbObjectRef, manifest }`. The buyer downloads ciphertext via 07's
+ `downloadObject` (their granted permission authorizes the SP fetch) and decrypts locally.
+ NEVER return the raw content key or the plaintext GLB from the server.
+
+## States
+Not purchased → 403 with "purchase required" + the buy call info. Purchased but grant still
+mirroring → 200 `state:'pending-grant'` + poll hint (not an error). Bad signature → 401.
+Object delisted → 410. Every state distinct and honest.
+
+## Tests (`tests/bnb-vault-api.test.js`)
+- `list` builds entries from mocked logs + manifests; empty → `[]` with empty-state shape.
+- `status` returns `pending-grant` when purchase log present but mocked policy unsettled.
+- `unlock` refuses without a valid purchase (403) and without a valid signature (401);
+ succeeds only when both hold, returning a wrapped (not raw) key.
+- Synthetic addresses/objects.
+
+## Definition of done
+Inherit 00-CONTEXT DoD. Additionally:
+- [ ] REAL end-to-end slice on testnet: an address that actually bought via prompt 10 calls
+ `unlock`, receives the wrapped key, downloads ciphertext from Greenfield, decrypts to a
+ valid GLB. Paste each step's real output (tx hash, status JSON, sha256 of decrypted GLB
+ matching the manifest). Prove a NON-buyer gets 403.
+- [ ] Docs deferred to 13; note any manifest/keystore assumptions in PROGRESS.
diff --git a/prompts/bnb-chain/12-vault-ui.md b/prompts/bnb-chain/12-vault-ui.md
new file mode 100644
index 000000000..6c74c5af2
--- /dev/null
+++ b/prompts/bnb-chain/12-vault-ui.md
@@ -0,0 +1,47 @@
+# 12 — Vault UI (/vault): browse, buy, unlock, view in 3D
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: 11** (vault API). Run it first if missing. Do not build UI against unbuilt APIs.
+
+## Why
+The face of Track B. A polished page where anyone browses encrypted 3D listings, buys one
+(BSC testnet), watches the cross-chain grant settle, unlocks, and sees the model render in
+our existing Three.js viewer. This is the screenshot-worthy artifact. Hold the CLAUDE.md
+UI/UX bar: every state designed, transitions, responsive, a11y, microinteractions.
+
+## Build — `/vault` page
+- New page wired into the Vite app + nav (find how existing pages register: `data/pages.json`,
+ the router, and the nav component — match them). Reuse the existing GLB viewer component
+ (grep for the Three.js viewer used by forge/marketplace) — do NOT build a new viewer.
+- Flow UI:
+ 1. **Browse** — grid of listings from `GET /api/vault/list`. Each card: name, price,
+ seller, locked-state badge. Skeleton loading, designed empty state ("No models listed
+ yet — list yours"), error state.
+ 2. **Buy** — connect wallet (reuse existing wallet connect; BSC testnet), call the vault
+ contract `buy`. Show tx pending → confirmed. If gasless is available (prompt 02), offer
+ the sponsored path and label it.
+ 3. **Settling** — after purchase, poll `GET /api/vault/status`; show an honest
+ "granting access on Greenfield…" state for `pending-grant` (this async step is a feature
+ to surface, not hide — it's the cross-chain magic).
+ 4. **Unlock + view** — on `unlocked`, call `POST /api/vault/unlock`, decrypt client-side
+ (`vault-crypto` browser build), load the GLB into the viewer. Download button for the GLB.
+- Every interactive element: hover/active/focus states. Responsive at 320/768/1440.
+
+## States
+0 listings, 1 listing, many (paginate/virtualize if needed). Wallet not connected. Wrong
+network (prompt to switch to BSC testnet). Purchase rejected in wallet. Grant stuck pending
+(bounded poll → "still settling, check back" with a manual refresh). Decrypt failure (show a
+real recovery message). Non-buyer viewing a locked card (clear CTA).
+
+## Tests
+- Logic tests for any pure helpers (state machine: purchase→pending→unlocked) in `tests/`.
+- Manual browser exercise is REQUIRED (CLAUDE.md DoD): run `npm run dev`, drive the full flow,
+ confirm zero console errors and real network calls. Capture what you saw in PROGRESS.
+
+## Definition of done
+Inherit 00-CONTEXT DoD (incl. the UI-specific items: all states designed, no console errors,
+real API calls in network tab). Additionally:
+- [ ] `data/pages.json`: register `/vault` (path, title, description, `added` date).
+- [ ] `STRUCTURE.md`: add a row for the vault surface.
+- [ ] `data/changelog.json`: entry (tag `feature`) — "Vault: buy & unlock encrypted 3D models on BNB Chain".
+- [ ] Real browser proof in PROGRESS: the full buy→settle→unlock→render flow on testnet, with the tx hash and a note that the GLB rendered.
diff --git a/prompts/bnb-chain/13-vault-e2e-proof.md b/prompts/bnb-chain/13-vault-e2e-proof.md
new file mode 100644
index 000000000..85c0429c1
--- /dev/null
+++ b/prompts/bnb-chain/13-vault-e2e-proof.md
@@ -0,0 +1,38 @@
+# 13 — Vault end-to-end proof + final docs
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: 12** (and transitively 07–11). This prompt proves the whole track works together
+and writes the definitive docs. If any prereq is incomplete, finish it first — this prompt
+exists to catch exactly that.
+
+## Why
+Tracks that ship in pieces drift. One agent runs the entire vault flow on real BSC/Greenfield
+testnet, captures immutable proof, and writes the doc + spec that let anyone reproduce it.
+
+## Do — full E2E on testnet (no mocks)
+1. Generate a real GLB (reuse our free forge lane — `api/forge*.js` / the `generate-3d-model`
+ flow) so the asset is genuinely ours.
+2. Upload+encrypt it (09) → Greenfield testnet. Record bucket/object/manifest.
+3. List it on the vault contract (10) from a seller wallet.
+4. From a SECOND wallet, buy it (12/contract) — use the gasless path if available.
+5. Watch the cross-chain PermissionHub grant settle; unlock (11); decrypt; render.
+6. Confirm a THIRD wallet (no purchase) is correctly denied.
+Capture every tx hash, object ref, and status transition.
+
+## Build — `docs/bnb-vault.md`
+Zero-context reader. What the vault is, the exact "only on BNB Chain" mechanism (BSC contract
+→ cross-chain PermissionHub grant on Greenfield, per 00-CONTEXT verified facts), the full
+architecture (encrypt→store→gate→unlock), a reproducible walkthrough with the real testnet
+addresses from the E2E run, and the honest caveats (Greenfield deprioritized; content bytes
+off-chain via SPs; grants async). Link from `docs/start-here.md`. Update `specs/vault-manifest.md`
+if the E2E surfaced any drift from prompt 08's draft.
+
+## Definition of done
+Inherit 00-CONTEXT DoD. Additionally:
+- [ ] PROGRESS entry with the COMPLETE captured E2E trail: seller tx, buyer tx (with mode
+ sponsored/self-pay), Greenfield object + manifest refs, the PermissionHub policyId, the
+ unlock response, the decrypted-GLB sha256 matching the manifest, and the denied-third-
+ wallet 403. This is the campaign's Track-B proof-of-life — make it airtight.
+- [ ] `docs/bnb-vault.md` complete; every address/hash in it is real and from your run.
+- [ ] `data/changelog.json`: entry (tag `feature`) — "Encrypted 3D vault live end-to-end on BNB Chain testnet".
+- [ ] If ANY step couldn't complete on real testnet, say exactly which and why — do not paper over it.
diff --git a/prompts/bnb-chain/14-world-moves-contract.md b/prompts/bnb-chain/14-world-moves-contract.md
new file mode 100644
index 000000000..327afa41f
--- /dev/null
+++ b/prompts/bnb-chain/14-world-moves-contract.md
@@ -0,0 +1,37 @@
+# 14 — WorldMoves.sol (on-chain move commits)
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: 01** (chain constants). Run it first if missing.
+
+## Why
+Track C's core: a contract that records player moves/state transitions as events, cheap and
+tiny, designed to be written every ~0.45s (BSC's live block time) and read back as a
+real-time on-chain presence feed. The point is to feel Solana-class latency with full EVM
+tooling — 0.45s blocks + gasless moves make fully-on-chain movement actually usable.
+
+## Build — `contracts/WorldMoves.sol` (Foundry)
+- Minimal gas per move (this is written constantly). Design:
+ - `move(uint32 worldId, int32 x, int32 y, int32 z, uint16 facing)` — emits
+ `Moved(worldId, msg.sender, x, y, z, facing, block.number, block.timestamp)`. Prefer
+ event-only (no SSTORE) for the movement stream to keep gas minimal; keep optional current-
+ position storage behind a separate `checkpoint()` if a prompt needs queryable latest state.
+ - Optional `join(worldId)` / `leave(worldId)` presence events.
+- No admin, no upgradeability needed (keep it trivially auditable). Bound coordinates sanely.
+- Deploy script `contracts/script/DeployWorldMoves.s.sol`. Follow `contracts/README.md`.
+
+## States
+Out-of-bounds coords → revert or clamp (pick one, document). Spam is expected — that's the
+use case; ensure gas stays flat (no unbounded loops, no growing storage per move).
+
+## Tests (`contracts/test/WorldMoves.t.sol`, `forge test -vv`)
+- `move` emits `Moved` with the exact args + block metadata.
+- Gas per `move` measured and asserted under a tight bound (paste the gas number).
+- `join`/`leave` emit presence events.
+
+## Definition of done
+Inherit 00-CONTEXT DoD. Additionally:
+- [ ] `forge test -vv` green; paste output INCLUDING the measured gas-per-move.
+- [ ] REAL deploy to BSC testnet; record in `contracts/DEPLOYMENTS.md`; paste deploy tx +
+ BscScan link. Fire ~10 real `move` txs in a row and paste the block numbers/timestamps
+ showing sub-second spacing (this doubles as live 0.45s-block proof).
+- [ ] Internal — docs deferred to prompt 18.
diff --git a/prompts/bnb-chain/15-gasless-move-sender.md b/prompts/bnb-chain/15-gasless-move-sender.md
new file mode 100644
index 000000000..46b213362
--- /dev/null
+++ b/prompts/bnb-chain/15-gasless-move-sender.md
@@ -0,0 +1,40 @@
+# 15 — Gasless move sender (sponsored move txs)
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: 02** (`megafuel.js`) and **14** (`WorldMoves.sol` deployed). Run whichever is
+missing first.
+
+## Why
+Moving on-chain is only magical if it's FREE and instant. This layer turns a player's
+intended move into a gasless MegaFuel-sponsored `move()` tx (self-pay fallback), so a plain
+empty wallet can walk around a world writing to chain every ~0.45s with no gas. Combines the
+two headline capabilities into one felt experience.
+
+## Build — `api/_lib/bnb/world-moves.js` + a thin browser sender
+- `buildMoveTx(worldId, pos, facing)` — encodes a `WorldMoves.move` call via viem + the
+ deployed address (from `chains.js`/config).
+- `sendMove({ account, worldId, pos, facing })` — routes through `megafuel.sendGasless`
+ (prompt 02); returns `{ hash, mode }`. Rate-limit/coalesce: if the player moves faster than
+ blocks confirm, debounce to at most one in-flight tx + latest-wins queue (don't spam
+ hundreds of pending txs). This coalescing logic must be pure + tested.
+- Browser entry: a small module the presence mode (16) imports — takes the player's local
+ position stream, emits sponsored move txs at a sane cadence (target ~1 per block).
+
+## States
+Sponsorship unavailable → self-pay (still works, label it). Tx pending longer than a block →
+skip intermediate positions, send only the latest (latest-wins). Wallet has no funds AND
+sponsorship down → surface "moves can't be recorded on-chain right now" gracefully; local
+movement still works (never freeze the game).
+
+## Tests (`tests/bnb-world-moves.test.js`)
+- `buildMoveTx` encodes the right calldata for known args.
+- Coalescing: feed a burst of positions faster than confirmations → asserts only latest-wins
+ txs are emitted, in-flight cap respected (pure-logic test, no network).
+- `sendMove` sponsored + self-pay fallback paths (mock prompt 02).
+
+## Definition of done
+Inherit 00-CONTEXT DoD. Additionally:
+- [ ] REAL testnet proof: send a stream of ~20 gasless moves from a single wallet; paste a
+ few tx hashes, their `mode` (ideally `sponsored` with gasPrice 0), and the block spacing.
+ If sponsored, note the wallet's tBNB balance stayed flat — that's the wow.
+- [ ] Docs deferred to 18.
diff --git a/prompts/bnb-chain/16-onchain-presence-mode.md b/prompts/bnb-chain/16-onchain-presence-mode.md
new file mode 100644
index 000000000..d57d9e0d8
--- /dev/null
+++ b/prompts/bnb-chain/16-onchain-presence-mode.md
@@ -0,0 +1,42 @@
+# 16 — On-chain presence mode in explore/platformer
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: 15** (gasless move sender). Run it (and its chain) first if missing.
+
+## Why
+Wire the on-chain movement into a real, existing 3D surface so people can actually feel it.
+We shipped platformer mode + Agora player-mode (`src/agora/player-mode.js`) on 2026-07-07.
+Add an opt-in "On-chain (BNB)" toggle: when on, the local avatar's moves are also written to
+`WorldMoves` gaslessly, and OTHER players' on-chain moves are read back and rendered — a
+fully-on-chain presence layer riding 0.45s blocks.
+
+## Build
+- Find the existing explore/platformer/player-mode entry (grep `player-mode`, `platformer`,
+ the explore surface from `git log`). Add a clearly-labeled opt-in toggle "Record on-chain
+ (BNB testnet)" — OFF by default (don't surprise users with wallet prompts).
+- When ON: feed local position into prompt 15's sender (gasless moves). Read remote presence
+ by subscribing to `Moved` events (viem `watchContractEvent` / polling every block via
+ `chains.js`) and render lightweight ghosts/markers for other on-chain players in the same
+ `worldId`. Interpolate between the ~0.45s updates so motion is smooth.
+- Keep it additive: with the toggle OFF, the existing experience is byte-for-byte unchanged.
+ Never regress the current explore/platformer behavior.
+
+## States
+Toggle OFF → zero BNB code runs, no wallet prompt. ON but no wallet → prompt to connect (BSC
+testnet), gracefully cancelable. ON, sponsorship down → self-pay note or "local-only" degrade;
+never freeze movement. No other on-chain players → your own ghost only + a subtle "you're the
+first one here" hint. Event backfill on join (show recent movers, bounded lookback).
+
+## Tests
+- Pure interpolation/ghost-state logic in `tests/` (feed timestamped positions → smooth
+ intermediate frames; stale players time out).
+- Manual browser exercise REQUIRED: `npm run dev`, toggle on with a testnet wallet, walk
+ around, confirm real `move` txs fire and a second browser/wallet shows up as a ghost.
+ Capture observations + zero console errors in PROGRESS.
+
+## Definition of done
+Inherit 00-CONTEXT DoD (UI items included). Additionally:
+- [ ] Real proof: two sessions (two wallets) see each other move on-chain; paste tx hashes and
+ a note that ghost rendering tracked them at sub-second latency.
+- [ ] `data/changelog.json`: entry (tag `feature`) — "Walk on-chain: gasless real-time presence on BNB Chain".
+- [ ] `STRUCTURE.md`: update the explore/platformer row to mention the on-chain mode.
diff --git a/prompts/bnb-chain/17-latency-proof-page.md b/prompts/bnb-chain/17-latency-proof-page.md
new file mode 100644
index 000000000..e9a585322
--- /dev/null
+++ b/prompts/bnb-chain/17-latency-proof-page.md
@@ -0,0 +1,43 @@
+# 17 — /bnb-latency live block-race proof page
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: none** (uses public RPCs; `chains.js` from 01 if present, else inline the public
+RPC — but prefer 01's `probeBlockTime`). Standalone, high-shareability.
+
+## Why
+A single page that VIEWERS find fascinating and screenshot: a live, honest race showing BNB
+Chain confirming blocks at ~0.45s next to Base (2s) and Ethereum (12s). No wallet, no
+payment — pure proof of the speed claim, driven by real public RPCs. This is marketing that
+is also true (00-CONTEXT verified fact #3).
+
+## Build — `/bnb-latency` page
+- Three (or four) live lanes: BNB Chain (56), Base (8453), Ethereum (1), optionally Solana
+ (slot cadence via its RPC). Each lane subscribes to new blocks via public RPC and animates a
+ tick every time a block lands, with a running measured average interval. Use
+ `probeBlockTime` (01) for BNB where possible; other chains via their public RPCs.
+- Headline number: BNB Chain's live measured avg (should read ~0.45s), updated continuously.
+ Show a rolling sparkline of block intervals per chain.
+- Honesty guardrails: label everything "measured live from public RPC", show the last-updated
+ timestamp, and DON'T claim 250ms/20k TPS (refuted/roadmap per 00-CONTEXT). Compare only what
+ you measure.
+- CLAUDE.md UI bar: designed loading (before first blocks arrive), error (RPC down → show the
+ others, mark the dead lane), responsive, a11y, tasteful motion (respect
+ `prefers-reduced-motion`). Use existing design tokens.
+
+## States
+RPC for one chain down → that lane shows "reconnecting", others keep racing. All down →
+designed error with retry. First few seconds before enough samples → "measuring…" not a
+fake number. Reduced-motion → static bars with numbers.
+
+## Tests
+- Pure interval-averaging + sparkline math in `tests/` (feed block timestamps → correct
+ rolling average).
+- Manual browser exercise: `npm run dev`, open `/bnb-latency`, confirm BNB lane reads ~0.45s
+ live and others match expectations; zero console errors. Capture the observed BNB average.
+
+## Definition of done
+Inherit 00-CONTEXT DoD (UI items). Additionally:
+- [ ] `data/pages.json`: register `/bnb-latency`.
+- [ ] `STRUCTURE.md`: add a row.
+- [ ] `data/changelog.json`: entry (tag `feature`) — "Live block-speed race: watch BNB Chain confirm in ~0.45s".
+- [ ] PROGRESS: paste the live BNB average you observed + a note the page renders cleanly.
diff --git a/prompts/bnb-chain/18-world-e2e-demo.md b/prompts/bnb-chain/18-world-e2e-demo.md
new file mode 100644
index 000000000..636412cf9
--- /dev/null
+++ b/prompts/bnb-chain/18-world-e2e-demo.md
@@ -0,0 +1,32 @@
+# 18 — World E2E demo + docs
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: 16** (and transitively 14, 15). Finish them first if incomplete — this prompt
+proves the track end-to-end and documents it.
+
+## Why
+Prove the real-time on-chain world works with two real participants on testnet, and write the
+doc that explains the mechanism and lets anyone reproduce it.
+
+## Do — full E2E on BSC testnet (no mocks)
+1. Two wallets join the same `worldId` in on-chain presence mode (16).
+2. Both walk; confirm gasless `move` txs fire (15) and each sees the other's ghost update at
+ sub-second latency (14's 0.45s blocks).
+3. Capture: a sequence of real `move` tx hashes from both wallets with block timestamps
+ showing ~0.45s spacing, and the `mode` (sponsored ideally) proving gas-free movement.
+
+## Build — `docs/bnb-world.md`
+Zero-context reader: what the on-chain world is, exactly why it's only practical on BNB Chain
+(0.45s blocks + gasless EOA sends, both verified in 00-CONTEXT), the architecture
+(`WorldMoves.sol` events + MegaFuel sponsorship + event-subscription presence), the reproducible
+walkthrough with the real deployed testnet address, and the honest caveats (MegaFuel is one
+operator; sponsorship policy-gated; self-pay fallback). Link from `docs/start-here.md`.
+
+## Definition of done
+Inherit 00-CONTEXT DoD. Additionally:
+- [ ] PROGRESS: the full two-wallet trail — deployed `WorldMoves` address, move tx hashes from
+ both wallets with block timestamps (sub-second spacing shown), `mode` per tx, and a note
+ that ghosts tracked live. Track-C proof-of-life.
+- [ ] `docs/bnb-world.md` complete; every address/hash real and from your run.
+- [ ] `data/changelog.json`: entry (tag `feature`) — "Real-time on-chain 3D world live on BNB Chain testnet".
+- [ ] Any step that couldn't run on real testnet is named explicitly with the reason.
diff --git a/prompts/bnb-chain/19-bnb-hub-page.md b/prompts/bnb-chain/19-bnb-hub-page.md
new file mode 100644
index 000000000..230b08d90
--- /dev/null
+++ b/prompts/bnb-chain/19-bnb-hub-page.md
@@ -0,0 +1,40 @@
+# 19 — /bnb hub page (the campaign's front door)
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: none** to build the shell; it LINKS to the three tracks and degrades gracefully if
+a track isn't live yet. Best run last, but can ship early with "coming soon" states that
+auto-light-up as tracks land.
+
+## Why
+One landing page that tells the whole BNB Chain story and routes to each track. It's the
+narrative wrapper: three genuinely-unique capabilities, each with a live demo. This is where a
+visitor (or BNB Chain / a grant committee) lands and immediately gets why we built on BNB.
+
+## Build — `/bnb` page
+- Three feature cards, each stating the capability HONESTLY (trace every claim to 00-CONTEXT's
+ verified list — no 20k TPS, no 250ms):
+ 1. **Gasless agent onboarding** → links to gasless registration (03) + payments doc (06).
+ 2. **On-chain-gated 3D vault** → links to `/vault` (12).
+ 3. **Real-time on-chain world** → links to the on-chain mode (16) + `/bnb-latency` (17).
+- Live proof widgets where cheap: embed the BNB live block-average from `probeBlockTime` (01)
+ so the page itself demonstrates 0.45s. Show real counts if easy (agents registered, vault
+ listings, moves recorded) pulled from the respective APIs — real data only, no vanity fakes.
+- Each card: if its track's API/route isn't live yet, a designed "coming soon" state (not a
+ broken link). CLAUDE.md UI bar throughout.
+
+## States
+Track live → card shows the real demo link + a live stat. Track not yet deployed → "coming
+soon" state, no dead link. A stat API down → hide that stat gracefully, keep the card.
+Responsive, a11y, motion-tasteful.
+
+## Tests
+- Pure helpers (stat formatting, track-availability gating) in `tests/`.
+- Manual browser exercise: `npm run dev`, open `/bnb`, confirm the live block-average renders
+ and links resolve (or show coming-soon). Zero console errors. Capture in PROGRESS.
+
+## Definition of done
+Inherit 00-CONTEXT DoD (UI items). Additionally:
+- [ ] `data/pages.json`: register `/bnb` (this feeds sitemap/llms.txt/changelog).
+- [ ] `STRUCTURE.md`: add the BNB hub row (and link the three track surfaces under it).
+- [ ] `data/changelog.json`: entry (tag `feature`) — "BNB Chain hub: three uniquely-BNB demos in one place".
+- [ ] Every capability claim on the page is checked against 00-CONTEXT's verified/refuted lists.
diff --git a/prompts/bnb-chain/20-babt-verification-spike.md b/prompts/bnb-chain/20-babt-verification-spike.md
new file mode 100644
index 000000000..ff6ddc0a3
--- /dev/null
+++ b/prompts/bnb-chain/20-babt-verification-spike.md
@@ -0,0 +1,45 @@
+# 20 — BABT sybil-gating verification spike (settle the open question)
+
+Read `prompts/bnb-chain/00-CONTEXT.md` first, then `/workspaces/three.ws/CLAUDE.md`.
+**Prereqs: none.** Research-first spike; ships a feature ONLY if the capability verifies real.
+
+## Why
+BABT (Binance Account Bound Token) — a non-transferable on-chain token tied to a KYC'd Binance
+account — was a headline "unique to BNB" candidate that our research could NOT confirm
+(00-CONTEXT refuted/unverified list). Before anyone builds sybil-resistance on it, settle
+whether it's real, live, and queryable by a third-party BSC contract in 2026. Truth first;
+code only if warranted.
+
+## Do — verify (this half is mandatory)
+1. Find the real BABT contract on BSC mainnet (SBT-706 / "Binance Account Bound"). Confirm the
+ deployed address via BscScan + an `eth_getCode` check (use `chains.js`). Record the address
+ and the interface (is it ERC-721-ish? a `balanceOf`/`tokenIdOf` gate? non-transferable?).
+2. Determine, concretely: can an arbitrary third-party BSC contract read "does address X hold a
+ BABT?" on-chain, cheaply, today? Is there a testnet deployment (for our normal testnet-first
+ flow) or is it mainnet-only? Any usage terms/restrictions from Binance?
+3. Write the finding into `prompts/bnb-chain/PROGRESS.md` AND a short
+ `docs/bnb-babt-findings.md`: real / not-real, live address, how to gate on it, limitations,
+ and whether it beats Base/Ethereum/Solana sybil-resistance options (Gitcoin Passport, World
+ ID, etc.) — honest comparison.
+
+## Build — ONLY if step 1–2 confirm it's real and third-party-queryable
+- `api/_lib/bnb/babt.js` — `hasBabt(address)` reading the real contract via `chains.js`
+ (mainnet read; note if no testnet exists). Typed result `{ address, holdsBabt, tokenId?, source }`.
+- `GET /api/bnb/babt-check?address=` — free endpoint exposing it, for agents/apps that want a
+ KYC-backed uniqueness signal. Handle unknown/invalid address, contract-unreachable, and the
+ "no testnet" caveat honestly in the response.
+- Tests (`tests/bnb-babt.test.js`): `hasBabt` maps a mocked `balanceOf>0` → true, `=0` → false;
+ endpoint validates input; graceful when the contract read fails.
+
+## If NOT real / not third-party-queryable
+Do NOT build a fake. Ship only the `docs/bnb-babt-findings.md` verdict + PROGRESS note closing
+the open question, and update `00-CONTEXT.md`'s refuted list with the confirmed reason. That
+is a complete, valuable outcome.
+
+## Definition of done
+Inherit 00-CONTEXT DoD. Additionally:
+- [ ] The open question is definitively answered with a real on-chain check (paste the address
+ + `eth_getCode`/`balanceOf` probe result), regardless of whether code shipped.
+- [ ] If shipped: real proof of `hasBabt` against a known BABT holder address (paste it).
+- [ ] If not shipped: `docs/bnb-babt-findings.md` explains exactly why, with sources.
+- [ ] `data/changelog.json`: entry ONLY if a user-visible endpoint shipped (tag `feature`, `security`).
diff --git a/prompts/okx-ai/PROGRESS.md b/prompts/okx-ai/PROGRESS.md
index a9c6c5aa9..9be8b3d7d 100644
--- a/prompts/okx-ai/PROGRESS.md
+++ b/prompts/okx-ai/PROGRESS.md
@@ -6,6 +6,71 @@ Work Order 04 session — no earlier entries existed because no earlier work ord
---
+## 2026-07-07 — Work Order 04 session #2: rail deployed to prod, gauntlet armed, PAUSED on funding
+
+**Outcome: the X Layer / OKX rail is now LIVE on production and every funding-independent
+leg of the gauntlet passes. Presented the consolidated funding request
+([`e2e-evidence/FUNDING-REQUEST.md`](e2e-evidence/FUNDING-REQUEST.md)) and paused per Phase 1.
+No money spent yet — wallet holds 0 on all chains.**
+
+### What changed this session (deploy, not code)
+
+The WO-02/03 code was already in HEAD; it was just never activated in production because the
+X Layer rail env vars were absent (that is what the 2026-07-06 WO-04 NO-GO actually caught).
+Fixed by provisioning prod env + redeploy:
+
+- `X402_PAY_TO_XLAYER = 0x75d00a2713565171f33216e5aa2a375e076ecf69` → Vercel prod.
+- `X402_XLAYER_RELAYER_KEY` → Vercel prod. **Fresh keypair generated this session; address
+ `0x1B60Cb12cE894Efc2470bB18Bf2D41755b49AB2a`; private key lives ONLY in Vercel env +
+ session scratchpad, never committed.** This is the direct-redemption settle path (Path B),
+ used when OKX facilitator creds are absent.
+- `X402_ASSET_ADDRESS_XLAYER` already defaults to USD₮0 in `env.js` — no action.
+- Redeployed prod (a transient "deployment failed, retry later" fired once during the
+ dep-install phase but the build had already completed; the env change is live — confirmed
+ below).
+
+### Verified LIVE against production (evidence in `e2e-evidence/`)
+
+| Check | Result | Evidence |
+|---|---|---|
+| X Layer accept now emitted | `accepts[0]` = `{eip155:196, USD₮0, payTo 0x75d0…cf69, per-service amount}` on all 8 REST services | `01-x402-check-all.txt`, `02/03-*-402*` |
+| Buyer-CLI validation | `onchainos agent x402-check --body '{}'` → `valid:true`, `network:eip155:196` for text-to-3d/pro, image-to-3d, rig, avatar, retarget, pose-seed, fbx-export | `01-x402-check-all.txt` |
+| Free lane (case 1) | health `ok:true` (5 real subsystem probes incl. `payment-rail settleable:true`), catalog lists 11 services | `01-health-*`, `01-catalog-body.json` |
+| Buyer can sign (case 2 leg) | `onchainos payment pay` → `PAYMENT-SIGNATURE`, scheme `exact`, wallet `0x75d0…cf69`, 1168-byte header | `02-pay-attempt.json`, `02-auth-header.txt` |
+| Seller verify path live | real signed header replayed unfunded → `HTTP 402 insufficient_balance` + fresh `eip155:196` challenge (on-chain `balanceOf` ran) | `02-replay-unfunded.json` |
+| Garbage header (case 5d) | → `HTTP 400 invalid_payment` ("X-PAYMENT JSON parse failed"), no crash, no tool run | `05d-garbage-body.txt` |
+
+`payment-rail` health: `settleable:true, facilitator_configured:false, token USD₮0, block ~64.6M`
+— i.e. Path B (relayer) is the active settle route until OKX creds land.
+
+### Funding request presented (Phase 1) — PAUSED here
+
+Buyer == seller (`0x75d0…cf69` both sides) ⇒ settlement is a self-transfer, net-zero, so the
+USD₮0 float is one-time (covers the largest single call, not the sum). Ask:
+- **2.0 USD₮0** → `0x75d0…cf69` on X Layer 196 (floor 0.5 = the avatar flagship).
+- **0.3 OKB** → relayer `0x1B60…AB2a` on X Layer (Path B gas) — OR provide `OKX_API_KEY`/
+ `OKX_SECRET_KEY`/`OKX_PASSPHRASE` for the gasless official-facilitator Path A (recommended,
+ it's the exact rail the OKX reviewer's buyer uses; then no OKB needed).
+- **0.10 USDC + 0.02 SOL** → Solana `9PirGw…fnyc` for case 7 legacy regression.
+
+### Open finding for WO-05/06 (NOT a WO-04 blocker)
+
+**`identity-studio` (WO-06 surface) mis-advertises its rail.** It routes through the shared
+MCP auth path (`handleIdentityStudio` → `authenticateRequest` → `paymentRequirements()`),
+NOT the clean `okxXLayerAccept`+`sendOkx402` path the 8 REST services use. Consequences on
+its live 402: (a) accepts are **Solana-first**, so a buyer / `x402-check` auto-selects the
+Solana rail, not X Layer; (b) the empty-body probe prices the X Layer accept at `1000`
+($0.001), not the catalog's $1.50. Fix belongs in WO-06 (or before WO-05 submits that row)
+and touches shared MCP infra (blast radius = `api/mcp-3d.js` too), so it was deliberately
+NOT changed here. The 8 WO-03 REST services — WO-04's actual targets — are all correct.
+
+### GO/NO-GO
+- **Gauntlet cases 2–7 + settlement: BLOCKED on funding only.** Everything else is proven.
+- **Work Order 05: NO-GO until the gauntlet runs green post-funding** AND the identity-studio
+ rail finding above is resolved (it would otherwise list a Solana-first, mispriced flagship).
+
+---
+
## 2026-07-07 — Work Order 03 re-dispatch: rail DEPLOYED & OKX-validated live — the runtime env blocker is CLEARED
**Outcome: the one thing standing between the merged WO-02/03 code and a passing OKX listing —
diff --git a/prompts/okx-ai/e2e-evidence/01-x402-check-all.txt b/prompts/okx-ai/e2e-evidence/01-x402-check-all.txt
new file mode 100644
index 000000000..ae6567545
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/01-x402-check-all.txt
@@ -0,0 +1,9 @@
+text-to-3d: valid=True net=eip155:196 amt=10000 payTo=0x75d00a2713 err=
+text-to-3d-pro: valid=True net=eip155:196 amt=300000 payTo=0x75d00a2713 err=
+image-to-3d: valid=True net=eip155:196 amt=300000 payTo=0x75d00a2713 err=
+rig: valid=True net=eip155:196 amt=250000 payTo=0x75d00a2713 err=
+avatar: valid=True net=eip155:196 amt=500000 payTo=0x75d00a2713 err=
+retarget: valid=True net=eip155:196 amt=100000 payTo=0x75d00a2713 err=
+pose-seed: valid=True net=eip155:196 amt=20000 payTo=0x75d00a2713 err=
+fbx-export: valid=True net=eip155:196 amt=100000 payTo=0x75d00a2713 err=
+identity-studio: valid=True net=solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp amt=1000 payTo=wwwwwDxFWRn7 err=
diff --git a/prompts/okx-ai/e2e-evidence/02-auth-header.txt b/prompts/okx-ai/e2e-evidence/02-auth-header.txt
new file mode 100644
index 000000000..455586af0
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/02-auth-header.txt
@@ -0,0 +1 @@
+eyJhY2NlcHRlZCI6eyJhbW91bnQiOiIxMDAwMCIsImFzc2V0IjoiMHg3NzlkZWQwYzllMTAyMjIyNWY4ZTA2MzBiMzVhOWI1NGJlNzEzNzM2IiwiZXh0cmEiOnsiZGVjaW1hbHMiOjYsIm5hbWUiOiJVU0Tigq4wIiwic3ltYm9sIjoiVVNEVCIsInRyYW5zZmVyTWV0aG9kIjoiZWlwMzAwOSIsInZlcnNpb24iOiIxIn0sIm1heFRpbWVvdXRTZWNvbmRzIjo4NjQwMCwibmV0d29yayI6ImVpcDE1NToxOTYiLCJwYXlUbyI6IjB4NzVkMDBhMjcxMzU2NTE3MWYzMzIxNmU1YWEyYTM3NWUwNzZlY2Y2OSIsInJlc291cmNlIjoiaHR0cHM6Ly90aHJlZS53cy9hcGkvb2t4LzNkL3RleHQtdG8tM2QiLCJzY2hlbWUiOiJleGFjdCJ9LCJwYXlsb2FkIjp7ImF1dGhvcml6YXRpb24iOnsiZnJvbSI6IjB4NzVkMDBhMjcxMzU2NTE3MWYzMzIxNmU1YWEyYTM3NWUwNzZlY2Y2OSIsIm5vbmNlIjoiMHhmNmNhOGYwMGNkNGQ3NWYyNmU1NGU0NTg0OTc2YjcxZWNhMTllODRhMTg3M2NhMWVlNzVhODI4MzlhMjZkZGFiIiwidG8iOiIweDc1ZDAwYTI3MTM1NjUxNzFmMzMyMTZlNWFhMmEzNzVlMDc2ZWNmNjkiLCJ2YWxpZEFmdGVyIjoiMCIsInZhbGlkQmVmb3JlIjoiMTc4MzUwOTgwMSIsInZhbHVlIjoiMTAwMDAifSwic2lnbmF0dXJlIjoiMHhhYzk3ODJlYjEzOWZjNWVkMmMyNmYxNzJlYWI5ZjJjZmM3YWYyNmY4MmNkNjE4N2ViYjE1NzBjNDA2YzUzODI4MWRiNmYwYmExNThhZDdhMzRkYjIwN2JiYTY1MDA2NGI2OGI1NzEwOWNjNGJlMDNmNjgwNjkyYmEyYjVjMzI4NTFiIn0sInJlc291cmNlIjp7Im1pbWVUeXBlIjoiYXBwbGljYXRpb24vanNvbiIsInVybCI6Imh0dHBzOi8vdGhyZWUud3MvYXBpL29reC8zZC90ZXh0LXRvLTNkIn0sIng0MDJWZXJzaW9uIjoyfQ==
\ No newline at end of file
diff --git a/prompts/okx-ai/e2e-evidence/02-pay-attempt.json b/prompts/okx-ai/e2e-evidence/02-pay-attempt.json
new file mode 100644
index 000000000..c4d90cd86
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/02-pay-attempt.json
@@ -0,0 +1,9 @@
+{
+ "ok": true,
+ "data": {
+ "authorization_header": "eyJhY2NlcHRlZCI6eyJhbW91bnQiOiIxMDAwMCIsImFzc2V0IjoiMHg3NzlkZWQwYzllMTAyMjIyNWY4ZTA2MzBiMzVhOWI1NGJlNzEzNzM2IiwiZXh0cmEiOnsiZGVjaW1hbHMiOjYsIm5hbWUiOiJVU0Tigq4wIiwic3ltYm9sIjoiVVNEVCIsInRyYW5zZmVyTWV0aG9kIjoiZWlwMzAwOSIsInZlcnNpb24iOiIxIn0sIm1heFRpbWVvdXRTZWNvbmRzIjo4NjQwMCwibmV0d29yayI6ImVpcDE1NToxOTYiLCJwYXlUbyI6IjB4NzVkMDBhMjcxMzU2NTE3MWYzMzIxNmU1YWEyYTM3NWUwNzZlY2Y2OSIsInJlc291cmNlIjoiaHR0cHM6Ly90aHJlZS53cy9hcGkvb2t4LzNkL3RleHQtdG8tM2QiLCJzY2hlbWUiOiJleGFjdCJ9LCJwYXlsb2FkIjp7ImF1dGhvcml6YXRpb24iOnsiZnJvbSI6IjB4NzVkMDBhMjcxMzU2NTE3MWYzMzIxNmU1YWEyYTM3NWUwNzZlY2Y2OSIsIm5vbmNlIjoiMHhmNmNhOGYwMGNkNGQ3NWYyNmU1NGU0NTg0OTc2YjcxZWNhMTllODRhMTg3M2NhMWVlNzVhODI4MzlhMjZkZGFiIiwidG8iOiIweDc1ZDAwYTI3MTM1NjUxNzFmMzMyMTZlNWFhMmEzNzVlMDc2ZWNmNjkiLCJ2YWxpZEFmdGVyIjoiMCIsInZhbGlkQmVmb3JlIjoiMTc4MzUwOTgwMSIsInZhbHVlIjoiMTAwMDAifSwic2lnbmF0dXJlIjoiMHhhYzk3ODJlYjEzOWZjNWVkMmMyNmYxNzJlYWI5ZjJjZmM3YWYyNmY4MmNkNjE4N2ViYjE1NzBjNDA2YzUzODI4MWRiNmYwYmExNThhZDdhMzRkYjIwN2JiYTY1MDA2NGI2OGI1NzEwOWNjNGJlMDNmNjgwNjkyYmEyYjVjMzI4NTFiIn0sInJlc291cmNlIjp7Im1pbWVUeXBlIjoiYXBwbGljYXRpb24vanNvbiIsInVybCI6Imh0dHBzOi8vdGhyZWUud3MvYXBpL29reC8zZC90ZXh0LXRvLTNkIn0sIng0MDJWZXJzaW9uIjoyfQ==",
+ "header_name": "PAYMENT-SIGNATURE",
+ "scheme": "exact",
+ "wallet": "0x75d00a2713565171f33216e5aa2a375e076ecf69"
+ }
+}
diff --git a/prompts/okx-ai/e2e-evidence/02-replay-unfunded.json b/prompts/okx-ai/e2e-evidence/02-replay-unfunded.json
new file mode 100644
index 000000000..c78e27fa0
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/02-replay-unfunded.json
@@ -0,0 +1 @@
+{"x402Version":2,"error":"insufficient_balance","resource":{"url":"https://three.ws/api/okx/3d/text-to-3d","mimeType":"application/json"},"accepts":[{"scheme":"exact","network":"eip155:196","amount":"10000","payTo":"0x75d00a2713565171f33216e5aa2a375e076ecf69","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":"PayeRNCipcerPHCsYMTrX9pAYDm1LnPGzgb66NUDG5a"}}]}
\ No newline at end of file
diff --git a/prompts/okx-ai/e2e-evidence/02-text-to-3d-402-body.json b/prompts/okx-ai/e2e-evidence/02-text-to-3d-402-body.json
new file mode 100644
index 000000000..c1b7dddb2
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/02-text-to-3d-402-body.json
@@ -0,0 +1 @@
+{"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":"0x75d00a2713565171f33216e5aa2a375e076ecf69","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":"PayeRNCipcerPHCsYMTrX9pAYDm1LnPGzgb66NUDG5a"}}]}
diff --git a/prompts/okx-ai/e2e-evidence/02-text-to-3d-unpaid-402.txt b/prompts/okx-ai/e2e-evidence/02-text-to-3d-unpaid-402.txt
new file mode 100644
index 000000000..7bc105895
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/02-text-to-3d-unpaid-402.txt
@@ -0,0 +1,21 @@
+HTTP/2 402
+access-control-allow-headers: authorization, content-type, mcp-session-id, mcp-protocol-version, x-payment, payment-signature, idempotency-key, x-irl-device, x-irl-fix, x-forge-client, x-forge-seed
+access-control-allow-methods: GET,HEAD,POST,DELETE,OPTIONS
+access-control-allow-origin: *
+access-control-expose-headers: PAYMENT-REQUIRED, PAYMENT-RESPONSE
+access-control-max-age: 86400
+cache-control: no-store
+content-security-policy: base-uri 'self'; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://unpkg.com https://esm.sh https://ajax.googleapis.com https://s3.tradingview.com https://platform.twitter.com https://3d-agent.vercel.app https://three.ws; worker-src 'self' blob:; frame-ancestors 'self' https://ibm.com https://*.ibm.com https://*.seismic.com; report-uri /api/client-errors
+content-type: application/json; charset=utf-8
+date: Tue, 07 Jul 2026 11:23:06 GMT
+payment-required: eyJ4NDAyVmVyc2lvbiI6MiwicmVzb3VyY2UiOnsidXJsIjoiaHR0cHM6Ly90aHJlZS53cy9hcGkvb2t4LzNkL3RleHQtdG8tM2QiLCJtaW1lVHlwZSI6ImFwcGxpY2F0aW9uL2pzb24ifSwiYWNjZXB0cyI6W3sic2NoZW1lIjoiZXhhY3QiLCJuZXR3b3JrIjoiZWlwMTU1OjE5NiIsImFtb3VudCI6IjEwMDAwIiwicGF5VG8iOiIweDc1ZDAwYTI3MTM1NjUxNzFmMzMyMTZlNWFhMmEzNzVlMDc2ZWNmNjkiLCJtYXhUaW1lb3V0U2Vjb25kcyI6ODY0MDAsImFzc2V0IjoiMHg3NzlkZWQwYzllMTAyMjIyNWY4ZTA2MzBiMzVhOWI1NGJlNzEzNzM2IiwicmVzb3VyY2UiOiJodHRwczovL3RocmVlLndzL2FwaS9va3gvM2QvdGV4dC10by0zZCIsImV4dHJhIjp7InN5bWJvbCI6IlVTRFQiLCJuYW1lIjoiVVNE4oKuMCIsInZlcnNpb24iOiIxIiwidHJhbnNmZXJNZXRob2QiOiJlaXAzMDA5IiwiZGVjaW1hbHMiOjZ9fSx7InNjaGVtZSI6ImV4YWN0IiwibmV0d29yayI6InNvbGFuYTo1ZXlrdDRVc0Z2OFA4TkpkVFJFcFkxdnpxS3FaS3ZkcCIsImFtb3VudCI6IjEwMDAwIiwicGF5VG8iOiJ3d3d3d0R4RldSbjdncmdyM0VzcnNnNUM2TnZEb0RIU0E0Z2FDZmZjY3JVIiwiYXNzZXQiOiJFUGpGV2RkNUF1ZnFTU3FlTTJxTjF4enliYXBDOEc0d0VHR2tad3lURHQxdiIsIm1heFRpbWVvdXRTZWNvbmRzIjo2MCwicmVzb3VyY2UiOiJodHRwczovL3RocmVlLndzL2FwaS9va3gvM2QvdGV4dC10by0zZCIsImV4dHJhIjp7Im5hbWUiOiJVU0RDIiwiZGVjaW1hbHMiOjYsImZlZVBheWVyIjoiUGF5ZVJOQ2lwY2VyUEhDc1lNVHJYOXBBWURtMUxuUEd6Z2I2Nk5VREc1YSJ9fV19
+permissions-policy: accelerometer=(), autoplay=(self), bluetooth=(), camera=(), display-capture=(), encrypted-media=(self), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=(self), serial=(), usb=(), xr-spatial-tracking=(self)
+referrer-policy: strict-origin-when-cross-origin
+server: Vercel
+strict-transport-security: max-age=63072000; includeSubDomains; preload
+x-content-type-options: nosniff
+x-vercel-cache: MISS
+x-vercel-id: sfo1::iad1::kk96v-1783423386709-0abe6a1b83a9
+content-length: 825
+
+{"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":"0x75d00a2713565171f33216e5aa2a375e076ecf69","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":"PayeRNCipcerPHCsYMTrX9pAYDm1LnPGzgb66NUDG5a"}}]}
\ No newline at end of file
diff --git a/prompts/okx-ai/e2e-evidence/03-avatar-unpaid-402.json b/prompts/okx-ai/e2e-evidence/03-avatar-unpaid-402.json
new file mode 100644
index 000000000..c9e21df73
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/03-avatar-unpaid-402.json
@@ -0,0 +1 @@
+{"x402Version":2,"resource":{"url":"https://three.ws/api/okx/3d/avatar","mimeType":"application/json"},"accepts":[{"scheme":"exact","network":"eip155:196","amount":"500000","payTo":"0x75d00a2713565171f33216e5aa2a375e076ecf69","maxTimeoutSeconds":86400,"asset":"0x779ded0c9e1022225f8e0630b35a9b54be713736","resource":"https://three.ws/api/okx/3d/avatar","extra":{"symbol":"USDT","name":"USD₮0","version":"1","transferMethod":"eip3009","decimals":6}},{"scheme":"exact","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","amount":"500000","payTo":"wwwwwDxFWRn7grgr3Esrsg5C6NvDoDHSA4gaCffccrU","asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","maxTimeoutSeconds":60,"resource":"https://three.ws/api/okx/3d/avatar","extra":{"name":"USDC","decimals":6,"feePayer":"PayeRNCipcerPHCsYMTrX9pAYDm1LnPGzgb66NUDG5a"}}]}
\ No newline at end of file
diff --git a/prompts/okx-ai/e2e-evidence/05d-garbage-body.json b/prompts/okx-ai/e2e-evidence/05d-garbage-body.json
new file mode 100644
index 000000000..e4168f6cf
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/05d-garbage-body.json
@@ -0,0 +1 @@
+{"error":"invalid_payment","error_description":"X-PAYMENT JSON parse failed: Unexpected token '�', \"���j\u0007�׿7�m�ۏ\" is not valid JSON"}
\ No newline at end of file
diff --git a/prompts/okx-ai/e2e-evidence/05d-garbage-header.txt b/prompts/okx-ai/e2e-evidence/05d-garbage-header.txt
new file mode 100644
index 000000000..cca870e0a
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/05d-garbage-header.txt
@@ -0,0 +1,20 @@
+HTTP/2 400
+access-control-allow-headers: authorization, content-type, mcp-session-id, mcp-protocol-version, x-payment, payment-signature, idempotency-key, x-irl-device, x-irl-fix, x-forge-client, x-forge-seed
+access-control-allow-methods: GET,HEAD,POST,DELETE,OPTIONS
+access-control-allow-origin: *
+access-control-expose-headers: PAYMENT-REQUIRED, x-payment-response, x-payment-network, x-payment-tx, link
+access-control-max-age: 86400
+cache-control: no-store
+content-security-policy: base-uri 'self'; object-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://cdn.jsdelivr.net https://cdnjs.cloudflare.com https://unpkg.com https://esm.sh https://ajax.googleapis.com https://s3.tradingview.com https://platform.twitter.com https://3d-agent.vercel.app https://three.ws; worker-src 'self' blob:; frame-ancestors 'self' https://ibm.com https://*.ibm.com https://*.seismic.com; report-uri /api/client-errors
+content-type: application/json; charset=utf-8
+date: Tue, 07 Jul 2026 11:23:07 GMT
+permissions-policy: accelerometer=(), autoplay=(self), bluetooth=(), camera=(), display-capture=(), encrypted-media=(self), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=(self), serial=(), usb=(), xr-spatial-tracking=(self)
+referrer-policy: strict-origin-when-cross-origin
+server: Vercel
+strict-transport-security: max-age=63072000; includeSubDomains; preload
+x-content-type-options: nosniff
+x-frame-options: DENY
+x-vercel-cache: MISS
+x-vercel-id: sfo1::iad1::glfgb-1783423387298-79b772bbacf2
+content-length: 148
+
diff --git a/prompts/okx-ai/e2e-evidence/FUNDING-REQUEST.md b/prompts/okx-ai/e2e-evidence/FUNDING-REQUEST.md
new file mode 100644
index 000000000..c931f5cd5
--- /dev/null
+++ b/prompts/okx-ai/e2e-evidence/FUNDING-REQUEST.md
@@ -0,0 +1,61 @@
+# Work Order 04 — Consolidated funding request (2026-07-07)
+
+All preconditions are met and every funding-independent leg passes against production
+(`https://three.ws/api/okx/3d/*`). The gauntlet's paid legs are blocked ONLY on funds.
+This file is the exact ask; amounts are computed, not padded.
+
+## Key fact that shrinks the ask: buyer == seller
+
+The `onchainos` TEE buyer wallet and our seller `payTo` are the SAME address
+`0x75d00a2713565171f33216e5aa2a375e076ecf69` on every EVM chain. An EIP-3009
+`transferWithAuthorization` therefore moves USD₮0 from this address back to itself — a
+**self-transfer, net-zero balance change**. So the USD₮0 float is NOT consumed per call:
+it only has to satisfy the seller's on-chain `balanceOf >= amount` verify check for the
+single most expensive call. One top-up covers the entire gauntlet plus retries.
+
+## The request
+
+### 1. USD₮0 float — REQUIRED
+| | |
+|---|---|
+| To | `0x75d00a2713565171f33216e5aa2a375e076ecf69` |
+| Chain | X Layer mainnet, chainId **196** (`eip155:196`) |
+| Token | USD₮0 `0x779Ded0c9e1022225f8E0630b35a9b54bE713736` (6 decimals) |
+| Amount | **2.0 USD₮0** (2,000,000 atomic) |
+| Floor | 0.5 USD₮0 (covers the flagship avatar $0.50); 2.0 gives headroom for the $1.50 identity-studio + all retries |
+
+### 2. Settlement gas OR facilitator creds — pick ONE path
+
+**Path B (default, already wired — direct relayer redemption):**
+| | |
+|---|---|
+| To | `0x1B60Cb12cE894Efc2470bB18Bf2D41755b49AB2a` (fresh relayer keypair; private key is in Vercel prod env `X402_XLAYER_RELAYER_KEY`, never committed) |
+| Chain | X Layer mainnet, chainId 196 |
+| Token | **OKB** (native gas) |
+| Amount | **0.3 OKB** (each settle = 1 `transferWithAuthorization` tx ~80k gas; ~15–20 txs incl. retries ≪ 0.1 OKB — 0.3 is buffer) |
+
+**Path A (recommended for WO-05 de-risk — official OKX facilitator, gasless):**
+Provision from the OKX Web3 developer console and set in Vercel prod env:
+`OKX_API_KEY`, `OKX_SECRET_KEY`, `OKX_PASSPHRASE`. This routes verify/settle through
+`https://web3.okx.com/api/v6/pay/x402/*` — the exact path an OKX marketplace buyer (and the
+listing reviewer) uses. Facilitator sponsors gas, so **no OKB needed** if this is provided.
+Path B still runs as fallback and produces a real on-chain tx either way.
+
+### 3. Legacy-rail regression (case 7) — Solana — REQUIRED for that one case
+| | |
+|---|---|
+| To | `9PirGw9wVLLNFgVyjgAt5jvuFQwJ3pYUBWt9n3vZfnyc` (our TEE Solana wallet) |
+| Token | USDC SPL `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` |
+| Amount | **0.10 USDC** + **0.02 SOL** (gas / ATA rent; the Solana accept sets a feePayer sponsor so SOL may be unused, 0.02 insures it) |
+
+## Total to send
+- **2.0 USD₮0** → `0x75d0…cf69` (X Layer)
+- **0.3 OKB** → `0x1B60…AB2a` (X Layer) *(skip if providing OKX creds instead)*
+- **0.10 USDC + 0.02 SOL** → `9PirGw…fnyc` (Solana)
+
+≈ **$2.10 of stablecoin + ~$0.3 gas**. Everything above cost, one-time float (self-transfer).
+
+## What runs the moment funds land
+Cases 2 (text-to-3d $0.01), 3 (avatar $0.50, skeleton-verified), 4 (on-chain settlement tx
+capture), 5a/b/c (replay / tampered-amount / stale-challenge), 6 (pay-only-on-success), 7
+(Solana legacy). Full gauntlet, individually, against production.
diff --git a/prompts/store-submissions/_generated/TRACKER.md b/prompts/store-submissions/_generated/TRACKER.md
index adb108ba8..88407b4df 100644
--- a/prompts/store-submissions/_generated/TRACKER.md
+++ b/prompts/store-submissions/_generated/TRACKER.md
@@ -14,7 +14,7 @@ Legend: **not-started** | **blocked** | **ready-to-submit** | **submitted** | **
| **Claude plugin marketplace** | not-started | 10 | Plugin install test not yet run end-to-end; `three-ws-3d` plugin not yet created | — |
| **Claude Agent Skills pack** | not-started | 11 | 3D-creation skills (`generate-3d-model`, `create-3d-avatar`, `rig-a-model`) not yet added | — |
| **OpenAI App Directory** | not-started | 04–06 | `/api/mcp-studio` free endpoint not yet built (prompt 04); GLB viewer component not yet built (prompt 05); `[HUMAN: OpenAI developer identity verification required]` | — |
-| **OpenAI GPT Store** | not-started | 12 | OpenAPI 3.1 Actions schema not yet written; `[HUMAN: GPT builder config must be pasted manually; identity verification required]` | — |
+| **OpenAI GPT Store** | ready-to-build | 12 | `/api/3d/studio` free REST Actions lane built + live-verified (real GLB, safety gate, zero crypto/PII); `_generated/openai-actions.yaml` lints clean; `_generated/openai-gpt-config.md` complete; `[HUMAN: paste config into GPT builder, upload icon-512x512.png, verify Builder Profile, submit]` | — |
| **Official MCP Registry** | ready-to-submit | 13 | `server.json` manifests verified clean; `[HUMAN: Run mcp-publisher commands (staged in prompt 13 output) — do not publish without explicit operator approval]` | https://registry.modelcontextprotocol.io/?q=io.github.nirholas |
| **Smithery** | not-started | 13 | Listing doc not yet written | — |
| **Glama** | not-started | 13 | Listing doc not yet written | — |
@@ -40,7 +40,7 @@ Legend: **not-started** | **blocked** | **ready-to-submit** | **submitted** | **
| 09 | Conversational remixable 3D | ⬜ not started | Iterate-by-chat + royalty wiring |
| 10 | Claude plugin marketplace | ⬜ not started | 4 installable plugins |
| 11 | Agent Skills pack | ⬜ not started | Hardened skills + 3D-creation skills |
-| 12 | OpenAI GPT Store Actions | ⬜ not started | `_generated/openai-actions.yaml` + GPT config |
+| 12 | OpenAI GPT Store Actions | ✅ built | `api/3d/studio.js` + `_generated/openai-actions.yaml` (lints clean) + `_generated/openai-gpt-config.md` |
| 13 | MCP registries & directories | ⬜ not started | `_generated/mcp-directories/` + canonical metadata |
| 16 | Tokenized 3D NFT | ⬜ not started | `mint_3d_asset` + `get_3d_asset_onchain` tools |
| 17 | Embodied on-chain identity | ⬜ not started | Persona↔wallet binding + visual chain state |
diff --git a/prompts/store-submissions/_generated/build-mcp-directory-docs.mjs b/prompts/store-submissions/_generated/build-mcp-directory-docs.mjs
new file mode 100644
index 000000000..a1965aa55
--- /dev/null
+++ b/prompts/store-submissions/_generated/build-mcp-directory-docs.mjs
@@ -0,0 +1,245 @@
+// Generate one ready-to-submit listing doc per third-party MCP directory,
+// derived entirely from mcp-listing-source.json (the canonical source) so copy
+// never drifts. Directory-specific submission flow (fetched July 2026) lives in
+// the DIRECTORIES table below.
+//
+// Run: node prompts/store-submissions/_generated/build-mcp-directory-docs.mjs
+import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
+import { dirname, join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const HERE = dirname(fileURLToPath(import.meta.url));
+const SRC = JSON.parse(readFileSync(join(HERE, 'mcp-listing-source.json'), 'utf8'));
+const OUT = join(HERE, 'mcp-directories');
+mkdirSync(OUT, { recursive: true });
+
+const byName = Object.fromEntries(SRC.servers.map((s) => [s.name, s]));
+// Headline order: the two flagship remotes, the free lane, then the headline npm servers.
+const HEADLINE = [
+ 'io.github.nirholas/three.ws',
+ 'io.github.nirholas/threews-3d-studio',
+ 'io.github.nirholas/threews-3d-studio-free',
+ 'io.github.nirholas/threews-agent',
+ 'io.github.nirholas/threews-x402-bazaar',
+ 'io.github.nirholas/x402-mcp',
+ 'io.github.nirholas/three-token-mcp',
+ 'io.github.nirholas/pumpfun-solana-mcp',
+ 'io.github.nirholas/ibm-x402-mcp-remote',
+].map((n) => byName[n]).filter(Boolean);
+
+const remotes = SRC.servers.filter((s) => s.type === 'remote');
+const stdio = SRC.servers.filter((s) => s.type === 'stdio');
+
+function connectSnippet(s) {
+ if (s.type === 'remote') return s.connect;
+ return s.connect;
+}
+function claudeConfig(s) {
+ if (s.type === 'remote') {
+ return JSON.stringify({ mcpServers: { [s.title.replace(/\s+/g, '-').toLowerCase()]: { url: s.connect } } }, null, 2);
+ }
+ const [cmd, ...args] = s.connect.split(' ');
+ return JSON.stringify({ mcpServers: { [s.npmPackage.split('/').pop()]: { command: cmd, args } } }, null, 2);
+}
+
+function headlineTable() {
+ let t = '| Server | Name (registry) | Connect | What it does |\n|---|---|---|---|\n';
+ for (const s of HEADLINE) {
+ t += `| **${s.title}** | \`${s.name}\` | ${s.type === 'remote' ? '`' + s.connect + '`' : '`' + s.connect + '`'} | ${s.tagline} |\n`;
+ }
+ return t;
+}
+
+function fullList() {
+ let t = '';
+ t += `\n### All ${remotes.length} hosted remote servers (Streamable HTTP — connect by URL)\n\n`;
+ t += '| Name (registry) | Title | URL | Category |\n|---|---|---|---|\n';
+ for (const s of remotes) t += `| \`${s.name}\` | ${s.title} | ${s.connect} | ${s.category} |\n`;
+ t += `\n### All ${stdio.length} install-and-run servers (stdio — \`npx\`)\n\n`;
+ t += '| Name (registry) | Title | Connect | Category |\n|---|---|---|---|\n';
+ for (const s of stdio) t += `| \`${s.name}\` | ${s.title} | \`${s.connect}\` | ${s.category} |\n`;
+ return t;
+}
+
+const HDR = (dir) => `<!-- GENERATED by build-mcp-directory-docs.mjs from mcp-listing-source.json — do not hand-edit; edit the canonical source + regenerate. -->
+
+# ${dir.title} — three.ws MCP submission package
+
+**Publisher:** ${SRC.publisher.name} · ${SRC.publisher.website} · \`${SRC.publisher.namespace}\` namespace
+**Repository:** ${SRC.publisher.repository}
+**Contact:** ${SRC.publisher.contactEmail}
+**Icon:** ${SRC.publisher.icon}
+**Official MCP registry:** ${SRC.publisher.officialRegistrySearch}
+**Coverage:** ${SRC.counts.total} servers — ${SRC.counts.remote} hosted remote (Streamable HTTP) + ${SRC.counts.stdio} install-and-run (npm/stdio).
+
+> Every field below is derived from \`mcp-listing-source.json\`. If a value looks stale, fix the manifest or the overlay and re-run the generators — never hand-edit this file.
+
+`;
+
+function exampleBlock(s) {
+ return s.examplePrompts.map((p) => ` - "${p}"`).join('\n');
+}
+
+// -------- Directory-specific bodies --------
+const DIRECTORIES = {
+ smithery: {
+ title: 'Smithery',
+ body: () => `## How to submit (fetched 2026-07 from smithery.ai/docs/build/publish)
+
+Smithery is publisher-driven — publish by **URL** (hosted remote) or **MCPB bundle** (stdio), then Smithery auto-scans the server and introspects its tools.
+
+- **Web:** https://smithery.ai/new — paste the server's public HTTPS URL.
+- **CLI (remote):** \`smithery mcp publish "<url>" -n <namespace/name>\`
+- **CLI (stdio bundle):** \`smithery mcp publish ./server.mcpb -n <namespace/name>\`
+- After publishing, complete **Settings → Verification** on each server page for official-vendor status.
+- If auto-scan fails, serve a static card at \`/.well-known/mcp/server-card.json\` (\`serverInfo.name\`/\`version\` required).
+
+**[HUMAN: needs a Smithery account (GitHub OAuth) to publish under the \`three-ws\` namespace.]**
+**[HUMAN: the two flagship remotes require OAuth/x402; Smithery's Gateway handles client registration automatically for URL-based servers — no client registration needed on our side.]**
+
+## Lead with these (URL-publish, no install)
+
+${headlineTable()}
+
+## Per-server listing copy
+
+${HEADLINE.map((s) => `### ${s.title}
+- **Registry name:** \`${s.name}\`
+- **Type:** ${s.type === 'remote' ? 'Remote (Streamable HTTP) — publish by URL' : 'Local (stdio) — publish as MCPB bundle or npm'}
+- **Connect:** \`${connectSnippet(s)}\`
+- **Tagline:** ${s.tagline}
+- **Category:** ${s.category} · **Tags:** ${s.tags.join(', ')}
+- **Description:** ${s.description}
+- **Example prompts:**
+${exampleBlock(s)}
+${s.requiredEnv.length ? `- **Required env:** ${s.requiredEnv.join(', ')}` : ''}`).join('\n\n')}
+
+## Full catalog to publish
+${fullList()}`,
+ },
+ glama: {
+ title: 'Glama',
+ body: () => `## How to submit (fetched 2026-07 from glama.ai/mcp/methodology)
+
+Glama **ingests the official MCP registry automatically**, so publishing \`server.json\` to registry.modelcontextprotocol.io is the primary path — every \`${SRC.publisher.namespace}/*\` entry gets picked up and sandbox-analyzed. Then **claim** each listing to control its metadata:
+
+- **npm/stdio servers:** commit a \`glama.json\` at the **repo root**:
+\`\`\`json
+{
+ "$schema": "https://glama.ai/mcp/schemas/server.json",
+ "maintainers": ["nirholas"]
+}
+\`\`\`
+- **Hosted remotes:** serve \`/.well-known/glama.json\` on three.ws:
+\`\`\`json
+{
+ "$schema": "https://glama.ai/mcp/schemas/connector.json",
+ "maintainers": [{ "email": "${SRC.publisher.contactEmail}" }]
+}
+\`\`\`
+- Or use **Add Server** on https://glama.ai/mcp/servers (GitHub OAuth; Glama verifies repo write access).
+
+**[HUMAN: sign in to Glama with the \`nirholas\` GitHub account and either merge \`glama.json\` (repo root) or confirm the \`/.well-known/glama.json\` claim for the remotes.]**
+
+## Lead with these
+
+${headlineTable()}
+
+## Claim files (ready to commit / serve)
+- Repo root \`glama.json\` → maintainers \`["nirholas"]\`
+- \`https://three.ws/.well-known/glama.json\` → connector schema, maintainer \`${SRC.publisher.contactEmail}\`
+
+## Full catalog (auto-ingested from the official registry)
+${fullList()}`,
+ },
+ 'mcp-so': {
+ title: 'mcp.so',
+ body: () => `## How to submit (fetched 2026-07)
+
+mcp.so is submission-driven (no confirmed auto-ingest of the official registry):
+- **Site form:** the **Submit** button on https://mcp.so (self-serve, anonymous).
+- **GitHub issue:** comment on https://github.com/chatmcp/mcpso/issues/1 ("Submit Your MCP Servers here") or open a per-server issue with repo URL + description.
+
+**[HUMAN: submit via the mcp.so form or the chatmcp/mcpso issue — a GitHub account covers the issue route.]**
+
+Fields mcp.so expects per server: **name, GitHub repo, description, website, transport (streamable-http vs stdio), endpoint URL (remotes) or \`npx\` command (stdio), icon, and a Claude/Cursor config snippet.**
+
+## Lead with these
+
+${headlineTable()}
+
+## Per-server submission rows (headline set)
+
+${HEADLINE.map((s) => `### ${s.title}
+- **Name:** ${s.title} · **Registry name:** \`${s.name}\`
+- **Repo:** ${s.repository} · **Website:** ${s.websiteUrl} · **Icon:** ${s.icon}
+- **Transport:** ${s.transport}
+- **${s.type === 'remote' ? 'Endpoint URL' : 'Install command'}:** \`${s.connect}\`
+- **Description:** ${s.description}
+- **Tags:** ${s.tags.join(', ')}
+- **Claude/Cursor config:**
+\`\`\`json
+${claudeConfig(s)}
+\`\`\`
+- **Example prompts:**
+${exampleBlock(s)}`).join('\n\n')}
+
+## Full catalog to submit
+${fullList()}`,
+ },
+ pulsemcp: {
+ title: 'PulseMCP',
+ body: () => `## How to submit (fetched 2026-07 from pulsemcp.com/submit)
+
+PulseMCP **ingests the official MCP Registry daily and processes weekly** — so publishing \`server.json\` to registry.modelcontextprotocol.io lists us on PulseMCP with **no manual action**. To nudge or correct:
+- **Submit form:** https://www.pulsemcp.com/submit — pick "MCP Server", paste a GitHub repo / subfolder / website URL. No account required.
+- **Adjustments / faster processing:** email **[email protected]** once the registry entry is live.
+
+**[HUMAN: no account needed. Optional — submit ${SRC.publisher.repository} at pulsemcp.com/submit to speed indexing, or email [email protected] for listing edits.]**
+
+Because PulseMCP is registry-driven, the highest-leverage action is keeping the official registry current (see the republish commands in \`../mcp-registry-republish.sh\`). Every \`${SRC.publisher.namespace}/*\` server flows through automatically.
+
+## Lead with these
+
+${headlineTable()}
+
+## Full catalog (auto-ingested — verify these appear after each registry publish)
+${fullList()}`,
+ },
+ lobehub: {
+ title: 'LobeHub',
+ body: () => `## How to submit (fetched 2026-07)
+
+LobeHub runs **two** systems — MCP servers go through the **MCP Marketplace**, not the legacy plugin index:
+
+**A. MCP Marketplace — https://lobehub.com/mcp** (the correct path for all ${SRC.counts.total} servers):
+- **Primary:** the **Submit** modal on https://lobehub.com/mcp (login + Cloudflare Turnstile).
+- **Fallback (modal is flaky):** open a \`[Request] Add <server> to the MCP marketplace\` issue on https://github.com/lobehub/lobehub with: GitHub repo URL, publisher, license, **official MCP Registry entry ID** (e.g. \`${byName['io.github.nirholas/three.ws'].name}\` + version), transport, endpoint URL, auth scheme, and tool count.
+
+**[HUMAN: sign in to lobehub.com with GitHub for the Submit modal, or file the lobehub/lobehub issue. Reference our registry entry IDs (below).]**
+
+**B. Legacy LobeChat plugin (function-calling, NOT MCP):** the self-hosted \`public/lobehub/plugin.json\` manifest — reconciled in this pass — powers the embodied-avatar chat plugin via https://github.com/lobehub/lobe-chat-plugins (fork → add manifest → PR). It does **not** list us in the MCP marketplace; keep it for the LobeChat plugin surface only.
+
+## Lead with these (MCP marketplace)
+
+${headlineTable()}
+
+## Registry entry IDs to cite in the LobeHub submission
+
+${HEADLINE.map((s) => `- **${s.title}** — \`${s.name}@${s.version}\` · transport: ${s.transport} · ${s.type === 'remote' ? 'endpoint ' + s.connect : 'stdio ' + s.connect} · tags: ${s.tags.join(', ')}`).join('\n')}
+
+## Legacy LobeChat plugin manifest (surface B)
+- Hosted at: https://three.ws/lobehub/plugin.json (source: \`public/lobehub/plugin.json\`)
+- Identifier: \`3d-agent\` · embodied 3D avatar with render/speak/gesture/emote tools.
+
+## Full MCP catalog to submit
+${fullList()}`,
+ },
+};
+
+for (const [slug, d] of Object.entries(DIRECTORIES)) {
+ const md = HDR(d) + d.body() + '\n';
+ writeFileSync(join(OUT, `${slug}.md`), md);
+ console.log('Wrote', join('mcp-directories', `${slug}.md`));
+}
+console.log('Done —', Object.keys(DIRECTORIES).length, 'directory docs from', SRC.counts.total, 'servers.');
diff --git a/prompts/store-submissions/_generated/build-mcp-listing-source.mjs b/prompts/store-submissions/_generated/build-mcp-listing-source.mjs
new file mode 100644
index 000000000..44d5c346f
--- /dev/null
+++ b/prompts/store-submissions/_generated/build-mcp-listing-source.mjs
@@ -0,0 +1,159 @@
+// Build prompts/store-submissions/_generated/mcp-listing-source.json — the ONE
+// canonical metadata source every third-party MCP directory listing derives
+// from, so copy never drifts across Smithery / Glama / mcp.so / PulseMCP /
+// LobeHub. Shared, factual fields (name, title, description, version, repo,
+// website, connect snippet, tools) are read live from the server*.json
+// manifests. Curated fields (tagline, category, tags, examplePrompts) live in
+// the OVERLAY below and are the only thing a human edits by hand.
+//
+// Run: node prompts/store-submissions/_generated/build-mcp-listing-source.mjs
+import { readFileSync, writeFileSync, readdirSync } from 'node:fs';
+import { dirname, join, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const HERE = dirname(fileURLToPath(import.meta.url));
+const ROOT = resolve(HERE, '../../..');
+
+// ---- Curated overlay: keyed by manifest `name`. Everything else is derived. ----
+// category ∈ 3d | avatars | payments | agent-economy | market-data | trading |
+// identity | ai-models | account | gaming | learning
+const OVERLAY = {
+ 'io.github.nirholas/three.ws': { category: '3d', tags: ['3d', 'avatars', 'gltf', 'solana', 'agents'], tagline: 'Render 3D avatars, validate glTF/GLB, and read on-chain agent data — the flagship three.ws server.', examplePrompts: ['Render the avatar for agent alice as an embeddable 3D viewer.', 'Validate and optimize this GLB and report its triangle count.', 'Search public three.ws avatars for a cyberpunk knight.'] },
+ 'io.github.nirholas/threews-3d-studio': { category: '3d', tags: ['text-to-3d', 'image-to-3d', 'rigging', 'glb', 'x402'], tagline: 'Turn text or an image into an animation-ready GLB: generate, auto-rig, retexture, optimize.', examplePrompts: ['Generate a 3D model of a brass steampunk owl and rig it for animation.', 'Turn these three reference photos into a textured GLB.', 'Auto-rig this GLB so I can animate it.'] },
+ 'io.github.nirholas/threews-3d-studio-free': { category: '3d', tags: ['text-to-3d', 'free', 'avatars', 'rigging', 'nvidia-nim'], tagline: 'Free text/image → 3D. Five tools, no auth, no payment — forge meshes and rigged avatars on the house.', examplePrompts: ['Free: forge a 3D model of a mushroom house from text.', 'Free: make a rigged 3D avatar of an astronaut in one step.', 'Free: auto-rig this GLB for animation.'] },
+ 'io.github.nirholas/threews-agent': { category: 'payments', tags: ['x402', 'wallet', 'usdc', 'agent-payments', 'spend-caps'], tagline: 'Give your agent an x402 wallet: discover, pay for, and earn from services in USDC, bounded by spend caps.', examplePrompts: ['What is my agent wallet balance?', 'Find an x402 image-generation service and pay for one call, capped at $0.10.', 'Monetize my endpoint so other agents can pay to use it.'] },
+ 'io.github.nirholas/threews-x402-bazaar': { category: 'agent-economy', tags: ['x402', 'discovery', 'marketplace', 'agents', 'usdc'], tagline: 'Discover and price paid agent services across the live x402 facilitator network.', examplePrompts: ['Search the x402 bazaar for crypto price APIs and show their per-call price.', 'Inspect the payment requirements of this x402 endpoint.', 'List the cheapest 3D-generation services on the bazaar.'] },
+ 'io.github.nirholas/threews-pumpfun': { category: 'market-data', tags: ['pumpfun', 'solana', 'tokens', 'free', 'read-only'], tagline: 'Free, read-only pump.fun + Solana token discovery and on-chain analysis.', examplePrompts: ['Show details and the bonding curve for this pump.fun mint.', 'Who are the top holders of this Solana token?', 'List the newest pump.fun launches.'] },
+ 'io.github.nirholas/ibm-x402-mcp-remote': { category: 'ai-models', tags: ['ibm', 'granite', 'x402', 'usdc', 'llm'], tagline: 'Pay-per-use IBM Granite AI via x402: chat, code, embeddings, forecasting. USDC on Base or Solana.', examplePrompts: ['Use IBM Granite to review this function for bugs (pay per call).', 'Get Granite embeddings for these three sentences.', 'Forecast next week from this time series with Granite.'] },
+ 'io.github.nirholas/ibm-x402-mcp': { category: 'ai-models', tags: ['ibm', 'granite', 'x402', 'usdc', 'llm'], tagline: 'x402 pay-per-use IBM Granite AI over stdio: chat, code, embeddings, analysis, forecasting — pay USDC per call.', examplePrompts: ['Ask Granite to refactor this function (pay per call).', 'Get Granite embeddings for these documents.', 'Analyze the sentiment of these reviews with Granite.'] },
+ 'io.github.nirholas/3d-agent-mcp': { category: '3d', tags: ['text-to-3d', 'rigging', 'reputation', 'market-intel', 'free-and-paid'], tagline: 'Full three.ws 3D + agent toolkit: free and paid text-to-3D, rigging, agent reputation, market intel.', examplePrompts: ['Forge a free 3D model of a katana from text.', 'Generate a rigged avatar of a fox samurai.', "Look up this agent's ERC-8004 reputation."] },
+ 'io.github.nirholas/threews-avatar': { category: 'avatars', tags: ['avatars', 'embed', '3d', 'chat-ui', 'gltf'], tagline: 'Drop a live, interactive 3D avatar into any agent chat, or get an embed snippet.', examplePrompts: ['Render a live 3D avatar for agent nova in this chat.', 'Give me an embed code for this avatar.', 'Fetch the GLB and metadata for this avatar id.'] },
+ 'io.github.nirholas/3D-AI-Agent-Avatar': { category: 'avatars', tags: ['avatars', 'glb', 'solana', 'voice', 'pumpfun'], tagline: 'Turn any GLB into a riggable 3D AI agent with a Solana wallet, a voice, and pump.fun powers.', examplePrompts: ['Inspect and validate this GLB, then thumbnail it.', 'Optimize this avatar GLB for the web.', 'Give this avatar a Solana wallet and a voice.'] },
+ 'io.github.nirholas/scene-mcp': { category: '3d', tags: ['3d', 'scene', 'diorama', 'text-to-scene', 'gallery'], tagline: 'Speak a placed 3D diorama into being from one sentence, then browse the saved scene gallery.', examplePrompts: ['Compose a 3D scene: a campfire ringed by three tents at dusk.', 'Show me the scene I just made.', 'List the latest community scenes.'] },
+ 'io.github.nirholas/loom-mcp': { category: '3d', tags: ['3d', 'gallery', 'community', 'creations', 'viewer'], tagline: 'Browse the community 3D-creation gallery, fetch a creation with its viewer URL, and contribute your own.', examplePrompts: ['Show the newest creations in the Loom gallery.', 'Fetch this creation and give me its viewer link.', 'Submit my GLB to the Loom gallery.'] },
+ 'io.github.nirholas/audio-mcp': { category: 'ai-models', tags: ['tts', 'stt', 'lipsync', 'mocap', 'audio'], tagline: 'Text-to-speech, speech-to-text, audio-to-face lipsync, and motion-capture clips for 3D agents.', examplePrompts: ['Convert this text to speech for my avatar.', 'Transcribe this audio clip.', 'Generate audio-to-face lipsync from this voice line.'] },
+ 'io.github.nirholas/vision-mcp': { category: 'ai-models', tags: ['vision', 'image', 'analysis', 'captioning', 'ai'], tagline: 'Image understanding for AI agents — analyze and describe any image via the three.ws pipeline.', examplePrompts: ['Describe what is in this image.', 'Analyze this screenshot and list the UI elements.', 'What breed of dog is in this photo?'] },
+ 'io.github.nirholas/brain-mcp': { category: 'ai-models', tags: ['llm', 'router', 'multi-provider', 'chat', 'ai'], tagline: 'List LLM providers and run chat completions through the three.ws multi-provider router.', examplePrompts: ['List the available LLM providers.', 'Run this prompt through the cheapest available model.', 'Compare two providers on the same prompt.'] },
+ 'io.github.nirholas/ibm-watsonx': { category: 'ai-models', tags: ['ibm', 'watsonx', 'granite', 'embeddings', 'llm'], tagline: 'IBM watsonx.ai on your own account: chat, text generation, embeddings, and tokenization.', examplePrompts: ['Chat with Granite on my watsonx.ai account.', 'Get watsonx embeddings for these documents.', 'Tokenize this text with watsonx.'] },
+ 'io.github.nirholas/alibaba-cloud': { category: 'ai-models', tags: ['alibaba', 'qwen', 'dashscope', 'embeddings', 'llm'], tagline: 'Alibaba Cloud DashScope: Qwen chat, embeddings, and model discovery on your own account.', examplePrompts: ['Chat with Qwen on my DashScope account.', 'Get Qwen embeddings for these sentences.', 'List available DashScope models.'] },
+ 'io.github.nirholas/x402-mcp': { category: 'payments', tags: ['x402', 'wallet', 'usdc', 'self-custodial', 'payments'], tagline: 'Self-custodial x402 wallet for AI agents: find, inspect, and pay any service in USDC or $THREE from your own key.', examplePrompts: ['Find x402 services that generate images.', 'Inspect the price of this x402 endpoint before paying.', 'Pay and call this x402 endpoint with a $0.05 cap.'] },
+ 'io.github.nirholas/x402-bridge': { category: 'payments', tags: ['x402', 'bridge', 'auto-pay', 'spend-caps', 'usdc'], tagline: 'An auto-paying bridge that pays any x402 endpoint on the open web, with Bazaar discovery and spend caps.', examplePrompts: ['Pay this x402 URL and return the response, capped at $0.10 total.', 'Discover a weather x402 API and call it.', 'Set a per-call spend cap and pay this endpoint.'] },
+ 'io.github.nirholas/agentcore-payments-mcp': { category: 'payments', tags: ['x402', 'sessions', 'budget', 'allowlist', 'payments'], tagline: 'Governed x402 payment sessions: pay any endpoint with a budget, allowlist, and per-tx caps — no key handling.', examplePrompts: ['Open a $2 payment session allowlisted to this host.', 'Pay this endpoint using my open session.', 'Show my active payment sessions and remaining budget.'] },
+ 'io.github.nirholas/three-token-mcp': { category: 'payments', tags: ['three', 'solana', 'burn', 'token', 'defi'], tagline: 'Price, hold, and burn $THREE on Solana — the first MCP server whose actions burn a token.', examplePrompts: ['What is the current $THREE price?', 'Check my $THREE balance.', 'Burn 1000 $THREE from my wallet.'] },
+ 'io.github.nirholas/billing-mcp': { category: 'account', tags: ['billing', 'usage', 'invoices', 'receipts', 'quotas'], tagline: "An agent's account economics — plan quotas, metered usage, invoices, receipts, and earnings.", examplePrompts: ['Show my billing summary for this month.', 'Export my usage history as CSV.', 'Fetch the receipt for my last invoice.'] },
+ 'io.github.nirholas/autopilot-mcp': { category: 'agent-economy', tags: ['autopilot', 'agents', 'spend-caps', 'proposals', 'automation'], tagline: 'Set autopilot scopes and a daily SOL spend cap, then propose, execute, and undo agent actions.', examplePrompts: ['Set my autopilot daily cap to 0.5 SOL and enable trade scope.', 'Generate action proposals for my agent.', 'Execute proposal #3, then undo it.'] },
+ 'io.github.nirholas/portfolio-mcp': { category: 'trading', tags: ['portfolio', 'pnl', 'balances', 'transfers', 'solana'], tagline: "An agent's trading state — portfolio value, PnL, live balances, trade feed, and signed transfers.", examplePrompts: ['What is my portfolio value and PnL?', 'Show my live token balances.', 'Send 0.1 SOL to this address.'] },
+ 'io.github.nirholas/provenance-mcp': { category: 'identity', tags: ['provenance', 'audit', 'signed', 'on-chain', 'agents'], tagline: 'Append-only, signed, on-chain-verifiable agent action log — record and audit what agents did.', examplePrompts: ['Record this action to my provenance log.', "List my agent's recent actions.", 'Verify this logged action is untampered.'] },
+ 'io.github.nirholas/copy-mcp': { category: 'trading', tags: ['copy-trading', 'follow', 'sizing', 'guards', 'solana'], tagline: 'Manage copy-trade follows — follow leaders, tune sizing and guard rules, and track fees owed.', examplePrompts: ['Follow this leader wallet with 2% sizing.', 'List my copy-trade subscriptions.', 'Update the stop-loss guard on this follow.'] },
+ 'io.github.nirholas/signals-mcp': { category: 'market-data', tags: ['signals', 'feeds', 'edge', 'publishers', 'subscriptions'], tagline: 'Discover signal feeds ranked by proven edge, rank publishers, and subscribe + track results.', examplePrompts: ['List signal feeds ranked by proven edge.', 'Subscribe to this signal feed.', 'Show the mirror leaderboard of top publishers.'] },
+ 'io.github.nirholas/alerts-mcp': { category: 'market-data', tags: ['alerts', 'pumpfun', 'rules', 'webhook', 'telegram'], tagline: 'Create, update, and delete pump.fun alert rules and read fired-alert history across channels.', examplePrompts: ['Alert me when any token crosses $1M market cap.', 'List my active alert rules.', 'Show alerts that fired in the last day.'] },
+ 'io.github.nirholas/intel-mcp': { category: 'market-data', tags: ['smart-money', 'wallet-intel', 'signals', 'kol', 'solana'], tagline: 'Coin smart-money scores, wallet reputation, signal feeds, and KOL leaderboards.', examplePrompts: ['Score the smart money behind this coin.', 'Give me the reputation profile of this wallet.', 'Show the KOL leaderboard.'] },
+ 'io.github.nirholas/kol-mcp': { category: 'market-data', tags: ['kol', 'wallet', 'pnl', 'trades', 'solana'], tagline: "Per-wallet KOL deep dive — a tracked trader's portfolio P&L and their trades on a given mint.", examplePrompts: ["Show this KOL wallet's portfolio and P&L.", "List this wallet's trades on this mint.", 'How did this trader perform this month?'] },
+ 'io.github.nirholas/activity-mcp': { category: 'market-data', tags: ['trending', 'leaderboard', 'three', 'activity', 'discovery'], tagline: 'Trending agents and coins, the $THREE holder leaderboard, and the site-wide activity ticker.', examplePrompts: ['What agents are trending on three.ws right now?', 'Show the $THREE holder leaderboard.', 'Give me the latest platform activity.'] },
+ 'io.github.nirholas/pumpfun-solana-mcp': { category: 'market-data', tags: ['pumpfun', 'solana', 'sns', 'analysis', 'free'], tagline: 'Free, read-only pump.fun + Solana MCP: token discovery, on-chain analysis, SNS, 3D snapshots.', examplePrompts: ['Analyze this pump.fun token and its holders.', 'Resolve this .sol name to a wallet.', 'Snapshot this token as a 3D object.'] },
+ 'io.github.nirholas/vanity-mcp': { category: 'market-data', tags: ['vanity', 'solana', 'addresses', 'market', 'bounties'], tagline: 'Read the three.ws vanity-address market: quote difficulty and USDC price, browse the board.', examplePrompts: ['Quote the difficulty and price for a wallet ending in THREE.', 'Browse the vanity-address board.', 'Appraise the rarity of this vanity address.'] },
+ 'io.github.nirholas/agent-sniper': { category: 'trading', tags: ['pumpfun', 'sniper', 'solana', 'self-custodial', 'strategies'], tagline: 'Self-custodial pump.fun sniper: arm strategies, snipe, and manage positions. Simulates by default.', examplePrompts: ['Arm a snipe strategy for new launches by this dev (simulate).', 'Fire a manual buy on this mint for 0.05 SOL.', 'Show my open sniper positions.'] },
+ 'io.github.nirholas/naming-mcp': { category: 'identity', tags: ['sns', 'naming', 'sol', 'identity', 'resolve'], tagline: 'On-chain identity for AI agents: resolve .sol names, reverse-lookup wallets, check handle availability.', examplePrompts: ['Resolve alice.sol to a wallet address.', 'Reverse-lookup the .sol name for this wallet.', 'Is nova.threews.sol available?'] },
+ 'io.github.nirholas/marketplace-mcp': { category: 'agent-economy', tags: ['marketplace', 'agents', 'skills', 'discovery', 'read-only'], tagline: 'Browse and discover the public three.ws agent marketplace and skills catalog. Read-only.', examplePrompts: ['Browse trading agents on the three.ws marketplace.', 'Show details for this agent.', 'List the available agent skill categories.'] },
+ 'io.github.nirholas/agenc-mcp': { category: 'agent-economy', tags: ['agenc', 'tasks', 'registry', 'coordination', 'on-chain'], tagline: 'Browse the AgenC on-chain task marketplace, query the agent registry, and link identities.', examplePrompts: ['List open tasks on the AgenC marketplace.', 'Get the status of this AgenC task.', 'Look up this agent in the AgenC registry.'] },
+ 'io.github.nirholas/agora-mcp': { category: 'agent-economy', tags: ['agora', 'economy', 'bounties', 'work', 'three'], tagline: 'Join the Agora agent economy over MCP: browse the board, register, claim on-chain work, and post bounties.', examplePrompts: ['Show the Agora job board.', 'Register my agent as an Agora citizen.', 'Claim this bounty and mark it complete.'] },
+ 'io.github.nirholas/clash-mcp': { category: 'gaming', tags: ['game', 'clash', 'factions', 'leaderboard', 'three'], tagline: 'Play three.ws Coin Clash — read the faction battle board and leaderboard, enlist, and rally.', examplePrompts: ['Show the current Coin Clash battle state.', 'Enlist me in the strongest faction.', 'Rally my faction with a boost.'] },
+ 'io.github.nirholas/tutor-mcp': { category: 'learning', tags: ['tutor', 'learning', 'ledger', 'invoice', 'pay-as-you-learn'], tagline: "Read a Pay-As-You-Learn tutoring session's itemized tab and close it for an attested invoice.", examplePrompts: ['Show the itemized tab for my tutoring session.', 'Close this session and give me the invoice.', 'How much have I spent this session?'] },
+ 'io.github.nirholas/notifications-mcp': { category: 'account', tags: ['notifications', 'inbox', 'web-push', 'preferences', 'agents'], tagline: "An agent's inbox — read notifications, mark them read, manage delivery preferences, and register Web Push devices.", examplePrompts: ['Show my unread notifications.', 'Mark all notifications as read.', 'Turn off Telegram delivery and keep Web Push.'] },
+};
+
+// ---- Derive the rest from the manifests ----
+function findManifests() {
+ const out = [];
+ // root-level server*.json
+ for (const f of readdirSync(ROOT)) {
+ if (/^server[^/]*\.json$/.test(f)) out.push(join(ROOT, f));
+ }
+ // mcp-server, mcp-bridge, packages/*
+ for (const d of ['mcp-server', 'mcp-bridge']) out.push(join(ROOT, d, 'server.json'));
+ for (const p of readdirSync(join(ROOT, 'packages'))) {
+ const f = join(ROOT, 'packages', p, 'server.json');
+ try { readFileSync(f); out.push(f); } catch { /* no manifest */ }
+ }
+ return [...new Set(out)].filter((f) => { try { readFileSync(f); return true; } catch { return false; } });
+}
+
+const REMOTE_NPM = new Set(); // dedupe
+const servers = [];
+for (const f of findManifests()) {
+ const j = JSON.parse(readFileSync(f, 'utf8'));
+ const o = OVERLAY[j.name];
+ if (!o) { console.warn('NO OVERLAY for', j.name, '(' + f.replace(ROOT + '/', '') + ')'); }
+ const remote = (j.remotes || [])[0];
+ const pkg = (j.packages || [])[0];
+ let connect, type;
+ if (remote) {
+ type = 'remote';
+ connect = remote.url;
+ } else if (pkg) {
+ type = 'stdio';
+ const args = (pkg.packageArguments || []).map((a) => a.value).filter(Boolean).join(' ');
+ connect = `npx -y ${pkg.identifier}${args ? ' ' + args : ''}`;
+ }
+ const requiredEnv = ((pkg && pkg.environmentVariables) || []).filter((e) => e.isRequired).map((e) => e.name);
+ servers.push({
+ name: j.name,
+ title: j.title,
+ type,
+ transport: remote ? (remote.type || 'streamable-http') : 'stdio',
+ connect,
+ npmPackage: pkg ? pkg.identifier : null,
+ version: j.version,
+ description: j.description,
+ tagline: o?.tagline || j.description,
+ category: o?.category || 'agents',
+ tags: o?.tags || [],
+ examplePrompts: o?.examplePrompts || [],
+ requiredEnv,
+ websiteUrl: j.websiteUrl || 'https://three.ws',
+ repository: j.repository?.url || 'https://github.com/nirholas/three.ws',
+ registryUrl: `https://registry.modelcontextprotocol.io/?q=${encodeURIComponent(j.name)}`,
+ icon: 'https://three.ws/three-ws-mcp-icon.svg',
+ });
+}
+
+servers.sort((a, b) => (a.type === b.type ? a.name.localeCompare(b.name) : a.type === 'remote' ? -1 : 1));
+
+const doc = {
+ $comment: 'CANONICAL SOURCE OF TRUTH for every three.ws MCP directory listing. Regenerate with build-mcp-listing-source.mjs — do NOT hand-edit this JSON; edit the OVERLAY in that script. Factual fields (name/title/description/version/connect/tags-from-manifest) are read live from server*.json so listings can never drift from the manifests.',
+ generatedBy: 'prompts/store-submissions/_generated/build-mcp-listing-source.mjs',
+ publisher: {
+ name: 'three.ws',
+ namespace: 'io.github.nirholas',
+ website: 'https://three.ws',
+ repository: 'https://github.com/nirholas/three.ws',
+ contactEmail: '[email protected]',
+ officialRegistrySearch: 'https://registry.modelcontextprotocol.io/?q=io.github.nirholas',
+ promotedCoin: '$THREE (Solana: FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump)',
+ icon: 'https://three.ws/three-ws-mcp-icon.svg',
+ },
+ fieldConsumers: {
+ name: 'Official registry name; Glama/PulseMCP match this to the registry entry.',
+ title: 'Display name on Smithery, mcp.so, LobeHub cards.',
+ tagline: 'One-line summary for Smithery/mcp.so/LobeHub card subtitle.',
+ description: 'Long description body on every directory.',
+ category: 'Smithery + LobeHub category; mcp.so tag group.',
+ tags: 'Smithery/Glama/mcp.so/LobeHub keyword tags.',
+ connect: 'Install/connect snippet — remote URL for Smithery URL-publish; `npx` for stdio config JSON.',
+ examplePrompts: 'LobeHub + mcp.so "example usage"; Smithery README examples.',
+ icon: 'Card/avatar image on all directories.',
+ },
+ counts: {
+ total: servers.length,
+ remote: servers.filter((s) => s.type === 'remote').length,
+ stdio: servers.filter((s) => s.type === 'stdio').length,
+ },
+ servers,
+};
+
+const outPath = join(HERE, 'mcp-listing-source.json');
+writeFileSync(outPath, JSON.stringify(doc, null, 2) + '\n');
+console.log(`Wrote ${outPath}`);
+console.log(` ${doc.counts.total} servers (${doc.counts.remote} remote, ${doc.counts.stdio} stdio)`);
+const missing = servers.filter((s) => !OVERLAY[s.name]);
+if (missing.length) console.log(' MISSING OVERLAY:', missing.map((s) => s.name).join(', '));
diff --git a/prompts/store-submissions/_generated/forge-raw-response.json b/prompts/store-submissions/_generated/forge-raw-response.json
new file mode 100644
index 000000000..59bc1d969
--- /dev/null
+++ b/prompts/store-submissions/_generated/forge-raw-response.json
@@ -0,0 +1 @@
+{"job_id":null,"creation_id":"3adc72c8-d485-4484-8648-c4881dfc440f","status":"done","glb_url":"https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/3adc72c8-d485-4484-8648-c4881dfc440f.glb","durable":true,"mode":"text_to_3d","path":"image","tier":"draft","backend":"nvidia","prompt":"a small ceramic teapot with a bamboo handle, glossy celadon glaze","preview_image_url":null,"reference_image_urls":[],"eta_seconds":13,"estimated_credits":null}
\ No newline at end of file
diff --git a/prompts/store-submissions/_generated/live-tools-list.json b/prompts/store-submissions/_generated/live-tools-list.json
new file mode 100644
index 000000000..01f305154
--- /dev/null
+++ b/prompts/store-submissions/_generated/live-tools-list.json
@@ -0,0 +1 @@
+{"jsonrpc":"2.0","id":1,"result":{"tools":[{"name":"forge_free","title":"Generate a 3D model from text","description":"Turn a text prompt into a textured, downloadable 3D model (GLB) — free. Describe a single object, character, or creature; the studio generates an interactive model you can rotate, view, and download. Choose a quality tier (draft = fast, standard, high). Renders inline in an interactive 3D viewer.","inputSchema":{"type":"object","additionalProperties":false,"required":["prompt"],"properties":{"prompt":{"type":"string","minLength":3,"maxLength":1000,"description":"Description of the single object or character to model, e.g. \"a friendly round robot mascot, glossy white plastic\"."},"tier":{"type":"string","enum":["draft","standard","high"],"description":"Detail level: draft (fast, default), standard, or high. Higher tiers take longer."}}},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true},"_meta":{"openai/outputTemplate":"ui://widget/three-studio-model.html","openai/toolInvocation/invoking":"Generating your 3D model…","openai/toolInvocation/invoked":"Here is your 3D model","openai/widgetAccessible":true}},{"name":"text_to_avatar","title":"Generate a 3D avatar","description":"Generate a textured 3D avatar (GLB) from a text description or a reference image URL. Best for characters and figures. Renders inline in an interactive 3D viewer.","inputSchema":{"type":"object","additionalProperties":false,"properties":{"prompt":{"type":"string","maxLength":1000,"description":"Description of the avatar to generate."},"image_url":{"type":"string","format":"uri","description":"Optional http(s) URL to a reference image to reconstruct in 3D."}}},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true},"_meta":{"openai/outputTemplate":"ui://widget/three-studio-model.html","openai/toolInvocation/invoking":"Generating your avatar…","openai/toolInvocation/invoked":"Here is your avatar","openai/widgetAccessible":true}},{"name":"mesh_forge","title":"Generate a 3D mesh (art-directed)","description":"Generate a textured 3D mesh (GLB) from a text prompt or a reference image URL. In text mode an AI art-director first refines your prompt into an optimized single-subject spec for higher mesh quality. Renders inline in an interactive 3D viewer.","inputSchema":{"type":"object","additionalProperties":false,"properties":{"prompt":{"type":"string","maxLength":1000,"description":"Description of the single object to model."},"image_url":{"type":"string","format":"uri","description":"Optional http(s) URL to a reference image to reconstruct directly."}}},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true},"_meta":{"openai/outputTemplate":"ui://widget/three-studio-model.html","openai/toolInvocation/invoking":"Generating your 3D mesh…","openai/toolInvocation/invoked":"Here is your 3D mesh","openai/widgetAccessible":true}},{"name":"rig_mesh","title":"Rig a 3D model for animation","description":"Auto-rig a static 3D model (GLB) into an animation-ready model: adds a humanoid skeleton and skin weights so it can be posed and animated. Provide the GLB URL of a model (e.g. one generated by the other tools). Renders the rigged result inline in an interactive 3D viewer.","inputSchema":{"type":"object","additionalProperties":false,"required":["glb_url"],"properties":{"glb_url":{"type":"string","format":"uri","description":"http(s) URL to the static GLB mesh to rig."}}},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true},"_meta":{"openai/outputTemplate":"ui://widget/three-studio-model.html","openai/toolInvocation/invoking":"Rigging your model…","openai/toolInvocation/invoked":"Here is your rigged model","openai/widgetAccessible":true}},{"name":"forge_avatar","title":"Generate a rigged, animation-ready avatar","description":"Generate a rigged, animation-ready 3D avatar (GLB) from a single text prompt or a reference image — in one step. Generates the mesh, then auto-rigs it with a humanoid skeleton so it is ready to pose and animate. Best for characters; objects are steered to the mesh generator. Renders inline in an interactive 3D viewer.","inputSchema":{"type":"object","additionalProperties":false,"properties":{"prompt":{"type":"string","maxLength":1000,"description":"Description of the character/avatar to generate."},"image_url":{"type":"string","format":"uri","description":"Optional http(s) URL to a reference image to reconstruct in 3D."},"allow_non_humanoid":{"type":"boolean","description":"Set true to rig a non-humanoid subject anyway (rigging assumes a humanoid figure)."}}},"annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true},"_meta":{"openai/outputTemplate":"ui://widget/three-studio-model.html","openai/toolInvocation/invoking":"Generating your rigged avatar…","openai/toolInvocation/invoked":"Here is your rigged avatar","openai/widgetAccessible":true}}]}}
\ No newline at end of file
diff --git a/prompts/store-submissions/_generated/mcp-listing-source.json b/prompts/store-submissions/_generated/mcp-listing-source.json
new file mode 100644
index 000000000..d48b81b4e
--- /dev/null
+++ b/prompts/store-submissions/_generated/mcp-listing-source.json
@@ -0,0 +1,1271 @@
+{
+ "$comment": "CANONICAL SOURCE OF TRUTH for every three.ws MCP directory listing. Regenerate with build-mcp-listing-source.mjs — do NOT hand-edit this JSON; edit the OVERLAY in that script. Factual fields (name/title/description/version/connect/tags-from-manifest) are read live from server*.json so listings can never drift from the manifests.",
+ "generatedBy": "prompts/store-submissions/_generated/build-mcp-listing-source.mjs",
+ "publisher": {
+ "name": "three.ws",
+ "namespace": "io.github.nirholas",
+ "website": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "contactEmail": "[email protected]",
+ "officialRegistrySearch": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas",
+ "promotedCoin": "$THREE (Solana: FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump)",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ "fieldConsumers": {
+ "name": "Official registry name; Glama/PulseMCP match this to the registry entry.",
+ "title": "Display name on Smithery, mcp.so, LobeHub cards.",
+ "tagline": "One-line summary for Smithery/mcp.so/LobeHub card subtitle.",
+ "description": "Long description body on every directory.",
+ "category": "Smithery + LobeHub category; mcp.so tag group.",
+ "tags": "Smithery/Glama/mcp.so/LobeHub keyword tags.",
+ "connect": "Install/connect snippet — remote URL for Smithery URL-publish; `npx` for stdio config JSON.",
+ "examplePrompts": "LobeHub + mcp.so \"example usage\"; Smithery README examples.",
+ "icon": "Card/avatar image on all directories."
+ },
+ "counts": {
+ "total": 42,
+ "remote": 7,
+ "stdio": 35
+ },
+ "servers": [
+ {
+ "name": "io.github.nirholas/ibm-x402-mcp-remote",
+ "title": "IBM Granite x402 Remote",
+ "type": "remote",
+ "transport": "streamable-http",
+ "connect": "https://three.ws/api/ibm-mcp",
+ "npmPackage": null,
+ "version": "1.0.0",
+ "description": "Pay-per-use IBM Granite AI via x402: chat, code, embeddings, forecasting. USDC on Base or Solana.",
+ "tagline": "Pay-per-use IBM Granite AI via x402: chat, code, embeddings, forecasting. USDC on Base or Solana.",
+ "category": "ai-models",
+ "tags": [
+ "ibm",
+ "granite",
+ "x402",
+ "usdc",
+ "llm"
+ ],
+ "examplePrompts": [
+ "Use IBM Granite to review this function for bugs (pay per call).",
+ "Get Granite embeddings for these three sentences.",
+ "Forecast next week from this time series with Granite."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fibm-x402-mcp-remote",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/three.ws",
+ "title": "three.ws Avatars & Agents",
+ "type": "remote",
+ "transport": "streamable-http",
+ "connect": "https://three.ws/api/mcp",
+ "npmPackage": null,
+ "version": "1.0.1",
+ "description": "3D avatars, embeds, glTF tools, agent memory, and on-chain agent identity from three.ws.",
+ "tagline": "Render 3D avatars, validate glTF/GLB, and read on-chain agent data — the flagship three.ws server.",
+ "category": "3d",
+ "tags": [
+ "3d",
+ "avatars",
+ "gltf",
+ "solana",
+ "agents"
+ ],
+ "examplePrompts": [
+ "Render the avatar for agent alice as an embeddable 3D viewer.",
+ "Validate and optimize this GLB and report its triangle count.",
+ "Search public three.ws avatars for a cyberpunk knight."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fthree.ws",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/threews-3d-studio",
+ "title": "three.ws 3D Studio",
+ "type": "remote",
+ "transport": "streamable-http",
+ "connect": "https://three.ws/api/mcp-3d",
+ "npmPackage": null,
+ "version": "1.0.1",
+ "description": "Turn text or an image into an animation-ready 3D model (GLB): generate, rig, animate, retexture.",
+ "tagline": "Turn text or an image into an animation-ready GLB: generate, auto-rig, retexture, optimize.",
+ "category": "3d",
+ "tags": [
+ "text-to-3d",
+ "image-to-3d",
+ "rigging",
+ "glb",
+ "x402"
+ ],
+ "examplePrompts": [
+ "Generate a 3D model of a brass steampunk owl and rig it for animation.",
+ "Turn these three reference photos into a textured GLB.",
+ "Auto-rig this GLB so I can animate it."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fthreews-3d-studio",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/threews-3d-studio-free",
+ "title": "three.ws 3D Studio (free)",
+ "type": "remote",
+ "transport": "streamable-http",
+ "connect": "https://three.ws/api/mcp-studio",
+ "npmPackage": null,
+ "version": "1.0.0",
+ "description": "Free text/image → 3D. Five tools, no auth, no payment: forge_free (text → textured GLB), text_to_avatar (text/image → avatar), mesh_forge (art-directed mesh), rig_mesh (auto-rig a GLB for animation), forge_avatar (one-call text → rigged avatar). Results render in an interactive viewer.",
+ "tagline": "Free text/image → 3D. Five tools, no auth, no payment — forge meshes and rigged avatars on the house.",
+ "category": "3d",
+ "tags": [
+ "text-to-3d",
+ "free",
+ "avatars",
+ "rigging",
+ "nvidia-nim"
+ ],
+ "examplePrompts": [
+ "Free: forge a 3D model of a mushroom house from text.",
+ "Free: make a rigged 3D avatar of an astronaut in one step.",
+ "Free: auto-rig this GLB for animation."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fthreews-3d-studio-free",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/threews-agent",
+ "title": "three.ws Agent Wallet",
+ "type": "remote",
+ "transport": "streamable-http",
+ "connect": "https://three.ws/api/mcp-agent",
+ "npmPackage": null,
+ "version": "1.0.0",
+ "description": "Give your AI agent an x402 wallet: discover and pay for services in USDC, or earn from your own.",
+ "tagline": "Give your agent an x402 wallet: discover, pay for, and earn from services in USDC, bounded by spend caps.",
+ "category": "payments",
+ "tags": [
+ "x402",
+ "wallet",
+ "usdc",
+ "agent-payments",
+ "spend-caps"
+ ],
+ "examplePrompts": [
+ "What is my agent wallet balance?",
+ "Find an x402 image-generation service and pay for one call, capped at $0.10.",
+ "Monetize my endpoint so other agents can pay to use it."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fthreews-agent",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/threews-pumpfun",
+ "title": "three.ws pump.fun MCP",
+ "type": "remote",
+ "transport": "streamable-http",
+ "connect": "https://three.ws/api/pump-fun-mcp",
+ "npmPackage": null,
+ "version": "1.0.0",
+ "description": "Free, read-only pump.fun and Solana token discovery and on-chain analysis tools, by three.ws.",
+ "tagline": "Free, read-only pump.fun + Solana token discovery and on-chain analysis.",
+ "category": "market-data",
+ "tags": [
+ "pumpfun",
+ "solana",
+ "tokens",
+ "free",
+ "read-only"
+ ],
+ "examplePrompts": [
+ "Show details and the bonding curve for this pump.fun mint.",
+ "Who are the top holders of this Solana token?",
+ "List the newest pump.fun launches."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fthreews-pumpfun",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/threews-x402-bazaar",
+ "title": "three.ws x402 Bazaar",
+ "type": "remote",
+ "transport": "streamable-http",
+ "connect": "https://three.ws/api/mcp-bazaar",
+ "npmPackage": null,
+ "version": "1.0.2",
+ "description": "Discover and price paid agent services across the live x402 network, by three.ws.",
+ "tagline": "Discover and price paid agent services across the live x402 facilitator network.",
+ "category": "agent-economy",
+ "tags": [
+ "x402",
+ "discovery",
+ "marketplace",
+ "agents",
+ "usdc"
+ ],
+ "examplePrompts": [
+ "Search the x402 bazaar for crypto price APIs and show their per-call price.",
+ "Inspect the payment requirements of this x402 endpoint.",
+ "List the cheapest 3D-generation services on the bazaar."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fthreews-x402-bazaar",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/3d-agent-mcp",
+ "title": "three.ws 3D Agent Tools",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/mcp-server",
+ "npmPackage": "@three-ws/mcp-server",
+ "version": "1.2.1",
+ "description": "MCP tools from three.ws: free + paid text-to-3D, rigging, agent reputation, market intel.",
+ "tagline": "Full three.ws 3D + agent toolkit: free and paid text-to-3D, rigging, agent reputation, market intel.",
+ "category": "3d",
+ "tags": [
+ "text-to-3d",
+ "rigging",
+ "reputation",
+ "market-intel",
+ "free-and-paid"
+ ],
+ "examplePrompts": [
+ "Forge a free 3D model of a katana from text.",
+ "Generate a rigged avatar of a fox samurai.",
+ "Look up this agent's ERC-8004 reputation."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2F3d-agent-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/3D-AI-Agent-Avatar",
+ "title": "3D AI Agent Avatar",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/avatar-agent",
+ "npmPackage": "@three-ws/avatar-agent",
+ "version": "1.2.1",
+ "description": "3D AI Agent Avatar — render any GLB, give it a Solana wallet, a voice, and pump.fun powers.",
+ "tagline": "Turn any GLB into a riggable 3D AI agent with a Solana wallet, a voice, and pump.fun powers.",
+ "category": "avatars",
+ "tags": [
+ "avatars",
+ "glb",
+ "solana",
+ "voice",
+ "pumpfun"
+ ],
+ "examplePrompts": [
+ "Inspect and validate this GLB, then thumbnail it.",
+ "Optimize this avatar GLB for the web.",
+ "Give this avatar a Solana wallet and a voice."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2F3D-AI-Agent-Avatar",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/activity-mcp",
+ "title": "three.ws Activity",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/activity-mcp",
+ "npmPackage": "@three-ws/activity-mcp",
+ "version": "0.1.1",
+ "description": "Trending agents and coins, the $THREE holder leaderboard, and the site-wide activity ticker.",
+ "tagline": "Trending agents and coins, the $THREE holder leaderboard, and the site-wide activity ticker.",
+ "category": "market-data",
+ "tags": [
+ "trending",
+ "leaderboard",
+ "three",
+ "activity",
+ "discovery"
+ ],
+ "examplePrompts": [
+ "What agents are trending on three.ws right now?",
+ "Show the $THREE holder leaderboard.",
+ "Give me the latest platform activity."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Factivity-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/agenc-mcp",
+ "title": "three.ws AgenC",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/agenc-mcp",
+ "npmPackage": "@three-ws/agenc-mcp",
+ "version": "0.1.1",
+ "description": "Browse the AgenC on-chain task marketplace, query the agent registry, and link identities.",
+ "tagline": "Browse the AgenC on-chain task marketplace, query the agent registry, and link identities.",
+ "category": "agent-economy",
+ "tags": [
+ "agenc",
+ "tasks",
+ "registry",
+ "coordination",
+ "on-chain"
+ ],
+ "examplePrompts": [
+ "List open tasks on the AgenC marketplace.",
+ "Get the status of this AgenC task.",
+ "Look up this agent in the AgenC registry."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fagenc-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/agent-sniper",
+ "title": "Agent Sniper",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/agent-sniper mcp",
+ "npmPackage": "@three-ws/agent-sniper",
+ "version": "0.1.1",
+ "description": "Self-custodial pump.fun sniper: arm strategies, snipe, manage positions. Simulate by default.",
+ "tagline": "Self-custodial pump.fun sniper: arm strategies, snipe, and manage positions. Simulates by default.",
+ "category": "trading",
+ "tags": [
+ "pumpfun",
+ "sniper",
+ "solana",
+ "self-custodial",
+ "strategies"
+ ],
+ "examplePrompts": [
+ "Arm a snipe strategy for new launches by this dev (simulate).",
+ "Fire a manual buy on this mint for 0.05 SOL.",
+ "Show my open sniper positions."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fagent-sniper",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/agentcore-payments-mcp",
+ "title": "three.ws Agent Payments",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/agentcore-payments-mcp",
+ "npmPackage": "@three-ws/agentcore-payments-mcp",
+ "version": "0.1.1",
+ "description": "Governed x402 payment sessions: pay any endpoint with budget, allowlist & per-tx caps, no key.",
+ "tagline": "Governed x402 payment sessions: pay any endpoint with a budget, allowlist, and per-tx caps — no key handling.",
+ "category": "payments",
+ "tags": [
+ "x402",
+ "sessions",
+ "budget",
+ "allowlist",
+ "payments"
+ ],
+ "examplePrompts": [
+ "Open a $2 payment session allowlisted to this host.",
+ "Pay this endpoint using my open session.",
+ "Show my active payment sessions and remaining budget."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fagentcore-payments-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/agora-mcp",
+ "title": "three.ws Agora",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/agora-mcp",
+ "npmPackage": "@three-ws/agora-mcp",
+ "version": "0.1.1",
+ "description": "Agora agent economy over MCP: browse the board, register, claim on-chain work, and post bounties.",
+ "tagline": "Join the Agora agent economy over MCP: browse the board, register, claim on-chain work, and post bounties.",
+ "category": "agent-economy",
+ "tags": [
+ "agora",
+ "economy",
+ "bounties",
+ "work",
+ "three"
+ ],
+ "examplePrompts": [
+ "Show the Agora job board.",
+ "Register my agent as an Agora citizen.",
+ "Claim this bounty and mark it complete."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fagora-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/alerts-mcp",
+ "title": "three.ws Alerts",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/alerts-mcp",
+ "npmPackage": "@three-ws/alerts-mcp",
+ "version": "0.1.1",
+ "description": "Create, update, and delete pump.fun alert rules and read fired-alert history across channels.",
+ "tagline": "Create, update, and delete pump.fun alert rules and read fired-alert history across channels.",
+ "category": "market-data",
+ "tags": [
+ "alerts",
+ "pumpfun",
+ "rules",
+ "webhook",
+ "telegram"
+ ],
+ "examplePrompts": [
+ "Alert me when any token crosses $1M market cap.",
+ "List my active alert rules.",
+ "Show alerts that fired in the last day."
+ ],
+ "requiredEnv": [
+ "THREE_WS_SESSION"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Falerts-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/alibaba-cloud",
+ "title": "Alibaba Cloud DashScope — Qwen",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/alibaba-cloud-mcp",
+ "npmPackage": "@three-ws/alibaba-cloud-mcp",
+ "version": "0.1.1",
+ "description": "Alibaba Cloud DashScope MCP: Qwen chat, embeddings, and model discovery on your own account.",
+ "tagline": "Alibaba Cloud DashScope: Qwen chat, embeddings, and model discovery on your own account.",
+ "category": "ai-models",
+ "tags": [
+ "alibaba",
+ "qwen",
+ "dashscope",
+ "embeddings",
+ "llm"
+ ],
+ "examplePrompts": [
+ "Chat with Qwen on my DashScope account.",
+ "Get Qwen embeddings for these sentences.",
+ "List available DashScope models."
+ ],
+ "requiredEnv": [
+ "DASHSCOPE_API_KEY"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Falibaba-cloud",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/audio-mcp",
+ "title": "three.ws Audio",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/audio-mcp",
+ "npmPackage": "@three-ws/audio-mcp",
+ "version": "0.1.1",
+ "description": "Text-to-speech, speech-to-text, audio-to-face lipsync, and motion-capture clips for 3D agents.",
+ "tagline": "Text-to-speech, speech-to-text, audio-to-face lipsync, and motion-capture clips for 3D agents.",
+ "category": "ai-models",
+ "tags": [
+ "tts",
+ "stt",
+ "lipsync",
+ "mocap",
+ "audio"
+ ],
+ "examplePrompts": [
+ "Convert this text to speech for my avatar.",
+ "Transcribe this audio clip.",
+ "Generate audio-to-face lipsync from this voice line."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Faudio-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/autopilot-mcp",
+ "title": "three.ws Autopilot",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/autopilot-mcp",
+ "npmPackage": "@three-ws/autopilot-mcp",
+ "version": "0.2.0",
+ "description": "Set autopilot scopes and a daily SOL spend cap, then propose, execute, and undo agent actions.",
+ "tagline": "Set autopilot scopes and a daily SOL spend cap, then propose, execute, and undo agent actions.",
+ "category": "agent-economy",
+ "tags": [
+ "autopilot",
+ "agents",
+ "spend-caps",
+ "proposals",
+ "automation"
+ ],
+ "examplePrompts": [
+ "Set my autopilot daily cap to 0.5 SOL and enable trade scope.",
+ "Generate action proposals for my agent.",
+ "Execute proposal #3, then undo it."
+ ],
+ "requiredEnv": [
+ "THREE_WS_API_KEY"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fautopilot-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/billing-mcp",
+ "title": "three.ws Billing",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/billing-mcp",
+ "npmPackage": "@three-ws/billing-mcp",
+ "version": "0.1.1",
+ "description": "An agent's account economics — plan quotas, metered usage, invoices, receipts, and earnings.",
+ "tagline": "An agent's account economics — plan quotas, metered usage, invoices, receipts, and earnings.",
+ "category": "account",
+ "tags": [
+ "billing",
+ "usage",
+ "invoices",
+ "receipts",
+ "quotas"
+ ],
+ "examplePrompts": [
+ "Show my billing summary for this month.",
+ "Export my usage history as CSV.",
+ "Fetch the receipt for my last invoice."
+ ],
+ "requiredEnv": [
+ "THREE_WS_SESSION"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fbilling-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/brain-mcp",
+ "title": "three.ws Brain",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/brain-mcp",
+ "npmPackage": "@three-ws/brain-mcp",
+ "version": "0.1.1",
+ "description": "List LLM providers and run chat completions through the three.ws multi-provider router.",
+ "tagline": "List LLM providers and run chat completions through the three.ws multi-provider router.",
+ "category": "ai-models",
+ "tags": [
+ "llm",
+ "router",
+ "multi-provider",
+ "chat",
+ "ai"
+ ],
+ "examplePrompts": [
+ "List the available LLM providers.",
+ "Run this prompt through the cheapest available model.",
+ "Compare two providers on the same prompt."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fbrain-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/clash-mcp",
+ "title": "three.ws Coin Clash",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/clash-mcp",
+ "npmPackage": "@three-ws/clash-mcp",
+ "version": "0.1.1",
+ "description": "Play three.ws Coin Clash — read the faction battle board and leaderboard, enlist, and rally.",
+ "tagline": "Play three.ws Coin Clash — read the faction battle board and leaderboard, enlist, and rally.",
+ "category": "gaming",
+ "tags": [
+ "game",
+ "clash",
+ "factions",
+ "leaderboard",
+ "three"
+ ],
+ "examplePrompts": [
+ "Show the current Coin Clash battle state.",
+ "Enlist me in the strongest faction.",
+ "Rally my faction with a boost."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fclash-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/copy-mcp",
+ "title": "three.ws Copy Trading",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/copy-mcp",
+ "npmPackage": "@three-ws/copy-mcp",
+ "version": "0.1.1",
+ "description": "Manage copy-trade follows — follow leaders, tune sizing and guard rules, and track fees owed.",
+ "tagline": "Manage copy-trade follows — follow leaders, tune sizing and guard rules, and track fees owed.",
+ "category": "trading",
+ "tags": [
+ "copy-trading",
+ "follow",
+ "sizing",
+ "guards",
+ "solana"
+ ],
+ "examplePrompts": [
+ "Follow this leader wallet with 2% sizing.",
+ "List my copy-trade subscriptions.",
+ "Update the stop-loss guard on this follow."
+ ],
+ "requiredEnv": [
+ "THREE_WS_API_KEY"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fcopy-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/ibm-watsonx",
+ "title": "IBM watsonx.ai Granite",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/ibm-watsonx-mcp",
+ "npmPackage": "@three-ws/ibm-watsonx-mcp",
+ "version": "0.2.0",
+ "description": "IBM watsonx.ai MCP by three.ws: chat, text generation, embeddings, and tokenization.",
+ "tagline": "IBM watsonx.ai on your own account: chat, text generation, embeddings, and tokenization.",
+ "category": "ai-models",
+ "tags": [
+ "ibm",
+ "watsonx",
+ "granite",
+ "embeddings",
+ "llm"
+ ],
+ "examplePrompts": [
+ "Chat with Granite on my watsonx.ai account.",
+ "Get watsonx embeddings for these documents.",
+ "Tokenize this text with watsonx."
+ ],
+ "requiredEnv": [
+ "WATSONX_API_KEY"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fibm-watsonx",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/ibm-x402-mcp",
+ "title": "IBM Granite via x402",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/ibm-x402-mcp",
+ "npmPackage": "@three-ws/ibm-x402-mcp",
+ "version": "1.1.1",
+ "description": "x402 pay-per-use IBM Granite AI: chat, code, embeddings, analysis, forecasting. Pay USDC per call.",
+ "tagline": "x402 pay-per-use IBM Granite AI over stdio: chat, code, embeddings, analysis, forecasting — pay USDC per call.",
+ "category": "ai-models",
+ "tags": [
+ "ibm",
+ "granite",
+ "x402",
+ "usdc",
+ "llm"
+ ],
+ "examplePrompts": [
+ "Ask Granite to refactor this function (pay per call).",
+ "Get Granite embeddings for these documents.",
+ "Analyze the sentiment of these reviews with Granite."
+ ],
+ "requiredEnv": [
+ "MCP_SVM_PAYMENT_ADDRESS",
+ "WATSONX_API_KEY"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fibm-x402-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/intel-mcp",
+ "title": "three.ws Intel",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/intel-mcp",
+ "npmPackage": "@three-ws/intel-mcp",
+ "version": "0.1.1",
+ "description": "Coin smart-money scores, wallet reputation, signal feeds, and KOL leaderboards.",
+ "tagline": "Coin smart-money scores, wallet reputation, signal feeds, and KOL leaderboards.",
+ "category": "market-data",
+ "tags": [
+ "smart-money",
+ "wallet-intel",
+ "signals",
+ "kol",
+ "solana"
+ ],
+ "examplePrompts": [
+ "Score the smart money behind this coin.",
+ "Give me the reputation profile of this wallet.",
+ "Show the KOL leaderboard."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fintel-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/kol-mcp",
+ "title": "three.ws KOL",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/kol-mcp",
+ "npmPackage": "@three-ws/kol-mcp",
+ "version": "0.1.0",
+ "description": "Per-wallet KOL deep dive — a tracked trader's portfolio P&L and its trades on a given mint.",
+ "tagline": "Per-wallet KOL deep dive — a tracked trader's portfolio P&L and their trades on a given mint.",
+ "category": "market-data",
+ "tags": [
+ "kol",
+ "wallet",
+ "pnl",
+ "trades",
+ "solana"
+ ],
+ "examplePrompts": [
+ "Show this KOL wallet's portfolio and P&L.",
+ "List this wallet's trades on this mint.",
+ "How did this trader perform this month?"
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fkol-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/loom-mcp",
+ "title": "three.ws Loom",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/loom-mcp",
+ "npmPackage": "@three-ws/loom-mcp",
+ "version": "0.1.1",
+ "description": "Browse the community 3D-creation gallery, fetch a creation with its viewer URL, and submit it.",
+ "tagline": "Browse the community 3D-creation gallery, fetch a creation with its viewer URL, and contribute your own.",
+ "category": "3d",
+ "tags": [
+ "3d",
+ "gallery",
+ "community",
+ "creations",
+ "viewer"
+ ],
+ "examplePrompts": [
+ "Show the newest creations in the Loom gallery.",
+ "Fetch this creation and give me its viewer link.",
+ "Submit my GLB to the Loom gallery."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Floom-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/marketplace-mcp",
+ "title": "three.ws Marketplace",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/marketplace-mcp",
+ "npmPackage": "@three-ws/marketplace-mcp",
+ "version": "0.1.1",
+ "description": "Browse and discover the public three.ws agent marketplace and skills catalog. Read-only.",
+ "tagline": "Browse and discover the public three.ws agent marketplace and skills catalog. Read-only.",
+ "category": "agent-economy",
+ "tags": [
+ "marketplace",
+ "agents",
+ "skills",
+ "discovery",
+ "read-only"
+ ],
+ "examplePrompts": [
+ "Browse trading agents on the three.ws marketplace.",
+ "Show details for this agent.",
+ "List the available agent skill categories."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fmarketplace-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/naming-mcp",
+ "title": "three.ws Naming",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/naming-mcp",
+ "npmPackage": "@three-ws/naming-mcp",
+ "version": "0.1.1",
+ "description": "On-chain identity for AI agents: resolve .sol names, reverse-lookup wallets, check handles.",
+ "tagline": "On-chain identity for AI agents: resolve .sol names, reverse-lookup wallets, check handle availability.",
+ "category": "identity",
+ "tags": [
+ "sns",
+ "naming",
+ "sol",
+ "identity",
+ "resolve"
+ ],
+ "examplePrompts": [
+ "Resolve alice.sol to a wallet address.",
+ "Reverse-lookup the .sol name for this wallet.",
+ "Is nova.threews.sol available?"
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fnaming-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/notifications-mcp",
+ "title": "three.ws Notifications",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/notifications-mcp",
+ "npmPackage": "@three-ws/notifications-mcp",
+ "version": "0.1.1",
+ "description": "Read the inbox, mark items read, manage delivery preferences, and register Web Push devices.",
+ "tagline": "An agent's inbox — read notifications, mark them read, manage delivery preferences, and register Web Push devices.",
+ "category": "account",
+ "tags": [
+ "notifications",
+ "inbox",
+ "web-push",
+ "preferences",
+ "agents"
+ ],
+ "examplePrompts": [
+ "Show my unread notifications.",
+ "Mark all notifications as read.",
+ "Turn off Telegram delivery and keep Web Push."
+ ],
+ "requiredEnv": [
+ "THREE_WS_API_KEY"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fnotifications-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/portfolio-mcp",
+ "title": "three.ws Portfolio",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/portfolio-mcp",
+ "npmPackage": "@three-ws/portfolio-mcp",
+ "version": "0.1.0",
+ "description": "An agent's trading state — portfolio value, PnL, live balances, trade feed, and signed transfers.",
+ "tagline": "An agent's trading state — portfolio value, PnL, live balances, trade feed, and signed transfers.",
+ "category": "trading",
+ "tags": [
+ "portfolio",
+ "pnl",
+ "balances",
+ "transfers",
+ "solana"
+ ],
+ "examplePrompts": [
+ "What is my portfolio value and PnL?",
+ "Show my live token balances.",
+ "Send 0.1 SOL to this address."
+ ],
+ "requiredEnv": [
+ "SOLANA_SECRET_KEY"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fportfolio-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/provenance-mcp",
+ "title": "three.ws Provenance",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/provenance-mcp",
+ "npmPackage": "@three-ws/provenance-mcp",
+ "version": "0.1.1",
+ "description": "Append-only, signed, on-chain-verifiable agent action log — record and audit what agents did.",
+ "tagline": "Append-only, signed, on-chain-verifiable agent action log — record and audit what agents did.",
+ "category": "identity",
+ "tags": [
+ "provenance",
+ "audit",
+ "signed",
+ "on-chain",
+ "agents"
+ ],
+ "examplePrompts": [
+ "Record this action to my provenance log.",
+ "List my agent's recent actions.",
+ "Verify this logged action is untampered."
+ ],
+ "requiredEnv": [
+ "THREE_WS_TOKEN"
+ ],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fprovenance-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/pumpfun-solana-mcp",
+ "title": "pump.fun Solana Data",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/pumpfun-mcp",
+ "npmPackage": "@three-ws/pumpfun-mcp",
+ "version": "0.2.2",
+ "description": "Free, read-only pump.fun + Solana MCP: token discovery, on-chain analysis, SNS, 3D snapshots.",
+ "tagline": "Free, read-only pump.fun + Solana MCP: token discovery, on-chain analysis, SNS, 3D snapshots.",
+ "category": "market-data",
+ "tags": [
+ "pumpfun",
+ "solana",
+ "sns",
+ "analysis",
+ "free"
+ ],
+ "examplePrompts": [
+ "Analyze this pump.fun token and its holders.",
+ "Resolve this .sol name to a wallet.",
+ "Snapshot this token as a 3D object."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fpumpfun-solana-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/scene-mcp",
+ "title": "three.ws Scenes",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/scene-mcp",
+ "npmPackage": "@three-ws/scene-mcp",
+ "version": "0.1.1",
+ "description": "Compose a placed 3D diorama from one sentence, then browse the saved scene gallery.",
+ "tagline": "Speak a placed 3D diorama into being from one sentence, then browse the saved scene gallery.",
+ "category": "3d",
+ "tags": [
+ "3d",
+ "scene",
+ "diorama",
+ "text-to-scene",
+ "gallery"
+ ],
+ "examplePrompts": [
+ "Compose a 3D scene: a campfire ringed by three tents at dusk.",
+ "Show me the scene I just made.",
+ "List the latest community scenes."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fscene-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/signals-mcp",
+ "title": "three.ws Signals",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/signals-mcp",
+ "npmPackage": "@three-ws/signals-mcp",
+ "version": "0.1.1",
+ "description": "Discover signal feeds ranked by proven edge, rank publishers, and subscribe + track results.",
+ "tagline": "Discover signal feeds ranked by proven edge, rank publishers, and subscribe + track results.",
+ "category": "market-data",
+ "tags": [
+ "signals",
+ "feeds",
+ "edge",
+ "publishers",
+ "subscriptions"
+ ],
+ "examplePrompts": [
+ "List signal feeds ranked by proven edge.",
+ "Subscribe to this signal feed.",
+ "Show the mirror leaderboard of top publishers."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fsignals-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/three-token-mcp",
+ "title": "$THREE Token",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/three-token-mcp",
+ "npmPackage": "@three-ws/three-token-mcp",
+ "version": "1.1.1",
+ "description": "Price, hold, and burn $THREE on Solana — the first MCP server whose actions burn a token.",
+ "tagline": "Price, hold, and burn $THREE on Solana — the first MCP server whose actions burn a token.",
+ "category": "payments",
+ "tags": [
+ "three",
+ "solana",
+ "burn",
+ "token",
+ "defi"
+ ],
+ "examplePrompts": [
+ "What is the current $THREE price?",
+ "Check my $THREE balance.",
+ "Burn 1000 $THREE from my wallet."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fthree-token-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/threews-avatar",
+ "title": "three.ws Avatars",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/avatar-mcp",
+ "npmPackage": "@three-ws/avatar-mcp",
+ "version": "0.3.0",
+ "description": "three.ws 3D avatars in your agent: render a live, interactive 3D avatar inline, or get an embed.",
+ "tagline": "Drop a live, interactive 3D avatar into any agent chat, or get an embed snippet.",
+ "category": "avatars",
+ "tags": [
+ "avatars",
+ "embed",
+ "3d",
+ "chat-ui",
+ "gltf"
+ ],
+ "examplePrompts": [
+ "Render a live 3D avatar for agent nova in this chat.",
+ "Give me an embed code for this avatar.",
+ "Fetch the GLB and metadata for this avatar id."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fthreews-avatar",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/tutor-mcp",
+ "title": "three.ws Tutor",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/tutor-mcp",
+ "npmPackage": "@three-ws/tutor-mcp",
+ "version": "0.1.0",
+ "description": "Read a Pay-As-You-Learn tutoring session's itemized tab and close it for an attested invoice.",
+ "tagline": "Read a Pay-As-You-Learn tutoring session's itemized tab and close it for an attested invoice.",
+ "category": "learning",
+ "tags": [
+ "tutor",
+ "learning",
+ "ledger",
+ "invoice",
+ "pay-as-you-learn"
+ ],
+ "examplePrompts": [
+ "Show the itemized tab for my tutoring session.",
+ "Close this session and give me the invoice.",
+ "How much have I spent this session?"
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Ftutor-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/vanity-mcp",
+ "title": "three.ws Vanity",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/vanity-mcp",
+ "npmPackage": "@three-ws/vanity-mcp",
+ "version": "0.1.1",
+ "description": "Read the three.ws vanity-address market: quote difficulty + USDC price, browse the board.",
+ "tagline": "Read the three.ws vanity-address market: quote difficulty and USDC price, browse the board.",
+ "category": "market-data",
+ "tags": [
+ "vanity",
+ "solana",
+ "addresses",
+ "market",
+ "bounties"
+ ],
+ "examplePrompts": [
+ "Quote the difficulty and price for a wallet ending in THREE.",
+ "Browse the vanity-address board.",
+ "Appraise the rarity of this vanity address."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fvanity-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/vision-mcp",
+ "title": "three.ws Vision",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/vision-mcp",
+ "npmPackage": "@three-ws/vision-mcp",
+ "version": "0.1.1",
+ "description": "Image understanding for AI agents — analyze and describe any image via the three.ws pipeline.",
+ "tagline": "Image understanding for AI agents — analyze and describe any image via the three.ws pipeline.",
+ "category": "ai-models",
+ "tags": [
+ "vision",
+ "image",
+ "analysis",
+ "captioning",
+ "ai"
+ ],
+ "examplePrompts": [
+ "Describe what is in this image.",
+ "Analyze this screenshot and list the UI elements.",
+ "What breed of dog is in this photo?"
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fvision-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/x402-bridge",
+ "title": "x402 Universal Payer",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/mcp-bridge",
+ "npmPackage": "@three-ws/mcp-bridge",
+ "version": "1.0.1",
+ "description": "Pay any x402 endpoint on the open web: auto-paying bridge with Bazaar discovery and spend caps.",
+ "tagline": "An auto-paying bridge that pays any x402 endpoint on the open web, with Bazaar discovery and spend caps.",
+ "category": "payments",
+ "tags": [
+ "x402",
+ "bridge",
+ "auto-pay",
+ "spend-caps",
+ "usdc"
+ ],
+ "examplePrompts": [
+ "Pay this x402 URL and return the response, capped at $0.10 total.",
+ "Discover a weather x402 API and call it.",
+ "Set a per-call spend cap and pay this endpoint."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fx402-bridge",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ },
+ {
+ "name": "io.github.nirholas/x402-mcp",
+ "title": "x402 Wallet",
+ "type": "stdio",
+ "transport": "stdio",
+ "connect": "npx -y @three-ws/x402-mcp",
+ "npmPackage": "@three-ws/x402-mcp",
+ "version": "0.2.1",
+ "description": "Self-custodial x402 wallet for AI agents: pay any service in USDC or $THREE from your own key.",
+ "tagline": "Self-custodial x402 wallet for AI agents: find, inspect, and pay any service in USDC or $THREE from your own key.",
+ "category": "payments",
+ "tags": [
+ "x402",
+ "wallet",
+ "usdc",
+ "self-custodial",
+ "payments"
+ ],
+ "examplePrompts": [
+ "Find x402 services that generate images.",
+ "Inspect the price of this x402 endpoint before paying.",
+ "Pay and call this x402 endpoint with a $0.05 cap."
+ ],
+ "requiredEnv": [],
+ "websiteUrl": "https://three.ws",
+ "repository": "https://github.com/nirholas/three.ws",
+ "registryUrl": "https://registry.modelcontextprotocol.io/?q=io.github.nirholas%2Fx402-mcp",
+ "icon": "https://three.ws/three-ws-mcp-icon.svg"
+ }
+ ]
+}
diff --git a/prompts/store-submissions/_generated/openai-actions.yaml b/prompts/store-submissions/_generated/openai-actions.yaml
index 01b020be3..b104947e1 100644
--- a/prompts/store-submissions/_generated/openai-actions.yaml
+++ b/prompts/store-submissions/_generated/openai-actions.yaml
@@ -25,8 +25,8 @@ info:
url: https://three.ws/legal/tos.html
servers:
- url: https://three.ws
-# No authentication: the free text-to-3D lane needs no API key, account, or
-# wallet. An explicit empty root security requirement declares that plainly.
+# No authentication: the free text-to-3D lane needs no API key and no account.
+# An explicit empty root security requirement declares that plainly.
security: []
paths:
/api/3d/studio:
diff --git a/prompts/store-submissions/_generated/openai-gpt-config.md b/prompts/store-submissions/_generated/openai-gpt-config.md
new file mode 100644
index 000000000..7e6fa64f0
--- /dev/null
+++ b/prompts/store-submissions/_generated/openai-gpt-config.md
@@ -0,0 +1,214 @@
+# three.ws 3D Studio — GPT Store build sheet
+
+Everything a human needs to build and submit the **three.ws 3D Studio** custom GPT
+at [chatgpt.com/gpts/editor](https://chatgpt.com/gpts/editor). Paste each section
+into the matching field of the GPT builder's **Configure** tab. This GPT wraps one
+free, keyless REST surface (`/api/3d/studio`) and carries **zero** crypto, token,
+wallet, or payment surface — see the compliance audit at the bottom.
+
+The GPT Store and the OpenAI Apps directory (submissions 04–06) are **different**
+marketplaces. This is the low-effort GPT Store path: an OpenAPI Actions schema, no
+embedded component, no SDK build.
+
+---
+
+## 1. Name
+
+```
+three.ws 3D Studio
+```
+
+## 2. Description (short, shown in the store)
+
+```
+Turn any idea into a real, downloadable 3D model. Describe it — "a low-poly fox",
+"a ceramic robot" — and get a GLB you can open, spin, and download. Free.
+```
+
+## 3. Profile picture
+
+Reuse the asset kit from submission 14. Use the square studio icon:
+
+- **File:** `prompts/store-submissions/_generated/assets/icon-512x512.png`
+ (512×512 PNG; the GPT builder crops to a circle — the icon's mark is centered
+ with safe padding, so the crop is clean).
+- Source vector if a re-export is needed: `assets/icon.svg`.
+- `[HUMAN: upload icon-512x512.png as the GPT profile picture. Do NOT use the
+ DALL·E "generate" button — the branded mark must be used, not a random image.]`
+
+## 4. Instructions (paste verbatim into "Instructions")
+
+```
+You are three.ws 3D Studio. You turn a user's text description into a real,
+downloadable 3D model (GLB) using the three.ws generation Actions. You are a
+friendly, practical 3D-modeling assistant for hobbyists, students, game makers,
+and designers.
+
+WHAT YOU DO
+- When the user describes an object, character, prop, or creature they want as a
+ 3D model, call the generate3DModel action with a single clear "prompt".
+- Rewrite vague requests into ONE concrete subject before calling. Good prompts
+ name the subject, its style, and key colors, e.g. "a low-poly orange fox sitting
+ down" or "a small ceramic robot figurine with round eyes". Keep it to one
+ subject — the generator models a single object best, not whole scenes.
+- If the user gives you plenty of detail already, pass it through largely as-is.
+
+HANDLING THE RESPONSE
+- generate3DModel returns a "status".
+ - status "done": the model is ready. Present TWO links clearly:
+ • Download (GLB): the "glbUrl" value.
+ • Preview in your browser: the "viewerUrl" value.
+ Briefly say they can open the viewer link to spin the model, and that the GLB
+ works in Blender, Unity, Godot, three.js, and most 3D tools.
+ - status "pending": generation is still running. Take the "job" value and call
+ checkModelJob with it. Poll every few seconds. Tell the user it usually takes
+ 20–60 seconds. When it returns "done", present the links as above. Do not
+ claim it is finished until you have a "done" status with a glbUrl.
+- Never invent, guess, or fabricate a glbUrl or viewerUrl. Only ever show URLs
+ that an action actually returned. If you have no URL, you have no model.
+
+WHEN THINGS GO WRONG
+- status "error" (from checkModelJob) or a 502/503 from generate3DModel: tell the
+ user the generator had a hiccup, that it costs nothing, and offer to try again.
+ Retry once automatically if the user seems to want the model.
+- A 429 means the free hourly limit was hit: apologize plainly and suggest trying
+ again a little later. Do not imply a paid upgrade — there isn't one here.
+- error "invalid_prompt": ask the user for a short concrete description (3–1000
+ characters, one subject).
+- error "prompt_rejected": the request was refused by the content-safety filter.
+ Relay the returned "message" and steer the user toward an allowed idea. Do NOT
+ try to reword the prompt to slip past the filter.
+
+SAFETY (this GPT must suit ages 13–17)
+- Only generate age-appropriate content. Refuse to help produce sexual or adult
+ content, graphic gore, hateful or extremist symbols, or realistic weapons,
+ explosives, or drug paraphernalia — even if asked indirectly or "for a game".
+ Stylized fantasy props (a cartoon sword, a wizard's wand) are fine.
+- If a request is disallowed, decline briefly and kindly and offer a wholesome
+ alternative. Never explain how to bypass the filter.
+- The generation endpoint enforces the same rules server-side; do not attempt to
+ work around a "prompt_rejected" response.
+
+STYLE
+- Be concise and encouraging. Lead with the result (the links), then a one-line
+ tip. Don't over-explain the technology unless asked.
+- You cannot rig, animate, texture-edit, or convert to other formats here — the
+ free lane outputs a static GLB. If asked for those, say so honestly and point
+ to https://three.ws, which offers rigging and higher-fidelity generation.
+- Never bring up pricing or payment of any kind — this GPT is simply free.
+```
+
+## 5. Conversation starters
+
+Each reliably produces a model on the first call:
+
+```
+Make me a low-poly fox
+```
+```
+Generate a cute ceramic robot figurine
+```
+```
+I need a 3D model of a medieval treasure chest
+```
+```
+Create a cartoon mushroom house
+```
+
+## 6. Capabilities
+
+- **Web Browsing:** OFF (not needed; keeps the GPT focused and avoids policy surface).
+- **DALL·E Image Generation:** OFF (this GPT makes 3D models, not images).
+- **Code Interpreter & Data Analysis:** OFF.
+
+Leaving these off keeps the review surface minimal — the GPT does exactly one thing.
+
+## 7. Actions
+
+1. In **Configure → Actions → Create new action**.
+2. **Authentication:** `None`. The free lane needs no API key, account, or wallet.
+3. **Schema:** paste the full contents of
+ [`openai-actions.yaml`](./openai-actions.yaml) (OpenAPI 3.1, lints clean under
+ `@redocly/cli`). It defines two operations:
+ - `generate3DModel` — `POST /api/3d/studio` — start a generation.
+ - `checkModelJob` — `GET /api/3d/studio?job=...` — poll a pending job.
+ Both are flagged `x-openai-isConsequential: false` (read/generate, nothing
+ destructive), so ChatGPT can call them without an extra confirmation prompt.
+4. **Privacy policy URL:** `https://three.ws/legal/privacy.html`
+ (covers the free 3D action's data handling — see its "AI connectors & Actions"
+ section).
+
+## 8. Sharing / submission
+
+- Set **Share → "Everyone"** to list it in the GPT Store, and pick a category
+ (**Productivity** or **DALL·E / Creative**; "Programming" also fits).
+- `[HUMAN: GPT Store listing requires a verified Builder Profile — a verified
+ name or a verified public website domain (three.ws). Verify under Settings →
+ Builder profile before submitting.]`
+- `[HUMAN: final "Create" / "Update" then "Confirm" to publish. Only the account
+ owner can do this.]`
+
+---
+
+## Compliance audit (evidence)
+
+Run from repo root. All three checks must be clean before submitting.
+
+**a) Zero crypto/token/wallet surface** across the endpoint and the Actions
+schema (the two artifacts that actually ship to OpenAG's servers and to the GPT
+builder). The exact identifier list from the brief — `coin/token/wallet/x402/
+pump/aixbt/$THREE` — returns no matches:
+
+```
+$ grep -rniE 'coin|token|wallet|x402|pump|aixbt|\$three' \
+ api/3d/studio.js \
+ prompts/store-submissions/_generated/openai-actions.yaml
+$ echo "exit: $?"
+exit: 1 # grep found nothing → clean
+```
+
+The GPT-facing copy pasted into the builder (name, description, instructions §4,
+conversation starters §5) likewise contains none of these terms. (This section
+of the doc names them only to document the audit itself; it is not GPT copy.)
+
+**b) No payment/checkout surface.** The action's only server route is
+`/api/3d/studio`, which returns `{ status, glbUrl, viewerUrl, format }` (or a
+`{ status: 'pending', job, poll }`) and never a price, invoice, x402 challenge,
+or wallet field. Verified by the response-contract test in
+`tests/api/3d-studio.test.js` (`expectCleanWire` asserts no
+`x402|wallet|coin|upgrade|price|usd|creation_id|token` substring in any body).
+
+**c) Real generation, no internal IDs / PII.** A live call through the actual
+handler against the production lane:
+
+```
+POST /api/3d/studio {"prompt":"a low-poly orange fox sitting down"}
+→ 200 (22.6s)
+{
+ "status": "done",
+ "glbUrl": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/04818491-d43e-4576-b245-22743bf125a6.glb",
+ "viewerUrl": "https://three.ws/viewer?src=https%3A%2F%2Fpub-...04818491...glb",
+ "format": "glb"
+}
+```
+
+The GLB downloads over HTTPS (2,418,040 bytes, `glTF` magic header — a real binary
+glTF). The response carries only the public model URL, the viewer link, and
+`format` — no session id, trace id, wallet address, creator address, `creation_id`,
+or any PII. (The internal `creation_id` that `/api/forge` emits is deliberately
+dropped by `shapeSubmit`.)
+
+**d) NSFW / abuse safety on the generation lane.** Every prompt passes
+`checkPromptSafety` (`api/_mcp-studio/safety.js`) BEFORE any GPU work or quota
+spend. It refuses sexual/adult, child-sexual, gore, hate/extremist, and
+real-weapon/drug prompts with a `400 prompt_rejected` and an age-appropriate
+message. Verified live:
+
+```
+POST /api/3d/studio {"prompt":"a nude statue"}
+→ 400 {"error":"prompt_rejected","message":"This 3D Studio is rated for ages 13+
+ and cannot generate sexual or adult content. ..."}
+```
+
+The GPT instructions (§4) mirror this so the model refuses at the conversation
+layer too — defense in depth.
diff --git a/prompts/store-submissions/_generated/openai-tool-evidence.txt b/prompts/store-submissions/_generated/openai-tool-evidence.txt
new file mode 100644
index 000000000..9237b2292
--- /dev/null
+++ b/prompts/store-submissions/_generated/openai-tool-evidence.txt
@@ -0,0 +1,51 @@
+
+===== forge_free — real generation (45913ms) =====
+{
+ "jsonrpc": "2.0",
+ "id": 1,
+ "result": {
+ "content": [
+ {
+ "type": "text",
+ "text": "Generated a 3D model (GLB). View it: https://three.ws/viewer?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2F456f0f83-597d-4746-8fff-38933a1d695f.glb\nDownload: https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/456f0f83-597d-4746-8fff-38933a1d695f.glb"
+ }
+ ],
+ "structuredContent": {
+ "kind": "model",
+ "glbUrl": "https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/456f0f83-597d-4746-8fff-38933a1d695f.glb",
+ "viewerUrl": "https://three.ws/viewer?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2F456f0f83-597d-4746-8fff-38933a1d695f.glb",
+ "format": "glb",
+ "prompt": "a small ceramic teapot with a bamboo handle, glossy celadon glaze"
+ }
+ }
+}
+
+===== forge_free — safety refusal (explicit prompt) (1ms) =====
+{
+ "jsonrpc": "2.0",
+ "id": 2,
+ "result": {
+ "content": [
+ {
+ "type": "text",
+ "text": "This 3D Studio is rated for ages 13+ and cannot generate sexual or adult content. Try describing a character, creature, or object without explicit themes."
+ }
+ ],
+ "structuredContent": {
+ "error": true,
+ "message": "This 3D Studio is rated for ages 13+ and cannot generate sexual or adult content. Try describing a character, creature, or object without explicit themes."
+ },
+ "isError": true
+ }
+}
+{"lvl":"warn","name":"mcp-studio","msg":"rpc_error","method":"tools/call","code":-32602,"message":"invalid params for forge_free: /prompt must NOT have fewer than 3 characters"}
+
+===== forge_free — validation (empty prompt) (0ms) =====
+{
+ "jsonrpc": "2.0",
+ "id": 3,
+ "error": {
+ "code": -32602,
+ "message": "invalid params for forge_free: /prompt must NOT have fewer than 3 characters"
+ }
+}
diff --git a/public/changelog.json b/public/changelog.json
index 1443a6dd1..885716e5f 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-07T08:56:28.712Z",
+ "generated_at": "2026-07-07T11:29:21.993Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -89,6 +89,16 @@
"fix"
]
},
+ {
+ "date": "2026-07-07",
+ "type": "update",
+ "title": "Find the wallet grinder from the contract grinder",
+ "summary": "The two EVM vanity tools now point at each other. The CREATE2 grinder — which searches a salt for a vanity smart-contract address, with no private key involved — now carries a note explaining that difference and linking to the EVM Vanity Wallet generator for anyone who actually wants a wallet they hold the key to. The wallet generator already linked back; this closes the loop so you can no longer land on one and miss the other.",
+ "link": "/eth-vanity",
+ "tags": [
+ "improvement"
+ ]
+ },
{
"date": "2026-07-07",
"type": "update",
@@ -326,6 +336,27 @@
"feature"
]
},
+ {
+ "date": "2026-07-07",
+ "type": "update",
+ "title": "The animation library API now pages, so it stays fast as the catalog grows",
+ "summary": "The motion library is heading past its current 2,800+ clips as we add generatively-produced animations. Its public API (GET /api/animations/library) can now return the catalog in bounded pages — pass ?limit and ?offset and page until there's no next_offset — so a single response never balloons no matter how large the library gets. The /animations gallery already fetches the catalog this way. Calling it with no parameters still returns the whole list exactly as before, so nothing built on the old behavior breaks.",
+ "link": "/animations",
+ "tags": [
+ "improvement",
+ "infra"
+ ]
+ },
+ {
+ "date": "2026-07-07",
+ "type": "update",
+ "title": "The free 3D Studio in ChatGPT stays up even when our rate-limiter has a blip",
+ "summary": "The free 3D Studio generates entirely on no-cost engines, so there's no spend to protect by shutting it off. We fixed a case where a hiccup in the rate-limiting backend could make the studio refuse every generation with a \"try again shortly\" — an outage of a free feature for no reason. Its usage caps now stay enforced when everything is healthy but step aside during a backend blip, so a prompt still returns your model. Nothing about paid features changed: those still stop safely if the same backend is unavailable.",
+ "link": null,
+ "tags": [
+ "fix"
+ ]
+ },
{
"date": "2026-07-07",
"type": "update",
@@ -337,6 +368,27 @@
"docs"
]
},
+ {
+ "date": "2026-07-07",
+ "type": "update",
+ "title": "three.ws 3D Studio for the GPT Store — generate 3D models in ChatGPT, free",
+ "summary": "You can now turn a text prompt into a real, downloadable 3D model right inside ChatGPT. The three.ws 3D Studio custom GPT is backed by a free, keyless REST endpoint — describe something like \"a low-poly fox\" or \"a ceramic robot figurine\" and get back a GLB you can open in Blender, Unity, Godot, or three.js, plus a browser viewer link. No account, no key, no cost. Every prompt is screened by a content-safety filter so it stays appropriate for all ages, and the model file is served from a public URL so it's easy to download and share.",
+ "link": null,
+ "tags": [
+ "feature"
+ ]
+ },
+ {
+ "date": "2026-07-07",
+ "type": "update",
+ "title": "three.ws Agent Skills pack — for any Claude surface",
+ "summary": "Everything three.ws can do is now packaged as portable Agent Skills — self-contained folders that teach any Claude (Claude Code, the Claude apps, or an Agent SDK build) how to use the platform: generate a 3D model from text, make a rigged avatar, rig a GLB you already have, run a wallet, and buy or sell services in the x402 agent economy. Forty skills in all, each with a precise trigger and runnable examples, grouped into three sets — 3D creation, wallet & payments, and market intelligence. The three 3D-creation skills are the newest and run free with no key or account. Install the pack as a Claude Code plugin, drop a skill folder into any project, or upload one to a Claude project.",
+ "link": null,
+ "tags": [
+ "sdk",
+ "feature"
+ ]
+ },
{
"date": "2026-07-07",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 9e57e736f..6976df4da 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -70,6 +70,14 @@
<category>improvement</category>
<description>Text-to-3D prompts that name an art style — &quot;a cartoon fox,&quot; &quot;a stylized robot&quot; — now reliably produce a single, cleanly-isolated model instead of one baked into a busy background scene. The image step that seeds every 3D generation was skipping its &quot;isolated subject on a plain white background&quot; instruction whenever a prompt mentioned a style, which let the image model paint a whole illustrated scene the 3D reconstructor then struggled with. It now keeps that isolation instruction for stylized subjects (and no longer trips on unrelated words like &quot;lightsaber&quot;), so stylized characters and props reconstruct as sharp standalone assets.</description>
</item>
+ <item>
+ <title>Find the wallet grinder from the contract grinder</title>
+ <link>https://three.ws/eth-vanity</link>
+ <guid isPermaLink="false">2026-07-07:Find the wallet grinder from the contract grinder</guid>
+ <pubDate>Tue, 07 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>The two EVM vanity tools now point at each other. The CREATE2 grinder — which searches a salt for a vanity smart-contract address, with no private key involved — now carries a note explaining that difference and linking to the EVM Vanity Wallet generator for anyone who actually wants a wallet they hold the key to. The wallet generator already linked back; this closes the loop so you can no longer land on one and miss the other.</description>
+ </item>
<item>
<title>Forge listing sharpened: clear 3D generation tiers for agents</title>
<link>https://three.ws/docs/3d-api</link>
@@ -254,6 +262,22 @@
<category>feature</category>
<description>Every working stage of the platform's 3D pipeline is now its own pay-per-call x402 endpoint, so an agent can buy exactly the step it needs and get a finished asset URL back in one call — no account, no API key. Rig a static model into an animation-ready one ($0.05), remesh or retopologize to a clean topology ($0.03), make a mesh game-ready to a poly budget ($0.03), geometrically restyle it — voxel, brick, voronoi, low-poly ($0.03), or strip an image's background to a transparent PNG for image→3D ($0.01). Each call validates your input, runs the real worker, checks the output is a valid asset, and hands back a durable first-party URL — and if anything fails, you're never charged. Nobody else in the x402 ecosystem sells a 3D asset pipeline.</description>
</item>
+ <item>
+ <title>The animation library API now pages, so it stays fast as the catalog grows</title>
+ <link>https://three.ws/animations</link>
+ <guid isPermaLink="false">2026-07-07:The animation library API now pages, so it stays fast as the catalog grows</guid>
+ <pubDate>Tue, 07 Jul 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>The motion library is heading past its current 2,800+ clips as we add generatively-produced animations. Its public API (GET /api/animations/library) can now return the catalog in bounded pages — pass ?limit and ?offset and page until there's no next_offset — so a single response never balloons no matter how large the library gets. The /animations gallery already fetches the catalog this way. Calling it with no parameters still returns the whole list exactly as before, so nothing built on the old behavior breaks.</description>
+ </item>
+ <item>
+ <title>The free 3D Studio in ChatGPT stays up even when our rate-limiter has a blip</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-07:The free 3D Studio in ChatGPT stays up even when our rate-limiter has a blip</guid>
+ <pubDate>Tue, 07 Jul 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>The free 3D Studio generates entirely on no-cost engines, so there's no spend to protect by shutting it off. We fixed a case where a hiccup in the rate-limiting backend could make the studio refuse every generation with a &quot;try again shortly&quot; — an outage of a free feature for no reason. Its usage caps now stay enforced when everything is healthy but step aside during a backend blip, so a prompt still returns your model. Nothing about paid features changed: those still stop safely if the same backend is unavailable.</description>
+ </item>
<item>
<title>three.ws 3D API: free text→3D + inspection for AI agents, with pro tiers</title>
<link>https://three.ws/3d</link>
@@ -262,6 +286,22 @@
<category>feature</category>
<description>One URL now discovers the whole free, keyless 3D API for agents. GET /api/3d returns every free endpoint — turn a text prompt into a real GLB (/api/3d/generate) and validate/optimize any glTF/GLB (/api/3d/inspect) — with a live example each, plus the paid ladder it graduates to. GET /api/3d/openapi.json is a real OpenAPI 3.1 spec generated straight from the catalog, so LangChain, openapi-generator, and Swagger UI get typed tools with no key and no account. A new docs page at /3d shows a hero, a live endpoint table, a runnable quickstart with a &quot;run it live&quot; inspection console, an embedded 3D viewer of a real model, and a clear free→paid path: free draft + inspect → Forge Pro quality tiers → animation-ready Rigged Avatars. No other agent-payments platform gives away 3D generation and inspection.</description>
</item>
+ <item>
+ <title>three.ws 3D Studio for the GPT Store — generate 3D models in ChatGPT, free</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-07:three.ws 3D Studio for the GPT Store — generate 3D models in ChatGPT, free</guid>
+ <pubDate>Tue, 07 Jul 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>You can now turn a text prompt into a real, downloadable 3D model right inside ChatGPT. The three.ws 3D Studio custom GPT is backed by a free, keyless REST endpoint — describe something like &quot;a low-poly fox&quot; or &quot;a ceramic robot figurine&quot; and get back a GLB you can open in Blender, Unity, Godot, or three.js, plus a browser viewer link. No account, no key, no cost. Every prompt is screened by a content-safety filter so it stays appropriate for all ages, and the model file is served from a public URL so it's easy to download and share.</description>
+ </item>
+ <item>
+ <title>three.ws Agent Skills pack — for any Claude surface</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-07-07:three.ws Agent Skills pack — for any Claude surface</guid>
+ <pubDate>Tue, 07 Jul 2026 12:00:00 GMT</pubDate>
+ <category>sdk</category>
+ <description>Everything three.ws can do is now packaged as portable Agent Skills — self-contained folders that teach any Claude (Claude Code, the Claude apps, or an Agent SDK build) how to use the platform: generate a 3D model from text, make a rigged avatar, rig a GLB you already have, run a wallet, and buy or sell services in the x402 agent economy. Forty skills in all, each with a precise trigger and runnable examples, grouped into three sets — 3D creation, wallet &amp; payments, and market intelligence. The three 3D-creation skills are the newest and run free with no key or account. Install the pack as a Claude Code plugin, drop a skill folder into any project, or upload one to a Claude project.</description>
+ </item>
<item>
<title>three.ws Crypto Data API: one free, keyless crypto data bundle for AI agents</title>
<link>https://three.ws/docs/crypto-api</link>
diff --git a/public/features.json b/public/features.json
index 06f4e0f6f..c7c24a2ea 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-07T08:56:28.695Z",
+ "generated_at": "2026-07-07T11:29:21.976Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/legal/privacy.html b/public/legal/privacy.html
index fda2578eb..9f5c21137 100644
--- a/public/legal/privacy.html
+++ b/public/legal/privacy.html
@@ -128,6 +128,15 @@
<li><strong>Retention of tool inputs:</strong> tool-call inputs and outputs follow the usage-data retention in Section 5 (90 days), except content you explicitly save (e.g. a saved avatar), which is retained as account content until you delete it.</li>
</ul>
+ <h2>10a. Free 3D Actions (ChatGPT / GPT Store)</h2>
+ <p>three.ws also exposes a free, keyless REST endpoint, <code>https://three.ws/api/3d/studio</code>, used by the <em>three.ws 3D Studio</em> custom GPT (and any OpenAPI Action client) to turn a text prompt into a downloadable 3D model. This lane involves no account, no API key, and no payment, so none of the wallet, payment, or OAuth data described in Section 10 applies to it.</p>
+ <ul>
+ <li><strong>What we receive:</strong> only the text prompt you send. We do not ask for, receive, or store any name, email, wallet address, or other personal information through this endpoint.</li>
+ <li><strong>How the prompt is used:</strong> the prompt is forwarded to our generation provider (NVIDIA NIM / Microsoft TRELLIS) solely to produce the model. Do not include personal or confidential information in the prompt.</li>
+ <li><strong>What we return:</strong> a public URL to the generated GLB model (hosted on our Cloudflare R2 CDN) and a link to view it. The response contains no account identifiers or personal data. Generated model files are served from public URLs so you can download and share them; treat a model URL as public.</li>
+ <li><strong>Abuse prevention:</strong> requests are rate-limited by IP address, used only to prevent abuse of the free lane, and prompts are screened by an automated content-safety filter so the service stays appropriate for all ages.</li>
+ </ul>
+
<h2>11. Changes to This Policy</h2>
<p>We may update this Privacy Policy. We will notify you of material changes by email or a prominent notice on the Service. The "Effective" date at the top reflects the most recent revision.</p>
diff --git a/scripts/okx-identity-demo.mjs b/scripts/okx-identity-demo.mjs
index 3575a2cb4..a6c8a9598 100644
--- a/scripts/okx-identity-demo.mjs
+++ b/scripts/okx-identity-demo.mjs
@@ -18,8 +18,11 @@ import { readFileSync, writeFileSync } from 'node:fs';
import { resolve } from 'node:path';
const DATA_PATH = resolve(import.meta.dirname, '../data/agent-identities.json');
-const POLL_MS = 5000;
-const TIMEOUT_MS = 15 * 60 * 1000;
+// Overridable so a batch run can outlast the rig lane's rate-limit backoff
+// windows (the paid mcp3d:generate bucket is 30/h per IP; a single 429 parks the
+// job for up to 5 min). Defaults suit a single, unthrottled run.
+const POLL_MS = Number(process.env.IDENTITY_DEMO_POLL_MS) || 5000;
+const TIMEOUT_MS = Number(process.env.IDENTITY_DEMO_TIMEOUT_MS) || 15 * 60 * 1000;
const { createIdentityJob, advanceIdentityJob, describeIdentityJob } = await import(
'../api/_okx3d/identity.js'
diff --git a/scripts/publish-mcp-servers.mjs b/scripts/publish-mcp-servers.mjs
index f647974bf..83da47f41 100644
--- a/scripts/publish-mcp-servers.mjs
+++ b/scripts/publish-mcp-servers.mjs
@@ -98,6 +98,8 @@ const SERVERS = [
{ key: 'remote-agent', manifest: 'server-agent.json' },
{ key: 'remote-ibm', manifest: 'server-ibm.json' },
{ key: 'remote-bazaar', manifest: 'server-bazaar.json' },
+ // Free, non-crypto 3D Studio (api/mcp-studio.js) for the OpenAI Apps SDK.
+ { key: 'remote-studio', manifest: 'server-studio.json' },
];
const args = process.argv.slice(2);
diff --git a/src/animations-gallery.js b/src/animations-gallery.js
index 1ea3954cd..2c39049fc 100644
--- a/src/animations-gallery.js
+++ b/src/animations-gallery.js
@@ -10,8 +10,10 @@
//
// All are normalized to one card shape — poster thumbnail, derived category
// (src/animation-categories.js), duration, loop mode — then filtered (search +
-// category + loop/once), sorted, and paginated client-side; even the full
-// catalog is a few hundred KB of metadata.
+// category + loop/once), sorted, and paginated client-side (PAGE_SIZE at a time,
+// infinite-scroll, lazy thumbnails). The full catalog is fetched from the CDN in
+// bounded pages (LIBRARY_PAGE_SIZE) rather than one large response, so a library
+// that grows past thousands of clips never lands as a single unbounded payload.
//
// Previews run through ONE shared WebGL engine (src/animations-live-preview.js):
// hovering a card (or opening the detail modal) moves the singleton canvas into
@@ -30,6 +32,12 @@ const LIBRARY_API = '/api/animations/library';
const PAGE_SIZE = 36;
// Cap community pagination so a large catalog can't stall first paint.
const COMMUNITY_MAX = 300;
+// Page size for the full CDN catalog fetch. Matches the endpoint's max page so
+// each response stays bounded (~400 KB) as the library grows past thousands of
+// clips, instead of one ever-growing blob. A hard ceiling of pages guards
+// against a runaway manifest.
+const LIBRARY_PAGE_SIZE = 1000;
+const LIBRARY_MAX_PAGES = 50;
const HOVER_DELAY_MS = 130;
const REDUCED_MOTION = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
@@ -135,10 +143,23 @@ async function fetchCommunity() {
}
async function fetchFullLibrary() {
- const res = await fetch(LIBRARY_API);
- if (!res.ok) throw new Error(`HTTP ${res.status}`);
- const data = await res.json();
- return (Array.isArray(data.clips) ? data.clips : []).map(normalizeFullLibraryClip);
+ // Page through the catalog with the endpoint's opt-in ?limit/?offset so each
+ // response is bounded and individually CDN-cacheable. The endpoint returns
+ // `next_offset: null` on the last page; the page ceiling is a runaway guard.
+ const out = [];
+ let offset = 0;
+ for (let i = 0; i < LIBRARY_MAX_PAGES; i++) {
+ const res = await fetch(`${LIBRARY_API}?limit=${LIBRARY_PAGE_SIZE}&offset=${offset}`, {
+ cache: 'force-cache',
+ });
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
+ const data = await res.json();
+ const clips = Array.isArray(data.clips) ? data.clips : [];
+ out.push(...clips);
+ if (data.next_offset == null || clips.length === 0) break;
+ offset = data.next_offset;
+ }
+ return out.map(normalizeFullLibraryClip);
}
function normalizeLibraryClip(clip) {
diff --git a/tests/animations-library-endpoint.test.js b/tests/animations-library-endpoint.test.js
index 01b92cd7a..8161dc829 100644
--- a/tests/animations-library-endpoint.test.js
+++ b/tests/animations-library-endpoint.test.js
@@ -18,8 +18,8 @@ vi.mock('../api/_lib/r2.js', () => ({ getObjectBuffer: (...a) => getObjectBuffer
const { default: handler } = await import('../api/animations/library.js');
-function fakeReq(method = 'GET') {
- return { method, url: '/api/animations/library', headers: {} };
+function fakeReq(method = 'GET', url = '/api/animations/library') {
+ return { method, url, headers: {} };
}
function fakeRes() {
@@ -96,4 +96,47 @@ describe('GET /api/animations/library', () => {
await handler(fakeReq('POST'), res);
expect(res.statusCode).toBe(405);
});
+
+ // ── Bounded pagination (opt-in via ?limit) ──────────────────────────────
+ const CLIPS = Array.from({ length: 5 }, (_, i) => ({ ...CLIP, name: `mx-clip-${i}` }));
+
+ it('pages a large manifest with ?limit and exposes next_offset', async () => {
+ getObjectBuffer.mockResolvedValue(Buffer.from(JSON.stringify({ clips: CLIPS })));
+ const res = fakeRes();
+ await handler(fakeReq('GET', '/api/animations/library?limit=2'), res);
+ const body = JSON.parse(res.body);
+ expect(body.total).toBe(5); // full catalog size, not the page size
+ expect(body.clips.map((c) => c.name)).toEqual(['mx-clip-0', 'mx-clip-1']);
+ expect(body.offset).toBe(0);
+ expect(body.next_offset).toBe(2);
+ });
+
+ it('honors ?offset and returns next_offset=null on the final page', async () => {
+ getObjectBuffer.mockResolvedValue(Buffer.from(JSON.stringify({ clips: CLIPS })));
+ const res = fakeRes();
+ await handler(fakeReq('GET', '/api/animations/library?limit=2&offset=4'), res);
+ const body = JSON.parse(res.body);
+ expect(body.clips.map((c) => c.name)).toEqual(['mx-clip-4']);
+ expect(body.offset).toBe(4);
+ expect(body.next_offset).toBe(null);
+ });
+
+ it('returns an empty page (not an error) when offset runs past the end', async () => {
+ getObjectBuffer.mockResolvedValue(Buffer.from(JSON.stringify({ clips: CLIPS })));
+ const res = fakeRes();
+ await handler(fakeReq('GET', '/api/animations/library?limit=2&offset=99'), res);
+ const body = JSON.parse(res.body);
+ expect(body.clips).toEqual([]);
+ expect(body.total).toBe(5);
+ expect(body.next_offset).toBe(null);
+ });
+
+ it('omits pagination fields entirely when ?limit is absent (legacy contract)', async () => {
+ getObjectBuffer.mockResolvedValue(Buffer.from(JSON.stringify({ clips: CLIPS })));
+ const res = fakeRes();
+ await handler(fakeReq('GET', '/api/animations/library'), res);
+ const body = JSON.parse(res.body);
+ expect(body).toEqual({ clips: CLIPS, total: 5, generated_at: null });
+ expect('next_offset' in body).toBe(false);
+ });
});
diff --git a/tests/api/okx-identity-studio.test.js b/tests/api/okx-identity-studio.test.js
index b5e01f493..73b8fb5cc 100644
--- a/tests/api/okx-identity-studio.test.js
+++ b/tests/api/okx-identity-studio.test.js
@@ -60,6 +60,16 @@ vi.mock('../../api/_lib/ssrf-guard.js', () => ({
SsrfBlockedError: class SsrfBlockedError extends Error {},
}));
+// The prompt director runs in-process over the shared llm.js free-provider
+// chain. Mock it: default is "director unavailable" (throws → fallback template,
+// the state a keyless deployment lands in), and a test can install a spy to
+// assert what the director was handed or make it return a shaped prompt.
+const llmSpy = vi.hoisted(() => ({ fn: null }));
+vi.mock('../../api/_lib/llm.js', () => ({
+ llmComplete: (...args) =>
+ llmSpy.fn ? llmSpy.fn(...args) : Promise.reject(new Error('llm unavailable')),
+}));
+
// The pipeline is a pure HTTP client over three.ws surfaces — mock global
// fetch with a tiny programmable router.
const fetchRoutes = { chat: null, forgeSubmit: null, forgePoll: null, rig: null, render: null, ref: null };
@@ -69,7 +79,8 @@ function jsonResponse(status, body) {
const realFetch = globalThis.fetch;
beforeEach(() => {
r2Store.clear();
- fetchRoutes.chat = () => new Response(null, { status: 503 }); // director down → fallback template
+ fetchRoutes.chat = () => new Response(null, { status: 503 }); // legacy: nothing calls /api/chat now
+ llmSpy.fn = null; // default: director unavailable → deterministic fallback template
fetchRoutes.forgeSubmit = () => jsonResponse(200, { job_id: 'forge-gen-1', status: 'queued', eta: 30 });
fetchRoutes.forgePoll = () => jsonResponse(200, { status: 'running' });
fetchRoutes.rig = () => jsonResponse(200, { job_id: 'forge-rig-1', status: 'queued' });
@@ -355,19 +366,41 @@ describe('pipeline state machine', () => {
it('a Chinese brief is accepted and reaches the prompt director verbatim', async () => {
let directorSaw = null;
- fetchRoutes.chat = (u, init) => {
- directorSaw = JSON.parse(init.body).message;
- return new Response(null, { status: 503 });
+ // Director available but returns nothing usable → capture the input, then
+ // fall back. Proves the raw brief + the English-output instruction reach it.
+ llmSpy.fn = async ({ system, user }) => {
+ directorSaw = { system, user };
+ return { text: '' };
};
const brief = '一个冷静精准的链上会计智能体,喜欢深蓝色';
const created = await call('create_identity', { agent_name: '账本猞猁', brief });
expect(created.result.isError).toBeUndefined();
- expect(directorSaw).toContain(brief);
- expect(directorSaw).toContain('ALWAYS write the prompt in English');
- // Fallback template still embeds the brief when the director is down.
+ expect(directorSaw.user).toContain(brief);
+ expect(directorSaw.system).toContain('ALWAYS write the prompt in English');
+ // Fallback template still embeds the brief when the director yields nothing.
expect(created.result.structuredContent.brief_truncated).toBe(false);
});
+ it('a directed prompt is used verbatim when the LLM director succeeds', async () => {
+ const shaped = 'stoic navy-armored auditor android, silver circuit filigree, standing neutral, plain backdrop';
+ // The director is instructed to output ONLY the prompt as a single line;
+ // models routinely wrap it in quotes, which the shaper strips.
+ llmSpy.fn = async () => ({ text: `"${shaped}"` });
+ const created = await call('create_identity', {
+ agent_name: 'LedgerLynx',
+ brief: 'a calm on-chain accounting agent',
+ style_hints: 'deep navy and silver',
+ });
+ expect(created.result.isError).toBeUndefined();
+ // prompt + directed surface on the status poll (describeIdentityJob).
+ const status = await call('identity_status', { job_id: created.result.structuredContent.job_id });
+ const sc = status.result.structuredContent;
+ expect(sc.directed).toBe(true);
+ // First line only, surrounding quotes stripped — no fallback scaffolding.
+ expect(sc.prompt).toBe(shaped);
+ expect(sc.prompt).not.toContain('full-body humanoid character:');
+ });
+
it('an absurdly long brief is truncated and flagged, not silently mangled', async () => {
const created = await call('create_identity', {
agent_name: 'X',
diff --git a/tests/mcp-studio-ratelimit.test.js b/tests/mcp-studio-ratelimit.test.js
new file mode 100644
index 000000000..0940c4d7b
--- /dev/null
+++ b/tests/mcp-studio-ratelimit.test.js
@@ -0,0 +1,83 @@
+// Free 3D Studio (api/mcp-studio.js) rate-limiter disposition under a Redis
+// outage. The June-2026 Upstash over-quota incident took the whole free studio
+// down: its generation limiters were marked `critical` and so FAILED CLOSED when
+// every Redis command started rejecting with "max requests limit exceeded",
+// denying a zero-cost feature for no spend saved.
+//
+// Contract proven here (with a mocked Upstash whose every command rejects, in a
+// simulated production env):
+// - the studio's free-lane generation caps FAIL OPEN (success: true) — a Redis
+// blip must never dead-end a free generation, mirroring mcp3dGenerateFree;
+// - a genuinely cost-bearing bucket (mcp3dGenerate — the paid MCP lane) still
+// FAILS CLOSED (success: false), so the harness really is simulating an
+// outage and the money-protecting posture is intact.
+
+import { describe, it, expect, beforeAll, afterAll, vi } from 'vitest';
+
+// A stand-in Upstash client whose EVERY method rejects, reproducing the
+// over-quota state where the REST endpoint 400s on every command. A Proxy covers
+// whatever command @upstash/ratelimit reaches for (eval/scripts/sliding-window)
+// without pinning the test to its internals.
+vi.mock('@upstash/redis', () => ({
+ Redis: class {
+ constructor() {
+ return new Proxy(this, {
+ get() {
+ return () => Promise.reject(new Error('ERR max requests limit exceeded. Limit: 500000, Usage: 500000'));
+ },
+ });
+ }
+ },
+}));
+
+let limits;
+const prevNodeEnv = process.env.NODE_ENV;
+const prevUrl = process.env.UPSTASH_REDIS_REST_URL;
+const prevToken = process.env.UPSTASH_REDIS_REST_TOKEN;
+
+beforeAll(async () => {
+ // Production + a configured (but failing) Redis is exactly the incident shape:
+ // redis is present, so buckets take the resilientLimiter path, and IS_PRODUCTION
+ // makes `critical` buckets fail closed. A non-critical bucket fails open here.
+ process.env.NODE_ENV = 'production';
+ process.env.UPSTASH_REDIS_REST_URL = 'https://mock-upstash.invalid';
+ process.env.UPSTASH_REDIS_REST_TOKEN = 'mock-token';
+ vi.resetModules();
+ ({ limits } = await import('../api/_lib/rate-limit.js'));
+});
+
+afterAll(() => {
+ process.env.NODE_ENV = prevNodeEnv;
+ if (prevUrl === undefined) delete process.env.UPSTASH_REDIS_REST_URL;
+ else process.env.UPSTASH_REDIS_REST_URL = prevUrl;
+ if (prevToken === undefined) delete process.env.UPSTASH_REDIS_REST_TOKEN;
+ else process.env.UPSTASH_REDIS_REST_TOKEN = prevToken;
+ vi.resetModules();
+});
+
+describe('free studio limiters under a Redis outage', () => {
+ it('studioGenBurst fails OPEN (free lane must not dead-end)', async () => {
+ const r = await limits.studioGenBurst('203.0.113.7');
+ expect(r.success).toBe(true);
+ });
+
+ it('studioGenHourly fails OPEN', async () => {
+ const r = await limits.studioGenHourly('203.0.113.7');
+ expect(r.success).toBe(true);
+ });
+
+ it('studioGenerateGlobal fails OPEN', async () => {
+ const r = await limits.studioGenerateGlobal();
+ expect(r.success).toBe(true);
+ });
+
+ it('studioIp (transport) fails OPEN', async () => {
+ const r = await limits.studioIp('203.0.113.7');
+ expect(r.success).toBe(true);
+ });
+
+ it('the paid MCP lane (mcp3dGenerate) still FAILS CLOSED — spend stays protected', async () => {
+ const r = await limits.mcp3dGenerate('some-principal');
+ expect(r.success).toBe(false);
+ });
+});
diff --git a/tests/mcp-studio.test.js b/tests/mcp-studio.test.js
index 09bb77a93..b9c76a1d0 100644
--- a/tests/mcp-studio.test.js
+++ b/tests/mcp-studio.test.js
@@ -4,7 +4,7 @@ import { TOOL_CATALOG, TOOL_NAMES } from '../api/_mcp-studio/tools.js';
import { dispatch } from '../api/_mcp-studio/dispatch.js';
import { COMPONENT_URI } from '../api/_mcp-studio/component.js';
-const ALLOWED = ['forge_free', 'text_to_avatar', 'mesh_forge', 'rig_mesh', 'forge_avatar'];
+const ALLOWED = ['forge_free', 'text_to_avatar', 'mesh_forge', 'rig_mesh', 'forge_avatar', 'refine_model'];
// Anything that would signal a crypto / payment surface. The whole point of the
// free studio app is that NONE of this appears anywhere in its contract.
@@ -145,4 +145,80 @@ describe('mcp-studio dispatch', () => {
expect(r.error).toBeTruthy();
expect(r.error.message).toMatch(/invalid params/i);
});
+
+ it('refine_model anchors to the parent and returns a correct, growing lineage', async () => {
+ // Mock /api/forge to complete synchronously with a distinct refined GLB.
+ globalThis.fetch = vi.fn(async () => ({
+ ok: true,
+ status: 200,
+ json: async () => ({ status: 'done', glb_url: 'https://three.ws/cdn/creations/v1.glb', job_id: 'J1', creation_id: 'C1', backend: 'nvidia-internal' }),
+ }));
+ const r = await dispatch(
+ {
+ jsonrpc: '2.0',
+ id: 9,
+ method: 'tools/call',
+ params: {
+ name: 'refine_model',
+ arguments: {
+ glb_url: 'https://three.ws/cdn/creations/origin.glb',
+ instruction: 'make it metallic',
+ parent_prompt: 'a round robot mascot',
+ },
+ },
+ },
+ auth,
+ mkReq(),
+ );
+ const sc = r.result.structuredContent;
+ expect(sc.glbUrl).toBe('https://three.ws/cdn/creations/v1.glb');
+ expect(sc.kind).toBe('refined model');
+ // Lineage: origin (index 0) → refined (index 1), the refined one active.
+ expect(sc.lineage).toHaveLength(2);
+ expect(sc.lineage[0].label).toBe('Original');
+ expect(sc.lineage[0].glbUrl).toBe('https://three.ws/cdn/creations/origin.glb');
+ expect(sc.lineage[1].instruction).toBe('make it metallic');
+ expect(sc.lineage[1].active).toBe(true);
+ expect(sc.activeIndex).toBe(1);
+ // The prompt the generator actually ran carries the parent forward.
+ expect(sc.prompt).toBe('a round robot mascot, metallic');
+ // No internal identifiers leak.
+ const serialized = JSON.stringify(r.result);
+ expect(serialized).not.toContain('nvidia-internal');
+ expect(serialized).not.toContain('creation_id');
+ });
+
+ it('refine_model extends a passed-in lineage to three versions', async () => {
+ globalThis.fetch = vi.fn(async () => ({
+ ok: true,
+ status: 200,
+ json: async () => ({ status: 'done', glb_url: 'https://three.ws/cdn/creations/v2.glb', job_id: 'J2' }),
+ }));
+ const parentLineage = [
+ { index: 0, parentIndex: null, glbUrl: 'https://three.ws/cdn/creations/origin.glb', prompt: 'a round robot mascot', instruction: null, refKind: 'origin', label: 'Original' },
+ { index: 1, parentIndex: 0, glbUrl: 'https://three.ws/cdn/creations/v1.glb', prompt: 'a round robot mascot, metallic', instruction: 'make it metallic', refKind: 'text', label: 'make it metallic' },
+ ];
+ const r = await dispatch(
+ { jsonrpc: '2.0', id: 10, method: 'tools/call', params: { name: 'refine_model', arguments: { glb_url: 'https://three.ws/cdn/creations/v1.glb', instruction: 'add wings', parent_prompt: 'a round robot mascot, metallic', parent_lineage: parentLineage } } },
+ auth,
+ mkReq(),
+ );
+ const sc = r.result.structuredContent;
+ expect(sc.lineage).toHaveLength(3);
+ expect(sc.lineage[2].instruction).toBe('add wings');
+ expect(sc.lineage[2].parentIndex).toBe(1);
+ expect(sc.activeIndex).toBe(2);
+ });
+
+ it('refine_model requires both glb_url and instruction', async () => {
+ const spy = vi.fn();
+ globalThis.fetch = spy;
+ const r = await dispatch(
+ { jsonrpc: '2.0', id: 11, method: 'tools/call', params: { name: 'refine_model', arguments: { glb_url: 'https://three.ws/x.glb' } } },
+ auth,
+ mkReq(),
+ );
+ expect(r.error).toBeTruthy();
+ expect(spy).not.toHaveBeenCalled();
+ });
});
diff --git a/tests/tokenize-3d.test.js b/tests/tokenize-3d.test.js
new file mode 100644
index 000000000..902fdeb39
--- /dev/null
+++ b/tests/tokenize-3d.test.js
@@ -0,0 +1,273 @@
+// Tokenized-3D — metadata shape, royalty cap, and mint idempotency.
+//
+// The pure metadata/policy core (tokenize-3d-metadata.js) is tested directly.
+// The mint idempotency guard (tokenize-3d.js) is tested with injected fake deps
+// so we exercise the claim-first logic WITHOUT touching Solana, R2, or the DB —
+// the guarantee under test is "a double-call never double-mints".
+
+import { describe, it, expect } from 'vitest';
+
+import {
+ buildTokenized3dMetadata,
+ clampSellerFeeBps,
+ deriveIdempotencyKey,
+ viewerLinkFor,
+ TOKENIZE_3D_ROYALTY_CAP_BPS,
+ TOKENIZE_3D_ROYALTY_DEFAULT_BPS,
+} from '../api/_lib/tokenize-3d-metadata.js';
+import { mintTokenized3dAsset } from '../api/_lib/tokenize-3d.js';
+
+const OWNER = 'So11111111111111111111111111111111111111112';
+const GLB = 'https://cdn.three.ws/tokenized/abc/model.glb';
+const IMG = 'https://cdn.three.ws/tokenized/abc/thumb.png';
+const VIEWER = 'https://three.ws/viewer?src=' + encodeURIComponent(GLB);
+
+describe('tokenize-3d metadata shape', () => {
+ const meta = buildTokenized3dMetadata({
+ name: 'Knight',
+ glbUrl: GLB,
+ imageUrl: IMG,
+ viewerUrl: VIEWER,
+ creatorWallet: OWNER,
+ creatorUserId: 'user-1',
+ prompt: 'a brave knight',
+ generationModel: 'trellis',
+ generationProvider: 'nvidia-nim',
+ parentMint: 'ParentMint1111111111111111111111111111111111',
+ royaltyBps: 500,
+ royaltyRecipient: OWNER,
+ network: 'devnet',
+ createdAt: '2026-07-07T00:00:00.000Z',
+ });
+
+ it('puts the GLB under animation_url (live 3D media, not a static image)', () => {
+ expect(meta.animation_url).toBe(GLB);
+ expect(meta.image).toBe(IMG);
+ expect(meta.external_url).toBe(VIEWER);
+ });
+
+ it('lists the model in properties.files with the glTF-binary mimeType', () => {
+ const model = meta.properties.files.find((f) => f.uri === GLB);
+ expect(model).toBeTruthy();
+ expect(model.type).toBe('model/gltf-binary');
+ expect(meta.properties.category).toBe('3d');
+ });
+
+ it('bakes provenance into properties.provenance', () => {
+ const p = meta.properties.provenance;
+ expect(p.creator).toBe(OWNER);
+ expect(p.prompt).toBe('a brave knight');
+ expect(p.generation_model).toBe('trellis');
+ expect(p.generation_provider).toBe('nvidia-nim');
+ expect(p.parent_mint).toBe('ParentMint1111111111111111111111111111111111');
+ expect(p.minted_at).toBe('2026-07-07T00:00:00.000Z');
+ expect(p.network).toBe('devnet');
+ });
+
+ it('mirrors the royalty into the standard seller_fee_basis_points fields', () => {
+ expect(meta.seller_fee_basis_points).toBe(500);
+ expect(meta.properties.seller_fee_basis_points).toBe(500);
+ expect(meta.properties.creators).toEqual([{ address: OWNER, share: 100 }]);
+ });
+
+ it('references only $THREE as a coin (no other mint)', () => {
+ const json = JSON.stringify(meta);
+ expect(meta.token.symbol).toBe('THREE');
+ // The $THREE mint is present; no bare SOL/USDC coin promotion in copy.
+ expect(json).toContain('THREE');
+ });
+
+ it('optional IPFS permanence copies land in files when provided', () => {
+ const withIpfs = buildTokenized3dMetadata({
+ name: 'X',
+ glbUrl: GLB,
+ imageUrl: IMG,
+ viewerUrl: VIEWER,
+ glbIpfs: 'ipfs://bafyGLB',
+ imageIpfs: 'ipfs://bafyIMG',
+ creatorWallet: OWNER,
+ royaltyBps: 0,
+ royaltyRecipient: OWNER,
+ network: 'devnet',
+ createdAt: '2026-07-07T00:00:00.000Z',
+ });
+ const uris = withIpfs.properties.files.map((f) => f.uri);
+ expect(uris).toContain('ipfs://bafyGLB');
+ expect(uris).toContain('ipfs://bafyIMG');
+ });
+});
+
+describe('royalty hard cap', () => {
+ it('defaults when unset', () => {
+ expect(clampSellerFeeBps(undefined).bps).toBe(TOKENIZE_3D_ROYALTY_DEFAULT_BPS);
+ expect(clampSellerFeeBps(null).bps).toBe(TOKENIZE_3D_ROYALTY_DEFAULT_BPS);
+ });
+
+ it('clamps anything above the cap to the cap and flags it', () => {
+ const r = clampSellerFeeBps(5000);
+ expect(r.bps).toBe(TOKENIZE_3D_ROYALTY_CAP_BPS);
+ expect(r.capped).toBe(true);
+ expect(r.requestedBps).toBe(5000);
+ });
+
+ it('passes through a value under the cap', () => {
+ const r = clampSellerFeeBps(250);
+ expect(r.bps).toBe(250);
+ expect(r.capped).toBe(false);
+ });
+
+ it('never exceeds the cap for any input', () => {
+ for (const v of [0, 1, 999, 1000, 1001, 9999, 100000]) {
+ expect(clampSellerFeeBps(v).bps).toBeLessThanOrEqual(TOKENIZE_3D_ROYALTY_CAP_BPS);
+ }
+ });
+
+ it('treats a negative / garbage rate as the default', () => {
+ expect(clampSellerFeeBps(-5).bps).toBe(TOKENIZE_3D_ROYALTY_DEFAULT_BPS);
+ expect(clampSellerFeeBps('nonsense').bps).toBe(TOKENIZE_3D_ROYALTY_DEFAULT_BPS);
+ });
+});
+
+describe('idempotency key derivation', () => {
+ it('is deterministic for the same inputs', () => {
+ const a = deriveIdempotencyKey({ ownerWallet: OWNER, glbSource: 'avatar:1', network: 'devnet' });
+ const b = deriveIdempotencyKey({ ownerWallet: OWNER, glbSource: 'avatar:1', network: 'devnet' });
+ expect(a).toBe(b);
+ expect(a).toMatch(/^[0-9a-f]{64}$/);
+ });
+
+ it('differs when any input differs', () => {
+ const base = deriveIdempotencyKey({ ownerWallet: OWNER, glbSource: 'avatar:1', network: 'devnet' });
+ expect(deriveIdempotencyKey({ ownerWallet: OWNER, glbSource: 'avatar:2', network: 'devnet' })).not.toBe(base);
+ expect(deriveIdempotencyKey({ ownerWallet: OWNER, glbSource: 'avatar:1', network: 'mainnet' })).not.toBe(base);
+ expect(deriveIdempotencyKey({ ownerWallet: 'Other', glbSource: 'avatar:1', network: 'devnet' })).not.toBe(base);
+ });
+});
+
+// ── Mint idempotency guard (fake deps) ───────────────────────────────────────
+
+// A minimal in-memory stand-in for the neon `sql` tagged template. It emulates
+// the three statements the guard uses: the claim INSERT (ON CONFLICT DO NOTHING),
+// the read-back SELECT, and the success UPDATE. Enough to prove the guard.
+function makeFakeSql(store) {
+ const fn = (strings, ...values) => {
+ const q = strings.join(' ').replace(/\s+/g, ' ').trim().toLowerCase();
+
+ if (q.includes('insert into tokenized_3d_assets')) {
+ const [idem, network, owner, creatorId, avatarId, parentMint, name, glbUrl, viewerUrl, bps, recipient] = values;
+ const key = `${idem}|${network}`;
+ if (store.has(key)) return Promise.resolve([]); // ON CONFLICT DO NOTHING
+ const row = {
+ id: `row-${store.size + 1}`,
+ idempotency_key: idem,
+ network,
+ status: 'pending',
+ owner_wallet: owner,
+ creator_user_id: creatorId,
+ source_avatar_id: avatarId,
+ parent_mint: parentMint,
+ name,
+ glb_url: glbUrl,
+ image_url: null,
+ viewer_url: viewerUrl,
+ metadata_uri: null,
+ royalty_bps: bps,
+ royalty_recipient: recipient,
+ tx_signature: null,
+ mint: null,
+ };
+ store.set(key, row);
+ return Promise.resolve([{ id: row.id, status: 'pending' }]);
+ }
+
+ if (q.startsWith('select') && q.includes('from tokenized_3d_assets')) {
+ const [idem, network] = values;
+ const row = store.get(`${idem}|${network}`);
+ return Promise.resolve(row ? [{ ...row }] : []);
+ }
+
+ if (q.includes("set status = 'minted'")) {
+ const [mint, signature, glbUrl, imageUrl, viewerUrl, metadataUri, _prov, id] = values;
+ for (const row of store.values()) {
+ if (row.id === id) {
+ Object.assign(row, {
+ status: 'minted',
+ mint,
+ tx_signature: signature,
+ glb_url: glbUrl,
+ image_url: imageUrl,
+ viewer_url: viewerUrl,
+ metadata_uri: metadataUri,
+ });
+ return Promise.resolve([{ ...row }]);
+ }
+ }
+ return Promise.resolve([]);
+ }
+
+ // Failure / reclaim updates — unused in the happy path.
+ return Promise.resolve([]);
+ };
+ return fn;
+}
+
+function makeDeps(store, counters) {
+ return {
+ sql: makeFakeSql(store),
+ resolveSource: async () => ({
+ sourceUrl: GLB,
+ sourceAvatarId: 'avatar-1',
+ name: 'Knight',
+ description: '',
+ parentAvatarId: null,
+ provenance: { prompt: 'a knight', generationModel: 'trellis', generationProvider: 'nvidia-nim' },
+ }),
+ resolveOwnerWallet: async () => OWNER,
+ promoteToDurableStorage: async () => {
+ counters.promote++;
+ return { glbUrl: GLB, imageUrl: IMG, glbIpfs: null, imageIpfs: null };
+ },
+ uploadMetadataJson: async () => ({ uri: 'https://cdn.three.ws/tokenized/abc/metadata.json', ipfs: null }),
+ mintCoreAsset: async () => {
+ counters.mint++;
+ return { mint: 'MintAsset1111111111111111111111111111111111', signature: 'Sig111' };
+ },
+ now: () => '2026-07-07T00:00:00.000Z',
+ };
+}
+
+describe('mint idempotency guard', () => {
+ it('mints once, then a repeat call returns the same mint without minting again', async () => {
+ const store = new Map();
+ const counters = { mint: 0, promote: 0 };
+ const deps = makeDeps(store, counters);
+ const input = { avatarId: 'avatar-1', requesterId: 'user-1', network: 'devnet' };
+
+ const first = await mintTokenized3dAsset(input, deps);
+ expect(first.status).toBe('minted');
+ expect(first.mint).toBe('MintAsset1111111111111111111111111111111111');
+ expect(first.idempotent).toBe(false);
+ expect(counters.mint).toBe(1);
+
+ const second = await mintTokenized3dAsset(input, deps);
+ expect(second.status).toBe('minted');
+ expect(second.mint).toBe(first.mint);
+ expect(second.idempotent).toBe(true);
+ // The critical assertion: NO second on-chain mint.
+ expect(counters.mint).toBe(1);
+ expect(counters.promote).toBe(1);
+ });
+
+ it('applies and reports the royalty cap on the mint result', async () => {
+ const store = new Map();
+ const counters = { mint: 0, promote: 0 };
+ const deps = makeDeps(store, counters);
+ const result = await mintTokenized3dAsset(
+ { avatarId: 'avatar-1', requesterId: 'user-1', network: 'devnet', sellerFeeBasisPoints: 5000 },
+ deps,
+ );
+ expect(result.royalty.basis_points).toBe(TOKENIZE_3D_ROYALTY_CAP_BPS);
+ expect(result.royalty.capped).toBe(true);
+ expect(result.royalty.cap_basis_points).toBe(TOKENIZE_3D_ROYALTY_CAP_BPS);
+ });
+});
diff --git a/vercel.json b/vercel.json
index 74c9de765..2bddb758d 100644
--- a/vercel.json
+++ b/vercel.json
@@ -1317,6 +1317,17 @@
"src": "/embed/",
"dest": "/embed.html"
},
+ {
+ "src": "/embodiment/embed/?",
+ "headers": {
+ "content-security-policy": "frame-ancestors *; base-uri 'self'; object-src 'none'; report-uri /api/client-errors",
+ "x-content-type-options": "nosniff",
+ "referrer-policy": "strict-origin-when-cross-origin",
+ "permissions-policy": "microphone=(self), camera=(self), autoplay=(self), xr-spatial-tracking=*",
+ "cross-origin-resource-policy": "cross-origin"
+ },
+ "dest": "/embodiment/embed.html"
+ },
{
"src": "/embed/avatar",
"headers": {
diff --git a/vite.config.js b/vite.config.js
index 11e47caca..e2aefc0ee 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -335,6 +335,12 @@ const appConfig = {
constellation: resolve(__dirname, 'pages/constellation.html'),
embed: resolve(__dirname, 'pages/embed.html'),
'embed-demo': resolve(__dirname, 'pages/embed-demo.html'),
+ // Embodiment embed: a living, rigged agent body (lip-sync + emotion
+ // + idle) that renders inline in ChatGPT/Claude. Registered as an
+ // input so its inline module graph — /apps-sdk/embodiment/* → three
+ // → src/animation-* + src/embodiment/* — gets bundled to /assets/*
+ // chunks instead of shipping unresolved bare imports.
+ 'embodiment-embed': resolve(__dirname, 'pages/embodiment/embed.html'),
integrations: resolve(__dirname, 'pages/integrations.html'),
partners: resolve(__dirname, 'pages/partners.html'),
sperax: resolve(__dirname, 'pages/sperax.html'),
@@ -1000,6 +1006,8 @@ support: resolve(__dirname, 'pages/support.html'),
'/stage/': resolve(root, 'pages/stage.html'),
'/dad': resolve(root, 'pages/dad.html'),
'/dad/': resolve(root, 'pages/dad.html'),
+ '/embodiment/embed': resolve(root, 'pages/embodiment/embed.html'),
+ '/embodiment/embed/': resolve(root, 'pages/embodiment/embed.html'),
'/agenc/embodied': resolve(root, 'pages/agenc/embodied.html'),
'/agenc/embodied/': resolve(root, 'pages/agenc/embodied.html'),
'/agenc/room': resolve(root, 'pages/agenc/room.html'),
diff --git a/workers/model-trellis/Dockerfile b/workers/model-trellis/Dockerfile
index 6b2be95a2..24d60df74 100644
--- a/workers/model-trellis/Dockerfile
+++ b/workers/model-trellis/Dockerfile
@@ -70,7 +70,12 @@ RUN pip install \
"httpx>=0.27.0" "google-cloud-storage==2.18.0" "safetensors>=0.4.0"
# ── 6. TRELLIS source (imported via PYTHONPATH, pinned for reproducibility) ───
-RUN git clone https://github.com/microsoft/TRELLIS.git /app/TRELLIS
+# --recurse-submodules is REQUIRED: TRELLIS vendors FlexiCubes (its mesh
+# extractor) as a git submodule at trellis/representations/mesh/flexicubes. A
+# plain clone leaves that dir a bare gitlink, so `from .flexicubes.flexicubes
+# import FlexiCubes` fails at model load with ModuleNotFoundError and the worker
+# crashes on startup before binding the port.
+RUN git clone --recurse-submodules https://github.com/microsoft/TRELLIS.git /app/TRELLIS
WORKDIR /app
COPY worker_security.py /app/worker_security.py
diff --git a/workers/model-trellis/main.py b/workers/model-trellis/main.py
index 57853de6f..5c042d37d 100644
--- a/workers/model-trellis/main.py
+++ b/workers/model-trellis/main.py
@@ -68,6 +68,8 @@ MAX_CONCURRENT = int(os.environ.get("MAX_CONCURRENT", "1"))
_pipeline = None
_bucket: Optional[storage.Bucket] = None
_sem: Optional[asyncio.Semaphore] = None
+_ready: Optional[asyncio.Event] = None
+_load_error: Optional[str] = None
_tasks: dict[str, dict] = {}
@@ -82,14 +84,38 @@ def _load_pipeline():
log.info("TRELLIS pipeline loaded")
+async def _load_pipeline_bg():
+ """Load the pipeline off the request path and signal readiness when done.
+
+ Runs the blocking, GPU-bound load in a worker thread so the event loop (and
+ the HTTP port) stay live. On failure the error is recorded and surfaced via
+ /health and per-task, rather than crash-looping the container.
+ """
+ global _load_error
+ loop = asyncio.get_event_loop()
+ try:
+ await loop.run_in_executor(None, _load_pipeline)
+ _ready.set()
+ log.info("TRELLIS pipeline ready")
+ except Exception as exc: # noqa: BLE001 — surfaced via /health + task status
+ _load_error = safe_error(exc, context="model load")
+ log.error("TRELLIS pipeline load FAILED: %s", exc)
+
+
@asynccontextmanager
async def lifespan(app: FastAPI):
- global _bucket, _sem
+ global _bucket, _sem, _ready
_bucket = storage.Client().bucket(GCS_BUCKET)
_sem = asyncio.Semaphore(MAX_CONCURRENT)
- loop = asyncio.get_event_loop()
- await loop.run_in_executor(None, _load_pipeline)
- log.info("Service ready — max_concurrent=%d", MAX_CONCURRENT)
+ _ready = asyncio.Event()
+ # Load the ~3 GB pipeline in the BACKGROUND and yield immediately. uvicorn
+ # runs the ASGI lifespan BEFORE it binds the socket, so a blocking load here
+ # would delay the port past Cloud Run's startup TCP-probe window (the model
+ # load + GPU transfer runs minutes on a cold instance) and the revision would
+ # be marked failed. Backgrounding lets the port open at once; requests that
+ # arrive before the load completes wait on _ready (see _run_inference).
+ asyncio.create_task(_load_pipeline_bg())
+ log.info("Service starting — pipeline loading in background (max_concurrent=%d)", MAX_CONCURRENT)
yield
@@ -119,6 +145,21 @@ def _decode_image(src: str) -> Image.Image:
async def _run_inference(task_id: str, images: list[str], body_type: str) -> None:
+ # Wait for the background pipeline load before touching the GPU. Warm
+ # instances pass instantly; a cold one waits out the load rather than
+ # NoneType-crashing. A failed load surfaces as a designed task error.
+ if _load_error:
+ _tasks[task_id].update({"status": "failed", "error": f"pipeline unavailable: {_load_error}"})
+ return
+ try:
+ await asyncio.wait_for(_ready.wait(), timeout=600)
+ except asyncio.TimeoutError:
+ _tasks[task_id].update({"status": "failed", "error": "pipeline not ready (model load timed out)"})
+ return
+ if _load_error:
+ _tasks[task_id].update({"status": "failed", "error": f"pipeline unavailable: {_load_error}"})
+ return
+
async with _sem:
_tasks[task_id]["status"] = "running"
loop = asyncio.get_event_loop()
@@ -205,4 +246,6 @@ async def health() -> dict:
"gpu_available": torch.cuda.is_available(),
"gpu_name": torch.cuda.get_device_name(0) if torch.cuda.is_available() else None,
"pipeline_loaded": _pipeline is not None,
+ "ready": bool(_ready and _ready.is_set()),
+ "load_error": _load_error,
}
diff --git a/workers/vanity-grinder/grind.mjs b/workers/vanity-grinder/grind.mjs
index 318ca1a35..b8ff01538 100644
--- a/workers/vanity-grinder/grind.mjs
+++ b/workers/vanity-grinder/grind.mjs
@@ -265,7 +265,11 @@ async function main() {
}
active -= 1;
if (stats.found >= MAX_FOUND) {
+ // Target reached: abort every in-flight worker NOW so none grinds
+ // its current (possibly hard) target to completion. Each aborts at
+ // its next batch boundary and reports 'aborted', winding active to 0.
stopping = true;
+ stopAllWorkers();
maybeFinish();
return;
}