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.

chore: sync docs, specs, and yields page updates

nirholasd09988a8a1b5
diff --git a/docs/DESIGN-TOKENS.md b/docs/DESIGN-TOKENS.md
index d6ac4c4ee..b17472dab 100644
--- a/docs/DESIGN-TOKENS.md
+++ b/docs/DESIGN-TOKENS.md
@@ -1,7 +1,8 @@
# Design Tokens — three.ws
-Canonical design vocabulary. Source of truth: the `:root` block in
-[`public/style.css`](../public/style.css). New pages reference these tokens
+Canonical design vocabulary. Source of truth for every primitive:
+[`public/tokens.css`](../public/tokens.css); [`public/style.css`](../public/style.css)
+imports it first and layers component tokens on top. New pages reference these tokens
directly (`var(--surface-1)`, `var(--text-md)`, `var(--font-display)`) instead
of hand-rolling hex/rgba/px values. Per-surface namespaces (`--nv-*`, `--ibm-*`)
alias the canonical tokens through the CSS-var fallback chain so every surface
diff --git a/docs/agent-manifest.md b/docs/agent-manifest.md
index a948f8247..4eca6ea29 100644
--- a/docs/agent-manifest.md
+++ b/docs/agent-manifest.md
@@ -249,7 +249,7 @@ LLM runtime configuration. When omitted, the agent is reactive-only (skills and
| Field | Type | Required | Default | Description |
|----------------|--------|----------|---------|-------------|
-| `provider` | string | Yes | `"none"` | `"anthropic"`, `"openai"`, `"local"`, or `"none"`. Use `"none"` for a purely reactive avatar. |
+| `provider` | string | Yes | `"none"` | `"anthropic"` or `"none"`. Use `"none"` for a purely reactive avatar (skills drive it; the LLM never runs). |
| `model` | string | No | — | Model ID, e.g. `"claude-opus-4-7"`. |
| `instructions` | string | No | — | Relative path to a Markdown file (`instructions.md`) that contains the system prompt. Frontmatter in the file can override any `brain.*` field. |
| `temperature` | number | No | 0.7 | LLM sampling temperature (0–1). |
@@ -278,7 +278,7 @@ Text-to-speech and speech-to-text configuration.
| Field | Type | Required | Default | Description |
|------------|--------|----------|-------------|-------------|
-| `provider` | string | Yes | `"browser"` | `"browser"` (Web Speech API), `"elevenlabs"`, `"openai"`, or `"none"`. |
+| `provider` | string | Yes | `"browser"` | `"browser"` (Web Speech API), `"neural"` (free in-browser neural voice — runs the Kokoro 82M ONNX model on WebGPU with a WASM fallback via HeadTTS; no API key, returns real viseme timestamps for lip-sync; the model downloads lazily from a CDN on first speak), `"elevenlabs"`, or `"none"`. |
| `voiceId` | string | No | `"default"` | Provider-specific voice identifier. |
| `rate` | number | No | 1.0 | Speech rate multiplier (0.5–2.0). |
| `pitch` | number | No | 1.0 | Voice pitch multiplier (0.5–2.0). |
@@ -287,7 +287,7 @@ Text-to-speech and speech-to-text configuration.
| Field | Type | Required | Default | Description |
|--------------|---------|----------|-------------|-------------|
-| `provider` | string | Yes | `"browser"` | `"browser"` (Web Speech API), `"whisper"`, or `"none"`. |
+| `provider` | string | Yes | `"browser"` | `"browser"` (Web Speech API) or `"none"`. |
| `language` | string | No | `"en-US"` | BCP 47 language tag. |
| `continuous` | boolean | No | `false` | Whether to keep the microphone open between utterances. |
@@ -369,8 +369,10 @@ Full set of built-in scene tools:
| `setExpression` | Set a morph target expression blend. |
| `speak` | Emit a speech utterance (TTS + protocol event). |
| `remember` | Write a memory entry. |
+| `see_screen` | Capture what is currently visible on screen to inform the agent's response. |
| `moveTo` | Move the agent to a position in the scene. |
-| `pointAt` | Point at a target in the scene. |
+
+On a multi-agent stage, two additional stage-scoped tools become available: `observe_agents` (list the other agents sharing the stage, with names and positions) and `say_to_agent` (send a message to another agent on the same stage).
---
diff --git a/docs/api-reference.md b/docs/api-reference.md
index 7660f0f0b..0a81ccc99 100644
--- a/docs/api-reference.md
+++ b/docs/api-reference.md
@@ -2117,20 +2117,20 @@ hash — never a coordinate or raw device token. Anyone can re-verify a proof at
### Resolve on-chain agent
```
-GET /api/erc8004/:chainId/:agentId
+GET /api/v1/agents/:caip
```
-Resolves an on-chain ERC-8004 agent by chain ID and agent ID, returning its full manifest JSON. No auth required.
+Public, gateway-cached resolver for an ERC-8004 agent. `:caip` is a URL-encoded CAIP-style ref — `eip155:<chainId>:<registryAddress>/<tokenId>` — so consumers (the badge web component, indexers, third-party sites) don't have to do RPC + IPFS + sha256 verification themselves. No auth required.
**Example**
```
-GET /api/erc8004/8453/42
+GET /api/v1/agents/eip155%3A8453%3A0x8004A169...%2F1
```
-**Response:** Full agent manifest JSON as registered on-chain.
+**Response:** `{ ref, chainId, agentId, registry, owner, tokenURI, card, verified: { modelSha256, cardSchema }, fetchedAt }` — `card` is the resolved agent card JSON.
-Returns `400 CHAIN_NOT_SUPPORTED` if `chainId` is not in the platform's supported chain list.
+Errors: `400 invalid_caip`, `404 not_found`, `502 upstream`, `429 rate_limited`. Responses are edge-cached (5 min fresh, 1 h stale-while-revalidate). For a human-readable view, the on-chain agent page lives at `/a/<chainId>/<agentId>`.
---
diff --git a/docs/architecture.md b/docs/architecture.md
index 1497635e0..6503ebb31 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -32,7 +32,7 @@ This is the layer that turns a static GLB into a presence. It's structured as a
- **`agent-avatar.js`** — the **Empathy Layer**. Translates bus events into a continuous emotion blend (neutral, concern, celebration, patience, curiosity, empathy). Each emotion has its own decay rate (celebration half-life ~4s, patience ~20s) and drives morph targets, head tilt, and gaze.
- **`runtime/index.js`** — the **LLM tool-loop engine**. Holds conversation history, builds the system prompt from manifest instructions + memory + skill descriptions, calls the provider, dispatches tool calls, feeds results back. Capped at `MAX_TOOL_ITERATIONS = 8`.
- **`runtime/scene.js`** — the **SceneController**. The single bridge between agent intent and three.js reality: `playClipByName`, `playAnimationByHint`, `lookAt`, `setExpression`, `loadGLB`, `loadClip`, `moveTo`. `<agent-stage>` can scope operations to a sub-group via `setGroup()`.
-- **`runtime/tools.js`** — built-in tool defs (`wave`, `lookAt`, `play_clip`, `setExpression`, `speak`, `remember`) and stage-scoped tools (`observe_agents`, `say_to_agent`). Each is a JSON schema + an async handler `(args, ctx)`.
+- **`runtime/tools.js`** — built-in tool defs (`wave`, `lookAt`, `play_clip`, `setExpression`, `speak`, `remember`, `see_screen`) and stage-scoped tools (`observe_agents`, `say_to_agent`). Each is a JSON schema + an async handler `(args, ctx)`.
- **`runtime/speech.js`** — TTS (Web Speech API or ElevenLabs) and STT (browser `SpeechRecognition`). STT silently no-ops where unavailable.
- **`agent-skills.js`** + **`skills/`** — the skill registry. Skills are dynamically loaded bundles (`SKILL.md`, `tools.json`, `handlers.js`). Trust modes (`any` / `owned-only` / `whitelist`) gate installation.
- **`agent-memory.js`** + **`memory/`** — a four-type store (`user`, `feedback`, `project`, `reference`). The file-based variant writes frontmatter `.md` files, an auto-generated `MEMORY.md` index, and an append-only `timeline.jsonl`.
@@ -55,7 +55,7 @@ This layer is what keeps an agent's existence durable across sessions, devices,
The top layer is what lets an agent live somewhere other than the canonical app.
- **`element.js`** — the `<agent-3d>` custom web component. Lazy-boots via `IntersectionObserver` (unless `eager`), enforces an origin allowlist for embeds, and exposes attributes for body, brain, agent-id, manifest URL, mode (`inline` / `floating` / `section` / `fullscreen`), and more.
-- **`widget-types.js`** — five widget variants (chat, action button, mini-card, full card, floating bubble) that share the underlying element but ship as separate ergonomic wrappers.
+- **`widget-types.js`** — five widget variants (Turntable Showcase, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour) that share the underlying element but ship as separate ergonomic wrappers.
- **`lib.js`** — the CDN entry. Imports the element, registers it, and re-exports the public surface.
- **`app.js`** — the main SPA. URL routing happens here using hash params (`#model=`, `#agent=`, `#kiosk=`, `#brain=`, `#preset=`) and query params (`?agent=` for authenticated edit mode, `?pending=1` for post-login round-trips). The hash form stays in embed mode; the query form moves into edit mode.
- **`vercel.json`** — the server's route and cron table. Maps clean URLs (`/agent/<id>`, `/agent/<id>/edit`, `/agent/<id>/embed`, `/a/<chainId>/<agentId>`) to the right HTML entry and mounts the `api/*` handlers. In production the single Cloud Run container ([`server/index.mjs`](../server/index.mjs)) reads this table at runtime — it's a live config file, not a Vercel-only artifact.
diff --git a/docs/btn-pill-migration.md b/docs/btn-pill-migration.md
index 840c3c4de..c4acfc5f1 100644
--- a/docs/btn-pill-migration.md
+++ b/docs/btn-pill-migration.md
@@ -1,7 +1,7 @@
# Button + Pill Migration Map (B04)
**Canonical system:** `public/style.css` — `.btn` base + BEM modifiers + `.pill` base + semantic modifiers.
-**Tokens:** B01 `:root` block in `public/style.css` (`--btn-*`, `--badge-*`, `--focus-ring-*`, `--disabled-*`).
+**Tokens:** B01 primitives in `public/tokens.css`; component tokens (`--btn-*`, `--badge-*`, `--focus-ring-*`, `--disabled-*`) layered in `public/style.css`.
---
diff --git a/docs/configuration.md b/docs/configuration.md
index 84b6af4d4..c985023fc 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -44,13 +44,13 @@ DATABASE_URL=postgres://user:[email protected]/neondb?sslmode=require
Get from: [Neon](https://neon.tech) (free tier works for development), Supabase, or any PostgreSQL host. Always include `?sslmode=require` in production.
-After setting this, apply the schema:
+After setting this, provision the schema:
```bash
-psql "$DATABASE_URL" -f api/_lib/schema.sql
+npm run db:bootstrap
```
-The migration is idempotent — safe to re-run.
+This runs all four provisioning steps (core schema + indexer + delegations + migrations) and is idempotent — safe to re-run. Do not apply `api/_lib/schema.sql` alone: the base schema does not create the migration-defined tables and leaves a half-provisioned database (see [deployment.md](deployment.md)).
#### `JWT_SECRET`
**Required.** Long random secret used for two purposes: signing session JWTs and (via HKDF) deriving the AES-256-GCM key that encrypts agent wallet private keys.
@@ -479,9 +479,9 @@ For a fully open public platform where any site can embed agent viewers, set `"o
## `.mcp.json`
-Configures the MCP server connection for Claude Code integration. Claude Code auto-discovers this file from the project root.
+Configures MCP server connections for Claude Code integration. Claude Code auto-discovers this file from the project root. The checked-in file defines four servers (`meshy`, `3d-agent`, `3d-agent-local`, `atelier`); secrets are never inlined — values use `${VAR}` environment-variable interpolation, resolved from your shell at load time.
-The production configuration points to the hosted MCP endpoint and authenticates with a bearer API key:
+The minimal hosted-endpoint entry looks like:
```json
{
@@ -489,16 +489,16 @@ The production configuration points to the hosted MCP endpoint and authenticates
"3d-agent": {
"url": "https://three.ws/api/mcp",
"headers": {
- "Authorization": "Bearer <your-api-key>"
+ "Authorization": "Bearer ${THREE_WS_MCP_TOKEN}"
}
}
}
}
```
-Replace the `Authorization` value with an API key from your dashboard. For local development, point `url` at `http://localhost:3000/api/mcp`.
+Set `THREE_WS_MCP_TOKEN` in your environment to an API key from your dashboard. For local development, point `url` at `http://localhost:3000/api/mcp`.
-**Never commit a real API key** in this file. Add `.mcp.json` to `.gitignore` or use a development-only key with limited permissions.
+**Never commit a real API key** in this file — keep the `${VAR}` interpolation form so the checked-in file stays secret-free.
---
diff --git a/docs/introduction.md b/docs/introduction.md
index f2ac52e84..d211b7a16 100644
--- a/docs/introduction.md
+++ b/docs/introduction.md
@@ -87,9 +87,9 @@ A minimal manifest looks like:
```json
{
- "specVersion": "0.1",
+ "spec": "agent-manifest/0.1",
"name": "Aria",
- "body": { "uri": "./body.glb", "format": "glb" },
+ "body": { "uri": "./body.glb", "format": "gltf-binary" },
"brain": {
"provider": "anthropic",
"model": "claude-sonnet-4-6",
diff --git a/docs/money-feed.md b/docs/money-feed.md
index 99b300b67..95279bb87 100644
--- a/docs/money-feed.md
+++ b/docs/money-feed.md
@@ -12,15 +12,17 @@ event lives.
| Layer | Backing store | Surface | What it shows |
|---|---|---|---|
-| **Live ticker** | Redis list `feed:events` | `GET /api/feed`, widget `public/feed.js` | A curated, newest-first stream of notable public events. |
+| **Live ticker** | Redis list `feed:events` | `GET /api/feed` + `GET /api/feed-stream` (SSE), client `src/theater-feed.js` | A curated, newest-first stream of notable public events. |
| **Custody ledger** | Postgres `agent_custody_events` | Portfolio + volume dashboards | Every real wallet spend/transfer, the canonical record of money moved. |
| **Domain records** | `circulation_actions`, `pump_agent_trades`, `pump_agent_mints`, `skill_purchases`, `asset_purchases` | Pump feed, `/launches`, agent profiles | Per-domain detail behind each event. |
## Live ticker — `/api/feed`
A public, read-only, cache-friendly endpoint backed by a capped Redis list
-(`feed:events`, max 200 entries). The on-page widget polls it every ~20 seconds
-and prepends anything new. The endpoint is edge-cached
+(`feed:events`, max 200 entries). The on-page client
+([`src/theater-feed.js`](../src/theater-feed.js)) fetches one snapshot of
+`GET /api/feed` for first paint, then tails the live SSE stream at
+`GET /api/feed-stream` for fresh events. The snapshot endpoint is edge-cached
(`s-maxage=20, stale-while-revalidate=60`) so idle tabs don't drain the Redis
request quota.
diff --git a/docs/quick-start.md b/docs/quick-start.md
index 9759351a7..6c027af91 100644
--- a/docs/quick-start.md
+++ b/docs/quick-start.md
@@ -137,7 +137,7 @@ The `brain` attribute turns the 3D viewer into a conversational agent:
| Attribute | What it does |
|-----------|--------------|
-| `brain` | LLM model ID. Anthropic: `claude-sonnet-4-6`, `claude-opus-4-7`, `claude-haiku-4-5`. OpenAI: `gpt-4o`, `gpt-4o-mini`. Omit for a viewer-only display with no AI. |
+| `brain` | LLM model ID. The in-browser runtime supports the Anthropic provider — registered model IDs: `claude-sonnet-4-6`, `claude-opus-4-7`, `claude-opus-4-6`, `claude-haiku-4-5-20251001`. Omit for a viewer-only display with no AI (provider `none`). |
| `instructions` | System prompt for the agent's personality and role. |
| `mode` | Layout mode: `inline` (flows with page content), `floating` (fixed bubble in a corner), `fullscreen`, or `section`. Default: `inline`. |
@@ -161,7 +161,7 @@ The fastest path to an embeddable 3D experience is an iframe widget. Build one i
```html
<iframe
- src="https://three.ws/app#widget=wdgt_YOUR_ID&kiosk=true"
+ src="https://three.ws/widget#widget=wdgt_YOUR_ID&kiosk=true"
width="600"
height="600"
style="border:0;border-radius:12px;max-width:100%"
diff --git a/docs/solana.md b/docs/solana.md
index 3e31319ac..5df8fcb15 100644
--- a/docs/solana.md
+++ b/docs/solana.md
@@ -15,7 +15,7 @@ This document covers what is supported today, the end-to-end registration flow,
| Sign-In with Solana (SIWS) | Live | [api/auth/siws/\[action\].js](../api/auth/siws/%5Baction%5D.js) (handles `nonce` + `verify`) |
| Linking a Solana wallet to a user | Live | `user_wallets` table, `chain_type = 'solana'` |
| Solana payments (checkout + confirm) | Live | [api/payments/solana/\[action\].js](../api/payments/solana/%5Baction%5D.js) (handles `checkout` + `confirm`) |
-| Agent identity NFT (Metaplex Core) | Live | [api/agents/register/\[action\].js](../api/agents/register/%5Baction%5D.js) (handles `solana-prep` + `solana-confirm`) |
+| Agent identity NFT (Metaplex Core) | Live | [api/agents/solana/\[action\].js](../api/agents/solana/%5Baction%5D.js) (handles `register-prep` + `register-confirm`) |
| Agent record persisted in DB | Live | `agent_identities`, `meta.chain_type='solana'`, `meta.sol_mint_address` |
| On-chain reputation registry | **Not on Solana** | EVM only |
| On-chain validation registry | **Not on Solana** | EVM only (testnet) |
diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md
index c2c83e3ba..8dfcef358 100644
--- a/docs/troubleshooting.md
+++ b/docs/troubleshooting.md
@@ -43,11 +43,7 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
- **Apache:** `Header set Access-Control-Allow-Origin "*"` in `.htaccess`.
- **AWS S3 / CloudFront:** Set a CORS policy on the bucket (allow all origins, GET method).
- **Vercel / Netlify:** Add a `headers` rule in the config file.
-2. If you can't modify the server, use the `key-proxy` attribute on `<agent-3d>` to route the fetch through a proxy that adds CORS headers:
- ```html
- <agent-3d src="https://cdn.example.com/model.glb"
- key-proxy="https://your-cors-proxy/proxy?url="></agent-3d>
- ```
+2. If you can't modify the server, re-host the file somewhere that sends CORS headers: the platform's hosted storage (uploads via the Studio are CORS-configured automatically), or any CDN/bucket with a permissive CORS rule (Cloudflare R2, S3 + CORS policy). Note that the `key-proxy` attribute is **not** a fetch proxy — it points the element at your LLM API-key proxy endpoint (so the key never reaches the client) and has no effect on GLB loading.
---
@@ -120,7 +116,12 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
- `401` — the API key is missing or invalid.
- `429` — rate limited. Wait a minute and retry.
- `500` — server error. Check the server logs.
-3. Verify `ANTHROPIC_API_KEY` is set in your environment. In Vercel: Settings → Environment Variables. The key must be present before deployment — a new deploy is required after adding it.
+3. Verify `ANTHROPIC_API_KEY` is set in your server environment. On the production Cloud Run service:
+ ```bash
+ gcloud run services update three-ws-api --region us-central1 \
+ --update-env-vars ANTHROPIC_API_KEY=sk-ant-...
+ ```
+ Updating an env var rolls a new revision automatically. On a self-hosted fork, set it wherever your host reads environment variables and restart/redeploy.
4. If you're calling the Anthropic API directly from the browser (not via a proxy), also set the `api-key` attribute on the element and note that this exposes your key to users.
---
@@ -246,8 +247,12 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
console.log(e.data);
});
```
-3. All messages use the `'3dagent:'` type prefix. Outbound messages should look like `{ type: '3dagent:speak', payload: { text: '...' } }`.
-4. Use the embed-host bridge (`src/embed-host-bridge.js`) rather than raw `postMessage` — it handles the ping/pong handshake and waits for the iframe to be ready.
+3. Use the correct envelope shape. There are two related protocols, and neither uses a type prefix like `3dagent:`:
+ - The **element bridge** (`src/embed-host-bridge.js`) wraps every message in `{ v: 1, source: 'agent-host' | 'agent-3d', id, kind, op, payload }` — e.g. a speak request is `{ v: 1, source: 'agent-host', id: '<uuid>', kind: 'request', op: 'speak', payload: { text: '...' } }`.
+ - The **host protocol** ([specs/EMBED_HOST_PROTOCOL.md](../specs/EMBED_HOST_PROTOCOL.md)) uses `{ v: 1, type: 'host.*' | 'embed.*', id, payload }` — e.g. `{ v: 1, type: 'host.chat.message', payload: { ... } }`.
+
+ Messages that don't match the expected envelope (missing `v: 1`, wrong `source`/`type`) are silently ignored.
+4. Use the `EmbedHostBridge` class (`src/embed-host-bridge.js`) rather than raw `postMessage` — it handles the handshake, queues requests until the iframe is ready, and correlates responses by `id`.
---
@@ -307,9 +312,9 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
**Fix steps:**
-1. Set `PUBLIC_APP_ORIGIN` to exactly the origin users are hitting (e.g. `https://www.yourdomain.com`). `www.yourdomain.com` and `yourdomain.com` are treated as different domains.
+1. Set `PUBLIC_APP_ORIGIN` to exactly the origin users are hitting (e.g. `https://www.yourdomain.com`). `www.yourdomain.com` and `yourdomain.com` are treated as different domains. In production this lives on the Cloud Run service (`gcloud run services update three-ws-api --region us-central1 --update-env-vars PUBLIC_APP_ORIGIN=...`).
2. For local development, any `localhost` domain is accepted automatically — you don't need to set `PUBLIC_APP_ORIGIN` for local dev.
-3. For Vercel preview deployments, `VERCEL_URL` is automatically trusted alongside `PUBLIC_APP_ORIGIN`.
+3. For forks deployed on Vercel, the deployment host injected as `VERCEL_URL` is automatically trusted alongside `PUBLIC_APP_ORIGIN`.
---
diff --git a/docs/tutorials/connect-ai-brain.md b/docs/tutorials/connect-ai-brain.md
index 506d991fe..fcbe900b0 100644
--- a/docs/tutorials/connect-ai-brain.md
+++ b/docs/tutorials/connect-ai-brain.md
@@ -79,14 +79,14 @@ The current production-ready models, with the tradeoffs that actually matter for
- **Capability:** Excellent at tool use, structured output, and following system prompts. The right default for support, sales, concierge, and personal agents.
- **Context window:** 200K tokens. Plenty of room for long system prompts and memory.
-**Claude Opus 4.7 (1M)** (`claude-opus-4-7-1m`) — when you need the smartest model.
+**Claude Opus 4.7** (`claude-opus-4-7`) — when you need the smartest model.
- **Cost:** ~5x Sonnet. Worth it for high-stakes agents (legal, medical, financial assistants) and complex reasoning chains.
- **Latency:** First token in ~1.2s. Full reply 2.5-4s for a typical turn.
- **Capability:** Best-in-class at multi-step reasoning, ambiguous instruction handling, and long-context retrieval. Holds character better under adversarial pressure.
-- **Context window:** 1M tokens. Useful only if you're loading very long documents or transcripts into the prompt.
+- **Context window:** 200K tokens. Same headroom as Sonnet — the upgrade is depth of reasoning, not window size.
-**Claude Haiku 4.5** (`claude-haiku-4-5`) — when latency matters more than depth.
+**Claude Haiku 4.5** (`claude-haiku-4-5-20251001`) — when latency matters more than depth.
- **Cost:** ~1/3 of Sonnet.
- **Latency:** First token in ~250ms. Full reply in well under a second.
@@ -234,7 +234,8 @@ This is the part that often surprises people: the embed snippet on your website
If you have:
```html
-<script src="https://three.ws/cdn/agent-3d.js" data-agent-id="YOUR_AGENT_ID" id="agent"></script>
+<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
+<agent-3d agent-id="YOUR_AGENT_ID" id="agent"></agent-3d>
```
…on a thousand pages, you can switch the brain from Sonnet to Opus to GPT-5 entirely from the dashboard. No deploy. No code edit. The next page load picks up the new model.
diff --git a/docs/tutorials/embed-in-30-seconds.md b/docs/tutorials/embed-in-30-seconds.md
index 74e9983ca..30ae760fa 100644
--- a/docs/tutorials/embed-in-30-seconds.md
+++ b/docs/tutorials/embed-in-30-seconds.md
@@ -1,11 +1,11 @@
# Embed in 30 seconds
-The fastest way to put a living 3D agent on a website is one line of HTML. Paste a single `<script>` tag, save the file, refresh the browser — there's a 3D character animating in the corner of your page, ready to greet visitors. No build step, no npm install, no framework adapter, no API plumbing.
+The fastest way to put a living 3D agent on a website is two lines of HTML. Paste a `<script>` tag that loads the runtime and an `<agent-3d>` tag that places the agent, save the file, refresh the browser — there's a 3D character animating in the corner of your page, ready to greet visitors. No build step, no npm install, no framework adapter, no API plumbing.
-This tutorial walks through that one-liner end to end. By the time you finish, you will have an agent live on a real page, you will know exactly which line to copy, and you will know how to debug it when something gets in the way.
+This tutorial walks through those two lines end to end. By the time you finish, you will have an agent live on a real page, you will know exactly which lines to copy, and you will know how to debug it when something gets in the way.
**What you'll build:**
-- A live 3D agent embedded on an HTML page with one script tag
+- A live 3D agent embedded on an HTML page with two tags
- A working agent ID from the three.ws editor
- A floating widget that animates, greets, and chats out of the box
- A clear mental model of what the embed loader actually does
@@ -16,7 +16,7 @@ This tutorial walks through that one-liner end to end. By the time you finish, y
## Step 1 — Get an agent ID
-Every embedded agent on three.ws has a permanent ID. The script tag uses that ID to fetch the agent's body, personality, skills, and animations from the platform. Without one, there is nothing to embed.
+Every embedded agent on three.ws has a permanent ID. The `<agent-3d>` tag uses that ID to fetch the agent's body, personality, skills, and animations from the platform. Without one, there is nothing to embed.
Open [https://three.ws/create](https://three.ws/create) in a new tab. The editor loads with a default avatar in the centre of the canvas. You have two paths from here.
@@ -28,7 +28,7 @@ If you want to ship something working as fast as possible, skip every panel for
https://three.ws/agent/0xabc123…def
```
-The string after `/agent/` is your agent ID. Copy it. You will paste it into the script tag in the next step.
+The string after `/agent/` is your agent ID. Copy it. You will paste it into the `<agent-3d>` tag in the next step.
### Path B — Customise first, then save
@@ -74,10 +74,8 @@ Open your editor, create a new file called `index.html` anywhere on your compute
Try clicking it. Try saying hi. It works the same in every browser.
</p>
- <script
- src="https://three.ws/cdn/agent-3d.js"
- data-agent-id="YOUR_AGENT_ID"
- ></script>
+ <script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
+ <agent-3d agent-id="YOUR_AGENT_ID" mode="floating"></agent-3d>
</body>
</html>
```
@@ -88,61 +86,59 @@ Save the file. Double-click it to open in your browser, or drag it into a browse
You should see a 3D character appear in the bottom-right corner of the page within a couple of seconds. It will start an idle animation. Click on it and a chat panel slides open. Type a question, press Enter, and the agent replies — with voice and animation.
-That's the whole feature. One script tag, one agent ID, one working 3D agent.
+That's the whole feature. One script tag, one `<agent-3d>` tag, one working 3D agent.
---
-## Step 3 — Understand what the script tag does
+## Step 3 — Understand what the two tags do
It is worth taking a minute to understand what just happened, because once you know, every other embed customisation is obvious.
-When the browser hits this line:
+When the browser hits these lines:
```html
-<script
- src="https://three.ws/cdn/agent-3d.js"
- data-agent-id="YOUR_AGENT_ID"
-></script>
+<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
+<agent-3d agent-id="YOUR_AGENT_ID" mode="floating"></agent-3d>
```
…the following happens in order:
1. The browser fetches `agent-3d.js` from the three.ws CDN. The file is a single self-contained bundle: it brings its own copy of Three.js, the glTF loader, the chat UI, the speech subsystem — everything. There are no other network dependencies at this stage.
-2. The script reads its own `data-agent-id` attribute (and any other `data-*` attributes you've set — more on that in the customisation tutorial).
+2. The script registers `<agent-3d>` as a custom element. Every `<agent-3d>` tag on the page — including the one you just pasted — comes alive and reads its own attributes (`agent-id`, `mode`, and the others covered in the customisation tutorial).
-3. It calls the three.ws API to fetch the agent's manifest: name, body URL, personality, skills, default greeting, and the list of animation clips baked into the GLB.
+3. The element calls the three.ws API to fetch the agent's manifest: name, body URL, personality, skills, default greeting, and the list of animation clips baked into the GLB.
-4. It injects a container element into the page (by default, fixed to the bottom-right corner) and renders the 3D scene inside it.
+4. In `mode="floating"`, the element pins itself to the bottom-right corner of the page and renders the 3D scene inside it.
-5. Once the avatar is loaded, the script dispatches a `agent:ready` event you can listen to. The agent then begins its idle animation and waits for interaction.
+5. Once the avatar is loaded, the element dispatches a `agent:ready` event you can listen to. The agent then begins its idle animation and waits for interaction.
Notice what is *not* on this list:
- No iframe. The agent renders directly in your page's DOM, which means it inherits your site's CSS scope intentionally (we'll cover styling shadows in the customisation tutorial).
- No second script tag. You don't need to load Three.js separately. You don't need to bundle anything.
- No build step. The script is plain JavaScript, served minified from a CDN edge.
-The whole thing is by design: one tag, no setup, real 3D in any HTML page.
+The whole thing is by design: two tags, no setup, real 3D in any HTML page.
---
## Step 4 — Where to paste it on a real site
-The example file above puts the script tag right above `</body>`. That is the recommended placement for any page you embed on. Two reasons:
+The example file above puts both tags right above `</body>`. That is the recommended placement for any page you embed on. Two reasons:
-**Performance.** The script is not blocking your page's HTML or critical CSS. Visitors see your headline and copy first, then the agent finishes loading and slides in.
+**Performance.** The script is a module, so it never blocks your page's HTML or critical CSS. Visitors see your headline and copy first, then the agent finishes loading and slides in.
**DOM availability.** When the script runs, every element your page might want to react to is already in the DOM. If you decide later to attach event listeners or call the JS API, you don't have to wrap them in `DOMContentLoaded`.
If your site is built on a framework or CMS, the right place depends on the template system:
-- **WordPress** — Use a "Custom HTML" widget in the footer, or paste it via a footer scripts plugin like Insert Headers and Footers. Avoid the `<head>` section.
-- **Shopify** — Edit `theme.liquid` and paste the tag right before `</body>`.
-- **Webflow / Squarespace / Wix** — Each one has a "Custom code / Footer code injection" field in site settings. That is where the tag belongs.
-- **Next.js / React** — Use the framework's script component (`next/script` with `strategy="afterInteractive"`, or a plain `useEffect` injection on the page). Do not import the script as an ES module; it's a side-effect bundle that registers itself globally.
-- **Static site generator (Astro, Eleventy, Hugo, Jekyll)** — Paste the raw tag into your base layout template above `</body>`.
+- **WordPress** — Use a "Custom HTML" widget in the footer, or paste both tags via a footer scripts plugin like Insert Headers and Footers. Avoid the `<head>` section.
+- **Shopify** — Edit `theme.liquid` and paste both tags right before `</body>`.
+- **Webflow / Squarespace / Wix** — Each one has a "Custom code / Footer code injection" field in site settings. That is where the tags belong.
+- **Next.js / React** — Load the bundle with the framework's script component (`next/script` with `strategy="afterInteractive"`, or a plain `useEffect` injection on the page), then render `<agent-3d agent-id="…" mode="floating"></agent-3d>` in your JSX. The script's only side effect is registering the custom element; it renders nothing on its own.
+- **Static site generator (Astro, Eleventy, Hugo, Jekyll)** — Paste the raw tags into your base layout template above `</body>`.
-The script never re-renders the rest of your DOM. It only appends a single container element. This means there's no risk of it conflicting with your existing layout.
+The script never touches the rest of your DOM. The `<agent-3d>` element you placed is the only thing rendered, and in floating mode it pins itself to a corner. This means there's no risk of it conflicting with your existing layout.
---
@@ -183,8 +179,8 @@ A short guide to the things that usually go wrong, in roughly the order of how o
Open the console first. The fix is almost always one of these three:
-- **Wrong agent ID.** The most common cause. Copy it again from the URL in [https://three.ws/my-agents](https://three.ws/my-agents) — that's the page that lists every agent you've saved. Paste it into the `data-agent-id` attribute and reload.
-- **The script tag is malformed.** Check that you copied the full src URL (`https://three.ws/cdn/agent-3d.js`), that there are no stray characters between attributes, and that the tag is closed.
+- **Wrong agent ID.** The most common cause. Copy it again from the URL in [https://three.ws/my-agents](https://three.ws/my-agents) — that's the page that lists every agent you've saved. Paste it into the `agent-id` attribute and reload.
+- **One of the tags is malformed.** Check that you copied the full src URL (`https://three.ws/agent-3d/latest/agent-3d.js`), that the script tag has `type="module"`, and that the `<agent-3d>` tag is closed with `</agent-3d>` — custom elements are not self-closing.
- **The page is being served as plain `file://` and something is blocked.** This is uncommon — most browsers allow the embed to work from a local file — but if you hit it, run a quick local server: `python3 -m http.server 8080` and open `http://localhost:8080` instead.
### "The page says the script is blocked"
@@ -214,15 +210,20 @@ A few legitimate reasons:
### "I want it not to appear on certain pages"
-The simplest answer: just don't include the script tag on those pages. If your CMS only lets you set one site-wide footer block, gate the tag with a tiny conditional based on `location.pathname`:
+The simplest answer: just don't include the tags on those pages. If your CMS only lets you set one site-wide footer block, gate them with a tiny conditional based on `location.pathname`:
```html
<script>
if (!location.pathname.startsWith('/admin')) {
var s = document.createElement('script');
- s.src = 'https://three.ws/cdn/agent-3d.js';
- s.setAttribute('data-agent-id', 'YOUR_AGENT_ID');
+ s.type = 'module';
+ s.src = 'https://three.ws/agent-3d/latest/agent-3d.js';
document.body.appendChild(s);
+
+ var el = document.createElement('agent-3d');
+ el.setAttribute('agent-id', 'YOUR_AGENT_ID');
+ el.setAttribute('mode', 'floating');
+ document.body.appendChild(el);
}
</script>
```
@@ -247,9 +248,9 @@ If they comment that the agent is in the wrong corner, or feels too big, or dist
You now know:
- How to get an agent ID from the editor at [https://three.ws/create](https://three.ws/create)
-- The one script tag that powers every three.ws embed
-- Where to paste it on different site stacks
-- What the embed loader actually does behind the scenes
+- The two tags that power every three.ws embed — the runtime script and the `<agent-3d>` element
+- Where to paste them on different site stacks
+- What the embed runtime actually does behind the scenes
- The fastest path to diagnose the three most common failure modes
A working embedded agent is the foundation everything else builds on. From here, every other tutorial in this tier is about turning that working embed into something that matches your brand, your voice, and your visitors.
diff --git a/docs/tutorials/js-api-events.md b/docs/tutorials/js-api-events.md
index 40a583b0b..6a27959df 100644
--- a/docs/tutorials/js-api-events.md
+++ b/docs/tutorials/js-api-events.md
@@ -61,7 +61,7 @@ Start with the simplest possible embed. Create `index.html` and paste this:
</div>
</div>
- <script type="module" src="https://three.ws/cdn/agent-3d.js"></script>
+ <script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
<script type="module" src="./app.js"></script>
</body>
</html>
diff --git a/docs/tutorials/pay-for-x402-service.md b/docs/tutorials/pay-for-x402-service.md
index cdcf43097..018112148 100644
--- a/docs/tutorials/pay-for-x402-service.md
+++ b/docs/tutorials/pay-for-x402-service.md
@@ -32,11 +32,11 @@ The price, the recipient, and the network all come from the seller's 402 challen
There are two distinct problems: **finding** an endpoint and **paying** it.
-**Finding.** The [Bazaar](/bazaar) is a discovery surface. Server-side, [`/api/bazaar/list`](api/bazaar/list.js) and [`/api/bazaar/search`](api/bazaar/search.js) call each configured facilitator's `/discovery/resources` route, merge the catalogs, dedupe (HTTP by resource URL, MCP by `resource + toolName`), normalize the shape, and apply your filters. The default facilitators are PayAI (`facilitator.payai.network`, Base + Solana) and Coinbase CDP (`api.cdp.coinbase.com/platform/v2/x402`, Base + EVM L2s), wired in [`api/_lib/x402/bazaar-client.js`](api/_lib/x402/bazaar-client.js). An endpoint shows up here once it has answered a discovery probe with a valid 402 — there is no submission form. (How three.ws gets *its own* endpoints into those catalogs is the build-side concern covered in [paid-x402-endpoint](/tutorials/paid-x402-endpoint).)
+**Finding.** The [Bazaar](/bazaar) is a discovery surface. Server-side, `/api/bazaar/list` (`api/bazaar/list.js`) and `/api/bazaar/search` (`api/bazaar/search.js`) call each configured facilitator's `/discovery/resources` route, merge the catalogs, dedupe (HTTP by resource URL, MCP by `resource + toolName`), normalize the shape, and apply your filters. The default facilitators are PayAI (`facilitator.payai.network`, Base + Solana) and Coinbase CDP (`api.cdp.coinbase.com/platform/v2/x402`, Base + EVM L2s), wired in `api/_lib/x402/bazaar-client.js`. An endpoint shows up here once it has answered a discovery probe with a valid 402 — there is no submission form. (How three.ws gets *its own* endpoints into those catalogs is the build-side concern covered in [paid-x402-endpoint](/tutorials/paid-x402-endpoint).)
-**Paying.** Every payment runs through the same drop-in module, [`public/x402.js`](public/x402.js), exposed as `window.X402.pay(...)`. It does the 402 → sign → retry dance for you:
+**Paying.** Every payment runs through the same drop-in module, `public/x402.js`, exposed as `window.X402.pay(...)`. It does the 402 → sign → retry dance for you:
-- For **Solana**, the wallet can only sign serialized transactions, so the module posts the challenge's `accept` to [`/api/x402-checkout?action=prepare`](api/x402-checkout.js), gets back a partially-signed SPL `transferChecked`, has Phantom add the buyer's signature, then `?action=encode`s it into the `X-PAYMENT` header.
+- For **Solana**, the wallet can only sign serialized transactions, so the module posts the challenge's `accept` to `/api/x402-checkout?action=prepare` (`api/x402-checkout.js`), gets back a partially-signed SPL `transferChecked`, has Phantom add the buyer's signature, then `?action=encode`s it into the `X-PAYMENT` header.
- For **Base / EVM**, the wallet signs an EIP-3009 `transferWithAuthorization` typed-data message locally — no server prep needed.
Either way the signed payload is base64-encoded into `X-PAYMENT`, the gated request is retried once, and the unlocked result plus the decoded `X-PAYMENT-RESPONSE` receipt come back.
@@ -102,7 +102,7 @@ You get back a `402 Payment Required` whose JSON body (and a base64 mirror in th
Read it like a receipt-in-advance:
- **`amount`** is in atomic units of **`asset`**. With `decimals: 6`, `"1000"` is $0.001. (Spec-strict sellers may name this field `maxAmountRequired`; the client coerces both to `amount`.)
-- **`network`** tells you which wallet you need. `solana` / `solana:*` → Phantom/Solflare; `eip155:8453` → Base; other `eip155:*` are the EVM L2s in [`EVM_NETWORKS`](public/x402-pay-core.js).
+- **`network`** tells you which wallet you need. `solana` / `solana:*` → Phantom/Solflare; `eip155:8453` → Base; other `eip155:*` are the EVM L2s in `EVM_NETWORKS` (`public/x402-pay-core.js`).
- **`payTo`** is exactly where your USDC goes. Nothing else moves.
- **`maxTimeoutSeconds`** bounds how long your signed authorization is valid — your one safety net against a stale payment lingering.
@@ -117,9 +117,9 @@ A single endpoint can list several `accepts` (e.g. Base *and* Solana). You — o
Two related routes sit under it:
- **[/pay/calls](/pay/calls)** — the public ledger of paid x402 calls to the platform. Each settled call gets a permalink (`/pay/calls/<tx-signature>`) showing the tool invoked and the on-chain transaction. This is your audit trail: every payment you make here is verifiable on-chain by anyone.
-- **`/pay/c/<slug>`** — a *hosted checkout link*. A provider creates a SKU in their dashboard (see [`api/x402-skus.js`](api/x402-skus.js)) and shares the URL; the page hydrates from `/api/x402-skus?slug=<slug>` and opens the same drop-in modal pre-wired to that endpoint. If someone hands you a `/pay/c/...` link, paying it is identical to Step 2 — open it, pick a wallet, approve.
+- **`/pay/c/<slug>`** — a *hosted checkout link*. A provider creates a SKU in their dashboard (see `api/x402-skus.js`) and shares the URL; the page hydrates from `/api/x402-skus?slug=<slug>` and opens the same drop-in modal pre-wired to that endpoint. If someone hands you a `/pay/c/...` link, paying it is identical to Step 2 — open it, pick a wallet, approve.
-The point of the `/pay` surface: the *exact same* payment core ([`public/x402.js`](public/x402.js) and its sibling [`public/x402-pay-core.js`](public/x402-pay-core.js)) drives the Bazaar's "Try it", the hosted checkout, the full-page paywall, and the programmatic call below. Learn it once.
+The point of the `/pay` surface: the *exact same* payment core (`public/x402.js` and its sibling `public/x402-pay-core.js`) drives the Bazaar's "Try it", the hosted checkout, the full-page paywall, and the programmatic call below. Learn it once.
---
@@ -226,7 +226,7 @@ You learned four ways to consume an x402 paid service:
- **`window.X402.pay`** — pay for any endpoint from your own code; resolves with the result plus an on-chain receipt, with a `networks` allowlist to pin the rail.
- **The Endpoint Shopper** ([/shopper](/shopper)) — describe a task and a budget; an agent discovers, pays for, and synthesizes results from Bazaar endpoints autonomously.
-The throughline: discovery and payment are decoupled, the 402 challenge is the single source of truth for price and recipient, every payment settles on-chain in USDC, and one module ([`public/x402.js`](public/x402.js)) drives every surface.
+The throughline: discovery and payment are decoupled, the 402 challenge is the single source of truth for price and recipient, every payment settles on-chain in USDC, and one module (`public/x402.js`) drives every surface.
**Use it from your own project (npm)**
diff --git a/docs/tutorials/personal-ai-site.md b/docs/tutorials/personal-ai-site.md
index 87307b438..be07f0f45 100644
--- a/docs/tutorials/personal-ai-site.md
+++ b/docs/tutorials/personal-ai-site.md
@@ -92,33 +92,30 @@ Configure local memory in your agent manifest or element attributes:
}
```
-Then pre-load facts after the agent initialises:
+Then pre-load facts after the agent initialises. The element exposes its memory store as `agent.memory`, and `write(key, entry)` stores a Markdown note under that key — `name` and `description` are what the memory index shows the LLM, `body` is the full note, and `type` groups it in the index (`user`, `project`, `reference`, or `feedback`):
```js
const agent = document.getElementById('maya');
-agent.addEventListener('ready', async () => {
- await agent.agent.memory.write('long-term', 'portfolio', {
- projects: [
- {
- name: 'Acme Dashboard',
- url: 'yourname.com/work/acme',
- year: 2024,
- description: 'Redesigned the main analytics dashboard, reducing time-to-insight by 40%.'
- },
- {
- name: 'Health App AR',
- url: 'yourname.com/work/health-ar',
- year: 2023,
- description: 'AR overlay for physiotherapy exercises, used by 12k patients in clinical trial.'
- }
- ]
+agent.addEventListener('agent:ready', () => {
+ agent.memory.write('portfolio', {
+ name: 'Portfolio projects',
+ description: 'Shipped projects with URLs, years, and outcomes',
+ type: 'project',
+ body: [
+ '## Acme Dashboard (2024) — yourname.com/work/acme',
+ 'Redesigned the main analytics dashboard, reducing time-to-insight by 40%.',
+ '',
+ '## Health App AR (2023) — yourname.com/work/health-ar',
+ 'AR overlay for physiotherapy exercises, used by 12k patients in a clinical trial.',
+ ].join('\n'),
});
- await agent.agent.memory.write('long-term', 'availability', {
- freelance: false,
- open_to: ['advisory', 'speaking', 'collaboration'],
- note: 'Back on the market Q4 2026.'
+ agent.memory.write('availability', {
+ name: 'Availability',
+ description: 'Freelance and collaboration status',
+ type: 'user',
+ body: 'Not available for freelance until Q4 2026. Open to advisory, speaking, and collaboration.',
});
});
```
diff --git a/docs/tutorials/swap-avatar-in-studio.md b/docs/tutorials/swap-avatar-in-studio.md
index 0487364dd..681cfbcd9 100644
--- a/docs/tutorials/swap-avatar-in-studio.md
+++ b/docs/tutorials/swap-avatar-in-studio.md
@@ -101,13 +101,11 @@ When you save a new body in Studio, the only field that changes in that record i
This is the crucial property. Your embed snippet is:
```html
-<script
- src="https://three.ws/cdn/agent-3d.js"
- data-agent-id="YOUR_AGENT_ID"
-></script>
+<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
+<agent-3d agent-id="YOUR_AGENT_ID" mode="floating"></agent-3d>
```
-There is no body URL in this snippet. The script tag references the agent by its ID, and the embed loader fetches the current body URL from the platform every time a visitor loads the page. When you swap the body in Studio, the next page load returns the new body. The customer site doesn't need to be re-deployed, the snippet doesn't need to be edited, the cached HTML on Cloudflare doesn't need to be purged.
+There is no body URL in this snippet. The `<agent-3d>` element references the agent by its ID, and the embed runtime fetches the current body URL from the platform every time a visitor loads the page. When you swap the body in Studio, the next page load returns the new body. The customer site doesn't need to be re-deployed, the snippet doesn't need to be edited, the cached HTML on Cloudflare doesn't need to be purged.
This is by design and it's worth pausing on, because it changes how you operate at scale. You can:
diff --git a/docs/widget-api.md b/docs/widget-api.md
index fb26c0d85..42f16018a 100644
--- a/docs/widget-api.md
+++ b/docs/widget-api.md
@@ -123,7 +123,6 @@ Notifications (no `id`) sent to the parent over `postMessage`:
|-------------------|--------------------------------------|------------|
| `viewer.ready` | `{}` | First successful model frame. |
| `model.loaded` | `{ url, success, error? }` | After every `model.load` (success or failure). |
-| `widget.revealed` | `{ mode: 'auto' \| 'interaction' }` | Visitor clicked the play button (interaction mode) or auto mode booted. |
### Wire format
diff --git a/pages/yields.html b/pages/yields.html
index 793a14910..09645f28d 100644
--- a/pages/yields.html
+++ b/pages/yields.html
@@ -33,7 +33,7 @@
/>
<meta
property="og:image"
- content="https://three.ws/api/page-og?s=crypto&amp;t=DeFi+Yields&amp;d=Explore+live+DeFi+yield+pools+across+every+chain+and+protocol+%E2%80%94+filter+by+chain%2C+project%2C+stablecoins+and+TVL%2C+sort+by+APY+or+size%2C+and+chart+any+pool%27s+history&amp;p=%2Fyields"
+ content="https://three.ws/api/page-og?s=crypto&amp;t=DeFi+Yields+Explorer&amp;d=Explore+roughly+15%2C000+live+DeFi+yield+pools+across+every+chain+and+protocol+%E2%80%94+filter+by+chain%2C+project%2C+stablecoin+exposure%2C+and+minimum+TVL%2C+sort+by+APY+or+TV&amp;p=%2Fyields"
/>
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
@@ -46,7 +46,7 @@
/>
<meta
name="twitter:image"
- content="https://three.ws/api/page-og?s=crypto&amp;t=DeFi+Yields&amp;d=Explore+live+DeFi+yield+pools+across+every+chain+and+protocol+%E2%80%94+filter+by+chain%2C+project%2C+stablecoins+and+TVL%2C+sort+by+APY+or+size%2C+and+chart+any+pool%27s+history&amp;p=%2Fyields"
+ content="https://three.ws/api/page-og?s=crypto&amp;t=DeFi+Yields+Explorer&amp;d=Explore+roughly+15%2C000+live+DeFi+yield+pools+across+every+chain+and+protocol+%E2%80%94+filter+by+chain%2C+project%2C+stablecoin+exposure%2C+and+minimum+TVL%2C+sort+by+APY+or+TV&amp;p=%2Fyields"
/>
<meta name="theme-color" content="#09090b" />
<link rel="icon" href="/favicon.ico" sizes="any" />
diff --git a/public/changelog.json b/public/changelog.json
index fa910c41d..5f6ff9422 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-11T00:26:13.847Z",
+ "generated_at": "2026-07-11T03:45:18.108Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
diff --git a/public/features.json b/public/features.json
index da0088fbd..ebe8de838 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-11T00:26:13.834Z",
+ "generated_at": "2026-07-11T03:45:18.092Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index 2b5cb7021..93941e8df 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -56,6 +56,25 @@
.sm-brand img { width: 24px; height: 24px; border-radius: 5px; }
.sm-brand:hover { text-decoration: none; }
</style>
+
+ <meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1">
+ <meta property="og:type" content="website">
+ <meta property="og:site_name" content="three.ws">
+ <meta property="og:locale" content="en_US">
+ <meta property="og:title" content="Sitemap · three.ws">
+ <meta property="og:description" content="Human-readable index of every page on three.ws.">
+ <meta property="og:url" content="https://three.ws/sitemap">
+ <meta property="og:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap">
+ <meta property="og:image:width" content="1200">
+ <meta property="og:image:height" content="630">
+ <meta property="og:image:type" content="image/png">
+ <meta property="og:image:alt" content="Sitemap — three.ws">
+ <meta name="twitter:card" content="summary_large_image">
+ <meta name="twitter:site" content="@trythreews">
+ <meta name="twitter:title" content="Sitemap · three.ws">
+ <meta name="twitter:description" content="Human-readable index of every page on three.ws.">
+ <meta name="twitter:image" content="https://three.ws/api/page-og?s=main&amp;t=Sitemap&amp;d=Human-readable+index+of+every+page+on+three.ws.&amp;p=%2Fsitemap">
+ <script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"},"primaryImageOfPage":"https://three.ws/api/page-og?s=main&t=Sitemap&d=Human-readable+index+of+every+page+on+three.ws.&p=%2Fsitemap"}]}</script>
</head>
<body>
<header class="sm-topbar">
diff --git a/scripts/check-head-tmp.mjs b/scripts/check-head-tmp.mjs
new file mode 100644
index 000000000..7f834bd86
--- /dev/null
+++ b/scripts/check-head-tmp.mjs
@@ -0,0 +1,10 @@
+import { chromium } from 'playwright';
+const browser = await chromium.launch();
+const page = await browser.newPage({ viewport: { width: 1440, height: 1100 } });
+await page.goto('http://localhost:8090/markets/news', { waitUntil: 'domcontentloaded', timeout: 60000 });
+await page.waitForTimeout(1500);
+console.log(await page.evaluate(() => {
+ const box = (sel) => { const el = document.querySelector(sel); if (!el) return null; const r = el.getBoundingClientRect(); const cs = getComputedStyle(el); return { sel, top: Math.round(r.top), h: Math.round(r.height), mt: cs.marginTop, mb: cs.marginBottom, ai: cs.alignItems, pos: cs.position }; };
+ return JSON.stringify([box('.nwb-head'), box('.nwb-head-id'), box('.nwb-head .cv-h1'), box('.nwb-head-tools'), box('.nwb-search'), box('.nwb-search input'), box('.nwb-controls'), box('.cv-crumbs')], null, 1);
+}));
+await browser.close();
diff --git a/scripts/check-overflow-tmp.mjs b/scripts/check-overflow-tmp.mjs
index 327d7e957..d13965902 100644
--- a/scripts/check-overflow-tmp.mjs
+++ b/scripts/check-overflow-tmp.mjs
@@ -3,17 +3,20 @@ const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 375, height: 800 } });
await page.goto('http://localhost:8090/markets/news', { waitUntil: 'networkidle', timeout: 60000 });
await page.waitForTimeout(2500);
-const offenders = await page.evaluate(() => {
- const docW = document.documentElement.clientWidth;
- const out = [];
- for (const el of document.querySelectorAll('*')) {
- const r = el.getBoundingClientRect();
- if (r.right > docW + 1 && r.width > 20) {
- out.push(`${el.tagName}.${[...el.classList].join('.')} right=${Math.round(r.right)} w=${Math.round(r.width)}`);
- }
- if (out.length > 12) break;
- }
+const r = await page.evaluate(() => {
+ const doc = document.documentElement;
+ const main = document.querySelector('main');
+ const out = { docScrollW: doc.scrollWidth, clientW: doc.clientWidth, mainW: main.getBoundingClientRect().width };
+ // scrollWidth > clientWidth per element = internal overflow that may spill
+ out.spillers = [...document.querySelectorAll('body *')]
+ .filter((el) => el.scrollWidth > el.clientWidth + 2 && getComputedStyle(el).overflowX === 'visible')
+ .slice(0, 10)
+ .map((el) => `${el.tagName}.${[...el.classList].join('.')} scrollW=${el.scrollWidth} clientW=${el.clientWidth}`);
+ const sel = document.getElementById('nw-source');
+ out.sourceSelW = sel ? sel.getBoundingClientRect().width : null;
+ const brk = document.getElementById('nwb-breaking');
+ out.breakW = brk && !brk.hidden ? brk.scrollWidth + '/' + brk.clientWidth : 'hidden';
return out;
});
-console.log(offenders.join('\n'));
+console.log(JSON.stringify(r, null, 1));
await browser.close();
diff --git a/scripts/check-overflow2-tmp.mjs b/scripts/check-overflow2-tmp.mjs
new file mode 100644
index 000000000..e13f4ea89
--- /dev/null
+++ b/scripts/check-overflow2-tmp.mjs
@@ -0,0 +1,7 @@
+import { chromium } from 'playwright';
+const browser = await chromium.launch();
+const page = await browser.newPage({ viewport: { width: 375, height: 800 } });
+await page.goto('http://localhost:8090/coins', { waitUntil: 'domcontentloaded', timeout: 60000 });
+await page.waitForTimeout(2500);
+console.log('coins:', await page.evaluate(() => `${document.documentElement.scrollWidth} vs ${document.documentElement.clientWidth}, boxSizing(main)=${getComputedStyle(document.querySelector('main')).boxSizing}`));
+await browser.close();
diff --git a/specs/ENS_AGENT_CLAIM.md b/specs/ENS_AGENT_CLAIM.md
index e2540c468..ffaaa585d 100644
--- a/specs/ENS_AGENT_CLAIM.md
+++ b/specs/ENS_AGENT_CLAIM.md
@@ -56,16 +56,23 @@ Either direction alone is **unverified**. A consumer (resolver, badge, indexer)
## Resolver behavior
-The HTTP resolver at [`/api/v1/agents/:caip`](../api/v1/agents/[caip].js) SHOULD, when reachable, resolve the `claims` array and return:
+The HTTP resolver at [`/api/v1/agents/:caip`](../api/v1/agents/[caip].js) currently returns the on-chain agent record plus card-level verification:
```json
-"claims": [
- { "type": "ens", "name": "coachleo.eth", "verified": true },
- { "type": "dns", "name": "coachleo.com", "verified": false, "reason": "no _agent TXT" }
-]
+{
+ "ref": "eip155:8453:0x…/42",
+ "chainId": 8453,
+ "agentId": "42",
+ "registry": "0x…",
+ "owner": "0x…",
+ "tokenURI": "ipfs://…",
+ "card": { "…": "the fetched agent card" },
+ "verified": { "modelSha256": true, "cardSchema": "3d-agent-card-v1" },
+ "fetchedAt": "2026-07-11T00:00:00.000Z"
+}
```
-Verification is best-effort and time-bounded; failures are reported, not thrown.
+Any `claims` array appears only inside `card` (verbatim from the agent card); the resolver does not yet verify it. As a future extension, the resolver SHOULD resolve the card's `claims` array and annotate each entry with a per-name `verified` flag (and a `reason` on failure), e.g. `{ "type": "ens", "name": "coachleo.eth", "verified": true }`. When implemented, verification is best-effort and time-bounded; failures are reported, not thrown.
## Adding `claims` to the v1 schema
diff --git a/specs/SECURITY.md b/specs/SECURITY.md
index 352e0ce82..7b997ce2e 100644
--- a/specs/SECURITY.md
+++ b/specs/SECURITY.md
@@ -52,7 +52,7 @@ Attacker mints thousands of agents to spam discovery surfaces.
Pinned GLB is dropped by all gateways; card now points at dead content.
-- **Mitigation:** the registration flow pins to Storacha (paid). Validators MUST re-fetch on every attestation; a dropped file produces a `fail` on `manifest-integrity`, demoting the agent.
+- **Mitigation:** the registration flow pins via the platform pinning service (`api/pinning/[action].js`) — Pinata when `PINATA_JWT` is set, with web3.storage and Filebase as alternative providers (`src/pinning/`). Validators MUST re-fetch on every attestation; a dropped file produces a `fail` on `manifest-integrity`, demoting the agent.
- **Status:** mitigated during validator runs. Long-term: optional Filecoin deal storage for "permanent" tier agents.
### V8 — NSFW / illegal model content
diff --git a/specs/SKILL_SPEC.md b/specs/SKILL_SPEC.md
index 8edf0c516..e04bf0ccc 100644
--- a/specs/SKILL_SPEC.md
+++ b/specs/SKILL_SPEC.md
@@ -242,7 +242,15 @@ A skill without `handlers.js` is valid — it's pure prompt engineering + assets
## Skill discovery
-`Registry.searchSkills({ tags: ["greeting"], rig: "mixamo" })` queries:
+The runtime class is `SkillRegistry` ([src/skills/index.js](../src/skills/index.js)). Skills are installed explicitly with `registry.install({ uri, version })` and removed with `registry.uninstall(name)`; there is no built-in search method. Discovery over the installed set is caller-side iteration — e.g. filter `registry.all()` by manifest fields such as `tags`:
+
+```js
+const greeters = registry.all().filter((s) => s.manifest.tags?.includes("greeting"));
+```
+
+`registry.allTools()` merges every installed skill's tool schemas into the runtime tool-use schema, `registry.findSkillForTool(name)` resolves a tool name back to its skill, and `registry.systemPrompt()` concatenates the installed skills' `SKILL.md` fragments for the system prompt.
+
+Install specs come from:
1. The local manifest's `skills` array.
2. Optional HTTPS skill index (community-hosted).
diff --git a/specs/VALIDATORS.md b/specs/VALIDATORS.md
index 44fb971d3..eb654ddf4 100644
--- a/specs/VALIDATORS.md
+++ b/specs/VALIDATORS.md
@@ -8,7 +8,7 @@ A validation report says "I checked agent #N's model and it is sound." For that
## What a validator attests to
-A validator runs a deterministic suite over an agent's GLB and metadata, produces an [agent validation report](../public/validation/REPORT_FORMAT.md), pins it to IPFS, and calls `recordValidation(agentId, reportCID)` from an allow-listed address.
+A validator runs a deterministic suite over an agent's GLB and metadata, produces an [agent validation report](../public/validation/REPORT_FORMAT.md), pins it to IPFS, and calls `recordValidation(uint256 agentId, bool passed, bytes32 proofHash, string proofURI, string kind)` from an allow-listed address — `proofHash` is the sha256 of the report JSON, `proofURI` points at the pinned report (e.g. `ipfs://…`), and `kind` tags the suite (e.g. `"glb-schema"`).
The minimum suite for "verified" status:
@@ -24,7 +24,7 @@ A `pass` verdict requires zero `fail` suites. `warn` is allowed.
## Current allow-list
-Maintained on-chain at the registry's `validators` mapping. The canonical mirror lives at:
+Maintained on-chain at the registry's `isValidator` mapping. The canonical mirror lives at:
- **Base mainnet (8453):** [public/.well-known/validators.json](../public/.well-known/validators.json)
- **Base Sepolia (84532):** same file, `testnet` array.
diff --git a/src/coin-pages.css b/src/coin-pages.css
index e88955f35..1bf940a7a 100644
--- a/src/coin-pages.css
+++ b/src/coin-pages.css
@@ -133,6 +133,10 @@ html.cv-page,
margin: 0 auto;
padding: 2.5rem var(--cv-content-padding) 4rem;
width: 100%;
+ /* width:100% + horizontal padding must not exceed the viewport — without
+ this every cv-page is 2×padding wider than small screens and scrolls
+ sideways. */
+ box-sizing: border-box;
}
/* ── Typography ─────────────────────────────────────────────────────────── */
@@ -2042,6 +2046,10 @@ a.cv-liq-item:focus-visible {
}
.nwb-search {
width: 100%;
+ max-width: none;
+ /* .cv-search carries flex: 1 1 16rem for row layouts; inside this column
+ that basis becomes 256px of HEIGHT. Reset to content height. */
+ flex: 0 0 auto;
}
.nwb-controls {
display: flex;
diff --git a/src/shared/news-render.js b/src/shared/news-render.js
index 7edff7e71..07ff5037a 100644
--- a/src/shared/news-render.js
+++ b/src/shared/news-render.js
@@ -9,9 +9,10 @@
// 2. On error, one retry through the same-origin /api/img proxy — the server
// fetch is immune to referrer/CORS blocking and mixed-content rules.
// 3. On a second error, the source-initials tile.
-// Articles whose feed ships no image at all point at /api/news/image, which
-// resolves the publisher page's og:image server-side; its 404 lands on the
-// same initials tile.
+// Articles whose feed ships no image at all render the initials tile
+// immediately and upgrade in place: /api/news/image resolves the publisher
+// page's og:image server-side, fetched from here with fetch() (not an <img>
+// src) so its designed "no preview exists" 404 never logs a console error.
import { timeAgo, escapeHtml as esc } from './coin-format.js';
import { storyPath } from './news-links.js';
@@ -115,11 +116,61 @@ const proxied = (u) => `/api/img?url=${encodeURIComponent(u)}`;
export function newsMedia(a, { heroic = false } = {}) {
const cls = heroic ? 'nw-hero-media' : 'nw-media';
const initials = esc((a.source || '?').slice(0, 2).toUpperCase());
- // Feed image → direct load with one proxy retry. No feed image → the
- // og:image resolver; its 404 fires the same error path → initials tile.
- const src = a.image || `/api/news/image?url=${encodeURIComponent(a.link)}`;
- const retry = a.image ? ` data-retry="${esc(proxied(a.image))}"` : '';
- return `<div class="${cls}" style="position:relative"><img src="${esc(src)}" alt="" loading="lazy" decoding="async" referrerpolicy="no-referrer" data-fallback="${initials}"${retry} /></div>`;
+ if (!a.image) {
+ // Designed tile now; wireNewsContainer resolves the publisher's og:image
+ // in the background and swaps the tile when one exists.
+ return `<div class="${cls}" style="position:relative" data-resolve="${esc(a.link)}"><div class="nw-fallback">${initials}</div></div>`;
+ }
+ return `<div class="${cls}" style="position:relative"><img src="${esc(a.image)}" alt="" loading="lazy" decoding="async" referrerpolicy="no-referrer" data-fallback="${initials}" data-retry="${esc(proxied(a.image))}" /></div>`;
+}
+
+// og:image resolution for imageless articles, bounded to a few fetches in
+// flight — a page of text-only stories must not fire fifteen concurrent
+// upstream page-fetches through the resolver.
+const RESOLVE_CONCURRENCY = 4;
+let resolveActive = 0;
+const resolveQueue = [];
+
+function pumpResolveQueue() {
+ while (resolveActive < RESOLVE_CONCURRENCY && resolveQueue.length) {
+ const job = resolveQueue.shift();
+ resolveActive++;
+ job().finally(() => {
+ resolveActive--;
+ pumpResolveQueue();
+ });
+ }
+}
+
+async function resolveMedia(el, link) {
+ try {
+ const res = await fetch(`/api/news/image?url=${encodeURIComponent(link)}`);
+ if (!res.ok) return; // no preview exists — the tile IS the design
+ const blob = await res.blob();
+ if (!blob.type.startsWith('image/')) return;
+ const tile = el.querySelector('.nw-fallback');
+ if (!tile || !el.isConnected) return;
+ const img = document.createElement('img');
+ img.alt = '';
+ img.decoding = 'async';
+ const url = URL.createObjectURL(blob);
+ img.onload = () => {
+ URL.revokeObjectURL(url);
+ tile.replaceWith(img);
+ };
+ img.src = url;
+ } catch {
+ /* network hiccup — the tile stays */
+ }
+}
+
+function queueMediaResolves(container) {
+ for (const el of container.querySelectorAll('[data-resolve]')) {
+ const link = el.dataset.resolve;
+ el.removeAttribute('data-resolve'); // claim before the job runs — never double-queue
+ if (link) resolveQueue.push(() => resolveMedia(el, link));
+ }
+ pumpResolveQueue();
}
// ── Cards / rows ─────────────────────────────────────────────────────────────
@@ -167,6 +218,19 @@ export function newsRow(a, { thumb = true, star = true } = {}) {
* • star buttons → saved store; onSave lets the Saved tab react live
*/
export function wireNewsContainer(container, { onTicker, onSave } = {}) {
+ // Upgrade imageless tiles now and after every re-render (tab switches and
+ // load-more replace innerHTML; the observer catches them all).
+ queueMediaResolves(container);
+ let resolveScheduled = false;
+ new MutationObserver(() => {
+ if (resolveScheduled) return;
+ resolveScheduled = true;
+ requestAnimationFrame(() => {
+ resolveScheduled = false;
+ queueMediaResolves(container);
+ });
+ }).observe(container, { childList: true, subtree: true });
+
container.addEventListener(
'error',
(e) => {