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.

build: exclude subprojects from Vercel upload to fix tsc errors

nirholas7973fe29a42d
diff --git a/.vercelignore b/.vercelignore
index f019db9d8..e6f071e04 100644
--- a/.vercelignore
+++ b/.vercelignore
@@ -19,6 +19,10 @@ sims-demo
3d-demo
avatar
+three-ws
+xspace-agent
+agent-voice-chat
+
dist-lib
dist-artifact
diff --git a/content/x-schedule.json b/content/x-schedule.json
index c15cd095f..1059d2931 100644
--- a/content/x-schedule.json
+++ b/content/x-schedule.json
@@ -8,24 +8,26 @@
},
"calendar": [
{
- "id": "2026-05-21-am-bazaar-live",
+ "id": "2026-05-21-am-bazaar-x402-cdp",
"date": "2026-05-21",
"slot": "AM",
"kind": "news",
- "topic": "Bazaar marketplace live",
+ "topic": "Bazaar + x402 live on Base via Coinbase CDP",
"link": "https://three.ws/x402",
"status": "planned",
- "post": "The three.ws bazaar is live.\n\nAny dev or agent can list a paid endpoint and earn USDC per call — settled instantly over x402.\n\nNo API keys. No subscriptions. Stablecoin in, data out.\n\nBrowse + monetize → three.ws/x402"
+ "post": "Coinbase CDP + x402 are live on three.ws.\n\nAgents pay agents in USDC on Base mainnet with Permit2 gas-sponsoring on every CDP endpoint. Direct-scheme on BSC and Solana.\n\nBuyer signs. Relayer pays gas. Caller gets data.\n\nBrowse + monetize → three.ws/x402"
},
{
- "id": "2026-05-21-pm-x402-endpoints",
+ "id": "2026-05-21-pm-agentic-market",
"date": "2026-05-21",
"slot": "PM",
- "kind": "feature",
- "topic": "x402 paid endpoints",
- "link": "https://three.ws/x402-pay",
+ "kind": "news",
+ "topic": "Coinbase Agentic.Market launch",
+ "link": "https://agentic.market",
"status": "planned",
- "post": "x402 on three.ws — paid endpoints, native.\n\nAgents pay other agents in USDC. Base mainnet via Coinbase CDP. Direct-scheme on BSC and Solana. Permit2 gas-sponsoring on every CDP endpoint.\n\nBuyer signs. Relayer pays gas. Caller gets data.\n\nthree.ws/x402-pay"
+ "format": "thread",
+ "post": "Coinbase quietly built the App Store for AI agents.\n\nAgentic.Market — 480k agents, 100k services, $50M volume, 165M transactions.\n\nOpenAI, AWS, Bloomberg already partners.\n\nagentic.market",
+ "reply": "Why it matters:\n\nAgents need data, tools, execution and payments — without humans managing keys and approvals.\n\nAgentic.Market lets them discover, pay in stablecoins, and call services autonomously via x402.\n\nthree.ws is x402-native — every endpoint plugs in.\n\nthree.ws/x402"
},
{
"id": "2026-05-22-am-agent-3d-element",
diff --git a/content/x-schedule.md b/content/x-schedule.md
index b6fb5edb4..88644839f 100644
--- a/content/x-schedule.md
+++ b/content/x-schedule.md
@@ -12,23 +12,36 @@
### Thu 2026-05-21 — Bazaar Week
-**AM · news · Bazaar marketplace live** — [three.ws/x402](https://three.ws/x402)
-> The three.ws bazaar is live.
+**AM · news · Bazaar + x402 live on Base via Coinbase CDP** — [three.ws/x402](https://three.ws/x402)
+> Coinbase CDP + x402 are live on three.ws.
>
-> Any dev or agent can list a paid endpoint and earn USDC per call — settled instantly over x402.
+> Agents pay agents in USDC on Base mainnet with Permit2 gas-sponsoring on every CDP endpoint. Direct-scheme on BSC and Solana.
>
-> No API keys. No subscriptions. Stablecoin in, data out.
+> Buyer signs. Relayer pays gas. Caller gets data.
>
> Browse + monetize → three.ws/x402
-**PM · feature · x402 paid endpoints** — [three.ws/x402-pay](https://three.ws/x402-pay)
-> x402 on three.ws — paid endpoints, native.
+**PM · news · Coinbase Agentic.Market launch (thread)** — [agentic.market](https://agentic.market)
+
+_Main:_
+> Coinbase quietly built the App Store for AI agents.
>
-> Agents pay other agents in USDC. Base mainnet via Coinbase CDP. Direct-scheme on BSC and Solana. Permit2 gas-sponsoring on every CDP endpoint.
+> Agentic.Market — 480k agents, 100k services, $50M volume, 165M transactions.
>
-> Buyer signs. Relayer pays gas. Caller gets data.
+> OpenAI, AWS, Bloomberg already partners.
+>
+> agentic.market
+
+_Reply:_
+> Why it matters:
+>
+> Agents need data, tools, execution and payments — without humans managing keys and approvals.
+>
+> Agentic.Market lets them discover, pay in stablecoins, and call services autonomously via x402.
+>
+> three.ws is x402-native — every endpoint plugs in.
>
-> three.ws/x402-pay
+> three.ws/x402
### Fri 2026-05-22
diff --git a/src/account.js b/src/account.js
index d2fa8b6b9..0ed754fdf 100644
--- a/src/account.js
+++ b/src/account.js
@@ -3,6 +3,22 @@
const API = ''; // same origin
+// Single-use CSRF token: fetched lazily, burned by the server on consumption.
+// Re-issued on the next mutating call. Matches the dashboard's pattern so any
+// page using apiFetch gets CSRF-gated endpoints (PUT/PATCH/DELETE on agents,
+// keys, withdrawals, marketplace, etc.) for free.
+let _csrfToken = null;
+async function getCsrfToken() {
+ if (_csrfToken) return _csrfToken;
+ const r = await fetch('/api/csrf-token', { credentials: 'include' });
+ if (!r.ok) return null;
+ const j = await r.json().catch(() => null);
+ _csrfToken = j?.data?.token || null;
+ return _csrfToken;
+}
+
+const SAFE_METHODS = new Set(['GET', 'HEAD', 'OPTIONS']);
+
// Wrapped fetch that handles expired sessions centrally. A 401 response is
// treated as a session-expiry signal and redirects to /login?next=<current>
// with the URL hash preserved (SPAs lose it on a naked location.href hop).
@@ -10,9 +26,22 @@ const API = ''; // same origin
// "not signed in" answer the caller wants to inspect itself (e.g. /api/auth/me).
export async function apiFetch(path, options = {}) {
const { allowAnonymous = false, ...init } = options;
+ const method = (init.method || 'GET').toUpperCase();
+
+ // Mutating same-origin requests need a CSRF token. Skip for bearer-auth
+ // callers — the server exempts Authorization: Bearer requests.
+ const headers = new Headers(init.headers || {});
+ const hasBearer = (headers.get('authorization') || '').startsWith('Bearer ');
+ if (!SAFE_METHODS.has(method) && !hasBearer) {
+ const token = await getCsrfToken();
+ if (token) headers.set('x-csrf-token', token);
+ _csrfToken = null;
+ }
+
const res = await fetch(path, {
credentials: 'include',
...init,
+ headers,
});
if (res.status === 401 && !allowAnonymous) {
redirectToLogin();