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.

docs: sync READMEs/docs; fix viewer link, wallet error copy, crawler 404 note

nirholas746cd0c979fb
diff --git a/api/README.md b/api/README.md
index f317d6e5c..57f51e0ef 100644
--- a/api/README.md
+++ b/api/README.md
@@ -1,11 +1,74 @@
# API
-This directory contains all the backend API endpoints for the 3D-Agent application.
+Vercel serverless functions that power the three.ws backend. Every `.js` file under `api/` (outside the `_`-prefixed helper folders) is deployed as its own HTTP endpoint, and the file path maps directly to the route:
-## Structure
+- `api/agents.js` -> `/api/agents`
+- `api/avatars/index.js` -> `/api/avatars`
+- `api/agents/[id].js` -> `/api/agents/:id`
+- `api/erc8004/[action].js` -> `/api/erc8004/:action`
+- `api/studio-assets/[...path].js` -> `/api/studio-assets/*`
-The API is structured by modules, with each module handling a specific part of the application's functionality.
+Most handlers run on the Node.js runtime; `api/chat.js` runs on the Edge runtime to stream SSE. `vercel.json` sets `maxDuration` / `includeFiles` per function and declares the cron schedule (see below).
-## Getting Started
+## Shared internals (not endpoints)
-To get started with the API, you will need to...
+The `_`-prefixed folders are imported by the endpoints; they are not routes:
+
+- `_lib/` — shared helpers. HTTP utilities in `_lib/http.js` (`json`, `text`, `redirect`, `error`, `readJson`, `readForm`, `cors`, `wrap`, `method`); Postgres in `_lib/db.js` (the `sql` tagged-template proxy + `query`); auth in `_lib/auth.js` (`getSessionUser`, `authenticateBearer`, `extractBearer`, `hasScope`, sessions, access/refresh tokens, CSRF). Also covers x402 (`x402*.js`), Solana/EVM transfers, pump.fun pricing, R2 storage, rate limiting, and validation.
+- `_mcp/` — Model Context Protocol internals: tool `catalog`, `dispatch`, `auth`, `payments`, `render`, `embed-policy`.
+- `_providers/` — third-party provider adapters (`gcp.js`, `huggingface.js`, `replicate.js`).
+
+## Endpoint groups
+
+### Agents and identity
+- `agents.js`, `agents/` — agent identity registry: list/create, `agents/me`, `agents/[id]` (get/update), plus `by-wallet`, `check-name`, `pricing`, `talk`, `sns`, `solana-wallet`, `pumpfun`, `nfts`, `suggest`, and more.
+- `agent-3d/`, `agent-actions.js`, `agent-delegate.js`, `agent-memory.js`, `agent-skills.js`, `agent-skill-price.js`, `agent-strategy.js` — agent versions, actions, ERC-7710 delegation, memory, and skills.
+- `erc8004/` — ERC-8004 identity + reputation via an `[action].js` dispatcher, plus `register-confirm.js`.
+- `sns.js`, `sns-subdomain.js`, `threews/` — Solana Name Service (`.sol` resolve + reverse-lookup, cached) and three.ws subdomains.
+
+### Avatars and 3D
+- `avatars/`, `avatar/` — avatar CRUD plus `avatar/optimize`, `avatar/render`, `avatar/video-generate`, `avatar/video-status`.
+- `actions/` — avatar action renders; `animations/`, `mocap/`, `render/`, `scene/`, `nft/` — animation presigns, motion-capture clips, GLB/clip rendering, scene gating, and scene-NFT minting.
+
+### AI, chat, and inference
+- `chat.js` (Edge SSE, multi-provider routing across Groq / OpenRouter / OpenAI / Anthropic), `chat/`, `brain/chat.js`, `llm/anthropic.js`, `chat-skills.js`.
+- `inference/livepeer.js` — side-by-side Claude vs Livepeer LLM comparison.
+- `tts/` — text-to-speech (`speak`, `edge`, `eleven`, `eleven-clone`).
+- `persona/`, `seed/` — persona extraction/preview and seed synthesis from X / GitHub / Farcaster.
+- `mcp.js` — MCP server over Streamable HTTP (MCP 2025-06-18, JSON-RPC 2.0): `POST` tool calls, `GET` SSE, `DELETE` terminate. `pump-fun-mcp.js` — the pump.fun MCP surface.
+
+### Payments and x402
+- `x402/` — x402 paid endpoints (e.g. `agent-reputation`, `asset-download`, `fact-check`, `pay-by-name`, `mint-to-mesh`, `skill-marketplace`, `my-receipts`, `model-check`).
+- `x402-pay.js` (server-side payer streaming the challenge -> build -> verify -> settle lifecycle as SSE), `x402-pay/`, `x402-checkout.js`, `x402-checkout-record.js`, `x402-skus.js`, `x402-status.js`.
+- `payments/`, `billing/`, `monetization/`, `subscriptions.js`, `subscriptions/`, `purchase/`, `wallet/` — payment intents, billing/receipts, monetization revenue/withdrawals, subscriptions, wallet balances.
+
+### Marketplace and discovery
+- `marketplace.js` (301-redirects to `/api/marketplace/agents`), `marketplace/` — skill/asset marketplace: list, buy, reviews, trials, theme, skill pricing.
+- `bazaar/` — x402 bazaar service discovery (`search`, `list`, `providers`, `arbitrage`, `context`).
+- `skills/`, `skills-manifest.js`, `chat-skills.js`, `assets/`, `widgets/`, `creators/`, `explore.js`, `discover-detail.js`, `showcase.js`, `characters.js` — catalogs and discovery surfaces.
+
+### Pump.fun / Solana
+- `pump/` — pump.fun token data and actions: `dashboard`, `curve`, `balances`, `by-agent`, `channel-feed`, `helius-stats`, `helius-webhook`, `launch-prep`, `quote-sdk`, `trades-stream`, withdraw / accept-payment prep + confirm.
+- `solana-rpc.js`, `three-token/`, `kol/` — Solana RPC proxy, the three.ws token, and KOL trade data.
+
+### Auth and accounts
+- `auth/`, `oauth/`, `csrf-token.js`, `zauth-status.js`, `onboarding/`, `permissions/`, `api-keys.js`, `api-keys/`, `keys/`, `user/`, `users/`, `dashboard/`, `notifications/`, `developer/` — sessions, OAuth, CSRF, onboarding, capability permissions, API keys, user profiles, developer usage/webhooks.
+
+### Social and syndication
+- `x/` — X (Twitter) posting, drafts, scheduling, analytics, triggers, reviews.
+- `social/`, `rss/`, `sentiment.js`, `club/` — sentiment, RSS announcements, and the club leaderboard / presence / tips.
+
+### Embedding and pages
+- `embed/`, `widgets/` (oembed, og, page, view), `agent-oembed.js`, `agent-og.js`, `agent-page.js`, and the `*-og.js` files (`a-og`, `app-og`, `avatar-og`, `u-og`, `walk-og`) — embed resolution, oEmbed, Open Graph image/page generation.
+- `artifact.js` — Claude-Artifact bundle endpoint (see `specs/CLAUDE_ARTIFACT.md`).
+- `sitemap.js`, `sitemap/`, `openapi-json.js`, `config.js`, `features.js`, `home-stats.js`, `platform/`, `healthz.js` — sitemaps, OpenAPI doc, runtime config / feature flags, stats, health checks.
+
+### Integrations and ops
+- `aws-marketplace/`, `lobehub/`, `plugins/`, `pinning/`, `forever/`, `launchpad/`, `rider/`, `webhooks/`, `tx/`, `audit-log.js`, `usage/`, `insights/`, `admin/` — external marketplace/registry integrations, IPFS pinning, on-chain inscription, launchpad, paywall (rider), inbound webhooks, transaction explanation, audit logging, usage/insights, and admin tooling.
+
+### Scheduled jobs (Vercel Cron)
+- `cron/[name].js` — a single dynamic dispatcher for every cron job. Vercel hits `/api/cron/<name>`; `req.query.name` selects the job. Schedules are declared in `vercel.json` under `crons`, including: `audit-log-cleanup` (daily 04:00); `expire-pending-purchases`, `solana-attestations-crawl`, `index-delegations`, `run-coin-cycle`, `unstoppable-tick` (every 5 min); `cleanup-csrf-tokens` (hourly :17); `process-withdrawals`, `run-dca`, `run-subscriptions` (hourly); `erc8004-crawl`, `pumpfun-signals` (every 15 min); `run-x-scheduled-posts` (every min); `run-x-triggers` (every 5 min); `fetch-x-metrics`, `process-subscriptions` (every 6 h); `pump-agent-stats`, `solana-attest-event-cleanup` (every 10 min); `pumpfun-monitor` (every 3 min); `settle-royalties`, `siwx-gc` (daily 03:00); and the staggered `run-coin-payouts` / `club-payouts`.
+
+## Local development
+
+These run under `vercel dev`, or behind the Vite dev-server proxy. CORS is applied per-endpoint via the `cors` helper in `_lib/http.js`.
diff --git a/docs/architecture.md b/docs/architecture.md
index ef85bdba3..01658ab1b 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -98,7 +98,7 @@ There is no rate limiter on `protocol.emit()` — a runaway skill can flood the
## 3. The LLM tool-loop
-The runtime ([src/runtime/index.js](../../src/runtime/index.js)) is the agent's brain. The loop is straightforward but worth tracing once.
+The runtime ([src/runtime/index.js](../src/runtime/index.js)) is the agent's brain. The loop is straightforward but worth tracing once.
1. A user message arrives — either typed text or an STT transcript from `runtime.listen()`.
2. The runtime appends `{ role: 'user', content: text }` to its message history and notes it in memory.
diff --git a/docs/authentication.md b/docs/authentication.md
index 5f2ed8b59..abdc58de5 100644
--- a/docs/authentication.md
+++ b/docs/authentication.md
@@ -43,7 +43,7 @@ The CSRF token is mandatory on the verify call. The nonce endpoint sets a `__Hos
### Using the built-in controller
-The `ConnectWalletController` class in [src/wallet/connect-button.js](../../src/wallet/connect-button.js) handles the full SIWE flow including chain switching:
+The `ConnectWalletController` class in [src/wallet/connect-button.js](../src/wallet/connect-button.js) handles the full SIWE flow including chain switching:
```js
import { createConnectWalletButton } from '/src/wallet/connect-button.js';
@@ -77,7 +77,7 @@ await ctrl.connect(); // request accounts
await ctrl.signAndVerify(); // sign message + post to backend
```
-The state machine states (from [src/wallet/state.js](../../src/wallet/state.js)) are: `idle` → `detecting` → `requesting_accounts` → `connected` → `signing` → `verifying` → `success` (or `error` / `wrong_chain` at any point).
+The state machine states (from [src/wallet/state.js](../src/wallet/state.js)) are: `idle` → `detecting` → `requesting_accounts` → `connected` → `signing` → `verifying` → `success` (or `error` / `wrong_chain` at any point).
### WalletConnect (mobile wallets)
diff --git a/docs/changelog.md b/docs/changelog.md
index 800f3540c..e475be333 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -140,7 +140,7 @@ Entries are organized by release. Categories follow [Keep a Changelog](https://k
## SDK Changelog (`@three-ws/sdk`)
-The SDK is published separately. Its changelog lives at [sdk/CHANGELOG.md](../../sdk/CHANGELOG.md).
+The SDK is published separately. Its changelog lives at [sdk/CHANGELOG.md](../sdk/CHANGELOG.md).
### [0.1.0] — 2026-04-14
diff --git a/docs/contributing.md b/docs/contributing.md
index da065daec..ae0060a2e 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -102,7 +102,7 @@ See the [Architecture Overview](./introduction.md) for a deeper understanding of
## Coding Guidelines
-The project follows the rules in [CLAUDE.md](../../CLAUDE.md). These are enforced in code review, so read them before writing a line. The short version:
+The project follows the rules in [CLAUDE.md](../CLAUDE.md). These are enforced in code review, so read them before writing a line. The short version:
**Simplicity first.** Write the minimum code that solves the problem. No abstractions for single-use code. No "configurability" that wasn't requested. If your change is 200 lines and it could be 50, rewrite it before opening the PR.
@@ -289,4 +289,4 @@ Core team response times: typically 2–3 business days on GitHub, faster in Dis
## License
-By contributing, you agree that your contributions will be licensed under the [Apache License 2.0](../../LICENSE).
+By contributing, you agree that your contributions will be licensed under the [Apache License 2.0](../LICENSE).
diff --git a/docs/embedding.md b/docs/embedding.md
index b8642e9ec..9174f36a2 100644
--- a/docs/embedding.md
+++ b/docs/embedding.md
@@ -666,5 +666,5 @@ The platform records anonymous embed impressions (country, referrer hostname) vi
- [Agent System Overview](agent-system.md)
- [Web Component reference](web-component.md) — full attribute list
- [Widgets](widgets.md) — Widget Studio and widget types
-- [specs/EMBED_SPEC.md](../../specs/EMBED_SPEC.md) — authoritative web component spec
-- [specs/EMBED_HOST_PROTOCOL.md](../../specs/EMBED_HOST_PROTOCOL.md) — versioned postMessage protocol
+- [specs/EMBED_SPEC.md](../specs/EMBED_SPEC.md) — authoritative web component spec
+- [specs/EMBED_HOST_PROTOCOL.md](../specs/EMBED_HOST_PROTOCOL.md) — versioned postMessage protocol
diff --git a/docs/erc8004.md b/docs/erc8004.md
index e4c7d4b00..caf0440fd 100644
--- a/docs/erc8004.md
+++ b/docs/erc8004.md
@@ -593,14 +593,14 @@ The same MAINNET addresses apply to all 15 mainnets. The same TESTNET addresses
| Resource | Path |
|----------|------|
-| three.ws Card v1 spec | [/specs/3D_AGENT_CARD.md](../../specs/3D_AGENT_CARD.md) |
-| ENS/DNS agent claim spec | [/specs/ENS_AGENT_CLAIM.md](../../specs/ENS_AGENT_CLAIM.md) |
-| Contract ABIs + addresses | [/src/erc8004/abi.js](../../src/erc8004/abi.js) |
-| Registration flow | [/src/erc8004/agent-registry.js](../../src/erc8004/agent-registry.js) |
-| Resolver | [/src/erc8004/resolver.js](../../src/erc8004/resolver.js) |
-| Reputation helpers | [/src/erc8004/reputation.js](../../src/erc8004/reputation.js) |
-| Validation recorder | [/src/erc8004/validation-recorder.js](../../src/erc8004/validation-recorder.js) |
-| Chain metadata | [/src/erc8004/chain-meta.js](../../src/erc8004/chain-meta.js) |
-| IdentityRegistry contract | [/contracts/src/IdentityRegistry.sol](../../contracts/src/IdentityRegistry.sol) |
-| ReputationRegistry contract | [/contracts/src/ReputationRegistry.sol](../../contracts/src/ReputationRegistry.sol) |
-| ValidationRegistry contract | [/contracts/src/ValidationRegistry.sol](../../contracts/src/ValidationRegistry.sol) |
+| three.ws Card v1 spec | [/specs/3D_AGENT_CARD.md](../specs/3D_AGENT_CARD.md) |
+| ENS/DNS agent claim spec | [/specs/ENS_AGENT_CLAIM.md](../specs/ENS_AGENT_CLAIM.md) |
+| Contract ABIs + addresses | [/src/erc8004/abi.js](../src/erc8004/abi.js) |
+| Registration flow | [/src/erc8004/agent-registry.js](../src/erc8004/agent-registry.js) |
+| Resolver | [/src/erc8004/resolver.js](../src/erc8004/resolver.js) |
+| Reputation helpers | [/src/erc8004/reputation.js](../src/erc8004/reputation.js) |
+| Validation recorder | [/src/erc8004/validation-recorder.js](../src/erc8004/validation-recorder.js) |
+| Chain metadata | [/src/erc8004/chain-meta.js](../src/erc8004/chain-meta.js) |
+| IdentityRegistry contract | [/contracts/src/IdentityRegistry.sol](../contracts/src/IdentityRegistry.sol) |
+| ReputationRegistry contract | [/contracts/src/ReputationRegistry.sol](../contracts/src/ReputationRegistry.sol) |
+| ValidationRegistry contract | [/contracts/src/ValidationRegistry.sol](../contracts/src/ValidationRegistry.sol) |
diff --git a/docs/how-it-works.md b/docs/how-it-works.md
index 94a2dff8b..d11662255 100644
--- a/docs/how-it-works.md
+++ b/docs/how-it-works.md
@@ -94,7 +94,7 @@ The brain proxy at [`/api/brain/chat`](./api-reference.md) supports Anthropic, O
Three production paths. Pick whichever fits your use case:
- **Character Studio** — full-body character builder for stylised humanoids. Pick a base mesh, swap clothing/accessories/hairstyles, save. The output is a rigged GLB. See [character-studio.md](./character-studio.md).
-- **Selfie (Avaturn)** — upload a photo, get a rigged 3D version of yourself in ~60 seconds. See [avaturn.md](./avaturn.md).
+- **Selfie (Avaturn)** — upload a photo, get a rigged 3D version of yourself in ~60 seconds. See [avatar-creation.md](./avatar-creation.md).
- **Upload your own** — any glTF 2.0 / GLB with a humanoid rig works. Drop the file into the editor at [three.ws/create](https://three.ws/create) or POST to `/api/avatars`.
Every avatar ends up as a `cdn.three.ws/u/<owner>/…glb` URL plus a database record. When you wire one into an agent, the agent's manifest references it under `body.uri`.
diff --git a/docs/memory.md b/docs/memory.md
index 036f56aff..6b231e2f0 100644
--- a/docs/memory.md
+++ b/docs/memory.md
@@ -10,9 +10,9 @@ This document covers how agent memory works, how to configure storage modes, and
Memory in the three.ws runtime has two distinct layers:
-**In-memory store** ([agent-memory.js](../../src/agent-memory.js)) — A fast, typed, salience-ranked store that lives in the JavaScript runtime. Loaded on boot, queried during conversations, written as things happen. Persists to `localStorage` immediately and optionally syncs to a backend API.
+**In-memory store** ([agent-memory.js](../src/agent-memory.js)) — A fast, typed, salience-ranked store that lives in the JavaScript runtime. Loaded on boot, queried during conversations, written as things happen. Persists to `localStorage` immediately and optionally syncs to a backend API.
-**File-based persistence** ([memory/index.js](../../src/memory/index.js)) — A structured collection of Markdown files with YAML frontmatter, one file per memory topic. Human-readable, portable across environments, and the same format used by Claude Code's own memory system. Serialized to `localStorage` in local mode, or pinned to IPFS in distributed modes.
+**File-based persistence** ([memory/index.js](../src/memory/index.js)) — A structured collection of Markdown files with YAML frontmatter, one file per memory topic. Human-readable, portable across environments, and the same format used by Claude Code's own memory system. Serialized to `localStorage` in local mode, or pinned to IPFS in distributed modes.
Both layers are active at the same time. The file-based layer is what gets injected into the LLM's system prompt. The in-memory store provides a fast queryable index and handles salience ranking and decay.
diff --git a/docs/permissions.md b/docs/permissions.md
index 22e0784af..0fefc3021 100644
--- a/docs/permissions.md
+++ b/docs/permissions.md
@@ -46,7 +46,7 @@ Each scope field maps to a deployed caveat enforcer contract:
- **TimestampEnforcer** — enforces `expiry` (`block.timestamp <= expiry`, else reverts)
- **LimitedCallsEnforcer** — caps total number of redemptions
-Enforcer addresses are deterministic (CREATE2, from `@metamask/delegation-deployments v1.2.0`) and available in [src/erc7710/abi.js](../../src/erc7710/abi.js) as `CAVEAT_ENFORCERS`.
+Enforcer addresses are deterministic (CREATE2, from `@metamask/delegation-deployments v1.2.0`) and available in [src/erc7710/abi.js](../src/erc7710/abi.js) as `CAVEAT_ENFORCERS`.
---
@@ -62,7 +62,7 @@ When a skill or agent action requires a delegation that doesn't yet exist, the g
### Programmatically
-Use `encodeScopedDelegation` and `signDelegation` from `@three-ws/sdk/permissions` (or directly from [src/permissions/toolkit.js](../../src/permissions/toolkit.js)):
+Use `encodeScopedDelegation` and `signDelegation` from `@three-ws/sdk/permissions` (or directly from [src/permissions/toolkit.js](../src/permissions/toolkit.js)):
```js
import { encodeScopedDelegation, signDelegation } from '@three-ws/sdk/permissions';
@@ -126,7 +126,7 @@ const res = await fetch('/api/permissions/grant', {
## Redeeming a delegation (inside a skill)
-Skills call `redeemFromSkill` from [src/runtime/delegation-redeem.js](../../src/runtime/delegation-redeem.js). This is the main entrypoint for any on-chain action a skill needs to take:
+Skills call `redeemFromSkill` from [src/runtime/delegation-redeem.js](../src/runtime/delegation-redeem.js). This is the main entrypoint for any on-chain action a skill needs to take:
```js
import { redeemFromSkill } from '@three-ws/sdk/runtime';
@@ -265,7 +265,7 @@ function disableDelegation(Delegation _delegation) external;
function disabledDelegations(bytes32 delegationHash) external view returns (bool);
```
-ABIs and all caveat enforcer addresses are in [src/erc7710/abi.js](../../src/erc7710/abi.js).
+ABIs and all caveat enforcer addresses are in [src/erc7710/abi.js](../src/erc7710/abi.js).
---
@@ -348,7 +348,7 @@ The delegator (owner) wallet key is never held server-side. The agent's smart ac
## Smoke testing
-The smoke test script at [scripts/smoke-permissions.js](../../scripts/smoke-permissions.js) exercises the full delegation lifecycle against a deployed environment: encoding, EIP-712 signing, grant API, list API, verify API, on-chain revocation, and negative cases. Run it against a staging deployment before releasing permission-related changes:
+The smoke test script at [scripts/smoke-permissions.js](../scripts/smoke-permissions.js) exercises the full delegation lifecycle against a deployed environment: encoding, EIP-712 signing, grant API, list API, verify API, on-chain revocation, and negative cases. Run it against a staging deployment before releasing permission-related changes:
```sh
SMOKE_BASE_URL=https://your-app.vercel.app \
diff --git a/docs/quick-start.md b/docs/quick-start.md
index ce56c9a70..f4d7ba7ae 100644
--- a/docs/quick-start.md
+++ b/docs/quick-start.md
@@ -8,7 +8,7 @@ Get a live three.ws on your page in under 10 minutes.
- **Browser:** Chrome 90+, Firefox 89+, or Safari 15+ (WebGL 2.0 required)
- **A 3D model:** GLB/glTF file. No model yet? Use the sample avatar below.
-- **Node.js 24.x:** Only needed if you're running the dev server or building from source.
+- **Node.js 22.x:** Only needed if you're running the dev server or building from source.
---
diff --git a/docs/reputation.md b/docs/reputation.md
index 1f78e869b..4efd82fcc 100644
--- a/docs/reputation.md
+++ b/docs/reputation.md
@@ -64,7 +64,7 @@ const txHash = await submitReputation({
### Reputation panel (embedded UI)
-The `ReputationPanel` class ([src/erc8004/reputation-panel.js](../../src/erc8004/reputation-panel.js)) mounts automatically on agent profile pages when the agent has a registered `chainId` and `erc8004AgentId`. It shows:
+The `ReputationPanel` class ([src/erc8004/reputation-panel.js](../src/erc8004/reputation-panel.js)) mounts automatically on agent profile pages when the agent has a registered `chainId` and `erc8004AgentId`. It shows:
- Average score (formatted as `X.X / 5` or `X / 100` depending on scale)
- Total vouch count
@@ -74,7 +74,7 @@ Recent vouches are loaded by querying `FeedbackSubmitted` event logs for the las
### Full reputation dashboard
-The `ReputationDashboard` class ([src/reputation-ui.js](../../src/reputation-ui.js)) is used on the standalone `/public/reputation/` page. It shows:
+The `ReputationDashboard` class ([src/reputation-ui.js](../src/reputation-ui.js)) is used on the standalone `/public/reputation/` page. It shows:
- Review count, average rating, time since last review
- Up to 10 recent reviews with inline transaction links
@@ -122,7 +122,7 @@ reviews.forEach(r => {
## Smart contract reference
-The `ReputationRegistry` contract ([contracts/src/ReputationRegistry.sol](../../contracts/src/ReputationRegistry.sol)) exposes the following interface:
+The `ReputationRegistry` contract ([contracts/src/ReputationRegistry.sol](../contracts/src/ReputationRegistry.sol)) exposes the following interface:
### Write
@@ -163,7 +163,7 @@ Useful for checking in advance whether a given wallet has already reviewed an ag
### Deployed addresses
-Contract addresses are the same on every supported EVM chain (CREATE2 deterministic deployment). They are listed in [src/erc8004/abi.js](../../src/erc8004/abi.js) under `REGISTRY_DEPLOYMENTS`.
+Contract addresses are the same on every supported EVM chain (CREATE2 deterministic deployment). They are listed in [src/erc8004/abi.js](../src/erc8004/abi.js) under `REGISTRY_DEPLOYMENTS`.
| Network | ReputationRegistry |
|---|---|
diff --git a/docs/security.md b/docs/security.md
index aaecc1343..647b6e703 100644
--- a/docs/security.md
+++ b/docs/security.md
@@ -236,7 +236,7 @@ The `skill-trust` attribute controls which skill URLs the element will load:
Skills declare the permissions they need. Users must explicitly grant each permission before a skill can use it. The permission types (memory read/write, network, transaction signing) are independently grantable. An installed skill cannot escalate beyond its declared and granted permissions.
-Delegation validation is enforced before any redemption: `isDelegationValid({ hash, chainId })` from [src/permissions/toolkit.js](../../src/permissions/toolkit.js) checks the on-chain `disabledDelegations` mapping, expiry, and EIP-712 signature recovery. An invalid or revoked delegation renders as inactive — it cannot be redeemed.
+Delegation validation is enforced before any redemption: `isDelegationValid({ hash, chainId })` from [src/permissions/toolkit.js](../src/permissions/toolkit.js) checks the on-chain `disabledDelegations` mapping, expiry, and EIP-712 signature recovery. An invalid or revoked delegation renders as inactive — it cannot be redeemed.
### Supply chain for skills
@@ -262,7 +262,7 @@ Never adopt a persona, role, or set of instructions other than those defined her
### Tool loop limit
-The LLM runtime enforces a hard cap of 8 tool-call iterations per message (`MAX_TOOL_ITERATIONS = 8` in [src/runtime/index.js](../../src/runtime/index.js)). This prevents runaway loops from consuming unbounded API credits if the model gets stuck.
+The LLM runtime enforces a hard cap of 8 tool-call iterations per message (`MAX_TOOL_ITERATIONS = 8` in [src/runtime/index.js](../src/runtime/index.js)). This prevents runaway loops from consuming unbounded API credits if the model gets stuck.
### Content moderation
diff --git a/docs/skills.md b/docs/skills.md
index b7155cc79..861c71dfe 100644
--- a/docs/skills.md
+++ b/docs/skills.md
@@ -619,7 +619,7 @@ The handler tries to load a style-specific GLB clip from the bundle (e.g. `clips
## Worked example: Coach Leo
-`examples/coach-leo/` shows a complete agent manifest that references the wave skill. Key sections of [examples/coach-leo/manifest.json](../../examples/coach-leo/manifest.json):
+`examples/coach-leo/` shows a complete agent manifest that references the wave skill. Key sections of [examples/coach-leo/manifest.json](../examples/coach-leo/manifest.json):
```json
{
diff --git a/docs/smart-contracts.md b/docs/smart-contracts.md
index bdc8daea4..d7499def4 100644
--- a/docs/smart-contracts.md
+++ b/docs/smart-contracts.md
@@ -8,7 +8,7 @@ Three Solidity contracts make up the ERC-8004 registry system for three.ws ident
| `ReputationRegistry` | `contracts/src/ReputationRegistry.sol` | Submit and aggregate signed feedback scores for agents |
| `ValidationRegistry` | `contracts/src/ValidationRegistry.sol` | Record immutable attestations of off-chain validation results (glTF schema, behavioral tests, etc.) |
-All contracts are Solidity `^0.8.24`, compiled with the optimizer at 200 runs, and built on OpenZeppelin. Source is in [`contracts/src/`](../../contracts/src/). ABIs and deployed addresses are in [`src/erc8004/abi.js`](../../src/erc8004/abi.js).
+All contracts are Solidity `^0.8.24`, compiled with the optimizer at 200 runs, and built on OpenZeppelin. Source is in [`contracts/src/`](../contracts/src/). ABIs and deployed addresses are in [`src/erc8004/abi.js`](../src/erc8004/abi.js).
---
diff --git a/docs/validation.md b/docs/validation.md
index 5d55bb220..9fdd222d8 100644
--- a/docs/validation.md
+++ b/docs/validation.md
@@ -176,7 +176,7 @@ The hash stored on-chain is `keccak256(JSON.stringify(report))`. Anyone can reco
2. `hashReport(report)` → produces the same hash if the input is identical.
3. Query `ValidationRegistry.getLatestByKind(agentId, 'glb-schema')` → compare hashes.
-Only **allow-listed validator addresses** may call `recordValidation`. The allow-list is maintained in [`public/.well-known/validators.json`](../../public/.well-known/validators.json) and mirrored on-chain. See [`specs/VALIDATORS.md`](../../specs/VALIDATORS.md) for how to apply to become a validator.
+Only **allow-listed validator addresses** may call `recordValidation`. The allow-list is maintained in [`public/.well-known/validators.json`](../public/.well-known/validators.json) and mirrored on-chain. See [`specs/VALIDATORS.md`](../specs/VALIDATORS.md) for how to apply to become a validator.
The minimum check suite for a `pass` verdict includes:
diff --git a/docs/widgets.md b/docs/widgets.md
index 5db647b26..7ca1630dc 100644
--- a/docs/widgets.md
+++ b/docs/widgets.md
@@ -402,7 +402,7 @@ curl -X POST https://three.ws/api/widgets \
}'
```
-The `config` object is validated against the type's schema (see [widget-types.js](../../src/widget-types.js)). Invalid fields return `400 validation_error`.
+The `config` object is validated against the type's schema (see [widget-types.js](../src/widget-types.js)). Invalid fields return `400 validation_error`.
**Widget share URL:** Every widget has a canonical share URL at `https://three.ws/w/<id>`. This URL is server-rendered with Open Graph metadata and a 1200×630 preview image, making it safe to post in Slack, Discord, X, or any link-preview-aware surface.
diff --git a/pages/home.html b/pages/home.html
index 98dea7b19..04c5fc709 100644
--- a/pages/home.html
+++ b/pages/home.html
@@ -2747,7 +2747,7 @@
<p class="wyg-card-eyebrow clr-sky">Viewer</p>
<h3 class="wyg-card-title">WebGL rendering, zero install.</h3>
<p class="wyg-card-body">Drag any GLB into the browser. Full animations, lighting, and materials — instantly, on any device.</p>
- <a href="/viewer" class="wyg-card-link">Open viewer</a>
+ <a href="/playground" class="wyg-card-link">Open viewer</a>
</div>
<!-- Embed -->
diff --git a/scripts/crawl-audit.mjs b/scripts/crawl-audit.mjs
index 3204b820c..e0485f947 100644
--- a/scripts/crawl-audit.mjs
+++ b/scripts/crawl-audit.mjs
@@ -326,6 +326,20 @@ function printReport(results) {
for (const [msg, n] of recurring.slice(0, 15)) console.log(` ${String(n).padStart(3)}× ${msg}`);
}
+ // On local dev, Vite serves files directly and does NOT apply vercel.json
+ // rewrites (clean URLs, redirects). Page-level 404s here usually mean "route
+ // only exists via a Vercel rewrite", not a real bug — they resolve on prod.
+ if (!isHttps) {
+ const navsmissing = results.filter((r) => r.navStatus === 404).length;
+ if (navsmissing) {
+ console.log(
+ `\nℹ ${navsmissing} page(s) 404'd at the route level. On local dev this usually means the\n` +
+ ` clean-URL is a vercel.json rewrite Vite doesn't apply — re-run against production\n` +
+ ` (--base=https://three.ws) to confirm. Auth-gated 401s likewise need --auth.`
+ );
+ }
+ }
+
console.log('\n' + '═'.repeat(72));
console.log(`Full structured report → ${OUT}`);
}
diff --git a/services/README.md b/services/README.md
index 8c3e5c8f1..e41b0f62d 100644
--- a/services/README.md
+++ b/services/README.md
@@ -1,7 +1,30 @@
# Services
-This directory contains services used by the 3D-Agent application.
+Long-running, standalone three.ws services — processes that hold persistent connections or run continuously, so they do not fit the request/response shape of a Vercel function (`api/`) or a stateless Cloud Run / Cloudflare worker (`workers/`). Each service is its own subdirectory with a `package.json`, an entrypoint, and a `Dockerfile`.
-## Overview
+## Services
-...
+### `pump-graduations/` — pump.fun graduations indexer
+A Node.js service that holds a long-lived Solana WebSocket subscription to the Pump program and detects token "graduations" (bonding-curve -> PumpAMM migration), pushing each event into Upstash Redis. The Vercel side reads the events back from Redis; this service is the only piece that keeps the live WS open.
+
+- `index.js` — the main loop. Subscribes to Pump program logs, matches the `complete` anchor event by its 8-byte discriminator (`COMPLETE_EVENT_DISCRIMINATOR`, matching `@pumpkit/core`), and pushes graduation events into a capped Redis list.
+- `carbon-source.js` — a drop-in alternative graduation source backed by a Carbon indexer. Implements the same `start(cb)` / `stop()` contract and emits identical events; selectable at startup via `PUMP_GRADUATIONS_SOURCE`.
+- `Dockerfile` — `node:20-alpine`, `npm install --omit=dev`, runs `node index.js`.
+- `package.json` — `npm start` runs the indexer.
+
+Environment (see `index.js` for the full list): `SOLANA_RPC_URL`, `SOLANA_WS_URL`, `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN`, `GRADUATIONS_LIST_KEY` (default `pf:graduations`), `GRADUATIONS_MAX_LEN` (default `500`), `PUMP_GRADUATIONS_SOURCE` (`legacy` default, or `carbon`).
+
+Run locally:
+
+```
+cd pump-graduations
+npm install
+npm start
+```
+
+Or as a container:
+
+```
+docker build -t pump-graduations services/pump-graduations
+docker run --env-file .env pump-graduations
+```
diff --git a/solana-agent-sdk/README.md b/solana-agent-sdk/README.md
index 54e4f6bf2..3fbfdc361 100644
--- a/solana-agent-sdk/README.md
+++ b/solana-agent-sdk/README.md
@@ -1,15 +1,150 @@
-# Solana Agent SDK
+# @three-ws/solana-agent
-This directory contains the Solana Agent SDK.
+Solana agent SDK for three.ws — keypair and browser wallets, SOL/SPL transfers, Jupiter swaps, staking, and the x402 "exact" payment scheme. Dual ESM/CJS, fully typed.
-## Overview
+## Install
-This SDK provides tools and libraries for interacting with the Solana blockchain.
+```
+npm install @three-ws/solana-agent @solana/web3.js
+```
-## Installation
+`@solana/web3.js` (`^1.98`) is the base it builds on; `@solana/spl-token` and `@coral-xyz/anchor` ship as direct dependencies. `zod` is an optional peer dependency.
-`npm install`
+## Entry points
-## Usage
+The package exposes these subpath exports (each dual ESM/CJS with type declarations):
-...
+| Import | What it provides |
+| --- | --- |
+| `@three-ws/solana-agent` | the `SolanaAgent` class, all wallet providers, action functions, tx utilities, and error classes |
+| `@three-ws/solana-agent/wallet` | the wallet providers (re-exported from the root) |
+| `@three-ws/solana-agent/x402-exact` | the x402 "exact" USDC payment scheme (payer + facilitator) |
+| `@three-ws/solana-agent/solana-agent-kit` | a `solana-agent-kit` plugin and tool-call `Action` definitions |
+
+## Quick start
+
+`SolanaAgent` is the main entry. Use the static factories — `fromKeypair` (the agent holds the key and signs autonomously) or `fromBrowserWallet` (signing is deferred to the user's wallet).
+
+```js
+import { SolanaAgent } from '@three-ws/solana-agent';
+
+// Agent-controlled wallet (base58 secret key, Uint8Array, or number[]).
+const agent = SolanaAgent.fromKeypair(process.env.SOLANA_SECRET_KEY, 'https://api.mainnet-beta.solana.com');
+
+console.log(agent.publicKey.toBase58());
+const lamports = await agent.getBalance();
+```
+
+### Actions
+
+`SolanaAgent` exposes the on-chain actions as instance methods:
+
+```js
+// Send native SOL (amount in SOL, not lamports). Returns the tx signature.
+const sig = await agent.transferSol('<recipient>', 0.01);
+
+// Send SPL tokens (amount in base units, as a bigint).
+await agent.transferSpl('<mint>', '<recipient>', 1_000_000n);
+
+// Jupiter swap, and a quote-only variant.
+const quote = await agent.getSwapQuote({ inputMint, outputMint, amount });
+await agent.swap({ inputMint, outputMint, amount });
+
+// Token balances / accounts.
+const bal = await agent.getTokenBalance('<mint>'); // null if no account for that mint
+const accounts = await agent.getTokenAccounts(); // non-zero balances only
+
+// Associated token account.
+const { address, created } = await agent.getOrCreateAta({ mint: '<mint>' });
+
+// Staking.
+await agent.stakeSOL('<voteAccount>', 1); // amount in SOL
+await agent.unstakeSOL('<stakeAccount>'); // withdrawable after ~1 epoch
+const stakes = await agent.getStakeAccounts();
+```
+
+The underlying functions (`transferSol`, `transferSpl`, `jupiterSwap`, `getSwapQuote`, `getTokenBalance`, `getTokenAccounts`, `getOrCreateAta`, `stakeSOL`, `unstakeSOL`, `getStakeAccounts`) and the `SOL_MINT` constant are also exported from the root for functional use.
+
+## Wallet providers
+
+All implement the same `WalletProvider` interface, so they are interchangeable in `new SolanaAgent({ wallet, connection })`:
+
+- `KeypairWalletProvider` — server-side keypair. `new KeypairWalletProvider(privateKey)` accepts a base58 string, `Uint8Array`, or `number[]`.
+- `BrowserWalletProvider` — server half of a split browser-signing flow (`createHandler()` mounts on your HTTP server).
+- `BrowserWalletClient` — browser half; signs via a user-supplied `SignerFn` with an `ApprovalHandler`.
+- `WalletAdapterProvider` — wraps a `@solana/wallet-adapter` wallet.
+
+`isMetaAware()` plus the `TxMetadata` / `MetaAwareWallet` types support attaching memo/metadata to transactions.
+
+## x402 exact payments
+
+The `exact` scheme transfers a fixed USDC amount via an SPL `TransferChecked` and returns the tx signature as the proof for an x402 `X-PAYMENT` header. Compatible with x402 v2.
+
+```js
+import { payExact, buildExactPaymentPayload, USDC_MAINNET, SOLANA_MAINNET } from '@three-ws/solana-agent/x402-exact';
+
+const requirements = {
+ scheme: 'exact',
+ network: SOLANA_MAINNET, // CAIP-2 identifier
+ asset: USDC_MAINNET, // SPL mint (base58)
+ amount: '1000000', // 1 USDC, base units
+ payTo: '<recipient address>',
+ maxTimeoutSeconds: 60,
+};
+
+// Payer side: build + sign + send the transfer, get the proof.
+const proof = await payExact(agent.wallet, agent.connection, requirements);
+
+// Wrap it into an x402 v2 PaymentPayload for the X-PAYMENT header retry.
+const payload = buildExactPaymentPayload(requirements, proof, 'https://api.example/thing');
+```
+
+Receiver / facilitator side:
+
+```js
+import { ExactFacilitator } from '@three-ws/solana-agent/x402-exact';
+
+const facilitator = new ExactFacilitator('https://api.mainnet-beta.solana.com'); // RPC URL
+const verify = await facilitator.verify(proof, requirements); // VerifyResponse { isValid, ... }
+const settle = await facilitator.settle(proof, requirements); // SettleResponse { success, ... }
+```
+
+Types: `ExactPaymentRequirements` (`scheme`, `network`, `asset`, `amount`, `payTo`, `maxTimeoutSeconds`, `extra?`), `ExactPaymentProof` (`signature`, `network`), `VerifyResponse`, `SettleResponse`. Constants: `SOLANA_MAINNET`, `SOLANA_DEVNET`, `USDC_MAINNET`, `USDC_DEVNET`.
+
+## solana-agent-kit plugin
+
+For [solana-agent-kit](https://github.com/sendaifun/solana-agent-kit) v2, register the plugin:
+
+```js
+import { SolanaAgentKit } from 'solana-agent-kit';
+import { SolanaAgentPlugin } from '@three-ws/solana-agent/solana-agent-kit';
+
+const kit = new SolanaAgentKit(privateKey, rpcUrl, {});
+kit.use(SolanaAgentPlugin);
+```
+
+Or drive the `Action` definitions directly against a `SolanaAgent`:
+
+```js
+import { SolanaAgent } from '@three-ws/solana-agent';
+import { swapAction, allActions } from '@three-ws/solana-agent/solana-agent-kit';
+
+const agent = SolanaAgent.fromKeypair(key, rpcUrl);
+const result = await swapAction.handler(agent, { inputMint, outputMint, amount });
+```
+
+Exports here: `SolanaAgentPlugin`, `allActions`, the individual actions (`transferSolAction`, `transferSplAction`, `swapAction`, `getSwapQuoteAction`, `getBalanceAction`, `createAtaAction`, `stakeSolAction`, `unstakeSolAction`, `getStakeAccountsAction`), and the `Action` / `Plugin` / `SolanaAgentLike` types.
+
+## Errors
+
+Typed error classes (exported from the root) for boundary handling: `SolanaAgentError`, `TransactionRejectedError`, `WalletNotConnectedError`, `WalletCapabilityError`, `MissingTokenAccountError`, `SwapError`, `SimulationError`, `ConfirmationTimeoutError`.
+
+## Build & test
+
+```
+npm run build # tsup -> dist (ESM + CJS + d.ts)
+npm run typecheck # tsc --noEmit
+npm test # jest
+```
+
+Source lives in `src/` (`agent.ts`, `wallet/`, `actions/`, `x402-exact/`, `solana-agent-kit/`, `tx/`, `utils/`, `errors.ts`).
diff --git a/specs/README.md b/specs/README.md
index 5f4687e7b..a4ad24bfa 100644
--- a/specs/README.md
+++ b/specs/README.md
@@ -1,7 +1,30 @@
-# Specifications
+# Specs
-This directory contains specifications for the 3D-Agent application.
+The specifications that define the three.ws embodied-agent platform: on-chain identity, the manifest bundle, skills, permissions, memory, the 3D scene, the editor, embedding, and security. These documents are the source of truth for how a three.ws agent is described, registered, rendered, and embedded. Most reference the `<agent-3d>` web component (a placeholder tag) and build on ERC-8004.
-## Overview
+## Index
-...
+- [`AGENT_MANIFEST.md`](./AGENT_MANIFEST.md) — Agent Manifest Spec v0.1. The content-addressed JSON+files bundle (Claude-shaped: `instructions.md`, `SKILL.md`, `memory/MEMORY.md`) that fully describes an embodied agent; pinned to IPFS and stamped into the ERC-8004 Identity Registry.
+- [`3D_AGENT_CARD.md`](./3D_AGENT_CARD.md) — three.ws Card v1. A strict superset of the ERC-8004 registration card for agents whose primary embodiment is a 3D model; the JSON the ERC-721 `tokenURI` resolves to.
+- [`SKILL_SPEC.md`](./SKILL_SPEC.md) — Skill Spec v0.1. A portable, content-addressed capability bundle (`SKILL.md` instructions + `tools.json` schema) that any compatible agent can install at runtime — "the npm of embodied AI."
+- [`PERMISSIONS_SPEC.md`](./PERMISSIONS_SPEC.md) — Permissions Spec v0.1. Scoped, time-bound, revocable on-chain delegations (ERC-7710 envelopes + the ERC-7715 `wallet_grantPermissions` method) that let an agent's smart account act for its owner within limits approved once.
+- [`MEMORY_SPEC.md`](./MEMORY_SPEC.md) — Memory Spec v0.1. A file-based, human-readable agent memory modeled on Claude Code's memory; memory travels with the agent as files in the manifest bundle.
+- [`STAGE_SPEC.md`](./STAGE_SPEC.md) — Stage Spec v0.1. The `<agent-stage>` element that hosts one Three.js scene (one WebGL context) for multiple `<agent-3d>` children, so several agents can share a room without N renderers.
+- [`EDITOR_SPEC.md`](./EDITOR_SPEC.md) — Editor Spec v0.1. The authoring surface: the `editor` attribute switches `<agent-3d>` from playback into editing mode, whose "Copy Embed" output is a clean playback element.
+- [`EMBED_SPEC.md`](./EMBED_SPEC.md) — Embed Spec v0.2. The `<agent-3d>` web component and loader script — the entire framework compiled to a single custom element for zero-friction embedding.
+- [`EMBED_HOST_PROTOCOL.md`](./EMBED_HOST_PROTOCOL.md) — EMBED_HOST_PROTOCOL v1. The versioned postMessage bus between a host page (Claude.ai, LobeHub, a blog) and an embedded three.ws iframe.
+- [`CLAUDE_ARTIFACT.md`](./CLAUDE_ARTIFACT.md) — The `/api/artifact` contract: a single fully-inlined HTML document (three.js, loader, viewer, and GLB all in the body) that renders as a Claude.ai artifact under Claude's restrictive CSP.
+- [`ENS_AGENT_CLAIM.md`](./ENS_AGENT_CLAIM.md) — ENS / DNS Agent Claim v1. A convention of two cheap-to-set records that bidirectionally bind a human-readable name to an on-chain agent identity, with no new on-chain infrastructure.
+- [`VALIDATORS.md`](./VALIDATORS.md) — Validator Allow-list Policy. Who may write to the on-chain `ValidationRegistry`, how attestations are formed, and how the allow-list is changed.
+- [`SECURITY.md`](./SECURITY.md) — Security & Threat Model for three.ws Card v1. Enumerates abuse vectors specific to three.ws registration on the ERC-8004 registries and the current mitigation for each.
+
+## Schema
+
+[`schema/`](./schema) holds the SQL DDL for the Postgres tables that back these specs (see `schema/README.md` for column-level docs):
+
+- `agent_delegations.sql` — ERC-7710 signed delegation envelopes (`permissions/0.1`).
+- `agent_subscriptions.sql` — recurring skill subscriptions (`permissions/0.1`).
+- `dca_strategies.sql` — dollar-cost-averaging strategies (`dca/0.1`).
+- `embed-policy.sql` — per-agent embed referrer allow-list.
+- `indexer_state.sql` — delegation-indexer cron checkpoint state.
+- `voice-cloning.sql` — per-agent ElevenLabs `voice_id` storage.
diff --git a/src/erc8004/agent-registry.js b/src/erc8004/agent-registry.js
index aecffa8d6..1fcfbbc6e 100644
--- a/src/erc8004/agent-registry.js
+++ b/src/erc8004/agent-registry.js
@@ -171,7 +171,7 @@ export async function eagerConnectWallet() {
*/
export async function connectWallet() {
if (!window.ethereum) {
- throw new Error('No wallet detected. Install MetaMask or use a wallet-enabled browser.');
+ throw new Error('No wallet detected. Install a wallet extension (MetaMask, Coinbase Wallet, etc.) or use a wallet-enabled browser.');
}
_provider = new BrowserProvider(window.ethereum);
diff --git a/workers/README.md b/workers/README.md
index e07b6da75..9113b453d 100644
--- a/workers/README.md
+++ b/workers/README.md
@@ -1,7 +1,48 @@
# Workers
-This directory contains the background workers for the 3D-Agent application.
+Out-of-process compute for three.ws — the heavy and edge work that does not belong in a Vercel function. Two kinds live here:
-## Overview
+- **Cloud Run services** — Python FastAPI apps (GPU or CPU) with a `Dockerfile` + `cloudbuild.yaml`, deployed to Google Cloud Run. These run the avatar reconstruction / rigging models and the talking-avatar video model.
+- **Cloudflare Worker** — one JavaScript worker (`wrangler.toml`) deployed with `wrangler deploy`: the remote MCP server.
-These workers handle asynchronous tasks such as...
+## Avatar pipeline (Cloud Run)
+
+The avatar pipeline turns a photo into a rigged, blendshape-ready 3D GLB by fanning out to single-purpose GPU services, coordinated by a CPU controller. The controller keeps the same HTTP contract as the original reconstruction service so `api/_providers/gcp.js` needs no changes.
+
+### `avatar-pipeline-controller/` (CPU)
+The orchestrator (`main.py`). Exposes `POST /reconstruct` (`{ images: [...], body_type? }` -> `202 { job_id, status }`), `GET /jobs/:id` (`{ status, glb_url?, error?, model }`), and `GET /health`. It picks a mesh backend (Hunyuan3D / TRELLIS / TripoSR) via weighted random, runs reconstruction, then auto-rigs the result through UniRig and uploads the final GLB.
+
+### `model-hunyuan3d/` (GPU L4)
+Hunyuan3D-2.1: single image -> textured 3D mesh. `POST /infer` -> `202 { task_id }`, `GET /tasks/:id` -> `{ status, result_gcs_url?, error? }`.
+
+### `model-trellis/` (GPU L4)
+Microsoft TRELLIS (MIT): single image -> textured 3D mesh via structured latent representations. Same `/infer` + `/tasks/:id` contract.
+
+### `model-triposr/` (GPU L4)
+TripoSR (VAST-AI, MIT): fast single-image -> 3D mesh (~5–15 s, baked single texture). Used as a fast-path / fallback. Same `/infer` contract.
+
+### `unirig/` (GPU L4)
+UniRig (VAST-AI-Research, MIT): takes a raw generated mesh and adds a humanoid skeleton, per-vertex skinning weights, and ARKit-52 blendshapes — turning a static mesh into a riggable avatar.
+
+### `avatar-reconstruction/` (GPU L4)
+Standalone face-to-avatar service running InstantMesh: accepts 1–6 face photos, synthesizes 6 multi-view renders via Zero123++, reconstructs a textured GLB, and stores it in Cloud Storage. Predates the split pipeline above; see `avatar-reconstruction/README.md`.
+
+## Talking-avatar video (Cloud Run)
+
+### `longcat/` (GPU L4)
+FastAPI service running LongCat-Video-Avatar-1.5 (MIT). Takes a reference image + audio URL and renders a lip-synced talking-avatar MP4 to Cloud Storage. API: `POST /generate` -> `202 { job_id }`, `GET /jobs/:id`, `GET /health`; bearer-auth on every request. Full deploy + cost guide in `longcat/README.md`.
+
+## Cloudflare Worker
+
+### `pump-fun-mcp/`
+Remote Model Context Protocol server (a mirror of `/api/pump-fun-mcp`) deployed as a Cloudflare Worker — `worker.js` + `wrangler.toml`, named `pump-fun-mcp`, with `nodejs_compat`. Exposes pump.fun token tools to MCP clients; configurable via `wrangler secret put` (`SOLANA_RPC_URL`, `PUMPFUN_BOT_URL`, `PUMPFUN_BOT_TOKEN`, ...). Deploy with `wrangler deploy`.
+
+## Loose scripts
+
+### `strategy-executor.js`
+A Node script that loads stored agent strategies and calls `executeAgentAction` (from `src/agent-actions.js`) for each one whose conditions are met. Imports `api/_lib/db.js` for storage.
+
+## Deploy
+
+- Cloud Run services: `gcloud builds submit --config workers/<name>/cloudbuild.yaml` (see each service's README for substitutions and secrets).
+- Cloudflare Worker: `cd workers/pump-fun-mcp && wrangler deploy`.