Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
chore: MCP tool refinements, SDK licenses, forge showcase + gallery community tests
nirholas872406a3136b
diff --git a/agent-payments-sdk/LICENSE b/agent-payments-sdk/LICENSEnew file mode 100644index 000000000..59d243f0d--- /dev/null+++ b/agent-payments-sdk/LICENSE@@ -0,0 +1,15 @@+ISC License++Copyright (c) 2026 three.ws++Permission to use, copy, modify, and/or distribute this software for any+purpose with or without fee is hereby granted, provided that the above+copyright notice and this permission notice appear in all copies.++THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.diff --git a/agent-protocol-sdk/LICENSE b/agent-protocol-sdk/LICENSEnew file mode 100644index 000000000..bbb838721--- /dev/null+++ b/agent-protocol-sdk/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 three.ws++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/agent-protocol-sdk/package.json b/agent-protocol-sdk/package.jsonindex 7b256632e..06ca2c436 100644--- a/agent-protocol-sdk/package.json+++ b/agent-protocol-sdk/package.json@@ -15,7 +15,7 @@"prepublishOnly": "tsc"},"dependencies": {- "@coral-xyz/anchor": "^0.31.1",+ "@coral-xyz/anchor": "^0.32.1","@solana/web3.js": "^1.98.4"},"devDependencies": {diff --git a/agent-protocol-sdk/src/index.ts b/agent-protocol-sdk/src/index.tsindex 1b9b483e2..f82622de2 100644--- a/agent-protocol-sdk/src/index.ts+++ b/agent-protocol-sdk/src/index.ts@@ -5,7 +5,7 @@ import {Transaction,sendAndConfirmTransaction,} from '@solana/web3.js';-import { Program, AnchorProvider, Wallet, type Idl } from '@coral-xyz/anchor';+import { Program, AnchorProvider, Wallet } from '@coral-xyz/anchor';import { IDL, AGENT_INVOCATION_PROGRAM_ID, type AgentInvocation } from './idl.js';export { IDL, AGENT_INVOCATION_PROGRAM_ID } from './idl.js';@@ -81,10 +81,10 @@ export async function invokeSkill({const program = new Program<AgentInvocation>(idl, provider);const instruction = await program.methods- .invokeSkill(skillName, parameters)+ .invoke_skill(skillName, parameters).accounts({- invokerAuthority: invokerAuthority.publicKey,- targetAuthority,+ invoker_authority: invokerAuthority.publicKey,+ target_authority: targetAuthority,}).instruction();diff --git a/api/forge-gallery.js b/api/forge-gallery.jsindex a1a022ffb..1e76cdab6 100644--- a/api/forge-gallery.js+++ b/api/forge-gallery.js@@ -40,8 +40,12 @@ export default wrap(async (req, res) => {if ((url.searchParams.get('scope') || '').trim() === 'community') {const creations = await listShowcase({ limit });- res.setHeader('Cache-Control', 'public, s-maxage=60, stale-while-revalidate=300');- return json(res, 200, { enabled: true, creations });+ return json(+ res,+ 200,+ { enabled: true, creations },+ { 'cache-control': 'public, s-maxage=60, stale-while-revalidate=300' },+ );}const rawClient = req.headers['x-forge-client'];diff --git a/mcp-server/server.json b/mcp-server/server.jsonindex b936e9b05..364d1ff65 100644--- a/mcp-server/server.json+++ b/mcp-server/server.json@@ -1,18 +1,27 @@{"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json","name": "io.github.nirholas/3d-agent-mcp",- "description": "Paid MCP tools for the 3d-agent stack by three.ws — text/image-to-3D mesh generation, auto-rigging, avatar generation, pose generation, pump.fun snapshots, ERC-8004 agent reputation, and a Solana vanity grinder. Settled in USDC on Solana via x402.",+ "title": "three.ws 3D Agent Tools",+ "description": "Paid x402 MCP tools from three.ws: text-to-3D generation, rigging, agent reputation, market intel.",+ "websiteUrl": "https://three.ws",+ "icons": [+ {+ "src": "https://three.ws/three-ws-mcp-icon.svg",+ "mimeType": "image/svg+xml",+ "sizes": ["any"]+ }+ ],"repository": {"url": "https://github.com/nirholas/three.ws","source": "github","subfolder": "mcp-server"},- "version": "1.0.0",+ "version": "1.1.0","packages": [{"registryType": "npm","identifier": "@3d-agent/mcp-server",- "version": "1.0.0",+ "version": "1.1.0","transport": {"type": "stdio"},diff --git a/mcp-server/src/index.js b/mcp-server/src/index.jsindex ab68a6f10..4fd06c5a8 100755--- a/mcp-server/src/index.js+++ b/mcp-server/src/index.js@@ -19,6 +19,7 @@// MCP_SVM_PAYMENT_ADDRESS (enforced lazily inside `paid()`). The stdio boot in// `main()` runs only when this file is the process entry point.+import { createRequire } from 'node:module';import { pathToFileURL } from 'node:url';import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';@@ -57,9 +58,14 @@ const SERVER_INSTRUCTIONS ='intelligence — narrative intel feed and momentum-ranked project scans ' +'(aixbt_intel, aixbt_projects).';+// The advertised MCP server version comes straight from package.json so it+// can never drift from the published npm version.+const { version: PKG_VERSION } = createRequire(import.meta.url)('../package.json');+// Every tool builder. Each returns a descriptor-// { name, title, description, inputSchema (Zod shape), handler }. None of these-// require payment env — the env requirement is deferred to the first paid call.+// { name, title, description, inputSchema (Zod shape), annotations, handler }.+// None of these require payment env — the env requirement is deferred to the+// first paid call.const TOOL_BUILDERS = [buildTextToAvatarTool,buildMeshForgeTool,@@ -82,7 +88,7 @@ const TOOL_BUILDERS = [* Build every tool descriptor. Side-effect-free w.r.t. payment env and the* stdio transport — safe to call from tests to enumerate the tool surface.*- * @returns {Promise<Array<{name:string,title:string,description:string,inputSchema:object,handler:Function}>>}+ * @returns {Promise<Array<{name:string,title:string,description:string,inputSchema:object,annotations:object,handler:Function}>>}*/export async function buildTools() {return Promise.all(TOOL_BUILDERS.map((build) => build()));@@ -99,8 +105,11 @@ export async function buildTools() {export async function buildServer() {const server = new McpServer({+ // Stable MCP identity — matches the bin name and the registry+ // mcpName suffix (io.github.nirholas/3d-agent-mcp). Deliberately+ // NOT derived from the scoped npm package name.name: '3d-agent-mcp',- version: '1.0.0',+ version: PKG_VERSION,},{// Declare full tools capability so clients on the strict MCP 2025-06-18@@ -122,6 +131,11 @@ export async function buildServer() {title: t.title,description: t.description,inputSchema: t.inputSchema,+ // MCP ToolAnnotations (readOnlyHint / destructiveHint /+ // idempotentHint / openWorldHint) — lets clients gate+ // confirmation prompts per tool instead of treating every call+ // as a destructive write.+ annotations: t.annotations,},t.handler,);diff --git a/mcp-server/src/tools/agenc-get-agent.js b/mcp-server/src/tools/agenc-get-agent.jsindex 34e9bc1a8..2fd77a308 100644--- a/mcp-server/src/tools/agenc-get-agent.js+++ b/mcp-server/src/tools/agenc-get-agent.js@@ -133,6 +133,13 @@ export async function buildAgenCGetAgentTool() {title: 'AgenC get agent ($0.001)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Read-only on-chain registry lookup — agent stats (tasks, reputation)+ // change between calls, so not idempotent.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/agenc-get-task.js b/mcp-server/src/tools/agenc-get-task.jsindex 80f59f702..219276561 100644--- a/mcp-server/src/tools/agenc-get-task.js+++ b/mcp-server/src/tools/agenc-get-task.js@@ -175,6 +175,13 @@ export async function buildAgenCGetTaskTool() {title: 'AgenC get task ($0.001)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Read-only on-chain lookup — task status moves through its lifecycle+ // between calls, so not idempotent.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/agenc-list-tasks.js b/mcp-server/src/tools/agenc-list-tasks.jsindex b74892ae3..8e8fc8b3d 100644--- a/mcp-server/src/tools/agenc-list-tasks.js+++ b/mcp-server/src/tools/agenc-list-tasks.js@@ -98,6 +98,13 @@ export async function buildAgenCListTasksTool() {title: 'AgenC list tasks ($0.001)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Read-only on-chain program scan — the task set changes as agents+ // post/claim work, so not idempotent.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/agent-delegate-action.js b/mcp-server/src/tools/agent-delegate-action.jsindex da8e12189..dd028faa5 100644--- a/mcp-server/src/tools/agent-delegate-action.js+++ b/mcp-server/src/tools/agent-delegate-action.js@@ -100,6 +100,14 @@ export async function buildAgentDelegateActionTool() {title: 'Agent delegate action ($0.01)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Dispatches a delegated action to an external agent — a write with+ // side effects, but it never destroys existing state.+ annotations: {+ readOnlyHint: false,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/agent-reputation.js b/mcp-server/src/tools/agent-reputation.jsindex ba017177a..9112f8a7e 100644--- a/mcp-server/src/tools/agent-reputation.js+++ b/mcp-server/src/tools/agent-reputation.js@@ -272,6 +272,13 @@ export async function buildAgentReputationTool() {title: 'Agent reputation ($0.01)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Read-only on-chain lookup — reputation events accrue between calls,+ // so not idempotent.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/aixbt-intel.js b/mcp-server/src/tools/aixbt-intel.jsindex e0441c725..d077c8558 100644--- a/mcp-server/src/tools/aixbt-intel.js+++ b/mcp-server/src/tools/aixbt-intel.js@@ -96,6 +96,13 @@ export async function buildAixbtIntelTool() {title: 'aixbt intel ($0.01)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Read-only live intelligence feed — narratives update continuously,+ // so not idempotent.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/aixbt-projects.js b/mcp-server/src/tools/aixbt-projects.jsindex b317dffa2..f87fb1315 100644--- a/mcp-server/src/tools/aixbt-projects.js+++ b/mcp-server/src/tools/aixbt-projects.js@@ -104,6 +104,13 @@ export async function buildAixbtProjectsTool() {title: 'aixbt projects ($0.01)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Read-only live momentum rankings — scores shift continuously, so not+ // idempotent.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/ens-sns-resolve.js b/mcp-server/src/tools/ens-sns-resolve.jsindex 344793f30..2e2ac3999 100644--- a/mcp-server/src/tools/ens-sns-resolve.js+++ b/mcp-server/src/tools/ens-sns-resolve.js@@ -197,6 +197,13 @@ export async function buildEnsSnsResolveTool() {title: 'ENS + SNS resolve ($0.0005)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Read-only external lookup. Not idempotent: name → address records can+ // be re-pointed between calls.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/mesh-forge.js b/mcp-server/src/tools/mesh-forge.jsindex b08afca6c..d788393c7 100644--- a/mcp-server/src/tools/mesh-forge.js+++ b/mcp-server/src/tools/mesh-forge.js@@ -366,6 +366,14 @@ export async function buildMeshForgeTool() {title: 'Text → 3D mesh ($0.25)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Creates a hosted mesh artifact via external generation APIs; destroys+ // nothing, and every call mints a fresh asset.+ annotations: {+ readOnlyHint: false,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/pose-seed.js b/mcp-server/src/tools/pose-seed.jsindex 2ad5712ac..74afeda04 100644--- a/mcp-server/src/tools/pose-seed.js+++ b/mcp-server/src/tools/pose-seed.js@@ -157,6 +157,13 @@ export async function buildPoseSeedTool() {title: 'Pose seed ($0.001)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Pure deterministic local compute: same prompt → same pose preset,+ // no external interaction.+ annotations: {+ readOnlyHint: true,+ idempotentHint: true,+ openWorldHint: false,+ },handler,};}diff --git a/mcp-server/src/tools/pump-snapshot.js b/mcp-server/src/tools/pump-snapshot.jsindex 45aacfc3b..369fbe9e9 100644--- a/mcp-server/src/tools/pump-snapshot.js+++ b/mcp-server/src/tools/pump-snapshot.js@@ -250,6 +250,13 @@ export async function buildPumpSnapshotTool() {title: 'Pump.fun snapshot ($0.005)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Read-only live market snapshot — price/holders move between calls,+ // so not idempotent.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/rig-mesh.js b/mcp-server/src/tools/rig-mesh.jsindex 9cd027367..633db0b6f 100644--- a/mcp-server/src/tools/rig-mesh.js+++ b/mcp-server/src/tools/rig-mesh.js@@ -194,6 +194,14 @@ export async function buildRigMeshTool() {title: 'Rig 3D mesh ($0.20)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Creates a new hosted rigged-GLB artifact via external rigging APIs;+ // the input mesh is never modified or deleted.+ annotations: {+ readOnlyHint: false,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/sentiment-pulse.js b/mcp-server/src/tools/sentiment-pulse.jsindex 8478801be..3df19b1f9 100644--- a/mcp-server/src/tools/sentiment-pulse.js+++ b/mcp-server/src/tools/sentiment-pulse.js@@ -106,6 +106,13 @@ export async function buildSentimentPulseTool() {title: 'Sentiment pulse ($0.003)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Read-only live market feed — re-calls with the same args return+ // fresh data, so not idempotent.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/text-to-avatar.js b/mcp-server/src/tools/text-to-avatar.jsindex 634ba1454..27b9fa562 100644--- a/mcp-server/src/tools/text-to-avatar.js+++ b/mcp-server/src/tools/text-to-avatar.js@@ -276,6 +276,14 @@ export async function buildTextToAvatarTool() {title: 'Text → 3D avatar ($0.15)',description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Creates a hosted GLB artifact via external generation APIs; destroys+ // nothing, and every call mints a fresh asset.+ annotations: {+ readOnlyHint: false,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+ },handler,};}diff --git a/mcp-server/src/tools/vanity-grinder.js b/mcp-server/src/tools/vanity-grinder.jsindex e2dfdb3f4..bf774f4d5 100644--- a/mcp-server/src/tools/vanity-grinder.js+++ b/mcp-server/src/tools/vanity-grinder.js@@ -166,6 +166,13 @@ export async function buildVanityGrinderTool() {title: `Solana vanity grinder (${PRICE_USD})`,description: TOOL_DESCRIPTION,inputSchema: inputZodShape,+ // Pure local compute with no external interaction, but output is a+ // freshly-random keypair every call — never idempotent.+ annotations: {+ readOnlyHint: true,+ idempotentHint: false,+ openWorldHint: false,+ },handler,};}diff --git a/package-lock.json b/package-lock.jsonindex 127f25797..222f1bf7e 100644--- a/package-lock.json+++ b/package-lock.json@@ -178,7 +178,7 @@},"agent-payments-sdk": {"name": "@three-ws/agent-payments",- "version": "3.1.0",+ "version": "3.2.0","license": "ISC","dependencies": {"@bonfida/spl-name-service": "0.1.67",@@ -212,6 +212,9 @@"typescript-eslint": "^8.61.0","zod": "^3.25.76"},+ "engines": {+ "node": ">=18"+ },"optionalDependencies": {"@rollup/rollup-linux-x64-gnu": "*"},@@ -382,7 +385,7 @@},"agent-ui-sdk": {"name": "@three-ws/agent-ui",- "version": "0.1.0",+ "version": "0.2.0","license": "Apache-2.0","engines": {"node": ">=18"@@ -393,7 +396,7 @@},"avatar-sdk": {"name": "@three-ws/avatar",- "version": "0.1.0",+ "version": "0.2.0","license": "Apache-2.0","engines": {"node": ">=18"@@ -1179,7 +1182,7 @@},"mcp-server": {"name": "@3d-agent/mcp-server",- "version": "1.0.0",+ "version": "1.1.0","license": "Apache-2.0","dependencies": {"@bonfida/spl-name-service": "0.1.67",@@ -54145,10 +54148,10 @@},"packages/avatar-cli": {"name": "@three-ws/avatar-cli",- "version": "0.1.0",+ "version": "0.2.0","license": "Apache-2.0","dependencies": {- "@three-ws/avatar-schema": "0.1.0"+ "@three-ws/avatar-schema": "^0.2.0"},"bin": {"three-ws-avatar": "src/cli.js"@@ -54159,7 +54162,7 @@},"packages/avatar-schema": {"name": "@three-ws/avatar-schema",- "version": "0.1.0",+ "version": "0.2.0","license": "Apache-2.0","dependencies": {"ajv": "^8.20.0",@@ -54171,7 +54174,7 @@},"packages/ibm-watsonx-mcp": {"name": "@three-ws/ibm-watsonx-mcp",- "version": "0.1.1",+ "version": "0.2.0","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0"@@ -54185,7 +54188,7 @@},"packages/ibm-x402-mcp": {"name": "@three-ws/ibm-x402-mcp",- "version": "1.0.0",+ "version": "1.1.0","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0",@@ -54205,7 +54208,7 @@},"packages/pumpfun-mcp": {"name": "@three-ws/pumpfun-mcp",- "version": "0.1.0",+ "version": "0.2.0","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0"@@ -54219,7 +54222,7 @@},"packages/threews-avatar-mcp": {"name": "@three-ws/avatar-mcp",- "version": "0.2.0",+ "version": "0.3.0","license": "Apache-2.0","dependencies": {"@modelcontextprotocol/sdk": "^1.29.0"@@ -54721,7 +54724,7 @@},"packages/viewer-presets": {"name": "@three-ws/viewer-presets",- "version": "0.1.0",+ "version": "0.2.0","license": "Apache-2.0","engines": {"node": ">=18"@@ -54737,7 +54740,7 @@},"solana-agent-sdk": {"name": "@three-ws/solana-agent",- "version": "0.1.0",+ "version": "0.2.0","license": "MIT","dependencies": {"@coral-xyz/anchor": "^0.32.1",@@ -54757,6 +54760,9 @@"typescript": "^5.7.3","zod": "^3.0.0"},+ "engines": {+ "node": ">=18"+ },"peerDependencies": {"zod": "^3.0.0"},diff --git a/packages/avatar-agent-mcp/src/tools/dress-avatar.js b/packages/avatar-agent-mcp/src/tools/dress-avatar.jsindex 1f2728a2e..d4f205635 100644--- a/packages/avatar-agent-mcp/src/tools/dress-avatar.js+++ b/packages/avatar-agent-mcp/src/tools/dress-avatar.js@@ -9,6 +9,8 @@ import { ACCESSORIES, POSE_PRESETS, findAccessory, getSession, updateSession, viexport const def = {name: 'dress_avatar',title: 'Apply accessories + pose to a spawned avatar',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },description:'Apply (or replace) accessories on a spawned avatar session and optionally set a pose. Pass accessoryIds to set the full accessory list (empty array clears them). Pass pose to switch animations. Returns the updated viewer URL.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/ens-sns-resolve.js b/packages/avatar-agent-mcp/src/tools/ens-sns-resolve.jsindex 2cf5727c9..1065a1000 100644--- a/packages/avatar-agent-mcp/src/tools/ens-sns-resolve.js+++ b/packages/avatar-agent-mcp/src/tools/ens-sns-resolve.js@@ -10,6 +10,8 @@ import { resolveName } from '../lib/ens-sns.js';export const def = {name: 'ens_sns_resolve',title: 'Resolve ENS + SNS names to addresses',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: false, openWorldHint: true },description:'Resolve a human-readable name to addresses across ENS (Ethereum) and SNS (Solana, Bonfida). For .eth: returns Ethereum address + reverse lookup. For .sol: returns Solana owner wallet + the wallet\'s other owned .sol domains + favorite domain. Names without a suffix are tried against both registries.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/generate-avatar.js b/packages/avatar-agent-mcp/src/tools/generate-avatar.jsindex 695a0ebdc..ee3357b49 100644--- a/packages/avatar-agent-mcp/src/tools/generate-avatar.js+++ b/packages/avatar-agent-mcp/src/tools/generate-avatar.js@@ -71,6 +71,8 @@ async function pollPrediction(predictionId, { timeoutMs, intervalMs }) {export const def = {name: 'generate_avatar',title: 'Generate a 3D avatar (Replicate text-to-3D)',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },description:'Generate a textured GLB from a text prompt or reference image URLs via Replicate (Hunyuan-3D 3.1 by default; configurable). Returns the GLB URL and a new avatar session you can dress + animate. Requires REPLICATE_API_TOKEN and REPLICATE_TEXT_TO_AVATAR_MODEL on the MCP server.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/inspect-glb.js b/packages/avatar-agent-mcp/src/tools/inspect-glb.jsindex 98b244df9..7c920025d 100644--- a/packages/avatar-agent-mcp/src/tools/inspect-glb.js+++ b/packages/avatar-agent-mcp/src/tools/inspect-glb.js@@ -92,6 +92,8 @@ function transform(v, m) {export const def = {name: 'inspect_glb',title: 'Inspect a GLB / glTF 3D model',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },description:'Fetch any GLB URL (or data: URL) and return a full structural breakdown: meshes, primitives, materials, textures, animations, skins, vertex + triangle counts, world-space bounding box, and file size. Pure local parse via @gltf-transform/core — no third-party services.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/list-animations.js b/packages/avatar-agent-mcp/src/tools/list-animations.jsindex 82728d1db..688394f37 100644--- a/packages/avatar-agent-mcp/src/tools/list-animations.js+++ b/packages/avatar-agent-mcp/src/tools/list-animations.js@@ -9,6 +9,8 @@ import { fetchPoseCatalogRemote } from '../lib/render.js';export const def = {name: 'list_animations',title: 'List three.ws pose presets + animation slots',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: false, openWorldHint: true },description:'Return the three.ws pose preset catalog (T-pose, A-pose, wave, thinker, jump, dance, warrior2, …) grouped by category. Use the ids returned here as posePresetId in render_avatar. Fetched live from three.ws so the catalog reflects the deployed version.',inputSchema: {},diff --git a/packages/avatar-agent-mcp/src/tools/list-avatars.js b/packages/avatar-agent-mcp/src/tools/list-avatars.jsindex a4472be90..b436dba71 100644--- a/packages/avatar-agent-mcp/src/tools/list-avatars.js+++ b/packages/avatar-agent-mcp/src/tools/list-avatars.js@@ -6,6 +6,8 @@ import { ACCESSORIES, DEFAULT_AVATARS, POSE_PRESETS } from '../lib/avatars.js';export const def = {name: 'list_avatars',title: 'List three.ws default avatars + accessories',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },description:'Return the catalog of default 3D avatars (default, cz) and accessories (hats, glasses, earrings) hosted on the three.ws CDN. Each entry includes a public GLB URL ready to load in any glTF viewer or Three.js scene. Includes the supported pose preset names.',inputSchema: {},diff --git a/packages/avatar-agent-mcp/src/tools/optimize-glb.js b/packages/avatar-agent-mcp/src/tools/optimize-glb.jsindex a628608bf..9e7b1b51b 100644--- a/packages/avatar-agent-mcp/src/tools/optimize-glb.js+++ b/packages/avatar-agent-mcp/src/tools/optimize-glb.js@@ -17,6 +17,8 @@ const MAX_RETURN_BYTES = 20 * 1024 * 1024;export const def = {name: 'optimize_glb',title: 'Optimize a GLB (dedup, prune, weld, Draco)',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },description:'Run a @gltf-transform/functions optimization pipeline on a GLB URL: dedup → prune unused → weld duplicate vertices → optional Draco mesh compression. Returns the optimized bytes as a base64 data URL with before/after sizes. Lossless for geometry except where Draco quantization is requested.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/pump-buy.js b/packages/avatar-agent-mcp/src/tools/pump-buy.jsindex d8a1c9a72..33b477aba 100644--- a/packages/avatar-agent-mcp/src/tools/pump-buy.js+++ b/packages/avatar-agent-mcp/src/tools/pump-buy.js@@ -19,6 +19,8 @@ import { THREE_MINT } from '../config.js';export const def = {name: 'pump_buy',title: 'Buy a Solana token via Jupiter (direct or Jito-bundled)',+ // MCP ToolAnnotations — EXECUTION: moves real value on Solana mainnet, irreversible.+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },description:'Swap SOL → target mint via Jupiter aggregator. Direct mode = one tx signed by the buyer. Bundled mode (jitoBundle=true) = two-tx Jito bundle where funderSecret transfers SOL + tip to the buyer atomically with the swap (sweeper-resistant). Pass target="three" to use the $three reference mint. EXECUTION ACTION.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/pump-collect.js b/packages/avatar-agent-mcp/src/tools/pump-collect.jsindex e75cf2289..c17314607 100644--- a/packages/avatar-agent-mcp/src/tools/pump-collect.js+++ b/packages/avatar-agent-mcp/src/tools/pump-collect.js@@ -17,6 +17,8 @@ import { assertRecipientAllowed, confirmationGate } from '../lib/spend-policy.jsexport const def = {name: 'pump_collect_fees',title: 'Atomic pump.fun creator-fee collection (Jito bundle)',+ // MCP ToolAnnotations — EXECUTION: moves real value on Solana mainnet, irreversible.+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },description:'Collect a pump.fun coin\'s creator-fee vault and route the SOL to a safe destination, atomically, in a single tx inside a Jito bundle. Funder pays the fee + Jito tip; creator signs collectCoinCreatorFee + drain to DESTINATION. The bundle\'s atomicity blocks any competing collector from interleaving even if the creator key is leaked. EXECUTION ACTION.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/pump-launch.js b/packages/avatar-agent-mcp/src/tools/pump-launch.jsindex 0fb5df14f..c260ce4f7 100644--- a/packages/avatar-agent-mcp/src/tools/pump-launch.js+++ b/packages/avatar-agent-mcp/src/tools/pump-launch.js@@ -21,6 +21,8 @@ import { confirmationGate } from '../lib/spend-policy.js';export const def = {name: 'pump_launch',title: 'Atomic pump.fun launch (Jito bundle, separate funder/creator)',+ // MCP ToolAnnotations — EXECUTION: moves real value on Solana mainnet, irreversible.+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },description:'Launch a pump.fun token atomically via a Jito bundle. Funder pays its own fee + tip and rent-funds the creator; creator signs createV2 in tx2 — both txs land in the same block or neither does. If uri is omitted, metadata is uploaded to pump.fun IPFS first from name/symbol/description/socials/imageUrl. Returns the mint address, bundle id, both tx signatures, and the pump.fun URL. EXECUTION ACTION — creates a real mint on mainnet.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/pump-snapshot.js b/packages/avatar-agent-mcp/src/tools/pump-snapshot.jsindex 6bf8ee9ce..ef90e19e3 100644--- a/packages/avatar-agent-mcp/src/tools/pump-snapshot.js+++ b/packages/avatar-agent-mcp/src/tools/pump-snapshot.js@@ -12,6 +12,8 @@ import { THREE_MINT } from '../config.js';export const def = {name: 'pump_snapshot',title: 'Live pump.fun / Solana token snapshot',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: false, openWorldHint: true },description:'Live snapshot for a Solana token (SPL or pump.fun): USD price (Jupiter), 24h volume + primary DEX (Dexscreener), pump.fun metadata (name/symbol/image/socials/mcap), and top-holder distribution from Solana RPC. Optional Helius DAS supply when HELIUS_API_KEY is configured. Free — no signer.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/render-avatar.js b/packages/avatar-agent-mcp/src/tools/render-avatar.jsindex 6a89d2589..9edcec9f0 100644--- a/packages/avatar-agent-mcp/src/tools/render-avatar.js+++ b/packages/avatar-agent-mcp/src/tools/render-avatar.js@@ -17,6 +17,8 @@ import { getSession } from '../lib/avatars.js';export const def = {name: 'render_avatar',title: 'Render a posed avatar (pose + camera + expression)',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },description:'Render an avatar GLB with a three.ws pose preset, camera orbit, and optional ARKit-52 facial expression. Same pipeline as the three.ws customizer\'s save-snapshot flow. Returns PNG bytes as a base64 data URL. Accepts either glbUrl directly or sessionId from spawn_avatar.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/spawn-avatar.js b/packages/avatar-agent-mcp/src/tools/spawn-avatar.jsindex 5d966d161..b46133c33 100644--- a/packages/avatar-agent-mcp/src/tools/spawn-avatar.js+++ b/packages/avatar-agent-mcp/src/tools/spawn-avatar.js@@ -9,6 +9,8 @@ import { createSession, findAvatar, viewerUrlFor } from '../lib/avatars.js';export const def = {name: 'spawn_avatar',title: 'Spawn a 3D avatar session',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },description:'Spawn a 3D avatar from a curated default (preset="default" or "cz") or from a custom GLB URL. Returns a sessionId other tools (dress_avatar, viewer_url, speak) reference, plus the avatar GLB URL and a ready-to-open three.ws viewer link.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/speak.js b/packages/avatar-agent-mcp/src/tools/speak.jsindex 7c9421dc4..1a7a18a7f 100644--- a/packages/avatar-agent-mcp/src/tools/speak.js+++ b/packages/avatar-agent-mcp/src/tools/speak.js@@ -32,6 +32,8 @@ const NVIDIA_TIMEOUT_MS = 30_000;export const def = {name: 'speak',title: 'Avatar speaks (TTS)',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },description:'Synthesize speech for an avatar session and return a base64 audio data URL the client can play. Free NVIDIA NIM Magpie TTS leads when NVIDIA_API_KEY is set (non-pcm requests are served as WAV); OpenAI TTS is the paid backstop when OPENAI_API_KEY is set. Picks the session\'s configured voice unless overridden.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/thumbnail-glb.js b/packages/avatar-agent-mcp/src/tools/thumbnail-glb.jsindex b9382c0bc..0735db98a 100644--- a/packages/avatar-agent-mcp/src/tools/thumbnail-glb.js+++ b/packages/avatar-agent-mcp/src/tools/thumbnail-glb.js@@ -15,6 +15,8 @@ import { renderGlbThumbnail } from '../lib/render.js';export const def = {name: 'thumbnail_glb',title: 'Render a GLB to a PNG thumbnail',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },description:'Render any public GLB URL to a PNG via three.ws\'s hosted three-light rig + auto-framing camera. Returns the PNG inline as a base64 data URL (≤ ~4 MB) plus dimensions. Background defaults to #0a0a0a — pass "transparent" for compositing.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/validate-glb.js b/packages/avatar-agent-mcp/src/tools/validate-glb.jsindex ca28bfcc6..bd7852f07 100644--- a/packages/avatar-agent-mcp/src/tools/validate-glb.js+++ b/packages/avatar-agent-mcp/src/tools/validate-glb.js@@ -30,6 +30,8 @@ function classify(messages = []) {export const def = {name: 'validate_glb',title: 'Validate a GLB / glTF against the Khronos spec',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },description:'Run the official Khronos gltf-validator against a GLB URL. Returns errors, warnings, infos, and hints with codes + JSON pointers, plus structural counts (animations, materials, etc.) per the validator\'s info report. The same engine that powers gltf.report.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/viewer-url.js b/packages/avatar-agent-mcp/src/tools/viewer-url.jsindex 005ca2fba..6f96e984d 100644--- a/packages/avatar-agent-mcp/src/tools/viewer-url.js+++ b/packages/avatar-agent-mcp/src/tools/viewer-url.js@@ -20,6 +20,8 @@ function escAttr(s) {export const def = {name: 'viewer_url',title: 'Build a three.ws viewer URL + embed snippet',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },description:'Build a shareable https://three.ws/viewer?... URL that opens any GLB in three.ws\'s WebGL viewer, plus a ready-to-paste iframe snippet. Supports background, auto-rotate, camera preset OR explicit camera orbit, AR mode (model-viewer), dimensions, pose, and accessory overlay. Accepts a raw glbUrl or a sessionId from spawn_avatar.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/wallet-balance.js b/packages/avatar-agent-mcp/src/tools/wallet-balance.jsindex 146e55abf..e341a133b 100644--- a/packages/avatar-agent-mcp/src/tools/wallet-balance.js+++ b/packages/avatar-agent-mcp/src/tools/wallet-balance.js@@ -9,6 +9,8 @@ import { SOLANA_RPC_URL } from '../config.js';export const def = {name: 'wallet_balance',title: 'Read Solana wallet balances (SOL + SPL tokens)',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: false, openWorldHint: true },description:'Return SOL balance and all SPL token balances (including Token-2022) for a Solana pubkey. Uses the configured SOLANA_RPC_URL. Read-only — no signer required.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/wallet-create.js b/packages/avatar-agent-mcp/src/tools/wallet-create.jsindex c0c60ed73..a0697d44b 100644--- a/packages/avatar-agent-mcp/src/tools/wallet-create.js+++ b/packages/avatar-agent-mcp/src/tools/wallet-create.js@@ -15,6 +15,8 @@ import { getSession, updateSession } from '../lib/avatars.js';export const def = {name: 'wallet_create',title: 'Create a Solana wallet (optionally vanity-grinded)',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },description:'Generate a Solana keypair locally. Optionally grind for a base58 prefix/suffix (e.g. "three") and/or attach it to an avatar session. Returns the base58 pubkey and secret ONCE — store the secret yourself; the MCP does not persist it.',inputSchema: {diff --git a/packages/avatar-agent-mcp/src/tools/wallet-send.js b/packages/avatar-agent-mcp/src/tools/wallet-send.jsindex e6756bbb9..ec418a4f7 100644--- a/packages/avatar-agent-mcp/src/tools/wallet-send.js+++ b/packages/avatar-agent-mcp/src/tools/wallet-send.js@@ -11,6 +11,8 @@ import { assertRecipientAllowed, confirmationGate } from '../lib/spend-policy.jsexport const def = {name: 'wallet_send',title: 'Send SOL on Solana mainnet',+ // MCP ToolAnnotations — EXECUTION: moves real value on Solana mainnet, irreversible.+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },description:'Send SOL from the configured signer to a destination pubkey. The signer is supplied via the `secret` arg (base58) or via SOLANA_SECRET_KEY env on the MCP server. Returns the confirmed signature and a Solscan link. EXECUTION ACTION — funds move on mainnet, irreversible: pass confirm:true. Capped by MAX_SOL_PER_TX; destination must be in RECIPIENT_ALLOWLIST if one is configured.',inputSchema: {diff --git a/packages/avatar-cli/package.json b/packages/avatar-cli/package.jsonindex 4c18a97d7..51e2dbcad 100644--- a/packages/avatar-cli/package.json+++ b/packages/avatar-cli/package.json@@ -36,7 +36,7 @@"test": "node --test test/*.test.js"},"dependencies": {- "@three-ws/avatar-schema": "0.1.0"+ "@three-ws/avatar-schema": "^0.2.0"},"engines": {"node": ">=18"diff --git a/packages/ibm-watsonx-mcp/server.json b/packages/ibm-watsonx-mcp/server.jsonindex 0f2751801..25d6bd528 100644--- a/packages/ibm-watsonx-mcp/server.json+++ b/packages/ibm-watsonx-mcp/server.json@@ -1,18 +1,27 @@{"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json","name": "io.github.nirholas/ibm-watsonx",+ "title": "IBM watsonx.ai Granite","description": "IBM watsonx.ai MCP by three.ws: chat, text generation, embeddings, and tokenization.",+ "websiteUrl": "https://three.ws",+ "icons": [+ {+ "src": "https://three.ws/three-ws-mcp-icon.svg",+ "mimeType": "image/svg+xml",+ "sizes": ["any"]+ }+ ],"repository": {"url": "https://github.com/nirholas/three.ws","source": "github","subfolder": "packages/ibm-watsonx-mcp"},- "version": "0.1.1",+ "version": "0.2.0","packages": [{"registryType": "npm","identifier": "@three-ws/ibm-watsonx-mcp",- "version": "0.1.1",+ "version": "0.2.0","transport": {"type": "stdio"},diff --git a/packages/ibm-watsonx-mcp/src/index.js b/packages/ibm-watsonx-mcp/src/index.jsindex 7cc37b5bd..2a55641a8 100755--- a/packages/ibm-watsonx-mcp/src/index.js+++ b/packages/ibm-watsonx-mcp/src/index.js@@ -20,6 +20,8 @@// Run standalone: WATSONX_API_KEY=... WATSONX_PROJECT_ID=... npx @three-ws/ibm-watsonx-mcp// Inspect: npx -y @modelcontextprotocol/inspector npx @three-ws/ibm-watsonx-mcp+import { createRequire } from 'node:module';+import { Server } from '@modelcontextprotocol/sdk/server/index.js';import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';import {@@ -31,7 +33,10 @@ import { loadConfig, WatsonxClient, WatsonxError } from './watsonx.js';import { buildTools } from './tools.js';const SERVER_NAME = 'three.ws-ibm-watsonx-mcp';-const SERVER_VERSION = '0.1.0';+// Single source of truth for the version — read from package.json so the+// MCP server identity can never drift from the published package version.+const require = createRequire(import.meta.url);+const SERVER_VERSION = require('../package.json').version;async function main() {// Fail fast and clearly if credentials are missing — the message names the@@ -57,7 +62,8 @@ async function main() {'IBM watsonx.ai tools powered by Granite foundation models. Use watsonx_chat ' +'for conversational completions, watsonx_generate for raw prompt completion with ' +'decoding control, watsonx_embed for embedding vectors, watsonx_tokenize to count ' +- 'tokens before a call, and watsonx_list_models to discover available models. ' ++ 'tokens before a call, watsonx_forecast for zero-shot time-series forecasting, ' ++ 'and watsonx_list_models to discover available models. ' +`Default model: ${config.chatModel}. All calls use your own IBM Cloud account.`,},);diff --git a/packages/ibm-watsonx-mcp/src/tools.js b/packages/ibm-watsonx-mcp/src/tools.jsindex 0becb37e8..992140a5d 100644--- a/packages/ibm-watsonx-mcp/src/tools.js+++ b/packages/ibm-watsonx-mcp/src/tools.js@@ -6,6 +6,22 @@// boundary) and let WatsonxError propagate — the server turns those into MCP// tool errors with the real upstream cause.+// MCP ToolAnnotations (behavior hints for clients). Every tool here is a pure+// model-inference call against an external service: nothing is modified+// (readOnlyHint) and the call leaves the local environment (openWorldHint).+// Generative tools may return different output for identical input; embedding,+// tokenization, and model listing are deterministic for a given account state.+const generativeAnnotations = {+ readOnlyHint: true,+ openWorldHint: true,+ idempotentHint: false,+};+const deterministicAnnotations = {+ readOnlyHint: true,+ openWorldHint: true,+ idempotentHint: true,+};+// Shared decoding parameters reused by chat and generate.const samplingProps = {max_tokens: {@@ -51,6 +67,8 @@ export function buildTools(client) {{definition: {name: 'watsonx_chat',+ title: 'Watsonx Chat',+ annotations: generativeAnnotations,description:'Chat completion with an IBM Granite (or other watsonx.ai) model. Pass a ' +'list of role/content messages and get the assistant reply plus token usage.',@@ -92,6 +110,8 @@ export function buildTools(client) {{definition: {name: 'watsonx_forecast',+ title: 'Watsonx Time-Series Forecast',+ annotations: generativeAnnotations,description:'Zero-shot time-series forecasting with an IBM Granite TimeSeries (TinyTimeMixer) ' +'model. Provide equal-length `timestamps` (ISO-8601, uniform cadence, oldest first) ' +@@ -155,6 +175,8 @@ export function buildTools(client) {{definition: {name: 'watsonx_generate',+ title: 'Watsonx Text Generation',+ annotations: generativeAnnotations,description:'Raw text generation from a single prompt (no chat templating). Use for ' +'completion-style tasks and fine decoding control via greedy or sampling.',@@ -196,6 +218,8 @@ export function buildTools(client) {{definition: {name: 'watsonx_embed',+ title: 'Watsonx Embeddings',+ annotations: deterministicAnnotations,description:'Generate embedding vectors for one or more texts using an IBM Granite ' +'embedding model. Returns one vector per input plus the vector dimensionality.',@@ -226,6 +250,8 @@ export function buildTools(client) {{definition: {name: 'watsonx_tokenize',+ title: 'Watsonx Tokenize',+ annotations: deterministicAnnotations,description:'Count tokens (and optionally return them) for a text against a model ' +'tokenizer. Use to budget context and cost before a generation call.',@@ -255,6 +281,8 @@ export function buildTools(client) {{definition: {name: 'watsonx_list_models',+ title: 'Watsonx Model Catalog',+ annotations: deterministicAnnotations,description:'List the foundation models available to your watsonx.ai account and region. ' +'Optionally filter by supported function, e.g. text_generation or embedding.',diff --git a/packages/ibm-x402-mcp/src/index.js b/packages/ibm-x402-mcp/src/index.jsindex 0430b8be0..5210d212a 100644--- a/packages/ibm-x402-mcp/src/index.js+++ b/packages/ibm-x402-mcp/src/index.js@@ -14,6 +14,7 @@// Inspect tools:// npx -y @modelcontextprotocol/inspector npx @three-ws/ibm-x402-mcp+import { createRequire } from 'node:module';import { pathToFileURL } from 'node:url';import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';@@ -28,6 +29,11 @@ import { buildGraniteAnalyzeTool } from './tools/granite-analyze.js';import { buildGraniteForecastTool } from './tools/granite-forecast.js';import { buildGettingStartedTool } from './tools/getting-started.js';+// Single source of truth for the version — read from package.json so the MCP+// server identity can never drift from the published package version.+const require = createRequire(import.meta.url);+const SERVER_VERSION = require('../package.json').version;+const SERVER_INSTRUCTIONS ='x402 pay-per-use IBM Granite AI tools from three.ws. Each tool lists its USDC price. ' +'New here? Call ibm_granite_getting_started (free, no payment) for an overview, prices, and the payment flow. ' +@@ -47,7 +53,7 @@ const SERVER_INSTRUCTIONS =*/export async function buildServer(client) {const server = new McpServer(- { name: 'ibm-x402-mcp', version: '1.0.0' },+ { name: 'ibm-x402-mcp', version: SERVER_VERSION },{capabilities: { tools: { listChanged: false } },instructions: SERVER_INSTRUCTIONS,@@ -66,7 +72,12 @@ export async function buildServer(client) {for (const t of tools) {server.registerTool(t.name,- { title: t.title, description: t.description, inputSchema: t.inputSchema },+ {+ title: t.title,+ description: t.description,+ inputSchema: t.inputSchema,+ annotations: t.annotations,+ },t.handler,);}diff --git a/packages/ibm-x402-mcp/src/tools/_shared.js b/packages/ibm-x402-mcp/src/tools/_shared.jsindex 9697a6192..f9a1d7bb2 100644--- a/packages/ibm-x402-mcp/src/tools/_shared.js+++ b/packages/ibm-x402-mcp/src/tools/_shared.js@@ -3,6 +3,23 @@ import { zodToJsonSchema } from 'zod-to-json-schema';export { toolError } from '../payments.js';+// MCP ToolAnnotations shared by the inference tools. Every tool is a pure+// model-inference call: nothing local is modified (readOnlyHint) and the call+// reaches external services — watsonx.ai and the x402 facilitator+// (openWorldHint). Generative tools can return different output for identical+// input; embeddings are deterministic for a given model.+export const generativeAnnotations = Object.freeze({+ readOnlyHint: true,+ openWorldHint: true,+ idempotentHint: false,+});++export const deterministicAnnotations = Object.freeze({+ readOnlyHint: true,+ openWorldHint: true,+ idempotentHint: true,+});+export function jsonSchemaFromZod(shape) {const schema = zodToJsonSchema(z.object(shape).strict(), {$refStrategy: 'none',diff --git a/packages/ibm-x402-mcp/src/tools/getting-started.js b/packages/ibm-x402-mcp/src/tools/getting-started.jsindex 83173876f..2808c596f 100644--- a/packages/ibm-x402-mcp/src/tools/getting-started.js+++ b/packages/ibm-x402-mcp/src/tools/getting-started.js@@ -6,8 +6,15 @@// like watsonx Orchestrate that aren't x402-capable — can call it to learn what// the server offers, what each tool costs, and how the payment flow works.+import { createRequire } from 'node:module';+import { z } from 'zod';+// Read the package version once so the payload can never drift from the+// published package version.+const require = createRequire(import.meta.url);+const PACKAGE_VERSION = require('../../package.json').version;+const TOOL_NAME = 'ibm_granite_getting_started';const TOOL_DESCRIPTION ='FREE — start here. Returns an overview of this server: the IBM Granite tools available, ' +@@ -93,7 +100,7 @@ function buildPayload(section) {const full = {ok: true,server: 'ibm-x402-mcp',- version: '1.0.0',+ version: PACKAGE_VERSION,overview,tools: TOOLS,pricing: TOOLS.map((t) => `${t.name}: ${t.price}/call`),@@ -164,6 +171,13 @@ export function buildGettingStartedTool() {name: TOOL_NAME,title: 'Getting Started (free)',description: TOOL_DESCRIPTION,+ // Static catalog content: read-only, fully deterministic, and answered+ // in-process — no external systems are contacted (closed world).+ annotations: {+ readOnlyHint: true,+ openWorldHint: false,+ idempotentHint: true,+ },inputSchema,handler,};diff --git a/packages/ibm-x402-mcp/src/tools/granite-analyze.js b/packages/ibm-x402-mcp/src/tools/granite-analyze.jsindex da9d72828..1631e9264 100644--- a/packages/ibm-x402-mcp/src/tools/granite-analyze.js+++ b/packages/ibm-x402-mcp/src/tools/granite-analyze.js@@ -6,7 +6,7 @@import { z } from 'zod';import { paid, toolError } from '../payments.js';-import { jsonSchemaFromZod } from './_shared.js';+import { jsonSchemaFromZod, generativeAnnotations } from './_shared.js';import { WatsonxError } from '../watsonx.js';const TOOL_NAME = 'ibm_granite_analyze';@@ -164,6 +164,7 @@ export async function buildGraniteAnalyzeTool(client) {name: TOOL_NAME,title: 'IBM Granite Analyze ($0.04)',description: TOOL_DESCRIPTION,+ annotations: generativeAnnotations,inputSchema: inputZodShape,handler,};diff --git a/packages/ibm-x402-mcp/src/tools/granite-chat.js b/packages/ibm-x402-mcp/src/tools/granite-chat.jsindex e61e149d3..4652a4836 100644--- a/packages/ibm-x402-mcp/src/tools/granite-chat.js+++ b/packages/ibm-x402-mcp/src/tools/granite-chat.js@@ -5,7 +5,7 @@import { z } from 'zod';import { paid, toolError } from '../payments.js';-import { jsonSchemaFromZod } from './_shared.js';+import { jsonSchemaFromZod, generativeAnnotations } from './_shared.js';import { WatsonxError } from '../watsonx.js';const TOOL_NAME = 'ibm_granite_chat';@@ -89,6 +89,7 @@ export async function buildGraniteChatTool(client) {name: TOOL_NAME,title: 'IBM Granite Chat ($0.02)',description: TOOL_DESCRIPTION,+ annotations: generativeAnnotations,inputSchema: inputZodShape,handler,};diff --git a/packages/ibm-x402-mcp/src/tools/granite-code.js b/packages/ibm-x402-mcp/src/tools/granite-code.jsindex 7d7b6e980..bc7e4a00d 100644--- a/packages/ibm-x402-mcp/src/tools/granite-code.js+++ b/packages/ibm-x402-mcp/src/tools/granite-code.js@@ -5,7 +5,7 @@import { z } from 'zod';import { paid, toolError } from '../payments.js';-import { jsonSchemaFromZod } from './_shared.js';+import { jsonSchemaFromZod, generativeAnnotations } from './_shared.js';import { WatsonxError } from '../watsonx.js';const TOOL_NAME = 'ibm_granite_code';@@ -111,6 +111,7 @@ export async function buildGraniteCodeTool(client) {name: TOOL_NAME,title: 'IBM Granite Code ($0.025)',description: TOOL_DESCRIPTION,+ annotations: generativeAnnotations,inputSchema: inputZodShape,handler,};diff --git a/packages/ibm-x402-mcp/src/tools/granite-embed.js b/packages/ibm-x402-mcp/src/tools/granite-embed.jsindex d7753c184..95dff49cb 100644--- a/packages/ibm-x402-mcp/src/tools/granite-embed.js+++ b/packages/ibm-x402-mcp/src/tools/granite-embed.js@@ -6,7 +6,7 @@import { z } from 'zod';import { paid, toolError } from '../payments.js';-import { jsonSchemaFromZod } from './_shared.js';+import { jsonSchemaFromZod, deterministicAnnotations } from './_shared.js';import { WatsonxError } from '../watsonx.js';const TOOL_NAME = 'ibm_granite_embed';@@ -67,6 +67,7 @@ export async function buildGraniteEmbedTool(client) {name: TOOL_NAME,title: 'IBM Granite Embed ($0.005)',description: TOOL_DESCRIPTION,+ annotations: deterministicAnnotations,inputSchema: inputZodShape,handler,};diff --git a/packages/ibm-x402-mcp/src/tools/granite-forecast.js b/packages/ibm-x402-mcp/src/tools/granite-forecast.jsindex 9d86420ae..1cdc4d260 100644--- a/packages/ibm-x402-mcp/src/tools/granite-forecast.js+++ b/packages/ibm-x402-mcp/src/tools/granite-forecast.js@@ -6,7 +6,7 @@import { z } from 'zod';import { paid, toolError } from '../payments.js';-import { jsonSchemaFromZod } from './_shared.js';+import { jsonSchemaFromZod, generativeAnnotations } from './_shared.js';import { WatsonxError } from '../watsonx.js';const TOOL_NAME = 'ibm_granite_forecast';@@ -124,6 +124,7 @@ export async function buildGraniteForecastTool(client) {name: TOOL_NAME,title: 'IBM Granite Forecast ($0.05)',description: TOOL_DESCRIPTION,+ annotations: generativeAnnotations,inputSchema: inputZodShape,handler,};diff --git a/packages/pumpfun-mcp/server.json b/packages/pumpfun-mcp/server.jsonindex a1bdb7257..e73da7aff 100644--- a/packages/pumpfun-mcp/server.json+++ b/packages/pumpfun-mcp/server.json@@ -1,18 +1,27 @@{"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json","name": "io.github.nirholas/pumpfun-solana-mcp",+ "title": "pump.fun Solana Data","description": "Free, read-only pump.fun + Solana MCP server: token discovery, on-chain bonding-curve & holder analysis, creator fee-claim tracking, SNS name resolution, KOL radar/leaderboard signals, read-only swap quotes, and live 3D token snapshots (coin medallion + holder galaxy + graduation ring via three.ws/coin3d). No API keys required.",+ "websiteUrl": "https://three.ws",+ "icons": [+ {+ "src": "https://three.ws/three-ws-mcp-icon.svg",+ "mimeType": "image/svg+xml",+ "sizes": ["any"]+ }+ ],"repository": {"url": "https://github.com/nirholas/three.ws","source": "github","subfolder": "packages/pumpfun-mcp"},- "version": "0.1.0",+ "version": "0.2.0","packages": [{"registryType": "npm","identifier": "@three-ws/pumpfun-mcp",- "version": "0.1.0",+ "version": "0.2.0","transport": {"type": "stdio"},diff --git a/packages/pumpfun-mcp/src/index.js b/packages/pumpfun-mcp/src/index.jsindex 183b389c8..78d8b04e5 100755--- a/packages/pumpfun-mcp/src/index.js+++ b/packages/pumpfun-mcp/src/index.js@@ -16,16 +16,20 @@// Run standalone: npx @three-ws/pumpfun-mcp// Inspect: npx -y @modelcontextprotocol/inspector npx @three-ws/pumpfun-mcp+import { createRequire } from 'node:module';+import { Server } from '@modelcontextprotocol/sdk/server/index.js';import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';import { ListToolsRequestSchema, CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';-import { FALLBACK_TOOLS } from './tools.js';+import { FALLBACK_TOOLS, TOOL_ANNOTATIONS } from './tools.js';import { buildNativeRegistry } from './native.js';+const require = createRequire(import.meta.url);+const { version: SERVER_VERSION } = require('../package.json');+const BACKEND_URL = process.env.PUMPFUN_MCP_URL || 'https://three.ws/api/pump-fun-mcp';const SERVER_NAME = 'three.ws-pumpfun-mcp';-const SERVER_VERSION = '0.1.0';// A monotonically increasing JSON-RPC id for backend calls. Local to this// process; the backend is stateless so any unique id works.@@ -82,10 +86,24 @@ async function callTool(name, args) {return env?.result?.structuredContent ?? null;}+// Overlay the vendored title + ToolAnnotations onto a tool definition loaded+// from the backend. An up-to-date backend already ships both (its values win);+// an older deployed backend gets them filled in locally so clients always see+// read-only/idempotency hints.+function withLocalAnnotations(tool) {+ const local = TOOL_ANNOTATIONS[tool?.name];+ if (!local) return tool;+ return {+ ...tool,+ title: tool.title ?? local.title,+ annotations: tool.annotations ?? local,+ };+}+async function main() {const backendTools = await loadTools();const native = buildNativeRegistry(BACKEND_URL, callTool);- const tools = [...backendTools, ...native.defs];+ const tools = [...backendTools.map(withLocalAnnotations), ...native.defs];const server = new Server({ name: SERVER_NAME, version: SERVER_VERSION },diff --git a/packages/pumpfun-mcp/src/native.js b/packages/pumpfun-mcp/src/native.jsindex 192696797..39814d603 100644--- a/packages/pumpfun-mcp/src/native.js+++ b/packages/pumpfun-mcp/src/native.js@@ -127,6 +127,16 @@ export const NATIVE_TOOLS = [{def: {name: 'pumpfun_token_3d',+ title: 'Token 3D Snapshot',+ annotations: {+ // Composes live on-chain reads (metadata, curve, holders) — a+ // read-only, non-idempotent, open-world tool like its sources.+ title: 'Token 3D Snapshot',+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+ },description:'Live 3D snapshot of a pump.fun / Solana token. Composes on-chain token metadata, bonding-curve graduation progress, and top-holder distribution, and returns a shareable three.ws /coin3d viewer deep-link (a spinning coin medallion textured with the token logo, a holder galaxy, and a graduation ring) plus an embeddable iframe and the underlying data. Read-only, free.',inputSchema: {diff --git a/packages/pumpfun-mcp/src/tools.js b/packages/pumpfun-mcp/src/tools.jsindex 33594a8cb..ba67183c2 100644--- a/packages/pumpfun-mcp/src/tools.js+++ b/packages/pumpfun-mcp/src/tools.js@@ -6,6 +6,72 @@// correct tool surface offline. Keep in sync with src/pump/mcp-tools.js in the// three.ws repo — that file is the source of truth.+// ── MCP ToolAnnotations (readOnlyHint/destructiveHint/idempotentHint/+// openWorldHint). Every tool on this surface is read-only — nothing signs or+// sends a transaction. destructiveHint defaults to TRUE in the spec when+// omitted, so it is set explicitly everywhere.+//+// LIVE_READ live-market / on-chain read: same call can return new+// data, talks to external systems.+// DETERMINISTIC_READ external read whose answer is stable for the same args+// (name-service lookups).+// LOCAL_DETERMINISTIC pure in-process computation, stable output (lexicon+// sentiment scoring).+// LOCAL_GENERATIVE pure in-process computation, fresh output each call+// (vanity keypair grind).+const LIVE_READ = Object.freeze({+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+});+const DETERMINISTIC_READ = Object.freeze({+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: true,+ openWorldHint: true,+});+const LOCAL_DETERMINISTIC = Object.freeze({+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: true,+ openWorldHint: false,+});+const LOCAL_GENERATIVE = Object.freeze({+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: false,+});++// name → { title, ...ToolAnnotations }. Stamped onto FALLBACK_TOOLS below and+// overlaid by src/index.js onto whatever tool list loads from the backend, so+// annotations render even against an older deployed backend.+export const TOOL_ANNOTATIONS = Object.freeze({+ searchTokens: { title: 'Search Tokens', ...LIVE_READ },+ getTokenDetails: { title: 'Token Details', ...LIVE_READ },+ getBondingCurve: { title: 'Bonding Curve', ...LIVE_READ },+ getTokenTrades: { title: 'Token Trades', ...LIVE_READ },+ getTrendingTokens: { title: 'Trending Tokens', ...LIVE_READ },+ getNewTokens: { title: 'New Tokens', ...LIVE_READ },+ getGraduatedTokens: { title: 'Graduated Tokens', ...LIVE_READ },+ getKingOfTheHill: { title: 'King of the Hill', ...LIVE_READ },+ kol_radar: { title: 'KOL Radar', ...LIVE_READ },+ getCreatorProfile: { title: 'Creator Profile', ...LIVE_READ },+ getTokenHolders: { title: 'Token Holders', ...LIVE_READ },+ pumpfun_vanity_mint: { title: 'Vanity Mint Keypair', ...LOCAL_GENERATIVE },+ pumpfun_watch_whales: { title: 'Watch Whale Trades', ...LIVE_READ },+ pumpfun_list_claims: { title: 'List Creator Fee Claims', ...LIVE_READ },+ pumpfun_watch_claims: { title: 'Watch Creator Fee Claims', ...LIVE_READ },+ pumpfun_first_claims: { title: 'First Creator Fee Claims', ...LIVE_READ },+ sns_resolve: { title: 'Resolve .sol Domain', ...DETERMINISTIC_READ },+ sns_reverseLookup: { title: 'Reverse .sol Lookup', ...DETERMINISTIC_READ },+ social_cashtag_sentiment: { title: 'Cashtag Sentiment', ...LOCAL_DETERMINISTIC },+ kol_leaderboard: { title: 'KOL Leaderboard', ...LIVE_READ },+ pumpfun_quote_swap: { title: 'Swap Quote (Read-Only)', ...LIVE_READ },+ social_x_post_impact: { title: 'X Post Price Impact', ...LIVE_READ },+});+export const FALLBACK_TOOLS = [{name: 'searchTokens',@@ -314,3 +380,13 @@ export const FALLBACK_TOOLS = [},},];++// Stamp title + annotations onto every fallback tool from the map above. The+// package test asserts full coverage so a new tool can't ship un-annotated.+for (const tool of FALLBACK_TOOLS) {+ const annotations = TOOL_ANNOTATIONS[tool.name];+ if (annotations) {+ tool.title = annotations.title;+ tool.annotations = annotations;+ }+}diff --git a/packages/three-token-mcp/src/tools/three-balance.js b/packages/three-token-mcp/src/tools/three-balance.jsindex 0daf91331..a4bbac9f2 100644--- a/packages/three-token-mcp/src/tools/three-balance.js+++ b/packages/three-token-mcp/src/tools/three-balance.js@@ -9,6 +9,8 @@ import { resolveMint } from '../lib/token.js';export const def = {name: 'three_balance',title: "Read a wallet's $THREE + SOL balance",+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: false, openWorldHint: true },description:'Return the $THREE and SOL balance for a Solana pubkey. If no pubkey is given, uses the configured signer (SOLANA_SECRET_KEY). Read-only — no payment.',inputSchema: {diff --git a/packages/three-token-mcp/src/tools/three-burn.js b/packages/three-token-mcp/src/tools/three-burn.jsindex 65c4dc127..20e23f5ef 100644--- a/packages/three-token-mcp/src/tools/three-burn.js+++ b/packages/three-token-mcp/src/tools/three-burn.js@@ -10,6 +10,8 @@ import { REQUIRE_CONFIRM } from '../config.js';export const def = {name: 'three_burn',title: 'Burn $THREE on-chain (incinerator + treasury split)',+ // MCP ToolAnnotations — EXECUTION: moves real value on Solana mainnet, irreversible.+ annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },description:'Burn a USD-denominated amount of the $THREE your wallet holds. Quotes USD→$THREE via Jupiter, then sends ONE Solana transaction that splits it between the incinerator (burn) and the three.ws treasury, per the live public token config. EXECUTION ACTION — signs and broadcasts on Solana mainnet, IRREVERSIBLE: pass confirm:true. Capped by MAX_BURN_USD. The resolved mint is asserted to be canonical $THREE before signing. Requires a signer (SOLANA_SECRET_KEY env or the `secret` arg) holding enough $THREE. Returns the tx signature, the burned/treasury breakdown, and a Solscan link.',inputSchema: {diff --git a/packages/three-token-mcp/src/tools/three-price.js b/packages/three-token-mcp/src/tools/three-price.jsindex 692f2f96e..cb4fe03f2 100644--- a/packages/three-token-mcp/src/tools/three-price.js+++ b/packages/three-token-mcp/src/tools/three-price.js@@ -8,6 +8,8 @@ import { fetchTokenPrice } from '../lib/token.js';export const def = {name: 'three_price',title: 'Live $THREE price (Jupiter) + USD→$THREE quote',+ // MCP ToolAnnotations — safety hints surfaced to MCP clients.+ annotations: { readOnlyHint: true, idempotentHint: false, openWorldHint: true },description:'Return the live USD price of $THREE (Jupiter primary, Birdeye fallback). Pass `usd` to also get how much $THREE that amount buys (token amount + atomic units). Read-only — no signer or payment required.',inputSchema: {diff --git a/packages/threews-avatar-mcp/README.md b/packages/threews-avatar-mcp/README.mdindex c9261bb45..b311159d4 100644--- a/packages/threews-avatar-mcp/README.md+++ b/packages/threews-avatar-mcp/README.md@@ -1,5 +1,9 @@# @three-ws/avatar-mcp+[](https://www.npmjs.com/package/@three-ws/avatar-mcp)+[](./LICENSE)+[](https://registry.modelcontextprotocol.io/?q=io.github.nirholas)+An [MCP](https://modelcontextprotocol.io) server that drops a **live three.ws 3D avatar** into any MCP client — Claude Desktop, Claude Code, Cursor, or any other host. Render a rotatable avatar inline, get a paste-anywhere embed iframe, or fetch avatar metadata.It's a thin, **zero-config, read-only** bridge to the real three.ws endpoints. Public and unlisted avatars need **no API key**. No mock data — every tool reads live from three.ws.@@ -14,14 +18,24 @@ It's a thin, **zero-config, read-only** bridge to the real three.ws endpoints. P| `avatar_embed_code` | A ready-to-paste `<iframe>` that embeds the live avatar anywhere — as easy as a YouTube embed. || `get_avatar` | Avatar metadata: name, GLB model url, owner, visibility. |-### Interactive 3D in the chat (MCP Apps)+All three tools are read-only and annotated as such (`readOnlyHint`, `idempotentHint`, `openWorldHint`) so hosts can run them without confirmation prompts.++### Interactive 3D in the chat (MCP Apps) — the differentiator-`render_avatar` is an [MCP App](https://modelcontextprotocol.io/extensions/apps/overview) (SEP-1865): it declares a `ui://` resource that supporting hosts render in a sandboxed iframe — a real, orbit-and-zoom `<model-viewer>`, not a static image. Hosts without MCP Apps support still get a rendered preview image and a one-tap live embed, so the tool degrades gracefully everywhere.+`render_avatar` is an [MCP App](https://modelcontextprotocol.io/extensions/apps/overview) (SEP-1865): it declares a `ui://` resource that supporting hosts render in a sandboxed iframe — a real, orbit-and-zoom `<model-viewer>`, not a static image. The avatar is **live in the conversation**: rotate it, zoom it, watch it idle, all without leaving the chat. Hosts without MCP Apps support still get a rendered preview image and a one-tap live embed, so the tool degrades gracefully everywhere.Identify an avatar three ways: by **`id`** (UUID), by **`@handle`** (username), or by a raw **`model`** GLB url.## Use with Claude Desktop / Claude Code / Cursor+Claude Code, one line:++```bash+claude mcp add threews-avatar -- npx -y @three-ws/avatar-mcp+```++Claude Desktop / Cursor (JSON config):+```json{"mcpServers": {diff --git a/packages/threews-avatar-mcp/package.json b/packages/threews-avatar-mcp/package.jsonindex cdb9c40ff..7e0ddd002 100644--- a/packages/threews-avatar-mcp/package.json+++ b/packages/threews-avatar-mcp/package.json@@ -49,6 +49,7 @@"scripts": {"build": "node app/build.mjs","start": "node src/index.js",+ "test": "node --test","inspect": "npx -y @modelcontextprotocol/inspector node src/index.js"},"dependencies": {diff --git a/packages/threews-avatar-mcp/server.json b/packages/threews-avatar-mcp/server.jsonindex ac9576706..4573341df 100644--- a/packages/threews-avatar-mcp/server.json+++ b/packages/threews-avatar-mcp/server.json@@ -1,18 +1,27 @@{"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json","name": "io.github.nirholas/threews-avatar",+ "title": "three.ws Avatars","description": "three.ws 3D avatars in your agent: render a live, interactive 3D avatar inline, or get an embed.",+ "websiteUrl": "https://three.ws",+ "icons": [+ {+ "src": "https://three.ws/three-ws-mcp-icon.svg",+ "mimeType": "image/svg+xml",+ "sizes": ["any"]+ }+ ],"repository": {"url": "https://github.com/nirholas/three.ws","source": "github","subfolder": "packages/threews-avatar-mcp"},- "version": "0.2.0",+ "version": "0.3.0","packages": [{"registryType": "npm","identifier": "@three-ws/avatar-mcp",- "version": "0.2.0",+ "version": "0.3.0","transport": {"type": "stdio"},diff --git a/packages/threews-avatar-mcp/src/index.js b/packages/threews-avatar-mcp/src/index.jsindex 251de087e..6156522a7 100755--- a/packages/threews-avatar-mcp/src/index.js+++ b/packages/threews-avatar-mcp/src/index.js@@ -13,6 +13,8 @@// Run standalone: npx @three-ws/avatar-mcp// Inspect: npx -y @modelcontextprotocol/inspector npx @three-ws/avatar-mcp+import { createRequire } from 'node:module';+import { Server } from '@modelcontextprotocol/sdk/server/index.js';import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';import {@@ -26,8 +28,10 @@ import { buildTools } from './tools.js';import { baseUrl, ThreewsError } from './threews.js';import { UI_RESOURCE_URI, UI_MIME_TYPE, UI_RESOURCE_META, loadAppHtml } from './ui.js';+const require = createRequire(import.meta.url);+const { version: SERVER_VERSION } = require('../package.json');+const SERVER_NAME = 'three.ws-avatar-mcp';-const SERVER_VERSION = '0.2.0';async function main() {const tools = buildTools();diff --git a/packages/threews-avatar-mcp/src/tools.js b/packages/threews-avatar-mcp/src/tools.jsindex 78ddc6dc3..ac7a759d9 100644--- a/packages/threews-avatar-mcp/src/tools.js+++ b/packages/threews-avatar-mcp/src/tools.js@@ -19,6 +19,14 @@ import {} from './threews.js';import { UI_TOOL_META } from './ui.js';+// Every tool is a read of three.ws state over the network: no writes, no side+// effects, and the same avatar state always yields the same result.+const READ_ONLY_ANNOTATIONS = {+ readOnlyHint: true,+ openWorldHint: true,+ idempotentHint: true,+};+// One of these three selectors identifies an avatar across every tool.const selectorProps = {id: { type: 'string', description: 'Avatar UUID (from a three.ws avatar URL or get_avatar).' },@@ -35,6 +43,8 @@ export function buildTools() {{definition: {name: 'render_avatar',+ title: 'Render 3D avatar',+ annotations: READ_ONLY_ANNOTATIONS,description:'Render a three.ws 3D avatar inline: shows an interactive (rotatable) 3D model ' +'in the chat, plus a preview image and a ready-to-embed live URL. Identify the ' +@@ -135,6 +145,8 @@ export function buildTools() {{definition: {name: 'avatar_embed_code',+ title: 'Get avatar embed code',+ annotations: READ_ONLY_ANNOTATIONS,description:'Get a ready-to-paste iframe that embeds a live, interactive three.ws 3D avatar ' +'into any website or app — as easy as embedding a YouTube video.',@@ -174,6 +186,8 @@ export function buildTools() {{definition: {name: 'get_avatar',+ title: 'Get avatar metadata',+ annotations: READ_ONLY_ANNOTATIONS,description:'Fetch metadata for a three.ws avatar (name, GLB model url, owner, visibility) by id or @handle.',inputSchema: {diff --git a/packages/threews-avatar-mcp/test/tools.test.mjs b/packages/threews-avatar-mcp/test/tools.test.mjsnew file mode 100644index 000000000..e90dd929a--- /dev/null+++ b/packages/threews-avatar-mcp/test/tools.test.mjs@@ -0,0 +1,55 @@+// Smoke test: the tool surface enumerates correctly without secrets or network.+//+// Asserts the three tools exist with unique names, real descriptions, MCP+// ToolAnnotations (read-only), human titles, and that render_avatar declares+// its MCP Apps ui:// resource (SEP-1865) via _meta.ui.resourceUri.++import test from 'node:test';+import assert from 'node:assert/strict';++import { buildTools } from '../src/tools.js';+import { UI_RESOURCE_URI, UI_MIME_TYPE, UI_RESOURCE_META } from '../src/ui.js';++const EXPECTED_TOOLS = ['render_avatar', 'avatar_embed_code', 'get_avatar'];++test('enumerates exactly the three avatar tools with unique names', () => {+ const tools = buildTools();+ assert.equal(tools.length, 3);+ const names = tools.map((t) => t.definition.name);+ assert.deepEqual([...new Set(names)].sort(), [...EXPECTED_TOOLS].sort());+});++test('every tool has a title, description, input schema, and handler', () => {+ for (const tool of buildTools()) {+ const def = tool.definition;+ assert.equal(typeof def.title, 'string', `${def.name} missing title`);+ assert.ok(def.title.length > 0, `${def.name} empty title`);+ assert.equal(typeof def.description, 'string', `${def.name} missing description`);+ assert.ok(def.description.length >= 20, `${def.name} description too short`);+ assert.equal(def.inputSchema?.type, 'object', `${def.name} missing object inputSchema`);+ assert.equal(typeof tool.handler, 'function', `${def.name} missing handler`);+ }+});++test('every tool is annotated read-only, idempotent, open-world', () => {+ for (const tool of buildTools()) {+ const { name, annotations } = tool.definition;+ assert.ok(annotations, `${name} missing annotations`);+ assert.equal(annotations.readOnlyHint, true, `${name} readOnlyHint`);+ assert.equal(annotations.idempotentHint, true, `${name} idempotentHint`);+ assert.equal(annotations.openWorldHint, true, `${name} openWorldHint`);+ }+});++test('render_avatar declares the MCP Apps ui:// resource', () => {+ const renderAvatar = buildTools().find((t) => t.definition.name === 'render_avatar');+ assert.ok(renderAvatar, 'render_avatar tool not found');+ assert.equal(renderAvatar.definition._meta?.ui?.resourceUri, UI_RESOURCE_URI);+ assert.match(UI_RESOURCE_URI, /^ui:\/\//, 'UI resource must use the ui:// scheme');+ assert.equal(UI_MIME_TYPE, 'text/html;profile=mcp-app');+ assert.ok(+ Array.isArray(UI_RESOURCE_META.ui?.csp?.resourceDomains) &&+ UI_RESOURCE_META.ui.csp.resourceDomains.length > 0,+ 'UI resource must carry a CSP grant',+ );+});diff --git a/packages/viewer-presets/LICENSE b/packages/viewer-presets/LICENSEnew file mode 100644index 000000000..8e2251ab4--- /dev/null+++ b/packages/viewer-presets/LICENSE@@ -0,0 +1,180 @@+ Apache License+ Version 2.0, January 2004+ http://www.apache.org/licenses/++ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION++ 1. Definitions.++ "License" shall mean the terms and conditions for use, reproduction,+ and distribution as defined by Sections 1 through 9 of this document.++ "Licensor" shall mean the copyright owner or entity authorized by+ the copyright owner that is granting the License.++ "Legal Entity" shall mean the union of the acting entity and all+ other entities that control, are controlled by, or are under common+ control with that entity. For the purposes of this definition,+ "control" means (i) the power, direct or indirect, to cause the+ direction or management of such entity, whether by contract or+ otherwise, or (ii) ownership of fifty percent (50%) or more of the+ outstanding shares, or (iii) beneficial ownership of such entity.++ "You" (or "Your") shall mean an individual or Legal Entity+ exercising permissions granted by this License.++ "Source" form shall mean the preferred form for making modifications,+ including but not limited to software source code, documentation+ source, and configuration files.++ "Object" form shall mean any form resulting from mechanical+ transformation or translation of a Source form, including but+ not limited to compiled object code, generated documentation,+ and conversions to other media types.++ "Work" shall mean the work of authorship made available under+ the License, as indicated by a copyright notice that is included in+ or attached to the work (an example is provided in the Appendix below).++ "Derivative Works" shall mean any work, whether in Source or Object+ form, that is based on (or derived from) the Work and for which the+ editorial revisions, annotations, elaborations, or other transformations+ represent, as a whole, an original work of authorship. For the purposes+ of this License, Derivative Works shall not include works that remain+ separable from, or merely link (or bind by name) to the interfaces of,+ the Work and Derivative Works thereof.++ "Contribution" shall mean, as submitted to the Licensor for inclusion+ in the Work by the copyright owner or by an individual or Legal Entity+ authorized to submit on behalf of the copyright owner. For the purposes+ of this definition, "submitted" means any form of electronic, verbal,+ or written communication sent to the Licensor or its representatives,+ including but not limited to communication on electronic mailing lists,+ source code control systems, and issue tracking systems that are managed+ by, or on behalf of, the Licensor for the purpose of discussing and+ improving the Work, but excluding communication that is conspicuously+ marked or designated in writing by the copyright owner as "Not a+ Contribution."++ "Contributor" shall mean Licensor and any Legal Entity on behalf of+ whom a Contribution has been received by the Licensor and included+ within the Work.++ 2. Grant of Copyright License. Subject to the terms and conditions of+ this License, each Contributor hereby grants to You a perpetual,+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable+ copyright license to reproduce, prepare Derivative Works of,+ publicly display, publicly perform, sublicense, and distribute the+ Work and such Derivative Works in Source or Object form.++ 3. Grant of Patent License. Subject to the terms and conditions of+ this License, each Contributor hereby grants to You a perpetual,+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable+ (except as stated in this section) patent license to make, have made,+ use, offer to sell, sell, import, and otherwise transfer the Work,+ where such license applies only to those patent claims licensable+ by such Contributor that are necessarily infringed by their+ Contribution(s) alone or by the combination of their Contribution(s)+ with the Work to which such Contribution(s) was submitted. If You+ institute patent litigation against any entity (including a cross-claim+ or counterclaim in a lawsuit) alleging that the Work or any+ Contribution embodied within the Work constitutes direct or contributory+ patent infringement, then any patent licenses granted to You under+ this License for that Work shall terminate as of the date such+ litigation is filed.++ 4. Redistribution. You may reproduce and distribute copies of the+ Work or Derivative Works thereof in any medium, with or without+ modifications, and in Source or Object form, provided that You+ meet the following conditions:++ (a) You must give any other recipients of the Work or Derivative+ Works a copy of this License; and++ (b) You must cause any modified files to carry prominent notices+ stating that You changed the files; and++ (c) You must retain, in the Source form of any Derivative Works+ that You distribute, all copyright, patent, trademark, and+ attribution notices from the Source form of the Work,+ excluding those notices that do not pertain to any part of+ the Derivative Works; and++ (d) If the Work includes a "NOTICE" text file as part of its+ distribution, You must include a readable copy of the+ attribution notices contained within such NOTICE file, in+ at least one of the following places: within a NOTICE text+ file distributed as part of the Derivative Works; within+ the Source form or documentation, if provided along with the+ Derivative Works; or, within a display generated by the+ Derivative Works, if and wherever such third-party notices+ normally appear. The contents of the NOTICE file are for+ informational purposes only and do not modify the License.+ You may add Your own attribution notices within Derivative+ Works that You distribute, alongside or in addition to the+ NOTICE text from the Work, provided that such additional+ attribution notices cannot be construed as modifying the License.++ You may add Your own license statement for Your modifications and+ may provide additional grant of rights to use, copy, modify, merge,+ publish, distribute, sublicense, and/or sell copies of the+ Derivative Works, and to permit persons to whom the Derivative Works+ are furnished to do so.++ 5. Submission of Contributions. Unless You explicitly state otherwise,+ any Contribution intentionally submitted for inclusion in the Work+ by You to the Licensor shall be under the terms and conditions of+ this License, without any additional terms or conditions.+ Notwithstanding the above, nothing herein shall supersede or modify+ the terms of any separate license agreement you may have executed+ with Licensor regarding such Contributions.++ 6. Trademarks. This License does not grant permission to use the trade+ names, trademarks, service marks, or product names of the Licensor,+ except as required for reasonable and customary use in describing the+ origin of the Work and reproducing the content of the NOTICE file.++ 7. Disclaimer of Warranty. Unless required by applicable law or+ agreed to in writing, Licensor provides the Work (and each+ Contributor provides its Contributions) on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or+ implied, including, without limitation, any warranties or conditions+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A+ PARTICULAR PURPOSE. You are solely responsible for determining the+ appropriateness of using or reproducing the Work and assume any+ risks associated with Your exercise of permissions under this License.++ 8. Limitation of Liability. In no event and under no legal theory,+ whether in tort (including negligence), contract, or otherwise,+ unless required by applicable law (such as deliberate and grossly+ negligent acts) or agreed to in writing, shall any Contributor be+ liable to You for damages, including any direct, indirect, special,+ incidental, or exemplary damages of any character arising as a+ result of this License or out of the use or inability to use the+ Work (including but not limited to damages for loss of goodwill,+ work stoppage, computer failure or malfunction, or all other+ commercial damages or losses), even if such Contributor has been+ advised of the possibility of such damages.++ 9. Accepting Warranty or Additional Liability. While redistributing+ the Work or Derivative Works thereof, You may choose to offer,+ and charge a fee for, acceptance of support, warranty, indemnity,+ or other liability obligations and/or rights consistent with this+ License. However, in accepting such obligations, You may offer only+ conditions consistent with this License.++ END OF TERMS AND CONDITIONS++ Copyright 2026 nirholas++ Licensed under the Apache License, Version 2.0 (the "License");+ you may not use this file except in compliance with the License.+ You may obtain a copy of the License at++ http://www.apache.org/licenses/LICENSE-2.0++ Unless required by applicable law or agreed to in writing, software+ distributed under the License is distributed on an "AS IS" BASIS,+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ See the License for the specific language governing permissions and+ limitations under the License.diff --git a/packages/viewer-presets/NOTICE b/packages/viewer-presets/NOTICEnew file mode 100644index 000000000..200fc4d4d--- /dev/null+++ b/packages/viewer-presets/NOTICE@@ -0,0 +1,12 @@+@three-ws/viewer-presets+Copyright (c) 2026 three.ws++This product includes visual preset values (light rig intensities, tone-mapping,+floor reflection, and bloom configuration) derived from the open-source "visage"+viewer by Ready Player Me, used under the MIT License.++ Ready Player Me visage — https://github.com/readyplayerme/visage+ Copyright (c) Ready Player Me — MIT License++The derived preset values have been re-tuned for three.ws avatar viewers. This+package is distributed under the Apache License, Version 2.0; see LICENSE.diff --git a/pages/forge.html b/pages/forge.htmlindex 0d0723af7..f222c2756 100644--- a/pages/forge.html+++ b/pages/forge.html@@ -1665,127 +1665,12 @@.hint-foot a {color: var(--ink);}-- /* ── Refinements ─────────────────────────────────────────────────- Hero glow, composer focus + drop affordances, tier sublabels.- Pure presentation + discoverability over the existing real-async- flow — no fabricated progress. */- .forge-main {- position: relative;- }- .forge-aurora {- position: absolute;- inset: -8% -18% auto -18%;- height: 440px;- z-index: -1;- pointer-events: none;- background:- radial-gradient(- 38% 60% at 32% 18%,- color-mix(in srgb, var(--accent) 16%, transparent),- transparent 70%- ),- radial-gradient(- 44% 56% at 74% 8%,- color-mix(in srgb, var(--accent) 11%, transparent),- transparent 72%- );- filter: blur(40px);- opacity: 0.75;- animation: forge-aurora-drift 19s ease-in-out infinite alternate;- }- @keyframes forge-aurora-drift {- from {- transform: translate3d(-2%, 0, 0) scale(1);- }- to {- transform: translate3d(3%, -3%, 0) scale(1.06);- }- }-- /* Composer hosts the drop overlay and lifts on focus so the active- field reads as the focal point. */- .composer {- position: relative;- transition:- border-color 0.18s ease,- box-shadow 0.18s ease;- }- .composer:focus-within {- border-color: var(--stroke-strong);- box-shadow:- 0 24px 60px -30px rgba(0, 0, 0, 0.8),- 0 0 0 1px var(--accent-soft);- }-- /* Tier sublabels — compare the time/output trade-off without clicking. */- #tier button {- display: inline-flex;- flex-direction: column;- align-items: center;- gap: 1px;- line-height: 1.15;- }- #tier button .tier-sub {- font-family: var(--font-mono);- font-size: 0.56rem;- letter-spacing: 0.02em;- color: var(--ink-dim);- font-weight: 400;- }- #tier button[aria-pressed='true'] .tier-sub {- color: var(--ink);- }-- /* Paste-or-drag-a-photo-anywhere overlay over the composer. */- .composer-drop {- position: absolute;- inset: 0;- z-index: 5;- display: none;- place-items: center;- border-radius: var(--radius-lg);- border: 1.5px dashed var(--accent);- background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface-glass));- backdrop-filter: blur(3px);- -webkit-backdrop-filter: blur(3px);- color: var(--ink);- font-family: var(--font-display);- font-weight: 600;- text-align: center;- pointer-events: none;- }- .composer.is-drop-active .composer-drop {- display: grid;- }- .composer-drop .drop-inner {- display: flex;- flex-direction: column;- align-items: center;- gap: 0.3rem;- }- .composer-drop .drop-glyph {- font-size: 1.9rem;- line-height: 1;- }- .composer-drop small {- font-family: var(--font-body);- font-weight: 400;- color: var(--ink-dim);- }-- @media (prefers-reduced-motion: reduce) {- .forge-aurora {- animation: none;- }- }</style></head><body><div id="nav-container"></div><main class="forge-main">- <div class="forge-aurora" aria-hidden="true"></div><header class="forge-head"><span class="forge-eyebrow">Text · Image · Multi-view → 3D · live</span><h1>Forge a 3D model from words or photos</h1>@@ -1869,7 +1754,8 @@></textarea><p class="views-hint">Add 1–4 views of the <strong>same</strong> object (front · back · left ·- right). Drag to drop, click to browse, drag a thumbnail to reorder.+ right). Drag to drop, click to browse, paste from the clipboard+ (<kbd class="gen-kbd">⌘V</kbd> / <kbd class="gen-kbd">Ctrl+V</kbd>), drag a thumbnail to reorder.PNG/JPG/WebP, up to 8 MB each.</p></div>@@ -1964,15 +1850,6 @@</button></div>- <!-- Drag a photo onto the page, or paste one from the clipboard,- to jump straight into multi-view reconstruction. -->- <div class="composer-drop" id="composer-drop" aria-hidden="true">- <div class="drop-inner">- <span class="drop-glyph" aria-hidden="true">⤓</span>- Drop a photo to reconstruct- <small>PNG, JPG or WebP · up to 4 views of one object</small>- </div>- </div></form><div class="chips" id="examples" aria-label="Example prompts">diff --git a/public/features.json b/public/features.jsonindex ac7568232..6f76ec399 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-12T23:29:29.351Z",+ "generated_at": "2026-06-12T23:31:31.699Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/scripts/check-forge-polish.mjs b/scripts/check-forge-polish.mjsdeleted file mode 100644index 14e998e38..000000000--- a/scripts/check-forge-polish.mjs+++ /dev/null@@ -1,66 +0,0 @@-import { chromium } from 'playwright';-const base = 'http://localhost:3123';-const browser = await chromium.launch();--// Desktop 1440-const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });-await page.goto(base + '/', { waitUntil: 'domcontentloaded' });-await page.waitForSelector('.nav-main a.nav-hot', { timeout: 10000 });-await page.waitForTimeout(1200);-await page.screenshot({ path: '/tmp/shot-home-hero-1440.png', clip: { x: 0, y: 0, width: 1440, height: 760 } });--// Build dropdown open-await page.hover('.nav-grp:first-child .nav-trigger');-await page.click('.nav-grp:first-child .nav-trigger');-await page.waitForTimeout(400);-await page.screenshot({ path: '/tmp/shot-nav-build-menu.png', clip: { x: 0, y: 0, width: 900, height: 620 } });--// nav-hot hover state-await page.keyboard.press('Escape');-await page.hover('.nav-main a.nav-hot');-await page.waitForTimeout(300);-await page.screenshot({ path: '/tmp/shot-nav-hot-hover.png', clip: { x: 0, y: 0, width: 1440, height: 64 } });--// /create featured card-await page.goto(base + '/create', { waitUntil: 'domcontentloaded' });-await page.waitForSelector('#card-prompt', { timeout: 10000 });-await page.waitForTimeout(1000);-const ex1 = await page.locator('#card-prompt-example').innerText();-await page.locator('#card-prompt').scrollIntoViewIfNeeded();-await page.screenshot({ path: '/tmp/shot-create-card.png', clip: { x: 0, y: 0, width: 1440, height: 900 } });-await page.waitForTimeout(7000);-const ex2 = await page.locator('#card-prompt-example').innerText();-console.log('typewriter cycling:', JSON.stringify(ex1), '->', JSON.stringify(ex2), ex1 !== ex2 ? 'OK' : 'NOT CYCLING (may be mid-hold)');--// hover the featured card-await page.hover('#card-prompt');-await page.waitForTimeout(300);-const card = await page.locator('#card-prompt').boundingBox();-await page.screenshot({ path: '/tmp/shot-create-card-hover.png', clip: { x: Math.max(0, card.x - 20), y: Math.max(0, card.y - 20), width: 560, height: 380 } });--// Light theme nav-await page.evaluate(() => { localStorage.setItem('twx_theme', 'light'); });-await page.goto(base + '/', { waitUntil: 'domcontentloaded' });-await page.waitForSelector('.nav-main a.nav-hot', { timeout: 10000 });-await page.waitForTimeout(800);-await page.screenshot({ path: '/tmp/shot-nav-light.png', clip: { x: 0, y: 0, width: 1440, height: 64 } });-await page.evaluate(() => { localStorage.setItem('twx_theme', 'auto'); });--// Mobile 375 drawer-const m = await browser.newPage({ viewport: { width: 375, height: 720 } });-await m.goto(base + '/', { waitUntil: 'domcontentloaded' });-await m.waitForSelector('.nav-toggle', { timeout: 10000 });-await m.click('.nav-toggle');-await m.waitForTimeout(500);-await m.screenshot({ path: '/tmp/shot-drawer-375.png' });-// drawer hot link present?-const drawerHot = await m.locator('.nav-drawer a.nav-hot').count();-console.log('drawer hot link:', drawerHot);--// Mobile hero-await m.click('.nav-toggle');-await m.waitForTimeout(300);-await m.screenshot({ path: '/tmp/shot-home-375.png' });--await browser.close();-console.log('done');diff --git a/scripts/verify-forge-showcase.mjs b/scripts/verify-forge-showcase.mjsnew file mode 100644index 000000000..684b2f8e0--- /dev/null+++ b/scripts/verify-forge-showcase.mjs@@ -0,0 +1,114 @@+// One-off browser verification for the /forge community showcase + dropzone.+// Usage: BASE_URL=http://localhost:4174 node scripts/verify-forge-showcase.mjs+import { chromium } from 'playwright';++const BASE = process.env.BASE_URL || 'http://localhost:4174';+const SHOWCASE_ROWS = [+ {+ id: 'c-1',+ prompt: 'a glazed ceramic teapot with a bamboo handle',+ glb_url: 'https://example.com/teapot.glb',+ preview_image_url:+ 'data:image/svg+xml,' ++ encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64"><rect width="64" height="64" fill="#334"/></svg>'),+ views_used: null,+ backend: 'trellis',+ tier: 'standard',+ path: 'image',+ created_at: new Date(Date.now() - 5 * 60_000).toISOString(),+ },+ {+ id: 'c-2',+ prompt: 'a low-poly red fox, sitting',+ glb_url: 'https://example.com/fox.glb',+ preview_image_url: null,+ views_used: 3,+ backend: 'nvidia',+ tier: 'draft',+ path: 'image',+ created_at: new Date(Date.now() - 26 * 3600_000).toISOString(),+ },+];++const errors = [];+const browser = await chromium.launch();+const page = await browser.newPage();+// Local-harness noise that does not exist in production: vite's HMR socket,+// the absent Vercel functions (404s), and the stub's synthetic example.com GLB.+const ENV_NOISE = /websocket|_vercel|favicon|Failed to load resource|Failed to fetch|example\.com/i;+page.on('console', (m) => {+ if (m.type() === 'error' && !ENV_NOISE.test(m.text())) errors.push(m.text());+});+page.on('pageerror', (e) => {+ if (!ENV_NOISE.test(String(e))) errors.push(String(e));+});++// ── Pass 1: live API (vite proxies /api/* to production) — the section must+// settle into one of its two designed states: rendered cards, or hidden. ─────+await page.goto(`${BASE}/forge.html`, { waitUntil: 'load' });+await page.waitForFunction(+ () => {+ const s = document.getElementById('showcase');+ return s && (s.classList.contains('is-hidden') || s.querySelector('.showcase-card'));+ },+ { timeout: 15000 },+);+const livePass = await page.$eval('#showcase', (el) =>+ el.classList.contains('is-hidden') ? 'hidden (feed empty/disabled)' : `rendered ${el.querySelectorAll('.showcase-card').length} live cards`,+);+console.log('live API pass:', livePass);++// ── Pass 2: stub the community endpoint with the real response shape ─────────+await page.route('**/api/forge-gallery?scope=community*', (route) =>+ route.fulfill({ json: { enabled: true, creations: SHOWCASE_ROWS } }),+);+await page.goto(`${BASE}/forge.html`, { waitUntil: 'load' });+await page.waitForSelector('#showcase:not(.is-hidden) .showcase-card', { timeout: 5000 });+const cards = await page.$$eval('#showcase-grid .showcase-card', (els) => els.length);+const count = await page.$eval('#showcase-count', (el) => el.textContent);+const whens = await page.$$eval('.showcase-when', (els) => els.map((e) => e.textContent));+console.log('showcase rendered:', { cards, count, whens });++// Remix: fills the composer prompt + focuses it.+await page.click('.showcase-card .showcase-remix');+const promptVal = await page.$eval('#prompt', (el) => el.value);+const promptFocused = await page.$eval('#prompt', (el) => el === document.activeElement);+console.log('remix:', { promptVal, promptFocused });++// Card click: dispatches forge:open-creation → forge.js loads it in the viewer.+await page.click('.showcase-card');+await page.waitForTimeout(400);+const viewerSrc = await page.$eval('#viewer', (el) => el.getAttribute('src'));+const resultShown = await page.$eval('#state-result', (el) => !el.classList.contains('is-hidden'));+console.log('open in viewer:', { viewerSrc, resultShown });++// ── Dropzone: overlay on dragenter (text mode), hides on drop ────────────────+await page.evaluate(() => {+ document.querySelector('#mode-switch [data-mode="text"]').click();+ const dt = new DataTransfer();+ dt.items.add(new File(['x'], 'a.png', { type: 'image/png' }));+ document.body.dispatchEvent(new DragEvent('dragenter', { bubbles: true, dataTransfer: dt }));+});+const overlayActive = await page.$eval('.forge-drop-overlay', (el) => el.dataset.active === 'true');+await page.evaluate(() => {+ document.body.dispatchEvent(new DragEvent('dragleave', { bubbles: true }));+});+const overlayGone = await page.$eval('.forge-drop-overlay', (el) => el.dataset.active !== 'true');+console.log('drop overlay:', { overlayActive, overlayGone });++// Paste: image on clipboard → mode switches to photos + toast appears.+await page.evaluate(() => {+ const dt = new DataTransfer();+ dt.items.add(new File(['x'], 'paste.png', { type: 'image/png' }));+ const ev = new ClipboardEvent('paste', { bubbles: true, cancelable: true });+ Object.defineProperty(ev, 'clipboardData', { value: dt });+ document.dispatchEvent(ev);+});+await page.waitForTimeout(300);+const modeAfterPaste = await page.$eval('#mode-switch [aria-selected="true"]', (el) => el.dataset.mode);+const toastText = await page.$eval('.forge-toast', (el) => el.textContent).catch(() => null);+console.log('paste:', { modeAfterPaste, toastText });++console.log('console errors:', errors.length ? errors : 'none');+await browser.close();+process.exit(errors.length ? 1 : 0);diff --git a/solana-agent-sdk/LICENSE b/solana-agent-sdk/LICENSEnew file mode 100644index 000000000..bbb838721--- /dev/null+++ b/solana-agent-sdk/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 three.ws++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/src/forge-showcase.js b/src/forge-showcase.jsindex cb28ac61f..84fb7c5e9 100644--- a/src/forge-showcase.js+++ b/src/forge-showcase.js@@ -79,10 +79,13 @@ function buildCard(c) {meta.textContent = c.prompt || 'Untitled';card.appendChild(meta);+ const foot = document.createElement('div');+ foot.className = 'showcase-foot';+const when = document.createElement('span');when.className = 'showcase-when';when.textContent = timeAgo(c.created_at);- card.appendChild(when);+ foot.appendChild(when);// Remix — only meaningful when there is a prompt to start from.if (c.prompt) {@@ -96,8 +99,9 @@ function buildCard(c) {e.stopPropagation();remixPrompt(c.prompt);});- card.appendChild(remix);+ foot.appendChild(remix);}+ card.appendChild(foot);const open = () =>document.dispatchEvent(new CustomEvent('forge:open-creation', { detail: { creation: c } }));diff --git a/src/forge.js b/src/forge.jsindex 011f364e1..fbe6feff9 100644--- a/src/forge.js+++ b/src/forge.js@@ -84,13 +84,6 @@ const els = {byokHint: document.getElementById('byok-hint'),providerKey: document.getElementById('provider-key'),estimate: document.getElementById('estimate'),- // Prompt tools (surprise · live coach · counter) + example swap + drop overlay.- surprise: document.getElementById('surprise'),- chipsMore: document.getElementById('chips-more'),- promptCount: document.getElementById('prompt-count'),- promptCoach: document.getElementById('prompt-coach'),- composerDrop: document.getElementById('composer-drop'),- genKbd: document.querySelector('.gen-kbd'),};let aspectRatio = '1:1';@@ -329,7 +322,6 @@ async function loadCatalog() {return;}buildEngineButtons();- paintTierSublabels();selectTier(selectedTier);revealSketchMode();loadHealth();@@ -515,148 +507,6 @@ function updateEstimate() {els.estimate.innerHTML = parts.join(' · ');}-// Tier sublabels — paint each Quality button with the poly budget + a one-word-// intent ("12k · fast"), sourced from the live catalog so the trade-off between-// the three tiers is legible before you click one. No catalog → buttons keep-// their plain labels.-const TIER_INTENT = { draft: 'fast', standard: 'balanced', high: 'PBR' };-function paintTierSublabels() {- if (!els.tier || !catalog?.tiers) return;- for (const btn of els.tier.querySelectorAll('button[data-tier]')) {- const t = catalog.tiers.find((x) => x.id === btn.dataset.tier);- let sub = btn.querySelector('.tier-sub');- if (!sub) {- sub = document.createElement('small');- sub.className = 'tier-sub';- btn.appendChild(sub);- }- if (!t) {- sub.textContent = '';- continue;- }- const bits = [];- if (Number(t.polycount) > 0) bits.push(`${Math.round(t.polycount / 1000)}k`);- bits.push(TIER_INTENT[t.id] || '');- sub.textContent = bits.filter(Boolean).join(' · ');- }-}--// Prompt tools — curated idea pool, live counter, and an honest quality coach.-// The pool feeds both "Surprise me" (fill the box) and "More ideas" (swap the-// visible example chips). Every prompt is a single, clearly-described object —-// the shape that actually reconstructs well — so the tools teach by example.-const PROMPT_POOL = [- 'a low-poly red fox, sitting',- 'a sci-fi combat helmet, brushed metal',- 'a potted monstera plant',- 'a vintage film camera',- 'a glazed ceramic teapot',- 'a worn leather armchair, studio lighting',- 'a low-poly treasure chest, iron-banded wood',- 'a mid-century walnut sideboard, brass legs',- 'a steampunk submarine, riveted brass',- 'a cartoon robot, white and orange plastic',- 'a chibi dragon, green scales, small wings',- 'a medieval round shield, painted wood with steel rim',- 'a stoneware coffee mug, speckled glaze',- 'a minimalist desk lamp, matte black metal',- 'a glazed donut, pink frosting, rainbow sprinkles',- 'a tiny fantasy cottage, thatched roof',- 'a low-poly lighthouse, red and white stripes',- 'a brass steampunk owl',- 'a cast-iron skillet',- 'a neon arcade cabinet',- 'a velvet wingback chair, deep green',- 'a marble bust on a plinth',- 'a retro rotary telephone, cherry red',- 'a frosted glass perfume bottle',- 'a samurai helmet, lacquered black',- 'a knitted wool beanie',-];--// Material + style vocabulary the coach rewards — naming either is what lifts a-// prompt from vague to reconstructable.-const MATERIAL_RE =- /\b(leather|metal|metallic|brushed|steel|iron|brass|copper|gold|silver|chrome|wood(en)?|oak|walnut|maple|bamboo|ceramic|glazed|porcelain|stoneware|plastic|matte|glossy|gloss|glass|frosted|stone|marble|granite|concrete|fabric|cloth|velvet|denim|wool|knitted|woven|rubber|clay|terracotta|bronze|carbon|lacquered|enamel|chrome)\b/i;-const STYLE_RE =- /\b(low-?poly|realistic|photoreal\w*|cartoon|styli[sz]ed|voxel|sci-?fi|steampunk|minimalist|isometric|pixel|chibi|toy|retro|neon|fantasy|cyberpunk)\b/i;--// Live, honest prompt coach + character counter. Heuristics only — they read-// the text the user actually typed and never block submission; they nudge.-function updatePromptMeta() {- if (!els.prompt) return;- const raw = els.prompt.value;- if (els.promptCount) {- els.promptCount.textContent = `${raw.length} / 1000`;- els.promptCount.dataset.near = String(raw.length >= 900);- }- if (!els.promptCoach) return;- const t = raw.trim();- const words = t ? t.split(/\s+/).length : 0;- let grade = 'tip';- let msg = 'Describe one object and what it’s made of.';- if (t.length === 0) {- grade = 'tip';- msg = 'Describe one object and what it’s made of.';- } else if (t.length < 8 || words < 2) {- grade = 'warn';- msg = 'A little short — add a detail or a material.';- } else if (MATERIAL_RE.test(t) || STYLE_RE.test(t)) {- grade = 'strong';- msg = 'Strong prompt — clear subject and look.';- } else {- grade = 'tip';- msg = 'Tip: name a material (leather, brushed metal, ceramic).';- }- els.promptCoach.dataset.grade = grade;- els.promptCoach.textContent = msg;-}--// "Surprise me" — drop a random pool prompt into the box (never the one already-// there), spin the die, and focus so the user can tweak before forging.-function surprisePrompt() {- if (!els.prompt) return;- const current = els.prompt.value.trim();- let pick = current;- for (let i = 0; i < 8 && pick === current; i++) {- pick = PROMPT_POOL[Math.floor(Math.random() * PROMPT_POOL.length)];- }- setMode('text');- els.prompt.value = pick;- updatePromptMeta();- if (els.surprise) {- els.surprise.classList.add('is-rolling');- setTimeout(() => els.surprise.classList.remove('is-rolling'), 520);- }- els.prompt.focus();-}--// "More ideas" — swap the five visible example chips for the next window of the-// pool, with a quick fade so the change registers.-let chipOffset = 0;-function swapExampleChips() {- if (!els.examples) return;- const chips = Array.from(els.examples.querySelectorAll('.chip'));- if (!chips.length) return;- chipOffset = (chipOffset + chips.length) % PROMPT_POOL.length;- if (els.chipsMore) {- els.chipsMore.classList.add('is-rolling');- setTimeout(() => els.chipsMore.classList.remove('is-rolling'), 480);- }- const apply = () => {- chips.forEach((c, i) => {- c.textContent = PROMPT_POOL[(chipOffset + i) % PROMPT_POOL.length];- c.classList.remove('is-swapping');- });- };- if (REDUCED_MOTION) {- apply();- return;- }- chips.forEach((c) => c.classList.add('is-swapping'));- setTimeout(apply, 190);-}-// View slots ------------------------------------------------------------------function buildSlots() {@@ -1619,23 +1469,14 @@ els.aspect.addEventListener('click', (e) => {});els.examples.addEventListener('click', (e) => {- if (e.target.closest('#chips-more')) {- swapExampleChips();- return;- }const chip = e.target.closest('.chip');if (!chip) return;setMode('text');els.prompt.value = chip.textContent.trim();- updatePromptMeta();els.prompt.focus();submit();});-// Prompt tools: live counter + coach, surprise fill.-els.prompt.addEventListener('input', updatePromptMeta);-els.surprise?.addEventListener('click', surprisePrompt);-// Quality tier + engine + BYOK key wiring.els.tier?.addEventListener('click', (e) => {const btn = e.target.closest('button[data-tier]');@@ -1743,65 +1584,6 @@ if (els.forgeShareBtn) {});}-// Drop a photo anywhere on the page, or paste one from the clipboard, to jump-// straight into multi-view reconstruction. Both routes reuse the same upload-// path as the slots — no new backend, just a faster on-ramp.-function imagesFromDataTransfer(list) {- return Array.from(list || []).filter((f) => f && f.type && f.type.startsWith('image/'));-}--let dragDepth = 0;-function dragCarriesFiles(e) {- return Array.from(e.dataTransfer?.types || []).includes('Files');-}-window.addEventListener('dragenter', (e) => {- if (!dragCarriesFiles(e)) return;- dragDepth += 1;- els.form?.classList.add('is-drop-active');-});-window.addEventListener('dragover', (e) => {- if (dragCarriesFiles(e)) e.preventDefault();-});-window.addEventListener('dragleave', (e) => {- if (!dragCarriesFiles(e)) return;- dragDepth = Math.max(0, dragDepth - 1);- if (dragDepth === 0) els.form?.classList.remove('is-drop-active');-});-window.addEventListener('drop', (e) => {- dragDepth = 0;- els.form?.classList.remove('is-drop-active');- // A drop that lands on a view slot is owned by that slot's own handler.- if (e.target.closest?.('.view-slot')) return;- const imgs = imagesFromDataTransfer(e.dataTransfer?.files);- if (!imgs.length) return;- e.preventDefault();- setMode('image');- handleFiles(null, imgs);-});--// Paste an image (screenshot, copied product photo) → photo mode + upload. Text-// pastes carry no image files, so normal typing/paste is never intercepted.-window.addEventListener('paste', (e) => {- const items = e.clipboardData?.items;- if (!items) return;- const files = [];- for (const it of items) {- if (it.kind === 'file' && it.type.startsWith('image/')) {- const f = it.getAsFile();- if (f) files.push(f);- }- }- if (!files.length) return;- e.preventDefault();- setMode('image');- handleFiles(null, files);-});--// The ⌘↵ hint is rendered for macOS; everywhere else the submit chord is Ctrl↵.-if (els.genKbd && !/Mac|iPhone|iPad/i.test(navigator.platform || navigator.userAgent || '')) {- els.genKbd.textContent = 'Ctrl↵';-}-// Handle ?prompt= (pre-fill from a remix link) and ?share= (open a creation).(function handleQueryParams() {const params = new URLSearchParams(location.search);@@ -1817,10 +1599,6 @@ if (els.genKbd && !/Mac|iPhone|iPad/i.test(navigator.platform || navigator.userA}})();-// Paint the counter + coach for whatever the box starts with (remix prefill or-// empty), so the tools are live from first render.-updatePromptMeta();-// Hooks for the companion modules (forge-dropzone.js, forge-showcase.js) —// a CustomEvent contract keeps them decoupled from this file's internals.diff --git a/src/home-forge.js b/src/home-forge.jsindex 9084a24b9..97adcabcb 100644--- a/src/home-forge.js+++ b/src/home-forge.js@@ -338,6 +338,10 @@ function downloadName(prompt) {function showResult(glbUrl, prompt, { fromHistory = false } = {}) {stopElapsed();currentGlbUrl = glbUrl;+ // Reloading from the history rail can happen before any forge this session,+ // so the viewer library may not be registered yet. The element upgrades+ // retroactively once the script lands — fire the load and let it catch up.+ ensureModelViewer().catch(() => {});const viewer = document.createElement('model-viewer');viewer.setAttribute('src', glbUrl);viewer.setAttribute('alt', prompt ? `3D model: ${prompt}` : '3D model');diff --git a/src/pump/mcp-tools.js b/src/pump/mcp-tools.jsindex 0fca30aca..988709121 100644--- a/src/pump/mcp-tools.js+++ b/src/pump/mcp-tools.js@@ -3,6 +3,71 @@// Cloudflare Workers mirror (workers/pump-fun-mcp/worker.js).// No imports — pure data and pure helpers only.+// ── MCP ToolAnnotations (spec: readOnlyHint/destructiveHint/idempotentHint/+// openWorldHint). Every tool on this surface is read-only — nothing signs or+// sends a transaction. destructiveHint defaults to TRUE in the spec when+// omitted, so it is set explicitly everywhere.+//+// LIVE_READ live-market / on-chain read: same call can return new+// data, talks to external systems.+// DETERMINISTIC_READ external read whose answer is stable for the same args+// (name-service lookups).+// LOCAL_DETERMINISTIC pure in-process computation, stable output (lexicon+// sentiment scoring).+// LOCAL_GENERATIVE pure in-process computation, fresh output each call+// (vanity keypair grind).+const LIVE_READ = Object.freeze({+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: true,+});+const DETERMINISTIC_READ = Object.freeze({+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: true,+ openWorldHint: true,+});+const LOCAL_DETERMINISTIC = Object.freeze({+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: true,+ openWorldHint: false,+});+const LOCAL_GENERATIVE = Object.freeze({+ readOnlyHint: true,+ destructiveHint: false,+ idempotentHint: false,+ openWorldHint: false,+});++// name → { title, ...ToolAnnotations }. Applied onto TOOLS below; exported so+// runtimes (and the npm bridge) can overlay the same map on older tool lists.+export const TOOL_ANNOTATIONS = Object.freeze({+ searchTokens: { title: 'Search Tokens', ...LIVE_READ },+ getTokenDetails: { title: 'Token Details', ...LIVE_READ },+ getBondingCurve: { title: 'Bonding Curve', ...LIVE_READ },+ getTokenTrades: { title: 'Token Trades', ...LIVE_READ },+ getTrendingTokens: { title: 'Trending Tokens', ...LIVE_READ },+ getNewTokens: { title: 'New Tokens', ...LIVE_READ },+ getGraduatedTokens: { title: 'Graduated Tokens', ...LIVE_READ },+ getKingOfTheHill: { title: 'King of the Hill', ...LIVE_READ },+ kol_radar: { title: 'KOL Radar', ...LIVE_READ },+ getCreatorProfile: { title: 'Creator Profile', ...LIVE_READ },+ getTokenHolders: { title: 'Token Holders', ...LIVE_READ },+ pumpfun_vanity_mint: { title: 'Vanity Mint Keypair', ...LOCAL_GENERATIVE },+ pumpfun_watch_whales: { title: 'Watch Whale Trades', ...LIVE_READ },+ pumpfun_list_claims: { title: 'List Creator Fee Claims', ...LIVE_READ },+ pumpfun_watch_claims: { title: 'Watch Creator Fee Claims', ...LIVE_READ },+ pumpfun_first_claims: { title: 'First Creator Fee Claims', ...LIVE_READ },+ sns_resolve: { title: 'Resolve .sol Domain', ...DETERMINISTIC_READ },+ sns_reverseLookup: { title: 'Reverse .sol Lookup', ...DETERMINISTIC_READ },+ social_cashtag_sentiment: { title: 'Cashtag Sentiment', ...LOCAL_DETERMINISTIC },+ kol_leaderboard: { title: 'KOL Leaderboard', ...LIVE_READ },+ pumpfun_quote_swap: { title: 'Swap Quote (Read-Only)', ...LIVE_READ },+ social_x_post_impact: { title: 'X Post Price Impact', ...LIVE_READ },+});+export const TOOLS = [{name: 'searchTokens',@@ -293,6 +358,17 @@ export const TOOLS = [},];+// Stamp title + annotations onto every tool from the map above. A tool added+// to TOOLS without a TOOL_ANNOTATIONS entry would ship un-annotated — the+// parity tests assert full coverage so that can't land silently.+for (const tool of TOOLS) {+ const annotations = TOOL_ANNOTATIONS[tool.name];+ if (annotations) {+ tool.title = annotations.title;+ tool.annotations = annotations;+ }+}+export function rpcError(code, message) {const err = new Error(message);err.rpcCode = code;diff --git a/tests/api/forge-gallery-community.test.js b/tests/api/forge-gallery-community.test.jsnew file mode 100644index 000000000..def553788--- /dev/null+++ b/tests/api/forge-gallery-community.test.js@@ -0,0 +1,115 @@+// Tests for GET /api/forge-gallery — the personal gallery vs the public+// community showcase ("Fresh from the Forge" on /forge).+//+// Pins the contract the showcase module depends on:+// • ?scope=community serves cross-client rows from listShowcase and never+// touches the per-client path (no x-forge-client required, no hashClient),+// • community responses are CDN-cacheable (s-maxage) — the default personal+// scope must NOT be, it's keyed to a client header,+// • a deployment without a durable store answers { enabled: false } for+// both scopes instead of erroring,+// • the ?limit param reaches the store for both scopes.++import { describe, it, expect, beforeEach, vi } from 'vitest';++const storeEnabledMock = vi.fn(() => true);+const listCreationsMock = vi.fn(async () => []);+const listShowcaseMock = vi.fn(async () => []);+const hashClientMock = vi.fn(() => 'hashed-client');+vi.mock('../../api/_lib/forge-store.js', () => ({+ forgeStoreEnabled: (...a) => storeEnabledMock(...a),+ listCreations: (...a) => listCreationsMock(...a),+ listShowcase: (...a) => listShowcaseMock(...a),+ hashClient: (...a) => hashClientMock(...a),+}));++vi.mock('../../api/_lib/rate-limit.js', () => ({+ limits: { mcp3dStatus: vi.fn(async () => ({ success: true })) },+ clientIp: vi.fn(() => '127.0.0.1'),+}));++const handler = (await import('../../api/forge-gallery.js')).default;++function mkReq(url, headers = {}) {+ return { method: 'GET', url, headers, on() {}, destroy() {} };+}++function mkRes() {+ return {+ statusCode: 200,+ headers: {},+ body: '',+ setHeader(k, v) {+ this.headers[k.toLowerCase()] = v;+ },+ getHeader(k) {+ return this.headers[k.toLowerCase()];+ },+ end(chunk) {+ if (chunk !== undefined) this.body += String(chunk);+ this.writableEnded = true;+ },+ };+}++function parsed(res) {+ return JSON.parse(res.body);+}++beforeEach(() => {+ storeEnabledMock.mockReturnValue(true);+ listCreationsMock.mockResolvedValue([]);+ listShowcaseMock.mockResolvedValue([]);+ hashClientMock.mockClear();+ listCreationsMock.mockClear();+ listShowcaseMock.mockClear();+});++describe('GET /api/forge-gallery?scope=community', () => {+ it('serves cross-client showcase rows without touching the per-client path', async () => {+ const rows = [+ { id: 'c1', prompt: 'a glazed ceramic teapot', glb_url: 'https://cdn/x.glb', preview_image_url: 'https://cdn/x.png' },+ ];+ listShowcaseMock.mockResolvedValue(rows);++ const res = mkRes();+ // Deliberately no x-forge-client header — community must not need one.+ await handler(mkReq('/api/forge-gallery?scope=community&limit=12'), res);++ expect(res.statusCode).toBe(200);+ expect(parsed(res)).toEqual({ enabled: true, creations: rows });+ expect(listShowcaseMock).toHaveBeenCalledWith({ limit: 12 });+ expect(listCreationsMock).not.toHaveBeenCalled();+ expect(hashClientMock).not.toHaveBeenCalled();+ });++ it('is CDN-cacheable — the feed only changes when a generation finishes', async () => {+ const res = mkRes();+ await handler(mkReq('/api/forge-gallery?scope=community'), res);+ expect(res.getHeader('cache-control')).toMatch(/s-maxage=\d+/);+ });++ it('answers enabled:false when the deployment has no durable store', async () => {+ storeEnabledMock.mockReturnValue(false);+ const res = mkRes();+ await handler(mkReq('/api/forge-gallery?scope=community'), res);+ expect(parsed(res)).toEqual({ enabled: false, creations: [] });+ expect(listShowcaseMock).not.toHaveBeenCalled();+ });+});++describe('GET /api/forge-gallery (personal scope)', () => {+ it('stays keyed to the client header and is not CDN-cacheable', async () => {+ const rows = [{ id: 'mine', prompt: 'a vintage film camera', glb_url: 'https://cdn/m.glb' }];+ listCreationsMock.mockResolvedValue(rows);++ const res = mkRes();+ await handler(mkReq('/api/forge-gallery?limit=8', { 'x-forge-client': 'anon-123' }), res);++ expect(parsed(res)).toEqual({ enabled: true, creations: rows });+ expect(hashClientMock).toHaveBeenCalledWith('anon-123');+ expect(listCreationsMock).toHaveBeenCalledWith({ clientKey: 'hashed-client', limit: 8 });+ expect(listShowcaseMock).not.toHaveBeenCalled();+ expect(res.getHeader('cache-control') || '').not.toMatch(/s-maxage/);+ });+});