Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(agents): route the signed-manifest actions and bind a pump launch back to its saved plan

nirholas2d690abd0679
diff --git a/api/_lib/x402-spec.js b/api/_lib/x402-spec.js
index e0514944e..bde9d49d6 100644
--- a/api/_lib/x402-spec.js
+++ b/api/_lib/x402-spec.js
@@ -1344,7 +1344,7 @@ export function bazaarExtension() {
params: {
type: 'object',
description:
- 'For tools/call: { name, arguments }. Tool names include validate_model, inspect_model, optimize_model, search_public_avatars, solana_register, solana_reputation, and others, see tools/list.',
+ 'For tools/call: { name, arguments }. Tool names include validate_model, inspect_model, optimize_model, search_public_avatars, register_agent, solana_agent_reputation, and others, see tools/list.',
},
},
};
diff --git a/api/agents/[id].js b/api/agents/[id].js
index 57f82d49d..a01848fdb 100644
--- a/api/agents/[id].js
+++ b/api/agents/[id].js
@@ -12,6 +12,9 @@
* /api/agents/:id/animations — owner-only: replace meta.animations
* /api/agents/:id/embed-policy — read/write embed policy
* /api/agents/:id/manifest — public canonical manifest JSON
+ * /api/agents/:id/manifest/signed — public signed + IPFS-pinned manifest envelope
+ * /api/agents/:id/manifest/publish — owner-only: re-sign and re-pin the manifest
+ * /api/agents/:id/manifest/history — public: every manifest CID this agent published
* /api/agents/:id/registration — public EIP-8004 registry document (Metaplex Agent Registry URI)
* /api/agents/:id/sign — owner-only: sign message with server wallet
* /api/agents/:id/usage — owner-only: LLM usage stats
@@ -150,6 +153,12 @@ export default wrap(async function handler(req, res) {
}
if (sub === 'manifest') {
+ // /manifest is the live, unsigned public document. The sub-actions below
+ // are the signed, IPFS-pinned envelope built on top of it.
+ if (action === 'signed' || action === 'publish' || action === 'history') {
+ const mod = await import('./_id/manifest-signed.js');
+ return mod.handleSignedManifest(req, res, id, action);
+ }
const mod = await import('./_id/_sub.js');
return mod.handleManifest(req, res, id);
}
@@ -179,9 +188,10 @@ export default wrap(async function handler(req, res) {
const mod = await import('./_id/memory/pin.js');
return mod.default(req, res);
}
+ // /memory/seed/* has its own rewrite per provider (memory-seed-x,
+ // memory-seed-github, memory-seed-farcaster), so it never lands here.
if (action === 'seed') {
- const mod = await import('./_id/memory-seed-farcaster.js');
- return mod.default(req, res);
+ return error(res, 404, 'not_found', 'unknown memory seed provider');
}
if (action && CID_RE.test(action)) {
const mod = await import('./_id/memory/[cid].js');
diff --git a/api/pump/[action].js b/api/pump/[action].js
index 49067229f..5853bcbc0 100644
--- a/api/pump/[action].js
+++ b/api/pump/[action].js
@@ -64,6 +64,7 @@ import { limits, clientIp } from '../_lib/rate-limit.js';
import { resolveOrCreateAgentForAvatar as resolveLaunchAgentId } from '../_lib/agent-identity.js';
import { parse, isUuid } from '../_lib/validate.js';
import { queryAgentLaunches } from '../_lib/pump-agent-launches.js';
+import { markPlanLaunched } from '../_lib/agent-token-plan.js';
import { randomToken } from '../_lib/crypto.js';
import { publishFeedEvent } from '../_lib/feed.js';
import { normalizeGatewayURL } from '../../src/ipfs.js';
@@ -1894,6 +1895,12 @@ async function handleLaunchAgent(req, res) {
source: 'studio_agent_wallet',
});
+ // Bind the launch back to the agent's saved token plan, if it launched from
+ // one: the plan flips to 'launched' and records the mint, so the profile stops
+ // advertising a coin that now exists and starts rendering its market instead.
+ // A launch configured inline (no saved plan) writes nothing and is unaffected.
+ await markPlanLaunched({ agentId: resolvedAgentId, network: body.network, mint: mintAddr });
+
// Surface the confirmed agent-wallet launch on the site-wide live activity ticker.
publishFeedEvent({
type: 'coin-buy',
diff --git a/public/.well-known/agent.json b/public/.well-known/agent.json
index c50a3cce6..eff866888 100644
--- a/public/.well-known/agent.json
+++ b/public/.well-known/agent.json
@@ -1,6 +1,6 @@
{
"name": "three.ws",
- "description": "three.ws — the 3D agent economy. Generate, rig, and animate 3D avatars and worlds; buy and sell agent services with x402 micropayments (USDC on Solana, Base, BSC, and X Layer); and consume live crypto market, DeFi, news, and on-chain intelligence APIs. Machine-readable paid-service catalog at https://three.ws/.well-known/x402.json.",
+ "description": "three.ws — the 3D agent economy. Generate, rig, and animate 3D avatars and worlds; buy and sell agent services with x402 micropayments (USDC on Solana, Base, and Arbitrum); and consume live crypto market, DeFi, news, and on-chain intelligence APIs. Machine-readable paid-service catalog at https://three.ws/.well-known/x402.json.",
"url": "https://three.ws/",
"provider": {
"organization": "three.ws",
diff --git a/public/.well-known/mcp.json b/public/.well-known/mcp.json
index dd52d3478..352408c62 100644
--- a/public/.well-known/mcp.json
+++ b/public/.well-known/mcp.json
@@ -1,5 +1,5 @@
{
- "$comment": "Directory of hosted three.ws Model Context Protocol servers. Every endpoint speaks MCP over Streamable HTTP (JSON-RPC 2.0, POST). Thirty-seven more install-and-run servers are published on npm under the @three-ws scope; find all of them in the official MCP registry.",
+ "$comment": "Directory of hosted three.ws Model Context Protocol servers. Every endpoint speaks MCP over Streamable HTTP (JSON-RPC 2.0, POST). Dozens more install-and-run servers are published on npm under the @three-ws scope; find all of them in the official MCP registry.",
"name": "three.ws",
"description": "The 3D agent economy: generate, rig, and animate 3D avatars and worlds; pay and get paid per call with x402 (USDC on Solana and Base); read live crypto market and on-chain intelligence.",
"website": "https://three.ws",
diff --git a/public/schemas/mcp-trust-policy.json b/public/schemas/mcp-trust-policy.json
new file mode 100644
index 000000000..a67ff18de
--- /dev/null
+++ b/public/schemas/mcp-trust-policy.json
@@ -0,0 +1,146 @@
+{
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "https://three.ws/schemas/mcp-trust-policy.json",
+ "title": "three.ws MCP trust policy",
+ "description": "The JSON document served by GET https://three.ws/api/mcp-policy (format=json). It sorts every tool in the three.ws MCP catalog into allow / confirm / deny buckets for the requested trust profile, so an MCP client can automate exactly the tools whose readOnlyHint has been verified against the handler that implements it. Docs: https://three.ws/docs/mcp-safety",
+ "type": "object",
+ "required": [
+ "$schema",
+ "version",
+ "profile",
+ "profileLabel",
+ "summary",
+ "issuer",
+ "source",
+ "docs",
+ "verification",
+ "counts",
+ "rules"
+ ],
+ "additionalProperties": false,
+ "properties": {
+ "$schema": {
+ "type": "string",
+ "const": "https://three.ws/schemas/mcp-trust-policy.json"
+ },
+ "version": {
+ "type": "integer",
+ "const": 1
+ },
+ "profile": {
+ "type": "string",
+ "enum": ["strict", "balanced", "open"],
+ "description": "Which trust ladder rung this policy was generated for. balanced is the default."
+ },
+ "profileLabel": {
+ "type": "string",
+ "description": "Human-readable name of the profile."
+ },
+ "summary": {
+ "type": "string",
+ "description": "One-paragraph statement of what this profile automates and what it gates."
+ },
+ "issuer": {
+ "type": "string",
+ "format": "uri",
+ "description": "Origin that generated and signed off on the policy."
+ },
+ "source": {
+ "type": "string",
+ "format": "uri",
+ "description": "The tool catalog this policy was derived from (https://three.ws/mcp-catalog.json). The policy is regenerated from it on every request, so it always reflects the deployed tools."
+ },
+ "docs": {
+ "type": "string",
+ "format": "uri"
+ },
+ "verification": {
+ "type": "object",
+ "required": ["method", "check", "claim"],
+ "additionalProperties": false,
+ "properties": {
+ "method": {
+ "type": "string",
+ "description": "How the safety labels behind this policy were established."
+ },
+ "check": {
+ "type": "string",
+ "description": "The repo command that re-verifies every label."
+ },
+ "claim": {
+ "type": "string",
+ "description": "What the verification guarantees about the labels."
+ }
+ }
+ },
+ "counts": {
+ "type": "object",
+ "required": ["allow", "confirm", "deny", "total"],
+ "additionalProperties": false,
+ "properties": {
+ "allow": { "type": "integer", "minimum": 0 },
+ "confirm": { "type": "integer", "minimum": 0 },
+ "deny": { "type": "integer", "minimum": 0 },
+ "total": {
+ "type": "integer",
+ "minimum": 0,
+ "description": "Total tools in the catalog; equals allow + confirm + deny."
+ }
+ }
+ },
+ "rules": {
+ "type": "object",
+ "required": ["allow", "confirm", "deny"],
+ "additionalProperties": false,
+ "properties": {
+ "allow": {
+ "type": "array",
+ "items": { "$ref": "#/$defs/rule" },
+ "description": "Tools the client may run without asking under this profile."
+ },
+ "confirm": {
+ "type": "array",
+ "items": { "$ref": "#/$defs/rule" },
+ "description": "Tools the client must ask about before running."
+ },
+ "deny": {
+ "type": "array",
+ "items": { "$ref": "#/$defs/rule" },
+ "description": "Tools the client must refuse to run under this profile."
+ }
+ }
+ }
+ },
+ "$defs": {
+ "rule": {
+ "type": "object",
+ "required": ["name", "permission", "server", "safety", "priceUsd"],
+ "additionalProperties": false,
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The tool name as it appears in tools/list."
+ },
+ "permission": {
+ "type": "string",
+ "pattern": "^mcp__[A-Za-z0-9._-]+__[A-Za-z0-9._-]+$",
+ "description": "Namespaced permission id (mcp__<server>__<tool>) as MCP clients write it in their permission lists. The server segment is the id three.ws publishes; a client that named the server differently in its own config must substitute its own name."
+ },
+ "server": {
+ "type": "string",
+ "description": "The three.ws-published server id the tool belongs to."
+ },
+ "safety": {
+ "type": "string",
+ "enum": ["read", "write", "irreversible"],
+ "description": "Verified safety class of the tool handler: read never changes state, write changes state reversibly, irreversible cannot be undone (signs, sends, settles, or deletes)."
+ },
+ "priceUsd": {
+ "type": "number",
+ "minimum": 0,
+ "description": "Price per call in USD. 0 means free."
+ }
+ }
+ }
+ }
+}
diff --git a/scripts/build-discovery-cards.mjs b/scripts/build-discovery-cards.mjs
index 06cdbd66b..0d48d1715 100644
--- a/scripts/build-discovery-cards.mjs
+++ b/scripts/build-discovery-cards.mjs
@@ -34,7 +34,7 @@ const { getCatalog } = await import(path.join(root, 'api/_lib/service-catalog/in
const DESCRIPTION =
'three.ws — the 3D agent economy. Generate, rig, and animate 3D avatars and worlds; ' +
- 'buy and sell agent services with x402 micropayments (USDC on Solana, Base, BSC, and X Layer); ' +
+ 'buy and sell agent services with x402 micropayments (USDC on Solana, Base, and Arbitrum); ' +
'and consume live crypto market, DeFi, news, and on-chain intelligence APIs. ' +
'Machine-readable paid-service catalog at https://three.ws/.well-known/x402.json.';
diff --git a/tests/openapi-aggregator.test.js b/tests/openapi-aggregator.test.js
index 7789ba94b..3988d2888 100644
--- a/tests/openapi-aggregator.test.js
+++ b/tests/openapi-aggregator.test.js
@@ -40,6 +40,10 @@ function mockReq() {
};
}
+// Path-item keys that are operations; everything else ($ref, parameters,
+// summary, description) is path-item metadata, not an operation to audit.
+const HTTP_METHODS = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'];
+
describe('GET /openapi.json — aggregator coverage', () => {
let doc;
@@ -163,4 +167,44 @@ describe('GET /openapi.json — aggregator coverage', () => {
expect(priced.security).toEqual([]);
expect(priced['x-payment-info']).toBeUndefined();
});
+
+ // The three guards below encode what `redocly lint` (recommended ruleset)
+ // checks, so the failure lands in `npm test` instead of on whoever next runs
+ // an external validator against the published document.
+ it('declares security on every operation', () => {
+ // This document sets no root-level `security`, so an operation that omits
+ // its own inherits nothing: validators report undefined auth and agent
+ // tooling that infers an auth mode from the security list reports
+ // "unknown" instead of "public, pay-per-call". All 24 /api/x402/* paths
+ // once omitted it. Payment-gated operations declare [] (no credential
+ // required); credential-gated ones name their scheme.
+ for (const [path, pathItem] of Object.entries(doc.paths)) {
+ for (const [verb, op] of Object.entries(pathItem)) {
+ if (!HTTP_METHODS.includes(verb)) continue;
+ expect(op.security, `${verb.toUpperCase()} ${path} declares no security`).toBeDefined();
+ expect(Array.isArray(op.security), `${verb.toUpperCase()} ${path} security is not an array`).toBe(true);
+ }
+ }
+ });
+
+ it('documents at least one 4xx response on every operation', () => {
+ for (const [path, pathItem] of Object.entries(doc.paths)) {
+ for (const [verb, op] of Object.entries(pathItem)) {
+ if (!HTTP_METHODS.includes(verb)) continue;
+ const codes = Object.keys(op.responses || {});
+ expect(
+ codes.some((code) => /^4/.test(code)),
+ `${verb.toUpperCase()} ${path} documents no 4xx response (has ${codes.join(', ') || 'none'})`,
+ ).toBe(true);
+ }
+ }
+ });
+
+ it('states the API license', () => {
+ // Without it, spec renderers and SDK codegen present the API as
+ // unlicensed, which reads as public domain to anyone bundling our
+ // document into a client. The repo LICENSE is proprietary.
+ expect(doc.info.license?.name).toBeTruthy();
+ expect(doc.info.license?.url || doc.info.license?.identifier).toBeTruthy();
+ });
});