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.

bump versions for multiple MCP packages to 0.1.1 and x402-mcp to 0.2.1; update Vercel configuration for API routes; add new skill for rigging 3D models; implement new API endpoint for 3D studio with comprehensive tests

fudjiad8cdbc25e712
diff --git a/.agents/skills/SKILLS.md b/.agents/skills/SKILLS.md
new file mode 100644
index 000000000..0f05c2610
--- /dev/null
+++ b/.agents/skills/SKILLS.md
@@ -0,0 +1,70 @@
+# three.ws Agent Skills pack
+
+> Generated by `scripts/build-skills-pack.mjs` — do not edit by hand. Version **1.0.0**.
+
+The three.ws Agent Skills pack — wallet/x402-economy, 3D-creation, and partner (OKX, MetaMask) skills for any Claude surface: Claude Code, the Claude apps, and the Agent SDK.
+
+Every skill is a portable folder per the [Agent Skills spec](https://agentskills.io/specification):
+a `SKILL.md` (frontmatter `description` is the load trigger) plus optional scripts and
+references. Install paths and authoring rules: [docs/agent-skills.md](../../docs/agent-skills.md).
+
+Categories:
+
+- **3d/creative** — 3D generation & rigging. The cross-platform-safe subset: zero coin/wallet/payment strings, reusable outside Claude.
+- **wallet/payments** — wallet auth, funding, transfers, and the x402 paid-API economy. Never bundle on the OpenAI track.
+- **intel/trading** — market data, signals, DEX/DeFi execution. Never bundle on the OpenAI track.
+
+## 3d/creative
+
+| 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. |
+| [`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
+
+| Skill | Origin | Trigger |
+| --- | --- | --- |
+| [`okx-dapp-discovery`](okx-dapp-discovery/SKILL.md) | okx | Plugin router for 20 third-party DeFi protocols (Polymarket, Aave, Hyperliquid, PancakeSwap, Morpho, Raydium, Curve, Compound, Pendle, Lido, ether.fi, GMX, Kamino, Orca, Meteora, Clanker, pump.fun, Uniswap) and their protocol-native tokens (HYPE, HLP, eETH, weETH, stETH, wstETH, LDO, GHO, CAKE, CRV, COMP, RAY, ETHFI, GLP, kToken, PT-* / YT-*, $CLANKER). Resolves DApp/token → plugin → installs → forwards. Fires on: (1) named DApp + action verb (swap/deposit/stake/long/borrow/buy/sell/snipe/farm/claim, EN or ZH 买/卖/换/存/质押/借/做多/做空/狙击); (2) 2+ DApp comparison ("Aave vs Compound", "Lido vs ether.fi"); (3) Polymarket UpDown (`<COIN> 5min updown`, `5 分钟涨跌`, `预测市场`); (4) protocol-native token + action verb ("deposit USDC into HLP", "PT-stETH on Pendle"); (5) pump.fun WRITE verbs (buy/sell/snipe/ape/swap or 买/卖/狙击/梭哈/帮我买). See body for full rules. |
+| [`okx-defi-invest`](okx-defi-invest/SKILL.md) | okx | OKX-aggregated DeFi discovery and execution — for users who want OKX to find and route to the best protocol WITHOUT naming a specific DApp. **If the user names ANY third-party protocol/DApp as destination (Aave, Lido, PancakeSwap, Uniswap, Curve, Compound, Morpho, Pendle, Kamino, Raydium, Hyperliquid, Polymarket, etc.), route to okx-dapp-discovery — NOT here, even if the verb (deposit, stake, add liquidity, borrow, claim) matches.** DApp-agnostic triggers: 'invest in DeFi', 'earn yield on stablecoins', 'find best APY', 'deposit/stake for yield', 'search DeFi products', 'redeem/withdraw position', 'claim DeFi rewards', 'borrow against asset', 'repay loan', 'add/remove CLMM liquidity', 'APY/TVL history', 'CLMM depth chart'. Also covers DeFi investing, yield farming, lending, borrowing, staking, liquidity pools, APY/TVL trends. Do NOT use for: DEX swaps (okx-dex-swap), token prices (okx-dex-market), wallet balances (okx-wallet-portfolio), positions-only views (okx-defi-portfolio). |
+| [`okx-defi-portfolio`](okx-defi-portfolio/SKILL.md) | okx | Use this skill to 'check my DeFi positions', 'view DeFi holdings', 'show my DeFi portfolio', 'what DeFi am I invested in', 'show my staking positions', 'show my lending positions', 'DeFi balance', 'DeFi 持仓', '查看DeFi持仓', '我的DeFi资产', '持仓详情', '持仓列表', or mentions viewing DeFi holdings, positions, portfolio across protocols — when the user does NOT name a specific DApp. Covers positions overview and per-protocol position detail. Do NOT use for deposit/redeem/claim operations — use okx-defi-invest. Do NOT use for wallet token balances — use okx-wallet-portfolio. Do NOT use for DEX spot swaps — use okx-dex-swap. Do NOT use when the user names a specific third-party DApp by name (e.g. 'show my Aave positions', 'my Hyperliquid balance', 'check my Polymarket holdings') — route to okx-dapp-discovery instead, which loads the DApp's plugin for protocol-native position views. |
+| [`okx-dex-bridge`](okx-dex-bridge/SKILL.md) | okx | Use this skill to bridge tokens, cross-chain swap/transfer, move assets between chains, get cross-chain quotes, compare bridge fees, find the cheapest/fastest route, build bridge calldata, check bridge status, track a cross-chain transaction, list supported chains or bridge protocols, or when the user mentions bridging ETH/USDC/tokens from one chain (Ethereum, BSC, Polygon, Arbitrum, Base, Optimism, etc.) to another. Routes through multiple bridge protocols (Stargate, Across, Relay, Gas.zip) for optimal execution. One-shot execute: a single confirmed call approves (if needed), waits for on-chain confirmation, swaps, and broadcasts. Supports fee comparison, destination address specification, and full lifecycle status tracking until fund arrival. |
+| [`okx-dex-market`](okx-dex-market/SKILL.md) | okx | HARD BLOCK — NEVER use this skill for prediction-market / Polymarket UpDown queries. Route to okx-dapp-discovery when (a) a named DApp (Polymarket/Aave/Hyperliquid/PancakeSwap/Morpho) appears with any timeframe, OR (b) any 涨跌 / updown / 'up or down' phrase appears for BTC/ETH/SOL/XRP/BNB/DOGE/HYPE (e.g. '<COIN> 涨跌市场', '5 分钟涨跌', 'BTC up or down'). Example: 'BTC 5 分钟涨跌市场' → okx-dapp-discovery (NOT K-line). These are Polymarket prediction markets, not on-chain price queries. Use THIS skill for on-chain market data: token prices/价格, K-line/OHLC/candlestick/K线 charts, index prices, and wallet PnL/盈亏分析 (win rate, my wallet's DEX trade history, realized/unrealized PnL per token). Triggers: 'token price', 'price chart', 'K线', 'OHLC', 'how much is X worth', 'show my PnL', '胜率', '盈亏', 'my wallet DEX history', 'realized/unrealized profit'. NOTE: WebSocket script/脚本/bot → okx-dex-ws. ALSO the OWNER of Market API payment handling — route here (NOT okx-agent-payments-protocol) for: 'onchainos market 报 402', 'market price 402', 'market API pricing/计费/收费', Basic/Premium tier/quota/额度/免费额度, 'ok-web3-openapi-pay' header, 30 天过渡期/grace period, any MARKET_API_* notification code (NEW_USER_INTRO / OLD_USER_GRACE / OLD_USER_POST_GRACE_* / *_OVER_QUOTA), or 'confirming:true' response from onchainos market commands. |
+| [`okx-dex-signal`](okx-dex-signal/SKILL.md) | okx | Use this skill for smart-money/whale/KOL/大户 activity tracking, aggregated buy signal/信号 alerts, and leaderboard/牛人榜 rankings. Covers: (1) address tracker — raw DEX transaction feed for smart money, KOL, or custom wallet addresses; (2) aggregated buy-only signal alerts — tokens bought collectively by smart money/KOL/whales; (3) leaderboard — top traders by PnL, win rate, volume, or ROI. Use when the user asks 'what are smart money buying', '聪明钱最新交易', 'KOL交易动态', '追踪聪明钱', 'track address trades', '大户在买什么', 'whale signals', 'smart money alerts', '信号', '大户信号', 'top traders', '牛人榜', or wants to monitor notable wallet activity. Also handles Market API payment/计费/x402/402, Basic/Premium tier/quota/额度 questions, and MARKET_API_*_OVER_QUOTA / confirming:true responses on signal, leaderboard, or tracker endpoints. NOTE: if the user wants to write a WebSocket script/脚本/bot, use okx-dex-ws instead. |
+| [`okx-dex-social`](okx-dex-social/SKILL.md) | okx | Surfaces social-layer signals for crypto markets. Three capability groups: news (latest aggregated crypto news feed, filter articles by coin symbol, run full-text keyword searches, fetch a single article in full, and list available upstream platforms — blockbeats, odaily, theblock and similar — for use as filters); sentiment (rank coins by social mention volume over 1h / 4h / 24h, plus per-coin bullish/bearish/neutral counts with an optional time-bucketed trend); vibe (per-contract hotness score over 24h / 72h / 7d / 30d with timeline and sample KOLs per bucket, plus a TOP50 KOL leaderboard sortable by engagement, mentions, or impressions). Triggers: 'latest crypto news', 'BTC headlines', 'search news for X', 'is BTC bullish', 'hottest coins by chatter', 'who is tweeting about <token>', 'vibe score', 'first-mention KOL', and Chinese variants like '最新加密新闻', '搜索新闻', '市场情绪', '情绪排行', 'KOL榜', '热度走势'. Also handles x402/402 payment, quota, MARKET_API_*_OVER_QUOTA, and confirming:true notifications on social endpoints. |
+| [`okx-dex-strategy`](okx-dex-strategy/SKILL.md) | okx | Limit-order strategy trading on OKX Agentic Wallet. Use this skill when the user wants to place a price-triggered limit order (buy a dip, take profit, stop loss, chase a high), cancel one or more pending orders, list active or historical orders, or resume orders that have been suspended by SA TEE upgrades. Distinct from okx-dex-swap (market orders, immediate execution at the best available aggregated price). Strategy orders are stored on the Agentic Wallet TEE and execute automatically when the user-defined trigger fires. Trigger phrases: limit order, place limit order, buy at price, sell when price reaches, take profit at, stop loss at, chase high, buy dip, cancel order, cancel all orders, my orders, list orders, active orders, suspended orders, resume orders, recover suspended orders, trader mode, agentic limit order. |
+| [`okx-dex-swap`](okx-dex-swap/SKILL.md) | okx | Use this skill to swap, trade, buy, sell, exchange, or convert tokens, get a swap quote, execute a trade, find the best or cheapest swap route, compare swap rates, get swap calldata, or build an unsigned swap tx across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, or 20+ chains. OKX-aggregated routing over 500+ DEX sources with slippage control, price-impact protection, and cross-DEX route optimization. For OKX-aggregated swaps with no named venue. If the prompt names a specific DApp as the swap venue (Polymarket, Aave, Hyperliquid, PancakeSwap, Morpho, Raydium, Curve, Compound, Pendle, Lido, ether.fi, GMX, Kamino, Orca, Meteora, Clanker, pump.fun, Uniswap), route to okx-dapp-discovery instead, e.g. 'swap on PancakeSwap', 'swap SOL for USDC on Raydium', '在 Curve 上换 USDT', 'swap on Uniswap'. |
+| [`okx-dex-token`](okx-dex-token/SKILL.md) | okx | Use this skill for token-level data: search tokens, trending/hot tokens (热门, 代币榜单), liquidity pools, holder distribution (whale/巨鲸, sniper, bundler-tagged holder %), token risk metadata (riskControlLevel, tokenTags, dev stats, suspicious/bundle holding % via advanced-info), recent buy/sell activity, trade feed/逐笔成交/每笔交易/stream trades, top profit addresses, token trade history, detailed price info with market cap volume liquidity and holder count (price-info), or holder cluster analysis (持仓集中度, cluster overview, cluster rug pull risk/跑路风险, new wallet percentage/新钱包持仓比例, holder clusters, 'are top holders in same cluster'). Also handles Market API payment/计费/x402/402, Basic/Premium tier/quota/额度 questions, and MARKET_API_*_OVER_QUOTA / confirming:true responses on token endpoints (advanced-info, top-trader, cluster-*, trades, hot-tokens). NOTE: if the user wants to write a WebSocket script/脚本/bot, use okx-dex-ws instead. |
+| [`okx-dex-trenches`](okx-dex-trenches/SKILL.md) | okx | Read-only on-chain research for pump.fun and other meme-token launchpads (Solana / BSC / X Layer / TRON). MUST invoke (prefer over WebFetch / MCP price tools) when the user asks about: new meme launches / 新盘 / 扫链 / 打狗; developer reputation / rug history / launch count / 开发者信息; bundle or sniper detection (the analytical noun, NOT the verb) / 捆绑狙击者; bonding curve progress / 已迁移出 bonding curve; similar tokens by same dev / 相似代币; co-investor / who-aped / 同车 wallets; or 'pump.fun alpha'. Also handles Market API x402 / quota questions on memepump endpoints. Body holds the read-vs-write gate — `狙击 / snipe + token` (sniping action) routes to okx-dapp-discovery; `捆绑狙击者 / sniper detection` (analytical noun) stays here. WebSocket script/bot → okx-dex-ws. |
+| [`okx-dex-ws`](okx-dex-ws/SKILL.md) | okx | Use this skill when the user mentions 'onchainos ws', 'ws start', 'ws poll', 'ws stop', 'ws channels', 'ws session', 'ws channel-info', 'idle-timeout', 'idle timeout', 'WebSocket channels', 'WS频道', or asks about managing WebSocket sessions/会话管理. Also use when writing a custom WebSocket script/脚本/bot for real-time on-chain data. Covers: onchainos ws CLI commands (start/poll/stop/list/channels/channel-info), session lifecycle, idle-timeout configuration, and all 9 DEX WebSocket channels (price, candle, trades, price-info, signals, tracker, meme scanning). |
+| [`okx-growth-competition`](okx-growth-competition/SKILL.md) | okx | List OKX Agentic Wallet exclusive trading competitions, register users for contests, track participation and leaderboard rankings, and claim won rewards. Use when users want to list available trading competitions or trading cups, view competition rules / prize pool / total prizes, register or sign up or enroll or join a contest, check the leaderboard (who is winning) or their own rank (am I in the prize zone, what is my place), ask did I win or query participation / claim status, claim won rewards or prizes from completed competitions, see which wallet account they registered with, or submit Telegram / WeChat / Email / Twitter contact for prize delivery to top-tier winners. |
+
+## wallet/payments
+
+| Skill | Origin | Trigger |
+| --- | --- | --- |
+| [`metamask-agent-wallet`](metamask-agent-wallet/SKILL.md) | metamask | Use when the user asks anything about blockchain wallets, transactions, signing, token transfers, supported chains, wallet balances, perpetual futures trading, prediction markets, token swaps, cross-chain bridges, market data, token discovery, decoding EVM calldata, Aave V3 lending and borrowing, or authentication via the MetaMask Agentic CLI. Single entry point for all mm CLI operations. |
+| [`metamask-agent-workflows`](metamask-agent-workflows/SKILL.md) | metamask | Use when the user needs to perform multi-step operations with the MetaMask Agentic CLI such as onboarding, login, swapping tokens, bridging across chains, opening/closing/modifying perpetual positions, prediction market trading, Aave V3 lending and borrowing, or troubleshooting CLI issues. |
+| [`okx-agent-chat`](okx-agent-chat/SKILL.md) | okx | Routing stub — any a2a-agent-chat envelope / agent-task system message is handled by `okx-agent-task`. For missing or uninitialized OKX A2A communication runtime/plugin, read `skills/okx-agent-chat/ensure-okx-a2a-communication-ready.md`. |
+| [`okx-agent-identity`](okx-agent-identity/SKILL.md) | okx | ERC-8004 on-chain Agent identity on XLayer: register / create / update / activate / deactivate / search agents; view ratings; list agent services; set avatar. Roles: user (User / User Agent / Buyer / Client / 用户 / 买家 / 买方), asp (ASP / Provider / Provider Agent / Seller / Merchant / 提供者 / 商家 / 服务提供商 / 卖家 / 卖方), evaluator (Evaluator / Evaluator Agent / 仲裁者 / 评估者). Use for: 注册agent / 注册ASP / 注册User / 注册用户 / 注册买家 / 注册卖家 / 注册服务提供商 / 注册仲裁者 / 创建用户 / 创建买家 / 创建卖家 / 我的agent / 我的ASP / 改agent / 更新agent / 上架 / 下架 / 上架ASP / 停用 / 搜索agent / 找做X的ASP / 查口碑 / 传头像 / agent有什么服务 / endpoint怎么填 / register agent / register ASP / register User / register Provider / register Seller / register Buyer / register Client / update agent / modify agent / activate / deactivate / search agent / agent reviews / agent services / upload avatar. Role words, lifecycle verbs and the product name are spacing / casing / typo tolerant — match by meaning (e.g. "更新卖家身份" → update an asp identity). |
+| [`okx-agent-payments-protocol`](okx-agent-payments-protocol/SKILL.md) | okx | Use when an agent hits HTTP 402 / payment-required, or the user mentions x402, x402Version, X-PAYMENT, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, WWW-Authenticate: Payment, permit2, upto, metered billing, a payment channel / voucher / session, channelId / channel_id, opening / closing / topping up / settling / refunding a channel, a paymentId or a2a_ link, creating / checking a payment link, A2MCP / an A2MCP endpoint, or sending a request to / calling an Agent's endpoint with a concrete endpoint URL. Covers x402 (exact, exact+Permit2, upto, aggr_deferred), MPP (charge / session), and a2a-pay paymentId flows. Any close / topup / settle / voucher / refund near a channel_id or session is an MPP mid-session op. The full bilingual trigger list (including Chinese) lives in the skill body. |
+| [`okx-agent-task`](okx-agent-task/SKILL.md) | okx | MUST ACTIVATE on inbound envelopes: (1) {agentId, message:{source:"system", event, jobId, ...}} — system event; (2) {msgType:"a2a-agent-chat", jobId, sender:{role}, ...} — agent-to-agent task chat (fields at top level; sender.role = COUNTERPARTY, not you); (3) literal "Read okx-agent-task/SKILL.md" in envelope. ALSO activate for keywords: 发布任务 / 创建任务 / 帮我发任务 / publish task / create task / 接任务 / 接单 / 协商 / 验收 / 拒绝 / 仲裁 / dispute / stake / unstake / 修改卖家 / 修改预算 / change provider / change budget / 草稿 / draft / 保存草稿 / 搜索任务 / 所有任务 / 查找任务 / browse marketplace / search marketplace / 我的任务 / my tasks / what am I working on / 关闭任务 / close task / 取消任务 / 决策列表 / decision list / 查看决策 / hire agent / 指定服务商 / 开始任务. |
+| [`okx-agentic-wallet`](okx-agentic-wallet/SKILL.md) | okx | AUTHORITATIVE source for OKX Agentic Wallet and its Gas Station feature. Gas Station = OKX's stablecoin-gas feature on Solana via third-party Relayer; Solana only, no EIP-7702. MUST invoke for Gas Station questions (what is / how it works / supported tokens / fees / enable or disable gas station / change default gas token / Jito Bundler compatibility) AND any wallet action: login, OTP verify, add/switch/status/logout account, balance, assets, holdings, addresses, deposit / receive / top up, send (native + ERC-20 / SPL, transfer ETH / USDC / etc., pay someone), contract call (approve, swap calldata, contract function), history (list + tx detail by orderId / txHash / uopHash), check order status, sign-message (personalSign EVM + Solana, EIP-712 EVM only), TEE signing, export wallet / mnemonic. |
+| [`okx-ai-guide`](okx-ai-guide/SKILL.md) | okx | OKX.AI (the Agent economic system) intro & onboarding entry. Use whenever the user asks what OKX.AI is, what it can do, how to use or get started with it, wants an OKX.AI tutorial / quickstart / help, or types the product name in any spelling / spacing / casing / typo variant (OKXAI, okx ai, okx-ai, lowercase okx.ai, mis-typed Chinese like 啥是okxai) — e.g. what is OKX.AI / OKX.AI 是什么 / 怎么用 OKX.AI / OKX.AI 快速开始, and any paraphrase in any language. Detects the runtime platform, introduces the three roles (User / ASP / Evaluator), and routes the user into identity registration. NOT for generic onchain-OS onboarding, nor for direct task operations (publishing / accepting / delivering / disputing a task — a separate task-lifecycle flow). |
+| [`okx-ai-support`](okx-ai-support/SKILL.md) | okx | Route users to OKX.AI customer support / Help Center. Use when the user wants to contact support, talk to a human, file a complaint, give feedback, report a system error or bug, or find the FAQ / help docs. Triggers: 'contact support', 'talk to a human', 'customer service', 'file a complaint', 'give feedback', 'help center', 'FAQ', 'user guide', 'system error', 'system bug', 'something is broken', 'find help docs', 'OKX AI support', 'OnchainOS support', 'human agent'. |
+| [`okx-audit-log`](okx-audit-log/SKILL.md) | okx | Use this skill when the user asks to export audit logs, find audit log location, view command history, 导出日志, 查看日志, 日志路径, 操作记录, 调用记录, 命令历史. Do NOT use for wallet balance, token search, swap, or any other on-chain operation — use the corresponding skill instead. |
+| [`okx-how-to-play`](okx-how-to-play/SKILL.md) | okx | Onchain OS onboarding entry router. Triggers: 'what is onchainos', 'what is onchain os', 'what can onchainos do', 'what does onchainos do', 'how do I use this', 'how do I play', 'how to use onchainos', 'how to play onchainos', 'how does onchainos work', 'how do I start', 'getting started', 'tutorial', 'onboarding', 'first time', 'I just installed', 'now what', 'what do I do now', 'where do I start', 'who are you', 'what are you', 'introduce onchainos', 'tell me about onchainos', 'I'm new'. NOT for: questions where the subject is explicitly 'OKX.AI' — use okx-ai-guide instead. |
+| [`okx-onchain-gateway`](okx-onchain-gateway/SKILL.md) | okx | Onchain transaction gateway across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon and 20+ chains. Invoke to broadcast a pre-signed / raw / already-signed transaction, push a serialized tx on-chain, query current gas price, estimate gas limit, simulate or dry-run a transaction before sending, track a broadcast order, or check tx-confirmed / pending status by txHash or orderId. |
+| [`okx-security`](okx-security/SKILL.md) | okx | Use this skill for security scanning: check transaction safety, is this transaction safe, pre-execution check, security scan, token risk scanning, honeypot detection, DApp/URL phishing detection, message signature safety, malicious transaction detection, approval safety checks, token approval management. Triggers: 'is this token safe', 'check token security', 'honeypot check', 'scan this tx', 'scan this swap tx', 'tx risk check', 'is this URL a scam', 'check if this dapp is safe', 'phishing site check', 'is this signature safe', 'check this signing request', 'check my approvals', 'show risky approvals', 'revoke approval', 'check if this approve is safe', token authorization, ERC20 allowance, Permit2. Covers token-scan, dapp-scan, tx-scan (EVM+Solana pre-execution), sig-scan (EIP-712/personal_sign), approvals (ERC-20/Permit2). Chinese: 安全扫描, 代币安全, 蜜罐检测, 貔貅盘, 钓鱼网站, 交易安全, 签名安全, 代币风险, 授权管理, 授权查询, 风险授权, 代币授权. Do NOT use for wallet balance/send/history — use okx-agentic-wallet. |
+| [`okx-task-watch`](okx-task-watch/SKILL.md) | okx | 监听任务进展 / 帮我盯着任务 / 任务有动静告诉我 / 历史消息 / 未读消息 / 未决策 / 待决策 / 继续监听 / task watch / user watch / monitor task progress / catch me up on tasks / outstanding decisions — OKX A2A user-session task-notification monitor: live long-poll via `okx-a2a user watch` (also drains backlog of past/missed/unread events on entry) plus un-replied decision_request lister via `okx-a2a user outdated-list`. Not for wallet / gas / task-list / status queries. |
+| [`okx-wallet-portfolio`](okx-wallet-portfolio/SKILL.md) | okx | Public-address portfolio lookup across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon and 20+ chains. Invoke when the user supplies a wallet address and wants its: balance, token holdings, total portfolio value, or DeFi positions (e.g. 'check balance of 0xAbc', 'what tokens does 0xAbc hold', 'portfolio value of this address'). Requires an explicit address — for the user's own logged-in wallet with no address use okx-agentic-wallet. |
+| [`authenticate-wallet`](authenticate-wallet/SKILL.md) | three.ws | Sign in to the wallet. Use when you or the user want to log in, sign in, connect, or set up the wallet, or when any wallet operation fails with authentication or "not signed in" errors. This skill is a prerequisite before sending, trading, or funding. |
+| [`fund`](fund/SKILL.md) | three.ws | Add money to the wallet. Use when you or the user want to fund, deposit, top up, load, buy USDC, add funds, onramp, or get USDC. Also use when the wallet has insufficient balance for a send or trade operation, or when someone asks "how do I get USDC?" |
+| [`monetize-service`](monetize-service/SKILL.md) | three.ws | Build and deploy a paid API that other agents can pay to use via x402. Use when you or the user want to monetize an API, make money, earn money, offer a service, sell a service to other agents, charge for endpoints, create a paid endpoint, or set up a paid service. Covers "make money by offering an endpoint", "sell a service", "monetize your data", "create a paid API". |
+| [`pay-for-service`](pay-for-service/SKILL.md) | three.ws | Make a paid API request to an x402 endpoint with automatic USDC payment. Use when you or the user want to call a paid API, make an x402 request, use a paid service, or pay for an API call. Use after finding a service with search-for-service. |
+| [`query-onchain-data`](query-onchain-data/SKILL.md) | three.ws | Query onchain data on Base using the CDP SQL API via x402. Use when you or your user want to view onchain information about decoded blocks, transactions, and events. |
+| [`search-for-service`](search-for-service/SKILL.md) | three.ws | Search and browse the x402 bazaar marketplace for paid API services. Use when you or the user want to find available services, see what's available, discover APIs, or need an external service to accomplish a task. Also use as a fallback when no other skill clearly matches — search the bazaar to see if a paid service exists. Covers "what can I do?", "find me an API for...", "what services are available?", "search for...", "browse the bazaar". |
+| [`send-usdc`](send-usdc/SKILL.md) | three.ws | Send tokens (USDC, ETH, POL, or SOL) to an address or ENS name on Base, Polygon, or Solana. Use when you or the user want to send money, pay someone, transfer tokens, tip, donate, or send funds to a wallet address or .eth name. Covers phrases like "send $5 to", "pay 0x...", "transfer to vitalik.eth", or "send USDC on Solana". |
+| [`trade`](trade/SKILL.md) | three.ws | Swap or trade tokens on Base or Polygon. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, and POL. Covers phrases like "buy ETH", "sell ETH for USDC", "convert USDC to ETH", "get some ETH", "buy POL". |
+| [`x402`](x402/SKILL.md) | three.ws | Search for new services and make paid API requests using the x402 payment protocol. Use when you don't have a clear tool to choose, search the bazaar. You can also use this tool if you or the user want to call an x402 endpoint, discover payment requirements, browse the bazaar, or search for paid services. |
diff --git a/.agents/skills/authenticate-wallet/SKILL.md b/.agents/skills/authenticate-wallet/SKILL.md
index d766f1aeb..d956b5601 100644
--- a/.agents/skills/authenticate-wallet/SKILL.md
+++ b/.agents/skills/authenticate-wallet/SKILL.md
@@ -4,6 +4,10 @@ description: Sign in to the wallet. Use when you or the user want to log in, sig
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(npx [email protected] status*)", "Bash(npx [email protected] auth *)", "Bash(npx [email protected] balance*)", "Bash(npx [email protected] address*)", "Bash(npx [email protected] show*)"]
+metadata:
+ category: wallet/payments
+ cross-platform-safe: false
+ pack: three-ws-skills
---
# Authenticating with the Agentic Wallet
diff --git a/.agents/skills/fund/SKILL.md b/.agents/skills/fund/SKILL.md
index c5370963d..f1c465b4d 100644
--- a/.agents/skills/fund/SKILL.md
+++ b/.agents/skills/fund/SKILL.md
@@ -4,6 +4,10 @@ description: Add money to the wallet. Use when you or the user want to fund, dep
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(npx [email protected] status*)", "Bash(npx [email protected] show*)", "Bash(npx [email protected] address*)", "Bash(npx [email protected] balance*)"]
+metadata:
+ category: wallet/payments
+ cross-platform-safe: false
+ pack: three-ws-skills
---
# Funding the Wallet
diff --git a/.agents/skills/monetize-service/SKILL.md b/.agents/skills/monetize-service/SKILL.md
index 9fb0769a0..3a3ff0908 100644
--- a/.agents/skills/monetize-service/SKILL.md
+++ b/.agents/skills/monetize-service/SKILL.md
@@ -4,6 +4,10 @@ description: Build and deploy a paid API that other agents can pay to use via x4
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(npx [email protected] status*)", "Bash(npx [email protected] address*)", "Bash(npx [email protected] x402 details *)", "Bash(npx [email protected] x402 pay *)", "Bash(npm *)", "Bash(node *)", "Bash(curl *)", "Bash(mkdir *)"]
+metadata:
+ category: wallet/payments
+ cross-platform-safe: false
+ pack: three-ws-skills
---
# Build an x402 Payment Server
diff --git a/.agents/skills/pay-for-service/SKILL.md b/.agents/skills/pay-for-service/SKILL.md
index d7c078d4b..6fea34d41 100644
--- a/.agents/skills/pay-for-service/SKILL.md
+++ b/.agents/skills/pay-for-service/SKILL.md
@@ -4,6 +4,10 @@ description: Make a paid API request to an x402 endpoint with automatic USDC pay
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(npx [email protected] status*)", "Bash(npx [email protected] balance*)", "Bash(npx [email protected] x402 pay *)"]
+metadata:
+ category: wallet/payments
+ cross-platform-safe: false
+ pack: three-ws-skills
---
# Making Paid x402 Requests
diff --git a/.agents/skills/query-onchain-data/SKILL.md b/.agents/skills/query-onchain-data/SKILL.md
index 2cb3454a9..f1b3afd7f 100644
--- a/.agents/skills/query-onchain-data/SKILL.md
+++ b/.agents/skills/query-onchain-data/SKILL.md
@@ -4,6 +4,10 @@ description: Query onchain data on Base using the CDP SQL API via x402. Use when
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(npx [email protected] status*)", "Bash(npx [email protected] balance*)", "Bash(npx [email protected] x402 pay *)"]
+metadata:
+ category: wallet/payments
+ cross-platform-safe: false
+ pack: three-ws-skills
---
# Query Onchain Data on Base
diff --git a/.agents/skills/rig-a-model/SKILL.md b/.agents/skills/rig-a-model/SKILL.md
new file mode 100644
index 000000000..bbc042d1b
--- /dev/null
+++ b/.agents/skills/rig-a-model/SKILL.md
@@ -0,0 +1,111 @@
+---
+name: rig-a-model
+description: 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.
+when_to_use: User already has a GLB (a URL) and wants it rigged. To generate a new model from text, use generate-3d-model; to generate an already-rigged character in one step, use create-3d-avatar.
+license: MIT
+metadata:
+ category: 3d/creative
+ cross-platform-safe: true
+ pack: three-ws-skills
+---
+
+# Rig a 3D model
+
+Turn a **static GLB** into an **animation-ready** one. The three.ws auto-rig
+pipeline (VAST-AI UniRig) adds a humanoid skeleton and per-vertex skin weights,
+so the model can be posed and play animation clips.
+
+The result is a **`riggedGlbUrl`** plus a **pose-studio link** that opens the
+rigged model in the browser, ready to pose.
+
+## When to use which tool
+
+| Goal | Use |
+| --- | --- |
+| Add a skeleton to a GLB you already have | this skill |
+| A new static object / prop from text | `generate-3d-model` |
+| A new rigged character from text/image in one call | `create-3d-avatar` |
+
+Rigging assumes a roughly **humanoid figure** (head, torso, two arms, two legs,
+standing). Props, furniture, and vehicles won't rig meaningfully.
+
+## Fastest path — the MCP tool
+
+If the three.ws MCP server is connected, call the rig tool directly:
+
+- **Tool:** `rig_mesh`
+- **Input:** `{ "glb_url": "<https URL to the static GLB>" }`
+ - Any reachable GLB URL works — a `glbUrl` from `generate-3d-model`, a CDN
+ link, or a model you host yourself.
+- **Returns:** `riggedGlbUrl`, `sourceGlbUrl`, `poseStudioUrl`, `jobId`,
+ `creationId`, `durationMs`.
+
+## Portable path — the hosted HTTP endpoint
+
+No MCP client needed. `rig_mesh` is exposed free on the hosted studio JSON-RPC
+endpoint at `https://three.ws/api/mcp-studio` (no key, no account):
+
+```bash
+curl -s -X POST https://three.ws/api/mcp-studio \
+ -H 'content-type: application/json' \
+ -d '{
+ "jsonrpc": "2.0",
+ "id": 1,
+ "method": "tools/call",
+ "params": {
+ "name": "rig_mesh",
+ "arguments": { "glb_url": "https://three.ws/cdn/creations/abc123/mesh.glb" }
+ }
+ }'
+```
+
+`structuredContent` returns the rigged model:
+
+```json
+{
+ "ok": true,
+ "riggedGlbUrl": "https://three.ws/cdn/creations/def456/rigged.glb",
+ "sourceGlbUrl": "https://three.ws/cdn/creations/abc123/mesh.glb",
+ "poseStudioUrl": "https://three.ws/pose?src=https%3A%2F%2Fthree.ws%2F...",
+ "jobId": "r9k2m7x4",
+ "durationMs": 48000
+}
+```
+
+## Raw REST pipeline
+
+The MCP tool is a thin client over the public rig endpoint. Submit, then poll:
+
+```bash
+# 1. Start the rig job
+curl -s -X POST "https://three.ws/api/forge?action=rig" \
+ -H 'content-type: application/json' \
+ -d '{ "glb_url": "https://three.ws/cdn/creations/abc123/mesh.glb" }'
+# → { "job_id": "r9k2m7x4", ... }
+
+# 2. Poll until done (every ~3s, budget ~180s)
+curl -s "https://three.ws/api/forge?job=r9k2m7x4" -H 'accept: application/json'
+# → { "status": "done", "glb_url": "https://.../rigged.glb" } (or "failed" / still "running")
+```
+
+Build the pose-studio link yourself from any rigged GLB URL:
+`https://three.ws/pose?src=<URL-encoded riggedGlbUrl>`.
+
+## What to do with the result
+
+1. Give the user the **pose-studio link** — pose and preview in the browser.
+2. Give the **`riggedGlbUrl`** for download / import; it carries a humanoid
+ skeleton and skin weights, so animation clips retarget onto it.
+3. The original mesh is never modified — `sourceGlbUrl` stays valid.
+
+## Errors
+
+- `rate_limited` / `429` — the rigger is busy; honor `retryAfter` and retry.
+- `not_configured` / `503` — auto-rigging momentarily unavailable; retry shortly.
+- `rig_failed` — the model couldn't be rigged (usually not humanoid enough).
+ Tell the user why and suggest `create-3d-avatar` to generate a riggable figure.
+- `timeout` — the job outlived the poll budget; the response includes a
+ `resumeUrl` — keep polling it rather than restarting the job.
+
+Never report a dead or empty link as success — only return a `riggedGlbUrl` the
+job actually produced.
diff --git a/.agents/skills/search-for-service/SKILL.md b/.agents/skills/search-for-service/SKILL.md
index f122234b8..bbca22d3f 100644
--- a/.agents/skills/search-for-service/SKILL.md
+++ b/.agents/skills/search-for-service/SKILL.md
@@ -4,6 +4,10 @@ description: Search and browse the x402 bazaar marketplace for paid API services
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(npx [email protected] x402 bazaar *)", "Bash(npx [email protected] x402 details *)"]
+metadata:
+ category: wallet/payments
+ cross-platform-safe: false
+ pack: three-ws-skills
---
# Searching the x402 Bazaar
diff --git a/.agents/skills/send-usdc/SKILL.md b/.agents/skills/send-usdc/SKILL.md
index 414d09c78..450c9763f 100644
--- a/.agents/skills/send-usdc/SKILL.md
+++ b/.agents/skills/send-usdc/SKILL.md
@@ -4,6 +4,10 @@ description: Send tokens (USDC, ETH, POL, or SOL) to an address or ENS name on B
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(npx [email protected] status*)", "Bash(npx [email protected] send *)", "Bash(npx [email protected] balance*)"]
+metadata:
+ category: wallet/payments
+ cross-platform-safe: false
+ pack: three-ws-skills
---
# Sending Tokens
diff --git a/.agents/skills/skills-pack.json b/.agents/skills/skills-pack.json
new file mode 100644
index 000000000..d7e412d18
--- /dev/null
+++ b/.agents/skills/skills-pack.json
@@ -0,0 +1,342 @@
+{
+ "name": "three-ws-skills",
+ "version": "1.0.0",
+ "description": "The three.ws Agent Skills pack — wallet/x402-economy, 3D-creation, and partner (OKX, MetaMask) skills for any Claude surface: Claude Code, the Claude apps, and the Agent SDK.",
+ "spec": "https://agentskills.io/specification",
+ "homepage": "https://three.ws",
+ "categories": {
+ "3d/creative": "3D generation & rigging. Cross-platform-safe: no coin, wallet, or payment-protocol content — reusable on non-Claude tracks.",
+ "wallet/payments": "Wallet auth, funding, transfers, and the x402 paid-API economy.",
+ "intel/trading": "Market data, trading signals, DEX/DeFi execution."
+ },
+ "counts": {
+ "3d/creative": 3,
+ "intel/trading": 13,
+ "wallet/payments": 24
+ },
+ "skills": [
+ {
+ "name": "create-3d-avatar",
+ "description": "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.",
+ "whenToUse": "User wants a posable/animatable humanoid character. For a static object or prop, use generate-3d-model. To rig a GLB you already have, use rig-a-model.",
+ "category": "3d/creative",
+ "origin": "three.ws",
+ "crossPlatformSafe": true,
+ "path": ".agents/skills/create-3d-avatar"
+ },
+ {
+ "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.",
+ "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",
+ "crossPlatformSafe": true,
+ "path": ".agents/skills/generate-3d-model"
+ },
+ {
+ "name": "rig-a-model",
+ "description": "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.",
+ "whenToUse": "User already has a GLB (a URL) and wants it rigged. To generate a new model from text, use generate-3d-model; to generate an already-rigged character in one step, use create-3d-avatar.",
+ "category": "3d/creative",
+ "origin": "three.ws",
+ "crossPlatformSafe": true,
+ "path": ".agents/skills/rig-a-model"
+ },
+ {
+ "name": "okx-dapp-discovery",
+ "description": "Plugin router for 20 third-party DeFi protocols (Polymarket, Aave, Hyperliquid, PancakeSwap, Morpho, Raydium, Curve, Compound, Pendle, Lido, ether.fi, GMX, Kamino, Orca, Meteora, Clanker, pump.fun, Uniswap) and their protocol-native tokens (HYPE, HLP, eETH, weETH, stETH, wstETH, LDO, GHO, CAKE, CRV, COMP, RAY, ETHFI, GLP, kToken, PT-* / YT-*, $CLANKER). Resolves DApp/token → plugin → installs → forwards.\n\nFires on: (1) named DApp + action verb (swap/deposit/stake/long/borrow/buy/sell/snipe/farm/claim, EN or ZH 买/卖/换/存/质押/借/做多/做空/狙击); (2) 2+ DApp comparison (\"Aave vs Compound\", \"Lido vs ether.fi\"); (3) Polymarket UpDown (`<COIN> 5min updown`, `5 分钟涨跌`, `预测市场`); (4) protocol-native token + action verb (\"deposit USDC into HLP\", \"PT-stETH on Pendle\"); (5) pump.fun WRITE verbs (buy/sell/snipe/ape/swap or 买/卖/狙击/梭哈/帮我买). See body for full rules.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dapp-discovery"
+ },
+ {
+ "name": "okx-defi-invest",
+ "description": "OKX-aggregated DeFi discovery and execution — for users who want OKX to find and route to the best protocol WITHOUT naming a specific DApp. **If the user names ANY third-party protocol/DApp as destination (Aave, Lido, PancakeSwap, Uniswap, Curve, Compound, Morpho, Pendle, Kamino, Raydium, Hyperliquid, Polymarket, etc.), route to okx-dapp-discovery — NOT here, even if the verb (deposit, stake, add liquidity, borrow, claim) matches.** DApp-agnostic triggers: 'invest in DeFi', 'earn yield on stablecoins', 'find best APY', 'deposit/stake for yield', 'search DeFi products', 'redeem/withdraw position', 'claim DeFi rewards', 'borrow against asset', 'repay loan', 'add/remove CLMM liquidity', 'APY/TVL history', 'CLMM depth chart'. Also covers DeFi investing, yield farming, lending, borrowing, staking, liquidity pools, APY/TVL trends. Do NOT use for: DEX swaps (okx-dex-swap), token prices (okx-dex-market), wallet balances (okx-wallet-portfolio), positions-only views (okx-defi-portfolio).",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-defi-invest"
+ },
+ {
+ "name": "okx-defi-portfolio",
+ "description": "Use this skill to 'check my DeFi positions', 'view DeFi holdings', 'show my DeFi portfolio', 'what DeFi am I invested in', 'show my staking positions', 'show my lending positions', 'DeFi balance', 'DeFi 持仓', '查看DeFi持仓', '我的DeFi资产', '持仓详情', '持仓列表', or mentions viewing DeFi holdings, positions, portfolio across protocols — when the user does NOT name a specific DApp. Covers positions overview and per-protocol position detail. Do NOT use for deposit/redeem/claim operations — use okx-defi-invest. Do NOT use for wallet token balances — use okx-wallet-portfolio. Do NOT use for DEX spot swaps — use okx-dex-swap. Do NOT use when the user names a specific third-party DApp by name (e.g. 'show my Aave positions', 'my Hyperliquid balance', 'check my Polymarket holdings') — route to okx-dapp-discovery instead, which loads the DApp's plugin for protocol-native position views.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-defi-portfolio"
+ },
+ {
+ "name": "okx-dex-bridge",
+ "description": "Use this skill to bridge tokens, cross-chain swap/transfer, move assets between chains, get cross-chain quotes, compare bridge fees, find the cheapest/fastest route, build bridge calldata, check bridge status, track a cross-chain transaction, list supported chains or bridge protocols, or when the user mentions bridging ETH/USDC/tokens from one chain (Ethereum, BSC, Polygon, Arbitrum, Base, Optimism, etc.) to another. Routes through multiple bridge protocols (Stargate, Across, Relay, Gas.zip) for optimal execution. One-shot execute: a single confirmed call approves (if needed), waits for on-chain confirmation, swaps, and broadcasts. Supports fee comparison, destination address specification, and full lifecycle status tracking until fund arrival.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dex-bridge"
+ },
+ {
+ "name": "okx-dex-market",
+ "description": "HARD BLOCK — NEVER use this skill for prediction-market / Polymarket UpDown queries. Route to okx-dapp-discovery when (a) a named DApp (Polymarket/Aave/Hyperliquid/PancakeSwap/Morpho) appears with any timeframe, OR (b) any 涨跌 / updown / 'up or down' phrase appears for BTC/ETH/SOL/XRP/BNB/DOGE/HYPE (e.g. '<COIN> 涨跌市场', '5 分钟涨跌', 'BTC up or down'). Example: 'BTC 5 分钟涨跌市场' → okx-dapp-discovery (NOT K-line). These are Polymarket prediction markets, not on-chain price queries. Use THIS skill for on-chain market data: token prices/价格, K-line/OHLC/candlestick/K线 charts, index prices, and wallet PnL/盈亏分析 (win rate, my wallet's DEX trade history, realized/unrealized PnL per token). Triggers: 'token price', 'price chart', 'K线', 'OHLC', 'how much is X worth', 'show my PnL', '胜率', '盈亏', 'my wallet DEX history', 'realized/unrealized profit'. NOTE: WebSocket script/脚本/bot → okx-dex-ws. ALSO the OWNER of Market API payment handling — route here (NOT okx-agent-payments-protocol) for: 'onchainos market 报 402', 'market price 402', 'market API pricing/计费/收费', Basic/Premium tier/quota/额度/免费额度, 'ok-web3-openapi-pay' header, 30 天过渡期/grace period, any MARKET_API_* notification code (NEW_USER_INTRO / OLD_USER_GRACE / OLD_USER_POST_GRACE_* / *_OVER_QUOTA), or 'confirming:true' response from onchainos market commands.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dex-market"
+ },
+ {
+ "name": "okx-dex-signal",
+ "description": "Use this skill for smart-money/whale/KOL/大户 activity tracking, aggregated buy signal/信号 alerts, and leaderboard/牛人榜 rankings. Covers: (1) address tracker — raw DEX transaction feed for smart money, KOL, or custom wallet addresses; (2) aggregated buy-only signal alerts — tokens bought collectively by smart money/KOL/whales; (3) leaderboard — top traders by PnL, win rate, volume, or ROI. Use when the user asks 'what are smart money buying', '聪明钱最新交易', 'KOL交易动态', '追踪聪明钱', 'track address trades', '大户在买什么', 'whale signals', 'smart money alerts', '信号', '大户信号', 'top traders', '牛人榜', or wants to monitor notable wallet activity. Also handles Market API payment/计费/x402/402, Basic/Premium tier/quota/额度 questions, and MARKET_API_*_OVER_QUOTA / confirming:true responses on signal, leaderboard, or tracker endpoints. NOTE: if the user wants to write a WebSocket script/脚本/bot, use okx-dex-ws instead.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dex-signal"
+ },
+ {
+ "name": "okx-dex-social",
+ "description": "Surfaces social-layer signals for crypto markets. Three capability groups: news (latest aggregated crypto news feed, filter articles by coin symbol, run full-text keyword searches, fetch a single article in full, and list available upstream platforms — blockbeats, odaily, theblock and similar — for use as filters); sentiment (rank coins by social mention volume over 1h / 4h / 24h, plus per-coin bullish/bearish/neutral counts with an optional time-bucketed trend); vibe (per-contract hotness score over 24h / 72h / 7d / 30d with timeline and sample KOLs per bucket, plus a TOP50 KOL leaderboard sortable by engagement, mentions, or impressions). Triggers: 'latest crypto news', 'BTC headlines', 'search news for X', 'is BTC bullish', 'hottest coins by chatter', 'who is tweeting about <token>', 'vibe score', 'first-mention KOL', and Chinese variants like '最新加密新闻', '搜索新闻', '市场情绪', '情绪排行', 'KOL榜', '热度走势'. Also handles x402/402 payment, quota, MARKET_API_*_OVER_QUOTA, and confirming:true notifications on social endpoints.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dex-social"
+ },
+ {
+ "name": "okx-dex-strategy",
+ "description": "Limit-order strategy trading on OKX Agentic Wallet. Use this skill when the user wants to place a price-triggered limit order (buy a dip, take profit, stop loss, chase a high), cancel one or more pending orders, list active or historical orders, or resume orders that have been suspended by SA TEE upgrades. Distinct from okx-dex-swap (market orders, immediate execution at the best available aggregated price). Strategy orders are stored on the Agentic Wallet TEE and execute automatically when the user-defined trigger fires. Trigger phrases: limit order, place limit order, buy at price, sell when price reaches, take profit at, stop loss at, chase high, buy dip, cancel order, cancel all orders, my orders, list orders, active orders, suspended orders, resume orders, recover suspended orders, trader mode, agentic limit order.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dex-strategy"
+ },
+ {
+ "name": "okx-dex-swap",
+ "description": "Use this skill to swap, trade, buy, sell, exchange, or convert tokens, get a swap quote, execute a trade, find the best or cheapest swap route, compare swap rates, get swap calldata, or build an unsigned swap tx across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon, or 20+ chains. OKX-aggregated routing over 500+ DEX sources with slippage control, price-impact protection, and cross-DEX route optimization. For OKX-aggregated swaps with no named venue. If the prompt names a specific DApp as the swap venue (Polymarket, Aave, Hyperliquid, PancakeSwap, Morpho, Raydium, Curve, Compound, Pendle, Lido, ether.fi, GMX, Kamino, Orca, Meteora, Clanker, pump.fun, Uniswap), route to okx-dapp-discovery instead, e.g. 'swap on PancakeSwap', 'swap SOL for USDC on Raydium', '在 Curve 上换 USDT', 'swap on Uniswap'.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dex-swap"
+ },
+ {
+ "name": "okx-dex-token",
+ "description": "Use this skill for token-level data: search tokens, trending/hot tokens (热门, 代币榜单), liquidity pools, holder distribution (whale/巨鲸, sniper, bundler-tagged holder %), token risk metadata (riskControlLevel, tokenTags, dev stats, suspicious/bundle holding % via advanced-info), recent buy/sell activity, trade feed/逐笔成交/每笔交易/stream trades, top profit addresses, token trade history, detailed price info with market cap volume liquidity and holder count (price-info), or holder cluster analysis (持仓集中度, cluster overview, cluster rug pull risk/跑路风险, new wallet percentage/新钱包持仓比例, holder clusters, 'are top holders in same cluster'). Also handles Market API payment/计费/x402/402, Basic/Premium tier/quota/额度 questions, and MARKET_API_*_OVER_QUOTA / confirming:true responses on token endpoints (advanced-info, top-trader, cluster-*, trades, hot-tokens). NOTE: if the user wants to write a WebSocket script/脚本/bot, use okx-dex-ws instead.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dex-token"
+ },
+ {
+ "name": "okx-dex-trenches",
+ "description": "Read-only on-chain research for pump.fun and other meme-token launchpads (Solana / BSC / X Layer / TRON). MUST invoke (prefer over WebFetch / MCP price tools) when the user asks about: new meme launches / 新盘 / 扫链 / 打狗; developer reputation / rug history / launch count / 开发者信息; bundle or sniper detection (the analytical noun, NOT the verb) / 捆绑狙击者; bonding curve progress / 已迁移出 bonding curve; similar tokens by same dev / 相似代币; co-investor / who-aped / 同车 wallets; or 'pump.fun alpha'. Also handles Market API x402 / quota questions on memepump endpoints. Body holds the read-vs-write gate — `狙击 / snipe + token` (sniping action) routes to okx-dapp-discovery; `捆绑狙击者 / sniper detection` (analytical noun) stays here. WebSocket script/bot → okx-dex-ws.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dex-trenches"
+ },
+ {
+ "name": "okx-dex-ws",
+ "description": "Use this skill when the user mentions 'onchainos ws', 'ws start', 'ws poll', 'ws stop', 'ws channels', 'ws session', 'ws channel-info', 'idle-timeout', 'idle timeout', 'WebSocket channels', 'WS频道', or asks about managing WebSocket sessions/会话管理. Also use when writing a custom WebSocket script/脚本/bot for real-time on-chain data. Covers: onchainos ws CLI commands (start/poll/stop/list/channels/channel-info), session lifecycle, idle-timeout configuration, and all 9 DEX WebSocket channels (price, candle, trades, price-info, signals, tracker, meme scanning).",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-dex-ws"
+ },
+ {
+ "name": "okx-growth-competition",
+ "description": "List OKX Agentic Wallet exclusive trading competitions, register users for contests, track participation and leaderboard rankings, and claim won rewards. Use when users want to list available trading competitions or trading cups, view competition rules / prize pool / total prizes, register or sign up or enroll or join a contest, check the leaderboard (who is winning) or their own rank (am I in the prize zone, what is my place), ask did I win or query participation / claim status, claim won rewards or prizes from completed competitions, see which wallet account they registered with, or submit Telegram / WeChat / Email / Twitter contact for prize delivery to top-tier winners.",
+ "category": "intel/trading",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-growth-competition"
+ },
+ {
+ "name": "metamask-agent-wallet",
+ "description": "Use when the user asks anything about blockchain wallets, transactions, signing, token transfers, supported chains, wallet balances, perpetual futures trading, prediction markets, token swaps, cross-chain bridges, market data, token discovery, decoding EVM calldata, Aave V3 lending and borrowing, or authentication via the MetaMask Agentic CLI. Single entry point for all mm CLI operations.",
+ "category": "wallet/payments",
+ "origin": "metamask",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/metamask-agent-wallet"
+ },
+ {
+ "name": "metamask-agent-workflows",
+ "description": "Use when the user needs to perform multi-step operations with the MetaMask Agentic CLI such as onboarding, login, swapping tokens, bridging across chains, opening/closing/modifying perpetual positions, prediction market trading, Aave V3 lending and borrowing, or troubleshooting CLI issues.",
+ "category": "wallet/payments",
+ "origin": "metamask",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/metamask-agent-workflows"
+ },
+ {
+ "name": "okx-agent-chat",
+ "description": "Routing stub — any a2a-agent-chat envelope / agent-task system message is handled by `okx-agent-task`. For missing or uninitialized OKX A2A communication runtime/plugin, read `skills/okx-agent-chat/ensure-okx-a2a-communication-ready.md`.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-agent-chat"
+ },
+ {
+ "name": "okx-agent-identity",
+ "description": "ERC-8004 on-chain Agent identity on XLayer: register / create / update / activate / deactivate / search agents; view ratings; list agent services; set avatar. Roles: user (User / User Agent / Buyer / Client / 用户 / 买家 / 买方), asp (ASP / Provider / Provider Agent / Seller / Merchant / 提供者 / 商家 / 服务提供商 / 卖家 / 卖方), evaluator (Evaluator / Evaluator Agent / 仲裁者 / 评估者). Use for: 注册agent / 注册ASP / 注册User / 注册用户 / 注册买家 / 注册卖家 / 注册服务提供商 / 注册仲裁者 / 创建用户 / 创建买家 / 创建卖家 / 我的agent / 我的ASP / 改agent / 更新agent / 上架 / 下架 / 上架ASP / 停用 / 搜索agent / 找做X的ASP / 查口碑 / 传头像 / agent有什么服务 / endpoint怎么填 / register agent / register ASP / register User / register Provider / register Seller / register Buyer / register Client / update agent / modify agent / activate / deactivate / search agent / agent reviews / agent services / upload avatar. Role words, lifecycle verbs and the product name are spacing / casing / typo tolerant — match by meaning (e.g. \"更新卖家身份\" → update an asp identity).",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-agent-identity"
+ },
+ {
+ "name": "okx-agent-payments-protocol",
+ "description": "Use when an agent hits HTTP 402 / payment-required, or the user mentions x402, x402Version, X-PAYMENT, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, WWW-Authenticate: Payment, permit2, upto, metered billing, a payment channel / voucher / session, channelId / channel_id, opening / closing / topping up / settling / refunding a channel, a paymentId or a2a_ link, creating / checking a payment link, A2MCP / an A2MCP endpoint, or sending a request to / calling an Agent's endpoint with a concrete endpoint URL. Covers x402 (exact, exact+Permit2, upto, aggr_deferred), MPP (charge / session), and a2a-pay paymentId flows. Any close / topup / settle / voucher / refund near a channel_id or session is an MPP mid-session op. The full bilingual trigger list (including Chinese) lives in the skill body.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-agent-payments-protocol"
+ },
+ {
+ "name": "okx-agent-task",
+ "description": "MUST ACTIVATE on inbound envelopes: (1) {agentId, message:{source:\"system\", event, jobId, ...}} — system event; (2) {msgType:\"a2a-agent-chat\", jobId, sender:{role}, ...} — agent-to-agent task chat (fields at top level; sender.role = COUNTERPARTY, not you); (3) literal \"Read okx-agent-task/SKILL.md\" in envelope. ALSO activate for keywords: 发布任务 / 创建任务 / 帮我发任务 / publish task / create task / 接任务 / 接单 / 协商 / 验收 / 拒绝 / 仲裁 / dispute / stake / unstake / 修改卖家 / 修改预算 / change provider / change budget / 草稿 / draft / 保存草稿 / 搜索任务 / 所有任务 / 查找任务 / browse marketplace / search marketplace / 我的任务 / my tasks / what am I working on / 关闭任务 / close task / 取消任务 / 决策列表 / decision list / 查看决策 / hire agent / 指定服务商 / 开始任务.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-agent-task"
+ },
+ {
+ "name": "okx-agentic-wallet",
+ "description": "AUTHORITATIVE source for OKX Agentic Wallet and its Gas Station feature. Gas Station = OKX's stablecoin-gas feature on Solana via third-party Relayer; Solana only, no EIP-7702. MUST invoke for Gas Station questions (what is / how it works / supported tokens / fees / enable or disable gas station / change default gas token / Jito Bundler compatibility) AND any wallet action: login, OTP verify, add/switch/status/logout account, balance, assets, holdings, addresses, deposit / receive / top up, send (native + ERC-20 / SPL, transfer ETH / USDC / etc., pay someone), contract call (approve, swap calldata, contract function), history (list + tx detail by orderId / txHash / uopHash), check order status, sign-message (personalSign EVM + Solana, EIP-712 EVM only), TEE signing, export wallet / mnemonic.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-agentic-wallet"
+ },
+ {
+ "name": "okx-ai-guide",
+ "description": "OKX.AI (the Agent economic system) intro & onboarding entry. Use whenever the user asks what OKX.AI is, what it can do, how to use or get started with it, wants an OKX.AI tutorial / quickstart / help, or types the product name in any spelling / spacing / casing / typo variant (OKXAI, okx ai, okx-ai, lowercase okx.ai, mis-typed Chinese like 啥是okxai) — e.g. what is OKX.AI / OKX.AI 是什么 / 怎么用 OKX.AI / OKX.AI 快速开始, and any paraphrase in any language. Detects the runtime platform, introduces the three roles (User / ASP / Evaluator), and routes the user into identity registration. NOT for generic onchain-OS onboarding, nor for direct task operations (publishing / accepting / delivering / disputing a task — a separate task-lifecycle flow).",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-ai-guide"
+ },
+ {
+ "name": "okx-ai-support",
+ "description": "Route users to OKX.AI customer support / Help Center. Use when the user wants to contact support, talk to a human, file a complaint, give feedback, report a system error or bug, or find the FAQ / help docs. Triggers: 'contact support', 'talk to a human', 'customer service', 'file a complaint', 'give feedback', 'help center', 'FAQ', 'user guide', 'system error', 'system bug', 'something is broken', 'find help docs', 'OKX AI support', 'OnchainOS support', 'human agent'.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-ai-support"
+ },
+ {
+ "name": "okx-audit-log",
+ "description": "Use this skill when the user asks to export audit logs, find audit log location, view command history, 导出日志, 查看日志, 日志路径, 操作记录, 调用记录, 命令历史. Do NOT use for wallet balance, token search, swap, or any other on-chain operation — use the corresponding skill instead.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-audit-log"
+ },
+ {
+ "name": "okx-how-to-play",
+ "description": "Onchain OS onboarding entry router. Triggers: 'what is onchainos', 'what is onchain os', 'what can onchainos do', 'what does onchainos do', 'how do I use this', 'how do I play', 'how to use onchainos', 'how to play onchainos', 'how does onchainos work', 'how do I start', 'getting started', 'tutorial', 'onboarding', 'first time', 'I just installed', 'now what', 'what do I do now', 'where do I start', 'who are you', 'what are you', 'introduce onchainos', 'tell me about onchainos', 'I'm new'. NOT for: questions where the subject is explicitly 'OKX.AI' — use okx-ai-guide instead.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-how-to-play"
+ },
+ {
+ "name": "okx-onchain-gateway",
+ "description": "Onchain transaction gateway across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon and 20+ chains. Invoke to broadcast a pre-signed / raw / already-signed transaction, push a serialized tx on-chain, query current gas price, estimate gas limit, simulate or dry-run a transaction before sending, track a broadcast order, or check tx-confirmed / pending status by txHash or orderId.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-onchain-gateway"
+ },
+ {
+ "name": "okx-security",
+ "description": "Use this skill for security scanning: check transaction safety, is this transaction safe, pre-execution check, security scan, token risk scanning, honeypot detection, DApp/URL phishing detection, message signature safety, malicious transaction detection, approval safety checks, token approval management. Triggers: 'is this token safe', 'check token security', 'honeypot check', 'scan this tx', 'scan this swap tx', 'tx risk check', 'is this URL a scam', 'check if this dapp is safe', 'phishing site check', 'is this signature safe', 'check this signing request', 'check my approvals', 'show risky approvals', 'revoke approval', 'check if this approve is safe', token authorization, ERC20 allowance, Permit2. Covers token-scan, dapp-scan, tx-scan (EVM+Solana pre-execution), sig-scan (EIP-712/personal_sign), approvals (ERC-20/Permit2). Chinese: 安全扫描, 代币安全, 蜜罐检测, 貔貅盘, 钓鱼网站, 交易安全, 签名安全, 代币风险, 授权管理, 授权查询, 风险授权, 代币授权. Do NOT use for wallet balance/send/history — use okx-agentic-wallet.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-security"
+ },
+ {
+ "name": "okx-task-watch",
+ "description": "监听任务进展 / 帮我盯着任务 / 任务有动静告诉我 / 历史消息 / 未读消息 / 未决策 / 待决策 / 继续监听 / task watch / user watch / monitor task progress / catch me up on tasks / outstanding decisions — OKX A2A user-session task-notification monitor: live long-poll via `okx-a2a user watch` (also drains backlog of past/missed/unread events on entry) plus un-replied decision_request lister via `okx-a2a user outdated-list`. Not for wallet / gas / task-list / status queries.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-task-watch"
+ },
+ {
+ "name": "okx-wallet-portfolio",
+ "description": "Public-address portfolio lookup across XLayer, Solana, Ethereum, Base, BSC, Arbitrum, Polygon and 20+ chains. Invoke when the user supplies a wallet address and wants its: balance, token holdings, total portfolio value, or DeFi positions (e.g. 'check balance of 0xAbc', 'what tokens does 0xAbc hold', 'portfolio value of this address'). Requires an explicit address — for the user's own logged-in wallet with no address use okx-agentic-wallet.",
+ "category": "wallet/payments",
+ "origin": "okx",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/okx-wallet-portfolio"
+ },
+ {
+ "name": "authenticate-wallet",
+ "description": "Sign in to the wallet. Use when you or the user want to log in, sign in, connect, or set up the wallet, or when any wallet operation fails with authentication or \"not signed in\" errors. This skill is a prerequisite before sending, trading, or funding.",
+ "category": "wallet/payments",
+ "origin": "three.ws",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/authenticate-wallet"
+ },
+ {
+ "name": "fund",
+ "description": "Add money to the wallet. Use when you or the user want to fund, deposit, top up, load, buy USDC, add funds, onramp, or get USDC. Also use when the wallet has insufficient balance for a send or trade operation, or when someone asks \"how do I get USDC?\"",
+ "category": "wallet/payments",
+ "origin": "three.ws",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/fund"
+ },
+ {
+ "name": "monetize-service",
+ "description": "Build and deploy a paid API that other agents can pay to use via x402. Use when you or the user want to monetize an API, make money, earn money, offer a service, sell a service to other agents, charge for endpoints, create a paid endpoint, or set up a paid service. Covers \"make money by offering an endpoint\", \"sell a service\", \"monetize your data\", \"create a paid API\".",
+ "category": "wallet/payments",
+ "origin": "three.ws",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/monetize-service"
+ },
+ {
+ "name": "pay-for-service",
+ "description": "Make a paid API request to an x402 endpoint with automatic USDC payment. Use when you or the user want to call a paid API, make an x402 request, use a paid service, or pay for an API call. Use after finding a service with search-for-service.",
+ "category": "wallet/payments",
+ "origin": "three.ws",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/pay-for-service"
+ },
+ {
+ "name": "query-onchain-data",
+ "description": "Query onchain data on Base using the CDP SQL API via x402. Use when you or your user want to view onchain information about decoded blocks, transactions, and events.",
+ "category": "wallet/payments",
+ "origin": "three.ws",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/query-onchain-data"
+ },
+ {
+ "name": "search-for-service",
+ "description": "Search and browse the x402 bazaar marketplace for paid API services. Use when you or the user want to find available services, see what's available, discover APIs, or need an external service to accomplish a task. Also use as a fallback when no other skill clearly matches — search the bazaar to see if a paid service exists. Covers \"what can I do?\", \"find me an API for...\", \"what services are available?\", \"search for...\", \"browse the bazaar\".",
+ "category": "wallet/payments",
+ "origin": "three.ws",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/search-for-service"
+ },
+ {
+ "name": "send-usdc",
+ "description": "Send tokens (USDC, ETH, POL, or SOL) to an address or ENS name on Base, Polygon, or Solana. Use when you or the user want to send money, pay someone, transfer tokens, tip, donate, or send funds to a wallet address or .eth name. Covers phrases like \"send $5 to\", \"pay 0x...\", \"transfer to vitalik.eth\", or \"send USDC on Solana\".",
+ "category": "wallet/payments",
+ "origin": "three.ws",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/send-usdc"
+ },
+ {
+ "name": "trade",
+ "description": "Swap or trade tokens on Base or Polygon. Use when you or the user want to trade, swap, exchange, buy, sell, or convert between tokens like USDC, ETH, and POL. Covers phrases like \"buy ETH\", \"sell ETH for USDC\", \"convert USDC to ETH\", \"get some ETH\", \"buy POL\".",
+ "category": "wallet/payments",
+ "origin": "three.ws",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/trade"
+ },
+ {
+ "name": "x402",
+ "description": "Search for new services and make paid API requests using the x402 payment protocol. Use when you don't have a clear tool to choose, search the bazaar. You can also use this tool if you or the user want to call an x402 endpoint, discover payment requirements, browse the bazaar, or search for paid services.",
+ "category": "wallet/payments",
+ "origin": "three.ws",
+ "crossPlatformSafe": false,
+ "path": ".agents/skills/x402"
+ }
+ ]
+}
diff --git a/.agents/skills/trade/SKILL.md b/.agents/skills/trade/SKILL.md
index 5e5ff59d1..6d819ee38 100644
--- a/.agents/skills/trade/SKILL.md
+++ b/.agents/skills/trade/SKILL.md
@@ -4,6 +4,10 @@ description: Swap or trade tokens on Base or Polygon. Use when you or the user w
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(npx [email protected] status*)", "Bash(npx [email protected] trade *)", "Bash(npx [email protected] balance*)"]
+metadata:
+ category: wallet/payments
+ cross-platform-safe: false
+ pack: three-ws-skills
---
# Trading Tokens
diff --git a/.agents/skills/x402/SKILL.md b/.agents/skills/x402/SKILL.md
index 2e0f9b83a..f82ab6840 100644
--- a/.agents/skills/x402/SKILL.md
+++ b/.agents/skills/x402/SKILL.md
@@ -3,6 +3,10 @@ name: x402
description: Search for new services and make paid API requests using the x402 payment protocol. Use when you don't have a clear tool to choose, search the bazaar. You can also use this tool if you or the user want to call an x402 endpoint, discover payment requirements, browse the bazaar, or search for paid services.
user-invocable: true
disable-model-invocation: false
+metadata:
+ category: wallet/payments
+ cross-platform-safe: false
+ pack: three-ws-skills
---
# x402 Payment Protocol
diff --git a/api/3d/studio.js b/api/3d/studio.js
new file mode 100644
index 000000000..d44a7f4b4
--- /dev/null
+++ b/api/3d/studio.js
@@ -0,0 +1,222 @@
+// POST /api/3d/studio + GET /api/3d/studio?job=<id>
+//
+// The ChatGPT Actions surface for free text→3D — the REST contract behind the
+// "three.ws 3D Studio" custom GPT (prompts/store-submissions/_generated/
+// openai-actions.yaml). It exists as a separate route from /api/3d/generate
+// because a GPT Store listing has stricter response rules than the agent lane:
+// responses may carry ONLY the model URLs and job state — no upsell block, no
+// pricing paths, no internal identifiers — and every prompt must pass the
+// age-13+ content-safety gate before any GPU work starts.
+//
+// It is a thin shaper, not a second pipeline: generation runs through the SAME
+// forge-client → /api/forge free draft lane (NVIDIA NIM TRELLIS) and draws from
+// the SAME per-IP quota buckets as /api/3d/generate, so adding this surface
+// creates no new capacity and no new limiter.
+//
+// POST { prompt }
+// → 200 { status:'done', glbUrl, viewerUrl, format } (finished inline)
+// → 200 { status:'pending', job, poll, format } (queued — poll below)
+// → 400 { error:'prompt_rejected', message } (safety gate refusal)
+//
+// GET ?job=<id>
+// → 200 { status:'pending', job, poll } (still generating)
+// → 200 { status:'done', glbUrl, viewerUrl, format } (GLB ready)
+// → 200 { status:'error', error } (upstream failed — retry is free)
+//
+// ChatGPT Actions time out at ~45s; the forge lane bounds its synchronous hold
+// to 30s (NVCF_POLL_SECONDS in api/_providers/nvidia.js), so a slow job always
+// returns 'pending' + a poll handle before the Action deadline instead of dying
+// on the socket.
+
+import { cors, wrap, method, json, error, readJson, rateLimited } from '../_lib/http.js';
+import { limits, clientIp } from '../_lib/rate-limit.js';
+import { startForge, originFromReq, viewerUrl } from '../_mcp-studio/forge-client.js';
+import { checkPromptSafety } from '../_mcp-studio/safety.js';
+
+const PROMPT_MIN = 3; // the draft lane needs a subject to condition on
+const PROMPT_MAX = 1000; // matches /api/forge's own prompt ceiling
+const MAX_BODY_BYTES = 8_000;
+
+// A forge job handle is either a signed f1.<b64url>.<b64url> string or a bare
+// prediction id. Bound the poll param to that shape before forwarding —
+// /api/forge does the authoritative validation, this just keeps junk off the wire.
+const JOB_HANDLE_RE = /^[A-Za-z0-9._-]{8,1024}$/;
+
+// Shape a forge submit response into the Actions contract: model URLs and job
+// state only. Pure + exported so tests pin the boundary against real captured
+// forge shapes without any network.
+export function shapeSubmit(job, base) {
+ const glbUrl = typeof job?.glb_url === 'string' ? job.glb_url : '';
+ if (job?.status === 'done' && glbUrl) {
+ return { status: 'done', glbUrl, viewerUrl: viewerUrl(base, glbUrl), format: 'glb' };
+ }
+ const handle = job?.job_id ?? null;
+ return {
+ status: 'pending',
+ job: handle,
+ poll: handle ? `/api/3d/studio?job=${encodeURIComponent(handle)}` : null,
+ format: 'glb',
+ };
+}
+
+// Shape a forge poll response into { status:'pending'|'done'|'error', ... }.
+export function shapePoll(data, base, jobId) {
+ const glbUrl = typeof data?.glb_url === 'string' ? data.glb_url : '';
+ if (data?.status === 'done' && glbUrl) {
+ return { status: 'done', job: jobId, glbUrl, viewerUrl: viewerUrl(base, glbUrl), format: 'glb' };
+ }
+ if (data?.status === 'failed') {
+ return {
+ status: 'error',
+ job: jobId,
+ // The message is already sanitized by /api/forge; generation is free, so a
+ // failed job costs the user nothing — they can simply try again.
+ error: data?.error || '3D generation hit a snag upstream — it costs nothing to try again.',
+ };
+ }
+ // queued / running / anything transient → still pending.
+ return { status: 'pending', job: jobId, poll: `/api/3d/studio?job=${encodeURIComponent(jobId)}` };
+}
+
+// Map a startForge lane failure to an honest boundary response. A well-formed
+// prompt must NEVER 500: every code has a designed status + actionable message.
+function failFromLane(res, err) {
+ switch (err?.code) {
+ case 'not_configured':
+ return json(res, 503, {
+ error: 'not_configured',
+ message: '3D generation is temporarily unavailable on this deployment — try again later.',
+ });
+ case 'busy':
+ if (err.retryAfter) res.setHeader('retry-after', String(err.retryAfter));
+ return json(res, 429, {
+ error: 'rate_limited',
+ message: err.message || 'The free 3D generator is momentarily saturated — try again shortly.',
+ retry_after: err.retryAfter || 10,
+ });
+ case 'timeout':
+ res.setHeader('retry-after', '10');
+ return json(res, 503, {
+ error: 'lane_timeout',
+ message: err.message || 'The 3D generator took too long to accept the job — try again.',
+ retry_after: 10,
+ });
+ default:
+ return json(res, 502, {
+ error: 'generation_failed',
+ message: err?.message || 'The 3D generator could not start this job — try again.',
+ });
+ }
+}
+
+async function generate(req, res) {
+ const ip = clientIp(req);
+
+ let body;
+ try {
+ body = await readJson(req, MAX_BODY_BYTES);
+ } catch (err) {
+ return json(res, err?.status === 413 ? 413 : 400, {
+ error: 'bad_request',
+ message: err?.status === 413 ? 'Request body too large.' : 'Send a JSON body: { "prompt": "..." }.',
+ });
+ }
+
+ const prompt = typeof body?.prompt === 'string' ? body.prompt.trim() : '';
+ if (prompt.length < PROMPT_MIN) {
+ return json(res, 400, {
+ error: 'invalid_prompt',
+ message: `"prompt" is required — describe one subject in ${PROMPT_MIN}–${PROMPT_MAX} characters, e.g. "a small ceramic robot figurine".`,
+ });
+ }
+ if (prompt.length > PROMPT_MAX) {
+ return json(res, 400, {
+ error: 'invalid_prompt',
+ message: `"prompt" must be ${PROMPT_MAX} characters or fewer.`,
+ });
+ }
+
+ // Age-13+ content gate BEFORE any quota spend or GPU work. The category
+ // message is the user-facing refusal the GPT relays verbatim.
+ const safety = checkPromptSafety(prompt);
+ if (!safety.allowed) {
+ return json(res, 400, { error: 'prompt_rejected', message: safety.message });
+ }
+
+ // Per-IP guard on the free GPU lane — the SAME bucket /api/3d/generate and
+ // /api/forge draw from, so this surface adds no new unmetered capacity.
+ const rl = await limits.mcp3dGenerateFree(ip);
+ if (!rl.success) {
+ return rateLimited(res, rl, 'Free 3D generation limit reached — try again in a little while.');
+ }
+
+ const base = originFromReq(req);
+ let job;
+ try {
+ // Pin the free draft lane exactly: NVIDIA NIM TRELLIS, image path, draft tier.
+ job = await startForge(base, { prompt, backend: 'nvidia', path: 'image', tier: 'draft' });
+ } catch (err) {
+ return failFromLane(res, err);
+ }
+
+ return json(res, 200, shapeSubmit(job, base));
+}
+
+async function poll(req, res, jobId) {
+ if (!JOB_HANDLE_RE.test(jobId)) {
+ return json(res, 400, { error: 'invalid_job', message: 'Malformed job id. Pass the "job" value from the generate response.' });
+ }
+
+ // Cheap, high-frequency poll — reuse the forge status limiter (per-instance,
+ // flood-guard only) so a polling loop can't be turned into a hammer.
+ const rl = await limits.mcp3dStatus(clientIp(req));
+ if (!rl.success) return rateLimited(res, rl, 'Polling too fast — slow down and retry.');
+
+ const base = originFromReq(req);
+ let upstream;
+ try {
+ upstream = await fetch(`${base}/api/forge?job=${encodeURIComponent(jobId)}`, {
+ headers: { accept: 'application/json' },
+ signal: AbortSignal.timeout(15_000),
+ });
+ } catch {
+ // A transient network blip on the self-call is not a job failure — tell the
+ // caller it's still pending so its poll loop retries.
+ return json(res, 200, shapePoll({ status: 'running' }, base, jobId));
+ }
+
+ const data = await upstream.json().catch(() => ({}));
+ if (upstream.status === 400) {
+ return json(res, 400, { error: 'invalid_job', message: data?.message || 'Unknown or malformed job id.' });
+ }
+ if (upstream.status === 429) {
+ const retryAfter = Number(data?.retry_after) || 5;
+ res.setHeader('retry-after', String(retryAfter));
+ return json(res, 429, { error: 'rate_limited', message: 'Polling is rate-limited — retry shortly.', retry_after: retryAfter });
+ }
+ if (!upstream.ok) {
+ // Upstream hiccup mid-poll — keep the job alive as pending so the loop retries.
+ return json(res, 200, shapePoll({ status: 'running' }, base, jobId));
+ }
+
+ return json(res, 200, shapePoll(data, base, jobId));
+}
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,POST,OPTIONS' })) return;
+ if (!method(req, res, ['GET', 'POST'])) return;
+
+ if (req.method === 'POST') return generate(req, res);
+
+ const url = new URL(req.url, 'http://localhost');
+ const jobId = (url.searchParams.get('job') || '').trim();
+ if (!jobId) {
+ return error(res, 400, 'missing_job', 'Pass ?job=<id> to poll a generation, or POST { prompt } to start one.');
+ }
+ return poll(req, res, jobId);
+});
+
+// The free NIM draft often finishes inside the submit window; startForge waits up
+// to 90s for that inline completion. Give the function headroom beyond the default
+// so a fast draft returns done in one call instead of forcing a poll.
+export const config = { maxDuration: 120 };
diff --git a/api/_lib/http.js b/api/_lib/http.js
index a5fb32b4e..b41746e72 100644
--- a/api/_lib/http.js
+++ b/api/_lib/http.js
@@ -382,7 +382,7 @@ export function cors(
// cross-origin readers only see CORS-safelisted response headers.
res.setHeader(
'access-control-expose-headers',
- 'PAYMENT-REQUIRED, x-payment-response, x-payment-network, x-payment-tx, link',
+ 'PAYMENT-REQUIRED, PAYMENT-RESPONSE, x-payment-response, x-payment-network, x-payment-tx, link',
);
res.setHeader('access-control-max-age', '86400');
if (req.method === 'OPTIONS') {
diff --git a/api/_lib/x402-spec.js b/api/_lib/x402-spec.js
index 1d9b4145f..9f90fc8e2 100644
--- a/api/_lib/x402-spec.js
+++ b/api/_lib/x402-spec.js
@@ -1172,6 +1172,12 @@ export function encodePaymentResponseHeader(settleResult, extensions) {
transaction: settleResult.transaction,
network: settleResult.network,
payer: settleResult.payer,
+ // SettleResponse extras the OKX Agent Payments Protocol receipt carries
+ // (specs/okx-agent-payments.md §1.4): `status` ("success"/"pending" —
+ // pending buyers poll /settle/status), `amount` in atomic units. Other
+ // rails' facilitators don't return them; absent stays absent.
+ ...(settleResult.status ? { status: settleResult.status } : {}),
+ ...(settleResult.amount ? { amount: settleResult.amount } : {}),
};
if (extensions && Object.keys(extensions).length > 0) {
body.extensions = extensions;
diff --git a/api/_lib/x402-xlayer-okx.js b/api/_lib/x402-xlayer-okx.js
index bbacebca2..3cac0910a 100644
--- a/api/_lib/x402-xlayer-okx.js
+++ b/api/_lib/x402-xlayer-okx.js
@@ -480,6 +480,7 @@ export async function settleOkxXLayerPayment({ verified, requirement, paymentPay
network: result.network || NETWORK_XLAYER_MAINNET,
payer: result.payer || verified.payer,
...(result.status ? { status: result.status } : {}),
+ amount: result.amount || verified.amount,
};
}
const account = relayerAccount();
@@ -516,6 +517,10 @@ export async function settleOkxXLayerPayment({ verified, requirement, paymentPay
transaction: hash,
network: NETWORK_XLAYER_MAINNET,
payer: verified.payer,
+ // Direct redemption waited for the receipt — the transfer is
+ // confirmed, matching the facilitator's syncSettle "success".
+ status: 'success',
+ amount: verified.amount,
};
} catch (err) {
if (err instanceof X402Error) throw err;
diff --git a/api/mcp-3d.js b/api/mcp-3d.js
index cfef74b7f..6be60f501 100644
--- a/api/mcp-3d.js
+++ b/api/mcp-3d.js
@@ -107,7 +107,12 @@ export default wrap(async (req, res) => {
if (anySuccess) {
try {
const settled = await settlePayment({ verified: x402Ctx.verified });
- res.setHeader('x-payment-response', encodePaymentResponseHeader(settled));
+ // Both receipt header names: PAYMENT-RESPONSE is the x402 v2
+ // standard (what OKX Agent Payments Protocol buyers decode),
+ // x-payment-response the v1 name legacy clients still read.
+ const receipt = encodePaymentResponseHeader(settled);
+ res.setHeader('PAYMENT-RESPONSE', receipt);
+ res.setHeader('x-payment-response', receipt);
} catch (err) {
return sendX402Error(
res,
diff --git a/api/mcp-agent.js b/api/mcp-agent.js
index 834035c50..bd03e5ea4 100644
--- a/api/mcp-agent.js
+++ b/api/mcp-agent.js
@@ -7,6 +7,7 @@ import { cors, readJson, wrap } from './_lib/http.js';
import { limits, clientIp } from './_lib/rate-limit.js';
import { settlePayment, encodePaymentResponseHeader } from './_lib/x402-spec.js';
import { peekCalledTool } from './_lib/mcp-dispatch.js';
+import { isDiscoveryOnlyBatch } from './_lib/mcp-batch-price.js';
import { PROTOCOL_VERSION, dispatch, isPublicTool } from './_mcpagent/dispatch.js';
import {
send401,
@@ -14,6 +15,7 @@ import {
authenticateRequest,
handleSse,
handleTerminate,
+ isMcpProtocolClient,
} from './_mcp/auth.js';
import { sendX402Error, reservePaymentProof } from './_mcp/payments.js';
@@ -26,11 +28,16 @@ export default wrap(async (req, res) => {
// Read + parse the body before auth so a call to the free public
// getting_started tool can be served without an OAuth token or x402 payment.
+ // Discovery-only batches (initialize / tools/list / ping) from plain x402
+ // agents and crawlers are likewise free — but NOT from MCP protocol clients,
+ // which need the 401 to start their OAuth flow (same gate as /api/mcp).
const body = await readJson(req, 1_000_000);
const { toolName } = peekCalledTool(body);
const result = await authenticateRequest(req, res, {
- allowFree: Boolean(toolName && isPublicTool(toolName)),
+ allowFree:
+ Boolean(toolName && isPublicTool(toolName)) ||
+ (isDiscoveryOnlyBatch(body) && !isMcpProtocolClient(req)),
});
if (!result) return;
const { auth, x402Ctx } = result;
diff --git a/api/mcp-bazaar.js b/api/mcp-bazaar.js
index 3c89e8309..5234a24c7 100644
--- a/api/mcp-bazaar.js
+++ b/api/mcp-bazaar.js
@@ -4,11 +4,12 @@
// Discovery surface over the live x402 facilitator network: search, browse, and
// price paid agent services from any MCP client. Shares the main server's
// OAuth/x402 auth, rate limiting, and transport. Registered with the MCP
-// Registry as io.github.nirholas/three-ws-x402-bazaar (see server-bazaar.json).
+// Registry as io.github.nirholas/threews-x402-bazaar (see server-bazaar.json).
import { cors, readJson, wrap } from './_lib/http.js';
import { limits, clientIp } from './_lib/rate-limit.js';
import { settlePayment, encodePaymentResponseHeader } from './_lib/x402-spec.js';
import { peekCalledTool } from './_lib/mcp-dispatch.js';
+import { isDiscoveryOnlyBatch } from './_lib/mcp-batch-price.js';
import { PROTOCOL_VERSION, dispatch, isPublicTool } from './_mcpbazaar/dispatch.js';
import {
send401,
@@ -16,6 +17,7 @@ import {
authenticateRequest,
handleSse,
handleTerminate,
+ isMcpProtocolClient,
} from './_mcp/auth.js';
import { sendX402Error, reservePaymentProof } from './_mcp/payments.js';
@@ -28,11 +30,16 @@ export default wrap(async (req, res) => {
// Read + parse the body before auth so a call to the free public
// getting_started tool can be served without an OAuth token or x402 payment.
+ // Discovery-only batches (initialize / tools/list / ping) from plain x402
+ // agents and crawlers are likewise free — but NOT from MCP protocol clients,
+ // which need the 401 to start their OAuth flow (same gate as /api/mcp).
const body = await readJson(req, 1_000_000);
const { toolName } = peekCalledTool(body);
const result = await authenticateRequest(req, res, {
- allowFree: Boolean(toolName && isPublicTool(toolName)),
+ allowFree:
+ Boolean(toolName && isPublicTool(toolName)) ||
+ (isDiscoveryOnlyBatch(body) && !isMcpProtocolClient(req)),
});
if (!result) return;
const { auth, x402Ctx } = result;
diff --git a/api/okx/3d/[service].js b/api/okx/3d/[service].js
index 28c62c237..ef7aabfc4 100644
--- a/api/okx/3d/[service].js
+++ b/api/okx/3d/[service].js
@@ -380,7 +380,9 @@ async function handleIdentityStudio(req, res) {
if (anySuccess) {
try {
const settled = await settlePayment({ verified: x402Ctx.verified });
- res.setHeader('x-payment-response', encodePaymentResponseHeader(settled));
+ const receipt = encodePaymentResponseHeader(settled);
+ res.setHeader('PAYMENT-RESPONSE', receipt);
+ res.setHeader('x-payment-response', receipt);
} catch (err) {
return sendX402Error(
res,
diff --git a/docs/agent-skills.md b/docs/agent-skills.md
new file mode 100644
index 000000000..b3d878d1c
--- /dev/null
+++ b/docs/agent-skills.md
@@ -0,0 +1,111 @@
+# three.ws Agent Skills pack
+
+The three.ws **Agent Skills pack** is a set of portable skill folders that teach any
+Claude surface — Claude Code, the Claude apps, the Agent SDK — how to use the
+three.ws platform: create and rig 3D models, run a wallet, and buy/sell services in
+the x402 agent economy.
+
+> Not to be confused with the [in-app skills system](skills.md), which extends
+> avatars and agents **inside** three.ws with `manifest.json` + `tools.json` +
+> `handlers.js` bundles. Agent Skills are the inverse: they extend **external**
+> AI agents with three.ws capabilities.
+
+Each skill follows the [Agent Skills open standard](https://agentskills.io/specification):
+a folder with a `SKILL.md` whose frontmatter `description` is the *trigger* — the only
+text the model sees when deciding to load the skill — plus optional scripts and
+reference files loaded on demand (progressive disclosure).
+
+## What's in the pack
+
+The pack lives at [`.agents/skills/`](../.agents/skills/). The full index with every
+trigger is generated into [`.agents/skills/SKILLS.md`](../.agents/skills/SKILLS.md)
+(human) and [`.agents/skills/skills-pack.json`](../.agents/skills/skills-pack.json)
+(machine/registry) by `node scripts/build-skills-pack.mjs`.
+
+Three categories:
+
+| Category | Skills | Notes |
+| --- | --- | --- |
+| **3d/creative** | `generate-3d-model`, `create-3d-avatar`, `rig-a-model` | Text→GLB on the free lane, one-call rigged avatars, auto-rigging. **Cross-platform-safe**: zero coin/wallet/payment content, so this subset is reusable on non-Claude tracks (OpenAI, etc.). |
+| **wallet/payments** | `authenticate-wallet`, `fund`, `send-usdc`, `trade`, `search-for-service`, `pay-for-service`, `monetize-service`, `query-onchain-data`, `x402`, `metamask-agent-*`, okx wallet/identity set | The x402 agent-economy set. Never bundle these on non-crypto tracks. |
+| **intel/trading** | okx dex/defi market-data and execution set | Vendored partner skills (byte-identical to the vendor drop; categorized only in the pack manifest). |
+
+`skills-pack.json` carries `category`, `origin` (`three.ws` / `okx` / `metamask`), and
+`crossPlatformSafe` per skill, so a registry or a bundling script can slice the pack
+without reading every folder.
+
+## Install paths
+
+### a) As a Claude Code plugin
+
+The pack ships inside the `three-ws-core` plugin of this repo's
+[plugin marketplace](../.claude-plugin/marketplace.json):
+
+```
+/plugin marketplace add nirholas/three.ws
+/plugin install three-ws-core@three-ws
+```
+
+Skills load automatically; invoke one directly with `/generate-3d-model`,
+`/send-usdc`, etc.
+
+### b) Dropped into a project
+
+Copy (or symlink) any skill folder into a project's `.claude/skills/` — this repo
+does exactly that, symlinking every folder from `.agents/skills/` into
+[`.claude/skills/`](../.claude/skills/):
+
+```bash
+cp -r .agents/skills/generate-3d-model ~/my-project/.claude/skills/
+```
+
+Claude Code picks it up on the next session; the folder is self-contained, so it
+works copied out of this repo.
+
+### c) Uploaded to a Claude app / project
+
+In the Claude apps, upload a skill folder (or its zipped form) under
+**Project → Skills** (capabilities). The same `SKILL.md` drives triggering there —
+no code changes needed. For the Agent SDK, pass the folder via the `skills`
+option / skills directory the SDK exposes.
+
+## Authoring rules for this pack
+
+- **Frontmatter**: `name` (must equal the folder name, kebab-case, ≤64 chars) and
+ `description` (≤1024 chars, written as a trigger: *what it does + when to use it*,
+ with the phrases users actually say). Optional `when_to_use` adds routing hints.
+- **Metadata tags**: native skills carry `metadata.category`,
+ `metadata.cross-platform-safe`, and `metadata.pack: three-ws-skills` in
+ frontmatter. Vendored skills (`okx-*`, `metamask-*`) are never edited — their
+ categories live in `scripts/build-skills-pack.mjs`.
+- **Progressive disclosure**: `SKILL.md` stays short (<500 lines); heavy reference
+ material goes in a linked file (`reference.md`, `references/…`) loaded on demand.
+- **Real content only**: every endpoint, tool name, and response shape in a skill
+ is the production one; every bundled script must run. No stubs, no mock output.
+- **Self-contained**: a skill folder must work when copied out of this repo — no
+ relative imports into app internals.
+- After adding or editing a skill, regenerate the manifest:
+ `node scripts/build-skills-pack.mjs` (CI-style check: `--check`).
+
+## The 3D-creation skills
+
+The platform's signature set, safe to reuse anywhere:
+
+- **`generate-3d-model`** — text → textured GLB on the free `forge_free` lane
+ (NVIDIA NIM / TRELLIS; no key, no account). Returns `glbUrl` + viewer link.
+- **`create-3d-avatar`** — text/image → **rigged** avatar via `forge_avatar`
+ (generate + auto-rig in one call, humanoid gate). Returns rigged `glbUrl` +
+ pose-studio link.
+- **`rig-a-model`** — existing GLB → animation-ready GLB via `rig_mesh` /
+ `POST /api/forge?action=rig` (VAST-AI UniRig). Returns `riggedGlbUrl` +
+ pose-studio link.
+
+All three run free against the hosted studio endpoint
+`https://three.ws/api/mcp-studio` (JSON-RPC `tools/call`), documented with runnable
+`curl` examples inside each skill.
+
+## Related
+
+- [STRUCTURE.md](../STRUCTURE.md) — where every surface lives
+- [docs/skills.md](skills.md) — the in-app avatar/agent skills system
+- [docs/mcp.md](mcp.md) — the three.ws MCP server the 3D skills call
diff --git a/docs/gcp-credits.md b/docs/gcp-credits.md
index 46bb5fa60..03f0e402c 100644
--- a/docs/gcp-credits.md
+++ b/docs/gcp-credits.md
@@ -5,12 +5,18 @@ project, the credit grant, what's enabled, service accounts, env vars, quota,
and how to smoke-test Claude on Vertex. Prompts 02–08 append to this file as
they build on the foundation.
-> **Status: foundation partially blocked on one owner action.** Every artifact
-> that does not require live GCP auth is done (smoke test, dev-session helper,
-> this runbook). The live steps — billing/credit confirmation, API enablement,
-> service-account creation, Vercel env, quota, and the actual smoke call —
-> are blocked because `gcloud` in this environment needs an interactive
-> re-login (see **Pending human actions**). They run in minutes once that's done.
+> **Status: foundation live; one owner console action remains for Claude.**
+> `gcloud` is authenticated (`[email protected]`) against `aerial-vehicle-466722-p5`,
+> all APIs are enabled, the `vercel-inference` SA is created with
+> `roles/aiplatform.user`, and — as of 2026-07-07 — the four GCP env vars
+> (`GCP_SERVICE_ACCOUNT_JSON`, `GOOGLE_CLOUD_PROJECT`, `GOOGLE_CLOUD_LOCATION`,
+> `GOOGLE_CLOUD_LOCATION_CLAUDE`) are set in Vercel across Production, Preview,
+> and Development. The smoke test proves the SA key works: **Gemini on Vertex
+> returns 200** with it. **Claude on Vertex returns 404** ("Publisher model …
+> not found or your project does not have access") — the sole remaining gate is
+> the owner accepting the Anthropic partner-model terms in Model Garden (see
+> **Enable Claude in Model Garden** and **Pending human actions**). Credit
+> balance/expiry and partner-model coverage are console-only reads still owed.
---
@@ -31,18 +37,21 @@ they build on the foundation.
---
-## Credits & partner-model coverage — GO/NO-GO (blocked)
+## Credits & partner-model coverage — GO/NO-GO (billing confirmed; balance console-only)
-**Not yet confirmed** — requires live auth. Run these the moment reauth lands:
+**Billing account confirmed live 2026-07-07** (see table below). The remaining
+unknowns — credit **balance, expiry, and partner-model coverage** — are not
+exposed by the `gcloud billing` CLI and must be read from the console. Commands
+used to confirm the account object:
```bash
# Billing account linked to the project
gcloud billing projects describe aerial-vehicle-466722-p5
+# → billingAccountName: billingAccounts/01B467-A61905-9A97D2, billingEnabled: true
# The billing account object (open/closed, master)
-ACCT=$(gcloud billing projects describe aerial-vehicle-466722-p5 \
- --format='value(billingAccountName)')
-gcloud billing accounts describe "$ACCT"
+gcloud billing accounts describe billingAccounts/01B467-A61905-9A97D2
+# → displayName: Sperax, open: true, USD, parent org 530103279143
```
Credit **balance and expiry** are not exposed by the `gcloud billing` CLI. Read
@@ -78,9 +87,9 @@ Record here once confirmed:
---
-## APIs to enable (blocked)
+## APIs to enable (✅ all enabled 2026-07-07)
-Idempotent — run once auth is restored:
+Idempotent — kept for DR/re-provision:
```bash
gcloud services enable \
@@ -121,9 +130,9 @@ Also enabled 2026-07-07: `billingbudgets.googleapis.com`, `pubsub.googleapis.com
| SA | Purpose | Roles | Status |
|---|---|---|---|
| `avatar-reconstruction-sa@aerial-vehicle-466722-p5.iam.gserviceaccount.com` | Cloud Run workers (mesh/rig pipeline), used by `workers/deploy/*.sh` + cloudbuild | run/build identity | ✅ Confirmed valid 2026-07-07 |
-| `vercel-inference@aerial-vehicle-466722-p5.iam.gserviceaccount.com` | Vercel functions → Vertex Claude + Imagen | `roles/aiplatform.user` | ✅ Created + role bound + key minted 2026-07-07 (key held locally, pending Vercel env push) |
+| `vercel-inference@aerial-vehicle-466722-p5.iam.gserviceaccount.com` | Vercel functions → Vertex Claude + Imagen | `roles/aiplatform.user` | ✅ Created + role bound; key minted and **pushed to Vercel (all 3 envs) 2026-07-07**. Key proven working (Gemini 200). Rotate with `gcloud iam service-accounts keys create` → re-push if the local key is ever exposed. |
-### Create the Vercel inference SA (blocked)
+### Create the Vercel inference SA (done — commands kept for rotation/DR)
Check-first, then create only if absent:
@@ -147,39 +156,44 @@ gcloud iam service-accounts keys create /tmp/vercel-inference-key.json \
--iam-account "$SA" --project "$PROJECT"
```
-### Push credentials to Vercel (blocked — needs Vercel auth too)
+### Push credentials to Vercel (✅ done 2026-07-07 — commands kept for rotation)
-`vercel` CLI is not installed in this container. Install + link, then set envs
-for **all** environments (production, preview, development):
+All four vars are set for **all** environments (production, preview, development)
+and verified with `vercel env ls`. To rotate the key or re-provision from scratch
+(`npx vercel` is used since the CLI is not globally installed):
```bash
-npm i -g vercel && vercel login && vercel link # one-time
+# Mint a fresh key to a path OUTSIDE the repo (scratchpad / /tmp, never commit it)
+gcloud iam service-accounts keys create /tmp/vercel-inference-key.json \
+ --iam-account vercel-inference@aerial-vehicle-466722-p5.iam.gserviceaccount.com
# Value = the raw key file contents. The api/ token parser tolerates the paste.
-vercel env add GCP_SERVICE_ACCOUNT_JSON production < /tmp/vercel-inference-key.json
-vercel env add GCP_SERVICE_ACCOUNT_JSON preview < /tmp/vercel-inference-key.json
-vercel env add GCP_SERVICE_ACCOUNT_JSON development < /tmp/vercel-inference-key.json
-
-printf 'aerial-vehicle-466722-p5' | vercel env add GOOGLE_CLOUD_PROJECT production
-printf 'us-central1' | vercel env add GOOGLE_CLOUD_LOCATION production
-printf 'global' | vercel env add GOOGLE_CLOUD_LOCATION_CLAUDE production
-# …repeat the three non-secret vars for preview + development.
+for E in production preview development; do
+ cat /tmp/vercel-inference-key.json | npx vercel env add GCP_SERVICE_ACCOUNT_JSON "$E"
+ printf 'aerial-vehicle-466722-p5' | npx vercel env add GOOGLE_CLOUD_PROJECT "$E"
+ printf 'us-central1' | npx vercel env add GOOGLE_CLOUD_LOCATION "$E"
+ printf 'global' | npx vercel env add GOOGLE_CLOUD_LOCATION_CLAUDE "$E"
+done
# Then delete the local key file
shred -u /tmp/vercel-inference-key.json 2>/dev/null || rm -f /tmp/vercel-inference-key.json
# Verify
-vercel env ls
+npx vercel env ls | grep -iE 'GCP_SERVICE_ACCOUNT_JSON|GOOGLE_CLOUD'
```
+> **Fixes a live production gap:** before this push, `api/_mcp3d/vertex-imagen.js`
+> had no `GCP_SERVICE_ACCOUNT_JSON` in the deployed environment, so the Vertex
+> image lane could only run locally. It now has real credentials in production.
+
### Env vars (names only — never values here)
| Name | Value shape | Scope |
|---|---|---|
-| `GCP_SERVICE_ACCOUNT_JSON` | Vercel inference SA key JSON | all envs |
-| `GOOGLE_CLOUD_PROJECT` | `aerial-vehicle-466722-p5` | all envs |
-| `GOOGLE_CLOUD_LOCATION` | `us-central1` | all envs |
-| `GOOGLE_CLOUD_LOCATION_CLAUDE` | `global` | all envs |
+| `GCP_SERVICE_ACCOUNT_JSON` | Vercel inference SA key JSON | all envs ✅ set 2026-07-07 |
+| `GOOGLE_CLOUD_PROJECT` | `aerial-vehicle-466722-p5` | all envs ✅ set 2026-07-07 |
+| `GOOGLE_CLOUD_LOCATION` | `us-central1` | all envs ✅ set 2026-07-07 |
+| `GOOGLE_CLOUD_LOCATION_CLAUDE` | `global` | all envs ✅ set 2026-07-07 |
---
@@ -206,9 +220,12 @@ Accept the Anthropic terms once; enablement applies project-wide.
---
-## Quota (blocked)
+## Quota (open — file after Model Garden enablement)
-Check current Vertex quotas and file increases sized for production chat:
+Partner-model quota can only be inspected/filed once Anthropic is enabled in
+Model Garden (the models don't exist for the project until then — see the 404
+above). Run this the moment enablement lands, then file increases sized for
+production chat:
```bash
# Inspect current online-prediction / partner-model quotas
@@ -259,6 +276,15 @@ node scripts/gcp/vertex-smoke.mjs
Optional overrides: `GOOGLE_CLOUD_LOCATION_CLAUDE` (default `global`),
`VERTEX_SMOKE_MODEL` (default `claude-haiku-4-5@20251001`), `VERTEX_SMOKE_PROMPT`.
+**Last run — 2026-07-07:** `404 NOT_FOUND` — *"Publisher model
+`…/publishers/anthropic/models/claude-haiku-4-5@20251001` was not found or your
+project does not have access to it."* The **same SA key returns HTTP 200 against
+Gemini** (`publishers/google/models/gemini-2.5-flash:generateContent`), proving
+auth, billing, and `roles/aiplatform.user` are all good. The 404 is therefore
+purely the Anthropic Model Garden enablement gate — re-run this script the
+instant the owner accepts the terms; no code change is needed and a PASS is
+expected within seconds.
+
---
## Claude Code dev sessions → GCP credits
@@ -481,34 +507,40 @@ instant rollback stays available via `VERTEX_IMAGEN_ENABLED=0`.
## Pending human actions (do these, in order)
-1. ~~**Restore gcloud auth**~~ — ✅ done 2026-07-07 (`gcloud auth login`,
- project `aerial-vehicle-466722-p5`). **Still pending:** `gcloud auth
- application-default login` (ADC) — needed only for Claude Code dev sessions
- on Vertex and any script that insists on ADC; everything below used the
- user token / SA key instead.
-2. **Confirm credits + partner-model coverage** — console Credits page; answer
- the coverage question (see that section). This is the GO/NO-GO for prompt 02.
-3. **Enable Claude in Model Garden** — console, accept Anthropic terms, enable
- the five model IDs listed above. **Confirmed still missing 2026-07-07:** the
- smoke test returns `IAM_PERMISSION_DENIED` on
- `publishers/anthropic/models/*` while the same SA serves Gemini images fine —
- the terms acceptance is the only remaining gate.
-4. ~~**Run the live setup block**~~ — ✅ done 2026-07-07: APIs enabled (table
- above), `vercel-inference` SA created + `roles/aiplatform.user` bound, key
- minted (held locally outside the repo, pending Vercel push). Quota filing
- still open (partner-model QPM/TPM — console).
-5. **Install + auth the Vercel CLI** (`npm i -g vercel && vercel login`) so
- `GCP_SERVICE_ACCOUNT_JSON` + the three location vars can be pushed and
- verified with `vercel env ls`.
-6. **Run the smoke test** — `node scripts/gcp/vertex-smoke.mjs`. Attempted
- 2026-07-07: 403 (Model Garden — step 3). The Gemini image-lane E2E **passed**
- the same day with the same SA, proving auth, API enablement, and the client
- code end-to-end. Re-run after step 3; a green PASS closes prompt 01.
-7. **Enable the BigQuery billing export** (prompt 07) — console-only:
- Billing → Billing export → BigQuery. Confirmed 2026-07-07 that no dataset
- exists yet (`bq ls` empty; `burn-report.mjs` → "export not configured").
-
-Update the _pending_ cells in this file as each step completes.
+**✅ Done 2026-07-07 (no owner action needed — recorded for history):**
+
+- ~~Restore gcloud auth~~ — authenticated `[email protected]` on
+ `aerial-vehicle-466722-p5`.
+- ~~Enable all APIs~~ — 8 required + `billingbudgets` + `pubsub` (tables above).
+- ~~Create `vercel-inference` SA + bind `roles/aiplatform.user`~~.
+- ~~Push GCP env vars to Vercel~~ — `GCP_SERVICE_ACCOUNT_JSON`,
+ `GOOGLE_CLOUD_PROJECT`, `GOOGLE_CLOUD_LOCATION`, `GOOGLE_CLOUD_LOCATION_CLAUDE`
+ set across Production/Preview/Development; verified with `npx vercel env ls`.
+- ~~Prove the SA key works~~ — Gemini on Vertex returns 200 with it.
+
+**⏳ Still owed — owner console actions, in order:**
+
+1. **Enable Claude in Model Garden** — the ONE gate for all Vertex Claude
+ traffic (prompt 02). Console → accept Anthropic partner-model terms → enable
+ `claude-haiku-4-5`, `claude-sonnet-4-6`, `claude-opus-4-8`, `claude-sonnet-5`,
+ and `claude-fable-5` (if listed). **Confirmed still missing 2026-07-07:** the
+ smoke test returns `404 NOT_FOUND` on `publishers/anthropic/models/*` while
+ the same SA serves Gemini fine — terms acceptance is the only blocker. The
+ moment it lands, run `node scripts/gcp/vertex-smoke.mjs` for a green PASS
+ (closes prompt 01's smoke criterion) and then file partner-model quota.
+2. **Confirm credits + partner-model coverage** — console Credits page; read the
+ balance + expiry and confirm the grant covers Vertex AI *partner* (Anthropic)
+ models. GO/NO-GO for prompt 02's chain inversion. `gcloud billing` cannot
+ expose balance/expiry — this is console-only.
+3. **`gcloud auth application-default login` (ADC)** — only needed for Claude
+ Code dev sessions on Vertex (`scripts/gcp/claude-code-vertex.sh`) and any
+ ADC-only script. Production `api/` uses the SA key, not ADC, so this does not
+ block anything shipped.
+4. **Enable the BigQuery billing export** (prompt 07) — console-only:
+ Billing → Billing export → BigQuery. Confirmed 2026-07-07 no dataset exists
+ (`bq ls` empty; `burn-report.mjs` → "export not configured").
+
+Update the cells in this file as each step completes.
---
@@ -931,7 +963,7 @@ feeds `mcp3dGenerateFree` + `mcp3dGenerateFreeTiered`):
and the global paid envelope `FORGE_PAID_GLOBAL_HOURLY`.
- **Revert:** unset `FORGE_SELFHOST_PRIMARY` → back to 60/h.
-### Deploy runbook (run once gcloud reauth lands — step 1 above)
+### Deploy runbook (gcloud auth is live as of 2026-07-07 — ready to run)
```bash
# 0. Generate + set the shared worker bearer key (Cloud Run reads it from the
diff --git a/packages/activity-mcp/server.json b/packages/activity-mcp/server.json
index edafcce99..7059aa4eb 100644
--- a/packages/activity-mcp/server.json
+++ b/packages/activity-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/activity-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/activity-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/agenc-mcp/server.json b/packages/agenc-mcp/server.json
index 817fc315a..41ced7704 100644
--- a/packages/agenc-mcp/server.json
+++ b/packages/agenc-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/agenc-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/agenc-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/agentcore-payments-mcp/server.json b/packages/agentcore-payments-mcp/server.json
index 4962c520e..4cd7b4ec0 100644
--- a/packages/agentcore-payments-mcp/server.json
+++ b/packages/agentcore-payments-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/agentcore-payments-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/agentcore-payments-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/agora-mcp/server.json b/packages/agora-mcp/server.json
index b2d334c24..68c2ceeeb 100644
--- a/packages/agora-mcp/server.json
+++ b/packages/agora-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/agora-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/agora-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/alerts-mcp/server.json b/packages/alerts-mcp/server.json
index 159867edf..59ab37c70 100644
--- a/packages/alerts-mcp/server.json
+++ b/packages/alerts-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/alerts-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/alerts-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/alibaba-cloud-mcp/server.json b/packages/alibaba-cloud-mcp/server.json
index 80745765a..1501e6c78 100644
--- a/packages/alibaba-cloud-mcp/server.json
+++ b/packages/alibaba-cloud-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/alibaba-cloud-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/alibaba-cloud-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/audio-mcp/server.json b/packages/audio-mcp/server.json
index c77af2f93..1c3606c61 100644
--- a/packages/audio-mcp/server.json
+++ b/packages/audio-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/audio-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/audio-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/billing-mcp/server.json b/packages/billing-mcp/server.json
index 4e2ce4dc7..6bdd150cd 100644
--- a/packages/billing-mcp/server.json
+++ b/packages/billing-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/billing-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/billing-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/brain-mcp/server.json b/packages/brain-mcp/server.json
index 550f54dc8..0e6f5d6ea 100644
--- a/packages/brain-mcp/server.json
+++ b/packages/brain-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/brain-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/brain-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/clash-mcp/server.json b/packages/clash-mcp/server.json
index a153c20ce..7a15c9e89 100644
--- a/packages/clash-mcp/server.json
+++ b/packages/clash-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/clash-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/clash-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/copy-mcp/server.json b/packages/copy-mcp/server.json
index 0797c5892..218198829 100644
--- a/packages/copy-mcp/server.json
+++ b/packages/copy-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/copy-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/copy-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/intel-mcp/server.json b/packages/intel-mcp/server.json
index 57ffd5bc0..2badd0c2f 100644
--- a/packages/intel-mcp/server.json
+++ b/packages/intel-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/intel-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/intel-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/loom-mcp/server.json b/packages/loom-mcp/server.json
index 46221f4cd..eda401d35 100644
--- a/packages/loom-mcp/server.json
+++ b/packages/loom-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/loom-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/loom-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/marketplace-mcp/server.json b/packages/marketplace-mcp/server.json
index 64f6a24da..f65798274 100644
--- a/packages/marketplace-mcp/server.json
+++ b/packages/marketplace-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/marketplace-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/marketplace-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/naming-mcp/server.json b/packages/naming-mcp/server.json
index 7989fc0d6..d34f635c0 100644
--- a/packages/naming-mcp/server.json
+++ b/packages/naming-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/naming-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/naming-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/notifications-mcp/server.json b/packages/notifications-mcp/server.json
index de33e8fc6..318df10b6 100644
--- a/packages/notifications-mcp/server.json
+++ b/packages/notifications-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/notifications-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/notifications-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/provenance-mcp/server.json b/packages/provenance-mcp/server.json
index 908370489..cc4959add 100644
--- a/packages/provenance-mcp/server.json
+++ b/packages/provenance-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/provenance-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/provenance-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/scene-mcp/server.json b/packages/scene-mcp/server.json
index fd15ad961..ec0275860 100644
--- a/packages/scene-mcp/server.json
+++ b/packages/scene-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/scene-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/scene-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/signals-mcp/server.json b/packages/signals-mcp/server.json
index 8a2644d94..d1ddc0289 100644
--- a/packages/signals-mcp/server.json
+++ b/packages/signals-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/signals-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/signals-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/vanity-mcp/server.json b/packages/vanity-mcp/server.json
index 11361b3c5..a48fc082e 100644
--- a/packages/vanity-mcp/server.json
+++ b/packages/vanity-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/vanity-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/vanity-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/vision-mcp/server.json b/packages/vision-mcp/server.json
index 0fa04502a..af0516072 100644
--- a/packages/vision-mcp/server.json
+++ b/packages/vision-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/vision-mcp"
},
- "version": "0.1.0",
+ "version": "0.1.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/vision-mcp",
- "version": "0.1.0",
+ "version": "0.1.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/packages/x402-mcp/server.json b/packages/x402-mcp/server.json
index 35968c99c..caee049f8 100644
--- a/packages/x402-mcp/server.json
+++ b/packages/x402-mcp/server.json
@@ -18,12 +18,12 @@
"source": "github",
"subfolder": "packages/x402-mcp"
},
- "version": "0.2.0",
+ "version": "0.2.1",
"packages": [
{
"registryType": "npm",
"identifier": "@three-ws/x402-mcp",
- "version": "0.2.0",
+ "version": "0.2.1",
"runtimeHint": "npx",
"transport": {
"type": "stdio"
diff --git a/prompts/bnb-chain/00-CONTEXT.md b/prompts/bnb-chain/00-CONTEXT.md
new file mode 100644
index 000000000..63100ab78
--- /dev/null
+++ b/prompts/bnb-chain/00-CONTEXT.md
@@ -0,0 +1,149 @@
+# BNB Chain Campaign — Shared Context (READ FIRST; every prompt in this folder requires it)
+
+You are building three.ws's BNB Chain expansion: three product tracks that exploit
+capabilities verified live on BNB Chain on 2026-07-07 that Ethereum L1, Base, and (mostly)
+Solana cannot match. This file is static reference — reading it is NOT a dependency on
+another agent's work. Read `/workspaces/three.ws/CLAUDE.md` after this file.
+
+---
+
+## Owner approval (commit gate — resolved for this campaign)
+
+CLAUDE.md gates commits referencing crypto projects other than `$THREE`. **The owner
+approved this campaign on 2026-07-07** ("yeah lets do those all"). Within this campaign's
+scope — BNB Chain / BSC / opBNB / Greenfield / MegaFuel / MPP infrastructure code, docs,
+tests, prompts — committing BNB Chain references is **pre-approved**. Do not stop to re-ask.
+Boundaries that still hold:
+- `$THREE` (CA `FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) remains the ONLY promoted
+ coin. BNB Chain is infrastructure we build ON; never promote BNB or any other token.
+ No "buy BNB" copy, ever.
+- No real third-party token mints in tests/fixtures — use `$THREE` or synthetic placeholders.
+- Anything referencing a crypto project OUTSIDE this campaign's scope still needs the gate.
+
+## Verified facts (3-vote adversarially verified 2026-07-07 — build on these)
+
+1. **Gasless plain-EOA transactions.** BEP-414 paymaster API (`pm_isSponsorable` +
+ `eth_sendRawTransaction`) + BEP-322 atomic builder bundles: a user signs a normal tx
+ with `gasPrice = 0`; a sponsor tx pairs with it atomically. Works with unmodified
+ private-key EOAs — mechanically impossible on Ethereum L1/Base (EIP-1559 rejects
+ zero-fee; 4337 needs smart accounts, 7702 needs delegation). Production implementation:
+ **MegaFuel** (NodeReal) on BSC + opBNB — docs.nodereal.io/docs/megafuel, open SDKs
+ `node-real/megafuel-js-sdk` / `megafuel-go-sdk`. Caveats: operated by one company
+ (NodeReal), sponsor policies are whitelisted, BEP-414 status is Draft. **Always ship a
+ self-pay fallback** (the official SDK pattern: MegaFuel decides per-tx; outage → self-pay).
+2. **Greenfield storage programmable from BSC contracts.** Live BSC-mainnet (56) hubs,
+ bytecode-verified 2026-07-07:
+ - CrossChain `0x77e719b714be09F70D484AB81F70D02B0E182f7d`
+ - TokenHub `0xeA97dF87E6c7F68C9f95A69dA79E19B834823F25`
+ - BucketHub `0xE909754263572F71bc6aFAc837646A93f5818573`
+ - ObjectHub `0x634eB9c438b8378bbdd8D0e10970Ec88db0b4d0f`
+ - GroupHub `0xDd9af4573D64324125fCa5Ce13407be79331B7F7`
+ - MultiMessage `0x26204702935e2D617EE75B795152B9623a7d9809` (atomic batch of storage ops)
+ A BSC contract can create/delete buckets & groups, delete objects, and grant/revoke
+ per-object permissions (PermissionHub `createPolicy`/`deletePolicy`) cross-chain.
+ Hard limits (design around them, don't fight them): object CREATION from BSC is
+ "pending"/unshipped; file bytes always upload via off-chain Storage Providers; cross-chain
+ ops settle ASYNCHRONOUSLY on Greenfield after relay (poll for effect, never assume
+ same-block). Testnet hub addresses: read from `bnb-chain/greenfield-contracts` README —
+ never invent addresses. Ecosystem caveat: contracts repo last released May 2024 and
+ Greenfield is absent from the 2026 roadmap — live but deprioritized. Keep vault
+ architecture portable (encrypt-at-rest + permission-gated key release) so storage backend
+ could be swapped.
+3. **0.45s blocks, ~1.125s finality, live.** Fermi hardfork (BEP-619/590) activated
+ 2026-01-14; measured live at ~0.45–0.47s via public RPC on 2026-07-07. Fastest EVM L1
+ (Base 2s, Ethereum 12s; Solana slots ~400ms). BEP-670 targets 250ms (NOT live — don't
+ claim it).
+
+**Refuted / unverified — NEVER claim these in docs, UI copy, or marketing:** "20,000 TPS"
+and the chain-level "AI agent framework" are roadmap promises, not shipped. Greenfield
+mirror-NFTs are control handles, NOT freely composable ERC-721s. BABT sybil-gating is
+unverified (prompt 20 settles it). No unique precompiles / native LST hooks substantiated.
+Honest-docs rule: any "only on BNB Chain" claim you write must trace to the verified list.
+
+## Networks & endpoints
+
+| Thing | Value |
+|---|---|
+| BSC mainnet | chainId 56, RPC `https://bsc-dataseed.bnbchain.org` (reads OK on mainnet) |
+| BSC testnet | chainId 97, RPC `https://data-seed-prebsc-1-s1.bnbchain.org:8545` — **all deploys + writes default here** |
+| opBNB | out of scope this campaign (note gaps in PROGRESS if relevant) |
+| Greenfield mainnet / testnet | chain `greenfield_1017-1` / `greenfield_5600-1`; SP + RPC endpoints per `@bnb-chain/greenfield-js-sdk` docs |
+| MegaFuel | mainnet `https://bsc-megafuel.nodereal.io`, testnet `https://bsc-megafuel-testnet.nodereal.io` (confirm exact paths in docs.nodereal.io/docs/megafuel) |
+| tBNB faucet | `https://www.bnbchain.org/en/testnet-faucet` (alternatives: QuickNode/Chainlink faucets) |
+
+## The codebase map (so you never have to hunt)
+
+- **EVM libs already installed:** `viem ^2.52`, `ethers ^6.16` (package.json). Prefer viem
+ for new code. Open-source-first: use `@bnb-chain/greenfield-js-sdk`, `@bnb-chain/mpp`,
+ `megafuel-js-sdk` where they fit — don't hand-roll what they cover.
+- **New BNB server libs live in `api/_lib/bnb/`** (new namespace, one file per concern).
+- **Contracts:** Foundry workspace at `contracts/` (`foundry.toml`, `lib/forge-std`,
+ `lib/openzeppelin-contracts`, deploy scripts in `contracts/script/*.s.sol`). Follow
+ `contracts/README.md` deploy conventions; record every deploy in `contracts/DEPLOYMENTS.md`
+ (bytecode-verified style, see that file's Provenance section).
+- **ERC-8004 is ALREADY live on BSC(56)** at our CREATE2 registry addresses — see
+ `contracts/DEPLOYMENTS.md` + `api/_lib/erc8004-chains.js` + `src/erc8004/abi.js`. Don't
+ redeploy; extend.
+- **x402 stack:** paid endpoints `api/x402/<slug>.js` via `api/_lib/x402-paid-endpoint.js`;
+ BSC payTo already supported (`env.X402_PAY_TO_BSC`, `networks: ['bsc']`); discovery doc
+ mirrored in `api/wk.js`, validated by `node scripts/verify-x402-discovery.mjs`.
+- **Free endpoints:** plain-handler pattern (`cors`/`wrap`/`error` from `api/_lib/http.js`,
+ rate-limit via `api/_lib/rate-limit.js`). Model on `api/solana-rpc.js`.
+- **3D viewer + explore/platformer:** `src/` Vite app; platformer mode shipped 2026-07-07
+ (see `git log --oneline -5`). Multiplayer rooms: `multiplayer/` (Colyseus), Agora
+ player-mode `src/agora/player-mode.js`.
+- **Docs:** `docs/` per-capability files; `specs/` for wire formats; `data/pages.json` for
+ routes; `STRUCTURE.md` for surfaces; `data/changelog.json` for holder-visible changes.
+
+## Prompt independence & prerequisites
+
+Prompts are scoped small on purpose. Track-internal ordering exists (README table). Rule:
+**each prompt starts by checking its "Prereq artifacts" list.** If an artifact is missing,
+OPEN THE NAMED PREREQ PROMPT IN THIS FOLDER AND EXECUTE IT FIRST, then continue yours.
+Never stub around a missing prereq; never report done with a prereq unmet. Prompts with no
+prereqs say "Prereqs: none".
+
+## You are NEVER blocked — decision defaults
+
+| Situation | Do this — do NOT ask |
+|---|---|
+| Need a funded testnet key | Env `BNB_TESTNET_DEPLOYER_KEY` (add to `.env.example` with comment, never commit a real key). If absent, generate a throwaway key, fund via faucet, and print the address + faucet URL in your report. If every faucet fails: finish ALL code + tests against a local `anvil --chain-id 97` fork, and record the single funding blocker in PROGRESS. |
+| MegaFuel sponsor policy needs a NodeReal account we don't have | Code against the public API spec; probe `pm_isSponsorable` on the public testnet endpoint; ship the self-pay fallback as the default path; record the exact signup/policy-creation step needed in PROGRESS. The feature must work end-to-end in self-pay mode regardless. |
+| Greenfield cross-chain op hasn't settled | It's async by design. Poll (bounded, with backoff) for the mirrored effect; surface `pending` state honestly in API/UI. |
+| A BNB SDK is broken/unmaintained for our use | Wrap the minimal REST/RPC calls yourself in `api/_lib/bnb/`, document why in the commit message. Never mock. |
+| Mainnet money needed to prove something | Don't spend mainnet funds. Prove on testnet + assert mainnet-readiness via config/bytecode checks. Note the mainnet flip steps in PROGRESS. |
+| Unsure of a price for a paid surface | Default $0.10 (`"100000"` atomic USDC) via `priceFor`, env-overridable. Move on. |
+| Shared-file conflict with a concurrent agent | Stage YOUR explicit paths only, re-check `git status` before commit, re-apply only your hunk. |
+| Something adjacent is broken/mediocre | Fix it if <30 min and in your blast radius; otherwise note it in PROGRESS. Don't half-do two prompts. |
+
+If a genuine blocker remains (rare): implement everything else 100%, then state the ONE
+blocker with exactly what's needed.
+
+## Definition-of-done template (every prompt inherits)
+
+- [ ] Built, wired, reachable; zero mocks/stubs/TODOs/commented-out code (CLAUDE.md).
+- [ ] Every state handled: success, empty, error, bad input, rate-limited, upstream-down,
+ and (BNB-specific) `pending` for async cross-chain effects.
+- [ ] Real proof captured: live testnet tx hashes / real JSON responses / real block numbers
+ pasted into your PROGRESS entry. "Returns 200" is not done.
+- [ ] `npm test` green; new tests follow `tests/` conventions. Contracts: `forge test` green.
+- [ ] Docs per CLAUDE.md (docs/ file or section, pages.json for routes, STRUCTURE.md for
+ surfaces, specs/ for wire formats) — written for a zero-context reader, every claim
+ consistent with the Verified facts above.
+- [ ] `data/changelog.json` entry for anything user-visible (holder-readable, no jargon).
+- [ ] `git diff` self-reviewed; commit EXPLICIT paths (never `-A`); push BOTH remotes
+ (`git push threeD main` may fail "Repository not found" — report, don't block;
+ `git push threews main` must succeed).
+- [ ] `npx vercel build` trap: if run, check `head -1` of changed `api/*.js` for `__defProp`;
+ recover with `git restore -- api/ public/`.
+- [ ] Append a dated entry to `prompts/bnb-chain/PROGRESS.md`: what shipped, proof, gaps.
+
+## Dev commands
+
+```
+npm run dev # Vite, port 3000
+npm test # JS test suite
+cd contracts && forge build && forge test -vv
+node scripts/verify-x402-discovery.mjs # if you touched paid-route discovery
+npm run build:pages # regenerate + validate changelog/pages
+```
diff --git a/prompts/bnb-chain/PROGRESS.md b/prompts/bnb-chain/PROGRESS.md
new file mode 100644
index 000000000..8b64652f0
--- /dev/null
+++ b/prompts/bnb-chain/PROGRESS.md
@@ -0,0 +1,12 @@
+# BNB Chain Campaign — Progress Log
+
+Append-only. Each completing agent adds a dated entry: prompt #, what shipped, real proof
+(tx hashes, block numbers, JSON responses), gaps noticed for other prompts.
+
+---
+
+## 2026-07-07 — Campaign created
+
+Research basis: 101-agent deep-research run + bnb-chain org repo dig (verified facts and
+refuted claims recorded in `00-CONTEXT.md`). Owner approved all three tracks. No prompt
+executed yet.
diff --git a/prompts/bnb-chain/README.md b/prompts/bnb-chain/README.md
new file mode 100644
index 000000000..438071389
--- /dev/null
+++ b/prompts/bnb-chain/README.md
@@ -0,0 +1,52 @@
+# BNB Chain Campaign — Prompt Index
+
+Owner-approved 2026-07-07. Three product tracks exploiting capabilities verified live on
+BNB Chain that Ethereum L1 / Base / Solana can't match (see `00-CONTEXT.md` for the
+verified-facts list, addresses, decision defaults, and the commit-gate pre-approval).
+
+Every prompt is an independent work order sized for one agent to complete 100% — code,
+wiring, tests, docs, changelog, proof. Track-internal ordering below; a prompt whose
+prereq artifact is missing executes the named prereq prompt first (00-CONTEXT "Prompt
+independence").
+
+## Track A — Payments & gasless rails (MegaFuel + MPP)
+
+| # | Prompt | Prereqs | Ships |
+|---|---|---|---|
+| 01 | `01-bnb-chains-lib.md` | none | `api/_lib/bnb/chains.js` — chain constants, RPC failover, block-time probe |
+| 02 | `02-megafuel-client.md` | 01 | `api/_lib/bnb/megafuel.js` — sponsored gasless EOA sends + self-pay fallback |
+| 03 | `03-gasless-agent-registration.md` | 02 | Gas-free ERC-8004 agent registration on BSC testnet |
+| 04 | `04-mpp-server-adapter.md` | 01 | Accept MPP (BNB's 402 protocol) on a pilot paid endpoint |
+| 05 | `05-mpp-buyer-client.md` | 01 | Buyer client: our agents PAY MPP-protected endpoints |
+| 06 | `06-payments-bridge-docs.md` | 04, 05 | `docs/bnb-payments.md` + `specs/x402-mpp-bridge.md` |
+
+## Track B — Greenfield pay-to-unlock 3D vault
+
+| # | Prompt | Prereqs | Ships |
+|---|---|---|---|
+| 07 | `07-greenfield-read-client.md` | 01 | `api/_lib/bnb/greenfield.js` — SP/chain reads |
+| 08 | `08-vault-crypto-format.md` | none | Encrypted-GLB envelope + `specs/vault-manifest.md` |
+| 09 | `09-vault-upload-pipeline.md` | 07, 08 | Bucket + encrypted upload to Greenfield testnet |
+| 10 | `10-vault-contract.md` | 01 | `GreenfieldVault.sol` — pay → PermissionHub grant, testnet deploy |
+| 11 | `11-vault-unlock-api.md` | 09, 10 | `/api/vault/*` — list, status, unlock |
+| 12 | `12-vault-ui.md` | 11 | `/vault` page — browse, buy, unlock, view in 3D |
+| 13 | `13-vault-e2e-proof.md` | 12 | Full testnet E2E run + captured proof + docs final |
+
+## Track C — Real-time on-chain 3D world (0.45s blocks + gasless moves)
+
+| # | Prompt | Prereqs | Ships |
+|---|---|---|---|
+| 14 | `14-world-moves-contract.md` | 01 | `WorldMoves.sol` — move commits/events, testnet deploy |
+| 15 | `15-gasless-move-sender.md` | 02, 14 | Browser/server sender: sponsored move txs |
+| 16 | `16-onchain-presence-mode.md` | 15 | Opt-in on-chain mode in explore/platformer |
+| 17 | `17-latency-proof-page.md` | none | `/bnb-latency` — live block-race proof page |
+| 18 | `18-world-e2e-demo.md` | 16 | E2E demo on testnet + docs + changelog |
+
+## Cross-track
+
+| # | Prompt | Prereqs | Ships |
+|---|---|---|---|
+| 19 | `19-bnb-hub-page.md` | none | `/bnb` hub page + STRUCTURE.md + pages.json |
+| 20 | `20-babt-verification-spike.md` | none | Settle the BABT open question; ship checker if real |
+
+Progress log: `PROGRESS.md` (append-only, dated entries with proof).
diff --git a/prompts/store-submissions/_generated/openai-actions.yaml b/prompts/store-submissions/_generated/openai-actions.yaml
new file mode 100644
index 000000000..b058f4eb5
--- /dev/null
+++ b/prompts/store-submissions/_generated/openai-actions.yaml
@@ -0,0 +1,204 @@
+openapi: 3.1.0
+info:
+ title: three.ws 3D Studio
+ version: 1.0.0
+ description: |
+ Free text-to-3D generation for the "three.ws 3D Studio" custom GPT.
+ Turn a short text prompt into a real, textured, downloadable 3D model (GLB)
+ plus a browser viewer link. No account, no API key, no payment.
+
+ Data handling: the prompt is forwarded to the generation provider solely to
+ produce the model; the finished GLB is stored on a public CDN URL so the
+ user can download and share it. No personal information is collected or
+ returned by these operations. Requests are rate-limited per IP for abuse
+ prevention. Full policy: https://three.ws/legal/privacy.html
+
+ Contract: POST /api/3d/studio either finishes inline (status "done" with
+ glbUrl + viewerUrl) or returns status "pending" with a "job" handle. Poll
+ GET /api/3d/studio?job=... every few seconds until status is "done" or
+ "error". Generation typically takes 20-60 seconds.
+ contact:
+ name: three.ws
+ url: https://three.ws
+servers:
+ - url: https://three.ws
+paths:
+ /api/3d/studio:
+ post:
+ operationId: generate3DModel
+ x-openai-isConsequential: false
+ summary: Generate a 3D model (GLB) from a text prompt
+ description: |
+ Start a free text-to-3D generation. Describe ONE subject concretely
+ (shape, colors, style), e.g. "a low-poly orange fox sitting down".
+ If the response status is "done", present glbUrl (download) and
+ viewerUrl (interactive browser preview) to the user. If it is
+ "pending", poll checkModelJob with the returned "job" value every few
+ seconds until it completes. Prompts describing adult, gory, hateful,
+ or real-weapon content are refused with error "prompt_rejected".
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required: [prompt]
+ additionalProperties: false
+ properties:
+ prompt:
+ type: string
+ minLength: 3
+ maxLength: 1000
+ description: >-
+ A concrete description of one subject to model, e.g.
+ "a small ceramic robot figurine with round eyes".
+ examples:
+ fox:
+ summary: Low-poly animal
+ value:
+ prompt: a low-poly orange fox sitting down
+ responses:
+ "200":
+ description: Generation finished inline, or queued with a poll handle.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GenerationState"
+ examples:
+ done:
+ summary: Finished inline
+ value:
+ 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-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2F04818491-d43e-4576-b245-22743bf125a6.glb
+ format: glb
+ pending:
+ summary: Queued - poll with the job handle
+ value:
+ status: pending
+ job: f1.eyJwIjoibnZpZGlhIn0.c2ln
+ poll: /api/3d/studio?job=f1.eyJwIjoibnZpZGlhIn0.c2ln
+ format: glb
+ "400":
+ description: >-
+ Invalid prompt (too short/long) or refused by the content-safety
+ gate (error "prompt_rejected"). Relay the message to the user.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ErrorResponse"
+ "429":
+ description: Free generation limit reached - ask the user to try again later.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ErrorResponse"
+ "502":
+ description: The generator could not start the job - safe to retry once.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ErrorResponse"
+ "503":
+ description: Generation temporarily unavailable - try again later.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ErrorResponse"
+ get:
+ operationId: checkModelJob
+ x-openai-isConsequential: false
+ summary: Check a pending 3D generation job
+ description: |
+ Poll a generation started by generate3DModel. Pass the "job" value from
+ the pending response. Keep polling every few seconds while status is
+ "pending"; stop on "done" (present glbUrl + viewerUrl) or "error"
+ (tell the user it failed and offer to try again - generation is free).
+ parameters:
+ - name: job
+ in: query
+ required: true
+ schema:
+ type: string
+ minLength: 8
+ maxLength: 1024
+ pattern: "^[A-Za-z0-9._-]+$"
+ description: The job handle returned by generate3DModel.
+ responses:
+ "200":
+ description: Current job state.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/GenerationState"
+ examples:
+ done:
+ summary: Model ready
+ value:
+ status: done
+ job: f1.eyJwIjoibnZpZGlhIn0.c2ln
+ glbUrl: https://pub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev/forge/anon/done.glb
+ viewerUrl: https://three.ws/viewer?src=https%3A%2F%2Fpub-2534e921bf9c4314addcd4d8a6e98b7b.r2.dev%2Fforge%2Fanon%2Fdone.glb
+ format: glb
+ failed:
+ summary: Upstream failure - retrying is free
+ value:
+ status: error
+ job: f1.eyJwIjoibnZpZGlhIn0.c2ln
+ error: 3D generation hit a snag upstream - it costs nothing to try again.
+ "400":
+ description: Missing or malformed job handle.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ErrorResponse"
+ "429":
+ description: Polling too fast - wait for retry_after seconds.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ErrorResponse"
+components:
+ schemas:
+ GenerationState:
+ type: object
+ required: [status]
+ properties:
+ status:
+ type: string
+ enum: [done, pending, error]
+ description: done = model ready; pending = keep polling; error = generation failed.
+ glbUrl:
+ type: string
+ format: uri
+ description: Public download URL of the generated GLB model (present when done).
+ viewerUrl:
+ type: string
+ format: uri
+ description: Interactive three.ws browser viewer for the model (present when done).
+ format:
+ type: string
+ const: glb
+ description: Output format - always GLB (binary glTF).
+ job:
+ type: string
+ description: Job handle to pass to checkModelJob (present when pending).
+ poll:
+ type: string
+ description: Relative poll path for the pending job.
+ error:
+ type: string
+ description: Human-readable failure message (present when status is error).
+ ErrorResponse:
+ type: object
+ required: [error, message]
+ properties:
+ error:
+ type: string
+ description: Machine-readable error code (e.g. invalid_prompt, prompt_rejected, rate_limited).
+ message:
+ type: string
+ description: Human-readable explanation to relay to the user.
+ retry_after:
+ type: integer
+ description: Seconds to wait before retrying (rate-limit responses).
diff --git a/scripts/build-skills-pack.mjs b/scripts/build-skills-pack.mjs
new file mode 100644
index 000000000..927b8abbb
--- /dev/null
+++ b/scripts/build-skills-pack.mjs
@@ -0,0 +1,240 @@
+#!/usr/bin/env node
+// Regenerates the three.ws Agent Skills pack manifest from the skill files
+// themselves, so the registry-facing index can never drift from what ships:
+//
+// .agents/skills/skills-pack.json — machine-readable pack manifest
+// .agents/skills/SKILLS.md — human-readable index (same data)
+//
+// Usage: node scripts/build-skills-pack.mjs [--check]
+// --check exit 1 if the generated output differs from what is on disk
+// (use before committing skill changes)
+//
+// Native three.ws skills carry their category in SKILL.md frontmatter
+// (metadata.category / metadata.cross-platform-safe / metadata.pack).
+// Vendored partner skills (okx-*, metamask-*) are left byte-identical to the
+// vendor drop; their categories live only in VENDORED_CATEGORIES below.
+
+import fs from 'node:fs';
+import path from 'node:path';
+import process from 'node:process';
+
+const ROOT = path.resolve(path.dirname(new URL(import.meta.url).pathname), '..');
+const SKILLS_DIR = path.join(ROOT, '.agents', 'skills');
+
+const PACK = {
+ name: 'three-ws-skills',
+ version: '1.0.0',
+ description:
+ 'The three.ws Agent Skills pack — wallet/x402-economy, 3D-creation, and partner (OKX, MetaMask) skills for any Claude surface: Claude Code, the Claude apps, and the Agent SDK.',
+ spec: 'https://agentskills.io/specification',
+ homepage: 'https://three.ws',
+};
+
+// Category + origin for skills whose SKILL.md we do not edit (vendor drops).
+const VENDORED_CATEGORIES = {
+ 'metamask-agent-wallet': { category: 'wallet/payments', origin: 'metamask' },
+ 'metamask-agent-workflows': { category: 'wallet/payments', origin: 'metamask' },
+ 'okx-agent-chat': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-agent-identity': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-agent-payments-protocol': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-agent-task': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-agentic-wallet': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-ai-guide': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-ai-support': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-audit-log': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-onchain-gateway': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-security': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-task-watch': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-wallet-portfolio': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-how-to-play': { category: 'wallet/payments', origin: 'okx' },
+ 'okx-dapp-discovery': { category: 'intel/trading', origin: 'okx' },
+ 'okx-defi-invest': { category: 'intel/trading', origin: 'okx' },
+ 'okx-defi-portfolio': { category: 'intel/trading', origin: 'okx' },
+ 'okx-dex-bridge': { category: 'intel/trading', origin: 'okx' },
+ 'okx-dex-market': { category: 'intel/trading', origin: 'okx' },
+ 'okx-dex-signal': { category: 'intel/trading', origin: 'okx' },
+ 'okx-dex-social': { category: 'intel/trading', origin: 'okx' },
+ 'okx-dex-strategy': { category: 'intel/trading', origin: 'okx' },
+ 'okx-dex-swap': { category: 'intel/trading', origin: 'okx' },
+ 'okx-dex-token': { category: 'intel/trading', origin: 'okx' },
+ 'okx-dex-trenches': { category: 'intel/trading', origin: 'okx' },
+ 'okx-dex-ws': { category: 'intel/trading', origin: 'okx' },
+ 'okx-growth-competition': { category: 'intel/trading', origin: 'okx' },
+};
+
+// Minimal frontmatter reader for the fields this manifest needs. Handles the
+// three scalar forms present across the pack: plain, quoted, and block (| / >).
+// Deliberately dependency-free — js-yaml is only a transitive dep of hardhat.
+function readFrontmatter(text) {
+ const m = text.match(/^---\r?\n([\s\S]*?)\r?\n---/);
+ if (!m) return null;
+ const lines = m[1].split(/\r?\n/);
+ const out = {};
+ let i = 0;
+ while (i < lines.length) {
+ const line = lines[i];
+ const key = line.match(/^([A-Za-z0-9_-]+):(.*)$/);
+ if (!key) {
+ i += 1;
+ continue;
+ }
+ const name = key[1];
+ let value = key[2].trim();
+ if (value === '|' || value === '>' || value === '|-' || value === '>-') {
+ const block = [];
+ i += 1;
+ while (i < lines.length && (/^\s+\S/.test(lines[i]) || lines[i].trim() === '')) {
+ block.push(lines[i].replace(/^\s+/, ''));
+ i += 1;
+ }
+ out[name] = block.join(value.startsWith('|') ? '\n' : ' ').trim();
+ continue;
+ }
+ if (value === '') {
+ // nested map (e.g. metadata:) — collect " key: value" children
+ const child = {};
+ i += 1;
+ while (i < lines.length && /^\s+\S/.test(lines[i])) {
+ const cm = lines[i].match(/^\s+([A-Za-z0-9_-]+):\s*(.*)$/);
+ if (cm) child[cm[1]] = stripQuotes(cm[2].trim());
+ i += 1;
+ }
+ out[name] = child;
+ continue;
+ }
+ out[name] = stripQuotes(value);
+ i += 1;
+ }
+ return out;
+}
+
+function stripQuotes(v) {
+ if (
+ (v.startsWith('"') && v.endsWith('"') && v.length > 1) ||
+ (v.startsWith("'") && v.endsWith("'") && v.length > 1)
+ ) {
+ return v
+ .slice(1, -1)
+ .replace(/\\"/g, '"')
+ .replace(/''/g, "'");
+ }
+ return v;
+}
+
+function collectSkills() {
+ const skills = [];
+ for (const entry of fs.readdirSync(SKILLS_DIR, { withFileTypes: true })) {
+ if (!entry.isDirectory()) continue;
+ const skillPath = path.join(SKILLS_DIR, entry.name, 'SKILL.md');
+ if (!fs.existsSync(skillPath)) {
+ throw new Error(`${entry.name}: missing SKILL.md`);
+ }
+ const fm = readFrontmatter(fs.readFileSync(skillPath, 'utf8'));
+ if (!fm || !fm.name || !fm.description) {
+ throw new Error(`${entry.name}: SKILL.md frontmatter missing name/description`);
+ }
+ if (fm.name !== entry.name) {
+ throw new Error(`${entry.name}: frontmatter name "${fm.name}" != directory name`);
+ }
+
+ const vendored = VENDORED_CATEGORIES[entry.name];
+ const meta = typeof fm.metadata === 'object' && fm.metadata ? fm.metadata : {};
+ const category = meta.category || vendored?.category;
+ if (!category) {
+ throw new Error(
+ `${entry.name}: no category — add metadata.category to its frontmatter (native) or an entry to VENDORED_CATEGORIES (vendored)`,
+ );
+ }
+
+ skills.push({
+ name: fm.name,
+ description: fm.description,
+ ...(fm.when_to_use ? { whenToUse: fm.when_to_use } : {}),
+ category,
+ origin: vendored?.origin || 'three.ws',
+ crossPlatformSafe: meta['cross-platform-safe'] === 'true' || meta['cross-platform-safe'] === true,
+ path: `.agents/skills/${entry.name}`,
+ });
+ }
+ skills.sort(
+ (a, b) => a.category.localeCompare(b.category) || a.origin.localeCompare(b.origin) || a.name.localeCompare(b.name),
+ );
+ return skills;
+}
+
+function renderJson(skills) {
+ const byCategory = {};
+ for (const s of skills) byCategory[s.category] = (byCategory[s.category] || 0) + 1;
+ return `${JSON.stringify(
+ {
+ ...PACK,
+ categories: {
+ '3d/creative':
+ '3D generation & rigging. Cross-platform-safe: no coin, wallet, or payment-protocol content — reusable on non-Claude tracks.',
+ 'wallet/payments': 'Wallet auth, funding, transfers, and the x402 paid-API economy.',
+ 'intel/trading': 'Market data, trading signals, DEX/DeFi execution.',
+ },
+ counts: byCategory,
+ skills,
+ },
+ null,
+ '\t',
+ )}\n`;
+}
+
+function renderMarkdown(skills) {
+ const lines = [
+ '# three.ws Agent Skills pack',
+ '',
+ `> Generated by \`scripts/build-skills-pack.mjs\` — do not edit by hand. Version **${PACK.version}**.`,
+ '',
+ PACK.description,
+ '',
+ 'Every skill is a portable folder per the [Agent Skills spec](https://agentskills.io/specification):',
+ 'a `SKILL.md` (frontmatter `description` is the load trigger) plus optional scripts and',
+ 'references. Install paths and authoring rules: [docs/agent-skills.md](../../docs/agent-skills.md).',
+ '',
+ 'Categories:',
+ '',
+ '- **3d/creative** — 3D generation & rigging. The cross-platform-safe subset: zero coin/wallet/payment strings, reusable outside Claude.',
+ '- **wallet/payments** — wallet auth, funding, transfers, and the x402 paid-API economy. Never bundle on the OpenAI track.',
+ '- **intel/trading** — market data, signals, DEX/DeFi execution. Never bundle on the OpenAI track.',
+ '',
+ ];
+ let current = '';
+ for (const s of skills) {
+ if (s.category !== current) {
+ current = s.category;
+ lines.push(`## ${current}`, '', '| Skill | Origin | Trigger |', '| --- | --- | --- |');
+ }
+ const trigger = s.description.replace(/\|/g, '\\|').replace(/\s+/g, ' ');
+ const safe = s.crossPlatformSafe ? ' ✅ cross-platform-safe' : '';
+ lines.push(`| [\`${s.name}\`](${s.name}/SKILL.md)${safe} | ${s.origin} | ${trigger} |`);
+ if (skills[skills.indexOf(s) + 1]?.category !== current) lines.push('');
+ }
+ return `${lines.join('\n').trimEnd()}\n`;
+}
+
+const skills = collectSkills();
+const jsonOut = renderJson(skills);
+const mdOut = renderMarkdown(skills);
+const jsonPath = path.join(SKILLS_DIR, 'skills-pack.json');
+const mdPath = path.join(SKILLS_DIR, 'SKILLS.md');
+
+if (process.argv.includes('--check')) {
+ const same =
+ fs.existsSync(jsonPath) &&
+ fs.existsSync(mdPath) &&
+ fs.readFileSync(jsonPath, 'utf8') === jsonOut &&
+ fs.readFileSync(mdPath, 'utf8') === mdOut;
+ if (!same) {
+ console.error('skills-pack manifest is stale — run: node scripts/build-skills-pack.mjs');
+ process.exit(1);
+ }
+ console.log(`skills-pack manifest up to date (${skills.length} skills).`);
+ process.exit(0);
+}
+
+fs.writeFileSync(jsonPath, jsonOut);
+fs.writeFileSync(mdPath, mdOut);
+console.log(`Wrote ${path.relative(ROOT, jsonPath)} and ${path.relative(ROOT, mdPath)} (${skills.length} skills).`);
diff --git a/scripts/gcp/vanity-grind-deploy.sh b/scripts/gcp/vanity-grind-deploy.sh
index 3883cefea..1866d3de1 100755
--- a/scripts/gcp/vanity-grind-deploy.sh
+++ b/scripts/gcp/vanity-grind-deploy.sh
@@ -132,8 +132,8 @@ fi
cat <<EOF
Notes:
- • Cloud Run Jobs: set SHARD_INDEX=\$CLOUD_RUN_TASK_INDEX in the entrypoint if you
- want strict per-task sharding (the built-in default shards evenly by env).
+ • Cloud Run Jobs: each task auto-shards — the grinder reads CLOUD_RUN_TASK_INDEX
+ as its SHARD_INDEX, so TASKS parallel tasks split the target list evenly.
• Cost: c2d spot ≈ \$0.01–0.02 / vCPU-hour. At ~25k keys/sec/vCPU a 4‑char
address (~11.3M expected) is ~450 vCPU-seconds ≈ \$0.002. Even 5‑char (~656M)
is a few cents. See docs/gcp-credits.md for the measured \$/address table.
diff --git a/tests/api/3d-studio.test.js b/tests/api/3d-studio.test.js
new file mode 100644
index 000000000..575bfba8a
--- /dev/null
+++ b/tests/api/3d-studio.test.js
@@ -0,0 +1,320 @@
+// Tests for POST /api/3d/studio + GET /api/3d/studio?job=<id> — the ChatGPT
+// Actions surface for free text→3D behind the "three.ws 3D Studio" custom GPT.
+//
+// Beyond the generate-lane lifecycle (mirrored from tests/api/3d-generate.test.js),
+// this suite pins the two properties that make the route submittable to the GPT
+// Store: every prompt passes the age-13+ safety gate before any lane work, and
+// every response body is free of upsell/pricing/crypto fields.
+//
+// The rate limiter is mocked (switchable per test) and the network is stubbed via
+// global fetch, so the suite runs fully offline while exercising the real handler,
+// real safety gate, real originFromReq, real viewerUrl, and the real shape helpers
+// against the REAL captured /api/forge draft-lane shapes.
+
+import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
+import { Readable } from 'node:stream';
+
+let freeOk = true;
+let freeResult = { success: true, limit: 60, remaining: 59, reset: Date.now() + 3_600_000 };
+vi.mock('../../api/_lib/rate-limit.js', () => ({
+ limits: {
+ mcp3dGenerateFree: async () =>
+ freeOk ? { success: true, limit: 60, remaining: 59, reset: Date.now() + 3_600_000 } : freeResult,
+ mcp3dStatus: async () => ({ success: true, limit: 240, remaining: 239, reset: Date.now() + 60_000 }),
+ },
+ clientIp: () => '203.0.113.7',
+}));
+
+const ORIGINAL_FETCH = globalThis.fetch;
+const ENV_KEYS = ['STUDIO_API_BASE', 'PUBLIC_APP_ORIGIN', 'APP_ORIGIN'];
+const saved = {};
+
+beforeEach(() => {
+ freeOk = true;
+ for (const k of ENV_KEYS) {
+ saved[k] = process.env[k];
+ delete process.env[k];
+ }
+});
+afterEach(() => {
+ for (const k of ENV_KEYS) {
+ if (saved[k] === undefined) delete process.env[k];
+ else process.env[k] = saved[k];
+ }
+ globalThis.fetch = ORIGINAL_FETCH;
+ vi.restoreAllMocks();
+});
+
+function makeReq({ method = 'POST', url = '/api/3d/studio', body = null, host = 'three.ws' } = {}) {
+ const raw = body == null ? '' : JSON.stringify(body);
+ const stream = Readable.from(raw ? [Buffer.from(raw)] : []);
+ stream.method = method;
+ stream.url = url;
+ stream.headers = { 'content-type': 'application/json', host };
+ return stream;
+}
+
+function makeRes() {
+ return {
+ statusCode: 200,
+ _h: {},
+ writableEnded: false,
+ headersSent: false,
+ setHeader(k, v) {
+ this._h[k.toLowerCase()] = v;
+ },
+ getHeader(k) {
+ return this._h[k.toLowerCase()];
+ },
+ end(body) {
+ this._body = body;
+ this.writableEnded = true;
+ },
+ };
+}
+
+async function dispatch(req, res) {
+ const mod = await import('../../api/3d/studio.js');
+ await mod.default(req, res);
+ return { res, body: res._body ? JSON.parse(res._body) : null };
+}
+
+function jsonResponse(obj, { status = 200 } = {}) {
+ return {
+ ok: status >= 200 && status < 300,
+ status,
+ headers: { get: () => 'application/json' },
+ json: async () => obj,
+ text: async () => JSON.stringify(obj),
+ };
+}
+
+// ── Real captured /api/forge draft-lane shapes (NVIDIA NIM TRELLIS) ───────────
+const SUBMIT_DONE = {
+ job_id: null,
+ creation_id: 'a1b2c3d4-0000-4000-8000-000000000001',
+ status: 'done',
+ glb_url: 'https://cdn.three.ws/forge/anon/a1b2c3d4.glb',
+ durable: true,
+ backend: 'nvidia',
+ tier: 'draft',
+ path: 'image',
+};
+const SUBMIT_QUEUED = {
+ job_id: 'f1.eyJwIjoibnZpZGlhIiwiayI6InRleHQiLCJ0IjoibmltLXRhc2stMTIzIn0.c2lnbmF0dXJl',
+ creation_id: 'a1b2c3d4-0000-4000-8000-000000000002',
+ status: 'queued',
+};
+const POLL_DONE = { job_id: SUBMIT_QUEUED.job_id, status: 'done', glb_url: 'https://cdn.three.ws/forge/anon/done.glb', durable: true };
+const POLL_RUNNING = { job_id: SUBMIT_QUEUED.job_id, status: 'running' };
+const POLL_FAILED = { job_id: SUBMIT_QUEUED.job_id, status: 'failed', error: 'the generator hit a snag' };
+
+// The GPT Store wire contract: nothing in any response body may reference
+// pricing, upsells, or crypto surfaces, and internal creation ids stay internal.
+const FORBIDDEN_WIRE_RE = /x402|wallet|coin|upgrade|forgePro|price|usd|creation_id|token(?!s)/i;
+
+function expectCleanWire(body) {
+ expect(JSON.stringify(body)).not.toMatch(FORBIDDEN_WIRE_RE);
+}
+
+describe('shape helpers — Actions wire contract', () => {
+ it('shapeSubmit maps inline-done to { done, glbUrl, viewerUrl } with nothing else attached', async () => {
+ const { shapeSubmit } = await import('../../api/3d/studio.js');
+ const out = shapeSubmit(SUBMIT_DONE, 'https://three.ws');
+ expect(out).toEqual({
+ status: 'done',
+ glbUrl: SUBMIT_DONE.glb_url,
+ viewerUrl: 'https://three.ws/viewer?src=' + encodeURIComponent(SUBMIT_DONE.glb_url),
+ format: 'glb',
+ });
+ expectCleanWire(out);
+ });
+
+ it('shapeSubmit maps queued to { pending, job, poll } pointing at the studio route', async () => {
+ const { shapeSubmit } = await import('../../api/3d/studio.js');
+ const out = shapeSubmit(SUBMIT_QUEUED, 'https://three.ws');
+ expect(out.status).toBe('pending');
+ expect(out.job).toBe(SUBMIT_QUEUED.job_id);
+ expect(out.poll).toBe('/api/3d/studio?job=' + encodeURIComponent(SUBMIT_QUEUED.job_id));
+ expectCleanWire(out);
+ });
+
+ it('shapePoll maps done/running/failed forge shapes cleanly', async () => {
+ const { shapePoll } = await import('../../api/3d/studio.js');
+ const done = shapePoll(POLL_DONE, 'https://three.ws', SUBMIT_QUEUED.job_id);
+ expect(done.status).toBe('done');
+ expect(done.glbUrl).toBe(POLL_DONE.glb_url);
+ expect(done.viewerUrl).toContain('/viewer?src=');
+ expectCleanWire(done);
+
+ const pending = shapePoll(POLL_RUNNING, 'https://three.ws', SUBMIT_QUEUED.job_id);
+ expect(pending.status).toBe('pending');
+ expect(pending.poll).toContain('/api/3d/studio?job=');
+ expectCleanWire(pending);
+
+ const err = shapePoll(POLL_FAILED, 'https://three.ws', SUBMIT_QUEUED.job_id);
+ expect(err.status).toBe('error');
+ expect(err.error).toBe(POLL_FAILED.error);
+ expectCleanWire(err);
+ });
+});
+
+describe('POST /api/3d/studio — safety gate', () => {
+ it('refuses a sexual-content prompt with 400 prompt_rejected before any lane work', async () => {
+ globalThis.fetch = vi.fn(async () => {
+ throw new Error('lane must not be called for a refused prompt');
+ });
+ const { res, body } = await dispatch(makeReq({ body: { prompt: 'a nude figure statue' } }), makeRes());
+ expect(res.statusCode).toBe(400);
+ expect(body.error).toBe('prompt_rejected');
+ expect(body.message).toMatch(/ages 13\+/);
+ expect(globalThis.fetch).not.toHaveBeenCalled();
+ });
+
+ it('refuses gore, hate iconography, and real-weapon prompts', async () => {
+ globalThis.fetch = vi.fn(async () => {
+ throw new Error('lane must not be called for a refused prompt');
+ });
+ for (const prompt of ['a gory decapitated head', 'a swastika banner', 'an ar-15 rifle model']) {
+ const { res, body } = await dispatch(makeReq({ body: { prompt } }), makeRes());
+ expect(res.statusCode).toBe(400);
+ expect(body.error).toBe('prompt_rejected');
+ }
+ expect(globalThis.fetch).not.toHaveBeenCalled();
+ });
+
+ it('lets an ordinary creative prompt through (fantasy props are fine)', async () => {
+ globalThis.fetch = vi.fn(async () => jsonResponse(SUBMIT_DONE));
+ const { res, body } = await dispatch(makeReq({ body: { prompt: 'a knight holding a fantasy sword' } }), makeRes());
+ expect(res.statusCode).toBe(200);
+ expect(body.status).toBe('done');
+ });
+});
+
+describe('POST /api/3d/studio — validation + rate limit', () => {
+ it('rejects an empty prompt with 400', async () => {
+ const { res, body } = await dispatch(makeReq({ body: { prompt: '' } }), makeRes());
+ expect(res.statusCode).toBe(400);
+ expect(body.error).toBe('invalid_prompt');
+ });
+
+ it('rejects an oversized prompt with 400', async () => {
+ const { res, body } = await dispatch(makeReq({ body: { prompt: 'x'.repeat(1001) } }), makeRes());
+ expect(res.statusCode).toBe(400);
+ expect(body.error).toBe('invalid_prompt');
+ });
+
+ it('returns a clean 429 (no upsell block) when the shared free-lane cap is hit', async () => {
+ freeOk = false;
+ freeResult = { success: false, limit: 60, remaining: 0, reset: Date.now() + 600_000 };
+ globalThis.fetch = vi.fn(async () => {
+ throw new Error('lane should not be called when rate-limited');
+ });
+ const { res, body } = await dispatch(makeReq({ body: { prompt: 'a small ceramic robot figurine' } }), makeRes());
+ expect(res.statusCode).toBe(429);
+ expect(body.error).toBe('rate_limited');
+ expect(res.getHeader('retry-after')).toBeTruthy();
+ expectCleanWire(body);
+ expect(globalThis.fetch).not.toHaveBeenCalled();
+ });
+});
+
+describe('POST /api/3d/studio — response contract', () => {
+ it('returns { done, glbUrl, viewerUrl } inline with the pinned free draft lane params', async () => {
+ globalThis.fetch = vi.fn(async () => jsonResponse(SUBMIT_DONE));
+ const { res, body } = await dispatch(makeReq({ body: { prompt: 'a small ceramic robot figurine' } }), makeRes());
+ expect(res.statusCode).toBe(200);
+ expect(body.status).toBe('done');
+ expect(body.glbUrl).toBe(SUBMIT_DONE.glb_url);
+ expect(body.viewerUrl).toBe('https://three.ws/viewer?src=' + encodeURIComponent(SUBMIT_DONE.glb_url));
+ expectCleanWire(body);
+ const [, opts] = globalThis.fetch.mock.calls[0];
+ expect(JSON.parse(opts.body)).toMatchObject({ prompt: 'a small ceramic robot figurine', backend: 'nvidia', path: 'image', tier: 'draft' });
+ });
+
+ it('returns { pending, job, poll } when the lane queues the job', async () => {
+ globalThis.fetch = vi.fn(async () => jsonResponse(SUBMIT_QUEUED));
+ const { res, body } = await dispatch(makeReq({ body: { prompt: 'a small ceramic robot figurine' } }), makeRes());
+ expect(res.statusCode).toBe(200);
+ expect(body.status).toBe('pending');
+ expect(body.job).toBe(SUBMIT_QUEUED.job_id);
+ expect(body.poll).toBe('/api/3d/studio?job=' + encodeURIComponent(SUBMIT_QUEUED.job_id));
+ expectCleanWire(body);
+ });
+
+ it('maps an unconfigured lane to a designed 503 with no deployment internals', async () => {
+ globalThis.fetch = vi.fn(async () => jsonResponse({ message: '3D generation is not configured — set NVIDIA_API_KEY' }, { status: 503 }));
+ const { res, body } = await dispatch(makeReq({ body: { prompt: 'a small ceramic robot figurine' } }), makeRes());
+ expect(res.statusCode).toBe(503);
+ expect(body.error).toBe('not_configured');
+ // The env-var hint from the internal lane must not leak to the GPT wire.
+ expect(body.message).not.toMatch(/NVIDIA_API_KEY|env/i);
+ });
+
+ it('maps an upstream 429 (GPU lane saturated) to 429 + retry-after', async () => {
+ globalThis.fetch = vi.fn(async () => jsonResponse({ message: 'busy', retry_after: 12 }, { status: 429 }));
+ const { res, body } = await dispatch(makeReq({ body: { prompt: 'a small ceramic robot figurine' } }), makeRes());
+ expect(res.statusCode).toBe(429);
+ expect(body.error).toBe('rate_limited');
+ expect(res.getHeader('retry-after')).toBe('12');
+ });
+});
+
+describe('GET /api/3d/studio?job= — poll lifecycle', () => {
+ it('400s when no job param is present', async () => {
+ const { res, body } = await dispatch(makeReq({ method: 'GET', url: '/api/3d/studio' }), makeRes());
+ expect(res.statusCode).toBe(400);
+ expect(body.error).toBe('missing_job');
+ });
+
+ it('400s on a malformed job handle', async () => {
+ const { res, body } = await dispatch(makeReq({ method: 'GET', url: '/api/3d/studio?job=bad*job*id' }), makeRes());
+ expect(res.statusCode).toBe(400);
+ expect(body.error).toBe('invalid_job');
+ });
+
+ it('returns pending while the job runs', async () => {
+ globalThis.fetch = vi.fn(async () => jsonResponse(POLL_RUNNING));
+ const { res, body } = await dispatch(makeReq({ method: 'GET', url: `/api/3d/studio?job=${SUBMIT_QUEUED.job_id}` }), makeRes());
+ expect(res.statusCode).toBe(200);
+ expect(body.status).toBe('pending');
+ expect(body.poll).toContain('/api/3d/studio?job=');
+ expectCleanWire(body);
+ });
+
+ it('returns done with glbUrl + viewerUrl when the job finishes', async () => {
+ globalThis.fetch = vi.fn(async () => jsonResponse(POLL_DONE));
+ const { res, body } = await dispatch(makeReq({ method: 'GET', url: `/api/3d/studio?job=${SUBMIT_QUEUED.job_id}` }), makeRes());
+ expect(res.statusCode).toBe(200);
+ expect(body.status).toBe('done');
+ expect(body.glbUrl).toBe(POLL_DONE.glb_url);
+ expect(body.viewerUrl).toContain('/viewer?src=');
+ expectCleanWire(body);
+ });
+
+ it('returns status:error when the job failed upstream', async () => {
+ globalThis.fetch = vi.fn(async () => jsonResponse(POLL_FAILED));
+ const { res, body } = await dispatch(makeReq({ method: 'GET', url: `/api/3d/studio?job=${SUBMIT_QUEUED.job_id}` }), makeRes());
+ expect(res.statusCode).toBe(200);
+ expect(body.status).toBe('error');
+ expect(body.error).toBe(POLL_FAILED.error);
+ expectCleanWire(body);
+ });
+
+ it('treats a transient poll network error as pending', async () => {
+ globalThis.fetch = vi.fn(async () => {
+ throw new Error('network blip');
+ });
+ const { res, body } = await dispatch(makeReq({ method: 'GET', url: `/api/3d/studio?job=${SUBMIT_QUEUED.job_id}` }), makeRes());
+ expect(res.statusCode).toBe(200);
+ expect(body.status).toBe('pending');
+ });
+});
+
+describe('endpoint source — GPT Store compliance', () => {
+ it('the route source contains no crypto/pricing surface strings', async () => {
+ const { readFile } = await import('node:fs/promises');
+ const src = await readFile(new URL('../../api/3d/studio.js', import.meta.url), 'utf8');
+ expect(src).not.toMatch(/x402|wallet|\bcoin\b|pump|aixbt|\$THREE|forgePro|upgrade/i);
+ });
+});
diff --git a/tests/api/mcp-3d-challenge.test.js b/tests/api/mcp-3d-challenge.test.js
index ff5722d22..d1ae0e768 100644
--- a/tests/api/mcp-3d-challenge.test.js
+++ b/tests/api/mcp-3d-challenge.test.js
@@ -13,6 +13,12 @@ import { Readable } from 'node:stream';
process.env.PUBLIC_APP_ORIGIN = 'https://three.ws';
process.env.X402_PAY_TO_BASE ||= '0x0000000000000000000000000000000000000001';
process.env.X402_ASSET_ADDRESS_BASE ||= '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913';
+// OKX Agent Payments Protocol rail (specs/okx-agent-payments.md): payTo +
+// settlement route configured → the eip155:196 accept is advertised. The
+// relayer key is a synthetic, publicly-known test vector.
+process.env.X402_PAY_TO_XLAYER ||= '0x75d00a2713565171f33216e5aa2a375e076ecf69';
+process.env.X402_XLAYER_RELAYER_KEY ||=
+ '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d';
// Bearer path is out of scope — no token is ever presented in these tests.
vi.mock('../../api/_lib/auth.js', () => ({
diff --git a/vercel.json b/vercel.json
index 558e622c0..74c9de765 100644
--- a/vercel.json
+++ b/vercel.json
@@ -53,7 +53,7 @@
"includeFiles": "api/_lib/3d-catalog/**",
"maxDuration": 30
},
- "api/3d/generate.js": {
+ "{api/3d/generate,api/3d/studio}.js": {
"maxDuration": 120
},
"api/widgets/[id]/knowledge-process.js": {
diff --git a/workers/vanity-grinder/grind.mjs b/workers/vanity-grinder/grind.mjs
index 9eacbe866..318ca1a35 100644
--- a/workers/vanity-grinder/grind.mjs
+++ b/workers/vanity-grinder/grind.mjs
@@ -68,9 +68,10 @@ function loadTargets() {
} else {
list = defaultTargets({ include5: env.INCLUDE_5 === '1', ignoreCase: env.IGNORE_CASE === '1' });
}
- // Shard across parallel instances (a GCE MIG runs N of these).
+ // Shard across parallel instances. Cloud Run Jobs expose the task ordinal as
+ // CLOUD_RUN_TASK_INDEX — without this fallback every task would grind shard 0.
const shardCount = Math.max(1, parseInt(env.SHARD_COUNT || '1', 10));
- const shardIndex = Math.max(0, parseInt(env.SHARD_INDEX || '0', 10));
+ const shardIndex = Math.max(0, parseInt(env.SHARD_INDEX ?? env.CLOUD_RUN_TASK_INDEX ?? '0', 10));
if (shardCount > 1) list = list.filter((_, i) => i % shardCount === shardIndex);
return list;
}