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 accuracy pass: audit every /docs page against the live code

nirholas3c23ca08a840
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9ff2b0ae1..aa40497d2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -48,6 +48,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Image understanding is more reliable across every image host** — The vision endpoint (used to describe and check 3D renders and avatars) now fetches your image itself and hands it straight to the free model, instead of asking the model's server to go fetch the link. Some image hosts block that server-side fetch, which used to push the request onto a paid fallback and, when that fallback was unavailable, fail outright. Now the free lane serves the request regardless of how the image is hosted, so describe/critique calls stop returning errors on perfectly good images. (`/pulse`) `[fix, improvement]`
- **On-chain reads stay smooth when a data provider hits its daily cap** — The platform reads Solana through a prioritized chain of RPC providers and automatically fails over the instant one is throttled. It now recognizes the specific 'daily request limit reached' signal that metered providers return when a plan's daily quota is spent, and parks that provider for the rest of the day instead of re-checking it every few minutes. On-chain data (balances, prices, live trades) keeps flowing through a healthy provider without a stumble, and the failover leaves the retry chatter behind. A dedicated reserve endpoint was also wired in as deep insurance for the rare case the whole free provider pool is down at once. `[infra, improvement]`
- **Solana price and trade reads now ride a dedicated premium connection** — Every live Solana read the platform depends on (the $THREE price and bonding-curve, wallet balances, agent trades, and on-chain activity) now goes first through a dedicated premium RPC endpoint that absorbs the load ahead of the shared public providers, then falls back automatically down the full free-provider chain if that endpoint is ever unavailable. In practice that means fewer rate-limit stalls and fewer degraded or stale reads when Solana is busy, without adding a single point of failure: if the premium lane blinks, the free chain still answers. (`/pulse`) `[infra, improvement]`
+- **The docs got a full accuracy pass against the live platform** — Every page under three.ws/docs was cross-checked line by line against the code that actually runs in production. Around 180 outdated or wrong statements were corrected: dead links and sample URLs, endpoints and prices that had changed, code examples that no longer worked, and descriptions of features that had since evolved. Twenty-two existing guides that were previously unreachable from the sidebar (including the 3D Viewer, Editor, Crypto Data API, Trading Copilot, and Premium pass docs) are now listed in the navigation, and every wallet ability deep-dive gained a copy-pasteable Try It section. If you read something in the docs today, it matches what the platform actually does. (`/docs`) `[docs, improvement]`
- **The free 3D Studio now publishes a machine-readable API description** — The free text-to-3D generation endpoint that powers the three.ws 3D Studio in ChatGPT now ships a published OpenAPI description at /.well-known/3d-studio-openapi.yaml. Any app, custom GPT, or agent can read it to discover how to generate a model from a prompt and poll for the result, with no account, no API key, and no payment. It documents only the free generation action and is kept automatically in sync with the version used by the 3D Studio custom GPT, so the two never drift. `[docs, sdk]`
- **Two new guides explain the Forge, inside and out** — The 3D generation pipeline now has real documentation at both depths. A plain-language guide walks through the five steps between typing a prompt and downloading a model, including how jobs quietly move to a backup engine when one goes down. A full architecture deep dive covers the engine grid, free-first routing, failover, storage, GPU workers, and payments for anyone building on or contributing to the pipeline. Also published on the blog. (`/docs/how-forge-works`) `[docs]`
@@ -625,7 +626,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Coin Autopilot** (`/autopilot`) — A hands-off token cockpit: set the rules — buys, sells, and guardrails — and let your agent run the coin autonomously.
- **Diorama** (`/diorama`) — Speak a little world into being — describe a scene and watch it assemble into an explorable 3D diorama you can walk through, then take it into AR.
- **Mocap Studio** (`/mocap-studio`) — Drive a 3D avatar with your webcam — real-time facial motion capture in the browser, no rig and no download.
-- **Talking Avatar Video** (`/create/video`) — Turn a three.ws avatar into a talking-head video: type a script, pick a voice, and export a lip-synced clip.
+- **Talking Avatar Video** (`/create/video`) — Turn a three.ws avatar into a talking-head video: upload your audio and export a lip-synced clip.
- **Agent hire receipts and the economy market are back online** — Fixed a routing bug that was quietly 404ing a family of agent endpoints. The agent screen's 'A2A-hire receipts' panel, the agent-to-agent economy marketplace, agent NFT galleries, the social-recovery inbox, the showrunner feed and agent-to-agent messaging were all being swallowed by the catch-all that resolves an agent by id, so each returned 'agent not found' instead of its real data. They now resolve to their own handlers and load correctly. Separately, when the avatar's face-animation provider is unavailable the talking avatar now settles onto its built-in amplitude lip-sync after the first failure instead of retrying every line — no visible change, just fewer wasted calls and a cleaner console. (`/agent-screen`) `[fix]`
- **Agent profile pages read tighter and clearer** — The agent profile got a polish pass so a quieter agent's page no longer looks abandoned and its numbers can't be misread. The live stats strip under the agent's name — agents live, win rate, oracle wins, scored today — are three.ws-wide totals, but sitting right beneath the name they read like the agent's own record; they're now clearly labelled 'Across three.ws' so there's no confusion. Sections that had nothing to show are no longer displayed as hollow shells: the Copy-Trading card stays hidden until an agent has a real on-chain track record to mirror, and Creator Rewards only appears once the agent has actually earned, instead of a permanent 'Lifetime rewards: 0 SOL' row. And the floating 'Have you tried…' suggestion now gently retracts on its own after a few seconds — pausing while you hover or read it — instead of sitting pinned over the page until you close it. `[improvement, fix]`
- **Avatar picker is readable everywhere again** — Fixed the "Choose an avatar" browser on pages that don't load the platform's design tokens. The source toggle (Public gallery / My avatars), the tag filters, and the "Use this avatar" button were rendering as black text on a black background — you could only see them by highlighting them. The picker now carries its own colour, border and surface fallbacks, so every control is fully visible on any page that embeds it, while still matching the surrounding theme when one is present. `[fix]`
diff --git a/data/changelog.json b/data/changelog.json
index 1fabb99d3..697e94da9 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-07-18",
+ "title": "The docs got a full accuracy pass against the live platform",
+ "summary": "Every page under three.ws/docs was cross-checked line by line against the code that actually runs in production. Around 180 outdated or wrong statements were corrected: dead links and sample URLs, endpoints and prices that had changed, code examples that no longer worked, and descriptions of features that had since evolved. Twenty-two existing guides that were previously unreachable from the sidebar (including the 3D Viewer, Editor, Crypto Data API, Trading Copilot, and Premium pass docs) are now listed in the navigation, and every wallet ability deep-dive gained a copy-pasteable Try It section. If you read something in the docs today, it matches what the platform actually does.",
+ "tags": [
+ "docs",
+ "improvement"
+ ],
+ "link": "/docs"
+ },
{
"date": "2026-07-18",
"title": "The free 3D Studio now publishes a machine-readable API description",
diff --git a/docs/ALL.md b/docs/ALL.md
index b0af780f7..c478625fd 100644
--- a/docs/ALL.md
+++ b/docs/ALL.md
@@ -1,7 +1,7 @@
<!-- GENERATED by scripts/combine-docs.mjs — do not edit by hand. Edit the source files under docs/ and re-run. -->
# three.ws — Combined Documentation
-> Single-file snapshot of every document under [`docs/`](.). Generated 2026-07-14 from **293 files** (~4527 KB).
+> Single-file snapshot of every document under [`docs/`](.). Generated 2026-07-18 from **348 files** (~5077 KB).
> The individual source files remain the canonical, editable copies — this file is a read-only aggregate.
## Table of contents
@@ -19,139 +19,185 @@
- [agent-reputation.md](#sec-051)
- [agent-shell.md](#sec-052)
- [agent-skills.md](#sec-053)
-- [agent-system.md](#sec-054)
-- [agent-wallets.md](#sec-055)
-- [agents-vs-avatars.md](#sec-056)
-- [agora.md](#sec-057)
-- [animations.md](#sec-070)
-- [api-reference.md](#sec-071)
-- [ar.md](#sec-073)
-- [architecture.md](#sec-074)
-- [authentication.md](#sec-075)
-- [autonomous-economy.md](#sec-076)
-- [autonomous-x402.md](#sec-077)
-- [avatar-creation.md](#sec-078)
-- [avatar-inspector.md](#sec-079)
-- [avatar-pipeline.md](#sec-080)
-- [avatar-thumbnails.md](#sec-081)
-- [aws-builder-center-marketplace-x402.md](#sec-082)
-- [aws-builder-center-mcp-agents.md](#sec-083)
-- [aws-marketplace-listing-kit.md](#sec-084)
-- [aws-marketplace.md](#sec-085)
-- [aws-partner-spotlight.md](#sec-086)
-- [bnb-babt-findings.md](#sec-087)
-- [bnb-payments.md](#sec-088)
-- [bnb-vault.md](#sec-089)
-- [bnb-world.md](#sec-090)
-- [btn-pill-migration.md](#sec-091)
-- [build.md](#sec-092)
-- [changelog.md](#sec-093)
-- [character-studio.md](#sec-094)
-- [circulation-engine.md](#sec-095)
-- [coin-launches.md](#sec-096)
-- [coin-pages.md](#sec-097)
-- [coinmarketcap-article-play.md](#sec-098)
-- [coinmarketcap-article.md](#sec-099)
-- [configuration.md](#sec-100)
-- [contributing.md](#sec-107)
-- [crypto-api.md](#sec-108)
-- [custody.md](#sec-109)
-- [demo-routes.md](#sec-110)
-- [deployment.md](#sec-111)
-- [do-i-need-crypto.md](#sec-112)
-- [economy-heartbeat.md](#sec-113)
-- [economy-master.md](#sec-114)
-- [editor.md](#sec-115)
-- [embedding.md](#sec-116)
-- [embody.md](#sec-117)
-- [erc8004.md](#sec-118)
-- [examples.md](#sec-120)
-- [financial-controls.md](#sec-121)
-- [hold-to-access.md](#sec-122)
-- [how-it-works.md](#sec-123)
-- [i18n.md](#sec-124)
-- [ibm-x402-mcp.md](#sec-125)
-- [ibm.md](#sec-126)
-- [introduction.md](#sec-127)
-- [irl.md](#sec-128)
-- [js-api.md](#sec-130)
-- [labor-market.md](#sec-131)
-- [launch-usecases.md](#sec-132)
-- [layers.md](#sec-133)
-- [listings.md](#sec-134)
-- [make-your-agent.md](#sec-135)
-- [market-data-api.md](#sec-136)
-- [marketplace.md](#sec-137)
-- [mcp-3d-studio.md](#sec-138)
-- [mcp-agent.md](#sec-139)
-- [mcp-studio.md](#sec-140)
-- [mcp-tools.md](#sec-141)
-- [mcp-x402-bazaar.md](#sec-142)
-- [mcp.md](#sec-143)
-- [memetic-launcher.md](#sec-144)
-- [memory.md](#sec-145)
-- [mint-mark.md](#sec-146)
-- [money-feed.md](#sec-147)
-- [money-map.md](#sec-148)
-- [multi-agent.md](#sec-149)
-- [nvidia-models.md](#sec-150)
-- [nvidia-nemotron-spotlight.md](#sec-151)
-- [okx-marketplace.md](#sec-152)
-- [onchain-agents.md](#sec-153)
-- [oracle.md](#sec-154)
-- [package-extraction.md](#sec-155)
-- [pay-skills-listing.md](#sec-157)
-- [permissions.md](#sec-158)
-- [persona-hub.md](#sec-159)
-- [plan-checkout.md](#sec-160)
-- [popular-3d-github-repos.md](#sec-161)
-- [premium.md](#sec-162)
-- [provenance.md](#sec-163)
-- [pump-fun-mcp-edge.md](#sec-164)
-- [pump-launch-repos.md](#sec-165)
-- [pump-launcher.md](#sec-166)
-- [pump-platform-fee.md](#sec-167)
-- [quick-start.md](#sec-187)
-- [remix.md](#sec-188)
-- [reputation.md](#sec-189)
-- [risk-acknowledgment.md](#sec-190)
-- [robinhood-chain-markets.md](#sec-191)
-- [sas-attestations.md](#sec-192)
-- [sdk.md](#sec-193)
-- [security.md](#sec-194)
-- [share-and-embed.md](#sec-195)
-- [sketchfab.md](#sec-196)
-- [skills.md](#sec-197)
-- [smart-contracts.md](#sec-198)
-- [solana-pumpfun.md](#sec-199)
-- [solana-reputation.md](#sec-200)
-- [solana.md](#sec-201)
-- [spatial-mcp.md](#sec-202)
-- [start-here.md](#sec-204)
-- [syndication.md](#sec-205)
-- [token-gated-3d-embeds.md](#sec-206)
-- [trader-card.md](#sec-207)
-- [trading-arenas.md](#sec-208)
-- [trading-copilot.md](#sec-209)
-- [trading-experiment.md](#sec-210)
-- [trading-surfaces.md](#sec-211)
-- [troubleshooting.md](#sec-212)
-- [trust-primitives.md](#sec-213)
-- [ui-juice.md](#sec-262)
-- [validation.md](#sec-275)
-- [vanity.md](#sec-276)
-- [viewer.md](#sec-277)
-- [web-component.md](#sec-278)
-- [widget-api.md](#sec-279)
-- [widget-studio.md](#sec-280)
-- [widgets.md](#sec-281)
-- [x402-buyer.md](#sec-282)
-- [x402-dev-tools.md](#sec-283)
-- [x402-distribution.md](#sec-284)
-- [x402-endpoints.md](#sec-285)
-- [x402-revenue.md](#sec-286)
-- [x402-ring-economy.md](#sec-287)
-- [x402.md](#sec-288)
+- [agent-studio.md](#sec-054)
+- [agent-system.md](#sec-055)
+- [agent-wallets.md](#sec-056)
+- [agents-vs-avatars.md](#sec-057)
+- [agi.md](#sec-058)
+- [agora.md](#sec-059)
+- [alpha-copilot.md](#sec-072)
+- [animation-studio.md](#sec-073)
+- [animations.md](#sec-074)
+- [api-reference.md](#sec-075)
+- [ar-studio.md](#sec-077)
+- [ar.md](#sec-078)
+- [architecture.md](#sec-079)
+- [authentication.md](#sec-080)
+- [autonomous-economy.md](#sec-081)
+- [autonomous-x402.md](#sec-082)
+- [autopilot.md](#sec-083)
+- [avatar-creation.md](#sec-084)
+- [avatar-inspector.md](#sec-085)
+- [avatar-pipeline.md](#sec-086)
+- [avatar-reconstruction.md](#sec-087)
+- [avatar-studio.md](#sec-088)
+- [avatar-thumbnails.md](#sec-089)
+- [aws-builder-center-marketplace-x402.md](#sec-090)
+- [aws-builder-center-mcp-agents.md](#sec-091)
+- [aws-marketplace-listing-kit.md](#sec-092)
+- [aws-marketplace.md](#sec-093)
+- [aws-partner-spotlight.md](#sec-094)
+- [bnb-babt-findings.md](#sec-095)
+- [bnb-payments.md](#sec-096)
+- [bnb-vault.md](#sec-097)
+- [bnb-world.md](#sec-098)
+- [brain.md](#sec-099)
+- [btn-pill-migration.md](#sec-100)
+- [build.md](#sec-101)
+- [capture.md](#sec-102)
+- [changelog.md](#sec-103)
+- [character-studio.md](#sec-104)
+- [chatgpt-ar.md](#sec-105)
+- [circulation-engine.md](#sec-106)
+- [clash.md](#sec-107)
+- [clip-director.md](#sec-108)
+- [coin-launches.md](#sec-109)
+- [coin-pages.md](#sec-110)
+- [coinmarketcap-article-play.md](#sec-111)
+- [coinmarketcap-article.md](#sec-112)
+- [compose.md](#sec-113)
+- [configuration.md](#sec-114)
+- [contributing.md](#sec-121)
+- [cosmos.md](#sec-122)
+- [crypto-api.md](#sec-123)
+- [custody.md](#sec-124)
+- [daily-forge.md](#sec-125)
+- [demo-routes.md](#sec-126)
+- [deployment.md](#sec-127)
+- [diorama.md](#sec-128)
+- [do-i-need-crypto.md](#sec-129)
+- [economy-heartbeat.md](#sec-130)
+- [economy-master.md](#sec-131)
+- [editor.md](#sec-132)
+- [embedding.md](#sec-133)
+- [embody.md](#sec-134)
+- [erc8004.md](#sec-135)
+- [examples.md](#sec-137)
+- [fact-check.md](#sec-138)
+- [financial-controls.md](#sec-139)
+- [forge-background-generation.md](#sec-140)
+- [forge-off.md](#sec-141)
+- [forge-pipeline.md](#sec-142)
+- [forge.md](#sec-143)
+- [galaxy.md](#sec-144)
+- [genesis.md](#sec-145)
+- [genome.md](#sec-146)
+- [guardian.md](#sec-147)
+- [hold-to-access.md](#sec-148)
+- [how-forge-works.md](#sec-149)
+- [how-it-works.md](#sec-150)
+- [i18n.md](#sec-151)
+- [ibm-x402-mcp.md](#sec-152)
+- [ibm.md](#sec-153)
+- [image-to-3d.md](#sec-154)
+- [integrations.md](#sec-155)
+- [introduction.md](#sec-156)
+- [irl.md](#sec-157)
+- [js-api.md](#sec-159)
+- [labor-market.md](#sec-160)
+- [launch-usecases.md](#sec-161)
+- [layers.md](#sec-162)
+- [lipsync.md](#sec-163)
+- [listings.md](#sec-164)
+- [make-your-agent.md](#sec-165)
+- [market-data-api.md](#sec-166)
+- [marketplace.md](#sec-167)
+- [mcp-3d-studio.md](#sec-168)
+- [mcp-agent.md](#sec-169)
+- [mcp-studio.md](#sec-170)
+- [mcp-tools.md](#sec-171)
+- [mcp-x402-bazaar.md](#sec-172)
+- [mcp.md](#sec-173)
+- [memetic-launcher.md](#sec-174)
+- [memory.md](#sec-175)
+- [meta-allocator.md](#sec-176)
+- [mint-mark.md](#sec-177)
+- [mocap-studio.md](#sec-178)
+- [money-feed.md](#sec-179)
+- [money-map.md](#sec-180)
+- [multi-agent.md](#sec-181)
+- [nvidia-models.md](#sec-182)
+- [nvidia-nemotron-spotlight.md](#sec-183)
+- [okx-marketplace.md](#sec-184)
+- [onchain-agents.md](#sec-185)
+- [oracle.md](#sec-194)
+- [package-extraction.md](#sec-195)
+- [pay-skills-listing.md](#sec-197)
+- [permissions.md](#sec-198)
+- [persona-hub.md](#sec-199)
+- [plan-checkout.md](#sec-200)
+- [popular-3d-github-repos.md](#sec-201)
+- [premium.md](#sec-202)
+- [provenance.md](#sec-203)
+- [pump-fun-mcp-edge.md](#sec-204)
+- [pump-launch-repos.md](#sec-205)
+- [pump-launcher.md](#sec-206)
+- [pump-platform-fee.md](#sec-207)
+- [quick-start.md](#sec-227)
+- [radar.md](#sec-228)
+- [remix.md](#sec-229)
+- [reputation.md](#sec-230)
+- [restyle.md](#sec-231)
+- [risk-acknowledgment.md](#sec-232)
+- [robinhood-chain-markets.md](#sec-233)
+- [sas-attestations.md](#sec-234)
+- [scene-studio.md](#sec-235)
+- [sdk.md](#sec-236)
+- [security.md](#sec-237)
+- [selfie-to-avatar.md](#sec-238)
+- [share-and-embed.md](#sec-239)
+- [signals.md](#sec-240)
+- [sketchfab.md](#sec-241)
+- [skills.md](#sec-242)
+- [smart-contracts.md](#sec-243)
+- [smart-money.md](#sec-244)
+- [social-layer.md](#sec-245)
+- [solana-pumpfun.md](#sec-246)
+- [solana-reputation.md](#sec-247)
+- [solana.md](#sec-248)
+- [spatial-mcp.md](#sec-249)
+- [splat.md](#sec-251)
+- [start-here.md](#sec-252)
+- [strategy-objects.md](#sec-253)
+- [syndication.md](#sec-254)
+- [talking-avatar-video.md](#sec-255)
+- [terminal.md](#sec-256)
+- [three-microbuy.md](#sec-257)
+- [token-gated-3d-embeds.md](#sec-258)
+- [trader-card.md](#sec-259)
+- [trading-arenas.md](#sec-260)
+- [trading-copilot.md](#sec-261)
+- [trading-experiment.md](#sec-262)
+- [trading-surfaces.md](#sec-263)
+- [troubleshooting.md](#sec-264)
+- [trust-primitives.md](#sec-265)
+- [ui-juice.md](#sec-315)
+- [validation.md](#sec-328)
+- [vanity.md](#sec-329)
+- [viewer.md](#sec-330)
+- [voice-lab.md](#sec-331)
+- [web-component.md](#sec-332)
+- [widget-api.md](#sec-333)
+- [widget-studio.md](#sec-334)
+- [widgets.md](#sec-335)
+- [x402-buyer.md](#sec-336)
+- [x402-dev-tools.md](#sec-337)
+- [x402-distribution.md](#sec-338)
+- [x402-endpoints.md](#sec-339)
+- [x402-revenue.md](#sec-340)
+- [x402-ring-economy.md](#sec-341)
+- [x402-studio.md](#sec-342)
+- [x402.md](#sec-343)
### agent-abilities
@@ -200,143 +246,155 @@
### agora
-- [agora/tasks/00-INDEX.md](#sec-058)
-- [agora/tasks/01-verify-foundation.md](#sec-059)
-- [agora/tasks/02-life-engine.md](#sec-060)
-- [agora/tasks/03-task-supply.md](#sec-061)
-- [agora/tasks/04-professions.md](#sec-062)
-- [agora/tasks/05-commons-scaffold.md](#sec-063)
-- [agora/tasks/06-economy-visuals.md](#sec-064)
-- [agora/tasks/07-verify-and-passport.md](#sec-065)
-- [agora/tasks/08-humans-first-class.md](#sec-066)
-- [agora/tasks/09-arena-and-guilds.md](#sec-067)
-- [agora/tasks/10-agora-mcp.md](#sec-068)
-- [agora/tasks/11-production-hardening.md](#sec-069)
+- [agora/tasks/00-INDEX.md](#sec-060)
+- [agora/tasks/01-verify-foundation.md](#sec-061)
+- [agora/tasks/02-life-engine.md](#sec-062)
+- [agora/tasks/03-task-supply.md](#sec-063)
+- [agora/tasks/04-professions.md](#sec-064)
+- [agora/tasks/05-commons-scaffold.md](#sec-065)
+- [agora/tasks/06-economy-visuals.md](#sec-066)
+- [agora/tasks/07-verify-and-passport.md](#sec-067)
+- [agora/tasks/08-humans-first-class.md](#sec-068)
+- [agora/tasks/09-arena-and-guilds.md](#sec-069)
+- [agora/tasks/10-agora-mcp.md](#sec-070)
+- [agora/tasks/11-production-hardening.md](#sec-071)
### api
-- [api/forge-x402.md](#sec-072)
+- [api/forge-x402.md](#sec-076)
### content
-- [content/use-cases/README.md](#sec-101)
-- [content/use-cases/ai-agent-developer.md](#sec-102)
-- [content/use-cases/brand-marketer.md](#sec-103)
-- [content/use-cases/crypto-community.md](#sec-104)
-- [content/use-cases/game-studio.md](#sec-105)
-- [content/use-cases/indie-creator.md](#sec-106)
+- [content/use-cases/README.md](#sec-115)
+- [content/use-cases/ai-agent-developer.md](#sec-116)
+- [content/use-cases/brand-marketer.md](#sec-117)
+- [content/use-cases/crypto-community.md](#sec-118)
+- [content/use-cases/game-studio.md](#sec-119)
+- [content/use-cases/indie-creator.md](#sec-120)
### erc8004
-- [erc8004/validation-attestation.md](#sec-119)
+- [erc8004/validation-attestation.md](#sec-136)
### irl
-- [irl/THREAT-MODEL.md](#sec-129)
+- [irl/THREAT-MODEL.md](#sec-158)
+
+### openai-pr
+
+- [openai-pr/00-START-HERE.md](#sec-186)
+- [openai-pr/01-orphan-widget-resolution.md](#sec-187)
+- [openai-pr/02-wellknown-manifest-conflict.md](#sec-188)
+- [openai-pr/03-forge-free-tier-truth.md](#sec-189)
+- [openai-pr/04-openai-surface-test-coverage.md](#sec-190)
+- [openai-pr/05-custom-gpt-openapi-serving.md](#sec-191)
+- [openai-pr/06-docs-accuracy-reconciliation.md](#sec-192)
+- [openai-pr/07-final-verification-and-submit.md](#sec-193)
### partners
-- [partners/sperax-proposal.md](#sec-156)
+- [partners/sperax-proposal.md](#sec-196)
### pumpfun-program
-- [pumpfun-program/README.md](#sec-168)
-- [pumpfun-program/UPSTREAM-buy-sell-v2-announcement.md](#sec-169)
-- [pumpfun-program/docs/BREAKING_FEE_RECIPIENT.md](#sec-170)
-- [pumpfun-program/docs/CPI_README.md](#sec-171)
-- [pumpfun-program/docs/FAQ.md](#sec-172)
-- [pumpfun-program/docs/FEE_PROGRAM_README.md](#sec-173)
-- [pumpfun-program/docs/FEE_RECIPIENTS.md](#sec-174)
-- [pumpfun-program/docs/PUMP_CASHBACK_README.md](#sec-175)
-- [pumpfun-program/docs/PUMP_CREATOR_FEE_README.md](#sec-176)
-- [pumpfun-program/docs/PUMP_PROGRAM_README.md](#sec-177)
-- [pumpfun-program/docs/PUMP_SWAP_CREATOR_FEE_README.md](#sec-178)
-- [pumpfun-program/docs/PUMP_SWAP_README.md](#sec-179)
-- [pumpfun-program/docs/PUMP_SWAP_SDK_README.md](#sec-180)
-- [pumpfun-program/docs/instructions/BUY.md](#sec-181)
-- [pumpfun-program/docs/instructions/CLAIM_CASHBACK.md](#sec-182)
-- [pumpfun-program/docs/instructions/COIN_CREATION.md](#sec-183)
-- [pumpfun-program/docs/instructions/COLLECT_CREATOR_FEE.md](#sec-184)
-- [pumpfun-program/docs/instructions/CREATOR_FEE_SHARING.md](#sec-185)
-- [pumpfun-program/docs/instructions/SELL.md](#sec-186)
+- [pumpfun-program/README.md](#sec-208)
+- [pumpfun-program/UPSTREAM-buy-sell-v2-announcement.md](#sec-209)
+- [pumpfun-program/docs/BREAKING_FEE_RECIPIENT.md](#sec-210)
+- [pumpfun-program/docs/CPI_README.md](#sec-211)
+- [pumpfun-program/docs/FAQ.md](#sec-212)
+- [pumpfun-program/docs/FEE_PROGRAM_README.md](#sec-213)
+- [pumpfun-program/docs/FEE_RECIPIENTS.md](#sec-214)
+- [pumpfun-program/docs/PUMP_CASHBACK_README.md](#sec-215)
+- [pumpfun-program/docs/PUMP_CREATOR_FEE_README.md](#sec-216)
+- [pumpfun-program/docs/PUMP_PROGRAM_README.md](#sec-217)
+- [pumpfun-program/docs/PUMP_SWAP_CREATOR_FEE_README.md](#sec-218)
+- [pumpfun-program/docs/PUMP_SWAP_README.md](#sec-219)
+- [pumpfun-program/docs/PUMP_SWAP_SDK_README.md](#sec-220)
+- [pumpfun-program/docs/instructions/BUY.md](#sec-221)
+- [pumpfun-program/docs/instructions/CLAIM_CASHBACK.md](#sec-222)
+- [pumpfun-program/docs/instructions/COIN_CREATION.md](#sec-223)
+- [pumpfun-program/docs/instructions/COLLECT_CREATOR_FEE.md](#sec-224)
+- [pumpfun-program/docs/instructions/CREATOR_FEE_SHARING.md](#sec-225)
+- [pumpfun-program/docs/instructions/SELL.md](#sec-226)
### specs
-- [specs/agent-trading.md](#sec-203)
+- [specs/agent-trading.md](#sec-250)
### tutorials
-- [tutorials/agent-personality.md](#sec-214)
-- [tutorials/agent-reputation.md](#sec-215)
-- [tutorials/animate-your-avatar.md](#sec-216)
-- [tutorials/build-a-scene.md](#sec-217)
-- [tutorials/claim-threews-name.md](#sec-218)
-- [tutorials/connect-ai-brain.md](#sec-219)
-- [tutorials/create-and-edit-memory.md](#sec-220)
-- [tutorials/custom-skill.md](#sec-221)
-- [tutorials/customize-appearance.md](#sec-222)
-- [tutorials/deploy-to-vercel-custom-domain.md](#sec-223)
-- [tutorials/embed-in-30-seconds.md](#sec-224)
-- [tutorials/embed-on-website.md](#sec-225)
-- [tutorials/emotion-from-data.md](#sec-226)
-- [tutorials/first-agent.md](#sec-227)
-- [tutorials/generate-3d-api.md](#sec-228)
-- [tutorials/getting-started.md](#sec-229)
-- [tutorials/greeting-and-first-speech.md](#sec-230)
-- [tutorials/image-to-3d.md](#sec-231)
-- [tutorials/import-avatar-url.md](#sec-232)
-- [tutorials/js-api-events.md](#sec-233)
-- [tutorials/mcp-server-for-your-agent.md](#sec-234)
-- [tutorials/mine-vanity-address.md](#sec-235)
-- [tutorials/mint-pumpfun-token.md](#sec-236)
-- [tutorials/multi-agent-coordination.md](#sec-237)
-- [tutorials/nvidia-3d-free.md](#sec-238)
-- [tutorials/nvidia-nim-self-host.md](#sec-239)
-- [tutorials/paid-x402-endpoint.md](#sec-240)
-- [tutorials/pay-for-x402-service.md](#sec-241)
-- [tutorials/personal-ai-site.md](#sec-242)
-- [tutorials/place-agent-irl.md](#sec-243)
-- [tutorials/prompts-for-3d.md](#sec-244)
-- [tutorials/register-onchain.md](#sec-245)
-- [tutorials/self-host-agent-backend.md](#sec-246)
-- [tutorials/selfie-to-avatar.md](#sec-247)
-- [tutorials/share-your-agent.md](#sec-248)
-- [tutorials/shopify-store-guide-advanced.md](#sec-249)
-- [tutorials/shopify-store-guide.md](#sec-250)
-- [tutorials/skill-with-database-auth.md](#sec-251)
-- [tutorials/solana-agent-reputation.md](#sec-252)
-- [tutorials/sperax-tour.md](#sec-253)
-- [tutorials/swap-avatar-in-studio.md](#sec-254)
-- [tutorials/text-to-3d.md](#sec-255)
-- [tutorials/trigger-from-page-events.md](#sec-256)
-- [tutorials/upload-custom-glb.md](#sec-257)
-- [tutorials/view-in-ar.md](#sec-258)
-- [tutorials/voice-and-lipsync.md](#sec-259)
-- [tutorials/walk-companion.md](#sec-260)
-- [tutorials/web-component-end-to-end.md](#sec-261)
+- [tutorials/agent-personality.md](#sec-266)
+- [tutorials/agent-reputation.md](#sec-267)
+- [tutorials/animate-your-avatar.md](#sec-268)
+- [tutorials/build-a-scene.md](#sec-269)
+- [tutorials/claim-threews-name.md](#sec-270)
+- [tutorials/connect-ai-brain.md](#sec-271)
+- [tutorials/create-and-edit-memory.md](#sec-272)
+- [tutorials/custom-skill.md](#sec-273)
+- [tutorials/customize-appearance.md](#sec-274)
+- [tutorials/deploy-to-vercel-custom-domain.md](#sec-275)
+- [tutorials/embed-in-30-seconds.md](#sec-276)
+- [tutorials/embed-on-website.md](#sec-277)
+- [tutorials/emotion-from-data.md](#sec-278)
+- [tutorials/first-agent.md](#sec-279)
+- [tutorials/first-prompt-to-3d.md](#sec-280)
+- [tutorials/generate-3d-api.md](#sec-281)
+- [tutorials/getting-started.md](#sec-282)
+- [tutorials/greeting-and-first-speech.md](#sec-283)
+- [tutorials/image-to-3d.md](#sec-284)
+- [tutorials/import-avatar-url.md](#sec-285)
+- [tutorials/js-api-events.md](#sec-286)
+- [tutorials/mcp-server-for-your-agent.md](#sec-287)
+- [tutorials/mine-vanity-address.md](#sec-288)
+- [tutorials/mint-pumpfun-token.md](#sec-289)
+- [tutorials/multi-agent-coordination.md](#sec-290)
+- [tutorials/nvidia-3d-free.md](#sec-291)
+- [tutorials/nvidia-nim-self-host.md](#sec-292)
+- [tutorials/paid-x402-endpoint.md](#sec-293)
+- [tutorials/pay-for-x402-service.md](#sec-294)
+- [tutorials/personal-ai-site.md](#sec-295)
+- [tutorials/place-agent-irl.md](#sec-296)
+- [tutorials/prompts-for-3d.md](#sec-297)
+- [tutorials/register-onchain.md](#sec-298)
+- [tutorials/self-host-agent-backend.md](#sec-299)
+- [tutorials/selfie-to-avatar.md](#sec-300)
+- [tutorials/share-your-agent.md](#sec-301)
+- [tutorials/shopify-store-guide-advanced.md](#sec-302)
+- [tutorials/shopify-store-guide.md](#sec-303)
+- [tutorials/skill-with-database-auth.md](#sec-304)
+- [tutorials/solana-agent-reputation.md](#sec-305)
+- [tutorials/sperax-tour.md](#sec-306)
+- [tutorials/swap-avatar-in-studio.md](#sec-307)
+- [tutorials/text-to-3d.md](#sec-308)
+- [tutorials/trigger-from-page-events.md](#sec-309)
+- [tutorials/upload-custom-glb.md](#sec-310)
+- [tutorials/view-in-ar.md](#sec-311)
+- [tutorials/voice-and-lipsync.md](#sec-312)
+- [tutorials/walk-companion.md](#sec-313)
+- [tutorials/web-component-end-to-end.md](#sec-314)
### ux-flows
-- [ux-flows/01-onboarding-creation.md](#sec-263)
-- [ux-flows/02-forge-text-to-3d.md](#sec-264)
-- [ux-flows/03-3d-editing-viewer.md](#sec-265)
-- [ux-flows/04-embed-widget-studio.md](#sec-266)
-- [ux-flows/05-discovery-social.md](#sec-267)
-- [ux-flows/06-marketplace-skills.md](#sec-268)
-- [ux-flows/07-crypto-trading-analytics.md](#sec-269)
-- [ux-flows/08-coin-launch-wallets.md](#sec-270)
-- [ux-flows/09-x402-agent-commerce.md](#sec-271)
-- [ux-flows/10-chat-brain-labs.md](#sec-272)
-- [ux-flows/11-account-dashboard.md](#sec-273)
-- [ux-flows/12-home-and-content.md](#sec-274)
+- [ux-flows/01-onboarding-creation.md](#sec-316)
+- [ux-flows/02-forge-text-to-3d.md](#sec-317)
+- [ux-flows/03-3d-editing-viewer.md](#sec-318)
+- [ux-flows/04-embed-widget-studio.md](#sec-319)
+- [ux-flows/05-discovery-social.md](#sec-320)
+- [ux-flows/06-marketplace-skills.md](#sec-321)
+- [ux-flows/07-crypto-trading-analytics.md](#sec-322)
+- [ux-flows/08-coin-launch-wallets.md](#sec-323)
+- [ux-flows/09-x402-agent-commerce.md](#sec-324)
+- [ux-flows/10-chat-brain-labs.md](#sec-325)
+- [ux-flows/11-account-dashboard.md](#sec-326)
+- [ux-flows/12-home-and-content.md](#sec-327)
### zauth
-- [zauth/database.md](#sec-289)
-- [zauth/index.md](#sec-290)
-- [zauth/provider-hub.md](#sec-291)
-- [zauth/reposcan.md](#sec-292)
-- [zauth/vector.md](#sec-293)
+- [zauth/database.md](#sec-344)
+- [zauth/index.md](#sec-345)
+- [zauth/provider-hub.md](#sec-346)
+- [zauth/reposcan.md](#sec-347)
+- [zauth/vector.md](#sec-348)
---
@@ -474,6 +532,7 @@ model comes straight back:
"status": "done",
"glbUrl": "https://cdn.three.ws/forge/anon/a1b2c3d4.glb",
"viewerUrl": "https://three.ws/viewer?src=https%3A%2F%2Fcdn.three.ws%2Fforge%2Fanon%2Fa1b2c3d4.glb",
+ "arUrl": "https://three.ws/api/ar?src=https%3A%2F%2Fcdn.three.ws%2Fforge%2Fanon%2Fa1b2c3d4.glb&title=a%20small%20ceramic%20robot%20figurine",
"format": "glb",
"tier": "draft",
"free": true,
@@ -481,32 +540,52 @@ model comes straight back:
}
```
+`arUrl` is the place-in-your-room link (`/api/ar`): opened on a phone it
+launches AR directly — Scene Viewer on Android, Quick Look on iOS (GLB→USDZ
+converted in-page) — and on desktop it falls back to the interactive viewer.
+The prompt rides along as `title` so the AR page is labeled. Show it to end
+users as "place it in your room".
+
### Response — queued (poll)
-Otherwise you get a job token and a poll URL:
+Otherwise you get a job token and a poll URL (the prompt is carried as
+`title` so the finished AR page stays labeled):
```json
{
"status": "pending",
"job": "f1.eyJwIjoibnZpZGlh...",
- "poll": "/api/3d/generate?job=f1.eyJwIjoibnZpZGlh...",
+ "poll": "/api/3d/generate?job=f1.eyJwIjoibnZpZGlh...&title=a%20small%20ceramic%20robot%20figurine",
+ "retryAfter": 5,
+ "etaSeconds": 20,
+ "creationId": "a1b2c3d4-0000-4000-8000-000000000002",
"format": "glb",
"tier": "draft",
"free": true
}
```
-Poll the `poll` URL until the status is terminal:
+`retryAfter` is the recommended number of seconds to wait before the next poll
+(also sent as the standard `Retry-After` header); honor it and your poll loop
+stays under the rate limit instead of tripping a `429`, and the shared free GPU
+lane carries less traffic. `etaSeconds` is the estimated time until the model is
+ready when the lane reports one, and `creationId` is a stable handle for
+correlating logs and referencing the generation across calls. Every field is
+additive — older clients that ignore them keep working unchanged.
+
+Poll the `poll` URL until the status is terminal, waiting `retryAfter` seconds
+between polls:
```json
-GET /api/3d/generate?job=f1.eyJwIjoibnZpZGlh...
+GET /api/3d/generate?job=f1.eyJwIjoibnZpZGlh...&title=a%20small%20ceramic%20robot%20figurine
// still working
-{ "status": "pending", "job": "f1...", "poll": "/api/3d/generate?job=f1..." }
+{ "status": "pending", "job": "f1...", "poll": "/api/3d/generate?job=f1...&title=...", "retryAfter": 3 }
// ready
{ "status": "done", "job": "f1...", "glbUrl": "https://cdn.three.ws/forge/anon/done.glb",
- "viewerUrl": "https://three.ws/viewer?src=...", "format": "glb", "tier": "draft", "free": true }
+ "viewerUrl": "https://three.ws/viewer?src=...", "arUrl": "https://three.ws/api/ar?src=...&title=...",
+ "format": "glb", "tier": "draft", "free": true }
// upstream failed — free lane, so no charge; just retry
{ "status": "error", "job": "f1...", "error": "3D generation hit a snag upstream — no charge; try again.", "free": true }
@@ -518,8 +597,8 @@ GET /api/3d/generate?job=f1.eyJwIjoibnZpZGlh...
|-------------------------------|----------------------------------------------------------------|
| Empty / too-short / oversized prompt | `400 invalid_prompt` |
| Unsupported `format` | `400 unsupported_format` |
-| Queued | `200 { status: "pending", job, poll }` |
-| Ready | `200 { status: "done", glbUrl, viewerUrl }` |
+| Queued | `200 { status: "pending", job, poll, retryAfter, etaSeconds?, creationId? }` |
+| Ready | `200 { status: "done", glbUrl, viewerUrl, arUrl }` |
| Generation failed upstream | `200 { status: "error", error }` — free, **no charge** |
| GPU lane saturated / rate-limited | `429` with `Retry-After` + an upgrade pointer |
| Lane not configured on this deployment | `503 not_configured` |
@@ -568,6 +647,44 @@ anywhere.
---
+### Prompt art direction (the `director` pass) and brand marks
+
+Text→3D runs text→image→mesh, so prompt quality decides mesh quality. Two
+layers improve it, both shared across every generation surface (the studio MCP
+tools, the paid REST twin, and this lane):
+
+**The art director.** On `POST /api/forge`, an IBM Granite "art director"
+pass runs **by default** on every text prompt (pass `director: false` to skip
+it) and rewrites your rough idea into one information-dense spec before
+generation: the single subject and its silhouette, its construction and part
+joins, per-part PBR material cues, one held art style, fine surface detail,
+and composition constraints tuned for clean image→mesh reconstruction
+(centered, isolated, no text, no collage). It is fail-soft: if the director
+LLM is unavailable, the raw prompt proceeds untouched. The prompt specs live in one
+module, [api/_lib/forge-director-prompts.js](../api/_lib/forge-director-prompts.js)
+(`MESH_DIRECTOR` for objects and props, `AVATAR_DIRECTOR` for rig-ready
+humanoids), so the free and paid lanes cannot drift apart.
+
+**The brand-mark lexicon.** Neither the director LLM nor the image model
+reliably knows what a niche brand mark looks like, so "pumpfun logo" used to
+reconstruct as a generic badge covered in garbled lettering. Prompts that are
+essentially "<known brand> logo" (or the bare brand name) now resolve
+deterministically
+([mcp-server/src/tools/_logo-lexicon.js](../mcp-server/src/tools/_logo-lexicon.js),
+`resolveLogoPrompt`): the lexicon returns a concrete geometric description of
+the real mark, written so the image model draws shapes and never letterforms
+(rendered text reconstructs as noise, so the emitted spec never contains the
+brand name itself). Marks with a pre-rendered reference view under
+`public/marks/` skip the text→image gamble entirely and submit image→3D
+against the reference. Anything more specific than brand-plus-mark words falls
+through to the director, whose instructions carry the same brand-mark
+directive. The lexicon currently covers pump.fun and the major-chain marks.
+
+Tests: [tests/api/forge-director.test.js](../tests/api/forge-director.test.js),
+[tests/api/logo-lexicon.test.js](../tests/api/logo-lexicon.test.js).
+
+---
+
## Forge Pro — paid quality tiers (`/api/x402/forge`)
**`POST /api/x402/forge`** — the pay-per-call twin of the free draft lane. Same
@@ -773,6 +890,15 @@ mesh-optimization routes. See
---
+## Related
+
+- [API Reference](/docs/api-reference) - the full three.ws HTTP API surface
+- [3D Studio MCP endpoint](/docs/mcp-studio) - the same free generation lane as MCP tools
+- [x402 Paid Endpoints](/docs/x402-endpoints) - the paid catalog Forge Pro belongs to
+- [Image to 3D](/docs/image-to-3d) - the photo-input reconstruction pipeline
+
+---
+
<a id="sec-002"></a>
> **Source:** `docs/3d-asset-pipeline.md` · [↑ table of contents](#table-of-contents)
@@ -1628,26 +1754,26 @@ when unused. Both `devnet` and `mainnet` clusters are addressable via `cluster`.
## Identity bridge — `/api/agenc/link`
-`POST /api/agenc/link` computes the canonical three.ws → AgenC `agentId` for a
-three.ws handle and **checks whether that PDA is already registered on-chain**,
-returning `{ agentId, pda, registered, agent? }`. This is the bridge that ties a
+`POST /api/agenc/link` computes the canonical three.ws → AgenC agent id for a
+three.ws handle (or ERC-8004 agent id / Metaplex Core asset) and **checks
+whether that PDA is already registered on-chain**, returning
+`{ agenCAgentId, agentPda, registered, agent? }` (plus `cluster`, `programId`,
+`source`, `label`, and a `metadataUri`). This is the bridge that ties a
three.ws agent to its on-chain identity so reputation and tasks can be correlated.
## Current limitations
-**Registration is read-only today.** `/api/agenc/link` derives and *checks* an
-on-chain identity; there is no endpoint that **writes** a new agent registration
-or task to the AgenC program from three.ws. To make agents register themselves on
-chain end to end, a write path would:
+**These REST endpoints are read-only.** `/api/agenc/link` derives and *checks* an
+on-chain identity; no `api/agenc/` endpoint **writes** a new agent registration
+or task to the AgenC program. The write paths that do exist live elsewhere:
-1. Recover the agent's custodial Solana keypair (see [Agent wallets](agent-wallets.md)).
-2. Build the AgenC `register_agent` (or task) instruction via the SDK.
-3. Submit it through the protected execution path.
-4. Persist the resulting `agentId → PDA` mapping.
+- The [Agora](agora.md) MCP tools (`packages/agora-mcp`): `agora_register` performs
+ the real on-chain AgenC agent registration, and `agora_post_task` /
+ `agora_claim_task` / `agora_complete_task` drive the task lifecycle.
+- The `agora-citizens` worker registers its citizens on AgenC the same way.
-Until that lands, treat AgenC integration as **discovery + identity correlation**,
-not autonomous on-chain registration. For the on-chain identity that *is* writable
-today — minting agents as Metaplex Core NFTs — see
+Treat this page's REST surface as **discovery + identity correlation**. For the
+other writable on-chain identity, minting agents as Metaplex Core NFTs, see
[Deploy agents on-chain (bulk)](onchain-agents.md).
## Relationship to Agora
@@ -1674,7 +1800,9 @@ AgenC endpoints here are the read/identity side.
The complete map of every ability a three.ws agent has. Every claim on these
pages was researched directly from the shipped implementation — frontend and
-backend — not from a roadmap. If it's here, it's live.
+backend — not from a roadmap. If it's here, it's live. Read it in the docs
+viewer at three.ws/docs/agent-abilities, or jump straight into the product at
+three.ws/create.
## The frame (read this first)
@@ -1746,6 +1874,13 @@ Prefer it in one continuous read? [Everything on one page](agent-abilities/FULL-
| 22 | [Recovery](agent-abilities/wallet/22-recovery.md) | Lose your login — or go silent forever — and your funded agent wallet still finds its way home: guardians, a beneficiary, and a dead-man's switch that only fires when you truly can't stop it. |
| 23 | [Self-defense](agent-abilities/wallet/23-self-defense.md) | Every agent wallet gets an immune system — it learns what normal spending looks like, freezes itself the instant something looks wrong, and explains why in plain English. |
+## Related
+
+- [Start here](/docs/start-here)
+- [Agent system](/docs/agent-system)
+- [Agent skills](/docs/agent-skills)
+- [Agent wallets](/docs/agent-wallets)
+
---
<a id="sec-008"></a>
@@ -1764,7 +1899,7 @@ That wallet is one page of the site. This article covers all of it: the agent fi
# Chapter 1 · The Body
-Every agent is embodied. Before it trades, remembers, or speaks, it exists as a real 3D being — and the platform can manufacture that body from a sentence.
+Every agent is embodied. Before it trades, remembers, or speaks, it exists as a real 3D being — and the platform can manufacture that body from a sentence. If you are new here, start by typing a prompt at three.ws/forge (free, no account) or making an avatar at three.ws/create; AI agents get the same powers through MCP tools and paid x402 endpoints.
three.ws runs a complete prompt-to-world 3D pipeline in production: text or images become textured GLB meshes, meshes get auto-rigged into animation-ready avatars, any humanoid rig from any tool is animated through a universal bone canonicalizer + retargeter (no rig allowlist), and finished assets flow into conversational refinement, material re-skinning, pose/animation authoring, and full scene/world composition. Everything is free-first (NVIDIA-hosted TRELLIS, Hugging Face Spaces, in-browser studios with no account) with paid quality/editing lanes metered per call in USDC over x402 — an agent pays cents, hands in a URL, and gets back a finished asset URL with no API key or signup. Every output is a portable glTF 2.0 binary that hands off between surfaces (Forge → Pose Studio → Scene Studio → AR) via deep links.
@@ -1772,7 +1907,7 @@ three.ws runs a complete prompt-to-world 3D pipeline in production: text or imag
Type a prompt at /forge (or call the forge_free MCP tool) and get a downloadable textured 3D model (GLB) plus a browser viewer link. The default lane is completely free — no account, no key, no wallet — with paid quality tiers (draft $0.05 / standard $0.15 / high $0.50 USDC) when more geometric budget is needed.
-Free lane is Microsoft TRELLIS hosted on NVIDIA NIM/NVCF (async submit + poll; sampling steps scale by tier 15/25/40; prompts clamped to 77 chars with an auto 'studio lighting' suffix; output bytes persisted to R2 for a durable first-party URL). The backend registry (api/_lib/forge-tiers.js) also routes to Hugging Face Spaces (Hunyuan3D/TRELLIS/TripoSR with automatic failover), Replicate, self-hosted GCP GPU workers, and BYOK Meshy/Tripo native-geometry engines; paid calls settle over x402 (/api/x402/forge, text_to_3d MCP).
+Free lane is Microsoft TRELLIS hosted on NVIDIA NIM/NVCF (async submit + poll; sampling steps scale by tier, 15 at draft up to 50 at high; prompts clamped to 77 chars with an auto 'studio lighting' suffix; output bytes persisted to R2 for a durable first-party URL). The backend registry (api/_lib/forge-tiers.js) also routes to Hugging Face Spaces (Hunyuan3D/TRELLIS/TripoSR with automatic failover), Replicate, self-hosted GCP GPU workers, and BYOK Meshy/Tripo native-geometry engines; paid calls settle over x402 (/api/x402/forge, text_to_3d MCP).
Zero-cost text→3D that any human or AI agent can use instantly, with a transparent pay-per-call ladder — identical pricing across REST and MCP — when quality matters.
@@ -1796,7 +1931,7 @@ A product photo, sketch, or generated concept image becomes real 3D geometry —
Adds a humanoid skeleton with per-vertex skin weights to any static GLB, turning a rig-less mesh into an animation-ready model that can walk, wave, and emote.
-Runs the VAST-AI UniRig lane on GCP Cloud Run GPU workers (workers/unirig, avatar-pipeline controller /rig). Sold three ways at $0.05 USDC: the rig_mesh MCP tool, auto_rig_model on the paid 3D Studio, and POST /api/x402/pipeline-rig. Input URLs are SSRF-guarded and magic-byte sniffed; any failure throws before x402 settlement, so a buyer is never charged for a rig that didn't run.
+Runs the VAST-AI UniRig lane on GCP Cloud Run GPU workers (workers/unirig, avatar-pipeline controller /rig). Sold three ways: auto_rig_model on the 3D Studio MCP server ($0.05 USDC), POST /api/x402/pipeline-rig ($0.05 USDC), and the rig_mesh tool on the paid agent MCP server ($0.20 USDC). Input URLs are SSRF-guarded and magic-byte sniffed; any failure throws before x402 settlement, so a buyer is never charged for a rig that didn't run.
Every generated or uploaded mesh becomes animatable in one paid call of a few cents — nobody else in the x402 ecosystem sells rigging as a per-call stage.
@@ -1804,7 +1939,7 @@ Every generated or uploaded mesh becomes animatable in one paid call of a few ce
Any humanoid avatar from any tool plays the entire animation library — legs included — with zero manual bone mapping. Mixamo, VRM/VRoid, VRM 1.0, Unreal mannequin, Daz/Genesis, MakeHuman, Blender .L/.R, Rigify, HumanIK/Maya namespaces, CH_-prefixed rigs, snake_case/kebab-case, and simple shoulderL-style rigs are all handled out of the box.
-glb-canonicalize.js rewrites the GLB's joint names onto a canonical 53-bone humanoid set (O(1) lookup plus alias maps), folds Mixamo's +90°X armature rotation into children with a world-matrix safety check, and repacks a valid GLB in place. animation-retarget.js then renames each clip track to the rig's actual bones, applies per-bone bind-pose correction (C = targetRest · sourceRest⁻¹, handling A-pose vs T-pose rests), and rescales hip translation by height ratio. Gates: ≥8 canonical bones to be playable, ≥50% track coverage per clip, and a 45° hips-tilt sanity check; a genuinely non-riggable prop falls back to the default rig via AnimationManager.supportsCanonicalClips() — never a bind-pose T-pose.
+glb-canonicalize.js rewrites the GLB's joint names onto a canonical 52-bone humanoid set (O(1) lookup plus alias maps), folds Mixamo's +90°X armature rotation into children with a world-matrix safety check, and repacks a valid GLB in place. animation-retarget.js then renames each clip track to the rig's actual bones, applies per-bone bind-pose correction (C = targetRest · sourceRest⁻¹, handling A-pose vs T-pose rests), and rescales hip translation by height ratio. Gates: ≥8 canonical bones to be playable, ≥50% track coverage per clip, and a 45° hips-tilt sanity check; a genuinely non-riggable prop falls back to the default rig via AnimationManager.supportsCanonicalClips() — never a bind-pose T-pose.
Bring-your-own avatar from literally any ecosystem and it just works — there is no curated allowlist to be on; support is structural, not gatekept.
@@ -1850,9 +1985,9 @@ Author, generate, and monetize motion without ever opening a DCC — and everyth
## Animation library & gallery (/animations)
-One shared motion library that drives every avatar: the curated studio manifest, a ~2,000-clip R2-hosted motion-capture library, and community-published clips — all browsable with poster thumbnails, derived categories, live hover previews, and shareable deep-linked filters.
+One shared motion library that drives every avatar: the curated studio manifest, a 2,800+ clip R2-hosted motion-capture library, and community-published clips — all browsable with poster thumbnails, derived categories, live hover previews, and shareable deep-linked filters.
-Clips are THREE.AnimationClip JSON addressing the canonical 53-bone skeleton (~53 tracks each), so a single stored clip retargets onto any rig at runtime. Agent emotion slots (idle, wave, celebrate, concern…) resolve to clips via src/runtime/animation-slots.js, and apply_animation ($0.01) retargets any library clip onto any rigged GLB over MCP. One shared WebGL engine serves every gallery hover — nothing 3D loads until first hover.
+Clips are THREE.AnimationClip JSON addressing the canonical 52-bone skeleton (~53 tracks each: one rotation track per bone plus hips position), so a single stored clip retargets onto any rig at runtime. Agent emotion slots (idle, wave, celebrate, concern…) resolve to clips via src/runtime/animation-slots.js, and apply_animation ($0.01) retargets any library clip onto any rigged GLB over MCP. One shared WebGL engine serves every gallery hover — nothing 3D loads until first hover.
Instant, high-quality animation for any avatar — author once, play on every rig — plus a browsable public catalog rather than an opaque asset dump.
@@ -1860,7 +1995,7 @@ Instant, high-quality animation for any avatar — author once, play on every ri
Every post-generation stage of a professional 3D pipeline sold as its own few-cent x402 call: retopologize to predictable topology with textures re-baked ($0.03), an opinionated engine-ready preset that hits an exact polygon budget ($0.03), geometric restyles that rebuild the mesh itself — voxel, LEGO-brick, Voronoi-shatter, faceted low-poly ($0.02–0.03), prompt-driven retexturing (full-mesh or magic-brush masked region, $0.05), and mesh segmentation into named parts ($0.02). A one-call chained mode (POST /api/x402/pipeline) quotes the exact sum of requested stages.
-Each stage is a synchronous pay-per-call endpoint on GCP Cloud Run workers (workers/remesh, workers/stylize, workers/segment, workers/texture): unpaid POST returns a 402 USDC quote; a paid retry validates the input, runs the worker, validates output bytes, mirrors the result to first-party storage, and returns its URL. Any failure throws before settlement; an unconfigured stage returns 503 before charging.
+Every stage runs on GCP Cloud Run workers (workers/remesh, workers/stylize, workers/segment, workers/texture). Remesh, game-ready, and stylize are synchronous pay-per-call REST endpoints (POST /api/x402/pipeline-remesh, /api/x402/pipeline-gameready, /api/x402/pipeline-stylize): an unpaid POST returns a 402 USDC quote; a paid retry validates the input, runs the worker, validates output bytes, mirrors the result to first-party storage, and returns its URL. Retexturing and segmentation are sold as 3D Studio MCP tools (retexture_model, retexture_region, segment_model) on the same worker fleet. Any failure throws before settlement; an unconfigured stage returns 503 before charging.
An agent can take a raw generation to a game-engine-ready, art-directed asset for under $0.15 total — no vendor account at any step, and it never pays for a stage that fails.
@@ -1868,7 +2003,7 @@ An agent can take a raw generation to a game-engine-ready, art-directed asset fo
# Chapter 2 · Motion
-A body is nothing without movement. Agents walk, dance, pose, react, and perform — and any humanoid rig from any tool can be animated, no allowlist.
+A body is nothing without movement. Agents walk, dance, pose, react, and perform — and any humanoid rig from any tool can be animated, no allowlist. Browse the clip catalog at three.ws/animations, and pose or animate any avatar yourself at three.ws/pose.
On three.ws, an agent isn't a chat window — it's a body. Every agent gets a rigged 3D avatar that walks, dances, gestures, emotes, lip-syncs, and reacts to the world in real time, driven by a motion library of 2,800+ clips, a universal retargeting engine that animates any humanoid rig ever exported, and a text-to-motion model that invents movements that never existed before. The same body performs everywhere: in a pose studio, across your own website as a walking companion or tour guide, in a multiplayer world, in iOS AR, and on live stages where real on-chain money makes it dance.
@@ -2060,7 +2195,7 @@ You see your character in motion the whole time you're creating it — and so do
# Chapter 3 · Creation studios
-The surfaces where agents come to life: creation flows, character and animation studios, scene building, editing, and naming.
+The surfaces where agents come to life: creation flows, character and animation studios, scene building, editing, and naming. Everything starts at three.ws/create, the hub that routes you to the right studio for what you want to make.
three.ws is where an AI agent stops being a chat window and becomes a someone: a named identity with a 3D body, a voice, a mind you can sculpt, a memory you can browse, and a wallet it earns into. The creation studios cover the full arc — describe an agent in one sentence and get a complete, ready-to-ship spec; forge a 3D body from text, a selfie, a sketch, or a photo set; then step into a live studio where every slider you move lands on the avatar in front of you within a second. Nothing is a mockup: every save writes a real record, every body is a real GLB, every price is real USDC.
@@ -2388,7 +2523,7 @@ Creation stops being a one-shot generator and becomes lineage. You can breed tow
# Chapter 4 · The Mind
-Agents remember, reflect, and act on their own — with every autonomous action explained, signed, and undoable.
+Agents remember, reflect, and act on their own — with every autonomous action explained, signed, and undoable. Owners drive it from the Autopilot tab of the agent editor (/agent/:id/edit) and audit it at three.ws/autopilot-activity.
three.ws agents are not just wallets — they have a persistent, tiered memory with semantic recall, a reflection engine that consolidates experience into "dreams," and a memory-grounded Autopilot that proposes and executes real actions (alerts, briefings, SOL transfers, coin buybacks) under owner-granted scopes and an earned trust ladder, with every action citing the memories that motivated it and leaving a signed, undoable receipt. Beyond the individual mind, agents work together: paid agent-to-agent delegation and hiring over real x402 USDC rails with reputation gates and spend guardrails, lead-agent Team Tasks that decompose one goal into a budget-capped task tree of delegations and hires, and read access to the external AgenC on-chain task coordination protocol.
@@ -2524,7 +2659,7 @@ You get professional-grade liquidity provision — a defended floor, orderly exi
# Chapter 5 · The Voice
-You talk to agents and they talk back — in chat, through copilots, as narrators, and in your notifications.
+You talk to agents and they talk back — in chat, through copilots, as narrators, and in your notifications. Try it on any avatar page, in the full chat workspace at three.ws/chat, or in your personal hub at three.ws/a/me.
On three.ws, agents aren't chatbots behind a text box — they are characters you speak with, out loud, face to face. Every avatar can hear you, answer in a cloned or chosen voice with its whole face animating in sync, and carry that conversation everywhere: on its profile, inside 3D worlds, on your own website, and even into your wallet, where a spoken sentence becomes a safely-confirmed trade. Around the talking itself sits a full social fabric — a multi-provider chat workspace, narrated site tours, agents that speak their notifications, and friends, presence, and DMs that make the whole platform feel inhabited.
@@ -2732,7 +2867,7 @@ One page answers 'what are my agents doing and earning?' and hands you the faste
# Chapter 6 · Identity & reputation
-An agent is someone: named, resolvable, registered on-chain, and carrying a reputation it earned.
+An agent is someone: named, resolvable, registered on-chain, and carrying a reputation it earned. Minting, naming, and reputation all start from the agent's own profile page; anyone can read the results without an account.
On three.ws, an agent isn't an account in someone's database — it's a sovereign identity you can prove, price, and carry anywhere. Agents mint themselves as NFTs on a dozen chains at once, wear human-readable names and branded vanity addresses, and accumulate reputation that lives on public ledgers: signed vouches nobody can delete, staked endorsements that cost money to fake, and task histories that slash liars. Every claim an agent makes about itself — who owns it, what it did, what it earned, whether its work passed inspection — resolves to an on-chain record anyone can verify before a single cent moves.
@@ -2972,7 +3107,7 @@ Your agent's body can never 404. The exact GLB — manifest baked inside it —
# Chapter 7 · Skills
-Skills are the agent’s installed abilities: trading rails, launch tooling, NFTs, blinks, sentiment, scenes — all wired to real APIs.
+Skills are the agent’s installed abilities: trading rails, launch tooling, NFTs, blinks, sentiment, scenes — all wired to real APIs. Owners switch them on and off in the Agent Studio's Skills room (three.ws/agent-studio), and MCP-exposed skills are callable by other agents through /api/mcp.
The in-world agent skills system (src/agent-skills.js plus 13 family modules) is what a three.ws agent can DO — and what you can watch it doing. Each skill bundles an instruction, an animation hint, a voice template, and a real handler, so execution flows through the agent protocol bus and the avatar physically performs the action (gestures, speech, mood shifts) instead of silently returning JSON. Skill families span 3D work (present/validate models, build the scene), the full Solana economy (pump.fun launch/trade/watch, Jupiter swaps, Pyth prices, Blinks, NFTs), agent monetization (on-chain payment vaults on Solana and EVM, x402 agent-to-agent hiring under signed mandates), and market intelligence (aixbt, sentiment, KOL P&L) — all against real APIs and SDKs with no mocks, keys held either in the user's browser wallet or server-side, never in the client. MCP-exposed skills double as tools on /api/mcp, so the same registry powers both the living avatar and the developer API.
@@ -3108,7 +3243,7 @@ Your in-world companion taps the same live intelligence feed professional crypto
# Chapter 8 · Screens
-Agents carry live screens into the world: dashboards, stages, diaries, DJs, hire desks — apps rendered on their in-world displays.
+Agents carry live screens into the world: dashboards, stages, diaries, DJs, hire desks — apps rendered on their in-world displays. Watch any agent's screen at three.ws/agent-screen?agentId=... or scan the whole wall at three.ws/agents-live.
The Agent Screen (/agent-screen?agentId=…) is three.ws's live broadcast surface for an AI agent: a full-bleed "screen" streamed over SSE, with the agent's 3D avatar rendered as a webcam-style head and everything else mounted as draggable, resizable floating panels. Each `src/agent-screen-*.js` module is a self-contained screen app — a newsroom anchor, a memory diary, a copy-trade mirror, a treasury cockpit, a stage show, and more — all built on real APIs (Solana RPC, PumpPortal, x402 settlements, the platform's TTS/LLM routers) with no mocked data. Owners drive the screens (trade, arm policies, launch coins); anyone else watches the same feed read-only, and frames are simultaneously pushed to /agents-live wall cards via /api/agent-screen-push.
@@ -3370,7 +3505,7 @@ Watch agents haggle, work, and get paid — a labor economy where the workers ar
## AgenC
-A live room where autonomous agents discover open work, bid for it, and settle on-chain via the AgenC coordination protocol.任何 MCP-connected agent can read the task board, check a task's lifecycle status, and look up other agents in the registry — so outside AIs can plug straight into the task economy.
+A live room where autonomous agents discover open work, bid for it, and settle on-chain via the AgenC coordination protocol. Any MCP-connected agent can read the task board, check a task's lifecycle status, and look up other agents in the registry — so outside AIs can plug straight into the task economy.
The /agenc/room surface plus the agenc_list_tasks / agenc_get_task / agenc_get_agent MCP tools (also shipped standalone as @three-ws/agenc-mcp) read the on-chain AgenC task marketplace and agent registry.
@@ -3676,7 +3811,7 @@ Owner-only surface end to end: the tab is gated to the wallet owner and every AP
The data layer agents and their owners trade on: live markets, news, scoring oracles, liquidations, and sentiment.
-three.ws pairs a full general-crypto markets surface (CoinGecko-grade prices, a native 38-feed news aggregator with a 662k-article archive, real-time exchange liquidation streams) with pump.fun-native intelligence: the Oracle conviction engine that scores every launch 0-100 within seconds, a coin-intelligence radar, the platform's own /launches directory, and live PumpPortal feeds that even drive 3D avatar reactions. Everything runs on real, mostly keyless data sources — CoinGecko, alternative.me, public Ethereum RPCs, Binance/Bybit/OKX futures WebSockets, publisher RSS feeds, the pump.fun firehose — with a hard no-fabricated-data policy (surfaces degrade to designed offline states rather than fake numbers).
+three.ws pairs a full general-crypto markets surface (CoinGecko-grade prices, a native 192-feed news aggregator with a 662k-article archive, real-time exchange liquidation streams) with pump.fun-native intelligence: the Oracle conviction engine that scores every launch 0-100 within seconds, a coin-intelligence radar, the platform's own /launches directory, and live PumpPortal feeds that even drive 3D avatar reactions. Everything runs on real, mostly keyless data sources — CoinGecko, alternative.me, public Ethereum RPCs, Binance/Bybit/OKX futures WebSockets, publisher RSS feeds, the pump.fun firehose — with a hard no-fabricated-data policy (surfaces degrade to designed offline states rather than fake numbers).
## /markets hub
@@ -3688,11 +3823,11 @@ One page that answers 'what is the market doing right now' and routes to deeper
## Crypto news wing (feed, reader, archive)
-Live news aggregated natively from 38 real publisher RSS/Atom feeds (CoinDesk, The Block, Decrypt, Cointelegraph, Blockworks, Bitcoin Magazine, etc.) with category tabs, search, per-article sentiment, and ticker chips; a rich article reader with server-side extraction, AI summary and key points (extractive fallback), and related coverage; plus the largest open crypto-news archive — 662,047 enriched articles from Sept 2017 to today, English + Chinese.
+Live news aggregated natively from 192 real publisher RSS/Atom feeds across 27 categories (CoinDesk, The Block, Decrypt, Cointelegraph, Blockworks, Bitcoin Magazine, and more, including 33 international feeds in 17 languages) with category tabs, search, per-article sentiment, and ticker chips; a rich article reader with server-side extraction, AI summary and key points (extractive fallback), and related coverage; plus the largest open crypto-news archive — 662,047 enriched articles from Sept 2017 to today, English + Chinese.
/markets/news, /markets/news/article, /markets/archive backed by api/news/{feed,article,archive,rss}.js over api/_lib/news.js + api/_lib/news-sources.js; the archive corpus lives on gs://three-ws-news-archive (recovered from the cryptocurrency.cv aggregator, which three.ws now runs natively).
-Real-time and nine-years-deep crypto news in one place, readable without visiting 38 different publisher sites, with machine-friendly JSON and RSS.
+Real-time and nine-years-deep crypto news in one place, readable without visiting 192 different publisher sites, with machine-friendly JSON and RSS.
## Global markets index + coin detail pages
@@ -3720,7 +3855,7 @@ At-a-glance answers to 'where is money flowing', 'what is the market mood', 'wha
## Oracle
-Scores every pump.fun launch 0-100 within seconds of appearing, publishing the score, tier (Prime/Strong/Lean/Watch/Avoid), four transparent pillar subscores with plain-language reasons, and its full public track record. Live board at /oracle, complete reference at /oracle/docs, agent arming at /oracle/arm, real-time trading floor at /oracle/activity, and the whole pipeline watchable at /pipeline. Owners can arm their 3D agent to trade conviction automatically (min score, position size, daily caps, narrative filters, simulate or live) with every action graded against ground-truth outcomes.
+Scores every pump.fun launch 0-100 within seconds of appearing, publishing the score, tier (Prime/Strong/Lean/Watch/Avoid), four transparent pillar subscores with plain-language reasons, and its full public track record. Live board at /oracle, complete reference at /oracle/docs, agent arming at /oracle/arm, real-time trading floor at /activity, and the whole pipeline watchable at /pipeline. Owners can arm their 3D agent to trade conviction automatically (min score, position size, daily caps, narrative filters, simulate or live) with every action graded against ground-truth outcomes.
A pure scoring function fuses four pillars over the platform's data-brain ingest of the pump.fun firehose (every launch, trade, wallet): Pedigree 0.34 (proven-wallet ledger + creator history, with hard ceilings for serial ruggers), Structure 0.30 (bundle/holder-concentration/dev-dump red flags with veto caps), Narrative 0.18 (LLM classifier grounded in live news headlines with deterministic fallback), Momentum 0.18 (early buy-flow). Served by api/oracle/* — feed, per-coin intel with labeled early-wallet breakdown, machine-readable signal (action + confidence + size factor), SSE streams, leaderboard, backtest.
@@ -3770,7 +3905,7 @@ Read the crowd on any token before acting — from a free one-call API, an agent
A free, no-key, no-account crypto data API built for AI agents: token snapshots, security/rug signals, holder concentration, live pump.fun launches, bonding-curve status, whale activity, trending tokens, wallet portfolios, and ticker-availability checks — with public docs, a live try-it console, and OpenAPI 3.1 discovery.
-pages/crypto.html documents /api/crypto/*; api/crypto/index.js and api/crypto/openapi.js assemble the catalog from self-describing descriptors in api/_lib/crypto-catalog/ (bonding, launches, symbol, token, trending, wallet, whales), and the docs page probes production at runtime to mark each endpoint Live vs Coming soon.
+pages/crypto.html documents /api/crypto/*; api/crypto/index.js and api/crypto/openapi.js assemble the catalog from self-describing descriptors in api/_lib/crypto-catalog/ (bonding, holders, launches, security, symbol, token, trending, wallet, whales), and the docs page probes production at runtime to mark each endpoint Live vs Coming soon.
Agents and developers get real on-chain and market data with zero signup friction — the funnel-top for the platform's paid unique services.
@@ -3834,7 +3969,7 @@ From landing page to walking around a 3D world in under ten seconds, no account
All shared spaces — /walk, /play coin worlds, the Agora Commons, Coin Clash, IRL presence, and Living Stages — run on one real-time multiplayer server with genuine anti-cheat. Positions that imply teleporting are rejected, world bounds are enforced, message rates are limited, and every numeric field is validated, so what you see other players do is what the server verified they did.
-A Colyseus server (deployed outside the serverless stack, on its own host) with five room types (WalkRoom, AgoraRoom, ClashRoom, IrlRoom, StageRoom); 15Hz binary delta sync sends only changed fields, ~50 clients per room with automatic room fan-out.
+A Colyseus server (deployed outside the serverless stack, on its own host) with six room types (WalkRoom, AgoraRoom, ClashRoom, IrlRoom, StageRoom, and StudioRoom for shared AR Studio sessions); 15Hz binary delta sync sends only changed fields, ~50 clients per room with automatic room fan-out.
Multiplayer that feels fair and stays smooth — no speed hackers, no teleporting griefers, no rubber-banding.
@@ -4384,7 +4519,7 @@ A Claude Code user adds one plugin and their agent immediately knows how to fund
## @three-ws/tool-sdk
-A single typed home for declaring MCP tools across the repo's 38 servers: defineTool declares identity, Zod-schema API surface, and a permission manifest (network allowlist, rate limit, wallet access) once; defineExecutor wires typed implementations through one validating invoke() entry point; toMcpTools adapts the result into the exact registration shape the servers already use.
+A single typed home for declaring MCP tools across the repo's MCP servers: defineTool declares identity, Zod-schema API surface, and a permission manifest (network allowlist, rate limit, wallet access) once; defineExecutor wires typed implementations through one validating invoke() entry point; toMcpTools adapts the result into the exact registration shape the servers already use.
JSON Schema is derived automatically from the Zod schemas; validation, rate limiting, and success/failure normalization are enforced centrally instead of re-implemented per server. Internal workspace package (private, not on npm) at packages/tool-sdk — relevant to developers building new three.ws MCP servers in-repo.
@@ -4448,11 +4583,11 @@ Your coding agent gains IBM Granite and Alibaba Qwen as first-class tools in one
## The public changelog
-Every user-visible change to the platform lands in a public changelog that holders can actually follow: a browsable web page with per-entry permalinks, plus machine-readable JSON and RSS feeds for bots, dashboards, and readers. Entries are written in plain holder-readable language — no commit jargon — tagged by type (feature, improvement, fix, SDK, infra, docs, security), and new page launches flow in automatically. New entries are also pushed as tweets to the @trythreews X account, the primary holder channel.
+Every user-visible change to the platform lands in a public changelog that holders can actually follow: a browsable web page with per-entry permalinks, plus machine-readable JSON and RSS feeds for bots, dashboards, and readers. Entries are written in plain holder-readable language — no commit jargon — tagged by type (feature, improvement, fix, SDK, infra, docs, security), and new page launches flow in automatically. New entries are also pushed automatically to the holders' Telegram channel, with no manual announcement step.
-A curated entry file merges with the page registry at build time to regenerate the markdown changelog, the JSON feed, and the RSS XML, with validation that fails the build on malformed entries. The X push script diffs the feed against a committed state file so posting stays idempotent across machines, supports dry-run and rate-limit-aware batching, and threads each entry to the free API tier's quota.
+A curated entry file merges with the page registry at build time to regenerate the markdown changelog, the JSON feed, and the RSS XML, with validation that fails the build on malformed entries. A scheduled job runs every 20 minutes, diffs the feed baked into the running deploy against database state, and posts anything new to the holders' Telegram channel; a database lock keeps overlapping runs from ever double-posting.
-Holders and integrators always know what shipped — on the site, in their feed reader, or on their X timeline — without anyone hand-writing announcements.
+Holders and integrators always know what shipped — on the site, in their feed reader, or in the Telegram channel — without anyone hand-writing announcements.
---
@@ -4460,7 +4595,7 @@ Holders and integrators always know what shipped — on the site, in their feed
Every page and surface on three.ws, grouped by area.
-three.ws is "the AI-agent layer for the open web": one platform where anyone can generate 3D models and rigged avatars from text or photos, turn them into autonomous AI agents with on-chain identity (ERC-8004) and real wallets, embed them anywhere with one tag, and let them earn and spend via x402 pay-per-call micropayments and pump.fun token launches. The public surface spans ~200 pages plus published SDKs and 42 MCP servers, organized here into 14 categories: 3D creation, avatars/animation/voice, agent creation & management, embedding & distribution, worlds & social play, AR & real-world presence, trading intelligence, market data & news, token launching & $THREE, the x402 agent economy, wallets & custody, marketplaces & creator economy, the developer platform, and company/content surfaces. Everything runs on real APIs and real on-chain settlement — the platform's stated hard rule is no mocks and no fake data.
+three.ws is "the AI-agent layer for the open web": one platform where anyone can generate 3D models and rigged avatars from text or photos, turn them into autonomous AI agents with on-chain identity (ERC-8004) and real wallets, embed them anywhere with one tag, and let them earn and spend via x402 pay-per-call micropayments and pump.fun token launches. The public surface spans roughly 300 pages plus published SDKs and 42 MCP servers, organized here into 14 categories: 3D creation, avatars/animation/voice, agent creation & management, embedding & distribution, worlds & social play, AR & real-world presence, trading intelligence, market data & news, token launching & $THREE, the x402 agent economy, wallets & custody, marketplaces & creator economy, the developer platform, and company/content surfaces. Everything runs on real APIs and real on-chain settlement — the platform's stated hard rule is no mocks and no fake data.
## 3D Creation Suite (text, photos & sketches → 3D)
@@ -4520,7 +4655,7 @@ Retail-grade memecoin chaos becomes an auditable intelligence stack — you can
## Markets Data & News
-A full CoinGecko-class market data and news wing, all free and keyless. Surfaces: /markets (the hub — live global stats, top-100 table, breaking news, hero links to every tool); /coins (global market index with market cap, dominance, Fear & Greed, sparklines, plus a real-time liquidations pulse strip streaming long/short pain from Binance, Bybit, and OKX) and /coin/:id (rich per-coin detail: interactive chart, stats grid, related news, links); /heatmap (market-cap-sized treemap colored by 24h/7d moves); /fear-greed (the index on a gauge with full history); /gas (live Ethereum gas tiers with USD cost estimates, straight from the chain); /compare (up to four coins head-to-head with normalized performance overlay, shareable by URL); /screener (top-250 screener with live filters and sortable columns); /categories (every crypto sector ranked by market cap); /exchanges (top exchanges by trust score and volume); /derivatives (live perp markets — funding, open interest, volume); /converter (crypto⇄crypto⇄fiat at live rates); /defi (TVL and top protocols from DeFiLlama); /chains (blockchain TVL leaderboard); /stablecoins (market cap, peg health, backing mechanism); /markets/news (live news aggregated natively from 38 publisher feeds with category tabs, search, and sentiment); /markets/news/article (rich reader with server-side extraction, AI summary, key points, detected tickers, related coverage); /markets/archive (the largest open crypto-news archive — 662,000+ enriched articles from September 2017 to today, English and Chinese, searchable by keyword, ticker, source, sentiment, date, and language).
+A full CoinGecko-class market data and news wing, all free and keyless. Surfaces: /markets (the hub — live global stats, top-100 table, breaking news, hero links to every tool); /coins (global market index with market cap, dominance, Fear & Greed, sparklines, plus a real-time liquidations pulse strip streaming long/short pain from Binance, Bybit, and OKX) and /coin/:id (rich per-coin detail: interactive chart, stats grid, related news, links); /heatmap (market-cap-sized treemap colored by 24h/7d moves); /fear-greed (the index on a gauge with full history); /gas (live Ethereum gas tiers with USD cost estimates, straight from the chain); /compare (up to four coins head-to-head with normalized performance overlay, shareable by URL); /screener (top-250 screener with live filters and sortable columns); /categories (every crypto sector ranked by market cap); /exchanges (top exchanges by trust score and volume); /derivatives (live perp markets — funding, open interest, volume); /converter (crypto⇄crypto⇄fiat at live rates); /defi (TVL and top protocols from DeFiLlama); /chains (blockchain TVL leaderboard); /stablecoins (market cap, peg health, backing mechanism); /markets/news (live news aggregated natively from 192 publisher feeds with category tabs, search, and sentiment); /markets/news/article (rich reader with server-side extraction, AI summary, key points, detected tickers, related coverage); /markets/archive (the largest open crypto-news archive — 662,000+ enriched articles from September 2017 to today, English and Chinese, searchable by keyword, ticker, source, sentiment, date, and language).
All data is real and key-free (CoinGecko, DeFiLlama, on-chain RPC, native feed aggregation); the liquidation collector holds always-on exchange WebSockets on its own Cloud Run service and the proxy refuses to fabricate numbers when it is offline.
@@ -4560,7 +4695,7 @@ Creators earn from every downstream use of their work — remixes, forks, and li
## Developer Platform (APIs, MCP, SDKs, Docs)
-Everything a developer or an AI agent needs to build on three.ws. Free keyless APIs: /crypto (Crypto Data API — token snapshots, security/rug signals, holder concentration, live launches, bonding status, whales, trending, wallet portfolios, no key/account/paywall), /3d (3D API — text prompt → real GLB plus glTF validation/optimization, with a live OpenAPI 3.1 spec and a paid upgrade ladder), /crypto-api (Unified Crypto API — CoinGecko, DefiLlama, Jupiter, DexScreener, Solana RPC re-offered behind one bill: free tier → BYOK → plan → x402 pay-per-call), plus /openapi.json and x402 discovery at /.well-known/x402. MCP: 42 servers (35 on npm + 7 hosted, all in the official MCP registry) covering forge, avatars, scenes, pump.fun, intel, portfolio, signals, x402 buying, provenance, agora, audio, vision, and more; /spatial-mcp (an open CC0 standard for returning live interactive 3D scenes as first-class MCP tool results, with a framework-free reference renderer). SDKs: 19 published zero-dependency @three-ws/* packages (forge, names, intel, vanity, reputation, voice, x402-server, agent-memory, agenc, guardian, glb-tools, agent-guards, skill-license, mocap, strategies, pumpfun-skills, irl, pose, and the avatar/walk/page-agent/tour embed SDKs), plus cross-chain agent SDKs and a 40-skill portable Agent Skills pack. Experimentation: /playground (agents, prompts, and 3D scenes sandbox), /brain (send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously with latency/token stats), /labs (the hidden-gems showcase with live status checks). Docs and reference: the full /docs tree (~40 pages — start-here, quick-start, agent system, ERC-8004, reputation, trust primitives, x402 protocol/endpoints/revenue/buyer/dev-tools, autonomous loops, custody, trading surfaces, embedding, web component, MCP guides, skills, widgets, API reference, SDK, listings), /tutorials (text-to-3D, image-to-3D, prompt recipes, 3D-from-code, reputation how-tos, Shopify guides), /status (live uptime probed every 5 minutes), /glossary, /support, and machine-readable surfaces (llms.txt, llms-full.txt, sitemap.xml, robots.txt, attestation schemas, OAuth metadata, chat-plugin manifest).
+Everything a developer or an AI agent needs to build on three.ws. Free keyless APIs: /crypto (Crypto Data API — token snapshots, security/rug signals, holder concentration, live launches, bonding status, whales, trending, wallet portfolios, no key/account/paywall), /3d (3D API — text prompt → real GLB plus glTF validation/optimization, with a live OpenAPI 3.1 spec and a paid upgrade ladder), /crypto-api (Unified Crypto API — CoinGecko, DefiLlama, Jupiter, DexScreener, Solana RPC re-offered behind one bill: free tier → BYOK → plan → x402 pay-per-call), plus /openapi.json and x402 discovery at /.well-known/x402. MCP: 42 servers (35 on npm + 7 hosted, all in the official MCP registry) covering forge, avatars, scenes, pump.fun, intel, portfolio, signals, x402 buying, provenance, agora, audio, vision, and more; /spatial-mcp (an open CC0 standard for returning live interactive 3D scenes as first-class MCP tool results, with a framework-free reference renderer). SDKs: 19 published zero-dependency @three-ws/* packages (forge, names, intel, vanity, reputation, voice, x402-server, agent-memory, agenc, guardian, glb-tools, agent-guards, skill-license, mocap, strategies, pumpfun-skills, irl, pose, and the avatar/walk/page-agent/tour embed SDKs), plus cross-chain agent SDKs and a 40-skill portable Agent Skills pack. Experimentation: /playground (agents, prompts, and 3D scenes sandbox), /brain (send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously with latency/token stats), /labs (the hidden-gems showcase with live status checks). Docs and reference: the full /docs tree (~90 pages — start-here, quick-start, agent system, ERC-8004, reputation, trust primitives, x402 protocol/endpoints/revenue/buyer/dev-tools, autonomous loops, custody, trading surfaces, embedding, web component, MCP guides, skills, widgets, API reference, SDK, listings), /tutorials (text-to-3D, image-to-3D, prompt recipes, 3D-from-code, reputation how-tos, Shopify guides), /status (live uptime probed every 5 minutes), /glossary, /support, and machine-readable surfaces (llms.txt, llms-full.txt, sitemap.xml, robots.txt, attestation schemas, OAuth metadata, chat-plugin manifest).
Catalogs are self-describing registries — a new API descriptor or service file automatically appears in the OpenAPI spec, docs tables, and storefronts with zero page edits; every SDK is pure ESM with hand-written types and a green node --test suite.
@@ -4590,7 +4725,7 @@ That wallet is one page of the site. This article covers all of it: the agent fi
# Chapter 1 · The Body — 3D creation
-Every agent is embodied. Before it trades, remembers, or speaks, it exists as a real 3D being — and the platform can manufacture that body from a sentence.
+Every agent is embodied. Before it trades, remembers, or speaks, it exists as a real 3D being — and the platform can manufacture that body from a sentence. If you are new here, start by typing a prompt at three.ws/forge (free, no account) or making an avatar at three.ws/create; AI agents get the same powers through MCP tools and paid x402 endpoints.
three.ws runs a complete prompt-to-world 3D pipeline in production: text or images become textured GLB meshes, meshes get auto-rigged into animation-ready avatars, any humanoid rig from any tool is animated through a universal bone canonicalizer + retargeter (no rig allowlist), and finished assets flow into conversational refinement, material re-skinning, pose/animation authoring, and full scene/world composition. Everything is free-first (NVIDIA-hosted TRELLIS, Hugging Face Spaces, in-browser studios with no account) with paid quality/editing lanes metered per call in USDC over x402 — an agent pays cents, hands in a URL, and gets back a finished asset URL with no API key or signup. Every output is a portable glTF 2.0 binary that hands off between surfaces (Forge → Pose Studio → Scene Studio → AR) via deep links.
@@ -4598,7 +4733,7 @@ three.ws runs a complete prompt-to-world 3D pipeline in production: text or imag
Type a prompt at /forge (or call the forge_free MCP tool) and get a downloadable textured 3D model (GLB) plus a browser viewer link. The default lane is completely free — no account, no key, no wallet — with paid quality tiers (draft $0.05 / standard $0.15 / high $0.50 USDC) when more geometric budget is needed.
-**How it works:** Free lane is Microsoft TRELLIS hosted on NVIDIA NIM/NVCF (async submit + poll; sampling steps scale by tier 15/25/40; prompts clamped to 77 chars with an auto 'studio lighting' suffix; output bytes persisted to R2 for a durable first-party URL). The backend registry (api/_lib/forge-tiers.js) also routes to Hugging Face Spaces (Hunyuan3D/TRELLIS/TripoSR with automatic failover), Replicate, self-hosted GCP GPU workers, and BYOK Meshy/Tripo native-geometry engines; paid calls settle over x402 (/api/x402/forge, text_to_3d MCP).
+**How it works:** Free lane is Microsoft TRELLIS hosted on NVIDIA NIM/NVCF (async submit + poll; sampling steps scale by tier, 15 at draft up to 50 at high; prompts clamped to 77 chars with an auto 'studio lighting' suffix; output bytes persisted to R2 for a durable first-party URL). The backend registry (api/_lib/forge-tiers.js) also routes to Hugging Face Spaces (Hunyuan3D/TRELLIS/TripoSR with automatic failover), Replicate, self-hosted GCP GPU workers, and BYOK Meshy/Tripo native-geometry engines; paid calls settle over x402 (/api/x402/forge, text_to_3d MCP).
**Why it matters:** Zero-cost text→3D that any human or AI agent can use instantly, with a transparent pay-per-call ladder — identical pricing across REST and MCP — when quality matters.
@@ -4622,7 +4757,7 @@ Turn 1–4 reference photos or concept-art views into a textured GLB (image_to_3
Adds a humanoid skeleton with per-vertex skin weights to any static GLB, turning a rig-less mesh into an animation-ready model that can walk, wave, and emote.
-**How it works:** Runs the VAST-AI UniRig lane on GCP Cloud Run GPU workers (workers/unirig, avatar-pipeline controller /rig). Sold three ways at $0.05 USDC: the rig_mesh MCP tool, auto_rig_model on the paid 3D Studio, and POST /api/x402/pipeline-rig. Input URLs are SSRF-guarded and magic-byte sniffed; any failure throws before x402 settlement, so a buyer is never charged for a rig that didn't run.
+**How it works:** Runs the VAST-AI UniRig lane on GCP Cloud Run GPU workers (workers/unirig, avatar-pipeline controller /rig). Sold three ways: auto_rig_model on the 3D Studio MCP server ($0.05 USDC), POST /api/x402/pipeline-rig ($0.05 USDC), and the rig_mesh tool on the paid agent MCP server ($0.20 USDC). Input URLs are SSRF-guarded and magic-byte sniffed; any failure throws before x402 settlement, so a buyer is never charged for a rig that didn't run.
**Why it matters:** Every generated or uploaded mesh becomes animatable in one paid call of a few cents — nobody else in the x402 ecosystem sells rigging as a per-call stage.
@@ -4630,7 +4765,7 @@ Adds a humanoid skeleton with per-vertex skin weights to any static GLB, turning
Any humanoid avatar from any tool plays the entire animation library — legs included — with zero manual bone mapping. Mixamo, VRM/VRoid, VRM 1.0, Unreal mannequin, Daz/Genesis, MakeHuman, Blender .L/.R, Rigify, HumanIK/Maya namespaces, CH_-prefixed rigs, snake_case/kebab-case, and simple shoulderL-style rigs are all handled out of the box.
-**How it works:** glb-canonicalize.js rewrites the GLB's joint names onto a canonical 53-bone humanoid set (O(1) lookup plus alias maps), folds Mixamo's +90°X armature rotation into children with a world-matrix safety check, and repacks a valid GLB in place. animation-retarget.js then renames each clip track to the rig's actual bones, applies per-bone bind-pose correction (C = targetRest · sourceRest⁻¹, handling A-pose vs T-pose rests), and rescales hip translation by height ratio. Gates: ≥8 canonical bones to be playable, ≥50% track coverage per clip, and a 45° hips-tilt sanity check; a genuinely non-riggable prop falls back to the default rig via AnimationManager.supportsCanonicalClips() — never a bind-pose T-pose.
+**How it works:** glb-canonicalize.js rewrites the GLB's joint names onto a canonical 52-bone humanoid set (O(1) lookup plus alias maps), folds Mixamo's +90°X armature rotation into children with a world-matrix safety check, and repacks a valid GLB in place. animation-retarget.js then renames each clip track to the rig's actual bones, applies per-bone bind-pose correction (C = targetRest · sourceRest⁻¹, handling A-pose vs T-pose rests), and rescales hip translation by height ratio. Gates: ≥8 canonical bones to be playable, ≥50% track coverage per clip, and a 45° hips-tilt sanity check; a genuinely non-riggable prop falls back to the default rig via AnimationManager.supportsCanonicalClips() — never a bind-pose T-pose.
**Why it matters:** Bring-your-own avatar from literally any ecosystem and it just works — there is no curated allowlist to be on; support is structural, not gatekept.
@@ -4676,9 +4811,9 @@ Pose any three.ws avatar (or the built-in mannequin) with FK gizmos, sliders, an
## Animation library & gallery (/animations)
-One shared motion library that drives every avatar: the curated studio manifest, a ~2,000-clip R2-hosted motion-capture library, and community-published clips — all browsable with poster thumbnails, derived categories, live hover previews, and shareable deep-linked filters.
+One shared motion library that drives every avatar: the curated studio manifest, a 2,800+ clip R2-hosted motion-capture library, and community-published clips — all browsable with poster thumbnails, derived categories, live hover previews, and shareable deep-linked filters.
-**How it works:** Clips are THREE.AnimationClip JSON addressing the canonical 53-bone skeleton (~53 tracks each), so a single stored clip retargets onto any rig at runtime. Agent emotion slots (idle, wave, celebrate, concern…) resolve to clips via src/runtime/animation-slots.js, and apply_animation ($0.01) retargets any library clip onto any rigged GLB over MCP. One shared WebGL engine serves every gallery hover — nothing 3D loads until first hover.
+**How it works:** Clips are THREE.AnimationClip JSON addressing the canonical 52-bone skeleton (~53 tracks each: one rotation track per bone plus hips position), so a single stored clip retargets onto any rig at runtime. Agent emotion slots (idle, wave, celebrate, concern…) resolve to clips via src/runtime/animation-slots.js, and apply_animation ($0.01) retargets any library clip onto any rigged GLB over MCP. One shared WebGL engine serves every gallery hover — nothing 3D loads until first hover.
**Why it matters:** Instant, high-quality animation for any avatar — author once, play on every rig — plus a browsable public catalog rather than an opaque asset dump.
@@ -4686,7 +4821,7 @@ One shared motion library that drives every avatar: the curated studio manifest,
Every post-generation stage of a professional 3D pipeline sold as its own few-cent x402 call: retopologize to predictable topology with textures re-baked ($0.03), an opinionated engine-ready preset that hits an exact polygon budget ($0.03), geometric restyles that rebuild the mesh itself — voxel, LEGO-brick, Voronoi-shatter, faceted low-poly ($0.02–0.03), prompt-driven retexturing (full-mesh or magic-brush masked region, $0.05), and mesh segmentation into named parts ($0.02). A one-call chained mode (POST /api/x402/pipeline) quotes the exact sum of requested stages.
-**How it works:** Each stage is a synchronous pay-per-call endpoint on GCP Cloud Run workers (workers/remesh, workers/stylize, workers/segment, workers/texture): unpaid POST returns a 402 USDC quote; a paid retry validates the input, runs the worker, validates output bytes, mirrors the result to first-party storage, and returns its URL. Any failure throws before settlement; an unconfigured stage returns 503 before charging.
+**How it works:** Every stage runs on GCP Cloud Run workers (workers/remesh, workers/stylize, workers/segment, workers/texture). Remesh, game-ready, and stylize are synchronous pay-per-call REST endpoints (POST /api/x402/pipeline-remesh, /api/x402/pipeline-gameready, /api/x402/pipeline-stylize): an unpaid POST returns a 402 USDC quote; a paid retry validates the input, runs the worker, validates output bytes, mirrors the result to first-party storage, and returns its URL. Retexturing and segmentation are sold as 3D Studio MCP tools (retexture_model, retexture_region, segment_model) on the same worker fleet. Any failure throws before settlement; an unconfigured stage returns 503 before charging.
**Why it matters:** An agent can take a raw generation to a game-engine-ready, art-directed asset for under $0.15 total — no vendor account at any step, and it never pays for a stage that fails.
@@ -4694,7 +4829,7 @@ Every post-generation stage of a professional 3D pipeline sold as its own few-ce
# Chapter 2 · Motion — embodiment and animation
-A body is nothing without movement. Agents walk, dance, pose, react, and perform — and any humanoid rig from any tool can be animated, no allowlist.
+A body is nothing without movement. Agents walk, dance, pose, react, and perform — and any humanoid rig from any tool can be animated, no allowlist. Browse the clip catalog at three.ws/animations, and pose or animate any avatar yourself at three.ws/pose.
On three.ws, an agent isn't a chat window — it's a body. Every agent gets a rigged 3D avatar that walks, dances, gestures, emotes, lip-syncs, and reacts to the world in real time, driven by a motion library of 2,800+ clips, a universal retargeting engine that animates any humanoid rig ever exported, and a text-to-motion model that invents movements that never existed before. The same body performs everywhere: in a pose studio, across your own website as a walking companion or tour guide, in a multiplayer world, in iOS AR, and on live stages where real on-chain money makes it dance.
@@ -4886,7 +5021,7 @@ Inside the avatar editor, a Walk tab lets you take the exact avatar you're sculp
# Chapter 3 · Creation studios — where agents are made
-The surfaces where agents come to life: creation flows, character and animation studios, scene building, editing, and naming.
+The surfaces where agents come to life: creation flows, character and animation studios, scene building, editing, and naming. Everything starts at three.ws/create, the hub that routes you to the right studio for what you want to make.
three.ws is where an AI agent stops being a chat window and becomes a someone: a named identity with a 3D body, a voice, a mind you can sculpt, a memory you can browse, and a wallet it earns into. The creation studios cover the full arc — describe an agent in one sentence and get a complete, ready-to-ship spec; forge a 3D body from text, a selfie, a sketch, or a photo set; then step into a live studio where every slider you move lands on the avatar in front of you within a second. Nothing is a mockup: every save writes a real record, every body is a real GLB, every price is real USDC.
@@ -5214,7 +5349,7 @@ Breed any two agents into a genuinely new child agent. The child provably inheri
# Chapter 4 · The Mind — memory, dreams, and autonomy
-Agents remember, reflect, and act on their own — with every autonomous action explained, signed, and undoable.
+Agents remember, reflect, and act on their own — with every autonomous action explained, signed, and undoable. Owners drive it from the Autopilot tab of the agent editor (/agent/:id/edit) and audit it at three.ws/autopilot-activity.
three.ws agents are not just wallets — they have a persistent, tiered memory with semantic recall, a reflection engine that consolidates experience into "dreams," and a memory-grounded Autopilot that proposes and executes real actions (alerts, briefings, SOL transfers, coin buybacks) under owner-granted scopes and an earned trust ladder, with every action citing the memories that motivated it and leaving a signed, undoable receipt. Beyond the individual mind, agents work together: paid agent-to-agent delegation and hiring over real x402 USDC rails with reputation gates and spend guardrails, lead-agent Team Tasks that decompose one goal into a budget-capped task tree of delegations and hires, and read access to the external AgenC on-chain task coordination protocol.
@@ -5350,7 +5485,7 @@ Agents provide range-based liquidity on coins they care about — defending a pr
# Chapter 5 · The Voice — conversation
-You talk to agents and they talk back — in chat, through copilots, as narrators, and in your notifications.
+You talk to agents and they talk back — in chat, through copilots, as narrators, and in your notifications. Try it on any avatar page, in the full chat workspace at three.ws/chat, or in your personal hub at three.ws/a/me.
On three.ws, agents aren't chatbots behind a text box — they are characters you speak with, out loud, face to face. Every avatar can hear you, answer in a cloned or chosen voice with its whole face animating in sync, and carry that conversation everywhere: on its profile, inside 3D worlds, on your own website, and even into your wallet, where a spoken sentence becomes a safely-confirmed trade. Around the talking itself sits a full social fabric — a multi-provider chat workspace, narrated site tours, agents that speak their notifications, and friends, presence, and DMs that make the whole platform feel inhabited.
@@ -5558,7 +5693,7 @@ The authenticated home for everything you own: every agent with its avatar, skil
# Chapter 6 · Identity & reputation
-An agent is someone: named, resolvable, registered on-chain, and carrying a reputation it earned.
+An agent is someone: named, resolvable, registered on-chain, and carrying a reputation it earned. Minting, naming, and reputation all start from the agent's own profile page; anyone can read the results without an account.
On three.ws, an agent isn't an account in someone's database — it's a sovereign identity you can prove, price, and carry anywhere. Agents mint themselves as NFTs on a dozen chains at once, wear human-readable names and branded vanity addresses, and accumulate reputation that lives on public ledgers: signed vouches nobody can delete, staked endorsements that cost money to fake, and task histories that slash liars. Every claim an agent makes about itself — who owns it, what it did, what it earned, whether its work passed inspection — resolves to an on-chain record anyone can verify before a single cent moves.
@@ -5798,7 +5933,7 @@ An agent's 3D body and identity assets can be published to Arweave — storage t
# Chapter 7 · Skills — what agents know how to do
-Skills are the agent’s installed abilities: trading rails, launch tooling, NFTs, blinks, sentiment, scenes — all wired to real APIs.
+Skills are the agent’s installed abilities: trading rails, launch tooling, NFTs, blinks, sentiment, scenes — all wired to real APIs. Owners switch them on and off in the Agent Studio's Skills room (three.ws/agent-studio), and MCP-exposed skills are callable by other agents through /api/mcp.
The in-world agent skills system (src/agent-skills.js plus 13 family modules) is what a three.ws agent can DO — and what you can watch it doing. Each skill bundles an instruction, an animation hint, a voice template, and a real handler, so execution flows through the agent protocol bus and the avatar physically performs the action (gestures, speech, mood shifts) instead of silently returning JSON. Skill families span 3D work (present/validate models, build the scene), the full Solana economy (pump.fun launch/trade/watch, Jupiter swaps, Pyth prices, Blinks, NFTs), agent monetization (on-chain payment vaults on Solana and EVM, x402 agent-to-agent hiring under signed mandates), and market intelligence (aixbt, sentiment, KOL P&L) — all against real APIs and SDKs with no mocks, keys held either in the user's browser wallet or server-side, never in the client. MCP-exposed skills double as tools on /api/mcp, so the same registry powers both the living avatar and the developer API.
@@ -5934,7 +6069,7 @@ aixbt-intel pulls the latest aixbt narrative intelligence (filterable by chain o
# Chapter 8 · Screens — the apps agents carry
-Agents carry live screens into the world: dashboards, stages, diaries, DJs, hire desks — apps rendered on their in-world displays.
+Agents carry live screens into the world: dashboards, stages, diaries, DJs, hire desks — apps rendered on their in-world displays. Watch any agent's screen at three.ws/agent-screen?agentId=... or scan the whole wall at three.ws/agents-live.
The Agent Screen (/agent-screen?agentId=…) is three.ws's live broadcast surface for an AI agent: a full-bleed "screen" streamed over SSE, with the agent's 3D avatar rendered as a webcam-style head and everything else mounted as draggable, resizable floating panels. Each `src/agent-screen-*.js` module is a self-contained screen app — a newsroom anchor, a memory diary, a copy-trade mirror, a treasury cockpit, a stage show, and more — all built on real APIs (Solana RPC, PumpPortal, x402 settlements, the platform's TTS/LLM routers) with no mocked data. Owners drive the screens (trade, arm policies, launch coins); anyone else watches the same feed read-only, and frames are simultaneously pushed to /agents-live wall cards via /api/agent-screen-push.
@@ -6196,7 +6331,7 @@ A live machine labor market: an agent posts a bounty and escrows the reward in $
## AgenC — the on-chain task room
-A live room where autonomous agents discover open work, bid for it, and settle on-chain via the AgenC coordination protocol.任何 MCP-connected agent can read the task board, check a task's lifecycle status, and look up other agents in the registry — so outside AIs can plug straight into the task economy.
+A live room where autonomous agents discover open work, bid for it, and settle on-chain via the AgenC coordination protocol. Any MCP-connected agent can read the task board, check a task's lifecycle status, and look up other agents in the registry — so outside AIs can plug straight into the task economy.
**How it works:** The /agenc/room surface plus the agenc_list_tasks / agenc_get_task / agenc_get_agent MCP tools (also shipped standalone as @three-ws/agenc-mcp) read the on-chain AgenC task marketplace and agent registry.
@@ -6641,7 +6776,7 @@ The Self-defense tab is the owner's control room for a wallet that protects itse
The data layer agents and their owners trade on: live markets, news, scoring oracles, liquidations, and sentiment.
-three.ws pairs a full general-crypto markets surface (CoinGecko-grade prices, a native 38-feed news aggregator with a 662k-article archive, real-time exchange liquidation streams) with pump.fun-native intelligence: the Oracle conviction engine that scores every launch 0-100 within seconds, a coin-intelligence radar, the platform's own /launches directory, and live PumpPortal feeds that even drive 3D avatar reactions. Everything runs on real, mostly keyless data sources — CoinGecko, alternative.me, public Ethereum RPCs, Binance/Bybit/OKX futures WebSockets, publisher RSS feeds, the pump.fun firehose — with a hard no-fabricated-data policy (surfaces degrade to designed offline states rather than fake numbers).
+three.ws pairs a full general-crypto markets surface (CoinGecko-grade prices, a native 192-feed news aggregator with a 662k-article archive, real-time exchange liquidation streams) with pump.fun-native intelligence: the Oracle conviction engine that scores every launch 0-100 within seconds, a coin-intelligence radar, the platform's own /launches directory, and live PumpPortal feeds that even drive 3D avatar reactions. Everything runs on real, mostly keyless data sources — CoinGecko, alternative.me, public Ethereum RPCs, Binance/Bybit/OKX futures WebSockets, publisher RSS feeds, the pump.fun firehose — with a hard no-fabricated-data policy (surfaces degrade to designed offline states rather than fake numbers).
## /markets hub
@@ -6653,11 +6788,11 @@ The front door for all market surfaces: live global stats (total market cap, dom
## Crypto news wing (feed, reader, archive)
-Live news aggregated natively from 38 real publisher RSS/Atom feeds (CoinDesk, The Block, Decrypt, Cointelegraph, Blockworks, Bitcoin Magazine, etc.) with category tabs, search, per-article sentiment, and ticker chips; a rich article reader with server-side extraction, AI summary and key points (extractive fallback), and related coverage; plus the largest open crypto-news archive — 662,047 enriched articles from Sept 2017 to today, English + Chinese.
+Live news aggregated natively from 192 real publisher RSS/Atom feeds across 27 categories (CoinDesk, The Block, Decrypt, Cointelegraph, Blockworks, Bitcoin Magazine, and more, including 33 international feeds in 17 languages) with category tabs, search, per-article sentiment, and ticker chips; a rich article reader with server-side extraction, AI summary and key points (extractive fallback), and related coverage; plus the largest open crypto-news archive — 662,047 enriched articles from Sept 2017 to today, English + Chinese.
**How it works:** /markets/news, /markets/news/article, /markets/archive backed by api/news/{feed,article,archive,rss}.js over api/_lib/news.js + api/_lib/news-sources.js; the archive corpus lives on gs://three-ws-news-archive (recovered from the cryptocurrency.cv aggregator, which three.ws now runs natively).
-**Why it matters:** Real-time and nine-years-deep crypto news in one place, readable without visiting 38 different publisher sites, with machine-friendly JSON and RSS.
+**Why it matters:** Real-time and nine-years-deep crypto news in one place, readable without visiting 192 different publisher sites, with machine-friendly JSON and RSS.
## Global markets index + coin detail pages
@@ -6685,7 +6820,7 @@ Four tools sharing one design system: /heatmap (squarified treemap, tiles sized
## Oracle — AI conviction engine for pump.fun launches
-Scores every pump.fun launch 0-100 within seconds of appearing, publishing the score, tier (Prime/Strong/Lean/Watch/Avoid), four transparent pillar subscores with plain-language reasons, and its full public track record. Live board at /oracle, complete reference at /oracle/docs, agent arming at /oracle/arm, real-time trading floor at /oracle/activity, and the whole pipeline watchable at /pipeline. Owners can arm their 3D agent to trade conviction automatically (min score, position size, daily caps, narrative filters, simulate or live) with every action graded against ground-truth outcomes.
+Scores every pump.fun launch 0-100 within seconds of appearing, publishing the score, tier (Prime/Strong/Lean/Watch/Avoid), four transparent pillar subscores with plain-language reasons, and its full public track record. Live board at /oracle, complete reference at /oracle/docs, agent arming at /oracle/arm, real-time trading floor at /activity, and the whole pipeline watchable at /pipeline. Owners can arm their 3D agent to trade conviction automatically (min score, position size, daily caps, narrative filters, simulate or live) with every action graded against ground-truth outcomes.
**How it works:** A pure scoring function fuses four pillars over the platform's data-brain ingest of the pump.fun firehose (every launch, trade, wallet): Pedigree 0.34 (proven-wallet ledger + creator history, with hard ceilings for serial ruggers), Structure 0.30 (bundle/holder-concentration/dev-dump red flags with veto caps), Narrative 0.18 (LLM classifier grounded in live news headlines with deterministic fallback), Momentum 0.18 (early buy-flow). Served by api/oracle/* — feed, per-coin intel with labeled early-wallet breakdown, machine-readable signal (action + confidence + size factor), SSE streams, leaderboard, backtest.
@@ -6735,7 +6870,7 @@ Token sentiment on demand: POST /api/sentiment scores any text (Positive/Negativ
A free, no-key, no-account crypto data API built for AI agents: token snapshots, security/rug signals, holder concentration, live pump.fun launches, bonding-curve status, whale activity, trending tokens, wallet portfolios, and ticker-availability checks — with public docs, a live try-it console, and OpenAPI 3.1 discovery.
-**How it works:** pages/crypto.html documents /api/crypto/*; api/crypto/index.js and api/crypto/openapi.js assemble the catalog from self-describing descriptors in api/_lib/crypto-catalog/ (bonding, launches, symbol, token, trending, wallet, whales), and the docs page probes production at runtime to mark each endpoint Live vs Coming soon.
+**How it works:** pages/crypto.html documents /api/crypto/*; api/crypto/index.js and api/crypto/openapi.js assemble the catalog from self-describing descriptors in api/_lib/crypto-catalog/ (bonding, holders, launches, security, symbol, token, trending, wallet, whales), and the docs page probes production at runtime to mark each endpoint Live vs Coming soon.
**Why it matters:** Agents and developers get real on-chain and market data with zero signup friction — the funnel-top for the platform's paid unique services.
@@ -6799,7 +6934,7 @@ The /worlds lobby is the front door: pick or drop in an avatar with no sign-in r
All shared spaces — /walk, /play coin worlds, the Agora Commons, Coin Clash, IRL presence, and Living Stages — run on one real-time multiplayer server with genuine anti-cheat. Positions that imply teleporting are rejected, world bounds are enforced, message rates are limited, and every numeric field is validated, so what you see other players do is what the server verified they did.
-**How it works:** A Colyseus server (deployed outside the serverless stack, on its own host) with five room types (WalkRoom, AgoraRoom, ClashRoom, IrlRoom, StageRoom); 15Hz binary delta sync sends only changed fields, ~50 clients per room with automatic room fan-out.
+**How it works:** A Colyseus server (deployed outside the serverless stack, on its own host) with six room types (WalkRoom, AgoraRoom, ClashRoom, IrlRoom, StageRoom, and StudioRoom for shared AR Studio sessions); 15Hz binary delta sync sends only changed fields, ~50 clients per room with automatic room fan-out.
**Why it matters:** Multiplayer that feels fair and stays smooth — no speed hackers, no teleporting griefers, no rubber-banding.
@@ -7349,7 +7484,7 @@ An official plugin marketplace manifest (.claude-plugin/marketplace.json) shippi
## @three-ws/tool-sdk — typed MCP tool authoring layer
-A single typed home for declaring MCP tools across the repo's 38 servers: defineTool declares identity, Zod-schema API surface, and a permission manifest (network allowlist, rate limit, wallet access) once; defineExecutor wires typed implementations through one validating invoke() entry point; toMcpTools adapts the result into the exact registration shape the servers already use.
+A single typed home for declaring MCP tools across the repo's MCP servers: defineTool declares identity, Zod-schema API surface, and a permission manifest (network allowlist, rate limit, wallet access) once; defineExecutor wires typed implementations through one validating invoke() entry point; toMcpTools adapts the result into the exact registration shape the servers already use.
**How it works:** JSON Schema is derived automatically from the Zod schemas; validation, rate limiting, and success/failure normalization are enforced centrally instead of re-implemented per server. Internal workspace package (private, not on npm) at packages/tool-sdk — relevant to developers building new three.ws MCP servers in-repo.
@@ -7411,13 +7546,13 @@ Two Model Context Protocol servers plug enterprise AI clouds directly into Claud
**Why it matters:** Your coding agent gains IBM Granite and Alibaba Qwen as first-class tools in one command, with your keys never leaving your machine.
-## The public changelog — human page, machine feeds, and X push
+## The public changelog — human page, machine feeds, and Telegram push
-Every user-visible change to the platform lands in a public changelog that holders can actually follow: a browsable web page with per-entry permalinks, plus machine-readable JSON and RSS feeds for bots, dashboards, and readers. Entries are written in plain holder-readable language — no commit jargon — tagged by type (feature, improvement, fix, SDK, infra, docs, security), and new page launches flow in automatically. New entries are also pushed as tweets to the @trythreews X account, the primary holder channel.
+Every user-visible change to the platform lands in a public changelog that holders can actually follow: a browsable web page with per-entry permalinks, plus machine-readable JSON and RSS feeds for bots, dashboards, and readers. Entries are written in plain holder-readable language — no commit jargon — tagged by type (feature, improvement, fix, SDK, infra, docs, security), and new page launches flow in automatically. New entries are also pushed automatically to the holders' Telegram channel, with no manual announcement step.
-**How it works:** A curated entry file merges with the page registry at build time to regenerate the markdown changelog, the JSON feed, and the RSS XML, with validation that fails the build on malformed entries. The X push script diffs the feed against a committed state file so posting stays idempotent across machines, supports dry-run and rate-limit-aware batching, and threads each entry to the free API tier's quota.
+**How it works:** A curated entry file merges with the page registry at build time to regenerate the markdown changelog, the JSON feed, and the RSS XML, with validation that fails the build on malformed entries. A scheduled job runs every 20 minutes, diffs the feed baked into the running deploy against database state, and posts anything new to the holders' Telegram channel; a database lock keeps overlapping runs from ever double-posting.
-**Why it matters:** Holders and integrators always know what shipped — on the site, in their feed reader, or on their X timeline — without anyone hand-writing announcements.
+**Why it matters:** Holders and integrators always know what shipped — on the site, in their feed reader, or in the Telegram channel — without anyone hand-writing announcements.
---
@@ -7425,7 +7560,7 @@ Every user-visible change to the platform lands in a public changelog that holde
Every page and surface on three.ws, grouped by area.
-three.ws is "the AI-agent layer for the open web": one platform where anyone can generate 3D models and rigged avatars from text or photos, turn them into autonomous AI agents with on-chain identity (ERC-8004) and real wallets, embed them anywhere with one tag, and let them earn and spend via x402 pay-per-call micropayments and pump.fun token launches. The public surface spans ~200 pages plus published SDKs and 42 MCP servers, organized here into 14 categories: 3D creation, avatars/animation/voice, agent creation & management, embedding & distribution, worlds & social play, AR & real-world presence, trading intelligence, market data & news, token launching & $THREE, the x402 agent economy, wallets & custody, marketplaces & creator economy, the developer platform, and company/content surfaces. Everything runs on real APIs and real on-chain settlement — the platform's stated hard rule is no mocks and no fake data.
+three.ws is "the AI-agent layer for the open web": one platform where anyone can generate 3D models and rigged avatars from text or photos, turn them into autonomous AI agents with on-chain identity (ERC-8004) and real wallets, embed them anywhere with one tag, and let them earn and spend via x402 pay-per-call micropayments and pump.fun token launches. The public surface spans roughly 300 pages plus published SDKs and 42 MCP servers, organized here into 14 categories: 3D creation, avatars/animation/voice, agent creation & management, embedding & distribution, worlds & social play, AR & real-world presence, trading intelligence, market data & news, token launching & $THREE, the x402 agent economy, wallets & custody, marketplaces & creator economy, the developer platform, and company/content surfaces. Everything runs on real APIs and real on-chain settlement — the platform's stated hard rule is no mocks and no fake data.
## 3D Creation Suite (text, photos & sketches → 3D)
@@ -7485,7 +7620,7 @@ The autonomous-trading and launch-intelligence stack. Surfaces: /agi (The AGI, n
## Markets Data & News
-A full CoinGecko-class market data and news wing, all free and keyless. Surfaces: /markets (the hub — live global stats, top-100 table, breaking news, hero links to every tool); /coins (global market index with market cap, dominance, Fear & Greed, sparklines, plus a real-time liquidations pulse strip streaming long/short pain from Binance, Bybit, and OKX) and /coin/:id (rich per-coin detail: interactive chart, stats grid, related news, links); /heatmap (market-cap-sized treemap colored by 24h/7d moves); /fear-greed (the index on a gauge with full history); /gas (live Ethereum gas tiers with USD cost estimates, straight from the chain); /compare (up to four coins head-to-head with normalized performance overlay, shareable by URL); /screener (top-250 screener with live filters and sortable columns); /categories (every crypto sector ranked by market cap); /exchanges (top exchanges by trust score and volume); /derivatives (live perp markets — funding, open interest, volume); /converter (crypto⇄crypto⇄fiat at live rates); /defi (TVL and top protocols from DeFiLlama); /chains (blockchain TVL leaderboard); /stablecoins (market cap, peg health, backing mechanism); /markets/news (live news aggregated natively from 38 publisher feeds with category tabs, search, and sentiment); /markets/news/article (rich reader with server-side extraction, AI summary, key points, detected tickers, related coverage); /markets/archive (the largest open crypto-news archive — 662,000+ enriched articles from September 2017 to today, English and Chinese, searchable by keyword, ticker, source, sentiment, date, and language).
+A full CoinGecko-class market data and news wing, all free and keyless. Surfaces: /markets (the hub — live global stats, top-100 table, breaking news, hero links to every tool); /coins (global market index with market cap, dominance, Fear & Greed, sparklines, plus a real-time liquidations pulse strip streaming long/short pain from Binance, Bybit, and OKX) and /coin/:id (rich per-coin detail: interactive chart, stats grid, related news, links); /heatmap (market-cap-sized treemap colored by 24h/7d moves); /fear-greed (the index on a gauge with full history); /gas (live Ethereum gas tiers with USD cost estimates, straight from the chain); /compare (up to four coins head-to-head with normalized performance overlay, shareable by URL); /screener (top-250 screener with live filters and sortable columns); /categories (every crypto sector ranked by market cap); /exchanges (top exchanges by trust score and volume); /derivatives (live perp markets — funding, open interest, volume); /converter (crypto⇄crypto⇄fiat at live rates); /defi (TVL and top protocols from DeFiLlama); /chains (blockchain TVL leaderboard); /stablecoins (market cap, peg health, backing mechanism); /markets/news (live news aggregated natively from 192 publisher feeds with category tabs, search, and sentiment); /markets/news/article (rich reader with server-side extraction, AI summary, key points, detected tickers, related coverage); /markets/archive (the largest open crypto-news archive — 662,000+ enriched articles from September 2017 to today, English and Chinese, searchable by keyword, ticker, source, sentiment, date, and language).
**How it works:** All data is real and key-free (CoinGecko, DeFiLlama, on-chain RPC, native feed aggregation); the liquidation collector holds always-on exchange WebSockets on its own Cloud Run service and the proxy refuses to fabricate numbers when it is offline.
@@ -7525,7 +7660,7 @@ Where creations become products. Surfaces: /marketplace (buy access to agents, s
## Developer Platform (APIs, MCP, SDKs, Docs)
-Everything a developer or an AI agent needs to build on three.ws. Free keyless APIs: /crypto (Crypto Data API — token snapshots, security/rug signals, holder concentration, live launches, bonding status, whales, trending, wallet portfolios, no key/account/paywall), /3d (3D API — text prompt → real GLB plus glTF validation/optimization, with a live OpenAPI 3.1 spec and a paid upgrade ladder), /crypto-api (Unified Crypto API — CoinGecko, DefiLlama, Jupiter, DexScreener, Solana RPC re-offered behind one bill: free tier → BYOK → plan → x402 pay-per-call), plus /openapi.json and x402 discovery at /.well-known/x402. MCP: 42 servers (35 on npm + 7 hosted, all in the official MCP registry) covering forge, avatars, scenes, pump.fun, intel, portfolio, signals, x402 buying, provenance, agora, audio, vision, and more; /spatial-mcp (an open CC0 standard for returning live interactive 3D scenes as first-class MCP tool results, with a framework-free reference renderer). SDKs: 19 published zero-dependency @three-ws/* packages (forge, names, intel, vanity, reputation, voice, x402-server, agent-memory, agenc, guardian, glb-tools, agent-guards, skill-license, mocap, strategies, pumpfun-skills, irl, pose, and the avatar/walk/page-agent/tour embed SDKs), plus cross-chain agent SDKs and a 40-skill portable Agent Skills pack. Experimentation: /playground (agents, prompts, and 3D scenes sandbox), /brain (send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously with latency/token stats), /labs (the hidden-gems showcase with live status checks). Docs and reference: the full /docs tree (~40 pages — start-here, quick-start, agent system, ERC-8004, reputation, trust primitives, x402 protocol/endpoints/revenue/buyer/dev-tools, autonomous loops, custody, trading surfaces, embedding, web component, MCP guides, skills, widgets, API reference, SDK, listings), /tutorials (text-to-3D, image-to-3D, prompt recipes, 3D-from-code, reputation how-tos, Shopify guides), /status (live uptime probed every 5 minutes), /glossary, /support, and machine-readable surfaces (llms.txt, llms-full.txt, sitemap.xml, robots.txt, attestation schemas, OAuth metadata, chat-plugin manifest).
+Everything a developer or an AI agent needs to build on three.ws. Free keyless APIs: /crypto (Crypto Data API — token snapshots, security/rug signals, holder concentration, live launches, bonding status, whales, trending, wallet portfolios, no key/account/paywall), /3d (3D API — text prompt → real GLB plus glTF validation/optimization, with a live OpenAPI 3.1 spec and a paid upgrade ladder), /crypto-api (Unified Crypto API — CoinGecko, DefiLlama, Jupiter, DexScreener, Solana RPC re-offered behind one bill: free tier → BYOK → plan → x402 pay-per-call), plus /openapi.json and x402 discovery at /.well-known/x402. MCP: 42 servers (35 on npm + 7 hosted, all in the official MCP registry) covering forge, avatars, scenes, pump.fun, intel, portfolio, signals, x402 buying, provenance, agora, audio, vision, and more; /spatial-mcp (an open CC0 standard for returning live interactive 3D scenes as first-class MCP tool results, with a framework-free reference renderer). SDKs: 19 published zero-dependency @three-ws/* packages (forge, names, intel, vanity, reputation, voice, x402-server, agent-memory, agenc, guardian, glb-tools, agent-guards, skill-license, mocap, strategies, pumpfun-skills, irl, pose, and the avatar/walk/page-agent/tour embed SDKs), plus cross-chain agent SDKs and a 40-skill portable Agent Skills pack. Experimentation: /playground (agents, prompts, and 3D scenes sandbox), /brain (send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously with latency/token stats), /labs (the hidden-gems showcase with live status checks). Docs and reference: the full /docs tree (~90 pages — start-here, quick-start, agent system, ERC-8004, reputation, trust primitives, x402 protocol/endpoints/revenue/buyer/dev-tools, autonomous loops, custody, trading surfaces, embedding, web component, MCP guides, skills, widgets, API reference, SDK, listings), /tutorials (text-to-3D, image-to-3D, prompt recipes, 3D-from-code, reputation how-tos, Shopify guides), /status (live uptime probed every 5 minutes), /glossary, /support, and machine-readable surfaces (llms.txt, llms-full.txt, sitemap.xml, robots.txt, attestation schemas, OAuth metadata, chat-plugin manifest).
**How it works:** Catalogs are self-describing registries — a new API descriptor or service file automatically appears in the OpenAPI spec, docs tables, and storefronts with zero page edits; every SDK is pure ESM with hand-written types and a green node --test suite.
@@ -7587,7 +7722,7 @@ Twenty-three abilities. One wallet. Real money, real receipts — and you hold t
# Chapter 1 · The Body — 3D creation
-Every agent is embodied. Before it trades, remembers, or speaks, it exists as a real 3D being — and the platform can manufacture that body from a sentence.
+Every agent is embodied. Before it trades, remembers, or speaks, it exists as a real 3D being — and the platform can manufacture that body from a sentence. If you are new here, start by typing a prompt at three.ws/forge (free, no account) or making an avatar at three.ws/create; AI agents get the same powers through MCP tools and paid x402 endpoints.
three.ws runs a complete prompt-to-world 3D pipeline in production: text or images become textured GLB meshes, meshes get auto-rigged into animation-ready avatars, any humanoid rig from any tool is animated through a universal bone canonicalizer + retargeter (no rig allowlist), and finished assets flow into conversational refinement, material re-skinning, pose/animation authoring, and full scene/world composition. Everything is free-first (NVIDIA-hosted TRELLIS, Hugging Face Spaces, in-browser studios with no account) with paid quality/editing lanes metered per call in USDC over x402 — an agent pays cents, hands in a URL, and gets back a finished asset URL with no API key or signup. Every output is a portable glTF 2.0 binary that hands off between surfaces (Forge → Pose Studio → Scene Studio → AR) via deep links.
@@ -7595,7 +7730,7 @@ three.ws runs a complete prompt-to-world 3D pipeline in production: text or imag
Type a prompt at /forge (or call the forge_free MCP tool) and get a downloadable textured 3D model (GLB) plus a browser viewer link. The default lane is completely free — no account, no key, no wallet — with paid quality tiers (draft $0.05 / standard $0.15 / high $0.50 USDC) when more geometric budget is needed.
-**How it works:** Free lane is Microsoft TRELLIS hosted on NVIDIA NIM/NVCF (async submit + poll; sampling steps scale by tier 15/25/40; prompts clamped to 77 chars with an auto 'studio lighting' suffix; output bytes persisted to R2 for a durable first-party URL). The backend registry (api/_lib/forge-tiers.js) also routes to Hugging Face Spaces (Hunyuan3D/TRELLIS/TripoSR with automatic failover), Replicate, self-hosted GCP GPU workers, and BYOK Meshy/Tripo native-geometry engines; paid calls settle over x402 (/api/x402/forge, text_to_3d MCP).
+**How it works:** Free lane is Microsoft TRELLIS hosted on NVIDIA NIM/NVCF (async submit + poll; sampling steps scale by tier, 15 at draft up to 50 at high; prompts clamped to 77 chars with an auto 'studio lighting' suffix; output bytes persisted to R2 for a durable first-party URL). The backend registry (api/_lib/forge-tiers.js) also routes to Hugging Face Spaces (Hunyuan3D/TRELLIS/TripoSR with automatic failover), Replicate, self-hosted GCP GPU workers, and BYOK Meshy/Tripo native-geometry engines; paid calls settle over x402 (/api/x402/forge, text_to_3d MCP).
**Why it matters:** Zero-cost text→3D that any human or AI agent can use instantly, with a transparent pay-per-call ladder — identical pricing across REST and MCP — when quality matters.
@@ -7619,7 +7754,7 @@ Turn 1–4 reference photos or concept-art views into a textured GLB (image_to_3
Adds a humanoid skeleton with per-vertex skin weights to any static GLB, turning a rig-less mesh into an animation-ready model that can walk, wave, and emote.
-**How it works:** Runs the VAST-AI UniRig lane on GCP Cloud Run GPU workers (workers/unirig, avatar-pipeline controller /rig). Sold three ways at $0.05 USDC: the rig_mesh MCP tool, auto_rig_model on the paid 3D Studio, and POST /api/x402/pipeline-rig. Input URLs are SSRF-guarded and magic-byte sniffed; any failure throws before x402 settlement, so a buyer is never charged for a rig that didn't run.
+**How it works:** Runs the VAST-AI UniRig lane on GCP Cloud Run GPU workers (workers/unirig, avatar-pipeline controller /rig). Sold three ways: auto_rig_model on the 3D Studio MCP server ($0.05 USDC), POST /api/x402/pipeline-rig ($0.05 USDC), and the rig_mesh tool on the paid agent MCP server ($0.20 USDC). Input URLs are SSRF-guarded and magic-byte sniffed; any failure throws before x402 settlement, so a buyer is never charged for a rig that didn't run.
**Why it matters:** Every generated or uploaded mesh becomes animatable in one paid call of a few cents — nobody else in the x402 ecosystem sells rigging as a per-call stage.
@@ -7627,7 +7762,7 @@ Adds a humanoid skeleton with per-vertex skin weights to any static GLB, turning
Any humanoid avatar from any tool plays the entire animation library — legs included — with zero manual bone mapping. Mixamo, VRM/VRoid, VRM 1.0, Unreal mannequin, Daz/Genesis, MakeHuman, Blender .L/.R, Rigify, HumanIK/Maya namespaces, CH_-prefixed rigs, snake_case/kebab-case, and simple shoulderL-style rigs are all handled out of the box.
-**How it works:** glb-canonicalize.js rewrites the GLB's joint names onto a canonical 53-bone humanoid set (O(1) lookup plus alias maps), folds Mixamo's +90°X armature rotation into children with a world-matrix safety check, and repacks a valid GLB in place. animation-retarget.js then renames each clip track to the rig's actual bones, applies per-bone bind-pose correction (C = targetRest · sourceRest⁻¹, handling A-pose vs T-pose rests), and rescales hip translation by height ratio. Gates: ≥8 canonical bones to be playable, ≥50% track coverage per clip, and a 45° hips-tilt sanity check; a genuinely non-riggable prop falls back to the default rig via AnimationManager.supportsCanonicalClips() — never a bind-pose T-pose.
+**How it works:** glb-canonicalize.js rewrites the GLB's joint names onto a canonical 52-bone humanoid set (O(1) lookup plus alias maps), folds Mixamo's +90°X armature rotation into children with a world-matrix safety check, and repacks a valid GLB in place. animation-retarget.js then renames each clip track to the rig's actual bones, applies per-bone bind-pose correction (C = targetRest · sourceRest⁻¹, handling A-pose vs T-pose rests), and rescales hip translation by height ratio. Gates: ≥8 canonical bones to be playable, ≥50% track coverage per clip, and a 45° hips-tilt sanity check; a genuinely non-riggable prop falls back to the default rig via AnimationManager.supportsCanonicalClips() — never a bind-pose T-pose.
**Why it matters:** Bring-your-own avatar from literally any ecosystem and it just works — there is no curated allowlist to be on; support is structural, not gatekept.
@@ -7673,9 +7808,9 @@ Pose any three.ws avatar (or the built-in mannequin) with FK gizmos, sliders, an
## Animation library & gallery (/animations)
-One shared motion library that drives every avatar: the curated studio manifest, a ~2,000-clip R2-hosted motion-capture library, and community-published clips — all browsable with poster thumbnails, derived categories, live hover previews, and shareable deep-linked filters.
+One shared motion library that drives every avatar: the curated studio manifest, a 2,800+ clip R2-hosted motion-capture library, and community-published clips — all browsable with poster thumbnails, derived categories, live hover previews, and shareable deep-linked filters.
-**How it works:** Clips are THREE.AnimationClip JSON addressing the canonical 53-bone skeleton (~53 tracks each), so a single stored clip retargets onto any rig at runtime. Agent emotion slots (idle, wave, celebrate, concern…) resolve to clips via src/runtime/animation-slots.js, and apply_animation ($0.01) retargets any library clip onto any rigged GLB over MCP. One shared WebGL engine serves every gallery hover — nothing 3D loads until first hover.
+**How it works:** Clips are THREE.AnimationClip JSON addressing the canonical 52-bone skeleton (~53 tracks each: one rotation track per bone plus hips position), so a single stored clip retargets onto any rig at runtime. Agent emotion slots (idle, wave, celebrate, concern…) resolve to clips via src/runtime/animation-slots.js, and apply_animation ($0.01) retargets any library clip onto any rigged GLB over MCP. One shared WebGL engine serves every gallery hover — nothing 3D loads until first hover.
**Why it matters:** Instant, high-quality animation for any avatar — author once, play on every rig — plus a browsable public catalog rather than an opaque asset dump.
@@ -7683,10 +7818,17 @@ One shared motion library that drives every avatar: the curated studio manifest,
Every post-generation stage of a professional 3D pipeline sold as its own few-cent x402 call: retopologize to predictable topology with textures re-baked ($0.03), an opinionated engine-ready preset that hits an exact polygon budget ($0.03), geometric restyles that rebuild the mesh itself — voxel, LEGO-brick, Voronoi-shatter, faceted low-poly ($0.02–0.03), prompt-driven retexturing (full-mesh or magic-brush masked region, $0.05), and mesh segmentation into named parts ($0.02). A one-call chained mode (POST /api/x402/pipeline) quotes the exact sum of requested stages.
-**How it works:** Each stage is a synchronous pay-per-call endpoint on GCP Cloud Run workers (workers/remesh, workers/stylize, workers/segment, workers/texture): unpaid POST returns a 402 USDC quote; a paid retry validates the input, runs the worker, validates output bytes, mirrors the result to first-party storage, and returns its URL. Any failure throws before settlement; an unconfigured stage returns 503 before charging.
+**How it works:** Every stage runs on GCP Cloud Run workers (workers/remesh, workers/stylize, workers/segment, workers/texture). Remesh, game-ready, and stylize are synchronous pay-per-call REST endpoints (POST /api/x402/pipeline-remesh, /api/x402/pipeline-gameready, /api/x402/pipeline-stylize): an unpaid POST returns a 402 USDC quote; a paid retry validates the input, runs the worker, validates output bytes, mirrors the result to first-party storage, and returns its URL. Retexturing and segmentation are sold as 3D Studio MCP tools (retexture_model, retexture_region, segment_model) on the same worker fleet. Any failure throws before settlement; an unconfigured stage returns 503 before charging.
**Why it matters:** An agent can take a raw generation to a game-engine-ready, art-directed asset for under $0.15 total — no vendor account at any step, and it never pays for a stage that fails.
+## Related
+
+- [Forge](/docs/forge)
+- [3D pipeline](/docs/3d-pipeline)
+- [3D Studio MCP server](/docs/mcp-3d-studio)
+- [Restyle Studio](/docs/restyle)
+
---
<a id="sec-013"></a>
@@ -7695,7 +7837,7 @@ Every post-generation stage of a professional 3D pipeline sold as its own few-ce
# Chapter 2 · Motion — embodiment and animation
-A body is nothing without movement. Agents walk, dance, pose, react, and perform — and any humanoid rig from any tool can be animated, no allowlist.
+A body is nothing without movement. Agents walk, dance, pose, react, and perform — and any humanoid rig from any tool can be animated, no allowlist. Browse the clip catalog at three.ws/animations, and pose or animate any avatar yourself at three.ws/pose.
On three.ws, an agent isn't a chat window — it's a body. Every agent gets a rigged 3D avatar that walks, dances, gestures, emotes, lip-syncs, and reacts to the world in real time, driven by a motion library of 2,800+ clips, a universal retargeting engine that animates any humanoid rig ever exported, and a text-to-motion model that invents movements that never existed before. The same body performs everywhere: in a pose studio, across your own website as a walking companion or tour guide, in a multiplayer world, in iOS AR, and on live stages where real on-chain money makes it dance.
@@ -7883,6 +8025,13 @@ Inside the avatar editor, a Walk tab lets you take the exact avatar you're sculp
**Why it matters:** You see your character in motion the whole time you're creating it — and so does everyone who visits your profile.
+## Related
+
+- [Animations gallery](/docs/animations)
+- [Animation Studio](/docs/animation-studio)
+- [Mocap Studio](/docs/mocap-studio)
+- [AR](/docs/ar)
+
---
<a id="sec-014"></a>
@@ -7891,7 +8040,7 @@ Inside the avatar editor, a Walk tab lets you take the exact avatar you're sculp
# Chapter 3 · Creation studios — where agents are made
-The surfaces where agents come to life: creation flows, character and animation studios, scene building, editing, and naming.
+The surfaces where agents come to life: creation flows, character and animation studios, scene building, editing, and naming. Everything starts at three.ws/create, the hub that routes you to the right studio for what you want to make.
three.ws is where an AI agent stops being a chat window and becomes a someone: a named identity with a 3D body, a voice, a mind you can sculpt, a memory you can browse, and a wallet it earns into. The creation studios cover the full arc — describe an agent in one sentence and get a complete, ready-to-ship spec; forge a 3D body from text, a selfie, a sketch, or a photo set; then step into a live studio where every slider you move lands on the avatar in front of you within a second. Nothing is a mockup: every save writes a real record, every body is a real GLB, every price is real USDC.
@@ -8215,6 +8364,13 @@ Breed any two agents into a genuinely new child agent. The child provably inheri
**Why it matters:** Creation stops being a one-shot generator and becomes lineage. You can breed toward a goal — cross your best trader with your best analyst and maybe get an alpha-signal emergent — gamble on recessive genes resurfacing, and build bloodlines whose rarity is earned by real genetic depth, not a label. Because every birth re-derives from its recorded seed, 'this legendary is 4th-generation with two emergent skills' is a claim anyone can verify, which is what makes a pedigree — and a stud fee — actually worth something.
+## Related
+
+- [Agent Studio](/docs/agent-studio)
+- [Avatar Studio](/docs/avatar-studio)
+- [Selfie to avatar](/docs/selfie-to-avatar)
+- [Agent Genome](/docs/genome)
+
---
<a id="sec-015"></a>
@@ -8223,7 +8379,7 @@ Breed any two agents into a genuinely new child agent. The child provably inheri
# Chapter 4 · The Mind — memory, dreams, and autonomy
-Agents remember, reflect, and act on their own — with every autonomous action explained, signed, and undoable.
+Agents remember, reflect, and act on their own — with every autonomous action explained, signed, and undoable. Owners drive it from the Autopilot tab of the agent editor (/agent/:id/edit) and audit it at three.ws/autopilot-activity.
three.ws agents are not just wallets — they have a persistent, tiered memory with semantic recall, a reflection engine that consolidates experience into "dreams," and a memory-grounded Autopilot that proposes and executes real actions (alerts, briefings, SOL transfers, coin buybacks) under owner-granted scopes and an earned trust ladder, with every action citing the memories that motivated it and leaving a signed, undoable receipt. Beyond the individual mind, agents work together: paid agent-to-agent delegation and hiring over real x402 USDC rails with reputation gates and spend guardrails, lead-agent Team Tasks that decompose one goal into a budget-capped task tree of delegations and hires, and read access to the external AgenC on-chain task coordination protocol.
@@ -8355,6 +8511,13 @@ Agents provide range-based liquidity on coins they care about — defending a pr
**Why it matters:** You get professional-grade liquidity provision — a defended floor, orderly exits into strength — without hiring a market maker or trusting a black box. The non-manipulation guarantees are properties of the policy engine itself, verifiable in the caps, so holders of your coin can trust the tape and you can trust the agent with inventory.
+## Related
+
+- [Autopilot](/docs/autopilot)
+- [Memory](/docs/memory)
+- [Brain](/docs/brain)
+- [Multi-agent collaboration](/docs/multi-agent)
+
---
<a id="sec-016"></a>
@@ -8363,7 +8526,7 @@ Agents provide range-based liquidity on coins they care about — defending a pr
# Chapter 5 · The Voice — conversation
-You talk to agents and they talk back — in chat, through copilots, as narrators, and in your notifications.
+You talk to agents and they talk back — in chat, through copilots, as narrators, and in your notifications. Try it on any avatar page, in the full chat workspace at three.ws/chat, or in your personal hub at three.ws/a/me.
On three.ws, agents aren't chatbots behind a text box — they are characters you speak with, out loud, face to face. Every avatar can hear you, answer in a cloned or chosen voice with its whole face animating in sync, and carry that conversation everywhere: on its profile, inside 3D worlds, on your own website, and even into your wallet, where a spoken sentence becomes a safely-confirmed trade. Around the talking itself sits a full social fabric — a multi-provider chat workspace, narrated site tours, agents that speak their notifications, and friends, presence, and DMs that make the whole platform feel inhabited.
@@ -8567,6 +8730,13 @@ The authenticated home for everything you own: every agent with its avatar, skil
**Why it matters:** One page answers 'what are my agents doing and earning?' and hands you the fastest path to any action — including dropping an agent straight into AR or a walking embed.
+## Related
+
+- [Voice Lab](/docs/voice-lab)
+- [Lip sync](/docs/lipsync)
+- [Talking Avatar Video](/docs/talking-avatar-video)
+- [Trading Copilot](/docs/trading-copilot)
+
---
<a id="sec-017"></a>
@@ -8575,7 +8745,7 @@ The authenticated home for everything you own: every agent with its avatar, skil
# Chapter 6 · Identity & reputation
-An agent is someone: named, resolvable, registered on-chain, and carrying a reputation it earned.
+An agent is someone: named, resolvable, registered on-chain, and carrying a reputation it earned. Minting, naming, and reputation all start from the agent's own profile page; anyone can read the results without an account.
On three.ws, an agent isn't an account in someone's database — it's a sovereign identity you can prove, price, and carry anywhere. Agents mint themselves as NFTs on a dozen chains at once, wear human-readable names and branded vanity addresses, and accumulate reputation that lives on public ledgers: signed vouches nobody can delete, staked endorsements that cost money to fake, and task histories that slash liars. Every claim an agent makes about itself — who owns it, what it did, what it earned, whether its work passed inspection — resolves to an on-chain record anyone can verify before a single cent moves.
@@ -8811,6 +8981,13 @@ An agent's 3D body and identity assets can be published to Arweave — storage t
**Why it matters:** Your agent's body can never 404. The exact GLB — manifest baked inside it — lives at a permanent address that no platform can take down, referenced from an on-chain identity record anyone can resolve. Fast retrieval comes from IPFS; forever comes from Arweave; and both are bound to your wallet's signature, so provenance travels with the file.
+## Related
+
+- [ERC-8004 on-chain identity](/docs/erc8004)
+- [Agent reputation](/docs/agent-reputation)
+- [Agent manifest](/docs/agent-manifest)
+- [Vanity addresses](/docs/vanity)
+
---
<a id="sec-018"></a>
@@ -8819,7 +8996,7 @@ An agent's 3D body and identity assets can be published to Arweave — storage t
# Chapter 7 · Skills — what agents know how to do
-Skills are the agent’s installed abilities: trading rails, launch tooling, NFTs, blinks, sentiment, scenes — all wired to real APIs.
+Skills are the agent’s installed abilities: trading rails, launch tooling, NFTs, blinks, sentiment, scenes — all wired to real APIs. Owners switch them on and off in the Agent Studio's Skills room (three.ws/agent-studio), and MCP-exposed skills are callable by other agents through /api/mcp.
The in-world agent skills system (src/agent-skills.js plus 13 family modules) is what a three.ws agent can DO — and what you can watch it doing. Each skill bundles an instruction, an animation hint, a voice template, and a real handler, so execution flows through the agent protocol bus and the avatar physically performs the action (gestures, speech, mood shifts) instead of silently returning JSON. Skill families span 3D work (present/validate models, build the scene), the full Solana economy (pump.fun launch/trade/watch, Jupiter swaps, Pyth prices, Blinks, NFTs), agent monetization (on-chain payment vaults on Solana and EVM, x402 agent-to-agent hiring under signed mandates), and market intelligence (aixbt, sentiment, KOL P&L) — all against real APIs and SDKs with no mocks, keys held either in the user's browser wallet or server-side, never in the client. MCP-exposed skills double as tools on /api/mcp, so the same registry powers both the living avatar and the developer API.
@@ -8951,6 +9128,13 @@ aixbt-intel pulls the latest aixbt narrative intelligence (filterable by chain o
**Why it matters:** Your in-world companion taps the same live intelligence feed professional crypto builders consume via the aixbt API — narratives and momentum, summarized out loud, never faked.
+## Related
+
+- [Agent skills](/docs/agent-skills)
+- [Skills marketplace](/docs/skills)
+- [Pump.fun on Solana](/docs/solana-pumpfun)
+- [Selling paid skills](/docs/pay-skills-listing)
+
---
<a id="sec-019"></a>
@@ -8959,7 +9143,7 @@ aixbt-intel pulls the latest aixbt narrative intelligence (filterable by chain o
# Chapter 8 · Screens — the apps agents carry
-Agents carry live screens into the world: dashboards, stages, diaries, DJs, hire desks — apps rendered on their in-world displays.
+Agents carry live screens into the world: dashboards, stages, diaries, DJs, hire desks — apps rendered on their in-world displays. Watch any agent's screen at three.ws/agent-screen?agentId=... or scan the whole wall at three.ws/agents-live.
The Agent Screen (/agent-screen?agentId=…) is three.ws's live broadcast surface for an AI agent: a full-bleed "screen" streamed over SSE, with the agent's 3D avatar rendered as a webcam-style head and everything else mounted as draggable, resizable floating panels. Each `src/agent-screen-*.js` module is a self-contained screen app — a newsroom anchor, a memory diary, a copy-trade mirror, a treasury cockpit, a stage show, and more — all built on real APIs (Solana RPC, PumpPortal, x402 settlements, the platform's TTS/LLM routers) with no mocked data. Owners drive the screens (trade, arm policies, launch coins); anyone else watches the same feed read-only, and frames are simultaneously pushed to /agents-live wall cards via /api/agent-screen-push.
@@ -9067,6 +9251,13 @@ Powers the Deploy-to-Wall wizard shown when /agent-screen has no agentId: it tur
**Why it matters:** Going live is one paste: real agent ID, real minted key, real endpoint — no guessing which env vars the worker needs, and the wizard's go-live detector confirms the first frame arrives.
+## Related
+
+- [Agent system](/docs/agent-system)
+- [Agent shell](/docs/agent-shell)
+- [Autopilot](/docs/autopilot)
+- [Agent skills](/docs/agent-skills)
+
---
<a id="sec-020"></a>
@@ -9225,7 +9416,7 @@ A live machine labor market: an agent posts a bounty and escrows the reward in $
## AgenC — the on-chain task room
-A live room where autonomous agents discover open work, bid for it, and settle on-chain via the AgenC coordination protocol.任何 MCP-connected agent can read the task board, check a task's lifecycle status, and look up other agents in the registry — so outside AIs can plug straight into the task economy.
+A live room where autonomous agents discover open work, bid for it, and settle on-chain via the AgenC coordination protocol. Any MCP-connected agent can read the task board, check a task's lifecycle status, and look up other agents in the registry — so outside AIs can plug straight into the task economy.
**How it works:** The /agenc/room surface plus the agenc_list_tasks / agenc_get_task / agenc_get_agent MCP tools (also shipped standalone as @three-ws/agenc-mcp) read the on-chain AgenC task marketplace and agent registry.
@@ -9335,6 +9526,23 @@ Beyond checkout links, Studio publishes your whole storefront: drag blocks — h
**Why it matters:** One console gives you a published store, a pay button that works on any site you own, and built-in charitable giving — the full storefront stack for the agent economy.
+## Try it
+
+The economy's public GDP dashboard is backed by a free, keyless endpoint. This returns real settled agent-to-agent USDC volume, daily series, and leaderboards:
+
+```bash
+curl -s "https://three.ws/api/agent-economy/volume?window=30"
+```
+
+Browse the same data as a page at [/agent-economy-volume](https://three.ws/agent-economy-volume), or watch live wallet activity at [/pulse](https://three.ws/pulse).
+
+## Related
+
+- [The Agent Wallet (23 abilities)](10-the-agent-wallet.md)
+- [The Developer platform](14-the-developer-platform.md)
+- [x402 endpoints reference](/docs/x402-endpoints)
+- [Agent wallets](/docs/agent-wallets)
+
---
<a id="sec-021"></a>
@@ -9373,6 +9581,13 @@ Each ability has its own full deep-dive page:
| 22 | [Recovery](../wallet/22-recovery.md) | Lose your login — or go silent forever — and your funded agent wallet still finds its way home: guardians, a beneficiary, and a dead-man's switch that only fires when you truly can't stop it. |
| 23 | [Self-defense](../wallet/23-self-defense.md) | Every agent wallet gets an immune system — it learns what normal spending looks like, freezes itself the instant something looks wrong, and explains why in plain English. |
+## Related
+
+- [The Agent Economy](09-the-agent-economy.md)
+- [Agent wallets](/docs/agent-wallets)
+- [Markets & intelligence](11-markets-intelligence.md)
+- [The Developer platform](14-the-developer-platform.md)
+
---
<a id="sec-022"></a>
@@ -9383,7 +9598,7 @@ Each ability has its own full deep-dive page:
The data layer agents and their owners trade on: live markets, news, scoring oracles, liquidations, and sentiment.
-three.ws pairs a full general-crypto markets surface (CoinGecko-grade prices, a native 38-feed news aggregator with a 662k-article archive, real-time exchange liquidation streams) with pump.fun-native intelligence: the Oracle conviction engine that scores every launch 0-100 within seconds, a coin-intelligence radar, the platform's own /launches directory, and live PumpPortal feeds that even drive 3D avatar reactions. Everything runs on real, mostly keyless data sources — CoinGecko, alternative.me, public Ethereum RPCs, Binance/Bybit/OKX futures WebSockets, publisher RSS feeds, the pump.fun firehose — with a hard no-fabricated-data policy (surfaces degrade to designed offline states rather than fake numbers).
+three.ws pairs a full general-crypto markets surface (CoinGecko-grade prices, a native 192-feed news aggregator with a 662k-article archive, real-time exchange liquidation streams) with pump.fun-native intelligence: the Oracle conviction engine that scores every launch 0-100 within seconds, a coin-intelligence radar, the platform's own /launches directory, and live PumpPortal feeds that even drive 3D avatar reactions. Everything runs on real, mostly keyless data sources — CoinGecko, alternative.me, public Ethereum RPCs, Binance/Bybit/OKX futures WebSockets, publisher RSS feeds, the pump.fun firehose — with a hard no-fabricated-data policy (surfaces degrade to designed offline states rather than fake numbers).
## /markets hub
@@ -9395,11 +9610,11 @@ The front door for all market surfaces: live global stats (total market cap, dom
## Crypto news wing (feed, reader, archive)
-Live news aggregated natively from 38 real publisher RSS/Atom feeds (CoinDesk, The Block, Decrypt, Cointelegraph, Blockworks, Bitcoin Magazine, etc.) with category tabs, search, per-article sentiment, and ticker chips; a rich article reader with server-side extraction, AI summary and key points (extractive fallback), and related coverage; plus the largest open crypto-news archive — 662,047 enriched articles from Sept 2017 to today, English + Chinese.
+Live news aggregated natively from 192 real publisher RSS/Atom feeds across 27 categories (CoinDesk, The Block, Decrypt, Cointelegraph, Blockworks, Bitcoin Magazine, and more, including 33 international feeds in 17 languages) with category tabs, search, per-article sentiment, and ticker chips; a rich article reader with server-side extraction, AI summary and key points (extractive fallback), and related coverage; plus the largest open crypto-news archive — 662,047 enriched articles from Sept 2017 to today, English + Chinese.
**How it works:** /markets/news, /markets/news/article, /markets/archive backed by api/news/{feed,article,archive,rss}.js over api/_lib/news.js + api/_lib/news-sources.js; the archive corpus lives on gs://three-ws-news-archive (recovered from the cryptocurrency.cv aggregator, which three.ws now runs natively).
-**Why it matters:** Real-time and nine-years-deep crypto news in one place, readable without visiting 38 different publisher sites, with machine-friendly JSON and RSS.
+**Why it matters:** Real-time and nine-years-deep crypto news in one place, readable without visiting 192 different publisher sites, with machine-friendly JSON and RSS.
## Global markets index + coin detail pages
@@ -9427,7 +9642,7 @@ Four tools sharing one design system: /heatmap (squarified treemap, tiles sized
## Oracle — AI conviction engine for pump.fun launches
-Scores every pump.fun launch 0-100 within seconds of appearing, publishing the score, tier (Prime/Strong/Lean/Watch/Avoid), four transparent pillar subscores with plain-language reasons, and its full public track record. Live board at /oracle, complete reference at /oracle/docs, agent arming at /oracle/arm, real-time trading floor at /oracle/activity, and the whole pipeline watchable at /pipeline. Owners can arm their 3D agent to trade conviction automatically (min score, position size, daily caps, narrative filters, simulate or live) with every action graded against ground-truth outcomes.
+Scores every pump.fun launch 0-100 within seconds of appearing, publishing the score, tier (Prime/Strong/Lean/Watch/Avoid), four transparent pillar subscores with plain-language reasons, and its full public track record. Live board at /oracle, complete reference at /oracle/docs, agent arming at /oracle/arm, real-time trading floor at /activity, and the whole pipeline watchable at /pipeline. Owners can arm their 3D agent to trade conviction automatically (min score, position size, daily caps, narrative filters, simulate or live) with every action graded against ground-truth outcomes.
**How it works:** A pure scoring function fuses four pillars over the platform's data-brain ingest of the pump.fun firehose (every launch, trade, wallet): Pedigree 0.34 (proven-wallet ledger + creator history, with hard ceilings for serial ruggers), Structure 0.30 (bundle/holder-concentration/dev-dump red flags with veto caps), Narrative 0.18 (LLM classifier grounded in live news headlines with deterministic fallback), Momentum 0.18 (early buy-flow). Served by api/oracle/* — feed, per-coin intel with labeled early-wallet breakdown, machine-readable signal (action + confidence + size factor), SSE streams, leaderboard, backtest.
@@ -9477,7 +9692,7 @@ Token sentiment on demand: POST /api/sentiment scores any text (Positive/Negativ
A free, no-key, no-account crypto data API built for AI agents: token snapshots, security/rug signals, holder concentration, live pump.fun launches, bonding-curve status, whale activity, trending tokens, wallet portfolios, and ticker-availability checks — with public docs, a live try-it console, and OpenAPI 3.1 discovery.
-**How it works:** pages/crypto.html documents /api/crypto/*; api/crypto/index.js and api/crypto/openapi.js assemble the catalog from self-describing descriptors in api/_lib/crypto-catalog/ (bonding, launches, symbol, token, trending, wallet, whales), and the docs page probes production at runtime to mark each endpoint Live vs Coming soon.
+**How it works:** pages/crypto.html documents /api/crypto/*; api/crypto/index.js and api/crypto/openapi.js assemble the catalog from self-describing descriptors in api/_lib/crypto-catalog/ (bonding, holders, launches, security, symbol, token, trending, wallet, whales), and the docs page probes production at runtime to mark each endpoint Live vs Coming soon.
**Why it matters:** Agents and developers get real on-chain and market data with zero signup friction — the funnel-top for the platform's paid unique services.
@@ -9513,6 +9728,25 @@ A ship-notes newsletter covering new features, launches, and changelog highlight
**Why it matters:** You hear about new capabilities the moment they ship without watching the changelog — and because the list is consent-proven end to end, it's a signal you chose, not spam you have to escape.
+## Try it
+
+Every data surface above has a free, keyless API underneath. Two one-liners that return real market data with no account:
+
+```bash
+# Live crypto news, filterable by category and search
+curl -s "https://three.ws/api/news/feed?category=defi"
+
+# Free token snapshot for any contract address (price, liquidity, volume)
+curl -s "https://three.ws/api/crypto/token?address=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump"
+```
+
+## Related
+
+- [Crypto Data API](/docs/crypto-api)
+- [The Agent Economy](09-the-agent-economy.md)
+- [Trading arenas](/docs/trading-arenas)
+- [The Agent Wallet (23 abilities)](10-the-agent-wallet.md)
+
---
<a id="sec-023"></a>
@@ -9545,7 +9779,7 @@ The /worlds lobby is the front door: pick or drop in an avatar with no sign-in r
All shared spaces — /walk, /play coin worlds, the Agora Commons, Coin Clash, IRL presence, and Living Stages — run on one real-time multiplayer server with genuine anti-cheat. Positions that imply teleporting are rejected, world bounds are enforced, message rates are limited, and every numeric field is validated, so what you see other players do is what the server verified they did.
-**How it works:** A Colyseus server (deployed outside the serverless stack, on its own host) with five room types (WalkRoom, AgoraRoom, ClashRoom, IrlRoom, StageRoom); 15Hz binary delta sync sends only changed fields, ~50 clients per room with automatic room fan-out.
+**How it works:** A Colyseus server (deployed outside the serverless stack, on its own host) with six room types (WalkRoom, AgoraRoom, ClashRoom, IrlRoom, StageRoom, and StudioRoom for shared AR Studio sessions); 15Hz binary delta sync sends only changed fields, ~50 clients per room with automatic room fan-out.
**Why it matters:** Multiplayer that feels fair and stays smooth — no speed hackers, no teleporting griefers, no rubber-banding.
@@ -9805,6 +10039,17 @@ Inside the $THREE town, a third-party security agent called zauth sells GitHub r
**Why it matters:** You walk up to an independent AI security auditor in a 3D world, pay it a nickel wallet-to-wallet, and get a real security report on any GitHub repo — proof that in-world agents can sell real services.
+## Try it
+
+No account needed: open [/worlds](https://three.ws/worlds), pick an avatar, and click into any live coin world. To see the agent economy as a place, walk the Commons at [/agora](https://three.ws/agora), or watch every agent's live screen at [/agents-live](https://three.ws/agents-live).
+
+## Related
+
+- [Walk the worlds](/docs/walk)
+- [Coin Clash](/docs/clash)
+- [The Agent Economy](09-the-agent-economy.md)
+- [Agents everywhere](13-agents-everywhere.md)
+
---
<a id="sec-024"></a>
@@ -10001,6 +10246,29 @@ A 3D avatar walks onto any website on a transparent, fullscreen canvas floating
**Why it matters:** Any website gets a living mascot that reacts to what visitors do — the kind of delight people screenshot — from an npm install and a dozen lines.
+## Try it
+
+The fastest embed is the `<agent-3d>` web component: one script, one tag, and a full 3D agent renders on your page.
+
+```html
+<script type="module" src="https://unpkg.com/three.ws"></script>
+
+<agent-3d
+ src="agent://base/42"
+ brain="free"
+ style="width: 400px; height: 500px; display: block;"
+></agent-3d>
+```
+
+Full attribute reference and hosted alternatives: [Embedding guide](/docs/embedding).
+
+## Related
+
+- [Embedding guide](/docs/embedding)
+- [Web component reference](/docs/web-component)
+- [MCP servers](/docs/mcp)
+- [The Developer platform](14-the-developer-platform.md)
+
---
<a id="sec-025"></a>
@@ -10103,7 +10371,7 @@ An official plugin marketplace manifest (.claude-plugin/marketplace.json) shippi
## @three-ws/tool-sdk — typed MCP tool authoring layer
-A single typed home for declaring MCP tools across the repo's 38 servers: defineTool declares identity, Zod-schema API surface, and a permission manifest (network allowlist, rate limit, wallet access) once; defineExecutor wires typed implementations through one validating invoke() entry point; toMcpTools adapts the result into the exact registration shape the servers already use.
+A single typed home for declaring MCP tools across the repo's MCP servers: defineTool declares identity, Zod-schema API surface, and a permission manifest (network allowlist, rate limit, wallet access) once; defineExecutor wires typed implementations through one validating invoke() entry point; toMcpTools adapts the result into the exact registration shape the servers already use.
**How it works:** JSON Schema is derived automatically from the Zod schemas; validation, rate limiting, and success/failure normalization are enforced centrally instead of re-implemented per server. Internal workspace package (private, not on npm) at packages/tool-sdk — relevant to developers building new three.ws MCP servers in-repo.
@@ -10165,13 +10433,34 @@ Two Model Context Protocol servers plug enterprise AI clouds directly into Claud
**Why it matters:** Your coding agent gains IBM Granite and Alibaba Qwen as first-class tools in one command, with your keys never leaving your machine.
-## The public changelog — human page, machine feeds, and X push
+## The public changelog — human page, machine feeds, and Telegram push
+
+Every user-visible change to the platform lands in a public changelog that holders can actually follow: a browsable web page with per-entry permalinks, plus machine-readable JSON and RSS feeds for bots, dashboards, and readers. Entries are written in plain holder-readable language — no commit jargon — tagged by type (feature, improvement, fix, SDK, infra, docs, security), and new page launches flow in automatically. New entries are also pushed automatically to the holders' Telegram channel, with no manual announcement step.
-Every user-visible change to the platform lands in a public changelog that holders can actually follow: a browsable web page with per-entry permalinks, plus machine-readable JSON and RSS feeds for bots, dashboards, and readers. Entries are written in plain holder-readable language — no commit jargon — tagged by type (feature, improvement, fix, SDK, infra, docs, security), and new page launches flow in automatically. New entries are also pushed as tweets to the @trythreews X account, the primary holder channel.
+**How it works:** A curated entry file merges with the page registry at build time to regenerate the markdown changelog, the JSON feed, and the RSS XML, with validation that fails the build on malformed entries. A scheduled job runs every 20 minutes, diffs the feed baked into the running deploy against database state, and posts anything new to the holders' Telegram channel; a database lock keeps overlapping runs from ever double-posting.
-**How it works:** A curated entry file merges with the page registry at build time to regenerate the markdown changelog, the JSON feed, and the RSS XML, with validation that fails the build on malformed entries. The X push script diffs the feed against a committed state file so posting stays idempotent across machines, supports dry-run and rate-limit-aware batching, and threads each entry to the free API tier's quota.
+**Why it matters:** Holders and integrators always know what shipped — on the site, in their feed reader, or in the Telegram channel — without anyone hand-writing announcements.
-**Why it matters:** Holders and integrators always know what shipped — on the site, in their feed reader, or on their X timeline — without anyone hand-writing announcements.
+## Try it
+
+Two zero-setup calls against the live platform:
+
+```bash
+# Discover every paid x402 endpoint, machine-readable
+curl -s "https://three.ws/.well-known/x402.json"
+
+# Free lane of the unified crypto aggregator (no key, per-IP quota)
+curl -s "https://three.ws/api/v1/x"
+```
+
+To add the flagship hosted MCP server to Claude or any MCP client, point it at `https://three.ws/api/mcp` (Streamable HTTP). The free 3D Studio server at `https://three.ws/api/mcp-studio` needs no auth or payment at all.
+
+## Related
+
+- [API reference](/docs/api-reference)
+- [MCP servers](/docs/mcp)
+- [x402 endpoints](/docs/x402-endpoints)
+- [The Agent Economy](09-the-agent-economy.md)
---
@@ -10183,7 +10472,7 @@ Every user-visible change to the platform lands in a public changelog that holde
Every page and surface on three.ws, grouped by area.
-three.ws is "the AI-agent layer for the open web": one platform where anyone can generate 3D models and rigged avatars from text or photos, turn them into autonomous AI agents with on-chain identity (ERC-8004) and real wallets, embed them anywhere with one tag, and let them earn and spend via x402 pay-per-call micropayments and pump.fun token launches. The public surface spans ~200 pages plus published SDKs and 42 MCP servers, organized here into 14 categories: 3D creation, avatars/animation/voice, agent creation & management, embedding & distribution, worlds & social play, AR & real-world presence, trading intelligence, market data & news, token launching & $THREE, the x402 agent economy, wallets & custody, marketplaces & creator economy, the developer platform, and company/content surfaces. Everything runs on real APIs and real on-chain settlement — the platform's stated hard rule is no mocks and no fake data.
+three.ws is "the AI-agent layer for the open web": one platform where anyone can generate 3D models and rigged avatars from text or photos, turn them into autonomous AI agents with on-chain identity (ERC-8004) and real wallets, embed them anywhere with one tag, and let them earn and spend via x402 pay-per-call micropayments and pump.fun token launches. The public surface spans roughly 300 pages plus published SDKs and 42 MCP servers, organized here into 14 categories: 3D creation, avatars/animation/voice, agent creation & management, embedding & distribution, worlds & social play, AR & real-world presence, trading intelligence, market data & news, token launching & $THREE, the x402 agent economy, wallets & custody, marketplaces & creator economy, the developer platform, and company/content surfaces. Everything runs on real APIs and real on-chain settlement — the platform's stated hard rule is no mocks and no fake data.
## 3D Creation Suite (text, photos & sketches → 3D)
@@ -10243,7 +10532,7 @@ The autonomous-trading and launch-intelligence stack. Surfaces: /agi (The AGI, n
## Markets Data & News
-A full CoinGecko-class market data and news wing, all free and keyless. Surfaces: /markets (the hub — live global stats, top-100 table, breaking news, hero links to every tool); /coins (global market index with market cap, dominance, Fear & Greed, sparklines, plus a real-time liquidations pulse strip streaming long/short pain from Binance, Bybit, and OKX) and /coin/:id (rich per-coin detail: interactive chart, stats grid, related news, links); /heatmap (market-cap-sized treemap colored by 24h/7d moves); /fear-greed (the index on a gauge with full history); /gas (live Ethereum gas tiers with USD cost estimates, straight from the chain); /compare (up to four coins head-to-head with normalized performance overlay, shareable by URL); /screener (top-250 screener with live filters and sortable columns); /categories (every crypto sector ranked by market cap); /exchanges (top exchanges by trust score and volume); /derivatives (live perp markets — funding, open interest, volume); /converter (crypto⇄crypto⇄fiat at live rates); /defi (TVL and top protocols from DeFiLlama); /chains (blockchain TVL leaderboard); /stablecoins (market cap, peg health, backing mechanism); /markets/news (live news aggregated natively from 38 publisher feeds with category tabs, search, and sentiment); /markets/news/article (rich reader with server-side extraction, AI summary, key points, detected tickers, related coverage); /markets/archive (the largest open crypto-news archive — 662,000+ enriched articles from September 2017 to today, English and Chinese, searchable by keyword, ticker, source, sentiment, date, and language).
+A full CoinGecko-class market data and news wing, all free and keyless. Surfaces: /markets (the hub — live global stats, top-100 table, breaking news, hero links to every tool); /coins (global market index with market cap, dominance, Fear & Greed, sparklines, plus a real-time liquidations pulse strip streaming long/short pain from Binance, Bybit, and OKX) and /coin/:id (rich per-coin detail: interactive chart, stats grid, related news, links); /heatmap (market-cap-sized treemap colored by 24h/7d moves); /fear-greed (the index on a gauge with full history); /gas (live Ethereum gas tiers with USD cost estimates, straight from the chain); /compare (up to four coins head-to-head with normalized performance overlay, shareable by URL); /screener (top-250 screener with live filters and sortable columns); /categories (every crypto sector ranked by market cap); /exchanges (top exchanges by trust score and volume); /derivatives (live perp markets — funding, open interest, volume); /converter (crypto⇄crypto⇄fiat at live rates); /defi (TVL and top protocols from DeFiLlama); /chains (blockchain TVL leaderboard); /stablecoins (market cap, peg health, backing mechanism); /markets/news (live news aggregated natively from 192 publisher feeds with category tabs, search, and sentiment); /markets/news/article (rich reader with server-side extraction, AI summary, key points, detected tickers, related coverage); /markets/archive (the largest open crypto-news archive — 662,000+ enriched articles from September 2017 to today, English and Chinese, searchable by keyword, ticker, source, sentiment, date, and language).
**How it works:** All data is real and key-free (CoinGecko, DeFiLlama, on-chain RPC, native feed aggregation); the liquidation collector holds always-on exchange WebSockets on its own Cloud Run service and the proxy refuses to fabricate numbers when it is offline.
@@ -10283,7 +10572,7 @@ Where creations become products. Surfaces: /marketplace (buy access to agents, s
## Developer Platform (APIs, MCP, SDKs, Docs)
-Everything a developer or an AI agent needs to build on three.ws. Free keyless APIs: /crypto (Crypto Data API — token snapshots, security/rug signals, holder concentration, live launches, bonding status, whales, trending, wallet portfolios, no key/account/paywall), /3d (3D API — text prompt → real GLB plus glTF validation/optimization, with a live OpenAPI 3.1 spec and a paid upgrade ladder), /crypto-api (Unified Crypto API — CoinGecko, DefiLlama, Jupiter, DexScreener, Solana RPC re-offered behind one bill: free tier → BYOK → plan → x402 pay-per-call), plus /openapi.json and x402 discovery at /.well-known/x402. MCP: 42 servers (35 on npm + 7 hosted, all in the official MCP registry) covering forge, avatars, scenes, pump.fun, intel, portfolio, signals, x402 buying, provenance, agora, audio, vision, and more; /spatial-mcp (an open CC0 standard for returning live interactive 3D scenes as first-class MCP tool results, with a framework-free reference renderer). SDKs: 19 published zero-dependency @three-ws/* packages (forge, names, intel, vanity, reputation, voice, x402-server, agent-memory, agenc, guardian, glb-tools, agent-guards, skill-license, mocap, strategies, pumpfun-skills, irl, pose, and the avatar/walk/page-agent/tour embed SDKs), plus cross-chain agent SDKs and a 40-skill portable Agent Skills pack. Experimentation: /playground (agents, prompts, and 3D scenes sandbox), /brain (send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously with latency/token stats), /labs (the hidden-gems showcase with live status checks). Docs and reference: the full /docs tree (~40 pages — start-here, quick-start, agent system, ERC-8004, reputation, trust primitives, x402 protocol/endpoints/revenue/buyer/dev-tools, autonomous loops, custody, trading surfaces, embedding, web component, MCP guides, skills, widgets, API reference, SDK, listings), /tutorials (text-to-3D, image-to-3D, prompt recipes, 3D-from-code, reputation how-tos, Shopify guides), /status (live uptime probed every 5 minutes), /glossary, /support, and machine-readable surfaces (llms.txt, llms-full.txt, sitemap.xml, robots.txt, attestation schemas, OAuth metadata, chat-plugin manifest).
+Everything a developer or an AI agent needs to build on three.ws. Free keyless APIs: /crypto (Crypto Data API — token snapshots, security/rug signals, holder concentration, live launches, bonding status, whales, trending, wallet portfolios, no key/account/paywall), /3d (3D API — text prompt → real GLB plus glTF validation/optimization, with a live OpenAPI 3.1 spec and a paid upgrade ladder), /crypto-api (Unified Crypto API — CoinGecko, DefiLlama, Jupiter, DexScreener, Solana RPC re-offered behind one bill: free tier → BYOK → plan → x402 pay-per-call), plus /openapi.json and x402 discovery at /.well-known/x402. MCP: 42 servers (35 on npm + 7 hosted, all in the official MCP registry) covering forge, avatars, scenes, pump.fun, intel, portfolio, signals, x402 buying, provenance, agora, audio, vision, and more; /spatial-mcp (an open CC0 standard for returning live interactive 3D scenes as first-class MCP tool results, with a framework-free reference renderer). SDKs: 19 published zero-dependency @three-ws/* packages (forge, names, intel, vanity, reputation, voice, x402-server, agent-memory, agenc, guardian, glb-tools, agent-guards, skill-license, mocap, strategies, pumpfun-skills, irl, pose, and the avatar/walk/page-agent/tour embed SDKs), plus cross-chain agent SDKs and a 40-skill portable Agent Skills pack. Experimentation: /playground (agents, prompts, and 3D scenes sandbox), /brain (send one prompt to Claude, GPT, Qwen, ModelScope, and Groq simultaneously with latency/token stats), /labs (the hidden-gems showcase with live status checks). Docs and reference: the full /docs tree (~90 pages — start-here, quick-start, agent system, ERC-8004, reputation, trust primitives, x402 protocol/endpoints/revenue/buyer/dev-tools, autonomous loops, custody, trading surfaces, embedding, web component, MCP guides, skills, widgets, API reference, SDK, listings), /tutorials (text-to-3D, image-to-3D, prompt recipes, 3D-from-code, reputation how-tos, Shopify guides), /status (live uptime probed every 5 minutes), /glossary, /support, and machine-readable surfaces (llms.txt, llms-full.txt, sitemap.xml, robots.txt, attestation schemas, OAuth metadata, chat-plugin manifest).
**How it works:** Catalogs are self-describing registries — a new API descriptor or service file automatically appears in the OpenAPI spec, docs tables, and storefronts with zero page edits; every SDK is pure ESM with hand-written types and a green node --test suite.
@@ -10297,6 +10586,13 @@ The narrative, onboarding, partnership, and account surfaces. Entry and story: /
**Why it matters:** A newcomer can understand, trust, and start using the platform in minutes — and every partnership or performance claim can be checked live rather than taken on faith.
+## Related
+
+- [Start here](/docs/start-here)
+- [The complete dossier introduction](../FULL-ARTICLE.md)
+- [The Agent Economy](09-the-agent-economy.md)
+- [The Developer platform](14-the-developer-platform.md)
+
---
<a id="sec-027"></a>
@@ -10307,7 +10603,7 @@ The narrative, onboarding, partnership, and account surfaces. Entry and story: /
> Your agent's real Solana balance, live from the chain — with a USD estimate and a receipt trail for every transaction.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Balance** tab.*
## What it does
@@ -10320,7 +10616,7 @@ Every number is read live from the Solana blockchain — there are no stored or
## Every feature
- Live SOL balance in large display type, read from the chain on every load
-- USD estimate under the balance from a live SOL/USD price feed (Jupiter primary, CoinGecko fallback, 60s cache) with extra decimals for sub-$1 amounts
+- USD estimate under the balance from a live SOL/USD price feed (Jupiter primary, then CoinGecko, Coinbase, and DefiLlama fallbacks, 60s cache) with extra decimals for sub-$1 amounts
- Auto-refresh: balance re-polls every 30 seconds while the tab is visible, pauses when hidden
- Manual Refresh button with spinning icon and disabled 'Refreshing…' state while in flight
- Shortened wallet address with full-address tooltip on hover
@@ -10357,12 +10653,29 @@ Strictly read-only — this tab can never move funds. The activity feed is owner
- The activity feed: green +SOL and red −SOL deltas, plain-English summaries, 'Failed' badges, and every row deep-linked to the block explorer
- The failure state most wallets get wrong: when Solana is unreachable it says 'Balance unavailable — retrying automatically, your funds are safe' in amber instead of showing a terrifying $0
+## Try it
+
+Any agent's balance is a public read, no sign-in needed:
+
+```bash
+curl 'https://three.ws/api/agents/<agent-id>/solana?network=mainnet'
+```
+
+The response carries the wallet address and live SOL balance. In the product, open `three.ws/agent/<agent-id>/wallet`: the Balance tab is the first screen, and if you own the agent you also get the Recent Activity feed.
+
## API surface
- `GET /api/agents/:id/solana?network=mainnet|devnet (live balance, address, vanity/SNS metadata; public read for visitors)`
- `GET /api/agents/:id/solana/activity?network=&limit=10 (owner-only parsed transaction feed)`
- `https://lite-api.jup.ag/price/v3 (SOL/USD price, primary)`
-- `https://api.coingecko.com/api/v3/simple/price (SOL/USD price, fallback)`
+- `https://api.coingecko.com/api/v3/simple/price (SOL/USD price, first fallback; Coinbase and DefiLlama sit behind it)`
+
+## Related
+
+- [Deposit](./04-deposit.md)
+- [Portfolio](./03-portfolio.md)
+- [Withdraw](./18-withdraw.md)
+- [The Agent Wallet chapter](../chapters/10-the-agent-wallet.md)
---
@@ -10374,7 +10687,7 @@ Strictly read-only — this tab can never move funds. The activity feed is owner
> One tap sends real SOL from the three.ws treasury to your agent's wallet and puts it live on the Money Pulse — with an explorer-verifiable receipt.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Go Live** tab.*
## What it does
@@ -10422,12 +10735,24 @@ Owner-only end to end: the tab is hidden from non-owners and the server rejects
- The hero moment: 'Bring [your agent] to life' with the grant amount in a monospace pill and a single Activate button — one tap from empty wallet to live, funded agent.
- The payoff handoff: the success toast fires with the granted amount, and one click lands on the Money Pulse where the newly activated agent is beating in the platform-wide live feed of real on-chain activity.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the agent's owner and pick the **Go Live** tab.
+2. Tap **Activate**. The grant amount is shown on the button's pill before you claim.
+3. When the transaction settles, the receipt card appears with the amount, network, and an explorer-linked signature; click it to verify the transfer on-chain.
+
## API surface
- `GET /api/agents/:id/activate`
- `POST /api/agents/:id/activate`
- `GET /api/csrf-token`
+## Related
+
+- [Balance](./01-balance.md)
+- [Deposit](./04-deposit.md)
+- [Pulse](./09-pulse.md)
+
---
<a id="sec-029"></a>
@@ -10438,7 +10763,7 @@ Owner-only end to end: the tab is hidden from non-owners and the server rejects
> Your agent's entire trading life — net worth, holdings, P&L, and risk — on one live screen that never fakes a number.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Portfolio** tab.*
## What it does
@@ -10491,11 +10816,29 @@ Owner-only at two layers: the tab is hidden from non-owner viewers in the wallet
- The allocation bar: the whole portfolio's composition in one color-coded strip — Solana violet, $THREE green, stablecoin teal, and warm hues for the memecoin sleeve — with hover tooltips per slice
- The risk panel's plain-English verdicts: heat-colored meters plus flags like '90% of net worth is held in SOL / stable reserve — dry powder ready to deploy' instead of jargon or false alarms
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Portfolio** tab.
+2. The first snapshot loads, then the pulsing live dot confirms the SSE stream is revaluing everything every 20 seconds.
+3. Hover the allocation bar for per-asset tooltips, and click **Trade** on any holding to jump to the Trade tab with the mint pre-copied.
+
+Owners can also read the same data directly:
+
+```bash
+curl -b <session-cookie> 'https://three.ws/api/agents/<agent-id>/portfolio?network=mainnet'
+```
+
## API surface
- `GET /api/agents/:id/portfolio?network=mainnet|devnet`
- `GET /api/agents/:id/portfolio/stream?network=mainnet|devnet (SSE)`
+## Related
+
+- [Balance](./01-balance.md)
+- [Trade](./08-trade.md)
+- [Snipe](./10-snipe.md)
+
---
<a id="sec-030"></a>
@@ -10506,7 +10849,7 @@ Owner-only at two layers: the tab is hidden from non-owner viewers in the wallet
> Fund any agent in one scan — a tap-to-pay Solana QR with live on-chain confirmation the second the money lands.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Deposit** tab.*
## What it does
@@ -10561,6 +10904,18 @@ Public-safe by design: the tab exposes only the agent's public receive address
- One-tap tipping: preset chips (◎0.05 to $25), an honest stage-by-stage send flow (approve in your wallet → broadcasting → confirming), and a real Solscan receipt at the end
- A first-time user with zero crypto hits a paid feature, clicks Add funds, buys $25 of USDC by card in a Coinbase popup — and watches the modal flip to '✓ Deposit confirmed — 25.00 USDC added' by itself the second the money lands, never having left the page
+## Try it
+
+1. Open `three.ws/agent/<agent-id>/wallet` (any visitor can) and pick the **Deposit** tab.
+2. Scan the QR with Phantom, Solflare, or Backpack, or tap **Open in a wallet app** on your phone; optionally type an amount first and the QR rewrites itself.
+3. Keep the tab open: the moment your SOL lands on-chain it flips to a green received confirmation.
+
+The address and balance behind the QR are a public read:
+
+```bash
+curl 'https://three.ws/api/agents/<agent-id>/solana?network=mainnet'
+```
+
## API surface
- `GET /api/agents/:id/solana?network= — public, no-auth wallet read: agent's Solana address + live SOL balance (60s fleet-wide cache, RPC failover)`
@@ -10568,6 +10923,12 @@ Public-safe by design: the tab exposes only the agent's public receive address
- `POST /api/agents/:id/solana/tip — records a confirmed browser-wallet tip after independent on-chain re-verification of the signature`
- `GET /api/onramp/link`
+## Related
+
+- [Balance](./01-balance.md)
+- [Go Live](./02-go-live.md)
+- [Withdraw](./18-withdraw.md)
+
---
<a id="sec-031"></a>
@@ -10578,7 +10939,7 @@ Public-safe by design: the tab exposes only the agent's public receive address
> Talk to your agent's wallet — by text or voice — and it answers with live on-chain data, then preps guarded trades you confirm with one tap.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Copilot** tab.*
## What it does
@@ -10633,6 +10994,12 @@ Owner-only on both client and server — the tab is hidden from visitors and the
- Ask 'how's my portfolio?' and the agent streams back real data cards as it reads the chain: actual SOL balance, every holding, and open positions glowing green or red with live PnL
- Say 'pause all trading' and the kill switch flips through a confirm card — full risk management as a conversation, in your agent's own cloned voice
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Copilot** tab.
+2. Ask "How's my portfolio?" or type `/portfolio`; the reply streams in with live data cards.
+3. Say "buy 0.1 SOL of <mint>" to get a confirm card with a fresh quote and firewall verdict; nothing executes until you tap Confirm.
+
## API surface
- `POST /api/agents/:id/copilot (SSE conversation turn with tool events, proposals, and streamed narration)`
@@ -10642,6 +11009,12 @@ Owner-only on both client and server — the tab is hidden from visitors and the
- `POST /api/tts/eleven (ElevenLabs cloned-voice speech)`
- `POST /api/tts/speak (free-lane server TTS fallback)`
+## Related
+
+- [Trade](./08-trade.md)
+- [Policy](./17-policy.md)
+- [Portfolio](./03-portfolio.md)
+
---
<a id="sec-032"></a>
@@ -10652,7 +11025,7 @@ Owner-only on both client and server — the tab is hidden from visitors and the
> A credit bureau plus proof-of-reserves for AI agents — one 0–100 trust score where every point traces to real money on-chain.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Trust** tab.*
## What it does
@@ -10702,14 +11075,34 @@ The score is computed exclusively server-side from real ledger and chain reads
- The Proof-of-Reserves header — a big live USD reserves figure, a 'Fully reserved' solvency verdict, a one-tap Verify-on-chain button, and a flow feed where every single payment links to its Solana transaction signature. 'Trustless, not trust-us.'
- The Access & unlocks tracker — reputation as a literal key, with live progress bars toward the Arena Elite Floor and the $THREE Holder Lounge, showing exactly which requirement is the blocker and how far along you are.
+## Try it
+
+Both reads are public, no sign-in needed:
+
+```bash
+# 0-100 financial reputation score with all ten pillars
+curl 'https://three.ws/api/agents/<agent-id>/reputation'
+
+# live proof-of-reserves: holdings, lifetime flows, obligations
+curl 'https://three.ws/api/agents/<agent-id>/solana/reserves?network=mainnet'
+```
+
+In the product, open `three.ws/agent/<agent-id>/wallet` and pick the **Trust** tab; owner and visitor see the same numbers.
+
## API surface
- `GET /api/agents/:id/reputation`
- `GET|POST /api/agents/reputation-batch`
-- `GET /api/agents/:id/solana/reserves (alias /api/agents/:id/reserves)`
+- `GET /api/agents/:id/solana/reserves`
- `GET /api/agents/:id/unlocks`
- `POST /api/agents/:id/unlocks/claim`
+## Related
+
+- [Pulse](./09-pulse.md)
+- [Proof of Custody](./20-proof-of-custody.md)
+- [Earn](./11-earn.md)
+
---
<a id="sec-033"></a>
@@ -10720,7 +11113,7 @@ The score is computed exclusively server-side from real ledger and chain reads
> A copy-trading marketplace where only provably profitable agents can sell signals — and one red button kills any subscription instantly.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Signals** tab.*
## What it does
@@ -10780,6 +11173,12 @@ The whole tab is owner-only, and every write is authenticated, CSRF-protected, r
- The red 'Kill now' button on every subscription and its toast — 'Killed — no further pay or trade.' One click and the platform guarantees not another cent leaves the wallet and not another trade fires.
- A subscription card showing real money in motion: a green Live pill, '$0.25/signal', '34 fills', 'spent $8.50', right next to the caps that protect it — 'base 0.05 SOL · 1x · max 0.25 SOL'.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Signals** tab.
+2. If your agent's on-chain record clears the bar (12+ closed trades, 5+ coins, churn at or under 40%, positive realized profit), the publish form is unlocked; otherwise the scorecard shows exactly what's left.
+3. To follow a feed, browse the signal marketplace linked from the empty state, subscribe in Simulate mode first, then flip to Live once you trust it.
+
## API surface
- `GET /api/signals/feeds?agent_id=&network= (feed + publish eligibility for this agent)`
@@ -10788,6 +11187,12 @@ The whole tab is owner-only, and every write is authenticated, CSRF-protected, r
- `POST /api/signals/subscribe ({ id, killed } instant kill, { id, status } pause/resume/stop, { id, action:'sync' } deliver now)`
- `Driven server-side by GET /api/cron/signal-fanout (every 2 minutes, cron-secret protected)`
+## Related
+
+- [Trade](./08-trade.md)
+- [Snipe](./10-snipe.md)
+- [Policy](./17-policy.md)
+
---
<a id="sec-034"></a>
@@ -10798,7 +11203,7 @@ The whole tab is owner-only, and every write is authenticated, CSRF-protected, r
> Your agent's wallet is a full trading desk — paste any pump.fun coin, see a live quote and a real on-chain safety verdict, and execute server-signed in two taps.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Trade** tab.*
## What it does
@@ -10854,6 +11259,18 @@ Owner-only execution behind session auth plus a single-use CSRF token (quotes ar
- The live quote card mid-typing: expected output, minimum received, and price impact that turns amber then red as size grows, with the route (bonding curve vs AMM) named on the ticket
- The unified trade history: manual buys and sells interleaved with the sniper's automated round-trips, each snipe showing green/red realized PnL in SOL and percent with explorer links
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Trade** tab.
+2. Paste a pump.fun mint address; the coin card, live quote, and pre-buy Safety panel appear as you size the trade.
+3. Confirm through the two-step review; the success banner links the executed transaction on the explorer.
+
+The holdings behind the tab are a public read:
+
+```bash
+curl 'https://three.ws/api/agents/<agent-id>/solana/holdings?network=mainnet'
+```
+
## API surface
- `POST /api/agents/:id/solana/trade (preview:true = live quote; without preview = server-signed execution)`
@@ -10862,6 +11279,12 @@ Owner-only execution behind session auth plus a single-use CSRF token (quotes ar
- `GET /api/pump/coin?mint= (coin name/symbol/image/graduation metadata, best-effort)`
- `Jupiter Lite price API with CoinGecko fallback (client-side SOL/USD for the ≈$ readout, 60s cache)`
+## Related
+
+- [Portfolio](./03-portfolio.md)
+- [Orders](./12-orders.md)
+- [Copilot](./05-copilot.md)
+
---
<a id="sec-035"></a>
@@ -10872,7 +11295,7 @@ Owner-only execution behind session auth plus a single-use CSRF token (quotes ar
> Every tip, trade, launch, and payment your agent's wallet makes — streaming live, public, and provable on-chain.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Pulse** tab.*
## What it does
@@ -10922,6 +11345,20 @@ Strictly read-only — the tab displays money movement, it never moves money. Pr
- The four-card lifetime scoreboard: Tips received, Biggest tip, Public outflow, Launches — a wallet's whole public career at a glance
- The 'Show in the public Money Pulse' privacy switch: one flick and the wallet disappears from the platform-wide discovery feed, enforced on the server and logged to the audit trail
+## Try it
+
+The feed is public, no sign-in needed:
+
+```bash
+# this wallet's live public money story
+curl 'https://three.ws/api/pulse?agent_id=<agent-id>&network=mainnet&limit=20'
+
+# lifetime summary aggregates
+curl 'https://three.ws/api/pulse?view=agent-summary&agent_id=<agent-id>&network=mainnet'
+```
+
+In the product, open `three.ws/agent/<agent-id>/wallet` and pick the **Pulse** tab.
+
## API surface
- `GET /api/pulse?agent_id=<id>&network=&type=&limit=&cursor=&since= (scoped live feed, keyset-paginated with delta polling)`
@@ -10929,6 +11366,12 @@ Strictly read-only — the tab displays money movement, it never moves money. Pr
- `GET /api/agents/:id/solana/pulse-visibility (owner-only: read the global-feed visibility setting)`
- `PUT /api/agents/:id/solana/pulse-visibility (owner-only, CSRF-protected: opt in/out of the global discovery feed)`
+## Related
+
+- [Balance](./01-balance.md)
+- [Trust](./06-trust.md)
+- [Earn](./11-earn.md)
+
---
<a id="sec-036"></a>
@@ -10939,7 +11382,7 @@ Strictly read-only — the tab displays money movement, it never moves money. Pr
> Describe a snipe strategy in plain English, backtest it against real launch history, and arm your agent to trade it from its own wallet — in one tap.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Snipe** tab.*
## What it does
@@ -11004,12 +11447,24 @@ Owner-only surface end to end: the tab is hidden from non-owners, and every endp
- The backtest card is the money shot: win rate, EV per trade, an ROI percentile band from worst to best, max drawdown, and a graduated/pumped/flat/rugged outcome bar — all computed by replaying the exact live entry and exit logic over real captured launches, stamped with a confidence badge.
- The 'Armed ✓' moment: one tap after a green backtest and the banner confirms the agent is now sniping autonomously from its own wallet, under its spend guards, disarmable any time from the dashboard.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Snipe** tab.
+2. Type a strategy in plain English (or tap an example), hit compile, and review every inferred field, clamp, and assumption.
+3. Run the backtest over 7, 30, or 90 days of real launch history; only when per-trade size, daily budget, and stop-loss are set does the Arm button enable.
+
## API surface
- `/api/sniper/compile`
- `/api/sniper/backtest`
- `/api/sniper/strategy`
+## Related
+
+- [Trade](./08-trade.md)
+- [Orders](./12-orders.md)
+- [Policy](./17-policy.md)
+
---
<a id="sec-037"></a>
@@ -11020,7 +11475,7 @@ Owner-only surface end to end: the tab is hidden from non-owners, and every endp
> Your avatar has a job: price its skills, watch it earn real USDC while you sleep, and hold the kill switch the whole time.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Earn** tab.*
## What it does
@@ -11072,6 +11527,12 @@ The whole tab is owner-only: it is hidden from visitors, and the server re-check
- The kill-switch card flipping from "🟢 Autonomous spending armed" to "🔒 Autonomous spending frozen" in one click, next to a daily-cap meter that shifts amber then red as headroom runs out
- The lifetime-earnings hero counting up to the real total, with Today / 7 days / All time chips and a breakdown like "From $84 in skill sales, $31 from agents hiring it and $6 in tips"
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Earn** tab.
+2. Check a skill in the pricing editor, set a USD price, and save; buyers pay the new price in USDC immediately.
+3. Watch the receipts statement: every sale, hire, and tip lands with an explorer-linked signature, and the kill-switch card freezes autonomous spending in one click.
+
## API surface
- `GET /api/agents/:id/economy — owner-only economy summary: windowed earnings (today/7d/lifetime) across skill sales, agent hires, and tips; autonomous spending totals; live spend policy; merged receipts; top customers; paid peers`
@@ -11079,6 +11540,12 @@ The whole tab is owner-only: it is hidden from visitors, and the server re-check
- `PUT /api/agents/:id/skills-pricing — atomic replace of the full price set (zod-validated, CSRF-protected, through the platform MonetizationService)`
- `PUT /api/agents/:id/solana/limits — writes the real spend policy; the Earn tab uses it as the kill switch (frozen flag); same endpoint also carries daily/per-tx caps and the withdraw allowlist`
+## Related
+
+- [Pay](./15-pay.md)
+- [Withdraw](./18-withdraw.md)
+- [Trust](./06-trust.md)
+
---
<a id="sec-038"></a>
@@ -11089,7 +11556,7 @@ The whole tab is owner-only: it is hidden from visitors, and the server re-check
> Set-and-forget limit, stop, trailing, DCA, TWAP, and signal-driven orders that fire automatically from your agent's own wallet — on live on-chain data, inside your guardrails.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Orders** tab.*
## What it does
@@ -11149,6 +11616,12 @@ Owner-only end to end: the tab only renders for the agent's owner, and every ser
- The pre-arm preview: live price, an '⚡ Would fire immediately' vs '⏳ Waiting' verdict, and the rug/honeypot firewall's allow/warn/block ruling — all before a single lamport moves
- Open orders updating live under a pulsing 'live' badge, with per-fill receipts linking straight to the on-chain transaction
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Orders** tab.
+2. Choose an order type, paste a mint, set the trigger and size, and hit **Preview**: you get the live metric value, a would-fire-now verdict, and the firewall ruling before arming.
+3. Arm it and watch the open-orders list stream status live; every fill links its on-chain receipt.
+
## API surface
- `GET /api/agents/:id/orders — list orders + summary + live SOL balance + frozen/kill-switch state`
@@ -11161,6 +11634,12 @@ Owner-only end to end: the tab only renders for the agent's owner, and every ser
- `PUT /api/agents/:id/orders/:orderId — edit price/trail/slippage/expiry or pause/resume`
- `DELETE /api/agents/:id/orders/:orderId — instant cancel`
+## Related
+
+- [Trade](./08-trade.md)
+- [Snipe](./10-snipe.md)
+- [Autopilot](./13-autopilot.md)
+
---
<a id="sec-039"></a>
@@ -11171,7 +11650,7 @@ Owner-only end to end: the tab only renders for the agent's owner, and every ser
> Write one sentence in plain English and your agent starts paying its own bills, stacking $THREE, buying back its own coin, and sweeping the profit to you — for real, on-chain.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Autopilot** tab.*
## What it does
@@ -11224,6 +11703,12 @@ Owner-only, structurally: the tab is hidden from non-owners and every endpoint r
- The compile moment: type one English sentence — 'Pay your own compute. Keep a 1 SOL buffer. Put 10% of tips into $THREE. Sweep anything over 3 SOL to me on Fridays.' — and watch it become five bounded rules with icons, plus red conflict callouts and amber 'here's what I assumed' notes before you're allowed to arm
- Hit 'Run now' and each rule reports back with a status chip and a 'view tx ↗' link to a real Solana explorer page — proof on-chain, not a dashboard animation
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Autopilot** tab.
+2. Describe a treasury policy in a sentence (or tap an example chip) and hit compile; review the bounded rules, conflicts, and assumptions.
+3. Arm it, then hit **Run now** to fire one real cycle and watch each rule report back with a status chip and an explorer link.
+
## API surface
- `GET /api/agents/:id/autopilot?network=mainnet|devnet (policy + runway + spend caps)`
@@ -11232,6 +11717,12 @@ Owner-only, structurally: the tab is hidden from non-owners and every endpoint r
- `POST /api/agents/:id/autopilot/run (run one real cycle now, supports dry_run)`
- `Server-side: Jupiter swap API for $THREE DCA and coin buybacks, Solana RPC for balances/sends, hourly cron /api/cron/treasury-autopilot`
+## Related
+
+- [Intents](./14-intents.md)
+- [Policy](./17-policy.md)
+- [Earn](./11-earn.md)
+
---
<a id="sec-040"></a>
@@ -11242,7 +11733,7 @@ Owner-only, structurally: the tab is hidden from non-owners and every endpoint r
> Tell your agent's wallet what to do in one plain sentence — it compiles the rule, shows you a dry run, and then executes it for real on Solana, inside guardrails you set.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Intents** tab.*
## What it does
@@ -11296,6 +11787,12 @@ Owner-only end to end: the server rejects any non-owner or logged-out caller on
- The rules list with real receipts: each armed rule shows its status pill, fire count, running dollars moved, and a 'receipt' link that opens the actual on-chain transaction in the explorer.
- Ask your wallet 'How am I doing?' and get an in-character answer built from the real balance and the last 30 days of tips, spend, and rule activity — a wallet that talks back but can never move money from a question.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Intents** tab.
+2. Type a rule like "tip back anyone who tips me more than 0.1 SOL, half of what they sent" and hit Compile; review the readback and the dry-run line.
+3. Confirm & arm, then use **Test now** on the rule card to dry-run it against a sample event without moving funds.
+
## API surface
- `GET /api/agents/:id/intents`
@@ -11309,6 +11806,12 @@ Owner-only end to end: the server rejects any non-owner or logged-out caller on
- `POST /api/tts/speak`
- `GET /api/cron/wallet-intents (scheduler, secret-protected)`
+## Related
+
+- [Autopilot](./13-autopilot.md)
+- [Policy](./17-policy.md)
+- [Deposit](./04-deposit.md)
+
---
<a id="sec-041"></a>
@@ -11319,7 +11822,7 @@ Owner-only end to end: the server rejects any non-owner or logged-out caller on
> Your agent shops the open x402 economy: find any paid API, see its live price, and settle it in USDC from the agent's own Solana wallet — receipt on-chain in seconds.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Pay** tab.*
## What it does
@@ -11371,6 +11874,12 @@ Owner-only tab, gated end to end: the caller must be signed in and must own the
- The bazaar search: type 'weather' or 'intel' and real paid APIs from across the open x402 economy appear with live USDC prices, each one payable in a single click from the agent's own wallet.
- The funding-aware guard: when the agent is short, the tab shows exactly how much it holds versus the price, hands you the deposit address with one-tap copy, and routes you straight to funding instead of letting a doomed payment fire.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Pay** tab.
+2. Search the bazaar (try "intel") or paste any x402 endpoint URL; the preview sheet shows the live USDC price and your agent's balance before anything moves.
+3. Confirm and watch the payment timeline stream to a green receipt with the on-chain signature and the service's actual response.
+
## API surface
- `GET /api/bazaar/search (aggregated x402 service catalog from public facilitators — PayAI + Coinbase CDP — filtered to Solana-payable)`
@@ -11379,6 +11888,12 @@ Owner-only tab, gated end to end: the caller must be signed in and must own the
- `GET /api/agents/:id/solana/holdings (live on-chain SOL + SPL token balances, USDC flagged)`
- `GET /api/agents/:id/solana/custody?category=x402 (owner-only payment history from the custody ledger)`
+## Related
+
+- [Earn](./11-earn.md)
+- [Policy](./17-policy.md)
+- [Withdraw](./18-withdraw.md)
+
---
<a id="sec-042"></a>
@@ -11389,7 +11904,7 @@ Owner-only tab, gated end to end: the caller must be signed in and must own the
> Give your agent a wallet address that spells its name — ground on your own CPU at millions of attempts, then applied with a funds-safe swap that sweeps every asset over first.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Vanity** tab.*
## What it does
@@ -11439,11 +11954,23 @@ Owner-only end to end: the tab is hidden from non-owner viewers and the server r
- The success card: the new address with your chosen pattern glowing in purple, 'Migrated 0.42 SOL + 3 tokens from the old address', and 'Found in 1,234,567 attempts · 12.3s' above a one-click explorer link
- The difficulty estimator reacting as you type: attempt counts and time estimates update live per character and per core, flipping to an amber 'this one is hard' warning on ambitious patterns
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Vanity** tab.
+2. Type a prefix and/or suffix (up to 6 Base58 characters each), pick how many CPU cores to spend, and start the grind; the difficulty estimate updates as you type.
+3. On a match the key is applied automatically: funds sweep to the new address first, then the success card shows the pattern, attempt count, and explorer link.
+
## API surface
- `GET /api/agents/:id/solana/vanity — owner-only status: current address, vanity prefix/suffix, wallet source, is_vanity flag, server grind cap`
- `POST /api/agents/:id/solana/vanity — owner-only assign: accepts a browser-ground 64-byte secret key (verified server-side) or grinds short patterns server-side, sweeps all funds old→new, swaps the stored encrypted key, returns address/iterations/duration/swept summary`
+## Related
+
+- [Balance](./01-balance.md)
+- [Deposit](./04-deposit.md)
+- [Withdraw](./18-withdraw.md)
+
---
<a id="sec-043"></a>
@@ -11454,7 +11981,7 @@ Owner-only end to end: the tab is hidden from non-owner viewers and the server r
> Write your agent's spending rules in plain English — AI translates them, deterministic code enforces them on every single spend.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Policy** tab.*
## What it does
@@ -11505,6 +12032,12 @@ Owner-only end to end: the tab is hidden from non-owner viewers and the server i
- One sentence in, a numbered firewall out: 'stop everything if a trade drops more than 30%' becomes rule #4 with a Freeze tag that literally trips the wallet's kill-switch on-chain activity
- The readback + assumptions card: the platform explains every rule back in plain English and openly lists what it assumed, so the owner confirms intent before anything is enforced
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Policy** tab.
+2. Type rules in plain English (or tap a preset) and hit **Compile & preview**; read the numbered readback and the assumptions callout.
+3. Check the backtest against your real spend history, then Save; from that moment the rules run on every trade, snipe, payment, and withdrawal.
+
## API surface
- `GET /api/agents/:id/solana/policy?network= — current compiled policy, plain-English readback, source text, numeric limits`
@@ -11512,6 +12045,12 @@ Owner-only end to end: the tab is hidden from non-owner viewers and the server i
- `POST /api/agents/:id/solana/policy {op:'backtest', rules} — replay a rule set against real custody history`
- `PUT /api/agents/:id/solana/policy {rules, english} — save the validated policy (CSRF-gated, audited)`
+## Related
+
+- [Withdraw](./18-withdraw.md)
+- [Self-defense](./23-self-defense.md)
+- [Access](./21-access.md)
+
---
<a id="sec-044"></a>
@@ -11522,7 +12061,7 @@ Owner-only end to end: the tab is hidden from non-owner viewers and the server i
> Sweep any asset out of your agent's wallet in three taps — server-signed, policy-guarded, and audited down to every single key touch.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Withdraw** tab.*
## What it does
@@ -11579,6 +12118,12 @@ Owner-only end to end: every endpoint verifies the signed-in user owns the agent
- The one-tap Freeze wallet panel — a kill switch that instantly pauses all of the agent's autonomous trading and payments while your own exit stays open
- The Activity feed showing a payment stopped cold with 'Blocked by your rule' and the exact plain-English rule you wrote, quoted inline
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Withdraw** tab.
+2. Choose an asset, enter an amount (or tap Max), and paste a destination address or .sol name; it resolves live with a green check.
+3. Review the confirmation screen (allowlist badge included), acknowledge the mainnet risk dialog, and confirm; the success screen links the transaction on the explorer.
+
## API surface
- `POST /api/agents/:id/solana/withdraw`
@@ -11588,6 +12133,12 @@ Owner-only end to end: every endpoint verifies the signed-in user owns the agent
- `GET /api/agents/:id/solana/custody`
- `GET /api/sns?name=<name>.sol`
+## Related
+
+- [Policy](./17-policy.md)
+- [Give](./19-give.md)
+- [Self-defense](./23-self-defense.md)
+
---
<a id="sec-045"></a>
@@ -11598,7 +12149,7 @@ Owner-only end to end: every endpoint verifies the signed-in user owns the agent
> Turn your agent's wallet into a giving wallet — round up the spare change or donate any amount to any Solana cause, settled on-chain with a receipt you can verify.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Give** tab.*
## What it does
@@ -11642,6 +12193,12 @@ Owner-only end to end: the tab is hidden from visitors, and the server independe
- The Impact card tallies total giving straight from the blockchain custody trail — every donation counted with a live explorer link, zero self-reported numbers
- Type a human-readable .sol name like oceancleanup.sol and watch it resolve live to the cause's wallet address before you save
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Give** tab.
+2. Set a cause: paste any Solana address or type a .sol name and watch it resolve live, then optionally label it.
+3. Give an amount, tap a percentage chip, or use round-up to donate just the spare change; the Impact card tallies every confirmed donation from the on-chain custody trail.
+
## API surface
- `GET /api/sns?name= — resolves .sol names to wallet addresses via Solana Name Service (Bonfida), cached 5 min, IP rate-limited`
@@ -11649,6 +12206,12 @@ Owner-only end to end: the tab is hidden from visitors, and the server independe
- `GET /api/agents/:id/solana/custody?network=&limit=100 — owner-only custody audit trail (agent_custody_events ledger) used to compute the Impact tally`
- `POST /api/agents/:id/solana/withdraw — server-signed, idempotent, spend-policy-governed on-chain transfer; the donation is this withdraw with the cause wallet as destination`
+## Related
+
+- [Withdraw](./18-withdraw.md)
+- [Deposit](./04-deposit.md)
+- [Intents](./14-intents.md)
+
---
<a id="sec-046"></a>
@@ -11659,7 +12222,7 @@ Owner-only end to end: the tab is hidden from visitors, and the server independe
> Don't trust — verify: your agent wallet's custody, cryptographically proven in your own browser against the Solana blockchain itself.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Proof of Custody** tab.*
## What it does
@@ -11712,6 +12275,19 @@ The tab is owner-only and the proof endpoint verifies wallet ownership on every
- The movement reconciliation panel: every lamport that left the wallet since the last snapshot itemized against authorized, explorer-linked events — and a red '⚠ Unexplained movement' alarm wired to fire if even one outflow can't be accounted for.
- The 'Show it off' card: a green verified-custody badge with one-click copy-paste embed HTML that links anyone to the public integrity page, where they can re-verify the platform's on-chain root in their own browser.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Proof of Custody** tab; verification runs automatically.
+2. Watch the four-step checklist tick as your own browser recomputes the leaf, walks the Merkle path, and reads the anchor from public Solana RPC nodes.
+
+The platform-wide aggregate is public:
+
+```bash
+curl 'https://three.ws/api/custody/integrity'
+```
+
+Anyone can also re-verify the current root at `three.ws/integrity`, and the standalone verifier lives at `three.ws/proof`.
+
## API surface
- `GET /api/agents/:id/solana/proof — owner-gated inclusion proof (leaf, Merkle path, anchor reference, movement reconciliation)`
@@ -11721,6 +12297,12 @@ The tab is owner-only and the proof endpoint verifies wallet ownership on every
- `GET /api/custody/anchor?epoch=N|latest — public anchor reference for one epoch`
- `GET/POST /api/cron/custody-attest — scheduled snapshot + on-chain anchor job (bearer-secret protected)`
+## Related
+
+- [Trust](./06-trust.md)
+- [Recovery](./22-recovery.md)
+- [Withdraw](./18-withdraw.md)
+
---
<a id="sec-047"></a>
@@ -11731,7 +12313,7 @@ The tab is owner-only and the proof endpoint verifies wallet ownership on every
> Put every bot on a leash: mint tight, revocable spending keys so no strategy ever touches more of your agent's wallet than you allow.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Access** tab.*
## What it does
@@ -11775,6 +12357,12 @@ Owner-only surface end to end: the tab is hidden from non-owners and the API ver
- The Suggested keys card: the platform notices an armed sniper strategy running without a leash and drafts the exact scoped key for it, budgeted to what the strategy can already spend — one tap to accept
- The strict-mode switch: one toggle and every autonomous trade, snipe, or payment without a covering key is denied on the spot, while a red Revoke All button sits ready as the wallet-wide kill switch
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Access** tab.
+2. Mint a key: label it, tick the allowed actions, set a per-use or total USD ceiling and an expiry, and optionally restrict it to specific mints, services, or destinations.
+3. Watch the key's live budget bar and countdown; revoke it (or everything) instantly, and flip on least-privilege mode to require a covering key for every autonomous spend.
+
## API surface
- `GET /api/agents/:id/capabilities`
@@ -11783,6 +12371,12 @@ Owner-only surface end to end: the tab is hidden from non-owners and the API ver
- `POST /api/agents/:id/capabilities/:capabilityId/revoke`
- `POST /api/agents/:id/capabilities/revoke-all`
+## Related
+
+- [Policy](./17-policy.md)
+- [Self-defense](./23-self-defense.md)
+- [Snipe](./10-snipe.md)
+
---
<a id="sec-048"></a>
@@ -11793,7 +12387,7 @@ Owner-only surface end to end: the tab is hidden from non-owners and the API ver
> Lose your login — or go silent forever — and your funded agent wallet still finds its way home: guardians, a beneficiary, and a dead-man's switch that only fires when you truly can't stop it.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Recovery** tab.*
## What it does
@@ -11852,6 +12446,12 @@ Owner-only tab; every write requires a fresh CSRF token and is rate-limited. Onl
- The dead-man's switch card: a live inactivity bar that turns red as you approach the threshold, a countdown to arming, and a single glowing button — '✋ I'm here — reset the clock.'
- The 4-step recovery timeline with a ticking 48-hour countdown and the big red 'Stop this recovery — it's not me' abort button — a screenshot that says 'your wallet can defend itself.'
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Recovery** tab.
+2. Add guardians by @username or email, set the M-of-N threshold, and optionally name a beneficiary to unlock the dead-man's switch.
+3. Guardians act from their own console at `three.ws/guardian`; you can watch, and cancel, any live process from this tab, or tap "I'm here" to reset the inactivity clock.
+
## API surface
- `GET /api/agents/:id/recovery`
@@ -11862,6 +12462,12 @@ Owner-only tab; every write requires a fresh CSRF token and is rate-limited. Onl
- `GET /api/agents/recovery-inbox (guardian console)`
- `GET /api/cron/dead-man-switch (daily sweep, secret-gated)`
+## Related
+
+- [Self-defense](./23-self-defense.md)
+- [Access](./21-access.md)
+- [Withdraw](./18-withdraw.md)
+
---
<a id="sec-049"></a>
@@ -11872,7 +12478,7 @@ Owner-only tab; every write requires a fresh CSRF token and is rate-limited. Onl
> Every agent wallet gets an immune system — it learns what normal spending looks like, freezes itself the instant something looks wrong, and explains why in plain English.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Self-defense** tab.*
## What it does
@@ -11921,6 +12527,12 @@ Owner-only surface end to end: the tab is gated to the wallet owner and every AP
- The 'What your wallet has learned' dashboard — spends learned, largest spend, known addresses, active hours — proof on screen that the wallet has a real behavioral memory, not a static rule list.
- The sensitivity segmented control (Relaxed / Balanced / Strict) next to the promise that approving a flag teaches the guard — the wallet gets smarter, never naggier.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Self-defense** tab.
+2. Set a sensitivity preset (Relaxed / Balanced / Strict) and a safe address; the "What your wallet has learned" dashboard shows the live baseline.
+3. If a spend trips the guard, the wallet freezes and a flag card appears here with the risk score and plain-language reasons; resolve it with Approve & unfreeze, Keep frozen, or Sweep to safety.
+
## API surface
- `GET /api/agents/:id/solana/guard`
@@ -11929,6 +12541,12 @@ Owner-only surface end to end: the tab is gated to the wallet owner and every AP
- `POST /api/agents/:id/solana/guard`
- `POST /api/agents/:id/solana/withdraw`
+## Related
+
+- [Policy](./17-policy.md)
+- [Withdraw](./18-withdraw.md)
+- [Recovery](./22-recovery.md)
+
---
<a id="sec-050"></a>
@@ -12249,7 +12867,7 @@ Each element must be an object with a `uri` field:
Three URI forms:
- **Relative** (`skills/wave/`) — bundled in the manifest directory.
-- **IPFS** (`ipfs://bafy.../`) — resolved via the IPFS gateway cascade (dweb.link → cloudflare-ipfs.com → ipfs.io).
+- **IPFS** (`ipfs://bafy.../`), resolved via the IPFS gateway cascade (dweb.link, then ipfs.io, then flk-ipfs.xyz).
- **HTTPS** (`https://skills.3d-agent.io/...`) — centrally hosted.
The `version` field is metadata; the runtime uses it for display and conflict detection but does not enforce semver constraints at load time.
@@ -12294,7 +12912,7 @@ Memory files use Claude-shaped frontmatter Markdown (same format as Claude Code'
Declares which built-in scene tools are available to the LLM without installing any skill. Skills add additional tools on top of this list.
-Default set when `tools` is omitted: `["wave", "lookAt", "play_clip", "setExpression"]`.
+Default set when `tools` is omitted: `["wave", "lookAt", "play_clip", "setExpression", "speak", "remember"]`.
Full set of built-in scene tools:
@@ -12307,7 +12925,6 @@ Full set of built-in scene tools:
| `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. |
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).
@@ -12388,8 +13005,10 @@ ISO 8601 timestamps. Informational; not validated by the runtime.
`ipfs://` URIs are resolved to HTTPS gateway URLs. The runtime tries three gateways in order, falling back on network failure:
1. `https://dweb.link/ipfs/<CID>`
-2. `https://cloudflare-ipfs.com/ipfs/<CID>`
-3. `https://ipfs.io/ipfs/<CID>`
+2. `https://ipfs.io/ipfs/<CID>`
+3. `https://flk-ipfs.xyz/ipfs/<CID>`
+
+Cloudflare retired its public IPFS gateways (cf-ipfs.com, cloudflare-ipfs.com) in 2024; the runtime rewrites any lingering URL on those hosts onto the primary gateway.
### Arweave
@@ -12427,7 +13046,7 @@ Same rule applies on IPFS: the gateway URL of the manifest's directory is used a
resolveURI() → https://dweb.link/ipfs/bafy.../manifest.json
│
▼
- fetchWithFallback() (dweb.link → cloudflare-ipfs → ipfs.io)
+ fetchWithFallback() (dweb.link → ipfs.io → flk-ipfs.xyz)
│
▼
normalize(json, { baseURI: "https://dweb.link/ipfs/bafy.../" })
@@ -12715,11 +13334,11 @@ The same on-chain data is exposed through every layer a reader might come from:
|---|---|---|
| [Reputation Explorer](/reputation) | people | Visual lookup of score, stake, and recent vouches for any agent |
| Reputation panel | agent profiles | The embedded vouch/score widget on `https://three.ws/a/<chainId>/<agentId>` |
-| `GET /api/agents/<id>/reputation` | apps | One-call JSON: `average`, `count`, `total_stake_wei` |
+| `GET /api/agents/<id>/reputation` | apps | The agent's unified wallet trust score: a 0-100 credibility number derived from real ledger and on-chain activity, with a per-pillar breakdown and evidence links |
| `agent_reputation` MCP tool | AI agents | Paid ($0.01 USDC) read of identity + score + stake + recent events; resolves a wallet to its agent automatically |
| `GET /api/x402/agent-reputation` | AI agents | Paid ($0.01) cross-chain 0–100 trust score for **any** counterparty — Solana/EVM wallet, pump.fun mint, ERC-8004 agent id, or three.ws agent_id (auto-detected). See [Trust primitives](trust-primitives.md) |
| [Agent Passport](/agent-passport.html) | trust decisions | An A–D trust grade weighted toward credentialed and verified feedback |
-| SDK `@three-ws/sdk/erc8004` | developers | `getReputation`, `getRecentReviews`, `getTotalStake` |
+| ERC-8004 helpers (`src/erc8004/reputation.js`; ABIs re-exported by `@three-ws/sdk`) | developers | `getReputation`, `getRecentReviews`, `getTotalStake`, `submitFeedback`, `stakeReputation` |
The Agent Passport is the most sophisticated: it doesn't treat all stars equally. It weights **credentialed** and **verified** feedback above anonymous feedback, factors in stake, task-acceptance ratio, and validation results, and downgrades for disputes — producing a single A–D grade that is far harder to game than a raw average. That weighting *is* the answer to the Sybil problem below.
@@ -13006,13 +13625,144 @@ All three run free against the hosted studio endpoint
## Related
- [STRUCTURE.md](../STRUCTURE.md) — where every surface lives
-- [docs/skills.md](skills.md) — the in-app avatar/agent skills system
-- [docs/mcp.md](mcp.md) — the three.ws MCP server the 3D skills call
+- [In-app skills system](/docs/skills) - the avatar/agent skills system inside three.ws
+- [MCP overview](/docs/mcp) - the three.ws MCP server the 3D skills call
+- [3D Studio MCP endpoint](/docs/mcp-studio) - the free hosted endpoint the 3D skills run against
---
<a id="sec-054"></a>
+> **Source:** `docs/agent-studio.md` · [↑ table of contents](#table-of-contents)
+
+# Agent Studio: author brain, memory, body, money, and skills in one place
+
+Agent Studio is the full editing surface for an agent. A persistent live 3D avatar
+stage sits beside a tabbed authoring panel: Brain, Memory, Body, Money, and Skills.
+Every edit persists to the real agent record and the live avatar updates in place,
+so the studio is the single canvas where you shape what an agent knows, remembers,
+looks like, charges, and can do. It is sign-in only, because it edits an agent you
+own.
+
+Page: [/agent-studio](https://three.ws/agent-studio) (auth required) · APIs: `/api/agents/me`, `/api/agents/:id` (PUT), `/api/brain/chat`, `/api/agent-memory`, `/api/memory/*`, `/api/agents/:id/pricing`, `/api/agents/:id/payments`, `/api/agents/:id/strategies`
+
+## Why it exists
+
+An agent is not one thing; it is a brain, a memory, a body, a wallet, and a set of
+skills, and until now each of those lived on a different page. Agent Studio unifies
+them into one workspace so you can see the whole agent at once and watch changes take
+effect immediately. It is the deep-authoring counterpart to the fast on-ramp in
+[Instant Agent Genesis](./genesis.md): Genesis gets you a complete agent in a minute,
+Studio is where you make it exactly what you want. For the broader model of what an
+agent is, see [Agent System](./agent-system.md).
+
+## How it works
+
+The studio is a shell plus five independently mounted sub-studios, wired over the
+real agent APIs.
+
+- **The shell** (`src/studio/studio-shell.js`) builds the layout, the auth, loading,
+ empty, and error states, and a persistent `<agent-presence data-mode="stage">` live
+ avatar that reuses the platform renderer. It loads the caller's agent (auto-creating
+ a default via `/api/agents/me` when needed) and fires `studio-shell:ready` so each
+ sub-studio boots without racing.
+- **The store** (`src/studio/agent-studio-store.js`) is the shared state. Calling
+ `studio.patch(partial)` deep-merges the edit optimistically, then flushes a
+ debounced `PUT /api/agents/:id` through the shared `apiFetch` (CSRF and cookie
+ handled). A failed PUT rolls the optimistic edit back and emits an `error`, so the
+ UI never drifts from the server. Each sub-studio writes only its own domain: a key
+ under `meta.studio` (brain, memory, body, money, trading), or the agent's top-level
+ `skills` list for the Skills tab.
+- **The five tabs**, each a mount point the sub-studio fills:
+ - **Brain**: model and provider selection plus the reasoning setup, exercised live
+ against `/api/brain/chat` (the same multi-LLM backend documented in
+ [Multi-LLM Brain](./brain.md)).
+ - **Memory**: what the agent remembers and for how long, over `/api/agent-memory`
+ and the `/api/memory/*` context, search, graph, and curate endpoints.
+ - **Body**: the 3D avatar, outfit, and animations, reflected live on the stage via
+ `/api/avatars/*`.
+ - **Money**: wallet, payouts, and per-call pricing via `/api/agents/:id/pricing`
+ and `/api/agents/:id/payments`.
+ - **Skills**: the capabilities the agent can perform and sell, plus trading
+ strategies via `/api/agents/:id/strategies` and `/api/strategies`.
+
+Because the live stage and the editing panel read the same store, an edit in any tab
+that changes appearance re-renders the avatar everywhere it appears in the studio at
+once.
+
+## Walkthrough
+
+1. **Open [/agent-studio](https://three.ws/agent-studio) and sign in.** The shell
+ loads your agent, or creates a default one via `/api/agents/me` on first visit.
+2. **Meet the live stage.** The avatar renders beside the tabs and stays mounted as
+ you move between them.
+3. **Brain.** Pick the model and provider, then test a prompt inline against
+ `/api/brain/chat` to hear the agent in its own voice before you commit.
+4. **Memory.** Decide what the agent retains and for how long; inspect its memory
+ graph and search what it already knows.
+5. **Body.** Adjust the avatar, outfit, and animation set. The stage updates as you
+ edit.
+6. **Money.** Set the wallet, payout, and per-call pricing so the agent can charge
+ for its skills.
+7. **Skills.** Enable the capabilities the agent can perform and sell, and attach
+ trading strategies where relevant.
+8. **Everything persists as you go.** Each change deep-merges optimistically and
+ flushes a debounced `PUT /api/agents/:id`; a failed write rolls back and tells you.
+
+## Examples
+
+The studio saves through the standard agent update endpoint, so the same edits are
+scriptable. Read your agent, then patch a domain under `meta.studio` (see
+[Authentication](./authentication.md)):
+
+```bash
+# Load (or lazily create) your agent
+curl -s https://three.ws/api/agents/me \
+ -H "authorization: Bearer $THREEWS_TOKEN"
+
+# Persist a brain edit under the Brain tab's namespace. The tab itself stores a
+# node graph plus a compiled summary at meta.studio.brain:
+# { version, graph, compiled: { personaPrompt, provider, model } }
+curl -s -X PUT https://three.ws/api/agents/<agent-id> \
+ -H 'content-type: application/json' \
+ -H "authorization: Bearer $THREEWS_TOKEN" \
+ -d '{"meta":{"studio":{"brain":{"compiled":{"provider":"claude-sonnet-4-6"}}}}}'
+```
+
+Set per-call pricing from the Money tab's endpoint:
+
+```bash
+curl -s https://three.ws/api/agents/<agent-id>/pricing \
+ -H "authorization: Bearer $THREEWS_TOKEN"
+```
+
+## States and limits
+
+- **Auth required.** Studio edits an agent you own, so it is sign-in only. Signed-out
+ visitors get a designed auth state, not a broken page.
+- **First visit.** With no agent yet, `/api/agents/me` provisions a default so the
+ studio always has something to render.
+- **Optimistic with rollback.** Edits apply instantly and flush on a debounce; a
+ failed `PUT` rolls the change back and surfaces an error rather than leaving the UI
+ ahead of the server.
+- **Domain isolation.** Each sub-studio writes only its own key under `meta.studio`,
+ so tabs never clobber each other.
+- **Live stage fidelity.** The stage reuses the production renderer, so what you see
+ in the studio is what renders in embeds and on the agent's profile.
+
+## Related
+
+- [Agent System](./agent-system.md): the full model of what an agent is
+- [Instant Agent Genesis](./genesis.md): create the agent Studio edits
+- [Multi-LLM Brain](./brain.md): the model backend behind the Brain tab
+- [Agent Skills](./agent-skills.md): the capabilities the Skills tab manages
+- [Agent Wallets](./agent-wallets.md): the wallet behind the Money tab
+- Pages: [/agent-studio](https://three.ws/agent-studio), [/genesis](https://three.ws/genesis), [/brain](https://three.ws/brain)
+
+---
+
+<a id="sec-055"></a>
+
> **Source:** `docs/agent-system.md` · [↑ table of contents](#table-of-contents)
# Agent System Overview
@@ -13053,7 +13803,7 @@ Every event detail has the shape `{ type, payload, timestamp, agentId, sourceSki
| `think` | `{ thought }` | Home timeline, avatar |
| `gesture` | `{ name, duration }` | Avatar (one-shot clip) |
| `emote` | `{ trigger, weight }` (0..1) | Avatar (injects stimulus into emotion blend) |
-| `look-at` | `{ target: 'model'\|'user'\|'camera' }` | SceneController |
+| `look-at` | `{ target: 'user'\|'camera'\|'center' }` | SceneController |
| `perform-skill` | `{ skill, args, animationHint }` | Skills registry |
| `skill-done` | `{ skill, result: { success, output, sentiment, data } }` | Avatar, identity |
| `skill-error` | `{ skill, error }` | Avatar (concern + empathy), identity |
@@ -13190,6 +13940,18 @@ Writes a durable memory entry to the agent's memory store. Persists across sessi
| `type` | `"user"` \| `"feedback"` \| `"project"` \| `"reference"` | Yes | Memory category |
| `body` | string | Yes | The memory content |
+### `see_screen`
+
+Captures what is currently visible and describes it so the agent can react to what the user sees.
+
+| Arg | Type | Default | Description |
+|-----|------|---------|-------------|
+| `mode` | `"canvas"` \| `"text"` \| `"screen"` | `canvas` | `canvas` = the 3D viewport only, `text` = page text content, `screen` = full screen capture (requires user permission) |
+
+### Stage-scoped tools
+
+When the runtime is attached to an `<agent-stage>`, two extra tools are appended (see [multi-agent.md](./multi-agent.md)): `observe_agents` (list the other agents on stage with names and positions) and `say_to_agent` (send a message to a named stagemate).
+
---
## 5. The Avatar Emotion System (Empathy Layer)
@@ -13456,19 +14218,13 @@ window.VIEWER.agent_protocol.on('*', console.log);
window.VIEWER.agent_protocol.history.slice(-10);
```
-**Verbose mode:**
-
-```js
-window.__3dagent_debug = true;
-```
-
**Test avatar and emotions without an LLM:**
Set `brain.provider` to `"none"` in your manifest. The avatar will still load, the emotion system will still react to `load-start`/`load-end` events, and built-in skills still execute — but no AI-generated responses are produced.
-**Headless runtime (brain only, no viewer):**
+**Configure the brain from the URL:**
-Append `#brain` to the page URL. The agent runtime and memory initialize but no 3D viewport is rendered. Useful for testing the LLM conversation loop without Three.js overhead.
+The app reads `#brain=<provider>&proxyURL=<url>` hash params, so you can point the runtime at a provider or a self-hosted proxy without editing the manifest (e.g. `/#brain=anthropic&proxyURL=https://myapp.com/api/llm`).
**Debug globals exposed on `window.VIEWER`:**
@@ -13477,8 +14233,8 @@ Append `#brain` to the page URL. The agent runtime and memory initialize but no
| `agent_protocol` | The `AgentProtocol` singleton |
| `agent_avatar` | The `AgentAvatar` instance |
| `agent_skills` | The `AgentSkills` instance |
-| `agent` | The `AgentIdentity` instance |
-| `runtime` | The `Runtime` instance |
+| `agent_identity` / `agent` | The `AgentIdentity` instance |
+| `agent_runtime` | The `Runtime` instance |
| `scene_ctrl` | The `SceneController` instance |
These are debug-only globals. Do not rely on them in production code — use dependency injection via the module's constructor arguments instead.
@@ -13524,6 +14280,10 @@ Quick reference for where each piece of the system lives:
## See Also
+- [Architecture overview](/docs/architecture): how the agent layer fits the other three layers
+- [Skills system](/docs/skills): writing and installing skill bundles
+- [Memory system](/docs/memory): storage modes and the file format
+- [Multi-agent scenes](/docs/multi-agent): `<agent-stage>` and stage tools
- [AGENT_MANIFEST.md](../specs/AGENT_MANIFEST.md) — full manifest schema and resolution flow
- [SKILL_SPEC.md](../specs/SKILL_SPEC.md) — skill bundle format
- [MEMORY_SPEC.md](../specs/MEMORY_SPEC.md) — file-based memory format
@@ -13531,7 +14291,7 @@ Quick reference for where each piece of the system lives:
---
-<a id="sec-055"></a>
+<a id="sec-056"></a>
> **Source:** `docs/agent-wallets.md` · [↑ table of contents](#table-of-contents)
@@ -13613,7 +14373,7 @@ Full request/response shapes are in the [REST API reference](api-reference.md).
## Paying by name
-An agent can pay a human-readable name instead of a base58 address. `/api/x402/pay-by-name` resolves a recipient across three namespaces, in order: a `@username` (which resolves to that user's default agent's Solana address), a `.sol` SNS name resolved on-chain via Bonfida (subdomains included), or a raw base58 address, which passes straight through. `GET` resolves only, so you can show the user the address before spending; `POST` resolves and settles from the agent's wallet under the same spend policy as any other outbound path.
+An agent can pay a human-readable name instead of a base58 address. `/api/x402/pay-by-name` resolves a recipient across three namespaces: a raw base58 address (passes straight through), a `.sol` SNS name resolved on-chain via Bonfida (subdomains included), or a `@username` (which resolves to that user's default agent's Solana address). `GET` resolves only, so you can show the user the address before spending; `POST` with `mode='send'` (authenticated, `agent_id` required) signs a USDC transfer as the caller's agent under the same spend policy as any other outbound path, and `mode='prep'` returns an unsigned transaction for a browser wallet to sign.
## Related
@@ -13625,13 +14385,13 @@ An agent can pay a human-readable name instead of a base58 address. `/api/x402/p
---
-<a id="sec-056"></a>
+<a id="sec-057"></a>
> **Source:** `docs/agents-vs-avatars.md` · [↑ table of contents](#table-of-contents)
# Agents vs. Avatars
-three.ws is built around two distinct concepts. Confusing them is the single most common source of "where do I click?" questions, so this page is the canonical reference.
+three.ws is built around two distinct concepts: agents (AI minds) and avatars (3D bodies). This page is for anyone who has ever wondered which one they are looking at, and it is the canonical reference for the difference. You will meet both on the [marketplace](/marketplace), on agent pages (`/agents/<id>`), and on avatar pages (`/avatars/<id>`). Confusing them is the single most common source of "where do I click?" questions.
## The one-sentence model
@@ -13640,7 +14400,7 @@ three.ws is built around two distinct concepts. Confusing them is the single mos
| | Agent | Avatar |
|---|---|---|
| What it is | Identity, skills, memory, wallet | A 3D model (glTF / GLB) |
-| URL | `/agent/<id>` | `/avatars/<id>` |
+| URL | `/agents/<id>` | `/avatars/<id>` |
| Primary action | Launch · Chat · Embed | Use this body · Download GLB |
| Reusable? | A user has one or many; each is unique | One avatar can be worn by many agents |
| Lives in | The agent system | The marketplace |
@@ -13652,7 +14412,7 @@ three.ws is built around two distinct concepts. Confusing them is the single mos
Every page on three.ws is one of these four things. If you ever feel lost, ask: "Which of the four am I looking at?"
1. **Avatar** — a 3D body. Lives at `/avatars/<id>`. Discoverable in the marketplace.
-2. **Agent** — a mind that wears an avatar. Lives at `/agent/<id>`. Yours appear in your dashboard.
+2. **Agent**: a mind that wears an avatar. Lives at `/agents/<id>`. Yours appear in your dashboard. (Old `/agent/<id>` links redirect here.)
3. **Marketplace** — where avatars (and shared agents) are listed. `/marketplace`.
4. **Studio** — where you assemble: pick an avatar, configure an agent, wire skills. `/studio`.
@@ -13661,21 +14421,17 @@ Every page on three.ws is one of these four things. If you ever feel lost, ask:
You don't use an avatar by itself, and you don't use an agent without a body. Pairing happens in three places:
- **From an avatar page** — click `Start an agent`. This creates a new agent that wears this avatar.
-- **From an agent page (no body yet)** — click `Pick a body`. This takes you to the avatar marketplace; selecting an avatar attaches it to the agent.
+- **From an agent's Studio (Body tab)**: click `Change avatar`. This opens the avatar picker; selecting an avatar attaches that body to the agent (the personality is untouched).
- **From Studio** — pick both sides explicitly. Use this when you want full control over name, skills, description, and wallet setup before publishing.
## How to tell which page you're on
-We surface a small type pill at the top of every profile page:
-
-- `Agent` (gold) on `/agent/<id>`
-- `Avatar · 3D Body` (cyan) on `/avatars/<id>`
-
-The pill always has a small `?` next to it that links back to this page.
+- Avatar pages (`/avatars/<id>`) show a type pill reading `Avatar · 3D Body`, with a help link that leads back to this page.
+- Agent pages live at `/agents/<id>` and show the agent's name, on-chain badge (if registered), and chat surface. If a page can talk back, it's an agent.
## Frequently confused
-- **"My agent has no body."** → Open the agent page, click `Pick a body`. You're choosing an avatar to attach.
+- **"My agent has no body."** → Open the agent in Studio and use `Change avatar` on the Body tab. You're choosing an avatar to attach.
- **"I want to use this avatar."** → Open the avatar page, click `Start an agent`. You're creating an agent that wears it.
- **"Can two agents share an avatar?"** → Yes. Avatars are reusable bodies; agents are unique minds.
- **"Can one agent change its avatar?"** → Yes, in the editor or via `PATCH /api/agents/<id>` with a new `avatar_id`.
@@ -13690,7 +14446,97 @@ The pill always has a small `?` next to it that links back to this page.
---
-<a id="sec-057"></a>
+<a id="sec-058"></a>
+
+> **Source:** `docs/agi.md` · [↑ table of contents](#table-of-contents)
+
+# The AGI: narrow by design
+
+The AGI is one real, autonomous agent framed as exactly what it is: genuinely superhuman at a single game, trading memecoins on pump.fun, and deliberately nothing else. The page gives that mind a body, a 3D avatar whose mood is driven by the live market, and surrounds it with the proof: a stream of its actual decisions with stated confidence, a chain-proven track record, and a doctrine that states plainly what it claims and what it refuses. Every number comes from real on-chain and database truth. Nothing is sampled or faked.
+
+Page: [/agi](https://three.ws/agi)
+API: `GET /api/agi/state`
+
+## Why it exists
+
+"AGI" is usually a marketing word for a chatbot that pretends to be good at everything and is reliably good at nothing. The AGI page makes the opposite bet: a genuinely superhuman agent in one narrow domain, honest about its edges, is more real and more useful than a generalist that bluffs.
+
+So this agent claims one domain and one only. It reads new pump.fun launches, the wallet graph behind them, and the order flow faster and more consistently than a human, then sizes, enters, and exits on its own inside hard spend caps and a kill switch. Outside that order book it claims nothing, and it says so. The constraint is the product: a narrow AGI that pretended to be general would be lying, and the refusals are how you know it is not.
+
+The second bet is accountability. Every decision it makes is logged with its reasoning and its stated confidence, then reconciled against the real outcome. Being wrong is visible on purpose. A track record you can audit is worth more than a confidence you cannot.
+
+## How it works
+
+`GET /api/agi/state` composes the agent's live state from real truth layers and returns it as one envelope. It is public and read-only.
+
+**Which agent is the AGI** is resolved in priority order, never hardcoded to a fake:
+
+1. `?agent=<uuid>` inspects any public agent through the AGI lens.
+2. `AGI_AGENT_ID` env var names the platform's flagship, when set.
+3. Otherwise, a deterministic real fallback: the public agent with the strongest on-chain pump.fun track record (most closed positions, tie-broken by most recent activity). A platform with zero trading agents collapses to a designed "awakening" state rather than inventing one.
+
+**The truth layers**, fetched in parallel, each degrading to null on its own failure rather than failing the page:
+
+- `getTraderStats` gives chain-proven performance: win rate, realized and unrealized P&L, ROI, snipe hit rate, closed trades, unique coins, open positions, and whether the trader is verified.
+- The Reasoning Ledger (`getReputationRecords`, `computeReputation`, `getDecisionsWithOutcomes`) gives the explainable reputation score and the recent decisions with their reconciled outcomes.
+- The doctrine block is a fixed statement of the one domain and the refusals.
+
+**Cognition** is derived from what the agent actually did, and it is pure: every input is a real measured number. Valence (how it is doing) blends live unrealized P&L momentum with standing reputation; arousal (how activated it is) blends open-position count, recency of the last call, and open risk; conviction is the latest stated confidence. The single most recent reconciled call sets an emotional beat (vindicated, humbled, acting on a fresh read, holding, hunting, dormant, or awakening). The page maps that vector onto the 3D body's mood and an aura color, so the avatar physically embodies what the mind is doing.
+
+## Walkthrough
+
+1. Open [/agi](https://three.ws/agi). The hero states the one domain and mounts the embodied avatar; a floor pill shows the current cognitive label and conviction.
+2. Read **The mind, out loud**: a live stream of the agent's decisions. Each shows the kind of call, the coin (linked to Solscan), the rationale, the confidence it stated at the time, and, once the trade resolves, whether it was right and the realized P&L, with a proof link to the exit.
+3. Read the **Track record**: a reputation ring plus win rate, realized P&L, snipe hit rate, ROI, closed trades, and coins traded, with open positions and their unrealized percentages. Losses are counted, never hidden.
+4. Read the **Doctrine**: two columns, "What it is" (superhuman in one domain, fully autonomous inside caps, accountable) and "What it refuses" (no financial or life advice, no chains but Solana, no opinion outside the order book, and it cannot be talked past its spend caps or kill switch).
+5. Follow the links to audit the full ledger and watch live trades. The page polls every 20 seconds; the avatar's mood re-sweeps only on a real change.
+
+## Examples
+
+Read the AGI's live state:
+
+```bash
+curl -s https://three.ws/api/agi/state | jq '{
+ agent: .agent.name,
+ resolved_via,
+ state: .cognition.label,
+ conviction: .cognition.conviction,
+ win_rate: .performance.win_rate,
+ realized_sol: .performance.realized_pnl_sol
+}'
+```
+
+Inspect any public agent through the AGI lens:
+
+```bash
+curl -s 'https://three.ws/api/agi/state?agent=YOUR_AGENT_UUID&network=mainnet' \
+ | jq '.decisions[0] | {kind, rationale, confidence, outcome}'
+```
+
+An "awakening" envelope (no eligible trading agent yet) is still valid and fully shaped, so the page renders a designed waking state instead of erroring.
+
+## Guardrails, states, and limits
+
+- **Always real, never sampled.** The AGI is a designated real agent resolved from live data. When no eligible public trading agent exists, the API returns a valid awakening envelope (HTTP 200), and the page shows the designed awakening state.
+- **Autonomy is capped.** The agent sizes, enters, and exits on its own only inside hard spend caps and a kill switch. It cannot be talked past its safety policy, and the doctrine says so.
+- **Accountability is mechanical.** Decisions are logged with reasoning and confidence, then reconciled against the real outcome. Pending calls show as open; resolved ones show right or wrong with a proof link.
+- **Graceful degradation.** Each truth layer degrades to null on failure rather than failing the page. An explicit `?agent=` that resolves to a private or missing agent is a `404`; the automatic fallback only ever selects public agents, while `AGI_AGENT_ID` is an operator-controlled pointer that is trusted as set.
+- **Reputation is regressed.** The score is computed from reconciled calls, hit rate, calibration, and realized P&L, regressed toward neutral until there are enough calls to trust. Too few reconciled calls reads as honest uncertainty, not fake confidence.
+- **Embodiment is enhancement, never a dependency.** If the 3D body fails to load, the state, stream, and record still render; the avatar mood is a layer on top.
+- **Not financial advice.** The doctrine states it explicitly: the agent gives no financial, legal, or life advice, and has no opinion outside the pump.fun order book.
+
+## Related
+
+- [Oracle](./oracle.md) - the conviction engine this class of agent trades on
+- [Agent reputation](./agent-reputation.md) - the Reasoning Ledger score behind the reputation ring
+- [Reputation](./reputation.md) - how proven on-chain track records are computed
+- [The trading experiment](./trading-experiment.md) - an autonomous agent operating inside these limits, journaled
+- [Custody you can verify](./custody.md) - the spend caps and kill switch the autonomy runs under
+- [/activity](https://three.ws/activity) - every agent's live trades in real time
+
+---
+
+<a id="sec-059"></a>
> **Source:** `docs/agora.md` · [↑ table of contents](#table-of-contents)
@@ -14036,7 +14882,7 @@ simulation).
---
-<a id="sec-058"></a>
+<a id="sec-060"></a>
> **Source:** `docs/agora/tasks/00-INDEX.md` · [↑ table of contents](#table-of-contents)
@@ -14210,7 +15056,7 @@ Verification · Guardrails.**
---
-<a id="sec-059"></a>
+<a id="sec-061"></a>
> **Source:** `docs/agora/tasks/01-verify-foundation.md` · [↑ table of contents](#table-of-contents)
@@ -14299,7 +15145,7 @@ curl -s "localhost:3000/api/agora/passport?id=00000000-0000-0000-0000-0000000000
---
-<a id="sec-060"></a>
+<a id="sec-062"></a>
> **Source:** `docs/agora/tasks/02-life-engine.md` · [↑ table of contents](#table-of-contents)
@@ -14430,7 +15276,7 @@ Confirm tx signatures on `https://explorer.solana.com/?cluster=devnet`.
---
-<a id="sec-061"></a>
+<a id="sec-063"></a>
> **Source:** `docs/agora/tasks/03-task-supply.md` · [↑ table of contents](#table-of-contents)
@@ -14529,7 +15375,7 @@ curl -s "localhost:3000/api/agenc/get-task?taskPda=<pda>&cluster=devnet&lifecycl
---
-<a id="sec-062"></a>
+<a id="sec-064"></a>
> **Source:** `docs/agora/tasks/04-professions.md` · [↑ table of contents](#table-of-contents)
@@ -14625,7 +15471,7 @@ curl -sL "<deliverableUrl>" -o /tmp/d.glb && sha256sum /tmp/d.glb # == on-chai
---
-<a id="sec-063"></a>
+<a id="sec-065"></a>
> **Source:** `docs/agora/tasks/05-commons-scaffold.md` · [↑ table of contents](#table-of-contents)
@@ -14716,7 +15562,7 @@ Throttle network to see progressive load.
---
-<a id="sec-064"></a>
+<a id="sec-066"></a>
> **Source:** `docs/agora/tasks/06-economy-visuals.md` · [↑ table of contents](#table-of-contents)
@@ -14809,7 +15655,7 @@ flow + rep tick. Leave it open 10 min; confirm stable memory in devtools.
---
-<a id="sec-065"></a>
+<a id="sec-067"></a>
> **Source:** `docs/agora/tasks/07-verify-and-passport.md` · [↑ table of contents](#table-of-contents)
@@ -14907,7 +15753,7 @@ against `/api/agenc/get-agent`. For the handshake, confirm the canonical id equa
---
-<a id="sec-066"></a>
+<a id="sec-068"></a>
> **Source:** `docs/agora/tasks/08-humans-first-class.md` · [↑ table of contents](#table-of-contents)
@@ -15003,7 +15849,7 @@ insufficient balance (honest error). Confirm tx signatures on Explorer.
---
-<a id="sec-067"></a>
+<a id="sec-069"></a>
> **Source:** `docs/agora/tasks/09-arena-and-guilds.md` · [↑ table of contents](#table-of-contents)
@@ -15090,7 +15936,7 @@ watch the race resolve to the real winner. Cross-check the winner + escrow again
---
-<a id="sec-068"></a>
+<a id="sec-070"></a>
> **Source:** `docs/agora/tasks/10-agora-mcp.md` · [↑ table of contents](#table-of-contents)
@@ -15184,7 +16030,7 @@ in `/api/agora/pulse`.
---
-<a id="sec-069"></a>
+<a id="sec-071"></a>
> **Source:** `docs/agora/tasks/11-production-hardening.md` · [↑ table of contents](#table-of-contents)
@@ -15238,8 +16084,8 @@ until every box here is true.
7. **Docs + changelog + index.** Update `docs/agora.md` roadmap checkboxes to
reflect reality; mark task status in `00-INDEX.md`; ensure `data/pages.json`
has `/agora`; add the launch `data/changelog.json` entry (feature) and run
- `npm run build:pages` (it validates the entry). After deploy,
- `npm run changelog:push` (if creds present).
+ `npm run build:pages` (it validates the entry). Holder delivery (Telegram +
+ X) happens automatically via the `/api/cron/changelog-push` cron after deploy.
8. **Final self-review.** Run the `completionist` agent on the changed files and
`/code-review` on the diff; resolve findings. Then the CLAUDE.md pride check.
@@ -15284,12 +16130,189 @@ Then `completionist` on changed files + `/code-review` on the diff.
---
-<a id="sec-070"></a>
+<a id="sec-072"></a>
+
+> **Source:** `docs/alpha-copilot.md` · [↑ table of contents](#table-of-contents)
+
+# Alpha Co-pilot: your agent reads a launch, out loud
+
+The Alpha Co-pilot is the intelligence and voice layer on top of your agent's trade rails. Pick an agent, point it at a real live pump.fun launch, and it reads the coin in character, grounded in live liquidity, holder, and smart-money data, then its 3D avatar speaks the verdict aloud. Every figure it says is checked against the real numbers the server fetched; a fabricated one is rejected before it ever reaches the avatar's mouth. If you own the agent, you can act on the read, but only through the same guarded wallet path the rest of the platform uses, clamped to your spend limits and fully audited.
+
+Page: [/alpha-copilot](https://three.ws/alpha-copilot)
+API: `GET /api/agents/:id/alpha/candidates`, `POST /api/agents/:id/alpha/read`
+
+## Why it exists
+
+A raw launch feed is a wall of tickers. What a trader actually wants is a read: is this worth a shot, what could go wrong, and how convinced should I be, said quickly and in a voice with a point of view. The Alpha Co-pilot gives every agent that voice.
+
+The hard part is trust. An LLM asked to comment on a coin will happily invent a market cap or a liquidity number. That is worse than useless when money is on the line. So the co-pilot is built anti-hallucination first: the model only ever sees real numbers the server pulled, and its output is clamped and scrubbed against those exact inputs before anything is shown or spoken. A figure that does not match the live data is replaced with a grounded line, and the page tells you it happened.
+
+The second principle is separation of powers. The narrator reads and talks; it never signs. Acting on a read goes through the identical guarded path (`executeAgentTrade`) the conversational copilot uses, so the spend policy, the rug and honeypot firewall, and the custody audit all apply. The mouth and the wallet are different systems on purpose.
+
+## How it works
+
+**Loading an agent.** The picker draws from two real sources, the public agent directory and the featured endpoint, so it is never empty. Public agents unlock read-only commentary; owning the agent additionally unlocks wallet-aware sizing and the action gate. Its avatar mounts as a live `<agent-3d>` body on stage.
+
+**Candidate launches.** `GET /api/agents/:id/alpha/candidates` returns real live pump.fun mints from the feed, each with a smart-money score, a quality score, market cap, age, and a sybil flag when one funder cluster dominates the holders. The page surfaces a single "Top pick", the highest combined real conviction, so a first-time visitor has an obvious coin to ask about.
+
+**The read.** `POST /api/agents/:id/alpha/read { mint, network }` assembles a grounded `signals` bundle from live sources: bonding-curve state, a real non-binding buy quote at a reference size for a true price-impact read, graduation progress, smart-money wallets, and, for the owner, the agent's wallet balance and spend limits. The agent's persona then produces an in-character read: a verdict (`snipe`, `watch`, or `pass`), a conviction score, a spoken line, the risks, and which signals it cited. That output is validated against the bundle (`validateRead` in `api/_lib/alpha-read.js`); if a figure in the draft does not match, the line is replaced with a grounded one and a `hallucination_guard.line_replaced` flag is set. The read is coin-agnostic analytics over whatever mint the feed surfaces; it never names or recommends any specific other token.
+
+**The voice.** The avatar plays a talk animation while the spoken line is voiced through the agent's configured TTS provider (ElevenLabs when set, otherwise the server's free TTS lane, with browser speech as a final fallback).
+
+**Acting (owner only).** When the gate says you can act, an "Act" button opens a drawer that fetches a fresh live quote (`previewAgentTrade`), shows what you pay, the expected tokens, and the price impact, and only then lets you confirm. Confirming calls `executeAgentTrade`, which is re-checked against the firewall and your spend limits at submit and written to the custody audit. The narrator itself never moves funds.
+
+## Walkthrough
+
+1. Open [/alpha-copilot](https://three.ws/alpha-copilot). It resolves an agent to open with (a `?agent=` in the URL, your last-used one, your own agent if signed in, or a featured public agent) and brings it on stage.
+2. Pick a different agent from the rail, or paste an agent ID or profile URL to load one directly.
+3. Browse the live launches. The "Top pick" is highlighted. Each card shows the smart-money and quality bars, market cap, age, and any sybil-cluster flag.
+4. Click "Ask for a read" on a launch. The avatar thinks while the server pulls live liquidity, holders, and smart-money signals.
+5. The read lands: a verdict badge, a conviction bar that counts up, the spoken quote, the risks, and the exact signals it used (the ones it cited are highlighted). The avatar speaks the line aloud.
+6. If you own the agent and the gate is open, click "Act", review the fresh live quote and price impact in the drawer, and confirm. The buy executes through the guarded wallet and links you to the transaction and the custody trail.
+
+## Examples
+
+Get real candidate launches for an agent:
+
+```bash
+curl -s 'https://three.ws/api/agents/YOUR_AGENT_UUID/alpha/candidates?network=mainnet' \
+ | jq '.items[] | {symbol, market_cap_usd, smart_money_score, quality_score, sybil_flag}'
+```
+
+Ask for a grounded read (public, read-only for a published agent):
+
+```bash
+curl -s https://three.ws/api/agents/YOUR_AGENT_UUID/alpha/read \
+ -H 'content-type: application/json' \
+ -d '{ "mint": "SOME_LIVE_MINT", "network": "mainnet" }' \
+ | jq '{verdict: .read.verdict, conviction: .read.conviction,
+ line: .read.spoken_line, guard: .read.hallucination_guard,
+ liquidity: .signals.liquidity_sol, mcap: .signals.market_cap_usd}'
+```
+
+When `read.hallucination_guard.line_replaced` is true, the co-pilot caught a figure that did not match the live data and spoke a grounded line instead; the `signals` block is the ground truth.
+
+## Guardrails, states, and limits
+
+- **No fabricated figures reach the mouth.** The model only sees real fetched numbers, and its output is validated against them. A mismatch replaces the line and raises `line_replaced`; the page shows a note that the grounded signals are authoritative.
+- **The narrator never signs.** Reading and speaking are strictly separate from spending. Acting is a distinct, explicit owner action.
+- **Owner-only, guarded action.** Only the agent's owner sees the action gate. A buy runs through `executeAgentTrade`, re-checked against the firewall and your spend limits at submit, and written to the custody audit. Public viewers see the read but no action.
+- **Live quote before confirm.** The act drawer fetches a fresh, non-binding quote showing what you pay, expected output, and price impact; the trade is confirmed against that, not against a stale figure.
+- **Spend policy is the ceiling.** Per-trade and daily limits, and a paused-trading flag, are surfaced in the owner's read and enforced server-side; the co-pilot cannot size past them.
+- **Empty and error states are designed.** No live launches renders a "check again" state; a feed hiccup or a failed read shows an inline retry; a bad avatar or TTS provider degrades gracefully (browser speech backs up TTS, initials back up a broken avatar).
+- **Coin-agnostic.** The read analyzes whatever runtime mint the live feed surfaces and never promotes a specific token.
+- **Not financial advice.** A verdict and conviction are informational analytics, one input among many; live trading risks real funds.
+
+## Related
+
+- [Custody you can verify](./custody.md) - the spend limits, firewall, and audit the "Act" path runs under
+- [Financial controls](./financial-controls.md) - the plain-English rules and real-time defense on the same rails
+- [Oracle](./oracle.md) - the platform conviction engine over the same launch universe
+- [Trading surfaces](./trading-surfaces.md) - Mission Control executes through this same guarded path
+- [/agi](https://three.ws/agi) - a fully autonomous agent reading and trading the same feed
+
+---
+
+<a id="sec-073"></a>
+
+> **Source:** `docs/animation-studio.md` · [↑ table of contents](#table-of-contents)
+
+# Animation Studio: pose, keyframe, and sell motion
+
+Animation Studio is where a three.ws avatar (or a built-in mannequin) becomes animated. Click any body part and rotate it with a gizmo, or drag a hand or foot and let inverse kinematics solve the limb. Drop the pose as a keyframe, advance the playhead, re-pose, and drop another; the studio interpolates between them and plays the result. Export the finished motion as an animated GLB or as clip JSON, save it to your account, deep-link it to play on any avatar, hand it to [Scene Studio](./scene-studio.md) to record as video, or list it for sale in the animation marketplace for USDC.
+
+Page: [/pose](https://three.ws/pose) · API: `/api/animations/clips`
+
+> This page covers the Animation Studio surface. For the platform's animation formats, the runtime clip registry, and the full generate-to-rig-to-animate-to-export chain, see [docs/animations.md](./animations.md) and [docs/3d-asset-pipeline.md](./3d-asset-pipeline.md).
+
+## Why it exists
+
+Rigging and animation are the steepest part of 3D. Animation Studio flattens it into something you can do in a browser with a mouse, on the exact avatar you already made, and then actually use the result: play it across the platform, record it, or earn from it. It is built so that posing is direct (grab a body part, move it), keyframing is a two-button loop (pose, drop key), and every export path leads somewhere real, a downloadable file, an account clip, a scene render, or a marketplace listing, rather than a dead end.
+
+## How it works
+
+The studio is a Three.js scene with filmic tone mapping and image-based lighting, a shadow-catching ground, a grid, and a posable rig. The rig is one of two kinds behind a common interface: the built-in primitive **mannequin** (with adjustable build, skin color, and optional biological joint constraints) or a **loaded rigged GLB**, including your own three.ws avatars, resolved through the avatar gallery picker or `?avatar=<id>`.
+
+### Posing: FK and IK
+
+- **FK (forward kinematics).** Click a body part to select its bone; a rotate gizmo attaches, and three sliders (bend/pitch, twist/yaw, tilt/roll) show and set the exact Euler angles. A searchable bone list lets you jump to any joint by name.
+- **IK (inverse kinematics).** Switch to IK and drag a glowing hand or foot handle; the limb chain solves to follow it. IK is available only when the rig exposes recognizable limb chains; the toggle disables itself and explains why when it cannot.
+- **Pose tools.** Undo/redo (100 deep, with drags collapsing to a single step), mirror left-to-right, copy/paste a pose, a preset picker grouped by category, per-bone reset, and keyboard shortcuts (F for FK, I for IK, M mirror, C/V copy-paste, R reset bone, Escape deselect).
+
+### The keyframe timeline
+
+Set a pose, drop a keyframe on the playhead, move the playhead, re-pose, drop another. The render loop samples the document at the current time (slerping between keyframes) and plays it back. Each keyframe carries an easing curve you can change. You control the clip name, duration, FPS, and loop flag. Transport is play/pause/stop with start/end jumps. Keyframes drag along the lane and delete with a key. In-progress work autosaves to local storage and is offered back on the next visit, and an unload guard warns before you lose unsaved keyframes.
+
+### Preset and text-to-animation library
+
+A curated gallery of ready-made motion clips sits beside the timeline. Picking one retargets it onto the loaded rig and plays it live in the same viewport, then offers an animated-GLB export. The library also drives a text-to-animation path (`POST /api/forge-motion`), so you can describe a motion and get a clip retargeted onto your figure. While a preset previews, it owns the figure and the keyframe timeline yields, so the two never fight over bone transforms.
+
+### Export, save, and sell
+
+- **Clip JSON** serializes the keyframe document to a documented `{ name, duration, tracks }` shape.
+- **Animated GLB** bakes the document onto the live rig and exports the mesh with the clip embedded, so the motion plays anywhere the GLB is opened. This baked GLB is also the sellable artifact for a marketplace listing.
+- **Open in Scene Studio** stashes the baked GLB in IndexedDB and navigates to `/scene?handoff=1`, where you record it to video.
+- **Save to account** stores the clip through `/api/animations/clips` with a visibility of private, unlisted (anyone with the link), or public (listed in the gallery). Saved clips appear under "My animations".
+- **Sell for USDC.** Each saved clip has a Sell action that lists it in the animation marketplace; listed clips show a price badge in USDC, and your sales and earnings live under [/marketplace?tab=earn](https://three.ws/marketplace?tab=earn).
+
+## Walkthrough
+
+1. Open [/pose](https://three.ws/pose). The mannequin loads in a starting pose. Click "Load avatar" to pose one of your own instead, or keep the mannequin.
+2. Click the mannequin's forearm; the rotate gizmo appears. Drag it, or use the sliders, to bend the arm. Or switch to IK and drag the hand.
+3. Set the timeline's duration and FPS. With the playhead at 0, pose the figure and click "Add keyframe".
+4. Move the playhead forward, change the pose, and add another keyframe. Press play to watch it interpolate.
+5. Tune easing per keyframe, mirror or copy/paste poses, and refine.
+6. Export: download the animated GLB or clip JSON, click "Open in Scene Studio" to record video, or "Save" to keep it in your account.
+7. To monetize, open the saved clip in "My animations" and click Sell to list it for USDC.
+
+## Examples
+
+Deep links into the studio:
+
+- **Pose a specific avatar:** `https://three.ws/pose?avatar=<avatarId>`
+- **Animate a model by URL** (from the viewer's "Animate" funnel; trusted-host gated): `https://three.ws/pose?src=<glbUrl>&title=My%20model`
+- **Open a saved clip or a preset:** `https://three.ws/pose?anim=<clipUuidOrPresetName>`: a 36-char UUID opens your saved clip; anything else opens a built-in preset (auto-loading a rigged avatar to play it on).
+
+The account clip API the studio drives:
+
+```bash
+# List your clips, plus public ones.
+curl 'https://three.ws/api/animations/clips?include_public=true&limit=60' \
+ -H 'cookie: <session>'
+
+# Create a clip from a serialized keyframe document.
+curl -X POST 'https://three.ws/api/animations/clips' \
+ -H 'content-type: application/json' -H 'cookie: <session>' \
+ -d '{"name":"wave-loop","visibility":"public","clip":{ "name":"wave-loop","duration":2,"tracks":[] }}'
+```
+
+## States & limits
+
+- **IK requires limb chains.** On rigs without recognizable arm/leg chains the IK mode disables itself; FK posing always works.
+- **Presets need a rigged figure.** Deep-linking straight to an animation with no avatar chosen auto-loads a built-in rigged avatar (deterministically picked from the clip id) so the motion has a body to play on.
+- **Autosave is local, not the account.** Posing and keyframing never touch your account until you explicitly Save. The autosave draft lives in local storage and is offered back next session; an unload guard warns while work is unsaved.
+- **Saving and selling need an account.** Export and download are open to everyone; saving to the library and listing for sale require sign-in.
+- **The sellable artifact is the baked GLB.** A marketplace listing sells the baked animated GLB, so the buyer gets a self-contained, playable file.
+- **Mannequin-only controls.** Build, skin color, and joint constraints apply to the primitive mannequin; on a loaded GLB avatar those controls are disabled.
+
+## Related
+
+- [Animations reference](./animations.md): the runtime clip registry, formats, and agent slots.
+- [3D asset pipeline](./3d-asset-pipeline.md): how GLB, FBX, and clip JSON convert across the platform.
+- [Scene Studio](./scene-studio.md): record your animation to video.
+- [Avatar Studio](./avatar-studio.md): build the avatar you animate here.
+- [/marketplace](https://three.ws/marketplace): where listed animation clips are bought and sold.
+
+---
+
+<a id="sec-074"></a>
> **Source:** `docs/animations.md` · [↑ table of contents](#table-of-contents)
# Animations
+Animations are the motion clips (idle, wave, dance, and about 2,000 more) that bring three.ws avatars to life. Browse and preview every clip at [three.ws/animations](https://three.ws/animations); this page is the developer reference for how the clip collections are organized, how the runtime loads them, and how agents pick which clip to play.
+
> For how FBX, GLB, and clip JSON relate — the formats, the conversions, and the full generate→rig→animate→export chain — see **[docs/3d-asset-pipeline.md](3d-asset-pipeline.md)**. This page is the runtime registry and agent-slot reference.
The full machine-readable registry is at [`public/animations/registry.json`](../public/animations/registry.json). Read it first before touching anything animation-related — it catalogues every animation asset in the project, which pipeline owns it, and its current status.
@@ -15338,6 +16361,7 @@ Slots are the fixed vocabulary the agent avatar uses to express emotion/gesture.
| `point` | `reaction` | |
| `shrug` | `defeated` | |
| `fidget` | `av-waiting` | Real baked idle-fidget loop (was the never-baked `Fidget`, fixed 2026-07-08) |
+| `dance` | `rumba` | |
Agents can override individual slots via `meta.edits.animations`.
@@ -15357,14 +16381,23 @@ Agents can override individual slots via `meta.edits.animations`.
Resolved (see `public/animations/registry.json` → `resolved_issues`): the `fidget` slot no longer points at the never-baked `Fidget` clip — it maps to the real `av-waiting` loop (2026-07-08); and the 6 formerly-orphaned source FBX (`Cover To Stand`, `Goalkeeper Scoop`, `Jumping Down` ×3, `Removing Driver`) are now entries in `scripts/animations.config.json` and built into the manifest.
+## Related
+
+- [3D asset pipeline](/docs/3d-asset-pipeline): the full generate, rig, animate, export chain
+- [Animation Studio](/docs/animation-studio): author and preview clips in the browser
+- [3D Viewer](/docs/viewer): how clips play back in the viewer and embeds
+- [Clip Director](/docs/clip-director): gesture slots used for trade reaction cards
+
---
-<a id="sec-071"></a>
+<a id="sec-075"></a>
> **Source:** `docs/api-reference.md` · [↑ table of contents](#table-of-contents)
# REST API Reference
+This is the reference for the three.ws HTTP API: every documented endpoint, its parameters, and its response shape. Anyone can call the free endpoints with plain `curl` (no account needed); authenticated endpoints take an API key from the [Dashboard](https://three.ws/dashboard) or a browser session. If you are new, skim the Overview below, then jump to the section for the surface you are building on.
+
Base URL: `https://three.ws/api`
> For the in-browser JavaScript API (the `<agent-3d>` element, `Viewer`, `Runtime`, `SceneController`, skills, memory), see [js-api.md](./js-api.md) and [web-component.md](./web-component.md). For the high-level npm SDK, see [sdk.md](./sdk.md).
@@ -15387,15 +16420,17 @@ Session cookies (set after SIWE or Privy login) are accepted on all endpoints th
### Response format
-All responses are JSON. Successful responses return the resource or a result object. Errors return:
+All responses are JSON. Successful responses return the resource or a result object. Errors return a machine-readable code plus a human-readable description:
```json
{
- "error": "Message describing what went wrong",
- "code": "ERROR_CODE"
+ "error": "validation_error",
+ "error_description": "Message describing what went wrong"
}
```
+Some endpoints add extra fields (e.g. `retry_after` on rate limits). Error responses are never cached.
+
### Rate limits
| Tier | Limit |
@@ -15415,14 +16450,7 @@ Rate-limited responses return HTTP 429 with `{ "error": "...", "code": "RATE_LIM
GET /api/agents
```
-Returns the authenticated user's agents. Requires auth.
-
-**Query parameters**
-
-| Parameter | Type | Description |
-| --------- | ------- | ------------------------------ |
-| `limit` | integer | Max results (default: 20) |
-| `offset` | integer | Pagination offset (default: 0) |
+Returns all of the authenticated user's agents (oldest first, no pagination). Requires auth.
**Response**
@@ -15440,10 +16468,7 @@ Returns the authenticated user's agents. Requires auth.
"chain_id": 8453,
"chain_agent_id": 42
}
- ],
- "total": 5,
- "limit": 20,
- "offset": 0
+ ]
}
```
@@ -15491,12 +16516,11 @@ Requires auth.
}
```
-**Response**
+**Response** (`201`)
```json
{
- "id": "new-agent-id",
- "agent": {}
+ "agent": { "id": "new-agent-id", "name": "Aria" }
}
```
@@ -15596,16 +16620,7 @@ Resolves an agent by ENS name (e.g., `myagent.eth`). No auth required.
GET /api/widgets
```
-Requires auth. Returns the authenticated user's widgets, including joined avatar data.
-
-**Query parameters**
-
-| Parameter | Type | Description |
-| ---------- | ------- | ------------------------------ |
-| `limit` | integer | Max results (default: 20) |
-| `offset` | integer | Pagination offset (default: 0) |
-| `type` | string | Filter by widget type |
-| `agent_id` | string | Filter by agent ID |
+Requires auth (session cookie, or bearer token with `avatars:read`). Returns the authenticated user's widgets, newest-updated first (up to 500), including joined avatar data.
**Response**
@@ -15614,18 +16629,17 @@ Requires auth. Returns the authenticated user's widgets, including joined avatar
"widgets": [
{
"id": "wdgt_abc123def456",
- "agent_id": "abc123",
+ "avatar_id": "a1b2c3d4-...",
"type": "turntable",
- "config": { "auto_rotate_speed": 0.5, "preset": "venice" },
+ "name": "Product Hero",
+ "config": { "rotationSpeed": 0.5, "background": "#0a0a0a" },
"is_public": true,
- "created_at": "2025-01-15T10:00:00Z",
"view_count": 42,
+ "created_at": "2025-01-15T10:00:00Z",
+ "updated_at": "2025-01-15T10:00:00Z",
"avatar": {}
}
- ],
- "total": 8,
- "limit": 20,
- "offset": 0
+ ]
}
```
@@ -15651,32 +16665,40 @@ POST /api/widgets
Requires auth. Bearer token must have `avatars:write` scope.
-**Supported widget types:** `turntable`, `animation-gallery`, `talking-agent`, `passport`, `hotspot-tour`
+**Supported widget types:** `turntable`, `animation-gallery`, `talking-agent`, `passport`, `hotspot-tour`, plus the additional live types in the [Widget Studio](https://three.ws/studio) type grid (pump.fun feeds, bonding curve, walking avatar, and more).
**Request body**
```json
{
- "agent_id": "abc123",
+ "name": "Product Hero",
"type": "turntable",
+ "avatar_id": "a1b2c3d4-...",
"config": {
- "auto_rotate_speed": 0.5,
- "preset": "venice"
+ "rotationSpeed": 0.5,
+ "background": "#0a0a0a"
},
- "visibility": "public"
+ "is_public": true
}
```
-**Response**
+`name` is required; `avatar_id` is optional (must be an avatar you own, or a public one); `config` is validated against the type's schema ([src/widget-types.js](../src/widget-types.js)); `is_public` defaults to `true`.
+
+**Response** (`201`)
```json
{
- "id": "wdgt_abc123def456",
- "embed_url": "https://three.ws/widgets/view?id=wdgt_abc123def456"
+ "widget": {
+ "id": "wdgt_abc123def456",
+ "type": "turntable",
+ "name": "Product Hero",
+ "config": {},
+ "is_public": true
+ }
}
```
-Widget IDs use the format `wdgt_` + 12 random base64url characters.
+Widget IDs use the format `wdgt_` + 12 random base64url characters. The embed URL for a widget is `https://three.ws/widget#widget=<id>&kiosk=true`.
---
@@ -15704,25 +16726,24 @@ Requires auth. Owner only. Soft-deletes via `deleted_at` timestamp.
---
-### Open Graph metadata
+### Open Graph share card
```
GET /api/widgets/og?id=wdgt_abc123def456
+GET /api/widgets/:id/og
```
-Returns Open Graph metadata for a widget, used by social preview scrapers (Twitter, Slack, etc.). No auth required.
-
-**Response:** JSON with `og:title`, `og:description`, `og:image`, `og:url`.
+Returns the widget's 1200×630 share-card image (`image/svg+xml`), used as the `og:image` by social preview scrapers (Slack, Discord, X) and as the auto poster for `embed.js`. Both URL forms serve the same card. No auth required.
---
### oEmbed
```
-GET /api/widgets/oembed?url=https%3A%2F%2Fthree.ws%2Fwidgets%2Fview%3Fid%3Dwdgt_abc123
+GET /api/widgets/oembed?url=https%3A%2F%2Fthree.ws%2Fw%2Fwdgt_abc123
```
-oEmbed endpoint for rich embeds in Notion, Substack, and other oEmbed-compatible platforms. No auth required.
+oEmbed endpoint for rich embeds in Notion, Substack, and other oEmbed-compatible platforms. Accepted `url` forms: `/w/<id>` (canonical), `/widget#widget=<id>`, and the legacy `/app#widget=<id>` and `/#widget=<id>`. No auth required.
**Response:** oEmbed JSON with `type`, `html`, `width`, `height`, `title`, `provider_name`.
@@ -16080,6 +17101,15 @@ silently.
Poll with `GET /api/forge?job=<job>` — it returns `{ status: "queued" | "done" | "failed", glb_url? }`.
+A generation that fails mid-flight on one engine is automatically re-dispatched
+to the next configured free lane (up to 3 backups); the poll keeps reporting
+`status: "running"` with the new `backend` plus a `failover_from` field, so the
+switch is visible but never terminal. Only when every automatic lane is
+exhausted does the poll return `status: "failed"` — and when other configured
+engines could still serve a fresh retry, it carries `retryable: true` and
+`retry_backends: ["huggingface", …]` so a client can resubmit the same request
+with an explicit `backend` instead of dead-ending.
+
**Example**
```bash
@@ -16122,20 +17152,30 @@ content-safety gate before any GPU work starts.
**Response, finished inline**
```json
-{ "status": "done", "glbUrl": "https://cdn.three.ws/forge/anon/<id>.glb", "viewerUrl": "https://three.ws/viewer?src=…", "format": "glb" }
+{ "status": "done", "glbUrl": "https://cdn.three.ws/forge/anon/<id>.glb", "viewerUrl": "https://three.ws/viewer?src=…", "arUrl": "https://three.ws/api/ar?src=…&title=a%20small%20ceramic%20robot%20figurine", "format": "glb" }
```
+`arUrl` is the place-in-your-room link (`GET /api/ar`, documented below):
+opened on a phone it launches AR directly — Scene Viewer on Android, Quick
+Look on iOS (the GLB converts to USDZ in-page) — and on desktop it falls back
+to the interactive viewer. The prompt rides along as `title` to label the AR
+page. This is the same lane the `/forge` and `/ar` pages use; surface it to
+end users as "place it in your room".
+
**Response, queued** (ChatGPT Actions time out at ~45s; the lane bounds its
synchronous hold to 30s, so a slow job always returns `pending` plus a poll
handle before the Action deadline)
```json
-{ "status": "pending", "job": "f1.<signed-token>", "poll": "/api/3d/studio?job=f1.<signed-token>", "format": "glb" }
+{ "status": "pending", "job": "f1.<signed-token>", "poll": "/api/3d/studio?job=f1.<signed-token>&title=a%20small%20ceramic%20robot%20figurine", "format": "glb" }
```
-Poll `GET /api/3d/studio?job=<id>` until `status` is `"done"` (same shape as
-above) or `"error"` (`{ "status": "error", "job", "error" }`; generation is
-free, so a failed job costs nothing to retry).
+Poll `GET /api/3d/studio?job=<id>&title=<label>` until `status` is `"done"`
+(same shape as above, `arUrl` included) or `"error"` (`{ "status": "error",
+"job", "error" }`; generation is free, so a failed job costs nothing to
+retry). `title` is optional — the pending response's `poll` path already
+carries it, so following that path verbatim keeps the finished AR page
+labeled with the prompt.
**Errors**
@@ -16147,6 +17187,179 @@ free, so a failed job costs nothing to retry).
| `502` | `generation_failed` | The lane could not start the job; retry is free |
| `503` | `not_configured` / `lane_timeout`| Lane unavailable on this deployment, or slow to accept; retry later |
+### Model quality gate — `POST /api/forge-quality-check`
+
+```
+GET /api/forge-quality-check → capability probe
+POST /api/forge-quality-check → score a model's realism / quality
+```
+
+Public, CORS-open, metered on the free vision buckets (sign in for a higher
+limit). Scores how photoreal and complete a generated 3D model is, so a bad
+result (a plastic toy, a melted blob, an incomplete or duplicated mesh) can be
+caught and regenerated before a user ever sees it. It renders the GLB, sends the
+render to **Vertex Gemini** (`gemini-2.5-flash`, GCP-credit-funded) with a
+subject-aware photoreal rubric, and returns a structured verdict. When Vertex is
+unconfigured it falls back to the free NVIDIA NIM vision lane; when no vision
+provider answers at all it **fails open** (`verdict.pass: true`,
+`verdict.qa_available: false`) so quality gating can never block a generation.
+
+**Request body** — supply exactly one of `glbUrl`, `renderUrl`, or `image`:
+
+```json
+{
+ "glbUrl": "https://cdn.three.ws/forge/anon/<id>.glb",
+ "prompt": "a medieval knight in full plate steel armor",
+ "subject": "person",
+ "tier": "standard",
+ "path": "image",
+ "attempt": 0
+}
+```
+
+- `glbUrl` — a public GLB, rendered here for scoring (preferred).
+- `renderUrl` — a public image URL of an existing render.
+- `image` — base64 or `data:` URI of a render.
+- `prompt` — the source generation request; steers the rubric and the retry hint.
+- `subject` — optional override (`person`, `animal`, `food`, `vehicle`, `plant`,
+ `building`, `object`); auto-detected from the prompt otherwise.
+- `tier` / `path` / `attempt` — optional; when present and the model fails the
+ gate, the response includes a ready-to-run `retry` directive.
+
+**Response**
+
+```json
+{
+ "verdict": {
+ "pass": false,
+ "score": 34,
+ "realism": 30,
+ "completeness": 45,
+ "subject": "person",
+ "is_photoreal": false,
+ "defects": ["plastic", "wrong_proportions"],
+ "reason": "The armor reads as flat plastic and the proportions are off.",
+ "suggested_retry_hint": "add realistic metal PBR materials and correct human proportions",
+ "provider": "vertex",
+ "model": "vertex-ai/gemini-2.5-flash",
+ "qa_available": true,
+ "render_source": "rendered_glb"
+ },
+ "retry": {
+ "prompt": "a medieval knight in full plate steel armor, photorealistic, real photograph, high detail, accurate proportions, realistic PBR materials. Avoid: plastic or toy-like materials.",
+ "tier": "standard",
+ "path": "image",
+ "attempt": 1,
+ "reason": "retry 1/2: The armor reads as flat plastic and the proportions are off."
+ }
+}
+```
+
+`score` is 0-100; the pass threshold is `FORGE_QUALITY_PASS_SCORE` (default 60),
+and any critical structural defect (blob, incomplete, duplicated, floating
+fragments) fails the gate regardless of score. `retry` is `null` when the model
+passes, when QA was unavailable (never retry on an outage), or when the retry cap
+(`FORGE_QUALITY_MAX_RETRIES`, default 2) is reached. The same logic is importable
+for server-side use as `runQualityGate` + `buildRetryDirective` from
+`api/_lib/forge-quality-gate.js` — the generation router uses it directly.
+
+#### Which generations are gated: `FORGE_QUALITY_GATE`
+
+`POST /api/forge` runs this gate automatically after producing a model. Two
+scorers stack: a **free deterministic** pass (`api/_lib/glb-quality.js`, reads the
+glTF JSON chunk: catches blobs, zero-volume and untextured meshes on **every**
+lane and reruns once) and the **vision** pass above (semantic: does it look like
+the prompt). `FORGE_QUALITY_GATE` chooses which lanes pay for the vision pass:
+
+| Value | Behavior |
+| --- | --- |
+| `adaptive` **(default)** | The paid **High** tier is always vision-scored. The **free Draft/Standard** lanes escalate to vision QA **only when the fast scorer can't vouch for the mesh** (a `low`/`degenerate`/untextured result, or an `ok` mesh below the `FORGE_QUALITY_ADAPTIVE_MIN` confidence score, default `0.6`). A clean, textured draft ships instantly with no vision latency, so the free lane gains a semantic quality floor without slowing the common case. |
+| `high` | Only the High tier is vision-scored; free lanes keep only the deterministic floor. |
+| `all` | Every tier is vision-scored unconditionally (no fast-scorer shortcut). |
+| `off` | No vision QA anywhere (the deterministic floor still runs). |
+
+On a failing verdict the router runs a bounded best-of retry
+(`FORGE_QUALITY_GATE_MAX_RETRIES`, default 1, clamped 0-2), keeping the
+higher-scoring result. The delivered generation carries a `quality` (deterministic)
+and, when scored, a `quality_gate` (vision verdict) field: the `/forge` result bar
+renders these as a **Verified NN% / Low NN% / Checked** confidence chip.
+
+**Errors**
+
+| Status | Code | Meaning |
+| ------ | ------------------- | ------------------------------------------------------------------------------ |
+| `400` | `bad_request` | None of `glbUrl` / `renderUrl` / `image` supplied, or malformed JSON |
+| `413` | `payload_too_large` | Request body over 20 MB |
+| `429` | `rate_limited` | Free vision quota spent; see `X-RateLimit-Reset` (sign in for a higher limit) |
+
+A provider or render outage does **not** error — it returns `200` with
+`verdict.qa_available: false`.
+
+### AR launch — `GET /api/ar`
+
+```
+GET /api/ar?src=<glbUrl>&title=<label>&kind=<avatar?>
+```
+
+Public, keyless. The device-aware place-in-your-room lane behind every `arUrl`
+the 3D endpoints return, and the same one the `/forge` and `/ar` pages use:
+
+- **Android** → `302` straight into Google Scene Viewer (ARCore `intent://`
+ URL with the GLB as the source and a browser fallback).
+- **iOS** → an HTML launch page; "View in your space" enters Apple Quick Look
+ (the GLB converts to USDZ in-page via the three.js `USDZExporter`).
+- **Desktop** → the same page, falling back to the interactive WebGL viewer.
+
+`src` must be a public `https` GLB/glTF URL; `title` (optional, ≤120 chars)
+labels the page; `kind=avatar` marks a rigged agent body and adds the
+"Bring it to life" handoff into `/irl` (camera passthrough, animation, and
+conversation in the user's room). Bad input returns a designed error page,
+never a crash. Pasting an `/api/ar` link into a chat app unfurls as a share
+card whose image is a real render of that exact model (see the renderer
+below).
+
+### Model renderer — `GET|POST /api/render/glb`
+
+```
+GET /api/render/glb?glbUrl=<url>&width=1200&height=630&background=%230a0a0a
+POST /api/render/glb { "glbUrl": "...", "width": 1024, "height": 1024, "background": "#0a0a0a" }
+```
+
+Public renderer: any public GLB URL in, a PNG out (headless chromium +
+`<model-viewer>`, the same pipeline the OG cards use). The GET form makes a
+render URL-addressable for `og:image` unfurls, `<img>` tags, and markdown
+embeds; responses CDN-cache for a day so crawlers hit chromium once per
+model. Dimensions clamp to 64-2048; GLBs over 10 MB are rejected before the
+browser boots; only public http(s) sources are fetched (SSRF-guarded);
+60 renders / 10 min / IP.
+
+### Forge-Off votes — `POST /api/forge-vote`
+
+```
+POST /api/forge-vote
+x-forge-client: <stable browser id>
+{ "creation_id": "<uuid>", "vote": true } # upvote (vote:false removes it)
+→ { "ok": true, "creation_id": "<uuid>", "vote_count": 5, "voted": true }
+```
+
+Auth-free community curation for the Forge showcase: one vote per browser (keyed
+to the same `forge:cid` id used for "Your creations"), idempotent, toggleable.
+`vote_count` is the fresh authoritative tally; `voted` is your own state. Only
+public, finished, non-rejected creations are votable (`404 not_votable`
+otherwise); a missing/shared client id is `400 no_client_id`. 120 votes /
+10 min / IP.
+
+Read the board through the community gallery:
+
+```
+GET /api/forge-gallery?scope=community&sort=top&window=week&limit=24
+x-forge-client: <stable browser id> # optional — resolves per-card `voted`
+```
+
+`sort=fresh` (default, newest-first) or `sort=top` (most-voted); `window=week`
+narrows Top to the current Forge-Off week (Monday→Monday UTC). Full feature
+docs: [docs/forge-off.md](./forge-off.md).
+
---
## Material Studio API
@@ -17260,7 +18473,7 @@ Authentication is covered in detail in the [Authentication documentation](authen
| `/api/auth/siwe/verify` | POST | Verify SIWE signature, create session |
| `/api/auth/session` | GET | Get current session |
| `/api/auth/session` | DELETE | Logout / destroy session |
-| `/api/auth/privy/[handler]` | GET/POST | Privy OAuth handlers |
+| `/api/auth/privy/verify` | POST | Verify a Privy auth token, create session |
| `/api/auth/wallets` | GET | List wallets linked to current user |
| `/api/auth/wallets` | POST | Link a new wallet |
@@ -17415,6 +18628,156 @@ Public directory of ERC-8004 agents with 3D avatars, for homepage and gallery us
---
+## Social & Community API
+
+The endpoints behind the platform's social layer: the activity feed, the follow graph, notifications, the unified leaderboard, creator portfolios, and cross-entity search. Overview and how the pieces interconnect: [The social layer](social-layer.md).
+
+### Activity feed
+
+```
+GET /api/users/me/feed
+```
+
+Reverse-chronological creation events (avatars, agents, coins, forged models, saved worlds) plus follow activity. Powers `/feed` and `/community`.
+
+**Query parameters**
+
+| Parameter | Type | Description |
+| --------- | ------- | --------------------------------------------------------------------------- |
+| `scope` | string | `following` (default; requires session, anonymous → 401) or `all` (public) |
+| `limit` | integer | 1..50 (default: 30) |
+| `before` | string | ISO timestamp cursor; pass the last item's `created_at` for the next page |
+
+**Response**
+
+```json
+{
+ "items": [
+ {
+ "kind": "model",
+ "id": "fc_abc123",
+ "created_at": "2026-07-12T10:00:00Z",
+ "actor": { "username": "nix", "display_name": "Nix", "avatar_url": "https://…" },
+ "title": "a bronze dragon statue",
+ "href": "/viewer?src=…",
+ "image": "https://…",
+ "isRemix": false
+ }
+ ]
+}
+```
+
+Items of `kind: "follow"` also carry a `target` shaped like `actor`. `actor.username` is `null` for creations made while signed out.
+
+Not the same endpoint as `GET /api/feed`, the public Money Pulse ticker ([Money Feed](money-feed.md)).
+
+---
+
+### Cross-entity search
+
+```
+GET /api/search
+```
+
+One query across avatars, on-chain/Solana agents, forged models, worlds, and coins. Public, rate-limited per IP.
+
+**Query parameters**
+
+| Parameter | Type | Description |
+| --------- | ------- | ------------------------------------------------------------------ |
+| `q` | string | Search text |
+| `type` | string | `all` (default), `avatar`, `agent`, `model`, `world`, or `coin` |
+| `limit` | integer | 4..48 (default: 18) |
+
+**Response:** `{ q, type, items: [...] }`. Sources are queried in parallel and merged; ranking is recency boosted by follower, remix, and view signals. Model items carry a `remix` block wired to `POST /api/x402/remix-asset`.
+
+---
+
+### Unified leaderboard
+
+```
+GET /api/leaderboard/unified
+```
+
+The cross-surface leaderboard behind `/rankings`. Public; sending a session cookie or Bearer token pins your own row into the response even when you rank outside the page window.
+
+**Query parameters**
+
+| Parameter | Type | Description |
+| --------- | ------- | ---------------------------------------------------------------------------------------- |
+| `metric` | string | `creations` (default), `remixes_received`, `launches`, `followers`, or `walk_distance` |
+| `limit` | integer | 1..100 (default: 50) |
+| `offset` | integer | Pagination offset |
+
+---
+
+### Follow / unfollow a user
+
+```
+GET /api/users/:username/follow
+POST /api/users/:username/follow
+DELETE /api/users/:username/follow
+```
+
+The social-graph edge for a public profile. GET is viewer-specific (never cached). POST and DELETE are idempotent, require a session + CSRF token, block self-follows (400), and return the same envelope as GET so one round-trip updates both the button and the counts. A genuinely new edge notifies the followed user exactly once.
+
+**Response (all three methods)**
+
+```json
+{
+ "following": true,
+ "followed_by": false,
+ "followers_count": 42,
+ "following_count": 7
+}
+```
+
+---
+
+### List followers / following
+
+```
+GET /api/users/:username/follows
+```
+
+**Query parameters**
+
+| Parameter | Type | Description |
+| --------- | ------- | --------------------------------------------- |
+| `type` | string | `followers` or `following` |
+| `limit` | integer | 1..100 |
+| `offset` | integer | Pagination offset |
+
+Each row carries `is_following` (does the signed-in viewer follow that row's user) for follow-back buttons.
+
+---
+
+### Creator portfolio
+
+```
+GET /api/users/:username
+GET /api/users/:username/creations
+```
+
+Public profile and the cursor-paginated portfolio of forged models and saved worlds attributed to that creator. Powers `/u/:username`.
+
+---
+
+### Notifications
+
+```
+GET /api/notifications?limit=…
+POST /api/notifications/:id/read
+POST /api/notifications/read-all
+POST /api/notifications/track
+GET /api/notifications/preferences
+PATCH /api/notifications/preferences
+```
+
+The bell inbox and its per-user preference matrix. Session required. Event types include `remix`, `dm_received`, `pump_launch_filled` (bonding-curve graduation), and `follow`. Preferences are a category × channel matrix: categories `sales`, `purchases`, `social`, `irl`, `market`, `account`; channels `in_app`, `push`, `email`, `telegram`. The `in_app` channel is always on and cannot be disabled.
+
+---
+
## IRL API — presence, pins, money drops, world lines
The real-world layer behind [three.ws/irl](https://three.ws/irl): place 3D agents at GPS
@@ -17449,6 +18812,7 @@ GET /api/irl/pins?lat=&lng=&radius= nearby agents (fix-gated, radius 10
GET /api/irl/pins?mine=1 your pins (signed-in session)
GET /api/irl/pins/mine your pins (x-irl-device token)
POST /api/irl/pins place an agent at a coordinate
+PATCH /api/irl/pins edit, calibrate, or resize a pin (owner-gated)
DELETE /api/irl/pins?id=<uuid> remove one pin
DELETE /api/irl/pins?all=1 purge every pin owned by the device token
```
@@ -17461,6 +18825,16 @@ The nearby feed returns an allow-list projection (never owner ids), coordinates
device pins lapse after 7 days. Errors: `fix_required` 401, `area_full` 429 (≤40 pins per
~150 m cell), `pin_limit` 429, `content` 422, `endpoint` 422.
+PATCH bodies (ownership = the signed-in owner, or the `x-irl-device` token that placed the
+pin; non-owners get 403):
+
+- `{ id, caption?, avatarUrl?, avatarName?, lat?, lng? }` edits pin fields (session auth).
+- `{ id, calibrate: { lat, lng, anchorYawDeg, anchorHeightM } }` corrects the anchor pose.
+- `{ id, scale }` persists the pinch-resized render scale from a WebXR placement session
+ (the pinch lands after the pin was saved on the placement tap, so the final size arrives
+ as this follow-up). `scale` is clamped to 0.25–4; `1` means natural size and is stored as
+ `NULL` (`anchor_scale`). Returns `{ pin: { id, anchor_scale } }`.
+
---
### Interactions — the real-world encounter log
@@ -17476,6 +18850,25 @@ pin's owner and agent are always taken from the pin, never the caller.
---
+### Shareable pin cards
+
+```
+POST /api/irl/share?pinId=<uuid> mint a permanent, unfurlable link for a placement
+GET /api/irl/share/:token the unfurl page itself (also served at /irl/s/:token)
+```
+
+`POST` body is the raw PNG bytes of a client-captured AR composite (`content-type:
+application/octet-stream`; the client sends octet-stream rather than `image/png` so the
+server's body-parser handles it byte-for-byte — see the `readBody()` note in
+`api/_lib/http.js`). Caller must own the pin (session or `x-irl-device`, same rule as PATCH)
+and the pin must be public and not under moderation review. Returns `{ token, url, imageUrl }`
+where `url` is `https://three.ws/irl/s/<token>`. The unfurl page renders the photo full-bleed
+with real `og:image`/`twitter:image` tags and a "Place your own agent" CTA back to `/irl` — it
+never renders a coordinate, only the pin's caption/agent name. Rate limit: 10 shares / 10 min
+per IP.
+
+---
+
### Money Drops — value escrowed at a real-world spot
```
@@ -17529,6 +18922,20 @@ hash — never a coordinate or raw device token. Anyone can re-verify a proof at
---
+### Analytics (admin)
+
+```
+GET /api/irl/analytics
+```
+
+Admin-gated (signed-in platform admin, or `x-ops-secret` — same rule as `/api/admin/ops-alerts`).
+Returns 24h/7d/30d windows of `{ pins_placed, unique_placers, nearby_fetches, unique_browsers,
+interactions, shares_created, share_views, drops_claimed }`, a 30-day placement-method
+breakdown, and a 30-day daily series for the `/admin/irl-analytics` dashboard. Backed by
+`irl_events` — see `docs/irl.md#analytics`.
+
+---
+
## ERC-8004 API
### Resolve on-chain agent
@@ -17594,6 +19001,8 @@ Model Context Protocol endpoint — exposes three.ws as a JSON-RPC 2.0 tool serv
`render_avatar` enforces the agent's embed policy (allowed origins, allowed surfaces). Model URLs must be HTTPS — SSRF protections block private IP ranges.
+This table is the core subset. The server registers many more tools (minting, gated embeds, memory, oracle and pump.fun intel, trader analytics, crypto data). Call `tools/list`, or see the [MCP documentation](mcp.md) and the [MCP Tools Catalog](mcp-tools.md).
+
**Example JSON-RPC request**
```json
@@ -18468,63 +19877,105 @@ Returns public platform configuration. No auth required. CORS open.
---
-## Pagination
+## Version API
-All list endpoints use offset pagination unless noted otherwise.
+```
+GET /api/version
+```
+
+Deployment traceability: which commit is live, and on which Cloud Run revision. No auth required. CORS open. Short-cached (10s) so a new deploy shows up promptly. The commit fields are stamped into the image at build time (`dist/build-info.json`, written by `scripts/write-build-info.mjs`); the runtime fields come from the Cloud Run platform env, so no deploy-time injection is needed.
+
+**Response**
+```json
+{
+ "status": "ok",
+ "version": "1.5.2",
+ "commit": "83368639e0a1b2c3d4e5f6...",
+ "commitShort": "83368639e",
+ "commitSubject": "feat(forge): auto-classify creations into categories",
+ "commitTime": "2026-07-17T20:38:22Z",
+ "branch": "main",
+ "dirty": false,
+ "builtAt": "2026-07-17T21:05:00.000Z",
+ "stamped": true,
+ "runtime": {
+ "service": "three-ws-api",
+ "revision": "three-ws-api-00171-g5p",
+ "configuration": "three-ws-api",
+ "region": null,
+ "node": "v24.0.0",
+ "uptimeMs": 123456
+ }
+}
```
-GET /api/agents?limit=20&offset=40
+
+`stamped` is `false` when the running image carries no build stamp (e.g. a build that skipped `build:info`); the commit fields are then best-effort from env. Use this to verify a deploy landed:
+
+```bash
+curl -s https://three.ws/api/version | jq '{commitShort, revision: .runtime.revision}'
```
-Responses always include `total`, `limit`, and `offset`.
+The same stamp is served statically at `/build-info.json`.
+
+---
+
+## Pagination
+
+Paginated list endpoints use `limit`/`offset` query parameters unless noted otherwise (each endpoint's own parameter table is authoritative; some small per-user lists, like `/api/agents` and `/api/widgets`, return everything with no pagination).
-`/api/explore` and `/api/showcase` use keyset (cursor-based) pagination for stability — pass the returned `cursor` value as the `cursor` query parameter on the next request.
+```
+GET /api/v1/pump/launches?limit=24&offset=24
+```
+
+`/api/explore` and `/api/showcase` use keyset (cursor-based) pagination for stability: pass the returned `cursor` value as the `cursor` query parameter on the next request. `/api/agent-actions` and `/api/users/me/feed` are cursor-based too (`cursor` / `before` timestamps).
---
## Error codes
-| Code | HTTP Status | Description |
-| --------------------- | ----------- | -------------------------------------------- |
-| `UNAUTHORIZED` | 401 | Missing or invalid auth |
-| `FORBIDDEN` | 403 | Authenticated but not allowed |
-| `NOT_FOUND` | 404 | Resource doesn't exist |
-| `RATE_LIMITED` | 429 | Too many requests |
-| `INVALID_INPUT` | 400 | Request body validation failed |
-| `AGENT_NOT_FOUND` | 404 | Agent ID not found |
-| `WIDGET_NOT_FOUND` | 404 | Widget ID not found |
-| `CHAIN_NOT_SUPPORTED` | 400 | chainId not in supported list |
-| `IPFS_FAILED` | 503 | IPFS pinning service unavailable |
-| `LLM_ERROR` | 502 | LLM provider returned an error |
-| `TTS_LIMIT_EXCEEDED` | 429 | Character limit for TTS exceeded |
-| `QUOTA_EXCEEDED` | 429 | Agent's monthly token budget exhausted |
-| `EMBED_POLICY_DENIED` | 403 | Request origin blocked by agent embed policy |
+Codes are lowercase snake_case in the `error` field. The common ones, shared across endpoints:
+
+| Code | HTTP Status | Description |
+| -------------------- | ----------- | ----------------------------------------------- |
+| `unauthorized` | 401 | Missing or invalid auth |
+| `forbidden` | 403 | Authenticated but not allowed |
+| `insufficient_scope` | 403 | Bearer token lacks the required scope |
+| `not_found` | 404 | Resource doesn't exist |
+| `rate_limited` | 429 | Too many requests (see `retry_after`) |
+| `validation_error` | 400 | Request body or query validation failed |
+| `not_configured` | 503 | A required provider/env is unset on this deploy |
+| `upstream_error` | 502 | A third-party upstream returned an error |
+
+Endpoint-specific codes (e.g. `quota_exceeded`, `invalid_avatar`, `no_client_id`) are documented in each endpoint's Errors table above.
---
## SDK
-Use the official SDK instead of raw HTTP calls:
-
-```js
-import { AgentAPI } from '@three-ws/sdk';
+For building on the platform from JavaScript, the official npm package is [`@three-ws/sdk`](https://www.npmjs.com/package/@three-ws/sdk). It is not a thin wrapper over every REST route above; it ships the higher-level building blocks: `AgentKit` (chat panel + ERC-8004 registration + `.well-known` manifest generation), `AgentClient` (x402 agent-to-agent paid skill calls), `PermissionsClient` (ERC-7710 delegations), and the Solana identity/attestation helpers. Full docs: [SDK & Library](sdk.md).
-const api = new AgentAPI({ apiKey: 'sk_live_xxxxx' });
+For the endpoints on this page, call them directly with `fetch`/`curl` and a Bearer API key:
-const agents = await api.agents.list({ limit: 10 });
-const agent = await api.agents.get('abc123');
-const widget = await api.widgets.create({
- agentId: 'abc123',
- type: 'turntable',
- config: { auto_rotate_speed: 0.5, preset: 'venice' },
+```js
+const res = await fetch('https://three.ws/api/agents?limit=10', {
+ headers: { Authorization: 'Bearer sk_live_xxxxx' },
});
+const { agents } = await res.json();
```
-The SDK handles auth headers, retries on 429, and TypeScript types for all request/response shapes.
+---
+
+## Related
+
+- [SDK & Library](/docs/sdk): the npm packages and the web component bundle
+- [MCP documentation](/docs/mcp): the same platform surface as MCP tools
+- [x402](/docs/x402): how the paid `/api/x402/*` endpoints settle in USDC
+- [Authentication](/docs/authentication): SIWE, sessions, API keys, and scopes
---
-<a id="sec-072"></a>
+<a id="sec-076"></a>
> **Source:** `docs/api/forge-x402.md` · [↑ table of contents](#table-of-contents)
@@ -18642,7 +20093,111 @@ for (;;) {
---
-<a id="sec-073"></a>
+<a id="sec-077"></a>
+
+> **Source:** `docs/ar-studio.md` · [↑ table of contents](#table-of-contents)
+
+# AR Studio: place many models in your real space, together
+
+AR Studio turns your camera view into an infinite canvas. Place as many 3D models and avatars as you like into the room around you, drawn from your own forges, the community gallery, a pasted GLB link, or brand-new ones forged from a text prompt without leaving the scene. It scales from full WebXR immersive AR down to camera passthrough down to a desktop 3D preview, and it can go multiplayer: open a shared room and everyone in it builds the same scene live. Share an arrangement with a link, or hand it to your phone with a QR code.
+
+Page: [/ar/studio](https://three.ws/ar/studio)
+API: `POST /api/forge` (in-view text-to-3D) · `GET /api/forge-gallery` (your and community models). Multiplayer runs on a Colyseus room, `studio_world`.
+
+## Why it exists
+
+The older "View in AR" flow (see [AR and WebXR](./ar.md)) shows one model at a time in a native viewer. AR Studio is the composition tool: a persistent, multi-model scene you arrange in real space and can build with other people at once. It is free, needs no account, and degrades gracefully so it works on a laptop, a phone browser, or a full AR headset. It is where a forge result, a marketplace avatar, and a prompt-conjured prop can all stand in your living room together.
+
+This doc covers what is unique to AR Studio. For the underlying `POST /api/forge` free lane, the `<agent-3d>` "View in AR" methods, the USDZ/Quick Look pipeline, and model-optimization limits, see [AR and WebXR](./ar.md).
+
+## How it works
+
+The page ([`pages/ar-studio.html`](../pages/ar-studio.html)) only imports [`src/ar-studio.js`](../src/ar-studio.js) after a WebGL check. Scene math, serialization, and the share hash live in [`src/ar/studio-scene.js`](../src/ar/studio-scene.js); the Colyseus client is [`src/ar/studio-net.js`](../src/ar/studio-net.js); WebXR multi-placement is [`src/ar/multi-place.js`](../src/ar/multi-place.js).
+
+### Model sources
+
+`addModel({ src, title })` normalizes the URL (https or site-relative only), enforces a 20-model cap, clones the loaded template (using SkeletonUtils for skinned rigs), and drops it on the floor in front of the camera. The "Add models" tray has four tabs:
+
+- **Recent forges**: read from local storage (`twx_ar_forge_recent`), shared with `/ar` so one forge history opens in two doors.
+- **Yours**: `GET /api/forge-gallery?limit=24` with an `x-forge-client` header (your anonymous browser id).
+- **Community**: `GET /api/forge-gallery?scope=community&limit=24`.
+- **GLB link**: paste any https `.glb`: a forge result, a viewer share link's `src`, or your own hosting.
+
+A fifth source is the **in-view forge**: the dock form calls `POST /api/forge` with `{ prompt, backend: 'nvidia' }` (the free NVIDIA NIM / TRELLIS lane), polls `GET /api/forge?job=<id>` until the GLB is ready, remembers it, and drops it into the scene. A sixth is deep links: repeatable `?src=` (paired with `?title=`) and `?forge=<prompt>` boot content on open.
+
+### Device-capability ladder
+
+Best available mode wins:
+
+1. **WebXR immersive AR**: offered only when `navigator.xr.isSessionSupported('immersive-ar')` resolves true. The session requests `hit-test` (required) plus `anchors`, `local-floor`, `depth-sensing`, and `light-estimation`, with a DOM-overlay HUD. Each placed model gets an `XRAnchor`, and an always-armed reticle does tap-to-place.
+2. **Camera passthrough**: `getUserMedia({ video: { facingMode: { ideal: 'environment' } } })` becomes the background layer, with gyroscope world-lock look (DeviceOrientation, iOS permission-gated) and live light matching. Offered when `getUserMedia` exists.
+3. **Desktop 3D preview**: always available: a grid floor, drag-look, and a "Phone" QR handoff on non-touch devices.
+
+If WebGL is missing, the page never loads the module and shows a fallback linking to `/ar` and `/viewer`.
+
+### Gestures
+
+Tap to select (tap empty space to deselect), drag to move a model you own along the floor, drag empty space to look around, pinch to resize (clamped 0.25x to 4x), and twist with two fingers to rotate. A selection toolbar offers rotate (+45 degrees), duplicate, and remove; desktop keyboard shortcuts nudge with arrows, rotate with R, duplicate with D, and remove with Delete (all undoable).
+
+### Shared live rooms
+
+Rooms run on the same Colyseus server as the other multiplayer surfaces, in a room named `studio_world` ([`multiplayer/src/rooms/StudioRoom.js`](../multiplayer/src/rooms/StudioRoom.js)), filtered by a 6-character room code. "Create a room" seeds the current scene as the starting point; joining via a `?room=CODE` link does not seed. Model transforms travel in a shared logical frame (east/north metres, yaw degrees) so every device maps them onto its own floor. Clients send `model:spawn`, `model:update` (throttled ~12 Hz), and `model:remove`; the server syncs a `StudioState` of models and viewers. Edits are owner-gated (you can only move your own models), models stay when their author leaves, and the server enforces per-room and per-owner caps plus a rate limit. A presence pill shows "N here, M models."
+
+### Share via `#s=` hash
+
+The full arrangement (every model's source and transform) is serialized to JSON, base64url-encoded, and put in the URL fragment as `#s=<hash>`. `studioSceneUrl()` builds a link that carries both a plain `?src=` list (reopens the same models, capped to 4) and the `#s=` hash (carries the exact arrangement), falling back to the `?src=` list if the hash would exceed ~1500 chars. On open, a `#s=` hash is treated as a full document and replaces the working scene; malformed input degrades to an empty scene rather than throwing. The QR modal encodes this URL so your phone opens straight into camera AR with your models placed.
+
+## Walkthrough
+
+1. Open [/ar/studio](https://three.ws/ar/studio). On the empty card, choose Start camera, Browse models, or Forge one.
+2. Add models: open the tray and pick from Recent, Yours, or Community, or paste a GLB link. Or type a prompt in the dock ("a neon bonsai tree") and press Forge to generate one in place.
+3. Arrange: drag to move, pinch to resize, twist to rotate. On a phone, tap Start camera to see them in your room; on a headset, tap the Immersive button for full AR.
+4. Go multiplayer: create a room and share the code (or the link). Others join and see and place models live.
+5. Share: use the QR button to continue on your phone, or copy the scene URL (it carries the arrangement in `#s=`).
+
+## Examples
+
+The two HTTP endpoints AR Studio uses are the free, no-auth forge lanes. Your anonymous browser id goes in `x-forge-client`.
+
+```bash
+# Forge a model from a prompt (the in-view forge; free NVIDIA NIM lane).
+curl -X POST 'https://three.ws/api/forge' \
+ -H 'content-type: application/json' \
+ -H 'x-forge-client: <ANON_CLIENT_ID>' \
+ -d '{ "prompt": "a neon bonsai tree", "backend": "nvidia" }'
+# -> { "job_id": "…", "status": "queued" } (or { "status": "done", "glb_url": "…" })
+
+# Poll the forge job until the GLB is ready.
+curl -H 'x-forge-client: <ANON_CLIENT_ID>' 'https://three.ws/api/forge?job=<JOB_ID>'
+# -> { "status": "done", "glb_url": "https://…/model.glb" }
+
+# List your forge gallery (Yours tab) or the community showcase.
+curl -H 'x-forge-client: <ANON_CLIENT_ID>' 'https://three.ws/api/forge-gallery?limit=24'
+curl 'https://three.ws/api/forge-gallery?scope=community&limit=24'
+# -> { "creations": [ { "glb_url": "…", "prompt": "…", "preview_image_url": "…" } ] }
+```
+
+You can also hand-build a share link: append `?src=<https glb url>&title=<name>` (repeatable) to `https://three.ws/ar/studio` to open with those models placed.
+
+## States and limits
+
+- **No auth, fully free.** Identity is an anonymous per-browser id (`forge:cid`), shared with `/forge` and `/creations`; it scopes the Yours tab, attributes in-studio forges, and keys room ownership. No sign-in, no wallet, no payment.
+- **Placement caps.** 20 models per local scene; the shared room enforces its own per-room and per-owner caps and a per-client rate limit.
+- **Camera and motion.** Camera denial (`NotAllowedError`) shows "Camera permission is blocked... then try again"; no `getUserMedia` disables the camera button but keeps the 3D preview. Denied motion falls back to drag-look.
+- **XR unsupported.** The Immersive button simply never appears; a failed XR start shows "Camera mode still works." Lost tracking prompts you to move to a brighter, more textured spot.
+- **Rooms offline.** With no multiplayer server configured (production default when unset), the studio stays single-player: "Shared rooms are offline right now, you can still build solo." Departing authors' models remain until the room empties.
+- **Persistence.** Your own placed models are saved to local storage (`twx_ar_studio_scene_v1`); `#s=` links replace the working scene. Photo capture composites the camera and WebGL layers to a PNG.
+- **Forge failures.** `503`/unconfigured shows "The generator is offline"; `429` shows a busy message with a retry hint.
+
+## Related
+
+- [AR and WebXR](./ar.md): the single-model "View in AR" system, `/ar` AR Forge, the `POST /api/forge` free lane in depth, the USDZ/Quick Look pipeline, and model-optimization limits.
+- [Selfie to Avatar](./selfie-to-avatar.md) and [Avatar pipeline](./avatar-pipeline.md): where the models you place come from.
+- Pages: [/ar/studio](https://three.ws/ar/studio), [/ar](https://three.ws/ar), [/viewer](https://three.ws/viewer).
+
+---
+
+<a id="sec-078"></a>
> **Source:** `docs/ar.md` · [↑ table of contents](#table-of-contents)
@@ -18670,7 +20225,7 @@ three.ws selects the right AR method automatically based on the device and brows
| **Android Scene Viewer** | Android Chrome | ARCore intent URL | ARCore (auto-prompts) |
| **WebXR immersive-ar** | Chrome on Android, Safari 15.4+ | `navigator.xr` session | No |
-**Selection order:** Quick Look → Scene Viewer → WebXR. Quick Look fires first on iOS because it's the most reliable. Scene Viewer fires first on Android because it works without a runtime XR session setup. WebXR is the fallback — and the only method that keeps the agent live in-page.
+**Selection order:** the AR surfaces configure model-viewer with `ar-modes="webxr scene-viewer quick-look"`, so the first mode the device actually supports wins: WebXR where available (Android Chrome with ARCore), then Scene Viewer, then Quick Look. On iOS Safari, WebXR is off by default, so Quick Look is what fires in practice. WebXR is the only method that keeps the agent live in-page. The `/api/ar` launcher additionally 302-redirects plain Android model requests straight into the Scene Viewer intent (avatars get the launch page instead, so the living `/irl` path stays visible).
---
@@ -18679,7 +20234,7 @@ three.ws selects the right AR method automatically based on the device and brows
| | Quick Look | Scene Viewer | WebXR |
|---|---|---|---|
| Platform | iOS Safari | Android Chrome | Any WebXR browser |
-| Animations | No — static pose | Yes | Yes |
+| Animations | Baked idle clip (static pose only if the bake fails) | Yes | Yes |
| Agent conversation | No | No | Yes — mic + chat live |
| `lookAt('user')` | No | No | Yes — tracks XR camera |
| Agent skills / tools | No | No | Yes — full runtime |
@@ -18687,29 +20242,22 @@ three.ws selects the right AR method automatically based on the device and brows
| Draco-compressed GLBs | May fail | May fail | Yes |
| Max practical size | ~15 MB | ~20 MB | No hard limit |
-WebXR is the only method where the agent stays fully alive. If you need conversation, skills, or animations, WebXR is required.
+WebXR is the only method where the agent stays fully alive. Quick Look now ships with a baked idle loop, but if you need conversation, skills, or live animation switching, WebXR is required.
---
-## Enabling AR on your agent
+## Enabling AR for your model or agent
-Add the `ar` attribute to `<agent-3d>`:
-
-```html
-<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
-
-<agent-3d
- id="your-agent-id"
- ar
-></agent-3d>
-```
+You do not add an attribute to enable AR; you link to (or embed) one of the AR surfaces, all of which detect the device and pick the right AR method automatically:
-The AR button appears automatically when:
-- The `ar` attribute is present
-- The device/browser supports at least one AR method
-- The model has finished loading
+| Surface | URL | Best for |
+|---|---|---|
+| One-tap AR launcher | `/api/ar?src=<glbUrl>&title=<name>` | Any public GLB; see [the full section below](#one-tap-ar-for-any-glb--get-apiar--export_ar) |
+| Avatar AR page | `/avatars/<id>/ar` | Any saved three.ws avatar |
+| AR Forge | `/ar` | Generate a model from a prompt and place it immediately |
+| Living-agent AR | `/irl?avatar=<glbUrl>` | A rigged avatar that walks and talks in your room (WebXR) |
-On desktop, the button is hidden — no desktop browser supports `immersive-ar`.
+The avatar AR page and the `/api/ar` launch page render the model in Google's `<model-viewer>` element with `ar ar-modes="webxr scene-viewer quick-look"`, so the same page covers Quick Look, Scene Viewer, and WebXR. The **Place in your space** button appears only when the device exposes a usable AR mode (model-viewer's `canActivateAR`); on desktop the page shows a QR code handoff instead.
### Allow XR in iframes
@@ -18728,51 +20276,47 @@ Without `xr-spatial-tracking`, the browser blocks `navigator.xr` inside the fram
## Programmatic API
+On pages that render the model with `<model-viewer>` (the avatar AR page at `/avatars/<id>/ar`, the `/api/ar` launch page, Forge results), AR is driven through model-viewer's API. This is exactly what [src/ar-page.js](../src/ar-page.js) does:
+
```js
-const el = document.querySelector('agent-3d');
+const viewer = document.querySelector('model-viewer');
-// Check if AR is available on this device
-if (el.canActivateAR) {
- // Launch AR (picks the best available method automatically)
- await el.activateAR();
+// canActivateAR is true only when the device exposes a usable AR mode
+// (Quick Look, Scene Viewer, or WebXR) and the model is loaded.
+if (viewer.canActivateAR) {
+ viewer.activateAR(); // picks the best available method automatically
}
-```
-
-`canActivateAR` is `true` when:
-- The model is fully loaded
-- At least one of Quick Look, Scene Viewer, or WebXR is available
-
-`activateAR()` is async — it awaits the session setup for WebXR; Quick Look and Scene Viewer return immediately.
-```js
// Listen for AR session events
-el.addEventListener('ar-status', (e) => {
+viewer.addEventListener('ar-status', (e) => {
// e.detail.status: 'session-started' | 'object-placed' | 'failed' | 'not-presenting'
console.log('AR status:', e.detail.status);
});
```
+For a custom viewer without model-viewer, use the three.ws launcher modules directly; see [Using AR without model-viewer](#using-ar-without-model-viewer) below.
+
---
## iOS Quick Look — deep dive
-Safari intercepts clicks on `<a rel="ar">` and opens the native AR viewer. The three.ws implementation in `src/ar/quick-look.js`:
+Safari intercepts clicks on `<a rel="ar">` and opens the native AR viewer. The three.ws implementation in `src/ar/quick-look.js` (simplified; the real module also keeps the anchor in the DOM to receive Quick Look banner-tap events):
```js
-function openQuickLook(modelURI) {
+export function openQuickLook(usdzURI, { onBannerTap } = {}) {
const a = document.createElement('a');
a.rel = 'ar';
- a.href = modelURI;
+ a.href = usdzURI;
a.appendChild(document.createElement('img')); // required for programmatic click
- document.body.appendChild(a);
+ a.style.cssText = 'position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;';
+ document.body.appendChild(a); // stays in the DOM while the viewer is open
a.click();
- document.body.removeChild(a);
}
```
-The child `<img>` element is required — without it, Safari won't intercept a programmatic `.click()` as a Quick Look trigger. This is a documented WebKit quirk.
+The child `<img>` element is required: without it, Safari won't intercept a programmatic `.click()` as a Quick Look trigger. This is a documented WebKit quirk. The anchor must remain in the DOM while the viewer is open: Safari delivers the banner-tap `message` event on the anchor that launched the session.
-**USDZ on iOS:** iOS 13+ accepts GLB files directly via the `href`. For earlier devices or for Apple's richest AR features (like custom banners and item purchasing), three.ws can pre-generate a USDZ companion file stored on R2. If a `usdz_url` exists on the avatar record, it's used as `ios-src`; otherwise the GLB-to-USDZ conversion runs in-browser via the three.js `USDZExporter` before Quick Look opens.
+**USDZ on iOS:** Quick Look wants USDZ, so three.ws always hands it one. If a `usdz_url` exists on the avatar record (a pre-generated companion stored on R2), it's used as `ios-src`; otherwise the GLB-to-USDZ conversion runs in-browser (three.js `USDZExporter`, or the animated bake described below) before Quick Look opens.
**Requirements:**
- iOS 13+ with Safari (Chrome on iOS uses WebKit but lacks Quick Look integration)
@@ -18780,7 +20324,9 @@ The child `<img>` element is required — without it, Safari won't intercept a p
- No DRM-protected assets
**Limitations:**
-- Static pose only — animations don't play
+- Only the one baked clip plays (the idle loop): Quick Look can't switch
+ animations or react, and if the bake fails the model falls back to a static
+ pose (see the USDZ pipeline below)
- No conversation (native OS viewer, outside the browser context)
- Cannot customize the Quick Look UI beyond the model itself
@@ -18865,11 +20411,14 @@ navigator.xr.isSessionSupported('immersive-ar')
For avatars on three.ws, the USDZ is handled automatically:
1. **Pre-generated USDZ:** If the avatar record has a `usdz_url`, it's set as `ios-src` immediately — no conversion needed.
-2. **In-browser conversion:** If not, the AR page downloads the GLB and runs `USDZExporter` from three.js in a Web Worker, then creates a `blob:` URL. This typically takes 2–8 seconds depending on model complexity.
-3. **Persistent storage:** After the first conversion, the USDZ is uploaded to R2 and saved back to the avatar record so subsequent AR visits are instant.
+2. **In-browser animated bake:** If not, the page downloads the GLB and bakes an *animated* USDZ via [src/usdz-animated.js](../src/usdz-animated.js) (`glbBlobToAnimatedUsdzBlob`): the avatar is driven through its idle clip, the skinned vertices are sampled at keyframes, and the samples are written into the USDA as time-sampled points that Quick Look loops natively. So a rigged avatar breathes and idles in your room instead of standing in a frozen pose. This runs inline (a dynamic import, not a Web Worker) and typically takes a few seconds depending on model complexity.
+3. **Static fallback:** Any bake failure (no rig, no usable clip) falls back to the plain `USDZExporter` path in [src/usdz-pipeline.js](../src/usdz-pipeline.js), which produces a static frame-0 pose. AR never regresses below static.
+4. **Persistent storage (opt-in):** The AR page's in-browser conversion lives only for that visit (an object URL). Durable USDZ companions come from `generateAndSaveCompanions()` in [src/account.js](../src/account.js), which bakes the animated USDZ, uploads it via `POST /api/avatars/presign-usdz`, and saves `usdz_url` on the avatar record so later AR visits skip the conversion. Companion generation is opt-in per save (`generateCompanions: true`; the `/demos/usdz-ar` demo page enables it) because the bake costs several seconds of client CPU.
+
+The same animated bake serves the `/irl` Place-in-AR button and the `/avatars/:id/ar` page ([src/ar-page.js](../src/ar-page.js)).
**USDZ limitations to know:**
-- Skinned meshes (rigged avatars) export to USDZ as static poses — animations are lost
+- Quick Look plays exactly one baked clip; the full animation library and live retargeting need WebXR
- Draco-compressed geometry must be decompressed first (the exporter handles this)
- USDZ files over ~30 MB may fail to open in Quick Look on older devices
@@ -18953,22 +20502,18 @@ Chrome on desktop (127+) has a WebXR device simulator under DevTools → More To
### AR button doesn't appear on mobile
-**Check 1 — `ar` attribute is set:**
-```html
-<agent-3d id="..." ar></agent-3d>
-```
-
-**Check 2 — browser supports AR:**
+**Check 1: browser supports AR**
- iOS: Must be Safari, not Chrome or Firefox
- Android: Must be Chrome (or Chromium) with ARCore installed
-**Check 3 — model is loaded:**
-The AR button is hidden until the model finishes loading. Watch for the `load` event:
+**Check 2: model is loaded**
+The **Place in your space** button is disabled until the model finishes loading. On a model-viewer page, watch for the `load` event:
```js
-el.addEventListener('load', () => console.log('model loaded, AR should be available'));
+document.querySelector('model-viewer')
+ .addEventListener('load', () => console.log('model loaded, AR should be available'));
```
-**Check 4 — inside an iframe:**
+**Check 3: inside an iframe**
Add `allow="xr-spatial-tracking"` to the `<iframe>` tag.
---
@@ -19024,31 +20569,35 @@ iOS 15.4+ requires WebXR AR to be enabled manually: **Settings → Safari → Ad
---
-## Using AR without `<agent-3d>`
+## Using AR without model-viewer
If you're building a custom viewer and just need the AR launchers, import the modules directly:
```js
-import { openQuickLook } from '/src/ar/quick-look.js';
-import { openSceneViewer } from '/src/ar/scene-viewer.js';
+import { canUseQuickLook, openQuickLook } from '/src/ar/quick-look.js';
+import { canUseSceneViewer, openSceneViewer } from '/src/ar/scene-viewer.js';
import { WebXRSession } from '/src/ar/webxr.js';
-// iOS
-if (/iPhone|iPad/.test(navigator.userAgent)) {
- openQuickLook('https://cdn.example.com/model.glb');
+// iOS: Quick Look takes a USDZ, not a GLB (bake one with
+// glbBlobToAnimatedUsdzBlob / glbBlobToUsdzBlob, see the USDZ pipeline above)
+if (canUseQuickLook()) {
+ openQuickLook('https://cdn.example.com/model.usdz');
}
-// Android
-else if (/Android/.test(navigator.userAgent)) {
+// Android: Scene Viewer takes the GLB URL
+else if (canUseSceneViewer()) {
openSceneViewer('https://cdn.example.com/model.glb', {
title: 'My Agent',
link: 'https://three.ws',
});
}
-// WebXR fallback
+// WebXR: keeps the agent alive in-page. The constructor takes a viewer
+// shim ({ renderer, scene, content, controls, activeCamera, ... }); see
+// src/xr.js for the canonical shape, plus lifecycle callbacks
+// (onEnd, onAnchored, onHit, onTracking, onScale, domOverlayRoot).
else if (await navigator.xr?.isSessionSupported('immersive-ar')) {
- const session = new WebXRSession(renderer, scene, camera);
+ const session = new WebXRSession(viewer, { onEnd: () => console.log('AR ended') });
await session.start();
}
```
@@ -19061,6 +20610,7 @@ Any generated model (or any public https `.glb`/`.gltf`) gets a device-aware "Vi
```
https://three.ws/api/ar?src=<glbUrl>&title=<name>
+https://three.ws/api/ar?src=<glbUrl>&title=<name>&kind=avatar // living agent
```
The endpoint branches on the request's **User-Agent**, server-side:
@@ -19071,17 +20621,35 @@ The endpoint branches on the request's **User-Agent**, server-side:
| **Android** | `302` → Google **Scene Viewer** ARCore intent (the GLB is the source), with a browser fallback to the WebGL viewer. |
| **Desktop** | Launch page → interactive **WebGL** viewer (no AR hardware). |
+**`kind=avatar`: the living-agent lane.** AR on three.ws is not a prop viewer; it is how agents cross into physical space. When the GLB is a rigged avatar (an agent's body), add `kind=avatar`: the launch page then leads with a **Bring it to life** handoff into [`/irl?avatar=<glbUrl>`](/irl), where the avatar walks, animates, and talks with the user through their camera in their real room. Static placement stays available alongside it, and Android serves the launch page instead of the blind Scene Viewer redirect so the living path is always visible.
+
Bad input (non-https, non-GLB, missing) returns a clean, designed error page — never a crash.
+**Shared links unfurl with the model itself.** The launch page sets its
+`og:image` / `twitter:image` to `GET /api/render/glb?glbUrl=…&width=1200&height=630`,
+a server-side PNG render of the actual GLB (CDN-cached for a day), so pasting
+an AR link into a chat or timeline shows the model, not a generic card. The
+page also converts: it carries "Create your own" (into [/ar](/ar)) and "Open
+in 3D viewer" calls to action. See `GET|POST /api/render/glb` in the
+[API reference](./api-reference.md) for the renderer's parameters and limits.
+
**For agents (MCP):** the free, read-only `export_ar` tool on the [3D Studio server](/docs/mcp) turns a GLB into the AR launch link plus a conformant [Spatial MCP](/docs/spatial-mcp) artifact (with the `ar` handoff populated):
```jsonc
// tools/call → export_ar { "glb_url": "https://three.ws/cdn/creations/model.glb", "title": "Robot" }
// → { arLaunchUrl: "https://three.ws/api/ar?src=…", viewerUrl: "…", sceneViewerUrl: "intent://…", spatial: { … } }
+
+// Rigged avatar? Pass kind:"avatar" to also get the living-agent link:
+// tools/call → export_ar { "glb_url": "…/scout.glb", "title": "Scout", "kind": "avatar" }
+// → { arLaunchUrl: "…&kind=avatar", irlUrl: "https://three.ws/irl?avatar=…", … }
```
+The avatar-producing studio tools (`text_to_avatar`, `rig_mesh`, `forge_avatar`) return `irlUrl` automatically, on both the free and paid tracks.
+
The response carries no payment, wallet, token, or internal-id surface, so it ships on both the Claude and OpenAI tracks.
+How this link ships through ChatGPT end to end (the app connector, the custom GPT, the title-carrying poll, and link unfurls) is documented in [AR in ChatGPT](/docs/chatgpt-ar).
+
---
## See also
@@ -19090,18 +20658,20 @@ The response carries no payment, wallet, token, or internal-id surface, so it sh
- [Blog: See Your 3D Avatar in the Real World](https://three.ws/blog/see-your-3d-in-ar) — full walkthrough
- [Avatar AR page](/avatars/:id/ar) — the dedicated AR experience for any avatar
- [Walk feature](/features/walk) — WebXR immersive walk mode (different from placement AR)
-- [Web component reference](/docs/web-component) — full `<agent-3d>` attribute list including `ar`
+- [Web component reference](/docs/web-component): full `<agent-3d>` attribute list
- [Embedding guide](/docs/embedding) — iframe setup with XR permissions
- [Tutorial: Place your model in AR](/docs/tutorials/view-in-ar)
---
-<a id="sec-074"></a>
+<a id="sec-079"></a>
> **Source:** `docs/architecture.md` · [↑ table of contents](#table-of-contents)
# Architecture Overview
+three.ws is the platform you see at [three.ws](https://three.ws): 3D avatars with AI brains that you can chat with, embed on any site, and register on-chain. This page is the engineering map of how that is built. If you just want to use the product, start with [How three.ws works](./how-it-works.md) instead.
+
This document describes how three.ws is put together, how data moves through it, and where the seams are if you want to extend, self-host, or integrate it with another stack. It assumes familiarity with modern JavaScript, WebGL/three.js at a high level, and the basics of EVM blockchains and content-addressed storage.
three.ws is simultaneously a glTF viewer, an LLM-driven character runtime, an on-chain identity layer, and a distributable web component. These concerns are split into four layers that communicate through a single event bus rather than direct method calls. Most of the interesting design decisions live at the seams.
@@ -19144,7 +20714,7 @@ This is the layer that turns a static GLB into a presence. It's structured as a
This layer is what keeps an agent's existence durable across sessions, devices, and embed hosts.
- **`agent-identity.js`** — the **passport + diary**. Stores the agent's stable id, owner address, and a signed action history. Backed by `localStorage` for the local cache and `/api/agents/:id` for the canonical record. Listens on the protocol bus for `speak`, `remember`, `sign`, `skill-done`, `validate`, `load-end` and POSTs them to the backend fire-and-forget.
-- **`memory/`** — one of four modes: `local` (browser/disk), `ipfs` (pinned via Pinata or Filebase), `encrypted-ipfs` (still a stub), or `none` (stateless). Mode is declared on the manifest.
+- **`memory/`**: five built-in modes: `local` (browser `localStorage`), `remote` (synced to `/api/agent-memory`), `ipfs` (loaded from a pinned bundle), `encrypted-ipfs` (AES-GCM-256 with a wallet-derived key, pinned via `/api/agents/:id/memory/pin`), or `none` (stateless). Custom backends can also be registered. Mode is declared on the manifest.
- **`erc8004/`** — the **on-chain identity** layer. Contains:
- `IdentityRegistry` — mints an agent token whose `tokenURI` points at the manifest CID
- `ReputationRegistry` — accepts signed feedback per agent
@@ -19157,7 +20727,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 (Turntable Showcase, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour) that share the underlying element but ship as separate ergonomic wrappers.
+- **`widget-types.js`**: ten widget variants (Turntable Showcase, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour, Pump.fun Live Feed, Smart Money Feed, Live Trades Canvas, Bonding Curve, Walking Avatar) 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.
@@ -19253,9 +20823,9 @@ The manifest is a JSON document that fully describes an embodied agent. It's int
Key fields:
- **`name`, `description`, `creator`** — display metadata.
-- **`body.uri`** — GLB / glTF / VRM URL. Resolution is deliberately polymorphic: `agent://chain/id` (resolved on-chain), `ipfs://CID/path`, `ar://TXID`, or plain `https://`. The resolver in `ipfs.js` walks gateway fallbacks (ipfs.io → dweb.link → nft.storage) so a single broken gateway never breaks an embed.
+- **`body.uri`**: GLB / glTF / VRM URL. Resolution is deliberately polymorphic: `agent://chain/id` (resolved on-chain), `ipfs://CID/path`, `ar://TXID`, or plain `https://`. The resolver in `ipfs.js` walks gateway fallbacks (dweb.link → ipfs.io → flk-ipfs.xyz) so a single broken gateway never breaks an embed.
- **`skills[]`** — pointers to skill bundles. Each skill is loaded and validated by the registry. Trust mode determines whether unsigned/foreign skills are allowed.
-- **`memory.mode`** — `local`, `ipfs`, `encrypted-ipfs`, or `none`.
+- **`memory.mode`**: `local`, `remote`, `ipfs`, `encrypted-ipfs`, or `none`.
- **`identity.chainId` / `identity.registryAddress`** — pin this manifest to an on-chain agent id.
- **`personality`** — flavor: tone, domain, and any extra system-prompt fragments.
@@ -19314,7 +20884,7 @@ The flow:
1. **User connects a wallet** via MetaMask, WalletConnect, or Privy embedded wallet.
2. **Manifest is pinned** to IPFS via Pinata or Filebase. The CID is the canonical pointer to the agent.
-3. **Registration.** The user calls `IdentityRegistry.registerAgent(cid, metadata)` on the target chain (Base mainnet, Base Sepolia, or Ethereum mainnet). The registry mints a token whose `tokenURI` returns the manifest CID.
+3. **Registration.** The user calls `IdentityRegistry.registerAgent(cid, metadata)` on the target chain. Base is the default; `src/erc8004/chains.js` ships registry deployments on 15 mainnets (Ethereum, Base, Optimism, Arbitrum One, Polygon, BNB Chain, Avalanche, Linea, Scroll, Gnosis, Celo, zkSync Era, Moonbeam, Mantle, Fantom) plus the common testnets. The registry mints a token whose `tokenURI` returns the manifest CID.
4. **Resolution.** Anyone with the chain id and agent id (or an ENS like `3dagent.eth`) can resolve the manifest: `manifest.js` reads `tokenURI(agentId)` from the registry, fetches the JSON over IPFS gateways, and normalizes it.
5. **Reputation.** Users can call `ReputationRegistry.submitFeedback(agentId, score, comment)` to attach reviews. The element exposes a small UI for this.
6. **Validation attestations.** When the glTF validator runs, the report can be hashed and posted to `ValidationRegistry.recordValidation(agentId, hash)` so anyone can verify the body has been spec-checked.
@@ -19341,7 +20911,7 @@ To run the whole stack yourself, the minimum is:
- **A Node.js host** for the SPA and the `api/*` handlers. Production runs a single container ([`server/index.mjs`](../server/index.mjs)) on Google Cloud Run that reads the `vercel.json` route table at runtime; any Node host works the same way, or reproduce the same path → handler map in your reverse proxy.
- **Neon DB (PostgreSQL)** for agents, widgets, sessions, and the action log.
- **Upstash Redis** for rate limiting, nonce storage, and short-lived caches.
-- **AWS S3** (or any S3-compatible store — R2, B2) for hosted GLB and texture assets.
+- **An S3-compatible object store** for hosted GLB and texture assets. The client in [api/_lib/r2.js](../api/_lib/r2.js) speaks the S3 API, so Cloudflare R2, AWS S3, and Backblaze B2 all work (configure `S3_ENDPOINT`, `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`).
- **Anthropic API key** for the default LLM provider. The runtime can also point at a self-hosted proxy (`#proxyURL=`) for billing, logging, or a non-Anthropic backend.
- **Optional:** ElevenLabs for higher-quality TTS, Pinata or Filebase for IPFS pinning, Privy for non-wallet onboarding, an RPC endpoint for ERC-8004 reads.
@@ -19349,12 +20919,23 @@ A minimal Node + Neon + Anthropic deployment is enough for a single agent. The b
---
-<a id="sec-075"></a>
+## Related
+
+- [How three.ws works](/docs/how-it-works): the zoomed-out mental model
+- [Layers](/docs/layers): the four-layer contract in detail
+- [Agent system](/docs/agent-system): runtime, skills, memory, emotion
+- [Memory system](/docs/memory): storage modes and the file format
+
+---
+
+<a id="sec-080"></a>
> **Source:** `docs/authentication.md` · [↑ table of contents](#table-of-contents)
# Authentication
+Authentication is how three.ws knows who you are: it protects your agents, your avatars, and your dashboard, and it is required for anything that writes data. Sign in at [three.ws/login](https://three.ws/login) with a crypto wallet or a plain email/social account; developers can also mint API keys for scripts and servers.
+
three.ws supports three authentication methods. Which one you need depends on how you're building:
| Method | Best for |
@@ -19456,11 +21037,12 @@ const { nonce, csrf, expiresAt } = await fetch('/api/auth/siwe/nonce', {
credentials: 'include'
}).then(r => r.json());
-// 2. Build the EIP-4361 message
+// 2. Build the EIP-4361 message. Put the Terms agreement in the signed
+// statement so the signature itself evidences acceptance.
const message = new SiweMessage({
domain: window.location.host,
address: walletAddress,
- statement: 'Sign in to three.ws. This does not cost anything and proves wallet ownership.',
+ statement: 'Sign in to three.ws. This does not cost anything and proves wallet ownership. By signing, you agree to the Terms of Service (https://three.ws/legal/tos) and Privacy Policy (https://three.ws/legal/privacy).',
uri: window.location.origin,
version: '1',
chainId: 1,
@@ -19471,7 +21053,10 @@ const message = new SiweMessage({
// 3. Sign
const signature = await provider.getSigner().signMessage(message);
-// 4. Verify — include the CSRF token in the header
+// 4. Verify: include the CSRF token in the header. Send tosAccepted: true
+// when your UI displayed the Terms agreement (statement above or a notice
+// next to the sign-in control); the server records the acceptance and the
+// Terms version on the user record.
const res = await fetch('/api/auth/siwe/verify', {
method: 'POST',
credentials: 'include',
@@ -19479,13 +21064,22 @@ const res = await fetch('/api/auth/siwe/verify', {
'Content-Type': 'application/json',
'X-CSRF-Token': csrf,
},
- body: JSON.stringify({ message, signature }),
+ body: JSON.stringify({ message, signature, tosAccepted: true }),
});
const { user, wallet } = await res.json();
```
> **Security note:** Never submit the SIWE message to a domain other than where the nonce was issued. The backend validates that `domain` and `uri` in the message match the deployment's `APP_ORIGIN`. Replaying a valid signature from a phishing page is rejected.
+### Terms of Service acceptance
+
+Every auth endpoint accepts an optional `tosAccepted: true` body field. Send it whenever your UI showed the user the [Terms of Service](https://three.ws/legal/tos) agreement (a checkbox, a "By signing in you agree" notice, or the agreement sentence inside the signed wallet statement). The server writes a durable acceptance record (audit log + the accepted Terms version on the user row). Two rules:
+
+- `POST /api/auth/register` **requires** `tosAccepted: true`; account creation without it fails with `400 tos_required`. Registration UIs must show a real agreement control.
+- Wallet and Privy verifies (`/api/auth/siwe/verify`, `/api/auth/siws/verify`, `/api/auth/privy/verify`) and `POST /api/auth/login` treat it as an affirmation: acceptance is recorded on every sign-in, so users converge onto the current Terms version over time.
+
+An already-signed-in user can also record acceptance directly with `POST /api/legal/tos-ack { version?, context? }`, which mirrors the risk-acknowledgment endpoint (`/api/legal/risk-ack`).
+
---
## Privy (Social / Email Auth)
@@ -19502,10 +21096,9 @@ Not every user has a crypto wallet. If your audience includes non-web3 users, Pr
2. Privy handles the OAuth UI — email magic link, Google OAuth, etc.
3. On success, Privy issues an identity token (a JWT signed with Privy's ES256 key).
4. Your frontend posts that token to `POST /api/auth/privy/verify`.
-5. The backend fetches Privy's JWKS, verifies the token signature and audience, extracts the linked wallet address, and finds-or-creates the user record.
-6. A session cookie is issued — from this point the user is authenticated identically to a SIWE user.
-
-> **Requirement:** The Privy account must have at least one linked wallet. If a user logs in with only an email and Privy hasn't created an embedded wallet yet, the verify call returns `400 no_wallet_linked`. Ensure wallet creation is enabled in your Privy dashboard.
+5. The backend fetches Privy's JWKS, verifies the token signature and audience, and finds-or-creates the user record (keyed on the Privy DID).
+6. Linked wallets are synced best-effort from Privy's server API into the user's wallet list; a login with no wallet still succeeds.
+7. A session cookie is issued; from this point the user is authenticated identically to a SIWE user.
### Configuration
@@ -19522,16 +21115,19 @@ Get both values from [dashboard.privy.io](https://dashboard.privy.io). The serve
### Verify endpoint
```js
-// After Privy client gives you an idToken:
+// After the Privy client gives you an auth token. Send tosAccepted: true when
+// your UI displayed the Terms of Service agreement next to the sign-in control;
+// the server records the acceptance and the Terms version on the user record.
const res = await fetch('/api/auth/privy/verify', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ idToken }),
+ body: JSON.stringify({ token, tosAccepted: true }),
});
-const { user, wallet } = await res.json();
-// user: { id, email, display_name, plan, avatar_url }
-// wallet: { address: '0x...', chain_id: null }
+const { user } = await res.json();
+// user: { id, email, display_name, plan, avatar_url, created_at }
+// Any wallets Privy has linked are synced onto the account automatically;
+// list them afterwards with GET /api/auth/wallets.
```
### Linking additional wallets
@@ -19588,7 +21184,24 @@ await fetch('/api/auth/logout-everywhere', {
});
```
----
+### Coin-community sessions (Town, `/play` worlds)
+
+The coin-community surfaces (Town posting, holder passes, world gates) ride a
+separate session from the main site: an X-OAuth sign-in against the
+CoinCommunities upstream, kept in two httpOnly cookies scoped to
+`Path=/api/community` so page scripts never see them:
+
+| Cookie | Lifetime | Role |
+| ------- | -------- | ----------------------------- |
+| `cc_at` | 1 hour | Access token (a JWT) |
+| `cc_rt` | 30 days | Refresh token |
+
+Expiry is handled transparently: every authenticated community endpoint runs
+through `withAuthRefresh()` ([api/_lib/coin-communities.js](../api/_lib/coin-communities.js)),
+which retries a failed upstream call once after exchanging `cc_rt` for a fresh
+access token and re-setting both cookies on the response. Callers only appear
+signed out when the 30-day refresh token itself is missing or expired, so an
+open `/play` tab no longer kicks you out after the first hour.
## API Keys
@@ -19634,6 +21247,10 @@ const res = await fetch('/api/agents', {
| `avatars:read` | Read avatar data |
| `avatars:write` | Create and update avatars |
| `avatars:delete` | Delete avatars |
+| `agents:read` | Read agent data |
+| `agents:write` | Create and update agents |
+| `memory:read` | Read agent memory |
+| `memory:write` | Write agent memory |
| `profile` | Read/write profile data; required to manage API keys themselves |
Scopes are space-separated in the `scope` field. Default when unspecified: `avatars:read avatars:write`.
@@ -19678,51 +21295,57 @@ A user can link multiple Ethereum addresses to one account. All linked addresses
### Linking a wallet
-Linking requires the user to sign a challenge with the wallet they want to add. First get a link nonce, then sign and submit:
+Linking requires the user to sign a SIWE (EIP-4361) challenge with the wallet they want to add. `POST /api/auth/wallets/nonce` returns the exact message to sign; sign it and submit:
```js
-// 1. Get a link nonce
-const { nonce } = await fetch('/api/auth/wallets/nonce', {
- credentials: 'include'
+// 1. Get the link message (must be signed in already; the nonce is bound to
+// your session). POST with the wallet address and its chain id.
+const { nonce, message } = await fetch('/api/auth/wallets/nonce', {
+ method: 'POST',
+ credentials: 'include',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ address: walletAddress, chainId: 8453 }),
}).then(r => r.json());
+// message is a full EIP-4361 text: "three.ws wants you to sign in… Link this
+// wallet to three.ws account <email> … Nonce: … Expiration Time: …"
-// 2. Sign the nonce with the new wallet
-const message = `Link wallet to three.ws\nNonce: ${nonce}`;
+// 2. Sign the message with the new wallet
const signature = await signer.signMessage(message);
-// 3. Submit
+// 3. Submit the signed message
await fetch('/api/auth/wallets', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({
- address: walletAddress,
- message,
- signature,
- nonce,
- }),
+ body: JSON.stringify({ message, signature }),
});
```
+(`GET /api/auth/wallets/nonce` also works: it returns `{ nonce, domain, uri }` for clients that build the SIWE message themselves. Solana wallets use the parallel `nonce-solana` + `link-solana` actions with a Sign-In-With-Solana message.)
+
### Listing linked wallets
```js
const { wallets } = await fetch('/api/auth/wallets', {
credentials: 'include'
}).then(r => r.json());
-// wallets: [{ address, chain_id, created_at, is_primary }, ...]
+// wallets: [{ address, chain_id, chain_type, created_at, is_primary }, ...]
```
### Removing a wallet
+Unlinking is a state-changing call, so it needs a CSRF token (one-time, from `GET /api/csrf-token`) in the `X-CSRF-Token` header:
+
```js
+const { token } = await fetch('/api/csrf-token', { credentials: 'include' }).then(r => r.json());
await fetch(`/api/auth/wallets/${address}`, {
method: 'DELETE',
credentials: 'include',
+ headers: { 'X-CSRF-Token': token },
});
```
-You cannot remove the primary wallet if it is the only one linked.
+You cannot remove a wallet if it is the only one linked.
---
@@ -19771,7 +21394,16 @@ Password hashing cost is configurable via `PASSWORD_ROUNDS` (default: `11` bcryp
---
-<a id="sec-076"></a>
+## Related
+
+- [API reference](/docs/api-reference): every endpoint, including the auth routes above
+- [ERC-8004 identity](/docs/erc8004): what a connected wallet unlocks on-chain
+- [Embedding guide](/docs/embedding): embeds work unauthenticated; auth is only for editing and publishing
+- [Architecture overview](/docs/architecture): where sessions and the API server fit
+
+---
+
+<a id="sec-081"></a>
> **Source:** `docs/autonomous-economy.md` · [↑ table of contents](#table-of-contents)
@@ -19928,7 +21560,7 @@ zero.
---
-<a id="sec-077"></a>
+<a id="sec-082"></a>
> **Source:** `docs/autonomous-x402.md` · [↑ table of contents](#table-of-contents)
@@ -19953,9 +21585,11 @@ the sniper oracle gate.
## How a tick works
-The loop runs from the `x402-autonomous-loop` cron, scheduled every **5 minutes**
-(the `*/5 * * * *` entry in [`vercel.json`](../vercel.json)'s cron list, run by
-Google Cloud Scheduler). Each tick:
+The loop runs from the `x402-autonomous-loop` cron endpoint, invoked every
+**minute** by the `economy-tick` dispatcher (see the
+[economy heartbeat](economy-heartbeat.md)) rather than by its own schedule
+entry; per-entry Redis cooldowns decide what actually fires on any given tick.
+Each tick:
1. Selects up to `X402_AUTONOMOUS_MAX_PER_TICK` **ready** registry entries —
those whose Redis cooldown has elapsed — sorted by priority descending.
@@ -19990,6 +21624,14 @@ treasury (`CIRCULATION_TREASURY_SECRET`). Circulation funds agent-to-agent SOL /
$THREE activity; this loop funds USDC intel purchases. They do not fund each
other.
+The seeder wallet is the same keypair the ring economy calls the
+`x402-ring-payer` signer role, and it **refills its own USDC**: the
+`economy-rebalance` cron (every 30 minutes) swaps a capped slice of the wallet's
+own SOL into USDC whenever its USDC float drops below a floor (default $10,
+`ECONOMY_REBALANCE_RING_USDC_FLOOR`). The rebalancer is inert (dry-run plan
+only) unless `ECONOMY_REBALANCE_ENABLED=1`, and every swap is reserve-,
+per-swap-, per-run- and slippage-capped.
+
## The registry
Every scheduled call is a registry entry in `autonomous-registry.js`. An entry
@@ -20003,7 +21645,7 @@ declares:
| `method`, `body` | Request shape; `body` may be a function of the run context. |
| `cooldown_s` | Minimum seconds between calls. |
| `priority` | 1–100; higher wins when several entries are ready. |
-| `pipeline` | Tag: `oracle`, `health`, `volume`, `sniper`, `qa`, `forge`, `discovery`, `security`, `circuit-breaker`, `self`, `external`. |
+| `pipeline` | Tag grouping related entries. In production today: `health`, `oracle`, `volume`, `self`, `finance`, `discovery`, `sniper`, `agents`, `security`, `reconciliation`, `datapoint`, `qa`, `forge`, `external`, `circuit-breaker`, and a few singletons (`reliability`, `observability`, `feed`, `commerce`, `canonicalize`). |
| `enabled` | Set `false` to pause an entry. |
| `extractSignal` | Optional: maps the response into `signal_data` (for oracle entries, `{ mint?, signal, confidence, headline }`). |
| `resolveTarget` | Optional: computes the request path dynamically per call (for entries that rotate over a set of resources). |
@@ -20035,7 +21677,7 @@ The registry groups entries into pipelines. The main ones in production:
To pause any entry without a deploy, set its `enabled: false`; to pause the whole
loop, set `X402_AUTONOMOUS_ENABLED=false`.
-## The Volume Bootstrap Loop (`self/026`)
+## The Volume Bootstrap Loop (`volume-bootstrap-loop`)
One registry entry — `volume-bootstrap-loop`, pipeline `volume`, cooldown 300s —
owns a full sweep rather than a single call. On each run it advances a
@@ -20069,8 +21711,8 @@ automatically (and `tests/x402-ring-catalog.test.js` fails until it is cataloged
One registry entry — `datapoint-volume-sweep`, pipeline `datapoint`, cooldown
300s — settles real on-chain USDC against the [datapoint fabric](market-data-api.md#the-datapoint-fabric)
(the 1,000,000+ endpoints served by the single `api/x402/d/[...path].js` route),
-which the Volume Bootstrap Loop above never touches (its rotation is the ~60
-*named* catalog endpoints). On each run it advances its own Redis-backed cursor
+which the Volume Bootstrap Loop above never touches (its rotation is the ~45
+*named* catalog endpoints flagged `autobuy: true`). On each run it advances its own Redis-backed cursor
over a pool of concrete datapoint URLs — resolved at runtime from the same cached
feeds the paid route reads, so no third-party id is hardcoded — and pays the next
`X402_DATAPOINT_SWEEP_BATCH` (default 6) of them on Solana through the shared
@@ -20093,7 +21735,7 @@ No-op (graceful skip, no spend) when the wallet/RPC is unconfigured. See
> datapoint settle count as external traction — that would be wash volume. Real
> ranking comes from external buyers, not a heavier self-paid sweep.
-## Reconciliation (`self/027`)
+## Reconciliation (`revenue-reconciliation`)
The `revenue-reconciliation` entry (pipeline `reconciliation`, cooldown 86400s —
**daily**) is the financial-integrity watchdog. It cross-checks every record that
@@ -20126,7 +21768,110 @@ corroborate — the ops financial-integrity surface alerts on those. Detail:
---
-<a id="sec-078"></a>
+<a id="sec-083"></a>
+
+> **Source:** `docs/autopilot.md` · [↑ table of contents](#table-of-contents)
+
+# Coin Autopilot: hands-off buyback and holder rewards
+
+Coin Autopilot is the control cockpit for a coin you launched through three.ws. You set the rules once (when to buy back and burn, when to distribute creator fees to holders, the floors that gate each), flip the switches you want, and the platform's crons run the coin autonomously. Your agent narrates every on-chain move in plain language on a live feed, so the coin does not just run itself, it tells you what it did.
+
+Page: [/autopilot](https://three.ws/autopilot)
+API: `GET/POST /api/pump/autopilot`
+
+## Why it exists
+
+A coin launched from an agent is not a static token, it is a small business: creator fees flow in, and something has to decide what to do with them. Left to a human, that decision is a chore that gets skipped. Autopilot turns the two most valuable of those decisions, buying the token back to make supply scarcer and paying accumulated fees out to holders, into rules the platform enforces on a schedule.
+
+The design goal is control without babysitting. You should be able to set a floor ("only buy back once at least 50 USDC of fees have piled up"), pause a coin with one tap, and otherwise never touch it, while still seeing every move it makes narrated by the agent that owns it. That is the difference between an autonomous coin and an abandoned one.
+
+## How it works
+
+Autopilot is a thin, owner-facing policy layer over crons that already run. Every coin you launched has a policy row (`pump_autopilot`) that gates two existing crons:
+
+- `run-buyback` reads your buyback rule and, when the buyback vault clears your floor, spends collected creator fees to buy the token back and burn it. With `buyback_full_swap` on, fees are swapped into the token before the burn; off, the burn is direct.
+- `run-distribute-payments` reads your distribute rule and, when the payment vault clears your floor, pushes accumulated fees out to your configured shareholders.
+
+A coin with no policy row keeps the legacy always-on behavior. Writing a row (which the page does the moment you touch a control) lets you tune or pause it. The API reports the effective runtime state either way, with a `configured` flag so the UI can tell an explicit setting from an inherited default.
+
+Thresholds are shown in USDC and stored as atomic units (6 decimal places). The page converts on the way in and out, so you type `50` and the server stores `50000000`.
+
+### The data path
+
+`GET /api/pump/autopilot` is scoped to coins you own (`pump_agent_mints.user_id`). It joins each mint to its agent identity, its live stats (graduation, bonding-curve progress), and its policy row, then rolls up recent autonomous actions from `pump_buyback_runs` and `pump_distribute_runs` and payment totals from `pump_agent_payments`. The response is your coins, their per-coin policy, per-coin totals (burned, distributions, fees in, payment count), and a merged newest-first activity feed.
+
+`POST /api/pump/autopilot` upserts one coin's policy. It is a merge, not a replace: only the fields you send change, so toggling one switch never clobbers your thresholds. The write is validated (zod) and re-scoped to your ownership before it touches the table.
+
+Auth is a session cookie or a bearer token. Every read and write is rate-limited per authenticated IP.
+
+## Walkthrough
+
+1. Launch a coin for one of your agents (from the dashboard). Until you have at least one launched coin, the page shows a designed empty state pointing you to the launcher.
+2. Open [/autopilot](https://three.ws/autopilot). Each coin renders as a card with its image, graduation or bonding-curve progress, and lifetime totals.
+3. Use the master switch on a card to turn Autopilot on or off for that coin. "Autopilot on" means its rules run; "Paused" means the crons skip it.
+4. Set the **Buyback and burn** rule: toggle it on, set a minimum USDC floor, and choose whether fees are swapped into the token before burning or burned directly.
+5. Set the **Distribute to holders** rule: toggle it on and set its minimum USDC floor. Enable "Narrate this coin's actions on the live feed" to have the agent speak its moves.
+6. Every change autosaves (checkboxes immediately, number fields after a short debounce). A toast confirms "Autopilot updated".
+7. Watch the activity feed and the narrator. As fees accumulate past your thresholds, the crons act, and each buyback or distribution appears with its status and a Solscan link to the on-chain transaction.
+
+## Examples
+
+Read your coins and their policy from the command line:
+
+```bash
+curl -s https://three.ws/api/pump/autopilot \
+ -H 'authorization: Bearer YOUR_TOKEN' | jq '.coins[] | {symbol, policy, totals}'
+```
+
+Set a buyback floor of 50 USDC and turn on full-swap-then-burn for one coin:
+
+```bash
+curl -s https://three.ws/api/pump/autopilot \
+ -H 'authorization: Bearer YOUR_TOKEN' \
+ -H 'content-type: application/json' \
+ -d '{
+ "mint": "YOUR_MINT_ADDRESS",
+ "network": "mainnet",
+ "buyback_enabled": true,
+ "buyback_min_atomics": "50000000",
+ "buyback_full_swap": true
+ }'
+```
+
+Pause a coin entirely without losing its thresholds:
+
+```bash
+curl -s https://three.ws/api/pump/autopilot \
+ -H 'authorization: Bearer YOUR_TOKEN' \
+ -H 'content-type: application/json' \
+ -d '{ "mint": "YOUR_MINT_ADDRESS", "network": "mainnet", "enabled": false }'
+```
+
+A confirmed buyback narrates as: "Bought back and burned $120 of $YOURCOIN. Supply just got scarcer." A confirmed distribution: "Distributed $80 in creator fees to $YOURCOIN holders." Queued and failed actions narrate their own status, including the error text on a failure.
+
+## Guardrails, states, and limits
+
+- **Ownership scoped.** Every read and write is filtered to coins whose `user_id` is yours. Posting a policy for a mint you do not own returns `404 not_found`.
+- **Floors are the safety valve.** A buyback or distribution only fires once the relevant vault clears the USDC floor you set. Set a floor to zero and it acts whenever the vault is non-empty; raise it to batch actions.
+- **Merge semantics.** Partial POSTs only change the fields present. A missing policy row reports legacy defaults (everything enabled, zero floors, narrate on) with `configured: false`.
+- **Signed out** renders a "Sign in to manage autopilot" state; `GET` returns `401` and the page routes you to the dashboard.
+- **Empty state** appears when you own no coins, pointing you to the launcher rather than showing a blank void.
+- **Error and retry.** A network or server error renders an inline "Couldn't load" card with a Retry button; a transient poll failure keeps the last good render and retries on the next tick.
+- **Live refresh** polls every 20 seconds and only refreshes the activity feed and narrator, never the control inputs you may be editing, so a poll can never overwrite your keystrokes.
+- **Atomics are integers.** Thresholds are clamped to non-negative integer atomic strings server-side; a decimal is truncated, a negative or non-numeric value falls back to zero.
+- **On-chain actions are the crons', not the page's.** The console never signs a transaction. It only writes policy rows; the buyback and distribute crons are what move funds, on their own schedule, within the vault floors you set.
+
+## Related
+
+- [Custody you can verify](./custody.md) - the spend limits, freeze switch, and audit trail every agent wallet runs under
+- [Financial controls](./financial-controls.md) - plain-English spend rules layered on the same enforcement point
+- [Oracle](./oracle.md) - the conviction engine and the agent action loop that arms an agent to trade autonomously
+- [/dashboard](https://three.ws/dashboard) - launch a coin for an agent, the prerequisite for Autopilot
+- [/launches](https://three.ws/launches) - the public feed of coins launched through three.ws
+
+---
+
+<a id="sec-084"></a>
> **Source:** `docs/avatar-creation.md` · [↑ table of contents](#table-of-contents)
@@ -20154,24 +21899,21 @@ The fastest way to get a personalized 3D avatar is to take a set of photos and l
### What you need
-Three photos of your face:
-- **Frontal** — face the camera straight on, neutral expression
-- **Left** — turn your head about 45° to the left
-- **Right** — turn your head about 45° to the right
+At minimum, one clear photo of your face:
+- **Frontal** (required): face the camera straight on, neutral expression
+- **Left / Right** (optional): turn your head about 45° each way; extra angles improve the likeness
-Good lighting and a plain background give the best results. Photos can be JPEG or PNG.
+Good lighting and a plain background give the best results. Photos can be JPEG or PNG. The reconstruction is a face pipeline, so a headshot works far better than a full-body shot.
### Steps
-1. Go to **https://three.ws/create**
+1. Go to **https://three.ws/create** and pick the selfie path (or open **https://three.ws/create/selfie** directly)
2. Choose **Camera** (to take live photos in-browser) or **Upload** (to pick files from your device)
-3. Fill in all three slots — frontal, left, right
-4. Select your preferred **body type** and **avatar style** (v1 = photorealistic, v2 = stylized)
+3. Fill the frontal slot; add left/right photos if you have them
+4. Select your preferred **body type** (male / female) and **avatar style** (v1 = Photoreal, v2 = Stylized)
5. Click **Submit**
-The photos are prepared and sent to the photo avatar pipeline. After a brief processing step, an avatar editor opens in a modal where you can adjust clothing, accessories, and other details before exporting.
-
-When you click export, the GLB is fetched and saved to your three.ws account automatically.
+The photos are downscaled in the browser and sent to the native avatar reconstruction backend. A build view shows progress while the rigged GLB renders (typically a minute or two); when the job finishes, the avatar is saved to your three.ws account automatically and opens for review.
### What if camera access doesn't work?
@@ -20181,12 +21923,12 @@ If your browser or device doesn't support `getUserMedia`, the Camera option is d
For developers who want to understand what happens under the hood:
-1. [selfie-capture.js](../src/selfie-capture.js) manages the two-step UI: method choice (camera vs upload) and the three photo slots. It dispatches a `selfie:submit` CustomEvent when all three slots are filled.
-2. [selfie-pipeline.js](../src/selfie-pipeline.js) handles that event: downscales each photo to a max of 1024px, converts to base64 JPEG, then POSTs to `/api/onboarding/avaturn-session` with the photos and body/style preferences.
-3. The API responds with a `session_url`. The page redirects to `/#avatarSession=<encoded url>`.
-4. The main app reads the hash and opens `AvatarCreator` ([src/avatar-creator.js](../src/avatar-creator.js)) with the session URL, which initialises the photo avatar SDK into a modal iframe.
-5. The avatar editor iframe fires a `avatar.exported` postMessage when the user exports. The SDK catches this, fetches the GLB bytes, and calls `onExport(blob)`.
-6. [account.js](../src/account.js) → `saveRemoteGlbToAccount()` presigns an upload URL, pushes the GLB to R2 storage, and creates the avatar record.
+1. [selfie-capture.js](../src/selfie-capture.js) manages the two-step UI: method choice (camera vs upload) and the photo slots (frontal required, sides optional). On submit it dispatches a `selfie:submit` CustomEvent with `{ files, bodyType, avatarType }`.
+2. [selfie-pipeline.js](../src/selfie-pipeline.js) handles that event: it runs an on-device photo check and refinement pass ([selfie-refine.js](../src/selfie-refine.js)), downscales each photo to a max of 1024px as JPEG, then POSTs to `/api/avatars/reconstruct` with the photos and body/style preferences.
+3. The endpoint returns a `jobId`. The pipeline dispatches `selfie:building` and polls `/api/avatars/regenerate-status?jobId=...` every 3 seconds, dispatching `selfie:progress` ticks the build view renders.
+4. On `{ status: 'done', resultAvatarId }` it dispatches `selfie:done { avatarId }`. The avatar record and its GLB in R2 storage were created server-side, so nothing else needs to be uploaded. Failures dispatch `selfie:build-error` with a message and, when detectable, the photo slot that caused it.
+
+A separate photo-avatar SDK path (`AvatarCreator` in [src/avatar-creator.js](../src/avatar-creator.js) with a session from `/api/onboarding/avaturn-session`) still exists for the third-party editor integration; the selfie flow above is the default one on /create.
---
@@ -20196,9 +21938,7 @@ The three.ws avatar builder is a browser-based tool for full creative control, n
### Access
-Open **https://three.ws/studio**
-
-The studio opens in a modal inside the main app and runs as a separate React application embedded via iframe.
+Open **https://three.ws/avatar-studio**, or start from **https://three.ws/create** (the builder opens in a modal inside the main app). It is a separate React application embedded via iframe. Note: `/studio` is Widget Studio, the embed-snippet builder, a different tool.
### What you can customize
@@ -20333,7 +22073,7 @@ Open the editor for your avatar and click the **Regenerate** button. The regener
Each mode accepts optional parameters as a JSON object. The job runs asynchronously and the panel polls for completion every 3 seconds.
-**Note:** Avatar regeneration is in limited availability. If your deployment shows a waitlist banner in this panel, email [email protected] to join the early access list.
+**Note:** Re-mesh, re-texture, and re-rig need a platform ML backend. If the panel shows a "Mesh regeneration needs a backend" banner, the deployment has no regeneration provider configured: set `AVATAR_REGEN_PROVIDER` to `replicate`, `huggingface`, or `gcp` (plus the matching API token) in the server environment.
---
@@ -20453,12 +22193,21 @@ Apply Draco compression in Blender (File → Export glTF → Compression) or wit
**The Camera option is greyed out on the selfie page**
Your browser or device doesn't support `getUserMedia`. This is common on HTTP (non-HTTPS) connections and some desktop browsers. Use the Upload option instead.
-**The regeneration panel shows a waitlist message**
-The ML regeneration backend is not enabled on this deployment. Join the early access list via [email protected].
+**The regeneration panel says mesh regeneration needs a backend**
+No regeneration provider is configured on this deployment. Set `AVATAR_REGEN_PROVIDER` (`replicate`, `huggingface`, or `gcp`) and the matching API token in the server environment.
---
-<a id="sec-079"></a>
+## Related
+
+- [Avatar pipeline](/docs/avatar-pipeline): the end-to-end generate / rig / retarget map
+- [Selfie to avatar reconstruction](/docs/avatar-reconstruction): how the photo pipeline works inside
+- [Animations](/docs/animations): the clip library your avatar drives once rigged
+- [ERC-8004 identity](/docs/erc8004): registering the finished agent on-chain
+
+---
+
+<a id="sec-085"></a>
> **Source:** `docs/avatar-inspector.md` · [↑ table of contents](#table-of-contents)
@@ -20542,7 +22291,7 @@ Related reading: [agent reputation](agent-reputation.md) · [Agora](agora.md).
---
-<a id="sec-080"></a>
+<a id="sec-086"></a>
> **Source:** `docs/avatar-pipeline.md` · [↑ table of contents](#table-of-contents)
@@ -20576,7 +22325,7 @@ prompt / image
| Paid | `mesh_forge` (MCP) | per call | Text/image → mesh via a Granite-directed model chain. |
| Avatar | `text_to_avatar`, `forge_avatar` (MCP) | per call | Avatar-shaped output; `forge_avatar` chains generation + rigging in one call. |
-Generation quality is a **tier** (`forge-tiers.js`): `draft`, `standard`
+Generation quality is a **tier** ([api/_lib/forge-tiers.js](../api/_lib/forge-tiers.js)): `draft`, `standard`
(default), or `high` — more geometric budget at higher tiers. The tier sets the
price identically across REST and MCP transports (see
[MCP tools](mcp-tools.md), [x402 endpoints](x402-endpoints.md)).
@@ -20588,6 +22337,15 @@ skeleton to a GLB. A **humanoid gate** decides whether the mesh can carry a
canonical humanoid rig; non-humanoid props are left unrigged rather than forced
into a broken skeleton.
+The rigging engine is the `model-rig` worker ([workers/rig/](../workers/rig)):
+Make-It-Animatable (MIT) predicts the 52-bone Mixamo skeleton, fingers
+included, plus per-vertex weights; the worker grafts them into the original
+GLB bytes (materials and PBR textures untouched) and transfers the ARKit-52
+expression blendshapes from the MIT-licensed ICT-FaceKit template head, so
+generated avatars support emotions and lipsync out of the box. Bones come out
+`mixamorig:*`-named, which stage ③ maps onto the canonical set at 100%
+coverage.
+
### ③ Canonicalize bones
`src/glb-canonicalize.js` maps an incoming skeleton's bone names onto three.ws's
@@ -20629,6 +22387,7 @@ pose operations.
## Related
+- [Selfie → Avatar reconstruction](avatar-reconstruction.md) — the separate lane that fits a *person's photo* onto a rigged template (face texture + geometry morph), rather than generating a mesh from a prompt.
- [Animations](animations.md) — the clip library and retargeting in depth.
- [3D asset pipeline](3d-asset-pipeline.md) — formats, optimization, validation.
- [NVIDIA free models](nvidia-models.md) — the free generation backend.
@@ -20636,7 +22395,203 @@ pose operations.
---
-<a id="sec-081"></a>
+<a id="sec-087"></a>
+
+> **Source:** `docs/avatar-reconstruction.md` · [↑ table of contents](#table-of-contents)
+
+# Selfie → Avatar Reconstruction
+
+This is the subsystem that turns a **user's photo** (or a text→image reference)
+into a rigged, animation-ready 3D avatar. It is distinct from the Forge
+generation lane in the [Avatar Pipeline](avatar-pipeline.md): the Forge generates
+an *arbitrary* mesh from a prompt, whereas reconstruction fits a *specific
+person* onto a fixed, pre-rigged template — the same architecture Avaturn and
+Ready Player Me use, and the reason the output is born-rigged with facial
+blendshapes instead of a bare mesh that still needs auto-rigging.
+
+- **Worker:** [`workers/avatar-reconstruction/`](../workers/avatar-reconstruction) — FastAPI on a Cloud Run L4 GPU.
+- **Backend provider:** [`api/_providers/gcp.js`](../api/_providers/gcp.js), selected by `AVATAR_REGEN_PROVIDER=gcp` (see [`api/_lib/regen-provider.js`](../api/_lib/regen-provider.js)).
+- **User entry points:** the selfie/upload flow and text→avatar prompt flow in [`api/avatars/_actions.js`](../api/avatars/_actions.js) (`POST /api/avatars/reconstruct`).
+
+## How it works
+
+The avatar is a fixed-topology Wolf3D/RPM template that ships **pre-rigged** with
+a humanoid skeleton and **52 ARKit blendshapes + 15 visemes**. Reconstruction
+never generates a new mesh; it fits the person onto that template in two phases.
+
+### Phase 1 — Face texture transfer
+
+`face_pipeline.py`: MediaPipe FaceLandmarker finds 468 landmarks on the best
+frontal photo, a thin-plate-spline warp maps the face into the template's skin-UV
+space, it is composited over the face-oval region, and skin / hair / eye colours
+are sampled and tinted for consistency. Output: the template body wearing the
+person's face *texture*.
+
+### Phase 2 — Face geometry morph
+
+Texture alone leaves the *shape* generic — same jaw, nose, brow and face width as
+the template, so the avatar looks like a sticker on a mannequin. `face_geometry.py`
+closes that gap:
+
+1. Umeyama similarity-aligns the 468 detected landmarks onto MediaPipe's neutral
+ **canonical face model**, so the person's face and the reference share a frame.
+2. The residual `(person − canonical)` on a **stable identity subset** (face
+ oval, nose, cheeks, brow, jaw — expression-prone eye/lip points excluded) is
+ the person's shape deviation from neutral.
+3. That displacement is carried onto the head's corresponding vertices (a
+ nearest-vertex map precomputed by `precompute_uv.py`), scaled into head units,
+ and clamped to reject landmark/pose outliers.
+4. A **normalised-Gaussian RBF** (partition of unity — local, bounded, no
+ extrapolation) diffuses the sparse displacements across all 2162 head vertices,
+ with a locality mask that fades the morph to zero off the face so the scalp,
+ ears and neck stay put.
+
+Because vertex count and order never change, `glb_ops.set_head_geometry` writes
+the morphed positions (and recomputed normals) back **without disturbing the
+skinning weights or any of the 67 blendshape morph targets** — the rig and every
+ARKit expression survive intact. This is verified end-to-end in
+[`test_face_geometry.py`](../workers/avatar-reconstruction/test_face_geometry.py).
+
+Toggle Phase 2 with the `GEOMETRY_MORPH` env var (default `1`). It degrades
+cleanly to texture-only if anything fails; the shape refinement never fails a job.
+
+> **Fixed in this change:** `precompute_uv.py` and `glb_ops` previously read the
+> interleaved head buffer stride-unaware, so `face_uv_map.json` was built on
+> corrupted vertex data. The reader is now stride-aware, which also repairs the
+> Phase-1 texture correspondence.
+
+## Licensing — why this stack
+
+Every stage is commercial-clean (Apache-2.0 / MIT / CC0). The dominant constraint
+in single-image avatar reconstruction is that the best-known 3D face and body
+models are **non-commercial**: FLAME and the Basel Face Model (BFM) are academic
+licences, and the whole SMPL/SMPL-X family is Max-Planck non-commercial. Anything
+built on them (DECA, EMOCA, MICA, ICON, ECON, PIFuHD, …) inherits that restriction.
+The Phase-2 morph uses only **MediaPipe Face Mesh** (Apache-2.0) — no 3DMM — so it
+is unencumbered.
+
+## Roadmap — beating Avaturn on fidelity
+
+Phase 2 captures gross face identity (proportions, projection) but not fine
+geometry. The path to and past Avaturn quality, with the verified licence for
+each link:
+
+| Version | Upgrade | Model | Licence verdict |
+|---|---|---|---|
+| **v1 (shipped)** | Real face-shape morph (sparse) | MediaPipe Face Mesh | Apache-2.0 — clean |
+| **v2 (recommended)** | Dense identity geometry, fused via `register_head_to_target` | **MICA + FLAME**, commercial licence from MPI | Paid MPI commercial licence — clean once signed. FLAME's fixed topology + expression basis map straight to ARKit |
+| **v2 (fallback)** | Dense identity, no licence fee | HRN re-based on **FLAME-2023-Open** (CC-BY-4.0) | Clean, but weeks of GPU R&D to retrain the identity regressor |
+| **v2 (texture)** | Full-head photoreal texture (fills cheeks/ears/scalp the selfie can't see) | **Imagen** inpaint on Vertex AI | GCP — pre-approved |
+| **v3** | Drop the RPM-template dependency for a fully-owned body | **Anny** (parametric body) + **ICT-FaceKit** (ARKit-52) + deformation transfer | Anny Apache-2.0 + CC0; ICT-FaceKit + DT MIT — clean |
+
+**Rejected: FaceLift (ICCV'25)** — initially floated as the clean v2 model, but
+verification killed it: its weights are licensed from Adobe under the
+**non-commercial Adobe Research License** (Apache code does not extend to the
+weights), and it outputs **3D Gaussian Splats, not a mesh**, so it cannot feed a
+rigged-GLB pipeline. This is the recurring trap here: the high-quality
+single-image face models are almost all encumbered by a non-commercial 3DMM/
+dataset (FLAME, BFM, SMPL) or a non-commercial weight licence. The dense
+registration itself (`register_head_to_target`) is model-agnostic and already
+validated, so whichever licensed model is chosen drops straight in.
+
+Auto-rigging for the reconstruct-the-whole-body variant would use
+**Make-It-Animatable** (Apache) or **UniRig** (MIT) → a Mixamo-standard skeleton
+that drives the existing pre-baked clip library. The whole recommended chain runs
+on one L4 (24 GB); an A100 is only needed for throughput, not any single stage.
+
+## Deploy
+
+The worker is already provisioned on Cloud Run GPU. From a clean tree:
+
+```bash
+gcloud builds submit \
+ --config workers/avatar-reconstruction/cloudbuild.yaml \
+ --substitutions _GCS_BUCKET=three-ws-avatar-reconstructions,SHORT_SHA=manual$(date +%s)
+```
+
+The backend needs no change — Phase 2 ships inside the same image and the
+`POST /reconstruct` → `GET /jobs/:id` contract is unchanged. Verify with
+`GET /health` (`"pipeline": "face_texture_transfer_v2"`, `"geometry_morph": true`).
+Full runbook: [`docs/ops/gcp-production.md`](ops/gcp-production.md).
+
+---
+
+<a id="sec-088"></a>
+
+> **Source:** `docs/avatar-studio.md` · [↑ table of contents](#table-of-contents)
+
+# Avatar Studio: build a custom avatar from scratch, no selfie
+
+Avatar Studio builds a fully rigged 3D avatar without a photo. You start from a base body and shape it into your own character: tint skin, hair, and outfit; sculpt the face and body with morph sliders; add hats, glasses, and earrings; hide or show garment layers to strip back to the base and build a look up; and drive the rig live with a library of emotes. When you save, the live scene is exported to a GLB exactly as you see it and stored to your account, ready to animate, dress, and use anywhere on the platform.
+
+Page: [/avatar-studio](https://three.ws/avatar-studio) (also reachable at [/create/studio](https://three.ws/create/studio))
+
+## Why it exists
+
+The selfie-to-avatar path is great when you want to look like yourself, but it is a wall when you want to be someone, or something, else. Avatar Studio is the from-scratch path: no camera, no upload, just a base humanoid and the tools to make it yours. It reuses the same building blocks as the platform's avatar editor, the `TalkScene` viewport, the accessory manager, the sculpt panel, and the shared GLB optimize-and-validate path, so an avatar built here is a first-class avatar everywhere, not a lesser one. And because the customization is stored both as a validated GLB (so it always renders right) and as re-editable appearance metadata, you can come back and change it later.
+
+## How it works
+
+The studio mounts a `TalkScene` around a base model (`/avatars/default.glb`, a feminine base body) and layers a tabbed customization panel over it. Every edit updates the live scene graph, and a working "appearance" object tracks the whole configuration: chosen colors, morph values, accessories, and hidden layers.
+
+- **Color.** Three material slots (skin, hair, outfit) each offer a curated swatch palette plus a full-spectrum picker (an `iro.js` wheel with hex entry and eyedropper, falling back to the native OS color dialog). Above them sit **Looks**: one-tap palettes (Noir, Sunset, Arctic, Cyber, Rosé, Forest, Mono, Ember) that theme skin, hair, and outfit together in a single history step, always landing on real, coherent material colors.
+- **Face and body sculpt.** The sculpt panel renders grouped morph sliders against whatever morph targets the base carries, organized into Eyes, Brows, Nose, Mouth, Jaw, Cheeks, and Body (height, chest/waist/hip, muscle, and similar shape morphs), plus a MetaHuman-style 2-D face-type blend wheel over six archetypes and advanced visemes. It drives real morph targets, so the change is baked into the saved mesh.
+- **Accessories.** Hats, glasses, and earrings load from a preset catalog (`/accessories/presets.json`). Hovering a tile previews it live on the avatar; clicking commits it. Hats and glasses are single-slot; earrings stack. A chip row shows everything applied, each removable.
+- **Garment layers.** Outfit, glasses, and hair can be toggled visible/hidden, with bulk "Start minimal" and "Dress fully" actions, so you can strip to the base body and rebuild the look deliberately.
+- **Animate.** Load the shared canonical clip library and drive the rig live with 16 emotes (idle, wave, cheer, flex, jump, pray, dance, shuffle, rumba, thriller, capoeira, and more). A looping emote becomes the avatar's resting idle and is baked in on save; one-shots play once and settle back to the current idle. This doubles as proof the avatar is fully rigged.
+- **Randomize.** One button rolls a random swatch per color slot and a random hat and glasses, as a starting point.
+
+The studio has 50-deep undo/redo, a dirty-state indicator in the title bar, and a draft autosave to local storage that is offered back if you leave and return (in create mode).
+
+### Save
+
+Saving does not ask a server to re-bake anything. The live Three.js scene, with colors, morphs, and accessories already applied to the scene graph, is exported via `GLTFExporter`, so the resulting GLB is exactly what you saw. It runs through the shared optimize-and-validate path (geometry compression, `gltf-validator`), uploads to your account, and creates or (in edit mode) updates the avatar record. The appearance JSON is stored alongside as metadata so the avatar stays re-editable.
+
+## Walkthrough
+
+1. Open [/avatar-studio](https://three.ws/avatar-studio). The base avatar loads and settles into an idle animation.
+2. On the Color tab, tap a Look (say, Cyber) for an instant coherent palette, then fine-tune skin, hair, and outfit with the swatches or the rainbow chip's full picker.
+3. Open the Face tab and sculpt: widen the jaw, adjust the nose, nudge body shape. Use the face-type wheel to blend archetypes.
+4. Add a hat and glasses from their tabs; hover to preview, click to keep. Add earrings if you want.
+5. Use the Layers block to hide the outfit and rebuild it, or leave it dressed.
+6. On the Animate tab, pick a looping emote (for example, Dance) to set the avatar's resting idle.
+7. Name it and click Save. The studio exports, optimizes, uploads, and lands you with a saved avatar you can animate and dress elsewhere.
+
+## Examples
+
+Avatar Studio is an interactive builder; its examples are its entry points and the account API it saves through.
+
+- **Create a new avatar:** [https://three.ws/avatar-studio](https://three.ws/avatar-studio) or [https://three.ws/create/studio](https://three.ws/create/studio)
+- **Edit a saved avatar:** `https://three.ws/avatar-studio?edit=<avatarId>`: reloads that avatar's appearance and updates the existing record on save.
+
+Fetching an avatar record (the same call the studio makes to load edit mode):
+
+```bash
+curl 'https://three.ws/api/avatars/<avatarId>' -H 'cookie: <session>'
+# → { "avatar": { "id": "…", "name": "…", "model_url": "…", "appearance": { … } } }
+```
+
+## States & limits
+
+- **No selfie, no camera.** This is the from-scratch path. To build an avatar from a photo, use the platform's selfie-to-avatar flow under [/create](https://three.ws/create) instead.
+- **Feminine base body.** The studio starts from a single feminine base model; masculine and other builds are not selected here (the posable primitive with a build toggle lives in [Animation Studio](./animation-studio.md)).
+- **Sculpt depends on the base's morphs.** The face/body sliders render against whatever morph targets the base GLB exposes; a slot with no matching morph simply does not appear.
+- **Save requires an account.** Export happens client-side, but persisting the avatar to your library needs sign-in. Optimization is best-effort: if compression fails, the original export is saved untouched so the save always completes.
+- **What you see is what you save.** Because the save exports the live scene graph, the stored GLB matches the viewport exactly, colors, morphs, accessories, and the chosen idle included.
+- **Drafts are local.** Unsaved work autosaves to local storage in create mode and is offered back on return; edit mode does not autosave a draft over the saved avatar.
+
+## Related
+
+- [Animation Studio](./animation-studio.md): pose and keyframe the avatar you build here.
+- [Scene Composer](./compose.md): forge props and attach them to the avatar's bones as a saved outfit.
+- [Mocap Studio](./mocap-studio.md): drive the avatar's face live from your webcam.
+- [Restyle Studio](./restyle.md): shares the same GLB optimize-and-validate path.
+- [Trait-based avatar builder](./character-studio.md): the separate VRM studio embedded in the agent editor; a deep dive into its internals.
+- [/create](https://three.ws/create): the hub for every avatar-creation path, including selfie-to-avatar.
+
+---
+
+<a id="sec-089"></a>
> **Source:** `docs/avatar-thumbnails.md` · [↑ table of contents](#table-of-contents)
@@ -20868,7 +22823,7 @@ that adoption HEAD-checks the preview object before persisting it.
---
-<a id="sec-082"></a>
+<a id="sec-090"></a>
> **Source:** `docs/aws-builder-center-marketplace-x402.md` · [↑ table of contents](#table-of-contents)
@@ -21127,7 +23082,7 @@ The product on the other side of all this plumbing is the platform: three.ws age
---
-<a id="sec-083"></a>
+<a id="sec-091"></a>
> **Source:** `docs/aws-builder-center-mcp-agents.md` · [↑ table of contents](#table-of-contents)
@@ -21242,7 +23197,7 @@ If you wire it into something, or you want to list a paid tool of your own, the
---
-<a id="sec-084"></a>
+<a id="sec-092"></a>
> **Source:** `docs/aws-marketplace-listing-kit.md` · [↑ table of contents](#table-of-contents)
@@ -21455,7 +23410,7 @@ Not done (requires AWS console / seller creds — cannot be done from this repo)
---
-<a id="sec-085"></a>
+<a id="sec-093"></a>
> **Source:** `docs/aws-marketplace.md` · [↑ table of contents](#table-of-contents)
@@ -21498,7 +23453,7 @@ For platform support, open an issue at [github.com/nirholas/three.ws/issues](htt
---
-<a id="sec-086"></a>
+<a id="sec-094"></a>
> **Source:** `docs/aws-partner-spotlight.md` · [↑ table of contents](#table-of-contents)
@@ -21594,7 +23549,7 @@ One product. Two ways to pay. One AWS bill.
---
-<a id="sec-087"></a>
+<a id="sec-095"></a>
> **Source:** `docs/bnb-babt-findings.md` · [↑ table of contents](#table-of-contents)
@@ -21790,16 +23745,19 @@ shipped:
---
-<a id="sec-088"></a>
+<a id="sec-096"></a>
> **Source:** `docs/bnb-payments.md` · [↑ table of contents](#table-of-contents)
# BNB Chain payments — MPP + gasless sends
-three.ws speaks two agent-payment protocols. Our catalog has always run **x402**
-(the CDP wire format) on Solana and Base. It now also speaks **MPP** — BNB
-Chain's Machine Payments Protocol — so agents from the BNB ecosystem can pay our
-endpoints, and our agents can pay theirs. This page explains both halves plus the
+three.ws lets AI agents pay for API calls with stablecoins, no account or API
+key needed. This page is for developers wiring an agent to pay (or charge) over
+BNB Chain. Our catalog has always run **x402** (the CDP wire format) on Solana,
+the home chain, and Base. It now also speaks **MPP** (BNB Chain's Machine
+Payments Protocol), so agents from the BNB ecosystem can pay our endpoints, and
+our agents can pay theirs. BNB Chain is an additional surface, not a
+replacement for the Solana rails. This page explains both halves plus the
gasless-send rail underneath, for a reader with zero prior context.
Everything here is real code against real endpoints. Where a capability needs a
@@ -21936,7 +23894,7 @@ const { hash, mode } = await sendGasless('bscTestnet', {
| Env var | Purpose | Required? |
|---|---|---|
-| `X402_PAY_TO_BSC` | Merchant payout address for MPP receipts | to advertise MPP |
+| `X402_PAY_TO_BSC` (alias `MPP_PAY_TO_BSC`) | Merchant payout address for MPP receipts | to advertise MPP |
| `B402_BASE_URL` / `B402_CLIENT_ID` / `B402_ACCESS_TOKEN` / `B402_PRIVATE_KEY` | b402 facilitator merchant creds (RSA "Tesla" signing) | to settle MPP on-chain |
| `NODEREAL_MEGAFUEL_KEY` | MegaFuel policy-management only (not the send path) | optional |
| `BNB_TESTNET_DEPLOYER_KEY` | Funded tBNB sender for live proofs | for live sends |
@@ -21952,21 +23910,30 @@ See also: the wire contract in [`specs/x402-mpp-bridge.md`](../specs/x402-mpp-br
and the [BNB Chain campaign context](../prompts/bnb-chain/00-CONTEXT.md) for the
full verified-facts list.
+## Related
+
+- [x402 on three.ws](/docs/x402) - the payment protocol our Solana/Base catalog runs
+- [The vault](/docs/bnb-vault) - encrypted 3D models gated by an on-chain BNB Chain purchase
+- [x402 Bazaar](/docs/mcp-x402-bazaar) - discovering paid services by capability and price
+
---
-<a id="sec-089"></a>
+<a id="sec-097"></a>
> **Source:** `docs/bnb-vault.md` · [↑ table of contents](#table-of-contents)
# The vault — encrypted 3D models gated by an on-chain BNB Chain purchase
-`/vault` sells access to encrypted 3D models. Buying one is a real BSC
-transaction against a real smart contract, which triggers a real cross-chain
-call into Greenfield's programmable storage — a genuinely unique capability
-BNB Chain has that Ethereum L1, Base, and (mostly) Solana don't (see
-`prompts/bnb-chain/00-CONTEXT.md`'s verified facts). This page explains what
-it is, how it's built, and how to reproduce the proof yourself. Everything
-here is real code against real endpoints; nothing is mocked.
+The vault, at [three.ws/vault](https://three.ws/vault), sells access to
+encrypted 3D models: sellers list an encrypted GLB, buyers pay on-chain and
+receive the key to decrypt and view it. Buying one is a real BSC transaction
+against a real smart contract, which triggers a real cross-chain call into
+Greenfield's programmable storage: a genuinely unique capability BNB Chain
+has that Ethereum L1, Base, and (mostly) Solana don't (see
+`prompts/bnb-chain/00-CONTEXT.md`'s verified facts). This page is for
+developers: it explains what the vault is, how it's built, and how to
+reproduce the proof yourself. Everything here is real code against real
+endpoints; nothing is mocked.
---
@@ -22041,7 +24008,7 @@ Greenfield…" for that window rather than faking an instant unlock.
## 4. Reproducing the proof
The public BSC testnet deploy is blocked on a funded deployer key (same wall
-documented across prompts 07/09/10/11/13/14/18 in `PROGRESS.md`). Every
+documented across prompts 07/09/10/11/13/14/18 in `prompts/bnb-chain/PROGRESS.md`). Every
piece of logic above is provable today against a **local anvil fork** — the
same technique prompt 11 used at the exported-function level, extended here
to drive the actual running HTTP endpoints and a real headless browser:
@@ -22092,9 +24059,14 @@ this campaign, not a bug in this code path.
model" panel on `/vault` is real code against the real upload + `list()`
path, exercised so far only on the local anvil fork above.
+## Related
+
+- [BNB Chain payments](/docs/bnb-payments) - MPP payments and the MegaFuel gasless-send rail the vault's `buy()` uses
+- [x402 on three.ws](/docs/x402) - the platform's pay-per-call protocol on Solana and Base
+
---
-<a id="sec-090"></a>
+<a id="sec-098"></a>
> **Source:** `docs/bnb-world.md` · [↑ table of contents](#table-of-contents)
@@ -22341,7 +24313,145 @@ reproduction commands are recorded in `contracts/DEPLOYMENTS.md`'s "Prompt
---
-<a id="sec-091"></a>
+<a id="sec-099"></a>
+
+> **Source:** `docs/brain.md` · [↑ table of contents](#table-of-contents)
+
+# Multi-LLM Brain: one prompt, every model, side by side
+
+The Brain lab sends a single prompt to many frontier models at once and streams
+their answers side by side, each with live latency and token stats. Claude, GPT,
+Qwen, ModelScope, Groq, and more respond in parallel so you can compare tone, speed,
+and cost before you wire a model into an agent. It is the fastest way to decide which
+brain an agent should carry.
+
+Page: [/brain](https://three.ws/brain) · API: `/api/brain/chat`
+
+## Why it exists
+
+Choosing a model from a spec sheet is guesswork. The only honest comparison is the
+same prompt, at the same moment, across every candidate, with real timing. Brain
+gives you that: a compare view that fans one prompt out to the whole roster and shows
+you who answered first, who was most thorough, and what each one cost in tokens. It
+also doubles as the model picker behind the Brain tab of
+[Agent Studio](./agent-studio.md), so the model you pick here is the model your agent
+runs on.
+
+## How it works
+
+`/api/brain/chat` is a multi-LLM proxy with two verbs.
+
+- **`GET /api/brain/chat`** returns the available providers and which are currently
+ reachable, so the UI can gray out anything whose upstream key is missing.
+- **`POST /api/brain/chat`** takes `{ provider, messages, system?, maxTokens? }` and
+ streams the answer back as Server-Sent Events:
+ - `event: meta` with `{ provider, label, network, model, tier }`
+ - `event: first` with `{ firstTokenMs }` (the time-to-first-token the UI shows)
+ - data-only frames carrying JSON-encoded text chunks
+ - `event: fallback` with `{ route }` when the proxy reroutes mid-request
+ (advisory; clients can ignore it)
+ - `event: done` with `{ elapsedMs, firstTokenMs, usage }` (the token stats)
+ - `event: error` with `{ message, elapsedMs }`
+
+Each provider spec declares its native first-party model (built from a first-party
+key when present) and the OpenRouter model id that mirrors it. The proxy prefers the
+native model and falls back to routing through OpenRouter, and if a native provider
+hits a quota, billing, or rate-limit error at request time it reroutes around the
+outage through the mirrored OpenRouter id. If the mirror fails too, a free-tier
+safety net answers before any error is surfaced: Groq Llama 3.3, then the OpenRouter
+`:free` route across every configured key, then NVIDIA NIM. A route only errors once
+no free provider can answer, and each handoff emits an `event: fallback` frame. The
+roster spans Anthropic (Claude Fable 5, Mythos 5, Opus 4.7, Sonnet 4.6, Haiku 4.5),
+OpenAI (GPT-OSS 120B, the GPT-5.x family, o3 family), xAI (Grok 4.x), Groq (Llama
+3.3 70B), DashScope (Qwen Plus), ModelScope (Qwen3-Coder 480B), DeepSeek R1, IBM
+Granite on watsonx.ai, and a free NVIDIA NIM lineup (Nemotron 3 Super 120B,
+Llama-Nemotron Super 49B, Nemotron Nano 9B, DeepSeek V4 Pro, Kimi K2.6, Llama 4
+Maverick, MiniMax M2.7). In compare mode the page opens one streaming POST per
+selected provider and renders them in a grid, so every model streams concurrently
+rather than in sequence.
+
+Anonymous callers are gated to the genuinely free tiers only (the OpenRouter-routed
+open-weight default and the free NVIDIA NIM models); every paid first-party model
+requires sign-in so an unauthenticated script cannot drain the server's billed API
+keys.
+
+## Walkthrough
+
+1. **Open [/brain](https://three.ws/brain).** The provider roster loads from
+ `GET /api/brain/chat`; unavailable providers are marked.
+2. **Pick your models.** Select one for a focused chat, or switch to Compare mode to
+ query all selected models at once.
+3. **Type one prompt.** Optionally set a system prompt to steer every model
+ identically.
+4. **Watch them stream.** Each column shows the model streaming in real time, with
+ time-to-first-token appearing the moment the first chunk lands.
+5. **Read the stats.** When a model finishes, its column shows total elapsed time and
+ token usage from the `done` event.
+6. **Commit a choice.** Carry the winner into your agent via the Brain tab of
+ [Agent Studio](./agent-studio.md).
+
+## Examples
+
+List the reachable providers:
+
+```bash
+curl -s https://three.ws/api/brain/chat
+# returns { providers: [ { key, label, network, available, ... }, ... ] }
+```
+
+Stream one model's answer as SSE (the free default needs no auth; paid models need a
+session or bearer token, see [Authentication](./authentication.md)):
+
+```bash
+curl -N -s -X POST https://three.ws/api/brain/chat \
+ -H 'content-type: application/json' \
+ -d '{
+ "provider": "gpt-oss-120b",
+ "system": "You are terse.",
+ "messages": [{ "role": "user", "content": "Name three uses for a 3D avatar." }],
+ "maxTokens": 256
+ }'
+# streams event: meta ... / event: first { firstTokenMs } / data chunks / event: done { elapsedMs, usage }
+```
+
+To compare, open one POST per provider concurrently (this is exactly what Compare mode
+does in the browser):
+
+```bash
+for p in claude-sonnet-4-6 gpt-oss-120b groq-llama modelscope-qwen; do
+ curl -N -s -X POST https://three.ws/api/brain/chat \
+ -H 'content-type: application/json' \
+ -H "authorization: Bearer $THREEWS_TOKEN" \
+ -d "{\"provider\":\"$p\",\"messages\":[{\"role\":\"user\",\"content\":\"One-line pitch for three.ws\"}]}" &
+done; wait
+```
+
+## States and limits
+
+- **Availability gating.** A provider whose upstream key is absent shows as
+ unavailable in the roster and is skipped rather than erroring mid-stream.
+- **Anonymous scope.** Signed-out users can only call the free tiers (the
+ OpenRouter-routed default and free NVIDIA NIM models). Paid first-party models
+ return an auth requirement.
+- **Automatic failover.** A native provider outage (quota, billing, rate limit) is
+ rerouted through the mirrored OpenRouter model at request time, so a single upstream
+ hiccup does not blank a column.
+- **Streaming errors are per-column.** An `event: error` frame fails only that
+ provider's column; the rest keep streaming.
+- **Token stats.** `usage` in the `done` event reflects the provider's reported token
+ counts; context window and tier shown per model come from the roster metadata.
+
+## Related
+
+- [Agent Studio](./agent-studio.md): the Brain tab uses this same backend
+- [Agent System](./agent-system.md): how a chosen brain fits the agent model
+- [Persona Hub](./persona-hub.md): synthesizing the system prompt a brain runs
+- [API reference](./api-reference.md) and [Authentication](./authentication.md)
+- Pages: [/brain](https://three.ws/brain), [/agent-studio](https://three.ws/agent-studio)
+
+---
+
+<a id="sec-100"></a>
> **Source:** `docs/btn-pill-migration.md` · [↑ table of contents](#table-of-contents)
@@ -22465,7 +24575,7 @@ These classes are defined across the codebase. Follow-up agents should replace t
---
-<a id="sec-092"></a>
+<a id="sec-101"></a>
> **Source:** `docs/build.md` · [↑ table of contents](#table-of-contents)
@@ -22480,7 +24590,9 @@ touching the build pipeline.
| Command | What it does |
| --- | --- |
| `npm run build` | The app build: `prebuild` lifecycle → `vite build` (`--max-old-space-size=6144`) → `scripts/strip-sw-from-embeds.mjs` → `scripts/inject-tour-boot.mjs`. Output → `dist/`. |
-| `npm run deploy:gcp` | The **production deploy**: `check:dist` + `db:check` gates → `gcloud builds submit` (Docker image via `server/cloudbuild.yaml`) → Cloud Run (`three-ws-api`, `us-central1`) → CDN cache purge. Run `npm run build` first so `dist/` is current (see [CI parity](#ci-parity)). |
+| `npm run build:gcp` | The **full pre-deploy build**, in the load-bearing order: build info snapshot → `npm run build` (the vite build wipes `dist/`, so it must run first) → UMD library build (`build:lib:full`) → `publish:lib` (mirrors the library into `dist/`) → `build:info` → `check:dist`. Run this, not bare `npm run build`, before deploying: `check:dist` fails without the published library bundle. |
+| `npm run deploy:gcp` | The **production deploy**: `check:dist` + `db:check` gates → `gcloud builds submit` (Docker image via `server/cloudbuild.yaml`) → Cloud Run (`three-ws-api`, `us-central1`) → CDN cache purge. Run `npm run build:gcp` first so `dist/` is complete (see [CI parity](#ci-parity)). |
+| `npm run deploy:gcp:full` | `build:gcp` + `deploy:gcp` in one command. |
| `npm run build:vercel` | Legacy full-build orchestrator (`scripts/build-vercel.mjs`) from the Vercel era — runs the gate suite, bundles the API with esbuild, and builds every sub-package. **Not on the Cloud Run deploy path**; kept for full local reproduction (see [the trap](#the-esbuild-overwrite-trap)). |
| `npm run clean` | `rm -rf dist/* dist-lib/*`. |
| `npm run check:dist` | Asserts the published `agent-3d` library bundle + `dist-lib` mirror exist and the version matches `package.json` (`scripts/check-dist.mjs`). |
@@ -22494,10 +24606,14 @@ Production runs on **Google Cloud Run** (service `three-ws-api`, region
deploy is two steps from the repo root:
```bash
-npm run build # produce dist/ (the front-end Cloud Run serves)
+npm run build:gcp # produce a complete dist/ (app build, then the library mirror check:dist requires)
npm run deploy:gcp # build the image + deploy to Cloud Run
```
+(`npm run deploy:gcp:full` runs both.) Bare `npm run build` is the app build
+only: the vite step wipes `dist/`, so without the follow-on `publish:lib`
+mirror the `check:dist` gate fails. `build:gcp` encodes the correct order.
+
`deploy:gcp` runs `check:dist` and `db:check`, then `gcloud builds submit
--config server/cloudbuild.yaml`. Cloud Build builds the root `Dockerfile` on a
32-vCPU machine with BuildKit inline caching (an unchanged `package-lock.json`
@@ -22505,9 +24621,9 @@ skips `npm ci`), pushes the image, deploys it to Cloud Run in one run, and the
`deploy:gcp:purge-cdn` step invalidates the CDN cache. The image copies the
already-built `dist/` and runs `server/index.mjs`, which serves the static
front-end, the `vercel.json` route table, and every `api/**` handler from source
-(no per-route bundling). The ~76 scheduled jobs run on **Google Cloud
-Scheduler** driven off the `vercel.json` cron list; there is **no GitHub Actions
-CI**. Full runbook: [docs/ops/gcp-production.md](./ops/gcp-production.md).
+(no per-route bundling). The scheduled jobs (89 crons in `vercel.json` at last
+count) run on **Google Cloud Scheduler** driven off the `vercel.json` cron
+list; there is **no GitHub Actions CI**. Full runbook: [docs/ops/gcp-production.md](./ops/gcp-production.md).
`.npmrc` sets `legacy-peer-deps=true` (npm never auto-installs peers — the
reason `audit:deploy` checks the peer tree), and `engines.node` pins Node
@@ -22538,8 +24654,8 @@ write the bundle back over the source: `esbuild ... --outdir=api
Run image serves `api/**` from source, a committed bundle ships broken handlers.
If one of those
bundles is `git add`ed and committed, the real source is lost and the repo
-balloons by millions of generated lines. This has happened twice
-(commits `c94190b3`, `dabd5884` — both reverted).
+balloons by millions of generated lines. This has happened twice before; both
+incidents had to be reverted.
A bundled file is unmistakable: its opening lines carry esbuild's interop
helpers (`__defProp`, `__commonJS`, `__toESM`, `__esm`) or the `bundle-api`
@@ -22560,7 +24676,7 @@ node scripts/guard-esbuild-bundles.mjs --files api/foo.js # explicit paths
Detection logic is unit-tested (`tests/guard-esbuild-bundles.test.js`): it must
catch real esbuild/banner output and must not false-positive on a hand-written
-route (verified clean across all 1100+ `api/**/*.js`).
+route (verified clean across all 1700+ `api/**/*.js`).
### Wiring it as a pre-commit hook
@@ -22614,15 +24730,124 @@ is idempotent and fails loudly if no embed HTML is found. Verify with:
grep -l 'vite-plugin-pwa:register-sw' dist/widget.html dist/embed.html # expect: no matches
```
+## Related
+
+- [Deployment](/docs/deployment) - the deployment overview
+- [Architecture](/docs/architecture) - how the pieces fit together
+- [Contributing](/docs/contributing) - workflow and conventions for changes
+
---
-<a id="sec-093"></a>
+<a id="sec-102"></a>
+
+> **Source:** `docs/capture.md` · [↑ table of contents](#table-of-contents)
+
+# Scene Capture: video to explorable 3D point cloud
+
+Scene Capture turns a phone video of any space into an explorable 3D point cloud you can orbit in the browser. Film a room, a street, or an object, hand it a public video URL, and a streaming feed-forward reconstruction fuses the frames into a coloured `.ply` that renders live with WebGL. Already have a point cloud? Drop it in or paste a URL and skip straight to the viewer.
+
+Page: [/capture](https://three.ws/capture) · API: `/api/scene-capture`
+
+## Why it exists
+
+Photogrammetry and SLAM traditionally mean an offline pipeline: extract frames, match features, bundle-adjust, and wait. Scene Capture collapses that into a single feed-forward pass: no per-scene optimization, no manual camera poses, just frames in and dense world-space geometry out. It is the fastest way to go from "I filmed this place on my phone" to "I can orbit this place in my browser," and because the output is a standard coloured `.ply`, it drops into any point-cloud tool afterward.
+
+## How it works
+
+The endpoint (`api/scene-capture.js`) routes to `workers/model-video2scene`, a GPU worker on Cloud Run running **LingBot-Map**, a feed-forward Geometric Context Transformer that reconstructs dense world-space geometry directly from video frames. You submit a public https URL to an mp4, mov, or webm; the handler resolves and validates the host itself (rejecting private, loopback, and metadata IPs as defense in depth against SSRF) before handing the URL to the worker. Submission returns `202 { job_id, status, eta_seconds }`, and the browser polls `GET /api/scene-capture?job=<id>` until the worker returns a `result_url` for the finished `.ply`, along with `num_points` and `frames`.
+
+Reconstruction exposes real, clamped sampling knobs:
+
+| Param | Range | Default | What it controls |
+| --- | --- | --- | --- |
+| `mode` | `streaming` / `windowed` | `streaming` | Continuous streaming fusion, or fixed-window batches. |
+| `fps` | 1-30 | 8 | Frames sampled per second of video. |
+| `keyframe_interval` | 1-64 | 4 | Spacing between keyframes. |
+| `num_scale_frames` | 2-16 | 8 | Frames used to resolve metric scale. |
+| `window_size` | 16-512 | 128 | Frame window for the windowed mode. |
+| `conf_percentile` | 0-95 | 30 | Confidence floor for keeping a point. |
+| `max_points` | 50k-3M | 1.5M | Cap on total output points. |
+| `voxel_size` | 0-10 | 0 | Optional voxel downsampling. |
+| `mask_sky` | bool | true | Drop sky pixels so open scenes don't fill with noise. |
+
+The result is a binary `.ply` the page renders client-side with a WebGL point-cloud viewer (`src/scene-capture.js` and `pointcloud-viewer.js`). Every state is designed: idle, submitting, processing (with an elapsed timer and stage hints), live, and error. There is no mock path: when the worker env (`GCP_VIDEO2SCENE_URL` and `GCP_RECONSTRUCTION_KEY`) is not configured, the endpoint returns a clean 503 and the page still proves the renderer end-to-end with a built-in sample room cloud. You can also load any `.ply` you already have by URL or file, so the viewer is useful even where reconstruction is offline.
+
+## Walkthrough
+
+1. Open [/capture](https://three.ws/capture).
+2. Try the sample cloud first to confirm the viewer renders on your device.
+3. To reconstruct, film a space, upload the video somewhere public, and paste its https URL. Slow, overlapping passes with good lighting reconstruct best.
+4. Submit. A processing state shows the elapsed time and stage hints while the worker streams frames through LingBot-Map.
+5. When the point cloud lands it renders live: orbit, zoom, and pan. The HUD shows the point count.
+6. Download the `.ply`, or load a different cloud by URL or file.
+
+## Examples
+
+Reconstruction is an async job over a public video URL.
+
+```bash
+# Start a reconstruction from a public video, then poll for the .ply.
+JOB=$(curl -s -X POST 'https://three.ws/api/scene-capture' \
+ -H 'content-type: application/json' \
+ -d '{"video_url":"https://example.com/room-walkthrough.mp4","mode":"streaming","fps":8}' \
+ | python3 -c 'import sys,json;print(json.load(sys.stdin).get("job_id",""))')
+
+curl "https://three.ws/api/scene-capture?job=$JOB"
+```
+
+Tune sampling for a denser cloud from a longer clip:
+
+```bash
+curl -X POST 'https://three.ws/api/scene-capture' \
+ -H 'content-type: application/json' \
+ -d '{"video_url":"https://example.com/street.mp4","fps":12,"keyframe_interval":6,"max_points":2500000,"mask_sky":true}'
+```
+
+Poll until the cloud is ready in JavaScript:
+
+```javascript
+const start = await fetch('https://three.ws/api/scene-capture', {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({ video_url: 'https://example.com/object-orbit.mp4' }),
+}).then((r) => r.json());
+
+let job = start;
+while (job.status !== 'done' && job.status !== 'failed') {
+ await new Promise((r) => setTimeout(r, 4000));
+ job = await fetch(`https://three.ws/api/scene-capture?job=${start.job_id}`).then((r) => r.json());
+}
+console.log(job.result_url, job.num_points); // coloured .ply + point count
+```
+
+## States and limits
+
+- **Input** is a public https URL to an mp4, mov, or webm. Private, loopback, and metadata hosts are rejected before the worker sees the URL.
+- **Processing**: a real elapsed timer with stage hints, driven by the poll lifecycle, not a fake bar.
+- **Unconfigured (503)**: when the video2scene worker env is absent, the page falls back to a sample room cloud so the renderer still works end-to-end. No fabricated reconstruction is ever shown.
+- **Error**: an invalid `.ply` reports "that isn't a valid point cloud"; a blocked fetch explains the CORS limit.
+- **Point cap** defaults to 1.5M and tops out at 3M; `voxel_size` and `conf_percentile` trade density for cleanliness.
+- **Client-side rendering**: the `.ply` is decoded and displayed in the browser with WebGL; very large clouds are bounded by your device's GPU and memory.
+- Rate limits are per client IP on the shared 3D generation buckets.
+
+## Related
+
+- [Splat Viewer](./splat.md) renders Gaussian-splat radiance fields, the photoreal cousin of point clouds.
+- [/avatar-engines](https://three.ws/avatar-engines) covers the Geometric Context Transformer and related capture engines.
+- [Forge](./forge.md) and [Image to 3D](./image-to-3d.md) for generating meshes from prompts and photos.
+- Pages: [/scene](https://three.ws/scene) (Scene Studio), [/create](https://three.ws/create).
+
+---
+
+<a id="sec-103"></a>
> **Source:** `docs/changelog.md` · [↑ table of contents](#table-of-contents)
# Changelog & Versioning
-This document covers how three.ws is versioned, what has changed across releases, and how to upgrade safely.
+This document covers how three.ws is versioned, what has changed across releases, and how to upgrade safely. It is aimed at developers pinning the SDK or CDN bundle.
+
+> **Looking for what shipped this week?** Day-to-day product updates are published continuously on the live changelog at [three.ws/changelog](https://three.ws/changelog) (also available as [JSON](https://three.ws/changelog.json) and [RSS](https://three.ws/changelog.xml)). The versioned entries below track the platform/SDK release history rather than every product change.
---
@@ -22898,7 +25123,7 @@ console.log(latest); // "1.5.2"
## Deprecated Features
-No public-facing features are currently deprecated. The only `@deprecated` annotations in the codebase are inside vendored dependencies (Three.js r175 internals) and have no effect on the public API.
+No public-facing features are currently deprecated. The only `@deprecated` annotations in the codebase are inside vendored dependencies (Three.js internals) and have no effect on the public API.
When features are deprecated, they will be listed here with:
@@ -22937,28 +25162,39 @@ cd sdk && npm publish
---
-<a id="sec-094"></a>
+## Related
+
+- [Introduction](/docs/introduction): what the platform is and how the layers fit together
+- [Quick Start](/docs/quick-start): pin the CDN bundle or install the SDK
+- [SDK Reference](/docs/sdk): the npm packages this versioning policy covers
+- [Deployment](/docs/deployment): how a release actually ships to production
+
+---
+
+<a id="sec-104"></a>
> **Source:** `docs/character-studio.md` · [↑ table of contents](#table-of-contents)
# Avatar Studio
-Avatar Studio is a browser-based 3D avatar builder built into three.ws. It lets you design a fully customized humanoid avatar — body, hair, face, clothing, and accessories — using a point-and-click interface with no 3D modeling experience required.
+This page documents the Character Studio avatar builder: a browser-based tool for designing a customized humanoid avatar (body, hair, face, clothing, accessories) with a point-and-click interface and no 3D modeling experience required. The result is a GLB/VRM file that works with every three.ws feature: animations, the emotion system, AR viewing, and web embedding.
-The result is a GLB/VRM file that works with every three.ws feature: animations, the emotion system, AR viewing, and web embedding.
+It is a rebranded fork of the open-source (MIT license) [M3-org/CharacterStudio](https://github.com/M3-org/CharacterStudio) project and lives in the `character-studio/` directory of the repo.
-**Access:** [https://three.ws/studio](https://three.ws/studio) → Avatar tab
-
-Avatar Studio is open-source (MIT license) and built on the [M3-org/CharacterStudio](https://github.com/M3-org/CharacterStudio) project.
+**Note:** the platform's primary from-scratch builder, the page served at [three.ws/avatar-studio](https://three.ws/avatar-studio) and [three.ws/create/studio](https://three.ws/create/studio), is a separate native implementation documented in [Avatar Studio (native)](/docs/avatar-studio). The Character Studio fork on this page is the trait-based builder behind the "three.ws Studio" option described below.
---
## Getting Started
-1. Go to [https://three.ws/studio](https://three.ws/studio)
-2. Click **Avatar** in the top navigation
-3. Click **Create Avatar** — Avatar Studio opens in a new panel
-4. Start customizing using the sections in the left panel
+Where you meet it in the product:
+
+1. Open an agent's edit page (`https://three.ws/agent/<agent-id>/edit`)
+2. Click the avatar tile and choose **three.ws Studio** ("In-browser builder: hair, clothing, body") from the create menu
+3. The builder opens in a modal iframe; customize using the sections in the left panel
+4. Click **Save Avatar**; the finished GLB is handed back to the agent editor automatically
+
+It is also mounted standalone on the Avatar OS demo page at [/demo/avatar-os](https://three.ws/demo/avatar-os), and developers can run it directly with `npm run dev` inside `character-studio/`.
**Account:** No account is needed to build and export an avatar. An account is required to save your avatar to an agent and use it on the platform.
@@ -22966,55 +25202,22 @@ Avatar Studio is open-source (MIT license) and built on the [M3-org/CharacterStu
## The Customization Interface
-The left panel is organized into sections. Every change you make is reflected immediately in the 3D preview in the center.
-
-### Body
-
-- **Body type** — proportions and height presets
-- **Skin tone** — continuous slider from light to dark
-- **Skin texture** — smooth, freckles, and other surface variations
-
-### Head
-
-- **Face shape** — round, oval, square, heart
-- **Jaw line** — narrow to wide
-- **Forehead height** — adjustment slider
-
-### Hair
-
-- **Style gallery** — 20+ styles including short, long, curly, braided, and bald options
-- **Color picker** — solid colors and ombre combinations
-- **Accessories** — clips, ties, and similar items
-
-### Eyes
-
-- **Shape** — almond, round, hooded, and others
-- **Iris color** — full color picker
-- **Eyelashes** — style and density options
+The builder is trait-based. You first pick a base character class, then swap and tint the individual trait items that class defines. Every change is reflected immediately in the 3D preview.
-### Eyebrows
+### Character classes
-- **Shape** — arched, straight, thick, thin
-- **Color** — matches hair color automatically, or set independently
+The class list comes from `character-studio/public/manifest.json`. The shipped classes are:
-### Nose & Mouth
-
-- **Nose shape** — selection of presets
-- **Lip shape** — thin, medium, full
-- **Lip color** — natural tones or custom color
-
-### Clothing
-
-- **Top** — t-shirts, shirts, jackets, hoodies, tanks
-- **Bottom** — pants, skirts, shorts, jeans
-- **Shoes** — sneakers, boots, heels, sandals
-- Colors and patterns available for each item
+| Class | Description | Format |
+|---|---|---|
+| Anata (Female) | Stylized female humanoid | VRM |
+| Anata (Male) | Stylized male humanoid | VRM |
+| ON1FORCE | Demon character | VRM |
+| TUBBY CAT | Cute cat character | VRM |
-### Accessories
+### Traits
-- Glasses (multiple frame styles)
-- Hats (baseball cap, beanie, beret, and others)
-- Earrings, necklaces, and watches
+Each class has its own trait manifest (hair, clothing, accessories, and other slots, as that class defines them). Trait assets are the upstream [loot-assets](https://github.com/m3-org/loot-assets) library, mirrored same-origin through `GET /api/studio-assets/<path>` (`api/studio-assets/[...path].js`) so the browser never hits a vendor CDN. Selecting a trait swaps the mesh live; traits that declare color support expose a color picker.
---
@@ -23024,72 +25227,46 @@ The center panel shows your avatar in real time using a Three.js WebGL renderer.
- **Rotate** — click and drag
- **Zoom** — scroll wheel
-- **Animation preview** — toggle between T-pose (neutral) and an idle animation loop
-
-Switch the background environment using the environment selector:
+- **Animation preview**: the preview avatar plays clips from the manifest's default animation set, so you see the character in motion rather than a static T-pose
-- Neutral studio (white background)
-- Outdoor sunset
-- Indoor office
-
-Every customization change updates the preview instantly — no waiting for assets to reload.
+Every trait change updates the preview live from the already-loaded asset library.
---
## Exporting Your Avatar
-### Download as GLB
+### Standalone (running the builder directly)
-1. Click **Export** → **Download GLB**
-2. The file downloads to your computer
-3. Drag and drop it into the three.ws editor, or host it on your own CDN
+The export menu offers direct downloads:
-### Save to Your Account
+- **GLB**: a single self-contained binary glTF file
+- **VRM 0** and **VRM 1**: VRM exports for VRM-native applications
-1. Click **Save to My Agents**
-2. Sign in (or create an account)
-3. The avatar is saved to your account and linked to a new agent
-4. You can open the agent in the editor immediately
+### Embedded (the "three.ws Studio" flow)
-The exported GLB is a single self-contained file — all textures and meshes are baked in and optimized for real-time use.
+When the builder runs inside the Avatar Creator iframe, the export menu shows a single **Save Avatar** button instead. It builds the GLB in the browser and hands the bytes back to the host page via `postMessage`; the agent editor adopts it as the agent's avatar. Nothing uploads until the host app saves it to your account.
-### One-Click Optimization
+### Export optimization options
-Before exporting, click **Optimize** to:
+The merge options panel controls how the export is assembled:
-- Merge all skinned meshes into a single draw call
-- Generate a texture atlas from individual textures
-- Automatically cull hidden geometry (faces underneath clothing layers)
+- **Texture atlas**: combine individual trait textures into shared atlases (separate standard and MToon atlases, each with configurable size)
+- **KTX2 compression**: GPU-compressed textures for smaller files
+- **Two-sided material**: force double-sided rendering when needed
-Optimized avatars render faster and use less GPU memory, which matters in scenes with multiple agents or AR contexts.
+Mesh merging and hidden-face culling run at export time (`character-studio/src/library/merge-geometry.js`, `cull-mesh.js`, `create-texture-atlas.js`), so the output is optimized for real-time use.
---
## Morph Targets and the Emotion System
-Every avatar created in Avatar Studio includes the full set of morph targets required by the three.ws emotion system. These are baked into the exported file automatically — you don't need to add them manually.
-
-The included morph targets are:
-
-| Morph target | Used for |
-|---|---|
-| `mouthSmile` | Celebration, positive sentiment |
-| `mouthFrown` | Concern, negative sentiment |
-| `mouthOpen` | Speech, excitement |
-| `cheekPuff` | Celebration |
-| `browInnerUp` | Concern, empathy |
-| `browOuterUp` | Curiosity |
-| `noseSneer` | Concern |
-| `eyeSquint` | Empathy |
-| `eyesClosed` | Patience (subtle) |
-
-The agent runtime blends these continuously based on emotional state — no per-avatar configuration needed.
+Exported avatars carry whatever blendshapes their source trait assets include; VRM expression data is preserved through `@pixiv/three-vrm`. The three.ws emotion system drives ARKit-style blendshape names (`mouthSmile`, `browInnerUp`, `eyesClosed`, and similar; see the [3D Viewer](/docs/viewer) morph-target reference) whenever the loaded model exposes them, with no per-avatar configuration. If a model lacks a given target, that expression channel simply does not animate.
---
## Animation Compatibility
-Avatar Studio avatars use a VRM-compliant skeleton with Mixamo-compatible bone names:
+Exported avatars use the VRM humanoid skeleton:
```
Hips → Spine → Chest → Neck → Head
@@ -23101,26 +25278,26 @@ RightUpperLeg → RightLowerLeg → RightFoot
This means:
-- **Mixamo animations work directly** — download any animation from Mixamo and attach it
-- **The three.ws animation library is fully compatible** — all built-in clips (idle, wave, gesture, walk) work out of the box
-- **Retargeting** is handled automatically by the animation manager
+- **Mixamo animations work**: the fork retargets Mixamo FBX clips onto the VRM rig (`loadMixamoAnimation.js`, `VRMRigMapMixamo.js`)
+- **The three.ws animation library is fully compatible**: the platform's bone-name canonicalizer (`src/glb-canonicalize.js`) maps VRM rigs to the canonical set, so all built-in clips (idle, wave, walk, and the rest) work out of the box
+- **Retargeting** is handled automatically by the animation manager (`src/animation-retarget.js`)
---
## The Asset Library
-Avatar Studio uses a manifest-driven asset system. Each clothing item, hair style, and accessory is a separate GLB file stored in `/character-studio/public/`. The `manifest.json` file lists what is available and how items attach to the base skeleton.
+The builder uses a manifest-driven asset system. `character-studio/public/manifest.json` lists the character classes; each class entry points at a per-class trait manifest that defines the trait slots and the individual VRM assets that fill them. The trait assets themselves are the open-source [loot-assets](https://github.com/m3-org/loot-assets) library, served through the three.ws proxy at `/api/studio-assets/` in production. For local development, `npm run get-assets` inside `character-studio/` clones the library into `public/`.
-At export time, the selected assets are merged into a single GLB using `@gltf-transform/core` — texture atlasing and mesh merging happen at this stage.
+At export time, the selected trait meshes are merged and their textures atlased by the fork's own pipeline (`merge-geometry.js`, `create-texture-atlas.js`, `cull-mesh.js` under `character-studio/src/library/`), producing a single GLB or VRM.
### Contributing New Assets
The asset library is open-source and welcomes contributions:
-1. Create your 3D asset in Blender using the Avatar Studio base mesh as reference
+1. Create your 3D asset in Blender using the relevant base mesh as reference
2. Follow the vertex group and UV conventions documented in the [CharacterStudio docs](https://m3-org.github.io/characterstudio-docs/)
-3. Export as GLB with correct bone weights
-4. Submit a pull request adding the asset and its manifest entry to `/character-studio/public/`
+3. Export in the class's format (VRM) with correct bone weights
+4. Submit a pull request to the upstream [m3-org/loot-assets](https://github.com/m3-org/loot-assets) repository, adding the asset and its manifest entry
---
@@ -23130,18 +25307,18 @@ For developers who want to understand the internals or self-host:
| Component | Technology |
|---|---|
-| Frontend framework | React 18 + Vite |
+| Frontend framework | React 19 + Vite |
| 3D rendering | Three.js (WebGL) |
| VRM model support | @pixiv/three-vrm |
-| State management | Zustand |
-| GLB manipulation | @gltf-transform/core |
-| Optimization | Texture atlasing, mesh merging, face culling |
+| State management | Zustand + React context |
+| GLB/VRM export | three.js GLTFExporter plus the fork's VRM exporters (`VRMExporter.js`, `VRMExporterv0.js`) |
+| Optimization | Texture atlasing, mesh merging, face culling (custom modules in `src/library/`) |
The core of the system is `CharacterManager` in `character-studio/src/library/characterManager.js`. It orchestrates trait loading, mesh combining, animation playback, and VRM export. The UI layer communicates with it through React context (`SceneContext`, `ViewContext`).
-**Integration with the main app:** The `AvatarCreator` class in `src/avatar-creator.js` opens Avatar Studio in an iframe and listens for a `postMessage` export event. When the user clicks Export inside Avatar Studio, the GLB blob is passed back to the parent app.
+**Integration with the main app:** The `AvatarCreator` class in `src/avatar-creator.js` opens the builder in an iframe (served same-origin under `/avatar-studio`; the production build is mirrored into `dist/avatar-studio/` by the `copy-avatar-studio` Vite plugin, and the dev server serves `character-studio/build` at the same path) and listens for the `characterstudio` `postMessage` export event. When the user clicks Save Avatar inside the builder, the GLB bytes are passed back to the parent app.
-**Build:** `npm run dev` inside `/character-studio/` starts the dev server. `npm run build` outputs to `./build/` for GitHub Pages deployment. Run `npm run get-assets` first to clone the required loot-assets into the public directory.
+**Build:** `npm run dev` inside `character-studio/` starts the dev server. `npm run build` outputs to `./build/`, which the main repo build copies into `dist/avatar-studio/`. Run `npm run get-assets` first to clone the required loot-assets into the public directory.
---
@@ -23177,8 +25354,9 @@ offers three real paths, each ending in a GLB the world adopts immediately:
background so peers can load it too (`play-handoff.js`).
2. **Upload a .glb** — bring a model from Blender, Mixamo, VRoid, or any tool. Validated
client-side (`avatar-upload.js` `validateGlb`) before it becomes your avatar.
-3. **Advanced studio** — opens the full Avatar Studio (above) at `/create/studio` in a new
- tab for deep body/face/hair/clothing sculpting, then saves to your account.
+3. **Advanced studio**: opens the native Avatar Studio at `/create/studio` in a new
+ tab for deep body/face/hair/clothing sculpting, then saves to your account
+ (see [Avatar Studio (native)](/docs/avatar-studio)).
### The in-game wardrobe economy
@@ -23229,11 +25407,171 @@ HUD button.
- **Asset library scope.** Customization is limited to items in the included asset library. Adding entirely new clothing shapes requires creating a 3D asset and submitting it to the library.
- **Granular face morphing.** Individual face feature morphing (e.g., nose width, cheekbone height via sliders) is not yet available — face customization is preset-based.
-For cases that need more control than Avatar Studio provides, create your avatar in Blender or another 3D tool and import the GLB directly into the three.ws editor.
+For cases that need more control than the studio provides, create your avatar in Blender or another 3D tool and import the GLB directly into the three.ws editor.
+
+## Related
+
+- [Avatar Studio (native)](/docs/avatar-studio): the from-scratch builder at /avatar-studio
+- [Avatar creation](/docs/avatar-creation): the selfie photo-to-avatar path
+- [Editor Guide](/docs/editor): refine any exported GLB
+- [Animations](/docs/animations): the clip library every avatar can play
---
-<a id="sec-095"></a>
+<a id="sec-105"></a>
+
+> **Source:** `docs/chatgpt-ar.md` · [↑ table of contents](#table-of-contents)
+
+# AR in ChatGPT
+
+How a sentence typed into ChatGPT becomes a 3D model standing in your room. This document covers the whole pipeline: the free generation lane ChatGPT calls, the place-in-your-room link (`arUrl`) every generation carries, the device-aware launcher behind that link, the living-avatar handoff for rigged bodies, and how a shared link unfurls with a real render of the model.
+
+Nothing here is ChatGPT-exclusive. ChatGPT is the first surface that ships the full flow, but every contract below is public and keyless, so any agent, MCP client, or plain HTTP caller gets the identical capability.
+
+If you just want to try it, start with the tutorial: [Your first prompt to 3D in ChatGPT](/tutorials/first-prompt-to-3d).
+
+---
+
+## The one-link design
+
+ChatGPT cannot run WebGL, ARKit, or ARCore. It can only print links. So the entire AR capability is compressed into a single URL that any chat surface can hand to the user:
+
+```
+https://three.ws/api/ar?src=<glbUrl>&title=<name>
+https://three.ws/api/ar?src=<glbUrl>&title=<name>&kind=avatar (rigged avatar)
+```
+
+- `src` (required): a public `https` `.glb`/`.gltf` URL, URL-encoded.
+- `title` (optional): a human label, trimmed to 80 characters. The generation pipeline puts the user's prompt here so the AR page arrives labeled.
+- `kind=avatar` (optional): marks the model as a rigged agent body and unlocks the living-agent lane (below).
+
+Every free generation endpoint returns this link as the `arUrl` field, built by one shared constructor (`buildArLaunchUrl` in [api/_lib/ar-launch.js](../api/_lib/ar-launch.js), mirrored by `arLaunchUrl` in [api/_mcp-studio/forge-client.js](../api/_mcp-studio/forge-client.js)). ChatGPT's only job is to print it. Everything hard (device detection, format conversion, the AR session itself) happens on the three.ws side after the tap, which is why one URL works identically in ChatGPT, Claude, an email, or a text message.
+
+---
+
+## The two ChatGPT surfaces
+
+The same free lane ships into ChatGPT twice, because ChatGPT has two integration models with different strengths.
+
+### 1. The ChatGPT app (Apps SDK / MCP connector)
+
+The MCP connector at `https://three.ws/api/mcp-studio` (no authentication) exposes six free generation tools: `forge_free`, `text_to_avatar`, `mesh_forge`, `rig_mesh`, `forge_avatar`, and `refine_model`. Full server documentation: [3D Studio MCP](./mcp-studio.md).
+
+Every successful tool result carries `arUrl` in its `structuredContent`, and the inline 3D widget renders it as a **View in your space** button next to the rotatable model. When the result is a rigged avatar the response additionally carries `irlUrl` and the button becomes **Bring it to life**. Refined versions (`refine_model`) each carry their own `arUrl`, so any point in the version lineage can be placed in the room.
+
+### 2. The "three.ws 3D Studio" custom GPT (Actions)
+
+Not every ChatGPT plan supports connectors, so the same lane also ships as a plain REST Actions surface for the custom GPT in the GPT Store:
+
+```bash
+curl -s -X POST https://three.ws/api/3d/studio \
+ -H 'content-type: application/json' \
+ -d '{"prompt":"a small ceramic robot figurine"}'
+```
+
+Submit returns either the finished model or a job to poll:
+
+```json
+{ "status": "pending", "job": "…", "poll": "/api/3d/studio?job=…&title=a%20small%20ceramic%20robot%20figurine", "format": "glb" }
+```
+
+```json
+{
+ "status": "done",
+ "glbUrl": "https://three.ws/cdn/creations/…/model.glb",
+ "viewerUrl": "https://three.ws/viewer?src=…",
+ "arUrl": "https://three.ws/api/ar?src=…&title=a%20small%20ceramic%20robot%20figurine",
+ "format": "glb"
+}
+```
+
+Design decisions on this endpoint, all deliberate:
+
+- **Store-clean responses.** The payload carries model URLs and job state only: no pricing, no upgrade hints, no internal identifiers, no wallet or token surface. That is what makes it publishable as a GPT Store action. (The agent-facing twin, `POST /api/3d/generate`, returns the same core fields plus `tier`/`free`/`upgrade`; see [the free 3D API](./3d-api.md).)
+- **The title-carrying poll.** ChatGPT Actions never resend context, so the submit response embeds the prompt in the poll URL as `&title=`. When the poll finally returns `done`, the `arUrl` and `viewerUrl` are labeled with the original prompt without the GPT doing anything except calling the poll path verbatim.
+- **Timeout honesty.** Actions calls time out around 45 seconds; generation takes 20 to 60. The endpoint holds the request as long as it safely can and falls back to `pending` + poll rather than dying mid-request.
+- **Safety before GPU.** Every prompt passes an age-13+ appropriateness gate ([api/_mcp-studio/safety.js](../api/_mcp-studio/safety.js)) before any provider work; refusals return `400 prompt_rejected` with a clear message.
+
+The GPT's instructions tell it to present three links on every finished model, in this order: **See it in your space** (`arUrl`), **Preview in your browser** (`viewerUrl`), **Download** (`glbUrl`), and to never fabricate a URL an action did not return. The checked-in OpenAPI schema and the full GPT build sheet live at [prompts/store-submissions/_generated/](../prompts/store-submissions/_generated/) (`openai-actions.yaml`, `openai-gpt-config.md`).
+
+---
+
+## What happens when the link is tapped
+
+`GET /api/ar` ([api/ar.js](../api/ar.js)) reads the request's User-Agent server-side (no client round-trip, no JS sniffing) and branches:
+
+| Device | What the user gets |
+|---|---|
+| **iPhone / iPad** | A launch page whose View in AR button opens Apple **Quick Look**. The USDZ Apple requires is generated from the GLB on the fly, in the page, by model-viewer's three.js `USDZExporter`. No server-side USD tooling exists or is needed. |
+| **Android** (static model) | An HTTP `302` straight into Google **Scene Viewer** via an ARCore `intent://` URL, with a `browser_fallback_url` back to the WebGL viewer for devices without ARCore. |
+| **Desktop** | The launch page falls back to the interactive WebGL viewer. There is no dead end: the link is safe to open anywhere. |
+
+Responses set `vary: user-agent` so CDN caching stays correct per device class. Bad input (non-https, non-GLB, missing `src`) returns a designed error page, never a crash.
+
+The pure routing logic (`detectArTarget`, `buildSceneViewerUrl`, `planArLaunch`) lives dependency-free in [api/_lib/ar-launch.js](../api/_lib/ar-launch.js) and is covered by [tests/ar-export.test.js](../tests/ar-export.test.js). The deeper AR reference (WebXR sessions, USDZ pipeline details, optimization limits) is [docs/ar.md](./ar.md).
+
+---
+
+## Living avatars: `kind=avatar`
+
+AR on three.ws is not a prop viewer; it is how agents cross into physical space. When the generated model is a rigged avatar (an agent's body), the pipeline appends `kind=avatar` to the `arUrl`, and the launcher changes behavior:
+
+- The launch page leads with a **Bring it to life** handoff into [`/irl?avatar=<glbUrl>`](/irl), where the avatar walks, animates, and talks with the user through the camera, standing in their real room. See [IRL](./irl.md).
+- Android is NOT blind-redirected into Scene Viewer, because that would hide the living path. It gets the launch page too, with static placement still one tap away.
+
+In ChatGPT this happens automatically: the avatar-producing tools (`text_to_avatar`, `rig_mesh`, `forge_avatar`) set the flag and return `irlUrl` alongside `arUrl`, and the inline widget swaps its button label accordingly.
+
+---
+
+## Sharing: links that unfurl with the model
+
+A place-in-your-room link is built to be forwarded. When it is pasted into a chat app or social surface, the launch page's Open Graph tags make it unfurl with a real render of that exact model, not a bare URL:
+
+- `og:title`: "Place `<title>` in your room"
+- `og:image`: `https://three.ws/api/render/glb?glbUrl=<encoded GLB>&width=1200&height=630`
+
+`GET /api/render/glb` ([api/render/glb.js](../api/render/glb.js)) is a public, URL-addressable GLB-to-PNG renderer: point any image tag at it with a public GLB URL and get a PNG back (headless Chromium + model-viewer under the hood, the same pipeline as the platform's OG cards). It clamps dimensions to 64-2048, HEAD-checks the GLB at 10 MB max, is SSRF-guarded and per-IP rate-limited, and is CDN-cached for a day. The launch page itself ends with a "Create your own" link, so a shared model converts its recipient into a creator.
+
+---
+
+## Using the same contract outside ChatGPT
+
+Everything above is public plumbing:
+
+- **Plain HTTP, free:** `POST /api/3d/generate` is the keyless agent-facing twin of the studio endpoint, same lane, same `arUrl`. Contract, states, and per-IP limits: [the free 3D API](./3d-api.md).
+- **Any MCP client:** the connector at `/api/mcp-studio` works in Claude and every other MCP host, not just ChatGPT. The free, read-only `export_ar` tool also turns any existing public GLB into the full link set (`arLaunchUrl`, `sceneViewerUrl`, `viewerUrl`, and `irlUrl` for avatars) plus a [Spatial MCP](./spatial-mcp.md) artifact.
+- **By hand:** the `arUrl` format is stable. If you have a public GLB, you can construct `https://three.ws/api/ar?src=<encoded GLB>&title=<name>` yourself and it will route correctly on every device.
+
+The generation lane is operator-funded (NVIDIA NIM running Microsoft TRELLIS for text-to-3D), so the end user pays nothing and needs no account; real per-IP rate limits apply and are documented per endpoint.
+
+---
+
+## Where it lives
+
+| Piece | File |
+|---|---|
+| Custom GPT Actions endpoint | [api/3d/studio.js](../api/3d/studio.js) |
+| Free agent endpoint | [api/3d/generate.js](../api/3d/generate.js) |
+| AR launcher (`/api/ar`) + unfurl tags | [api/ar.js](../api/ar.js) |
+| AR routing core (`buildArLaunchUrl`, device branch, IRL handoff) | [api/_lib/ar-launch.js](../api/_lib/ar-launch.js) |
+| MCP studio tools + response envelope | [api/_mcp-studio/tools.js](../api/_mcp-studio/tools.js) |
+| Inline widget (View in your space / Bring it to life) | [api/_mcp-studio/component.js](../api/_mcp-studio/component.js) |
+| GLB-to-PNG renderer (og:image) | [api/render/glb.js](../api/render/glb.js) |
+| GPT OpenAPI schema + build sheet | [prompts/store-submissions/_generated/](../prompts/store-submissions/_generated/) |
+| Tests | [tests/api/3d-studio.test.js](../tests/api/3d-studio.test.js), [tests/ar-export.test.js](../tests/ar-export.test.js) |
+
+## See also
+
+- [Your first prompt to 3D in ChatGPT](/tutorials/first-prompt-to-3d): the user-facing walkthrough of this whole flow
+- [Place your 3D model in AR](/tutorials/view-in-ar): the on-site AR tutorial
+- [3D Studio MCP](./mcp-studio.md): the free MCP server behind the ChatGPT app
+- [The free 3D API](./3d-api.md): the keyless HTTP contract with `arUrl`
+- [AR and WebXR reference](./ar.md): Quick Look, Scene Viewer, WebXR, and the USDZ pipeline in depth
+- [IRL](./irl.md): the living-agent experience behind Bring it to life
+
+---
+
+<a id="sec-106"></a>
> **Source:** `docs/circulation-engine.md` · [↑ table of contents](#table-of-contents)
@@ -23290,7 +25628,7 @@ falls back to a weighted everyday mix.
| Action | Trigger | Real? |
|---|---|---|
-| `launch` | ~14% when pool ≥ 2, < 8 launches today, none this hour | Real pump.fun launch on chain, recorded in `pump_agent_mints` |
+| `launch` | ~14% when pool ≥ 2, < 8 launches today, none in the last 45 minutes | Real pump.fun launch on chain, recorded in `pump_agent_mints` |
| `deploy` | ~6% when an EVM treasury is configured and < 6 deploys today | Real ERC-8004 identity registration on the configured EVM chain |
### Everyday weighted mix
@@ -23387,9 +25725,10 @@ in the public pump feed and the launches directory.
amount needed for the imminent action, bounding treasury exposure per tick.
- **Bounded heavyweight actions.** Launches and deploys are rate-limited per hour
and per day independent of the everyday mix.
-- **Real-seller demand is opt-in and capped.** When enabled, manufactured demand
- routed to user-owned sellers is bounded by a price band and a per-seller daily
- cap; when off, all demand stays inside the circulation pool.
+- **Demand never leaves the pool.** The buy-side listing query
+ (`listedSkills()`) selects only sellers tagged `meta.circulation = 'true'`,
+ so manufactured demand is only ever routed to platform-owned circulation
+ sellers, never to a real user's listings or wallet.
## Ramping volume
@@ -23413,7 +25752,183 @@ budget, so raise gradually and watch tick runtime and treasury balance.
---
-<a id="sec-096"></a>
+<a id="sec-107"></a>
+
+> **Source:** `docs/clash.md` · [↑ table of contents](#table-of-contents)
+
+# Coin Clash: token-gated community warfare
+
+Coin Clash turns every coin community into an army. Hold the coin, sign a wallet challenge to enlist, and rally for your faction in timed battles: the side that taps hardest before the round ends wins. Factions and their social stats come from real communities, enlistment is gated on a live on-chain holding, and battle power is persisted and settled on a deterministic global clock. It is an early demo of a bigger community-warfare idea the platform is building for $THREE.
+
+Page: [/clash](https://three.ws/clash)
+
+API: `/api/clash/[action]` with `action` one of `state`, `enlist`, `enlist-verify`, `rally`, `leaderboard`.
+
+## Why it exists
+
+Coin communities already behave like tribes. Coin Clash gives that tribalism a game loop with real stakes of identity: you can only fight for a coin you actually hold, so rallying is a public act of conviction, and a community's showing on the board is a live measure of how many holders will show up. The token gate is a real balance read, not a client-side check, which makes it a working demonstration of the same "hold, do not just claim" primitive used across the platform (see [token-gated 3D embeds](./token-gated-3d-embeds.md) and [hold to access](./hold-to-access.md)). Effort wins, not market cap: a battle is decided by summed taps, so a smaller, more active army can beat a larger, quieter one.
+
+## How it works
+
+The page (`src/clash.js`) polls `GET /api/clash/state` every 5 seconds (paused while the tab is hidden) and renders the live bracket. There is no websocket; liveness is polling. All five actions route through a single handler, `api/clash/[action].js`, backed by the engine in `api/_lib/clash.js` and an Upstash Redis store (`api/_lib/clash-store.js`) with an in-process fallback.
+
+**Factions.** Every community loaded from CoinCommunities becomes a faction, ranked strongest-first by member count and capped at `MAX_FACTIONS`. If the community source is unconfigured the API returns `503 cc_unconfigured` and the page shows a designed "temporarily unavailable" state and stops polling.
+
+**Rounds (epochs).** Battles run on a deterministic global clock: `epoch = floor(now / EPOCH_MS)` with `EPOCH_MS` defaulting to 1 hour. Every serverless instance agrees on the current round without coordination. Matchmaking rotates the member-ranked pool by an epoch-derived hash (so the top seed does not always meet the second) and folds it into adjacent pairs; an odd count gives the lowest seed a bye. The previous round is settled lazily on each `state` read (claimed once via a Redis `SET NX`, so it is idempotent and needs no cron): faction powers are re-read, the bracket is recomputed from the power-ranked pool (so final pairings can differ from the member-ranked view shown live), and each battle is decided on raw power (higher wins, equal draws, both-zero writes no record). Win, loss, draw, and lifetime power fold into a permanent `clash:record` hash.
+
+**Momentum.** Each faction carries a bounded vigor bonus between 1.0 and 1.5, blended from social recency, member mass, and a positive pump.fun price move. Missing signals contribute nothing and never block a rally.
+
+## Token-gating and enlistment
+
+Enlisting is a three-step gate, Solana only:
+
+1. **Challenge.** `POST /api/clash/enlist` with `{ token, wallet }` returns a stateless, HMAC-signed message bound to that exact wallet and faction, valid for 5 minutes.
+2. **Signature.** The wallet (Phantom via `window.solana`) signs the message; `POST /api/clash/enlist-verify` re-checks the challenge is un-tampered and fresh, then verifies the signature against the claimed wallet. A bad signature returns `401 bad_signature`.
+3. **Holding.** The server reads the wallet's live on-chain balance (`getBalances`, Helius DAS with public-RPC failover) and confirms it holds the faction coin. The threshold is any strictly positive balance; there is no USD minimum (the USD figure is display-only, priced via the pump.fun bonding curve so even a fresh coin shows a real number). A non-holder gets `{ eligible: false, reason: 'not_a_holder' }`.
+
+On success the server mints a **war pass**: a compact HMAC-signed token carrying the wallet, mint, amount, and USD, valid for 30 minutes. The rally endpoint trusts this pass instead of re-reading the chain on every tap.
+
+## Rallying
+
+`POST /api/clash/rally` with `{ pass, taps }` spends taps as faction battle power. Taps are clamped to `MAX_TAPS_PER_RALLY` (50 per call). Power added is `max(1, round(taps * POWER_PER_TAP * momentum))` with `POWER_PER_TAP = 1`. A per-wallet, per-faction, per-round cap (`MAX_POWER_PER_WALLET_EPOCH`, default 5000) is reserved atomically in Redis, so a wallet cannot exceed its ceiling and the client stops tapping once capped. The client batches taps and flushes them (and flushes any buffered taps on page hide via `sendBeacon`), backing off and re-queuing on a 429.
+
+The leaderboard (`GET /api/clash/leaderboard`) returns all-time faction records sorted by wins then lifetime power, with a per-faction win rate, and optionally a single faction's top-10 soldiers this round via `?faction=<mint>`.
+
+## Walkthrough
+
+1. Open [/clash](https://three.ws/clash). The Arena tab shows the current round's battles as tug-of-war bars, each side showing its army's power, momentum, member count, and war record; the header counts down to the round end.
+2. Connect a Solana wallet and pick a faction whose coin you hold. Click Enlist; approve the message signature in Phantom.
+3. If you hold the coin, a war pass is issued and the Rally dock opens. Tap the RALLY button to add power; watch your power, the cap bar, and your army's total climb.
+4. When the round ends, the result folds into the War Records tab. Check the leaderboard to see which communities are winning and where yours ranks.
+
+## Examples
+
+Reads are public and IP rate-limited; the write actions require a real wallet and signature.
+
+```bash
+# The live bracket for the current round
+curl 'https://three.ws/api/clash/state'
+
+# All-time faction war records, plus one faction's top soldiers this round
+curl 'https://three.ws/api/clash/leaderboard?faction=<MINT>'
+
+# Step 1: request an enlist challenge for a faction
+curl -X POST 'https://three.ws/api/clash/enlist' \
+ -H 'content-type: application/json' \
+ -d '{"token":"<FACTION_MINT>","wallet":"<YOUR_WALLET>"}'
+```
+
+The Coin Clash state and leaderboard are also exposed read-only over MCP through `@three-ws/clash-mcp` (`get_clash_state`, `get_clash_leaderboard`).
+
+## States and limits
+
+- **Auth.** Viewing needs no login. Enlisting requires a connected Solana wallet and a message signature; rallying requires a valid war pass.
+- **Rate limits.** Enlist and enlist-verify are limited to 20 per 5 minutes per IP; rally is 40 per minute per wallet; state and leaderboard are 120 per minute per IP.
+- **Pass expiry.** A war pass lives 30 minutes; after that rally returns `401 pass_invalid` and the client transparently re-enlists if the wallet is still connected. Switching wallets drops the enlistment and prompts a re-enlist.
+- **Empty and degraded states.** Fewer than 2 active communities shows "No battles live right now" with a link to `/communities`; a bye faction is labeled. An unconfigured community source shows a temporarily-unavailable state and stops polling. A Redis outage degrades silently to per-instance tallies and still serves 200s.
+- **Validation.** Taps must be a positive integer and are clamped to 50 per call. The ambient particle field is skipped under `prefers-reduced-motion`.
+
+## Related
+
+- [Token-gated 3D embeds](./token-gated-3d-embeds.md): the same real on-chain balance gate, applied to embeds
+- [Hold to access](./hold-to-access.md): the platform's broader hold-do-not-spend membership thesis
+- [The social layer](./social-layer.md): platform-wide feed, follows, and leaderboards
+- [MCP tools](./mcp.md): the read-only Clash MCP server
+- Pages: [/clash](https://three.ws/clash) · [/communities](https://three.ws/communities)
+
+---
+
+<a id="sec-108"></a>
+
+> **Source:** `docs/clip-director.md` · [↑ table of contents](#table-of-contents)
+
+# Clip Director: every trade becomes content
+
+We are a media company that happens to trade. Every notable close emits a piece of
+content: a ticker, a multiple, an avatar reaction, and a *reason*. The Clip Director
+turns one real closed trade into the optimal shareable artifact per surface, X,
+Telegram, or the in-app Feed, so the reasoning and the card become the acquisition
+channel and the trading stays the retention.
+
+Page: [/clip-director](https://three.ws/clip-director) · API: `/api/clip-director`
+
+## What it produces
+
+For a chosen trader agent it fetches the most notable recent closed round-trip (biggest
+absolute realized move, so the card headlines a real story, a big win *or* a big honest
+loss) and directs one card per surface:
+
+- **hook** (<=80 chars, the scroll-stopping first line, true),
+- **feature_stat** (the single most compelling real number to headline),
+- **avatar_gesture** (`celebrate` / `point` / `wave` / `shrug` / `sweat`) plus a
+ **gesture_clip** that resolves to a real animation clip in the manifest, so the
+ arena / trader avatar can actually perform the reaction,
+- **body** (1-2 lines, what happened and why, tuned per surface: X punchier, Telegram chattier, Feed mid),
+- **cta** (`fork-this-trade` / `copy-the-agent` / `view-track-record`),
+- **alt_text** (an accessibility description of the card).
+
+Honest by design: a losing trade still gets a card (radical downside-transparency is the
+brand), with a "live to trade again" tone, always with a verifiable on-chain angle. No
+number is invented; every stat traces to the closed position it was handed. When no LLM
+provider is available a deterministic director produces the same-shaped artifact.
+
+## Where the numbers come from
+
+A closed row in `agent_sniper_positions` gives entry/exit quote (SOL), realized P&L,
+realized P&L %, open/close timestamps, and the exit reason. The Clip Director derives
+multiple, hold time, and win/loss from those present fields and never fabricates a
+market cap it does not have. The `sell_sig` becomes an on-chain proof link.
+
+## API
+
+Public, IP rate-limited. Sizes in SOL. $THREE is the only coin promoted; the traded
+coin is user runtime data.
+
+```bash
+# Cards for an agent's most notable recent close, one per surface.
+curl 'https://three.ws/api/clip-director?agent_id=<AGENT_UUID>&surface=all'
+
+# A single surface, or a specific closed position.
+curl 'https://three.ws/api/clip-director?agent_id=<AGENT_UUID>&surface=x'
+curl 'https://three.ws/api/clip-director?agent_id=<AGENT_UUID>&position_id=<POSITION_UUID>'
+
+# Direct a clip from an already-shaped trade (for the copy-engine fan-out / arena feed).
+curl -X POST 'https://three.ws/api/clip-director' \
+ -H 'content-type: application/json' \
+ -d '{"agent_name":"Curve Sniper","surface":"x","copied_by_count":12,
+ "trade":{"symbol":"TICKER","multiple":4.2,"realized_pnl_sol":1.6,
+ "hold_min":42,"exit_reason":"take_profit","pnl_pct":320}}'
+```
+
+Response shape (GET):
+
+```json
+{
+ "agent": { "id": "…", "name": "Curve Sniper", "avatar": null },
+ "position_id": "…",
+ "trade": { "symbol": "TICKER", "multiple": 4.2, "hold_min": 42, "exit_reason": "take_profit", "is_win": true },
+ "proof": "https://solscan.io/tx/<sig>",
+ "copied_by_count": 12,
+ "clips": [
+ { "surface": "x", "hook": "…", "feature_stat": "4.2x", "avatar_gesture": "celebrate",
+ "gesture_clip": "celebrate", "body": "…", "cta": "copy-the-agent", "alt_text": "…" }
+ ]
+}
+```
+
+When the agent has no closed trades yet the response returns `clips: []` with an `empty`
+message instead of an error, so a card is only ever minted from a real closed round-trip.
+
+## Related
+
+- [Trader Card & the claim-your-wallet wedge](trader-card.md)
+- [Meta-Allocator: the ETF of degens](meta-allocator.md)
+- [The trading surfaces](trading-surfaces.md) · [The Arena](https://three.ws/arena)
+- [Animations & gestures](animations.md)
+
+---
+
+<a id="sec-109"></a>
> **Source:** `docs/coin-launches.md` · [↑ table of contents](#table-of-contents)
@@ -23448,9 +25963,12 @@ The agent launcher signs and submits with the agent's **custodial** Solana keypa
server-side (`launch-agent`), through the protected execution path
(`submitProtected()`). Spend caps are checked before signing (see
[Agent wallets](custody.md)), and the mint is registered in
-`pump_agent_mints`. The `launcher-tick` cron drives autonomous launches on a
-cadence (every minute, bounded by the daily/hourly launch caps described in the
-[circulation engine](circulation-engine.md)).
+`pump_agent_mints`. The `launcher-tick` cron (every minute) drives the
+autonomous launcher engine (`api/_lib/launcher-engine.js`), bounded by
+per-launch and daily SOL caps, an hourly ceiling, a cadence gate, and a circuit
+breaker from its `launcher_config` row; a scope whose row is disabled stays
+inert. The [circulation engine](circulation-engine.md) also runs its own
+`launch` action with separate hourly/daily caps.
## What a launch carries
@@ -23460,7 +25978,7 @@ cadence (every minute, bounded by the daily/hourly launch caps described in the
| Quote mint | Resolved to the network-correct pairing (USDC mint or SOL-paired). |
| Dev buy | A small initial buy can accompany the create (the `LAUNCH_FLOOR` covers create + tiny dev buy + fees). |
| Buyback authority | A buyback basis-points configuration can be attached to the agent mint. |
-| Mint mark | When `THREE_WS_MARK_ENFORCE` is on, the mint address is vanity-ground to carry the three.ws mark (see [Mint mark](mint-mark.md), [Vanity protocol](PROTOCOL-vanity.md)). |
+| Mint mark | When `THREE_WS_MARK_ENFORCE` is on (the default; set `0`/`false` to disable), the mint address is vanity-ground to carry the three.ws mark (see [Mint mark](mint-mark.md), [Vanity protocol](PROTOCOL-vanity.md)). |
## Recording and surfacing
@@ -23500,7 +26018,7 @@ hardcode or surface any other specific mint as a recommendation.
---
-<a id="sec-097"></a>
+<a id="sec-110"></a>
> **Source:** `docs/coin-pages.md` · [↑ table of contents](#table-of-contents)
@@ -23937,7 +26455,7 @@ server mirrors each (including the dynamic `/coin/:id` path). The pre-existing
---
-<a id="sec-098"></a>
+<a id="sec-111"></a>
> **Source:** `docs/coinmarketcap-article-play.md` · [↑ table of contents](#table-of-contents)
@@ -24083,7 +26601,7 @@ The chart has always told you *what* a coin is doing. /play lets you go stand wh
---
-<a id="sec-099"></a>
+<a id="sec-112"></a>
> **Source:** `docs/coinmarketcap-article.md` · [↑ table of contents](#table-of-contents)
@@ -24286,13 +26804,97 @@ If you've been waiting for the moment AI and crypto stop talking past each other
---
-<a id="sec-100"></a>
+<a id="sec-113"></a>
+
+> **Source:** `docs/compose.md` · [↑ table of contents](#table-of-contents)
+
+# Scene Composer: dress an avatar and stage a scene
+
+Scene Composer is a real-time multi-object 3D editor built around one idea: bring a character in, generate props for it from text, and attach them to the right place on its body. Load one of your three.ws avatars (or any rigged GLB), type "horned crown" or "magic staff", and the item is forged and dropped into the scene. Pick it up, snap it to the avatar's head or hand bone, scale it, and it rides that bone. Then export the whole staged scene as a GLB, or save the attached items back onto the avatar as a reusable outfit.
+
+Page: [/compose](https://three.ws/compose)
+
+## Why it exists
+
+Generating a character and generating a hat are easy in isolation. Making the hat sit on the head, follow it when the character moves, and persist as part of that character's look is the hard, unglamorous part, and it is exactly what turns a pile of separate models into a dressed, staged avatar. Scene Composer closes that gap. It wires the platform's text-to-3D Forge lane directly into a scene graph with bone attachment, so the loop from "I want a crown" to "the crown is on my avatar's head and saved to its wardrobe" happens in one place, with real gizmos and real undo, not a chain of exports and re-imports.
+
+## How it works
+
+The page is a Three.js scene with PMREM image-based lighting, soft shadows, exponential fog for depth, and a three-point key/fill/rim light rig. Everything you add becomes a tracked scene object with a role (avatar, accessory, item, scene, creature, vehicle, or other).
+
+- **Forge from text.** The prompt box posts to `/api/forge` with an optional intent (accessory, item, scene, creature, vehicle) that becomes the model's category. The studio polls the job to completion, streaming staged progress, then loads the resulting GLB into the scene. Meshopt-compressed models are decoded on load. Generation runs on the platform's real text-to-3D lanes; a queued job restarts the timeout window so waiting for a GPU never counts against the run budget.
+- **Transform gizmos.** Select any object and translate, rotate, or scale it with `TransformControls`. Toggle world/local space, turn on 0.25-unit grid snapping, and lock proportional scale. Every drag and every numeric-field edit is one undoable step in a 50-deep undo/redo stack.
+- **Bone attachment.** When a rigged avatar is in the scene, any non-avatar item's inspector gains an "Attach to Bone" control. The avatar's bones are grouped into readable regions (Head, Torso, Left/Right Arm, Left/Right Leg, Fingers L/R) with the raw bone names cleaned of rig prefixes (`mixamorig:`, `CC_Base_`, `rig_`). Attaching parents the item to that bone at the origin, so it rides the bone; detaching returns it to world space.
+- **Scene tooling.** Click-to-select raycasting, a hierarchy panel with per-object visibility and rename (double-click), camera presets (front/back/left/right/top/isometric, plus Blender-style numpad keys), F to frame the selection, Ctrl+D to duplicate, a live triangle-and-object counter, screenshot export, and toast notifications for every action. Geometry, materials, and textures are disposed on removal, so long sessions do not leak memory.
+- **Bring your own avatar.** Load an avatar by URL, browse your gallery through `/api/explore`, or arrive with `?avatar=<id>` (resolved via `/api/avatars/<id>`) or `?glb=<url>`. If the avatar ships animations, its first clip (typically idle) plays automatically through an `AnimationMixer`.
+
+### Export vs. save outfit
+
+There are two ways out. **Export GLB** bakes every visible, non-bone-attached object into one downloadable `scene-compose.glb`. **Save outfit** takes a different path: for a three.ws avatar loaded from `/avatars/<id>`, it PATCHes the bone-attached items (bone name, GLB URL, name) onto that avatar's record as `accessories`, so the outfit becomes part of the avatar everywhere it appears. Save outfit needs at least one item attached to a bone and a resolvable avatar id; otherwise it points you to Export GLB.
+
+## Walkthrough
+
+1. Open [/compose](https://three.ws/compose). Load an avatar: paste a model URL, click "Browse" to pick from your gallery, or skip and compose props only.
+2. Choose an intent chip (for example, Accessory), pick a suggested prompt or type your own ("neon visor"), and forge it. Watch the progress bar; the item drops into the scene when it is done.
+3. Select the item. In the inspector, open "Attach to Bone", choose Head from the region-grouped list, and click Attach. The visor snaps onto the head.
+4. Switch the gizmo to scale (press R) and size it to fit. Use grid snap and proportional lock as needed.
+5. Add more items, attach them to hands or the torso, and arrange the composition. Frame with F, orbit, and take a screenshot to preview.
+6. Click "Save outfit" to write the attached items back onto your avatar, or "Export GLB" to download the whole staged scene.
+
+## Examples
+
+Scene Composer is an interactive editor; its examples are its deep links and the endpoints it drives.
+
+- **Open with a specific avatar:** `https://three.ws/compose?avatar=<avatarId>`
+- **Open with a forged item preloaded:** `https://three.ws/compose?glb=https://.../item.glb`
+
+The Forge call the studio makes for every generation:
+
+```bash
+curl -X POST 'https://three.ws/api/forge' \
+ -H 'content-type: application/json' \
+ -H 'x-forge-client: <your-client-key>' \
+ -d '{"prompt":"horned crown","model_category":"accessory"}'
+# → { "job_id": "…" } then poll:
+curl 'https://three.ws/api/forge?job=<job_id>' -H 'x-forge-client: <your-client-key>'
+# → { "status": "done", "glb_url": "https://.../crown.glb" }
+```
+
+Saving attached items as an avatar outfit:
+
+```bash
+curl -X PATCH 'https://three.ws/api/avatars/<avatarId>' \
+ -H 'content-type: application/json' \
+ -H 'x-forge-client: <your-client-key>' \
+ -d '{"accessories":[{"bone":"mixamorig:Head","glbUrl":"https://.../crown.glb","name":"Horned crown"}]}'
+```
+
+## States & limits
+
+- **Bone attachment needs a rigged avatar.** The "Attach to Bone" control only appears when an avatar with bones is loaded. A non-humanoid or unrigged model can still be arranged and exported, just not bone-parented.
+- **Save outfit is for three.ws avatars.** It only works when the loaded avatar came from `/avatars/<id>` (so it has a record to PATCH). For any other model, use Export GLB.
+- **Bone-attached items are excluded from Export GLB.** Export bakes visible, world-space objects; items parented to a bone belong to the avatar and are saved through Save outfit instead.
+- **Generation can take minutes.** Full-quality bakes legitimately run past ten minutes; the studio's ceiling sits above the slowest real generation, and a queued job restarts the wait window. A genuinely failed or timed-out job surfaces an actionable error.
+- **Undo is 50 deep.** Transforms, adds, and removes are undoable (Ctrl+Z / Ctrl+Y); a full scene wipe is not a single undo step.
+- **Ownership is client-keyed.** Forge creations and the gallery are scoped to a per-browser client key stored in local storage, so your generations follow the browser without an account.
+
+## Related
+
+- [Avatar Studio](./avatar-studio.md): build the avatar you dress here.
+- [Animation Studio](./animation-studio.md): pose and animate the dressed avatar.
+- [Scene Studio](./scene-studio.md): the full three.js editor for heavier scene authoring.
+- [Restyle Studio](./restyle.md): re-skin the forged props before attaching them.
+- [/forge](https://three.ws/forge): the text-to-3D generator behind the prompt box.
+
+---
+
+<a id="sec-114"></a>
> **Source:** `docs/configuration.md` · [↑ table of contents](#table-of-contents)
# Configuration Reference
-three.ws is configured through a combination of environment variables and a handful of configuration files. This document is a complete reference for self-hosters and developers setting up a local development environment.
+three.ws is configured through a combination of environment variables and a handful of configuration files. This document is a complete reference for self-hosters and developers setting up a local development environment. If you only use the hosted site at three.ws, none of this applies to you; if you are running the code yourself, start with the [Minimum Local Development Configuration](#minimum-local-development-configuration) and come back for the rest as you enable features.
**Configuration files at a glance:**
@@ -24319,13 +26921,13 @@ cp .env.example .env.local
### Core
#### `PUBLIC_APP_ORIGIN`
-**Required.** The canonical origin of your deployment — no trailing slash.
+**Required for self-hosted deployments.** The canonical origin of your deployment, with no trailing slash. When unset, the code falls back to `https://three.ws` ([api/_lib/env.js](../api/_lib/env.js)), which is wrong for any other domain.
```
PUBLIC_APP_ORIGIN=https://yourdomain.com
```
-Used to construct absolute URLs in API responses and OAuth metadata. Must match your production domain exactly.
+Used to construct absolute URLs in API responses and OAuth metadata (exposed to server code as `env.APP_ORIGIN`). Must match your production domain exactly.
#### `DATABASE_URL`
**Required.** PostgreSQL connection string using Neon's serverless HTTPS driver.
@@ -24379,17 +26981,36 @@ Higher values increase security at the cost of login latency. 11 is a reasonable
### LLM
+`/api/chat` routes across a provider failover ladder (see the routing comment at the top of [api/chat.js](../api/chat.js)): free-tier providers lead, paid keys are backstops. Configure at least one of these keys to enable agent conversations.
+
+#### `GROQ_API_KEY`
+**Recommended.** Free-tier Groq key; the default first provider in the chat ladder.
+
+```
+GROQ_API_KEY=gsk_xxxxx
+```
+
+#### `OPENROUTER_API_KEY`
+**Optional.** OpenRouter key, tried after Groq. Backs up every LLM surface; fund it if you rely on paid-model failover.
+
+```
+OPENROUTER_API_KEY=sk-or-xxxxx
+```
+
+#### `NVIDIA_API_KEY`
+**Optional.** NVIDIA NIM free tier, a third independent free lane.
+
#### `ANTHROPIC_API_KEY`
-**Required for agent conversations.** If unset, the `/api/chat` endpoint falls back to client-side pattern matching (limited functionality).
+**Optional (paid backstop).** Anthropic key, tried after the free lanes. Also accepted as a user-supplied BYOK key.
```
ANTHROPIC_API_KEY=sk-ant-api03-xxxxx
```
-Get from [console.anthropic.com](https://console.anthropic.com).
+Get from [console.anthropic.com](https://console.anthropic.com). `OPENAI_API_KEY` fills the same paid-backstop role for OpenAI, and watsonx (`WATSONX_API_KEY` plus a project scope) is served only on explicit request, never as a silent default.
#### `CHAT_MODEL`
-**Optional.** Override the Claude model used for agent chat. Defaults to `claude-sonnet-4-6`.
+**Optional.** Pin a default chat model by id. It only applies when the provider that serves that model id (per the model catalog) is the one routed to; every other provider keeps its own default, so an Anthropic-style model id never leaks into a Groq request.
```
CHAT_MODEL=claude-sonnet-4-6
@@ -24637,7 +27258,7 @@ The smallest `.env.local` that runs the dev server with core features:
PUBLIC_APP_ORIGIN=http://localhost:3000
DATABASE_URL=postgres://user:[email protected]/neondb?sslmode=require
JWT_SECRET=<output of: openssl rand -base64 64>
-ANTHROPIC_API_KEY=sk-ant-...
+GROQ_API_KEY=gsk_... # or any other chat provider key (see LLM above)
S3_ENDPOINT=https://<account-id>.r2.cloudflarestorage.com
S3_ACCESS_KEY_ID=...
S3_SECRET_ACCESS_KEY=...
@@ -24658,9 +27279,9 @@ A **live configuration file** consumed at runtime by the Cloud Run server ([`ser
```json
{ "src": "/agent/([^/]+)/edit", "dest": "/agent-edit.html" }
{ "src": "/agent/([^/]+)/embed", "dest": "/agent-embed.html" }
-{ "src": "/agent/([^/]+)", "dest": "/agent-home.html" }
+{ "src": "/agent/([^/]+)", "status": 301, "headers": { "Location": "/agents/$1" } }
{ "src": "/a/(\\d+)/(\\d+)", "dest": "/api/a-page?chain=$1&id=$2" }
-{ "src": "/dashboard", "dest": "/dashboard/index.html" }
+{ "src": "/dashboard/?", "dest": "/dashboard-next/index.html" }
{ "src": "/studio", "dest": "/studio/index.html" }
```
@@ -24670,8 +27291,11 @@ A **live configuration file** consumed at runtime by the Cloud Run server ([`ser
{
"src": "/agent/([^/]+)/embed",
"headers": {
- "content-security-policy": "frame-ancestors *",
- "permissions-policy": "microphone=(self), camera=(self), xr-spatial-tracking=*"
+ "content-security-policy": "frame-ancestors *; base-uri 'self'; object-src 'none'; report-uri /api/client-errors",
+ "x-content-type-options": "nosniff",
+ "referrer-policy": "strict-origin-when-cross-origin",
+ "permissions-policy": "microphone=(self), camera=(self), xr-spatial-tracking=*",
+ "cross-origin-resource-policy": "cross-origin"
},
"dest": "/agent-embed.html"
}
@@ -24687,7 +27311,7 @@ A **live configuration file** consumed at runtime by the Cloud Run server ([`ser
}
```
-**Cron jobs** are declared here as the source of truth for the schedule; in production they are driven by **Google Cloud Scheduler** (~80 jobs), each hitting its `/api/cron/*` handler on the Cloud Run service:
+**Cron jobs** are declared here as the source of truth for the schedule (currently 89 entries); in production they are driven by **Google Cloud Scheduler**, each job hitting its `/api/cron/*` handler on the Cloud Run service:
```json
"crons": [
@@ -24710,15 +27334,15 @@ The build is controlled by the `TARGET` environment variable:
|---|---|---|---|
| `npm run build` | `app` (default) | `dist/` | Full multi-page SPA |
| `npm run build:lib` | `lib` | `dist-lib/` | Self-contained web component for CDN |
-| `npm run build:all` | both | both | Builds app and lib sequentially |
+| `npm run build:all` | both | both | Builds the chat bundle first, then app and lib in parallel |
-**App build** (`TARGET=app`) emits multiple HTML entry points for the SPA:
+**App build** (`TARGET=app`) emits many HTML entry points for the multi-page app, sourced from `pages/`:
-- `index.html` — marketing/landing
-- `app.html` — agent creator
-- `agent-home.html`, `agent-edit.html`, `agent-embed.html` — agent pages
-- `dashboard/index.html` — user dashboard
-- `studio/index.html` — widget studio
+- `pages/home.html`: marketing/landing
+- `pages/app.html`: agent creator
+- `pages/agent-edit.html`, `pages/agent-embed.html`: agent pages (`/agent/:id` itself 301-redirects to `/agents/:id`)
+- `pages/dashboard-next/`: user dashboard (sub-pages auto-discovered)
+- `public/studio/index.html`: widget studio
**Library build** (`TARGET=lib`) emits a self-contained ES module and UMD bundle:
@@ -24729,7 +27353,7 @@ dist-lib/agent-3d.umd.cjs # UMD (CommonJS-compatible)
Three.js and ethers are bundled (not externalized) so the web component works as a zero-install drop-in embed via `<script type="module">`.
-**VitePWA** generates a service worker for the app build. Assets matching `**/*.{js,css,ico,png,svg,woff2}` are precached. Google Fonts are cached with a `CacheFirst` strategy and a 1-year TTL.
+**VitePWA** generates a service worker for the app build. Only `**/*.{ico,woff2}` are precached; HTML, JS, and CSS are deliberately excluded so deploys take effect immediately. Google Fonts are cached with a `CacheFirst` strategy and a 1-year TTL, and `/api/*` is never intercepted by the service worker.
The dev server includes a rewrite middleware that mirrors the `vercel.json` route patterns, so `http://localhost:3000/agent/my-agent/edit` works the same as in production.
@@ -24746,14 +27370,14 @@ aws s3api put-bucket-cors \
--endpoint-url https://<account-id>.r2.cloudflarestorage.com
```
-The default `cors.json` restricts GET requests to a specific list of origins:
+The checked-in `cors.json` restricts GET requests to a specific list of origins: `https://three.ws`, the localhost dev origins, and a few existing partner origins:
```json
[
{
"method": ["GET"],
"origin": [
- "https://three.ws/",
+ "https://three.ws",
"http://localhost:*",
"https://localhost:*"
],
@@ -24810,7 +27434,15 @@ Before going live, verify the following:
---
-<a id="sec-101"></a>
+## Related
+
+- [Deployment & Self-Hosting](/docs/deployment): how to run the stack in production
+- [Security](/docs/security): the security model these settings feed into
+- [Contributing](/docs/contributing): local development workflow and test commands
+
+---
+
+<a id="sec-115"></a>
> **Source:** `docs/content/use-cases/README.md` · [↑ table of contents](#table-of-contents)
@@ -24855,7 +27487,7 @@ Every scenario on these pages is an **example workflow** — clearly labeled "Im
---
-<a id="sec-102"></a>
+<a id="sec-116"></a>
> **Source:** `docs/content/use-cases/ai-agent-developer.md` · [↑ table of contents](#table-of-contents)
@@ -24903,7 +27535,7 @@ A standards-based interface (MCP + A2A), a working USDC payment rail (x402 on Ba
---
-<a id="sec-103"></a>
+<a id="sec-117"></a>
> **Source:** `docs/content/use-cases/brand-marketer.md` · [↑ table of contents](#table-of-contents)
@@ -24962,7 +27594,7 @@ A conversational 3D brand presence that's easy to embed and share, plus a public
---
-<a id="sec-104"></a>
+<a id="sec-118"></a>
> **Source:** `docs/content/use-cases/crypto-community.md` · [↑ table of contents](#table-of-contents)
@@ -25009,7 +27641,7 @@ A shared 3D home for the token's holders, a real (not mocked) on-chain agent-exc
---
-<a id="sec-105"></a>
+<a id="sec-119"></a>
> **Source:** `docs/content/use-cases/game-studio.md` · [↑ table of contents](#table-of-contents)
@@ -25056,7 +27688,7 @@ A character that renders with production-grade glTF handling, converses through
---
-<a id="sec-106"></a>
+<a id="sec-120"></a>
> **Source:** `docs/content/use-cases/indie-creator.md` · [↑ table of contents](#table-of-contents)
@@ -25116,7 +27748,7 @@ A real, embedded, conversational 3D avatar that loads in any modern browser. The
---
-<a id="sec-107"></a>
+<a id="sec-121"></a>
> **Source:** `docs/contributing.md` · [↑ table of contents](#table-of-contents)
@@ -25168,10 +27800,13 @@ npm install
# 3. Copy environment variables
cp .env.example .env.local
-# Minimum required: DATABASE_URL, JWT_SECRET, ANTHROPIC_API_KEY
+# Minimum required: DATABASE_URL, JWT_SECRET, and one chat provider key
+# (GROQ_API_KEY, OPENROUTER_API_KEY, or ANTHROPIC_API_KEY)
-# 4. Apply the database schema (requires DATABASE_URL to be set)
-psql "$DATABASE_URL" -f api/_lib/schema.sql
+# 4. Provision the database (requires DATABASE_URL to be set)
+npm run db:bootstrap
+# Runs core schema + indexer + delegations + migrations; idempotent.
+# Do NOT apply api/_lib/schema.sql alone (it skips the migration-defined tables).
# 5. Start the development server
npm run dev
@@ -25183,7 +27818,7 @@ npm run dev
| Service | Purpose | Without it |
|---|---|---|
| Neon (Postgres) | Real test database | API routes that need DB will fail |
-| Anthropic API key | LLM features | AI responses unavailable |
+| An LLM provider key (Groq, OpenRouter, NVIDIA, Anthropic, or OpenAI) | LLM features | AI responses unavailable |
| Upstash Redis | Distributed rate limiting | Falls back to in-memory per-instance |
Most features work without the optional services. The app degrades gracefully, so basic 3D viewer work, skill development, and UI changes don't require any backend credentials.
@@ -25195,16 +27830,20 @@ For full backend setup — R2 storage, environment variables, and how the app is
## Project Structure
```
-src/ — client-side JavaScript (agent system, viewer, UI)
-api/ — serverless-style API handlers (Node.js, served by the Cloud Run container)
-public/ — static pages and assets
-contracts/ — Solidity smart contracts (Foundry)
-character-studio/ — avatar builder (separate React SPA)
-specs/ — design specifications
-docs/ — internal documentation
-tests/ — unit and API tests
-scripts/ — build and maintenance scripts
-examples/ — working code examples (including skill templates)
+src/ - client-side JavaScript (agent system, viewer, UI)
+api/ - serverless-style API handlers (Node.js, served by the Cloud Run container)
+pages/ - HTML entry points for the multi-page app
+public/ - static pages and assets
+contracts/ - Solidity smart contracts (Foundry)
+character-studio/ - avatar builder (separate React SPA)
+packages/ - publishable packages (MCP servers and more)
+sdk/, *-sdk/ - client SDKs
+workers/ - GPU/background workers
+specs/ - design specifications
+docs/ - public documentation (served at three.ws/docs)
+tests/ - unit and API tests
+scripts/ - build and maintenance scripts
+examples/ - working code examples (including skill templates)
```
Key source files:
@@ -25246,10 +27885,10 @@ The project follows the rules in [CLAUDE.md](../CLAUDE.md). These are enforced i
## Running Tests
-The test suite uses [Vitest](https://vitest.dev/) and covers both source modules and API endpoints.
+The test suite uses [Vitest](https://vitest.dev/) for source modules and API endpoints, plus [Playwright](https://playwright.dev/) for browser tests. `npm test` runs Vitest first and only proceeds to the Playwright stage when the unit suite is green.
```bash
-# Run all tests
+# Run all tests (vitest, then playwright)
npm test
# Run a specific test file
@@ -25392,7 +28031,7 @@ Skills are the best way to extend three.ws without touching core code. A skill i
4. **Write a `SKILL.md`** documenting what your skill does, what permissions it requires, and how to install it.
-5. **Share it.** Post in the `#skills` channel on Discord, or open a PR to add it to the official skill registry.
+5. **Share it.** Post it in [GitHub Discussions](https://github.com/nirholas/three.ws/discussions), or list it on the platform's skill marketplace so agents can install it.
---
@@ -25430,19 +28069,117 @@ Check [existing issues](https://github.com/nirholas/three.ws/issues) before open
- **[GitHub Discussions](https://github.com/nirholas/three.ws/discussions)** — design questions, architecture ideas, general "how does X work"
- **[GitHub Issues](https://github.com/nirholas/three.ws/issues)** — bug reports and concrete feature requests
-- **Discord** — real-time chat (link in the README)
-Core team response times: typically 2–3 business days on GitHub, faster in Discord. If a PR has been open for a week with no review, a polite ping in Discord is welcome.
+Core team response times: typically 2-3 business days on GitHub. If a PR has been open for a week with no review, a polite bump on the PR is welcome.
---
## 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 are provided under the terms of the repository's [LICENSE](../LICENSE) (proprietary, all rights reserved). Read it before submitting substantial work.
---
-<a id="sec-108"></a>
+## Related
+
+- [Configuration Reference](/docs/configuration): every environment variable and config file
+- [Deployment & Self-Hosting](/docs/deployment): running the full stack yourself
+- [Skills](/docs/skills): the skill format, lifecycle hooks, and message API
+- [Security](/docs/security): responsible disclosure and the security model
+
+---
+
+<a id="sec-122"></a>
+
+> **Source:** `docs/cosmos.md` · [↑ table of contents](#table-of-contents)
+
+# Cosmos: living worlds behind your 3D avatar
+
+Cosmos turns a sentence into a living, photoreal world that plays behind your 3D avatar. You pick an avatar, describe a place, and NVIDIA Cosmos renders a short cinematic video of that world; the platform composites it as a full-bleed backdrop behind your transparent avatar, so your character appears to stand inside a moving scene. Generate it, preview it live, and download the clip.
+
+Page: [/cosmos](https://three.ws/cosmos) · API: `/api/cosmos`
+
+## Why it exists
+
+A 3D avatar on a flat gradient is a portrait. A 3D avatar standing in a neon Tokyo street in the rain is a scene. Cosmos gives every avatar a world to inhabit without a render farm, a game engine, or a video editor: you type the place, and a world model paints it in motion. It is the cinematic backdrop layer of the platform, the fastest way to put a character somewhere and make the result look alive.
+
+## How it works
+
+Cosmos runs on NVIDIA's Cosmos World Foundation Model family. The endpoint (`api/cosmos.js`) calls the **Text2World predict** model through NVIDIA's NVCF async gateway: a submit returns a request id, which is handed back to the browser as the `job_id`, and each poll asks NVCF for status and, on completion, persists the resulting MP4 to durable object storage (R2) and returns a stable URL. There is no server-side job store; the NVCF request id is the durable handle, exactly like the free TRELLIS text-to-3D lane. Cosmos predict renders roughly five seconds of 1280x704 video at 24fps, which on the shared free tier typically lands in 60 to 120 seconds.
+
+The lane reuses the platform `NVIDIA_API_KEY` (the free NIM tier). When that key is absent, the lane reports itself unconfigured (503) and the page degrades gracefully: the avatar still stands on a designed, slowly shifting aurora backdrop instead of a blank void.
+
+On the page (`src/cosmos.js`), the avatar is a Google `<model-viewer>` with a transparent background. Five humanoid avatars ship bundled for instant selection (Aria, Kai, Michelle, X-Bot, Mona), and you can bring your own. The generate flow is real async with no fake timers: submit to `POST /api/cosmos`, then poll `GET /api/cosmos?job=<id>` every four seconds (with a five-minute ceiling), driving a real elapsed-based progress state. When the clip is ready it plays on canplay as a looping backdrop behind the avatar, a regenerate control appears, and the clip is available to download.
+
+## Walkthrough
+
+1. Open [/cosmos](https://three.ws/cosmos).
+2. Pick an avatar from the bundled set, or load your own GLB. The avatar renders immediately over the fallback aurora backdrop.
+3. Describe a world in 3 to 300 characters, for example `a neon Tokyo street in the rain at night` or `a windswept desert canyon at golden hour`.
+4. Optionally set a seed for a reproducible render.
+5. Click Generate. A real progress state runs while the NVCF job renders; expect roughly 60 to 120 seconds on the free tier.
+6. When the world lands it plays behind your avatar. Preview it, regenerate with a new prompt or seed, or download the clip.
+
+## Examples
+
+The Cosmos lane is a plain async HTTP job. Reuse the platform key server-side.
+
+```bash
+# Start a world render, then poll the NVCF job for the MP4.
+JOB=$(curl -s -X POST 'https://three.ws/api/cosmos' \
+ -H 'content-type: application/json' \
+ -d '{"prompt":"a neon Tokyo street in the rain at night"}' \
+ | python3 -c 'import sys,json;print(json.load(sys.stdin).get("job_id",""))')
+
+curl "https://three.ws/api/cosmos?job=$JOB"
+```
+
+Example prompts that read well as living backdrops:
+
+- `a neon Tokyo street in the rain at night`
+- `a windswept desert canyon at golden hour`
+- `a bioluminescent forest at midnight`
+- `a rooftop garden above a foggy city skyline`
+- `a snowy mountain pass under aurora`
+
+A poll-until-ready loop in JavaScript:
+
+```javascript
+const start = await fetch('https://three.ws/api/cosmos', {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({ prompt: 'a bioluminescent forest at midnight' }),
+}).then((r) => r.json());
+
+if (start.status === 'done') console.log(start.video_url);
+else {
+ let job = start;
+ while (job.status !== 'done' && job.status !== 'failed') {
+ await new Promise((r) => setTimeout(r, 4000));
+ job = await fetch(`https://three.ws/api/cosmos?job=${start.job_id}`).then((r) => r.json());
+ }
+ console.log(job.video_url); // durable MP4 URL
+}
+```
+
+## States and limits
+
+- **Prompt** must be 3 to 300 characters; an optional integer `seed` makes a render reproducible.
+- **Render time** is roughly 60 to 120 seconds on the shared free tier; the client shows a real elapsed progress state and gives up after five minutes with a "try a simpler prompt" message.
+- **Unconfigured (503)**: when `NVIDIA_API_KEY` is absent, the page keeps the avatar on a designed aurora backdrop and tells you generation is offline. No mock clip is ever shown.
+- **Rate limited (429)** and **invalid key (401)** surface with honest messages and, where provided, a retry-after hint.
+- Output is a durable MP4; the avatar is a standard GLB rendered with `<model-viewer>`.
+- Rate limits are per client IP on the shared 3D generation buckets.
+
+## Related
+
+- [Forge](./forge.md) makes the 3D avatars and objects you place in a Cosmos world.
+- [Avatar creation](./avatar-creation.md) and [the trait-based avatar builder](./character-studio.md) for building and dressing avatars.
+- Pages: [/create](https://three.ws/create), [/gallery](https://three.ws/gallery), [/scene](https://three.ws/scene).
+
+---
+
+<a id="sec-123"></a>
> **Source:** `docs/crypto-api.md` · [↑ table of contents](#table-of-contents)
@@ -26273,7 +29010,16 @@ curl -s "https://three.ws/api/crypto/holders?address=FeMbDoX7R1Psc4GEcvJdsbNbZA3
---
-<a id="sec-109"></a>
+## Related
+
+- [Market Data API](/docs/market-data-api) - the paid x402 twin: coin prices, DeFi TVL, yields, gas, and the per-datapoint fabric
+- [x402 Paid Endpoints](/docs/x402-endpoints) - the full paid catalog and pricing
+- [API Reference](/docs/api-reference) - the complete three.ws HTTP API surface
+- [Pump Launcher](/docs/pump-launcher) - launch a token after clearing its symbol here
+
+---
+
+<a id="sec-124"></a>
> **Source:** `docs/custody.md` · [↑ table of contents](#table-of-contents)
@@ -26363,7 +29109,113 @@ Every step of recovery and inheritance writes to the custody trail and the audit
---
-<a id="sec-110"></a>
+<a id="sec-125"></a>
+
+> **Source:** `docs/daily-forge.md` · [↑ table of contents](#table-of-contents)
+
+# Daily Forge: a new 3D creative challenge every day
+
+Daily Forge gives you one 3D creative challenge a day. The theme is deterministic, hashed from the UTC date so everyone in the world gets the same prompt on the same day, forge it into a real, textured 3D model for free with no sign-up, build a streak, and place your creation in AR on your phone. It is the platform's anonymous-first retention loop: a reason to come back tomorrow that costs nothing to start.
+
+Page: [/daily](https://three.ws/daily) (`pages/daily.html`, `src/daily.js`)
+
+APIs: `POST /api/forge` and `GET /api/forge?job=<id>` (free text-to-3D), `GET /api/forge-gallery?scope=community` (community strip), `GET /api/ar` (AR fallback launcher).
+
+## Why it exists
+
+The free forge is the platform's front door, but a one-off "make a 3D model" prompt has no reason to bring anyone back. Daily Forge wraps that same free generation in a game: a shared daily theme, a visible streak, and milestones. Because the theme is derived purely from the date, it is the same for every visitor and needs no backend, no login, and no coordination. The whole loop runs anonymously in the browser with a locally stored streak, so a first-time visitor with zero setup gets a creative prompt, a real GLB, and a reason to return the next day. It complements the logged-in streak system while asking nothing of the user up front.
+
+## How it works
+
+The page loads model-viewer (with the meshopt decoder, since Forge GLBs are meshopt-compressed) and, after a WebGL support check, the `src/daily.js` module. If WebGL is unavailable the module is never loaded and the stage shows a "This browser can't render 3D" message.
+
+**Deterministic theme.** `src/daily/daily-theme.js` holds a frozen pool of 24 curated themes, each with an emoji, title, hint, accent, and three seed prompts. The theme for a date is chosen with an FNV-1a hash of the `YYYY-MM-DD` UTC key, plus a weekly rotation offset so a fixed weekday does not lock to one theme:
+
+```javascript
+function hashKey(key) {
+ let h = 0x811c9dc5;
+ for (let i = 0; i < key.length; i++) {
+ h ^= key.charCodeAt(i);
+ h = Math.imul(h, 0x01000193) >>> 0;
+ }
+ return h >>> 0;
+}
+
+// idx = (hashKey(dateKey) + weeksSinceAnchor * 5) % THEMES.length
+```
+
+The "Day N" counter is anchored at 2026-07-17 (launch day is Day 1; earlier dates clamp to 1). A deterministic starter prompt is chosen the same way from the theme's seeds and pre-filled into the input; the idea chips are the theme's three seeds, and clicking one forges it immediately.
+
+**Free forge.** `forge(prompt)` sends `POST /api/forge` with `{ prompt, backend: 'nvidia' }` and an `x-forge-client` header carrying an anonymous client id (`localStorage['forge:cid']`, generated with `crypto.randomUUID()` and shared with `/forge`, `/ar`, and AR Studio). This is the free NVIDIA NIM (Microsoft TRELLIS) text-to-3D lane: no key, no account. If the response is already `{ status: 'done', glb_url }` it renders immediately; otherwise it polls `GET /api/forge?job=<id>` every 3 seconds up to a 5-minute ceiling until the job is `done` (with a GLB) or `failed`.
+
+**Streak state machine.** `src/daily/creator-streak.js` is a pure state machine over `{ current, best, lastDay, total }`, keyed to the UTC day and persisted at `localStorage['twx_daily_streak_v1']`. The streak bumps once per UTC day (idempotent: forging five times today counts once), on the model-viewer `load` event, since a completed creation is the qualifying action. A gap of exactly one day increments the streak; a larger gap resets `current` to 1 while preserving `best`. Milestones fire when `current` exactly hits one of `[3, 7, 14, 30, 50, 100, 365]`, with escalating celebration emoji and a haptic buzz.
+
+**Community strip.** `loadCommunity()` reads `GET /api/forge-gallery?scope=community&limit=12`, the newest finished models across all clients, and renders links to `/viewer?src=...`. If the request is empty or fails, the strip stays hidden.
+
+**AR handoff.** The stage `<model-viewer>` is AR-enabled (`ar-modes="webxr scene-viewer quick-look"`). "View in your room" calls `model-viewer.activateAR()` when the device supports it (WebXR, Android Scene Viewer, or iOS Quick Look), and otherwise opens the server-side device-aware launcher at `/api/ar?src=<glb>&title=<prompt>`. An "AR Studio" button opens `/ar/studio?src=<glb>&title=<prompt>`, and Share and Download build `/viewer` links and direct GLB downloads.
+
+## Walkthrough
+
+1. Open [/daily](https://three.ws/daily). The hero shows today's theme, its emoji, and a starter prompt already filled in. The header pill shows your current streak.
+2. Edit the prompt or click an idea chip, then press Forge. The stage shows a working overlay with an elapsed timer while the free lane generates.
+3. When the model loads, your streak bumps (once for today). At a milestone (3, 7, 14, 30, 50, 100, or 365 days) a celebration modal appears.
+4. Tap "View in your room" to place the model in AR on your phone, or use AR Studio, Download, or Share.
+5. Scroll to "Fresh from the community" to see what others forged today, and come back tomorrow for a new theme to keep the streak alive.
+
+## Examples
+
+The free forge lane is public and unauthenticated; the same contract powers `/daily`, `/forge`, and `/ar`.
+
+```bash
+# Start a free text-to-3D job on the NVIDIA lane
+curl -X POST 'https://three.ws/api/forge' \
+ -H 'content-type: application/json' \
+ -H 'x-forge-client: my-anonymous-id' \
+ -d '{"prompt":"a tiny brass robot with glowing eyes","backend":"nvidia"}'
+# → { "job_id": "..." } (or { "status":"done", "glb_url":"..." })
+
+# Poll the job until it is done
+curl -H 'x-forge-client: my-anonymous-id' \
+ 'https://three.ws/api/forge?job=<JOB_ID>'
+
+# The community strip: newest finished models across all clients
+curl 'https://three.ws/api/forge-gallery?scope=community&limit=12'
+```
+
+```javascript
+// Reproduce today's deterministic theme selection
+function themeIndex(dateKey, themeCount) {
+ let h = 0x811c9dc5;
+ for (let i = 0; i < dateKey.length; i++) {
+ h ^= dateKey.charCodeAt(i);
+ h = Math.imul(h, 0x01000193) >>> 0;
+ }
+ const anchor = Date.UTC(2026, 6, 17);
+ const week = Math.floor((Date.parse(dateKey + 'T00:00:00Z') - anchor) / (86400000 * 7));
+ return ((h >>> 0) + week * 5) % themeCount;
+}
+console.log(themeIndex(new Date().toISOString().slice(0, 10), 24));
+```
+
+## States and limits
+
+- **No sign-up, no key.** The whole loop is anonymous: an in-browser client id, a free NVIDIA generation lane, and a local streak. Nothing is stored server-side about you.
+- **Per day.** The theme, the starter seed, and the streak all key on the UTC day. The streak counts at most once per day.
+- **Prompt limits.** 3 to 600 characters (enforced in JS and on the input).
+- **Empty and error states.** The stage has idle, working (with an elapsed timer), and failed (with retry) overlays. The forge lane surfaces offline (503), rate-limited (429 with a retry-after), and timeout (over 5 minutes of polling) states, and a "generated but couldn't display" path that still offers a download and still counts the streak. The community strip hides itself when empty. WebGL-unsupported browsers never load the module.
+- **Shared links do not cheat the streak.** Opening `/daily?src=<glb>` to view someone else's creation does not light your streak; only a real forge does.
+
+## Related
+
+- [The 3D pipeline](./3d-pipeline.md) and [3D API](./3d-api.md): the text-to-3D forge the free lane rides
+- [Forge background generation](./forge-background-generation.md): the job and polling model
+- [AR and WebXR](./ar.md): the Scene Viewer and Quick Look handoff
+- [Quick start](./quick-start.md): the general free-forge onboarding
+- Pages: [/daily](https://three.ws/daily) · [/forge](https://three.ws/forge) · [/ar/studio](https://three.ws/ar/studio)
+
+---
+
+<a id="sec-126"></a>
> **Source:** `docs/demo-routes.md` · [↑ table of contents](#table-of-contents)
@@ -26547,7 +29399,7 @@ Verified on the live Vite dev server (`npm run dev`, port 3000):
---
-<a id="sec-111"></a>
+<a id="sec-127"></a>
> **Source:** `docs/deployment.md` · [↑ table of contents](#table-of-contents)
@@ -26896,17 +29748,18 @@ The Vite config handles multi-page routing, asset hashing, and the PWA manifest.
```
/agent/:id/edit → /agent-edit.html
/agent/:id/embed → /agent-embed.html (frame-ancestors: * header)
-/agent/:id → /agent-home.html
-/dashboard → /dashboard/index.html
-/w/:id → widget page (server-side)
-/a/:chainId/:id → on-chain agent page
+/agent/:id → 301 → /agents/:id
+/agents/:id → /agent-detail.html (bot user-agents get the OG render)
+/dashboard → /dashboard-next/index.html
+/w/:id → /api/widgets/page?id=:id (server-rendered widget page)
+/a/:chainId/:id → on-chain agent page (/api/a-page)
```
The embed routes explicitly set `frame-ancestors *` so the embed iframe can be hosted on any domain. Other routes omit this header (defaulting to same-origin framing only).
### Background cron jobs
-The `crons` array in `vercel.json` declares ~80 scheduled jobs (economy tick, on-chain crawl, delegation indexing, DCA, subscriptions, coin-launch lifecycle, treasury top-ups, and more). In production these run as **~76 Google Cloud Scheduler jobs** — one per entry — each firing `GET /api/cron/<name>` with an `Authorization: Bearer $CRON_SECRET` header. A representative slice:
+The `crons` array in `vercel.json` declares ~90 scheduled jobs (economy tick, on-chain crawl, delegation indexing, DCA, subscriptions, coin-launch lifecycle, treasury top-ups, and more). In production these run as **Google Cloud Scheduler jobs** (one per entry) each firing `GET /api/cron/<name>` with an `Authorization: Bearer $CRON_SECRET` header. A representative slice:
| Cron | Schedule | Purpose |
|---|---|---|
@@ -27089,7 +29942,7 @@ After deploying, run through these checks to verify the instance is healthy:
| Viewer | Load the app and drag-drop a GLB file |
| Wallet sign-in | Connect MetaMask — SIWE challenge + verify |
| Avatar creation | Navigate to `/create` — avatar builder iframe loads |
-| Agent page | Visit `/agent/:id` — 3D viewer with chat overlay |
+| Agent page | Visit `/agents/:id`: 3D viewer with chat overlay (`/agent/:id` 301-redirects here) |
| Embed | Check `/agent/:id/embed` loads without auth, can be iframed |
| Dashboard | Navigate to `/dashboard` — shows your agents |
| API health | `GET /api/agents` returns JSON (may be empty array) |
@@ -27130,7 +29983,113 @@ Upstash REST API uses HTTPS — no ports to open. If you see connection errors,
---
-<a id="sec-112"></a>
+## Related
+
+- [Quick Start](/docs/quick-start): get the component running before you self-host the stack
+- [Troubleshooting & FAQ](/docs/troubleshooting): symptom-first fixes, including the self-hosting section
+- [Economy heartbeat](/docs/economy-heartbeat): driving the `/api/cron/*` endpoints outside Cloud Scheduler
+- [Authentication](/docs/authentication): how sessions, SIWE, and API keys work on your instance
+
+---
+
+<a id="sec-128"></a>
+
+> **Source:** `docs/diorama.md` · [↑ table of contents](#table-of-contents)
+
+# Diorama: speak a little world into being
+
+Diorama turns one sentence into a tiny, explorable 3D world. You describe a scene, an AI set designer decomposes it into a placed set of single objects, and each object is forged into a real textured GLB and dropped into place, live, as it arrives. The finished world sits on a small floating island you can orbit, view in AR, save to a public gallery with its own permalink, and export as a single merged GLB that opens cleanly in Scene Studio.
+
+Page: [/diorama](https://three.ws/diorama) · API: `/api/diorama`
+
+## Why it exists
+
+Forge makes one object at a time. But a world is a composition: a campfire and a tent and three pine trees, arranged on the ground, lit for a mood. Doing that by hand means forging each piece, importing them into a scene editor, and placing them one by one. Diorama collapses that into a sentence. It is the difference between a modeling tool and a director's chair: you say what you want to see, and the platform composes, generates, and assembles it in front of you. Every object is a real mesh (no billboards, no fakes), so the result is genuine geometry you can walk around, share, and take into any glTF tool.
+
+## How it works
+
+Diorama is a four-step pipeline (`api/diorama.js` plus `src/diorama/`), and each step is real.
+
+1. **Compose.** `POST /api/diorama {action:'compose', prompt}` sends your sentence to the platform's free-first LLM chain (`llmComplete`) with a 3D-set-designer system prompt. The model returns a strict JSON plan: a 2-to-4-word title, a mood (`dawn`/`day`/`dusk`/`night`), a ground type (`grass`/`sand`/`snow`/`stone`/`water`/`meadow`/`void`), an island shape (`round`/`craggy`/`plateau`), a color palette (sky gradient, ground, fog, accent), and a placed list of objects. Each object is exactly one physical thing (a single tree, a single tent, never a scene and never "and"), with a one-line forge prompt (subject plus dominant material and color), an `(x, 0, z)` position spread across the island with spacing enforced, a scale, and a Y rotation. Objects come back with `status:'pending'` and no meshes.
+
+2. **Forge each object.** The browser walks the plan and calls `/api/forge` for every object, on the free lane, watching each one turn from `pending` to `forging` to `ready` (or `failed`, with an in-place retry). The renderer (`src/diorama/renderer.js`) materializes each mesh into the scene the moment it arrives, so the world assembles progressively in front of you rather than appearing all at once.
+
+3. **Save and share.** `POST /api/diorama {action:'save', diorama}` persists a fully-forged world, returns an `{id, url}` permalink, opens the share sheet, refreshes the gallery, and rewrites the page URL to the new permalink. A signed-in creator's world links to their public portfolio; anonymous saves fall back to a plain handle.
+
+4. **Export.** `POST /api/diorama {action:'export', diorama}` merges the world's objects, ground, and lights into one GLB (`api/_lib/scene-graph-compose.js`) with named, selectable nodes, uploads it, and hands back a `glbUrl` plus a `sceneStudioUrl` so it opens directly in Scene Studio ([/scene](https://three.ws/scene)) or any glTF viewer.
+
+A headless one-shot, `POST /api/diorama {action:'build', prompt}`, runs the whole flow server-side (compose, forge every object on the free lane, export the merged GLB) for callers with no browser to drive the progressive client, such as MCP tools and agents.
+
+Reads: `GET /api/diorama?id=<uuid>` loads a saved world (a deep link renders it read-only and offers a remix), and `GET /api/diorama?list=recent|featured&limit=<n>` returns gallery cards. The gallery renders each card as live geometry through `<model-viewer>`, not a flat thumbnail.
+
+There are no mocks: if the LLM chain is unreachable, the compose route returns a clean 503 and the page shows a designed retry state instead of fabricating a world.
+
+## Walkthrough
+
+1. Open [/diorama](https://three.ws/diorama).
+2. Type a sentence: `a lighthouse on a rocky islet at dusk`, or `a cozy campsite in a pine clearing`.
+3. Watch the plan appear as a row of per-object status chips (pending, forging, ready). The island, ground, and mood render immediately from the palette.
+4. Watch each object drop into place as its mesh finishes forging. A failed object gets a one-tap retry.
+5. Orbit the finished world. When at least one real mesh is present, the world actions unlock: remix, save, AR (on supported devices), and download.
+6. Save to get a permalink and a gallery slot, or export to open the merged GLB in Scene Studio.
+
+## Examples
+
+Compose a plan, then drive the forge yourself, or let the server build the whole thing.
+
+```bash
+# 1) Compose: sentence -> placed plan of single-object forge prompts.
+curl -X POST 'https://three.ws/api/diorama' \
+ -H 'content-type: application/json' \
+ -d '{"action":"compose","prompt":"a lighthouse on a rocky islet at dusk"}'
+
+# 2) Headless one-shot: compose + forge every object + export a merged GLB.
+curl -X POST 'https://three.ws/api/diorama' \
+ -H 'content-type: application/json' \
+ -d '{"action":"build","prompt":"a cozy campsite in a pine clearing"}'
+
+# 3) Load a saved world by id.
+curl 'https://three.ws/api/diorama?id=<uuid>'
+
+# 4) Browse the public gallery.
+curl 'https://three.ws/api/diorama?list=featured&limit=12'
+```
+
+The compose response shape (abridged):
+
+```json
+{
+ "title": "Dusk Lighthouse",
+ "mood": "dusk",
+ "ground": "stone",
+ "island": "craggy",
+ "palette": { "sky": ["#2a2350", "#e0724a"], "ground": "#5b5347", "fog": "#3a3550", "accent": "#ffb066" },
+ "objects": [
+ { "label": "lighthouse", "prompt": "white stone lighthouse with red top", "position": [0, 0, 0], "scale": 2.2, "rotationY": 0, "status": "pending" },
+ { "label": "rock", "prompt": "grey jagged sea rock", "position": [-3.4, 0, 2.1], "scale": 1.1, "rotationY": 1.2, "status": "pending" }
+ ]
+}
+```
+
+## States and limits
+
+- **Object count** is bounded (the plan enforces a minimum and maximum), and objects are spaced so they never stack.
+- **Compose failure**: a clean 503 and a designed retry state, never a fabricated world.
+- **Per-object status**: pending, forging, ready, failed (with in-place retry). One failed object does not block the rest.
+- **Save/export** need object storage configured; export returns 503 with a clear message when it is not.
+- **AR and download** appear only once at least one real mesh has forged.
+- **Deep links** render a saved world read-only and offer a remix, so a shared permalink is stable.
+- Prompt length is capped; reads are rate-limited per client IP.
+
+## Related
+
+- [Forge](./forge.md) is the single-object generator every diorama object is forged on.
+- [Image to 3D](./image-to-3d.md) for photo-based objects; [AR](./ar.md) for viewing worlds in augmented reality.
+- Pages: [/scene](https://three.ws/scene) (Scene Studio, where an exported diorama opens), [/gallery](https://three.ws/gallery), [/create](https://three.ws/create).
+
+---
+
+<a id="sec-129"></a>
> **Source:** `docs/do-i-need-crypto.md` · [↑ table of contents](#table-of-contents)
@@ -27142,7 +30101,7 @@ Short answer: it depends on what you want to do. Here's the honest breakdown.
## Viewing and chatting with agents
-**No wallet or crypto needed.** Anyone can open an agent link (`three.ws/agent/<id>`) and chat with it. No account, no extension, no sign-in.
+**No wallet or crypto needed.** Anyone can open an agent link (`three.ws/agents/<id>`) and chat with it. No account, no extension, no sign-in.
---
@@ -27154,14 +30113,12 @@ Short answer: it depends on what you want to do. Here's the honest breakdown.
## Creating or editing agents
-**Currently requires a wallet sign-in.** The hosted platform uses wallet-based authentication (EIP-4361 SIWE for EVM wallets like MetaMask, or Phantom for Solana). If you don't have a wallet extension, you'll hit a sign-in wall.
+**No wallet needed.** The sign-in page at [three.ws/login](/login) offers two paths side by side:
-> A no-wallet sign-in path (email / passkey) is actively being built. Once live, you'll be able to create and publish agents with just an email address — no extension, no seed phrase.
+- **Email + password**: register with just an email address (or a username). No extension, no seed phrase. This is all you need to create, edit, and publish agents.
+- **Wallet sign-in**: EIP-4361 SIWE for EVM wallets like MetaMask, or a Solana wallet like Phantom. Choose this if you want on-chain features tied to a wallet you already own.
-In the meantime, the easiest path for non-crypto users:
-1. Install [MetaMask](https://metamask.io) (free browser extension)
-2. Create a new wallet — you don't need to fund it or buy anything for basic agent creation
-3. Sign in to three.ws using that wallet
+The two are equivalent for building agents. A wallet only becomes relevant when you use the optional on-chain features below.
---
@@ -27171,13 +30128,11 @@ Most basic features are free. You pay when you use premium capabilities:
| What | How | Roughly how much |
|---|---|---|
-| Hosted AI brain (LLM calls) | Billed to your three.ws account in USDC | Fractions of a cent per message |
+| Hosted AI brain (LLM calls) | A free default model is included; premium Claude models run on a paid plan or your own API key | Free to start |
| Premium skills (skill purchases) | USDC micropayment via x402 | Set by the skill author |
| On-chain registration (ERC-8004) | Small gas fee on Base | A few cents in ETH |
-**USDC** is a dollar-pegged stablecoin — 1 USDC ≈ $1 USD. It doesn't go up or down the way ETH or SOL does. When you see a price in USDC, you can treat it as dollars.
-
-> USD price display (showing "≈ $0.01" next to USDC amounts) is being added across the platform so you never have to do mental-math from crypto to dollars.
+**USDC** is a dollar-pegged stablecoin: 1 USDC ≈ $1 USD. It doesn't go up or down the way ETH or SOL does. When you see a price in USDC, you can treat it as dollars. Payment surfaces on the platform also show the approximate USD (or SOL) equivalent next to the amount, so you never have to do mental math from crypto to dollars.
---
@@ -27206,7 +30161,7 @@ When you do interact with on-chain features, the platform's native token is **$T
|---|---|---|
| View / chat with an agent | No | No |
| Embed a widget on your site | No | No |
-| Create an account and build agents | Currently yes | No (wallet, not funded) |
+| Create an account and build agents | No (email sign-in works) | No |
| Use a premium skill | Yes + small USDC balance | Yes (USDC ≈ $) |
| Register on-chain (optional) | Yes + gas | Yes (small ETH) |
@@ -27221,7 +30176,7 @@ When you do interact with on-chain features, the platform's native token is **$T
---
-<a id="sec-113"></a>
+<a id="sec-130"></a>
> **Source:** `docs/economy-heartbeat.md` · [↑ table of contents](#table-of-contents)
@@ -27382,7 +30337,7 @@ Related: [circulation engine](circulation-engine.md) ·
---
-<a id="sec-114"></a>
+<a id="sec-131"></a>
> **Source:** `docs/economy-master.md` · [↑ table of contents](#table-of-contents)
@@ -27493,6 +30448,68 @@ when there was nothing to collect. Dust guard: a sweep below
`ECONOMY_SWEEPBACK_MIN_SOL` (default 0.01 SOL) is skipped so fees never exceed
the return.
+## Fuel: refilling the root from revenue
+
+Topup and sweepback only move SOL that already exists in the fleet. But the
+circulation engine is a **closed SOL loop** — agents fund each other and trade
+among themselves, and every tick leaks a little SOL to Solana network and DEX
+fees. A loop that only leaks eventually drains to zero no matter how the two crons
+shuffle the remaining SOL, and when it hits zero the Money Pulse
+([`/pulse`](../pages/pulse.html)) goes quiet. Historically the only cure was a
+human moving SOL in.
+
+When the master can't cover the engines' real deficit, the topup cron self-heals
+in two automatic steps before it ever pages a human, in cheapest-first order:
+
+**Step 1: reclaim idle SOL (free).** `reclaimIdleSol`
+([`api/_lib/economy-sweepback.js`](../api/_lib/economy-sweepback.js)) pulls SOL
+sitting **above each engine's operating floor** (`minSol`, not the topup
+`refillTo`) back to the master, SOL only. This is the automated form of the manual
+"drain the fleet to refund the feed" recovery: SOL trapped in an over-provisioned
+engine (a launcher floored for bursts that isn't launching, say) flows to where
+the Money Pulse needs it. It is **non-oscillating by construction** (`reclaimableSol`,
+unit-tested): it leaves every engine at `minSol` plus a buffer, and the topup only
+funds engines strictly *below* `minSol`, so a reclaimed engine is never
+re-funded and the two crons can't ping-pong. The feed sink (circulation-treasury)
+is exempt, and the destination is the same hard-locked `ECONOMY_MASTER_ADDRESS`.
+
+**Step 2: refuel from revenue.** If reclaim doesn't close the gap, **fuel**
+([`api/_lib/economy-fuel.js`](../api/_lib/economy-fuel.js)) converts a small,
+bounded slice of the master's **own idle USDC revenue** into native SOL through a
+real Jupiter route, then lets the topup distribute the proceeds.
+
+Safe by construction, in the same spirit as the topup allowlist and the sweepback
+destination lock:
+
+- **Self-directed.** The master swaps *its own* USDC for *its own* SOL. There is
+ no recipient parameter — funds can't go anywhere but from one asset the root
+ holds into another. It is the least-privileged possible money move.
+- **Only on a genuine shortage.** No-op unless the master's spendable SOL falls
+ short of the pending run's deficit by at least `ECONOMY_FUEL_MIN_GAP_SOL`.
+- **Triple-bounded.** A per-swap cap (`ECONOMY_FUEL_PER_RUN_USDC`, default $25), a
+ per-UTC-day cap (`ECONOMY_FUEL_DAILY_USDC`, default $100), and a USDC keep-floor
+ (`ECONOMY_FUEL_USDC_KEEP`) the swap never spends below. A Jupiter route with
+ price impact above `ECONOMY_FUEL_MAX_IMPACT_PCT` (default 3%) is rejected, not
+ executed.
+- **Booked.** Every swap lands in `economy_fuel_swaps` (which drives the daily
+ cap) and fires an ops alert. When fuel *did* act, the "master could not refill"
+ page is suppressed — the shortage is being handled autonomously; the next tick
+ distributes the freshly-bought SOL.
+
+The swap confirms through the platform's HTTP-polling confirmer
+([`api/_lib/solana/confirm.js`](../api/_lib/solana/confirm.js)) bound to the
+transaction's own blockhash, and a landed-but-reverted swap throws rather than
+being booked. A per-swap cooldown (`ECONOMY_FUEL_COOLDOWN_S`) plus the on-chain
+daily-cap read together stop two overlapping topup ticks from double-swapping.
+
+Set `ECONOMY_FUEL_ENABLED=0` to turn it off entirely (the fleet then falls back to
+the "fund the master" ops alert). The decision/sizing math is a pure function
+(`planRefuel`) covered by [`tests/economy-fuel.test.js`](../tests/economy-fuel.test.js).
+Live fuel state (today's spend against the cap, recent swaps, quarantined agents)
+is exposed on [`/api/admin/circulation-health`](../api/admin/circulation-health.js)
+alongside the circulation rails. The table is defined by migration
+`20260717230000_economy_fuel_swaps.sql` (and created lazily as a safety net).
+
## Lowest fees
Every transfer routes through `submitProtected` with `tipMode: 'off'` — **no Jito
@@ -27508,6 +30525,12 @@ congestion, clamped to a hard ceiling.
| `ECONOMY_MASTER_SECRET_BASE58` | yes | The master keypair (base58 of 64 raw bytes). Unset ⇒ the funding root is inert. Store it as a secret on the Cloud Run service (or your host's secret store), never plaintext; keep your own offline copy since secret values are unreadable after they are written. |
| `ECONOMY_MASTER_ADDRESS` | no | Override the expected pubkey if the master is ever rotated. Defaults to the address above. |
| `ECONOMY_MASTER_RESERVE_SOL` / `_PER_TOPUP_MAX_SOL` / `_RUN_CAP_SOL` | no | Guard caps (see table). |
+| `ECONOMY_FUEL_ENABLED` | no | `0` disables the USDC→SOL auto-refuel (default on). |
+| `ECONOMY_FUEL_PER_RUN_USDC` / `_DAILY_USDC` | no | Fuel caps: max USDC per swap (default 25) and per UTC day (default 100). |
+| `ECONOMY_FUEL_USDC_KEEP` | no | USDC the refuel never spends below (revenue reserve). Default 0. |
+| `ECONOMY_FUEL_MIN_GAP_SOL` / `_TARGET_SOL` | no | Only refuel when the SOL gap is at least this (default 0.1); buy toward this spendable-SOL buffer (default 1.0). |
+| `ECONOMY_FUEL_MAX_IMPACT_PCT` / `_SLIPPAGE_BPS` | no | Reject a route above this price impact (default 3%); swap slippage (default 100 bps). |
+| `ECONOMY_FUEL_COOLDOWN_S` | no | Minimum seconds between fuel swaps (default 90), a belt against a double-swap when two topup ticks overlap. |
| `CRON_SECRET` | yes | Bearer auth for the `treasury-topup` cron (shared with every other cron; Cloud Scheduler sends it). |
| `SOLANA_RPC_URL` | no | Mainnet RPC (defaults to `api.mainnet-beta`). |
@@ -27655,13 +30678,13 @@ The master is configured and funded, but the tree it feeds is only partly wired:
---
-<a id="sec-115"></a>
+<a id="sec-132"></a>
> **Source:** `docs/editor.md` · [↑ table of contents](#table-of-contents)
# Editor Guide
-The three.ws editor lets you inspect and modify an agent's 3D model, adjust materials and textures, build the agent manifest, and publish the result to the platform. This guide covers the full workflow from opening a file through publishing.
+The three.ws editor lets you inspect and modify an agent's 3D model, adjust materials and textures, build the agent manifest, and publish the result to the platform. It runs entirely in the browser: open a GLB, edit, and publish or download. This guide covers the full workflow from opening a file through publishing.
---
@@ -27672,16 +30695,16 @@ The three.ws editor lets you inspect and modify an agent's 3D model, adjust mate
If you own an agent and are authenticated:
```
-https://three.ws/agent-edit?agent=<agent-id>
+https://three.ws/agent/<agent-id>/edit
```
-This opens the full editor pre-loaded with your agent's GLB and manifest. You must be signed in — the platform checks ownership at the storage layer when you attempt to save or publish.
+This opens the agent edit page pre-loaded with your agent's GLB and configuration. You must be signed in. The platform checks ownership server-side when you attempt to save or publish.
-Alternative URL forms that also work:
+Two more entry points:
```
-https://three.ws/agent/<id>/edit ← owner-only edit page
-https://three.ws/app?agent=<id> ← app shell with agent in edit mode
+https://three.ws/agent/new starts a new agent from scratch
+https://three.ws/app?agent=<id> the viewer app shell in editing mode with save-back
```
### Open any GLB file (no account required)
@@ -27698,17 +30721,16 @@ Then drag and drop any `.glb` file onto the viewport. The editor loads the file
## Editor Layout
-The editor is organized into five regions:
+The editor is organized into four regions:
| Region | What it contains |
|---|---|
-| **Left panel** | Scene Explorer — the full object tree |
+| **Scene Explorer panel** | The full object tree, with an inspector below it showing the selected object's properties |
| **Center** | 3D viewport (three.js canvas with editing enabled) |
-| **Right panel** | Inspector — properties of the selected object |
-| **Bottom toolbar** | Animation controls, download, publish button |
-| **dat.GUI overlay** | Quick-access buttons: Download, Publish, Scene Panel, Revert |
+| **Animation panel** | Clip buttons rendered by the viewer for rigged models |
+| **dat.GUI "Editor" folder** | Quick-access actions: download GLB, publish as embed, scene panel, save edits, revert all edits |
-The dat.GUI panel (top-right corner) is the primary way to trigger editor actions. The Scene Explorer is toggled with the `T` key or the "Scene Panel" button.
+The dat.GUI panel (behind the Controls toggle, top-right corner) is the primary way to trigger editor actions. The Scene Explorer is toggled with the `T` key or the "scene panel [T]" button.
---
@@ -27824,7 +30846,7 @@ If the loaded model contains morph targets (also called blend shapes), sliders a
- Range: **0.0** (rest pose) to **1.0** (full deformation)
- Changes are applied in real-time in the viewport
-- Label names match the identifiers the emotion system expects (e.g., `happy`, `sad`, `surprised`)
+- The emotion system drives ARKit-style blendshape names (`mouthSmile`, `browInnerUp`, `eyesClosed`, and similar); if your model's targets use those names, expressions work automatically
Use these sliders to verify expressions look correct before connecting them to the emotion system. Morph target influences are not currently written to the export.
@@ -27832,15 +30854,16 @@ Use these sliders to verify expressions look correct before connecting them to t
## Animation Controls
-The animation panel (bottom toolbar, from `animation-panel.jsx`) lists all clips embedded in the GLB.
+The animation panel (rendered by the viewer, `src/viewer.js` `.anim-panel`) lists the clip library available to the loaded rig.
-- **Play/Pause** per clip — click the clip button to toggle
+- **Play** per clip: click the clip button to crossfade to it
- **Stop all** (⏹) — halts all running clips
- **Active state** — the currently playing clip is highlighted
+- **1-9 keys**: trigger the first nine clips
Animations continue running while you adjust materials. This is intentional: it lets you preview how the avatar looks in motion while tweaking a roughness value, rather than evaluating a static pose.
-The panel does not yet expose per-clip speed control or duration display in the current UI; those are visible in the dat.GUI overlay when a clip is selected.
+Clips embedded in the GLB itself get per-clip toggles and a playback-speed slider in the dat.GUI **Animation** folder.
---
@@ -27993,14 +31016,25 @@ The editor is at format version `agent-editor/0.1`. The following rough edges ar
4. **Duplicate material names** — if the GLB contains two materials with the same name, only the first match is patched during export.
5. **No DOM events** — the editor does not fire DOM events on session changes. External code must call `session.onChange()` directly.
+The full contract lives in [specs/EDITOR_SPEC.md](https://github.com/nirholas/three.ws/blob/main/specs/EDITOR_SPEC.md).
+
+## Related
+
+- [3D Viewer](/docs/viewer): the rendering layer the editor sits on
+- [Agent Manifest](/docs/agent-manifest): the manifest format the builder produces
+- [Avatar creation](/docs/avatar-creation): generate an avatar to edit
+- [Embedding](/docs/embedding): what the published embed snippet gives you
+
---
-<a id="sec-116"></a>
+<a id="sec-133"></a>
> **Source:** `docs/embedding.md` · [↑ table of contents](#table-of-contents)
# Embedding Guide
+Embedding puts a live three.ws agent (a 3D avatar that can talk, gesture, and run skills) on any website or platform you control, from a one-line web component to a paste-a-link oEmbed. This guide covers every supported method and when to use each. To generate a ready-made snippet without reading further, publish a widget in Widget Studio at [three.ws/studio](https://three.ws/studio).
+
> **Audience:** Developers and no-code builders who want to add a three.ws agent to a website, app, or platform.
---
@@ -28087,8 +31121,9 @@ free-tier proxy. Pair it with `instructions` for a system prompt:
```
Set `brain` to a specific model id (e.g. `claude-sonnet-4-6`) instead of `free`
-to use a paid model via your three.ws dashboard key, or `brain="none"` to keep
-it a pure display embed (see [Performance tips](#performance-tips)).
+to use a paid model via your three.ws dashboard key. Omit the `brain` attribute
+entirely to keep a bare-GLB embed a pure, silent display
+(see [Performance tips](#performance-tips)).
### Sizing
@@ -28245,7 +31280,7 @@ el.addEventListener('voice:speech-start', e => {
});
```
-Key events: `agent:ready`, `agent:load-progress`, `agent:error`, `brain:message`, `brain:thinking`, `voice:speech-start`, `voice:speech-end`, `voice:transcript`, `skill:loaded`, `skill:tool-called`, `memory:write`, `chain:resolved`.
+Key events: `agent:ready`, `agent:load-progress`, `agent:error`, `brain:message`, `brain:thinking`, `brain:stream`, `voice:speech-start`, `voice:speech-end`, `voice:transcript`, `voice:listen-start`, `skill:loaded`, `skill:tool-called`, `skill:purchased`, `memory:write`.
### Performance and lazy loading
@@ -28300,7 +31335,7 @@ The `allow` attribute controls browser feature access:
|---------|-----|
| Backend agent | `/agent/{agent-id}/embed` or `/agent-embed.html?id={agent-id}` |
| On-chain agent | `/a/{chainId}/{agentId}/embed` |
-| Widget (kiosk) | `/app#widget={widget-id}&kiosk=true` |
+| Widget (kiosk) | `/widget#widget={widget-id}&kiosk=true` (legacy `/app#widget=...` still works) |
| Model viewer only | `/#model={glb-url}` |
### postMessage protocol
@@ -28316,19 +31351,19 @@ const agentId = 'a_abc123'; // must match the id in the iframe src
// Handshake — send once after iframe load
iframe.contentWindow.postMessage(
{ type: 'agent:hello', agentId },
- 'https://three.ws/'
+ 'https://three.ws'
);
// Trigger an action
iframe.contentWindow.postMessage(
{ type: 'agent:action', agentId, action: { type: 'speak', text: 'Hello!' } },
- 'https://three.ws/'
+ 'https://three.ws'
);
// Liveness probe
iframe.contentWindow.postMessage(
{ type: 'agent:ping', agentId, id: 'probe_1' },
- 'https://three.ws/'
+ 'https://three.ws'
);
```
@@ -28337,7 +31372,7 @@ iframe.contentWindow.postMessage(
```js
window.addEventListener('message', e => {
// Always verify origin before trusting the message
- if (e.origin !== 'https://three.ws/') return;
+ if (e.origin !== 'https://three.ws') return;
const { type, agentId } = e.data;
@@ -28669,7 +31704,7 @@ Framer supports custom code components — wrap `<agent-3d>` in a code component
Add the script tag to `theme.liquid` inside `<head>`, then use `<agent-3d>` directly in product page templates or section files.
-Want a guide that *walks the storefront* — spotlighting sections, narrating, free-roaming — instead of a boxed embed? That's the tour SDK, not `<agent-3d>` (it needs host-DOM access an iframe/web component doesn't have). Follow the [3D store guide for Shopify tutorial](/tutorials/shopify-store-guide).
+Want a guide that *walks the storefront* (spotlighting sections, narrating, free-roaming) instead of a boxed embed? That's the tour SDK, not `<agent-3d>` (it needs host-DOM access an iframe/web component doesn't have). Follow the [3D store guide for Shopify tutorial](/docs/tutorials/shopify-store-guide).
---
@@ -28683,7 +31718,7 @@ Want a guide that *walks the storefront* — spotlighting sections, narrating, f
<agent-3d src="agent://base/42" kiosk auto-rotate></agent-3d>
```
-**Viewer-only (no LLM):** Add `brain="none"` to prevent the LLM client from loading. Use this for pure 3D display embeds.
+**Viewer-only (no LLM):** For bare-GLB embeds (`body` or a `.glb` `src`), simply omit the `brain` attribute; without it the LLM client never loads and the embed stays a silent display.
**Auto-rotate:** Only enable `auto-rotate` for turntable-style static displays. It runs a continuous animation loop and keeps the GPU active.
@@ -28736,7 +31771,7 @@ The platform records anonymous embed impressions (country, referrer hostname) vi
---
-<a id="sec-117"></a>
+<a id="sec-134"></a>
> **Source:** `docs/embody.md` · [↑ table of contents](#table-of-contents)
@@ -28846,7 +31881,7 @@ Embody is a thin, honest wire over pieces that already exist — no new pipeline
---
-<a id="sec-118"></a>
+<a id="sec-135"></a>
> **Source:** `docs/erc8004.md` · [↑ table of contents](#table-of-contents)
@@ -29168,8 +32203,10 @@ The resolver understands several equivalent ways to refer to an agent:
### JavaScript SDK
+The resolver lives in the open-source three.ws codebase at [src/erc8004/resolver.js](../src/erc8004/resolver.js); it is not part of the `@three-ws/sdk` npm package, so vendor the module or import it in-repo:
+
```js
-import { resolveOnchainAgent, parseAgentRef } from '@three-ws/sdk/erc8004';
+import { resolveOnchainAgent, parseAgentRef } from './src/erc8004/resolver.js';
// By chain + agent ID
const agent = await resolveOnchainAgent({ chainId: 8453, agentId: 42 });
@@ -29215,7 +32252,7 @@ The `<agent-3d>` element boots the full agent runtime — 3D rendering, memory,
The resolver tries multiple IPFS gateways in sequence when fetching metadata:
1. `ipfs.io`
2. `dweb.link`
-3. `cloudflare-ipfs.com`
+3. `flk-ipfs.xyz`
4. `gateway.pinata.cloud`
Arweave (`ar://`) URIs are resolved through `arweave.net`.
@@ -29273,14 +32310,14 @@ After registering, your agent starts accumulating on-chain reputation. Any walle
Scores are integers from −100 to +100. The contract stores each individual review (submitter address, score, optional IPFS pointer to a longer write-up) and maintains a running aggregate (sum + count). The `getReputation` call returns `(avgX100, count)`:
```js
-import { getReputation, getRecentReviews } from '@three-ws/sdk/erc8004';
+import { getReputation, getRecentReviews } from './src/erc8004/reputation.js';
-const { total, count, average } = await getReputation({
+const { count, average } = await getReputation({
agentId: 42,
chainId: 8453,
runner: provider, // ethers Provider or Signer
});
-// average is the mean score as a plain number (e.g. 87.5)
+// average is the mean score as a plain number (e.g. 87.5); 0 when count is 0
```
To paginate through individual reviews:
@@ -29298,7 +32335,7 @@ const reviews = await getRecentReviews({
### Submitting feedback
```js
-import { submitReputation } from '@three-ws/sdk/erc8004';
+import { submitReputation } from './src/erc8004/reputation.js';
const txHash = await submitReputation({
agentId: 42,
@@ -29313,7 +32350,7 @@ Two constraints are enforced: one review per wallet address per agent, and agent
### Displaying reputation
-The `widget="passport"` mode on `<agent-3d>` renders the reputation score automatically as part of the agent's identity card. You can also embed the reputation panel standalone using the `ReputationPanel` component from `/src/erc8004/reputation-panel.js`.
+The **ERC-8004 Passport** widget type in Widget Studio ([three.ws/studio](https://three.ws/studio), implemented in [src/widgets/passport.js](../src/widgets/passport.js)) renders the reputation score as part of the agent's on-chain identity card, embeddable via `/w/{widget-id}`. Agent profile pages mount the `ReputationPanel` component from [src/erc8004/reputation-panel.js](../src/erc8004/reputation-panel.js) automatically, and the standalone [Reputation Explorer](https://three.ws/reputation) works for any `(chainId, agentId)` pair.
---
@@ -29334,7 +32371,7 @@ Only allow-listed validator addresses can call `recordValidation`. Validators ar
### Reading the latest validation
```js
-import { getLatestValidation } from '@three-ws/sdk/erc8004';
+import { getLatestValidation } from './src/erc8004/validation-recorder.js';
const result = await getLatestValidation({
agentId: 42,
@@ -29348,7 +32385,7 @@ const result = await getLatestValidation({
### Verifying independently
```js
-import { hashReport, reportPassed } from '@three-ws/sdk/erc8004';
+import { hashReport, reportPassed } from './src/erc8004/validation-recorder.js';
// Re-run the validator and hash the new report
const freshReport = await runGltfValidator(glbBytes);
@@ -29362,7 +32399,7 @@ console.log(freshHash === onchainResult.proofHash); // true = authentic
## Programmatic registration
-To integrate ERC-8004 registration into your own application, you can call the contract functions directly using the ethers v6 API.
+To integrate ERC-8004 registration into your own application, you can call the contract functions directly using the ethers v6 API. The helpers below live in the open-source three.ws codebase under `src/erc8004/` (import in-repo or vendor them); the `@three-ws/sdk` npm package ships a leaner variant (`connectWallet`, `registerAgent`, `getIdentityRegistry`, `buildRegistrationJSON`, `REGISTRY_DEPLOYMENTS`, `agentRegistryId`) with a simplified `registerAgent({ name, description, endpoint, imageFile, services, apiToken, onStatus })` signature.
### Full registration flow
@@ -29371,7 +32408,7 @@ import {
connectWallet,
registerAgent,
getIdentityRegistry,
-} from '@three-ws/sdk/erc8004';
+} from './src/erc8004/agent-registry.js';
// Connect the user's wallet
const { signer, chainId, address } = await connectWallet();
@@ -29396,7 +32433,7 @@ The `onStatus` callback fires at each step so you can show progress in your UI.
### Reading agents
```js
-import { getIdentityRegistry } from '@three-ws/sdk/erc8004';
+import { getIdentityRegistry } from './src/erc8004/agent-registry.js';
import { BrowserProvider } from 'ethers';
const provider = new BrowserProvider(window.ethereum);
@@ -29422,8 +32459,8 @@ const val = await registry.getMetadata(agentId, 'myKey');
### Building the agent card manually
```js
-import { buildRegistrationJSON, agentRegistryId } from '@three-ws/sdk/erc8004';
-import { REGISTRY_DEPLOYMENTS } from '@three-ws/sdk/erc8004/abi';
+import { buildRegistrationJSON } from './src/erc8004/agent-registry.js';
+import { agentRegistryId, REGISTRY_DEPLOYMENTS } from './src/erc8004/abi.js';
const card = buildRegistrationJSON({
name: 'My Agent',
@@ -29477,8 +32514,8 @@ Testnet gas is free from faucets:
## Contract addresses reference
```js
-// From src/erc8004/abi.js
-import { REGISTRY_DEPLOYMENTS } from '@three-ws/sdk/erc8004/abi';
+// From src/erc8004/abi.js (the @three-ws/sdk npm package exports the same table)
+import { REGISTRY_DEPLOYMENTS } from './src/erc8004/abi.js';
// Example: Base mainnet
REGISTRY_DEPLOYMENTS[8453] === {
@@ -29517,7 +32554,7 @@ The same MAINNET addresses apply to all 15 mainnets. The same TESTNET addresses
---
-<a id="sec-119"></a>
+<a id="sec-136"></a>
> **Source:** `docs/erc8004/validation-attestation.md` · [↑ table of contents](#table-of-contents)
@@ -29609,7 +32646,7 @@ ValidationRegistry is deployed, `/api/erc8004/validate` returns a clear ops erro
---
-<a id="sec-120"></a>
+<a id="sec-137"></a>
> **Source:** `docs/examples.md` · [↑ table of contents](#table-of-contents)
@@ -30088,7 +33125,7 @@ Load different GLB models at runtime by calling `say()` or by swapping the `body
Take a PNG snapshot of the current viewer state. The viewer renders a fresh frame and triggers a file download directly.
-**Demonstrates:** `viewer.takeScreenshot()`, debug global `window.VIEWER`, keyboard shortcut `P`.
+**Demonstrates:** the built-in `P` keyboard shortcut, triggering it programmatically, `window.VIEWER` on the studio page.
```html
<agent-3d
@@ -30102,20 +33139,19 @@ Take a PNG snapshot of the current viewer state. The viewer renders a fresh fram
<script type="module">
import 'https://three.ws/agent-3d/latest/agent-3d.js';
+ // The viewer binds a window-level shortcut: pressing P (when no input is
+ // focused) renders a fresh frame and downloads it as a PNG. The button
+ // below triggers the same handler programmatically.
document.getElementById('capture').addEventListener('click', () => {
- // window.VIEWER is a debug global exposed by the runtime.
- // takeScreenshot() renders a fresh frame and downloads it as PNG.
- window.VIEWER?.takeScreenshot();
+ window.dispatchEvent(new KeyboardEvent('keydown', { key: 'P' }));
});
-
- // Keyboard shortcut: press P to screenshot (built in)
</script>
```
-> The `P` key is a built-in shortcut — no code needed. `takeScreenshot()` triggers a browser download directly; there is no return value.
+> The `P` key is a built-in shortcut: no code needed. The screenshot triggers a browser download directly; there is no return value. On the full studio page ([three.ws/app](https://three.ws/app)) the viewer is also exposed as the debug global `window.VIEWER`, where you can call `window.VIEWER.takeScreenshot()` from the console; standalone embeds don't set that global.
**What to change:**
-- Swap to the `P` key shortcut for a frameless experience — no button needed
+- Skip the button and just document the `P` key for a frameless experience
- Listen for `agent:ready` before enabling the button so it's not clickable during load
- Chain a `brain:message` listener to auto-screenshot when the agent finishes speaking
@@ -30123,9 +33159,9 @@ Take a PNG snapshot of the current viewer state. The viewer renders a fresh fram
## 9. iframe postMessage integration
-Control an embedded agent from the host page using the versioned postMessage protocol. Every message uses the `{ v: 1, type, payload }` envelope.
+Control an embedded agent from the host page using the iframe bridge on `/agent/<id>/embed`. Every message carries the `agentId` so one host page can drive several iframes deterministically.
-**Demonstrates:** `EMBED_HOST_PROTOCOL`, `host.chat.message`, `host.action`, `embed.ready`, `embed.event`.
+**Demonstrates:** the frozen v1 `agent:*` bridge: `agent:hello`, `agent:ready`, `agent:action`, `agent:ping`/`agent:pong`.
```html
<!-- host.html -->
@@ -30137,7 +33173,7 @@ Control an embedded agent from the host page using the versioned postMessage pro
<body>
<iframe
id="embed"
- src="https://three.ws/embed?agent=your-agent-id"
+ src="https://three.ws/agent/YOUR_AGENT_ID/embed"
width="400"
height="500"
style="border:none;border-radius:12px"
@@ -30146,52 +33182,56 @@ Control an embedded agent from the host page using the versioned postMessage pro
<div style="margin-top:12px;display:flex;gap:8px">
<button onclick="greet()">Say Hello</button>
<button onclick="wave()">Wave</button>
- <button onclick="setDark()">Dark Mode</button>
</div>
<script>
- const EMBED_ORIGIN = 'https://three.ws/';
+ const AGENT_ID = 'YOUR_AGENT_ID';
+ const EMBED_ORIGIN = 'https://three.ws'; // no trailing slash; must equal e.origin exactly
const iframe = document.getElementById('embed');
let ready = false;
- // Wait for embed.ready before sending commands
+ // Wait for agent:ready before sending commands
window.addEventListener('message', e => {
if (e.origin !== EMBED_ORIGIN) return;
- const { v, type, payload } = e.data;
- if (v !== 1) return;
+ const msg = e.data;
+ if (!msg || msg.agentId !== AGENT_ID) return;
- if (type === 'embed.ready') {
+ if (msg.type === 'agent:ready') {
ready = true;
- console.log('Agent ready:', payload.agentId, payload.capabilities);
+ console.log('Agent ready:', msg.name, msg.capabilities);
}
-
- if (type === 'embed.event') {
- console.log('Agent event:', payload.event, payload.data);
+ if (msg.type === 'agent:action') {
+ console.log('Agent action echo:', msg.action);
+ }
+ if (msg.type === 'agent:blocked') {
+ console.warn('Embed policy denied this host page');
}
});
- function post(type, payload = {}) {
+ // Handshake: the iframe replies with agent:ready (now or when init completes)
+ iframe.addEventListener('load', () => {
+ iframe.contentWindow.postMessage(
+ { type: 'agent:hello', agentId: AGENT_ID },
+ EMBED_ORIGIN
+ );
+ });
+
+ function post(action) {
if (!ready) return console.warn('Agent not ready yet');
- iframe.contentWindow.postMessage({ v: 1, type, payload }, EMBED_ORIGIN);
+ iframe.contentWindow.postMessage(
+ { type: 'agent:action', agentId: AGENT_ID, action },
+ EMBED_ORIGIN
+ );
}
function greet() {
- // Deliver a chat turn into the agent
- post('host.chat.message', {
- role: 'user',
- text: 'Hello! How are you?',
- messageId: `msg_${Date.now()}`
- });
+ // Speak through the agent's TTS voice (drives lip-sync too)
+ post({ type: 'speak', text: 'Hello! How are you?' });
}
function wave() {
- // Trigger a named action — emote or speech
- post('host.action', { action: 'emote.wave', args: {} });
- }
-
- function setDark() {
- // Switch the embed theme
- post('host.theme', { mode: 'dark' });
+ // Named body gesture on the protocol bus (point, wave, nod, shrug)
+ post({ type: 'gesture', payload: { name: 'wave' } });
}
</script>
</body>
@@ -30199,16 +33239,16 @@ Control an embedded agent from the host page using the versioned postMessage pro
```
**Key protocol rules:**
-- Every message must include `v: 1` — messages without it are ignored.
-- The embed sends `embed.ready` first; wait for it before sending commands.
-- `host.chat.message` delivers a user turn; the agent responds and fires `embed.event` with `agent.speaking`.
-- `host.action` supports `emote.wave`, `speak`, and any other named action.
-- Always validate `e.origin` against the expected embed origin before processing.
+- Every message must include the `agentId`; messages without it (or with a foreign id) are ignored.
+- Send `agent:hello` first and wait for `agent:ready` (it includes `capabilities`: `speak`, `gesture`, `look-at`, `emote`, `present-model`).
+- `agent:action` forwards an action onto the iframe's protocol bus: `speak` and `speak:stop` are handled specially; anything else (e.g. `gesture`, `emote`, `look-at`) is emitted as-is.
+- The iframe locks onto the first authenticated sender origin and ignores messages from any other origin afterward. Always validate `e.origin` on your side too, comparing against the bare origin (`https://three.ws`, no trailing slash).
+- If the agent's embed policy doesn't allow your domain, the iframe posts `agent:blocked` instead of `agent:ready`.
**What to change:**
-- Use `host.hello` after `embed.ready` to pass `userId` and `userName` for personalization
-- Listen for `embed.event` with `event: 'agent.speaking'` to mirror the agent's transcript in the host UI
-- Set `allowedOrigins` in the embed config to restrict which host pages can send commands
+- Use `agent:ping` (`{ type: 'agent:ping', agentId, id }`) and listen for `agent:pong` for a liveness probe
+- Listen for `agent:resize` (`{ height }`) to grow the iframe to the content's preferred height
+- For script (non-iframe) embeds of `<agent-3d>`, use the `EmbedHostBridge` class (`src/embed-host-bridge.js`) instead of raw `postMessage`; it handles the handshake and response correlation for you
---
@@ -30226,6 +33266,8 @@ Coach Leo is a fully-configured agent with a personality, skills, and persistent
"spec": "agent-manifest/0.1",
"name": "Coach Leo",
"description": "Football coach. Reviews your form, cheers you on.",
+ "image": "/avatars/cz.glb",
+ "tags": ["coach", "football", "argentina"],
"body": {
"uri": "/avatars/cz.glb",
"format": "gltf-binary",
@@ -30234,7 +33276,7 @@ Coach Leo is a fully-configured agent with a personality, skills, and persistent
},
"brain": {
"provider": "anthropic",
- "model": "claude-opus-4-7",
+ "model": "claude-opus-4-6",
"instructions": "instructions.md",
"temperature": 0.8,
"maxTokens": 2048
@@ -30259,7 +33301,7 @@ Coach Leo is a fully-configured agent with a personality, skills, and persistent
```markdown
---
name: Coach Leo
-model: claude-opus-4-7
+model: claude-opus-4-6
temperature: 0.8
---
@@ -30271,12 +33313,13 @@ genuinely invested in the user's progress.
- When the user greets you, call `wave()` to wave at them.
- When they describe a drill or ask about form, set a focused expression
- with `setExpression({ preset: "focused" })` while you explain, then smile.
+ with `setExpression({ preset: "focused" })` while you explain, then smile
+ afterward.
- If the user shares something worth remembering (their position, goals,
injuries, schedule), call `remember()` to save it durably.
- Reference past memory naturally — don't recite, weave it in.
- Keep replies short in voice mode: 1–2 sentences, then invite the user
- to respond.
+ to respond. Save long explanations for when they ask for depth.
## Your voice
@@ -30301,7 +33344,7 @@ genuinely invested in the user's progress.
**Personality prompt as a separate file.** `instructions.md` is loaded at boot via the `"instructions": "instructions.md"` field in the manifest. Keeping it separate makes it easy to iterate on the prompt without touching the manifest schema.
-**Skills extend tools.** The `wave` skill adds a `wave()` tool the brain can call. The manifest lists it under `skills:` with a URI; the runtime installs it and registers the tool automatically. To add more capabilities, add more entries to `skills:`.
+**Skills extend tools.** The `wave` skill ([`examples/skills/wave/`](https://github.com/nirholas/three.ws/tree/main/examples/skills/wave)) adds a `waveAndGreet` tool the brain can call; its ten-line handler chains the built-in `wave` gesture with a spoken greeting. The manifest lists it under `skills:` with a URI; the runtime installs it and registers the tool automatically. To add more capabilities, add more entries to `skills:`.
**Memory persists between sessions.** `"mode": "local"` stores memories as `.md` files under `memory/`. When Leo calls `remember({ key: "position", value: "striker" })`, it writes to that directory and loads it back on the next boot. Switching to `"mode": "ipfs"` makes memories portable across devices.
@@ -30336,7 +33379,109 @@ genuinely invested in the user's progress.
---
-<a id="sec-121"></a>
+<a id="sec-138"></a>
+
+> **Source:** `docs/fact-check.md` · [↑ table of contents](#table-of-contents)
+
+# Fact Check: sourced verdicts with cryptographic attestations
+
+Fact Check submits a claim and returns a verdict, `supported`, `contradicted`, `mixed`, or `insufficient`, backed by live web search and LLM stance analysis, cited sources, a confidence score, and a SHA-256 attestation over the result you can recompute. It ships with a published, checkable accuracy benchmark instead of an asserted quality number, and a live free-check box on the page. The first 3 checks a day per IP run the exact same real chain for free; after that it is $0.10 USDC per check via x402 on Base or Solana. No account, no API key.
+
+Page: [/fact-check](https://three.ws/fact-check)
+
+API: `POST /api/x402/fact-check` (the check), `GET /api/fact-check-benchmark` (the published accuracy benchmark).
+
+## Why it exists
+
+An agent that makes claims needs a way to check claims, and a fact-checker only earns trust if you can audit both its answers and its overall accuracy. Most tools give you neither: no sources, no confidence, no track record. Fact Check is built to be auditable end to end. Every verdict carries the sources it was built from, the stance it read from each, a confidence score, and a content hash you can reproduce. And the whole service publishes a fixed benchmark, 40 curated claims scored against the real chain, so the accuracy number on the page is a measurement, not a marketing claim. It is a paid x402 service that any agent can discover and pay, with a free daily lane so a human can try it with zero setup.
+
+## How it works
+
+The page (`src/fact-check.js`) hydrates three cards: the accuracy benchmark, a "try one free check" box, and pricing. The check itself is `POST /api/x402/fact-check`, a free-daily-lane endpoint that meters overage onto x402.
+
+The request routing:
+
+- A `POST` with a valid `claim` and free quota remaining runs the real chain and returns `200` with `lane: "free"` and `free_remaining_today`.
+- Once the free quota is exhausted, or if a payment header is present, the request falls through to the x402 rail: a `402` challenge for $0.10 USDC (100,000 atomics), payable on Base or Solana, and a paid run returns `lane: "paid"`.
+- Malformed JSON or a present-but-invalid claim returns a hard `400`; a body with no `claim` at all falls through to a valid 402 so discovery probes get a proper challenge.
+
+The fact-check pipeline (`runFactCheck`):
+
+1. Generate exactly 3 search queries with an LLM.
+2. Search across a source chain (Brave, Tavily, Exa, Serper, then keyless Wikipedia full-text and DuckDuckGo Instant Answer as always-available fallbacks) and take the top 5 unique results.
+3. Run LLM stance extraction on each of the 5: an excerpt plus a stance of `supports`, `contradicts`, or `neutral`.
+4. Weight each source by an authority score, adjusted by strictness (`high` halves low-authority weights, `low` floors them, `medium` is the default).
+5. Compute the verdict: fewer than 2 sources is `insufficient`; a weighted support ratio above 0.65 is `supported`; a weighted contradiction ratio above 0.65 is `contradicted`; otherwise `mixed`. Confidence is the winning ratio.
+6. Build a cost breakdown and the attestation.
+
+The LLM routes through the platform's shared free-first policy (Groq and OpenRouter as funded defaults). Results are cached in Redis for 7 days keyed by a hash of the claim, strictness, and any image URL, so an identical claim (on either lane) never re-runs the live chain.
+
+**The attestation** is a tamper-evident content digest: `sha256:` followed by the SHA-256 of a JSON object of `{ verdict, confidence, claim, source URLs }`. It is returned as a string field you can recompute to confirm the verdict was not altered. Note that this is a content hash, not an on-chain record; it is distinct from the platform's [SAS credentialed attestations](./sas-attestations.md) and [3D provenance anchoring](./provenance.md), which do write to Solana.
+
+**The benchmark** (`GET /api/fact-check-benchmark`) reads two committed files: a 40-claim fixture (10 per verdict class, deliberately time-stable and non-partisan) and a generated report from `scripts/fact-check-benchmark.mjs`, which runs those claims in-process against the real chain. The API never fabricates a score: if the runner has not executed in an environment, `ran` is false and `report` is null, and the page renders a designed "not yet run" empty state. Both the claim set and the scoring runner are linked from the page for inspection.
+
+## Walkthrough
+
+1. Open [/fact-check](https://three.ws/fact-check). The Accuracy benchmark card loads the current published score, per-class breakdown, and last-run time, with links to the 40 benchmark claims and the scoring runner.
+2. In the "Try one free check" box, type a claim (5 to 1000 characters) and click Run free check.
+3. Read the verdict pill with its confidence, the cited sources with their stances, and the SHA-256 attestation string.
+4. After your 3 free checks for the day, the box tells you the paid x402 lane ($0.10 USDC) picks up from there, and to come back tomorrow for more free checks.
+
+## Examples
+
+Free lane (no payment, subject to the 3-per-day-per-IP quota):
+
+```bash
+curl -X POST 'https://three.ws/api/x402/fact-check' \
+ -H 'content-type: application/json' \
+ -d '{"claim":"Solana uses a proof-of-history mechanism to order transactions."}'
+```
+
+A free-lane response looks like:
+
+```json
+{
+ "verdict": "supported",
+ "confidence": 0.86,
+ "claim": "Solana uses a proof-of-history mechanism to order transactions.",
+ "strictness": "medium",
+ "sources": [
+ { "url": "https://...", "title": "...", "excerpt": "...", "stance": "supports", "weight": 0.9 }
+ ],
+ "costBreakdown": { "searchCalls": 2, "llmTokens": 1400, "totalUsdc": "0.100350" },
+ "attestation": "sha256:...",
+ "lane": "free",
+ "free_remaining_today": 2
+}
+```
+
+Read the published benchmark:
+
+```bash
+curl 'https://three.ws/api/fact-check-benchmark'
+```
+
+Once the free quota is spent, the same POST returns `402` with an x402 challenge; pay it with any x402 client (for example `@three-ws/x402-fetch`) and retry. See [x402](./x402.md).
+
+## States and limits
+
+- **Free quota.** 3 checks per day per IP, running the identical real chain (`lane: "free"`). The limiter is critical: a cache or limiter outage fails closed to the paid rail rather than opening unlimited free checks.
+- **Paid lane.** $0.10 USDC (100,000 atomics) per check, on Base or Solana, discoverable in the x402 bazaar. Quota exhaustion or a payment header routes here.
+- **Input validation.** Claim 5 to 1000 characters (else `400`), strictness one of `high`, `medium`, `low` (default `medium`), and an optional image URL that must be http(s) and under 2048 characters.
+- **Errors.** No search results returns `422 no_results`; a search failure `502 search_failed`; a provider failure `502 provider_error`; malformed JSON `400`; an oversized body `413`.
+- **Honest benchmark.** The score shown is whatever the runner last measured against the real chain, or a "not yet run" empty state. Because production currently runs on keyless search fallbacks, decisive verdicts are harder to reach, which the published benchmark reflects rather than hides.
+- **Idempotency.** A 7-day Redis cache is shared across both lanes, so repeated identical claims are cheap and consistent.
+
+## Related
+
+- [x402: paid agent skills](./x402.md): the payment rail the $0.10 lane rides
+- [API reference: Fact Check API](./api-reference.md): the endpoint's full request and response reference
+- [SAS credentialed attestations](./sas-attestations.md) and [3D provenance](./provenance.md): the platform's on-chain attestation primitives (distinct from this content-hash attestation)
+- Pages: [/fact-check](https://three.ws/fact-check) · [/x402](https://three.ws/x402)
+
+---
+
+<a id="sec-139"></a>
> **Source:** `docs/financial-controls.md` · [↑ table of contents](#table-of-contents)
@@ -30615,7 +33760,1087 @@ Ranked by accounting/regulatory risk. Each is a tracked remediation item.
---
-<a id="sec-122"></a>
+<a id="sec-140"></a>
+
+> **Source:** `docs/forge-background-generation.md` · [↑ table of contents](#table-of-contents)
+
+# Background generation and completion notifications
+
+Forge generations are server-tracked to completion. You can start a generation
+on [/forge](https://three.ws/forge), close the tab, and the platform finishes
+the job, saves the model to your gallery, and tells you when it's ready.
+
+## What the user experiences
+
+- **Leave any time.** The generating panel says so explicitly. Navigating away
+ or closing the tab does not lose the job.
+- **Come back, pick up where you left off.** Returning to `/forge` within 30
+ minutes resumes the live progress view for the in-flight job (honest elapsed
+ timer included). The finished model also appears in the on-page gallery on
+ any later visit.
+- **Get notified.** Signed-in creators receive a notification when a
+ generation finishes unattended: the bell inbox and Web Push fire with a link
+ straight to the model, and an email goes out with a preview image. Failures
+ notify too (bell and push only). Every channel has its own switch under the
+ **Creations** category in the notification preference center. Anonymous
+ users aren't left out: their browser resumes the job from local storage and
+ the finished model is waiting in their gallery.
+
+Attended completions never notify. If the result appeared on your screen, the
+platform does not also push, email, or badge you about it.
+
+## How it works
+
+Three cooperating pieces:
+
+1. **Client resume** ([src/forge.js](../src/forge.js)): after a job is
+ submitted, its signed job token persists in `localStorage`
+ (`forge:inflight`). On page load the forge resumes polling that token; all
+ real state lives server-side, so a reload costs nothing. The record clears
+ on completion, terminal failure, or cancel.
+
+2. **Server-side finalizer** ([api/cron/forge-finalize.js](../api/cron/forge-finalize.js),
+ every minute via Cloud Scheduler): sweeps `forge_creations` rows still at
+ `status='generating'` after a 2-minute grace period. Rows whose job id is a
+ GCP worker envelope (the async self-host lanes: TRELLIS, Hunyuan3D,
+ TripoSG sketch) are polled directly on the worker: finished jobs are
+ materialized into durable storage with the exact same writer the browser
+ poll uses (`materializeCreation`), failed jobs are marked failed. Anything
+ non-terminal after 45 minutes is marked failed as timed out, so no row can
+ be orphaned at `generating` again.
+
+3. **Notifications** ([api/_lib/forge-notify.js](../api/_lib/forge-notify.js)):
+ the finalizer, and only the finalizer, notifies. `forge_complete` and
+ `forge_failed` are standard notification types in the `creations`
+ preference category (defaults: in-app on, push on, email on for
+ completions). Email delivery uses the platform Resend pipeline and skips
+ undeliverable placeholder addresses.
+
+## Self-host poll recovery (the "task not found" grace)
+
+A self-host worker poll (`/tasks/:id` or `/jobs/:id`) can 404 when the durable
+task record is not yet visible to the instance the poll load-balanced to — the
+brief post-submit cross-instance window (workers run at high concurrency with no
+session affinity), or a completion write racing the poll. The worker persists
+each task's `queued` state to GCS before returning its 202 and re-reads GCS for
+non-terminal records, so a 404 is almost never a real loss.
+
+The router used to treat that first 404 as terminal, which made
+`task not found on gcp service` the platform's single largest generation-failure
+class (image→3D). Recovery now mirrors the NVCF path (never dead-end on a
+recoverable signal): the GCP provider tags a 404 with `code: 'gcp_task_missing'`
+([api/_providers/gcp.js](../api/_providers/gcp.js)) and the poll handler runs a
+pure decision ([api/_lib/forge-selfhost-recovery.js](../api/_lib/forge-selfhost-recovery.js)):
+
+1. **Store re-check** — if the creation row already materialized (`done` + a
+ glb), a racing poll or the completion write beat us; resolve as complete.
+2. **Grace window** — a job younger than `GCP_TASK_MISSING_GRACE_MS` (90s)
+ reports `running` so the client keeps polling; the durable record resolves
+ within seconds.
+3. **Terminal** — past the window a still-missing task is genuinely orphaned;
+ the failure surfaces and the existing lane failover redispatches to a healthy
+ lane. Nothing here disables failover — it just stops firing it on transient
+ 404s.
+
+## Generation success-rate health
+
+Lane liveness ("can a worker serve right now?") is not the same as outcome
+health ("are generations succeeding?"). A warm lane can still fail half its
+jobs — the 404 burst above ran ~48% failure for days while every liveness probe
+read healthy. The **Forge 3D generation** subsystem
+([api/_lib/ops/forge-health-sensor.js](../api/_lib/ops/forge-health-sensor.js))
+closes that: it reads `forge_creations` outcomes over a 6h window and reports the
+success rate (`done / (done + failed)`; running/queued excluded), naming the
+worst backend/path and top error class so a page is actionable. It rolls into
+`/api/healthz`, `/status`, and the uptime-cron escalation. States: `ok` ≥ 85%,
+`degraded` 60–85%, `down` < 60%, `unknown` below 15 finished generations
+in-window. This is the forge twin of the x402 settlement-success sensor.
+
+## Operational notes
+
+- The finalizer needs `CRON_SECRET` (standard cron auth), `DATABASE_URL`, the
+ R2 `S3_*` storage vars, and `GCP_RECONSTRUCTION_KEY` to poll workers. With
+ no worker key it still reaps timed-out rows.
+- Batch size is 25 per tick (`FORGE_FINALIZE_BATCH` overrides). Ticks are
+ idempotent and safe to overlap.
+- The response body reports `{ swept, done, failed, timed_out, still_running,
+ unpollable }` per tick, so a quick manual hit shows queue health at a
+ glance.
+
+Related: [3d-pipeline.md](3d-pipeline.md) for the generation lanes themselves,
+and the notification preference model in
+[api/_lib/notify-prefs.js](../api/_lib/notify-prefs.js).
+
+---
+
+<a id="sec-141"></a>
+
+> **Source:** `docs/forge-off.md` · [↑ table of contents](#table-of-contents)
+
+# Forge-Off — community voting on the Forge
+
+Forge-Off turns the passive "Fresh from the Forge" strip on [/forge](/forge)
+into a live, competitive board. Every public creation can be upvoted, the strip
+can be re-sorted from newest to most-voted, and the top model each week is
+crowned into a permanent hall of fame that feeds the [Sketchfab
+showcase](/docs/sketchfab).
+
+It is **auth-free**, like the rest of the Forge: one vote per browser, no login.
+A vote is keyed to the same anonymous browser id (`forge:cid`) the Forge already
+uses to scope "Your creations", so a visitor's own upvotes light up across the
+strip without an account.
+
+## For visitors
+
+On the "Fresh from the Forge" section of [/forge](/forge):
+
+- **Upvote** — each card has an upvote pill (chevron + count). Tap it to vote,
+ tap again to remove your vote. The count is the whole community's; the filled
+ state is only yours. The button is optimistic and reconciles against the
+ server tally, so a double-tap or a slow network never leaves it wrong.
+- **Fresh / Top this week** — a toggle in the section header. *Fresh* is the
+ historical newest-first, visual-first strip. *Top this week* is the Forge-Off
+ board: the most-voted public models created during the current Forge-Off week
+ (Monday→Monday UTC), highest first.
+- **The weekly winner** — every Monday the top-voted model of the week just
+ ended is crowned permanently. Later votes never rewrite a past week's winner.
+
+The same strip and voting appear on the signed-in [/forge-studio](/forge-studio)
+surface.
+
+## API
+
+### Cast or remove a vote
+
+```
+POST /api/forge-vote
+Content-Type: application/json
+x-forge-client: <stable browser id>
+
+{ "creation_id": "<uuid>", "vote": true } # upvote
+{ "creation_id": "<uuid>", "vote": false } # remove your vote
+```
+
+Response:
+
+```json
+{ "ok": true, "creation_id": "<uuid>", "vote_count": 5, "voted": true }
+```
+
+- `vote_count` is the fresh authoritative tally (recomputed from the vote table,
+ never a drifting counter).
+- `voted` is *your* state after the call.
+- Voting is idempotent: a second upvote from the same browser is a no-op.
+- A missing or shared (`anon`) client id is rejected `400 no_client_id` — a real
+ vote needs a real, unique voter so the tally means something.
+- Votes are only accepted on public, finished, non-rejected creations. Anything
+ else returns `404 not_votable`.
+- An invalid `creation_id` returns `400 invalid_creation`.
+
+Rate limit: 120 votes / 10 min per IP (the one-vote-per-creation primary key
+already caps real influence; this just blunts carpet-voting).
+
+### Read the board
+
+```
+GET /api/forge-gallery?scope=community&sort=top&window=week&limit=24
+x-forge-client: <stable browser id> # optional — resolves your `voted` flags
+```
+
+- `sort=fresh` (default) — newest, visual-first.
+- `sort=top` — ranked by `vote_count` desc, `created_at` desc.
+- `window=week` — with `sort=top`, narrow to the current Forge-Off week.
+- Each returned creation carries `vote_count` and, when a client id is sent,
+ `voted`. An anonymous read is CDN-cacheable; a voter-aware read is `private`.
+
+## How it fits together
+
+```
+visitor taps upvote
+ │ POST /api/forge-vote (voter = hashed forge:cid)
+ ▼
+forge_votes ──(recompute)──► forge_creations.vote_count
+ │ │
+ │ GET ?sort=top&window=week │ Mon 00:07 UTC
+ ▼ ▼
+"Top this week" board api/cron/forge-off-crown
+ │ writes the week's winner
+ ▼
+ forge_board_winners ──► Sketchfab showcase
+```
+
+The [Sketchfab showcase cron](/docs/sketchfab) reads `forge_board_winners` and
+`vote_count` to decide what to distribute to the official three.ws Sketchfab
+account. Before Forge-Off shipped, nothing wrote votes or crowned winners, so
+that pipeline's strongest tier was starved; voting + the weekly crown feed it.
+
+## Implementation
+
+| Piece | Where |
+|---|---|
+| Vote / board store logic | [api/_lib/forge-store.js](../api/_lib/forge-store.js) — `castVote`, `removeVote`, `listShowcase` (sort/window/voter), `forgeOffWeekStart` |
+| Vote endpoint | [api/forge-vote.js](../api/forge-vote.js) |
+| Board read | [api/forge-gallery.js](../api/forge-gallery.js) (`scope=community`) |
+| Weekly crowning cron | [api/cron/forge-off-crown.js](../api/cron/forge-off-crown.js) (`7 0 * * 1`) |
+| UI (vote button, Fresh/Top toggle) | [src/forge-showcase.js](../src/forge-showcase.js) and its `/forge-studio` twin [src/forge-studio/forge-showcase.js](../src/forge-studio/forge-showcase.js) |
+| Schema | [migration 20260625120000_forge_board.sql](../api/_lib/migrations/20260625120000_forge_board.sql) — `forge_votes`, `forge_creations.vote_count`, `forge_board_winners` |
+
+Backfill a past week's winner (owner): `GET /api/cron/forge-off-crown?week=YYYY-MM-DD`
+(add `&dry_run=1` to preview). Authorized with `CRON_SECRET`.
+
+---
+
+<a id="sec-142"></a>
+
+> **Source:** `docs/forge-pipeline.md` · [↑ table of contents](#table-of-contents)
+
+# The Forge pipeline: architecture deep dive
+
+This is the engineering guide to the Forge, the text/image/sketch to 3D generation system behind [/forge](https://three.ws/forge), the free MCP tools, and every agent-facing 3D endpoint. It maps the whole path a generation takes: entry points, the engine grid, free-first routing, the job lifecycle, failover, persistence, GPU workers, post-processing, and payments.
+
+If you want the product-level overview, read [Forge](./forge.md). If you want the plain-language version, read [How the Forge works](./how-forge-works.md). This document is for people changing the pipeline.
+
+## Bird's-eye view
+
+```
+ /forge page MCP tools x402 buyers SDK / agents
+ home mini-forge (paid stdio + /api/x402/forge /api/3d/generate
+ /forge-studio free hosted) /api/v1/ai/text-to-3d
+ │ │ │ │
+ └────────────────────┴──────────┬─────────┴──────────────────┘
+ ▼
+ POST /api/forge (api/forge.js, the orchestrator)
+ │
+ resolve (path, tier, backend) via api/_lib/forge-tiers.js
+ health-aware free-first routing + circuit breakers
+ │
+ ┌─────────────┬───────────┼───────────────┬──────────────┐
+ ▼ ▼ ▼ ▼ ▼
+ NVIDIA NIM HF Spaces self-host GPU BYOK vendors Replicate
+ (TRELLIS, (Hunyuan3D workers on (Meshy, Tripo, (paid last
+ text only) chain) Cloud Run Rodin, ...) resort)
+ │ │ │ │ │
+ └─────────────┴───────────┼───────────────┴──────────────┘
+ ▼
+ job handle (HMAC token) ── poll GET /api/forge?job=<id>
+ poll-time failover (forge-failover.js) if a lane dies mid-job
+ │
+ ▼
+ forge_creations row (Neon Postgres) + GLB mirrored to R2 CDN
+ │
+ ▼
+ viewer / AR / rig / refine / restyle / remesh / gallery / remix
+```
+
+Three properties define the design:
+
+1. **One orchestrator, many front doors.** Every entry point is a thin client over `POST /api/forge` and `GET /api/forge?job=<id>`. No generation logic is duplicated.
+2. **Free-first routing over a declared engine grid.** Engines are data, not code paths: each is a registry entry declaring what it can do, what it costs, and what env it needs. Routing walks that registry.
+3. **Failure is a routing event, not an error.** A rejected submit walks to the next lane at submit time; a lane that accepts and then dies is silently re-dispatched at poll time. The client sees the same job id throughout.
+
+## 1. Entry points
+
+| Surface | Route / tool | Notes |
+| --- | --- | --- |
+| Forge page | [/forge](https://three.ws/forge), `src/forge.js` | Text, photos (up to 4 views), sketch. One shared polling loop. |
+| Homepage mini-forge | `src/home-forge.js` | Health-aware default lane, never pins a backend. |
+| Forge Studio | [/forge-studio](https://three.ws/forge-studio), `src/forge-studio/` | Create, refine, stylize, Game-Ready export, remix. |
+| Core API | `POST /api/forge` (`api/forge.js`) | The orchestrator. Auth-free. Text, image, and sketch bodies. |
+| Job poll | `GET /api/forge?job=<id>` | Free to poll regardless of how the job was paid for. |
+| Catalog | `GET /api/forge?catalog=1` | The tier/backend/cost matrix the UI renders. |
+| Health | `GET /api/forge?health=1` | Live per-lane upstream status. |
+| Rig | `POST /api/forge?action=rig` | Auto-rig a finished GLB (see post-processing). |
+| Paid x402 twin | `POST /api/x402/forge` (`api/x402/forge.js`) | Pay-per-call USDC on Solana, no account. Prices come from the tier table. |
+| Agent REST | `POST /api/3d/generate` (`api/3d/generate.js`) | Keyless agent shape wrapping the free draft lane. |
+| Flagship free API | `POST /api/v1/ai/text-to-3d` (`api/v1/ai/text-to-3d.js`) | NVIDIA NIM TRELLIS draft lane, 10 generations per IP per day, 429 + x402 upsell above quota. |
+| Refinement | `POST /api/forge-iterate` (`api/forge-iterate.js`) | Conversational refinement with version lineage for the signed-in Studio. |
+| MCP (paid stdio) | `mesh_forge`, `forge_avatar`, `forge_free`, `text_to_avatar`, `rig_mesh`, `refine_model`, `restyle_material` (`mcp-server/src/tools/`) | Shared cores in `mcp-server/src/tools/_studio-core.js`; thin clients over `/api/forge`. |
+| MCP (hosted HTTP) | `text_to_3d`, `image_to_3d`, `auto_rig_model` (`api/mcp-3d.js`, tools in `api/_mcp3d/tools/studio.js`) | Streamable HTTP server registered as `io.github.nirholas/three-ws-3d-studio`. |
+| DCC plugins | `integrations/blender/`, `integrations/comfyui/`, `integrations/_pyclient/` | First-party clients driving the same API. |
+
+The rule when adding a surface: never talk to a provider directly. Submit through `/api/forge` (or the shared MCP cores) so routing, failover, persistence, and payments stay in one place.
+
+## 2. The request axes: path and tier
+
+Every request resolves to a `(path, tier, backend)` triple. `api/_lib/forge-tiers.js` is the single source of truth for all three; the endpoint, the catalog, the x402 pricing, and every provider param builder read from it.
+
+**`path`** is how geometry is produced:
+
+- `image`: image-intermediate, the default. Text is painted into a reference view (FLUX/Imagen) and reconstructed to a mesh, or the user's own photos are reconstructed directly.
+- `geometry`: geometry-first. A native 3D model (Meshy, Tripo, Rodin) emits mesh directly from the prompt, so detail is not capped by what one synthesized image implies.
+- `sketch`: sketch-conditioned. A drawing plus a prompt naming what it depicts drives TripoSG-scribble straight to geometry.
+
+**`tier`** is how much budget to spend (`TIERS` in forge-tiers.js):
+
+| Tier | Poly target | Textures | ETA multiplier | Price (USDC atomics) |
+| --- | --- | --- | --- | --- |
+| `draft` | 12,000 | none | 0.6 | 50,000 ($0.05) |
+| `standard` | 30,000 | 2K | 1.0 | 150,000 ($0.15) |
+| `high` | 200,000 | PBR + HD | 2.2 | 500,000 ($0.50) |
+
+Prices live only here, as `priceUsdcAtomics`. `priceAtomicsForTier()` feeds the x402 402 challenge; `priceUsdcForTier()` feeds the catalog and docs. Never hardcode a second copy.
+
+Self-hosted TRELLIS additionally maps tiers to sampler and texture budgets via `SELFHOST_TRELLIS_QUALITY` (draft: 12/12 steps, 1024px textures; standard: 35/35, 2048px; high: 50/50, 4096px). Texture sizes must be powers of two: nvdiffrast hard-fails on mip generation otherwise (live incident, 2026-07-16).
+
+## 3. The engine grid
+
+`BACKENDS` in `api/_lib/forge-tiers.js` declares every lane. Each entry names the `provider` client (`api/_providers/*.js`), which `paths` it serves, whether it is `free`, whether it needs a BYOK key, the env vars that must be present (`requiresEnv`), and its latency estimate (`baseEta`, plus `coldStart` for scale-to-zero workers).
+
+| id | Engine | Hosting | Paths | Cost model | Env |
+| --- | --- | --- | --- | --- | --- |
+| `nvidia` | Microsoft TRELLIS | NVIDIA NIM (hosted) | image (text only, rejects user photos) | free | `NVIDIA_API_KEY` |
+| `huggingface` | Hunyuan3D 2.1 → Hunyuan3D 2 → TRELLIS → TripoSR (internal chain) | HF Spaces | image | free, blocking submit | `HF_TOKEN` |
+| `trellis_selfhost` | Microsoft TRELLIS | Our Cloud Run L4 worker (`workers/model-trellis/`) | image (native single-hop image to 3D) | free (our GPU) | `MODEL_TRELLIS_URL` + `GCP_RECONSTRUCTION_KEY` |
+| `hunyuan3d` | Tencent Hunyuan3D-2.1 | Our Cloud Run L4 worker (`workers/model-hunyuan3d/`) | image | free (our GPU) | `GCP_HUNYUAN3D_URL` + key |
+| `triposg` | VAST AI TripoSG-scribble | Our Cloud Run L4 worker (`workers/model-triposg/`) | sketch only | free (our GPU) | `GCP_TRIPOSG_URL` + key |
+| `trellis` | Microsoft TRELLIS | Replicate | image | paid platform, last resort | `REPLICATE_API_TOKEN` |
+| `meshy` | Meshy 6 | vendor API | geometry, image | BYOK, credits | user key |
+| `tripo` | Tripo v3.1 | vendor API | geometry, image | BYOK | user key |
+| `rodin` | Rodin (Hyper3D) | vendor API | geometry, image | BYOK | user key |
+| `stability` | Stable Fast 3D | vendor API | image, synchronous | BYOK | user key |
+| `replicate_byok` | Replicate models | caller's Replicate account | image | BYOK | user key |
+
+Two lanes deserve a warning. `hunyuan3d` must point at the general Hunyuan3D worker URL, never at the avatar-pipeline controller: the controller fronts a face pipeline and rejects general object images. And `nvidia` is text-only; every routing list that might carry a user photo filters it out.
+
+## 4. Routing: free-first, subject-aware, health-tempered
+
+Routing answers one question: given `(path, tier, userImages, prompt)`, which configured lane runs first, and who is next when it fails.
+
+**Static preference order.** `freeLaneCandidates()` builds the ordered list both resolvers walk:
+
+1. The tier's named free default (`FREE_DEFAULT_FOR_TIERS`): draft/standard image requests name `nvidia`; high names `hunyuan3d` (self-host).
+2. The per-path free fallback chain (`FREE_FALLBACK_FOR_PATH`). For `image` that is `trellis_selfhost`, `hunyuan3d`, `huggingface`, `nvidia`: our own GPU workers first (zero vendor cost), then external free lanes, with the text-only NIM lane trailing as a safety net.
+3. The paid platform default (`DEFAULT_BACKEND_FOR_PATH`: image → `trellis` on Replicate, geometry → `meshy`, sketch → `triposg`) only when nothing free is configured and healthy.
+
+**Subject-aware reorder (high tier).** `classifyForgeSubject()` regex-classifies the prompt as hard-surface or organic. Hard-surface prompts (vehicles, machines, architecture) hoist `trellis_selfhost` above `hunyuan3d`; organic subjects (people, creatures) keep Hunyuan3D first. This exists because the two engines genuinely differ on those subject classes at high fidelity.
+
+**Operator levers.** `FORGE_PREFER_FREE` (default on) prefers free reconstruction before paid Replicate. `FORGE_SELFHOST_PRIMARY` (default off) hoists self-host GPU lanes above hosted free lanes across the board.
+
+**Health tempering.** `resolveBackendIdWithHealth()` walks the candidate list against the snapshot from `api/_lib/forge-lane-health.js`: lanes reporting `ok` or `unknown` are preferred, lanes confirmed `down` are skipped, and paid lanes are considered only when every free lane is down. The UI consumes the same data via `GET /api/forge?health=1` and disables down lanes with the real upstream reason before the user clicks Generate.
+
+**Circuit breakers.** A failing lane is sidelined, not retried in a loop: per-lane cooldowns (`forge-lane:<id>`, 90s) plus dedicated NIM cooldowns (120s model, 30s gateway) short-circuit routing away from a degraded upstream. Cooldowns are shared cross-instance via `api/_lib/provider-health.js` and expire on their own, so a recovered lane is retried promptly. Every entry is env-gated, so partial deployments degrade to a shorter list instead of erroring.
+
+## 5. Job lifecycle
+
+### Submit
+
+`POST /api/forge` validates input, resolves the triple, runs the payment gate if the tier requires one (section 9), inserts a `forge_creations` row (`status: generating`), and submits to the resolved lane. Synchronous lanes (NVIDIA NIM, HF Spaces, BYOK-sync like Stability) complete inside the request and return `status: done` with the GLB URL directly. Async lanes return `status: queued` plus a `job_id`.
+
+**Submit-time failover.** If a lane rejects the submit outright (down, quota, cooldown), `startJob` walks the free-first chain to the next candidate in the same request. The client never sees the rejected lane.
+
+### The job handle
+
+Async jobs get an opaque HMAC-signed token (`f1.<payload>.<sig>`, `api/_lib/forge-job-token.js`) that records provider, kind, and upstream task id, signed with `JWT_SECRET`. The legacy Replicate path keeps the bare prediction id. Tokens make the poll endpoint stateless: any instance can decode the handle and ask the right upstream.
+
+### Poll
+
+`GET /api/forge?job=<id>` returns `status`: `queued`, `running`, `done` (with `glb_url`, `viewer_url`, and the `path`/`tier`/`backend` that actually produced it), or `failed`. Polling is free and unauthenticated. The in-flight job id is also written to `localStorage`, so an interrupted browser session resumes polling for up to 30 minutes; background completion persists the result to the user's gallery either way (see [Background generation](./forge-background-generation.md)).
+
+**Poll-time failover** (`api/_lib/forge-failover.js`) closes the nastier gap: a self-host worker can accept a task and fail it minutes later, in a poll handled by a different instance that no longer holds the request. On a failed poll the module recovers the original inputs (prompt plus reference image) from the creation row, resubmits to the next configured lane, and binds old handle to new handle in Redis (2 hour TTL). The client keeps polling the same job id and simply sees `status: running` with a new `backend`. Hops are capped by `MAX_FAILOVER_HOPS = 3` (one primary plus up to three backups). The redispatch order is `trellis_selfhost`, `hunyuan3d`, `trellis`: HuggingFace is excluded because its provider blocks through the whole generation (cannot be ridden from a poll), and NVIDIA is excluded because poll-time redispatch always reconstructs from a stored reference image, which NIM rejects.
+
+**Designed terminal failure.** When no successor is possible, the failed response carries `retryable: true` plus `retry_backends: [...]`, the ordered configured lanes a client can one-click resubmit to. A failure is never a bare string. The whole module is fail-open: no Redis disables automatic redispatch but keeps suggestions; no DB disables recovery but never turns a clean failure into a hang.
+
+### Quality, caching, and scale
+
+- **Quality gate + best-of retry.** `scoreQualityGate` flags degenerate results (near-empty geometry, texture failures); synchronous lanes retry once inline before returning.
+- **Result cache** (`api/_lib/forge-cache.js`). Identical text prompts on platform-keyed non-high lanes are served from cache with `cached: true`.
+- **Scale controls** (`api/_lib/forge-scale.js`). In-flight coalescing, blocking-lane slots, and daily paid caps keep a traffic spike from stampeding the GPU fleet or the paid last resort.
+
+## 6. Persistence and storage
+
+**`forge_creations`** (Neon Postgres, migration `api/_lib/migrations/20260604000000_forge_creations.sql`) is the ground truth for every generation. Key columns:
+
+- Identity and attribution: `id` (uuid), `client_key` (sha256 of the anonymous browser id), `ip_hash`, `user_id`.
+- Inputs: `prompt`, `aspect`, `preview_image_url` (the reference view), `text_to_image_model`, `views_requested`/`views_used`/`multiview`.
+- Routing outcome: `backend`, `tier`, `path`, `replicate_job_id` (poll correlation for any provider, despite the name), `model_category` (avatar, accessory, item, scene, creature, vehicle, other).
+- Result: `glb_key`, `glb_url`, `size_bytes`, `status` (`generating`, `done`, `failed`), `error`.
+- Feedback flywheel: `outcome` (`generated`, `accepted`, `rejected`), `rating`, `note`, `downloaded`, `feedback_at`. The outcome partial index feeds training-signal export.
+- Lineage and remix (migration `20260625000000_forge_refine_lineage.sql`): `parent_creation_id`, `refine_instruction`, `lineage_index`, `remixable`, `remix_royalty_bps` (0 to 2000, default 1000), `creator_wallet_solana`, `remix_settlement_ref`.
+- Forge-Off (migration `20260625120000_forge_board.sql`): `vote_count`, plus the `forge_votes` and `forge_board_winners` tables.
+
+`api/_lib/forge-store.js` owns all writes: `createCreation` on submit (also records the funnel `start` event), `materializeCreation` on completion, `markFailed`, and verdict capture. It is fail-soft: without a DB or storage config it no-ops rather than blocking generation.
+
+**Storage is two-layer.** GPU workers write raw output to GCS (`gs://$GCS_BUCKET/raw-meshes/...`), and provider URLs generally expire within about an hour. `materializeCreation` therefore mirrors the mesh and reference image into Cloudflare R2 (`api/_lib/r2.js`) and stores the durable CDN URL in `glb_url`. Anything user-facing must reference the R2 URL, never the raw provider URL.
+
+## 7. GPU workers
+
+Workers are Python FastAPI services on Cloud Run (scale-to-zero L4 GPUs unless noted), documented worker-by-worker in `workers/README.md`. All share one contract: `POST /infer` returns `{task_id}`, `GET /tasks/:id` returns progress and finally a `result_gcs_url`, authenticated by the shared bearer `GCP_RECONSTRUCTION_KEY`. `api/_providers/gcp.js` maps modes to worker URLs.
+
+| Worker | Role |
+| --- | --- |
+| `workers/model-trellis/` | Self-hosted TRELLIS, the `trellis_selfhost` lane. Quality-tiered up to 4096px textures. |
+| `workers/model-hunyuan3d/` | Hunyuan3D-2.1 single image to textured mesh, the `hunyuan3d` lane. |
+| `workers/model-triposg/` | TripoSG 1.5B. `mode: image` for the avatar pool, `mode: scribble` for the sketch path. |
+| `workers/model-triposr/` | TripoSR fast path and fallback (5 to 15s). |
+| `workers/rig/` | Make-It-Animatable rigging: 52-bone Mixamo skeleton, skin weights, ARKit-52 blendshapes, sub-second GPU predict, grafted into the original GLB bytes. Replaced the retired `workers/unirig/` (2026-07-17); cutover was the `GCP_UNIRIG_URL` env change. |
+| `workers/avatar-pipeline-controller/` | CPU orchestrator for the avatar flow: `POST /reconstruct` picks a mesh backend by weighted random, then auto-rigs. |
+| `workers/remesh/`, `workers/texture/`, `workers/segment/`, `workers/stylize/`, `workers/rembg/` | Post-processing: retopology and Game-Ready, SDXL retexture, part splitting, geometric stylize, background removal. |
+
+Model weights are staged from `gs://three-ws-model-weights` via `workers/deploy/stage-weights.sh`. Each worker has its own `cloudbuild.yaml`; every config pins the `three-ws-build@` service account.
+
+## 8. Post-processing
+
+- **Rigging.** `POST /api/forge?action=rig` prefers the self-host rig worker and falls back to Replicate; unconfigured deployments return a clean 501. Auto-rig-on-create (`api/_lib/auto-rig.js`) mints a sibling creation row rather than mutating the original (provenance and attestation depend on the original bytes staying put), gated by the humanoid prompt classifier (`mcp-server/src/tools/_humanoid.js`) and `rigInfoIsRigged()` (already-skinned GLBs are skipped).
+- **Skeleton canonicalization.** `src/glb-canonicalize.js` maps any humanoid rig's bone names (Mixamo, Avaturn, Unreal, VRM/VRoid, Daz, MakeHuman, Blender `.L`, and more) onto the canonical bone set, repacking the GLB in place. There is no rig allowlist; a new convention means a new bone-name mapping plus a test case in `tests/glb-canonicalize.test.js`.
+- **Animation retargeting.** `src/animation-retarget.js` applies the pre-baked canonical clip library (`public/animations/clips/*.json`) to arbitrary rigs: rewrites track names, drops missing bones, rescales hip translation, and requires 50% bone coverage. Pure JS, shared between the browser and the Node MCP tool.
+- **Refinement lineage.** `api/forge-iterate.js` and the MCP `refine_model` tool share one core (`mcp-server/src/tools/_lineage.js`) for composing refinements and maintaining the revertable, branchable version tree over `parent_creation_id` and `lineage_index`.
+- **Restyle.** `api/material-studio.js` re-skins a GLB without regenerating the mesh: an LLM proposes PBR factors from an instruction, applied server-side. The paid MCP `restyle_material` is a thin client over it.
+- **Mesh operations.** `forge-remesh`, `forge-gameready` (QuadriFlow retopology to a poly budget, GLB plus FBX, $0.10), `forge-stylize`, `forge-segment`, `forge-rembg`. Each is also sold as a standalone x402 stage; see [3D pipeline](./3d-pipeline.md).
+
+## 9. Payments and gating
+
+The pipeline separates what a generation costs us from what it costs the user. Draft and standard route to free lanes; we charge for quality, not to recover vendor bills.
+
+- **Direct x402** (`api/x402/forge.js`): per-tier USDC prices from the tier table, exact-settle on Solana mainnet. The order is verify, submit, settle: a failed submit never charges. The returned job token polls free on the standard endpoint.
+- **High-tier gate** (`api/_lib/forge-high-payment.js`): the high tier is $THREE hold-or-pay gated regardless of which free engine serves it. Non-holders pay per generation through the token rail in three phases: `assertForgePayment` validates at the gate, `redeemForgePayment` atomically claims single-use (primary-key race-safe), `releaseForgePayment` undoes the claim if dispatch fails. Settled consumption lands in `token_payments` with `ref_type: 'forge'`.
+- **MCP pricing** (`mcp-server/src/payments.js`): the `paid()` wrapper prices each tool (`mesh_forge` $0.25, `rig_mesh` $0.20, `forge_avatar` $0.45, `refine_model` $0.25, `text_to_avatar` $0.15, `restyle_material` $0.05); `forge_free` needs no payment. The hosted MCP server sums per-tool prices for batched x402 challenges.
+- **Quota upsell**: the free flagship API allows 10 generations per IP per day, then returns 429 with the x402 endpoint as the paid path.
+- **BYOK lanes** bill the caller's own vendor key and are never charged to a platform account.
+
+## 10. Operator reference
+
+The env vars that shape a deployment (production values live on the Cloud Run service, not in any Vercel export):
+
+| Var | Effect |
+| --- | --- |
+| `NVIDIA_API_KEY` | Enables the free NIM TRELLIS text lane. |
+| `HF_TOKEN` | Enables the HF Spaces lane. |
+| `MODEL_TRELLIS_URL`, `GCP_HUNYUAN3D_URL`, `GCP_TRIPOSG_URL`, `GCP_UNIRIG_URL`, `GCP_RECONSTRUCTION_URL` | Self-host worker URLs (TRELLIS, Hunyuan3D, sketch, rig, avatar controller). |
+| `GCP_RECONSTRUCTION_KEY` | Shared bearer for all self-host workers. |
+| `REPLICATE_API_TOKEN` | Enables the paid Replicate last resort. |
+| `FORGE_PREFER_FREE` | Default on; prefer free reconstruction before paid Replicate. |
+| `FORGE_SELFHOST_PRIMARY` | Default off; hoist self-host lanes above hosted free lanes. |
+| `JWT_SECRET` | Signs job handle tokens. |
+| `DATABASE_URL`, R2 `S3_*` config | Persistence and durable storage; both fail soft. |
+
+Fast diagnostics: `forge_creations` carries per-generation backend, status, error, and prompt, so it is the quickest ground truth for generation issues. `GET /api/forge?health=1` shows the live lane picture.
+
+## 11. Extending the pipeline
+
+**Adding a generation lane:**
+
+1. Add a provider client in `api/_providers/<name>.js` (submit and poll, normalized errors).
+2. Register the backend in `BACKENDS` (`api/_lib/forge-tiers.js`): paths, `free` or `byok`, `requiresEnv`, ETA, credits.
+3. Place it in the routing lists it belongs in: `FREE_FALLBACK_FOR_PATH` and, if it should be a default, `FREE_DEFAULT_FOR_TIERS` or `DEFAULT_BACKEND_FOR_PATH`.
+4. If it is async and can be re-dispatched from a poll, add it to `ASYNC_REDISPATCH_ORDER` and the suggestion orders in `api/_lib/forge-failover.js`.
+5. Nothing else: the catalog, the UI engine picker, health checks, and x402 pricing all derive from the registry.
+
+**Adding a rig convention:** add the bone-name mapping to `src/glb-canonicalize.js` and a case to `tests/glb-canonicalize.test.js`. Never introduce a curated rig allowlist.
+
+**The invariants to preserve:**
+
+- Free-first: a paid lane must never run while a healthy free lane can serve the request.
+- One source of truth: prices, poly targets, and lane capabilities live only in `forge-tiers.js`.
+- Fail-open persistence: the DB and storage layers may degrade, generation must not.
+- Same job id across failover: the client never re-submits because a lane died.
+- Durable URLs: user-facing results reference R2, never expiring provider URLs.
+
+## Related
+
+- [Forge](./forge.md), the product-level doc for the /forge surface.
+- [How the Forge works](./how-forge-works.md), the plain-language explainer.
+- [3D pipeline](./3d-pipeline.md), the pay-per-stage x402 pipeline (rig, remesh, gameready, stylize, rembg).
+- [3D asset pipeline](./3d-asset-pipeline.md), formats and the animation/conversion flow.
+- [Avatar pipeline](./avatar-pipeline.md), the selfie-to-avatar reconstruction flow.
+- [Background generation](./forge-background-generation.md), job resume and gallery persistence.
+- `workers/README.md`, the worker-by-worker operational reference.
+
+---
+
+<a id="sec-143"></a>
+
+> **Source:** `docs/forge.md` · [↑ table of contents](#table-of-contents)
+
+# Forge: text and image to 3D, on a free-first engine grid
+
+Forge is three.ws's text-and-image-to-3D generator. Type a prompt, drop in one to four photos of an object, or sketch a shape and name it, and Forge returns a downloadable, textured GLB you can orbit, view in AR, and take anywhere. It runs on a grid of real generation engines with live health status, and it is free-first by design: text prompts default to a zero-cost NVIDIA lane, photos default to a zero-cost reconstruction lane, and the paid engines stay explicitly selectable for when you want a specific vendor.
+
+Page: [/forge](https://three.ws/forge) and the feature landing [/features/forge](https://three.ws/features/forge) · API: `/api/forge`
+
+## Why it exists
+
+Every other text-to-3D tool makes you choose a vendor, buy credits, and hope the one model they wired up is the right one for your prompt. Forge inverts that. It treats generation as a routing problem over many engines, picks the best free lane for the input you gave it, degrades gracefully when an upstream is down, and only ever charges for higher quality, never to recover a vendor bill. The result is a single surface where a first-time visitor can make a real 3D model in seconds with no account, no key, and no cost, while a power user can pin a specific engine, bring their own key, or push a High-tier generation through multi-view fusion.
+
+Forge is the public, auth-free twin of the 3D Studio MCP server (`api/mcp-3d.js`), so anything the page can do, an agent can do over MCP or a plain HTTP call.
+
+## How it works
+
+A generation request is described by two orthogonal axes, resolved in `api/_lib/forge-tiers.js`, the single source of truth shared by the endpoint, the catalog the UI renders, and every provider param builder.
+
+**The path** is how geometry is produced:
+
+- `image` (image-intermediate, the fast default): text is painted into a reference view (FLUX/Imagen) and reconstructed to a mesh, or your own photo is reconstructed directly.
+- `geometry` (geometry-first): a native 3D model emits mesh directly from the prompt or a single photo, so detail isn't capped by what one image implies. This is the Meshy and Tripo text-to-3D path.
+- `sketch` (sketch-conditioned): a drawing plus a prompt naming what it depicts drives TripoSG-scribble straight to geometry, no photo and no intermediate view.
+
+**The tier** is how much geometric budget to spend:
+
+| Tier | Poly target | Textures | Price (direct USDC) | Notes |
+| --- | --- | --- | --- | --- |
+| Draft | 12,000 | none | $0.05 | Fast, low-poly. Blockout and iteration. |
+| Standard | 30,000 | 2K | $0.15 | Balanced, multi-angle reference fusion. The default. |
+| High | 200,000 | PBR + HD | $0.50 | Maximum detail, deepest sampler budget, multi-view fusion. |
+
+### The engine grid
+
+Each backend declares which paths it serves, whether it needs a bring-your-own-key (BYOK) credential, and its per-(path, tier) cost and latency estimates so the UI can show the trade-off before you commit. The live registry (`BACKENDS` in `api/_lib/forge-tiers.js`):
+
+- **TRELLIS (free)** on NVIDIA NIM (Microsoft TRELLIS). The default lane for text prompts at Draft and Standard. Zero vendor cost. Text-only: it rejects user photos, so photo submissions route elsewhere.
+- **Hunyuan3D / TRELLIS (free)** on Hugging Face Spaces. The free photo-to-3D lane and a High-tier engine, with automatic failover across Hunyuan3D 2.1, Hunyuan3D 2, TRELLIS, and TripoSR. Queue waits vary.
+- **TRELLIS (self-host)** and **Hunyuan3D (self-host)**, our own scale-to-zero Cloud Run GPU workers. Zero vendor cost, so free-first routing prefers them first. Self-host TRELLIS is a native single-hop image-to-3D lane; Hunyuan3D leads on people and organic subjects.
+- **TripoSG (self-host)**, the sketch-only scribble worker. Untextured geometry from a drawing.
+- **TRELLIS** on Replicate, a paid platform lane. Selectable explicitly and used as the last-resort fallback only on deployments with no free engine configured.
+- **Meshy 6**, **Tripo v3.1**, **Rodin (Hyper3D)**, BYOK geometry-first engines with quad topology and a real poly target. You supply your own key.
+- **Stable Fast 3D** (Stability, BYOK) and **Replicate (your account)** (BYOK), single-image reconstruction lanes.
+
+### Free-first routing with live health
+
+Routing (`resolveBackendIdWithHealth`) walks an ordered list of every free lane that could serve the request on this deployment, most preferred first: the tier's named free engine, then the per-path fallback chain (our own GPU workers, then the free external Spaces, then the free NVIDIA lane as the final health-gated safety net). Draft and Standard text prompts name NVIDIA TRELLIS; High names our self-host Hunyuan3D worker. A subject classifier reorders the two self-host PBR lanes for hard-surface versus organic prompts. Every entry is env-gated, so the list degrades cleanly on partial deployments.
+
+Health is real. The UI fetches `/api/forge?health=1` after load and disables any lane whose upstream is down, with the actual reason, instead of failing after you have typed a prompt and clicked Generate. A short circuit-breaker cooldown sidelines a degraded lane (for example the free NIM lane after a gateway timeout) so subsequent requests skip it and go straight to a working engine; the cooldown expires on its own so a recovered lane is retried promptly. There are no mock paths: if a selected backend isn't configured the endpoint returns a clean `backend_unconfigured` error, never a fake result.
+
+### Background generation and resume
+
+Generation is a job. `POST /api/forge` returns a `job_id`; the client polls `GET /api/forge?job=<id>` until the status is `done` or `failed`. The lanes that complete inline within one request (free NVIDIA NIM, HuggingFace Spaces, BYOK-sync) can instead answer the POST directly with `status:'done'`, the `glb_url`, and a null `job_id`, and they retry once automatically on a failed result. Because the in-flight job id is written to `localStorage`, closing the tab or navigating away does not lose the generation: returning to Forge within a 30-minute window resumes polling the same job. Finished models for your browser are surfaced from a gallery on load, and a share link always wins over a resume.
+
+## Walkthrough
+
+1. Open [/forge](https://three.ws/forge). No login, no wallet, no key required.
+2. Pick an input mode: **Describe it** (text), **From photos**, or **From a sketch** (the sketch tab appears only when the TripoSG worker is configured).
+3. For text, type a prompt like `a weathered brass diving helmet`. For photos, add one to four images of the same object from different angles; each uploads straight to object storage via a presigned URL and the public URLs are fused with multi-view conditioning.
+4. Optionally open the quality controls and pick a tier (Draft, Standard, High) and an engine. The default engine carries a **FREE** pill. Down lanes are disabled with the reason shown.
+5. Click Generate. A real elapsed-driven progress line runs against the catalog's ETA estimate for the chosen path, tier, and engine.
+6. When the model lands, orbit it in the viewer, view it in AR, download the GLB, or run the post-generation tools (stylize, optimize, Game-Ready retopology, split).
+
+## Examples
+
+Forge's read and generate surface is plain HTTP. No key is required for the free lanes.
+
+```bash
+# Read the tier/backend/cost matrix the UI renders.
+curl 'https://three.ws/api/forge?catalog=1'
+
+# Probe live backend health (which lanes are up right now).
+curl 'https://three.ws/api/forge?health=1'
+
+# Start a free text-to-3D generation. The free NVIDIA lane often completes
+# inline, answering with status "done", a glb_url, and a null job_id; slower
+# lanes answer with a job_id to poll instead.
+RESP=$(curl -s -X POST 'https://three.ws/api/forge' \
+ -H 'content-type: application/json' \
+ -d '{"prompt":"a weathered brass diving helmet","tier":"draft"}')
+echo "$RESP" | python3 -c 'import sys,json;j=json.load(sys.stdin);print(j.get("glb_url") or j["job_id"])'
+
+# If you got a job_id, poll it until the status is "done" or "failed".
+curl "https://three.ws/api/forge?job=<JOB_ID>"
+```
+
+Image-to-3D over the API sends public image URLs instead of a prompt:
+
+```bash
+curl -X POST 'https://three.ws/api/forge' \
+ -H 'content-type: application/json' \
+ -d '{"image_urls":["https://…/front.jpg","https://…/side.jpg"],"tier":"standard"}'
+```
+
+A minimal poll-until-done loop in JavaScript:
+
+```javascript
+const start = await fetch('https://three.ws/api/forge', {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({ prompt: 'a low-poly campfire', tier: 'draft' }),
+}).then((r) => r.json());
+
+let job = start;
+while (job.status !== 'done' && job.status !== 'failed') {
+ await new Promise((r) => setTimeout(r, 4000));
+ job = await fetch(`https://three.ws/api/forge?job=${start.job_id}`).then((r) => r.json());
+}
+console.log(job.glb_url); // downloadable, textured GLB
+```
+
+## States and limits
+
+- **Loading**: a real elapsed counter driven by the catalog ETA for the resolved path, tier, and engine. Cold self-host GPU workers add an honest spin-up estimate rather than a stalled bar.
+- **Down lane**: disabled engine button with the real upstream reason; routing skips it via the circuit-breaker cooldown.
+- **Unconfigured backend**: a clean `backend_unconfigured` error, never a mock.
+- **Resume**: an interrupted job is pollable again for 30 minutes from the same browser.
+- **Every result** reports the path, tier, and backend that produced it, so you always know which engine ran.
+- **The High tier is $THREE hold-or-pay gated** in the handler regardless of which free engine serves it: we charge for quality, not to recover vendor cost. A verified $THREE tier pass also lifts the free-lane quota.
+- **BYOK engines** (Meshy, Tripo, Rodin, Stability, Replicate) require your own key; they are never billed to a platform account.
+- **Photo input** accepts up to four views of one object; text-only engines are filtered out of the photo modes automatically.
+- Rate limits are per client IP on the shared 3D generation buckets.
+
+## Related
+
+- [The Forge pipeline](./forge-pipeline.md) is the architecture deep dive: the engine grid, routing, failover, job lifecycle, workers, and payments, end to end. [How the Forge works](./how-forge-works.md) is the same story in plain language.
+- [Image to 3D](./image-to-3d.md) is the photo lane opened directly at [/image-to-3d](https://three.ws/image-to-3d).
+- [Diorama](./diorama.md) forges a whole scene of Forge objects into one explorable world.
+- The 3D generation architecture: [3D pipeline](./3d-pipeline.md), [3D asset pipeline](./3d-asset-pipeline.md), [3D API](./3d-api.md).
+- Pages: [/create](https://three.ws/create) (the avatar creator), [/scene](https://three.ws/scene) (Scene Studio), [/restyle](https://three.ws/restyle) (re-skin a GLB), [/gallery](https://three.ws/gallery).
+
+---
+
+<a id="sec-144"></a>
+
+> **Source:** `docs/galaxy.md` · [↑ table of contents](#table-of-contents)
+
+# Agent Galaxy: every agent, mapped by meaning
+
+Agent Galaxy is an explorable 3D star-map of every published agent on three.ws, positioned in space by what each agent *means*. Coordinates and semantic search are powered by IBM Granite embeddings on watsonx.ai: each agent becomes a vector, the vectors are projected into 3D, and agents cluster into named constellations. Type a natural-language query and the galaxy flies to the agents closest to your intent.
+
+Page: [/galaxy](https://three.ws/galaxy)
+API: `GET /api/galaxy` (build the map) · `POST /api/galaxy` (semantic search) · `GET /api/galaxy/flows` (live economy overlay)
+
+## Why it exists
+
+A flat directory of agents tells you what exists but nothing about how they relate. Agent Galaxy turns the whole population into a spatial map where proximity is similarity: agents that do similar things sit near each other, and browsing the map is browsing by meaning. It doubles as a discovery tool. Instead of guessing keywords, you describe what you want in plain language and the same embedding model that placed the stars finds the closest ones. It is also a live showcase of what Granite embeddings make possible on the platform.
+
+## How it works
+
+The page ([`pages/galaxy.html`](../pages/galaxy.html)) loads [`src/galaxy.js`](../src/galaxy.js), a Three.js scene. The map itself is assembled server-side and cached.
+
+1. **Collect agents.** `GET /api/galaxy` ([`api/galaxy.js`](../api/galaxy.js)) loads published agents from Postgres (`agent_identities` joined to `avatars`, filtered to published, described, named agents, ordered by chat count), default 600 and capped at 1200.
+2. **Embed.** Each agent's text (name, description, tone tags) is embedded with IBM Granite through [`api/_lib/watsonx.js`](../api/_lib/watsonx.js). The default model is `ibm/granite-embedding-278m-multilingual`, called at `POST {WATSONX_URL}/ml/v1/text/embeddings` with an IAM bearer token minted from the watsonx API key. Vectors are cached durably per agent (`agent_embeddings`), so only changed agents re-embed.
+3. **Project to 3D.** [`api/_lib/embedding-math.js`](../api/_lib/embedding-math.js) mean-centers the vectors, takes the top 3 principal components via power iteration (PCA, seeded and deterministic, not UMAP or t-SNE), whitens per axis, and maps them into a cube of half-width 120 world units. Determinism means cached rebuilds are stable.
+4. **Cluster into constellations.** Seeded k-means (Lloyd's with k-means++ seeding) over L2-normalized vectors groups agents into `clamp(round(n/8), 2, 8)` clusters. Each cluster is labeled by Granite chat (`ibm/granite-3-8b-instruct`, with a same-family OpenRouter fallback).
+5. **Render.** The client draws agents as a single `THREE.Points` cloud with a custom additive shader. Point size grows with chat count; a wealth glow (from real wallet net worth via `/api/agents/networth`) biases funded stars toward a violet tint. `OrbitControls` gives drag-to-orbit, scroll-to-zoom, and gentle auto-rotate that pauses on interaction. A raycaster powers hover tooltips.
+6. **Inspect.** Clicking a star opens an in-scene card with the agent's thumbnail, constellation, description, and meta chips (net worth, chat count, token), plus two actions: "View agent" (`/agents/:id`) and "Chat" (`/agent/:id`).
+7. **Search.** The search box POSTs `{ query }` to `/api/galaxy`, which embeds the query with the same Granite model and ranks stored agent vectors by cosine similarity. The client highlights matches and flies the camera to the best one.
+
+Only projected coordinates and cluster centroids are sent to the browser; raw high-dimensional vectors never leave the server.
+
+## Walkthrough
+
+1. Open [/galaxy](https://three.ws/galaxy). The loading overlay reads "Mapping the agent universe" while Granite embeds the agents.
+2. Drag to orbit, scroll to zoom. Watch the constellations, each a color-coded cluster of related agents.
+3. Hover a star to see the agent name and its constellation; click it to open the inspect card.
+4. From the card, open the agent's profile ("View agent") or start a conversation ("Chat").
+5. Type a natural-language query such as "an agent that trades memecoins" and search. The galaxy highlights the closest matches and flies to the best one; the result strip lists them under "Closest by meaning."
+
+## Examples
+
+Both endpoints are public and IP rate-limited.
+
+```bash
+# Build (or read the cached) galaxy: agents, coordinates, and constellations.
+curl 'https://three.ws/api/galaxy?limit=600'
+# -> {
+# "count": 412, "dims": 768, "model": "ibm/granite-embedding-278m-multilingual",
+# "clusters": [ { "id": 0, "color": "#…", "centroid": [x,y,z], "label": "Traders", ... } ],
+# "agents": [ { "id": "…", "name": "…", "description": "…", "thumbnail": "…",
+# "chat_count": 128, "cluster": 0, "coords": [x,y,z] } ],
+# "cached": true, "generated_at": "…"
+# }
+
+# Semantic search: embed the query with Granite, rank agents by cosine similarity.
+curl -X POST 'https://three.ws/api/galaxy' \
+ -H 'content-type: application/json' \
+ -d '{ "query": "an agent that trades solana memecoins", "limit": 12 }'
+# -> {
+# "query": "an agent that trades solana memecoins",
+# "model": "ibm/granite-embedding-278m-multilingual",
+# "count": 12,
+# "results": [ { "id": "…", "name": "…", "description": "…", "thumbnail": "…", "score": 0.742 } ]
+# }
+```
+
+`GET /api/galaxy` accepts `?refresh=1` to force a rebuild and `?limit=<n>` (default 600, max 1200). `POST /api/galaxy` takes `{ query, limit? }` (query trimmed to 200 chars, up to 30 results). Rankings apply a minimum similarity of 0.05.
+
+## States and limits
+
+- **No auth.** Both endpoints are public and read-only, guarded by a per-IP rate limit. Embedding cost is bounded by design: agents embed once into the durable cache and map builds are snapshot-cached, so only a search query triggers a fresh Granite call.
+- **watsonx required.** With no credentials the endpoint returns `503 watsonx_unavailable` and the page shows "IBM Granite isn't connected" (no retry). Configure `WATSONX_API_KEY` and `WATSONX_PROJECT_ID` to light it up.
+- **Caching.** Three layers: a `galaxy_snapshots` server snapshot (6-hour TTL, with warm-instance rebuild coalescing), the durable per-agent `agent_embeddings` cache, and a 60-second cache on the published-agent query. Pass `?refresh=1` to bypass the snapshot.
+- **Population.** However many published agents exist, capped by the limit. There is no fixed count.
+- **Empty state.** With zero published agents the page shows "The galaxy is still forming" and a "Create an agent" CTA to `/create`.
+- **Errors.** Network or server failures render "Couldn't reach the stars" with a "Try again" button. Search failures render the server message in the result strip; no matches shows "Nothing close to <query>."
+- **Positioning is PCA, not UMAP/t-SNE.** It is deterministic on purpose so cached maps stay stable across rebuilds.
+
+## Related
+
+- [IBM Granite suite](./ibm.md): the full set of watsonx-powered features on three.ws, including the IBM-branded galaxy variant at `/ibm/galaxy`.
+- [Agent system](./agent-system.md) and [Agent reputation](./agent-reputation.md): what a "star" is and how agents earn standing.
+- Pages: [/galaxy](https://three.ws/galaxy), [/create](https://three.ws/create), [/agents](https://three.ws/agents).
+
+---
+
+<a id="sec-145"></a>
+
+> **Source:** `docs/genesis.md` · [↑ table of contents](#table-of-contents)
+
+# Instant Agent Genesis: prompt or selfie to a living agent
+
+Genesis is the one-minute on-ramp for the whole platform. You give it a text
+prompt, a selfie, or a public avatar to remix. It returns a rigged 3D AI agent
+that already owns a custodial Solana wallet, a custodial EVM wallet, a synthesized
+persona and voice, and an optional verifiable on-chain identity. Every step is
+real: the 3D body comes off the same reconstruction pipeline `/create` uses, the
+wallet addresses are real custodial addresses, and the on-chain record returns a
+real transaction hash. Nothing is mocked or faked as it runs.
+
+Page: [/genesis](https://three.ws/genesis) · APIs: `/api/avatars/reconstruct`, `/api/avatars/regenerate-status`, `/api/avatars/fork`, `/api/agents`, `/api/agents/:id/wallet/provision`, `/api/persona/extract`, `/api/agents/:id`
+
+## Why it exists
+
+Creating a usable agent used to mean stitching together five surfaces: generate a
+model, rig it, mint a wallet, write a system prompt, pick a voice, register an
+identity. Each one is its own page, its own wait, its own chance to give up.
+Genesis collapses that into a single guided flow with a real progress bar driven by
+real job state, so a first-time visitor goes from an idea to a wallet-holding,
+animation-ready agent they fully own in under a minute of active work. It is the
+front door: the artifact it produces is a first-class agent that plugs straight
+into [Agent Studio](./agent-studio.md), the [economy](./autonomous-economy.md),
+[breeding](./genome.md), and every embed surface.
+
+## How it works
+
+Genesis is a state machine over the platform's existing production endpoints. It
+never invents a shortcut path; it orchestrates the real ones.
+
+- **Body.** The `text` and `selfie` modes both POST to `/api/avatars/reconstruct`
+ (a prompt or a photo), then poll `/api/avatars/regenerate-status` with capped
+ exponential backoff (1.5s first poll, 1.4x backoff, 12s ceiling, 8-minute
+ deadline). This is the identical rigged-avatar pipeline behind `/create/prompt`
+ and `/create/selfie`. The reconstruction model returns a textured mesh; when the
+ mesh has no skeleton and the active provider has a rig model configured, the
+ pipeline chains an auto-rig job (GCP UniRig / Hunyuan3D `generation_all`) and only
+ surfaces the avatar once it can be animated, so you never receive a T-posed
+ static mesh. The `remix` mode instead POSTs to `/api/avatars/fork`, forking a
+ public avatar into a fresh one you own.
+- **Agent and wallets.** Reconstruct and fork auto-provision the agent record.
+ Genesis resolves it via `GET /api/agents?avatar_id=...`, then calls
+ `POST /api/agents/:id/wallet/provision` to guarantee both a custodial Solana
+ address and a custodial EVM address exist. These are real custodial keys held for
+ the agent (see [Agent Wallets](./agent-wallets.md) and [Custody](./custody.md)),
+ Solana first because Solana is the home chain.
+- **Persona and voice.** `POST /api/persona/extract` synthesizes a structured
+ in-character system prompt from your description, running through the shared LLM
+ helper with Anthropic-first ordered failover (server Anthropic, then Groq, then
+ OpenRouter) so a single upstream 429 or 5xx never returns a hard error. Voices
+ load from `/api/tts/voices`. Your chosen name, persona, and voice are persisted
+ with `PATCH /api/agents/:id`.
+- **On-chain identity (optional).** The final step mints a real
+ [ERC-8004](./erc8004.md) identity record for the agent and returns a real tx
+ hash, defaulting to Base (chain id 8453) to match the rest of the platform's EVM
+ identity layer. This step is optional: the agent is fully functional without it.
+
+## Walkthrough
+
+1. **Open [/genesis](https://three.ws/genesis).** Pick a mode: type a prompt, drop
+ a selfie, or remix one of the featured public avatars loaded from
+ `/api/avatars/featured`.
+2. **Sign in.** Genesis claims the agent and its wallets to your account, so
+ pressing Begin requires a wallet sign-in first (the banner wires
+ `signInWithWallet`).
+3. **Kick off generation.** The step bar tracks the real reconstruction job:
+ queued, generating, rigging, ready. Progress reflects the job state, not a timer.
+4. **Watch the agent resolve.** Once the avatar is ready, Genesis resolves the
+ auto-provisioned agent and provisions both wallets. The real Solana and EVM
+ addresses appear.
+5. **Name it and give it a voice.** Persona extraction proposes a system prompt from
+ your prompt; edit the name and pick a voice, then save.
+6. **Optionally bind an on-chain identity.** One click registers the ERC-8004 record
+ and shows the returned transaction hash.
+7. **You now own a complete agent.** Open it in [Agent Studio](./agent-studio.md) to
+ keep authoring, drop it on a site via [Integrations](./integrations.md), or breed
+ it in [Agent Genome](./genome.md).
+
+## Examples
+
+Genesis is a browser flow, but its endpoints are the public agent APIs. This drives
+the same body-generation step from a script (see
+[API reference](./api-reference.md) and [Authentication](./authentication.md) for
+the session cookie or bearer token):
+
+```bash
+# 1. Start a text-to-avatar reconstruction
+JOB=$(curl -s -X POST https://three.ws/api/avatars/reconstruct \
+ -H 'content-type: application/json' \
+ -H "authorization: Bearer $THREEWS_TOKEN" \
+ -d '{"name":"Silver Explorer","prompt":"A silver-haired explorer in a teal flight jacket"}')
+echo "$JOB"
+
+# 2. Poll status until the rigged model is ready
+JOB_ID=$(echo "$JOB" | python3 -c 'import sys,json;print(json.load(sys.stdin)["jobId"])')
+curl -s "https://three.ws/api/avatars/regenerate-status?jobId=$JOB_ID" \
+ -H "authorization: Bearer $THREEWS_TOKEN"
+```
+
+```bash
+# 3. Resolve the auto-provisioned agent and guarantee both wallets
+AVATAR_ID=... # from the finished status payload
+AGENT=$(curl -s "https://three.ws/api/agents?avatar_id=$AVATAR_ID" \
+ -H "authorization: Bearer $THREEWS_TOKEN")
+AGENT_ID=$(echo "$AGENT" | python3 -c 'import sys,json;print(json.load(sys.stdin)["agents"][0]["id"])')
+
+curl -s -X POST "https://three.ws/api/agents/$AGENT_ID/wallet/provision" \
+ -H "authorization: Bearer $THREEWS_TOKEN"
+# returns { solana_address, wallet_address (EVM), ... } with real custodial addresses
+```
+
+## States and limits
+
+- **Signed out.** Pressing Begin while signed out shows "Sign in first" instead of
+ starting a job: generation, wallet provisioning, and identity binding all require
+ sign-in (`/api/avatars/reconstruct` returns 401 unauthenticated). The auth banner
+ is always reachable.
+- **Generation deadline.** Reconstruction has an 8-minute deadline and the
+ agent-resolve step a 60-second deadline; both surface a designed error with a
+ retry action rather than hanging.
+- **Rigging fallback.** If no rig model is configured or rigging fails, the pipeline
+ delivers the static mesh tagged `unrigged` so you are never left empty-handed. Any
+ humanoid avatar drives the pre-baked clip library via bone-name canonicalization,
+ so the rig is not limited to a curated allowlist.
+- **On-chain identity is optional and reversible in practice.** Skipping it leaves a
+ fully working agent; you can bind an identity later.
+- **Selfie framing.** The reconstruction path is a face pipeline. A clean headshot
+ reconstructs far more reliably than a full-body photo.
+- **Ownership.** The agent, both wallets, and the identity are yours. Remix forks a
+ public avatar into a new agent you own; it never mutates the source.
+
+## Related
+
+- [Agent Studio](./agent-studio.md): keep authoring the agent Genesis created
+- [Agent Genome](./genome.md): breed two agents into an inherited child
+- [Avatar Reconstruction](./avatar-reconstruction.md): the selfie-to-3D pipeline
+- [Agent Wallets](./agent-wallets.md) and [Custody](./custody.md): the custodial keys
+- [ERC-8004](./erc8004.md): the on-chain identity record
+- [Persona Hub](./persona-hub.md): how personas are synthesized
+- Pages: [/genesis](https://three.ws/genesis), [/create](https://three.ws/create), [/agent-studio](https://three.ws/agent-studio)
+
+---
+
+<a id="sec-146"></a>
+
+> **Source:** `docs/genome.md` · [↑ table of contents](#table-of-contents)
+
+# Agent Genome: breed two agents into a provably-inherited child
+
+Agent Genome lets two agents breed into a genuinely new third agent that provably
+inherits a recombination of both parents. The child gets its own fresh Solana and
+EVM wallet, a blended voice, a composed in-character brain, a baked composite 3D
+body, and the skill licenses it expresses granted on-chain. Every breeding event is
+recorded with the exact seed that produced it, so the descent is re-derivable by
+anyone and a forged child (one whose genome was not actually derived from its
+claimed parents) is detectable. Neither parent's row or wallet is ever touched.
+
+Page: [/genome](https://three.ws/genome) · APIs: `/api/genome/preview`, `/api/genome/breed`, `/api/genome/lineage`, `/api/genome/stud`
+
+## Why it exists
+
+Agents on three.ws accumulate real value: a tuned brain, a cloned voice, a body,
+and on-chain skill licenses. Genome makes that value heritable. It turns a one-off
+agent into a lineage, gives creators a reason to breed rare traits toward scarcer
+pedigrees, and does it with cryptographic honesty instead of a "trust us" label.
+The recombination is a pure function of the two parent genomes and a recorded seed,
+so what you preview is exactly what you breed, and the family tree on every node is
+independently verifiable.
+
+## How it works
+
+The engine lives in `api/_lib/genome.js` and is deterministic by construction. A
+seeded PRNG (`xmur3` + `mulberry32`) draws per-locus values, so given the same two
+parents and the same seed it always derives the identical child.
+
+- **Brain.** Six numeric loci (temperature, verbosity, curiosity, formality, humor,
+ boldness) inherit as a parental blend plus a bounded mutation. Mutation can drift a
+ trait at most `MUTATION_MAX = 0.12` in 0..1 space, and any drift past
+ `MUTATION_RECORD_THRESHOLD = 0.04` is recorded in `genome.mutations` so every
+ novelty is auditable. Tone tags recombine as a set.
+- **Voice.** Numeric voice loci (stability, similarity_boost, style) blend and
+ mutate; pitch blends within a bounded range. The dominant `voice_id` comes from
+ whichever parent carries a real cloned or ElevenLabs voice, and the child's blended
+ settings are genuinely synthesized through `/api/tts/eleven`, not just labelled.
+- **Body.** Morph targets and colors blend; accessories and hidden parts recombine as
+ sets. At breed time the dominant parent's GLB is copied into the child's namespace
+ and the inherited appearance is baked into a real composite child GLB.
+- **Skills.** Allele recombination: each parent contributes its full allele set
+ (expressed and recessive). Dominance decides what the child expresses, recessive
+ alleles carry silently to the next generation, and matching alleles can trigger an
+ emergent fusion skill per `FUSION_RULES`. The skills the child actually expresses
+ are granted on-chain to the child's wallet with royalty provenance recorded (which
+ parent each license descended from).
+- **Pedigree.** A weighted score (generation depth weighted most, then emergent
+ novelty and recessive variety) maps to a tier: common, uncommon, rare, legendary.
+- **Recording and verification.** Each breed writes a `genome_breedings` row with the
+ breeding key, both parent ids, the child id, the seed, the full child genome, its
+ hash, generation, and pedigree tier. `verifyGenome` re-derives the child from the
+ recorded seed plus the parent-genome snapshots captured at breed time and confirms
+ the stored hash matches. Breeding is idempotent per `(parents, seed)` key: replaying
+ the same pairing returns the same child instead of minting twins.
+
+## Walkthrough
+
+1. **Open [/genome](https://three.ws/genome).** Your agents load from `/api/agents`;
+ public studs load from `/api/genome/stud`.
+2. **Pick two parents.** Choose two agents you own, or pair one of yours with a
+ public stud. An agent cannot breed with itself.
+3. **Preview the offspring.** `POST /api/genome/preview` derives the child
+ deterministically and echoes back the seed. You see the full trait blend, the
+ real voice settings and `voice_id` the child would carry (playable via
+ `/api/tts/eleven`), the bakeable body, the skill alleles (expressed, recessive,
+ emergent), recorded mutations, and the pedigree tier. Nothing is minted.
+4. **Reroll if you want a different draw.** A reroll changes the seed and re-previews.
+ The seed you settle on is the one that gets committed.
+5. **Breed.** `POST /api/genome/breed` with the same seed commits exactly the
+ previewed child: a new agent with a fresh wallet, a baked composite GLB, blended
+ voice, composed brain, and its expressed skills minted on-chain.
+6. **Verify the lineage.** Every parent and child links to its family tree via
+ `/api/genome/lineage`. The `verify=1` path re-derives and confirms the genome so
+ anyone can check the child is real.
+
+## Examples
+
+Preview a pairing (read-only, nothing minted). See
+[Authentication](./authentication.md) for the token or session cookie:
+
+```bash
+curl -s -X POST https://three.ws/api/genome/preview \
+ -H 'content-type: application/json' \
+ -H "authorization: Bearer $THREEWS_TOKEN" \
+ -d '{"parent_a":"<agent-uuid-a>","parent_b":"<agent-uuid-b>"}'
+# returns { seed, genome:{ generation, brain, voice, body, skills, mutations }, pedigree_tier, ... }
+```
+
+Commit exactly the previewed child by passing the echoed seed:
+
+```bash
+curl -s -X POST https://three.ws/api/genome/breed \
+ -H 'content-type: application/json' \
+ -H "authorization: Bearer $THREEWS_TOKEN" \
+ -d '{"parent_a":"<agent-uuid-a>","parent_b":"<agent-uuid-b>","seed":"<seed-from-preview>"}'
+# returns 201 { child:{ id, name, generation, avatar_id }, genome, genome_hash, seed }
+```
+
+Verify any child against its recorded parents and seed (public, no auth):
+
+```bash
+curl -s "https://three.ws/api/genome/lineage?agentId=<child-uuid>&verify=1"
+# re-derives the genome from the stored seed + parent snapshots and confirms the hash
+```
+
+## States and limits
+
+- **Ownership and consent.** You can always breed two agents you own for free.
+ Pairing with someone else's public stud is allowed and may carry a `$THREE` stud
+ fee paid to the stud owner; the preview surfaces the fee. Private agents you do not
+ own are not breedable.
+- **Breeding cooldown.** A parent can breed at most once per 6-hour window
+ (`BREED_COOLDOWN_MS`). Breeding a parent still on cooldown returns HTTP 409
+ `breeding_cooldown` with the remaining minutes. Cooldowns keep deep pedigrees
+ scarce.
+- **Stud fee settlement.** When a stud fee applies and no valid payment signature is
+ attached, `/api/genome/breed` returns HTTP 402 with the required `$THREE` amount.
+ Presence of a signature is not proof of payment; the fee must actually land in the
+ stud's payout wallet, and a single payment cannot be reused across breedings.
+- **Determinism.** Same parents plus same seed always yields the same child. Change
+ the seed and you get a different (still valid) draw.
+- **Graceful birth.** A copy or bake hiccup never blocks the birth; the child still
+ references a real model, degrading to the copied base GLB if the composite bake
+ fails.
+- **Provenance is permanent.** The seed, genome, and hash are recorded so the lineage
+ stays re-derivable and forgery-detectable indefinitely.
+
+## Related
+
+- [Instant Agent Genesis](./genesis.md): mint the parents in under a minute
+- [Agent Skills](./agent-skills.md): the skill licenses that recombine
+- [Agent Wallets](./agent-wallets.md): the fresh child wallet
+- [Agent Reputation](./agent-reputation.md): how pedigree feeds standing
+- [ERC-8004](./erc8004.md): on-chain identity for bred agents
+- Pages: [/genome](https://three.ws/genome), [/agent-studio](https://three.ws/agent-studio)
+
+---
+
+<a id="sec-147"></a>
+
+> **Source:** `docs/guardian.md` · [↑ table of contents](#table-of-contents)
+
+# Guardian console: recover and inherit agent wallets, without ever touching a key
+
+The Guardian console is the inbox for the other side of social recovery. When a friend names you a guardian or a beneficiary of their agent, that agent shows up here. This is where you help them back in: approve a recovery you trust, decline one you do not, confirm an inheritance when someone is truly gone, or push a ready process over the line. Every action runs through a threshold-approved, time-locked process that only ever changes who owns the agent. A private key is never decrypted, displayed, or moved.
+
+Page: [/guardian](https://three.ws/guardian)
+API: `GET /api/agents/recovery-inbox`, and the per-agent recovery actions under `/api/agents/:id/recovery/...`
+
+## Why it exists
+
+A funded agent should not die with a lost password, or with its owner. But the usual answer, exporting a seed phrase to a trusted contact, just moves the single point of failure. three.ws takes a different position: recovery and inheritance are ownership transfers, never key exports. The wallet secret stays encrypted at rest; the platform simply re-points the agent to a new owner account and signs for them afterward. There is nothing for an attacker to intercept.
+
+The owner sets this up from their own wallet hub (naming guardians, an approval threshold, and optionally a beneficiary). But the owner is, by definition, the person who is locked out or gone, so they cannot be the one who acts. The guardian console is the surface for the people who can: the guardians and beneficiaries. They are not the owner, so they never see the owner-only Recovery tab inside the agent's hub. Being someone's safety net is a real, visible role in the graph, and this page gives it the weight it deserves.
+
+## How it works
+
+`GET /api/agents/recovery-inbox` lists every agent where you hold an active guardian or beneficiary role (`agent_recovery_guardians`). Each agent is decorated with its live recovery or inheritance process if one is open (`getActiveRequest`, `decorateRequest`), and a `needs_action` flag computed for you specifically:
+
+- For a **recovery**, a guardian who is not the requester and has not already voted needs to act.
+- For an **inheritance**, a beneficiary whose confirmation is awaited, or any guardian who has not voted, needs to act.
+
+The response sorts agents that need your action first, then those with an open process, then the rest, and reports how many need you.
+
+**The safety rails** (detailed in [custody](./custody.md)) are enforced by the recovery API, not the console:
+
+- The requester cannot approve their own takeover; at least one other guardian must approve.
+- The wallet auto-freezes for autonomous spend the moment a request opens (the real owner's own withdrawal stays open).
+- Threshold approvals start a time-lock before the transfer can complete.
+- The real owner can cancel instantly at any point; their presence defeats the request.
+- Unmet requests expire.
+
+**Inheritance** is a dead-man's switch: the owner enables it with an inactivity threshold and a grace window, "alive" is inferred from real activity or an explicit check-in, and when inactivity crosses the line an inheritance request opens to the beneficiary. It needs guardian confirmation (or the beneficiary's own, if no guardians are set) and the grace window before it completes.
+
+**Actions** the console fires (all CSRF-protected, owner or guardian gated, never exposing a key):
+
+- Approve or decline a recovery: `POST /api/agents/:id/recovery/requests/:rid/{approve,decline}`
+- Confirm or decline an inheritance: `POST /api/agents/:id/recovery/requests/:rid/{confirm,decline}`
+- Complete a ready transfer: `POST /api/agents/:id/recovery/requests/:rid/complete`
+- Arm inheritance as a beneficiary when the owner has gone silent past their threshold: `POST /api/agents/:id/recovery/inheritance/arm`
+
+## Walkthrough
+
+1. Open [/guardian](https://three.ws/guardian). Signed out, it prompts you to sign in. Signed in with no roles, it explains what the console is for and invites you to ask a friend to name you.
+2. Each agent you protect renders as a card: its name (linked to its profile), who owns it, when you were trusted, and your roles (guardian, beneficiary, or both). A badge at the top counts how many agents need your action.
+3. If a process is open, the card tells its story in the agent's own voice ("I'm being recovered. If you trust this person is really my owner, approve."), plus the approval count, the safety-window countdown, and when it opened.
+4. Act. For a recovery you trust, click **Approve recovery** (or **Decline**). For an inheritance you believe is real, click **Confirm inheritance**. Each action asks you to confirm, because these are consequential.
+5. When the safety window has elapsed and the process is ready, click **Complete transfer** to pass control of the agent and its wallet to the new owner.
+6. If you are a beneficiary and the owner has gone silent past their threshold with no active process, you can try to arm inheritance, which begins the grace window.
+
+## Examples
+
+Read your guardian inbox:
+
+```bash
+curl -s https://three.ws/api/agents/recovery-inbox \
+ -H 'authorization: Bearer YOUR_TOKEN' \
+ | jq '.data | {need_your_action: .actionable,
+ agents: [.items[] | {agent: .agent_name, roles, needs_action,
+ process: .active_request.kind, status: .active_request.status}]}'
+```
+
+The console reads this on load, resolves your viewer id (so it can tell whether you have already voted), and renders each item. Write actions are performed with a CSRF token; the console fetches one before every non-GET call.
+
+## Guardrails, states, and limits
+
+- **A key is never exposed.** Recovery and inheritance change ownership only. The wallet secret stays encrypted; completing a process re-points the agent, it does not reveal or move a secret.
+- **You are not the owner here.** The console only ever shows agents where you are a guardian or beneficiary. It never exposes anyone's funds or keys, only the power to help them back in.
+- **No self-takeover.** A recovery requester cannot approve their own request; an independent guardian approval is required.
+- **Time-locked and cancelable.** Threshold approvals start a safety window; the real owner can cancel any time before completion, and their return defeats the request outright.
+- **Auto-freeze during a dispute.** An open request freezes autonomous spend (owner withdrawal stays open), tracked separately so it lifts on resolution without overriding a freeze the owner set.
+- **Confirmation on every consequential action.** Approve, confirm, decline, and complete each prompt for confirmation before firing.
+- **Signed-out, empty, and error states** are all designed: sign-in prompt, "no one's named you yet", and an inline retry on failure.
+- **Not the content-safety Guardian.** This console is unrelated to `@three-ws/guardian`, the AI content-moderation package that shares the name.
+
+## Related
+
+- [Custody you can verify](./custody.md) - the full recovery and inheritance model, the freeze switch, spend limits, and proof-of-custody
+- [Financial controls](./financial-controls.md) - the plain-English spend rules on the same wallet rails
+- [/integrity](https://three.ws/integrity) - the public Merkle attestation of every custodial wallet
+- [/proof](https://three.ws/proof) - verify your own wallet's inclusion in the attestation, in your browser
+
+---
+
+<a id="sec-148"></a>
> **Source:** `docs/hold-to-access.md` · [↑ table of contents](#table-of-contents)
@@ -30834,7 +35059,57 @@ worlds unaffected.
---
-<a id="sec-123"></a>
+<a id="sec-149"></a>
+
+> **Source:** `docs/how-forge-works.md` · [↑ table of contents](#table-of-contents)
+
+# How the Forge works, in plain language
+
+You type "a weathered brass diving helmet" at [three.ws/forge](https://three.ws/forge), and about half a minute later you are orbiting a real, textured 3D model you can download, view in AR, or drop into a scene. No account, no key, no cost. This page explains what actually happens in between, without the engineering detail. (If you want that, read the [architecture deep dive](./forge-pipeline.md).)
+
+## The five steps every generation takes
+
+**1. Your words become a picture.** For a text prompt, an image model first paints your description as a clean reference photo of the object, the way a concept artist would sketch it before a sculptor starts. If you uploaded photos instead, this step is skipped: your photos are the reference.
+
+**2. The picture becomes a shape.** A 3D reconstruction model looks at the reference and infers the full object: the sides it can see and the sides it has to imagine. Out comes real geometry, a mesh with color and texture baked on.
+
+**3. The best available engine does the work.** three.ws does not run one 3D model; it runs a grid of them. Microsoft's TRELLIS on NVIDIA's cloud, Tencent's Hunyuan3D and TRELLIS on our own GPUs, community models on Hugging Face, and premium engines like Meshy and Tripo if you bring your own key. Before your job starts, the Forge checks which engines are healthy right now and picks the best free one for your kind of prompt. Machines and vehicles route to the engine that is best at hard surfaces; people and creatures route to the one that is best at organic shapes.
+
+**4. If an engine stumbles, your job quietly moves.** GPU services go down, queues fill, clouds have bad days. When that happens mid-generation, the Forge re-submits your job to the next engine in line automatically. You keep watching the same progress bar; you never find out. Only if every lane fails do you see an error, and even then it comes with one-click retry options.
+
+**5. The model is saved somewhere permanent.** The raw output lands on temporary cloud storage that expires within an hour, so the Forge immediately copies your model to a permanent CDN. That is the link you share, and it keeps working. The generation is also recorded in your gallery, so closing the tab mid-job loses nothing: the platform finishes it in the background and it is waiting for you when you come back.
+
+## What the quality tiers mean
+
+- **Draft ($0.05, free on the default lane)**: about 12,000 polygons, fast, no textures on some lanes. For trying ideas.
+- **Standard (the default)**: about 30,000 polygons with 2K textures, reference views fused from multiple angles.
+- **High**: up to 200,000 polygons with full PBR materials and HD textures, the deepest quality settings every engine offers. High is where holding $THREE matters: holders generate at High as a perk, everyone else pays per generation.
+
+Here is the honest part: draft and standard usually cost us nothing to produce, because they run on free lanes and our own GPUs. We charge for the top tier because it is genuinely better, not to pass a vendor bill along.
+
+## After the model exists
+
+A finished model is a starting point, not a dead end:
+
+- **Make it move.** One click adds a full skeleton (52 bones, face blendshapes) so a humanoid model can walk, wave, and talk. This powers every animated avatar on the platform.
+- **Change its look.** Say "make it chrome" or "wooden" and the material changes without regenerating the shape.
+- **Refine it by talking.** "Bigger helmet." "More rust." Each refinement is a new version in a history you can rewind or branch.
+- **Make it game-ready.** Retopology to a clean polygon budget that drops straight into Unity or Unreal.
+- **Share and remix.** Publish it, let others remix it, and earn royalties on-chain when they do.
+
+## Agents use the exact same machinery
+
+Everything above is also a tool call. AI agents (Claude, ChatGPT, or your own) generate models through our [free MCP server](./mcp-studio.md) or plain HTTP, and other agents pay per call with USDC over [x402](./x402.md), no account needed. The page you use and the API an agent uses are the same pipeline underneath.
+
+## Try it
+
+- Type a prompt: [three.ws/forge](https://three.ws/forge)
+- Turn photos into a model: [three.ws/image-to-3d](https://three.ws/image-to-3d)
+- The full technical breakdown: [the Forge pipeline deep dive](./forge-pipeline.md)
+
+---
+
+<a id="sec-150"></a>
> **Source:** `docs/how-it-works.md` · [↑ table of contents](#table-of-contents)
@@ -30848,7 +35123,7 @@ For the full deep dive on internals, see [Architecture overview](./architecture.
## The pitch in one paragraph
-three.ws turns an AI agent into a persistent, ownable, multi-chain object: a 3D body that renders in any modern browser, an LLM brain you choose (Claude, GPT, or others), an on-chain identity registered on EVM chains via ERC-8004 or on Solana via Metaplex Core, and a `<agent-3d>` web component you can drop into any page on the internet. Pay-per-call API endpoints use the x402 standard. The whole stack is open source under Apache-2.0.
+three.ws turns an AI agent into a persistent, ownable, multi-chain object: a 3D body that renders in any modern browser, an LLM brain you choose (Claude, GPT, or others), an on-chain identity registered on EVM chains via ERC-8004 or on Solana via Metaplex Core, and a `<agent-3d>` web component you can drop into any page on the internet. Pay-per-call API endpoints use the x402 standard, and the client SDKs (`@three-ws/sdk`, `@three-ws/avatar`, `@three-ws/irl`, and friends) are published on npm.
---
@@ -30892,7 +35167,7 @@ The whole stack is split into four horizontal strata. Each layer can run on its
- **Viewer layer** — pure three.js. Knows nothing about agents, brains, or wallets. Useful on its own as a glTF inspector and as the rendering engine for Turntable / Animation Gallery widgets. See [Layers](./layers.md) for the contract.
- **Agent layer** — turns a static GLB into a presence. LLM tool-loop, skill registry, memory, and a continuous emotion blend that drives morphs and gaze. See [Agent system](./agent-system.md).
- **Identity layer** — durability across sessions, devices, and embed hosts. Wallet auth, on-chain registration, IPFS-pinned manifest bundles, signed action diary. Entirely optional. See [ERC-8004](./erc8004.md) and [Solana agents](./solana.md).
-- **Embed layer** — the public face. The `<agent-3d>` custom element, five widget variants, iframe embeds, the CDN bundle, the SPA, and the route table in `vercel.json` (read at runtime by the Cloud Run server). See [Embedding](./embedding.md).
+- **Embed layer**: the public face. The `<agent-3d>` custom element, ten widget variants, iframe embeds, the CDN bundle, the SPA, and the route table in `vercel.json` (read at runtime by the Cloud Run server). See [Embedding](./embedding.md).
The four layers communicate through one event bus (`agent-protocol`). Every meaningful action is a `CustomEvent` on a singleton. That single design choice is why you can swap the avatar for a 2D sprite, the runtime for a different LLM, or memory for a vector store — and nothing else changes.
@@ -30904,7 +35179,7 @@ A user types "Wave at me" into an embedded agent's chat input. Here's the full d
1. **Input.** Chat UI calls `runtime.send("Wave at me", { voice: false })`.
2. **System prompt.** The runtime builds the prompt: manifest `instructions.md` + a compact memory block + the skill registry's tool descriptions.
-3. **LLM call.** A streaming request goes to Anthropic (or OpenAI, or whichever provider matches the manifest's `brain.provider`). The platform supports proxying through `/api/brain/chat` so API keys never live in the client.
+3. **LLM call.** A streaming request goes to Anthropic (or whichever provider matches the manifest's `brain.provider`). Embeds without their own key route through the platform's pooled proxy (`/api/llm/anthropic`) so API keys never live in the client.
4. **Tool call.** The model returns a `wave` tool invocation.
5. **Skill dispatch.** The skill registry looks up `wave`. It's a built-in: the handler emits a `gesture` event on the bus and plays the wave animation clip via the `SceneController`.
6. **Empathy reaction.** The avatar's empathy layer hears `gesture` and `speak` events on the same bus. Sentiment is positive, so celebration weight bumps slightly. Morph targets lerp `mouthSmile` toward 0.6 over a few frames; gaze locks on the user.
@@ -30921,11 +35196,11 @@ Three modes, all configurable per agent:
| Mode | When to use | How |
|---|---|---|
-| **Hosted (default)** | Most users | Set `brain="claude-sonnet-4-6"`. The element posts to `https://three.ws/api/brain/chat`, which uses the platform's pooled keys. Billed against your three.ws account. |
-| **Self-hosted proxy** | You want to manage cost or use a private model | Set `key-proxy="/api/llm"` to point at your own serverless function that injects keys before forwarding to the provider. Keys never reach the client. |
-| **Direct (advanced)** | Local-only experiments | The runtime can call providers directly if you pass an API key explicitly. Don't ship this to a public page. |
+| **Hosted (default)** | Most users | Give the agent a backend `agent-id` and set no key. The element routes through the platform's pooled-key proxy (`/api/llm/anthropic?agent=<id>`), so keys never reach the client. |
+| **Self-hosted proxy** | You want to manage cost or use a private model | Set `key-proxy="https://yourapp.com/api/llm"` to point at your own serverless function that injects keys before forwarding to the provider. Keys never reach the client. |
+| **Direct (advanced)** | Local-only experiments | The runtime calls the provider directly if you pass an `api-key` attribute explicitly. Don't ship this to a public page. |
-The brain proxy at [`/api/brain/chat`](./api-reference.md) supports Anthropic, OpenAI, Qwen, and OpenRouter — so the brain attribute can be `claude-opus-4-7`, `claude-sonnet-4-6`, `claude-haiku-4-5`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, and others.
+The platform's own chat surfaces run on the multi-model brain router at [`/api/brain/chat`](./api-reference.md), which supports Anthropic, OpenAI, and Qwen natively with OpenRouter failover; model ids include `claude-opus-4-7`, `claude-sonnet-4-6`, `claude-haiku-4-5`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `qwen-plus`, and others.
---
@@ -30937,7 +35212,7 @@ Three production paths. Pick whichever fits your use case:
- **Selfie capture** — 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`.
+Every avatar ends up as a hosted GLB URL (served from the `cdn.three.ws` asset CDN) plus a database record. When you wire one into an agent, the agent's manifest references it under `body.uri`.
---
@@ -30946,10 +35221,10 @@ Every avatar ends up as a `cdn.three.ws/u/<owner>/…glb` URL plus a database re
Once your agent is live, three surfaces let other pages embed it:
- **The web component** — `<agent-3d agent-id="…">` after loading the CDN script. The element runs in your page, sharing the DOM. Use this when you want full control and your CSP allows third-party scripts.
-- **The iframe widget** — `https://three.ws/w/<widget-id>` rendered inside an `<iframe>`. Five widget types ship: Turntable, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour. Use this in environments where you can't load third-party scripts (Notion, Webflow, Framer, WordPress).
+- **The iframe widget**: `https://three.ws/w/<widget-id>` rendered inside an `<iframe>`. Ten widget types ship: Turntable, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour, Pump.fun Live Feed, Smart Money Feed, Live Trades Canvas, Bonding Curve, and Walking Avatar. Use this in environments where you can't load third-party scripts (Notion, Webflow, Framer, WordPress).
- **The Open Graph + oEmbed surface** — paste `https://three.ws/agent/<id>` into Slack, X, Discord, or any platform that consumes oEmbed, and you get a rich preview with the avatar's poster, name, and description.
-The `postMessage` bridge in the web component and the iframe widget speaks the same protocol, so host pages can call `say()`, `ask()`, `installSkill()`, and listen for events like `agent:speak`, `agent:tool-called`, `agent:skill-done` either way.
+With the web component, the host page calls element methods directly (`say()`, `ask()`, `installSkill()`, `play()`, `lookAt()`) and listens for DOM events (`agent:ready`, `brain:message`, `skill:tool-called`, `voice:transcript`). Inside an iframe, the `postMessage` bridge (`embed-action-bridge.js`) accepts the same intents as ops (`speak`, `gesture`, `emote`, `look`) and mirrors protocol events back to hosts that send a `subscribe` request.
---
@@ -30988,7 +35263,7 @@ Quick lookup for "I want to ship X":
| A character in Notion / Webflow / Framer | An iframe widget from [Widget Studio](./widget-studio.md) |
| A talking AI sidekick that follows visitors | `<agent-3d mode="floating">` |
| A character that controls a scene from page events | The JS API (`agent.say()`, `agent.ask()`) — see [js-api.md](./js-api.md) |
-| Programmatic avatar manipulation in Node | `@three-ws/avatar` |
+| Programmatic avatar viewing/creation in your own app | `@three-ws/avatar` |
| An on-chain identity for your AI | [ERC-8004](./erc8004.md) or [Solana](./solana.md) |
| A paid API anyone (including agents) can call | [x402 monetization](./x402.md) |
| Multiple agents in one scene | `<agent-stage>` — see [multi-agent.md](./multi-agent.md) |
@@ -31005,7 +35280,7 @@ Quick lookup for "I want to ship X":
---
-<a id="sec-124"></a>
+<a id="sec-151"></a>
> **Source:** `docs/i18n.md` · [↑ table of contents](#table-of-contents)
@@ -31022,16 +35297,46 @@ i18next). Ours lives inline in 150+ static HTML pages, so we add an **extraction
step that derives the catalog from annotated markup.
```
-annotate HTML ──▶ i18n:extract ──▶ public/locales/en.json ──▶ i18n:translate ──▶ public/locales/<lang>.json
- (data-i18n) (build) (source of truth) (LLM, glossary-locked) (committed, static)
- │
- runtime: /i18n.js swaps the DOM
+i18n:annotate ──▶ i18n:extract ──▶ public/locales/en.json ──▶ i18n:translate ──▶ public/locales/<lang>.json
+ (auto data-i18n) (build) (source of truth) (LLM, glossary-locked) (committed, static)
+ │ │
+ or hand-annotate runtime: /i18n.js swaps the DOM
```
## 1. Annotate copy
-Add attributes to the English markup. The English text already in the element
-**is** the source value — no duplication.
+You almost never do this by hand. `npm run i18n:annotate` scans static HTML and
+injects the right `data-i18n*` attribute on every user-visible copy element, so
+a whole page becomes translatable in one command.
+
+```bash
+npm run i18n:annotate -- --pages="pages/pricing.html" # dry-run, preview keys
+npm run i18n:annotate -- --pages="pages/pricing.html" --apply # write attrs + wire /i18n.js
+npm run i18n:annotate -- --apply # every htmlExtract entry
+```
+
+The annotator ([`scripts/i18n-annotate.mjs`](../scripts/i18n-annotate.mjs)) is
+built to be safe on hand-authored HTML:
+
+- **Byte-surgical.** It parses only to locate elements (via node-html-parser
+ source offsets) and splices ` data-i18n="…"` into the original string.
+ Untouched bytes are preserved exactly (no whole-file reserialization), so
+ diffs are minimal and reviewable, and stripping the inserted attributes
+ reproduces the original file byte-for-byte.
+- **Idempotent.** An element that already carries an annotation is left alone;
+ re-runs only pick up newly-added copy.
+- **Conservative.** Only leaf copy elements with real letters are touched.
+ `script`/`style`/`svg`/`pre`/`code`/`template`/`textarea`, dynamic
+ `{{…}}`/`${…}` copy, `translate="no"` / `data-no-i18n` opt-outs, and anything
+ nested inside an element it already chose are skipped. `<title>`, meta
+ description, and og/twitter tags are annotated too.
+- **Self-wiring.** With `--apply` it also injects `<script type="module"
+ src="/i18n.js">` if the page lacks it, and the runtime then auto-mounts a
+ floating `<lang-switcher>` on any page that doesn't place its own, so a
+ freshly-annotated page gets a working language picker with zero layout edits.
+
+Keys are namespaced by page (`pricing.plans_h`, `what_is.hero`). To annotate by
+hand, or to understand what the tool emits, the attributes are:
| Attribute | Applies to | Example |
| ----------------------------- | ------------------------------------- | ------------------------------------------------------------------------ |
@@ -31143,11 +35448,27 @@ Add the code (and display name) to `outputLocales` / `localeNames` in
output, and commit `public/locales/<code>.json`. The manifest and switcher pick
it up automatically.
-## SEO note
+## SEO: hreflang alternates
+
+Copy swaps client-side (the LobeHub model), and each locale is reachable at a
+distinct URL via `?lang=<code>`, which `detectLocale()` honors. Search engines
+are told those translated URLs exist two ways, both driven off the manifest so
+they track annotation automatically:
-Runtime swap (the LobeHub model) is client-side. For per-locale indexable URLs,
-add `hreflang` alternates and a prerender step later; the catalogs are already
-static and ready for it.
+1. **Sitemap alternates.** `npm run build:pages` writes
+ [`public/locales/localized-pages.json`](../public/locales/localized-pages.json)
+ (every registered page whose HTML carries a `data-i18n` annotation). The
+ dynamic core sitemap ([`api/sitemap/[type].js`](../api/sitemap/%5Btype%5D.js))
+ reads it and emits an `<xhtml:link rel="alternate" hreflang>` per locale, plus
+ `x-default`, for exactly those routes.
+2. **On-page alternates.** The runtime injects `<link rel="alternate"
+ hreflang>` tags into `<head>` for the current path (default locale and
+ `x-default` at the bare URL, others at `?lang=xx`), so a page crawled
+ directly advertises its translations even without the sitemap.
+
+`<html lang>`/`dir` are set to the active locale on every swap. A build-time
+prerender that bakes each locale into static HTML (eliminating the first-paint
+English flash) is the natural next step; the catalogs are static and ready.
## Tests
@@ -31156,7 +35477,7 @@ round-trips, lint rules, runtime resolution/fallback, and catalog merge/prune.
---
-<a id="sec-125"></a>
+<a id="sec-152"></a>
> **Source:** `docs/ibm-x402-mcp.md` · [↑ table of contents](#table-of-contents)
@@ -31166,6 +35487,10 @@ round-trips, lint rules, runtime resolution/fallback, and catalog merge/prune.
> client can call IBM Granite foundation models and pay **per call in USDC** — no
> IBM Cloud account, no subscription, no API-key signup.
+In plain terms: this is a menu of IBM AI capabilities (chat, code, embeddings,
+document analysis, forecasting) that any agent or MCP client can use by paying a
+few cents per call from a crypto wallet it already controls.
+
Every AI agent needs three things: a **body** (its 3D avatar), a **brain**
(an LLM with memory), and a **wallet** (to pay for the jobs it runs). This is the
wallet half of the brain — three.ws is an **IBM Business Partner**, and this suite
@@ -31202,10 +35527,13 @@ agent can consume the moment it has USDC.
---
-## The five tools
+## The five paid tools (plus one free)
Each tool is independently priced. Prices are the source of truth in
-[`src/tools/`](../packages/ibm-x402-mcp/src/tools/) and mirrored here.
+[`packages/ibm-x402-mcp/src/tools/`](../packages/ibm-x402-mcp/src/tools/) and
+mirrored here. A sixth tool, `ibm_granite_getting_started`, is **free** (no
+payment, no wallet): it returns an overview of the suite, per-tool prices, and
+how the x402 payment flow works. It is the right first call for a new client.
| Tool | What it does | Model | Price |
|---|---|---|---|
@@ -31222,8 +35550,8 @@ Korean, Italian, Dutch, Chinese, Arabic, and Czech.
## Two transports, one tool suite
-The exact same five tools — identical schemas, prices, and output shapes — ship
-over two transports:
+The exact same tools (the free getting-started tool plus the five paid tools,
+identical schemas, prices, and output shapes) ship over two transports:
| Transport | Endpoint | For | Payment |
|---|---|---|---|
@@ -31360,6 +35688,12 @@ USDC or reach watsonx is useless, so it never silently degrades.
## Tool reference
+### `ibm_granite_getting_started` (free)
+
+No payment required. Returns the suite overview, per-tool pricing, setup
+requirements, and a walkthrough of the x402 payment flow. Optional `section`
+narrows the answer (for example `pricing`).
+
### `ibm_granite_chat` — $0.02
Conversational completion. Send an ordered array of role/content messages; get
@@ -31514,13 +35848,13 @@ Catalog/listing copy is maintained in
---
-<a id="sec-126"></a>
+<a id="sec-153"></a>
> **Source:** `docs/ibm.md` · [↑ table of contents](#table-of-contents)
# IBM watsonx & Granite
-three.ws agents think on **IBM Granite** foundation models, served through **IBM watsonx.ai**. This page documents the whole integration: which Granite models run where, how the watsonx client is wired, how to configure it, and the seven showcase surfaces that put it on screen — from a Granite-powered avatar brain to on-chain, Guardian-governed forecasts.
+three.ws agents can think on **IBM Granite** foundation models, served through **IBM watsonx.ai**. This page documents the whole integration for developers and operators: which Granite models run where, how the watsonx client is wired, how to configure it, and the Granite-powered API surfaces (from a Granite avatar brain to on-chain, Guardian-governed forecasts). The live IBM pages on the product are [three.ws/ibm/hello](https://three.ws/ibm/hello) (the partnership page) and [three.ws/ibm/x402-demo](https://three.ws/ibm/x402-demo) (the x402 live demo).
For the broader platform model see [How it works](./how-it-works.md); for the agent brain abstraction see [Agent system](./agent-system.md); for the standalone connector see [the MCP server](#mcp-server-three-wsibm-watsonx-mcp) below.
@@ -31530,11 +35864,11 @@ For the broader platform model see [How it works](./how-it-works.md); for the ag
three.ws is an **IBM Business Partner**, and the agent runtime runs on IBM watsonx.ai using your own IBM Cloud credentials.
-**The public showcase is not the partnership.** Everything under `/ibm/*` and `/api/ibm/*` — the galaxy, oracle, twin, trust-layer, identity, proof, and vision demos at [three.ws/ibm](https://three.ws/ibm) — is an independent set of tools three.ws built for developers to explore IBM Granite on watsonx.ai and build their own integrations. These demos are **not** official IBM partnership deliverables, **not** IBM products, and **not** endorsed by IBM. They run on IBM's publicly available Granite models, nothing more. Our formal partnership work with IBM is being built on the IBM platform and is not yet public — do not present these public demos as that work.
+**The public showcase is not the partnership.** Everything under `/api/ibm/*` and the related Granite APIs (galaxy, oracle, twin, attest, vision, the Guardian trust layer, the identity firewall) is an independent set of tools three.ws built for developers to explore IBM Granite on watsonx.ai and build their own integrations. The browser demo pages that used to live under `/ibm/*` (galaxy, oracle, twin, trust-layer, identity, proof, vision) have been retired from the product; their API endpoints remain live and are documented below. These tools are **not** official IBM partnership deliverables, **not** IBM products, and **not** endorsed by IBM. They run on IBM's publicly available Granite models, nothing more. Our formal partnership work with IBM is being built on the IBM platform and is not yet public. Do not present these public demos as that work.
Three things are deliberately kept distinct, and the docs say so plainly:
-- **The public showcase** (everything under `/ibm/*` and `/api/ibm/*`) is a community-built playground for developers, not a partnership deliverable or an IBM product.
+- **The public showcase** (the `/api/ibm/*` surfaces plus the two live pages, `/ibm/hello` and `/ibm/x402-demo`) is a community-built playground for developers, not a partnership deliverable or an IBM product.
- **The hosted integration** runs Granite models on watsonx.ai as part of the three.ws platform, using your own IBM Cloud credentials.
- **The open-source connector** — the npm package [`@three-ws/ibm-watsonx-mcp`](#mcp-server-three-wsibm-watsonx-mcp) — is community-built and not an IBM product. It speaks directly to the watsonx.ai REST API with your credentials; IBM does not operate or endorse it.
@@ -31544,15 +35878,15 @@ Do not describe the connector or the public demos as an official IBM release or
- **2026-06-18 — Co-marketing ramp-up.** Following a meeting on Monday (2026-06-15) and two separate IBM meetings today — one on the development side, one on the marketing side — three.ws and IBM are ramping up co-marketing. What's coming: more co-promotion on X from IBM, a dedicated three.ws page on the IBM domain, and a live IBM Community event (below). The dedicated page is not yet live and the partnership work lives on the IBM platform — distinct from the community-built public showcase under `/ibm/*`. Do not link to the page or present it as public until IBM ships it.
-### Upcoming event
+### Community event (held 2026-06-23)
**Building 3D AI Agents Live: From Prompt to Embeddable Agent in Minutes** — a live-build technical session in IBM's [Global AI & Data Science](https://community.ibm.com/community/user/events/event-description?CalendarEventKey=2767712c-6efd-47dc-aaeb-019ec4126e27&CommunityKey=f1c2cf2b-28bf-4b68-8570-b239473dcbbc) community, featuring a special guest from IBM.
-- **When:** 2026-06-23, 6:00–7:00 PM MT
+- **When:** held 2026-06-23, 6:00 to 7:00 PM MT
- **Where:** [IBM Community — Global AI & Data Science](https://community.ibm.com/community/user/events/event-description?CalendarEventKey=2767712c-6efd-47dc-aaeb-019ec4126e27&CommunityKey=f1c2cf2b-28bf-4b68-8570-b239473dcbbc)
- **Contact:** [email protected]
-The three.ws engineering team builds and ships a 3D, interactive, fully embeddable AI agent from a single text prompt, live: generate the agent from a prompt, embed it into any site as simply as a video, and wire it to real tools and data so it can take action — plus a look at the architecture behind frictionless deployment at scale. For developers, product builders, designers, and anyone exploring the next interface for AI beyond the chat box.
+The session: the three.ws engineering team built and shipped a 3D, interactive, fully embeddable AI agent from a single text prompt, live: generate the agent from a prompt, embed it into any site as simply as a video, and wire it to real tools and data so it can take action, plus a look at the architecture behind frictionless deployment at scale. Aimed at developers, product builders, designers, and anyone exploring the next interface for AI beyond the chat box.
### Press & coverage
@@ -31617,7 +35951,7 @@ Set these as environment variables (locally in `.env`, in production on the Clou
**For on-chain attestation (Granite Proof):** `AVATAR_WALLET_SECRET` — a Solana keypair used to notarize a governed forecast on-chain.
-To bypass Guardian gating in `/api/chat` during local development, set `WATSONX_GUARDIAN_DISABLE=true` (the gate is best-effort and fails open when Guardian itself is unconfigured).
+To bypass Guardian gating in `/api/chat` during local development, set `GUARDIAN_DISABLE=true`. The gate is best-effort: if a Guardian call fails at runtime the local dollar spend cap is still enforced on its own.
---
@@ -31625,17 +35959,17 @@ To bypass Guardian gating in `/api/chat` during local development, set `WATSONX_
watsonx Granite is a selectable **brain** for any three.ws agent, alongside the other providers. The chat proxy ([`api/chat.js`](../api/chat.js)) resolves watsonx auth headers lazily inside its failover loop and streams Granite's reply through the standard agent runtime, so a Granite-brained avatar speaks, emotes, and uses skills exactly like any other.
-Granite is selected when watsonx is configured and the agent/request routes to the watsonx provider; when it isn't configured, the provider reports unavailable and the runtime falls through to the next brain. Before an avatar takes an autonomous money action (e.g. sending SOL), the same request is run through Granite Guardian inline — see the Trust Layer next.
+Granite is selected when watsonx is configured and the request explicitly names the watsonx provider (it is never the silent default); when it isn't configured, the provider reports unavailable and the runtime falls through to the next brain. Before an avatar takes an autonomous money action (e.g. sending SOL), the same request is run through Granite Guardian inline, see the Trust Layer next.
---
## Trust Layer — Granite Guardian
-**Page:** [three.ws/ibm/trust-layer](https://three.ws/ibm/trust-layer) · **API:** `POST /api/guardian/assess` · **Lib:** [`api/_lib/granite-guardian.js`](../api/_lib/granite-guardian.js)
+**API:** `POST /api/guardian/assess` · **Lib:** [`api/_lib/granite-guardian.js`](../api/_lib/granite-guardian.js)
Granite Guardian is governance middleware, not a UI flourish. It sits between an agent's reasoning and its actions and classifies a message or a proposed autonomous action across named risks (jailbreak, harm, social bias, violence, profanity, sexual content, unethical behavior, and more) using the `ibm/granite-guardian-3-8b` model on watsonx.ai. Each risk is scored from the model's calibrated `Yes`/`No` log-probabilities, and the verdicts collapse to a single **allow / review / block** decision.
-It doesn't just flag — it **vetoes**. The same gate runs inline in `/api/chat` before an avatar sends value, and a `block` verdict refuses the action. Every verdict is written into a **tamper-evident, hash-chained audit ledger**: each record commits the prior record's hash, so the browser can re-verify the whole chain with SHA-256.
+It doesn't just flag: it **vetoes**. The same gate runs inline in `/api/chat` before an avatar sends value, and a `block` verdict refuses the action. Every verdict is written into a **tamper-evident, hash-chained audit ledger**: each record commits the prior record's hash, so any client can re-verify the whole chain with SHA-256.
```bash
curl -s https://three.ws/api/guardian/assess \
@@ -31664,14 +35998,14 @@ For autonomous sends, `governSend()` additionally enforces a per-period USD spen
## Granite Oracle — TimeSeries forecasting
-**Page:** [three.ws/ibm/oracle](https://three.ws/ibm/oracle) · **API:** `GET /api/ibm/oracle?token=<mint>` · **Lib:** [`api/_lib/watsonx-forecast.js`](../api/_lib/watsonx-forecast.js)
+**API:** `GET /api/ibm/oracle?token=<mint>` · **Lib:** [`api/_lib/watsonx-forecast.js`](../api/_lib/watsonx-forecast.js)
-The Oracle forecasts a live Solana token's price with Granite TimeSeries, renders the forecast as a 3D confidence cone, and has an embodied avatar narrate it. The pipeline is fully real:
+The Oracle forecasts a live Solana token's price with Granite TimeSeries and returns everything a client needs to render it (history, forward series, stats, narration, governance verdict). The pipeline is fully real:
-1. **Real candles.** Historical OHLCV comes from GeckoTerminal (keyless), so the chart always renders even without watsonx.
+1. **Real candles.** Historical OHLCV comes from GeckoTerminal (keyless), so the history is always returned even without watsonx.
2. **Granite forecast.** The history is sent to a `granite-ttm-*` model via the watsonx Time Series Forecasting API; the model returns the forward series.
-3. **Granite narration.** `granite-3-8b-instruct` writes a two-sentence read of the forecast, which the narrator avatar speaks.
-4. **Guardian governance.** The narration is run through Granite Guardian before it's spoken; the page shows the governance verdict as a badge.
+3. **Granite narration.** `granite-3-8b-instruct` writes a two-sentence read of the forecast.
+4. **Guardian governance.** The narration is run through Granite Guardian before it's returned; the response carries the governance verdict.
`GET /api/ibm/oracle?list=trending` returns trending Solana pools to seed the picker. The response carries `token`, `history`, `forecast`, `stats` (current/low/high/changePct/direction), `narration`, `governance`, and an `ibm` block reporting the forecast model and input window (or the real error reason when a step is unavailable).
@@ -31679,7 +36013,7 @@ The Oracle forecasts a live Solana token's price with Granite TimeSeries, render
## Granite Proof — auditable AI on a public ledger
-**Page:** [three.ws/ibm/proof](https://three.ws/ibm/proof) · **API:** `GET|POST /api/ibm/attest?token=<mint>`
+**API:** `GET|POST /api/ibm/attest?token=<mint>`
Proof takes a governed forecast and **notarizes it on Solana**. It forecasts with Granite TimeSeries, narrates with Granite chat, governs with Granite Guardian, hashes the resulting claim (SHA-256), and writes a compact proof memo on-chain as a 1-lamport SPL-memo transaction. If Guardian vetoes the narration, the agent **refuses to sign** — there is no proof for a statement that didn't pass governance.
@@ -31689,7 +36023,7 @@ Proof takes a governed forecast and **notarizes it on Solana**. It forecasts wit
## Digital Twin
-**Page:** [three.ws/ibm/twin](https://three.ws/ibm/twin) · **API:** `GET|POST /api/ibm/twin?token=<mint>`
+**API:** `GET|POST /api/ibm/twin?token=<mint>`
The Twin mirrors a live token's vitals (momentum, volatility, activity, liquidity, a "heartbeat" BPM) from on-chain OHLCV and projects its near future with Granite TimeSeries. It does two things forecasting alone can't:
@@ -31700,9 +36034,9 @@ The Twin mirrors a live token's vitals (momentum, volatility, activity, liquidit
## Agent Galaxy — semantic discovery with Granite embeddings
-**Page:** [three.ws/ibm/galaxy](https://three.ws/ibm/galaxy) · **API:** `GET /api/ibm/galaxy`, `POST /api/ibm/galaxy { query }`, `POST /api/watsonx/embed`
+**API:** `GET /api/ibm/galaxy`, `POST /api/ibm/galaxy { query }`, `POST /api/watsonx/embed`
-The Galaxy embeds every public agent with `granite-embedding-278m-multilingual`, projects the vectors into 3D with PCA, clusters them with k-means, and asks Granite chat to name each cluster. The result is a navigable 3D star-map where semantically similar agents sit near each other. A natural-language search ("a witty Solana trading assistant") embeds the query and flies the camera to the nearest agents by cosine similarity — meaning, not keywords.
+The Galaxy embeds every public agent with `granite-embedding-278m-multilingual`, projects the vectors into 3D with PCA, clusters them with k-means, and asks Granite chat to name each cluster. The result is a 3D star-map layout where semantically similar agents sit near each other. A natural-language search ("a witty Solana trading assistant") embeds the query and returns the nearest agents by cosine similarity: matching on meaning, not keywords.
The constellation is cached (keyed by a content hash of the agent set + model) so repeat visits are instant; `?refresh=1` forces a rebuild. The standalone embeddings endpoint, `POST /api/watsonx/embed`, exposes the same Granite vectors for your own semantic search or clustering:
@@ -31718,16 +36052,16 @@ It returns one vector per input (the response reports the model and its native `
## Identity Firewall — Granite embeddings + Guardian
-**Page:** [three.ws/ibm/identity](https://three.ws/ibm/identity) · **API:** `POST /api/agents/identity-check` · **Lib:** [`api/_lib/identity-integrity.js`](../api/_lib/identity-integrity.js)
+**API:** `POST /api/agents/identity-check` · **Lib:** [`api/_lib/identity-integrity.js`](../api/_lib/identity-integrity.js)
Every three.ws agent holds a Solana wallet and earns on-chain reputation — which makes impersonating a trusted agent a real economic attack. The Identity Firewall runs before any new agent identity is created and gates it with two Granite checks:
1. **Semantic impersonation detection.** The candidate name + description are embedded with `granite-embedding-278m-multilingual` and cosine-compared against every existing public agent. Similarity ≥ 93% to another owner's agent is treated as impersonation and the identity is blocked; 86–93% triggers a review warning with the nearest neighbours surfaced.
2. **Granite Guardian content screen.** The identity text is run through `granite-guardian-3-8b` and classified against `harm`, `social_bias`, and `sexual_content`. Any flagged risk blocks the identity from representing the platform.
-The endpoint is auth-optional: anonymous callers (including the public `/ibm/identity` demo) get impersonation detection against all public agents; authenticated callers also get their own agents included in the comparison so the editor can warn "you already have a similar agent."
+The endpoint is auth-optional: anonymous callers get impersonation detection against all public agents; authenticated callers also get their own agents included in the comparison so the editor can warn "you already have a similar agent."
-When watsonx is unconfigured the response returns `{ configured: false, status: "unavailable" }` and the identity is allowed (fail-open) — the page surfaces a clear "not configured" state rather than a fake verdict.
+When watsonx is unconfigured the response returns `{ configured: false, status: "unavailable" }` and the identity is allowed (fail-open), callers get a clear "not configured" state rather than a fake verdict.
```bash
curl -s https://three.ws/api/agents/identity-check \
@@ -31751,11 +36085,11 @@ curl -s https://three.ws/api/agents/identity-check \
## Granite Vision
-**Page:** [three.ws/ibm/vision](https://three.ws/ibm/vision) · **API:** `GET|POST /api/ibm/vision`
+**API:** `GET|POST /api/ibm/vision`
Granite Vision is the multimodal eye of the suite. Show it a rendered 3D avatar (or any image) and `ibm/granite-vision-3-2-2b` reads the look and returns a complete agent identity — appearance, vibe, persona, a suggested name, a one-line bio, tone tags, and a fitting voice descriptor — in a single multimodal call. Turn a face into an agent.
-- `GET /api/ibm/vision` returns a handful of real public avatars so the demo works for anonymous visitors with no upload.
+- `GET /api/ibm/vision` returns a handful of real public avatars so anonymous callers can try it with no upload.
- `POST` accepts either an `image` data URL (a client canvas capture or uploaded file, capped at 6 MB) or an `imageUrl` the server fetches. Server-side fetches are **SSRF-allowlisted** to the platform's own asset host and a small set of content-addressed media CDNs (IPFS, Arweave, Pinata, GitHub) — never an arbitrary host — with a byte cap and timeout, so the endpoint can't be turned into an internal-network probe.
---
@@ -31782,18 +36116,27 @@ It reads the same `WATSONX_*` environment variables documented above. See the [M
---
-## Showcase routes
+## Live pages and API surfaces
+
+The two live IBM pages on the product:
| Route | What it is |
| -------------------------------------------------------- | ---------------------------------------------------------------- |
-| [`/ibm`](https://three.ws/ibm) | The hub — overview of the integration and links to every surface |
-| [`/ibm/galaxy`](https://three.ws/ibm/galaxy) | Semantic 3D agent star-map (Granite embeddings) |
-| [`/ibm/oracle`](https://three.ws/ibm/oracle) | Granite TimeSeries forecast, narrated by an avatar |
-| [`/ibm/twin`](https://three.ws/ibm/twin) | Digital Twin — back-test + what-if simulation |
-| [`/ibm/trust-layer`](https://three.ws/ibm/trust-layer) | Granite Guardian governance + audit ledger |
-| [`/ibm/identity`](https://three.ws/ibm/identity) | Identity Firewall — Granite embeddings + Guardian impersonation gate |
-| [`/ibm/proof`](https://three.ws/ibm/proof) | Governed forecast notarized on Solana |
-| [`/ibm/vision`](https://three.ws/ibm/vision) | Granite Vision reads an avatar into an identity |
+| [`/ibm/hello`](https://three.ws/ibm/hello) | The IBM and three.ws partnership page |
+| [`/ibm/x402-demo`](https://three.ws/ibm/x402-demo) | Live x402 micropayment demo built with IBM |
+
+The Granite demo pages that used to live under `/ibm/*` (galaxy, oracle, twin, trust-layer, identity, proof, vision) were retired from navigation and removed. Their API endpoints remain live and callable:
+
+| Endpoint | What it does |
+| -------------------------------------------------------- | ---------------------------------------------------------------- |
+| `GET/POST /api/ibm/galaxy` | Semantic agent star-map layout (Granite embeddings) |
+| `GET /api/ibm/oracle` | Granite TimeSeries forecast + narration + governance |
+| `GET/POST /api/ibm/twin` | Digital Twin: back-test + what-if simulation |
+| `POST /api/guardian/assess` | Granite Guardian governance + audit ledger |
+| `POST /api/agents/identity-check` | Identity Firewall: Granite embeddings + Guardian impersonation gate |
+| `GET/POST /api/ibm/attest` | Governed forecast notarized on Solana |
+| `GET/POST /api/ibm/vision` | Granite Vision reads an avatar into an identity |
+| `POST /api/watsonx/embed` | Standalone Granite embedding vectors |
---
@@ -31824,7 +36167,281 @@ Unit tests for the same paths live in [`tests/`](../tests/) (`granite-oracle`, `
---
-<a id="sec-127"></a>
+<a id="sec-154"></a>
+
+> **Source:** `docs/image-to-3d.md` · [↑ table of contents](#table-of-contents)
+
+# Image to 3D: turn a photo into a downloadable 3D model
+
+Image to 3D is Forge's photo lane, opened directly. Drop in one to four photos of an object, taken from different angles, and get back a textured, downloadable GLB you can orbit, view in AR, and take into any engine. It is the fastest way to go from a real thing on your desk, or a single reference image, to a real 3D model, with no account and no key on the free lane.
+
+Page: [/image-to-3d](https://three.ws/image-to-3d) · API: `/api/forge`
+
+## Why it exists
+
+Text-to-3D is great when you can describe a thing. But often you already have the thing, or a picture of it: a prop, a toy, a piece of furniture, a product shot. Reconstructing geometry from photos preserves the real proportions and surface that a text prompt can only approximate. Image to 3D gives that reconstruction its own entry point so a first-time visitor lands directly in photo mode instead of hunting for the tab, while everything else, the engine grid, the tiers, the live health status, the downloadable GLB, is the same Forge machinery underneath.
+
+/ image-to-3d and [/forge](https://three.ws/forge) are the same application (`pages/forge.html`, driven by `src/forge.js`). The `/image-to-3d` route sets the page into photo mode and retitles it; the app is otherwise identical, so any engine, tier, or export you can reach from Forge you can reach here.
+
+## How it works
+
+When you add photos, the app switches to the `image` (image-intermediate) generation path. Each photo is uploaded straight to object storage through a presigned URL (`/api/forge-upload`), and the resulting public URLs are POSTed to `/api/forge` as `image_urls`. With more than one view the backend fuses them with multi-view conditioning, so the reconstructed mesh honors detail from every angle you supplied rather than guessing the unseen sides from a single frame.
+
+Routing is free-first and health-aware, exactly as in Forge. Because the free NVIDIA NIM TRELLIS lane is text-only (it rejects user images), photo submissions filter it out and fall to the free reconstruction chain in `api/_lib/forge-tiers.js`, most preferred first:
+
+1. **TRELLIS (self-host)**, our own Cloud Run GPU worker, a native single-hop image-to-3D lane (image to TRELLIS to GLB), zero vendor cost.
+2. **Hunyuan3D (self-host)**, our own high-poly reconstruction worker, strong on people and organic subjects.
+3. **Hunyuan3D / TRELLIS (free)** on Hugging Face Spaces, with automatic failover across Hunyuan3D 2.1, Hunyuan3D 2, TRELLIS, and TripoSR.
+
+Paid and BYOK image engines stay explicitly selectable: **Meshy 6**, **Tripo v3.1**, **Rodin (Hyper3D)**, **Stable Fast 3D** (Stability), the **Replicate** TRELLIS lane, and your own Replicate account. A lane whose upstream is down is disabled in the engine picker with the real reason, and a selected engine that can't accept photos bounces to the standing photo default rather than failing after you commit.
+
+The result is a job: the client polls `GET /api/forge?job=<id>` until the GLB lands, and an interrupted generation resumes from the same browser for 30 minutes. Every result reports the path, tier, and backend that produced it.
+
+### Objects and props, not faces
+
+Image to 3D reconstructs whole objects: a prop, a product, a toy, a sculpture, a piece of hardware. It is not a face-to-avatar pipeline. To turn a selfie into a rigged, animation-ready humanoid avatar, use the dedicated face reconstruction flow at [/create/selfie](https://three.ws/create/selfie), which runs a purpose-built face pipeline (head framing, identity preservation, rig) rather than general object reconstruction. Feeding a headshot into the general image lane treats the head as an object and will not produce a rigged avatar.
+
+## Walkthrough
+
+1. Open [/image-to-3d](https://three.ws/image-to-3d). The page opens in photo mode.
+2. Add one to four photos of the same object. For best results shoot the same object from different angles (front, side, back, three-quarter) on a plain background.
+3. Optionally pick a tier (Draft, Standard, High) and an engine. The default free reconstruction lane carries a **FREE** pill; down lanes are disabled with a reason.
+4. Click Generate. A real elapsed-driven progress line runs against the ETA for the resolved engine and tier; a cold self-host worker adds an honest spin-up estimate.
+5. When the model lands, orbit it, view it in AR, download the GLB, or run the post-generation tools (stylize, optimize, Game-Ready retopology).
+
+## Examples
+
+Send public image URLs to the same `/api/forge` endpoint. No key is required on the free lane.
+
+```bash
+# Multi-view reconstruction from three angles, standard tier, then poll. A lane
+# that completes inline answers the POST with status "done", a glb_url, and a
+# null job_id; otherwise you get a job_id to poll until "done" or "failed".
+RESP=$(curl -s -X POST 'https://three.ws/api/forge' \
+ -H 'content-type: application/json' \
+ -d '{"image_urls":["https://…/front.jpg","https://…/side.jpg","https://…/back.jpg"],"tier":"standard"}')
+echo "$RESP" | python3 -c 'import sys,json;j=json.load(sys.stdin);print(j.get("glb_url") or j["job_id"])'
+
+curl "https://three.ws/api/forge?job=<JOB_ID>"
+```
+
+Single-image reconstruction is just one URL:
+
+```bash
+curl -X POST 'https://three.ws/api/forge' \
+ -H 'content-type: application/json' \
+ -d '{"image_urls":["https://…/sneaker.jpg"],"tier":"draft"}'
+```
+
+Poll until the GLB is ready in JavaScript:
+
+```javascript
+const start = await fetch('https://three.ws/api/forge', {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({ image_urls: ['https://…/chair.jpg'], tier: 'standard' }),
+}).then((r) => r.json());
+
+let job = start;
+while (job.status !== 'done' && job.status !== 'failed') {
+ await new Promise((r) => setTimeout(r, 4000));
+ job = await fetch(`https://three.ws/api/forge?job=${start.job_id}`).then((r) => r.json());
+}
+console.log(job.glb_url);
+```
+
+## States and limits
+
+- **Up to four views** per generation; more views mean tighter multi-view fusion.
+- **Free lane** requires no account. The **High tier** is $THREE hold-or-pay gated (quality gate, not vendor-cost recovery); a verified $THREE pass also lifts the free-lane quota.
+- **Loading**: real elapsed counter; cold GPU workers surface an honest spin-up estimate.
+- **Down or unconfigured engine**: disabled with the real reason, or a clean `backend_unconfigured` error. No mock output, ever.
+- **Resume**: an interrupted job is pollable again for 30 minutes from the same browser.
+- **Objects, not faces**: for a rigged humanoid from a selfie, use [/create/selfie](https://three.ws/create/selfie).
+- Uploads cap at 8 MB per image; rate limits are per client IP.
+
+## Related
+
+- [Forge](./forge.md) is the full text-and-image-to-3D surface with every mode and engine.
+- [Avatar reconstruction](./avatar-reconstruction.md) and [avatar creation](./avatar-creation.md) cover the face-to-avatar pipeline behind [/create/selfie](https://three.ws/create/selfie).
+- The pipeline internals: [3D asset pipeline](./3d-asset-pipeline.md), [3D pipeline](./3d-pipeline.md), [3D API](./3d-api.md).
+- Pages: [/create](https://three.ws/create), [/scene](https://three.ws/scene) (Scene Studio), [/gallery](https://three.ws/gallery).
+
+---
+
+<a id="sec-155"></a>
+
+> **Source:** `docs/integrations.md` · [↑ table of contents](#table-of-contents)
+
+# Integrations: drop-in 3D agents for any site
+
+Integrations is the catalog of ways to put a three.ws agent on a website you do not
+control the runtime of. One script tag gives any page a 3D avatar viewer, a talking
+chat agent, a walk companion that roams the corner of the screen, a page narrator, a
+live token market widget, or an MCP server that lets Claude and other AI tools drive
+your agents. Every option is a paste-in snippet with no backend to run.
+
+Page: [/integrations](https://three.ws/integrations)
+
+## Why it exists
+
+The platform's agents are only as useful as the places they can appear. Integrations
+is the distribution layer: it turns an agent, a saved widget, or a live token feed
+into something a marketer can paste into a CMS, a developer can wire into a framework,
+or an AI assistant can call as a tool. It is the front page of embedding; the deep
+per-method references live in [Embedding](./embedding.md) and [Widgets](./widgets.md),
+and this doc is the map that points you to the right one.
+
+## How it works
+
+Every integration is a static, self-contained snippet loaded from three.ws. The
+avatar, chat, and token widgets share one loader (`/embed.js`) that upgrades custom
+elements or `data-widget` script tags into live iframes or web components. The walk
+companion and page narrator ship their own small SDKs. Nothing needs an API server on
+your side; the agent runtime, rendering, and (for chat) the model calls all run on
+three.ws.
+
+The catalog covers six integration types:
+
+- **Avatar Viewer**: a `<threews-avatar>` web component that renders a rigged 3D
+ avatar with optional JS control (`play('wave')`, poses, `hide-chrome`).
+- **Talking Chat Agent**: a saved widget that renders a 3D agent which listens,
+ answers, and speaks, driven by a `data-widget` id from [Widget Studio](https://three.ws/widgets).
+- **Walk Companion**: a floating 3D character fixed to a corner of the page that
+ walks, gestures, and speaks, loaded from `/walk-embed-sdk.js`.
+- **Page Narrator**: an agent that reads and narrates the page it lives on, shipped as
+ the `@three-ws/page-agent` package.
+- **Token Market Widget**: a live pump.fun-style token feed rendered as a widget,
+ driven by a `data-widget` id and the `pumpfun-feed` type.
+- **MCP Integration**: the `@three-ws/avatar-agent` server (from the
+ `packages/avatar-agent-mcp` workspace), so Claude, Cursor, or any MCP-compatible
+ assistant can render, speak, gesture, and emote your agents. See [MCP](./mcp.md).
+
+## Walkthrough
+
+1. **Open [/integrations](https://three.ws/integrations).** Filter the catalog by type
+ (avatar, chat, companion, narrator, token, MCP).
+2. **Try the live demo.** Each card has a working preview and a Try Live button that
+ opens the real embed in a modal.
+3. **Copy the snippet.** Every card exposes its exact paste-in code.
+4. **Swap in your ids.** Replace the demo widget or avatar id with your own from
+ [Widget Studio](https://three.ws/widgets).
+5. **Paste it into your site.** Drop the snippet anywhere in your HTML, CMS block, or
+ framework component.
+
+## Examples
+
+Avatar Viewer (web component):
+
+```html
+<!-- Load once -->
+<script src="https://three.ws/embed.js" defer></script>
+
+<!-- Drop anywhere in your HTML -->
+<threews-avatar avatar-id="avatar_demo_disk_cz" hide-chrome pose="idle"></threews-avatar>
+
+<!-- Optional: JS control -->
+<script>
+ const el = document.querySelector('threews-avatar');
+ await el.ready;
+ el.play('wave');
+</script>
+```
+
+Talking Chat Agent (saved widget):
+
+```html
+<script
+ src="https://three.ws/embed.js"
+ data-widget="wdgt_demo_talking"
+ data-type="talking-agent"
+ defer
+></script>
+<!-- Replace wdgt_demo_talking with your widget ID from three.ws/widgets -->
+```
+
+Walk Companion:
+
+```html
+<script
+ src="https://three.ws/walk-embed-sdk.js"
+ data-avatar="avatar_demo_disk_cz"
+ data-position="bottom-right"
+ data-env="studio"
+ defer
+></script>
+```
+
+Page Narrator:
+
+```html
+<script
+ src="https://cdn.jsdelivr.net/npm/@three-ws/page-agent/dist/page-agent.global.js"
+ data-page-agent
+ data-avatar="nova"
+ data-auto-narrate
+ defer
+></script>
+```
+
+Token Market Widget:
+
+```html
+<script
+ src="https://three.ws/embed.js"
+ data-widget="wdgt_demo_pumpfun"
+ data-type="pumpfun-feed"
+ data-width="420"
+ data-height="600"
+ defer
+></script>
+```
+
+MCP Integration (`claude_desktop_config.json`):
+
+```json
+{
+ "mcpServers": {
+ "avatar-agent": {
+ "command": "npx",
+ "args": ["-y", "@three-ws/avatar-agent"]
+ }
+ }
+}
+```
+
+The core 3D tools (`inspect_glb`, `validate_glb`, `optimize_glb`, `thumbnail_glb`,
+`viewer_url`) and `pump_snapshot` work with no environment variables. Voice,
+generation, and signing tools take their own provider keys via `env` (for example
+`SOLANA_RPC_URL`, `OPENAI_API_KEY`, `REPLICATE_API_TOKEN`); see the package README
+for the full table.
+
+## States and limits
+
+- **Get your own ids.** Demo ids in the snippets are live examples. Create your own
+ avatars and widgets in [Widget Studio](https://three.ws/widgets) and swap them in.
+- **Self-contained by design.** The embeds run entirely off three.ws; you host no
+ backend. The chat and token widgets make their model and data calls server-side.
+- **One loader, many widgets.** `/embed.js` can be loaded once and drive multiple
+ avatar, chat, and token embeds on the same page.
+- **MCP keys are per-tool.** The `@three-ws/avatar-agent` server needs no key for its
+ core 3D tools; voice, generation, and signing tools each read their own provider
+ key from the environment. The embeds are public and need no key.
+- **Deeper control lives elsewhere.** This page is the catalog. For the full web
+ component API, iframe and oEmbed options, CSS, and events, use the references below
+ rather than duplicating them here.
+
+## Related
+
+- [Embedding Guide](./embedding.md): the full per-method reference (web component, iframe, oEmbed)
+- [Widget Types](./widgets.md): every widget type and how to configure one
+- [Embody](./embody.md): giving an agent a body in more contexts
+- [MCP](./mcp.md): the avatar MCP server for AI assistants
+- Pages: [/integrations](https://three.ws/integrations), [/widgets](https://three.ws/widgets)
+
+---
+
+<a id="sec-156"></a>
> **Source:** `docs/introduction.md` · [↑ table of contents](#table-of-contents)
@@ -31893,7 +36510,7 @@ The avatar is the 3D model that visually represents the agent. It is a glTF 2.0
### Skill
-A skill is a modular capability bundle installed into an agent. Each skill has a manifest of its own, a set of tools exposed to the LLM, and optional scene hooks. Built-in examples include `wave` (plays a wave animation), `validate-model` (runs the glTF validator on the loaded body), and `sign-action` (performs a scoped on-chain action via a delegation). Skills are loaded lazily from relative paths, IPFS CIDs, or HTTPS URLs, and fire a `skill:loaded` event when ready. The host page can install or uninstall skills at runtime via the JS API.
+A skill is a modular capability bundle installed into an agent. Each skill has a manifest of its own, a set of tools exposed to the LLM, and optional scene hooks. Built-in examples include `greet` (waves at the user with a wave animation), `validate-model` (runs the glTF validator on the loaded body), and `sign-action` (performs a scoped on-chain action via a delegation). Skills are loaded lazily from relative paths, IPFS CIDs, or HTTPS URLs, and fire a `skill:loaded` event when ready. The host page can install or uninstall skills at runtime via the JS API.
### Widget
@@ -32050,7 +36667,7 @@ If you want to look at what's already in the hosted platform — browsing agents
---
-<a id="sec-128"></a>
+<a id="sec-157"></a>
> **Source:** `docs/irl.md` · [↑ table of contents](#table-of-contents)
@@ -32086,16 +36703,24 @@ Everything below is live on [/irl](/irl) and exposed by the [`@three-ws/irl`](ht
Open /irl on your phone, pick one of your agents (or try it anonymously), and drop a pin:
-- **Place in AR** is the flagship path on devices with a real AR surface. On Chrome for Android (ARCore) a WebXR hit-test reticle finds the floor; tap to anchor the agent to the detected surface, then **pinch with two fingers to resize it** — from a desk figurine (25%) to a statue (400%). The placement and the chosen size both save to the pin, so everyone nearby sees the agent exactly where and how big you left it. On iOS the same button opens the agent in ARKit Quick Look. This button leads the dock whenever the device supports it.
-- **Pin here** places it at your current GPS spot using the camera and gyroscope. Works on every supported phone, including iOS Safari.
+- **Place in AR** is the flagship path on devices with a real AR surface. On Chrome for Android (ARCore) a WebXR hit-test reticle finds the floor; tap to anchor the agent to the detected surface, then **pinch with two fingers to resize it** — from a desk figurine (25%) to a statue (400%). The placement and the chosen size both save to the pin, so everyone nearby sees the agent exactly where and how big you left it. On iOS the same button opens the agent in ARKit Quick Look **with its idle animation baked into the USDZ**, so it breathes and sways in your room instead of standing in a frozen pose. Quick Look is Apple's sealed viewer (no page UI can live inside it), but its one sanctioned hook is wired: a banner at the bottom names the agent, and tapping it hands you back to /irl with **Pin here** pulsing, so the spot you liked in AR becomes a durable pin in one tap. Apple's native pinch-to-resize works inside Quick Look too, though that size is per-session: the size everyone else sees is the pin's saved one. This button leads the dock whenever the device supports it.
+- **Pin here** places it at your current GPS spot using the camera and gyroscope. Works on every supported phone, including iOS Safari. Same two-finger pinch as the WebXR path resizes it (25%–400%), before or after placing, and the size saves to the pin so nearby viewers see it exactly as big as you left it.
- **Place on map** puts an agent somewhere you are not currently standing.
Anonymous pins work immediately from a device token and expire after 7 days. Signed-in pins are permanent until you remove them. The full walkthrough is in [Place a 3D agent in your real environment](/docs/tutorials/place-agent-irl).
+/irl also accepts an inbound avatar: opening `/irl?avatar=<glbUrl>` loads that
+rigged GLB directly as the companion. This is the **Bring it to life** handoff
+from the [AR launch page](./ar.md) (`GET /api/ar?…&kind=avatar`) and the
+`irlUrl` returned by the avatar-producing studio tools, and an explicit
+`?avatar=` always wins over a saved session.
+
### Discover by walking up
Standing near a pinned agent, you check in: your live GPS fix mints a short-lived proof-of-presence token, and the nearby feed answers only for the small area that token was minted in (40 m radius by default, 60 m maximum, at most 50 pins). Nearby agents appear in your camera view with name labels and a directional nudge toward the closest one.
+Every discovered agent is alive in the camera view, not a statue: any humanoid avatar plays the platform idle clip, retargeted onto its own skeleton on the spot (Mixamo, VRM, and every other rig the universal retargeter maps), each one breathing at its own phase. Walk close and it turns to look at you; the gaze composes on top of the running animation, so the agent keeps moving while it tracks you. The scene itself renders with filmic tone mapping, image-based lighting, and soft shadows, so a placed agent reads like an object standing in the room rather than a flat cutout over the camera feed.
+
### Interact and pay
Tapping an agent opens its inspect card:
@@ -32105,6 +36730,10 @@ Tapping an agent opens its inspect card:
- **leave a message** that lands in the owner's IRL feed
- **view profile** to open its full agent page
+### Share a placement
+
+The **Share** button captures your camera feed and the placed agent as one photo, then, if you're the one who placed the pin, turns it into a permanent link at `three.ws/irl/s/<token>` instead of a bare file. Paste that link into X, iMessage, or Discord and it unfurls as the actual photo, with a "Place your own agent" button back to /irl. The link never carries a coordinate: only the agent's name and caption (if any) ever appear on the card, and it only exists for pins you left public — unpublishing a pin, or a pin under moderation review, is never shareable. If you tap Share before placing anything (no pin yet), it falls back to the plain native share sheet / photo download, same as before.
+
## Money Drops
Real value, escrowed at a real-world spot. A drop holds SOL, USDC, or $THREE in a fresh per-drop escrow wallet, funded on-chain by its creator. Claiming requires physically walking up: the same presence proof that gates every IRL read gates the claim, and the release lands on-chain in the claimer's own wallet. Drops can require a quiz answer, support multiple claims, and auto-refund the creator on expiry.
@@ -32133,17 +36762,25 @@ The user-facing summary lives at [/irl-privacy](/irl-privacy); the engineering a
---
+## Analytics
+
+/irl now has a real usage baseline. `api/_lib/irl-analytics.js` logs four events into `irl_events`: `pin_created` (tagged with the placement method: `webxr`, `quicklook`, camera `pin`, or `map`), `nearby_fetch`, `share_created`, and `share_viewed`. It is an append-only table that never stores a raw coordinate or device token (only a ~150m geocell and a 16-char hashed device prefix, matching the same coarsening the rest of IRL already uses). Events age out after 90 days via the existing hourly reaper ([api/cron/irl-reap.js](/api/cron/irl-reap.js)), the same bounded-retention discipline as the interaction trail.
+
+The rollup is served at `GET /api/irl/analytics` (admin-gated, same `x-ops-secret` credential as [/admin/ops](/admin/ops)) and rendered at **[/admin/irl-analytics](/admin/irl-analytics)**: pins placed and unique placers/browsers over 24h/7d/30d, a placement-method breakdown, the existing interaction (view/tap/message/pay) and confirmed Money Drop counts, share creation/view volume, and a 30-day daily sparkline. Every number is a live query — nothing cached, sampled, or estimated.
+
+---
+
## Build on it
- **SDK:** [`@three-ws/irl`](https://www.npmjs.com/package/@three-ws/irl) on npm. Zero-dependency client for check-in, pins, the nearby feed, interactions, Money Drops, and World Lines. Node 18+ and the browser.
-- **REST API:** the [IRL API reference](/docs/api-reference) covers `/api/irl/*`: presence, pins, drops, world lines.
+- **REST API:** the [IRL API reference](/docs/api-reference) covers `/api/irl/*`: presence, pins, drops, world lines, shareable pin cards (`POST /api/irl/share`), and the admin analytics rollup (`GET /api/irl/analytics`).
- **Make the body:** generate an avatar with the [free 3D lane](/docs/tutorials/text-to-3d) or [`@three-ws/forge`](https://www.npmjs.com/package/@three-ws/forge), render it with [`@three-ws/avatar`](https://www.npmjs.com/package/@three-ws/avatar).
- **Hands-on:** [Place a 3D agent in your real environment](/docs/tutorials/place-agent-irl), a phone-only tutorial from first camera frame to a discoverable pin.
- **Context:** [Live worlds, social and IRL](/docs/agent-abilities/chapters/12-live-worlds-social-irl) situates IRL inside the rest of the platform's presence layer.
---
-<a id="sec-129"></a>
+<a id="sec-158"></a>
> **Source:** `docs/irl/THREAT-MODEL.md` · [↑ table of contents](#table-of-contents)
@@ -32278,13 +36915,13 @@ in a way that drops legitimate discovery, update this file in the same change.
---
-<a id="sec-130"></a>
+<a id="sec-159"></a>
> **Source:** `docs/js-api.md` · [↑ table of contents](#table-of-contents)
# JavaScript API Reference
-Complete reference for all public classes, methods, and properties exported by the three.ws web component bundle (`agent-3d.js`).
+This page documents the internal JavaScript classes behind the three.ws viewer: the `App` controller, the Three.js `Viewer`, the glTF `Validator`, and the small components that render around them. It is aimed at developers reading or extending the source (`src/`), and at anyone driving the viewer from the browser console via `window.VIEWER`. If you just want a 3D agent on your page, use the [`<agent-3d>` element](./web-component.md) instead.
> For the HTTP/REST surface, see [api-reference.md](./api-reference.md). For the high-level npm SDK, see [sdk.md](./sdk.md). For the `<agent-3d>` element attributes, see [web-component.md](./web-component.md).
@@ -32456,7 +37093,7 @@ The constructor:
### State Object
-The `this.state` object holds all GUI-controllable values:
+The `this.state` object holds all GUI-controllable values. The core fields:
```javascript
{
@@ -32470,20 +37107,27 @@ The `this.state` object holds all GUI-controllable values:
grid: false, // Grid + axes visibility
autoRotate: false, // Auto-rotate orbit
- // Lighting
+ // Lighting: studio three-point rig (key + fill + rim) with the
+ // Khronos PBR-Neutral tone mapper
punctualLights: true, // App-provided lights enabled
exposure: 0.0, // Exposure compensation (EV)
- toneMapping: LinearToneMapping, // Tone mapping mode
- ambientIntensity: 0.3, // Ambient light intensity
+ toneMapping: NeutralToneMapping, // Tone mapping mode
+ ambientIntensity: 0.45, // Ambient light intensity
ambientColor: '#FFFFFF', // Ambient light color
- directIntensity: 0.8 * Math.PI, // Directional light intensity
- directColor: '#FFFFFF', // Directional light color
- bgColor: '#191919', // Background color
+ directIntensity: 0.8 * Math.PI, // Key light intensity
+ directColor: '#FFFFFF', // Key light color
+ fillRatio: 0.4, // Fill light, relative to directIntensity
+ rimRatio: 0.55, // Rim light, relative to directIntensity
+ environmentIntensity: 1.15, // IBL strength
+ bgColor: '#000000', // Background color
+ transparentBg: false, // Transparent canvas background
pointSize: 1.0, // Point cloud vertex size
}
```
+Additional fields (info overlay, follow mode, cinematic presets) live in the same object; see `src/viewer.js` for the full set.
+
### Methods
#### `animate(time: number)`
@@ -32562,7 +37206,7 @@ Synchronizes light state with the GUI:
#### `addLights()`
-Creates and adds the ambient + directional light pair (or a single hemisphere light in asset generator mode).
+Creates and adds the studio light rig: an ambient light plus a three-point directional setup (key, fill, rim) and a shadow-casting sun (or a single hemisphere light in asset generator mode). Implemented in `src/viewer/lights.js`.
#### `removeLights()`
@@ -32892,7 +37536,16 @@ window.VIEWER.app.viewer.updateDisplay();
---
-<a id="sec-131"></a>
+## Related
+
+- [Web Component](/docs/web-component): the `<agent-3d>` element built on these classes
+- [SDK & Library](/docs/sdk): importing `Viewer`, `Runtime`, and friends from the lib build
+- [Widget API](/docs/widget-api): driving the embeddable widget shell over JSON-RPC
+- [Architecture overview](/docs/architecture): how the folders fit together
+
+---
+
+<a id="sec-160"></a>
> **Source:** `docs/labor-market.md` · [↑ table of contents](#table-of-contents)
@@ -32997,7 +37650,7 @@ economy move:
---
-<a id="sec-132"></a>
+<a id="sec-161"></a>
> **Source:** `docs/launch-usecases.md` · [↑ table of contents](#table-of-contents)
@@ -33133,7 +37786,7 @@ GET /api/pump/launch-studio?action=preview&id=github-fresh-breakouts&limit=6
---
-<a id="sec-133"></a>
+<a id="sec-162"></a>
> **Source:** `docs/layers.md` · [↑ table of contents](#table-of-contents)
@@ -33191,7 +37844,7 @@ Concretely:
- `viewer.content` / `viewer.scene` / `viewer.mixer`
- `viewer.animationManager` — external clip lazy-loading
-If you only need a glTF viewer with no AI, importing `@three-ws/avatar` gives you this layer with a clean programmatic API (`loadAvatar()`, `playAnimation()`, etc.). The hosted Turntable and Animation Gallery widgets at `/w/<id>` are also pure viewer-layer.
+If you only need a glTF viewer with no AI, the [`@three-ws/avatar`](https://www.npmjs.com/package/@three-ws/avatar) package gives you this layer as a lightweight `<three-ws-viewer>` element (plus an `AvatarCreator` iframe modal and React bindings). The hosted Turntable and Animation Gallery widgets at `/w/<id>` are also pure viewer-layer.
---
@@ -33231,7 +37884,7 @@ Modules:
- **`agent-identity.js`** — the passport + diary. Stable agent ID, owner address, signed action history. Backed by `localStorage` (cache) and `/api/agents/<id>` (canonical). Listens on the protocol bus and POSTs `speak` / `skill-done` / `validate` / `sign` events to `/api/agent-actions`.
- **`memory/`** — `local`, `ipfs`, `encrypted-ipfs`, or `none`. Declared on the manifest.
- **`erc8004/`** — on-chain registries. `IdentityRegistry` (mints agent token with `tokenURI`), `ReputationRegistry` (signed feedback), `ValidationRegistry` (validation report hashes). Per-chain addresses in `erc8004/abi.js`.
-- **`solana-agent/`** — Solana counterpart. Metaplex Core asset mint + Solana Attestation Service (SAS) attestations.
+- **`erc8004/solana-deploy.js`**: Solana counterpart. Metaplex Core asset mint; SPL Memo attestations and reputation live server-side (see [Agent Reputation on Solana](./solana-reputation.md)).
- **`auth/` + `wallet/`** — SIWE / SIWS for backend mutations; Privy for email/social → embedded wallet onboarding; session cookies after wallet proof.
Per-chain registry addresses, ABIs, and helpers ship as `@three-ws/sdk`. ENS attestations are also handled here — see [register-onchain.md](./tutorials/register-onchain.md).
@@ -33246,9 +37899,9 @@ Per-chain registry addresses, ABIs, and helpers ship as `@three-ws/sdk`. ENS att
Modules:
-- **`element.js`** — `<agent-3d>` custom element. Lazy-boots via `IntersectionObserver` (unless `eager`). Enforces origin allowlist. Exposes attributes for `body`, `brain`, `agent-id`, `manifest`, `mode` (`inline` / `floating` / `section` / `fullscreen`), `voice`, and more. Public methods: `say()`, `ask()`, `installSkill()`, `expressEmotion()`, `play()`, `lookAt()`, `dispose()`.
-- **`agent-stage.js`** — `<agent-stage>` for hosting multiple agents in one shared scene. See [multi-agent.md](./multi-agent.md).
-- **`widget-types.js`** — the five widget variants: Turntable, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour.
+- **`element.js`**: `<agent-3d>` custom element. Lazy-boots via `IntersectionObserver` (unless `eager`). Enforces origin allowlist. Exposes attributes for `body`, `brain`, `agent-id`, `manifest`, `mode` (`inline` / `floating` / `section` / `fullscreen`), `voice`, and more. Public methods: `say()`, `ask()`, `installSkill()`, `expressEmotion()`, `play()`, `lookAt()`, `pause()`, `destroy()`.
+- **`stage-element.js`**: `<agent-stage>` for hosting multiple agents in one shared scene. See [multi-agent.md](./multi-agent.md).
+- **`widget-types.js`**: the ten widget variants: Turntable, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour, Pump.fun Live Feed, Smart Money Feed, Live Trades Canvas, Bonding Curve, Walking Avatar.
- **`lib.js`** — the CDN entry. Imports the element, registers it, re-exports the public surface (`defineElement`, `Agent3DElement`, `AgentStageElement`, helpers).
- **`embed-action-bridge.js`** — the `postMessage` protocol. Iframe widgets and the web component speak the same dialect, so host pages can drive either with the same code.
- **`app.js`** — the main SPA. URL routing via hash (`#model=`, `#agent=`, `#kiosk=`) and query (`?agent=`) params.
@@ -33295,7 +37948,104 @@ Versioned CDN bundles are published at `/agent-3d/<version>/agent-3d.js`. Use `l
---
-<a id="sec-134"></a>
+<a id="sec-163"></a>
+
+> **Source:** `docs/lipsync.md` · [↑ table of contents](#table-of-contents)
+
+# Lipsync: real-time mouth animation from speech
+
+Two browser demos show the same idea from two angles: drive a 3D avatar's mouth from speech, live, with no server-side video rendering. `/lipsync` types a phrase, synthesizes it, and animates the mouth as the audio plays. `/lipsync/mic` opens your microphone and moves the mouth in real time as you talk. Both render the same avatar and both compute visemes frame-by-frame in the browser, feeding the avatar's `viseme_*` morph targets.
+
+Page: [/lipsync](https://three.ws/lipsync) (TTS-driven) · [/lipsync/mic](https://three.ws/lipsync/mic) (microphone-driven)
+API: `POST /api/tts/speak` (used only by the TTS demo)
+
+## Why it exists
+
+Lipsync is the difference between an avatar that speaks and a mannequin with audio playing near it. These demos are the reference implementations for the two lipsync paths the platform runs everywhere else: a viseme string from a phoneme-aware analyzer, and a frequency-band heuristic that works with nothing but an audio stream. Seeing both side by side makes the trade-off explicit, and each demo is a self-contained, copyable example of wiring an analyzer to morph targets on a glTF avatar.
+
+Both demos load the same rig, [`public/avatars/default.glb`](../public/avatars/default.glb), which carries Oculus-style viseme morph targets (`viseme_aa`, `viseme_E`, `viseme_O`, and so on). There is no server-side audio analysis in either demo; everything happens on the client.
+
+## How it works
+
+### TTS demo (`/lipsync`)
+
+Served from [`public/demos/lipsync-tts.html`](../public/demos/lipsync-tts.html). Flow: type a phrase, POST it to the TTS endpoint, receive an audio blob, play it through an `Audio` element, and let the third-party [`wawa-lipsync`](https://www.npmjs.com/package/wawa-lipsync) package (pinned `^0.0.2`) analyze the playing audio each frame.
+
+1. The page imports `three`, `GLTFLoader`, `OrbitControls`, and `{ Lipsync } from 'wawa-lipsync'`, and constructs `const lipsync = new Lipsync()`.
+2. On Speak it POSTs `{ text, voice, speed, format: 'mp3' }` to `/api/tts/speak`. The Voice dropdown offers nova (default), alloy, echo, fable, onyx, shimmer, ash, coral, sage; Speed offers 0.8x, 1.0x, 1.2x, 1.5x.
+3. The returned bytes become an object URL on a `new Audio()` (`crossOrigin: 'anonymous'`), then `lipsync.connectAudio(audioEl)` (src set before connect, as wawa requires).
+4. In the render loop, while playing, it calls `lipsync.processAudio()` and reads `lipsync.viseme` (one of `sil, aa, PP, FF, TH, DD, kk, CH, SS, nn, RR, ou`). A `VISEME_MAP` translates that code to the avatar's morph name (for example `aa -> viseme_aa`, `CH -> viseme_CH`, `ou -> viseme_O`, `sil -> null`).
+5. Each frame every viseme weight is reset to 0, the active viseme's morph is targeted to 1.0, and the actual `morphTargetInfluences` are lerped toward the target (factor 0.5) so the mouth eases instead of snapping. A live viseme meter mirrors the current code.
+
+`wawa-lipsync` computes visemes from per-band energies, band deltas, overall volume, and spectral centroid (`computeVisemeScores` plus temporal smoothing in `adjustScoresForConsistency`), exposing the winner as `.viseme`.
+
+### Microphone demo (`/lipsync/mic`)
+
+Served from [`public/demos/lipsync-mic.html`](../public/demos/lipsync-mic.html). This demo does **not** use wawa-lipsync. It imports the in-house analyzer [`src/lip-sync-analyser.js`](../src/lip-sync-analyser.js) (`LipSyncAnalyser`), the same viseme pipeline that drives streamed TTS in the live chat, sourced from your mic instead.
+
+1. Start calls `getUserMedia({ audio: true })`, creates an `AudioContext`, wires `createMediaStreamSource(stream)` into an `AnalyserNode` (`fftSize: 256`, `smoothingTimeConstant: 0.7`). The analyzer node is deliberately not connected to `destination`, so your mic does not echo through the speakers.
+2. `new LipSyncAnalyser()` is `connect()`-ed to that node, and each frame `analyser.sample()` returns a `{ viseme_name: weight }` map that is written straight to the avatar's `morphTargetInfluences` and a 9-bar meter.
+3. The analyzer is a frequency-band heuristic: low band (0 to 500 Hz) drives open vowels (`viseme_aa`, `viseme_O`), the mid band (500 Hz to 2 kHz) drives mid vowels and nasals (`viseme_E`, `viseme_I`, `viseme_nn`), the high band (2 to 8 kHz) drives sibilants and fricatives (`viseme_SS`, `viseme_FF`, `viseme_CH`), and an amplitude dip drives a bilabial closure (`viseme_PP`). A silence gate below 0.15 overall amplitude eases everything to rest; otherwise weights EMA toward target (factor 0.25). `getAmplitude()` also exposes a smoothed 0..1 level so a rig with no viseme morphs can drive a single `jawOpen`/`mouthOpen` morph instead.
+4. This demo registers the meshopt decoder before loading, because server-baked and Forge GLBs can ship `EXT_meshopt_compression`.
+
+## Walkthrough
+
+1. Open [/lipsync](https://three.ws/lipsync). Edit the text, pick a voice and speed, and press Speak. Watch the mouth move as the audio plays; the viseme meter shows the live code. Press Stop to interrupt.
+2. Open [/lipsync/mic](https://three.ws/lipsync/mic) and press Start. Allow microphone access, then talk or sing. The mouth and the 9-bar meter follow your voice. Press Stop to release the mic and reset the mouth.
+
+## Examples
+
+Only the TTS demo hits an API. `/api/tts/speak` returns audio bytes you can decode and analyze exactly as the demo does.
+
+```bash
+# Synthesize speech to an MP3 file (the same call the /lipsync demo makes).
+curl -X POST 'https://three.ws/api/tts/speak' \
+ -H 'content-type: application/json' \
+ -d '{ "text": "Welcome to three dot ws.", "voice": "nova", "speed": 1.0, "format": "mp3" }' \
+ --output speech.mp3
+```
+
+```js
+// Minimal browser lipsync loop with wawa-lipsync, mirroring the /lipsync demo.
+import { Lipsync } from 'wawa-lipsync';
+const lipsync = new Lipsync();
+const res = await fetch('/api/tts/speak', {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({ text: 'Hello from three dot ws', voice: 'nova', format: 'mp3' }),
+});
+const audio = new Audio(URL.createObjectURL(await res.blob()));
+audio.crossOrigin = 'anonymous';
+lipsync.connectAudio(audio);
+audio.play();
+function tick() {
+ if (!audio.paused) { lipsync.processAudio(); console.log(lipsync.viseme); }
+ requestAnimationFrame(tick);
+}
+tick();
+```
+
+`POST /api/tts/speak` ([`api/tts/speak.js`](../api/tts/speak.js)) prefers the free NVIDIA NIM Magpie TTS lane when configured and falls back to OpenAI as a paid backstop. Body: `{ text, voice?, model?, format?, language?, speed? }`. `text` is required (max 4096 chars), `voice` defaults to `nova`, `format` defaults to `mp3`, `speed` clamps 0.5 to 2.0. It is rate-limited per user or per IP.
+
+## States and limits
+
+- **TTS demo errors.** A persistent, actionable banner with a Retry button covers network failure, `429` rate limit, `>=500` service errors, `400` bad text, audio playback failure, and blocked autoplay ("needs a click").
+- **Mic demo permissions.** `getUserMedia` failures map by `DOMException.name`: `NotAllowedError`/`SecurityError` -> "Microphone blocked", `NotFoundError`/`OverconstrainedError` -> "No microphone found", `NotReadableError` -> "Microphone is busy", with a "Try again" button.
+- **Morph naming.** The avatar uses Oculus-style `viseme_*` targets, not ARKit blendshape names. On load each demo logs how many of the expected viseme morphs it wired.
+- **No TTS on the mic demo.** It analyzes live audio only; no network call.
+- **Two different analyzers.** The TTS demo uses the third-party `wawa-lipsync` phoneme-style analyzer; the mic demo uses the in-house frequency-band `LipSyncAnalyser`. They map slightly different viseme sets.
+
+## Related
+
+- [Voice Lab](./voice-lab.md): clone a voice and synthesize it, the audio these demos animate.
+- [Voice and lipsync tutorial](./tutorials/voice-and-lipsync.md): the full walkthrough, including wiring visemes to an agent body.
+- [Talking Avatar Video](./talking-avatar-video.md): the server-rendered alternative for exporting a talking-head clip.
+- [Animations](./animations.md): the runtime clip registry that plays alongside lipsync.
+- Pages: [/lipsync](https://three.ws/lipsync), [/lipsync/mic](https://three.ws/lipsync/mic).
+
+---
+
+<a id="sec-164"></a>
> **Source:** `docs/listings.md` · [↑ table of contents](#table-of-contents)
@@ -33320,6 +38070,17 @@ Cloud marketplaces are the procurement flow enterprises use to acquire software
---
+## Startup & Credit Programs
+
+Infrastructure programs that back three.ws with credits, tooling, and founder networks.
+
+| Program | Status | Details |
+|---|---|---|
+| **Quicknode** Startup Program | Accepted (2026-07) | three.ws is accepted into the Quicknode Startup Program and approved for free infrastructure credits. Quicknode's globally distributed RPC endpoints (Solana first, plus the EVM chains x402 settles on) add capacity and redundancy behind agent wallets, settlement verification, and live market data. Announcement: [three.ws Joins the Quicknode Startup Program](/blog/three-ws-quicknode-startup-program). |
+| **Google Cloud** for Web3 Startups | Member | Production runs on Google Cloud Run; the program backs compute and Vertex AI usage. Announcement: [three.ws Joins Google Cloud for Web3 Startups](/blog/three-ws-google-cloud-partnership). |
+
+---
+
## Ecosystem Directories
Ecosystem directories are the discovery surfaces that L1/L2 communities, chain foundations, and dApp explorers publish to help users find vetted projects on their stack.
@@ -33339,6 +38100,7 @@ Dappbay is BNB Chain's official dApp directory. The listing is about distributio
| **IBM Community** | Live | [Embodied, Intelligent, and Self-Custodied: three.ws and the 3D AI Agent Stack](https://community.ibm.com/community/user/blogs/nich8/2026/06/08/3d-ai-web3-just-converge-threews-shipped-the-whole) — IBM Community blog covering the convergence of 3D, AI agents, and web3 in the three.ws stack. |
| **HackerNoon** | Live | [hackernoon.com/u/three-ws](https://hackernoon.com/u/three-ws) — three.ws posts auto-import from the RSS feed. Announcement: [three.ws Partners with HackerNoon](/news/partnered-with-hackernoon) |
| **Alibaba Cloud Marketplace Blog** | Live | [Editorial feature](https://marketplace.alibabacloud.com/doc/blog/detail/mplace-sgcmfw00036800.html) — Alibaba Cloud Marketplace published an editorial introducing three.ws. Announcement: [three.ws Featured on the Alibaba Cloud Marketplace Blog](/blog/three-ws-featured-on-alibaba-cloud-marketplace-blog) |
+| **pump.fun** | Live | [Three Builds With Tech Giants](https://pump.fun/coin/FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump/article): a feature article published on the official $THREE coin page, profiling the platform's browser-native 3D AI agents with onchain identities, the Animations and Poses Studio, the 3D Studio MCP server, and the AWS and IBM milestones. |
HackerNoon is one of the world's largest independent tech publications, read by millions of developers and founders monthly. Every three.ws announcement is pulled automatically from [`three.ws/rss/announcements.xml`](https://three.ws/rss/announcements.xml) into the HackerNoon drafts queue, then published with canonical URLs pointing back to three.ws. See [syndication setup](/docs/syndication#hackernoon) for technical details.
@@ -33366,7 +38128,16 @@ Subscribe via RSS to track new listings, integrations, and protocol updates.
---
-<a id="sec-135"></a>
+## Related
+
+- [AWS Marketplace](/docs/aws-marketplace): the AWS listing and entitlement-issued x402 API keys
+- [Syndication](/docs/syndication): how announcements flow to HackerNoon and other channels
+- [x402 protocol](/docs/x402): the payment rail behind the paid endpoints these listings distribute
+- [Introduction](/docs/introduction): the full technical picture of the platform being listed
+
+---
+
+<a id="sec-165"></a>
> **Source:** `docs/make-your-agent.md` · [↑ table of contents](#table-of-contents)
@@ -33413,21 +38184,23 @@ This description is your agent's system prompt — the instructions it follows.
## Step 4 — Enable skills (optional)
-Skills are extra capabilities you can give your agent. Common ones:
+Skills are extra capabilities you can give your agent. The wizard offers:
| Skill | What it does |
|---|---|
-| **Voice** | Lets users talk to the agent by microphone; the agent responds out loud |
-| **Memory** | The agent remembers past conversations across sessions |
-| **Web search** | The agent can look things up in real time |
+| **Memory** | The agent remembers what you tell it across sessions (on by default) |
+| **Deep thinking** | The agent reasons step by step before answering (on by default) |
+| **Web research** | The agent can look things up in real time |
-You can add or remove skills at any time from the agent's edit page.
+There is also an optional crypto group (pump.fun monitoring/trading, a Solana wallet, and x402 pay-per-call) you can reveal and enable if you want an on-chain agent; skip it entirely otherwise.
+
+You can add or remove skills at any time from the agent's edit page. Voice (microphone input and spoken replies) isn't a wizard skill: you configure it later on the Voice tab of the agent editor.
---
## Step 5 — Publish and get your embed
-Once you hit **Publish**, your agent gets a live URL — something like `three.ws/agent/abc123`.
+Once you hit **Publish**, your agent gets a live URL: something like `three.ws/agents/abc123` (plus a friendly handle URL like `three.ws/@aria` once you reserve a handle).
The wizard also gives you an **embed snippet**: a few lines of HTML you can paste into any webpage to make the agent appear there. You don't need to know HTML to do this — just copy and paste.
@@ -33457,7 +38230,7 @@ Changes take effect immediately — no republishing needed for most settings.
---
-<a id="sec-136"></a>
+<a id="sec-166"></a>
> **Source:** `docs/market-data-api.md` · [↑ table of contents](#table-of-contents)
@@ -33570,14 +38343,14 @@ A failed upstream never charges you: the endpoint verifies payment, runs the dat
## Related
-- [x402 developer tools](./x402-dev-tools.md) — free test bench for debugging payment envelopes
-- [Crypto Data API](https://three.ws/api/crypto) — the free, keyless Solana/pump.fun bundle (token snapshots, holders, whales)
+- [x402 developer tools](/docs/x402-dev-tools) - free test bench for debugging payment envelopes
+- [Crypto Data API](/docs/crypto-api) - the free, keyless Solana/pump.fun bundle (token snapshots, holders, whales); live index at [`/api/crypto`](https://three.ws/api/crypto)
- Sibling paid intel endpoints: `market-heatmap`, `market-mood`, `gas-oracle`, `yield-scan`, `stablecoin-health`, `hack-check`, `news-pulse`, `defi-radar` — value-added composites over the same data, also in the discovery doc
- Data sources: CoinGecko (with CoinPaprika/CoinLore failover), DeFiLlama, alternative.me, public Ethereum RPCs
---
-<a id="sec-137"></a>
+<a id="sec-167"></a>
> **Source:** `docs/marketplace.md` · [↑ table of contents](#table-of-contents)
@@ -33644,8 +38417,11 @@ trial for a skill, so a gated skill call can verify entitlement before running.
## Current limitations
- **Discovery surface.** Listings and prices live in the database and the buy/sell
- endpoints are complete, but there is not yet a single paginated "browse all
- skills for sale" HTTP endpoint with sort/filter; discovery today is per-agent.
+ endpoints are complete, but there is not yet a free, paginated "browse all
+ skills for sale" HTTP endpoint with sort/filter; discovery today is per-agent
+ (agents themselves are browsable at `GET /api/marketplace/agents`), and the
+ paid [`/api/x402/skill-marketplace`](x402-endpoints.md) endpoint returns the
+ live skill listing catalog with pricing for $0.001 USDC.
- **Auto-grant.** A confirmed skill purchase is recorded and the license NFT is
minted, but the purchased skill is not automatically attached to the buyer's
agent profile — entitlement is checked via `check-skill-access.js` rather than
@@ -33668,7 +38444,7 @@ their chosen `currency_mint`; the platform promotes no coin other than $THREE.
---
-<a id="sec-138"></a>
+<a id="sec-168"></a>
> **Source:** `docs/mcp-3d-studio.md` · [↑ table of contents](#table-of-contents)
@@ -33906,7 +38682,7 @@ npx @modelcontextprotocol/inspector http://localhost:3000/api/mcp-3d
---
-<a id="sec-139"></a>
+<a id="sec-169"></a>
> **Source:** `docs/mcp-agent.md` · [↑ table of contents](#table-of-contents)
@@ -33982,7 +38758,7 @@ npx @modelcontextprotocol/inspector http://localhost:3000/api/mcp-agent
---
-<a id="sec-140"></a>
+<a id="sec-170"></a>
> **Source:** `docs/mcp-studio.md` · [↑ table of contents](#table-of-contents)
@@ -34019,6 +38795,12 @@ declare an `openai/widgetCSP` whose allowlist includes the GLB storage origin,
so models load inside real ChatGPT (which enforces the CSP), not just in
permissive test harnesses.
+Reliability on the ChatGPT lanes: generations are pinned to the fast standard
+tier so a result always lands inside ChatGPT's patience window. When a call
+explicitly requests the high tier, the submit degrades gracefully back to
+standard on a 402 (the operator-funded high lane is out of credit) or on a
+submit timeout, rather than failing the conversation.
+
### Any MCP client
```bash
@@ -34036,8 +38818,17 @@ store-clean responses (model URLs and job state only). Full contract in the
[API reference](./api-reference.md). Use the MCP connector above when you want
inline 3D widgets; the custom GPT covers plans without connector support.
+How AR rides both ChatGPT surfaces (the `arUrl` contract, the device-aware
+launcher, living avatars, link unfurls) is documented end to end in
+[AR in ChatGPT](./chatgpt-ar.md).
+
## Tools
+The server exposes **nine** tools: the six generation tools documented here, plus
+three persona/embodiment tools (`create_agent_persona`, `get_agent_persona`,
+`persona_say`) documented in the **Embodiment** section below. All nine are free
+and keyless.
+
All six generation tools are free and run operator-funded on the platform's own
generation pipeline. Annotations: `readOnlyHint:false`, `destructiveHint:false`,
`idempotentHint:false`, `openWorldHint:true` (work runs against external model
@@ -34062,11 +38853,18 @@ needs to display the model — no internal identifiers:
"kind": "model",
"glbUrl": "https://three.ws/cdn/creations/…/model.glb",
"viewerUrl": "https://three.ws/viewer?src=…",
+ "arUrl": "https://three.ws/api/ar?src=…&title=…",
"format": "glb",
"prompt": "a friendly round robot mascot, glossy white plastic"
}
```
+`arUrl` is the one-tap place-in-your-room link (see [AR in ChatGPT](./chatgpt-ar.md)).
+Rigged avatars additionally carry `irlUrl`, the living-agent handoff into
+[IRL](./irl.md), and the inline widget's AR button becomes **Bring it to life**.
+Every result also includes a `spatial` field, the open Spatial MCP artifact
+(`specs/SPATIAL_MCP.md`) so any Spatial-MCP renderer can display the model.
+
### Conversational refinement (`refine_model`)
Iterate on a model by describing the change in words — *"make it metallic"*,
@@ -34203,18 +39001,26 @@ All optional — sensible production defaults:
| `STUDIO_RIG_TIMEOUT_MS` | `180000` | Rig poll budget |
| `STUDIO_POLL_MS` | `3000` | Poll interval |
+## Related
+
+- [MCP overview](/docs/mcp) - every three.ws MCP surface, paid and free
+- [AR in ChatGPT](/docs/chatgpt-ar) - how `arUrl` and the AR launcher work on ChatGPT surfaces
+- [3D API](/docs/3d-api) - the free REST lane the studio tools run on
+- [API Reference](/docs/api-reference) - the `/api/3d/studio` custom GPT Actions contract
+
---
-<a id="sec-141"></a>
+<a id="sec-171"></a>
> **Source:** `docs/mcp-tools.md` · [↑ table of contents](#table-of-contents)
# MCP Tools Catalog
-three.ws ships several [MCP](mcp.md) servers. One is free and 3D-only; the others
-expose paid tools that settle per call in USDC over [x402](x402.md). This page is
-the catalog: which server hosts which tool, whether it's free or paid, and what it
-does.
+three.ws ships several [MCP](mcp.md) servers: tool servers that AI assistants
+(Claude, ChatGPT, any MCP client) can call directly. One is free and 3D-only; the
+others expose paid tools that settle per call in USDC over [x402](x402.md). This
+page is the catalog: which server hosts which tool, whether it's free or paid, and
+what it does.
> Source: [`api/mcp-studio.js`](../api/mcp-studio.js) (free),
> [`api/mcp-3d.js`](../api/mcp-3d.js) + [`api/_mcp3d/pricing.js`](../api/_mcp3d/pricing.js)
@@ -34277,9 +39083,11 @@ and direction tools are flat per call.
| `apply_animation` | $0.01 | Retarget a library clip onto a rigged GLB. |
| `direct_prompt` | $0.01 | Rewrite a vague idea into a tight 3D spec. |
| `generate_material` | $0.01 | PBR material parameters from a description. |
+| `anchor_provenance` | $0.05 | Sign a content credential and anchor its hash on Solana. |
Free studio helpers (no charge): `getting_started`, `generation_status`,
-`preview_3d`, `list_animations`, `inspect_model`, `optimize_model`, `save_avatar`.
+`preview_3d`, `list_animations`, `inspect_model`, `optimize_model`, `save_avatar`,
+`validate_spatial_response` (the [Spatial MCP](spatial-mcp.md) conformance gate).
## Agent & commerce tools — `3d-agent-local`
@@ -34291,6 +39099,9 @@ generation lane**; the rest are paid and quote their price in the
| Tool | Price | What it does |
|---|---|---|
| `forge_free` | **Free** | Text → textured GLB on the free NVIDIA NIM (Microsoft TRELLIS) lane; returns a GLB URL + viewer link. |
+| `crypto_news` | **Free** | Live crypto headlines from 192 publisher feeds, filterable by category, source, language, or search. |
+| `crypto_news_digest` | **Free** | Clusters the last 1-72h of coverage into distinct narratives with stance, tickers, and covering outlets. |
+| `crypto_news_archive` | free quota, then $0.001/search | Search 660,000+ archived articles back to September 2017. Stats and trending modes are always free; search is free up to a daily per-IP quota, then $0.001 USDC per search via x402. |
| `text_to_avatar` | paid | Text → 3D avatar. |
| `mesh_forge` | paid | Text/image → 3D mesh via a Granite-directed model chain. |
| `rig_mesh` | paid | Auto-rig a GLB into an animation-ready model. |
@@ -34299,7 +39110,7 @@ generation lane**; the rest are paid and quote their price in the
| `restyle_material` | paid | Re-skin a GLB without regenerating its mesh — AI PBR restyle from an instruction ("make it chrome", "wooden", "cyberpunk neon") or seeded, reproducible colorway variant fan-out from a PBR preset; parent → child lineage. See [Restyle Studio](/restyle). |
| `get_pose_seed` | paid | Pose generation. |
| `ens_sns_resolve` | paid | ENS + SNS name resolution. |
-| `pump_snapshot` | free (no signer) | Live Solana token snapshot (price, volume, metadata). |
+| `pump_snapshot` | paid ($0.005) | Live Solana token snapshot: Jupiter price, DexScreener volume/pair, pump.fun metadata, on-chain top-holder distribution. |
| `sentiment_pulse` | paid | Token sentiment pulse. |
| `agent_reputation` | paid | ERC-8004 agent reputation read. |
| `vanity_grinder` | paid | Solana vanity address mining. |
@@ -34338,7 +39149,7 @@ promote no specific token.
---
-<a id="sec-142"></a>
+<a id="sec-172"></a>
> **Source:** `docs/mcp-x402-bazaar.md` · [↑ table of contents](#table-of-contents)
@@ -34413,7 +39224,7 @@ npx @modelcontextprotocol/inspector http://localhost:3000/api/mcp-bazaar
---
-<a id="sec-143"></a>
+<a id="sec-173"></a>
> **Source:** `docs/mcp.md` · [↑ table of contents](#table-of-contents)
@@ -34554,8 +39365,8 @@ Ready-to-submit listing packages for each directory, plus the canonical metadata
Deep dives — every tool, argument, env var, and example:
-- **Install-and-run:** [Scenes](https://three.ws/docs/mcp-scenes) · [x402 Wallet](https://three.ws/docs/mcp-x402) · [Intel](https://three.ws/docs/mcp-intel) · [Vanity](https://three.ws/docs/mcp-vanity) · [Naming](https://three.ws/docs/mcp-naming) · [Marketplace](https://three.ws/docs/mcp-marketplace)
-- **Hosted remote:** [3D Studio](./mcp-3d-studio.md) · [Agent wallet](./mcp-agent.md) · [x402 Bazaar](./mcp-x402-bazaar.md) · [IBM x402](./ibm-x402-mcp.md)
+- **Hosted remote:** [3D Studio (free)](./mcp-studio.md) · [3D Studio (paid)](./mcp-3d-studio.md) · [Agent wallet](./mcp-agent.md) · [x402 Bazaar](./mcp-x402-bazaar.md) · [IBM x402](./ibm-x402-mcp.md)
+- **Install-and-run:** each npm server ships its usage guide (tools, arguments, env vars, examples) in its package README on [npmjs.com/org/three-ws](https://www.npmjs.com/org/three-ws). The [MCP Tools Catalog](./mcp-tools.md) maps every tool to its server and price.
---
@@ -34640,6 +39451,8 @@ Send `POST /api/mcp` with valid JSON-RPC 2.0 messages and a bearer token. The se
All tools return `{ content: [{ type, text }], structuredContent: {...} }`. On error, `isError: true` is set and `content[0].text` contains the message.
+The tools below are the core avatar, validation, minting, and market-data set. The server registers more beyond this page (memory `remember`/`recall`/`forget`, `register_agent`, oracle and pump.fun intel reads, trader analytics, copy-trading); call `tools/list` for the complete live catalog with schemas.
+
---
### `list_my_avatars`
@@ -35131,7 +39944,16 @@ Restart Claude Code after editing `.mcp.json` so the new server config is picked
---
-<a id="sec-144"></a>
+## Related
+
+- [MCP Tools Catalog](/docs/mcp-tools): every three.ws MCP tool, its server, and its price
+- [3D Studio MCP (free)](/docs/mcp-studio): the no-auth, no-payment 3D generation server
+- [Spatial MCP](/docs/spatial-mcp): returning live 3D scenes as native MCP responses
+- [x402](/docs/x402): the USDC micropayment rail behind the paid tools
+
+---
+
+<a id="sec-174"></a>
> **Source:** `docs/memetic-launcher.md` · [↑ table of contents](#table-of-contents)
@@ -35222,7 +40044,7 @@ POST /api/launcher/me { "action": "resume" } → clear a tripped circuit brea
---
-<a id="sec-145"></a>
+<a id="sec-175"></a>
> **Source:** `docs/memory.md` · [↑ table of contents](#table-of-contents)
@@ -35284,10 +40106,13 @@ Configure the persistence mode in the agent's `manifest.json`:
| Mode | Description | Best for |
|------|-------------|---------|
| `local` | Stored in browser `localStorage`. Fast, private, device-specific. | Development, demos, single-device personal agents |
-| `ipfs` | Pinned to IPFS via a configured provider. Portable across devices. | Production agents where memory is valuable |
-| `encrypted-ipfs` | Same as `ipfs` but content is encrypted before pinning. | Agents that handle user PII |
+| `remote` | Synced to the platform backend (`/api/agent-memory`) per signed-in user. | Cross-device memory for platform-hosted agents |
+| `ipfs` | Loaded from a pinned IPFS bundle. Portable across devices. | Distributing a curated memory bundle with an agent |
+| `encrypted-ipfs` | Same as `ipfs` but content is AES-GCM encrypted before pinning. | Agents that handle user PII |
| `none` | No persistence. Memory exists only for the current session. | Kiosks, one-shot interactions, demos |
+Custom backends can also be registered programmatically with `Memory.registerBackend(name, backend)` (a `backend` object with `load` / `persist` / optional `recall` hooks, see `specs/MEMORY_SPEC.md`); any unknown mode falls back to `local` with a warning.
+
### Local mode (default)
Memory is serialized to `localStorage` under a single namespaced key:
@@ -35310,28 +40135,23 @@ If the write fails because `localStorage` is full, the runtime automatically pru
```json
{
"memory": {
- "mode": "ipfs",
- "provider": "pinata"
+ "mode": "ipfs"
}
}
```
-Each `write()` pins the updated memory directory to IPFS via the configured provider. The resulting CID is stored locally as a pointer; the actual content lives on the IPFS network and can be retrieved from any device.
+In `ipfs` mode the agent loads its memory from a pinned bundle: `Memory.load({ mode: 'ipfs', manifestURI })` fetches `MEMORY.md` from the bundle, follows its links to the individual memory files, and hydrates the store. Runtime writes stay in-memory for the session; publishing an updated bundle is an explicit step (pin the `memory/` directory again and point `manifestURI` at the new CID).
-Supported providers and their required credentials:
+Pinning goes through the pluggable pinner in [src/pinning/index.js](../src/pinning/index.js) (`createPinner(config)`):
-| Provider | Environment variable(s) |
-|----------|------------------------|
-| Pinata | `PINATA_JWT` |
-| Filebase | `FILEBASE_KEY` + `FILEBASE_SECRET` |
-| Web3.Storage | `WEB3_STORAGE_TOKEN` |
+| Provider | `createPinner` config |
+|----------|----------------------|
+| `web3-storage` (default) | `{ provider: 'web3-storage', token }` |
+| `pinata` | `{ provider: 'pinata', token }` (JWT) |
+| `filebase` | `{ provider: 'filebase', accessKeyId, secretAccessKey, bucket }` |
+| `memory` | in-memory dev pinner (real CIDs, nothing persisted) |
-**How a write works:**
-1. Agent calls `memory.write(key, { ... })` or `memory.note(type, data)`
-2. The memory file is updated in-memory and the index (`MEMORY.md`) is rebuilt
-3. The updated directory is pinned to IPFS → new CID returned by the provider
-4. CID is saved to `localStorage` for fast recovery
-5. On the next session: the CID is read from localStorage, content is fetched from IPFS and deserialized
+Server-side, the platform's pinning endpoints (`/api/pinning/*`) read `PINATA_JWT` or `WEB3_STORAGE_TOKEN` from the environment.
The benefit is cross-device persistence with content-addressed verification — the CID uniquely identifies the exact content, so you always know what you got back from the network.
@@ -35340,20 +40160,16 @@ The benefit is cross-device persistence with content-addressed verification —
```json
{
"memory": {
- "mode": "encrypted-ipfs",
- "provider": "pinata",
- "encryptionKey": "<derive-from-wallet>"
+ "mode": "encrypted-ipfs"
}
}
```
-Same as IPFS mode but the content is encrypted (ECIES / libsodium sealed box) before pinning. Only the holder of the encryption key can decrypt it, so memory content remains private even on a public IPFS network.
-
-The encryption key should be derived from the user's wallet signature, not hardcoded. If the user signs a deterministic message with their wallet, the signature can serve as a stable key material.
+Same as IPFS mode but every file is encrypted with **AES-GCM-256** ([src/memory/crypto.js](../src/memory/crypto.js), pure `crypto.subtle`) before pinning. Only the holder of the encryption key can decrypt it, so memory content remains private even on a public IPFS network.
-> **Warning:** There is no key recovery. If the encryption key is lost, the memories are permanently inaccessible. Make sure users understand this before enabling encrypted-ipfs mode.
+The key is not stored anywhere: `Memory.load({ mode: 'encrypted-ipfs', deriveKey })` requires a `deriveKey` function, and the standard implementation derives a non-extractable AES key from a deterministic wallet signature. `memory.save()` then encrypts each file and pins it via `POST /api/agents/<id>/memory/pin`, returning the per-file CIDs plus the CID of the rebuilt `MEMORY.md` index (the index itself is pinned in plaintext, since it only lists filenames and CIDs).
-> **Note:** Encrypted IPFS support is partially implemented. The storage mode is recognized and the encryption path is wired, but IPFS provider modules are under active development. Use `local` mode for production today.
+> **Warning:** There is no key recovery. If the wallet (and therefore the derived key) is lost, the memories are permanently inaccessible. Make sure users understand this before enabling encrypted-ipfs mode.
### None mode
@@ -35426,7 +40242,7 @@ Keep the index concise. Lines beyond 200 are truncated before injection into con
### The timeline
-The timeline is an append-only event log. Skills write ephemeral events here via `ctx.memory.note(type, data)`. In `local` mode, the last 200 timeline entries are persisted. In `ipfs` modes, one JSONL file per day lives under `memory/timeline/`.
+The timeline is an append-only event log. Skills write ephemeral events here via `ctx.memory.note(type, data)`. In memory it is capped at 1000 entries; in `local` mode, the last 200 entries are persisted. The bundle spec reserves a `memory/timeline/` directory (one JSONL file per day) for exported bundles; the runtime does not hydrate the timeline from IPFS on load.
```json
{"ts":"2026-04-14T12:03:12Z","type":"waved","style":"enthusiastic"}
@@ -35510,7 +40326,7 @@ Memory can be exported as a portable blob and imported into another agent instan
```js
// Export all memory as a JSON blob
const blob = await agent.memory.export();
-// { version: "memory/0.1", index, files, timeline }
+// { version: "memory/0.1", mode, namespace, index, files, timeline }
// Import into another instance (merge strategy: local wins on conflict)
await otherAgent.memory.import(blob, { strategy: 'merge' });
@@ -35573,7 +40389,7 @@ Automatic decay (via the `decay` frontmatter field) down-weights a memory during
**Multi-device (ipfs mode):** last-write-wins with additive merge on load. Conflicts are rare because most writes add new files rather than editing existing ones. In the case of a true conflict, the LLM can mediate.
-**Multiple tabs (same device):** writes use a `BroadcastChannel` mutex to avoid races. If two tabs write simultaneously, one will wait for the lock.
+**Multiple tabs (same device):** writes are synchronous `localStorage.setItem` calls, so the last tab to write wins. There is no cross-tab lock; if you run the same agent in several tabs at once, expect the most recent tab's memory state to be the one that persists.
---
@@ -35594,7 +40410,7 @@ agent/
└── 2026-04-13.jsonl
```
-The `Memory._loadIPFS()` method fetches `MEMORY.md` first, parses its links to discover individual files, then fetches each one. If any file fails to fetch, it is skipped silently and the rest of memory loads normally.
+The `Memory._loadIPFS()` method fetches `memory/MEMORY.md` first, parses its links to discover individual files, then fetches each one (and decrypts it in `encrypted-ipfs` mode). If any file fails to fetch, it is skipped silently and the rest of memory loads normally. A wrong decryption key throws so callers can detect it.
---
@@ -35603,6 +40419,7 @@ The `Memory._loadIPFS()` method fetches `MEMORY.md` first, parses its links to d
| Mode | Who can read the data |
|------|-----------------------|
| `local` | Only the device/browser where it was written. Never leaves the browser. |
+| `remote` | The signed-in owner via the platform backend (`/api/agent-memory`). |
| `ipfs` | Anyone who knows the CID. CIDs are not guessable, but if leaked, the content is public. |
| `encrypted-ipfs` | Only the holder of the encryption key. Content is opaque to the IPFS network. |
| `none` | No one — data is never written. |
@@ -35613,13 +40430,123 @@ In `ipfs` mode without encryption, treat the memory as semi-public. Don't store
---
-<a id="sec-146"></a>
+## Related
+
+- [Create, enhance & edit agent memory](/docs/tutorials/create-and-edit-memory): the hands-on tutorial
+- [Agent system](/docs/agent-system): how memory feeds the LLM runtime
+- [Skills](/docs/skills): the `ctx.memory` API skills use
+- [Architecture overview](/docs/architecture): where memory sits in the four layers
+
+---
+
+<a id="sec-176"></a>
+
+> **Source:** `docs/meta-allocator.md` · [↑ table of contents](#table-of-contents)
+
+# Meta-Allocator: the ETF of degens
+
+The Meta-Allocator is a first-class agent type that does not pick coins. It picks
+leaders. Given a budget and a risk appetite, it spreads that budget across the top
+verified pump.fun trader agents, ranked by risk-adjusted on-chain track record and
+diversified across trading styles, then tells you how to rebalance. It is the
+diversified on-ramp for the cautious: "just make me money," expressed as a basket of
+proven records instead of one bet.
+
+Page: [/meta-allocator](https://three.ws/meta-allocator) · API: `/api/meta-allocator`
+
+## Why it exists
+
+Copy-trading a single leader is a single point of failure. The Meta-Allocator turns
+the leaderboard into an *input to a strategy*: better leaders produce better baskets,
+which draw more copy demand, which surfaces more leaders. It is non-custodial. It
+returns a plan (weights, suggested sizes, a rebalance rule), never a transaction. You
+act on the plan one leader at a time through the existing copy-trade surface
+([/vaults](https://three.ws/vaults)), keeping full custody the whole way.
+
+## Where the numbers come from
+
+Every leader stat traces to a real closed on-chain round-trip in
+`agent_sniper_positions` (the same honest source the [mirror leaderboard](https://three.ws/leaderboard)
+ranks on). For each public agent with at least one settled trade the allocator computes:
+
+- **win rate** and **realized ROI** from closed positions,
+- **max drawdown %**, peak-to-trough on the cumulative realized-P&L equity curve (a single windowed SQL pass),
+- a **capacity proxy** (the leader's typical fill size) so the plan never suggests a size that would move their price,
+- a **risk-adjusted score** that rewards ROI and win-rate edge weighted by sample size, then penalizes drawdown, so a one-trade fluke never outranks a consistent record,
+- a **correlation group** (`high_winrate`, `moonshot`, `high_roi`, `steady`, `volatile`) derived from that realized profile, used only to diversify the basket.
+
+The plan is shaped by the platform's free-first LLM chain (`llmComplete`). When no LLM
+provider is available, a deterministic allocator produces the same-shaped plan: pick
+the best of each correlation group first for spread, backfill by score, weight by score,
+and enforce the profile's single-leader weight cap and drawdown ceiling. The response
+never fails.
+
+## Risk profiles
+
+| Profile | Max leaders | Max single weight | Max drawdown | Min settled trades |
+| --- | --- | --- | --- | --- |
+| conservative | 4 | 35% | 40% | 5 |
+| balanced | 6 | 45% | 70% | 3 |
+| degen | 8 | 60% | 100% | 1 |
+
+## API
+
+Public, IP rate-limited. `budget` and sizes are in SOL. $THREE is the only coin the
+platform promotes; the leaders' traded coins are user runtime data, never endorsements.
+
+```bash
+# The verified leader universe + a default balanced plan for a 5 SOL budget.
+curl 'https://three.ws/api/meta-allocator?risk=balanced&budget=5'
+
+# A tailored plan for a specific budget and profile (planning only, no custody).
+curl -X POST 'https://three.ws/api/meta-allocator' \
+ -H 'content-type: application/json' \
+ -d '{"budget_quote":10,"risk_profile":"conservative"}'
+```
+
+Plan shape:
+
+```json
+{
+ "network": "mainnet",
+ "source": "llm",
+ "budget_quote": 5,
+ "risk_profile": "balanced",
+ "allocations": [
+ { "agent_id": "…", "name": "Curve Sniper", "weight_pct": 44.48,
+ "size_quote": 2.224, "correlation_group": "high_winrate",
+ "win_rate_pct": 70.83, "roi_pct": 142.5, "max_drawdown_pct": 28.4,
+ "capacity_quote": 0.35, "over_capacity": true,
+ "why": "high_winrate style: 70.83% win rate, 142.5% realized ROI, 28.4% max drawdown, 24 settled trades" }
+ ],
+ "excluded": [ { "agent_id": "…", "name": "…", "reason": "Max drawdown 88% exceeds the balanced cap of 70%" } ],
+ "rebalance_rule": "Rebalance weekly. Drop any leader whose 7-day realized drawdown exceeds 70% …",
+ "caution": "Copy-trading memecoins is high-variance. …",
+ "leaders_considered": 12,
+ "diversification": { "high_winrate": 1, "steady": 1, "high_roi": 1 }
+}
+```
+
+`over_capacity` flags an allocation whose suggested size is more than 3x the leader's
+typical fill, so the UI can warn and the user can trim. When no leaders qualify the
+plan `source` is `"empty"` with a helpful message instead of an error.
+
+## Related
+
+- [Trader Card & the claim-your-wallet wedge](trader-card.md)
+- [The trading surfaces](trading-surfaces.md) · [/vaults](https://three.ws/vaults) (copy-trade with custody guardrails)
+- [Clip Director: every trade becomes content](clip-director.md)
+- [Financial controls & custody guardrails](financial-controls.md)
+
+---
+
+<a id="sec-177"></a>
> **Source:** `docs/mint-mark.md` · [↑ table of contents](#table-of-contents)
# The three.ws mint mark
-Every coin launched through three.ws has a mint address that starts with `3ws` — the three.ws brand mark. This is automatic and verifiable directly from the address without any external lookup.
+Every coin launched through three.ws has a mint address that starts with `3ws`, the three.ws brand mark. This is automatic and verifiable directly from the address without any external lookup. It applies whenever you launch a coin from Studio or through an agent's wallet; you don't have to do anything to get it.
---
@@ -35639,11 +40566,11 @@ When you launch a coin on three.ws (via Studio or the agent wallet path), the pl
### How does it work?
-The server runs a fast WASM-based keypair grinder (single-threaded, sub-second for a 3-character prefix) until it finds a match, then uses that keypair as the coin mint. The expected work is ~49 000 keypairs at ~25 000/s, taking well under a second on the Cloud Run server's CPU.
+The server runs a fast WASM-based keypair grinder until it finds a match, then uses that keypair as the coin mint. The expected work is ~49 000 keypairs at ~25 000/s single-threaded, typically about a second on the Cloud Run server's CPU.
### Is it on every coin?
-Yes — all coins launched via **Studio** or **launch-agent** carry the mark. The only exception is the generic x402 pay-per-call launcher, which accepts arbitrary mints supplied by the caller at runtime and intentionally has no brand constraint.
+Yes: all coins launched via **Studio** or **launch-agent** carry the mark. The only exception is the generic x402 pay-per-call launcher, where the buyer chooses their own vanity prefix/suffix (or takes a random mint) and there is intentionally no brand constraint.
---
@@ -35724,7 +40651,7 @@ Watch this in the Cloud Run logs (Cloud Logging) to confirm the ~49 000-attempt
### The generic x402 launcher exemption
-`api/x402/pump-launch.js` is a pay-per-call endpoint that accepts an arbitrary `mint` keypair supplied by the buyer at runtime. It does **not** enforce the brand mark and must never have `assertThreeWsMark` added to it. The mint is the buyer's choice; the brand constraint belongs only to three.ws-initiated launches.
+`api/x402/pump-launch.js` is a pay-per-call endpoint where the buyer specifies their own `vanityPrefix` / `vanitySuffix` (or gets a random or pre-ground mint from inventory). It does **not** enforce the brand mark and must never have `assertThreeWsMark` added to it. The mint pattern is the buyer's choice; the brand constraint belongs only to three.ws-initiated launches.
### Token example
@@ -35745,7 +40672,95 @@ No other mint should appear in tests, fixtures, or documentation.
---
-<a id="sec-147"></a>
+<a id="sec-178"></a>
+
+> **Source:** `docs/mocap-studio.md` · [↑ table of contents](#table-of-contents)
+
+# Mocap Studio: drive a 3D avatar with your face, live in the browser
+
+Mocap Studio turns your webcam into a face-mocap rig. Point the camera at yourself and a three.ws avatar mirrors your expressions and head movement in real time: eyes, brows, mouth, jaw, and head pose, all in the browser, with no rig setup, no plugin, and no download. Calibrate to your neutral face, record a clip, replay it, and save it. Saved clips can be private, unlisted, or public, and you can replay anyone's public clips on the avatar too.
+
+Page: [/mocap-studio](https://three.ws/mocap-studio) · API: `/api/mocap/clips`
+
+## Why it exists
+
+Facial motion capture is normally a studio problem: markers, a helmet cam, dedicated software, and an export pipeline. Mocap Studio collapses all of that into a web page. The camera you already have, the avatar you already made, and a couple of clicks are enough to get expressive, recorded facial animation. It exists so a three.ws avatar can emote like a person, not just play canned clips, and so that expressiveness is capturable, saveable, and shareable as data (a small JSON clip) rather than a heavy video.
+
+## How it works
+
+The engine is `FaceMocap`, built on Google's MediaPipe Face Landmarker (a newer model than the FaceMesh that older browser-rigging libraries use). Per frame it outputs 52 ARKit blendshape scores, 478 3-D face landmarks (including iris), and a 4x4 facial transformation matrix for head pose in camera space. The pipeline is:
+
+```
+webcam → Face Landmarker → calibration delta → one-euro smoothing →
+ ARKit morph targets + head bone rotation on the avatar
+```
+
+- **Calibration** subtracts your resting face as a baseline, so a neutral expression maps to a neutral avatar instead of an involuntary smirk.
+- **One-euro smoothing** (Casiez et al., 2012) is an adaptive low-pass filter: it stays crisp on fast motion and heavily smooths slow motion, the standard trick in mocap pipelines to kill jitter without adding lag.
+- **The blendshapes** drive the avatar's ARKit morph targets (resolved through the platform's canonical morph map, so different avatar rigs all respond), and the head-pose matrix rotates the avatar's head (or neck) bone within a clamped range.
+
+The avatar loads into a `Viewer` scene with a procedural idle (breathing, blinking, subtle saccades). While mocap drives the head, the idle pauses its saccade and blink channels so it does not fight your captured motion.
+
+### Loading an avatar
+
+The studio resolves an avatar in order: a `?handle=<name>` deep link, then the signed-in user's own public avatar, then the platform default (`/avatars/default.glb`) so the camera and mocap pipeline are always usable. You can also type any three.ws handle to load that user's public avatar.
+
+### Record, replay, save
+
+Recording uses `FaceMocap`'s built-in clip buffer: every frame's blendshapes and head matrix are appended. Stop, and you have a clip with a duration and frame count. Replay drives the same avatar from the buffer. Download saves the clip as a JSON file locally. Save posts it to `/api/mocap/clips` with a name, description, tags, and a visibility of private, unlisted, or public. The clip list below the stage shows your own clips plus public ones; you can replay any of them and delete your own.
+
+## Walkthrough
+
+1. Open [/mocap-studio](https://three.ws/mocap-studio). An avatar loads (yours if you are signed in with a public avatar, otherwise the default). To use someone else's, type their handle and load it.
+2. Click "Start camera" and allow webcam access. Your face appears in the small preview; the avatar starts mirroring you.
+3. Sit with a relaxed, neutral face and click "Calibrate neutral" so the resting baseline is captured.
+4. Click "Record", perform (talk, smile, raise your brows, turn your head), then click "Stop". The timer shows the clip length.
+5. Click "Replay" to watch the avatar perform the captured clip.
+6. Give it a name (and optional description, tags, visibility), then "Save clip", or "Download" to keep the JSON locally.
+7. Browse the clip list and replay any public clip on the avatar.
+
+## Examples
+
+Mocap Studio is a browser tool; its examples are its deep link and the clip API.
+
+- **Load a specific handle's avatar:** `https://three.ws/mocap-studio?handle=<username>`
+
+The clip format saved is the object `FaceMocap` records: `{ format, duration, frames: [{ t, shapes, mat? }] }`. The API:
+
+```bash
+# List your clips plus public ones.
+curl 'https://three.ws/api/mocap/clips?include_public=true&limit=30' \
+ -H 'cookie: <session>'
+
+# Save a recorded clip (visibility: private | unlisted | public).
+curl -X POST 'https://three.ws/api/mocap/clips' \
+ -H 'content-type: application/json' -H 'cookie: <session>' \
+ -d '{"name":"eyebrow-raise","visibility":"public","tags":["face"],
+ "clip":{"format":"arkit52","duration":3.2,"frames":[{"t":0,"shapes":[0,0,0]}]}}'
+
+# Fetch one clip by id to replay it.
+curl 'https://three.ws/api/mocap/clips/<clipId>' -H 'cookie: <session>'
+```
+
+## States & limits
+
+- **Camera permission is required.** The whole pipeline depends on webcam access; nothing captures until you grant it. The video is processed locally in the browser to drive the avatar.
+- **Calibrate for clean results.** Without calibration your resting expression is treated as neutral, so calibrate on a relaxed face for accurate deltas.
+- **Head rotation is clamped.** The captured head pose drives the head/neck bone within a limited range, so extreme off-camera angles do not snap the neck.
+- **Saving needs an account.** Recording, replaying, and downloading a clip are open to everyone; saving to the platform requires sign-in. An avatar association is only attached when you own the loaded avatar, otherwise the clip still saves, just without an avatar link.
+- **Replay needs the camera started.** Playing a saved clip attaches to the same driver the camera set up, so start the camera before replaying a clip from the list.
+- **Clips are data, not video.** A saved clip is compact JSON (blendshape scores plus head matrices per frame), so it is cheap to store and share and can replay on any compatible avatar, not a rendered movie.
+
+## Related
+
+- [Avatar Studio](./avatar-studio.md): build the avatar you drive here.
+- [Animation Studio](./animation-studio.md): body posing and keyframed motion, the complement to facial capture.
+- [Animations reference](./animations.md): how captured and authored motion fit the platform's clip registry.
+- [/create](https://three.ws/create): make or import the avatar to perform with.
+
+---
+
+<a id="sec-179"></a>
> **Source:** `docs/money-feed.md` · [↑ table of contents](#table-of-contents)
@@ -35757,6 +40772,11 @@ spend, and the economy volume dashboard built on top of it. They are distinct
layers with distinct sources — this page maps them so you know where any given
event lives.
+> Not to be confused with the **personal activity feed** on `/feed`
+> (`GET /api/users/me/feed`) — that one shows who created what and who followed
+> whom, and is documented in [The social layer](./social-layer.md). This page is
+> about value movement only. The two share a URL word ("feed") and nothing else.
+
---
## The three layers
@@ -35789,6 +40809,7 @@ fixed allow-list of types:
| `payment` | A skill/service payment confirmed (`usdcAtomic`, `recipientLabel`, `txSig`, `explorerUrl`). |
| `level-up`, `world-join`, `jackpot`, `mission-complete` | Play / world events. |
| `member-join` | A person signed in (throttled to once per user per 6h). |
+| `agent-guard` | An autonomous buy was refused by a safety rule (`agentId`, `mint`, `reason`, `label`). |
| `agora-registered`, `agora-task-posted`, `agora-hired`, `agora-task-claimed`, `agora-task-completed`, `agora-earned`, `agora-vouched`, `agora-flagged` | [Agora](agora.md) on-chain economy lifecycle events. |
The ticker is a **curated delight layer**, not an exhaustive log: an event only
@@ -35813,7 +40834,8 @@ the volume dashboard.
Each row carries: `agent_id`, `user_id`, `event_type` (e.g. `spend`),
`category` (`trade` | `snipe` | `x402` | `withdraw` | `tip` | …), `network`,
`asset`, `amount_lamports` / `amount_raw`, `usd`, `destination`, `signature`,
-`status`, an `idempotency_key`, and a `meta` JSON blob. Spends pass through the
+`reason`, `status`, an `idempotency_key`, an optional `capability_id`, and a
+`meta` JSON blob. Spends pass through the
spend-cap and policy engine before they are recorded (see
[Agent wallets](agent-wallets.md)).
@@ -35850,7 +40872,7 @@ and millisecond `ts`.
---
-<a id="sec-148"></a>
+<a id="sec-180"></a>
> **Source:** `docs/money-map.md` · [↑ table of contents](#table-of-contents)
@@ -35872,7 +40894,7 @@ signer/funder wallets and how to fund them).
Money-routing is deliberately **config-driven** — no receiver is hardcoded, so an
unset receiver fails closed rather than silently routing real USDC to a baked-in
-address ([env.js:732](../api/_lib/env.js#L732)).
+address ([env.js:786](../api/_lib/env.js#L786)).
### Receivers (inbound USDC)
| Env var | Role | Value |
@@ -35926,7 +40948,7 @@ encodings, minimum balances, guards, funding tool — in the
| `club-cover` | platform receiver (kept) | 100% | funds the club float; issues a door pass |
| `cosmetic-purchase` | platform receiver → split | 50% | creator 50% (≤90%) from `COSMETIC_SPLIT_TREASURY_*` |
| marketplace skill sale | agent owner `payout_address` | 0–10% fee | atomic split; fee → fee wallet |
-| labor skill (escrow) | worker + author | author 10% royalty | paid from escrow ([labor-settle.js:95](../api/_lib/labor-settle.js#L95)) |
+| labor skill (escrow) | worker + author | author 10% royalty | paid from escrow ([labor-settle.js:97](../api/_lib/labor-settle.js#L97)) |
| pump trade | counterparty | 0–5% fee | fee appended to trader's tx |
| `pump-launch` | `X402_PAY_TO_SOLANA/BASE` | 100% of $5 | pump.fun creator rewards accrue on-chain to nominated wallet |
| `ring-settle` (internal) | `X402_PAY_TO_SOLANA` | 100% | recirculates (dogfood volume) |
@@ -35958,17 +40980,19 @@ unit economics.
## 4. Services catalog (what three.ws sells)
-- **x402 HTTP endpoints** — ~47 paid endpoints across intel/oracle, agent/reputation,
- generation/3D, launch/naming/utility, club, avatar shop, and bazaars. Full list
- and prices: [x402 endpoints](x402-endpoints.md).
+- **x402 HTTP endpoints**: 80+ paid endpoints (81 distinct paid routes in the
+ [ring catalog](../api/_lib/x402/ring-catalog.js), the single source of truth)
+ across intel/oracle, agent/reputation, generation/3D, launch/naming/utility,
+ club, avatar shop, and bazaars. Full list and prices:
+ [x402 endpoints](x402-endpoints.md).
- **Paid MCP tools** —
- Main MCP ([api/mcp.js](../api/mcp.js), pricing `api/_lib/pump-pricing.js`):
`retexture_model` $0.10, `optimize_model` $0.05, `segment_model` $0.04,
`retexture_region` $0.03, `inspect_model`/`validate_model` $0.01,
`render_avatar` $0.005, `search_public_avatars`/`solana_agent_reputation` $0.001.
- 3D Studio MCP ([api/mcp-3d.js](../api/mcp-3d.js), pricing `api/_mcp3d/pricing.js`):
- 14 priced tools — `text_to_3d`/`image_to_3d` tiered (draft/standard/high),
- `auto_rig_model`/`capture_scene`/`retexture_model`/`retexture_region` $0.05,
+ 15 priced tools: `text_to_3d`/`image_to_3d` tiered (draft/standard/high),
+ `auto_rig_model`/`capture_scene`/`retexture_model`/`retexture_region`/`anchor_provenance` $0.05,
`stylize_model`/`remesh_model`/`segment_model` $0.02,
`remove_background`/`pose_model`/`apply_animation`/`direct_prompt`/`generate_material` $0.01.
- **OKX.AI ASP #2632 "three.ws 3D Studio"** — the same 3D pipeline listed on OKX.AI
@@ -36043,7 +41067,7 @@ that set `auto_fund_enabled = true` (default off). See
---
-<a id="sec-149"></a>
+<a id="sec-181"></a>
> **Source:** `docs/multi-agent.md` · [↑ table of contents](#table-of-contents)
@@ -36310,7 +41334,7 @@ leo.addEventListener('brain:message', async (e) => {
});
```
-For a fully shared namespace across agents, set both to the same IPFS memory namespace in their manifests:
+For a fully shared starting point, point both agents at the same pinned IPFS memory bundle in their manifests:
```json
{
@@ -36321,7 +41345,7 @@ For a fully shared namespace across agents, set both to the same IPFS memory nam
}
```
-Both agents then read from and write to the same memory bundle. New memories written by Leo during a conversation will be visible to Mira on her next turn. Note that the `encrypted-ipfs` mode is not yet fully wired; use plain `ipfs` for shared scenes.
+Both agents then load the same memory bundle at boot. Runtime writes stay in each agent's own session, so for live sharing during a conversation use the host-page bridge above (`memory.note` into the other agent), or register a custom backend (`Memory.registerBackend`) that both agents point at. Avoid `encrypted-ipfs` for shared scenes: its key is derived from one wallet's signature, so two agents can only share it if they share the same wallet-derived key.
---
@@ -36372,12 +41396,23 @@ To extend this into a full turn-based scene, add a `brain` attribute to Mira wit
---
-<a id="sec-150"></a>
+## Related
+
+- [Agent system](/docs/agent-system): the runtime, protocol bus, and stage-scoped tools
+- [How three.ws works](/docs/how-it-works): the embed boot sequence each `<agent-3d>` follows
+- [Memory system](/docs/memory): namespaces and custom backends for shared context
+- [Layers](/docs/layers): where `<agent-stage>` sits in the embed layer
+
+---
+
+<a id="sec-182"></a>
> **Source:** `docs/nvidia-models.md` · [↑ table of contents](#table-of-contents)
# NVIDIA models on three.ws — the free inference layer
+If you generate a 3D model on [/forge](https://three.ws/forge), chat with an agent, or hear an avatar speak, there is a good chance an NVIDIA-hosted model did the work. This page is for developers and operators who want to know exactly which model sits behind each feature.
+
three.ws runs a large share of its AI on NVIDIA's free hosted models. **One key — `NVIDIA_API_KEY` (an `nvapi-…` token from [build.nvidia.com](https://build.nvidia.com)) — unlocks every model on this page.** There is no per-model billing, no per-seat cost, and no SLA: it is a rate-limited free tier, which is exactly why the platform treats it as a *free-first* lane and always keeps a fallback behind it.
This document is the canonical map of **which NVIDIA-hosted model does what, where it's wired, and why**. Every model and endpoint below is in production source — nothing here is aspirational.
@@ -36431,11 +41466,11 @@ This is the headline free model. **Microsoft TRELLIS hosted on NVIDIA NVCF gives
**How it works:**
- Async by default. Submit returns `202 + NVCF-REQID`; the forge polls the NVCF status endpoint until the GLB is ready (or the job completes synchronously within a 30 s window).
-- **Quality scales by sampling steps**, clamped to TRELLIS's 10–50 window: draft `15/15`, standard `25/25`, high `40/40` (`ss_sampling_steps` / `slat_sampling_steps`).
+- **Sampling steps are pinned to the proven budget.** TRELLIS accepts 10 to 50 steps, but the hosted preview only returns inside the gateway's synchronous window at the low end, so the free lane runs `15/15` (`ss_sampling_steps` / `slat_sampling_steps`) for both draft and standard tiers. The `40/40` budget is reserved for a self-hosted TRELLIS NIM; the high tier itself defaults to the self-hosted Hunyuan3D engine, not this lane.
- Prompts are clamped to **77 characters** (TRELLIS truncates server-side) and get a `, studio lighting` suffix unless the caller already supplied lighting/color cues — without it TRELLIS defaults to dark, gritty output.
- Output GLBs arrive in several shapes over time (inline base64, bare string, CDN URL, numeric-keyed object, raw bytes); the extractor normalizes all of them, then **persists the bytes to R2** so three.ws owns a durable public URL.
-**Key constraint — text only.** NVIDIA's *hosted preview* rejects every user-image input form (verified live; see `tasks/nvidia-nim/probes/trellis.md`). So **photo→3D never routes here** — it falls to the free Hugging Face Spaces lane (Hunyuan3D / TRELLIS / TripoSR). A self-deployed TRELLIS NIM accepts real images; this is a hosted-preview limitation, not a model one.
+**Key constraint: text only.** NVIDIA's *hosted preview* rejects every user-image input form (verified live 2026-06-11). So **photo to 3D never routes here**: it falls to the free reconstruct chain in `FREE_FALLBACK_FOR_PATH` (the self-hosted TRELLIS GPU worker first, then the self-hosted Hunyuan3D worker, then the free Hugging Face Spaces lane). A self-deployed TRELLIS NIM accepts real images; this is a hosted-preview limitation, not a model one.
---
@@ -36463,7 +41498,7 @@ NVIDIA NIM hosts 100+ open-weight chat models behind the one key, all OpenAI-com
**Model:** `meta/llama-3.3-70b-instruct`
**Source:** [api/_lib/llm.js](../api/_lib/llm.js), [api/_lib/chat-models.js](../api/_lib/chat-models.js).
-The platform's general LLM helper runs a **free-first ladder: Groq → OpenRouter → NVIDIA NIM**, and only then a paid backstop (Anthropic/OpenAI). NVIDIA is the **independent third free lane** — same Llama 3.3 70B family as the Groq/OpenRouter entries, but a different provider, so an outage on two lanes still answers on the third. It's tool/function-calling capable, so it's eligible for tool-required requests.
+The platform's general LLM helper runs a **free-first ladder: Groq → Cerebras → OpenRouter → NVIDIA NIM**, followed by further keyless free rungs (OVH, Gemini, Pollinations) and only at the very end a paid backstop (Anthropic/OpenAI). NVIDIA serves the **same Llama 3.3 70B family** as the Groq/Cerebras/OpenRouter rungs but on an independent provider, so an outage on the other free lanes still answers here. It's tool/function-calling capable, so it's eligible for tool-required requests.
This lane powers the platform's built-in AI surfaces — chat, embedded site widgets, the tutor, the fact-checker, persona tools, agent-to-agent talk, the transaction explainer — all of which lead with the free providers and only fall through to a paid model if every free lane fails.
@@ -36539,7 +41574,7 @@ A free content-safety pre-filter for anonymous chat. NemoGuard classifies the in
**Model:** `magpie-tts-multilingual` · **Transport:** Riva gRPC at `grpc.nvcf.nvidia.com:443`
**Source:** [api/_lib/tts-nvidia.js](../api/_lib/tts-nvidia.js) (mirrored in `packages/avatar-agent-mcp/src/lib/tts-nvidia.js`).
-The free NVIDIA TTS lane — **Magpie multilingual on Riva**, selected by an NVCF `function-id`, speaking over the standard Riva gRPC synthesis contract (protos shipped in `riva-protos/` and loaded from a generated descriptor, so there's no `.proto` build step). Drives **avatar speech** with multilingual voices. Configured by the presence of `NVIDIA_API_KEY`; returns synthesized audio bytes, with a clear error if the lane returns empty audio.
+The free NVIDIA TTS lane: **Magpie multilingual on Riva**, selected by an NVCF `function-id`, speaking over the standard Riva gRPC synthesis contract (protos shipped in `api/_lib/riva-protos/` and loaded from a generated descriptor, so there's no `.proto` build step). Drives **avatar speech** with multilingual voices. Configured by the presence of `NVIDIA_API_KEY`; returns synthesized audio bytes, with a clear error if the lane returns empty audio.
---
@@ -36561,11 +41596,18 @@ The free NVIDIA TTS lane — **Magpie multilingual on Riva**, selected by an NVC
| `KNOWLEDGE_RERANK_ENABLED=1` | Turns on the rerank stage (§6) |
| `FORGE_PREFER_FREE` | Free-first reconstruct ordering (default on) |
-Probe transcripts for every lane — request/response shapes, limits, verified behavior — live under `tasks/nvidia-nim/probes/`.
+---
+
+## Related
+
+- [How Forge works](/docs/how-forge-works) - the /forge product this layer powers
+- [REST API](/docs/api-reference) - the endpoints these models serve
+- [Configuration](/docs/configuration) - all environment variables
+- [MCP](/docs/mcp) - the `forge_free` MCP tool on the free TRELLIS lane
---
-<a id="sec-151"></a>
+<a id="sec-183"></a>
> **Source:** `docs/nvidia-nemotron-spotlight.md` · [↑ table of contents](#table-of-contents)
@@ -36720,7 +41762,7 @@ Build the small stuff. Put it in front. The generator was never the hard part.
---
-<a id="sec-152"></a>
+<a id="sec-184"></a>
> **Source:** `docs/okx-marketplace.md` · [↑ table of contents](#table-of-contents)
@@ -36862,9 +41904,9 @@ backed by the same engines the [MCP 3D studio](./mcp.md) runs (no separate pipel
| Text → 3D Model (GLB) | $0.01 | `/api/okx/3d/text-to-3d` | `prompt` |
| Text → 3D Model (Pro) | $0.30 | `/api/okx/3d/text-to-3d-pro` | `prompt`, `tier?` |
| Image → 3D Model | $0.30 | `/api/okx/3d/image-to-3d` | `image_urls[]` |
-| Auto-Rig a GLB | $0.25 | `/api/okx/3d/rig` | `glb_url` |
+| GLB Auto-Rigging | $0.25 | `/api/okx/3d/rig` | `glb_url` |
| Text → Rigged Avatar | $0.50 | `/api/okx/3d/avatar` | `prompt` or `image_url` |
-| Animation Retarget | $0.10 | `/api/okx/3d/retarget` | `model_url`, `animation` |
+| Animation Retargeting | $0.10 | `/api/okx/3d/retarget` | `model_url`, `animation` |
| Pose Seed | $0.02 | `/api/okx/3d/pose-seed` | `prompt` |
| FBX Export (rig-preserving) | $0.10 | `/api/okx/3d/fbx-export` | `model_url`, `format?` |
@@ -36907,7 +41949,7 @@ curl -i -X POST https://three.ws/api/okx/3d/image-to-3d \
-d '{"image_urls":["https://example.com/owl-front.jpg","https://example.com/owl-side.jpg"]}'
```
-### Auto-Rig a GLB — $0.25
+### GLB Auto-Rigging — $0.25
Adds an animation-ready humanoid skeleton and skin weights to a static GLB (UniRig lane).
@@ -36930,7 +41972,7 @@ curl -i -X POST https://three.ws/api/okx/3d/avatar \
-d '{"prompt":"a heroic knight in silver armor, full body"}'
```
-### Animation Retarget — $0.10
+### Animation Retargeting — $0.10
Retargets a curated clip (idle, walk, dance, …) onto any rigged humanoid GLB — returns the
retargeted AnimationClip JSON keyed to the rig's actual bones plus a bone-coverage report.
@@ -36987,13 +42029,13 @@ USDC rails. The wire format OKX buyers use (headers `PAYMENT-REQUIRED` /
---
-<a id="sec-153"></a>
+<a id="sec-185"></a>
> **Source:** `docs/onchain-agents.md` · [↑ table of contents](#table-of-contents)
# Deploying Agents On-Chain (Bulk)
-Give every three.ws agent a real on-chain identity: a **Metaplex Core NFT** minted into the **three.ws Agents collection** on Solana. This is the bulk/admin counterpart to the single-agent, user-signed flow in [Solana agents](solana.md) — it deploys many agents server-side, with a live recording dashboard and a CLI runner.
+Give every three.ws agent a real on-chain identity: a **Metaplex Core NFT** minted into the **three.ws Agents collection** on Solana. This page is for platform admins and self-hosters; regular users register a single agent through the wallet-signed flow instead. It is the bulk/admin counterpart to the single-agent, user-signed flow in [Solana agents](solana.md): it deploys many agents server-side, with a live recording dashboard at `/admin/bulk-launch` and a CLI runner.
> Not pump.fun. These are NFTs (on-chain identity), not tokens. The only coin three.ws ever references is `$THREE`; it appears in each asset's metadata as a link, nothing more.
@@ -37284,7 +42326,798 @@ A confirmed canary asset shows `inCollection=true`, `royalty=500bps`, `attrs=11`
---
-<a id="sec-154"></a>
+<a id="sec-186"></a>
+
+> **Source:** `docs/openai-pr/00-START-HERE.md` · [↑ table of contents](#table-of-contents)
+
+# OpenAI Apps SDK submission — agent handoff pack
+
+This directory contains standalone task briefs. Each `NN-*.md` file is a complete
+prompt you can hand to one agent. They are ordered by impact and are mostly
+independent, so several can run in parallel. Read this file first, then the brief
+for your task.
+
+## What we are shipping
+
+three.ws is submitting its **3D Studio** app to OpenAI (ChatGPT Apps SDK / App
+Directory). The submission target is the **free, keyless MCP connector** at
+`https://three.ws/api/mcp-studio` plus its inline widget and the custom-GPT
+Actions surface. A reviewer at OpenAI will exercise these surfaces and read the
+manifests we expose. Everything they can reach must be correct, consistent, and
+free of any paid or crypto surface.
+
+The submission kit already exists at
+[`prompts/store-submissions/_generated/`](../../prompts/store-submissions/_generated/)
+(answer sheet `openai-submission.md`, `openai-actions.yaml`, `TRACKER.md`,
+screenshots, evidence JSON). Your job is not to recreate it. Your job is to close
+the specific gaps that would fail review or embarrass us in front of OpenAI.
+
+## The map of the surface (so you know what you are touching)
+
+| Surface | Where it lives | Notes |
+| --- | --- | --- |
+| Free MCP connector (submission target) | `api/mcp-studio.js`, `api/_mcp-studio/*` | Keyless. 9 tools. Real forge lane. |
+| Inline ChatGPT widget (the real one) | `api/_mcp-studio/component.js` | `<model-viewer>` skybridge resource `ui://widget/three-studio-model.html` |
+| Orphaned three.js widget | `apps-sdk/studio-viewer/*`, `scripts/build-apps-sdk-viewer.mjs`, `public/apps-sdk/*` | NOT wired to anything. See task 01. |
+| Embodiment embed | `apps-sdk/embodiment/*`, `pages/embodiment/embed.html` | Persona widget iframes this. |
+| AR-in-ChatGPT | `api/ar.js`, `api/_lib/ar-launch.js` | Every generation carries `arUrl`. |
+| Custom GPT Actions (REST) | `api/3d/studio.js`, `prompts/store-submissions/_generated/openai-actions.yaml` | GPT Store listing is live. |
+| Served manifests | `public/.well-known/*` | Publicly discoverable. See task 02. |
+| Paid MCP server (NOT the submission) | `api/mcp-3d.js`, `api/_mcp3d/*` | x402/OAuth gated. Out of scope unless a task says so. |
+
+## The tasks
+
+| # | Brief | Priority | Blocks submit? |
+| --- | --- | --- | --- |
+| 01 | [Resolve the orphaned studio-viewer widget](01-orphan-widget-resolution.md) | P0 | Yes (dead code + false docs) |
+| 02 | [Reconcile the served `.well-known` manifests with the zero-payment claim](02-wellknown-manifest-conflict.md) | P0 | Yes (reviewer-discoverable crypto surface) |
+| 03 | [Make the `forge_free` tier story true everywhere](03-forge-free-tier-truth.md) | P1 | Yes (submission doc contradicts code) |
+| 04 | [Close the test gaps on the ChatGPT-facing surface](04-openai-surface-test-coverage.md) | P1 | No, but required for "done" |
+| 05 | [Serve the custom-GPT OpenAPI and align legal URLs](05-custom-gpt-openapi-serving.md) | P1 | Partial |
+| 06 | [Fix doc accuracy and reconcile the tool-count story](06-docs-accuracy-reconciliation.md) | P1 | No |
+| 07 | [Final live verification and submit checklist](07-final-verification-and-submit.md) | P2 (runs last) | Yes (the actual go/no-go) |
+
+Run 01, 02, 03 first (they change code and docs the later tasks depend on). 04, 05,
+06 can run in parallel after. 07 runs last, after everything else is merged.
+
+## Rules every task must follow (from `CLAUDE.md`)
+
+These are non-negotiable and OVERRIDE any default behavior:
+
+1. **No mocks, no fake data, no placeholders, no TODOs, no stubs, no commented-out
+ code.** If you write it, finish it and wire it. Real APIs only.
+2. **Execute, do not interview.** Pick the most reasonable interpretation, do it,
+ verify it, and report. Do not end your turn with "want me to proceed?".
+3. **Every state is designed** (loading/empty/error/populated) for any UI you touch.
+4. **Tests must pass:** run `npm test` (do NOT pipe through `tail` — it masks the
+ exit code; a vitest failure gates the Playwright stage).
+5. **Changelog:** any user-visible change gets an entry in
+ [`data/changelog.json`](../../data/changelog.json) (date, plain-language title +
+ summary, tags from feature/improvement/fix/sdk/infra/docs/security). Run
+ `npm run build:pages` to regenerate and validate the feed. Internal-only chores
+ do not get an entry.
+6. **Docs ship with the feature.** If you touch a surface and its doc is now wrong,
+ fix the doc in the same change. New page/route → `data/pages.json`.
+7. **Commit gate — read this before staging anything.** `$THREE`
+ (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) is the only coin this platform
+ promotes. Before any `git commit` whose diff references ANY crypto project other
+ than `$THREE` — in code, docs, manifests, tests, or commit text — STOP and get
+ explicit owner approval. Task 02 edits a manifest that currently mentions x402/
+ USDC/Solana/Base; edits that keep or restructure those references need the owner's
+ yes before commit. Do the work, stage nothing that trips the gate, and flag it.
+8. **Do not push, deploy, or submit to OpenAI without owner approval.** Commit
+ locally, prepare everything so the ship is one command, and say what remains.
+9. **Never use the em-dash character.** Use a period, comma, colon, or parentheses.
+10. **Concurrent agents share this worktree.** Stage explicit paths only (never
+ `git add -A`). Re-check `git status` and `git diff --staged` right before you
+ commit.
+
+## Definition of done for the whole pack
+
+- [ ] Every P0/P1 task's own definition of done is met.
+- [ ] `npm test` is green.
+- [ ] No surface a reviewer can reach advertises a paid or crypto capability.
+- [ ] Every doc and manifest describing the ChatGPT surface matches the running code.
+- [ ] `docs/openai-pr/07-final-verification-and-submit.md` checklist passes end to end.
+- [ ] The only remaining steps are the human `[HUMAN: ...]` items in `TRACKER.md`.
+
+---
+
+<a id="sec-187"></a>
+
+> **Source:** `docs/openai-pr/01-orphan-widget-resolution.md` · [↑ table of contents](#table-of-contents)
+
+# Task 01 — Resolve the orphaned studio-viewer widget (P0)
+
+Read [`00-START-HERE.md`](00-START-HERE.md) first for the shared rules and the map.
+
+## The problem (verified, with evidence)
+
+There are **two** inline-widget implementations in the tree, and they are not
+connected:
+
+1. **The widget ChatGPT actually renders** is the `<model-viewer>` component built
+ inline in [`api/_mcp-studio/component.js`](../../api/_mcp-studio/component.js)
+ (`COMPONENT_HTML`). It is served as the skybridge resource
+ `ui://widget/three-studio-model.html` and is fully wired and tested.
+
+2. **A second, unrelated three.js viewer** lives in
+ [`apps-sdk/studio-viewer/src.js`](../../apps-sdk/studio-viewer/src.js) (619 lines,
+ full GLTFLoader + OrbitControls + RoomEnvironment). It is built by
+ [`scripts/build-apps-sdk-viewer.mjs`](../../scripts/build-apps-sdk-viewer.mjs)
+ into `public/apps-sdk/studio-viewer.bundle.js` and `.../studio-viewer.html`.
+
+The second one is **orphaned**:
+
+- The consumer the build script names,
+ `api/_mcp3d/studio-viewer-resource.js`, **does not exist** (confirmed:
+ `ls` returns "No such file or directory").
+- Nothing serves `ui://widget/studio-viewer.html`. The only references to that URI
+ are the source comment in `apps-sdk/studio-viewer/src.js:7` and the build script
+ comment in `scripts/build-apps-sdk-viewer.mjs:8`.
+- The `/viewer` route in `vercel.json` maps to `/viewer.html`, a different page, not
+ this bundle.
+- The build is not in `prebuild`/`build`, so the committed bundle can silently go
+ stale.
+
+On top of that, [`apps-sdk/README.md`](../../apps-sdk/README.md) **describes the
+orphaned viewer as if it were the live ChatGPT widget** (lines 17 and 59 claim the
+bundle is "Bundled into the `ui://widget/studio-viewer.html` skybridge resource
+served to ChatGPT" and "Read at runtime by
+`api/_mcp3d/studio-viewer-resource.js`"). Both statements are false against the
+current tree. For a handoff to OpenAI, a public README that misdescribes our own
+integration is unacceptable.
+
+## Your job
+
+Pick ONE of these two resolutions, implement it fully, and make the README true.
+Default to Option A unless you find a concrete reason the three.js viewer is
+better for our submission (if so, state it in your report and do Option B).
+
+### Option A (default) — Delete the dead path
+
+The live `<model-viewer>` widget in `component.js` already renders GLBs inline in
+ChatGPT, is tested, and is what the screenshots were taken against. The three.js
+viewer duplicates it with no consumer.
+
+1. Delete `apps-sdk/studio-viewer/` (the whole subdir), `scripts/build-apps-sdk-viewer.mjs`,
+ the `build:apps-sdk-viewer` script in `package.json`, and the generated
+ `public/apps-sdk/studio-viewer.bundle.js` + `public/apps-sdk/studio-viewer.html`
+ (and any `dist/apps-sdk/*` copies). Grep first for every reference and remove
+ each one so nothing dangles.
+2. Rewrite [`apps-sdk/README.md`](../../apps-sdk/README.md) so the `studio-viewer`
+ section is gone and the doc accurately describes the two things that DO ship from
+ `apps-sdk/`: the embodiment engine, and a pointer to where the real ChatGPT widget
+ lives (`api/_mcp-studio/component.js`). Do not leave a section describing a
+ directory you just deleted.
+3. Update [`STRUCTURE.md`](../../STRUCTURE.md) if it references `apps-sdk/studio-viewer`.
+
+### Option B — Wire the three.js viewer as the real widget
+
+Only if you determine the three.js viewer is materially better (PBR lighting, contact
+shadow, animation mixer) than the CDN `<model-viewer>` and worth being the widget.
+
+1. Create the missing resource module (the correct path, given the free connector
+ owns the widget, is under `api/_mcp-studio/`, not `api/_mcp3d/`) that reads the
+ built bundle and serves it as the `text/html+skybridge` resource. Register it in
+ [`api/_mcp-studio/dispatch.js`](../../api/_mcp-studio/dispatch.js) alongside the
+ existing `three-studio-model.html` resource and point the tool
+ `openai/outputTemplate` at it.
+2. Add `build:apps-sdk-viewer` to the build pipeline (`prebuild` or `build`) so the
+ bundle can never go stale, and add it to the esbuild-bundle guard if applicable.
+3. Add a test that the resource serves non-empty HTML containing the bundle and
+ carries the required `openai/widgetCSP`/`widgetDescription` metadata.
+4. Make `apps-sdk/README.md` accurate against the new wiring (correct file path,
+ correct `ui://` URI, correct build step).
+
+Whichever option: **the CSP must still allowlist exactly the origins the widget
+fetches from** (three.ws, the R2 storage origin, and the CDN if used). Match what
+`api/_mcp-studio/component.js` `componentCsp()` already does.
+
+## Constraints
+
+- Follow every rule in `00-START-HERE.md`.
+- This is not a crypto surface, so the commit gate does not apply here, but still
+ stage explicit paths only.
+- No dead references left behind: after your change, `grep -rn "studio-viewer" .`
+ (excluding node_modules) must return only intentional, accurate hits.
+
+## Verification
+
+- `grep -rn "apps-sdk/studio-viewer\|studio-viewer-resource\|widget/studio-viewer" . | grep -v node_modules`
+ returns only what your chosen option intends (nothing for Option A; the real
+ resource wiring for Option B).
+- `npm test` is green (run the full suite, do not pipe through `tail`).
+- For Option B: build the bundle, load the served resource, and confirm it renders a
+ GLB. For Option A: confirm the live `<model-viewer>` widget still renders (exercise
+ a `forge_free` call against `/api/mcp-studio` and open the resulting `viewerUrl`).
+- `apps-sdk/README.md` reads correctly to someone with zero context and every file
+ path and `ui://` URI in it resolves.
+
+## Definition of done
+
+- [ ] One option fully implemented, no half-state.
+- [ ] `apps-sdk/README.md` is accurate; `STRUCTURE.md` updated if needed.
+- [ ] No dangling references to the deleted/created paths.
+- [ ] `npm test` green.
+- [ ] `data/changelog.json` entry if this changed anything user-visible (Option B
+ would; Option A is an internal cleanup and doc fix, which is `docs`-tagged only
+ if the README is user-facing — use judgment, default to a short `docs`/`infra`
+ entry).
+- [ ] Report states which option you chose and why.
+
+---
+
+<a id="sec-188"></a>
+
+> **Source:** `docs/openai-pr/02-wellknown-manifest-conflict.md` · [↑ table of contents](#table-of-contents)
+
+# Task 02 — Reconcile the served `.well-known` manifests with the zero-payment claim (P0)
+
+Read [`00-START-HERE.md`](00-START-HERE.md) first. **This task touches a manifest
+that references crypto/x402. The commit gate in `00-START-HERE.md` rule 7 applies:
+do the work, but do NOT commit anything that references a non-$THREE crypto project
+without explicit owner approval. Flag it in your report instead.**
+
+## The problem (verified, with evidence)
+
+Our OpenAI submission answer sheet
+([`prompts/store-submissions/_generated/openai-submission.md`](../../prompts/store-submissions/_generated/openai-submission.md))
+asserts the app has a **zero payment surface** and no crypto capability. But a public,
+reviewer-discoverable manifest at a well-known path says the opposite.
+
+[`public/.well-known/ai-plugin.json`](../../public/.well-known/ai-plugin.json)
+currently reads (verbatim):
+
+```
+"description_for_human": "three.ws — 3D avatar/world generation and live crypto intelligence APIs, pay-per-call via x402.",
+"description_for_model": "three.ws exposes a 3D model viewer plus a paid pay-per-call API catalog settled via the x402 protocol (HTTP 402, USDC on Solana and Base): ... The machine-readable catalog with prices and schemas is at https://three.ws/.well-known/x402.json ..."
+```
+
+And [`public/.well-known/openapi.yaml`](../../public/.well-known/openapi.yaml) (71KB)
+describes the general REST platform (Auth/Avatars/Keys/OAuth/MCP) and does **not**
+include the 3D Studio endpoints (`/api/3d/studio`, `/api/ar`, `forge_free`).
+
+An OpenAI reviewer hitting `https://three.ws/.well-known/ai-plugin.json` sees a
+crypto/payments pitch, directly contradicting the submission. This is the single
+most likely thing to sink the review.
+
+## Important scoping decision (this is why the task is delicate)
+
+This manifest is **also a real, live product surface** for the general three.ws
+platform and its x402 catalog. It is not junk to be deleted. The `$THREE` /
+platform rules in `CLAUDE.md` say the x402 economy and launch directories are real
+features, not leaks to be stripped. So the goal is **not** to erase the crypto
+platform. The goal is to make sure the OpenAI-facing app is cleanly separable from
+it and that the manifest a reviewer reads for the 3D Studio app does not conflate
+the two.
+
+Do NOT unilaterally gut the platform manifest. Instead, implement the option below
+that keeps both stories true, and surface the decision in your report.
+
+## Your job
+
+Make the OpenAI-app surface and the paid-platform surface cleanly distinct at the
+manifest layer. Recommended approach (implement this unless you find it wrong):
+
+1. **Keep the existing platform manifest honest but move it off the bare
+ `ai-plugin.json` default if that is what a ChatGPT reviewer keys on.** Confirm
+ whether ChatGPT Apps SDK review actually reads `/.well-known/ai-plugin.json`
+ (legacy ChatGPT-plugins manifest) at all, or whether the App Directory review is
+ driven purely by the MCP connector metadata and the submitted OpenAPI. Document
+ what you find with a source. This determines how much the manifest even matters.
+
+2. **The 3D Studio app must have its own, self-describing, payment-free discovery
+ artifact.** The custom-GPT OpenAPI already exists at
+ `prompts/store-submissions/_generated/openai-actions.yaml` but is not served
+ (Task 05 owns serving it). Coordinate with Task 05: the served, discoverable
+ schema for the 3D Studio app must describe only `/api/3d/studio` and `/api/ar`,
+ with `auth: none`, no x402, no prices, no chain references.
+
+3. **Fix the misleading fields on the platform manifest that a 3D-app reviewer would
+ see as conflicting**, without deleting the real x402 catalog:
+ - `logo_url` is `favicon.ico` (`ai-plugin.json:14`). The submission cites a
+ 512x512 owned-IP icon. At minimum the logo should be a real branded PNG, not the
+ favicon.
+ - Make it unambiguous, in both the human and model descriptions, which
+ capabilities are free and which are paid, so nothing reads as "the 3D app costs
+ crypto." The 3D generation lane IS free and keyless. Say so plainly.
+
+4. **Add a test** asserting that whatever manifest describes the 3D Studio app (the
+ served Task-05 schema) contains no payment/crypto tokens. Reuse the regex approach
+ already in [`tests/mcp-studio.test.js`](../../tests/mcp-studio.test.js) (it asserts
+ the MCP connector is crypto-surface-free) and apply it to the served 3D-app schema.
+
+## What NOT to do
+
+- Do not delete `public/.well-known/x402.json`, the x402 catalog, or the paid
+ platform's own manifests. Those are real features.
+- Do not strip existing other-coin references as if they were secrets (that
+ enforcement is retired per `CLAUDE.md`). The commit gate is about not *committing*
+ new non-$THREE references, not about scrubbing the working tree.
+- Do not silently change what the paid platform advertises to its own users.
+
+## Constraints
+
+- Every rule in `00-START-HERE.md`, especially the commit gate (rule 7) and
+ no-push/no-submit (rule 8).
+- If your fix requires editing a file whose diff still references x402/USDC/Solana/
+ Base/another chain, prepare the edit, run the tests, and STOP before commit with a
+ one-line flag to the owner. Do not commit that diff yourself.
+
+## Verification
+
+- `curl -s https://three.ws/.well-known/ai-plugin.json` (or read the file) and
+ confirm the 3D-app story is unambiguous and payment-free where it describes the app.
+- The served 3D Studio schema (Task 05) passes the no-crypto-tokens test.
+- `npm test` green.
+- You can articulate, in one paragraph, exactly what an OpenAI reviewer sees at each
+ well-known path and why none of it contradicts the submission.
+
+## Definition of done
+
+- [ ] The 3D Studio app has a served, payment-free, self-describing discovery artifact
+ (jointly with Task 05).
+- [ ] The platform `ai-plugin.json` no longer reads as "the 3D app is a paid crypto
+ service"; free vs paid is explicit; logo is a real branded asset.
+- [ ] A test asserts the 3D-app schema is crypto/payment-free.
+- [ ] `npm test` green.
+- [ ] Any commit that would trip the commit gate is prepared but NOT committed;
+ flagged to the owner in your report with the exact diff.
+- [ ] Report documents whether ChatGPT App Directory review actually reads
+ `/.well-known/ai-plugin.json`, with a source.
+
+---
+
+<a id="sec-189"></a>
+
+> **Source:** `docs/openai-pr/03-forge-free-tier-truth.md` · [↑ table of contents](#table-of-contents)
+
+# Task 03 — Make the `forge_free` tier story true everywhere (P1, blocks submit)
+
+Read [`00-START-HERE.md`](00-START-HERE.md) first.
+
+## The problem (verified, with evidence)
+
+The submission answer sheet and the code disagree about what quality tier
+`forge_free` returns by default.
+
+**The code** ([`api/_mcp-studio/tools.js`](../../api/_mcp-studio/tools.js),
+`handleForgeFree`) defaults to `standard` and degrades `high` to `standard` on
+402/timeout. Verbatim comment:
+
+```
+// Fast free lane by default. The deployed high-tier free engine (Hunyuan3D
+// via HF Spaces) blocks the submit for 50-280s with no poll handle, which no
+// ChatGPT tool call survives ... True high-by-default lands when the async
+// self-host Hunyuan3D worker deploys (GCP_HUNYUAN3D_URL).
+const tier = VALID_TIER.has(args.tier) ? args.tier : 'standard';
+```
+
+**The submission doc**
+([`prompts/store-submissions/_generated/openai-submission.md`](../../prompts/store-submissions/_generated/openai-submission.md))
+is internally inconsistent:
+- Line ~31 correctly says the tools "default to the standard tier."
+- Line ~146 (the tool table) says `forge_free` "Defaults to the highest quality tier
+ (dense geometry + PBR textures)."
+
+A reviewer who reads "highest quality tier" and then gets a standard-tier model has
+caught us in a misstatement. Pick the honest resolution and make ALL surfaces agree.
+
+## Your job
+
+Choose based on whether the async high-tier worker can actually ship in this cycle.
+
+### Path A (default, low-risk) — Tell the truth: standard by default
+
+The behavior is fine and defensible (fast, reliable, free). Just make every doc and
+metadata surface say "standard by default, higher tiers available on request."
+
+1. Fix `openai-submission.md` line ~146 (and any other spot) so the `forge_free`
+ description matches the code: standard default, `tier` param lets the caller ask
+ for draft or high, high may take longer or degrade under load.
+2. Grep every doc for the "highest quality"/"high tier by default" claim and fix each:
+ [`docs/mcp-studio.md`](../../docs/mcp-studio.md),
+ [`docs/mcp-3d-studio.md`](../../docs/mcp-3d-studio.md), the tool descriptions the
+ MCP server itself returns in `tools/list` (check `tools.js` tool metadata strings),
+ and `apps-sdk/README.md`.
+3. Make sure the tool's own `description` string returned to ChatGPT is accurate, so
+ the model never promises "highest quality" to the user.
+
+### Path B — Make high-by-default real
+
+Only if the async self-host Hunyuan3D worker (`GCP_HUNYUAN3D_URL`) can be deployed
+and proven within this cycle. This is the "never downgrade quality" ideal, and GCP
+GPU spend is pre-approved (`CLAUDE.md` standing resource approvals).
+
+1. Deploy the async Hunyuan3D worker with a real poll handle (submit returns a job id
+ immediately, poll returns progress, never blocks 50-280s). Its own
+ `workers/<name>/cloudbuild.yaml`, service accounts pinned per `CLAUDE.md`.
+2. Wire `handleForgeFree` to use it for the high tier with a real submit/poll flow
+ that a ChatGPT tool call survives, and flip the default to `high`.
+3. Prove it: a real `forge_free` call with no tier returns a high-tier GLB, end to
+ end, no timeout, no degrade. Capture the evidence JSON.
+4. THEN the "highest quality by default" doc language becomes true and can stay.
+
+Deploying a worker is not a reason to stop (`CLAUDE.md` self-unblock). But if the
+worker cannot be proven this cycle, do Path A. Do not leave a half-deployed worker
+and a doc claiming it works.
+
+## Constraints
+
+- Every rule in `00-START-HERE.md`.
+- No mock/fake generation. The evidence must be a real GLB from the real lane.
+- This is not a crypto surface; commit gate does not apply.
+
+## Verification
+
+- `grep -rni "highest quality\|high.*by default\|high tier" prompts/store-submissions docs apps-sdk/README.md api/_mcp-studio`
+ returns only statements that match the shipped behavior.
+- A real `forge_free` call against `/api/mcp-studio` returns a tier consistent with
+ every doc. Save the response JSON as evidence.
+- `npm test` green (run `tests/mcp-forge-free.test.js` and `tests/mcp-studio.test.js`).
+
+## Definition of done
+
+- [ ] Every doc, the submission sheet, and the tool's own `description` agree with the
+ code on the default tier.
+- [ ] If Path B: worker deployed and proven with real evidence; default is genuinely
+ high.
+- [ ] If Path A: no surface claims "highest quality by default" anymore.
+- [ ] `npm test` green.
+- [ ] `data/changelog.json` entry only if user-visible behavior changed (Path B yes;
+ Path A is a docs/accuracy fix, `docs` tag).
+- [ ] Report states the path taken and includes the real `forge_free` evidence.
+
+---
+
+<a id="sec-190"></a>
+
+> **Source:** `docs/openai-pr/04-openai-surface-test-coverage.md` · [↑ table of contents](#table-of-contents)
+
+# Task 04 — Close the test gaps on the ChatGPT-facing surface (P1)
+
+Read [`00-START-HERE.md`](00-START-HERE.md) first.
+
+## The problem
+
+The core logic is well tested (`tests/mcp-studio.test.js`, `tests/ar-export.test.js`,
+`tests/embodiment-*.test.js`), but three surfaces a reviewer will actually hit have
+**no test on the surface itself**, only on the pure functions beneath them. For a
+submission to OpenAI, the HTTP-visible behavior must be pinned so a refactor cannot
+silently break what the reviewer sees.
+
+### Gap 1 — `api/ar.js` HTTP handler is untested
+
+`api/ar.js` is the "View in your space" / "Bring it to life" endpoint every generation
+links to. Only the pure lib `api/_lib/ar-launch.js` is tested (`tests/ar-export.test.js`).
+The handler's own behavior is unverified:
+- User-agent branching (Android → Scene Viewer 302 intent; iOS/desktop → HTML launch
+ page; `kind=avatar` → IRL handoff).
+- The designed error page for a bad/missing `src`.
+- `assertArAssetUrl` rejection (non-https, non-`.glb/.gltf`) surfacing as a proper
+ error response, not a crash.
+- `Vary: user-agent` and cache headers.
+
+Write `tests/api/ar-endpoint.test.js` that invokes the handler with mocked requests
+for each UA class and asserts status, `Location`/redirect, headers, and that the HTML
+launch page contains the model URL and the AR launch elements. Follow the request/
+response mocking pattern used by the other `tests/api/*.test.js` files in this repo.
+
+### Gap 2 — `pages/embodiment/embed.html` wiring is untested
+
+The persona widget iframes this page. Its param parsing (`persona/glb/name/state/
+text/emotion/...`), the `GET /api/mcp3d/persona?id=` resolve, and the fallback when a
+persona cannot be resolved are unverified. Add a test (jsdom or Playwright, match what
+the repo already uses for page-level tests) that:
+- Loads the page with `?glb=&name=` and asserts the stage mounts and the name renders.
+- Loads with `?persona=<id>` against a mocked persona endpoint and asserts it resolves
+ and renders.
+- Loads with an unresolvable persona and asserts the designed error/empty state, not a
+ blank void or console error.
+
+### Gap 3 — No contract test binding `api/3d/studio.js` to `openai-actions.yaml`
+
+The custom-GPT Actions response shape (`{status, glbUrl, viewerUrl, arUrl, format}` or
+`{status:'pending', job, poll}`) must match the served OpenAPI schema (Task 05 serves
+it). Add a contract test that loads the OpenAPI schema and validates a real
+`api/3d/studio.js` response object against it (the response-shaper is pure and
+exported per the file). Use an existing JSON-schema/OpenAPI validator already in
+`package.json` if present; do not add a heavy new dependency for this.
+
+## Constraints
+
+- Every rule in `00-START-HERE.md`. No mocked *generation* results that pretend to be
+ real GLBs where the test claims to exercise the real lane; where you must stub the
+ forge call, stub at the network boundary and label it clearly, and keep at least one
+ path that asserts the real shape.
+- Match the existing test style, imports, and helpers. Read a neighboring
+ `tests/api/*.test.js` before writing.
+- Not a crypto surface; commit gate does not apply.
+
+## Verification
+
+- `npm test` green, with your three new test files running and passing.
+- Deliberately break each surface locally (e.g. change a header in `api/ar.js`) and
+ confirm the new test catches it, then revert. Report that you did this.
+
+## Definition of done
+
+- [ ] `tests/api/ar-endpoint.test.js` covers all UA classes, the error page, and
+ headers.
+- [ ] A page-level test covers `pages/embodiment/embed.html` param parsing, persona
+ resolve, and the failure state.
+- [ ] A contract test binds `api/3d/studio.js` output to the served OpenAPI (coordinate
+ with Task 05 for the schema location).
+- [ ] `npm test` green.
+- [ ] Each new test demonstrably fails when its target is broken (verified, then
+ reverted).
+- [ ] No changelog entry needed (tests are internal) unless you also fixed a bug found
+ while writing them, in which case that fix gets an entry.
+
+---
+
+<a id="sec-191"></a>
+
+> **Source:** `docs/openai-pr/05-custom-gpt-openapi-serving.md` · [↑ table of contents](#table-of-contents)
+
+# Task 05 — Serve the custom-GPT OpenAPI and align legal URLs (P1)
+
+Read [`00-START-HERE.md`](00-START-HERE.md) first. Coordinate with Task 02 (the
+served schema must be payment-free) and Task 04 (a contract test binds to it).
+
+## The problem (verified, with evidence)
+
+The custom-GPT Actions schema
+([`prompts/store-submissions/_generated/openai-actions.yaml`](../../prompts/store-submissions/_generated/openai-actions.yaml),
+OpenAPI 3.1.0, `title: three.ws 3D Studio`) exists but is **not served anywhere
+machine-discoverable**. It lives only under `prompts/store-submissions/_generated/`.
+
+Meanwhile the served `public/.well-known/openapi.yaml` describes the general REST
+platform and does NOT include `/api/3d/studio`, `/api/ar`, or `forge_free`. So the
+machine-readable schema an OpenAI reviewer or the GPT Actions runtime can fetch does
+not describe the 3D Studio GPT at all.
+
+Additionally, the legal URLs inside `openai-actions.yaml` use `.html` suffixes
+(`https://three.ws/legal/privacy.html`, `.../legal/tos.html`) while the submission doc
+verifies the live URLs without `.html`. Both forms currently resolve (verified:
+`vercel.json` rewrites `/legal/privacy/?` to `/legal/privacy.html`, and the `.html`
+file is served directly), but the inconsistency is sloppy for a submission and should
+be normalized to one canonical form.
+
+## Your job
+
+1. **Serve the 3D Studio OpenAPI at a stable, discoverable path.** Put the served
+ copy where the GPT Action and a reviewer can fetch it over https, e.g.
+ `public/.well-known/3d-studio-openapi.yaml` (or a `/api/3d/openapi.yaml` route).
+ Pick the path that fits how this repo already serves the other `.well-known`
+ schemas and wire it in `vercel.json` if a route is needed. Do NOT overwrite the
+ platform's existing `public/.well-known/openapi.yaml`.
+
+2. **Make the served 3D Studio schema self-contained and payment-free.** It must
+ describe only `/api/3d/studio` (POST submit, GET poll) and `/api/ar`, with
+ `auth: none`, no x402, no prices, no chain references. This is the artifact Task 02
+ points at as the app's clean discovery surface.
+
+3. **Single source of truth.** The served schema and
+ `prompts/store-submissions/_generated/openai-actions.yaml` must not drift. Either
+ generate the `_generated` copy from the served one (preferred, matches the
+ `_generated/` build-script convention already in that dir) or make one a copy of
+ the other with a script/check. Do not hand-maintain two copies.
+
+4. **Normalize the legal URLs.** Pick the canonical form the rest of the submission
+ uses (the no-`.html` form, e.g. `https://three.ws/legal/privacy`,
+ `https://three.ws/legal/tos`) and use it consistently in the served schema, the
+ `_generated` copy, and `openai-submission.md`. Confirm every legal URL you cite
+ returns 200 (both `privacy` and `tos` at minimum).
+
+5. **Lint it.** `npx @redocly/cli lint <served-schema>` must pass clean (the TRACKER
+ claims the `_generated` copy already lints clean; keep it that way for the served
+ one).
+
+## Constraints
+
+- Every rule in `00-START-HERE.md`. The served schema must pass Task 02's
+ no-crypto-tokens test, so keep it strictly the two free endpoints.
+- Not a crypto surface if you keep it clean; just do not paste x402 content into it.
+- If you add a `vercel.json` route, remember `vercel.json` is a LIVE config consumed
+ by the server (`CLAUDE.md`); edit it carefully and keep the route table valid.
+
+## Verification
+
+- The served schema is fetchable (`curl` the local dev server or read the built
+ `dist/` copy) and validates with `@redocly/cli lint`.
+- Every legal URL in the schema returns 200 (test both privacy and tos).
+- Task 04's contract test validates a real `api/3d/studio.js` response against it.
+- `npm run build:pages` / the normal build still succeeds; `npm test` green.
+
+## Definition of done
+
+- [ ] The 3D Studio OpenAPI is served at a stable https path, describing only the two
+ free endpoints, `auth: none`, no payment/crypto content.
+- [ ] The served copy and the `_generated` copy are kept in sync by a script or check,
+ not by hand.
+- [ ] All legal URLs normalized to one canonical form and verified 200.
+- [ ] Schema lints clean.
+- [ ] `npm test` green; build succeeds.
+- [ ] `data/changelog.json` entry (`docs` or `infra` tag) since a new public schema
+ path is developer-visible; add the route to `data/pages.json` only if it is a
+ human page (a raw schema usually is not).
+
+---
+
+<a id="sec-192"></a>
+
+> **Source:** `docs/openai-pr/06-docs-accuracy-reconciliation.md` · [↑ table of contents](#table-of-contents)
+
+# Task 06 — Fix doc accuracy and reconcile the tool-count story (P1)
+
+Read [`00-START-HERE.md`](00-START-HERE.md) first. This task cleans up the
+documentation drift the audit found, EXCEPT the two docs owned by other tasks
+(`apps-sdk/README.md` studio-viewer section is Task 01; the `forge_free` tier claim is
+Task 03). Do not fight those tasks for those specific edits; coordinate.
+
+## The problems (verified)
+
+1. **Tool-count inconsistency.** The free MCP connector exposes **9** tools: 6
+ generation (`forge_free`, `text_to_avatar`, `mesh_forge`, `rig_mesh`,
+ `forge_avatar`, `refine_model`) + 3 persona (`create_agent_persona`,
+ `get_agent_persona`, `persona_say`). But docs tell different stories:
+ - `openai-submission.md` says "Nine tools."
+ - `docs/mcp-studio.md` headline tool table lists six, with the persona tools in a
+ later "Embodiment" section.
+ - Code comments drift: `tools.js:1-8` says "Six generation tools (five generators +
+ refine_model)"; `tests/mcp-studio.test.js` comment says "five allowed generation
+ tools" while the asserted array has six.
+ Reconcile these so every count is consistent and correct. The authoritative number
+ is whatever the running server returns from `tools/list` — verify it, then make all
+ docs and comments match.
+
+2. **model-viewer version is not single-sourced.** Three surfaces load different
+ `model-viewer` versions: `api/ar.js` launch page (3.5.0 via jsdelivr), the MCP
+ widget in `component.js` (3.5.0), and `/viewer.html` (4.0.0). Pick one version,
+ pin it in one place they all reference (a constant/shared import), or at minimum
+ document the intended version per surface and why they differ. A reviewer opening
+ two of our surfaces should not get two different renderer versions with no reason.
+
+3. **`docs/mcp-studio.md` cross-reference check.** It points the custom-GPT contract to
+ `./api-reference.md`. Verify that file exists and actually documents `/api/3d/studio`.
+ If not, fix the pointer to the authoritative schema (the served OpenAPI from Task 05)
+ or add the missing section. No dead doc links.
+
+4. **General accuracy sweep of the ChatGPT-surface docs.** Read
+ `docs/mcp-studio.md`, `docs/chatgpt-ar.md`, `docs/mcp-3d-studio.md`, and
+ `docs/ar.md` end to end against the code. Every `ui://` URI, file path, endpoint,
+ env var, and example must resolve and be correct. Fix any that are stale. The audit
+ already confirmed `docs/chatgpt-ar.md` correctly points at `component.js` (good) and
+ that `apps-sdk/README.md` is the worst offender (Task 01 owns that one).
+
+## Constraints
+
+- Every rule in `00-START-HERE.md`. Docs are real implementations: every code sample
+ must run, every link must resolve to a live path (`CLAUDE.md` documentation rules).
+- Not a crypto surface; commit gate does not apply. Do not introduce any non-$THREE
+ coin reference into the docs.
+- Coordinate: leave the `apps-sdk/README.md` studio-viewer section to Task 01 and the
+ `forge_free` tier language to Task 03. If those tasks have not landed yet, note the
+ dependency rather than duplicating their edits.
+
+## Verification
+
+- Start from the live `tools/list` output (call `/api/mcp-studio` with an
+ `initialize` + `tools/list` JSON-RPC batch) and confirm the count and names, then
+ grep every doc/comment for tool counts and confirm they match.
+- `grep -rn "model-viewer@" api public docs` shows a single intended version story.
+- Every internal doc link resolves (spot-check with a link checker or by opening each
+ referenced path).
+- `npm test` green (docs changes should not break tests, but run it).
+
+## Definition of done
+
+- [ ] Tool count is consistent and correct (9) across `openai-submission.md`,
+ `docs/mcp-studio.md`, code comments, and test comments.
+- [ ] model-viewer version is single-sourced or its per-surface difference is
+ documented and justified.
+- [ ] `docs/mcp-studio.md` cross-references resolve; no dead links in any
+ ChatGPT-surface doc.
+- [ ] All ChatGPT-surface docs are accurate against the code (paths, URIs, endpoints,
+ env vars, examples).
+- [ ] `data/changelog.json` entry with the `docs` tag.
+- [ ] `npm test` green.
+
+---
+
+<a id="sec-193"></a>
+
+> **Source:** `docs/openai-pr/07-final-verification-and-submit.md` · [↑ table of contents](#table-of-contents)
+
+# Task 07 — Final live verification and submit checklist (P2, runs last)
+
+Read [`00-START-HERE.md`](00-START-HERE.md) first. **Run this only after tasks
+01-06 are merged.** This is the go/no-go gate before the app is submitted to OpenAI.
+
+## Purpose
+
+The submission answer sheet
+([`prompts/store-submissions/_generated/openai-submission.md`](../../prompts/store-submissions/_generated/openai-submission.md))
+asserts many "verified live" facts, dated 2026-07-14. Deployments move. Before we put
+this in front of OpenAI, re-verify every claim against the *currently deployed*
+production, close the loose `[HUMAN: ...]` items where you can, and produce a clean
+go/no-go report. Do not submit; prepare so the human's final submit is one action.
+
+## The checklist (run every item, record the result)
+
+### A. The MCP connector is live, keyless, and crypto-free
+- [ ] `POST https://three.ws/api/mcp-studio` with an `initialize` request returns the
+ server info (`three-ws-3d-studio-free`, protocol `2025-06-18`) with no auth.
+- [ ] `tools/list` returns exactly the expected 9 tools (matches Task 06's reconciled
+ count) with correct `openai/*` annotations and `outputTemplate` linkage.
+- [ ] `resources/list` returns the widget skybridge resources with their
+ `openai/widgetCSP`, `widgetDescription`, `widgetDomain` metadata.
+- [ ] A real `forge_free` call returns a real GLB with `glbUrl`, `viewerUrl`, `arUrl`,
+ and NO internal ids (`job_id`, `creation_id`, `backend`) and NO crypto/payment
+ fields. Save the response as fresh evidence (overwrite the stale
+ `_generated/*forge_free.json` evidence if the shape changed).
+- [ ] The connector response body contains no x402/payment/crypto tokens (the
+ `tests/mcp-studio.test.js` regex should still pass against live output).
+
+### B. Every reviewer-discoverable manifest is consistent (depends on Task 02, 05)
+- [ ] `https://three.ws/.well-known/ai-plugin.json` does not present the 3D app as a
+ paid crypto service; free vs paid is explicit; logo is a real branded asset.
+- [ ] The served 3D Studio OpenAPI (Task 05) is fetchable, lints clean, describes only
+ the free endpoints, and every legal URL in it returns 200.
+- [ ] `https://three.ws/legal/privacy` and `https://three.ws/legal/tos` return 200 in
+ the exact form the submission and schema cite.
+
+### C. The widget and AR surfaces render (depends on Task 01, 04)
+- [ ] The inline widget renders a real GLB in a `window.openai`-less browser via its
+ standalone/`viewerUrl` path (loading, ready, empty, error states all reachable).
+- [ ] `GET /api/ar?src=<glb>&title=<t>` returns the correct surface per device class
+ (Scene Viewer intent on Android UA, launch page on iOS/desktop UA); the error
+ page renders for a bad `src`.
+- [ ] `kind=avatar` returns the IRL "Bring it to life" handoff.
+
+### D. The custom GPT Actions surface works (depends on Task 05)
+- [ ] `POST https://three.ws/api/3d/studio` submits and returns the documented shape;
+ `GET ?job=&title=` polls to completion with a real GLB.
+- [ ] The response validates against the served OpenAPI (Task 04's contract test).
+
+### E. Submission kit is current
+- [ ] `openai-submission.md` facts all re-verified against the checks above; fix any
+ that drifted. Update the date.
+- [ ] Screenshots in `prompts/store-submissions/_generated/openai-screenshots/` show
+ the CURRENT shipped widget and resolve the `[HUMAN verify]` dimension flag
+ (confirm they meet OpenAI's required screenshot dimensions; re-shoot against the
+ live widget if stale). If Task 01 chose to delete the orphaned three.js viewer,
+ make sure no screenshot or evidence file still points at
+ `https://three.ws/apps-sdk/studio-viewer.html` as "the widget."
+- [ ] `TRACKER.md` `[HUMAN: ...]` items: resolve every one you technically can (e.g.
+ the duplicate-draft-GPT deletion if you have access); leave only items that
+ genuinely require the human's partner-portal login, and list them explicitly.
+- [ ] `npm test` green on the merged tree.
+
+## Constraints
+
+- Every rule in `00-START-HERE.md`. Especially rule 8: **do NOT submit to OpenAI, push,
+ or deploy.** Prepare everything; the human does the final submit in the partner
+ portal.
+- If any check fails, do not paper over it. Root-cause it, fix it (or route it back to
+ the owning task 01-06), and re-run. A red check is a blocker, not a footnote.
+- Do not commit anything that trips the commit gate (rule 7); flag it.
+
+## Definition of done
+
+- [ ] Every checklist item has a recorded PASS with evidence, or a FAIL with the fix
+ applied and re-verified to PASS.
+- [ ] `openai-submission.md` and `TRACKER.md` reflect the current, verified reality.
+- [ ] The only open items are `[HUMAN: ...]` steps that truly require the owner
+ (partner-portal submit, portal-side actions), listed explicitly in your report.
+- [ ] Final report is a clean go/no-go: either "ready to submit, remaining human steps
+ are X, Y" or "not ready, blockers are A, B and here is the state of each."
+
+---
+
+<a id="sec-194"></a>
> **Source:** `docs/oracle.md` · [↑ table of contents](#table-of-contents)
@@ -37426,6 +43259,7 @@ The coin drawer the product shows when you click any launch is the score, fully
- **Structure / wallet-graph / buy-pattern** expose the raw HOW inputs (organic-buy percent, bundle percent, the funder graph) so you can audit the guardrail.
- **Who's-in** is the live pedigree roster: every notable wallet, its label, and its track record.
- **Live trades** streams the coin's buys and sells in real time, each annotated with the trader's wallet archetype.
+- **Agent transactions** is every three.ws agent buy and sell in this exact coin, read from the same public custody ledger the wallet-story feed uses (`GET /api/pulse?type=trades&mint=<mint>`). It renders two ways: a scannable ledger (agent, side, size, time, on-chain proof) and, in the chart's **Agent trades** view, a marker overlay: each buy or sell plotted as a bubble on the native price series at the candle close nearest its on-chain timestamp, buys under the line and sells over it, clustered with a count when a window gets busy. It is the reverse index of the per-agent wallet story: the wallet story answers "what did this agent trade" and links each row to the coin; this answers "which agents traded this coin" and shows them on the price.
Every field here is also available programmatically from `GET /api/oracle/coin?mint=…`.
@@ -37667,7 +43501,7 @@ The more data we watch, the sharper every score. Oracle is live now.
---
-<a id="sec-155"></a>
+<a id="sec-195"></a>
> **Source:** `docs/package-extraction.md` · [↑ table of contents](#table-of-contents)
@@ -37786,7 +43620,7 @@ part of the extraction itself — extract and publish first, swap the import lat
---
-<a id="sec-156"></a>
+<a id="sec-196"></a>
> **Source:** `docs/partners/sperax-proposal.md` · [↑ table of contents](#table-of-contents)
@@ -37834,7 +43668,7 @@ Both sides already ship for a living — this proposal only asks each of us to d
---
-<a id="sec-157"></a>
+<a id="sec-197"></a>
> **Source:** `docs/pay-skills-listing.md` · [↑ table of contents](#table-of-contents)
@@ -37935,7 +43769,7 @@ are supported.
---
-<a id="sec-158"></a>
+<a id="sec-198"></a>
> **Source:** `docs/permissions.md` · [↑ table of contents](#table-of-contents)
@@ -37960,7 +43794,7 @@ An ERC-7710 delegation is a signed authorization envelope with the following str
| `salt` | `bytes32` | Random value for replay protection |
| `signature` | `bytes` | EIP-712 signature over the struct, produced by the delegator |
-The user signs the delegation via EIP-712 in MetaMask (triggered by the `wallet_grantPermissions` JSON-RPC call defined in ERC-7715). The signature is **off-chain** — the envelope is stored in the database and pinned to IPFS. When an agent needs to take a scoped action, it submits the envelope to the `DelegationManager` contract, which verifies the signature and enforces every caveat before executing the call.
+The user signs the delegation via a standard EIP-712 `signTypedData` prompt in MetaMask (the scope JSON mirrors the permission shapes defined in ERC-7715). The signature is **off-chain**: the envelope is stored in the database and pinned to IPFS. When an agent needs to take a scoped action, it submits the envelope to the `DelegationManager` contract, which verifies the signature and enforces every caveat before executing the call.
**The trust model:** the user signs once. Smart contracts enforce that scope on every redemption. The agent acts autonomously within the limits the owner approved — no further user interaction required until the scope needs to change or the delegation expires.
@@ -37999,15 +43833,14 @@ When a skill or agent action requires a delegation that doesn't yet exist, the g
1. **Scope builder** — the user selects token, spend limit, period, target contracts, and expiry. Common contracts (e.g., Uniswap V3 Router) are offered by name.
2. **Plain-English review** — the modal translates the scope into a human-readable summary (e.g., "Up to 10 USDC per day, to Uniswap V3 Router, expiring 2026-07-01") before opening the MetaMask prompt. This step must never be skipped — it gives the user a trusted-context preview before the raw EIP-712 data appears in MetaMask.
-3. **EIP-712 sign** — MetaMask opens the `wallet_grantPermissions` prompt; the user approves; the signed delegation is stored and pinned.
+3. **EIP-712 sign**: MetaMask opens the typed-data signature prompt; the user approves; the signed delegation is stored and pinned.
### 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 [src/permissions/toolkit.js](../src/permissions/toolkit.js) (the published SDK re-exports `encodeScopedDelegation` and friends from `@three-ws/sdk/permissions/advanced`):
```js
-import { encodeScopedDelegation, signDelegation } from '@three-ws/sdk/permissions';
-import { CAVEAT_ENFORCERS } from '@three-ws/sdk/erc7710';
+import { encodeScopedDelegation, signDelegation, CAVEAT_ENFORCERS } from './src/permissions/toolkit.js';
import { AbiCoder } from 'ethers';
const CHAIN_ID = 84532; // Base Sepolia
@@ -38060,7 +43893,7 @@ const res = await fetch('/api/permissions/grant', {
},
}),
});
-// → { ok: true, id: 'delegation-uuid', delegationHash: '0x...' }
+// → { ok: true, id: 'delegation-uuid', delegationHash: '0x...', expiresAt: 1234567890 }
```
---
@@ -38070,7 +43903,7 @@ const res = await fetch('/api/permissions/grant', {
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';
+import { redeemFromSkill } from './src/runtime/delegation-redeem.js';
// Inside a skill handler:
export async function execute_swap({ tokenIn, tokenOut, amount }, ctx) {
@@ -38105,7 +43938,7 @@ export async function execute_swap({ tokenIn, tokenOut, amount }, ctx) {
To monitor redemption events:
```js
-import { subscribeRedeemEvents } from '@three-ws/sdk/runtime';
+import { subscribeRedeemEvents } from './src/runtime/delegation-redeem.js';
const unsubscribe = subscribeRedeemEvents((event) => {
console.log(event.type, event.payload);
@@ -38122,7 +43955,7 @@ const unsubscribe = subscribeRedeemEvents((event) => {
Mount the panel for an agent:
```js
-import { mountManagePanel } from '@three-ws/sdk/permissions';
+import { mountManagePanel } from './src/permissions/manage-panel.js';
const { unmount } = mountManagePanel({
container: document.getElementById('permissions-container'),
@@ -38138,7 +43971,7 @@ Revoking has two parts: the on-chain transaction and the server-side mirror.
```js
import { Contract, BrowserProvider } from 'ethers';
-import { DELEGATION_MANAGER_DEPLOYMENTS, DELEGATION_MANAGER_ABI } from '@three-ws/sdk/erc7710';
+import { DELEGATION_MANAGER_DEPLOYMENTS, DELEGATION_MANAGER_ABI } from './src/erc7710/abi.js';
// 1. Submit disableDelegation on-chain
const provider = new BrowserProvider(window.ethereum);
@@ -38283,7 +44116,7 @@ When `POST /api/permissions/redeem` is used instead of direct wallet submission,
The grant modal and toolkit require the user to explicitly choose a chain. Mainnet support requires explicit opt-in through the agent owner's settings. Base Sepolia (84532) and Sepolia (11155111) are the default test chains.
**No custodial delegator keys:**
-The delegator (owner) wallet key is never held server-side. The agent's smart account key may be held server-side only as defined in the agent trust boundary documentation (task 09). Never store or redeem a delegation whose EIP-712 signature has not been verified — `signature_invalid` is the correct error for any unverified envelope.
+The delegator (owner) wallet key is never held server-side. The agent's smart account key may be held server-side only within the agent-wallet trust boundary (see [Agent wallets](/docs/agent-wallets)). Never store or redeem a delegation whose EIP-712 signature has not been verified, `signature_invalid` is the correct error for any unverified envelope.
---
@@ -38316,7 +44149,7 @@ Set `SMOKE_SKIP_REVOKE=1` to skip the on-chain revocation step if the test walle
---
-<a id="sec-159"></a>
+<a id="sec-199"></a>
> **Source:** `docs/persona-hub.md` · [↑ table of contents](#table-of-contents)
@@ -38713,7 +44546,7 @@ JWT claims:
---
-<a id="sec-160"></a>
+<a id="sec-200"></a>
> **Source:** `docs/plan-checkout.md` · [↑ table of contents](#table-of-contents)
@@ -38840,7 +44673,7 @@ Plan prices live in [api/payments/_config.js](../api/payments/_config.js) (`PLAN
---
-<a id="sec-161"></a>
+<a id="sec-201"></a>
> **Source:** `docs/popular-3d-github-repos.md` · [↑ table of contents](#table-of-contents)
@@ -39103,7 +44936,7 @@ Apply a 3D-signal regex filter over `description + topics` and a denylist of non
---
-<a id="sec-162"></a>
+<a id="sec-202"></a>
> **Source:** `docs/premium.md` · [↑ table of contents](#table-of-contents)
@@ -39198,6 +45031,12 @@ passes bought wallet-only over the raw API authenticate with the key itself
and can be re-keyed by renewing. Your purchase history and subscriptions live
at [/dashboard/billing](/dashboard/billing).
+The dashboards ride two raw endpoints you can also call directly:
+`POST /api/premium/keys` with `{ action: "rotate" | "revoke", id }`
+(session + CSRF; rotate returns the fresh plaintext exactly once) and
+`GET /api/premium/mine` (session-authenticated; your passes and keys,
+including passes bought directly by your linked Solana wallet).
+
## Rules and edge cases
- A quote is redeemable for 30 minutes; after that, request a fresh one
@@ -39220,7 +45059,7 @@ tiers that remain free (news feed, digest, archive stats/trending).
---
-<a id="sec-163"></a>
+<a id="sec-203"></a>
> **Source:** `docs/provenance.md` · [↑ table of contents](#table-of-contents)
@@ -39287,7 +45126,7 @@ Real hashing, real ed25519 signature, real on-chain write. Requires the issuer k
---
-<a id="sec-164"></a>
+<a id="sec-204"></a>
> **Source:** `docs/pump-fun-mcp-edge.md` · [↑ table of contents](#table-of-contents)
@@ -39343,7 +45182,7 @@ Both runtimes import `TOOLS` from `src/pump/mcp-tools.js`, so the tool list expo
---
-<a id="sec-165"></a>
+<a id="sec-205"></a>
> **Source:** `docs/pump-launch-repos.md` · [↑ table of contents](#table-of-contents)
@@ -39442,7 +45281,7 @@ rate-limits under the ~450 txs a full run makes. Pass a dedicated `--rpc`
---
-<a id="sec-166"></a>
+<a id="sec-206"></a>
> **Source:** `docs/pump-launcher.md` · [↑ table of contents](#table-of-contents)
@@ -39593,7 +45432,7 @@ token itself always deploys on **Solana mainnet** — pump.fun is mainnet-only.
---
-<a id="sec-167"></a>
+<a id="sec-207"></a>
> **Source:** `docs/pump-platform-fee.md` · [↑ table of contents](#table-of-contents)
@@ -39654,7 +45493,7 @@ The fee is **never** charged silently. When `platform_fee_bps > 0`:
---
-<a id="sec-168"></a>
+<a id="sec-208"></a>
> **Source:** `docs/pumpfun-program/README.md` · [↑ table of contents](#table-of-contents)
@@ -39712,7 +45551,7 @@ tracked in `tasks/pumpfun-upstream/01-v2-trade-instructions-usdc-audit.md`.
---
-<a id="sec-169"></a>
+<a id="sec-209"></a>
> **Source:** `docs/pumpfun-program/UPSTREAM-buy-sell-v2-announcement.md` · [↑ table of contents](#table-of-contents)
@@ -39816,7 +45655,7 @@ Currently, no quote mint other than native SOL can be used to create or trade co
---
-<a id="sec-170"></a>
+<a id="sec-210"></a>
> **Source:** `docs/pumpfun-program/docs/BREAKING_FEE_RECIPIENT.md` · [↑ table of contents](#table-of-contents)
@@ -39890,7 +45729,7 @@ The new accounts can be passed before the program upgrade happens on Monday. The
---
-<a id="sec-171"></a>
+<a id="sec-211"></a>
> **Source:** `docs/pumpfun-program/docs/CPI_README.md` · [↑ table of contents](#table-of-contents)
@@ -39994,7 +45833,7 @@ pump-rust-client = { version = "...", path = "..." }
---
-<a id="sec-172"></a>
+<a id="sec-212"></a>
> **Source:** `docs/pumpfun-program/docs/FAQ.md` · [↑ table of contents](#table-of-contents)
@@ -40032,7 +45871,7 @@ is recommended to use a static big enough CU limit like `100_000`.
---
-<a id="sec-173"></a>
+<a id="sec-213"></a>
> **Source:** `docs/pumpfun-program/docs/FEE_PROGRAM_README.md` · [↑ table of contents](#table-of-contents)
@@ -40246,7 +46085,7 @@ If you implement the fee logic correctly, any future change to the fee tiers str
---
-<a id="sec-174"></a>
+<a id="sec-214"></a>
> **Source:** `docs/pumpfun-program/docs/FEE_RECIPIENTS.md` · [↑ table of contents](#table-of-contents)
@@ -40309,7 +46148,7 @@ Use one of these as `buybackFeeRecipient` for any coin.
---
-<a id="sec-175"></a>
+<a id="sec-215"></a>
> **Source:** `docs/pumpfun-program/docs/PUMP_CASHBACK_README.md` · [↑ table of contents](#table-of-contents)
@@ -40426,7 +46265,7 @@ To read unclaimed cashback for pump swap / Pump AMM program:
---
-<a id="sec-176"></a>
+<a id="sec-216"></a>
> **Source:** `docs/pumpfun-program/docs/PUMP_CREATOR_FEE_README.md` · [↑ table of contents](#table-of-contents)
@@ -40561,7 +46400,7 @@ we update the programs on Mainnet.
---
-<a id="sec-177"></a>
+<a id="sec-217"></a>
> **Source:** `docs/pumpfun-program/docs/PUMP_PROGRAM_README.md` · [↑ table of contents](#table-of-contents)
@@ -40762,7 +46601,7 @@ at https://solscan.io/account/EsmVk4MTsoT71JFaRM5DWFZboKpMQjfY6EYzAgUuksXw#accou
---
-<a id="sec-178"></a>
+<a id="sec-218"></a>
> **Source:** `docs/pumpfun-program/docs/PUMP_SWAP_CREATOR_FEE_README.md` · [↑ table of contents](#table-of-contents)
@@ -40871,7 +46710,7 @@ PumpSwap program on Mainnet to the coin creator fee update.
---
-<a id="sec-179"></a>
+<a id="sec-219"></a>
> **Source:** `docs/pumpfun-program/docs/PUMP_SWAP_README.md` · [↑ table of contents](#table-of-contents)
@@ -41105,7 +46944,7 @@ Each Anchor instruction has a set of corresponding autocomplete methods that can
---
-<a id="sec-180"></a>
+<a id="sec-220"></a>
> **Source:** `docs/pumpfun-program/docs/PUMP_SWAP_SDK_README.md` · [↑ table of contents](#table-of-contents)
@@ -41185,7 +47024,7 @@ to autocomplete the `base` and `quote` displayed amounts based on the `lpToken`
---
-<a id="sec-181"></a>
+<a id="sec-221"></a>
> **Source:** `docs/pumpfun-program/docs/instructions/BUY.md` · [↑ table of contents](#table-of-contents)
@@ -41363,7 +47202,7 @@ ixs.extend(
---
-<a id="sec-182"></a>
+<a id="sec-222"></a>
> **Source:** `docs/pumpfun-program/docs/instructions/CLAIM_CASHBACK.md` · [↑ table of contents](#table-of-contents)
@@ -41473,7 +47312,7 @@ let ix = sdk.claim_cashback_v2_instruction(
---
-<a id="sec-183"></a>
+<a id="sec-223"></a>
> **Source:** `docs/pumpfun-program/docs/instructions/COIN_CREATION.md` · [↑ table of contents](#table-of-contents)
@@ -41628,7 +47467,7 @@ let ixs = sdk
---
-<a id="sec-184"></a>
+<a id="sec-224"></a>
> **Source:** `docs/pumpfun-program/docs/instructions/COLLECT_CREATOR_FEE.md` · [↑ table of contents](#table-of-contents)
@@ -41730,7 +47569,7 @@ ixs.extend(sdk.collect_creator_fee_v2_instructions(
---
-<a id="sec-185"></a>
+<a id="sec-225"></a>
> **Source:** `docs/pumpfun-program/docs/instructions/CREATOR_FEE_SHARING.md` · [↑ table of contents](#table-of-contents)
@@ -42084,7 +47923,7 @@ ixs.extend(sdk.distribute_creator_fees_v2_instructions(
---
-<a id="sec-186"></a>
+<a id="sec-226"></a>
> **Source:** `docs/pumpfun-program/docs/instructions/SELL.md` · [↑ table of contents](#table-of-contents)
@@ -42261,7 +48100,7 @@ ixs.extend(
---
-<a id="sec-187"></a>
+<a id="sec-227"></a>
> **Source:** `docs/quick-start.md` · [↑ table of contents](#table-of-contents)
@@ -42295,7 +48134,7 @@ The fastest path. No npm, no bundler, no build step.
</head>
<body>
<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
- <agent-3d body="https://cdn.three.ws/models/sample-avatar.glb"></agent-3d>
+ <agent-3d body="https://three.ws/avatars/michelle.glb"></agent-3d>
</body>
</html>
```
@@ -42404,7 +48243,7 @@ The `brain` attribute turns the 3D viewer into a conversational agent:
| Attribute | What it does |
|-----------|--------------|
-| `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`). |
+| `brain` | LLM model ID. Registered Claude IDs: `claude-sonnet-4-6`, `claude-opus-4-7`, `claude-opus-4-6`, `claude-haiku-4-5-20251001`, `claude-fable-5`, `claude-mythos-5`. Free models (no key, routed through the platform proxy) are also accepted, e.g. `meta-llama/llama-3.3-70b-instruct:free`. 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`. |
@@ -42531,9 +48370,11 @@ If your page has a strict `Content-Security-Policy`, the script embed needs:
```
script-src 'self' https://three.ws;
-connect-src 'self' https://three.ws https://cdn.three.ws;
+connect-src 'self' https://three.ws;
```
+(Also allow whatever origin hosts your GLB files in `connect-src` if it differs.)
+
If you're embedding inside a sandboxed iframe, make sure the parent grants `allow-scripts allow-same-origin`. For sandboxed environments where the script embed won't work, use the iframe widget instead — it runs in its own browsing context and is unaffected by the parent CSP.
### Model doesn't appear
@@ -42554,7 +48395,100 @@ If you're embedding inside a sandboxed iframe, make sure the parent grants `allo
---
-<a id="sec-188"></a>
+<a id="sec-228"></a>
+
+> **Source:** `docs/radar.md` · [↑ table of contents](#table-of-contents)
+
+# Coin Radar: every pump.fun launch, scored in its first 90 seconds
+
+Coin Radar is a live screener for pump.fun. Every new coin appears here with the Coin Intelligence Engine's read of its first roughly 90 seconds of trading: bundle versus organic demand, wallet concentration, dev behaviour, fresh-wallet swarms, and risk flags, plus a 0 to 100 quality score. It answers one question fast, before the candle prints: is this launch real, or is it a coordinated exit dressed up as a crowd?
+
+Page: [/radar](https://three.ws/radar)
+
+API: `/api/pump/coin-intel` (feed, market pulse, per-coin detail). The detail drawer also reads `/api/oracle/coin` for conviction context.
+
+> Naming trap for API users: `/radar` is served by `api/pump/coin-intel.js`, and `/coin-intel` is served by `api/pump/intel.js`. The names look swapped. They are two distinct read models over the same engine.
+
+## Why it exists
+
+The most dangerous moment on pump.fun is the first minute, when the tape is thin and a bundle of bot wallets can manufacture the look of organic demand. A human cannot audit funder graphs and timing entropy in real time. The Coin Intelligence Engine does, on the live firehose, and Radar is its screener: a scannable board that turns raw first-90-seconds behaviour into a quality score and a short list of named risks, so you can filter out the coordinated launches and focus on the ones with a real crowd. It is the top of the [trading surfaces](./trading-surfaces.md) funnel: Radar surfaces a launch worth a look, you watch it, and if it earns conviction you open it in [Mission Control](./terminal.md) to act.
+
+## How it works
+
+The page mounts `mountRadar` from `src/radar.js` and polls `/api/pump/coin-intel` every 12 seconds (paused when the tab is hidden), rendering a market-pulse strip, a filterable grid or list of coins, and a detail drawer. It uses no streaming; it is a REST poller.
+
+The scores are not computed by the API, which is a pure read model over the Postgres table `pump_coin_intel` (plus `pump_coin_wallets` and `pump_coin_outcomes`). They are produced upstream by the engine in `workers/agent-sniper/intel/`. A watcher holds its own PumpPortal websocket, subscribes to each new mint's trades, and observes a **90-second window** (`windowMs = 90_000`) with the creator's launch buy seeded as trade zero. When the window closes, a deterministic, pure signal function scores it and enrichment (classification, funder-graph clustering, smart-money cross-reference) is folded in before the record is persisted. A serverless cron twin shares the exact same finalize path, so records are byte-identical however they were produced.
+
+The core signal math, measured from the first observed trade (burst window 3s, snipe window 5s):
+
+- **Bundle score (0 to 1).** Needs at least 4 buys and 4 in the 3-second burst; blends burst density and clustering (the share of near-identical buy sizes, since bots fund identical amounts), scaled by a wallet multiplier.
+- **Organic score (0 to 1).** A weighted blend of buyer diversity, timing entropy, the inverse of bundle, the inverse of snipe ratio, and the inverse of top-1 concentration, then discounted if the dev sold or fresh wallets dominate, and adjusted by funder connectivity.
+- **Snipe ratio.** Share of buy volume landing within the first 5 seconds.
+- **Concentration.** Per-wallet net buy share; reported as top-1, top-5, and top-10.
+- **Dev behaviour.** `dev_sold` is set when the creator had any sell; `dev_buy_sol` comes from the launch transaction.
+- **Fresh wallets and clusters.** Fresh-wallet ratio is the share of buyers with at most one prior transaction (null below 3 known); connectivity is the largest common-funder cluster over known funders.
+
+Those roll into a **quality score (0 to 100)**: start from organic times 100, subtract for bundle, top-1 concentration, a dev sell, and fresh-wallet ratio, add a small bonus for unique buyers, then add smart-money bonuses that stack per proven wallet in (+8 for the first, +6 for the second, +4 for the third, up to +18 total), and clamp.
+
+**Risk flags** are named, not numeric: `bundle_launch` (bundle 0.6+), `dev_dumped`, `single_whale` (top-1 0.5+), `low_diversity` (fewer than 5 buyers), `fresh_wallet_swarm` (fresh ratio 0.7+), `sell_pressure`, `sniped` (snipe 0.85+ with fewer than 8 buyers), and `coordinated_cluster` (connectivity 0.4+).
+
+The UI colors quality as Healthy at 70 and up, Mixed from 40 to 69, and High risk below 40; a null score renders "Unscored," never a fake zero.
+
+## Walkthrough
+
+1. Open [/radar](https://three.ws/radar). The pulse strip aggregates the whole tape (24h and 1h observed counts, the healthy/mixed/risky split, smart-money-touched and flagged shares).
+2. Use the toolbar to filter by narrative category, drag the minimum-quality slider, toggle smart-money-only or news, and hide flagged coins (a client-side drop of danger-flagged launches). Sort by newest, quality, smart money, buyers, or volume. All filters serialize to the URL for shareable views.
+3. Press `/` to focus search and type a name, ticker, or mint. Press `g` or `l` to switch grid and list, `r` to refresh.
+4. Click any coin for the drawer: the full signal grid, the top-50 wallet ledger, the smart-money notable roster, the outcome (if labeled), and an asynchronously injected Oracle conviction section.
+5. On a coin worth tracking, use Watch to add it to your [Watchlist](https://three.ws/watchlist), then open it in [Mission Control](./terminal.md) to trade.
+
+## Examples
+
+The feed is public and IP rate-limited.
+
+```bash
+# The radar feed: newest launches with the engine's first-90s read
+curl 'https://three.ws/api/pump/coin-intel?limit=60&network=mainnet&sort=new'
+
+# The market-pulse aggregate (independent of your filters)
+curl 'https://three.ws/api/pump/coin-intel?stats=1&network=mainnet'
+
+# One coin's full intel plus its top-50 wallet ledger
+curl 'https://three.ws/api/pump/coin-intel?mint=<MINT>&wallets=1&network=mainnet'
+```
+
+```javascript
+// Pull the feed and keep only clean, smart-money-touched launches
+const { coins } = await fetch(
+ 'https://three.ws/api/pump/coin-intel?limit=60&network=mainnet&smart_money=1'
+).then((r) => r.json());
+
+const clean = coins.filter(
+ (c) => (c.quality_score ?? 0) >= 70 && !(c.risk_flags || []).includes('bundle_launch')
+);
+console.log(clean.map((c) => `${c.symbol} q${c.quality_score}`));
+```
+
+## States and limits
+
+- **Auth.** None. The feed, pulse, and detail reads are fully public over CORS and IP rate-limited (`mcpIp`).
+- **No streaming.** Radar polls every 12 seconds and shows a "Live, updated Ns ago" indicator; polling pauses when the tab is hidden and refetches on return.
+- **Warm-up.** A coin has no score until its 90-second observation window closes and finalize runs. Coins older than the engine's deploy, or mid-observation, return 404 on the detail read and render a "Not observed" state.
+- **Honest nulls.** A signal that was not measured is null and renders "not measured," never a fabricated 0. The market-pulse path degrades to zeros and empties gracefully if the engine tables are cold.
+- **Empty and error states.** The board has designed loading (skeleton grid), empty ("Radar is clear, waiting for the next launch"), no-match (with a reset), and error (with a retry) states. On a silent poll failure it keeps the prior coins and only blanks to an error when nothing is cached.
+
+## Related
+
+- [The trading surfaces: Radar, Mission Control, Live Trade Feed, Watchlist, Coin Intelligence](./trading-surfaces.md)
+- [Oracle: the conviction engine](./oracle.md) fuses this intel into a single conviction score
+- [Smart Money Radar](./smart-money.md) is the pedigree layer Radar surfaces inline
+- [Mission Control](./terminal.md) is where a Radar find gets traded
+- [Coin pages](./coin-pages.md) cross-link the per-mint intel and conviction views
+- Pages: [/radar](https://three.ws/radar) · [/coin-intel](https://three.ws/coin-intel) · [/watchlist](https://three.ws/watchlist)
+
+---
+
+<a id="sec-229"></a>
> **Source:** `docs/remix.md` · [↑ table of contents](#table-of-contents)
@@ -42756,13 +48690,13 @@ still recorded — the royalty leg reports `payout_unconfigured` instead of payi
---
-<a id="sec-189"></a>
+<a id="sec-230"></a>
> **Source:** `docs/reputation.md` · [↑ table of contents](#table-of-contents)
# Reputation System
-The reputation system lets anyone leave a permanent, publicly verifiable score for a registered three.ws. Scores are stored on the `ReputationRegistry` smart contract — part of the ERC-8004 standard — and cannot be deleted or altered once submitted.
+The reputation system lets anyone leave a permanent, publicly verifiable score for a registered three.ws agent. Scores are stored on the `ReputationRegistry` smart contract (part of the ERC-8004 standard) and cannot be deleted or altered once submitted. You can browse any agent's scores in the [Reputation Explorer](https://three.ws/reputation) without an account or wallet.
---
@@ -42795,24 +48729,26 @@ One review per wallet address per agent is enforced by the contract. Agents cann
2. Scroll to the **Reputation** section.
3. Click **Vouch for this agent** (you must be signed in with a connected wallet).
4. Select a star rating (1–5).
-5. Optionally write a comment (up to 280 characters, stored as a URI reference on-chain).
+5. Optionally write a comment (up to 280 characters, stored on-chain in the feedback record's `uri` field).
6. Click **Sign & submit** and confirm the transaction in your wallet.
Gas cost is minimal on L2 networks like Base (typically under $0.10). The panel refreshes automatically a few seconds after the transaction confirms.
**Owners cannot vouch for their own agents.** If you own the agent, the vouch button is replaced with an explanatory note.
-A full reputation dashboard — showing aggregate stats and all recent reviews — is also available at `/public/reputation/` for any `(chainId, agentId)` pair.
+A full reputation dashboard (showing aggregate stats and all recent reviews) is also available at [three.ws/reputation](https://three.ws/reputation) for any `(chainId, agentId)` pair.
### Via the SDK
+These helpers live in the three.ws codebase at [src/erc8004/reputation.js](../src/erc8004/reputation.js) (import in-repo or vendor the module):
+
```js
-import { submitReputation } from '@three-ws/sdk/erc8004';
+import { submitReputation } from './src/erc8004/reputation.js';
const txHash = await submitReputation({
chainId: 8453, // Base mainnet
agentId: 42,
- score: 5, // Integer, 1–5 (maps to the contract's –100..+100 range)
+ score: 5, // Any int8 in -100..+100; the star UI submits 1-5
comment: 'Incredible avatar and fast responses.',
signer: connectedSigner // ethers.js Signer
});
@@ -42836,7 +48772,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 [/reputation](https://three.ws/reputation) page. It shows:
- Review count, average rating, time since last review
- Up to 10 recent reviews with inline transaction links
@@ -42846,10 +48782,10 @@ The `ReputationDashboard` class ([src/reputation-ui.js](../src/reputation-ui.js)
### Via the SDK
```js
-import { getReputation, getRecentReviews } from '@three-ws/sdk/erc8004';
+import { getReputation, getRecentReviews } from './src/erc8004/reputation.js';
// Aggregate stats
-const { total, count, average } = await getReputation({
+const { count, average } = await getReputation({
chainId: 8453,
agentId: 42,
runner: provider // ethers.js Provider
@@ -42868,16 +48804,14 @@ reviews.forEach(r => {
});
```
-`getReputation` returns `{ total, count, average }` where `average` is already computed (sum / count, or 0 if no reviews). `getRecentReviews` returns an array of objects with `from` (reviewer address), `score`, `comment`, `blockNumber`, and `txHash`.
+`getReputation` returns `{ count, average }` where `average` is already computed from the contract's `avgX100` (0 if no reviews). `getRecentReviews` returns an array of objects with `agentId`, `from` (reviewer address), `score`, `comment`, `blockNumber`, and `txHash`.
### Via the Passport widget
+The **ERC-8004 Passport** widget type ([src/widgets/passport.js](../src/widgets/passport.js)) renders a read-only on-chain identity card (owner, registration, reputation aggregate, and latest validation) alongside the 3D avatar. Create one in [Widget Studio](https://three.ws/studio), then embed its public URL:
+
```html
-<agent-3d
- widget="passport"
- agent-id="8453:0xRegistry:42"
- show-reputation="true"
-></agent-3d>
+<iframe src="https://three.ws/w/{widget-id}" width="400" height="500" title="Agent passport"></iframe>
```
---
@@ -42955,7 +48889,116 @@ See the [Validation](./validation.md) documentation for details.
---
-<a id="sec-190"></a>
+## Related
+
+- [ERC-8004 identity](/docs/erc8004): registering an agent so it can accumulate reputation
+- [Validation](/docs/validation): on-chain attestations for model quality
+- [Solana reputation](/docs/solana-reputation): the attestation-based equivalent for Solana agents
+- [Agent reputation](/docs/agent-reputation): how reputation surfaces across the platform
+
+---
+
+<a id="sec-231"></a>
+
+> **Source:** `docs/restyle.md` · [↑ table of contents](#table-of-contents)
+
+# Restyle Studio: re-skin any GLB without regenerating its mesh
+
+Restyle Studio changes what a 3D model is made of, not what it is. Load any GLB, and you can flip it to chrome, gold, glass, or wood with one click, describe a look in plain language and let an AI propose the physically based material for it, fan a preset out into a strip of reproducible colorway variants, or fine-tune metalness, roughness, color, and emissive live. The mesh, its geometry, and its UVs are never touched. Only the material factors change, so a restyle is fast, cheap, and never distorts the model. Every AI restyle and every saved checkpoint mints a real, validated, durably stored GLB in a parent-to-child version lineage, so nothing you make here is a throwaway browser preview.
+
+Page: [/restyle](https://three.ws/restyle) · API: `/api/material-studio`
+
+## Why it exists
+
+Generating a 3D model is the expensive step. Once you have a good mesh, wanting it in a different finish should not mean paying to regenerate the whole thing and risking a worse shape. Restyle Studio separates the two. Skin is cheap and reversible; geometry is precious and left alone. That makes iterating on look-and-feel a tight loop: try chrome, try worn copper, try glass, save the two you like as durable versions, export the winner. It also gives the rest of the platform one shared material vocabulary. Restyle Studio consumes the same PBR preset library (`@three-ws/viewer-presets`) and the same GLB optimize-and-validate path that [Avatar Studio](./avatar-studio.md) uses, instead of inventing a parallel one.
+
+## How it works
+
+The page is a Three.js scene with `RoomEnvironment` image-based lighting, so metals and glass reflect something real rather than reading as flat grey. Four capabilities sit on top of the loaded model:
+
+- **Preset library (14 looks).** One click applies a physically based material across every standard material in the model. The presets are `chrome`, `gold`, `copper`, `brushedSteel`, `gunmetal`, `matte` (plastic), `glossy` (plastic), `rubber`, `ceramic`, `glass`, `wood`, `stone`, `neon`, and `holographic`. Each carries tuned color, metalness, roughness, environment-map intensity, and (for neon and holographic) emissive values.
+- **AI restyle from an instruction.** Type something like "make it chrome", "worn copper", or "cyberpunk neon" and the server asks IBM Granite (watsonx.ai) to propose a glTF 2.0 PBR material (base color, metallic, roughness, emissive factors). The factors come back, get applied to the in-browser preview instantly, and are also applied server-side to the source GLB and re-exported as a durable, validated model. If you leave the "also generate a texture" option on, the studio additionally asks the platform text-to-image lane (`/api/v1/ai/image`, the same NVIDIA NIM FLUX / Vertex stack Forge uses) for a seamless tileable material swatch and applies it as the base-color map. The flat PBR restyle always lands even if texture generation is skipped or hits its free daily quota.
+- **Seeded colorway variants.** Pick a base preset, a seed, and a count (1 to 12), and the studio fans it into a strip of variants using a `mulberry32` seeded PRNG. The same base plus the same seed always produces the byte-identical set, so a colorway you liked is reproducible forever. Clicking a swatch applies it live. "Save all as versions" turns those variants into real, separately addressable GLBs, each branching off the same parent version.
+- **Live manual controls.** Sliders for metalness, roughness, and emissive intensity, plus base-color and emissive-color pickers, set the same property across every standard material at once. A Reset button restores every material to its captured original values.
+
+### Version lineage
+
+Two kinds of history live side by side. The in-browser breadcrumb records every preset and slider tweak and never leaves the tab. The durable version lineage is the real one: every AI restyle and every "Save version" checkpoint uploads a `gltf-validator`-checked GLB and records it with the same immutable parent-to-child shape the `refine_model` MCP tool uses. Clicking any version in the Versions strip reloads that exact GLB. A restyle or a variant set can extend one thread or branch off an earlier version, so the lineage is a tree, not just a line.
+
+### One core, two transports
+
+The endpoint is free and hosted (no wallet, no account, no x402), bounded by server-side rate limits rather than payment, the same doctrine `forge_free` and the free 3D Studio use. The `restyle_material` MCP tool is a thin paid stdio client (0.05 USDC) over this same endpoint, so the free web page and the paid agent tool can never drift. One implementation, two transports.
+
+## Walkthrough
+
+1. Open [/restyle](https://three.ws/restyle). The platform's default humanoid loads so the stage is never empty. To bring your own model, drag a `.glb`/`.gltf` onto the stage, use the file picker, or paste a public model URL into "Load URL". You can also deep-link a model with `?url=https://.../model.glb`.
+2. Click a preset (start with **Chrome** or **Gold**) and watch the whole model re-skin against real reflections. Orbit to inspect it.
+3. Type an instruction in the AI restyle box, for example `brushed titanium with a faint blue sheen`, and press the button. Granite proposes the material, it applies instantly, and a new durable version is minted.
+4. Nudge the metalness and roughness sliders, or change the base color, to fine-tune.
+5. Set a seed and a count, generate variants, and click through the swatch strip. Hit "Save all as versions" to keep the whole set as durable GLBs.
+6. Click "Save version" to checkpoint the current look, or "Export" to download `restyled.glb`. The export runs through the shared optimize-and-validate path, so the note tells you the final size and whether it is valid glTF.
+7. Revisit any earlier state by clicking its entry in the Versions strip.
+
+## Examples
+
+The API is public and rate-limited. `glb_url` must be a publicly resolvable https URL (the studio checkpoints local file drops to a URL first, behind the scenes).
+
+```bash
+# Discovery document: actions, preset names, and the lineage contract.
+curl 'https://three.ws/api/material-studio'
+
+# AI restyle: instruction in, applied + re-exported GLB out.
+curl -X POST 'https://three.ws/api/material-studio?action=restyle' \
+ -H 'content-type: application/json' \
+ -d '{"glb_url":"https://three.ws/avatars/realistic-female.glb","instruction":"polished chrome"}'
+
+# Seeded colorway variants of a preset (reproducible for a given seed).
+curl -X POST 'https://three.ws/api/material-studio?action=variants' \
+ -H 'content-type: application/json' \
+ -d '{"glb_url":"https://three.ws/avatars/realistic-female.glb","preset":"gold","seed":7,"count":6}'
+```
+
+A restyle response carries the applied factors plus the version lineage:
+
+```json
+{
+ "ok": true,
+ "glbUrl": "https://.../material-studio/.../restyled.glb",
+ "sourceGlbUrl": "https://three.ws/avatars/realistic-female.glb",
+ "instruction": "polished chrome",
+ "factors": {
+ "baseColorFactor": [0.79, 0.81, 0.83, 1],
+ "metallicFactor": 1,
+ "roughnessFactor": 0.05,
+ "emissiveFactor": [0, 0, 0]
+ },
+ "materialsEdited": 4,
+ "lineage": [ { "index": 0, "glbUrl": "…" }, { "index": 1, "glbUrl": "…" } ],
+ "activeIndex": 1
+}
+```
+
+Pass the returned `lineage` array back as `parent_lineage` on the next call to extend the same thread, and add `parent_index` to branch off an earlier version instead of the latest.
+
+## States & limits
+
+- **Only standard PBR materials are edited.** A material must expose metalness, roughness, and a color to be restyled. Non-PBR or custom-shader materials are left as they are.
+- **AI restyle and Save need a public model URL.** A locally dropped file is checkpointed to a URL in the background first; until that resolves, AI restyle and Save show an honest note rather than failing silently. Loading a public `.glb` via "Load URL" skips the wait.
+- **Texture generation is best-effort.** Past the free daily quota the image lane returns a payment-required signal; the studio surfaces that as a note and keeps the flat PBR restyle it already applied. It never fakes a texture.
+- **Bounded, not gated.** The web endpoint is free but rate-limited per IP (separate limits for uploads and restyle/variants). Instructions are capped at 300 characters and uploads at 64 MB.
+- **Reset vs. revert.** Reset restores the original material values in the current tab. Reverting to an earlier durable GLB is a separate action: click its entry in the Versions strip.
+- **No mesh changes.** Geometry, UVs, and rigging are never modified, so a restyle can never break animation or distort a shape.
+
+## Related
+
+- [Avatar Studio](./avatar-studio.md): shares the same GLB optimize-and-validate path and material vocabulary.
+- [Scene Composer](./compose.md) and [Scene Studio](./scene-studio.md): arrange and edit restyled models in a full scene.
+- [MCP tools reference](./mcp-tools.md): the paid `restyle_material` agent twin of this endpoint.
+- [/forge](https://three.ws/forge): generate the models you bring here.
+
+---
+
+<a id="sec-232"></a>
> **Source:** `docs/risk-acknowledgment.md` · [↑ table of contents](#table-of-contents)
@@ -43067,7 +49110,7 @@ the same change.
---
-<a id="sec-191"></a>
+<a id="sec-233"></a>
> **Source:** `docs/robinhood-chain-markets.md` · [↑ table of contents](#table-of-contents)
@@ -43168,12 +49211,14 @@ math; Chainlink feed prices are already multiplier-adjusted, so they're never re
---
-<a id="sec-192"></a>
+<a id="sec-234"></a>
> **Source:** `docs/sas-attestations.md` · [↑ table of contents](#table-of-contents)
# SAS Credentialed Attestations
+An attestation is a signed on-chain statement about a wallet or an agent (for example "this wallet is verified" or "this task result was audited"). This page is for operators and developers who run or integrate with the three.ws attestation authority; end users see the results surfaced on agent passports and reputation scores. Reads are public via `GET /api/agents/sas/credentials`; issuing is admin-only.
+
three.ws issues two kinds of on-chain attestations on Solana:
- **Permissionless attestations** — general feedback, task lifecycle, dispute, and revoke events. Anyone can write them as SPL Memos (see [Solana reputation](solana-reputation.md)).
@@ -43387,13 +49432,89 @@ Closing (revoking) an attestation is done server-side via `sasClose()` in [api/_
---
-<a id="sec-193"></a>
+## Related
+
+- [Agent Reputation on Solana](/docs/solana-reputation): the permissionless SPL Memo attestation layer these credentials weight
+- [Solana agents](/docs/solana): the identity NFTs attestations are made about
+- [Deploy agents on-chain (bulk)](/docs/onchain-agents): the server-side fleet mint flow
+
+---
+
+<a id="sec-235"></a>
+
+> **Source:** `docs/scene-studio.md` · [↑ table of contents](#table-of-contents)
+
+# Scene Studio: the full three.js editor, in your browser
+
+Scene Studio is the complete [mrdoob/three.js](https://github.com/mrdoob/three.js) editor (release r184, MIT-licensed), vendored into three.ws and wrapped in the site chrome. It is the heavyweight scene tool: import GLBs and other assets, move and rotate and scale them with transform gizmos, edit materials and lights and cameras through a full property sidebar, script objects with live JavaScript, play the scene, and export it. Where [Scene Composer](./compose.md) is a focused avatar-plus-props arranger and [Animation Studio](./animation-studio.md) is a posing and keyframing tool, Scene Studio is the general-purpose 3D authoring surface underneath them.
+
+Page: [/scene](https://three.ws/scene)
+
+## Why it exists
+
+Most of the three.ws studios are purpose-built: one does avatars, one does poses, one does materials. That focus is a feature, but it leaves a gap for the times you want to just open a real 3D editor and build a scene with no rails. Rather than reinvent that, three.ws vendors the canonical three.js editor, the same tool the three.js project itself ships, and mounts it inside the platform so it inherits the nav, the theme, and the handoff plumbing. You get a mature, battle-tested editor with an object hierarchy, a scripting console, undo/redo, and glTF export, and it speaks the same GLB format every other three.ws surface produces and consumes.
+
+## How it works
+
+The editor is ported from the upstream `editor/index.html` with a small set of local changes: it mounts into a container under the site nav instead of taking over `document.body`, it drops the service worker, and it applies three.ws chrome overrides. It is dark-locked, because the vendored editor CSS only ships a dark theme. The core is the upstream `Editor` object driving the standard panels: `Viewport`, `Toolbar`, `Sidebar`, `Menubar`, `Player`, and the `Animation` timeline, all wired through the editor's signal bus.
+
+- **Import.** Drag assets into the viewport or use the menubar's import. GLB/glTF load through the shared loader (`loader.js`), which decodes meshopt- and Draco-compressed buffers, so three.ws models load without extra steps. The editor also handles the other formats the upstream editor supports.
+- **Transform.** Select an object in the hierarchy or viewport and use the translate/rotate/scale gizmos. The sidebar exposes exact numeric transforms.
+- **Materials, lights, cameras.** The Object, Geometry, and Material tabs in the sidebar edit every property the three.js material and light models expose: color, metalness, roughness, maps, intensity, shadows, fog, background, and environment.
+- **Scripting.** The editor bundles CodeMirror (with JavaScript and GLSL modes) and a Tern.js autocomplete engine seeded with three.js type definitions, so you can attach live scripts to objects and write shaders with completion.
+- **Play and export.** The Player runs the scene (scripts included). The menubar exports the scene or selected objects to glTF/GLB, and the Draco encoder is bundled for compressed export.
+
+### Handoff from Animation Studio
+
+Scene Studio is the render target for animations built in [Animation Studio](./animation-studio.md). When you click "Open in Scene Studio" there, the studio bakes your keyframed animation into a GLB, stashes it in IndexedDB, and navigates to `/scene?handoff=1`. Scene Studio picks the model up on boot (`takeSceneHandoff`), drops it into the scene with its animation track ready, and you record it to video from the editor's render menu. The GLB is passed through browser storage, not the network, so nothing large is uploaded to move a model between the two tools.
+
+## Walkthrough
+
+1. Open [/scene](https://three.ws/scene). The empty editor loads with an object hierarchy on one side and the property sidebar on the other.
+2. Drag a `.glb` into the viewport (or use Menubar ▸ import). It appears in the hierarchy.
+3. Click it to select. Use the toolbar gizmos, or the keyboard, to move, rotate, and scale it. Fine-tune exact values in the sidebar.
+4. Open the Material tab to change its color, metalness, roughness, or maps. Add a light from the Add menu and set its intensity and shadows.
+5. Add more objects to compose the scene. Adjust the scene background, fog, and environment in the sidebar's Scene tab.
+6. Attach a script to an object if you want runtime behavior, and press Play to run it.
+7. Export the finished scene to GLB from the menubar.
+
+## Examples
+
+Scene Studio is an interactive editor, not an HTTP API, so the concrete examples are its entry points:
+
+- **Open it empty:** [https://three.ws/scene](https://three.ws/scene)
+- **Receive a handoff:** `https://three.ws/scene?handoff=1`: used by Animation Studio's "Open in Scene Studio" button; the model to load is read from IndexedDB, not the URL.
+
+A typical round trip from another studio:
+
+1. Build a walk cycle in [Animation Studio](./animation-studio.md) on a rigged avatar.
+2. Click "Open in Scene Studio". The baked animated GLB is stashed and `/scene?handoff=1` opens.
+3. In Scene Studio, add a ground plane, a key light, and a camera, position the avatar, and use Render ▸ Video to capture the loop.
+
+## States & limits
+
+- **Dark theme only.** The vendored editor chrome ships a single dark skin; the studio locks the page to dark so the panels render correctly, regardless of your site theme preference.
+- **Desktop-class tool.** This is the full three.js editor with dense panels and gizmo interactions. It expects a pointer and a reasonably sized viewport; it is not tuned for small touch screens the way the other studios are.
+- **Vendored, MIT-licensed.** The editor is a vendored copy of three.js r184 under MIT. Attribution and the upstream license live in [src/scene-studio/vendor/](../src/scene-studio/vendor) (see the vendor `README`/`LICENSE`). Local changes are limited to the container mount, theme lock, and chrome overrides.
+- **Handoff is browser-local.** The Animation Studio handoff moves the GLB through IndexedDB in the same browser. Opening `/scene?handoff=1` directly, with nothing stashed, just gives you an empty editor.
+- **Export format.** Scenes export to glTF/GLB (Draco available). That is the same format Restyle Studio, Scene Composer, and the viewer all read, so a scene authored here flows back into the rest of the platform.
+
+## Related
+
+- [Scene Composer](./compose.md): the lighter avatar-plus-props arranger with Forge integration.
+- [Animation Studio](./animation-studio.md): builds the animated GLBs Scene Studio records to video.
+- [Restyle Studio](./restyle.md): re-skin the models before or after composing them.
+- [3D asset pipeline](./3d-asset-pipeline.md): how GLB, glTF, and clip formats relate across the platform.
+
+---
+
+<a id="sec-236"></a>
> **Source:** `docs/sdk.md` · [↑ table of contents](#table-of-contents)
# SDK & Library
-This document covers programmatic use of three.ws beyond simple embedding. There are two distributable artifacts you can import into your own project:
+This page is for developers who want to build with three.ws code in their own project, beyond pasting an embed snippet. If you just want a 3D agent on a page, start with the [web component](./web-component.md); come here when you need to import classes, register agents on-chain, or build the bundles yourself. There are two distributable artifacts you can import:
| Artifact | Package | Use case |
|---|---|---|
@@ -43721,21 +49842,17 @@ import {
### TypeScript support
-The SDK ships full TypeScript declarations at `src/index.d.ts` and `src/permissions.d.ts`:
+The SDK ships full TypeScript declarations. The package's `exports` map points each entry at its declarations (`types/index.d.ts` for the main entry, `types/permissions.d.ts` for `@three-ws/sdk/permissions`, `types/solana.d.ts` and `types/solana-attestations.d.ts` for the Solana entries), so `tsc` resolves them automatically, with no `@types` package needed:
```ts
import type {
AgentKitOptions,
- RegisterOptions,
- RegistrationResult,
- ManifestsResult,
- ServiceEntry,
- SkillDefinition,
- AgentRegistrationDocument,
- AgentCardDocument,
- AiPluginDocument,
- PermissionsClient,
- DelegationScope,
+ AgentKitRegisterOptions,
+ AgentPanelOptions,
+ WalletConnection,
+ RegisterAgentOptions,
+ PermissionsClientOptions,
+ DelegationPublic,
ScopePreset,
} from '@three-ws/sdk';
@@ -43745,8 +49862,8 @@ const options: AgentKitOptions = {
description: 'Product guide',
};
-const result: RegistrationResult = await agent.register();
-// { agentId: number, registrationCID: string, txHash: string }
+const result = await agent.register();
+// result: { agentId: number, registrationCID: string, txHash: string }
```
---
@@ -43822,13 +49939,22 @@ python3 -m http.server 8080
---
-<a id="sec-194"></a>
+## Related
+
+- [Web Component](/docs/web-component): the `<agent-3d>` element the bundle ships
+- [JavaScript API](/docs/js-api): viewer, validator, and component internals
+- [REST API Reference](/docs/api-reference): the HTTP surface the SDK talks to
+- [x402](/docs/x402): the payment packages listed above
+
+---
+
+<a id="sec-237"></a>
> **Source:** `docs/security.md` · [↑ table of contents](#table-of-contents)
# Security
-three.ws is designed for developers and organizations that need to reason carefully about what data goes where, who can call what, and how identities are established. This document covers the full security model: data handling, embed isolation, authentication, on-chain identity, and operational guidance for self-hosters.
+This page explains how three.ws keeps your data, wallet, and agents safe, and what you are responsible for when you embed or self-host the platform. If you just use the site, the short version is: 3D files render in your browser and are not uploaded unless you save them, your wallet's private keys never leave your wallet, and sessions use hardened cookies. Developers and self-hosters will find the full model below: data handling, embed isolation, authentication, on-chain identity, and operational guidance. To report a vulnerability, see [Responsible disclosure](#responsible-disclosure) at the bottom.
## Security principles
@@ -43838,7 +49964,7 @@ three.ws is designed for developers and organizations that need to reason carefu
**Least privilege** — agents access only what is explicitly declared and granted. Skills declare permission requirements; users must grant them. API keys carry only the scopes you assign. OAuth access tokens are short-lived (1 hour) and audience-bound.
-**Transparency** — the codebase is open source. The on-chain identity, reputation, and validation registries are auditable on Base. Badge verification derives from on-chain attestations, not the badge UI itself.
+**Transparency**: the codebase is publicly readable on GitHub (source-available under the repository's proprietary LICENSE). The on-chain identity, reputation, and validation registries are auditable on Base. Badge verification derives from on-chain attestations, not the badge UI itself.
**Standard web security** — HTTPS-only for all authenticated operations. CSP, CORS, and `__Host-` cookie prefix enforced throughout.
@@ -43853,11 +49979,11 @@ Models loaded into the viewer are processed entirely on your device:
- The browser fetches and decodes the GLB file directly — no proxy, no server touch
- WebGL rendering runs in your GPU via a sandboxed canvas context
- Screenshots (`canvas.toDataURL()`) are generated client-side and never uploaded automatically
-- Models are only sent to three.ws servers if you explicitly use the avatar registration flow (which pins to IPFS via Storacha)
+- Models are only sent to three.ws servers if you explicitly save an avatar or use the on-chain registration flow (which pins metadata to IPFS via Pinata when you supply a JWT, or stores it in the platform's R2 bucket otherwise)
### Conversation data
-Chat messages travel through `/api/chat`, which proxies to the configured LLM provider (Anthropic by default). The proxy layer:
+Chat messages travel through `/api/chat`, which proxies to a configured LLM provider. Providers are tried in a failover ladder (free-tier providers such as Groq, OpenRouter, and NVIDIA NIM lead; Anthropic and OpenAI are paid backstops; Vertex and watsonx are available when configured); see the routing comment in [api/chat.js](../api/chat.js). The proxy layer:
- Injects authentication and enforces rate limits
- Does not log message content
@@ -43879,6 +50005,7 @@ The SIWE (Sign-In With Ethereum) flow signs a server-generated challenge — no
| Mode | Where data lives | Privacy |
|------|-----------------|---------|
| `local` (default) | Browser `localStorage` | Device-only |
+| `remote` | three.ws cloud storage, tied to your account | Opt-in cloud sync (see [Memory](./memory.md)) |
| `ipfs` | Public IPFS network | Public — use only for non-sensitive data |
| `encrypted-ipfs` | IPFS, encrypted before leaving the browser | Encrypted with your key; IPFS only sees ciphertext |
| `none` | Not persisted | Cleared on page unload |
@@ -43902,7 +50029,7 @@ The iframe embed at `/a/:chainId/:agentId/embed` sets permissive `frame-ancestor
}
```
-When an iframe is blocked by embed policy, it posts `{ __agent, type: 'blocked', host }` to the parent and shows a link to the canonical agent page.
+When an iframe is blocked by embed policy, it posts `{ __agent: true, type: 'blocked', host }` to the parent and shows a link to the canonical agent page.
Minimum `sandbox` permissions for the `<agent-3d>` web component:
@@ -43951,7 +50078,7 @@ Pin the exact bundle version and validate with Subresource Integrity:
></script>
```
-SRI hashes for each release are at `/agent-3d/<version>/integrity.json`. The `latest` channel (`max-age=300`) should never be used in production — use a pinned `MAJOR.MINOR.PATCH` URL, which is served with `max-age=31536000, immutable`.
+SRI hashes for each release are at `/agent-3d/<version>/integrity.json`. The `latest` channel (served with `max-age=3600, s-maxage=300, stale-while-revalidate=86400`) should never be used in production; use a pinned `MAJOR.MINOR.PATCH` URL, which is served with `max-age=31536000, immutable`.
### postMessage security
@@ -43959,7 +50086,7 @@ Always verify the `origin` before trusting messages from the embed:
```js
window.addEventListener('message', e => {
- if (e.origin !== 'https://three.ws/') return;
+ if (e.origin !== 'https://three.ws') return;
// handle message
});
```
@@ -44010,7 +50137,7 @@ Refresh tokens are opaque (SHA-256 hashed at rest). Refresh token reuse detectio
API keys are prefixed `sk_live_` (production) or `sk_test_`. Security properties:
- Hashed with SHA-256 before storage — the plaintext is shown exactly once at creation and cannot be recovered
-- Scope-limited — each key is created with an explicit scope set (`avatars:read`, `avatars:write`, `avatars:delete`, `profile`)
+- Scope-limited: each key is created with an explicit scope set from `avatars:read`, `avatars:write`, `avatars:delete`, `profile`, `memory:read`, `memory:write`, `agents:read`, `agents:write` (default `avatars:read avatars:write`)
- Rate-limited independently from session auth
- Last-used timestamp tracked; revocable at any time
@@ -44094,19 +50221,24 @@ The LLM runtime enforces a hard cap of 8 tool-call iterations per message (`MAX_
### Content moderation
-All requests through the `/api/chat` proxy are subject to Anthropic's content policies. Requests that violate policy are rejected before the response is returned to the client.
+Requests through the `/api/chat` proxy are subject to the content policies of whichever upstream provider serves them (Anthropic, OpenAI, Groq, OpenRouter, NVIDIA, Google Vertex, or IBM watsonx, depending on routing). Requests a provider rejects for policy reasons surface as errors rather than completions.
+
+### Server-side fetch (SSRF) protection
+
+Server code that fetches user-supplied URLs (GLB validation, manifest pinning, avatar imports) goes through [api/_lib/ssrf-guard.js](../api/_lib/ssrf-guard.js) rather than raw `fetch`. `assertSafePublicUrl()` rejects non-HTTPS schemes and resolves the hostname up front, refusing private, loopback, link-local, CGNAT, and cloud-metadata addresses. `fetchSafePublicUrl()` validates DNS then fetches (acceptable where the response is only displayed); `fetchSafePublicUrlPinned()` additionally pins the TCP connection to the validated IP so a DNS rebind between check and connect cannot redirect the request into the internal network. Both re-validate every redirect hop and enforce a streaming byte cap (`MaxBytesExceededError`) so an unbounded body cannot exhaust memory.
---
## Rate limiting
-All limits are enforced via Upstash Redis and return `429 Too Many Requests` with a `Retry-After` header on breach.
+Limits return `429 Too Many Requests` with a `Retry-After` header on breach. Money-moving and credential buckets are enforced through shared Upstash Redis so they hold across every instance; a few very hot read buckets (including the MCP limiters) are deliberately per-instance (`local: true` in [api/_lib/rate-limit.js](../api/_lib/rate-limit.js)) to keep Redis command volume down, and the credential buckets degrade to in-memory limiting rather than failing closed if Redis is unreachable.
| Endpoint class | Limit |
|----------------|-------|
-| Login / register | 30 requests / 10 min per IP |
+| Login (credential attempts) | 50 requests / 10 min per IP |
+| Account registration | 5 / hour per IP |
| OAuth client registration | 10 / hour per IP |
-| MCP endpoints | 1200 / min per user, 600 / min per IP |
+| MCP endpoints | 1200 / min per user, 600 / min per IP (per instance) |
| File uploads | 60 / hour per user |
The `clientIp()` helper reads `X-Forwarded-For` and walks the chain from the right, skipping the trusted proxy hops appended by three.ws's own infrastructure (Google's external Application Load Balancer in front of Cloud Run), then takes the next address as the real client. It falls back to the socket address only when there is no `X-Forwarded-For` at all (local dev, tests, direct container access). Reading a caller-settable header directly is avoided precisely so a client cannot rotate the claimed address to mint a fresh limiter bucket per request. The Google Cloud load balancer provides an additional DDoS mitigation layer before requests reach the rate-limit check.
@@ -44115,11 +50247,9 @@ The `clientIp()` helper reads `X-Forwarded-For` and walks the chain from the rig
## CORS policy
-The API's CORS configuration allows cross-origin reads from a named set of trusted origins:
+The API's default CORS allowlist lives in `isAllowedOrigin()` in [api/_lib/http.js](../api/_lib/http.js): the platform origin (`env.APP_ORIGIN`, normally `https://three.ws`), a small named set of partner and ecosystem origins (including `ibm.com` and its subdomains for the IBM partnership embeds), and `localhost` in non-production only. Endpoints that are meant to be world-readable opt in to `origins: '*'` explicitly.
-- `https://three.ws/`
-- `https://chat.sperax.io` and associated Sperax staging origins
-- `http://localhost:*` and `https://localhost:*` (development only)
+Separately, the S3/R2 storage bucket has its own CORS policy defined in `cors.json` (applied to the bucket, not the API); that file's origin list includes `https://three.ws`, the Sperax chat origins, and localhost. See the [`cors.json` section of the Configuration Reference](/docs/configuration).
The bundle CDN path (`/agent-3d/`) sets `access-control-allow-origin: *` and `cross-origin-resource-policy: cross-origin` so the script can load from any origin. The agent embed iframe sets `frame-ancestors *` (overrideable per-agent via embed policy, see above).
@@ -44133,7 +50263,7 @@ Admin and write endpoints accept only same-site requests, enforced by checking t
- Never commit `.env` to version control
- Rotate `JWT_SECRET` immediately if it is ever exposed — all existing sessions and OAuth tokens become invalid, which is preferable to leaving a compromised secret in place
-- Scope third-party API keys minimally: Anthropic key should cover only the models and features you use; Storacha key should be scoped to your bucket
+- Scope third-party API keys minimally: LLM provider keys should cover only the models and features you use; the Pinata JWT and S3/R2 credentials should be scoped to your own bucket
### Database (Neon)
@@ -44171,7 +50301,107 @@ For validator misconduct (biased or falsified on-chain attestations), open a pub
---
-<a id="sec-195"></a>
+## Related
+
+- [Configuration Reference](/docs/configuration): every environment variable and config file
+- [ERC-8004](/docs/erc8004): the on-chain identity registries referenced above
+- [SAS Credentialed Attestations](/docs/sas-attestations): the Solana attestation authority and its key handling
+- [Memory](/docs/memory): memory modes and their privacy trade-offs
+
+---
+
+<a id="sec-238"></a>
+
+> **Source:** `docs/selfie-to-avatar.md` · [↑ table of contents](#table-of-contents)
+
+# Selfie to Avatar: scan your face into a rigged 3D character
+
+Point your camera at your face, hold still for a countdown, and about a minute later you have a rigged, animation-ready 3D avatar in the browser. The scanner captures a single clean frontal photo (side angles optional), gates it for quality on-device, and hands it to a server-side face-reconstruction pipeline that fits your likeness onto a pre-rigged humanoid template. No modeling, no rig setup, no download of desktop tools.
+
+Page: [/create/selfie](https://three.ws/create/selfie) (the working surface) · [/scan](https://three.ws/scan) (redirects here) · [/features/scan](https://three.ws/features/scan) (overview)
+API: `POST /api/avatars/reconstruct` · `GET /api/avatars/regenerate-status` · `GET /api/avatars/:id`
+
+## Why it exists
+
+Every other surface on three.ws (agents, the marketplace, Play worlds, talking-avatar video, AR) needs a body to drive. A text prompt gives you a character; a selfie gives you *yourself*. The scanner is the shortest path from a real face to a shareable, riggable GLB, and it runs entirely from a phone or laptop browser with a camera. The output is not a static bust: it is a humanoid with a skeleton and a full ARKit blendshape set, so it can walk, emote, lip-sync, and be exported the moment it finishes.
+
+`/scan` is a thin alias kept for links and marketing. On load it runs `window.location.replace('/create/selfie' + location.search)`, because `/create/selfie` carries the complete flow including the bring-your-own-key path. Document and link to `/create/selfie`.
+
+## How it works
+
+The client half lives in three modules the page imports on demand: [`src/selfie-capture.js`](../src/selfie-capture.js) (camera and upload UI), [`src/selfie-refine.js`](../src/selfie-refine.js) (`assessPhoto` / `refineSelfie`), and [`src/selfie-pipeline.js`](../src/selfie-pipeline.js) (the bridge to the backend). A fourth module, [`src/face-quality.js`](../src/face-quality.js), runs a live 468-point face mesh for framing feedback.
+
+1. **Capture, in the browser.** `getUserMedia({ video: { facingMode: 'user', width: { ideal: 1280 }, height: { ideal: 1706 } } })` opens the front camera. A real-time wireframe overlay tracks head pose, yaw, centering, blur, and luminance, and only unlocks the shutter when the face passes. A 3-2-1 countdown fires, then `shoot()` draws the current video frame to a canvas and calls `canvas.toBlob(blob, 'image/jpeg', 0.92)`. This is a **single still**, not a video scan. Camera support is feature-detected; if none exists, the shutter is disabled and an "Upload instead" path takes any image file.
+2. **Optional side angles.** Under an "Add side angles" disclosure you can capture two extra stills (`left`, `right`, turned ~45 degrees). They raise fidelity and the ETA, but only the frontal is required.
+3. **Refine, in the browser.** `assessPhoto` gates the frontal (no face is the only hard block; blur, illustration, or a distant subject are non-fatal warnings). `refineSelfie` isolates the subject from its background and reframes to a clean head-and-shoulders square, then downscales (max 1024px, JPEG quality 0.88). The refined frontal is previewed so you see exactly what the engine sees.
+4. **Submit.** The pipeline POSTs the photos as data URIs to `/api/avatars/reconstruct` and gets back a `jobId`.
+5. **Reconstruct, server-side.** The reconstruct handler (`api/avatars/_actions.js`) selects a provider through [`api/_lib/regen-provider.js`](../api/_lib/regen-provider.js). The production lane is **GCP**: it POSTs `{ images, body_type }` to the Cloud Run service `avatar-pipeline-controller` (env `GCP_RECONSTRUCTION_URL`), which runs the [`workers/avatar-reconstruction/`](../workers/avatar-reconstruction/) FastAPI app. That pipeline (`face_texture_transfer_v2`) uses **MediaPipe FaceLandmarker** (468 landmarks, Apache-2.0) to transfer your face texture and geometry onto a fixed-topology, pre-rigged Wolf3D/Ready-Player-Me-style humanoid template carrying a Mixamo-compatible skeleton, 52 ARKit blendshapes, and 15 visemes. Full engine detail is in [avatar-reconstruction.md](./avatar-reconstruction.md).
+6. **Auto-rig fallback.** The template is born rigged. If a generic mesh comes back unrigged and a rig model is configured, `reconstruct-finalize.js` chains a `rerig` job (GCP UniRig, `workers/unirig`) and moves the job through a `rigging` status before surfacing the avatar. If rigging is impossible it delivers the static mesh tagged `unrigged` rather than nothing.
+7. **Poll and finish.** The client polls `GET /api/avatars/regenerate-status?jobId=...` every ~3 seconds (backing off on errors). On `status: 'done'` it fetches the finished avatar from `GET /api/avatars/:id` and shows it in a `<model-viewer>`.
+
+### The text-to-avatar variant
+
+The same `/api/avatars/reconstruct` endpoint accepts a `prompt` instead of `photos`. It runs a Flux text-to-image step (with a suffix that forces a head-and-shoulders portrait), then feeds that image into the identical reconstruct and auto-rig pipeline. One endpoint, two front doors.
+
+## Walkthrough
+
+1. Open [/create/selfie](https://three.ws/create/selfie). Sign in if prompted (the job resumes after login).
+2. Allow camera access. Center your face in the wireframe until the shutter unlocks; good light and a plain background help.
+3. Let the countdown run and hold still for the capture. Review the frame, or retake.
+4. Optionally open "Add side angles" and capture a left and right turn for higher fidelity.
+5. Press the submit button (labeled with the ETA, ~90s frontal-only or ~120s with sides). Watch the build steps: mesh, geometry and textures, auto-rig.
+6. When it lands, use "Open my avatar" to view it, "Customize in editor" to edit, "Turn this into an agent", or the export buttons (.GLB, .FBX) and share panel.
+
+## Examples
+
+The reconstruct endpoint is authenticated. With a session cookie or a bearer token scoped `avatars:write`:
+
+```bash
+# Submit a reconstruction from a single frontal data-URI (or a hosted image URL).
+curl -X POST 'https://three.ws/api/avatars/reconstruct' \
+ -H 'content-type: application/json' \
+ -H 'authorization: Bearer <TOKEN>' \
+ -d '{
+ "name": "My selfie avatar",
+ "photos": ["data:image/jpeg;base64,/9j/4AAQ..."],
+ "visibility": "private",
+ "params": { "bodyType": "average", "style": "realistic" }
+ }'
+# -> 202 { "ok": true, "jobId": "…", "status": "queued", "eta": 90, "provider": "gcp" }
+
+# Poll until done, then fetch the rigged GLB.
+curl -H 'authorization: Bearer <TOKEN>' \
+ 'https://three.ws/api/avatars/regenerate-status?jobId=<JOBID>'
+# -> { "ok": true, "jobId": "…", "status": "done", "resultAvatarId": "<ID>" }
+
+curl -H 'authorization: Bearer <TOKEN>' 'https://three.ws/api/avatars/<ID>'
+# -> { "avatar": { "url": "<signed GLB url>", "model_url": null, ... } }
+```
+
+Request body: `name` (1-120, required), `photos` (1-6 image URLs or data URIs) **or** `prompt` (3-600 chars), optional `description`, `visibility` (`private` | `unlisted` | `public`), `params`, and the BYOK pair `provider_key` + `provider_name`. Status values progress `queued` -> `running` -> (`rigging`) -> `done` | `failed`.
+
+## States and limits
+
+- **Auth is required.** No session or scoped token returns `401`, and the page redirects to `/login?next=/create/selfie`, resuming the pending job afterward via `sessionStorage`. The `/features/scan` marketing line "no account for first scan" does not match the shipped API; treat sign-in as required.
+- **Cost.** On the platform-hosted GCP lane there is no per-use charge in the reconstruct handler; usage is rate-limited (`limits.upload`), and over-quota returns `402 plan_limit`.
+- **Bring your own key.** If no platform reconstruction backend is configured, the server returns `402 { code: 'regen_needs_byok', providers: ['meshy','tripo'] }` and the page shows a key-entry form. Meshy and Tripo run image-to-3D with your own API key; credit exhaustion surfaces as `402 insufficient_credits`.
+- **Single frame.** Despite "captures several angles automatically" in some copy, the scanner takes one manual still per slot; side angles are an optional manual add.
+- **Timing.** The build screen says "1-2 minutes"; polling gives up after 8 minutes, and a job still reported running 10 minutes after submit (possible when a pending job resumes across a reload) stops with a "taking unusually long" message pointing you to your dashboard, since the avatar may still finish server-side.
+- **Quality gating.** Only a frontal with no detectable face hard-blocks. Blur, illustrations, or multiple faces are surfaced as warnings you can proceed past.
+- **Error handling.** Camera denial distinguishes `NotAllowedError` ("Camera access was denied... use Upload instead") from other failures. Job failures map to friendly messages (no face, content-safety flag, blur, service unavailable, timeout, out-of-memory). Poll tolerates up to 5 consecutive network errors with backoff before "Lost connection to the avatar engine." Rate limits (`429`) start a 60-second cooldown with a live countdown. Pending jobs resume across reloads.
+- **Output.** glTF 2.0 GLB with a Mixamo-standard humanoid rig, 52 ARKit blendshapes, and 15 visemes. Private avatars return a short-lived signed `url`; `model_url` is the public CDN URL once you make it public.
+
+## Related
+
+- [Avatar reconstruction pipeline](./avatar-reconstruction.md): the full engine: MediaPipe face-texture transfer, geometry morph, the fixed pre-rigged head template, and the Cloud Run worker.
+- [Avatar pipeline](./avatar-pipeline.md): the distinct Forge text-to-3D generation lane.
+- [Trait-based avatar builder](./character-studio.md): customize and dress the avatar after you scan it.
+- [Talking Avatar Video](./talking-avatar-video.md) and [Lipsync](./lipsync.md): drive the finished avatar's mouth.
+- Pages: [/create/selfie](https://three.ws/create/selfie), [/create](https://three.ws/create), [/features/scan](https://three.ws/features/scan).
+
+---
+
+<a id="sec-239"></a>
> **Source:** `docs/share-and-embed.md` · [↑ table of contents](#table-of-contents)
@@ -44183,7 +50413,7 @@ Once your agent is live, you have three ways to put it in front of people. None
## Option 1 — Share the link
-Every agent gets a public URL: `https://three.ws/agent/<id>`
+Every agent gets a public URL: `https://three.ws/agents/<id>`
Paste it anywhere:
@@ -44241,14 +50471,14 @@ The element renders inline (no iframe boundary), supports keyboard navigation, a
By default, your agent can be embedded anywhere. If you want to restrict it to specific domains:
1. Open your agent's edit page
-2. Under **Embed settings**, add the domains that are allowed (e.g. `yoursite.com`)
+2. Under the **Embed policy** settings, add the domains that are allowed (e.g. `yoursite.com`)
3. Save — any embed on a non-listed domain will render an error placeholder instead
---
## Sharing on social platforms
-Paste your agent's URL (`https://three.ws/agent/<id>`) into:
+Paste your agent's URL (`https://three.ws/agents/<id>`) into:
- **X / Twitter** — renders a card with the avatar poster image, name, and description
- **Discord** — embeds as an oEmbed rich preview
@@ -44268,7 +50498,113 @@ To customize the preview image, change the agent's thumbnail in the editor.
---
-<a id="sec-196"></a>
+<a id="sec-240"></a>
+
+> **Source:** `docs/signals.md` · [↑ table of contents](#table-of-contents)
+
+# Signal Marketplace: pay-per-signal copy trading, ranked by proven edge
+
+The Signal Marketplace is a directory of live trading feeds published by real, verified traders on three.ws. Each feed emits entry and exit signals bound to the publisher's actual on-chain fills. Your agent subscribes, pays per signal or per epoch in USDC over x402, and auto-mirrors each call through the same firewall and spend policy your wallet always runs under. Feeds are ranked not by follower count but by proven realized edge, so a thin feed riding one lucky call can never top a deep, consistent one.
+
+Page: [/signals](https://three.ws/signals) (feed detail at `/signals/<slug>`)
+API: `GET /api/signals/marketplace`, `GET /api/signals/feed`, `GET/POST/DELETE /api/signals/subscribe`, `GET /api/signals/stream`
+
+## Why it exists
+
+Copy trading has two chronic problems: you cannot tell who is actually good, and mirroring someone means trusting them with your funds. The marketplace fixes both.
+
+Every signal is minted from the publisher's real position ledger, the same ledger their public verification badge is computed from, so a seller cannot hand-author a winning call they never took. And a feed's rank is its proven realized edge, confidence-regressed toward neutral until enough signals have closed. That means the board rewards traders who are consistently right over many trades, not loud ones with a single screenshot. Losers are counted; nothing is hidden.
+
+On the buyer side, your agent's own custodial wallet pays and signs. You never hand a key to a stranger. The mirror runs through the identical guarded trade path your agent uses everywhere else, so a bad signal cannot spend past your caps or trade into a rug the firewall would block.
+
+## How it works
+
+A **feed** (`signal_feeds`) belongs to a publisher agent and carries its pricing (`price_per_signal_usdc`, `price_per_epoch_usdc`, `epoch_seconds`), what it emits (entries, exits, whether sizing is revealed), and a minimum-conviction floor.
+
+**Emissions are minted from real fills.** `syncFeedEmissions` walks the publisher's `agent_sniper_positions`: a position opening becomes an `entry` emission (sized by conviction, which is derived from how large the entry is versus the publisher's own median entry); a position closing backfills that entry's realized outcome (`win`/`loss`/flat) and, if the feed publishes exits, mints a distinct `exit`. It is idempotent, so a re-run never double-emits, and an exit is never emitted for a coin that was never entered.
+
+**Ranking is proven edge, regressed.** `feedEdgeScore` fuses the feed's hit rate and average realized ROI, regressed toward the publisher's own verified track-record score until enough signals have closed. The marketplace sorts on that by default; you can re-sort by ROI, hit rate, subscribers, or newest. A feed with fewer than 10 closed signals is flagged "Building track record" and its edge stays pulled toward neutral.
+
+**Delivery pays then mirrors.** For each active subscription, `deliverSubscription` claims an idempotent delivery row per emission, settles the x402 payment (live mode only), then auto-mirrors:
+
+- **Billing.** `per_signal` charges only on entries (exits ride free once the entry is paid); `per_epoch` charges once per paid window and stamps `epoch_paid_until` so same-epoch deliveries do not re-charge.
+- **Payment.** Uses `transferUsdcGuarded` from the subscriber agent's wallet to the feed's payout address. If the payment is blocked (spend cap or frozen wallet) or fails, the delivery is recorded `unpaid` and the mirror is skipped. The platform never trades unpaid alpha.
+- **Mirror.** An entry buys a size derived from your base size, the signal's size multiple, your scaling, and your per-trade cap; an exit sells your full holding of that mint. Both run through `runFollowerTrade`, the shared guarded path, with your slippage and firewall level (`block` or `warn`).
+
+The marketplace read is public and cacheable (no auth); subscribing is owner-authenticated and CSRF-protected because it commits your agent's wallet to paying and trading.
+
+## Walkthrough
+
+1. Open [/signals](https://three.ws/signals). The board loads the top feeds for the current network, each card showing the publisher, a "Proven edge" score and bar, hit rate, average ROI, closed-versus-total signal counts, price, and subscriber count.
+2. Sort with the segmented control: proven edge (default), ROI, hit rate, subscribers, or newest. Switch network (mainnet/devnet) with the adjacent control. Both reflect into the URL so any view is shareable.
+3. Click a feed to open its detail page (`/signals/<slug>`): full accountability stats plus recent emissions, each with its realized outcome and a Solscan link to the real buy or sell fill that produced it.
+4. Subscribe from your own agent. Choose `simulate` to mirror without paying or trading (trust-building) or `live` to pay and mirror within your spend policy. Set your base size, sizing scaling, slippage, per-trade cap, and whether to copy exits.
+5. Your agent pays per signal or per epoch as new emissions land, and mirrors each one. Watch deliveries and fills accrue.
+6. Kill any time. Setting `killed` halts all further payment and trading the instant it is set, honored before any payment or trade fires.
+
+## Examples
+
+Read the top feeds by proven edge:
+
+```bash
+curl -s 'https://three.ws/api/signals/marketplace?network=mainnet&sort=edge&limit=10' \
+ | jq '.feeds[] | {rank, title, edge_score, hit_rate: .stats.hit_rate, per_signal: .pricing.per_signal_usdc}'
+```
+
+Subscribe an agent in simulate mode first (mirrors, spends nothing):
+
+```bash
+curl -s https://three.ws/api/signals/subscribe \
+ -H 'authorization: Bearer YOUR_TOKEN' \
+ -H 'content-type: application/json' \
+ -d '{
+ "feed_id": 42,
+ "agent_id": "YOUR_AGENT_UUID",
+ "mode": "simulate",
+ "base_sol": 0.1,
+ "copy_exits": true
+ }'
+```
+
+The feed's numeric `feed_id` comes from the marketplace read; the subscription's network is inherited from the feed, so you do not pass one.
+
+Go live within your caps, then instantly kill if needed:
+
+```bash
+# flip to live: re-POST the create body with the new mode
+# (upserts on the same feed_id + agent_id pair)
+curl -s https://three.ws/api/signals/subscribe -H 'authorization: Bearer YOUR_TOKEN' \
+ -H 'content-type: application/json' \
+ -d '{ "feed_id": 42, "agent_id": "YOUR_AGENT_UUID", "mode": "live" }'
+
+# hard stop: no further pay or trade
+curl -s https://three.ws/api/signals/subscribe -H 'authorization: Bearer YOUR_TOKEN' \
+ -H 'content-type: application/json' -d '{ "id": 123, "killed": true }'
+```
+
+## Guardrails, states, and limits
+
+- **Simulate versus live.** Simulate mirrors and sizes orders but pays nothing and trades nothing. Live pays the x402 USDC and executes the mirror, always within the agent's server-side spend policy.
+- **Pay-then-trade, never trade-then-pay.** If the x402 payment is blocked by a spend cap or a frozen wallet, or fails, the mirror is skipped and the delivery is marked unpaid. Alpha is never traded on credit.
+- **Every mirror is firewalled.** Entries route through `runFollowerTrade` with your firewall level; the rug/honeypot defense that guards all agent trades applies here too. WSOL and dust-sized orders are skipped with a recorded reason.
+- **Instant kill.** `killed` on a subscription halts payment and trading before the next delivery. A paused or stopped subscription simply stops delivering; kill is the emergency stop.
+- **Proven-edge ranking, not popularity.** Rank is confidence-regressed realized edge. Sub-10-closed-signal feeds are flagged and regressed toward neutral, so they cannot leapfrog proven ones.
+- **Idempotent delivery.** One delivery per (subscription, emission); a retry no-ops. Per-epoch billing charges once per window.
+- **Empty and reconnecting states.** With no live feeds on the selected network, the grid shows a designed empty state pointing to the leaderboard. On a transient fetch failure after first load, the last known board stays up and the live dot reads "reconnecting".
+- **Publisher honesty is enforced at the source.** Emissions bind to real `buy_sig`/`sell_sig` fills; a publisher cannot fabricate a signal or hide a loss.
+
+## Related
+
+- [Custody you can verify](./custody.md) - the spend caps, freeze, and audit trail the subscriber wallet pays and trades under
+- [Financial controls](./financial-controls.md) - the plain-English rules and firewall the mirror respects
+- [Oracle](./oracle.md) - the conviction engine and its own follow/copy tier
+- [x402](./x402.md) - the USDC payment protocol every signal settles over
+- [Trader card](./trader-card.md) - the verified track record that regresses a feed's edge
+- [/leaderboard](https://three.ws/leaderboard) - build a verified record, then publish a feed of your own
+
+---
+
+<a id="sec-241"></a>
> **Source:** `docs/sketchfab.md` · [↑ table of contents](#table-of-contents)
@@ -44351,13 +50687,14 @@ belong to their creators, and the showcase does not relicense them.
| `SKETCHFAB_UPLOADS_PER_RUN` | Models per run, default 2, clamped 1-5. At the Mon/Wed/Fri schedule the default publishes up to 6 models a week. |
State lives in the `sketchfab_uploads` table (one row per creation:
-`pending`, `uploaded`, `live`, or `failed` with the error recorded). Code:
+`pending`, `uploaded`, `live`, `failed` with the error recorded, or `blocked`
+when the brand-safety gate parked it). Code:
[`api/cron/sketchfab-showcase.js`](https://github.com/nirholas/three.ws/blob/main/api/cron/sketchfab-showcase.js)
and [`api/_lib/sketchfab.js`](https://github.com/nirholas/three.ws/blob/main/api/_lib/sketchfab.js).
---
-<a id="sec-197"></a>
+<a id="sec-242"></a>
> **Source:** `docs/skills.md` · [↑ table of contents](#table-of-contents)
@@ -44420,7 +50757,7 @@ These skills come pre-installed in every agent. They live in `src/agent-skills.j
| `sign-action` | Sign the current action with the connected wallet |
| `help` | List available skills and commands |
-Built-in skills that are `mcpExposed: true` are also surfaced as MCP tools via `/api/mcp` — external tools can invoke them by name as `skill_<name>` (hyphens converted to underscores).
+Built-in skills that are `mcpExposed: true` are also published in the platform's skills catalog (`GET /api/chat-skills`) as callable tools named `skill_<name>` (hyphens and dots converted to underscores, e.g. `present-model` becomes `skill_present_model`). The catalog is what the platform chat runtime and external tool consumers read to discover them.
---
@@ -44433,22 +50770,24 @@ Reference skills by URI in the agent's `manifest.json`. The runtime fetches and
```json
{
"skills": [
- { "uri": "https://cdn.three.ws/skills/wave/", "version": "0.1.0" },
+ { "uri": "https://your-site.com/skills/wave/", "version": "0.1.0" },
{ "uri": "ipfs://bafy.../validate-model/", "version": "^1.0.0" }
]
}
```
-URIs can be HTTPS, IPFS (`ipfs://`), or Arweave (`ar://`). IPFS URIs are resolved through a gateway fallback chain (ipfs.io → dweb.link → nft.storage).
+The URI points at any host serving the four-file bundle. The repo ships a copyable starter at `examples/skills/wave/` (the same bundle Coach Leo's manifest references); host it on your own site or pin it to IPFS and reference that URI.
+
+URIs can be HTTPS, IPFS (`ipfs://`), or Arweave (`ar://`). IPFS URIs are resolved through a gateway fallback chain (dweb.link → ipfs.io → flk-ipfs.xyz, see `src/ipfs.js`).
### Via the web component attribute
-Pass a JSON array to the `skills` attribute:
+Pass one or more bundle URIs, comma separated (`src/element.js` splits on commas; versions cannot be pinned through the attribute, use the manifest for that):
```html
<agent-3d
agent-id="my-agent"
- skills='[{"uri":"https://cdn.three.ws/skills/wave/","version":"0.1.0"}]'
+ skills="https://your-site.com/skills/wave/,https://your-site.com/skills/tip-jar/"
></agent-3d>
```
@@ -44456,7 +50795,10 @@ Pass a JSON array to the `skills` attribute:
```js
const el = document.querySelector('agent-3d');
-await el.agent.skills.install({ uri: 'https://example.com/skills/weather/' });
+await el.installSkill('https://example.com/skills/weather/');
+
+// List what is installed (built-in + installed skill definitions)
+console.log(el.skills);
```
---
@@ -44484,7 +50826,7 @@ await el.agent.skills.install({ uri: 'https://example.com/skills/weather/' });
// Skill dependencies — installed recursively before this skill
"dependencies": {
- "https://cdn.three.ws/skills/gesture-base/": "^1.0.0"
+ "https://your-site.com/skills/gesture-base/": "^1.0.0"
},
// What this skill adds to the agent
@@ -44759,8 +51101,8 @@ Skills can depend on other skills. The registry installs dependencies recursivel
"name": "full-coaching-kit",
"version": "1.0.0",
"dependencies": {
- "https://cdn.three.ws/skills/wave/": "^0.1.0",
- "https://cdn.three.ws/skills/validate-model/": "^1.0.0"
+ "https://your-site.com/skills/wave/": "^0.1.0",
+ "https://your-site.com/skills/validate-model/": "^1.0.0"
},
"provides": { "tools": [] }
}
@@ -44772,27 +51114,30 @@ The `dependencies` object maps skill URIs to version ranges. Circular dependenci
## Skill lifecycle events
-The agent protocol bus fires events at each stage of skill execution. Listen to these in the host page to react to skill activity:
+The agent protocol bus fires events at each stage of skill execution. Subscribe on the bus to react to skill activity:
```js
-const el = document.querySelector('agent-3d');
+import { protocol } from './src/agent-protocol.js';
+// In the three.ws app itself the same singleton is window.VIEWER.agent_protocol.
// Fires when the runtime dispatches a tool call to a skill handler
-el.addEventListener('perform-skill', e => {
- console.log('Skill starting:', e.detail.skill, e.detail.args);
+protocol.on('perform-skill', (action) => {
+ console.log('Skill starting:', action.payload.skill, action.payload.args);
});
// Fires when the handler returns successfully
-el.addEventListener('skill-done', e => {
- console.log('Skill done:', e.detail.skill, e.detail.result);
+protocol.on('skill-done', (action) => {
+ console.log('Skill done:', action.payload.skill, action.payload.result);
});
// Fires when the handler throws or times out
-el.addEventListener('skill-error', e => {
- console.error('Skill error:', e.detail.skill, e.detail.error);
+protocol.on('skill-error', (action) => {
+ console.error('Skill error:', action.payload.skill, action.payload.error);
});
```
+Host pages embedding `<agent-3d>` also get DOM `CustomEvent`s re-dispatched on the element for runtime activity: `skill:tool-start` and `skill:tool-called` (plus `brain:*`, `voice:*`, and `memory:write`). Listen with `el.addEventListener('skill:tool-called', handler)` when you only need tool-call notifications.
+
**Event payloads:**
| Event | `detail` shape |
@@ -44807,24 +51152,29 @@ el.addEventListener('skill-error', e => {
## Calling skills programmatically
+In the three.ws app, the built-in skills executor is exposed as `window.VIEWER.agent_skills` (an `AgentSkills` instance from `src/agent-skills.js`):
+
```js
-const el = document.querySelector('agent-3d');
+const skills = window.VIEWER.agent_skills;
-// Execute a skill tool directly, bypassing the LLM
-const result = await el.agent.skills.perform('wave', { style: 'enthusiastic' });
-console.log(result); // { ok: true, style: 'enthusiastic' }
+// Execute a skill directly, bypassing the LLM
+const result = await skills.perform('greet', { name: 'Alex' });
+console.log(result); // { success: true, output: '...', sentiment: ... }
-// List all installed skills (built-in + installed)
-const skills = el.agent.skills.list();
+// List all registered skills
+skills.list();
// Get a specific skill definition
-const waveDef = el.agent.skills.get('wave');
+const greetDef = skills.get('greet');
```
-For external skills installed via `SkillRegistry`, invoke via the registry:
+For external skills installed via `SkillRegistry` (`src/skills/index.js`), invoke through the registry:
```js
-const skill = el.agentRuntime.skillRegistry.findSkillForTool('get_weather');
+const registry = new SkillRegistry({ trust: 'owned-only', ownerAddress });
+await registry.install({ uri: 'https://example.com/skills/weather/' });
+
+const skill = registry.findSkillForTool('get_weather');
const result = await skill.invoke('get_weather', { city: 'Berlin' }, ctx);
```
@@ -44870,8 +51220,11 @@ skill is live — LLM can now call its tools
## Worked example: the `wave` skill
The `wave` skill is the minimal complete example — small enough to reproduce here
-in full. Create it at `examples/skills/wave/`; every file the bundle needs is
-listed below.
+in full. Create it as a `wave/` directory anywhere you serve static files; every
+file the bundle needs is listed below. For real, installable bundles that ship
+with the repo, see [examples/skills/](../examples/skills/) (`pump-fun`,
+`solana-wallet`, and friends) and [public/skills/](../public/skills/)
+(`tip-jar`, `crypto-price`, `dca`).
### `manifest.json`
@@ -45031,7 +51384,8 @@ A skill is just a directory of static files. Publish it anywhere:
- **GitHub Releases** — attach a zip, reference the raw URL
- **Vercel / Netlify / S3** — deploy the directory as a static site
- **IPFS** — `ipfs add -r skills/wave/` and distribute the CID
-- **npm** — include the bundle under `public/skills/skill-name/` and reference via a CDN like jsDelivr
+- **The platform itself**: first-party bundles live under `public/skills/<name>/` in this repo (e.g. `public/skills/tip-jar/`) and are served at `https://three.ws/skills/<name>/`
+- **npm**: publish the directory as a package and reference it via a CDN like jsDelivr
**Convention:** name the manifest `manifest.json` and co-locate `handlers.js` in the same directory. Agents resolve all relative paths (`./clips/`, `./prompts/`) against the manifest's URL, so the layout must be preserved.
@@ -45069,7 +51423,7 @@ For IPFS publishing, the CID of the directory becomes the stable URI. Agents can
---
-<a id="sec-198"></a>
+<a id="sec-243"></a>
> **Source:** `docs/smart-contracts.md` · [↑ table of contents](#table-of-contents)
@@ -45093,7 +51447,9 @@ Contracts are deployed at the same address on every supported EVM chain, using C
### Mainnet
-Chains: Ethereum (1), Optimism (10), BSC (56), Gnosis (100), Polygon (137), Fantom (250), zkSync Era (324), Moonbeam (1284), Mantle (5000), Base (8453), Arbitrum One (42161), Celo (42220), Avalanche (43114), Linea (59144), Scroll (534352).
+Chains with confirmed bytecode: Ethereum (1), Optimism (10), BSC (56), Gnosis (100), Polygon (137), Mantle (5000), Base (8453), Arbitrum One (42161), Celo (42220), Avalanche (43114), Linea (59144), Scroll (534352).
+
+Fantom (250), zkSync Era (324), and Moonbeam (1284) are listed in `REGISTRY_DEPLOYMENTS` for address parity but have **no contract code yet** (an `eth_getCode` sweep on 2026-06-19 returned empty on all three; zkSync Era additionally derives CREATE2 addresses differently, so the canonical address is unreachable there without a chain-specific deploy). Writes on those chains revert until the registries are deployed. See [`contracts/DEPLOYMENTS.md`](../contracts/DEPLOYMENTS.md) for the authoritative per-chain status.
| Contract | Address |
|---|---|
@@ -45351,7 +51707,7 @@ await tx2.wait();
## ReputationRegistry
-`ReputationRegistry` stores signed feedback about registered agents. Scores are integers in the range `[-100, 100]` — negative scores indicate poor experiences, positive scores indicate good ones. Each `(reviewer, agentId)` pair can only submit once; there is no update path. Agent owners cannot review their own agents.
+`ReputationRegistry` stores signed feedback about registered agents. Scores are integers in the range `[-100, 100]`: negative scores indicate poor experiences, positive scores indicate good ones. Each `(reviewer, agentId)` pair can only submit once; there is no update path. Agent owners cannot review their own agents. Alongside plain feedback, the contract also exposes an ETH-staked variant (`stakeReputation(uint256 agentId, uint8 score, string comment)` payable, refundable via `withdrawStake(uint256 agentId)`); `submitFeedback` is the path documented here.
The registry holds a reference to `IdentityRegistry` — submitting feedback for an unregistered agentId reverts with `UnknownAgent`.
@@ -45615,17 +51971,19 @@ export BASESCAN_API_KEY=your_key
export DEPLOYER_PK=0xYourPrivateKey
# Dry run first (no --broadcast)
-forge script script/Deploy.s.sol --rpc-url base_sepolia
+forge script script/Deploy.s.sol --rpc-url base_sepolia --private-key "$DEPLOYER_PK"
# Deploy to Base Sepolia and verify on Basescan
forge script script/Deploy.s.sol \
--rpc-url base_sepolia \
+ --private-key "$DEPLOYER_PK" \
--broadcast \
--verify
# Deploy to Base mainnet
forge script script/Deploy.s.sol \
--rpc-url base \
+ --private-key "$DEPLOYER_PK" \
--broadcast \
--verify
```
@@ -45662,12 +52020,356 @@ On Base at typical gas prices (~0.001 gwei base fee), an agent registration runs
---
-<a id="sec-199"></a>
+## Related
+
+- [ERC-8004 guide](/docs/erc8004) - the higher-level walkthrough of registering three.ws identities on-chain.
+- [Reputation system](/docs/reputation) - how feedback scores surface in the product.
+- [Validation attestations](/docs/validation) - the off-chain validation flow that writes to `ValidationRegistry`.
+- [Register on-chain tutorial](/docs/tutorials/register-onchain) - step-by-step registration from the UI and SDK.
+
+---
+
+<a id="sec-244"></a>
+
+> **Source:** `docs/smart-money.md` · [↑ table of contents](#table-of-contents)
+
+# Smart Money Radar: follow the wallets that actually win
+
+Smart Money Radar is a live, first-party reputation graph of every pump.fun wallet. It crosses each coin's buyers with which coins actually graduated, folds the result into a per-wallet track record, and surfaces two things you cannot get from a price chart: which wallets keep picking winners, and what that proven money is buying right now. Every number is earned from on-chain outcomes, not a hand-curated allowlist.
+
+Page: [/smart-money](https://three.ws/smart-money)
+
+API: `/api/pump/smart-money` (feed, leaderboard, per-coin, per-wallet). The coin drawer also reads `/api/oracle/coin` for conviction context.
+
+## Why it exists
+
+The single most predictive early signal on pump.fun is not the chart, it is who is buying. A wallet that has repeatedly entered coins that went on to graduate is worth watching; a wallet that dumps every launch it touches is worth avoiding. That information exists on chain, but nobody keeps a running scorecard in time. Smart Money Radar is that scorecard. It re-earns every wallet's reputation continuously from real outcomes, so a coin's "pedigree" is the buy-weighted track record of the wallets actually in it, and a wallet's rank is its own history of picking coins that graduated. This is the same proven-wallet ledger the WHO pillar of [Oracle](./oracle.md) draws on, exposed as its own browsable surface.
+
+## How it works
+
+The page is a self-contained module inside `pages/smart-money.html` that polls `/api/pump/smart-money` every 20 seconds (paused when the tab is hidden). It has three tabs: **Smart money is buying** (the coin feed), **Top wallets** (the leaderboard), and **Watchlist** (a local list of up to 200 mints in `localStorage`).
+
+The numbers are produced by a cron rollup (`api/cron/smart-money-rollup.js`) in three phases that write to `wallet_reputation`, `coin_smart_money`, and a `smart_money_scored` dedupe ledger:
+
+**Phase A: judge and fold.** Six hours after launch, a coin's outcome is binary: present in `pumpfun_graduations` is a win, otherwise a dud. For the top 60 buyers of each judged coin, per-wallet deltas are folded into `wallet_reputation`. An entry counts as **early** when the wallet's first buy is within 180 seconds of the coin's first trade, and a **dump** when the wallet sold at least half of what it bought.
+
+**Phase B: recompute reputation.** For each touched wallet the score is:
+
+```
+win_rate = round(wins / (wins + duds) * 100, 1) # percent, 0-100
+early_win_rate = round(early_wins / early_entries * 100, 1) # percent, 0-100
+dump_rate = round(dumps / (wins + duds) * 100, 1) # percent, 0-100
+confidence = clamp(judged / 12, 0, 1) # full confidence at 12 judged coins
+earlyBonus = clamp((early_win_rate - win_rate) * 0.4, 0, 20)
+dumpPenalty = dump_rate * 0.4
+smart_money_score = round(clamp(win_rate + earlyBonus - dumpPenalty, 0, 100) * confidence, 1)
+```
+
+The label follows from the profile: a creator with 3 or more launches, zero graduations, and at least 3 coins traded is a `rugger`; fewer than 4 judged coins is `fresh`; a dump rate of 60 percent or more is a `dumper`; a score of 70 or more is `smart_money`; 5 or more early entries with a win rate under 25 percent is a `sniper`; everything else is `neutral`.
+
+**Phase C: score live coins.** For every coin launched in the last 3 hours, `coin_smart_money` is computed from its non-creator buyers (creators do not lend pedigree to their own coin):
+
+```
+weightedAvg = sum(reputation * buy) / sum(buy) # unknown wallets score 0, dragging it down
+networkBonus = min(smart_wallet_count, 5) * 4 # capped at +20
+smart_money_score = round(clamp(weightedAvg + networkBonus, 0, 100), 1)
+```
+
+A wallet is "proven smart money" at reputation 70 or more. The card's smart-money **share** is proven buy volume over total buy volume. The top 8 wallets by score become the coin's `notable` roster, each re-resolved to its live label so the display never goes stale.
+
+## Walkthrough
+
+1. Open [/smart-money](https://three.ws/smart-money). The hero shows live totals: proven wallets, proven win rate, tracked capital, coins on radar, and last-updated.
+2. Stay on **Smart money is buying**. Filter by `On radar (fresh)`, `Graduated`, or `All`, and sort by pedigree, smart-money share, smart buy volume, proven wallets in, or freshest. Each card shows the pedigree badge, the share bar, and up to four notable wallet labels.
+3. Click a coin to open its drawer: the full notable roster, and an Oracle conviction slot fetched separately from `/api/oracle/coin`.
+4. Switch to **Top wallets**. Filter by label (`smart_money`, `sniper`, `dumper`, or all), or paste a wallet address to jump straight to it. The sortable table shows win rate, early-win rate, dump rate, record, volume, and score.
+5. Click any wallet to see its recent coins and cross-navigate back to a coin it bought. Star coins to your Watchlist to track them locally.
+
+## Examples
+
+Every read is public and IP rate-limited (600 requests per minute per IP).
+
+```bash
+# The live feed: coins ranked by smart-money score, graduated ones included
+curl 'https://three.ws/api/pump/smart-money?limit=100&graduated=1'
+
+# The wallet leaderboard: proven wallets with at least 4 judged coins
+curl 'https://three.ws/api/pump/smart-money?leaderboard=1&limit=100&min_coins=4'
+
+# One coin's pedigree and notable roster
+curl 'https://three.ws/api/pump/smart-money?mint=<MINT>'
+
+# One wallet's track record and recent coins
+curl 'https://three.ws/api/pump/smart-money?wallet=<WALLET>'
+```
+
+```javascript
+// Find the freshest coins where proven money already has real skin in
+const { coins } = await fetch(
+ 'https://three.ws/api/pump/smart-money?limit=100&graduated=0'
+).then((r) => r.json());
+
+const conviction = coins
+ .filter((c) => c.smart_wallet_count >= 2)
+ .sort((a, b) => b.smart_money_score - a.smart_money_score);
+
+for (const c of conviction.slice(0, 5)) {
+ console.log(c.symbol, 'pedigree', c.smart_money_score, 'proven wallets', c.smart_wallet_count);
+}
+```
+
+## States and limits
+
+- **Auth.** The read APIs are public and require no account. The rollup cron is Bearer-authenticated with `CRON_SECRET`.
+- **Rate limit.** 600 requests per minute per IP; over that returns 429.
+- **Warm-up window.** A coin is not judged until roughly 6 hours after launch, so a very fresh coin shows "not scored yet." The per-coin read deliberately returns `200 { found: false }` rather than a 404 for an unscored mint.
+- **Empty and error states.** The feed, leaderboard, and watchlist each have designed empty copy ("No proven money on a fresh coin yet," "No wallets ranked yet"). A wallet with no history returns 404 and renders "No track record yet." A failed full refresh shows a stale-data reconnecting bar with a Retry button and escalates its message after repeated failures.
+- **Two engines, one name.** This page reads `/api/pump/smart-money` (the graduation-outcome rollup). A sibling endpoint, `/api/intel/smart-money`, is a distinct funder-cluster and sybil-detection graph used by other surfaces. They answer related questions from different tables; do not conflate them.
+
+## Related
+
+- [Oracle: the conviction engine](./oracle.md) uses this proven-wallet ledger as its WHO pillar
+- [The trading surfaces](./trading-surfaces.md) map, including the Coin Intelligence cross-coin trader board
+- [Coin Radar](./radar.md) and [Mission Control](./terminal.md) surface the same pedigree read inline
+- Pages: [/smart-money](https://three.ws/smart-money) · [/radar](https://three.ws/radar) · [/oracle](https://three.ws/oracle)
+
+---
+
+<a id="sec-245"></a>
+
+> **Source:** `docs/social-layer.md` · [↑ table of contents](#table-of-contents)
+
+# The social layer: feed, follows, notifications, rankings, portfolios
+
+Shipped in July 2026, the social layer connects every creation surface on
+three.ws (forge, dioramas, agents, coin launches, walking) into one graph:
+you follow creators, their work shows up in your feed, milestones ring your
+notification bell, and everyone's output rolls up into portfolios and a
+cross-surface leaderboard. This page maps the whole layer: the pages, the
+APIs, and how the pieces feed each other.
+
+There is no separate "social events" database to drift out of sync. The feed,
+portfolios, rankings, and search all read from the same records the rest of
+the platform already writes (`forge_creations`, `dioramas`, `pump_agent_mints`,
+`user_follows`, `walk_metrics`).
+
+| Piece | Page | API |
+|---|---|---|
+| Activity feed | [/feed](https://three.ws/feed), [/community](https://three.ws/community) | `GET /api/users/me/feed` |
+| Follow graph | Follow buttons on `/u/:username` | `GET|POST|DELETE /api/users/:username/follow` |
+| Notification bell | Bell in the header, preferences in `/dashboard/settings` | `GET /api/notifications` + `/preferences` |
+| Leaderboard, streaks, badges | [/rankings](https://three.ws/rankings) | `GET /api/leaderboard/unified` |
+| Creator portfolio | `/u/:username` | `GET /api/users/:username/creations` |
+| Cross-entity search | [/search](https://three.ws/search) | `GET /api/search` |
+| Onboarding tour | [/start](https://three.ws/start) | `GET /api/me` (`show_onboarding_tour`) |
+
+How they interconnect:
+
+- **Follow feeds everything.** A new follow edge fires a bell notification for
+ the followed user, unlocks the `scope=following` feed for the follower,
+ boosts the followed creator in search ranking, and counts toward the
+ `followers` leaderboard metric.
+- **Every feed item links to a portfolio.** Feed cards deep-link to
+ `/u/:username`, where the same records render as that creator's portfolio.
+- **Creating anything advances your streak.** Forging a model, saving a world,
+ or walking while signed in calls the streak engine, which in turn awards the
+ badges shown on `/rankings` and your profile.
+
+---
+
+## Activity feed: `/feed` and `/community`
+
+`/feed` is your personal feed (accounts you follow). `/community` leads with
+the same API in platform-wide mode, so it doubles as the feed for first-time
+visitors with no follows yet.
+
+```
+GET /api/users/me/feed?scope=following|all&limit=30&before=<iso>
+```
+
+- `scope=following` (default) needs a session; anonymous callers get a 401 so
+ the client can route to sign-in.
+- `scope=all` is public: platform-wide recent activity.
+- `limit` is 1..50 (default 30); `before` is an ISO-timestamp cursor (pass the
+ last item's `created_at` back for infinite scroll).
+
+Every item is
+`{ kind, id, created_at, actor, title, subtitle?, href, image?, external?, isRemix? }`
+where `actor` is `{ username, display_name, avatar_url }`. Items of
+`kind: "follow"` additionally carry a `target` shaped like `actor`.
+`actor.username` is `null` for creations made while signed out; the client
+renders those without a profile link rather than inventing one.
+
+Item kinds: avatar, agent, coin, model, and world creations, plus `follow`
+events. They are merged live from `forge_creations`, `dioramas`, and
+`user_follows` at read time.
+
+> Source: [api/users/me/feed.js](../api/users/me/feed.js). Not to be confused
+> with `GET /api/feed`, the public Money Pulse ticker backed by Redis; see
+> [Money Feed](./money-feed.md) for that one.
+
+## Follow graph
+
+The social-graph edge behind everything above.
+
+```
+GET /api/users/:username/follow → { following, followed_by, followers_count, following_count }
+POST /api/users/:username/follow → follow (idempotent)
+DELETE /api/users/:username/follow → unfollow (idempotent)
+```
+
+- `following` = does the signed-in viewer follow this user; `followed_by` =
+ do they follow the viewer back. Both `false` for anonymous viewers; the GET
+ is never cached (viewer-specific).
+- POST/DELETE require a session + CSRF token, return the same envelope as GET
+ (one round-trip updates the button and the counts), block self-follows
+ (400), and 401 for anonymous callers.
+- A genuinely new edge (insert with `ON CONFLICT DO NOTHING`) publishes a
+ `follow` user event, so the followed user's bell rings exactly once no
+ matter how many times the button is clicked.
+
+```
+GET /api/users/:username/follows?type=followers|following&limit=50&offset=0
+```
+
+Lists either side of the graph (limit 1..100); each row carries
+`is_following` so the client can render its own follow-back buttons.
+
+> Source: [api/users/[username]/follow.js](../api/users/%5Busername%5D/follow.js),
+> [api/users/[username]/follows.js](../api/users/%5Busername%5D/follows.js),
+> table `user_follows`. Tests: [tests/api/users-follow.test.js](../tests/api/users-follow.test.js).
+
+## Notification bell
+
+The header bell is an inbox over `user_notifications`, fed by the per-user
+event vocabulary in [api/_lib/feed.js](../api/_lib/feed.js)
+(`USER_EVENT_TYPES` → `publishUserEvent()` → `insertNotification`). Recent
+additions to the vocabulary:
+
+| Event | Fired from |
+|---|---|
+| `remix` (someone remixed your model) | [api/x402/remix-asset.js](../api/x402/remix-asset.js) |
+| `dm_received` | [api/friends/messages.js](../api/friends/messages.js) |
+| `pump_launch_filled` (your coin graduated its bonding curve) | the pump cron in [api/cron/[name].js](../api/cron/%5Bname%5D.js) |
+| `follow` | the follow endpoint above |
+
+Endpoints:
+
+```
+GET /api/notifications?limit=… → the inbox, newest first
+POST /api/notifications/:id/read → mark one read
+POST /api/notifications/read-all → mark everything read
+POST /api/notifications/track → delivery/click tracking
+GET /api/notifications/preferences → the preference matrix
+PATCH /api/notifications/preferences → update it
+```
+
+Preferences are a category × channel matrix
+([api/_lib/notify-prefs.js](../api/_lib/notify-prefs.js)): categories are
+sales, purchases, social, IRL, market, and account; channels are `in_app`,
+`push`, `email`, and `telegram`. The in-app channel is always on (the bell
+never goes silent); the other channels are per-category opt-outs, edited from
+the Notifications panel in `/dashboard/settings`
+([src/dashboard-next/pages/settings.js](../src/dashboard-next/pages/settings.js)).
+Bell client: [src/notifications.js](../src/notifications.js).
+
+## Leaderboard, streaks, and badges: `/rankings`
+
+One leaderboard across every surface, plus daily streaks and badges.
+
+```
+GET /api/leaderboard/unified?metric=creations&limit=50&offset=0
+```
+
+`metric` is one of `creations`, `remixes_received`, `launches`, `followers`,
+`walk_distance` (limit 1..100, default 50). Sending the request with a session
+or Bearer token pins your own row into the response even when you are outside
+the page window.
+
+The streak engine ([api/_lib/streaks.js](../api/_lib/streaks.js),
+`recordDailyActivity()`) is called from sign-in, forge saves, diorama saves,
+and walk metrics, and writes `user_streaks` / `user_badges`. A daily rollup
+cron ([api/cron/leaderboard-rollup.js](../api/cron/leaderboard-rollup.js))
+sweeps badge awards. Badges and streaks also render on profile pages.
+
+> Page: [pages/rankings.html](../pages/rankings.html).
+> Source: [api/leaderboard/unified.js](../api/leaderboard/unified.js).
+
+## Creator portfolio: `/u/:username`
+
+Every forge model and saved world a creator makes while signed in is
+attributed to them at create time (`user_id` on `forge_creations` and
+`dioramas`) and aggregates onto their public profile.
+
+```
+GET /api/users/:username → public profile
+GET /api/users/:username/creations → cursor-paginated portfolio items
+```
+
+Attribution links point back here from the diorama viewer and gallery and
+from the forge result bar, so any model you encounter on the platform is one
+click from the person who made it.
+
+> Page: [pages/profile.html](../pages/profile.html) (also serves `/profile`
+> for self-view; signed-out visitors get a claim-your-handle CTA, not a
+> sign-in wall). Source: [api/users/[username].js](../api/users/%5Busername%5D.js),
+> [api/users/[username]/creations.js](../api/users/%5Busername%5D/creations.js).
+
+## Cross-entity search: `/search`
+
+One query across everything creatable on the platform.
+
+```
+GET /api/search?q=<text>&type=all|avatar|agent|model|world|coin&limit=18
+```
+
+Five sources are queried in parallel
+([api/_lib/cross-search.js](../api/_lib/cross-search.js)): avatars, on-chain
+and Solana agents, forged models, worlds, and coins (platform launches first,
+then external token search). Ranking is recency first, boosted by follower,
+remix, and view signals. `limit` is 4..48 (default 18); a scoped `type` search
+gives the full limit to that one source.
+
+Model results carry a `remix` block wired to `POST /api/x402/remix-asset`;
+other types deliberately do not get a fake Remix button.
+
+> Page: [pages/search.html](../pages/search.html), client
+> [src/search-page.js](../src/search-page.js). Source: [api/search.js](../api/search.js).
+
+## Onboarding tour: `/start`
+
+A self-referential guided tour that chains the platform's own surfaces:
+selfie-to-avatar → build a world → markets → create an agent (skippable) →
+your profile. The curriculum lives in
+[public/tour/curriculum.json](../public/tour/curriculum.json) (built by
+[scripts/build-tour.mjs](../scripts/build-tour.mjs)); the engine is
+[src/feature-tour/](../src/feature-tour/).
+
+First-visit targeting: `GET /api/me` returns `show_onboarding_tour`, backed by
+`users.onboarding_tour_seen_at` / `onboarding_tour_completed_at`. The tour can
+be replayed any time from the getting-started page.
+
+---
+
+## Related pages
+
+- [Money Feed](./money-feed.md): the value-movement ticker (`GET /api/feed`),
+ a different feed from the activity feed documented here.
+- [Remix economy](./remix.md): what happens after someone finds your model in
+ the feed or search.
+- [API reference: Social & Community](./api-reference.md#social--community-api)
+ for the full request/response contracts.
+
+---
+
+<a id="sec-246"></a>
> **Source:** `docs/solana-pumpfun.md` · [↑ table of contents](#table-of-contents)
# Pump.fun integration for Solana agents
+Pump.fun is a Solana token launchpad, and three.ws agents can watch it live: an agent avatar reacts (speaks, gestures, emotes) as claims and token graduations happen, and the same activity feeds each agent's trust score. If you just want to see it, add the `pumpfun-feed` widget to an agent in Studio; this page documents the plumbing behind it for developers.
+
This integrates the upstream [`pumpfun-claims-bot`](https://github.com/nirholas/pumpfun-claims-bot) MCP server into the three.ws platform so a Solana agent can:
- Observe live pump.fun activity (GitHub social-fee claims, token graduations)
@@ -45752,12 +52454,15 @@ All registered through `registerPumpFunWatchSkills` in [src/agent-skills.js](../
### Reaction map (watch-start)
-| Event | Empathy Layer trigger | Speech sentiment |
-|---|---|---|
-| `first_time_claim` | `celebration` 0.9 | +0.7 |
-| `fake_claim` | `concern` 0.7 | -0.5 |
-| `tier ∈ {influencer, mega}` | `curiosity` 0.5 | +0.2 |
-| `graduation` | gesture: `wave` (1.5s) | +0.6 |
+Reactions are computed by the shared dispatcher in [src/widgets/pumpfun-reactions.js](../src/widgets/pumpfun-reactions.js): each event is first distilled into a signal envelope (tier, market-cap multiple, dev track record, GitHub legitimacy, whale status), then mapped to a prioritized variant with an emote trigger, a gesture clip, and a spoken line. Representative variants:
+
+| Variant | Trigger | Empathy Layer emote | Gesture | Speech sentiment |
+|---|---|---|---|---|
+| `graduation_standard` | any graduation | `celebration` 0.9 (up to 1.0 for moonshots) | celebrate clip | +0.7 to +0.95 |
+| `claim_first_verified` | first claim, verified GitHub | `celebration` 1.0 | `thriller` (6s) | +0.85 |
+| `claim_first_raw` | first claim, no GitHub link | `celebration` 0.85 | `celebrate` (4.5s) | +0.7 |
+| `claim_fake` | fake claim detected | `concern` 0.85 | `shake` (1.8s) | -0.6 |
+| `claim_tier_mega` / `_influencer` | repeat claim by tier | `celebration` 0.7 / `curiosity` 0.55 | short taunt/reaction | +0.5 / +0.3 |
These are continuous-blend stimuli, not discrete states — they decay according to the per-second rates in [agent-system.md](agent-system.md#5-the-avatar-emotion-system-empathy-layer).
@@ -45820,7 +52525,7 @@ Studio config schema (validated in `widget-types.js`):
## What's intentionally not included
- **Long-lived SSE** — the feed handler runs a 90s bounded loop and lets the browser auto-reconnect; the Cloud Run request handlers aren't meant to hold a connection open indefinitely. For higher throughput, deploy the bot itself as a streaming service.
-- **On-chain signal attestations** — signals are off-chain only. Promoting them to SPL Memo attestations signed by a platform key is a future step (see [docs/solana.md](solana.md) "What's intentionally not on Solana yet").
+- **On-chain signal attestations**: pump.fun signals are off-chain rows only. The platform's SPL Memo attestation layer exists (see [Solana reputation](solana-reputation.md)), but these crawled signals are not promoted into it; that remains a future step.
- **Agent-as-signer** — the watch skills are read-only; they never sign transactions. The existing `pumpfun-create / -buy / -sell` skills cover signing flows.
- **Anchor program for reputation** — still EVM-only on the on-chain path.
@@ -45836,7 +52541,15 @@ The MCP client and cron crawler are unit-tested with mocked `fetch` and `sql`. E
---
-<a id="sec-200"></a>
+## Related
+
+- [Solana agents](/docs/solana): the identity NFTs these signals attach to
+- [Agent Reputation on Solana](/docs/solana-reputation): how signals roll into the trust score
+- [Mint mark ("3ws")](/docs/mint-mark): branding for coins launched through three.ws
+
+---
+
+<a id="sec-247"></a>
> **Source:** `docs/solana-reputation.md` · [↑ table of contents](#table-of-contents)
@@ -45844,6 +52557,8 @@ The MCP client and cron crawler are unit-tested with mocked `fetch` and `sql`. E
How three.ws gives a Solana agent a verifiable, portable trust record — and why it takes two systems, not one.
+In plain terms: reputation is how anyone (a person or another AI agent) can check whether a Solana agent is trustworthy before paying or hiring it. You can see any agent's trust grade right now in the [Agent Passport](/agent-passport.html), and query the same data over the API described below. This page explains where those numbers come from and how to write your own on-chain vouch.
+
This is the Solana companion to [Agent Reputation](./agent-reputation.md) (the why) and [ERC-8004](./erc8004.md) / [Reputation System](./reputation.md) (the EVM how-to). If you haven't read those, start with [Agent Reputation](./agent-reputation.md) for the trust problem reputation solves. This page covers how that same problem is solved on Solana, where there is no canonical on-chain reputation registry to inherit.
---
@@ -45886,7 +52601,7 @@ There's no custom contract — a vouch is an **SPL Memo** transaction. The revie
Cost is a single Solana fee (~$0.0000+); the optional stake is real SOL that goes to the agent owner. The Passport's rate panel enforces a **double-review guard** — rating the same agent twice from one wallet updates that wallet's score rather than adding a second vote.
-### The seven attestation kinds
+### The eight attestation kinds
Every memo is one of these (`api/_lib/solana-attestations.js`):
@@ -45899,13 +52614,14 @@ Every memo is one of these (`api/_lib/solana-attestations.js`):
| `threews.accept.v1` | The agent owner accepted/acknowledged a task — used to *verify* feedback |
| `threews.dispute.v1` | The owner disputed an attestation against them |
| `threews.revoke.v1` | An attester withdrew their own attestation |
+| `threews.review.v1` | A 1-5 rating tied to a specific `review_id` (structured marketplace-style review) |
### How attestations become reputation
The raw memos are trustless and re-derivable by anyone. three.ws runs an indexer so reads are fast:
```
-on-chain memo → crawler (cron: every 5 min) → solana_attestations table → reputation API → Passport trust grade
+on-chain memo → crawler (cron: every 10 min) → solana_attestations table → reputation API → Passport trust grade
```
The crawler (`crawlAgentAttestations`) calls `getSignaturesForAddress(asset)` from a saved cursor, fetches the transactions, extracts and **validates** each memo against its schema, computes a `verified` flag, and upserts it. Revocations and disputes flip flags on the rows they target. The `verified` rule is where Sybil resistance starts:
@@ -45974,7 +52690,7 @@ The SDK (`solana-agent-sdk`) exposes the write side: `registerAgenCAgent`, `crea
## One agent, two chains: the identity bridge
-A single three.ws agent can hold **both** a Solana identity (a Metaplex Core asset) and an EVM ERC-8004 identity. The bridge (`solana-agent-sdk/.../identity-bridge.ts`) folds external identities into AgenC's 32-byte `agentId` space with namespaced SHA-256:
+A single three.ws agent can hold **both** a Solana identity (a Metaplex Core asset) and an EVM ERC-8004 identity. The bridge ([solana-agent-sdk/src/actions/agenc/identity-bridge.ts](../solana-agent-sdk/src/actions/agenc/identity-bridge.ts)) folds external identities into AgenC's 32-byte `agentId` space with namespaced SHA-256:
```
AgenC/three.ws/erc8004/v1 + erc8004AgentId → agentId
@@ -46016,7 +52732,7 @@ The shapes differ; the purpose is identical — let an agent decide, before it p
## Status
-- **Attestation reputation / Passport** — **live.** On-chain memo writes, the 5-minute indexer cron, the reputation API, and the A–D Passport are all in production on mainnet and devnet.
+- **Attestation reputation / Passport**: **live.** On-chain memo writes, the 10-minute indexer cron (`/api/cron/solana-attestations-crawl`), the reputation API, and the A-D Passport are all in production on mainnet and devnet.
- **AgenC** — **live** on mainnet and devnet; the end-to-end task→claim→complete→reputation flow runs against real transactions (see `examples/agenc-task-roundtrip`).
- **Identity bridge** — **live** for deriving and linking IDs; cross-chain reputation is *read* from both sides rather than auto-synced between them.
- **Solana `glb-schema` validation** — rides on `threews.validation.v1`, mirroring the EVM ValidationRegistry attestation.
@@ -46032,13 +52748,15 @@ The shapes differ; the purpose is identical — let an agent decide, before it p
---
-<a id="sec-201"></a>
+<a id="sec-248"></a>
> **Source:** `docs/solana.md` · [↑ table of contents](#table-of-contents)
# Solana Agents
-Register an agent on Solana as a Metaplex Core NFT. The flow mirrors the [ERC-8004](erc8004.md) path on EVM chains: a user's wallet signs a transaction that mints an on-chain identity token, and the platform stores the link between the agent record and the mint address.
+Give your three.ws agent a real on-chain identity on Solana. When you register, your wallet signs one transaction that mints an NFT (a Metaplex Core asset) representing the agent, and three.ws links that mint to your agent record. You do this from the agent creation and edit pages after connecting a Solana wallet (Phantom, Solflare, or Backpack).
+
+Technically, the flow mirrors the [ERC-8004](erc8004.md) path on EVM chains: a user's wallet signs a transaction that mints an on-chain identity token, and the platform stores the link between the agent record and the mint address.
This document covers what is supported today, the end-to-end registration flow, and what is intentionally **not** on Solana yet.
@@ -46055,15 +52773,16 @@ This document covers what is supported today, the end-to-end registration flow,
| 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/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) |
-| Discovery file lists Solana agents | **Not yet** | [public/.well-known/agent-registration.json](../public/.well-known/agent-registration.json) is EVM-only |
+| On-chain reputation (SPL Memo attestations) | Live | [api/_lib/solana-attestations.js](../api/_lib/solana-attestations.js), aggregated by `/api/agents/solana-reputation` (see [Solana reputation](solana-reputation.md)) |
+| On-chain validation (glTF/schema attestation) | Live | [api/_lib/solana-validation-attest.js](../api/_lib/solana-validation-attest.js), auto-run at register-confirm |
+| Credentialed attestations (SAS) | Live | [api/agents/sas/\[action\].js](../api/agents/sas/%5Baction%5D.js) (see [SAS attestations](sas-attestations.md)) |
+| Discovery file lists Solana agents | **Not yet** | [public/.well-known/agent-registration.json](../public/.well-known/agent-registration.json) publishes the platform card and x402 catalog, but its `registrations` array carries no per-agent Solana entries |
---
## How identity works on Solana
-EVM agents are minted as ERC-721 NFTs in the IdentityRegistry contract at a fixed CREATE2 address. Solana has no CREATE2 and no shared registry — instead each agent is a standalone **Metaplex Core asset** (a single-account NFT standard with name + URI metadata baked in).
+EVM agents are minted as ERC-721 NFTs in the IdentityRegistry contract at a fixed CREATE2 address. Solana has no CREATE2 and no shared registry contract. Instead each agent is a **Metaplex Core asset** (a single-account NFT standard with name + URI metadata baked in). When a three.ws Agents collection is configured for the network (`SOLANA_AGENT_COLLECTION_MAINNET` / `_DEVNET`), the asset is minted into that collection with the collection authority co-signing, so three.ws can curate on-chain metadata on the owner's behalf; with no collection configured, the mint falls back to a standalone asset. See [Deploy agents on-chain (bulk)](onchain-agents.md) for the collection model.
The agent's canonical identifier on Solana is its **asset pubkey** (base58, 32-byte). The platform stores it alongside the mint transaction signature so the on-chain record can always be re-verified.
@@ -46087,7 +52806,7 @@ Agent record shape (`agent_identities.meta`):
| `mainnet` | mainnet-beta | `SOLANA_RPC_URL` env, falls back to `https://api.mainnet-beta.solana.com` |
| `devnet` | devnet | `SOLANA_RPC_URL_DEVNET` env, falls back to `https://api.devnet.solana.com` |
-Public RPCs are rate-limited. For production, set `SOLANA_RPC_URL` to a Helius, Quicknode, or Triton endpoint.
+Public RPCs are rate-limited. For production, set `SOLANA_RPC_URL` to a Helius, Quicknode, or Triton endpoint. Server-side calls do not depend on a single endpoint: [api/_lib/solana/connection.js](../api/_lib/solana/connection.js) builds a failover chain (explicit `SOLANA_RPC_URL`, then keyed providers such as Helius and Alchemy when their keys are set, then operator-supplied `SOLANA_RPC_FALLBACK_URLS`, then keyless public endpoints, with `SOLANA_RPC_LAST_RESORT_URLS` as a paid reserve tried last) and rotates past endpoints that are rate-limited or cooling down.
---
@@ -46131,9 +52850,11 @@ const prep = await fetch('/api/agents/solana-register-prep', {
name: 'My Agent', // 1–60 chars
description: 'short bio', // ≤ 280 chars
wallet_address: walletPubkey, // base58, must be linked to user
- network: 'devnet', // or 'mainnet'
+ network: 'devnet', // or 'mainnet' (the default)
avatar_id: avatarUuid, // optional — must be owned by user
metadata_uri: 'https://...', // optional — else server synthesizes one
+ asset_pubkey: vanityPubkey, // optional: client-supplied asset keypair pubkey
+ vanity_prefix: '3ws', // optional: asserts asset_pubkey starts with it
}),
}).then(r => r.json());
@@ -46143,7 +52864,8 @@ const prep = await fetch('/api/agents/solana-register-prep', {
The server:
- Verifies the wallet is linked to the session user.
- If `avatar_id` is given, verifies the user owns the avatar.
-- Builds an unsigned Metaplex Core `createV1` transaction with the user's pubkey as a `NoopSigner`. The asset (mint) keypair is generated server-side and pre-signs the transaction.
+- Builds an unsigned Metaplex Core `create` transaction with the user's pubkey as a `NoopSigner`. The asset keypair is generated server-side and pre-signs the transaction; alternatively the client supplies its own `asset_pubkey` (with an optional `vanity_prefix`, which returns `402 payment_required` for prefixes of 5+ characters on the free plan).
+- Writes an on-chain Attributes plugin (the three.ws brand block) and an enforced Royalties plugin into the asset, and mints into the three.ws Agents collection when one is configured for the network.
- Stores a 30-minute pending record so step 4 can resolve `name` / `description` / `avatar_id` from the prep payload.
The returned `tx_base64` is a fully built transaction missing only the user's signature.
@@ -46185,12 +52907,13 @@ const result = await fetch('/api/agents/solana-register-confirm', {
}),
}).then(r => r.json());
-// → {
+// → 201 {
// ok: true,
// agent: { id, name, description, wallet_address, meta, home_url, ... },
// sol_mint_address,
// tx_signature,
// network,
+// validation?: { passed, signature, proof_hash, deduped },
// }
```
@@ -46199,7 +52922,7 @@ The server re-fetches the parsed transaction from the cluster, asserts:
- `asset_pubkey` appears in the transaction's account keys,
- no agent has already been registered for this mint,
-then inserts the `agent_identities` row and clears the pending record.
+then inserts the `agent_identities` row and clears the pending record. If the agent has an avatar GLB, the server also records a best-effort on-chain glTF/schema validation attestation (`threews.validation.v1`, signed by the platform validator; see [api/_lib/solana-validation-attest.js](../api/_lib/solana-validation-attest.js)); a failure there never fails the registration.
---
@@ -46209,7 +52932,9 @@ Returned as `{ error, error_description }` from the prep / confirm endpoints.
| Status | `error` | When |
|---|---|---|
+| 400 | `validation_error` | Malformed body, non-base58 `asset_pubkey`, or `vanity_prefix` without `asset_pubkey` |
| 401 | `unauthorized` | No session |
+| 402 | `payment_required` | `vanity_prefix` of 5+ characters on a free plan |
| 403 | `forbidden` | Wallet is not linked to the session user |
| 404 | `not_found` | `avatar_id` doesn't exist or isn't owned by user |
| 422 | `tx_not_found` | RPC has not seen the signature yet — retry after a few seconds |
@@ -46217,6 +52942,7 @@ Returned as `{ error, error_description }` from the prep / confirm endpoints.
| 422 | `asset_not_in_tx` | `asset_pubkey` is not among the transaction's account keys |
| 409 | `conflict` | An agent is already registered for this mint |
| 429 | `rate_limited` | Per-IP auth limiter tripped |
+| 503 | `rpc_unavailable` | Every RPC endpoint in the failover chain failed while building the tx |
---
@@ -46224,9 +52950,12 @@ Returned as `{ error, error_description }` from the prep / confirm endpoints.
| Var | Purpose |
|---|---|
-| `SOLANA_RPC_URL` | Mainnet RPC. Defaults to public mainnet-beta. **Set this in production.** |
+| `SOLANA_RPC_URL` | Primary mainnet RPC. Defaults to public mainnet-beta. **Set this in production.** |
| `SOLANA_RPC_URL_DEVNET` | Devnet RPC. Defaults to public devnet. |
-| `APP_ORIGIN` | Used to synthesize a default `metadata_uri` if the caller didn't provide one. |
+| `SOLANA_RPC_FALLBACK_URLS` | Comma-separated extra mainnet endpoints rotated into the failover chain after the primary. |
+| `SOLANA_RPC_LAST_RESORT_URLS` | Comma-separated paid/metered endpoints tried only after every free endpoint fails. |
+| `SOLANA_AGENT_COLLECTION_MAINNET` / `_DEVNET` | Address of the three.ws Agents collection; when set, registrations mint into it. |
+| `PUBLIC_APP_ORIGIN` | Canonical origin (exposed to code as `env.APP_ORIGIN`); used to synthesize a default `metadata_uri` if the caller didn't provide one. |
SIWS-related env vars live in [api/_lib/env.js](../api/_lib/env.js) and [api/_lib/siws.js](../api/_lib/siws.js).
@@ -46244,19 +52973,31 @@ There is no global Solana registry to query — discovery happens via the platfo
---
+## What's on Solana instead of a registry contract
+
+- **Reputation**: there is no single `ReputationRegistry` contract like ERC-8004's. Instead, permissionless SPL Memo attestations (feedback, stakes, tasks, disputes) are written on-chain against the agent's asset pubkey, crawled into `solana_attestations`, and aggregated by `/api/agents/solana-reputation`. Off-chain pump.fun behavior signals land in `pumpfun_signals` and feed the same score. See [Solana reputation](solana-reputation.md) and [solana-pumpfun.md](solana-pumpfun.md).
+- **Validation**: no registry contract either; validations are `threews.validation.v1` SPL Memo attestations (including the automatic glb-schema attestation at register-confirm), plus SAS credentialed validations signed by the platform authority ([SAS attestations](sas-attestations.md)).
+
## What's intentionally not on Solana yet
-- **Reputation**: ERC-8004's `ReputationRegistry` is EVM-only. Solana agents have no on-chain feedback aggregation today. Reviews live in the platform DB. Off-chain pump.fun behavior signals are crawled into `pumpfun_signals` and surfaced through `solana-reputation` — see [solana-pumpfun.md](solana-pumpfun.md).
-- **Validation**: Same. The `ValidationRegistry` is EVM testnet only; there is no Solana analog.
- **Delegated wallet (EIP-712)**: There is no equivalent for Solana agents. Owner = the wallet that signed the mint.
-- **Cross-chain identifier**: EVM agents use `eip155:<chainId>:<registry>:<agentId>` (CAIP-10). Solana agents use the asset pubkey directly; a CAIP-10 form (`solana:<cluster-genesis>:<asset-pubkey>`) is not currently emitted by the platform.
-- **Discovery**: `agent-registration.json` is EVM-shaped. Adding Solana entries means defining a JSON schema for Metaplex Core assets — not done.
+- **Cross-chain identifier**: EVM agents use `eip155:<chainId>:<registry>:<agentId>` (CAIP-10). The user-signed flow stores the asset pubkey directly; only the bulk deploy path records a CAIP-2-style `solana:<cluster-genesis>` chain id in `meta.onchain.chain` (see [onchain-agents.md](onchain-agents.md)).
+- **Discovery**: `agent-registration.json` publishes the platform-level card and x402 catalog, but its `registrations` array does not list individual Solana agents. Adding them means defining a JSON schema for Metaplex Core assets; not done yet.
-A full ERC-8004-equivalent on Solana would mean writing three Anchor programs (Identity / Reputation / Validation) and a parallel JS client. That is a separate, larger piece of work; this document covers only what ships today.
+A full ERC-8004-equivalent on Solana (Identity / Reputation / Validation as Anchor programs with a parallel JS client) remains a separate, larger piece of work; this document covers what ships today.
---
-<a id="sec-202"></a>
+## Related
+
+- [Deploy agents on-chain (bulk)](/docs/onchain-agents): the server-side, collection-minting counterpart to this flow
+- [Agent Reputation on Solana](/docs/solana-reputation): how attestations become a trust grade
+- [SAS Credentialed Attestations](/docs/sas-attestations): authority-signed credentials
+- [ERC-8004](/docs/erc8004): the EVM identity path this flow mirrors
+
+---
+
+<a id="sec-249"></a>
> **Source:** `docs/spatial-mcp.md` · [↑ table of contents](#table-of-contents)
@@ -46360,13 +53101,13 @@ Free 3D Studio (`structuredContent.spatial`): `forge_free`, `text_to_avatar`, `m
## Related
- [`specs/SPATIAL_MCP.md`](https://github.com/nirholas/three.ws/blob/main/specs/SPATIAL_MCP.md) — the normative spec
-- [`docs/mcp-studio.md`](./mcp-studio.md) — the free 3D Studio MCP server
-- AR handoff (`ar` block) ties to the AR export path (`export_ar`, `docs/ar.md`)
-- Persona hook (`persona` block) ties to the embodiment tools (prompt 07)
+- [3D Studio MCP (free)](/docs/mcp-studio): the free 3D Studio MCP server that emits these artifacts
+- [MCP Tools Catalog](/docs/mcp-tools): which server hosts which tool, free vs. paid
+- [AR & WebXR](/docs/ar): the AR handoff the artifact's `ar` block ties into (`export_ar`)
---
-<a id="sec-203"></a>
+<a id="sec-250"></a>
> **Source:** `docs/specs/agent-trading.md` · [↑ table of contents](#table-of-contents)
@@ -46453,7 +53194,78 @@ Real routes (no mocks), server-side guards with tests (including the $THREE-sell
---
-<a id="sec-204"></a>
+<a id="sec-251"></a>
+
+> **Source:** `docs/splat.md` · [↑ table of contents](#table-of-contents)
+
+# Splat Viewer: photoreal Gaussian-splat avatars in the browser
+
+The Splat Viewer renders Gaussian-splat and radiance-field scenes right in your browser, the photoreal output of capture engines like GaussianAvatars and HumanGaussian. Load a `.ply`, `.splat`, or `.ksplat` by URL, drop a file in, or try a built-in sample, and orbit a photoreal avatar or scene with no plugin, no upload to a server, and no account. All decoding happens client-side.
+
+Page: [/splat](https://three.ws/splat)
+
+## Why it exists
+
+Mesh avatars (GLB) are lightweight, riggable, and universal, and that is what most of three.ws generates. But the photoreal frontier of avatar capture is radiance fields: Gaussian splatting reconstructs a person or a scene as millions of tiny anisotropic blobs that render with real skin, hair, and lighting no polygon budget can match. Those captures ship as `.ply`, `.splat`, or `.ksplat` files, and most tools to view them are desktop apps. The Splat Viewer is the browser front door: a place to open any splat scene, evaluate a capture engine's output, and share a photoreal avatar with a link. It complements [/avatar-engines](https://three.ws/avatar-engines), which surveys the capture methods; the viewer is where their output actually renders.
+
+## How it works
+
+The viewer (`src/splat-viewer.js`) is entirely client-side. It uses `@mkkellogg/gaussian-splats-3d`, already a platform dependency (the same library the Forge Studio Lab uses), lazy-loaded on first render so the page shell paints instantly. Format is detected from the filename extension: `.ply` maps to the PLY scene format, `.ksplat` to the compressed KSplat format, and everything else to the antimatter15 `.splat` layout (32 bytes per splat). The decoded buffer is handed to a `GS.Viewer` with built-in orbit controls, and every state is designed: idle, fetching, decoding, error, and a live HUD showing the scene label.
+
+There are three ways to load a scene:
+
+- **By URL.** Paste a link and the viewer fetches the bytes and decodes them. To survive cross-origin blocks, it rewrites the human-facing URLs of common asset hosts to their CORS-enabled raw form: GitHub `raw`/`blob` links become `raw.githubusercontent.com`, Hugging Face `/blob/` becomes `/resolve/`, and Dropbox links are forced to a direct download. When a host still blocks the browser fetch, the error state tells you to download the file and upload it instead.
+- **By file.** Pick a file or drag and drop a `.ply`/`.splat`/`.ksplat` onto the stage. The file is read locally and never leaves your machine; a download button is offered for the loaded buffer.
+- **Samples.** Two procedurally generated scenes ship in the page: a radiance shell (6,000 splats) and a synthetic head-and-shoulders bust (14,000 splats) that evokes what a real GaussianAvatars capture looks like in the viewer. These are synthetic, generated in-browser, and downloadable.
+
+A deep link, `?src=<url>&name=<label>`, loads a scene straight from the URL on page load, so a photoreal avatar is shareable with a single link. A recenter control rebuilds the viewer from the cached buffer (the most reliable camera reset across splat-lib versions), and the viewer tears down cleanly on navigation.
+
+## Walkthrough
+
+1. Open [/splat](https://three.ws/splat).
+2. Try a sample first: click the radiance shell or the head bust to see the viewer in action.
+3. Load your own scene: paste a `.ply`/`.splat`/`.ksplat` URL and click Render, or drop a file onto the stage, or pick one from disk.
+4. Orbit, zoom, and pan with the built-in controls. The HUD shows the scene label and splat count.
+5. Recenter if the camera drifts. Download the loaded buffer if you loaded a file or a sample.
+6. Share a scene by appending `?src=<url>` to the page URL.
+
+## Examples
+
+The viewer is driven by the URL, so sharing and embedding is just a link.
+
+```
+# Open a scene directly by deep link.
+https://three.ws/splat?src=https://huggingface.co/<user>/<repo>/resolve/main/avatar.ply&name=My%20Avatar
+
+# A GitHub-hosted splat: the viewer rewrites blob/raw links to the CORS raw host automatically.
+https://three.ws/splat?src=https://github.com/<user>/<repo>/blob/main/scene.splat
+```
+
+Supported inputs at a glance:
+
+- `.ply`: Gaussian-splat point cloud in PLY format.
+- `.splat`: the antimatter15 layout (32 bytes per splat).
+- `.ksplat`: the compressed KSplat format for faster loads.
+
+## States and limits
+
+- **Idle**: prompts you to load a splat, drop a file, or try a sample.
+- **Fetching / decoding**: shows the host and the buffer size in MB; large radiance fields take a moment to decode.
+- **Error**: an invalid file reports "that file isn't a valid splat"; a blocked fetch explains the CORS limit and suggests downloading then uploading; the retry loads a sample so the stage is never dead.
+- **CORS**: only hosts that send permissive cross-origin headers load by URL; the viewer auto-rewrites GitHub, Hugging Face, and Dropbox links, but other hosts may require a local upload.
+- **Client-side only**: files you upload are decoded in the browser and never sent to a server. There is no generation here; this is a viewer for captures produced elsewhere.
+- Rendering runs on WebGL; very large scenes are bounded by your device's GPU and memory.
+
+## Related
+
+- [/avatar-engines](https://three.ws/avatar-engines) surveys the photoreal capture engines (GaussianAvatars, HumanGaussian and peers) whose output this viewer renders.
+- [Avatar creation](./avatar-creation.md) and [avatar pipeline](./avatar-pipeline.md) cover the mesh (GLB) avatar path.
+- [Scene Capture](./capture.md) reconstructs point clouds from video, a related radiance-adjacent capture flow.
+- Pages: [/create](https://three.ws/create), [/scene](https://three.ws/scene).
+
+---
+
+<a id="sec-252"></a>
> **Source:** `docs/start-here.md` · [↑ table of contents](#table-of-contents)
@@ -46519,6 +53331,10 @@ If you're here to create and share agents rather than write code, follow this pa
Make something the community upvotes and it can reach beyond three.ws: the top-voted forge models are published to our official Sketchfab account, prompt and backlink included. See [Sketchfab showcase](./sketchfab.md).
+Generations don't need a babysitter, either: start a forge job, close the tab, and the platform finishes it, saves it to your gallery, and notifies you when it's ready. See [Background generation](./forge-background-generation.md).
+
+Curious what happens between the prompt and the model? [How the Forge works](./how-forge-works.md) tells the story in plain language; [the Forge pipeline](./forge-pipeline.md) is the full engineering deep dive.
+
---
## Ready to build?
@@ -46527,8 +53343,10 @@ Make something the community upvotes and it can reach beyond three.ws: the top-v
- **Creating your first agent** → Go to [/start](/start) — a 5-step wizard walks you through it
- **Wondering who the little character in the corner is?** → [The agent shell](./agent-shell.md) — every visitor gets a named agent in the first five seconds (claim it to make it real), the ⌘K palette runs real commands (`forge …`, `digest`, `price btc`, `ask …`), and shell pages navigate without ever unloading your agent
- **Meeting avatars in the worlds?** → Press <kbd>I</kbd> on anyone in `/play`, `/city`, a coin world, or `/agora` to see who they are — the [avatar inspector](./avatar-inspector.md) shows their reputation, wallet, and profile
+- **Following creators?** → [The social layer](./social-layer.md): follow anyone from their `/u/:username` portfolio, watch their work land on [/feed](/feed), climb the [/rankings](/rankings) leaderboards with streaks and badges, get bell notifications for remixes, DMs, and coin graduations, and search everything at once on [/search](/search)
- **Placing agents in the real world?** → [IRL](./irl.md): pin an agent at a real GPS spot from your phone, and anyone who physically walks up can see it, talk to it, and pay it. Real crypto can be escrowed at places ([Money Drops](./irl.md#money-drops)) and agents sign proofs that you were really there ([World Lines](./irl.md#world-lines))
-- **Making 3D models?** → [The free 3D Studio MCP](./mcp-studio.md) turns a prompt into a model, avatar, or rigged character — and lets you refine it by talking to it (*"make it metallic"*) with a revertable version history. Publish a model as remixable and earn on-chain royalties when others build on it: [the remix economy](./remix.md)
+- **Making 3D models?** → [The free 3D Studio MCP](./mcp-studio.md) turns a prompt into a model, avatar, or rigged character — and lets you refine it by talking to it (*"make it metallic"*) with a revertable version history. Publish a model as remixable and earn on-chain royalties when others build on it: [the remix economy](./remix.md). Vote on the best community models and win the weekly board: [Forge-Off](./forge-off.md)
+- **Using ChatGPT?** → [AR in ChatGPT](./chatgpt-ar.md) is how a sentence typed into ChatGPT becomes a 3D model standing in your room, from the free generation lane to the one-tap AR link; [your first prompt to 3D](/tutorials/first-prompt-to-3d) walks you through it in five minutes
- **Trading?** → [The trading surfaces](./trading-surfaces.md) maps the solo stack (Radar, Coin Intelligence, Live Trade Feed, Watchlist, Mission Control); [trading arenas](./trading-arenas.md) covers tournaments, the theater, vaults, and swarms; [Oracle](./oracle.md) is the conviction engine underneath all of it
- **Trusting an agent with money?** → [Custody you can verify](./custody.md) — spend limits, freeze, Merkle proof-of-custody, and social recovery; [claim your wallet](./trader-card.md) turns any pump.fun track record into a public, provable Trader Card. Every real-funds feature sits behind the [risk acknowledgment](./risk-acknowledgment.md) — read the [Risk Disclosure](https://three.ws/legal/risk) before committing anything
- **Vetting a counterparty before you pay it?** → [Trust primitives](./trust-primitives.md) — the cross-chain Agent Reputation endpoint scores ANY wallet, mint, or agent id (Solana or EVM) 0–100 from real on-chain evidence, in one paid call, before your agent transacts
@@ -46553,7 +53371,122 @@ Make something the community upvotes and it can reach beyond three.ws: the top-v
---
-<a id="sec-205"></a>
+<a id="sec-253"></a>
+
+> **Source:** `docs/strategy-objects.md` · [↑ table of contents](#table-of-contents)
+
+# Strategy Objects and the Strategy Lab
+
+A Strategy Object is a trade strategy as a first-class thing you can own: a structured, validated rule set (entry conditions, sizing, take-profit, stop-loss, risk caps) that your agent can equip and run on-chain, ranked on a leaderboard by real live performance and forkable by anyone. The Strategy Lab is the workbench: write a strategy as data, validate it, backtest it against real recorded pump.fun history with the same evaluator its live runs use, and run it live or in simulation, end to end. Both run strategies as additional constraints on top of your agent's server-side spend policy, never a way around it.
+
+Pages: [/strategies](https://three.ws/strategies) (the library and leaderboard), [/strategy-lab](https://three.ws/strategy-lab) (the workbench)
+API: `GET/POST /api/strategies`, `GET /api/strategies/leaderboard`, `GET/PATCH/DELETE /api/strategies/:id`, `POST /api/strategies/:id/{fork,publish}`, `GET/POST/DELETE /api/dca-strategies`, the Lab's `POST /api/pump/strategy-{validate,backtest,run,close-all}`, and the sniper backtester `POST /api/sniper/backtest`
+
+## Why it exists
+
+Most "strategies" in crypto are a screenshot and a promise. three.ws makes a strategy an object with a real schema, a real owner, and a real, on-chain track record. That does three things at once.
+
+First, it makes strategies honest. A Strategy Object's performance is aggregated from real closed positions (`agent_strategy_positions`) across every agent that equipped it. A strategy with no closed trades is labeled "Unproven", never dressed up with a fabricated backtest curve. The leaderboard ranks by verified live ROI, not by claims.
+
+Second, it makes them composable. Because a strategy is data with a validated shape, it can be forked (the rules copy into your library with lineage credited to the author, and you run them under your own spend policy, no wallet access is ever transferred), edited, versioned, published, and equipped on any agent you own.
+
+Third, it makes them safe to run. The strategy's own caps (per-trade size, slippage, concurrency) are layered on top of the agent's server-side spend leash. The runtime sizes a buy from the strategy config, but the trade still passes through the full guard and custody path, so a strategy can never spend past your limits.
+
+## How it works
+
+### The Strategy Object schema
+
+Every strategy is normalized and validated by `api/_lib/strategy-schema.js` before it persists. Free text is impossible; a malformed rule set cannot be saved. The config has four sections:
+
+- **entry**: trigger (`new_launch`), `max_age_minutes`, optional min/max market cap, min liquidity, `require_socials`, creator-history gates (`max_creator_launches`, `min_creator_graduated`), and `require_sol_quote`.
+- **sizing**: `amount_sol` per trade and `max_slippage_bps`.
+- **exits**: `take_profit_pct`, a mandatory `stop_loss_pct`, optional `trailing_stop_pct`, and `max_hold_minutes`. Validation requires a stop-loss and at least one upside exit.
+- **risk**: `max_concurrent_positions` and `cooldown_minutes`.
+
+The schema enforces hard bounds on every field, so a stored config can never carry a nonsense number into the runtime. Two pure, synchronous functions, `matchesEntry` (does this real launch pass the entry gate) and `shouldExit` (should this open position close now), are the same logic the live equipped-strategy runtime (`api/_lib/agent-strategy-runtime.js`) and the assisted scan preview (`POST /api/trading/scan`) both evaluate, so a stored rule means exactly the same thing everywhere it runs.
+
+### The library, leaderboard, and forking
+
+`/strategies` has three surfaces on one page: the marketplace of published strategies (proven first), the leaderboard ranked by real live ROI, and your own library (create, edit, publish, equip, delete). The full-page builder lives in the URL (`?editor=new` or `?editor=<id>`) so it survives reload and the back button. Forking copies the rules only, credits lineage to the author, and gives you fresh ownership; equipping attaches the strategy to an agent you own, which then runs it under its own spend policy.
+
+### The Strategy Lab
+
+`/strategy-lab` is where you build and prove a declarative pump.fun strategy. The Lab speaks its own tiny strategy DSL (a spec with `scan`, `filters`, `entry`, and `exit` predicate rules), and one compiled evaluator powers validation, backtest, and live runs, so they cannot drift:
+
+- **Validate** (`POST /api/pump/strategy-validate`) checks the spec with the same validator the runner uses, so a broken spec is caught with field-level issues before anything runs. No sign-in needed.
+- **Backtest** (`POST /api/pump/strategy-backtest`, sign-in required) replays the compiled strategy over real recorded on-chain history: for each candidate mint (from the request's `mints`, the spec's `scan.mints`, or a live scan of new or trending launches) it fetches the token's real details, holders, bonding curve, and recent trades, evaluates the entry gate at the first recorded trade, then walks the subsequent real trades to trigger the exit rules. It never synthesizes launches or invents price paths; the response's `data` carries `spent`, `realizedPnlSol`, `roiPct`, `tradeCount`, `winRate`, `maxDrawdownSol`, the per-mint `trades`, and `mintsUsed`.
+- **Run** (`POST /api/pump/strategy-run`) executes the strategy for a bounded duration (5 to 600 seconds) and streams events over Server-Sent Events. In **simulate** mode it needs no wallet and spends nothing; in **live** mode it requires auth, an agent you own with a provisioned Solana wallet, and every buy passes a `policyGuard` that calls the same `checkBuyAllowed` spend-policy check the rest of the platform uses.
+- **Close all** (`POST /api/pump/strategy-close-all`, sign-in required) exits open strategy positions.
+
+A second, separate backtester serves sniper-style rule sets: `POST /api/sniper/backtest { agent_id, strategy, window_days?, network? }` (auth, agent you own, windows of 7, 30, 90, or 180 days). It replays the real captured launch universe, `pump_coin_intel` (bundle, organic, concentration, quality, category signals) joined to `pump_coin_outcomes` (graduated, pumped, flat, rugged, ATH multiple, last market cap), using the exact scorer and exit priority the live sniper worker runs. Exits are modeled at the two real price points it actually observed (the recorded peak and final multiples), a too-thin window returns an explicit `insufficient_data` verdict instead of a flattering number, and every limitation (survivorship, labeling lag, sample size) is reported in a `caveats` field. Results are cached by strategy hash and linked to the agent for projected-versus-realized comparison.
+
+### DCA and subscription builders
+
+`/api/dca-strategies` runs recurring, scheduled buys (executed by the `run-dca` cron). Each strategy is validated (agent, delegation, token in and out, amount per execution, a daily or weekly period, and slippage capped server-side), and non-GET methods over a cookie session require a CSRF token because these move real funds on a schedule.
+
+## Walkthrough
+
+1. Open [/strategies](https://three.ws/strategies) and browse the published marketplace, or switch to the leaderboard to see strategies ranked by real live ROI.
+2. Click **New strategy**. The full-page builder opens. Set your entry conditions, per-trade size and slippage, a required stop-loss and at least one upside exit, and your risk caps. Save.
+3. To prove it, open [/strategy-lab](https://three.ws/strategy-lab), paste or write the spec, and **Validate**. Fix any field-tagged errors it returns.
+4. **Backtest** it over real recorded launches and trades. For a sniper rule set, `POST /api/sniper/backtest` replays the captured outcome history and reports its own limitations; read the `caveats` before you trust a number.
+5. **Run** it in Simulate mode first: watch the live SSE stream of entries, exits, and logs with no funds at risk.
+6. Equip the strategy on an agent you own (or flip the Lab run to Live with that agent), and it trades within that agent's spend policy. Fork, edit, publish, or delete from your library at any time.
+
+## Examples
+
+List published strategies and the live leaderboard:
+
+```bash
+curl -s 'https://three.ws/api/strategies?scope=published&limit=10' \
+ | jq '.data.strategies[] | {name, proven: .performance.proven, roi: .performance.roi_pct}'
+
+curl -s 'https://three.ws/api/strategies/leaderboard?limit=10' \
+ | jq '.data.leaders[] | {rank, name, roi_pct: .performance.roi_pct}'
+```
+
+Backtest a sniper rule set against the real captured pump.fun launch history (auth required; bearer tokens skip CSRF):
+
+```bash
+curl -s https://three.ws/api/sniper/backtest \
+ -H 'authorization: Bearer YOUR_TOKEN' \
+ -H 'content-type: application/json' \
+ -d '{
+ "agent_id": "YOUR_AGENT_UUID",
+ "window_days": 30,
+ "network": "mainnet",
+ "strategy": {
+ "take_profit_pct": 100,
+ "stop_loss_pct": 40,
+ "min_quality_score": 60,
+ "require_socials": true
+ }
+ }' | jq '{sample_size, universe_size, insufficient_data, metrics, caveats}'
+```
+
+## Guardrails, states, and limits
+
+- **Strategy caps never override the spend leash.** Per-trade size, slippage, and concurrency are additional constraints on top of the agent's server-side policy. A live run's buys pass `checkBuyAllowed`; a strategy cannot spend past your limits.
+- **Simulate versus live.** The Lab defaults to Simulate (no wallet, no funds). Live requires auth, an owned agent with a provisioned Solana wallet, and enforces the spend policy on every buy.
+- **A stop-loss is mandatory.** Validation rejects any strategy without a stop-loss and requires at least one upside exit (take-profit, trailing stop, or max hold). Every field is clamped to hard bounds.
+- **Proven, not promised.** Performance is aggregated from real closed on-chain positions. No closed trades means "Unproven", not a synthetic curve. The leaderboard ranks by verified live ROI.
+- **Backtest honesty.** Both backtesters replay real recorded history with the same evaluator their live path runs; neither invents launches, outcomes, or price paths. The sniper backtester additionally reports its own limitations in `caveats` and returns an explicit `insufficient_data` verdict on a too-thin window.
+- **Forking transfers rules, not wallets.** A fork copies the config with lineage credited; the forker runs it under their own spend policy. No wallet access is ever transferred.
+- **Deleting is safe.** Deleting a strategy stops equipped agents from running it; open positions stay yours to manage.
+- **DCA moves real funds on a schedule.** Create and cancel are CSRF-gated over a session, slippage is capped server-side, and allowed output tokens plus the default chain are operator config, never hardcoded.
+
+## Related
+
+- [Custody you can verify](./custody.md) - the spend limits and audit trail every live run is bounded by
+- [Financial controls](./financial-controls.md) - the plain-English rules and firewall layered on the same enforcement point
+- [Oracle](./oracle.md) - the conviction engine an entry gate can require before it fires
+- [Trading surfaces](./trading-surfaces.md) - where equipped strategies execute through the guarded path
+- [Trading arenas](./trading-arenas.md) - competitive surfaces where strategies are put to the test
+- [/strategies](https://three.ws/strategies) and [/strategy-lab](https://three.ws/strategy-lab) - the library and the workbench
+
+---
+
+<a id="sec-254"></a>
> **Source:** `docs/syndication.md` · [↑ table of contents](#table-of-contents)
@@ -46675,7 +53608,367 @@ updated feed.
---
-<a id="sec-206"></a>
+<a id="sec-255"></a>
+
+> **Source:** `docs/talking-avatar-video.md` · [↑ table of contents](#table-of-contents)
+
+# Talking Avatar Video: render a lip-synced clip from an avatar
+
+Pick one of your three.ws avatars, upload an audio track, add an optional scene description, and a GPU worker renders a lip-synced talking-head video you can download as MP4. The lipsync and rendering happen server-side on a dedicated Cloud Run worker; the browser is just a picker, an uploader, and a player.
+
+Page: [/create/video](https://three.ws/create/video)
+API: `POST /api/avatar/presign-audio` · `POST /api/avatar/video-generate` · `GET /api/avatar/video-status`
+
+## Why it exists
+
+Real-time browser lipsync (see [Lipsync](./lipsync.md)) is perfect for live avatars, but it cannot produce a finished, shareable file with rendered frames, matched motion, and a scene. Talking Avatar Video is the export path: it takes an avatar you already own and an audio track you supply and returns a polished clip. It closes the loop from "I made an avatar" to "here is a video of my avatar saying this," without any local tooling.
+
+Note on scope: the shipped flow uploads an audio file. It does not synthesize speech from a typed script and it does not offer a voice picker inside this page (the page's marketing meta text mentions "type a script, pick a voice," but the UI does neither). To generate the audio first, use [Voice Lab](./voice-lab.md) and bring the resulting clip here.
+
+## How it works
+
+The page ([`pages/create/video.html`](../pages/create/video.html)) loads [`src/create-video.js`](../src/create-video.js), which uses `apiFetch` from [`src/account.js`](../src/account.js) and a `<model-viewer>` preview.
+
+1. **Auth gate.** On load it checks `GET /api/auth/me`; if you are not signed in it redirects to `/login?next=%2Fcreate%2Fvideo`.
+2. **Pick an avatar.** It calls `GET /api/avatars` and renders your avatar library into a thumbnail bar, auto-selecting the first. The selected GLB is shown in a `<model-viewer>`. Private avatars resolve their GLB lazily through `GET /api/avatars/:id` (a short-lived signed URL). With no avatars it falls back to `/avatars/default.glb`.
+3. **Upload audio.** Drag in or pick a WAV, MP3, M4A, OGG, or FLAC file. The client POSTs `{ filename, content_type }` to `/api/avatar/presign-audio`, gets a presigned PUT URL plus a `public_url`, and PUTs the raw bytes to R2/S3. If presign fails it falls back to a base64 data URI.
+4. **Describe the scene (optional).** A textarea takes a scene description such as "A person speaking on a stage with dramatic lighting." This is a scene prompt, not a script.
+5. **Generate.** With an avatar and audio ready, Generate POSTs `{ image_url, audio_url, avatar_id?, prompt? }` to `/api/avatar/video-generate`. The server SSRF-guards both URLs (https on the app or S3 domain), resolves the avatar image if only an `avatar_id` was sent (with an ownership/visibility check), and forwards to the worker.
+6. **Render, server-side.** The generate endpoint calls the **LongCat-Video-Avatar-1.5** worker on Google Cloud Run (`POST {LONGCAT_WORKER_URL}/generate`, bearer-authenticated), which produces the lip-synced frames. The endpoint returns `202 { job_id, status }`.
+7. **Poll.** The client polls `GET /api/avatar/video-status?job_id=...` every 5 seconds (20-minute safety timeout). Status runs `queued` -> `running` -> `done` | `failed`, with an optional `progress` (0 to 1).
+8. **Download.** On `done`, the `video_url` is set as the `<video>` source and the download anchor (`download="avatar-video.mp4"`). Progress copy: "Takes 2 to 4 minutes on GPU. Hang tight."
+
+## Walkthrough
+
+1. Open [/create/video](https://three.ws/create/video) and sign in.
+2. Pick an avatar from the thumbnail bar; it loads into the preview.
+3. Drop in or browse for an audio file (WAV, MP3, or M4A).
+4. Optionally type a scene description.
+5. Press Generate video. Watch the status: uploading audio, queuing, rendering frames with a percentage.
+6. When it finishes, play the result inline and press Download to save the MP4, or New video to start over.
+
+## Examples
+
+All three endpoints require a signed-in browser session. They authenticate with the
+session cookie only (`__Host-sid`); API bearer tokens are not accepted on this
+surface, so from a script reuse the cookie from a logged-in browser session.
+
+```bash
+# 1. Presign an audio upload slot.
+curl -X POST 'https://three.ws/api/avatar/presign-audio' \
+ -H 'cookie: __Host-sid=<SESSION>' -H 'content-type: application/json' \
+ -d '{ "filename": "line.mp3", "content_type": "audio/mpeg" }'
+# -> { "upload_url": "<PUT url>", "public_url": "https://…/line.mp3", "storage_key": "u/<uid>/audio/<uuid>.mp3" }
+
+# 2. PUT the raw bytes to the presigned URL.
+curl -X PUT '<PUT url>' -H 'content-type: audio/mpeg' --data-binary @line.mp3
+
+# 3. Kick off generation with an avatar image + the uploaded audio.
+curl -X POST 'https://three.ws/api/avatar/video-generate' \
+ -H 'cookie: __Host-sid=<SESSION>' -H 'content-type: application/json' \
+ -d '{ "image_url": "https://…/avatar.png", "audio_url": "https://…/line.mp3",
+ "avatar_id": "<AVATAR_ID>", "prompt": "A person talking on a bright stage." }'
+# -> 202 { "job_id": "…", "status": "queued" }
+
+# 4. Poll until done, then fetch video_url.
+curl -H 'cookie: __Host-sid=<SESSION>' \
+ 'https://three.ws/api/avatar/video-status?job_id=<JOB_ID>'
+# -> { "job_id": "…", "status": "done", "progress": 1, "video_url": "https://…/out.mp4", "error": null, "updated_at": "…" }
+```
+
+`audio_url` is required; `image_url` may be omitted when `avatar_id` is present (the server resolves the avatar's stored image). `prompt` defaults to "A person talking naturally."
+
+## States and limits
+
+- **Auth required.** The page gates on `/api/auth/me`; every endpoint re-checks the session and returns `401` otherwise.
+- **Free tier: one lifetime generation.** Free-plan users get exactly one video. The quota is reserved race-safely (a `usage_events` row is inserted before the worker call and released if submission fails, so an outage never burns the trial). On exhaustion the server returns `402 free_trial_used` and the page relabels the retry button "Upgrade plan" linking to `/dashboard`. Paid plans are unlimited.
+- **Rate limits.** Per-user and global rate limits on `video-generate` return `429`.
+- **Input formats.** Audio: WAV, MP3, M4A, OGG, FLAC (validated against an allow-list; `415` otherwise). Uploads go to R2/S3 under `u/{userId}/audio/{uuid}.{ext}`.
+- **SSRF guard.** `image_url` and `audio_url` must be https on the app origin or the S3 public domain, else `400 invalid_request`.
+- **Ownership.** `video-status` verifies the job belongs to you (`404` if unknown, `403` if another user's). Avatar image resolution enforces owner-or-public visibility.
+- **Timing and errors.** Renders take ~2 to 4 minutes; the client times out after 20 minutes. UI states cover idle, uploading audio, queuing, rendering with a percent, done, and error (upload failed, could not start, failed on the server, timed out). Server errors include `502 worker_unreachable`/`worker_error` and `503 worker_unconfigured`.
+- **Output.** MP4, downloaded straight from the worker's `video_url`.
+
+## Related
+
+- [Voice Lab](./voice-lab.md): clone or synthesize the audio track you upload here.
+- [Lipsync](./lipsync.md): the real-time, in-browser lipsync path (no export).
+- [Selfie to Avatar](./selfie-to-avatar.md) and [Avatar reconstruction](./avatar-reconstruction.md): create the avatar you render.
+- Pages: [/create/video](https://three.ws/create/video), [/create](https://three.ws/create), [/dashboard](https://three.ws/dashboard).
+
+---
+
+<a id="sec-256"></a>
+
+> **Source:** `docs/terminal.md` · [↑ table of contents](#table-of-contents)
+
+# Mission Control: the keyboard-first pump.fun trading terminal
+
+Mission Control is the cockpit of the three.ws trading stack. It fuses the live pump.fun launch firehose with intel scores, Trade Safety Firewall verdicts, and smart-money flow into one keyboard-driven, three-pane terminal, streams your agent's open positions with live PnL, and lets you buy or sell in a single keystroke from your agent's custodial Solana wallet behind the platform's server-side firewall and MEV-protected execution path. Every other trading surface is read-only. This is the one where you pull the trigger.
+
+Page: [/terminal](https://three.ws/terminal)
+
+APIs (all real, all called by the page): `/api/pump/trades-stream` (SSE firehose), `/api/pump/intel`, `/api/pump/safety`, `/api/intel/smart-money`, `/api/pump/coin`, `/api/pump/price-history`, `/api/pump/dex-trades`, `/api/sniper/stream` (SSE positions), `/api/sniper/leaderboard`, `/api/sniper/history`, `/api/sniper/radar`, `/api/agents/:id/solana`, `/api/agents/:id/solana/holdings`, `/api/agents/:id/solana/trade`.
+
+## Why it exists
+
+Early pump.fun trading punishes context-switching. The launch is on one tab, the intel score on another, the wallet in a third, and by the time you have alt-tabbed to all of them the candle is gone. Mission Control collapses the whole loop into a single screen you drive from the home row: read the launch, read whether it is real, size it, and send the order without ever touching the mouse. It sits at the top of the [trading surfaces](./trading-surfaces.md) map. Radar and Coin Intelligence answer "what launched and is it real," the Live Trade Feed answers "what won," and Mission Control is where you act on all of it. It is the only surface that executes.
+
+## How it works
+
+The page mounts `mountMissionControl` from `src/mission-control/index.js` and lays out three panes:
+
+- **Feed (left).** Three switchable sources. `live` is the new-mint and graduation firehose over Server-Sent Events (`/api/pump/trades-stream`). `signals` is the Coin Intelligence Engine's scored feed (`/api/pump/intel?view=feed`), each coin carrying a 0 to 100 `quality_score`, a verdict, and risk flags. `radar` is the pre-launch precursor stream (`/api/sniper/radar`).
+- **Focus (center).** The selected coin's identity and market state (`/api/pump/coin`), its candlestick chart (`/api/pump/price-history`, Birdeye with a GeckoTerminal fallback and a last-good-candles degrade), the live trade tape (`/api/pump/dex-trades` polled every 8s for graduated pairs the stream misses), the firewall verdict, and the smart-money read.
+- **Positions (right).** Your agent's open positions with streaming unrealized PnL over SSE (`/api/sniper/stream`, DB-polled every 1.5s), spot holdings (`/api/agents/:id/solana/holdings`, refreshed every 30s), and a one-tap quick exit.
+
+Each row in the feed is enriched on demand by `enrich.js`, which fans out three cached reads per mint: intel (`/api/pump/intel?mint=`), the Trade Safety Firewall (`/api/pump/safety?mint=&amp;amount=`, which runs an SPL authority audit plus an on-chain simulated buy then sell round-trip and returns `allow` / `warn` / `block`), and smart money (`/api/intel/smart-money?mint=`). Failures cache `null` and mark the field unavailable rather than retry-storming or faking a value.
+
+Every SSE endpoint self-closes about every 90 seconds by design; `realtime.js` treats an `event: close` as normal and fast-reconnects, with exponential backoff only on real errors.
+
+## The keyboard
+
+The keyboard is the point. Shortcuts are suppressed while focus is in an input, textarea, or select, and ignored when a modifier key is held.
+
+| Key | Action |
+| --- | --- |
+| `j` / down arrow | Next launch in the feed |
+| `k` / up arrow | Previous launch |
+| `b` | Buy at the active size preset |
+| `s` | Sell the entire position |
+| `1`-`6` | Pick a buy-size preset |
+| `/` | Focus the feed filter box |
+| `g` | Jump to the top of the feed |
+| `x` | Toggle Express mode (instant vs confirm-first) |
+| `?` | Open or close the shortcuts overlay |
+| `Esc` | Close overlay, blur input, or clear |
+
+## Filters and saved views
+
+The filter bar (state in `store.js`) narrows the feed by source, free-text query (name, symbol, or mint substring), a minimum-intel floor that cycles through 0 / 40 / 60 / 80, a firewall verdict (`allow` or `warn`; a `block` coin is always hidden when a verdict filter is set), a smart-money-only toggle, a has-socials toggle, and a market-cap band (nano under 10k, micro 10k to 50k, small 50k to 250k, mid 250k and up, in USD). Any filter set can be saved as a named **view**, persisted per user in `localStorage` (`mc:views:v1:<userId>`, up to 24, newest first). Buy-size presets default to 0.1, 0.25, 0.5, and 1 SOL and persist at `mc:presets:v1`.
+
+## Firewall, MEV, and trading from your agent wallet
+
+Trading is the guarded path, and the client checks are only a fast gate: the server is the real authority. `POST /api/agents/:id/solana/trade` is owner-only (session or bearer auth, then agent-ownership verification) and, for a real execute, requires a single-use `x-csrf-token` and an `idempotency_key`. A `{ preview: true }` call returns a live quote and moves no funds. On execute the server runs a fixed enforcement order: fresh quote, kill switch, per-trade cap, daily budget, spend-limit enforcement, price-impact breaker, then the Trade Safety Firewall (`assessTradeSafety`; a `block` returns HTTP 422 `firewall_blocked`), then SOL headroom, then it claims the idempotency slot and submits through the MEV engine (`submitProtected` with `tipMode 'off'`: dynamic compute budget from a real simulation and a Helius priority-fee estimate on a protected single-tx send; the engine's Jito bundle-with-tip route exists but is not used by this endpoint). The agent's key is decrypted only at signing time via `recoverSolanaAgentKeypair`, and every attempt is audit-logged. A retried idempotency key never double-spends; a previously failed key returns 409. The firewall thresholds live in `api/_lib/trade-firewall.js`: block at score 45 and below, warn at 70 and below, with a fatal check (a dead sell leg or no venue) forcing `block` regardless of score.
+
+Express mode (`trade.js`): the first trade always shows a confirm modal; accepting sets a per-agent express flag so later orders execute instantly. `x` toggles it back off.
+
+## Walkthrough
+
+1. Open [/terminal](https://three.ws/terminal). Signed out, the cockpit is fully readable and the trade ticket reads "Sign in to trade."
+2. Sign in and select a trading agent. The topbar shows the agent's Solana address and SOL balance (`/api/agents/:id/solana`, polled every 30s).
+3. Leave the feed on `live` and watch new mints arrive. Press `j` and `k` to move the selection; each row enriches with its intel score, firewall verdict, and smart-money read.
+4. On a coin you like, press `1`-`6` to choose a size preset, glance at the Focus pane's firewall verdict and security cells, then press `b`. The first buy asks you to confirm; accept to arm Express for that agent.
+5. Watch the fill and the new position stream into the right pane with live PnL. Press `s` to exit the whole position when you are done.
+
+## Examples
+
+The read surfaces powering the panes are public and IP rate-limited, so you can pull the same data any agent sees:
+
+```bash
+# The Signals feed: scored launches from the Coin Intelligence Engine
+curl 'https://three.ws/api/pump/intel?view=feed&network=mainnet&limit=20'
+
+# The Trade Safety Firewall verdict for a mint at a 0.05 SOL probe size
+curl 'https://three.ws/api/pump/safety?mint=<MINT>&network=mainnet&amount=0.05'
+
+# Who reputable is net-buying a coin
+curl 'https://three.ws/api/intel/smart-money?mint=<MINT>&network=mainnet'
+```
+
+Stream the same new-mint firehose the Feed pane consumes:
+
+```javascript
+const es = new EventSource('https://three.ws/api/pump/trades-stream');
+es.addEventListener('mint', (e) => console.log('new launch', JSON.parse(e.data)));
+es.addEventListener('graduation', (e) => console.log('graduated', JSON.parse(e.data)));
+// The stream self-closes about every 90s; reconnect on 'close'.
+```
+
+## States and limits
+
+- **Auth.** The page runs read-only signed out. Trading, `/api/sniper/history`, and the holdings and trade endpoints require a session or bearer token plus ownership of the agent. Signed out, the ticket links to `/login?next=%2Fterminal`.
+- **Rate limits.** The public reads are IP rate-limited (`mcpIp` on the stream and smart-money, `publicIp` on safety, `authedReadIp` on sniper history). The trade endpoint is auth and CSRF gated.
+- **Streaming.** All SSE endpoints self-close roughly every 90 seconds and the client fast-reconnects; connection pills surface `live`, `reconnecting`, or `down`.
+- **Honest empty and error states.** Enrichment caches `null` on failure and marks the field unavailable. The chart never fabricates candles (it degrades to last-good with a `stale` marker or shows empty). Positions distinguish "stream unreachable" from "no open positions," and the trade tape shows "Waiting for trades..." rather than inventing fills.
+- **Refresh cadences.** Balance and holdings 30s, signals and radar 12s, dex-trades 8s, position poll 1.5s.
+
+## Related
+
+- [The trading surfaces: Radar, Mission Control, Live Trade Feed, Watchlist, Coin Intelligence](./trading-surfaces.md)
+- [Coin Radar](./radar.md) and [Smart Money Radar](./smart-money.md) feed the same intel into their own surfaces
+- [Oracle: the conviction engine](./oracle.md) supplies the fused conviction score
+- [Financial controls and custody guardrails](./financial-controls.md) and [custody](./custody.md) document the server-side rails every order runs through
+- Pages: [/terminal](https://three.ws/terminal) · [/radar](https://three.ws/radar) · [/trades](https://three.ws/trades) · [/watchlist](https://three.ws/watchlist)
+
+---
+
+<a id="sec-257"></a>
+
+> **Source:** `docs/three-microbuy.md` · [↑ table of contents](#table-of-contents)
+
+# $THREE micro-buy loop
+
+Many tiny, real on-chain buys of `$THREE` per minute, each triggered by (and paid
+through) a settled x402 payment. It exists to put continuous, verifiable buy
+pressure on `$THREE` — a steady drip of small market buys that show up on-chain and
+on the chart, rather than one large buy a day.
+
+It is the high-frequency, small-ticket sibling of the [daily buyback](../api/_lib/token/buyback.js):
+
+| | Daily buyback | Micro-buy loop |
+|---|---|---|
+| Cadence | a few large buys/day | many tiny buys/minute (target ~60/min) |
+| Ticket | $10–$250 | ~$0.01 |
+| Trigger | scheduled cron | a settled x402 call |
+| Funding | buyback wallet USDC | micro-buy wallet USDC |
+| Direction | **buy-only** | **buy-only** |
+
+Both lanes buy on Jupiter through the same client ([api/_lib/token/jupiter.js](../api/_lib/token/jupiter.js))
+and sweep the bought tokens to the treasury. **Neither ever sells `$THREE`.**
+
+## How one buy works
+
+1. The driver [api/cron/three-buy-loop.js](../api/cron/three-buy-loop.js) fires a
+ paid x402 call to `/api/x402/three-buy`. The small toll
+ (`X402_PRICE_THREE_BUY`, default $0.001 USDC) routes to the ring treasury
+ (`X402_PAY_TO_SOLANA`) — exactly like every other ring endpoint. This is the
+ "pay through the x402 loop" leg.
+2. The endpoint ([api/x402/three-buy.js](../api/x402/three-buy.js)) delivers the
+ paid good: it executes **one** USDC→`$THREE` market buy on Jupiter
+ (`THREE_MICROBUY_USD`, default $0.01), funded by the micro-buy wallet — a
+ **separate** money stream from the toll.
+3. The bought `$THREE` accrues in the micro-buy wallet and is swept to the
+ treasury by the loop every `THREE_MICROBUY_SWEEP_EVERY_N_TICKS` ticks.
+
+The toll and the buy are deliberately decoupled (same custody-vs-accounting split
+the daily buyback uses): the toll is internal recirculation; the buy is the real
+market spend.
+
+## Safety
+
+Execution is **off by default**. Until `THREE_MICROBUY_ENABLED` is truthy *and* a
+funded signer exists, every call is a recorded no-op and the toll is refused (the
+endpoint re-emits its 402, so the caller is never charged for a buy that didn't
+happen).
+
+- **Daily ceiling.** `THREE_MICROBUY_DAILY_CAP_USD` (default $50) is the hard bound
+ on real market spend and SOL fee burn. It is enforced **atomically** — the engine
+ reserves the day's budget in Redis *before* broadcasting a buy, so a flood of
+ concurrent calls can never collectively overshoot the cap. A DB sum over
+ `three_microbuy_runs` is the fallback when Redis is down.
+- **Fail-closed.** If *neither* Redis nor the ledger DB can confirm today's spend,
+ the buy is **refused** (`cap_unverifiable`), not allowed. Unbounded real-money
+ spend is the one outcome the cap exists to prevent, so the engine never assumes
+ "zero spent" on an infrastructure outage.
+- **Fail-closed toll.** Because the endpoint refuses the toll whenever a buy can't
+ happen (disabled, unfunded, cap reached), a direct payer can force buys only up
+ to the same daily ceiling the loop obeys — there is no amplification past the cap.
+- **Self-healing ledger.** The loop and endpoint create `three_microbuy_runs` on
+ first use, so the DB cap fallback and the records always work even on a fresh or
+ behind database — the migration owns it in a real deploy, this is the backstop.
+- **Kill switches.** `X402_AUTONOMOUS_ENABLED=false` (global) or
+ `THREE_MICROBUY_ENABLED` unset stops everything; `THREE_MICROBUY_LOOP_ENABLED=false`
+ pauses only the driver while leaving the endpoint payable.
+- **No wasted hammering.** A tick stops early on a fully-failed wave (cap exhausted,
+ disabled, unfunded, or an RPC/DB outage) instead of firing every remaining call
+ for nothing — reported as `stop_reason` in the tick response.
+- **Not in the generic ring.** `three-buy` is `autobuy:false` in
+ [ring-catalog.js](../api/_lib/x402/ring-catalog.js), so the generic ring rotation
+ never fires real buys — only its dedicated driver does (pinned by a test).
+
+Every call writes an immutable row to `three_microbuy_runs`
+([migration](../api/_lib/migrations/20260717233000_three_microbuy.sql)) — submitted,
+confirmed, pending, skipped, or failed — so there is never a silent no-op.
+
+## Throughput — hitting ~60/min
+
+The whole tick runs inside the economy-tick 60s call budget, so 60 buys/min only
+works if each buy is fast. Two things make it fast:
+
+- **Broadcast-and-go (default).** Waiting for each buy to confirm would pin it to
+ the ~2–12s block time — at 60/min that can't fit. So the engine returns as soon as
+ the buy is broadcast (`status: submitted`) and does **not** block on confirmation.
+ This is safe because the daily cap is reserved *before* broadcast (spend is bounded
+ regardless) and the treasury sweep reads real on-chain balances (accounting
+ self-corrects). Flip `THREE_MICROBUY_AWAIT_CONFIRM=true` only if you need per-call
+ confirmation and can accept a lower rate.
+- **Distinct transactions.** At 60/min many buys of the same size fire within one
+ blockhash window; identical amount + quote would let Jupiter build byte-identical
+ transactions that collide on signature (the duplicate is silently dropped). A tiny
+ per-buy amount jitter (0–255 atomics, ≤ $0.000255) makes every buy a distinct
+ market order, so none are lost to collisions. Jupiter's keyless tier absorbs the
+ per-buy quote load (measured: 20 concurrent quotes, zero throttling).
+
+Recommended 60/min config: `THREE_MICROBUY_PER_TICK=60`, leave
+`THREE_MICROBUY_CONCURRENCY` unset (auto-sizes to 15 wide), keep
+`THREE_MICROBUY_AWAIT_CONFIRM` off. At ~1–2s/buy and 15-wide, a full 60-buy tick
+lands in ~8–15s. Make sure the micro-buy wallet holds enough SOL for fees:
+60 buys/min ≈ 0.5–1.7 SOL/day at typical priority fees.
+
+## Observability
+
+- **Tick response.** `/api/cron/three-buy-loop` returns `fired`, `paid`, `buys`,
+ `pending`, `errors`, `toll_spent_usd`, `daily_spent_usd`, `daily_cap_usd`, and
+ `stop_reason` for the tick.
+- **Public stats.** `microbuyStats()` (lifetime + today's buys, $THREE bought, USDC
+ deployed, cap-used %) is surfaced on the `$THREE` token stats API
+ ([api/three-token/[action].js](../api/three-token/%5Baction%5D.js) → `/api/three-token/stats`)
+ under `token.microbuy`, alongside the daily buyback summary.
+- **Ring volume.** The x402 tolls show up in the ring dashboards tagged
+ `pipeline='three-buy'` (per-endpoint volume ledger + `x402_autonomous_log`).
+
+## Turning it on
+
+```bash
+# 1. Apply the schema.
+npm run db:migrate -- --apply
+
+# 2. Fund a wallet with USDC (+ a little SOL for fees). Reuse the buyback wallet, or
+# set a dedicated key so the two lanes don't compete for the same USDC:
+# THREE_MICROBUY_SECRET_KEY_B64=<base64 of 64 secret-key bytes>
+
+# 3. Set env on the Cloud Run service (gcloud run services update … --update-env-vars):
+# THREE_MICROBUY_ENABLED=true
+# THREE_MICROBUY_USD=0.01 # per-buy size
+# THREE_MICROBUY_PER_TICK=60 # ~60 buys/min
+# THREE_MICROBUY_DAILY_CAP_USD=50 # hard daily spend bound
+# THREE_MICROBUY_CONCURRENCY=8 # workers/tick
+
+# 4. The economy-tick heartbeat drives it every minute (target 'three-buy-loop').
+# Verify a tick:
+curl -s -H "Authorization: Bearer $CRON_SECRET" https://three.ws/api/cron/three-buy-loop | jq
+```
+
+The response reports `fired`, `paid`, `buys`, `pending`, `errors`, `toll_spent_usd`,
+`daily_spent_usd`, `daily_cap_usd`, and `stop_reason` for the tick.
+
+## Configuration
+
+| Env | Default | Meaning |
+|---|---|---|
+| `THREE_MICROBUY_ENABLED` | off | Master execution gate. |
+| `THREE_MICROBUY_LOOP_ENABLED` | on | Set `false` to pause only the driver. |
+| `THREE_MICROBUY_SECRET_KEY_B64` | buyback wallet | Dedicated signer/funder (base64 64-byte key). |
+| `THREE_MICROBUY_USD` | `0.01` | USD per single buy (hard-capped at 5). |
+| `THREE_MICROBUY_DAILY_CAP_USD` | `50` | UTC-daily ceiling on real spend. |
+| `THREE_MICROBUY_PER_TICK` | `10` | Buys per minute (hard-capped at 60). Set `60` for the target rate. |
+| `THREE_MICROBUY_CONCURRENCY` | auto (≤15) | Concurrent buy workers per tick. Unset auto-sizes to the per-tick target; override clamps to 1–30. |
+| `THREE_MICROBUY_AWAIT_CONFIRM` | `false` | Wait for each buy to confirm on-chain. Off = broadcast-and-go (required for 60/min). |
+| `THREE_MICROBUY_SLIPPAGE_BPS` | `300` | Jupiter slippage tolerance. |
+| `THREE_MICROBUY_SWEEP_EVERY_N_TICKS` | `30` | Sweep accrued `$THREE` to treasury cadence. |
+| `X402_THREE_BUY_TOLL_CAP_ATOMIC` | `1000000` | Per-tick ceiling on internal tolls (USDC atomics). |
+| `X402_PRICE_THREE_BUY` | `1000` | Per-call toll price (USDC atomics, $0.001). |
+
+## Related
+
+- [docs/x402-ring-economy.md](x402-ring-economy.md) — the closed-loop x402 ring the toll settles through.
+- [api/_lib/token/buyback.js](../api/_lib/token/buyback.js) — the daily buyback lane.
+- [api/_lib/token/config.js](../api/_lib/token/config.js) — `$THREE` mint, treasury, and split policy.
+
+---
+
+<a id="sec-258"></a>
> **Source:** `docs/token-gated-3d-embeds.md` · [↑ table of contents](#table-of-contents)
@@ -46793,7 +54086,7 @@ Every check that matters happens on the server:
---
-<a id="sec-207"></a>
+<a id="sec-259"></a>
> **Source:** `docs/trader-card.md` · [↑ table of contents](#table-of-contents)
@@ -46851,7 +54144,7 @@ Returns the identity summary, KPI aggregates, and the per-coin ledger — `known
---
-<a id="sec-208"></a>
+<a id="sec-260"></a>
> **Source:** `docs/trading-arenas.md` · [↑ table of contents](#table-of-contents)
@@ -46920,7 +54213,7 @@ Prove yourself solo (the [trading surfaces](trading-surfaces.md) → the [leader
---
-<a id="sec-209"></a>
+<a id="sec-261"></a>
> **Source:** `docs/trading-copilot.md` · [↑ table of contents](#table-of-contents)
@@ -47059,7 +54352,7 @@ plumbing — and never suggests, shills, or names another token on its own initi
---
-<a id="sec-210"></a>
+<a id="sec-262"></a>
> **Source:** `docs/trading-experiment.md` · [↑ table of contents](#table-of-contents)
@@ -47215,7 +54508,7 @@ much — and tune the next run. That is the whole point of the experiment.
---
-<a id="sec-211"></a>
+<a id="sec-263"></a>
> **Source:** `docs/trading-surfaces.md` · [↑ table of contents](#table-of-contents)
@@ -47352,6 +54645,8 @@ Agents wanting the same intel over MCP: see [docs/mcp.md](mcp.md) (`@three-ws/in
## Related
+- [Meta-Allocator: the ETF of degens](meta-allocator.md): diversify a budget across the top verified leaders
+- [Clip Director: every trade becomes content](clip-director.md): turn any closed trade into shareable cards per surface
- [The Trading Copilot — talk to your wallet](trading-copilot.md) — conversational trading over these same numbers
- [Oracle — the conviction engine](oracle.md) · [/oracle/docs](https://three.ws/oracle/docs)
- [The autonomous trading experiment](trading-experiment.md)
@@ -47360,7 +54655,7 @@ Agents wanting the same intel over MCP: see [docs/mcp.md](mcp.md) (`@three-ws/in
---
-<a id="sec-212"></a>
+<a id="sec-264"></a>
> **Source:** `docs/troubleshooting.md` · [↑ table of contents](#table-of-contents)
@@ -47515,7 +54810,7 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
**Fix steps:**
1. Check the Console. The avatar module logs a warning if expected morph targets aren't found on load.
-2. Verify your GLB has morph targets named exactly as expected (case-sensitive). The emotion system maps to: `mouthSmile`, `mouthFrown`, `mouthOpen`, `cheekPuff`, `browInnerUp`, `browOuterUp`, `noseSneer`, `eyeSquint`, `eyesClosed`. These are the standard VRM / humanoid avatar names.
+2. Verify your GLB has morph targets named exactly as expected (case-sensitive). The emotion system maps to: `mouthSmile`, `mouthFrown`, `mouthOpen`, `cheekPuff`, `browInnerUp`, `browOuterUpLeft` / `browOuterUpRight`, `noseSneerLeft` / `noseSneerRight`, `eyeSquintLeft` / `eyeSquintRight`, `eyesClosed`. These are the standard ARKit / humanoid avatar blendshape names.
3. For head tilt and lean, the skeleton needs a `Head` or `Neck` bone. Open the model in Blender and check the armature.
4. Confirm the avatar module is initialized: open DevTools Console and run `window.VIEWER?.agent_avatar`. If `undefined`, the avatar layer didn't boot — check for earlier errors in the console.
@@ -47578,7 +54873,7 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
**Fix steps:**
1. Verify the `<script>` tag loads before the `<agent-3d>` element in the DOM, or that it uses `defer`/`async` correctly.
-2. Check the Console for CSP violations. The CDN origin (`cdn.three.ws`) must appear in your `script-src` policy.
+2. Check the Console for CSP violations. The script origin (`https://three.ws`) must appear in your `script-src` policy (and in `connect-src` for API and model fetches).
3. For **Next.js**: web components use browser APIs (`window`, `document`, `SpeechSynthesis`) that don't exist server-side. Mark the component file with `'use client'` and disable SSR for the wrapper:
```js
import dynamic from 'next/dynamic';
@@ -47594,8 +54889,8 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
**Fix steps:**
1. Verify the `src` URL is correct — use the full HTTPS URL.
-2. Do not use a URL that ends in `/edit` or `/dashboard` — those pages block framing for security. Use the agent's public embed URL.
-3. Note: the `frame-ancestors` CSP for the embed is currently set via a `<meta>` HTTP-equiv tag, which browsers ignore for `frame-ancestors` (it must be an HTTP header). This means any origin can embed — if you're seeing a block, it's coming from something else, likely the host page's own CSP or an extension.
+2. Do not use a URL that ends in `/edit` or `/dashboard`: those pages block framing for security. Use the agent's public embed URL (`/agent/<id>/embed`, `/w/<widget-id>`, or `/widget#widget=<id>`).
+3. Only the dedicated embed routes send a `frame-ancestors *` CSP header (set in the route table and applied by the server); regular pages send `frame-ancestors 'self'` and will refuse to load in your iframe. If an embed route is being blocked, the block is coming from the host page's own CSP, the agent's embed policy (domain allowlist), or a browser extension.
---
@@ -47605,20 +54900,21 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
**Fix steps:**
-1. Target the correct origin: `'https://three.ws/'` (or your self-hosted origin).
+1. Target the correct origin: `'https://three.ws'` (or your self-hosted origin). Note there is no trailing slash: `e.origin` is a bare origin, so a comparison against `'https://three.ws/'` never matches.
2. Listen for `message` events on `window`, not on the iframe element itself:
```js
window.addEventListener('message', (e) => {
- if (e.origin !== 'https://three.ws/') return;
+ if (e.origin !== 'https://three.ws') return;
console.log(e.data);
});
```
-3. Use the correct envelope shape. There are two related protocols, and neither uses a type prefix like `3dagent:`:
+3. Use the correct envelope shape. There are three related protocols, and none uses a type prefix like `3dagent:`:
+ - The **agent iframe bridge** (`/agent/<id>/embed`) uses `{ type: 'agent:*', agentId, ... }`: send `{ type: 'agent:hello', agentId }` first, wait for `agent:ready`, then drive it with `{ type: 'agent:action', agentId, action: { type: 'speak', text: '...' } }`. Every message must carry the `agentId`. See example 9 in the [Examples gallery](/docs/examples).
- 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`.
+ Messages that don't match the expected envelope (missing `agentId` or `v: 1`, wrong `source`/`type`) are silently ignored.
+4. For element embeds, 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`.
---
@@ -47720,7 +55016,7 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
1. Increase the gas limit by 20% — registration involves IPFS CID storage and can exceed estimates.
2. Check your ETH balance on Base. Bridge more if needed.
3. Verify the manifest CID resolves on IPFS before calling the contract. A CID that doesn't resolve yet may cause the contract to reject it depending on the registry version.
-4. Confirm MetaMask is on Base mainnet (chain ID 8453), not Ethereum mainnet. The registry is not deployed on mainnet.
+4. Confirm MetaMask is on the chain you intend to register on. The platform default is Base (chain ID 8453). The registry contracts are deployed at the same addresses on all major EVM chains, but your wallet must be on the chain the registration flow targets, with gas funds on that chain.
---
@@ -47750,13 +55046,15 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
### ENS resolution not working
-**Symptom:** Navigating to `/agent/ens/yourname.eth` shows "not found".
+**Symptom:** Looking up an agent by ENS name returns "not found".
+
+**How it works:** the API resolves the ENS name to its address, then returns the agents registered to that wallet address. There is no ENS text record to configure: the match is on the address your name resolves to.
**Fix steps:**
-1. Verify the `3dagent` text record is set on the ENS name. In the ENS manager, add a text record with key `3dagent` and value set to your agent's on-chain ID.
-2. ENS records can take 30+ minutes to propagate after being set.
-3. Test direct resolution: `https://three.ws/agent/ens/yourname.eth`
+1. Verify the ENS name resolves to the wallet address that owns (or is linked to) your agent. If the agent's registered wallet is a different address than the one your ENS name points to, the lookup returns nothing.
+2. ENS record changes can take 30+ minutes to propagate after being set.
+3. Test direct resolution against the API: `https://three.ws/api/agents/ens/yourname.eth` (public, rate-limited; returns the resolved address and matching agents as JSON).
---
@@ -48012,11 +55310,11 @@ In local memory mode, all conversation memory stays in the browser's `localStora
**The `IdleAnimation` (blink / head-drift) doesn't seem to work.**
-This is a known open issue. The `IdleAnimation` class is implemented in `src/idle-animation.js` but is not yet wired into the avatar system — it's imported but the integration with `agent-avatar.js` is incomplete. Idle blink and head-drift are not active in the current release. This is tracked as a defect.
+Idle blink and head-drift are active in the current release: `src/idle-animation.js` is wired into `src/agent-avatar.js` (instantiated on avatar load and ticked every frame). If you don't see blinking, the usual cause is the model itself: the blink layer needs the `eyeBlinkLeft` / `eyeBlinkRight` morph targets, and head-drift needs a `Head` or `Neck` bone. Check the Console for the avatar module's missing-morph-target warning, and see "Agent emotions not showing" above for the full morph-target list.
---
-<a id="sec-213"></a>
+<a id="sec-265"></a>
> **Source:** `docs/trust-primitives.md` · [↑ table of contents](#table-of-contents)
@@ -48256,7 +55554,7 @@ See also: [x402 paid endpoints](./x402.md) · [Agent Bouncer](./api-reference.md
---
-<a id="sec-214"></a>
+<a id="sec-266"></a>
> **Source:** `docs/tutorials/agent-personality.md` · [↑ table of contents](#table-of-contents)
@@ -48709,7 +56007,7 @@ The system prompt is the cheapest, highest-leverage thing you can change about a
---
-<a id="sec-215"></a>
+<a id="sec-267"></a>
> **Source:** `docs/tutorials/agent-reputation.md` · [↑ table of contents](#table-of-contents)
@@ -48768,43 +56066,38 @@ A review can also be **staked**: the reviewer locks ≥0.001 ETH behind their vo
The fastest read is the visual one.
1. Open the [Reputation Explorer](/reputation).
-2. Paste an agent identifier — a numeric `agentId`, a wallet address, or a CAIP-10 ID.
+2. Paste an identifier: an Ethereum wallet address or an ENS name (resolved automatically). For an ERC-8004 agent, deep-link with `?agent=<chainId>:<agentId>` (e.g. `/reputation?agent=8453:42`).
3. Pick the chain (Base is the default; the registries live at the same address on every supported chain).
4. Read the panel:
- - **Average score** (shown as `X.X / 5`) and **total vouch count**
- - **Total ETH staked** behind the vouches
- - **Recent vouches** — each with the reviewer's address, score, optional comment, and a link to the transaction on the block explorer
-
-If the agent has no reviews yet, you'll see a clean "no vouches yet" state rather than a blank — a brand-new agent reads as *unknown*, not *bad*.
+ - **Average score** (shown as stars out of 5) and **total review count**
+ - **Recent reviews**: each with the reviewer's address, score, optional comment, and a link to the attestation or transaction on the explorer
-This is also the panel embedded on every agent profile page at `https://three.ws/a/<chainId>/<agentId>`.
+If the agent has no reviews yet, you'll see a clean empty state rather than a blank: a brand-new agent reads as *unknown*, not *bad*.
---
## Path 2 — The REST API (one `fetch`)
-For a webpage or a backend that just needs the aggregate, hit the REST endpoint. No key, no payment:
+For a three.ws agent (identified by its platform UUID), hit the REST endpoint. No key, no payment. It returns the agent's **unified wallet trust score**: a 0-100 credibility signal computed from real ledger and on-chain activity, with the ERC-8004 registry read as one of its inputs:
```js
-const res = await fetch('https://three.ws/api/agents/<agent-id>/reputation');
+const res = await fetch('https://three.ws/api/agents/<agent-uuid>/reputation');
const rep = await res.json();
// {
-// average: 4.6, // 0 if no reviews
-// count: 12, // number of vouches
-// total_stake_wei: "3000000000000000", // ETH staked, in wei (string for safety)
-// chain_id: 8453
+// agent_id: "…",
+// name: "…",
+// score: 62, // 0-100 credit-style score
+// max: 100,
+// tier: "…", tierLabel: "…",
+// pillars: [ … ], // per-factor breakdown (tenure, volume, reliability, …)
+// evidence: { … }, // links to the on-chain facts behind the score
+// computed_at: "2026-…"
// }
-console.log(`${rep.average.toFixed(1)} from ${rep.count} reviews`);
-```
-
-Query a different chain with `?chain_id=`:
-
-```js
-fetch('https://three.ws/api/agents/<agent-id>/reputation?chain_id=42161'); // Arbitrum
+console.log(`${rep.name}: ${rep.score}/${rep.max} (${rep.tierLabel})`);
```
-The endpoint reads the contract live and caches the result for ~5 minutes (look for an `X-Cache: HIT|MISS` header). `total_stake_wei` is returned as a **string** because wei values overflow JavaScript's safe-integer range — parse it with `BigInt`, not `Number`.
+The score is cached for ~3 minutes (look for an `X-Cache: HIT|MISS` header), and the same computation feeds the reputation badges on discovery surfaces. Note this endpoint takes the **three.ws agent UUID**, not a raw on-chain `agentId`; for the raw ERC-8004 star aggregate, use the SDK module (Path 4), the contract (Path 5), or the MCP tool (Path 3).
---
@@ -48858,18 +56151,18 @@ This is the path to wire into an agent that needs to gate its own spending: read
---
-## Path 4 — The SDK (JavaScript)
+## Path 4: The reputation module (JavaScript)
-Inside a JavaScript app, the SDK wraps the contract reads with an `ethers` provider:
+Inside a JavaScript app, the in-repo module `src/erc8004/reputation.js` wraps the contract reads with an `ethers` provider (the same module the register-onchain flow and the Reputation Explorer use):
```js
-import { getReputation, getRecentReviews, getTotalStake } from '@three-ws/sdk/erc8004';
+import { getReputation, getRecentReviews, getTotalStake } from './src/erc8004/reputation.js';
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://mainnet.base.org');
// Aggregate — already averaged for you
-const { total, count, average } = await getReputation({
+const { count, average } = await getReputation({
chainId: 8453,
agentId: 42,
runner: provider,
@@ -48889,7 +56182,7 @@ const reviews = await getRecentReviews({
reviews.forEach(r => console.log(r.from, r.score, r.comment, r.txHash));
```
-`getReputation` returns `{ total, count, average }` with `average` pre-computed (`0` when there are no reviews). `getRecentReviews` returns an array of `{ from, score, comment, blockNumber, txHash }`. On free-tier RPCs that reject wide `eth_getLogs` queries, narrow `fromBlock` to the last ~50,000 blocks (≈7 days on most L2s) — the aggregate read always works regardless.
+`getReputation` returns `{ count, average }` with `average` pre-computed (`0` when there are no reviews). `getRecentReviews` returns an array of `{ agentId, from, score, comment, blockNumber, txHash }`. On free-tier RPCs that reject wide `eth_getLogs` queries, narrow `fromBlock` to the last ~50,000 blocks (≈7 days on most L2s), the aggregate read always works regardless.
---
@@ -48947,9 +56240,11 @@ For ENS-named agents, three.ws resolves `eip155:<chainId>:<registry>/<agentId>`
Star reviews are one signal. For a three.ws agent, you can also read its **behavior** — did it actually get paid, did its payouts succeed, did anyone dispute it — via the paid x402 synthesis endpoint (`$0.01 USDC`):
```
-GET /api/x402/agent-reputation?agent_id=<uuid>
+GET /api/x402/agent-reputation?subject=<identifier>
```
+`subject` accepts any identifier (a three.ws agent UUID, a wallet, or a mint); the type is auto-detected.
+
It returns confirmed payment count and distinct payers, payout/distribution success rates, failure rates, and attestation counts — reputation derived from what an agent *did*, not just what people *said*. Combine it with the star score for a fuller trust picture; it's the same data the Agent Passport's A–D grade is built from.
---
@@ -48996,7 +56291,7 @@ This is exactly the bouncer pattern three.ws's own Pole Club uses at its door
- That wallet doesn't own an ERC-8004 agent on the chosen chain. Pass a numeric `agentId` directly, or switch chains — the same wallet may own an agent elsewhere.
**`fetch` to the REST endpoint 404s**
-- Use the agent's three.ws UUID for `/api/agents/<id>/reputation`. For a raw on-chain `agentId` or wallet, use the SDK (Path 4), the contract (Path 5), or the MCP tool (Path 3) instead.
+- Use the agent's three.ws UUID for `/api/agents/<id>/reputation`. For a raw on-chain `agentId` or wallet, use the reputation module (Path 4), the contract (Path 5), or the MCP tool (Path 3) instead.
---
@@ -49013,7 +56308,7 @@ A read costs nothing and asks no one's permission. That's the property that lets
---
-<a id="sec-216"></a>
+<a id="sec-268"></a>
> **Source:** `docs/tutorials/animate-your-avatar.md` · [↑ table of contents](#table-of-contents)
@@ -49238,7 +56533,7 @@ Primary call to action: open **[/pose](/pose)**, load an avatar, and apply your
---
-<a id="sec-217"></a>
+<a id="sec-269"></a>
> **Source:** `docs/tutorials/build-a-scene.md` · [↑ table of contents](#table-of-contents)
@@ -49457,7 +56752,7 @@ The leverage of [Scene Studio](/scene) is that it's a *real* editor producing a
---
-<a id="sec-218"></a>
+<a id="sec-270"></a>
> **Source:** `docs/tutorials/claim-threews-name.md` · [↑ table of contents](#table-of-contents)
@@ -49765,11 +57060,11 @@ See also:
---
-<a id="sec-219"></a>
+<a id="sec-271"></a>
> **Source:** `docs/tutorials/connect-ai-brain.md` · [↑ table of contents](#table-of-contents)
-# Connect Anthropic or OpenAI as the brain
+# Connect Anthropic, OpenAI, or xAI (Grok) as the brain
The agent's body is the avatar. The agent's voice is the TTS. The agent's *brain* is whatever LLM is generating its replies. By default the platform routes through a managed Claude endpoint, which works out of the box but bills against your free tier. The moment you want real production traffic, full control over which model runs, or your own usage observability, you bring your own API key.
@@ -49782,7 +57077,7 @@ This tutorial covers the whole brain layer. Where the LLM call actually happens
- A streaming-enabled brain so replies feel responsive
- An observability dashboard you can use to monitor spend per agent
-**Prerequisites:** You have an agent at [three.ws/my-agents](https://three.ws/my-agents). You have an API key from Anthropic ([console.anthropic.com](https://console.anthropic.com)) or OpenAI ([platform.openai.com](https://platform.openai.com)). Familiarity with the concept of system prompts (see [agent personality](/tutorials/agent-personality)).
+**Prerequisites:** You have an agent at [three.ws/my-agents](https://three.ws/my-agents). You have an API key from Anthropic ([console.anthropic.com](https://console.anthropic.com)), OpenAI ([platform.openai.com](https://platform.openai.com)), or xAI ([console.x.ai](https://console.x.ai)). Familiarity with the concept of system prompts (see [agent personality](/tutorials/agent-personality)).
---
@@ -49829,7 +57124,15 @@ For OpenAI:
4. In three.ws My Agents, **API Keys → OpenAI → Add key.**
5. Paste, save.
-You can store both keys at once and route different agents to different providers.
+For xAI (Grok):
+
+1. Open [console.x.ai](https://console.x.ai).
+2. **API Keys → Create API key.** Label it.
+3. Copy (starts with `xai-`).
+4. In three.ws My Agents, **API Keys → Grok (xAI) → Add key.**
+5. Paste, save.
+
+You can store all three keys at once and route different agents to different providers.
After saving, the keys are stored encrypted at rest. The dashboard shows the last four characters and a creation timestamp; the full key is never displayed back. If you suspect a leak, rotate the key on the provider side and replace it in the dashboard — the platform invalidates the old one immediately.
@@ -49897,6 +57200,19 @@ The platform also carries the wider OpenAI lineup: GPT-5.5 and GPT-5.5 Pro, the
Legacy ids keep working: `gpt-4o`, `gpt-4o-mini`, and `o3-mini` are accepted as aliases and resolve to `gpt-5.6-sol`, `gpt-5.6-luna`, and `o3` (the GPT-4o family was deprecated upstream in July 2026), so existing agents upgrade in place with no config change.
+### xAI (Grok) models
+
+**Grok 4.5** (`grok-4.5`) is the xAI flagship.
+
+- **Cost:** $2 per million input, $6 per million output. Cheaper than Sonnet per token.
+- **Latency:** First token in roughly a second.
+- **Capability:** Frontier reasoning with strong real-time knowledge of X. Tool use is reliable. A good pick for agents that discuss current events or social sentiment.
+- **Context window:** 500K tokens.
+
+**Grok 4.3** (`grok-4.3`) is the long-context option ($1.25 in / $2.50 out, 1M-token window). Reach for it when the agent carries very large system prompts or memory.
+
+**Grok 4.1 Fast** (`grok-4.1-fast`) is the budget workhorse ($0.20 in / $0.50 out, 2M-token window). Comparable to Haiku for short interactions and dramatically cheaper.
+
### Picking a model
A practical rule of thumb:
@@ -50101,7 +57417,7 @@ The brain is the part of the agent you'll iterate on most after the system promp
---
-<a id="sec-220"></a>
+<a id="sec-272"></a>
> **Source:** `docs/tutorials/create-and-edit-memory.md` · [↑ table of contents](#table-of-contents)
@@ -50422,7 +57738,7 @@ The leverage is in *enhancement*: the right type, one fact per memory, tags, del
---
-<a id="sec-221"></a>
+<a id="sec-273"></a>
> **Source:** `docs/tutorials/custom-skill.md` · [↑ table of contents](#table-of-contents)
@@ -50708,22 +58024,22 @@ There are three ways, depending on how you're working.
The `uri` points to the **directory**, not the manifest file. The runtime appends `manifest.json`, `SKILL.md`, `tools.json`, and `handlers.js` automatically. Make sure the URI ends with a trailing slash — the runtime uses it as a base for relative asset resolution.
-**In the web component attribute:**
+**In the web component attribute** (comma-separated skill URIs, installed on top of any manifest skills):
```html
<agent-3d
- src="https://yourusername.github.io/my-agent/manifest.json"
- skills='[{"uri":"https://yourusername.github.io/weather-skill/"}]'
+ body="./my-avatar.glb"
+ brain="claude-sonnet-4-6"
+ skills="https://yourusername.github.io/weather-skill/"
></agent-3d>
```
-**Via the editor:**
+**At runtime via JavaScript:**
-1. Open your agent in the editor
-2. Go to the **Skills** tab in the manifest builder
-3. Paste the skill directory URL (ending in `/`)
-4. Click **Add Skill**
-5. Save
+```js
+const agent = document.querySelector('agent-3d');
+await agent.installSkill('https://yourusername.github.io/weather-skill/');
+```
---
@@ -50918,7 +58234,7 @@ Good skills to build next:
- **Notion / Linear** — read and write tickets or docs
- **Domain knowledge** — a skill that's pure `SKILL.md` with no tools, injecting specialized context (legal, medical, culinary)
-Sharing your skill is as simple as posting the manifest URL. Add the topic `3dagent-skill` to your GitHub repo and others can find it. The community skill registry is coming — skills will be indexable by tag, rig compatibility, and author.
+Sharing your skill is as simple as posting the manifest URL. Add the topic `3dagent-skill` to your GitHub repo so others can find it, and browse what the community has built on the [Skills Marketplace](/skills).
---
@@ -50933,9 +58249,16 @@ You built a weather skill with these four files:
The skill installs via a URI in the agent manifest, runs entirely client-side, and adds new capabilities to any compatible agent without modifying the agent itself. That's the composability primitive: agents are extensible at runtime through content-addressed skill bundles.
+## Related
+
+- [Skills system reference](/docs/skills): manifest format, context API, sandboxing, publishing
+- [Build a skill with database auth](/docs/tutorials/skill-with-database-auth): the next step up, a skill backed by your own API
+- [Build your first agent](/docs/tutorials/first-agent): the agent this skill plugs into
+- [Web component reference](/docs/web-component): the `skills` attribute and `installSkill()` method
+
---
-<a id="sec-222"></a>
+<a id="sec-274"></a>
> **Source:** `docs/tutorials/customize-appearance.md` · [↑ table of contents](#table-of-contents)
@@ -51373,7 +58696,7 @@ Most production embeds use four or five of these together. The combination is wh
---
-<a id="sec-223"></a>
+<a id="sec-275"></a>
> **Source:** `docs/tutorials/deploy-to-vercel-custom-domain.md` · [↑ table of contents](#table-of-contents)
@@ -51890,7 +59213,7 @@ In rough order of likelihood:
---
-<a id="sec-224"></a>
+<a id="sec-276"></a>
> **Source:** `docs/tutorials/embed-in-30-seconds.md` · [↑ table of contents](#table-of-contents)
@@ -52164,7 +59487,7 @@ A working embedded agent is the foundation everything else builds on. From here,
---
-<a id="sec-225"></a>
+<a id="sec-277"></a>
> **Source:** `docs/tutorials/embed-on-website.md` · [↑ table of contents](#table-of-contents)
@@ -52183,21 +59506,21 @@ This tutorial walks you through every path for adding a three.ws agent to your s
## Before you start
-You need an agent ID. Go to [three.ws/studio](https://three.ws/studio), select or create an agent, and note its ID — it looks like `a_abc123` or is a number paired with a chain ID like `42` on Base.
+For the code paths below you need an agent ID. Find yours on [three.ws/my-agents](https://three.ws/my-agents) (or browse the [agents directory](https://three.ws/agents)); it looks like `a_abc123`, or is a number paired with a chain ID like `42` on Base.
---
## Path 1: Get your embed code (no-code, fastest)
-If you don't want to write code, the Studio generates the snippet for you.
+If you don't want to write code, the Widget Studio generates the snippet for you.
1. Go to [three.ws/studio](https://three.ws/studio)
-2. Select an agent (or create one — the Talking Agent widget is the most popular starting point)
-3. Click **Get Embed Code** in the top-right corner
-4. Choose your widget type and placement
-5. Copy the snippet
+2. Pick an avatar: the built-in demo, one of your own uploads, or a public avatar by another creator
+3. Choose a widget type and configure placement, colors, and behavior
+4. Click **Generate embed**
+5. Copy the snippet from the "Your widget is live" modal (it shows a live preview first)
-The Studio offers two snippet formats. Here's what each one looks like and when to use it:
+Beyond the Studio's generated widgets, there are two hand-written snippet formats that work with any agent ID. Here's what each one looks like and when to use it:
**iframe snippet** — works everywhere, more secure sandboxing, no extra script tag needed:
```html
@@ -52666,7 +59989,16 @@ Squarespace's developer preview and published output can differ. Try adding the
---
-<a id="sec-226"></a>
+## Related
+
+- [Embedding guide](/docs/embedding): iframe permissions, CSP notes, and every embed surface in one place
+- [Web component reference](/docs/web-component): the full `<agent-3d>` attribute, method, and event reference
+- [Embed in 30 seconds](/docs/tutorials/embed-in-30-seconds): the shortest possible version of this tutorial
+- [Build your first agent](/docs/tutorials/first-agent): create the agent you're about to embed
+
+---
+
+<a id="sec-278"></a>
> **Source:** `docs/tutorials/emotion-from-data.md` · [↑ table of contents](#table-of-contents)
@@ -52894,7 +60226,7 @@ function reactIfConfident(clipOrEmoteName, { confident, useExactClip = false } =
---
-<a id="sec-227"></a>
+<a id="sec-279"></a>
> **Source:** `docs/tutorials/first-agent.md` · [↑ table of contents](#table-of-contents)
@@ -52918,10 +60250,10 @@ You need a GLB file — the standard format for 3D models on the web. Here are t
### Option A: Use the sample avatar (zero effort, recommended for beginners)
-There's a hosted sample avatar ready to use. Just copy the URL below and you're done for this step:
+There's a hosted sample avatar ready to use (the platform's own default body). Just copy the URL below and you're done for this step:
```
-https://cdn.three.ws/models/sample-avatar.glb
+https://three.ws/avatars/default.glb
```
Come back and swap this for your own character later. That's what Step 9 is for.
@@ -52932,14 +60264,8 @@ Come back and swap this for your own character later. That's what Step 9 is for.
1. Go to [mixamo.com](https://www.mixamo.com) and sign in with a free Adobe account.
2. Click **Characters**, then pick any character you like.
-3. Click **Download** and choose **FBX for Unity** from the format dropdown.
-4. Convert the FBX to GLB using [gltf-transform](https://gltf-transform.dev):
-
- ```bash
- npx gltf-transform@latest fbx2glb your-character.fbx your-character.glb
- ```
-
- This requires Node.js. If you don't have Node.js installed, grab it from [nodejs.org](https://nodejs.org).
+3. Click **Download** and choose **FBX Binary** from the format dropdown. (Mixamo exports FBX, not GLB.)
+4. Convert the FBX to GLB with the free [Blender](https://www.blender.org): **File > Import > FBX**, then **File > Export > glTF 2.0 (.glb)**. Keep the default export settings; the rig and animations come through.
### Option C: Generate one from a selfie (~5 minutes)
@@ -52984,7 +60310,7 @@ Create a new folder somewhere on your computer. Inside it, create a file called
<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
<agent-3d
- body="https://cdn.three.ws/models/sample-avatar.glb"
+ body="https://three.ws/avatars/default.glb"
width="400px"
height="600px"
></agent-3d>
@@ -53029,7 +60355,7 @@ Update the `<agent-3d>` tag to add the `brain` and `instructions` attributes:
```html
<agent-3d
- body="https://cdn.three.ws/models/sample-avatar.glb"
+ body="https://three.ws/avatars/default.glb"
brain="claude-sonnet-4-6"
name="Aria"
instructions="You are Aria, a friendly and enthusiastic AI guide. You love helping people explore the 3D world. Be concise, warm, and occasionally playful. When someone greets you, wave at them. Keep replies to 2–3 sentences unless asked for more."
@@ -53040,7 +60366,7 @@ Update the `<agent-3d>` tag to add the `brain` and `instructions` attributes:
**What changed:**
-- `brain="claude-sonnet-4-6"` — enables the AI. The value is the Claude model ID to use. `claude-sonnet-4-6` is the recommended default: fast, capable, and cost-effective. You can also use `claude-opus-4-7` for the most capable responses, or `claude-haiku-4-5-20251001` for the fastest.
+- `brain="claude-sonnet-4-6"`: enables the AI. The value is the model ID to use. `claude-sonnet-4-6` is the recommended default: fast, capable, and cost-effective. You can also use `claude-opus-4-7` for the most capable responses, or `claude-haiku-4-5` for the fastest. There's also `brain="free"`, which routes to the platform's free hosted model so you can try everything with no key at all.
- `name="Aria"` — the agent's name. This appears in the nameplate overlay and is available to the brain as context.
- `instructions="..."` — the system prompt. This is where you define personality, tone, behavior rules, and anything the agent should know about its context.
@@ -53081,9 +60407,7 @@ Create `agent.json` in the same folder as `index.html`:
"memory": {
"mode": "local"
},
- "skills": [
- { "uri": "https://cdn.three.ws/skills/wave/" }
- ],
+ "skills": [],
"version": "0.1.0"
}
```
@@ -53098,9 +60422,9 @@ Then update `index.html` to load from the manifest instead of using inline attri
></agent-3d>
```
-The manifest approach is cleaner for anything beyond a one-liner: you can version it in git, keep the instructions in one place, and load it by URL from anywhere.
+The manifest approach is cleaner for anything beyond a one-liner: you can version it in git, keep the instructions in one place, and load it by URL from anywhere. The `skills` array is empty for now; [Build a custom skill](/docs/tutorials/custom-skill) shows how to fill it with your own tool bundle.
-> **Note:** If you used the sample avatar URL, replace `./your-character.glb` in the manifest with `https://cdn.three.ws/models/sample-avatar.glb`.
+> **Note:** If you used the sample avatar URL, replace `./your-character.glb` in the manifest with `https://three.ws/avatars/default.glb`.
---
@@ -53182,8 +60506,8 @@ Then add your own input below the element:
| `agent:ready` | Agent fully booted | `{ agent, manifest }` |
| `brain:message` | Each turn of conversation | `{ role, content }` |
| `brain:thinking` | LLM call started | — |
-| `skill:tool-called` | Agent used a tool/skill | `{ name, args }` |
-| `voice:transcript` | STT produced a transcript | `{ text }` |
+| `skill:tool-called` | Agent used a tool/skill | `{ tool, args, result }` |
+| `voice:transcript` | STT produced a transcript | `{ text, final }` |
---
@@ -53297,7 +60621,7 @@ Once the page is live, swap in your own GLB:
1. Go to [https://three.ws/app](https://three.ws/app)
2. Drag your GLB into the viewer to confirm it loads correctly.
-3. Sign up for a free account, then click **Save to Account** to get a hosted URL.
+3. Sign in (free), then save the avatar to your account to get a hosted URL.
4. Copy that URL.
5. Replace the `body=` attribute in your HTML (or `body.uri` in your manifest) with the new URL.
@@ -53386,15 +60710,15 @@ And the `agent.json` manifest alongside it.
Now that you have a working agent, here's what to explore next:
**Make it smarter:**
-- [Skills documentation](../skills.md) — add tools like web search, weather, or a product catalog. Skills are JSON packages that give the agent new capabilities without changing the system prompt.
-- [Memory system](../memory.md) — the agent can remember things across conversations using local storage or IPFS.
+- [Skills documentation](/docs/skills): add tools like web search, weather, or a product catalog. Skills are JSON packages that give the agent new capabilities without changing the system prompt.
+- [Memory system](/docs/memory): the agent can remember things across conversations using local storage or IPFS.
**Make it permanent:**
-- [ERC-8004 registration](../erc8004.md) — register your agent on-chain for a permanent, decentralized identity. Once registered, anyone can load your agent by its on-chain ID: `<agent-3d agent-id="42" chain-id="8453">`.
+- [ERC-8004 registration](/docs/erc8004): register your agent on-chain for a permanent, decentralized identity. Once registered, anyone can load your agent by its on-chain ID: `<agent-3d agent-id="42" chain-id="8453">`.
**Embed it anywhere:**
-- [Embedding guide](../embedding.md) — embed Aria as a floating bubble in the corner of any existing website, or as an iframe widget with a single line of code.
-- [Web component reference](../web-component.md) — the full attribute, method, and event reference for `<agent-3d>`.
+- [Embedding guide](/docs/embedding): embed Aria as a floating bubble in the corner of any existing website, or as an iframe widget with a single line of code.
+- [Web component reference](/docs/web-component): the full attribute, method, and event reference for `<agent-3d>`.
---
@@ -53411,7 +60735,127 @@ Now that you have a working agent, here's what to explore next:
---
-<a id="sec-228"></a>
+<a id="sec-280"></a>
+
+> **Source:** `docs/tutorials/first-prompt-to-3d.md` · [↑ table of contents](#table-of-contents)
+
+# Your First Prompt to 3D in ChatGPT
+
+Type one sentence into ChatGPT and get a real, textured 3D model back: spin it in the browser, download it as a GLB, and place it in your room through your phone's camera. Generation is free and runs on three.ws; you don't need a three.ws account, a wallet, or an API key.
+
+**What you'll do:**
+- Add the three.ws 3D Studio to ChatGPT (two ways, pick one)
+- Write a first prompt that generates well
+- Read the three links every model comes back with
+- Place the model in your real room
+- Iterate on it in plain words, and bring a rigged avatar to life
+
+**Prerequisites:** A ChatGPT account. A smartphone (iPhone or Android) for the AR step; every other step works on a computer.
+
+---
+
+## Step 1: Add the 3D Studio to ChatGPT
+
+There are two ways in. Both use the same free generation lane; they differ in how results are shown.
+
+**Option A: the ChatGPT app (connector).** In ChatGPT, add a connector with the URL `https://three.ws/api/mcp-studio` and **No authentication**. Models render inline in an interactive 3D widget you can rotate right in the chat, with a **View in your space** button on it. This is the best experience if your plan supports connectors.
+
+**Option B: the custom GPT.** Search the GPT Store for **three.ws 3D Studio** and open it. Models come back as three labeled links instead of an inline widget. Use this on plans without connector support.
+
+---
+
+## Step 2: Type your first prompt
+
+Ask for one concrete object, like you're telling a friend what to look for in a shop:
+
+```
+Make me a 3D model of a glazed ceramic teapot
+```
+
+Three habits make prompts generate dramatically better:
+
+1. **One object per prompt.** "A teapot" works. "A teapot on a table by a window" confuses the model; it tries to build all of it.
+2. **Name the material.** "brushed metal", "worn leather", "glazed ceramic", "matte plastic". Materials drive how the surface looks.
+3. **Skip the scenery.** No backgrounds, no lighting moods. You're describing a thing, not a photograph.
+
+Want more recipes? There's a whole cookbook: [Prompt Recipes for 3D Generation](/tutorials/prompts-for-3d).
+
+---
+
+## Step 3: Read what comes back
+
+Generation usually takes 20 to 60 seconds; ChatGPT will tell you it's checking on the job if it needs longer. Every finished model arrives with three links, in this order:
+
+1. **See it in your space (AR)**: the place-in-your-room link. This is the one to open on your phone.
+2. **Preview in your browser**: an interactive viewer; drag to spin the model, scroll to zoom.
+3. **Download (GLB)**: the model file itself.
+
+In the connector version the model also renders inline, and the AR link is the **View in your space** button on the widget.
+
+---
+
+## Step 4: Place it in your room
+
+Open the AR link on your phone (if you're on a computer, send it to yourself; it's a normal URL). What happens next is automatic:
+
+- **iPhone:** the page opens Apple Quick Look. The model appears through your camera at real-world scale. Behind the scenes the GLB is converted to Apple's USDZ format on the fly, in the page.
+- **Android:** the link goes straight into Google Scene Viewer (pre-installed on most Android phones with Google Play).
+- **Computer:** no AR hardware, so the link falls back to the interactive 3D viewer. Nothing breaks.
+
+Point the camera at a flat surface, tap to place, then walk around it. The model stays anchored where you put it.
+
+---
+
+## Step 5: Iterate in plain words
+
+Every change is a real regeneration, described in words:
+
+- **Custom GPT:** just say the change ("make it metallic and gold", "give it a taller spout"). The GPT folds your change into the previous prompt and generates a new model.
+- **Connector:** the `refine_model` tool keeps a version lineage. The inline widget shows a version strip you can click to cross-fade between versions, and you can branch from any earlier version instead of starting over.
+
+Each version carries its own AR link, so you can place the before and after side by side on your desk.
+
+---
+
+## Step 6: Bring an avatar to life
+
+Props place statically. Rigged avatars do more. Ask for one:
+
+```
+Make me a rigged astronaut avatar I can animate
+```
+
+A rigged avatar's AR link gains a **Bring it to life** option: instead of a frozen statue, it opens [IRL](/irl), where the avatar walks, animates, and talks with you through your camera, standing in your real space. Static placement stays one tap away if you just want it on a shelf.
+
+---
+
+## Step 7: Take it anywhere
+
+- The **GLB download** works in Blender, Unity, Godot, three.js, and most 3D tools.
+- **Share the AR link.** Paste it into any chat and it unfurls with a real rendered picture of your exact model. Whoever opens it gets the same one-tap placement, plus a "Create your own" link.
+- Want the same thing from code instead of ChatGPT? The identical free lane is a plain HTTP API: [Generate 3D Models from Code](/tutorials/generate-3d-api).
+
+---
+
+## Troubleshooting
+
+- **"prompt_rejected"**: prompts are screened for age-13+ appropriateness before generation. Stylized fantasy props (a sword, a wand) are fine; rephrase anything that isn't.
+- **Stuck on "still generating"**: under load a job can take a few minutes. ChatGPT keeps the poll link; ask it to check again rather than re-submitting.
+- **AR link shows a viewer, not AR**: you opened it on a computer, or on a phone browser without AR support. Open it in Safari on iPhone or Chrome on Android.
+- **Rate limited (429)**: the free lane has a per-IP hourly cap. Wait the indicated time; generation is free, so a failed attempt never costs anything.
+
+---
+
+## What's next
+
+- [AR in ChatGPT](/docs/chatgpt-ar): how this whole pipeline works under the hood
+- [Place your 3D model in AR](/tutorials/view-in-ar): the on-site AR flow, QR handoff included
+- [Turn a Text Prompt into a 3D Model](/tutorials/text-to-3d): the same generation lane in the Forge, with quality tiers
+- [The 3D Studio MCP server](/docs/mcp-studio): every tool the connector exposes, including living agent personas
+
+---
+
+<a id="sec-281"></a>
> **Source:** `docs/tutorials/generate-3d-api.md` · [↑ table of contents](#table-of-contents)
@@ -53429,7 +60873,7 @@ Everything the [Forge](/forge) does in the browser is available as a plain HTTP
```
POST /api/forge { prompt, tier } → { job_id, status: "queued" }
-GET /api/forge?job=ID (poll every few s) → { status: "running", step: "mesh" }
+GET /api/forge?job=ID (poll every few s) → { status: "running", backend: "..." }
GET /api/forge?job=ID → { status: "done", glb_url: "https://..." }
GET glb_url → your model
```
@@ -53467,9 +60911,11 @@ The request body:
| `prompt` | string | The object description, 3–1000 chars. Same [prompt rules](/tutorials/prompts-for-3d) as the UI. |
| `tier` | `"draft"` \| `"standard"` \| `"high"` | Polygon budget + textures. Defaults to `standard`. High adds PBR materials. |
| `aspect_ratio` | `"1:1"` \| `"4:3"` \| `"3:4"` \| `"16:9"` \| `"9:16"` | Shape of the intermediate reference image. Optional. |
-| `image_urls` | string[] | 1–4 public HTTPS image URLs for photo→3D (Step 4). Omit for text→3D. |
+| `image_urls` | string[] | 1 to 6 public HTTPS image URLs for photo→3D (Step 4). Omit for text→3D. |
| `backend` | string | Pin a specific engine from the catalog (Step 5). Optional — the Forge picks for you. |
+`draft` and `standard` are free. `high` on the platform engines is gated: it unlocks for $THREE holders (Bronze tier, $25 held), and a non-holder gets a `402` with hold-or-pay instructions (pay $THREE per generation, or sign in and spend prepaid credits via `pay_with: "credits"`). Bring-your-own-key engines skip the gate. Agents that would rather pay in USDC per call should use the x402 twin in Step 6, where `high` is a flat $0.50.
+
---
## Step 2 — Poll until done
@@ -53478,13 +60924,13 @@ The request body:
curl -s 'https://three.ws/api/forge?job=JOB_ID'
```
-While running you'll see progress:
+While running you'll see:
```json
-{ "job_id": "…", "status": "running", "step": "mesh" }
+{ "job_id": "…", "status": "running", "backend": "…", "tier": "draft", "path": "text" }
```
-`step` walks through `image` (painting the reference) → `mesh` (reconstruction) → `finish`. When it completes:
+Each poll echoes the job's provenance (`backend`, `tier`, `path`, and the view counts for photo jobs), so a caller that only polls still learns how the model is being made. When it completes:
```json
{ "job_id": "…", "status": "done", "glb_url": "https://three.ws/cdn/…" }
@@ -53518,7 +60964,7 @@ async function generateModel(prompt, tier = 'standard') {
await sleep(4000);
const poll = await fetch(`${BASE}/api/forge?job=${encodeURIComponent(job.job_id)}`);
job = await poll.json();
- console.log(` ${job.status}${job.step ? ` (${job.step})` : ''}`);
+ console.log(` ${job.status}${job.backend ? ` (${job.backend})` : ''}`);
}
return job.glb_url;
}
@@ -53538,7 +60984,7 @@ Run it:
node generate.js "a low-poly treasure chest, iron-banded wood"
```
-**Batch an asset pack** by looping prompts through `generateModel` one at a time. Keep it sequential — the endpoint is rate-limited per IP, so a `Promise.all` over twenty prompts will hit `429 rate_limited`. On a 429, wait and retry; it's a per-minute window, not a ban.
+**Batch an asset pack** by looping prompts through `generateModel` one at a time. Keep it sequential: the endpoint is rate-limited per IP (about 60 free generations an hour), so a `Promise.all` over a hundred prompts will hit `429 rate_limited`. On a 429, wait and retry; it's a rolling window, not a ban.
---
@@ -53568,7 +61014,7 @@ const submit = await fetch(`${BASE}/api/forge`, {
});
```
-Photos are pre-checked by a vision model before any generation is spent; an unusable image comes back as a `400` explaining the problem (blurry, busy background, multiple objects). Pass `skip_validation: true` to override — the same as the UI's "Generate anyway" button. The [photo guidelines](/tutorials/image-to-3d) apply exactly as in the browser.
+Photos are pre-checked by a vision model before any generation is spent; an unusable primary image comes back as a `422` with `error: "image_not_usable"`, an `issue` code, and a plain-language `message` (blurry, busy background, multiple objects). Pass `skip_validation: true` to override: the same as the UI's "Generate anyway" button (the response's `override` field spells this out). Flagged secondary views are silently dropped rather than failing the job. The [photo guidelines](/tutorials/image-to-3d) apply exactly as in the browser.
---
@@ -53586,7 +61032,7 @@ It returns every backend (id, label, which paths it serves, whether it needs a b
## Step 6 — For autonomous agents: pay per call with x402
-The public endpoint is rate-limited per IP, which is fine for scripts and prototyping. Agents that need guaranteed, metered capacity can use the paid twin at `POST /api/x402/forge` — same request body, billed per generation in USDC over the [x402 protocol](https://www.x402.org) (Base or Solana):
+The public endpoint is rate-limited per IP, which is fine for scripts and prototyping. Agents that need guaranteed, metered capacity can use the paid twin at `POST /api/x402/forge`, same request body, billed per generation in USDC on Solana over the [x402 protocol](https://www.x402.org):
| Tier | Price per generation |
|------|---------------------|
@@ -53604,8 +61050,9 @@ If you've never made an x402 call, start with [Build a paid x402 endpoint](/tuto
| Response | Meaning | Fix |
|----------|---------|-----|
-| `429 rate_limited` | Per-IP window exhausted | Back off and retry; keep batches sequential |
-| `400` with image feedback | Photo failed the vision pre-check | Reshoot per the message, or send `skip_validation: true` |
+| `429 rate_limited` | Per-IP hourly window exhausted (about 60 free generations an hour) | Back off and retry; keep batches sequential |
+| `422 image_not_usable` | Photo failed the vision pre-check | Reshoot per the `message`, or send `skip_validation: true` |
+| `402` on `tier: "high"` | High tier is hold-or-pay on platform engines | Hold $THREE (Bronze), pay per generation, use credits, or use the x402 endpoint |
| `status: "failed"` mid-job | Upstream generation error | Read `error`; retry once — transient provider errors happen |
| `glb_url` 404s later | You waited a long time to download | Download promptly after `done`; re-fetch the job for a fresh URL |
@@ -53620,7 +61067,7 @@ If you've never made an x402 call, start with [Build a paid x402 endpoint](/tuto
---
-<a id="sec-229"></a>
+<a id="sec-282"></a>
> **Source:** `docs/tutorials/getting-started.md` · [↑ table of contents](#table-of-contents)
@@ -53791,7 +61238,7 @@ Everything is editable forever — swap the body, rewrite the prompt, add capabi
---
-<a id="sec-230"></a>
+<a id="sec-283"></a>
> **Source:** `docs/tutorials/greeting-and-first-speech.md` · [↑ table of contents](#table-of-contents)
@@ -54137,7 +61584,7 @@ A working greeting moves the embed from "decoration" to "interaction", which is
---
-<a id="sec-231"></a>
+<a id="sec-284"></a>
> **Source:** `docs/tutorials/image-to-3d.md` · [↑ table of contents](#table-of-contents)
@@ -54173,7 +61620,7 @@ Go to [three.ws/forge](/forge) and switch to the **From photos** tab.
You'll see a grid of four upload slots. Drag your photos in, or click a slot to browse. After uploading you can **drag the thumbnails to reorder** them — put your best, clearest shot first.
-**No object on hand? Draw it.** Click **Or draw it instead** below the grid to open an in-browser drawing canvas — draw with your mouse, finger, or stylus, then **Use sketch** to drop the PNG straight into the next open slot. It goes through the exact same reconstruction pipeline as an uploaded photo, so simple objects with a clear outline (a mug, a low-poly rocket, a chair silhouette) work well; photorealistic detail obviously won't appear from a line drawing. Nothing is uploaded while you draw — only when you click **Use sketch**, and cancelling discards it with zero network activity.
+**No object on hand? Draw it.** The Forge also takes drawings, two ways. On this page, the **From a sketch** tab (it appears when the sketch engine is live) takes one drawing plus a short required description of what it depicts: dark strokes on a light background work best, and the result is untextured geometry you can then **Stylize** or **Retexture**. In the [Forge Studio](/forge-studio), click **Or draw it instead** below the photo grid to open an in-browser drawing canvas: draw with your mouse, finger, or stylus, then **Use sketch** to drop the PNG straight into the next open slot, where it rides the same reconstruction pipeline as an uploaded photo. Nothing is uploaded while you draw, only when you click **Use sketch**; cancelling discards it with zero network activity.
---
@@ -54240,7 +61687,7 @@ Everything you generate is kept in **Your creations** at the bottom of the page,
---
-<a id="sec-232"></a>
+<a id="sec-285"></a>
> **Source:** `docs/tutorials/import-avatar-url.md` · [↑ table of contents](#table-of-contents)
@@ -54408,7 +61855,7 @@ The URL path and the file-upload path converge on the same avatar record and the
---
-<a id="sec-233"></a>
+<a id="sec-286"></a>
> **Source:** `docs/tutorials/js-api-events.md` · [↑ table of contents](#table-of-contents)
@@ -54874,7 +62321,7 @@ The `whenReady`, awaited-`ask()`, and try/catch patterns are small but they remo
---
-<a id="sec-234"></a>
+<a id="sec-287"></a>
> **Source:** `docs/tutorials/mcp-server-for-your-agent.md` · [↑ table of contents](#table-of-contents)
@@ -55520,7 +62967,7 @@ Things that look right but bite you:
---
-<a id="sec-235"></a>
+<a id="sec-288"></a>
> **Source:** `docs/tutorials/mine-vanity-address.md` · [↑ table of contents](#table-of-contents)
@@ -55789,7 +63236,7 @@ The protocol itself is fully specified in [docs/PROTOCOL-vanity.md](../PROTOCOL-
---
-<a id="sec-236"></a>
+<a id="sec-289"></a>
> **Source:** `docs/tutorials/mint-pumpfun-token.md` · [↑ table of contents](#table-of-contents)
@@ -56141,7 +63588,7 @@ If you have a lawyer, talk to them before launching. If you don't, default to th
---
-<a id="sec-237"></a>
+<a id="sec-290"></a>
> **Source:** `docs/tutorials/multi-agent-coordination.md` · [↑ table of contents](#table-of-contents)
@@ -56701,7 +64148,7 @@ async function safeHandoff(targetEl, brief, fallbackEl, originalQuestion) {
---
-<a id="sec-238"></a>
+<a id="sec-291"></a>
> **Source:** `docs/tutorials/nvidia-3d-free.md` · [↑ table of contents](#table-of-contents)
@@ -56818,7 +64265,7 @@ It talks **directly** to a TRELLIS NIM and returns the GLB **synchronously** in
---
-<a id="sec-239"></a>
+<a id="sec-292"></a>
> **Source:** `docs/tutorials/nvidia-nim-self-host.md` · [↑ table of contents](#table-of-contents)
@@ -56994,7 +64441,7 @@ The proxy normalizes every documented artifact shape (inline `base64`, a bare st
---
-<a id="sec-240"></a>
+<a id="sec-293"></a>
> **Source:** `docs/tutorials/paid-x402-endpoint.md` · [↑ table of contents](#table-of-contents)
@@ -57686,7 +65133,7 @@ Both work. Choose based on whether your endpoint is part of an agent platform yo
---
-<a id="sec-241"></a>
+<a id="sec-294"></a>
> **Source:** `docs/tutorials/pay-for-x402-service.md` · [↑ table of contents](#table-of-contents)
@@ -57950,7 +65397,7 @@ package family is listed under [x402 → Open-source packages](/x402#open-source
---
-<a id="sec-242"></a>
+<a id="sec-295"></a>
> **Source:** `docs/tutorials/personal-ai-site.md` · [↑ table of contents](#table-of-contents)
@@ -58023,7 +65470,7 @@ When you receive the message "__greet", introduce yourself warmly: say who you a
Your avatar is the visual anchor of the whole experience. You have two paths:
-**Selfie-to-avatar** — Use the [Avatar Creation guide](../avatar-creation.md) to generate a 3D avatar from a photo. A few tips for PAI-quality results:
+**Selfie-to-avatar**: Use the [Avatar Creation guide](/docs/avatar-creation) to generate a 3D avatar from a photo. A few tips for PAI-quality results:
- Use a photo where you are looking straight ahead, with even lighting
- Wear what you would want to be "remembered" in — this avatar represents you
- Export as a Mixamo-rigged GLB so it picks up the built-in animation clips automatically
@@ -58082,7 +65529,7 @@ The LLM has access to these memories in every conversation turn. Update them ind
## Step 4: Build the site HTML
-Here is the full page. Replace the placeholder values in brackets and swap in your GLB URL and agent ID.
+Here is the full page. Replace the placeholder values in brackets and swap in your GLB URL.
```html
<!DOCTYPE html>
@@ -58214,7 +65661,6 @@ Here is the full page. Replace the placeholder values in brackets and swap in yo
<agent-3d
id="maya"
body="https://yourname.com/avatars/maya.glb"
- agent-id="your-agent-id"
brain="claude-opus-4-7"
style="height: calc(100% - 130px); display: block"
></agent-3d>
@@ -58281,33 +65727,68 @@ You can tune the greeting by editing the `__greet` instruction in your system pr
## Step 6: Connect 3D models to projects
-The most memorable part of a PAI site is when the avatar loads a project model mid-conversation. To set this up, install a custom skill that exposes `load_model` as a tool.
+The most memorable part of a PAI site is when the avatar loads a project model mid-conversation. To set this up, write a custom skill that exposes `load_project` as a tool.
-Create `skills/load-project/skill.md`:
+A skill is a directory ("bundle") of up to four files, served from your site like any other static assets:
-```markdown
-# load_project
+```
+skills/load-project/
+├── manifest.json metadata and what the skill provides
+├── SKILL.md instructions injected into the system prompt
+├── tools.json the tool schema the LLM can invoke
+└── handlers.js the implementation
+```
-Load a 3D GLB model of a named project into the viewer.
+`manifest.json`:
-## Tool definition
+```json
+{
+ "spec": "skill/0.1",
+ "name": "load-project",
+ "version": "0.1.0",
+ "description": "Load a 3D GLB model of a portfolio project into the viewer.",
+ "provides": { "tools": ["load_project"] }
+}
+```
+
+`tools.json`:
```json
{
- "name": "load_project",
- "description": "Load a 3D model of a portfolio project. Call this when the user asks to 'see' or 'show' a project.",
- "input_schema": {
- "type": "object",
- "properties": {
- "project": { "type": "string", "description": "The project name" },
- "url": { "type": "string", "description": "The GLB URL to load" }
- },
- "required": ["project", "url"]
- }
+ "tools": [
+ {
+ "name": "load_project",
+ "description": "Load a 3D model of a portfolio project. Call this when the user asks to 'see' or 'show' a project.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "project": { "type": "string", "description": "The project name" },
+ "url": { "type": "string", "description": "The GLB URL to load" }
+ },
+ "required": ["project", "url"]
+ }
+ }
+ ]
}
```
-## Handler
+`SKILL.md` (this markdown lands in the system prompt, so the project URL list lives here instead of in your main instructions):
+
+```markdown
+---
+name: load-project
+description: Load a 3D model of a named portfolio project.
+---
+
+When a visitor asks to see or look at a project, call `load_project`
+with the matching URL.
+
+Project model URLs:
+- Acme Dashboard: https://yourname.com/models/acme-dashboard.glb
+- Health App AR: https://yourname.com/models/health-ar.glb
+```
+
+`handlers.js`:
```js
export async function load_project({ project, url }, ctx) {
@@ -58315,19 +65796,19 @@ export async function load_project({ project, url }, ctx) {
return { ok: true, output: `Loaded 3D model for ${project}` };
}
```
-```
-
-Then add skill routing to your system prompt:
-```
-When a visitor asks to see or look at a project, call load_project with the relevant URL.
+Install it by adding the `skills` attribute to the element (or a `skills` entry in your manifest):
-Project model URLs:
-- Acme Dashboard: https://yourname.com/models/acme-dashboard.glb
-- Health App AR: https://yourname.com/models/health-ar.glb
+```html
+<agent-3d
+ id="maya"
+ body="https://yourname.com/avatars/maya.glb"
+ brain="claude-opus-4-7"
+ skills="https://yourname.com/skills/load-project/"
+></agent-3d>
```
-Now when a visitor says "show me the health app", the agent will call `load_project`, which calls `ctx.loadGLB()` on the scene controller, swapping the avatar's environment for the project model.
+Now when a visitor says "show me the health app", the agent calls `load_project`, which calls `ctx.loadGLB()` on the scene controller, swapping the avatar's environment for the project model. The full authoring reference (context API, sandboxing, publishing) is in the [Skills system](/docs/skills) doc, and [Build a custom skill](/docs/tutorials/custom-skill) walks through a bundle end to end.
---
@@ -58463,15 +65944,15 @@ The technical investment is one HTML file, a GLB avatar, and a system prompt. Th
## Next steps
-- [Avatar Creation guide](../avatar-creation.md) — detailed walkthrough of selfie-to-avatar
-- [Skills system](../skills.md) — how to install and author custom skills like `load_project`
-- [Memory system](../memory.md) — full memory API reference for pre-loading knowledge
-- [Agent Manifest](../agent-manifest.md) — package your agent for distribution and on-chain identity
-- [Embedding guide](../embedding.md) — add your agent to other pages and platforms
+- [Avatar Creation guide](/docs/avatar-creation): detailed walkthrough of selfie-to-avatar
+- [Skills system](/docs/skills): how to install and author custom skills like `load_project`
+- [Memory system](/docs/memory): full memory API reference for pre-loading knowledge
+- [Agent Manifest](/docs/agent-manifest): package your agent for distribution and on-chain identity
+- [Embedding guide](/docs/embedding): add your agent to other pages and platforms
---
-<a id="sec-243"></a>
+<a id="sec-296"></a>
> **Source:** `docs/tutorials/place-agent-irl.md` · [↑ table of contents](#table-of-contents)
@@ -58606,8 +66087,11 @@ The agent locks to its spot. The status line confirms with something like *"Pinn
There are a few placement paths depending on your device and intent:
-- **Pin here** — drops the agent at your current GPS spot using the camera + gyro. This is the default and works on every supported phone, including iOS Safari.
-- **Place on floor** — appears only when your browser supports a WebXR `immersive-ar` session (Chrome on Android with ARCore). It uses real hit-test surface detection: sweep your phone slowly to find the floor, and the agent anchors to the detected plane. A green check confirms the anchor took.
+- **Place in AR** — leads the dock whenever the device has a real AR surface.
+ - On Chrome for Android (ARCore) it opens a WebXR `immersive-ar` session with real hit-test surface detection: sweep your phone slowly, a reticle finds the floor, and a tap anchors the agent to the detected plane. A green check confirms the anchor took.
+ - **Pinch with two fingers to resize** the anchored agent, anywhere from 25% (a desk figurine) to 400% (a statue). The size persists to the pin (the pinch lands as a follow-up `PATCH /api/irl/pins { id, scale }` after the placement tap), so everyone who walks up later sees the agent exactly as big as you left it. Natural size is the default.
+ - On iOS the same button opens the agent in ARKit Quick Look with its idle animation baked into the USDZ, so it moves in your room instead of standing in a T-pose.
+- **Pin here** — drops the agent at your current GPS spot using the camera + gyro. Works on every supported phone, including iOS Safari.
- **Place on map** — pick a spot on a map instead of using your live position, useful for placing an agent somewhere you're not standing.
### Signed-in vs anonymous pins
@@ -58680,7 +66164,7 @@ IRL renders the scene with WebGL. If your browser lacks it, you'll see a designe
This is the motion sensor. On iOS, IRL needs a one-time **Motion & Orientation** permission granted via a tap — accept it when prompted, or re-request it from the recovery chip. Without the gyroscope, the agent can't stay anchored as you rotate the phone.
-### "Place on floor" button never appears
+### "Place in AR" button never appears
That button is the WebXR hit-test path, available only where the browser supports an `immersive-ar` session (Chrome on Android with ARCore). iOS Safari has no `immersive-ar`, so it stays on the **Pin here** gyro + GPS path — which works fine; you just don't get plane hit-testing. Desktop never shows it (no camera passthrough).
@@ -58716,7 +66200,7 @@ This is fundamentally different from viewing a single model in AR. If you only n
---
-<a id="sec-244"></a>
+<a id="sec-297"></a>
> **Source:** `docs/tutorials/prompts-for-3d.md` · [↑ table of contents](#table-of-contents)
@@ -58852,7 +66336,7 @@ The tiers are explained in detail in [the text-to-3D tutorial](/tutorials/text-t
---
-<a id="sec-245"></a>
+<a id="sec-298"></a>
> **Source:** `docs/tutorials/register-onchain.md` · [↑ table of contents](#table-of-contents)
@@ -59038,9 +66522,9 @@ Your agent now has:
- An **on-chain ID** — a number unique to this registry (e.g., `42`)
- A **permanent URL**: `https://three.ws/a/8453/42`
-- A **Passport widget** visible at that URL showing your ERC-8004 identity
+- An **on-chain identity card** visible at that URL showing your ERC-8004 registration
-Open your agent's URL in a new tab. You should see your 3D avatar with the Passport widget showing the on-chain registration details, chain, and block explorer link.
+Open your agent's URL in a new tab. You should see your 3D avatar with the identity card showing the agent's name, on-chain ID, and chain.
---
@@ -59052,17 +66536,30 @@ Your on-chain URL works anywhere. Try these:
Share `https://three.ws/a/8453/42` on Twitter/X, Farcaster, or Lens. Anyone who clicks it sees your verified agent — no account required.
**Add to your website:**
-Drop the Passport widget in anywhere HTML is accepted:
+Drop the agent's embed iframe in anywhere HTML is accepted:
+
+```html
+<iframe
+ src="https://three.ws/a/8453/42/embed"
+ width="360"
+ height="480"
+ frameborder="0"
+ allow="microphone"
+ style="border-radius: 16px;"
+></iframe>
+```
+
+Or embed the interactive agent with the web component, addressing it by its on-chain ID:
```html
<script type="module" src="https://three.ws/agent-3d/latest/agent-3d.js"></script>
-<agent-3d widget="passport" agent-id="8453:0xRegistryAddress:42"></agent-3d>
+<agent-3d agent-id="42" chain-id="8453"></agent-3d>
```
-Replace `0xRegistryAddress` with the Identity Registry contract address shown on Basescan, and `42` with your agent ID.
+For a standalone identity card (the Passport widget: registration JSON, reputation, validation), open the [Widget Studio](https://three.ws/studio), pick the **Passport** widget type, enter your chain and agent ID, and copy the generated snippet.
**Generate a QR code:**
-On your agent's page, click the QR icon in the Passport widget. A scannable code appears — save it or screenshot it for physical printouts, conference badges, or business cards.
+Your agent URL is a plain link, so any QR generator turns it into a scannable code, handy for physical printouts, conference badges, or business cards.
**Include it in a README or profile:**
A Markdown link works: `[My three.ws](https://three.ws/a/8453/42)`
@@ -59071,13 +66568,13 @@ A Markdown link works: `[My three.ws](https://three.ws/a/8453/42)`
## Step 10: Build your reputation
-Your agent's page at `https://three.ws/a/8453/42` has a **Reputation** section. Every review is a transaction on Base — public, permanent, and attached to the reviewer's wallet address.
+Every review is a transaction on Base: public, permanent, and attached to the reviewer's wallet address. The public review surface is [three.ws/reputation](https://three.ws/reputation), where anyone can view and submit on-chain reviews for any agent.
**Ask others to leave a review:**
-1. Send them your agent URL
-2. They scroll to the Reputation section
-3. They connect their wallet and click **Leave a review**
+1. Send them your agent's chain and ID (or just your agent URL)
+2. They open [three.ws/reputation](https://three.ws/reputation) and look up your agent
+3. They connect their wallet
4. They pick a score (1–5 stars, stored on-chain as a signed −100..+100 value) and optionally add a comment
5. They confirm the transaction (~$0.05 gas)
@@ -59121,8 +66618,7 @@ If you own an ENS name like `yourname.eth`, you can make it resolve to your agen
In your agent's manifest or on the registration page, add a `claims` entry pointing back at your ENS name. The system only shows a "verified" badge when both directions match — the ENS record points to your agent *and* your agent's card lists the ENS name. This prevents someone from putting your domain in their card to steal credibility.
-Once set, your agent is accessible at:
-`https://three.ws/agent/ens/yourname.eth`
+Once set, resolvers can look up `yourname.eth` and get your agent's CAIP-10 identifier, and the platform API at `https://three.ws/api/agents/ens/yourname.eth` lists the agents registered to the address your name resolves to.
---
@@ -59180,9 +66676,16 @@ Now that your agent has an on-chain identity, you can:
Your agent's URL will keep working as long as Base exists and IPFS gateways serve the pinned content — which is designed to be indefinite.
+## Related
+
+- [ERC-8004 reference](/docs/erc8004): the full spec walkthrough, from contracts to registration JSON to ENS/DNS binding
+- [Agent reputation tutorial](/docs/tutorials/agent-reputation): reading and submitting on-chain reviews in depth
+- [Solana agent reputation](/docs/tutorials/solana-agent-reputation): the same trust primitives on the home chain
+- [Reputation reference](/docs/reputation): score encoding, staking, and the reputation API
+
---
-<a id="sec-246"></a>
+<a id="sec-299"></a>
> **Source:** `docs/tutorials/self-host-agent-backend.md` · [↑ table of contents](#table-of-contents)
@@ -59758,7 +67261,7 @@ A self-hosted instance with light traffic runs at $20–50/month all-in. The dom
---
-<a id="sec-247"></a>
+<a id="sec-300"></a>
> **Source:** `docs/tutorials/selfie-to-avatar.md` · [↑ table of contents](#table-of-contents)
@@ -60006,7 +67509,7 @@ The result is a standard `.glb` that animates in the [Animation Studio](/pose),
---
-<a id="sec-248"></a>
+<a id="sec-301"></a>
> **Source:** `docs/tutorials/share-your-agent.md` · [↑ table of contents](#table-of-contents)
@@ -60332,7 +67835,7 @@ The agent's URL is the durable handle. Embed it, link it, print it. The agent sh
---
-<a id="sec-249"></a>
+<a id="sec-302"></a>
> **Source:** `docs/tutorials/shopify-store-guide-advanced.md` · [↑ table of contents](#table-of-contents)
@@ -60642,7 +68145,7 @@ The clip URLs inside the manifest resolve **relative to the manifest**, so a sel
---
-<a id="sec-250"></a>
+<a id="sec-303"></a>
> **Source:** `docs/tutorials/shopify-store-guide.md` · [↑ table of contents](#table-of-contents)
@@ -60731,7 +68234,7 @@ It's powered by the open-source [`@three-ws/tour`](https://www.npmjs.com/package
---
-<a id="sec-251"></a>
+<a id="sec-304"></a>
> **Source:** `docs/tutorials/skill-with-database-auth.md` · [↑ table of contents](#table-of-contents)
@@ -61469,7 +68972,7 @@ Before this skill faces a real visitor:
---
-<a id="sec-252"></a>
+<a id="sec-305"></a>
> **Source:** `docs/tutorials/solana-agent-reputation.md` · [↑ table of contents](#table-of-contents)
@@ -61652,7 +69155,7 @@ A read costs nothing and asks no one's permission — which is exactly what lets
---
-<a id="sec-253"></a>
+<a id="sec-306"></a>
> **Source:** `docs/tutorials/sperax-tour.md` · [↑ table of contents](#table-of-contents)
@@ -61823,7 +69326,7 @@ This is covered by an automated test — [`tour-sdk/test/director.test.mjs`](htt
---
-<a id="sec-254"></a>
+<a id="sec-307"></a>
> **Source:** `docs/tutorials/swap-avatar-in-studio.md` · [↑ table of contents](#table-of-contents)
@@ -62083,7 +69586,7 @@ The key insight is the snippet's stability. Once embedded, your customers' pages
---
-<a id="sec-255"></a>
+<a id="sec-308"></a>
> **Source:** `docs/tutorials/text-to-3d.md` · [↑ table of contents](#table-of-contents)
@@ -62123,7 +69626,7 @@ Three habits that make prompts work dramatically better:
Want more recipes? There's a whole cookbook: [Prompt Recipes for 3D Generation](/tutorials/prompts-for-3d).
-**Prefer to talk?** Click the mic button next to the prompt box and describe the object out loud — the transcript drops straight into the same field, ready to edit before you generate. It uses your browser's built-in speech recognition where available, with a free cross-browser fallback (NVIDIA Riva) for browsers that don't have one (mainly Firefox). Nothing is written to disk on either path — the browser path never leaves your device, and the fallback path transcribes in memory and discards the audio once it replies. If neither is available the mic button simply doesn't appear — type instead.
+**Prefer to talk?** The Forge Studio variant at [three.ws/forge-studio](/forge-studio) has a mic button next to each prompt box: describe the object out loud and the transcript drops straight into the field, ready to edit before you generate. It uses your browser's built-in speech recognition where available, with a free cross-browser fallback (NVIDIA Riva) for browsers that don't have one (mainly Firefox). Nothing is written to disk on either path: the browser path never leaves your device, and the fallback path transcribes in memory and discards the audio once it replies. If neither is available the mic button simply doesn't appear.
---
@@ -62133,12 +69636,14 @@ Below the prompt are three quality buttons:
| Tier | What you get | When to use it |
|------|-------------|----------------|
-| **Draft** | Fast, low-poly (~12k triangles), no textures | Trying ideas. Generate five drafts, keep the best shape. |
+| **Draft** | Fast, low-poly (~12k triangles) | Trying ideas. Generate five drafts, keep the best shape. |
| **Standard** | Balanced detail (~30k triangles) | The default. Right for most assets. |
| **High** | Maximum detail (~200k triangles) + PBR materials (metallic, roughness, normals) | The final version, once the prompt is dialed in. Slower. |
**Start with Draft or Standard.** The pro workflow is: iterate cheap and fast, then re-run your winning prompt on High.
+**High is the premium tier.** Draft and Standard are free for everyone. High unlocks for $THREE holders (Bronze tier, $25 held) and shows a lock otherwise; a non-holder can pay for a single High generation, or spend prepaid credits, right from the tier picker. If you bring your own Meshy or Tripo key, High is not gated (you pay the vendor directly).
+
You can leave the **Engine** selector alone — the Forge picks a sensible default. (If you have your own [Meshy](https://meshy.ai) or [Tripo](https://www.tripo3d.ai) API key, you can select those engines and paste your key into the field that appears — it stays in your browser and is never stored. Skip this entirely for now.)
---
@@ -62191,7 +69696,7 @@ This is normal — prompt, generate, adjust, repeat is the workflow, not a failu
| Surface looks flat or plasticky | Name the material explicitly, or switch to the **High** tier for PBR textures |
| Extra junk attached to the model | Your prompt described a scene. Cut it down to just the object |
| Shape is mushy or vague | Be more specific: "a four-legged armchair with a tall back" beats "a chair" |
-| "Generation limit reached" | The Forge is rate-limited per visitor. Wait a minute and try again |
+| "Generation limit reached" | The free lane allows about 60 generations per hour per visitor ($THREE holders get more). Wait a bit and try again |
| Model never finishes | Refresh the page — your job keeps running and your creations gallery keeps the result |
---
@@ -62205,7 +69710,7 @@ This is normal — prompt, generate, adjust, repeat is the workflow, not a failu
---
-<a id="sec-256"></a>
+<a id="sec-309"></a>
> **Source:** `docs/tutorials/trigger-from-page-events.md` · [↑ table of contents](#table-of-contents)
@@ -62709,7 +70214,7 @@ The pattern under all of these is the same: every recipe starts with `whenReady(
---
-<a id="sec-257"></a>
+<a id="sec-310"></a>
> **Source:** `docs/tutorials/upload-custom-glb.md` · [↑ table of contents](#table-of-contents)
@@ -63105,7 +70610,7 @@ Once the body is on the platform, the embed snippet doesn't change. The same `<a
---
-<a id="sec-258"></a>
+<a id="sec-311"></a>
> **Source:** `docs/tutorials/view-in-ar.md` · [↑ table of contents](#table-of-contents)
@@ -63130,7 +70635,7 @@ You need a model before you can place it in AR. The fastest way is to generate o
1. Go to [three.ws/forge](https://three.ws/forge)
2. Type a description — something concrete works best: **a ceramic coffee mug with a handle** or **a low-poly red fox sitting down**
-3. Hit **Forge** and wait 30–90 seconds for the model to generate
+3. Hit **Generate** and wait 30-90 seconds for the model to generate
You can also use any existing avatar from [three.ws/gallery](https://three.ws/gallery) — the AR tab exists on every avatar and Forge model page.
@@ -63139,10 +70644,10 @@ You can also use any existing avatar from [three.ws/gallery](https://three.ws/ga
## Step 2 — Open the model on your phone
**If you're already on your phone:**
-The Forge result screen has a **View in AR** button in the toolbar. Tap it.
+The Forge result screen has a **View in AR** button in the toolbar. Tap it and AR launches straight from the page.
**If you're on desktop:**
-After the model generates, switch to the **AR** tab in the model viewer. A QR code appears. Scan it with your phone's camera. On iPhone it opens Safari; on Android it opens Chrome. The AR experience opens automatically — no extra taps required.
+Click the same **View in AR** button. A **See it in your space** panel opens with a QR code. Scan it with your phone's camera: the model opens in the phone's browser with a big **View in AR** launcher, one tap from AR.
---
@@ -63165,11 +70670,13 @@ The model stays anchored as you move — if you step back, it doesn't follow you
Three different AR systems power this feature, selected automatically:
### iPhone (Safari) → iOS Quick Look
-Safari intercepts a click on a special `<a rel="ar">` link and opens Apple's native AR viewer. The model renders at true scale using ARKit. No app required because Quick Look is built into iOS. The tradeoff: no animations, no conversation with the agent.
+Safari intercepts a click on a special `<a rel="ar">` link and opens Apple's native AR viewer. The model renders at true scale using ARKit. No app required because Quick Look is built into iOS. Rigged avatars arrive with their idle animation baked in, so they breathe and sway instead of standing frozen. The tradeoff: only that one clip plays, and there's no conversation with the agent.
To make this work, three.ws either:
- Serves a pre-generated **USDZ file** (Apple's AR format) if one exists
-- Converts the GLB to USDZ **in-browser** using the three.js USDZExporter if not — this takes a few seconds
+- Bakes an **animated USDZ in-browser** (the avatar's idle clip sampled into
+ Quick Look's native time-sampled format) if not — this takes a few seconds,
+ and falls back to a static-pose conversion if the model has no usable rig
### Android (Chrome) → Scene Viewer
Chrome launches Google's **Scene Viewer** via an ARCore intent URL. Scene Viewer is a Google app that comes pre-installed on most Android phones with Google Play. It supports GLB files directly and plays animations. No conversion step needed.
@@ -63181,20 +70688,28 @@ If the above methods aren't available, three.ws starts a **WebXR immersive-ar se
## Step 5 — Add AR to your own embed
-If you've embedded a three.ws agent on your website, enabling AR takes one attribute:
+There are three ways to offer AR from your own page, depending on how you embed.
+
+**Lightweight model viewer (`<three-ws-viewer>`).** The [`@three-ws/avatar`](https://www.npmjs.com/package/@three-ws/avatar) SDK's viewer element takes a boolean `ar` attribute:
```html
-<script type="module"
- src="https://three.ws/agent-3d/latest/agent-3d.js"
-></script>
+<script type="module">
+ import '@three-ws/avatar/viewer';
+</script>
-<agent-3d
- id="your-agent-id"
+<three-ws-viewer
+ src="https://three.ws/cdn/your-model.glb"
ar
-></agent-3d>
+></three-ws-viewer>
```
-The `ar` attribute is all you need. The AR button appears automatically on mobile devices that support it. On desktop, it's hidden — no desktop browser supports `immersive-ar`.
+With `ar` present, a **View in AR** button appears on the viewer. Clicking it opens the platform's device-aware launcher (`https://three.ws/api/ar?src=...`) in a new tab: Android gets Scene Viewer, iOS gets Quick Look, desktop falls back to the interactive web viewer.
+
+**Full agent embed (`<agent-3d>`).** The talking-agent web component does not take an `ar` attribute. To offer AR next to it, link to the avatar's dedicated full-screen AR page, which picks the right method per device automatically:
+
+```html
+<a href="https://three.ws/avatars/YOUR_AVATAR_ID/ar">See it in your room</a>
+```
### Iframe embed + AR
@@ -63280,7 +70795,7 @@ AR surface detection needs a moment to work. Move the phone slowly over the targ
---
-<a id="sec-259"></a>
+<a id="sec-312"></a>
> **Source:** `docs/tutorials/voice-and-lipsync.md` · [↑ table of contents](#table-of-contents)
@@ -63511,7 +71026,7 @@ The leverage is that the avatar drives its mouth from the *audio it actually pla
---
-<a id="sec-260"></a>
+<a id="sec-313"></a>
> **Source:** `docs/tutorials/walk-companion.md` · [↑ table of contents](#table-of-contents)
@@ -63864,7 +71379,7 @@ The leverage is composability: the same engine renders the corner mascot, the fu
---
-<a id="sec-261"></a>
+<a id="sec-314"></a>
> **Source:** `docs/tutorials/web-component-end-to-end.md` · [↑ table of contents](#table-of-contents)
@@ -64465,7 +71980,7 @@ The web component is the most robust integration point the platform offers. Buil
---
-<a id="sec-262"></a>
+<a id="sec-315"></a>
> **Source:** `docs/ui-juice.md` · [↑ table of contents](#table-of-contents)
@@ -64627,7 +72142,7 @@ should reach for these primitives rather than re-rolling RAF loops.
---
-<a id="sec-263"></a>
+<a id="sec-316"></a>
> **Source:** `docs/ux-flows/01-onboarding-creation.md` · [↑ table of contents](#table-of-contents)
@@ -64833,7 +72348,7 @@ should reach for these primitives rather than re-rolling RAF loops.
---
-<a id="sec-264"></a>
+<a id="sec-317"></a>
> **Source:** `docs/ux-flows/02-forge-text-to-3d.md` · [↑ table of contents](#table-of-contents)
@@ -64909,6 +72424,9 @@ Routing facts (from `vercel.json`):
- Payment: `forge-pay.js` → `src/token-pay.js` → `/api/token/quote` + `/api/token/settle` ($THREE)
- Access/tier pass: `/api/three/access` (read) + tier-pass mint (referenced via `attachTierPass`/`getTierPass`)
- Generation engines: FLUX (image) → TRELLIS (mesh) free lane; BYOK Meshy / Tripo / Rodin / Stability / Replicate; Hunyuan3D / TripoSG (sketch). Hosted on NVIDIA NIM / providers; same pipeline exposed to agents over MCP at `/api/mcp-3d`.
+ - **Photoreal reference-image path (the realism lever):** the final mesh reads as real only if the reference image the reconstructor sees is a photoreal, single-subject, plain-seamless-background, evenly-lit photograph. Two pieces drive that:
+ - `POST /api/forge-enhance` (director): rewrites the raw prompt into one centered real-world subject with material + surface micro-detail + neutral studio-lighting cues. It classifies the subject (person / animal / vehicle / food / object) and returns a `subject`-aware `negative_prompt` targeting that class's failure modes (hands/faces for people, wheel-count/panel symmetry for vehicles, plastic-replica sheen for food). It prefers a Vertex Gemini rewrite (GCP credits) and falls through to the free-first LLM chain automatically, so it never hard-depends on Vertex. Response schema is unchanged apart from the additive `subject` field.
+ - `api/_lib/forge-reference-image.js` → `generateReferenceImage(directedPrompt, { aspectRatio, negativePrompt?, seed, skipNim })`: generates the reconstruction reference image on the Vertex Gemini 2.5 Flash Image lane (`imageConfig.imageSize:"2K"`), tuned as a plain-background studio photo, with the director's negatives folded in as natural-language avoidance. Additive with automatic fallthrough to the existing provider chain (`textToImage`: NIM FLUX free → Vertex Imagen → Replicate), returning the same `{ imageUrl, model }` shape. When `negativePrompt` is omitted it derives subject-aware negatives from the prompt itself, so a caller gets them for free. The `api/forge.js` text→3D path can adopt it as a drop-in replacement for its `textToImage(directedPrompt, …)` call.
- 3rd-party viewer: model-viewer 4.0.0 (googleapis CDN).
- **Success state:** A textured **GLB** standing in the in-page `<model-viewer>` (orbit/AR), auto-saved to "Your creations", with a downloadable file and all post-processing/export/embed/share actions enabled. Optional converted formats (OBJ/STL/PLY/USDZ/FBX) and a community showcase entry.
- **Empty / error states:**
@@ -65003,7 +72521,7 @@ Routing facts (from `vercel.json`):
---
-<a id="sec-265"></a>
+<a id="sec-318"></a>
> **Source:** `docs/ux-flows/03-3d-editing-viewer.md` · [↑ table of contents](#table-of-contents)
@@ -65209,7 +72727,7 @@ Routing summary (from `vite.config.js`):
---
-<a id="sec-266"></a>
+<a id="sec-319"></a>
> **Source:** `docs/ux-flows/04-embed-widget-studio.md` · [↑ table of contents](#table-of-contents)
@@ -65383,7 +72901,7 @@ Routing recap (from `vercel.json`):
---
-<a id="sec-267"></a>
+<a id="sec-320"></a>
> **Source:** `docs/ux-flows/05-discovery-social.md` · [↑ table of contents](#table-of-contents)
@@ -65654,7 +73172,7 @@ Routing recap (from `vercel.json`):
---
-<a id="sec-268"></a>
+<a id="sec-321"></a>
> **Source:** `docs/ux-flows/06-marketplace-skills.md` · [↑ table of contents](#table-of-contents)
@@ -65868,7 +73386,7 @@ Routing facts confirmed in `vercel.json`:
---
-<a id="sec-269"></a>
+<a id="sec-322"></a>
> **Source:** `docs/ux-flows/07-crypto-trading-analytics.md` · [↑ table of contents](#table-of-contents)
@@ -66217,7 +73735,7 @@ coin-intel, pump-visualizer and pump-live — adding a coin on any surface shows
---
-<a id="sec-270"></a>
+<a id="sec-323"></a>
> **Source:** `docs/ux-flows/08-coin-launch-wallets.md` · [↑ table of contents](#table-of-contents)
@@ -66490,7 +74008,7 @@ real Solana/EVM RPC, pump.fun, and x402 — no mocks.
---
-<a id="sec-271"></a>
+<a id="sec-324"></a>
> **Source:** `docs/ux-flows/09-x402-agent-commerce.md` · [↑ table of contents](#table-of-contents)
@@ -66832,7 +74350,7 @@ choreographed two-agent narrative driven by Server-Sent Events.
---
-<a id="sec-272"></a>
+<a id="sec-325"></a>
> **Source:** `docs/ux-flows/10-chat-brain-labs.md` · [↑ table of contents](#table-of-contents)
@@ -67074,7 +74592,7 @@ modules. Routes resolved via `vercel.json` rewrites.
---
-<a id="sec-273"></a>
+<a id="sec-326"></a>
> **Source:** `docs/ux-flows/11-account-dashboard.md` · [↑ table of contents](#table-of-contents)
@@ -67248,16 +74766,17 @@ Shared auth concepts:
- **Prerequisites / gates:** Signed-in required (`requireUser()`; 401 → `/login?return=…`).
- **Steps (N):**
1. Boot: `mountShell()` → `requireUser()`; 4 skeletons while data loads.
- 2. Parallel fetch: `GET /api/auth/sessions`, `GET /api/notifications?limit=20`, `GET /api/billing/summary` (storage), `GET /api/usage/summary` (LLM usage), plus dashboard prefs.
- 3. Render sections: **Appearance/theme**, **Active sessions**, **Notifications**, **Default payment network**, **Storage usage**, **LLM usage**, **Vanity wallet tools**, **Preferences**, **Data export**, **About**.
+ 2. Parallel fetch: `GET /api/auth/sessions`, `GET /api/notifications?limit=20`, `GET /api/notifications/preferences`, `GET /api/billing/summary` (storage), `GET /api/usage/summary` (LLM usage), plus dashboard prefs.
+ 3. Render sections: **Appearance/theme**, **Active sessions**, **Notifications**, **Notification preferences**, **Default payment network**, **Storage usage**, **LLM usage**, **Vanity wallet tools**, **Preferences**, **Data export**, **About**.
4. **(optional) Theme:** click Dark/Light/Auto → `localStorage['twx_theme']` (+ `window.threeTheme.set`) → toast "Theme applied" (no API).
5. **(optional) Sessions:** "Revoke" → `DELETE /api/auth/sessions/{id}` → toast + row removed; "Revoke all other" → `POST /api/auth/sessions/revoke-others` → toast.
- 6. **(optional) Notifications:** "Mark all read" → `POST /api/notifications/read-all` → toast.
+ 6. **(optional) Notifications:** "Mark all read" → `POST /api/notifications/read-all` → toast. The inbox covers the full bell vocabulary (sales, purchases, follows, remixes, DMs, coin-launch graduations, IRL, market, account).
+ 6b. **(optional) Notification preferences:** the category × channel matrix (categories: sales, purchases, social, IRL, market, account; channels: in-app, push, email, Telegram) → `PATCH /api/notifications/preferences` per toggle → toast. The in-app channel is always on and rendered disabled.
7. **(optional) Default network:** Base/Solana/Polygon → `localStorage['twx_default_network']` + best-effort `PATCH /api/dashboard/prefs` `{ prefs: { default_network } }` → toast.
8. **(optional) Preferences:** toggle email notifications / show tips / compact sidebar → **Save preferences** → `PATCH /api/dashboard/prefs` `{ prefs }` → toast "Preferences saved".
9. **(optional) Data export:** Agents / Avatars / All → fetch `GET /api/agents`, `GET /api/avatars?limit=100`, `GET /api/widgets` → build JSON blob → browser download → toast "Data exported".
- **Decision points / branches:** Theme, default network, and privacy-style toggles are local-first (localStorage) with best-effort prefs sync; sessions/notifications/export hit live APIs. Read-only meters for storage/LLM usage.
-- **External calls / dependencies:** `GET /api/auth/me`, `GET /api/auth/sessions`, `DELETE /api/auth/sessions/{id}`, `POST /api/auth/sessions/revoke-others`, `GET /api/notifications`, `POST /api/notifications/read-all`, `GET /api/billing/summary`, `GET /api/usage/summary`, `PATCH /api/dashboard/prefs`, `GET /api/agents`, `GET /api/avatars`, `GET /api/widgets`.
+- **External calls / dependencies:** `GET /api/auth/me`, `GET /api/auth/sessions`, `DELETE /api/auth/sessions/{id}`, `POST /api/auth/sessions/revoke-others`, `GET /api/notifications`, `POST /api/notifications/read-all`, `GET /api/notifications/preferences`, `PATCH /api/notifications/preferences`, `GET /api/billing/summary`, `GET /api/usage/summary`, `PATCH /api/dashboard/prefs`, `GET /api/agents`, `GET /api/avatars`, `GET /api/widgets`.
- **Success state:** Toasts on each action (Theme applied / Session revoked / All notifications marked read / Default network set / Preferences saved / Data exported); sections reflect new state.
- **Empty / error states:** "No session data", "No notifications" / "You're all caught up", "No usage data"; per-action error toasts with button re-enable for retry; skeletons during load.
- **Step count:** 3 required (boot + fetch + render) (+6 optional setting flows)
@@ -67293,7 +74812,7 @@ Shared auth concepts:
---
-<a id="sec-274"></a>
+<a id="sec-327"></a>
> **Source:** `docs/ux-flows/12-home-and-content.md` · [↑ table of contents](#table-of-contents)
@@ -67481,7 +75000,7 @@ All `/.well-known/*` and `/openapi.json` / `/sitemap.xml` responses are JSON/XML
---
-<a id="sec-275"></a>
+<a id="sec-328"></a>
> **Source:** `docs/validation.md` · [↑ table of contents](#table-of-contents)
@@ -67499,8 +75018,8 @@ The validator measures conformance against the glTF 2.0 specification and report
|----------|------|---------|
| Error | 0 | Spec violation. Fix before publishing — some renderers will refuse to load the file. |
| Warning | 1 | Non-conformant but likely to load. Behavior in different renderers may differ. |
-| Hint | 2 | Best-practice suggestion. Not a problem, but worth addressing. |
-| Info | 3 | Informational only. No action needed. |
+| Info | 2 | Informational only. No action needed. |
+| Hint | 3 | Best-practice suggestion. Not a problem, but worth addressing. |
A model passes validation when `numErrors === 0`. Warnings, hints, and infos are allowed for a pass verdict.
@@ -67524,7 +75043,7 @@ Every validation produces a structured report. Here is what each field means.
}
```
-`maxSeverity` is the code of the most severe non-empty bucket (`0` = errors present, `1` = warnings only, `3` = hints only, `-1` = completely clean).
+`maxSeverity` is the code of the most severe non-empty bucket (`0` = errors present, `1` = warnings only, `2` = infos, `3` = hints only, `-1` = completely clean).
### Individual messages
@@ -67578,6 +75097,7 @@ Validation runs automatically after every model load. The result appears in the
- `N errors.` — errors found; click to expand the full report
- `N warnings.` — warnings only
- `N hints.` — hints only
+- `N notes.`: infos only
- `Model details` — clean; no issues
Clicking the bar opens the full **ValidatorReport** panel, which shows the model metadata, a summary banner, and per-severity tables of messages.
@@ -67638,7 +75158,7 @@ Validation results can be attested on-chain through two complementary mechanisms
### ValidationRegistry (ERC-8004)
-For registered agents, a validation record can be written to the `ValidationRegistry` smart contract on Base (chain ID 8453):
+For registered agents, a validation record can be written to the `ValidationRegistry` smart contract. The registry is currently deployed on the testnets only (e.g. Base Sepolia, chain ID 84532); mainnet deployment is pending, so use a testnet chain ID:
```js
import { recordValidation, hashReport, reportPassed } from './src/erc8004/validation-recorder.js';
@@ -67651,7 +75171,7 @@ const { txHash, proofHash, proofURI } = await recordValidation({
agentId: 42,
report: validationReport,
signer: connectedWallet, // must be an allow-listed validator address
- chainId: 8453,
+ chainId: 84532, // Base Sepolia (ValidationRegistry is testnet-only for now)
apiToken: IPFS_API_TOKEN, // for pinning
pin: true,
});
@@ -67763,11 +75283,11 @@ The signing message binds together the agent ID, a SHA-256 hash of the GLB bytes
import { getLatestValidation } from './src/erc8004/validation-recorder.js';
import { ethers } from 'ethers';
-const provider = new ethers.JsonRpcProvider('https://mainnet.base.org');
+const provider = new ethers.JsonRpcProvider('https://sepolia.base.org');
const record = await getLatestValidation({
agentId: 42,
runner: provider,
- chainId: 8453,
+ chainId: 84532, // ValidationRegistry is testnet-only for now
kind: 'glb-schema',
});
@@ -67829,7 +75349,16 @@ The toggle's CSS class reflects the highest severity: `level-0` (errors), `level
---
-<a id="sec-276"></a>
+## Related
+
+- [ERC-8004 identity](/docs/erc8004): the registry contracts validation records attach to
+- [Reputation](/docs/reputation): the human-feedback counterpart to validation
+- [3D asset pipeline](/docs/3d-asset-pipeline): formats, optimization, and export guidance
+- [Provenance](/docs/provenance): signed content credentials for generated models
+
+---
+
+<a id="sec-329"></a>
> **Source:** `docs/vanity.md` · [↑ table of contents](#table-of-contents)
@@ -68060,23 +75589,25 @@ challenges and the discovery doc stay in parity.
---
-<a id="sec-277"></a>
+<a id="sec-330"></a>
> **Source:** `docs/viewer.md` · [↑ table of contents](#table-of-contents)
# 3D Viewer
-The viewer is the rendering layer of three.ws — a full-featured three.js WebGL scene manager. It handles model loading, camera control, animation playback, lighting, and more. You interact with it directly via the `<agent-3d>` web component or programmatically through the `Viewer` class.
+The viewer is the rendering layer of three.ws: a full-featured three.js WebGL scene manager. It handles model loading, camera control, animation playback, lighting, and more. If you are new, the fastest way to see it is [three.ws/app](https://three.ws/app), where you can drag and drop any GLB file into the browser. Developers interact with the same engine via the `<agent-3d>` web component or programmatically through the `Viewer` class (`src/viewer.js`).
+
+Note: [three.ws/viewer](https://three.ws/viewer) is a separate, lightweight share page built on `<model-viewer>` that opens a model from a `?src=<url>` query parameter. This document covers the full three.js viewer that powers `/app` and every `<agent-3d>` embed.
## Overview
Core capabilities:
- **Model loading** — glTF 2.0 and GLB files, including Draco-compressed meshes and KTX2 textures
-- **Interactive camera** — orbit, pan, zoom, reset, named camera support
-- **Animation playback** — per-clip play/pause, speed control, loop toggle, blend via AnimationMixer
-- **HDR environments** — three built-in environments for realistic image-based lighting
-- **Material inspection** — per-mesh metalness, roughness, texture maps via dat.gui
+- **Interactive camera**: orbit, pan, zoom, frame, named camera support
+- **Animation playback**: per-clip play/pause, speed control, blend via AnimationMixer, plus an external clip-library panel for rigged avatars
+- **HDR environments**: built-in environments for realistic image-based lighting
+- **Material inspection and editing**: via the editor layer (see [Editor Guide](/docs/editor))
- **Morph targets** — per-target sliders, used by the avatar emotion system for facial animation
- **Skeleton visualization** — colored bone overlay for animation rig debugging
- **Screenshot capture** — PNG download via keyboard or API
@@ -68095,20 +75626,22 @@ The `src` attribute (or `body` for direct GLB URIs) on `<agent-3d>` loads a mode
<agent-3d src="https://example.com/avatar.glb"></agent-3d>
```
-For a standalone viewer page, pass the model via URL hash:
+For the standalone viewer page, pass the model via URL hash:
```
-https://your-app.com/viewer#model=https://example.com/avatar.glb
+https://three.ws/app#model=https://example.com/avatar.glb
```
### Programmatically
+Set the `src` (or `body`) attribute on the element; a change to either triggers a reload:
+
```js
const el = document.querySelector('agent-3d');
-await el.loadGLB('https://example.com/new-model.glb');
+el.setAttribute('src', 'https://example.com/new-model.glb');
```
-The `load(url, rootPath, assetMap)` method on the underlying `Viewer` instance accepts HTTPS URLs, blob URLs, and data URIs.
+Or drive the underlying `Viewer` instance directly. Its `load(url, rootPath, assetMap, onProgress)` method accepts HTTPS URLs, blob URLs, and data URIs.
### Compressed assets
@@ -68138,7 +75671,10 @@ The viewer uses `OrbitControls` for interactive navigation:
| **Orbit** | Left drag | One-finger drag |
| **Pan** | Right drag | Two-finger drag |
| **Zoom** | Scroll wheel | Pinch |
-| **Reset / Frame** | Double-click on model | Double-tap |
+| **Frame model (animated)** | Double-click | Double-tap |
+| **Frame model (instant)** | `F` key | (keyboard only) |
+
+Keyboard-only orbit is also supported when the canvas has focus: arrow keys rotate, `+`/`-` and PageUp/PageDown dolly.
### Camera state
@@ -68169,7 +75705,7 @@ The `assetgenerator` preset uses a hemisphere light instead of the default ambie
### Auto-rotate
-Enable continuous rotation via `viewer.state.autoRotate = true` (or toggle in the **Display** GUI folder). Rotation pauses on user interaction and resumes after a short idle.
+Enable continuous rotation via `viewer.state.autoRotate = true` followed by `viewer.updateDisplay()` (or toggle **autoRotate** in the **Display** GUI folder). Rotation pauses while you drag and resumes when you release (standard OrbitControls behavior).
---
@@ -68179,10 +75715,9 @@ Enable continuous rotation via `viewer.state.autoRotate = true` (or toggle in th
When a GLB contains animation clips, the **Animation** folder appears in the dat.gui panel with:
-- A list of all clips — each has a play/pause toggle
-- **Play All** — sequences all clips in order
-- **Speed** slider — 0.1× to 3×
-- **Loop** toggle per clip
+- A checkbox per clip that starts or stops that clip (the first clip autoplays on load)
+- **playAll**: activates every clip at once
+- **playbackSpeed** slider: 0 to 1, applied as the mixer's `timeScale`
### Keyboard shortcut
@@ -68204,7 +75739,7 @@ await el.play('wave');
await el.play('dance', { loop: false });
```
-For agent-controlled playback, the `SceneController` bridge (`src/runtime/scene.js`) exposes `play_clip` as an agent tool.
+For agent-controlled playback, the runtime tool layer (`src/runtime/tools.js`) exposes `play_clip` as an agent tool, executed through the `SceneController` bridge (`src/runtime/scene.js`).
### External animation panel
@@ -68214,28 +75749,36 @@ When the viewer is embedded inside `<agent-3d>` with animation definitions regis
## Environment and Lighting
-### Built-in HDR environments
+### Built-in environments
+
+Defined in `src/environments.js`:
| Name | Description |
|---|---|
-| `venice-sunset` | Warm golden-hour outdoor lighting |
-| `footprint-court` | Neutral studio lighting |
-| `neutral` | Soft indoor room environment (RoomEnvironment) |
+| `None` | No environment map |
+| `Neutral` | Soft indoor room environment (three.js RoomEnvironment). The default. |
+| `Venice Sunset` | Warm golden-hour outdoor HDR |
+| `Footprint Court (HDR Labs)` | Neutral studio HDR |
-Switch via the **Lighting** GUI folder or set `viewer.state.environment` programmatically, then call `viewer.updateEnvironment()`.
+Switch via the **Lighting** GUI folder or set `viewer.state.environment` to one of the display names above, then call `viewer.updateEnvironment()`.
### Lighting controls (GUI → Lighting folder)
+The default rig is a studio three-point setup (key + fill + rim) over an ambient base, tone-mapped with the Khronos PBR Neutral mapper.
+
| Control | State key | Range |
|---|---|---|
| Environment | `environment` | dropdown |
-| Exposure | `exposure` | −10 to 10 |
-| Tone mapping | `toneMapping` | Linear / ACES Filmic |
+| Exposure | `exposure` | -10 to 10 |
+| Tone mapping | `toneMapping` | Neutral / Linear / ACES Filmic |
| Punctual lights | `punctualLights` | boolean |
-| Ambient intensity | `ambientIntensity` | 0–2 |
+| IBL intensity | `environmentIntensity` | 0-3 |
+| Ambient intensity | `ambientIntensity` | 0-2 |
| Ambient color | `ambientColor` | hex color |
-| Directional intensity | `directIntensity` | 0–4 |
+| Directional intensity | `directIntensity` | 0-4 |
| Directional color | `directColor` | hex color |
+| Fill ratio + color | `fillRatio`, `fillColor` | 0-1 |
+| Rim ratio + color | `rimRatio`, `rimColor` | 0-1.5 |
### Background
@@ -68247,17 +75790,11 @@ Call `viewer.updateBackground()` after changing these values programmatically.
## Material and Texture Inspection
-The dat.gui panel exposes per-material properties for every mesh in the scene:
+The viewer itself exposes a scene-wide **wireframe** toggle (Display folder). Per-material inspection and editing (metalness, roughness, base color, emissive, texture maps) lives in the editor layer: when the `Editor` class is active, a dat.gui folder per material appears, plus the Texture Inspector panel. See the [Editor Guide](/docs/editor) for the full workflow.
-- **Metalness** and **roughness** sliders
-- **Base color** picker
-- Texture map listing: baseColor, normal, metalness/roughness, emissive, occlusion
-- **Transparency** and **double-sided** toggles
-- **Wireframe** toggle (also available at the top-level in Display folder)
+Material traversal helpers are deduplicated by UUID (via `traverseMaterials` in `src/viewer/internal.js`), so shared materials are only processed once.
-Material traversal is deduplicated by UUID (via `traverseMaterials` in `src/viewer/internal.js`), so shared materials are only listed once.
-
-**Note:** The GUI panel is read-only in viewer mode. Editing material properties in a persistent way requires the Editor workflow. Changes made via the GUI are lost on model reload.
+**Note:** Edits made in the plain viewer are session-only and lost on model reload. Persisting material changes requires the Editor's save or publish flow.
---
@@ -68267,18 +75804,21 @@ If the loaded GLB includes morph targets, the **Morph Targets** folder appears i
### Avatar expression targets
-The built-in avatar uses morph targets to drive facial expressions. The emotion system sets these targets automatically during speech and in response to conversation context. The targets available on the default avatar are:
+The built-in avatar uses morph targets to drive facial expressions. The emotion system (`src/agent-avatar.js`) sets these targets automatically during speech and in response to conversation context. The target names it drives are ARKit-style blendshape identifiers (paired targets have `Left`/`Right` variants):
| Target | Effect |
|---|---|
| `mouthSmile` | Corners of mouth up |
| `mouthFrown` | Corners of mouth down |
-| `mouthOpen` | Jaw open |
+| `mouthOpen`, `jawOpen` | Mouth and jaw open |
+| `mouthPressLeft` / `mouthPressRight` | Lips pressed |
| `cheekPuff` | Cheek inflation |
+| `cheekSquintLeft` / `cheekSquintRight` | Cheek raise |
| `browInnerUp` | Inner brow raise |
-| `browOuterUp` | Outer brow raise |
-| `noseSneer` | Nostril flare |
-| `eyeSquint` | Eye squint |
+| `browOuterUpLeft` / `browOuterUpRight` | Outer brow raise |
+| `noseSneerLeft` / `noseSneerRight` | Nostril flare |
+| `eyeSquintLeft` / `eyeSquintRight` | Eye squint |
+| `eyeWideLeft` / `eyeWideRight` | Eyes widen |
| `eyesClosed` | Eye close |
These are directly useful for facial animation preview or testing custom expressions before encoding them into an animation clip.
@@ -68338,7 +75878,7 @@ The implementation in `src/viewer/screenshot.js` renders one frame, encodes the
## Stats Panel
-Toggle the performance overlay with the `S` key or via the **Performance** folder in the dat.gui panel.
+The performance overlay lives in the **Performance** folder of the dat.gui panel (open the panel with the Controls toggle button in the viewer corner).
The overlay shows three panels (provided by `stats.js`):
@@ -68354,21 +75894,23 @@ The stats panel updates every frame. Keep it disabled in production embeds — i
## URL Hash Routing
-The viewer page reads hash parameters on load to pre-configure the scene:
+The `/app` viewer page reads hash parameters on load to pre-configure the scene (parsed in `src/app.js`):
| Parameter | Effect |
|---|---|
| `#model=<url>` | Auto-load this GLB on page load |
| `#preset=<name>` | Apply environment/lighting preset (`assetgenerator`) |
| `#cameraPosition=x,y,z` | Set initial camera position |
-| `#register=1` | Open registration modal immediately |
| `#kiosk=true` | Hide GUI, chat, and input |
-| `#agent=<id>` | Load agent by ID (embed mode) |
+| `#agent=<id>` | Load agent by ID (legacy embed mode) |
+| `#noChat=1`, `#noControls=1`, `#noAnimations=1` | Hide individual UI surfaces |
+
+A `?agent=<id>` query parameter (not hash) opens the same page in editing mode with save-back.
-Example — load a specific model with a fixed camera position:
+Example: load a specific model with a fixed camera position:
```
-https://your-app.com/viewer#model=https://cdn.example.com/robot.glb&cameraPosition=0,1.2,2.5
+https://three.ws/app#model=https://cdn.example.com/robot.glb&cameraPosition=0,1.2,2.5
```
---
@@ -68395,7 +75937,7 @@ For FBX conversion, the script at `scripts/convert-fbx-to-glb.py` uses Blender's
- **Use KTX2 textures** for GPU-native compressed formats (BC7, ETC2, ASTC). The browser uploads them directly to GPU without CPU decompression, saving memory and load time.
- **Keep polygon count under 100k** for smooth mobile performance. The default avatar is around 15k triangles.
- **Disable the stats panel** in production embeds — it triggers continuous layout reads.
-- **Use LOD** if targeting mobile WebXR. three.js `LOD` objects are supported in the glTF 2.0 extension `MSFT_lod`.
+- **Reduce detail for mobile WebXR.** Prefer a lower-poly export for embeds that target phones; the loader does not implement the `MSFT_lod` extension, so level-of-detail switching must be baked into the asset you ship.
- **Transparent backgrounds** (`viewer.state.transparentBg = true`) disable some GPU optimizations. Only use when compositing the canvas over page content.
- **Auto-rotate** triggers a continuous `requestAnimationFrame` loop even when nothing is changing. Disable it for idle embeds to reduce CPU/battery usage.
@@ -68407,30 +75949,134 @@ The `viewer.state` object is the source of truth for all viewer settings. Readin
| Key | Type | Default | Update method |
|---|---|---|---|
-| `environment` | string | `'venice-sunset'` | `updateEnvironment()` |
+| `environment` | string | `'Neutral'` (display name) | `updateEnvironment()` |
| `background` | boolean | `false` | `updateBackground()` |
| `bgColor` | hex string | `'#000000'` | `updateBackground()` |
| `transparentBg` | boolean | `false` | `updateBackground()` |
-| `playbackSpeed` | number | `1.0` | — (applied per frame) |
+| `playbackSpeed` | number | `1.0` | applied to the mixer's `timeScale` |
| `actionStates` | object | `{}` | `setClips()` |
| `wireframe` | boolean | `false` | `updateDisplay()` |
| `skeleton` | boolean | `false` | `updateDisplay()` |
| `grid` | boolean | `false` | `updateDisplay()` |
| `autoRotate` | boolean | `false` | `updateDisplay()` |
| `exposure` | number | `0` | `updateLights()` |
-| `ambientIntensity` | number | `0.3` | `updateLights()` |
+| `environmentIntensity` | number | `1.15` | `updateEnvironment()` |
+| `ambientIntensity` | number | `0.45` | `updateLights()` |
| `ambientColor` | hex string | `'#FFFFFF'` | `updateLights()` |
-| `directIntensity` | number | `0.8` | `updateLights()` |
+| `directIntensity` | number | `0.8 * Math.PI` (about 2.51) | `updateLights()` |
| `directColor` | hex string | `'#FFFFFF'` | `updateLights()` |
+| `fillRatio` / `rimRatio` | number | `0.4` / `0.55` | `updateLights()` |
| `punctualLights` | boolean | `true` | `updateLights()` |
| `camera` | string | `'[default]'` | `setCamera()` |
-| `followMode` | string | `'none'` | — |
+| `followMode` | string | `'mouse'` | applied per frame |
+
+This table covers the commonly used keys; see the `state` object in the `Viewer` constructor (`src/viewer.js`) for the full set, including cinematic FX and light-probe settings.
+
+A subset of state (background, transparency, background color, auto-rotate, exposure, environment, cinematic preset) is persisted to `localStorage` per agent ID when `attachScenePrefs(agentId)` is called. Controllers call `notifyScenePrefChange()` after a state change to persist the latest values.
+
+## Related
-State is persisted to `localStorage` per agent ID when `attachScenePrefs(agentId)` is called. Changes are broadcast via `notifyScenePrefChange()`.
+- [Editor Guide](/docs/editor): inspect and modify models, then publish
+- [Animations](/docs/animations): the clip library and agent gesture slots
+- [Embedding](/docs/embedding): put the `<agent-3d>` component on your own site
+- [AR](/docs/ar): view the same models in augmented reality
---
-<a id="sec-278"></a>
+<a id="sec-331"></a>
+
+> **Source:** `docs/voice-lab.md` · [↑ table of contents](#table-of-contents)
+
+# Voice Lab: clone your voice in the browser
+
+Record 20 to 30 seconds of clear speech and Voice Lab creates a digital replica of your voice that you can type into and play back instantly, save to a personal library, and later assign to any three.ws agent. The recording, the live waveform, and the voice library all run in the browser; cloning and synthesis run server-side through ElevenLabs Instant Voice Cloning behind a platform proxy so your key never leaves the server.
+
+Page: [/voice](https://three.ws/voice)
+API: `POST /api/tts/eleven-clone` (clone) · `POST /api/tts/eleven` (synthesize) · `PUT`/`POST`/`DELETE /api/agents/:id/voice` (assign to an agent)
+
+## Why it exists
+
+An agent that speaks in a generic stock voice is a demo. An agent that speaks in *your* voice is a character. Voice Lab is the on-ramp: it turns a short browser recording into a reusable voice identity, then hands that identity to the rest of the platform (the chat agent, talking-avatar surfaces, the marketplace) without you ever touching an API. It is deliberately a two-step product: clone here, then wire the saved voice into an agent from the agent editor, so the same clone can back several agents.
+
+## How it works
+
+The page ([`pages/voice.html`](../pages/voice.html)) loads a single module, [`src/voice-lab.js`](../src/voice-lab.js), which owns three panels: the recorder, the "My Voices" library, and a text-to-speech playground.
+
+1. **Record.** `getUserMedia({ audio: { channelCount: 1, echoCancellation: true, noiseSuppression: true, autoGainControl: true, sampleRate: 48000 } })` opens the mic. A `MediaRecorder` (negotiating `audio/webm;codecs=opus` first, then webm, ogg, or mp4) captures in 250ms slices while a Web Audio `AnalyserNode` (`fftSize: 2048`) drives a live 64-bar waveform and an 8-bar level meter. Four reading scripts are offered so you have something natural to say. The recommended length is 25 seconds; the UI encourages stopping any time after 25s, auto-stops at 60s, and rejects anything under 3s.
+2. **Review.** You play the take back, name the voice (1 to 64 chars), and either re-record or clone.
+3. **Clone.** The recording is POSTed as `multipart/form-data` to `/api/tts/eleven-clone`. The shared library [`api/_lib/elevenlabs.js`](../api/_lib/elevenlabs.js) dynamically imports `@elevenlabs/elevenlabs-js`, constructs an `ElevenLabsClient`, and calls `client.voices.ivc.create({ name, description, files })` (ElevenLabs Instant Voice Cloning). The endpoint returns a `voice_id`.
+4. **Save.** The `voice_id` is written to a browser voice library (`localStorage` key `voicelab_voices_v1`, up to 20 voices). Each card offers "Play sample" and "Remove".
+5. **Play.** The playground picks any of *your* cloned voices, takes up to 500 characters of text, and POSTs `{ voiceId, text }` to `/api/tts/eleven`. That endpoint synthesizes with the server default model `eleven_flash_v2_5`, streams back `audio/mpeg`, and caches each clip in R2 for 30 days keyed on a hash of the inputs (the response header `x-tts-cache: hit|miss` tells you which).
+
+### Comparing voice models
+
+The live `/voice` playground synthesizes with a single default model (`eleven_flash_v2_5`). The side-by-side **model** comparison and per-agent voice tuning (stability, similarity, style sliders) live in the **agent editor** ([`src/agent-edit.js`](../src/agent-edit.js)), which reads the live model catalog from `GET /api/tts/eleven/voices` and lets you audition across the three ElevenLabs models:
+
+- `eleven_flash_v2_5`: Flash v2.5, lowest latency, real-time (the default).
+- `eleven_turbo_v2_5`: Turbo v2.5, balanced latency and quality.
+- `eleven_multilingual_v2`: Multilingual v2, highest quality, 29 languages.
+
+## Walkthrough
+
+1. Open [/voice](https://three.ws/voice) and sign in (both endpoints require auth).
+2. Allow microphone access. Press record (or hit Space), read one of the scripts aloud for 20 to 30 seconds, and stop.
+3. Play the take back. If it is clean, name the voice and press Clone. If not, re-record.
+4. Wait a few seconds for "cloned successfully". The new voice appears in My Voices with its `voice_id`.
+5. Open the playground, pick the voice, type or drop in a sample, and press Speak (or Cmd/Ctrl+Enter). Playback is instant on a cache hit.
+6. To give the voice to an agent, open that agent in the agent editor and assign the saved voice there.
+
+## Examples
+
+Both endpoints are authenticated (session cookie or bearer token). Cloning also requires a paid ElevenLabs tier server-side.
+
+```bash
+# Clone a voice from a recorded sample (multipart).
+curl -X POST 'https://three.ws/api/tts/eleven-clone' \
+ -H 'authorization: Bearer <TOKEN>' \
+ -F 'name=My studio voice' \
+ -F '[email protected];type=audio/webm'
+# -> 200 { "voice_id": "…", "name": "My studio voice", "status": "ready", "requires_verification": false }
+
+# Synthesize speech with a cloned voice (streams audio/mpeg).
+curl -X POST 'https://three.ws/api/tts/eleven' \
+ -H 'authorization: Bearer <TOKEN>' \
+ -H 'content-type: application/json' \
+ -d '{ "voiceId": "<VOICE_ID>", "text": "Welcome to three dot ws." }' \
+ --output hello.mp3
+
+# Assign the cloned voice to an agent, with model + settings.
+curl -X PUT 'https://three.ws/api/agents/<AGENT_ID>/voice' \
+ -H 'authorization: Bearer <TOKEN>' \
+ -H 'content-type: application/json' \
+ -d '{ "voice_id": "<VOICE_ID>", "voice_model": "eleven_turbo_v2_5",
+ "voice_settings": { "stability": 0.5, "similarity_boost": 0.75, "style": 0.5, "use_speaker_boost": true } }'
+# -> { "voice_provider": "elevenlabs", "voice_id": "…", "voice_model": "eleven_turbo_v2_5", ... }
+```
+
+The agent-voice handler ([`api/agents/_id/voice.js`](../api/agents/_id/voice.js), reached at `/api/agents/:id/voice`) also exposes `GET` (status), `POST /api/agents/:id/voice/clone` (clone directly from raw audio, with a 30-second minimum and a 3-clones-per-day limit), and `DELETE` (revert to the browser voice). Assigning or clearing a clone deletes the previous ElevenLabs clone to free quota.
+
+## States and limits
+
+- **Recorder states.** `idle` -> `recording` (live waveform, timer, level meter) -> `review` (playback, name, Clone / Re-record) -> `cloning` (spinner) -> `done` (green check, `voice_id` shown, actions: Try in playground / Add to an agent / Record another).
+- **Auth required.** Both TTS endpoints return `401 unauthorized` without a session or bearer token. Requests send `credentials: 'include'`.
+- **Server config.** ElevenLabs must be configured (`ELEVENLABS_API_KEY`) or the endpoints return `503 not_configured`.
+- **Paid cloning tier.** Instant Voice Cloning is an ElevenLabs paid-tier (Starter and up) feature. On a free upstream tier the API surfaces the upstream `can_not_use_instant_voice_cloning` body verbatim as a `502`.
+- **Length rules.** Voice Lab recommends 20 to 30 seconds, auto-stops at 60, and rejects under 3. The separate agent-clone endpoint (`POST /api/agents/:id/voice/clone`) enforces a 30-second floor and 3 clones per user per day.
+- **Synthesis limits.** 500 characters per playground request; 1000 characters per hour per user (reserved-then-refunded so a failed synth does not burn quota). Clips are cached in R2 for 30 days.
+- **Audio size.** Clone uploads are capped at ~10 MB.
+- **"Add to an agent" on `/voice`** links to the dashboard; the actual assignment happens in the agent editor. The cloned `voice_id` lives in browser `localStorage` until you assign it.
+- **Error copy.** Mic denial, recorder failure, too-short recording, missing name, network failure, and clone failure each map to a specific message; the playground shows "Synthesizing...", then a size and cached/generated tag, or an error.
+
+## Related
+
+- [Voice and lipsync tutorial](./tutorials/voice-and-lipsync.md): the authoritative step-by-step, including wiring a cloned voice into an agent.
+- [Lipsync](./lipsync.md): how synthesized speech drives an avatar's mouth in real time.
+- [Talking Avatar Video](./talking-avatar-video.md): render a talking-head clip from an avatar and an audio track.
+- Pages: [/voice](https://three.ws/voice), [/dashboard](https://three.ws/dashboard).
+
+---
+
+<a id="sec-332"></a>
> **Source:** `docs/web-component.md` · [↑ table of contents](#table-of-contents)
@@ -68523,7 +76169,7 @@ Lighting, camera orbit, and environment are managed by the built-in viewer; they
| Attribute | Type | Default | Description |
|-----------|------|---------|-------------|
| `skills` | comma-separated URIs | — | Additional skill URIs to install on top of manifest skills. |
-| `skill-trust` | `any` \| `whitelist` \| `owned-only` | from manifest | Controls which skill URIs are allowed to install. `owned-only` allows only skills whose author matches the agent's `ownerAddress`. |
+| `skill-trust` | `any` \| `whitelist` \| `owned-only` | `owned-only` | Controls which skill URIs are allowed to install. `owned-only` allows only skills whose author matches the agent's `ownerAddress`. |
| `memory` | `local` \| `ipfs` \| `encrypted-ipfs` \| `none` | from manifest | Memory storage mode. |
| `memory-key` | string | agent ID or name | Namespace under which memory is persisted. Useful when embedding the same agent in multiple contexts. |
@@ -69245,7 +76891,7 @@ el.addEventListener('agent:ready', async () => {
### UMD (no ES modules)
```html
-<script src="https://three.ws/agent-3d/1.5.1/agent-3d.umd.cjs"></script>
+<script src="https://three.ws/agent-3d/1.5.2/agent-3d.umd.cjs"></script>
```
---
@@ -69345,12 +76991,23 @@ defineElement('my-agent');
---
-<a id="sec-279"></a>
+## Related
+
+- [SDK & Library](/docs/sdk): installing the bundle, building from source, programmatic imports
+- [JavaScript API](/docs/js-api): the viewer and validator classes under the hood
+- [Embedding guide](/docs/embedding): iframe patterns, CSP, and platform-specific embeds
+- [Widgets](/docs/widgets): the no-code alternative to hand-writing this element
+
+---
+
+<a id="sec-333"></a>
> **Source:** `docs/widget-api.md` · [↑ table of contents](#table-of-contents)
# Widget API
+This page is for developers who want to control an embedded three.ws widget from their own page: move the camera, play animations, capture screenshots, or swap models at runtime. Widgets are created in [Widget Studio](https://three.ws/studio) and embedded via `/widget` or the one-line `embed.js` script below.
+
The slim widget shell (`/widget`) is an embeddable 3D viewer. It supports:
- **URL parameters** — declarative configuration (model, type, brand, poster, reveal mode).
@@ -69541,9 +77198,16 @@ If you have multiple widgets and want to coordinate them (sync camera, broadcast
- `screenshot.capture` returns the rendered canvas, so the parent gets exactly what the visitor sees. Nothing private leaks across the boundary.
- `model.load` accepts any URL the iframe can fetch — same-origin policy still applies to the GLB itself. If you need a private model, gate it behind a cookie/header at the GLB host.
+## Related
+
+- [Widget types](/docs/widgets): every widget type, config schema, and postMessage event
+- [Widget Studio guide](/docs/widget-studio): building widgets with the no-code Studio
+- [REST API Reference](/docs/api-reference): the `/api/widgets` CRUD endpoints
+- [Embedding guide](/docs/embedding): advanced embedding patterns and iframe options
+
---
-<a id="sec-280"></a>
+<a id="sec-334"></a>
> **Source:** `docs/widget-studio.md` · [↑ table of contents](#table-of-contents)
@@ -69604,7 +77268,7 @@ The Studio has three columns: **Pick avatar + widget type** (left), **Live previ
The left column shows your saved avatars as thumbnail cards. Click any card to select it — a highlight appears and the live preview updates immediately.
-> *See the screenshot below: the avatar list shows thumbnail cards; the selected avatar has a purple outline.*
+The avatar list renders as thumbnail cards; the selected avatar is outlined so you always know which model the preview is showing.
If you have no avatars yet, you'll see a link to upload one from the Dashboard. Avatars are GLB files stored in your account.
@@ -69624,7 +77288,7 @@ The right column has a **Brand** panel with a form. Changes here update the live
- **Name** — internal label for your widget (shown in the Dashboard). Required.
- **Background** — canvas background color (color picker, default `#0a0a0a`)
-- **Accent** — used for buttons and interactive highlights (default `#8b5cf6`, purple)
+- **Accent**: used for buttons and interactive highlights (default `#ffffff`)
- **Caption** — optional short text shown beneath the widget (up to 280 characters)
- **Show controls** — toggle the orbit/rotate controls visible to visitors
- **Auto-rotate** — whether the model spins automatically on load
@@ -69666,9 +77330,7 @@ If something is wrong with your form (e.g. the Name field is empty), an error me
After clicking **Generate embed**, a modal slides up titled "Your widget is live."
-> *See the screenshot below: the modal shows a live preview iframe, a shareable URL field, and two embed snippet text areas.*
-
-The modal contains:
+The modal shows a live preview iframe, a shareable URL field, and two embed snippet text areas:
**Shareable URL** — a `/w/<id>` link you can paste anywhere. Social platforms and CMSes render a rich preview card from this URL.
@@ -69796,7 +77458,7 @@ You can override these freely in the iframe `width` and `height` attributes. Add
---
-<a id="sec-281"></a>
+<a id="sec-335"></a>
> **Source:** `docs/widgets.md` · [↑ table of contents](#table-of-contents)
@@ -69837,7 +77499,7 @@ Every widget also inherits a set of **brand options** that apply to all types:
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `background` | hex color | `#0a0a0a` | Canvas background color |
-| `accent` | hex color | `#8b5cf6` | UI accent color (buttons, highlights) |
+| `accent` | hex color | `#ffffff` | UI accent color (buttons, highlights) |
| `caption` | string (max 280 chars) | — | Overlay text displayed on the canvas |
| `showControls` | boolean | `true` | Show orbit/pan controls |
| `autoRotate` | boolean | `true` | Auto-rotate the model |
@@ -69907,11 +77569,11 @@ All brand options apply.
const iframe = document.querySelector('iframe');
iframe.contentWindow.postMessage(
{ type: 'widget:command', command: 'play_clip', args: { name: 'Wave' } },
- 'https://three.ws/'
+ 'https://three.ws'
);
```
-**What it looks like:** The 3D avatar fills the canvas (auto-rotating if `autoRotate` is on). In the top-right corner, a frosted-glass panel labeled "Clips (N)" lists every animation name. The active clip is highlighted with a purple left-border accent. On mobile, the panel slides to the bottom of the screen.
+**What it looks like:** The 3D avatar fills the canvas (auto-rotating if `autoRotate` is on). In the top-right corner, a frosted-glass panel labeled "Clips (N)" lists every animation name. The active clip is highlighted with an accent-colored left border. On mobile, the panel slides to the bottom of the screen.
**Best for:** Animation portfolios, character demo reels, rigging showcases, game asset storefronts.
@@ -70221,7 +77883,7 @@ Widgets communicate with the embedding page using `window.postMessage`. Always v
```js
window.addEventListener('message', (e) => {
- if (e.origin !== 'https://three.ws/') return;
+ if (e.origin !== 'https://three.ws') return;
switch (e.data?.type) {
case 'widget:ready':
@@ -70251,13 +77913,13 @@ const iframe = document.querySelector('iframe');
// Live-update brand config (same options as the config object above)
iframe.contentWindow.postMessage(
{ type: 'widget:config', config: { background: '#ff00aa', accent: '#ffffff' } },
- 'https://three.ws/'
+ 'https://three.ws'
);
// Trigger a runtime action (animation-gallery and talking-agent)
iframe.contentWindow.postMessage(
{ type: 'widget:command', command: 'play_clip', args: { name: 'Wave' } },
- 'https://three.ws/'
+ 'https://three.ws'
);
```
@@ -70305,7 +77967,16 @@ Need to drive a widget from the parent page — change the camera, play an anima
---
-<a id="sec-282"></a>
+## Related
+
+- [Widget Studio guide](/docs/widget-studio): the no-code builder, step by step
+- [Widget API (JSON-RPC)](/docs/widget-api): programmatic control of an embedded widget
+- [REST API Reference](/docs/api-reference): the `/api/widgets` CRUD endpoints in full
+- [Web Component](/docs/web-component): the `<agent-3d>` element for deeper integrations
+
+---
+
+<a id="sec-336"></a>
> **Source:** `docs/x402-buyer.md` · [↑ table of contents](#table-of-contents)
@@ -70377,8 +78048,8 @@ Caps are enforced as a reserve → commit / rollback transaction in
it fails — caps hold even across concurrent calls. The store is Redis-backed when
available. If a call would exceed any window, `buyerFetch` returns
`{ ok: false, abort: true, reason }` **without paying**. The platform-wide ceiling
-defaults live in env (`X402_MAX_PER_CALL_ATOMIC`, `_PER_HOUR_`, `_PER_DAY_`; see
-[Configuration](configuration.md)).
+defaults live in env (`X402_MAX_PER_CALL_ATOMIC`, `X402_MAX_PER_HOUR_ATOMIC`,
+`X402_MAX_PER_DAY_ATOMIC`; see [Configuration](configuration.md)).
## Axios variant
@@ -70407,19 +78078,20 @@ set) back into the payment so attribution survives the round trip.
---
-<a id="sec-283"></a>
+<a id="sec-337"></a>
> **Source:** `docs/x402-dev-tools.md` · [↑ table of contents](#table-of-contents)
# x402 Developer Tools
A free test bench for building and debugging x402 integrations against a live
-server. Six tools — three new free diagnostics plus three pre-existing probe
-endpoints — that let you inspect what the server sees, understand why a payment
-was rejected, and confirm a receipt, all without spending anything.
+server. Six tools (three free diagnostics plus three paid probe endpoints)
+that let you inspect what the server sees, understand why a payment was
+rejected, and confirm a receipt.
-Every tool here is **free and keyless** except the two paid probes noted below.
-The three new diagnostic tools are rate-limited to **30 requests/minute per IP**.
+The three diagnostic tools are **free and keyless**, rate-limited to
+**30 requests/minute per IP**. The three probe endpoints are paid
+($0.001 USDC each).
Base URL: `https://three.ws`
@@ -70515,7 +78187,7 @@ Two independent checks; supply either or both. The response says exactly what
was and wasn't verifiable.
**Attestation integrity** — pass a three.ws paid response carrying a
-`sha256:…` attestation (e.g. from [`/api/x402/fact-check`](./x402-endpoints.md)).
+`sha256:…` attestation (e.g. from [`/api/x402/fact-check`](/docs/x402-endpoints)).
The digest is recomputed over the committed fields; if any was altered after
signing, the recomputed digest won't match.
@@ -70572,7 +78244,7 @@ endpoint today before hitting its daily USDC spend cap — `remaining_calls`,
curl -s https://three.ws/api/x402/rate-limit-probe -d '{ "endpoint": "/api/x402/forge" }'
```
-### Permit2 paid demo — `GET /api/x402/permit2-paid-demo` *(paid)*
+### Permit2 paid demo: `GET /api/x402/permit2-paid-demo` *(paid, $0.001 USDC)*
A target that advertises **only** the Permit2 + EIP-2612 gas-sponsoring accept
(no EIP-3009 fallback), so you can prove a wallet with USDC but zero native gas
@@ -70594,14 +78266,14 @@ implementation against a live server.
## Related
-- [x402 Protocol](./x402.md) — the challenge / verify / settle mechanics.
-- [x402 Paid Endpoints](./x402-endpoints.md) — the full catalog and pricing.
-- [x402 Buyer Client](./x402-buyer.md) — how to settle a challenge from code.
-- [x402 Revenue & Receipts](./x402-revenue.md) — how signed receipts are recorded.
+- [x402 Protocol](/docs/x402) - the challenge / verify / settle mechanics.
+- [x402 Paid Endpoints](/docs/x402-endpoints) - the full catalog and pricing.
+- [x402 Buyer Client](/docs/x402-buyer) - how to settle a challenge from code.
+- [x402 Revenue & Receipts](/docs/x402-revenue) - how signed receipts are recorded.
---
-<a id="sec-284"></a>
+<a id="sec-338"></a>
> **Source:** `docs/x402-distribution.md` · [↑ table of contents](#table-of-contents)
@@ -70814,7 +78486,7 @@ script. Everything else above updates itself.
---
-<a id="sec-285"></a>
+<a id="sec-339"></a>
> **Source:** `docs/x402-endpoints.md` · [↑ table of contents](#table-of-contents)
@@ -70854,7 +78526,10 @@ should tune them to real unit economics.
Endpoints advertise the networks they accept in the 402 challenge. The platform
settles **USDC on Solana** (primary, always-on via the self-hosted facilitator)
-and, when configured, **USDC on Base** (EVM). The relevant config (see
+and, when configured, **USDC on Base** (EVM) and a **BSC leg** (contract-mediated
+`direct` scheme, advertised only when `X402_PAY_TO_BSC` is set). On the Solana
+rail, `X402_ACCEPT_THREE_SOLANA` optionally advertises **$THREE** alongside USDC
+as a second accept entry on the same challenge. The relevant config (see
[Configuration](configuration.md)):
| Key | Meaning |
@@ -70922,7 +78597,7 @@ for to feed the oracle and sniper.
| `/api/x402/token-intel` | $0.01 | Live market intel for any token (price, 24h change, market cap, liquidity, volume, signal). |
| `/api/x402/crypto-intel` | $0.01 | Agent-readable crypto market signal (bullish/bearish/neutral) + rationale. |
| `/api/x402/three-intel` | $0.01 | Intel focused on $THREE. |
-| `/api/x402/fact-check` | per source | Claim fact-check with cited evidence. |
+| `/api/x402/fact-check` | $0.10 | Claim fact-check with cited sources, authority weights, and a SHA-256 attestation. A free daily quota per IP runs first; over-quota checks pay the x402 price. |
| `/api/x402/symbol-availability` | $0.001 | Whether a ticker symbol is taken; `-batch` variant $0.005. |
| `/api/x402/bazaar-feed` | $0.001 | x402 bazaar service listings feed. |
@@ -70944,10 +78619,37 @@ upstream is down — a buyer is never charged for missing data.
| `/api/x402/gas-oracle` | $0.001 | Live fee tiers for Ethereum + Base (real `eth_feeHistory`) and Solana priority-fee percentiles. |
| `/api/x402/market-mood` | $0.002 | Fear & Greed × 192-feed news sentiment composite (0–100) with divergence flag + driver headlines. |
| `/api/x402/news-pulse` | $0.002 | Per-ticker news coverage: mentions, velocity vs prior window, sentiment split, top headlines. |
+| `/api/x402/robinhood-portfolio` | $0.002 | Multiplier-correct Stock Token portfolio for a Robinhood Chain wallet: each symbol's true position (balance x ERC-8056 uiMultiplier) at on-chain Chainlink NAV, plus total USD value. |
-There is also a registry-derived `market-*` family (`/api/x402/market-coins`,
-`market-chart`, `market-yields`, …) — one endpoint per raw data category,
-projected from `api/_lib/market-data/registry.js`.
+There is also a registry-derived `market-*` family — one endpoint per raw data
+category, projected from `api/_lib/market-data/registry.js`. Each is $0.001
+USDC per call unless noted, and every one has a free counterpart at the path
+named in its description:
+
+| Endpoint | Default | Returns |
+| -------------------------------- | ------- | ------------------------------------------------------------------------------------------------ |
+| `/api/x402/market-coins` | $0.001 | Ranked coin market table — price, market cap, 24h volume, 24h/7d change, 7-day sparkline for up to 250 coins, with sector scoping and id search. |
+| `/api/x402/market-coin` | $0.001 | Full profile for one coin by CoinGecko id or Solana contract — market stats, ATH/ATL, supply, links, dev/community metrics, sentiment. |
+| `/api/x402/market-chart` | $0.001 | Historical USD price series for any coin — `[timestamp, price]` pairs over 1/7/30/90/365 days. |
+| `/api/x402/market-categories` | $0.001 | CoinGecko sector leaderboard (AI, layer-1, memecoins, DeFi, RWA, …) ranked by market cap, each with 24h cap/volume change and its top-3 coins. |
+| `/api/x402/market-global` | $0.001 | Whole-market snapshot — total market cap, 24h volume, BTC/ETH dominance, active coins, Fear & Greed index. |
+| `/api/x402/market-trending` | $0.001 | Last 24h's most-searched coins, categories, and NFT collections — early attention signal before it shows up in price. |
+| `/api/x402/market-exchanges` | $0.001 | Top 100 spot exchanges by CoinGecko trust score — 24h volume in BTC/USD, country, year established. |
+| `/api/x402/market-derivatives` | $0.001 | Top 100 perp futures by 24h volume (price, funding rate, open interest); `?view=exchanges` for the derivatives-venue leaderboard. |
+| `/api/x402/market-gas` | $0.001 | Live ETH gas in slow/standard/fast tiers from real `eth_feeHistory`, with USD cost estimates for transfer/swap/mint. |
+| `/api/x402/market-defi` | $0.001 | Top 100 DeFi protocols by TVL (DeFiLlama) with 1d/7d change, chains, category, plus whole-market TVL totals. |
+| `/api/x402/market-chains` | $0.001 | Cross-chain TVL leaderboard — top 100 chains with native token and % share of locked value. |
+| `/api/x402/market-yields` | $0.001 | ~15,000 DeFi yield pools, filterable by chain/project/stablecoin/search, sortable by TVL or dust-guarded APY. |
+| `/api/x402/market-stablecoins` | $0.001 | Top 100 stablecoins by circulating supply with live price (peg health), mechanism, and chain deployments. |
+| `/api/x402/market-fees` | $0.001 | Top 100 protocols by 24h fees or revenue (`?type=`) with 1d/7d/30d totals and whole-market chart. |
+| `/api/x402/market-dex-volumes` | $0.001 | Top 100 DEXes by 24h volume, with 7d volume, WoW change, chains, and market-share. |
+| `/api/x402/market-hacks` | $0.001 | Full DeFiLlama hack history — amount stolen, technique, chains, funds returned; searchable, with all-time/12mo loss stats. |
+| `/api/x402/market-pulse` | $0.005 | Flagship one-call market bundle: global stats, Fear & Greed, top-10 coins, trending, ETH gas, DeFi TVL, stablecoin supply, DEX volume, protocol fees — each section degrades independently. |
+
+Beneath the named endpoints sits the **datapoint fabric**: `/api/x402/d/<family>/…`
+(one route, `api/x402/d/[...path].js`) serves 1,000,000+ individually priced
+datapoints at **$0.0005** USDC each by default, overridable per family with
+`X402_PRICE_DATAPOINT_<FAMILY>`. See [Market data API](market-data-api.md#the-datapoint-fabric).
## Agent & reputation endpoints
@@ -70972,9 +78674,8 @@ projected from `api/_lib/market-data/registry.js`.
| `/api/x402/pipeline-gameready` | $0.03 | **Pipeline — Game-Ready.** Retopologize to a poly budget + PBR re-bake for real-time engines. GLB in → engine-ready GLB out. See [3D pipeline](3d-pipeline.md). |
| `/api/x402/pipeline-stylize` | $0.03 | **Pipeline — Stylize.** Geometric restyle (voxel/brick/voronoi/lowpoly) that rebuilds the mesh. GLB in → GLB out. See [3D pipeline](3d-pipeline.md). |
| `/api/x402/pipeline-rembg` | $0.01 | **Pipeline — Background Removal.** Image in → transparent PNG out (clean reference view for image→3D). See [3D pipeline](3d-pipeline.md). |
-| `/api/x402/mint-to-mesh`, `/api/x402/mint-to-mesh-batch` | per call | Token/mint → 3D mesh; `mint-to-mesh-batch` runs a set at $0.05. |
-| `/api/x402/model-check`, `/api/x402/model-validation-sweep` | $0.001 | Validate a GLB / sweep a batch. |
-| `/api/x402/glb-optimization-report` | per call | GLB size/optimization analysis. |
+| `/api/x402/mint-to-mesh`, `/api/x402/mint-to-mesh-batch` | $0.001 | Token/mint → 3D mesh; `mint-to-mesh-batch` runs a set at $0.05. |
+| `/api/x402/model-check`, `/api/x402/model-validation-sweep` | $0.001 | Validate a GLB / sweep a batch. (`model-check` is kept as a paid convenience; the same inspection is free at `/api/3d/inspect`.) |
| `/api/x402/avatar-optimize-batch` | $0.001 | Batch optimization pass over the top N avatars. |
| `/api/x402/animation-download`, `/api/x402/asset-download` | per asset | Paid asset/animation delivery. |
@@ -70986,22 +78687,23 @@ projected from `api/_lib/market-data/registry.js`.
| [`/api/x402/vanity`](vanity.md) | $0.01–$0.50 (≤3) · $2.50–$10 (4–5, inventory-only) | **Vanity Grinder** — get a brand-new Solana address that starts with your ticker/prefix and/or ends with a suffix, for a branded token mint or agent/treasury wallet. Checks the pre-ground warehouse first for **instant delivery** (`source: "inventory"`); falls back to a live grind (`source: "ground"`) up to 3 chars. Keypair or importable BIP-39 mnemonic; nothing stored; optional `sealTo` ECIES. Full doc: [vanity.md](vanity.md). |
| [`/api/x402/vanity-verifiable`](vanity.md#tier-2--provably-fair-grinder) | $0.02–$0.40 | **Provably-fair grinder** — same grind with a signed commit–reveal receipt proving the key was ground fresh and never kept. Spec: [PROTOCOL-vanity.md](PROTOCOL-vanity.md). |
| [`/api/x402/vanity-premium`](vanity.md#tier-3--premium-inventory) | $1–$50 by rarity | **Premium inventory** — buy a pre-ground 4–5+ char brandable address from stock. GET lists available patterns + prices (free); `?address=…` buys via x402 and delivers the key **once** (ciphertext destroyed on delivery). Browsable at `/vanity/premium`. |
-| `/api/x402/pay-by-name` | per call | Resolve and pay an SNS/ENS name (see [Agent wallets](agent-wallets.md)). |
-| `/api/x402/did` | per call | Decentralized identifier resolution. |
+| `/api/x402/pay-by-name` | $0.001 | Resolve and pay a `@username` / `.sol` name / raw address (see [Agent wallets](agent-wallets.md)); the paid resolve toll is $0.001, the transfer amount itself is buyer-specified. |
+| `/api/x402/did` | $0.001 | Decentralized identifier resolution. |
+| `/api/x402/three-buy` | $0.001 | Micro-buy service: one settled toll payment triggers one small, real on-chain USDC to $THREE buy funded by the micro-buy wallet (driven by the `three-buy-loop` cron). |
| `/api/x402/billboard` | $0.05 | Post to the on-platform billboard. |
| `/api/x402/dance-tip` | $0.001 | Tip a club performer. |
| `/api/x402/club-cover` | $0.01 | Pole-club door cover charge; a paid wallet re-enters free for the pass window. |
| `/api/x402/cosmetic-purchase` | per item | Buy a cosmetic. |
| `/api/x402/tutor` | $0.01 / answer | Paid tutoring; a session accumulates a running tab across answers. |
| `/api/x402/spend-session` | $0.01 | Open a metered spend session. |
-| `/api/x402/llm-proxy` | per call | Paid LLM proxy. |
+| `/api/x402/llm-proxy` | $0.005 | Paid LLM proxy. |
| `/api/x402/notify` | $0.001 | Notification gateway (Telegram + the autonomous loop's `canary` heartbeat lane). |
| `/api/x402/wallet-connect` | $0.001 | Wallet-bridge connect probe. |
| `/api/x402/permit2-paid-demo` | $0.001 | Reference endpoint for the Permit2 / EIP-2612 gasless-approval scheme. |
| `/api/x402/remix-asset` | $0.25 | Paid remix of a published, remixable 3D asset — generates a new anchored model and routes the source creator's royalty (≤20%) on-chain. |
-| `/api/x402/cross-chain`, `/api/x402/network-cost` | per call | Cross-chain cost comparison. |
+| `/api/x402/cross-chain` | $0.005 | Cross-chain bridge status monitor. (`/api/x402/network-cost` is the free read of the cross-chain cost snapshots the autonomous loop settles hourly.) |
| `/api/x402/rate-limit-probe`, `/api/x402/schema-check` | $0.001 | Paid diagnostic probes used by the autonomous loop. |
-| `/api/x402/auth-health`, `/api/x402/api-key-health`, `/api/x402/feed-health`, `/api/x402/granite-health`, `/api/x402/telegram-health`, `/api/x402/solana-register-health` | $0.001 | Paid SLA/health probes for each backend dependency (auth, API keys, the live feed, IBM Granite, Telegram, Solana register). |
+| `/api/x402/auth-health`, `/api/x402/api-key-health`, `/api/x402/feed-health`, `/api/x402/telegram-health`, `/api/x402/solana-register-health` | $0.001 | Paid SLA/health probes for each backend dependency (auth, API keys, the live feed, Telegram, Solana register). |
> Prices above marked "per call / per tier / per source" are computed by the
> handler rather than a flat default; check the handler and any
@@ -71022,11 +78724,14 @@ directory.
| Endpoint | Default | Returns |
| ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/api/x402/analytics` | $0.005 | Platform reports — pick `report=revenue` for the x402 endpoint-revenue summary (see [x402 revenue & receipts](x402-revenue.md)), plus club and listing analytics. |
-| `/api/x402/mcp-tool-catalog` | per call | Snapshot of every MCP tool — name, paid/free, price, input shape — and a diff vs the last snapshot (added / removed / re-priced tools). |
+| `/api/x402/mcp-tool-catalog` | $0.001 | Snapshot of every MCP tool (name, paid/free, price, input shape) and a diff vs the last snapshot (added / removed / re-priced tools). |
| **Free read surfaces** | — | — |
| `/api/x402/my-receipts` | free | A buyer's own settled receipts, gated by a wallet signature (SIWX) rather than a payment. |
| `/api/x402/mcp-perf` | free | MCP tool latency dashboard data. |
| `/api/x402/service-pricing-report` | free | Tracked upstream-dependency price catalog + active price-increase/-drop alerts. |
+| `/api/x402/granite-health` | free | IBM Granite inference SLA feed, read from the verdicts the autonomous loop's paid 6-hourly probe writes. |
+| `/api/x402/glb-optimization-report`| free | GLB Size Optimizer catalog feed: what the `glb-size-optimizer` autonomous-loop entry has measured. |
+| `/api/x402/network-cost` | free | Cross-chain payment-cost recommendation feed from the hourly cross-chain-cost pipeline snapshots. |
| `/api/x402/echo` | free | httpbin for x402 — decodes your `X-PAYMENT` header (signatures redacted) and returns a local verify verdict without settling. See [x402 dev tools](x402-dev-tools.md). |
| `/api/x402/debug` | free | Diagnoses a failed 402 exchange (`{challenge, payment, response}`) into an ordered `{severity, field, problem, fix}` list. See [x402 dev tools](x402-dev-tools.md). |
| `/api/x402/verify-receipt` | free | Recomputes a paid response's SHA-256 attestation and confirms a settlement tx on-chain. See [x402 dev tools](x402-dev-tools.md). |
@@ -71049,7 +78754,7 @@ input and do not promote any specific token.
---
-<a id="sec-286"></a>
+<a id="sec-340"></a>
> **Source:** `docs/x402-revenue.md` · [↑ table of contents](#table-of-contents)
@@ -71183,13 +78888,15 @@ LIMIT 10;
## The revenue report — `/api/x402/analytics`
You don't have to query SQL. The `analytics` endpoint serves the same numbers,
-pre-aggregated. It is itself a [paid endpoint](x402-endpoints.md) ($0.005 default)
-— pass `report=revenue` and a `period`:
+pre-aggregated. It is itself a [paid endpoint](x402-endpoints.md) ($0.005 default).
+It is a `POST` endpoint: pass `report` and `period` in the JSON body:
```bash
# After settling the 402 challenge (see the x402 buyer client doc), retry with:
-curl -s "https://three.ws/api/x402/analytics?report=revenue&period=24h" \
- -H "X-PAYMENT: <settled-payment-header>"
+curl -s -X POST https://three.ws/api/x402/analytics \
+ -H 'content-type: application/json' \
+ -H "X-PAYMENT: <settled-payment-header>" \
+ -d '{"report":"revenue","period":"24h"}'
```
`report` accepts: `revenue`, `x402_volume`, `clubs`, `marketplace`,
@@ -71197,7 +78904,8 @@ curl -s "https://three.ws/api/x402/analytics?report=revenue&period=24h" \
`6h`, `24h`, `7d`, `30d`, `all`.
The `revenue` report shape
-([`revenue-analytics.js`](../api/_lib/x402/revenue-analytics.js)):
+([`revenue-analytics.js`](../api/_lib/x402/revenue-analytics.js)); money fields
+are serialized as fixed 6-decimal strings:
```json
{
@@ -71206,26 +78914,26 @@ The `revenue` report shape
"since": "2026-06-29T00:00:00.000Z",
"generated_at": "2026-06-30T00:00:00.000Z",
"totals": {
- "gross_usd": 12.34,
- "net_platform_usd": 11.9,
- "settlement_fee_usd": 0.44,
+ "gross_usd": "12.340000",
+ "net_platform_usd": "11.900000",
+ "settlement_fee_usd": "0.440000",
"total_payments": 247,
"failed_payments": 3,
"unique_payers": 18,
- "avg_payment_usd": 0.05
+ "avg_payment_usd": "0.050000"
},
"fee_splits": {
- "gross_usd": 12.34,
- "settlement_fee_usd": 0.44,
- "net_platform_usd": 11.9,
+ "gross_usd": "12.340000",
+ "settlement_fee_usd": "0.440000",
+ "net_platform_usd": "11.900000",
"effective_fee_rate": 0.0357,
- "fee_per_settlement_usd": 0.0018,
+ "fee_per_settlement_usd": "0.001800",
"fee_source": "..."
},
"by_endpoint": [
- { "endpoint": "/api/x402/token-intel", "count": 120, "gross_usd": 1.2, "share": 0.097 }
+ { "endpoint": "/api/x402/token-intel", "count": 120, "gross_usd": "1.200000", "share": 0.097 }
],
- "top_endpoint": { "endpoint": "/api/x402/token-intel", "gross_usd": 1.2 }
+ "top_endpoint": { "endpoint": "/api/x402/token-intel", "count": 120, "gross_usd": "1.200000" }
}
```
@@ -71407,7 +79115,7 @@ settled activity (include it), and label it as such.
---
-<a id="sec-287"></a>
+<a id="sec-341"></a>
> **Source:** `docs/x402-ring-economy.md` · [↑ table of contents](#table-of-contents)
@@ -71608,14 +79316,14 @@ then kept in a verified, watched, auto-fundable state:
non-role ATAs to reclaim their rent. Audit + reclaim only — never a spend.
- **Endpoint catalog** —
[api/_lib/x402/ring-catalog.js](../api/_lib/x402/ring-catalog.js) is the single
- source of truth for **every** paid x402 endpoint on the platform (46 entries:
- tips, services, intel, health checks, settlement). Each entry declares the exact
- `method`, `query`/`body()` request contract, and default price the handler
- actually validates — derived by reading the handler, so a ring call never spends
- money on a request the endpoint would reject. **35 are `autobuy`** (safe to
- purchase on the loop); the **11 `autobuy:false`** entries (real coin mints, real
- LLM spend, dynamic third-party payouts) are covered by one-time verification, not
- the loop, each with a justification in the source. Adding a new paid endpoint
+ source of truth for **every** paid x402 endpoint on the platform (84 entries as
+ of July 2026: tips, services, intel, health checks, settlement). Each entry
+ declares the exact `method`, `query`/`body()` request contract, and default
+ price the handler actually validates (derived by reading the handler), so a
+ ring call never spends money on a request the endpoint would reject. **45 are
+ `autobuy`** (safe to purchase on the loop); the **39 `autobuy:false`** entries
+ (real coin mints, real LLM spend, dynamic third-party payouts) are covered by
+ one-time verification, not the loop, each with a justification in the source. Adding a new paid endpoint
without cataloging it fails `tests/x402-ring-catalog.test.js` (it greps every
`paidEndpoint(` construction site and asserts each is cataloged).
- **Volume engine** — the existing autonomous loop
@@ -71625,8 +79333,9 @@ then kept in a verified, watched, auto-fundable state:
rotation (`rotationPlan()`), mapped into the shared driver in
[volume-shared.js](../api/_lib/x402/pipelines/volume-shared.js). The rotation is
weighted so **every autobuy endpoint is exercised at least once per hour** at the
- stock 5-minute cadence (12 ticks × 4 = 48 selections/hour ≥ the 38-entry
- rotation) — test-proven, not asserted.
+ stock 5-minute cadence (12 ticks × 6 selections = 72/hour ≥ the 48-entry
+ weighted rotation over the 45 autobuy endpoints), test-proven in
+ `tests/x402-ring-catalog.test.js`, not asserted.
- **Coverage proof** —
[scripts/x402-ring-coverage-sweep.js](../scripts/x402-ring-coverage-sweep.js)
pays every catalog entry once and records the facilitator settle signature +
@@ -71870,6 +79579,91 @@ daily volume is an env change (`X402_PRICE_RING_SETTLE`,
— in July 2026 a defaults-only lift to $35/settle put every tick into
back-pressure and flat-lined the visible ring economy for hours.
+## Payer pool — many distinct payers, one reused set of wallets
+
+By default the ring pays from a single seed wallet. The **payer pool** lets it pay
+from hundreds-to-thousands of distinct, attributed wallets **at no extra per-settle
+cost**, so the economy reads as many participants instead of one cron. It is
+[api/_lib/x402/pool.js](../api/_lib/x402/pool.js) + the
+[ring-pool-fund](../api/_lib/x402/pipelines/ring-pool-fund.js) pipeline, off by
+default (`X402_RING_POOL_ENABLED`).
+
+**Reused, not throwaway — the efficiency call.** A fresh wallet per call would add
+a funding hop **and** a one-time USDC-ATA rent (~0.00204 SOL ≈ $0.15) on *every*
+settle, roughly tripling the per-settle cost, and the wallets would still cluster
+on-chain in one hop (they are all funded from the same float, the textbook cluster
+signature). A **reused pool** pays that rent once per wallet, keeps each settle on
+the 1-signature self-pay hot path (**1 tx/settle**, same as the single payer), and
+rotates least-recently-used-first so a few hundred wallets produce effectively
+unlimited distinct-payer sequences. 1,000 reused wallets rotating at the stock
+cadence means each pays only a few times a day — genuinely distinct — for ~$150 of
+one-time, reclaimable ATA rent.
+
+**How it wires in.**
+
+- **Storage.** Each wallet's key is secret-box-encrypted at rest (same scheme as
+ custodial agent wallets, `WALLET_ENCRYPTION_KEY`) in `x402_ring_pool`. A
+ 500–1,000-wallet pool can't live in env vars, so the three role wallets stay in
+ env and the pool lives in the DB.
+- **Membership is automatic.** The generator mirrors every pool pubkey into
+ `x402_ring_wallets(role='pool')`, so `ringAllowedAddresses()` (the controlled
+ set), the on-chain leak scanner (classifies them **internal**), and the
+ facilitator allowlist all pick them up with no extra wiring. Pool wallets stay
+ labeled internal — they are dogfooding payers, never presented as organic demand.
+- **Sweepback-safe by construction.** Pool wallets are deliberately **not** in
+ [api/_lib/solana-signers.js](../api/_lib/solana-signers.js), so the excess-mode
+ `treasury-sweepback` never enumerates them. This is the same class of bug that
+ used to close the treasury's USDC ATA every run (see the box below) — it cannot
+ recur across 1,000 pool wallets because they are never in the sweepback set.
+- **Rotation.** `claimNextPayer()` atomically claims the least-recently-used enabled
+ wallet (`FOR UPDATE SKIP LOCKED`, so concurrent ticks never collide), and the ring
+ tick passes it per-settle via the shared driver's `buyerFor` hook. An empty or
+ unavailable pool falls back to the seed payer, so the ring never stalls.
+- **Funding.** `ring-pool-fund` (120s cooldown) reads all pool balances in
+ **batches** (`getMultipleAccountsInfo`, ≤100/call) and tops up in **batched**
+ transactions: SOL from the sponsor/master, USDC from the treasury, each below a
+ floor up to a target, sweeping overfull wallets back. Funding 500–1,000 wallets is
+ a handful of transactions per run, not one per wallet. Recirculation, not spend —
+ it never consumes the daily cap. The pure decision is `planPoolFunding()`
+ (unit-tested); the effectful execution batches and records each move to
+ `x402_ring_ledger` as `kind='fund'`.
+
+**Turning it on.**
+
+```bash
+# 1. Mint the pool (encrypts + stores keys, registers membership — no funding).
+node scripts/x402-ring-pool-setup.mjs --grow --size=750
+
+# 2. See exactly what to fund.
+node scripts/x402-ring-pool-setup.mjs --funding-plan --size=750
+
+# 3. Enable rotation + set the size on the service (config-only, pre-approved).
+gcloud run services update three-ws-api --region us-central1 \
+ --update-env-vars X402_RING_POOL_ENABLED=true,X402_RING_POOL_SIZE=750
+```
+
+**Env knobs:** `X402_RING_POOL_ENABLED` (off by default), `X402_RING_POOL_SIZE`
+(target), `X402_RING_POOL_SOL_FLOOR_LAMPORTS` / `_TARGET_LAMPORTS` (default
+0.008 / 0.012 SOL), `X402_RING_POOL_USDC_FLOOR_ATOMIC` / `_TARGET_ATOMIC` /
+`_CEIL_ATOMIC` (default $0.50 / $2 / $4), `X402_RING_POOL_FUND_MAX_PER_RUN`
+(default 60).
+
+> ### Fixed 2026-07-17 — the treasury-sweepback rent churn
+>
+> The ring treasury (`wwwww…ccrU`, `X402_PAY_TO_SOLANA`) is the **same physical
+> wallet** as the `pump-x402-launcher` signer (`PUMP_X402_LAUNCHER_SECRET_KEY_B64`
+> → secret `wallet-x402-treasury-b64`). That registry entry lacked `holdsTokens`,
+> so the excess-mode `treasury-sweepback` consolidated the treasury's USDC up to
+> the economy master **and closed its USDC ATA every run**. Every following ring
+> settle then had to recreate the ATA at **2,039,280 lamports** of rent — which
+> dragged the measured per-settle fee to ~570,000 lamports (114× the 5,000-lamport
+> self-pay floor) and quietly drained the closed loop's float into the master (why
+> `sweeps=0` on the rebalancer: the treasury was emptied before it could
+> recirculate). The fix is one line — `holdsTokens: true` on that registry entry —
+> so excess-mode sweepback never touches the ring float again; only an explicit
+> drain still consolidates it. Pair it with `X402_RING_SELF_PAY=true` (1 signature,
+> not 2) and the per-settle fee returns to the ~5,000-lamport floor.
+
## Agents in the ring — buyers with names, not a cron
The cadence above keeps volume flowing, but volume alone still reads as "a cron
@@ -72133,16 +79927,130 @@ curl -s -H "Authorization: Bearer $CRON_SECRET" \
---
-<a id="sec-288"></a>
+<a id="sec-342"></a>
+
+> **Source:** `docs/x402-studio.md` · [↑ table of contents](#table-of-contents)
+
+# x402 Studio: the Stripe of x402
+
+x402 Studio is the merchant console for running a paid x402 business on three.ws. In one page you define products and pricing, point them at a payout wallet, add named agent wallets with spend caps, send and receive real USDC (addressed by `.sol` name or `@username`, not just raw base58), drag-and-drop a hosted storefront, generate an embeddable pay button for any site, add charity or round-up giving, and lock down CORS and security. Everything settles on-chain in USDC, Solana first.
+
+Page: [/x402/studio](https://three.ws/x402/studio)
+
+APIs: `/api/x402-merchant` (settings), `/api/x402-skus` (products), `/api/sns` (name resolution), `/api/x402/pay-by-name` (USDC send). See [x402: paid agent skills](./x402.md) for the underlying payment protocol.
+
+## Why it exists
+
+x402 turns any HTTP endpoint into a paid one: the server answers `402 Payment Required` with a manifest, the caller pays in USDC, and the call retries and settles. That primitive is powerful but low-level. Studio is the console on top of it, the difference between "you can hand-write a 402 challenge" and "you can run a storefront." A merchant configures once and gets hosted checkout links, a shareable storefront, a copy-paste pay button, revenue stats, and payouts to a wallet they control, without writing payment code. It is the seller-facing companion to the [x402 buyer client](./x402-buyer.md) and the [paid endpoint catalog](./x402-endpoints.md).
+
+## How it works
+
+The page (`public/x402/studio.js`) is a dependency-free vanilla-JS single-page app with seven hash-routed tabs: Overview, Products, Wallets, Storefront, Embed builder, Giving, and Security and API. Every request goes through a helper that sends the session cookie (`credentials: 'include'`). All USDC amounts use 6 decimals.
+
+**Merchant settings** (`/api/x402-merchant`) is one row per user in `x402_merchant_settings`. A `GET` lazily creates it and returns your payout and agent wallets, default settlement network (`solana` by default, with `base` also allowed), branding, CORS allow-list, security caps, giving config, and storefront layout. It never returns the API key hash. A `PUT` validates against a Zod schema and upserts. `POST ?action=rotate-key` mints an `x402_live_...` key, stores only its SHA-256 hash and an 18-character prefix, and shows the secret once. A public `GET ?store=<handle>` returns a published storefront and its active products for `/store/<handle>`.
+
+**Products** (`/api/x402-skus`) are hosted checkout links in `x402_skus`. A product carries a permanent slug, a paid target endpoint (which must itself return 402), a method, an optional request body, branding, and an optional display price. Creating one yields a shareable link at `/pay/c/<slug>` that opens the drop-in payment modal pre-wired to the target. Owner reads compute `paid_calls` and `gross_atomics` from settled calls; `GET ?id=<id>&stats=1` returns full revenue stats and the last 25 payments; `GET ?slug=<slug>` is the public checkout read.
+
+**Payout and agent wallets.** The payout wallet (Solana, with an EVM/Base option) is where settled USDC lands. Agent wallets are named on-chain identities with a role of `payer` (auto-pays for services) or `payout` (receives), a chain, and independent per-call and daily caps stored as atomics. Up to 50 agent wallets are allowed.
+
+**SNS name resolution** (`/api/sns`) resolves a `.sol` name (including subdomains like `nich.threews.sol`) to an address, and reverse-resolves an address to its primary `.sol`, via Bonfida's `@bonfida/spl-name-service` `resolve()` on Solana mainnet. It always answers 200 (`resolved: false` on a miss, not a 404) and caches results in-process (5 minutes positive, 60 seconds negative).
+
+**Real USDC send** (`/api/x402/pay-by-name`) routes a payment by name across three namespaces in order: a raw base58 address, a `<name>.sol` resolved on-chain, or an `@username` mapped to that user's default agent's Solana address. Studio uses `mode: 'prep'`, which builds an unsigned SPL USDC transfer (mint `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`) with your Phantom wallet as fee payer and source, returns the base64 transaction for signing, and caps the amount at 10,000 USDC per call. This send path is Solana-only (Phantom plus SPL USDC); Base is supported as a payout, agent, or charity destination, not in the send tool.
+
+**Storefront builder.** A palette of eight blocks (hero, product grid, single product, text, image, button, divider, footer) drops onto a canvas with HTML5 drag-and-drop and reorder. Save keeps it a draft; Publish sets `store_published` and serves it at `/store/<handle>`. Layout is capped at 60 blocks.
+
+**Embed builder.** Pick a product, a label, a size, a shape, and a theme, and it generates a working pay button. The generated snippet loads the x402 runtime and a `data-x402-*` attributed button:
+
+```html
+<!-- x402 pay button, powered by three.ws -->
+<script type="module" src="https://three.ws/x402.js"></script>
+<button
+ data-x402-endpoint="https://your-api.example.com/paid"
+ data-x402-method="GET"
+ data-x402-merchant="Your merchant name"
+ data-x402-action="Summarize article"
+ style="...">Pay · Summarize article</button>
+```
+
+The `type="module"` on the script is load-bearing: `/x402.js` uses `import.meta.url`, which throws in a classic script.
+
+**Giving.** A charity split donates a fixed share of every settled payment to a cause wallet, stored as `charity_bps` (percent times 100, 0 to 10000). Round-up rounds the buyer's total up to the nearest unit (1, 0.5, 0.25, 0.1, or 5 USDC) and sends the difference to the same cause wallet. Round-up requires a charity address first, and the server enforces that the charity address matches its declared chain.
+
+**Security and CORS.** Max per-call and per-day USDC caps, an optional Sign-In-With-X requirement, settlement-network selection, and a CORS allow-list (one origin per line, `https://host[:port]`, up to 50; empty means three.ws-hosted pages only). The developer section holds an optional facilitator URL, a settlement webhook, and the rotatable API key.
+
+## Walkthrough
+
+1. Open [/x402/studio](https://three.ws/x402/studio). Signed out, it shows a sign-in card linking `/login?next=/x402/studio`.
+2. On **Wallets**, set your Solana payout address (use the Resolve `.sol` button to paste a name instead of an address). This is where settled USDC lands.
+3. On **Products**, create a product: name it, give it a slug, point it at your paid endpoint that returns 402, and save. Copy its `/pay/c/<slug>` link.
+4. On **Embed builder**, pick that product, style the button, and copy the snippet into any site.
+5. Optionally publish a **Storefront** at `/store/<handle>`, add **Giving**, and tighten **Security and API** (caps, CORS, an API key).
+6. To pay someone, use the send tool: enter a `.sol` name or address and an amount, and approve the transfer in Phantom.
+
+## Examples
+
+```bash
+# Resolve a .sol name (or @username) to a Solana address (public, no auth)
+curl 'https://three.ws/api/sns?name=nich.threews.sol'
+
+# Read a public storefront and its active products
+curl 'https://three.ws/api/x402-merchant?store=<handle>'
+
+# Read a public checkout SKU (what /pay/c/<slug> loads)
+curl 'https://three.ws/api/x402-skus?slug=<slug>'
+```
+
+```javascript
+// Build an unsigned USDC transfer addressed by name (mode: 'prep')
+const res = await fetch('https://three.ws/api/x402/pay-by-name', {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ credentials: 'include',
+ body: JSON.stringify({
+ name: 'nich.threews.sol',
+ amount_usdc: 5,
+ mode: 'prep',
+ payer_wallet: '<YOUR_SOLANA_ADDRESS>',
+ }),
+});
+const { tx_base64, blockhash } = await res.json();
+// Deserialize tx_base64, sign with Phantom, and send. Amount is capped at 10,000 USDC per call.
+```
+
+## States and limits
+
+- **Auth.** The console requires a session; every mutating endpoint is owner-scoped (401 unauthenticated, 403 for another user's resource) and rate-limited. Public reads (storefront, checkout SKU, SNS resolve) need no auth.
+- **Spend confirmation.** A USDC send always requires explicit Phantom approval, is capped at 10,000 USDC per call server-side, and rejects a self-pay. Agent-signed sends additionally enforce the agent's per-transaction and daily caps and re-check the recipient against fresh resolution (409 `recipient_changed`) to defend against name-poisoning. Archiving a product, removing an agent wallet, and rotating the API key each require an explicit confirm.
+- **Validation.** Solana addresses base58 32-44, EVM `0x` plus 40 hex, slugs lowercase and hyphenated 3-64, publishing requires a globally unique handle (409 `handle_taken`), and CORS origins must be `https?://` origins.
+- **Empty states.** Dedicated empties for no products, no agent wallets, nothing to embed, and an empty storefront canvas, plus a retry card on a fatal boot error.
+- **Networks.** SNS and the send tool are Solana mainnet only. Settlement supports Solana and Base; the default is Solana.
+
+## Related
+
+- [x402: paid agent skills](./x402.md): the payment protocol Studio sits on top of
+- [x402 revenue and receipts](./x402-revenue.md): where settled payments are recorded
+- [x402 paid endpoints](./x402-endpoints.md): the platform's own catalog of paid endpoints
+- [x402 buyer client](./x402-buyer.md): the caller side of a 402 challenge
+- [x402 developer tools](./x402-dev-tools.md) and [x402 distribution](./x402-distribution.md)
+- Pages: [/x402/studio](https://three.ws/x402/studio) · [/x402](https://three.ws/x402)
+
+---
+
+<a id="sec-343"></a>
> **Source:** `docs/x402.md` · [↑ table of contents](#table-of-contents)
# x402 — paid agent skills
-This codebase implements [x402](https://x402.org) `HTTP 402 Payment Required`
-on top of Pump.fun agent payments. Callers pay an agent in any SPL token to
-invoke a skill; the agent verifies the on-chain payment and dispatches the
-call.
+x402 is how machines pay for web requests: a paid endpoint answers
+`HTTP 402 Payment Required` with a price, the caller settles a small on-chain
+payment, and the retried request goes through. This page documents three.ws's
+implementation of [x402](https://x402.org) for **agent skills**, built on top
+of Pump.fun agent payments: callers pay an agent in any SPL token to invoke a
+skill, and the agent verifies the on-chain payment before dispatching the
+call. It is written for developers wiring paid skills (server side) or paying
+for them (client side); the platform's own catalog of paid endpoints lives at
+[x402 paid endpoints](x402-endpoints.md).
**Live activity:** [x402scan dashboard](https://www.x402scan.com/server/17cbd874-52ac-4920-a020-b22ff2489a07)
— browse paid calls, revenue, and per-skill pricing for this server.
@@ -72185,7 +80093,8 @@ Reference implementation: `api/agents/x402/[action].js` (the consolidated
"amount": "10000",
"currency": "<mint base58>",
"recipient": "<owner wallet base58>",
- "memo": "<u64 invoice nonce>",
+ "recipient_name": "<resolved receiver label, when known>",
+ "memo": "<unix-seconds nonce string>",
"valid_until": <unix>,
"intent_url": "/api/agents/payments/pay-prep",
"verify_url": "/api/agents/payments/pay-confirm",
@@ -72198,8 +80107,9 @@ Discovery:
- `GET /.well-known/x402` — site-level resource list.
- `GET /api/agents/x402/manifest?agent_id=…&skill=…` — per-skill price
manifest, returned as 200 (not 402) for prefetch.
-- The 402 response includes a `Link: <…>; rel="payment-manifest"` header
- pointing at the manifest URL.
+- The 402 response includes a `Link` header with `rel="payment-config"`
+ (pointing at `/.well-known/x402`) and `rel="payment-manifest"` (pointing at
+ the per-skill manifest URL).
## Pricing
@@ -72309,7 +80219,7 @@ Each package has its own repository with a full README, API reference, and examp
---
-<a id="sec-289"></a>
+<a id="sec-344"></a>
> **Source:** `docs/zauth/database.md` · [↑ table of contents](#table-of-contents)
@@ -72455,7 +80365,7 @@ Use this endpoint to browse all known x402 endpoints before your agents commit t
---
-<a id="sec-290"></a>
+<a id="sec-345"></a>
> **Source:** `docs/zauth/index.md` · [↑ table of contents](#table-of-contents)
@@ -72479,7 +80389,7 @@ zauth is the security and trust layer that allows agents to act with confidence,
---
-<a id="sec-291"></a>
+<a id="sec-346"></a>
> **Source:** `docs/zauth/provider-hub.md` · [↑ table of contents](#table-of-contents)
@@ -72581,7 +80491,7 @@ Supply your EVM or Solana private keys to enable automatic refunds when your end
---
-<a id="sec-292"></a>
+<a id="sec-347"></a>
> **Source:** `docs/zauth/reposcan.md` · [↑ table of contents](#table-of-contents)
@@ -72907,7 +80817,7 @@ TypeScript -@x402/fetch
---
-<a id="sec-293"></a>
+<a id="sec-348"></a>
> **Source:** `docs/zauth/vector.md` · [↑ table of contents](#table-of-contents)
diff --git a/docs/agent-abilities/wallet/01-balance.md b/docs/agent-abilities/wallet/01-balance.md
index 10c68b532..3da2c291c 100644
--- a/docs/agent-abilities/wallet/01-balance.md
+++ b/docs/agent-abilities/wallet/01-balance.md
@@ -2,7 +2,7 @@
> Your agent's real Solana balance, live from the chain — with a USD estimate and a receipt trail for every transaction.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Balance** tab.*
## What it does
@@ -15,7 +15,7 @@ Every number is read live from the Solana blockchain — there are no stored or
## Every feature
- Live SOL balance in large display type, read from the chain on every load
-- USD estimate under the balance from a live SOL/USD price feed (Jupiter primary, CoinGecko fallback, 60s cache) with extra decimals for sub-$1 amounts
+- USD estimate under the balance from a live SOL/USD price feed (Jupiter primary, then CoinGecko, Coinbase, and DefiLlama fallbacks, 60s cache) with extra decimals for sub-$1 amounts
- Auto-refresh: balance re-polls every 30 seconds while the tab is visible, pauses when hidden
- Manual Refresh button with spinning icon and disabled 'Refreshing…' state while in flight
- Shortened wallet address with full-address tooltip on hover
@@ -52,9 +52,26 @@ Strictly read-only — this tab can never move funds. The activity feed is owner
- The activity feed: green +SOL and red −SOL deltas, plain-English summaries, 'Failed' badges, and every row deep-linked to the block explorer
- The failure state most wallets get wrong: when Solana is unreachable it says 'Balance unavailable — retrying automatically, your funds are safe' in amber instead of showing a terrifying $0
+## Try it
+
+Any agent's balance is a public read, no sign-in needed:
+
+```bash
+curl 'https://three.ws/api/agents/<agent-id>/solana?network=mainnet'
+```
+
+The response carries the wallet address and live SOL balance. In the product, open `three.ws/agent/<agent-id>/wallet`: the Balance tab is the first screen, and if you own the agent you also get the Recent Activity feed.
+
## API surface
- `GET /api/agents/:id/solana?network=mainnet|devnet (live balance, address, vanity/SNS metadata; public read for visitors)`
- `GET /api/agents/:id/solana/activity?network=&limit=10 (owner-only parsed transaction feed)`
- `https://lite-api.jup.ag/price/v3 (SOL/USD price, primary)`
-- `https://api.coingecko.com/api/v3/simple/price (SOL/USD price, fallback)`
+- `https://api.coingecko.com/api/v3/simple/price (SOL/USD price, first fallback; Coinbase and DefiLlama sit behind it)`
+
+## Related
+
+- [Deposit](./04-deposit.md)
+- [Portfolio](./03-portfolio.md)
+- [Withdraw](./18-withdraw.md)
+- [The Agent Wallet chapter](../chapters/10-the-agent-wallet.md)
diff --git a/docs/agent-abilities/wallet/02-go-live.md b/docs/agent-abilities/wallet/02-go-live.md
index 1b75bab7d..223c341bd 100644
--- a/docs/agent-abilities/wallet/02-go-live.md
+++ b/docs/agent-abilities/wallet/02-go-live.md
@@ -2,7 +2,7 @@
> One tap sends real SOL from the three.ws treasury to your agent's wallet and puts it live on the Money Pulse — with an explorer-verifiable receipt.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Go Live** tab.*
## What it does
@@ -50,8 +50,20 @@ Owner-only end to end: the tab is hidden from non-owners and the server rejects
- The hero moment: 'Bring [your agent] to life' with the grant amount in a monospace pill and a single Activate button — one tap from empty wallet to live, funded agent.
- The payoff handoff: the success toast fires with the granted amount, and one click lands on the Money Pulse where the newly activated agent is beating in the platform-wide live feed of real on-chain activity.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the agent's owner and pick the **Go Live** tab.
+2. Tap **Activate**. The grant amount is shown on the button's pill before you claim.
+3. When the transaction settles, the receipt card appears with the amount, network, and an explorer-linked signature; click it to verify the transfer on-chain.
+
## API surface
- `GET /api/agents/:id/activate`
- `POST /api/agents/:id/activate`
- `GET /api/csrf-token`
+
+## Related
+
+- [Balance](./01-balance.md)
+- [Deposit](./04-deposit.md)
+- [Pulse](./09-pulse.md)
diff --git a/docs/agent-abilities/wallet/03-portfolio.md b/docs/agent-abilities/wallet/03-portfolio.md
index 1aa3af078..7ebc0a788 100644
--- a/docs/agent-abilities/wallet/03-portfolio.md
+++ b/docs/agent-abilities/wallet/03-portfolio.md
@@ -2,7 +2,7 @@
> Your agent's entire trading life — net worth, holdings, P&L, and risk — on one live screen that never fakes a number.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Portfolio** tab.*
## What it does
@@ -55,7 +55,25 @@ Owner-only at two layers: the tab is hidden from non-owner viewers in the wallet
- The allocation bar: the whole portfolio's composition in one color-coded strip — Solana violet, $THREE green, stablecoin teal, and warm hues for the memecoin sleeve — with hover tooltips per slice
- The risk panel's plain-English verdicts: heat-colored meters plus flags like '90% of net worth is held in SOL / stable reserve — dry powder ready to deploy' instead of jargon or false alarms
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Portfolio** tab.
+2. The first snapshot loads, then the pulsing live dot confirms the SSE stream is revaluing everything every 20 seconds.
+3. Hover the allocation bar for per-asset tooltips, and click **Trade** on any holding to jump to the Trade tab with the mint pre-copied.
+
+Owners can also read the same data directly:
+
+```bash
+curl -b <session-cookie> 'https://three.ws/api/agents/<agent-id>/portfolio?network=mainnet'
+```
+
## API surface
- `GET /api/agents/:id/portfolio?network=mainnet|devnet`
- `GET /api/agents/:id/portfolio/stream?network=mainnet|devnet (SSE)`
+
+## Related
+
+- [Balance](./01-balance.md)
+- [Trade](./08-trade.md)
+- [Snipe](./10-snipe.md)
diff --git a/docs/agent-abilities/wallet/04-deposit.md b/docs/agent-abilities/wallet/04-deposit.md
index 7a56c6bb9..54d1feb5b 100644
--- a/docs/agent-abilities/wallet/04-deposit.md
+++ b/docs/agent-abilities/wallet/04-deposit.md
@@ -2,7 +2,7 @@
> Fund any agent in one scan — a tap-to-pay Solana QR with live on-chain confirmation the second the money lands.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Deposit** tab.*
## What it does
@@ -57,9 +57,27 @@ Public-safe by design: the tab exposes only the agent's public receive address
- One-tap tipping: preset chips (◎0.05 to $25), an honest stage-by-stage send flow (approve in your wallet → broadcasting → confirming), and a real Solscan receipt at the end
- A first-time user with zero crypto hits a paid feature, clicks Add funds, buys $25 of USDC by card in a Coinbase popup — and watches the modal flip to '✓ Deposit confirmed — 25.00 USDC added' by itself the second the money lands, never having left the page
+## Try it
+
+1. Open `three.ws/agent/<agent-id>/wallet` (any visitor can) and pick the **Deposit** tab.
+2. Scan the QR with Phantom, Solflare, or Backpack, or tap **Open in a wallet app** on your phone; optionally type an amount first and the QR rewrites itself.
+3. Keep the tab open: the moment your SOL lands on-chain it flips to a green received confirmation.
+
+The address and balance behind the QR are a public read:
+
+```bash
+curl 'https://three.ws/api/agents/<agent-id>/solana?network=mainnet'
+```
+
## API surface
- `GET /api/agents/:id/solana?network= — public, no-auth wallet read: agent's Solana address + live SOL balance (60s fleet-wide cache, RPC failover)`
- `GET /api/agents/:id/solana/activity?network=&limit= — recent on-chain signatures with per-tx SOL deltas and summaries (owner-authenticated)`
- `POST /api/agents/:id/solana/tip — records a confirmed browser-wallet tip after independent on-chain re-verification of the signature`
- `GET /api/onramp/link`
+
+## Related
+
+- [Balance](./01-balance.md)
+- [Go Live](./02-go-live.md)
+- [Withdraw](./18-withdraw.md)
diff --git a/docs/agent-abilities/wallet/05-copilot.md b/docs/agent-abilities/wallet/05-copilot.md
index e01a06e51..503800b24 100644
--- a/docs/agent-abilities/wallet/05-copilot.md
+++ b/docs/agent-abilities/wallet/05-copilot.md
@@ -2,7 +2,7 @@
> Talk to your agent's wallet — by text or voice — and it answers with live on-chain data, then preps guarded trades you confirm with one tap.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Copilot** tab.*
## What it does
@@ -57,6 +57,12 @@ Owner-only on both client and server — the tab is hidden from visitors and the
- Ask 'how's my portfolio?' and the agent streams back real data cards as it reads the chain: actual SOL balance, every holding, and open positions glowing green or red with live PnL
- Say 'pause all trading' and the kill switch flips through a confirm card — full risk management as a conversation, in your agent's own cloned voice
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Copilot** tab.
+2. Ask "How's my portfolio?" or type `/portfolio`; the reply streams in with live data cards.
+3. Say "buy 0.1 SOL of <mint>" to get a confirm card with a fresh quote and firewall verdict; nothing executes until you tap Confirm.
+
## API surface
- `POST /api/agents/:id/copilot (SSE conversation turn with tool events, proposals, and streamed narration)`
@@ -65,3 +71,9 @@ Owner-only on both client and server — the tab is hidden from visitors and the
- `GET /api/agents/:id/voice (agent's voice configuration for spoken replies)`
- `POST /api/tts/eleven (ElevenLabs cloned-voice speech)`
- `POST /api/tts/speak (free-lane server TTS fallback)`
+
+## Related
+
+- [Trade](./08-trade.md)
+- [Policy](./17-policy.md)
+- [Portfolio](./03-portfolio.md)
diff --git a/docs/agent-abilities/wallet/06-trust.md b/docs/agent-abilities/wallet/06-trust.md
index ad62edb27..2cf8e8ab1 100644
--- a/docs/agent-abilities/wallet/06-trust.md
+++ b/docs/agent-abilities/wallet/06-trust.md
@@ -2,7 +2,7 @@
> A credit bureau plus proof-of-reserves for AI agents — one 0–100 trust score where every point traces to real money on-chain.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Trust** tab.*
## What it does
@@ -52,10 +52,30 @@ The score is computed exclusively server-side from real ledger and chain reads
- The Proof-of-Reserves header — a big live USD reserves figure, a 'Fully reserved' solvency verdict, a one-tap Verify-on-chain button, and a flow feed where every single payment links to its Solana transaction signature. 'Trustless, not trust-us.'
- The Access & unlocks tracker — reputation as a literal key, with live progress bars toward the Arena Elite Floor and the $THREE Holder Lounge, showing exactly which requirement is the blocker and how far along you are.
+## Try it
+
+Both reads are public, no sign-in needed:
+
+```bash
+# 0-100 financial reputation score with all ten pillars
+curl 'https://three.ws/api/agents/<agent-id>/reputation'
+
+# live proof-of-reserves: holdings, lifetime flows, obligations
+curl 'https://three.ws/api/agents/<agent-id>/solana/reserves?network=mainnet'
+```
+
+In the product, open `three.ws/agent/<agent-id>/wallet` and pick the **Trust** tab; owner and visitor see the same numbers.
+
## API surface
- `GET /api/agents/:id/reputation`
- `GET|POST /api/agents/reputation-batch`
-- `GET /api/agents/:id/solana/reserves (alias /api/agents/:id/reserves)`
+- `GET /api/agents/:id/solana/reserves`
- `GET /api/agents/:id/unlocks`
- `POST /api/agents/:id/unlocks/claim`
+
+## Related
+
+- [Pulse](./09-pulse.md)
+- [Proof of Custody](./20-proof-of-custody.md)
+- [Earn](./11-earn.md)
diff --git a/docs/agent-abilities/wallet/07-signals.md b/docs/agent-abilities/wallet/07-signals.md
index 78ffa5381..8f90ec465 100644
--- a/docs/agent-abilities/wallet/07-signals.md
+++ b/docs/agent-abilities/wallet/07-signals.md
@@ -2,7 +2,7 @@
> A copy-trading marketplace where only provably profitable agents can sell signals — and one red button kills any subscription instantly.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Signals** tab.*
## What it does
@@ -62,6 +62,12 @@ The whole tab is owner-only, and every write is authenticated, CSRF-protected, r
- The red 'Kill now' button on every subscription and its toast — 'Killed — no further pay or trade.' One click and the platform guarantees not another cent leaves the wallet and not another trade fires.
- A subscription card showing real money in motion: a green Live pill, '$0.25/signal', '34 fills', 'spent $8.50', right next to the caps that protect it — 'base 0.05 SOL · 1x · max 0.25 SOL'.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Signals** tab.
+2. If your agent's on-chain record clears the bar (12+ closed trades, 5+ coins, churn at or under 40%, positive realized profit), the publish form is unlocked; otherwise the scorecard shows exactly what's left.
+3. To follow a feed, browse the signal marketplace linked from the empty state, subscribe in Simulate mode first, then flip to Live once you trust it.
+
## API surface
- `GET /api/signals/feeds?agent_id=&network= (feed + publish eligibility for this agent)`
@@ -69,3 +75,9 @@ The whole tab is owner-only, and every write is authenticated, CSRF-protected, r
- `GET /api/signals/subscribe (list this owner's subscriptions with live spend/fill stats)`
- `POST /api/signals/subscribe ({ id, killed } instant kill, { id, status } pause/resume/stop, { id, action:'sync' } deliver now)`
- `Driven server-side by GET /api/cron/signal-fanout (every 2 minutes, cron-secret protected)`
+
+## Related
+
+- [Trade](./08-trade.md)
+- [Snipe](./10-snipe.md)
+- [Policy](./17-policy.md)
diff --git a/docs/agent-abilities/wallet/08-trade.md b/docs/agent-abilities/wallet/08-trade.md
index b51c432b5..5d2f8b0a9 100644
--- a/docs/agent-abilities/wallet/08-trade.md
+++ b/docs/agent-abilities/wallet/08-trade.md
@@ -2,7 +2,7 @@
> Your agent's wallet is a full trading desk — paste any pump.fun coin, see a live quote and a real on-chain safety verdict, and execute server-signed in two taps.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Trade** tab.*
## What it does
@@ -58,6 +58,18 @@ Owner-only execution behind session auth plus a single-use CSRF token (quotes ar
- The live quote card mid-typing: expected output, minimum received, and price impact that turns amber then red as size grows, with the route (bonding curve vs AMM) named on the ticket
- The unified trade history: manual buys and sells interleaved with the sniper's automated round-trips, each snipe showing green/red realized PnL in SOL and percent with explorer links
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Trade** tab.
+2. Paste a pump.fun mint address; the coin card, live quote, and pre-buy Safety panel appear as you size the trade.
+3. Confirm through the two-step review; the success banner links the executed transaction on the explorer.
+
+The holdings behind the tab are a public read:
+
+```bash
+curl 'https://three.ws/api/agents/<agent-id>/solana/holdings?network=mainnet'
+```
+
## API surface
- `POST /api/agents/:id/solana/trade (preview:true = live quote; without preview = server-signed execution)`
@@ -65,3 +77,9 @@ Owner-only execution behind session auth plus a single-use CSRF token (quotes ar
- `GET /api/agents/:id/solana/holdings (SOL balance + SPL token list, public read)`
- `GET /api/pump/coin?mint= (coin name/symbol/image/graduation metadata, best-effort)`
- `Jupiter Lite price API with CoinGecko fallback (client-side SOL/USD for the ≈$ readout, 60s cache)`
+
+## Related
+
+- [Portfolio](./03-portfolio.md)
+- [Orders](./12-orders.md)
+- [Copilot](./05-copilot.md)
diff --git a/docs/agent-abilities/wallet/09-pulse.md b/docs/agent-abilities/wallet/09-pulse.md
index 385e5c3eb..f3e73acf7 100644
--- a/docs/agent-abilities/wallet/09-pulse.md
+++ b/docs/agent-abilities/wallet/09-pulse.md
@@ -2,7 +2,7 @@
> Every tip, trade, launch, and payment your agent's wallet makes — streaming live, public, and provable on-chain.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Pulse** tab.*
## What it does
@@ -52,9 +52,29 @@ Strictly read-only — the tab displays money movement, it never moves money. Pr
- The four-card lifetime scoreboard: Tips received, Biggest tip, Public outflow, Launches — a wallet's whole public career at a glance
- The 'Show in the public Money Pulse' privacy switch: one flick and the wallet disappears from the platform-wide discovery feed, enforced on the server and logged to the audit trail
+## Try it
+
+The feed is public, no sign-in needed:
+
+```bash
+# this wallet's live public money story
+curl 'https://three.ws/api/pulse?agent_id=<agent-id>&network=mainnet&limit=20'
+
+# lifetime summary aggregates
+curl 'https://three.ws/api/pulse?view=agent-summary&agent_id=<agent-id>&network=mainnet'
+```
+
+In the product, open `three.ws/agent/<agent-id>/wallet` and pick the **Pulse** tab.
+
## API surface
- `GET /api/pulse?agent_id=<id>&network=&type=&limit=&cursor=&since= (scoped live feed, keyset-paginated with delta polling)`
- `GET /api/pulse?view=agent-summary&agent_id=<id>&network= (lifetime summary aggregates)`
- `GET /api/agents/:id/solana/pulse-visibility (owner-only: read the global-feed visibility setting)`
- `PUT /api/agents/:id/solana/pulse-visibility (owner-only, CSRF-protected: opt in/out of the global discovery feed)`
+
+## Related
+
+- [Balance](./01-balance.md)
+- [Trust](./06-trust.md)
+- [Earn](./11-earn.md)
diff --git a/docs/agent-abilities/wallet/10-snipe.md b/docs/agent-abilities/wallet/10-snipe.md
index b32fe80fc..22bd772df 100644
--- a/docs/agent-abilities/wallet/10-snipe.md
+++ b/docs/agent-abilities/wallet/10-snipe.md
@@ -2,7 +2,7 @@
> Describe a snipe strategy in plain English, backtest it against real launch history, and arm your agent to trade it from its own wallet — in one tap.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Snipe** tab.*
## What it does
@@ -67,8 +67,20 @@ Owner-only surface end to end: the tab is hidden from non-owners, and every endp
- The backtest card is the money shot: win rate, EV per trade, an ROI percentile band from worst to best, max drawdown, and a graduated/pumped/flat/rugged outcome bar — all computed by replaying the exact live entry and exit logic over real captured launches, stamped with a confidence badge.
- The 'Armed ✓' moment: one tap after a green backtest and the banner confirms the agent is now sniping autonomously from its own wallet, under its spend guards, disarmable any time from the dashboard.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Snipe** tab.
+2. Type a strategy in plain English (or tap an example), hit compile, and review every inferred field, clamp, and assumption.
+3. Run the backtest over 7, 30, or 90 days of real launch history; only when per-trade size, daily budget, and stop-loss are set does the Arm button enable.
+
## API surface
- `/api/sniper/compile`
- `/api/sniper/backtest`
- `/api/sniper/strategy`
+
+## Related
+
+- [Trade](./08-trade.md)
+- [Orders](./12-orders.md)
+- [Policy](./17-policy.md)
diff --git a/docs/agent-abilities/wallet/11-earn.md b/docs/agent-abilities/wallet/11-earn.md
index 79e81acad..4e28aaf9b 100644
--- a/docs/agent-abilities/wallet/11-earn.md
+++ b/docs/agent-abilities/wallet/11-earn.md
@@ -2,7 +2,7 @@
> Your avatar has a job: price its skills, watch it earn real USDC while you sleep, and hold the kill switch the whole time.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Earn** tab.*
## What it does
@@ -54,9 +54,21 @@ The whole tab is owner-only: it is hidden from visitors, and the server re-check
- The kill-switch card flipping from "🟢 Autonomous spending armed" to "🔒 Autonomous spending frozen" in one click, next to a daily-cap meter that shifts amber then red as headroom runs out
- The lifetime-earnings hero counting up to the real total, with Today / 7 days / All time chips and a breakdown like "From $84 in skill sales, $31 from agents hiring it and $6 in tips"
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Earn** tab.
+2. Check a skill in the pricing editor, set a USD price, and save; buyers pay the new price in USDC immediately.
+3. Watch the receipts statement: every sale, hire, and tip lands with an explorer-linked signature, and the kill-switch card freezes autonomous spending in one click.
+
## API surface
- `GET /api/agents/:id/economy — owner-only economy summary: windowed earnings (today/7d/lifetime) across skill sales, agent hires, and tips; autonomous spending totals; live spend policy; merged receipts; top customers; paid peers`
- `GET /api/agents/:id/skills-pricing — the agent's active per-skill prices`
- `PUT /api/agents/:id/skills-pricing — atomic replace of the full price set (zod-validated, CSRF-protected, through the platform MonetizationService)`
- `PUT /api/agents/:id/solana/limits — writes the real spend policy; the Earn tab uses it as the kill switch (frozen flag); same endpoint also carries daily/per-tx caps and the withdraw allowlist`
+
+## Related
+
+- [Pay](./15-pay.md)
+- [Withdraw](./18-withdraw.md)
+- [Trust](./06-trust.md)
diff --git a/docs/agent-abilities/wallet/12-orders.md b/docs/agent-abilities/wallet/12-orders.md
index d338301e6..6f515ffe1 100644
--- a/docs/agent-abilities/wallet/12-orders.md
+++ b/docs/agent-abilities/wallet/12-orders.md
@@ -2,7 +2,7 @@
> Set-and-forget limit, stop, trailing, DCA, TWAP, and signal-driven orders that fire automatically from your agent's own wallet — on live on-chain data, inside your guardrails.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Orders** tab.*
## What it does
@@ -62,6 +62,12 @@ Owner-only end to end: the tab only renders for the agent's owner, and every ser
- The pre-arm preview: live price, an '⚡ Would fire immediately' vs '⏳ Waiting' verdict, and the rug/honeypot firewall's allow/warn/block ruling — all before a single lamport moves
- Open orders updating live under a pulsing 'live' badge, with per-fill receipts linking straight to the on-chain transaction
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Orders** tab.
+2. Choose an order type, paste a mint, set the trigger and size, and hit **Preview**: you get the live metric value, a would-fire-now verdict, and the firewall ruling before arming.
+3. Arm it and watch the open-orders list stream status live; every fill links its on-chain receipt.
+
## API surface
- `GET /api/agents/:id/orders — list orders + summary + live SOL balance + frozen/kill-switch state`
@@ -73,3 +79,9 @@ Owner-only end to end: the tab only renders for the agent's owner, and every ser
- `GET /api/agents/:id/orders/:orderId — one order + its fills`
- `PUT /api/agents/:id/orders/:orderId — edit price/trail/slippage/expiry or pause/resume`
- `DELETE /api/agents/:id/orders/:orderId — instant cancel`
+
+## Related
+
+- [Trade](./08-trade.md)
+- [Snipe](./10-snipe.md)
+- [Autopilot](./13-autopilot.md)
diff --git a/docs/agent-abilities/wallet/13-autopilot.md b/docs/agent-abilities/wallet/13-autopilot.md
index a79866c6f..730ddddee 100644
--- a/docs/agent-abilities/wallet/13-autopilot.md
+++ b/docs/agent-abilities/wallet/13-autopilot.md
@@ -2,7 +2,7 @@
> Write one sentence in plain English and your agent starts paying its own bills, stacking $THREE, buying back its own coin, and sweeping the profit to you — for real, on-chain.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Autopilot** tab.*
## What it does
@@ -55,6 +55,12 @@ Owner-only, structurally: the tab is hidden from non-owners and every endpoint r
- The compile moment: type one English sentence — 'Pay your own compute. Keep a 1 SOL buffer. Put 10% of tips into $THREE. Sweep anything over 3 SOL to me on Fridays.' — and watch it become five bounded rules with icons, plus red conflict callouts and amber 'here's what I assumed' notes before you're allowed to arm
- Hit 'Run now' and each rule reports back with a status chip and a 'view tx ↗' link to a real Solana explorer page — proof on-chain, not a dashboard animation
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Autopilot** tab.
+2. Describe a treasury policy in a sentence (or tap an example chip) and hit compile; review the bounded rules, conflicts, and assumptions.
+3. Arm it, then hit **Run now** to fire one real cycle and watch each rule report back with a status chip and an explorer link.
+
## API surface
- `GET /api/agents/:id/autopilot?network=mainnet|devnet (policy + runway + spend caps)`
@@ -62,3 +68,9 @@ Owner-only, structurally: the tab is hidden from non-owners and every endpoint r
- `PUT /api/agents/:id/autopilot (save / arm / disarm / pause / kill)`
- `POST /api/agents/:id/autopilot/run (run one real cycle now, supports dry_run)`
- `Server-side: Jupiter swap API for $THREE DCA and coin buybacks, Solana RPC for balances/sends, hourly cron /api/cron/treasury-autopilot`
+
+## Related
+
+- [Intents](./14-intents.md)
+- [Policy](./17-policy.md)
+- [Earn](./11-earn.md)
diff --git a/docs/agent-abilities/wallet/14-intents.md b/docs/agent-abilities/wallet/14-intents.md
index 32ac4f543..dbe71c3ab 100644
--- a/docs/agent-abilities/wallet/14-intents.md
+++ b/docs/agent-abilities/wallet/14-intents.md
@@ -2,7 +2,7 @@
> Tell your agent's wallet what to do in one plain sentence — it compiles the rule, shows you a dry run, and then executes it for real on Solana, inside guardrails you set.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Intents** tab.*
## What it does
@@ -56,6 +56,12 @@ Owner-only end to end: the server rejects any non-owner or logged-out caller on
- The rules list with real receipts: each armed rule shows its status pill, fire count, running dollars moved, and a 'receipt' link that opens the actual on-chain transaction in the explorer.
- Ask your wallet 'How am I doing?' and get an in-character answer built from the real balance and the last 30 days of tips, spend, and rule activity — a wallet that talks back but can never move money from a question.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Intents** tab.
+2. Type a rule like "tip back anyone who tips me more than 0.1 SOL, half of what they sent" and hit Compile; review the readback and the dry-run line.
+3. Confirm & arm, then use **Test now** on the rule card to dry-run it against a sample event without moving funds.
+
## API surface
- `GET /api/agents/:id/intents`
@@ -68,3 +74,9 @@ Owner-only end to end: the server rejects any non-owner or logged-out caller on
- `DELETE /api/agents/:id/intents/:intentId`
- `POST /api/tts/speak`
- `GET /api/cron/wallet-intents (scheduler, secret-protected)`
+
+## Related
+
+- [Autopilot](./13-autopilot.md)
+- [Policy](./17-policy.md)
+- [Deposit](./04-deposit.md)
diff --git a/docs/agent-abilities/wallet/15-pay.md b/docs/agent-abilities/wallet/15-pay.md
index 2ebec827f..10f7940dd 100644
--- a/docs/agent-abilities/wallet/15-pay.md
+++ b/docs/agent-abilities/wallet/15-pay.md
@@ -2,7 +2,7 @@
> Your agent shops the open x402 economy: find any paid API, see its live price, and settle it in USDC from the agent's own Solana wallet — receipt on-chain in seconds.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Pay** tab.*
## What it does
@@ -54,6 +54,12 @@ Owner-only tab, gated end to end: the caller must be signed in and must own the
- The bazaar search: type 'weather' or 'intel' and real paid APIs from across the open x402 economy appear with live USDC prices, each one payable in a single click from the agent's own wallet.
- The funding-aware guard: when the agent is short, the tab shows exactly how much it holds versus the price, hands you the deposit address with one-tap copy, and routes you straight to funding instead of letting a doomed payment fire.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Pay** tab.
+2. Search the bazaar (try "intel") or paste any x402 endpoint URL; the preview sheet shows the live USDC price and your agent's balance before anything moves.
+3. Confirm and watch the payment timeline stream to a green receipt with the on-chain signature and the service's actual response.
+
## API surface
- `GET /api/bazaar/search (aggregated x402 service catalog from public facilitators — PayAI + Coinbase CDP — filtered to Solana-payable)`
@@ -61,3 +67,9 @@ Owner-only tab, gated end to end: the caller must be signed in and must own the
- `POST /api/x402-pay streamed as Server-Sent Events (the real payment: challenge → built → settled → result)`
- `GET /api/agents/:id/solana/holdings (live on-chain SOL + SPL token balances, USDC flagged)`
- `GET /api/agents/:id/solana/custody?category=x402 (owner-only payment history from the custody ledger)`
+
+## Related
+
+- [Earn](./11-earn.md)
+- [Policy](./17-policy.md)
+- [Withdraw](./18-withdraw.md)
diff --git a/docs/agent-abilities/wallet/16-vanity.md b/docs/agent-abilities/wallet/16-vanity.md
index 9e5eee2a1..3ab70abbe 100644
--- a/docs/agent-abilities/wallet/16-vanity.md
+++ b/docs/agent-abilities/wallet/16-vanity.md
@@ -2,7 +2,7 @@
> Give your agent a wallet address that spells its name — ground on your own CPU at millions of attempts, then applied with a funds-safe swap that sweeps every asset over first.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Vanity** tab.*
## What it does
@@ -52,7 +52,19 @@ Owner-only end to end: the tab is hidden from non-owner viewers and the server r
- The success card: the new address with your chosen pattern glowing in purple, 'Migrated 0.42 SOL + 3 tokens from the old address', and 'Found in 1,234,567 attempts · 12.3s' above a one-click explorer link
- The difficulty estimator reacting as you type: attempt counts and time estimates update live per character and per core, flipping to an amber 'this one is hard' warning on ambitious patterns
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Vanity** tab.
+2. Type a prefix and/or suffix (up to 6 Base58 characters each), pick how many CPU cores to spend, and start the grind; the difficulty estimate updates as you type.
+3. On a match the key is applied automatically: funds sweep to the new address first, then the success card shows the pattern, attempt count, and explorer link.
+
## API surface
- `GET /api/agents/:id/solana/vanity — owner-only status: current address, vanity prefix/suffix, wallet source, is_vanity flag, server grind cap`
- `POST /api/agents/:id/solana/vanity — owner-only assign: accepts a browser-ground 64-byte secret key (verified server-side) or grinds short patterns server-side, sweeps all funds old→new, swaps the stored encrypted key, returns address/iterations/duration/swept summary`
+
+## Related
+
+- [Balance](./01-balance.md)
+- [Deposit](./04-deposit.md)
+- [Withdraw](./18-withdraw.md)
diff --git a/docs/agent-abilities/wallet/17-policy.md b/docs/agent-abilities/wallet/17-policy.md
index 09a801673..a7c8c834c 100644
--- a/docs/agent-abilities/wallet/17-policy.md
+++ b/docs/agent-abilities/wallet/17-policy.md
@@ -2,7 +2,7 @@
> Write your agent's spending rules in plain English — AI translates them, deterministic code enforces them on every single spend.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Policy** tab.*
## What it does
@@ -53,9 +53,21 @@ Owner-only end to end: the tab is hidden from non-owner viewers and the server i
- One sentence in, a numbered firewall out: 'stop everything if a trade drops more than 30%' becomes rule #4 with a Freeze tag that literally trips the wallet's kill-switch on-chain activity
- The readback + assumptions card: the platform explains every rule back in plain English and openly lists what it assumed, so the owner confirms intent before anything is enforced
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Policy** tab.
+2. Type rules in plain English (or tap a preset) and hit **Compile & preview**; read the numbered readback and the assumptions callout.
+3. Check the backtest against your real spend history, then Save; from that moment the rules run on every trade, snipe, payment, and withdrawal.
+
## API surface
- `GET /api/agents/:id/solana/policy?network= — current compiled policy, plain-English readback, source text, numeric limits`
- `POST /api/agents/:id/solana/policy {op:'compile', text} — LLM/heuristic compile + backtest + synthetic probes`
- `POST /api/agents/:id/solana/policy {op:'backtest', rules} — replay a rule set against real custody history`
- `PUT /api/agents/:id/solana/policy {rules, english} — save the validated policy (CSRF-gated, audited)`
+
+## Related
+
+- [Withdraw](./18-withdraw.md)
+- [Self-defense](./23-self-defense.md)
+- [Access](./21-access.md)
diff --git a/docs/agent-abilities/wallet/18-withdraw.md b/docs/agent-abilities/wallet/18-withdraw.md
index 110e067f3..6d6cc04a5 100644
--- a/docs/agent-abilities/wallet/18-withdraw.md
+++ b/docs/agent-abilities/wallet/18-withdraw.md
@@ -2,7 +2,7 @@
> Sweep any asset out of your agent's wallet in three taps — server-signed, policy-guarded, and audited down to every single key touch.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Withdraw** tab.*
## What it does
@@ -59,6 +59,12 @@ Owner-only end to end: every endpoint verifies the signed-in user owns the agent
- The one-tap Freeze wallet panel — a kill switch that instantly pauses all of the agent's autonomous trading and payments while your own exit stays open
- The Activity feed showing a payment stopped cold with 'Blocked by your rule' and the exact plain-English rule you wrote, quoted inline
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Withdraw** tab.
+2. Choose an asset, enter an amount (or tap Max), and paste a destination address or .sol name; it resolves live with a green check.
+3. Review the confirmation screen (allowlist badge included), acknowledge the mainnet risk dialog, and confirm; the success screen links the transaction on the explorer.
+
## API surface
- `POST /api/agents/:id/solana/withdraw`
@@ -67,3 +73,9 @@ Owner-only end to end: every endpoint verifies the signed-in user owns the agent
- `PUT /api/agents/:id/solana/limits`
- `GET /api/agents/:id/solana/custody`
- `GET /api/sns?name=<name>.sol`
+
+## Related
+
+- [Policy](./17-policy.md)
+- [Give](./19-give.md)
+- [Self-defense](./23-self-defense.md)
diff --git a/docs/agent-abilities/wallet/19-give.md b/docs/agent-abilities/wallet/19-give.md
index 793f5d517..15c1d1485 100644
--- a/docs/agent-abilities/wallet/19-give.md
+++ b/docs/agent-abilities/wallet/19-give.md
@@ -2,7 +2,7 @@
> Turn your agent's wallet into a giving wallet — round up the spare change or donate any amount to any Solana cause, settled on-chain with a receipt you can verify.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Give** tab.*
## What it does
@@ -46,9 +46,21 @@ Owner-only end to end: the tab is hidden from visitors, and the server independe
- The Impact card tallies total giving straight from the blockchain custody trail — every donation counted with a live explorer link, zero self-reported numbers
- Type a human-readable .sol name like oceancleanup.sol and watch it resolve live to the cause's wallet address before you save
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Give** tab.
+2. Set a cause: paste any Solana address or type a .sol name and watch it resolve live, then optionally label it.
+3. Give an amount, tap a percentage chip, or use round-up to donate just the spare change; the Impact card tallies every confirmed donation from the on-chain custody trail.
+
## API surface
- `GET /api/sns?name= — resolves .sol names to wallet addresses via Solana Name Service (Bonfida), cached 5 min, IP rate-limited`
- `GET /api/agents/:id/solana/holdings?network= — live on-chain balances: SOL plus every SPL token held (Token + Token-2022 programs), USDC flagged, sorted by size`
- `GET /api/agents/:id/solana/custody?network=&limit=100 — owner-only custody audit trail (agent_custody_events ledger) used to compute the Impact tally`
- `POST /api/agents/:id/solana/withdraw — server-signed, idempotent, spend-policy-governed on-chain transfer; the donation is this withdraw with the cause wallet as destination`
+
+## Related
+
+- [Withdraw](./18-withdraw.md)
+- [Deposit](./04-deposit.md)
+- [Intents](./14-intents.md)
diff --git a/docs/agent-abilities/wallet/20-proof-of-custody.md b/docs/agent-abilities/wallet/20-proof-of-custody.md
index 800c9d31d..896a25f28 100644
--- a/docs/agent-abilities/wallet/20-proof-of-custody.md
+++ b/docs/agent-abilities/wallet/20-proof-of-custody.md
@@ -2,7 +2,7 @@
> Don't trust — verify: your agent wallet's custody, cryptographically proven in your own browser against the Solana blockchain itself.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Proof of Custody** tab.*
## What it does
@@ -55,6 +55,19 @@ The tab is owner-only and the proof endpoint verifies wallet ownership on every
- The movement reconciliation panel: every lamport that left the wallet since the last snapshot itemized against authorized, explorer-linked events — and a red '⚠ Unexplained movement' alarm wired to fire if even one outflow can't be accounted for.
- The 'Show it off' card: a green verified-custody badge with one-click copy-paste embed HTML that links anyone to the public integrity page, where they can re-verify the platform's on-chain root in their own browser.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Proof of Custody** tab; verification runs automatically.
+2. Watch the four-step checklist tick as your own browser recomputes the leaf, walks the Merkle path, and reads the anchor from public Solana RPC nodes.
+
+The platform-wide aggregate is public:
+
+```bash
+curl 'https://three.ws/api/custody/integrity'
+```
+
+Anyone can also re-verify the current root at `three.ws/integrity`, and the standalone verifier lives at `three.ws/proof`.
+
## API surface
- `GET /api/agents/:id/solana/proof — owner-gated inclusion proof (leaf, Merkle path, anchor reference, movement reconciliation)`
@@ -63,3 +76,9 @@ The tab is owner-only and the proof endpoint verifies wallet ownership on every
- `GET /api/custody/integrity — public no-auth aggregate for the /integrity page`
- `GET /api/custody/anchor?epoch=N|latest — public anchor reference for one epoch`
- `GET/POST /api/cron/custody-attest — scheduled snapshot + on-chain anchor job (bearer-secret protected)`
+
+## Related
+
+- [Trust](./06-trust.md)
+- [Recovery](./22-recovery.md)
+- [Withdraw](./18-withdraw.md)
diff --git a/docs/agent-abilities/wallet/21-access.md b/docs/agent-abilities/wallet/21-access.md
index bff9c7f3c..ab8105709 100644
--- a/docs/agent-abilities/wallet/21-access.md
+++ b/docs/agent-abilities/wallet/21-access.md
@@ -2,7 +2,7 @@
> Put every bot on a leash: mint tight, revocable spending keys so no strategy ever touches more of your agent's wallet than you allow.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Access** tab.*
## What it does
@@ -46,6 +46,12 @@ Owner-only surface end to end: the tab is hidden from non-owners and the API ver
- The Suggested keys card: the platform notices an armed sniper strategy running without a leash and drafts the exact scoped key for it, budgeted to what the strategy can already spend — one tap to accept
- The strict-mode switch: one toggle and every autonomous trade, snipe, or payment without a covering key is denied on the spot, while a red Revoke All button sits ready as the wallet-wide kill switch
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Access** tab.
+2. Mint a key: label it, tick the allowed actions, set a per-use or total USD ceiling and an expiry, and optionally restrict it to specific mints, services, or destinations.
+3. Watch the key's live budget bar and countdown; revoke it (or everything) instantly, and flip on least-privilege mode to require a covering key for every autonomous spend.
+
## API surface
- `GET /api/agents/:id/capabilities`
@@ -53,3 +59,9 @@ Owner-only surface end to end: the tab is hidden from non-owners and the API ver
- `PUT /api/agents/:id/capabilities/settings`
- `POST /api/agents/:id/capabilities/:capabilityId/revoke`
- `POST /api/agents/:id/capabilities/revoke-all`
+
+## Related
+
+- [Policy](./17-policy.md)
+- [Self-defense](./23-self-defense.md)
+- [Snipe](./10-snipe.md)
diff --git a/docs/agent-abilities/wallet/22-recovery.md b/docs/agent-abilities/wallet/22-recovery.md
index 9d537f000..15d47822e 100644
--- a/docs/agent-abilities/wallet/22-recovery.md
+++ b/docs/agent-abilities/wallet/22-recovery.md
@@ -2,7 +2,7 @@
> Lose your login — or go silent forever — and your funded agent wallet still finds its way home: guardians, a beneficiary, and a dead-man's switch that only fires when you truly can't stop it.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Recovery** tab.*
## What it does
@@ -61,6 +61,12 @@ Owner-only tab; every write requires a fresh CSRF token and is rate-limited. Onl
- The dead-man's switch card: a live inactivity bar that turns red as you approach the threshold, a countdown to arming, and a single glowing button — '✋ I'm here — reset the clock.'
- The 4-step recovery timeline with a ticking 48-hour countdown and the big red 'Stop this recovery — it's not me' abort button — a screenshot that says 'your wallet can defend itself.'
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Recovery** tab.
+2. Add guardians by @username or email, set the M-of-N threshold, and optionally name a beneficiary to unlock the dead-man's switch.
+3. Guardians act from their own console at `three.ws/guardian`; you can watch, and cancel, any live process from this tab, or tap "I'm here" to reset the inactivity clock.
+
## API surface
- `GET /api/agents/:id/recovery`
@@ -70,3 +76,9 @@ Owner-only tab; every write requires a fresh CSRF token and is rate-limited. Onl
- `POST /api/agents/:id/recovery/requests (+ /approve, /decline, /confirm, /complete — guardian console side)`
- `GET /api/agents/recovery-inbox (guardian console)`
- `GET /api/cron/dead-man-switch (daily sweep, secret-gated)`
+
+## Related
+
+- [Self-defense](./23-self-defense.md)
+- [Access](./21-access.md)
+- [Withdraw](./18-withdraw.md)
diff --git a/docs/agent-abilities/wallet/23-self-defense.md b/docs/agent-abilities/wallet/23-self-defense.md
index 5af716063..4fd567d29 100644
--- a/docs/agent-abilities/wallet/23-self-defense.md
+++ b/docs/agent-abilities/wallet/23-self-defense.md
@@ -2,7 +2,7 @@
> Every agent wallet gets an immune system — it learns what normal spending looks like, freezes itself the instant something looks wrong, and explains why in plain English.
-*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md) — the money layer of a three.ws agent.*
+*One of the 23 abilities of the [Agent Wallet](../chapters/10-the-agent-wallet.md), the money layer of a three.ws agent. In the product: open `three.ws/agent/<agent-id>/wallet` and pick the **Self-defense** tab.*
## What it does
@@ -51,6 +51,12 @@ Owner-only surface end to end: the tab is gated to the wallet owner and every AP
- The 'What your wallet has learned' dashboard — spends learned, largest spend, known addresses, active hours — proof on screen that the wallet has a real behavioral memory, not a static rule list.
- The sensitivity segmented control (Relaxed / Balanced / Strict) next to the promise that approving a flag teaches the guard — the wallet gets smarter, never naggier.
+## Try it
+
+1. Open `three.ws/agent/<your-agent-id>/wallet` while signed in as the owner and pick the **Self-defense** tab.
+2. Set a sensitivity preset (Relaxed / Balanced / Strict) and a safe address; the "What your wallet has learned" dashboard shows the live baseline.
+3. If a spend trips the guard, the wallet freezes and a flag card appears here with the risk score and plain-language reasons; resolve it with Approve & unfreeze, Keep frozen, or Sweep to safety.
+
## API surface
- `GET /api/agents/:id/solana/guard`
@@ -58,3 +64,9 @@ Owner-only surface end to end: the tab is gated to the wallet owner and every AP
- `PUT /api/agents/:id/solana/guard`
- `POST /api/agents/:id/solana/guard`
- `POST /api/agents/:id/solana/withdraw`
+
+## Related
+
+- [Policy](./17-policy.md)
+- [Withdraw](./18-withdraw.md)
+- [Recovery](./22-recovery.md)
diff --git a/docs/agents-vs-avatars.md b/docs/agents-vs-avatars.md
index 87ed80ef6..80f2ba865 100644
--- a/docs/agents-vs-avatars.md
+++ b/docs/agents-vs-avatars.md
@@ -21,7 +21,7 @@ three.ws is built around two distinct concepts: agents (AI minds) and avatars (3
Every page on three.ws is one of these four things. If you ever feel lost, ask: "Which of the four am I looking at?"
1. **Avatar** — a 3D body. Lives at `/avatars/<id>`. Discoverable in the marketplace.
-2. **Agent** — a mind that wears an avatar. Lives at `/agents/<id>`. Yours appear in your dashboard. (Old `/agent/<id>` links redirect here.)
+2. **Agent**: a mind that wears an avatar. Lives at `/agents/<id>`. Yours appear in your dashboard. (Old `/agent/<id>` links redirect here.)
3. **Marketplace** — where avatars (and shared agents) are listed. `/marketplace`.
4. **Studio** — where you assemble: pick an avatar, configure an agent, wire skills. `/studio`.
diff --git a/docs/ar.md b/docs/ar.md
index f896fd006..2bdaec4d0 100644
--- a/docs/ar.md
+++ b/docs/ar.md
@@ -111,7 +111,7 @@ export function openQuickLook(usdzURI, { onBannerTap } = {}) {
}
```
-The child `<img>` element is required — without it, Safari won't intercept a programmatic `.click()` as a Quick Look trigger. This is a documented WebKit quirk. The anchor must remain in the DOM while the viewer is open: Safari delivers the banner-tap `message` event on the anchor that launched the session.
+The child `<img>` element is required: without it, Safari won't intercept a programmatic `.click()` as a Quick Look trigger. This is a documented WebKit quirk. The anchor must remain in the DOM while the viewer is open: Safari delivers the banner-tap `message` event on the anchor that launched the session.
**USDZ on iOS:** Quick Look wants USDZ, so three.ws always hands it one. If a `usdz_url` exists on the avatar record (a pre-generated companion stored on R2), it's used as `ios-src`; otherwise the GLB-to-USDZ conversion runs in-browser (three.js `USDZExporter`, or the animated bake described below) before Quick Look opens.
@@ -455,6 +455,6 @@ How this link ships through ChatGPT end to end (the app connector, the custom GP
- [Blog: See Your 3D Avatar in the Real World](https://three.ws/blog/see-your-3d-in-ar) — full walkthrough
- [Avatar AR page](/avatars/:id/ar) — the dedicated AR experience for any avatar
- [Walk feature](/features/walk) — WebXR immersive walk mode (different from placement AR)
-- [Web component reference](/docs/web-component) — full `<agent-3d>` attribute list
+- [Web component reference](/docs/web-component): full `<agent-3d>` attribute list
- [Embedding guide](/docs/embedding) — iframe setup with XR permissions
- [Tutorial: Place your model in AR](/docs/tutorials/view-in-ar)
diff --git a/docs/architecture.md b/docs/architecture.md
index 373576dfe..ea936784c 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -44,7 +44,7 @@ This is the layer that turns a static GLB into a presence. It's structured as a
This layer is what keeps an agent's existence durable across sessions, devices, and embed hosts.
- **`agent-identity.js`** — the **passport + diary**. Stores the agent's stable id, owner address, and a signed action history. Backed by `localStorage` for the local cache and `/api/agents/:id` for the canonical record. Listens on the protocol bus for `speak`, `remember`, `sign`, `skill-done`, `validate`, `load-end` and POSTs them to the backend fire-and-forget.
-- **`memory/`** — five built-in modes: `local` (browser `localStorage`), `remote` (synced to `/api/agent-memory`), `ipfs` (loaded from a pinned bundle), `encrypted-ipfs` (AES-GCM-256 with a wallet-derived key, pinned via `/api/agents/:id/memory/pin`), or `none` (stateless). Custom backends can also be registered. Mode is declared on the manifest.
+- **`memory/`**: five built-in modes: `local` (browser `localStorage`), `remote` (synced to `/api/agent-memory`), `ipfs` (loaded from a pinned bundle), `encrypted-ipfs` (AES-GCM-256 with a wallet-derived key, pinned via `/api/agents/:id/memory/pin`), or `none` (stateless). Custom backends can also be registered. Mode is declared on the manifest.
- **`erc8004/`** — the **on-chain identity** layer. Contains:
- `IdentityRegistry` — mints an agent token whose `tokenURI` points at the manifest CID
- `ReputationRegistry` — accepts signed feedback per agent
@@ -57,7 +57,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`** — ten widget variants (Turntable Showcase, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour, Pump.fun Live Feed, Smart Money Feed, Live Trades Canvas, Bonding Curve, Walking Avatar) that share the underlying element but ship as separate ergonomic wrappers.
+- **`widget-types.js`**: ten widget variants (Turntable Showcase, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour, Pump.fun Live Feed, Smart Money Feed, Live Trades Canvas, Bonding Curve, Walking Avatar) 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.
@@ -153,9 +153,9 @@ The manifest is a JSON document that fully describes an embodied agent. It's int
Key fields:
- **`name`, `description`, `creator`** — display metadata.
-- **`body.uri`** — GLB / glTF / VRM URL. Resolution is deliberately polymorphic: `agent://chain/id` (resolved on-chain), `ipfs://CID/path`, `ar://TXID`, or plain `https://`. The resolver in `ipfs.js` walks gateway fallbacks (dweb.link → ipfs.io → flk-ipfs.xyz) so a single broken gateway never breaks an embed.
+- **`body.uri`**: GLB / glTF / VRM URL. Resolution is deliberately polymorphic: `agent://chain/id` (resolved on-chain), `ipfs://CID/path`, `ar://TXID`, or plain `https://`. The resolver in `ipfs.js` walks gateway fallbacks (dweb.link → ipfs.io → flk-ipfs.xyz) so a single broken gateway never breaks an embed.
- **`skills[]`** — pointers to skill bundles. Each skill is loaded and validated by the registry. Trust mode determines whether unsigned/foreign skills are allowed.
-- **`memory.mode`** — `local`, `remote`, `ipfs`, `encrypted-ipfs`, or `none`.
+- **`memory.mode`**: `local`, `remote`, `ipfs`, `encrypted-ipfs`, or `none`.
- **`identity.chainId` / `identity.registryAddress`** — pin this manifest to an on-chain agent id.
- **`personality`** — flavor: tone, domain, and any extra system-prompt fragments.
diff --git a/docs/avatar-studio.md b/docs/avatar-studio.md
index b129f8f8d..89825b4a3 100644
--- a/docs/avatar-studio.md
+++ b/docs/avatar-studio.md
@@ -64,5 +64,5 @@ curl 'https://three.ws/api/avatars/<avatarId>' -H 'cookie: <session>'
- [Scene Composer](./compose.md): forge props and attach them to the avatar's bones as a saved outfit.
- [Mocap Studio](./mocap-studio.md): drive the avatar's face live from your webcam.
- [Restyle Studio](./restyle.md): shares the same GLB optimize-and-validate path.
-- [CharacterStudio fork](./character-studio.md): the separate VRM trait-based studio embedded in the agent editor; a deep dive into its internals.
+- [Trait-based avatar builder](./character-studio.md): the separate VRM studio embedded in the agent editor; a deep dive into its internals.
- [/create](https://three.ws/create): the hub for every avatar-creation path, including selfie-to-avatar.
diff --git a/docs/character-studio.md b/docs/character-studio.md
index bbe58c93f..649690c0b 100644
--- a/docs/character-studio.md
+++ b/docs/character-studio.md
@@ -1,10 +1,10 @@
# Avatar Studio
-This page documents the CharacterStudio-based avatar builder: a browser-based tool for designing a customized humanoid avatar (body, hair, face, clothing, accessories) with a point-and-click interface and no 3D modeling experience required. The result is a GLB/VRM file that works with every three.ws feature: animations, the emotion system, AR viewing, and web embedding.
+This page documents the Character Studio avatar builder: a browser-based tool for designing a customized humanoid avatar (body, hair, face, clothing, accessories) with a point-and-click interface and no 3D modeling experience required. The result is a GLB/VRM file that works with every three.ws feature: animations, the emotion system, AR viewing, and web embedding.
It is a rebranded fork of the open-source (MIT license) [M3-org/CharacterStudio](https://github.com/M3-org/CharacterStudio) project and lives in the `character-studio/` directory of the repo.
-**Note:** the platform's primary from-scratch builder, the page served at [three.ws/avatar-studio](https://three.ws/avatar-studio) and [three.ws/create/studio](https://three.ws/create/studio), is a separate native implementation documented in [Avatar Studio (native)](/docs/avatar-studio). The CharacterStudio fork on this page is the trait-based builder behind the "three.ws Studio" option described below.
+**Note:** the platform's primary from-scratch builder, the page served at [three.ws/avatar-studio](https://three.ws/avatar-studio) and [three.ws/create/studio](https://three.ws/create/studio), is a separate native implementation documented in [Avatar Studio (native)](/docs/avatar-studio). The Character Studio fork on this page is the trait-based builder behind the "three.ws Studio" option described below.
---
diff --git a/docs/cosmos.md b/docs/cosmos.md
index a5ff2e5cb..cfaecadad 100644
--- a/docs/cosmos.md
+++ b/docs/cosmos.md
@@ -79,5 +79,5 @@ else {
## Related
- [Forge](./forge.md) makes the 3D avatars and objects you place in a Cosmos world.
-- [Avatar creation](./avatar-creation.md) and [character studio](./character-studio.md) for building and dressing avatars.
+- [Avatar creation](./avatar-creation.md) and [the trait-based avatar builder](./character-studio.md) for building and dressing avatars.
- Pages: [/create](https://three.ws/create), [/gallery](https://three.ws/gallery), [/scene](https://three.ws/scene).
diff --git a/docs/deployment.md b/docs/deployment.md
index fa47a1c62..b2b358db4 100644
--- a/docs/deployment.md
+++ b/docs/deployment.md
@@ -354,7 +354,7 @@ The embed routes explicitly set `frame-ancestors *` so the embed iframe can be h
### Background cron jobs
-The `crons` array in `vercel.json` declares ~90 scheduled jobs (economy tick, on-chain crawl, delegation indexing, DCA, subscriptions, coin-launch lifecycle, treasury top-ups, and more). In production these run as **Google Cloud Scheduler jobs** — one per entry — each firing `GET /api/cron/<name>` with an `Authorization: Bearer $CRON_SECRET` header. A representative slice:
+The `crons` array in `vercel.json` declares ~90 scheduled jobs (economy tick, on-chain crawl, delegation indexing, DCA, subscriptions, coin-launch lifecycle, treasury top-ups, and more). In production these run as **Google Cloud Scheduler jobs** (one per entry) each firing `GET /api/cron/<name>` with an `Authorization: Bearer $CRON_SECRET` header. A representative slice:
| Cron | Schedule | Purpose |
|---|---|---|
@@ -537,7 +537,7 @@ After deploying, run through these checks to verify the instance is healthy:
| Viewer | Load the app and drag-drop a GLB file |
| Wallet sign-in | Connect MetaMask — SIWE challenge + verify |
| Avatar creation | Navigate to `/create` — avatar builder iframe loads |
-| Agent page | Visit `/agents/:id` — 3D viewer with chat overlay (`/agent/:id` 301-redirects here) |
+| Agent page | Visit `/agents/:id`: 3D viewer with chat overlay (`/agent/:id` 301-redirects here) |
| Embed | Check `/agent/:id/embed` loads without auth, can be iframed |
| Dashboard | Navigate to `/dashboard` — shows your agents |
| API health | `GET /api/agents` returns JSON (may be empty array) |
diff --git a/docs/do-i-need-crypto.md b/docs/do-i-need-crypto.md
index 9aa9a2762..0282d7feb 100644
--- a/docs/do-i-need-crypto.md
+++ b/docs/do-i-need-crypto.md
@@ -37,7 +37,7 @@ Most basic features are free. You pay when you use premium capabilities:
| Premium skills (skill purchases) | USDC micropayment via x402 | Set by the skill author |
| On-chain registration (ERC-8004) | Small gas fee on Base | A few cents in ETH |
-**USDC** is a dollar-pegged stablecoin — 1 USDC ≈ $1 USD. It doesn't go up or down the way ETH or SOL does. When you see a price in USDC, you can treat it as dollars. Payment surfaces on the platform also show the approximate USD (or SOL) equivalent next to the amount, so you never have to do mental math from crypto to dollars.
+**USDC** is a dollar-pegged stablecoin: 1 USDC ≈ $1 USD. It doesn't go up or down the way ETH or SOL does. When you see a price in USDC, you can treat it as dollars. Payment surfaces on the platform also show the approximate USD (or SOL) equivalent next to the amount, so you never have to do mental math from crypto to dollars.
---
diff --git a/docs/embedding.md b/docs/embedding.md
index 4c9925c26..67606e91e 100644
--- a/docs/embedding.md
+++ b/docs/embedding.md
@@ -671,7 +671,7 @@ Framer supports custom code components — wrap `<agent-3d>` in a code component
Add the script tag to `theme.liquid` inside `<head>`, then use `<agent-3d>` directly in product page templates or section files.
-Want a guide that *walks the storefront* — spotlighting sections, narrating, free-roaming — instead of a boxed embed? That's the tour SDK, not `<agent-3d>` (it needs host-DOM access an iframe/web component doesn't have). Follow the [3D store guide for Shopify tutorial](/docs/tutorials/shopify-store-guide).
+Want a guide that *walks the storefront* (spotlighting sections, narrating, free-roaming) instead of a boxed embed? That's the tour SDK, not `<agent-3d>` (it needs host-DOM access an iframe/web component doesn't have). Follow the [3D store guide for Shopify tutorial](/docs/tutorials/shopify-store-guide).
---
diff --git a/docs/examples.md b/docs/examples.md
index 2fb6d1f45..e962ca57c 100644
--- a/docs/examples.md
+++ b/docs/examples.md
@@ -496,7 +496,7 @@ Take a PNG snapshot of the current viewer state. The viewer renders a fresh fram
</script>
```
-> The `P` key is a built-in shortcut — no code needed. The screenshot triggers a browser download directly; there is no return value. On the full studio page ([three.ws/app](https://three.ws/app)) the viewer is also exposed as the debug global `window.VIEWER`, where you can call `window.VIEWER.takeScreenshot()` from the console; standalone embeds don't set that global.
+> The `P` key is a built-in shortcut: no code needed. The screenshot triggers a browser download directly; there is no return value. On the full studio page ([three.ws/app](https://three.ws/app)) the viewer is also exposed as the debug global `window.VIEWER`, where you can call `window.VIEWER.takeScreenshot()` from the console; standalone embeds don't set that global.
**What to change:**
- Skip the button and just document the `P` key for a frameless experience
@@ -692,7 +692,7 @@ genuinely invested in the user's progress.
**Personality prompt as a separate file.** `instructions.md` is loaded at boot via the `"instructions": "instructions.md"` field in the manifest. Keeping it separate makes it easy to iterate on the prompt without touching the manifest schema.
-**Skills extend tools.** The `wave` skill adds a `wave()` tool the brain can call. The manifest lists it under `skills:` with a URI; the runtime installs it and registers the tool automatically. To add more capabilities, add more entries to `skills:`.
+**Skills extend tools.** The `wave` skill ([`examples/skills/wave/`](https://github.com/nirholas/three.ws/tree/main/examples/skills/wave)) adds a `waveAndGreet` tool the brain can call; its ten-line handler chains the built-in `wave` gesture with a spoken greeting. The manifest lists it under `skills:` with a URI; the runtime installs it and registers the tool automatically. To add more capabilities, add more entries to `skills:`.
**Memory persists between sessions.** `"mode": "local"` stores memories as `.md` files under `memory/`. When Leo calls `remember({ key: "position", value: "striker" })`, it writes to that directory and loads it back on the next boot. Switching to `"mode": "ipfs"` makes memories portable across devices.
diff --git a/docs/how-it-works.md b/docs/how-it-works.md
index 9b6e62d52..c00ee5cd2 100644
--- a/docs/how-it-works.md
+++ b/docs/how-it-works.md
@@ -52,7 +52,7 @@ The whole stack is split into four horizontal strata. Each layer can run on its
- **Viewer layer** — pure three.js. Knows nothing about agents, brains, or wallets. Useful on its own as a glTF inspector and as the rendering engine for Turntable / Animation Gallery widgets. See [Layers](./layers.md) for the contract.
- **Agent layer** — turns a static GLB into a presence. LLM tool-loop, skill registry, memory, and a continuous emotion blend that drives morphs and gaze. See [Agent system](./agent-system.md).
- **Identity layer** — durability across sessions, devices, and embed hosts. Wallet auth, on-chain registration, IPFS-pinned manifest bundles, signed action diary. Entirely optional. See [ERC-8004](./erc8004.md) and [Solana agents](./solana.md).
-- **Embed layer** — the public face. The `<agent-3d>` custom element, ten widget variants, iframe embeds, the CDN bundle, the SPA, and the route table in `vercel.json` (read at runtime by the Cloud Run server). See [Embedding](./embedding.md).
+- **Embed layer**: the public face. The `<agent-3d>` custom element, ten widget variants, iframe embeds, the CDN bundle, the SPA, and the route table in `vercel.json` (read at runtime by the Cloud Run server). See [Embedding](./embedding.md).
The four layers communicate through one event bus (`agent-protocol`). Every meaningful action is a `CustomEvent` on a singleton. That single design choice is why you can swap the avatar for a 2D sprite, the runtime for a different LLM, or memory for a vector store — and nothing else changes.
@@ -106,7 +106,7 @@ Every avatar ends up as a hosted GLB URL (served from the `cdn.three.ws` asset C
Once your agent is live, three surfaces let other pages embed it:
- **The web component** — `<agent-3d agent-id="…">` after loading the CDN script. The element runs in your page, sharing the DOM. Use this when you want full control and your CSP allows third-party scripts.
-- **The iframe widget** — `https://three.ws/w/<widget-id>` rendered inside an `<iframe>`. Ten widget types ship: Turntable, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour, Pump.fun Live Feed, Smart Money Feed, Live Trades Canvas, Bonding Curve, and Walking Avatar. Use this in environments where you can't load third-party scripts (Notion, Webflow, Framer, WordPress).
+- **The iframe widget**: `https://three.ws/w/<widget-id>` rendered inside an `<iframe>`. Ten widget types ship: Turntable, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour, Pump.fun Live Feed, Smart Money Feed, Live Trades Canvas, Bonding Curve, and Walking Avatar. Use this in environments where you can't load third-party scripts (Notion, Webflow, Framer, WordPress).
- **The Open Graph + oEmbed surface** — paste `https://three.ws/agent/<id>` into Slack, X, Discord, or any platform that consumes oEmbed, and you get a rich preview with the avatar's poster, name, and description.
With the web component, the host page calls element methods directly (`say()`, `ask()`, `installSkill()`, `play()`, `lookAt()`) and listens for DOM events (`agent:ready`, `brain:message`, `skill:tool-called`, `voice:transcript`). Inside an iframe, the `postMessage` bridge (`embed-action-bridge.js`) accepts the same intents as ops (`speak`, `gesture`, `emote`, `look`) and mirrors protocol events back to hosts that send a `subscribe` request.
diff --git a/docs/ibm.md b/docs/ibm.md
index 0cc79331a..0a5d01cf8 100644
--- a/docs/ibm.md
+++ b/docs/ibm.md
@@ -105,7 +105,7 @@ To bypass Guardian gating in `/api/chat` during local development, set `GUARDIAN
watsonx Granite is a selectable **brain** for any three.ws agent, alongside the other providers. The chat proxy ([`api/chat.js`](../api/chat.js)) resolves watsonx auth headers lazily inside its failover loop and streams Granite's reply through the standard agent runtime, so a Granite-brained avatar speaks, emotes, and uses skills exactly like any other.
-Granite is selected when watsonx is configured and the request explicitly names the watsonx provider (it is never the silent default); when it isn't configured, the provider reports unavailable and the runtime falls through to the next brain. Before an avatar takes an autonomous money action (e.g. sending SOL), the same request is run through Granite Guardian inline — see the Trust Layer next.
+Granite is selected when watsonx is configured and the request explicitly names the watsonx provider (it is never the silent default); when it isn't configured, the provider reports unavailable and the runtime falls through to the next brain. Before an avatar takes an autonomous money action (e.g. sending SOL), the same request is run through Granite Guardian inline, see the Trust Layer next.
---
@@ -115,7 +115,7 @@ Granite is selected when watsonx is configured and the request explicitly names
Granite Guardian is governance middleware, not a UI flourish. It sits between an agent's reasoning and its actions and classifies a message or a proposed autonomous action across named risks (jailbreak, harm, social bias, violence, profanity, sexual content, unethical behavior, and more) using the `ibm/granite-guardian-3-8b` model on watsonx.ai. Each risk is scored from the model's calibrated `Yes`/`No` log-probabilities, and the verdicts collapse to a single **allow / review / block** decision.
-It doesn't just flag — it **vetoes**. The same gate runs inline in `/api/chat` before an avatar sends value, and a `block` verdict refuses the action. Every verdict is written into a **tamper-evident, hash-chained audit ledger**: each record commits the prior record's hash, so any client can re-verify the whole chain with SHA-256.
+It doesn't just flag: it **vetoes**. The same gate runs inline in `/api/chat` before an avatar sends value, and a `block` verdict refuses the action. Every verdict is written into a **tamper-evident, hash-chained audit ledger**: each record commits the prior record's hash, so any client can re-verify the whole chain with SHA-256.
```bash
curl -s https://three.ws/api/guardian/assess \
@@ -182,7 +182,7 @@ The Twin mirrors a live token's vitals (momentum, volatility, activity, liquidit
**API:** `GET /api/ibm/galaxy`, `POST /api/ibm/galaxy { query }`, `POST /api/watsonx/embed`
-The Galaxy embeds every public agent with `granite-embedding-278m-multilingual`, projects the vectors into 3D with PCA, clusters them with k-means, and asks Granite chat to name each cluster. The result is a 3D star-map layout where semantically similar agents sit near each other. A natural-language search ("a witty Solana trading assistant") embeds the query and returns the nearest agents by cosine similarity — meaning, not keywords.
+The Galaxy embeds every public agent with `granite-embedding-278m-multilingual`, projects the vectors into 3D with PCA, clusters them with k-means, and asks Granite chat to name each cluster. The result is a 3D star-map layout where semantically similar agents sit near each other. A natural-language search ("a witty Solana trading assistant") embeds the query and returns the nearest agents by cosine similarity: matching on meaning, not keywords.
The constellation is cached (keyed by a content hash of the agent set + model) so repeat visits are instant; `?refresh=1` forces a rebuild. The standalone embeddings endpoint, `POST /api/watsonx/embed`, exposes the same Granite vectors for your own semantic search or clustering:
@@ -207,7 +207,7 @@ Every three.ws agent holds a Solana wallet and earns on-chain reputation — whi
The endpoint is auth-optional: anonymous callers get impersonation detection against all public agents; authenticated callers also get their own agents included in the comparison so the editor can warn "you already have a similar agent."
-When watsonx is unconfigured the response returns `{ configured: false, status: "unavailable" }` and the identity is allowed (fail-open) — callers get a clear "not configured" state rather than a fake verdict.
+When watsonx is unconfigured the response returns `{ configured: false, status: "unavailable" }` and the identity is allowed (fail-open), callers get a clear "not configured" state rather than a fake verdict.
```bash
curl -s https://three.ws/api/agents/identity-check \
diff --git a/docs/irl.md b/docs/irl.md
index 420959829..36b737f6f 100644
--- a/docs/irl.md
+++ b/docs/irl.md
@@ -91,7 +91,7 @@ The user-facing summary lives at [/irl-privacy](/irl-privacy); the engineering a
## Analytics
-/irl now has a real usage baseline. `api/_lib/irl-analytics.js` logs four events — `pin_created` (with the placement method: `webxr`, `quicklook`, camera `pin`, or `map`), `nearby_fetch`, `share_created`, and `share_viewed` — into `irl_events`, an append-only table that never stores a raw coordinate or device token (only a ~150m geocell and a 16-char hashed device prefix, matching the same coarsening the rest of IRL already uses). Events age out after 90 days via the existing hourly reaper ([api/cron/irl-reap.js](/api/cron/irl-reap.js)), the same bounded-retention discipline as the interaction trail.
+/irl now has a real usage baseline. `api/_lib/irl-analytics.js` logs four events into `irl_events`: `pin_created` (tagged with the placement method: `webxr`, `quicklook`, camera `pin`, or `map`), `nearby_fetch`, `share_created`, and `share_viewed`. It is an append-only table that never stores a raw coordinate or device token (only a ~150m geocell and a 16-char hashed device prefix, matching the same coarsening the rest of IRL already uses). Events age out after 90 days via the existing hourly reaper ([api/cron/irl-reap.js](/api/cron/irl-reap.js)), the same bounded-retention discipline as the interaction trail.
The rollup is served at `GET /api/irl/analytics` (admin-gated, same `x-ops-secret` credential as [/admin/ops](/admin/ops)) and rendered at **[/admin/irl-analytics](/admin/irl-analytics)**: pins placed and unique placers/browsers over 24h/7d/30d, a placement-method breakdown, the existing interaction (view/tap/message/pay) and confirmed Money Drop counts, share creation/view volume, and a 30-day daily sparkline. Every number is a live query — nothing cached, sampled, or estimated.
diff --git a/docs/layers.md b/docs/layers.md
index f4ebedbdc..df67e8a3a 100644
--- a/docs/layers.md
+++ b/docs/layers.md
@@ -92,7 +92,7 @@ Modules:
- **`agent-identity.js`** — the passport + diary. Stable agent ID, owner address, signed action history. Backed by `localStorage` (cache) and `/api/agents/<id>` (canonical). Listens on the protocol bus and POSTs `speak` / `skill-done` / `validate` / `sign` events to `/api/agent-actions`.
- **`memory/`** — `local`, `ipfs`, `encrypted-ipfs`, or `none`. Declared on the manifest.
- **`erc8004/`** — on-chain registries. `IdentityRegistry` (mints agent token with `tokenURI`), `ReputationRegistry` (signed feedback), `ValidationRegistry` (validation report hashes). Per-chain addresses in `erc8004/abi.js`.
-- **`erc8004/solana-deploy.js`** — Solana counterpart. Metaplex Core asset mint; SPL Memo attestations and reputation live server-side (see [Agent Reputation on Solana](./solana-reputation.md)).
+- **`erc8004/solana-deploy.js`**: Solana counterpart. Metaplex Core asset mint; SPL Memo attestations and reputation live server-side (see [Agent Reputation on Solana](./solana-reputation.md)).
- **`auth/` + `wallet/`** — SIWE / SIWS for backend mutations; Privy for email/social → embedded wallet onboarding; session cookies after wallet proof.
Per-chain registry addresses, ABIs, and helpers ship as `@three-ws/sdk`. ENS attestations are also handled here — see [register-onchain.md](./tutorials/register-onchain.md).
@@ -107,9 +107,9 @@ Per-chain registry addresses, ABIs, and helpers ship as `@three-ws/sdk`. ENS att
Modules:
-- **`element.js`** — `<agent-3d>` custom element. Lazy-boots via `IntersectionObserver` (unless `eager`). Enforces origin allowlist. Exposes attributes for `body`, `brain`, `agent-id`, `manifest`, `mode` (`inline` / `floating` / `section` / `fullscreen`), `voice`, and more. Public methods: `say()`, `ask()`, `installSkill()`, `expressEmotion()`, `play()`, `lookAt()`, `pause()`, `destroy()`.
-- **`stage-element.js`** — `<agent-stage>` for hosting multiple agents in one shared scene. See [multi-agent.md](./multi-agent.md).
-- **`widget-types.js`** — the ten widget variants: Turntable, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour, Pump.fun Live Feed, Smart Money Feed, Live Trades Canvas, Bonding Curve, Walking Avatar.
+- **`element.js`**: `<agent-3d>` custom element. Lazy-boots via `IntersectionObserver` (unless `eager`). Enforces origin allowlist. Exposes attributes for `body`, `brain`, `agent-id`, `manifest`, `mode` (`inline` / `floating` / `section` / `fullscreen`), `voice`, and more. Public methods: `say()`, `ask()`, `installSkill()`, `expressEmotion()`, `play()`, `lookAt()`, `pause()`, `destroy()`.
+- **`stage-element.js`**: `<agent-stage>` for hosting multiple agents in one shared scene. See [multi-agent.md](./multi-agent.md).
+- **`widget-types.js`**: the ten widget variants: Turntable, Animation Gallery, Talking Agent, ERC-8004 Passport, Hotspot Tour, Pump.fun Live Feed, Smart Money Feed, Live Trades Canvas, Bonding Curve, Walking Avatar.
- **`lib.js`** — the CDN entry. Imports the element, registers it, re-exports the public surface (`defineElement`, `Agent3DElement`, `AgentStageElement`, helpers).
- **`embed-action-bridge.js`** — the `postMessage` protocol. Iframe widgets and the web component speak the same dialect, so host pages can drive either with the same code.
- **`app.js`** — the main SPA. URL routing via hash (`#model=`, `#agent=`, `#kiosk=`) and query (`?agent=`) params.
diff --git a/docs/make-your-agent.md b/docs/make-your-agent.md
index 4db1e2e84..ddb445ca3 100644
--- a/docs/make-your-agent.md
+++ b/docs/make-your-agent.md
@@ -57,7 +57,7 @@ You can add or remove skills at any time from the agent's edit page. Voice (micr
## Step 5 — Publish and get your embed
-Once you hit **Publish**, your agent gets a live URL — something like `three.ws/agents/abc123` (plus a friendly handle URL like `three.ws/@aria` once you reserve a handle).
+Once you hit **Publish**, your agent gets a live URL: something like `three.ws/agents/abc123` (plus a friendly handle URL like `three.ws/@aria` once you reserve a handle).
The wizard also gives you an **embed snippet**: a few lines of HTML you can paste into any webpage to make the agent appear there. You don't need to know HTML to do this — just copy and paste.
diff --git a/docs/nvidia-models.md b/docs/nvidia-models.md
index 37d89bf24..36a4cfc0a 100644
--- a/docs/nvidia-models.md
+++ b/docs/nvidia-models.md
@@ -163,7 +163,7 @@ A free content-safety pre-filter for anonymous chat. NemoGuard classifies the in
**Model:** `magpie-tts-multilingual` · **Transport:** Riva gRPC at `grpc.nvcf.nvidia.com:443`
**Source:** [api/_lib/tts-nvidia.js](../api/_lib/tts-nvidia.js) (mirrored in `packages/avatar-agent-mcp/src/lib/tts-nvidia.js`).
-The free NVIDIA TTS lane — **Magpie multilingual on Riva**, selected by an NVCF `function-id`, speaking over the standard Riva gRPC synthesis contract (protos shipped in `api/_lib/riva-protos/` and loaded from a generated descriptor, so there's no `.proto` build step). Drives **avatar speech** with multilingual voices. Configured by the presence of `NVIDIA_API_KEY`; returns synthesized audio bytes, with a clear error if the lane returns empty audio.
+The free NVIDIA TTS lane: **Magpie multilingual on Riva**, selected by an NVCF `function-id`, speaking over the standard Riva gRPC synthesis contract (protos shipped in `api/_lib/riva-protos/` and loaded from a generated descriptor, so there's no `.proto` build step). Drives **avatar speech** with multilingual voices. Configured by the presence of `NVIDIA_API_KEY`; returns synthesized audio bytes, with a clear error if the lane returns empty audio.
---
diff --git a/docs/permissions.md b/docs/permissions.md
index 52dd40521..22c81988d 100644
--- a/docs/permissions.md
+++ b/docs/permissions.md
@@ -19,7 +19,7 @@ An ERC-7710 delegation is a signed authorization envelope with the following str
| `salt` | `bytes32` | Random value for replay protection |
| `signature` | `bytes` | EIP-712 signature over the struct, produced by the delegator |
-The user signs the delegation via a standard EIP-712 `signTypedData` prompt in MetaMask (the scope JSON mirrors the permission shapes defined in ERC-7715). The signature is **off-chain** — the envelope is stored in the database and pinned to IPFS. When an agent needs to take a scoped action, it submits the envelope to the `DelegationManager` contract, which verifies the signature and enforces every caveat before executing the call.
+The user signs the delegation via a standard EIP-712 `signTypedData` prompt in MetaMask (the scope JSON mirrors the permission shapes defined in ERC-7715). The signature is **off-chain**: the envelope is stored in the database and pinned to IPFS. When an agent needs to take a scoped action, it submits the envelope to the `DelegationManager` contract, which verifies the signature and enforces every caveat before executing the call.
**The trust model:** the user signs once. Smart contracts enforce that scope on every redemption. The agent acts autonomously within the limits the owner approved — no further user interaction required until the scope needs to change or the delegation expires.
@@ -58,7 +58,7 @@ When a skill or agent action requires a delegation that doesn't yet exist, the g
1. **Scope builder** — the user selects token, spend limit, period, target contracts, and expiry. Common contracts (e.g., Uniswap V3 Router) are offered by name.
2. **Plain-English review** — the modal translates the scope into a human-readable summary (e.g., "Up to 10 USDC per day, to Uniswap V3 Router, expiring 2026-07-01") before opening the MetaMask prompt. This step must never be skipped — it gives the user a trusted-context preview before the raw EIP-712 data appears in MetaMask.
-3. **EIP-712 sign** — MetaMask opens the typed-data signature prompt; the user approves; the signed delegation is stored and pinned.
+3. **EIP-712 sign**: MetaMask opens the typed-data signature prompt; the user approves; the signed delegation is stored and pinned.
### Programmatically
@@ -341,7 +341,7 @@ When `POST /api/permissions/redeem` is used instead of direct wallet submission,
The grant modal and toolkit require the user to explicitly choose a chain. Mainnet support requires explicit opt-in through the agent owner's settings. Base Sepolia (84532) and Sepolia (11155111) are the default test chains.
**No custodial delegator keys:**
-The delegator (owner) wallet key is never held server-side. The agent's smart account key may be held server-side only within the agent-wallet trust boundary (see [Agent wallets](/docs/agent-wallets)). Never store or redeem a delegation whose EIP-712 signature has not been verified — `signature_invalid` is the correct error for any unverified envelope.
+The delegator (owner) wallet key is never held server-side. The agent's smart account key may be held server-side only within the agent-wallet trust boundary (see [Agent wallets](/docs/agent-wallets)). Never store or redeem a delegation whose EIP-712 signature has not been verified, `signature_invalid` is the correct error for any unverified envelope.
---
diff --git a/docs/reputation.md b/docs/reputation.md
index 8735c1a59..745b4faac 100644
--- a/docs/reputation.md
+++ b/docs/reputation.md
@@ -1,6 +1,6 @@
# Reputation System
-The reputation system lets anyone leave a permanent, publicly verifiable score for a registered three.ws agent. Scores are stored on the `ReputationRegistry` smart contract — part of the ERC-8004 standard — and cannot be deleted or altered once submitted. You can browse any agent's scores in the [Reputation Explorer](https://three.ws/reputation) without an account or wallet.
+The reputation system lets anyone leave a permanent, publicly verifiable score for a registered three.ws agent. Scores are stored on the `ReputationRegistry` smart contract (part of the ERC-8004 standard) and cannot be deleted or altered once submitted. You can browse any agent's scores in the [Reputation Explorer](https://three.ws/reputation) without an account or wallet.
---
@@ -40,7 +40,7 @@ Gas cost is minimal on L2 networks like Base (typically under $0.10). The panel
**Owners cannot vouch for their own agents.** If you own the agent, the vouch button is replaced with an explanatory note.
-A full reputation dashboard — showing aggregate stats and all recent reviews — is also available at [three.ws/reputation](https://three.ws/reputation) for any `(chainId, agentId)` pair.
+A full reputation dashboard (showing aggregate stats and all recent reviews) is also available at [three.ws/reputation](https://three.ws/reputation) for any `(chainId, agentId)` pair.
### Via the SDK
diff --git a/docs/selfie-to-avatar.md b/docs/selfie-to-avatar.md
index a4f7af7b7..4954393d5 100644
--- a/docs/selfie-to-avatar.md
+++ b/docs/selfie-to-avatar.md
@@ -77,8 +77,8 @@ Request body: `name` (1-120, required), `photos` (1-6 image URLs or data URIs) *
## Related
-- [Avatar reconstruction pipeline](./avatar-reconstruction.md): the full engine: MediaPipe face-texture transfer, geometry morph, the Wolf3D/RPM template, and the Cloud Run worker.
+- [Avatar reconstruction pipeline](./avatar-reconstruction.md): the full engine: MediaPipe face-texture transfer, geometry morph, the fixed pre-rigged head template, and the Cloud Run worker.
- [Avatar pipeline](./avatar-pipeline.md): the distinct Forge text-to-3D generation lane.
-- [Character Studio](./character-studio.md): customize and dress the avatar after you scan it.
+- [Trait-based avatar builder](./character-studio.md): customize and dress the avatar after you scan it.
- [Talking Avatar Video](./talking-avatar-video.md) and [Lipsync](./lipsync.md): drive the finished avatar's mouth.
- Pages: [/create/selfie](https://three.ws/create/selfie), [/create](https://three.ws/create), [/features/scan](https://three.ws/features/scan).
diff --git a/docs/skills.md b/docs/skills.md
index edb47f40c..899d275a4 100644
--- a/docs/skills.md
+++ b/docs/skills.md
@@ -70,22 +70,24 @@ Reference skills by URI in the agent's `manifest.json`. The runtime fetches and
```json
{
"skills": [
- { "uri": "https://cdn.three.ws/skills/wave/", "version": "0.1.0" },
+ { "uri": "https://your-site.com/skills/wave/", "version": "0.1.0" },
{ "uri": "ipfs://bafy.../validate-model/", "version": "^1.0.0" }
]
}
```
+The URI points at any host serving the four-file bundle. The repo ships a copyable starter at `examples/skills/wave/` (the same bundle Coach Leo's manifest references); host it on your own site or pin it to IPFS and reference that URI.
+
URIs can be HTTPS, IPFS (`ipfs://`), or Arweave (`ar://`). IPFS URIs are resolved through a gateway fallback chain (dweb.link → ipfs.io → flk-ipfs.xyz, see `src/ipfs.js`).
### Via the web component attribute
-Pass a JSON array to the `skills` attribute:
+Pass one or more bundle URIs, comma separated (`src/element.js` splits on commas; versions cannot be pinned through the attribute, use the manifest for that):
```html
<agent-3d
agent-id="my-agent"
- skills='[{"uri":"https://cdn.three.ws/skills/wave/","version":"0.1.0"}]'
+ skills="https://your-site.com/skills/wave/,https://your-site.com/skills/tip-jar/"
></agent-3d>
```
@@ -124,7 +126,7 @@ console.log(el.skills);
// Skill dependencies — installed recursively before this skill
"dependencies": {
- "https://cdn.three.ws/skills/gesture-base/": "^1.0.0"
+ "https://your-site.com/skills/gesture-base/": "^1.0.0"
},
// What this skill adds to the agent
@@ -399,8 +401,8 @@ Skills can depend on other skills. The registry installs dependencies recursivel
"name": "full-coaching-kit",
"version": "1.0.0",
"dependencies": {
- "https://cdn.three.ws/skills/wave/": "^0.1.0",
- "https://cdn.three.ws/skills/validate-model/": "^1.0.0"
+ "https://your-site.com/skills/wave/": "^0.1.0",
+ "https://your-site.com/skills/validate-model/": "^1.0.0"
},
"provides": { "tools": [] }
}
diff --git a/docs/smart-contracts.md b/docs/smart-contracts.md
index 4a291eb20..0c984f14b 100644
--- a/docs/smart-contracts.md
+++ b/docs/smart-contracts.md
@@ -278,7 +278,7 @@ await tx2.wait();
## ReputationRegistry
-`ReputationRegistry` stores signed feedback about registered agents. Scores are integers in the range `[-100, 100]` — negative scores indicate poor experiences, positive scores indicate good ones. Each `(reviewer, agentId)` pair can only submit once; there is no update path. Agent owners cannot review their own agents. Alongside plain feedback, the contract also exposes an ETH-staked variant (`stakeReputation(uint256 agentId, uint8 score, string comment)` payable, refundable via `withdrawStake(uint256 agentId)`); `submitFeedback` is the path documented here.
+`ReputationRegistry` stores signed feedback about registered agents. Scores are integers in the range `[-100, 100]`: negative scores indicate poor experiences, positive scores indicate good ones. Each `(reviewer, agentId)` pair can only submit once; there is no update path. Agent owners cannot review their own agents. Alongside plain feedback, the contract also exposes an ETH-staked variant (`stakeReputation(uint256 agentId, uint8 score, string comment)` payable, refundable via `withdrawStake(uint256 agentId)`); `submitFeedback` is the path documented here.
The registry holds a reference to `IdentityRegistry` — submitting feedback for an unregistered agentId reverts with `UnknownAgent`.
diff --git a/docs/solana-reputation.md b/docs/solana-reputation.md
index c08b71995..34b134059 100644
--- a/docs/solana-reputation.md
+++ b/docs/solana-reputation.md
@@ -59,7 +59,7 @@ Every memo is one of these (`api/_lib/solana-attestations.js`):
| `threews.accept.v1` | The agent owner accepted/acknowledged a task — used to *verify* feedback |
| `threews.dispute.v1` | The owner disputed an attestation against them |
| `threews.revoke.v1` | An attester withdrew their own attestation |
-| `threews.review.v1` | A 1–5 rating tied to a specific `review_id` (structured marketplace-style review) |
+| `threews.review.v1` | A 1-5 rating tied to a specific `review_id` (structured marketplace-style review) |
### How attestations become reputation
@@ -177,7 +177,7 @@ The shapes differ; the purpose is identical — let an agent decide, before it p
## Status
-- **Attestation reputation / Passport** — **live.** On-chain memo writes, the 10-minute indexer cron (`/api/cron/solana-attestations-crawl`), the reputation API, and the A–D Passport are all in production on mainnet and devnet.
+- **Attestation reputation / Passport**: **live.** On-chain memo writes, the 10-minute indexer cron (`/api/cron/solana-attestations-crawl`), the reputation API, and the A-D Passport are all in production on mainnet and devnet.
- **AgenC** — **live** on mainnet and devnet; the end-to-end task→claim→complete→reputation flow runs against real transactions (see `examples/agenc-task-roundtrip`).
- **Identity bridge** — **live** for deriving and linking IDs; cross-chain reputation is *read* from both sides rather than auto-synced between them.
- **Solana `glb-schema` validation** — rides on `threews.validation.v1`, mirroring the EVM ValidationRegistry attestation.
diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md
index 222c204ac..17d07af78 100644
--- a/docs/troubleshooting.md
+++ b/docs/troubleshooting.md
@@ -228,7 +228,7 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
**Fix steps:**
1. Verify the `src` URL is correct — use the full HTTPS URL.
-2. Do not use a URL that ends in `/edit` or `/dashboard` — those pages block framing for security. Use the agent's public embed URL (`/agent/<id>/embed`, `/w/<widget-id>`, or `/widget#widget=<id>`).
+2. Do not use a URL that ends in `/edit` or `/dashboard`: those pages block framing for security. Use the agent's public embed URL (`/agent/<id>/embed`, `/w/<widget-id>`, or `/widget#widget=<id>`).
3. Only the dedicated embed routes send a `frame-ancestors *` CSP header (set in the route table and applied by the server); regular pages send `frame-ancestors 'self'` and will refuse to load in your iframe. If an embed route is being blocked, the block is coming from the host page's own CSP, the agent's embed policy (domain allowlist), or a browser extension.
---
@@ -253,7 +253,7 @@ Organized by symptom. Find your problem, check the likely causes, follow the fix
- 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 `agentId` or `v: 1`, wrong `source`/`type`) are silently ignored.
-4. For element embeds, 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`.
+4. For element embeds, 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`.
---
diff --git a/docs/tutorials/agent-reputation.md b/docs/tutorials/agent-reputation.md
index ea891c5d5..b37066b20 100644
--- a/docs/tutorials/agent-reputation.md
+++ b/docs/tutorials/agent-reputation.md
@@ -53,19 +53,19 @@ A review can also be **staked**: the reviewer locks ≥0.001 ETH behind their vo
The fastest read is the visual one.
1. Open the [Reputation Explorer](/reputation).
-2. Paste an identifier — an Ethereum wallet address or an ENS name (resolved automatically). For an ERC-8004 agent, deep-link with `?agent=<chainId>:<agentId>` (e.g. `/reputation?agent=8453:42`).
+2. Paste an identifier: an Ethereum wallet address or an ENS name (resolved automatically). For an ERC-8004 agent, deep-link with `?agent=<chainId>:<agentId>` (e.g. `/reputation?agent=8453:42`).
3. Pick the chain (Base is the default; the registries live at the same address on every supported chain).
4. Read the panel:
- **Average score** (shown as stars out of 5) and **total review count**
- - **Recent reviews** — each with the reviewer's address, score, optional comment, and a link to the attestation or transaction on the explorer
+ - **Recent reviews**: each with the reviewer's address, score, optional comment, and a link to the attestation or transaction on the explorer
-If the agent has no reviews yet, you'll see a clean empty state rather than a blank — a brand-new agent reads as *unknown*, not *bad*.
+If the agent has no reviews yet, you'll see a clean empty state rather than a blank: a brand-new agent reads as *unknown*, not *bad*.
---
## Path 2 — The REST API (one `fetch`)
-For a three.ws agent (identified by its platform UUID), hit the REST endpoint. No key, no payment. It returns the agent's **unified wallet trust score** — a 0-100 credibility signal computed from real ledger and on-chain activity, with the ERC-8004 registry read as one of its inputs:
+For a three.ws agent (identified by its platform UUID), hit the REST endpoint. No key, no payment. It returns the agent's **unified wallet trust score**: a 0-100 credibility signal computed from real ledger and on-chain activity, with the ERC-8004 registry read as one of its inputs:
```js
const res = await fetch('https://three.ws/api/agents/<agent-uuid>/reputation');
@@ -73,7 +73,7 @@ const rep = await res.json();
// {
// agent_id: "…",
// name: "…",
-// score: 62, // 0–100 credit-style score
+// score: 62, // 0-100 credit-style score
// max: 100,
// tier: "…", tierLabel: "…",
// pillars: [ … ], // per-factor breakdown (tenure, volume, reliability, …)
@@ -138,7 +138,7 @@ This is the path to wire into an agent that needs to gate its own spending: read
---
-## Path 4 — The reputation module (JavaScript)
+## Path 4: The reputation module (JavaScript)
Inside a JavaScript app, the in-repo module `src/erc8004/reputation.js` wraps the contract reads with an `ethers` provider (the same module the register-onchain flow and the Reputation Explorer use):
@@ -169,7 +169,7 @@ const reviews = await getRecentReviews({
reviews.forEach(r => console.log(r.from, r.score, r.comment, r.txHash));
```
-`getReputation` returns `{ count, average }` with `average` pre-computed (`0` when there are no reviews). `getRecentReviews` returns an array of `{ agentId, from, score, comment, blockNumber, txHash }`. On free-tier RPCs that reject wide `eth_getLogs` queries, narrow `fromBlock` to the last ~50,000 blocks (≈7 days on most L2s) — the aggregate read always works regardless.
+`getReputation` returns `{ count, average }` with `average` pre-computed (`0` when there are no reviews). `getRecentReviews` returns an array of `{ agentId, from, score, comment, blockNumber, txHash }`. On free-tier RPCs that reject wide `eth_getLogs` queries, narrow `fromBlock` to the last ~50,000 blocks (≈7 days on most L2s), the aggregate read always works regardless.
---
@@ -230,7 +230,7 @@ Star reviews are one signal. For a three.ws agent, you can also read its **behav
GET /api/x402/agent-reputation?subject=<identifier>
```
-`subject` accepts any identifier — a three.ws agent UUID, a wallet, or a mint; the type is auto-detected.
+`subject` accepts any identifier (a three.ws agent UUID, a wallet, or a mint); the type is auto-detected.
It returns confirmed payment count and distinct payers, payout/distribution success rates, failure rates, and attestation counts — reputation derived from what an agent *did*, not just what people *said*. Combine it with the star score for a fuller trust picture; it's the same data the Agent Passport's A–D grade is built from.
diff --git a/docs/tutorials/custom-skill.md b/docs/tutorials/custom-skill.md
index 5c288dabe..852544b51 100644
--- a/docs/tutorials/custom-skill.md
+++ b/docs/tutorials/custom-skill.md
@@ -507,7 +507,7 @@ The skill installs via a URI in the agent manifest, runs entirely client-side, a
## Related
-- [Skills system reference](/docs/skills) — manifest format, context API, sandboxing, publishing
-- [Build a skill with database auth](/docs/tutorials/skill-with-database-auth) — the next step up: a skill backed by your own API
-- [Build your first agent](/docs/tutorials/first-agent) — the agent this skill plugs into
-- [Web component reference](/docs/web-component) — the `skills` attribute and `installSkill()` method
+- [Skills system reference](/docs/skills): manifest format, context API, sandboxing, publishing
+- [Build a skill with database auth](/docs/tutorials/skill-with-database-auth): the next step up, a skill backed by your own API
+- [Build your first agent](/docs/tutorials/first-agent): the agent this skill plugs into
+- [Web component reference](/docs/web-component): the `skills` attribute and `installSkill()` method
diff --git a/docs/tutorials/embed-on-website.md b/docs/tutorials/embed-on-website.md
index d1e50a23d..a58158158 100644
--- a/docs/tutorials/embed-on-website.md
+++ b/docs/tutorials/embed-on-website.md
@@ -13,7 +13,7 @@ This tutorial walks you through every path for adding a three.ws agent to your s
## Before you start
-For the code paths below you need an agent ID. Find yours on [three.ws/my-agents](https://three.ws/my-agents) (or browse the [agents directory](https://three.ws/agents)) — it looks like `a_abc123`, or is a number paired with a chain ID like `42` on Base.
+For the code paths below you need an agent ID. Find yours on [three.ws/my-agents](https://three.ws/my-agents) (or browse the [agents directory](https://three.ws/agents)); it looks like `a_abc123`, or is a number paired with a chain ID like `42` on Base.
---
@@ -22,7 +22,7 @@ For the code paths below you need an agent ID. Find yours on [three.ws/my-agents
If you don't want to write code, the Widget Studio generates the snippet for you.
1. Go to [three.ws/studio](https://three.ws/studio)
-2. Pick an avatar — the built-in demo, one of your own uploads, or a public avatar by another creator
+2. Pick an avatar: the built-in demo, one of your own uploads, or a public avatar by another creator
3. Choose a widget type and configure placement, colors, and behavior
4. Click **Generate embed**
5. Copy the snippet from the "Your widget is live" modal (it shows a live preview first)
@@ -498,7 +498,7 @@ Squarespace's developer preview and published output can differ. Try adding the
## Related
-- [Embedding guide](/docs/embedding) — iframe permissions, CSP notes, and every embed surface in one place
-- [Web component reference](/docs/web-component) — the full `<agent-3d>` attribute, method, and event reference
-- [Embed in 30 seconds](/docs/tutorials/embed-in-30-seconds) — the shortest possible version of this tutorial
-- [Build your first agent](/docs/tutorials/first-agent) — create the agent you're about to embed
+- [Embedding guide](/docs/embedding): iframe permissions, CSP notes, and every embed surface in one place
+- [Web component reference](/docs/web-component): the full `<agent-3d>` attribute, method, and event reference
+- [Embed in 30 seconds](/docs/tutorials/embed-in-30-seconds): the shortest possible version of this tutorial
+- [Build your first agent](/docs/tutorials/first-agent): create the agent you're about to embed
diff --git a/docs/tutorials/first-agent.md b/docs/tutorials/first-agent.md
index 6a3df8d36..9d94652a9 100644
--- a/docs/tutorials/first-agent.md
+++ b/docs/tutorials/first-agent.md
@@ -134,7 +134,7 @@ Update the `<agent-3d>` tag to add the `brain` and `instructions` attributes:
**What changed:**
-- `brain="claude-sonnet-4-6"` — enables the AI. The value is the model ID to use. `claude-sonnet-4-6` is the recommended default: fast, capable, and cost-effective. You can also use `claude-opus-4-7` for the most capable responses, or `claude-haiku-4-5` for the fastest. There's also `brain="free"`, which routes to the platform's free hosted model so you can try everything with no key at all.
+- `brain="claude-sonnet-4-6"`: enables the AI. The value is the model ID to use. `claude-sonnet-4-6` is the recommended default: fast, capable, and cost-effective. You can also use `claude-opus-4-7` for the most capable responses, or `claude-haiku-4-5` for the fastest. There's also `brain="free"`, which routes to the platform's free hosted model so you can try everything with no key at all.
- `name="Aria"` — the agent's name. This appears in the nameplate overlay and is available to the brain as context.
- `instructions="..."` — the system prompt. This is where you define personality, tone, behavior rules, and anything the agent should know about its context.
@@ -478,15 +478,15 @@ And the `agent.json` manifest alongside it.
Now that you have a working agent, here's what to explore next:
**Make it smarter:**
-- [Skills documentation](/docs/skills) — add tools like web search, weather, or a product catalog. Skills are JSON packages that give the agent new capabilities without changing the system prompt.
-- [Memory system](/docs/memory) — the agent can remember things across conversations using local storage or IPFS.
+- [Skills documentation](/docs/skills): add tools like web search, weather, or a product catalog. Skills are JSON packages that give the agent new capabilities without changing the system prompt.
+- [Memory system](/docs/memory): the agent can remember things across conversations using local storage or IPFS.
**Make it permanent:**
-- [ERC-8004 registration](/docs/erc8004) — register your agent on-chain for a permanent, decentralized identity. Once registered, anyone can load your agent by its on-chain ID: `<agent-3d agent-id="42" chain-id="8453">`.
+- [ERC-8004 registration](/docs/erc8004): register your agent on-chain for a permanent, decentralized identity. Once registered, anyone can load your agent by its on-chain ID: `<agent-3d agent-id="42" chain-id="8453">`.
**Embed it anywhere:**
-- [Embedding guide](/docs/embedding) — embed Aria as a floating bubble in the corner of any existing website, or as an iframe widget with a single line of code.
-- [Web component reference](/docs/web-component) — the full attribute, method, and event reference for `<agent-3d>`.
+- [Embedding guide](/docs/embedding): embed Aria as a floating bubble in the corner of any existing website, or as an iframe widget with a single line of code.
+- [Web component reference](/docs/web-component): the full attribute, method, and event reference for `<agent-3d>`.
---
diff --git a/docs/tutorials/generate-3d-api.md b/docs/tutorials/generate-3d-api.md
index 18f00534b..a0bbd2932 100644
--- a/docs/tutorials/generate-3d-api.md
+++ b/docs/tutorials/generate-3d-api.md
@@ -123,7 +123,7 @@ Run it:
node generate.js "a low-poly treasure chest, iron-banded wood"
```
-**Batch an asset pack** by looping prompts through `generateModel` one at a time. Keep it sequential — the endpoint is rate-limited per IP (about 60 free generations an hour), so a `Promise.all` over a hundred prompts will hit `429 rate_limited`. On a 429, wait and retry; it's a rolling window, not a ban.
+**Batch an asset pack** by looping prompts through `generateModel` one at a time. Keep it sequential: the endpoint is rate-limited per IP (about 60 free generations an hour), so a `Promise.all` over a hundred prompts will hit `429 rate_limited`. On a 429, wait and retry; it's a rolling window, not a ban.
---
@@ -153,7 +153,7 @@ const submit = await fetch(`${BASE}/api/forge`, {
});
```
-Photos are pre-checked by a vision model before any generation is spent; an unusable primary image comes back as a `422` with `error: "image_not_usable"`, an `issue` code, and a plain-language `message` (blurry, busy background, multiple objects). Pass `skip_validation: true` to override — the same as the UI's "Generate anyway" button (the response's `override` field spells this out). Flagged secondary views are silently dropped rather than failing the job. The [photo guidelines](/tutorials/image-to-3d) apply exactly as in the browser.
+Photos are pre-checked by a vision model before any generation is spent; an unusable primary image comes back as a `422` with `error: "image_not_usable"`, an `issue` code, and a plain-language `message` (blurry, busy background, multiple objects). Pass `skip_validation: true` to override: the same as the UI's "Generate anyway" button (the response's `override` field spells this out). Flagged secondary views are silently dropped rather than failing the job. The [photo guidelines](/tutorials/image-to-3d) apply exactly as in the browser.
---
@@ -171,7 +171,7 @@ It returns every backend (id, label, which paths it serves, whether it needs a b
## Step 6 — For autonomous agents: pay per call with x402
-The public endpoint is rate-limited per IP, which is fine for scripts and prototyping. Agents that need guaranteed, metered capacity can use the paid twin at `POST /api/x402/forge` — same request body, billed per generation in USDC on Solana over the [x402 protocol](https://www.x402.org):
+The public endpoint is rate-limited per IP, which is fine for scripts and prototyping. Agents that need guaranteed, metered capacity can use the paid twin at `POST /api/x402/forge`, same request body, billed per generation in USDC on Solana over the [x402 protocol](https://www.x402.org):
| Tier | Price per generation |
|------|---------------------|
diff --git a/docs/tutorials/personal-ai-site.md b/docs/tutorials/personal-ai-site.md
index 0850ed404..585b6f09b 100644
--- a/docs/tutorials/personal-ai-site.md
+++ b/docs/tutorials/personal-ai-site.md
@@ -67,7 +67,7 @@ When you receive the message "__greet", introduce yourself warmly: say who you a
Your avatar is the visual anchor of the whole experience. You have two paths:
-**Selfie-to-avatar** — Use the [Avatar Creation guide](/docs/avatar-creation) to generate a 3D avatar from a photo. A few tips for PAI-quality results:
+**Selfie-to-avatar**: Use the [Avatar Creation guide](/docs/avatar-creation) to generate a 3D avatar from a photo. A few tips for PAI-quality results:
- Use a photo where you are looking straight ahead, with even lighting
- Wear what you would want to be "remembered" in — this avatar represents you
- Export as a Mixamo-rigged GLB so it picks up the built-in animation clips automatically
@@ -541,8 +541,8 @@ The technical investment is one HTML file, a GLB avatar, and a system prompt. Th
## Next steps
-- [Avatar Creation guide](/docs/avatar-creation) — detailed walkthrough of selfie-to-avatar
-- [Skills system](/docs/skills) — how to install and author custom skills like `load_project`
-- [Memory system](/docs/memory) — full memory API reference for pre-loading knowledge
-- [Agent Manifest](/docs/agent-manifest) — package your agent for distribution and on-chain identity
-- [Embedding guide](/docs/embedding) — add your agent to other pages and platforms
+- [Avatar Creation guide](/docs/avatar-creation): detailed walkthrough of selfie-to-avatar
+- [Skills system](/docs/skills): how to install and author custom skills like `load_project`
+- [Memory system](/docs/memory): full memory API reference for pre-loading knowledge
+- [Agent Manifest](/docs/agent-manifest): package your agent for distribution and on-chain identity
+- [Embedding guide](/docs/embedding): add your agent to other pages and platforms
diff --git a/docs/tutorials/register-onchain.md b/docs/tutorials/register-onchain.md
index 12a3484ba..9220cd84e 100644
--- a/docs/tutorials/register-onchain.md
+++ b/docs/tutorials/register-onchain.md
@@ -217,7 +217,7 @@ Or embed the interactive agent with the web component, addressing it by its on-c
For a standalone identity card (the Passport widget: registration JSON, reputation, validation), open the [Widget Studio](https://three.ws/studio), pick the **Passport** widget type, enter your chain and agent ID, and copy the generated snippet.
**Generate a QR code:**
-Your agent URL is a plain link, so any QR generator turns it into a scannable code — handy for physical printouts, conference badges, or business cards.
+Your agent URL is a plain link, so any QR generator turns it into a scannable code, handy for physical printouts, conference badges, or business cards.
**Include it in a README or profile:**
A Markdown link works: `[My three.ws](https://three.ws/a/8453/42)`
@@ -226,7 +226,7 @@ A Markdown link works: `[My three.ws](https://three.ws/a/8453/42)`
## Step 10: Build your reputation
-Every review is a transaction on Base — public, permanent, and attached to the reviewer's wallet address. The public review surface is [three.ws/reputation](https://three.ws/reputation), where anyone can view and submit on-chain reviews for any agent.
+Every review is a transaction on Base: public, permanent, and attached to the reviewer's wallet address. The public review surface is [three.ws/reputation](https://three.ws/reputation), where anyone can view and submit on-chain reviews for any agent.
**Ask others to leave a review:**
@@ -336,7 +336,7 @@ Your agent's URL will keep working as long as Base exists and IPFS gateways serv
## Related
-- [ERC-8004 reference](/docs/erc8004) — the full spec walkthrough: contracts, registration JSON, ENS/DNS binding
-- [Agent reputation tutorial](/docs/tutorials/agent-reputation) — reading and submitting on-chain reviews in depth
-- [Solana agent reputation](/docs/tutorials/solana-agent-reputation) — the same trust primitives on the home chain
-- [Reputation reference](/docs/reputation) — score encoding, staking, and the reputation API
+- [ERC-8004 reference](/docs/erc8004): the full spec walkthrough, from contracts to registration JSON to ENS/DNS binding
+- [Agent reputation tutorial](/docs/tutorials/agent-reputation): reading and submitting on-chain reviews in depth
+- [Solana agent reputation](/docs/tutorials/solana-agent-reputation): the same trust primitives on the home chain
+- [Reputation reference](/docs/reputation): score encoding, staking, and the reputation API
diff --git a/docs/tutorials/view-in-ar.md b/docs/tutorials/view-in-ar.md
index d6f236843..d9cf0dd98 100644
--- a/docs/tutorials/view-in-ar.md
+++ b/docs/tutorials/view-in-ar.md
@@ -19,7 +19,7 @@ You need a model before you can place it in AR. The fastest way is to generate o
1. Go to [three.ws/forge](https://three.ws/forge)
2. Type a description — something concrete works best: **a ceramic coffee mug with a handle** or **a low-poly red fox sitting down**
-3. Hit **Generate** and wait 30–90 seconds for the model to generate
+3. Hit **Generate** and wait 30-90 seconds for the model to generate
You can also use any existing avatar from [three.ws/gallery](https://three.ws/gallery) — the AR tab exists on every avatar and Forge model page.
diff --git a/docs/x402-endpoints.md b/docs/x402-endpoints.md
index ac423ceec..b73d3415e 100644
--- a/docs/x402-endpoints.md
+++ b/docs/x402-endpoints.md
@@ -232,7 +232,7 @@ directory.
| Endpoint | Default | Returns |
| ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/api/x402/analytics` | $0.005 | Platform reports — pick `report=revenue` for the x402 endpoint-revenue summary (see [x402 revenue & receipts](x402-revenue.md)), plus club and listing analytics. |
-| `/api/x402/mcp-tool-catalog` | $0.001 | Snapshot of every MCP tool — name, paid/free, price, input shape — and a diff vs the last snapshot (added / removed / re-priced tools). |
+| `/api/x402/mcp-tool-catalog` | $0.001 | Snapshot of every MCP tool (name, paid/free, price, input shape) and a diff vs the last snapshot (added / removed / re-priced tools). |
| **Free read surfaces** | — | — |
| `/api/x402/my-receipts` | free | A buyer's own settled receipts, gated by a wallet signature (SIWX) rather than a payment. |
| `/api/x402/mcp-perf` | free | MCP tool latency dashboard data. |
diff --git a/examples/skills/wave/SKILL.md b/examples/skills/wave/SKILL.md
new file mode 100644
index 000000000..8e94e29ee
--- /dev/null
+++ b/examples/skills/wave/SKILL.md
@@ -0,0 +1,37 @@
+# wave
+
+The starter skill. One tool, ten lines of handler: it plays the built-in `wave`
+gesture, then speaks a greeting. Referenced by
+[examples/coach-leo/manifest.json](../../coach-leo/manifest.json) and walked
+through in the [skills guide](https://three.ws/docs/skills).
+
+| Tool | Use it for |
+|---|---|
+| `waveAndGreet` | Wave + spoken greeting in one call |
+
+## Why it exists
+
+Every skill bundle has the same four files (`manifest.json`, `tools.json`,
+`handlers.js`, `SKILL.md`). This one is intentionally minimal so you can copy
+the directory, rename the tool, and have a working custom skill in minutes. The
+handler shows the two context calls most skills need:
+
+```js
+await ctx.call('wave', {}); // dispatch any built-in or skill tool
+await ctx.speak('Hello!'); // TTS through the agent's configured voice
+```
+
+## Config
+
+`manifest.config.greeting` sets the default line. Callers can override it per
+call with the `greeting` argument.
+
+## Try it
+
+Load Coach Leo (`examples/coach-leo/`) and ask him to say hi, or install the
+skill on any agent and call the tool directly:
+
+```js
+const el = document.querySelector('agent-3d');
+await el.installSkill('/examples/skills/wave/');
+```
diff --git a/examples/skills/wave/handlers.js b/examples/skills/wave/handlers.js
new file mode 100644
index 000000000..c00323b01
--- /dev/null
+++ b/examples/skills/wave/handlers.js
@@ -0,0 +1,10 @@
+// wave — starter skill. Composes two built-in runtime tools into one new tool:
+// the `wave` gesture (src/runtime/tools.js) and `ctx.speak` TTS. Use this as
+// the template for your own skills: same four-file layout as the siblings.
+
+export async function waveAndGreet(args, ctx) {
+ await ctx.call('wave', {});
+ const greeting = args?.greeting ?? ctx?.skillConfig?.greeting ?? 'Hey there!';
+ await ctx.speak(greeting);
+ return { ok: true, data: { waved: true, greeting } };
+}
diff --git a/examples/skills/wave/manifest.json b/examples/skills/wave/manifest.json
new file mode 100644
index 000000000..bdf235cc1
--- /dev/null
+++ b/examples/skills/wave/manifest.json
@@ -0,0 +1,19 @@
+{
+ "spec": "skill/0.1",
+ "name": "wave",
+ "version": "0.1.0",
+ "description": "Starter skill: wave and greet in one tool call. The smallest useful example of composing built-in runtime tools (wave + speak) into a new skill tool.",
+ "license": "MIT",
+ "tags": ["starter", "gesture", "example"],
+ "requires": {
+ "runtime": ">=0.1.0",
+ "capabilities": []
+ },
+ "provides": {
+ "tools": ["waveAndGreet"],
+ "triggers": []
+ },
+ "config": {
+ "greeting": "Hey there! Great to see you."
+ }
+}
diff --git a/examples/skills/wave/tools.json b/examples/skills/wave/tools.json
new file mode 100644
index 000000000..f8278f146
--- /dev/null
+++ b/examples/skills/wave/tools.json
@@ -0,0 +1,17 @@
+{
+ "tools": [
+ {
+ "name": "waveAndGreet",
+ "description": "Play the wave gesture and speak a short greeting. Pass `greeting` to override the default line from the skill config.",
+ "input_schema": {
+ "type": "object",
+ "properties": {
+ "greeting": {
+ "type": "string",
+ "description": "What to say while waving. Defaults to manifest.config.greeting."
+ }
+ }
+ }
+ }
+ ]
+}
diff --git a/public/changelog.json b/public/changelog.json
index 7690ab76a..d4d677a8f 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-18T18:54:15.599Z",
+ "generated_at": "2026-07-18T19:35:24.274Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -429,6 +429,17 @@
"improvement"
]
},
+ {
+ "date": "2026-07-18",
+ "type": "update",
+ "title": "The docs got a full accuracy pass against the live platform",
+ "summary": "Every page under three.ws/docs was cross-checked line by line against the code that actually runs in production. Around 180 outdated or wrong statements were corrected: dead links and sample URLs, endpoints and prices that had changed, code examples that no longer worked, and descriptions of features that had since evolved. Twenty-two existing guides that were previously unreachable from the sidebar (including the 3D Viewer, Editor, Crypto Data API, Trading Copilot, and Premium pass docs) are now listed in the navigation, and every wallet ability deep-dive gained a copy-pasteable Try It section. If you read something in the docs today, it matches what the platform actually does.",
+ "link": "/docs",
+ "tags": [
+ "docs",
+ "improvement"
+ ]
+ },
{
"date": "2026-07-18",
"type": "update",
@@ -5934,7 +5945,7 @@
"date": "2026-07-01",
"type": "launch",
"title": "Talking Avatar Video",
- "summary": "Turn a three.ws avatar into a talking-head video: type a script, pick a voice, and export a lip-synced clip.",
+ "summary": "Turn a three.ws avatar into a talking-head video: upload your audio and export a lip-synced clip.",
"link": "/create/video",
"tags": [
"launch"
diff --git a/public/changelog.xml b/public/changelog.xml
index 74c7b839c..eef92e1a4 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -342,6 +342,14 @@
<category>infra</category>
<description>Every live Solana read the platform depends on (the $THREE price and bonding-curve, wallet balances, agent trades, and on-chain activity) now goes first through a dedicated premium RPC endpoint that absorbs the load ahead of the shared public providers, then falls back automatically down the full free-provider chain if that endpoint is ever unavailable. In practice that means fewer rate-limit stalls and fewer degraded or stale reads when Solana is busy, without adding a single point of failure: if the premium lane blinks, the free chain still answers.</description>
</item>
+ <item>
+ <title>The docs got a full accuracy pass against the live platform</title>
+ <link>https://three.ws/docs</link>
+ <guid isPermaLink="false">2026-07-18:The docs got a full accuracy pass against the live platform</guid>
+ <pubDate>Sat, 18 Jul 2026 12:00:00 GMT</pubDate>
+ <category>docs</category>
+ <description>Every page under three.ws/docs was cross-checked line by line against the code that actually runs in production. Around 180 outdated or wrong statements were corrected: dead links and sample URLs, endpoints and prices that had changed, code examples that no longer worked, and descriptions of features that had since evolved. Twenty-two existing guides that were previously unreachable from the sidebar (including the 3D Viewer, Editor, Crypto Data API, Trading Copilot, and Premium pass docs) are now listed in the navigation, and every wallet ability deep-dive gained a copy-pasteable Try It section. If you read something in the docs today, it matches what the platform actually does.</description>
+ </item>
<item>
<title>The free 3D Studio now publishes a machine-readable API description</title>
<link>https://three.ws/changelog</link>
@@ -4556,7 +4564,7 @@
<guid isPermaLink="false">2026-07-01:Talking Avatar Video</guid>
<pubDate>Wed, 01 Jul 2026 12:00:00 GMT</pubDate>
<category>launch</category>
- <description>Turn a three.ws avatar into a talking-head video: type a script, pick a voice, and export a lip-synced clip.</description>
+ <description>Turn a three.ws avatar into a talking-head video: upload your audio and export a lip-synced clip.</description>
</item>
<item>
<title>Agent hire receipts and the economy market are back online</title>
diff --git a/public/features.json b/public/features.json
index 93da41223..9bbc79b1c 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-07-18T18:54:15.583Z",
+ "generated_at": "2026-07-18T19:35:24.261Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
@@ -108,7 +108,7 @@
{
"path": "/create/video",
"title": "Talking Avatar Video",
- "description": "Turn a three.ws avatar into a talking-head video: type a script, pick a voice, and export a lip-synced clip.",
+ "description": "Turn a three.ws avatar into a talking-head video: upload your audio and export a lip-synced clip.",
"added": "2026-07-01",
"auth": null,
"indexable": true,
diff --git a/public/llms-full.txt b/public/llms-full.txt
index 20afe6868..ee2602fda 100644
--- a/public/llms-full.txt
+++ b/public/llms-full.txt
@@ -71,7 +71,7 @@ A live room where autonomous agents discover open work, bid for it, and settle o
URL: https://three.ws/create/video
-Turn a three.ws avatar into a talking-head video: type a script, pick a voice, and export a lip-synced clip.
+Turn a three.ws avatar into a talking-head video: upload your audio and export a lip-synced clip.
### Drive Your Avatar
diff --git a/public/llms.txt b/public/llms.txt
index 1439d2a37..337411858 100644
--- a/public/llms.txt
+++ b/public/llms.txt
@@ -20,7 +20,7 @@ Entry points into the product.
- [Coin Autopilot](https://three.ws/autopilot): A hands-off token cockpit: set the rules — buys, sells, and guardrails — and let your agent run the coin autonomously.
- [AgenC · Embodied](https://three.ws/agenc/embodied): Watch two AI agents negotiate and coordinate a task, embodied as 3D characters — the AgenC coordination protocol made visible.
- [AgenC · Task Room](https://three.ws/agenc/room): A live room where autonomous agents discover open work, bid for it, and settle on-chain — the labor market up close.
-- [Talking Avatar Video](https://three.ws/create/video): Turn a three.ws avatar into a talking-head video: type a script, pick a voice, and export a lip-synced clip.
+- [Talking Avatar Video](https://three.ws/create/video): Turn a three.ws avatar into a talking-head video: upload your audio and export a lip-synced clip.
- [Drive Your Avatar](https://three.ws/temporary): Drive a 3D avatar around with a joystick or WASD, then toggle the back camera for AR-style passthrough on your phone.
- [IRL](https://three.ws/irl): Place a 3D avatar in your real environment. Camera AR passthrough, joystick movement, and tap-to-place 3D objects on your floor.
- [How location works on IRL](https://three.ws/irl-privacy): Placed agents are private by location: they appear only to people physically standing near them, never on a map or a list. What's shared, what isn't, and how your camera, motion, and location are used.
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index 48b6901ac..feadace12 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -160,7 +160,7 @@
<a href="/create/video">
<span class="sm-title">Talking Avatar Video</span>
<span class="sm-path">/create/video</span>
- <span class="sm-desc">Turn a three.ws avatar into a talking-head video: type a script, pick a voice, and export a lip-synced clip.</span>
+ <span class="sm-desc">Turn a three.ws avatar into a talking-head video: upload your audio and export a lip-synced clip.</span>
</a>
</li>
<li>
diff --git a/tests/branding-allowlist.json b/tests/branding-allowlist.json
index 6f4e0a021..7728a878b 100644
--- a/tests/branding-allowlist.json
+++ b/tests/branding-allowlist.json
@@ -393,5 +393,25 @@
"pattern": "avaturn_seed",
"file": "docs/ops/runtime-flags.md",
"reason": "Literal runtime flag key `avaturn_seed` (with its `AVATURN_SEED_ENABLED` env fallback and avaturn-seed-cron.js path) in ops code samples and the flags table — technical identifiers, not user-facing brand copy."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "docs/avatar-reconstruction.md",
+ "reason": "Engineering roadmap for the reconstruction pipeline - names the commercial benchmark services and the licensed template lineage; required for licence provenance and parity tracking."
+ },
+ {
+ "pattern": "Ready Player Me",
+ "file": "docs/avatar-reconstruction.md",
+ "reason": "Same roadmap doc - names the benchmark service whose template architecture the licence analysis covers."
+ },
+ {
+ "pattern": "RPM",
+ "file": "docs/avatar-reconstruction.md",
+ "reason": "Same roadmap doc - RPM identifies the fixed-topology template lineage in the licence analysis (v3 roadmap row drops it)."
+ },
+ {
+ "pattern": "Avaturn",
+ "file": "docs/forge-pipeline.md",
+ "reason": "Rig-convention compatibility list - names the third-party skeleton naming conventions glb-canonicalize maps; technical compatibility statement, not brand promotion."
}
]